moi-computer 0.11.1-next.2 → 0.11.1-next.3

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.
Files changed (222) hide show
  1. package/README.md +2 -2
  2. package/client/app/AppRouter.tsx +2 -2
  3. package/client/app/routes/WorkspaceRoute.tsx +7 -9
  4. package/client/app/shell/SidebarLayout.tsx +18 -15
  5. package/client/components/shared/BottomPanel.tsx +26 -14
  6. package/client/components/shared/PanelHeader.tsx +1 -1
  7. package/client/components/shared/ReorderableList.tsx +7 -2
  8. package/client/components/shared/WorkspaceIcon.tsx +92 -0
  9. package/client/components/ui/alert-dialog.tsx +1 -0
  10. package/client/components/ui/checkbox.tsx +1 -0
  11. package/client/components/ui/inline-input.tsx +84 -0
  12. package/client/components/ui/toast.tsx +2 -2
  13. package/client/features/applets/AppletMount.tsx +1 -1
  14. package/client/features/applets/applet-cache.ts +3 -3
  15. package/client/features/applets/applet-runtime.ts +147 -108
  16. package/client/features/applets/applet-styles.ts +2 -2
  17. package/client/features/applets/applet-thumbnail.ts +6 -8
  18. package/client/features/applets/useApplet.ts +10 -9
  19. package/client/features/chat/ChatPanel.tsx +19 -10
  20. package/client/features/chat/ChatPopup.tsx +7 -2
  21. package/client/features/chat/applet-chat-intents.ts +170 -0
  22. package/client/features/chat/chat-send.ts +103 -62
  23. package/client/features/chat/chat-store.ts +50 -59
  24. package/client/features/chat/composer/ChatComposer.tsx +43 -132
  25. package/client/features/chat/composer/ModelPicker.tsx +1 -1
  26. package/client/features/chat/composer/attachments/AttachmentChip.tsx +99 -0
  27. package/client/features/chat/composer/attachments/DrawingAttachmentChip.tsx +37 -0
  28. package/client/features/chat/composer/attachments/FileAttachmentChip.tsx +22 -0
  29. package/client/features/chat/composer/attachments/TextAttachmentChip.tsx +11 -0
  30. package/client/features/chat/composer/attachments/draft-attachments.ts +168 -0
  31. package/client/features/chat/composer/attachments/types.ts +25 -0
  32. package/client/features/chat/composer/attachments/uploads.ts +26 -0
  33. package/client/features/chat/{chat-connection.ts → connection/chat-connection.ts} +1 -1
  34. package/client/features/chat/{chat-frames.ts → connection/chat-frames.ts} +2 -2
  35. package/client/features/chat/{ChatEmptyState.tsx → messages/ChatEmptyState.tsx} +16 -11
  36. package/client/features/chat/{MarkdownContent.tsx → messages/MarkdownContent.tsx} +16 -1
  37. package/client/features/chat/{TurnView.tsx → messages/TurnView.tsx} +22 -15
  38. package/client/features/chat/{tool-group → messages/tool-group}/SubagentCard.tsx +1 -1
  39. package/client/features/chat/{tool-group → messages/tool-group}/TimelineRow.tsx +2 -2
  40. package/client/features/chat/{tool-group → messages/tool-group}/ToolCallGroup.tsx +1 -1
  41. package/client/features/chat/{ChatSelector.tsx → sessions/ChatSelector.tsx} +3 -3
  42. package/client/features/chat/{api.ts → sessions/api.ts} +1 -1
  43. package/client/features/chat/useChat.ts +32 -15
  44. package/client/features/dev/ChatStatesPage.tsx +5 -6
  45. package/client/features/dev/HarnessDebugPage.tsx +10 -7
  46. package/client/features/dev/ToolCallsPage.tsx +1 -1
  47. package/client/features/dev/UiComponentPreviews.tsx +21 -0
  48. package/client/features/dev/chat-states-fixtures.ts +13 -2
  49. package/client/features/drawings/useChatAnnotation.ts +17 -17
  50. package/client/features/drawings/useDrawingLayer.ts +7 -9
  51. package/client/features/drawings/useViewBuilderSketch.ts +18 -15
  52. package/client/features/home/HomePage.tsx +8 -7
  53. package/client/features/home/WorkspacePreview.tsx +1 -1
  54. package/client/features/home/workspace-presentation.tsx +1 -11
  55. package/client/features/home/workspace-setup/WorkspaceAgentStep.tsx +2 -4
  56. package/client/features/overview/HiddenPanel.tsx +109 -0
  57. package/client/features/overview/Overview.tsx +302 -0
  58. package/client/features/overview/WidgetCanvas.tsx +164 -0
  59. package/client/features/{widgets → overview}/WidgetFrame.tsx +24 -16
  60. package/client/features/overview/WorkspaceName.tsx +60 -0
  61. package/client/features/overview/api.ts +30 -0
  62. package/client/features/overview/default/ViewsWidget.tsx +252 -0
  63. package/client/features/overview/default/registry.tsx +36 -0
  64. package/client/features/{widgets → overview}/grid.ts +36 -0
  65. package/client/features/overview/useGridReconcile.ts +94 -0
  66. package/client/features/scratchpad/Scratchpad.tsx +7 -8
  67. package/client/features/scratchpad/ScratchpadControls.tsx +0 -1
  68. package/client/features/scratchpad/useScratchpadSnapshot.tsx +23 -13
  69. package/client/features/settings/GeneralSettings.tsx +55 -58
  70. package/client/features/settings/SettingsLayout.tsx +2 -2
  71. package/client/features/settings/WorkspaceIconPicker.tsx +318 -0
  72. package/client/features/settings/WorkspaceSettingsDialog.tsx +65 -0
  73. package/client/features/settings/api.ts +48 -24
  74. package/client/features/views/ViewBuilder.tsx +5 -4
  75. package/client/features/views/ViewManager.tsx +11 -13
  76. package/client/features/views/api.ts +36 -2
  77. package/client/features/views/useViewBuilderActions.ts +8 -5
  78. package/client/features/views/useViewBuilderDrafts.ts +23 -21
  79. package/client/features/views/view-presentation.ts +13 -0
  80. package/client/features/workspace/{CustomizePanel.tsx → ThemePanel.tsx} +26 -31
  81. package/client/features/workspace/UnavailablePage.tsx +21 -0
  82. package/client/features/workspace/WorkspaceLayoutContext.tsx +4 -7
  83. package/client/features/workspace/WorkspaceScreen.tsx +205 -161
  84. package/client/features/workspace/WorkspaceSplitLayout.tsx +1 -1
  85. package/client/features/workspace/WorkspaceTabs.tsx +2 -0
  86. package/client/features/workspace/api.ts +0 -26
  87. package/client/features/workspace/moi-context.ts +8 -9
  88. package/client/features/workspace/tab-resolution.ts +10 -33
  89. package/client/features/workspace/useWorkspaceNavigation.ts +164 -101
  90. package/client/index.css +1 -1
  91. package/client/lib/app-icon-registry.ts +2 -0
  92. package/client/lib/use-latest-ref.ts +11 -0
  93. package/client/main.tsx +1 -1
  94. package/client/runtime/useWorkspaceEvents.ts +59 -14
  95. package/client/theme.css +5 -5
  96. package/dist/chunk-1pp135b4.js +1 -0
  97. package/dist/chunk-2gs8jjx4.css +1 -0
  98. package/dist/chunk-94m3q9ce.js +1 -0
  99. package/dist/chunk-azkjzc7a.js +68 -0
  100. package/dist/{chunk-w482ew2c.js → chunk-brr0zbeh.js} +73 -73
  101. package/dist/chunk-m1fvqssh.js +2 -0
  102. package/dist/chunk-p34hvqt3.js +1 -0
  103. package/dist/{chunk-4s15axjs.js → chunk-p83f0jnj.js} +2 -2
  104. package/dist/{chunk-j3wvxjr7.js → chunk-tzz101ea.js} +1 -1
  105. package/dist/chunk-xg01f6pn.js +10 -0
  106. package/dist/{chunk-53a7pxcz.js → chunk-zs4mte79.js} +1 -1
  107. package/dist/index.html +1 -1
  108. package/lib/app-icons.ts +1 -0
  109. package/lib/applet-selector.ts +24 -0
  110. package/lib/chat-title.ts +6 -1
  111. package/lib/default-widgets.ts +32 -0
  112. package/lib/format.ts +12 -1
  113. package/lib/message-attachments.ts +40 -0
  114. package/lib/moi-attachments.ts +204 -0
  115. package/lib/moi-context.ts +20 -35
  116. package/lib/navigation.ts +84 -0
  117. package/lib/types.ts +79 -24
  118. package/lib/workspace-icon.ts +20 -0
  119. package/lib/workspace-layout.ts +22 -2
  120. package/lib/workspace-tabs.ts +9 -33
  121. package/package.json +27 -27
  122. package/registry.json +13 -0
  123. package/server/AGENTS.md +1 -0
  124. package/server/api.ts +114 -37
  125. package/server/applet-typecheck.ts +95 -0
  126. package/server/{bundler → applets}/build-applet.ts +13 -246
  127. package/server/applets/config.ts +226 -0
  128. package/server/applets/dependencies.ts +206 -0
  129. package/server/{applets.ts → applets/index.ts} +15 -161
  130. package/server/applets/runtime/base.ts +4 -0
  131. package/server/applets/runtime/moi.ts +42 -0
  132. package/server/applets/runtime/rpc.ts +17 -0
  133. package/server/applets/view-source.ts +67 -0
  134. package/server/attachment-message.ts +95 -0
  135. package/server/cli.ts +163 -97
  136. package/server/control.ts +63 -42
  137. package/server/harness/README.md +4 -2
  138. package/server/harness/acp/adapter.ts +7 -21
  139. package/server/harness/acp/session.ts +31 -50
  140. package/server/harness/claude-code/NOTES.md +8 -2
  141. package/server/harness/claude-code/adapter.ts +8 -25
  142. package/server/harness/claude-code/index.ts +2 -0
  143. package/server/harness/claude-code/session.ts +42 -47
  144. package/server/harness/claude-code/sessions.ts +9 -4
  145. package/server/harness/codex/adapter.ts +8 -7
  146. package/server/harness/codex/index.ts +1 -0
  147. package/server/harness/codex/permissions.ts +1 -1
  148. package/server/harness/codex/session.ts +20 -47
  149. package/server/harness/hermes/NOTES.md +1 -1
  150. package/server/harness/hermes/index.ts +4 -0
  151. package/server/harness/openclaw/NOTES.md +1 -1
  152. package/server/harness/openclaw/adapter.ts +22 -4
  153. package/server/harness/openclaw/gateway.ts +5 -3
  154. package/server/harness/openclaw/session.ts +27 -27
  155. package/server/harness/types.ts +5 -3
  156. package/server/layout.ts +9 -14
  157. package/server/moi-scaffold.ts +21 -13
  158. package/server/navigation-relay.ts +110 -0
  159. package/server/registry.ts +8 -0
  160. package/server/selected-session.ts +24 -4
  161. package/server/skill-update.ts +5 -3
  162. package/server/skill-version.ts +4 -7
  163. package/server/skills-template.ts +48 -9
  164. package/server/tabs.ts +19 -33
  165. package/server/uploads.ts +0 -0
  166. package/server/view-builders.ts +18 -1
  167. package/server/views.ts +126 -6
  168. package/server/web.ts +35 -9
  169. package/server/widgets.ts +12 -5
  170. package/server/workspace-config.ts +13 -9
  171. package/ui-components/button.tsx +2 -2
  172. package/ui-components/docs/kbd.md +191 -0
  173. package/ui-components/dropdown-menu.tsx +1 -1
  174. package/ui-components/kbd.tsx +32 -0
  175. package/ui-components/slider.tsx +1 -1
  176. package/ui-components/switch.tsx +1 -1
  177. package/ui-components/tabs.tsx +1 -1
  178. package/workspace/.claude/skills/moi-workspace/SKILL.md +284 -228
  179. package/workspace/.claude/skills/moi-workspace/references/DESIGN.md +100 -153
  180. package/workspace/.claude/skills/moi-workspace/references/INTENTS.md +156 -0
  181. package/client/features/chat/attachment-staging.ts +0 -153
  182. package/client/features/chat/uploads.ts +0 -18
  183. package/client/features/chat/useAppletChatMessage.ts +0 -68
  184. package/client/features/settings/IconPicker.tsx +0 -442
  185. package/client/features/settings/WorkspaceSettings.tsx +0 -95
  186. package/client/features/settings/render-icon.ts +0 -173
  187. package/client/features/widgets/HiddenPanel.tsx +0 -80
  188. package/client/features/widgets/WidgetGrid.tsx +0 -123
  189. package/client/features/widgets/Widgets.tsx +0 -262
  190. package/client/features/widgets/useGridReconcile.ts +0 -73
  191. package/dist/chunk-245wt82v.css +0 -1
  192. package/dist/chunk-87thzbtw.js +0 -2
  193. package/dist/chunk-a6jad1a6.js +0 -1
  194. package/dist/chunk-dghwstd2.js +0 -9
  195. package/dist/chunk-eg120aca.js +0 -1
  196. package/dist/chunk-j7hh2ab4.js +0 -70
  197. package/dist/chunk-y8eyahwx.js +0 -1
  198. /package/client/features/chat/{ChatPromptBubbles.tsx → messages/ChatPromptBubbles.tsx} +0 -0
  199. /package/client/features/chat/{ShimmerText.tsx → messages/ShimmerText.tsx} +0 -0
  200. /package/client/features/chat/{group-turns.ts → messages/group-turns.ts} +0 -0
  201. /package/client/features/chat/{interleave-notices.ts → messages/interleave-notices.ts} +0 -0
  202. /package/client/features/chat/{preview-turn.ts → messages/preview-turn.ts} +0 -0
  203. /package/client/features/chat/{tool-group → messages/tool-group}/CodeBlock.tsx +0 -0
  204. /package/client/features/chat/{tool-group → messages/tool-group}/Collapse.tsx +0 -0
  205. /package/client/features/chat/{tool-group → messages/tool-group}/ReadImagePreview.tsx +0 -0
  206. /package/client/features/chat/{tool-group → messages/tool-group}/ToolOutput.tsx +0 -0
  207. /package/client/features/chat/{tool-group → messages/tool-group}/detect.ts +0 -0
  208. /package/client/features/chat/{tool-group → messages/tool-group}/fixtures.ts +0 -0
  209. /package/client/features/chat/{tool-group → messages/tool-group}/format/claude.ts +0 -0
  210. /package/client/features/chat/{tool-group → messages/tool-group}/format/codex.ts +0 -0
  211. /package/client/features/chat/{tool-group → messages/tool-group}/format/hermes.ts +0 -0
  212. /package/client/features/chat/{tool-group → messages/tool-group}/format/index.ts +0 -0
  213. /package/client/features/chat/{tool-group → messages/tool-group}/format/mcp.ts +0 -0
  214. /package/client/features/chat/{tool-group → messages/tool-group}/format/openclaw.ts +0 -0
  215. /package/client/features/chat/{tool-group → messages/tool-group}/format/shared.ts +0 -0
  216. /package/client/features/chat/{tool-group → messages/tool-group}/format/shell.ts +0 -0
  217. /package/client/features/chat/{tool-group → messages/tool-group}/index.ts +0 -0
  218. /package/client/features/chat/{useStickToBottom.ts → messages/useStickToBottom.ts} +0 -0
  219. /package/client/features/chat/{session-view.ts → sessions/session-view.ts} +0 -0
  220. /package/client/features/chat/{useSelectedSession.ts → sessions/useSelectedSession.ts} +0 -0
  221. /package/server/{bundler → applets}/applet-css.ts +0 -0
  222. /package/server/{bundler → applets}/build-worker.ts +0 -0
@@ -1,70 +0,0 @@
1
- import{$ as Yk,$a as PO,A as $9,Aa as Kd,Ab as vm,B as O4,Ba as PX,Bb as rD,C as dH,Ca as Fd,Cb as gm,D as a9,Da as Yd,Db as dl,E as T$,Ea as Wd,Eb as gF,F as uW,Fa as Ad,Fb as xd,G as f0,Ga as Nd,Gb as O2,H as v2,Ha as xT,I as NI,Ia as Iy,Ib as vd,J as m4,Ja as CI,Jb as gd,K as F0,Kb as $B,L as hU,La as Vd,Lb as $Q,M as FU,Ma as jy,Mb as fd,N as R5,Na as OZ,Nb as md,O as uq,Oa as Ld,Ob as JB,P as z0,Pa as Dd,Pb as aw,Q as $i,Qa as il,Qb as ud,R as d1,Ra as oC,Rb as pd,S as W7,Sa as qd,T as E0,Ta as Md,Tb as cd,U as em,Ua as Pd,V as nc,Va as _d,Vb as dd,W as pl,Wb as ld,X as qO,Xa as jd,Xb as id,Y as wz,Ya as Od,Yb as rd,Z as oc,Zb as Xc,_ as Sy,_a as Td,_b as ad,aa as Wk,ab as dF,ac as Oy,b as r,ba as nC,bb as HB,bc as Ul,c as x2,ca as Vk,cb as vi,cc as nd,d as cG0,da as zl,db as Cd,e as K1,ea as ZB,eb as gi,ec as Ty,f as u9,fa as sc,fc as od,g as _1,ga as tc,gb as y5,gc as sd,h as p1,ha as eJ,hb as _O,hc as b5,i as J0,ia as ec,ib as cl,ic as xp,j as g0,ja as $d,jb as wd,jc as nw,k as jQ,ka as Zd,kb as Ed,kc as Vy,l as k_,la as xi,lb as rw,lc as _X,m as W0,ma as Hd,mb as sC,mc as My,n as F4,na as Jd,nb as Sd,nc as XT,o as u1,oa as Bd,ob as TM,oc as GT,p as o9,pa as Qd,pb as Nu,pc as jT,q as u_,qa as zd,qb as Gl,r as r0,ra as x3,rb as Id,rc as VT,s as C1,sa as Xd,sb as kd,sc as F5,t as L3,ta as XK,tb as Rd,tc as di,u as cH,ua as E7,ub as bd,uc as OT,v as yj,va as Qu,vb as BK,vc as TT,w as Lz,wa as MO,wc as G2,x as pW,xa as Xl,xb as yd,xc as Rp,y as hj,ya as Gd,yb as QK,yc as Y5,z as cW,za as Ud,zb as hd}from"/chunk-dghwstd2.js";import{Ac as f2,Bc as o5,Dc as N9,zc as q1}from"/chunk-4s15axjs.js";import{Ec as p,Fc as qT,Gc as aI,Hc as H4}from"/chunk-87thzbtw.js";import{Ic as _,Jc as D5,Kc as g5,Lc as JV}from"/chunk-j3wvxjr7.js";var W$=D5((Mr)=>{var L8=_(p());function Fr($,Z){return $===Z&&($!==0||1/$===1/Z)||$!==$&&Z!==Z}var Yr=typeof Object.is==="function"?Object.is:Fr,Wr=L8.useState,Ar=L8.useEffect,Nr=L8.useLayoutEffect,Vr=L8.useDebugValue;function Lr($,Z){var H=Z(),J=Wr({inst:{value:H,getSnapshot:Z}}),B=J[0].inst,Q=J[1];return Nr(function(){B.value=H,B.getSnapshot=Z,EY(B)&&Q({inst:B})},[$,H,Z]),Ar(function(){return EY(B)&&Q({inst:B}),$(function(){EY(B)&&Q({inst:B})})},[$]),Vr(H),H}function EY($){var Z=$.getSnapshot;$=$.value;try{var H=Z();return!Yr($,H)}catch(J){return!0}}function Dr($,Z){return Z()}var qr=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?Dr:Lr;Mr.useSyncExternalStore=L8.useSyncExternalStore!==void 0?L8.useSyncExternalStore:qr});var iy=D5((u51,ly)=>{var uy=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,g20=/\n/g,f20=/^\s*/,m20=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,u20=/^:\s*/,p20=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,c20=/^[;\s]*/,d20=/^\s+|\s+$/g,l20=`
2
- `,py="/",cy="*",y7="",i20="comment",r20="declaration";function a20($,Z){if(typeof $!=="string")throw TypeError("First argument must be a string");if(!$)return[];Z=Z||{};var H=1,J=1;function B(A){var N=A.match(g20);if(N)H+=N.length;var L=A.lastIndexOf(l20);J=~L?A.length-L:J+A.length}function Q(){var A={line:H,column:J};return function(N){return N.position=new z(A),U(),N}}function z(A){this.start=A,this.end={line:H,column:J},this.source=Z.source}z.prototype.content=$;function X(A){var N=Error(Z.source+":"+H+":"+J+": "+A);if(N.reason=A,N.filename=Z.source,N.line=H,N.column=J,N.source=$,Z.silent);else throw N}function G(A){var N=A.exec($);if(!N)return;var L=N[0];return B(L),$=$.slice(L.length),N}function U(){G(f20)}function K(A){var N;A=A||[];while(N=F())if(N!==!1)A.push(N);return A}function F(){var A=Q();if(py!=$.charAt(0)||cy!=$.charAt(1))return;var N=2;while(y7!=$.charAt(N)&&(cy!=$.charAt(N)||py!=$.charAt(N+1)))++N;if(N+=2,y7===$.charAt(N-1))return X("End of comment missing");var L=$.slice(2,N-2);return J+=2,B(L),$=$.slice(N),J+=2,A({type:i20,comment:L})}function Y(){var A=Q(),N=G(m20);if(!N)return;if(F(),!G(u20))return X("property missing ':'");var L=G(p20),V=A({type:r20,property:dy(N[0].replace(uy,y7)),value:L?dy(L[0].replace(uy,y7)):y7});return G(c20),V}function W(){var A=[];K(A);var N;while(N=Y())if(N!==!1)A.push(N),K(A);return A}return U(),W()}function dy($){return $?$.replace(d20,y7):y7}ly.exports=a20});var ry=D5((XB)=>{var n20=XB&&XB.__importDefault||function($){return $&&$.__esModule?$:{default:$}};Object.defineProperty(XB,"__esModule",{value:!0});XB.default=s20;var o20=n20(iy());function s20($,Z){let H=null;if(!$||typeof $!=="string")return H;let J=(0,o20.default)($),B=typeof Z==="function";return J.forEach((Q)=>{if(Q.type!=="declaration")return;let{property:z,value:X}=Q;if(B)Z(z,X,Q);else if(X)H=H||{},H[z]=X}),H}});var sy=D5((ny)=>{Object.defineProperty(ny,"__esModule",{value:!0});ny.camelCase=void 0;var t20=/^--[a-zA-Z0-9_-]+$/,e20=/-([a-z])/g,$80=/^[^-]+$/,Z80=/^-(webkit|moz|ms|o|khtml)-/,H80=/^-(ms)-/,J80=function($){return!$||$80.test($)||t20.test($)},B80=function($,Z){return Z.toUpperCase()},ay=function($,Z){return"".concat(Z,"-")},Q80=function($,Z){if(Z===void 0)Z={};if(J80($))return $;if($=$.toLowerCase(),Z.reactCompat)$=$.replace(H80,ay);else $=$.replace(Z80,ay);return $.replace(e20,B80)};ny.camelCase=Q80});var ey=D5((ZL,ty)=>{var z80=ZL&&ZL.__importDefault||function($){return $&&$.__esModule?$:{default:$}},X80=z80(ry()),G80=sy();function $L($,Z){var H={};if(!$||typeof $!=="string")return H;return(0,X80.default)($,function(J,B){if(J&&B)H[(0,G80.camelCase)(J,Z)]=B}),H}$L.default=$L;ty.exports=$L});var Mx=D5((R61,qx)=>{var gK=Object.prototype.hasOwnProperty,Dx=Object.prototype.toString,Yx=Object.defineProperty,Wx=Object.getOwnPropertyDescriptor,Ax=function(Z){if(typeof Array.isArray==="function")return Array.isArray(Z);return Dx.call(Z)==="[object Array]"},Nx=function(Z){if(!Z||Dx.call(Z)!=="[object Object]")return!1;var H=gK.call(Z,"constructor"),J=Z.constructor&&Z.constructor.prototype&&gK.call(Z.constructor.prototype,"isPrototypeOf");if(Z.constructor&&!H&&!J)return!1;var B;for(B in Z);return typeof B>"u"||gK.call(Z,B)},Vx=function(Z,H){if(Yx&&H.name==="__proto__")Yx(Z,H.name,{enumerable:!0,configurable:!0,value:H.newValue,writable:!0});else Z[H.name]=H.newValue},Lx=function(Z,H){if(H==="__proto__"){if(!gK.call(Z,H))return;else if(Wx)return Wx(Z,H).value}return Z[H]};qx.exports=function $(){var Z,H,J,B,Q,z,X=arguments[0],G=1,U=arguments.length,K=!1;if(typeof X==="boolean")K=X,X=arguments[1]||{},G=2;if(X==null||typeof X!=="object"&&typeof X!=="function")X={};for(;G<U;++G)if(Z=arguments[G],Z!=null){for(H in Z)if(J=Lx(X,H),B=Lx(Z,H),X!==B){if(K&&B&&(Nx(B)||(Q=Ax(B)))){if(Q)Q=!1,z=J&&Ax(J)?J:[];else z=J&&Nx(J)?J:{};Vx(X,{name:H,newValue:$(K,z,B)})}else if(typeof B<"u")Vx(X,{name:H,newValue:B})}}return X}});var Yg=D5((e$1,Fg)=>{function ov($){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 H=$[Z],J=typeof H;if((J==="object"||J==="function")&&!Object.isFrozen(H))ov(H)}),$}class iL{constructor($){if($.data===void 0)$.data={};this.data=$.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}}function sv($){return $.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#x27;")}function D6($,...Z){let H=Object.create(null);for(let J in $)H[J]=$[J];return Z.forEach(function(J){for(let B in J)H[B]=J[B]}),H}var b60="</span>",dv=($)=>{return!!$.scope},y60=($,{prefix:Z})=>{if($.startsWith("language:"))return $.replace("language:","language-");if($.includes(".")){let H=$.split(".");return[`${Z}${H.shift()}`,...H.map((J,B)=>`${J}${"_".repeat(B+1)}`)].join(" ")}return`${Z}${$}`};class tv{constructor($,Z){this.buffer="",this.classPrefix=Z.classPrefix,$.walk(this)}addText($){this.buffer+=sv($)}openNode($){if(!dv($))return;let Z=y60($.scope,{prefix:this.classPrefix});this.span(Z)}closeNode($){if(!dv($))return;this.buffer+=b60}value(){return this.buffer}span($){this.buffer+=`<span class="${$}">`}}var lv=($={})=>{let Z={children:[]};return Object.assign(Z,$),Z};class rL{constructor(){this.rootNode=lv(),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=lv({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((H)=>this._walk($,H)),$.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)=>{rL._collapse(Z)})}}class ev extends rL{constructor($){super();this.options=$}addText($){if($==="")return;this.add($)}startScope($){this.openNode($)}endScope(){this.closeNode()}__addSublanguage($,Z){let H=$.root;if(Z)H.scope=`language:${Z}`;this.add(H)}toHTML(){return new tv(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}}function OB($){if(!$)return null;if(typeof $==="string")return $;return $.source}function $g($){return d7("(?=",$,")")}function h60($){return d7("(?:",$,")*")}function x60($){return d7("(?:",$,")?")}function d7(...$){return $.map((H)=>OB(H)).join("")}function v60($){let Z=$[$.length-1];if(typeof Z==="object"&&Z.constructor===Object)return $.splice($.length-1,1),Z;else return{}}function aL(...$){return"("+(v60($).capture?"":"?:")+$.map((J)=>OB(J)).join("|")+")"}function Zg($){return new RegExp($.toString()+"|").exec("").length-1}function g60($,Z){let H=$&&$.exec(Z);return H&&H.index===0}var f60=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function nL($,{joinWith:Z}){let H=0;return $.map((J)=>{H+=1;let B=H,Q=OB(J),z="";while(Q.length>0){let X=f60.exec(Q);if(!X){z+=Q;break}if(z+=Q.substring(0,X.index),Q=Q.substring(X.index+X[0].length),X[0][0]==="\\"&&X[1])z+="\\"+String(Number(X[1])+B);else if(z+=X[0],X[0]==="(")H++}return z}).map((J)=>`(${J})`).join(Z)}var m60=/\b\B/,Hg="[a-zA-Z]\\w*",oL="[a-zA-Z_]\\w*",Jg="\\b\\d+(\\.\\d+)?",Bg="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",Qg="\\b(0b[01]+)",u60="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",p60=($={})=>{let Z=/^#![ ]*\//;if($.binary)$.begin=d7(Z,/.*\b/,$.binary,/\b.*/);return D6({scope:"meta",begin:Z,end:/$/,relevance:0,"on:begin":(H,J)=>{if(H.index!==0)J.ignoreMatch()}},$)},TB={begin:"\\\\[\\s\\S]",relevance:0},c60={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[TB]},d60={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[TB]},l60={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/},sK=function($,Z,H={}){let J=D6({scope:"comment",begin:$,end:Z,contains:[]},H);J.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 B=aL("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 J.contains.push({begin:d7(/[ ]+/,"(",B,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),J},i60=sK("//","$"),r60=sK("/\\*","\\*/"),a60=sK("#","$"),n60={scope:"number",begin:Jg,relevance:0},o60={scope:"number",begin:Bg,relevance:0},s60={scope:"number",begin:Qg,relevance:0},t60={scope:"regexp",begin:/\/(?=[^/\n]*\/)/,end:/\/[gimuy]*/,contains:[TB,{begin:/\[/,end:/\]/,relevance:0,contains:[TB]}]},e60={scope:"title",begin:Hg,relevance:0},$70={scope:"title",begin:oL,relevance:0},Z70={begin:"\\.\\s*"+oL,relevance:0},H70=function($){return Object.assign($,{"on:begin":(Z,H)=>{H.data._beginMatch=Z[1]},"on:end":(Z,H)=>{if(H.data._beginMatch!==Z[1])H.ignoreMatch()}})},nK=Object.freeze({__proto__:null,APOS_STRING_MODE:c60,BACKSLASH_ESCAPE:TB,BINARY_NUMBER_MODE:s60,BINARY_NUMBER_RE:Qg,COMMENT:sK,C_BLOCK_COMMENT_MODE:r60,C_LINE_COMMENT_MODE:i60,C_NUMBER_MODE:o60,C_NUMBER_RE:Bg,END_SAME_AS_BEGIN:H70,HASH_COMMENT_MODE:a60,IDENT_RE:Hg,MATCH_NOTHING_RE:m60,METHOD_GUARD:Z70,NUMBER_MODE:n60,NUMBER_RE:Jg,PHRASAL_WORDS_MODE:l60,QUOTE_STRING_MODE:d60,REGEXP_MODE:t60,RE_STARTERS_RE:u60,SHEBANG:p60,TITLE_MODE:e60,UNDERSCORE_IDENT_RE:oL,UNDERSCORE_TITLE_MODE:$70});function J70($,Z){if($.input[$.index-1]===".")Z.ignoreMatch()}function B70($,Z){if($.className!==void 0)$.scope=$.className,delete $.className}function Q70($,Z){if(!Z)return;if(!$.beginKeywords)return;if($.begin="\\b("+$.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",$.__beforeBegin=J70,$.keywords=$.keywords||$.beginKeywords,delete $.beginKeywords,$.relevance===void 0)$.relevance=0}function z70($,Z){if(!Array.isArray($.illegal))return;$.illegal=aL(...$.illegal)}function X70($,Z){if(!$.match)return;if($.begin||$.end)throw Error("begin & end are not supported with match");$.begin=$.match,delete $.match}function G70($,Z){if($.relevance===void 0)$.relevance=1}var U70=($,Z)=>{if(!$.beforeMatch)return;if($.starts)throw Error("beforeMatch cannot be used with starts");let H=Object.assign({},$);Object.keys($).forEach((J)=>{delete $[J]}),$.keywords=H.keywords,$.begin=d7(H.beforeMatch,$g(H.begin)),$.starts={relevance:0,contains:[Object.assign(H,{endsParent:!0})]},$.relevance=0,delete H.beforeMatch},K70=["of","and","for","in","not","or","if","then","parent","list","value"],F70="keyword";function zg($,Z,H=F70){let J=Object.create(null);if(typeof $==="string")B(H,$.split(" "));else if(Array.isArray($))B(H,$);else Object.keys($).forEach(function(Q){Object.assign(J,zg($[Q],Z,Q))});return J;function B(Q,z){if(Z)z=z.map((X)=>X.toLowerCase());z.forEach(function(X){let G=X.split("|");J[G[0]]=[Q,Y70(G[0],G[1])]})}}function Y70($,Z){if(Z)return Number(Z);return W70($)?0:1}function W70($){return K70.includes($.toLowerCase())}var iv={},c7=($)=>{console.error($)},rv=($,...Z)=>{console.log(`WARN: ${$}`,...Z)},vZ=($,Z)=>{if(iv[`${$}/${Z}`])return;console.log(`Deprecated as of ${$}. ${Z}`),iv[`${$}/${Z}`]=!0},oK=Error();function Xg($,Z,{key:H}){let J=0,B=$[H],Q={},z={};for(let X=1;X<=Z.length;X++)z[X+J]=B[X],Q[X+J]=!0,J+=Zg(Z[X-1]);$[H]=z,$[H]._emit=Q,$[H]._multi=!0}function A70($){if(!Array.isArray($.begin))return;if($.skip||$.excludeBegin||$.returnBegin)throw c7("skip, excludeBegin, returnBegin not compatible with beginScope: {}"),oK;if(typeof $.beginScope!=="object"||$.beginScope===null)throw c7("beginScope must be object"),oK;Xg($,$.begin,{key:"beginScope"}),$.begin=nL($.begin,{joinWith:""})}function N70($){if(!Array.isArray($.end))return;if($.skip||$.excludeEnd||$.returnEnd)throw c7("skip, excludeEnd, returnEnd not compatible with endScope: {}"),oK;if(typeof $.endScope!=="object"||$.endScope===null)throw c7("endScope must be object"),oK;Xg($,$.end,{key:"endScope"}),$.end=nL($.end,{joinWith:""})}function V70($){if($.scope&&typeof $.scope==="object"&&$.scope!==null)$.beginScope=$.scope,delete $.scope}function L70($){if(V70($),typeof $.beginScope==="string")$.beginScope={_wrap:$.beginScope};if(typeof $.endScope==="string")$.endScope={_wrap:$.endScope};A70($),N70($)}function D70($){function Z(z,X){return new RegExp(OB(z),"m"+($.case_insensitive?"i":"")+($.unicodeRegex?"u":"")+(X?"g":""))}class H{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(z,X){X.position=this.position++,this.matchIndexes[this.matchAt]=X,this.regexes.push([X,z]),this.matchAt+=Zg(z)+1}compile(){if(this.regexes.length===0)this.exec=()=>null;let z=this.regexes.map((X)=>X[1]);this.matcherRe=Z(nL(z,{joinWith:"|"}),!0),this.lastIndex=0}exec(z){this.matcherRe.lastIndex=this.lastIndex;let X=this.matcherRe.exec(z);if(!X)return null;let G=X.findIndex((K,F)=>F>0&&K!==void 0),U=this.matchIndexes[G];return X.splice(0,G),Object.assign(X,U)}}class J{constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(z){if(this.multiRegexes[z])return this.multiRegexes[z];let X=new H;return this.rules.slice(z).forEach(([G,U])=>X.addRule(G,U)),X.compile(),this.multiRegexes[z]=X,X}resumingScanAtSamePosition(){return this.regexIndex!==0}considerAll(){this.regexIndex=0}addRule(z,X){if(this.rules.push([z,X]),X.type==="begin")this.count++}exec(z){let X=this.getMatcher(this.regexIndex);X.lastIndex=this.lastIndex;let G=X.exec(z);if(this.resumingScanAtSamePosition())if(G&&G.index===this.lastIndex);else{let U=this.getMatcher(0);U.lastIndex=this.lastIndex+1,G=U.exec(z)}if(G){if(this.regexIndex+=G.position+1,this.regexIndex===this.count)this.considerAll()}return G}}function B(z){let X=new J;if(z.contains.forEach((G)=>X.addRule(G.begin,{rule:G,type:"begin"})),z.terminatorEnd)X.addRule(z.terminatorEnd,{type:"end"});if(z.illegal)X.addRule(z.illegal,{type:"illegal"});return X}function Q(z,X){let G=z;if(z.isCompiled)return G;[B70,X70,L70,U70].forEach((K)=>K(z,X)),$.compilerExtensions.forEach((K)=>K(z,X)),z.__beforeBegin=null,[Q70,z70,G70].forEach((K)=>K(z,X)),z.isCompiled=!0;let U=null;if(typeof z.keywords==="object"&&z.keywords.$pattern)z.keywords=Object.assign({},z.keywords),U=z.keywords.$pattern,delete z.keywords.$pattern;if(U=U||/\w+/,z.keywords)z.keywords=zg(z.keywords,$.case_insensitive);if(G.keywordPatternRe=Z(U,!0),X){if(!z.begin)z.begin=/\B|\b/;if(G.beginRe=Z(G.begin),!z.end&&!z.endsWithParent)z.end=/\B|\b/;if(z.end)G.endRe=Z(G.end);if(G.terminatorEnd=OB(G.end)||"",z.endsWithParent&&X.terminatorEnd)G.terminatorEnd+=(z.end?"|":"")+X.terminatorEnd}if(z.illegal)G.illegalRe=Z(z.illegal);if(!z.contains)z.contains=[];if(z.contains=[].concat(...z.contains.map(function(K){return q70(K==="self"?z:K)})),z.contains.forEach(function(K){Q(K,G)}),z.starts)Q(z.starts,X);return G.matcher=B(G),G}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=D6($.classNameAliases||{}),Q($)}function Gg($){if(!$)return!1;return $.endsWithParent||Gg($.starts)}function q70($){if($.variants&&!$.cachedVariants)$.cachedVariants=$.variants.map(function(Z){return D6($,{variants:null},Z)});if($.cachedVariants)return $.cachedVariants;if(Gg($))return D6($,{starts:$.starts?D6($.starts):null});if(Object.isFrozen($))return D6($);return $}var M70="11.11.1";class Ug extends Error{constructor($,Z){super($);this.name="HTMLInjectionError",this.html=Z}}var lL=sv,av=D6,nv=Symbol("nomatch"),P70=7,Kg=function($){let Z=Object.create(null),H=Object.create(null),J=[],B=!0,Q="Could not find the language '{}', did you forget to load/include a language module?",z={disableAutodetect:!0,name:"Plain text",contains:[]},X={ignoreUnescapedHTML:!1,throwUnescapedHTML:!1,noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:"hljs-",cssSelector:"pre code",languages:null,__emitter:ev};function G(I){return X.noHighlightRe.test(I)}function U(I){let y=I.className+" ";y+=I.parentNode?I.parentNode.className:"";let f=X.languageDetectRe.exec(y);if(f){let g=C(f[1]);if(!g)rv(Q.replace("{}",f[1])),rv("Falling back to no-highlight mode for this block.",I);return g?f[1]:"no-highlight"}return y.split(/\s+/).find((g)=>G(g)||C(g))}function K(I,y,f){let g="",O="";if(typeof y==="object")g=I,f=y.ignoreIllegals,O=y.language;else vZ("10.7.0","highlight(lang, code, ...args) has been deprecated."),vZ("10.7.0",`Please use highlight(code, options) instead.
3
- https://github.com/highlightjs/highlight.js/issues/2277`),O=I,g=y;if(f===void 0)f=!0;let c={code:g,language:O};w("before:highlight",c);let o=c.result?c.result:F(c.language,c.code,f);return o.code=c.code,w("after:highlight",o),o}function F(I,y,f,g){let O=Object.create(null);function c(v,m){return v.keywords[m]}function o(){if(!l.keywords){$0.addText(H0);return}let v=0;l.keywordPatternRe.lastIndex=0;let m=l.keywordPatternRe.exec(H0),s="";while(m){s+=H0.substring(v,m.index);let G0=D0.case_insensitive?m[0].toLowerCase():m[0],j0=c(l,G0);if(j0){let[m0,v0]=j0;if($0.addText(s),s="",O[G0]=(O[G0]||0)+1,O[G0]<=P70)O0+=v0;if(m0.startsWith("_"))s+=m[0];else{let T0=D0.classNameAliases[m0]||m0;t(m[0],T0)}}else s+=m[0];v=l.keywordPatternRe.lastIndex,m=l.keywordPatternRe.exec(H0)}s+=H0.substring(v),$0.addText(s)}function b(){if(H0==="")return;let v=null;if(typeof l.subLanguage==="string"){if(!Z[l.subLanguage]){$0.addText(H0);return}v=F(l.subLanguage,H0,!0,e[l.subLanguage]),e[l.subLanguage]=v._top}else v=W(H0,l.subLanguage.length?l.subLanguage:null);if(l.relevance>0)O0+=v.relevance;$0.__addSublanguage(v._emitter,v.language)}function d(){if(l.subLanguage!=null)b();else o();H0=""}function t(v,m){if(v==="")return;$0.startScope(m),$0.addText(v),$0.endScope()}function u(v,m){let s=1,G0=m.length-1;while(s<=G0){if(!v._emit[s]){s++;continue}let j0=D0.classNameAliases[v[s]]||v[s],m0=m[s];if(j0)t(m0,j0);else H0=m0,o(),H0="";s++}}function a(v,m){if(v.scope&&typeof v.scope==="string")$0.openNode(D0.classNameAliases[v.scope]||v.scope);if(v.beginScope){if(v.beginScope._wrap)t(H0,D0.classNameAliases[v.beginScope._wrap]||v.beginScope._wrap),H0="";else if(v.beginScope._multi)u(v.beginScope,m),H0=""}return l=Object.create(v,{parent:{value:l}}),l}function n(v,m,s){let G0=g60(v.endRe,s);if(G0){if(v["on:end"]){let j0=new iL(v);if(v["on:end"](m,j0),j0.isMatchIgnored)G0=!1}if(G0){while(v.endsParent&&v.parent)v=v.parent;return v}}if(v.endsWithParent)return n(v.parent,m,s)}function Q0(v){if(l.matcher.regexIndex===0)return H0+=v[0],1;else return M0=!0,0}function Z0(v){let m=v[0],s=v.rule,G0=new iL(s),j0=[s.__beforeBegin,s["on:begin"]];for(let m0 of j0){if(!m0)continue;if(m0(v,G0),G0.isMatchIgnored)return Q0(m)}if(s.skip)H0+=m;else{if(s.excludeBegin)H0+=m;if(d(),!s.returnBegin&&!s.excludeBegin)H0=m}return a(s,v),s.returnBegin?0:m.length}function U0(v){let m=v[0],s=y.substring(v.index),G0=n(l,v,s);if(!G0)return nv;let j0=l;if(l.endScope&&l.endScope._wrap)d(),t(m,l.endScope._wrap);else if(l.endScope&&l.endScope._multi)d(),u(l.endScope,v);else if(j0.skip)H0+=m;else{if(!(j0.returnEnd||j0.excludeEnd))H0+=m;if(d(),j0.excludeEnd)H0=m}do{if(l.scope)$0.closeNode();if(!l.skip&&!l.subLanguage)O0+=l.relevance;l=l.parent}while(l!==G0.parent);if(G0.starts)a(G0.starts,v);return j0.returnEnd?0:m.length}function B0(){let v=[];for(let m=l;m!==D0;m=m.parent)if(m.scope)v.unshift(m.scope);v.forEach((m)=>$0.openNode(m))}let Y0={};function A0(v,m){let s=m&&m[0];if(H0+=v,s==null)return d(),0;if(Y0.type==="begin"&&m.type==="end"&&Y0.index===m.index&&s===""){if(H0+=y.slice(m.index,m.index+1),!B){let G0=Error(`0 width match regex (${I})`);throw G0.languageName=I,G0.badRule=Y0.rule,G0}return 1}if(Y0=m,m.type==="begin")return Z0(m);else if(m.type==="illegal"&&!f){let G0=Error('Illegal lexeme "'+s+'" for mode "'+(l.scope||"<unnamed>")+'"');throw G0.mode=l,G0}else if(m.type==="end"){let G0=U0(m);if(G0!==nv)return G0}if(m.type==="illegal"&&s==="")return H0+=`
4
- `,1;if(N0>1e5&&N0>m.index*3)throw Error("potential infinite loop, way more iterations than matches");return H0+=s,s.length}let D0=C(I);if(!D0)throw c7(Q.replace("{}",I)),Error('Unknown language: "'+I+'"');let X0=D70(D0),i="",l=g||X0,e={},$0=new X.__emitter(X);B0();let H0="",O0=0,P0=0,N0=0,M0=!1;try{if(!D0.__emitTokens){l.matcher.considerAll();for(;;){if(N0++,M0)M0=!1;else l.matcher.considerAll();l.matcher.lastIndex=P0;let v=l.matcher.exec(y);if(!v)break;let m=y.substring(P0,v.index),s=A0(m,v);P0=v.index+s}A0(y.substring(P0))}else D0.__emitTokens(y,$0);return $0.finalize(),i=$0.toHTML(),{language:I,value:i,relevance:O0,illegal:!1,_emitter:$0,_top:l}}catch(v){if(v.message&&v.message.includes("Illegal"))return{language:I,value:lL(y),illegal:!0,relevance:0,_illegalBy:{message:v.message,index:P0,context:y.slice(P0-100,P0+100),mode:v.mode,resultSoFar:i},_emitter:$0};else if(B)return{language:I,value:lL(y),illegal:!1,relevance:0,errorRaised:v,_emitter:$0,_top:l};else throw v}}function Y(I){let y={value:lL(I),illegal:!1,relevance:0,_top:z,_emitter:new X.__emitter(X)};return y._emitter.addText(I),y}function W(I,y){y=y||X.languages||Object.keys(Z);let f=Y(I),g=y.filter(C).filter(E).map((d)=>F(d,I,!1));g.unshift(f);let O=g.sort((d,t)=>{if(d.relevance!==t.relevance)return t.relevance-d.relevance;if(d.language&&t.language){if(C(d.language).supersetOf===t.language)return 1;else if(C(t.language).supersetOf===d.language)return-1}return 0}),[c,o]=O,b=c;return b.secondBest=o,b}function A(I,y,f){let g=y&&H[y]||f;I.classList.add("hljs"),I.classList.add(`language-${g}`)}function N(I){let y=null,f=U(I);if(G(f))return;if(w("before:highlightElement",{el:I,language:f}),I.dataset.highlighted){console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.",I);return}if(I.children.length>0){if(!X.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(I);if(X.throwUnescapedHTML)throw new Ug("One of your code blocks includes unescaped HTML.",I.innerHTML)}y=I;let g=y.textContent,O=f?K(g,{language:f,ignoreIllegals:!0}):W(g);if(I.innerHTML=O.value,I.dataset.highlighted="yes",A(I,f,O.language),I.result={language:O.language,re:O.relevance,relevance:O.relevance},O.secondBest)I.secondBest={language:O.secondBest.language,relevance:O.secondBest.relevance};w("after:highlightElement",{el:I,result:O,text:g})}function L(I){X=av(X,I)}let V=()=>{j(),vZ("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")};function D(){j(),vZ("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.")}let q=!1;function j(){function I(){j()}if(document.readyState==="loading"){if(!q)window.addEventListener("DOMContentLoaded",I,!1);q=!0;return}document.querySelectorAll(X.cssSelector).forEach(N)}function M(I,y){let f=null;try{f=y($)}catch(g){if(c7("Language definition for '{}' could not be registered.".replace("{}",I)),!B)throw g;else c7(g);f=z}if(!f.name)f.name=I;if(Z[I]=f,f.rawDefinition=y.bind(null,$),f.aliases)k(f.aliases,{languageName:I})}function P(I){delete Z[I];for(let y of Object.keys(H))if(H[y]===I)delete H[y]}function T(){return Object.keys(Z)}function C(I){return I=(I||"").toLowerCase(),Z[I]||Z[H[I]]}function k(I,{languageName:y}){if(typeof I==="string")I=[I];I.forEach((f)=>{H[f.toLowerCase()]=y})}function E(I){let y=C(I);return y&&!y.disableAutodetect}function h(I){if(I["before:highlightBlock"]&&!I["before:highlightElement"])I["before:highlightElement"]=(y)=>{I["before:highlightBlock"](Object.assign({block:y.el},y))};if(I["after:highlightBlock"]&&!I["after:highlightElement"])I["after:highlightElement"]=(y)=>{I["after:highlightBlock"](Object.assign({block:y.el},y))}}function x(I){h(I),J.push(I)}function R(I){let y=J.indexOf(I);if(y!==-1)J.splice(y,1)}function w(I,y){let f=I;J.forEach(function(g){if(g[f])g[f](y)})}function S(I){return vZ("10.7.0","highlightBlock will be removed entirely in v12.0"),vZ("10.7.0","Please use highlightElement now."),N(I)}Object.assign($,{highlight:K,highlightAuto:W,highlightAll:j,highlightElement:N,highlightBlock:S,configure:L,initHighlighting:V,initHighlightingOnLoad:D,registerLanguage:M,unregisterLanguage:P,listLanguages:T,getLanguage:C,registerAliases:k,autoDetection:E,inherit:av,addPlugin:x,removePlugin:R}),$.debugMode=function(){B=!1},$.safeMode=function(){B=!0},$.versionString=M70,$.regex={concat:d7,lookahead:$g,either:aL,optional:x60,anyNumberOfTimes:h60};for(let I in nK)if(typeof nK[I]==="object")ov(nK[I]);return Object.assign($,nK),$},gZ=Kg({});gZ.newInstance=()=>Kg({});Fg.exports=gZ;gZ.HighlightJS=gZ;gZ.default=gZ});var Am=D5((tz1,Wm)=>{var aZ0=["||","&&",";;","|&","<(","<<<",">>",">&","<&","&",";","(",")","|","<",">"],Ym=/[\n\r\u2028\u2029]/,nZ0=/[\s#!"$&'():;<=>@\\^`|]/g;Wm.exports=function(Z){return Z.map(function(H){if(H==="")return"''";if(H&&typeof H==="object"){if("op"in H&&H.op==="glob"){if(typeof H.pattern!=="string")throw TypeError("glob token requires a string `pattern`");if(Ym.test(H.pattern))throw TypeError("glob `pattern` must not contain line terminators");return H.pattern.replace(nZ0,"\\$&")}if("op"in H&&typeof H.op==="string"){if(aZ0.indexOf(H.op)<0)throw TypeError("invalid `op` value: "+JSON.stringify(H.op));return H.op.replace(/[\s\S]/g,"\\$&")}if("comment"in H&&typeof H.comment==="string"){if(Ym.test(H.comment))throw TypeError("`comment` must not contain line terminators");return"#"+H.comment}throw TypeError("unrecognized object token shape")}if(/["\s\\]/.test(H)&&!/'/.test(H))return"'"+H.replace(/(['])/g,"\\$1")+"'";if(/["'\s]/.test(H))return'"'+H.replace(/(["\\$`!])/g,"\\$1")+'"';return String(H).replace(/([A-Za-z]:)?([#!"$&'()*,:;<=>?@[\\\]^`{|}~])/g,"$1\\$2")}).join(" ")}});var Pm=D5((ez1,Mm)=>{var qm="(?:"+["\\|\\|","\\&\\&",";;","\\|\\&","\\<\\(","\\<\\<\\<",">>",">\\&","<\\&","[&;()|<>]"].join("|")+")",Nm=new RegExp("^"+qm+"$"),Vm="|&;()<> \\t",oZ0="'([^']*?)'",sZ0='"((\\\\"|[^"])*?)"',tZ0=/^#$/,Lm="'",Dm='"',XF="$",r7="",eZ0=4294967296;for(GF=0;GF<4;GF++)r7+=(eZ0*Math.random()).toString(16);var GF,$H0=new RegExp("^"+r7);function ZH0($,Z){var H=Z.lastIndex,J=[],B;while(B=Z.exec($))if(J[J.length]=B,Z.lastIndex===B.index)Z.lastIndex+=1;return Z.lastIndex=H,J}function HH0($,Z,H){var J=typeof $==="function"?$(H):$[H];if(typeof J>"u"&&H!="")J="";else if(typeof J>"u")J="$";if(typeof J==="object")return Z+r7+JSON.stringify(J)+r7;return Z+J}function JH0($,Z,H){if(!H)H={};var J=H.escape||"\\",B=H.splitUnquoted===!0?`
5
- `:typeof H.splitUnquoted==="string"?H.splitUnquoted:"",Q="(\\"+J+`['"`+Vm+`]|[^\\s'"`+Vm+"])+",z=new RegExp(["("+qm+")","("+Q+"|"+sZ0+"|"+oZ0+")+"].join("|"),"g"),X=ZH0($,z);if(X.length===0)return[];if(!Z)Z={};var G=!1;return X.map(function(U){var K=U[0];if(!K||G)return;if(Nm.test(K))return{op:K};var F=!1,Y=!1,W="",A=[],N=!1,L=null,V=!1,D;function q(){D+=1;var h,x,R=K.charAt(D);if(R==="{"){if(D+=1,K.charAt(D)==="}")throw Error("Bad substitution: "+K.slice(D-2,D+1));var w=1;h=D;while(w>0&&h<K.length){if(K.charAt(h)==="{"&&K.charAt(h-1)==="$")w+=1;else if(K.charAt(h)==="}")w-=1;h+=1}if(w!==0)throw Error("Bad substitution: "+K.slice(D));h-=1,x=K.slice(D,h),D=h}else if(/[*@#?$!_-]/.test(R))x=R,D+=1;else{var S=K.slice(D);if(h=S.match(/[^\w\d_]/),!h)x=S,D=K.length;else x=S.slice(0,h.index),D+=h.index-1}return HH0(Z,"",x)}function j(){if(L===null)return;if(L===0){if(W!=="")A[A.length]=W,W=""}else{A[A.length]=W,W="";for(var h=1;h<L;h+=1)A[A.length]=""}L=null}for(D=0;D<K.length;D++){var M=K.charAt(D);if(B&&M!==XF)j();if(V=V||!F&&(M==="*"||M==="?"),Y)W+=M,Y=!1;else if(F)if(M===F)F=!1;else if(F==Lm)W+=M;else if(M===J)if(D+=1,M=K.charAt(D),M===Dm||M===J||M===XF)W+=M;else W+=J+M;else if(M===XF)W+=q();else W+=M;else if(M===Dm||M===Lm)F=M,N=!0;else if(Nm.test(M))return{op:K};else if(tZ0.test(M)){G=!0;var P={comment:$.slice(U.index+D+1)};if(W.length)return[W,P];return[P]}else if(M===J)Y=!0;else if(M===XF){var T=q();if(!B)W+=T;else for(var C=0;C<T.length;C+=1){var k=T.charAt(C);if(B.indexOf(k)<0)j(),W+=k;else if(L===null)L=k===" "||k==="\t"||k===`
6
- `?0:1;else if(k!==" "&&k!=="\t"&&k!==`
7
- `)L+=1}}else W+=M}if(V)return{op:"glob",pattern:W};if(B){if(L!==null&&L>0){A[A.length]=W,W="";for(var E=1;E<L;E+=1)A[A.length]=""}if(W!==""||N&&A.length===0)A[A.length]=W;return A}return W}).reduce(function(U,K){if(typeof K>"u")return U;return[].concat(K).forEach(function(F){U[U.length]=F}),U},[])}Mm.exports=function(Z,H,J){var B=JH0(Z,H,J);if(typeof H!=="function")return B;return B.reduce(function(Q,z){if(typeof z==="object")return Q[Q.length]=z,Q;var X=z.split(RegExp("("+r7+".*?"+r7+")","g"));if(X.length===1)return Q[Q.length]=X[0],Q;return X.filter(Boolean).forEach(function(G){Q[Q.length]=$H0.test(G)?JSON.parse(G.split(r7)[1]):G}),Q},[])}});var ku=D5((TF,Iu)=>{(function($,Z){typeof TF==="object"&&typeof Iu<"u"?Z(TF):typeof define==="function"&&define.amd?define(["exports"],Z):($=typeof globalThis<"u"?globalThis:$||self,Z($["fast-equals"]={}))})(TF,function($){function Z(u){return function(n,Q0,Z0,U0,B0,Y0,A0){return u(n,Q0,A0)}}function H(u){return function(n,Q0,Z0,U0){if(!n||!Q0||typeof n!=="object"||typeof Q0!=="object")return u(n,Q0,Z0,U0);var B0=U0.get(n),Y0=U0.get(Q0);if(B0&&Y0)return B0===Q0&&Y0===n;U0.set(n,Q0),U0.set(Q0,n);var A0=u(n,Q0,Z0,U0);return U0.delete(n),U0.delete(Q0),A0}}function J(u,a){var n={};for(var Q0 in u)n[Q0]=u[Q0];for(var Q0 in a)n[Q0]=a[Q0];return n}function B(u){return u.constructor===Object||u.constructor==null}function Q(u){return typeof u.then==="function"}function z(u,a){return u===a||u!==u&&a!==a}var X="[object Arguments]",G="[object Boolean]",U="[object Date]",K="[object RegExp]",F="[object Map]",Y="[object Number]",W="[object Object]",A="[object Set]",N="[object String]",L=Object.prototype.toString;function V(u){var{areArraysEqual:a,areDatesEqual:n,areMapsEqual:Q0,areObjectsEqual:Z0,areRegExpsEqual:U0,areSetsEqual:B0,createIsNestedEqual:Y0}=u,A0=Y0(D0);function D0(X0,i,l){if(X0===i)return!0;if(!X0||!i||typeof X0!=="object"||typeof i!=="object")return X0!==X0&&i!==i;if(B(X0)&&B(i))return Z0(X0,i,A0,l);var e=Array.isArray(X0),$0=Array.isArray(i);if(e||$0)return e===$0&&a(X0,i,A0,l);var H0=L.call(X0);if(H0!==L.call(i))return!1;if(H0===U)return n(X0,i,A0,l);if(H0===K)return U0(X0,i,A0,l);if(H0===F)return Q0(X0,i,A0,l);if(H0===A)return B0(X0,i,A0,l);if(H0===W||H0===X)return Q(X0)||Q(i)?!1:Z0(X0,i,A0,l);if(H0===G||H0===Y||H0===N)return z(X0.valueOf(),i.valueOf());return!1}return D0}function D(u,a,n,Q0){var Z0=u.length;if(a.length!==Z0)return!1;while(Z0-- >0)if(!n(u[Z0],a[Z0],Z0,Z0,u,a,Q0))return!1;return!0}var q=H(D);function j(u,a){return z(u.valueOf(),a.valueOf())}function M(u,a,n,Q0){var Z0=u.size===a.size;if(!Z0)return!1;if(!u.size)return!0;var U0={},B0=0;return u.forEach(function(Y0,A0){if(!Z0)return;var D0=!1,X0=0;a.forEach(function(i,l){if(!D0&&!U0[X0]&&(D0=n(A0,l,B0,X0,u,a,Q0)&&n(Y0,i,A0,l,u,a,Q0)))U0[X0]=!0;X0++}),B0++,Z0=D0}),Z0}var P=H(M),T="_owner",C=Object.prototype.hasOwnProperty;function k(u,a,n,Q0){var Z0=Object.keys(u),U0=Z0.length;if(Object.keys(a).length!==U0)return!1;var B0;while(U0-- >0){if(B0=Z0[U0],B0===T){var Y0=!!u.$$typeof,A0=!!a.$$typeof;if((Y0||A0)&&Y0!==A0)return!1}if(!C.call(a,B0)||!n(u[B0],a[B0],B0,B0,u,a,Q0))return!1}return!0}var E=H(k);function h(u,a){return u.source===a.source&&u.flags===a.flags}function x(u,a,n,Q0){var Z0=u.size===a.size;if(!Z0)return!1;if(!u.size)return!0;var U0={};return u.forEach(function(B0,Y0){if(!Z0)return;var A0=!1,D0=0;a.forEach(function(X0,i){if(!A0&&!U0[D0]&&(A0=n(B0,X0,Y0,i,u,a,Q0)))U0[D0]=!0;D0++}),Z0=A0}),Z0}var R=H(x),w=Object.freeze({areArraysEqual:D,areDatesEqual:j,areMapsEqual:M,areObjectsEqual:k,areRegExpsEqual:h,areSetsEqual:x,createIsNestedEqual:Z}),S=Object.freeze({areArraysEqual:q,areDatesEqual:j,areMapsEqual:P,areObjectsEqual:E,areRegExpsEqual:h,areSetsEqual:R,createIsNestedEqual:Z}),I=V(w);function y(u,a){return I(u,a,void 0)}var f=V(J(w,{createIsNestedEqual:function(){return z}}));function g(u,a){return f(u,a,void 0)}var O=V(S);function c(u,a){return O(u,a,new WeakMap)}var o=V(J(S,{createIsNestedEqual:function(){return z}}));function b(u,a){return o(u,a,new WeakMap)}function d(u){return V(J(w,u(w)))}function t(u){var a=V(J(S,u(S)));return function(n,Q0,Z0){if(Z0===void 0)Z0=new WeakMap;return a(n,Q0,Z0)}}$.circularDeepEqual=c,$.circularShallowEqual=b,$.createCustomCircularEqual=t,$.createCustomEqual=d,$.deepEqual=y,$.sameValueZeroEqual=z,$.shallowEqual=g,Object.defineProperty($,"__esModule",{value:!0})})});var bu=D5((oU1,Ru)=>{var QB0="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";Ru.exports=QB0});var vu=D5((sU1,xu)=>{var zB0=bu();function yu(){}function hu(){}hu.resetWarningCache=yu;xu.exports=function(){function $(J,B,Q,z,X,G){if(G===zB0)return;var U=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 U.name="Invariant Violation",U}$.isRequired=$;function Z(){return $}var H={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:hu,resetWarningCache:yu};return H.PropTypes=H,H}});var cB=D5((tU1,gu)=>{gu.exports=vu()();var XB0,GB0});var uu=D5((eU1,Pq)=>{function mu($){var Z,H,J="";if(typeof $=="string"||typeof $=="number")J+=$;else if(typeof $=="object")if(Array.isArray($)){var B=$.length;for(Z=0;Z<B;Z++)$[Z]&&(H=mu($[Z]))&&(J&&(J+=" "),J+=H)}else for(H in $)$[H]&&(J&&(J+=" "),J+=H);return J}function fu(){for(var $,Z,H=0,J="",B=arguments.length;H<B;H++)($=arguments[H])&&(Z=mu($))&&(J&&(J+=" "),J+=Z);return J}Pq.exports=fu,Pq.exports.clsx=fu});var dB=D5((pu)=>{Object.defineProperty(pu,"__esModule",{value:!0});pu.dontSetMe=WB0;pu.findInArray=UB0;pu.int=YB0;pu.isFunction=KB0;pu.isNum=FB0;function UB0($,Z){for(let H=0,J=$.length;H<J;H++)if(Z.apply(Z,[$[H],H,$]))return $[H]}function KB0($){return typeof $==="function"||Object.prototype.toString.call($)==="[object Function]"}function FB0($){return typeof $==="number"&&!isNaN($)}function YB0($){return parseInt($,10)}function WB0($,Z,H){if($[Z])return Error(`Invalid prop ${Z} passed to ${H} - do not set this, set it on the child.`)}});var ru=D5((lu)=>{Object.defineProperty(lu,"__esModule",{value:!0});lu.browserPrefixToKey=du;lu.browserPrefixToStyle=qB0;lu.default=void 0;lu.getPrefix=cu;var _q=["Moz","Webkit","O","ms"];function cu(){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 H=0;H<_q.length;H++)if(du($,_q[H])in Z)return _q[H];return""}function du($,Z){return Z?`${Z}${MB0($)}`:$}function qB0($,Z){return Z?`-${Z.toLowerCase()}-${$}`:$}function MB0($){let Z="",H=!0;for(let J=0;J<$.length;J++)if(H)Z+=$[J].toUpperCase(),H=!1;else if($[J]==="-")H=!0;else Z+=$[J];return Z}var ZK1=lu.default=cu()});var wF=D5(($p)=>{Object.defineProperty($p,"__esModule",{value:!0});$p.addClassName=tu;$p.addEvent=TB0;$p.addUserSelectStyles=xB0;$p.createCSSTransform=RB0;$p.createSVGTransform=bB0;$p.getTouch=yB0;$p.getTouchIdentifier=hB0;$p.getTranslation=jq;$p.innerHeight=SB0;$p.innerWidth=IB0;$p.matchesSelector=su;$p.matchesSelectorAndParentsTo=OB0;$p.offsetXYFromParent=kB0;$p.outerHeight=wB0;$p.outerWidth=EB0;$p.removeClassName=eu;$p.removeEvent=CB0;$p.scheduleRemoveUserSelectStyles=vB0;var l2=dB(),au=ou(ru());function ou($,Z){if(typeof WeakMap=="function")var H=new WeakMap,J=new WeakMap;return(ou=function(B,Q){if(!Q&&B&&B.__esModule)return B;var z,X,G={__proto__:null,default:B};if(B===null||typeof B!="object"&&typeof B!="function")return G;if(z=Q?J:H){if(z.has(B))return z.get(B);z.set(B,G)}for(let U in B)U!=="default"&&{}.hasOwnProperty.call(B,U)&&((X=(z=Object.defineProperty)&&Object.getOwnPropertyDescriptor(B,U))&&(X.get||X.set)?z(G,U,X):G[U]=B[U]);return G})($,Z)}var CF="";function su($,Z){if(!CF)CF=(0,l2.findInArray)(["matches","webkitMatchesSelector","mozMatchesSelector","msMatchesSelector","oMatchesSelector"],function(H){return(0,l2.isFunction)($[H])});if(!(0,l2.isFunction)($[CF]))return!1;return $[CF](Z)}function OB0($,Z,H){let J=$;do{if(su(J,Z))return!0;if(J===H)return!1;J=J.parentNode}while(J);return!1}function TB0($,Z,H,J){if(!$)return;let B={capture:!0,...J};if($.addEventListener)$.addEventListener(Z,H,B);else if($.attachEvent)$.attachEvent("on"+Z,H);else $["on"+Z]=H}function CB0($,Z,H,J){if(!$)return;let B={capture:!0,...J};if($.removeEventListener)$.removeEventListener(Z,H,B);else if($.detachEvent)$.detachEvent("on"+Z,H);else $["on"+Z]=null}function wB0($){let Z=$.clientHeight,H=$.ownerDocument.defaultView.getComputedStyle($);return Z+=(0,l2.int)(H.borderTopWidth),Z+=(0,l2.int)(H.borderBottomWidth),Z}function EB0($){let Z=$.clientWidth,H=$.ownerDocument.defaultView.getComputedStyle($);return Z+=(0,l2.int)(H.borderLeftWidth),Z+=(0,l2.int)(H.borderRightWidth),Z}function SB0($){let Z=$.clientHeight,H=$.ownerDocument.defaultView.getComputedStyle($);return Z-=(0,l2.int)(H.paddingTop),Z-=(0,l2.int)(H.paddingBottom),Z}function IB0($){let Z=$.clientWidth,H=$.ownerDocument.defaultView.getComputedStyle($);return Z-=(0,l2.int)(H.paddingLeft),Z-=(0,l2.int)(H.paddingRight),Z}function kB0($,Z,H){let B=Z===Z.ownerDocument.body?{left:0,top:0}:Z.getBoundingClientRect(),Q=($.clientX+Z.scrollLeft-B.left)/H,z=($.clientY+Z.scrollTop-B.top)/H;return{x:Q,y:z}}function RB0($,Z){let H=jq($,Z,"px");return{[(0,au.browserPrefixToKey)("transform",au.default)]:H}}function bB0($,Z){return jq($,Z,"")}function jq($,Z,H){let{x:J,y:B}=$,Q=`translate(${J}${H},${B}${H})`;if(Z){let z=`${typeof Z.x==="string"?Z.x:Z.x+H}`,X=`${typeof Z.y==="string"?Z.y:Z.y+H}`;Q=`translate(${z}, ${X})`+Q}return Q}function yB0($,Z){return $.targetTouches&&(0,l2.findInArray)($.targetTouches,(H)=>Z===H.identifier)||$.changedTouches&&(0,l2.findInArray)($.changedTouches,(H)=>Z===H.identifier)}function hB0($){if($.targetTouches&&$.targetTouches[0])return $.targetTouches[0].identifier;if($.changedTouches&&$.changedTouches[0])return $.changedTouches[0].identifier}function xB0($){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;}
8
- `,Z.innerHTML+=`.react-draggable-transparent-selection *::selection {all: inherit;}
9
- `,$.getElementsByTagName("head")[0].appendChild(Z);if($.body)tu($.body,"react-draggable-transparent-selection")}function vB0($){if(window.requestAnimationFrame)window.requestAnimationFrame(()=>{nu($)});else nu($)}function nu($){if(!$)return;try{if($.body)eu($.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 tu($,Z){if($.classList)$.classList.add(Z);else if(!$.className.match(new RegExp(`(?:^|\\s)${Z}(?!\\S)`)))$.className+=` ${Z}`}function eu($,Z){if($.classList)$.classList.remove(Z);else $.className=$.className.replace(new RegExp(`(?:^|\\s)${Z}(?!\\S)`,"g"),"")}});var Tq=D5((Zp)=>{Object.defineProperty(Zp,"__esModule",{value:!0});Zp.canDragX=BQ0;Zp.canDragY=QQ0;Zp.createCoreData=XQ0;Zp.createDraggableData=GQ0;Zp.getBoundPosition=HQ0;Zp.getControlPosition=zQ0;Zp.snapToGrid=JQ0;var i2=dB(),ZH=wF();function HQ0($,Z,H){if(!$.props.bounds)return[Z,H];let{bounds:J}=$.props;J=typeof J==="string"?J:UQ0(J);let B=Oq($);if(typeof J==="string"){let{ownerDocument:Q}=B,z=Q.defaultView,X;if(J==="parent")X=B.parentNode;else X=B.getRootNode().querySelector(J);if(!(X instanceof z.HTMLElement))throw Error('Bounds selector "'+J+'" could not find an element.');let G=X,U=z.getComputedStyle(B),K=z.getComputedStyle(G);J={left:-B.offsetLeft+(0,i2.int)(K.paddingLeft)+(0,i2.int)(U.marginLeft),top:-B.offsetTop+(0,i2.int)(K.paddingTop)+(0,i2.int)(U.marginTop),right:(0,ZH.innerWidth)(G)-(0,ZH.outerWidth)(B)-B.offsetLeft+(0,i2.int)(K.paddingRight)-(0,i2.int)(U.marginRight),bottom:(0,ZH.innerHeight)(G)-(0,ZH.outerHeight)(B)-B.offsetTop+(0,i2.int)(K.paddingBottom)-(0,i2.int)(U.marginBottom)}}if((0,i2.isNum)(J.right))Z=Math.min(Z,J.right);if((0,i2.isNum)(J.bottom))H=Math.min(H,J.bottom);if((0,i2.isNum)(J.left))Z=Math.max(Z,J.left);if((0,i2.isNum)(J.top))H=Math.max(H,J.top);return[Z,H]}function JQ0($,Z,H){let J=Math.round(Z/$[0])*$[0],B=Math.round(H/$[1])*$[1];return[J,B]}function BQ0($){return $.props.axis==="both"||$.props.axis==="x"}function QQ0($){return $.props.axis==="both"||$.props.axis==="y"}function zQ0($,Z,H){let J=typeof Z==="number"?(0,ZH.getTouch)($,Z):null;if(typeof Z==="number"&&!J)return null;let B=Oq(H),Q=H.props.offsetParent||B.offsetParent||B.ownerDocument.body;return(0,ZH.offsetXYFromParent)(J||$,Q,H.props.scale)}function XQ0($,Z,H){let J=!(0,i2.isNum)($.lastX),B=Oq($);if(J)return{node:B,deltaX:0,deltaY:0,lastX:Z,lastY:H,x:Z,y:H};else return{node:B,deltaX:Z-$.lastX,deltaY:H-$.lastY,lastX:$.lastX,lastY:$.lastY,x:Z,y:H}}function GQ0($,Z){let H=$.props.scale;return{node:Z.node,x:$.state.x+Z.deltaX/H,y:$.state.y+Z.deltaY/H,deltaX:Z.deltaX/H,deltaY:Z.deltaY/H,lastX:$.state.x,lastY:$.state.y}}function UQ0($){return{left:$.left,top:$.top,right:$.right,bottom:$.bottom}}function Oq($){let Z=$.findDOMNode();if(!Z)throw Error("<DraggableCore>: Unmounted during event!");return Z}});var Cq=D5((Hp)=>{Object.defineProperty(Hp,"__esModule",{value:!0});Hp.default=LQ0;function LQ0(){}});var zp=D5((Bp)=>{var _Q0=_(p()),jQ0=_(x2());Object.defineProperty(Bp,"__esModule",{value:!0});Bp.default=void 0;var wq=Jp(_Q0),W2=Sq(cB()),qQ0=Sq(jQ0),n4=wF(),E6=Tq(),Eq=dB(),lB=Sq(Cq());function Sq($){return $&&$.__esModule?$:{default:$}}function Jp($,Z){if(typeof WeakMap=="function")var H=new WeakMap,J=new WeakMap;return(Jp=function(B,Q){if(!Q&&B&&B.__esModule)return B;var z,X,G={__proto__:null,default:B};if(B===null||typeof B!="object"&&typeof B!="function")return G;if(z=Q?J:H){if(z.has(B))return z.get(B);z.set(B,G)}for(let U in B)U!=="default"&&{}.hasOwnProperty.call(B,U)&&((X=(z=Object.defineProperty)&&Object.getOwnPropertyDescriptor(B,U))&&(X.get||X.set)?z(G,U,X):G[U]=B[U]);return G})($,Z)}function A2($,Z,H){return(Z=MQ0(Z))in $?Object.defineProperty($,Z,{value:H,enumerable:!0,configurable:!0,writable:!0}):$[Z]=H,$}function MQ0($){var Z=PQ0($,"string");return typeof Z=="symbol"?Z:Z+""}function PQ0($,Z){if(typeof $!="object"||!$)return $;var H=$[Symbol.toPrimitive];if(H!==void 0){var J=H.call($,Z||"default");if(typeof J!="object")return J;throw TypeError("@@toPrimitive must return a primitive value.")}return(Z==="string"?String:Number)($)}var g8={touch:{start:"touchstart",move:"touchmove",stop:"touchend"},mouse:{start:"mousedown",move:"mousemove",stop:"mouseup"}},S6=g8.mouse;class iB extends wq.Component{constructor(){super(...arguments);A2(this,"dragging",!1),A2(this,"lastX",NaN),A2(this,"lastY",NaN),A2(this,"touchIdentifier",null),A2(this,"mounted",!1),A2(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:H}=Z;if(this.props.disabled||!($.target instanceof H.defaultView.Node)||this.props.handle&&!(0,n4.matchesSelectorAndParentsTo)($.target,this.props.handle,Z)||this.props.cancel&&(0,n4.matchesSelectorAndParentsTo)($.target,this.props.cancel,Z))return;if($.type==="touchstart"&&!this.props.allowMobileScroll)$.preventDefault();let J=(0,n4.getTouchIdentifier)($);this.touchIdentifier=J;let B=(0,E6.getControlPosition)($,J,this);if(B==null)return;let{x:Q,y:z}=B,X=(0,E6.createCoreData)(this,Q,z);if((0,lB.default)("DraggableCore: handleDragStart: %j",X),(0,lB.default)("calling",this.props.onStart),this.props.onStart($,X)===!1||this.mounted===!1)return;if(this.props.enableUserSelectHack)(0,n4.addUserSelectStyles)(H);this.dragging=!0,this.lastX=Q,this.lastY=z,(0,n4.addEvent)(H,S6.move,this.handleDrag),(0,n4.addEvent)(H,S6.stop,this.handleDragStop)}),A2(this,"handleDrag",($)=>{let Z=(0,E6.getControlPosition)($,this.touchIdentifier,this);if(Z==null)return;let{x:H,y:J}=Z;if(Array.isArray(this.props.grid)){let z=H-this.lastX,X=J-this.lastY;if([z,X]=(0,E6.snapToGrid)(this.props.grid,z,X),!z&&!X)return;H=this.lastX+z,J=this.lastY+X}let B=(0,E6.createCoreData)(this,H,J);if((0,lB.default)("DraggableCore: handleDrag: %j",B),this.props.onDrag($,B)===!1||this.mounted===!1){try{this.handleDragStop(new MouseEvent("mouseup"))}catch(z){let X=document.createEvent("MouseEvents");X.initMouseEvent("mouseup",!0,!0,window,0,0,0,0,0,!1,!1,!1,!1,0,null),this.handleDragStop(X)}return}this.lastX=H,this.lastY=J}),A2(this,"handleDragStop",($)=>{if(!this.dragging)return;let Z=(0,E6.getControlPosition)($,this.touchIdentifier,this);if(Z==null)return;let{x:H,y:J}=Z;if(Array.isArray(this.props.grid)){let X=H-this.lastX||0,G=J-this.lastY||0;[X,G]=(0,E6.snapToGrid)(this.props.grid,X,G),H=this.lastX+X,J=this.lastY+G}let B=(0,E6.createCoreData)(this,H,J);if(this.props.onStop($,B)===!1||this.mounted===!1)return!1;let z=this.findDOMNode();if(z){if(this.props.enableUserSelectHack)(0,n4.scheduleRemoveUserSelectStyles)(z.ownerDocument)}if((0,lB.default)("DraggableCore: handleDragStop: %j",B),this.dragging=!1,this.lastX=NaN,this.lastY=NaN,z)(0,lB.default)("DraggableCore: Removing handlers"),(0,n4.removeEvent)(z.ownerDocument,S6.move,this.handleDrag),(0,n4.removeEvent)(z.ownerDocument,S6.stop,this.handleDragStop)}),A2(this,"onMouseDown",($)=>{return S6=g8.mouse,this.handleDragStart($)}),A2(this,"onMouseUp",($)=>{return S6=g8.mouse,this.handleDragStop($)}),A2(this,"onTouchStart",($)=>{return S6=g8.touch,this.handleDragStart($)}),A2(this,"onTouchEnd",($)=>{return S6=g8.touch,this.handleDragStop($)})}componentDidMount(){this.mounted=!0;let $=this.findDOMNode();if($)(0,n4.addEvent)($,g8.touch.start,this.onTouchStart,{passive:!1})}componentWillUnmount(){this.mounted=!1;let $=this.findDOMNode();if($){let{ownerDocument:Z}=$;if((0,n4.removeEvent)(Z,g8.mouse.move,this.handleDrag),(0,n4.removeEvent)(Z,g8.touch.move,this.handleDrag),(0,n4.removeEvent)(Z,g8.mouse.stop,this.handleDragStop),(0,n4.removeEvent)(Z,g8.touch.stop,this.handleDragStop),(0,n4.removeEvent)($,g8.touch.start,this.onTouchStart,{passive:!1}),this.props.enableUserSelectHack)(0,n4.scheduleRemoveUserSelectStyles)(Z)}}findDOMNode(){return this.props?.nodeRef?this.props?.nodeRef?.current:qQ0.default.findDOMNode(this)}render(){return wq.cloneElement(wq.Children.only(this.props.children),{onMouseDown:this.onMouseDown,onMouseUp:this.onMouseUp,onTouchEnd:this.onTouchEnd})}}Bp.default=iB;A2(iB,"displayName","DraggableCore");A2(iB,"propTypes",{allowAnyClick:W2.default.bool,allowMobileScroll:W2.default.bool,children:W2.default.node.isRequired,disabled:W2.default.bool,enableUserSelectHack:W2.default.bool,offsetParent:function($,Z){if($[Z]&&$[Z].nodeType!==1)throw Error("Draggable's offsetParent must be a DOM Node.")},grid:W2.default.arrayOf(W2.default.number),handle:W2.default.string,cancel:W2.default.string,nodeRef:W2.default.object,onStart:W2.default.func,onDrag:W2.default.func,onStop:W2.default.func,onMouseDown:W2.default.func,scale:W2.default.number,className:Eq.dontSetMe,style:Eq.dontSetMe,transform:Eq.dontSetMe});A2(iB,"defaultProps",{allowAnyClick:!1,allowMobileScroll:!1,disabled:!1,enableUserSelectHack:!0,onStart:function(){},onDrag:function(){},onStop:function(){},onMouseDown:function(){},scale:1})});var Kp=D5((Rq)=>{var EQ0=_(p()),SQ0=_(x2());Object.defineProperty(Rq,"__esModule",{value:!0});Object.defineProperty(Rq,"DraggableCore",{enumerable:!0,get:function(){return IF.default}});Rq.default=void 0;var EF=Gp(EQ0),O5=kF(cB()),OQ0=kF(SQ0),TQ0=uu(),Xp=wF(),HH=Tq(),Iq=dB(),IF=kF(zp()),SF=kF(Cq());function kF($){return $&&$.__esModule?$:{default:$}}function Gp($,Z){if(typeof WeakMap=="function")var H=new WeakMap,J=new WeakMap;return(Gp=function(B,Q){if(!Q&&B&&B.__esModule)return B;var z,X,G={__proto__:null,default:B};if(B===null||typeof B!="object"&&typeof B!="function")return G;if(z=Q?J:H){if(z.has(B))return z.get(B);z.set(B,G)}for(let U in B)U!=="default"&&{}.hasOwnProperty.call(B,U)&&((X=(z=Object.defineProperty)&&Object.getOwnPropertyDescriptor(B,U))&&(X.get||X.set)?z(G,U,X):G[U]=B[U]);return G})($,Z)}function kq(){return kq=Object.assign?Object.assign.bind():function($){for(var Z=1;Z<arguments.length;Z++){var H=arguments[Z];for(var J in H)({}).hasOwnProperty.call(H,J)&&($[J]=H[J])}return $},kq.apply(null,arguments)}function JH($,Z,H){return(Z=CQ0(Z))in $?Object.defineProperty($,Z,{value:H,enumerable:!0,configurable:!0,writable:!0}):$[Z]=H,$}function CQ0($){var Z=wQ0($,"string");return typeof Z=="symbol"?Z:Z+""}function wQ0($,Z){if(typeof $!="object"||!$)return $;var H=$[Symbol.toPrimitive];if(H!==void 0){var J=H.call($,Z||"default");if(typeof J!="object")return J;throw TypeError("@@toPrimitive must return a primitive value.")}return(Z==="string"?String:Number)($)}class rB extends EF.Component{static getDerivedStateFromProps($,Z){let{position:H}=$,{prevPropsPosition:J}=Z;if(H&&(!J||H.x!==J.x||H.y!==J.y))return(0,SF.default)("Draggable: getDerivedStateFromProps %j",{position:H,prevPropsPosition:J}),{x:H.x,y:H.y,prevPropsPosition:{...H}};return null}constructor($){super($);if(JH(this,"onDragStart",(Z,H)=>{if((0,SF.default)("Draggable: onDragStart: %j",H),this.props.onStart(Z,(0,HH.createDraggableData)(this,H))===!1)return!1;this.setState({dragging:!0,dragged:!0})}),JH(this,"onDrag",(Z,H)=>{if(!this.state.dragging)return!1;(0,SF.default)("Draggable: onDrag: %j",H);let J=(0,HH.createDraggableData)(this,H),B={x:J.x,y:J.y,slackX:0,slackY:0};if(this.props.bounds){let{x:z,y:X}=B;B.x+=this.state.slackX,B.y+=this.state.slackY;let[G,U]=(0,HH.getBoundPosition)(this,B.x,B.y);B.x=G,B.y=U,B.slackX=this.state.slackX+(z-B.x),B.slackY=this.state.slackY+(X-B.y),J.x=B.x,J.y=B.y,J.deltaX=B.x-this.state.x,J.deltaY=B.y-this.state.y}if(this.props.onDrag(Z,J)===!1)return!1;this.setState(B)}),JH(this,"onDragStop",(Z,H)=>{if(!this.state.dragging)return!1;if(this.props.onStop(Z,(0,HH.createDraggableData)(this,H))===!1)return!1;(0,SF.default)("Draggable: onDragStop: %j",H);let B={dragging:!1,slackX:0,slackY:0};if(Boolean(this.props.position)){let{x:z,y:X}=this.props.position;B.x=z,B.y=X}this.setState(B)}),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??OQ0.default.findDOMNode(this)}render(){let{axis:$,bounds:Z,children:H,defaultPosition:J,defaultClassName:B,defaultClassNameDragging:Q,defaultClassNameDragged:z,position:X,positionOffset:G,scale:U,...K}=this.props,F={},Y=null,A=!Boolean(X)||this.state.dragging,N=X||J,L={x:(0,HH.canDragX)(this)&&A?this.state.x:N.x,y:(0,HH.canDragY)(this)&&A?this.state.y:N.y};if(this.state.isElementSVG)Y=(0,Xp.createSVGTransform)(L,G);else F=(0,Xp.createCSSTransform)(L,G);let V=(0,TQ0.clsx)(H.props.className||"",B,{[Q]:this.state.dragging,[z]:this.state.dragged});return EF.createElement(IF.default,kq({},K,{onStart:this.onDragStart,onDrag:this.onDrag,onStop:this.onDragStop}),EF.cloneElement(EF.Children.only(H),{className:V,style:{...H.props.style,...F},transform:Y}))}}Rq.default=rB;JH(rB,"displayName","Draggable");JH(rB,"propTypes",{...IF.default.propTypes,axis:O5.default.oneOf(["both","x","y","none"]),bounds:O5.default.oneOfType([O5.default.shape({left:O5.default.number,right:O5.default.number,top:O5.default.number,bottom:O5.default.number}),O5.default.string,O5.default.oneOf([!1])]),defaultClassName:O5.default.string,defaultClassNameDragging:O5.default.string,defaultClassNameDragged:O5.default.string,defaultPosition:O5.default.shape({x:O5.default.number,y:O5.default.number}),positionOffset:O5.default.shape({x:O5.default.oneOfType([O5.default.number,O5.default.string]),y:O5.default.oneOfType([O5.default.number,O5.default.string])}),position:O5.default.shape({x:O5.default.number,y:O5.default.number}),className:Iq.dontSetMe,style:Iq.dontSetMe,transform:Iq.dontSetMe});JH(rB,"defaultProps",{...IF.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 bF=D5((GK1,RF)=>{var{default:Fp,DraggableCore:IQ0}=Kp();RF.exports=Fp;RF.exports.default=Fp;RF.exports.DraggableCore=IQ0});var Ap=D5((vQ0)=>{var mQ0=_(p());vQ0.__esModule=!0;vQ0.cloneElement=xQ0;var kQ0=RQ0(mQ0);function RQ0($){return $&&$.__esModule?$:{default:$}}function Yp($,Z){var H=Object.keys($);if(Object.getOwnPropertySymbols){var J=Object.getOwnPropertySymbols($);Z&&(J=J.filter(function(B){return Object.getOwnPropertyDescriptor($,B).enumerable})),H.push.apply(H,J)}return H}function Wp($){for(var Z=1;Z<arguments.length;Z++){var H=arguments[Z]!=null?arguments[Z]:{};Z%2?Yp(Object(H),!0).forEach(function(J){bQ0($,J,H[J])}):Object.getOwnPropertyDescriptors?Object.defineProperties($,Object.getOwnPropertyDescriptors(H)):Yp(Object(H)).forEach(function(J){Object.defineProperty($,J,Object.getOwnPropertyDescriptor(H,J))})}return $}function bQ0($,Z,H){return(Z=yQ0(Z))in $?Object.defineProperty($,Z,{value:H,enumerable:!0,configurable:!0,writable:!0}):$[Z]=H,$}function yQ0($){var Z=hQ0($,"string");return typeof Z=="symbol"?Z:Z+""}function hQ0($,Z){if(typeof $!="object"||!$)return $;var H=$[Symbol.toPrimitive];if(H!==void 0){var J=H.call($,Z||"default");if(typeof J!="object")return J;throw TypeError("@@toPrimitive must return a primitive value.")}return(Z==="string"?String:Number)($)}function xQ0($,Z){if(Z.style&&$.props.style)Z.style=Wp(Wp({},$.props.style),Z.style);if(Z.className&&$.props.className)Z.className=`${$.props.className} ${Z.className}`;return kQ0.default.cloneElement($,Z)}});var bq=D5((pQ0)=>{pQ0.__esModule=!0;pQ0.resizableProps=void 0;var T1=uQ0(cB()),KK1=bF();function uQ0($){return $&&$.__esModule?$:{default:$}}var FK1=pQ0.resizableProps={axis:T1.default.oneOf(["both","x","y","none"]),className:T1.default.string,children:T1.default.element.isRequired,draggableOpts:T1.default.shape({allowAnyClick:T1.default.bool,cancel:T1.default.string,children:T1.default.node,disabled:T1.default.bool,enableUserSelectHack:T1.default.bool,offsetParent:typeof Element<"u"?T1.default.instanceOf(Element):T1.default.any,grid:T1.default.arrayOf(T1.default.number),handle:T1.default.string,nodeRef:T1.default.object,onStart:T1.default.func,onDrag:T1.default.func,onStop:T1.default.func,onMouseDown:T1.default.func,scale:T1.default.number}),height:function(){for(var $=arguments.length,Z=Array($),H=0;H<$;H++)Z[H]=arguments[H];let[J]=Z;if(J.axis==="both"||J.axis==="y")return T1.default.number.isRequired(...Z);return T1.default.number(...Z)},handle:T1.default.oneOfType([T1.default.node,T1.default.func]),handleSize:T1.default.arrayOf(T1.default.number),lockAspectRatio:T1.default.bool,maxConstraints:T1.default.arrayOf(T1.default.number),minConstraints:T1.default.arrayOf(T1.default.number),onResizeStop:T1.default.func,onResizeStart:T1.default.func,onResize:T1.default.func,resizeHandles:T1.default.arrayOf(T1.default.oneOf(["s","w","e","n","sw","nw","se","ne"])),transformScale:T1.default.number,width:function(){for(var $=arguments.length,Z=Array($),H=0;H<$;H++)Z[H]=arguments[H];let[J]=Z;if(J.axis==="both"||J.axis==="x")return T1.default.number.isRequired(...Z);return T1.default.number(...Z)}}});var xq=D5((eQ0)=>{var Zz0=_(p());eQ0.__esModule=!0;eQ0.default=void 0;var BH=Lp(Zz0),dQ0=bF(),lQ0=Ap(),iQ0=bq(),rQ0=["children","className","draggableOpts","width","height","handle","handleSize","lockAspectRatio","axis","minConstraints","maxConstraints","onResize","onResizeStop","onResizeStart","resizeHandles","transformScale"];function Lp($,Z){if(typeof WeakMap=="function")var H=new WeakMap,J=new WeakMap;return(Lp=function(B,Q){if(!Q&&B&&B.__esModule)return B;var z,X,G={__proto__:null,default:B};if(B===null||typeof B!="object"&&typeof B!="function")return G;if(z=Q?J:H){if(z.has(B))return z.get(B);z.set(B,G)}for(let U in B)U!=="default"&&{}.hasOwnProperty.call(B,U)&&((X=(z=Object.defineProperty)&&Object.getOwnPropertyDescriptor(B,U))&&(X.get||X.set)?z(G,U,X):G[U]=B[U]);return G})($,Z)}function hq(){return hq=Object.assign?Object.assign.bind():function($){for(var Z=1;Z<arguments.length;Z++){var H=arguments[Z];for(var J in H)({}).hasOwnProperty.call(H,J)&&($[J]=H[J])}return $},hq.apply(null,arguments)}function aQ0($,Z){if($==null)return{};var H,J,B=nQ0($,Z);if(Object.getOwnPropertySymbols){var Q=Object.getOwnPropertySymbols($);for(J=0;J<Q.length;J++)H=Q[J],Z.indexOf(H)===-1&&{}.propertyIsEnumerable.call($,H)&&(B[H]=$[H])}return B}function nQ0($,Z){if($==null)return{};var H={};for(var J in $)if({}.hasOwnProperty.call($,J)){if(Z.indexOf(J)!==-1)continue;H[J]=$[J]}return H}function Vp($,Z){var H=Object.keys($);if(Object.getOwnPropertySymbols){var J=Object.getOwnPropertySymbols($);Z&&(J=J.filter(function(B){return Object.getOwnPropertyDescriptor($,B).enumerable})),H.push.apply(H,J)}return H}function yq($){for(var Z=1;Z<arguments.length;Z++){var H=arguments[Z]!=null?arguments[Z]:{};Z%2?Vp(Object(H),!0).forEach(function(J){oQ0($,J,H[J])}):Object.getOwnPropertyDescriptors?Object.defineProperties($,Object.getOwnPropertyDescriptors(H)):Vp(Object(H)).forEach(function(J){Object.defineProperty($,J,Object.getOwnPropertyDescriptor(H,J))})}return $}function oQ0($,Z,H){return(Z=sQ0(Z))in $?Object.defineProperty($,Z,{value:H,enumerable:!0,configurable:!0,writable:!0}):$[Z]=H,$}function sQ0($){var Z=tQ0($,"string");return typeof Z=="symbol"?Z:Z+""}function tQ0($,Z){if(typeof $!="object"||!$)return $;var H=$[Symbol.toPrimitive];if(H!==void 0){var J=H.call($,Z||"default");if(typeof J!="object")return J;throw TypeError("@@toPrimitive must return a primitive value.")}return(Z==="string"?String:Number)($)}class yF extends BH.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:H,maxConstraints:J,lockAspectRatio:B}=this.props;if(!H&&!J&&!B)return[$,Z];if(B){let U=this.props.width/this.props.height,K=$-this.props.width,F=Z-this.props.height;if(Math.abs(K)>Math.abs(F*U))Z=$/U;else $=Z*U}let[Q,z]=[$,Z],[X,G]=this.slack||[0,0];if($+=X,Z+=G,H)$=Math.max(H[0],$),Z=Math.max(H[1],Z);if(J)$=Math.min(J[0],$),Z=Math.min(J[1],Z);return this.slack=[X+(Q-$),G+(z-Z)],[$,Z]}resizeHandler($,Z){return(H,J)=>{let{node:B,deltaX:Q,deltaY:z}=J;if($==="onResizeStart")this.resetData();let X=(this.props.axis==="both"||this.props.axis==="x")&&Z!=="n"&&Z!=="s",G=(this.props.axis==="both"||this.props.axis==="y")&&Z!=="e"&&Z!=="w";if(!X&&!G)return;let U=Z[0],K=Z[Z.length-1],F=B.getBoundingClientRect();if(this.lastHandleRect!=null){if(K==="w"){let V=F.left-this.lastHandleRect.left;Q+=V}if(U==="n"){let V=F.top-this.lastHandleRect.top;z+=V}}if(this.lastHandleRect=F,K==="w")Q=-Q;if(U==="n")z=-z;let Y=this.props.width+(X?Q/this.props.transformScale:0),W=this.props.height+(G?z/this.props.transformScale:0);if([Y,W]=this.runConstraints(Y,W),$==="onResizeStop"&&this.lastSize)({width:Y,height:W}=this.lastSize);let A=Y!==this.props.width||W!==this.props.height;if($!=="onResizeStop")this.lastSize={width:Y,height:W};let N=typeof this.props[$]==="function"?this.props[$]:null;if(N&&!($==="onResize"&&!A))H.persist?.(),N(H,{node:B,size:{width:Y,height:W},handle:Z});if($==="onResizeStop")this.resetData()}}renderResizeHandle($,Z){let{handle:H}=this.props;if(!H)return BH.createElement("span",{className:`react-resizable-handle react-resizable-handle-${$}`,ref:Z});if(typeof H==="function")return H($,Z);let J=typeof H.type==="string",B=yq({ref:Z},J?{}:{handleAxis:$});return BH.cloneElement(H,B)}render(){let $=this.props,{children:Z,className:H,draggableOpts:J,width:B,height:Q,handle:z,handleSize:X,lockAspectRatio:G,axis:U,minConstraints:K,maxConstraints:F,onResize:Y,onResizeStop:W,onResizeStart:A,resizeHandles:N,transformScale:L}=$,V=aQ0($,rQ0);return(0,lQ0.cloneElement)(Z,yq(yq({},V),{},{className:`${H?`${H} `:""}react-resizable`,children:[...BH.Children.toArray(Z.props.children),...N.map((D)=>{let q=this.handleRefs[D]??(this.handleRefs[D]=BH.createRef());return BH.createElement(dQ0.DraggableCore,hq({},J,{nodeRef:q,key:`resizableHandle-${D}`,onStop:this.resizeHandler("onResizeStop",D),onStart:this.resizeHandler("onResizeStart",D),onDrag:this.resizeHandler("onResize",D)}),this.renderResizeHandle(D,q))})]}))}}eQ0.default=yF;yF.propTypes=iQ0.resizableProps;yF.defaultProps={axis:"both",handleSize:[20,20],lockAspectRatio:!1,minConstraints:[20,20],maxConstraints:[1/0,1/0],resizeHandles:["se"],transformScale:1}});var jp=D5((Fz0)=>{var Wz0=_(p());Fz0.__esModule=!0;Fz0.default=void 0;var vq=Pp(Wz0),Hz0=Mp(cB()),Jz0=Mp(xq()),Bz0=bq(),Qz0=["handle","handleSize","onResize","onResizeStart","onResizeStop","draggableOpts","minConstraints","maxConstraints","lockAspectRatio","axis","width","height","resizeHandles","style","transformScale"];function Mp($){return $&&$.__esModule?$:{default:$}}function Pp($,Z){if(typeof WeakMap=="function")var H=new WeakMap,J=new WeakMap;return(Pp=function(B,Q){if(!Q&&B&&B.__esModule)return B;var z,X,G={__proto__:null,default:B};if(B===null||typeof B!="object"&&typeof B!="function")return G;if(z=Q?J:H){if(z.has(B))return z.get(B);z.set(B,G)}for(let U in B)U!=="default"&&{}.hasOwnProperty.call(B,U)&&((X=(z=Object.defineProperty)&&Object.getOwnPropertyDescriptor(B,U))&&(X.get||X.set)?z(G,U,X):G[U]=B[U]);return G})($,Z)}function gq(){return gq=Object.assign?Object.assign.bind():function($){for(var Z=1;Z<arguments.length;Z++){var H=arguments[Z];for(var J in H)({}).hasOwnProperty.call(H,J)&&($[J]=H[J])}return $},gq.apply(null,arguments)}function qp($,Z){var H=Object.keys($);if(Object.getOwnPropertySymbols){var J=Object.getOwnPropertySymbols($);Z&&(J=J.filter(function(B){return Object.getOwnPropertyDescriptor($,B).enumerable})),H.push.apply(H,J)}return H}function hF($){for(var Z=1;Z<arguments.length;Z++){var H=arguments[Z]!=null?arguments[Z]:{};Z%2?qp(Object(H),!0).forEach(function(J){zz0($,J,H[J])}):Object.getOwnPropertyDescriptors?Object.defineProperties($,Object.getOwnPropertyDescriptors(H)):qp(Object(H)).forEach(function(J){Object.defineProperty($,J,Object.getOwnPropertyDescriptor(H,J))})}return $}function zz0($,Z,H){return(Z=Xz0(Z))in $?Object.defineProperty($,Z,{value:H,enumerable:!0,configurable:!0,writable:!0}):$[Z]=H,$}function Xz0($){var Z=Gz0($,"string");return typeof Z=="symbol"?Z:Z+""}function Gz0($,Z){if(typeof $!="object"||!$)return $;var H=$[Symbol.toPrimitive];if(H!==void 0){var J=H.call($,Z||"default");if(typeof J!="object")return J;throw TypeError("@@toPrimitive must return a primitive value.")}return(Z==="string"?String:Number)($)}function Uz0($,Z){if($==null)return{};var H,J,B=Kz0($,Z);if(Object.getOwnPropertySymbols){var Q=Object.getOwnPropertySymbols($);for(J=0;J<Q.length;J++)H=Q[J],Z.indexOf(H)===-1&&{}.propertyIsEnumerable.call($,H)&&(B[H]=$[H])}return B}function Kz0($,Z){if($==null)return{};var H={};for(var J in $)if({}.hasOwnProperty.call($,J)){if(Z.indexOf(J)!==-1)continue;H[J]=$[J]}return H}class fq extends vq.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:H}=Z;if(this.props.onResize)$.persist?.(),this.setState(H,()=>this.props.onResize&&this.props.onResize($,Z));else this.setState(H)}}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:H,onResize:J,onResizeStart:B,onResizeStop:Q,draggableOpts:z,minConstraints:X,maxConstraints:G,lockAspectRatio:U,axis:K,width:F,height:Y,resizeHandles:W,style:A,transformScale:N}=$,L=Uz0($,Qz0);return vq.createElement(Jz0.default,{axis:K,draggableOpts:z,handle:Z,handleSize:H,height:this.state.height,lockAspectRatio:U,maxConstraints:G,minConstraints:X,onResizeStart:B,onResize:this.onResize,onResizeStop:Q,resizeHandles:W,transformScale:N,width:this.state.width},vq.createElement("div",gq({},L,{style:hF(hF({},A),{},{width:this.state.width+"px",height:this.state.height+"px"})})))}}Fz0.default=fq;fq.propTypes=hF(hF({},Bz0.resizableProps),{},{children:Hz0.default.element})});var Op=D5((NK1,xF)=>{xF.exports=function(){throw Error("Don't instantiate Resizable directly! Use require('react-resizable').Resizable")};xF.exports.Resizable=xq().default;xF.exports.ResizableBox=jp().default});var n2=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 ti=class extends n2{#$;#Z;#H;constructor(){super();this.#H=($)=>{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.#H)}onUnsubscribe(){if(!this.hasListeners())this.#Z?.(),this.#Z=void 0}setEventListener($){this.#H=$,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"}},X$=new ti;var ei={setTimeout:($,Z)=>setTimeout($,Z),clearTimeout:($)=>clearTimeout($),setInterval:($,Z)=>setInterval($,Z),clearInterval:($)=>clearInterval($)},$r=class{#$=ei;#Z=!1;setTimeoutProvider($){this.#$=$}setTimeout($,Z){return this.#$.setTimeout($,Z)}clearTimeout($){this.#$.clearTimeout($)}setInterval($,Z){return this.#$.setInterval($,Z)}clearInterval($){this.#$.clearInterval($)}},p8=new $r;function CM($){setTimeout($,0)}var WY=typeof window>"u"||"Deno"in globalThis;function x5(){}function SM($,Z){return typeof $==="function"?$(Z):$}function LH($){return typeof $==="number"&&$>=0&&$!==1/0}function KQ($,Z){return Math.max($+(Z||0)-Date.now(),0)}function V8($,Z){return typeof $==="function"?$(Z):$}function $2($,Z){return typeof $==="function"?$(Z):$}function FQ($,Z){let{type:H="all",exact:J,fetchStatus:B,predicate:Q,queryKey:z,stale:X}=$;if(z){if(J){if(Z.queryHash!==DH(z,Z.options))return!1}else if(!v6(Z.queryKey,z))return!1}if(H!=="all"){let G=Z.isActive();if(H==="active"&&!G)return!1;if(H==="inactive"&&G)return!1}if(typeof X==="boolean"&&Z.isStale()!==X)return!1;if(B&&B!==Z.state.fetchStatus)return!1;if(Q&&!Q(Z))return!1;return!0}function YQ($,Z){let{exact:H,status:J,predicate:B,mutationKey:Q}=$;if(Q){if(!Z.options.mutationKey)return!1;if(H){if(c8(Z.options.mutationKey)!==c8(Q))return!1}else if(!v6(Z.options.mutationKey,Q))return!1}if(J&&Z.state.status!==J)return!1;if(B&&!B(Z))return!1;return!0}function DH($,Z){return(Z?.queryKeyHashFn||c8)($)}function c8($){return JSON.stringify($,(Z,H)=>YY(H)?Object.keys(H).sort().reduce((J,B)=>{return J[B]=H[B],J},{}):H)}function v6($,Z){if($===Z)return!0;if(typeof $!==typeof Z)return!1;if($&&Z&&typeof $==="object"&&typeof Z==="object")return Object.keys(Z).every((H)=>v6($[H],Z[H]));return!1}var Zr=Object.prototype.hasOwnProperty;function qH($,Z,H=0){if($===Z)return $;if(H>500)return Z;let J=wM($)&&wM(Z);if(!J&&!(YY($)&&YY(Z)))return Z;let Q=(J?$:Object.keys($)).length,z=J?Z:Object.keys(Z),X=z.length,G=J?Array(X):{},U=0;for(let K=0;K<X;K++){let F=J?K:z[K],Y=$[F],W=Z[F];if(Y===W){if(G[F]=Y,J?K<Q:Zr.call($,F))U++;continue}if(Y===null||W===null||typeof Y!=="object"||typeof W!=="object"){G[F]=W;continue}let A=qH(Y,W,H+1);if(G[F]=A,A===Y)U++}return Q===X&&U===Q?$:G}function G$($,Z){if(!Z||Object.keys($).length!==Object.keys(Z).length)return!1;for(let H in $)if($[H]!==Z[H])return!1;return!0}function wM($){return Array.isArray($)&&$.length===Object.keys($).length}function YY($){if(!EM($))return!1;let Z=$.constructor;if(Z===void 0)return!0;let H=Z.prototype;if(!EM(H))return!1;if(!H.hasOwnProperty("isPrototypeOf"))return!1;if(Object.getPrototypeOf($)!==Object.prototype)return!1;return!0}function EM($){return Object.prototype.toString.call($)==="[object Object]"}function IM($){return new Promise((Z)=>{p8.setTimeout(Z,$)})}function MH($,Z,H){if(typeof H.structuralSharing==="function")return H.structuralSharing($,Z);else if(H.structuralSharing!==!1)return qH($,Z);return Z}function kM($,Z,H=0){let J=[...$,Z];return H&&J.length>H?J.slice(1):J}function RM($,Z,H=0){let J=[Z,...$];return H&&J.length>H?J.slice(0,-1):J}var U$=Symbol();function WQ($,Z){if(!$.queryFn&&Z?.initialPromise)return()=>Z.initialPromise;if(!$.queryFn||$.queryFn===U$)return()=>Promise.reject(Error(`Missing queryFn: '${$.queryHash}'`));return $.queryFn}function K$($,Z){if(typeof $==="function")return $(...Z);return!!$}function bM($,Z,H){let J=!1,B;return Object.defineProperty($,"signal",{enumerable:!0,get:()=>{if(B??=Z(),J)return B;if(J=!0,B.aborted)H();else B.addEventListener("abort",H,{once:!0});return B}}),$}var d8=(()=>{let $=()=>WY;return{isServer(){return $()},setIsServer(Z){$=Z}}})();function PH(){let $,Z,H=new Promise((B,Q)=>{$=B,Z=Q});H.status="pending",H.catch(()=>{});function J(B){Object.assign(H,B),delete H.resolve,delete H.reject}return H.resolve=(B)=>{J({status:"fulfilled",value:B}),$(B)},H.reject=(B)=>{J({status:"rejected",reason:B}),Z(B)},H}var yM=CM;function Hr(){let $=[],Z=0,H=(X)=>{X()},J=(X)=>{X()},B=yM,Q=(X)=>{if(Z)$.push(X);else B(()=>{H(X)})},z=()=>{let X=$;if($=[],X.length)B(()=>{J(()=>{X.forEach((G)=>{H(G)})})})};return{batch:(X)=>{let G;Z++;try{G=X()}finally{if(Z--,!Z)z()}return G},batchCalls:(X)=>{return(...G)=>{Q(()=>{X(...G)})}},schedule:Q,setNotifyFunction:(X)=>{H=X},setBatchNotifyFunction:(X)=>{J=X},setScheduler:(X)=>{B=X}}}var e1=Hr();var Jr=class extends n2{#$=!0;#Z;#H;constructor(){super();this.#H=($)=>{if(typeof window<"u"&&window.addEventListener){let Z=()=>$(!0),H=()=>$(!1);return window.addEventListener("online",Z,!1),window.addEventListener("offline",H,!1),()=>{window.removeEventListener("online",Z),window.removeEventListener("offline",H)}}return}}onSubscribe(){if(!this.#Z)this.setEventListener(this.#H)}onUnsubscribe(){if(!this.hasListeners())this.#Z?.(),this.#Z=void 0}setEventListener($){this.#H=$,this.#Z?.(),this.#Z=$(this.setOnline.bind(this))}setOnline($){if(this.#$!==$)this.#$=$,this.listeners.forEach((H)=>{H($)})}isOnline(){return this.#$}},F$=new Jr;function Br($){return Math.min(1000*2**$,30000)}function AY($){return($??"online")==="online"?F$.isOnline():!0}var AQ=class extends Error{constructor($){super("CancelledError");this.revert=$?.revert,this.silent=$?.silent}};function NQ($){let Z=!1,H=0,J,B=PH(),Q=()=>B.status!=="pending",z=(N)=>{if(!Q()){let L=new AQ(N);Y(L),$.onCancel?.(L)}},X=()=>{Z=!0},G=()=>{Z=!1},U=()=>X$.isFocused()&&($.networkMode==="always"||F$.isOnline())&&$.canRun(),K=()=>AY($.networkMode)&&$.canRun(),F=(N)=>{if(!Q())J?.(),B.resolve(N)},Y=(N)=>{if(!Q())J?.(),B.reject(N)},W=()=>{return new Promise((N)=>{J=(L)=>{if(Q()||U())N(L)},$.onPause?.()}).then(()=>{if(J=void 0,!Q())$.onContinue?.()})},A=()=>{if(Q())return;let N,L=H===0?$.initialPromise:void 0;try{N=L??$.fn()}catch(V){N=Promise.reject(V)}Promise.resolve(N).then(F).catch((V)=>{if(Q())return;let D=$.retry??(d8.isServer()?0:3),q=$.retryDelay??Br,j=typeof q==="function"?q(H,V):q,M=D===!0||typeof D==="number"&&H<D||typeof D==="function"&&D(H,V);if(Z||!M){Y(V);return}H++,$.onFail?.(H,V),IM(j).then(()=>{return U()?void 0:W()}).then(()=>{if(Z)Y(V);else A()})})};return{promise:B,status:()=>B.status,cancel:z,continue:()=>{return J?.(),B},cancelRetry:X,continueRetry:G,canStart:K,start:()=>{if(K())A();else W().then(A);return B}}}var VQ=class{#$;destroy(){this.clearGcTimeout()}scheduleGc(){if(this.clearGcTimeout(),LH(this.gcTime))this.#$=p8.setTimeout(()=>{this.optionalRemove()},this.gcTime)}updateGcTime($){this.gcTime=Math.max(this.gcTime||0,$??(d8.isServer()?1/0:300000))}clearGcTimeout(){if(this.#$!==void 0)p8.clearTimeout(this.#$),this.#$=void 0}};var vM=class extends VQ{#$;#Z;#H;#B;#J;#Q;#z;constructor($){super();this.#z=!1,this.#Q=$.defaultOptions,this.setOptions($.options),this.observers=[],this.#B=$.client,this.#H=this.#B.getQueryCache(),this.queryKey=$.queryKey,this.queryHash=$.queryHash,this.#$=xM(this.options),this.state=$.state??this.#$,this.scheduleGc()}get meta(){return this.options.meta}get promise(){return this.#J?.promise}setOptions($){if(this.options={...this.#Q,...$},this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){let Z=xM(this.options);if(Z.data!==void 0)this.setState(hM(Z.data,Z.dataUpdatedAt)),this.#$=Z}}optionalRemove(){if(!this.observers.length&&this.state.fetchStatus==="idle")this.#H.remove(this)}setData($,Z){let H=MH(this.state.data,$,this.options);return this.#G({data:H,type:"success",dataUpdatedAt:Z?.updatedAt,manual:Z?.manual}),H}setState($,Z){this.#G({type:"setState",state:$,setStateOptions:Z})}cancel($){let Z=this.#J?.promise;return this.#J?.cancel($),Z?Z.then(x5).catch(x5):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(($)=>$2($.options.enabled,this)!==!1)}isDisabled(){if(this.getObserversCount()>0)return!this.isActive();return this.options.queryFn===U$||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){if(this.getObserversCount()>0)return this.observers.some(($)=>V8($.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!KQ(this.state.dataUpdatedAt,$)}onFocus(){this.observers.find((Z)=>Z.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#J?.continue()}onOnline(){this.observers.find((Z)=>Z.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#J?.continue()}addObserver($){if(!this.observers.includes($))this.observers.push($),this.clearGcTimeout(),this.#H.notify({type:"observerAdded",query:this,observer:$})}removeObserver($){if(this.observers.includes($)){if(this.observers=this.observers.filter((Z)=>Z!==$),!this.observers.length){if(this.#J)if(this.#z||this.#X())this.#J.cancel({revert:!0});else this.#J.cancelRetry();this.scheduleGc()}this.#H.notify({type:"observerRemoved",query:this,observer:$})}}getObserversCount(){return this.observers.length}#X(){return this.state.fetchStatus==="paused"&&this.state.status==="pending"}invalidate(){if(!this.state.isInvalidated)this.#G({type:"invalidate"})}async fetch($,Z){if(this.state.fetchStatus!=="idle"&&this.#J?.status()!=="rejected"){if(this.state.data!==void 0&&Z?.cancelRefetch)this.cancel({silent:!0});else if(this.#J)return this.#J.continueRetry(),this.#J.promise}if($)this.setOptions($);if(!this.options.queryFn){let X=this.observers.find((G)=>G.options.queryFn);if(X)this.setOptions(X.options)}let H=new AbortController,J=(X)=>{Object.defineProperty(X,"signal",{enumerable:!0,get:()=>{return this.#z=!0,H.signal}})},B=()=>{let X=WQ(this.options,Z),U=(()=>{let K={client:this.#B,queryKey:this.queryKey,meta:this.meta};return J(K),K})();if(this.#z=!1,this.options.persister)return this.options.persister(X,U,this);return X(U)},z=(()=>{let X={fetchOptions:Z,options:this.options,queryKey:this.queryKey,client:this.#B,state:this.state,fetchFn:B};return J(X),X})();if(this.options.behavior?.onFetch(z,this),this.#Z=this.state,this.state.fetchStatus==="idle"||this.state.fetchMeta!==z.fetchOptions?.meta)this.#G({type:"fetch",meta:z.fetchOptions?.meta});this.#J=NQ({initialPromise:Z?.initialPromise,fn:z.fetchFn,onCancel:(X)=>{if(X instanceof AQ&&X.revert)this.setState({...this.#Z,fetchStatus:"idle"});H.abort()},onFail:(X,G)=>{this.#G({type:"failed",failureCount:X,error:G})},onPause:()=>{this.#G({type:"pause"})},onContinue:()=>{this.#G({type:"continue"})},retry:z.options.retry,retryDelay:z.options.retryDelay,networkMode:z.options.networkMode,canRun:()=>!0});try{let X=await this.#J.start();if(X===void 0)throw Error(`${this.queryHash} data is undefined`);return this.setData(X),this.#H.config.onSuccess?.(X,this),this.#H.config.onSettled?.(X,this.state.error,this),X}catch(X){if(X instanceof AQ){if(X.silent)return this.#J.promise;else if(X.revert){if(this.state.data===void 0)throw X;return this.state.data}}throw this.#G({type:"error",error:X}),this.#H.config.onError?.(X,this),this.#H.config.onSettled?.(this.state.data,X,this),X}finally{this.scheduleGc()}}#G($){let Z=(H)=>{switch($.type){case"failed":return{...H,fetchFailureCount:$.failureCount,fetchFailureReason:$.error};case"pause":return{...H,fetchStatus:"paused"};case"continue":return{...H,fetchStatus:"fetching"};case"fetch":return{...H,...NY(H.data,this.options),fetchMeta:$.meta??null};case"success":let J={...H,...hM($.data,$.dataUpdatedAt),dataUpdateCount:H.dataUpdateCount+1,...!$.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return this.#Z=$.manual?J:void 0,J;case"error":let B=$.error;return{...H,error:B,errorUpdateCount:H.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:H.fetchFailureCount+1,fetchFailureReason:B,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...H,isInvalidated:!0};case"setState":return{...H,...$.state}}};this.state=Z(this.state),e1.batch(()=>{this.observers.forEach((H)=>{H.onQueryUpdate()}),this.#H.notify({query:this,type:"updated",action:$})})}};function NY($,Z){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:AY(Z.networkMode)?"fetching":"paused",...$===void 0&&{error:null,status:"pending"}}}function hM($,Z){return{data:$,dataUpdatedAt:Z??Date.now(),error:null,isInvalidated:!1,status:"success"}}function xM($){let Z=typeof $.initialData==="function"?$.initialData():$.initialData,H=Z!==void 0,J=H?typeof $.initialDataUpdatedAt==="function"?$.initialDataUpdatedAt():$.initialDataUpdatedAt:0;return{data:Z,dataUpdateCount:0,dataUpdatedAt:H?J??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:H?"success":"pending",fetchStatus:"idle"}}var LY=class extends n2{constructor($,Z){super();this.options=Z,this.#$=$,this.#X=null,this.#z=PH(),this.bindMethods(),this.setOptions(Z)}#$;#Z=void 0;#H=void 0;#B=void 0;#J;#Q;#z;#X;#G;#W;#A;#K;#F;#U;#N=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){if(this.listeners.size===1){if(this.#Z.addObserver(this),gM(this.#Z,this.options))this.#Y();else this.updateResult();this.#q()}}onUnsubscribe(){if(!this.hasListeners())this.destroy()}shouldFetchOnReconnect(){return VY(this.#Z,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return VY(this.#Z,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#M(),this.#P(),this.#Z.removeObserver(this)}setOptions($){let Z=this.options,H=this.#Z;if(this.options=this.#$.defaultQueryOptions($),this.options.enabled!==void 0&&typeof this.options.enabled!=="boolean"&&typeof this.options.enabled!=="function"&&typeof $2(this.options.enabled,this.#Z)!=="boolean")throw Error("Expected enabled to be a boolean or a callback that returns a boolean");if(this.#_(),this.#Z.setOptions(this.options),Z._defaulted&&!G$(this.options,Z))this.#$.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#Z,observer:this});let J=this.hasListeners();if(J&&fM(this.#Z,H,this.options,Z))this.#Y();if(this.updateResult(),J&&(this.#Z!==H||$2(this.options.enabled,this.#Z)!==$2(Z.enabled,this.#Z)||V8(this.options.staleTime,this.#Z)!==V8(Z.staleTime,this.#Z)))this.#V();let B=this.#L();if(J&&(this.#Z!==H||$2(this.options.enabled,this.#Z)!==$2(Z.enabled,this.#Z)||B!==this.#U))this.#D(B)}getOptimisticResult($){let Z=this.#$.getQueryCache().build(this.#$,$),H=this.createResult(Z,$);if(zr(this,H))this.#B=H,this.#Q=this.options,this.#J=this.#Z.state;return H}getCurrentResult(){return this.#B}trackResult($,Z){return new Proxy($,{get:(H,J)=>{if(this.trackProp(J),Z?.(J),J==="promise"){if(this.trackProp("data"),!this.options.experimental_prefetchInRender&&this.#z.status==="pending")this.#z.reject(Error("experimental_prefetchInRender feature flag is not enabled"))}return Reflect.get(H,J)}})}trackProp($){this.#N.add($)}getCurrentQuery(){return this.#Z}refetch({...$}={}){return this.fetch({...$})}fetchOptimistic($){let Z=this.#$.defaultQueryOptions($),H=this.#$.getQueryCache().build(this.#$,Z);return H.fetch().then(()=>this.createResult(H,Z))}fetch($){return this.#Y({...$,cancelRefetch:$.cancelRefetch??!0}).then(()=>{return this.updateResult(),this.#B})}#Y($){this.#_();let Z=this.#Z.fetch(this.options,$);if(!$?.throwOnError)Z=Z.catch(x5);return Z}#V(){this.#M();let $=V8(this.options.staleTime,this.#Z);if(d8.isServer()||this.#B.isStale||!LH($))return;let H=KQ(this.#B.dataUpdatedAt,$)+1;this.#K=p8.setTimeout(()=>{if(!this.#B.isStale)this.updateResult()},H)}#L(){return(typeof this.options.refetchInterval==="function"?this.options.refetchInterval(this.#Z):this.options.refetchInterval)??!1}#D($){if(this.#P(),this.#U=$,d8.isServer()||$2(this.options.enabled,this.#Z)===!1||!LH(this.#U)||this.#U===0)return;this.#F=p8.setInterval(()=>{if(this.options.refetchIntervalInBackground||X$.isFocused())this.#Y()},this.#U)}#q(){this.#V(),this.#D(this.#L())}#M(){if(this.#K!==void 0)p8.clearTimeout(this.#K),this.#K=void 0}#P(){if(this.#F!==void 0)p8.clearInterval(this.#F),this.#F=void 0}createResult($,Z){let H=this.#Z,J=this.options,B=this.#B,Q=this.#J,z=this.#Q,G=$!==H?$.state:this.#H,{state:U}=$,K={...U},F=!1,Y;if(Z._optimisticResults){let C=this.hasListeners(),k=!C&&gM($,Z),E=C&&fM($,H,Z,J);if(k||E)K={...K,...NY(U.data,$.options)};if(Z._optimisticResults==="isRestoring")K.fetchStatus="idle"}let{error:W,errorUpdatedAt:A,status:N}=K;Y=K.data;let L=!1;if(Z.placeholderData!==void 0&&Y===void 0&&N==="pending"){let C;if(B?.isPlaceholderData&&Z.placeholderData===z?.placeholderData)C=B.data,L=!0;else C=typeof Z.placeholderData==="function"?Z.placeholderData(this.#A?.state.data,this.#A):Z.placeholderData;if(C!==void 0)N="success",Y=MH(B?.data,C,Z),F=!0}if(Z.select&&Y!==void 0&&!L)if(B&&Y===Q?.data&&Z.select===this.#G)Y=this.#W;else try{this.#G=Z.select,Y=Z.select(Y),Y=MH(B?.data,Y,Z),this.#W=Y,this.#X=null}catch(C){this.#X=C}if(this.#X)W=this.#X,Y=this.#W,A=Date.now(),N="error";let V=K.fetchStatus==="fetching",D=N==="pending",q=N==="error",j=D&&V,M=Y!==void 0,T={status:N,fetchStatus:K.fetchStatus,isPending:D,isSuccess:N==="success",isError:q,isInitialLoading:j,isLoading:j,data:Y,dataUpdatedAt:K.dataUpdatedAt,error:W,errorUpdatedAt:A,failureCount:K.fetchFailureCount,failureReason:K.fetchFailureReason,errorUpdateCount:K.errorUpdateCount,isFetched:$.isFetched(),isFetchedAfterMount:K.dataUpdateCount>G.dataUpdateCount||K.errorUpdateCount>G.errorUpdateCount,isFetching:V,isRefetching:V&&!D,isLoadingError:q&&!M,isPaused:K.fetchStatus==="paused",isPlaceholderData:F,isRefetchError:q&&M,isStale:DY($,Z),refetch:this.refetch,promise:this.#z,isEnabled:$2(Z.enabled,$)!==!1};if(this.options.experimental_prefetchInRender){let C=T.data!==void 0,k=T.status==="error"&&!C,E=(R)=>{if(k)R.reject(T.error);else if(C)R.resolve(T.data)},h=()=>{let R=this.#z=T.promise=PH();E(R)},x=this.#z;switch(x.status){case"pending":if($.queryHash===H.queryHash)E(x);break;case"fulfilled":if(k||T.data!==x.value)h();break;case"rejected":if(!k||T.error!==x.reason)h();break}}return T}updateResult(){let $=this.#B,Z=this.createResult(this.#Z,this.options);if(this.#J=this.#Z.state,this.#Q=this.options,this.#J.data!==void 0)this.#A=this.#Z;if(G$(Z,$))return;this.#B=Z;let H=()=>{if(!$)return!0;let{notifyOnChangeProps:J}=this.options,B=typeof J==="function"?J():J;if(B==="all"||!B&&!this.#N.size)return!0;let Q=new Set(B??this.#N);if(this.options.throwOnError)Q.add("error");return Object.keys(this.#B).some((z)=>{let X=z;return this.#B[X]!==$[X]&&Q.has(X)})};this.#j({listeners:H()})}#_(){let $=this.#$.getQueryCache().build(this.#$,this.options);if($===this.#Z)return;let Z=this.#Z;if(this.#Z=$,this.#H=$.state,this.hasListeners())Z?.removeObserver(this),$.addObserver(this)}onQueryUpdate(){if(this.updateResult(),this.hasListeners())this.#q()}#j($){e1.batch(()=>{if($.listeners)this.listeners.forEach((Z)=>{Z(this.#B)});this.#$.getQueryCache().notify({query:this.#Z,type:"observerResultsUpdated"})})}};function Qr($,Z){return $2(Z.enabled,$)!==!1&&$.state.data===void 0&&!($.state.status==="error"&&$2(Z.retryOnMount,$)===!1)}function gM($,Z){return Qr($,Z)||$.state.data!==void 0&&VY($,Z,Z.refetchOnMount)}function VY($,Z,H){if($2(Z.enabled,$)!==!1&&V8(Z.staleTime,$)!=="static"){let J=typeof H==="function"?H($):H;return J==="always"||J!==!1&&DY($,Z)}return!1}function fM($,Z,H,J){return($!==Z||$2(J.enabled,$)===!1)&&(!H.suspense||$.state.status!=="error")&&DY($,H)}function DY($,Z){return $2(Z.enabled,$)!==!1&&$.isStaleByTime(V8(Z.staleTime,$))}function zr($,Z){if(!G$($.getCurrentResult(),Z))return!0;return!1}function qY($){return{onFetch:(Z,H)=>{let J=Z.options,B=Z.fetchOptions?.meta?.fetchMore?.direction,Q=Z.state.data?.pages||[],z=Z.state.data?.pageParams||[],X={pages:[],pageParams:[]},G=0,U=async()=>{let K=!1,F=(A)=>{bM(A,()=>Z.signal,()=>K=!0)},Y=WQ(Z.options,Z.fetchOptions),W=async(A,N,L)=>{if(K)return Promise.reject();if(N==null&&A.pages.length)return Promise.resolve(A);let D=(()=>{let P={client:Z.client,queryKey:Z.queryKey,pageParam:N,direction:L?"backward":"forward",meta:Z.options.meta};return F(P),P})(),q=await Y(D),{maxPages:j}=Z.options,M=L?RM:kM;return{pages:M(A.pages,q,j),pageParams:M(A.pageParams,N,j)}};if(B&&Q.length){let A=B==="backward",N=A?Xr:mM,L={pages:Q,pageParams:z},V=N(J,L);X=await W(L,V,A)}else{let A=$??Q.length;do{let N=G===0?z[0]??J.initialPageParam:mM(J,X);if(G>0&&N==null)break;X=await W(X,N),G++}while(G<A)}return X};if(Z.options.persister)Z.fetchFn=()=>{return Z.options.persister?.(U,{client:Z.client,queryKey:Z.queryKey,meta:Z.options.meta,signal:Z.signal},H)};else Z.fetchFn=U}}}function mM($,{pages:Z,pageParams:H}){let J=Z.length-1;return Z.length>0?$.getNextPageParam(Z[J],Z,H[J],H):void 0}function Xr($,{pages:Z,pageParams:H}){return Z.length>0?$.getPreviousPageParam?.(Z[0],Z,H[0],H):void 0}var uM=class extends VQ{#$;#Z;#H;#B;constructor($){super();this.#$=$.client,this.mutationId=$.mutationId,this.#H=$.mutationCache,this.#Z=[],this.state=$.state||MY(),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.#H.notify({type:"observerAdded",mutation:this,observer:$})}removeObserver($){this.#Z=this.#Z.filter((Z)=>Z!==$),this.scheduleGc(),this.#H.notify({type:"observerRemoved",mutation:this,observer:$})}optionalRemove(){if(!this.#Z.length)if(this.state.status==="pending")this.scheduleGc();else this.#H.remove(this)}continue(){return this.#B?.continue()??this.execute(this.state.variables)}async execute($){let Z=()=>{this.#J({type:"continue"})},H={client:this.#$,meta:this.options.meta,mutationKey:this.options.mutationKey};this.#B=NQ({fn:()=>{if(!this.options.mutationFn)return Promise.reject(Error("No mutationFn found"));return this.options.mutationFn($,H)},onFail:(Q,z)=>{this.#J({type:"failed",failureCount:Q,error:z})},onPause:()=>{this.#J({type:"pause"})},onContinue:Z,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#H.canRun(this)});let J=this.state.status==="pending",B=!this.#B.canStart();try{if(J)Z();else{if(this.#J({type:"pending",variables:$,isPaused:B}),this.#H.config.onMutate)await this.#H.config.onMutate($,this,H);let z=await this.options.onMutate?.($,H);if(z!==this.state.context)this.#J({type:"pending",context:z,variables:$,isPaused:B})}let Q=await this.#B.start();return await this.#H.config.onSuccess?.(Q,$,this.state.context,this,H),await this.options.onSuccess?.(Q,$,this.state.context,H),await this.#H.config.onSettled?.(Q,null,this.state.variables,this.state.context,this,H),await this.options.onSettled?.(Q,null,$,this.state.context,H),this.#J({type:"success",data:Q}),Q}catch(Q){try{await this.#H.config.onError?.(Q,$,this.state.context,this,H)}catch(z){Promise.reject(z)}try{await this.options.onError?.(Q,$,this.state.context,H)}catch(z){Promise.reject(z)}try{await this.#H.config.onSettled?.(void 0,Q,this.state.variables,this.state.context,this,H)}catch(z){Promise.reject(z)}try{await this.options.onSettled?.(void 0,Q,$,this.state.context,H)}catch(z){Promise.reject(z)}throw this.#J({type:"error",error:Q}),Q}finally{this.#H.runNext(this)}}#J($){let Z=(H)=>{switch($.type){case"failed":return{...H,failureCount:$.failureCount,failureReason:$.error};case"pause":return{...H,isPaused:!0};case"continue":return{...H,isPaused:!1};case"pending":return{...H,context:$.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:$.isPaused,status:"pending",variables:$.variables,submittedAt:Date.now()};case"success":return{...H,data:$.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...H,data:void 0,error:$.error,failureCount:H.failureCount+1,failureReason:$.error,isPaused:!1,status:"error"}}};this.state=Z(this.state),e1.batch(()=>{this.#Z.forEach((H)=>{H.onMutationUpdate($)}),this.#H.notify({mutation:this,type:"updated",action:$})})}};function MY(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var pM=class extends n2{constructor($={}){super();this.config=$,this.#$=new Set,this.#Z=new Map,this.#H=0}#$;#Z;#H;build($,Z,H){let J=new uM({client:$,mutationCache:this,mutationId:++this.#H,options:$.defaultMutationOptions(Z),state:H});return this.add(J),J}add($){this.#$.add($);let Z=LQ($);if(typeof Z==="string"){let H=this.#Z.get(Z);if(H)H.push($);else this.#Z.set(Z,[$])}this.notify({type:"added",mutation:$})}remove($){if(this.#$.delete($)){let Z=LQ($);if(typeof Z==="string"){let H=this.#Z.get(Z);if(H){if(H.length>1){let J=H.indexOf($);if(J!==-1)H.splice(J,1)}else if(H[0]===$)this.#Z.delete(Z)}}}this.notify({type:"removed",mutation:$})}canRun($){let Z=LQ($);if(typeof Z==="string"){let J=this.#Z.get(Z)?.find((B)=>B.state.status==="pending");return!J||J===$}else return!0}runNext($){let Z=LQ($);if(typeof Z==="string")return this.#Z.get(Z)?.find((J)=>J!==$&&J.state.isPaused)?.continue()??Promise.resolve();else return Promise.resolve()}clear(){e1.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((H)=>YQ(Z,H))}findAll($={}){return this.getAll().filter((Z)=>YQ($,Z))}notify($){e1.batch(()=>{this.listeners.forEach((Z)=>{Z($)})})}resumePausedMutations(){let $=this.getAll().filter((Z)=>Z.state.isPaused);return e1.batch(()=>Promise.all($.map((Z)=>Z.continue().catch(x5))))}};function LQ($){return $.options.scope?.id}var PY=class extends n2{#$;#Z=void 0;#H;#B;constructor($,Z){super();this.#$=$,this.setOptions(Z),this.bindMethods(),this.#J()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions($){let Z=this.options;if(this.options=this.#$.defaultMutationOptions($),!G$(this.options,Z))this.#$.getMutationCache().notify({type:"observerOptionsUpdated",mutation:this.#H,observer:this});if(Z?.mutationKey&&this.options.mutationKey&&c8(Z.mutationKey)!==c8(this.options.mutationKey))this.reset();else if(this.#H?.state.status==="pending")this.#H.setOptions(this.options)}onUnsubscribe(){if(!this.hasListeners())this.#H?.removeObserver(this)}onMutationUpdate($){this.#J(),this.#Q($)}getCurrentResult(){return this.#Z}reset(){this.#H?.removeObserver(this),this.#H=void 0,this.#J(),this.#Q()}mutate($,Z){return this.#B=Z,this.#H?.removeObserver(this),this.#H=this.#$.getMutationCache().build(this.#$,this.options),this.#H.addObserver(this),this.#H.execute($)}#J(){let $=this.#H?.state??MY();this.#Z={...$,isPending:$.status==="pending",isSuccess:$.status==="success",isError:$.status==="error",isIdle:$.status==="idle",mutate:this.mutate,reset:this.reset}}#Q($){e1.batch(()=>{if(this.#B&&this.hasListeners()){let Z=this.#Z.variables,H=this.#Z.context,J={client:this.#$,meta:this.options.meta,mutationKey:this.options.mutationKey};if($?.type==="success"){try{this.#B.onSuccess?.($.data,Z,H,J)}catch(B){Promise.reject(B)}try{this.#B.onSettled?.($.data,null,Z,H,J)}catch(B){Promise.reject(B)}}else if($?.type==="error"){try{this.#B.onError?.($.error,Z,H,J)}catch(B){Promise.reject(B)}try{this.#B.onSettled?.(void 0,$.error,Z,H,J)}catch(B){Promise.reject(B)}}}this.listeners.forEach((Z)=>{Z(this.#Z)})})}};var cM=class extends n2{constructor($={}){super();this.config=$,this.#$=new Map}#$;build($,Z,H){let J=Z.queryKey,B=Z.queryHash??DH(J,Z),Q=this.get(B);if(!Q)Q=new vM({client:$,queryKey:J,queryHash:B,options:$.defaultQueryOptions(Z),state:H,defaultOptions:$.getQueryDefaults(J)}),this.add(Q);return Q}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(){e1.batch(()=>{this.getAll().forEach(($)=>{this.remove($)})})}get($){return this.#$.get($)}getAll(){return[...this.#$.values()]}find($){let Z={exact:!0,...$};return this.getAll().find((H)=>FQ(Z,H))}findAll($={}){let Z=this.getAll();return Object.keys($).length>0?Z.filter((H)=>FQ($,H)):Z}notify($){e1.batch(()=>{this.listeners.forEach((Z)=>{Z($)})})}onFocus(){e1.batch(()=>{this.getAll().forEach(($)=>{$.onFocus()})})}onOnline(){e1.batch(()=>{this.getAll().forEach(($)=>{$.onOnline()})})}};var _Y=class{#$;#Z;#H;#B;#J;#Q;#z;#X;constructor($={}){this.#$=$.queryCache||new cM,this.#Z=$.mutationCache||new pM,this.#H=$.defaultOptions||{},this.#B=new Map,this.#J=new Map,this.#Q=0}mount(){if(this.#Q++,this.#Q!==1)return;this.#z=X$.subscribe(async($)=>{if($)await this.resumePausedMutations(),this.#$.onFocus()}),this.#X=F$.subscribe(async($)=>{if($)await this.resumePausedMutations(),this.#$.onOnline()})}unmount(){if(this.#Q--,this.#Q!==0)return;this.#z?.(),this.#z=void 0,this.#X?.(),this.#X=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($),H=this.#$.build(this,Z),J=H.state.data;if(J===void 0)return this.fetchQuery($);if($.revalidateIfStale&&H.isStaleByTime(V8(Z.staleTime,H)))this.prefetchQuery(Z);return Promise.resolve(J)}getQueriesData($){return this.#$.findAll($).map(({queryKey:Z,state:H})=>{let J=H.data;return[Z,J]})}setQueryData($,Z,H){let J=this.defaultQueryOptions({queryKey:$}),Q=this.#$.get(J.queryHash)?.state.data,z=SM(Z,Q);if(z===void 0)return;return this.#$.build(this,J).setData(z,{...H,manual:!0})}setQueriesData($,Z,H){return e1.batch(()=>this.#$.findAll($).map(({queryKey:J})=>[J,this.setQueryData(J,Z,H)]))}getQueryState($){let Z=this.defaultQueryOptions({queryKey:$});return this.#$.get(Z.queryHash)?.state}removeQueries($){let Z=this.#$;e1.batch(()=>{Z.findAll($).forEach((H)=>{Z.remove(H)})})}resetQueries($,Z){let H=this.#$;return e1.batch(()=>{return H.findAll($).forEach((J)=>{J.reset()}),this.refetchQueries({type:"active",...$},Z)})}cancelQueries($,Z={}){let H={revert:!0,...Z},J=e1.batch(()=>this.#$.findAll($).map((B)=>B.cancel(H)));return Promise.all(J).then(x5).catch(x5)}invalidateQueries($,Z={}){return e1.batch(()=>{if(this.#$.findAll($).forEach((H)=>{H.invalidate()}),$?.refetchType==="none")return Promise.resolve();return this.refetchQueries({...$,type:$?.refetchType??$?.type??"active"},Z)})}refetchQueries($,Z={}){let H={...Z,cancelRefetch:Z.cancelRefetch??!0},J=e1.batch(()=>this.#$.findAll($).filter((B)=>!B.isDisabled()&&!B.isStatic()).map((B)=>{let Q=B.fetch(void 0,H);if(!H.throwOnError)Q=Q.catch(x5);return B.state.fetchStatus==="paused"?Promise.resolve():Q}));return Promise.all(J).then(x5)}fetchQuery($){let Z=this.defaultQueryOptions($);if(Z.retry===void 0)Z.retry=!1;let H=this.#$.build(this,Z);return H.isStaleByTime(V8(Z.staleTime,H))?H.fetch(Z):Promise.resolve(H.state.data)}prefetchQuery($){return this.fetchQuery($).then(x5).catch(x5)}fetchInfiniteQuery($){return $.behavior=qY($.pages),this.fetchQuery($)}prefetchInfiniteQuery($){return this.fetchInfiniteQuery($).then(x5).catch(x5)}ensureInfiniteQueryData($){return $.behavior=qY($.pages),this.ensureQueryData($)}resumePausedMutations(){if(F$.isOnline())return this.#Z.resumePausedMutations();return Promise.resolve()}getQueryCache(){return this.#$}getMutationCache(){return this.#Z}getDefaultOptions(){return this.#H}setDefaultOptions($){this.#H=$}setQueryDefaults($,Z){this.#B.set(c8($),{queryKey:$,defaultOptions:Z})}getQueryDefaults($){let Z=[...this.#B.values()],H={};return Z.forEach((J)=>{if(v6($,J.queryKey))Object.assign(H,J.defaultOptions)}),H}setMutationDefaults($,Z){this.#J.set(c8($),{mutationKey:$,defaultOptions:Z})}getMutationDefaults($){let Z=[...this.#J.values()],H={};return Z.forEach((J)=>{if(v6($,J.mutationKey))Object.assign(H,J.defaultOptions)}),H}defaultQueryOptions($){if($._defaulted)return $;let Z={...this.#H.queries,...this.getQueryDefaults($.queryKey),...$,_defaulted:!0};if(!Z.queryHash)Z.queryHash=DH(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===U$)Z.enabled=!1;return Z}defaultMutationOptions($){if($?._defaulted)return $;return{...this.#H.mutations,...$?.mutationKey&&this.getMutationDefaults($.mutationKey),...$,_defaulted:!0}}clear(){this.#$.clear(),this.#Z.clear()}};var A3=_(p(),1);var Y$=_(p(),1),dM=_(r(),1),jY=Y$.createContext(void 0),z1=($)=>{let Z=Y$.useContext(jY);if($)return $;if(!Z)throw Error("No QueryClient set, use QueryClientProvider to set one");return Z},OY=({client:$,children:Z})=>{return Y$.useEffect(()=>{return $.mount(),()=>{$.unmount()}},[$]),dM.jsx(jY.Provider,{value:$,children:Z})};var _H=_(p(),1),Gr=_(r(),1);function Ur(){let $=!1;return{clearReset:()=>{$=!1},reset:()=>{$=!0},isReset:()=>{return $}}}var Kr=_H.createContext(Ur()),lM=()=>_H.useContext(Kr);var iM=_(p(),1);var rM=($,Z,H)=>{let J=H?.state.error&&typeof $.throwOnError==="function"?K$($.throwOnError,[H.state.error,H]):$.throwOnError;if($.suspense||$.experimental_prefetchInRender||J){if(!Z.isReset())$.retryOnMount=!1}},aM=($)=>{iM.useEffect(()=>{$.clearReset()},[$])},nM=({result:$,errorResetBoundary:Z,throwOnError:H,query:J,suspense:B})=>{return $.isError&&!Z.isReset()&&!$.isFetching&&J&&(B&&$.data===void 0||K$(H,[$.error,J]))};var DQ=_(p(),1),oM=DQ.createContext(!1),sM=()=>DQ.useContext(oM),EK0=oM.Provider;var tM=($)=>{if($.suspense){let H=(B)=>B==="static"?B:Math.max(B??1000,1000),J=$.staleTime;if($.staleTime=typeof J==="function"?(...B)=>H(J(...B)):H(J),typeof $.gcTime==="number")$.gcTime=Math.max($.gcTime,1000)}},eM=($,Z)=>$.isLoading&&$.isFetching&&!Z,$P=($,Z)=>$?.suspense&&Z.isPending,TY=($,Z,H)=>Z.fetchOptimistic($).catch(()=>{H.clearReset()});function ZP($,Z,H){let J=sM(),B=lM(),Q=z1(H),z=Q.defaultQueryOptions($);Q.getDefaultOptions().queries?._experimental_beforeQuery?.(z);let X=Q.getQueryCache().get(z.queryHash);z._optimisticResults=J?"isRestoring":"optimistic",tM(z),rM(z,B,X),aM(B);let G=!Q.getQueryCache().get(z.queryHash),[U]=A3.useState(()=>new Z(Q,z)),K=U.getOptimisticResult(z),F=!J&&$.subscribed!==!1;if(A3.useSyncExternalStore(A3.useCallback((Y)=>{let W=F?U.subscribe(e1.batchCalls(Y)):x5;return U.updateResult(),W},[U,F]),()=>U.getCurrentResult(),()=>U.getCurrentResult()),A3.useEffect(()=>{U.setOptions(z)},[z,U]),$P(z,K))throw TY(z,U,B);if(nM({result:K,errorResetBoundary:B,throwOnError:z.throwOnError,query:X,suspense:z.suspense}))throw K.error;if(Q.getDefaultOptions().queries?._experimental_afterQuery?.(z,K),z.experimental_prefetchInRender&&!d8.isServer()&&eM(K,J))(G?TY(z,U,B):X?.promise)?.catch(x5).finally(()=>{U.updateResult()});return!z.notifyOnChangeProps?U.trackResult(K):K}function J5($,Z){return ZP($,LY,Z)}function CY($){return $}var f9=_(p(),1);function wY($,Z){let H=z1(Z);return JP({filters:{...$,status:"pending"}},H).length}function HP($,Z){return $.findAll(Z.filters).map((H)=>Z.select?Z.select(H):H.state)}function JP($={},Z){let H=z1(Z).getMutationCache(),J=f9.useRef($),B=f9.useRef(null);if(B.current===null)B.current=HP(H,$);return f9.useEffect(()=>{J.current=$}),f9.useSyncExternalStore(f9.useCallback((Q)=>H.subscribe(()=>{let z=qH(B.current,HP(H,J.current));if(B.current!==z)B.current=z,e1.schedule(Q)}),[H]),()=>B.current,()=>B.current)}var m9=_(p(),1);function B5($,Z){let H=z1(Z),[J]=m9.useState(()=>new PY(H,$));m9.useEffect(()=>{J.setOptions($)},[J,$]);let B=m9.useSyncExternalStore(m9.useCallback((z)=>J.subscribe(e1.batchCalls(z)),[J]),()=>J.getCurrentResult(),()=>J.getCurrentResult()),Q=m9.useCallback((z,X)=>{J.mutate(z,X).catch(x5)},[J]);if(B.error&&K$(J.options.throwOnError,[B.error]))throw B.error;return{...B,mutate:Q,mutateAsync:B.mutate}}var ai=_(cG0(),1);function BP($,Z){if($ instanceof RegExp)return{keys:!1,pattern:$};var H,J,B,Q,z=[],X="",G=$.split("/");G[0]||G.shift();while(B=G.shift())if(H=B[0],H==="*")z.push(H),X+=B[1]==="?"?"(?:/(.*))?":"/(.*)";else if(H===":"){if(J=B.indexOf("?",1),Q=B.indexOf(".",1),z.push(B.substring(1,~J?J:~Q?Q:B.length)),X+=!!~J&&!~Q?"(?:/([^/]+?))?":"/([^/]+?)",~Q)X+=(~J?"?":"")+"\\"+B.substring(Q)}else X+="/"+B;return{keys:z,pattern:new RegExp("^"+X+(Z?"(?=$|/)":"/?$"),"i")}}var g6=_(p(),1),y1=_(p(),1);var qQ=_(W$(),1);var _r=g6.useInsertionEffect,jr=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",SY=jr?g6.useLayoutEffect:g6.useEffect,Or=_r||SY,MQ=($)=>{let Z=g6.useRef([$,(...H)=>Z[0](...H)]).current;return Or(()=>{Z[0]=$}),Z[1]};var Tr="popstate",IY="pushState",kY="replaceState",Cr="hashchange",QP=[Tr,IY,kY,Cr],wr=($)=>{for(let Z of QP)addEventListener(Z,$);return()=>{for(let Z of QP)removeEventListener(Z,$)}},RY=($,Z)=>qQ.useSyncExternalStore(wr,$,Z),zP=()=>location.search,UP=({ssrSearch:$}={})=>RY(zP,$!=null?()=>$:zP),XP=()=>location.pathname,Er=({ssrPath:$}={})=>RY(XP,$!=null?()=>$:XP),Sr=()=>history.state,KP=()=>RY(Sr,()=>null),Ir=($,{replace:Z=!1,state:H=null}={})=>history[Z?kY:IY](H,"",$),FP=($={})=>[Er($),Ir],GP=Symbol.for("wouter_v3");if(typeof history<"u"&&typeof window[GP]>"u"){for(let $ of[IY,kY]){let Z=history[$];history[$]=function(){let H=Z.apply(this,arguments),J=new Event($);return J.arguments=arguments,dispatchEvent(J),H}}Object.defineProperty(window,GP,{value:!0})}var kr=($,Z)=>!Z.toLowerCase().indexOf($.toLowerCase())?Z.slice($.length)||"/":"~"+Z,WP=($="")=>$==="/"?"":$,AP=($,Z)=>$[0]==="~"?$.slice(1):WP(Z)+$,NP=($="",Z)=>kr(YP(WP($)),YP(Z));var YP=($)=>{try{return decodeURI($)}catch(Z){return $}};var LP={hook:FP,searchHook:UP,parser:BP,base:"",ssrPath:void 0,ssrSearch:void 0,ssrContext:void 0,hrefs:($)=>$,aroundNav:($,Z,H)=>$(Z,H)},DP=y1.createContext(LP),A$=()=>y1.useContext(DP),qP={},MP=y1.createContext(qP),bY=()=>y1.useContext(MP),jH=($)=>{let[Z,H]=$.hook($);return[NP($.base,Z),MQ((J,B)=>$.aroundNav(H,AP(J,$.base),B))]},o2=()=>jH(A$());var PP=($,Z,H,J)=>{let{pattern:B,keys:Q}=Z instanceof RegExp?{keys:!1,pattern:Z}:$(Z||"*",J),z=B.exec(H)||[],[X,...G]=z;return X!==void 0?[!0,(()=>{let U=Q!==!1?Object.fromEntries(Q.map((F,Y)=>[F,G[Y]])):z.groups,K={...G};return U&&Object.assign(K,U),K})(),...J?[X]:[]]:[!1,null]};var yY=({children:$,...Z})=>{let H=A$(),J=Z.hook?LP:H,B=J,[Q,z=Z.ssrSearch??""]=Z.ssrPath?.split("?")??[];if(Q)Z.ssrSearch=z,Z.ssrPath=Q;Z.hrefs=Z.hrefs??Z.hook?.hrefs,Z.searchHook=Z.searchHook??Z.hook?.searchHook;let X=y1.useRef({}),G=X.current,U=G;for(let K in J){let F=K==="base"?J[K]+(Z[K]??""):Z[K]??J[K];if(G===U&&F!==U[K])X.current=U={...U};if(U[K]=F,F!==J[K]||F!==B[K])B=U}return y1.createElement(DP.Provider,{value:B,children:$})},VP=({children:$,component:Z},H)=>{if(Z)return y1.createElement(Z,{params:H});return typeof $==="function"?$(H):$},Rr=($)=>{let Z=y1.useRef(qP),H=Z.current;return Z.current=Object.keys($).length!==Object.keys(H).length||Object.entries($).some(([J,B])=>B!==H[J])?$:H};var PQ=({path:$,nest:Z,match:H,...J})=>{let B=A$(),[Q]=jH(B),[z,X,G]=H??PP(B.parser,$,Q,Z),U=Rr({...bY(),...X});if(!z)return null;let K=G?y1.createElement(yY,{base:G},VP(J,U)):VP(J,U);return y1.createElement(MP.Provider,{value:U,children:K})},f6=y1.forwardRef(($,Z)=>{let H=A$(),[J,B]=jH(H),{to:Q="",href:z=Q,onClick:X,asChild:G,children:U,className:K,replace:F,state:Y,transition:W,...A}=$,N=MQ((V)=>{if(V.ctrlKey||V.metaKey||V.altKey||V.shiftKey||V.button!==0)return;if(X?.(V),!V.defaultPrevented)V.preventDefault(),B(z,$)}),L=H.hrefs(z[0]==="~"?z.slice(1):H.base+z,H);return G&&y1.isValidElement(U)?y1.cloneElement(U,{onClick:N,href:L}):y1.createElement("a",{...A,onClick:N,href:L,className:K?.call?K(J===z):K,children:U,ref:Z})}),_P=($)=>Array.isArray($)?$.flatMap((Z)=>_P(Z&&Z.type===y1.Fragment?Z.props.children:Z)):[$],jP=({children:$,location:Z})=>{let H=A$(),[J]=jH(H);for(let B of _P($)){let Q=0;if(y1.isValidElement(B)&&(Q=PP(H.parser,B.props.path,Z||J,B.props.nest))[0])return y1.cloneElement(B,{match:Q})}return null},OP=($)=>{let{to:Z,href:H=Z}=$,J=A$(),[,B]=jH(J),Q=MQ(()=>B(Z||H,$)),{ssrContext:z}=J;if(SY(()=>{Q()},[]),z)z.redirectTo=Z;return null};var f4={};g5(f4,{useToastManager:()=>LO,createToastManager:()=>DO,Viewport:()=>G_,Title:()=>v_,Root:()=>w_,Provider:()=>J_,Positioner:()=>WO,Portal:()=>r_,Description:()=>h_,Content:()=>E_,Close:()=>g_,Arrow:()=>NO,Action:()=>m_});var H_=_(p(),1);var TP=_(p(),1);function N3($){TP.useEffect($,u9)}var _Q=_(p(),1),hY=_Q.createContext(void 0);function l8(){let $=_Q.useContext(hY);if(!$)throw Error(g0(73));return $}var SP=_(p(),1),fY=_(W$(),1);var V3=_(p(),1),br=W$();function yr($,Z){return $===Z&&($!==0||1/$===1/Z)||$!==$&&Z!==Z}var hr=typeof Object.is==="function"?Object.is:yr,xr=br.useSyncExternalStore,vr=V3.useRef,gr=V3.useEffect,fr=V3.useMemo,mr=V3.useDebugValue;var xY=function($,Z,H,J,B){var Q=vr(null);if(Q.current===null){var z={hasValue:!1,value:null};Q.current=z}else z=Q.current;Q=fr(function(){function G(W){if(!U){if(U=!0,K=W,W=J(W),B!==void 0&&z.hasValue){var A=z.value;if(B(A,W))return F=A}return F=W}if(A=F,hr(K,W))return A;var N=J(W);if(B!==void 0&&B(A,N))return K=W,A;return K=W,F=N}var U=!1,K,F,Y=H===void 0?null:H;return[function(){return G(Z())},Y===null?void 0:function(){return G(Y())}]},[Z,H,J,B]);var X=xr($,Q[0],Q[1]);return gr(function(){z.hasValue=!0,z.value=X},[X]),mr(X),X};var CP=_(p(),1);var vY=[],gY=void 0;function wP(){return gY}function EP($){vY.push($)}function D8($){let Z=(H,J)=>{let B=p1(ur).current,Q;try{gY=B;for(let z of vY)z.before(B);Q=$(H,J);for(let z of vY)z.after(B);B.didInitialize=!0}finally{gY=void 0}return Q};return Z.displayName=$.displayName||$.name,Z}function i8($){return CP.forwardRef(D8($))}function ur(){return{didInitialize:!1}}var pr=jQ(19),cr=pr?lr:ir;function OQ($,Z,H,J,B){return cr($,Z,H,J,B)}function dr($,Z,H,J,B){let Q=SP.useCallback(()=>Z($.getSnapshot(),H,J,B),[$,Z,H,J,B]);return fY.useSyncExternalStore($.subscribe,Q,Q)}EP({before($){if($.syncIndex=0,!$.didInitialize)$.syncTick=1,$.syncHooks=[],$.didChangeStore=!0,$.getSnapshot=()=>{let Z=!1;for(let H=0;H<$.syncHooks.length;H+=1){let J=$.syncHooks[H],B=J.selector(J.store.state,J.a1,J.a2,J.a3);if(!Object.is(J.value,B))Z=!0,J.value=B}if(Z)$.syncTick+=1;return $.syncTick}},after($){if($.syncHooks.length>0){if($.didChangeStore)$.didChangeStore=!1,$.subscribe=(Z)=>{let H=new Set;for(let B of $.syncHooks)H.add(B.store);let J=[];for(let B of H)J.push(B.subscribe(Z));return()=>{for(let B of J)B()}};fY.useSyncExternalStore($.subscribe,$.getSnapshot,$.getSnapshot)}}});function lr($,Z,H,J,B){let Q=wP();if(!Q)return dr($,Z,H,J,B);let z=Q.syncIndex;Q.syncIndex+=1;let X;if(!Q.didInitialize)X={store:$,selector:Z,a1:H,a2:J,a3:B,value:Z($.getSnapshot(),H,J,B)},Q.syncHooks.push(X);else if(X=Q.syncHooks[z],X.store!==$||X.selector!==Z||!Object.is(X.a1,H)||!Object.is(X.a2,J)||!Object.is(X.a3,B)){if(X.store!==$)Q.didChangeStore=!0;X.store=$,X.selector=Z,X.a1=H,X.a2=J,X.a3=B,X.value=Z($.getSnapshot(),H,J,B)}return X.value}function ir($,Z,H,J,B){return xY($.subscribe,$.getSnapshot,$.getSnapshot,(Q)=>Z(Q,H,J,B))}class mY{static create($){return new this($)}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 H of this.listeners){if(Z!==this.updateTick)return;H($)}}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,H,J){return OQ(this,$,Z,H,J)}}var m6=_(p(),1);class _4 extends mY{constructor($,Z={},H){super($);this.context=Z,this.selectors=H}useSyncedValue($,Z){m6.useDebugValue($);let H=this;J0(()=>{if(H.state[$]!==Z)H.set($,Z)},[H,$,Z])}useSyncedValueWithCleanup($,Z){let H=this;J0(()=>{if(H.state[$]!==Z)H.set($,Z);return()=>{H.set($,void 0)}},[H,$,Z])}useSyncedValues($){let Z=this,H=Object.values($);J0(()=>{Z.update($)},[Z,...H])}useControlledProp($,Z){m6.useDebugValue($);let H=this,J=Z!==void 0;J0(()=>{if(J&&!Object.is(H.state[$],Z))H.setState({...H.state,[$]:Z})},[H,$,Z,J])}select($,Z,H,J){let B=this.selectors[$];return B(this.state,Z,H,J)}useState($,Z,H,J){return m6.useDebugValue($),OQ(this,this.selectors[$],Z,H,J)}useContextCallback($,Z){m6.useDebugValue($);let H=W0(Z??K1);this.context[$]=H}useStateSetter($){let Z=m6.useRef(void 0);if(Z.current===void 0)Z.current=(H)=>{this.set($,H)};return Z.current}observe($,Z){let H;if(typeof $==="function")H=$;else H=this.selectors[$];let J=H(this.state);return Z(J,J,this),this.subscribe((B)=>{let Q=H(B);if(!Object.is(J,Q)){let z=J;J=Q,Z(Q,z,this)}})}}function K4(...$){return()=>{for(let Z=0;Z<$.length;Z+=1){let H=$[Z];if(H)H()}}}function i0($,Z,H,J){return $.addEventListener(Z,H,J),()=>{$.removeEventListener(Z,H,J)}}var TQ=null,WY0=globalThis.requestAnimationFrame;class IP{callbacks=[];callbacksCount=0;nextId=1;startId=1;isScheduled=!1;tick=($)=>{this.isScheduled=!1;let Z=this.callbacks,H=this.callbacksCount;if(this.callbacks=[],this.callbacksCount=0,this.startId=this.nextId,H>0)for(let J=0;J<Z.length;J+=1)Z[J]?.($)};request($){let Z=this.nextId;this.nextId+=1,this.callbacks.push($),this.callbacksCount+=1;let H=!1;if(!this.isScheduled||H)requestAnimationFrame(this.tick),this.isScheduled=!0;return Z}cancel($){let Z=$-this.startId;if(Z<0||Z>=this.callbacks.length)return;if(this.callbacks[Z]===null)return;this.callbacks[Z]=null,this.callbacksCount-=1}}var CQ=new IP;class j4{static create(){return new j4}static request($){return CQ.request($)}static cancel($){return CQ.cancel($)}currentId=TQ;request($){this.cancel(),this.currentId=CQ.request(()=>{this.currentId=TQ,$()})}cancel=()=>{if(this.currentId!==TQ)CQ.cancel(this.currentId),this.currentId=TQ};disposeEffect=()=>{return this.cancel}}function Z2(){let $=p1(j4.create).current;return N3($.disposeEffect),$}var OH=0;class v5{static create(){return new v5}currentId=OH;start($,Z){this.clear(),this.currentId=setTimeout(()=>{this.currentId=OH,Z()},$)}isStarted(){return this.currentId!==OH}clear=()=>{if(this.currentId!==OH)clearTimeout(this.currentId),this.currentId=OH};disposeEffect=()=>{return this.clear}}function a1(){let $=p1(v5.create).current;return N3($.disposeEffect),$}var kP=0;function wQ($){return kP+=1,`${$}-${Math.random().toString(36).slice(2,6)}-${kP}`}function EQ($,Z){if(typeof $==="string")return{description:$};if(typeof $==="function"){let H=$(Z);return typeof H==="string"?{description:H}:H}return $}var n1={};g5(n1,{screenReader:()=>iY,os:()=>cY,mediaQuery:()=>aY,env:()=>rY,engine:()=>lY});var cY={};g5(cY,{windows:()=>or,mac:()=>hP,linux:()=>sr,ios:()=>uY,apple:()=>pY,android:()=>yP});function rr(){if(typeof navigator>"u")return{userAgent:"",platform:"",maxTouchPoints:0};return{userAgent:navigator.userAgent,platform:navigator.platform??"",maxTouchPoints:navigator.maxTouchPoints??0}}var{userAgent:ar,platform:nr,maxTouchPoints:RP}=rr(),u6=ar.toLowerCase(),p6=nr.toLowerCase();var uY=/^i(os$|p)/.test(p6)||p6==="macintel"&&RP>1,bP="android",yP=p6===bP||u6.includes(bP),hP=!uY&&p6.startsWith("mac"),or=p6.startsWith("win"),sr=!yP&&/^(linux|chrome os)/.test(p6),pY=hP||uY;var lY={};g5(lY,{webkit:()=>dY,gecko:()=>tr,blink:()=>er});var dY=typeof CSS<"u"&&!!CSS.supports?.("-webkit-backdrop-filter:none"),tr=!dY&&u6.includes("firefox"),er=!dY&&u6.includes("chrom");var iY={};g5(iY,{voiceOver:()=>$a});var $a=pY;var rY={};g5(rY,{jsdom:()=>Za});var Za=/jsdom|happydom/.test(u6);var aY={};g5(aY,{iOS:()=>Ha});var Ha="@supports (-webkit-touch-callout: none)";function c1($){let Z=$.activeElement;while(Z?.shadowRoot?.activeElement!=null)Z=Z.shadowRoot.activeElement;return Z}function k0($,Z){if(!$||!Z)return!1;let H=Z.getRootNode?.();if($.contains(Z))return!0;if(H&&L3(H)){let J=Z;while(J){if($===J)return!0;J=J.parentNode||J.host}}return!1}function P1($){if("composedPath"in $)return $.composedPath()[0]??$.target;return $.target}var TH="data-base-ui-focusable";var nY="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])",CH="ArrowLeft",wH="ArrowRight",oY="ArrowUp",SQ="ArrowDown";var r8={};g5(r8,{startingStyle:()=>c6,endingStyle:()=>EH});var c6="data-starting-style",EH="data-ending-style";var Ja={[c6]:""},Ba={[EH]:""},D2={transitionStatus($){if($==="starting")return Ja;if($==="ending")return Ba;return null}};var d6={};g5(d6,{startingStyle:()=>Qa,side:()=>Xa,open:()=>sY,endingStyle:()=>za,closed:()=>tY,anchorHidden:()=>eY,align:()=>Ga});var sY="data-open",tY="data-closed",Qa=c6,za=EH,eY="data-anchor-hidden",Xa="data-side",Ga="data-align";var kQ={};g5(kQ,{pressed:()=>$W,popupOpen:()=>IQ});var IQ="data-popup-open",$W="data-pressed";var Ua={[IQ]:""},Ka={[IQ]:"",[$W]:""},Fa={[sY]:""},Ya={[tY]:""},Wa={[eY]:""},a8={open($){if($)return Ua;return null}},SH={open($){if($)return Ka;return null}},b2={open($){if($)return Fa;return Ya},anchorHidden($){if($)return Wa;return null}},y4={...b2,...D2};var bY0=kQ.popupOpen,IH="data-trigger-disabled";function D3($,Z){if(!r0($))return!1;let H=$;if(Z.hasElement(H))return!H.hasAttribute(IH);for(let[,J]of Z.entries())if(k0(J,H))return!J.hasAttribute(IH);return!1}function RQ($,Z){if(Z==null)return!1;if("composedPath"in $)return $.composedPath().includes(Z);let H=$;return H.target!=null&&Z.contains(H.target)}function vP($){return $.matches("html,body")}function l6($){return C1($)&&$.matches(nY)}function ZW($){return $?.closest(`button,a[href],[role="button"],select,[tabindex]:not([tabindex="-1"]),${nY}`)!=null}function kH($){if(!$)return!1;return $.getAttribute("role")==="combobox"&&l6($)}function n8($){if(!$||n1.env.jsdom)return!0;try{return $.matches(":focus-visible")}catch(Z){return!0}}function RH($){if(!$)return null;return $.hasAttribute(TH)?$:$.querySelector(`[${TH}]`)||$}function s2($,Z,H=!0){return $.filter((B)=>B.parentId===Z).flatMap((B)=>[...!H||B.context?.open?[B]:[],...s2($,B.id,H)])}function HW($,Z){let H=[],J=$.find((B)=>B.id===Z)?.parentId;while(J){let B=$.find((Q)=>Q.id===J);if(J=B?.parentId,B)H=H.concat(B)}return H}function y2($){$.preventDefault(),$.stopPropagation()}function gP($){return"nativeEvent"in $}function N$($){if($.pointerType===""&&$.isTrusted)return!0;if(n1.os.android&&$.pointerType)return $.type==="click"&&$.buttons===1;return $.detail===0&&!$.pointerType}function V$($){if(n1.env.jsdom)return!1;return!n1.os.android&&$.width===0&&$.height===0||n1.os.android&&$.width===1&&$.height===1&&$.pressure===0&&$.detail===0&&$.pointerType==="mouse"||$.width<1&&$.height<1&&$.pressure===0&&$.detail===0&&$.pointerType==="touch"}function h2($,Z){let H=["mouse","pen"];if(!Z)H.push("",void 0);return H.includes($)}function fP($){let Z=$.type;return Z==="click"||Z==="mousedown"||Z==="keydown"||Z==="keyup"}var{min:q3,max:q8,round:M3,floor:yH}=Math,o8=($)=>({x:$,y:$}),Aa={left:"right",right:"left",bottom:"top",top:"bottom"};function yQ($,Z,H){return q8($,q3(Z,H))}function s8($,Z){return typeof $==="function"?$(Z):$}function h4($){return $.split("-")[0]}function t2($){return $.split("-")[1]}function hQ($){return $==="x"?"y":"x"}function hH($){return $==="y"?"height":"width"}function q2($){let Z=$[0];return Z==="t"||Z==="b"?"y":"x"}function xH($){return hQ(q2($))}function pP($,Z,H){if(H===void 0)H=!1;let J=t2($),B=xH($),Q=hH(B),z=B==="x"?J===(H?"end":"start")?"right":"left":J==="start"?"bottom":"top";if(Z.reference[Q]>Z.floating[Q])z=bH(z);return[z,bH(z)]}function cP($){let Z=bH($);return[bQ($),Z,bQ(Z)]}function bQ($){return $.includes("start")?$.replace("start","end"):$.replace("end","start")}var mP=["left","right"],uP=["right","left"],Na=["top","bottom"],Va=["bottom","top"];function La($,Z,H){switch($){case"top":case"bottom":if(H)return Z?uP:mP;return Z?mP:uP;case"left":case"right":return Z?Na:Va;default:return[]}}function dP($,Z,H,J){let B=t2($),Q=La(h4($),H==="start",J);if(B){if(Q=Q.map((z)=>z+"-"+B),Z)Q=Q.concat(Q.map(bQ))}return Q}function bH($){let Z=h4($);return Aa[Z]+$.slice(Z.length)}function Da($){var Z,H,J,B;return{top:(Z=$.top)!=null?Z:0,right:(H=$.right)!=null?H:0,bottom:(J=$.bottom)!=null?J:0,left:(B=$.left)!=null?B:0}}function xQ($){return typeof $!=="number"?Da($):{top:$,right:$,bottom:$,left:$}}function i6($){let{x:Z,y:H,width:J,height:B}=$;return{width:J,height:B,top:H,left:Z,right:Z+J,bottom:H+B,x:Z,y:H}}function JW($,Z){return Z<0||Z>=$.length}function vQ($,Z){return r6($.current,{disabledIndices:Z})}function BW($,Z){return r6($.current,{decrement:!0,startingIndex:$.current.length,disabledIndices:Z})}function r6($,{startingIndex:Z=-1,decrement:H=!1,disabledIndices:J,amount:B=1}={}){let Q=Z;do Q+=H?-B:B;while(Q>=0&&Q<=$.length-1&&QW($,Q,J));return Q}function QW($,Z,H){if(typeof H==="function"?H(Z):H?.includes(Z)??!1)return!0;let B=$[Z];if(!B)return!1;if(!a6(B))return!0;if(B.matches(":disabled"))return!0;return!H&&(B.hasAttribute("disabled")||B.getAttribute("aria-disabled")==="true")}function qa($){return $.visibility==="hidden"||$.visibility==="collapse"}function a6($,Z=$?O4($):null){if(!$||!$.isConnected||!Z||qa(Z))return!1;if(typeof $.checkVisibility==="function")return $.checkVisibility();return Z.display!=="none"&&Z.display!=="contents"}var Ma='a[href],button,input,select,textarea,summary,details,iframe,object,embed,[tabindex],[contenteditable]:not([contenteditable="false"]),audio[controls],video[controls]';function Pa($){let Z=$.assignedSlot;if(Z)return Z;if($.parentElement)return $.parentElement;let H=$.getRootNode();return L3(H)?H.host:null}function XW($){for(let Z of Array.from($.children))if(F4(Z)==="summary")return Z;return null}function _a($,Z){let H=XW(Z);return!!H&&($===H||k0(H,$))}function lP($){let Z=$?F4($):"";return $!=null&&$.matches(Ma)&&(Z!=="summary"||$.parentElement!=null&&F4($.parentElement)==="details"&&XW($.parentElement)===$)&&(Z!=="details"||XW($)==null)&&(Z!=="input"||$.type!=="hidden")}function iP($){if(!lP($)||!$.isConnected||$.matches(":disabled"))return!1;for(let Z=$;Z;Z=Pa(Z)){let H=Z!==$,J=F4(Z)==="slot";if(Z.hasAttribute("inert"))return!1;if(H&&F4(Z)==="details"&&!Z.open&&!_a($,Z)||Z.hasAttribute("hidden")||!J&&!ja(Z,H))return!1}return!0}function ja($,Z){let H=O4($);if(!Z)return a6($,H);return H.display!=="none"}function rP($){let Z=$.tabIndex;if(Z<0){let H=F4($);if(H==="details"||H==="audio"||H==="video"||C1($)&&$.isContentEditable)return 0}return Z}function zW($){if(F4($)!=="input")return null;let Z=$;return Z.type==="radio"&&Z.name!==""?Z:null}function Oa($,Z){let H=zW($);if(!H)return!0;let J=Z.find((B)=>{let Q=zW(B);return Q?.name===H.name&&Q.form===H.form&&Q.checked});if(J)return J===H;return Z.find((B)=>{let Q=zW(B);return Q?.name===H.name&&Q.form===H.form})===H}function aP($){if(C1($)&&F4($)==="slot"){let Z=$.assignedElements({flatten:!0});if(Z.length>0)return Z}if(C1($)&&$.shadowRoot)return Array.from($.shadowRoot.children);return Array.from($.children)}function nP($,Z){aP($).forEach((H)=>{if(lP(H))Z.push(H);nP(H,Z)})}function oP($,Z,H){aP($).forEach((J)=>{if(C1(J)&&J.matches(Z))H.push(J);oP(J,Z,H)})}function gQ($){return iP($)&&rP($)>=0}function GW($){let Z=[];return nP($,Z),Z.filter(iP)}function L$($){let Z=GW($);return Z.filter((H)=>rP(H)>=0&&Oa(H,Z))}function sP($,Z){let H=L$($),J=H.length;if(J===0)return;let B=c1(f0($)),Q=H.indexOf(B),z=Q===-1?Z===1?0:J-1:Q+Z;return H[z]}function D$($){return sP(f0($).body,1)||$}function fQ($){return sP(f0($).body,-1)||$}function tP($,Z){if(!$)return null;let H=L$(f0($).body),J=H.length;if(J===0)return null;let B=H.indexOf($);if(B===-1)return null;let Q=(B+Z+J)%J;return H[Q]}function eP($){return tP($,1)}function $_($){return tP($,-1)}function p9($,Z){let H=Z||$.currentTarget,J=$.relatedTarget;return!J||!k0(H,J)}function Z_($){L$($).forEach((H)=>{H.dataset.tabindex=H.getAttribute("tabindex")||"",H.setAttribute("tabindex","-1")})}function UW($){let Z=[];oP($,"[data-tabindex]",Z),Z.forEach((H)=>{let J=H.dataset.tabindex;if(delete H.dataset.tabindex,J)H.setAttribute("tabindex",J);else H.removeAttribute("tabindex")})}function KW($){let Z=new Map,H=0,J=0;return $.forEach((B,Q)=>{let z=B.transitionStatus==="ending";if(Z.set(B.id,{value:B,domIndex:Q,visibleIndex:z?-1:H,offsetY:J}),J+=B.height||0,!z)H+=1}),Z}function FW($,Z){let H=0;return $.map((J)=>{if(J.transitionStatus==="ending")return J;let B=H>=Z;return H+=1,J.limited===B?J:{...J,limited:B}})}var M8={toasts:($)=>$.toasts,isEmpty:($)=>$.toasts.length===0,toast:($,Z)=>$.toastMetadata.get(Z)?.value,toastIndex:($,Z)=>$.toastMetadata.get(Z)?.domIndex??-1,toastOffsetY:($,Z)=>$.toastMetadata.get(Z)?.offsetY??0,toastVisibleIndex:($,Z)=>$.toastMetadata.get(Z)?.visibleIndex??-1,focused:($)=>$.focused,expanded:($)=>$.hovering||$.focused,expandedOrOutOfFocus:($)=>$.hovering||$.focused||!$.isWindowFocused,prevFocusElement:($)=>$.prevFocusElement};class YW extends _4{timers=new Map;areTimersPaused=!1;constructor($){super({...$,toastMetadata:KW($.toasts)},{},M8)}setViewport=($)=>{this.set("viewport",$)};syncProviderProps($,Z){let H=this.state.limit!==Z;if(this.state.timeout===$&&!H)return;let J={timeout:$,limit:Z};if(H){let B=FW(this.state.toasts,Z);J.toasts=B,J.toastMetadata=KW(B)}this.update(J)}disposeEffect=()=>{return()=>{this.timers.forEach(($)=>{$.timeout?.clear()}),this.timers.clear()}};removeToast($,Z=!1){let H=M8.toastIndex(this.state,$);if(H===-1)return;let J=this.state.toasts[H];if(!Z)J?.onRemove?.();let B=[...this.state.toasts];B.splice(H,1),this.setToasts(B)}addToast=($)=>{let{timeout:Z,limit:H}=this.state,J=$.id||wQ("toast");if($.id){let X=M8.toast(this.state,$.id);if(X)if(X.transitionStatus==="ending")this.removeToast($.id,!0);else{let{id:G,transitionStatus:U,...K}=$;return this.updateToastInternal($.id,K,!0,!0),$.id}}let B={...$,id:J,updateKey:0,transitionStatus:"starting"},Q=[B,...this.state.toasts];this.setToasts(FW(Q,H));let z=B.timeout??Z;if(B.type!=="loading"&&z>0)this.scheduleTimer(J,z,()=>this.closeToast(J));if(M8.expandedOrOutOfFocus(this.state))this.pauseTimers();return J};updateToast=($,Z)=>{let H=M8.toast(this.state,$);if(!H||H.transitionStatus==="ending")return;this.updateToastInternal($,typeof Z==="function"?Z(H):Z,!1,!0)};updateToastInternal=($,Z,H=!1,J=!1)=>{let{timeout:B,toasts:Q}=this.state,z=M8.toast(this.state,$);if(!z)return;if(z.transitionStatus==="ending")return;let X={...z,...Z,...J&&{updateKey:z.updateKey+1}};this.setToasts(Q.map((N)=>N.id===$?X:N));let G=X.timeout??B,U=z.timeout??B,K=Object.hasOwn(Z,"timeout"),F=X.transitionStatus!=="ending"&&X.type!=="loading"&&G>0,Y=this.timers.has($),W=U!==G,A=z.type==="loading";if(!F&&Y){this.clearTimer($);return}if(F&&(!Y||W||K||A||H)){if(this.clearTimer($),this.scheduleTimer($,G,()=>this.closeToast($)),M8.expandedOrOutOfFocus(this.state))this.pauseTimers()}};closeToast=($)=>{let Z=$===void 0,{limit:H,toasts:J}=this.state,B;if(Z)B=J,this.clearTimers();else{let X=M8.toast(this.state,$);if(!X)return;B=[X],this.clearTimer($)}let Q=J.map((X)=>Z||X.id===$?{...X,transitionStatus:"ending",height:0}:X),z=FW(Q,H);this.setToasts(z,!z.some((X)=>X.transitionStatus!=="ending")),B.forEach((X)=>{if(X.transitionStatus!=="ending")X.onClose?.()}),this.handleFocusManagement($)};promiseToast=($,Z)=>{let H=EQ(Z.loading),J=this.addToast({...H,type:"loading"}),B=$.then((Q)=>{let z=EQ(Z.success,Q);return this.updateToast(J,{...z,type:"success",timeout:z.timeout}),Q}).catch((Q)=>{let z=EQ(Z.error,Q);return this.updateToast(J,{...z,type:"error",timeout:z.timeout}),Promise.reject(Q)});if({}.hasOwnProperty.call(Z,"setPromise"))Z.setPromise(B);return B};pauseTimers(){if(this.areTimersPaused)return;this.areTimersPaused=!0,this.timers.forEach(($)=>{if($.timeout)$.timeout.clear(),$.remaining=Math.max($.remaining-(Date.now()-$.start),0)})}resumeTimers(){if(!this.areTimersPaused)return;this.areTimersPaused=!1,this.timers.forEach(($,Z)=>{$.remaining=$.remaining>0?$.remaining:$.delay,$.timeout??=v5.create(),$.timeout.start($.remaining,()=>{this.handleTimerFired(Z),$.callback()}),$.start=Date.now()})}restoreFocusToPrevElement(){this.state.prevFocusElement?.focus({preventScroll:!0})}handleDocumentPointerDown=($)=>{if($.pointerType!=="touch")return;let Z=P1($);if(k0(this.state.viewport,Z))return;this.resumeTimers(),this.update({hovering:!1,focused:!1})};scheduleTimer($,Z,H){let J=Date.now(),Q=!M8.expandedOrOutOfFocus(this.state)?v5.create():void 0;Q?.start(Z,()=>{this.handleTimerFired($),H()}),this.timers.set($,{timeout:Q,start:J,delay:Z,remaining:Z,callback:H})}clearTimers(){this.timers.forEach(($)=>{$.timeout?.clear()}),this.timers.clear(),this.areTimersPaused=!1}clearTimer($){this.timers.get($)?.timeout?.clear(),this.timers.delete($),this.resetPausedStateIfNoTimersRemain()}handleTimerFired($){this.timers.delete($),this.resetPausedStateIfNoTimersRemain()}resetPausedStateIfNoTimersRemain(){if(this.timers.size===0)this.areTimersPaused=!1}setToasts($,Z=$.length===0){let H={toasts:$,toastMetadata:KW($)};if(Z)H.hovering=!1,H.focused=!1;this.update(H)}handleFocusManagement($){let Z=c1(f0(this.state.viewport));if(!this.state.viewport||!k0(this.state.viewport,Z)||!n8(Z))return;if($===void 0){this.restoreFocusToPrevElement();return}let H=M8.toasts(this.state),J=M8.toastIndex(this.state,$),B=(z,X)=>{for(let G=z;G>=0&&G<H.length;G+=X)if(H[G].transitionStatus!=="ending")return H[G];return null},Q=B(J+1,1)??B(J-1,-1);if(Q)Q.ref?.current?.focus();else this.restoreFocusToPrevElement()}}var mQ=_(r(),1),J_=function(Z){let{children:H,timeout:J=5000,limit:B=3,toastManager:Q}=Z,z=p1(()=>new YW({timeout:J,limit:B,viewport:null,toasts:[],hovering:!1,focused:!1,isWindowFocused:!0,prevFocusElement:null})).current;return N3(z.disposeEffect),H_.useEffect(function(){if(!Q)return;return Q[" subscribe"](({action:U,options:K})=>{let F=K.id;if(U==="promise"&&K.promise)z.promiseToast(K.promise,K);else if(U==="update"&&F)z.updateToast(F,K.updates);else if(U==="close")z.closeToast(F);else z.addToast(K)})},[z,Q]),mQ.jsxs(hY.Provider,{value:z,children:[mQ.jsx(Ta,{store:z,timeout:J,limit:B}),H]})};function Ta($){let{store:Z,timeout:H,limit:J}=$;return J0(()=>{Z.syncProviderProps(H,J)},[Z,H,J]),null}var e2=_(p(),1);var B_={clipPath:"inset(50%)",overflow:"hidden",whiteSpace:"nowrap",border:0,padding:0,width:1,height:1,margin:-1},c9={...B_,position:"fixed",top:0,left:0},Q_={...B_,position:"absolute"};var uQ=_(p(),1);var z_=_(r(),1),M2=uQ.forwardRef(function(Z,H){let[J,B]=uQ.useState();return J0(()=>{if(n1.screenReader.voiceOver&&n1.engine.webkit)B("button")},[]),z_.jsx("span",{...Z,ref:H,style:c9,"aria-hidden":J?void 0:!0,...{tabIndex:0,role:J},"data-base-ui-focus-guard":""})});var X_="--toast-frontmost-height";var d9=_(r(),1),G_=e2.forwardRef(function(Z,H){let{render:J,className:B,style:Q,children:z,...X}=Z,G=l8(),U=a1(),K=e2.useRef(!1),F=e2.useRef(!1),Y=e2.useRef(!1),W=G.useState("isEmpty"),A=G.useState("toasts"),N=G.useState("focused"),L=G.useState("expanded"),V=G.useState("prevFocusElement"),D=A[0]?.height,q=A.some((g)=>g.transitionStatus==="ending"),j=A.filter((g)=>g.priority==="high");e2.useEffect(()=>{let g=G.state.viewport;if(!g||W)return;let O=u1(g),c=f0(g);function o(t){if(t.key==="F6"&&P1(t)!==g)t.preventDefault(),G.set("prevFocusElement",c1(c)),g?.focus({preventScroll:!0}),G.pauseTimers(),G.set("focused",!0)}function b(t){if(P1(t)!==O)return;G.set("isWindowFocused",!1),G.pauseTimers()}function d(t){if(t.relatedTarget)return;let u=P1(t),a=c1(f0(g));if(u===O||!k0(g,u)||!n8(a))G.resumeTimers();U.start(0,()=>G.set("isWindowFocused",!0))}return K4(i0(O,"keydown",o),i0(O,"blur",b,!0),i0(O,"focus",d,!0),i0(c,"pointerdown",G.handleDocumentPointerDown,!0))},[G,U,W]);function M(g){K.current=!0;let O=g.relatedTarget===G.state.viewport?A.find((c)=>c.transitionStatus!=="ending"&&!c.limited):void 0;if(O)O.ref?.current?.focus();else G.restoreFocusToPrevElement()}function P(g){if(g.key==="Tab"&&g.shiftKey&&P1(g.nativeEvent)===G.state.viewport)g.preventDefault(),G.restoreFocusToPrevElement()}function T(){if(G.state.toasts.some((O)=>O.transitionStatus==="ending")||Y.current||!F.current)return;if(G.state.isWindowFocused)G.resumeTimers();G.set("hovering",!1),F.current=!1}e2.useEffect(T,[q,G]);function C(){G.pauseTimers(),G.set("hovering",!0),F.current=!1}function k(){if(G.state.isWindowFocused)G.resumeTimers()}function E(){F.current=!0,T()}function h(g){if(g.pointerType==="touch")Y.current=!0}function x(g){if(g.pointerType!=="touch")return;Y.current=!1,T()}function R(){if(K.current){K.current=!1;return}if(N)return;if(n8(c1(f0(G.state.viewport))))G.set("focused",!0),G.pauseTimers()}function w(g){if(!N||k0(G.state.viewport,g.relatedTarget))return;G.set("focused",!1),k()}let S={tabIndex:-1,role:"region","aria-live":"polite","aria-atomic":!1,"aria-relevant":"additions text","aria-label":"Notifications",onMouseEnter:C,onMouseMove:C,onMouseLeave:E,onFocus:R,onBlur:w,onKeyDown:P,onClick:R,onPointerDown:h,onPointerUp:x,onPointerCancel:x,style:{[X_]:D?`${D}px`:void 0}},I={expanded:L},y=!W&&V&&d9.jsx(M2,{onFocus:M}),f=F0("div",Z,{ref:[H,G.setViewport],state:I,props:[S,X,{children:d9.jsxs(e2.Fragment,{children:[y,z,y]})}]});return d9.jsxs(e2.Fragment,{children:[y,f,!N&&j.length>0&&d9.jsx("div",{style:c9,children:j.map((g)=>d9.jsxs("div",{role:"alert","aria-atomic":!0,children:[d9.jsx("div",{children:g.title}),d9.jsx("div",{children:g.description})]},g.id))})]})});var U5=_(p(),1),T_=_(x2(),1);function t8($){if(jQ(19))return $;return $?"true":void 0}var pQ=_(p(),1),WW=pQ.createContext(void 0);function P3(){let $=pQ.useContext(WW);if(!$)throw Error(g0(66));return $}var U_=_(p(),1);var AW=_(x2(),1);function P8($){if($==null)return $;return"current"in $?$.current:$}var cQ=null;function wa($){if(!cQ){let Z=[];cQ=Z,queueMicrotask(()=>{cQ=null,AW.flushSync(()=>{for(let H of Z)H()})})}cQ.push($)}function P2($,Z=!1,H=!1){let J=Z2();return W0((B,Q=null)=>{J.cancel();let z=P8($);if(z==null)return;let X=z,G=()=>{if(!H){AW.flushSync(B);return}wa(()=>{if(!Q?.aborted)B()})};if(typeof X.getAnimations!=="function"||globalThis.BASE_UI_ANIMATIONS_DISABLED){B();return}function U(){Promise.all(X.getAnimations().map((K)=>K.finished)).then(()=>{if(!Q?.aborted)G()},()=>{if(Q?.aborted)return;if(X.getAnimations().some((F)=>F.pending||F.playState!=="finished")){U();return}G()})}if(Z){let K=c6;if(!X.hasAttribute(K)){J.request(U);return}let F=new MutationObserver(()=>{if(!X.hasAttribute(K))F.disconnect(),U()});F.observe(X,{attributes:!0,attributeFilter:[K]}),Q?.addEventListener("abort",()=>F.disconnect(),{once:!0});return}J.request(U)})}function f5($){let{enabled:Z=!0,open:H,ref:J,batch:B=!1,onComplete:Q}=$,z=W0(Q),X=P2(J,H,B);U_.useEffect(()=>{if(!Z)return;let G=new AbortController;return X(z,G.signal),()=>{G.abort()}},[Z,H,z,X])}var K_=500,dQ=500,F_={style:{transition:"none"}},q$="data-base-ui-click-trigger";var Y_="[data-base-ui-swipe-ignore]",W_="[data-swipe-ignore]",A_={fallbackAxisSide:"none"},e8={fallbackAxisSide:"end"},N_={clipPath:"inset(50%)",position:"fixed",top:0,left:0};var lQ=_(p(),1);function Y4($,Z=Number.MIN_SAFE_INTEGER,H=Number.MAX_SAFE_INTEGER){return Math.max(Z,Math.min($,H))}function V_($,Z){let H=(Z??u1($).getComputedStyle($)).transform,J=0,B=0,Q=1;if(H&&H!=="none"){let z=H.match(/matrix(?:3d)?\(([^)]+)\)/);if(z){let X=z[1].split(", ").map(parseFloat);if(X.length===6)J=X[4],B=X[5],Q=Math.sqrt(X[0]*X[0]+X[1]*X[1]);else if(X.length===16)J=X[12],B=X[13],Q=X[0]}}return{x:J,y:B,scale:Q}}function iQ($,Z,H){switch($){case"up":return-H;case"down":return H;case"left":return-Z;case"right":return Z;default:return 0}}var rQ="--toast-index",L_="--toast-offset-y",D_="--toast-height",q_="--toast-swipe-movement-x",M_="--toast-swipe-movement-y";var __="data-swipe-direction",iW0=r8.startingStyle,rW0=r8.endingStyle;var C_=_(r(),1),Sa={...D2,swipeDirection($){return $?{[__]:$}:null}},j_=40,Ia=10,O_=0.5,ka=1,Ra=`${Y_},${W_}`,w_=U5.forwardRef(function(Z,H){let{toast:J,render:B,className:Q,swipeDirection:z=["down","right"],style:X,...G}=Z,U=J.positionerProps?.anchor!==void 0,K=[];if(!U)K=Array.isArray(z)?z:[z];let F=K.length>0,Y=l8(),[W,A]=U5.useState(void 0),[N,L]=U5.useState(!1),[V,D]=U5.useState(!1),[q,j]=U5.useState({x:0,y:0}),[M,P]=U5.useState({x:0,y:0,scale:1}),[T,C]=U5.useState(),[k,E]=U5.useState(),[h,x]=U5.useState(null),R=U5.useRef(null),w=U5.useRef(void 0),S=U5.useRef({x:0,y:0}),I=U5.useRef({x:0,y:0,scale:1}),y=U5.useRef(void 0),f=U5.useRef(0),g=U5.useRef(!1),O=U5.useRef({x:0,y:0}),c=U5.useRef(!1),o=U5.useRef({x:0,y:0}),b=U5.useRef(null),d=U5.useRef(null),t=Y.useState("toastIndex",J.id),u=Y.useState("toastVisibleIndex",J.id),a=Y.useState("toastOffsetY",J.id),n=Y.useState("focused"),Q0=Y.useState("expanded");f5({open:J.transitionStatus!=="ending",ref:R,onComplete(){if(J.transitionStatus==="ending")Y.removeToast(J.id)}});let Z0=W0((P0=!1)=>{let N0=R.current;if(!N0)return;let M0=N0.style.height;N0.style.height="auto";let v=N0.offsetHeight;N0.style.height=M0;function m(){Y.updateToastInternal(J.id,{ref:R,height:v,transitionStatus:void 0})}if(P0)T_.flushSync(m);else m()});J0(()=>{let P0=w.current;if(J.transitionStatus!=="starting"&&P0===J.id)return;if(P0!==void 0)A(void 0),P({x:0,y:0,scale:1}),U0({x:0,y:0});w.current=J.id,Z0()},[Z0,J.id,J.transitionStatus]);function U0(P0){o.current=P0,j(P0)}J0(()=>{return()=>{d.current?.abort()}},[]);function B0(P0,N0){let M0=(s)=>s>0?s**O_:-(Math.abs(s)**O_),v=P0>0&&!K.includes("right")||P0<0&&!K.includes("left"),m=N0>0&&!K.includes("down")||N0<0&&!K.includes("up");return{x:v?M0(P0):P0,y:m?M0(N0):N0}}let Y0=W0((P0)=>{if(P0.pointerId!==b.current)return;b.current=null,d.current?.abort(),d.current=null,L(!1),D(!1),x(null);let N0=I.current;if(P0.type==="pointercancel"||g.current){U0({x:N0.x,y:N0.y}),A(void 0);return}let M0=o.current,v=M0.x-N0.x,m=M0.y-N0.y,s;for(let G0 of K)if(iQ(G0,v,m)>j_){s=G0;break}if(s)A(s),Y.closeToast(J.id);else U0({x:N0.x,y:N0.y}),A(void 0)});function A0(P0){if(P0.button!==0)return;if(P0.pointerType==="touch")Y.pauseTimers();if(P1(P0.nativeEvent)?.closest(`button,a,input,textarea,[role="button"],${Ra}`))return;g.current=!1,y.current=void 0,f.current=0,b.current=P0.pointerId,S.current={x:P0.clientX,y:P0.clientY},O.current=S.current;let v=P0.currentTarget,m=V_(v);I.current=m,P(m),U0({x:m.x,y:m.y}),Y.set("hovering",!0),L(!0),D(!1),x(null),c.current=!0,d.current?.abort();let s=new AbortController;d.current=s;let G0=f0(v);G0.addEventListener("pointerup",Y0,{signal:s.signal}),G0.addEventListener("pointercancel",Y0,{signal:s.signal}),v.setPointerCapture?.(P0.pointerId)}function D0(P0){if(P0.pointerId!==b.current)return;if(P0.preventDefault(),c.current)S.current={x:P0.clientX,y:P0.clientY},c.current=!1;let{clientY:N0,clientX:M0,movementX:v,movementY:m}=P0;if(m<0&&N0>O.current.y||m>0&&N0<O.current.y)O.current={x:O.current.x,y:N0};if(v<0&&M0>O.current.x||v>0&&M0<O.current.x)O.current={x:M0,y:O.current.y};let s=M0-S.current.x,G0=N0-S.current.y,j0=N0-O.current.y,m0=M0-O.current.x,v0=h;if(!V){if(Math.sqrt(s*s+G0*G0)>=ka){D(!0);let M1=K.includes("left")||K.includes("right"),q0=K.includes("up")||K.includes("down");if(M1&&q0){let V0=Math.abs(s),I0=Math.abs(G0);v0=V0>I0?"horizontal":"vertical",x(v0)}}}let T0;if(!y.current){if(v0==="vertical"){if(G0>0)T0="down";else if(G0<0)T0="up"}else if(v0==="horizontal"){if(s>0)T0="right";else if(s<0)T0="left"}else if(Math.abs(s)>=Math.abs(G0))T0=s>0?"right":"left";else T0=G0>0?"down":"up";if(T0&&K.includes(T0))y.current=T0,f.current=iQ(T0,s,G0),A(T0)}else{let H5=y.current,M1=iQ(H5,m0,j0);if(M1>j_)g.current=!1,A(H5);else if(!(K.includes("left")&&K.includes("right"))&&!(K.includes("up")&&K.includes("down"))&&f.current-M1>=Ia)g.current=!0}let p0=B0(s,G0),$1=I.current.x,D1=I.current.y,u0=K.includes("left")||K.includes("right"),N1=K.includes("up")||K.includes("down");if(v0!=="vertical"&&u0)$1+=p0.x;if(v0!=="horizontal"&&N1)D1+=p0.y;U0({x:$1,y:D1})}function X0(P0){if(P0.key==="Escape"){if(!R.current||!k0(R.current,c1(f0(R.current))))return;Y.closeToast(J.id)}}U5.useEffect(()=>{let P0=R.current;if(!F||!P0)return;function N0(M0){if(b.current===null||!k0(P0,P1(M0)))return;M0.preventDefault()}return i0(P0,"touchmove",N0,{passive:!1})},[F]);function i(){let P0=q.x-M.x,N0=q.y-M.y;return{transition:N?"none":void 0,transform:N?`translateX(${q.x}px) translateY(${q.y}px) scale(${M.scale})`:void 0,[q_]:`${P0}px`,[M_]:`${N0}px`}}let l=J.priority==="high",e={role:l?"alertdialog":"dialog",tabIndex:0,"aria-modal":!1,"aria-labelledby":T,"aria-describedby":k,"aria-hidden":l&&!n?!0:void 0,onPointerDown:F?A0:void 0,onPointerMove:F?D0:void 0,onPointerUp:F?Y0:void 0,onPointerCancel:F?Y0:void 0,onKeyDown:X0,inert:t8(J.limited),style:{...i(),[rQ]:J.transitionStatus==="ending"?t:u,[L_]:`${a}px`,[D_]:J.height?`${J.height}px`:void 0}},$0=U5.useMemo(()=>({toast:J,setTitleId:C,setDescriptionId:E,recalculateHeight:Z0,visibleIndex:u,expanded:Q0}),[J,C,E,Z0,u,Q0]),H0={transitionStatus:J.transitionStatus,expanded:Q0,limited:J.limited||!1,type:J.type,swiping:N,swipeDirection:W},O0=F0("div",Z,{ref:[H,R],state:H0,stateAttributesMapping:Sa,props:[e,G]});return C_.jsx(WW.Provider,{value:$0,children:O0})});var aQ=_(p(),1);var E_=aQ.forwardRef(function(Z,H){let{render:J,className:B,style:Q,...z}=Z,{visibleIndex:X,expanded:G,recalculateHeight:U}=P3(),K=aQ.useRef(null);J0(()=>{U();let W=K.current;if(!W||typeof ResizeObserver!=="function"||typeof MutationObserver!=="function")return;let A=new ResizeObserver(()=>U(!0)),N=new MutationObserver(()=>U(!0));return A.observe(W),N.observe(W,{childList:!0,subtree:!0,characterData:!0}),()=>{A.disconnect(),N.disconnect()}},[U]);let F=X>0;return F0("div",Z,{ref:[H,K],state:{expanded:G,behind:F},props:z})});var y_=_(p(),1);var nQ=_(p(),1);var S_=0;function ba($,Z="mui"){let[H,J]=nQ.useState($),B=$||H;return nQ.useEffect(()=>{if(H==null)S_+=1,J(`${Z}-${S_}`)},[H,Z]),B}var I_=k_.useId;function H2($,Z){if(I_!==void 0){let H=I_();return $??(Z?`${Z}-${H}`:H)}return ba($,Z)}var R_=_(p(),1);function b_($){if($==null||typeof $==="boolean"||$==="")return!1;if(Array.isArray($))return $.some(b_);return!0}function oQ($){return R_.isValidElement($)&&b_($.props.children)}function sQ($,Z,H){let{toast:J,setTitleId:B,setDescriptionId:Q}=P3(),z=H==="title"?B:Q,X=Z??(H==="title"?J.title:J.description);return{id:H2($),children:X,type:J.type,setId:z}}function tQ($,Z,H){let J=oQ($);return J0(()=>{if(!J)return;return H(Z),()=>{H((B)=>B===Z?void 0:B)}},[J,Z,H]),J?$:null}var h_=y_.forwardRef(function(Z,H){let{render:J,className:B,style:Q,id:z,children:X,...G}=Z,{id:U,children:K,type:F,setId:Y}=sQ(z,X,"description"),A=F0("p",Z,{ref:H,state:{type:F},props:{...G,id:U,children:K}});return tQ(A,U,Y)});var x_=_(p(),1);var v_=x_.forwardRef(function(Z,H){let{render:J,className:B,style:Q,id:z,children:X,...G}=Z,{id:U,children:K,type:F,setId:Y}=sQ(z,X,"title"),A=F0("h2",Z,{ref:H,state:{type:F},props:{...G,id:U,children:K}});return tQ(A,U,Y)});var eQ=_(p(),1);var g_=eQ.forwardRef(function(Z,H){let{render:J,className:B,style:Q,disabled:z,nativeButton:X=!0,...G}=Z,U=l8(),{toast:K,expanded:F}=P3(),[Y,W]=eQ.useState(!1),{getButtonProps:A,buttonRef:N}=R5({disabled:z,native:X}),L={type:K.type};return F0("button",Z,{ref:[H,N],state:L,props:[{"aria-hidden":!F&&!Y,onClick(){U.closeToast(K.id)},onFocus(){W(!0)},onBlur(){W(!1)}},G,A]})});var f_=_(p(),1);var m_=f_.forwardRef(function(Z,H){let{render:J,className:B,style:Q,disabled:z,nativeButton:X=!0,...G}=Z,{toast:U}=P3(),K=U.actionProps?.children??G.children,{getButtonProps:F,buttonRef:Y}=R5({disabled:z,native:X}),W={type:U.type},A=F0("button",Z,{ref:[H,Y],state:W,props:[G,U.actionProps,F,{children:K}]});return oQ(A)?A:null});var l_=_(p(),1);var Hz=_(p(),1),c_=_(x2(),1);var j5=_(p(),1),NW=_(x2(),1);var K0={};g5(K0,{windowResize:()=>An,wheel:()=>Qn,triggerPress:()=>ha,triggerHover:()=>xa,triggerFocus:()=>va,trackPress:()=>da,swipe:()=>Wn,siblingOpen:()=>Gn,scrub:()=>zn,pointer:()=>Jn,outsidePress:()=>ga,none:()=>ya,missing:()=>Kn,listNavigation:()=>Zn,linkPress:()=>ua,keyboard:()=>Hn,itemPress:()=>fa,inputPress:()=>sa,inputPaste:()=>oa,inputClear:()=>aa,inputChange:()=>ra,inputBlur:()=>na,initial:()=>Fn,incrementPress:()=>la,imperativeAction:()=>Yn,focusOut:()=>ta,escapeKey:()=>ea,drag:()=>Bn,disabled:()=>Un,decrementPress:()=>ia,closeWatcher:()=>$n,closePress:()=>ma,clearPress:()=>pa,chipRemovePress:()=>ca,cancelOpen:()=>Xn});var ya="none",ha="trigger-press",xa="trigger-hover",va="trigger-focus",ga="outside-press",fa="item-press",ma="close-press",ua="link-press",pa="clear-press",ca="chip-remove-press",da="track-press",la="increment-press",ia="decrement-press",ra="input-change",aa="input-clear",na="input-blur",oa="input-paste",sa="input-press",ta="focus-out",ea="escape-key",$n="close-watcher",Zn="list-navigation",Hn="keyboard",Jn="pointer",Bn="drag",Qn="wheel",zn="scrub",Xn="cancel-open",Gn="sibling-open",Un="disabled",Kn="missing",Fn="initial",Yn="imperative-action",Wn="swipe",An="window-resize";function R0($,Z,H,J){let B=!1,Q=!1,z=J??_1;return{reason:$,event:Z??new Event("base-ui"),cancel(){B=!0},allowPropagation(){Q=!0},get isCanceled(){return B},get isPropagationAllowed(){return Q},trigger:H,...z}}function $z($,Z,H){let J=H??_1;return{reason:$,event:Z??new Event("base-ui"),...J}}function l9($){return`data-base-ui-${$}`}var n6=_(r(),1),p_=j5.createContext(null),VW=()=>j5.useContext(p_),Nn=l9("portal");function Zz($={}){let{ref:Z,container:H,componentProps:J=_1,elementProps:B}=$,Q=H2(),X=VW()?.portalNode,[G,U]=j5.useState(null),[K,F]=j5.useState(null),Y=W0((L)=>{if(L!==null)F(L)}),W=j5.useRef(null);J0(()=>{if(H===null){if(W.current)W.current=null,F(null),U(null);return}let L=(H&&(u_(H)?H:H.current))??X??document.body;if(L==null){if(W.current)W.current=null,F(null),U(null);return}if(W.current!==L)W.current=L,F(null),U(L)},[H,X]);let A=F0("div",J,{ref:[Z,Y],props:[{id:Q,[Nn]:""},B]}),N=G&&A?NW.createPortal(A,G):null;return{node:K,nodeId:j5.isValidElement(A)?A.props.id:void 0,subtree:N}}var o6=j5.forwardRef(function(Z,H){let{render:J,className:B,style:Q,children:z,container:X,portalOwnerRole:G,...U}=Z,{node:K,nodeId:F,subtree:Y}=Zz({container:X,ref:H,componentProps:Z,elementProps:U}),W=j5.useRef(null),A=j5.useRef(null),N=j5.useRef(null),L=j5.useRef(null),[V,D]=j5.useState(null),q=j5.useRef(!1),j=V?.modal,M=V?.open,P=!!V&&!V.modal&&V.open&&!!K;j5.useEffect(()=>{if(!K||j)return;function C(k){if(K&&k.relatedTarget&&p9(k))if(k.type==="focusin"){if(q.current)UW(K),q.current=!1}else Z_(K),q.current=!0}return K4(i0(K,"focusin",C,!0),i0(K,"focusout",C,!0))},[K,j]),J0(()=>{if(!K||M!==!0||!q.current)return;UW(K),q.current=!1},[M,K]);let T=j5.useMemo(()=>({beforeOutsideRef:W,afterOutsideRef:A,beforeInsideRef:N,afterInsideRef:L,portalNode:K,setFocusManagerState:D}),[K]);return n6.jsxs(j5.Fragment,{children:[Y,n6.jsxs(p_.Provider,{value:T,children:[P&&K&&n6.jsx(M2,{"data-type":"outside",ref:W,onFocus:(C)=>{if(p9(C,K))N.current?.focus();else{let k=V?V.domReference:null;fQ(k)?.focus()}}}),P&&K&&n6.jsx("span",{role:G,"aria-owns":F,style:N_}),K&&NW.createPortal(z,K),P&&K&&n6.jsx(M2,{"data-type":"outside",ref:A,onFocus:(C)=>{if(p9(C,K))L.current?.focus();else{let k=V?V.domReference:null;if(D$(k)?.focus(),V?.closeOnFocusOut)V?.onOpenChange(!1,R0(K0.focusOut,C.nativeEvent))}}})]})]})});var d_=_(r(),1),M$=Hz.forwardRef(function(Z,H){let{children:J,container:B,className:Q,render:z,style:X,...G}=Z,{node:U,subtree:K}=Zz({container:B,ref:H,componentProps:Z,elementProps:G});if(!K&&!U)return null;return d_.jsxs(Hz.Fragment,{children:[K,U&&c_.createPortal(J,U)]})});var i_=_(r(),1),r_=l_.forwardRef(function(Z,H){return i_.jsx(M$,{ref:H,...Z})});var Cz=_(p(),1);var g2=_(p(),1);function Q5($){let Z=p1(Vn,$).current;return Z.next=$,J0(Z.effect),Z}function Vn($){let Z={current:$,next:$,effect:()=>{Z.current=Z.next}};return Z}var J2=_(p(),1);function Ln($,Z){if(Z!=null&&!h2(Z))return 0;if(typeof $==="function")return $();return $}function _8($,Z,H){let J=Ln($,H);if(typeof J==="number")return J;return J?.[Z]}function LW($){if(typeof $==="function")return $();return $}function Jz($,Z){return Z||$==="click"||$==="mousedown"}function a_($){return $?.includes("mouse")&&$!=="mousedown"}var n_=_(r(),1),o_=J2.createContext({hasProvider:!1,timeoutMs:0,delayRef:{current:0},initialDelayRef:{current:0},timeout:new v5,currentIdRef:{current:null},currentContextRef:{current:null}});function Dn($,Z){$.current=Z.current}function DW($){let{children:Z,delay:H,timeoutMs:J=0}=$,B=J2.useRef(H),Q=J2.useRef(H),z=J2.useRef(null),X=J2.useRef(null),G=a1();return J0(()=>{if(Q.current=H,!z.current){B.current=H;return}B.current={open:_8(B.current,"open"),close:_8(H,"close")}},[H,z,B,Q]),n_.jsx(o_.Provider,{value:J2.useMemo(()=>({hasProvider:!0,delayRef:B,initialDelayRef:Q,currentIdRef:z,timeoutMs:J,currentContextRef:X,timeout:G}),[J,G]),children:Z})}function qW($,Z={open:!1}){let{open:H}=Z,J="rootStore"in $?$.rootStore:$,B=J.useState("floatingId"),Q=J2.useContext(o_),{currentIdRef:z,delayRef:X,timeoutMs:G,initialDelayRef:U,currentContextRef:K,hasProvider:F,timeout:Y}=Q,[W,A]=J2.useState(!1),N=J2.useRef(H);return J0(()=>{N.current=H},[H]),J0(()=>{function L(){K.current?.setIsInstantPhase(!1),z.current=null,K.current=null,X.current=U.current,Y.clear()}if(!z.current)return;if(!H&&z.current===B){if(A(!1),G){let V=B;return Y.start(G,()=>{if(J.select("open")||z.current&&z.current!==V)return;L()}),()=>{if(N.current||z.current!==V)Y.clear()}}L()}return},[H,B,z,X,G,U,K,Y,J]),J0(()=>{if(!H)return;let L=K.current,V=z.current;if(Y.clear(),K.current={onOpenChange:J.setOpen,setIsInstantPhase:A},z.current=B,X.current={open:0,close:_8(U.current,"close")},V!==null&&V!==B)A(!0),L?.setIsInstantPhase(!0),L?.onOpenChange(!1,R0(K0.none));else A(!1),L?.setIsInstantPhase(!1)},[H,B,J,z,X,U,K,Y]),J0(()=>{return()=>{if(z.current===B){if(K.current=null,!N.current)return;z.current=null,Dn(X,U),Y.clear()}}},[K,z,X,B,U,Y]),J2.useMemo(()=>({activeIdRef:z,hasProvider:F,delayRef:X,isInstantPhase:W}),[z,F,X,W])}var v4=_(p(),1);var Bz=0;function P$($,Z={}){let{preventScroll:H=!1,sync:J=!1,shouldFocus:B}=Z;cancelAnimationFrame(Bz);function Q(){if(B&&!B())return;$?.focus({preventScroll:H})}if(J)return Q(),K1;let z=requestAnimationFrame(Q);return Bz=z,()=>{if(Bz===z)cancelAnimationFrame(z),Bz=0}}var MW={inert:new WeakMap,"aria-hidden":new WeakMap},s_="data-base-ui-inert",_W={inert:new WeakSet,"aria-hidden":new WeakSet},vH=new WeakMap,PW=0;function qn($){return _W[$]}function Zj($){if(!$)return null;return L3($)?$.host:Zj($.parentNode)}var t_=($,Z)=>Z.map((H)=>{if($.contains(H))return H;let J=Zj(H);if($.contains(J))return J;return null}).filter((H)=>H!=null),e_=($)=>{let Z=new Set;return $.forEach((H)=>{let J=H;while(J&&!Z.has(J))Z.add(J),J=J.parentNode}),Z},$j=($,Z,H)=>{let J=[],B=(Q)=>{if(!Q||H.has(Q))return;Array.from(Q.children).forEach((z)=>{if(F4(z)==="script")return;if(Z.has(z))B(z);else J.push(z)})};return B($),J};function Mn($,Z,H,J,{mark:B=!0}){let Q=null;if(J)Q="inert";else if(H)Q="aria-hidden";let z=null,X=null,G=t_(Z,$),U=B?$j(Z,e_(G),new Set(G)):[],K=[],F=[];if(Q){let Y=MW[Q],W=qn(Q);X=W,z=Y;let A=t_(Z,Array.from(Z.querySelectorAll("[aria-live]"))),N=G.concat(A);$j(Z,e_(N),new Set(N)).forEach((V)=>{let D=V.getAttribute(Q),q=D!==null&&D!=="false",j=(Y.get(V)||0)+1;if(Y.set(V,j),K.push(V),j===1&&q)W.add(V);if(!q)V.setAttribute(Q,Q==="inert"?"":"true")})}if(B)U.forEach((Y)=>{let W=(vH.get(Y)||0)+1;if(vH.set(Y,W),F.push(Y),W===1)Y.setAttribute(s_,"")});return PW+=1,()=>{if(z)K.forEach((Y)=>{let A=(z.get(Y)||0)-1;if(z.set(Y,A),!A){if(!X?.has(Y)&&Q)Y.removeAttribute(Q);X?.delete(Y)}});if(B)F.forEach((Y)=>{let W=(vH.get(Y)||0)-1;if(vH.set(Y,W),!W)Y.removeAttribute(s_)});if(PW-=1,!PW)MW.inert=new WeakMap,MW["aria-hidden"]=new WeakMap,_W.inert=new WeakSet,_W["aria-hidden"]=new WeakSet,vH=new WeakMap}}function jW($,Z={}){let{ariaHidden:H=!1,inert:J=!1,mark:B=!0}=Z,Q=f0($[0]).body;return Mn($,Q,H,J,{mark:B})}var _3=_(p(),1);function Qz(){let $=new Map;return{emit(Z,H){$.get(Z)?.forEach((J)=>J(H))},on(Z,H){if(!$.has(Z))$.set(Z,new Set);$.get(Z).add(H)},off(Z,H){$.get(Z)?.delete(H)}}}class s6{nodesRef={current:[]};events=Qz();addNode($){this.nodesRef.current.push($)}removeNode($){let Z=this.nodesRef.current.findIndex((H)=>H===$);if(Z!==-1)this.nodesRef.current.splice(Z,1)}}var OW=_(r(),1),Hj=_3.createContext(null),Jj=_3.createContext(null),B2=()=>_3.useContext(Hj)?.id||null,x4=($)=>{let Z=_3.useContext(Jj);return $??Z};function i9($){let Z=H2(),H=x4($),J=B2();return J0(()=>{if(!Z)return;let B={id:Z,parentId:J};return H?.addNode(B),()=>{H?.removeNode(B)}},[H,Z,J]),Z}function t6($){let{children:Z,id:H}=$,J=B2();return OW.jsx(Hj.Provider,{value:_3.useMemo(()=>({id:H,parentId:J}),[H,J]),children:Z})}function e6($){let{children:Z,externalTree:H}=$,J=p1(()=>H??new s6).current;return OW.jsx(Jj.Provider,{value:J,children:Z})}var gH=_(r(),1);function Pn($,Z){let H=u1(P1($));if($ instanceof H.KeyboardEvent)return"keyboard";if($ instanceof H.FocusEvent)return Z||"keyboard";if("pointerType"in $)return $.pointerType||"keyboard";if("touches"in $)return"touch";if($ instanceof H.MouseEvent)return Z||($.detail===0?"keyboard":"mouse");return""}var Bj=20,j3=[];function TW(){j3=j3.filter(($)=>{return $.deref()?.isConnected})}function Qj($){if(TW(),$&&F4($)!=="body"){if(j3.push(new WeakRef($)),j3.length>Bj)j3=j3.slice(-Bj)}}function zj(){return TW(),j3[j3.length-1]?.deref()}function _n($){if(!$)return null;if(gQ($))return $;return L$($)[0]||$}function Xj($){if($.hasAttribute("tabindex")&&!$.hasAttribute("data-tabindex"))return;if(!$.getAttribute("role")?.includes("dialog"))return;let H=GW($).filter((B)=>{let Q=B.getAttribute("data-tabindex")||"";return gQ(B)||B.hasAttribute("data-tabindex")&&!Q.startsWith("-")}),J=$.getAttribute("tabindex");if(H.length===0){if(J!=="0")$.setAttribute("tabindex","0"),$.setAttribute("data-tabindex","0")}else if(J!=="-1"||$.hasAttribute("data-tabindex")&&$.getAttribute("data-tabindex")!=="-1")$.setAttribute("tabindex","-1"),$.setAttribute("data-tabindex","-1")}function $7($){let{context:Z,children:H,disabled:J=!1,initialFocus:B=!0,returnFocus:Q=!0,restoreFocus:z=!1,modal:X=!0,closeOnFocusOut:G=!0,openInteractionType:U="",nextFocusableElement:K,previousFocusableElement:F,beforeContentFocusGuardRef:Y,externalTree:W,getInsideElements:A}=$,N="rootStore"in Z?Z.rootStore:Z,L=N.useState("open"),V=N.useState("domReferenceElement"),D=N.useState("floatingElement"),{events:q,dataRef:j}=N.context,M=W0(()=>j.current.floatingContext?.nodeId),P=B===!1,T=kH(V)&&P,C=Q5(B),k=Q5(Q),E=Q5(U),h=Q5(L),x=x4(W),R=VW(),w=v4.useRef(!1),S=v4.useRef(!1),I=v4.useRef(!1),y=v4.useRef(null),f=v4.useRef(""),g=v4.useRef(""),O=v4.useRef(null),c=v4.useRef(null),o=v2(O,Y,R?.beforeInsideRef),b=v2(c,R?.afterInsideRef),d=a1(),t=a1(),u=Z2(),a=R!=null,n=RH(D),Q0=W0((B0=n)=>{return B0?L$(B0):[]}),Z0=W0(()=>A?.().filter((B0)=>B0!=null)??[]);v4.useEffect(()=>{if(J||!X)return;function B0(A0){if(A0.key==="Tab"){if(k0(n,c1(f0(n)))&&Q0().length===0&&!T)y2(A0)}}let Y0=f0(n);return i0(Y0,"keydown",B0)},[J,n,X,T,Q0]),v4.useEffect(()=>{if(J||!L)return;let B0=f0(n);function Y0(){I.current=!1}function A0(X0){let i=P1(X0),l=Z0(),e=k0(D,i)||k0(V,i)||k0(R?.portalNode,i)||l.some(($0)=>$0===i||k0($0,i));if(I.current=!e,g.current=X0.pointerType||"keyboard",i?.closest(`[${q$}]`))S.current=!0,t.start(0,()=>{S.current=!1})}function D0(){g.current="keyboard"}return K4(i0(B0,"pointerdown",A0,!0),i0(B0,"pointerup",Y0,!0),i0(B0,"pointercancel",Y0,!0),i0(B0,"keydown",D0,!0),Y0)},[J,D,V,n,L,R,t,Z0]),v4.useEffect(()=>{if(J||!G)return;let B0=f0(n);function Y0(){S.current=!0,t.start(0,()=>{S.current=!1})}function A0(l){let e=P1(l);if(gQ(e))y.current=e}function D0(l){let{relatedTarget:e,currentTarget:$0}=l,H0=P1(l);if(X&&e==null&&H0!=null&&k0(D,H0))Qj(H0);queueMicrotask(()=>{let O0=M(),P0=N.context.triggerElements,N0=Z0(),M0=e?.hasAttribute(l9("focus-guard"))&&[O.current,c.current,R?.beforeInsideRef.current,R?.afterInsideRef.current,R?.beforeOutsideRef.current,R?.afterOutsideRef.current,P8(F),P8(K)].includes(e),v=!(k0(V,e)||k0(D,e)||k0(e,D)||k0(R?.portalNode,e)||N0.some((m)=>m===e||k0(m,e))||P0.hasMatchingElement((m)=>k0(m,e))||M0||x&&(s2(x.nodesRef.current,O0).find((m)=>k0(m.context?.elements.floating,e)||k0(m.context?.elements.domReference,e))||HW(x.nodesRef.current,O0).find((m)=>[m.context?.elements.floating,RH(m.context?.elements.floating)].includes(e)||m.context?.elements.domReference===e)));if($0===V&&n)Xj(n);if(z&&$0!==V&&!a6(H0)&&c1(B0)===B0.body){if(C1(n)){if(n.focus(),z==="popup"){u.request(()=>{n.focus()});return}}let m=Q0(),s=y.current,G0=(s&&m.includes(s)?s:null)||m[m.length-1]||n;if(C1(G0))G0.focus()}if(j.current.insideReactTree){j.current.insideReactTree=!1;return}if((T?!0:!X)&&e&&v&&!S.current&&(T||e!==zj()))w.current=!0,N.setOpen(!1,R0(K0.focusOut,l))})}function X0(){if(I.current)return;j.current.insideReactTree=!0,d.start(0,()=>{j.current.insideReactTree=!1})}let i=C1(V)?V:null;if(!D&&!i)return;return K4(i&&i0(i,"focusout",D0),i&&i0(i,"pointerdown",Y0),D&&i0(D,"focusin",A0),D&&i0(D,"focusout",D0),D&&R&&i0(D,"focusout",X0,!0))},[J,V,D,n,X,x,R,N,G,z,Q0,T,M,j,d,t,u,K,F,Z0]),v4.useEffect(()=>{if(J||!D||!L)return;let B0=Array.from(R?.portalNode?.querySelectorAll(`[${l9("portal")}]`)||[]),A0=(x?HW(x.nodesRef.current,M()):[]).find(($0)=>kH($0.context?.elements.domReference||null))?.context?.elements.domReference,X0=[...[D,...B0,O.current,c.current,R?.beforeOutsideRef.current,R?.afterOutsideRef.current,...Z0()],A0,P8(F),P8(K),T?V:null].filter(($0)=>$0!=null),i=jW(X0,{ariaHidden:X||T,mark:!1}),l=[D,...B0].filter(($0)=>$0!=null),e=jW(l);return()=>{e(),i()}},[L,J,V,D,X,R,T,x,M,K,F,Z0]),J0(()=>{if(!L||J||!C1(n))return;f.current="",g.current="";let B0=f0(n),Y0=c1(B0);queueMicrotask(()=>{let A0=C.current,D0=typeof A0==="function"?A0(E.current||""):A0;if(D0===void 0||D0===!1)return;if(k0(n,Y0))return;let i=null,l=()=>{if(i==null)i=Q0(n);return i[0]||n},e;if(D0===!0||D0===null)e=l();else e=P8(D0);e=e||l();let $0=k0(n,c1(B0));P$(e,{preventScroll:e===n,shouldFocus(){if(!h.current)return!1;if($0)return!0;let H0=c1(B0);return!(H0!==e&&k0(n,H0))}})})},[J,L,n,Q0,C,E,h]),J0(()=>{if(J||!n)return;let B0=f0(n),Y0=c1(B0),A0=E.current==null;Qj(Y0);function D0(i){if(!i.open)f.current=Pn(i.nativeEvent,g.current);if(i.reason===K0.triggerHover&&i.nativeEvent.type==="mouseleave")w.current=!0;if(i.reason!==K0.outsidePress)return;if(i.nested)w.current=!1;else if(N$(i.nativeEvent)||V$(i.nativeEvent))w.current=!1;else{let l=!1;if(f0(n).createElement("div").focus({get preventScroll(){return l=!0,!1}}),l)w.current=!1;else w.current=!0}}q.on("openchange",D0);function X0(i){let l=k.current,e=typeof l==="function"?l(i):l;if(e===void 0||e===!1)return null;if(e===null)e=!0;let $0=V?.isConnected?V:null,H0=Y0?.isConnected&&F4(Y0)!=="body"?Y0:null,O0=A0?H0||$0:$0||H0;if(!O0)O0=zj()||null;if(typeof e==="boolean")return O0;return P8(e)||O0||null}return()=>{q.off("openchange",D0);let i=c1(B0),l=Z0(),e=k0(D,i)||l.some((P0)=>P0===i||k0(P0,i))||x&&s2(x.nodesRef.current,M(),!1).some((P0)=>k0(P0.context?.elements.floating,i)),$0=k.current,H0=f.current,O0=X0(H0);queueMicrotask(()=>{let P0=_n(O0),N0=typeof $0!=="boolean";if($0&&!w.current&&C1(P0)&&(!N0&&P0!==i&&i!==B0.body?e:!0)){let M0={preventScroll:!0};if(H0==="keyboard")M0.focusVisible=!0;P0.focus(M0)}w.current=!1})}},[J,D,n,k,E,q,x,V,M,Z0]),J0(()=>{if(!n1.engine.webkit||L||!D)return;let B0=c1(f0(D));if(!C1(B0)||!l6(B0))return;if(k0(D,B0))B0.blur()},[L,D]),J0(()=>{if(J||!R)return;return R.setFocusManagerState({modal:X,closeOnFocusOut:G,open:L,onOpenChange:N.setOpen,domReference:V}),()=>{R.setFocusManagerState(null)}},[J,R,X,L,N,G,V]),J0(()=>{if(J||!n)return;return Xj(n),()=>{queueMicrotask(TW)}},[J,n]);let U0=!J&&(X?!T:!0)&&(a||X);return gH.jsxs(v4.Fragment,{children:[U0&&gH.jsx(M2,{"data-type":"inside",ref:o,onFocus:(B0)=>{if(X){let Y0=Q0();P$(Y0[Y0.length-1])}else if(R?.portalNode)if(w.current=!1,p9(B0,R.portalNode))D$(V)?.focus();else P8(F??R.beforeOutsideRef)?.focus()}}),H,U0&&gH.jsx(M2,{"data-type":"inside",ref:b,onFocus:(B0)=>{if(X)P$(Q0()[0]);else if(R?.portalNode){if(G)w.current=!0;if(p9(B0,R.portalNode))fQ(V)?.focus();else P8(K??R.afterOutsideRef)?.focus()}}})]})}var fH=_(p(),1);function r9($,Z={}){let{enabled:H=!0,event:J="click",toggle:B=!0,ignoreMouse:Q=!1,stickIfOpen:z=!0,touchOpenDelay:X=0,reason:G=K0.triggerPress}=Z,U="rootStore"in $?$.rootStore:$,K=U.context.dataRef,F=fH.useRef(void 0),Y=Z2(),W=a1(),A=fH.useMemo(()=>{function N(V,D,q,j){let M=R0(G,D,q);if(V&&j==="touch"&&X>0)W.start(X,()=>{U.setOpen(!0,M)});else U.setOpen(V,M)}function L(V,D,q){let j=K.current.openEvent,M=U.select("domReferenceElement")!==D;if(V&&M)return!0;if(!V)return!0;if(!B)return!0;if(j&&z)return!q(j.type);return!1}return{onPointerDown(V){F.current=h2(V.pointerType,!0)&&V$(V.nativeEvent)?"virtual":V.pointerType},onMouseDown(V){let D=F.current,q=V.nativeEvent,j=U.select("open");if(V.button!==0||J==="click"||h2(D,!0)&&Q)return;let M=L(j,V.currentTarget,(C)=>C==="click"||C==="mousedown"),P=P1(q);if(l6(P)){N(M,q,P,D);return}let T=V.currentTarget;Y.request(()=>{N(M,q,T,D)})},onClick(V){if(J==="mousedown-only")return;let D=F.current;if(J==="mousedown"&&D){F.current=void 0;return}if(h2(D,!0)&&Q)return;let q=U.select("open"),j=L(q,V.currentTarget,(M)=>M==="click"||M==="mousedown"||M==="keydown"||M==="keyup");N(j,V.nativeEvent,V.currentTarget,D)},onKeyDown(){F.current=void 0}}},[K,J,Q,G,U,z,B,Y,W,X]);return fH.useMemo(()=>H?{reference:A}:_1,[H,A])}var _2=_(p(),1);function jn($,Z){let H=null,J=null,B=!1;return{contextElement:$||void 0,getBoundingClientRect(){let Q=$?.getBoundingClientRect()||{width:0,height:0,x:0,y:0},z=Z.axis==="x"||Z.axis==="both",X=Z.axis==="y"||Z.axis==="both",G=["mouseenter","mousemove"].includes(Z.dataRef.current.openEvent?.type||"")&&Z.pointerType!=="touch",U=Q.width,K=Q.height,F=Q.x,Y=Q.y;if(H==null&&Z.x&&z)H=Q.x-Z.x;if(J==null&&Z.y&&X)J=Q.y-Z.y;if(F-=H||0,Y-=J||0,U=0,K=0,!B||G)U=Z.axis==="y"?Q.width:0,K=Z.axis==="x"?Q.height:0,F=z&&Z.x!=null?Z.x:F,Y=X&&Z.y!=null?Z.y:Y;else if(B&&!G)K=Z.axis==="x"?Q.height:K,U=Z.axis==="y"?Q.width:U;return B=!0,{width:U,height:K,x:F,y:Y,top:Y,right:F+U,bottom:Y+K,left:F}}}}function Gj($){return $!=null&&$.clientX!=null}function CW($,Z={}){let{enabled:H=!0,axis:J="both"}=Z,B="rootStore"in $?$.rootStore:$,Q=B.useState("open"),z=B.useState("floatingElement"),X=B.useState("domReferenceElement"),G=B.context.dataRef,U=_2.useRef(!1),K=_2.useRef(null),[F,Y]=_2.useState(),[W,A]=_2.useState([]),N=W0((j)=>{B.set("positionReference",j)}),L=W0((j,M,P)=>{if(U.current)return;if(G.current.openEvent&&!Gj(G.current.openEvent))return;B.set("positionReference",jn(P??X,{x:j,y:M,axis:J,dataRef:G,pointerType:F}))}),V=W0((j)=>{if(!Q)L(j.clientX,j.clientY,j.currentTarget);else if(!K.current)L(j.clientX,j.clientY,j.currentTarget),A([])}),D=h2(F)?z:Q;_2.useEffect(()=>{if(!H){N(X);return}if(!D)return;function j(){K.current?.(),K.current=null}let M=u1(z);function P(T){let C=P1(T);if(!k0(z,C))L(T.clientX,T.clientY);else j()}if(!G.current.openEvent||Gj(G.current.openEvent))K.current=i0(M,"mousemove",P);else N(X);return j},[D,H,z,G,X,B,L,N,W]),_2.useEffect(()=>()=>{B.set("positionReference",null)},[B]),_2.useEffect(()=>{if(H&&!z)U.current=!1},[H,z]),_2.useEffect(()=>{if(!H&&Q)U.current=!0},[H,Q]);let q=_2.useMemo(()=>{function j(M){Y(M.pointerType)}return{onPointerDown:j,onPointerEnter:j,onMouseMove:V,onMouseEnter:V}},[V]);return _2.useMemo(()=>H?{reference:q,trigger:q}:{},[H,q])}var Q2=_(p(),1);function On(){return!1}function Tn($){return{escapeKey:typeof $==="boolean"?$:$?.escapeKey??!1,outsidePress:typeof $==="boolean"?$:$?.outsidePress??!0}}function j8($,Z={}){let{enabled:H=!0,escapeKey:J=!0,outsidePress:B=!0,outsidePressEvent:Q="sloppy",referencePress:z=On,bubbles:X,externalTree:G}=Z,U="rootStore"in $?$.rootStore:$,K=U.useState("open"),F=U.useState("floatingElement"),{dataRef:Y,events:W}=U.context,A=x4(G),N=W0(typeof B==="function"?B:()=>!1),L=typeof B==="function"?N:B,V=L!==!1,D=W0(()=>Q),{escapeKey:q,outsidePress:j}=Tn(X),M=Q2.useRef(!1),P=Q2.useRef(!1),T=Q2.useRef(!1),C=Q2.useRef(!1),k=Q2.useRef(!1),E=Q2.useRef(""),h=Q2.useRef(null),x=a1(),R=a1(),w=W0(()=>{R.clear(),Y.current.insideReactTree=!1}),S=W0((d)=>{let t=Y.current.floatingContext?.nodeId;return(A?s2(A.nodesRef.current,t):[]).some((a)=>a.context?.open&&!a.context.dataRef.current[d])}),I=W0((d)=>{return RQ(d,U.select("floatingElement"))||RQ(d,U.select("domReferenceElement"))}),y=W0((d)=>{if(!z())return;U.setOpen(!1,R0(K0.triggerPress,d.nativeEvent))}),f=W0((d)=>{if(!K||!H||!J||d.key!=="Escape")return;if(k.current)return;if(!q&&S("__escapeKeyBubbles"))return;let t=gP(d)?d.nativeEvent:d,u=R0(K0.escapeKey,t);if(U.setOpen(!1,u),!u.isCanceled)d.preventDefault();if(!q&&!u.isPropagationAllowed)d.stopPropagation()}),g=W0(()=>{Y.current.insideReactTree=!0,R.start(0,w)}),O=W0((d)=>{if(!K||!H||d.button!==0)return;let t=P1(d.nativeEvent);if(!k0(U.select("floatingElement"),t))return;if(!M.current)M.current=!0,P.current=!1}),c=W0((d)=>{if(!K||!H)return;if(!(d.defaultPrevented||d.nativeEvent.defaultPrevented))return;if(M.current)P.current=!0});Q2.useEffect(()=>{function d(t){if(!t.open)C.current=!1}return W.on("openchange",d),()=>{W.off("openchange",d)}},[W]),Q2.useEffect(()=>{if(!K||!H){if(!K)C.current=!1;return w}Y.current.__escapeKeyBubbles=q,Y.current.__outsidePressBubbles=j;let d=new v5,t=new v5,u=f0(F);function a(){d.clear(),k.current=!0}function n(){d.start(n1.engine.webkit?5:0,()=>{k.current=!1})}function Q0(){T.current=!0,t.start(0,()=>{T.current=!1})}function Z0(){M.current=!1,P.current=!1}function U0(){let v=E.current,m=v==="pen"||!v?"mouse":v,s=D(),G0=typeof s==="function"?s():s;if(typeof G0==="string")return G0;return G0[m]}function B0(v){let m=U0();return m==="intentional"&&v.type!=="click"||m==="sloppy"&&v.type==="click"}function Y0(v){let m=Y.current.floatingContext?.nodeId,s=A&&s2(A.nodesRef.current,m).some((G0)=>RQ(v,G0.context?.elements.floating));return I(v)||s}function A0(v){if(B0(v)){if(v.type!=="click"&&!I(v))t.clear(),T.current=!1;w();return}if(Y.current.insideReactTree){w();return}let m=P1(v),s=`[${l9("inert")}]`,G0=r0(m)?m.getRootNode():null,j0=Array.from((L3(G0)?G0:f0(U.select("floatingElement"))).querySelectorAll(s)),m0=U.context.triggerElements;if(m&&(m0.hasElement(m)||m0.hasMatchingElement((T0)=>k0(T0,m))))return;let v0=r0(m)?m:null;while(v0&&!$9(v0)){let T0=a9(v0);if($9(T0)||!r0(T0))break;v0=T0}if(j0.length&&r0(m)&&!vP(m)&&!k0(m,U.select("floatingElement"))&&j0.every((T0)=>!k0(v0,T0)))return;if(C1(m)&&!("touches"in v)){let T0=$9(m),p0=O4(m),$1=/auto|scroll/,D1=T0||$1.test(p0.overflowX),u0=T0||$1.test(p0.overflowY),N1=D1&&m.clientWidth>0&&m.scrollWidth>m.clientWidth,H5=u0&&m.clientHeight>0&&m.scrollHeight>m.clientHeight,M1=p0.direction==="rtl",q0=H5&&(M1?v.offsetX<=m.offsetWidth-m.clientWidth:v.offsetX>m.clientWidth),V0=N1&&v.offsetY>m.clientHeight;if(q0||V0)return}if(Y0(v))return;if(U0()==="intentional"){if(v.detail!==0&&!N$(v)&&!C.current)return;if(T.current){t.clear(),T.current=!1;return}}if(typeof L==="function"&&!L(v))return;if(S("__outsidePressBubbles"))return;U.setOpen(!1,R0(K0.outsidePress,v)),w()}function D0(v){if(U0()!=="sloppy"||v.pointerType==="touch"||!U.select("open")||!H||I(v))return;A0(v)}function X0(v){if(U0()!=="sloppy"||!U.select("open")||!H||I(v))return;let m=v.touches[0];if(m)h.current={startTime:Date.now(),startX:m.clientX,startY:m.clientY,dismissOnTouchEnd:!1,dismissOnMouseDown:!0},x.start(1000,()=>{if(h.current)h.current.dismissOnTouchEnd=!1,h.current.dismissOnMouseDown=!1})}function i(v,m){let s=P1(v);if(!s)return;let G0=i0(s,v.type,()=>{m(v),G0()})}function l(v){E.current="touch",i(v,X0)}function e(v){if(x.clear(),v.type==="pointerdown"){if(v.button===0)C.current=!0;E.current=v.pointerType}if(v.type==="mousedown"&&h.current&&!h.current.dismissOnMouseDown)return;i(v,(m)=>{if(m.type==="pointerdown")D0(m);else A0(m)})}function $0(v){if(v.type==="pointercancel")C.current=!1;if(!M.current)return;let m=P.current;if(Z0(),U0()!=="intentional")return;if(v.type==="pointercancel"){if(m)Q0();return}if(Y0(v))return;if(m){Q0();return}if(typeof L==="function"&&!L(v))return;t.clear(),T.current=!0,w()}function H0(v){if(U0()!=="sloppy"||!h.current||I(v))return;let m=v.touches[0];if(!m)return;let s=Math.abs(m.clientX-h.current.startX),G0=Math.abs(m.clientY-h.current.startY),j0=Math.sqrt(s*s+G0*G0);if(j0>5)h.current.dismissOnTouchEnd=!0;if(j0>10)A0(v),x.clear(),h.current=null}function O0(v){i(v,H0)}function P0(v){if(U0()!=="sloppy"||!h.current||I(v))return;if(h.current.dismissOnTouchEnd)A0(v);x.clear(),h.current=null}function N0(v){i(v,P0)}let M0=K4(J&&K4(i0(u,"keydown",f),i0(u,"compositionstart",a),i0(u,"compositionend",n)),V&&K4(i0(u,"click",e,!0),i0(u,"pointerdown",e,!0),i0(u,"pointerup",$0,!0),i0(u,"pointercancel",$0,!0),i0(u,"mousedown",e,!0),i0(u,"mouseup",$0,!0),i0(u,"touchstart",l,{capture:!0,passive:!0}),i0(u,"touchmove",O0,{capture:!0,passive:!0}),i0(u,"touchend",N0,{capture:!0,passive:!0})));return()=>{M0(),d.clear(),t.clear(),Z0(),T.current=!1,w()}},[Y,F,J,V,L,K,H,q,j,f,w,D,S,I,A,U,x]);let o=Q2.useMemo(()=>({onKeyDown:f,onPointerDown:y,onClick:y}),[f,y]),b=Q2.useMemo(()=>({onKeyDown:f,onPointerDown:c,onMouseDown:c,onClickCapture:g,onMouseDownCapture(d){g(),O(d)},onPointerDownCapture(d){g(),O(d)},onMouseUpCapture:g,onTouchEndCapture:g,onTouchMoveCapture:g}),[f,g,O,c]);return Q2.useMemo(()=>H?{reference:o,floating:b,trigger:o}:{},[H,o,b])}function zz($,Z,H,J){return{left:$,top:Z,right:H,bottom:J,x:$,y:Z,width:H-$,height:J-Z}}function Cn($){return{left:$.left,top:$.top,right:$.right,bottom:$.bottom,width:$.width,height:$.height}}function Kj($){let Z=[],H,J=Number.POSITIVE_INFINITY,B=Number.POSITIVE_INFINITY,Q=Number.NEGATIVE_INFINITY,z=Number.NEGATIVE_INFINITY;for(let X of Array.from($).sort((G,U)=>G.top-U.top)){if(J=Math.min(J,X.left),B=Math.min(B,X.top),Q=Math.max(Q,X.right),z=Math.max(z,X.bottom),!H||X.top-H.top>H.height/2)Z.push(Cn(X));else{let G=Z[Z.length-1];G.left=Math.min(G.left,X.left),G.right=Math.max(G.right,X.right),G.bottom=Math.max(G.bottom,X.bottom),G.width=G.right-G.left,G.height=G.bottom-G.top}H=X}return{lines:Z,fallback:zz(J,B,Q,z)}}function Fj($,Z,H){return $.findIndex((J)=>Z>J.left-2&&Z<J.right+2&&H>J.top-2&&H<J.bottom+2)}function Uj($){return zz($.left,$.top,$.right,$.bottom)}function wn($,Z,H){let{lines:J}=Kj($.getClientRects());if(J.length<2)return;let B=Fj(J,Z,H);return{x:Z,y:H,lineIndex:B===-1?void 0:B,element:$}}function En($,Z,H){let{lines:J,fallback:B}=Kj($.getClientRects());if(J.length<2)return null;let Q=H?.x,z=H?.y,X=Z[0];if(H?.lineIndex!=null&&J[H.lineIndex])return Uj(J[H.lineIndex]);if(Q!=null&&z!=null){let A=Fj(J,Q,z);if(A!==-1)return Uj(J[A])}if(J.length===2&&J[0].left>J[1].right&&Q!=null&&z!=null)return B;if(X==="t"||X==="b"){let A=J[0],N=J[J.length-1],L=X==="t"?A:N;return zz(L.left,A.top,L.right,N.bottom)}let G=X==="l",U=J[0].left,K=J[0].right,F=G?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY,Y=J[0],W=J[0];for(let A of J){U=Math.min(U,A.left),K=Math.max(K,A.right);let N=G?A.left:A.right;if(G&&N<F||!G&&N>F)F=N,Y=A,W=A;else if(N===F)W=A}return zz(U,Y.top,K,W.bottom)}function Sn($){if("contextElement"in $&&$.contextElement)return $.contextElement;return r0($)?$:void 0}function Yj($,Z){function H(B){wW($,B.currentTarget,B.clientX,B.clientY)}function J(B){if(!Z)H(B)}return{onFocus(){$.current=void 0},onMouseEnter:J,onMouseMove:J}}function wW($,Z,H,J){let B=wn(Z,H,J);return $.current=B,B}function Wj($){return{name:"inline",async fn(Z){let H=Z.elements.reference;if(typeof H?.getClientRects!=="function")return{};let J=Sn(H),B=$.current,Q=B?.element===H||B?.element===J?B:void 0,z=En(H,Z.placement,Q);if(!z||typeof Z.platform.getElementRects!=="function")return{};let X=await Z.platform.getElementRects({reference:{contextElement:J,getBoundingClientRect(){return z}},floating:Z.elements.floating,strategy:Z.strategy});if(Z.rects.reference.x===X.reference.x&&Z.rects.reference.y===X.reference.y&&Z.rects.reference.width===X.reference.width&&Z.rects.reference.height===X.reference.height)return{};return{reset:{rects:X}}}}}class O8{attachedStores=[];attachedStoreValue=null;storeListeners=new Set;constructor($,Z,H=!0){this.fallbackStore=$,this.componentName=Z,this.throwOnMissingTrigger=H}get attachedStore(){return this.attachedStoreValue}get store(){return this.attachedStoreValue??this.fallbackStore}get serverStore(){return this.fallbackStore}subscribeStore($){return this.storeListeners.add($),()=>{this.storeListeners.delete($)}}attachStore($){return this.attachedStores.push($),this.setActiveStore($),()=>{let Z=this.attachedStores.lastIndexOf($);if(Z!==-1)this.attachedStores.splice(Z,1);this.setActiveStore(this.attachedStores[this.attachedStores.length-1]??null)}}setActiveStore($){if(this.attachedStoreValue!==$)this.attachedStoreValue=$,this.storeListeners.forEach((Z)=>{Z()})}openByTrigger($){let Z=this.attachedStore;if(Z===null)return;let H;if($){for(let J=this.attachedStores.length-1;J>=0&&!H;J-=1)H=this.attachedStores[J].context.triggerElements.getById($);H??=this.fallbackStore.context.triggerElements.getById($)}if($&&!H){if(this.throwOnMissingTrigger)throw Error(g0(99,this.componentName,$,this.componentName))}Z.setOpen(!0,R0(K0.imperativeAction,void 0,H))}closePopup(){let $=this.attachedStore;if($===null)return;$.setOpen(!1,R0(K0.imperativeAction))}}var SW=_(p(),1),Vj=_(x2(),1);var Aj=_(p(),1);var In={open:($)=>$.open,transitionStatus:($)=>$.transitionStatus,domReferenceElement:($)=>$.domReferenceElement,referenceElement:($)=>$.positionReference??$.referenceElement,floatingElement:($)=>$.floatingElement,floatingId:($)=>$.floatingId};class Z7 extends _4{constructor($){let{syncOnly:Z,nested:H,onOpenChange:J,triggerElements:B,...Q}=$;super({...Q,positionReference:Q.referenceElement,domReferenceElement:Q.referenceElement},{onOpenChange:J,dataRef:{current:{}},events:Qz(),nested:H,triggerElements:B},In);this.syncOnly=Z}syncOpenEvent=($,Z)=>{if(!$||!this.state.open||Z!=null&&fP(Z))this.context.dataRef.current.openEvent=$?Z:void 0};dispatchOpenChange=($,Z)=>{this.syncOpenEvent($,Z.event);let H={open:$,reason:Z.reason,nativeEvent:Z.event,nested:this.context.nested,triggerElement:Z.trigger};this.context.events.emit("openchange",H)};setOpen=($,Z)=>{if(this.syncOnly){this.context.onOpenChange?.($,Z);return}this.dispatchOpenChange($,Z),this.context.onOpenChange?.($,Z)}}function mH($){let{popupStore:Z,treatPopupAsFloatingElement:H=!1,floatingRootContext:J,floatingId:B,nested:Q,onOpenChange:z}=$,X=Z.useState("open"),G=Z.useState("activeTriggerElement"),U=Z.useState(H?"popupElement":"positionerElement"),K=Z.context.triggerElements,F=z,Y=Aj.useRef(null);if(J===void 0&&Y.current===null)Y.current=new Z7({open:X,transitionStatus:void 0,referenceElement:G,floatingElement:U,triggerElements:K,onOpenChange:F,floatingId:B,syncOnly:!0,nested:Q});let W=J??Y.current;return Z.useSyncedValue("floatingId",B),J0(()=>{let A={open:X,floatingId:B,referenceElement:G,floatingElement:U};if(r0(G))A.domReferenceElement=G;if(W.state.positionReference===W.state.referenceElement)A.positionReference=G;W.update(A)},[X,B,G,U,W]),W.context.onOpenChange=F,W.context.nested=Q,W}var EW=_(p(),1);function $8($,Z=!1,H=!1,J=!1){let[B,Q]=EW.useState($&&Z?"idle":void 0),[z,X]=EW.useState($&&!J);if($&&!z)X(!0),Q("starting");if(!$&&z&&B!=="ending"&&!H)Q("ending");if(!$&&!z&&B==="ending")Q(void 0);return J0(()=>{if(!$&&z&&B!=="ending"&&H){let G=j4.request(()=>{Q("ending")});return()=>{j4.cancel(G)}}return},[$,z,B,H]),J0(()=>{if(!$||Z)return;let G=j4.request(()=>{Q(void 0)});return()=>{j4.cancel(G)}},[Z,$]),J0(()=>{if(!$||!Z)return;if($&&z&&B!=="idle")Q("starting");let G=j4.request(()=>{Q("idle")});return()=>{j4.cancel(G)}},[Z,$,z,B]),{mounted:z,setMounted:X,transitionStatus:B}}var Z9={tabIndex:-1,[TH]:""};function Xz($){return(Z)=>Z==="touch"?$.current:!0}function O3($,Z=!1){let H=H2(),J=B2()!=null,B=p1(()=>$(H,J)).current;return mH({popupStore:B,treatPopupAsFloatingElement:Z,floatingRootContext:B.state.floatingRootContext,floatingId:H,nested:J,onOpenChange:B.setOpen}),B}function H9({handle:$,store:Z}){return J0(()=>{return $.attachStore(Z)},[$,Z]),null}function Nj($){let Z=$.context.triggerElements.size;if($.select("open")&&$.state.triggerCount!==Z)$.set("triggerCount",Z)}function IW($,Z){let H=SW.useRef(null);return W0((J)=>{let B=H.current;if(B!==null){if(B.element===J&&B.store===Z&&B.id===$)return;H.current=null;let Q=B.store;if(Q.context.triggerElements.getById(B.id)===B.element)Q.context.triggerElements.delete(B.id),Nj(Q)}if(J!==null&&$!==void 0)H.current={store:Z,id:$,element:J},Z.context.triggerElements.add($,J),Nj(Z)})}function H7($,Z,H,J=!1){let B=$.preventUnmountingOnClose;if(Z)B=!1;else if(J)B=!0;let Q=H?.id??null,z=$.activeTriggerId,X=$.activeTriggerElement;if(Q||Z)z=Q,X=H??null;return{open:Z,preventUnmountingOnClose:B,activeTriggerId:z,activeTriggerElement:X}}function uH($){let Z=!1;return $.preventUnmountOnClose=()=>{Z=!0},()=>Z}function Gz($,Z,H,J={}){let B=H.reason,Q=B===K0.triggerHover,z=Z&&B===K0.triggerFocus,X=!Z&&(B===K0.triggerPress||B===K0.escapeKey),G=uH(H);if($.context.onOpenChange?.(Z,H),H.isCanceled)return;J.onBeforeDispatch?.(),$.state.floatingRootContext.dispatchOpenChange(Z,H);let U=()=>{let K=H7($.state,Z,H.trigger,G()),F={...J.extraState,...K};if(z)F.instantType="focus";else if(X)F.instantType="dismiss";else if(Q)F.instantType=void 0;$.update(F)};if(Q)Vj.flushSync(U);else U()}function J9($,Z,H,J){let B=H.useState("isMountedByTrigger",$),Q=IW($,H),z=W0((G)=>{let U=H.select("open"),K=H.select("activeTriggerId");if(K===$){let F={activeTriggerElement:G,...U?J:null};H.update(F);return}if(K==null&&U){let F={activeTriggerId:$??null,activeTriggerElement:G,...J};H.update(F)}}),X=W0((G)=>{if(Q(G),G)z(G)});return J0(()=>{return X(Z.current),()=>X(null)},[X,Z,H,$]),J0(()=>{if(B){let G={activeTriggerElement:Z.current,...J};H.update(G)}},[B,H,Z,...Object.values(J)]),{registerTrigger:X,isMountedByThisTrigger:B}}function B9($,Z={}){let{closeOnActiveTriggerUnmount:H=!1}=Z,J=SW.useRef(null),B=$.useState("open"),Q=$.useState("triggerCount"),z=$.useState("activeTriggerId"),X=$.useState("activeTriggerElement");J0(()=>{if(!B){if(J.current=null,$.state.triggerCount!==0)$.set("triggerCount",0);return}let G=$.context.triggerElements.size,U={};if($.state.triggerCount!==G)U.triggerCount=G;let K=$.select("activeTriggerId"),F=null;if(K){let Y=$.context.triggerElements.getById(K);if(!Y){for(let[W,A]of $.context.triggerElements.entries())if(A===$.state.activeTriggerElement){U.activeTriggerId=W,U.activeTriggerElement=A,J.current=W;break}if(U.activeTriggerId===void 0)if(J.current===K)F=K;else J.current=null}else if(J.current=K,Y!==$.state.activeTriggerElement)U.activeTriggerElement=Y}else J.current=null;if(!F&&!K&&G===1){let Y=$.context.triggerElements.entries().next();if(!Y.done){let[W,A]=Y.value;U.activeTriggerId=W,U.activeTriggerElement=A,J.current=W}}if(U.triggerCount!==void 0||U.activeTriggerId!==void 0||U.activeTriggerElement!==void 0)$.update(U);if(F){if(H)queueMicrotask(()=>{if($.select("open")&&$.select("activeTriggerId")===F&&!$.context.triggerElements.getById(F)){let Y=R0(K0.none);if($.setOpen(!1,Y),!Y.isCanceled)$.update({activeTriggerId:null,activeTriggerElement:null})}})}},[B,$,Q,z,X,H])}function Q9($,Z,H,J){let{mounted:B,setMounted:Q,transitionStatus:z}=$8($,!1,!1,J),X=Z.useState("preventUnmountingOnClose"),G=$?!1:X;Z.useSyncedValues({mounted:B,transitionStatus:z,preventUnmountingOnClose:G});let U=W0(()=>{Q(!1),Z.update({activeTriggerId:null,activeTriggerElement:null,mounted:!1,preventUnmountingOnClose:!1}),H?.(),Z.context.onOpenChangeComplete?.(!1)});return f5({enabled:B&&!$&&!G,open:$,ref:Z.context.popupRef,onComplete(){if(!$)U()}}),{forceUnmount:U,transitionStatus:z}}function z9($,Z){$.useSyncedValues(Z),J0(()=>()=>{$.update({activeTriggerProps:_1,inactiveTriggerProps:_1,popupProps:_1})},[$])}function Uz($,Z){J0(()=>{if(!Z&&$.state.openMethod!==null)$.set("openMethod",null)},[Z,$]),J0(()=>()=>{if($.state.openMethod!==null)$.set("openMethod",null)},[$])}class W4{constructor(){this.idMap=new Map}add($,Z){this.idMap.set($,Z)}delete($){this.idMap.delete($)}hasElement($){for(let Z of this.idMap.values())if(Z===$)return!0;return!1}hasMatchingElement($){for(let Z of this.idMap.values())if($(Z))return!0;return!1}getById($){return this.idMap.get($)}entries(){return this.idMap.entries()}elements(){return this.idMap.values()}get size(){return this.idMap.size}}function X9($,Z,H=!1){return{open:!1,openProp:void 0,mounted:!1,transitionStatus:void 0,floatingRootContext:new Z7({open:!1,transitionStatus:void 0,floatingElement:null,referenceElement:null,triggerElements:$,floatingId:Z,syncOnly:!0,nested:H,onOpenChange:void 0}),floatingId:Z,triggerCount:0,preventUnmountingOnClose:!1,payload:void 0,activeTriggerId:null,activeTriggerElement:null,triggerIdProp:void 0,popupElement:null,positionerElement:null,activeTriggerProps:_1,inactiveTriggerProps:_1,popupProps:_1}}var pH=($)=>$.triggerIdProp??$.activeTriggerId,kW=($)=>$.openProp??$.open,Lj=($)=>{return($.popupElement?.id??$.floatingId)||void 0};function Dj($,Z){return Z!==void 0&&kW($)&&pH($)===Z}function kn($,Z){if(Dj($,Z))return!0;return Z!==void 0&&kW($)&&pH($)==null&&$.triggerCount===1}var G9={open:kW,mounted:($)=>$.mounted,transitionStatus:($)=>$.transitionStatus,floatingRootContext:($)=>$.floatingRootContext,triggerCount:($)=>$.triggerCount,preventUnmountingOnClose:($)=>$.preventUnmountingOnClose,payload:($)=>$.payload,activeTriggerId:pH,activeTriggerElement:($)=>$.mounted?$.activeTriggerElement:null,popupId:Lj,isTriggerActive:($,Z)=>Z!==void 0&&pH($)===Z,isOpenedByTrigger:($,Z)=>Dj($,Z),isMountedByTrigger:($,Z)=>Z!==void 0&&pH($)===Z&&$.mounted,triggerProps:($,Z)=>Z?$.activeTriggerProps:$.inactiveTriggerProps,triggerPopupId:($,Z)=>kn($,Z)?Lj($):void 0,popupProps:($)=>$.popupProps,popupElement:($)=>$.popupElement,positionerElement:($)=>$.positionerElement};var RW=_(p(),1),qj=_(W$(),1);function U9($){let Z=RW.useCallback((J)=>{if($===void 0)return K1;return $.subscribeStore(J)},[$]),H=RW.useCallback(()=>{return $===void 0?void 0:$.store},[$]);return qj.useSyncExternalStore(Z,H,()=>$?.serverStore)}function bW($){let{open:Z=!1,onOpenChange:H,elements:J={}}=$,B=H2(),Q=B2()!=null,z=p1(()=>new Z7({open:Z,transitionStatus:void 0,onOpenChange:H,referenceElement:J.reference??null,floatingElement:J.floating??null,triggerElements:new W4,floatingId:B,syncOnly:!1,nested:Q})).current;return J0(()=>{let X={open:Z,floatingId:B};if(J.reference!==void 0)X.referenceElement=J.reference,X.domReferenceElement=r0(J.reference)?J.reference:null;if(J.floating!==void 0)X.floatingElement=J.floating;z.update(X)},[Z,B,J.reference,J.floating,z]),z.context.onOpenChange=H,z.context.nested=Q,z}var K9=_(p(),1);var yW=n1.os.mac&&n1.engine.webkit;function J7($,Z={}){let{enabled:H=!0,delay:J}=Z,B="rootStore"in $?$.rootStore:$,{events:Q,dataRef:z}=B.context,X=K9.useRef(!1),G=K9.useRef(null),U=K9.useRef(!0),K=a1();K9.useEffect(()=>{let Y=B.select("domReferenceElement");if(!H)return;let W=u1(Y);function A(){let V=B.select("domReferenceElement");if(!B.select("open")&&C1(V)&&V===c1(f0(V)))X.current=!0,G.current=V}function N(){U.current=!0}function L(){U.current=!1}return K4(i0(W,"blur",A),yW&&i0(W,"keydown",N,!0),yW&&i0(W,"pointerdown",L,!0))},[B,H]),K9.useEffect(()=>{if(!H)return;function Y(W){if(W.reason===K0.triggerPress||W.reason===K0.escapeKey){let A=B.select("domReferenceElement");if(r0(A))G.current=A,X.current=!0}}return Q.on("openchange",Y),()=>{Q.off("openchange",Y)}},[Q,H,B]);let F=K9.useMemo(()=>{function Y(){X.current=!1,G.current=null}return{onMouseLeave(){Y()},onFocus(W){let A=W.currentTarget;if(X.current){if(G.current===A)return;Y()}let N=P1(W.nativeEvent);if(r0(N)){if(yW&&!W.relatedTarget){if(!U.current&&!l6(N))return}else if(!n8(N))return}let L=D3(W.relatedTarget,B.context.triggerElements),{nativeEvent:V,currentTarget:D}=W,q=typeof J==="function"?J():J;if(B.select("open")&&L||q===0||q===void 0){B.setOpen(!0,R0(K0.triggerFocus,V,D));return}K.start(q,()=>{if(X.current)return;B.setOpen(!0,R0(K0.triggerFocus,V,D))})},onBlur(W){Y();let{relatedTarget:A,nativeEvent:N}=W,L=r0(A)&&A.hasAttribute(l9("focus-guard"))&&A.getAttribute("data-type")==="outside";K.start(0,()=>{let V=B.select("domReferenceElement"),D=c1(f0(V));if(!A&&D===V)return;if(k0(z.current.floatingContext?.refs.floating.current,D)||k0(V,D)||L)return;if(D3(A??D,B.context.triggerElements))return;B.setOpen(!1,R0(K0.triggerFocus,N))})}}},[z,J,B,K]);return K9.useMemo(()=>H?{reference:F,trigger:F}:{},[H,F])}var xW=_(p(),1);class hW{constructor(){this.pointerType=void 0,this.interactedInside=!1,this.handler=void 0,this.blockMouseMove=!0,this.performedPointerEventsMutation=!1,this.pointerEventsScopeElement=null,this.pointerEventsReferenceElement=null,this.pointerEventsFloatingElement=null,this.restTimeoutPending=!1,this.openChangeTimeout=new v5,this.restTimeout=new v5,this.handleCloseOptions=void 0}static create(){return new hW}dispose=()=>{this.openChangeTimeout.clear(),this.restTimeout.clear()};disposeEffect=()=>{return this.dispose}}var Kz=new WeakMap;function _$($){if(!$.performedPointerEventsMutation)return;let Z=$.pointerEventsScopeElement;if(Z&&Kz.get(Z)===$)$.pointerEventsScopeElement?.style.removeProperty("pointer-events"),$.pointerEventsReferenceElement?.style.removeProperty("pointer-events"),$.pointerEventsFloatingElement?.style.removeProperty("pointer-events"),Kz.delete(Z);$.performedPointerEventsMutation=!1,$.pointerEventsScopeElement=null,$.pointerEventsReferenceElement=null,$.pointerEventsFloatingElement=null}function Fz($,Z){let{scopeElement:H,referenceElement:J,floatingElement:B}=Z,Q=Kz.get(H);if(Q&&Q!==$)_$(Q);_$($),$.performedPointerEventsMutation=!0,$.pointerEventsScopeElement=H,$.pointerEventsReferenceElement=J,$.pointerEventsFloatingElement=B,Kz.set(H,$),H.style.pointerEvents="none",J.style.pointerEvents="auto",B.style.pointerEvents="auto"}function j$($){let Z=$.context.dataRef.current,H=p1(()=>Z.hoverInteractionState??hW.create()).current;if(!Z.hoverInteractionState)Z.hoverInteractionState=H;return N3(Z.hoverInteractionState.disposeEffect),Z.hoverInteractionState}function n9($,Z={}){let{enabled:H=!0,closeDelay:J=0,nodeId:B}=Z,Q="rootStore"in $?$.rootStore:$,z=Q.useState("open"),X=Q.useState("floatingElement"),G=Q.useState("domReferenceElement"),{dataRef:U}=Q.context,K=x4(),F=B2(),Y=j$(Q),W=a1(),A=W0(()=>{return Jz(U.current.openEvent?.type,Y.interactedInside)}),N=W0(()=>{return a_(U.current.openEvent?.type)}),L=W0(()=>{_$(Y)});J0(()=>{if(!z)Y.pointerType=void 0,Y.restTimeoutPending=!1,Y.interactedInside=!1,L()},[z,Y,L]),xW.useEffect(()=>{return L},[L]),J0(()=>{if(!H)return;if(z&&Y.handleCloseOptions?.blockPointerEvents&&N()&&r0(G)&&X){let V=G,D=X,q=f0(X),j=K?.nodesRef.current.find((C)=>C.id===F)?.context?.elements.floating;if(j)j.style.pointerEvents="";let M=Y.pointerEventsScopeElement!==D?Y.pointerEventsScopeElement:null,P=j!==D?j:null,T=Y.handleCloseOptions?.getScope?.()??M??P??V.closest("[data-rootownerid]")??q.body;return Fz(Y,{scopeElement:T,referenceElement:V,floatingElement:D}),()=>{L()}}return},[H,z,G,X,Y,N,K,F,L]),xW.useEffect(()=>{if(!H)return;function V(){return!!(K&&F&&s2(K.nodesRef.current,F).length>0)}function D(C){let k=_8(J,"close",Y.pointerType),E=()=>{Q.setOpen(!1,R0(K0.triggerHover,C)),K?.events.emit("floating.closed",C)};if(k)Y.openChangeTimeout.start(k,E);else Y.openChangeTimeout.clear(),E()}function q(C){let k=P1(C);if(!ZW(k)){Y.interactedInside=!1;return}Y.interactedInside=k?.closest("[aria-haspopup]")!=null}function j(){Y.openChangeTimeout.clear(),W.clear(),K?.events.off("floating.closed",P),L()}function M(C){if(V()&&K){K.events.on("floating.closed",P);return}if(D3(C.relatedTarget,Q.context.triggerElements))return;let k=U.current.floatingContext?.nodeId??B,E=C.relatedTarget;if(K&&k&&r0(E)&&s2(K.nodesRef.current,k,!1).some((x)=>k0(x.context?.elements.floating,E)))return;if(Y.handler){Y.handler(C);return}if(L(),N()&&!A())D(C)}function P(C){if(!K||!F||V())return;W.start(0,()=>{K.events.off("floating.closed",P),Q.setOpen(!1,R0(K0.triggerHover,C)),K.events.emit("floating.closed",C)})}let T=X;return K4(T&&i0(T,"mouseenter",j),T&&i0(T,"mouseleave",M),T&&i0(T,"pointerdown",q,!0),()=>{K?.events.off("floating.closed",P)})},[H,X,Q,U,J,B,N,A,L,Y,K,F,W])}var T3=_(p(),1),Mj=_(x2(),1);var Rn={current:null};function T8($,Z={}){let{enabled:H=!0,delay:J=0,handleClose:B=null,mouseOnly:Q=!1,restMs:z=0,move:X=!0,triggerElementRef:G=Rn,externalTree:U,isActiveTrigger:K=!0,getHandleCloseContext:F,isClosing:Y,shouldOpen:W,guardStaleOpen:A=!1}=Z,N="rootStore"in $?$.rootStore:$,{dataRef:L,events:V}=N.context,D=x4(U),q=j$(N),j=T3.useRef(!1),M=Q5(B),P=Q5(J),T=Q5(z),C=Q5(H),k=Q5(W),E=Q5(Y),h=W0(()=>{return Jz(L.current.openEvent?.type,q.interactedInside)}),x=W0(()=>{return k.current?.()!==!1}),R=W0((I,y,f)=>{let g=N.context.triggerElements;if(g.hasElement(y))return!I||!k0(I,y);if(!r0(f))return!1;let O=f;return g.hasMatchingElement((c)=>k0(c,O))&&(!I||!k0(I,O))}),w=W0(()=>{if(!q.handler)return;f0(N.select("domReferenceElement")).removeEventListener("mousemove",q.handler),q.handler=void 0}),S=W0(()=>{_$(q)});if(K)q.handleCloseOptions=B?.__options;return T3.useEffect(()=>w,[w]),T3.useEffect(()=>{if(!H)return;function I(y){if(!y.open)j.current=y.reason===K0.triggerHover,w(),q.openChangeTimeout.clear(),q.restTimeout.clear(),q.blockMouseMove=!0,q.restTimeoutPending=!1;else j.current=!1}return V.on("openchange",I),()=>{V.off("openchange",I)}},[H,V,q,w]),T3.useEffect(()=>{if(!H)return;function I(o,b=!0){let d=_8(P.current,"close",q.pointerType);if(d)q.openChangeTimeout.start(d,()=>{N.setOpen(!1,R0(K0.triggerHover,o)),D?.events.emit("floating.closed",o)});else if(b)q.openChangeTimeout.clear(),N.setOpen(!1,R0(K0.triggerHover,o)),D?.events.emit("floating.closed",o)}let y=G.current??(K?N.select("domReferenceElement"):null);if(!r0(y))return;function f(o){if(q.openChangeTimeout.clear(),q.blockMouseMove=!1,Q&&!h2(q.pointerType))return;let b=LW(T.current),d=_8(P.current,"open",q.pointerType),t=P1(o),u=o.currentTarget??null,a=N.select("domReferenceElement"),n=u;if(r0(t)&&!N.context.triggerElements.hasElement(t)){for(let i of N.context.triggerElements.elements())if(k0(i,t)){n=i;break}}if(r0(u)&&r0(a)&&!N.context.triggerElements.hasElement(u)&&k0(u,a))n=a;let Q0=n==null?!1:R(a,n,t),Z0=N.select("open"),U0=E.current?.()??N.select("transitionStatus")==="ending",B0=!Z0&&U0&&j.current,Y0=!Q0&&r0(n)&&r0(a)&&k0(a,n)&&B0,A0=b>0&&!d,D0=Q0&&(Z0||B0)||Y0,X0=!Z0||Q0;if(D0){if(x())N.setOpen(!0,R0(K0.triggerHover,o,n));return}if(A0)return;if(d)q.openChangeTimeout.start(d,()=>{if(X0&&x())N.setOpen(!0,R0(K0.triggerHover,o,n))});else if(X0){if(x())N.setOpen(!0,R0(K0.triggerHover,o,n))}}function g(o){if(h()){S();return}w();let b=N.select("domReferenceElement"),d=f0(b);q.restTimeout.clear(),q.restTimeoutPending=!1;let t=L.current.floatingContext??F?.();if(D3(o.relatedTarget,N.context.triggerElements))return;if(M.current&&t){if(!N.select("open"))q.openChangeTimeout.clear();let a=G.current;q.handler=M.current({...t,tree:D,x:o.clientX,y:o.clientY,onClose(){if(S(),w(),C.current&&!h()&&a===N.select("domReferenceElement"))I(o,!0)}}),d.addEventListener("mousemove",q.handler),q.handler(o);return}if(q.pointerType==="touch"?!k0(N.select("floatingElement"),o.relatedTarget):!0)I(o)}function O(o){if(k0(y,o.relatedTarget))return;q.openChangeTimeout.clear(),q.restTimeout.clear(),q.restTimeoutPending=!1}let c=A?i0(y,"mouseout",O):void 0;if(X)return K4(i0(y,"mousemove",f,{once:!0}),i0(y,"mouseenter",f),i0(y,"mouseleave",g),c);return K4(i0(y,"mouseenter",f),i0(y,"mouseleave",g),c)},[w,S,L,P,N,H,M,q,K,R,h,Q,X,T,G,D,C,F,E,x,A]),T3.useMemo(()=>{if(!H)return;function I(y){q.pointerType=y.pointerType}return{onPointerDown:I,onPointerEnter:I,onMouseMove(y){let{nativeEvent:f}=y,g=y.currentTarget,O=N.select("domReferenceElement"),c=N.select("open"),o=R(O,g,y.target);if(Q&&!h2(q.pointerType))return;if(c&&o&&q.handleCloseOptions?.blockPointerEvents){let t=N.select("floatingElement");if(t){let u=q.handleCloseOptions?.getScope?.()??g.ownerDocument.body;Fz(q,{scopeElement:u,referenceElement:g,floatingElement:t})}}let b=LW(T.current);if(c&&!o||b===0)return;if(!o&&q.restTimeoutPending&&y.movementX**2+y.movementY**2<2)return;q.restTimeout.clear();function d(){if(q.restTimeoutPending=!1,h())return;let t=N.select("open");if(!q.blockMouseMove&&(!t||o)&&x())N.setOpen(!0,R0(K0.triggerHover,f,g))}if(q.pointerType==="touch")Mj.flushSync(()=>{d()});else if(o&&c)d();else q.restTimeoutPending=!0,q.restTimeout.start(b,d)}}},[H,q,h,R,Q,N,T,x])}var T4=_(p(),1);var bn="Escape";function Pj($){return n1.engine.webkit&&$.movementX===0&&$.movementY===0}function Wz($,Z,H){switch($){case"vertical":return Z;case"horizontal":return H;default:return Z||H}}function Yz($,Z){return Wz(Z,$===oY||$===SQ,$===CH||$===wH)}function vW($,Z,H){return Wz(Z,$===SQ,H?$===CH:$===wH)||$==="Enter"||$===" "||$===""}function yn($,Z,H){return Wz(Z,H?$===CH:$===wH,$===SQ)}function hn($,Z,H,J){let B=H?$===wH:$===CH,Q=$===oY;if(Z==="both"||Z==="horizontal"&&J)return $===bn;return Wz(Z,B,Q)}function gW($,Z){let{listRef:H,activeIndex:J,onNavigate:B=()=>{},enabled:Q=!0,selectedIndex:z=null,allowEscape:X=!1,loopFocus:G=!1,nested:U=!1,rtl:K=!1,virtual:F=!1,focusItemOnOpen:Y="auto",focusItemOnHover:W=!0,openOnArrowKeyDown:A=!0,disabledIndices:N=void 0,orientation:L="vertical",parentOrientation:V,id:D,resetOnPointerLeave:q=!0,externalTree:j,grid:M}=Z,P=M!=null,T="rootStore"in $?$.rootStore:$,C=T.useState("open"),k=T.useState("floatingElement"),E=T.useState("domReferenceElement"),h=T.context.dataRef,x=RH(k),R=kH(E),w=Q5(x),S=B2(),I=x4(j),y=T4.useRef(Y),f=T4.useRef(z??-1),g=T4.useRef(null),O=T4.useRef(!0),c=W0((N0)=>{B(f.current===-1?null:f.current,N0)}),o=T4.useRef(!!k),b=T4.useRef(C),d=T4.useRef(!1),t=T4.useRef(!1),u=T4.useRef(null),a=Q5(N),n=Q5(C),Q0=Q5(z),Z0=Q5(q),U0=Z2(),B0=Z2(),Y0=W0(()=>{function N0(s){if(F)I?.events.emit("virtualfocus",s);else u.current=P$(s,{sync:d.current,preventScroll:!0})}let M0=H.current[f.current],v=t.current;if(M0)N0(M0);(d.current?(s)=>s():(s)=>U0.request(s))(()=>{let s=H.current[f.current]||M0;if(!s)return;if(!M0)N0(s);if(e&&(v||!O.current))s.scrollIntoView?.({block:"nearest",inline:"nearest"})})});J0(()=>{h.current.orientation=L},[h,L]),J0(()=>{if(!Q)return;if(C&&k){if(f.current=z??-1,y.current&&z!=null)t.current=!0,c()}else if(o.current)f.current=-1,c()},[Q,C,k,z,c]),J0(()=>{if(!Q)return;if(!C){d.current=!1;return}if(!k)return;if(J==null){if(d.current=!1,Q0.current!=null)return;if(o.current)f.current=-1,Y0();if((!b.current||!o.current)&&y.current&&(g.current!=null||y.current===!0&&g.current==null)){let N0=0,M0=()=>{if(H.current[0]==null){if(N0<2)(N0?(m)=>B0.request(m):queueMicrotask)(M0);N0+=1}else f.current=g.current==null||vW(g.current,L,K)||U?vQ(H):BW(H),g.current=null,c()};M0()}}else if(!JW(H.current,J))f.current=J,Y0(),t.current=!1},[Q,C,k,J,Q0,U,H,L,K,c,Y0,B0]),J0(()=>{if(!Q||k||!I||F||!o.current)return;let N0=I.nodesRef.current,M0=N0.find((s)=>s.id===S)?.context?.elements.floating,v=c1(f0(E??M0??null)),m=N0.some((s)=>s.context&&k0(s.context.elements.floating,v));if(M0&&!m&&O.current)M0.focus({preventScroll:!0})},[Q,k,E,I,S,F]),J0(()=>{b.current=C,o.current=!!k}),J0(()=>{if(!C)g.current=null,y.current=Y},[C,Y]);let A0=J!=null,D0=W0((N0)=>{if(!n.current)return;let M0=H.current.indexOf(N0.currentTarget);if(M0!==-1&&(f.current!==M0||J!==M0))f.current=M0,c(N0)}),X0=W0(()=>{return V??I?.nodesRef.current.find((N0)=>N0.id===S)?.context?.dataRef?.current.orientation}),i=W0(()=>{return vQ(H,a.current)}),l=W0((N0)=>{if(O.current=!1,d.current=!0,N0.which===229)return;if(!n.current&&N0.currentTarget===w.current)return;if(U&&hn(N0.key,L,K,P)){if(!Yz(N0.key,X0()))y2(N0);if(T.setOpen(!1,R0(K0.listNavigation,N0.nativeEvent)),C1(E))if(F)I?.events.emit("virtualfocus",E);else E.focus();return}let M0=f.current,v=vQ(H,N),m=BW(H,N);if(!R){if(N0.key==="Home")y2(N0),f.current=v,c(N0);if(N0.key==="End")y2(N0),f.current=m,c(N0)}if(M!=null){let s=M(N0,f.current,H,L,G,K,N,v,m);if(s!=null)f.current=s,c(N0);if(L==="both")return}if(Yz(N0.key,L)){if(y2(N0),C&&!F&&c1(N0.currentTarget.ownerDocument)===N0.currentTarget){f.current=vW(N0.key,L,K)?v:m,c(N0);return}if(vW(N0.key,L,K))if(G)if(M0>=m)if(X&&M0!==H.current.length)f.current=-1;else d.current=!1,f.current=v;else f.current=r6(H.current,{startingIndex:M0,disabledIndices:N});else f.current=Math.min(m,r6(H.current,{startingIndex:M0,disabledIndices:N}));else if(G)if(M0<=v)if(X&&M0!==-1)f.current=H.current.length;else d.current=!1,f.current=m;else f.current=r6(H.current,{startingIndex:M0,decrement:!0,disabledIndices:N});else f.current=Math.max(v,r6(H.current,{startingIndex:M0,decrement:!0,disabledIndices:N}));if(JW(H.current,f.current))f.current=-1;c(N0)}}),e=T4.useMemo(()=>{return{onFocus(M0){d.current=!0,D0(M0)},onClick:({currentTarget:M0})=>M0.focus({preventScroll:!0}),onMouseMove(M0){if(Pj(M0))return;if(d.current=!0,t.current=!1,W)D0(M0)},onPointerLeave(M0){if(!n.current||!O.current||M0.pointerType==="touch")return;d.current=!0;let v=M0.relatedTarget;if(!W||H.current.includes(v))return;if(!Z0.current)return;if(u.current?.(),u.current=null,f.current=-1,c(M0),!F){let m=w.current,s=c1(f0(m));if(m&&k0(m,s))m.focus({preventScroll:!0})}}}},[D0,n,w,W,H,c,Z0,F]),$0=T4.useMemo(()=>{return F&&C&&A0&&{"aria-activedescendant":`${D}-${J}`}},[F,C,A0,D,J]),H0=T4.useMemo(()=>{return{...!R?$0:{},onKeyDown(N0){if(N0.key==="Tab"&&N0.shiftKey&&C&&!F){let M0=P1(N0.nativeEvent);if(M0&&!k0(w.current,M0))return;if(y2(N0),T.setOpen(!1,R0(K0.focusOut,N0.nativeEvent)),C1(E))E.focus();return}l(N0)},onPointerMove(N0){if(Pj(N0))return;O.current=!0}}},[$0,l,w,R,T,C,F,E]),O0=T4.useMemo(()=>{function N0(m){T.setOpen(!0,R0(K0.listNavigation,m.nativeEvent,m.currentTarget))}function M0(m){if(Y==="auto"&&N$(m.nativeEvent))y.current=!F}function v(m){if(y.current=Y,Y==="auto"&&V$(m.nativeEvent))y.current=!0}return{onKeyDown(m){let s=T.select("open");O.current=!1;let G0=m.key.startsWith("Arrow"),j0=yn(m.key,X0(),K),m0=Yz(m.key,L),v0=(U?j0:m0)||m.key==="Enter"||m.key.trim()==="";if(F&&s)return l(m);if(!s&&!A&&G0)return;if(v0){let T0=Yz(m.key,X0());g.current=U&&T0?null:m.key}if(U){if(j0)if(y2(m),s)f.current=i(),c(m);else N0(m);return}if(m0){if(Q0.current!=null)f.current=Q0.current;if(y2(m),!s&&A)N0(m);else l(m);if(s)c(m)}return},onFocus(m){if(T.select("open")&&!F)f.current=-1,c(m)},onPointerDown:v,onPointerEnter:v,onMouseDown:M0,onClick:M0}},[l,Y,i,U,c,T,A,L,X0,K,Q0,F]),P0=T4.useMemo(()=>{return{...$0,...O0}},[$0,O0]);return T4.useMemo(()=>Q?{reference:P0,floating:H0,item:e,trigger:O0}:{},[Q,P0,H0,O0,e])}var B7=_(p(),1);function fW($,Z){let{listRef:H,elementsRef:J,activeIndex:B,onMatch:Q,disabledIndices:z,onTyping:X,enabled:G=!0,resetMs:U=750,selectedIndex:K=null}=Z,F="rootStore"in $?$.rootStore:$,Y=F.useState("open"),W=a1(),A=B7.useRef(""),N=B7.useRef(K??B??-1),L=B7.useRef(null),V=W0((j)=>{function M(w){return J?.current[w]}function P(w){let S=M(w);if(S&&!a6(S)||S?.matches(":disabled"))return!1;return z==null||!QW(u9,w,z)}function T(w,S,I=0){if(w.length===0)return-1;let y=(I%w.length+w.length)%w.length,f=S.toLowerCase();for(let g=0;g<w.length;g+=1){let O=(y+g)%w.length;if(!w[O]?.toLowerCase().startsWith(f)||!P(O))continue;return O}return-1}let C=H.current;if(A.current.length>0&&j.key===" ")y2(j),X?.(!0);if(A.current.length>0&&A.current[0]!==" "){if(T(C,A.current)===-1&&j.key!==" ")X?.(!1)}if(C==null||j.key.length!==1||j.ctrlKey||j.metaKey||j.altKey)return;if(Y&&j.key!==" ")y2(j),X?.(!0);let k=A.current==="";if(k)N.current=K??B??-1;if(C.every((w,S)=>w&&P(S)?w[0]?.toLowerCase()!==w[1]?.toLowerCase():!0)&&A.current===j.key)A.current="",N.current=L.current;A.current+=j.key,W.start(U,()=>{A.current="",N.current=L.current,X?.(!1)});let x=((k?K??B??-1:N.current)??0)+1,R=T(C,A.current,x);if(R!==-1)Q?.(R),L.current=R;else if(j.key!==" ")A.current="",X?.(!1)}),D=W0((j)=>{let M=j.relatedTarget,P=F.select("domReferenceElement"),T=F.select("floatingElement");if(k0(P,M)||k0(T,M))return;W.clear(),A.current="",N.current=L.current,X?.(!1)});J0(()=>{if(!Y&&K!==null)return;if(W.clear(),L.current=null,A.current!=="")A.current=""},[Y,K,W]);let q=B7.useMemo(()=>({onKeyDown:V,onBlur:D}),[V,D]);return B7.useMemo(()=>G?{reference:q,floating:q}:{},[G,q])}var _j=0.1,xn=_j*_j,K5=0.5;function Az($,Z,H,J,B,Q){return J>=Z!==Q>=Z&&$<=(B-H)*(Z-J)/(Q-J)+H}function Nz($,Z,H,J,B,Q,z,X,G,U){let K=!1;if(Az($,Z,H,J,B,Q))K=!K;if(Az($,Z,B,Q,z,X))K=!K;if(Az($,Z,z,X,G,U))K=!K;if(Az($,Z,G,U,H,J))K=!K;return K}function vn($,Z,H){return $>=H.x&&$<=H.x+H.width&&Z>=H.y&&Z<=H.y+H.height}function Vz($,Z,H,J,B,Q){let z=Math.min(H,B),X=Math.max(H,B),G=Math.min(J,Q),U=Math.max(J,Q);return $>=z&&$<=X&&Z>=G&&Z<=U}function C8($={}){let{blockPointerEvents:Z=!1}=$,H=new v5,J=({x:B,y:Q,placement:z,elements:X,onClose:G,nodeId:U,tree:K})=>{let F=z?.split("-")[0],Y=!1,W=null,A=null,N=typeof performance<"u"?performance.now():0;function L(D,q){let j=performance.now(),M=j-N;if(W===null||A===null||M===0)return W=D,A=q,N=j,!1;let P=D-W,T=q-A,C=P*P+T*T,k=M*M*xn;return W=D,A=q,N=j,C<k}function V(){H.clear(),G()}return function(q){H.clear();let{domReference:j,floating:M}=X;if(!j||!M||F==null||B==null||Q==null)return;let{clientX:P,clientY:T}=q,C=P1(q),k=q.type==="mouseleave",E=k0(M,C),h=k0(j,C);if(E){if(Y=!0,!k)return}if(h){if(Y=!1,!k){Y=!0;return}}if(k&&r0(q.relatedTarget)&&k0(M,q.relatedTarget))return;function x(){return Boolean(K&&s2(K.nodesRef.current,U).length>0)}function R(){if(!x())V()}if(x())return;let w=j.getBoundingClientRect(),S=M.getBoundingClientRect(),I=B>S.right-S.width/2,y=Q>S.bottom-S.height/2,f=S.width>w.width,g=S.height>w.height,O=(f?w:S).left,c=(f?w:S).right,o=(g?w:S).top,b=(g?w:S).bottom;if(F==="top"&&Q>=w.bottom-1||F==="bottom"&&Q<=w.top+1||F==="left"&&B>=w.right-1||F==="right"&&B<=w.left+1){R();return}let d=!1;switch(F){case"top":d=Vz(P,T,O,w.top+1,c,S.bottom-1);break;case"bottom":d=Vz(P,T,O,S.top+1,c,w.bottom-1);break;case"left":d=Vz(P,T,S.right-1,b,w.left+1,o);break;case"right":d=Vz(P,T,w.right-1,b,S.left+1,o);break;default:}if(d)return;if(Y&&!vn(P,T,w)){R();return}if(!k&&L(P,T)){R();return}let t=!1;switch(F){case"top":{let u=f?K5/2:K5*4,a=f?B+u:I?B+u:B-u,n=f?B-u:I?B+u:B-u,Q0=Q+K5+1,Z0=I?S.bottom-K5:f?S.bottom-K5:S.top,U0=I?f?S.bottom-K5:S.top:S.bottom-K5;t=Nz(P,T,a,Q0,n,Q0,S.left,Z0,S.right,U0);break}case"bottom":{let u=f?K5/2:K5*4,a=f?B+u:I?B+u:B-u,n=f?B-u:I?B+u:B-u,Q0=Q-K5,Z0=I?S.top+K5:f?S.top+K5:S.bottom,U0=I?f?S.top+K5:S.bottom:S.top+K5;t=Nz(P,T,a,Q0,n,Q0,S.left,Z0,S.right,U0);break}case"left":{let u=g?K5/2:K5*4,a=g?Q+u:y?Q+u:Q-u,n=g?Q-u:y?Q+u:Q-u,Q0=B+K5+1,Z0=y?S.right-K5:g?S.right-K5:S.left,U0=y?g?S.right-K5:S.left:S.right-K5;t=Nz(P,T,Z0,S.top,U0,S.bottom,Q0,a,Q0,n);break}case"right":{let u=g?K5/2:K5*4,a=g?Q+u:y?Q+u:Q-u,n=g?Q-u:y?Q+u:Q-u,Q0=B-K5,Z0=y?S.left+K5:g?S.left+K5:S.right,U0=y?g?S.left+K5:S.right:S.left+K5;t=Nz(P,T,Q0,a,Q0,n,Z0,S.top,U0,S.bottom);break}default:}if(!t)R();else if(!Y)H.start(40,R);return}};return J.__options={...$,blockPointerEvents:Z},J}function jj($,Z,H){let{reference:J,floating:B}=$,Q=q2(Z),z=xH(Z),X=hH(z),G=h4(Z),U=Q==="y",K=J.x+J.width/2-B.width/2,F=J.y+J.height/2-B.height/2,Y=J[X]/2-B[X]/2,W;switch(G){case"top":W={x:K,y:J.y-B.height};break;case"bottom":W={x:K,y:J.y+J.height};break;case"right":W={x:J.x+J.width,y:F};break;case"left":W={x:J.x-B.width,y:F};break;default:W={x:J.x,y:J.y}}let A=t2(Z);if(A)W[z]+=Y*(A==="end"?1:-1)*(H&&U?-1:1);return W}async function Oj($,Z){var H;if(Z===void 0)Z={};let{x:J,y:B,platform:Q,rects:z,elements:X,strategy:G}=$,{boundary:U="clippingAncestors",rootBoundary:K="viewport",elementContext:F="floating",altBoundary:Y=!1,padding:W=0}=s8(Z,$),A=xQ(W),L=X[Y?F==="floating"?"reference":"floating":F],V=i6(await Q.getClippingRect({element:((H=await(Q.isElement==null?void 0:Q.isElement(L)))!=null?H:!0)?L:L.contextElement||await(Q.getDocumentElement==null?void 0:Q.getDocumentElement(X.floating)),boundary:U,rootBoundary:K,strategy:G})),D=F==="floating"?{x:J,y:B,width:z.floating.width,height:z.floating.height}:z.reference,q=await(Q.getOffsetParent==null?void 0:Q.getOffsetParent(X.floating)),j=await(Q.isElement==null?void 0:Q.isElement(q))&&await(Q.getScale==null?void 0:Q.getScale(q))||{x:1,y:1},M=i6(Q.convertOffsetParentRelativeRectToViewportRelativeRect?await Q.convertOffsetParentRelativeRectToViewportRelativeRect({elements:X,rect:D,offsetParent:q,strategy:G}):D);return{top:(V.top-M.top+A.top)/j.y,bottom:(M.bottom-V.bottom+A.bottom)/j.y,left:(V.left-M.left+A.left)/j.x,right:(M.right-V.right+A.right)/j.x}}var gn=50,Tj=async($,Z,H)=>{let{placement:J="bottom",strategy:B="absolute",middleware:Q=[],platform:z}=H,X=z.detectOverflow?z:{...z,detectOverflow:Oj},G=await(z.isRTL==null?void 0:z.isRTL(Z)),U=await z.getElementRects({reference:$,floating:Z,strategy:B}),{x:K,y:F}=jj(U,J,G),Y=J,W=0,A={};for(let N=0;N<Q.length;N++){let L=Q[N];if(!L)continue;let{name:V,fn:D}=L,{x:q,y:j,data:M,reset:P}=await D({x:K,y:F,initialPlacement:J,placement:Y,strategy:B,middlewareData:A,rects:U,platform:X,elements:{reference:$,floating:Z}});if(K=q!=null?q:K,F=j!=null?j:F,A[V]={...A[V],...M},P&&W<gn){if(W++,typeof P==="object"){if(P.placement)Y=P.placement;if(P.rects)U=P.rects===!0?await z.getElementRects({reference:$,floating:Z,strategy:B}):P.rects;({x:K,y:F}=jj(U,Y,G))}N=-1}}return{x:K,y:F,placement:Y,strategy:B,middlewareData:A}};var Cj=function($){if($===void 0)$={};return{name:"flip",options:$,async fn(Z){var H,J;let{placement:B,middlewareData:Q,rects:z,initialPlacement:X,platform:G,elements:U}=Z,{mainAxis:K=!0,crossAxis:F=!0,fallbackPlacements:Y,fallbackStrategy:W="bestFit",fallbackAxisSideDirection:A="none",flipAlignment:N=!0,...L}=s8($,Z);if((H=Q.arrow)!=null&&H.alignmentOffset)return{};let V=h4(B),D=q2(X),q=h4(X)===X,j=await(G.isRTL==null?void 0:G.isRTL(U.floating)),M=Y||(q||!N?[bH(X)]:cP(X)),P=A!=="none";if(!Y&&P)M.push(...dP(X,N,A,j));let T=[X,...M],C=await G.detectOverflow(Z,L),k=[],E=((J=Q.flip)==null?void 0:J.overflows)||[];if(K)k.push(C[V]);if(F){let w=pP(B,z,j);k.push(C[w[0]],C[w[1]])}if(E=[...E,{placement:B,overflows:k}],!k.every((w)=>w<=0)){var h,x;let w=(((h=Q.flip)==null?void 0:h.index)||0)+1,S=T[w];if(S){if(!(F==="alignment"?D!==q2(S):!1)||E.every((f)=>q2(f.placement)===D?f.overflows[0]>0:!0))return{data:{index:w,overflows:E},reset:{placement:S}}}let I=(x=E.filter((y)=>y.overflows[0]<=0).sort((y,f)=>y.overflows[1]-f.overflows[1])[0])==null?void 0:x.placement;if(!I)switch(W){case"bestFit":{var R;let y=(R=E.filter((f)=>{if(P){let g=q2(f.placement);return g===D||g==="y"}return!0}).map((f)=>[f.placement,f.overflows.filter((g)=>g>0).reduce((g,O)=>g+O,0)]).sort((f,g)=>f[1]-g[1])[0])==null?void 0:R[0];if(y)I=y;break}case"initialPlacement":I=X;break}if(B!==I)return{reset:{placement:I}}}return{}}}};var wj=new Set(["left","top"]);async function fn($,Z){let{placement:H,platform:J,elements:B}=$,Q=await(J.isRTL==null?void 0:J.isRTL(B.floating)),z=h4(H),X=t2(H),G=q2(H)==="y",U=wj.has(z)?-1:1,K=Q&&G?-1:1,F=s8(Z,$),{mainAxis:Y,crossAxis:W,alignmentAxis:A}=typeof F==="number"?{mainAxis:F,crossAxis:0,alignmentAxis:null}:{mainAxis:F.mainAxis||0,crossAxis:F.crossAxis||0,alignmentAxis:F.alignmentAxis};if(X&&typeof A==="number")W=X==="end"?A*-1:A;return G?{x:W*K,y:Y*U}:{x:Y*U,y:W*K}}var Ej=function($){if($===void 0)$=0;return{name:"offset",options:$,async fn(Z){var H,J;let{x:B,y:Q,placement:z,middlewareData:X}=Z,G=await fn(Z,$);if(z===((H=X.offset)==null?void 0:H.placement)&&(J=X.arrow)!=null&&J.alignmentOffset)return{};return{x:B+G.x,y:Q+G.y,data:{...G,placement:z}}}}},Sj=function($){if($===void 0)$={};return{name:"shift",options:$,async fn(Z){let{x:H,y:J,placement:B,platform:Q}=Z,{mainAxis:z=!0,crossAxis:X=!1,limiter:G={fn:(D)=>{let{x:q,y:j}=D;return{x:q,y:j}}},...U}=s8($,Z),K={x:H,y:J},F=await Q.detectOverflow(Z,U),Y=q2(B),W=hQ(Y),A=K[W],N=K[Y],L=(D,q)=>yQ(q+F[D==="y"?"top":"left"],q,q-F[D==="y"?"bottom":"right"]);if(z)A=L(W,A);if(X)N=L(Y,N);let V=G.fn({...Z,[W]:A,[Y]:N});return{...V,data:{x:V.x-H,y:V.y-J,enabled:{[W]:z,[Y]:X}}}}}},Ij=function($){if($===void 0)$={};return{options:$,fn(Z){var H,J;let{x:B,y:Q,placement:z,rects:X,middlewareData:G}=Z,{offset:U=0,mainAxis:K=!0,crossAxis:F=!0}=s8($,Z),Y={x:B,y:Q},W=q2(z),A=hQ(W),N=Y[A],L=Y[W],V=s8(U,Z),D=typeof V==="number"?{mainAxis:V,crossAxis:0}:{mainAxis:(H=V.mainAxis)!=null?H:0,crossAxis:(J=V.crossAxis)!=null?J:0};if(K){let M=A==="y"?"height":"width",P=X.reference[A]-X.floating[M]+D.mainAxis,T=X.reference[A]+X.reference[M]-D.mainAxis;if(N<P)N=P;else if(N>T)N=T}if(F){var q,j;let M=A==="y"?"width":"height",P=wj.has(h4(z)),T=X.reference[W]-X.floating[M]+(P?((q=G.offset)==null?void 0:q[W])||0:0)+(P?0:D.crossAxis),C=X.reference[W]+X.reference[M]+(P?0:((j=G.offset)==null?void 0:j[W])||0)-(P?D.crossAxis:0);if(L<T)L=T;else if(L>C)L=C}return{[A]:N,[W]:L}}}},kj=function($){if($===void 0)$={};return{name:"size",options:$,async fn(Z){let{placement:H,rects:J,platform:B,elements:Q}=Z,{apply:z=()=>{},...X}=s8($,Z),G=await B.detectOverflow(Z,X),U=h4(H),K=t2(H),F=q2(H)==="y",{width:Y,height:W}=J.floating,A,N;if(U==="top"||U==="bottom")A=U,N=K===(await(B.isRTL==null?void 0:B.isRTL(Q.floating))?"start":"end")?"left":"right";else N=U,A=K==="end"?"top":"bottom";let L=W-G.top-G.bottom,V=Y-G.left-G.right,D=q3(W-G[A],L),q=q3(Y-G[N],V),j=Z.middlewareData.shift,M=!j,P=D,T=q;if(j!=null&&j.enabled.x)T=V;if(j!=null&&j.enabled.y)P=L;if(M&&!K)if(F)T=Y-2*q8(G.left,G.right);else P=W-2*q8(G.top,G.bottom);await z({...Z,availableWidth:T,availableHeight:P});let C=await B.getDimensions(Q.floating);if(Y!==C.width||W!==C.height)return{reset:{rects:!0}};return{}}}};function xj($){let Z=O4($),H=parseFloat(Z.width)||0,J=parseFloat(Z.height)||0,B=C1($),Q=B?$.offsetWidth:H,z=B?$.offsetHeight:J,X=M3(H)!==Q||M3(J)!==z;if(X)H=Q,J=z;return{width:H,height:J,$:X}}function dW($){return!r0($)?$.contextElement:$}function O$($){let Z=dW($);if(!C1(Z))return o8(1);let H=Z.getBoundingClientRect(),{width:J,height:B,$:Q}=xj(Z),z=(Q?M3(H.width):H.width)/J,X=(Q?M3(H.height):H.height)/B;if(!z||!Number.isFinite(z))z=1;if(!X||!Number.isFinite(X))X=1;return{x:z,y:X}}var mn=o8(0);function vj($){let Z=u1($);if(!cW()||!Z.visualViewport)return mn;return{x:Z.visualViewport.offsetLeft,y:Z.visualViewport.offsetTop}}function un($,Z,H){if(Z===void 0)Z=!1;return!!H&&Z&&H===u1($)}function Q7($,Z,H,J){if(Z===void 0)Z=!1;if(H===void 0)H=!1;let B=$.getBoundingClientRect(),Q=dW($),z=o8(1);if(Z)if(J){if(r0(J))z=O$(J)}else z=O$($);let X=un(Q,H,J)?vj(Q):o8(0),G=(B.left+X.x)/z.x,U=(B.top+X.y)/z.y,K=B.width/z.x,F=B.height/z.y;if(Q&&J){let Y=u1(Q),W=r0(J)?u1(J):J,A=Y,N=uW(A);while(N&&W!==A){let L=O$(N),V=N.getBoundingClientRect(),D=O4(N),q=V.left+(N.clientLeft+parseFloat(D.paddingLeft))*L.x,j=V.top+(N.clientTop+parseFloat(D.paddingTop))*L.y;G*=L.x,U*=L.y,K*=L.x,F*=L.y,G+=q,U+=j,A=u1(N),N=uW(A)}}return i6({width:K,height:F,x:G,y:U})}function Dz($,Z){let H=dH($).scrollLeft;if(!Z)return Q7(o9($)).left+H;return Z.left+H}function gj($,Z){let H=$.getBoundingClientRect(),J=H.left+Z.scrollLeft-Dz($,H),B=H.top+Z.scrollTop;return{x:J,y:B}}function pn($){let{elements:Z,rect:H,offsetParent:J,strategy:B}=$,Q=B==="fixed",z=o9(J),X=Z?Lz(Z.floating):!1;if(J===z||X&&Q)return H;let G={scrollLeft:0,scrollTop:0},U=o8(1),K=o8(0),F=C1(J);if(F||!Q){if(F4(J)!=="body"||cH(z))G=dH(J);if(F){let W=Q7(J);U=O$(J),K.x=W.x+J.clientLeft,K.y=W.y+J.clientTop}}let Y=z&&!F&&!Q?gj(z,G):o8(0);return{width:H.width*U.x,height:H.height*U.y,x:H.x*U.x-G.scrollLeft*U.x+K.x+Y.x,y:H.y*U.y-G.scrollTop*U.y+K.y+Y.y}}function cn($){return $.getClientRects?Array.from($.getClientRects()):[]}function dn($){let Z=dH($),H=$.ownerDocument.body,J=q8($.scrollWidth,$.clientWidth,H.scrollWidth,H.clientWidth),B=q8($.scrollHeight,$.clientHeight,H.scrollHeight,H.clientHeight),Q=-Z.scrollLeft+Dz($),z=-Z.scrollTop;if(O4(H).direction==="rtl")Q+=q8($.clientWidth,H.clientWidth)-J;return{width:J,height:B,x:Q,y:z}}var ln=25;function rn($,Z,H){if(H===void 0)H="viewport";let J=H==="layoutViewport",B=u1($),Q=o9($),z=B.visualViewport,X=Q.clientWidth,G=Q.clientHeight,U=0,K=0;if(z){let Y=!cW()||Z==="fixed";if(J){if(!Y)U=-z.offsetLeft,K=-z.offsetTop}else if(X=z.width,G=z.height,Y)U=z.offsetLeft,K=z.offsetTop}if(Dz(Q)<=0){let Y=Q.ownerDocument,W=Y.body,A=getComputedStyle(W),N=Y.compatMode==="CSS1Compat"?parseFloat(A.marginLeft)+parseFloat(A.marginRight)||0:0,L=Math.abs(Q.clientWidth-W.clientWidth-N),V=getComputedStyle(Q).scrollbarGutter==="stable both-edges"?L/2:L;if(V<=ln)X-=V}return{width:X,height:G,x:U,y:K}}function an($,Z){let H=Q7($,!0,Z==="fixed"),J=H.top+$.clientTop,B=H.left+$.clientLeft,Q=O$($),z=$.clientWidth*Q.x,X=$.clientHeight*Q.y,G=B*Q.x,U=J*Q.y;return{width:z,height:X,x:G,y:U}}function Rj($,Z,H){let J;if(Z==="viewport"||Z==="layoutViewport")J=rn($,H,Z);else if(Z==="document")J=dn(o9($));else if(r0(Z))J=an(Z,H);else{let B=vj($);J={x:Z.x-B.x,y:Z.y-B.y,width:Z.width,height:Z.height}}return i6(J)}function nn($,Z){let H=Z.get($);if(H)return H;let J=T$($,[],!1).filter((X)=>r0(X)&&F4(X)!=="body"),B=null,Q=O4($).position==="fixed",z=Q?a9($):$;while(r0(z)&&!$9(z)){let X=O4(z),G=pW(z),U=B?B.position:Q?"fixed":"";if(!G&&(U==="fixed"||U==="absolute"&&X.position==="static"))J=J.filter((F)=>F!==z);else B=X;z=a9(z)}return Z.set($,J),J}function on($){let{element:Z,boundary:H,rootBoundary:J,strategy:B}=$,z=[...H==="clippingAncestors"?Lz(Z)?[]:nn(Z,this._c):[].concat(H),J],X=Rj(Z,z[0],B),G=X.top,U=X.right,K=X.bottom,F=X.left;for(let Y=1;Y<z.length;Y++){let W=Rj(Z,z[Y],B);G=q8(W.top,G),U=q3(W.right,U),K=q3(W.bottom,K),F=q8(W.left,F)}return{width:U-F,height:K-G,x:F,y:G}}function sn($){let{width:Z,height:H}=xj($);return{width:Z,height:H}}function tn($,Z,H){let J=C1(Z),B=o9(Z),Q=H==="fixed",z=Q7($,!0,Q,Z),X={scrollLeft:0,scrollTop:0},G=o8(0);if(J||!Q){if(F4(Z)!=="body"||cH(B))X=dH(Z);if(J){let Y=Q7(Z,!0,Q,Z);G.x=Y.x+Z.clientLeft,G.y=Y.y+Z.clientTop}}if(!J&&B)G.x=Dz(B);let U=B&&!J&&!Q?gj(B,X):o8(0),K=z.left+X.scrollLeft-G.x-U.x,F=z.top+X.scrollTop-G.y-U.y;return{x:K,y:F,width:z.width,height:z.height}}function mW($){return O4($).position==="static"}function bj($,Z){if(!C1($)||O4($).position==="fixed")return null;if(Z)return Z($);let H=$.offsetParent;if(o9($)===H)H=H.ownerDocument.body;return H}function fj($,Z){let H=u1($);if(Lz($))return H;if(!C1($)){let B=a9($);while(B&&!$9(B)){if(r0(B)&&!mW(B))return B;B=a9(B)}return H}let J=bj($,Z);while(J&&yj(J)&&mW(J))J=bj(J,Z);if(J&&$9(J)&&mW(J)&&!pW(J))return H;return J||hj($)||H}var en=async function($){let Z=this.getOffsetParent||fj,H=this.getDimensions,J=await H($.floating);return{reference:tn($.reference,await Z($.floating),$.strategy),floating:{x:0,y:0,width:J.width,height:J.height}}};function $o($){return O4($).direction==="rtl"}var lW={convertOffsetParentRelativeRectToViewportRelativeRect:pn,getDocumentElement:o9,getClippingRect:on,getOffsetParent:fj,getElementRects:en,getClientRects:cn,getDimensions:sn,getScale:O$,isElement:r0,isRTL:$o};function mj($,Z){return $.x===Z.x&&$.y===Z.y&&$.width===Z.width&&$.height===Z.height}function Zo($,Z,H){let J=null,B,Q=o9($);function z(){var K;clearTimeout(B),(K=J)==null||K.disconnect(),J=null}function X(K,F){if(K===void 0)K=!1;if(F===void 0)F=1;z();let Y=$.getBoundingClientRect(),{left:W,top:A,width:N,height:L}=Y;if(!K)Z();if(!N||!L)return;let V=yH(A),D=yH(Q.clientWidth-(W+N)),q=yH(Q.clientHeight-(A+L)),j=yH(W),P={rootMargin:-V+"px "+-D+"px "+-q+"px "+-j+"px",threshold:q8(0,q3(1,F))||1},T=!0;function C(k){let E=k[0].intersectionRatio;if(!mj(Y,$.getBoundingClientRect()))return X();if(E!==F){if(!T)return X();if(!E)B=setTimeout(()=>{X(!1,0.0000001)},1000);else X(!1,E)}T=!1}try{J=new IntersectionObserver(C,{...P,root:Q.ownerDocument})}catch(k){J=new IntersectionObserver(C,P)}J.observe($)}let G=u1($),U=()=>X(H);return G.addEventListener("resize",U),X(!0),()=>{G.removeEventListener("resize",U),z()}}function lH($,Z,H,J){if(J===void 0)J={};let{ancestorScroll:B=!0,ancestorResize:Q=!0,elementResize:z=typeof ResizeObserver==="function",layoutShift:X=typeof IntersectionObserver==="function",animationFrame:G=!1}=J,U=dW($),K=B||Q?[...U?T$(U):[],...Z?T$(Z):[]]:[];K.forEach((V)=>{B&&V.addEventListener("scroll",H),Q&&V.addEventListener("resize",H)});let F=U&&X?Zo(U,H,Q):null,Y=-1,W=null;if(z){if(W=new ResizeObserver((V)=>{let[D]=V;if(D&&D.target===U&&W&&Z)W.unobserve(Z),cancelAnimationFrame(Y),Y=requestAnimationFrame(()=>{var q;(q=W)==null||q.observe(Z)});H()}),U&&!G)W.observe(U);if(Z)W.observe(Z)}let A,N=G?Q7($):null;if(G)L();function L(){let V=Q7($);if(N&&!mj(N,V))H();N=V,A=requestAnimationFrame(L)}return H(),()=>{var V;if(K.forEach((D)=>{B&&D.removeEventListener("scroll",H),Q&&D.removeEventListener("resize",H)}),F==null||F(),(V=W)==null||V.disconnect(),W=null,G)cancelAnimationFrame(A)}}var uj=Ej;var pj=Sj,cj=Cj,dj=kj;var lj=Ij,qz=($,Z,H)=>{let J=new Map,B=H!=null?H:{},Q={...lW,...B.platform,_c:J};return Tj($,Z,{...B,platform:Q})};var n5=_(p(),1),rj=_(p(),1),aj=_(x2(),1),Jo=typeof document<"u",Bo=function(){},Mz=Jo?rj.useLayoutEffect:Bo;function Pz($,Z){if($===Z)return!0;if(typeof $!==typeof Z)return!1;if(typeof $==="function"&&$.toString()===Z.toString())return!0;let H,J,B;if($&&Z&&typeof $==="object"){if(Array.isArray($)){if(H=$.length,H!==Z.length)return!1;for(J=H;J--!==0;)if(!Pz($[J],Z[J]))return!1;return!0}if(B=Object.keys($),H=B.length,H!==Object.keys(Z).length)return!1;for(J=H;J--!==0;)if(!{}.hasOwnProperty.call(Z,B[J]))return!1;for(J=H;J--!==0;){let Q=B[J];if(Q==="_owner"&&$.$$typeof)continue;if(!Pz($[Q],Z[Q]))return!1}return!0}return $!==$&&Z!==Z}function nj($){if(typeof window>"u")return 1;return($.ownerDocument.defaultView||window).devicePixelRatio||1}function ij($,Z){let H=nj($);return Math.round(Z*H)/H}function iW($){let Z=n5.useRef($);return Mz(()=>{Z.current=$}),Z}function oj($){if($===void 0)$={};let{placement:Z="bottom",strategy:H="absolute",middleware:J=[],platform:B,elements:{reference:Q,floating:z}={},transform:X=!0,whileElementsMounted:G,open:U}=$,[K,F]=n5.useState({x:0,y:0,strategy:H,placement:Z,middlewareData:{},isPositioned:!1}),[Y,W]=n5.useState(J);if(!Pz(Y,J))W(J);let[A,N]=n5.useState(null),[L,V]=n5.useState(null),D=n5.useCallback((f)=>{if(f!==P.current)P.current=f,N(f)},[]),q=n5.useCallback((f)=>{if(f!==T.current)T.current=f,V(f)},[]),j=Q||A,M=z||L,P=n5.useRef(null),T=n5.useRef(null),C=n5.useRef(K),k=G!=null,E=iW(G),h=iW(B),x=iW(U),R=n5.useCallback(()=>{if(!P.current||!T.current)return;let f={placement:Z,strategy:H,middleware:Y};if(h.current)f.platform=h.current;qz(P.current,T.current,f).then((g)=>{let O={...g,isPositioned:x.current!==!1};if(w.current&&!Pz(C.current,O))C.current=O,aj.flushSync(()=>{F(O)})})},[Y,Z,H,h,x]);Mz(()=>{if(U===!1&&C.current.isPositioned)C.current.isPositioned=!1,F((f)=>({...f,isPositioned:!1}))},[U]);let w=n5.useRef(!1);Mz(()=>{return w.current=!0,()=>{w.current=!1}},[]),Mz(()=>{if(j)P.current=j;if(M)T.current=M;if(j&&M){if(E.current)return E.current(j,M,R);R()}},[j,M,R,E,k]);let S=n5.useMemo(()=>({reference:P,floating:T,setReference:D,setFloating:q}),[D,q]),I=n5.useMemo(()=>({reference:j,floating:M}),[j,M]),y=n5.useMemo(()=>{let f={position:H,left:0,top:0};if(!I.floating)return f;let g=ij(I.floating,K.x),O=ij(I.floating,K.y);if(X)return{...f,transform:"translate("+g+"px, "+O+"px)",...nj(I.floating)>=1.5&&{willChange:"transform"}};return{position:H,left:g,top:O}},[H,X,I.floating,K.x,K.y]);return n5.useMemo(()=>({...K,update:R,refs:S,elements:I,floatingStyles:y}),[K,R,S,I,y])}var rW=($,Z)=>{let H=uj($);return{name:H.name,fn:H.fn,options:[$,Z]}},aW=($,Z)=>{let H=pj($);return{name:H.name,fn:H.fn,options:[$,Z]}},nW=($,Z)=>{return{fn:lj($).fn,options:[$,Z]}},oW=($,Z)=>{let H=cj($);return{name:H.name,fn:H.fn,options:[$,Z]}},sW=($,Z)=>{let H=dj($);return{name:H.name,fn:H.fn,options:[$,Z]}};var g4=_(p(),1);function sj($){return Qo($,$.rootContext)}function Qo($,Z){let{nodeId:H,externalTree:J}=$,B=Z.useState("referenceElement"),Q=Z.useState("floatingElement"),z=Z.useState("domReferenceElement"),X=Z.useState("open"),G=Z.useState("floatingId"),[U,K]=g4.useState(null),[F,Y]=g4.useState(void 0),[W,A]=g4.useState(void 0),N=g4.useRef(null),L=x4(J),V=g4.useMemo(()=>({reference:B,floating:Q,domReference:z}),[B,Q,z]),D=oj({...$,elements:{...V,...U&&{reference:U}}}),q=r0(F)?F:null,j=W===void 0?Z.state.floatingElement:W;Z.useSyncedValue("referenceElement",F??null),Z.useSyncedValue("domReferenceElement",F===void 0?z:q),Z.useSyncedValue("floatingElement",j);let M=g4.useCallback((h)=>{let x=r0(h)?{getBoundingClientRect:()=>h.getBoundingClientRect(),getClientRects:()=>h.getClientRects(),contextElement:h}:h;K(x),D.refs.setReference(x)},[D.refs]),P=g4.useCallback((h)=>{if(r0(h)||h===null)N.current=h,Y(h);if(r0(D.refs.reference.current)||D.refs.reference.current===null||h!==null&&!r0(h))D.refs.setReference(h)},[D.refs,Y]),T=g4.useCallback((h)=>{A(h),D.refs.setFloating(h)},[D.refs]),C=g4.useMemo(()=>({...D.refs,setReference:P,setFloating:T,setPositionReference:M,domReference:N}),[D.refs,P,T,M]),k=g4.useMemo(()=>({...D.elements,domReference:z}),[D.elements,z]),E=g4.useMemo(()=>({...D,dataRef:Z.context.dataRef,open:X,onOpenChange:Z.setOpen,events:Z.context.events,floatingId:G,refs:C,elements:k,nodeId:H,rootStore:Z}),[D,C,k,H,Z,X,G]);return J0(()=>{if(z)N.current=z},[z]),J0(()=>{Z.context.dataRef.current.floatingContext=E;let h=L?.nodesRef.current.find((x)=>x.id===H);if(h)h.context=E}),g4.useMemo(()=>({...D,context:E,refs:C,elements:k,rootStore:Z}),[D,C,k,E,Z])}var _z=_(p(),1),zo=_z.createContext(void 0);function Z8(){return _z.useContext(zo)?.direction??"ltr"}var Xo=($)=>({name:"arrow",options:$,async fn(Z){let{x:H,y:J,placement:B,rects:Q,platform:z,elements:X,middlewareData:G}=Z,{element:U,padding:K=0,offsetParent:F="real"}=s8($,Z)||{};if(U==null)return{};let Y=xQ(K),W={x:H,y:J},A=xH(B),N=hH(A),L=await z.getDimensions(U),V=A==="y",D=V?"top":"left",q=V?"bottom":"right",j=V?"clientHeight":"clientWidth",M=Q.reference[N]+Q.reference[A]-W[A]-Q.floating[N],P=W[A]-Q.reference[A],T=F==="real"?await z.getOffsetParent?.(U):X.floating,C=X.floating[j]||Q.floating[N];if(!C||!await z.isElement?.(T))C=X.floating[j]||Q.floating[N];let k=M/2-P/2,E=C/2-L[N]/2-1,h=Math.min(Y[D],E),x=Math.min(Y[q],E),R=h,w=C-L[N]-x,S=C/2-L[N]/2+k,I=yQ(R,S,w),y=!G.arrow&&t2(B)!=null&&S!==I&&Q.reference[N]/2-(S<R?h:x)-L[N]/2<0,f=y?S<R?S-R:S-w:0;return{[A]:W[A]+f,data:{[A]:I,centerOffset:S-I-f,...y&&{alignmentOffset:f}},reset:y}}}),tj=($,Z)=>{let{name:H,fn:J}=Xo($);return{name:H,fn:J,options:[$,Z]}};var ej={name:"hide",async fn($){let{width:Z,height:H,x:J,y:B}=$.rects.reference,Q=Z===0&&H===0&&J===0&&B===0,z=await $.platform.detectOverflow($,{elementContext:"reference"});return{data:{referenceHidden:z.top-H>=0||z.right-Z>=0||z.bottom-H>=0||z.left-Z>=0||Q}}}};var C$={sideX:"left",sideY:"top"};var jz="--available-width",Oz="--available-height",$O="--anchor-width",ZO="--anchor-height",HO="--transform-origin",JO="--positioner-width",BO="--positioner-height";var zO=jz,XO=Oz;function KO($,Z,H){let J=$==="inline-start"||$==="inline-end";return{top:"top",right:J?H?"inline-start":"inline-end":"right",bottom:"bottom",left:J?H?"inline-end":"inline-start":"left"}[Z]}function GO($,Z,H){let{rects:J,placement:B}=$;return{side:KO(Z,h4(B),H),align:t2(B)||"center",anchor:{width:J.reference.width,height:J.reference.height},positioner:{width:J.floating.width,height:J.floating.height}}}function F9($){return Go($,sj)}function Go($,Z){let{anchor:H,positionMethod:J="absolute",side:B="bottom",sideOffset:Q=0,align:z="center",alignOffset:X=0,collisionBoundary:G,collisionPadding:U=5,sticky:K=!1,arrowPadding:F=5,disableAnchorTracking:Y=!1,inline:W,keepMounted:A=!1,floatingRootContext:N,mounted:L,collisionAvoidance:V,shift:D,nodeId:q,adaptiveOrigin:j,lazyFlip:M=!1,externalTree:P}=$,[T,C]=g2.useState(null);if(!L&&T!==null)C(null);let k=V.side||"flip",E=V.align||"flip",h=V.fallbackAxisSide||"end",x=D?.crossAxis??!1,R=D?.rootBoundary,w=typeof H==="function"?H:void 0,S=W0(w),I=w?S:H,y=Q5(H),f=Q5(L),O=Z8()==="rtl",c=T||{top:"top",right:"right",bottom:"bottom",left:"left","inline-end":O?"left":"right","inline-start":O?"right":"left"}[B],o=z==="center"?c:`${c}-${z}`,b=U;if(typeof b==="number")b={top:b,right:b,bottom:b,left:b};else if(b)b={top:b.top||0,right:b.right||0,bottom:b.bottom||0,left:b.left||0};let d=1,t=B==="bottom"?d:0,u=B==="top"?d:0,a=B==="right"?d:0,n=B==="left"?d:0,Q0={boundary:G==="clipping-ancestors"?"clippingAncestors":G,padding:b},Z0=g2.useRef(null),U0=Q5(Q),B0=Q5(X),Y0=typeof Q!=="function"?Q:0,A0=typeof X!=="function"?X:0,D0=[];if(W)D0.push(W);D0.push(rW((V0)=>{let I0=GO(V0,B,O),c0=typeof U0.current==="function"?U0.current(I0):U0.current,d0=typeof B0.current==="function"?B0.current(I0):B0.current;return{mainAxis:c0,crossAxis:d0,alignmentAxis:d0}},[Y0,A0,O,B]));let X0=E==="none"&&k!=="shift",i=!X0&&(K||x||k==="shift"),l=k==="none"?null:oW({...Q0,padding:{top:b.top+d+t,right:b.right+d+n,bottom:b.bottom+d+u,left:b.left+d+a},mainAxis:!x&&k==="flip",crossAxis:E==="flip"?"alignment":!1,fallbackAxisSideDirection:h}),e=X0?null:aW({...Q0,rootBoundary:R,mainAxis:E!=="none",crossAxis:i,limiter:K||x?void 0:nW((V0)=>{if(!Z0.current)return{};let{width:I0,height:c0}=Z0.current.getBoundingClientRect(),d0=q2(h4(V0.placement)),B1=d0==="y"?I0:c0,Y1=d0==="y"?b.left+b.right:b.top+b.bottom;return{offset:B1/2+Y1/2}})},[Q0,K,x,R,b,E]);if(k==="shift"||E==="shift"||z==="center")D0.push(e,l);else D0.push(l,e);D0.push(sW({...Q0,apply({elements:{floating:V0},availableWidth:I0,availableHeight:c0,rects:d0}){if(!f.current)return;let B1=V0.style;B1.setProperty(zO,`${I0}px`),B1.setProperty(XO,`${c0}px`);let Y1=u1(V0).devicePixelRatio||1,{x:Z1,y:k1,width:h0,height:H1}=d0.reference,O1=(Math.round((Z1+h0)*Y1)-Math.round(Z1*Y1))/Y1,f1=(Math.round((k1+H1)*Y1)-Math.round(k1*Y1))/Y1;B1.setProperty($O,`${O1}px`),B1.setProperty(ZO,`${f1}px`)}}),tj((V0)=>({element:Z0.current||f0(V0.elements.floating).createElement("div"),padding:Z0.current?F:0,offsetParent:"floating"}),[F]),{name:"transformOrigin",fn(V0){let{elements:{floating:I0},middlewareData:c0,placement:d0,platform:B1,rects:Y1,y:Z1}=V0,k1=h4(d0),h0=t2(d0),H1=q2(k1)==="y",O1=Z0.current,f1=typeof Q==="function"?Q(GO(V0,B,O)):Q,b0;if(!O1&&h0&&Math.abs(H1?c0.shift?.x||0:c0.shift?.y||0)<=1)b0=h0==="start"===(H1&&B1.isRTL?.(I0)===!0)?"100%":"0%";else{let l0=H1?c0.arrow?.x||0:c0.arrow?.y||0,V1=H1?O1?.clientWidth||0:O1?.clientHeight||0;b0=`${l0+V1/2}px`}let n0=k1==="top"||k1==="left"?`calc(100% + ${f1}px)`:`${-f1}px`;if(i&&H1&&Math.abs(c0.shift?.y||0)>f1)n0=`${Y1.reference.y+Y1.reference.height/2-Z1}px`;return I0.style.setProperty(HO,H1?`${b0} ${n0}`:`${n0} ${b0}`),{}}},ej,j),J0(()=>{if(!L&&N)N.update({referenceElement:null,floatingElement:null,domReferenceElement:null,positionReference:null})},[L,N]);let $0=g2.useMemo(()=>({ancestorScroll:!Y,elementResize:!Y&&typeof ResizeObserver<"u",layoutShift:!Y&&typeof IntersectionObserver<"u"}),[Y]),{refs:H0,elements:O0,x:P0,y:N0,middlewareData:M0,update:v,placement:m,context:s,isPositioned:G0,floatingStyles:j0}=Z({rootContext:N,open:A?L:void 0,placement:o,middleware:D0,strategy:J,whileElementsMounted:A?void 0:(...V0)=>lH(...V0,$0),nodeId:q,externalTree:P}),{sideX:m0,sideY:v0}=M0.adaptiveOrigin||C$,T0=G0?J:"fixed",p0=g2.useMemo(()=>{let V0;if(!G0)V0={position:T0,top:0,left:0};else if(j)V0={position:T0,[m0]:P0,[v0]:N0};else V0={...j0,position:T0};if(V0[zO]="100vw",V0[XO]="100vh",!G0)V0.opacity=0;return V0},[j,T0,m0,P0,v0,N0,j0,G0]),$1=g2.useRef(null);J0(()=>{if(!L)return;let V0=y.current,I0=typeof V0==="function"?V0():V0,d0=(UO(I0)?I0.current:I0)||null||null;if(d0!==$1.current)H0.setPositionReference(d0),$1.current=d0},[L,H0,I,y]),g2.useEffect(()=>{if(!L)return;let V0=y.current;if(typeof V0==="function")return;if(UO(V0)&&V0.current!==$1.current)H0.setPositionReference(V0.current),$1.current=V0.current},[L,H0,I,y]),g2.useEffect(()=>{if(A&&L&&O0.reference&&O0.floating)return lH(O0.reference,O0.floating,v,$0);return},[A,L,O0,v,$0]);let D1=h4(m),u0=KO(B,D1,O),N1=t2(m)||"center",H5=Boolean(M0.hide?.referenceHidden);J0(()=>{if(M&&L&&G0&&D1!==c)C(D1)},[M,L,G0,D1,c]);let M1=g2.useMemo(()=>({position:"absolute",top:M0.arrow?.y,left:M0.arrow?.x}),[M0.arrow]),q0=M0.arrow?.centerOffset!==0;return g2.useMemo(()=>({positionerStyles:p0,arrowStyles:M1,arrowRef:Z0,arrowUncentered:q0,side:u0,align:N1,physicalSide:D1,anchorHidden:H5,refs:H0,context:s,isPositioned:G0,update:v}),[p0,M1,Z0,q0,u0,N1,D1,H5,H0,s,G0,v])}function UO($){return $!=null&&"current"in $}var Tz=_(p(),1),tW=Tz.createContext(void 0);function FO(){let $=Tz.useContext(tW);if($===void 0)throw Error(g0(84));return $}function Y9($){return $==="starting"?F_:_1}function W9($,Z,{styles:H,transitionStatus:J,props:B,refs:Q,hidden:z,inert:X=!1}){let G={...H};if(X)G.pointerEvents="none";return F0("div",$,{state:Z,ref:Q,props:[{role:"presentation",hidden:z,style:G},Y9(J),B],stateAttributesMapping:b2})}var YO=_(r(),1),WO=Cz.forwardRef(function(Z,H){let{toast:J,...B}=Z,Q=l8(),z=J.positionerProps??_1,{render:X,className:G,anchor:U=z.anchor,positionMethod:K=z.positionMethod??"absolute",side:F=z.side??"top",align:Y=z.align??"center",sideOffset:W=z.sideOffset??0,alignOffset:A=z.alignOffset??0,collisionBoundary:N=z.collisionBoundary??"clipping-ancestors",collisionPadding:L=z.collisionPadding??5,arrowPadding:V=z.arrowPadding??5,sticky:D=z.sticky??!1,disableAnchorTracking:q=z.disableAnchorTracking??!1,collisionAvoidance:j=z.collisionAvoidance??e8,style:M,...P}=B,[T,C]=Cz.useState(null),k=Q.useState("toastIndex",J.id),E=Q.useState("toastVisibleIndex",J.id),h=r0(U)?U:null,x=bW({open:!0,onOpenChange:K1,elements:{floating:T,reference:h}}),R=F9({anchor:h,positionMethod:K,floatingRootContext:x,mounted:!0,side:F,sideOffset:W,align:Y,alignOffset:A,collisionBoundary:N,collisionPadding:L,sticky:D,arrowPadding:V,disableAnchorTracking:q,keepMounted:!0,collisionAvoidance:j}),w={side:R.side,align:R.align,anchorHidden:R.anchorHidden},S=W9(Z,w,{styles:{...R.positionerStyles,[rQ]:J.transitionStatus==="ending"?k:E},transitionStatus:J.transitionStatus,props:P,refs:[H,C]});return YO.jsx(tW.Provider,{value:R,children:S})});var AO=_(p(),1);var NO=AO.forwardRef(function(Z,H){let{className:J,render:B,style:Q,...z}=Z,{arrowRef:X,side:G,align:U,arrowUncentered:K,arrowStyles:F}=FO();return F0("div",Z,{state:{side:G,align:U,uncentered:K},ref:[H,X],props:[{style:F,"aria-hidden":!0},z]})});var VO=_(p(),1);function LO(){let $=l8(),Z=$.useState("toasts");return VO.useMemo(()=>({toasts:Z,add:$.addToast,close:$.closeToast,update:$.updateToast,promise:$.promiseToast}),[Z,$])}function DO(){let $=new Set;function Z(H){$.forEach((J)=>J(H))}return{" subscribe":function(J){return $.add(J),()=>{$.delete(J)}},add(H){let J=H.id||wQ("toast"),B={...H,id:J,transitionStatus:"starting"};return Z({action:"add",options:B}),J},close(H){Z({action:"close",options:{id:H}})},update(H,J){Z({action:"update",options:{id:H,updates:J}})},promise(H,J){let B=H;return Z({action:"promise",options:{...J,promise:H,setPromise(Q){B=Q}}}),B}}}var o1=_(r(),1),H8=f4.createToastManager();function Uo({...$}){return o1.jsx(f4.Provider,{...$})}function Ko({...$}){return o1.jsx(f4.Portal,{"data-slot":"toast-portal",...$})}function Fo({className:$,...Z}){return o1.jsx(f4.Viewport,{"data-slot":"toast-viewport",className:z0("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 Yo({className:$,...Z}){return o1.jsx(f4.Root,{"data-slot":"toast",className:z0("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 Wo({className:$,...Z}){return o1.jsx(f4.Content,{"data-slot":"toast-content",className:z0("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 Ao({className:$,...Z}){return o1.jsx(f4.Title,{"data-slot":"toast-title",className:z0("text-sm font-medium",$),...Z})}function No({className:$,...Z}){return o1.jsx(f4.Description,{"data-slot":"toast-description",className:z0("text-sm text-muted-foreground",$),...Z})}function Vo({className:$,render:Z=o1.jsx(E0,{variant:"outline",size:"sm"}),...H}){return o1.jsx(f4.Action,{"data-slot":"toast-action",render:Z,className:z0("shrink-0",$),...H})}function Lo({className:$,children:Z,render:H=o1.jsx(E0,{variant:"ghost",size:"icon-sm"}),...J}){return o1.jsx(f4.Close,{"data-slot":"toast-close","aria-label":"Close toast",render:H,className:z0("relative shrink-0 text-muted-foreground after:absolute after:-inset-2 after:content-[''] hover:text-foreground",$),...J,children:Z??o1.jsx(b5,{"aria-hidden":"true",stroke:1.75})})}function Do({type:$}){let Z=null;if($==="success")Z=o1.jsx(MO,{"aria-hidden":"true",stroke:1.75});if($==="info")Z=o1.jsx(PO,{"aria-hidden":"true",stroke:1.75});if($==="warning")Z=o1.jsx(wz,{"aria-hidden":"true",stroke:1.75});if($==="error")Z=o1.jsx(qO,{className:"text-destructive","aria-hidden":"true",stroke:1.75});if($==="loading")Z=o1.jsx(_O,{className:"animate-spin","aria-hidden":"true",stroke:1.75});if(!Z)return null;return o1.jsx("span",{"data-slot":"toast-icon",className:"shrink-0 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4",children:Z})}function qo(){let{toasts:$}=f4.useToastManager();return $.map((Z)=>o1.jsx(Yo,{toast:Z,children:o1.jsxs(Wo,{children:[o1.jsx(Do,{type:Z.type}),o1.jsxs("div",{className:"flex min-w-0 flex-1 flex-col gap-1",children:[o1.jsx(Ao,{}),o1.jsx(No,{})]}),o1.jsx(Vo,{}),o1.jsx(Lo,{})]})},Z.id))}function jO({children:$,toastManager:Z=H8,...H}){return o1.jsxs(Uo,{toastManager:Z,...H,children:[$,o1.jsx(Ko,{children:o1.jsx(Fo,{children:o1.jsx(qo,{})})})]})}var oM0=f4.createToastManager,sM0=f4.useToastManager;var s9={};g5(s9,{createHandle:()=>JT,Viewport:()=>HT,Trigger:()=>yO,Root:()=>SO,Provider:()=>lO,Positioner:()=>fO,Portal:()=>vO,Popup:()=>uO,Handle:()=>xz,Arrow:()=>cO});var w$=_(p(),1);var Ez=_(p(),1),eW=Ez.createContext(void 0);function J8($){let Z=Ez.useContext(eW);if(Z===void 0&&!$)throw Error(g0(72));return Z}var OO=_(p(),1);class w8 extends _4{setState($){}update($){}set($,Z){}notifyAll(){}}var TO={...G9,disabled:($)=>$.disabled,instantType:($)=>$.instantType,isInstantPhase:($)=>$.isInstantPhase,trackCursorAxis:($)=>$.trackCursorAxis,disableHoverablePopup:($)=>$.disableHoverablePopup,lastOpenChangeReason:($)=>$.openChangeReason,closeOnClick:($)=>$.closeOnClick,closeDelay:($)=>$.closeDelay,adaptiveOrigin:($)=>$.adaptiveOrigin};class $A extends _4{constructor($,Z,H){let J=new W4;super(wO($,J,Z,H),EO(J),TO)}setOpen=($,Z)=>{Gz(this,$,Z,{extraState:{openChangeReason:Z.reason}})};cancelPendingOpen($){this.state.floatingRootContext.dispatchOpenChange(!1,R0(K0.triggerPress,$))}}function CO(){let $=new W4,Z=new w8(Object.freeze(wO(void 0,$)),Object.freeze(EO($)),TO);return Object.assign(Z,{setOpen:K1,cancelPendingOpen:K1})}function wO($,Z,H,J=!1){return{...X9(Z,H,J),disabled:!1,instantType:void 0,isInstantPhase:!1,trackCursorAxis:"none",disableHoverablePopup:!1,openChangeReason:null,closeOnClick:!0,closeDelay:0,adaptiveOrigin:void 0,...$}}function EO($){return{popupRef:OO.createRef(),onOpenChange:void 0,onOpenChangeComplete:void 0,triggerElements:$}}var iH=_(r(),1),SO=D8(function(Z){let{disabled:H=!1,defaultOpen:J=!1,open:B,disableHoverablePopup:Q=!1,trackCursorAxis:z="none",actionsRef:X,onOpenChange:G,onOpenChangeComplete:U,handle:K,triggerId:F,defaultTriggerId:Y=null,children:W}=Z,A=O3((h,x)=>new $A({open:J,openProp:B,activeTriggerId:Y,triggerIdProp:F},h,x));A.useControlledProp("openProp",B),A.useControlledProp("triggerIdProp",F),A.useContextCallback("onOpenChange",G),A.useContextCallback("onOpenChangeComplete",U);let N=A.useState("open"),L=!H&&N,V=A.useState("activeTriggerId"),D=A.useState("mounted"),q=A.useState("payload");A.useSyncedValues({trackCursorAxis:z,disableHoverablePopup:Q,disabled:H}),B9(A,{closeOnActiveTriggerUnmount:!0});let{forceUnmount:j,transitionStatus:M}=Q9(L,A),P=A.useState("isInstantPhase"),T=A.useState("instantType"),C=A.useState("lastOpenChangeReason"),k=w$.useRef(null);J0(()=>{if(N&&H)A.setOpen(!1,R0(K0.disabled))},[N,H,A]),J0(()=>{if(M==="ending"&&C===K0.none||M!=="ending"&&P){if(T!=="delay")k.current=T;A.set("instantType","delay")}else if(k.current!==null)A.set("instantType",k.current),k.current=null},[M,P,C,T,A]),J0(()=>{if(L){if(V==null)A.set("payload",void 0)}},[A,V,L]),w$.useImperativeHandle(X,()=>({unmount:j,close:()=>A.setOpen(!1,R0(K0.imperativeAction))}),[j,A]);let E=L||D||!H&&z!=="none";return iH.jsxs(eW.Provider,{value:A,children:[K&&iH.jsx(H9,{handle:K,store:A}),E&&iH.jsx(Mo,{store:A,disabled:H,trackCursorAxis:z}),typeof W==="function"?W({payload:q}):W]})});function Mo({store:$,disabled:Z,trackCursorAxis:H}){let J=$.useState("floatingRootContext"),B=j8(J,{enabled:!Z,referencePress:()=>$.select("closeOnClick")}),Q=CW(J,{enabled:!Z&&H!=="none",axis:H==="none"?void 0:H}),z=w$.useMemo(()=>m4(Q.reference,B.reference),[Q.reference,B.reference]);return z9($,{activeTriggerProps:z,inactiveTriggerProps:z,popupProps:B.floating??_1}),null}var Iz=_(p(),1);function J1($){return H2($,"base-ui")}var Sz=_(p(),1),ZA=Sz.createContext(void 0);function IO(){return Sz.useContext(ZA)}var kO=600;var bO="data-base-ui-tooltip-trigger";function RO($){if("composedPath"in $){let H=$.composedPath();for(let J=0;J<H.length;J+=1){let B=H[J];if(r0(B))return B}}let Z=$.target;if(r0(Z))return Z;return null}function Po($){let Z=$;while(Z){let H=Z.closest(`[${bO}]`);if(H)return H;let J=Z.getRootNode();Z="host"in J&&r0(J.host)?J.host:null}return null}var yO=i8(function(Z,H){let{render:J,className:B,style:Q,handle:z,payload:X,disabled:G,delay:U,closeOnClick:K=!0,closeDelay:F,id:Y,...W}=Z,A=J8(!0),L=U9(z)??A;if(!L)throw Error(g0(82));let V=J1(Y),D=L.useState("isTriggerActive",V),q=L.useState("isOpenedByTrigger",V),j=L.useState("floatingRootContext"),M=Iz.useRef(null),P=F??0,{registerTrigger:T,isMountedByThisTrigger:C}=J9(V,M,L,{payload:X,closeOnClick:K,closeDelay:P}),k=IO(),{activeIdRef:E,delayRef:h,isInstantPhase:x,hasProvider:R}=qW(j,{open:q}),w=j$(j);L.useSyncedValue("isInstantPhase",x);let S=L.useState("disabled"),I=G??S,y=Q5(I),f=L.useState("trackCursorAxis"),g=L.useState("disableHoverablePopup"),O=Iz.useRef(!1),c=a1(),o=Iz.useRef(void 0);function b(){if(R&&E.current!=null)return 0;return U??k??kO}function d(Y0){let A0=M.current;if(!A0||!Y0)return!1;let D0=Po(Y0);return D0!==null&&D0!==A0&&k0(A0,D0)}function t(Y0){let A0=d(Y0);if(O.current=A0,A0)w.openChangeTimeout.clear(),w.restTimeout.clear(),w.restTimeoutPending=!1,c.clear();return A0}let u=T8(j,{enabled:!I,mouseOnly:!0,move:!1,handleClose:!g&&f!=="both"?C8():null,restMs:b,delay(){if(F==null&&R)return{close:_8(h.current,"close")};return{close:P}},triggerElementRef:M,isActiveTrigger:D,isClosing:()=>L.select("transitionStatus")==="ending",shouldOpen(){return!O.current}}),a=J7(j,{enabled:!I}).reference,n=(Y0)=>{let A0=O.current,D0=RO(Y0),X0=t(D0),i=M.current,l=i&&D0&&k0(i,D0);if(X0&&L.select("open")&&L.select("lastOpenChangeReason")===K0.triggerHover){L.setOpen(!1,R0(K0.triggerHover,Y0));return}if(A0&&!X0&&l&&!y.current&&!L.select("open")&&i&&h2(o.current)){let e=()=>{if(!O.current&&!y.current&&!L.select("open"))L.setOpen(!0,R0(K0.triggerHover,Y0,i))},$0=b();if($0===0)c.clear(),e();else c.start($0,e)}},Q0=L.useState("triggerProps",C);return F0("button",Z,{state:{open:q},ref:[H,T,M],props:[u,a,C||f!=="none"?Q0:void 0,{onMouseOver(Y0){n(Y0.nativeEvent)},onFocus(Y0){if(d(RO(Y0.nativeEvent)))Y0.preventBaseUIHandler()},onMouseLeave(){O.current=!1,c.clear(),o.current=void 0},onPointerEnter(Y0){o.current=Y0.pointerType},onPointerDown(Y0){if(o.current=Y0.pointerType,L.set("closeOnClick",K),K&&!L.select("open"))L.cancelPendingOpen(Y0.nativeEvent)},onClick(Y0){if(K&&!L.select("open"))L.cancelPendingOpen(Y0.nativeEvent)},id:V,[IH]:I?"":void 0,[bO]:I?void 0:""},W],stateAttributesMapping:a8})});var xO=_(p(),1);var kz=_(p(),1),HA=kz.createContext(void 0);function hO(){let $=kz.useContext(HA);if($===void 0)throw Error(g0(70));return $}var JA=_(r(),1),vO=xO.forwardRef(function(Z,H){let{keepMounted:J=!1,...B}=Z;if(!(J8().useState("mounted")||J))return null;return JA.jsx(HA.Provider,{value:J,children:JA.jsx(M$,{ref:H,...B})})});var bz=_(p(),1);var Rz=_(p(),1),BA=Rz.createContext(void 0);function E$(){let $=Rz.useContext(BA);if($===void 0)throw Error(g0(71));return $}var gO=_(r(),1),fO=bz.forwardRef(function(Z,H){let{render:J,className:B,anchor:Q,positionMethod:z="absolute",side:X="top",align:G="center",sideOffset:U=0,alignOffset:K=0,collisionBoundary:F="clipping-ancestors",collisionPadding:Y=5,arrowPadding:W=5,sticky:A=!1,disableAnchorTracking:N=!1,collisionAvoidance:L=e8,style:V,...D}=Z,q=J8(),j=hO(),M=q.useState("open"),P=q.useState("mounted"),T=q.useState("trackCursorAxis"),C=q.useState("disableHoverablePopup"),k=q.useState("floatingRootContext"),E=q.useState("instantType"),h=q.useState("transitionStatus"),x=q.useState("adaptiveOrigin"),R=F9({anchor:Q,positionMethod:z,floatingRootContext:k,mounted:P,side:X,sideOffset:U,align:G,alignOffset:K,collisionBoundary:F,collisionPadding:Y,sticky:A,arrowPadding:W,disableAnchorTracking:N,keepMounted:j,collisionAvoidance:L,adaptiveOrigin:x}),w=bz.useMemo(()=>({open:M,side:R.side,align:R.align,anchorHidden:R.anchorHidden,instant:T!=="none"?"tracking-cursor":E}),[M,R.side,R.align,R.anchorHidden,T,E]),S=W9(Z,w,{styles:R.positionerStyles,transitionStatus:h,props:D,refs:[H,q.useStateSetter("positionerElement")],hidden:!P,inert:!M||T==="both"||C});return gO.jsx(BA.Provider,{value:R,children:S})});var mO=_(p(),1);var uO=mO.forwardRef(function(Z,H){let{render:J,className:B,style:Q,...z}=Z,X=J8(),{side:G,align:U}=E$(),K=X.useState("open"),F=X.useState("instantType"),Y=X.useState("transitionStatus"),W=X.useState("popupProps"),A=X.useState("floatingRootContext"),N=X.useState("disabled"),L=X.useState("closeDelay");f5({open:K,ref:X.context.popupRef,onComplete(){if(K)X.context.onOpenChangeComplete?.(!0)}}),n9(A,{enabled:!N,closeDelay:L});let V=X.useStateSetter("popupElement");return F0("div",Z,{state:{open:K,side:G,align:U,instant:F,transitionStatus:Y},ref:[H,X.context.popupRef,V],props:[Z9,W,Y9(Y),z],stateAttributesMapping:y4})});var pO=_(p(),1);var cO=pO.forwardRef(function(Z,H){let{render:J,className:B,style:Q,...z}=Z,X=J8(),{arrowRef:G,side:U,align:K,arrowUncentered:F,arrowStyles:Y}=E$(),W=X.useState("open"),A=X.useState("instantType");return F0("div",Z,{state:{open:W,side:U,align:K,uncentered:F,instant:A},ref:[H,G],props:[{style:Y,"aria-hidden":!0},z],stateAttributesMapping:b2})});var dO=_(p(),1);var QA=_(r(),1),lO=function(Z){let{delay:H,closeDelay:J,timeout:B=400}=Z,Q=dO.useMemo(()=>({open:H,close:J}),[H,J]);return QA.jsx(ZA.Provider,{value:H,children:QA.jsx(DW,{delay:Q,timeoutMs:B,children:Z.children})})};var ZT=_(p(),1);var C4=_(p(),1),$T=_(x2(),1);var iO=_(p(),1);function rO($){let[Z,H]=iO.useState({current:$,previous:null});if(!Object.is($,Z.current))H({current:$,previous:Z.current});return Z.previous}var S$=_(p(),1);function zA($){let Z=O4($),H=parseFloat(Z.width)||0,J=parseFloat(Z.height)||0,B=C1($),Q=B?$.offsetWidth:H,z=B?$.offsetHeight:J;if(M3(H)!==Q||M3(J)!==z)H=Q,J=z;return{width:H,height:J}}var rH="--popup-width",aH="--popup-height";function oO($){let{popupElement:Z,positionerElement:H,content:J,mounted:B,onMeasureLayout:Q,onMeasureLayoutComplete:z,side:X,direction:G}=$,U=P2(Z,!0),K=Z2(),F=S$.useRef(null),Y=S$.useRef(!0),W=S$.useRef(K1),A=W0(Q),N=W0(z),L=S$.useMemo(()=>_o(X,G),[X,G]);J0(()=>{if(!B){W.current=K1,Y.current=!0,F.current=null;return}if(!Z||!H)return;W.current=nO(Z,L),XA(Z,"auto");let V=hz(Z,"position","static"),D=hz(Z,"transform","none"),q=hz(Z,"scale","1"),j=nO(H,{[jz]:"max-content",[Oz]:"max-content"});function M(){V(),D(),j()}function P(){M(),q()}if(A?.(),Y.current||F.current===null){yz(H,"max-content");let E=zA(Z);return F.current=E,yz(H,E),P(),N?.(null,E),Y.current=!1,()=>{W.current(),W.current=K1}}yz(H,"max-content");let T=F.current,C=zA(Z);F.current=C,XA(Z,T),P(),N?.(T,C),yz(H,C);let k=new AbortController;return K.request(()=>{XA(Z,C),U(()=>{Z.style.setProperty(rH,"auto"),Z.style.setProperty(aH,"auto")},k.signal)}),()=>{k.abort(),K.cancel(),W.current(),W.current=K1}},[J,Z,H,U,K,B,A,N,L])}function _o($,Z){let H=$==="top",J=$==="left"||$===(Z==="rtl"?"inline-end":"inline-start");if(!H&&!J)return _1;return{position:"absolute",[H?"bottom":"top"]:"0",[J?"right":"left"]:"0"}}function hz($,Z,H){let J=$.style.getPropertyValue(Z);return $.style.setProperty(Z,H),()=>{$.style.setProperty(Z,J)}}function nO($,Z){let H=[];for(let[J,B]of Object.entries(Z))H.push(hz($,J,B));return H.length?()=>{H.forEach((J)=>J())}:K1}function XA($,Z){let H=Z==="auto"?"auto":`${Z.width}px`,J=Z==="auto"?"auto":`${Z.height}px`;$.style.setProperty(rH,H),$.style.setProperty(aH,J)}function yz($,Z){let H=Z==="max-content"?"max-content":`${Z.width}px`,J=Z==="max-content"?"max-content":`${Z.height}px`;$.style.setProperty(JO,H),$.style.setProperty(BO,J)}var sO={name:"adaptiveOrigin",async fn($){let{x:Z,y:H,rects:{floating:J},elements:{floating:B},platform:Q,strategy:z,placement:X}=$,G=u1(B),U=G.getComputedStyle(B);if(!(U.transitionDuration!=="0s"&&U.transitionDuration!==""))return{x:Z,y:H,data:C$};let F=await Q.getOffsetParent?.(B),Y={width:0,height:0};if(z==="fixed"&&G?.visualViewport)Y={width:G.visualViewport.width,height:G.visualViewport.height};else if(F===G){let D=f0(B);Y={width:D.documentElement.clientWidth,height:D.documentElement.clientHeight}}else if(await Q.isElement?.(F))Y=await Q.getDimensions(F);let W=h4(X),A=Z,N=H;if(W==="left")A=Y.width-(Z+J.width);if(W==="top")N=Y.height-(H+J.height);let L=W==="left"?"right":C$.sideX,V=W==="top"?"bottom":C$.sideY;return{x:A,y:N,data:{sideX:L,sideY:V}}}};var tO="data-activation-direction";var I$=_(r(),1),C3={activationDirection:($)=>$?{[tO]:$}:null};function w3($){let{store:Z,side:H,children:J}=$,B=Z8(),Q=Z.useState("activeTriggerElement"),z=Z.useState("activeTriggerId"),X=Z.useState("open"),G=Z.useState("payload"),U=Z.useState("mounted"),K=Z.useState("popupElement"),F=Z.useState("positionerElement"),Y=rO(X?Q:null),W=Co(z,G),A=C4.useRef(null),[N,L]=C4.useState(null),[V,D]=C4.useState(null),q=C4.useRef(null),j=C4.useRef(null),M=P2(q,!0),P=Z2(),T=C4.useRef(null),[C,k]=C4.useState(null),[E,h]=C4.useState(!1);J0(()=>{return Z.set("adaptiveOrigin",sO),()=>{Z.set("adaptiveOrigin",void 0)}},[Z]);let x=W0(()=>{q.current?.style.setProperty("animation","none"),q.current?.style.setProperty("transition","none"),j.current?.style.setProperty("display","none")}),R=W0((g)=>{if(q.current?.style.removeProperty("animation"),q.current?.style.removeProperty("transition"),j.current?.style.removeProperty("display"),g)k(g)}),w=W0(()=>{T.current?.abort();let g=new AbortController;T.current=g,M(()=>{L(null),k(null),A.current=null},g.signal)}),S=C4.useRef(null);J0(()=>{if(!X||!U)S.current=null},[X,U]),J0(()=>{if(Q&&Y&&Q!==Y&&S.current!==Q&&A.current){L(A.current),h(!0);let g=To(Y,Q);D(g),S.current=Q}},[Q,Y]),J0(()=>{if(N==null)return;T.current?.abort(),h(!0),P.request(()=>{$T.flushSync(()=>{h(!1)}),w()})},[W,N,w,P]),J0(()=>{let g=q.current;if(!g)return;let O=f0(g).createElement("div");for(let c of Array.from(g.childNodes))O.appendChild(c.cloneNode(!0));A.current=O});let I=N!=null,y;if(!I)y=I$.jsx("div",{"data-current":!0,ref:q,children:J},W);else y=I$.jsxs(C4.Fragment,{children:[I$.jsx("div",{"data-previous":!0,inert:t8(!0),ref:j,style:{...C?{[rH]:`${C.width}px`,[aH]:`${C.height}px`}:null,position:"absolute"},"data-ending-style":E?void 0:""},"previous"),I$.jsx("div",{"data-current":!0,ref:q,"data-starting-style":E?"":void 0,children:J},W)]});J0(()=>{let g=j.current;if(!g||!N)return;g.replaceChildren(...Array.from(N.childNodes))},[N]),oO({popupElement:K,positionerElement:F,mounted:U,content:G,onMeasureLayout:x,onMeasureLayoutComplete:R,side:H,direction:B});let f={activationDirection:Oo(V),transitioning:I};return{children:y,state:f}}function Oo($){if(!$)return;return`${eO($.horizontal,5,"right","left")} ${eO($.vertical,5,"down","up")}`}function eO($,Z,H,J){if($>Z)return H;if($<-Z)return J;return""}function To($,Z){let H=$.getBoundingClientRect(),J=Z.getBoundingClientRect(),B={x:H.left+H.width/2,y:H.top+H.height/2},Q={x:J.left+J.width/2,y:J.top+J.height/2};return{horizontal:Q.x-B.x,vertical:Q.y-B.y}}function Co($,Z){let[H,J]=C4.useState(0),B=C4.useRef($),Q=C4.useRef(Z),z=C4.useRef(!1);return J0(()=>{let X=B.current,G=Q.current,U=$!==X,K=Z!==G;if(U)J((F)=>F+1),z.current=!K;else if(z.current&&K)J((F)=>F+1),z.current=!1;B.current=$,Q.current=Z},[$,Z]),`${$??"current"}-${H}`}var HT=ZT.forwardRef(function(Z,H){let{render:J,className:B,style:Q,children:z,...X}=Z,G=J8(),U=E$(),K=G.useState("instantType"),{children:F,state:Y}=w3({store:G,side:U.side,children:z}),W={activationDirection:Y.activationDirection,transitioning:Y.transitioning,instant:K};return F0("div",Z,{state:W,ref:H,props:[X,{children:F}],stateAttributesMapping:C3})});class xz extends O8{constructor(){super(CO(),"Tooltip")}open($){this.openByTrigger($)}close(){this.closePopup()}get isOpen(){return this.attachedStore?.select("open")??!1}}function JT(){return new xz}var vz=_(p(),1),E3=_(r(),1);function A9({portal:$,children:Z,...H}){let[J,B]=vz.useState(void 0),Q=vz.useCallback((z)=>{if(z)B(z.closest("[data-applet]")?.getAttribute("data-applet")??void 0)},[]);return E3.jsxs(E3.Fragment,{children:[E3.jsx("span",{hidden:!0,ref:Q}),E3.jsx($,{...H,children:E3.jsx("div",{"data-applet":J,className:"contents",children:Z})})]})}var z7=_(r(),1);function gz({delay:$=100,...Z}){return z7.jsx(s9.Provider,{"data-slot":"tooltip-provider",delay:$,...Z})}function l1({...$}){return z7.jsx(s9.Root,{"data-slot":"tooltip",...$})}function i1({...$}){return z7.jsx(s9.Trigger,{"data-slot":"tooltip-trigger",...$})}function r1({className:$,side:Z="top",sideOffset:H=6,align:J="center",alignOffset:B=0,children:Q,...z}){return z7.jsx(A9,{portal:s9.Portal,children:z7.jsx(s9.Positioner,{align:J,alignOffset:B,side:Z,sideOffset:H,className:"isolate z-50",children:z7.jsx(s9.Popup,{"data-slot":"tooltip-content",className:d1("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",$),...z,children:Q})})})}function fz({cooldownMs:$,windowMs:Z,maxPerWindow:H,maxKeys:J=256,now:B=Date.now}){let Q=new Map,z=0,X=0;return{admit(G){let U=B(),K=Q.get(G);if(K!==void 0&&U-K<$)return"cooldown";if(U-z>=Z)z=U,X=0;if(X>=H)return"window";if(X++,Q.set(G,U),Q.size>J)for(let F of[...Q.keys()].slice(0,Math.ceil(J/2)))Q.delete(F);return"ok"}}}var wo=fz({cooldownMs:5000,windowMs:60000,maxPerWindow:30});function E8($,Z){let H=[$,Z.source,Z.kind,Z.name,Z.message].join("\x00");if(wo.admit(H)!=="ok")return;fetch(`/api/workspaces/${$}/applet-log`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({events:[Z]})}).catch(()=>{})}var Eo=/\/api\/workspaces\/([^/\s)]+)\/(widgets|views)\/([^/\s)]+)\//;function BT($){if(!$)return null;let Z=Eo.exec($);if(!Z)return null;return{workspaceId:Z[1],kind:Z[2]==="widgets"?"widget":"view",name:Z[3]}}var QT=!1;function zT(){if(QT)return;QT=!0;let $=(Z,H,J)=>{let B=H instanceof Error?H:null,Q=B?.stack??"",z=Z??BT(Q);if(!z)return;E8(z.workspaceId,{source:"window",kind:z.kind,name:z.name,message:B?.message||J||String(H),...Q?{stack:Q}:{}})};window.addEventListener("error",(Z)=>$(BT(Z.filename),Z.error,Z.message)),window.addEventListener("unhandledrejection",(Z)=>$(null,Z.reason))}function S3($,Z){return`${$}:${Z}`}function k$($){return $==="running"}function UT($){return Object.values($).some(k$)}function nH($,Z,H){return k$($[S3(Z,H)])}function mz($,Z){let H=`${Z}:`;return Object.entries($).some(([J,B])=>J.startsWith(H)&&k$(B))}function KT($,Z,H){if(!H)return!1;let J=`${Z}:`,B=S3(Z,H);return Object.entries($).some(([Q,z])=>Q.startsWith(J)&&Q!==B&&k$(z))}function z2($,Z){return S3($,Z??"new")}var h1=XT()(($)=>({activity:{},errors:{},previews:{},attachments:{},setActivity:(Z,H,J)=>$((B)=>({activity:{...B.activity,[S3(Z,H)]:J}})),reconcileActivity:(Z)=>$(()=>({activity:Object.fromEntries(Z.map((H)=>[S3(H.workspaceId,H.sessionId),H.activity]))})),setError:(Z,H,J)=>$((B)=>({errors:{...B.errors,[S3(Z,H)]:J}})),setPreview:(Z)=>$((H)=>({previews:{...H.previews,[Z.messageId]:{workspaceId:Z.workspaceId,sessionId:Z.sessionId,parentToolUseId:Z.parentToolUseId,blocks:Z.blocks,updatedAt:Date.now()}}})),clearPreview:(Z)=>$((H)=>{if(!(Z in H.previews))return H;let{[Z]:J,...B}=H.previews;return{previews:B}}),clearPreviewsForSession:(Z,H)=>$((J)=>{let B={},Q=!1;for(let[z,X]of Object.entries(J.previews))if(X.workspaceId===Z&&X.sessionId===H)Q=!0;else B[z]=X;return Q?{previews:B}:J}),clearAllPreviews:()=>$((Z)=>Object.keys(Z.previews).length?{previews:{}}:Z),sweepPreviews:(Z,H)=>$((J)=>{let B={},Q=!1;for(let[z,X]of Object.entries(J.previews))if(H-X.updatedAt>Z)Q=!0;else B[z]=X;return Q?{previews:B}:J}),addAttachments:(Z,H,J)=>$((B)=>{let Q=z2(Z,H);return{attachments:{...B.attachments,[Q]:[...B.attachments[Q]??[],...J]}}}),updateAttachment:(Z,H,J,B)=>$((Q)=>{let z=z2(Z,H),X=Q.attachments[z];if(!X)return{};let G=X.find((U)=>U.localId===J);if(G?.previewUrl&&"previewUrl"in B&&B.previewUrl!==G.previewUrl)URL.revokeObjectURL(G.previewUrl);return{attachments:{...Q.attachments,[z]:X.map((U)=>U.localId===J?{...U,...B}:U)}}}),removeAttachment:(Z,H,J)=>$((B)=>{let Q=z2(Z,H),z=B.attachments[Q];if(!z)return{};let X=z.find((G)=>G.localId===J);if(X?.previewUrl)URL.revokeObjectURL(X.previewUrl);return{attachments:{...B.attachments,[Q]:z.filter((G)=>G.localId!==J)}}}),clearAttachments:(Z,H)=>$((J)=>{let B=z2(Z,H);for(let z of J.attachments[B]??[])if(z.previewUrl)URL.revokeObjectURL(z.previewUrl);let Q={...J.attachments};return delete Q[B],{attachments:Q}}),renameSession:(Z,H,J)=>$((B)=>{let Q=S3(Z,H),z=S3(Z,J),X={...B.activity},G={...B.errors};if(Q in X)X[z]=X[Q],delete X[Q];if(Q in G)G[z]=G[Q],delete G[Q];let U=B.previews,K=!1;for(let[F,Y]of Object.entries(B.previews))if(Y.workspaceId===Z&&Y.sessionId===H){if(!K)U={...B.previews},K=!0;U[F]={...Y,sessionId:J}}return{activity:X,errors:G,previews:U}})}));function FT($,Z,H){if(!H)return{root:null,byParent:{}};let J=null,B={};for(let Q of Object.values($)){if(Q.workspaceId!==Z||Q.sessionId!==H)continue;if(Q.parentToolUseId===null){if(!J||Q.updatedAt>J.updatedAt)J=Q}else{let z=B[Q.parentToolUseId];if(!z||Q.updatedAt>z.updatedAt)B[Q.parentToolUseId]=Q}}return{root:J,byParent:B}}function w4($){return GT(h1,$)}var S0={all:["workspaces"],discover:["workspaces","discover"],setupInfo:["workspaces","setup-info"],preview:($)=>["workspaces","preview",$],layout:($)=>["workspaces","layout",$],widgets:($)=>["workspaces","widgets",$],appletThumbnails:($)=>["workspaces","applet-thumbnails",$],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",$]};function oH(){return{turns:[],notices:[]}}function uz($,Z){switch(Z.kind){case"snapshot":return{...$,snapshot:Z.snapshot};case"turn":{let H=$.turns.findIndex((B)=>B.id===Z.turn.id);if(H>=0)return{...$,turns:$.turns.map((B,Q)=>Q===H?Z.turn:B)};if(Z.turn.seq===void 0)return{...$,turns:[...$.turns,Z.turn]};let J=$.turns.findIndex((B)=>B.seq!==void 0&&B.seq>Z.turn.seq);if(J<0)return{...$,turns:[...$.turns,Z.turn]};return{...$,turns:[...$.turns.slice(0,J),Z.turn,...$.turns.slice(J)]}}case"notice":{if($.notices.some((H)=>H.id===Z.notice.id))return{...$,notices:$.notices.map((H)=>H.id===Z.notice.id?Z.notice:H)};return{...$,notices:[...$.notices,Z.notice]}}case"result":return{...$,result:Z.result}}}function YT($){let Z=oH(),H=new Map,J=new Map,B=-1/0;for(let Q of $)switch(Q.kind){case"snapshot":Z.snapshot=Q.snapshot;break;case"turn":{let z=Q.turn,X=z.seq,G=H.get(z.id);if(G!==void 0)Z.turns[G]=z;else{let U=X!==void 0&&X<B?Z.turns.findIndex((K)=>K.seq!==void 0&&K.seq>X):-1;if(U<0)H.set(z.id,Z.turns.length),Z.turns.push(z);else{Z.turns.splice(U,0,z);for(let K=U;K<Z.turns.length;K++)H.set(Z.turns[K].id,K)}}if(X!==void 0)B=Math.max(B,X);break}case"notice":J.set(Q.notice.id,Q.notice);break;case"result":Z.result=Q.result;break}return Z.notices=[...J.values()],Z}var GA=new WeakMap;function WT($,Z,H,J){for(let B of GA.get($)??[])if(B.workspaceId===Z&&B.sessionId===H)B.events.push(J)}function AT($,Z){return CY({queryKey:S0.events($,Z),queryFn:async({client:H,signal:J})=>{let B=GA.get(H)??new Set;GA.set(H,B);let Q={workspaceId:$,sessionId:Z,events:[]};B.add(Q);try{let z=await q1(`/api/workspaces/${$}/sessions/${Z}/events`,{signal:J},"Couldn’t load chat");return YT([...z,...Q.events])}finally{B.delete(Q)}},staleTime:1/0,gcTime:300000})}var sH=_(p(),1);var X7={all:["app-ui"],selectedSession:($)=>["app-ui","selected-session",$]};function So($){return[...X7.selectedSession($),"save"]}function Io($,Z,H){let J=X7.selectedSession(Z),B=$.getQueryData(J),Q=B?.sessionId??null;if(B&&Q===H)return null;return $.setQueryData(J,{sessionId:H}),{sessionId:H,previousSessionId:Q}}function ko($,Z,H,J){let B=X7.selectedSession(Z),Q=$.getQueryData(B);if(H.sessionId!==J.sessionId&&Q?.sessionId!==H.sessionId)return"conflict";if(Q?.sessionId!==J.sessionId&&Q?.sessionId!==J.previousSessionId)return"ignored";return $.setQueryData(B,H),"applied"}function Ro($,Z,H,J){if(J)return;$.setQueryData(X7.selectedSession(Z),{sessionId:H})}function NT($,Z,H,J){$.setQueryData(X7.selectedSession(Z),(B)=>B?.sessionId===H?{sessionId:J}:B)}function I3(){let $=F5(),Z=z1(),H=sH.useMemo(()=>X7.selectedSession($),[$]),J=sH.useMemo(()=>So($),[$]),B=wY({mutationKey:J,exact:!0}),Q=J5({queryKey:H,queryFn:()=>q1(`/api/workspaces/${$}/selected-session`),staleTime:1/0,gcTime:0,refetchOnMount:!1,refetchOnWindowFocus:!1}),{mutate:z}=B5({mutationKey:J,scope:{id:`selected-session:${$}`},mutationFn:(U)=>q1(`/api/workspaces/${$}/selected-session`,o5("PUT",U),"Couldn’t save selected chat"),onSuccess:(U,K)=>{if(ko(Z,$,U,K)!=="conflict")return;H8.add({title:"Couldn’t save selected chat",type:"error"}),Z.invalidateQueries({queryKey:H})},onError:(U,K)=>{if(Z.getQueryData(H)?.sessionId!==K.sessionId)return;H8.add({title:"Couldn’t save selected chat",type:"error"}),Z.invalidateQueries({queryKey:H})}}),X=sH.useCallback((U)=>{let K=Io(Z,$,U);if(K)z(K)},[Z,z,$]);return H4((U)=>{if(U.type!=="selected-session:updated"||U.workspaceId!==$)return;Ro(Z,$,U.sessionId,B>0)}),[Q.isLoading?void 0:Q.data?.sessionId??null,X]}function LT($,Z){let{queryClient:H,sendMessage:J,onWorkspaceSwitch:B}=Z,Q=h1.getState();if($.type==="status_snapshot"){Q.reconcileActivity($.sessions??[]);return}if($.type==="status"){let{workspaceId:U,sessionId:K,activity:F}=$;if(Q.setActivity(U,K,F),F!=="running")Q.clearPreviewsForSession(U,K);return}if($.type==="preview"){let U=$,K=S0.events(U.workspaceId,U.sessionId);if(H?.getQueryData(K)===void 0)return;Q.setPreview({workspaceId:U.workspaceId,sessionId:U.sessionId,messageId:U.messageId,parentToolUseId:U.parentToolUseId,blocks:U.blocks});return}if($.type==="session_renamed"){let{workspaceId:U,from:K,to:F}=$,Y=S0.sessions(U),A=H?.getQueryData(Y)?.find((V)=>V.sessionId===K||V.sessionId===F);if(A)H?.cancelQueries({queryKey:Y});if(Q.renameSession(U,K,F),H)NT(H,U,K,F);if(A)H?.setQueryData(Y,(V)=>[{...A,sessionId:F},...(V??[]).filter((D)=>D.sessionId!==K&&D.sessionId!==F)]);let N=H?.getQueryData(S0.events(U,K));if(N!==void 0)H?.setQueryData(S0.events(U,F),N),H?.removeQueries({queryKey:S0.events(U,K)});let L=H?.getQueryData(S0.sessionConfig(U,K));if(L!==void 0)H?.setQueryData(S0.sessionConfig(U,F),L),H?.removeQueries({queryKey:S0.sessionConfig(U,K)});if(!A)H?.invalidateQueries({queryKey:Y});H?.invalidateQueries({queryKey:S0.preview(U)});return}if($.type==="sessions_changed"){let U=$.workspaceId,K=S0.sessions(U);H?.invalidateQueries({queryKey:K}),H?.invalidateQueries({queryKey:S0.preview(U)});return}if($.type==="workspace:switch"){B?.($.workspaceId);return}if($.type==="scratchpad:op"){let U=VT($.workspaceId);if(!U)return;let K=$.opId;U($.op).then((F)=>J({type:"scratchpad:op-result",opId:K,result:F}),(F)=>J({type:"scratchpad:op-result",opId:K,error:F instanceof Error?F.message:String(F)}));return}let{workspaceId:z,sessionId:X}=$;if(!z||!X)return;let G=$.kind;if(G==="snapshot"||G==="turn"||G==="notice"||G==="result"){if(bo(H,z,X,$),G==="turn"){let U=$.turn?.meta?.apiMessageId;if(U)Q.clearPreview(U)}if(G==="result")Q.clearPreviewsForSession(z,X)}if(G==="error"&&typeof $.content==="string"){if(Q.setError(z,X,$.content),$.terminal!==!1)Q.setActivity(z,X,"idle"),Q.clearPreviewsForSession(z,X)}if(G==="stopped")Q.setActivity(z,X,"idle"),Q.clearPreviewsForSession(z,X)}function bo($,Z,H,J){if(!$)return;WT($,Z,H,J);let B=S0.events(Z,H),Q=$.getQueryData(B);if(Q===void 0)return;$.setQueryData(B,uz(Q,J))}var KA=null,R$=null,pz=0,cz=null,UA=[],MT=null,DT=null,yo=15000;function PT($){if(KA=$,!DT)DT=setInterval(()=>h1.getState().sweepPreviews(yo,Date.now()),5000);if(R$)return;_T()}function _T(){let $=++pz;if(cz)clearTimeout(cz),cz=null;let Z=new WebSocket(qT("/ws"));R$=Z,Z.onopen=()=>{if(pz!==$){Z.close();return}for(let H of UA)Z.send(JSON.stringify(H));UA.length=0,KA?.invalidateQueries({queryKey:["workspaces","events"]}),h1.getState().clearAllPreviews()},Z.onmessage=(H)=>{if(pz!==$)return;let J;try{J=JSON.parse(H.data)}catch{return}ho(J)},Z.onclose=()=>{if(pz!==$)return;R$=null,cz=setTimeout(_T,1000)},Z.onerror=()=>Z.close()}function ho($){LT($,{queryClient:KA,sendMessage:dz,onWorkspaceSwitch:MT})}function dz($){if(R$&&R$.readyState===WebSocket.OPEN)R$.send(JSON.stringify($));else UA.push($)}function FA($){MT=$}var UY=_(p(),1);var xo=($)=>jT()(TT((Z)=>({discoveredWorkspacesOpen:!0,hasSentMessageFromMoi:!1,workspaceIdsPendingAnalysis:[],composerDrafts:{},viewBuilderDrafts:{},dockedChatWidth:360,setDiscoveredWorkspacesOpen:(H)=>Z({discoveredWorkspacesOpen:H}),markWorkspacePendingAnalysis:(H)=>Z((J)=>{let B=J.workspaceIdsPendingAnalysis??[];return{workspaceIdsPendingAnalysis:B.includes(H)?B:[...B,H]}}),markMessageSentFromMoi:(H)=>Z((J)=>({hasSentMessageFromMoi:!0,workspaceIdsPendingAnalysis:(J.workspaceIdsPendingAnalysis??[]).filter((B)=>B!==H)})),setComposerDraft:(H,J)=>Z((B)=>{let Q={...B.composerDrafts??{}};if(J)Q[H]=J;else delete Q[H];return{composerDrafts:Q}}),setViewBuilderDraft:(H,J)=>Z((B)=>{let Q=B.viewBuilderDrafts??{};if(J===null){if(!(H in Q))return B;let z={...Q};return delete z[H],{viewBuilderDrafts:z}}if(Q[H]===J)return B;return{viewBuilderDrafts:{...Q,[H]:J}}}),setDockedChatWidth:(H)=>Z({dockedChatWidth:H})}),$?{name:"moi:ui",storage:OT(()=>$)}:{name:"moi:ui"})),S5=xo();function CT($,Z){let H=$??[],J=H.findIndex((B)=>B.id===Z.id||B.path===Z.path);if(J===-1)return[Z,...H];return H.map((B,Q)=>Q===J?{...B,...Z}:B)}function lz(){return J5({queryKey:S0.all,queryFn:()=>q1("/api/workspaces"),staleTime:1/0,refetchOnMount:"always"})}function iz($){return J5({queryKey:S0.preview($),queryFn:()=>q1(`/api/workspaces/${$}/preview`),staleTime:60000})}function wT(){return J5({queryKey:S0.discover,queryFn:()=>q1("/api/workspaces/discover")})}function ET(){let $=z1();return B5({mutationFn:(Z)=>q1("/api/workspaces",o5("POST",Z),"Failed to add workspace"),onSuccess:(Z,H)=>{S5.getState().markWorkspacePendingAnalysis(Z.id),$.setQueryData(S0.all,(J)=>CT(J,Z)),$.setQueryData(S0.discover,(J)=>(J??[]).filter((B)=>B.path!==H.path))}})}function rz(){return J5({queryKey:S0.setupInfo,queryFn:()=>q1("/api/workspaces/create"),staleTime:30000,refetchOnMount:"always"})}function ST(){let $=z1();return B5({mutationFn:(Z)=>q1("/api/workspaces/create",o5("POST",Z),"Failed to create workspace"),onSuccess:(Z)=>{$.setQueryData(S0.all,(H)=>CT(H,Z))}})}function IT(){let $=z1();return B5({mutationFn:(Z)=>q1("/api/workspaces/order",o5("PUT",{ids:Z}),"Failed to reorder spaces"),onMutate:async(Z)=>{await $.cancelQueries({queryKey:S0.all,exact:!0});let H=$.getQueryData(S0.all);if(H){let J=new Map(H.map((Q)=>[Q.id,Q])),B=Z.map((Q)=>J.get(Q)).filter((Q)=>Boolean(Q));if(B.length===H.length)$.setQueryData(S0.all,B)}return{previous:H}},onError:(Z,H,J)=>{if(J?.previous)$.setQueryData(S0.all,J.previous);$.invalidateQueries({queryKey:S0.all,exact:!0})},onSuccess:(Z)=>{$.setQueryData(S0.all,Z)}})}function kT(){let $=z1();return B5({mutationFn:(Z)=>f2(`/api/workspaces/${Z}`,{method:"DELETE"},"Failed to remove workspace"),onSuccess:(Z,H)=>{$.setQueryData(S0.all,(J)=>(J??[]).filter((B)=>B.id!==H)),$.invalidateQueries({queryKey:S0.discover})}})}var vT=_(p(),1);var RT=_(r(),1);function m2({className:$,...Z}){return RT.jsx(y5,{"data-slot":"spinner",role:"status","aria-label":"Loading",className:d1("size-4 animate-spin",$),stroke:1.75,...Z})}var YA="Wait for active agents to finish, or stop them before updating moi";var vo=["update"],bT=300000,go=1000;function yT($){return J5({queryKey:vo,queryFn:()=>q1("/api/update"),staleTime:bT,refetchInterval:$?go:bT,refetchOnWindowFocus:!0,retry:!1})}function hT(){return B5({mutationFn:()=>q1("/api/update",{method:"POST"},"Could not update moi")})}var t9=_(r(),1);function fo($,Z){return!!Z&&$?.runningVersion===Z}function mo($,Z,H){let J=Z||H,B=$&&!J;return{busy:J,blocked:B,label:Z?"Updating":H?"Restarting":B?YA:"Update"}}function gT(){let $=hT(),Z=yT($.isSuccess),H=w4((X)=>UT(X.activity)),J=Z.data,B=$.data?.installedVersion??null;if(vT.useEffect(()=>{if(fo(J,B))window.location.reload()},[B,J]),Z.isPending)return{status:"loading"};if(!J?.availableVersion&&!$.isSuccess)return{status:"unavailable"};let Q=$.isSuccess;return{status:"available",button:{...mo(H,$.isPending,Q),errorMessage:$.error?.message??null,onClick:()=>$.mutate()}}}function fT({busy:$,blocked:Z,label:H,errorMessage:J,onClick:B}){return t9.jsxs(l1,{children:[t9.jsx(i1,{render:t9.jsx("div",{children:t9.jsx(E0,{type:"button",size:"icon",variant:$?"ghost":"default","aria-label":H,disabled:Z||$,onClick:B,children:$?t9.jsx(m2,{stroke:1.5}):t9.jsx(xT,{stroke:1.5})})})}),t9.jsx(r1,{side:"right",className:Z?"max-w-56":void 0,children:Z?YA:J??H})]})}var QJ=_(p(),1);var S8={};g5(S8,{createHandle:()=>jC,Viewport:()=>NC,Trigger:()=>_C,Title:()=>LC,Root:()=>WC,Portal:()=>$C,Popup:()=>oT,Handle:()=>ZX,Description:()=>lT,Close:()=>cT,Backdrop:()=>uT});var mT=_(p(),1);var az=_(p(),1),WA=az.createContext(void 0);function A4($){let Z=az.useContext(WA);if(!$&&Z===void 0)throw Error(g0(27));return Z}var uT=mT.forwardRef(function(Z,H){let{render:J,className:B,style:Q,forceRender:z=!1,...X}=Z,G=A4(),U=G.useState("open"),K=G.useState("nested"),F=G.useState("mounted"),Y=G.useState("transitionStatus");return F0("div",Z,{state:{open:U,transitionStatus:Y},ref:[G.context.backdropRef,H],stateAttributesMapping:y4,props:[{role:"presentation",hidden:!F,style:{userSelect:"none",WebkitUserSelect:"none"}},X],enabled:z||!K})});var pT=_(p(),1);var cT=pT.forwardRef(function(Z,H){let{render:J,className:B,style:Q,disabled:z=!1,nativeButton:X=!0,...G}=Z,U=A4(),K=U.useState("open"),{getButtonProps:F,buttonRef:Y}=R5({disabled:z,native:X}),W={disabled:z};function A(N){if(K)U.setOpen(!1,R0(K0.closePress,N.nativeEvent))}return F0("button",Z,{state:W,ref:[H,Y],props:[{onClick:A},G,F]})});var dT=_(p(),1);var lT=dT.forwardRef(function(Z,H){let{render:J,className:B,style:Q,id:z,...X}=Z,G=A4(),U=J1(z);return G.useSyncedValueWithCleanup("descriptionElementId",U),F0("p",Z,{ref:H,props:[{id:U},X]})});var aT=_(p(),1);var nz=_(p(),1),AA=nz.createContext(void 0);function oz(){let $=nz.useContext(AA);if($===void 0)throw Error(g0(26));return $}var NA="ArrowUp",VA="ArrowDown",LA="ArrowLeft",DA="ArrowRight",qA="Home",MA="End",PA="PageUp",_A="PageDown",e9=new Set([NA,VA,LA,DA,qA,MA]);var iT="--nested-dialogs";var oO0=d6.open,sO0=d6.closed,tO0=d6.startingStyle,eO0=d6.endingStyle;var rT="data-nested-dialog-open";var sz={...b2,...D2,nestedDialogOpen($){return $?{[rT]:""}:null}};var nT=_(r(),1),oT=aT.forwardRef(function(Z,H){let{render:J,className:B,style:Q,finalFocus:z,initialFocus:X,...G}=Z,U=A4(),K=U.useState("descriptionElementId"),F=U.useState("disablePointerDismissal"),Y=U.useState("floatingRootContext"),W=U.useState("popupProps"),A=U.useState("modal"),N=U.useState("mounted"),L=U.useState("nested"),V=U.useState("nestedOpenDialogCount"),D=U.useState("open"),q=U.useState("openMethod"),j=U.useState("titleElementId"),M=U.useState("transitionStatus"),P=U.useState("role"),T=Y.useState("floatingId");oz(),f5({open:D,ref:U.context.popupRef,onComplete(){if(D)U.context.onOpenChangeComplete?.(!0)}});let C=X===void 0?Xz(U.context.popupRef):X,k=V>0,E=U.useStateSetter("popupElement"),x=F0("div",Z,{state:{open:D,nested:L,transitionStatus:M,nestedDialogOpen:k},props:[W,{id:T,"aria-labelledby":j,"aria-describedby":K,role:P,...Z9,hidden:!N,onKeyDown(R){if(e9.has(R.key))R.stopPropagation()},style:{[iT]:V}},G],ref:[H,U.context.popupRef,E],stateAttributesMapping:sz});return nT.jsx($7,{context:Y,openInteractionType:q,disabled:!N,closeOnFocusOut:!F,initialFocus:C,returnFocus:z,modal:A!==!1,restoreFocus:"popup",children:x})});var eT=_(p(),1);var sT=_(p(),1),tT=_(r(),1),b$=sT.forwardRef(function(Z,H){let{cutout:J,...B}=Z,Q;if(J){let z=J.getBoundingClientRect();Q=`polygon(0% 0%,100% 0%,100% 100%,0% 100%,0% 0%,${z.left}px ${z.top}px,${z.left}px ${z.bottom}px,${z.right}px ${z.bottom}px,${z.right}px ${z.top}px,${z.left}px ${z.top}px)`}return tT.jsx("div",{ref:H,role:"presentation","data-base-ui-inert":"",...B,style:{position:"fixed",inset:0,userSelect:"none",WebkitUserSelect:"none",clipPath:Q}})});var tH=_(r(),1),$C=eT.forwardRef(function(Z,H){let{keepMounted:J=!1,...B}=Z,Q=A4(),z=Q.useState("mounted"),X=Q.useState("modal"),G=Q.useState("open");if(!(z||J))return null;return tH.jsx(AA.Provider,{value:J,children:tH.jsxs(o6,{ref:H,...B,children:[z&&X===!0&&tH.jsx(b$,{ref:Q.context.internalBackdropRef,inert:t8(!G)}),Z.children]})})});var FC=_(p(),1);var jA=_(p(),1);var ZC={},HC={},JC="";function tz($,Z){return cH($)?$:Z}function BC($,Z,H){return/hidden|clip/.test($.getComputedStyle(tz(Z,H)).overflowY)}function co($){if(typeof document>"u")return!1;let Z=f0($);return u1(Z).innerWidth-Z.documentElement.clientWidth>0}function lo($){if(!(typeof CSS<"u"&&CSS.supports&&CSS.supports("scrollbar-gutter","stable"))||typeof document>"u")return!1;let H=f0($),J=H.documentElement,B=H.body,Q=tz(J,B),z=Q.style.overflowY,X=J.style.scrollbarGutter;J.style.scrollbarGutter="stable",Q.style.overflowY="scroll";let G=Q.offsetWidth;Q.style.overflowY="hidden";let U=Q.offsetWidth;return Q.style.overflowY=z,J.style.scrollbarGutter=X,G===U}function io($){let Z=f0($),H=Z.documentElement,J=Z.body,B=tz(H,J),Q={overflowY:B.style.overflowY,overflowX:B.style.overflowX};return Object.assign(B.style,{overflowY:"hidden",overflowX:"hidden"}),()=>{Object.assign(B.style,Q)}}function ro($){let Z=f0($),H=Z.documentElement,J=Z.body,B=u1(H),Q=0,z=0,X=!1,G=j4.create();if(n1.engine.webkit&&(B.visualViewport?.scale??1)!==1)return()=>{};function U(){let W=B.getComputedStyle(H),A=B.getComputedStyle(J),V=(W.scrollbarGutter||"").includes("both-edges")?"stable both-edges":"stable";Q=H.scrollTop,z=H.scrollLeft,ZC={scrollbarGutter:H.style.scrollbarGutter,overflowY:H.style.overflowY,overflowX:H.style.overflowX},JC=H.style.scrollBehavior,HC={position:J.style.position,height:J.style.height,width:J.style.width,boxSizing:J.style.boxSizing,overflowY:J.style.overflowY,overflowX:J.style.overflowX,scrollBehavior:J.style.scrollBehavior};let D=H.scrollHeight>H.clientHeight,q=H.scrollWidth>H.clientWidth,j=W.overflowY==="scroll"||A.overflowY==="scroll",M=W.overflowX==="scroll"||A.overflowX==="scroll",P=Math.max(0,B.innerWidth-J.clientWidth),T=Math.max(0,B.innerHeight-J.clientHeight),C=parseFloat(A.marginTop)+parseFloat(A.marginBottom),k=parseFloat(A.marginLeft)+parseFloat(A.marginRight),E=tz(H,J);if(X=lo($),X){H.style.scrollbarGutter=V,E.style.overflowY="hidden",E.style.overflowX="hidden";return}if(Object.assign(H.style,{scrollbarGutter:V,overflowY:"hidden",overflowX:"hidden"}),D||j)H.style.overflowY="scroll";if(q||M)H.style.overflowX="scroll";Object.assign(J.style,{position:"relative",height:C||T?`calc(100dvh - ${C+T}px)`:"100dvh",width:k||P?`calc(100vw - ${k+P}px)`:"100vw",boxSizing:"border-box",overflowY:"hidden",overflowX:"hidden",scrollBehavior:"unset"}),J.scrollTop=Q,J.scrollLeft=z,H.setAttribute("data-base-ui-scroll-locked",""),H.style.scrollBehavior="unset"}function K(){if(Object.assign(H.style,ZC),Object.assign(J.style,HC),!X)H.scrollTop=Q,H.scrollLeft=z,H.removeAttribute("data-base-ui-scroll-locked"),H.style.scrollBehavior=JC}function F(){K(),G.request(U)}U();let Y=i0(B,"resize",F);return()=>{if(G.cancel(),K(),typeof B.removeEventListener==="function")Y()}}class QC{lockCount=0;restore=null;timeoutLock=v5.create();timeoutUnlock=v5.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 Z=f0($),H=Z.documentElement,J=Z.body,B=u1(H);if(BC(B,H,J)){let z=new B.MutationObserver(()=>{if(BC(B,H,J))return;z.disconnect(),this.restore=null,this.lock($)}),X={attributes:!0};z.observe(H,X),z.observe(J,X),this.restore=()=>z.disconnect();return}let Q=n1.os.ios||!co($);this.restore=Q?io($):ro($)}}var ao=new QC;function ez($=!0,Z=null){J0(()=>{if(!$)return;return ao.acquire(Z)},[$,Z])}function zC({store:$,parentContext:Z,isDrawer:H}){let J=$.useState("open"),B=$.useState("disablePointerDismissal"),Q=$.useState("modal"),z=$.useState("popupElement"),X=$.useState("floatingRootContext"),[G,U]=jA.useState(0),[K,F]=jA.useState(0),Y=G===0,W=j8(X,{outsidePressEvent(){if($.context.internalBackdropRef.current||$.context.backdropRef.current)return"intentional";return{mouse:Q==="trap-focus"?"sloppy":"intentional",touch:"sloppy"}},outsidePress(A){if(!$.context.outsidePressEnabledRef.current)return!1;if("button"in A&&A.button!==0)return!1;if("touches"in A){if(A.type==="touchend"){if(A.changedTouches.length!==1||A.touches.length!==0)return!1}else if(A.touches.length!==1)return!1}let N=P1(A);if(Y&&!B){if(Q){let L=$.context.internalBackdropRef.current,V=$.context.backdropRef.current;return L||V?L===N||V===N||k0(N,z)&&!N?.hasAttribute("data-base-ui-portal"):!0}return!0}return!1},escapeKey:Y});return ez(J&&Q===!0,z),$.useContextCallback("onNestedDialogOpen",(A,N)=>{U(A),F(N)}),J0(()=>{if(Z?.onNestedDialogOpen)if(J)Z.onNestedDialogOpen(G+1,K+(H?1:0));else Z.onNestedDialogOpen(0,0);return()=>{if(Z?.onNestedDialogOpen&&J)Z.onNestedDialogOpen(0,0)}},[H,J,G,K,Z]),z9($,{activeTriggerProps:W.reference,inactiveTriggerProps:W.trigger,popupProps:W.floating,nestedOpenDialogCount:G,nestedOpenDrawerCount:K}),null}var $X=_(p(),1);var XC={...G9,modal:($)=>$.modal,nested:($)=>$.nested,nestedOpenDialogCount:($)=>$.nestedOpenDialogCount,nestedOpenDrawerCount:($)=>$.nestedOpenDrawerCount,disablePointerDismissal:($)=>$.disablePointerDismissal,openMethod:($)=>$.openMethod,descriptionElementId:($)=>$.descriptionElementId,titleElementId:($)=>$.titleElementId,viewportElement:($)=>$.viewportElement,role:($)=>$.role};class OA extends _4{constructor($,Z,H){let J=new W4,B=UC($,J,Z,H);super(B,KC(J),XC)}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;this.state.floatingRootContext.dispatchOpenChange($,Z),this.update(H7(this.state,$,Z.trigger))}}function GC(){let $=new W4;return new w8(Object.freeze(UC(void 0,$)),Object.freeze(KC($)),XC)}function UC($,Z,H,J=!1){return{...X9(Z,H,J),modal:!0,disablePointerDismissal:!1,viewportElement:null,descriptionElementId:void 0,titleElementId:void 0,openMethod:null,nested:!1,nestedOpenDialogCount:0,nestedOpenDrawerCount:0,role:"dialog",...$}}function KC($){return{popupRef:$X.createRef(),backdropRef:$X.createRef(),internalBackdropRef:$X.createRef(),outsidePressEnabledRef:{current:!0},triggerElements:$,onOpenChange:void 0,onOpenChangeComplete:void 0}}var eH=_(r(),1);function YC($,Z){let{children:H,open:J,defaultOpen:B=!1,onOpenChange:Q,onOpenChangeComplete:z,disablePointerDismissal:X=!1,modal:G=!0,actionsRef:U,handle:K,triggerId:F,defaultTriggerId:Y=null}=Z,W=$==="drawer",A=$==="alert-dialog",N=A?!0:G,L=A||X,V=A?"alertdialog":"dialog",D=A4(!0),q=D!=null,j={modal:N,disablePointerDismissal:L,nested:q,role:V},M=O3((h,x)=>new OA({open:B,openProp:J,activeTriggerId:Y,triggerIdProp:F,...j},h,x),!0);M.useControlledProp("openProp",J),M.useControlledProp("triggerIdProp",F),M.useSyncedValues(j),M.useContextCallback("onOpenChange",Q),M.useContextCallback("onOpenChangeComplete",z);let P=M.useState("open"),T=M.useState("mounted"),C=M.useState("payload");Uz(M,P),B9(M);let{forceUnmount:k}=Q9(P,M);FC.useImperativeHandle(U,()=>({unmount:k,close:()=>M.setOpen(!1,R0(K0.imperativeAction))}),[k,M]);let E=P||T;return eH.jsxs(WA.Provider,{value:M,children:[K&&eH.jsx(H9,{handle:K,store:M}),E&&eH.jsx(zC,{store:M,parentContext:D?.context,isDrawer:W}),typeof H==="function"?H({payload:C}):H]})}var WC=D8(function(Z){return YC("dialog",Z)});var AC=_(p(),1);var NC=AC.forwardRef(function(Z,H){let{render:J,className:B,style:Q,children:z,...X}=Z,G=oz(),U=A4(),K=U.useState("open"),F=U.useState("nested"),Y=U.useState("transitionStatus"),W=U.useState("nestedOpenDialogCount"),A=U.useState("mounted"),N=U.useStateSetter("viewportElement"),L=W>0;return F0("div",Z,{enabled:G||A,state:{open:K,nested:F,transitionStatus:Y,nestedDialogOpen:L},ref:[H,N],stateAttributesMapping:sz,props:[{role:"presentation",hidden:!A,style:{pointerEvents:!K?"none":void 0},children:z},X]})});var VC=_(p(),1);var LC=VC.forwardRef(function(Z,H){let{render:J,className:B,style:Q,id:z,...X}=Z,G=A4(),U=J1(z);return G.useSyncedValueWithCleanup("titleElementId",U),F0("h2",Z,{ref:H,props:[{id:U},X]})});var PC=_(p(),1);var ZJ=_(p(),1);var $J=_(p(),1);function DC($){let Z=$J.useRef(""),H=$J.useCallback((B)=>{if(B.defaultPrevented)return;Z.current=B.pointerType,$(B,B.pointerType)},[$]);return{onClick:$J.useCallback((B)=>{if(B.detail===0){$(B,"keyboard");return}if("pointerType"in B)$(B,B.pointerType);else $(B,Z.current);Z.current=""},[$]),onPointerDown:H}}var qC=_(p(),1);function k3($,Z){let H=qC.useRef($),J=W0(Z);J0(()=>{if(H.current!==$)J(H.current);H.current=$},[$,J])}function HJ($,Z){let H=W0((Q,z)=>{if(!(typeof $==="function"?$():$))Z(z||(n1.os.ios?"touch":""))}),{onClick:J,onPointerDown:B}=DC(H);return ZJ.useMemo(()=>({onClick:J,onPointerDown:B}),[J,B])}function MC($){let[Z,H]=ZJ.useState(null),J=HJ($,H);return k3($,(B)=>{if(B&&!$)H(null)}),ZJ.useMemo(()=>({openMethod:Z,triggerProps:J}),[Z,J])}var _C=i8(function(Z,H){let{render:J,className:B,style:Q,disabled:z=!1,nativeButton:X=!0,id:G,payload:U,handle:K,...F}=Z,Y=A4(!0),A=U9(K)??Y;if(!A)throw Error(g0(79));let N=J1(G),L=A.useState("floatingRootContext"),V=A.useState("isOpenedByTrigger",N),D=A.useState("triggerPopupId",N),q=PC.useRef(null),{registerTrigger:j,isMountedByThisTrigger:M}=J9(N,q,A,{payload:U}),{getButtonProps:P,buttonRef:T}=R5({disabled:z,native:X}),C=r9(L),k=HJ(()=>A.select("open"),(x)=>{A.set("openMethod",x)}),E={disabled:z,open:V},h=A.useState("triggerProps",M);return F0("button",Z,{state:E,ref:[T,H,j,q],props:[C.reference,h,k,{[q$]:"",id:N,"aria-haspopup":"dialog","aria-expanded":V,"aria-controls":D},F,P],stateAttributesMapping:a8})});class ZX extends O8{constructor(){super(GC(),"Dialog",!1)}open($){this.openByTrigger($)}openWithPayload($){let Z=this.attachedStore;if(Z===null)return;Z.set("payload",$),Z.setOpen(!0,R0(K0.imperativeAction))}close(){this.closePopup()}get isOpen(){return this.attachedStore?.select("open")??!1}}function jC(){return new ZX}var u4=_(r(),1);function R3({...$}){return u4.jsx(S8.Root,{"data-slot":"dialog",...$})}function HX({...$}){return u4.jsx(S8.Trigger,{"data-slot":"dialog-trigger",...$})}function no({...$}){return u4.jsx(A9,{portal:S8.Portal,"data-slot":"dialog-portal",...$})}function G7({...$}){return u4.jsx(S8.Close,{"data-slot":"dialog-close",...$})}function oo({className:$,...Z}){return u4.jsx(S8.Backdrop,{"data-slot":"dialog-overlay",className:d1("fixed inset-0 isolate z-50 bg-black/10 duration-100 supports-backdrop-filter:backdrop-blur-xs data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0",$),...Z})}function y$({className:$,children:Z,showCloseButton:H=!0,...J}){return u4.jsxs(no,{children:[u4.jsx(oo,{}),u4.jsxs(S8.Popup,{"data-slot":"dialog-content",className:d1("fixed top-1/2 left-1/2 z-50 grid w-full max-w-[calc(100%-2rem)] -translate-x-1/2 -translate-y-1/2 gap-4 rounded-xl bg-popover p-6 text-sm text-popover-foreground shadow-xl duration-100 outline-none sm:max-w-sm 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,H&&u4.jsxs(G7,{render:u4.jsx(E0,{variant:"ghost",size:"icon-sm",className:"absolute top-4 right-4"}),children:[u4.jsx(b5,{stroke:1.75}),u4.jsx("span",{className:"sr-only",children:"Close"})]})]})]})}function b3({className:$,...Z}){return u4.jsx(S8.Title,{"data-slot":"dialog-title",className:d1("text-lg font-semibold",$),...Z})}function h$({className:$,...Z}){return u4.jsx(S8.Description,{"data-slot":"dialog-description",className:d1("text-sm text-muted-foreground *:[a]:underline *:[a]:underline-offset-3 *:[a]:hover:text-foreground",$),...Z})}var cC=_(p(),1);var VX={};g5(VX,{Validity:()=>uC,Root:()=>bC,Label:()=>hC,Item:()=>pC,Error:()=>xC,Description:()=>gC,Control:()=>fC});var N4=_(p(),1);var JX=_(p(),1);var OC="data-valid",TC="data-invalid";var U7={badInput:!1,customError:!1,patternMismatch:!1,rangeOverflow:!1,rangeUnderflow:!1,stepMismatch:!1,tooLong:!1,tooShort:!1,typeMismatch:!1,valid:null,valueMissing:!1},to={valid:null,touched:!1,dirty:!1,filled:!1,focused:!1},CC={disabled:!1,...to},p4={valid($){if($===null)return null;if($)return{[OC]:""};return{[TC]:""}}};var eo={invalid:void 0,name:void 0,validityData:{state:U7,errors:[],error:"",value:"",initialValue:null},setValidityData:K1,disabled:void 0,setTouched:K1,setDirty:K1,setFilled:K1,setFocused:K1,validationMode:"onSubmit",shouldValidateOnChange:()=>!1,state:CC,registerFieldControl:K1,validation:{getValidationProps:($,Z=_1)=>Z,inputRef:{current:null},registeredInputs:new Map,registerInput:K1,getInputControl:()=>null,commit:async()=>{},change:K1}},TA=JX.createContext(eo);function s5($=!0){let Z=JX.useContext(TA);if(Z.setValidityData===K1&&!$)throw Error(g0(28));return Z}var BX=_(p(),1),$s=BX.createContext(void 0);function wC($=!1){let Z=BX.useContext($s);if(!Z&&!$)throw Error(g0(86));return Z}var QX=_(p(),1);var Zs=QX.createContext({elementRef:{current:null},formRef:{current:{fields:new Map}},errors:{},clearErrors:K1,validationMode:"onSubmit",submitCountRef:{current:0}});function j2(){return QX.useContext(Zs)}var y3=_(p(),1);var zX=_(p(),1);var CA=zX.createContext({controlId:void 0,registerControlId:K1,resetControlId:K1,labelId:void 0,setLabelId:K1,messageIds:[],setMessageIds:K1,getDescriptionProps:($)=>$});function t5(){return zX.useContext(CA)}var EC=_(r(),1),XX=function(Z){let H=J1(),[J,B]=y3.useState(H),[Q,z]=y3.useState(),[X,G]=y3.useState([]),U=J===void 0?H:J,K=p1(()=>new Map),{messageIds:F}=t5(),Y=W0((L,V)=>{let D=K.current;if(V===void 0)D.delete(L);else D.set(L,V);B((q)=>{if(D.size===0)return q;let j;for(let M of D.values()){if(M===q)return q;if(j===void 0)j=M}return j})}),W=W0(()=>{if(K.current.size===0)B(H)}),A=y3.useCallback((L)=>{let V=L["aria-describedby"]?L["aria-describedby"].split(" "):[];return V.push(...F,...X),{...L,"aria-describedby":Array.from(new Set(V)).join(" ")||void 0}},[F,X]),N=y3.useMemo(()=>({controlId:U,registerControlId:Y,resetControlId:W,labelId:Q,setLabelId:z,messageIds:X,setMessageIds:G,getDescriptionProps:A}),[U,Y,W,Q,z,X,G,A]);return EC.jsx(CA.Provider,{value:N,children:Z.children})};var $3=_(p(),1);function K7($,Z){return{...$,state:{...$.state,valid:!Z&&$.state.valid}}}var wA=Object.keys(U7);function Hs($,Z){if($.matches(":disabled"))return!1;if(!Z||$.form===Z)return!0;return $.form===null&&!$.hasAttribute("form")}function SC($,Z){let H=null;for(let J of $.keys()){if(!Hs(J,Z))continue;if(!J.validity.valid)return J;H??=J}return H}function IC($){return{...U7,valid:!$,customError:$}}function EA($){return $&&$.validationMessage?[$.validationMessage]:[]}function kC($){let{elementRef:Z,formRef:H}=j2(),{setValidityData:J,validate:B,validityData:Q,validationDebounceTime:z,invalid:X,markedDirtyRef:G,state:U,shouldValidateOnChange:K,validationMode:F,registeredFieldIdRef:Y}=$,{controlId:W,getDescriptionProps:A}=t5(),N=a1(),L=$3.useRef(null),V=p1(()=>new Map).current,D=$3.useRef(0),q=$3.useRef(null),j=$3.useCallback((k,E)=>{return V.set(k,E),()=>{V.delete(k)}},[V]),M=W0(()=>{let k=SC(V,Z.current);return k&&V.get(k)?.controlRef.current||null}),P=W0(async(k,E=!1)=>{D.current+=1;let h=D.current;function x(d,t=X){let u=Y.current??W;if(u==null)return;let a=H.current.fields.get(u);if(!a)return;let n=K7(d,t);H.current.fields.set(u,{...a,validityData:n})}function R(d,t){let u=d.valid===!1?t:[];return{value:k,state:d,error:u[0]??"",errors:u,initialValue:Q.initialValue}}function w(d,t){let u=d.validity.customError?d.validationMessage:"",a=t.replace(/\r\n?/g,`
10
- `);d.setCustomValidity(a),q.current=[d,a,u]}function S(){let d=q.current;if(q.current=null,d&&(!d[0].willValidate||d[0].validationMessage===d[1]))d[0].setCustomValidity(d[2])}function I(d,t,u){let a=R(d,t);x(a,u),J(a)}function y(d){let t=wA.reduce((a,n)=>{return a[n]=d.validity[n],a},{}),u=!1;for(let a of wA){if(a==="valid")continue;if(a==="valueMissing"&&t[a])u=!0;else if(t[a])return t}if(u&&!G.current)t.valid=!0,t.valueMissing=!1;return t}function f(){return V.size>0?SC(V,Z.current):L.current}let g=f();function O(){return g=f(),g?.willValidate?y(g):IC(!1)}if(E){if(U.valid!==!1||!g)return;if(!g.validity.valueMissing){S();let d=f(),t=d?.validity.customError?EA(d):[];I(IC(t.length>0),t,!1);return}for(let d of wA)if(d!=="valid"&&d!=="valueMissing"&&d!=="customError"&&g.validity[d])return}N.clear(),S();let c=O(),o=EA(g),b=K();if(o.length===0||b){let d=Array.from(H.current.fields.values()).reduce((a,n)=>{if(n.name)a[n.name]=n.getValue();return a},{}),t=B(k,d),u;if(typeof t==="object"&&t!==null&&"then"in t){if(c.valid===!1)I(c,o);else if(F==="onSubmit"||!Q.state.customError)c.valid=null,I(c,o);if(u=await t,h!==D.current)return;c=O()}else u=t;if(o=u?[].concat(u).filter(Boolean):[],o.length>0){if(c.valid=!1,c.customError=!0,g?.willValidate)w(g,o.join(`
11
- `))}else o=EA(g)}I(c,o)}),T=W0((k,E=!1)=>{if(N.clear(),D.current+=1,E)return;let h=K();if(h&&k!==""&&z)N.start(z,()=>{P(k)});else P(k,!h)}),C=$3.useCallback((k,E={})=>m4(A(E),U.valid===!1&&!U.disabled&&!k?{"aria-invalid":!0}:_1),[A,U.disabled,U.valid]);return $3.useMemo(()=>({getValidationProps:C,inputRef:L,registeredInputs:V,registerInput:j,getInputControl:M,commit:P,change:T}),[C,V,j,M,P,T])}var GX=_(p(),1);function RC($){let{change:Z,commit:H,invalid:J,markedDirtyRef:B,name:Q,setRegisteredFieldName:z,registeredFieldIdRef:X,setValidityData:G,validityData:U}=$,{formRef:K}=j2(),F=GX.useRef(null),Y=GX.useRef(null),W=GX.useRef(!1),A=W0(()=>{let M=Y.current;if(!M)return;if(M.getValue)return M.getValue();return M.value});function N(M){return M.value===void 0?A():M.value}let L=W0(()=>{let M=Y.current;if(B.current=!0,!M){H(U.value);return}H(N(M))});function V(){let M=Y.current;if(!M||!M.id)return;K.current.fields.set(M.id,{getValue:A,name:Q??M.name,controlRef:M.controlRef,validityData:K7(U,J),validate:L})}function D(M=Y.current?.id){if(M)K.current.fields.delete(M)}function q(M){if(W.current)return;W.current=!0;let P=N(M);G((T)=>T.initialValue===P?T:{...T,initialValue:P})}J0(()=>{let M=Y.current;if(!M||!M.id)return;z(Q?void 0:M.name),K.current.fields.set(M.id,{getValue:A,name:Q??M.name,controlRef:M.controlRef,validityData:K7(U,J),validate:L})},[K,A,J,Q,z,L,U]),J0(()=>{let M=K.current.fields;return()=>{let P=Y.current?.id;if(P)M.delete(P)}},[K]);let j=W0((M,P)=>{if(!P){if(F.current===M)F.current=null,Z(void 0,!0),D(),Y.current=null,z(void 0),X.current=void 0;return}let T=Y.current?.id,C=F.current;if(C&&C!==M)Z(void 0,!0);if(F.current=M,Y.current=P,!Q)z(P.name);if(X.current=P.id,T&&T!==P.id)D(T);q(P),V()});return[L,j]}var UX=_(r(),1),Js=N4.forwardRef(function(Z,H){let{errors:J,validationMode:B,submitCountRef:Q}=j2(),{render:z,className:X,validate:G,validationDebounceTime:U=0,validationMode:K=B,name:F,disabled:Y=!1,invalid:W,dirty:A,touched:N,actionsRef:L,style:V,...D}=Z,q=wC(!0)?.disabled,j=W0(G||(()=>null)),M=q||Y,[P,T]=N4.useState(!1),[C,k]=N4.useState(!1),[E,h]=N4.useState(!1),[x,R]=N4.useState(!1),w=A??C,S=N??P,I=N4.useRef(w),y=N4.useRef(void 0),[f,g]=N4.useState(),O=F??f;J0(()=>{if(A!==void 0)I.current=A},[A]);let c=W0((X0)=>{if(A!==void 0)return;if(X0)I.current=!0;k(X0)}),o=W0((X0)=>{if(N!==void 0)return;T(X0)}),b=W0(()=>K==="onChange"||K==="onSubmit"&&Q.current>0),d=O&&Object.hasOwn(J,O)?J[O]:null,t=!!(Array.isArray(d)?d.length:d),u=W===!0||t,[a,n]=N4.useState({state:U7,error:"",errors:[],value:null,initialValue:null}),Q0=!u&&(M?null:a.state.valid),Z0=N4.useMemo(()=>({disabled:M,touched:S,dirty:w,valid:Q0,filled:E,focused:x}),[M,S,w,Q0,E,x]),U0=kC({setValidityData:n,validate:j,validityData:a,validationDebounceTime:U,invalid:u,markedDirtyRef:I,state:Z0,shouldValidateOnChange:b,validationMode:K,registeredFieldIdRef:y}),[B0,Y0]=RC({change:U0.change,commit:U0.commit,invalid:u,markedDirtyRef:I,name:F,setRegisteredFieldName:g,registeredFieldIdRef:y,setValidityData:n,validityData:a});N4.useImperativeHandle(L,()=>({validate:B0}),[B0]);let A0=N4.useMemo(()=>({invalid:u,name:O,validityData:a,setValidityData:n,disabled:M,setTouched:o,setDirty:c,setFilled:h,setFocused:R,validationMode:K,shouldValidateOnChange:b,state:Z0,registerFieldControl:Y0,validation:U0}),[u,O,a,M,o,c,h,R,K,b,Z0,Y0,U0]),D0=F0("div",Z,{ref:H,state:Z0,props:D,stateAttributesMapping:p4});return UX.jsx(TA.Provider,{value:A0,children:D0})}),bC=N4.forwardRef(function(Z,H){return UX.jsx(XX,{children:UX.jsx(Js,{...Z,ref:H})})});var JJ=_(p(),1);function yC($,Z){let H=J1($);return J0(()=>{return Z(H),()=>{Z((J)=>J===H?void 0:J)}},[H,Z]),H}function KX($={}){let{id:Z,fallbackControlId:H,native:J=!1,setLabelId:B,focusControl:Q}=$,{controlId:z,setLabelId:X}=t5(),G=W0((W)=>{X(W),B?.(W)}),U=yC(Z,G),K=z??H;function F(W){if(Q){Q(W,K);return}if(!K)return;let A=f0(W.currentTarget).getElementById(K);if(C1(A))FX(A)}function Y(W){if(P1(W.nativeEvent)?.closest("button,input,select,textarea"))return;if(!W.defaultPrevented&&W.detail>1)W.preventDefault();if(J)return;F(W)}return J?{id:U,htmlFor:K,onMouseDown:Y}:{id:U,onClick:Y,onPointerDown(W){W.preventDefault()}}}function FX($){$.focus({focusVisible:!0})}var YX=_(p(),1),SA=YX.createContext({disabled:!1});function WX(){return YX.useContext(SA)}var hC=JJ.forwardRef(function(Z,H){let{render:J,className:B,style:Q,id:z,nativeLabel:X=!0,...G}=Z,U=s5(!1),K=WX(),{labelId:F}=t5(),Y={...U.state,disabled:U.disabled||K.disabled},W=JJ.useRef(null),A=KX({id:F??z,native:X});return F0("label",Z,{ref:[H,W],state:Y,props:[A,G],stateAttributesMapping:p4})});var F7=_(p(),1);var IA=_(r(),1),Bs={...p4,...D2},xC=F7.forwardRef(function(Z,H){let{render:J,id:B,className:Q,match:z,style:X,...G}=Z,U=J1(B),{validityData:K,state:F,name:Y}=s5(!1),{setMessageIds:W}=t5(),{errors:A}=j2(),N=Y&&Object.hasOwn(A,Y)?A[Y]:null,L=!!(Array.isArray(N)?N.length:N),V=typeof z==="string",D=!1;if(z===!0)D=!0;else if(F.disabled)D=!1;else if(V)D=Boolean(K.state[z]);else D=L||K.state.valid===!1;let{mounted:q,transitionStatus:j,setMounted:M}=$8(D);J0(()=>{if(!D||!U)return;return W((I)=>I.concat(U)),()=>{W((I)=>I.filter((y)=>y!==U))}},[D,U,W]);let P=F7.useRef(null),[T,C]=F7.useState(null),[k,E]=F7.useState(null),h=K.error;if(!V&&L)h=N;else if(K.errors.length>1)h=K.errors;let x=h;if(Array.isArray(h))x=h.length>1?IA.jsx("ul",{children:h.map((I)=>IA.jsx("li",{children:I},I))}):h[0];let R=Array.isArray(h)?JSON.stringify(h):h;if(D&&R!==k)E(R),C(x);f5({open:D,ref:P,onComplete(){if(!D)M(!1)}});let w={...F,transitionStatus:j},S=F0("div",Z,{ref:[H,P],state:w,props:[{id:U,children:D?x:T},G],stateAttributesMapping:Bs,enabled:q});if(!q)return null;return S});var vC=_(p(),1);var gC=vC.forwardRef(function(Z,H){let{render:J,id:B,className:Q,style:z,...X}=Z,G=J1(B),U=s5(!1),K=WX(),{setMessageIds:F}=t5(),Y={...U.state,disabled:U.disabled||K.disabled};return J0(()=>{if(!G)return;return F((A)=>A.concat(G)),()=>{F((A)=>A.filter((N)=>N!==G))}},[G,F]),F0("p",Z,{ref:H,state:Y,props:[{id:G},X],stateAttributesMapping:p4})});var AX=_(p(),1);var Y7=_(p(),1);function B8({controlled:$,default:Z,name:H,state:J="value"}){let{current:B}=Y7.useRef($!==void 0),[Q,z]=Y7.useState(Z),X=B&&$!==void 0?$:Q,G=Y7.useCallback((U)=>{if(!B)z(U)},[]);return[X,G]}function x$($,Z,H,J,B=!0,Q){let{registerFieldControl:z}=s5(),X=p1(()=>Symbol());J0(()=>{let G=X.current;if(!B){z(G,void 0);return}z(G,{controlRef:$,getValue:J,id:Z,name:Q,value:H})},[$,B,J,Z,Q,z,X,H]),J0(()=>{let G=X.current;return()=>{z(G,void 0)}},[z,X])}var kA=_(p(),1);function v$($={}){let{id:Z,enabled:H=!0}=$,{controlId:J,registerControlId:B,resetControlId:Q}=t5(),z=J1(),X=p1(()=>Symbol()),G=kA.useRef(!1),U=kA.useRef(!1),K=W0(()=>{if(!G.current||B===K1)return;G.current=!1,B(X.current,void 0)});return J0(()=>{if(!H||B===K1){K();return}let F;if(Z!==void 0)U.current=!0,F=Z;else if(U.current)F=z;else{Q();return}if(F===void 0){K();return}G.current=!0,B(X.current,F);return},[Z,H,B,Q,z,X,K]),J0(()=>{return K},[K]),(H?J:void 0)??Z??z}var fC=AX.forwardRef(function(Z,H){let{render:J,className:B,id:Q,name:z,value:X,disabled:G=!1,onValueChange:U,defaultValue:K,autoFocus:F=!1,style:Y,...W}=Z,{state:A,name:N,disabled:L,setTouched:V,setDirty:D,validityData:q,setFocused:j,setFilled:M,validationMode:P,validation:T}=s5(),{clearErrors:C,elementRef:k,submitCountRef:E}=j2(),h=L||G,x=N??z,R={...A,disabled:h},{labelId:w}=t5(),S=v$({id:Q}),[I]=B8({controlled:X,default:K,name:"FieldControl",state:"value"}),y=X!==void 0,f=y?I:void 0,g=f==null?void 0:String(f),O=W0(()=>T.inputRef.current?.value);x$(T.inputRef,S,g,O,!h,z),J0(()=>{let d=g??T.inputRef.current?.value;if(d!==void 0)M(d!=="")},[g,T.inputRef,M]),k3(g,()=>{if(g===void 0)return;C(x),D(g!==(q.initialValue??"")),T.change(g)});let c=AX.useRef(null),o=a1();return J0(()=>{if(F&&c.current===c1(f0(c.current)))j(!0)},[F,j]),F0("input",Z,{ref:[H,c],state:R,props:[{id:S,disabled:h,name:x,ref:T.inputRef,"aria-labelledby":w,autoFocus:F,...y?{value:f}:{defaultValue:K},onChange(d){let t=d.currentTarget.value,u=R0(K0.none,d.nativeEvent);if(U?.(t,u),y)return;if(D(t!==(q.initialValue??"")),M(t!==""),!d.nativeEvent.defaultPrevented&&!u.isCanceled)C(x),T.change(t)},onFocus(){j(!0)},onBlur(d){if(V(!0),j(!1),P==="onBlur"){let t=d.currentTarget.value;if(T.commit(t),y)queueMicrotask(()=>{let u=T.inputRef.current?.value;if(u!==void 0&&u!==t&&u!==(q.initialValue??""))T.commit(u)})}},onKeyDown(d){if(d.currentTarget.tagName==="INPUT"&&d.key==="Enter"){V(!0);let t=d.currentTarget.value,u=d.currentTarget.form;if(u&&u===k.current&&!d.defaultPrevented){let a=d.currentTarget,n=E.current;o.start(0,()=>{if(E.current===n)T.commit(a.value)})}else T.commit(t)}}},W,(d)=>T.getValidationProps(h,d)],stateAttributesMapping:p4})});var BJ=_(p(),1);var mC=_(r(),1),uC=function(Z){let{children:H}=Z,{validityData:J,invalid:B}=s5(!1),Q=BJ.useMemo(()=>K7(J,B),[J,B]),z=Q.state.valid===!1,{transitionStatus:X}=$8(z),G=BJ.useMemo(()=>{return{...Q,validity:Q.state,transitionStatus:X}},[Q,X]);return mC.jsx(BJ.Fragment,{children:H(G)})};var NX=_(p(),1);var RA=_(r(),1),pC=NX.forwardRef(function(Z,H){let{render:J,className:B,style:Q,disabled:z=!1,...X}=Z,{state:G,disabled:U}=s5(!1),K=U||z,F={...G,disabled:K},Y=NX.useMemo(()=>({disabled:K}),[K]),W=F0("div",Z,{ref:H,state:F,props:X,stateAttributesMapping:p4});return RA.jsx(XX,{children:RA.jsx(SA.Provider,{value:Y,children:W})})});var dC=_(r(),1),bA=cC.forwardRef(function(Z,H){return dC.jsx(VX.Control,{ref:H,...Z})});var lC=_(r(),1);function h3({className:$,type:Z,...H}){return lC.jsx(bA,{type:Z,"data-slot":"input",className:d1("h-8 w-full min-w-0 rounded-lg border bg-transparent px-2.5 py-1 text-base 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",$),...H})}function iC($){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 g$=["claude-code","codex","openclaw","hermes"];var f$=_(p(),1);var LX="/claude-z2xnay0d.svg";var rC="/floppy-disk-wmjs0n85.webp";var DX="/hermes-pznd63x9.png";var qX="/openai-ep9ht2pq.svg";var MX="/openclaw-a2pyfhpn.svg";var X1=_(r(),1),tC="Set up the moi workspace for this project. Fetch https://moi.computer/INSTALL.md, and follow the steps.";function m$({trigger:$,open:Z,onOpenChange:H}){return X1.jsxs(R3,{open:Z,onOpenChange:H,children:[$&&X1.jsx(HX,{render:$}),X1.jsx(Ys,{})]})}var aC=2;function Ks({demoInstallUrl:$}){let Z=f$.useRef(null);return X1.jsx("div",{className:"relative min-h-56 overflow-hidden md:min-h-full",onMouseMove:(B)=>{if(!Z.current)return;let Q=B.currentTarget.getBoundingClientRect(),z=(B.clientX-Q.left)/Q.width-0.5,X=(B.clientY-Q.top)/Q.height-0.5;Z.current.style.setProperty("--floppy-x",`${z*-2*aC}px`),Z.current.style.setProperty("--floppy-y",`${X*-2*aC}px`)},onMouseLeave:()=>{Z.current?.style.removeProperty("--floppy-x"),Z.current?.style.removeProperty("--floppy-y")},children:X1.jsxs("a",{ref:Z,href:$,target:"_blank",rel:"noreferrer",className:"group absolute top-1/2 left-1/2 w-44 -translate-x-1/2 -translate-y-1/2 rotate-4 [transform:translate3d(var(--floppy-x,0px),var(--floppy-y,0px),0)] rounded-lg transition-transform duration-150 ease-out will-change-transform outline-none focus-visible:ring-3 focus-visible:ring-ring/50 motion-reduce:transform-none motion-reduce:transition-none md:w-40",children:[X1.jsx("img",{src:rC,alt:"",className:"w-full drop-shadow-xl"}),X1.jsxs("div",{className:W7({variant:"outline",className:"absolute -right-3 -bottom-2 -rotate-8"}),children:["About moi",X1.jsx(nC,{"data-icon":"inline-end",stroke:1.5})]})]})})}function Fs(){let[$,Z]=f$.useState(!1);return f$.useEffect(()=>{if(!$)return;let J=setTimeout(()=>Z(!1),1500);return()=>clearTimeout(J)},[$]),{copied:$,copy:()=>{navigator.clipboard?.writeText(tC).then(()=>Z(!0)).catch(()=>{})}}}function Ys(){let{demoInstallUrl:$}=N9(),{copied:Z,copy:H}=Fs();return X1.jsxs(y$,{"data-vivid":!0,showCloseButton:!1,className:"block w-full max-w-md overflow-hidden rounded-2xl bg-primary texture-checker-16 p-2 text-primary-foreground sm:max-w-md md:max-w-2xl",children:[X1.jsx("div",{className:"absolute inset-0 bg-[linear-gradient(to_right,color-mix(in_oklch,var(--background)_14%,transparent),color-mix(in_oklch,var(--background)_6%,transparent))]"}),X1.jsxs("svg",{className:"pointer-events-none absolute inset-0 size-full opacity-30 mix-blend-soft-light","aria-hidden":"true",children:[X1.jsx("filter",{id:"floppy-grain",children:X1.jsx("feTurbulence",{type:"fractalNoise",baseFrequency:"0.8",numOctaves:"2",stitchTiles:"stitch"})}),X1.jsx("rect",{width:"100%",height:"100%",filter:"url(#floppy-grain)"})]}),X1.jsxs("div",{className:"relative grid max-h-[calc(100dvh-2rem)] overflow-y-auto md:grid-cols-[3fr_2fr] md:overflow-visible",children:[X1.jsxs("div",{className:"rounded-xl bg-background p-6 text-foreground shadow-sm md:p-8",children:[X1.jsxs("div",{className:"flex flex-col gap-0.5",children:[X1.jsx(b3,{children:"Unlock all features"}),X1.jsx(h$,{className:"mt-1",children:"This is a demo version with sample workspaces. Install moi locally and connect to your agent."})]}),X1.jsxs("ul",{className:"mt-4 flex flex-col gap-3",children:[X1.jsxs("li",{className:"flex items-center gap-3",children:[X1.jsx(oC,{stroke:0.75,className:"mt-0.5 size-8 shrink-0 text-muted-foreground"}),X1.jsx("span",{className:"text-sm text-foreground",children:"Connect your own data sources and work on existing projects"})]}),X1.jsxs("li",{className:"flex items-center gap-3",children:[X1.jsx(sC,{stroke:0.75,className:"mt-0.5 size-8 shrink-0 text-muted-foreground"}),X1.jsxs("span",{className:"flex flex-wrap items-center gap-x-1 gap-y-0.5 text-sm text-foreground",children:[X1.jsx("span",{children:"Build with"}),X1.jsxs("span",{className:"inline-flex items-center gap-1 font-medium",children:[X1.jsx("img",{src:LX,alt:"",className:"size-3.5 object-contain"}),"Claude Code,"]}),X1.jsxs("span",{className:"inline-flex items-center gap-1 font-medium",children:[X1.jsx("img",{src:qX,alt:"",className:"size-3.5 object-contain"}),"Codex,"]}),X1.jsxs("span",{className:"inline-flex items-center gap-1 font-medium",children:[X1.jsx("img",{src:DX,alt:"",className:"size-3.5 object-contain"}),"Hermes,"]}),X1.jsxs("span",{className:"inline-flex items-center gap-1 font-medium",children:[X1.jsx("img",{src:MX,alt:"",className:"size-3.5 object-contain"}),"OpenClaw,"]}),X1.jsx("span",{children:"and more"})]})]})]}),X1.jsxs("div",{className:"mt-8 flex flex-col gap-3 pb-4",children:[X1.jsx("p",{className:"text-sm text-muted-foreground",children:"Give this prompt to your agent:"}),X1.jsxs("div",{className:"relative rounded-lg bg-muted p-4 pb-8 ring-1 ring-border",children:[X1.jsx("code",{className:"block font-mono text-sm leading-relaxed text-foreground",children:tC}),X1.jsxs(E0,{type:"button",onClick:H,className:"absolute right-4 -bottom-4",children:[Z?X1.jsx(x3,{"data-icon":"inline-start",stroke:1.5}):X1.jsx(PX,{"data-icon":"inline-start",stroke:1.5}),Z?"Copied":"Copy prompt"]})]})]})]}),X1.jsx(Ks,{demoInstallUrl:$})]}),X1.jsx(G7,{render:X1.jsx(E0,{variant:"outline",size:"icon","aria-label":"Close",className:"absolute top-4 right-4",children:X1.jsx(b5,{stroke:1.5})})})]})}var $w=_(p(),1);var yA=_(r(),1),I8={"claude-code":LX,openclaw:MX,codex:qX,hermes:DX},hA={"claude-code":"Claude Code",openclaw:"OpenClaw",codex:"Codex",hermes:"Hermes"};function eC({types:$}){let Z=$.map((H)=>hA[H]).join(", ");return yA.jsx("span",{role:"img","aria-label":Z,className:"inline-flex shrink-0 items-center -space-x-0.5",children:$.map((H)=>yA.jsx("img",{src:I8[H],alt:"",className:"size-4 shrink-0 rounded-full bg-muted ring-2 ring-muted"},H))})}function A7($){if("types"in $)return $.path.split("/").pop()||$.path;if($.name)return $.name;if($.type==="openclaw")return $.agentId??"OpenClaw agent";if($.type==="hermes")return $.agentId??"Hermes agent";return $.path.split("/").pop()||$.path}var $5=_(r(),1),Ws="Choose which agent moi will use to build your workspace",As={openclaw:"To connect an OpenClaw agent, run",hermes:"To connect a Hermes agent, run"},Ns={openclaw:"moi openclaw init",hermes:"moi hermes init"},Vs={"claude-code":"Anthropic",codex:"OpenAI",openclaw:"Open-source",hermes:"Nous Research"};function Ls({availability:$,detectedTypes:Z=[]}){return g$.map((H)=>{let J=$?.[H],B=J&&J.status!=="available"?J.reason:void 0,Q=!Z.includes(H)?As[H]:void 0,z=!Z.includes(H)?Ns[H]:void 0,X=B??Q;return{type:H,description:Vs[H],disabled:Boolean(X),...X?{disabledReason:X}:{},...!B&&z?{disabledCommand:z}:{}}})}function Ds($,Z){let H=$.find((J)=>J.type===Z);if(H&&!H.disabled)return H.type;return $.find((J)=>!J.disabled)?.type}function jX({title:$,selectedType:Z,detectedTypes:H,availability:J,isPending:B,errorMessage:Q,secondaryAction:z,primaryLabel:X,pendingLabel:G,onTypeChange:U,onSubmit:K}){let F=S5((L)=>L.hasSentMessageFromMoi),Y=Ls({availability:J,detectedTypes:H}),W=Ds(Y,Z),A=W!==Z,N=W==="claude-code"?"Tip: you can use your existing Claude subscription in moi":W==="codex"?"Tip: you can use your existing ChatGPT subscription in moi":void 0;return $w.useEffect(()=>{if(W&&A)U(W)},[U,W,A]),$5.jsxs("div",{className:"flex flex-col gap-5",children:[$5.jsxs("div",{className:"flex flex-col gap-0.5 pr-8",children:[$5.jsx(b3,{children:$}),$5.jsx(h$,{children:Ws})]}),$5.jsxs("div",{className:"flex flex-col gap-4",children:[$5.jsx(qs,{options:Y,selectedType:A?void 0:Z,onTypeChange:U}),!F&&N&&$5.jsx("p",{className:"text-sm text-muted-foreground",children:N})]}),Q&&$5.jsx("p",{role:"alert",className:"text-xs text-destructive",children:Q}),$5.jsxs("div",{className:"flex items-center justify-end gap-2",children:[z,$5.jsx(E0,{onClick:K,disabled:B||A,children:B&&G?G:X})]})]})}function qs({options:$,selectedType:Z,onTypeChange:H}){return $5.jsx("div",{role:"group","aria-label":"Agent",className:z0("grid gap-2",$.length>2?"grid-cols-4":"grid-cols-2"),children:$.map((J)=>$5.jsx(Ms,{option:J,selected:Z===J.type,onSelect:H},J.type))})}function Ms({option:$,selected:Z,onSelect:H}){let J=Boolean($.disabledReason),B=$5.jsxs("button",{type:"button",disabled:$.disabled&&!J,"aria-disabled":$.disabled||void 0,"aria-pressed":Z,onClick:(Q)=>{if($.disabled){Q.preventDefault();return}H($.type)},className:z0("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:[$5.jsxs("span",{className:"relative inline-flex",children:[$5.jsx(Ps,{type:$.type}),Z&&$5.jsx(_X,{size:16,stroke:1.75,"aria-hidden":"true",className:"absolute -top-1.5 -right-1.5"})]}),$5.jsxs("span",{className:"flex min-w-0 flex-col gap-0.5",children:[$5.jsx("span",{className:"text-sm font-medium text-foreground",children:hA[$.type]}),$5.jsx("span",{className:"text-xs leading-4 text-muted-foreground",children:$.description})]})]});if(!J)return B;return $5.jsxs(l1,{children:[$5.jsx(i1,{render:B}),$5.jsx(r1,{className:z0("max-w-64",$.disabledCommand&&"max-w-none leading-5"),children:$5.jsxs("span",{className:"text-center",children:[$.disabledReason,$.disabledCommand&&$5.jsxs($5.Fragment,{children:[$5.jsx("br",{}),$5.jsx("code",{className:"rounded-xs bg-accent px-1 py-0.5 font-mono whitespace-nowrap",children:$.disabledCommand})]})]})})]})}function Ps({type:$}){return $5.jsx("img",{src:I8[$],alt:"",className:"size-8 shrink-0"})}var Zw=_(r(),1);function OX({children:$,showCloseButton:Z=!0}){return Zw.jsx(y$,{showCloseButton:Z,className:"block w-[calc(100%-2rem)] max-w-xl overflow-hidden p-6 sm:max-w-xl",children:$})}var M5=_(r(),1),Hw=g$[0];function zJ({trigger:$}){let[,Z]=o2(),H=N9(),J=rz(),B=ST(),[Q,z]=QJ.useState(!1),[X,G]=QJ.useState("agent"),[U,K]=QJ.useState(Hw),[F,Y]=QJ.useState(""),W=F.trim(),A=W?iC(W):null,N=B.isPending;if(H.cloudDemo)return M5.jsx(m$,{trigger:$});function L(j){z(!1),Z(`/workspace/${j}`)}function V(){G("agent"),K(Hw),Y(""),B.reset()}function D(){B.reset(),G("name")}function q(){if(!W||A||N)return;B.reset(),B.mutate({name:W,type:U},{onSuccess:(j)=>L(j.id)})}return M5.jsxs(R3,{open:Q,onOpenChange:z,onOpenChangeComplete:(j)=>{if(!j)V()},children:[M5.jsx(HX,{render:$}),M5.jsx(OX,{children:X==="agent"?M5.jsx(jX,{title:"Create new workspace",selectedType:U,availability:J.data?.availability,isPending:!1,secondaryAction:M5.jsx(js,{}),primaryLabel:"Next",onTypeChange:K,onSubmit:D}):M5.jsx(_s,{name:F,validationError:A,requestError:B.error?.message,isPending:N,onNameChange:Y,onSubmit:q})})]})}function _s({name:$,validationError:Z,requestError:H,isPending:J,onNameChange:B,onSubmit:Q}){function z(X){X.preventDefault(),Q()}return M5.jsxs("form",{className:"flex flex-col gap-5",onSubmit:z,children:[M5.jsxs("div",{className:"flex flex-col gap-0.5 pr-8",children:[M5.jsx(b3,{children:"Create new workspace"}),M5.jsx(h$,{children:"Give it a short and recognizable name"})]}),M5.jsxs("div",{className:"flex flex-col gap-2",children:[M5.jsx("label",{htmlFor:"workspace-name",className:"sr-only",children:"Workspace name"}),M5.jsx(h3,{id:"workspace-name",value:$,onChange:(X)=>B(X.target.value),placeholder:"my-workspace",autoFocus:!0,"aria-invalid":Boolean(Z),"aria-describedby":Z?"workspace-name-error":void 0,autoComplete:"off",spellCheck:!1}),Z&&M5.jsx("p",{id:"workspace-name-error",role:"alert",className:"text-xs text-destructive",children:Z})]}),H&&M5.jsx("p",{role:"alert",className:"text-xs text-destructive",children:H}),M5.jsx("div",{className:"flex items-center justify-end gap-2",children:M5.jsx(E0,{type:"submit",disabled:!$.trim()||Boolean(Z)||J,children:J?"Creating…":"Create workspace"})})]})}function js(){return M5.jsxs(l1,{children:[M5.jsx(i1,{render:M5.jsx(E0,{variant:"secondary","aria-disabled":!0,onClick:(Z)=>Z.preventDefault(),className:"cursor-not-allowed opacity-50",children:"Use existing folder"})}),M5.jsx(r1,{className:"max-w-64",children:M5.jsxs("span",{className:"text-center",children:["Not supported yet — run"," ",M5.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 g3=_(p(),1);var L0=_(p(),1),q7=_(x2(),1);var e5=_(p(),1);var XJ=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function N7($){let Z=Object.prototype.toString.call($);return Z==="[object Window]"||Z==="[object global]"}function TX($){return"nodeType"in $}function c4($){var Z,H;if(!$)return window;if(N7($))return $;if(!TX($))return window;return(Z=(H=$.ownerDocument)==null?void 0:H.defaultView)!=null?Z:window}function CX($){let{Document:Z}=c4($);return $ instanceof Z}function p$($){if(N7($))return!1;return $ instanceof c4($).HTMLElement}function vA($){return $ instanceof c4($).SVGElement}function V7($){if(!$)return document;if(N7($))return $.document;if(!TX($))return document;if(CX($))return $;if(p$($)||vA($))return $.ownerDocument;return document}var V9=XJ?e5.useLayoutEffect:e5.useEffect;function GJ($){let Z=e5.useRef($);return V9(()=>{Z.current=$}),e5.useCallback(function(){for(var H=arguments.length,J=Array(H),B=0;B<H;B++)J[B]=arguments[B];return Z.current==null?void 0:Z.current(...J)},[])}function Bw(){let $=e5.useRef(null),Z=e5.useCallback((J,B)=>{$.current=setInterval(J,B)},[]),H=e5.useCallback(()=>{if($.current!==null)clearInterval($.current),$.current=null},[]);return[Z,H]}function c$($,Z){if(Z===void 0)Z=[$];let H=e5.useRef($);return V9(()=>{if(H.current!==$)H.current=$},Z),H}function d$($,Z){let H=e5.useRef();return e5.useMemo(()=>{let J=$(H.current);return H.current=J,J},[...Z])}function UJ($){let Z=GJ($),H=e5.useRef(null),J=e5.useCallback((B)=>{if(B!==H.current)Z==null||Z(B,H.current);H.current=B},[]);return[H,J]}function KJ($){let Z=e5.useRef();return e5.useEffect(()=>{Z.current=$},[$]),Z.current}var xA={};function FJ($,Z){return e5.useMemo(()=>{if(Z)return Z;let H=xA[$]==null?0:xA[$]+1;return xA[$]=H,$+"-"+H},[$,Z])}function Qw($){return function(Z){for(var H=arguments.length,J=Array(H>1?H-1:0),B=1;B<H;B++)J[B-1]=arguments[B];return J.reduce((Q,z)=>{let X=Object.entries(z);for(let[G,U]of X){let K=Q[G];if(K!=null)Q[G]=K+$*U}return Q},{...Z})}}var L7=Qw(1),YJ=Qw(-1);function Os($){return"clientX"in $&&"clientY"in $}function wX($){if(!$)return!1;let{KeyboardEvent:Z}=c4($.target);return Z&&$ instanceof Z}function Ts($){if(!$)return!1;let{TouchEvent:Z}=c4($.target);return Z&&$ instanceof Z}function WJ($){if(Ts($)){if($.touches&&$.touches.length){let{clientX:Z,clientY:H}=$.touches[0];return{x:Z,y:H}}else if($.changedTouches&&$.changedTouches.length){let{clientX:Z,clientY:H}=$.changedTouches[0];return{x:Z,y:H}}}if(Os($))return{x:$.clientX,y:$.clientY};return null}var u$=Object.freeze({Translate:{toString($){if(!$)return;let{x:Z,y:H}=$;return"translate3d("+(Z?Math.round(Z):0)+"px, "+(H?Math.round(H):0)+"px, 0)"}},Scale:{toString($){if(!$)return;let{scaleX:Z,scaleY:H}=$;return"scaleX("+Z+") scaleY("+H+")"}},Transform:{toString($){if(!$)return;return[u$.Translate.toString($),u$.Scale.toString($)].join(" ")}},Transition:{toString($){let{property:Z,duration:H,easing:J}=$;return Z+" "+H+"ms "+J}}}),Jw="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function zw($){if($.matches(Jw))return $;return $.querySelector(Jw)}var D7=_(p(),1),Cs={display:"none"};function Xw($){let{id:Z,value:H}=$;return D7.default.createElement("div",{id:Z,style:Cs},H)}function Gw($){let{id:Z,announcement:H,ariaLiveType:J="assertive"}=$,B={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 D7.default.createElement("div",{id:Z,style:B,role:"status","aria-live":J,"aria-atomic":!0},H)}function Uw(){let[$,Z]=D7.useState("");return{announce:D7.useCallback((J)=>{if(J!=null)Z(J)},[]),announcement:$}}var _w=L0.createContext(null);function ws($){let Z=L0.useContext(_w);L0.useEffect(()=>{if(!Z)throw Error("useDndMonitor must be used within a children of <DndContext>");return Z($)},[$,Z])}function Es(){let[$]=L0.useState(()=>new Set),Z=L0.useCallback((J)=>{return $.add(J),()=>$.delete(J)},[$]);return[L0.useCallback((J)=>{let{type:B,event:Q}=J;$.forEach((z)=>{var X;return(X=z[B])==null?void 0:X.call(z,Q)})},[$]),Z]}var Ss={draggable:`
12
- To pick up a draggable item, press the space bar.
13
- While dragging, use the arrow keys to move the item.
14
- Press space again to drop the item in its new position, or press escape to cancel.
15
- `},Is={onDragStart($){let{active:Z}=$;return"Picked up draggable item "+Z.id+"."},onDragOver($){let{active:Z,over:H}=$;if(H)return"Draggable item "+Z.id+" was moved over droppable area "+H.id+".";return"Draggable item "+Z.id+" is no longer over a droppable area."},onDragEnd($){let{active:Z,over:H}=$;if(H)return"Draggable item "+Z.id+" was dropped over droppable area "+H.id;return"Draggable item "+Z.id+" was dropped."},onDragCancel($){let{active:Z}=$;return"Dragging was cancelled. Draggable item "+Z.id+" was dropped."}};function ks($){let{announcements:Z=Is,container:H,hiddenTextDescribedById:J,screenReaderInstructions:B=Ss}=$,{announce:Q,announcement:z}=Uw(),X=FJ("DndLiveRegion"),[G,U]=L0.useState(!1);if(L0.useEffect(()=>{U(!0)},[]),ws(L0.useMemo(()=>({onDragStart(F){let{active:Y}=F;Q(Z.onDragStart({active:Y}))},onDragMove(F){let{active:Y,over:W}=F;if(Z.onDragMove)Q(Z.onDragMove({active:Y,over:W}))},onDragOver(F){let{active:Y,over:W}=F;Q(Z.onDragOver({active:Y,over:W}))},onDragEnd(F){let{active:Y,over:W}=F;Q(Z.onDragEnd({active:Y,over:W}))},onDragCancel(F){let{active:Y,over:W}=F;Q(Z.onDragCancel({active:Y,over:W}))}}),[Q,Z])),!G)return null;let K=L0.default.createElement(L0.default.Fragment,null,L0.default.createElement(Xw,{id:J,value:B.draggable}),L0.default.createElement(Gw,{id:X,announcement:z}));return H?q7.createPortal(K,H):K}var J4;(function($){$.DragStart="dragStart",$.DragMove="dragMove",$.DragEnd="dragEnd",$.DragCancel="dragCancel",$.DragOver="dragOver",$.RegisterDroppable="registerDroppable",$.SetDroppableDisabled="setDroppableDisabled",$.UnregisterDroppable="unregisterDroppable"})(J4||(J4={}));function SX(){}function dA($,Z){return L0.useMemo(()=>({sensor:$,options:Z!=null?Z:{}}),[$,Z])}function jw(){for(var $=arguments.length,Z=Array($),H=0;H<$;H++)Z[H]=arguments[H];return L0.useMemo(()=>[...Z].filter((J)=>J!=null),[...Z])}var k8=Object.freeze({x:0,y:0});function Rs($,Z){return Math.sqrt(Math.pow($.x-Z.x,2)+Math.pow($.y-Z.y,2))}function bs($,Z){let H=WJ($);if(!H)return"0 0";let J={x:(H.x-Z.left)/Z.width*100,y:(H.y-Z.top)/Z.height*100};return J.x+"% "+J.y+"%"}function ys($,Z){let{data:{value:H}}=$,{data:{value:J}}=Z;return H-J}function hs($,Z){let{data:{value:H}}=$,{data:{value:J}}=Z;return J-H}function xs($,Z){if(!$||$.length===0)return null;let[H]=$;return Z?H[Z]:H}function Kw($,Z,H){if(Z===void 0)Z=$.left;if(H===void 0)H=$.top;return{x:Z+$.width*0.5,y:H+$.height*0.5}}var Ow=($)=>{let{collisionRect:Z,droppableRects:H,droppableContainers:J}=$,B=Kw(Z,Z.left,Z.top),Q=[];for(let z of J){let{id:X}=z,G=H.get(X);if(G){let U=Rs(Kw(G),B);Q.push({id:X,data:{droppableContainer:z,value:U}})}}return Q.sort(ys)};function vs($,Z){let H=Math.max(Z.top,$.top),J=Math.max(Z.left,$.left),B=Math.min(Z.left+Z.width,$.left+$.width),Q=Math.min(Z.top+Z.height,$.top+$.height),z=B-J,X=Q-H;if(J<B&&H<Q){let G=Z.width*Z.height,U=$.width*$.height,K=z*X,F=K/(G+U-K);return Number(F.toFixed(4))}return 0}var gs=($)=>{let{collisionRect:Z,droppableRects:H,droppableContainers:J}=$,B=[];for(let Q of J){let{id:z}=Q,X=H.get(z);if(X){let G=vs(X,Z);if(G>0)B.push({id:z,data:{droppableContainer:Q,value:G}})}}return B.sort(hs)};function fs($,Z,H){return{...$,scaleX:Z&&H?Z.width/H.width:1,scaleY:Z&&H?Z.height/H.height:1}}function Tw($,Z){return $&&Z?{x:$.left-Z.left,y:$.top-Z.top}:k8}function ms($){return function(H){for(var J=arguments.length,B=Array(J>1?J-1:0),Q=1;Q<J;Q++)B[Q-1]=arguments[Q];return B.reduce((z,X)=>({...z,top:z.top+$*X.y,bottom:z.bottom+$*X.y,left:z.left+$*X.x,right:z.right+$*X.x}),{...H})}}var us=ms(1);function Cw($){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 ps($,Z,H){let J=Cw(Z);if(!J)return $;let{scaleX:B,scaleY:Q,x:z,y:X}=J,G=$.left-z-(1-B)*parseFloat(H),U=$.top-X-(1-Q)*parseFloat(H.slice(H.indexOf(" ")+1)),K=B?$.width/B:$.width,F=Q?$.height/Q:$.height;return{width:K,height:F,top:U,right:G+K,bottom:U+F,left:G}}var cs={ignoreTransform:!1};function VJ($,Z){if(Z===void 0)Z=cs;let H=$.getBoundingClientRect();if(Z.ignoreTransform){let{transform:U,transformOrigin:K}=c4($).getComputedStyle($);if(U)H=ps(H,U,K)}let{top:J,left:B,width:Q,height:z,bottom:X,right:G}=H;return{top:J,left:B,width:Q,height:z,bottom:X,right:G}}function Fw($){return VJ($,{ignoreTransform:!0})}function ds($){let{innerWidth:Z,innerHeight:H}=$;return{top:0,left:0,right:Z,bottom:H,width:Z,height:H}}function ls($,Z){if(Z===void 0)Z=c4($).getComputedStyle($);return Z.position==="fixed"}function is($,Z){if(Z===void 0)Z=c4($).getComputedStyle($);let H=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some((B)=>{let Q=Z[B];return typeof Q==="string"?H.test(Q):!1})}function lA($,Z){let H=[];function J(B){if(Z!=null&&H.length>=Z)return H;if(!B)return H;if(CX(B)&&B.scrollingElement!=null&&!H.includes(B.scrollingElement))return H.push(B.scrollingElement),H;if(!p$(B)||vA(B))return H;if(H.includes(B))return H;let Q=c4($).getComputedStyle(B);if(B!==$){if(is(B,Q))H.push(B)}if(ls(B,Q))return H;return J(B.parentNode)}if(!$)return H;return J($)}function ww($){let[Z]=lA($,1);return Z!=null?Z:null}function gA($){if(!XJ||!$)return null;if(N7($))return $;if(!TX($))return null;if(CX($)||$===V7($).scrollingElement)return window;if(p$($))return $;return null}function Ew($){if(N7($))return $.scrollX;return $.scrollLeft}function Sw($){if(N7($))return $.scrollY;return $.scrollTop}function uA($){return{x:Ew($),y:Sw($)}}var V4;(function($){$[$.Forward=1]="Forward",$[$.Backward=-1]="Backward"})(V4||(V4={}));function Iw($){if(!XJ||!$)return!1;return $===document.scrollingElement}function kw($){let Z={x:0,y:0},H=Iw($)?{height:window.innerHeight,width:window.innerWidth}:{height:$.clientHeight,width:$.clientWidth},J={x:$.scrollWidth-H.width,y:$.scrollHeight-H.height},B=$.scrollTop<=Z.y,Q=$.scrollLeft<=Z.x,z=$.scrollTop>=J.y,X=$.scrollLeft>=J.x;return{isTop:B,isLeft:Q,isBottom:z,isRight:X,maxScroll:J,minScroll:Z}}var rs={x:0.2,y:0.2};function as($,Z,H,J,B){let{top:Q,left:z,right:X,bottom:G}=H;if(J===void 0)J=10;if(B===void 0)B=rs;let{isTop:U,isBottom:K,isLeft:F,isRight:Y}=kw($),W={x:0,y:0},A={x:0,y:0},N={height:Z.height*B.y,width:Z.width*B.x};if(!U&&Q<=Z.top+N.height)W.y=V4.Backward,A.y=J*Math.abs((Z.top+N.height-Q)/N.height);else if(!K&&G>=Z.bottom-N.height)W.y=V4.Forward,A.y=J*Math.abs((Z.bottom-N.height-G)/N.height);if(!Y&&X>=Z.right-N.width)W.x=V4.Forward,A.x=J*Math.abs((Z.right-N.width-X)/N.width);else if(!F&&z<=Z.left+N.width)W.x=V4.Backward,A.x=J*Math.abs((Z.left+N.width-z)/N.width);return{direction:W,speed:A}}function ns($){if($===document.scrollingElement){let{innerWidth:Q,innerHeight:z}=window;return{top:0,left:0,right:Q,bottom:z,width:Q,height:z}}let{top:Z,left:H,right:J,bottom:B}=$.getBoundingClientRect();return{top:Z,left:H,right:J,bottom:B,width:$.clientWidth,height:$.clientHeight}}function Rw($){return $.reduce((Z,H)=>{return L7(Z,uA(H))},k8)}function os($){return $.reduce((Z,H)=>{return Z+Ew(H)},0)}function ss($){return $.reduce((Z,H)=>{return Z+Sw(H)},0)}function bw($,Z){if(Z===void 0)Z=VJ;if(!$)return;let{top:H,left:J,bottom:B,right:Q}=Z($);if(!ww($))return;if(B<=0||Q<=0||H>=window.innerHeight||J>=window.innerWidth)$.scrollIntoView({block:"center",inline:"center"})}var ts=[["x",["left","right"],os],["y",["top","bottom"],ss]];class kX{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 H=lA(Z),J=Rw(H);this.rect={...$},this.width=$.width,this.height=$.height;for(let[B,Q,z]of ts)for(let X of Q)Object.defineProperty(this,X,{get:()=>{let G=z(H),U=J[B]-G;return this.rect[X]+U},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class l${constructor($){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach((Z)=>{var H;return(H=this.target)==null?void 0:H.removeEventListener(...Z)})},this.target=$}add($,Z,H){var J;(J=this.target)==null||J.addEventListener($,Z,H),this.listeners.push([$,Z,H])}}function es($){let{EventTarget:Z}=c4($);return $ instanceof Z?$:V7($)}function fA($,Z){let H=Math.abs($.x),J=Math.abs($.y);if(typeof Z==="number")return Math.sqrt(H**2+J**2)>Z;if("x"in Z&&"y"in Z)return H>Z.x&&J>Z.y;if("x"in Z)return H>Z.x;if("y"in Z)return J>Z.y;return!1}var Q8;(function($){$.Click="click",$.DragStart="dragstart",$.Keydown="keydown",$.ContextMenu="contextmenu",$.Resize="resize",$.SelectionChange="selectionchange",$.VisibilityChange="visibilitychange"})(Q8||(Q8={}));function Yw($){$.preventDefault()}function $t($){$.stopPropagation()}var s1;(function($){$.Space="Space",$.Down="ArrowDown",$.Right="ArrowRight",$.Left="ArrowLeft",$.Up="ArrowUp",$.Esc="Escape",$.Enter="Enter",$.Tab="Tab"})(s1||(s1={}));var yw={start:[s1.Space,s1.Enter],cancel:[s1.Esc],end:[s1.Space,s1.Enter,s1.Tab]},Zt=($,Z)=>{let{currentCoordinates:H}=Z;switch($.code){case s1.Right:return{...H,x:H.x+25};case s1.Left:return{...H,x:H.x-25};case s1.Down:return{...H,y:H.y+25};case s1.Up:return{...H,y:H.y-25}}return};class LJ{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 l$(V7(Z)),this.windowListeners=new l$(c4(Z)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(Q8.Resize,this.handleCancel),this.windowListeners.add(Q8.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(Q8.Keydown,this.handleKeyDown))}handleStart(){let{activeNode:$,onStart:Z}=this.props,H=$.node.current;if(H)bw(H);Z(k8)}handleKeyDown($){if(wX($)){let{active:Z,context:H,options:J}=this.props,{keyboardCodes:B=yw,coordinateGetter:Q=Zt,scrollBehavior:z="smooth"}=J,{code:X}=$;if(B.end.includes(X)){this.handleEnd($);return}if(B.cancel.includes(X)){this.handleCancel($);return}let{collisionRect:G}=H.current,U=G?{x:G.left,y:G.top}:k8;if(!this.referenceCoordinates)this.referenceCoordinates=U;let K=Q($,{active:Z,context:H.current,currentCoordinates:U});if(K){let F=YJ(K,U),Y={x:0,y:0},{scrollableAncestors:W}=H.current;for(let A of W){let N=$.code,{isTop:L,isRight:V,isLeft:D,isBottom:q,maxScroll:j,minScroll:M}=kw(A),P=ns(A),T={x:Math.min(N===s1.Right?P.right-P.width/2:P.right,Math.max(N===s1.Right?P.left:P.left+P.width/2,K.x)),y:Math.min(N===s1.Down?P.bottom-P.height/2:P.bottom,Math.max(N===s1.Down?P.top:P.top+P.height/2,K.y))},C=N===s1.Right&&!V||N===s1.Left&&!D,k=N===s1.Down&&!q||N===s1.Up&&!L;if(C&&T.x!==K.x){let E=A.scrollLeft+F.x,h=N===s1.Right&&E<=j.x||N===s1.Left&&E>=M.x;if(h&&!F.y){A.scrollTo({left:E,behavior:z});return}if(h)Y.x=A.scrollLeft-E;else Y.x=N===s1.Right?A.scrollLeft-j.x:A.scrollLeft-M.x;if(Y.x)A.scrollBy({left:-Y.x,behavior:z});break}else if(k&&T.y!==K.y){let E=A.scrollTop+F.y,h=N===s1.Down&&E<=j.y||N===s1.Up&&E>=M.y;if(h&&!F.x){A.scrollTo({top:E,behavior:z});return}if(h)Y.y=A.scrollTop-E;else Y.y=N===s1.Down?A.scrollTop-j.y:A.scrollTop-M.y;if(Y.y)A.scrollBy({top:-Y.y,behavior:z});break}}this.handleMove($,L7(YJ(K,this.referenceCoordinates),Y))}}}handleMove($,Z){let{onMove:H}=this.props;$.preventDefault(),H(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()}}LJ.activators=[{eventName:"onKeyDown",handler:($,Z,H)=>{let{keyboardCodes:J=yw,onActivation:B}=Z,{active:Q}=H,{code:z}=$.nativeEvent;if(J.start.includes(z)){let X=Q.activatorNode.current;if(X&&$.target!==X)return!1;return $.preventDefault(),B==null||B({event:$.nativeEvent}),!0}return!1}}];function Ww($){return Boolean($&&"distance"in $)}function Aw($){return Boolean($&&"delay"in $)}class RX{constructor($,Z,H){var J;if(H===void 0)H=es($.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:B}=$,{target:Q}=B;this.props=$,this.events=Z,this.document=V7(Q),this.documentListeners=new l$(this.document),this.listeners=new l$(H),this.windowListeners=new l$(c4(Q)),this.initialCoordinates=(J=WJ(B))!=null?J:k8,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:H}}}=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(Q8.Resize,this.handleCancel),this.windowListeners.add(Q8.DragStart,Yw),this.windowListeners.add(Q8.VisibilityChange,this.handleCancel),this.windowListeners.add(Q8.ContextMenu,Yw),this.documentListeners.add(Q8.Keydown,this.handleKeydown),Z){if(H!=null&&H({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(Aw(Z)){this.timeoutId=setTimeout(this.handleStart,Z.delay),this.handlePending(Z);return}if(Ww(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:H,onPending:J}=this.props;J(H,$,this.initialCoordinates,Z)}handleStart(){let{initialCoordinates:$}=this,{onStart:Z}=this.props;if($)this.activated=!0,this.documentListeners.add(Q8.Click,$t,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(Q8.SelectionChange,this.removeTextSelection),Z($)}handleMove($){var Z;let{activated:H,initialCoordinates:J,props:B}=this,{onMove:Q,options:{activationConstraint:z}}=B;if(!J)return;let X=(Z=WJ($))!=null?Z:k8,G=YJ(J,X);if(!H&&z){if(Ww(z)){if(z.tolerance!=null&&fA(G,z.tolerance))return this.handleCancel();if(fA(G,z.distance))return this.handleStart()}if(Aw(z)){if(fA(G,z.tolerance))return this.handleCancel()}this.handlePending(z,G);return}if($.cancelable)$.preventDefault();Q(X)}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===s1.Esc)this.handleCancel()}removeTextSelection(){var $;($=this.document.getSelection())==null||$.removeAllRanges()}}var Ht={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class DJ extends RX{constructor($){let{event:Z}=$,H=V7(Z.target);super($,Ht,H)}}DJ.activators=[{eventName:"onPointerDown",handler:($,Z)=>{let{nativeEvent:H}=$,{onActivation:J}=Z;if(!H.isPrimary||H.button!==0)return!1;return J==null||J({event:H}),!0}}];var Jt={move:{name:"mousemove"},end:{name:"mouseup"}},pA;(function($){$[$.RightClick=2]="RightClick"})(pA||(pA={}));class hw extends RX{constructor($){super($,Jt,V7($.event.target))}}hw.activators=[{eventName:"onMouseDown",handler:($,Z)=>{let{nativeEvent:H}=$,{onActivation:J}=Z;if(H.button===pA.RightClick)return!1;return J==null||J({event:H}),!0}}];var mA={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};class xw extends RX{constructor($){super($,mA)}static setup(){return window.addEventListener(mA.move.name,$,{capture:!1,passive:!1}),function(){window.removeEventListener(mA.move.name,$)};function $(){}}}xw.activators=[{eventName:"onTouchStart",handler:($,Z)=>{let{nativeEvent:H}=$,{onActivation:J}=Z,{touches:B}=H;if(B.length>1)return!1;return J==null||J({event:H}),!0}}];var AJ;(function($){$[$.Pointer=0]="Pointer",$[$.DraggableRect=1]="DraggableRect"})(AJ||(AJ={}));var IX;(function($){$[$.TreeOrder=0]="TreeOrder",$[$.ReversedTreeOrder=1]="ReversedTreeOrder"})(IX||(IX={}));function Bt($){let{acceleration:Z,activator:H=AJ.Pointer,canScroll:J,draggingRect:B,enabled:Q,interval:z=5,order:X=IX.TreeOrder,pointerCoordinates:G,scrollableAncestors:U,scrollableAncestorRects:K,delta:F,threshold:Y}=$,W=zt({delta:F,disabled:!Q}),[A,N]=Bw(),L=L0.useRef({x:0,y:0}),V=L0.useRef({x:0,y:0}),D=L0.useMemo(()=>{switch(H){case AJ.Pointer:return G?{top:G.y,bottom:G.y,left:G.x,right:G.x}:null;case AJ.DraggableRect:return B}},[H,B,G]),q=L0.useRef(null),j=L0.useCallback(()=>{let P=q.current;if(!P)return;let T=L.current.x*V.current.x,C=L.current.y*V.current.y;P.scrollBy(T,C)},[]),M=L0.useMemo(()=>X===IX.TreeOrder?[...U].reverse():U,[X,U]);L0.useEffect(()=>{if(!Q||!U.length||!D){N();return}for(let P of M){if((J==null?void 0:J(P))===!1)continue;let T=U.indexOf(P),C=K[T];if(!C)continue;let{direction:k,speed:E}=as(P,C,D,Z,Y);for(let h of["x","y"])if(!W[h][k[h]])E[h]=0,k[h]=0;if(E.x>0||E.y>0){N(),q.current=P,A(j,z),L.current=E,V.current=k;return}}L.current={x:0,y:0},V.current={x:0,y:0},N()},[Z,j,J,N,Q,z,JSON.stringify(D),JSON.stringify(W),A,U,M,K,JSON.stringify(Y)])}var Qt={x:{[V4.Backward]:!1,[V4.Forward]:!1},y:{[V4.Backward]:!1,[V4.Forward]:!1}};function zt($){let{delta:Z,disabled:H}=$,J=KJ(Z);return d$((B)=>{if(H||!J||!B)return Qt;let Q={x:Math.sign(Z.x-J.x),y:Math.sign(Z.y-J.y)};return{x:{[V4.Backward]:B.x[V4.Backward]||Q.x===-1,[V4.Forward]:B.x[V4.Forward]||Q.x===1},y:{[V4.Backward]:B.y[V4.Backward]||Q.y===-1,[V4.Forward]:B.y[V4.Forward]||Q.y===1}}},[H,Z,J])}function Xt($,Z){let H=Z!=null?$.get(Z):void 0,J=H?H.node.current:null;return d$((B)=>{var Q;if(Z==null)return null;return(Q=J!=null?J:B)!=null?Q:null},[J,Z])}function Gt($,Z){return L0.useMemo(()=>$.reduce((H,J)=>{let{sensor:B}=J,Q=B.activators.map((z)=>({eventName:z.eventName,handler:Z(z.handler,J)}));return[...H,...Q]},[]),[$,Z])}var NJ;(function($){$[$.Always=0]="Always",$[$.BeforeDragging=1]="BeforeDragging",$[$.WhileDragging=2]="WhileDragging"})(NJ||(NJ={}));var cA;(function($){$.Optimized="optimized"})(cA||(cA={}));var Nw=new Map;function Ut($,Z){let{dragging:H,dependencies:J,config:B}=Z,[Q,z]=L0.useState(null),{frequency:X,measure:G,strategy:U}=B,K=L0.useRef($),F=L(),Y=c$(F),W=L0.useCallback(function(V){if(V===void 0)V=[];if(Y.current)return;z((D)=>{if(D===null)return V;return D.concat(V.filter((q)=>!D.includes(q)))})},[Y]),A=L0.useRef(null),N=d$((V)=>{if(F&&!H)return Nw;if(!V||V===Nw||K.current!==$||Q!=null){let D=new Map;for(let q of $){if(!q)continue;if(Q&&Q.length>0&&!Q.includes(q.id)&&q.rect.current){D.set(q.id,q.rect.current);continue}let j=q.node.current,M=j?new kX(G(j),j):null;if(q.rect.current=M,M)D.set(q.id,M)}return D}return V},[$,Q,H,F,G]);return L0.useEffect(()=>{K.current=$},[$]),L0.useEffect(()=>{if(F)return;W()},[H,F]),L0.useEffect(()=>{if(Q&&Q.length>0)z(null)},[JSON.stringify(Q)]),L0.useEffect(()=>{if(F||typeof X!=="number"||A.current!==null)return;A.current=setTimeout(()=>{W(),A.current=null},X)},[X,F,W,...J]),{droppableRects:N,measureDroppableContainers:W,measuringScheduled:Q!=null};function L(){switch(U){case NJ.Always:return!1;case NJ.BeforeDragging:return H;default:return!H}}}function iA($,Z){return d$((H)=>{if(!$)return null;if(H)return H;return typeof Z==="function"?Z($):$},[Z,$])}function Kt($,Z){return iA($,Z)}function Ft($){let{callback:Z,disabled:H}=$,J=GJ(Z),B=L0.useMemo(()=>{if(H||typeof window>"u"||typeof window.MutationObserver>"u")return;let{MutationObserver:Q}=window;return new Q(J)},[J,H]);return L0.useEffect(()=>{return()=>B==null?void 0:B.disconnect()},[B]),B}function bX($){let{callback:Z,disabled:H}=$,J=GJ(Z),B=L0.useMemo(()=>{if(H||typeof window>"u"||typeof window.ResizeObserver>"u")return;let{ResizeObserver:Q}=window;return new Q(J)},[H]);return L0.useEffect(()=>{return()=>B==null?void 0:B.disconnect()},[B]),B}function Yt($){return new kX(VJ($),$)}function Vw($,Z,H){if(Z===void 0)Z=Yt;let[J,B]=L0.useState(null);function Q(){B((G)=>{if(!$)return null;if($.isConnected===!1){var U;return(U=G!=null?G:H)!=null?U:null}let K=Z($);if(JSON.stringify(G)===JSON.stringify(K))return G;return K})}let z=Ft({callback(G){if(!$)return;for(let U of G){let{type:K,target:F}=U;if(K==="childList"&&F instanceof HTMLElement&&F.contains($)){Q();break}}}}),X=bX({callback:Q});return V9(()=>{if(Q(),$)X==null||X.observe($),z==null||z.observe(document.body,{childList:!0,subtree:!0});else X==null||X.disconnect(),z==null||z.disconnect()},[$]),J}function Wt($){let Z=iA($);return Tw($,Z)}var Lw=[];function At($){let Z=L0.useRef($),H=d$((J)=>{if(!$)return Lw;if(J&&J!==Lw&&$&&Z.current&&$.parentNode===Z.current.parentNode)return J;return lA($)},[$]);return L0.useEffect(()=>{Z.current=$},[$]),H}function Nt($){let[Z,H]=L0.useState(null),J=L0.useRef($),B=L0.useCallback((Q)=>{let z=gA(Q.target);if(!z)return;H((X)=>{if(!X)return null;return X.set(z,uA(z)),new Map(X)})},[]);return L0.useEffect(()=>{let Q=J.current;if($!==Q){z(Q);let X=$.map((G)=>{let U=gA(G);if(U)return U.addEventListener("scroll",B,{passive:!0}),[U,uA(U)];return null}).filter((G)=>G!=null);H(X.length?new Map(X):null),J.current=$}return()=>{z($),z(Q)};function z(X){X.forEach((G)=>{let U=gA(G);U==null||U.removeEventListener("scroll",B)})}},[B,$]),L0.useMemo(()=>{if($.length)return Z?Array.from(Z.values()).reduce((Q,z)=>L7(Q,z),k8):Rw($);return k8},[$,Z])}function Dw($,Z){if(Z===void 0)Z=[];let H=L0.useRef(null);return L0.useEffect(()=>{H.current=null},Z),L0.useEffect(()=>{let J=$!==k8;if(J&&!H.current)H.current=$;if(!J&&H.current)H.current=null},[$]),H.current?YJ($,H.current):k8}function Vt($){L0.useEffect(()=>{if(!XJ)return;let Z=$.map((H)=>{let{sensor:J}=H;return J.setup==null?void 0:J.setup()});return()=>{for(let H of Z)H==null||H()}},$.map((Z)=>{let{sensor:H}=Z;return H}))}function Lt($,Z){return L0.useMemo(()=>{return $.reduce((H,J)=>{let{eventName:B,handler:Q}=J;return H[B]=(z)=>{Q(z,Z)},H},{})},[$,Z])}function vw($){return L0.useMemo(()=>$?ds($):null,[$])}var qw=[];function Dt($,Z){if(Z===void 0)Z=VJ;let[H]=$,J=vw(H?c4(H):null),[B,Q]=L0.useState(qw);function z(){Q(()=>{if(!$.length)return qw;return $.map((G)=>Iw(G)?J:new kX(Z(G),G))})}let X=bX({callback:z});return V9(()=>{X==null||X.disconnect(),z(),$.forEach((G)=>X==null?void 0:X.observe(G))},[$]),B}function gw($){if(!$)return null;if($.children.length>1)return $;let Z=$.children[0];return p$(Z)?Z:$}function qt($){let{measure:Z}=$,[H,J]=L0.useState(null),B=L0.useCallback((U)=>{for(let{target:K}of U)if(p$(K)){J((F)=>{let Y=Z(K);return F?{...F,width:Y.width,height:Y.height}:Y});break}},[Z]),Q=bX({callback:B}),z=L0.useCallback((U)=>{let K=gw(U);if(Q==null||Q.disconnect(),K)Q==null||Q.observe(K);J(K?Z(K):null)},[Z,Q]),[X,G]=UJ(z);return L0.useMemo(()=>({nodeRef:X,rect:H,setRef:G}),[H,X,G])}var Mt=[{sensor:DJ,options:{}},{sensor:LJ,options:{}}],Pt={current:{}},EX={draggable:{measure:Fw},droppable:{measure:Fw,strategy:NJ.WhileDragging,frequency:cA.Optimized},dragOverlay:{measure:VJ}};class i$ 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,H;return(Z=(H=this.get($))==null?void 0:H.node.current)!=null?Z:void 0}}var _t={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new i$,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:SX},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:EX,measureDroppableContainers:SX,windowRect:null,measuringScheduled:!1},fw={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:SX,draggableNodes:new Map,over:null,measureDroppableContainers:SX},qJ=L0.createContext(fw),mw=L0.createContext(_t);function jt(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new i$}}}function Ot($,Z){switch(Z.type){case J4.DragStart:return{...$,draggable:{...$.draggable,initialCoordinates:Z.initialCoordinates,active:Z.active}};case J4.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 J4.DragEnd:case J4.DragCancel:return{...$,draggable:{...$.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case J4.RegisterDroppable:{let{element:H}=Z,{id:J}=H,B=new i$($.droppable.containers);return B.set(J,H),{...$,droppable:{...$.droppable,containers:B}}}case J4.SetDroppableDisabled:{let{id:H,key:J,disabled:B}=Z,Q=$.droppable.containers.get(H);if(!Q||J!==Q.key)return $;let z=new i$($.droppable.containers);return z.set(H,{...Q,disabled:B}),{...$,droppable:{...$.droppable,containers:z}}}case J4.UnregisterDroppable:{let{id:H,key:J}=Z,B=$.droppable.containers.get(H);if(!B||J!==B.key)return $;let Q=new i$($.droppable.containers);return Q.delete(H),{...$,droppable:{...$.droppable,containers:Q}}}default:return $}}function Tt($){let{disabled:Z}=$,{active:H,activatorEvent:J,draggableNodes:B}=L0.useContext(qJ),Q=KJ(J),z=KJ(H==null?void 0:H.id);return L0.useEffect(()=>{if(Z)return;if(!J&&Q&&z!=null){if(!wX(Q))return;if(document.activeElement===Q.target)return;let X=B.get(z);if(!X)return;let{activatorNode:G,node:U}=X;if(!G.current&&!U.current)return;requestAnimationFrame(()=>{for(let K of[G.current,U.current]){if(!K)continue;let F=zw(K);if(F){F.focus();break}}})}},[J,Z,B,z,Q]),null}function uw($,Z){let{transform:H,...J}=Z;return $!=null&&$.length?$.reduce((B,Q)=>{return Q({transform:B,...J})},H):H}function Ct($){return L0.useMemo(()=>({draggable:{...EX.draggable,...$==null?void 0:$.draggable},droppable:{...EX.droppable,...$==null?void 0:$.droppable},dragOverlay:{...EX.dragOverlay,...$==null?void 0:$.dragOverlay}}),[$==null?void 0:$.draggable,$==null?void 0:$.droppable,$==null?void 0:$.dragOverlay])}function wt($){let{activeNode:Z,measure:H,initialRect:J,config:B=!0}=$,Q=L0.useRef(!1),{x:z,y:X}=typeof B==="boolean"?{x:B,y:B}:B;V9(()=>{if(!z&&!X||!Z){Q.current=!1;return}if(Q.current||!J)return;let U=Z==null?void 0:Z.node.current;if(!U||U.isConnected===!1)return;let K=H(U),F=Tw(K,J);if(!z)F.x=0;if(!X)F.y=0;if(Q.current=!0,Math.abs(F.x)>0||Math.abs(F.y)>0){let Y=ww(U);if(Y)Y.scrollBy({top:F.y,left:F.x})}},[Z,z,X,J,H])}var yX=L0.createContext({...k8,scaleX:1,scaleY:1}),v3;(function($){$[$.Uninitialized=0]="Uninitialized",$[$.Initializing=1]="Initializing",$[$.Initialized=2]="Initialized"})(v3||(v3={}));var pw=L0.memo(function(Z){var H,J,B,Q;let{id:z,accessibility:X,autoScroll:G=!0,children:U,sensors:K=Mt,collisionDetection:F=gs,measuring:Y,modifiers:W,...A}=Z,N=L0.useReducer(Ot,void 0,jt),[L,V]=N,[D,q]=Es(),[j,M]=L0.useState(v3.Uninitialized),P=j===v3.Initialized,{draggable:{active:T,nodes:C,translate:k},droppable:{containers:E}}=L,h=T!=null?C.get(T):null,x=L0.useRef({initial:null,translated:null}),R=L0.useMemo(()=>{var V0;return T!=null?{id:T,data:(V0=h==null?void 0:h.data)!=null?V0:Pt,rect:x}:null},[T,h]),w=L0.useRef(null),[S,I]=L0.useState(null),[y,f]=L0.useState(null),g=c$(A,Object.values(A)),O=FJ("DndDescribedBy",z),c=L0.useMemo(()=>E.getEnabled(),[E]),o=Ct(Y),{droppableRects:b,measureDroppableContainers:d,measuringScheduled:t}=Ut(c,{dragging:P,dependencies:[k.x,k.y],config:o.droppable}),u=Xt(C,T),a=L0.useMemo(()=>y?WJ(y):null,[y]),n=q0(),Q0=Kt(u,o.draggable.measure);wt({activeNode:T!=null?C.get(T):null,config:n.layoutShiftCompensation,initialRect:Q0,measure:o.draggable.measure});let Z0=Vw(u,o.draggable.measure,Q0),U0=Vw(u?u.parentElement:null),B0=L0.useRef({activatorEvent:null,active:null,activeNode:u,collisionRect:null,collisions:null,droppableRects:b,draggableNodes:C,draggingNode:null,draggingNodeRect:null,droppableContainers:E,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),Y0=E.getNodeFor((H=B0.current.over)==null?void 0:H.id),A0=qt({measure:o.dragOverlay.measure}),D0=(J=A0.nodeRef.current)!=null?J:u,X0=P?(B=A0.rect)!=null?B:Z0:null,i=Boolean(A0.nodeRef.current&&A0.rect),l=Wt(i?null:Z0),e=vw(D0?c4(D0):null),$0=At(P?Y0!=null?Y0:u:null),H0=Dt($0),O0=uw(W,{transform:{x:k.x-l.x,y:k.y-l.y,scaleX:1,scaleY:1},activatorEvent:y,active:R,activeNodeRect:Z0,containerNodeRect:U0,draggingNodeRect:X0,over:B0.current.over,overlayNodeRect:A0.rect,scrollableAncestors:$0,scrollableAncestorRects:H0,windowRect:e}),P0=a?L7(a,k):null,N0=Nt($0),M0=Dw(N0),v=Dw(N0,[Z0]),m=L7(O0,M0),s=X0?us(X0,O0):null,G0=R&&s?F({active:R,collisionRect:s,droppableRects:b,droppableContainers:c,pointerCoordinates:P0}):null,j0=xs(G0,"id"),[m0,v0]=L0.useState(null),T0=i?O0:L7(O0,v),p0=fs(T0,(Q=m0==null?void 0:m0.rect)!=null?Q:null,Z0),$1=L0.useRef(null),D1=L0.useCallback((V0,I0)=>{let{sensor:c0,options:d0}=I0;if(w.current==null)return;let B1=C.get(w.current);if(!B1)return;let Y1=V0.nativeEvent,Z1=new c0({active:w.current,activeNode:B1,event:Y1,options:d0,context:B0,onAbort(h0){if(!C.get(h0))return;let{onDragAbort:O1}=g.current,f1={id:h0};O1==null||O1(f1),D({type:"onDragAbort",event:f1})},onPending(h0,H1,O1,f1){if(!C.get(h0))return;let{onDragPending:n0}=g.current,l0={id:h0,constraint:H1,initialCoordinates:O1,offset:f1};n0==null||n0(l0),D({type:"onDragPending",event:l0})},onStart(h0){let H1=w.current;if(H1==null)return;let O1=C.get(H1);if(!O1)return;let{onDragStart:f1}=g.current,b0={activatorEvent:Y1,active:{id:H1,data:O1.data,rect:x}};q7.unstable_batchedUpdates(()=>{f1==null||f1(b0),M(v3.Initializing),V({type:J4.DragStart,initialCoordinates:h0,active:H1}),D({type:"onDragStart",event:b0}),I($1.current),f(Y1)})},onMove(h0){V({type:J4.DragMove,coordinates:h0})},onEnd:k1(J4.DragEnd),onCancel:k1(J4.DragCancel)});$1.current=Z1;function k1(h0){return async function(){let{active:O1,collisions:f1,over:b0,scrollAdjustedTranslate:n0}=B0.current,l0=null;if(O1&&n0){let{cancelDrop:V1}=g.current;if(l0={activatorEvent:Y1,active:O1,collisions:f1,delta:n0,over:b0},h0===J4.DragEnd&&typeof V1==="function"){if(await Promise.resolve(V1(l0)))h0=J4.DragCancel}}w.current=null,q7.unstable_batchedUpdates(()=>{V({type:h0}),M(v3.Uninitialized),v0(null),I(null),f(null),$1.current=null;let V1=h0===J4.DragEnd?"onDragEnd":"onDragCancel";if(l0){let b1=g.current[V1];b1==null||b1(l0),D({type:V1,event:l0})}})}}},[C]),u0=L0.useCallback((V0,I0)=>{return(c0,d0)=>{let B1=c0.nativeEvent,Y1=C.get(d0);if(w.current!==null||!Y1||B1.dndKit||B1.defaultPrevented)return;let Z1={active:Y1};if(V0(c0,I0.options,Z1)===!0)B1.dndKit={capturedBy:I0.sensor},w.current=d0,D1(c0,I0)}},[C,D1]),N1=Gt(K,u0);Vt(K),V9(()=>{if(Z0&&j===v3.Initializing)M(v3.Initialized)},[Z0,j]),L0.useEffect(()=>{let{onDragMove:V0}=g.current,{active:I0,activatorEvent:c0,collisions:d0,over:B1}=B0.current;if(!I0||!c0)return;let Y1={active:I0,activatorEvent:c0,collisions:d0,delta:{x:m.x,y:m.y},over:B1};q7.unstable_batchedUpdates(()=>{V0==null||V0(Y1),D({type:"onDragMove",event:Y1})})},[m.x,m.y]),L0.useEffect(()=>{let{active:V0,activatorEvent:I0,collisions:c0,droppableContainers:d0,scrollAdjustedTranslate:B1}=B0.current;if(!V0||w.current==null||!I0||!B1)return;let{onDragOver:Y1}=g.current,Z1=d0.get(j0),k1=Z1&&Z1.rect.current?{id:Z1.id,rect:Z1.rect.current,data:Z1.data,disabled:Z1.disabled}:null,h0={active:V0,activatorEvent:I0,collisions:c0,delta:{x:B1.x,y:B1.y},over:k1};q7.unstable_batchedUpdates(()=>{v0(k1),Y1==null||Y1(h0),D({type:"onDragOver",event:h0})})},[j0]),V9(()=>{B0.current={activatorEvent:y,active:R,activeNode:u,collisionRect:s,collisions:G0,droppableRects:b,draggableNodes:C,draggingNode:D0,draggingNodeRect:X0,droppableContainers:E,over:m0,scrollableAncestors:$0,scrollAdjustedTranslate:m},x.current={initial:X0,translated:s}},[R,u,G0,s,C,D0,X0,b,E,m0,$0,m]),Bt({...n,delta:k,draggingRect:s,pointerCoordinates:P0,scrollableAncestors:$0,scrollableAncestorRects:H0});let H5=L0.useMemo(()=>{return{active:R,activeNode:u,activeNodeRect:Z0,activatorEvent:y,collisions:G0,containerNodeRect:U0,dragOverlay:A0,draggableNodes:C,droppableContainers:E,droppableRects:b,over:m0,measureDroppableContainers:d,scrollableAncestors:$0,scrollableAncestorRects:H0,measuringConfiguration:o,measuringScheduled:t,windowRect:e}},[R,u,Z0,y,G0,U0,A0,C,E,b,m0,d,$0,H0,o,t,e]),M1=L0.useMemo(()=>{return{activatorEvent:y,activators:N1,active:R,activeNodeRect:Z0,ariaDescribedById:{draggable:O},dispatch:V,draggableNodes:C,over:m0,measureDroppableContainers:d}},[y,N1,R,Z0,V,O,C,m0,d]);return L0.default.createElement(_w.Provider,{value:q},L0.default.createElement(qJ.Provider,{value:M1},L0.default.createElement(mw.Provider,{value:H5},L0.default.createElement(yX.Provider,{value:p0},U)),L0.default.createElement(Tt,{disabled:(X==null?void 0:X.restoreFocus)===!1})),L0.default.createElement(ks,{...X,hiddenTextDescribedById:O}));function q0(){let V0=(S==null?void 0:S.autoScrollEnabled)===!1,I0=typeof G==="object"?G.enabled===!1:G===!1,c0=P&&!V0&&!I0;if(typeof G==="object")return{...G,enabled:c0};return{enabled:c0}}}),Et=L0.createContext(null),Mw="button",St="Draggable";function cw($){let{id:Z,data:H,disabled:J=!1,attributes:B}=$,Q=FJ(St),{activators:z,activatorEvent:X,active:G,activeNodeRect:U,ariaDescribedById:K,draggableNodes:F,over:Y}=L0.useContext(qJ),{role:W=Mw,roleDescription:A="draggable",tabIndex:N=0}=B!=null?B:{},L=(G==null?void 0:G.id)===Z,V=L0.useContext(L?yX:Et),[D,q]=UJ(),[j,M]=UJ(),P=Lt(z,Z),T=c$(H);V9(()=>{return F.set(Z,{id:Z,key:Q,node:D,activatorNode:j,data:T}),()=>{let k=F.get(Z);if(k&&k.key===Q)F.delete(Z)}},[F,Z]);let C=L0.useMemo(()=>({role:W,tabIndex:N,"aria-disabled":J,"aria-pressed":L&&W===Mw?!0:void 0,"aria-roledescription":A,"aria-describedby":K.draggable}),[J,W,N,L,A,K.draggable]);return{active:G,activatorEvent:X,activeNodeRect:U,attributes:C,isDragging:L,listeners:J?void 0:P,node:D,over:Y,setNodeRef:q,setActivatorNodeRef:M,transform:V}}function It(){return L0.useContext(mw)}var kt="Droppable",Rt={timeout:25};function dw($){let{data:Z,disabled:H=!1,id:J,resizeObserverConfig:B}=$,Q=FJ(kt),{active:z,dispatch:X,over:G,measureDroppableContainers:U}=L0.useContext(qJ),K=L0.useRef({disabled:H}),F=L0.useRef(!1),Y=L0.useRef(null),W=L0.useRef(null),{disabled:A,updateMeasurementsFor:N,timeout:L}={...Rt,...B},V=c$(N!=null?N:J),D=L0.useCallback(()=>{if(!F.current){F.current=!0;return}if(W.current!=null)clearTimeout(W.current);W.current=setTimeout(()=>{U(Array.isArray(V.current)?V.current:[V.current]),W.current=null},L)},[L]),q=bX({callback:D,disabled:A||!z}),j=L0.useCallback((C,k)=>{if(!q)return;if(k)q.unobserve(k),F.current=!1;if(C)q.observe(C)},[q]),[M,P]=UJ(j),T=c$(Z);return L0.useEffect(()=>{if(!q||!M.current)return;q.disconnect(),F.current=!1,q.observe(M.current)},[M,q]),L0.useEffect(()=>{return X({type:J4.RegisterDroppable,element:{id:J,key:Q,disabled:H,node:M,rect:Y,data:T}}),()=>X({type:J4.UnregisterDroppable,key:Q,id:J})},[J]),L0.useEffect(()=>{if(H!==K.current.disabled)X({type:J4.SetDroppableDisabled,id:J,key:Q,disabled:H}),K.current.disabled=H},[J,Q,H,X]),{active:z,rect:Y,isOver:(G==null?void 0:G.id)===J,node:M,over:G,setNodeRef:P}}function bt($){let{animation:Z,children:H}=$,[J,B]=L0.useState(null),[Q,z]=L0.useState(null),X=KJ(H);if(!H&&!J&&X)B(X);return V9(()=>{if(!Q)return;let G=J==null?void 0:J.key,U=J==null?void 0:J.props.id;if(G==null||U==null){B(null);return}Promise.resolve(Z(U,Q)).then(()=>{B(null)})},[Z,J,Q]),L0.default.createElement(L0.default.Fragment,null,H,J?L0.cloneElement(J,{ref:z}):null)}var yt={x:0,y:0,scaleX:1,scaleY:1};function ht($){let{children:Z}=$;return L0.default.createElement(qJ.Provider,{value:fw},L0.default.createElement(yX.Provider,{value:yt},Z))}var xt={position:"fixed",touchAction:"none"},vt=($)=>{return wX($)?"transform 250ms ease":void 0},gt=L0.forwardRef(($,Z)=>{let{as:H,activatorEvent:J,adjustScale:B,children:Q,className:z,rect:X,style:G,transform:U,transition:K=vt}=$;if(!X)return null;let F=B?U:{...U,scaleX:1,scaleY:1},Y={...xt,width:X.width,height:X.height,top:X.top,left:X.left,transform:u$.Transform.toString(F),transformOrigin:B&&J?bs(J,X):void 0,transition:typeof K==="function"?K(J):K,...G};return L0.default.createElement(H,{className:z,style:Y,ref:Z},Q)}),ft=($)=>(Z)=>{let{active:H,dragOverlay:J}=Z,B={},{styles:Q,className:z}=$;if(Q!=null&&Q.active)for(let[X,G]of Object.entries(Q.active)){if(G===void 0)continue;B[X]=H.node.style.getPropertyValue(X),H.node.style.setProperty(X,G)}if(Q!=null&&Q.dragOverlay)for(let[X,G]of Object.entries(Q.dragOverlay)){if(G===void 0)continue;J.node.style.setProperty(X,G)}if(z!=null&&z.active)H.node.classList.add(z.active);if(z!=null&&z.dragOverlay)J.node.classList.add(z.dragOverlay);return function(){for(let[G,U]of Object.entries(B))H.node.style.setProperty(G,U);if(z!=null&&z.active)H.node.classList.remove(z.active)}},mt=($)=>{let{transform:{initial:Z,final:H}}=$;return[{transform:u$.Transform.toString(Z)},{transform:u$.Transform.toString(H)}]},ut={duration:250,easing:"ease",keyframes:mt,sideEffects:ft({styles:{active:{opacity:"0"}}})};function pt($){let{config:Z,draggableNodes:H,droppableContainers:J,measuringConfiguration:B}=$;return GJ((Q,z)=>{if(Z===null)return;let X=H.get(Q);if(!X)return;let G=X.node.current;if(!G)return;let U=gw(z);if(!U)return;let{transform:K}=c4(z).getComputedStyle(z),F=Cw(K);if(!F)return;let Y=typeof Z==="function"?Z:ct(Z);return bw(G,B.draggable.measure),Y({active:{id:Q,data:X.data,node:G,rect:B.draggable.measure(G)},draggableNodes:H,dragOverlay:{node:z,rect:B.dragOverlay.measure(U)},droppableContainers:J,measuringConfiguration:B,transform:F})})}function ct($){let{duration:Z,easing:H,sideEffects:J,keyframes:B}={...ut,...$};return(Q)=>{let{active:z,dragOverlay:X,transform:G,...U}=Q;if(!Z)return;let K={x:X.rect.left-z.rect.left,y:X.rect.top-z.rect.top},F={scaleX:G.scaleX!==1?z.rect.width*G.scaleX/X.rect.width:1,scaleY:G.scaleY!==1?z.rect.height*G.scaleY/X.rect.height:1},Y={x:G.x-K.x,y:G.y-K.y,...F},W=B({...U,active:z,dragOverlay:X,transform:{initial:G,final:Y}}),[A]=W,N=W[W.length-1];if(JSON.stringify(A)===JSON.stringify(N))return;let L=J==null?void 0:J({active:z,dragOverlay:X,...U}),V=X.node.animate(W,{duration:Z,easing:H,fill:"forwards"});return new Promise((D)=>{V.onfinish=()=>{L==null||L(),D()}})}}var Pw=0;function dt($){return L0.useMemo(()=>{if($==null)return;return Pw++,Pw},[$])}var lw=L0.default.memo(($)=>{let{adjustScale:Z=!1,children:H,dropAnimation:J,style:B,transition:Q,modifiers:z,wrapperElement:X="div",className:G,zIndex:U=999}=$,{activatorEvent:K,active:F,activeNodeRect:Y,containerNodeRect:W,draggableNodes:A,droppableContainers:N,dragOverlay:L,over:V,measuringConfiguration:D,scrollableAncestors:q,scrollableAncestorRects:j,windowRect:M}=It(),P=L0.useContext(yX),T=dt(F==null?void 0:F.id),C=uw(z,{activatorEvent:K,active:F,activeNodeRect:Y,containerNodeRect:W,draggingNodeRect:L.rect,over:V,overlayNodeRect:L.rect,scrollableAncestors:q,scrollableAncestorRects:j,transform:P,windowRect:M}),k=iA(Y),E=pt({config:J,draggableNodes:A,droppableContainers:N,measuringConfiguration:D}),h=k?L.setRef:void 0;return L0.default.createElement(ht,null,L0.default.createElement(bt,{animation:E},F&&T?L0.default.createElement(gt,{key:T,id:F.id,ref:h,as:X,activatorEvent:K,adjustScale:Z,className:G,transition:Q,rect:k,style:{zIndex:U,...B},transform:C},H):null))});var M7=_(r(),1),lt={start:[s1.Space],cancel:[s1.Esc],end:[s1.Space,s1.Tab]};function it($,Z,H){let J=$.indexOf(Z),B=$.indexOf(H);if(J<0||B<0||J===B)return $;let Q=[...$],[z]=Q.splice(J,1);return Q.splice(B,0,z),Q}function hX({items:$,getId:Z,className:H,itemClassName:J,dragDisabled:B=!1,onReorder:Q,renderItem:z,renderPlaceholder:X,renderOverlay:G}){let U=jw(dA(DJ,{activationConstraint:{distance:4}}),dA(LJ,{keyboardCodes:lt})),[K,F]=g3.useState(null),[Y,W]=g3.useState(null),A=g3.useRef(null),N=g3.useMemo(()=>$.map(Z),[$,Z]),L=g3.useMemo(()=>new Map($.map((T)=>[Z(T),T])),[$,Z]),D=(K&&Y?Y:N).map((T)=>L.get(T)).filter((T)=>Boolean(T)),q=K?L.get(K):void 0,j=B||$.length<2;return M7.jsxs(pw,{sensors:U,collisionDetection:Ow,onDragStart:(T)=>{let C=$.map(Z);F(String(T.active.id)),A.current=C,W(C)},onDragOver:(T)=>{let C=String(T.active.id),k=T.over?String(T.over.id):void 0,E=A.current;if(!k||k===C||!E)return;let h=it(E,C,k);if(h===E)return;A.current=h,W(h)},onDragCancel:()=>{A.current=null,F(null),W(null)},onDragEnd:(T)=>{let C=String(T.active.id),k=A.current;if(A.current=null,F(null),W(null),!k||k.join("|")===N.join("|"))return;if(!k.includes(C))return;Q(k)},children:[M7.jsx("div",{className:H,children:D.map((T)=>M7.jsx(rt,{id:Z(T),item:T,disabled:j,itemClassName:J,renderItem:z,renderPlaceholder:X},Z(T)))}),M7.jsx(lw,{dropAnimation:null,children:q&&G?G(q):null})]})}function rt({id:$,item:Z,disabled:H,itemClassName:J,renderItem:B,renderPlaceholder:Q}){let{setNodeRef:z,isOver:X}=dw({id:$,disabled:H}),{attributes:G,listeners:U,setNodeRef:K,isDragging:F}=cw({id:$,disabled:H,attributes:{roleDescription:"sortable item"}}),Y=(A)=>{z(A),K(A)},W={isDragging:F,isOver:X,dragDisabled:H,dragHandleProps:H?{}:{...G,...U}};return M7.jsxs(Y5.div,{layout:!0,ref:Y,className:z0("relative",J?.(Z,W)),transition:{type:"spring",duration:0.25,bounce:0},children:[F&&Q?.(Z),B(Z,W)]})}var G1=_(r(),1),at="https://mlfrg.notion.site/3c678a44b6788042b734d775dd2e935e?pvs=105";function nt($){return z0(W7({variant:"ghost",size:"icon"}),$&&"bg-accent text-accent-foreground")}function xX({children:$,showWorkspaces:Z=!0}){let{data:H}=lz(),J=z1();return H4((B)=>{if(B.type==="workspace:updated"||B.type==="workspaces-list:updated")J.invalidateQueries({queryKey:S0.all,exact:!0})}),G1.jsxs("div",{className:"flex h-dvh bg-muted transition-colors duration-100 ease-out motion-reduce:transition-none",children:[G1.jsx(ot,{workspaces:Z?H??[]:[]}),G1.jsx("main",{className:"flex min-w-0 flex-1 flex-col",children:$})]})}function ot({workspaces:$}){let Z=IT();return G1.jsx(gz,{delay:500,children:G1.jsxs("aside",{className:"flex h-full shrink-0 flex-col items-center gap-4 px-2 py-5 [font-family:var(--default-sans)]",children:[G1.jsxs(l1,{children:[G1.jsx(i1,{render:G1.jsx(f6,{href:"/","aria-label":"Home",className:nt,children:G1.jsx(aw,{stroke:1.5})})}),G1.jsx(r1,{side:"right",children:"Home"})]}),G1.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&&G1.jsxs(G1.Fragment,{children:[G1.jsx("div",{className:"no-scrollbar min-h-0 scroll-fade overflow-y-auto [--scroll-fade-reveal:16px]",children:G1.jsx(hX,{items:$,getId:(H)=>H.id,className:"flex flex-col gap-4",onReorder:(H)=>Z.mutate(H),renderPlaceholder:()=>G1.jsx("div",{className:"pointer-events-none absolute top-0 left-1 size-10 rounded-xl bg-accent"}),renderOverlay:(H)=>G1.jsx(iw,{workspace:H,dragOverlay:!0}),renderItem:(H,J)=>G1.jsx(iw,{workspace:H,dragState:J})})}),G1.jsx("div",{className:"shrink-0",children:G1.jsxs(l1,{children:[G1.jsx(zJ,{trigger:G1.jsx(i1,{render:G1.jsx(E0,{type:"button",variant:"ghost",size:"icon-lg","aria-label":"Create new workspace",className:"text-muted-foreground hover:text-foreground",children:G1.jsx(O2,{"data-icon":"inline-start",stroke:1.5})})})}),G1.jsx(r1,{side:"right",children:"Create new workspace"})]})})]})}),G1.jsx("div",{className:"size-8 shrink-0",children:G1.jsx(st,{})})]})})}function st(){let{cloudDemo:$}=N9(),Z=gT();if($)return G1.jsx(m$,{trigger:G1.jsx(E0,{size:"icon","aria-label":"Unlock all features",title:"Unlock all features",children:G1.jsx(nw,{stroke:1.5})})});if(Z.status==="loading")return null;if(Z.status==="available")return G1.jsx(fT,{...Z.button});return G1.jsx(tt,{})}function tt(){return G1.jsxs(l1,{children:[G1.jsx(i1,{render:G1.jsx(E0,{render:G1.jsx("a",{href:at,target:"_blank",rel:"noreferrer"}),variant:"ghost",size:"icon","aria-label":"Leave feedback",className:"text-muted-foreground hover:text-foreground",children:G1.jsx(rw,{stroke:1.5})})}),G1.jsx(r1,{side:"right",children:"Leave feedback"})]})}function iw({workspace:$,dragOverlay:Z=!1,dragState:H}){let[J]=o2(),B=`/workspace/${$.id}`,Q=A7($),z=J===B||J.startsWith(`${B}/`),X=G1.jsx("div",{className:z0(W7({variant:"ghost",size:"icon-lg"}),"pointer-events-none size-12 transition-[border-radius,background-color,color] duration-100 ease-out motion-reduce:transition-none",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",z&&!Z&&"bg-accent text-accent-foreground"),children:G1.jsx("img",{src:$.icon??I8[$.type??"claude-code"],alt:"",className:"size-7 shrink-0 rounded-xs transition-[border-radius] duration-100 ease-out motion-reduce:transition-none"})}),G=G1.jsx("span",{className:"mt-0.5 line-clamp-2 w-full text-center text-[11px] leading-snug font-medium text-ellipsis text-foreground",children:Q});if(Z)return G1.jsxs("span",{className:"flex w-14 flex-col items-center",children:[X,G]});return G1.jsxs(f6,{href:B,"aria-label":Q,onClick:(U)=>{if(H?.isDragging)U.preventDefault()},className:z0("group flex w-14 flex-col items-center rounded-lg outline-none",H?.isDragging&&"invisible"),...H?.dragHandleProps,children:[X,G1.jsxs(l1,{children:[G1.jsx(i1,{render:G}),G1.jsx(r1,{side:"right",children:Q})]})]})}var wI=_(p(),1);var ow=_(p(),1);var P7=_(r(),1);function et({choice:$,availability:Z,isPending:H,errorMessage:J,onTypeChange:B,onSubmit:Q}){return P7.jsx(jX,{title:`Import ${A7($.workspace)}`,selectedType:$.selectedType,detectedTypes:$.workspace.types,availability:Z,isPending:H,errorMessage:J,secondaryAction:P7.jsx(G7,{render:P7.jsx(E0,{variant:"secondary"}),disabled:H,children:"Cancel"}),primaryLabel:"Add workspace",pendingLabel:"Adding…",onTypeChange:B,onSubmit:Q})}function sw({choice:$,availability:Z,isPending:H,errorMessage:J,onTypeChange:B,onSubmit:Q,onReset:z}){let[X,G]=ow.useState(!0);function U(F){if(!F&&H)return;G(F)}function K(F){if(!F)z()}return P7.jsx(R3,{open:X,onOpenChange:U,onOpenChangeComplete:K,children:P7.jsx(OX,{showCloseButton:!H,children:P7.jsx(et,{choice:$,availability:Z,isPending:H,errorMessage:J,onTypeChange:B,onSubmit:Q})})})}var tw=_(p(),1);function $e($){return $.types[0]??g$[0]}function ew({onSuccess:$}){let Z=ET(),[H,J]=tw.useState(null);function B(G){Z.reset(),J({workspace:G,selectedType:$e(G)})}function Q(G){J((U)=>U?{...U,selectedType:G}:U)}function z(){if(!H||Z.isPending)return;Z.mutate({path:H.workspace.path,type:H.selectedType},{onSuccess:$})}function X(){J(null),Z.reset()}return{choice:H,isPending:Z.isPending,error:Z.error,startImport:B,selectType:Q,submit:z,reset:X}}var PJ=_(p(),1);var _J=_(r(),1),Ze=[["OOOOO","O.O.O","O.O.O"],["OOO","O.O","OOO"],["O","O","O"]],f3=10,vX=3,He=2.5,Je={O:1,o:0.5,".":0},Be=3000,Qe=2,$E=3,m3=3,ZE=0.001,_7={courantSquared:0.14,damping:0.976,driveAmplitude:1.4,driveFrequency:0.027,gain:0.65,fadeIn:0.36,fadeOut:0.1};function ze($){let Z=Math.max(...$.map((Q)=>Q.length)),H=Z*f3+(Z-1)*vX,J=$.length*f3+($.length-1)*vX,B=[];return $.forEach((Q,z)=>{Array.from(Q).forEach((X,G)=>{let U=Je[X];if(U===void 0)return;let K=G*(f3+vX),F=z*(f3+vX);B.push({x:K,y:F,centerX:K+f3/2,centerY:F+f3/2,targetOpacity:U})})}),{width:H,height:J,fieldColumns:Math.round(H/m3)+1,fieldRows:Math.round(J/m3)+1,pixels:B}}var Xe=Ze.map(ze);function MJ($,Z,H){return $<Z?Z:$>H?H:$}function Ge($){return $<0.5?2*$*$:1-(-2*$+2)**2/2}class HE{rects;svg;geometry;animationFrame=0;running=!1;intro=!0;introStartedAt=-1;field;previousField;nextField;pointerActive=!1;pointerX=0;pointerY=0;activation=0;constructor($,Z,H){this.rects=$,this.svg=Z,this.geometry=H;let J=H.fieldColumns*H.fieldRows;this.field=new Float32Array(J),this.previousField=new Float32Array(J),this.nextField=new Float32Array(J)}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/m3),Z=Math.round(this.geometry.height/2/m3),H=2*$E*$E;for(let J=0;J<this.geometry.fieldRows;J++)for(let B=0;B<this.geometry.fieldColumns;B++){let Q=(B-$)**2+(J-Z)**2,z=Qe*Math.exp(-Q/H),X=J*this.geometry.fieldColumns+B;this.field[X]=z,this.previousField[X]=z}}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 H=($-this.introStartedAt)/Be;if(this.activation=1-Ge(Math.min(1,H)),H>=1)this.intro=!1}else{this.intro=!1;let H=this.pointerActive?1:0,J=this.pointerActive?_7.fadeIn:_7.fadeOut;this.activation+=(H-this.activation)*J}let Z=this.renderWave();if(this.intro||this.pointerActive||this.activation>ZE||Z>ZE){this.animationFrame=requestAnimationFrame(this.animate);return}this.running=!1,this.activation=0,this.renderTargets()};stepWave(){let{fieldColumns:$,fieldRows:Z}=this.geometry;for(let J=1;J<Z-1;J++)for(let B=1;B<$-1;B++){let Q=J*$+B,z=this.field[Q-1]+this.field[Q+1]+this.field[Q-$]+this.field[Q+$]-4*this.field[Q];this.nextField[Q]=(2*this.field[Q]-this.previousField[Q]+_7.courantSquared*z)*_7.damping}let H=this.previousField;this.previousField=this.field,this.field=this.nextField,this.nextField=H}driveWave($){let Z=MJ(Math.round(this.pointerX/m3),1,this.geometry.fieldColumns-2),H=MJ(Math.round(this.pointerY/m3),1,this.geometry.fieldRows-2);this.field[H*this.geometry.fieldColumns+Z]=_7.driveAmplitude*Math.sin($*_7.driveFrequency)}sampleField($,Z){let H=MJ($/m3,0,this.geometry.fieldColumns-1),J=MJ(Z/m3,0,this.geometry.fieldRows-1),B=Math.floor(H),Q=Math.floor(J),z=Math.min(B+1,this.geometry.fieldColumns-1),X=Math.min(Q+1,this.geometry.fieldRows-1),G=H-B,U=J-Q,{fieldColumns:K}=this.geometry,F=this.field[Q*K+B],Y=this.field[Q*K+z],W=this.field[X*K+B],A=this.field[X*K+z];return(F*(1-G)+Y*G)*(1-U)+(W*(1-G)+A*G)*U}renderWave(){let $=0;return this.geometry.pixels.forEach((Z,H)=>{let J=this.rects[H];if(!J)return;let B=this.sampleField(Z.centerX,Z.centerY);$=Math.max($,Math.abs(B));let Q=MJ(0.5+B*_7.gain,0,1),z=Z.targetOpacity*(1-this.activation)+Q*this.activation;J.setAttribute("opacity",z.toFixed(3))}),$}renderTargets(){this.geometry.pixels.forEach(($,Z)=>{this.rects[Z]?.setAttribute("opacity",String($.targetOpacity))})}}function Ue({geometry:$}){let Z=PJ.useRef([]),H=PJ.useRef(null);return PJ.useEffect(()=>{let J=H.current;if(!J||window.matchMedia("(prefers-reduced-motion: reduce)").matches)return;let B=new HE(Z.current,J,$);return B.start(),window.addEventListener("pointermove",B.handlePointerMove),()=>{B.stop(),window.removeEventListener("pointermove",B.handlePointerMove)}},[$]),_J.jsx("svg",{ref:H,className:"h-8 w-auto",viewBox:`0 0 ${$.width} ${$.height}`,fill:"currentColor","aria-hidden":"true",children:$.pixels.map((J,B)=>_J.jsx("rect",{ref:(Q)=>{Z.current[B]=Q},x:J.x,y:J.y,width:f3,height:f3,rx:He,opacity:J.targetOpacity},`${J.x}-${J.y}`))})}function JE({className:$}){return _J.jsx("div",{role:"img","aria-label":"moi",className:z0("flex items-center gap-2 text-accent",$),children:Xe.map((Z,H)=>_J.jsx(Ue,{geometry:Z},H))})}var fX=_(p(),1),j7=_(r(),1),Ke=($,Z)=>`mo-root${$==="always"?" mo-always":""}${Z?" mo-expr":""}`;function Fe($){let Z=(X)=>`${-Math.round(X)}ms`,H=(X)=>String(Math.round(X*100)/100),J=Math.round($.num("motion.blink",3500,6500)),B=Math.round($.num("motion.saccade",4200,7600)),Q=$.num("motion.lookX",1,2.2),z=$.num("motion.lookY",0.8,1.7);return{"--mo-phase":Z($.num("motion.phase",0,2800)),"--mo-bob-phase":Z($.num("motion.bob",0,3400)),"--mo-blink":`${J}ms`,"--mo-blink-phase":Z($.num("motion.blinkPhase",0,J)),"--mo-look-x":H(Q*($.bool("motion.lookXFlip")?-1:1)),"--mo-look-mx":H(Q),"--mo-look-y":H(z*($.bool("motion.lookYFlip")?-1:1)),"--mo-look-my":H(z),"--mo-saccade":`${B}ms`,"--mo-saccade-phase":Z($.num("motion.saccadePhase",0,B))}}function rA({l:$,c:Z,h:H}){let J=H*Math.PI/180,B=Z*Math.cos(J),Q=Z*Math.sin(J),z=$+0.3963377774*B+0.2158037573*Q,X=$-0.1055613458*B-0.0638541728*Q,G=$-0.0894841775*B-1.291485548*Q,U=z*z*z,K=X*X*X,F=G*G*G;return[4.0767416621*U-3.3077115913*K+0.2309699292*F,-1.2684380046*U+2.6097574011*K-0.3413193965*F,-0.0041960863*U-0.7034186147*K+1.707614701*F]}var BE=($)=>$.every((Z)=>Z>=-0.0001&&Z<=1.0001);function GE($){let Z=rA($);if(!BE(Z)){let H=0,J=$.c;for(let B=0;B<12;B++){let Q=(H+J)/2;if(BE(rA({...$,c:Q})))H=Q;else J=Q}Z=rA({...$,c:H})}return Z.map((H)=>Math.min(1,Math.max(0,H)))}function QE($){let[Z,H,J]=GE($);return 0.2126*Z+0.7152*H+0.0722*J}function gX($,Z){let H=QE($),J=QE(Z);return(Math.max(H,J)+0.05)/(Math.min(H,J)+0.05)}function UE($,Z,H){if(gX($,Z)>=H)return $;let J=$.l>=Z.l?1:-1;for(let z of[J,-J]){let X={...$};for(let G=0;G<60;G++){if(X.l=Math.min(1,Math.max(0,X.l+z*0.02)),gX(X,Z)>=H)return X;if(X.l===0||X.l===1)break}}let B={...$,l:0,c:0},Q={...$,l:1,c:0};return gX(B,Z)>=gX(Q,Z)?B:Q}function Ye($){return"#"+GE($).map((Z)=>{let H=Z<=0.0031308?12.92*Z:1.055*Math.pow(Z,0.4166666666666667)-0.055;return Math.round(H*255).toString(16).padStart(2,"0")}).join("")}var zE=[[0.2,{l:0.86,c:0.085}],[0.36,{l:0.9,c:0.028}],[0.62,{l:0.73,c:0.135}],[0.8,{l:0.62,c:0.165}],[0.93,{l:0.87,c:0.16}],[1,{l:0.34,c:0.035}]],We=($)=>zE.find(([Z])=>$<Z)?.[1]??zE[0][1],Ae={l:0.145,c:0,h:0},Ne=1.5,Ve=($,Z)=>{let H=We(Z),J=UE({l:H.l,c:H.c,h:$},Ae,Ne);return{bg:{l:0.965,c:0.01,h:$},head:J,eye:J.l>=0.5?{l:0.17,c:0.02,h:$}:{l:0.97,c:0.012,h:$}}},Le=[["head","bg",1.25],["eye","head",4.5]];function De($,Z=!0,H=0){let J=Ve($,H);if(Z)for(let[B,Q,z]of Le)J[B]=UE(J[B],J[Q],z);return J}function qe($,Z=!0,H=0){let J=De($,Z,H),B={};for(let Q in J)B[Q]=Ye(J[Q]);return B}var W5=($)=>{let Z=Math.round($*100)/100;return Object.is(Z,-0)?"0":String(Z)};function aA({cx:$,cy:Z,rx:H,ry:J,n:B=4,rot:Q=0}){let z=Math.min(1,(8*Math.pow(2,-1/B)-4)/3),X=H,G=J,U=X*z,K=G*z,F=[[X,0],[X,K],[U,G],[0,G],[-U,G],[-X,K],[-X,0],[-X,-K],[-U,-G],[0,-G],[U,-G],[X,-K],[X,0]],Y=Q*Math.PI/180,W=Math.cos(Y),A=Math.sin(Y),N=(V)=>{let[D,q]=F[V];return`${W5($+D*W-q*A)} ${W5(Z+D*A+q*W)}`},L=`M${N(0)}`;for(let V=1;V<13;V+=3)L+=`C${N(V)} ${N(V+1)} ${N(V+2)}`;return L+"Z"}function Me($,Z,H,J,B,Q=0){let z=B.length,X=Q*Math.PI/180,G=B.map((F,Y)=>{let W=X+2*Math.PI*Y/z;return[$+H*F*Math.cos(W),Z+J*F*Math.sin(W)]}),U=(F)=>G[(F%z+z)%z],K=`M${W5(U(0)[0])} ${W5(U(0)[1])}`;for(let F=0;F<z;F++){let[Y,W]=U(F-1),[A,N]=U(F),[L,V]=U(F+1),[D,q]=U(F+2);K+=`C${W5(A+(L-Y)/6)} ${W5(N+(V-W)/6)} ${W5(L-(D-A)/6)} ${W5(V-(q-N)/6)} ${W5(L)} ${W5(V)}`}return K+"Z"}function Pe({cx:$,cy:Z,rx:H,ry:J,sides:B,round:Q=0.3,rot:z=0}){let X=Q>0?Q<1?Q/2:0.5:0,G=z*Math.PI/180-Math.PI/2,U=Array.from({length:B},(W,A)=>{let N=G+2*Math.PI*A/B;return[$+H*Math.cos(N),Z+J*Math.sin(N)]}),K=(W)=>U[(W%B+B)%B],F=(W,A)=>{let[N,L]=K(W),[V,D]=K(A);return`${W5(N+(V-N)*X)} ${W5(L+(D-L)*X)}`},Y=`M${F(0,-1)}`;for(let W=0;W<B;W++){let[A,N]=K(W);if(Y+=`Q${W5(A)} ${W5(N)} ${F(W,W+1)}`,X<0.5)Y+=`L${F(W+1,W)}`}return Y+"Z"}function _e($,Z,H,J){let B=W5($-H),Q=W5($+H);return`M${B} ${W5(Z-J)}H${Q}V${W5(Z+J)}H${B}Z`}function je($,Z,H,J,B){let Q=Math.max(1.05,B),z=H*Math.sqrt(1-1/(Q*Q)),X=Z-J/Q,G=Z-Q*J,U=z*0.14,K=X+0.86*(G-X);return`M${W5($-z)} ${W5(X)}L${W5($-U)} ${W5(K)}Q${W5($)} ${W5(G)} ${W5($+U)} ${W5(K)}L${W5($+z)} ${W5(X)}Z`}function nA($,Z){for(let H=0;H<Z.length;H++)$=Math.imul($^Z[H],3432918353),$=$<<13|$>>>19;return $}function Oe($){return $=Math.imul($^$>>>16,2246822507),$=Math.imul($^$>>>13,3266489909),($^$>>>16)>>>0}var KE=new TextEncoder;function Te($){return $.normalize("NFC").trim().toLowerCase()}function Ce($,Z=!0){let H=Z?Te($):$;return nA(1779033703^H.length,KE.encode(H))}function XE($,Z){return Oe(nA(nA($,Uint8Array.of(255)),KE.encode(Z)))/4294967296}function we($,Z=!0,H){let J=Ce($,Z),B=(Q)=>{let z=H?.[Q],X=Array.isArray(z)?z[Math.floor(XE(J,Q)*z.length)]:z;return X===void 0?XE(J,Q):X>0?X<1?X:0.999999:0};return B.num=(Q,z,X)=>z+B(Q)*(X-z),B.int=(Q,z,X)=>z+Math.floor(B(Q)*(X-z+1)),B.pick=(Q,z)=>z[Math.floor(B(Q)*z.length)],B.bool=(Q,z=0.5)=>B(Q)<z,B.jitter=(Q,z)=>(B(Q)*2-1)*z,B}function FE($,Z,H){let J=Z.expression;if(H||!J)return{l:$,wrap:""};return J.bake($,J.p)}var Ee=($,Z)=>Z?.tint?Z.tint($,Z.p):$,YE=($,Z)=>Z?`<g transform="${Z}">${$}</g>`:$,Se=($)=>$.replace(/[&<>]/g,(Z)=>Z==="&"?"&amp;":Z==="<"?"&lt;":"&gt;");function WE($,Z){let H=we($,Z.normalize??!0,Z.traits);return{t:H,palette:{...qe(Z.hue??H.num("hue",0,360),Z.contrast??!0,Z.tone??H("tone")),...Z.palette}}}var Ie=($)=>$.title?`<title>${Se($.title)}</title>`:"";function AE($,Z,H){let J=Z.background??$.background;if(J===!1)return;return{d:J==="square"?"M0 0H100V100H0Z":aA({cx:50,cy:50,rx:50,ry:50,n:J==="circle"?2:6}),fill:H.bg}}var ke=($)=>$?`<path d="${$.d}" fill="${$.fill}"/>`:"";function Re($){return(Z,H={})=>{let{t:J,palette:B}=WE(Z,H),Q=Ee(B,H.expression),z=H.size?` width="${H.size}" height="${H.size}"`:"",X=FE($.layout(J),H),G=Ie(H)+ke(AE($,H,Q))+YE($.render(X.l,Q),X.wrap);return`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"${z}>${G}</svg>`}}function be($){return(Z,H={},J)=>{let{t:B,palette:Q}=WE(Z,H),z=J?.(B,Q),X=FE($.layout(B),H,z);return{cls:z?.cls,bg:AE($,H,Q),inner:YE($.render(X.l,Q,!!z),X.wrap),vars:z?.vars}}}var ye=($,Z,H)=>{let J=Z.rx,B=$.num("eye.rx",0.075,0.105)*J,Q=$.num("eye.ratio",1.9,3.2),z=$.num("eye.scale",0.78,1.24),X=$.num("eye.stretch",0.85,1.18),G=$.num("eye.gap",0.1,0.24)*J,U=B*Math.max(1,z),K=B*Q*Math.max(1,z*X),F=U+J*0.03+G,Y=$.jitter("gaze.x",0.09)*H.rx,W=$.num("gaze.y",-0.2,0.08)*H.ry,A=$.jitter("eye.dy",0.04)*H.ry,N=Math.hypot(U,K),L=Math.hypot((Math.abs(Y)+F+N)/H.rx,(Math.abs(W)+Math.abs(A)+N)/H.ry),V=L>0.9?0.9/L:1,D=B*V,q=D*Q,j=F*V,M=Math.max(0,Math.min(1,G/K)),P=Math.min(12,Math.asin(M)*180/Math.PI),T=$.num("eye.lean",-1,1)*P,C=Math.max(-12,Math.min(12,T+$.jitter("eye.lean2",3.5))),k=H.cx+Y*V,E=H.cy+W*V;return[{cx:k-j,cy:E,rx:D,ry:q,n:$.num("eye.n",3.5,6),rot:T},{cx:k+j,cy:E+A*V,rx:D*z,ry:q*z*X,n:$.num("eye.n",3.5,6),rot:C}]};function he($,Z){let H=(Q)=>($.find(([,z])=>Q<z)??$[$.length-1])[0];function J(Q){let z=H(Q("shape")),X=Q.num("body.r",31,38)*z.core,G={cx:50+Q.jitter("body.x",1.5),cy:50+Q.jitter("body.y",1.5),rx:X,ry:X*Q.num("body.ratio",0.92,1.08),n:Q.num("body.n",1.9,2.5),rot:0,radii:Array.from({length:Q.int("body.pts",6,8)},(F,Y)=>1+Q.jitter(`body.r${Y}`,0.16))};z.body?.(Q,G);let U=z.face?.(G)??G,K={petals:[],extra:[]};return z.decorate?.(Q,G,K),{shape:z.name,draw:z.path,body:G,face:U,petals:K.petals,extra:K.extra,eyes:Z(Q,G,U)}}function B(Q,z,X){let G=(F)=>Math.round(F*100)/100,U=(F,Y)=>{let W=`<path d="${aA(F)}"/>`;return X?`<g class="mo-eye" style="--mo-wrap:${Y?1:-1};--mo-lean:${G(F.rot)};transform-origin:${G(F.cx)}px ${G(F.cy)}px">${W}</g>`:W},K=`<g fill="${z.head}">`+Q.petals.map((F)=>`<circle cx="${G(F.cx)}" cy="${G(F.cy)}" r="${G(F.r)}"/>`).join("")+Q.extra.map((F)=>`<path d="${F}"/>`).join("")+`<path d="${Q.draw?Q.draw(Q.body):aA(Q.body)}"/></g><g fill="${z.eye}"${X?' class="mo-eyes"':""}>`+Q.eyes.map(U).join("")+"</g>";return X?`<g class="mo-breathe"><g class="mo-bob">${K}</g></g>`:K}return{layout:J,render:B,background:!1}}var NE=($)=>Pe($),VE=($)=>Me($.cx,$.cy,$.rx,$.ry,$.radii,$.rot),oA=($)=>(Z)=>({cx:Z.cx,cy:Z.cy,rx:Z.rx*$,ry:Z.ry*$}),LE=($)=>oA(Math.min(...$.radii)*0.95)($),xe=($)=>oA(0.84)($),ve={name:"round",core:1},ge={name:"organic",core:0.98,path:VE,face:LE},fe={name:"boxy",core:0.86,body:($,Z)=>{Z.n=$.num("body.n",3.4,6),Z.rot=$.num("body.rot",-20,20)}},me={name:"capsule",core:1.02,body:($,Z)=>{Z.ry*=$.num("capsule.squat",0.55,0.68)},face:oA(0.94),decorate:($,Z,H)=>{for(let J of[-1,1])H.petals.push({cx:Z.cx+J*(Z.rx-Z.ry),cy:Z.cy,r:Z.ry})},path:($)=>_e($.cx,$.cy,$.rx-$.ry,$.ry)},ue={name:"nub",core:0.88,decorate:($,Z,H)=>{let J=$.int("nub.n",1,2);for(let B=0;B<J;B++){let Q=$.num(`nub.a${B}`,0,2*Math.PI);H.petals.push({cx:Z.cx+Math.cos(Q)*Z.rx*0.88,cy:Z.cy+Math.sin(Q)*Z.rx*0.88,r:Z.rx*$.num(`nub.r${B}`,0.24,0.4)})}}},pe={name:"cloud",core:0.78,face:LE,path:VE,decorate:($,Z,H)=>{let J=$.int("cloud.n",4,6);for(let B=0;B<J;B++){let Q=Math.PI+Math.PI*(B+0.5)/J;H.petals.push({cx:Z.cx+Math.cos(Q)*Z.rx*0.8,cy:Z.cy+Math.sin(Q)*Z.rx*0.5,r:Z.rx*$.num(`cloud.r${B}`,0.44,0.62)})}}},ce={name:"droplet",core:0.78,body:($,Z)=>{Z.cy+=0.22*Z.ry,Z.n=2},face:($)=>({cx:$.cx,cy:$.cy+$.ry*0.05,rx:$.rx*0.88,ry:$.ry*0.88}),decorate:($,Z,H)=>{H.extra.push(je(Z.cx,Z.cy,Z.rx,Z.ry,$.num("droplet.tip",1.4,1.65)))}},de={name:"hexagon",core:1.05,path:NE,face:xe,body:($,Z)=>{Z.sides=6,Z.rot=$.num("body.rot",-12,12),Z.round=$.num("poly.round",0.24,0.5)}},le={name:"sun",core:0.7,decorate:($,Z,H)=>{let J=$.int("sun.n",6,9),B=Z.rx*$.num("sun.dist",1,1.08),Q=Z.rx*$.num("sun.r",0.2,0.26),z=$.num("sun.rot",0,2*Math.PI);for(let X=0;X<J;X++){let G=z+2*Math.PI*X/J;H.petals.push({cx:Z.cx+Math.cos(G)*B,cy:Z.cy+Math.sin(G)*B,r:Q})}}},ie={name:"triangle",core:1.15,path:NE,body:($,Z)=>{Z.sides=3,Z.rot=$.num("body.rot",-5,5),Z.round=$.num("poly.round",0.24,0.5)},face:($)=>({cx:$.cx,cy:$.cy+$.ry*0.1,rx:$.rx*0.54,ry:$.ry*0.36})},re=[[ve,0.22],[ge,0.48],[fe,0.6],[me,0.7],[ue,0.79],[pe,0.86],[ce,0.915],[de,0.95],[le,0.98],[ie,1]],DE=he(re,ye),ae=Re(DE),ne=($,Z)=>(H,J)=>{let B=Z?Z.vars(Z.p):{},Q=Z?.tint?Z.tint(J,Z.p):J;return{cls:Ke($,!!Object.keys(B).length||!!Z?.tint),vars:{...Fe(H),"--mo-head":Q.head,"--mo-eye":Q.eye,...B}}};function oe($,Z={}){return be(DE)($,Z,Z.animate&&ne(Z.animate,Z.expression))}function se($,Z){return"data:image/svg+xml,"+ae($,Z).replace(/"/g,"'").replace(/[%#<>{}|\\^[\]`]/g,(H)=>"%"+H.charCodeAt(0).toString(16).toUpperCase()).replace(/\s+/g," ")}function qE({name:$,size:Z,background:H,palette:J,hue:B,tone:Q,normalize:z,contrast:X,title:G,animate:U,expression:K,traits:F,...Y}){let W={size:Z,background:H,palette:J,hue:B,tone:Q,normalize:z,contrast:X,title:G,expression:K,traits:F},A=JSON.stringify([$,W,U]),N=fX.useMemo(()=>U?"":se($,W),[A]),L=fX.useMemo(()=>U?oe($,{...W,animate:U}):null,[A]),V=fX.useMemo(()=>({__html:L?.inner??""}),[L?.inner]);if(L){let{style:j,...M}=Y;return j7.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 100 100",width:Z,height:Z,role:G?"img":void 0,"aria-hidden":G?void 0:!0,style:{...L.vars,...j},...M,children:[G?j7.jsx("title",{children:G}):null,L.bg?j7.jsx("path",{d:L.bg.d,fill:L.bg.fill}):null,j7.jsx("g",{className:L.cls,dangerouslySetInnerHTML:V})]})}let{alt:D,...q}=Y;return j7.jsx("img",{src:N,width:Z,height:Z,alt:D??G??"",...q})}var ME=qE;function sA({l:$,c:Z,h:H}){let J=H*Math.PI/180,B=Z*Math.cos(J),Q=Z*Math.sin(J),z=$+0.3963377774*B+0.2158037573*Q,X=$-0.1055613458*B-0.0638541728*Q,G=$-0.0894841775*B-1.291485548*Q,U=z*z*z,K=X*X*X,F=G*G*G;return[4.0767416621*U-3.3077115913*K+0.2309699292*F,-1.2684380046*U+2.6097574011*K-0.3413193965*F,-0.0041960863*U-0.7034186147*K+1.707614701*F]}var PE=($)=>$.every((Z)=>Z>=-0.0001&&Z<=1.0001);function TE($){let Z=sA($);if(!PE(Z)){let H=0,J=$.c;for(let B=0;B<12;B++){let Q=(H+J)/2;if(PE(sA({...$,c:Q})))H=Q;else J=Q}Z=sA({...$,c:H})}return Z.map((H)=>Math.min(1,Math.max(0,H)))}function _E($){let[Z,H,J]=TE($);return 0.2126*Z+0.7152*H+0.0722*J}function jJ($,Z){let H=_E($),J=_E(Z);return(Math.max(H,J)+0.05)/(Math.min(H,J)+0.05)}function jE($,Z,H){if(jJ($,Z)>=H)return $;let J=$.l>=Z.l?1:-1;for(let z of[J,-J]){let X={...$};for(let G=0;G<60;G++){if(X.l=Math.min(1,Math.max(0,X.l+z*0.02)),jJ(X,Z)>=H)return X;if(X.l===0||X.l===1)break}}let B={...$,l:0,c:0},Q={...$,l:1,c:0};return jJ(B,Z)>=jJ(Q,Z)?B:Q}function mX($){return"#"+TE($).map((Z)=>{let H=Z<=0.0031308?12.92*Z:1.055*Math.pow(Z,0.4166666666666667)-0.055;return Math.round(H*255).toString(16).padStart(2,"0")}).join("")}function r$($){let Z=parseInt($.slice(1),16),[H,J,B]=[Z>>16&255,Z>>8&255,Z&255].map((K)=>{let F=K/255;return F<=0.04045?F/12.92:Math.pow((F+0.055)/1.055,2.4)}),Q=Math.cbrt(0.4122214708*H+0.5363325363*J+0.0514459929*B),z=Math.cbrt(0.2119034982*H+0.6806995451*J+0.1073969566*B),X=Math.cbrt(0.0883024619*H+0.2817188376*J+0.6299787005*B),G=1.9779984951*Q-2.428592205*z+0.4505937099*X,U=0.0259040371*Q+0.7827717662*z-0.808675766*X;return{l:0.2104542553*Q+0.793617785*z-0.0040720468*X,c:Math.hypot(G,U),h:Math.atan2(U,G)*180/Math.PI}}function te($,Z,H){let J=(K)=>K*Math.PI/180,B=$.c*Math.cos(J($.h)),Q=$.c*Math.sin(J($.h)),z=Z.c*Math.cos(J(Z.h)),X=Z.c*Math.sin(J(Z.h)),G=B+(z-B)*H,U=Q+(X-Q)*H;return{l:$.l+(Z.l-$.l)*H,c:Math.hypot(G,U),h:Math.atan2(U,G)*180/Math.PI}}var uX=($,Z,H)=>mX(te(r$($),r$(Z),H));var ee={h:12,l:0.84,pull:0.4,c:0.1};var OE=4.55;function $00($,Z,H){let J=r$($),B=r$(Z),Q={l:J.l+(H.l-J.l)*H.pull,c:Math.max(J.c,H.c),h:H.h};Q=jE(Q,Z00,H00);let z=jE(B,Q,OE),X=z.l>=Q.l?1:-1,G=mX(Q);for(let U=0;U<40;U++){let K=mX(z),F=1/0;for(let W=0;W<=10;W++){let A=W/10;F=Math.min(F,jJ(r$(uX(Z,K,A)),r$(uX($,G,A))))}if(F>=OE)return[G,K];let Y=Math.min(1,Math.max(0,z.l+X*0.02));if(Y===z.l)return[G,K];z={...z,l:Y}}return[G,mX(z)]}var Z00={l:0.145,c:0,h:0},H00=1.5;var tA={esx:1,esy:1,tilt:0,edy:0,edx:0,esx2:0,esy2:0,tilt2:0,edy2:0,lock:0,heat:0,shake:0,rock:0,bdy:0},CE=($)=>String(Math.round($*1000)/1000);function L9($){let Z={};for(let H in tA){if(H==="heat")continue;let J=$[H];if(J!==tA[H])Z["--mo-"+H]=CE(J)}return Z}function J00($,Z,H){let[J,B]=$00($.head,$.eye,H);return{...$,head:uX($.head,J,Z.heat),eye:uX($.eye,B,Z.heat)}}function D9($,Z){return{l:{...$,eyes:$.eyes.map((H,J)=>({...H,cx:H.cx+Z.edx*(J?1:-1),cy:H.cy+Z.edy+(J?Z.edy2:0),rx:H.rx*(Z.esx+(J?Z.esx2:0)),ry:H.ry*(Z.esy+(J?Z.esy2:0)),rot:H.rot*(1-Z.lock)+(Z.tilt+(J?Z.tilt2:0))*(J?1:-1)}))},wrap:Z.bdy!==0?`translate(0 ${CE(Z.bdy)})`:""}}var wE={p:tA,vars:L9,bake:D9},EE={p:{esx:1.72,esy:0.3,tilt:8,edy:-1.5,edx:1.5,esx2:0.08,esy2:0.05,tilt2:-16,edy2:0,lock:1,heat:0,shake:0,rock:0,bdy:-2.2},vars:L9,bake:D9},SE={p:{esx:0.6,esy:0.56,tilt:26,edy:3.6,edx:1.9,esx2:-0.05,esy2:-0.07,tilt2:-7,edy2:0,lock:1,heat:0,shake:0,rock:0,bdy:2.6},vars:L9,bake:D9};var IE={p:{esx:1.34,esy:1.2,tilt:-6,edy:-1.05,edx:0.5,esx2:0.05,esy2:0.07,tilt2:3,edy2:0,lock:1,heat:0,shake:0,rock:0,bdy:-1.4},vars:L9,bake:D9},kE={p:{esx:1.32,esy:0.76,tilt:5,edy:-0.6,edx:0.8,esx2:0.26,esy2:-0.56,tilt2:-11,edy2:0,lock:1,heat:0,shake:0,rock:0,bdy:-1.1},vars:L9,bake:D9},RE={p:{esx:1.14,esy:0.22,tilt:0,edy:2.4,edx:0.3,esx2:-0.04,esy2:0.03,tilt2:4,edy2:0,lock:1,heat:0,shake:0,rock:0,bdy:1.2},vars:L9,bake:D9},bE={p:{esx:1.3,esy:0.42,tilt:18,edy:-0.5,edx:0.5,esx2:0.06,esy2:-0.06,tilt2:-36,edy2:0,lock:1,heat:0,shake:0,rock:0,bdy:-1},vars:L9,bake:D9},yE={p:{esx:0.95,esy:1.02,tilt:4,edy:-0.2,edx:0.3,esx2:0.24,esy2:-0.44,tilt2:-18,edy2:0,lock:1,heat:0,shake:0,rock:0,bdy:0},vars:L9,bake:D9};var hE={p:{esx:0.62,esy:0.5,tilt:10,edy:1.4,edx:-0.2,esx2:-0.05,esy2:-0.04,tilt2:-8,edy2:0,lock:1,heat:0.55,shake:0,rock:0,bdy:0.9},vars:L9,bake:D9,tint:($,Z)=>J00($,Z,ee)};var xE={p:{esx:1.15,esy:0.62,tilt:0,edy:4.2,edx:0.4,esx2:0.02,esy2:0.06,tilt2:0,edy2:-8.4,lock:1,heat:0,shake:0,rock:0.8,bdy:-0.4},vars:L9,bake:D9};var B00=($,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}},pX=B00;var Q00={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},vE=Q00;var z00=($)=>{return pX(vE[$.toLowerCase()],6)},gE=z00;var X00=/^#?([0-9a-f]{8}|[0-9a-f]{6}|[0-9a-f]{4}|[0-9a-f]{3})$/i,G00=($)=>{let Z;return(Z=$.match(X00))?pX(parseInt(Z[1],16),Z[1].length):void 0},fE=G00;var cX="([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)";var O7="([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)%";var OJ="(?:([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)%|([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?))";var mE="(?:([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)(deg|grad|rad|turn)|([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?))";var u3="\\s*,\\s*";var Xk0=new RegExp("^(?:([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)%|([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)|none)$");var U00=new RegExp(`^rgba?\\(\\s*${cX}${u3}${cX}${u3}${cX}\\s*(?:,\\s*${OJ}\\s*)?\\)$`),K00=new RegExp(`^rgba?\\(\\s*${O7}${u3}${O7}${u3}${O7}\\s*(?:,\\s*${OJ}\\s*)?\\)$`),F00=($)=>{let Z={mode:"rgb"},H;if(H=$.match(U00)){if(H[1]!==void 0)Z.r=H[1]/255;if(H[2]!==void 0)Z.g=H[2]/255;if(H[3]!==void 0)Z.b=H[3]/255}else if(H=$.match(K00)){if(H[1]!==void 0)Z.r=H[1]/100;if(H[2]!==void 0)Z.g=H[2]/100;if(H[3]!==void 0)Z.b=H[3]/100}else return;if(H[4]!==void 0)Z.alpha=Math.max(0,Math.min(1,H[4]/100));else if(H[5]!==void 0)Z.alpha=Math.max(0,Math.min(1,+H[5]));return Z},uE=F00;var Y00=($,Z)=>$===void 0?void 0:typeof $!=="object"?cE($):$.mode!==void 0?$:Z?{...$,mode:Z}:void 0,pE=Y00;var W00=($="rgb")=>(Z)=>(Z=pE(Z,$))!==void 0?Z.mode===$?Z:R8[Z.mode][$]?R8[Z.mode][$](Z):$==="rgb"?R8[Z.mode].rgb(Z):R8.rgb[$](R8[Z.mode].rgb(Z)):void 0,dX=W00;var R8={},dE={},TJ=[],eA={},A00=($)=>$,Z5=($)=>{if(R8[$.mode]={...R8[$.mode],...$.toMode},Object.keys($.fromMode||{}).forEach((Z)=>{if(!R8[Z])R8[Z]={};R8[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=A00}),dE[$.mode]=$,($.parse||[]).forEach((Z)=>{N00(Z,$.mode)}),dX($.mode)},lE=($)=>dE[$],N00=($,Z)=>{if(typeof $==="string"){if(!Z)throw Error("'mode' required when 'parser' is a string");eA[$]=Z}else if(typeof $==="function"){if(TJ.indexOf($)<0)TJ.push($)}};var $N=/[^\x00-\x7F]|[a-zA-Z_]/,V00=/[^\x00-\x7F]|[-\w]/,_0={Function:"function",Ident:"ident",Number:"number",Percentage:"percentage",ParenClose:")",None:"none",Hue:"hue",Alpha:"alpha"},U1=0;function lX($){let Z=$[U1],H=$[U1+1];if(Z==="-"||Z==="+")return/\d/.test(H)||H==="."&&/\d/.test($[U1+2]);if(Z===".")return/\d/.test(H);return/\d/.test(Z)}function ZN($){if(U1>=$.length)return!1;let Z=$[U1];if($N.test(Z))return!0;if(Z==="-"){if($.length-U1<2)return!1;let H=$[U1+1];if(H==="-"||$N.test(H))return!0;return!1}return!1}var L00={deg:1,rad:180/Math.PI,grad:0.9,turn:360};function CJ($){let Z="";if($[U1]==="-"||$[U1]==="+")Z+=$[U1++];if(Z+=iX($),$[U1]==="."&&/\d/.test($[U1+1]))Z+=$[U1++]+iX($);if($[U1]==="e"||$[U1]==="E"){if(($[U1+1]==="-"||$[U1+1]==="+")&&/\d/.test($[U1+2]))Z+=$[U1++]+$[U1++]+iX($);else if(/\d/.test($[U1+1]))Z+=$[U1++]+iX($)}if(ZN($)){let H=rX($);if(H==="deg"||H==="rad"||H==="turn"||H==="grad")return{type:_0.Hue,value:Z*L00[H]};return}if($[U1]==="%")return U1++,{type:_0.Percentage,value:+Z};return{type:_0.Number,value:+Z}}function iX($){let Z="";while(/\d/.test($[U1]))Z+=$[U1++];return Z}function rX($){let Z="";while(U1<$.length&&V00.test($[U1]))Z+=$[U1++];return Z}function D00($){let Z=rX($);if($[U1]==="(")return U1++,{type:_0.Function,value:Z};if(Z==="none")return{type:_0.None,value:void 0};return{type:_0.Ident,value:Z}}function q00($=""){let Z=$.trim(),H=[],J;U1=0;while(U1<Z.length){if(J=Z[U1++],J===`
16
- `||J==="\t"||J===" "){while(U1<Z.length&&(Z[U1]===`
17
- `||Z[U1]==="\t"||Z[U1]===" "))U1++;continue}if(J===",")return;if(J===")"){H.push({type:_0.ParenClose});continue}if(J==="+"){if(U1--,lX(Z)){H.push(CJ(Z));continue}return}if(J==="-"){if(U1--,lX(Z)){H.push(CJ(Z));continue}if(ZN(Z)){H.push({type:_0.Ident,value:rX(Z)});continue}return}if(J==="."){if(U1--,lX(Z)){H.push(CJ(Z));continue}return}if(J==="/"){while(U1<Z.length&&(Z[U1]===`
18
- `||Z[U1]==="\t"||Z[U1]===" "))U1++;let B;if(lX(Z)){if(B=CJ(Z),B.type!==_0.Hue){H.push({type:_0.Alpha,value:B});continue}}if(ZN(Z)){if(rX(Z)==="none"){H.push({type:_0.Alpha,value:{type:_0.None,value:void 0}});continue}}return}if(/\d/.test(J)){U1--,H.push(CJ(Z));continue}if($N.test(J)){U1--,H.push(D00(Z));continue}return}return H}function M00($){$._i=0;let Z=$[$._i++];if(!Z||Z.type!==_0.Function||Z.value!=="color")return;if(Z=$[$._i++],Z.type!==_0.Ident)return;let H=eA[Z.value];if(!H)return;let J={mode:H},B=iE($,!1);if(!B)return;let Q=lE(H).channels;for(let z=0,X,G;z<Q.length;z++)if(X=B[z],G=Q[z],X.type!==_0.None){if(J[G]=X.type===_0.Number?X.value:X.value/100,G==="alpha")J[G]=Math.max(0,Math.min(1,J[G]))}return J}function iE($,Z){let H=[],J;while($._i<$.length){if(J=$[$._i++],J.type===_0.None||J.type===_0.Number||J.type===_0.Alpha||J.type===_0.Percentage||Z&&J.type===_0.Hue){H.push(J);continue}if(J.type===_0.ParenClose){if($._i<$.length)return;continue}return}if(H.length<3||H.length>4)return;if(H.length===4){if(H[3].type!==_0.Alpha)return;H[3]=H[3].value}if(H.length===3)H.push({type:_0.None,value:void 0});return H.every((B)=>B.type!==_0.Alpha)?H:void 0}function P00($,Z){$._i=0;let H=$[$._i++];if(!H||H.type!==_0.Function)return;let J=iE($,Z);if(!J)return;return J.unshift(H.value),J}var _00=($)=>{if(typeof $!=="string")return;let Z=q00($),H=Z?P00(Z,!0):void 0,J=void 0,B=0,Q=TJ.length;while(B<Q)if((J=TJ[B++]($,H))!==void 0)return J;return Z?M00(Z):void 0},cE=_00;function j00($,Z){if(!Z||Z[0]!=="rgb"&&Z[0]!=="rgba")return;let H={mode:"rgb"},[,J,B,Q,z]=Z;if(J.type===_0.Hue||B.type===_0.Hue||Q.type===_0.Hue)return;if(J.type!==_0.None)H.r=J.type===_0.Number?J.value/255:J.value/100;if(B.type!==_0.None)H.g=B.type===_0.Number?B.value/255:B.value/100;if(Q.type!==_0.None)H.b=Q.type===_0.Number?Q.value/255:Q.value/100;if(z.type!==_0.None)H.alpha=Math.min(1,Math.max(0,z.type===_0.Number?z.value:z.value/100));return H}var rE=j00;var O00=($)=>$==="transparent"?{mode:"rgb",r:0,g:0,b:0,alpha:0}:void 0,aE=O00;var nE=($,Z,H)=>$+H*(Z-$);var T00=($)=>{let Z=[];for(let H=0;H<$.length-1;H++){let J=$[H],B=$[H+1];if(J===void 0&&B===void 0)Z.push(void 0);else if(J!==void 0&&B!==void 0)Z.push([J,B]);else Z.push(J!==void 0?[J,J]:[B,B])}return Z},oE=($)=>(Z)=>{let H=T00(Z);return(J)=>{let B=J*H.length,Q=J>=1?H.length-1:Math.max(Math.floor(B),0),z=H[Q];return z===void 0?void 0:$(z[0],z[1],B-Q)}};var C0=oE(nE);var E1=($)=>{let Z=!1,H=$.map((J)=>{if(J!==void 0)return Z=!0,J;return 1});return Z?H:$};var C00={mode:"rgb",channels:["r","g","b","alpha"],parse:[rE,fE,uE,gE,aE,"srgb"],serialize:"srgb",interpolate:{r:C0,g:C0,b:C0,alpha:{use:C0,fixup:E1}},gamut:!0,white:{r:1,g:1,b:1},black:{r:0,g:0,b:0}},z8=C00;var HN=($=0)=>Math.pow(Math.abs($),2.19921875)*Math.sign($),w00=($)=>{let Z=HN($.r),H=HN($.g),J=HN($.b),B={mode:"xyz65",x:0.5766690429101305*Z+0.1855582379065463*H+0.1882286462349947*J,y:0.297344975250536*Z+0.6273635662554661*H+0.0752914584939979*J,z:0.0270313613864123*Z+0.0706888525358272*H+0.9913375368376386*J};if($.alpha!==void 0)B.alpha=$.alpha;return B},JN=w00;var BN=($)=>Math.pow(Math.abs($),0.4547069271758437)*Math.sign($),E00=({x:$,y:Z,z:H,alpha:J})=>{if($===void 0)$=0;if(Z===void 0)Z=0;if(H===void 0)H=0;let B={mode:"a98",r:BN($*2.0415879038107465-Z*0.5650069742788597-0.3447313507783297*H),g:BN($*-0.9692436362808798+Z*1.8759675015077206+0.0415550574071756*H),b:BN($*0.0134442806320312-Z*0.1183623922310184+1.0151749943912058*H)};if(J!==void 0)B.alpha=J;return B},QN=E00;var zN=($=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)},S00=({r:$,g:Z,b:H,alpha:J})=>{let B={mode:"lrgb",r:zN($),g:zN(Z),b:zN(H)};if(J!==void 0)B.alpha=J;return B},X8=S00;var I00=($)=>{let{r:Z,g:H,b:J,alpha:B}=X8($),Q={mode:"xyz65",x:0.4123907992659593*Z+0.357584339383878*H+0.1804807884018343*J,y:0.2126390058715102*Z+0.715168678767756*H+0.0721923153607337*J,z:0.0193308187155918*Z+0.119194779794626*H+0.9505321522496607*J};if(B!==void 0)Q.alpha=B;return Q},T2=I00;var XN=($=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},k00=({r:$,g:Z,b:H,alpha:J},B="rgb")=>{let Q={mode:B,r:XN($),g:XN(Z),b:XN(H)};if(J!==void 0)Q.alpha=J;return Q},G8=k00;var R00=({x:$,y:Z,z:H,alpha:J})=>{if($===void 0)$=0;if(Z===void 0)Z=0;if(H===void 0)H=0;let B=G8({r:$*3.2409699419045226-Z*1.537383177570094-0.4986107602930034*H,g:$*-0.9692436362808796+Z*1.8759675015077204+0.0415550574071756*H,b:$*0.0556300796969936-Z*0.2039769588889765+1.0569715142428784*H});if(J!==void 0)B.alpha=J;return B},C2=R00;var b00={...z8,mode:"a98",parse:["a98-rgb"],serialize:"a98-rgb",fromMode:{rgb:($)=>QN(T2($)),xyz65:QN},toMode:{rgb:($)=>C2(JN($)),xyz65:JN}},sE=b00;var y00=($)=>($=$%360)<0?$+360:$,A5=y00;var h00=($,Z)=>{return $.map((H,J,B)=>{if(H===void 0)return H;let Q=A5(H);if(J===0||$[J-1]===void 0)return Q;return Z(Q-A5(B[J-1]))}).reduce((H,J)=>{if(!H.length||J===void 0||H[H.length-1]===void 0)return H.push(J),H;return H.push(J+H[H.length-1]),H},[])},L4=($)=>h00($,(Z)=>Math.abs(Z)<=180?Z:Z-360*Math.sign(Z));var $4=[-0.14861,1.78277,-0.29227,-0.90649,1.97294,0],tE=Math.PI/180,eE=180/Math.PI;var $S=$4[3]*$4[4],ZS=$4[1]*$4[4],HS=$4[1]*$4[2]-$4[0]*$4[3],x00=({r:$,g:Z,b:H,alpha:J})=>{if($===void 0)$=0;if(Z===void 0)Z=0;if(H===void 0)H=0;let B=(HS*H+$*$S-Z*ZS)/(HS+$S-ZS),Q=H-B,z=($4[4]*(Z-B)-$4[2]*Q)/$4[3],X={mode:"cubehelix",l:B,s:B===0||B===1?void 0:Math.sqrt(Q*Q+z*z)/($4[4]*B*(1-B))};if(X.s)X.h=Math.atan2(z,Q)*eE-120;if(J!==void 0)X.alpha=J;return X},JS=x00;var v00=({h:$,s:Z,l:H,alpha:J})=>{let B={mode:"rgb"};if($=($===void 0?0:$+120)*tE,H===void 0)H=0;let Q=Z===void 0?0:Z*H*(1-H),z=Math.cos($),X=Math.sin($);if(B.r=H+Q*($4[0]*z+$4[1]*X),B.g=H+Q*($4[2]*z+$4[3]*X),B.b=H+Q*($4[4]*z+$4[5]*X),J!==void 0)B.alpha=J;return B},BS=v00;var p3=($,Z)=>{if($.h===void 0||Z.h===void 0||!$.s||!Z.s)return 0;let H=A5($.h),J=A5(Z.h),B=Math.sin((J-H+360)/2*Math.PI/180);return 2*Math.sqrt($.s*Z.s)*B},QS=($,Z)=>{if($.h===void 0||Z.h===void 0)return 0;let H=A5($.h),J=A5(Z.h);if(Math.abs(J-H)>180)return H-(J-360*Math.sign(J-H));return J-H},c3=($,Z)=>{if($.h===void 0||Z.h===void 0||!$.c||!Z.c)return 0;let H=A5($.h),J=A5(Z.h),B=Math.sin((J-H+360)/2*Math.PI/180);return 2*Math.sqrt($.c*Z.c)*B};var D4=($)=>{let Z=$.reduce((J,B)=>{if(B!==void 0){let Q=B*Math.PI/180;J.sin+=Math.sin(Q),J.cos+=Math.cos(Q)}return J},{sin:0,cos:0}),H=Math.atan2(Z.sin,Z.cos)*180/Math.PI;return H<0?360+H:H};var g00={mode:"cubehelix",channels:["h","s","l","alpha"],parse:["--cubehelix"],serialize:"--cubehelix",ranges:{h:[0,360],s:[0,4.614],l:[0,1]},fromMode:{rgb:JS},toMode:{rgb:BS},interpolate:{h:{use:C0,fixup:L4},s:C0,l:C0,alpha:{use:C0,fixup:E1}},difference:{h:p3},average:{h:D4}},zS=g00;var f00=({l:$,a:Z,b:H,alpha:J},B="lch")=>{if(Z===void 0)Z=0;if(H===void 0)H=0;let Q=Math.sqrt(Z*Z+H*H),z={mode:B,l:$,c:Q};if(Q)z.h=A5(Math.atan2(H,Z)*180/Math.PI);if(J!==void 0)z.alpha=J;return z},u2=f00;var m00=({l:$,c:Z,h:H,alpha:J},B="lab")=>{if(H===void 0)H=0;let Q={mode:B,l:$,a:Z?Z*Math.cos(H/180*Math.PI):0,b:Z?Z*Math.sin(H/180*Math.PI):0};if(J!==void 0)Q.alpha=J;return Q},p2=m00;var aX=Math.pow(29,3)/Math.pow(3,3),nX=Math.pow(6,3)/Math.pow(29,3);var I5={X:0.9642956764295677,Y:1,Z:0.8251046025104602},d3={X:0.9504559270516716,Y:1,Z:1.0890577507598784},MR0=Math.pow(29,3)/Math.pow(3,3),PR0=Math.pow(6,3)/Math.pow(29,3);var GN=($)=>Math.pow($,3)>nX?Math.pow($,3):(116*$-16)/aX,u00=({l:$,a:Z,b:H,alpha:J})=>{if($===void 0)$=0;if(Z===void 0)Z=0;if(H===void 0)H=0;let B=($+16)/116,Q=Z/500+B,z=B-H/200,X={mode:"xyz65",x:GN(Q)*d3.X,y:GN(B)*d3.Y,z:GN(z)*d3.Z};if(J!==void 0)X.alpha=J;return X},oX=u00;var p00=($)=>C2(oX($)),l3=p00;var UN=($)=>$>nX?Math.cbrt($):(aX*$+16)/116,c00=({x:$,y:Z,z:H,alpha:J})=>{if($===void 0)$=0;if(Z===void 0)Z=0;if(H===void 0)H=0;let B=UN($/d3.X),Q=UN(Z/d3.Y),z=UN(H/d3.Z),X={mode:"lab65",l:116*Q-16,a:500*(B-Q),b:200*(Q-z)};if(J!==void 0)X.alpha=J;return X},sX=c00;var d00=($)=>{let Z=sX(T2($));if($.r===$.b&&$.b===$.g)Z.a=Z.b=0;return Z},i3=d00;var a$=1,tX=1,T7=0.14444444444444443*Math.PI,n$=Math.cos(T7),o$=Math.sin(T7),eX=100/Math.log(1.39);var l00=({l:$,c:Z,h:H,alpha:J})=>{if($===void 0)$=0;if(Z===void 0)Z=0;if(H===void 0)H=0;let B={mode:"lab65",l:(Math.exp($*a$/eX)-1)/0.0039},Q=(Math.exp(0.0435*Z*tX*a$)-1)/0.075,z=Q*Math.cos(H/180*Math.PI-T7),X=Q*Math.sin(H/180*Math.PI-T7);if(B.a=z*n$-X/0.83*o$,B.b=z*o$+X/0.83*n$,J!==void 0)B.alpha=J;return B},wJ=l00;var i00=({l:$,a:Z,b:H,alpha:J})=>{if($===void 0)$=0;if(Z===void 0)Z=0;if(H===void 0)H=0;let B=Z*n$+H*o$,Q=0.83*(H*n$-Z*o$),z=Math.sqrt(B*B+Q*Q),X={mode:"dlch",l:eX/a$*Math.log(1+0.0039*$),c:Math.log(1+0.075*z)/(0.0435*tX*a$)};if(X.c)X.h=A5((Math.atan2(Q,B)+T7)/Math.PI*180);if(J!==void 0)X.alpha=J;return X},EJ=i00;var XS=($)=>wJ(u2($,"dlch")),GS=($)=>p2(EJ($),"dlab"),r00={mode:"dlab",parse:["--din99o-lab"],serialize:"--din99o-lab",toMode:{lab65:XS,rgb:($)=>l3(XS($))},fromMode:{lab65:GS,rgb:($)=>GS(i3($))},channels:["l","a","b","alpha"],ranges:{l:[0,100],a:[-40.09,45.501],b:[-40.469,44.344]},interpolate:{l:C0,a:C0,b:C0,alpha:{use:C0,fixup:E1}}},US=r00;var a00={mode:"dlch",parse:["--din99o-lch"],serialize:"--din99o-lch",toMode:{lab65:wJ,dlab:($)=>p2($,"dlab"),rgb:($)=>l3(wJ($))},fromMode:{lab65:EJ,dlab:($)=>u2($,"dlch"),rgb:($)=>EJ(i3($))},channels:["l","c","h","alpha"],ranges:{l:[0,100],c:[0,51.484],h:[0,360]},interpolate:{l:C0,c:C0,h:{use:C0,fixup:L4},alpha:{use:C0,fixup:E1}},difference:{h:c3},average:{h:D4}},KS=a00;function KN({h:$,s:Z,i:H,alpha:J}){if($=A5($!==void 0?$:0),Z===void 0)Z=0;if(H===void 0)H=0;let B=Math.abs($/60%2-1),Q;switch(Math.floor($/60)){case 0:Q={r:H*(1+Z*(3/(2-B)-1)),g:H*(1+Z*(3*(1-B)/(2-B)-1)),b:H*(1-Z)};break;case 1:Q={r:H*(1+Z*(3*(1-B)/(2-B)-1)),g:H*(1+Z*(3/(2-B)-1)),b:H*(1-Z)};break;case 2:Q={r:H*(1-Z),g:H*(1+Z*(3/(2-B)-1)),b:H*(1+Z*(3*(1-B)/(2-B)-1))};break;case 3:Q={r:H*(1-Z),g:H*(1+Z*(3*(1-B)/(2-B)-1)),b:H*(1+Z*(3/(2-B)-1))};break;case 4:Q={r:H*(1+Z*(3*(1-B)/(2-B)-1)),g:H*(1-Z),b:H*(1+Z*(3/(2-B)-1))};break;case 5:Q={r:H*(1+Z*(3/(2-B)-1)),g:H*(1-Z),b:H*(1+Z*(3*(1-B)/(2-B)-1))};break;default:Q={r:H*(1-Z),g:H*(1-Z),b:H*(1-Z)}}if(Q.mode="rgb",J!==void 0)Q.alpha=J;return Q}function FN({r:$,g:Z,b:H,alpha:J}){if($===void 0)$=0;if(Z===void 0)Z=0;if(H===void 0)H=0;let B=Math.max($,Z,H),Q=Math.min($,Z,H),z={mode:"hsi",s:$+Z+H===0?0:1-3*Q/($+Z+H),i:($+Z+H)/3};if(B-Q!==0)z.h=(B===$?(Z-H)/(B-Q)+(Z<H)*6:B===Z?(H-$)/(B-Q)+2:($-Z)/(B-Q)+4)*60;if(J!==void 0)z.alpha=J;return z}var n00={mode:"hsi",toMode:{rgb:KN},parse:["--hsi"],serialize:"--hsi",fromMode:{rgb:FN},channels:["h","s","i","alpha"],ranges:{h:[0,360]},gamut:"rgb",interpolate:{h:{use:C0,fixup:L4},s:C0,i:C0,alpha:{use:C0,fixup:E1}},difference:{h:p3},average:{h:D4}},FS=n00;function YN({h:$,s:Z,l:H,alpha:J}){if($=A5($!==void 0?$:0),Z===void 0)Z=0;if(H===void 0)H=0;let B=H+Z*(H<0.5?H:1-H),Q=B-(B-H)*2*Math.abs($/60%2-1),z;switch(Math.floor($/60)){case 0:z={r:B,g:Q,b:2*H-B};break;case 1:z={r:Q,g:B,b:2*H-B};break;case 2:z={r:2*H-B,g:B,b:Q};break;case 3:z={r:2*H-B,g:Q,b:B};break;case 4:z={r:Q,g:2*H-B,b:B};break;case 5:z={r:B,g:2*H-B,b:Q};break;default:z={r:2*H-B,g:2*H-B,b:2*H-B}}if(z.mode="rgb",J!==void 0)z.alpha=J;return z}function WN({r:$,g:Z,b:H,alpha:J}){if($===void 0)$=0;if(Z===void 0)Z=0;if(H===void 0)H=0;let B=Math.max($,Z,H),Q=Math.min($,Z,H),z={mode:"hsl",s:B===Q?0:(B-Q)/(1-Math.abs(B+Q-1)),l:0.5*(B+Q)};if(B-Q!==0)z.h=(B===$?(Z-H)/(B-Q)+(Z<H)*6:B===Z?(H-$)/(B-Q)+2:($-Z)/(B-Q)+4)*60;if(J!==void 0)z.alpha=J;return z}var o00=($,Z)=>{switch(Z){case"deg":return+$;case"rad":return $/Math.PI*180;case"grad":return $/10*9;case"turn":return $*360}},YS=o00;var s00=new RegExp(`^hsla?\\(\\s*${mE}${u3}${O7}${u3}${O7}\\s*(?:,\\s*${OJ}\\s*)?\\)$`),t00=($)=>{let Z=$.match(s00);if(!Z)return;let H={mode:"hsl"};if(Z[3]!==void 0)H.h=+Z[3];else if(Z[1]!==void 0&&Z[2]!==void 0)H.h=YS(Z[1],Z[2]);if(Z[4]!==void 0)H.s=Math.min(Math.max(0,Z[4]/100),1);if(Z[5]!==void 0)H.l=Math.min(Math.max(0,Z[5]/100),1);if(Z[6]!==void 0)H.alpha=Math.max(0,Math.min(1,Z[6]/100));else if(Z[7]!==void 0)H.alpha=Math.max(0,Math.min(1,+Z[7]));return H},WS=t00;function e00($,Z){if(!Z||Z[0]!=="hsl"&&Z[0]!=="hsla")return;let H={mode:"hsl"},[,J,B,Q,z]=Z;if(J.type!==_0.None){if(J.type===_0.Percentage)return;H.h=J.value}if(B.type!==_0.None){if(B.type===_0.Hue)return;H.s=B.value/100}if(Q.type!==_0.None){if(Q.type===_0.Hue)return;H.l=Q.value/100}if(z.type!==_0.None)H.alpha=Math.min(1,Math.max(0,z.type===_0.Number?z.value:z.value/100));return H}var AS=e00;var $10={mode:"hsl",toMode:{rgb:YN},fromMode:{rgb:WN},channels:["h","s","l","alpha"],ranges:{h:[0,360]},gamut:"rgb",parse:[AS,WS],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:C0,fixup:L4},s:C0,l:C0,alpha:{use:C0,fixup:E1}},difference:{h:p3},average:{h:D4}},$G=$10;function SJ({h:$,s:Z,v:H,alpha:J}){if($=A5($!==void 0?$:0),Z===void 0)Z=0;if(H===void 0)H=0;let B=Math.abs($/60%2-1),Q;switch(Math.floor($/60)){case 0:Q={r:H,g:H*(1-Z*B),b:H*(1-Z)};break;case 1:Q={r:H*(1-Z*B),g:H,b:H*(1-Z)};break;case 2:Q={r:H*(1-Z),g:H,b:H*(1-Z*B)};break;case 3:Q={r:H*(1-Z),g:H*(1-Z*B),b:H};break;case 4:Q={r:H*(1-Z*B),g:H*(1-Z),b:H};break;case 5:Q={r:H,g:H*(1-Z),b:H*(1-Z*B)};break;default:Q={r:H*(1-Z),g:H*(1-Z),b:H*(1-Z)}}if(Q.mode="rgb",J!==void 0)Q.alpha=J;return Q}function IJ({r:$,g:Z,b:H,alpha:J}){if($===void 0)$=0;if(Z===void 0)Z=0;if(H===void 0)H=0;let B=Math.max($,Z,H),Q=Math.min($,Z,H),z={mode:"hsv",s:B===0?0:1-Q/B,v:B};if(B-Q!==0)z.h=(B===$?(Z-H)/(B-Q)+(Z<H)*6:B===Z?(H-$)/(B-Q)+2:($-Z)/(B-Q)+4)*60;if(J!==void 0)z.alpha=J;return z}var Z10={mode:"hsv",toMode:{rgb:SJ},parse:["--hsv"],serialize:"--hsv",fromMode:{rgb:IJ},channels:["h","s","v","alpha"],ranges:{h:[0,360]},gamut:"rgb",interpolate:{h:{use:C0,fixup:L4},s:C0,v:C0,alpha:{use:C0,fixup:E1}},difference:{h:p3},average:{h:D4}},ZG=Z10;function AN({h:$,w:Z,b:H,alpha:J}){if(Z===void 0)Z=0;if(H===void 0)H=0;if(Z+H>1){let B=Z+H;Z/=B,H/=B}return SJ({h:$,s:H===1?1:1-Z/(1-H),v:1-H,alpha:J})}function NN($){let Z=IJ($);if(Z===void 0)return;let H=Z.s!==void 0?Z.s:0,J=Z.v!==void 0?Z.v:0,B={mode:"hwb",w:(1-H)*J,b:1-J};if(Z.h!==void 0)B.h=Z.h;if(Z.alpha!==void 0)B.alpha=Z.alpha;return B}function H10($,Z){if(!Z||Z[0]!=="hwb")return;let H={mode:"hwb"},[,J,B,Q,z]=Z;if(J.type!==_0.None){if(J.type===_0.Percentage)return;H.h=J.value}if(B.type!==_0.None){if(B.type===_0.Hue)return;H.w=B.value/100}if(Q.type!==_0.None){if(Q.type===_0.Hue)return;H.b=Q.value/100}if(z.type!==_0.None)H.alpha=Math.min(1,Math.max(0,z.type===_0.Number?z.value:z.value/100));return H}var NS=H10;var J10={mode:"hwb",toMode:{rgb:AN},fromMode:{rgb:NN},channels:["h","w","b","alpha"],ranges:{h:[0,360]},gamut:"rgb",parse:[NS],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:C0,fixup:L4},w:C0,b:C0,alpha:{use:C0,fixup:E1}},difference:{h:QS},average:{h:D4}},VS=J10;var HG=203;var JG=0.1593017578125;var BG=0.8359375,QG=18.8515625,zG=18.6875;function XG($){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 GG($){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 VN=($)=>Math.max($/HG,0),B10=({i:$,t:Z,p:H,alpha:J})=>{if($===void 0)$=0;if(Z===void 0)Z=0;if(H===void 0)H=0;let B=XG($+0.008609037037932761*Z+0.11102962500302593*H),Q=XG($-0.00860903703793275*Z-0.11102962500302599*H),z=XG($+0.5600313357106791*Z-0.32062717498731885*H),X={mode:"xyz65",x:VN(2.070152218389422*B-1.3263473389671556*Q+0.2066510476294051*z),y:VN(0.3647385209748074*B+0.680566024947227*Q-0.0453045459220346*z),z:VN(-0.049747207535812*B-0.0492609666966138*Q+1.1880659249923042*z)};if(J!==void 0)X.alpha=J;return X},LN=B10;var DN=($=0)=>Math.max($*HG,0),Q10=({x:$,y:Z,z:H,alpha:J})=>{let B=DN($),Q=DN(Z),z=DN(H),X=GG(0.3592832590121217*B+0.6976051147779502*Q-0.0358915932320289*z),G=GG(-0.1920808463704995*B+1.1004767970374323*Q+0.0753748658519118*z),U=GG(0.0070797844607477*B+0.0748396662186366*Q+0.8433265453898765*z),K=0.5*X+0.5*G,F=1.61376953125*X-3.323486328125*G+1.709716796875*U,Y=4.378173828125*X-4.24560546875*G-0.132568359375*U,W={mode:"itp",i:K,t:F,p:Y};if(J!==void 0)W.alpha=J;return W},qN=Q10;var z10={mode:"itp",channels:["i","t","p","alpha"],parse:["--ictcp"],serialize:"--ictcp",toMode:{xyz65:LN,rgb:($)=>C2(LN($))},fromMode:{xyz65:qN,rgb:($)=>qN(T2($))},ranges:{i:[0,0.581],t:[-0.369,0.272],p:[-0.164,0.331]},interpolate:{i:C0,t:C0,p:C0,alpha:{use:C0,fixup:E1}}},LS=z10;var X10=134.03437499999998,G10=0.000000000016295499532821565,MN=($)=>{if($<0)return 0;let Z=Math.pow($/1e4,JG);return Math.pow((BG+QG*Z)/(1+zG*Z),X10)},PN=($=0)=>Math.max($*203,0),U10=({x:$,y:Z,z:H,alpha:J})=>{$=PN($),Z=PN(Z),H=PN(H);let B=1.15*$-0.15*H,Q=0.66*Z+0.34*$,z=MN(0.41478972*B+0.579999*Q+0.014648*H),X=MN(-0.20151*B+1.120649*Q+0.0531008*H),G=MN(-0.0166008*B+0.2648*Q+0.6684799*H),U=(z+X)/2,K={mode:"jab",j:0.44*U/(1-0.56*U)-G10,a:3.524*z-4.066708*X+0.542708*G,b:0.199076*z+1.096799*X-1.295875*G};if(J!==void 0)K.alpha=J;return K},UG=U10;var K10=134.03437499999998,DS=0.000000000016295499532821565,_N=($)=>{if($<0)return 0;let Z=Math.pow($,1/K10);return 1e4*Math.pow((BG-Z)/(zG*Z-QG),1/JG)},jN=($)=>$/203,F10=({j:$,a:Z,b:H,alpha:J})=>{if($===void 0)$=0;if(Z===void 0)Z=0;if(H===void 0)H=0;let B=($+DS)/(0.44+0.56*($+DS)),Q=_N(B+0.13860504*Z+0.058047316*H),z=_N(B-0.13860504*Z-0.058047316*H),X=_N(B-0.096019242*Z-0.8118919*H),G={mode:"xyz65",x:jN(1.661373024652174*Q-0.914523081304348*z+0.23136208173913045*X),y:jN(-0.3250758611844533*Q+1.571847026732543*z-0.21825383453227928*X),z:jN(-0.090982811*Q-0.31272829*z+1.5227666*X)};if(J!==void 0)G.alpha=J;return G},KG=F10;var Y10=($)=>{let Z=UG(T2($));if($.r===$.b&&$.b===$.g)Z.a=Z.b=0;return Z},FG=Y10;var W10=($)=>C2(KG($)),YG=W10;var A10={mode:"jab",channels:["j","a","b","alpha"],parse:["--jzazbz"],serialize:"--jzazbz",fromMode:{rgb:FG,xyz65:UG},toMode:{rgb:YG,xyz65:KG},ranges:{j:[0,0.222],a:[-0.109,0.129],b:[-0.185,0.134]},interpolate:{j:C0,a:C0,b:C0,alpha:{use:C0,fixup:E1}}},qS=A10;var N10=({j:$,a:Z,b:H,alpha:J})=>{if(Z===void 0)Z=0;if(H===void 0)H=0;let B=Math.sqrt(Z*Z+H*H),Q={mode:"jch",j:$,c:B};if(B)Q.h=A5(Math.atan2(H,Z)*180/Math.PI);if(J!==void 0)Q.alpha=J;return Q},ON=N10;var V10=({j:$,c:Z,h:H,alpha:J})=>{if(H===void 0)H=0;let B={mode:"jab",j:$,a:Z?Z*Math.cos(H/180*Math.PI):0,b:Z?Z*Math.sin(H/180*Math.PI):0};if(J!==void 0)B.alpha=J;return B},TN=V10;var L10={mode:"jch",parse:["--jzczhz"],serialize:"--jzczhz",toMode:{jab:TN,rgb:($)=>YG(TN($))},fromMode:{rgb:($)=>ON(FG($)),jab:ON},channels:["j","c","h","alpha"],ranges:{j:[0,0.221],c:[0,0.19],h:[0,360]},interpolate:{h:{use:C0,fixup:L4},c:C0,j:C0,alpha:{use:C0,fixup:E1}},difference:{h:c3},average:{h:D4}},MS=L10;var r3=Math.pow(29,3)/Math.pow(3,3),s$=Math.pow(6,3)/Math.pow(29,3);var CN=($)=>Math.pow($,3)>s$?Math.pow($,3):(116*$-16)/r3,D10=({l:$,a:Z,b:H,alpha:J})=>{if($===void 0)$=0;if(Z===void 0)Z=0;if(H===void 0)H=0;let B=($+16)/116,Q=Z/500+B,z=B-H/200,X={mode:"xyz50",x:CN(Q)*I5.X,y:CN(B)*I5.Y,z:CN(z)*I5.Z};if(J!==void 0)X.alpha=J;return X},t$=D10;var q10=({x:$,y:Z,z:H,alpha:J})=>{if($===void 0)$=0;if(Z===void 0)Z=0;if(H===void 0)H=0;let B=G8({r:$*3.1341359569958707-Z*1.6173863321612538-0.4906619460083532*H,g:$*-0.978795502912089+Z*1.916254567259524+0.03344273116131949*H,b:$*0.07195537988411677-Z*0.2289768264158322+1.405386058324125*H});if(J!==void 0)B.alpha=J;return B},q9=q10;var M10=($)=>q9(t$($)),WG=M10;var P10=($)=>{let{r:Z,g:H,b:J,alpha:B}=X8($),Q={mode:"xyz50",x:0.436065742824811*Z+0.3851514688337912*H+0.14307845442264197*J,y:0.22249319175623702*Z+0.7168870538238823*H+0.06061979053616537*J,z:0.013923904500943465*Z+0.09708128566574634*H+0.7140993584005155*J};if(B!==void 0)Q.alpha=B;return Q},M9=P10;var wN=($)=>$>s$?Math.cbrt($):(r3*$+16)/116,_10=({x:$,y:Z,z:H,alpha:J})=>{if($===void 0)$=0;if(Z===void 0)Z=0;if(H===void 0)H=0;let B=wN($/I5.X),Q=wN(Z/I5.Y),z=wN(H/I5.Z),X={mode:"lab",l:116*Q-16,a:500*(B-Q),b:200*(Q-z)};if(J!==void 0)X.alpha=J;return X},e$=_10;var j10=($)=>{let Z=e$(M9($));if($.r===$.b&&$.b===$.g)Z.a=Z.b=0;return Z},AG=j10;function O10($,Z){if(!Z||Z[0]!=="lab")return;let H={mode:"lab"},[,J,B,Q,z]=Z;if(J.type===_0.Hue||B.type===_0.Hue||Q.type===_0.Hue)return;if(J.type!==_0.None)H.l=Math.min(Math.max(0,J.value),100);if(B.type!==_0.None)H.a=B.type===_0.Number?B.value:B.value*125/100;if(Q.type!==_0.None)H.b=Q.type===_0.Number?Q.value:Q.value*125/100;if(z.type!==_0.None)H.alpha=Math.min(1,Math.max(0,z.type===_0.Number?z.value:z.value/100));return H}var PS=O10;var T10={mode:"lab",toMode:{xyz50:t$,rgb:WG},fromMode:{xyz50:e$,rgb:AG},channels:["l","a","b","alpha"],ranges:{l:[0,100],a:[-125,125],b:[-125,125]},parse:[PS],serialize:($)=>`lab(${$.l!==void 0?$.l:"none"} ${$.a!==void 0?$.a:"none"} ${$.b!==void 0?$.b:"none"}${$.alpha<1?` / ${$.alpha}`:""})`,interpolate:{l:C0,a:C0,b:C0,alpha:{use:C0,fixup:E1}}},$Z=T10;var C10={...$Z,mode:"lab65",parse:["--lab-d65"],serialize:"--lab-d65",toMode:{xyz65:oX,rgb:l3},fromMode:{xyz65:sX,rgb:i3},ranges:{l:[0,100],a:[-125,125],b:[-125,125]}},_S=C10;function w10($,Z){if(!Z||Z[0]!=="lch")return;let H={mode:"lch"},[,J,B,Q,z]=Z;if(J.type!==_0.None){if(J.type===_0.Hue)return;H.l=Math.min(Math.max(0,J.value),100)}if(B.type!==_0.None)H.c=Math.max(0,B.type===_0.Number?B.value:B.value*150/100);if(Q.type!==_0.None){if(Q.type===_0.Percentage)return;H.h=Q.value}if(z.type!==_0.None)H.alpha=Math.min(1,Math.max(0,z.type===_0.Number?z.value:z.value/100));return H}var jS=w10;var E10={mode:"lch",toMode:{lab:p2,rgb:($)=>WG(p2($))},fromMode:{rgb:($)=>u2(AG($)),lab:u2},channels:["l","c","h","alpha"],ranges:{l:[0,100],c:[0,150],h:[0,360]},parse:[jS],serialize:($)=>`lch(${$.l!==void 0?$.l:"none"} ${$.c!==void 0?$.c:"none"} ${$.h!==void 0?$.h:"none"}${$.alpha<1?` / ${$.alpha}`:""})`,interpolate:{h:{use:C0,fixup:L4},c:C0,l:C0,alpha:{use:C0,fixup:E1}},difference:{h:c3},average:{h:D4}},ZZ=E10;var S10={...ZZ,mode:"lch65",parse:["--lch-d65"],serialize:"--lch-d65",toMode:{lab65:($)=>p2($,"lab65"),rgb:($)=>l3(p2($,"lab65"))},fromMode:{rgb:($)=>u2(i3($),"lch65"),lab65:($)=>u2($,"lch65")},ranges:{l:[0,100],c:[0,150],h:[0,360]}},OS=S10;var I10=({l:$,u:Z,v:H,alpha:J})=>{if(Z===void 0)Z=0;if(H===void 0)H=0;let B=Math.sqrt(Z*Z+H*H),Q={mode:"lchuv",l:$,c:B};if(B)Q.h=A5(Math.atan2(H,Z)*180/Math.PI);if(J!==void 0)Q.alpha=J;return Q},EN=I10;var k10=({l:$,c:Z,h:H,alpha:J})=>{if(H===void 0)H=0;let B={mode:"luv",l:$,u:Z?Z*Math.cos(H/180*Math.PI):0,v:Z?Z*Math.sin(H/180*Math.PI):0};if(J!==void 0)B.alpha=J;return B},SN=k10;var TS=($,Z,H)=>4*$/($+15*Z+3*H),CS=($,Z,H)=>9*Z/($+15*Z+3*H),R10=TS(I5.X,I5.Y,I5.Z),b10=CS(I5.X,I5.Y,I5.Z),y10=($)=>$<=s$?r3*$:116*Math.cbrt($)-16,h10=({x:$,y:Z,z:H,alpha:J})=>{if($===void 0)$=0;if(Z===void 0)Z=0;if(H===void 0)H=0;let B=y10(Z/I5.Y),Q=TS($,Z,H),z=CS($,Z,H);if(!isFinite(Q)||!isFinite(z))B=Q=z=0;else Q=13*B*(Q-R10),z=13*B*(z-b10);let X={mode:"luv",l:B,u:Q,v:z};if(J!==void 0)X.alpha=J;return X},kJ=h10;var x10=($,Z,H)=>4*$/($+15*Z+3*H),v10=($,Z,H)=>9*Z/($+15*Z+3*H),g10=x10(I5.X,I5.Y,I5.Z),f10=v10(I5.X,I5.Y,I5.Z),m10=({l:$,u:Z,v:H,alpha:J})=>{if($===void 0)$=0;if($===0)return{mode:"xyz50",x:0,y:0,z:0};if(Z===void 0)Z=0;if(H===void 0)H=0;let B=Z/(13*$)+g10,Q=H/(13*$)+f10,z=I5.Y*($<=8?$/r3:Math.pow(($+16)/116,3)),X=z*(9*B)/(4*Q),G=z*(12-3*B-20*Q)/(4*Q),U={mode:"xyz50",x:X,y:z,z:G};if(J!==void 0)U.alpha=J;return U},RJ=m10;var u10=($)=>EN(kJ(M9($))),p10=($)=>q9(RJ(SN($))),c10={mode:"lchuv",toMode:{luv:SN,rgb:p10},fromMode:{rgb:u10,luv:EN},channels:["l","c","h","alpha"],parse:["--lchuv"],serialize:"--lchuv",ranges:{l:[0,100],c:[0,176.956],h:[0,360]},interpolate:{h:{use:C0,fixup:L4},c:C0,l:C0,alpha:{use:C0,fixup:E1}},difference:{h:c3},average:{h:D4}},wS=c10;var d10={...z8,mode:"lrgb",toMode:{rgb:G8},fromMode:{rgb:X8},parse:["srgb-linear"],serialize:"srgb-linear"},ES=d10;var l10={mode:"luv",toMode:{xyz50:RJ,rgb:($)=>q9(RJ($))},fromMode:{xyz50:kJ,rgb:($)=>kJ(M9($))},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:C0,u:C0,v:C0,alpha:{use:C0,fixup:E1}}},SS=l10;var i10=({r:$,g:Z,b:H,alpha:J})=>{if($===void 0)$=0;if(Z===void 0)Z=0;if(H===void 0)H=0;let B=Math.cbrt(0.412221469470763*$+0.5363325372617348*Z+0.0514459932675022*H),Q=Math.cbrt(0.2119034958178252*$+0.6806995506452344*Z+0.1073969535369406*H),z=Math.cbrt(0.0883024591900564*$+0.2817188391361215*Z+0.6299787016738222*H),X={mode:"oklab",l:0.210454268309314*B+0.7936177747023054*Q-0.0040720430116193*z,a:1.9779985324311684*B-2.42859224204858*Q+0.450593709617411*z,b:0.0259040424655478*B+0.7827717124575296*Q-0.8086757549230774*z};if(J!==void 0)X.alpha=J;return X},NG=i10;var r10=($)=>{let Z=NG(X8($));if($.r===$.b&&$.b===$.g)Z.a=Z.b=0;return Z},a3=r10;var a10=({l:$,a:Z,b:H,alpha:J})=>{if($===void 0)$=0;if(Z===void 0)Z=0;if(H===void 0)H=0;let B=Math.pow($+0.3963377773761749*Z+0.2158037573099136*H,3),Q=Math.pow($-0.1055613458156586*Z-0.0638541728258133*H,3),z=Math.pow($-0.0894841775298119*Z-1.2914855480194092*H,3),X={mode:"lrgb",r:4.076741636075957*B-3.3077115392580616*Q+0.2309699031821044*z,g:-1.2684379732850317*B+2.6097573492876887*Q-0.3413193760026573*z,b:-0.0041960761386756*B-0.7034186179359362*Q+1.7076146940746117*z};if(J!==void 0)X.alpha=J;return X},P9=a10;var n10=($)=>G8(P9($)),n3=n10;function bJ($){return 0.5*(1.170873786407767*$-0.206+Math.sqrt((1.170873786407767*$-0.206)*(1.170873786407767*$-0.206)+0.14050485436893204*$))}function C7($){return($*$+0.206*$)/(1.170873786407767*($+0.03))}function o10($,Z){let H,J,B,Q,z,X,G,U;if(-1.88170328*$-0.80936493*Z>1)H=1.19086277,J=1.76576728,B=0.59662641,Q=0.75515197,z=0.56771245,X=4.0767416621,G=-3.3077115913,U=0.2309699292;else if(1.81444104*$-1.19445276*Z>1)H=0.73956515,J=-0.45954404,B=0.08285427,Q=0.1254107,z=0.14503204,X=-1.2684380046,G=2.6097574011,U=-0.3413193965;else H=1.35733652,J=-0.00915799,B=-1.1513021,Q=-0.50559606,z=0.00692167,X=-0.0041960863,G=-0.7034186147,U=1.707614701;let K=H+J*$+B*Z+Q*$*$+z*$*Z,F=0.3963377774*$+0.2158037573*Z,Y=-0.1055613458*$-0.0638541728*Z,W=-0.0894841775*$-1.291485548*Z;{let A=1+K*F,N=1+K*Y,L=1+K*W,V=A*A*A,D=N*N*N,q=L*L*L,j=3*F*A*A,M=3*Y*N*N,P=3*W*L*L,T=6*F*F*A,C=6*Y*Y*N,k=6*W*W*L,E=X*V+G*D+U*q,h=X*j+G*M+U*P,x=X*T+G*C+U*k;K=K-E*h/(h*h-0.5*E*x)}return K}function IN($,Z){let H=o10($,Z),J=P9({l:1,a:H*$,b:H*Z}),B=Math.cbrt(1/Math.max(J.r,J.g,J.b)),Q=B*H;return[B,Q]}function s10($,Z,H,J,B,Q=null){if(!Q)Q=IN($,Z);let z;if((H-B)*Q[1]-(Q[0]-B)*J<=0)z=Q[1]*B/(J*Q[0]+Q[1]*(B-H));else{z=Q[1]*(B-1)/(J*(Q[0]-1)+Q[1]*(B-H));{let X=H-B,G=J,U=0.3963377774*$+0.2158037573*Z,K=-0.1055613458*$-0.0638541728*Z,F=-0.0894841775*$-1.291485548*Z,Y=X+G*U,W=X+G*K,A=X+G*F;{let N=B*(1-z)+z*H,L=z*J,V=N+L*U,D=N+L*K,q=N+L*F,j=V*V*V,M=D*D*D,P=q*q*q,T=3*Y*V*V,C=3*W*D*D,k=3*A*q*q,E=6*Y*Y*V,h=6*W*W*D,x=6*A*A*q,R=4.0767416621*j-3.3077115913*M+0.2309699292*P-1,w=4.0767416621*T-3.3077115913*C+0.2309699292*k,S=4.0767416621*E-3.3077115913*h+0.2309699292*x,I=w/(w*w-0.5*R*S),y=-R*I,f=-1.2684380046*j+2.6097574011*M-0.3413193965*P-1,g=-1.2684380046*T+2.6097574011*C-0.3413193965*k,O=-1.2684380046*E+2.6097574011*h-0.3413193965*x,c=g/(g*g-0.5*f*O),o=-f*c,b=-0.0041960863*j-0.7034186147*M+1.707614701*P-1,d=-0.0041960863*T-0.7034186147*C+1.707614701*k,t=-0.0041960863*E-0.7034186147*h+1.707614701*x,u=d/(d*d-0.5*b*t),a=-b*u;y=I>=0?y:1e6,o=c>=0?o:1e6,a=u>=0?a:1e6,z+=Math.min(y,Math.min(o,a))}}}return z}function yJ($,Z,H=null){if(!H)H=IN($,Z);let J=H[0],B=H[1];return[B/J,B/(1-J)]}function VG($,Z,H){let J=IN(Z,H),B=s10(Z,H,$,1,$,J),Q=yJ(Z,H,J),z=0.11516993+1/(7.4477897+4.1590124*H+Z*(-2.19557347+1.75198401*H+Z*(-2.13704948-10.02301043*H+Z*(-4.24894561+5.38770819*H+4.69891013*Z)))),X=0.11239642+1/(1.6132032-0.68124379*H+Z*(0.40370612+0.90148123*H+Z*(-0.27087943+0.6122399*H+Z*(0.00299215-0.45399568*H-0.14661872*Z)))),G=B/Math.min($*Q[0],(1-$)*Q[1]),U=$*z,K=(1-$)*X,F=0.9*G*Math.sqrt(Math.sqrt(1/(1/(U*U*U*U)+1/(K*K*K*K))));return U=$*0.4,K=(1-$)*0.8,[Math.sqrt(1/(1/(U*U)+1/(K*K))),F,B]}function LG($){let Z=$.l!==void 0?$.l:0,H=$.a!==void 0?$.a:0,J=$.b!==void 0?$.b:0,B={mode:"okhsl",l:bJ(Z)};if($.alpha!==void 0)B.alpha=$.alpha;let Q=Math.sqrt(H*H+J*J);if(!Q)return B.s=0,B;let[z,X,G]=VG(Z,H/Q,J/Q),U;if(Q<X){let K=0,F=0.8*z,Y=1-F/X;U=(Q-K)/(F+Y*(Q-K))*0.8}else{let K=X,F=0.2*X*X*1.25*1.25/z,Y=1-F/(G-X);U=0.8+0.2*((Q-K)/(F+Y*(Q-K)))}if(U)B.s=U,B.h=A5(Math.atan2(J,H)*180/Math.PI);return B}function DG($){let Z=$.h!==void 0?$.h:0,H=$.s!==void 0?$.s:0,J=$.l!==void 0?$.l:0,B={mode:"oklab",l:C7(J)};if($.alpha!==void 0)B.alpha=$.alpha;if(!H||J===1)return B.a=B.b=0,B;let Q=Math.cos(Z/180*Math.PI),z=Math.sin(Z/180*Math.PI),[X,G,U]=VG(B.l,Q,z),K,F,Y,W;if(H<0.8)K=1.25*H,F=0,Y=0.8*X,W=1-Y/G;else K=5*(H-0.8),F=G,Y=0.2*G*G*1.25*1.25/X,W=1-Y/(U-G);let A=F+K*Y/(1-W*K);return B.a=A*Q,B.b=A*z,B}var t10={...$G,mode:"okhsl",channels:["h","s","l","alpha"],parse:["--okhsl"],serialize:"--okhsl",fromMode:{oklab:LG,rgb:($)=>LG(a3($))},toMode:{oklab:DG,rgb:($)=>n3(DG($))}},IS=t10;function qG($){let Z=$.l!==void 0?$.l:0,H=$.a!==void 0?$.a:0,J=$.b!==void 0?$.b:0,B=Math.sqrt(H*H+J*J),Q=B?H/B:1,z=B?J/B:1,[X,G]=yJ(Q,z),U=0.5,K=1-U/X,F=G/(B+Z*G),Y=F*Z,W=F*B,A=C7(Y),N=W*A/Y,L=P9({l:A,a:Q*N,b:z*N}),V=Math.cbrt(1/Math.max(L.r,L.g,L.b,0));Z=Z/V,B=B/V*bJ(Z)/Z,Z=bJ(Z);let D={mode:"okhsv",s:B?(U+G)*W/(G*U+G*K*W):0,v:Z?Z/Y:0};if(D.s)D.h=A5(Math.atan2(J,H)*180/Math.PI);if($.alpha!==void 0)D.alpha=$.alpha;return D}function MG($){let Z={mode:"oklab"};if($.alpha!==void 0)Z.alpha=$.alpha;let H=$.h!==void 0?$.h:0,J=$.s!==void 0?$.s:0,B=$.v!==void 0?$.v:0,Q=Math.cos(H/180*Math.PI),z=Math.sin(H/180*Math.PI),[X,G]=yJ(Q,z),U=0.5,K=1-U/X,F=1-J*U/(U+G-G*K*J),Y=J*G*U/(U+G-G*K*J),W=C7(F),A=Y*W/F,N=P9({l:W,a:Q*A,b:z*A}),L=Math.cbrt(1/Math.max(N.r,N.g,N.b,0)),V=C7(B*F),D=Y*V/F;return Z.l=V*L,Z.a=D*Q*L,Z.b=D*z*L,Z}var e10={...ZG,mode:"okhsv",channels:["h","s","v","alpha"],parse:["--okhsv"],serialize:"--okhsv",fromMode:{oklab:qG,rgb:($)=>qG(a3($))},toMode:{oklab:MG,rgb:($)=>n3(MG($))}},kS=e10;function $50($,Z){if(!Z||Z[0]!=="oklab")return;let H={mode:"oklab"},[,J,B,Q,z]=Z;if(J.type===_0.Hue||B.type===_0.Hue||Q.type===_0.Hue)return;if(J.type!==_0.None)H.l=Math.min(Math.max(0,J.type===_0.Number?J.value:J.value/100),1);if(B.type!==_0.None)H.a=B.type===_0.Number?B.value:B.value*0.4/100;if(Q.type!==_0.None)H.b=Q.type===_0.Number?Q.value:Q.value*0.4/100;if(z.type!==_0.None)H.alpha=Math.min(1,Math.max(0,z.type===_0.Number?z.value:z.value/100));return H}var RS=$50;var Z50={...$Z,mode:"oklab",toMode:{lrgb:P9,rgb:n3},fromMode:{lrgb:NG,rgb:a3},ranges:{l:[0,1],a:[-0.4,0.4],b:[-0.4,0.4]},parse:[RS],serialize:($)=>`oklab(${$.l!==void 0?$.l:"none"} ${$.a!==void 0?$.a:"none"} ${$.b!==void 0?$.b:"none"}${$.alpha<1?` / ${$.alpha}`:""})`},bS=Z50;function H50($,Z){if(!Z||Z[0]!=="oklch")return;let H={mode:"oklch"},[,J,B,Q,z]=Z;if(J.type!==_0.None){if(J.type===_0.Hue)return;H.l=Math.min(Math.max(0,J.type===_0.Number?J.value:J.value/100),1)}if(B.type!==_0.None)H.c=Math.max(0,B.type===_0.Number?B.value:B.value*0.4/100);if(Q.type!==_0.None){if(Q.type===_0.Percentage)return;H.h=Q.value}if(z.type!==_0.None)H.alpha=Math.min(1,Math.max(0,z.type===_0.Number?z.value:z.value/100));return H}var yS=H50;var J50={...ZZ,mode:"oklch",toMode:{oklab:($)=>p2($,"oklab"),rgb:($)=>n3(p2($,"oklab"))},fromMode:{rgb:($)=>u2(a3($),"oklch"),oklab:($)=>u2($,"oklch")},parse:[yS],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]}},hS=J50;var B50=($)=>{let{r:Z,g:H,b:J,alpha:B}=X8($),Q={mode:"xyz65",x:0.486570948648216*Z+0.265667693169093*H+0.1982172852343625*J,y:0.2289745640697487*Z+0.6917385218365062*H+0.079286914093745*J,z:0*Z+0.0451133818589026*H+1.043944368900976*J};if(B!==void 0)Q.alpha=B;return Q},kN=B50;var Q50=({x:$,y:Z,z:H,alpha:J})=>{if($===void 0)$=0;if(Z===void 0)Z=0;if(H===void 0)H=0;let B=G8({r:$*2.4934969119414263-Z*0.9313836179191242-0.402710784450717*H,g:$*-0.8294889695615749+Z*1.7626640603183465+0.0236246858419436*H,b:$*0.0358458302437845-Z*0.0761723892680418+0.9568845240076871*H},"p3");if(J!==void 0)B.alpha=J;return B},RN=Q50;var z50={...z8,mode:"p3",parse:["display-p3"],serialize:"display-p3",fromMode:{rgb:($)=>RN(T2($)),xyz65:RN},toMode:{rgb:($)=>C2(kN($)),xyz65:kN}},xS=z50;var bN=($)=>{let Z=Math.abs($);if(Z>=0.001953125)return Math.sign($)*Math.pow(Z,0.5555555555555556);return 16*$},X50=({x:$,y:Z,z:H,alpha:J})=>{if($===void 0)$=0;if(Z===void 0)Z=0;if(H===void 0)H=0;let B={mode:"prophoto",r:bN($*1.3457868816471585-Z*0.2555720873797946-0.0511018649755453*H),g:bN($*-0.5446307051249019+Z*1.5082477428451466+0.0205274474364214*H),b:bN($*0+Z*0+1.2119675456389452*H)};if(J!==void 0)B.alpha=J;return B},yN=X50;var hN=($=0)=>{let Z=Math.abs($);if(Z>=0.03125)return Math.sign($)*Math.pow(Z,1.8);return $/16},G50=($)=>{let Z=hN($.r),H=hN($.g),J=hN($.b),B={mode:"xyz50",x:0.7977666449006423*Z+0.1351812974005331*H+0.0313477341283922*J,y:0.2880748288194013*Z+0.7118352342418731*H+0.0000899369387256*J,z:0*Z+0*H+0.8251046025104602*J};if($.alpha!==void 0)B.alpha=$.alpha;return B},xN=G50;var U50={...z8,mode:"prophoto",parse:["prophoto-rgb"],serialize:"prophoto-rgb",fromMode:{xyz50:yN,rgb:($)=>yN(M9($))},toMode:{xyz50:xN,rgb:($)=>q9(xN($))}},vS=U50;var vN=($)=>{let Z=Math.abs($);if(Z>0.018053968510807)return(Math.sign($)||1)*(1.09929682680944*Math.pow(Z,0.45)-0.09929682680944008);return 4.5*$},K50=({x:$,y:Z,z:H,alpha:J})=>{if($===void 0)$=0;if(Z===void 0)Z=0;if(H===void 0)H=0;let B={mode:"rec2020",r:vN($*1.7166511879712683-Z*0.3556707837763925-0.2533662813736599*H),g:vN($*-0.6666843518324893+Z*1.6164812366349395+0.0157685458139111*H),b:vN($*0.0176398574453108-Z*0.0427706132578085+0.9421031212354739*H)};if(J!==void 0)B.alpha=J;return B},gN=K50;var fN=($=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)},F50=($)=>{let Z=fN($.r),H=fN($.g),J=fN($.b),B={mode:"xyz65",x:0.6369580483012911*Z+0.1446169035862083*H+0.1688809751641721*J,y:0.262700212011267*Z+0.6779980715188708*H+0.059301716469862*J,z:0*Z+0.0280726930490874*H+1.0609850577107909*J};if($.alpha!==void 0)B.alpha=$.alpha;return B},mN=F50;var Y50={...z8,mode:"rec2020",fromMode:{xyz65:gN,rgb:($)=>gN(T2($))},toMode:{xyz65:mN,rgb:($)=>C2(mN($))},parse:["rec2020"],serialize:"rec2020"},gS=Y50;var o3=0.0037930732552754493,PG=Math.cbrt(0.0037930732552754493);var uN=($)=>Math.cbrt($)-PG,W50=($)=>{let{r:Z,g:H,b:J,alpha:B}=X8($),Q=uN(0.3*Z+0.622*H+0.078*J+o3),z=uN(0.23*Z+0.692*H+0.078*J+o3),X=uN(0.2434226892454782*Z+0.2047674442449682*H+0.5518098665095535*J+o3),G={mode:"xyb",x:(Q-z)/2,y:(Q+z)/2,b:X-(Q+z)/2};if(B!==void 0)G.alpha=B;return G},fS=W50;var pN=($)=>Math.pow($+PG,3),A50=({x:$,y:Z,b:H,alpha:J})=>{if($===void 0)$=0;if(Z===void 0)Z=0;if(H===void 0)H=0;let B=pN($+Z)-o3,Q=pN(Z-$)-o3,z=pN(H+Z)-o3,X=G8({r:11.031566904639861*B-9.866943908131562*Q-0.16462299650829934*z,g:-3.2541473810744237*B+4.418770377582723*Q-0.16462299650829934*z,b:-3.6588512867136815*B+2.7129230459360922*Q+1.9459282407775895*z});if(J!==void 0)X.alpha=J;return X},mS=A50;var N50={mode:"xyb",channels:["x","y","b","alpha"],parse:["--xyb"],serialize:"--xyb",toMode:{rgb:mS},fromMode:{rgb:fS},ranges:{x:[-0.0154,0.0281],y:[0,0.8453],b:[-0.2778,0.388]},interpolate:{x:C0,y:C0,b:C0,alpha:{use:C0,fixup:E1}}},uS=N50;var V50={mode:"xyz50",parse:["xyz-d50"],serialize:"xyz-d50",toMode:{rgb:q9,lab:e$},fromMode:{rgb:M9,lab:t$},channels:["x","y","z","alpha"],ranges:{x:[0,0.964],y:[0,0.999],z:[0,0.825]},interpolate:{x:C0,y:C0,z:C0,alpha:{use:C0,fixup:E1}}},pS=V50;var L50=($)=>{let{x:Z,y:H,z:J,alpha:B}=$;if(Z===void 0)Z=0;if(H===void 0)H=0;if(J===void 0)J=0;let Q={mode:"xyz50",x:1.0479298208405488*Z+0.0229467933410191*H-0.0501922295431356*J,y:0.0296278156881593*Z+0.990434484573249*H-0.0170738250293851*J,z:-0.0092430581525912*Z+0.0150551448965779*H+0.7518742899580008*J};if(B!==void 0)Q.alpha=B;return Q},cS=L50;var D50=($)=>{let{x:Z,y:H,z:J,alpha:B}=$;if(Z===void 0)Z=0;if(H===void 0)H=0;if(J===void 0)J=0;let Q={mode:"xyz65",x:0.9554734527042182*Z-0.0230985368742614*H+0.0632593086610217*J,y:-0.0283697069632081*Z+1.0099954580058226*H+0.021041398966943*J,z:0.0123140016883199*Z-0.0205076964334779*H+1.3303659366080753*J};if(B!==void 0)Q.alpha=B;return Q},dS=D50;var q50={mode:"xyz65",toMode:{rgb:C2,xyz50:cS},fromMode:{rgb:T2,xyz50:dS},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:C0,y:C0,z:C0,alpha:{use:C0,fixup:E1}}},lS=q50;var M50=({r:$,g:Z,b:H,alpha:J})=>{if($===void 0)$=0;if(Z===void 0)Z=0;if(H===void 0)H=0;let B={mode:"yiq",y:0.29889531*$+0.58662247*Z+0.11448223*H,i:0.59597799*$-0.2741761*Z-0.32180189*H,q:0.21147017*$-0.52261711*Z+0.31114694*H};if(J!==void 0)B.alpha=J;return B},iS=M50;var P50=({y:$,i:Z,q:H,alpha:J})=>{if($===void 0)$=0;if(Z===void 0)Z=0;if(H===void 0)H=0;let B={mode:"rgb",r:$+0.95608445*Z+0.6208885*H,g:$-0.27137664*Z-0.6486059*H,b:$-1.10561724*Z+1.70250126*H};if(J!==void 0)B.alpha=J;return B},rS=P50;var _50={mode:"yiq",toMode:{rgb:rS},fromMode:{rgb:iS},channels:["y","i","q","alpha"],parse:["--yiq"],serialize:"--yiq",ranges:{i:[-0.595,0.595],q:[-0.522,0.522]},interpolate:{y:C0,i:C0,q:C0,alpha:{use:C0,fixup:E1}}},aS=_50;function cN($){let Z=dX("lrgb")($);return 0.2126*Z.r+0.7152*Z.g+0.0722*Z.b}var Vf0=Z5(sE),Lf0=Z5(zS),Df0=Z5(US),qf0=Z5(KS),Mf0=Z5(FS),Pf0=Z5($G),_f0=Z5(ZG),jf0=Z5(VS),Of0=Z5(LS),Tf0=Z5(qS),Cf0=Z5(MS),wf0=Z5($Z),Ef0=Z5(_S),Sf0=Z5(ZZ),If0=Z5(OS),kf0=Z5(wS),Rf0=Z5(ES),bf0=Z5(SS),yf0=Z5(IS),hf0=Z5(kS),xf0=Z5(bS),vf0=Z5(hS),gf0=Z5(xS),ff0=Z5(vS),mf0=Z5(gS),uf0=Z5(z8),pf0=Z5(uS),cf0=Z5(pS),df0=Z5(lS),lf0=Z5(aS);var s3={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"}},hJ={squishy:{label:"Squishy",radius:"0.875rem"},soft:{label:"Soft",radius:"0.625rem"},subtle:{label:"Subtle",radius:"0.375rem"},square:{label:"Square",radius:"0"}},xJ={blob:{label:"Blob",traits:{shape:0.11,"body.r":0.5,"body.ratio":0,"body.n":0.5}},boxy:{label:"Boxy",traits:{shape:0.54,"body.r":1,"body.ratio":0}},pill:{label:"Pill",traits:{shape:0.65,"body.r":1}},dorito:{label:"Dorito",traits:{shape:0.99,"body.r":1,"body.ratio":0,"body.rot":0}}},j50="oklch(0.205 0 0)";function nS($){return cN($)>0.3?"oklch(0 0 0)":"oklch(1 0 0)"}var oS={workspace:{primary:($)=>$,primaryForeground:($)=>nS($),background:()=>"color-mix(in srgb, var(--primary) 2%, oklch(1 0 0) 98%)",foreground:()=>"color-mix(in srgb, var(--primary) 20%, oklch(0 0 0) 80%)",muted:()=>"color-mix(in srgb, var(--background) 95%, var(--foreground) 5%)",mutedForeground:()=>"color-mix(in srgb, var(--background) 50%, var(--foreground) 50%)",accent:()=>"color-mix(in srgb, var(--primary) 3%, var(--foreground) 4%)",accentForeground:()=>"var(--foreground)",border:()=>"color-mix(in srgb, var(--foreground) 7%, transparent)",ring:()=>"color-mix(in srgb, var(--background) 50%, var(--primary) 50%)"},widget:{background:($)=>$,foreground:($)=>nS($),primary:()=>"color-mix(in srgb, var(--background) 2%, oklch(1 0 0) 98%)",primaryForeground:()=>"color-mix(in srgb, var(--background) 20%, oklch(0 0 0) 80%)",muted:()=>"color-mix(in srgb, var(--background) 95%, var(--foreground) 5%)",mutedForeground:()=>"color-mix(in srgb, var(--background) 50%, var(--foreground) 50%)",accent:()=>"color-mix(in srgb, var(--primary) 3%, var(--foreground) 4%)",accentForeground:()=>"var(--foreground)",border:()=>"color-mix(in srgb, var(--foreground) 15%, transparent)",ring:()=>"color-mix(in srgb, var(--background) 50%, var(--primary) 50%)"}},dN=Object.keys(oS.workspace);function O50($,Z="workspace"){let H={},J=oS[Z];for(let B of dN)H[B]=J[B]($);return H}var jG={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)"}},_9={font:"sans",color:"default",radius:"soft",agent:"boxy"};function _G($,Z,H){return typeof $==="string"&&Object.hasOwn(Z,$)?$:H}function b8($){return{font:_G($?.font,s3,_9.font),color:_G($?.color,jG,_9.color),radius:_G($?.radius,hJ,_9.radius),agent:_G($?.agent,xJ,_9.agent)}}function sS($,Z="workspace"){let H=b8($),B=jG[H.color].primary??(Z==="widget"?j50:void 0);return B?O50(B,Z):void 0}var tS=_(r(),1),T50="moi-agent",C50={default:{head:"var(--foreground)",eye:"var(--background)"},primary:{head:"var(--primary)",eye:"var(--primary-foreground)"},secondary:{head:"var(--accent)",eye:"var(--accent-foreground)"}},w50={idle:wE,happy:EE,sad:SE,surprised:IE,wink:kE,sleepy:RE,smug:bE,unsure:yE,shy:hE,thinking:xE};function j9({size:$=56,preset:Z=_9.agent,animated:H=!1,color:J="default",expression:B="idle",className:Q}){return tS.jsx(ME,{name:T50,size:$,animate:H?"always":"hover",palette:C50[J],expression:B?w50[B]:void 0,className:z0("shrink-0",Q),traits:xJ[Z].traits})}var JZ={};g5(JZ,{Trigger:()=>KI,Root:()=>GI,Panel:()=>VI});var vJ=_(p(),1);var OG=_(p(),1);function eS($){let{open:Z,defaultOpen:H=!1,onOpenChange:J,disabled:B}=$,[Q,z]=B8({controlled:Z,default:H,name:"Collapsible",state:"open"}),{mounted:X,setMounted:G,transitionStatus:U}=$8(Q,!0,!0),K=J1(),[F,Y]=OG.useState(),W=F===null?void 0:F??K,A=W0((N)=>{let L=!Q,V=R0(K0.triggerPress,N.nativeEvent);if(J(L,V),V.isCanceled)return;z(L)});return OG.useMemo(()=>({defaultPanelId:K,disabled:B,handleTrigger:A,mounted:X,open:Q,panelId:W,setMounted:G,setOpen:z,setPanelIdState:Y,transitionStatus:U}),[K,B,A,X,Q,W,G,z,Y,U])}var TG=_(p(),1),lN=TG.createContext(void 0);function CG(){let $=TG.useContext(lN);if($===void 0)throw Error(g0(15));return $}var $I="data-open",ZI="data-closed",HI=r8.startingStyle,Fm0=r8.endingStyle;var BI="data-panel-open";var S50={[$I]:""},I50={[ZI]:""},QI={open($){if($)return{[BI]:""};return null}},zI={open($){if($)return S50;return I50}};var wG={...zI,...D2};var XI=_(r(),1),GI=vJ.forwardRef(function(Z,H){let{render:J,className:B,defaultOpen:Q=!1,disabled:z=!1,onOpenChange:X,open:G,style:U,...K}=Z,F=W0(X),Y=eS({open:G,defaultOpen:Q,onOpenChange:F,disabled:z}),W=vJ.useMemo(()=>({open:Y.open,disabled:Y.disabled,transitionStatus:Y.transitionStatus}),[Y.open,Y.disabled,Y.transitionStatus]),A=vJ.useMemo(()=>({...Y,onOpenChange:F,state:W}),[Y,F,W]),N=F0("div",Z,{state:W,ref:H,props:K,stateAttributesMapping:wG});return XI.jsx(lN.Provider,{value:A,children:N})});var UI=_(p(),1);var k50={...QI,...D2},KI=UI.forwardRef(function(Z,H){let{panelId:J,open:B,handleTrigger:Q,state:z,disabled:X}=CG(),{className:G,disabled:U=X,render:K,nativeButton:F=!0,style:Y,...W}=Z,{getButtonProps:A,buttonRef:N}=R5({disabled:U,focusableWhenDisabled:!0,native:F});return F0("button",Z,{state:z,ref:[H,N],props:[{"aria-controls":B?J:void 0,"aria-expanded":B,onClick:Q},W,A],stateAttributesMapping:k50})});var iN=_(p(),1);var X2=_(p(),1);var gJ={height:void 0,width:void 0};function YI($){let{externalRef:Z,hiddenUntilFound:H,id:J,keepMounted:B,mounted:Q,onOpenChange:z,open:X,setMounted:G,setOpen:U,transitionStatus:K}=$,F=X2.useRef(null),Y=X2.useRef(null),[W,A]=X2.useState(gJ),N=X2.useRef(gJ),L=X2.useRef(!1),V=X2.useRef(X),D=X2.useRef(!1),[q,j]=X2.useState(!1),M=X2.useRef(null),P=v2(Z,F),T=Q5(X),C=P2(F),k=!X&&!Q,E=q?"idle":K,h=X&&(V.current||D.current),x=!X&&Q&&Y.current==="css-animation"&&W.height===void 0&&W.width===void 0?N.current:W,R=H&&k&&Y.current!=="css-animation",w=W0((g,O=!0)=>{if(O)N.current=g;A(g)}),S=W0(()=>{M.current?.(),M.current=null}),I=W0((g)=>{S(),M.current=()=>{M.current=null,g()}}),y=W0(()=>{if(X&&Q&&Y.current==="css-animation")D.current=!0});J0(()=>{if(!q||K==="starting")return;j(!1)},[q,K]),X2.useEffect(()=>{return()=>{y(),S()}},[y,S]),J0(()=>{let g=F.current;if(!g)return;if(!X&&M.current)S();let O=R50(g,h);if(Y.current=O,X&&K==="idle"&&V.current&&O==="css-animation"){N.current=HZ(g);return}if(X&&K==="starting"){let b=L.current;if(L.current=!1,O==="none"){w(HZ(g)),j(!0);return}if(O==="css-transition"){let u=b50(g);if(w(HZ(g)),!b)return u;let a=EG(g,"transition-duration","0s");return I(a),j(!0),u}w(HZ(g));let d=EG(g,"animation-name","none");if(!b){d();return}let t=EG(g,"animation-duration","0s");d(),I(t),j(!0);return}if(!X&&Q&&(K==="idle"||K==="starting")){if(V.current=!1,D.current=!1,O==="none"){w(gJ,!1),G(!1);return}w(HZ(g));return}if(K!=="ending")return;if(O==="none"){G(!1);return}let c=HZ(g);if(!(c.height>0||c.width>0)){G(!1);return}if(w(c),O==="css-animation")EG(g,"animation-name","none")();return},[Q,X,S,w,G,I,h,K]),f5({enabled:X&&Q&&E==="idle",open:!0,ref:F,onComplete(){if(!X)return;w(gJ,!1)}}),X2.useEffect(()=>{if(X||!Q||E!=="ending")return;if(!F.current)return;let O=new AbortController,c=-1;function o(){if(T.current)return;G(!1),w(gJ,!1)}return c=j4.request(()=>{C(o,O.signal)}),()=>{j4.cancel(c),O.abort()}},[T,Q,X,E,C,w,G]),J0(()=>{let g=F.current;if(!g||!H||!k)return;g.setAttribute("hidden","until-found")},[k,H]),X2.useEffect(function(){let O=F.current;if(!O)return;function c(o){let b=R0(K0.none,o);if(z(!0,b),b.isCanceled)return;L.current=!0,U(!0)}return i0(O,"beforematch",c)},[z,U]);let f=B||H||Q||X;return{height:x.height,props:{...R?{[HI]:""}:void 0,hidden:k,id:J},ref:P,shouldPreventOpenAnimation:h,shouldRender:f,transitionStatus:E,width:x.width}}function HZ($){return{height:$.scrollHeight,width:$.scrollWidth}}function R50($,Z){let H=u1($).getComputedStyle($),J=(H.animationName.split(",").map((Q)=>Q.trim()).some((Q)=>Q!==""&&Q!=="none")||Z)&&FI(H.animationDuration),B=FI(H.transitionDuration);if(J&&B)return"css-transition";if(B)return"css-transition";if(J)return"css-animation";return"none"}function FI($){return $.split(",").map((Z)=>Z.trim()).some((Z)=>Z!==""&&Number.parseFloat(Z)>0)}function EG($,Z,H){let J=$.style.getPropertyValue(Z),B=$.style.getPropertyPriority(Z);return $.style.setProperty(Z,H),()=>{if(J===""){$.style.removeProperty(Z);return}$.style.setProperty(Z,J,B)}}function b50($){let Z={"justify-content":$.style.justifyContent,"align-items":$.style.alignItems,"align-content":$.style.alignContent,"justify-items":$.style.justifyItems};Object.keys(Z).forEach((B)=>{$.style.setProperty(B,"initial","important")});function H(){Object.entries(Z).forEach(([B,Q])=>{if(Q===""){$.style.removeProperty(B);return}$.style.setProperty(B,Q)})}let J=j4.request(H);return()=>{j4.cancel(J),H()}}var WI="--collapsible-panel-height",AI="--collapsible-panel-width";var VI=iN.forwardRef(function(Z,H){let{className:J,hiddenUntilFound:B,keepMounted:Q,render:z,id:X,style:G,...U}=Z,{defaultPanelId:K,mounted:F,onOpenChange:Y,open:W,setMounted:A,setPanelIdState:N,setOpen:L,state:V,transitionStatus:D}=CG(),q=B??!1,j=Q??!1,M=X||void 0,P=M??K;J0(()=>{return N((y)=>M??(y===null?void 0:y)),()=>{N((y)=>y===M?null:y)}},[M,N]);let{height:T,props:C,ref:k,shouldPreventOpenAnimation:E,shouldRender:h,transitionStatus:x,width:R}=YI({externalRef:H,hiddenUntilFound:q,id:P,keepMounted:j,mounted:F,onOpenChange:Y,open:W,setMounted:A,setOpen:L,transitionStatus:D}),w={...V,transitionStatus:x},S=NI(G,w),I=F0("div",{...Z,style:void 0},{state:w,ref:k,props:[C,{style:{[WI]:T===void 0?"auto":`${T}px`,[AI]:R===void 0?"auto":`${R}px`}},U,S?{style:S}:void 0,E?{style:{animationName:"none"}}:void 0],stateAttributesMapping:wG});if(!h)return null;return I});var RG=_(r(),1);function SG({...$}){return RG.jsx(JZ.Root,{"data-slot":"collapsible",...$})}function IG({...$}){return RG.jsx(JZ.Trigger,{"data-slot":"collapsible-trigger",...$})}function kG({...$}){return RG.jsx(JZ.Panel,{"data-slot":"collapsible-content",...$})}var bG=_(p(),1);var rN="moi-fonts",LI="moi-font-previews",h50=Object.values(s3).map(($)=>$.googleFontsQuery).filter(Boolean).join("&family="),qI=[["sans","--sans"],["mono","--mono"]],MI=dN.map(($)=>[$,x50($)]),PI="--radius",DI=[...qI.map(([,$])=>$),...MI.map(([,$])=>$),PI];function x50($){return`--${$.replace(/[A-Z]/g,(H)=>`-${H.toLowerCase()}`)}`}function v50($){let Z={},H=b8($),J=H.font===_9.font?void 0:s3[H.font];for(let[B,Q]of qI)Z[Q]=J?.[B];return Z}function aN($,Z="workspace"){let H={},J=sS($,Z);for(let[B,Q]of MI)H[Q]=J?.[B];return H}function g50($){let Z={},H=b8($),J=H.radius===_9.radius?void 0:hJ[H.radius];return Z[PI]=J?.radius,Z}function y8($,Z="workspace"){return{...v50($),...aN($,Z),...g50($)}}function yG(){bG.useEffect(()=>{if(document.getElementById(LI))return;let $=document.createElement("link");return $.id=LI,$.rel="stylesheet",$.crossOrigin="anonymous",$.href=`https://fonts.googleapis.com/css2?family=${h50}&display=swap`,document.head.appendChild($),()=>{$.remove()}},[])}function f50($){bG.useEffect(()=>{let Z=document.documentElement,H=y8($);for(let J of DI){let B=H[J];if(B)Z.style.setProperty(J,B);else Z.style.removeProperty(J)}return()=>{for(let J of DI)Z.style.removeProperty(J)}},[$])}function _I($){let{font:Z}=b8($);f50($),bG.useEffect(()=>{let H=s3[Z]??s3[_9.font],J=document.getElementById(rN);if(!H.googleFontsQuery)J?.remove();else{let B=`https://fonts.googleapis.com/css2?family=${H.googleFontsQuery}&display=swap`;if(J)J.href=B;else{let Q=document.createElement("link");Q.id=rN,Q.rel="stylesheet",Q.crossOrigin="anonymous",Q.href=B,document.head.appendChild(Q)}}return()=>{document.getElementById(rN)?.remove()}},[Z])}function nN($){return $==="agent"||$==="widgets"||$==="scratchpad"||typeof $==="string"&&(/^view:[^/]+$/.test($)||/^view-builder:[^/]+$/.test($))}function fJ($){return nN($)?$:null}function hG($,Z){return`/workspace/${$}/${Z}`}var xG=($)=>`view:${$}`,t3=($)=>$.startsWith("view:")?$.slice(5):null,e3=($)=>`view-builder:${$}`,w7=($)=>$.startsWith("view-builder:")?$.slice(13):null;function BZ($){return typeof $==="object"&&$!==null&&!Array.isArray($)}function jI($){if(!BZ($))return{};let Z=$.appletParams;return BZ(Z)?Z:{}}var QZ=_(p(),1);var B4=_(r(),1),mJ={width:320,height:180,radius:32,topLeftRadius:18,bodyTop:24,tabEnd:124,shoulder:{width:48,roundness:20}};function m50($){let{width:Z,height:H,radius:J,topLeftRadius:B,bodyTop:Q,tabEnd:z,shoulder:X}=mJ,G=Math.min(Z/2,J*$),U=Math.min(Z/2,B*$),K=Math.max(0,X.width),F=z+K,Y=Math.max(0,Math.min(X.roundness,K/2));return[`M ${U} 0`,`H ${z}`,`C ${z+Y} 0 ${F-Y} ${Q} ${F} ${Q}`,`H ${Z-G}`,`Q ${Z} ${Q} ${Z} ${Q+J}`,`V ${H-J}`,`Q ${Z} ${H} ${Z-G} ${H}`,`H ${G}`,`Q 0 ${H} 0 ${H-J}`,`V ${B}`,`Q 0 0 ${U} 0`,"Z"].join(" ")}function u50(){let $=QZ.useRef(null),[Z,H]=QZ.useState(1);return QZ.useLayoutEffect(()=>{let J=$.current;if(!J)return;let B=(X,G)=>{if(X<=0||G<=0)return;let U=X/mJ.width,F=G/mJ.height/U;H((Y)=>Math.abs(Y-F)<0.001?Y:F)},Q=J.getBoundingClientRect();B(Q.width,Q.height);let z=new ResizeObserver(([X])=>{if(X)B(X.contentRect.width,X.contentRect.height)});return z.observe(J),()=>z.disconnect()},[]),{ref:$,horizontalRadiusScale:Z}}var OI=[{frame:z0("-translate-x-3 translate-y-3 -rotate-6","group-focus-within:translate-y-2 group-hover:translate-y-2"),img:"opacity-40"},{frame:z0("translate-x-3 translate-y-2 rotate-5","group-focus-within:translate-y-1 group-hover:translate-y-1"),img:"opacity-50"},{frame:z0("-translate-x-1 translate-y-1 -rotate-2","group-focus-within:-translate-y-2 group-hover:-translate-y-2"),img:"opacity-100"}];function TI({workspaceId:$}){let Z=iz($),H=Z.data?[...Z.data.thumbnails].reverse():[],J=OI.slice(OI.length-H.length),B=Z.data?.firstUserMessage,Q=Z.data?.theme,{ref:z,horizontalRadiusScale:X}=u50(),G=m50(X),U=`folder-noise-${$}`,K=y8(Q),F=aN(Q);return B4.jsxs("div",{ref:z,style:F,className:"relative h-45 w-full",children:[B4.jsxs("svg",{viewBox:`0 0 ${mJ.width} ${mJ.height}`,preserveAspectRatio:"none","aria-hidden":"true",className:"absolute inset-0 h-full w-full overflow-visible",children:[B4.jsx("defs",{children:B4.jsxs("filter",{id:U,x:"0%",y:"0%",width:"100%",height:"100%",colorInterpolationFilters:"sRGB",children:[B4.jsx("feTurbulence",{type:"fractalNoise",baseFrequency:"0.5",numOctaves:"3",seed:"7",result:"noise"}),B4.jsx("feColorMatrix",{in:"noise",type:"saturate",values:"0",result:"monochromeNoise"}),B4.jsx("feComponentTransfer",{in:"monochromeNoise",result:"faintNoise",children:B4.jsx("feFuncA",{type:"linear",slope:"0.24"})}),B4.jsx("feComposite",{in:"faintNoise",in2:"SourceAlpha",operator:"in",result:"clippedNoise"}),B4.jsx("feBlend",{in:"SourceGraphic",in2:"clippedNoise",mode:"soft-light"})]})}),B4.jsx("path",{d:G,filter:`url(#${U})`,className:"fill-accent"})]}),H.map((Y,W)=>B4.jsx("div",{className:z0("absolute top-[12%] left-[14%] w-fit max-w-[72%] overflow-hidden rounded-[calc(var(--radius-2xl)*0.4)] bg-background shadow-xs squircle","animate-in duration-300 ease-out fade-in",J[W].frame),children:B4.jsx("img",{src:Y,alt:"",loading:"lazy",className:z0("block h-auto max-h-32 w-auto max-w-full object-contain",J[W].img)})},Y)),H.length===0&&B&&B4.jsx("div",{className:"absolute inset-x-[12%] top-[22%] flex justify-end",children:B4.jsx("div",{"aria-hidden":"true",style:K,className:z0("w-max max-w-40 origin-center rounded-lg bg-card px-3 py-2 font-sans shadow-xs","animate-in transition-transform duration-300 ease-out fade-in","-translate-x-1 translate-y-1 -rotate-2","group-focus-within:translate-y-0.5 group-hover:translate-y-0.5"),children:B4.jsx("p",{className:"line-clamp-3 text-sm leading-normal whitespace-normal",children:B})})}),B4.jsx("div",{className:z0("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 t0=_(r(),1);function EI(){yG();let[,$]=o2(),Z=lz(),H=wT(),J=rz(),B=ew({onSuccess:(A)=>$(`/workspace/${A.id}`)}),Q=N9(),[z,X]=wI.useState(!1),G=S5((A)=>A.discoveredWorkspacesOpen),U=S5((A)=>A.setDiscoveredWorkspacesOpen);if(Z.isPending||H.isPending)return t0.jsx("div",{className:"flex min-h-[50vh] items-center justify-center",children:t0.jsx(y5,{size:20,stroke:1.5,className:"animate-spin text-muted-foreground"})});if(Z.isError||H.isError)return t0.jsx("div",{className:"flex min-h-[50vh] items-center justify-center",children:t0.jsx("p",{className:"text-sm text-muted-foreground",children:"Could not load spaces."})});let K=Z.data,F=H.data,Y=K.length;function W(A){if(Q.cloudDemo){X(!0);return}B.startImport(A)}return t0.jsxs("div",{className:"mx-auto w-full max-w-3xl px-8 pt-14 pb-16",children:[t0.jsx(JE,{className:"mb-10"}),Y>0?t0.jsxs("section",{className:"mb-12",children:[t0.jsxs("div",{className:"mb-4 flex items-center justify-between gap-2",children:[t0.jsx("h1",{className:"text-sm font-medium text-foreground",children:"My workspaces"}),t0.jsx(zJ,{trigger:t0.jsxs(E0,{variant:"outline",size:"sm",children:[t0.jsx(O2,{"data-icon":"inline-start",stroke:1.75}),"New"]})})]}),t0.jsx("div",{className:"grid grid-cols-1 gap-x-4 gap-y-8 sm:grid-cols-2 md:grid-cols-3",children:K.map((A)=>t0.jsx(p50,{workspace:A},A.id))})]}):t0.jsxs("div",{className:"mb-10 flex flex-col items-center gap-4 px-8 pt-8 pb-16 text-center",children:[t0.jsx(CI,{size:32,stroke:1.5,className:"text-muted-foreground"}),t0.jsxs("div",{className:"flex flex-col gap-1.5",children:[t0.jsx("h2",{className:"font-medium",children:"Let’s start with creating your first workspace"}),t0.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."})]}),t0.jsx(zJ,{trigger:t0.jsx(E0,{children:"Create workspace"})})]}),F.length>0&&t0.jsx("section",{children:t0.jsxs(SG,{open:G,onOpenChange:U,className:"group",children:[t0.jsxs(IG,{className:z0("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:[t0.jsx("span",{className:"text-sm font-medium",children:"Import from this computer"}),t0.jsx(E7,{size:16,stroke:2,className:z0("opacity-0 transition-[opacity,transform]","group-hover/trigger:opacity-100 group-focus-visible/trigger:opacity-100 group-data-open:rotate-90")})]}),t0.jsx(kG,{children:t0.jsx("ul",{className:"border-t border-border",children:F.map((A)=>t0.jsx(c50,{suggestion:A,onAdd:W},A.path))})})]})}),B.choice&&t0.jsx(sw,{choice:B.choice,availability:J.data?.availability,isPending:B.isPending,errorMessage:B.error?.message,onTypeChange:B.selectType,onSubmit:B.submit,onReset:B.reset}),t0.jsx(m$,{open:z,onOpenChange:X})]})}function p50({workspace:$}){let Z=A7($),H=iz($.id),J=H.data?.theme,B=b8(J).agent,Q=w4((G)=>mz(G.activity,$.id)),z=H.data?.updatedAt??new Date($.addedAt).getTime(),X=`/workspace/${$.id}`;return t0.jsxs("div",{className:"group flex min-w-0 flex-col gap-3",children:[t0.jsxs("div",{className:"relative",children:[t0.jsx(TI,{workspaceId:$.id}),t0.jsx(f6,{href:X,"aria-label":`Open ${Z}`,className:"absolute inset-0 rounded-2xl outline-none focus-visible:ring-3 focus-visible:ring-ring/50"}),H.data&&t0.jsxs(l1,{children:[t0.jsx(i1,{render:t0.jsx(f6,{href:hG($.id,"agent"),"aria-label":`Chat in ${Z}`,style:y8(J),className:"absolute right-3 bottom-3 rounded-lg outline-none focus-visible:ring-3 focus-visible:ring-ring/50",children:t0.jsx(j9,{preset:B,color:"primary",animated:Q,expression:Q?"thinking":void 0,size:48,className:"drop-shadow-sm drop-shadow-primary/20"})})}),t0.jsx(r1,{children:"Chat"})]})]}),t0.jsxs(f6,{href:X,className:"flex min-w-0 flex-col gap-2 rounded-lg px-2 outline-none focus-visible:ring-3 focus-visible:ring-ring/50",children:[t0.jsxs("div",{className:"flex min-w-0 items-center gap-1.5 font-sans",style:y8(J),children:[t0.jsx("img",{src:$.icon??I8[$.type??"claude-code"],alt:"",className:"size-4 shrink-0 rounded-xs"}),t0.jsx("span",{className:"truncate text-sm font-medium text-foreground",children:Z})]}),t0.jsx("span",{className:"text-xs text-muted-foreground",children:d50(z)})]})]})}function c50({suggestion:$,onAdd:Z}){let{path:H,types:J}=$,B=A7($);return t0.jsxs("li",{className:"flex items-center gap-2 border-b border-border px-1 py-3",children:[t0.jsx(eC,{types:J}),t0.jsx("span",{className:"shrink-0 text-sm font-medium text-foreground",children:B}),t0.jsx("span",{title:H,className:"min-w-0 flex-1 truncate text-xs text-muted-foreground",children:$.displayPath??H}),t0.jsxs(E0,{variant:"outline",size:"sm",onClick:()=>Z($),children:[t0.jsx(O2,{stroke:1.75}),"Add"]})]})}function d50($){let Z=Date.now()-$,H=Math.floor(Z/60000);if(H<1)return"Updated just now";if(H<60)return`Updated ${H} min${H===1?"":"s"} ago`;let J=Math.floor(H/60);if(J<24)return`Updated ${J} hour${J===1?"":"s"} ago`;let B=Math.floor(J/24);if(B<30)return`Updated ${B} day${B===1?"":"s"} ago`;return`Updated ${new Date($).toLocaleDateString()}`}var vG=_(r(),1);function SI(){return vG.jsx(xX,{showWorkspaces:!1,children:vG.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto",children:vG.jsx(EI,{})})})}var gG=_(p(),1);var oN=_(r(),1),RI=($)=>$.map((Z)=>[...Z].map((H)=>H==="#"?1:0)),l50=["####.","#.#.#","#.#.#","#.#.#","#.#.#"],i50=["###.#","#.#.#","#.#.#","#.#.#","###.#"],r50=RI([".....","####.","#.#.#","#.#.#","#.#.#"]),a50=RI(l50.map(($,Z)=>`${$}.${i50[Z]}`)),n50={moi:r50,"moi-full":a50};function bI($,Z,H){let J=[];for(let B=0;B<Z;B++){let Q=[];for(let z=0;z<$;z++)Q.push(H(z,B));J.push(Q)}return J}function II($,Z,H){let J=Math.sin($*12.9898+Z*78.233+H*37.719)*43758.5453;return J-Math.floor(J)}function o50($,Z,H){return bI(Z,H,(J,B)=>{let Q=II(J,B,0)*Math.PI*2,z=5+II(J,B,1)*6,X=0.5+0.5*Math.sin($*z+Q);return X*X})}function s50($,Z,H){return bI(Z,H,(B,Q)=>0.5+0.5*Math.sin(B*0.5+Q*0.32-$*6.5))}var yI=0.55;function t50($,Z){let H=$.length,J=$.reduce((G,U)=>Math.max(G,U.length),0),B=Math.min(Z/yI,1),Q=1-Math.pow(1-B,3),z=Math.round((1-Q)*H),X=[];for(let G=0;G<H;G++){let U=[];for(let K=0;K<J;K++)U.push($[G-z]?.[K]??0);X.push(U)}return X}function kI($,Z,H){let J=n50[$];if(Z===void 0)return t50(J,H);let B=J.length,Q=J[0]?.length??0;return Z==="wave"?s50(H,Q,B):o50(H,Q,B)}var e50=24;function $40($,Z,H){let[J,B]=gG.useState(()=>kI($,Z,0));return gG.useEffect(()=>{let Q=0,z=null,X=0,G=1000/H,U=(K)=>{if(z===null)z=K;let F=(K-z)/1000;if(K-X>=G){if(X=K,B(kI($,Z,F)),Z===void 0&&F>=yI)return}Q=requestAnimationFrame(U)};return Q=requestAnimationFrame(U),()=>cancelAnimationFrame(Q)},[$,Z,H]),J}function Z40($){return`rgba(23, 23, 23, ${(0.1+Math.max(0,Math.min(1,$))*0.9).toFixed(3)})`}function hI({sprite:$="moi",effect:Z,fps:H=e50,pixelSize:J=3,gap:B=1,className:Q}){let z=$40($,Z,H),X=z[0]?.length??0,G=Z!==void 0;return oN.jsx("div",{className:z0("grid",Q),style:{gridTemplateColumns:`repeat(${X}, ${J}px)`,gap:`${B}px`},children:z.flatMap((U,K)=>U.map((F,Y)=>oN.jsx("div",{className:"rounded-[2px]",style:{width:J,height:J,background:Z40(F),boxShadow:G?`0 0 ${(J*(0.4+F)).toFixed(1)}px rgba(23, 23, 23, ${(F*0.35).toFixed(3)})`:void 0}},`${K}-${Y}`)))})}var XZ=_(p(),1);var mG=_(p(),1);var xI=()=>({emit($,...Z){for(let H=this.events[$]||[],J=0,B=H.length;J<B;J++)H[J](...Z)},events:{},on($,Z){return(this.events[$]||=[]).push(Z),()=>{this.events[$]=this.events[$]?.filter((H)=>Z!==H)}}});var sN=2000;var H40=({kind:$,name:Z})=>`${$}:${Z}`,vI=1000,tN={cooldownMs:2000,windowMs:60000,maxPerWindow:10,maxKeys:64};function J40($){let Z=xI(),H=fz(tN),J=(Q,z)=>{E8($,{source:"runtime",kind:Q.kind,name:Q.name,message:z})},B=(Q,z,X)=>{let G=H.admit(`${z}\x00${X}`);if(G==="cooldown")return J(Q,`sendChatMessage("${X}") was dropped: the same message was already sent less than ${tN.cooldownMs/1000}s ago. Call it from an event handler, not during render.`),!1;if(G==="window")return J(Q,`sendChatMessage("${X}") was dropped: more than ${tN.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(Q,z){return Z.on(Q,z)},connect(Q){let z=!0,X=H40(Q);return{bridge:{focusTab(U,K){if(!z)return;if(!nN(U))return;Z.emit("focusTab",U,BZ(K)?K:void 0)},sendChatMessage(U,K){if(!z)return;if(typeof U!=="string")return;let F=U.trim();if(!F)return;if(F.length>vI){J(Q,`sendChatMessage() was dropped: the message is ${F.length} characters (max ${vI}). Put long content in the context argument, not the message.`);return}if(!B(Q,X,F))return;Z.emit("sendChatMessage",{message:F,source:X,...K!==void 0?{context:B40(Q,K,J)}:{}})}},dispose:()=>{z=!1}}}}}function B40($,Z,H){if(!BZ(Z)){H($,"sendChatMessage() ignored its context argument: it must be a plain object.");return}let J;try{J=JSON.stringify(Z)}catch{H($,"sendChatMessage() ignored its context argument: it is not JSON-serializable (cycles, functions, or BigInt).");return}if(J.length>sN){H($,`sendChatMessage() ignored its context argument: ${J.length} characters serialized (max ${sN}). Send an id the agent can look up instead of the whole payload.`);return}return Z}var gI=new Map;function fI($){let Z=gI.get($);if(!Z)Z=J40($),gI.set($,Z);return Z}function uG($,Z,H){let J=mG.useRef(H);J.current=H,mG.useEffect(()=>{let B=(...Q)=>J.current(...Q);return fI($).on(Z,B)},[$,Z])}var fG=new Map;function mI($,Z,H,J){let B=$.__attachBridge;if(typeof B!=="function")return;fG.get(H)?.();let{bridge:Q,dispose:z}=fI(Z).connect(J);fG.set(H,z),B(Q)}function eN($){let Z=fG.get($);if(!Z)return;fG.delete($),Z()}function pG($,Z,H){return`${$}/${Z}/${H}`}var zZ=new Map,uJ=new Map;function Q40($,Z,H){return zZ.get(pG($,Z,H))??0}var z40="module";function uI($,Z,H){return`/api/workspaces/${Z}/${$}/${H}/${z40}?v=${Q40($,Z,H)}`}function cG($,Z,H){return`/api/workspaces/${Z}/${$}/${H}`}function dG($,Z){return`${$==="widgets"?"widget":"view"}:${Z}`}function pI($){return uJ.get($)}function cI($,Z){uJ.set($,Z)}function lG($,Z,H){let J=pG($,Z,H);uJ.delete(J),zZ.set(J,(zZ.get(J)??0)+1),eN(J)}function $V($){let Z=`${$}/`;for(let H of new Set([...uJ.keys(),...zZ.keys()]))if(H.startsWith(Z))uJ.delete(H),zZ.set(H,(zZ.get(H)??0)+1),eN(H)}var X40={kind:"widget",segment:"widgets",shouldReload:($,Z)=>$.type==="widget:updated"&&$.name===Z||$.type==="applets:refresh"&&$.only!=="views"},G40={kind:"view",segment:"views",shouldReload:($,Z)=>$.type==="view:updated"&&$.name===Z||$.type==="applets:refresh"&&$.only!=="widgets"};function U40($,Z,H){let{segment:J}=$,B=pG(J,Z,H),Q=pI(B);if(Q)return Q;let z=import(uI(J,Z,H)).then((X)=>{if(!X.default)throw Error(`"${H}" has no default export`);return mI(X,Z,B,{kind:$.kind,name:H}),X.default});return cI(B,z),z}function dI($,Z){let H=F5(),[J,B]=XZ.useState({status:"loading",version:0}),Q=XZ.useCallback(()=>{B((z)=>({status:"loading",version:z.version})),U40($,H,Z).then((z)=>B((X)=>({status:"ready",Component:z,version:X.version+1}))).catch((z)=>{E8(H,{source:"load",kind:$.kind,name:Z,message:String(z),...z instanceof Error&&z.stack?{stack:z.stack}:{}}),B((X)=>({status:"error",error:String(z),version:X.version+1}))})},[$,H,Z]);return XZ.useEffect(()=>{Q()},[Q]),H4((z)=>{if($.shouldReload(z,Z))lG($.segment,H,Z),Q()}),J}function lI($){return dI(X40,$)}function iI($){return dI(G40,$)}function rI(){let $=F5();H4((Z)=>{if(Z.type==="view:updated")lG("views",$,Z.name);else if(Z.type==="widget:updated")lG("widgets",$,Z.name);else if(Z.type==="applets:refresh"){if(Z.only!=="views")$V("widgets");if(Z.only!=="widgets")$V("views")}})}var U8=_(p(),1);var nI=_(p(),1);var c2={staleTime:0,gcTime:300000,refetchOnMount:!0,refetchOnWindowFocus:!0};function oI($){return J5({queryKey:S0.layout($),queryFn:()=>q1(`/api/workspaces/${$}`),...c2})}function O9($){let Z=z1();return nI.useEffect(()=>aI(()=>{Z.invalidateQueries({queryKey:S0.agent($)})}),[Z,$]),H4((H)=>{if(H.type==="agent:updated"&&H.workspaceId===$)Z.setQueryData(S0.agent($),(J)=>J?{...J,availability:H.availability,login:H.login}:J);if(H.type==="env:updated"&&H.workspaceId===$)Z.invalidateQueries({queryKey:S0.agent($)})}),J5({queryKey:S0.agent($),queryFn:()=>q1(`/api/workspaces/${$}/agent`),staleTime:30000,refetchOnWindowFocus:!0})}function sI($){return q1(`/api/workspaces/${$}/auth/login`,{method:"POST"},"Could not start sign-in")}function tI($){return J5({queryKey:S0.skills($),queryFn:()=>q1(`/api/workspaces/${$}/skills`),...c2})}async function K40($){let Z=await fetch(`/api/workspaces/${$}/skills/update`,{method:"POST"}),H=await Z.text(),J=null;try{J=JSON.parse(H)}catch{}if(!Z.ok){let B=J&&"error"in J?J.error:H,Q=Error(B||"Failed to update workspace skill");if(J?.skills)Q.status={skills:J.skills,updateAvailable:J.updateAvailable};throw Q}if(!J)throw Error("Invalid workspace skill update response");return J}function eI($){let Z=z1();return B5({mutationFn:()=>K40($),onSuccess:(H)=>{Z.setQueryData(S0.skills($),H)},onError:(H)=>{if(H.status)Z.setQueryData(S0.skills($),H.status)}})}function $k($){return J5({queryKey:S0.widgets($),queryFn:async()=>{return(await q1(`/api/workspaces/${$}/widgets`)).widgets},...c2})}function iG($){return J5({queryKey:S0.views($),queryFn:async()=>{return(await q1(`/api/workspaces/${$}/views`)).views},...c2})}function Zk($){let Z=z1();return B5({mutationFn:(H)=>f2(`/api/workspaces/${$}`,o5("PUT",H),"Failed to save layout"),onSuccess:()=>{Z.invalidateQueries({queryKey:S0.preview($)})}})}function ZV(){return{open:["agent","widgets","scratchpad"],active:"agent"}}function Hk(){return{version:1,widgetGrid:[],layoutMode:"split",tabs:ZV()}}var zk=_(r(),1),HV=U8.createContext(null);function P5(){let $=U8.useContext(HV);if(!$)throw Error("useWorkspaceLayoutCtx must be used within <WorkspaceLayoutProvider>");return $}function Bk(){return U8.useContext(HV)?.layout.theme}function Jk($){let{cwd:Z,name:H,provider:J,agentId:B,...Q}=$;return Q}function Qk({id:$,children:Z}){let H=z1(),J=oI($),B=Zk($),Q=U8.useRef(B.mutate);Q.current=B.mutate;let z=U8.useRef(null),X=U8.useCallback((U)=>{let K=S0.layout($),F=H.getQueryData(K);if(!F)return;let Y={...F,...U};if(H.setQueryData(K,Y),z.current)clearTimeout(z.current);z.current=setTimeout(()=>{z.current=null,Q.current(Jk(Y))},600)},[$,H]),G=U8.useMemo(()=>({layout:J.data?Jk(J.data):Hk(),setLayout:X,name:J.data?.name??null,icon:J.data?.icon??null,cwd:J.data?.cwd??null,provider:J.data?.provider??null,workspaceId:$,isLoading:J.isLoading}),[J.data,J.isLoading,X,$]);return zk.jsx(HV,{value:G,children:Z})}var L2=_(p(),1);var aG=_(r(),1);function rG({visible:$,editing:Z,canvasRef:H,width:J,height:B,pointerProps:Q,onKeyDown:z,children:X}){if(!$)return null;return aG.jsxs("div",{className:"absolute inset-0 animate-in duration-100 fade-in",onKeyDown:z,children:[aG.jsx("canvas",{ref:H,...Q,width:J,height:B,"aria-label":"Drawing area",tabIndex:0,className:"absolute inset-0 size-full cursor-pencil touch-none outline-none"}),Z&&X]})}var a0=_(p(),1);function BV($,Z,H){let J=Math.max($,Z);if(J<=0)return 1;return Math.min(Math.max(H,1),1568/J)}function F40($){return new Promise((Z,H)=>{setTimeout(()=>H(Error("Annotation capture timed out")),$)})}function Y40($){if(!($ instanceof HTMLElement))return;let{overflowX:Z,overflowY:H}=$.style;if(H==="auto"||H==="scroll")$.style.overflowY="hidden";if(Z==="auto"||Z==="scroll")$.style.overflowX="hidden"}async function Xk($){let Z=$.getBoundingClientRect();if(Z.width<=0||Z.height<=0)throw Error("Annotation target is not visible");let{createContext:H,destroyContext:J,domToCanvas:B}=await import("/chunk-53a7pxcz.js"),Q=async()=>{let z=await H($,{width:Math.round(Z.width),height:Math.round(Z.height),scale:BV(Z.width,Z.height,window.devicePixelRatio),type:"image/png",backgroundColor:getComputedStyle($).backgroundColor,timeout:1000,features:{restoreScrollPosition:!0},style:{overflow:"hidden"},onCloneEachNode:Y40});try{return await B(z)}finally{J(z)}};return Promise.race([Q(),F40(1e4)])}var QV={past:[],present:[],future:[]};function W40($,Z){if(Z.type==="commit")return{past:[...$.past,$.present],present:[...$.present,Z.stroke],future:[]};if(Z.type==="undo"){let H=$.past.at(-1);if(!H)return $;return{past:$.past.slice(0,-1),present:H,future:[$.present,...$.future]}}if(Z.type==="redo"){let H=$.future[0];if(!H)return $;return{past:[...$.past,$.present],present:H,future:$.future.slice(1)}}if($.present.length===0)return $;return{past:[...$.past,$.present],present:[],future:[]}}function Kk($,Z,H){let J=$.getBoundingClientRect();return{x:(Z-J.left)/J.width*$.width,y:(H-J.top)/J.height*$.height}}function Gk($,Z){let H=Z.getCoalescedEvents?.()??[];return(H.length>0?H:[Z]).map((B)=>Kk($,B.clientX,B.clientY))}var A40={canUndo:!1,canRedo:!1,hasStrokes:!1};function pJ($){return a0.useSyncExternalStore($.subscribeHistory,$.getHistoryState,$.getHistoryState)}function Uk($,Z,H,J){let B=Z.points[0];if(!B)return;$.beginPath(),$.lineCap="round",$.lineJoin="round",$.lineWidth=J,$.strokeStyle=H,$.moveTo(B.x,B.y);for(let Q=1;Q<Z.points.length;Q++){let z=Z.points[Q];$.lineTo(z.x,z.y)}if(Z.points.length===1)$.lineTo(B.x+0.01,B.y+0.01);$.stroke()}function Fk($,Z,H,J,B,Q=null){let z=Math.max(3,Math.min(Z,H)*0.005),X=z+Math.max(2,z*0.75),G=Q?[...B,Q]:B;for(let U of G)Uk($,U,J.haloColor,X);for(let U of G)Uk($,U,J.strokeColor,z)}function N40($,Z,H,J=null){let B=$.getContext("2d");if(!B)return;B.clearRect(0,0,$.width,$.height),Fk(B,$.width,$.height,Z,H,J)}function V40($,Z,H){let J=$.getContext("2d");if(!J)return;J.clearRect(0,0,$.width,$.height),J.drawImage(Z.snapshot,0,0,$.width,$.height),Fk(J,$.width,$.height,Z,H)}function L40($){return new Promise((Z,H)=>{$.toBlob((J)=>{if(J)Z(J);else H(Error("Could not export drawing"))},"image/png")})}function D40($,Z,H){let J=$.getBoundingClientRect();if(J.width<=0||J.height<=0)return null;let B=getComputedStyle($),Q=BV(J.width,J.height,window.devicePixelRatio),z=Math.max(1,Math.round(J.width*Q)),X=Math.max(1,Math.round(J.height*Q)),G=document.createElement("canvas");G.width=z,G.height=X;let U=B.getPropertyValue("--background").trim()||"#ffffff",K=G.getContext("2d");if(K)K.fillStyle=U,K.fillRect(0,0,z,X);return Z.width=z,Z.height=X,{id:H,snapshot:G,strokeColor:B.getPropertyValue("--primary").trim()||"#2563eb",haloColor:U,targetWidth:J.width,targetHeight:J.height}}function q40($){return $ instanceof HTMLInputElement||$ instanceof HTMLTextAreaElement||$ instanceof HTMLElement&&$.isContentEditable}function nG({mode:$="annotation",onChange:Z,onEditingStart:H,onFinish:J}={}){let B=a0.useRef(null),Q=a0.useRef(null),[z,X]=a0.useState(null),G=a0.useRef(z),[U,K]=a0.useState(!1),F=a0.useRef(!1),Y=a0.useRef(QV),W=a0.useRef(A40),A=a0.useRef(new Set),N=a0.useRef(0),L=a0.useRef(null),V=a0.useRef(null),D=a0.useRef(0),q=a0.useRef(0),j=a0.useRef(null),M=a0.useRef(null),[P,T]=a0.useState(!1),C=a0.useRef(!1),[k,E]=a0.useState(!1),h=a0.useRef(!1),x=a0.useRef(Z),R=a0.useRef(H),w=a0.useRef(J);x.current=Z,R.current=H,w.current=J;let S=a0.useCallback(()=>{let i=Y.current,l=W.current,e={canUndo:i.past.length>0,canRedo:i.future.length>0,hasStrokes:i.present.length>0};if(e.canUndo===l.canUndo&&e.canRedo===l.canRedo&&e.hasStrokes===l.hasStrokes)return;W.current=e;for(let $0 of A.current)$0()},[]),I=a0.useCallback((i)=>{return A.current.add(i),()=>{A.current.delete(i)}},[]),y=a0.useCallback(()=>W.current,[]),f=a0.useCallback((i,l=null)=>{if(D.current)cancelAnimationFrame(D.current),D.current=0;let e=Q.current,$0=G.current;if(e&&$0)N40(e,$0,i,l)},[]),g=a0.useCallback(()=>{if(D.current)return;D.current=requestAnimationFrame(()=>{D.current=0,f(Y.current.present,L.current)})},[f]),O=a0.useCallback((i,l,e)=>{let $0=j.current;if($0?.sessionId===i.id&&$0.historyVersion===e)return Promise.resolve($0.blob);let H0=M.current;if(H0?.sessionId===i.id&&H0.historyVersion===e)return H0.promise;if(l.length===0)return j.current={sessionId:i.id,historyVersion:e,blob:null},x.current?.(null),Promise.resolve(null);let O0=document.createElement("canvas");O0.width=i.snapshot.width,O0.height=i.snapshot.height,V40(O0,i,l);let P0=L40(O0).then((N0)=>{if(G.current?.id!==i.id||N.current!==e)return N0;return j.current={sessionId:i.id,historyVersion:e,blob:N0},x.current?.(N0),N0}).catch(()=>{if(G.current?.id===i.id&&N.current===e)H8.add({title:"Couldn’t export the drawing",type:"error"});return null}).finally(()=>{if(M.current?.promise===P0)M.current=null});return M.current={sessionId:i.id,historyVersion:e,promise:P0},P0},[]),c=a0.useCallback(()=>{if(!L.current)return;let i=Q.current,l=V.current;if(i&&l!==null&&i.hasPointerCapture(l))i.releasePointerCapture(l);L.current=null,V.current=null,f(Y.current.present)},[f]),o=a0.useCallback((i)=>{let l=G.current;if(!l||h.current)return;let e=W40(Y.current,i);if(e===Y.current)return;Y.current=e,S(),L.current=null;let $0=++N.current;f(e.present),O(l,e.present,$0)},[O,S,f]),b=a0.useCallback((i)=>{Y.current=QV,N.current=0,j.current=null,M.current=null,L.current=null,V.current=null,S(),G.current=i,X(i)},[S]),d=a0.useCallback(()=>{if(F.current)return;F.current=!0,K(!0),R.current?.()},[]),t=a0.useCallback(async()=>{let i=B.current;if(!i||G.current||C.current)return!1;let l=++q.current;C.current=!0,T(!0);try{let e=await Xk(i);if(l!==q.current||B.current!==i)return!1;let $0=i.getBoundingClientRect(),H0=getComputedStyle(i),O0={id:l,snapshot:e,strokeColor:H0.getPropertyValue("--primary").trim()||"#2563eb",haloColor:H0.getPropertyValue("--background").trim()||"#ffffff",targetWidth:$0.width,targetHeight:$0.height};return b(O0),d(),!0}finally{if(l===q.current)C.current=!1,T(!1)}},[d,b]),u=a0.useCallback(()=>{let i=G.current;q.current+=1,C.current=!1,h.current=!1,T(!1),E(!1),F.current=!1,K(!1),c(),X(null),Y.current=QV,S();let l=M.current;if(!i||l?.sessionId!==i.id)return G.current=null,Promise.resolve();return l.promise.then(()=>{if(G.current?.id===i.id)G.current=null})},[c,S]),a=a0.useCallback(async()=>{let i=G.current;if(!i)return null;return c(),O(i,Y.current.present,N.current)},[c,O]),n=a0.useCallback(async()=>{return F.current=!1,K(!1),a()},[a]),Q0=a0.useCallback(async()=>{let i=G.current;if(!i||h.current)return null;h.current=!0,E(!0),c();let l=N.current,e=Y.current.present,$0=null;if(e.length>0||l>0)$0=await O(i,e,l);if(G.current?.id!==i.id)return $0;try{await w.current?.($0)}finally{if(G.current?.id===i.id)q.current+=1,F.current=!1,K(!1),G.current=null,X(null),h.current=!1,E(!1)}return $0},[c,O]),Z0=a0.useCallback(()=>o({type:"undo"}),[o]),U0=a0.useCallback(()=>o({type:"redo"}),[o]),B0=a0.useCallback(()=>o({type:"clear"}),[o]),Y0=a0.useMemo(()=>({onPointerDown:(i)=>{if(h.current||!i.isPrimary||i.pointerType==="mouse"&&i.button!==0)return;if(!G.current&&$==="sketch"){let l=B.current;if(!l)return;let e=D40(l,i.currentTarget,++q.current);if(!e)return;b(e)}if(!G.current)return;d(),V.current=i.pointerId,i.currentTarget.setPointerCapture(i.pointerId),L.current={points:[Kk(i.currentTarget,i.clientX,i.clientY)]},f(Y.current.present,L.current)},onPointerMove:(i)=>{if(i.pointerId!==V.current||!L.current)return;L.current.points.push(...Gk(i.currentTarget,i.nativeEvent)),g()},onPointerUp:(i)=>{if(i.pointerId!==V.current||!L.current)return;let l=L.current;if(l.points.push(...Gk(i.currentTarget,i.nativeEvent)),L.current=null,V.current=null,i.currentTarget.hasPointerCapture(i.pointerId))i.currentTarget.releasePointerCapture(i.pointerId);o({type:"commit",stroke:l})},onPointerCancel:(i)=>{if(i.pointerId===V.current)c()}}),[o,d,c,b,$,f,g]),A0=a0.useCallback((i)=>{if(q40(i.target))return;if(i.key==="Escape"&&$==="annotation"){i.preventDefault(),Q0();return}if(!(i.metaKey||i.ctrlKey)||i.key.toLowerCase()!=="z")return;if(i.preventDefault(),i.shiftKey)U0();else Z0()},[Q0,$,U0,Z0]);a0.useLayoutEffect(()=>{if(!z)return;if(f(Y.current.present,L.current),U)Q.current?.focus()},[U,f,z]),a0.useEffect(()=>{if(!z||$==="sketch")return;let i=B.current;if(!i){u();return}let l=new ResizeObserver((e)=>{let $0=e[0]?.contentRect;if(!$0)return;if(Math.abs($0.width-z.targetWidth)>1||Math.abs($0.height-z.targetHeight)>1)u()});return l.observe(i),()=>l.disconnect()},[u,$,z]),a0.useEffect(()=>()=>{if(q.current+=1,F.current=!1,G.current=null,D.current)cancelAnimationFrame(D.current)},[]);let D0=a0.useMemo(()=>({active:U,visible:$==="sketch"||z!==null,starting:P,finishing:k,open:t,undo:Z0,redo:U0,clear:B0,flush:a,deactivate:n,finish:Q0,cancel:u,subscribeHistory:I,getHistoryState:y}),[U,$,z,P,k,t,Z0,U0,B0,a,n,Q0,u,I,y]),X0=a0.useMemo(()=>({visible:D0.visible,editing:D0.active,canvasRef:Q,width:z?.snapshot.width??1,height:z?.snapshot.height??1,pointerProps:Y0,onKeyDown:A0}),[D0.active,D0.visible,z,Y0,A0]);return a0.useMemo(()=>({targetRef:B,controls:D0,layerProps:X0}),[D0,X0])}var d5=_(r(),1);function oG({controls:$,title:Z,busy:H,onComplete:J}){let{canUndo:B,canRedo:Q,hasStrokes:z}=pJ($);return d5.jsxs("div",{className:"absolute bottom-3 left-1/2 flex -translate-x-1/2 items-center gap-2 rounded-lg bg-popover p-1.5 shadow-md",children:[d5.jsx("span",{className:"mr-2 ml-2 text-sm font-medium",children:Z}),d5.jsxs("div",{className:"flex gap-1",children:[d5.jsxs(l1,{children:[d5.jsx(i1,{render:d5.jsx(E0,{type:"button",variant:"outline",size:"icon-sm",onClick:$.undo,disabled:H||!B,"aria-label":"Undo",children:d5.jsx(Yk,{stroke:1.75})})}),d5.jsx(r1,{children:"Undo"})]}),d5.jsxs(l1,{children:[d5.jsx(i1,{render:d5.jsx(E0,{type:"button",variant:"outline",size:"icon-sm",onClick:$.redo,disabled:H||!Q,"aria-label":"Redo",children:d5.jsx(Wk,{stroke:1.75})})}),d5.jsx(r1,{children:"Redo"})]}),d5.jsx(E0,{type:"button",variant:"outline",size:"sm",onClick:$.clear,disabled:H||!z,children:"Clear"})]}),d5.jsx(G2,{mode:"popLayout",initial:!1,children:d5.jsx(Y5.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.1,bounce:0},children:d5.jsx(E0,{type:"button",variant:z?"default":"ghost",size:"icon-sm",onClick:J,disabled:H,"aria-label":"Complete",className:z0(!z&&"text-muted-foreground"),children:z?d5.jsx(x3,{stroke:1.75}):d5.jsx(b5,{stroke:1.75})})},z?"complete":"cancel")})]})}var m5=_(p(),1);async function zV($,Z){let H=new FormData;for(let B of Z)H.append("files",B);let J=await fetch(`/api/workspaces/${$}/uploads`,{method:"POST",body:H});if(!J.ok){let B=await J.text().catch(()=>"");throw Error(B||`Upload failed (${J.status})`)}return J.json()}function Ak({workspaceId:$,sessionId:Z},H){if(H.length===0)return;let J=H.map((B)=>({kind:"file",localId:crypto.randomUUID(),name:B.name||"file",mediaType:B.type||"application/octet-stream",previewUrl:B.type.startsWith("image/")?URL.createObjectURL(B):void 0,status:"uploading"}));h1.getState().addAttachments($,Z,J),J.forEach((B,Q)=>{zV($,[H[Q]]).then(([z])=>{h1.getState().updateAttachment($,Z,B.localId,{status:"ready",upload:z,mediaType:z.mediaType})}).catch((z)=>{h1.getState().updateAttachment($,Z,B.localId,{status:"error",error:z instanceof Error?z.message:"Upload failed"})})})}function sG({workspaceId:$,sessionId:Z,localId:H,purpose:J,sourceTab:B,blob:Q}){let z=J==="sketch"?"Sketch":"Annotation",X=URL.createObjectURL(Q),G=h1.getState();if(G.attachments[z2($,Z)]?.some((K)=>K.localId===H))G.updateAttachment($,Z,H,{previewUrl:X,status:"draft",upload:void 0,error:void 0});else G.addAttachments($,Z,[{kind:"drawing",purpose:J,localId:H,sourceTab:B,name:`${z}.png`,mediaType:"image/png",previewUrl:X,status:"draft"}])}async function tG({workspaceId:$,sessionId:Z,localId:H,purpose:J,sourceTab:B,blob:Q,isCurrent:z}){let X=J==="sketch"?"Sketch":"Annotation",G=URL.createObjectURL(Q),U=h1.getState();if(U.attachments[z2($,Z)]?.some((F)=>F.localId===H))U.updateAttachment($,Z,H,{previewUrl:G,status:"uploading",upload:void 0,error:void 0});else U.addAttachments($,Z,[{kind:"drawing",purpose:J,localId:H,sourceTab:B,name:`${X}.png`,mediaType:"image/png",previewUrl:G,status:"uploading"}]);try{let[F]=await zV($,[new File([Q],`${X}.png`,{type:"image/png"})]);if(!z())return;h1.getState().updateAttachment($,Z,H,{status:"ready",upload:F,mediaType:F.mediaType,error:void 0})}catch{if(!z())return;h1.getState().removeAttachment($,Z,H)}}function Nk({workspaceId:$,sessionId:Z,activeTab:H,mode:J,available:B,closePopup:Q,openPopup:z}){let X=m5.useRef(null),G=m5.useRef(null),U=m5.useRef(new Map),K=m5.useRef(Q),F=m5.useRef(z);K.current=Q,F.current=z;let Y=m5.useCallback((w)=>{let S=X.current;if(!S)return;if(G.current=w,!w){h1.getState().removeAttachment(S.workspaceId,S.sourceSessionId,S.attachmentId);return}sG({workspaceId:S.workspaceId,sessionId:S.sourceSessionId,localId:S.attachmentId,purpose:"annotation",sourceTab:S.sourceTab,blob:w})},[]),W=m5.useCallback((w,S)=>{let I=(U.current.get(w.attachmentId)??0)+1;return U.current.set(w.attachmentId,I),tG({workspaceId:w.workspaceId,sessionId:w.sourceSessionId,localId:w.attachmentId,purpose:"annotation",sourceTab:w.sourceTab,blob:S,isCurrent:()=>U.current.get(w.attachmentId)===I})},[]),A=m5.useCallback(async(w)=>{let S=X.current;if(X.current=null,G.current=null,S&&w)await W(S,w);if(S?.origin==="popup")F.current()},[W]),N=nG({onChange:Y,onFinish:A}),{controls:L}=N,{active:V,starting:D,open:q,finish:j,cancel:M}=L,P=m5.useCallback(async(w)=>{if(!B||V||D)return;let S={workspaceId:$,sourceSessionId:Z,sourceTab:H,origin:w,attachmentId:crypto.randomUUID()};X.current=S;try{if(!await q()){if(X.current===S)X.current=null;return}if(w==="popup")K.current()}catch{if(X.current!==S)return;X.current=null,H8.add({title:"Couldn’t capture this page",type:"error"})}},[V,H,B,q,Z,D,$]),T=m5.useCallback(async()=>{let w=X.current;if(await M(),X.current!==w)return;X.current=null;let S=G.current;if(G.current=null,w&&S)W(w,S)},[M,W]),C=m5.useCallback((w)=>{let S=(U.current.get(w)??0)+1;if(U.current.set(w,S),h1.getState().removeAttachment($,Z,w),X.current?.attachmentId===w)X.current=null,G.current=null,M()},[M,Z,$]),k=m5.useCallback(async()=>{if(D){await T();return}await j()},[T,j,D]),E=m5.useCallback(()=>{if(V||D)k();else P("docked")},[V,k,P,D]),h=m5.useCallback(()=>{if(V||D)k();else P("popup")},[V,k,P,D]);m5.useEffect(()=>{let w=X.current;if(!w)return;let S=w.origin==="docked"?"split":"fullscreen";if(w.workspaceId!==$||w.sourceSessionId!==Z||w.sourceTab!==H||J!==S||!B)T()},[H,B,T,J,Z,$]);let x=m5.useMemo(()=>B?{active:V||D,finish:k,onRemove:C,onToggle:E}:void 0,[B,V,D,k,C,E]),R=m5.useMemo(()=>B?{active:V||D,finish:k,onRemove:C,onToggle:h}:void 0,[B,V,D,k,C,h]);return m5.useMemo(()=>({...N,docked:x,popup:R}),[N,x,R])}var I2=_(p(),1);var K8=_(r(),1);function XV($){if(!$)return;$.focus();let Z=$.value.length;$.setSelectionRange(Z,Z)}function Lk({composerRef:$,className:Z,onMouseDown:H,children:J,...B}){return K8.jsx("form",{...B,onMouseDown:(Q)=>{if(H?.(Q),Q.defaultPrevented)return;if(Q.target instanceof Element&&Q.target.closest('button, input, textarea, select, a, [contenteditable="true"]'))return;XV($.current)},className:z0("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:J})}function Dk({textareaRef:$,className:Z,...H}){return K8.jsx("textarea",{...H,ref:$,className:z0("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 qk({className:$,children:Z,...H}){return K8.jsx("div",{...H,className:z0("flex items-center justify-end gap-3",$),children:Z})}function M40($){if($.status==="checking")return"Checking agent status…";return}function cJ($,Z,H){return $&&!Z&&H.status==="available"}function Mk({label:$,hasContent:Z,busy:H=!1,loading:J=!1,availability:B}){let Q=cJ(Z,H||J,B),z=M40(B),X=K8.jsx(E0,{type:"submit",size:"icon",disabled:!Q,"aria-label":$,children:J?K8.jsx(m2,{}):K8.jsx(Vk,{stroke:1.5})});if(J||!z)return X;return K8.jsxs(l1,{children:[K8.jsx(i1,{render:K8.jsx("span",{className:"inline-flex",children:X})}),K8.jsx(r1,{className:"max-w-64 text-center",children:z})]})}var d2=_(p(),1),P40=48;function Pk($,Z){let H=d2.useRef(!0),[J,B]=d2.useState(!0),Q=d2.useCallback((G)=>{H.current=G,B((U)=>U===G?U:G)},[]),z=d2.useCallback((G="auto")=>{let U=$.current;if(!U)return;Q(!0),U.scrollTo({top:U.scrollHeight,behavior:G})},[$,Q]),X=d2.useCallback(()=>{let G=$.current;if(!G)return;Q(!1),G.scrollTo({top:0,behavior:"auto"})},[$,Q]);return d2.useEffect(()=>{let G=$.current;if(!G)return;let U=()=>{let K=G.scrollHeight-G.scrollTop-G.clientHeight;Q(K<=P40)};return G.addEventListener("scroll",U,{passive:!0}),()=>G.removeEventListener("scroll",U)},[$,Q]),d2.useEffect(()=>{let G=$.current;if(!G)return;let U=G.firstElementChild??G,K=new ResizeObserver(()=>{if(H.current)G.scrollTop=G.scrollHeight});return K.observe(U),()=>K.disconnect()},[$]),d2.useLayoutEffect(()=>{z("auto")},[Z,z]),{atBottom:J,scrollToBottom:z,scrollToTop:X}}function _40($){return $.origin.kind!=="replay"&&$.origin.kind!=="synthetic"&&$.origin.kind!=="subagent-prompt"}function _k($,Z){let H=$.meta||Z.meta?{...$.meta,...Z.meta}:void 0;return{...$,parts:[...$.parts,...Z.parts],timestamp:Z.timestamp??$.timestamp,meta:H}}function jk($,Z){if(!Z)return $;let H=$.at(-1);if(H?.role==="assistant")return[...$.slice(0,-1),_k(H,Z)];return[...$,Z]}function Ok($){let Z=[];for(let H of $){if(!_40(H))continue;if(H.role!=="assistant"){Z.push(H);continue}let J=Z.length>0?Z[Z.length-1]:null;if(J?.role==="assistant")Z[Z.length-1]=_k(J,H);else Z.push(H)}return Z.map((H,J)=>{let B=Z[J-1];if(H.role!=="assistant"||H.meta?.durationMs!==void 0||B?.role!=="user"||B.origin.kind!=="user-input"||!B.timestamp||!H.timestamp)return H;let Q=Date.parse(B.timestamp),z=Date.parse(H.timestamp);if(!Number.isFinite(Q)||!Number.isFinite(z)||z<Q)return H;return{...H,meta:{...H.meta,durationMs:z-Q}}})}function GV($){switch($.kind){case"warning":return $.message;case"compact":return"Context compacted";case"model-change":return $.prev?`Model changed to ${$.model} (was ${$.prev})`:`Model changed to ${$.model}`;case"api-retry":return $.error?`Retrying: ${$.error}`:"Retrying the connection";case"rate-limit":case"hook":case"session-state":case"files-persisted":case"elicitation":default:return null}}function Tk($){if(!$)return;let Z=Date.parse($);return Number.isNaN(Z)?void 0:Z}function Ck($,Z){let H=Z.filter((G)=>GV(G)!==null);if(H.length===0)return $.map((G)=>({kind:"turn",turn:G}));let J=[],B=[];for(let G of H){let U=Tk(G.at);if(U===void 0)B.push(G);else J.push({notice:G,time:U})}J.sort((G,U)=>G.time-U.time);let Q=[],z=0,X=Number.NEGATIVE_INFINITY;for(let G of $){X=Math.max(X,Tk(G.timestamp)??X);while(z<J.length&&J[z].time<=X)Q.push({kind:"notice",notice:J[z].notice}),z+=1;Q.push({kind:"turn",turn:G})}for(;z<J.length;z+=1)Q.push({kind:"notice",notice:J[z].notice});for(let G of B)Q.push({kind:"notice",notice:G});return Q}var jZ=_(p(),1);var Z6={};g5(Z6,{createHandle:()=>sk,Viewport:()=>ok,Trigger:()=>mk,Root:()=>hk,Positioner:()=>pk,Portal:()=>gk,Popup:()=>dk,Handle:()=>JU,Backdrop:()=>ak,Arrow:()=>ik});var yk=_(p(),1);var eG=_(p(),1),UV=eG.createContext(void 0);function d4($){let Z=eG.useContext(UV);if(Z===void 0&&!$)throw Error(g0(50));return Z}var Ek=_(p(),1);var wk=600,$U=300;var Sk={...G9,instantType:($)=>$.instantType,adaptiveOrigin:($)=>$.adaptiveOrigin,closeDelay:($)=>$.closeDelay};class KV extends _4{constructor($,Z,H){let J=new W4;super(kk($,J,Z,H),Rk(J),Sk)}setOpen=($,Z)=>{let{inlineRectCoordsRef:H}=this.context;Gz(this,$,Z,{onBeforeDispatch(){let J=Z.event;if($&&Z.reason===K0.triggerHover&&Z.trigger&&"clientX"in J&&"clientY"in J&&H.current?.element!==Z.trigger)wW(H,Z.trigger,J.clientX,J.clientY)}})}}function Ik(){let $=new W4;return new w8(Object.freeze(kk(void 0,$)),Object.freeze(Rk($)),Sk)}function kk($,Z,H,J=!1){return{...X9(Z,H,J),instantType:void 0,adaptiveOrigin:void 0,closeDelay:$U,...$}}function Rk($){return{popupRef:Ek.createRef(),onOpenChange:void 0,onOpenChangeComplete:void 0,triggerElements:$,inlineRectCoordsRef:{current:void 0}}}var $6=_(r(),1);function bk($){let{open:Z,defaultOpen:H=!1,onOpenChange:J,onOpenChangeComplete:B,actionsRef:Q,handle:z,triggerId:X,defaultTriggerId:G=null,children:U}=$,K=O3((V,D)=>new KV({open:H,openProp:Z,activeTriggerId:G,triggerIdProp:X},V,D));K.useControlledProp("openProp",Z),K.useControlledProp("triggerIdProp",X),K.useContextCallback("onOpenChange",J),K.useContextCallback("onOpenChangeComplete",B);let F=K.useState("open"),Y=K.useState("activeTriggerId"),W=K.useState("mounted"),A=K.useState("payload");B9(K,{closeOnActiveTriggerUnmount:!0});let{forceUnmount:N}=Q9(F,K,()=>{K.context.inlineRectCoordsRef.current=void 0});J0(()=>{if(F){if(Y==null)K.set("payload",void 0)}},[K,Y,F]),yk.useImperativeHandle(Q,()=>({unmount:N,close:()=>K.setOpen(!1,R0(K0.imperativeAction))}),[N,K]);let L=F||W;return $6.jsxs(UV.Provider,{value:K,children:[z&&$6.jsx(H9,{handle:z,store:K}),L&&$6.jsx(j40,{store:K}),typeof U==="function"?U({payload:A}):U]})}function j40({store:$}){let Z=$.useState("floatingRootContext"),H=j8(Z);return z9($,{activeTriggerProps:H.reference,inactiveTriggerProps:H.trigger,popupProps:H.floating}),null}var hk=D8(function(Z){if(d4(!0))return $6.jsx(bk,{...Z});return $6.jsx(e6,{children:$6.jsx(bk,{...Z})})});var vk=_(p(),1);var ZU=_(p(),1),FV=ZU.createContext(void 0);function xk(){let $=ZU.useContext(FV);if($===void 0)throw Error(g0(48));return $}var YV=_(r(),1),gk=vk.forwardRef(function(Z,H){let{keepMounted:J=!1,...B}=Z;if(!(d4().useState("mounted")||J))return null;return YV.jsx(FV.Provider,{value:J,children:YV.jsx(M$,{ref:H,...B})})});var fk=_(p(),1);var mk=i8(function(Z,H){let{render:J,className:B,delay:Q,closeDelay:z,id:X,payload:G,handle:U,style:K,...F}=Z,Y=d4(!0),A=U9(U)??Y;if(!A)throw Error(g0(89));let N=J1(X),L=A.useState("isTriggerActive",N),V=A.useState("isOpenedByTrigger",N),D=A.useState("floatingRootContext"),q=A.context.inlineRectCoordsRef,j=fk.useRef(null),M=Q??wk,P=z??$U,{registerTrigger:T,isMountedByThisTrigger:C}=J9(N,j,A,{payload:G,closeDelay:P}),k=T8(D,{mouseOnly:!0,move:!1,handleClose:C8(),delay:()=>({open:M,close:P}),triggerElementRef:j,isActiveTrigger:L,isClosing:()=>A.select("transitionStatus")==="ending"}),E=J7(D,{delay:M}),h={open:V},x=A.useState("triggerProps",C),R=Yj(q,V);return F0("a",Z,{state:h,ref:[H,T,j],props:[k,E.reference,x,R,{id:N},F],stateAttributesMapping:a8})});var uk=_(p(),1);var HU=_(p(),1),WV=HU.createContext(void 0);function GZ(){let $=HU.useContext(WV);if($===void 0)throw Error(g0(49));return $}var AV=_(r(),1),pk=uk.forwardRef(function(Z,H){let{render:J,className:B,anchor:Q,positionMethod:z="absolute",side:X="bottom",align:G="center",sideOffset:U=0,alignOffset:K=0,collisionBoundary:F="clipping-ancestors",collisionPadding:Y=5,arrowPadding:W=5,sticky:A=!1,disableAnchorTracking:N=!1,collisionAvoidance:L=e8,style:V,...D}=Z,q=d4(),j=xk(),M=i9(),P=q.useState("open"),T=q.useState("mounted"),C=q.useState("floatingRootContext"),k=q.useState("instantType"),E=q.useState("transitionStatus"),h=q.useState("adaptiveOrigin"),x=q.context.inlineRectCoordsRef,R=F9({anchor:Q,floatingRootContext:C,positionMethod:z,mounted:T,side:X,sideOffset:U,align:G,alignOffset:K,arrowPadding:W,collisionBoundary:F,collisionPadding:Y,sticky:A,disableAnchorTracking:N,keepMounted:j,nodeId:M,collisionAvoidance:L,adaptiveOrigin:h,inline:Wj(x)}),w=R.update;J0(()=>{if(P&&T)w()},[P,T,w]);let S={open:P,side:R.side,align:R.align,anchorHidden:R.anchorHidden,instant:k},I=W9(Z,S,{styles:R.positionerStyles,transitionStatus:E,props:D,refs:[H,q.useStateSetter("positionerElement")],hidden:!T,inert:!P});return AV.jsx(WV.Provider,{value:R,children:AV.jsx(t6,{id:M,children:I})})});var ck=_(p(),1);var dk=ck.forwardRef(function(Z,H){let{className:J,render:B,style:Q,...z}=Z,X=d4(),{side:G,align:U}=GZ(),K=X.useState("open"),F=X.useState("instantType"),Y=X.useState("transitionStatus"),W=X.useState("popupProps"),A=X.useState("floatingRootContext"),N=X.useState("closeDelay");return f5({open:K,ref:X.context.popupRef,onComplete(){if(K)X.context.onOpenChangeComplete?.(!0)}}),n9(A,{closeDelay:N}),F0("div",Z,{state:{open:K,side:G,align:U,instant:F,transitionStatus:Y},ref:[H,X.context.popupRef,X.useStateSetter("popupElement")],props:[Z9,W,Y9(Y),z],stateAttributesMapping:y4})});var lk=_(p(),1);var ik=lk.forwardRef(function(Z,H){let{render:J,className:B,style:Q,...z}=Z,X=d4(),{arrowRef:G,side:U,align:K,arrowUncentered:F,arrowStyles:Y}=GZ(),A={open:X.useState("open"),side:U,align:K,uncentered:F};return F0("div",Z,{state:A,ref:[G,H],props:[{style:Y,"aria-hidden":!0},z],stateAttributesMapping:b2})});var rk=_(p(),1);var ak=rk.forwardRef(function(Z,H){let{render:J,className:B,style:Q,...z}=Z,X=d4(),G=X.useState("open"),U=X.useState("mounted"),K=X.useState("transitionStatus");return F0("div",Z,{state:{open:G,transitionStatus:K},ref:[H],props:[{role:"presentation",hidden:!U,style:{pointerEvents:"none",userSelect:"none",WebkitUserSelect:"none"}},z],stateAttributesMapping:y4})});var nk=_(p(),1);var ok=nk.forwardRef(function(Z,H){let{render:J,className:B,style:Q,children:z,...X}=Z,G=d4(),U=GZ(),K=G.useState("instantType"),{children:F,state:Y}=w3({store:G,side:U.side,children:z}),W={activationDirection:Y.activationDirection,transitioning:Y.transitioning,instant:K};return F0("div",Z,{state:W,ref:H,props:[X,{children:F}],stateAttributesMapping:C3})});class JU extends O8{constructor(){super(Ik(),"PreviewCard")}open($){this.openByTrigger($)}close(){this.closePopup()}get isOpen(){return this.attachedStore?.select("open")??!1}}function sk(){return new JU}var UZ=_(r(),1);function tk({...$}){return UZ.jsx(Z6.Root,{"data-slot":"hover-card",...$})}function ek({...$}){return UZ.jsx(Z6.Trigger,{"data-slot":"hover-card-trigger",...$})}function $R({className:$,side:Z="bottom",sideOffset:H=4,align:J="center",alignOffset:B=0,...Q}){return UZ.jsx(A9,{portal:Z6.Portal,"data-slot":"hover-card-portal",children:UZ.jsx(Z6.Positioner,{align:J,alignOffset:B,side:Z,sideOffset:H,className:"isolate z-50",children:UZ.jsx(Z6.Popup,{"data-slot":"hover-card-content",className:d1("z-50 w-64 origin-(--transform-origin) 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",$),...Q})})})}var _Z=_(p(),1);function BU($){return J5({queryKey:S0.sessions($),queryFn:()=>q1(`/api/workspaces/${$}/sessions`),...c2})}function O40($,Z){return $?.filter((H)=>H.sessionId!==Z)}function ZR($){let Z=z1();return B5({mutationFn:(H)=>f2(`/api/workspaces/${$}/sessions/${H}/archive`,{method:"POST"},"Couldn’t archive chat"),onSuccess:(H,J)=>{Z.setQueryData(S0.sessions($),(B)=>O40(B,J)),Z.removeQueries({queryKey:S0.events($,J)}),Z.removeQueries({queryKey:S0.sessionConfig($,J)}),Z.invalidateQueries({queryKey:S0.preview($)})}})}function HR($,Z){return J5({...AT($,Z??""),enabled:Boolean(Z)})}function QU($,Z){return J5({queryKey:S0.sessionConfig($,Z??""),queryFn:()=>q1(`/api/workspaces/${$}/sessions/${Z}/config`),enabled:Boolean(Z),staleTime:1/0,gcTime:300000,refetchOnMount:!1,refetchOnWindowFocus:!1})}function JR($){let Z=z1();return B5({mutationFn:({patch:H,sessionId:J})=>q1(`/api/workspaces/${$}/sessions/${J}/config`,o5("PUT",H),"Failed to save chat settings"),onSuccess:(H,{sessionId:J})=>{Z.setQueryData(S0.sessionConfig($,J),H)}})}var T40=["fable","opus","sonnet","haiku"];function zU($,Z,H=$.find((J)=>J.value==="default")?.resolvedModel){let J=$.filter((B)=>B.value!=="default");return J.find((B)=>B.value===Z)??J.find((B)=>(B.resolvedModel??B.value)===H)??J[0]}function BR($){let Z=$.resolvedModel??$.value,H=T40.findIndex((J)=>Z===J||Z.startsWith(`${J}[`)||Z.includes(`-${J}-`));return H===-1?void 0:H}function C40($,Z){if($===void 0&&Z===void 0)return 0;if($===void 0)return-1;if(Z===void 0)return 1;return $-Z}function w40($,Z){return C40(BR($),BR(Z))}var E40={"claude-code":w40};function S40($,Z){return $.map((H,J)=>({model:H,index:J})).sort((H,J)=>Z(H.model,J.model)||H.index-J.index).map(({model:H})=>H)}function NV($,Z,H){if(Z&&$.includes(Z))return Z;if(H&&$.includes(H))return H;if($.includes("high"))return"high";return $[$.length-1]}function QR($,Z,H){let J=NV($,Z,H);return J?$.indexOf(J):-1}function zR($){return $.length>1}function XR($,Z){if($.supportsFastMode!==!0)return!1;return Z??$.defaultFastMode??!1}function GR($,Z){let H=E40[Z];return H?S40($,H):$}function UR($,Z){let H=[];for(let J of $){let B=J.group??Z,Q=H.find((z)=>z.label===B);if(Q)Q.models.push(J);else H.push({label:B,models:[J]})}return H}var U2={};g5(U2,{createHandle:()=>Ub,Viewport:()=>Qb,Trigger:()=>Jb,SubmenuTrigger:()=>Gb,SubmenuRoot:()=>oR,Separator:()=>Xb,Root:()=>bU,RadioItemIndicator:()=>dR,RadioItem:()=>cR,RadioGroup:()=>mR,Positioner:()=>gR,Portal:()=>yR,Popup:()=>kR,LinkItem:()=>SR,Item:()=>ER,Handle:()=>gU,GroupLabel:()=>CR,Group:()=>OR,CheckboxItemIndicator:()=>PR,CheckboxItem:()=>MR,Backdrop:()=>WR,Arrow:()=>FR});var KR=_(p(),1);var XU=_(p(),1),VV=XU.createContext(void 0);function l4($){let Z=XU.useContext(VV);if(Z===void 0&&!$)throw Error(g0(33));return Z}var GU=_(p(),1),LV=GU.createContext(void 0);function N5($){let Z=GU.useContext(LV);if(Z===void 0&&!$)throw Error(g0(36));return Z}var FR=KR.forwardRef(function(Z,H){let{render:J,className:B,style:Q,...z}=Z,{store:X}=N5(),{arrowRef:G,side:U,align:K,arrowUncentered:F,arrowStyles:Y}=l4(),A={open:X.useState("open"),side:U,align:K,uncentered:F};return F0("div",Z,{ref:[G,H],stateAttributesMapping:b2,state:A,props:{style:Y,"aria-hidden":!0,...z}})});var YR=_(p(),1);var UU=_(p(),1),I40=UU.createContext(void 0);function H6($=!0){let Z=UU.useContext(I40);if(Z===void 0&&!$)throw Error(g0(25));return Z}var WR=YR.forwardRef(function(Z,H){let{render:J,className:B,style:Q,...z}=Z,{store:X}=N5(),G=X.useState("open"),U=X.useState("mounted"),K=X.useState("transitionStatus"),F=X.useState("lastOpenChangeReason"),Y=H6(),W={open:G,transitionStatus:K};return F0("div",Z,{ref:Y?.backdropRef?[H,Y.backdropRef]:H,state:W,stateAttributesMapping:y4,props:[{role:"presentation",hidden:!U,style:{pointerEvents:F===K0.triggerHover?"none":void 0,userSelect:"none",WebkitUserSelect:"none"}},z]})});var AU=_(p(),1);var KU=_(p(),1),DV=KU.createContext(void 0);function AR(){let $=KU.useContext(DV);if($===void 0)throw Error(g0(30));return $}var KZ=_(p(),1);var NR=_(p(),1);function YU($){let{closeOnClick:Z,highlighted:H,id:J,nodeId:B,store:Q,typingRef:z,itemRef:X,itemMetadata:G}=$,{events:U}=Q.useState("floatingTreeRoot"),K=Q.useState("open"),F=H6(!0),Y=F!==void 0;return NR.useMemo(()=>({id:J,role:"menuitem",tabIndex:K&&H?0:-1,onKeyDown(W){if(W.key===" "&&z?.current)W.preventDefault()},onMouseMove(W){if(!B)return;U.emit("itemhover",{nodeId:B,target:W.currentTarget})},onClick(W){if(Z)U.emit("close",{domEvent:W,reason:K0.itemPress})},onMouseUp(W){if(F){let A=F.initialCursorPointRef.current;if(F.initialCursorPointRef.current=null,Y&&A&&Math.abs(W.clientX-A.x)<=1&&Math.abs(W.clientY-A.y)<=1)return;if(Y&&!n1.os.mac&&W.button===2)return}if(X.current&&Q.context.allowMouseUpTriggerRef.current&&(!Y||W.button===2)){if(G.type==="regular-item")FU(X.current,W,{detail:1})}}}),[Z,H,J,U,B,K,Q,z,X,F,Y,G])}var J6={type:"regular-item"};function B6($){let{closeOnClick:Z,disabled:H,highlighted:J,id:B,store:Q,typingRef:z=Q.context.typingRef,nativeButton:X,itemMetadata:G,nodeId:U}=$,K=KZ.useRef(null),{getButtonProps:F,buttonRef:Y}=R5({disabled:H,focusableWhenDisabled:!0,native:X,composite:!0}),W=YU({closeOnClick:Z,highlighted:J,id:B,nodeId:U,store:Q,typingRef:z,itemRef:K,itemMetadata:G}),A=KZ.useCallback((L)=>{return m4(W,{onMouseEnter(){if(G.type!=="submenu-trigger")return;G.setActive()}},L,F)},[W,F,G]),N=v2(K,Y);return KZ.useMemo(()=>({getItemProps:A,itemRef:N}),[A,N])}var S7=_(p(),1);var WU=_(p(),1),qV=WU.createContext({register:()=>{},unregister:()=>{},subscribeMapChange:()=>()=>{},nextIndexRef:{current:0}});function VR(){return WU.useContext(qV)}function w2($={}){let{guess:Z,label:H,metadata:J,textRef:B,index:Q}=$,{register:z,unregister:X,subscribeMapChange:G,nextIndexRef:U}=VR(),K=S7.useRef(-1),[F,Y]=S7.useState(Q==null&&Z?()=>{if(K.current===-1){let L=U.current;U.current+=1,K.current=L}return K.current}:-1),W=Q??F,A=S7.useRef(null),N=S7.useCallback((L)=>{let V=A.current;if(V)X(V);if(A.current=L,L)z(L,{metadata:J??null,index:Q??null,label:H,textRef:B})},[Q,z,X,J,H,B]);return J0(()=>{if(Q!=null)return;return G((L)=>{let V=A.current?L.get(A.current)?.index:null;if(V!=null)Y(V)})},[Q,G]),{ref:N,index:W}}var LR="data-checked",DR="data-unchecked";var Q6={checked($){if($)return{[LR]:""};return{[DR]:""}},...D2};var qR=_(r(),1),MR=AU.forwardRef(function(Z,H){let{render:J,className:B,id:Q,label:z,nativeButton:X=!1,disabled:G=!1,closeOnClick:U=!1,checked:K,defaultChecked:F,onCheckedChange:Y,style:W,...A}=Z,N=w2({guess:!0,label:z}),L=l4(!0),V=J1(Q),{store:D}=N5(),q=D.useState("disabled"),j=G||q,M=D.useState("isActive",N.index),P=D.useState("itemProps"),[T,C]=B8({controlled:K,default:F??!1,name:"MenuCheckboxItem",state:"checked"}),{getItemProps:k,itemRef:E}=B6({closeOnClick:U,disabled:j,highlighted:M,id:V,store:D,nativeButton:X,nodeId:L?.context.nodeId,itemMetadata:J6}),h=AU.useMemo(()=>({disabled:j,highlighted:M,checked:T}),[j,M,T]);function x(w){let S=R0(K0.itemPress,w.nativeEvent,void 0,{preventUnmountOnClose:K1});if(Y?.(!T,S),S.isCanceled)return;C((I)=>!I)}let R=F0("div",Z,{state:h,stateAttributesMapping:Q6,props:[P,{role:"menuitemcheckbox","aria-checked":T,onClick:x},A,k],ref:[E,H,N.ref]});return qR.jsx(DV.Provider,{value:h,children:R})});var NU=_(p(),1);var PR=NU.forwardRef(function(Z,H){let{render:J,className:B,style:Q,keepMounted:z=!1,...X}=Z,G=AR(),U=NU.useRef(null),{transitionStatus:K,mounted:F,setMounted:Y}=$8(G.checked);f5({batch:!0,enabled:!G.checked,open:G.checked,ref:U,onComplete(){if(!G.checked)Y(!1)}});let W={checked:G.checked,disabled:G.disabled,highlighted:G.highlighted,transitionStatus:K};return F0("span",Z,{state:W,ref:[H,U],stateAttributesMapping:Q6,props:{"aria-hidden":!0,...X},enabled:z||F})});var LU=_(p(),1);var VU=_(p(),1),dJ=VU.createContext(void 0);function _R(){let $=VU.useContext(dJ);if($===void 0)throw Error(g0(31));return $}var jR=_(r(),1),OR=LU.forwardRef(function(Z,H){let{render:J,className:B,style:Q,...z}=Z,[X,G]=LU.useState(void 0),U=F0("div",Z,{ref:H,props:{role:"group","aria-labelledby":X,...z}});return jR.jsx(dJ.Provider,{value:G,children:U})});var TR=_(p(),1);var CR=TR.forwardRef(function(Z,H){let{render:J,className:B,style:Q,id:z,...X}=Z,G=J1(z),U=_R();return J0(()=>{return U(G),()=>{U((K)=>K===G?void 0:K)}},[U,G]),F0("div",Z,{ref:H,props:{id:G,"aria-hidden":!0,...X}})});var wR=_(p(),1);var ER=wR.forwardRef(function(Z,H){let{render:J,className:B,id:Q,label:z,nativeButton:X=!1,disabled:G=!1,closeOnClick:U=!0,style:K,...F}=Z,Y=w2({guess:!0,label:z}),W=l4(!0),A=J1(Q),{store:N}=N5(),L=N.useState("disabled"),V=G||L,D=N.useState("isActive",Y.index),q=N.useState("itemProps"),{getItemProps:j,itemRef:M}=B6({closeOnClick:U,disabled:V,highlighted:D,id:A,store:N,nativeButton:X,nodeId:W?.context.nodeId,itemMetadata:J6});return F0("div",Z,{state:{disabled:V,highlighted:D},props:[q,F,j],ref:[M,H,Y.ref]})});var DU=_(p(),1);var SR=DU.forwardRef(function(Z,H){let{render:J,className:B,id:Q,label:z,closeOnClick:X=!1,style:G,...U}=Z,K=DU.useRef(null),F=w2({guess:!0,label:z}),W=l4(!0)?.context.nodeId,A=J1(Q),{store:N}=N5(),L=N.useState("isActive",F.index),V=N.useState("itemProps"),D=N.context.typingRef,{getButtonProps:q,buttonRef:j}=R5({native:!1,composite:!0}),M=YU({closeOnClick:X,highlighted:L,id:A,nodeId:W,store:N,typingRef:D,itemRef:K,itemMetadata:J6});function P(C){return m4(M,C,q)}return F0("a",Z,{state:{highlighted:L},props:[V,U,P],ref:[K,j,H,F.ref]})});var PU=_(p(),1);var qU=_(p(),1),R40=qU.createContext(void 0);function MU($){let Z=qU.useContext(R40);if(Z===void 0&&!$)throw Error(g0(69));return Z}var IR=_(r(),1),kR=PU.forwardRef(function(Z,H){let{render:J,className:B,style:Q,finalFocus:z,...X}=Z,{store:G}=N5(),{side:U,align:K}=l4(),F=MU(!0)!=null,Y=G.useState("open"),W=G.useState("transitionStatus"),A=G.useState("popupProps"),N=G.useState("mounted"),L=G.useState("instantType"),V=G.useState("activeTriggerElement"),D=G.useState("parent"),q=G.useState("lastOpenChangeReason"),j=G.useState("rootId"),M=G.useState("floatingRootContext"),P=G.useState("floatingTreeRoot"),T=G.useState("closeDelay"),C=G.useState("hoverEnabled"),k=G.useState("disabled"),E=G.useState("openMethod"),h=D.type==="context-menu";f5({open:Y,ref:G.context.popupRef,onComplete(){if(Y)G.context.onOpenChangeComplete?.(!0)}}),PU.useEffect(()=>{function I(y){G.setOpen(!1,R0(y.reason,y.domEvent))}return P.events.on("close",I),()=>{P.events.off("close",I)}},[P.events,G]),n9(M,{enabled:C&&!k&&!h&&D.type!=="menubar",closeDelay:T});let x=G.useStateSetter("popupElement"),R={transitionStatus:W,side:U,align:K,open:Y,nested:D.type==="menu",instant:L},w=F0("div",Z,{state:R,ref:[H,G.context.popupRef,x],stateAttributesMapping:y4,props:[A,{onKeyDown(I){if(F&&e9.has(I.key))I.stopPropagation()}},Y9(W),X,{"data-rootownerid":j}]}),S=D.type===void 0||h;if(V||D.type==="menubar"&&q!==K0.outsidePress)S=!0;return IR.jsx($7,{context:M,openInteractionType:E,modal:h,disabled:!N,returnFocus:z===void 0?S:z,initialFocus:D.type!=="menu",restoreFocus:!0,externalTree:D.type!=="menubar"?P:void 0,previousFocusableElement:V,nextFocusableElement:D.type===void 0?G.context.triggerFocusTargetRef:void 0,beforeContentFocusGuardRef:D.type===void 0?G.context.beforeContentFocusGuardRef:void 0,children:w})});var bR=_(p(),1);var _U=_(p(),1),MV=_U.createContext(void 0);function RR(){let $=_U.useContext(MV);if($===void 0)throw Error(g0(32));return $}var PV=_(r(),1),yR=bR.forwardRef(function(Z,H){let{keepMounted:J=!1,...B}=Z,{store:Q,parent:z}=N5();if(!(Q.useState("mounted")||J))return null;let U=z.type==="menu"||z.type==="menubar"?"group":void 0;return PV.jsx(MV.Provider,{value:J,children:PV.jsx(o6,{ref:H,...B,portalOwnerRole:U})})});var T9=_(p(),1);var Z3=_(p(),1);var hR=_(r(),1);function jU($){let{children:Z,elementsRef:H,labelsRef:J,onMapChange:B}=$,Q=W0(B),[,z]=Z3.useState(!1),X=p1(y40).current,G=p1(b40).current,U=Z3.useRef(0),K=Z3.useRef(!0),F=Z3.useRef(null),Y=Z3.useRef(null),W=W0(()=>{if(K.current)return;K.current=!0,z((M)=>!M)}),A=W0((M,P)=>{G.set(M,P),W()}),N=W0((M)=>{G.delete(M),W()}),L=W0((M)=>{let P=new Map;if(H.current.length=0,J)J.current.length=0;return M.forEach((T)=>{if(P.set(T.element,{...T.registration.metadata??{},index:T.index}),H.current[T.index]=T.element,J)J.current[T.index]=T.registration.label!==void 0?T.registration.label:T.registration.textRef?.current?.textContent??T.element.textContent}),U.current=H.current.length,P});function V(M){if(Y.current?.disconnect(),Y.current=null,typeof MutationObserver!=="function"||M.length<2)return;let P=new MutationObserver((C)=>{if(!v40(C))return;let k=null;for(let E of M){if(!E.isConnected)continue;if(k&&xR(k,E)>0){P.disconnect(),W();return}k=E}});Y.current=P;let T=new Set;for(let C=1;C<M.length;C+=1){let k=x40(M[C-1],M[C]);if(k)T.add(k)}T.forEach((C)=>P.observe(C,{childList:!0}))}let D=W0(()=>{let[M,P]=h40(G),T=L(M),C=F.current,k=!C||C.length!==M.length||M.some((E,h)=>{let x=C[h];return E.index!==x.index||E.element!==x.element||E.registration.index!==x.registration.index||E.registration.metadata!==x.registration.metadata});if(V(P),F.current=M,K.current=!1,!k)return;X.forEach((E)=>E(T)),Q(T)});J0(()=>{if(!K.current&&F.current)L(F.current);return()=>{if(H.current=[],J)J.current=[]}},[H,J,L]),J0(()=>{if(K.current)D()}),J0(()=>{return()=>{Y.current?.disconnect(),K.current=!0}},[]);let q=W0((M)=>{return X.add(M),()=>{X.delete(M)}}),j=Z3.useMemo(()=>({register:A,unregister:N,subscribeMapChange:q,nextIndexRef:U}),[A,N,q,U]);return hR.jsx(qV.Provider,{value:j,children:Z})}function b40(){return new Map}function y40(){return new Set}function h40($){let Z=new Set,H=[],J=[];$.forEach((Q,z)=>{if(!z.isConnected)return;let X=Q.index,G={index:X??-1,element:z,registration:Q};if(X===null)J.push(G);else if(X>=0)Z.add(X),H.push(G)});let B=0;if(J.sort((Q,z)=>xR(Q.element,z.element)),J.forEach((Q)=>{while(Z.has(B))B+=1;Q.index=B,H.push(Q),B+=1}),Z.size>0)H.sort((Q,z)=>Q.index-z.index);return[H,J.map((Q)=>Q.element)]}function x40($,Z){let H=$.parentElement;while(H&&!H.contains(Z))H=H.parentElement;return H}function v40($){for(let Z of $)for(let H=0;H<Z.removedNodes.length;H+=1)if(Z.removedNodes[H].isConnected)return!0;return!1}function xR($,Z){return $.compareDocumentPosition(Z)&Node.DOCUMENT_POSITION_FOLLOWING?-1:1}var vR=_(p(),1);var g40=20;function OU($,Z,H,J){let[B,Q]=vR.useState(!1);J0(()=>{if(!$||!Z||H==null){Q(!1);return}let z=f0(H).documentElement.clientWidth,X=H.offsetWidth;Q(z>0&&X>0&&X>=z-g40)},[$,Z,H]),ez($&&(!Z||B),J)}var FZ=_(r(),1),gR=T9.forwardRef(function(Z,H){let{anchor:J,positionMethod:B="absolute",className:Q,render:z,side:X,align:G,sideOffset:U=0,alignOffset:K=0,collisionBoundary:F="clipping-ancestors",collisionPadding:Y=5,arrowPadding:W=5,sticky:A=!1,disableAnchorTracking:N=!1,collisionAvoidance:L=A_,style:V,...D}=Z,{store:q}=N5(),j=RR(),M=H6(!0),P=q.useState("parent"),T=q.useState("floatingRootContext"),C=q.useState("floatingTreeRoot"),k=q.useState("mounted"),E=q.useState("open"),h=q.useState("modal"),x=q.useState("openMethod"),R=q.useState("activeTriggerElement"),w=q.useState("transitionStatus"),S=q.useState("positionerElement"),I=q.useState("instantType"),y=q.useState("adaptiveOrigin"),f=q.useState("lastOpenChangeReason"),g=q.useState("floatingNodeId"),O=q.useState("floatingParentNodeId"),c=T.useState("domReferenceElement"),o=T9.useRef(null),b=P2(S),d=J,t=U,u=K,a=G,n=L;if(P.type==="context-menu"){if(d=J??P.context?.anchor,a=a??"start",!X&&a!=="center")u=Z.alignOffset??2,t=Z.sideOffset??-5}let Q0=X,Z0=a;if(P.type==="menu")Q0=Q0??"inline-end",Z0=Z0??"start",n=Z.collisionAvoidance??e8;else if(P.type==="menubar")Q0=Q0??(P.context.orientation==="vertical"?"inline-end":"bottom"),Z0=Z0??"start";let U0=P.type==="context-menu",B0=F9({anchor:d,floatingRootContext:T,positionMethod:M?"fixed":B,mounted:k,side:Q0,sideOffset:t,align:Z0,alignOffset:u,arrowPadding:U0?0:W,collisionBoundary:F,collisionPadding:Y,sticky:A,nodeId:g,keepMounted:j,disableAnchorTracking:N,collisionAvoidance:n,shift:U0?{crossAxis:!(("side"in n)&&n.side==="flip"),rootBoundary:"layoutViewport"}:void 0,externalTree:C,adaptiveOrigin:y});T9.useEffect(()=>{function $0(H0){if(H0.open){if(H0.parentNodeId===g)q.set("hoverEnabled",!1);if(H0.nodeId!==g&&H0.parentNodeId===q.select("floatingParentNodeId"))q.setOpen(!1,R0(K0.siblingOpen))}}return C.events.on("menuopenchange",$0),()=>{C.events.off("menuopenchange",$0)}},[q,C.events,g]),T9.useEffect(()=>{if(q.select("floatingParentNodeId")==null)return;function $0(H0){if(H0.open||H0.nodeId!==q.select("floatingParentNodeId"))return;let O0=H0.reason??K0.siblingOpen;q.setOpen(!1,R0(O0))}return C.events.on("menuopenchange",$0),()=>{C.events.off("menuopenchange",$0)}},[C.events,q]);let Y0=a1();T9.useEffect(()=>{if(!E)Y0.clear()},[E,Y0]),T9.useEffect(()=>{function $0(H0){if(!E||H0.nodeId!==q.select("floatingParentNodeId"))return;if(H0.target&&R&&R!==H0.target){let O0=q.select("closeDelay");if(O0>0){if(!Y0.isStarted())Y0.start(O0,()=>{q.setOpen(!1,R0(K0.siblingOpen))})}else q.setOpen(!1,R0(K0.siblingOpen))}else Y0.clear()}return C.events.on("itemhover",$0),()=>{C.events.off("itemhover",$0)}},[C.events,E,R,q,Y0]),T9.useEffect(()=>{let $0={open:E,nodeId:g,parentNodeId:O,reason:q.select("lastOpenChangeReason")};C.events.emit("menuopenchange",$0)},[C.events,E,q,g,O]),J0(()=>{let $0=c,H0=o.current;if($0)o.current=$0;if(H0&&$0&&$0!==H0){q.set("instantType",void 0);let O0=new AbortController;return b(()=>{q.set("instantType","trigger-change")},O0.signal),()=>{O0.abort()}}return},[c,b,q]);let A0={open:E,side:B0.side,align:B0.align,anchorHidden:B0.anchorHidden,nested:P.type==="menu",instant:I},D0=P.type==="menubar"&&P.context.modal,X0=h&&f!==K0.triggerHover;OU(E&&(D0||X0),x==="touch",S,R);let i=W9(Z,A0,{styles:B0.positionerStyles,transitionStatus:w,props:D,refs:[H,q.useStateSetter("positionerElement")],hidden:!k,inert:!E}),l=k&&P.type!=="menu"&&(P.type!=="menubar"&&h&&f!==K0.triggerHover||P.type==="menubar"&&P.context.modal),e=null;if(P.type==="menubar")e=P.context.contentElement;else if(P.type===void 0)e=R;return FZ.jsxs(VV.Provider,{value:B0,children:[l&&FZ.jsx(b$,{ref:P.type==="context-menu"||P.type==="nested-context-menu"?P.context.internalBackdropRef:null,inert:t8(!E),cutout:e}),FZ.jsx(t6,{id:g,children:FZ.jsx(jU,{elementsRef:q.context.itemDomElements,labelsRef:q.context.itemLabels,children:i})})]})});var z6=_(p(),1);var TU=_(p(),1),_V=TU.createContext(void 0);function fR(){let $=TU.useContext(_V);if($===void 0)throw Error(g0(34));return $}var jV=_(r(),1),mR=z6.memo(z6.forwardRef(function(Z,H){let{render:J,className:B,value:Q,defaultValue:z,onValueChange:X,disabled:G=!1,style:U,"aria-labelledby":K,...F}=Z,[Y,W]=z6.useState(void 0),[A,N]=B8({controlled:Q,default:z,name:"MenuRadioGroup"}),L=W0((j,M)=>{if(X?.(j,M),M.isCanceled)return;N(j)}),D=F0("div",Z,{state:{disabled:G},ref:H,props:{role:"group","aria-labelledby":K??Y,"aria-disabled":G||void 0,...F}}),q=z6.useMemo(()=>({value:A,setValue:L,disabled:G}),[A,L,G]);return jV.jsx(dJ.Provider,{value:W,children:jV.jsx(_V.Provider,{value:q,children:D})})}));var wU=_(p(),1);var CU=_(p(),1),OV=CU.createContext(void 0);function uR(){let $=CU.useContext(OV);if($===void 0)throw Error(g0(35));return $}var pR=_(r(),1),cR=wU.forwardRef(function(Z,H){let{render:J,className:B,id:Q,label:z,nativeButton:X=!1,disabled:G=!1,closeOnClick:U=!1,value:K,style:F,...Y}=Z,W=w2({guess:!0,label:z}),A=l4(!0),N=J1(Q),{store:L}=N5(),V=L.useState("isActive",W.index),D=L.useState("itemProps"),{value:q,setValue:j,disabled:M}=fR(),P=L.useState("disabled"),T=G||M||P,C=q===K,{getItemProps:k,itemRef:E}=B6({closeOnClick:U,disabled:T,highlighted:V,id:N,store:L,nativeButton:X,nodeId:A?.context.nodeId,itemMetadata:J6}),h=wU.useMemo(()=>({disabled:T,highlighted:V,checked:C}),[T,V,C]);function x(w){let S=R0(K0.itemPress,w.nativeEvent,void 0,{preventUnmountOnClose:K1});j(K,S)}let R=F0("div",Z,{state:h,stateAttributesMapping:Q6,props:[D,{role:"menuitemradio","aria-checked":C,onClick:x},Y,k],ref:[E,H,W.ref]});return pR.jsx(OV.Provider,{value:h,children:R})});var EU=_(p(),1);var dR=EU.forwardRef(function(Z,H){let{render:J,className:B,style:Q,keepMounted:z=!1,...X}=Z,G=uR(),U=EU.useRef(null),{transitionStatus:K,mounted:F,setMounted:Y}=$8(G.checked);f5({batch:!0,enabled:!G.checked,open:G.checked,ref:U,onComplete(){if(!G.checked)Y(!1)}});let W={checked:G.checked,disabled:G.disabled,highlighted:G.highlighted,transitionStatus:K};return F0("span",Z,{state:W,stateAttributesMapping:Q6,ref:[H,U],props:{"aria-hidden":!0,...X},enabled:z||F})});var l5=_(p(),1);var SU=_(p(),1),f40=SU.createContext(null);function IU($){let Z=SU.useContext(f40);if(Z===null&&!$)throw Error(g0(5));return Z}var lJ=_(p(),1);var lR={...G9,disabled:($)=>$.parent.type==="menubar"?$.parent.context.disabled||$.disabled:$.disabled,modal:($)=>($.parent.type===void 0||$.parent.type==="context-menu")&&($.modal??!0),openMethod:($)=>$.openMethod,allowMouseEnter:($)=>$.allowMouseEnter,highlightItemOnHover:($)=>$.highlightItemOnHover,parent:($)=>$.parent,rootId:($)=>{if($.parent.type==="menu")return $.parent.store.select("rootId");return $.parent.type!==void 0?$.parent.context.rootId:$.rootId},activeIndex:($)=>$.activeIndex,isActive:($,Z)=>$.activeIndex===Z,hoverEnabled:($)=>$.hoverEnabled,instantType:($)=>$.instantType,lastOpenChangeReason:($)=>$.openChangeReason,floatingTreeRoot:($)=>{if($.parent.type==="menu")return $.parent.store.select("floatingTreeRoot");return $.floatingTreeRoot},floatingNodeId:($)=>$.floatingNodeId,floatingParentNodeId:($)=>$.floatingParentNodeId,itemProps:($)=>$.itemProps,closeDelay:($)=>$.closeDelay,adaptiveOrigin:($)=>$.adaptiveOrigin,keyboardEventRelay:($)=>{if($.keyboardEventRelay)return $.keyboardEventRelay;if($.parent.type==="menu")return $.parent.store.select("keyboardEventRelay");return}};class TV extends _4{constructor($,Z,H=!1){let J=new W4,B=aR(J,Z,H,$);super(B,rR(J),lR);this.unsubscribeParentListener=this.observe("parent",(Q)=>{if(this.unsubscribeParentListener?.(),Q.type==="menu"){let z=Q.store.select("rootId"),X=Q.store.select("floatingTreeRoot"),G=Q.store.select("keyboardEventRelay");this.unsubscribeParentListener=Q.store.subscribe(()=>{let U=Q.store.select("rootId"),K=Q.store.select("floatingTreeRoot"),F=Q.store.select("keyboardEventRelay");if(z===U&&X===K&&G===F)return;z=U,X=K,G=F,this.notifyAll()}),this.context.allowMouseUpTriggerRef=Q.store.context.allowMouseUpTriggerRef;return}if(Q.type!==void 0)this.context.allowMouseUpTriggerRef=Q.context.allowMouseUpTriggerRef;this.unsubscribeParentListener=null})}setOpen($,Z){this.state.floatingRootContext.context.events.emit("setOpen",{open:$,eventDetails:Z})}unsubscribeParentListener=null}function iR(){let $=new W4,Z=new w8(Object.freeze(aR($)),Object.freeze(rR($)),lR);return Object.assign(Z,{setOpen:K1})}function rR($){return{positionerRef:lJ.createRef(),popupRef:lJ.createRef(),typingRef:{current:!1},itemDomElements:{current:[]},itemLabels:{current:[]},allowMouseUpTriggerRef:{current:!1},triggerFocusTargetRef:lJ.createRef(),beforeContentFocusGuardRef:lJ.createRef(),onOpenChangeComplete:void 0,triggerElements:$}}function aR($,Z,H=!1,J){return{...X9($,Z,H),disabled:!1,modal:!0,openMethod:null,allowMouseEnter:!1,highlightItemOnHover:!0,parent:{type:void 0},rootId:void 0,activeIndex:null,hoverEnabled:!0,instantType:void 0,openChangeReason:null,floatingTreeRoot:new s6,floatingNodeId:void 0,floatingParentNodeId:null,itemProps:_1,keyboardEventRelay:void 0,closeDelay:0,adaptiveOrigin:void 0,...J}}var kU=_(p(),1),CV=kU.createContext(void 0);function RU(){return kU.useContext(CV)}var iJ=_(r(),1),bU=D8(function(Z){let{children:H,open:J,onOpenChange:B,onOpenChangeComplete:Q,defaultOpen:z=!1,disabled:X=!1,modal:G,loopFocus:U=!0,orientation:K="vertical",actionsRef:F,closeParentOnEsc:Y=!1,handle:W,triggerId:A,defaultTriggerId:N=null,highlightItemOnHover:L=!0}=Z,V=H6(!0),D=N5(!0),q=IU(!0),j=RU(),M=l5.useMemo(()=>{if(j&&D)return{type:"menu",store:D.store};if(q)return{type:"menubar",context:q};if(V&&!D)return{type:"context-menu",context:V};return{type:void 0}},[V,D,q,j]),P=H2(),T=H2(),C=B2(),k=M.type==="menu"?M.store:void 0,E=(J??z)&&k?.state.transitionStatus==="starting",h=p1(()=>E?k?.state.instantType:void 0).current,x=m40({open:z,openProp:J,activeTriggerId:N,triggerIdProp:A,parent:M,disabled:X,highlightItemOnHover:L,modal:M.type===void 0?G:void 0,rootId:P,instantType:h},T,C!=null);x.useControlledProp("openProp",J),x.useControlledProp("triggerIdProp",A),x.useContextCallback("onOpenChangeComplete",Q);let R=x.useState("floatingTreeRoot"),w=i9(R),S=x.useState("open"),I=x.useState("activeTriggerElement"),y=x.useState("positionerElement"),f=x.useState("hoverEnabled"),g=x.useState("disabled"),O=x.useState("lastOpenChangeReason"),c=x.useState("parent"),o=x.useState("activeIndex"),b=x.useState("payload"),d=x.useState("floatingParentNodeId"),t=l5.useRef(null),u=l5.useRef(c.type!=="context-menu"),a=a1(),n=l5.useRef(!0),Q0=a1(),Z0=d!=null,{openMethod:U0,triggerProps:B0}=MC(S);x.useSyncedValues({disabled:X,highlightItemOnHover:L,modal:c.type===void 0?G:void 0,openMethod:U0,rootId:P}),B9(x);let{forceUnmount:Y0,transitionStatus:A0}=Q9(S,x,()=>{x.set("allowMouseEnter",!1)},E),D0=P2(x.context.popupRef);l5.useEffect(()=>{if(h===void 0)return;let T0=()=>{if(x.state.instantType===h)x.set("instantType",void 0)};if(!S){T0();return}if(A0!==void 0)return;if(x.context.popupRef.current==null){T0();return}let p0=new AbortController;return D0(T0,p0.signal),()=>{p0.abort()}},[h,S,A0,D0,x]),J0(()=>{if(V&&!D)x.update({parent:{type:"context-menu",context:V},floatingNodeId:w,floatingParentNodeId:C});else if(D)x.update({floatingNodeId:w,floatingParentNodeId:C})},[V,D,w,C,x]),l5.useEffect(()=>{if(!S)t.current=null;if(c.type!=="context-menu")return;if(!S){a.clear(),u.current=!1;return}a.start(500,()=>{u.current=!0})},[a,S,c.type]),J0(()=>{if(!S&&!f)x.set("hoverEnabled",!0)},[S,f,x]);let X0=W0((T0,p0)=>{let $1=p0.reason;if(!T0&&!x.select("open"))return;if(S===T0&&p0.trigger===I&&O===$1)return;let D1=uH(p0);if(!T0&&p0.trigger==null)p0.trigger=I??void 0;if(B?.(T0,p0),p0.isCanceled)return;x.state.floatingRootContext.dispatchOpenChange(T0,p0);let u0=p0.event;if(T0===!1&&u0?.type==="click"&&u0.pointerType==="touch"&&!n.current)return;if(T0&&$1===K0.triggerFocus)n.current=!1,Q0.start(300,()=>{n.current=!0});else n.current=!0,Q0.clear();let N1=($1===K0.triggerPress||$1===K0.itemPress)&&u0.detail===0,H5=!T0&&($1===K0.escapeKey||$1==null);t.current=p0.event;let M1=H7(x.state,T0,p0.trigger,D1());if(M1.openChangeReason=$1,c.type==="menubar"&&($1===K0.triggerFocus||$1===K0.focusOut||$1===K0.triggerHover||$1===K0.listNavigation||$1===K0.siblingOpen))M1.instantType="group";else if(N1||H5)M1.instantType=N1?"click":"dismiss";else M1.instantType=void 0;x.update(M1)}),i=mH({popupStore:x,floatingRootContext:x.state.floatingRootContext,floatingId:T,nested:C!=null,onOpenChange:X0}),l=i.context.events;J0(()=>{let T0=({open:p0,eventDetails:$1})=>X0(p0,$1);return l.on("setOpen",T0),()=>{l?.off("setOpen",T0)}},[l,X0]);let e=l5.useCallback(()=>{x.setOpen(!1,R0(K0.imperativeAction))},[x]);l5.useImperativeHandle(F,()=>({unmount:Y0,close:e}),[Y0,e]);let $0;if(c.type==="context-menu")$0=c.context;l5.useImperativeHandle($0?.positionerRef,()=>y,[y]),l5.useImperativeHandle($0?.actionsRef,()=>({setOpen:X0}),[X0]);let H0=j8(i,{enabled:!g,bubbles:{escapeKey:Y&&c.type==="menu"},outsidePress(){if(c.type!=="context-menu"||t.current?.type==="contextmenu")return!0;return u.current},externalTree:Z0?R:void 0}),O0=Z8(),P0=l5.useCallback((T0)=>{if(x.select("activeIndex")===T0)return;x.set("activeIndex",T0)},[x]),N0=gW(i,{enabled:!g,listRef:x.context.itemDomElements,activeIndex:o,nested:c.type!==void 0,loopFocus:U,orientation:K,parentOrientation:c.type==="menubar"?c.context.orientation:void 0,rtl:O0==="rtl",disabledIndices:u9,onNavigate:P0,openOnArrowKeyDown:c.type!=="context-menu",externalTree:Z0?R:void 0,focusItemOnHover:L}),M0=l5.useCallback((T0)=>{x.context.typingRef.current=T0},[x]),v=fW(i,{enabled:!g,listRef:x.context.itemLabels,elementsRef:x.context.itemDomElements,activeIndex:o,resetMs:K_,onMatch:(T0)=>{if(S&&T0!==o)x.set("activeIndex",T0)},onTyping:M0}),m=l5.useMemo(()=>{let T0=m4(v.reference,N0.reference,H0.reference,{onMouseMove(){x.set("allowMouseEnter",!0)}},B0);return T0["aria-haspopup"]="menu",T0["aria-expanded"]=S,T0},[x,v.reference,N0.reference,H0.reference,B0,S]),s=l5.useMemo(()=>{let T0=m4(N0.trigger,H0.trigger,B0);return T0["aria-haspopup"]="menu",T0["aria-expanded"]=!1,T0},[N0.trigger,H0.trigger,B0]);p1(()=>{return x.update({inactiveTriggerProps:s}),null});let G0=l5.useMemo(()=>m4(Z9,{id:T,role:"menu","aria-orientation":K==="horizontal"?"horizontal":void 0,"aria-labelledby":I?.id,onMouseMove(){if(x.set("allowMouseEnter",!0),c.type==="menu")x.set("hoverEnabled",!1)},onClick(){if(x.select("hoverEnabled"))x.set("hoverEnabled",!1)},onKeyDown(T0){let p0=x.select("keyboardEventRelay");if(p0&&!T0.isPropagationStopped())p0(T0)}},v.floating,N0.floating,H0.floating),[I,T,K,c.type,x,v.floating,N0.floating,H0.floating]),j0=N0.item??_1;z9(x,{floatingRootContext:i,activeTriggerProps:m,inactiveTriggerProps:s,popupProps:G0,itemProps:j0});let m0=l5.useMemo(()=>({store:x,parent:M}),[x,M]),v0=iJ.jsxs(LV.Provider,{value:m0,children:[W&&iJ.jsx(H9,{handle:W,store:x}),typeof H==="function"?H({payload:b}):H]});if(c.type===void 0||c.type==="context-menu")return iJ.jsx(e6,{externalTree:R,children:v0});return v0});function m40($,Z,H){return p1(()=>new TV($,Z,H)).current}var nR=_(p(),1);var wV=_(r(),1);function oR($){let Z=N5().store,H=nR.useMemo(()=>({parentMenu:Z}),[Z]);return wV.jsx(CV.Provider,{value:H,children:wV.jsx(bU,{...$})})}var i4=_(p(),1);var yU=5;function sR($,Z){let H=u40(Z);return $.clientX>=H.left-yU&&$.clientX<=H.right+yU&&$.clientY>=H.top-yU&&$.clientY<=H.bottom+yU}function u40($){let Z=$.getBoundingClientRect(),H=u1($);if(n1.env.jsdom)return Z;let J=H.getComputedStyle($,"::before"),B=H.getComputedStyle($,"::after");if(!(J.content!=="none"||B.content!=="none"))return Z;let z=parseFloat(J.width)||0,X=parseFloat(J.height)||0,G=parseFloat(B.width)||0,U=parseFloat(B.height)||0,K=Math.max(Z.width,z,G),F=Math.max(Z.height,X,U),Y=K-Z.width,W=F-Z.height;return{left:Z.left-Y/2,right:Z.right+Y/2,top:Z.top-W/2,bottom:Z.bottom+W/2}}var tR=_(p(),1);function eR($={}){let{highlightItemOnHover:Z,highlightedIndex:H,onHighlightedIndexChange:J}=hU(),{ref:B,index:Q}=w2($),z=H===Q,X=tR.useRef(null),G=v2(B,X);return{compositeProps:{tabIndex:z?0:-1,onFocus(){J(Q)},onMouseMove(){let K=X.current;if(!Z||!K)return;let F=K.hasAttribute("disabled")||K.ariaDisabled==="true";if(!z&&!F)K.focus()}},compositeRef:G,index:Q}}function $b($){let{render:Z,className:H,style:J,state:B=_1,props:Q=u9,refs:z=u9,metadata:X,stateAttributesMapping:G,tag:U="div",...K}=$,{compositeProps:F,compositeRef:Y}=eR({metadata:X});return F0(U,$,{state:B,ref:[Y,...z],props:[F,...Q,K],stateAttributesMapping:G})}function EV($){if(C1($)&&$.hasAttribute("data-rootownerid"))return $.getAttribute("data-rootownerid");if($9($))return;return EV(a9($))}var Zb=_(p(),1),SV=_(x2(),1);function xU($,Z){let H=Zb.useRef(null);function J(Q){SV.flushSync(()=>{$.setOpen(!1,R0(K0.focusOut,Q.nativeEvent,Q.currentTarget))}),$_(H.current)?.focus()}function B(Q){let z=$.select("positionerElement");if(z&&p9(Q,z))$.context.beforeContentFocusGuardRef.current?.focus();else{SV.flushSync(()=>{$.setOpen(!1,R0(K0.focusOut,Q.nativeEvent,Q.currentTarget))});let X=eP($.context.triggerFocusTargetRef.current||Z.current);while(X!==null&&k0(z,X)){let G=X;if(X=D$(X),X===G)break}X?.focus()}}return{preFocusGuardRef:H,handlePreFocusGuardFocus:J,handleFocusTargetFocus:B}}var vU=_(p(),1);function Hb($){let{enabled:Z=!0,mouseDownAction:H,open:J}=$,B=vU.useRef(!1);return vU.useMemo(()=>{if(!Z)return _1;return{onMouseDown:(Q)=>{if(H==="open"&&!J||H==="close"&&J)B.current=!0,f0(Q.currentTarget).addEventListener("click",()=>{B.current=!1},{once:!0})},onClick:(Q)=>{if(B.current)B.current=!1,Q.preventBaseUIHandler()}}},[Z,H,J])}var X6=_(r(),1),Jb=i8(function(Z,H){let{render:J,className:B,style:Q,disabled:z=!1,nativeButton:X=!0,id:G,openOnHover:U,delay:K=100,closeDelay:F=0,handle:Y,payload:W,...A}=Z,N=N5(!0),V=U9(Y)??N?.store;if(!V)throw Error(g0(85));let D=J1(G),q=V.useState("isTriggerActive",D),j=V.useState("floatingRootContext"),M=V.useState("isOpenedByTrigger",D),P=V.useState("triggerPopupId",D),T=i4.useRef(null),C=c40(),k=hU(!0),E=x4(),h=i4.useMemo(()=>{return E??new s6},[E]),x=i9(h),R=B2(),{registerTrigger:w,isMountedByThisTrigger:S}=J9(D,T,V,{payload:W,closeDelay:F,parent:C,floatingTreeRoot:h,floatingNodeId:x,floatingParentNodeId:R,keyboardEventRelay:k?.relayKeyboardEvent}),I=C.type==="menubar",y=V.useState("disabled"),f=z||y||I&&C.context.disabled,{getButtonProps:g,buttonRef:O}=R5({disabled:f,native:X});i4.useEffect(()=>{if(!M&&C.type===void 0)V.context.allowMouseUpTriggerRef.current=!1},[V,M,C.type]);let c=i4.useRef(null),o=a1(),b=W0(($0)=>{if(!c.current)return;o.clear(),V.context.allowMouseUpTriggerRef.current=!1;let H0=$0.target;if(k0(c.current,H0)||k0(V.select("positionerElement"),H0)||H0===c.current)return;if(H0!=null&&EV(H0)===V.select("rootId"))return;if(sR($0,c.current))return;h.events.emit("close",{domEvent:$0,reason:K0.cancelOpen})});i4.useEffect(()=>{if(M&&V.select("lastOpenChangeReason")===K0.triggerHover)f0(c.current).addEventListener("mouseup",b,{once:!0})},[M,b,V]);let d=I&&C.context.hasSubmenuOpen,u=T8(j,{enabled:(U??d)&&!f&&(!I||d&&!S),handleClose:C8({blockPointerEvents:!I}),mouseOnly:!0,move:!1,restMs:C.type===void 0?K:void 0,delay:{close:F},triggerElementRef:T,externalTree:h,isActiveTrigger:q,isClosing:()=>V.select("transitionStatus")==="ending"}),a=p40(M,V.select("lastOpenChangeReason")),n=r9(j,{enabled:!f,event:M&&I?"click":"mousedown",toggle:!0,ignoreMouse:!1,stickIfOpen:C.type===void 0?a:!1}),Q0=J7(j,{enabled:!f&&d}),Z0=Hb({open:M,enabled:I,mouseDownAction:"open"}),U0=i4.useMemo(()=>m4(Q0.reference,n.reference),[Q0.reference,n.reference]),B0=V.useState("triggerProps",S),{preFocusGuardRef:Y0,handlePreFocusGuardFocus:A0,handleFocusTargetFocus:D0}=xU(V,T),X0={disabled:f,open:M},i=[c,H,O,w,T],l=[U0,u??_1,B0,{"aria-haspopup":"menu","aria-controls":P,id:D,onMouseDown:($0)=>{if(V.select("open"))return;o.start(200,()=>{V.context.allowMouseUpTriggerRef.current=!0}),f0($0.currentTarget).addEventListener("mouseup",b,{once:!0})}},I?{role:"menuitem"}:{},Z0,A,g],e=F0("button",Z,{enabled:!I,stateAttributesMapping:SH,state:X0,ref:i,props:l});if(I)return X6.jsx($b,{tag:"button",render:J,className:B,style:Q,state:X0,refs:i,props:l,stateAttributesMapping:SH});if(M)return X6.jsxs(i4.Fragment,{children:[X6.jsx(M2,{ref:Y0,onFocus:A0},`${D}-pre-focus-guard`),X6.jsx(i4.Fragment,{children:e},D),X6.jsx(M2,{ref:V.context.triggerFocusTargetRef,onFocus:D0},`${D}-post-focus-guard`)]});return X6.jsx(i4.Fragment,{children:e},D)});function p40($,Z){let H=a1(),[J,B]=i4.useState(!1);return J0(()=>{if($&&Z===K0.triggerHover)B(!0),H.start(dQ,()=>{B(!1)});else if(!$)H.clear(),B(!1)},[$,Z,H]),J}function c40(){let $=IU(!0);return i4.useMemo(()=>{if($)return{type:"menubar",context:$};return{type:void 0}},[$])}var Bb=_(p(),1);var Qb=Bb.forwardRef(function(Z,H){let{render:J,className:B,style:Q,children:z,...X}=Z,{store:G}=N5(),{side:U}=l4(),K=G.useState("instantType"),{children:F,state:Y}=w3({store:G,side:U,children:z}),W={activationDirection:Y.activationDirection,transitioning:Y.transitioning,instant:K};return F0("div",Z,{state:W,ref:H,props:[X,{children:F}],stateAttributesMapping:C3})});var zb=_(p(),1);var Xb=zb.forwardRef(function(Z,H){let{className:J,render:B,orientation:Q="horizontal",style:z,...X}=Z;return F0("div",Z,{state:{orientation:Q},ref:H,props:[{role:"separator","aria-orientation":Q},X]})});var H3=_(p(),1);var d40={"aria-expanded":void 0},Gb=H3.forwardRef(function(Z,H){let{render:J,className:B,style:Q,label:z,id:X,nativeButton:G=!1,openOnHover:U=!0,delay:K=100,closeDelay:F=0,disabled:Y=!1,...W}=Z,A=RU();if(!A?.parentMenu)throw Error(g0(37));let N=w2({guess:!0,label:z}),L=l4(),{store:V}=N5(),D=J1(X),q=V.useState("open"),j=V.useState("floatingRootContext"),M=V.useState("floatingTreeRoot"),P=V.useState("triggerPopupId",D),T=IW(D,V),C=W0((U0)=>{if(T(U0),U0!==null&&V.select("open")&&V.select("activeTriggerId")==null)V.update({activeTriggerId:D??null,activeTriggerElement:U0,closeDelay:F})}),k=H3.useRef(null),E=H3.useCallback((U0)=>{k.current=U0,V.set("activeTriggerElement",U0)},[V]);J0(()=>{return C(k.current),()=>C(null)},[C,D,V]),V.useSyncedValue("closeDelay",F);let h=A.parentMenu,x=V.useState("disabled"),R=h.useState("disabled"),w=Y||x||R,S=h.useState("itemProps"),I=h.useState("isActive",N.index),y=H3.useMemo(()=>({type:"submenu-trigger",setActive(){if(h.select("highlightItemOnHover"))h.set("activeIndex",N.index)}}),[h,N.index]),{getItemProps:f,itemRef:g}=B6({closeOnClick:!1,disabled:w,highlighted:I,id:D,store:V,typingRef:h.context.typingRef,nativeButton:G,itemMetadata:y,nodeId:L?.context.nodeId}),O=V.useState("hoverEnabled"),c=T8(j,{enabled:O&&U&&!w,handleClose:C8({blockPointerEvents:!0}),mouseOnly:!0,move:!0,restMs:K,delay:{open:K,close:F},shouldOpen:K>0?()=>h.select("allowMouseEnter"):void 0,triggerElementRef:k,externalTree:M,isClosing:()=>V.select("transitionStatus")==="ending",guardStaleOpen:!0}),b=r9(j,{enabled:!w,event:"mousedown",toggle:!U,ignoreMouse:U,stickIfOpen:!1}).reference??_1,d=V.useState("triggerProps",!0);delete d.id;let t={disabled:w,highlighted:I,open:q},u=V.useState("openMethod"),n=V.useState("lastOpenChangeReason")===K0.listNavigation||u==="keyboard",Q0=q&&n&&n1.screenReader.voiceOver;return F0("div",Z,{state:t,stateAttributesMapping:a8,props:[b,c,d,S,Q0?d40:void 0,{"aria-controls":P,tabIndex:q||I?0:-1,onBlur(){if(I)h.set("activeIndex",null)}},W,f],ref:[H,N.ref,g,C,E]})});class gU extends O8{constructor(){super(iR(),"Menu")}open($){this.openByTrigger($)}close(){this.closePopup()}get isOpen(){return this.attachedStore?.select("open")??!1}}function Ub(){return new gU}var E4=_(r(),1);function YZ({...$}){return E4.jsx(U2.Root,{"data-slot":"dropdown-menu",...$})}function l40({...$}){return E4.jsx(A9,{portal:U2.Portal,"data-slot":"dropdown-menu-portal",...$})}function WZ({...$}){return E4.jsx(U2.Trigger,{"data-slot":"dropdown-menu-trigger",...$})}function AZ({align:$="start",alignOffset:Z=0,side:H="bottom",sideOffset:J=4,className:B,...Q}){return E4.jsx(l40,{children:E4.jsx(U2.Positioner,{className:"isolate z-50 outline-none",align:$,alignOffset:Z,side:H,sideOffset:J,children:E4.jsx(U2.Popup,{"data-slot":"dropdown-menu-content",className:d1("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 rtl:data-[side=inline-end]:slide-in-from-right-2 rtl:data-[side=inline-start]:slide-in-from-left-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",B),...Q})})})}function NZ({...$}){return E4.jsx(U2.Group,{"data-slot":"dropdown-menu-group",...$})}function fU({className:$,inset:Z,...H}){return E4.jsx(U2.GroupLabel,{"data-slot":"dropdown-menu-label","data-inset":Z,className:d1("px-2 pt-1.5 pb-0.5 text-xs text-muted-foreground data-inset:ps-7",$),...H})}function rJ({className:$,inset:Z,variant:H="default",...J}){return E4.jsx(U2.Item,{"data-slot":"dropdown-menu-item","data-inset":Z,"data-variant":H,className:d1("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:ps-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",$),...J})}function Kb({...$}){return E4.jsx(U2.RadioGroup,{"data-slot":"dropdown-menu-radio-group",...$})}function Fb({className:$,children:Z,inset:H,...J}){return E4.jsxs(U2.RadioItem,{"data-slot":"dropdown-menu-radio-item","data-inset":H,className:d1("relative flex cursor-default items-center gap-2 rounded-md py-1 ps-2 pe-8 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground focus:**:text-accent-foreground data-inset:ps-7 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",$),...J,children:[E4.jsx("span",{className:"pointer-events-none absolute end-2 flex items-center justify-center","data-slot":"dropdown-menu-radio-item-indicator",children:E4.jsx(U2.RadioItemIndicator,{children:E4.jsx(x3,{stroke:1.75})})}),Z]})}function Yb({className:$,...Z}){return E4.jsx(U2.Separator,{"data-slot":"dropdown-menu-separator",className:d1("mx-2 my-1 h-px bg-border",$),...Z})}var K6={};g5(K6,{createHandle:()=>pb,Viewport:()=>ub,Trigger:()=>Pb,Title:()=>hb,Root:()=>qb,Positioner:()=>Tb,Portal:()=>Ob,Popup:()=>Sb,Handle:()=>lU,Description:()=>vb,Close:()=>fb,Backdrop:()=>bb,Arrow:()=>kb});var aJ=_(p(),1);var mU=_(p(),1),IV=mU.createContext(void 0);function u5($){let Z=mU.useContext(IV);if(Z===void 0&&!$)throw Error(g0(47));return Z}var uU=_(p(),1),Wb=_(x2(),1);var Ab={...G9,disabled:($)=>$.disabled,instantType:($)=>$.instantType,openMethod:($)=>$.openMethod,openChangeReason:($)=>$.openChangeReason,modal:($)=>$.modal,focusManagerModal:($)=>$.focusManagerModal,stickIfOpen:($)=>$.stickIfOpen,titleElementId:($)=>$.titleElementId,descriptionElementId:($)=>$.descriptionElementId,openOnHover:($)=>$.openOnHover,closeDelay:($)=>$.closeDelay,adaptiveOrigin:($)=>$.adaptiveOrigin};class kV extends _4{constructor($,Z,H){let J=new W4;super(Vb($,J,Z,H),Lb(J),Ab)}setOpen=($,Z)=>{let H=Z.reason===K0.triggerHover,J=Z.reason===K0.triggerPress&&Z.event.detail===0,B=!$&&(Z.reason===K0.escapeKey||Z.reason==null),Q=uH(Z),z=this.select("activeTriggerId");if(!$&&Z.reason===K0.closePress&&Z.trigger==null&&z!=null)Z.trigger=this.context.triggerElements.getById(z)??this.select("activeTriggerElement")??void 0;if(this.context.onOpenChange?.($,Z),Z.isCanceled)return;this.state.floatingRootContext.dispatchOpenChange($,Z);let X=()=>{let U=H7(this.state,$,Z.trigger,Q());U.openChangeReason=Z.reason,this.update(U)};if(H)this.set("stickIfOpen",!0),this.context.stickIfOpenTimeout.start(dQ,()=>{this.set("stickIfOpen",!1)}),Wb.flushSync(X);else X();let G;if(J)G="click";else if(B)G="dismiss";else if(Z.reason===K0.focusOut)G="focus";this.set("instantType",G)}}function Nb(){let $=new W4,Z=new w8(Object.freeze(Vb(void 0,$)),Object.freeze(Lb($)),Ab);return Object.assign(Z,{setOpen:K1})}function Vb($,Z,H,J=!1){let B={...X9(Z,H,J),disabled:!1,modal:!1,focusManagerModal:!1,instantType:void 0,openMethod:null,openChangeReason:null,titleElementId:void 0,descriptionElementId:void 0,stickIfOpen:!0,openOnHover:!1,closeDelay:0,adaptiveOrigin:void 0,...$};if(B.open&&$?.mounted===void 0)B.mounted=!0;return B}function Lb($){return{popupRef:uU.createRef(),onOpenChange:void 0,onOpenChangeComplete:void 0,triggerFocusTargetRef:uU.createRef(),beforeContentFocusGuardRef:uU.createRef(),stickIfOpenTimeout:new v5,triggerElements:$}}var G6=_(r(),1),Db=D8(function({props:Z}){let{children:H,open:J,defaultOpen:B=!1,onOpenChange:Q,onOpenChangeComplete:z,modal:X=!1,handle:G,triggerId:U,defaultTriggerId:K=null}=Z,F=i40(G,{modal:X,open:B,openProp:J,activeTriggerId:K,triggerIdProp:U});F.useControlledProp("openProp",J),F.useControlledProp("triggerIdProp",U);let Y=F.useState("open"),W=F.useState("mounted"),A=F.useState("payload");F.useContextCallback("onOpenChange",Q),F.useContextCallback("onOpenChangeComplete",z),Uz(F,Y),B9(F);let{forceUnmount:N}=Q9(Y,F,()=>{F.update({stickIfOpen:!0,openChangeReason:null})});F.useSyncedValues({modal:X}),aJ.useEffect(()=>{if(!Y)F.context.stickIfOpenTimeout.clear()},[F,Y]),aJ.useImperativeHandle(Z.actionsRef,()=>({unmount:N,close:()=>F.setOpen(!1,R0(K0.imperativeAction))}),[N,F]);let L=Y||W;return G6.jsxs(IV.Provider,{value:F,children:[G&&G6.jsx(H9,{handle:G,store:F}),L&&G6.jsx(r40,{store:F,modal:X}),typeof H==="function"?H({payload:A}):H]})});function qb($){if(u5(!0))return G6.jsx(Db,{props:$});return G6.jsx(e6,{children:G6.jsx(Db,{props:$})})}function i40($,Z){let H=O3((J,B)=>new kV(Z,J,B));return aJ.useEffect(()=>H.context.stickIfOpenTimeout.disposeEffect(),[H]),H}function r40({store:$,modal:Z}){let H=$.useState("floatingRootContext"),J=j8(H,{outsidePressEvent:{mouse:Z==="trap-focus"?"sloppy":"intentional",touch:"sloppy"}}),B=J.reference,Q=J.floating;return z9($,{activeTriggerProps:B,inactiveTriggerProps:B,popupProps:Q}),null}var nJ=_(p(),1);var Mb=300;var VZ=_(r(),1),Pb=i8(function(Z,H){let{render:J,className:B,style:Q,disabled:z=!1,nativeButton:X=!0,handle:G,payload:U,openOnHover:K=!1,delay:F=Mb,closeDelay:Y=0,id:W,...A}=Z,N=u5(!0),V=U9(G)??N;if(!V)throw Error(g0(74));let D=J1(W),q=V.useState("isTriggerActive",D),j=V.useState("floatingRootContext"),M=V.useState("isOpenedByTrigger",D),P=V.useState("triggerPopupId",D),T=nJ.useRef(null),{registerTrigger:C,isMountedByThisTrigger:k}=J9(D,T,V,{payload:U,disabled:z,openOnHover:K,closeDelay:Y}),E=V.useState("openChangeReason"),h=V.useState("stickIfOpen"),x=V.useState("openMethod"),R=V.useState("focusManagerModal"),w=T8(j,{enabled:!z&&K&&(x!=="touch"||E!==K0.triggerPress),mouseOnly:!0,move:!1,handleClose:C8(),restMs:F,delay:{close:Y},triggerElementRef:T,isActiveTrigger:q,isClosing:()=>V.select("transitionStatus")==="ending"}),S=r9(j,{stickIfOpen:h}),I=HJ(()=>V.select("open"),(a)=>{V.set("openMethod",a)}),y=V.useState("triggerProps",k),{getButtonProps:f,buttonRef:g}=R5({disabled:z,native:X}),O={open(a){if(a&&E===K0.triggerPress)return SH.open(a);return a8.open(a)}},{preFocusGuardRef:c,handlePreFocusGuardFocus:o,handleFocusTargetFocus:b}=xU(V,T),t=F0("button",Z,{state:{disabled:z,open:M},ref:[g,H,C,T],props:[S.reference,w,y,I,{[q$]:"",id:D,"aria-haspopup":"dialog","aria-expanded":M,"aria-controls":P},A,f],stateAttributesMapping:O}),u=VZ.jsx(nJ.Fragment,{children:t},D);if(k&&!R)return VZ.jsxs(nJ.Fragment,{children:[VZ.jsx(M2,{ref:c,onFocus:o}),u,VZ.jsx(M2,{ref:V.context.triggerFocusTargetRef,onFocus:b})]});return u});var jb=_(p(),1);var pU=_(p(),1),RV=pU.createContext(void 0);function _b(){let $=pU.useContext(RV);if($===void 0)throw Error(g0(45));return $}var bV=_(r(),1),Ob=jb.forwardRef(function(Z,H){let{keepMounted:J=!1,...B}=Z;if(!(u5().useState("mounted")||J))return null;return bV.jsx(RV.Provider,{value:J,children:bV.jsx(o6,{ref:H,...B})})});var dU=_(p(),1);var cU=_(p(),1),yV=cU.createContext(void 0);function LZ(){let $=cU.useContext(yV);if(!$)throw Error(g0(46));return $}var oJ=_(r(),1),Tb=dU.forwardRef(function(Z,H){let{render:J,className:B,style:Q,anchor:z,positionMethod:X,side:G,align:U,sideOffset:K,alignOffset:F,collisionBoundary:Y="clipping-ancestors",collisionPadding:W,arrowPadding:A,sticky:N,disableAnchorTracking:L=!1,collisionAvoidance:V=e8,...D}=Z,q=u5(),j=_b(),M=i9(),P=q.useState("floatingRootContext"),T=q.useState("mounted"),C=q.useState("open"),k=q.useState("openChangeReason"),E=q.useState("activeTriggerElement"),h=q.useState("modal"),x=q.useState("openMethod"),R=q.useState("positionerElement"),w=q.useState("instantType"),S=q.useState("transitionStatus"),I=q.useState("adaptiveOrigin"),y=dU.useRef(null),f=P2(R),g=F9({anchor:z,floatingRootContext:P,positionMethod:X,mounted:T,side:G,sideOffset:K,align:U,alignOffset:F,arrowPadding:A,collisionBoundary:Y,collisionPadding:W,sticky:N,disableAnchorTracking:L,keepMounted:j,nodeId:M,collisionAvoidance:V,adaptiveOrigin:I}),O=P.useState("domReferenceElement");J0(()=>{let t=O,u=y.current;if(t)y.current=t;if(u&&t&&t!==u){q.set("instantType",void 0);let a=new AbortController;return f(()=>{q.set("instantType","trigger-change")},a.signal),()=>{a.abort()}}return},[O,f,q]);let c=h===!0&&k!==K0.triggerHover;OU(C&&c,x==="touch",R,E);let o=q.useStateSetter("positionerElement"),b={open:C,side:g.side,align:g.align,anchorHidden:g.anchorHidden,instant:w},d=W9(Z,b,{styles:g.positionerStyles,transitionStatus:S,props:D,refs:[H,o],hidden:!T,inert:!C});return oJ.jsxs(yV.Provider,{value:g,children:[T&&c&&oJ.jsx(b$,{inert:t8(!C),cutout:E}),oJ.jsx(t6,{id:M,children:d})]})});var Eb=_(p(),1);var U6=_(p(),1);var hV=U6.createContext(void 0);function Cb(){let[$,Z]=U6.useState(0),H=W0(()=>{return Z((B)=>B+1),()=>{Z((B)=>Math.max(0,B-1))}});return{context:U6.useMemo(()=>({register:H}),[H]),hasClosePart:$>0}}function wb(){let $=U6.useContext(hV);J0(()=>{return $?.register()},[$])}var xV=_(r(),1),Sb=Eb.forwardRef(function(Z,H){let{render:J,className:B,style:Q,initialFocus:z,finalFocus:X,...G}=Z,U=u5(),K=LZ(),F=MU(!0)!=null,{context:Y,hasClosePart:W}=Cb(),A=U.useState("open"),N=U.useState("openMethod"),L=U.useState("instantType"),V=U.useState("transitionStatus"),D=U.useState("popupProps"),q=U.useState("titleElementId"),j=U.useState("descriptionElementId"),M=U.useState("modal"),P=U.useState("mounted"),T=U.useState("openChangeReason"),C=U.useState("activeTriggerElement"),k=U.useState("floatingRootContext"),E=k.useState("floatingId"),h=U.useState("disabled"),x=U.useState("openOnHover"),R=U.useState("closeDelay");f5({open:A,ref:U.context.popupRef,onComplete(){if(A)U.context.onOpenChangeComplete?.(!0)}}),n9(k,{enabled:x&&!h,closeDelay:R});let w=z===void 0?Xz(U.context.popupRef):z,S=M!==!1&&W;U.useSyncedValue("focusManagerModal",S);let I=U.useStateSetter("popupElement"),y={open:A,side:K.side,align:K.align,instant:L,transitionStatus:V},f=F0("div",Z,{state:y,ref:[H,U.context.popupRef,I],props:[D,{id:E,role:"dialog",...Z9,"aria-labelledby":q,"aria-describedby":j,onKeyDown(g){if(F&&e9.has(g.key))g.stopPropagation()}},Y9(V),G],stateAttributesMapping:y4});return xV.jsx($7,{context:k,openInteractionType:N,modal:S,disabled:!P||T===K0.triggerHover,initialFocus:w,returnFocus:X,restoreFocus:"popup",previousFocusableElement:C1(C)?C:void 0,nextFocusableElement:U.context.triggerFocusTargetRef,beforeContentFocusGuardRef:U.context.beforeContentFocusGuardRef,children:xV.jsx(hV.Provider,{value:Y,children:f})})});var Ib=_(p(),1);var kb=Ib.forwardRef(function(Z,H){let{render:J,className:B,style:Q,...z}=Z,G=u5().useState("open"),{arrowRef:U,side:K,align:F,arrowUncentered:Y,arrowStyles:W}=LZ();return F0("div",Z,{state:{open:G,side:K,align:F,uncentered:Y},ref:[H,U],props:[{style:W,"aria-hidden":!0},z],stateAttributesMapping:b2})});var Rb=_(p(),1);var bb=Rb.forwardRef(function(Z,H){let{render:J,className:B,style:Q,...z}=Z,X=u5(),G=X.useState("open"),U=X.useState("mounted"),K=X.useState("transitionStatus"),F=X.useState("openChangeReason");return F0("div",Z,{state:{open:G,transitionStatus:K},ref:H,props:[{role:"presentation",hidden:!U,style:{pointerEvents:F===K0.triggerHover?"none":void 0,userSelect:"none",WebkitUserSelect:"none"}},z],stateAttributesMapping:y4})});var yb=_(p(),1);var hb=yb.forwardRef(function(Z,H){let{render:J,className:B,style:Q,...z}=Z,X=u5(),G=J1(z.id);return X.useSyncedValueWithCleanup("titleElementId",G),F0("h2",Z,{ref:H,props:[{id:G},z]})});var xb=_(p(),1);var vb=xb.forwardRef(function(Z,H){let{render:J,className:B,style:Q,...z}=Z,X=u5(),G=J1(z.id);return X.useSyncedValueWithCleanup("descriptionElementId",G),F0("p",Z,{ref:H,props:[{id:G},z]})});var gb=_(p(),1);var fb=gb.forwardRef(function(Z,H){let{render:J,className:B,style:Q,disabled:z=!1,nativeButton:X=!0,...G}=Z,{buttonRef:U,getButtonProps:K}=R5({disabled:z,focusableWhenDisabled:!1,native:X}),F=u5();return wb(),F0("button",Z,{ref:[H,U],props:[{onClick(W){F.setOpen(!1,R0(K0.closePress,W.nativeEvent))}},G,K]})});var mb=_(p(),1);var ub=mb.forwardRef(function(Z,H){let{render:J,className:B,style:Q,children:z,...X}=Z,G=u5(),{side:U}=LZ(),K=G.useState("instantType"),{children:F,state:Y}=w3({store:G,side:U,children:z}),W={activationDirection:Y.activationDirection,transitioning:Y.transitioning,instant:K};return F0("div",Z,{state:W,ref:H,props:[X,{children:F}],stateAttributesMapping:C3})});class lU extends O8{constructor(){super(Nb(),"Popover")}open($){this.openByTrigger($)}close(){this.closePopup()}get isOpen(){return this.attachedStore?.select("open")??!1}}function pb(){return new lU}var I7=_(r(),1);function iU({...$}){return I7.jsx(K6.Root,{"data-slot":"popover",...$})}function rU({...$}){return I7.jsx(K6.Trigger,{"data-slot":"popover-trigger",...$})}function aU({className:$,align:Z="center",alignOffset:H=0,side:J="bottom",sideOffset:B=4,keepMounted:Q,...z}){return I7.jsx(A9,{portal:K6.Portal,keepMounted:Q,children:I7.jsx(K6.Positioner,{align:Z,alignOffset:H,side:J,sideOffset:B,className:"isolate z-50",children:I7.jsx(K6.Popup,{"data-slot":"popover-content",className:d1("z-50 flex w-72 origin-(--transform-origin) flex-col gap-2.5 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",$),...z})})})}function cb({className:$,...Z}){return I7.jsx("div",{"data-slot":"popover-header",className:d1("flex flex-col gap-0.5 text-sm",$),...Z})}var JK=_(p(),1);var F6={};g5(F6,{Value:()=>ob,Track:()=>$y,Thumb:()=>Gy,Root:()=>ib,Label:()=>ab,Indicator:()=>Ky,Control:()=>tb});var i5=_(p(),1);function vV($,Z,H=Object.is){let{length:J}=$;if(J!==Z.length)return!1;for(let B=0;B<J;B+=1)if(!H($[B],Z[B]))return!1;return!0}function db($){return $==null?void 0:`${$}-label`}function lb($,Z){return $??Z}function nU($,Z){return $-Z}function oU($,Z,H,J,B,Q){let z=Y4($,H,J);if(!B)return z;let X=Q.slice();return X[Z]=Y4(z,Q[Z-1]??-1/0,Q[Z+1]??1/0),X.sort(nU)}function sU($,Z,H){if(!Array.isArray($))return!0;let J=Z*H;for(let B=0;B<$.length-1;B+=1)if(!(Math.abs($[B]-$[B+1])>=J))return!1;return!0}var DZ=()=>null,E2={activeThumbIndex:DZ,max:DZ,min:DZ,minStepsBetweenValues:DZ,step:DZ,values:DZ,...p4};var tU=_(p(),1),gV=tU.createContext(void 0);function F8(){let $=tU.useContext(gV);if($===void 0)throw Error(g0(62));return $}var fV=_(r(),1);function a40($,Z){return $===Z||Array.isArray($)&&Array.isArray(Z)&&vV($,Z)}var ib=i5.forwardRef(function(Z,H){let{"aria-labelledby":J,className:B,defaultValue:Q,disabled:z=!1,id:X,format:G,largeStep:U=10,locale:K,render:F,max:Y=100,min:W=0,minStepsBetweenValues:A=0,form:N,name:L,onValueChange:V,onValueCommitted:D,orientation:q="horizontal",step:j=1,thumbCollisionBehavior:M="push",thumbAlignment:P="center",value:T,style:C,...k}=Z,E=J1(X),h=db(E),x=W0(V),R=W0(D),{clearErrors:w}=j2(),{state:S,disabled:I,name:y,setTouched:f,setDirty:g,validityData:O,validation:c}=s5(),{labelId:o}=t5(),[b,d]=i5.useState(),t=J??lb(o,b),u=I||z,a=y??L,[n,Q0]=B8({controlled:T,default:Q??W,name:"Slider"}),Z0=i5.useRef(null),U0=i5.useRef(null),B0=i5.useRef([]),Y0=i5.useRef(null),A0=i5.useRef(-1),D0=i5.useRef(null),X0=i5.useRef(K0.none),[i,l]=i5.useState(-1),[e,$0]=i5.useState(-1),[H0,O0]=i5.useState(!1),[P0,N0]=i5.useState(()=>new Map),[M0,v]=i5.useState([void 0,void 0]),m=W0((u0)=>{if(l(u0),u0!==-1)$0(u0)}),s=W0((u0)=>{if(u0)U0.current=u0}),G0=Array.isArray(n),j0=i5.useMemo(()=>{if(!G0)return[Y4(n,W,Y)];return n.map((u0)=>Y4(u0,W,Y)).sort(nU)},[Y,W,G0,n]),m0=G0?j0:j0[0];x$(c.inputRef,E,m0,void 0,!u,L),k3(m0,()=>{w(a),c.change(m0);let u0=O.initialValue,N1;if(Array.isArray(m0)&&Array.isArray(u0))N1=!vV(m0,u0);else N1=m0!==u0;g(N1)});let v0=W0((u0,N1)=>{if(Number.isNaN(u0)||a40(u0,n))return!1;let H5=N1.event,q0=new H5.constructor(H5.type,H5);if(Object.defineProperty(q0,"target",{writable:!0,value:{value:u0,name:a}}),N1.event=q0,x(u0,N1),N1.isCanceled)return!1;return X0.current=N1.reason,Q0(u0),!0}),T0=W0((u0,N1,H5)=>{let M1=oU(u0,N1,W,Y,G0,j0);if(sU(M1,j,A)){let q0="key"in H5?K0.keyboard:K0.inputChange,V0=v0(M1,R0(q0,H5.nativeEvent,void 0,{activeThumbIndex:N1}));if(f(!0),V0)R(M1,$z(q0,H5.nativeEvent))}});J0(()=>{if(!u)return;let u0=c1(f0(Z0.current));if(k0(Z0.current,u0))u0.blur();if(i!==-1)m(-1)},[i,u,m]);let p0=i5.useMemo(()=>({...S,activeThumbIndex:i,disabled:u,dragging:H0,orientation:q,max:Y,min:W,minStepsBetweenValues:A,step:j,values:j0}),[S,i,u,H0,Y,W,A,q,j,j0]),$1=i5.useMemo(()=>({active:i,controlRef:U0,disabled:u,dragging:H0,validation:c,format:G,handleInputChange:T0,indicatorPosition:M0,inset:P!=="center",labelId:t,rootLabelId:h,largeStep:U,lastUsedThumbIndex:e,lastChangeReasonRef:X0,form:N,locale:K,max:Y,min:W,minStepsBetweenValues:A,name:a,onValueCommitted:R,orientation:q,pressedThumbCenterOffsetRef:Y0,pressedThumbIndexRef:A0,pressedValuesRef:D0,registerFieldControlRef:s,renderBeforeHydration:P==="edge",setActive:m,setDragging:O0,setIndicatorPosition:v,setLabelId:d,setValue:v0,state:p0,step:j,thumbCollisionBehavior:M,thumbMap:P0,thumbRefs:B0,values:j0}),[i,t,h,u,H0,c,G,T0,M0,U,e,N,K,Y,W,A,a,R,q,s,m,v0,p0,j,M,P,P0,j0]),D1=F0("div",Z,{state:p0,ref:[H,Z0],props:[{"aria-labelledby":t,id:E,role:"group"},k,(u0)=>c.getValidationProps(u,u0)],stateAttributesMapping:E2});return fV.jsx(gV.Provider,{value:$1,children:fV.jsx(jU,{elementsRef:B0,onMapChange:N0,children:D1})})});var rb=_(p(),1);var ab=rb.forwardRef(function(Z,H){let{render:J,className:B,style:Q,...z}=Z,X=z;delete X.id;let{state:G,setLabelId:U,controlRef:K,rootLabelId:F}=F8();function Y(A,N){if(N){let D=f0(A.currentTarget).getElementById(N);if(C1(D)){FX(D);return}}let L=K.current?.querySelectorAll('input[type="range"]'),V=L?.length===1?L[0]:null;if(C1(V))FX(V)}let W=KX({id:F,setLabelId:U,focusControl:Y});return F0("div",Z,{ref:H,state:G,props:[W,z],stateAttributesMapping:E2})});var eU=_(p(),1);function mV($){if(Array.isArray($))return $.map((Z)=>mV(Z)).join(",");if($==null)return"";return String($)}var nb=new Map;function n40($,Z){let H=JSON.stringify({locale:mV($),options:Z}),J=nb.get(H);if(J)return J;let B=new Intl.NumberFormat($,Z);return nb.set(H,B),B}function qZ($,Z,H){if($==null)return"";return n40(Z,H).format($)}var ob=eU.forwardRef(function(Z,H){let{"aria-live":J="off",render:B,className:Q,children:z,style:X,...G}=Z,{thumbMap:U,state:K,values:F,format:Y,locale:W}=F8(),A=Array.from(U.values(),({inputId:D})=>D).join(" ").trim()||void 0,N=eU.useMemo(()=>F.map((D)=>qZ(D,W,Y)),[Y,W,F]),L=N.join(" – ");return F0("output",Z,{state:K,ref:H,props:[{"aria-live":J,children:typeof z==="function"?z(N,F):L,htmlFor:A},G],stateAttributesMapping:E2})});var Y8=_(p(),1);function $K($,Z){let H=$.getBoundingClientRect();return Z?(H.top+H.bottom)/2:(H.left+H.right)/2}function MZ($){if($===0)return 0;if(Math.abs($)<1){let H=$.toExponential().split("e-"),J=H[0].split(".")[1];return(J?J.length:0)+parseInt(H[1],10)}let Z=$.toString().split(".")[1];return Z?Z.length:0}function ZK($,Z,H){let J=Math.round(($-H)/Z)*Z+H;return Number(J.toFixed(Math.max(MZ(Z),MZ(H))))}function uV($,Z,H,J,B,Q,z,X){let G=$.slice(),U=Q*z,K=G.length-1,F=X??$,Y=J+Z*U,W=B-(K-Z)*U;G[Z]=Y4(H,Y,W);for(let A=Z+1;A<=K;A+=1){let N=G[A-1]+U,L=B-(K-A)*U,V=F[A],D=Math.max(G[A],N);if(V<D)D=Math.max(V,N);G[A]=Y4(D,N,L)}for(let A=Z-1;A>=0;A-=1){let N=G[A+1]-U,L=J+A*U,V=F[A],D=Math.min(G[A],N);if(V>D)D=Math.min(V,N);G[A]=Y4(D,L,N)}for(let A=0;A<=K;A+=1)G[A]=Number(G[A].toFixed(12));return G}function sb($,Z,H,J,B,Q,z,X,G,U){let K=H??Z,F=J??Z;if(!(K.length>1))return{value:Q,thumbIndex:0,didSwap:!1};let W=G*U;if($==="push")return{value:uV(K,B,Q,z,X,G,U),thumbIndex:B,didSwap:!1};let A=K.slice(),N=A[B-1],L=A[B+1],V=N!=null?N+W:z,D=L!=null?L-W:X,q=Number(Y4(Q,V,D).toFixed(12));switch(A[B]=q,$){case"swap":{let j=K[B],M=0.0000001,P=Q>j,T=Q<j,C=P&&L!=null&&Q>=L-0.0000001,k=T&&N!=null&&Q<=N+0.0000001;if(!C&&!k)return{value:A,thumbIndex:B,didSwap:!1};let E=C?B+1:B-1,h=A.map((O,c)=>{if(c===B)return q;let o=F[c];if(o!=null)return o;return K[c]}),x=Q;if(C)x=Math.max(Q,A[E]);else x=Math.min(Q,A[E]);let R=uV(A,E,x,z,X,G,U,h),w=C?E-1:E+1,S=R[w-1],I=R[w+1],y=S!=null?S+W:z;y=Math.max(y,z+w*W);let f=I!=null?I-W:X;f=Math.min(f,X-(R.length-1-w)*W);let g=Y4(q,y,f);return R[w]=Number(g.toFixed(12)),{value:R,thumbIndex:E,didSwap:!0}}case"none":default:return{value:A,thumbIndex:B,didSwap:!1}}}var o40=2;function s40($,Z){if(!$)return{start:0,end:0};function H(Q){let z=Q!=null?parseFloat(Q):0;return Number.isNaN(z)?0:z}let J=!Z?"InlineStart":"Top",B=!Z?"InlineEnd":"Bottom";return{start:H($[`border${J}Width`])+H($[`padding${J}`]),end:H($[`border${B}Width`])+H($[`padding${B}`])}}function t40($,Z){if(Z.current!=null&&$.changedTouches){let H=$;for(let J=0;J<H.changedTouches.length;J+=1){let B=H.changedTouches[J];if(B.identifier===Z.current)return{x:B.clientX,y:B.clientY}}return null}return{x:$.clientX,y:$.clientY}}var tb=Y8.forwardRef(function(Z,H){let{render:J,className:B,style:Q,...z}=Z,{disabled:X,dragging:G,inset:U,lastChangeReasonRef:K,max:F,min:Y,minStepsBetweenValues:W,onValueCommitted:A,orientation:N,pressedThumbCenterOffsetRef:L,pressedThumbIndexRef:V,pressedValuesRef:D,registerFieldControlRef:q,renderBeforeHydration:j,setActive:M,setDragging:P,setValue:T,state:C,step:k,thumbCollisionBehavior:E,thumbRefs:h,values:x}=F8(),R=Z8(),w=x.length>1,S=N==="vertical",I=Y8.useRef(null),y=Y8.useRef(null),f=W0((l)=>{if(l&&y.current==null)y.current=u1(l).getComputedStyle(l)}),g=Y8.useRef(null),O=Y8.useRef(0),c=Y8.useRef(0),o=Y8.useRef(null),b=Q5(x);function d(l){return l?.querySelector('input[type="range"]')}function t(l){if(V.current=l,!h.current[l])L.current=null}function u(){V.current=-1,L.current=null}function a(l){if(!r0(l))return!1;return h.current.some((e)=>{if(!r0(e)||!k0(e,l))return!1;return d(e)?.disabled===!0})}function n(l){let e=I.current,$0=V.current;if(!e||$0<0||$0>=x.length){if($0>=x.length)o.current=null;return null}let{width:H0,height:O0,bottom:P0,left:N0,right:M0}=e.getBoundingClientRect(),v=s40(y.current,S),m=c.current,s=(S?O0:H0)-v.start-v.end-m*2,G0=L.current??0,j0=l.x-G0,m0=l.y-G0,v0=S?P0-m0-v.end:(R==="rtl"?M0-j0:j0-N0)-v.start,T0=Y4((v0-m)/s,0,1),p0=(F-Y)*T0+Y;if(p0=ZK(p0,k,Y),p0=Y4(p0,Y,F),!w)return{value:p0,thumbIndex:$0,didSwap:!1};return sb(E,x,b.current,D.current,$0,p0,Y,F,k,W)}function Q0(l){D.current=w?x.slice():null,o.current=null,b.current=x;let e=V.current,$0=e;if(e>-1&&e<x.length){if(x[e]===F){let H0=e;while(H0>0&&x[H0-1]===F)H0-=1;$0=H0}}else{let H0=!S?"x":"y",O0;$0=-1;for(let P0=0;P0<h.current.length;P0+=1){let N0=h.current[P0];if(r0(N0)&&!d(N0)?.disabled){let M0=$K(N0,S),v=Math.abs(l[H0]-M0);if(O0===void 0||v<=O0)$0=P0,O0=v}}}if($0>-1&&$0!==e)t($0);if(U){let H0=h.current[$0];if(r0(H0)){let O0=H0.getBoundingClientRect(),P0=!S?"width":"height";c.current=O0[P0]/2}}}function Z0(l){let e=d(h.current?.[l]);if(!e)return;e.focus({preventScroll:!0,focusVisible:!1})}function U0(l,e,$0){let H0=T(l.value,R0(e,$0,void 0,{activeThumbIndex:l.thumbIndex}));if(H0){if(o.current=l.value,b.current=Array.isArray(l.value)?l.value:[l.value],l.didSwap)t(l.thumbIndex),Z0(l.thumbIndex)}return H0}let B0=W0((l)=>{let e=t40(l,g);if(e==null)return;if(O.current+=1,l.type==="pointermove"&&l.buttons===0){Y0(l);return}let $0=n(e);if($0==null)return;if(sU($0.value,k,W)){if(!G&&O.current>o40)P(!0);U0($0,K0.drag,l)}}),Y0=W0((l)=>{M(-1),P(!1),L.current=null;let e=o.current;if(Array.isArray(e)&&e.length!==x.length)o.current=null;if(o.current!=null){let $0=K.current;A(o.current,$z($0,l))}if("pointerType"in l&&I.current?.hasPointerCapture(l.pointerId))I.current?.releasePointerCapture(l.pointerId);V.current=-1,g.current=null,D0()}),A0=W0((l)=>{if(X)return;if(a(P1(l))){u();return}let e=l.changedTouches[0];if(e==null)return;g.current=e.identifier;let $0={x:e.clientX,y:e.clientY};Q0($0);let H0=n($0);if(H0==null)return;Z0(H0.thumbIndex),U0(H0,K0.trackPress,l),O.current=0;let O0=f0(I.current);O0.addEventListener("touchmove",B0,{passive:!0}),O0.addEventListener("touchend",Y0,{passive:!0})}),D0=W0(()=>{let l=f0(I.current);l.removeEventListener("pointermove",B0),l.removeEventListener("pointerup",Y0),l.removeEventListener("touchmove",B0),l.removeEventListener("touchend",Y0),D.current=null,o.current=null}),X0=Z2();return Y8.useEffect(()=>{let l=I.current;if(!l)return()=>D0();let e=i0(l,"touchstart",A0,{passive:!0});return()=>{e(),X0.cancel(),D0()}},[D0,A0,I,X0]),Y8.useEffect(()=>{if(X)D0()},[X,D0]),F0("div",Z,{state:C,ref:[H,q,I,f],props:[{["data-base-ui-slider-control"]:j?"":void 0,onPointerDown(l){let e=I.current,$0=P1(l.nativeEvent);if(!e||X||l.defaultPrevented||!r0($0)||l.button!==0)return;if(a($0)){u();return}let H0={x:l.clientX,y:l.clientY};Q0(H0);let O0=n(H0);if(O0==null)return;if(k0(h.current[O0.thumbIndex],c1(f0(e))))l.preventDefault();else X0.request(()=>{Z0(O0.thumbIndex)});if(P(!0),L.current==null)U0(O0,K0.trackPress,l.nativeEvent);if(l.nativeEvent.pointerId)e.setPointerCapture(l.nativeEvent.pointerId);O.current=0;let M0=f0(e);M0.addEventListener("pointermove",B0,{passive:!0}),M0.addEventListener("pointerup",Y0,{once:!0})}},z],stateAttributesMapping:E2})});var eb=_(p(),1);var $y=eb.forwardRef(function(Z,H){let{render:J,className:B,style:Q,...z}=Z,{state:X}=F8();return F0("div",Z,{state:X,ref:H,props:[{style:{position:"relative"}},z],stateAttributesMapping:E2})});var W8=_(p(),1);var Zy="";var Hy=_(W$(),1);function e40(){return K1}function $20(){return!1}function Z20(){return!0}function PZ(){return Hy.useSyncExternalStore(e40,$20,Z20)}function sJ($,Z,H){return($-Z)*100/(H-Z)}var ne0=_(p(),1);var HK=_(p(),1),H20=HK.createContext(void 0),J20={disableStyleElements:!1};function Jy(){return HK.useContext(H20)??J20}var By=_(r(),1);function Qy($){let{script:Z}=$,{nonce:H}=Jy();if(!PZ())return null;return By.jsx("script",{nonce:H,dangerouslySetInnerHTML:{__html:Z},suppressHydrationWarning:!0})}var zy="data-index";var tJ=_(r(),1),Xy,Q20=new Set([...e9,PA,_A]);function z20($,Z,H,J){if(Z<0)return;if($.length===2)return`${qZ($[Z],J,H)} ${Z===0?"start":"end"} range`;return H?qZ($[Z],J,H):void 0}function X20($,Z,H,J,B){let Q=$+Z*H,z=Number(Q.toFixed(Math.max(MZ($),MZ(Z),MZ(J))));return Y4(z,J,B)}var Gy=W8.forwardRef(function(Z,H){let{render:J,children:B,className:Q,"aria-describedby":z,"aria-label":X,"aria-labelledby":G,"aria-valuetext":U,disabled:K=!1,getAriaLabel:F,getAriaValueText:Y,id:W,index:A,inputRef:N,onBlur:L,onFocus:V,onKeyDown:D,tabIndex:q,style:j,...M}=Z,P=J1(W),{active:T,lastUsedThumbIndex:C,controlRef:k,disabled:E,validation:h,format:x,handleInputChange:R,inset:w,labelId:S,largeStep:I,locale:y,max:f,min:g,minStepsBetweenValues:O,form:c,name:o,orientation:b,pressedThumbCenterOffsetRef:d,pressedThumbIndexRef:t,renderBeforeHydration:u,setActive:a,setIndicatorPosition:n,state:Q0,step:Z0,thumbRefs:U0,values:B0}=F8(),Y0=Z8(),A0=K||E,D0=B0.length>1,X0=b==="vertical",i=Y0==="rtl",{setTouched:l,setFocused:e,validationMode:$0}=s5(),H0=W8.useRef(null),O0=W8.useRef(null),P0=W8.useRef(!1),N0=W0((h0)=>{if(P0.current)return;V?.(h0)}),M0=W0((h0)=>{if(P0.current)return;L?.(h0)}),v=J1(),m=v$(),s=D0?v:m,G0=W8.useMemo(()=>({inputId:s}),[s]),{ref:j0,index:m0}=w2({metadata:G0}),v0=!D0?0:A??m0,T0=v0===B0.length-1,p0=B0[v0],$1=sJ(p0,g,f),[D1,u0]=W8.useState(),N1=PZ(),H5=C>=0&&C<B0.length?C:-1,M1=W0(()=>{let h0=k.current,H1=H0.current;if(!h0||!H1)return;let O1=H1.getBoundingClientRect(),f1=h0.getBoundingClientRect(),b0=X0?"height":"width",n0=f1[b0]-O1[b0],V1=(O1[b0]/2+n0*$1/100)/f1[b0]*100,b1=Number.isFinite(V1)?V1:void 0;if(u0(b1),v0===0)n((m1)=>[b1,m1[1]]);else if(T0)n((m1)=>[m1[0],b1])});J0(()=>{if(w)queueMicrotask(M1)},[M1,w]),J0(()=>{if(w)M1()},[M1,w,$1]),J0(()=>{if(!w)return;let h0=k.current,H1=H0.current;if(!h0||!H1)return;let O1=u1(h0).ResizeObserver;if(typeof O1!=="function")return;let f1=new O1(M1);return f1.observe(h0),f1.observe(H1),()=>{f1.disconnect()}},[k,M1,w]);let q0=X0?"bottom":"insetInlineStart",V0=X0?"left":"top",I0;if(D0){if(T===v0)I0=2;else if(H5===v0)I0=1}else if(T===v0)I0=1;let c0;if(!w&&!Number.isFinite($1))c0=c9;else c0={position:"absolute",[q0]:w?"var(--position)":`${$1}%`,[V0]:"50%",translate:`${(X0||!i?-1:1)*50}% ${(X0?1:-1)*50}%`,zIndex:I0,...w&&{["--position"]:`${D1??0}%`,visibility:u&&N1||D1===void 0?"hidden":void 0}};let d0;if(X0)d0=i?"vertical-rl":"vertical-lr";let B1=typeof F==="function"?F(v0):X,Y1=m4({"aria-label":B1,"aria-labelledby":G??(B1==null?S:void 0),"aria-describedby":z,"aria-orientation":b,"aria-valuenow":p0,"aria-valuetext":typeof Y==="function"?Y(qZ(p0,y,x),p0,v0):U??z20(B0,v0,x,y),disabled:A0,form:c,id:s,max:f,min:g,name:o,onChange(h0){R(h0.currentTarget.valueAsNumber,v0,h0)},onFocus(h0){let H1=P0.current;if(P0.current=!1,a(v0),e(!0),H1)h0.stopPropagation()},onBlur(h0){if(P0.current){h0.stopPropagation();return}if(a(-1),U0.current.some((H1)=>k0(H1,h0.relatedTarget)))return;if(l(!0),e(!1),$0==="onBlur")h.commit(oU(p0,v0,g,f,D0,B0))},onKeyDown(h0){if(h0.defaultPrevented)return;if(!Q20.has(h0.key))return;if(e9.has(h0.key))h0.stopPropagation();let H1=null,O1=0,f1=h0.shiftKey?I:Z0,b0=ZK(p0,Z0,g);switch(h0.key){case NA:O1=1;break;case DA:O1=i?-1:1;break;case VA:O1=-1;break;case LA:O1=i?1:-1;break;case PA:f1=I,O1=1;break;case _A:f1=I,O1=-1;break;case MA:H1=D0&&Number.isFinite(B0[v0+1])?B0[v0+1]-Z0*O:f;break;case qA:H1=D0&&Number.isFinite(B0[v0-1])?B0[v0-1]+Z0*O:g;break;default:break}if(O1!==0)H1=X20(b0,f1,O1,g,f);if(H1!==null){let n0=h0.currentTarget;if(!n8(n0))P0.current=!0,n0.blur(),n0.focus({preventScroll:!0,focusVisible:!0});R(H1,v0,h0),h0.preventDefault()}},step:Z0,style:{...c9,width:"100%",height:"100%",writingMode:d0},tabIndex:q,type:"range",value:p0??""},(h0)=>h.getValidationProps(A0,h0),{onFocus:N0,onBlur:M0,onKeyDown:D}),Z1=v2(O0,h.inputRef,N);return F0("div",Z,{state:Q0,ref:[H,j0,H0],props:[{[zy]:v0,children:tJ.jsxs(W8.Fragment,{children:[B,tJ.jsx("input",{ref:Z1,...Y1,suppressHydrationWarning:!0}),w&&T0&&u&&(Xy||(Xy=tJ.jsx(Qy,{script:Zy})))]}),id:P,onPointerDown(h0){if(A0)return;t.current=v0;let H1=$K(h0.currentTarget,X0);d.current=(X0?h0.clientY:h0.clientX)-H1},style:c0,suppressHydrationWarning:u||void 0},M],stateAttributesMapping:E2})});var Uy=_(p(),1);function G20($,Z,H,J,B,Q){let z={visibility:Q||H&&(J===void 0||Z&&B===void 0)?"hidden":void 0,position:$?"absolute":"relative",[$?"width":"height"]:"inherit"},X=`${J??0}%`,G=`${(B??0)-(J??0)}%`;if(H){if(z["--start-position"]=X,X="var(--start-position)",Z)z["--relative-size"]=G,G="var(--relative-size)"}return z[$?"bottom":"insetInlineStart"]=Z?X:0,z[$?"height":"width"]=Z?G:X,z}var Ky=Uy.forwardRef(function(Z,H){let{render:J,className:B,style:Q,...z}=Z,{indicatorPosition:X,inset:G,max:U,min:K,orientation:F,renderBeforeHydration:Y,state:W,values:A}=F8(),N=PZ(),L=F==="vertical",V=A.length>1,D=G20(L,V,G,G?X[0]:sJ(A[0],K,U),G?X[1]:sJ(A[A.length-1],K,U),G&&Y&&N);return F0("div",Z,{state:W,ref:H,props:[{["data-base-ui-slider-indicator"]:Y?"":void 0,style:D,suppressHydrationWarning:Y||void 0},z],stateAttributesMapping:E2})});var k7=_(r(),1);function Fy({animate:$=!1,children:Z,className:H,defaultValue:J,value:B,min:Q=0,max:z=100,...X}){let[G,U]=JK.useState(!1),K=Array.isArray(B)?B:Array.isArray(J)?J:[Q];return JK.useEffect(()=>{let F=requestAnimationFrame(()=>U(!0));return()=>cancelAnimationFrame(F)},[]),k7.jsx(F6.Root,{className:d1("data-horizontal:w-full data-vertical:h-full",H),"data-slot":"slider",defaultValue:J,value:B,min:Q,max:z,thumbAlignment:"edge",...X,children:k7.jsxs(F6.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:[k7.jsx(F6.Track,{"data-slot":"slider-track",className:"relative grow overflow-hidden rounded-full bg-accent select-none data-horizontal:h-1 data-horizontal:w-full data-vertical:h-full data-vertical:w-1",children:k7.jsx(F6.Indicator,{"data-slot":"slider-range",className:d1("bg-primary select-none data-horizontal:h-full data-vertical:w-full",$&&G&&"transition-[width,height,inset-inline-start,bottom] duration-100 ease-in-out")})}),Z,Array.from({length:K.length},(F,Y)=>k7.jsx(F6.Thumb,{"data-slot":"slider-thumb",className:d1("relative block size-3 shrink-0 rounded-xs bg-primary-foreground shadow-xs 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 data-horizontal:cursor-ew-resize data-vertical:cursor-ns-resize",$&&G&&"transition-[inset-inline-start,bottom,color,box-shadow] duration-100 ease-in-out")},Y))]})})}var A1=_(r(),1);function U20($){return $?.split(/\s*·\s*/)[0]??""}function Yy($){return U20($.description)||$.displayName}function K20($){return $.charAt(0).toUpperCase()+$.slice(1)}function F20($){return $==="xhigh"?"Extra":K20($)}function Wy($){return typeof $==="number"?$:$[0]??0}var Ay={from:{opacity:0,filter:"blur(4px)"},to:{opacity:1,filter:"blur(0px)"}},Ny={type:"spring",duration:0.3,delay:0.1,bounce:0};function Ly({label:$,leadingIcon:Z,className:H,...J}){return A1.jsxs(E0,{...J,variant:"ghost",className:z0("group/picker max-w-56 min-w-0 px-2 text-muted-foreground hover:text-muted-foreground",H),children:[Z,A1.jsx("span",{className:"truncate font-normal",children:$})]})}function Y20({current:$,model:Z,models:H,onValueChange:J}){let B=Yy(Z),Q=UR(H,"Models");return A1.jsxs(YZ,{children:[A1.jsx(WZ,{render:A1.jsx(Ly,{label:B,className:"shrink","aria-label":`Model: ${B}`})}),A1.jsx(AZ,{align:"end",side:"top",className:"w-max max-w-64 min-w-40",children:A1.jsx(Kb,{value:$,onValueChange:J,children:Q.map((z)=>A1.jsxs(NZ,{children:[A1.jsx(fU,{children:z.label}),z.models.map((X)=>A1.jsx(Fb,{value:X.value,closeOnClick:!0,children:Yy(X)},X.value))]},z.label))})})]})}function Dy({fastMode:$,onChange:Z}){return A1.jsxs(l1,{children:[A1.jsx(i1,{render:A1.jsx(E0,{type:"button",variant:"ghost",size:"icon-sm","aria-label":$?"Turn off fast mode":"Turn on fast mode","aria-pressed":$,onClick:()=>Z(!$),className:"-my-1 -mr-1",children:$?A1.jsx(Vy,{className:"text-primary",stroke:1.75}):A1.jsx(eJ,{className:"text-muted-foreground",stroke:1.75})})}),A1.jsxs(r1,{align:"center",className:"flex-col gap-0",children:[A1.jsx("span",{children:"Fast mode"}),A1.jsx("span",{className:"font-normal text-muted-foreground",children:"More usage"})]})]})}function W20({currentEffort:$,effortLevels:Z,fastMode:H,showFastMode:J,onFastModeChange:B,onValueChange:Q}){let z=QR(Z,$),[X,G]=_Z.useState(!1),[U,K]=_Z.useState(z),[F,Y]=_Z.useState(!1),A=Z[X?U:z]??$,N=F20(A),L=(D)=>{if(D)K(z);else Y(!1);G(D)},V=(D)=>{let q=Z[D];if(q&&q!==$)Q(q)};return A1.jsxs(iU,{open:X,onOpenChange:L,children:[A1.jsx(rU,{render:A1.jsx(Ly,{label:N,leadingIcon:H?A1.jsx(eJ,{stroke:1.5}):void 0,"aria-label":`Effort: ${N}`})}),A1.jsxs(aU,{align:"end",side:"top",className:"w-64",children:[A1.jsx(cb,{className:"relative h-5 flex-row items-center",children:A1.jsx(G2,{mode:"popLayout",initial:!1,children:F?A1.jsxs(Y5.div,{className:"flex h-5 w-full items-center justify-between text-sm text-muted-foreground","aria-hidden":"true",variants:Ay,initial:"from",animate:"to",exit:"from",transition:Ny,children:[A1.jsx("span",{children:"Faster"}),A1.jsx("span",{children:"Smarter"})]},"range"):A1.jsxs(Y5.div,{className:"flex h-5 w-full items-center justify-between gap-2",variants:Ay,initial:"from",animate:"to",exit:"from",transition:Ny,children:[A1.jsxs("div",{className:"flex items-center gap-1",children:[A1.jsx("span",{className:"text-muted-foreground",children:"Effort"}),A1.jsx("output",{"aria-live":"polite",children:N})]}),J&&A1.jsx(Dy,{fastMode:H,onChange:B})]},"effort")})}),A1.jsxs("label",{className:"block",children:[A1.jsx("span",{className:"sr-only",children:"Reasoning effort"}),A1.jsx(Fy,{value:[U],min:0,max:Z.length-1,step:1,onPointerDown:(D)=>{if(D.button===0)Y(!0)},onPointerCancel:()=>Y(!1),onValueChange:(D)=>K(Wy(D)),onValueCommitted:(D)=>{Y(!1),V(Wy(D))},className:z0("**: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]:ring-0"),animate:!0,children:A1.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},(D,q)=>A1.jsx("span",{className:z0("size-1 rounded-full",q<=U?"bg-primary-foreground/30":"bg-foreground/30")},q))})})]})]})]})}var qy=_Z.memo(function({sessionId:Z}){let{workspaceId:H,layout:J,setLayout:B}=P5(),{data:Q}=O9(H),z=Q?.models??[],X=z.find((P)=>P.value==="default"),G=Q?GR(z.filter((P)=>P.value!=="default"),Q.provider):[],U=QU(H,Z).data,K=JR(H),F=(Z?U?.model:void 0)??J.selectedModel,Y=(Z?U?.effort:void 0)??J.selectedEffort,W=(Z?U?.fastMode:void 0)??J.selectedFastMode,A=(P)=>{if(Z)K.mutate({sessionId:Z,patch:{model:P}});else B({selectedModel:P})},N=(P)=>{if(Z)K.mutate({sessionId:Z,patch:{effort:P}});else B({selectedEffort:P})},L=(P)=>{if(Z)K.mutate({sessionId:Z,patch:{fastMode:P}});else B({selectedFastMode:P})},V=zU(G,F,X?.resolvedModel);if(!V)return null;let D=V.supportsEffort?V.supportedEffortLevels??[]:[],q=NV(D,Y,V.defaultEffort),j=zR(D)&&q!==void 0,M=XR(V,W);return A1.jsxs("div",{className:"flex min-w-0 items-center gap-1",children:[A1.jsx(Y20,{current:V.value,model:V,models:G,onValueChange:A}),!j&&V.supportsFastMode&&A1.jsx(Dy,{fastMode:M,onChange:L}),j&&A1.jsx(W20,{currentEffort:q,effortLevels:D,fastMode:M,showFastMode:V.supportsFastMode===!0,onFastModeChange:L,onValueChange:N},V.value)]})});var F1=_(r(),1);function Py({composerRef:$,onSend:Z,onStop:H,processing:J,sessionId:B,modelSessionId:Q,availability:z,annotation:X,onRemoveDrawing:G,allowFiles:U=!0,placeholder:K,draft:F}){let Y=jZ.useRef(null),W=F5(),A=S5((w)=>w.composerDrafts[W]??""),N=S5((w)=>F?(w.viewBuilderDrafts??{})[F.id]:void 0),L=F?N??F.initialValue:A,V=jZ.useRef(L);V.current=L;let D=w4((w)=>w.attachments[z2(W,B)]??A20),[q,j]=jZ.useState(!1),M=D.some((w)=>w.status==="uploading"),P=D.some((w)=>w.status==="ready"||w.status==="draft"),T=L.trim().length>0||P,C=cJ(T,M,z),k=(w)=>{if(V.current=w,F)F.onChange(w);else S5.getState().setComposerDraft(W,w)},E=(w)=>{if(U)Ak({workspaceId:W,sessionId:B},w)},h=jZ.useRef(!1),x=(w)=>{if(w.kind==="drawing"&&G){G(w.localId);return}h1.getState().removeAttachment(W,B,w.localId)},R=async()=>{if(!C||h.current)return;h.current=!0;try{if(await X?.finish(),await Z(V.current),!F)V.current="",S5.getState().setComposerDraft(W,"")}finally{h.current=!1}};return F1.jsxs(Lk,{composerRef:$,onSubmit:(w)=>{w.preventDefault(),R()},onDragOver:(w)=>{if(!w.dataTransfer.types.includes("Files"))return;if(w.preventDefault(),U)j(!0)},onDragLeave:(w)=>{if(!U)return;if(w.currentTarget.contains(w.relatedTarget))return;j(!1)},onDrop:(w)=>{if(!w.dataTransfer.types.includes("Files"))return;w.preventDefault(),j(!1),E(Array.from(w.dataTransfer.files))},className:z0(q&&"ring-2 ring-ring/60"),children:[D.length>0&&F1.jsx("div",{className:"flex flex-wrap gap-2 px-1 pt-1 pb-1",children:D.map((w)=>F1.jsx(N20,{attachment:w,onRemove:()=>x(w)},w.localId))}),F1.jsx(Dk,{textareaRef:$,id:"chat-input",name:"message",value:L,onChange:(w)=>k(w.target.value),onKeyDown:(w)=>{if(w.key==="Enter"&&!w.shiftKey)w.preventDefault(),R()},onPaste:(w)=>{let S=Array.from(w.clipboardData?.files??[]);if(S.length===0)return;w.preventDefault(),E(S)},placeholder:J?"Queue a follow-up":K??"Do anything",rows:1}),F1.jsxs(qk,{children:[U&&F1.jsx("input",{ref:Y,type:"file",multiple:!0,hidden:!0,onChange:(w)=>{E(Array.from(w.target.files??[])),w.target.value=""}}),F1.jsxs("div",{className:"mr-auto flex shrink-0 items-center gap-0.5",children:[U&&F1.jsxs(l1,{children:[F1.jsx(i1,{render:F1.jsx(E0,{type:"button",variant:"ghost",size:"icon",onClick:()=>Y.current?.click(),"aria-label":"Attach files",children:F1.jsx(BK,{stroke:1.6,className:"size-4.5!"})})}),F1.jsx(r1,{children:"Attach files"})]}),X&&F1.jsxs(l1,{children:[F1.jsx(i1,{render:F1.jsx(E0,{type:"button",variant:"ghost",size:"icon",onClick:X.onToggle,className:z0(X.active&&"bg-accent"),"aria-label":"Draw annotation","aria-pressed":X.active,children:F1.jsx($B,{stroke:1.5})})}),F1.jsx(r1,{children:"Draw annotation"})]})]}),F1.jsx(qy,{sessionId:Q}),J?F1.jsxs(l1,{children:[F1.jsx(i1,{render:F1.jsx(E0,{type:"button",size:"icon",onClick:H,"aria-label":"Stop agent",children:F1.jsx(My,{})})}),F1.jsx(r1,{children:"Stop answering"})]}):F1.jsx(Mk,{label:"Send message",hasContent:T,busy:M,availability:z})]})]})}var A20=[];function N20({attachment:$,onRemove:Z}){if($.kind==="drawing")return F1.jsx(V20,{attachment:$,onRemove:Z});let{name:H,previewUrl:J,status:B,error:Q}=$,z=!!J;return F1.jsxs("div",{className:z0("group relative flex items-center gap-2 overflow-hidden rounded-lg bg-accent text-accent-foreground ring-1 ring-border",z?"size-14":"h-10 max-w-52 pr-2 pl-2",B==="error"&&"border-destructive/50"),title:Q??H,children:[z?F1.jsx("img",{src:J,alt:H,className:"size-full object-cover"}):F1.jsxs(F1.Fragment,{children:[F1.jsx(OZ,{size:16,stroke:1.75,className:"shrink-0 text-muted-foreground"}),F1.jsx("span",{className:"truncate text-xs",children:H})]}),B==="uploading"&&F1.jsx("div",{className:"absolute inset-0 flex items-center justify-center bg-background/70",children:F1.jsx(y5,{size:16,stroke:1.75,className:"animate-spin text-muted-foreground"})}),B==="error"&&F1.jsx("div",{className:"absolute inset-0 flex items-center justify-center bg-destructive/10 text-[10px] text-destructive",children:"Failed"}),F1.jsx(E0,{type:"button",variant:"ghost",size:"icon-sm",onClick:Z,"aria-label":`Remove ${H}`,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:F1.jsx(b5,{stroke:1.75})})]})}function V20({attachment:$,onRemove:Z}){let{previewUrl:H,purpose:J}=$,B=J==="sketch"?"Sketch":"Annotation";return F1.jsxs(tk,{children:[F1.jsxs(ek,{render:F1.jsx("div",{tabIndex:0,className:"group flex h-7 cursor-default items-center rounded-md bg-background pr-2 pl-0.5 text-sm whitespace-nowrap text-foreground ring-1 ring-border outline-none focus-visible:ring-3 focus-visible:ring-ring/50"}),children:[F1.jsxs(E0,{type:"button",variant:"ghost",size:"icon-sm",onClick:Z,"aria-label":`Remove ${B.toLowerCase()}`,className:"size-6 shrink-0 hover:bg-transparent hover:text-current",children:[F1.jsx($B,{stroke:1.75,className:"group-focus-within:hidden group-hover:hidden"}),F1.jsx(b5,{stroke:1.75,className:"hidden group-focus-within:block group-hover:block"})]}),F1.jsx("span",{children:B})]}),H&&F1.jsx($R,{side:"top",align:"start",className:"w-60 max-w-[calc(100vw-2rem)] rounded-xl",children:F1.jsx("img",{src:H,alt:`${B} preview`,className:"max-h-72 w-full rounded-md object-contain"})})]})}var R7=_(r(),1);function pV({className:$,prompt:Z,disabled:H=!1,onSelect:J}){let B=Z.icon;return R7.jsxs(E0,{type:"button",size:"sm",disabled:H,onClick:()=>J(Z),className:z0("h-auto items-start justify-start gap-2 rounded-lg p-2 px-3 text-left leading-snug whitespace-normal",$),children:[R7.jsx(B,{stroke:2,"aria-hidden":!0,className:"mt-0.5"}),R7.jsx("span",{children:Z.label})]})}function _y({prompts:$,disabled:Z=!1,onSelect:H}){return R7.jsx("div",{className:"row-gap-2 grid w-full grid-cols-1 gap-x-3 gap-y-2 @md:grid-cols-3",children:$.map((J,B)=>{return R7.jsx(pV,{prompt:J,disabled:Z,onSelect:H,className:z0("h-full w-fit @md:w-full",B===0&&"@md:translate-y-3 @md:rotate-3 @md:hover:translate-y-2.5",B===1&&"@md:-rotate-1",B===2&&"@md:translate-y-3 @md:-rotate-4 @md:hover:translate-y-2.5")},J.prompt)})})}var z5=_(r(),1),cV="Keep the final reply brief and user-facing. Do not include file or storage links, file paths, or bundle, test, and runtime-log summaries.",L20=[{label:"Check 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.",cV],icon:Oy},{label:"Track my finances",prompt:"Build me a personal finance view for tracking income, expenses, monthly budgets, spending trends, and savings, with an agent action that can add sample transactions",context:["Build this onboarding example immediately without asking follow-up questions, and don't use external services or bank connections.","Create a responsive View with a month selector, income, spending, and savings summaries, an income-versus-spending trend, category breakdowns, budget progress, and recent transactions.","Support adding, editing, and deleting income and expense transactions, categories, and monthly category budgets.","Persist transactions, categories, and budgets in a workspace-local SQLite database accessed through server functions. Store monetary amounts as integer cents and seed realistic sample data only when the database is empty.","Add an “Add with agent” action that imports `sendChatMessage` from `moi` and sends a concise request for the agent to generate and insert a realistic batch of sample transactions into the same database.","Provide a small documented workspace script the agent can use to validate and append transactions safely, then refresh the View data after the agent updates the database.","Include loading, empty, and error states, then bundle the View and smoke-test its SQLite persistence and transaction mutations before finishing.",cV],icon:Ty},{label:"Build a playful 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.",cV],icon:QK}],D20={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:jy};function Cy({isViewBuilderDraft:$,hasSentMessageFromMoi:Z,isWorkspacePendingAnalysis:H}){if($)return"view-builder";if(!Z)return"welcome";if(H)return"explore-workspace";return"empty"}function wy({agent:$,kind:Z,hasWorkspaceApplets:H,disabled:J=!1,onSelectPrompt:B,onNavigate:Q}){switch(Z){case"view-builder":return z5.jsx(q20,{agent:$});case"welcome":return z5.jsx(M20,{agent:$,disabled:J,showExamples:!H,onSelectPrompt:B,onNavigate:Q});case"explore-workspace":return z5.jsx(P20,{agent:$,disabled:J,onSelectPrompt:B});case"empty":return z5.jsx(_20,{agent:$})}}function zK({agent:$,children:Z,className:H}){return z5.jsxs("div",{className:z0("flex flex-1 flex-col items-center justify-center self-center",H),children:[z5.jsx(j9,{preset:$,color:"secondary",expression:"idle",className:"mb-2",animated:!0}),Z]})}function q20({agent:$}){return z5.jsx(zK,{agent:$,className:"text-center text-muted-foreground",children:z5.jsx("p",{className:"mx-auto max-w-xs px-8 text-sm",children:"Describe the content, data, and key actions you need in the view"})})}function M20({agent:$,disabled:Z=!1,showExamples:H=!0,onSelectPrompt:J,onNavigate:B}){return z5.jsx(zK,{agent:$,className:"@container w-full max-w-md min-w-0",children:z5.jsxs("div",{className:"mt-2 flex flex-col gap-4",children:[z5.jsxs("div",{className:"prose prose-sm min-w-0 wrap-anywhere prose-inherit",children:[z5.jsx("p",{children:"moi is the visual workspace for you and your agent. It grows and adapts to the work you're doing."}),z5.jsxs("p",{children:["Ask agent to build"," ",z5.jsx(dV,{Icon:HB,destination:"widgets",onNavigate:B,children:"Widgets"})," ","that surface information and quick actions, or entire"," ",z5.jsx(dV,{Icon:ZB,destination:"views",onNavigate:B,children:"Views"})," ","for more complex tools. Use"," ",z5.jsx(dV,{Icon:JB,destination:"scratchpad",onNavigate:B,children:"Scratchpad"})," ","for exploring and shaping ideas with your agent."]}),H&&z5.jsx("p",{children:"Try an example:"})]}),H&&z5.jsx(_y,{prompts:L20,disabled:Z,onSelect:J})]})})}function P20({agent:$,disabled:Z=!1,onSelectPrompt:H}){return z5.jsx(zK,{agent:$,children:z5.jsxs("div",{className:"flex flex-col items-center gap-4",children:[z5.jsx("div",{className:"prose prose-sm max-w-xs min-w-0 text-center wrap-anywhere prose-inherit",children:z5.jsx("p",{children:"Your agent can explore this workspace and suggest useful widgets and views based on what’s already here"})}),z5.jsx(pV,{prompt:D20,disabled:Z,onSelect:H})]})})}function _20({agent:$}){return z5.jsx(zK,{agent:$,className:"text-center text-muted-foreground",children:z5.jsx("p",{className:"mx-auto max-w-sm px-8 text-sm",children:"Chat with your agent, create widgets and views, and manage your workspace context from here"})})}function dV({Icon:$,children:Z,destination:H,onNavigate:J}){return z5.jsxs("button",{type:"button","data-welcome-destination":H,onClick:()=>J(H),className:"-mx-0.5 inline-flex cursor-pointer items-center gap-0.5 rounded-xs px-0.5 align-bottom font-medium text-foreground hover:bg-accent focus-visible:bg-accent focus-visible:outline-2 focus-visible:outline-offset-1 focus-visible:outline-ring",children:[z5.jsx($,{size:16,stroke:1.75,"aria-hidden":!0}),Z]})}var BB=_(p(),1);var R1=_(r(),1);function ky({label:$}){return R1.jsx("div",{className:"flex h-7 items-center px-2.5 text-sm font-medium",children:$})}function j20($){if($.flavor==="cron"||$.flavor==="subagent")return $.flavor;let Z=$.origin?.provider.trim().toLowerCase();return Z?Z:null}function O20({active:$,canArchive:Z,confirmingArchive:H,onArchive:J,onRequestArchive:B,onSelect:Q,session:z,workspaceId:X}){let G=BB.useRef(!1),[U,K]=BB.useState(!1),F=w4((N)=>nH(N.activity,X,z.sessionId)),Y=j20(z);function W(){B(z.sessionId)}async function A(){if(G.current)return;G.current=!0,K(!0);try{await J(z.sessionId)}catch{H8.add({title:"Couldn’t archive chat",type:"error"})}finally{G.current=!1,K(!1)}}return R1.jsxs("div",{className:"group/chat relative",children:[R1.jsx(rJ,{className:z0("font-medium group-hover/chat:bg-accent group-hover/chat:text-accent-foreground",$&&"bg-accent text-accent-foreground"),onClick:()=>Q(z.sessionId),children:R1.jsx("div",{className:z0("flex min-w-0 flex-1 overflow-hidden",(F||U)&&"mr-4 mask-r-from-[calc(100%-16px)]",Z&&!H&&"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)]",H&&"mr-14 mask-r-from-[calc(100%-16px)]"),children:R1.jsxs("span",{className:z0("flex min-w-0 items-baseline gap-1.5",(F||U)&&"-mr-4",H?"-mr-14":Z&&"group-focus-within/chat:-mr-4 group-hover/chat:-mr-4 [@media(hover:none)]:-mr-4"),children:[R1.jsx("span",{className:"min-w-0 truncate",children:z.summary}),Y&&R1.jsx("span",{className:"shrink-0 text-xs text-muted-foreground",children:Y})]})})}),F&&R1.jsx(m2,{className:z0("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",(H||U)&&"hidden")}),Z&&R1.jsx("div",{className:z0("absolute top-1/2 right-0 flex -translate-y-1/2 items-center opacity-100 transition-none",!H&&"group-focus-within/chat:opacity-100 group-hover/chat:opacity-100 [@media(hover:hover)]:opacity-0",U&&"opacity-100!"),children:H?R1.jsx(E0,{type:"button",variant:"secondary",size:"sm","aria-label":`Confirm archive ${z.summary}`,tabIndex:-1,className:"mr-1 h-5 rounded-sm px-1.5 text-xs hover:bg-accent",disabled:U,onClick:A,onPointerDown:(N)=>N.stopPropagation(),children:"Confirm"}):R1.jsxs(l1,{children:[R1.jsx(i1,{render:R1.jsx(E0,{type:"button",variant:"ghost",size:"icon-sm","aria-label":`Archive ${z.summary}`,tabIndex:-1,className:"text-muted-foreground hover:bg-transparent hover:text-foreground",disabled:U,onClick:W,onPointerDown:(N)=>N.stopPropagation(),children:R1.jsx(Sy,{stroke:1.75})})}),R1.jsx(r1,{side:"right",children:"Archive chat"})]})})]})}function T20($){return`${$.getFullYear()}-${$.getMonth()}-${$.getDate()}`}function Ey($){return Date.UTC($.getFullYear(),$.getMonth(),$.getDate())/86400000}function C20($,Z){let H=Ey(Z)-Ey($);if(H===0)return"Today";if(H===1)return"Yesterday";if(H>=2&&H<=5)return`${H} days ago`;return $.toLocaleDateString([],{month:"short",day:"numeric",...$.getFullYear()===Z.getFullYear()?{}:{year:"numeric"}})}function w20($,Z=new Date){let H=new Map;for(let J of $.slice().sort((B,Q)=>Q.lastModified-B.lastModified)){let B=new Date(J.lastModified),Q=T20(B),z=H.get(Q);if(z){z.sessions.push(J);continue}H.set(Q,{key:Q,label:C20(B,Z),sessions:[J]})}return[...H.values()]}function Ry({isViewBuilder:$=!1}){if($)return R1.jsx(ky,{label:"Build a new view"});return R1.jsx(E20,{})}function E20(){let $=F5(),[Z,H]=I3(),J=Z??null,[B,Q]=BB.useState(null),{data:z=[]}=BU($),X=O9($).data?.supportsArchiving===!0,G=ZR($),U=w4((N)=>KT(N.activity,$,J));if(z.length===0)return R1.jsx(ky,{label:"New chat"});let F=z.find((N)=>N.sessionId===J)?.summary??"New chat",Y=w20(z);function W(N){if(!N)Q(null)}async function A(N){Q(null),await G.mutateAsync(N);let L=h1.getState();if(L.clearAttachments($,N),L.clearPreviewsForSession($,N),J===N)H(null)}return R1.jsxs(YZ,{onOpenChange:W,children:[R1.jsx(WZ,{render:R1.jsxs(E0,{className:"group",variant:"ghost",size:"sm",children:[R1.jsx("span",{className:"max-w-64 truncate",children:F}),U?R1.jsx(m2,{className:"size-4!",stroke:2}):R1.jsx(XK,{className:"text-muted-foreground group-hover:text-foreground",stroke:1.75})]})}),R1.jsxs(AZ,{align:"start",className:"flex max-h-100 w-max max-w-72 min-w-40 flex-col overflow-hidden",children:[R1.jsxs(rJ,{className:"shrink-0 gap-1 font-medium text-muted-foreground! **:text-muted-foreground!",onClick:()=>H(null),children:[R1.jsx(Iy,{size:16,stroke:1.75}),"New chat"]}),Y.length>0&&R1.jsxs(R1.Fragment,{children:[R1.jsx(Yb,{className:"shrink-0"}),R1.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:Y.map((N)=>R1.jsxs(NZ,{children:[R1.jsx(fU,{children:N.label}),N.sessions.map((L)=>R1.jsx(O20,{session:L,active:J===L.sessionId,canArchive:X,confirmingArchive:B===L.sessionId,onSelect:H,onArchive:A,onRequestArchive:Q,workspaceId:$},L.sessionId))]},N.key))})]})]})]})}var Zu=_(p(),1);function t1(){}function GK(){}function by($,Z){let H=Z||{};return($[$.length-1]===""?[...$,""]:$).join((H.padRight?" ":"")+","+(H.padLeft===!1?"":" ")).trim()}var S20=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,I20=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,k20={};function UK($,Z){return((Z||k20).jsx?I20:S20).test($)}var R20=/[ \t\n\f\r]/g;function lV($){return typeof $==="object"?$.type==="text"?yy($.value):!1:yy($)}function yy($){return $.replace(R20,"")===""}class Y6{constructor($,Z,H){if(this.normal=Z,this.property=$,H)this.space=H}}Y6.prototype.normal={};Y6.prototype.property={};Y6.prototype.space=void 0;function iV($,Z){let H={},J={};for(let B of $)Object.assign(H,B.property),Object.assign(J,B.normal);return new Y6(H,J,Z)}function QB($){return $.toLowerCase()}class S4{constructor($,Z){this.attribute=Z,this.property=$}}S4.prototype.attribute="";S4.prototype.booleanish=!1;S4.prototype.boolean=!1;S4.prototype.commaOrSpaceSeparated=!1;S4.prototype.commaSeparated=!1;S4.prototype.defined=!1;S4.prototype.mustUseProperty=!1;S4.prototype.number=!1;S4.prototype.overloadedBoolean=!1;S4.prototype.property="";S4.prototype.spaceSeparated=!1;S4.prototype.space=void 0;var zB={};g5(zB,{spaceSeparated:()=>X5,overloadedBoolean:()=>KK,number:()=>w0,commaSeparated:()=>W6,commaOrSpaceSeparated:()=>S2,booleanish:()=>p5,boolean:()=>L1});var b20=0,L1=b7(),p5=b7(),KK=b7(),w0=b7(),X5=b7(),W6=b7(),S2=b7();function b7(){return 2**++b20}var rV=Object.keys(zB);class TZ extends S4{constructor($,Z,H,J){let B=-1;super($,Z);if(hy(this,"space",J),typeof H==="number")while(++B<rV.length){let Q=rV[B];hy(this,rV[B],(H&zB[Q])===zB[Q])}}}TZ.prototype.defined=!0;function hy($,Z,H){if(H)$[Z]=H}function A8($){let Z={},H={};for(let[J,B]of Object.entries($.properties)){let Q=new TZ(J,$.transform($.attributes||{},J),B,$.space);if($.mustUseProperty&&$.mustUseProperty.includes(J))Q.mustUseProperty=!0;Z[J]=Q,H[QB(J)]=J,H[QB(Q.attribute)]=J}return new Y6(Z,H,$.space)}var aV=A8({properties:{ariaActiveDescendant:null,ariaAtomic:p5,ariaAutoComplete:null,ariaBusy:p5,ariaChecked:p5,ariaColCount:w0,ariaColIndex:w0,ariaColSpan:w0,ariaControls:X5,ariaCurrent:null,ariaDescribedBy:X5,ariaDetails:null,ariaDisabled:p5,ariaDropEffect:X5,ariaErrorMessage:null,ariaExpanded:p5,ariaFlowTo:X5,ariaGrabbed:p5,ariaHasPopup:null,ariaHidden:p5,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:X5,ariaLevel:w0,ariaLive:null,ariaModal:p5,ariaMultiLine:p5,ariaMultiSelectable:p5,ariaOrientation:null,ariaOwns:X5,ariaPlaceholder:null,ariaPosInSet:w0,ariaPressed:p5,ariaReadOnly:p5,ariaRelevant:null,ariaRequired:p5,ariaRoleDescription:X5,ariaRowCount:w0,ariaRowIndex:w0,ariaRowSpan:w0,ariaSelected:p5,ariaSetSize:w0,ariaSort:null,ariaValueMax:w0,ariaValueMin:w0,ariaValueNow:w0,ariaValueText:null,role:null},transform($,Z){return Z==="role"?Z:"aria-"+Z.slice(4).toLowerCase()}});function FK($,Z){return Z in $?$[Z]:Z}function YK($,Z){return FK($,Z.toLowerCase())}var xy=A8({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:W6,acceptCharset:X5,accessKey:X5,action:null,allow:null,allowFullScreen:L1,allowPaymentRequest:L1,allowUserMedia:L1,alt:null,as:null,async:L1,autoCapitalize:null,autoComplete:X5,autoFocus:L1,autoPlay:L1,blocking:X5,capture:null,charSet:null,checked:L1,cite:null,className:X5,cols:w0,colSpan:null,content:null,contentEditable:p5,controls:L1,controlsList:X5,coords:w0|W6,crossOrigin:null,data:null,dateTime:null,decoding:null,default:L1,defer:L1,dir:null,dirName:null,disabled:L1,download:KK,draggable:p5,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:L1,formTarget:null,headers:X5,height:w0,hidden:KK,high:w0,href:null,hrefLang:null,htmlFor:X5,httpEquiv:X5,id:null,imageSizes:null,imageSrcSet:null,inert:L1,inputMode:null,integrity:null,is:null,isMap:L1,itemId:null,itemProp:X5,itemRef:X5,itemScope:L1,itemType:X5,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:L1,low:w0,manifest:null,max:null,maxLength:w0,media:null,method:null,min:null,minLength:w0,multiple:L1,muted:L1,name:null,nonce:null,noModule:L1,noValidate:L1,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:L1,optimum:w0,pattern:null,ping:X5,placeholder:null,playsInline:L1,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:L1,referrerPolicy:null,rel:X5,required:L1,reversed:L1,rows:w0,rowSpan:w0,sandbox:X5,scope:null,scoped:L1,seamless:L1,selected:L1,shadowRootClonable:L1,shadowRootDelegatesFocus:L1,shadowRootMode:null,shape:null,size:w0,sizes:null,slot:null,span:w0,spellCheck:p5,src:null,srcDoc:null,srcLang:null,srcSet:null,start:w0,step:null,style:null,tabIndex:w0,target:null,title:null,translate:null,type:null,typeMustMatch:L1,useMap:null,value:p5,width:w0,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:X5,axis:null,background:null,bgColor:null,border:w0,borderColor:null,bottomMargin:w0,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:L1,declare:L1,event:null,face:null,frame:null,frameBorder:null,hSpace:w0,leftMargin:w0,link:null,longDesc:null,lowSrc:null,marginHeight:w0,marginWidth:w0,noResize:L1,noHref:L1,noShade:L1,noWrap:L1,object:null,profile:null,prompt:null,rev:null,rightMargin:w0,rules:null,scheme:null,scrolling:p5,standby:null,summary:null,text:null,topMargin:w0,valueType:null,version:null,vAlign:null,vLink:null,vSpace:w0,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:L1,disableRemotePlayback:L1,prefix:null,property:null,results:w0,security:null,unselectable:null},space:"html",transform:YK});var vy=A8({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:S2,accentHeight:w0,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:w0,amplitude:w0,arabicForm:null,ascent:w0,attributeName:null,attributeType:null,azimuth:w0,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:w0,by:null,calcMode:null,capHeight:w0,className:X5,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:w0,diffuseConstant:w0,direction:null,display:null,dur:null,divisor:w0,dominantBaseline:null,download:L1,dx:null,dy:null,edgeMode:null,editable:null,elevation:w0,enableBackground:null,end:null,event:null,exponent:w0,externalResourcesRequired:null,fill:null,fillOpacity:w0,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:w0,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:w0,horizOriginX:w0,horizOriginY:w0,id:null,ideographic:w0,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:w0,k:w0,k1:w0,k2:w0,k3:w0,k4:w0,kernelMatrix:S2,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:w0,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:w0,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:w0,overlineThickness:w0,paintOrder:null,panose1:null,path:null,pathLength:w0,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:X5,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:w0,pointsAtY:w0,pointsAtZ:w0,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:S2,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:S2,rev:S2,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:S2,requiredFeatures:S2,requiredFonts:S2,requiredFormats:S2,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:w0,specularExponent:w0,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:w0,strikethroughThickness:w0,string:null,stroke:null,strokeDashArray:S2,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:w0,strokeOpacity:w0,strokeWidth:null,style:null,surfaceScale:w0,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:S2,tabIndex:w0,tableValues:null,target:null,targetX:w0,targetY:w0,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:S2,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:w0,underlineThickness:w0,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:w0,values:null,vAlphabetic:w0,vMathematical:w0,vectorEffect:null,vHanging:w0,vIdeographic:w0,version:null,vertAdvY:w0,vertOriginX:w0,vertOriginY:w0,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:w0,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:FK});var nV=A8({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 oV=A8({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:YK});var sV=A8({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform($,Z){return"xml:"+Z.slice(3).toLowerCase()}});var tV={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 y20=/[A-Z]/g,gy=/-[a-z]/g,h20=/^data[-\w.:]+$/i;function eV($,Z){let H=QB(Z),J=Z,B=S4;if(H in $.normal)return $.property[$.normal[H]];if(H.length>4&&H.slice(0,4)==="data"&&h20.test(Z)){if(Z.charAt(4)==="-"){let Q=Z.slice(5).replace(gy,v20);J="data"+Q.charAt(0).toUpperCase()+Q.slice(1)}else{let Q=Z.slice(4);if(!gy.test(Q)){let z=Q.replace(y20,x20);if(z.charAt(0)!=="-")z="-"+z;Z="data"+z}}B=TZ}return new B(J,Z)}function x20($){return"-"+$.toLowerCase()}function v20($){return $.charAt(1).toUpperCase()}var fy=iV([aV,xy,nV,oV,sV],"html"),WK=iV([aV,vy,nV,oV,sV],"svg");function my($){return $.join(" ").trim()}var Jh=_(ey(),1);var AK=$h("end"),CZ=$h("start");function $h($){return Z;function Z(H){let J=H&&H.position&&H.position[$]||{};if(typeof J.line==="number"&&J.line>0&&typeof J.column==="number"&&J.column>0)return{line:J.line,column:J.column,offset:typeof J.offset==="number"&&J.offset>-1?J.offset:void 0}}}function HL($){let Z=CZ($),H=AK($);if(Z&&H)return{start:Z,end:H}}function A6($){if(!$||typeof $!=="object")return"";if("position"in $||"type"in $)return Zh($.position);if("start"in $||"end"in $)return Zh($);if("line"in $||"column"in $)return JL($);return""}function JL($){return Hh($&&$.line)+":"+Hh($&&$.column)}function Zh($){return JL($&&$.start)+"-"+JL($&&$.end)}function Hh($){return $&&typeof $==="number"?$:1}class Z4 extends Error{constructor($,Z,H){super();if(typeof Z==="string")H=Z,Z=void 0;let J="",B={},Q=!1;if(Z)if("line"in Z&&"column"in Z)B={place:Z};else if("start"in Z&&"end"in Z)B={place:Z};else if("type"in Z)B={ancestors:[Z],place:Z.position};else B={...Z};if(typeof $==="string")J=$;else if(!B.cause&&$)Q=!0,J=$.message,B.cause=$;if(!B.ruleId&&!B.source&&typeof H==="string"){let X=H.indexOf(":");if(X===-1)B.ruleId=H;else B.source=H.slice(0,X),B.ruleId=H.slice(X+1)}if(!B.place&&B.ancestors&&B.ancestors){let X=B.ancestors[B.ancestors.length-1];if(X)B.place=X.position}let z=B.place&&"start"in B.place?B.place.start:B.place;this.ancestors=B.ancestors||void 0,this.cause=B.cause||void 0,this.column=z?z.column:void 0,this.fatal=void 0,this.file="",this.message=J,this.line=z?z.line:void 0,this.name=A6(B.place)||"1:1",this.place=B.place||void 0,this.reason=this.message,this.ruleId=B.ruleId||void 0,this.source=B.source||void 0,this.stack=Q&&B.cause&&typeof B.cause.stack==="string"?B.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}Z4.prototype.file="";Z4.prototype.name="";Z4.prototype.reason="";Z4.prototype.message="";Z4.prototype.stack="";Z4.prototype.column=void 0;Z4.prototype.line=void 0;Z4.prototype.ancestors=void 0;Z4.prototype.cause=void 0;Z4.prototype.fatal=void 0;Z4.prototype.place=void 0;Z4.prototype.ruleId=void 0;Z4.prototype.source=void 0;var BL={}.hasOwnProperty,U80=new Map,K80=/[A-Z]/g,F80=new Set(["table","tbody","thead","tfoot","tr"]),Y80=new Set(["td","th"]),Bh="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function QL($,Z){if(!Z||Z.Fragment===void 0)throw TypeError("Expected `Fragment` in options");let H=Z.filePath||void 0,J;if(Z.development){if(typeof Z.jsxDEV!=="function")throw TypeError("Expected `jsxDEV` in options when `development: true`");J=M80(H,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");J=q80(H,Z.jsx,Z.jsxs)}let B={Fragment:Z.Fragment,ancestors:[],components:Z.components||{},create:J,elementAttributeNameCase:Z.elementAttributeNameCase||"react",evaluater:Z.createEvaluater?Z.createEvaluater():void 0,filePath:H,ignoreInvalidStyle:Z.ignoreInvalidStyle||!1,passKeys:Z.passKeys!==!1,passNode:Z.passNode||!1,schema:Z.space==="svg"?WK:fy,stylePropertyNameCase:Z.stylePropertyNameCase||"dom",tableCellAlignToStyle:Z.tableCellAlignToStyle!==!1},Q=Qh(B,$,void 0);if(Q&&typeof Q!=="string")return Q;return B.create($,B.Fragment,{children:Q||void 0},void 0)}function Qh($,Z,H){if(Z.type==="element")return W80($,Z,H);if(Z.type==="mdxFlowExpression"||Z.type==="mdxTextExpression")return A80($,Z);if(Z.type==="mdxJsxFlowElement"||Z.type==="mdxJsxTextElement")return V80($,Z,H);if(Z.type==="mdxjsEsm")return N80($,Z);if(Z.type==="root")return L80($,Z,H);if(Z.type==="text")return D80($,Z)}function W80($,Z,H){let J=$.schema,B=J;if(Z.tagName.toLowerCase()==="svg"&&J.space==="html")B=WK,$.schema=B;$.ancestors.push(Z);let Q=Xh($,Z.tagName,!1),z=P80($,Z),X=XL($,Z);if(F80.has(Z.tagName))X=X.filter(function(G){return typeof G==="string"?!lV(G):!0});return zh($,z,Q,Z),zL(z,X),$.ancestors.pop(),$.schema=J,$.create(Z,Q,z,H)}function A80($,Z){if(Z.data&&Z.data.estree&&$.evaluater){let J=Z.data.estree.body[0];return t1(J.type==="ExpressionStatement"),$.evaluater.evaluateExpression(J.expression)}GB($,Z.position)}function N80($,Z){if(Z.data&&Z.data.estree&&$.evaluater)return $.evaluater.evaluateProgram(Z.data.estree);GB($,Z.position)}function V80($,Z,H){let J=$.schema,B=J;if(Z.name==="svg"&&J.space==="html")B=WK,$.schema=B;$.ancestors.push(Z);let Q=Z.name===null?$.Fragment:Xh($,Z.name,!0),z=_80($,Z),X=XL($,Z);return zh($,z,Q,Z),zL(z,X),$.ancestors.pop(),$.schema=J,$.create(Z,Q,z,H)}function L80($,Z,H){let J={};return zL(J,XL($,Z)),$.create(Z,$.Fragment,J,H)}function D80($,Z){return Z.value}function zh($,Z,H,J){if(typeof H!=="string"&&H!==$.Fragment&&$.passNode)Z.node=J}function zL($,Z){if(Z.length>0){let H=Z.length>1?Z:Z[0];if(H)$.children=H}}function q80($,Z,H){return J;function J(B,Q,z,X){let U=Array.isArray(z.children)?H:Z;return X?U(Q,z,X):U(Q,z)}}function M80($,Z){return H;function H(J,B,Q,z){let X=Array.isArray(Q.children),G=CZ(J);return Z(B,Q,z,X,{columnNumber:G?G.column-1:void 0,fileName:$,lineNumber:G?G.line:void 0},void 0)}}function P80($,Z){let H={},J,B;for(B in Z.properties)if(B!=="children"&&BL.call(Z.properties,B)){let Q=j80($,B,Z.properties[B]);if(Q){let[z,X]=Q;if($.tableCellAlignToStyle&&z==="align"&&typeof X==="string"&&Y80.has(Z.tagName))J=X;else H[z]=X}}if(J){let Q=H.style||(H.style={});Q[$.stylePropertyNameCase==="css"?"text-align":"textAlign"]=J}return H}function _80($,Z){let H={};for(let J of Z.attributes)if(J.type==="mdxJsxExpressionAttribute")if(J.data&&J.data.estree&&$.evaluater){let Q=J.data.estree.body[0];t1(Q.type==="ExpressionStatement");let z=Q.expression;t1(z.type==="ObjectExpression");let X=z.properties[0];t1(X.type==="SpreadElement"),Object.assign(H,$.evaluater.evaluateExpression(X.argument))}else GB($,Z.position);else{let B=J.name,Q;if(J.value&&typeof J.value==="object")if(J.value.data&&J.value.data.estree&&$.evaluater){let X=J.value.data.estree.body[0];t1(X.type==="ExpressionStatement"),Q=$.evaluater.evaluateExpression(X.expression)}else GB($,Z.position);else Q=J.value===null?!0:J.value;H[B]=Q}return H}function XL($,Z){let H=[],J=-1,B=$.passKeys?new Map:U80;while(++J<Z.children.length){let Q=Z.children[J],z;if($.passKeys){let G=Q.type==="element"?Q.tagName:Q.type==="mdxJsxFlowElement"||Q.type==="mdxJsxTextElement"?Q.name:void 0;if(G){let U=B.get(G)||0;z=G+"-"+U,B.set(G,U+1)}}let X=Qh($,Q,z);if(X!==void 0)H.push(X)}return H}function j80($,Z,H){let J=eV($.schema,Z);if(H===null||H===void 0||typeof H==="number"&&Number.isNaN(H))return;if(Array.isArray(H))H=J.commaSeparated?by(H):my(H);if(J.property==="style"){let B=typeof H==="object"?H:O80($,String(H));if($.stylePropertyNameCase==="css")B=T80(B);return["style",B]}return[$.elementAttributeNameCase==="react"&&J.space?tV[J.property]||J.property:J.attribute,H]}function O80($,Z){try{return Jh.default(Z,{reactCompat:!0})}catch(H){if($.ignoreInvalidStyle)return{};let J=H,B=new Z4("Cannot parse `style` attribute",{ancestors:$.ancestors,cause:J,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw B.file=$.filePath||void 0,B.url=Bh+"#cannot-parse-style-attribute",B}}function Xh($,Z,H){let J;if(!H)J={type:"Literal",value:Z};else if(Z.includes(".")){let B=Z.split("."),Q=-1,z;while(++Q<B.length){let X=UK(B[Q])?{type:"Identifier",name:B[Q]}:{type:"Literal",value:B[Q]};z=z?{type:"MemberExpression",object:z,property:X,computed:Boolean(Q&&X.type==="Literal"),optional:!1}:X}t1(z,"always a result"),J=z}else J=UK(Z)&&!/^[a-z]/.test(Z)?{type:"Identifier",name:Z}:{type:"Literal",value:Z};if(J.type==="Literal"){let B=J.value;return BL.call($.components,B)?$.components[B]:B}if($.evaluater)return $.evaluater.evaluateExpression(J);GB($)}function GB($,Z){let H=new Z4("Cannot handle MDX estrees without `createEvaluater`",{ancestors:$.ancestors,place:Z,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw H.file=$.filePath||void 0,H.url=Bh+"#cannot-handle-mdx-estrees-without-createevaluater",H}function T80($){let Z={},H;for(H in $)if(BL.call($,H))Z[C80(H)]=$[H];return Z}function C80($){let Z=$.replace(K80,w80);if(Z.slice(0,3)==="ms-")Z="-"+Z;return Z}function w80($){return"-"+$.toLowerCase()}var UB={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 yZ=_(r(),1),Ix=_(p(),1);var E80={};function h7($,Z){let H=Z||E80,J=typeof H.includeImageAlt==="boolean"?H.includeImageAlt:!0,B=typeof H.includeHtml==="boolean"?H.includeHtml:!0;return Uh($,J,B)}function Uh($,Z,H){if(S80($)){if("value"in $)return $.type==="html"&&!H?"":$.value;if(Z&&"alt"in $&&$.alt)return $.alt;if("children"in $)return Gh($.children,Z,H)}if(Array.isArray($))return Gh($,Z,H);return""}function Gh($,Z,H){let J=[],B=-1;while(++B<$.length)J[B]=Uh($[B],Z,H);return J.join("")}function S80($){return Boolean($&&typeof $==="object")}var Kh=document.createElement("i");function wZ($){let Z="&"+$+";";Kh.innerHTML=Z;let H=Kh.textContent;if(H.charCodeAt(H.length-1)===59&&$!=="semi")return!1;return H===Z?!1:H}function r5($,Z,H,J){let B=$.length,Q=0,z;if(Z<0)Z=-Z>B?0:B+Z;else Z=Z>B?B:Z;if(H=H>0?H:0,J.length<1e4)z=Array.from(J),z.unshift(Z,H),$.splice(...z);else{if(H)$.splice(Z,H);while(Q<J.length)z=J.slice(Q,Q+1e4),z.unshift(Z,0),$.splice(...z),Q+=1e4,Z+=1e4}}function K2($,Z){if($.length>0)return r5($,$.length,0,Z),$;return Z}var Fh={}.hasOwnProperty;function NK($){let Z={},H=-1;while(++H<$.length)I80(Z,$[H]);return Z}function I80($,Z){let H;for(H in Z){let B=(Fh.call($,H)?$[H]:void 0)||($[H]={}),Q=Z[H],z;if(Q)for(z in Q){if(!Fh.call(B,z))B[z]=[];let X=Q[z];k80(B[z],Array.isArray(X)?X:X?[X]:[])}}}function k80($,Z){let H=-1,J=[];while(++H<Z.length)(Z[H].add==="after"?$:J).push(Z[H]);r5($,0,0,J)}function VK($,Z){let H=Number.parseInt($,Z);if(H<9||H===11||H>13&&H<32||H>126&&H<160||H>55295&&H<57344||H>64975&&H<65008||(H&65535)===65535||(H&65535)===65534||H>1114111)return"�";return String.fromCodePoint(H)}function r4($){return $.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}var Q4=N6(/[A-Za-z]/),c5=N6(/[\dA-Za-z]/),Yh=N6(/[#-'*+\--9=?A-Z^-~]/);function x7($){return $!==null&&($<32||$===127)}var KB=N6(/\d/),Wh=N6(/[\dA-Fa-f]/),Ah=N6(/[!-/:-@[-`{-~]/);function x0($){return $!==null&&$<-2}function S1($){return $!==null&&($<0||$===32)}function e0($){return $===-2||$===-1||$===32}var v7=N6(/\p{P}|\p{S}/u),C9=N6(/\s/);function N6($){return Z;function Z(H){return H!==null&&H>-1&&$.test(String.fromCharCode(H))}}function N8($){let Z=[],H=-1,J=0,B=0;while(++H<$.length){let Q=$.charCodeAt(H),z="";if(Q===37&&c5($.charCodeAt(H+1))&&c5($.charCodeAt(H+2)))B=2;else if(Q<128){if(!/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(Q)))z=String.fromCharCode(Q)}else if(Q>55295&&Q<57344){let X=$.charCodeAt(H+1);if(Q<56320&&X>56319&&X<57344)z=String.fromCharCode(Q,X),B=1;else z="�"}else z=String.fromCharCode(Q);if(z)Z.push($.slice(J,H),encodeURIComponent(z)),J=H+B+1,z="";if(B)H+=B,B=0}return Z.join("")+$.slice(J)}function o0($,Z,H,J){let B=J?J-1:Number.POSITIVE_INFINITY,Q=0;return z;function z(G){if(e0(G))return $.enter(H),X(G);return Z(G)}function X(G){if(e0(G)&&Q++<B)return $.consume(G),X;return $.exit(H),Z(G)}}var Nh={tokenize:R80};function R80($){let Z=$.attempt(this.parser.constructs.contentInitial,J,B),H;return Z;function J(X){if(X===null){$.consume(X);return}return $.enter("lineEnding"),$.consume(X),$.exit("lineEnding"),o0($,Z,"linePrefix")}function B(X){return $.enter("paragraph"),Q(X)}function Q(X){let G=$.enter("chunkText",{contentType:"text",previous:H});if(H)H.next=G;return H=G,z(X)}function z(X){if(X===null){$.exit("chunkText"),$.exit("paragraph"),$.consume(X);return}if(x0(X))return $.consume(X),$.exit("chunkText"),Q;return $.consume(X),z}}var Lh={tokenize:b80},Vh={tokenize:y80};function b80($){let Z=this,H=[],J=0,B,Q,z;return X;function X(q){if(J<H.length){let j=H[J];return Z.containerState=j[1],$.attempt(j[0].continuation,G,U)(q)}return U(q)}function G(q){if(J++,Z.containerState._closeFlow){if(Z.containerState._closeFlow=void 0,B)D();let j=Z.events.length,M=j,P;while(M--)if(Z.events[M][0]==="exit"&&Z.events[M][1].type==="chunkFlow"){P=Z.events[M][1].end;break}V(J);let T=j;while(T<Z.events.length)Z.events[T][1].end={...P},T++;return r5(Z.events,M+1,0,Z.events.slice(j)),Z.events.length=T,U(q)}return X(q)}function U(q){if(J===H.length){if(!B)return Y(q);if(B.currentConstruct&&B.currentConstruct.concrete)return A(q);Z.interrupt=Boolean(B.currentConstruct&&!B._gfmTableDynamicInterruptHack)}return Z.containerState={},$.check(Vh,K,F)(q)}function K(q){if(B)D();return V(J),Y(q)}function F(q){return Z.parser.lazy[Z.now().line]=J!==H.length,z=Z.now().offset,A(q)}function Y(q){return Z.containerState={},$.attempt(Vh,W,A)(q)}function W(q){return J++,H.push([Z.currentConstruct,Z.containerState]),Y(q)}function A(q){if(q===null){if(B)D();V(0),$.consume(q);return}return B=B||Z.parser.flow(Z.now()),$.enter("chunkFlow",{_tokenizer:B,contentType:"flow",previous:Q}),N(q)}function N(q){if(q===null){L($.exit("chunkFlow"),!0),V(0),$.consume(q);return}if(x0(q))return $.consume(q),L($.exit("chunkFlow")),J=0,Z.interrupt=void 0,X;return $.consume(q),N}function L(q,j){let M=Z.sliceStream(q);if(j)M.push(null);if(q.previous=Q,Q)Q.next=q;if(Q=q,B.defineSkip(q.start),B.write(M),Z.parser.lazy[q.start.line]){let P=B.events.length;while(P--)if(B.events[P][1].start.offset<z&&(!B.events[P][1].end||B.events[P][1].end.offset>z))return;let T=Z.events.length,C=T,k,E;while(C--)if(Z.events[C][0]==="exit"&&Z.events[C][1].type==="chunkFlow"){if(k){E=Z.events[C][1].end;break}k=!0}V(J),P=T;while(P<Z.events.length)Z.events[P][1].end={...E},P++;r5(Z.events,C+1,0,Z.events.slice(T)),Z.events.length=P}}function V(q){let j=H.length;while(j-- >q){let M=H[j];Z.containerState=M[1],M[0].exit.call(Z,$)}H.length=q}function D(){B.write([null]),Q=void 0,B=void 0,Z.containerState._closeFlow=void 0}}function y80($,Z,H){return o0($,$.attempt(this.parser.constructs.document,Z,H),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function J3($){if($===null||S1($)||C9($))return 1;if(v7($))return 2}function V6($,Z,H){let J=[],B=-1;while(++B<$.length){let Q=$[B].resolveAll;if(Q&&!J.includes(Q))Z=Q(Z,H),J.push(Q)}return Z}var FB={name:"attention",resolveAll:h80,tokenize:x80};function h80($,Z){let H=-1,J,B,Q,z,X,G,U,K;while(++H<$.length)if($[H][0]==="enter"&&$[H][1].type==="attentionSequence"&&$[H][1]._close){J=H;while(J--)if($[J][0]==="exit"&&$[J][1].type==="attentionSequence"&&$[J][1]._open&&Z.sliceSerialize($[J][1]).charCodeAt(0)===Z.sliceSerialize($[H][1]).charCodeAt(0)){if(($[J][1]._close||$[H][1]._open)&&($[H][1].end.offset-$[H][1].start.offset)%3&&!(($[J][1].end.offset-$[J][1].start.offset+$[H][1].end.offset-$[H][1].start.offset)%3))continue;G=$[J][1].end.offset-$[J][1].start.offset>1&&$[H][1].end.offset-$[H][1].start.offset>1?2:1;let F={...$[J][1].end},Y={...$[H][1].start};if(Dh(F,-G),Dh(Y,G),z={type:G>1?"strongSequence":"emphasisSequence",start:F,end:{...$[J][1].end}},X={type:G>1?"strongSequence":"emphasisSequence",start:{...$[H][1].start},end:Y},Q={type:G>1?"strongText":"emphasisText",start:{...$[J][1].end},end:{...$[H][1].start}},B={type:G>1?"strong":"emphasis",start:{...z.start},end:{...X.end}},$[J][1].end={...z.start},$[H][1].start={...X.end},U=[],$[J][1].end.offset-$[J][1].start.offset)U=K2(U,[["enter",$[J][1],Z],["exit",$[J][1],Z]]);if(U=K2(U,[["enter",B,Z],["enter",z,Z],["exit",z,Z],["enter",Q,Z]]),U=K2(U,V6(Z.parser.constructs.insideSpan.null,$.slice(J+1,H),Z)),U=K2(U,[["exit",Q,Z],["enter",X,Z],["exit",X,Z],["exit",B,Z]]),$[H][1].end.offset-$[H][1].start.offset)K=2,U=K2(U,[["enter",$[H][1],Z],["exit",$[H][1],Z]]);else K=0;r5($,J-1,H-J+3,U),H=J+U.length-K-2;break}}H=-1;while(++H<$.length)if($[H][1].type==="attentionSequence")$[H][1].type="data";return $}function x80($,Z){let H=this.parser.constructs.attentionMarkers.null,J=this.previous,B=J3(J),Q;return z;function z(G){return Q=G,$.enter("attentionSequence"),X(G)}function X(G){if(G===Q)return $.consume(G),X;let U=$.exit("attentionSequence"),K=J3(G),F=!K||K===2&&B||H.includes(G),Y=!B||B===2&&K||H.includes(J);return U._open=Boolean(Q===42?F:F&&(B||!Y)),U._close=Boolean(Q===42?Y:Y&&(K||!F)),Z(G)}}function Dh($,Z){$.column+=Z,$.offset+=Z,$._bufferIndex+=Z}var GL={name:"autolink",tokenize:v80};function v80($,Z,H){let J=0;return B;function B(W){return $.enter("autolink"),$.enter("autolinkMarker"),$.consume(W),$.exit("autolinkMarker"),$.enter("autolinkProtocol"),Q}function Q(W){if(Q4(W))return $.consume(W),z;if(W===64)return H(W);return U(W)}function z(W){if(W===43||W===45||W===46||c5(W))return J=1,X(W);return U(W)}function X(W){if(W===58)return $.consume(W),J=0,G;if((W===43||W===45||W===46||c5(W))&&J++<32)return $.consume(W),X;return J=0,U(W)}function G(W){if(W===62)return $.exit("autolinkProtocol"),$.enter("autolinkMarker"),$.consume(W),$.exit("autolinkMarker"),$.exit("autolink"),Z;if(W===null||W===32||W===60||x7(W))return H(W);return $.consume(W),G}function U(W){if(W===64)return $.consume(W),K;if(Yh(W))return $.consume(W),U;return H(W)}function K(W){return c5(W)?F(W):H(W)}function F(W){if(W===46)return $.consume(W),J=0,K;if(W===62)return $.exit("autolinkProtocol").type="autolinkEmail",$.enter("autolinkMarker"),$.consume(W),$.exit("autolinkMarker"),$.exit("autolink"),Z;return Y(W)}function Y(W){if((W===45||c5(W))&&J++<63){let A=W===45?Y:F;return $.consume(W),A}return H(W)}}var w9={partial:!0,tokenize:g80};function g80($,Z,H){return J;function J(Q){return e0(Q)?o0($,B,"linePrefix")(Q):B(Q)}function B(Q){return Q===null||x0(Q)?Z(Q):H(Q)}}var LK={continuation:{tokenize:m80},exit:u80,name:"blockQuote",tokenize:f80};function f80($,Z,H){let J=this;return B;function B(z){if(z===62){let X=J.containerState;if(!X.open)$.enter("blockQuote",{_container:!0}),X.open=!0;return $.enter("blockQuotePrefix"),$.enter("blockQuoteMarker"),$.consume(z),$.exit("blockQuoteMarker"),Q}return H(z)}function Q(z){if(e0(z))return $.enter("blockQuotePrefixWhitespace"),$.consume(z),$.exit("blockQuotePrefixWhitespace"),$.exit("blockQuotePrefix"),Z;return $.exit("blockQuotePrefix"),Z(z)}}function m80($,Z,H){let J=this;return B;function B(z){if(e0(z))return o0($,Q,"linePrefix",J.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(z);return Q(z)}function Q(z){return $.attempt(LK,Z,H)(z)}}function u80($){$.exit("blockQuote")}var DK={name:"characterEscape",tokenize:p80};function p80($,Z,H){return J;function J(Q){return $.enter("characterEscape"),$.enter("escapeMarker"),$.consume(Q),$.exit("escapeMarker"),B}function B(Q){if(Ah(Q))return $.enter("characterEscapeValue"),$.consume(Q),$.exit("characterEscapeValue"),$.exit("characterEscape"),Z;return H(Q)}}var qK={name:"characterReference",tokenize:c80};function c80($,Z,H){let J=this,B=0,Q,z;return X;function X(F){return $.enter("characterReference"),$.enter("characterReferenceMarker"),$.consume(F),$.exit("characterReferenceMarker"),G}function G(F){if(F===35)return $.enter("characterReferenceMarkerNumeric"),$.consume(F),$.exit("characterReferenceMarkerNumeric"),U;return $.enter("characterReferenceValue"),Q=31,z=c5,K(F)}function U(F){if(F===88||F===120)return $.enter("characterReferenceMarkerHexadecimal"),$.consume(F),$.exit("characterReferenceMarkerHexadecimal"),$.enter("characterReferenceValue"),Q=6,z=Wh,K;return $.enter("characterReferenceValue"),Q=7,z=KB,K(F)}function K(F){if(F===59&&B){let Y=$.exit("characterReferenceValue");if(z===c5&&!wZ(J.sliceSerialize(Y)))return H(F);return $.enter("characterReferenceMarker"),$.consume(F),$.exit("characterReferenceMarker"),$.exit("characterReference"),Z}if(z(F)&&B++<Q)return $.consume(F),K;return H(F)}}var qh={partial:!0,tokenize:l80},MK={concrete:!0,name:"codeFenced",tokenize:d80};function d80($,Z,H){let J=this,B={partial:!0,tokenize:M},Q=0,z=0,X;return G;function G(P){return U(P)}function U(P){let T=J.events[J.events.length-1];return Q=T&&T[1].type==="linePrefix"?T[2].sliceSerialize(T[1],!0).length:0,X=P,$.enter("codeFenced"),$.enter("codeFencedFence"),$.enter("codeFencedFenceSequence"),K(P)}function K(P){if(P===X)return z++,$.consume(P),K;if(z<3)return H(P);return $.exit("codeFencedFenceSequence"),e0(P)?o0($,F,"whitespace")(P):F(P)}function F(P){if(P===null||x0(P))return $.exit("codeFencedFence"),J.interrupt?Z(P):$.check(qh,N,j)(P);return $.enter("codeFencedFenceInfo"),$.enter("chunkString",{contentType:"string"}),Y(P)}function Y(P){if(P===null||x0(P))return $.exit("chunkString"),$.exit("codeFencedFenceInfo"),F(P);if(e0(P))return $.exit("chunkString"),$.exit("codeFencedFenceInfo"),o0($,W,"whitespace")(P);if(P===96&&P===X)return H(P);return $.consume(P),Y}function W(P){if(P===null||x0(P))return F(P);return $.enter("codeFencedFenceMeta"),$.enter("chunkString",{contentType:"string"}),A(P)}function A(P){if(P===null||x0(P))return $.exit("chunkString"),$.exit("codeFencedFenceMeta"),F(P);if(P===96&&P===X)return H(P);return $.consume(P),A}function N(P){return $.attempt(B,j,L)(P)}function L(P){return $.enter("lineEnding"),$.consume(P),$.exit("lineEnding"),V}function V(P){return Q>0&&e0(P)?o0($,D,"linePrefix",Q+1)(P):D(P)}function D(P){if(P===null||x0(P))return $.check(qh,N,j)(P);return $.enter("codeFlowValue"),q(P)}function q(P){if(P===null||x0(P))return $.exit("codeFlowValue"),D(P);return $.consume(P),q}function j(P){return $.exit("codeFenced"),Z(P)}function M(P,T,C){let k=0;return E;function E(S){return P.enter("lineEnding"),P.consume(S),P.exit("lineEnding"),h}function h(S){return P.enter("codeFencedFence"),e0(S)?o0(P,x,"linePrefix",J.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(S):x(S)}function x(S){if(S===X)return P.enter("codeFencedFenceSequence"),R(S);return C(S)}function R(S){if(S===X)return k++,P.consume(S),R;if(k>=z)return P.exit("codeFencedFenceSequence"),e0(S)?o0(P,w,"whitespace")(S):w(S);return C(S)}function w(S){if(S===null||x0(S))return P.exit("codeFencedFence"),T(S);return C(S)}}}function l80($,Z,H){let J=this;return B;function B(z){if(z===null)return H(z);return $.enter("lineEnding"),$.consume(z),$.exit("lineEnding"),Q}function Q(z){return J.parser.lazy[J.now().line]?H(z):Z(z)}}var YB={name:"codeIndented",tokenize:r80},i80={partial:!0,tokenize:a80};function r80($,Z,H){let J=this;return B;function B(U){return $.enter("codeIndented"),o0($,Q,"linePrefix",5)(U)}function Q(U){let K=J.events[J.events.length-1];return K&&K[1].type==="linePrefix"&&K[2].sliceSerialize(K[1],!0).length>=4?z(U):H(U)}function z(U){if(U===null)return G(U);if(x0(U))return $.attempt(i80,z,G)(U);return $.enter("codeFlowValue"),X(U)}function X(U){if(U===null||x0(U))return $.exit("codeFlowValue"),z(U);return $.consume(U),X}function G(U){return $.exit("codeIndented"),Z(U)}}function a80($,Z,H){let J=this;return B;function B(z){if(J.parser.lazy[J.now().line])return H(z);if(x0(z))return $.enter("lineEnding"),$.consume(z),$.exit("lineEnding"),B;return o0($,Q,"linePrefix",5)(z)}function Q(z){let X=J.events[J.events.length-1];return X&&X[1].type==="linePrefix"&&X[2].sliceSerialize(X[1],!0).length>=4?Z(z):x0(z)?B(z):H(z)}}var UL={name:"codeText",previous:o80,resolve:n80,tokenize:s80};function n80($){let Z=$.length-4,H=3,J,B;if(($[H][1].type==="lineEnding"||$[H][1].type==="space")&&($[Z][1].type==="lineEnding"||$[Z][1].type==="space")){J=H;while(++J<Z)if($[J][1].type==="codeTextData"){$[H][1].type="codeTextPadding",$[Z][1].type="codeTextPadding",H+=2,Z-=2;break}}J=H-1,Z++;while(++J<=Z)if(B===void 0){if(J!==Z&&$[J][1].type!=="lineEnding")B=J}else if(J===Z||$[J][1].type==="lineEnding"){if($[B][1].type="codeTextData",J!==B+2)$[B][1].end=$[J-1][1].end,$.splice(B+2,J-B-2),Z-=J-B-2,J=B+2;B=void 0}return $}function o80($){return $!==96||this.events[this.events.length-1][1].type==="characterEscape"}function s80($,Z,H){let J=this,B=0,Q,z;return X;function X(Y){return $.enter("codeText"),$.enter("codeTextSequence"),G(Y)}function G(Y){if(Y===96)return $.consume(Y),B++,G;return $.exit("codeTextSequence"),U(Y)}function U(Y){if(Y===null)return H(Y);if(Y===32)return $.enter("space"),$.consume(Y),$.exit("space"),U;if(Y===96)return z=$.enter("codeTextSequence"),Q=0,F(Y);if(x0(Y))return $.enter("lineEnding"),$.consume(Y),$.exit("lineEnding"),U;return $.enter("codeTextData"),K(Y)}function K(Y){if(Y===null||Y===32||Y===96||x0(Y))return $.exit("codeTextData"),U(Y);return $.consume(Y),K}function F(Y){if(Y===96)return $.consume(Y),Q++,F;if(Q===B)return $.exit("codeTextSequence"),$.exit("codeText"),Z(Y);return z.type="codeTextData",K(Y)}}class KL{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 H=Z===null||Z===void 0?Number.POSITIVE_INFINITY:Z;if(H<this.left.length)return this.left.slice($,H);if($>this.left.length)return this.right.slice(this.right.length-H+this.left.length,this.right.length-$+this.left.length).reverse();return this.left.slice($).concat(this.right.slice(this.right.length-H+this.left.length).reverse())}splice($,Z,H){let J=Z||0;this.setCursor(Math.trunc($));let B=this.right.splice(this.right.length-J,Number.POSITIVE_INFINITY);if(H)WB(this.left,H);return B.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),WB(this.left,$)}unshift($){this.setCursor(0),this.right.push($)}unshiftMany($){this.setCursor(0),WB(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);WB(this.right,Z.reverse())}else{let Z=this.right.splice(this.left.length+this.right.length-$,Number.POSITIVE_INFINITY);WB(this.left,Z.reverse())}}}function WB($,Z){let H=0;if(Z.length<1e4)$.push(...Z);else while(H<Z.length)$.push(...Z.slice(H,H+1e4)),H+=1e4}function PK($){let Z={},H=-1,J,B,Q,z,X,G,U,K=new KL($);while(++H<K.length){while(H in Z)H=Z[H];if(J=K.get(H),H&&J[1].type==="chunkFlow"&&K.get(H-1)[1].type==="listItemPrefix"){if(G=J[1]._tokenizer.events,Q=0,Q<G.length&&G[Q][1].type==="lineEndingBlank")Q+=2;if(Q<G.length&&G[Q][1].type==="content")while(++Q<G.length){if(G[Q][1].type==="content")break;if(G[Q][1].type==="chunkText")G[Q][1]._isInFirstContentOfListItem=!0,Q++}}if(J[0]==="enter"){if(J[1].contentType)Object.assign(Z,t80(K,H)),H=Z[H],U=!0}else if(J[1]._container){Q=H,B=void 0;while(Q--)if(z=K.get(Q),z[1].type==="lineEnding"||z[1].type==="lineEndingBlank"){if(z[0]==="enter"){if(B)K.get(B)[1].type="lineEndingBlank";z[1].type="lineEnding",B=Q}}else if(z[1].type==="linePrefix"||z[1].type==="listItemIndent");else break;if(B)J[1].end={...K.get(B)[1].start},X=K.slice(B,H),X.unshift(J),K.splice(B,H-B+1,X)}}return r5($,0,Number.POSITIVE_INFINITY,K.slice(0)),!U}function t80($,Z){let H=$.get(Z)[1],J=$.get(Z)[2],B=Z-1,Q=[],z=H._tokenizer;if(!z){if(z=J.parser[H.contentType](H.start),H._contentTypeTextTrailing)z._contentTypeTextTrailing=!0}let X=z.events,G=[],U={},K,F,Y=-1,W=H,A=0,N=0,L=[N];while(W){while($.get(++B)[1]!==W);if(Q.push(B),!W._tokenizer){if(K=J.sliceStream(W),!W.next)K.push(null);if(F)z.defineSkip(W.start);if(W._isInFirstContentOfListItem)z._gfmTasklistFirstContentOfListItem=!0;if(z.write(K),W._isInFirstContentOfListItem)z._gfmTasklistFirstContentOfListItem=void 0}F=W,W=W.next}W=H;while(++Y<X.length)if(X[Y][0]==="exit"&&X[Y-1][0]==="enter"&&X[Y][1].type===X[Y-1][1].type&&X[Y][1].start.line!==X[Y][1].end.line)N=Y+1,L.push(N),W._tokenizer=void 0,W.previous=void 0,W=W.next;if(z.events=[],W)W._tokenizer=void 0,W.previous=void 0;else L.pop();Y=L.length;while(Y--){let V=X.slice(L[Y],L[Y+1]),D=Q.pop();G.push([D,D+V.length-1]),$.splice(D,2,V)}G.reverse(),Y=-1;while(++Y<G.length)U[A+G[Y][0]]=A+G[Y][1],A+=G[Y][1]-G[Y][0]-1;return U}var FL={resolve:$90,tokenize:Z90},e80={partial:!0,tokenize:H90};function $90($){return PK($),$}function Z90($,Z){let H;return J;function J(X){return $.enter("content"),H=$.enter("chunkContent",{contentType:"content"}),B(X)}function B(X){if(X===null)return Q(X);if(x0(X))return $.check(e80,z,Q)(X);return $.consume(X),B}function Q(X){return $.exit("chunkContent"),$.exit("content"),Z(X)}function z(X){return $.consume(X),$.exit("chunkContent"),H.next=$.enter("chunkContent",{contentType:"content",previous:H}),H=H.next,B}}function H90($,Z,H){let J=this;return B;function B(z){return $.exit("chunkContent"),$.enter("lineEnding"),$.consume(z),$.exit("lineEnding"),o0($,Q,"linePrefix")}function Q(z){if(z===null||x0(z))return H(z);let X=J.events[J.events.length-1];if(!J.parser.constructs.disable.null.includes("codeIndented")&&X&&X[1].type==="linePrefix"&&X[2].sliceSerialize(X[1],!0).length>=4)return Z(z);return $.interrupt(J.parser.constructs.flow,H,Z)(z)}}function _K($,Z,H,J,B,Q,z,X,G){let U=G||Number.POSITIVE_INFINITY,K=0;return F;function F(V){if(V===60)return $.enter(J),$.enter(B),$.enter(Q),$.consume(V),$.exit(Q),Y;if(V===null||V===32||V===41||x7(V))return H(V);return $.enter(J),$.enter(z),$.enter(X),$.enter("chunkString",{contentType:"string"}),N(V)}function Y(V){if(V===62)return $.enter(Q),$.consume(V),$.exit(Q),$.exit(B),$.exit(J),Z;return $.enter(X),$.enter("chunkString",{contentType:"string"}),W(V)}function W(V){if(V===62)return $.exit("chunkString"),$.exit(X),Y(V);if(V===null||V===60||x0(V))return H(V);return $.consume(V),V===92?A:W}function A(V){if(V===60||V===62||V===92)return $.consume(V),W;return W(V)}function N(V){if(!K&&(V===null||V===41||S1(V)))return $.exit("chunkString"),$.exit(X),$.exit(z),$.exit(J),Z(V);if(K<U&&V===40)return $.consume(V),K++,N;if(V===41)return $.consume(V),K--,N;if(V===null||V===32||V===40||x7(V))return H(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 jK($,Z,H,J,B,Q){let z=this,X=0,G;return U;function U(W){return $.enter(J),$.enter(B),$.consume(W),$.exit(B),$.enter(Q),K}function K(W){if(X>999||W===null||W===91||W===93&&!G||W===94&&!X&&"_hiddenFootnoteSupport"in z.parser.constructs)return H(W);if(W===93)return $.exit(Q),$.enter(B),$.consume(W),$.exit(B),$.exit(J),Z;if(x0(W))return $.enter("lineEnding"),$.consume(W),$.exit("lineEnding"),K;return $.enter("chunkString",{contentType:"string"}),F(W)}function F(W){if(W===null||W===91||W===93||x0(W)||X++>999)return $.exit("chunkString"),K(W);if($.consume(W),!G)G=!e0(W);return W===92?Y:F}function Y(W){if(W===91||W===92||W===93)return $.consume(W),X++,F;return F(W)}}function OK($,Z,H,J,B,Q){let z;return X;function X(Y){if(Y===34||Y===39||Y===40)return $.enter(J),$.enter(B),$.consume(Y),$.exit(B),z=Y===40?41:Y,G;return H(Y)}function G(Y){if(Y===z)return $.enter(B),$.consume(Y),$.exit(B),$.exit(J),Z;return $.enter(Q),U(Y)}function U(Y){if(Y===z)return $.exit(Q),G(z);if(Y===null)return H(Y);if(x0(Y))return $.enter("lineEnding"),$.consume(Y),$.exit("lineEnding"),o0($,U,"linePrefix");return $.enter("chunkString",{contentType:"string"}),K(Y)}function K(Y){if(Y===z||Y===null||x0(Y))return $.exit("chunkString"),U(Y);return $.consume(Y),Y===92?F:K}function F(Y){if(Y===z||Y===92)return $.consume(Y),K;return K(Y)}}function g7($,Z){let H;return J;function J(B){if(x0(B))return $.enter("lineEnding"),$.consume(B),$.exit("lineEnding"),H=!0,J;if(e0(B))return o0($,J,H?"linePrefix":"lineSuffix")(B);return Z(B)}}var YL={name:"definition",tokenize:B90},J90={partial:!0,tokenize:Q90};function B90($,Z,H){let J=this,B;return Q;function Q(W){return $.enter("definition"),z(W)}function z(W){return jK.call(J,$,X,H,"definitionLabel","definitionLabelMarker","definitionLabelString")(W)}function X(W){if(B=r4(J.sliceSerialize(J.events[J.events.length-1][1]).slice(1,-1)),W===58)return $.enter("definitionMarker"),$.consume(W),$.exit("definitionMarker"),G;return H(W)}function G(W){return S1(W)?g7($,U)(W):U(W)}function U(W){return _K($,K,H,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(W)}function K(W){return $.attempt(J90,F,F)(W)}function F(W){return e0(W)?o0($,Y,"whitespace")(W):Y(W)}function Y(W){if(W===null||x0(W))return $.exit("definition"),J.parser.defined.push(B),Z(W);return H(W)}}function Q90($,Z,H){return J;function J(X){return S1(X)?g7($,B)(X):H(X)}function B(X){return OK($,Q,H,"definitionTitle","definitionTitleMarker","definitionTitleString")(X)}function Q(X){return e0(X)?o0($,z,"whitespace")(X):z(X)}function z(X){return X===null||x0(X)?Z(X):H(X)}}var WL={name:"hardBreakEscape",tokenize:z90};function z90($,Z,H){return J;function J(Q){return $.enter("hardBreakEscape"),$.consume(Q),B}function B(Q){if(x0(Q))return $.exit("hardBreakEscape"),Z(Q);return H(Q)}}var AL={name:"headingAtx",resolve:X90,tokenize:G90};function X90($,Z){let H=$.length-2,J=3,B,Q;if($[J][1].type==="whitespace")J+=2;if(H-2>J&&$[H][1].type==="whitespace")H-=2;if($[H][1].type==="atxHeadingSequence"&&(J===H-1||H-4>J&&$[H-2][1].type==="whitespace"))H-=J+1===H?2:4;if(H>J)B={type:"atxHeadingText",start:$[J][1].start,end:$[H][1].end},Q={type:"chunkText",start:$[J][1].start,end:$[H][1].end,contentType:"text"},r5($,J,H-J+1,[["enter",B,Z],["enter",Q,Z],["exit",Q,Z],["exit",B,Z]]);return $}function G90($,Z,H){let J=0;return B;function B(K){return $.enter("atxHeading"),Q(K)}function Q(K){return $.enter("atxHeadingSequence"),z(K)}function z(K){if(K===35&&J++<6)return $.consume(K),z;if(K===null||S1(K))return $.exit("atxHeadingSequence"),X(K);return H(K)}function X(K){if(K===35)return $.enter("atxHeadingSequence"),G(K);if(K===null||x0(K))return $.exit("atxHeading"),Z(K);if(e0(K))return o0($,X,"whitespace")(K);return $.enter("atxHeadingText"),U(K)}function G(K){if(K===35)return $.consume(K),G;return $.exit("atxHeadingSequence"),X(K)}function U(K){if(K===null||K===35||S1(K))return $.exit("atxHeadingText"),X(K);return $.consume(K),U}}var Mh=["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"],NL=["pre","script","style","textarea"];var VL={concrete:!0,name:"htmlFlow",resolveTo:F90,tokenize:Y90},U90={partial:!0,tokenize:A90},K90={partial:!0,tokenize:W90};function F90($){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 Y90($,Z,H){let J=this,B,Q,z,X,G;return U;function U(b){return K(b)}function K(b){return $.enter("htmlFlow"),$.enter("htmlFlowData"),$.consume(b),F}function F(b){if(b===33)return $.consume(b),Y;if(b===47)return $.consume(b),Q=!0,N;if(b===63)return $.consume(b),B=3,J.interrupt?Z:O;if(Q4(b))return $.consume(b),z=String.fromCharCode(b),L;return H(b)}function Y(b){if(b===45)return $.consume(b),B=2,W;if(b===91)return $.consume(b),B=5,X=0,A;if(Q4(b))return $.consume(b),B=4,J.interrupt?Z:O;return H(b)}function W(b){if(b===45)return $.consume(b),J.interrupt?Z:O;return H(b)}function A(b){if(b==="CDATA[".charCodeAt(X++)){if($.consume(b),X===6)return J.interrupt?Z:x;return A}return H(b)}function N(b){if(Q4(b))return $.consume(b),z=String.fromCharCode(b),L;return H(b)}function L(b){if(b===null||b===47||b===62||S1(b)){let d=b===47,t=z.toLowerCase();if(!d&&!Q&&NL.includes(t))return B=1,J.interrupt?Z(b):x(b);if(Mh.includes(z.toLowerCase())){if(B=6,d)return $.consume(b),V;return J.interrupt?Z(b):x(b)}return B=7,J.interrupt&&!J.parser.lazy[J.now().line]?H(b):Q?D(b):q(b)}if(b===45||c5(b))return $.consume(b),z+=String.fromCharCode(b),L;return H(b)}function V(b){if(b===62)return $.consume(b),J.interrupt?Z:x;return H(b)}function D(b){if(e0(b))return $.consume(b),D;return E(b)}function q(b){if(b===47)return $.consume(b),E;if(b===58||b===95||Q4(b))return $.consume(b),j;if(e0(b))return $.consume(b),q;return E(b)}function j(b){if(b===45||b===46||b===58||b===95||c5(b))return $.consume(b),j;return M(b)}function M(b){if(b===61)return $.consume(b),P;if(e0(b))return $.consume(b),M;return q(b)}function P(b){if(b===null||b===60||b===61||b===62||b===96)return H(b);if(b===34||b===39)return $.consume(b),G=b,T;if(e0(b))return $.consume(b),P;return C(b)}function T(b){if(b===G)return $.consume(b),G=null,k;if(b===null||x0(b))return H(b);return $.consume(b),T}function C(b){if(b===null||b===34||b===39||b===47||b===60||b===61||b===62||b===96||S1(b))return M(b);return $.consume(b),C}function k(b){if(b===47||b===62||e0(b))return q(b);return H(b)}function E(b){if(b===62)return $.consume(b),h;return H(b)}function h(b){if(b===null||x0(b))return x(b);if(e0(b))return $.consume(b),h;return H(b)}function x(b){if(b===45&&B===2)return $.consume(b),I;if(b===60&&B===1)return $.consume(b),y;if(b===62&&B===4)return $.consume(b),c;if(b===63&&B===3)return $.consume(b),O;if(b===93&&B===5)return $.consume(b),g;if(x0(b)&&(B===6||B===7))return $.exit("htmlFlowData"),$.check(U90,o,R)(b);if(b===null||x0(b))return $.exit("htmlFlowData"),R(b);return $.consume(b),x}function R(b){return $.check(K90,w,o)(b)}function w(b){return $.enter("lineEnding"),$.consume(b),$.exit("lineEnding"),S}function S(b){if(b===null||x0(b))return R(b);return $.enter("htmlFlowData"),x(b)}function I(b){if(b===45)return $.consume(b),O;return x(b)}function y(b){if(b===47)return $.consume(b),z="",f;return x(b)}function f(b){if(b===62){let d=z.toLowerCase();if(NL.includes(d))return $.consume(b),c;return x(b)}if(Q4(b)&&z.length<8)return $.consume(b),z+=String.fromCharCode(b),f;return x(b)}function g(b){if(b===93)return $.consume(b),O;return x(b)}function O(b){if(b===62)return $.consume(b),c;if(b===45&&B===2)return $.consume(b),O;return x(b)}function c(b){if(b===null||x0(b))return $.exit("htmlFlowData"),o(b);return $.consume(b),c}function o(b){return $.exit("htmlFlow"),Z(b)}}function W90($,Z,H){let J=this;return B;function B(z){if(x0(z))return $.enter("lineEnding"),$.consume(z),$.exit("lineEnding"),Q;return H(z)}function Q(z){return J.parser.lazy[J.now().line]?H(z):Z(z)}}function A90($,Z,H){return J;function J(B){return $.enter("lineEnding"),$.consume(B),$.exit("lineEnding"),$.attempt(w9,Z,H)}}var LL={name:"htmlText",tokenize:N90};function N90($,Z,H){let J=this,B,Q,z;return X;function X(O){return $.enter("htmlText"),$.enter("htmlTextData"),$.consume(O),G}function G(O){if(O===33)return $.consume(O),U;if(O===47)return $.consume(O),M;if(O===63)return $.consume(O),q;if(Q4(O))return $.consume(O),C;return H(O)}function U(O){if(O===45)return $.consume(O),K;if(O===91)return $.consume(O),Q=0,A;if(Q4(O))return $.consume(O),D;return H(O)}function K(O){if(O===45)return $.consume(O),W;return H(O)}function F(O){if(O===null)return H(O);if(O===45)return $.consume(O),Y;if(x0(O))return z=F,y(O);return $.consume(O),F}function Y(O){if(O===45)return $.consume(O),W;return F(O)}function W(O){return O===62?I(O):O===45?Y(O):F(O)}function A(O){if(O==="CDATA[".charCodeAt(Q++))return $.consume(O),Q===6?N:A;return H(O)}function N(O){if(O===null)return H(O);if(O===93)return $.consume(O),L;if(x0(O))return z=N,y(O);return $.consume(O),N}function L(O){if(O===93)return $.consume(O),V;return N(O)}function V(O){if(O===62)return I(O);if(O===93)return $.consume(O),V;return N(O)}function D(O){if(O===null||O===62)return I(O);if(x0(O))return z=D,y(O);return $.consume(O),D}function q(O){if(O===null)return H(O);if(O===63)return $.consume(O),j;if(x0(O))return z=q,y(O);return $.consume(O),q}function j(O){return O===62?I(O):q(O)}function M(O){if(Q4(O))return $.consume(O),P;return H(O)}function P(O){if(O===45||c5(O))return $.consume(O),P;return T(O)}function T(O){if(x0(O))return z=T,y(O);if(e0(O))return $.consume(O),T;return I(O)}function C(O){if(O===45||c5(O))return $.consume(O),C;if(O===47||O===62||S1(O))return k(O);return H(O)}function k(O){if(O===47)return $.consume(O),I;if(O===58||O===95||Q4(O))return $.consume(O),E;if(x0(O))return z=k,y(O);if(e0(O))return $.consume(O),k;return I(O)}function E(O){if(O===45||O===46||O===58||O===95||c5(O))return $.consume(O),E;return h(O)}function h(O){if(O===61)return $.consume(O),x;if(x0(O))return z=h,y(O);if(e0(O))return $.consume(O),h;return k(O)}function x(O){if(O===null||O===60||O===61||O===62||O===96)return H(O);if(O===34||O===39)return $.consume(O),B=O,R;if(x0(O))return z=x,y(O);if(e0(O))return $.consume(O),x;return $.consume(O),w}function R(O){if(O===B)return $.consume(O),B=void 0,S;if(O===null)return H(O);if(x0(O))return z=R,y(O);return $.consume(O),R}function w(O){if(O===null||O===34||O===39||O===60||O===61||O===96)return H(O);if(O===47||O===62||S1(O))return k(O);return $.consume(O),w}function S(O){if(O===47||O===62||S1(O))return k(O);return H(O)}function I(O){if(O===62)return $.consume(O),$.exit("htmlTextData"),$.exit("htmlText"),Z;return H(O)}function y(O){return $.exit("htmlTextData"),$.enter("lineEnding"),$.consume(O),$.exit("lineEnding"),f}function f(O){return e0(O)?o0($,g,"linePrefix",J.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(O):g(O)}function g(O){return $.enter("htmlTextData"),z(O)}}var f7={name:"labelEnd",resolveAll:q90,resolveTo:M90,tokenize:P90},V90={tokenize:_90},L90={tokenize:j90},D90={tokenize:O90};function q90($){let Z=-1,H=[];while(++Z<$.length){let J=$[Z][1];if(H.push($[Z]),J.type==="labelImage"||J.type==="labelLink"||J.type==="labelEnd"){let B=J.type==="labelImage"?4:2;J.type="data",Z+=B}}if($.length!==H.length)r5($,0,$.length,H);return $}function M90($,Z){let H=$.length,J=0,B,Q,z,X;while(H--)if(B=$[H][1],Q){if(B.type==="link"||B.type==="labelLink"&&B._inactive)break;if($[H][0]==="enter"&&B.type==="labelLink")B._inactive=!0}else if(z){if($[H][0]==="enter"&&(B.type==="labelImage"||B.type==="labelLink")&&!B._balanced){if(Q=H,B.type!=="labelLink"){J=2;break}}}else if(B.type==="labelEnd")z=H;let G={type:$[Q][1].type==="labelLink"?"link":"image",start:{...$[Q][1].start},end:{...$[$.length-1][1].end}},U={type:"label",start:{...$[Q][1].start},end:{...$[z][1].end}},K={type:"labelText",start:{...$[Q+J+2][1].end},end:{...$[z-2][1].start}};return X=[["enter",G,Z],["enter",U,Z]],X=K2(X,$.slice(Q+1,Q+J+3)),X=K2(X,[["enter",K,Z]]),X=K2(X,V6(Z.parser.constructs.insideSpan.null,$.slice(Q+J+4,z-3),Z)),X=K2(X,[["exit",K,Z],$[z-2],$[z-1],["exit",U,Z]]),X=K2(X,$.slice(z+1)),X=K2(X,[["exit",G,Z]]),r5($,Q,$.length,X),$}function P90($,Z,H){let J=this,B=J.events.length,Q,z;while(B--)if((J.events[B][1].type==="labelImage"||J.events[B][1].type==="labelLink")&&!J.events[B][1]._balanced){Q=J.events[B][1];break}return X;function X(Y){if(!Q)return H(Y);if(Q._inactive)return F(Y);return z=J.parser.defined.includes(r4(J.sliceSerialize({start:Q.end,end:J.now()}))),$.enter("labelEnd"),$.enter("labelMarker"),$.consume(Y),$.exit("labelMarker"),$.exit("labelEnd"),G}function G(Y){if(Y===40)return $.attempt(V90,K,z?K:F)(Y);if(Y===91)return $.attempt(L90,K,z?U:F)(Y);return z?K(Y):F(Y)}function U(Y){return $.attempt(D90,K,F)(Y)}function K(Y){return Z(Y)}function F(Y){return Q._balanced=!0,H(Y)}}function _90($,Z,H){return J;function J(F){return $.enter("resource"),$.enter("resourceMarker"),$.consume(F),$.exit("resourceMarker"),B}function B(F){return S1(F)?g7($,Q)(F):Q(F)}function Q(F){if(F===41)return K(F);return _K($,z,X,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(F)}function z(F){return S1(F)?g7($,G)(F):K(F)}function X(F){return H(F)}function G(F){if(F===34||F===39||F===40)return OK($,U,H,"resourceTitle","resourceTitleMarker","resourceTitleString")(F);return K(F)}function U(F){return S1(F)?g7($,K)(F):K(F)}function K(F){if(F===41)return $.enter("resourceMarker"),$.consume(F),$.exit("resourceMarker"),$.exit("resource"),Z;return H(F)}}function j90($,Z,H){let J=this;return B;function B(X){return jK.call(J,$,Q,z,"reference","referenceMarker","referenceString")(X)}function Q(X){return J.parser.defined.includes(r4(J.sliceSerialize(J.events[J.events.length-1][1]).slice(1,-1)))?Z(X):H(X)}function z(X){return H(X)}}function O90($,Z,H){return J;function J(Q){return $.enter("reference"),$.enter("referenceMarker"),$.consume(Q),$.exit("referenceMarker"),B}function B(Q){if(Q===93)return $.enter("referenceMarker"),$.consume(Q),$.exit("referenceMarker"),$.exit("reference"),Z;return H(Q)}}var DL={name:"labelStartImage",resolveAll:f7.resolveAll,tokenize:T90};function T90($,Z,H){let J=this;return B;function B(X){return $.enter("labelImage"),$.enter("labelImageMarker"),$.consume(X),$.exit("labelImageMarker"),Q}function Q(X){if(X===91)return $.enter("labelMarker"),$.consume(X),$.exit("labelMarker"),$.exit("labelImage"),z;return H(X)}function z(X){return X===94&&"_hiddenFootnoteSupport"in J.parser.constructs?H(X):Z(X)}}var qL={name:"labelStartLink",resolveAll:f7.resolveAll,tokenize:C90};function C90($,Z,H){let J=this;return B;function B(z){return $.enter("labelLink"),$.enter("labelMarker"),$.consume(z),$.exit("labelMarker"),$.exit("labelLink"),Q}function Q(z){return z===94&&"_hiddenFootnoteSupport"in J.parser.constructs?H(z):Z(z)}}var AB={name:"lineEnding",tokenize:w90};function w90($,Z){return H;function H(J){return $.enter("lineEnding"),$.consume(J),$.exit("lineEnding"),o0($,Z,"linePrefix")}}var m7={name:"thematicBreak",tokenize:E90};function E90($,Z,H){let J=0,B;return Q;function Q(U){return $.enter("thematicBreak"),z(U)}function z(U){return B=U,X(U)}function X(U){if(U===B)return $.enter("thematicBreakSequence"),G(U);if(J>=3&&(U===null||x0(U)))return $.exit("thematicBreak"),Z(U);return H(U)}function G(U){if(U===B)return $.consume(U),J++,G;return $.exit("thematicBreakSequence"),e0(U)?o0($,X,"whitespace")(U):X(U)}}var a4={continuation:{tokenize:R90},exit:y90,name:"list",tokenize:k90},S90={partial:!0,tokenize:h90},I90={partial:!0,tokenize:b90};function k90($,Z,H){let J=this,B=J.events[J.events.length-1],Q=B&&B[1].type==="linePrefix"?B[2].sliceSerialize(B[1],!0).length:0,z=0;return X;function X(W){let A=J.containerState.type||(W===42||W===43||W===45?"listUnordered":"listOrdered");if(A==="listUnordered"?!J.containerState.marker||W===J.containerState.marker:KB(W)){if(!J.containerState.type)J.containerState.type=A,$.enter(A,{_container:!0});if(A==="listUnordered")return $.enter("listItemPrefix"),W===42||W===45?$.check(m7,H,U)(W):U(W);if(!J.interrupt||W===49)return $.enter("listItemPrefix"),$.enter("listItemValue"),G(W)}return H(W)}function G(W){if(KB(W)&&++z<10)return $.consume(W),G;if((!J.interrupt||z<2)&&(J.containerState.marker?W===J.containerState.marker:W===41||W===46))return $.exit("listItemValue"),U(W);return H(W)}function U(W){return $.enter("listItemMarker"),$.consume(W),$.exit("listItemMarker"),J.containerState.marker=J.containerState.marker||W,$.check(w9,J.interrupt?H:K,$.attempt(S90,Y,F))}function K(W){return J.containerState.initialBlankLine=!0,Q++,Y(W)}function F(W){if(e0(W))return $.enter("listItemPrefixWhitespace"),$.consume(W),$.exit("listItemPrefixWhitespace"),Y;return H(W)}function Y(W){return J.containerState.size=Q+J.sliceSerialize($.exit("listItemPrefix"),!0).length,Z(W)}}function R90($,Z,H){let J=this;return J.containerState._closeFlow=void 0,$.check(w9,B,Q);function B(X){return J.containerState.furtherBlankLines=J.containerState.furtherBlankLines||J.containerState.initialBlankLine,o0($,Z,"listItemIndent",J.containerState.size+1)(X)}function Q(X){if(J.containerState.furtherBlankLines||!e0(X))return J.containerState.furtherBlankLines=void 0,J.containerState.initialBlankLine=void 0,z(X);return J.containerState.furtherBlankLines=void 0,J.containerState.initialBlankLine=void 0,$.attempt(I90,Z,z)(X)}function z(X){return J.containerState._closeFlow=!0,J.interrupt=void 0,o0($,$.attempt(a4,Z,H),"linePrefix",J.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(X)}}function b90($,Z,H){let J=this;return o0($,B,"listItemIndent",J.containerState.size+1);function B(Q){let z=J.events[J.events.length-1];return z&&z[1].type==="listItemIndent"&&z[2].sliceSerialize(z[1],!0).length===J.containerState.size?Z(Q):H(Q)}}function y90($){$.exit(this.containerState.type)}function h90($,Z,H){let J=this;return o0($,B,"listItemPrefixWhitespace",J.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function B(Q){let z=J.events[J.events.length-1];return!e0(Q)&&z&&z[1].type==="listItemPrefixWhitespace"?Z(Q):H(Q)}}var TK={name:"setextUnderline",resolveTo:x90,tokenize:v90};function x90($,Z){let H=$.length,J,B,Q;while(H--)if($[H][0]==="enter"){if($[H][1].type==="content"){J=H;break}if($[H][1].type==="paragraph")B=H}else{if($[H][1].type==="content")$.splice(H,1);if(!Q&&$[H][1].type==="definition")Q=H}let z={type:"setextHeading",start:{...$[J][1].start},end:{...$[$.length-1][1].end}};if($[B][1].type="setextHeadingText",Q)$.splice(B,0,["enter",z,Z]),$.splice(Q+1,0,["exit",$[J][1],Z]),$[J][1].end={...$[Q][1].end};else $[J][1]=z;return $.push(["exit",z,Z]),$}function v90($,Z,H){let J=this,B;return Q;function Q(U){let K=J.events.length,F;while(K--)if(J.events[K][1].type!=="lineEnding"&&J.events[K][1].type!=="linePrefix"&&J.events[K][1].type!=="content"){F=J.events[K][1].type==="paragraph";break}if(!J.parser.lazy[J.now().line]&&(J.interrupt||F))return $.enter("setextHeadingLine"),B=U,z(U);return H(U)}function z(U){return $.enter("setextHeadingLineSequence"),X(U)}function X(U){if(U===B)return $.consume(U),X;return $.exit("setextHeadingLineSequence"),e0(U)?o0($,G,"lineSuffix")(U):G(U)}function G(U){if(U===null||x0(U))return $.exit("setextHeadingLine"),Z(U);return H(U)}}var Ph={tokenize:g90};function g90($){let Z=this,H=$.attempt(w9,J,$.attempt(this.parser.constructs.flowInitial,B,o0($,$.attempt(this.parser.constructs.flow,B,$.attempt(FL,B)),"linePrefix")));return H;function J(Q){if(Q===null){$.consume(Q);return}return $.enter("lineEndingBlank"),$.consume(Q),$.exit("lineEndingBlank"),Z.currentConstruct=void 0,H}function B(Q){if(Q===null){$.consume(Q);return}return $.enter("lineEnding"),$.consume(Q),$.exit("lineEnding"),Z.currentConstruct=void 0,H}}var _h={resolveAll:Ch()},jh=Th("string"),Oh=Th("text");function Th($){return{resolveAll:Ch($==="text"?f90:void 0),tokenize:Z};function Z(H){let J=this,B=this.parser.constructs[$],Q=H.attempt(B,z,X);return z;function z(K){return U(K)?Q(K):X(K)}function X(K){if(K===null){H.consume(K);return}return H.enter("data"),H.consume(K),G}function G(K){if(U(K))return H.exit("data"),Q(K);return H.consume(K),G}function U(K){if(K===null)return!0;let F=B[K],Y=-1;if(F)while(++Y<F.length){let W=F[Y];if(!W.previous||W.previous.call(J,J.previous))return!0}return!1}}}function Ch($){return Z;function Z(H,J){let B=-1,Q;while(++B<=H.length)if(Q===void 0){if(H[B]&&H[B][1].type==="data")Q=B,B++}else if(!H[B]||H[B][1].type!=="data"){if(B!==Q+2)H[Q][1].end=H[B-1][1].end,H.splice(Q+2,B-Q-2),B=Q+2;Q=void 0}return $?$(H,J):H}}function f90($,Z){let H=0;while(++H<=$.length)if((H===$.length||$[H][1].type==="lineEnding")&&$[H-1][1].type==="data"){let J=$[H-1][1],B=Z.sliceStream(J),Q=B.length,z=-1,X=0,G;while(Q--){let U=B[Q];if(typeof U==="string"){z=U.length;while(U.charCodeAt(z-1)===32)X++,z--;if(z)break;z=-1}else if(U===-2)G=!0,X++;else if(U===-1);else{Q++;break}}if(Z._contentTypeTextTrailing&&H===$.length)X=0;if(X){let U={type:H===$.length||G||X<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:Q?z:J.start._bufferIndex+z,_index:J.start._index+Q,line:J.end.line,column:J.end.column-X,offset:J.end.offset-X},end:{...J.end}};if(J.end={...U.start},J.start.offset===J.end.offset)Object.assign(J,U);else $.splice(H,0,["enter",U,Z],["exit",U,Z]),H+=2}H++}return $}var ML={};g5(ML,{text:()=>l90,string:()=>d90,insideSpan:()=>i90,flowInitial:()=>p90,flow:()=>c90,document:()=>m90,disable:()=>a90,contentInitial:()=>u90,attentionMarkers:()=>r90});var m90={[42]:a4,[43]:a4,[45]:a4,[48]:a4,[49]:a4,[50]:a4,[51]:a4,[52]:a4,[53]:a4,[54]:a4,[55]:a4,[56]:a4,[57]:a4,[62]:LK},u90={[91]:YL},p90={[-2]:YB,[-1]:YB,[32]:YB},c90={[35]:AL,[42]:m7,[45]:[TK,m7],[60]:VL,[61]:TK,[95]:m7,[96]:MK,[126]:MK},d90={[38]:qK,[92]:DK},l90={[-5]:AB,[-4]:AB,[-3]:AB,[33]:DL,[38]:qK,[42]:FB,[60]:[GL,LL],[91]:qL,[92]:[WL,DK],[93]:f7,[95]:FB,[96]:UL},i90={null:[FB,_h]},r90={null:[42,95]},a90={null:[]};function wh($,Z,H){let J={_bufferIndex:-1,_index:0,line:H&&H.line||1,column:H&&H.column||1,offset:H&&H.offset||0},B={},Q=[],z=[],X=[],G=!0,U={attempt:k(T),check:k(C),consume:j,enter:M,exit:P,interrupt:k(C,{interrupt:!0})},K={code:null,containerState:{},defineSkip:V,events:[],now:L,parser:$,previous:null,sliceSerialize:A,sliceStream:N,write:W},F=Z.tokenize.call(K,U),Y;if(Z.resolveAll)Q.push(Z);return K;function W(R){if(z=K2(z,R),D(),z[z.length-1]!==null)return[];return E(Z,0),K.events=V6(Q,K.events,K),K.events}function A(R,w){return o90(N(R),w)}function N(R){return n90(z,R)}function L(){let{_bufferIndex:R,_index:w,line:S,column:I,offset:y}=J;return{_bufferIndex:R,_index:w,line:S,column:I,offset:y}}function V(R){B[R.line]=R.column,x()}function D(){let R;while(J._index<z.length){let w=z[J._index];if(typeof w==="string"){if(R=J._index,J._bufferIndex<0)J._bufferIndex=0;while(J._index===R&&J._bufferIndex<w.length)q(w.charCodeAt(J._bufferIndex))}else q(w)}}function q(R){G=void 0,Y=R,F=F(R)}function j(R){if(x0(R))J.line++,J.column=1,J.offset+=R===-3?2:1,x();else if(R!==-1)J.column++,J.offset++;if(J._bufferIndex<0)J._index++;else if(J._bufferIndex++,J._bufferIndex===z[J._index].length)J._bufferIndex=-1,J._index++;K.previous=R,G=!0}function M(R,w){let S=w||{};return S.type=R,S.start=L(),K.events.push(["enter",S,K]),X.push(S),S}function P(R){let w=X.pop();return w.end=L(),K.events.push(["exit",w,K]),w}function T(R,w){E(R,w.from)}function C(R,w){w.restore()}function k(R,w){return S;function S(I,y,f){let g,O,c,o;return Array.isArray(I)?d(I):("tokenize"in I)?d([I]):b(I);function b(n){return Q0;function Q0(Z0){let U0=Z0!==null&&n[Z0],B0=Z0!==null&&n.null,Y0=[...Array.isArray(U0)?U0:U0?[U0]:[],...Array.isArray(B0)?B0:B0?[B0]:[]];return d(Y0)(Z0)}}function d(n){if(g=n,O=0,n.length===0)return f;return t(n[O])}function t(n){return Q0;function Q0(Z0){if(o=h(),c=n,!n.partial)K.currentConstruct=n;if(n.name&&K.parser.constructs.disable.null.includes(n.name))return a(Z0);return n.tokenize.call(w?Object.assign(Object.create(K),w):K,U,u,a)(Z0)}}function u(n){return G=!0,R(c,o),y}function a(n){if(G=!0,o.restore(),++O<g.length)return t(g[O]);return f}}}function E(R,w){if(R.resolveAll&&!Q.includes(R))Q.push(R);if(R.resolve)r5(K.events,w,K.events.length-w,R.resolve(K.events.slice(w),K));if(R.resolveTo)K.events=R.resolveTo(K.events,K)}function h(){let R=L(),w=K.previous,S=K.currentConstruct,I=K.events.length,y=Array.from(X);return{from:I,restore:f};function f(){J=R,K.previous=w,K.currentConstruct=S,K.events.length=I,X=y,x()}}function x(){if(J.line in B&&J.column<2)J.column=B[J.line],J.offset+=B[J.line]-1}}function n90($,Z){let H=Z.start._index,J=Z.start._bufferIndex,B=Z.end._index,Q=Z.end._bufferIndex,z;if(H===B)z=[$[H].slice(J,Q)];else{if(z=$.slice(H,B),J>-1){let X=z[0];if(typeof X==="string")z[0]=X.slice(J);else z.shift()}if(Q>0)z.push($[B].slice(0,Q))}return z}function o90($,Z){let H=-1,J=[],B;while(++H<$.length){let Q=$[H],z;if(typeof Q==="string")z=Q;else switch(Q){case-5:{z="\r";break}case-4:{z=`
19
- `;break}case-3:{z=`\r
20
- `;break}case-2:{z=Z?" ":"\t";break}case-1:{if(!Z&&B)continue;z=" ";break}default:z=String.fromCharCode(Q)}B=Q===-2,J.push(z)}return J.join("")}function PL($){let J={constructs:NK([ML,...($||{}).extensions||[]]),content:B(Nh),defined:[],document:B(Lh),flow:B(Ph),lazy:{},string:B(jh),text:B(Oh)};return J;function B(Q){return z;function z(X){return wh(J,Q,X)}}}function _L($){while(!PK($));return $}var Eh=/[\0\t\n\r]/g;function jL(){let $=1,Z="",H=!0,J;return B;function B(Q,z,X){let G=[],U,K,F,Y,W;if(Q=Z+(typeof Q==="string"?Q.toString():new TextDecoder(z||void 0).decode(Q)),F=0,Z="",H){if(Q.charCodeAt(0)===65279)F++;H=void 0}while(F<Q.length){if(Eh.lastIndex=F,U=Eh.exec(Q),Y=U&&U.index!==void 0?U.index:Q.length,W=Q.charCodeAt(Y),!U){Z=Q.slice(F);break}if(W===10&&F===Y&&J)G.push(-3),J=void 0;else{if(J)G.push(-5),J=void 0;if(F<Y)G.push(Q.slice(F,Y)),$+=Y-F;switch(W){case 0:{G.push(65533),$++;break}case 9:{K=Math.ceil($/4)*4,G.push(-2);while($++<K)G.push(-1);break}case 10:{G.push(-4),$=1;break}default:J=!0,$=1}}F=Y+1}if(X){if(J)G.push(-5);if(Z)G.push(Z);G.push(null)}return G}}var s90=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function Sh($){return $.replace(s90,t90)}function t90($,Z,H){if(Z)return Z;if(H.charCodeAt(0)===35){let B=H.charCodeAt(1),Q=B===120||B===88;return VK(H.slice(Q?2:1),Q?16:10)}return wZ(H)||$}var kh={}.hasOwnProperty;function OL($,Z,H){if(Z&&typeof Z==="object")H=Z,Z=void 0;return e90(H)(_L(PL(H).document().write(jL()($,Z,!0))))}function e90($){let Z={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:Q(e),autolinkProtocol:k,autolinkEmail:k,atxHeading:Q(D0),blockQuote:Q(Z0),characterEscape:k,characterReference:k,codeFenced:Q(U0),codeFencedFenceInfo:z,codeFencedFenceMeta:z,codeIndented:Q(U0,z),codeText:Q(B0,z),codeTextData:k,data:k,codeFlowValue:k,definition:Q(Y0),definitionDestinationString:z,definitionLabelString:z,definitionTitleString:z,emphasis:Q(A0),hardBreakEscape:Q(X0),hardBreakTrailing:Q(X0),htmlFlow:Q(i,z),htmlFlowData:k,htmlText:Q(i,z),htmlTextData:k,image:Q(l),label:z,link:Q(e),listItem:Q(H0),listItemValue:Y,listOrdered:Q($0,F),listUnordered:Q($0),paragraph:Q(O0),reference:b,referenceString:z,resourceDestinationString:z,resourceTitleString:z,setextHeading:Q(D0),strong:Q(P0),thematicBreak:Q(M0)},exit:{atxHeading:G(),atxHeadingSequence:M,autolink:G(),autolinkEmail:Q0,autolinkProtocol:n,blockQuote:G(),characterEscapeValue:E,characterReferenceMarkerHexadecimal:t,characterReferenceMarkerNumeric:t,characterReferenceValue:u,characterReference:a,codeFenced:G(L),codeFencedFence:N,codeFencedFenceInfo:W,codeFencedFenceMeta:A,codeFlowValue:E,codeIndented:G(V),codeText:G(S),codeTextData:E,data:E,definition:G(),definitionDestinationString:j,definitionLabelString:D,definitionTitleString:q,emphasis:G(),hardBreakEscape:G(x),hardBreakTrailing:G(x),htmlFlow:G(R),htmlFlowData:E,htmlText:G(w),htmlTextData:E,image:G(y),label:g,labelText:f,lineEnding:h,link:G(I),listItem:G(),listOrdered:G(),listUnordered:G(),paragraph:G(),referenceString:d,resourceDestinationString:O,resourceTitleString:c,resource:o,setextHeading:G(C),setextHeadingLineSequence:T,setextHeadingText:P,strong:G(),thematicBreak:G()}};Rh(Z,($||{}).mdastExtensions||[]);let H={};return J;function J(v){let m={type:"root",children:[]},s={stack:[m],tokenStack:[],config:Z,enter:X,exit:U,buffer:z,resume:K,data:H},G0=[],j0=-1;while(++j0<v.length)if(v[j0][1].type==="listOrdered"||v[j0][1].type==="listUnordered")if(v[j0][0]==="enter")G0.push(j0);else{let m0=G0.pop();j0=B(v,m0,j0)}j0=-1;while(++j0<v.length){let m0=Z[v[j0][0]];if(kh.call(m0,v[j0][1].type))m0[v[j0][1].type].call(Object.assign({sliceSerialize:v[j0][2].sliceSerialize},s),v[j0][1])}if(s.tokenStack.length>0){let m0=s.tokenStack[s.tokenStack.length-1];(m0[1]||Ih).call(s,void 0,m0[0])}m.position={start:L6(v.length>0?v[0][1].start:{line:1,column:1,offset:0}),end:L6(v.length>0?v[v.length-2][1].end:{line:1,column:1,offset:0})},j0=-1;while(++j0<Z.transforms.length)m=Z.transforms[j0](m)||m;return m}function B(v,m,s){let G0=m-1,j0=-1,m0=!1,v0,T0,p0,$1;while(++G0<=s){let D1=v[G0];switch(D1[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{if(D1[0]==="enter")j0++;else j0--;$1=void 0;break}case"lineEndingBlank":{if(D1[0]==="enter"){if(v0&&!$1&&!j0&&!p0)p0=G0;$1=void 0}break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:$1=void 0}if(!j0&&D1[0]==="enter"&&D1[1].type==="listItemPrefix"||j0===-1&&D1[0]==="exit"&&(D1[1].type==="listUnordered"||D1[1].type==="listOrdered")){if(v0){let u0=G0;T0=void 0;while(u0--){let N1=v[u0];if(N1[1].type==="lineEnding"||N1[1].type==="lineEndingBlank"){if(N1[0]==="exit")continue;if(T0)v[T0][1].type="lineEndingBlank",m0=!0;N1[1].type="lineEnding",T0=u0}else if(N1[1].type==="linePrefix"||N1[1].type==="blockQuotePrefix"||N1[1].type==="blockQuotePrefixWhitespace"||N1[1].type==="blockQuoteMarker"||N1[1].type==="listItemIndent");else break}if(p0&&(!T0||p0<T0))v0._spread=!0;v0.end=Object.assign({},T0?v[T0][1].start:D1[1].end),v.splice(T0||G0,0,["exit",v0,D1[2]]),G0++,s++}if(D1[1].type==="listItemPrefix"){let u0={type:"listItem",_spread:!1,start:Object.assign({},D1[1].start),end:void 0};v0=u0,v.splice(G0,0,["enter",u0,D1[2]]),G0++,s++,p0=void 0,$1=!0}}}return v[m][1]._spread=m0,s}function Q(v,m){return s;function s(G0){if(X.call(this,v(G0),G0),m)m.call(this,G0)}}function z(){this.stack.push({type:"fragment",children:[]})}function X(v,m,s){this.stack[this.stack.length-1].children.push(v),this.stack.push(v),this.tokenStack.push([m,s||void 0]),v.position={start:L6(m.start),end:void 0}}function G(v){return m;function m(s){if(v)v.call(this,s);U.call(this,s)}}function U(v,m){let s=this.stack.pop(),G0=this.tokenStack.pop();if(!G0)throw Error("Cannot close `"+v.type+"` ("+A6({start:v.start,end:v.end})+"): it’s not open");else if(G0[0].type!==v.type)if(m)m.call(this,v,G0[0]);else(G0[1]||Ih).call(this,v,G0[0]);s.position.end=L6(v.end)}function K(){return h7(this.stack.pop())}function F(){this.data.expectingFirstListItemValue=!0}function Y(v){if(this.data.expectingFirstListItemValue){let m=this.stack[this.stack.length-2];m.start=Number.parseInt(this.sliceSerialize(v),10),this.data.expectingFirstListItemValue=void 0}}function W(){let v=this.resume(),m=this.stack[this.stack.length-1];m.lang=v}function A(){let v=this.resume(),m=this.stack[this.stack.length-1];m.meta=v}function N(){if(this.data.flowCodeInside)return;this.buffer(),this.data.flowCodeInside=!0}function L(){let v=this.resume(),m=this.stack[this.stack.length-1];m.value=v.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function V(){let v=this.resume(),m=this.stack[this.stack.length-1];m.value=v.replace(/(\r?\n|\r)$/g,"")}function D(v){let m=this.resume(),s=this.stack[this.stack.length-1];s.label=m,s.identifier=r4(this.sliceSerialize(v)).toLowerCase()}function q(){let v=this.resume(),m=this.stack[this.stack.length-1];m.title=v}function j(){let v=this.resume(),m=this.stack[this.stack.length-1];m.url=v}function M(v){let m=this.stack[this.stack.length-1];if(!m.depth){let s=this.sliceSerialize(v).length;m.depth=s}}function P(){this.data.setextHeadingSlurpLineEnding=!0}function T(v){let m=this.stack[this.stack.length-1];m.depth=this.sliceSerialize(v).codePointAt(0)===61?1:2}function C(){this.data.setextHeadingSlurpLineEnding=void 0}function k(v){let s=this.stack[this.stack.length-1].children,G0=s[s.length-1];if(!G0||G0.type!=="text")G0=N0(),G0.position={start:L6(v.start),end:void 0},s.push(G0);this.stack.push(G0)}function E(v){let m=this.stack.pop();m.value+=this.sliceSerialize(v),m.position.end=L6(v.end)}function h(v){let m=this.stack[this.stack.length-1];if(this.data.atHardBreak){let s=m.children[m.children.length-1];s.position.end=L6(v.end),this.data.atHardBreak=void 0;return}if(!this.data.setextHeadingSlurpLineEnding&&Z.canContainEols.includes(m.type))k.call(this,v),E.call(this,v)}function x(){this.data.atHardBreak=!0}function R(){let v=this.resume(),m=this.stack[this.stack.length-1];m.value=v}function w(){let v=this.resume(),m=this.stack[this.stack.length-1];m.value=v}function S(){let v=this.resume(),m=this.stack[this.stack.length-1];m.value=v}function I(){let v=this.stack[this.stack.length-1];if(this.data.inReference){let m=this.data.referenceType||"shortcut";v.type+="Reference",v.referenceType=m,delete v.url,delete v.title}else delete v.identifier,delete v.label;this.data.referenceType=void 0}function y(){let v=this.stack[this.stack.length-1];if(this.data.inReference){let m=this.data.referenceType||"shortcut";v.type+="Reference",v.referenceType=m,delete v.url,delete v.title}else delete v.identifier,delete v.label;this.data.referenceType=void 0}function f(v){let m=this.sliceSerialize(v),s=this.stack[this.stack.length-2];s.label=Sh(m),s.identifier=r4(m).toLowerCase()}function g(){let v=this.stack[this.stack.length-1],m=this.resume(),s=this.stack[this.stack.length-1];if(this.data.inReference=!0,s.type==="link"){let G0=v.children;s.children=G0}else s.alt=m}function O(){let v=this.resume(),m=this.stack[this.stack.length-1];m.url=v}function c(){let v=this.resume(),m=this.stack[this.stack.length-1];m.title=v}function o(){this.data.inReference=void 0}function b(){this.data.referenceType="collapsed"}function d(v){let m=this.resume(),s=this.stack[this.stack.length-1];s.label=m,s.identifier=r4(this.sliceSerialize(v)).toLowerCase(),this.data.referenceType="full"}function t(v){this.data.characterReferenceType=v.type}function u(v){let m=this.sliceSerialize(v),s=this.data.characterReferenceType,G0;if(s)G0=VK(m,s==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0;else G0=wZ(m);let j0=this.stack[this.stack.length-1];j0.value+=G0}function a(v){let m=this.stack.pop();m.position.end=L6(v.end)}function n(v){E.call(this,v);let m=this.stack[this.stack.length-1];m.url=this.sliceSerialize(v)}function Q0(v){E.call(this,v);let m=this.stack[this.stack.length-1];m.url="mailto:"+this.sliceSerialize(v)}function Z0(){return{type:"blockquote",children:[]}}function U0(){return{type:"code",lang:null,meta:null,value:""}}function B0(){return{type:"inlineCode",value:""}}function Y0(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function A0(){return{type:"emphasis",children:[]}}function D0(){return{type:"heading",depth:0,children:[]}}function X0(){return{type:"break"}}function i(){return{type:"html",value:""}}function l(){return{type:"image",title:null,url:"",alt:null}}function e(){return{type:"link",title:null,url:"",children:[]}}function $0(v){return{type:"list",ordered:v.type==="listOrdered",start:null,spread:v._spread,children:[]}}function H0(v){return{type:"listItem",spread:v._spread,checked:null,children:[]}}function O0(){return{type:"paragraph",children:[]}}function P0(){return{type:"strong",children:[]}}function N0(){return{type:"text",value:""}}function M0(){return{type:"thematicBreak"}}}function L6($){return{line:$.line,column:$.column,offset:$.offset}}function Rh($,Z){let H=-1;while(++H<Z.length){let J=Z[H];if(Array.isArray(J))Rh($,J);else $30($,J)}}function $30($,Z){let H;for(H in Z)if(kh.call(Z,H))switch(H){case"canContainEols":{let J=Z[H];if(J)$[H].push(...J);break}case"transforms":{let J=Z[H];if(J)$[H].push(...J);break}case"enter":case"exit":{let J=Z[H];if(J)Object.assign($[H],J);break}}}function Ih($,Z){if($)throw Error("Cannot close `"+$.type+"` ("+A6({start:$.start,end:$.end})+"): a different token (`"+Z.type+"`, "+A6({start:Z.start,end:Z.end})+") is open");else throw Error("Cannot close document, a token (`"+Z.type+"`, "+A6({start:Z.start,end:Z.end})+") is still open")}function CK($){let Z=this;Z.parser=H;function H(J){return OL(J,{...Z.data("settings"),...$,extensions:Z.data("micromarkExtensions")||[],mdastExtensions:Z.data("fromMarkdownExtensions")||[]})}}var wK=-1,EZ=0,u7=1,SZ=2,NB=3,VB=4,LB=5,DB=6,EK=7,SK=8;var bh=typeof self==="object"?self:globalThis,Z30=($,Z)=>{let H=(B,Q)=>{return $.set(Q,B),B},J=(B)=>{if($.has(B))return $.get(B);let[Q,z]=Z[B];switch(Q){case EZ:case wK:return H(z,B);case u7:{let X=H([],B);for(let G of z)X.push(J(G));return X}case SZ:{let X=H({},B);for(let[G,U]of z)X[J(G)]=J(U);return X}case NB:return H(new Date(z),B);case VB:{let{source:X,flags:G}=z;return H(new RegExp(X,G),B)}case LB:{let X=H(new Map,B);for(let[G,U]of z)X.set(J(G),J(U));return X}case DB:{let X=H(new Set,B);for(let G of z)X.add(J(G));return X}case EK:{let{name:X,message:G}=z;return H(new bh[X](G),B)}case SK:return H(BigInt(z),B);case"BigInt":return H(Object(BigInt(z)),B);case"ArrayBuffer":return H(new Uint8Array(z).buffer,z);case"DataView":{let{buffer:X}=new Uint8Array(z);return H(new DataView(X),z)}}return H(new bh[Q](z),B)};return J},TL=($)=>Z30(new Map,$)(0);var IZ="",{toString:H30}={},{keys:J30}=Object,qB=($)=>{let Z=typeof $;if(Z!=="object"||!$)return[EZ,Z];let H=H30.call($).slice(8,-1);switch(H){case"Array":return[u7,IZ];case"Object":return[SZ,IZ];case"Date":return[NB,IZ];case"RegExp":return[VB,IZ];case"Map":return[LB,IZ];case"Set":return[DB,IZ];case"DataView":return[u7,H]}if(H.includes("Array"))return[u7,H];if(H.includes("Error"))return[EK,H];return[SZ,H]},IK=([$,Z])=>$===EZ&&(Z==="function"||Z==="symbol"),B30=($,Z,H,J)=>{let B=(z,X)=>{let G=J.push(z)-1;return H.set(X,G),G},Q=(z)=>{if(H.has(z))return H.get(z);let[X,G]=qB(z);switch(X){case EZ:{let K=z;switch(G){case"bigint":X=SK,K=z.toString();break;case"function":case"symbol":if($)throw TypeError("unable to serialize "+G);K=null;break;case"undefined":return B([wK],z)}return B([X,K],z)}case u7:{if(G){let Y=z;if(G==="DataView")Y=new Uint8Array(z.buffer);else if(G==="ArrayBuffer")Y=new Uint8Array(z);return B([G,[...Y]],z)}let K=[],F=B([X,K],z);for(let Y of z)K.push(Q(Y));return F}case SZ:{if(G)switch(G){case"BigInt":return B([G,z.toString()],z);case"Boolean":case"Number":case"String":return B([G,z.valueOf()],z)}if(Z&&"toJSON"in z)return Q(z.toJSON());let K=[],F=B([X,K],z);for(let Y of J30(z))if($||!IK(qB(z[Y])))K.push([Q(Y),Q(z[Y])]);return F}case NB:return B([X,z.toISOString()],z);case VB:{let{source:K,flags:F}=z;return B([X,{source:K,flags:F}],z)}case LB:{let K=[],F=B([X,K],z);for(let[Y,W]of z)if($||!(IK(qB(Y))||IK(qB(W))))K.push([Q(Y),Q(W)]);return F}case DB:{let K=[],F=B([X,K],z);for(let Y of z)if($||!IK(qB(Y)))K.push(Q(Y));return F}}let{message:U}=z;return B([X,{name:G,message:U}],z)};return Q},CL=($,{json:Z,lossy:H}={})=>{let J=[];return B30(!(Z||H),!!Z,new Map,J)($),J};var kZ=typeof structuredClone==="function"?($,Z)=>Z&&(("json"in Z)||("lossy"in Z))?TL(CL($,Z)):structuredClone($):($,Z)=>TL(CL($,Z));function Q30($,Z){let H=[{type:"text",value:"↩"}];if(Z>1)H.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(Z)}]});return H}function z30($,Z){return"Back to reference "+($+1)+(Z>1?"-"+Z:"")}function yh($){let Z=typeof $.options.clobberPrefix==="string"?$.options.clobberPrefix:"user-content-",H=$.options.footnoteBackContent||Q30,J=$.options.footnoteBackLabel||z30,B=$.options.footnoteLabel||"Footnotes",Q=$.options.footnoteLabelTagName||"h2",z=$.options.footnoteLabelProperties||{className:["sr-only"]},X=[],G=-1;while(++G<$.footnoteOrder.length){let U=$.footnoteById.get($.footnoteOrder[G]);if(!U)continue;let K=$.all(U),F=String(U.identifier).toUpperCase(),Y=N8(F.toLowerCase()),W=0,A=[],N=$.footnoteCounts.get(F);while(N!==void 0&&++W<=N){if(A.length>0)A.push({type:"text",value:" "});let D=typeof H==="string"?H:H(G,W);if(typeof D==="string")D={type:"text",value:D};A.push({type:"element",tagName:"a",properties:{href:"#"+Z+"fnref-"+Y+(W>1?"-"+W:""),dataFootnoteBackref:"",ariaLabel:typeof J==="string"?J:J(G,W),className:["data-footnote-backref"]},children:Array.isArray(D)?D:[D]})}let L=K[K.length-1];if(L&&L.type==="element"&&L.tagName==="p"){let D=L.children[L.children.length-1];if(D&&D.type==="text")D.value+=" ";else L.children.push({type:"text",value:" "});L.children.push(...A)}else K.push(...A);let V={type:"element",tagName:"li",properties:{id:Z+"fn-"+Y},children:$.wrap(K,!0)};$.patch(U,V),X.push(V)}if(X.length===0)return;return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:Q,properties:{...kZ(z),id:"footnote-label"},children:[{type:"text",value:B}]},{type:"text",value:`
21
- `},{type:"element",tagName:"ol",properties:{},children:$.wrap(X,!0)},{type:"text",value:`
22
- `}]}}var E9=function($){if($===null||$===void 0)return K30;if(typeof $==="function")return kK($);if(typeof $==="object")return Array.isArray($)?X30($):G30($);if(typeof $==="string")return U30($);throw Error("Expected function, string, or object as test")};function X30($){let Z=[],H=-1;while(++H<$.length)Z[H]=E9($[H]);return kK(J);function J(...B){let Q=-1;while(++Q<Z.length)if(Z[Q].apply(this,B))return!0;return!1}}function G30($){let Z=$;return kK(H);function H(J){let B=J,Q;for(Q in $)if(B[Q]!==Z[Q])return!1;return!0}}function U30($){return kK(Z);function Z(H){return H&&H.type===$}}function kK($){return Z;function Z(H,J,B){return Boolean(F30(H)&&$.call(this,H,typeof J==="number"?J:void 0,B||void 0))}}function K30(){return!0}function F30($){return $!==null&&typeof $==="object"&&"type"in $}function hh($){return $}var xh=[],RK=!0,p7=!1,bK="skip";function MB($,Z,H,J){let B;if(typeof Z==="function"&&typeof H!=="function")J=H,H=Z;else B=Z;let Q=E9(B),z=J?-1:1;X($,void 0,[])();function X(G,U,K){let F=G&&typeof G==="object"?G:{};if(typeof F.type==="string"){let W=typeof F.tagName==="string"?F.tagName:typeof F.name==="string"?F.name:void 0;Object.defineProperty(Y,"name",{value:"node ("+hh(G.type+(W?"<"+W+">":""))+")"})}return Y;function Y(){let W=xh,A,N,L;if(!Z||Q(G,U,K[K.length-1]||void 0)){if(W=Y30(H(G,K)),W[0]===p7)return W}if("children"in G&&G.children){let V=G;if(V.children&&W[0]!==bK){N=(J?V.children.length:-1)+z,L=K.concat(V);while(N>-1&&N<V.children.length){let D=V.children[N];if(A=X(D,N,L)(),A[0]===p7)return A;N=typeof A[1]==="number"?A[1]:N+z}}}return W}}}function Y30($){if(Array.isArray($))return $;if(typeof $==="number")return[RK,$];return $===null||$===void 0?xh:[$]}function B3($,Z,H,J){let B,Q,z;if(typeof Z==="function"&&typeof H!=="function")Q=void 0,z=Z,B=H;else Q=Z,z=H,B=J;MB($,Q,X,B);function X(G,U){let K=U[U.length-1],F=K?K.children.indexOf(G):void 0;return z(G,F,K)}}function vh($,Z){let H={type:"element",tagName:"blockquote",properties:{},children:$.wrap($.all(Z),!0)};return $.patch(Z,H),$.applyData(Z,H)}function gh($,Z){let H={type:"element",tagName:"br",properties:{},children:[]};return $.patch(Z,H),[$.applyData(Z,H),{type:"text",value:`
23
- `}]}function fh($,Z){let H=Z.value?Z.value+`
24
- `:"",J={},B=Z.lang?Z.lang.split(/\s+/):[];if(B.length>0)J.className=["language-"+B[0]];let Q={type:"element",tagName:"code",properties:J,children:[{type:"text",value:H}]};if(Z.meta)Q.data={meta:Z.meta};return $.patch(Z,Q),Q=$.applyData(Z,Q),Q={type:"element",tagName:"pre",properties:{},children:[Q]},$.patch(Z,Q),Q}function mh($,Z){let H={type:"element",tagName:"del",properties:{},children:$.all(Z)};return $.patch(Z,H),$.applyData(Z,H)}function uh($,Z){let H={type:"element",tagName:"em",properties:{},children:$.all(Z)};return $.patch(Z,H),$.applyData(Z,H)}function ph($,Z){let H=typeof $.options.clobberPrefix==="string"?$.options.clobberPrefix:"user-content-",J=String(Z.identifier).toUpperCase(),B=N8(J.toLowerCase()),Q=$.footnoteOrder.indexOf(J),z,X=$.footnoteCounts.get(J);if(X===void 0)X=0,$.footnoteOrder.push(J),z=$.footnoteOrder.length;else z=Q+1;X+=1,$.footnoteCounts.set(J,X);let G={type:"element",tagName:"a",properties:{href:"#"+H+"fn-"+B,id:H+"fnref-"+B+(X>1?"-"+X:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(z)}]};$.patch(Z,G);let U={type:"element",tagName:"sup",properties:{},children:[G]};return $.patch(Z,U),$.applyData(Z,U)}function ch($,Z){let H={type:"element",tagName:"h"+Z.depth,properties:{},children:$.all(Z)};return $.patch(Z,H),$.applyData(Z,H)}function dh($,Z){if($.options.allowDangerousHtml){let H={type:"raw",value:Z.value};return $.patch(Z,H),$.applyData(Z,H)}return}function yK($,Z){let H=Z.referenceType,J="]";if(H==="collapsed")J+="[]";else if(H==="full")J+="["+(Z.label||Z.identifier)+"]";if(Z.type==="imageReference")return[{type:"text",value:"!["+Z.alt+J}];let B=$.all(Z),Q=B[0];if(Q&&Q.type==="text")Q.value="["+Q.value;else B.unshift({type:"text",value:"["});let z=B[B.length-1];if(z&&z.type==="text")z.value+=J;else B.push({type:"text",value:J});return B}function lh($,Z){let H=String(Z.identifier).toUpperCase(),J=$.definitionById.get(H);if(!J)return yK($,Z);let B={src:N8(J.url||""),alt:Z.alt};if(J.title!==null&&J.title!==void 0)B.title=J.title;let Q={type:"element",tagName:"img",properties:B,children:[]};return $.patch(Z,Q),$.applyData(Z,Q)}function ih($,Z){let H={src:N8(Z.url)};if(Z.alt!==null&&Z.alt!==void 0)H.alt=Z.alt;if(Z.title!==null&&Z.title!==void 0)H.title=Z.title;let J={type:"element",tagName:"img",properties:H,children:[]};return $.patch(Z,J),$.applyData(Z,J)}function rh($,Z){let H={type:"text",value:Z.value.replace(/\r?\n|\r/g," ")};$.patch(Z,H);let J={type:"element",tagName:"code",properties:{},children:[H]};return $.patch(Z,J),$.applyData(Z,J)}function ah($,Z){let H=String(Z.identifier).toUpperCase(),J=$.definitionById.get(H);if(!J)return yK($,Z);let B={href:N8(J.url||"")};if(J.title!==null&&J.title!==void 0)B.title=J.title;let Q={type:"element",tagName:"a",properties:B,children:$.all(Z)};return $.patch(Z,Q),$.applyData(Z,Q)}function nh($,Z){let H={href:N8(Z.url)};if(Z.title!==null&&Z.title!==void 0)H.title=Z.title;let J={type:"element",tagName:"a",properties:H,children:$.all(Z)};return $.patch(Z,J),$.applyData(Z,J)}function oh($,Z,H){let J=$.all(Z),B=H?W30(H):sh(Z),Q={},z=[];if(typeof Z.checked==="boolean"){let K=J[0],F;if(K&&K.type==="element"&&K.tagName==="p")F=K;else F={type:"element",tagName:"p",properties:{},children:[]},J.unshift(F);if(F.children.length>0)F.children.unshift({type:"text",value:" "});F.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:Z.checked,disabled:!0},children:[]}),Q.className=["task-list-item"]}let X=-1;while(++X<J.length){let K=J[X];if(B||X!==0||K.type!=="element"||K.tagName!=="p")z.push({type:"text",value:`
25
- `});if(K.type==="element"&&K.tagName==="p"&&!B)z.push(...K.children);else z.push(K)}let G=J[J.length-1];if(G&&(B||G.type!=="element"||G.tagName!=="p"))z.push({type:"text",value:`
26
- `});let U={type:"element",tagName:"li",properties:Q,children:z};return $.patch(Z,U),$.applyData(Z,U)}function W30($){let Z=!1;if($.type==="list"){Z=$.spread||!1;let H=$.children,J=-1;while(!Z&&++J<H.length)Z=sh(H[J])}return Z}function sh($){let Z=$.spread;return Z===null||Z===void 0?$.children.length>1:Z}function th($,Z){let H={},J=$.all(Z),B=-1;if(typeof Z.start==="number"&&Z.start!==1)H.start=Z.start;while(++B<J.length){let z=J[B];if(z.type==="element"&&z.tagName==="li"&&z.properties&&Array.isArray(z.properties.className)&&z.properties.className.includes("task-list-item")){H.className=["contains-task-list"];break}}let Q={type:"element",tagName:Z.ordered?"ol":"ul",properties:H,children:$.wrap(J,!0)};return $.patch(Z,Q),$.applyData(Z,Q)}function eh($,Z){let H={type:"element",tagName:"p",properties:{},children:$.all(Z)};return $.patch(Z,H),$.applyData(Z,H)}function $x($,Z){let H={type:"root",children:$.wrap($.all(Z))};return $.patch(Z,H),$.applyData(Z,H)}function Zx($,Z){let H={type:"element",tagName:"strong",properties:{},children:$.all(Z)};return $.patch(Z,H),$.applyData(Z,H)}function Hx($,Z){let H=$.all(Z),J=H.shift(),B=[];if(J){let z={type:"element",tagName:"thead",properties:{},children:$.wrap([J],!0)};$.patch(Z.children[0],z),B.push(z)}if(H.length>0){let z={type:"element",tagName:"tbody",properties:{},children:$.wrap(H,!0)},X=CZ(Z.children[1]),G=AK(Z.children[Z.children.length-1]);if(X&&G)z.position={start:X,end:G};B.push(z)}let Q={type:"element",tagName:"table",properties:{},children:$.wrap(B,!0)};return $.patch(Z,Q),$.applyData(Z,Q)}function Jx($,Z,H){let J=H?H.children:void 0,Q=(J?J.indexOf(Z):1)===0?"th":"td",z=H&&H.type==="table"?H.align:void 0,X=z?z.length:Z.children.length,G=-1,U=[];while(++G<X){let F=Z.children[G],Y={},W=z?z[G]:void 0;if(W)Y.align=W;let A={type:"element",tagName:Q,properties:Y,children:[]};if(F)A.children=$.all(F),$.patch(F,A),A=$.applyData(F,A);U.push(A)}let K={type:"element",tagName:"tr",properties:{},children:$.wrap(U,!0)};return $.patch(Z,K),$.applyData(Z,K)}function Bx($,Z){let H={type:"element",tagName:"td",properties:{},children:$.all(Z)};return $.patch(Z,H),$.applyData(Z,H)}function zx($){let Z=String($),H=/\r?\n|\r/g,J=H.exec(Z),B=0,Q=[];while(J)Q.push(Qx(Z.slice(B,J.index),B>0,!0),J[0]),B=J.index+J[0].length,J=H.exec(Z);return Q.push(Qx(Z.slice(B),B>0,!1)),Q.join("")}function Qx($,Z,H){let J=0,B=$.length;if(Z){let Q=$.codePointAt(J);while(Q===9||Q===32)J++,Q=$.codePointAt(J)}if(H){let Q=$.codePointAt(B-1);while(Q===9||Q===32)B--,Q=$.codePointAt(B-1)}return B>J?$.slice(J,B):""}function Xx($,Z){let H={type:"text",value:zx(String(Z.value))};return $.patch(Z,H),$.applyData(Z,H)}function Gx($,Z){let H={type:"element",tagName:"hr",properties:{},children:[]};return $.patch(Z,H),$.applyData(Z,H)}var Ux={blockquote:vh,break:gh,code:fh,delete:mh,emphasis:uh,footnoteReference:ph,heading:ch,html:dh,imageReference:lh,image:ih,inlineCode:rh,linkReference:ah,link:nh,listItem:oh,list:th,paragraph:eh,root:$x,strong:Zx,table:Hx,tableCell:Bx,tableRow:Jx,text:Xx,thematicBreak:Gx,toml:hK,yaml:hK,definition:hK,footnoteDefinition:hK};function hK(){return}var wL={}.hasOwnProperty,A30={};function Fx($,Z){let H=Z||A30,J=new Map,B=new Map,Q=new Map,z={...Ux,...H.handlers},X={all:U,applyData:V30,definitionById:J,footnoteById:B,footnoteCounts:Q,footnoteOrder:[],handlers:z,one:G,options:H,patch:N30,wrap:D30};return B3($,function(K){if(K.type==="definition"||K.type==="footnoteDefinition"){let F=K.type==="definition"?J:B,Y=String(K.identifier).toUpperCase();if(!F.has(Y))F.set(Y,K)}}),X;function G(K,F){let Y=K.type,W=X.handlers[Y];if(wL.call(X.handlers,Y)&&W)return W(X,K,F);if(X.options.passThrough&&X.options.passThrough.includes(Y)){if("children"in K){let{children:N,...L}=K,V=kZ(L);return V.children=X.all(K),V}return kZ(K)}return(X.options.unknownHandler||L30)(X,K,F)}function U(K){let F=[];if("children"in K){let Y=K.children,W=-1;while(++W<Y.length){let A=X.one(Y[W],K);if(A){if(W&&Y[W-1].type==="break"){if(!Array.isArray(A)&&A.type==="text")A.value=Kx(A.value);if(!Array.isArray(A)&&A.type==="element"){let N=A.children[0];if(N&&N.type==="text")N.value=Kx(N.value)}}if(Array.isArray(A))F.push(...A);else F.push(A)}}}return F}}function N30($,Z){if($.position)Z.position=HL($)}function V30($,Z){let H=Z;if($&&$.data){let J=$.data.hName,B=$.data.hChildren,Q=$.data.hProperties;if(typeof J==="string")if(H.type==="element")H.tagName=J;else{let z="children"in H?H.children:[H];H={type:"element",tagName:J,properties:{},children:z}}if(H.type==="element"&&Q)Object.assign(H.properties,kZ(Q));if("children"in H&&H.children&&B!==null&&B!==void 0)H.children=B}return H}function L30($,Z){let H=Z.data||{},J="value"in Z&&!(wL.call(H,"hProperties")||wL.call(H,"hChildren"))?{type:"text",value:Z.value}:{type:"element",tagName:"div",properties:{},children:$.all(Z)};return $.patch(Z,J),$.applyData(Z,J)}function D30($,Z){let H=[],J=-1;if(Z)H.push({type:"text",value:`
27
- `});while(++J<$.length){if(J)H.push({type:"text",value:`
28
- `});H.push($[J])}if(Z&&$.length>0)H.push({type:"text",value:`
29
- `});return H}function Kx($){let Z=0,H=$.charCodeAt(Z);while(H===9||H===32)Z++,H=$.charCodeAt(Z);return $.slice(Z)}function xK($,Z){let H=Fx($,Z),J=H.one($,void 0),B=yh(H),Q=Array.isArray(J)?{type:"root",children:J}:J||{type:"root",children:[]};if(B)t1("children"in Q),Q.children.push({type:"text",value:`
30
- `},B);return Q}function vK($,Z){if($&&"run"in $)return async function(H,J){let B=xK(H,{file:J,...Z});await $.run(B,J)};return function(H,J){return xK(H,{file:J,...$||Z})}}function EL($){if($)throw $}var mK=_(Mx(),1);function PB($){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 SL(){let $=[],Z={run:H,use:J};return Z;function H(...B){let Q=-1,z=B.pop();if(typeof z!=="function")throw TypeError("Expected function as last argument, not "+z);X(null,...B);function X(G,...U){let K=$[++Q],F=-1;if(G){z(G);return}while(++F<B.length)if(U[F]===null||U[F]===void 0)U[F]=B[F];if(B=U,K)Px(K,X)(...U);else z(null,...U)}}function J(B){if(typeof B!=="function")throw TypeError("Expected `middelware` to be a function, not "+B);return $.push(B),Z}}function Px($,Z){let H;return J;function J(...z){let X=$.length>z.length,G;if(X)z.push(B);try{G=$.apply(this,z)}catch(U){let K=U;if(X&&H)throw K;return B(K)}if(!X)if(G&&G.then&&typeof G.then==="function")G.then(Q,B);else if(G instanceof Error)B(G);else Q(G)}function B(z,...X){if(!H)H=!0,Z(z,...X)}function Q(z){B(null,z)}}var h8={basename:q30,dirname:M30,extname:P30,join:_30,sep:"/"};function q30($,Z){if(Z!==void 0&&typeof Z!=="string")throw TypeError('"ext" argument must be a string');_B($);let H=0,J=-1,B=$.length,Q;if(Z===void 0||Z.length===0||Z.length>$.length){while(B--)if($.codePointAt(B)===47){if(Q){H=B+1;break}}else if(J<0)Q=!0,J=B+1;return J<0?"":$.slice(H,J)}if(Z===$)return"";let z=-1,X=Z.length-1;while(B--)if($.codePointAt(B)===47){if(Q){H=B+1;break}}else{if(z<0)Q=!0,z=B+1;if(X>-1)if($.codePointAt(B)===Z.codePointAt(X--)){if(X<0)J=B}else X=-1,J=z}if(H===J)J=z;else if(J<0)J=$.length;return $.slice(H,J)}function M30($){if(_B($),$.length===0)return".";let Z=-1,H=$.length,J;while(--H)if($.codePointAt(H)===47){if(J){Z=H;break}}else if(!J)J=!0;return Z<0?$.codePointAt(0)===47?"/":".":Z===1&&$.codePointAt(0)===47?"//":$.slice(0,Z)}function P30($){_B($);let Z=$.length,H=-1,J=0,B=-1,Q=0,z;while(Z--){let X=$.codePointAt(Z);if(X===47){if(z){J=Z+1;break}continue}if(H<0)z=!0,H=Z+1;if(X===46){if(B<0)B=Z;else if(Q!==1)Q=1}else if(B>-1)Q=-1}if(B<0||H<0||Q===0||Q===1&&B===H-1&&B===J+1)return"";return $.slice(B,H)}function _30(...$){let Z=-1,H;while(++Z<$.length)if(_B($[Z]),$[Z])H=H===void 0?$[Z]:H+"/"+$[Z];return H===void 0?".":j30(H)}function j30($){_B($);let Z=$.codePointAt(0)===47,H=O30($,!Z);if(H.length===0&&!Z)H=".";if(H.length>0&&$.codePointAt($.length-1)===47)H+="/";return Z?"/"+H:H}function O30($,Z){let H="",J=0,B=-1,Q=0,z=-1,X,G;while(++z<=$.length){if(z<$.length)X=$.codePointAt(z);else if(X===47)break;else X=47;if(X===47){if(B===z-1||Q===1);else if(B!==z-1&&Q===2){if(H.length<2||J!==2||H.codePointAt(H.length-1)!==46||H.codePointAt(H.length-2)!==46){if(H.length>2){if(G=H.lastIndexOf("/"),G!==H.length-1){if(G<0)H="",J=0;else H=H.slice(0,G),J=H.length-1-H.lastIndexOf("/");B=z,Q=0;continue}}else if(H.length>0){H="",J=0,B=z,Q=0;continue}}if(Z)H=H.length>0?H+"/..":"..",J=2}else{if(H.length>0)H+="/"+$.slice(B+1,z);else H=$.slice(B+1,z);J=z-B-1}B=z,Q=0}else if(X===46&&Q>-1)Q++;else Q=-1}return H}function _B($){if(typeof $!=="string")throw TypeError("Path must be a string. Received "+JSON.stringify($))}var _x={cwd:T30};function T30(){return"/"}function RZ($){return Boolean($!==null&&typeof $==="object"&&"href"in $&&$.href&&"protocol"in $&&$.protocol&&$.auth===void 0)}function jx($){if(typeof $==="string")$=new URL($);else if(!RZ($)){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 C30($)}function C30($){if($.hostname!==""){let J=TypeError('File URL host must be "localhost" or empty on darwin');throw J.code="ERR_INVALID_FILE_URL_HOST",J}let Z=$.pathname,H=-1;while(++H<Z.length)if(Z.codePointAt(H)===37&&Z.codePointAt(H+1)===50){let J=Z.codePointAt(H+2);if(J===70||J===102){let B=TypeError("File URL path must not include encoded / characters");throw B.code="ERR_INVALID_FILE_URL_PATH",B}}return decodeURIComponent(Z)}var IL=["history","path","basename","stem","extname","dirname"];class bZ{constructor($){let Z;if(!$)Z={};else if(RZ($))Z={path:$};else if(typeof $==="string"||w30($))Z={value:$};else Z=$;this.cwd="cwd"in Z?"":_x.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let H=-1;while(++H<IL.length){let B=IL[H];if(B in Z&&Z[B]!==void 0&&Z[B]!==null)this[B]=B==="history"?[...Z[B]]:Z[B]}let J;for(J in Z)if(!IL.includes(J))this[J]=Z[J]}get basename(){return typeof this.path==="string"?h8.basename(this.path):void 0}set basename($){RL($,"basename"),kL($,"basename"),this.path=h8.join(this.dirname||"",$)}get dirname(){return typeof this.path==="string"?h8.dirname(this.path):void 0}set dirname($){Ox(this.basename,"dirname"),this.path=h8.join($||"",this.basename)}get extname(){return typeof this.path==="string"?h8.extname(this.path):void 0}set extname($){if(kL($,"extname"),Ox(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=h8.join(this.dirname,this.stem+($||""))}get path(){return this.history[this.history.length-1]}set path($){if(RZ($))$=jx($);if(RL($,"path"),this.path!==$)this.history.push($)}get stem(){return typeof this.path==="string"?h8.basename(this.path,this.extname):void 0}set stem($){RL($,"stem"),kL($,"stem"),this.path=h8.join(this.dirname||"",$+(this.extname||""))}fail($,Z,H){let J=this.message($,Z,H);throw J.fatal=!0,J}info($,Z,H){let J=this.message($,Z,H);return J.fatal=void 0,J}message($,Z,H){let J=new Z4($,Z,H);if(this.path)J.name=this.path+":"+J.name,J.file=this.path;return J.fatal=!1,this.messages.push(J),J}toString($){if(this.value===void 0)return"";if(typeof this.value==="string")return this.value;return new TextDecoder($||void 0).decode(this.value)}}function kL($,Z){if($&&$.includes(h8.sep))throw Error("`"+Z+"` cannot be a path: did not expect `"+h8.sep+"`")}function RL($,Z){if(!$)throw Error("`"+Z+"` cannot be empty")}function Ox($,Z){if(!$)throw Error("Setting `"+Z+"` requires `path` to be set too")}function w30($){return Boolean($&&typeof $==="object"&&"byteLength"in $&&"byteOffset"in $)}var Tx=function($){let J=this.constructor.prototype,B=J[$],Q=function(){return B.apply(Q,arguments)};return Object.setPrototypeOf(Q,J),Q};var E30={}.hasOwnProperty;class xL extends Tx{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=SL()}copy(){let $=new xL,Z=-1;while(++Z<this.attachers.length){let H=this.attachers[Z];$.use(...H)}return $.data(mK.default(!0,{},this.namespace)),$}data($,Z){if(typeof $==="string"){if(arguments.length===2)return hL("data",this.frozen),this.namespace[$]=Z,this;return E30.call(this.namespace,$)&&this.namespace[$]||void 0}if($)return hL("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,...H]=this.attachers[this.freezeIndex];if(H[0]===!1)continue;if(H[0]===!0)H[0]=void 0;let J=Z.call($,...H);if(typeof J==="function")this.transformers.use(J)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse($){this.freeze();let Z=fK($),H=this.parser||this.Parser;return bL("parse",H),H(String(Z),Z)}process($,Z){let H=this;return this.freeze(),bL("process",this.parser||this.Parser),yL("process",this.compiler||this.Compiler),Z?J(void 0,Z):new Promise(J);function J(B,Q){let z=fK($),X=H.parse(z);H.run(X,z,function(U,K,F){if(U||!K||!F)return G(U);let Y=K,W=H.stringify(Y,F);if(I30(W))F.value=W;else F.result=W;G(U,F)});function G(U,K){if(U||!K)Q(U);else if(B)B(K);else t1(Z,"`done` is defined if `resolve` is not"),Z(void 0,K)}}}processSync($){let Z=!1,H;return this.freeze(),bL("processSync",this.parser||this.Parser),yL("processSync",this.compiler||this.Compiler),this.process($,J),wx("processSync","process",Z),t1(H,"we either bailed on an error or have a tree"),H;function J(B,Q){Z=!0,EL(B),H=Q}}run($,Z,H){Cx($),this.freeze();let J=this.transformers;if(!H&&typeof Z==="function")H=Z,Z=void 0;return H?B(void 0,H):new Promise(B);function B(Q,z){t1(typeof Z!=="function","`file` can’t be a `done` anymore, we checked");let X=fK(Z);J.run($,X,G);function G(U,K,F){let Y=K||$;if(U)z(U);else if(Q)Q(Y);else t1(H,"`done` is defined if `resolve` is not"),H(void 0,Y,F)}}}runSync($,Z){let H=!1,J;return this.run($,Z,B),wx("runSync","run",H),t1(J,"we either bailed on an error or have a tree"),J;function B(Q,z){EL(Q),J=z,H=!0}}stringify($,Z){this.freeze();let H=fK(Z),J=this.compiler||this.Compiler;return yL("stringify",J),Cx($),J($,H)}use($,...Z){let H=this.attachers,J=this.namespace;if(hL("use",this.frozen),$===null||$===void 0);else if(typeof $==="function")X($,Z);else if(typeof $==="object")if(Array.isArray($))z($);else Q($);else throw TypeError("Expected usable value, not `"+$+"`");return this;function B(G){if(typeof G==="function")X(G,[]);else if(typeof G==="object")if(Array.isArray(G)){let[U,...K]=G;X(U,K)}else Q(G);else throw TypeError("Expected usable value, not `"+G+"`")}function Q(G){if(!("plugins"in G)&&!("settings"in G))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(z(G.plugins),G.settings)J.settings=mK.default(!0,J.settings,G.settings)}function z(G){let U=-1;if(G===null||G===void 0);else if(Array.isArray(G))while(++U<G.length){let K=G[U];B(K)}else throw TypeError("Expected a list of plugins, not `"+G+"`")}function X(G,U){let K=-1,F=-1;while(++K<H.length)if(H[K][0]===G){F=K;break}if(F===-1)H.push([G,...U]);else if(U.length>0){let[Y,...W]=U,A=H[F][1];if(PB(A)&&PB(Y))Y=mK.default(!0,A,Y);H[F]=[G,Y,...W]}}}}var vL=new xL().freeze();function bL($,Z){if(typeof Z!=="function")throw TypeError("Cannot `"+$+"` without `parser`")}function yL($,Z){if(typeof Z!=="function")throw TypeError("Cannot `"+$+"` without `compiler`")}function hL($,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 Cx($){if(!PB($)||typeof $.type!=="string")throw TypeError("Expected node, got `"+$+"`")}function wx($,Z,H){if(!H)throw Error("`"+$+"` finished async. Use `"+Z+"` instead")}function fK($){return S30($)?$:new bZ($)}function S30($){return Boolean($&&typeof $==="object"&&"message"in $&&"messages"in $)}function I30($){return typeof $==="string"||k30($)}function k30($){return Boolean($&&typeof $==="object"&&"byteLength"in $&&"byteOffset"in $)}var R30="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",Ex=[],Sx={allowDangerousHtml:!0},b30=/^(https?|ircs?|mailto|xmpp)$/i,y30=[{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 uK($){let Z=h30($),H=x30($);return v30(Z.runSync(Z.parse(H),H),$)}function h30($){let Z=$.rehypePlugins||Ex,H=$.remarkPlugins||Ex,J=$.remarkRehypeOptions?{...$.remarkRehypeOptions,...Sx}:Sx;return vL().use(CK).use(H).use(vK,J).use(Z)}function x30($){let Z=$.children||"",H=new bZ;if(typeof Z==="string")H.value=Z;else GK("Unexpected value `"+Z+"` for `children` prop, expected `string`");return H}function v30($,Z){let{allowedElements:H,allowElement:J,components:B,disallowedElements:Q,skipHtml:z,unwrapDisallowed:X}=Z,G=Z.urlTransform||kx;for(let K of y30)if(Object.hasOwn(Z,K.from))GK("Unexpected `"+K.from+"` prop, "+(K.to?"use `"+K.to+"` instead":"remove it")+" (see <"+R30+"#"+K.id+"> for more info)");if(H&&Q)GK("Unexpected combined `allowedElements` and `disallowedElements`, expected one or the other");return B3($,U),QL($,{Fragment:yZ.Fragment,components:B,ignoreInvalidStyle:!0,jsx:yZ.jsx,jsxs:yZ.jsxs,passKeys:!0,passNode:!0});function U(K,F,Y){if(K.type==="raw"&&Y&&typeof F==="number"){if(z)Y.children.splice(F,1);else Y.children[F]={type:"text",value:K.value};return F}if(K.type==="element"){let W;for(W in UB)if(Object.hasOwn(UB,W)&&Object.hasOwn(K.properties,W)){let A=K.properties[W],N=UB[W];if(N===null||N.includes(K.tagName))K.properties[W]=G(String(A||""),W,K)}}if(K.type==="element"){let W=H?!H.includes(K.tagName):Q?Q.includes(K.tagName):!1;if(!W&&J&&typeof F==="number")W=!J(K,F,Y);if(W&&Y&&typeof F==="number"){if(X&&K.children)Y.children.splice(F,1,...K.children);else Y.children.splice(F,1);return F}}}}function kx($){let Z=$.indexOf(":"),H=$.indexOf("?"),J=$.indexOf("#"),B=$.indexOf("/");if(Z===-1||B!==-1&&Z>B||H!==-1&&Z>H||J!==-1&&Z>J||b30.test($.slice(0,Z)))return $;return""}var pK=function($,Z,H){let J=E9(H);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(J($.children[Z],Z,$))return $.children[Z];return};var Q3=function($){if($===null||$===void 0)return m30;if(typeof $==="string")return f30($);if(typeof $==="object")return g30($);if(typeof $==="function")return gL($);throw Error("Expected function, string, or array as `test`")};function g30($){let Z=[],H=-1;while(++H<$.length)Z[H]=Q3($[H]);return gL(J);function J(...B){let Q=-1;while(++Q<Z.length)if(Z[Q].apply(this,B))return!0;return!1}}function f30($){return gL(Z);function Z(H){return H.tagName===$}}function gL($){return Z;function Z(H,J,B){return Boolean(u30(H)&&$.call(this,H,typeof J==="number"?J:void 0,B||void 0))}}function m30($){return Boolean($&&typeof $==="object"&&"type"in $&&$.type==="element"&&"tagName"in $&&typeof $.tagName==="string")}function u30($){return $!==null&&typeof $==="object"&&"type"in $&&"tagName"in $}var Rx=/\n/g,bx=/[\t ]+/g,fL=Q3("br"),yx=Q3(a30),p30=Q3("p"),hx=Q3("tr"),c30=Q3(["datalist","head","noembed","noframes","noscript","rp","script","style","template","title",r30,n30]),xx=Q3(["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 mL($,Z){let H=Z||{},J="children"in $?$.children:[],B=xx($),Q=fx($,{whitespace:H.whitespace||"normal",breakBefore:!1,breakAfter:!1}),z=[];if($.type==="text"||$.type==="comment")z.push(...gx($,{whitespace:Q,breakBefore:!0,breakAfter:!0}));let X=-1;while(++X<J.length)z.push(...vx(J[X],$,{whitespace:Q,breakBefore:X?void 0:B,breakAfter:X<J.length-1?fL(J[X+1]):B}));let G=[],U;X=-1;while(++X<z.length){let K=z[X];if(typeof K==="number"){if(U!==void 0&&K>U)U=K}else if(K){if(U!==void 0&&U>-1)G.push(`
31
- `.repeat(U)||" ");U=-1,G.push(K)}}return G.join("")}function vx($,Z,H){if($.type==="element")return d30($,Z,H);if($.type==="text")return H.whitespace==="normal"?gx($,H):l30($);return[]}function d30($,Z,H){let J=fx($,H),B=$.children||[],Q=-1,z=[];if(c30($))return z;let X,G;if(fL($))G=`
32
- `;else if(hx($)&&pK(Z,$,hx))G=`
33
- `;else if(p30($))X=2,G=2;else if(xx($))X=1,G=1;while(++Q<B.length)z=z.concat(vx(B[Q],$,{whitespace:J,breakBefore:Q?void 0:X,breakAfter:Q<B.length-1?fL(B[Q+1]):G}));if(yx($)&&pK(Z,$,yx))z.push("\t");if(X)z.unshift(X);if(G)z.push(G);return z}function gx($,Z){let H=String($.value),J=[],B=[],Q=0;while(Q<=H.length){Rx.lastIndex=Q;let G=Rx.exec(H),U=G&&"index"in G?G.index:H.length;J.push(i30(H.slice(Q,U).replace(/[\u061C\u200E\u200F\u202A-\u202E\u2066-\u2069]/g,""),Q===0?Z.breakBefore:!0,U===H.length?Z.breakAfter:!0)),Q=U+1}let z=-1,X;while(++z<J.length)if(J[z].charCodeAt(J[z].length-1)===8203||z<J.length-1&&J[z+1].charCodeAt(0)===8203)B.push(J[z]),X=void 0;else if(J[z]){if(typeof X==="number")B.push(X);B.push(J[z]),X=0}else if(z===0||z===J.length-1)B.push(0);return B}function l30($){return[String($.value)]}function i30($,Z,H){let J=[],B=0,Q;while(B<$.length){bx.lastIndex=B;let z=bx.exec($);if(Q=z?z.index:$.length,!B&&!Q&&z&&!Z)J.push("");if(B!==Q)J.push($.slice(B,Q));B=z?Q+z[0].length:Q}if(B!==Q&&!H)J.push("");return J.join(" ")}function fx($,Z){if($.type==="element"){let H=$.properties||{};switch($.tagName){case"listing":case"plaintext":case"xmp":return"pre";case"nobr":return"nowrap";case"pre":return H.wrap?"pre-wrap":"pre";case"td":case"th":return H.noWrap?"nowrap":Z.whitespace;case"textarea":return"pre-wrap";default:}}return Z.whitespace}function r30($){return Boolean(($.properties||{}).hidden)}function a30($){return $.tagName==="td"||$.tagName==="th"}function n30($){return $.tagName==="dialog"&&!($.properties||{}).open}function o30($){let Z=$.regex,H=$.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),J="decltype\\(auto\\)",B="[a-zA-Z_]\\w*::",Q="<[^<>]+>",z="(?!struct)(decltype\\(auto\\)|"+Z.optional("[a-zA-Z_]\\w*::")+"[a-zA-Z_]\\w*"+Z.optional("<[^<>]+>")+")",X={className:"type",begin:"\\b[a-z\\d_]*_t\\b"},G="\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)",U={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})"/})]},K={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},F={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(U,{className:"string"}),{className:"string",begin:/<.*?>/},H,$.C_BLOCK_COMMENT_MODE]},Y={className:"title",begin:Z.optional("[a-zA-Z_]\\w*::")+$.IDENT_RE,relevance:0},W=Z.optional("[a-zA-Z_]\\w*::")+$.IDENT_RE+"\\s*\\(",A=["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"],j={type:N,keyword:A,literal:["NULL","false","nullopt","nullptr","true"],built_in:["_Pragma"],_type_hints:L},M={className:"function.dispatch",relevance:0,keywords:{_hint:V},begin:Z.concat(/\b/,/(?!decltype)/,/(?!if)/,/(?!for)/,/(?!switch)/,/(?!while)/,$.IDENT_RE,Z.lookahead(/(<[^<>]+>|)\s*\(/))},P=[M,F,X,H,$.C_BLOCK_COMMENT_MODE,K,U],T={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:j,contains:P.concat([{begin:/\(/,end:/\)/,keywords:j,contains:P.concat(["self"]),relevance:0}]),relevance:0},C={className:"function",begin:"("+z+"[\\*&\\s]+)+"+W,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:j,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:"decltype\\(auto\\)",keywords:j,relevance:0},{begin:W,returnBegin:!0,contains:[Y],relevance:0},{begin:/::/,relevance:0},{begin:/:/,endsWithParent:!0,contains:[U,K]},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:j,relevance:0,contains:[H,$.C_BLOCK_COMMENT_MODE,U,K,X,{begin:/\(/,end:/\)/,keywords:j,relevance:0,contains:["self",H,$.C_BLOCK_COMMENT_MODE,U,K,X]}]},X,H,$.C_BLOCK_COMMENT_MODE,F]};return{name:"C++",aliases:["cc","c++","h++","hpp","hh","hxx","cxx"],keywords:j,illegal:"</",classNameAliases:{"function.dispatch":"built_in"},contains:[].concat(T,C,M,P,[F,{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:j,contains:["self",X]},{begin:$.IDENT_RE+"::",keywords:j},{match:[/\b(?:enum(?:\s+(?:class|struct))?|class|struct|union)/,/\s+/,/\w+/],className:{1:"keyword",3:"title.class"}}])}}function mx($){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"]},H=o30($),J=H.keywords;return J.type=[...J.type,...Z.type],J.literal=[...J.literal,...Z.literal],J.built_in=[...J.built_in,...Z.built_in],J._hints=Z._hints,H.name="Arduino",H.aliases=["ino"],H.supersetOf="cpp",H}function ux($){let Z=$.regex,H={},J={begin:/\$\{/,end:/\}/,contains:["self",{begin:/:-/,contains:[H]}]};Object.assign(H,{className:"variable",variants:[{begin:Z.concat(/\$[\w\d#@][\w\d_]*/,"(?![\\w\\d])(?![$])")},J]});let B={className:"subst",begin:/\$\(/,end:/\)/,contains:[$.BACKSLASH_ESCAPE]},Q=$.inherit($.COMMENT(),{match:[/(^|\s)/,/#.*$/],scope:{2:"comment"}}),z={begin:/<<-?\s*(?=\w+)/,starts:{contains:[$.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,className:"string"})]}},X={className:"string",begin:/"/,end:/"/,contains:[$.BACKSLASH_ESCAPE,H,B]};B.contains.push(X);let G={match:/\\"/},U={className:"string",begin:/'/,end:/'/},K={match:/\\'/},F={begin:/\$?\(\(/,end:/\)\)/,contains:[{begin:/\d+#[0-9a-f]+/,className:"number"},$.NUMBER_MODE,H]},Y=["fish","bash","zsh","sh","csh","ksh","tcsh","dash","scsh"],W=$.SHEBANG({binary:`(${Y.join("|")})`,relevance:10}),A={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._-]+)+/},D=["break","cd","continue","eval","exec","exit","export","getopts","hash","pwd","readonly","return","shift","test","times","trap","umask","unset"],q=["alias","bind","builtin","caller","command","declare","echo","enable","help","let","local","logout","mapfile","printf","read","readarray","source","sudo","type","typeset","ulimit","unalias"],j=["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"],M=["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:[...D,...q,"set","shopt",...j,...M]},contains:[W,$.SHEBANG(),A,F,Q,z,V,X,G,U,K,H]}}function px($){let Z=$.regex,H=$.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),J="decltype\\(auto\\)",B="[a-zA-Z_]\\w*::",Q="<[^<>]+>",z="(decltype\\(auto\\)|"+Z.optional("[a-zA-Z_]\\w*::")+"[a-zA-Z_]\\w*"+Z.optional("<[^<>]+>")+")",X={className:"type",variants:[{begin:"\\b[a-z\\d_]*_t\\b"},{match:/\batomic_[a-z]{3,6}\b/}]},G="\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)",U={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})"/})]},K={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},F={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(U,{className:"string"}),{className:"string",begin:/<.*?>/},H,$.C_BLOCK_COMMENT_MODE]},Y={className:"title",begin:Z.optional("[a-zA-Z_]\\w*::")+$.IDENT_RE,relevance:0},W=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=[F,X,H,$.C_BLOCK_COMMENT_MODE,K,U],D={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},q={begin:"("+z+"[\\*&\\s]+)+"+W,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:L,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:"decltype\\(auto\\)",keywords:L,relevance:0},{begin:W,returnBegin:!0,contains:[$.inherit(Y,{className:"title.function"})],relevance:0},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:L,relevance:0,contains:[H,$.C_BLOCK_COMMENT_MODE,U,K,X,{begin:/\(/,end:/\)/,keywords:L,relevance:0,contains:["self",H,$.C_BLOCK_COMMENT_MODE,U,K,X]}]},X,H,$.C_BLOCK_COMMENT_MODE,F]};return{name:"C",aliases:["h"],keywords:L,disableAutodetect:!0,illegal:"</",contains:[].concat(D,q,V,[F,{begin:$.IDENT_RE+"::",keywords:L},{className:"class",beginKeywords:"enum class struct union",end:/[{;:<>=]/,contains:[{beginKeywords:"final class struct"},$.TITLE_MODE]}]),exports:{preprocessor:F,strings:U,keywords:L}}}function cx($){let Z=$.regex,H=$.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),J="decltype\\(auto\\)",B="[a-zA-Z_]\\w*::",Q="<[^<>]+>",z="(?!struct)(decltype\\(auto\\)|"+Z.optional("[a-zA-Z_]\\w*::")+"[a-zA-Z_]\\w*"+Z.optional("<[^<>]+>")+")",X={className:"type",begin:"\\b[a-z\\d_]*_t\\b"},G="\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)",U={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})"/})]},K={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},F={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(U,{className:"string"}),{className:"string",begin:/<.*?>/},H,$.C_BLOCK_COMMENT_MODE]},Y={className:"title",begin:Z.optional("[a-zA-Z_]\\w*::")+$.IDENT_RE,relevance:0},W=Z.optional("[a-zA-Z_]\\w*::")+$.IDENT_RE+"\\s*\\(",A=["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"],j={type:N,keyword:A,literal:["NULL","false","nullopt","nullptr","true"],built_in:["_Pragma"],_type_hints:L},M={className:"function.dispatch",relevance:0,keywords:{_hint:V},begin:Z.concat(/\b/,/(?!decltype)/,/(?!if)/,/(?!for)/,/(?!switch)/,/(?!while)/,$.IDENT_RE,Z.lookahead(/(<[^<>]+>|)\s*\(/))},P=[M,F,X,H,$.C_BLOCK_COMMENT_MODE,K,U],T={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:j,contains:P.concat([{begin:/\(/,end:/\)/,keywords:j,contains:P.concat(["self"]),relevance:0}]),relevance:0},C={className:"function",begin:"("+z+"[\\*&\\s]+)+"+W,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:j,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:"decltype\\(auto\\)",keywords:j,relevance:0},{begin:W,returnBegin:!0,contains:[Y],relevance:0},{begin:/::/,relevance:0},{begin:/:/,endsWithParent:!0,contains:[U,K]},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:j,relevance:0,contains:[H,$.C_BLOCK_COMMENT_MODE,U,K,X,{begin:/\(/,end:/\)/,keywords:j,relevance:0,contains:["self",H,$.C_BLOCK_COMMENT_MODE,U,K,X]}]},X,H,$.C_BLOCK_COMMENT_MODE,F]};return{name:"C++",aliases:["cc","c++","h++","hpp","hh","hxx","cxx"],keywords:j,illegal:"</",classNameAliases:{"function.dispatch":"built_in"},contains:[].concat(T,C,M,P,[F,{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:j,contains:["self",X]},{begin:$.IDENT_RE+"::",keywords:j},{match:[/\b(?:enum(?:\s+(?:class|struct))?|class|struct|union)/,/\s+/,/\w+/],className:{1:"keyword",3:"title.class"}}])}}function dx($){let Z=["bool","byte","char","decimal","delegate","double","dynamic","enum","float","int","long","nint","nuint","object","sbyte","short","string","ulong","uint","ushort"],H=["public","private","protected","static","internal","protected","abstract","async","extern","override","unsafe","virtual","new","sealed","partial"],J=["default","false","null","true"],B=["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"],Q=["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"],z={keyword:B.concat(Q),built_in:Z,literal:J},X=$.inherit($.TITLE_MODE,{begin:"[a-zA-Z](\\.?\\w)*"}),G={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},U={className:"string",begin:/"""("*)(?!")(.|\n)*?"""\1/,relevance:1},K={className:"string",begin:'@"',end:'"',contains:[{begin:'""'}]},F=$.inherit(K,{illegal:/\n/}),Y={className:"subst",begin:/\{/,end:/\}/,keywords:z},W=$.inherit(Y,{illegal:/\n/}),A={className:"string",begin:/\$"/,end:'"',illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/},$.BACKSLASH_ESCAPE,W]},N={className:"string",begin:/\$@"/,end:'"',contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:'""'},Y]},L=$.inherit(N,{illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:'""'},W]});Y.contains=[N,A,K,$.APOS_STRING_MODE,$.QUOTE_STRING_MODE,G,$.C_BLOCK_COMMENT_MODE],W.contains=[L,A,F,$.APOS_STRING_MODE,$.QUOTE_STRING_MODE,G,$.inherit($.C_BLOCK_COMMENT_MODE,{illegal:/\n/})];let V={variants:[U,N,A,K,$.APOS_STRING_MODE,$.QUOTE_STRING_MODE]},D={begin:"<",end:">",contains:[{beginKeywords:"in out"},X]},q=$.IDENT_RE+"(<"+$.IDENT_RE+"(\\s*,\\s*"+$.IDENT_RE+")*>)?(\\[\\])?",j={begin:"@"+$.IDENT_RE,relevance:0};return{name:"C#",aliases:["cs","c#"],keywords:z,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,G,{beginKeywords:"class interface",relevance:0,end:/[{;=]/,illegal:/[^\s:,]/,contains:[{beginKeywords:"where class"},X,D,$.C_LINE_COMMENT_MODE,$.C_BLOCK_COMMENT_MODE]},{beginKeywords:"namespace",relevance:0,end:/[{;=]/,illegal:/[^\s:]/,contains:[X,$.C_LINE_COMMENT_MODE,$.C_BLOCK_COMMENT_MODE]},{beginKeywords:"record",relevance:0,end:/[{;=]/,illegal:/[^\s:]/,contains:[X,D,$.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:"("+q+"\\s+)+"+$.IDENT_RE+"\\s*(<[^=]+>\\s*)?\\(",returnBegin:!0,end:/\s*[{;=]/,excludeEnd:!0,keywords:z,contains:[{beginKeywords:H.join(" "),relevance:0},{begin:$.IDENT_RE+"\\s*(<[^=]+>\\s*)?\\(",returnBegin:!0,contains:[$.TITLE_MODE,D],relevance:0},{match:/\(\)/},{className:"params",begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:z,relevance:0,contains:[V,G,$.C_BLOCK_COMMENT_MODE]},$.C_LINE_COMMENT_MODE,$.C_BLOCK_COMMENT_MODE]},j]}}var s30=($)=>{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_-]*/}}},t30=["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"],e30=["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"],$60=[...t30,...e30],Z60=["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(),H60=["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(),J60=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),B60=["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 lx($){let Z=$.regex,H=s30($),J={begin:/-(webkit|moz|ms|o)-(?=[a-z])/},B="and or not only",Q=/@-?\w[\w]*(-\w+)*/,z="[a-zA-Z-][a-zA-Z0-9_-]*",X=[$.APOS_STRING_MODE,$.QUOTE_STRING_MODE];return{name:"CSS",case_insensitive:!0,illegal:/[=|'\$]/,keywords:{keyframePosition:"from to"},classNameAliases:{keyframePosition:"selector-tag"},contains:[H.BLOCK_COMMENT,J,H.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},H.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",variants:[{begin:":("+H60.join("|")+")"},{begin:":(:)?("+J60.join("|")+")"}]},H.CSS_VARIABLE,{className:"attribute",begin:"\\b("+B60.join("|")+")\\b"},{begin:/:/,end:/[;}{]/,contains:[H.BLOCK_COMMENT,H.HEXCOLOR,H.IMPORTANT,H.CSS_NUMBER_MODE,...X,{begin:/(url|data-uri)\(/,end:/\)/,relevance:0,keywords:{built_in:"url data-uri"},contains:[...X,{className:"string",begin:/[^)]/,endsWithParent:!0,excludeEnd:!0}]},H.FUNCTION_DISPATCH]},{begin:Z.lookahead(/@/),end:"[{;]",relevance:0,illegal:/:/,contains:[{className:"keyword",begin:Q},{begin:/\s/,endsWithParent:!0,excludeEnd:!0,relevance:0,keywords:{$pattern:/[a-z-]+/,keyword:"and or not only",attribute:Z60.join(" ")},contains:[{begin:/[a-z-]+(?=:)/,className:"attribute"},...X,H.CSS_NUMBER_MODE]}]},{className:"selector-tag",begin:"\\b("+$60.join("|")+")\\b"}]}}function ix($){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 rx($){let Q={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:Q,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:Q,illegal:/["']/}]}]}}function ax($){let Z=$.regex,H=/[_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(H,Z.lookahead(/\s*:/)),relevance:0}],illegal:[/[;<']/,/BEGIN/]}}function nx($){let Z=$.regex,H={className:"number",relevance:0,variants:[{begin:/([+-]+)?[\d]+_[\d_]+/},{begin:$.NUMBER_RE}]},J=$.COMMENT();J.variants=[{begin:/;/,end:/$/},{begin:/#/,end:/$/}];let B={className:"variable",variants:[{begin:/\$[\w\d"][\w\d_]*/},{begin:/\$\{(.*?)\}/}]},Q={className:"literal",begin:/\bon|off|true|false|yes|no\b/},z={className:"string",contains:[$.BACKSLASH_ESCAPE],variants:[{begin:"'''",end:"'''",relevance:10},{begin:'"""',end:'"""',relevance:10},{begin:'"',end:'"'},{begin:"'",end:"'"}]},X={begin:/\[/,end:/\]/,contains:[J,Q,B,z,H,"self"],relevance:0},G=/[A-Za-z0-9_-]+/,U=/"(\\"|[^"])*"/,K=/'[^']*'/,F=Z.either(G,U,K),Y=Z.concat(F,"(\\s*\\.\\s*",F,")*",Z.lookahead(/\s*=\s*[^#\s]/));return{name:"TOML, also INI",aliases:["toml"],case_insensitive:!0,illegal:/\S/,contains:[J,{className:"section",begin:/\[+/,end:/\]+/},{begin:Y,className:"attr",starts:{end:/$/,contains:[J,X,Q,B,z,H]}}]}}var hZ="[0-9](_*[0-9])*",cK=`\\.(${hZ})`,dK="[0-9a-fA-F](_*[0-9a-fA-F])*",ox={className:"number",variants:[{begin:`(\\b(${hZ})((${cK})|\\.)?|(${cK}))[eE][+-]?(${hZ})[fFdD]?\\b`},{begin:`\\b(${hZ})((${cK})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${cK})[fFdD]?\\b`},{begin:`\\b(${hZ})[fFdD]\\b`},{begin:`\\b0[xX]((${dK})\\.?|(${dK})?\\.(${dK}))[pP][+-]?(${hZ})[fFdD]?\\b`},{begin:"\\b(0|[1-9](_*[0-9])*)[lL]?\\b"},{begin:`\\b0[xX](${dK})[lL]?\\b`},{begin:"\\b0(_*[0-7])*[lL]?\\b"},{begin:"\\b0[bB][01](_*[01])*[lL]?\\b"}],relevance:0};function sx($,Z,H){if(H===-1)return"";return $.replace(Z,(J)=>{return sx($,Z,H-1)})}function tx($){let Z=$.regex,H="[À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*",J="[À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*"+sx("(?:<"+"[À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*"+"~~~(?:\\s*,\\s*"+"[À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*"+"~~~)*>)?",/~~~/g,2),G={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"]},U={className:"meta",begin:"@"+"[À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*",contains:[{begin:/\(/,end:/\)/,contains:["self"]}]},K={className:"params",begin:/\(/,end:/\)/,keywords:G,relevance:0,contains:[$.C_BLOCK_COMMENT_MODE],endsParent:!0};return{name:"Java",aliases:["jsp"],keywords:G,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:[K,$.C_LINE_COMMENT_MODE,$.C_BLOCK_COMMENT_MODE]},{beginKeywords:"new throw return else",relevance:0},{begin:["(?:"+J+"\\s+)",$.UNDERSCORE_IDENT_RE,/\s*(?=\()/],className:{2:"title.function"},keywords:G,contains:[{className:"params",begin:/\(/,end:/\)/,keywords:G,relevance:0,contains:[U,$.APOS_STRING_MODE,$.QUOTE_STRING_MODE,ox,$.C_BLOCK_COMMENT_MODE]},$.C_LINE_COMMENT_MODE,$.C_BLOCK_COMMENT_MODE]},ox,U]}}var Q60=["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"],z60=["true","false","null","undefined","NaN","Infinity"],ex=["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"],$v=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],Zv=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],X60=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],G60=[].concat(Zv,ex,$v);function Hv($){let Z=$.regex,H=(f,{after:g})=>{let O="</"+f[0].slice(1);return f.input.indexOf(O,g)!==-1},J="[A-Za-z$_][0-9A-Za-z$_]*",B={begin:"<>",end:"</>"},Q=/<[A-Za-z0-9\\._:-]+\s*\/>/,z={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(f,g)=>{let O=f[0].length+f.index,c=f.input[O];if(c==="<"||c===","){g.ignoreMatch();return}if(c===">"){if(!H(f,{after:O}))g.ignoreMatch()}let o,b=f.input.substring(O);if(o=b.match(/^\s*=/)){g.ignoreMatch();return}if(o=b.match(/^\s+extends\s+/)){if(o.index===0){g.ignoreMatch();return}}}},X={$pattern:"[A-Za-z$_][0-9A-Za-z$_]*",keyword:Q60,literal:z60,built_in:G60,"variable.language":X60},G="[0-9](_?[0-9])*",U="\\.([0-9](_?[0-9])*)",K="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",F={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},Y={className:"subst",begin:"\\$\\{",end:"\\}",keywords:X,contains:[]},W={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[$.BACKSLASH_ESCAPE,Y],subLanguage:"xml"}},A={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[$.BACKSLASH_ESCAPE,Y],subLanguage:"css"}},N={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[$.BACKSLASH_ESCAPE,Y],subLanguage:"graphql"}},L={className:"string",begin:"`",end:"`",contains:[$.BACKSLASH_ESCAPE,Y]},D={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]},q=[$.APOS_STRING_MODE,$.QUOTE_STRING_MODE,W,A,N,L,{match:/\$\d+/},F];Y.contains=q.concat({begin:/\{/,end:/\}/,keywords:X,contains:["self"].concat(q)});let j=[].concat(D,Y.contains),M=j.concat([{begin:/(\s*)\(/,end:/\)/,keywords:X,contains:["self"].concat(j)}]),P={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:X,contains:M},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"}}]},C={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:{_:[...ex,...$v]}},k={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},E={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:[P],illegal:/%/},h={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function x(f){return Z.concat("(?!",f.join("|"),")")}let R={match:Z.concat(/\b/,x([...Zv,"super","import"].map((f)=>`${f}\\s*\\(`)),"[A-Za-z$_][0-9A-Za-z$_]*",Z.lookahead(/\s*\(/)),className:"title.function",relevance:0},w={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:/\(\)/},P]},I="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+$.UNDERSCORE_IDENT_RE+")\\s*=>",y={match:[/const|var|let/,/\s+/,"[A-Za-z$_][0-9A-Za-z$_]*",/\s*/,/=\s*/,/(async\s*)?/,Z.lookahead(I)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[P]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:X,exports:{PARAMS_CONTAINS:M,CLASS_REFERENCE:C},illegal:/#(?![$_A-z])/,contains:[$.SHEBANG({label:"shebang",binary:"node",relevance:5}),k,$.APOS_STRING_MODE,$.QUOTE_STRING_MODE,W,A,N,L,D,{match:/\$\d+/},F,C,{scope:"attr",match:"[A-Za-z$_][0-9A-Za-z$_]*"+Z.lookahead(":"),relevance:0},y,{begin:"("+$.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[D,$.REGEXP_MODE,{className:"function",begin:I,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:X,contains:M}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:B.begin,end:B.end},{match:Q},{begin:z.begin,"on:begin":z.isTrulyOpeningTag,end:z.end}],subLanguage:"xml",contains:[{begin:z.begin,end:z.end,skip:!0,contains:["self"]}]}]},E,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+$.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[P,$.inherit($.TITLE_MODE,{begin:"[A-Za-z$_][0-9A-Za-z$_]*",className:"title.function"})]},{match:/\.\.\./,relevance:0},w,{match:"\\$[A-Za-z$_][0-9A-Za-z$_]*",relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[P]},R,h,T,S,{match:/\$[(.]/}]}}function Jv($){let Z={className:"attr",begin:/"(\\.|[^\\"\r\n])*"(?=\s*:)/,relevance:1.01},H={match:/[{}[\],:]/,className:"punctuation",relevance:0},J=["true","false","null"],B={scope:"literal",beginKeywords:J.join(" ")};return{name:"JSON",aliases:["jsonc"],keywords:{literal:J},contains:[Z,H,$.QUOTE_STRING_MODE,B,$.C_NUMBER_MODE,$.C_LINE_COMMENT_MODE,$.C_BLOCK_COMMENT_MODE],illegal:"\\S"}}var xZ="[0-9](_*[0-9])*",lK=`\\.(${xZ})`,iK="[0-9a-fA-F](_*[0-9a-fA-F])*",U60={className:"number",variants:[{begin:`(\\b(${xZ})((${lK})|\\.)?|(${lK}))[eE][+-]?(${xZ})[fFdD]?\\b`},{begin:`\\b(${xZ})((${lK})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${lK})[fFdD]?\\b`},{begin:`\\b(${xZ})[fFdD]\\b`},{begin:`\\b0[xX]((${iK})\\.?|(${iK})?\\.(${iK}))[pP][+-]?(${xZ})[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 Bv($){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"},H={className:"keyword",begin:/\b(break|continue|return|this)\b/,starts:{contains:[{className:"symbol",begin:/@\w+/}]}},J={className:"symbol",begin:$.UNDERSCORE_IDENT_RE+"@"},B={className:"subst",begin:/\$\{/,end:/\}/,contains:[$.C_NUMBER_MODE]},Q={className:"variable",begin:"\\$"+$.UNDERSCORE_IDENT_RE},z={className:"string",variants:[{begin:'"""',end:'"""(?=[^"])',contains:[Q,B]},{begin:"'",end:"'",illegal:/\n/,contains:[$.BACKSLASH_ESCAPE]},{begin:'"',end:'"',illegal:/\n/,contains:[$.BACKSLASH_ESCAPE,Q,B]}]};B.contains.push(z);let X={className:"meta",begin:"@(?:file|property|field|get|set|receiver|param|setparam|delegate)\\s*:(?:\\s*"+$.UNDERSCORE_IDENT_RE+")?"},G={className:"meta",begin:"@"+$.UNDERSCORE_IDENT_RE,contains:[{begin:/\(/,end:/\)/,contains:[$.inherit(z,{className:"string"}),"self"]}]},U=U60,K=$.COMMENT("/\\*","\\*/",{contains:[$.C_BLOCK_COMMENT_MODE]}),F={variants:[{className:"type",begin:$.UNDERSCORE_IDENT_RE},{begin:/\(/,end:/\)/,contains:[]}]},Y=F;return Y.variants[1].contains=[F],F.variants[1].contains=[Y],{name:"Kotlin",aliases:["kt","kts"],keywords:Z,contains:[$.COMMENT("/\\*\\*","\\*/",{relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"}]}),$.C_LINE_COMMENT_MODE,K,H,J,X,G,{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:[F,$.C_LINE_COMMENT_MODE,K],relevance:0},$.C_LINE_COMMENT_MODE,K,X,G,z,$.C_NUMBER_MODE]},K]},{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},X,G]},z,{className:"meta",begin:"^#!/usr/bin/env",end:"$",illegal:`
34
- `},U]}}var K60=($)=>{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_-]*/}}},F60=["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"],Y60=["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"],W60=[...F60,...Y60],A60=["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(),Qv=["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(),zv=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),N60=["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(),V60=Qv.concat(zv).sort().reverse();function Xv($){let Z=K60($),H=V60,J="and or not only",B="[\\w-]+",Q="([\\w-]+|@\\{[\\w-]+\\})",z=[],X=[],G=function(q){return{className:"string",begin:"~?"+q+".*?"+q}},U=function(q,j,M){return{className:q,begin:j,relevance:M}},K={$pattern:/[a-z-]+/,keyword:"and or not only",attribute:A60.join(" ")},F={begin:"\\(",end:"\\)",contains:X,keywords:K,relevance:0};X.push($.C_LINE_COMMENT_MODE,$.C_BLOCK_COMMENT_MODE,G("'"),G('"'),Z.CSS_NUMBER_MODE,{begin:"(url|data-uri)\\(",starts:{className:"string",end:"[\\)\\n]",excludeEnd:!0}},Z.HEXCOLOR,F,U("variable","@@?[\\w-]+",10),U("variable","@\\{[\\w-]+\\}"),U("built_in","~?`[^`]*?`"),{className:"attribute",begin:"[\\w-]+\\s*:",end:":",returnBegin:!0,excludeEnd:!0},Z.IMPORTANT,{beginKeywords:"and not"},Z.FUNCTION_DISPATCH);let Y=X.concat({begin:/\{/,end:/\}/,contains:z}),W={beginKeywords:"when",endsWithParent:!0,contains:[{beginKeywords:"and not"}].concat(X)},A={begin:Q+"\\s*:",returnBegin:!0,end:/[;}]/,relevance:0,contains:[{begin:/-(webkit|moz|ms|o)-/},Z.CSS_VARIABLE,{className:"attribute",begin:"\\b("+N60.join("|")+")\\b",end:/(?=:)/,starts:{endsWithParent:!0,illegal:"[<=$]",relevance:0,contains:X}}]},N={className:"keyword",begin:"@(import|media|charset|font-face|(-[a-z]+-)?keyframes|supports|document|namespace|page|viewport|host)\\b",starts:{end:"[;{}]",keywords:K,returnEnd:!0,contains:X,relevance:0}},L={className:"variable",variants:[{begin:"@[\\w-]+\\s*:",relevance:15},{begin:"@[\\w-]+"}],starts:{end:"[;}]",returnEnd:!0,contains:Y}},V={variants:[{begin:"[\\.#:&\\[>]",end:"[;{}]"},{begin:Q,end:/\{/}],returnBegin:!0,returnEnd:!0,illegal:`[<='$"]`,relevance:0,contains:[$.C_LINE_COMMENT_MODE,$.C_BLOCK_COMMENT_MODE,W,U("keyword","all\\b"),U("variable","@\\{[\\w-]+\\}"),{begin:"\\b("+W60.join("|")+")\\b",className:"selector-tag"},Z.CSS_NUMBER_MODE,U("selector-tag",Q,0),U("selector-id","#"+Q),U("selector-class","\\."+Q,0),U("selector-tag","&",0),Z.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",begin:":("+Qv.join("|")+")"},{className:"selector-pseudo",begin:":(:)?("+zv.join("|")+")"},{begin:/\(/,end:/\)/,relevance:0,contains:Y},{begin:"!important"},Z.FUNCTION_DISPATCH]},D={begin:`[\\w-]+:(:)?(${H.join("|")})`,returnBegin:!0,contains:[V]};return z.push($.C_LINE_COMMENT_MODE,$.C_BLOCK_COMMENT_MODE,N,L,D,A,V,W,Z.FUNCTION_DISPATCH),{name:"Less",case_insensitive:!0,illegal:`[=>'/<($"]`,contains:z}}function Gv($){let J={begin:"\\[=*\\[",end:"\\]=*\\]",contains:["self"]},B=[$.COMMENT("--(?!\\[=*\\[)","$"),$.COMMENT("--\\[=*\\[","\\]=*\\]",{contains:[J],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:B.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:B}].concat(B)},$.C_NUMBER_MODE,$.APOS_STRING_MODE,$.QUOTE_STRING_MODE,{className:"string",begin:"\\[=*\\[",end:"\\]=*\\]",contains:[J],relevance:5}])}}function Uv($){let Z={className:"variable",variants:[{begin:"\\$\\("+$.UNDERSCORE_IDENT_RE+"\\)",contains:[$.BACKSLASH_ESCAPE]},{begin:/\$[@%<?\^\+\*]/}]},H={className:"string",begin:/"/,end:/"/,contains:[$.BACKSLASH_ESCAPE,Z]},J={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,H]},B={begin:"^"+$.UNDERSCORE_IDENT_RE+"\\s*(?=[:+?]?=)"},Q={className:"meta",begin:/^\.PHONY:/,end:/$/,keywords:{$pattern:/[\.\w]+/,keyword:".PHONY"}},z={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,H,J,B,Q,z]}}function Kv($){let Z=$.regex,H={begin:/<\/?[A-Za-z_]/,end:">",subLanguage:"xml",relevance:0},J={begin:"^[-\\*]{3,}",end:"$"},B={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}]},Q={className:"bullet",begin:"^[ \t]*([*+-]|(\\d+\\.))(?=\\s+)",end:"\\s+",excludeEnd:!0},z={begin:/^\[[^\n]+\]:/,returnBegin:!0,contains:[{className:"symbol",begin:/\[/,end:/\]/,excludeBegin:!0,excludeEnd:!0},{className:"link",begin:/:\s*/,end:/$/,excludeBegin:!0}]},X=/[A-Za-z][A-Za-z0-9+.-]*/,G={variants:[{begin:/\[.+?\]\[.*?\]/,relevance:0},{begin:/\[.+?\]\(((data|javascript|mailto):|(?:http|ftp)s?:\/\/).*?\)/,relevance:2},{begin:Z.concat(/\[.+?\]\(/,X,/:\/\/.*?\)/),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}]},U={className:"strong",contains:[],variants:[{begin:/_{2}(?!\s)/,end:/_{2}/},{begin:/\*{2}(?!\s)/,end:/\*{2}/}]},K={className:"emphasis",contains:[],variants:[{begin:/\*(?![*\s])/,end:/\*/},{begin:/_(?![_\s])/,end:/_/,relevance:0}]},F=$.inherit(U,{contains:[]}),Y=$.inherit(K,{contains:[]});U.contains.push(Y),K.contains.push(F);let W=[H,G];return[U,K,F,Y].forEach((V)=>{V.contains=V.contains.concat(W)}),W=W.concat(U,K),{name:"Markdown",aliases:["md","mkdown","mkd"],contains:[{className:"section",variants:[{begin:"^#{1,6}",end:"$",contains:W},{begin:"(?=^.+?\\n[=-]{2,}$)",contains:[{begin:"^[=-]*$"},{begin:"^",end:"\\n",contains:W}]}]},H,Q,U,K,{className:"quote",begin:"^>\\s+",contains:W,end:"$"},B,J,G,z,{scope:"literal",match:/&([a-zA-Z0-9]+|#[0-9]{1,7}|#[Xx][0-9a-fA-F]{1,6});/}]}}function Fv($){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+"},H=/[a-zA-Z@][a-zA-Z0-9_]*/,X={"variable.language":["this","super"],$pattern:H,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"]},G={$pattern:H,keyword:["@interface","@class","@protocol","@implementation"]};return{name:"Objective-C",aliases:["mm","objc","obj-c","obj-c++","objective-c++"],keywords:X,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:"("+G.keyword.join("|")+")\\b",end:/(\{|$)/,excludeEnd:!0,keywords:G,contains:[$.UNDERSCORE_TITLE_MODE]},{begin:"\\."+$.UNDERSCORE_IDENT_RE,relevance:0}]}}function Yv($){let Z=$.regex,H=["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"],J=/[dualxmsipngr]{0,12}/,B={$pattern:/[\w.]+/,keyword:H.join(" ")},Q={className:"subst",begin:"[$@]\\{",end:"\\}",keywords:B},z={begin:/->\{/,end:/\}/},X={scope:"attr",match:/\s+:\s*\w+(\s*\(.*?\))?/},G={scope:"variable",variants:[{begin:/\$\d/},{begin:Z.concat(/[$%@](?!")(\^\w\b|#\w+(::\w+)*|\{\w+\}|\w+(::\w*)*)/,"(?![A-Za-z])(?![@$%])")},{begin:/[$%@](?!")[^\s\w{=]|\$=/,relevance:0}],contains:[X]},U={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},K=[$.BACKSLASH_ESCAPE,Q,G],F=[/!/,/\//,/\|/,/\?/,/'/,/"/,/#/],Y=(N,L,V="\\1")=>{let D=V==="\\1"?V:Z.concat(V,L);return Z.concat(Z.concat("(?:",N,")"),L,/(?:\\.|[^\\\/])*?/,D,/(?:\\.|[^\\\/])*?/,V,J)},W=(N,L,V)=>{return Z.concat(Z.concat("(?:",N,")"),L,/(?:\\.|[^\\\/])*?/,V,J)},A=[G,$.HASH_COMMENT_MODE,$.COMMENT(/^=\w/,/=cut/,{endsWithParent:!0}),z,{className:"string",contains:K,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}]},U,{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:Y("s|tr|y",Z.either(...F,{capture:!0}))},{begin:Y("s|tr|y","\\(","\\)")},{begin:Y("s|tr|y","\\[","\\]")},{begin:Y("s|tr|y","\\{","\\}")}],relevance:2},{className:"regexp",variants:[{begin:/(m|qr)\/\//,relevance:0},{begin:W("(?:m|qr)?",/\//,/\//)},{begin:W("m|qr",Z.either(...F,{capture:!0}),/\1/)},{begin:W("m|qr",/\(/,/\)/)},{begin:W("m|qr",/\[/,/\]/)},{begin:W("m|qr",/\{/,/\}/)}]}]},{className:"function",beginKeywords:"sub method",end:"(\\s*\\(.*?\\))?[;{]",excludeEnd:!0,relevance:5,contains:[$.TITLE_MODE,X]},{className:"class",beginKeywords:"class",end:"[;{]",excludeEnd:!0,relevance:5,contains:[$.TITLE_MODE,X,U]},{begin:"-\\w\\b",relevance:0},{begin:"^__DATA__$",end:"^__END__$",subLanguage:"mojolicious",contains:[{begin:"^@@.*",end:"$",className:"comment"}]}];return Q.contains=A,z.contains=A,{name:"Perl",aliases:["pl","pm"],keywords:B,contains:A}}function Wv($){let Z=$.regex,H=/(?![A-Za-z0-9])(?![$])/,J=Z.concat(/[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*/,H),B=Z.concat(/(\\?[A-Z][a-z0-9_\x7f-\xff]+|\\?[A-Z]+(?=[A-Z][a-z0-9_\x7f-\xff])){1,}/,H),Q=Z.concat(/[A-Z]+/,H),z={scope:"variable",match:"\\$+"+J},X={scope:"meta",variants:[{begin:/<\?php/,relevance:10},{begin:/<\?=/},{begin:/<\?/,relevance:0.1},{begin:/\?>/}]},G={scope:"subst",variants:[{begin:/\$\w+/},{begin:/\{\$/,end:/\}/}]},U=$.inherit($.APOS_STRING_MODE,{illegal:null}),K=$.inherit($.QUOTE_STRING_MODE,{illegal:null,contains:$.QUOTE_STRING_MODE.contains.concat(G)}),F={begin:/<<<[ \t]*(?:(\w+)|"(\w+)")\n/,end:/[ \t]*(\w+)\b/,contains:$.QUOTE_STRING_MODE.contains.concat(G),"on:begin":(w,S)=>{S.data._beginMatch=w[1]||w[2]},"on:end":(w,S)=>{if(S.data._beginMatch!==w[1])S.ignoreMatch()}},Y=$.END_SAME_AS_BEGIN({begin:/<<<[ \t]*'(\w+)'\n/,end:/[ \t]*(\w+)\b/}),W=`[
35
- ]`,A={scope:"string",variants:[K,U,F,Y]},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"],D=["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"],j={keyword:V,literal:((w)=>{let S=[];return w.forEach((I)=>{if(S.push(I),I.toLowerCase()===I)S.push(I.toUpperCase());else S.push(I.toLowerCase())}),S})(L),built_in:D},M=(w)=>{return w.map((S)=>{return S.replace(/\|\d+$/,"")})},P={variants:[{match:[/new/,Z.concat(`[
36
- ]`,"+"),Z.concat("(?!",M(D).join("\\b|"),"\\b)"),B],scope:{1:"keyword",4:"title.class"}}]},T=Z.concat(J,"\\b(?!\\()"),C={variants:[{match:[Z.concat(/::/,Z.lookahead(/(?!class\b)/)),T],scope:{2:"variable.constant"}},{match:[/::/,/class/],scope:{2:"variable.language"}},{match:[B,Z.concat(/::/,Z.lookahead(/(?!class\b)/)),T],scope:{1:"title.class",3:"variable.constant"}},{match:[B,Z.concat("::",Z.lookahead(/(?!class\b)/))],scope:{1:"title.class"}},{match:[B,/::/,/class/],scope:{1:"title.class",3:"variable.language"}}]},k={scope:"attr",match:Z.concat(J,Z.lookahead(":"),Z.lookahead(/(?!::)/))},E={relevance:0,begin:/\(/,end:/\)/,keywords:j,contains:[k,z,C,$.C_BLOCK_COMMENT_MODE,A,N,P]},h={relevance:0,match:[/\b/,Z.concat("(?!fn\\b|function\\b|",M(V).join("\\b|"),"|",M(D).join("\\b|"),"\\b)"),J,Z.concat(`[
37
- ]`,"*"),Z.lookahead(/(?=\()/)],scope:{3:"title.function.invoke"},contains:[E]};E.contains.push(h);let x=[k,C,$.C_BLOCK_COMMENT_MODE,A,N,P],R={begin:Z.concat(/#\[\s*\\?/,Z.either(B,Q)),beginScope:"meta",end:/]/,endScope:"meta",keywords:{literal:L,keyword:["new","array"]},contains:[{begin:/\[/,end:/]/,keywords:{literal:L,keyword:["new","array"]},contains:["self",...x]},...x,{scope:"meta",variants:[{match:B},{match:Q}]}]};return{case_insensitive:!1,keywords:j,contains:[R,$.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}]}},X,{scope:"variable.language",match:/\$this\b/},z,h,C,{match:[/const/,/\s/,J],scope:{1:"keyword",3:"variable.constant"}},P,{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:j,contains:["self",R,z,C,$.C_BLOCK_COMMENT_MODE,A,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]},A,N]}}function Av($){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 Nv($){return{name:"Plain text",aliases:["text","txt"],disableAutodetect:!0}}function Vv($){let Z=$.regex,H=/[\p{XID_Start}_]\p{XID_Continue}*/u,J=["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"],X={$pattern:/[A-Za-z]\w+|__\w+__/,keyword:J,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"]},G={className:"meta",begin:/^(>>>|\.\.\.) /},U={className:"subst",begin:/\{/,end:/\}/,keywords:X,illegal:/#/},K={begin:/\{\{/,relevance:0},F={className:"string",contains:[$.BACKSLASH_ESCAPE],variants:[{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?'''/,end:/'''/,contains:[$.BACKSLASH_ESCAPE,G],relevance:10},{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?"""/,end:/"""/,contains:[$.BACKSLASH_ESCAPE,G],relevance:10},{begin:/([fF][rR]|[rR][fF]|[fF])'''/,end:/'''/,contains:[$.BACKSLASH_ESCAPE,G,K,U]},{begin:/([fF][rR]|[rR][fF]|[fF])"""/,end:/"""/,contains:[$.BACKSLASH_ESCAPE,G,K,U]},{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,K,U]},{begin:/([fF][rR]|[rR][fF]|[fF])"/,end:/"/,contains:[$.BACKSLASH_ESCAPE,K,U]},$.APOS_STRING_MODE,$.QUOTE_STRING_MODE]},Y="[0-9](_?[0-9])*",W="(\\b([0-9](_?[0-9])*))?\\.([0-9](_?[0-9])*)|\\b([0-9](_?[0-9])*)\\.",A=`\\b|${J.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]?(?=${A})`},{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]?(?=${A})`},{begin:`\\b0[bB](_?[01])+[lL]?(?=${A})`},{begin:`\\b0[oO](_?[0-7])+[lL]?(?=${A})`},{begin:`\\b0[xX](_?[0-9a-fA-F])+[lL]?(?=${A})`},{begin:`\\b([0-9](_?[0-9])*)[jJ](?=${A})`}]},L={className:"comment",begin:Z.lookahead(/# type:/),end:/$/,keywords:X,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:X,contains:["self",G,N,F,$.HASH_COMMENT_MODE]}]};return U.contains=[F,N,G],{name:"Python",aliases:["py","gyp","ipython"],unicodeRegex:!0,keywords:X,illegal:/(<\/|\?)|=>/,contains:[G,N,{scope:"variable.language",match:/\bself\b/},{beginKeywords:"if",relevance:0},{match:/\bor\b/,scope:"keyword"},F,L,$.HASH_COMMENT_MODE,{match:[/\bdef/,/\s+/,H],scope:{1:"keyword",3:"title.function"},contains:[V]},{variants:[{match:[/\bclass/,/\s+/,H,/\s*/,/\(\s*/,H,/\s*\)/]},{match:[/\bclass/,/\s+/,H]}],scope:{1:"keyword",3:"title.class",6:"title.class.inherited"}},{className:"meta",begin:/^[\t ]*@/,end:/(?=#)|$/,contains:[N,V,F]}]}}function Lv($){return{aliases:["pycon"],contains:[{className:"meta.prompt",starts:{end:/ |$/,starts:{end:"$",subLanguage:"python"}},variants:[{begin:/^>>>(?=[ ]|$)/},{begin:/^\.\.\.(?=[ ]|$)/}]}]}}function Dv($){let Z=$.regex,H=/(?:(?:[a-zA-Z]|\.[._a-zA-Z])[._a-zA-Z0-9]*)|\.(?!\d)/,J=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]?/),B=/[=!<>:]=|\|\||&&|:::?|<-|<<-|->>|->|\|>|[-+*\/?!$&|:<=>@^~]|\*\*/,Q=Z.either(/[()]/,/[{}]/,/\[\[/,/[[\]]/,/\\/,/,/);return{name:"R",keywords:{$pattern:H,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:H},{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:[B,J]},{scope:{1:"operator",2:"number"},match:[/%[^%]*%/,J]},{scope:{1:"punctuation",2:"number"},match:[Q,J]},{scope:{2:"number"},match:[/[^a-zA-Z0-9._]|^/,J]}]},{scope:{3:"operator"},match:[H,/\s+/,/<-/,/\s+/]},{scope:"operator",relevance:0,variants:[{match:B},{match:/%[^%]*%/}]},{scope:"punctuation",relevance:0,match:Q},{begin:"`",end:"`",contains:[{begin:/\\./}]}]}}function qv($){let Z=$.regex,H="([a-zA-Z_]\\w*[!?=]?|[-+~]@|<<|>>|=~|===?|<=>|[<>]=?|\\*\\*|[-/+%^&*~`|]|\\[\\]=?)",J=Z.either(/\b([A-Z]+[a-z0-9]+)+/,/\b([A-Z]+[a-z0-9]+)+[A-Z]+/),B=Z.concat(J,/(::\w+)*/),z={"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"]},X={className:"doctag",begin:"@[A-Za-z]+"},G={begin:"#<",end:">"},U=[$.COMMENT("#","$",{contains:[X]}),$.COMMENT("^=begin","^=end",{contains:[X],relevance:10}),$.COMMENT("^__END__",$.MATCH_NOTHING_RE)],K={className:"subst",begin:/#\{/,end:/\}/,keywords:z},F={className:"string",contains:[$.BACKSLASH_ESCAPE,K],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,K]})]}]},Y="[1-9](_?[0-9])*|0",W="[0-9](_?[0-9])*",A={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:z}]},P=[F,{variants:[{match:[/class\s+/,B,/\s+<\s+/,B]},{match:[/\b(class|module)\s+/,B]}],scope:{2:"title.class",4:"title.class.inherited"},keywords:z},{match:[/(include|extend)\s+/,B],scope:{2:"title.class"},keywords:z},{relevance:0,match:[B,/\.new[. (]/],scope:{1:"title.class"}},{relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"},{relevance:0,match:J,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:[F,{begin:"([a-zA-Z_]\\w*[!?=]?|[-+~]@|<<|>>|=~|===?|<=>|[<>]=?|\\*\\*|[-/+%^&*~`|]|\\[\\]=?)"}],relevance:0},A,{className:"variable",begin:"(\\$\\W)|((\\$|@@?)(\\w+))(?=[^@$?])(?![A-Za-z])(?![@$?'])"},{className:"params",begin:/\|(?!=)/,end:/\|/,excludeBegin:!0,excludeEnd:!0,relevance:0,keywords:z},{begin:"("+$.RE_STARTERS_RE+"|unless)\\s*",keywords:"unless",contains:[{className:"regexp",contains:[$.BACKSLASH_ESCAPE,K],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(G,U),relevance:0}].concat(G,U);K.contains=P,N.contains=P;let T="[>?]>",C="[\\w#]+\\(\\w+\\):\\d+:\\d+[>*]",k="(\\w+-)?\\d+\\.\\d+\\.\\d+(p\\d+)?[^\\d][^>]+>",E=[{begin:/^\s*=>/,starts:{end:"$",contains:P}},{className:"meta.prompt",begin:"^("+T+"|"+C+"|"+k+")(?=[ ])",starts:{end:"$",keywords:z,contains:P}}];return U.unshift(G),{name:"Ruby",aliases:["rb","gemspec","podspec","thor","irb"],keywords:z,illegal:/\/\*/,contains:[$.SHEBANG({binary:"ruby"})].concat(E).concat(U).concat(P)}}function Mv($){let Z=$.regex,H=/(r#)?/,J=Z.concat(H,$.UNDERSCORE_IDENT_RE),B=Z.concat(H,$.IDENT_RE),Q={className:"title.function.invoke",relevance:0,begin:Z.concat(/\b/,/(?!let|for|while|if|else|match\b)/,B,Z.lookahead(/\s*\(/))},z="([ui](8|16|32|64|128|size)|f(32|64))?",X=["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"],G=["true","false","Some","None","Ok","Err"],U=["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!"],K=["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:K,keyword:X,literal:G,built_in:U},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+/,J],className:{1:"keyword",3:"title.function"}},{className:"meta",begin:"#!?\\[",end:"\\]",contains:[{className:"string",begin:/"/,end:/"/,contains:[$.BACKSLASH_ESCAPE]}]},{begin:[/let/,/\s+/,/(?:mut\s+)?/,J],className:{1:"keyword",3:"keyword",4:"variable"}},{begin:[/for/,/\s+/,J,/\s+/,/in/],className:{1:"keyword",3:"variable",5:"keyword"}},{begin:[/type/,/\s+/,J],className:{1:"keyword",3:"title.class"}},{begin:[/(?:trait|enum|struct|union|impl|for)/,/\s+/,J],className:{1:"keyword",3:"title.class"}},{begin:$.IDENT_RE+"::",keywords:{keyword:"Self",built_in:U,type:K}},{className:"punctuation",begin:"->"},Q]}}var L60=($)=>{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_-]*/}}},D60=["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"],q60=["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"],M60=[...D60,...q60],P60=["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(),_60=["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(),j60=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),O60=["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 Pv($){let Z=L60($),H=j60,J=_60,B="@[a-z-]+",Q="and or not only",z="[a-zA-Z-][a-zA-Z0-9_-]*",X={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("+M60.join("|")+")\\b",relevance:0},{className:"selector-pseudo",begin:":("+J.join("|")+")"},{className:"selector-pseudo",begin:":(:)?("+H.join("|")+")"},X,{begin:/\(/,end:/\)/,contains:[Z.CSS_NUMBER_MODE]},Z.CSS_VARIABLE,{className:"attribute",begin:"\\b("+O60.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,X,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:P60.join(" ")},contains:[{begin:"@[a-z-]+",className:"keyword"},{begin:/[a-z-]+(?=:)/,className:"attribute"},X,$.QUOTE_STRING_MODE,$.APOS_STRING_MODE,Z.HEXCOLOR,Z.CSS_NUMBER_MODE]},Z.FUNCTION_DISPATCH]}}function _v($){return{name:"Shell Session",aliases:["console","shellsession"],contains:[{className:"meta.prompt",begin:/^\s{0,3}[/~\w\d[\]()@-]*[>%$#][ ]?/,starts:{end:/[^\\](?=\s*$)/,subLanguage:"bash"}}]}}function jv($){let Z=$.regex,H=$.COMMENT("--","$"),J={scope:"string",variants:[{begin:/'/,end:/'/,contains:[{match:/''/}]}]},B={begin:/"/,end:/"/,contains:[{match:/""/}]},Q=["true","false","unknown"],z=["double precision","large object","with timezone","without timezone"],X=["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"],G=["add","asc","collation","desc","final","first","last","view"],U=["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"],K=["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"],F=["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"],Y=["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"],W=K,A=[...U,...G].filter((M)=>{return!K.includes(M)}),N={scope:"variable",match:/@[a-z0-9][a-z0-9_]*/},L={scope:"operator",match:/[-+*/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?/,relevance:0},V={match:Z.concat(/\b/,Z.either(...W),/\s*\(/),relevance:0,keywords:{built_in:W}};function D(M){return Z.concat(/\b/,Z.either(...M.map((P)=>{return P.replace(/\s+/,"\\s+")})),/\b/)}let q={scope:"keyword",match:D(Y),relevance:0};function j(M,{exceptions:P,when:T}={}){let C=T;return P=P||[],M.map((k)=>{if(k.match(/\|\d+$/)||P.includes(k))return k;else if(C(k))return`${k}|0`;else return k})}return{name:"SQL",case_insensitive:!0,illegal:/[{}]|<\//,keywords:{$pattern:/\b[\w\.]+/,keyword:j(A,{when:(M)=>M.length<3}),literal:Q,type:X,built_in:F},contains:[{scope:"type",match:D(z)},q,V,N,J,B,$.C_NUMBER_MODE,$.C_BLOCK_COMMENT_MODE,H,L]}}function wv($){if(!$)return null;if(typeof $==="string")return $;return $.source}function jB($){return V5("(?=",$,")")}function V5(...$){return $.map((H)=>wv(H)).join("")}function T60($){let Z=$[$.length-1];if(typeof Z==="object"&&Z.constructor===Object)return $.splice($.length-1,1),Z;else return{}}function F2(...$){return"("+(T60($).capture?"":"?:")+$.map((J)=>wv(J)).join("|")+")"}var cL=($)=>V5(/\b/,$,/\w$/.test($)?/\b/:/\B/),C60=["Protocol","Type"].map(cL),Ov=["init","self"].map(cL),w60=["Any","Self"],uL=["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"],Tv=["false","nil","true"],E60=["assignment","associativity","higherThan","left","lowerThan","none","right"],S60=["#colorLiteral","#column","#dsohandle","#else","#elseif","#endif","#error","#file","#fileID","#fileLiteral","#filePath","#function","#if","#imageLiteral","#keyPath","#line","#selector","#sourceLocation","#warning"],Cv=["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"],Ev=F2(/[/=\-+!*%<>&|^~?]/,/[\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]/),Sv=F2(Ev,/[\u0300-\u036F]/,/[\u1DC0-\u1DFF]/,/[\u20D0-\u20FF]/,/[\uFE00-\uFE0F]/,/[\uFE20-\uFE2F]/),pL=V5(Ev,Sv,"*"),Iv=F2(/[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]/),aK=F2(Iv,/\d/,/[\u0300-\u036F\u1DC0-\u1DFF\u20D0-\u20FF\uFE20-\uFE2F]/),S9=V5(Iv,aK,"*"),rK=V5(/[A-Z]/,aK,"*"),I60=["attached","autoclosure",V5(/convention\(/,F2("swift","block","c"),/\)/),"discardableResult","dynamicCallable","dynamicMemberLookup","escaping","freestanding","frozen","GKInspectable","IBAction","IBDesignable","IBInspectable","IBOutlet","IBSegueAction","inlinable","main","nonobjc","NSApplicationMain","NSCopying","NSManaged",V5(/objc\(/,S9,/\)/),"objc","objcMembers","propertyWrapper","requires_stored_property_inits","resultBuilder","Sendable","testable","UIApplicationMain","unchecked","unknown","usableFromInline","warn_unqualified_access"],k60=["iOS","iOSApplicationExtension","macOS","macOSApplicationExtension","macCatalyst","macCatalystApplicationExtension","watchOS","watchOSApplicationExtension","tvOS","tvOSApplicationExtension","swift"];function kv($){let Z={match:/\s+/,relevance:0},H=$.COMMENT("/\\*","\\*/",{contains:["self"]}),J=[$.C_LINE_COMMENT_MODE,H],B={match:[/\./,F2(...C60,...Ov)],className:{2:"keyword"}},Q={match:V5(/\./,F2(...uL)),relevance:0},z=uL.filter((X0)=>typeof X0==="string").concat(["_|0"]),X=uL.filter((X0)=>typeof X0!=="string").concat(w60).map(cL),G={variants:[{className:"keyword",match:F2(...X,...Ov)}]},U={$pattern:F2(/\b\w+/,/#\w+/),keyword:z.concat(S60),literal:Tv},K=[B,Q,G],F={match:V5(/\./,F2(...Cv)),relevance:0},Y={className:"built_in",match:V5(/\b/,F2(...Cv),/(?=\()/)},W=[F,Y],A={match:/->/,relevance:0},N={className:"operator",relevance:0,variants:[{match:pL},{match:`\\.(\\.|${Sv})+`}]},L=[A,N],V="([0-9]_*)+",D="([0-9a-fA-F]_*)+",q={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/}]},j=(X0="")=>({className:"subst",variants:[{match:V5(/\\/,X0,/[0\\tnr"']/)},{match:V5(/\\/,X0,/u\{[0-9a-fA-F]{1,8}\}/)}]}),M=(X0="")=>({className:"subst",match:V5(/\\/,X0,/[\t ]*(?:[\r\n]|\r\n)/)}),P=(X0="")=>({className:"subst",label:"interpol",begin:V5(/\\/,X0,/\(/),end:/\)/}),T=(X0="")=>({begin:V5(X0,/"""/),end:V5(/"""/,X0),contains:[j(X0),M(X0),P(X0)]}),C=(X0="")=>({begin:V5(X0,/"/),end:V5(/"/,X0),contains:[j(X0),P(X0)]}),k={className:"string",variants:[T(),T("#"),T("##"),T("###"),C(),C("#"),C("##"),C("###")]},E=[$.BACKSLASH_ESCAPE,{begin:/\[/,end:/\]/,relevance:0,contains:[$.BACKSLASH_ESCAPE]}],h={begin:/\/[^\s](?=[^/\n]*\/)/,end:/\//,contains:E},x=(X0)=>{let i=V5(X0,/\//),l=V5(/\//,X0);return{begin:i,end:l,contains:[...E,{scope:"comment",begin:`#(?!.*${l})`,end:/$/}]}},R={scope:"regexp",variants:[x("###"),x("##"),x("#"),h]},w={match:V5(/`/,S9,/`/)},S={className:"variable",match:/\$\d+/},I={className:"variable",match:`\\$${aK}+`},y=[w,S,I],f={match:/(@|#(un)?)available/,scope:"keyword",starts:{contains:[{begin:/\(/,end:/\)/,keywords:k60,contains:[...L,q,k]}]}},g={scope:"keyword",match:V5(/@/,F2(...I60),jB(F2(/\(/,/\s+/)))},O={scope:"meta",match:V5(/@/,S9)},c=[f,g,O],o={match:jB(/\b[A-Z]/),relevance:0,contains:[{className:"type",match:V5(/(AV|CA|CF|CG|CI|CL|CM|CN|CT|MK|MP|MTK|MTL|NS|SCN|SK|UI|WK|XC)/,aK,"+")},{className:"type",match:rK,relevance:0},{match:/[?!]+/,relevance:0},{match:/\.\.\./,relevance:0},{match:V5(/\s+&\s+/,jB(rK)),relevance:0}]},b={begin:/</,end:/>/,keywords:U,contains:[...J,...K,...c,A,o]};o.contains.push(b);let d={match:V5(S9,/\s*:/),keywords:"_|0",relevance:0},t={begin:/\(/,end:/\)/,relevance:0,keywords:U,contains:["self",d,...J,R,...K,...W,...L,q,k,...y,...c,o]},u={begin:/</,end:/>/,keywords:"repeat each",contains:[...J,o]},a={begin:F2(jB(V5(S9,/\s*:/)),jB(V5(S9,/\s+/,S9,/\s*:/))),end:/:/,relevance:0,contains:[{className:"keyword",match:/\b_\b/},{className:"params",match:S9}]},n={begin:/\(/,end:/\)/,keywords:U,contains:[a,...J,...K,...L,q,k,...c,o,t],endsParent:!0,illegal:/["']/},Q0={match:[/(func|macro)/,/\s+/,F2(w.match,S9,pL)],className:{1:"keyword",3:"title.function"},contains:[u,n,Z],illegal:[/\[/,/%/]},Z0={match:[/\b(?:subscript|init[?!]?)/,/\s*(?=[<(])/],className:{1:"keyword"},contains:[u,n,Z],illegal:/\[|%/},U0={match:[/operator/,/\s+/,pL],className:{1:"keyword",3:"title"}},B0={begin:[/precedencegroup/,/\s+/,rK],className:{1:"keyword",3:"title"},contains:[o],keywords:[...E60,...Tv],end:/}/},Y0={match:[/class\b/,/\s+/,/func\b/,/\s+/,/\b[A-Za-z_][A-Za-z0-9_]*\b/],scope:{1:"keyword",3:"keyword",5:"title.function"}},A0={match:[/class\b/,/\s+/,/var\b/],scope:{1:"keyword",3:"keyword"}},D0={begin:[/(struct|protocol|class|extension|enum|actor)/,/\s+/,S9,/\s*/],beginScope:{1:"keyword",3:"title.class"},keywords:U,contains:[u,...K,{begin:/:/,end:/\{/,keywords:U,contains:[{scope:"title.class.inherited",match:rK},...K],relevance:0}]};for(let X0 of k.variants){let i=X0.contains.find((e)=>e.label==="interpol");i.keywords=U;let l=[...K,...W,...L,q,k,...y];i.contains=[...l,{begin:/\(/,end:/\)/,contains:["self",...l]}]}return{name:"Swift",keywords:U,contains:[...J,Q0,Z0,Y0,A0,D0,U0,B0,{beginKeywords:"import",end:/$/,contains:[...J],relevance:0},R,...K,...W,...L,q,k,...y,...c,o,t]}}var Rv=["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"],bv=["true","false","null","undefined","NaN","Infinity"],yv=["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"],hv=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],xv=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],vv=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],gv=[].concat(xv,yv,hv);function R60($){let Z=$.regex,H=(f,{after:g})=>{let O="</"+f[0].slice(1);return f.input.indexOf(O,g)!==-1},J="[A-Za-z$_][0-9A-Za-z$_]*",B={begin:"<>",end:"</>"},Q=/<[A-Za-z0-9\\._:-]+\s*\/>/,z={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(f,g)=>{let O=f[0].length+f.index,c=f.input[O];if(c==="<"||c===","){g.ignoreMatch();return}if(c===">"){if(!H(f,{after:O}))g.ignoreMatch()}let o,b=f.input.substring(O);if(o=b.match(/^\s*=/)){g.ignoreMatch();return}if(o=b.match(/^\s+extends\s+/)){if(o.index===0){g.ignoreMatch();return}}}},X={$pattern:"[A-Za-z$_][0-9A-Za-z$_]*",keyword:Rv,literal:bv,built_in:gv,"variable.language":vv},G="[0-9](_?[0-9])*",U="\\.([0-9](_?[0-9])*)",K="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",F={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},Y={className:"subst",begin:"\\$\\{",end:"\\}",keywords:X,contains:[]},W={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[$.BACKSLASH_ESCAPE,Y],subLanguage:"xml"}},A={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[$.BACKSLASH_ESCAPE,Y],subLanguage:"css"}},N={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[$.BACKSLASH_ESCAPE,Y],subLanguage:"graphql"}},L={className:"string",begin:"`",end:"`",contains:[$.BACKSLASH_ESCAPE,Y]},D={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]},q=[$.APOS_STRING_MODE,$.QUOTE_STRING_MODE,W,A,N,L,{match:/\$\d+/},F];Y.contains=q.concat({begin:/\{/,end:/\}/,keywords:X,contains:["self"].concat(q)});let j=[].concat(D,Y.contains),M=j.concat([{begin:/(\s*)\(/,end:/\)/,keywords:X,contains:["self"].concat(j)}]),P={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:X,contains:M},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"}}]},C={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:{_:[...yv,...hv]}},k={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},E={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:[P],illegal:/%/},h={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function x(f){return Z.concat("(?!",f.join("|"),")")}let R={match:Z.concat(/\b/,x([...xv,"super","import"].map((f)=>`${f}\\s*\\(`)),"[A-Za-z$_][0-9A-Za-z$_]*",Z.lookahead(/\s*\(/)),className:"title.function",relevance:0},w={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:/\(\)/},P]},I="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+$.UNDERSCORE_IDENT_RE+")\\s*=>",y={match:[/const|var|let/,/\s+/,"[A-Za-z$_][0-9A-Za-z$_]*",/\s*/,/=\s*/,/(async\s*)?/,Z.lookahead(I)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[P]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:X,exports:{PARAMS_CONTAINS:M,CLASS_REFERENCE:C},illegal:/#(?![$_A-z])/,contains:[$.SHEBANG({label:"shebang",binary:"node",relevance:5}),k,$.APOS_STRING_MODE,$.QUOTE_STRING_MODE,W,A,N,L,D,{match:/\$\d+/},F,C,{scope:"attr",match:"[A-Za-z$_][0-9A-Za-z$_]*"+Z.lookahead(":"),relevance:0},y,{begin:"("+$.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[D,$.REGEXP_MODE,{className:"function",begin:I,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:X,contains:M}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:B.begin,end:B.end},{match:Q},{begin:z.begin,"on:begin":z.isTrulyOpeningTag,end:z.end}],subLanguage:"xml",contains:[{begin:z.begin,end:z.end,skip:!0,contains:["self"]}]}]},E,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+$.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[P,$.inherit($.TITLE_MODE,{begin:"[A-Za-z$_][0-9A-Za-z$_]*",className:"title.function"})]},{match:/\.\.\./,relevance:0},w,{match:"\\$[A-Za-z$_][0-9A-Za-z$_]*",relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[P]},R,h,T,S,{match:/\$[(.]/}]}}function fv($){let Z=$.regex,H=R60($),J="[A-Za-z$_][0-9A-Za-z$_]*",B=["any","void","number","boolean","string","object","never","symbol","bigint","unknown"],Q={begin:[/namespace/,/\s+/,$.IDENT_RE],beginScope:{1:"keyword",3:"title.class"}},z={beginKeywords:"interface",end:/\{/,excludeEnd:!0,keywords:{keyword:"interface extends",built_in:B},contains:[H.exports.CLASS_REFERENCE]},X={className:"meta",relevance:10,begin:/^\s*['"]use strict['"]/},G=["type","interface","public","private","protected","implements","declare","abstract","readonly","enum","override","satisfies"],U={$pattern:"[A-Za-z$_][0-9A-Za-z$_]*",keyword:Rv.concat(G),literal:bv,built_in:gv.concat(B),"variable.language":vv},K={className:"meta",begin:"@[A-Za-z$_][0-9A-Za-z$_]*"},F=(N,L,V)=>{let D=N.contains.findIndex((q)=>q.label===L);if(D===-1)throw Error("can not find mode to replace");N.contains.splice(D,1,V)};Object.assign(H.keywords,U),H.exports.PARAMS_CONTAINS.push(K);let Y=H.contains.find((N)=>N.scope==="attr"),W=Object.assign({},Y,{match:Z.concat("[A-Za-z$_][0-9A-Za-z$_]*",Z.lookahead(/\s*\?:/))});H.exports.PARAMS_CONTAINS.push([H.exports.CLASS_REFERENCE,Y,W]),H.contains=H.contains.concat([K,Q,z,W]),F(H,"shebang",$.SHEBANG()),F(H,"use_strict",X);let A=H.contains.find((N)=>N.label==="func.def");return A.relevance=0,Object.assign(H,{name:"TypeScript",aliases:["ts","tsx","mts","cts"]}),H}function mv($){let Z=$.regex,H={className:"string",begin:/"(""|[^/n])"C\b/},J={className:"string",begin:/"/,end:/"/,illegal:/\n/,contains:[{begin:/""/}]},B=/\d{1,2}\/\d{1,2}\/\d{4}/,Q=/\d{4}-\d{1,2}-\d{1,2}/,z=/(\d|1[012])(:\d+){0,2} *(AM|PM)/,X=/\d{1,2}(:\d{1,2}){1,2}/,G={className:"literal",variants:[{begin:Z.concat(/# */,Z.either(Q,B),/ *#/)},{begin:Z.concat(/# */,X,/ *#/)},{begin:Z.concat(/# */,z,/ *#/)},{begin:Z.concat(/# */,Z.either(Q,B),/ +/,Z.either(z,X),/ *#/)}]},U={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])|[%&])?/}]},K={className:"label",begin:/^\w+:/},F=$.COMMENT(/'''/,/$/,{contains:[{className:"doctag",begin:/<\/?/,end:/>/}]}),Y=$.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:[H,J,G,U,K,F,Y,{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:[Y]}]}}function uv($){$.regex;let Z=$.COMMENT(/\(;/,/;\)/);Z.contains.push("self");let H=$.COMMENT(/;;/,/$/),J=["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"],B={begin:[/(?:func|call|call_indirect)/,/\s+/,/\$[^\s)]+/],className:{1:"keyword",3:"title.function"}},Q={className:"variable",begin:/\$[\w_]+/},z={match:/(\((?!;)|\))+/,className:"punctuation",relevance:0},X={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/},G={match:/(i32|i64|f32|f64)(?!\.)/,className:"type"},U={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:J},contains:[H,Z,{match:[/(?:offset|align)/,/\s*/,/=/],className:{1:"keyword",3:"operator"}},Q,z,B,$.QUOTE_STRING_MODE,G,U,X]}}function pv($){let Z=$.regex,H=Z.concat(/[\p{L}_]/u,Z.optional(/[\p{L}0-9_.-]*:/u),/[\p{L}0-9_.-]*/u),J=/[\p{L}0-9._:-]+/u,B={className:"symbol",begin:/&[a-z]+;|&#[0-9]+;|&#x[a-f0-9]+;/},Q={begin:/\s/,contains:[{className:"keyword",begin:/#?[a-z_][a-z1-9_-]+/,illegal:/\n/}]},z=$.inherit(Q,{begin:/\(/,end:/\)/}),X=$.inherit($.APOS_STRING_MODE,{className:"string"}),G=$.inherit($.QUOTE_STRING_MODE,{className:"string"}),U={endsWithParent:!0,illegal:/</,relevance:0,contains:[{className:"attr",begin:J,relevance:0},{begin:/=\s*/,relevance:0,contains:[{className:"string",endsParent:!0,variants:[{begin:/"/,end:/"/,contains:[B]},{begin:/'/,end:/'/,contains:[B]},{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:[Q,G,X,z,{begin:/\[/,end:/\]/,contains:[{className:"meta",begin:/<![a-z]/,end:/>/,contains:[Q,z,G,X]}]}]},$.COMMENT(/<!--/,/-->/,{relevance:10}),{begin:/<!\[CDATA\[/,end:/\]\]>/,relevance:10},B,{className:"meta",end:/\?>/,variants:[{begin:/<\?xml/,relevance:10,contains:[G]},{begin:/<\?[a-z][a-z0-9]+/}]},{className:"tag",begin:/<style(?=\s|>)/,end:/>/,keywords:{name:"style"},contains:[U],starts:{end:/<\/style>/,returnEnd:!0,subLanguage:["css","xml"]}},{className:"tag",begin:/<script(?=\s|>)/,end:/>/,keywords:{name:"script"},contains:[U],starts:{end:/<\/script>/,returnEnd:!0,subLanguage:["javascript","handlebars","xml"]}},{className:"tag",begin:/<>|<\/>/},{className:"tag",begin:Z.concat(/</,Z.lookahead(Z.concat(H,Z.either(/\/>/,/>/,/\s/)))),end:/\/?>/,contains:[{className:"name",begin:H,relevance:0,starts:U}]},{className:"tag",begin:Z.concat(/<\//,Z.lookahead(Z.concat(H,/>/))),contains:[{className:"name",begin:H,relevance:0},{begin:/>/,relevance:0,endsParent:!0}]}]}}function cv($){let J={className:"attr",variants:[{begin:/[\w*@][\w*@ :()\./-]*:(?=[ \t]|$)/},{begin:/"[\w*@][\w*@ :()\./-]*":(?=[ \t]|$)/},{begin:/'[\w*@][\w*@ :()\./-]*':(?=[ \t]|$)/}]},B={className:"template-variable",variants:[{begin:/\{\{/,end:/\}\}/},{begin:/%\{/,end:/\}/}]},Q={className:"string",relevance:0,begin:/'/,end:/'/,contains:[{match:/''/,scope:"char.escape",relevance:0}]},z={className:"string",relevance:0,variants:[{begin:/"/,end:/"/},{begin:/\S+/}],contains:[$.BACKSLASH_ESCAPE,B]},X=$.inherit(z,{variants:[{begin:/'/,end:/'/,contains:[{begin:/''/,relevance:0}]},{begin:/"/,end:/"/},{begin:/[^\s,{}[\]]+/}]}),G="[0-9]{4}(-[0-9][0-9]){0,2}",U="([Tt \\t][0-9][0-9]?(:[0-9][0-9]){2})?",K="(\\.[0-9]*)?",F="([ \\t])*(Z|[-+][0-9][0-9]?(:[0-9][0-9])?)?",Y={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"},W={end:",",endsWithParent:!0,excludeEnd:!0,keywords:"true false yes no null",relevance:0},A={begin:/\{/,end:/\}/,contains:[W],illegal:"\\n",relevance:0},N={begin:"\\[",end:"\\]",contains:[W],illegal:"\\n",relevance:0},L=[J,{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"}},Y,{className:"number",begin:$.C_NUMBER_RE+"\\b",relevance:0},A,N,Q,z],V=[...L];return V.pop(),V.push(X),W.contains=V,{name:"YAML",case_insensitive:!0,aliases:["yml"],contains:L}}var dL={arduino:mx,bash:ux,c:px,cpp:cx,csharp:dx,css:lx,diff:ix,go:rx,graphql:ax,ini:nx,java:tx,javascript:Hv,json:Jv,kotlin:Bv,less:Xv,lua:Gv,makefile:Uv,markdown:Kv,objectivec:Fv,perl:Yv,php:Wv,"php-template":Av,plaintext:Nv,python:Vv,"python-repl":Lv,r:Dv,ruby:qv,rust:Mv,scss:Pv,shell:_v,sql:jv,swift:kv,typescript:fv,vbnet:mv,wasm:uv,xml:pv,yaml:cv};var Wg=_(Yg(),1);var Ag=Wg.default;var Ng={},_70="hljs-";function sL($){let Z=Ag.newInstance();if($)Q($);return{highlight:H,highlightAuto:J,listLanguages:B,register:Q,registerAlias:z,registered:X};function H(G,U,K){t1(typeof G==="string","expected `string` as `name`"),t1(typeof U==="string","expected `string` as `value`");let F=K||Ng,Y=typeof F.prefix==="string"?F.prefix:_70;if(!Z.getLanguage(G))throw Error("Unknown language: `"+G+"` is not registered");Z.configure({__emitter:Vg,classPrefix:Y});let W=Z.highlight(U,{ignoreIllegals:!0,language:G});if(W.errorRaised)throw Error("Could not highlight with `Highlight.js`",{cause:W.errorRaised});let A=W._emitter.root,N=A.data;return N.language=W.language,N.relevance=W.relevance,A}function J(G,U){t1(typeof G==="string","expected `string` as `value`");let F=(U||Ng).subset||B(),Y=-1,W=0,A;while(++Y<F.length){let N=F[Y];if(!Z.getLanguage(N))continue;let L=H(N,G,U);if(L.data&&L.data.relevance!==void 0&&L.data.relevance>W)W=L.data.relevance,A=L}return A||{type:"root",children:[],data:{language:void 0,relevance:W}}}function B(){return Z.listLanguages()}function Q(G,U){if(typeof G==="string")t1(U!==void 0,"expected `grammar`"),Z.registerLanguage(G,U);else{let K;for(K in G)if(Object.hasOwn(G,K))Z.registerLanguage(K,G[K])}}function z(G,U){if(typeof G==="string")t1(U!==void 0),Z.registerAliases(typeof U==="string"?U:[...U],{languageName:G});else{let K;for(K in G)if(Object.hasOwn(G,K)){let F=G[K];Z.registerAliases(typeof F==="string"?F:[...F],{languageName:K})}}}function X(G){return Boolean(Z.getLanguage(G))}}class Vg{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],H=Z.children[Z.children.length-1];if(H&&H.type==="text")H.value+=$;else Z.children.push({type:"text",value:$})}startScope($){this.openNode(String($))}endScope(){this.closeNode()}__addSublanguage($,Z){let H=this.stack[this.stack.length-1],J=$.root.children;if(Z)H.children.push({type:"element",tagName:"span",properties:{className:[Z]},children:J});else H.children.push(...J)}openNode($){let Z=this,H=$.split(".").map(function(Q,z){return z?Q+"_".repeat(z):Z.options.classPrefix+Q}),J=this.stack[this.stack.length-1],B={type:"element",tagName:"span",properties:{className:H},children:[]};J.children.push(B),this.stack.push(B)}closeNode(){this.stack.pop()}finalize(){}toHTML(){return""}}var j70={};function tK($){let Z=$||j70,H=Z.aliases,J=Z.detect||!1,B=Z.languages||dL,Q=Z.plainText,z=Z.prefix,X=Z.subset,G="hljs",U=sL(B);if(H)U.registerAlias(H);if(z){let K=z.indexOf("-");G=K===-1?z:z.slice(0,K)}return function(K,F){B3(K,"element",function(Y,W,A){if(Y.tagName!=="code"||!A||A.type!=="element"||A.tagName!=="pre")return;let N=O70(Y);if(N===!1||!N&&!J||N&&Q&&Q.includes(N))return;if(!Array.isArray(Y.properties.className))Y.properties.className=[];if(!Y.properties.className.includes(G))Y.properties.className.unshift(G);let L=mL(Y,{whitespace:"pre"}),V;try{V=N?U.highlight(N,L,{prefix:z}):U.highlightAuto(L,{prefix:z,subset:X})}catch(D){let q=D;if(N&&/Unknown language/.test(q.message)){F.message("Cannot highlight as `"+N+"`, it’s not registered",{ancestors:[A,Y],cause:q,place:Y.position,ruleId:"missing-language",source:"rehype-highlight"});return}throw q}if(!N&&V.data&&V.data.language)Y.properties.className.push("language-"+V.data.language);if(V.children.length>0)Y.children=V.children})}}function O70($){let Z=$.properties.className,H=-1;if(!Array.isArray(Z))return;let J;while(++H<Z.length){let B=String(Z[H]);if(B==="no-highlight"||B==="nohighlight")return!1;if(!J&&B.slice(0,5)==="lang-")J=B.slice(5);if(!J&&B.slice(0,9)==="language-")J=B.slice(9)}return J}function tL($,Z){let H=String($);if(typeof Z!=="string")throw TypeError("Expected character");let J=0,B=H.indexOf(Z);while(B!==-1)J++,B=H.indexOf(Z,B+Z.length);return J}function eL($){if(typeof $!=="string")throw TypeError("Expected a string");return $.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function $D($,Z,H){let B=E9((H||{}).ignore||[]),Q=T70(Z),z=-1;while(++z<Q.length)MB($,"text",X);function X(U,K){let F=-1,Y;while(++F<K.length){let W=K[F],A=Y?Y.children:void 0;if(B(W,A?A.indexOf(W):void 0,Y))return;Y=W}if(Y)return G(U,K)}function G(U,K){let F=K[K.length-1],Y=Q[z][0],W=Q[z][1],A=0,L=F.children.indexOf(U),V=!1,D=[];Y.lastIndex=0;let q=Y.exec(U.value);while(q){let j=q.index,M={index:q.index,input:q.input,stack:[...K,U]},P=W(...q,M);if(typeof P==="string")P=P.length>0?{type:"text",value:P}:void 0;if(P===!1)Y.lastIndex=j+1;else{if(A!==j)D.push({type:"text",value:U.value.slice(A,j)});if(Array.isArray(P))D.push(...P);else if(P)D.push(P);A=j+q[0].length,V=!0}if(!Y.global)break;q=Y.exec(U.value)}if(V){if(A<U.value.length)D.push({type:"text",value:U.value.slice(A)});F.children.splice(L,1,...D)}else D=[U];return L+D.length}}function T70($){let Z=[];if(!Array.isArray($))throw TypeError("Expected find and replace tuple or list of tuples");let H=!$[0]||Array.isArray($[0])?$:[$],J=-1;while(++J<H.length){let B=H[J];Z.push([C70(B[0]),w70(B[1])])}return Z}function C70($){return typeof $==="string"?new RegExp(eL($),"g"):$}function w70($){return typeof $==="function"?$:function(){return $}}var ZD="phrasing",HD=["autolink","link","image","label"];function BD(){return{transforms:[b70],enter:{literalAutolink:E70,literalAutolinkEmail:JD,literalAutolinkHttp:JD,literalAutolinkWww:JD},exit:{literalAutolink:R70,literalAutolinkEmail:k70,literalAutolinkHttp:S70,literalAutolinkWww:I70}}}function QD(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:ZD,notInConstruct:HD},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:ZD,notInConstruct:HD},{character:":",before:"[ps]",after:"\\/",inConstruct:ZD,notInConstruct:HD}]}}function E70($){this.enter({type:"link",title:null,url:"",children:[]},$)}function JD($){this.config.enter.autolinkProtocol.call(this,$)}function S70($){this.config.exit.autolinkProtocol.call(this,$)}function I70($){this.config.exit.data.call(this,$);let Z=this.stack[this.stack.length-1];t1(Z.type==="link"),Z.url="http://"+this.sliceSerialize($)}function k70($){this.config.exit.autolinkEmail.call(this,$)}function R70($){this.exit($)}function b70($){$D($,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,y70],[/(?<=^|\s|\p{P}|\p{S})([-.\w+]+)@([-\w]+(?:\.[-\w]+)+)/gu,h70]],{ignore:["link","linkReference"]})}function y70($,Z,H,J,B){let Q="";if(!Lg(B))return!1;if(/^w/i.test(Z))H=Z+H,Z="",Q="http://";if(!x70(H))return!1;let z=v70(H+J);if(!z[0])return!1;let X={type:"link",title:null,url:Q+Z+z[0],children:[{type:"text",value:Z+z[0]}]};if(z[1])return[X,{type:"text",value:z[1]}];return X}function h70($,Z,H,J){if(!Lg(J,!0)||/[-\d_]$/.test(H))return!1;return{type:"link",title:null,url:"mailto:"+Z+"@"+H,children:[{type:"text",value:Z+"@"+H}]}}function x70($){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 v70($){let Z=/[!"&'),.:;<>?\]}]+$/.exec($);if(!Z)return[$,void 0];$=$.slice(0,Z.index);let H=Z[0],J=H.indexOf(")"),B=tL($,"("),Q=tL($,")");while(J!==-1&&B>Q)$+=H.slice(0,J+1),H=H.slice(J+1),J=H.indexOf(")"),Q++;return[$,H]}function Lg($,Z){let H=$.input.charCodeAt($.index-1);return($.index===0||C9(H)||v7(H))&&(!Z||H!==47)}Dg.peek=i70;function g70(){this.buffer()}function f70($){this.enter({type:"footnoteReference",identifier:"",label:""},$)}function m70(){this.buffer()}function u70($){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},$)}function p70($){let Z=this.resume(),H=this.stack[this.stack.length-1];t1(H.type==="footnoteReference"),H.identifier=r4(this.sliceSerialize($)).toLowerCase(),H.label=Z}function c70($){this.exit($)}function d70($){let Z=this.resume(),H=this.stack[this.stack.length-1];t1(H.type==="footnoteDefinition"),H.identifier=r4(this.sliceSerialize($)).toLowerCase(),H.label=Z}function l70($){this.exit($)}function i70(){return"["}function Dg($,Z,H,J){let B=H.createTracker(J),Q=B.move("[^"),z=H.enter("footnoteReference"),X=H.enter("reference");return Q+=B.move(H.safe(H.associationId($),{after:"]",before:Q})),X(),z(),Q+=B.move("]"),Q}function zD(){return{enter:{gfmFootnoteCallString:g70,gfmFootnoteCall:f70,gfmFootnoteDefinitionLabelString:m70,gfmFootnoteDefinition:u70},exit:{gfmFootnoteCallString:p70,gfmFootnoteCall:c70,gfmFootnoteDefinitionLabelString:d70,gfmFootnoteDefinition:l70}}}function XD($){let Z=!1;if($&&$.firstLineBlank)Z=!0;return{handlers:{footnoteDefinition:H,footnoteReference:Dg},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function H(J,B,Q,z){let X=Q.createTracker(z),G=X.move("[^"),U=Q.enter("footnoteDefinition"),K=Q.enter("label");if(G+=X.move(Q.safe(Q.associationId(J),{before:G,after:"]"})),K(),G+=X.move("]:"),J.children&&J.children.length>0)X.shift(4),G+=X.move((Z?`
38
- `:" ")+Q.indentLines(Q.containerFlow(J,X.current()),Z?qg:r70));return U(),G}}function r70($,Z,H){return Z===0?$:qg($,Z,H)}function qg($,Z,H){return(H?"":" ")+$}var a70=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];Mg.peek=s70;function GD(){return{canContainEols:["delete"],enter:{strikethrough:n70},exit:{strikethrough:o70}}}function UD(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:a70}],handlers:{delete:Mg}}}function n70($){this.enter({type:"delete",children:[]},$)}function o70($){this.exit($)}function Mg($,Z,H,J){let B=H.createTracker(J),Q=H.enter("strikethrough"),z=B.move("~~");return z+=H.containerPhrasing($,{...B.current(),before:z,after:"~"}),z+=B.move("~~"),Q(),z}function s70(){return"~"}function t70($){return $.length}function _g($,Z){let H=Z||{},J=(H.align||[]).concat(),B=H.stringLength||t70,Q=[],z=[],X=[],G=[],U=0,K=-1;while(++K<$.length){let N=[],L=[],V=-1;if($[K].length>U)U=$[K].length;while(++V<$[K].length){let D=e70($[K][V]);if(H.alignDelimiters!==!1){let q=B(D);if(L[V]=q,G[V]===void 0||q>G[V])G[V]=q}N.push(D)}z[K]=N,X[K]=L}let F=-1;if(typeof J==="object"&&"length"in J)while(++F<U)Q[F]=Pg(J[F]);else{let N=Pg(J);while(++F<U)Q[F]=N}F=-1;let Y=[],W=[];while(++F<U){let N=Q[F],L="",V="";if(N===99)L=":",V=":";else if(N===108)L=":";else if(N===114)V=":";let D=H.alignDelimiters===!1?1:Math.max(1,G[F]-L.length-V.length),q=L+"-".repeat(D)+V;if(H.alignDelimiters!==!1){if(D=L.length+D+V.length,D>G[F])G[F]=D;W[F]=D}Y[F]=q}z.splice(1,0,Y),X.splice(1,0,W),K=-1;let A=[];while(++K<z.length){let N=z[K],L=X[K];F=-1;let V=[];while(++F<U){let D=N[F]||"",q="",j="";if(H.alignDelimiters!==!1){let M=G[F]-(L[F]||0),P=Q[F];if(P===114)q=" ".repeat(M);else if(P===99)if(M%2)q=" ".repeat(M/2+0.5),j=" ".repeat(M/2-0.5);else q=" ".repeat(M/2),j=q;else j=" ".repeat(M)}if(H.delimiterStart!==!1&&!F)V.push("|");if(H.padding!==!1&&!(H.alignDelimiters===!1&&D==="")&&(H.delimiterStart!==!1||F))V.push(" ");if(H.alignDelimiters!==!1)V.push(q);if(V.push(D),H.alignDelimiters!==!1)V.push(j);if(H.padding!==!1)V.push(" ");if(H.delimiterEnd!==!1||F!==U-1)V.push("|")}A.push(H.delimiterEnd===!1?V.join("").replace(/ +$/,""):V.join(""))}return A.join(`
39
- `)}function e70($){return $===null||$===void 0?"":String($)}function Pg($){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 jg($,Z,H,J){let B=H.enter("blockquote"),Q=H.createTracker(J);Q.move("> "),Q.shift(2);let z=H.indentLines(H.containerFlow($,Q.current()),$$0);return B(),z}function $$0($,Z,H){return">"+(H?"":" ")+$}function Tg($,Z){return Og($,Z.inConstruct,!0)&&!Og($,Z.notInConstruct,!1)}function Og($,Z,H){if(typeof Z==="string")Z=[Z];if(!Z||Z.length===0)return H;let J=-1;while(++J<Z.length)if($.includes(Z[J]))return!0;return!1}function KD($,Z,H,J){let B=-1;while(++B<H.unsafe.length)if(H.unsafe[B].character===`
40
- `&&Tg(H.stack,H.unsafe[B]))return/[ \t]/.test(J.before)?"":" ";return"\\\n"}function Cg($,Z){let H=String($),J=H.indexOf(Z),B=J,Q=0,z=0;if(typeof Z!=="string")throw TypeError("Expected substring");while(J!==-1){if(J===B){if(++Q>z)z=Q}else Q=1;B=J+Z.length,J=H.indexOf(Z,B)}return z}function wg($,Z){return Boolean(Z.options.fences===!1&&$.value&&!$.lang&&/[^ \r\n]/.test($.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test($.value))}function Eg($){let Z=$.options.fence||"`";if(Z!=="`"&&Z!=="~")throw Error("Cannot serialize code with `"+Z+"` for `options.fence`, expected `` ` `` or `~`");return Z}function Sg($,Z,H,J){let B=Eg(H),Q=$.value||"",z=B==="`"?"GraveAccent":"Tilde";if(wg($,H)){let F=H.enter("codeIndented"),Y=H.indentLines(Q,Z$0);return F(),Y}let X=H.createTracker(J),G=B.repeat(Math.max(Cg(Q,B)+1,3)),U=H.enter("codeFenced"),K=X.move(G);if($.lang){let F=H.enter(`codeFencedLang${z}`);K+=X.move(H.safe($.lang,{before:K,after:" ",encode:["`"],...X.current()})),F()}if($.lang&&$.meta){let F=H.enter(`codeFencedMeta${z}`);K+=X.move(" "),K+=X.move(H.safe($.meta,{before:K,after:`
41
- `,encode:["`"],...X.current()})),F()}if(K+=X.move(`
42
- `),Q)K+=X.move(Q+`
43
- `);return K+=X.move(G),U(),K}function Z$0($,Z,H){return(H?"":" ")+$}function fZ($){let Z=$.options.quote||'"';if(Z!=='"'&&Z!=="'")throw Error("Cannot serialize title with `"+Z+"` for `options.quote`, expected `\"`, or `'`");return Z}function Ig($,Z,H,J){let B=fZ(H),Q=B==='"'?"Quote":"Apostrophe",z=H.enter("definition"),X=H.enter("label"),G=H.createTracker(J),U=G.move("[");if(U+=G.move(H.safe(H.associationId($),{before:U,after:"]",...G.current()})),U+=G.move("]: "),X(),!$.url||/[\0- \u007F]/.test($.url))X=H.enter("destinationLiteral"),U+=G.move("<"),U+=G.move(H.safe($.url,{before:U,after:">",...G.current()})),U+=G.move(">");else X=H.enter("destinationRaw"),U+=G.move(H.safe($.url,{before:U,after:$.title?" ":`
44
- `,...G.current()}));if(X(),$.title)X=H.enter(`title${Q}`),U+=G.move(" "+B),U+=G.move(H.safe($.title,{before:U,after:B,...G.current()})),U+=G.move(B),X();return z(),U}function kg($){let Z=$.options.emphasis||"*";if(Z!=="*"&&Z!=="_")throw Error("Cannot serialize emphasis with `"+Z+"` for `options.emphasis`, expected `*`, or `_`");return Z}function q6($){return"&#x"+$.toString(16).toUpperCase()+";"}function mZ($,Z,H){let J=J3($),B=J3(Z);if(J===void 0)return B===void 0?H==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:B===1?{inside:!0,outside:!0}:{inside:!1,outside:!0};if(J===1)return B===void 0?{inside:!1,outside:!1}:B===1?{inside:!0,outside:!0}:{inside:!1,outside:!1};return B===void 0?{inside:!1,outside:!1}:B===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}FD.peek=H$0;function FD($,Z,H,J){let B=kg(H),Q=H.enter("emphasis"),z=H.createTracker(J),X=z.move(B),G=z.move(H.containerPhrasing($,{after:B,before:X,...z.current()})),U=G.charCodeAt(0),K=mZ(J.before.charCodeAt(J.before.length-1),U,B);if(K.inside)G=q6(U)+G.slice(1);let F=G.charCodeAt(G.length-1),Y=mZ(J.after.charCodeAt(0),F,B);if(Y.inside)G=G.slice(0,-1)+q6(F);let W=z.move(B);return Q(),H.attentionEncodeSurroundingInfo={after:Y.outside,before:K.outside},X+G+W}function H$0($,Z,H){return H.options.emphasis||"*"}function Rg($,Z){let H=!1;return B3($,function(J){if("value"in J&&/\r?\n|\r/.test(J.value)||J.type==="break")return H=!0,p7}),Boolean((!$.depth||$.depth<3)&&h7($)&&(Z.options.setext||H))}function bg($,Z,H,J){let B=Math.max(Math.min(6,$.depth||1),1),Q=H.createTracker(J);if(Rg($,H)){let K=H.enter("headingSetext"),F=H.enter("phrasing"),Y=H.containerPhrasing($,{...Q.current(),before:`
45
- `,after:`
46
- `});return F(),K(),Y+`
47
- `+(B===1?"=":"-").repeat(Y.length-(Math.max(Y.lastIndexOf("\r"),Y.lastIndexOf(`
48
- `))+1))}let z="#".repeat(B),X=H.enter("headingAtx"),G=H.enter("phrasing");Q.move(z+" ");let U=H.containerPhrasing($,{before:"# ",after:`
49
- `,...Q.current()});if(/^[\t ]/.test(U))U=q6(U.charCodeAt(0))+U.slice(1);if(U=U?z+" "+U:z,H.options.closeAtx)U+=" "+z;return G(),X(),U}YD.peek=J$0;function YD($){return $.value||""}function J$0(){return"<"}WD.peek=B$0;function WD($,Z,H,J){let B=fZ(H),Q=B==='"'?"Quote":"Apostrophe",z=H.enter("image"),X=H.enter("label"),G=H.createTracker(J),U=G.move("![");if(U+=G.move(H.safe($.alt,{before:U,after:"]",...G.current()})),U+=G.move("]("),X(),!$.url&&$.title||/[\0- \u007F]/.test($.url))X=H.enter("destinationLiteral"),U+=G.move("<"),U+=G.move(H.safe($.url,{before:U,after:">",...G.current()})),U+=G.move(">");else X=H.enter("destinationRaw"),U+=G.move(H.safe($.url,{before:U,after:$.title?" ":")",...G.current()}));if(X(),$.title)X=H.enter(`title${Q}`),U+=G.move(" "+B),U+=G.move(H.safe($.title,{before:U,after:B,...G.current()})),U+=G.move(B),X();return U+=G.move(")"),z(),U}function B$0(){return"!"}AD.peek=Q$0;function AD($,Z,H,J){let B=$.referenceType,Q=H.enter("imageReference"),z=H.enter("label"),X=H.createTracker(J),G=X.move("!["),U=H.safe($.alt,{before:G,after:"]",...X.current()});G+=X.move(U+"]["),z();let K=H.stack;H.stack=[],z=H.enter("reference");let F=H.safe(H.associationId($),{before:G,after:"]",...X.current()});if(z(),H.stack=K,Q(),B==="full"||!U||U!==F)G+=X.move(F+"]");else if(B==="shortcut")G=G.slice(0,-1);else G+=X.move("]");return G}function Q$0(){return"!"}ND.peek=z$0;function ND($,Z,H){let J=$.value||"",B="`",Q=-1;while(new RegExp("(^|[^`])"+B+"([^`]|$)").test(J))B+="`";if(/[^ \r\n]/.test(J)&&(/^[ \r\n]/.test(J)&&/[ \r\n]$/.test(J)||/^`|`$/.test(J)))J=" "+J+" ";while(++Q<H.unsafe.length){let z=H.unsafe[Q],X=H.compilePattern(z),G;if(!z.atBreak)continue;while(G=X.exec(J)){let U=G.index;if(J.charCodeAt(U)===10&&J.charCodeAt(U-1)===13)U--;J=J.slice(0,U)+" "+J.slice(G.index+1)}}return B+J+B}function z$0(){return"`"}function VD($,Z){let H=h7($);return Boolean(!Z.options.resourceLink&&$.url&&!$.title&&$.children&&$.children.length===1&&$.children[0].type==="text"&&(H===$.url||"mailto:"+H===$.url)&&/^[a-z][a-z+.-]+:/i.test($.url)&&!/[\0- <>\u007F]/.test($.url))}LD.peek=X$0;function LD($,Z,H,J){let B=fZ(H),Q=B==='"'?"Quote":"Apostrophe",z=H.createTracker(J),X,G;if(VD($,H)){let K=H.stack;H.stack=[],X=H.enter("autolink");let F=z.move("<");return F+=z.move(H.containerPhrasing($,{before:F,after:">",...z.current()})),F+=z.move(">"),X(),H.stack=K,F}X=H.enter("link"),G=H.enter("label");let U=z.move("[");if(U+=z.move(H.containerPhrasing($,{before:U,after:"](",...z.current()})),U+=z.move("]("),G(),!$.url&&$.title||/[\0- \u007F]/.test($.url))G=H.enter("destinationLiteral"),U+=z.move("<"),U+=z.move(H.safe($.url,{before:U,after:">",...z.current()})),U+=z.move(">");else G=H.enter("destinationRaw"),U+=z.move(H.safe($.url,{before:U,after:$.title?" ":")",...z.current()}));if(G(),$.title)G=H.enter(`title${Q}`),U+=z.move(" "+B),U+=z.move(H.safe($.title,{before:U,after:B,...z.current()})),U+=z.move(B),G();return U+=z.move(")"),X(),U}function X$0($,Z,H){return VD($,H)?"<":"["}DD.peek=G$0;function DD($,Z,H,J){let B=$.referenceType,Q=H.enter("linkReference"),z=H.enter("label"),X=H.createTracker(J),G=X.move("["),U=H.containerPhrasing($,{before:G,after:"]",...X.current()});G+=X.move(U+"]["),z();let K=H.stack;H.stack=[],z=H.enter("reference");let F=H.safe(H.associationId($),{before:G,after:"]",...X.current()});if(z(),H.stack=K,Q(),B==="full"||!U||U!==F)G+=X.move(F+"]");else if(B==="shortcut")G=G.slice(0,-1);else G+=X.move("]");return G}function G$0(){return"["}function uZ($){let Z=$.options.bullet||"*";if(Z!=="*"&&Z!=="+"&&Z!=="-")throw Error("Cannot serialize items with `"+Z+"` for `options.bullet`, expected `*`, `+`, or `-`");return Z}function yg($){let Z=uZ($),H=$.options.bulletOther;if(!H)return Z==="*"?"-":"*";if(H!=="*"&&H!=="+"&&H!=="-")throw Error("Cannot serialize items with `"+H+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(H===Z)throw Error("Expected `bullet` (`"+Z+"`) and `bulletOther` (`"+H+"`) to be different");return H}function hg($){let Z=$.options.bulletOrdered||".";if(Z!=="."&&Z!==")")throw Error("Cannot serialize items with `"+Z+"` for `options.bulletOrdered`, expected `.` or `)`");return Z}function eK($){let Z=$.options.rule||"*";if(Z!=="*"&&Z!=="-"&&Z!=="_")throw Error("Cannot serialize rules with `"+Z+"` for `options.rule`, expected `*`, `-`, or `_`");return Z}function xg($,Z,H,J){let B=H.enter("list"),Q=H.bulletCurrent,z=$.ordered?hg(H):uZ(H),X=$.ordered?z==="."?")":".":yg(H),G=Z&&H.bulletLastUsed?z===H.bulletLastUsed:!1;if(!$.ordered){let K=$.children?$.children[0]:void 0;if((z==="*"||z==="-")&&K&&(!K.children||!K.children[0])&&H.stack[H.stack.length-1]==="list"&&H.stack[H.stack.length-2]==="listItem"&&H.stack[H.stack.length-3]==="list"&&H.stack[H.stack.length-4]==="listItem"&&H.indexStack[H.indexStack.length-1]===0&&H.indexStack[H.indexStack.length-2]===0&&H.indexStack[H.indexStack.length-3]===0)G=!0;if(eK(H)===z&&K){let F=-1;while(++F<$.children.length){let Y=$.children[F];if(Y&&Y.type==="listItem"&&Y.children&&Y.children[0]&&Y.children[0].type==="thematicBreak"){G=!0;break}}}}if(G)z=X;H.bulletCurrent=z;let U=H.containerFlow($,J);return H.bulletLastUsed=z,H.bulletCurrent=Q,B(),U}function vg($){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 gg($,Z,H,J){let B=vg(H),Q=H.bulletCurrent||uZ(H);if(Z&&Z.type==="list"&&Z.ordered)Q=(typeof Z.start==="number"&&Z.start>-1?Z.start:1)+(H.options.incrementListMarker===!1?0:Z.children.indexOf($))+Q;let z=Q.length+1;if(B==="tab"||B==="mixed"&&(Z&&Z.type==="list"&&Z.spread||$.spread))z=Math.ceil(z/4)*4;let X=H.createTracker(J);X.move(Q+" ".repeat(z-Q.length)),X.shift(z);let G=H.enter("listItem"),U=H.indentLines(H.containerFlow($,X.current()),K);return G(),U;function K(F,Y,W){if(Y)return(W?"":" ".repeat(z))+F;return(W?Q:Q+" ".repeat(z-Q.length))+F}}function fg($,Z,H,J){let B=H.enter("paragraph"),Q=H.enter("phrasing"),z=H.containerPhrasing($,J);return Q(),B(),z}var qD=E9(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function mg($,Z,H,J){return($.children.some(function(z){return qD(z)})?H.containerPhrasing:H.containerFlow).call(H,$,J)}function ug($){let Z=$.options.strong||"*";if(Z!=="*"&&Z!=="_")throw Error("Cannot serialize strong with `"+Z+"` for `options.strong`, expected `*`, or `_`");return Z}MD.peek=U$0;function MD($,Z,H,J){let B=ug(H),Q=H.enter("strong"),z=H.createTracker(J),X=z.move(B+B),G=z.move(H.containerPhrasing($,{after:B,before:X,...z.current()})),U=G.charCodeAt(0),K=mZ(J.before.charCodeAt(J.before.length-1),U,B);if(K.inside)G=q6(U)+G.slice(1);let F=G.charCodeAt(G.length-1),Y=mZ(J.after.charCodeAt(0),F,B);if(Y.inside)G=G.slice(0,-1)+q6(F);let W=z.move(B+B);return Q(),H.attentionEncodeSurroundingInfo={after:Y.outside,before:K.outside},X+G+W}function U$0($,Z,H){return H.options.strong||"*"}function pg($,Z,H,J){return H.safe($.value,J)}function cg($){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 dg($,Z,H){let J=(eK(H)+(H.options.ruleSpaces?" ":"")).repeat(cg(H));return H.options.ruleSpaces?J.slice(0,-1):J}var CB={blockquote:jg,break:KD,code:Sg,definition:Ig,emphasis:FD,hardBreak:KD,heading:bg,html:YD,image:WD,imageReference:AD,inlineCode:ND,link:LD,linkReference:DD,list:xg,listItem:gg,paragraph:fg,root:mg,strong:MD,text:pg,thematicBreak:dg};function _D(){return{enter:{table:K$0,tableData:lg,tableHeader:lg,tableRow:Y$0},exit:{codeText:W$0,table:F$0,tableData:PD,tableHeader:PD,tableRow:PD}}}function K$0($){let Z=$._align;t1(Z,"expected `_align` on table"),this.enter({type:"table",align:Z.map(function(H){return H==="none"?null:H}),children:[]},$),this.data.inTable=!0}function F$0($){this.exit($),this.data.inTable=void 0}function Y$0($){this.enter({type:"tableRow",children:[]},$)}function PD($){this.exit($)}function lg($){this.enter({type:"tableCell",children:[]},$)}function W$0($){let Z=this.resume();if(this.data.inTable)Z=Z.replace(/\\([\\|])/g,A$0);let H=this.stack[this.stack.length-1];t1(H.type==="inlineCode"),H.value=Z,this.exit($)}function A$0($,Z){return Z==="|"?Z:$}function jD($){let Z=$||{},H=Z.tableCellPadding,J=Z.tablePipeAlign,B=Z.stringLength,Q=H?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
50
- `,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[\t :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:Y,table:z,tableCell:G,tableRow:X}};function z(W,A,N,L){return U(K(W,N,L),W.align)}function X(W,A,N,L){let V=F(W,N,L),D=U([V]);return D.slice(0,D.indexOf(`
51
- `))}function G(W,A,N,L){let V=N.enter("tableCell"),D=N.enter("phrasing"),q=N.containerPhrasing(W,{...L,before:Q,after:Q});return D(),V(),q}function U(W,A){return _g(W,{align:A,alignDelimiters:J,padding:H,stringLength:B})}function K(W,A,N){let L=W.children,V=-1,D=[],q=A.enter("table");while(++V<L.length)D[V]=F(L[V],A,N);return q(),D}function F(W,A,N){let L=W.children,V=-1,D=[],q=A.enter("tableRow");while(++V<L.length)D[V]=G(L[V],W,A,N);return q(),D}function Y(W,A,N){let L=CB.inlineCode(W,A,N);if(N.stack.includes("tableCell"))L=L.replace(/\|/g,"\\$&");return L}}function OD(){return{exit:{taskListCheckValueChecked:ig,taskListCheckValueUnchecked:ig,paragraph:N$0}}}function TD(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:V$0}}}function ig($){let Z=this.stack[this.stack.length-2];t1(Z.type==="listItem"),Z.checked=$.type==="taskListCheckValueChecked"}function N$0($){let Z=this.stack[this.stack.length-2];if(Z&&Z.type==="listItem"&&typeof Z.checked==="boolean"){let H=this.stack[this.stack.length-1];t1(H.type==="paragraph");let J=H.children[0];if(J&&J.type==="text"){let B=Z.children,Q=-1,z;while(++Q<B.length){let X=B[Q];if(X.type==="paragraph"){z=X;break}}if(z===H){if(J.value=J.value.slice(1),J.value.length===0)H.children.shift();else if(H.position&&J.position&&typeof J.position.start.offset==="number")J.position.start.column++,J.position.start.offset++,H.position.start=Object.assign({},J.position.start)}}}this.exit($)}function V$0($,Z,H,J){let B=$.children[0],Q=typeof $.checked==="boolean"&&B&&B.type==="paragraph",z="["+($.checked?"x":" ")+"] ",X=H.createTracker(J);if(Q)X.move(z);let G=CB.listItem($,Z,H,{...J,...X.current()});if(Q)G=G.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,U);return G;function U(K){return K+z}}function CD(){return[BD(),zD(),GD(),_D(),OD()]}function wD($){return{extensions:[QD(),XD($),UD(),jD($),TD()]}}var L$0={tokenize:_$0,partial:!0},rg={tokenize:j$0,partial:!0},ag={tokenize:O$0,partial:!0},ng={tokenize:T$0,partial:!0},D$0={tokenize:C$0,partial:!0},og={name:"wwwAutolink",tokenize:M$0,previous:tg},sg={name:"protocolAutolink",tokenize:P$0,previous:eg},z3={name:"emailAutolink",tokenize:q$0,previous:$f},I9={};function SD(){return{text:I9}}var l7=48;while(l7<123)if(I9[l7]=z3,l7++,l7===58)l7=65;else if(l7===91)l7=97;I9[43]=z3;I9[45]=z3;I9[46]=z3;I9[95]=z3;I9[72]=[z3,sg];I9[104]=[z3,sg];I9[87]=[z3,og];I9[119]=[z3,og];function q$0($,Z,H){let J=this,B,Q;return z;function z(F){if(!ED(F)||!$f.call(J,J.previous)||ID(J.events))return H(F);return $.enter("literalAutolink"),$.enter("literalAutolinkEmail"),X(F)}function X(F){if(ED(F))return $.consume(F),X;if(F===64)return $.consume(F),G;return H(F)}function G(F){if(F===46)return $.check(D$0,K,U)(F);if(F===45||F===95||c5(F))return Q=!0,$.consume(F),G;return K(F)}function U(F){return $.consume(F),B=!0,G}function K(F){if(Q&&B&&Q4(J.previous))return $.exit("literalAutolinkEmail"),$.exit("literalAutolink"),Z(F);return H(F)}}function M$0($,Z,H){let J=this;return B;function B(z){if(z!==87&&z!==119||!tg.call(J,J.previous)||ID(J.events))return H(z);return $.enter("literalAutolink"),$.enter("literalAutolinkWww"),$.check(L$0,$.attempt(rg,$.attempt(ag,Q),H),H)(z)}function Q(z){return $.exit("literalAutolinkWww"),$.exit("literalAutolink"),Z(z)}}function P$0($,Z,H){let J=this,B="",Q=!1;return z;function z(F){if((F===72||F===104)&&eg.call(J,J.previous)&&!ID(J.events))return $.enter("literalAutolink"),$.enter("literalAutolinkHttp"),B+=String.fromCodePoint(F),$.consume(F),X;return H(F)}function X(F){if(Q4(F)&&B.length<5)return B+=String.fromCodePoint(F),$.consume(F),X;if(F===58){let Y=B.toLowerCase();if(Y==="http"||Y==="https")return $.consume(F),G}return H(F)}function G(F){if(F===47){if($.consume(F),Q)return U;return Q=!0,G}return H(F)}function U(F){return F===null||x7(F)||S1(F)||C9(F)||v7(F)?H(F):$.attempt(rg,$.attempt(ag,K),H)(F)}function K(F){return $.exit("literalAutolinkHttp"),$.exit("literalAutolink"),Z(F)}}function _$0($,Z,H){let J=0;return B;function B(z){if((z===87||z===119)&&J<3)return J++,$.consume(z),B;if(z===46&&J===3)return $.consume(z),Q;return H(z)}function Q(z){return z===null?H(z):Z(z)}}function j$0($,Z,H){let J,B,Q;return z;function z(U){if(U===46||U===95)return $.check(ng,G,X)(U);if(U===null||S1(U)||C9(U)||U!==45&&v7(U))return G(U);return Q=!0,$.consume(U),z}function X(U){if(U===95)J=!0;else B=J,J=void 0;return $.consume(U),z}function G(U){if(B||J||!Q)return H(U);return Z(U)}}function O$0($,Z){let H=0,J=0;return B;function B(z){if(z===40)return H++,$.consume(z),B;if(z===41&&J<H)return Q(z);if(z===33||z===34||z===38||z===39||z===41||z===42||z===44||z===46||z===58||z===59||z===60||z===63||z===93||z===95||z===126)return $.check(ng,Z,Q)(z);if(z===null||S1(z)||C9(z))return Z(z);return $.consume(z),B}function Q(z){if(z===41)J++;return $.consume(z),B}}function T$0($,Z,H){return J;function J(X){if(X===33||X===34||X===39||X===41||X===42||X===44||X===46||X===58||X===59||X===63||X===95||X===126)return $.consume(X),J;if(X===38)return $.consume(X),Q;if(X===93)return $.consume(X),B;if(X===60||X===null||S1(X)||C9(X))return Z(X);return H(X)}function B(X){if(X===null||X===40||X===91||S1(X)||C9(X))return Z(X);return J(X)}function Q(X){return Q4(X)?z(X):H(X)}function z(X){if(X===59)return $.consume(X),J;if(Q4(X))return $.consume(X),z;return H(X)}}function C$0($,Z,H){return J;function J(Q){return $.consume(Q),B}function B(Q){return c5(Q)?H(Q):Z(Q)}}function tg($){return $===null||$===40||$===42||$===95||$===91||$===93||$===126||S1($)}function eg($){return!Q4($)}function $f($){return!($===47||ED($))}function ED($){return $===43||$===45||$===46||$===95||c5($)}function ID($){let Z=$.length,H=!1;while(Z--){let J=$[Z][1];if((J.type==="labelLink"||J.type==="labelImage")&&!J._balanced){H=!0;break}if(J._gfmAutolinkLiteralWalkedInto){H=!1;break}}if($.length>0&&!H)$[$.length-1][1]._gfmAutolinkLiteralWalkedInto=!0;return H}var w$0={tokenize:y$0,partial:!0};function kD(){return{document:{[91]:{name:"gfmFootnoteDefinition",tokenize:k$0,continuation:{tokenize:R$0},exit:b$0}},text:{[91]:{name:"gfmFootnoteCall",tokenize:I$0},[93]:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:E$0,resolveTo:S$0}}}}function E$0($,Z,H){let J=this,B=J.events.length,Q=J.parser.gfmFootnotes||(J.parser.gfmFootnotes=[]),z;while(B--){let G=J.events[B][1];if(G.type==="labelImage"){z=G;break}if(G.type==="gfmFootnoteCall"||G.type==="labelLink"||G.type==="label"||G.type==="image"||G.type==="link")break}return X;function X(G){if(!z||!z._balanced)return H(G);let U=r4(J.sliceSerialize({start:z.end,end:J.now()}));if(U.codePointAt(0)!==94||!Q.includes(U.slice(1)))return H(G);return $.enter("gfmFootnoteCallLabelMarker"),$.consume(G),$.exit("gfmFootnoteCallLabelMarker"),Z(G)}}function S$0($,Z){let H=$.length,J;while(H--)if($[H][1].type==="labelImage"&&$[H][0]==="enter"){J=$[H][1];break}$[H+1][1].type="data",$[H+3][1].type="gfmFootnoteCallLabelMarker";let B={type:"gfmFootnoteCall",start:Object.assign({},$[H+3][1].start),end:Object.assign({},$[$.length-1][1].end)},Q={type:"gfmFootnoteCallMarker",start:Object.assign({},$[H+3][1].end),end:Object.assign({},$[H+3][1].end)};Q.end.column++,Q.end.offset++,Q.end._bufferIndex++;let z={type:"gfmFootnoteCallString",start:Object.assign({},Q.end),end:Object.assign({},$[$.length-1][1].start)},X={type:"chunkString",contentType:"string",start:Object.assign({},z.start),end:Object.assign({},z.end)},G=[$[H+1],$[H+2],["enter",B,Z],$[H+3],$[H+4],["enter",Q,Z],["exit",Q,Z],["enter",z,Z],["enter",X,Z],["exit",X,Z],["exit",z,Z],$[$.length-2],$[$.length-1],["exit",B,Z]];return $.splice(H,$.length-H+1,...G),$}function I$0($,Z,H){let J=this,B=J.parser.gfmFootnotes||(J.parser.gfmFootnotes=[]),Q=0,z;return X;function X(F){return $.enter("gfmFootnoteCall"),$.enter("gfmFootnoteCallLabelMarker"),$.consume(F),$.exit("gfmFootnoteCallLabelMarker"),G}function G(F){if(F!==94)return H(F);return $.enter("gfmFootnoteCallMarker"),$.consume(F),$.exit("gfmFootnoteCallMarker"),$.enter("gfmFootnoteCallString"),$.enter("chunkString").contentType="string",U}function U(F){if(Q>999||F===93&&!z||F===null||F===91||S1(F))return H(F);if(F===93){$.exit("chunkString");let Y=$.exit("gfmFootnoteCallString");if(!B.includes(r4(J.sliceSerialize(Y))))return H(F);return $.enter("gfmFootnoteCallLabelMarker"),$.consume(F),$.exit("gfmFootnoteCallLabelMarker"),$.exit("gfmFootnoteCall"),Z}if(!S1(F))z=!0;return Q++,$.consume(F),F===92?K:U}function K(F){if(F===91||F===92||F===93)return $.consume(F),Q++,U;return U(F)}}function k$0($,Z,H){let J=this,B=J.parser.gfmFootnotes||(J.parser.gfmFootnotes=[]),Q,z=0,X;return G;function G(A){return $.enter("gfmFootnoteDefinition")._container=!0,$.enter("gfmFootnoteDefinitionLabel"),$.enter("gfmFootnoteDefinitionLabelMarker"),$.consume(A),$.exit("gfmFootnoteDefinitionLabelMarker"),U}function U(A){if(A===94)return $.enter("gfmFootnoteDefinitionMarker"),$.consume(A),$.exit("gfmFootnoteDefinitionMarker"),$.enter("gfmFootnoteDefinitionLabelString"),$.enter("chunkString").contentType="string",K;return H(A)}function K(A){if(z>999||A===93&&!X||A===null||A===91||S1(A))return H(A);if(A===93){$.exit("chunkString");let N=$.exit("gfmFootnoteDefinitionLabelString");return Q=r4(J.sliceSerialize(N)),$.enter("gfmFootnoteDefinitionLabelMarker"),$.consume(A),$.exit("gfmFootnoteDefinitionLabelMarker"),$.exit("gfmFootnoteDefinitionLabel"),Y}if(!S1(A))X=!0;return z++,$.consume(A),A===92?F:K}function F(A){if(A===91||A===92||A===93)return $.consume(A),z++,K;return K(A)}function Y(A){if(A===58){if($.enter("definitionMarker"),$.consume(A),$.exit("definitionMarker"),!B.includes(Q))B.push(Q);return o0($,W,"gfmFootnoteDefinitionWhitespace")}return H(A)}function W(A){return Z(A)}}function R$0($,Z,H){return $.check(w9,Z,$.attempt(w$0,Z,H))}function b$0($){$.exit("gfmFootnoteDefinition")}function y$0($,Z,H){let J=this;return o0($,B,"gfmFootnoteDefinitionIndent",5);function B(Q){let z=J.events[J.events.length-1];return z&&z[1].type==="gfmFootnoteDefinitionIndent"&&z[2].sliceSerialize(z[1],!0).length===4?Z(Q):H(Q)}}function RD($){let H=($||{}).singleTilde,J={name:"strikethrough",tokenize:Q,resolveAll:B};if(H===null||H===void 0)H=!0;return{text:{[126]:J},insideSpan:{null:[J]},attentionMarkers:{null:[126]}};function B(z,X){let G=-1;while(++G<z.length)if(z[G][0]==="enter"&&z[G][1].type==="strikethroughSequenceTemporary"&&z[G][1]._close){let U=G;while(U--)if(z[U][0]==="exit"&&z[U][1].type==="strikethroughSequenceTemporary"&&z[U][1]._open&&z[G][1].end.offset-z[G][1].start.offset===z[U][1].end.offset-z[U][1].start.offset){z[G][1].type="strikethroughSequence",z[U][1].type="strikethroughSequence";let K={type:"strikethrough",start:Object.assign({},z[U][1].start),end:Object.assign({},z[G][1].end)},F={type:"strikethroughText",start:Object.assign({},z[U][1].end),end:Object.assign({},z[G][1].start)},Y=[["enter",K,X],["enter",z[U][1],X],["exit",z[U][1],X],["enter",F,X]],W=X.parser.constructs.insideSpan.null;if(W)r5(Y,Y.length,0,V6(W,z.slice(U+1,G),X));r5(Y,Y.length,0,[["exit",F,X],["enter",z[G][1],X],["exit",z[G][1],X],["exit",K,X]]),r5(z,U-1,G-U+3,Y),G=U+Y.length-2;break}}G=-1;while(++G<z.length)if(z[G][1].type==="strikethroughSequenceTemporary")z[G][1].type="data";return z}function Q(z,X,G){let U=this.previous,K=this.events,F=0;return Y;function Y(A){if(U===126&&K[K.length-1][1].type!=="characterEscape")return G(A);return z.enter("strikethroughSequenceTemporary"),W(A)}function W(A){let N=J3(U);if(A===126){if(F>1)return G(A);return z.consume(A),F++,W}if(F<2&&!H)return G(A);let L=z.exit("strikethroughSequenceTemporary"),V=J3(A);return L._open=!V||V===2&&Boolean(N),L._close=!N||N===2&&Boolean(V),X(A)}}}class bD{constructor(){this.map=[]}add($,Z,H){h$0(this,$,Z,H)}consume($){if(this.map.sort(function(B,Q){return B[0]-Q[0]}),this.map.length===0)return;let Z=this.map.length,H=[];while(Z>0)Z-=1,H.push($.slice(this.map[Z][0]+this.map[Z][1]),this.map[Z][2]),$.length=this.map[Z][0];H.push($.slice()),$.length=0;let J=H.pop();while(J){for(let B of J)$.push(B);J=H.pop()}this.map.length=0}}function h$0($,Z,H,J){let B=0;if(H===0&&J.length===0)return;while(B<$.map.length){if($.map[B][0]===Z){$.map[B][1]+=H,$.map[B][2].push(...J);return}B+=1}$.map.push([Z,H,J])}function Zf($,Z){let H=!1,J=[];while(Z<$.length){let B=$[Z];if(H){if(B[0]==="enter"){if(B[1].type==="tableContent")J.push($[Z+1][1].type==="tableDelimiterMarker"?"left":"none")}else if(B[1].type==="tableContent"){if($[Z-1][1].type==="tableDelimiterMarker"){let Q=J.length-1;J[Q]=J[Q]==="left"?"center":"right"}}else if(B[1].type==="tableDelimiterRow")break}else if(B[0]==="enter"&&B[1].type==="tableDelimiterRow")H=!0;Z+=1}return J}function yD(){return{flow:{null:{name:"table",tokenize:x$0,resolveAll:v$0}}}}function x$0($,Z,H){let J=this,B=0,Q=0,z;return X;function X(E){let h=J.events.length-1;while(h>-1){let w=J.events[h][1].type;if(w==="lineEnding"||w==="linePrefix")h--;else break}let x=h>-1?J.events[h][1].type:null,R=x==="tableHead"||x==="tableRow"?P:G;if(R===P&&J.parser.lazy[J.now().line])return H(E);return R(E)}function G(E){return $.enter("tableHead"),$.enter("tableRow"),U(E)}function U(E){if(E===124)return K(E);return z=!0,Q+=1,K(E)}function K(E){if(E===null)return H(E);if(x0(E)){if(Q>1)return Q=0,J.interrupt=!0,$.exit("tableRow"),$.enter("lineEnding"),$.consume(E),$.exit("lineEnding"),W;return H(E)}if(e0(E))return o0($,K,"whitespace")(E);if(Q+=1,z)z=!1,B+=1;if(E===124)return $.enter("tableCellDivider"),$.consume(E),$.exit("tableCellDivider"),z=!0,K;return $.enter("data"),F(E)}function F(E){if(E===null||E===124||S1(E))return $.exit("data"),K(E);return $.consume(E),E===92?Y:F}function Y(E){if(E===92||E===124)return $.consume(E),F;return F(E)}function W(E){if(J.interrupt=!1,J.parser.lazy[J.now().line])return H(E);if($.enter("tableDelimiterRow"),z=!1,e0(E))return o0($,A,"linePrefix",J.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(E);return A(E)}function A(E){if(E===45||E===58)return L(E);if(E===124)return z=!0,$.enter("tableCellDivider"),$.consume(E),$.exit("tableCellDivider"),N;return M(E)}function N(E){if(e0(E))return o0($,L,"whitespace")(E);return L(E)}function L(E){if(E===58)return Q+=1,z=!0,$.enter("tableDelimiterMarker"),$.consume(E),$.exit("tableDelimiterMarker"),V;if(E===45)return Q+=1,V(E);if(E===null||x0(E))return j(E);return M(E)}function V(E){if(E===45)return $.enter("tableDelimiterFiller"),D(E);return M(E)}function D(E){if(E===45)return $.consume(E),D;if(E===58)return z=!0,$.exit("tableDelimiterFiller"),$.enter("tableDelimiterMarker"),$.consume(E),$.exit("tableDelimiterMarker"),q;return $.exit("tableDelimiterFiller"),q(E)}function q(E){if(e0(E))return o0($,j,"whitespace")(E);return j(E)}function j(E){if(E===124)return A(E);if(E===null||x0(E)){if(!z||B!==Q)return M(E);return $.exit("tableDelimiterRow"),$.exit("tableHead"),Z(E)}return M(E)}function M(E){return H(E)}function P(E){return $.enter("tableRow"),T(E)}function T(E){if(E===124)return $.enter("tableCellDivider"),$.consume(E),$.exit("tableCellDivider"),T;if(E===null||x0(E))return $.exit("tableRow"),Z(E);if(e0(E))return o0($,T,"whitespace")(E);return $.enter("data"),C(E)}function C(E){if(E===null||E===124||S1(E))return $.exit("data"),T(E);return $.consume(E),E===92?k:C}function k(E){if(E===92||E===124)return $.consume(E),C;return C(E)}}function v$0($,Z){let H=-1,J=!0,B=0,Q=[0,0,0,0],z=[0,0,0,0],X=!1,G=0,U,K,F,Y=new bD;while(++H<$.length){let W=$[H],A=W[1];if(W[0]==="enter"){if(A.type==="tableHead"){if(X=!1,G!==0)Hf(Y,Z,G,U,K),K=void 0,G=0;U={type:"table",start:Object.assign({},A.start),end:Object.assign({},A.end)},Y.add(H,0,[["enter",U,Z]])}else if(A.type==="tableRow"||A.type==="tableDelimiterRow"){if(J=!0,F=void 0,Q=[0,0,0,0],z=[0,H+1,0,0],X)X=!1,K={type:"tableBody",start:Object.assign({},A.start),end:Object.assign({},A.end)},Y.add(H,0,[["enter",K,Z]]);B=A.type==="tableDelimiterRow"?2:K?3:1}else if(B&&(A.type==="data"||A.type==="tableDelimiterMarker"||A.type==="tableDelimiterFiller")){if(J=!1,z[2]===0){if(Q[1]!==0)z[0]=z[1],F=$F(Y,Z,Q,B,void 0,F),Q=[0,0,0,0];z[2]=H}}else if(A.type==="tableCellDivider")if(J)J=!1;else{if(Q[1]!==0)z[0]=z[1],F=$F(Y,Z,Q,B,void 0,F);Q=z,z=[Q[1],H,0,0]}}else if(A.type==="tableHead")X=!0,G=H;else if(A.type==="tableRow"||A.type==="tableDelimiterRow"){if(G=H,Q[1]!==0)z[0]=z[1],F=$F(Y,Z,Q,B,H,F);else if(z[1]!==0)F=$F(Y,Z,z,B,H,F);B=0}else if(B&&(A.type==="data"||A.type==="tableDelimiterMarker"||A.type==="tableDelimiterFiller"))z[3]=H}if(G!==0)Hf(Y,Z,G,U,K);Y.consume(Z.events),H=-1;while(++H<Z.events.length){let W=Z.events[H];if(W[0]==="enter"&&W[1].type==="table")W[1]._align=Zf(Z.events,H)}return $}function $F($,Z,H,J,B,Q){let z=J===1?"tableHeader":J===2?"tableDelimiter":"tableData",X="tableContent";if(H[0]!==0)Q.end=Object.assign({},pZ(Z.events,H[0])),$.add(H[0],0,[["exit",Q,Z]]);let G=pZ(Z.events,H[1]);if(Q={type:z,start:Object.assign({},G),end:Object.assign({},G)},$.add(H[1],0,[["enter",Q,Z]]),H[2]!==0){let U=pZ(Z.events,H[2]),K=pZ(Z.events,H[3]),F={type:"tableContent",start:Object.assign({},U),end:Object.assign({},K)};if($.add(H[2],0,[["enter",F,Z]]),J!==2){let Y=Z.events[H[2]],W=Z.events[H[3]];if(Y[1].end=Object.assign({},W[1].end),Y[1].type="chunkText",Y[1].contentType="text",H[3]>H[2]+1){let A=H[2]+1,N=H[3]-H[2]-1;$.add(A,N,[])}}$.add(H[3]+1,0,[["exit",F,Z]])}if(B!==void 0)Q.end=Object.assign({},pZ(Z.events,B)),$.add(B,0,[["exit",Q,Z]]),Q=void 0;return Q}function Hf($,Z,H,J,B){let Q=[],z=pZ(Z.events,H);if(B)B.end=Object.assign({},z),Q.push(["exit",B,Z]);J.end=Object.assign({},z),Q.push(["exit",J,Z]),$.add(H+1,0,Q)}function pZ($,Z){let H=$[Z],J=H[0]==="enter"?"start":"end";return H[1][J]}var g$0={name:"tasklistCheck",tokenize:f$0};function hD(){return{text:{[91]:g$0}}}function f$0($,Z,H){let J=this;return B;function B(G){if(J.previous!==null||!J._gfmTasklistFirstContentOfListItem)return H(G);return $.enter("taskListCheck"),$.enter("taskListCheckMarker"),$.consume(G),$.exit("taskListCheckMarker"),Q}function Q(G){if(S1(G))return $.enter("taskListCheckValueUnchecked"),$.consume(G),$.exit("taskListCheckValueUnchecked"),z;if(G===88||G===120)return $.enter("taskListCheckValueChecked"),$.consume(G),$.exit("taskListCheckValueChecked"),z;return H(G)}function z(G){if(G===93)return $.enter("taskListCheckMarker"),$.consume(G),$.exit("taskListCheckMarker"),$.exit("taskListCheck"),X;return H(G)}function X(G){if(x0(G))return Z(G);if(e0(G))return $.check({tokenize:m$0},Z,H)(G);return H(G)}}function m$0($,Z,H){return o0($,J,"whitespace");function J(B){return B===null?H(B):Z(B)}}function Jf($){return NK([SD(),kD(),RD($),yD(),hD()])}var u$0={};function ZF($){let Z=this,H=$||u$0,J=Z.data(),B=J.micromarkExtensions||(J.micromarkExtensions=[]),Q=J.fromMarkdownExtensions||(J.fromMarkdownExtensions=[]),z=J.toMarkdownExtensions||(J.toMarkdownExtensions=[]);B.push(Jf(H)),Q.push(CD()),z.push(wD(H))}var i7=_(r(),1),p$0=[ZF],c$0=[tK],d$0={code({node:$,className:Z,children:H,...J}){return i7.jsx("code",{className:z0("rounded-xs bg-accent px-1 py-0.5 font-mono font-normal before:content-none after:content-none",Z),...J,children:H})},pre({children:$}){return i7.jsx("div",{className:"not-prose my-2 rounded-lg border border-border bg-accent px-3 py-2.5",children:i7.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 Bf({size:$="sm",content:Z}){return i7.jsx("div",{className:z0("prose max-w-full min-w-0 wrap-anywhere prose-inherit",$==="sm"&&"prose-sm"),children:i7.jsx(uK,{remarkPlugins:p$0,rehypePlugins:c$0,components:d$0,children:Z})})}function Qf({content:$}){return i7.jsx(uK,{allowedElements:[],skipHtml:!0,unwrapDisallowed:!0,children:$})}var Bq=_(p(),1);var zf="/agentation-4s0nn45p.png";var Xf="/airtable-hsa66v6q.png";var Gf="/apollo-2ed5dy2d.png";var Uf="/asana-tvgtwbx2.png";var Kf="/atlassian-b3tq39hs.png";var Ff="/box-w3n36t5g.png";var xD="/chrome-tspm94rw.svg";var Yf="/clickup-qqrqqvqb.png";var Wf="/cloudflare-j9p931v6.png";var Af="/context7-8ht0xjfy.png";var Nf="/datadog-70ne3yzt.png";var Vf="/discord-vejhptwx.png";var Lf="/dropbox-4m5s9mgr.png";var Df="/elevenlabs-2nzzej1t.png";var qf="/exa-qqj3vr0x.png";var Mf="/figma-y9898rry.png";var Pf="/firecrawl-w2t8nehx.png";var _f="/github-av5r5y3e.png";var jf="/gitlab-4pv5vm6b.png";var Of="/gmail-sg6a5v3x.png";var Tf="/googlecalendar-nqhh2v7r.png";var Cf="/googledrive-6s8xyab7.png";var wf="/grafana-1yfsnwr6.png";var Ef="/granola-7j3b0nk2.png";var Sf="/hubspot-hghcmc2t.png";var If="/huggingface-kxzaxj83.png";var kf="/intercom-td763jt8.png";var Rf="/linear-v9s3az2d.png";var bf="/monday-jdbs4wwf.png";var yf="/mongodb-emzxvhd5.png";var hf="/neon-zj4qar44.png";var xf="/notion-w034c0b8.png";var vf="/paper-zbt34fab.png";var gf="/paypal-kwwf7xsc.png";var ff="/perplexity-4y63rxvj.png";var mf="/postgresql-qsspbsr1.png";var uf="/posthog-sphppc4w.png";var pf="/puppeteer-2xjt1a9b.png";var cf="/railway-834de8d2.png";var df="/redis-spm6w2m1.png";var lf="/salesforce-1mk56v4z.png";var rf="/sentry-hdwpmvek.png";var af="/shopify-90dadaav.png";var nf="/slack-1c1wj62s.png";var of="/snowflake-hfpykpgy.png";var sf="/stripe-zrfaqbj3.png";var tf="/supabase-4vg33zf2.png";var ef="/telegram-v6tjyrs7.png";var $m="/twilio-dpyjdwpj.png";var Zm="/vercel-7d0ssw28.png";var Hm="/zapier-p67qfch0.png";var pZ0={agentation:zf,airtable:Xf,apollo:Gf,asana:Uf,atlassian:Kf,box:Ff,chrome:xD,"chrome-devtools":xD,clickup:Yf,cloudflare:Wf,context7:Af,datadog:Nf,discord:Vf,dropbox:Lf,elevenlabs:Df,exa:qf,figma:Mf,firecrawl:Pf,github:_f,gitlab:jf,gmail:Of,googlecalendar:Tf,googledrive:Cf,grafana:wf,granola:Ef,hubspot:Sf,huggingface:If,intercom:kf,linear:Rf,monday:bf,mongodb:yf,neon:hf,notion:xf,paper:vf,paypal:gf,perplexity:ff,postgresql:mf,posthog:uf,puppeteer:pf,railway:cf,redis:df,salesforce:lf,sentry:rf,shopify:af,slack:nf,snowflake:of,stripe:sf,supabase:tf,telegram:ef,twilio:$m,vercel:Zm,zapier:Hm},cZ0={"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 Jm($){let Z=$.match(/^claude[._]ai[._\s]+(.+)$/i);if(!Z)return $;return Z[1].replace(/_/g," ")}function HF($){return $.toLowerCase().replace(/[\s._-]+/g,"")}var dZ0=new Map(Object.entries(pZ0).map(([$,Z])=>[HF($),Z])),lZ0=new Map(Object.entries(cZ0).map(([$,Z])=>[HF($),HF(Z)]));function JF($){let Z=HF(Jm($));return dZ0.get(lZ0.get(Z)??Z)}function BF($){return Jm($).split(/[\s._-]+/).filter(Boolean).map((Z)=>Z[0].toUpperCase()+Z.slice(1)).join(" ")}var vD=_(r(),1);function wB({open:$,children:Z}){return vD.jsx(G2,{initial:!1,children:$&&vD.jsx(Y5.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 Bm=_(p(),1);var Xm=_(r(),1),iZ0=/\.(png|jpe?g|gif|webp|avif|svg)$/i;function Qm($,Z){if($.name!=="Read"||!Z)return null;let H=$.input,J=typeof H.file_path==="string"?H.file_path:null;if(!J||!iZ0.test(J))return null;let B=Z.endsWith("/")?Z:`${Z}/`;if(!J.startsWith(B))return null;return J.slice(B.length)}function zm({relPath:$}){let Z=F5(),[H,J]=Bm.useState(!1);if(H)return null;let B=`/api/workspaces/${Z}/preview/${$.split("/").map(encodeURIComponent).join("/")}`;return Xm.jsx("img",{src:B,alt:$,loading:"lazy",onError:()=>J(!0),className:"max-h-64 max-w-full self-start rounded-lg border border-border object-contain"})}var kB=_(p(),1);var Um=_(r(),1),rZ0=z0("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 Gm({children:$,active:Z=!0,className:H}){return Um.jsx("span",{className:z0(H,Z&&rZ0),children:$})}var EB=_(r(),1);function QF({className:$}){return EB.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:[EB.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"}),EB.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 z4=_(r(),1),zF="group/row flex w-full items-center gap-2 py-1.5 text-left select-none";function dZ({isFirst:$,isLast:Z,marker:H,loading:J=!1,isError:B=!1,children:Q}){let z=H!=null||J;return z4.jsxs("div",{className:"relative flex gap-2.5",children:[z4.jsxs("div",{className:"relative w-[13px] shrink-0",children:[!$&&z4.jsx("span",{className:z0("absolute top-0 left-1/2 w-px -translate-x-1/2 bg-border",z?"h-1":"h-2.5")}),!Z&&z4.jsx("span",{className:z0("absolute bottom-0 left-1/2 w-px -translate-x-1/2 bg-border",z?"top-[26px]":"top-5")}),H?z4.jsx("span",{className:"absolute top-[15px] left-1/2 z-10 -translate-x-1/2 -translate-y-1/2",children:H}):J?z4.jsx("span",{className:"absolute top-[15px] left-1/2 z-10 flex -translate-x-1/2 -translate-y-1/2 p-0.5",children:z4.jsx(y5,{size:12,stroke:1.75,className:"animate-spin text-muted-foreground"})}):z4.jsx("span",{className:z0("absolute top-[15px] left-1/2 z-10 size-[5px] -translate-x-1/2 -translate-y-1/2 rounded-full",B?"bg-destructive":"bg-border")})]}),Q]})}function SB({open:$}){return z4.jsx(Y5.span,{animate:{rotate:$?90:0},transition:{type:"spring",duration:0.2,bounce:0.1},className:z0("flex shrink-0",$?"opacity-100":"opacity-0 group-hover/row:opacity-100"),children:z4.jsx(E7,{size:12,stroke:1.75})})}function cZ({children:$,className:Z}){return z4.jsx("span",{className:z0("flex size-4 items-center justify-center overflow-hidden rounded-xs bg-muted",Z),children:$})}function Km({icon:$,size:Z=12,stroke:H=1.75}){return z4.jsx(cZ,{children:z4.jsx($,{size:Z,stroke:H,className:"text-muted-foreground"})})}function Fm({src:$}){if(!$)return z4.jsx(cZ,{children:z4.jsx(QF,{className:"size-3 text-muted-foreground"})});return z4.jsx(cZ,{children:z4.jsx("img",{src:$,alt:"",className:"size-full object-cover"})})}var BH0=Am(),gD=Pm();function QH0($){if(!$)return"$";return/^[A-Za-z_][A-Za-z0-9_]*$/.test($)?`$${$}`:`\${${$}}`}function zH0($){try{return gD($,QH0)}catch{return null}}function _m($){return $.split("/").pop()??$}var XH0=new Set(["bash","sh","zsh","fish","dash","ash","ksh","mksh","csh","tcsh","nu","pwsh","powershell"]),GH0=new Set(["-o","+o","-O","+O","--rcfile","--init-file"]),UH0=/^[A-Za-z_][A-Za-z0-9_]*=/;function KH0($){if(/^-[a-zA-Z]*c$/.test($))return!0;let Z=$.toLowerCase();return Z==="--command"||Z==="-command"}function FH0($){let Z=zH0($);if(!Z||Z.length<3)return null;let H=(Q)=>{let z=Z[Q];return typeof z==="string"?z:null},J=0,B=()=>{while(UH0.test(H(J)??""))J++};if(B(),_m(H(J)??"")==="env")J++,B();if(!XH0.has(_m(H(J)??"")))return null;J++;while(J<Z.length){let Q=H(J);if(Q===null)return null;if(KH0(Q)){if(J+2!==Z.length)return null;return H(J+1)?.trim()||null}if(!Q.startsWith("-")&&!Q.startsWith("+"))return null;J+=GH0.has(Q)?2:1}return null}function YH0($){let Z=$;for(let H=0;H<3;H++){let J=FH0(Z);if(J===null)return Z;Z=J}return Z}function WH0($){return $.replace(/\\\r?\n[ \t]*/g," ").replace(/[ \t]*\r?\n[ \t]*/g," ").replace(/[ \t]{2,}/g," ").trim()}function a7($){return WH0(YH0($))}function lZ($,Z){let H=a7($);return H?Z(`$ ${H}`):""}var AH0=/^[A-Za-z]:\//;function NH0($=""){if(!$)return $;return $.replace(/\\/g,"/").replace(AH0,(Z)=>Z.toUpperCase())}var VH0=/^[/\\](?![/\\])|^[/\\]{2}(?!\.)|^[A-Za-z]:[/\\]/;var jm=/^\/([A-Za-z]:)?$/;function LH0(){if(typeof process<"u"&&typeof process.cwd==="function")return process.cwd().replace(/\\/g,"/");return"/"}var fD=function(...$){$=$.map((J)=>NH0(J));let Z="",H=!1;for(let J=$.length-1;J>=-1&&!H;J--){let B=J>=0?$[J]:LH0();if(!B||B.length===0)continue;Z=`${B}/${Z}`,H=mD(B)}if(Z=Om(Z,!H),H&&!mD(Z))return`/${Z}`;return Z.length>0?Z:"."};function Om($,Z){let H="",J=0,B=-1,Q=0,z=null;for(let X=0;X<=$.length;++X){if(X<$.length)z=$[X];else if(z==="/")break;else z="/";if(z==="/"){if(B===X-1||Q===1);else if(Q===2){if(H.length<2||J!==2||H[H.length-1]!=="."||H[H.length-2]!=="."){if(H.length>2){let G=H.lastIndexOf("/");if(G===-1)H="",J=0;else H=H.slice(0,G),J=H.length-1-H.lastIndexOf("/");B=X,Q=0;continue}else if(H.length>0){H="",J=0,B=X,Q=0;continue}}if(Z)H+=H.length>0?"/..":"..",J=2}else{if(H.length>0)H+=`/${$.slice(B+1,X)}`;else H=$.slice(B+1,X);J=X-B-1}B=X,Q=0}else if(z==="."&&Q!==-1)++Q;else Q=-1}return H}var mD=function($){return VH0.test($)};var uD=function($,Z){let H=fD($).replace(jm,"$1").split("/"),J=fD(Z).replace(jm,"$1").split("/");if(J[0][1]===":"&&H[0][1]===":"&&H[0]!==J[0])return J.join("/");let B=[...H];for(let Q of B){if(J[0]!==Q)break;H.shift(),J.shift()}return[...H.map(()=>".."),...J].join("/")};function iZ($){return $.input??{}}function W1($,Z){let H=$[Z];return typeof H==="string"?H:""}function Tm($){return(Z)=>Z.replace(/\/[^\s"']+/g,(H)=>{if(!$)return H;let J=uD($,H);return J.startsWith("..")?H:J})}function n7($){let Z=Math.max(1,Math.round($/1000));if(Z<60)return`${Z}s`;let H=Math.floor(Z/60),J=Z%60;return J?`${H}m ${J}s`:`${H}m`}var DH0={ToolSearch:"Tool search",WebSearch:"Web search",WebFetch:"Web fetch"};function qH0($){if(!$.startsWith("mcp__"))return $;let Z=$.slice(5).split("__");return Z.length>=2?Z.slice(1).join("__"):Z[0]}function MH0($,Z){let H=$.name,J=iZ($);if(H==="Bash")return lZ(W1(J,"command"),Z);if(H==="Read"||H==="Write"||H==="Edit")return Z(W1(J,"file_path"));if(H==="Glob")return Z(W1(J,"pattern"));if(H==="Grep")return`/${W1(J,"pattern")}/ ${Z(W1(J,"path"))}`;if(H==="WebSearch")return W1(J,"query");if(H==="WebFetch")return W1(J,"url");if(H==="ToolSearch"){let B=W1(J,"query");if(B.startsWith("select:"))return B.slice(7).split(",").map(qH0).join(", ");return B}return""}var IB={displayName:($)=>DH0[$.name]??$.name,brief:MH0};var pD={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"},wm={read:"Read",listFiles:"List files",search:"Search"};function Em($){let Z=$?.commandActions;if(!Array.isArray(Z)||Z.length===0)return null;let H=Z[0],J=H?.type;if(!J||!(J in wm))return null;if(Z.some((B)=>B?.type!==J))return null;return H}var Cm={spawn_agent:"Run sub-agent",send_input:"Message the agent",resume_agent:"Resume the agent",close_agent:"Stopping the agent"};function PH0($){if($.name==="exec"){let Z=Em($.input);if(Z?.type)return wm[Z.type]}if($.name==="subagent"){let Z=$.input?.action;if(typeof Z==="string"&&Z in Cm)return Cm[Z]}return pD[$.name]??$.name}function _H0($,Z){let H=$.name,J=iZ($);if(H==="exec"){let B=Em(J);if(B?.type==="read")return Z(B.path||B.name||"");if(B?.type==="search")return[B.query&&`/${B.query}/`,B.path&&Z(B.path)].filter(Boolean).join(" ");if(B?.type==="listFiles")return B.path?Z(B.path):"";return lZ(W1(J,"command"),Z)}if(H==="apply_patch"){let B=J.changes;if(Array.isArray(B))return B.map((z)=>z&&typeof z==="object"?z.path:void 0).filter((z)=>typeof z==="string").map(Z).join(", ");return""}if(H==="web_search"){let B=J.queries;if(Array.isArray(B)&&B.length>0)return B.filter((Q)=>typeof Q==="string").join(" · ");return W1(J,"query")||[W1(J,"url"),W1(J,"pattern")].filter(Boolean).join(" · ")}if(H==="update_plan"){let B=J.plan;return typeof B==="string"?B.split(`
52
- `)[0]:""}if(H==="subagent"){if(W1(J,"action")==="close_agent")return"";return W1(J,"prompt")}if(H==="subagent_activity")return W1(J,"kind");if(H==="generate_image")return W1(J,"prompt").split(`
53
- `)[0];if(H==="read_mcp_resource")return W1(J,"uri");if(H==="list_mcp_resources"||H==="list_mcp_resource_templates")return W1(J,"server");return""}var Sm={displayName:PH0,brief:_H0};function Im($){let Z=$.indexOf(":"),H=(Z>0?$.slice(0,Z):$).trim(),J=Z>0?$.slice(Z+1).trim():"",B=H.match(/^(.*?)\s*\(([^)]*)\)$/);if(!B)return{action:H,qualifier:"",detail:J};return{action:B[1].trim(),qualifier:B[2].trim(),detail:J}}var jH0={terminal:"Run command",read:"Read",write:"Write",edit:"Edit",patch:"Edit",search:"Search",extract:"Fetch webpage","web extract":"Fetch webpage","web search":"Web search",delegate:"Delegate task","delegate batch":"Delegate tasks",todo:"Update TODO",python:"Run Python","process wait":"Wait for process","session search":"Search sessions","skills list":"List skills","skill view":"View skill"};function OH0($){let{action:Z}=Im($.name),H=jH0[Z];if(H)return H;let J=Z.replace(/_/g," ");return J.charAt(0).toUpperCase()+J.slice(1)}function TH0($,Z){let{action:H,qualifier:J,detail:B}=Im($.name),Q=B||J;if(!Q)return"";return H==="terminal"?`$ ${a7(Q)}`:Z(Q)}var km={displayName:OH0,brief:TH0};var CH0={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"};function wH0($,Z){let H=$.name,J=iZ($);if(H==="read"||H==="write"||H==="edit")return Z(W1(J,"path"));if(H==="apply_patch"){let B=J.changes;if(Array.isArray(B)&&B.length>0){let X=B.map((G)=>G&&typeof G==="object"?W1(G,"path"):"").filter(Boolean);if(X.length===1)return Z(X[0]);if(X.length>1)return`${X.length} files`}let Q=W1(J,"patch")||W1(J,"input"),z=Q.split(`
54
- `).find((X)=>X.startsWith("*** "))??Q.split(`
55
- `)[0];return Z(z??"")}if(H==="exec"||H==="bash"){let B=W1(J,"command")||W1(J,"code");return lZ(B,Z)}if(H==="ls"||H==="find"||H==="grep")return Z(W1(J,"path")||W1(J,"pattern"));if(H==="process"){let B=W1(J,"action"),Q=W1(J,"name");return[B,Q].filter(Boolean).join(" ")||Z(a7(W1(J,"command")))}if(H==="web_search"||H==="x_search")return W1(J,"query");if(H==="web_fetch")return W1(J,"url");if(H==="memory_search")return W1(J,"query");if(H==="memory_get")return W1(J,"key")||W1(J,"name");if(H==="sessions_history"||H==="sessions_send"||H==="sessions_yield")return W1(J,"sessionKey")||W1(J,"agentId");if(H==="sessions_list"||H==="agents_list")return W1(J,"agentId");if(H==="subagents"||H==="sessions_spawn")return W1(J,"task")||W1(J,"agentId");if(H==="image"||H==="image_generate")return W1(J,"prompt")||Z(W1(J,"path"));if(H==="message")return W1(J,"recipient")||W1(J,"to");if(H==="update_plan"){let B=J.plan;if(Array.isArray(B)){let z=B.find((X)=>!!X&&typeof X==="object"&&X.status==="in_progress")?.step??B[0]?.step;if(typeof z==="string")return z}return""}return""}var Rm={displayName:($)=>CH0[$.name]??IB.displayName($),brief:($,Z)=>wH0($,Z)||IB.brief($,Z)};function cD($){if(!($.name==="Bash"||$.name==="exec"||$.name==="bash"))return null;let H=$.input??{},J=typeof H.command==="string"?H.command:"";if(!J)return null;let Q=a7(J).match(/(?:^|\s|\$\()mcporter(?:\)?)\s+call\s+([A-Za-z0-9_-]+)\.([A-Za-z0-9_-]+)((?:\s+(?!&&|\|\||;|\|)\S+)*)/);if(!Q)return null;return{server:Q[1],tool:Q[2],rest:(Q[3]??"").trim()}}function dD($){let Z=$.name;if(!Z.startsWith("mcp__"))return null;let H=Z.slice(5),J=H.indexOf("__");if(J<=0)return null;return{server:H.slice(0,J),tool:H.slice(J+2),rest:""}}function lD($){if($.provider!=="codex"||!$.mcpServer)return null;if($.name in pD)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 iD($,Z){let H=Z.toLowerCase();return["-","_","."].find((B)=>H.startsWith($.toLowerCase()+B))?Z.slice($.length+1):Z}var EH0={"claude-code":IB,openclaw:Rm,codex:Sm,hermes:km};function bm($){return EH0[$.provider??"claude-code"]}function ym($){return bm($).displayName($)}function hm($,Z){return bm($).brief($,Tm(Z))}var a5=_(r(),1),xm=[vm,gm,rD];function SH0(){let[$,Z]=kB.useState(0);kB.useEffect(()=>{let J=setInterval(()=>Z((B)=>(B+1)%xm.length),600);return()=>clearInterval(J)},[]);let H=xm[$];return a5.jsx(cZ,{className:"size-5",children:a5.jsx(H,{size:16,stroke:1.75,className:"text-foreground"})})}function fm({call:$,cwd:Z,isFirst:H,isLast:J,renderNestedParts:B}){let[Q,z]=kB.useState(!1),X=$.subagent,G=$.input??{},U=X?.description??G.description??"Subtask",K=X?.status,F=$.state==="error"||K==="failed",Y=$.state==="running"||K==="running",W=X?.usage?.toolUses,A=X?.usage?.durationMs,L=(Y&&X?.progress?.length?X.progress[X.progress.length-1]:null)??(W!=null?`Took ${W} step${W===1?"":"s"}`:null),V=(X?.transcript??[]).flatMap((j)=>j.parts),D=typeof $.output==="string"?$.output:"",q=V.length>0||!!D;return a5.jsx(dZ,{isFirst:H,isLast:J,marker:Y?a5.jsx(SH0,{}):a5.jsx(cZ,{className:"size-5",children:a5.jsx(rD,{size:16,stroke:1.75,className:"text-foreground"})}),isError:F,children:a5.jsxs("div",{className:"min-w-0 flex-1",children:[a5.jsxs("button",{type:"button",title:`Agent: ${U}`,onClick:()=>q&&z((j)=>!j),className:z0("group/row flex w-full flex-col items-start gap-0.5 py-1.5 text-left select-none",q?"cursor-pointer":"cursor-default"),children:[a5.jsxs("span",{className:"flex w-full items-center gap-2",children:[a5.jsxs(Gm,{active:Y,className:"min-w-0 flex-1 truncate text-xs font-medium",children:["Agent: ",U]}),!Y&&A!=null&&a5.jsx("span",{className:"shrink-0 rounded-full border border-border px-1.5 text-[10px] font-medium text-muted-foreground tabular-nums",children:n7(A)}),K==="failed"&&a5.jsx("span",{className:"shrink-0 text-xs text-destructive",children:"✗"}),K==="stopped"&&a5.jsx("span",{className:"shrink-0 text-xs text-muted-foreground",children:"✗"}),q&&a5.jsx(SB,{open:Q})]}),L&&a5.jsx("span",{className:"w-full truncate text-xs text-muted-foreground",children:L})]}),q&&a5.jsx(wB,{open:Q,children:a5.jsxs("div",{className:"mt-1 mb-1 overflow-hidden rounded-lg border border-border",children:[V.length>0&&a5.jsx("div",{className:"py-1.5 pr-2 pl-3",children:B(V,Z)}),D&&a5.jsx("div",{className:z0("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:D})]})})]})})}var o7=_(p(),1);var nm=_(p(),1);var oD=new Set(["<",">","{","}","[","]"]),$q=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"]),IH0=new Set([...$q,"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"]),cm=new Set(["+","-","*","/","%","=","!","&","|","^","~","!","?",":",".",",",";","'",'"',".","(",")","[","]","#","@","\\",...oD]),kH0={keywords:$q,onCommentStart:rm,onCommentEnd:mH0};function RH0($){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 bH0($,Z){if($[Z]!=="<")return!1;let H=0,J=!1;for(let B=Z;B<$.length;B++){let Q=$[B];if(Q==="<"){H++;continue}if(Q===">"){if(H--,H===0){let z=B+1;while(z<$.length&&/\s/.test($[z]))z++;if(!(J&&$[z]==="("))return!1;let X=$.slice(z,z+320);return/\)\s*(?::[\s\S]{0,120}?)?=>/.test(X)}continue}if(H===0)continue;if(/[$A-Za-z_]/.test(Q)){J=!0;continue}if(/[\s,\.\=\?\:\|\&\[\]]/.test(Q))continue;return!1}return!1}var UF=["identifier","keyword","string","class","property","entity","jsxliterals","sign","comment","break","space"],[rZ,yH0,M6,aD,nD,hH0,xH0,k9,mm,sD,um]=UF.map(($,Z)=>Z);function RB($){return/^[^\S\r\n]+$/g.test($)}function vH0($){return cm.has($)}function gH0($){return $.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#039;")}function KF($){return/^[\w_]+$/.test($)||dm($)}function pm($){let Z=$[0];return KF(Z)&&Z===Z.toUpperCase()||$==="null"}function dm($){return/[^\u0000-\u007f]/.test($)}function lm($){return/^[a-zA-Z]$/.test($)}function im($){return lm($)||dm($)}function aZ($){return im($[0])&&($.length===1||KF($.slice(1)))}function tD($){return $==="`"}function eD($){return $==='"'||$==="'"}function fH0($){return eD($)||tD($)}function rm($,Z){let H=$+Z;if(H==="/*")return 2;return H==="//"?1:0}function mH0($,Z){return $+Z==="*/"?2:Z===`
56
- `?1:0}function uH0($){return $[0]==="/"&&!rm($[0],$[1])}function pH0($,Z){let H={...kH0,...Z},J=!!(Z&&Z.keywords instanceof Set),B=RH0($),Q=J?H.keywords:B?IH0:$q,{onCommentStart:z,onCommentEnd:X}=H,G=H.typeKeywords instanceof Set?H.typeKeywords:null,U="",K=-1,F=[-1,""],Y=[-2,""],W=[],A=!1,N=0,L=!1,V=0,D=()=>A&&!L&&!N,q=()=>N&&!D(),j=()=>!N&&D()&&!L&&V>0,M=null,P=!1,T=0,C=0,k=()=>M!==null,E=()=>P,h=()=>C>T,x=()=>C>0&&C===T,R=()=>k()||h();function w(I){let y=I===`
57
- `;if(q()){if(k())return M6;let[,g]=F;if(aZ(I)){if(g==="<"||g==="</")return hH0}}if(j())return xH0;if(k()||h())return M6;else if(G&&G.has(I))return F[1]==="."?rZ:aD;else if(Q.has(I))return F[1]==="."?rZ:yH0;else if(y)return sD;else if(RB(I))return um;else if(I.split("").every(vH0))return k9;else if(pm(I))return q()?rZ:aD;else{if(aZ(I)){let g=F[1]==="."&&aZ(Y[1]);if(!R()&&!g)return rZ;if(g)return nD}return M6}}let S=(I,y)=>{if(y)U=y;if(U){K=typeof I==="number"?I:w(U);let f=[K,U];if(K!==um&&K!==sD)Y=F,F=f;W.push(f)}U=""};for(let I=0;I<$.length;I++){let y=$[I],f=$[I-1],g=$[I+1],O=f+y,c=y+g;if(typeof H.onQuote==="function"&&y==="'"&&!k()&&!j()&&!h()){let u=H.onQuote(y,I,$);if(typeof u==="number"&&u>=1&&!Number.isNaN(u)){let a=Math.min(u,$.length-I),n=I+a;S(),U=$.slice(I,n),S(rZ),I=n-1;continue}}if(eD(y)&&!j()&&!h()){if(S(),f!=="\\"){if(M&&y===M)M=null;else if(!M)M=y}S(M6,y);continue}if(!h()){if(f!=="\\n"&&tD(y)){S(),S(M6,y),C++;continue}}if(h()){if(f!=="\\n"&&tD(y)){if(C>0){S(),C--,S(M6,y);continue}}if(c==="${"){T++,S(M6),S(k9,c),I++;continue}}if(x()&&y==="}"){S(),T--,S(k9,y);continue}if(D()){if(y==="{"){S(),S(k9,y),L=!0;continue}}if(A){if(!N&&y==="<"){if(S(),g==="/")N=2,U=c,I++;else N=1,U=y;S(k9);continue}if(N){if(y===">"&&!"/=".includes(f)){if(S(),N===1)N=0,V++;else N=0,A=!1;S(k9,y);continue}if(c==="/>"||c==="</"){if(U!=="<"&&U!=="/")S();if(c==="/>")N=0;else V--;if(!V)A=!1;U=c,I++,S(k9);continue}if(y==="<"){S(),U=y,S(k9);continue}if(g==="-"&&!R()&&!j()){if(U){S(nD,U+y+g),I++;continue}}if(g==="="&&!R()){if(!RB(y)){if(RB(U))S();let u=U+y;if(aZ(u)){S(nD,u);continue}}}}}if(!N&&(y==="<"&&im(g)||c==="</")){let u=I-1;while(u>=0&&/\s/.test($[u]))u--;let a=u>=0?$[u]:"",[n,Q0]=F,Z0=!1,U0=!1;if(U&&!RB(U)){let A0=U;if(pm(A0)||A0==="true"||A0==="false")Z0=!0;else if(Q.has(A0)&&aZ(A0))U0=!0;else if(aZ(A0))Z0=!0}let B0=y==="<"&&/[$\w\]\)]/.test(a)&&(Z0||!U0&&(n===rZ||n===aD||n===k9&&(Q0===")"||Q0==="]"))),Y0=y==="<"&&bH0($,I);if(!B0&&!Y0)N=g==="/"?2:1;if(y==="<"&&(g==="/"||lm(g))){if(!B0&&!Y0&&!R()&&!j()&&!E())A=!0}}let o=fH0(y),b=h(),d=!A&&uH0(c),t=j();if(o||b||eD(M))U+=y;else if(d){S();let[u,a]=F;if(d&&u!==-1&&!(u===k9&&a!==")"||u===mm)){U=y,S();continue}P=!0;let n=I++,Q0=()=>I>=$.length,Z0=()=>Q0()||$[I]===`
58
- `,U0=!1,B0=!1;for(;!Z0();I++){let Y0=$[I],A0=$[I-1]==="\\";if(!A0&&Y0==="[")B0=!0;if(!A0&&Y0==="]")B0=!1;if(Y0==="/"&&!B0&&!A0){U0=!0;while(n!==I&&/^[a-z]$/.test($[I+1])&&!Z0())I++;break}}if(P=!1,n!==I&&U0)U=$.slice(n,I+1),S(M6);else U=y,S(),I=n}else if(z(y,g)){S();let u=I,a=z(y,g);if(a){for(;I<$.length;I++)if(X($[I-1],$[I])==a)break}U=$.slice(u,I+1),S(mm)}else if(y===" "||y===`
59
- `)if(y===" "&&(RB(U)||!U||t)){if(U+=y,g==="<")S()}else S(),U=y,S();else if(L&&y==="}")S(),U=y,S(),L=!1;else if(t&&!oD.has(y)||h()||(KF(y)===KF(U[U.length-1])||D())&&!cm.has(y))U+=y;else{if(O==="</")U=O;if(S(),O!=="</")U=y;if(c==="</"||c==="/>")U=c,S(),I++;else if(oD.has(y))S()}}return S(),W}function cH0($,Z){let H=[],J=Z&&typeof Z.lineClassName==="function"?Z.lineClassName:null,B=0,Q=(U,K)=>{let F=J?J(K,B):"";return B++,{type:"element",tagName:"span",children:U,properties:{className:F?`sh__line ${F}`:"sh__line"}}};function z(U){let K=U.map(([,Y])=>Y).join(""),F=U.map(([Y,W])=>{let A=UF[Y];return{type:"element",tagName:"span",children:[{type:"text",value:W}],properties:{className:`sh__token--${A}`,style:{color:`var(--sh-${A})`}}}});H.push(Q(F,K))}let X=[],G=!1;for(let U=0;U<$.length;U++){let K=$[U],[F,Y]=K,W=U===$.length-1;if(F!==sD){if(Y.includes(`
60
- `)){let A=Y.split(`
61
- `);for(let N=0;N<A.length;N++)if(X.push([F,A[N]]),N<A.length-1)z(X),X.length=0}else X.push(K);G=!1}else{if(G)z([]);else z(X),X.length=0;if(W)z([]);G=!0}}if(X.length)z(X);return H}var dH0=($)=>{let Z=`class="${$.className}"`;if($.style){let H=Object.entries($.style).map(([J,B])=>`${J}:${B}`).join(";");Z+=` style="${H}"`}return Z};function lH0($){return $.map((Z)=>{let{tagName:H}=Z,J=Z.children.map((B)=>{let{tagName:Q,children:z,properties:X}=B;return`<${Q} ${dH0(X)}>${gH0(z[0].value)}</${Q}>`}).join("");return`<${H} class="${Z.properties.className}">${J}</${H}>`}).join(`
62
- `)}function am($,Z){let H=pH0($,Z),J=cH0(H,Z);return lH0(J)}var aX1={TokenTypes:UF,TokenMap:new Map(UF.map(($,Z)=>[$,Z]))};var Zq=_(r(),1),iH0=z0("[--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 om({code:$,className:Z}){let H=nm.useMemo(()=>am($),[$]);return Zq.jsx("pre",{className:z0("overflow-auto font-mono text-xs leading-relaxed whitespace-pre",iH0,Z),children:Zq.jsx("code",{className:"font-mono",dangerouslySetInnerHTML:{__html:H}})})}var rH0={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 aH0($){let Z=$.split(/[\\/]/).pop()??"",H=Z.lastIndexOf("."),J=H>0?Z.slice(H+1).toLowerCase():"";return rH0[J]??null}function nH0($){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 oH0($){let Z=$.split(`
63
- `);if(!Z.some((H)=>/^\s*\d+\t/.test(H)))return $;return Z.map((H)=>H.replace(/^\s*\d+\t/,"")).join(`
64
- `)}function sm($,Z){let H=$.input??{},J=typeof H.file_path==="string"?H.file_path:typeof H.path==="string"?H.path:"",B=J?aH0(J):null,Q=$.name==="Read"||$.name==="read",z=$.name==="Write"||$.name==="write";if(B&&Q&&Z)return{kind:"highlight",code:oH0(Z),label:B};if(B&&z&&typeof H.content==="string"&&H.content)return{kind:"highlight",code:H.content,label:B};let X=nH0(Z);if(X)return{kind:"highlight",code:X,label:"json"};return{kind:"plain"}}var Y2=_(r(),1),Hq="max-h-[280px] overflow-auto px-3 py-2.5 font-mono text-xs leading-relaxed";function tm({call:$,output:Z,isError:H}){let[J,B]=o7.useState(!1),Q=o7.useMemo(()=>H?{kind:"plain"}:sm($,Z),[$,Z,H]);if(Q.kind==="plain")return Y2.jsx("div",{className:z0("rounded-lg border",H?"border-destructive/30 bg-destructive/10":"border-border bg-muted"),children:Y2.jsx("pre",{className:z0(Hq,"break-all whitespace-pre-wrap",H?"text-destructive":"text-muted-foreground"),children:Z||"(empty)"})});return Y2.jsxs("div",{className:"overflow-hidden rounded-lg border border-border bg-muted",children:[Y2.jsx(sH0,{raw:J,onRaw:B,label:Q.label,copyText:J?Z:Q.code}),J?Y2.jsx("pre",{className:z0(Hq,"break-all whitespace-pre-wrap text-muted-foreground"),children:Z||"(empty)"}):Y2.jsx(om,{code:Q.code,className:z0(Hq,"text-muted-foreground")})]})}function sH0({raw:$,onRaw:Z,label:H,copyText:J}){return Y2.jsxs("div",{className:"flex items-center gap-1 border-b border-border p-2",children:[[[!1,H],[!0,"raw"]].map(([Q,z])=>Y2.jsx(E0,{type:"button",variant:$===Q?"outline":"ghost",size:"sm",onClick:()=>Z(Q),className:"rounded-full text-xs uppercase",children:z},z)),Y2.jsx("div",{className:"flex-1"}),Y2.jsx(tH0,{text:J})]})}function tH0({text:$}){let[Z,H]=o7.useState(!1);return o7.useEffect(()=>{if(!Z)return;let B=setTimeout(()=>H(!1),1500);return()=>clearTimeout(B)},[Z]),Y2.jsx(E0,{type:"button",variant:"ghost",size:"icon-sm",onClick:()=>{navigator.clipboard?.writeText($).then(()=>H(!0)).catch(()=>{})},"aria-label":Z?"Copied":"Copy",children:Z?Y2.jsx(x3,{stroke:1.75}):Y2.jsx(PX,{stroke:1.75})})}var x1=_(r(),1);function FF({parts:$,cwd:Z=null,processing:H=!1}){let J=$.filter((B)=>B.type==="reasoning"||B.type==="tool-call");return x1.jsx("div",{className:"flex flex-col",children:J.map((B,Q)=>{let z=Q===J.length-1,X={isFirst:Q===0,isLast:z};if(B.type==="reasoning")return x1.jsx(eH0,{text:B.text,durationMs:B.durationMs,inProgress:H&&z,...X},Q);return x1.jsx($J0,{call:B.call,cwd:Z,...X},B.call.toolCallId||Q)})})}function Jq({isFirst:$,isLast:Z,call:H,leading:J,marker:B,name:Q,brief:z,preview:X}){let[G,U]=Bq.useState(!1),K=H.state==="error",F=H.state==="running"||H.state==="pending",Y=K?H.errorText??"":typeof H.output==="string"?H.output:"",W=!!(Y||K||X),A=z?`${Q}: ${z}`:Q;return x1.jsx(dZ,{isFirst:$,isLast:Z,marker:B,loading:F,isError:K,children:x1.jsxs("div",{className:"min-w-0 flex-1",children:[x1.jsxs("button",{type:"button",title:A,onClick:()=>W&&U((N)=>!N),className:z0(zF,W?"cursor-pointer":"cursor-default"),children:[J,x1.jsx("span",{className:"shrink-0 text-xs font-medium whitespace-nowrap",children:Q}),z&&x1.jsx("span",{className:"min-w-0 self-baseline truncate text-[12px] text-muted-foreground",children:z}),F&&B&&x1.jsx(y5,{size:12,stroke:1.75,className:"shrink-0 animate-spin text-muted-foreground"}),W&&x1.jsx(SB,{open:G})]}),W&&x1.jsx(wB,{open:G,children:x1.jsxs("div",{className:"mt-1 mb-1 flex flex-col gap-1.5",children:[X,(Y||K)&&x1.jsx(tm,{call:H,output:Y,isError:K})]})})]})})}function eH0({isFirst:$,isLast:Z,text:H,inProgress:J=!1,durationMs:B}){let[Q,z]=Bq.useState(!1);if(!H){let U=B===void 0?"Thought":`Thought for ${n7(B)}`;return x1.jsx(dZ,{isFirst:$,isLast:Z,loading:J,children:x1.jsx("div",{className:z0(zF,"min-w-0 flex-1 cursor-default"),children:x1.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:J?"Thinking":U})})})}let X=J?"Thinking":"Thought",G=J||Q;return x1.jsx(dZ,{isFirst:$,isLast:Z,loading:J,children:x1.jsxs("div",{className:"min-w-0 flex-1",children:[x1.jsxs("button",{type:"button","aria-expanded":G,onClick:()=>z((U)=>!U),className:z0(zF,"cursor-pointer"),children:[x1.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:X}),x1.jsx(SB,{open:G})]}),x1.jsx(wB,{open:G,children:x1.jsx("div",{className:"mt-1 mb-1 pr-2 text-xs leading-relaxed whitespace-pre-wrap text-muted-foreground",children:x1.jsx(Qf,{content:H})})})]})})}function $J0({call:$,cwd:Z,isFirst:H,isLast:J}){if($.caller==="subagent")return x1.jsx(fm,{call:$,cwd:Z,isFirst:H,isLast:J,renderNestedParts:(z,X)=>x1.jsx(FF,{parts:z,cwd:X})});if($.name==="Skill"&&$.skill){let z=$.state==="success";return x1.jsx(Jq,{isFirst:H,isLast:J,call:$,marker:z?x1.jsx(Km,{icon:em,size:16,stroke:1.75}):void 0,name:"Loading skill",brief:$.skill.skillName})}let B=cD($)??dD($)??lD($);if(B){let z=iD(B.server,B.tool);return x1.jsx(Jq,{isFirst:H,isLast:J,call:$,marker:x1.jsx(Fm,{src:JF(B.server)}),name:BF(B.server),brief:B.rest?`${z} ${B.rest}`:z})}let Q=$.state==="error"?null:Qm($,Z);return x1.jsx(Jq,{isFirst:H,isLast:J,call:$,leading:x1.jsx(ZJ0,{call:$}),name:ym($),brief:hm($,Z),preview:Q?x1.jsx(zm,{relPath:Q}):void 0})}function ZJ0({call:$}){if($.caller!=="mcp"&&$.caller!=="server-tool")return null;let Z=$.caller==="mcp"?`mcp${$.mcpServer?`:${$.mcpServer.slice(0,8)}`:""}`:"server";return x1.jsx("span",{className:"shrink-0 rounded border border-border px-1 text-[9px] text-muted-foreground uppercase",children:Z})}var v1=_(r(),1);function Hu($){if($.type==="reasoning")return!0;if($.type==="tool-call")return!0;return!1}function HJ0($){let Z=[];for(let H of $)if(Hu(H)){let J=Z[Z.length-1];if(J&&J.kind==="run")J.parts.push(H);else Z.push({kind:"run",parts:[H]})}else Z.push({kind:"single",part:H});return Z}function YF({parts:$,cwd:Z,processing:H=!1}){let J=HJ0($);return v1.jsx("div",{className:"flex flex-col",children:J.map((B,Q)=>{let z=Q===0?"":"mt-3",X=Q===J.length-1;return v1.jsx("div",{className:z,children:B.kind==="run"?v1.jsx(FF,{parts:B.parts,cwd:Z,processing:H&&X}):v1.jsx(XJ0,{part:B.part})},Q)})})}function JJ0($){return $.some((Z)=>Z.type!=="text"||Z.text.trim().length>0)}function BJ0($){let Z=-1;for(let J=$.length-1;J>=0;J--)if(Hu($[J])){Z=J;break}if(Z<0)return null;let H=$.slice(Z+1);if(!JJ0(H))return null;return{work:$.slice(0,Z+1),response:H}}function QJ0({parts:$,cwd:Z,durationMs:H,defaultOpen:J}){let B=H===void 0?"Worked":`Worked for ${n7(H)}`;return v1.jsxs(SG,{defaultOpen:J,className:"group/collapsible",children:[v1.jsxs(IG,{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:[v1.jsx("span",{children:B}),v1.jsx(E7,{size:16,stroke:1.5,className:"shrink-0 transition-transform group-data-open/collapsible:rotate-90"})]}),v1.jsx(kG,{className:"overflow-hidden pt-2",children:v1.jsx(YF,{parts:$,cwd:Z})})]})}function zJ0({parts:$,cwd:Z,processing:H=!1,durationMs:J}){let B=H?null:BJ0($);return v1.jsx("div",{className:"w-full min-w-0",children:H?v1.jsx(YF,{parts:$,cwd:Z,processing:!0}):B?v1.jsxs("div",{className:"flex flex-col gap-3",children:[v1.jsx(QJ0,{parts:B.work,cwd:Z,durationMs:J}),v1.jsx(YF,{parts:B.response,cwd:Z})]}):v1.jsx(YF,{parts:$,cwd:Z})})}var Ju=Zu.memo(function({turn:Z,processing:H=!1}){let J=P5().cwd;if(Z.role==="user"&&Z.origin.kind==="user-input"){let B=Z.parts.filter((z)=>z.type==="file"),Q=Z.parts.filter((z)=>z.type==="text").map((z)=>z.type==="text"?z.text:"").join(`
65
- `);if(!Q&&B.length===0)return null;return v1.jsxs("div",{className:"flex w-full min-w-0 flex-col items-end gap-1.5 pl-8",children:[B.map((z,X)=>v1.jsx(Bu,{mediaType:z.mediaType,url:z.url,filename:z.filename},X)),Q&&v1.jsx("p",{className:z0("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:Q})]})}return v1.jsx(zJ0,{parts:Z.parts,cwd:J,processing:H,durationMs:Z.meta?.durationMs})});function XJ0({part:$}){switch($.type){case"text":return v1.jsx(Bf,{content:$.text});case"tool-call":return v1.jsx(FF,{parts:[$],cwd:null});case"file":return v1.jsx(Bu,{mediaType:$.mediaType,url:$.url,filename:$.filename});case"source-url":return v1.jsx($u,{url:$.url,title:$.title});case"source-document":return v1.jsx($u,{url:"#",title:$.title});case"data":return v1.jsx(GJ0,{name:$.name,data:$.data});case"reasoning":return null}}function Bu({mediaType:$,url:Z,filename:H}){if($.startsWith("image/")&&Z)return v1.jsx("img",{src:Z,alt:H??"attachment",className:"max-h-64 max-w-full rounded-lg border border-border object-contain"});return v1.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:[v1.jsx(OZ,{size:16,stroke:1.75}),v1.jsx("span",{className:"truncate",children:H??$})]})}function $u({url:$,title:Z}){return v1.jsx("a",{href:$,target:"_blank",rel:"noreferrer",className:"text-xs underline",children:Z??$})}function GJ0({name:$,data:Z}){return v1.jsxs("details",{children:[v1.jsxs("summary",{className:"cursor-pointer list-none text-xs text-muted-foreground marker:hidden [&::-webkit-details-marker]:hidden",children:["data:",$]}),v1.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 q5=_(r(),1),UJ0=[],KJ0=[];function WF({agent:$,active:Z=!0,focusRequest:H=0,docked:J=!1,chatLoaded:B,hasWorkspaceApplets:Q,view:z,previewTurn:X,sessionId:G,processing:U,composerBanner:K,agentAvailability:F,annotation:Y,send:W,stop:A,onNavigateFromWelcome:N,onClose:L,builderDraft:V}){let D=F5(),q=I2.useRef(null),j=I2.useRef(null),M=V?.sessionId??G??null,P=V?null:G??null,T=V?UJ0:z.turns,C=S5((a)=>a.hasSentMessageFromMoi),k=S5((a)=>(a.workspaceIdsPendingAnalysis??[]).includes(D)),E=w4((a)=>(a.attachments[z2(D,M)]??[]).some((n)=>n.status==="uploading")),h=!cJ(!0,E,F),x=V?null:X,R=V?KJ0:z.notices,w=I2.useMemo(()=>Ok(T),[T]),S=I2.useMemo(()=>jk(w,x),[w,x]),I=I2.useMemo(()=>Ck(S,R),[S,R]),y=S.length>0?S[S.length-1].id:null,f=V?!1:U,g=!!V||B&&I.length===0&&!f,O=B&&!g,c=Cy({isViewBuilderDraft:!!V,hasSentMessageFromMoi:C,isWorkspacePendingAnalysis:k}),{atBottom:o,scrollToBottom:b,scrollToTop:d}=Pk(j,M);I2.useLayoutEffect(()=>{if(g&&c!=="empty")d()},[g,c,d]),I2.useEffect(()=>{if(Z)XV(q.current)},[Z,H]);let t=I2.useCallback(async(a,n)=>{if(V)await V.onSubmit(a);else W(a,n);b()},[V,W,b]),u=I2.useCallback((a)=>{if(h)return;t(a.prompt,{directives:a.context})},[t,h]);return q5.jsxs("div",{className:"flex min-h-0 flex-1 flex-col pt-2 pb-3",children:[q5.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:[q5.jsx(Ry,{isViewBuilder:!!V}),L&&J&&q5.jsxs(l1,{children:[q5.jsx(i1,{render:q5.jsx(E0,{variant:"ghost",size:"icon-sm",onClick:L,"aria-label":"Undock agent",children:q5.jsx(Qu,{className:"size-5! text-muted-foreground",stroke:1.5})})}),q5.jsx(r1,{children:"Undock agent"})]}),!V&&L&&!J&&q5.jsx(E0,{variant:"ghost",size:"icon-sm",onClick:L,"aria-label":"Close chat",children:q5.jsx(b5,{stroke:2})})]}),q5.jsxs("div",{className:"relative flex min-h-0 flex-1 flex-col",children:[q5.jsx("div",{ref:j,className:"flex scrollbar-thin flex-1 scroll-fade flex-col overflow-y-auto overscroll-contain px-5 pt-4 pb-8 [--scroll-fade-reveal:8px]",children:q5.jsxs("div",{className:"mx-auto flex w-full max-w-(--chat-max-container) flex-1 flex-col gap-6",children:[g&&q5.jsx(wy,{agent:$,kind:c,hasWorkspaceApplets:Q,disabled:h,onSelectPrompt:u,onNavigate:N}),O&&I.map((a)=>a.kind==="notice"?q5.jsx(FJ0,{notice:a.notice},`notice:${a.notice.id}`):q5.jsx(Ju,{turn:a.turn,processing:f&&a.turn.id===y},a.turn.id)),O&&q5.jsx("div",{className:"mt-auto -ml-3 pt-2",children:q5.jsx(j9,{preset:$,color:"primary",animated:f,expression:f?"thinking":void 0})})]})}),O&&!o&&T.length>0&&q5.jsx(E0,{type:"button",variant:"outline",size:"icon",onClick:()=>b("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:q5.jsx(XK,{stroke:1.5})})]}),q5.jsx("div",{className:"mx-auto flex w-full max-w-[calc(var(--chat-max-container)+24px)] flex-col px-3",children:q5.jsxs("div",{className:z0("@container flex w-full flex-col transition-[padding]",K&&"gap-2 rounded-t-lg rounded-b-2xl p-2",K?.tone==="default"&&"bg-accent",K?.tone==="error"&&"bg-destructive/10"),children:[K?.content,q5.jsx(Py,{composerRef:q,onSend:t,onStop:A,processing:f,sessionId:M,modelSessionId:P,availability:F,annotation:V?void 0:Y,onRemoveDrawing:V?.onRemoveDrawing??Y?.onRemove,allowFiles:!V,placeholder:V?"Drop in the details":void 0,draft:V?{id:V.builderId,initialValue:V.initialValue,onChange:V.onChange}:void 0})]})})]})}function FJ0({notice:$}){let Z=GV($);if(!Z)return null;return q5.jsx("div",{className:"flex justify-center",children:q5.jsx("span",{className:"max-w-full truncate text-xs text-muted-foreground",children:Z})})}var X3=_(r(),1);function zu({agent:$,loading:Z,open:H,onOpenChange:J,onOpenChangeComplete:B,children:Q}){let z=()=>J(!1);return X3.jsxs(iU,{open:H,onOpenChange:(G,U)=>{if(!G&&U.reason==="outside-press"){U.cancel();return}J(G)},onOpenChangeComplete:B,children:[X3.jsx(rU,{render:X3.jsx("div",{className:"fixed right-3 bottom-3",children:X3.jsx(Y5.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:H?"invisible":"to",transition:{type:"spring",duration:0.3,delay:0.2,bounce:0},children:X3.jsx("button",{type:"button",className:"group block cursor-pointer rounded-xl p-0 drop-shadow-[0_0_4px_var(--primary-foreground)] outline-none focus-visible:ring-3 focus-visible:ring-ring/50","aria-label":"Agent",children:X3.jsx(j9,{preset:$,color:"primary",animated:Z,size:Z?80:64,expression:Z?"thinking":void 0,className:z0("drop-shadow-md drop-shadow-primary/25","group-hover:drop-shadow-lg group-hover:drop-shadow-primary/40","transition-[width,height,filter] duration-300 ease-in-out motion-reduce:transition-none")})})})})}),X3.jsx(aU,{side:"top",sideOffset:({anchor:G})=>-G.height,align:"end",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:Q(z)})]})}var P6=_(r(),1);function AF({className:$,title:Z,children:H,onClose:J,ref:B}){return P6.jsxs(Y5.div,{ref:B,className:z0("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:[P6.jsxs("div",{className:"flex shrink-0 items-center justify-between gap-4",children:[P6.jsx("p",{className:"text-sm font-medium",children:Z}),P6.jsx(E0,{type:"button",variant:"ghost",size:"icon-sm",onClick:J,"aria-label":"Close panel",children:P6.jsx(b5,{stroke:1.75})})]}),P6.jsx("div",{className:"flex-1 pb-(--page-pad)",children:H})]})}var G5=_(r(),1),YJ0=Object.entries(s3),WJ0=Object.entries(jG),AJ0=Object.entries(hJ),NJ0=Object.entries(xJ),VJ0="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";function NF({children:$,className:Z,gridClassName:H,label:J}){return G5.jsxs("div",{className:z0("flex flex-col gap-2",Z),children:[G5.jsx("p",{className:"text-xs font-medium",children:J}),G5.jsx("div",{role:"group","aria-label":J,className:z0("grid grid-cols-4 gap-2 @4xl/workspace:grid-cols-2",H),children:$})]})}function VF({active:$,children:Z,className:H,onSelect:J,style:B}){return G5.jsxs("button",{type:"button","aria-pressed":$,onClick:J,className:z0(VJ0,"flex items-center gap-2 p-3",H,!$&&"cursor-pointer pr-9 opacity-70 hover:opacity-100"),style:B,children:[G5.jsx("div",{className:"flex flex-1 flex-col justify-center",children:Z}),$&&G5.jsx(_X,{size:20,stroke:1.5,"aria-hidden":"true"})]})}function Xu({onClose:$,ref:Z}){yG();let{layout:H,setLayout:J}=P5(),B=b8(H.theme);function Q(z){J({theme:{...B,...z}})}return G5.jsx(AF,{ref:Z,title:"Customize",onClose:$,className:"@4xl/workspace:max-w-5xl",children:G5.jsxs("div",{className:"grid grid-cols-1 gap-4 @4xl/workspace:grid-cols-[repeat(2,minmax(0,1fr))_0.5rem_repeat(2,minmax(0,1fr))_0.5rem_minmax(0,1fr)_0.5rem_minmax(0,1fr)] @4xl/workspace:gap-x-2",children:[G5.jsx(NF,{label:"Font",className:"@4xl/workspace:col-span-2 @4xl/workspace:col-start-1",children:YJ0.map(([z,X])=>G5.jsx(VF,{active:z===B.font,onSelect:()=>Q({font:z}),style:{fontFamily:X.sans},children:G5.jsx("span",{className:"text-sm font-medium",children:X.label})},z))}),G5.jsx(NF,{label:"Colors",className:"@4xl/workspace:col-span-2 @4xl/workspace:col-start-4",children:WJ0.map(([z,X])=>G5.jsx(VF,{active:z===B.color,className:X.primary&&"bg-background text-foreground",onSelect:()=>Q({color:z}),style:y8({...B,color:z}),children:G5.jsxs("div",{className:"flex gap-2",children:[G5.jsx("span",{className:z0("flex size-5 shrink-0 items-center justify-center rounded-sm text-[9px] leading-none font-bold",X.primary?"bg-primary text-primary-foreground":"bg-foreground text-background"),children:"Aa"}),G5.jsx("span",{className:"text-sm font-medium",children:X.label})]})},z))}),G5.jsx(NF,{label:"Radius",className:"@4xl/workspace:col-start-7",gridClassName:"@4xl/workspace:grid-cols-1",children:AJ0.map(([z,X])=>G5.jsx(VF,{active:z===B.radius,onSelect:()=>Q({radius:z}),style:y8({...B,radius:z}),children:G5.jsxs("div",{className:"flex items-center gap-2",children:[G5.jsx("span",{className:"size-5 shrink-0 rounded-sm bg-card texture-checker-2.5 shadow-xs","aria-hidden":"true"}),G5.jsx("span",{className:"text-sm font-medium",children:X.label})]})},z))}),G5.jsx(NF,{label:"Agent",className:"@4xl/workspace:col-start-9",gridClassName:"@4xl/workspace:grid-cols-1",children:NJ0.map(([z,X])=>G5.jsx(VF,{active:z===B.agent,onSelect:()=>Q({agent:z}),children:G5.jsxs("div",{className:"flex items-center gap-2",children:[G5.jsx("span",{className:"flex size-5 shrink-0 items-center justify-center",children:G5.jsx(j9,{preset:z,color:"primary",size:28})}),G5.jsx("span",{className:"text-sm font-medium",children:X.label})]})},z))})]})})}var vF=_(p(),1);var nZ=_(p(),1);function Gu($){return J5({queryKey:S0.appletThumbnails($),queryFn:async()=>(await q1(`/api/workspaces/${$}/applet-thumbnails`)).thumbnails,...c2})}function Uu($){let Z=z1();return B5({mutationFn:(H)=>f2(`/api/workspaces/${$}/applet-thumbnails`,o5("PUT",H),"Failed to save applet thumbnails"),onSuccess:()=>{Z.invalidateQueries({queryKey:S0.appletThumbnails($)}),Z.invalidateQueries({queryKey:S0.preview($)})}})}var LJ0=1000,DJ0=3,qJ0=10800000,MJ0=1000,PJ0="1000px-3x-webp-q80-v1",_J0=5000,jJ0=1000,OJ0=1e4,TJ0=100,CJ0=5000;function wJ0($){return Math.min(DJ0,LJ0/Math.max($.offsetWidth,$.offsetHeight))}function EJ0($){return`${PJ0}:${$??""}`}function SJ0($,Z,H=Date.now()){if(!$||$.revision!==Z)return!0;let J=Date.parse($.capturedAt);return!Number.isFinite(J)||H-J>=qJ0}function IJ0($,Z){return $!==void 0&&$.revision===Z&&$.captureMs!==void 0&&$.captureMs>=MJ0}var kJ0=($)=>new Promise((Z)=>{setTimeout(()=>Z(null),$)});function RJ0($,Z=TJ0){let H=$.getBoundingClientRect(),J=H.top-Z,B=H.bottom+Z,Q=H.left-Z,z=H.right+Z;return(X)=>{if(X.nodeType!==1)return!0;let G=X,U=G.getBoundingClientRect();if(U.width===0&&U.height===0)return G.ownerDocument?.defaultView?.getComputedStyle(G).display!=="none";return U.bottom>J&&U.top<B&&U.right>Q&&U.left<z}}function bJ0($,Z,H=CJ0){let J=H,B=(Q)=>{for(let z of Q.children){if(!Z(z))continue;if(--J<0)return!0;if(B(z))return!0}return!1};return B($)}async function yJ0($,Z){let{createContext:H,destroyContext:J,domToDataUrl:B}=await import("/chunk-53a7pxcz.js"),Q=RJ0($);if(bJ0($,Q))return null;let z=async()=>{let X=await H($,{scale:wJ0($),type:"image/webp",quality:0.8,backgroundColor:"#ffffff",timeout:jJ0,filter:Q,...Z&&{onCreateForeignObjectSvg:(G)=>{let U=document.createElement("style");U.textContent="[data-widget-chrome] { border-radius: 0 !important; box-shadow: none !important; }[data-widget-chrome]::after { display: none !important; }",G.append(U)}}});try{return await B(X)}finally{J(X)}};return Promise.race([z(),kJ0(OJ0)])}async function hJ0($,Z,H,J,B=yJ0,Q=Date.now()){let z=[];for(let X of H){if(J())return null;let G=EJ0(X.revision),U=Z.find((W)=>W.kind===$&&W.id===X.id);if(!SJ0(U,G,Q)){z.push({id:X.id,revision:G});continue}if(IJ0(U,G)){z.push({id:X.id,revision:G});continue}if(!X.element){z.push({id:X.id,revision:G,image:null});continue}let K=performance.now(),F=await B(X.element,$==="widget").catch(()=>null),Y=Math.round(performance.now()-K);if(J())return null;z.push({id:X.id,revision:G,image:F,captureMs:Y})}return z}function LF({kind:$,enabled:Z,targets:H}){let J=F5(),B=Gu(J).data,Q=Uu(J),z=nZ.useRef(H);z.current=H;let X=nZ.useRef(B??[]);X.current=B??[];let G=nZ.useRef(Q.mutate);G.current=Q.mutate;let U=H.map((F)=>`${F.id}@${F.revision??""}`).join(`
66
- `),K=B!==void 0;nZ.useEffect(()=>{if(!Z||!K||U==="")return;let F=!1,Y=0,W,A=()=>{Y+=1;let N=Y;if(W!==void 0)clearTimeout(W);if(document.visibilityState!=="visible")return;W=setTimeout(async()=>{W=void 0;let L=await hJ0($,X.current,z.current.map((V)=>({...V,element:document.querySelector(`[data-applet-thumbnail="${CSS.escape(`${$}:${V.id}`)}"]`)})),()=>F||Y!==N||document.visibilityState!=="visible");if(!L||F||document.visibilityState!=="visible")return;G.current({kind:$,thumbnails:L})},_J0)};return document.addEventListener("visibilitychange",A),A(),()=>{if(F=!0,W!==void 0)clearTimeout(W);document.removeEventListener("visibilitychange",A)}},[Z,$,K,U])}function bB($,Z,H,J){let B=$.reduce((Q,z)=>Math.max(Q,z.y+z.h),0);for(let Q=0;Q<=B+H;Q++)for(let z=0;z<=J-Z;z++)if(!$.some((G)=>!(z+Z<=G.x||G.x+G.w<=z||Q+H<=G.y||G.y+G.h<=Q)))return{x:z,y:Q};return{x:0,y:B}}function yB($,Z=[],H=4){let J=[];for(let B of $){let{x:Q,y:z}=B.x!==void 0&&B.y!==void 0?{x:B.x,y:B.y}:bB([...Z,...J],B.w,B.h,H);J.push({i:B.id,x:Q,y:z,w:B.w,h:B.h})}return J}var Qq=_(p(),1),DF=new Map;function xJ0($){let Z=window.__moiAppletCss?.get($)??"",H=DF.get($);if(!H){let Q=document.createElement("style");Q.dataset.appletStyle=$,document.head.appendChild(Q),H={el:Q,refs:0},DF.set($,H)}if(H.el.textContent!==Z)H.el.textContent=Z;H.refs++;let J=H,B=!1;return()=>{if(B)return;if(B=!0,J.refs--,J.refs<=0)J.el.remove(),DF.delete($)}}function vJ0($){let Z=DF.get($);if(!Z||Z.el===document.head.lastElementChild)return;document.head.appendChild(Z.el)}function qF($,Z,H=!1){Qq.useInsertionEffect(()=>xJ0($),[$,Z]),Qq.useInsertionEffect(()=>{if(H)vJ0($)},[$,H,Z])}var Fu=_(r(),1);function Ku({segment:$,name:Z,version:H,children:J}){let B=F5();return qF(cG($,B,Z),H),Fu.jsx("div",{"data-applet":dG($,Z),className:"size-full",children:J})}var Yu=_(p(),1);var oZ=_(r(),1);class hB extends Yu.Component{state={error:null};static getDerivedStateFromError($){return{error:$}}componentDidCatch($,Z){console.error(`[widget:${this.props.name}]`,$,Z.componentStack),E8(this.props.workspaceId,{source:"render",kind:this.props.kind,name:this.props.name,message:$.message||String($),stack:[$.stack,Z.componentStack].filter(Boolean).join(`
67
- `)})}componentDidUpdate($){if($.resetKey!==this.props.resetKey&&this.state.error)this.setState({error:null})}render(){if(this.state.error)return oZ.jsxs("div",{className:"flex h-full w-full flex-col items-start justify-start gap-1.5 p-4 text-xs",children:[oZ.jsxs("div",{className:"flex items-center gap-1.5 font-semibold text-destructive",children:[oZ.jsx(wz,{size:16,stroke:1.75}),"Widget crashed"]}),oZ.jsx("div",{className:"font-mono break-words text-muted-foreground",children:this.state.error.message})]});return this.props.children}}var _6=_(r(),1);function Wu({name:$}){let Z=F5(),H=lI($);return _6.jsxs(G2,{mode:"wait",initial:!1,children:[H.status==="ready"&&_6.jsx(Y5.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:_6.jsx(hB,{name:$,kind:"widget",workspaceId:Z,resetKey:H.version,children:_6.jsx(Ku,{segment:"widgets",name:$,version:H.version,children:_6.jsx(H.Component,{})})})},H.version),H.status==="error"&&_6.jsx(Y5.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:H.error},`err-${H.version}`)]})}var Au=_(r(),1);function sZ({className:$,...Z}){return Au.jsx("div",{"data-slot":"skeleton",className:d1("animate-pulse rounded-lg bg-accent",$),...Z})}var Vu=_(p(),1);var j6=_(r(),1);function MF({editing:$,hidden:Z,onRemove:H,children:J}){let B=Bk();return j6.jsxs(Y5.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:[j6.jsx("div",{"data-widget-chrome":!0,"data-vivid":!0,style:y8(B,"widget"),className:z0("absolute inset-0 overflow-hidden rounded-2xl text-foreground squircle","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:J}),$&&H&&j6.jsx("div",{className:"absolute -top-2 -right-2 opacity-0 transition-opacity group-hover/widget:opacity-100",children:j6.jsx(E0,{size:"icon-sm",variant:"outline",className:"rounded-full",onClick:H,children:Z?j6.jsx(O2,{stroke:1.75}):j6.jsx(Nu,{stroke:1.75})})})]})}var tZ=_(r(),1),gJ0={0:"col-start-1",1:"col-start-2",2:"col-start-3",3:"col-start-4"},fJ0={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"},mJ0={1:"col-span-1",2:"col-span-2",3:"col-span-3",4:"col-span-4"},uJ0={1:"row-span-1",2:"row-span-2",3:"row-span-3",4:"row-span-4"};function Lu({items:$,renderItem:Z,onClose:H,onRestore:J,ref:B}){let Q=Vu.useMemo(()=>yB($),[$]);return tZ.jsx(AF,{ref:B,title:"Hidden widgets",onClose:H,className:"max-h-[60vh]",children:tZ.jsx("div",{className:"grid auto-rows-[160px] grid-cols-4 gap-2",children:tZ.jsx(G2,{children:Q.map((z)=>tZ.jsx(Y5.div,{layoutId:z.i,className:z0(gJ0[z.x],fJ0[z.y],mJ0[z.w],uJ0[z.h]),transition:{type:"spring",duration:0.35,bounce:0},children:tZ.jsx(MF,{editing:!0,onRemove:()=>J(z.i),hidden:!0,children:Z(z.i)})},z.i))})})})}var nB=_(p(),1);function T6($){let{margin:Z,containerPadding:H,containerWidth:J,cols:B}=$;return(J-Z[0]*(B-1)-H[0]*2)/B}function x8($,Z,H){if(!Number.isFinite($))return $;return Math.round(Z*$+Math.max(0,$-1)*H)}function vB($,Z,H,J,B,Q,z){let{margin:X,containerPadding:G,rowHeight:U}=$,K=T6($),F,Y,W,A;if(z)F=Math.round(z.width),Y=Math.round(z.height);else F=x8(J,K,X[0]),Y=x8(B,U,X[1]);if(Q)W=Math.round(Q.top),A=Math.round(Q.left);else if(z)W=Math.round(z.top),A=Math.round(z.left);else W=Math.round((U+X[1])*H+G[1]),A=Math.round((K+X[0])*Z+G[0]);if(!Q&&!z){if(Number.isFinite(J)){let L=Math.round((K+X[0])*(Z+J)+G[0])-A-F;if(L!==X[0])F+=L-X[0]}if(Number.isFinite(B)){let L=Math.round((U+X[1])*(H+B)+G[1])-W-Y;if(L!==X[1])Y+=L-X[1]}}return{top:W,left:A,width:F,height:Y}}function qu($,Z,H,J,B){let{margin:Q,containerPadding:z,cols:X,rowHeight:G,maxRows:U}=$,K=T6($),F=Math.round((H-z[0])/(K+Q[0])),Y=Math.round((Z-z[1])/(G+Q[1]));return F=xB(F,0,X-J),Y=xB(Y,0,U-B),{x:F,y:Y}}function gB($,Z,H){let{margin:J,containerPadding:B,rowHeight:Q}=$,z=T6($),X=Math.round((H-B[0])/(z+J[0])),G=Math.round((Z-B[1])/(Q+J[1]));return{x:X,y:G}}function Mu($,Z,H){let{margin:J,rowHeight:B}=$,Q=T6($),z=Math.max(1,Math.round((Z+J[0])/(Q+J[0]))),X=Math.max(1,Math.round((H+J[1])/(B+J[1])));return{w:z,h:X}}function xB($,Z,H){return Math.max(Math.min($,H),Z)}function _F($,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 C6($,Z){for(let H=0;H<$.length;H++){let J=$[H];if(J!==void 0&&_F(J,Z))return J}return}function zq($,Z){return $.filter((H)=>_F(H,Z))}function pJ0($,Z){if(Z==="horizontal")return Xq($);if(Z==="vertical")return PF($);if(Z==="wrap")return PF($);return[...$]}function PF($){return[...$].sort((Z,H)=>{if(Z.y!==H.y)return Z.y-H.y;return Z.x-H.x})}function Xq($){return[...$].sort((Z,H)=>{if(Z.x!==H.x)return Z.x-H.x;return Z.y-H.y})}function fB($){let Z=0;for(let H=0;H<$.length;H++){let J=$[H];if(J!==void 0){let B=J.y+J.h;if(B>Z)Z=B}}return Z}function w6($,Z){for(let H=0;H<$.length;H++){let J=$[H];if(J!==void 0&&J.i===Z)return J}return}function mB($){return $.filter((Z)=>Z.static===!0)}function G3($){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 eZ($){let Z=Array($.length);for(let H=0;H<$.length;H++){let J=$[H];if(J!==void 0)Z[H]=G3(J)}return Z}function cJ0($,Z){let H=Array($.length);for(let J=0;J<$.length;J++){let B=$[J];if(B!==void 0)if(Z.i===B.i)H[J]=Z;else H[J]=B}return H}function Pu($,Z,H){let J=w6($,Z);if(!J)return[[...$],null];return J=H(G3(J)),[cJ0($,J),J]}function Gq($,Z){let H=mB($);for(let J=0;J<$.length;J++){let B=$[J];if(B===void 0)continue;if(B.x+B.w>Z.cols)B.x=Z.cols-B.w;if(B.x<0)B.x=0,B.w=Z.cols;if(!B.static)H.push(B);else while(C6(H,B))B.y++}return $}function O6($,Z,H,J,B,Q,z,X,G){if(Z.static&&Z.isDraggable!==!0)return[...$];if(Z.y===J&&Z.x===H)return[...$];let{x:U,y:K}=Z;if(typeof H==="number")Z.x=H;if(typeof J==="number")Z.y=J;Z.moved=!0;let F=pJ0($,z);if(z==="vertical"&&typeof J==="number"?K>=J:z==="horizontal"&&typeof H==="number"?U>=H:!1)F=F.reverse();let W=zq(F,Z),A=W.length>0;if(A&&G)return eZ($);if(A&&Q)return Z.x=U,Z.y=K,Z.moved=!1,$;let N=[...$];for(let L=0;L<W.length;L++){let V=W[L];if(V===void 0)continue;if(V.moved)continue;if(V.static)N=Du(N,V,Z,B,z);else N=Du(N,Z,V,B,z)}return N}function Du($,Z,H,J,B,Q){let z=B==="horizontal",X=B==="vertical",G=Z.static;if(J){J=!1;let F={x:z?Math.max(Z.x-H.w,0):H.x,y:X?Math.max(Z.y-H.h,0):H.y,w:H.w,h:H.h,i:"-1"},Y=C6($,F),W=Y!==void 0&&Y.y+Y.h>Z.y,A=Y!==void 0&&Z.x+Z.w>Y.x;if(!Y)return O6($,H,z?F.x:void 0,X?F.y:void 0,J,G,B);if(W&&X)return O6($,H,void 0,H.y+1,J,G,B);if(W&&B===null)return Z.y=H.y,H.y=H.y+H.h,[...$];if(A&&z)return O6($,Z,H.x,void 0,J,G,B)}let U=z?H.x+1:void 0,K=X?H.y+1:void 0;if(U===void 0&&K===void 0)return[...$];return O6($,H,U,K,J,G,B)}function $H($,Z,H){return Math.max(Z,Math.min(H,$))}var dJ0={name:"gridBounds",constrainPosition($,Z,H,{cols:J,maxRows:B}){return{x:$H(Z,0,Math.max(0,J-$.w)),y:$H(H,0,Math.max(0,B-$.h))}},constrainSize($,Z,H,J,{cols:B,maxRows:Q}){let z=J==="w"||J==="nw"||J==="sw"?$.x+$.w:B-$.x,X=J==="n"||J==="nw"||J==="ne"?$.y+$.h:Q-$.y;return{w:$H(Z,1,Math.max(1,z)),h:$H(H,1,Math.max(1,X))}}},lJ0={name:"minMaxSize",constrainSize($,Z,H){return{w:$H(Z,$.minW??1,$.maxW??1/0),h:$H(H,$.minH??1,$.maxH??1/0)}}};var Uq=[dJ0,lJ0];function uB($,Z,H,J,B){let Q={x:H,y:J};for(let z of $)if(z.constrainPosition)Q=z.constrainPosition(Z,Q.x,Q.y,B);if(Z.constraints){for(let z of Z.constraints)if(z.constrainPosition)Q=z.constrainPosition(Z,Q.x,Q.y,B)}return Q}function _u($,Z,H,J,B,Q){let z={w:H,h:J};for(let X of $)if(X.constrainSize)z=X.constrainSize(Z,z.w,z.h,B,Q);if(Z.constraints){for(let X of Z.constraints)if(X.constrainSize)z=X.constrainSize(Z,z.w,z.h,B,Q)}return z}function OF({top:$,left:Z,width:H,height:J}){let B=`translate(${Z}px,${$}px)`;return{transform:B,WebkitTransform:B,MozTransform:B,msTransform:B,OTransform:B,width:`${H}px`,height:`${J}px`,position:"absolute"}}function Kq({top:$,left:Z,width:H,height:J}){return{top:`${$}px`,left:`${Z}px`,width:`${H}px`,height:`${J}px`,position:"absolute"}}function Fq($){return $*100+"%"}function iJ0($,Z,H,J){return $+H>J?Z:H}function ju($,Z,H){return $<0?Z:H}function rJ0($){return Math.max(0,$)}function jF($){return Math.max(0,$)}var Yq=($,Z,H)=>{let{left:J,height:B,width:Q}=Z,z=$.top-(B-$.height);return{left:J,width:Q,height:ju(z,$.height,B),top:jF(z)}},Wq=($,Z,H)=>{let{top:J,left:B,height:Q,width:z}=Z;return{top:J,height:Q,width:iJ0($.left,$.width,z,H),left:rJ0(B)}},Aq=($,Z,H)=>{let{top:J,height:B,width:Q}=Z,z=$.left+$.width-Q;if(z<0)return{height:B,width:$.left+$.width,top:jF(J),left:0};return{height:B,width:Q,top:jF(J),left:z}},Nq=($,Z,H)=>{let{top:J,left:B,height:Q,width:z}=Z;return{width:z,left:B,height:ju(J,$.height,Q),top:jF(J)}},aJ0=($,Z,H)=>Yq($,Wq($,Z,H)),nJ0=($,Z,H)=>Yq($,Aq($,Z)),oJ0=($,Z,H)=>Nq($,Wq($,Z,H)),sJ0=($,Z,H)=>Nq($,Aq($,Z)),tJ0={n:Yq,ne:aJ0,e:Wq,se:oJ0,s:Nq,sw:sJ0,w:Aq,nw:nJ0};function Ou($,Z,H,J){let B=tJ0[$];if(!B)return H;return B(Z,{...Z,...H},J)}var eJ0={type:"transform",scale:1,calcStyle($){return OF($)}};var Tu=eJ0,Cu={cols:12,rowHeight:150,margin:[10,10],containerPadding:null,maxRows:1/0},wu={enabled:!0,bounded:!1,threshold:3},Eu={enabled:!0,handles:["se"]},Su={enabled:!1,defaultItem:{w:1,h:1}};function Vq($,Z,H,J,B){let Q=J==="x"?"w":"h";Z[J]+=1;let z=$.findIndex((G)=>G.i===Z.i),X=B??mB($).length>0;for(let G=z+1;G<$.length;G++){let U=$[G];if(U===void 0)continue;if(U.static)continue;if(!X&&U.y>Z.y+Z.h)break;if(_F(Z,U))Vq($,U,H+Z[Q],J,X)}Z[J]=H}function $B0($,Z,H,J){Z.x=Math.max(Z.x,0),Z.y=Math.max(Z.y,0),Z.y=Math.min(J,Z.y);while(Z.y>0&&!C6($,Z))Z.y--;let B;while((B=C6($,Z))!==void 0)Vq(H,Z,B.y+B.h,"y");return Z.y=Math.max(Z.y,0),Z}function ZB0($,Z,H,J){Z.x=Math.max(Z.x,0),Z.y=Math.max(Z.y,0);while(Z.x>0&&!C6($,Z))Z.x--;let B;while((B=C6($,Z))!==void 0)if(Vq(J,Z,B.x+B.w,"x"),Z.x+Z.w>H){Z.x=H-Z.w,Z.y++;while(Z.x>0&&!C6($,Z))Z.x--}return Z.x=Math.max(Z.x,0),Z}var pB={type:"vertical",allowOverlap:!1,compact($,Z){let H=mB($),J=fB(H),B=PF($),Q=Array($.length);for(let z=0;z<B.length;z++){let X=B[z];if(X===void 0)continue;let G=G3(X);if(!G.static)G=$B0(H,G,B,J),J=Math.max(J,G.y+G.h),H.push(G);let U=$.indexOf(X);Q[U]=G,G.moved=!1}return Q}},Lq={type:"horizontal",allowOverlap:!1,compact($,Z){let H=mB($),J=Xq($),B=Array($.length);for(let Q=0;Q<J.length;Q++){let z=J[Q];if(z===void 0)continue;let X=G3(z);if(!X.static)X=ZB0(H,X,Z,J),H.push(X);let G=$.indexOf(z);B[G]=X,X.moved=!1}return B}},Dq={type:null,allowOverlap:!1,compact($,Z){return eZ($)}},HB0={...pB,allowOverlap:!0,compact($,Z){return eZ($)}},JB0={...Lq,allowOverlap:!0,compact($,Z){return eZ($)}},BB0={...Dq,allowOverlap:!0};function qq($,Z=!1,H=!1){let J;if(Z)if($==="vertical")J=HB0;else if($==="horizontal")J=JB0;else J=BB0;else if($==="vertical")J=pB;else if($==="horizontal")J=Lq;else J=Dq;if(H)return{...J,preventCollision:H};return J}var v8=_(p(),1);function Mq($={}){let{measureBeforeMount:Z=!1,initialWidth:H=1280}=$,[J,B]=v8.useState(H),[Q,z]=v8.useState(!Z),X=v8.useRef(null),G=v8.useRef(null),U=v8.useCallback(()=>{let K=X.current;if(K){let F=K.offsetWidth;if(B(F),!Q)z(!0)}},[Q]);return v8.useEffect(()=>{let K=X.current;if(!K)return;if(U(),typeof ResizeObserver<"u"){let F=null;return G.current=new ResizeObserver((Y)=>{let W=Y[0];if(W){let A=W.contentRect.width;if(F!==null)cancelAnimationFrame(F);F=requestAnimationFrame(()=>{B(A),F=null})}}),G.current.observe(K),()=>{if(F!==null)cancelAnimationFrame(F);if(G.current)G.current.disconnect(),G.current=null}}return()=>{if(G.current)G.current.disconnect(),G.current=null}},[U]),{width:J,mounted:Q,containerRef:X,measureWidth:U}}var y0=_(p(),1),wp=_(bF(),1),Ep=_(Op(),1);var K3=_(r(),1),s7=_(ku(),1);function mq($){let{children:Z,cols:H,containerWidth:J,margin:B,containerPadding:Q,rowHeight:z,maxRows:X,isDraggable:G,isResizable:U,isBounded:K,static:F,useCSSTransforms:Y=!0,usePercentages:W=!1,transformScale:A=1,positionStrategy:N,dragThreshold:L=0,droppingPosition:V,className:D="",style:q,handle:j="",cancel:M="",x:P,y:T,w:C,h:k,minW:E=1,maxW:h=1/0,minH:x=1,maxH:R=1/0,i:w,resizeHandles:S,resizeHandle:I,constraints:y=Uq,layoutItem:f,layout:g=[],onDragStart:O,onDrag:c,onDragStop:o,onResizeStart:b,onResize:d,onResizeStop:t}=$,[u,a]=y0.useState(!1),[n,Q0]=y0.useState(!1),Z0=y0.useRef(null),U0=y0.useRef({left:0,top:0}),B0=y0.useRef({top:0,left:0,width:0,height:0}),Y0=y0.useRef(void 0),A0=y0.useRef(g);A0.current=g;let D0=y0.useRef(null),X0=y0.useRef(null),i=y0.useRef(!1),l=y0.useRef({x:0,y:0}),e=y0.useRef(!1),$0=y0.useMemo(()=>({cols:H,containerPadding:Q,containerWidth:J,margin:B,maxRows:X,rowHeight:z}),[H,Q,J,B,X,z]),H0=y0.useMemo(()=>({cols:H,maxRows:X,containerWidth:J,containerHeight:0,rowHeight:z,margin:B,layout:[]}),[H,X,J,z,B]),O0=y0.useCallback(()=>({...H0,layout:A0.current}),[H0]),P0=y0.useMemo(()=>f??{i:w,x:P,y:T,w:C,h:k,minW:E,maxW:h,minH:x,maxH:R},[f,w,P,T,C,k,E,h,x,R]),N0=y0.useCallback((V0)=>{if(N?.calcStyle)return N.calcStyle(V0);if(Y)return OF(V0);let I0=Kq(V0);if(W)return{...I0,left:Fq(V0.left/J),width:Fq(V0.width/J)};return I0},[N,Y,W,J]),M0=y0.useCallback((V0,{node:I0})=>{if(!O)return;let{offsetParent:c0}=I0;if(!c0)return;let d0=c0.getBoundingClientRect(),B1=I0.getBoundingClientRect(),Y1=B1.left/A,Z1=d0.left/A,k1=B1.top/A,h0=d0.top/A,H1;if(N?.calcDragPosition){let n0=V0;H1=N.calcDragPosition(n0.clientX,n0.clientY,n0.clientX-B1.left,n0.clientY-B1.top)}else H1={left:Y1-Z1+c0.scrollLeft,top:k1-h0+c0.scrollTop};if(U0.current=H1,L>0){let n0=V0;l.current={x:n0.clientX,y:n0.clientY},i.current=!0,e.current=!1,a(!0);return}a(!0);let O1=gB($0,H1.top,H1.left),{x:f1,y:b0}=uB(y,P0,O1.x,O1.y,O0());O(w,f1,b0,{e:V0,node:I0,newPosition:H1})},[O,A,$0,N,L,y,P0,O0,w]),v=y0.useCallback((V0,{node:I0,deltaX:c0,deltaY:d0})=>{if(!c||!u)return;let B1=V0;if(i.current&&!e.current){let f1=B1.clientX-l.current.x,b0=B1.clientY-l.current.y;if(Math.hypot(f1,b0)<L)return;if(e.current=!0,i.current=!1,O){let l0=gB($0,U0.current.top,U0.current.left),{x:V1,y:b1}=uB(y,P0,l0.x,l0.y,O0());O(w,V1,b1,{e:V0,node:I0,newPosition:U0.current})}}let Y1=U0.current.top+d0,Z1=U0.current.left+c0;if(K){let{offsetParent:f1}=I0;if(f1){let b0=f1.clientHeight-x8(k,z,B[1]);Y1=xB(Y1,0,b0);let n0=T6($0),l0=J-x8(C,n0,B[0]);Z1=xB(Z1,0,l0)}}let k1={top:Y1,left:Z1};U0.current=k1;let h0=gB($0,Y1,Z1),{x:H1,y:O1}=uB(y,P0,h0.x,h0.y,O0());c(w,H1,O1,{e:V0,node:I0,newPosition:k1})},[c,O,u,L,K,k,z,B,$0,J,C,w,y,P0,O0]),m=y0.useCallback((V0,{node:I0})=>{if(!o||!u)return;let c0=i.current;if(i.current=!1,e.current=!1,l.current={x:0,y:0},c0){a(!1),U0.current={left:0,top:0};return}let{left:d0,top:B1}=U0.current,Y1={top:B1,left:d0};a(!1),U0.current={left:0,top:0};let Z1=gB($0,B1,d0),{x:k1,y:h0}=uB(y,P0,Z1.x,Z1.y,O0());o(w,k1,h0,{e:V0,node:I0,newPosition:Y1})},[o,u,$0,y,P0,O0,w]);D0.current=M0,X0.current=v;let s=y0.useCallback((V0,{node:I0,size:c0,handle:d0},B1,Y1)=>{let Z1=Y1==="onResizeStart"?b:Y1==="onResize"?d:t;if(!Z1)return;let k1;if(I0)k1=Ou(d0,B1,c0,J);else k1={...c0,top:B1.top,left:B1.left};B0.current=k1;let h0=Mu($0,k1.width,k1.height),{w:H1,h:O1}=_u(y,P0,h0.w,h0.h,d0,O0());Z1(w,H1,O1,{e:V0.nativeEvent,node:I0,size:k1,handle:d0})},[b,d,t,J,$0,w,y,P0,O0]),G0=y0.useCallback((V0,I0)=>{Q0(!0);let c0=vB($0,P,T,C,k),d0={...I0,handle:I0.handle};s(V0,d0,c0,"onResizeStart")},[s,$0,P,T,C,k]),j0=y0.useCallback((V0,I0)=>{let c0=vB($0,P,T,C,k),d0={...I0,handle:I0.handle};s(V0,d0,c0,"onResize")},[s,$0,P,T,C,k]),m0=y0.useCallback((V0,I0)=>{Q0(!1),B0.current={top:0,left:0,width:0,height:0};let c0=vB($0,P,T,C,k),d0={...I0,handle:I0.handle};s(V0,d0,c0,"onResizeStop")},[s,$0,P,T,C,k]);y0.useEffect(()=>{if(!V)return;let V0=Z0.current;if(!V0)return;let I0=Y0.current||{left:0,top:0},c0=u&&(V.left!==I0.left||V.top!==I0.top);if(!u){let d0={node:V0,deltaX:V.left,deltaY:V.top,lastX:0,lastY:0,x:V.left,y:V.top};D0.current?.(V.e,d0)}else if(c0){let d0=V.left-U0.current.left,B1=V.top-U0.current.top,Y1={node:V0,deltaX:d0,deltaY:B1,lastX:U0.current.left,lastY:U0.current.top,x:V.left,y:V.top};X0.current?.(V.e,Y1)}Y0.current=V},[V,u,w]);let v0=vB($0,P,T,C,k,u?U0.current:null,n?B0.current:null),T0=y0.default.Children.only(Z),p0=T6($0),$1=[x8(E,p0,B[0]),x8(x,z,B[1])],D1=[x8(h,p0,B[0]),x8(R,z,B[1])],u0=T0.props,N1=u0.className,H5=u0.style,M1=y0.default.cloneElement(T0,{ref:Z0,className:uq("react-grid-item",N1,D,{static:F,resizing:n,"react-draggable":G,"react-draggable-dragging":u,dropping:Boolean(V),cssTransforms:Y}),style:{...q,...H5,...N0(v0)}}),q0=I;return M1=K3.jsx(Ep.Resizable,{draggableOpts:{disabled:!U},className:U?void 0:"react-resizable-hide",width:v0.width,height:v0.height,minConstraints:$1,maxConstraints:D1,onResizeStart:G0,onResize:j0,onResizeStop:m0,transformScale:A,resizeHandles:S,handle:q0,children:M1}),M1=K3.jsx(wp.DraggableCore,{disabled:!G,onStart:M0,onDrag:v,onStop:m,handle:j,cancel:".react-resizable-handle"+(M?","+M:""),scale:A,nodeRef:Z0,children:M1}),M1}var U3=()=>{},Tp="react-grid-layout",Sp=!1;try{Sp=/firefox/i.test(navigator.userAgent)}catch{}function Lz0($,Z){let H=y0.default.Children.toArray($),J=y0.default.Children.toArray(Z);if(H.length!==J.length)return!1;for(let B=0;B<H.length;B++){let Q=H[B],z=J[B];if(Q?.key!==z?.key)return!1}return!0}function Cp($,Z,H,J){let B=[],Q=new Set;y0.default.Children.forEach(Z,(X)=>{if(!y0.default.isValidElement(X)||X.key===null)return;let G=String(X.key);Q.add(G);let U=$.find((K)=>K.i===G);if(U)B.push(G3(U));else{let F=X.props["data-grid"];if(F)B.push({i:G,x:F.x??0,y:F.y??0,w:F.w??1,h:F.h??1,minW:F.minW,maxW:F.maxW,minH:F.minH,maxH:F.maxH,static:F.static,isDraggable:F.isDraggable,isResizable:F.isResizable,resizeHandles:F.resizeHandles,isBounded:F.isBounded});else B.push({i:G,x:0,y:fB(B),w:1,h:1})}});let z=Gq(B,{cols:H});return J.compact(z,H)}function aB($){let{children:Z,width:H,gridConfig:J,dragConfig:B,resizeConfig:Q,dropConfig:z,positionStrategy:X=Tu,compactor:G,constraints:U=Uq,layout:K=[],droppingItem:F,autoSize:Y=!0,className:W="",style:A={},innerRef:N,onLayoutChange:L=U3,onDragStart:V=U3,onDrag:D=U3,onDragStop:q=U3,onResizeStart:j=U3,onResize:M=U3,onResizeStop:P=U3,onDrop:T=U3,onDropDragOver:C=U3}=$,k=y0.useMemo(()=>({...Cu,...J}),[J]),E=y0.useMemo(()=>({...wu,...B}),[B]),h=y0.useMemo(()=>({...Eu,...Q}),[Q]),x=y0.useMemo(()=>({...Su,...z}),[z]),{cols:R,rowHeight:w,maxRows:S,margin:I,containerPadding:y}=k,{enabled:f,bounded:g,handle:O,cancel:c,threshold:o}=E,{enabled:b,handles:d,handleComponent:t}=h,{enabled:u,defaultItem:a,onDragOver:n}=x,Q0=G??qq("vertical"),Z0=Q0.type,U0=Q0.allowOverlap,B0=Q0.preventCollision??!1,Y0=y0.useMemo(()=>F??{i:"__dropping-elem__",...a},[F,a]),A0=X.type==="transform",D0=X.scale,X0=y??I,[i,l]=y0.useState(!1),[e,$0]=y0.useState(()=>Cp(K,Z,R,Q0)),[H0,O0]=y0.useState(null),[P0,N0]=y0.useState(!1),[M0,v]=y0.useState(null),[m,s]=y0.useState(),G0=y0.useRef(null),j0=y0.useRef(null),m0=y0.useRef(null),v0=y0.useRef(0),T0=y0.useRef(e),p0=y0.useRef(K),$1=y0.useRef(Z),D1=y0.useRef(Z0),u0=y0.useRef(e);u0.current=e,y0.useEffect(()=>{if(l(!0),!s7.deepEqual(e,K))L(e)},[]),y0.useEffect(()=>{if(H0)return;if(M0)return;let b0=!s7.deepEqual(K,p0.current),n0=!Lz0(Z,$1.current),l0=Z0!==D1.current;if(b0||n0||l0){let b1=Cp(b0?K:e,Z,R,Q0);if(!s7.deepEqual(b1,e))$0(b1)}p0.current=K,$1.current=Z,D1.current=Z0},[K,Z,R,Z0,Q0,H0,M0,e]),y0.useEffect(()=>{if(!H0&&!s7.deepEqual(e,T0.current)){T0.current=e;let b0=e.filter((n0)=>n0.i!==Y0.i);L(b0)}},[e,H0,L,Y0.i]);let N1=y0.useMemo(()=>{if(!Y)return;let b0=fB(e),n0=X0[1];return b0*w+(b0-1)*I[1]+n0*2+"px"},[Y,e,w,I,X0]),H5=y0.useCallback((b0,n0,l0,V1)=>{let b1=u0.current,m1=w6(b1,b0);if(!m1)return;let w5={w:m1.w,h:m1.h,x:m1.x,y:m1.y,i:b0};G0.current=G3(m1),m0.current=b1,O0(w5),V(b1,m1,m1,null,V1.e,V1.node)},[V]),M1=y0.useCallback((b0,n0,l0,V1)=>{let b1=u0.current,m1=G0.current,w5=w6(b1,b0);if(!w5)return;let U4={w:w5.w,h:w5.h,x:w5.x,y:w5.y,i:b0},E5=O6(b1,w5,n0,l0,!0,B0,Z0,R,U0);D(E5,m1,w5,U4,V1.e,V1.node),$0(Q0.compact(E5,R)),O0(U4)},[B0,Z0,R,U0,Q0,D]),q0=y0.useCallback((b0,n0,l0,V1)=>{if(!H0)return;let b1=u0.current,m1=G0.current,w5=w6(b1,b0);if(!w5)return;let U4=O6(b1,w5,n0,l0,!0,B0,Z0,R,U0),E5=Q0.compact(U4,R);q(E5,m1,w5,null,V1.e,V1.node);let b4=m0.current;if(G0.current=null,m0.current=null,O0(null),$0(E5),b4&&!s7.deepEqual(b4,E5))L(E5)},[H0,B0,Z0,R,U0,Q0,q,L]),V0=y0.useCallback((b0,n0,l0,V1)=>{let b1=u0.current,m1=w6(b1,b0);if(!m1)return;j0.current=G3(m1),m0.current=b1,N0(!0),j(b1,m1,m1,null,V1.e,V1.node)},[j]),I0=y0.useCallback((b0,n0,l0,V1)=>{let b1=u0.current,m1=j0.current,{handle:w5}=V1,U4=!1,E5,b4,[zQ,g9]=Pu(b1,b0,(k5)=>{if(E5=k5.x,b4=k5.y,["sw","w","nw","n","ne"].includes(w5)){if(["sw","nw","w"].includes(w5))E5=k5.x+(k5.w-n0),n0=k5.x!==E5&&E5<0?k5.w:n0,E5=E5<0?0:E5;if(["ne","n","nw"].includes(w5))b4=k5.y+(k5.h-l0),l0=k5.y!==b4&&b4<0?k5.h:l0,b4=b4<0?0:b4;U4=!0}if(B0&&!U0){if(zq(b1,{...k5,w:n0,h:l0,x:E5??k5.x,y:b4??k5.y}).filter((GQ)=>GQ.i!==k5.i).length>0)b4=k5.y,l0=k5.h,E5=k5.x,n0=k5.w,U4=!1}return k5.w=n0,k5.h=l0,k5});if(!g9)return;let VH=zQ;if(U4&&E5!==void 0&&b4!==void 0)VH=O6(zQ,g9,E5,b4,!0,B0,Z0,R,U0);let XQ={w:g9.w,h:g9.h,x:g9.x,y:g9.y,i:b0,static:!0};M(VH,m1,g9,XQ,V1.e,V1.node),$0(Q0.compact(VH,R)),O0(XQ)},[B0,Z0,R,U0,Q0,M]),c0=y0.useCallback((b0,n0,l0,V1)=>{let b1=u0.current,m1=j0.current,w5=w6(b1,b0),U4=Q0.compact(b1,R);P(U4,m1,w5??null,null,V1.e,V1.node);let E5=m0.current;if(j0.current=null,m0.current=null,O0(null),N0(!1),$0(U4),E5&&!s7.deepEqual(E5,U4))L(U4)},[R,Q0,P,L]),d0=y0.useCallback(()=>{let b0=u0.current;if(!b0.some((V1)=>V1.i===Y0.i)){v(null),O0(null),s(void 0);return}let l0=Q0.compact(b0.filter((V1)=>V1.i!==Y0.i),R);$0(l0),v(null),O0(null),s(void 0)},[Y0.i,R,Q0]),B1=y0.useCallback((b0)=>{if(b0.preventDefault(),b0.stopPropagation(),Sp&&!b0.nativeEvent.target?.classList.contains(Tp))return!1;let n0=n?n(b0.nativeEvent):C(b0);if(n0===!1){if(M0)d0();return!1}let{dragOffsetX:l0=0,dragOffsetY:V1=0,...b1}=n0??{},m1={...Y0,...b1},w5=b0.currentTarget.getBoundingClientRect(),U4={cols:R,margin:I,maxRows:S,rowHeight:w,containerWidth:H,containerPadding:X0},E5=T6(U4),b4=x8(m1.w,E5,I[0]),zQ=x8(m1.h,w,I[1]),g9=b4/2,VH=zQ/2,XQ=b0.clientX-w5.left+l0-g9,k5=b0.clientY-w5.top+V1-VH,KY=Math.max(0,XQ),GQ=Math.max(0,k5),UQ={left:KY/D0,top:GQ/D0,e:b0.nativeEvent};if(!M0){let FY=qu(U4,GQ,KY,m1.w,m1.h);v(K3.jsx("div",{},m1.i)),s(UQ);let oi=u0.current.filter((si)=>si.i!==m1.i);$0([...oi,{...m1,x:FY.x,y:FY.y,static:!1,isDraggable:!0}])}else if(m){if(m.left!==UQ.left||m.top!==UQ.top)s(UQ)}},[M0,m,Y0,n,C,d0,D0,R,I,S,w,H,X0]),Y1=y0.useCallback((b0)=>{if(b0.preventDefault(),b0.stopPropagation(),v0.current--,v0.current<0)v0.current=0;if(v0.current===0)d0()},[d0]),Z1=y0.useCallback((b0)=>{b0.preventDefault(),b0.stopPropagation(),v0.current++},[]),k1=y0.useCallback((b0)=>{b0.preventDefault(),b0.stopPropagation();let n0=u0.current,l0=n0.find((V1)=>V1.i===Y0.i);v0.current=0,d0(),T(n0,l0,b0.nativeEvent)},[Y0.i,d0,T]),h0=y0.useCallback((b0,n0)=>{if(!b0||!b0.key)return null;let l0=w6(e,String(b0.key));if(!l0)return null;let V1=typeof l0.isDraggable==="boolean"?l0.isDraggable:!l0.static&&f,b1=typeof l0.isResizable==="boolean"?l0.isResizable:!l0.static&&b,m1=l0.resizeHandles||[...d],w5=V1&&g&&l0.isBounded!==!1,U4=t;return K3.jsx(mq,{containerWidth:H,cols:R,margin:I,containerPadding:X0,maxRows:S,rowHeight:w,cancel:c,handle:O,onDragStart:H5,onDrag:M1,onDragStop:q0,onResizeStart:V0,onResize:I0,onResizeStop:c0,isDraggable:V1,isResizable:b1,isBounded:w5,useCSSTransforms:A0&&i,usePercentages:!i,transformScale:D0,positionStrategy:X,dragThreshold:o,w:l0.w,h:l0.h,x:l0.x,y:l0.y,i:l0.i,minH:l0.minH,minW:l0.minW,maxH:l0.maxH,maxW:l0.maxW,static:l0.static,droppingPosition:n0?m:void 0,resizeHandles:m1,resizeHandle:U4,constraints:U,layoutItem:l0,layout:e,children:b0},l0.i)},[e,H,R,I,X0,S,w,c,O,H5,M1,q0,V0,I0,c0,f,b,g,A0,i,D0,X,o,m,d,t,U]),H1=()=>{if(!H0)return null;return K3.jsx(mq,{w:H0.w,h:H0.h,x:H0.x,y:H0.y,i:H0.i,className:`react-grid-placeholder ${P0?"placeholder-resizing":""}`,containerWidth:H,cols:R,margin:I,containerPadding:X0,maxRows:S,rowHeight:w,isDraggable:!1,isResizable:!1,isBounded:!1,useCSSTransforms:A0,transformScale:D0,constraints:U,layout:e,children:K3.jsx("div",{})})},O1=uq(Tp,W),f1={height:N1,...A};return K3.jsxs("div",{ref:N,className:O1,style:f1,onDrop:u?k1:void 0,onDragLeave:u?Y1:void 0,onDragEnter:u?Z1:void 0,onDragOver:u?B1:void 0,children:[y0.default.Children.map(Z,(b0)=>{if(!y0.default.isValidElement(b0))return null;return h0(b0)}),u&&M0&&h0(M0,!0),H1()]})}var t7=_(r(),1);function pq({items:$,editing:Z,renderItem:H,onLayoutChange:J}){let[B,Q]=nB.useState(()=>yB($,[])),[z,X]=nB.useState($),{width:G,containerRef:U,mounted:K}=Mq({measureBeforeMount:!0});if(z!==$)X($),Q((Y)=>{let W=new Map(Y.map((V)=>[V.i,V])),A=$.filter((V)=>W.has(V.id)).map((V)=>({...W.get(V.id),w:V.w,h:V.h})),N=new Set(A.map((V)=>V.i)),L=yB($.filter((V)=>!N.has(V.id)),A);return[...A,...L]});let F=nB.useCallback((Y)=>{Q(Y),J?.(Y.map((W)=>({id:W.i,w:W.w,h:W.h,x:W.x,y:W.y})))},[J]);return t7.jsx("div",{ref:U,className:"w-full",children:K&&t7.jsx(aB,{width:G,layout:B,gridConfig:{cols:4,rowHeight:160,margin:[8,8],containerPadding:[0,0]},dragConfig:{enabled:!!Z},resizeConfig:{enabled:!1},compactor:pB,onLayoutChange:F,children:B.map((Y)=>t7.jsx("div",{children:t7.jsx(Y5.div,{layoutId:Y.i,"data-applet-thumbnail":`widget:${Y.i}`,className:"size-full",transition:{type:"spring",duration:0.35,bounce:0},children:H(Y.i)})},Y.i))})})}function Ip({items:$,editing:Z,renderItem:H,onLayoutChange:J,onRemove:B}){return t7.jsx(pq,{items:$,editing:Z,onLayoutChange:J,renderItem:(Q)=>t7.jsx(MF,{editing:Z,onRemove:B?()=>B(Q):void 0,children:H(Q)})})}var g1=_(r(),1);function kp($){return g1.jsx(Wu,{name:$})}var qz0=Array.from({length:10},($,Z)=>({id:`empty-widget-${Z}`,w:2,h:1}));function Mz0(){return g1.jsx(sZ,{className:"size-full animate-none rounded-2xl texture-checker squircle"})}function Pz0({onCreateWidget:$}){return g1.jsxs("div",{className:"relative min-h-0 w-full max-w-(--column-w) flex-1 pt-7",children:[g1.jsx("div",{"aria-hidden":"true",children:g1.jsx(pq,{items:qz0,renderItem:Mz0})}),g1.jsx("div",{className:"absolute inset-0 flex items-center justify-center p-6",children:g1.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-30% to-transparent to-80% text-center",children:[g1.jsxs("div",{className:"flex flex-col gap-1.5",children:[g1.jsx("h2",{className:"font-medium",children:"A little empty here"}),g1.jsx("p",{className:"mx-auto max-w-xs text-sm text-muted-foreground",children:"Widgets are small apps that can read data, perform tasks, and surface important information"})]}),g1.jsxs(E0,{type:"button",variant:"secondary",onClick:$,children:[g1.jsx(O2,{"data-icon":"inline-start",stroke:1.5}),"Create widget"]})]})})]})}function _z0({editing:$,onCreateWidget:Z,onEditingChange:H}){return g1.jsxs("div",{className:"mb-4 flex w-full max-w-(--column-w) shrink-0 items-center justify-end gap-2",children:[$&&g1.jsxs(E0,{type:"button",variant:"ghost",size:"sm",className:"mr-auto",onClick:Z,children:[g1.jsx(O2,{"data-icon":"inline-start",stroke:1.75}),"New widget"]}),g1.jsx(G2,{mode:"popLayout",initial:!1,children:g1.jsx(Y5.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:g1.jsx(E0,{type:"button",variant:$?"default":"ghost",size:"sm",className:z0(!$&&"text-muted-foreground group-hover/widgets:opacity-100 [@media(hover:hover)]:opacity-0"),onClick:()=>H(!$),children:$?"Done":"Edit widgets"})},$?"done":"edit")})]})}function jz0(){return g1.jsx("div",{className:"flex min-h-0 flex-1 flex-col items-center justify-center gap-3",children:g1.jsx("p",{className:"text-sm text-muted-foreground",children:"No widgets added yet"})})}function Oz0(){let[$,Z]=vF.useState(0);return[vF.useCallback((J)=>{if(!J)return;let B=new ResizeObserver(([Q])=>{let z=Q.borderBoxSize?.[0];Z(z?z.blockSize:Q.contentRect.height)});return B.observe(J),()=>B.disconnect()},[]),$]}function bp({onCreateWidget:$,editing:Z,onEditingChange:H,widgets:J}){let{layout:B,setLayout:Q}=P5(),z=J.length>0,X=new Set(B.widgetGrid.map((N)=>N.i)),G=B.widgetGrid.filter((N)=>J.some((L)=>L.id===N.i)).map((N)=>{let L=J.find((V)=>V.id===N.i);return{id:N.i,w:L.config.colSpan,h:L.config.rowSpan,x:N.x,y:N.y}}),U=J.filter((N)=>!X.has(N.id)).map((N)=>({id:N.id,w:N.config.colSpan,h:N.config.rowSpan})),[K,F]=Oz0(),Y=Z&&U.length>0;LF({kind:"widget",enabled:!Z,targets:G.map((N)=>({id:N.id,revision:J.find((L)=>L.id===N.id)?.revision}))});function W(N){Q({widgetGrid:B.widgetGrid.filter((L)=>L.i!==N)})}function A(N){let L=J.find((q)=>q.id===N);if(!L)return;let V=B.widgetGrid.map((q)=>{let j=J.find((M)=>M.id===q.i);return{...q,w:j?.config.colSpan??1,h:j?.config.rowSpan??1}}),D=bB(V,L.config.colSpan,L.config.rowSpan,4);Q({widgetGrid:[...B.widgetGrid,{i:N,x:D.x,y:D.y}]})}return g1.jsx("div",{className:"group/widgets relative min-h-0 flex-1",children:g1.jsxs(Rp,{children:[g1.jsx("div",{className:z0("relative flex h-full flex-col items-center p-4",z?"overflow-y-auto":"overflow-hidden"),children:z?g1.jsxs(g1.Fragment,{children:[g1.jsx(_z0,{editing:Z,onCreateWidget:$,onEditingChange:H}),G.length===0?g1.jsx(Y5.div,{className:"flex min-h-0 w-full max-w-(--column-w) flex-1 flex-col",animate:{paddingBottom:Y?F:0},transition:{type:"spring",duration:0.3,bounce:0},children:g1.jsx(jz0,{})}):g1.jsx(Y5.div,{className:"w-full max-w-(--column-w)",animate:{marginBottom:Y?F:0},transition:{type:"spring",duration:0.3,bounce:0},children:g1.jsx(Ip,{items:G,editing:Z,renderItem:kp,onRemove:W,onLayoutChange:(N)=>Q({widgetGrid:N.map((L)=>({i:L.id,x:L.x??0,y:L.y??0}))})})})]}):g1.jsx(Pz0,{onCreateWidget:$})}),g1.jsx(G2,{children:z&&Z&&U.length>0&&g1.jsx(Lu,{ref:K,items:U,renderItem:kp,onClose:()=>H(!1),onRestore:A})})]})})}var hp=_(r(),1);function yp({children:$}){return hp.jsx("header",{className:z0("@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 HM=_(p(),1);var q4=_(r(),1);function Tz0($){if($==="needs-auth")return"Needs auth";return $[0].toUpperCase()+$.slice(1)}function Cz0({name:$,status:Z}){let H=JF($),J="size-full rounded-lg ring-2 ring-background";return q4.jsxs("span",{className:"relative size-10 shrink-0",children:[H?q4.jsx("img",{src:H,alt:"",className:"size-full rounded-lg ring-2 ring-background"}):q4.jsx("span",{className:"flex size-full items-center justify-center rounded-lg bg-muted text-muted-foreground ring-2 ring-background",children:q4.jsx(QF,{className:"size-5"})}),Z!=="connected"&&q4.jsx(xp,{"aria-hidden":"true",size:16,stroke:1.75,className:"absolute -top-1 -right-1 rounded-full bg-card text-amber-400"})]})}function vp($){return[...$].sort((Z,H)=>Number(H.status==="connected")-Number(Z.status==="connected"))}function gp({icon:$,children:Z}){return q4.jsxs("div",{className:"flex items-center gap-3 text-card-foreground",children:[$,q4.jsx("div",{className:"flex min-w-0 flex-1 flex-col justify-center gap-0.5",children:Z})]})}function fp({server:$}){return q4.jsxs(gp,{icon:q4.jsx(Cz0,{name:$.name,status:$.status}),children:[q4.jsx("div",{className:"truncate text-sm font-medium text-foreground",children:BF($.name)}),q4.jsx("span",{className:"text-sm text-muted-foreground",children:Tz0($.status)})]})}function mp(){return q4.jsxs(gp,{icon:q4.jsx(sZ,{className:"size-10 shrink-0 rounded-lg"}),children:[q4.jsx(sZ,{className:"h-4 w-36 max-w-full"}),q4.jsx(sZ,{className:"h-4 w-20"})]})}function cq({children:$}){return q4.jsx("div",{className:"grid grid-cols-1 gap-6 sm:grid-cols-2",children:$})}function up($,Z){return J5({queryKey:S0.mcp($),queryFn:()=>q1(`/api/workspaces/${$}/mcp`),enabled:Z,staleTime:1/0,gcTime:1/0,refetchOnMount:!1,refetchOnWindowFocus:!1})}var k2=_(r(),1);function QH({title:$,description:Z,children:H}){return k2.jsxs("div",{className:"flex flex-col gap-6",children:[k2.jsxs("header",{className:"flex flex-col gap-0.5",children:[k2.jsx("h2",{className:"text-lg font-medium tracking-tight",children:$}),Z&&k2.jsx("p",{className:"text-sm text-muted-foreground",children:Z})]}),H]})}function zH({label:$,children:Z}){return k2.jsxs("section",{className:"flex flex-col gap-2",children:[$&&k2.jsx("p",{className:"px-0.5 text-xs font-medium text-muted-foreground",children:$}),k2.jsx("div",{className:"flex flex-col divide-y divide-dashed divide-border overflow-hidden rounded-xl border bg-background text-foreground",children:Z})]})}function XH({title:$,description:Z,control:H}){return k2.jsxs("div",{className:"flex items-center gap-3 px-3.5 py-3",children:[k2.jsxs("div",{className:"flex min-w-0 flex-col",children:[k2.jsx("span",{className:"text-sm font-medium",children:$}),Z&&k2.jsx("span",{className:"text-xs text-muted-foreground",children:Z})]}),H&&k2.jsx("div",{className:"ml-auto flex shrink-0 items-center pl-3",children:H})]})}var o4=_(r(),1),wz0=Array.from({length:4},($,Z)=>Z);function Ez0({connectors:$}){if($.isPending)return o4.jsx("div",{role:"status","aria-label":"Loading connectors",children:o4.jsx(cq,{children:wz0.map((Z)=>o4.jsx(mp,{},Z))})});if($.isError)return o4.jsxs(pp,{children:[o4.jsx("p",{className:"text-sm text-muted-foreground",children:"Could not load connectors."}),o4.jsx(E0,{variant:"outline",size:"sm",onClick:()=>$.refetch(),children:"Retry"})]});if($.data.length===0)return o4.jsxs(pp,{children:[o4.jsx(gF,{size:24,stroke:1.5,className:"text-muted-foreground"}),o4.jsx("p",{className:"text-sm text-foreground",children:"No connectors configured."})]});return o4.jsx(cq,{children:vp($.data).map((Z)=>o4.jsx(fp,{server:Z},Z.name))})}function pp({children:$}){return o4.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 cp(){let{workspaceId:$}=P5(),Z=up($,!0);return o4.jsx(QH,{title:"Connectors",description:"Connectors available to the agent in this workspace.",children:o4.jsx(Ez0,{connectors:Z})})}var rq=_(p(),1);var sB={};g5(sB,{Thumb:()=>sp,Root:()=>np});var e7=_(p(),1);var fF=_(p(),1),dq=fF.createContext(void 0);function dp(){let $=fF.useContext(dq);if($===void 0)throw Error(g0(63));return $}var lp="data-checked",ip="data-unchecked";var mF={...p4,checked($){if($)return{[lp]:""};return{[ip]:""}}};var rp=_(p(),1);function ap($,Z,H,J=!0,B){let[Q,z]=rp.useState(),X=J1(B?`${B}-label`:void 0),G=$??Z??Q;return J0(()=>{let U=$||Z||!J?void 0:Iz0(H.current,X);if(Q!==U)z(U)}),G}function Iz0($,Z){let H=kz0($);if(!H)return;if(!H.id&&Z)H.id=Z;return H.id||void 0}function kz0($){if(!$)return;let Z=$.parentElement;if(Z&&Z.tagName==="LABEL")return Z;let H=$.id;if(H){let B=$.nextElementSibling;if(B&&B.htmlFor===H)return B}let J=$.labels;return J&&J[0]}var oB=_(r(),1),np=e7.forwardRef(function(Z,H){let{checked:J,className:B,defaultChecked:Q,"aria-labelledby":z,form:X,id:G,inputRef:U,name:K,nativeButton:F=!1,onCheckedChange:Y,readOnly:W=!1,required:A=!1,disabled:N=!1,render:L,uncheckedValue:V,value:D,style:q,...j}=Z,{clearErrors:M}=j2(),{state:P,setTouched:T,setDirty:C,validityData:k,setFilled:E,setFocused:h,validationMode:x,disabled:R,name:w,validation:S}=s5(),{labelId:I}=t5(),y=R||N,f=w??K,g=e7.useRef(null),O=v2(g,U,S.inputRef),c=e7.useRef(null),o=J1(),b=v$({id:G}),d=F?void 0:b,[t,u]=B8({controlled:J,default:Boolean(Q),name:"Switch",state:"checked"});x$(c,o,t,void 0,!y,K),J0(()=>{E(t)},[t,E]),k3(t,()=>{M(f),C(t!==k.initialValue),S.change(t)});let{getButtonProps:a,buttonRef:n}=R5({disabled:y,native:F}),Q0=ap(z,I,g,!F,d),Z0={id:F?b:o,role:"switch","aria-checked":t,"aria-readonly":W||void 0,"aria-required":A||void 0,"aria-labelledby":Q0,onFocus(){if(!y)h(!0)},onBlur(){let A0=g.current;if(!A0||y)return;if(T(!0),h(!1),x==="onBlur")S.commit(A0.checked)},onClick(A0){if(W||y)return;A0.preventDefault();let D0=g.current;if(!D0)return;FU(D0,A0)}},U0={...S.getValidationProps(y),checked:t,disabled:y,form:X,id:d,name:f,required:A,style:f?Q_:c9,tabIndex:-1,type:"checkbox","aria-hidden":!0,ref:O,onChange(A0){if(A0.nativeEvent.defaultPrevented)return;if(W){A0.preventDefault();return}let D0=A0.currentTarget.checked,X0=R0(K0.none,A0.nativeEvent);if(Y?.(D0,X0),X0.isCanceled)return;u(D0)},onClick(A0){A0.stopPropagation()},onFocus(){c.current?.focus()},...D!==void 0?{value:D}:_1},B0=e7.useMemo(()=>({...P,checked:t,disabled:y,readOnly:W,required:A}),[P,t,y,W,A]),Y0=F0("span",Z,{state:B0,ref:[H,c,n],props:[Z0,j,a,(A0)=>S.getValidationProps(y,A0)],stateAttributesMapping:mF});return oB.jsxs(dq.Provider,{value:B0,children:[Y0,!t&&f&&V!==void 0&&oB.jsx("input",{type:"hidden",form:X,name:f,value:V,disabled:y}),oB.jsx("input",{...U0,suppressHydrationWarning:!0})]})});var op=_(p(),1);var sp=op.forwardRef(function(Z,H){let{render:J,className:B,style:Q,...z}=Z,X=dp();return F0("span",Z,{state:X,ref:H,stateAttributesMapping:mF,props:z})});var lq=_(r(),1);function tp({className:$,...Z}){return lq.jsx(sB.Root,{"data-slot":"switch",className:d1('peer relative inline-flex h-5 w-9 shrink-0 cursor-pointer items-center rounded-sm border border-transparent p-px transition-all outline-none after:absolute after:-inset-x-3 after:-inset-y-2 focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 data-checked:bg-primary data-unchecked:bg-accent data-disabled:cursor-not-allowed data-disabled:opacity-50 [:where([class~="group/field-label"]:has(:focus-visible))_&]:border-transparent [:where([class~="group/field-label"]:has(:focus-visible))_&]:ring-0',$),...Z,children:lq.jsx(sB.Thumb,{"data-slot":"switch-thumb",className:"pointer-events-none block size-4 rounded-xs bg-background shadow-xs ring-0 transition-transform data-checked:translate-x-full data-checked:bg-primary-foreground data-unchecked:translate-x-0"})})}var iq=["app-settings"];function ep(){let $=z1();return H4((Z)=>{if(Z.type==="settings:updated")$.setQueryData(iq,Z.settings)}),J5({queryKey:iq,queryFn:()=>q1("/api/settings"),staleTime:30000})}function $c(){let $=z1();return B5({mutationFn:(Z)=>q1("/api/settings",o5("PATCH",Z),"Failed to save settings"),onSuccess:(Z)=>{$.setQueryData(iq,Z)}})}function Zc($){return J5({queryKey:S0.env($),queryFn:()=>q1(`/api/workspaces/${$}/env`),...c2})}function Hc($){let Z=z1();return B5({mutationFn:(H)=>q1(`/api/workspaces/${$}/env`,o5("PUT",H)),onSuccess:(H)=>{Z.setQueryData(S0.env($),H)}})}function Jc($){let Z=z1();return B5({mutationFn:(H)=>f2(`/api/workspaces/${$}/config`,o5("PUT",{name:H}),"Failed to save name"),onSuccess:()=>{Z.invalidateQueries({queryKey:S0.layout($)}),Z.invalidateQueries({queryKey:S0.all})}})}function Bc($){let Z=z1();return B5({scope:{id:`workspace-icon:${$}`},mutationFn:(H)=>q1(`/api/workspaces/${$}/icon`,{method:"PUT",headers:{"Content-Type":H.type||"application/octet-stream"},body:H}),onSuccess:()=>{Z.invalidateQueries({queryKey:S0.layout($)}),Z.invalidateQueries({queryKey:S0.all})}})}function Qc($){let Z=z1();return B5({scope:{id:`workspace-icon:${$}`},mutationFn:()=>f2(`/api/workspaces/${$}/icon`,{method:"DELETE"},"Failed to reset icon"),onSuccess:()=>{Z.invalidateQueries({queryKey:S0.layout($)}),Z.invalidateQueries({queryKey:S0.all})}})}function zc($){let Z=z1();return H4((H)=>{if(H.type==="env:updated"&&H.workspaceId===$)Z.invalidateQueries({queryKey:S0.env($)})}),{env:Zc($),update:Hc($)}}var h5=_(r(),1),Rz0={dotenv:".env",custom:"secret",both:"override"},bz0=/^[A-Za-z_][A-Za-z0-9_]*$/;function Gc(){let{workspaceId:$}=P5(),{env:Z,update:H}=zc($),[J,B]=rq.useState(""),[Q,z]=rq.useState(""),X=bz0.test(J),G=X&&Q.length>0&&!H.isPending,U=()=>{if(!G)return;H.mutate({set:{[J]:Q}},{onSuccess:()=>{B(""),z("")}})},K=Z.data?.vars??[],F=Z.data?.files.reduce((W,A)=>W+A.count,0)??0,Y=Z.data?.files.length??0;return h5.jsxs(QH,{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:[h5.jsxs(zH,{label:"Variables",children:[Z.isLoading?h5.jsx("div",{className:"flex items-center justify-center px-3.5 py-6 text-muted-foreground",children:h5.jsx(y5,{className:"size-4 animate-spin",stroke:1.75})}):K.length===0?h5.jsx("p",{className:"px-3.5 py-4 text-sm text-muted-foreground",children:"No variables yet."}):K.map((W)=>{let A=W.source!=="dotenv";return h5.jsxs("div",{className:"flex items-center gap-3 px-3.5 py-2.5",children:[h5.jsx("code",{className:"min-w-0 flex-1 truncate font-mono text-xs text-foreground",children:W.key}),h5.jsx("span",{className:"text-xs tracking-widest text-muted-foreground/60 select-none",children:"••••••"}),h5.jsx("span",{className:z0("rounded-lg px-1.5 py-0.5 text-[11px] font-medium",W.source==="dotenv"?"bg-muted text-muted-foreground":"bg-primary/10 text-primary"),children:Rz0[W.source]}),!A&&h5.jsx("span",{className:"text-right text-[11px] text-muted-foreground/60",children:"from file"}),h5.jsx(E0,{type:"button",variant:"ghost",size:"icon-sm",onClick:()=>H.mutate({remove:[W.key]}),disabled:!A,"aria-label":`Delete ${W.key}`,className:"disabled:invisible",children:h5.jsx(Xc,{stroke:1.75})})]},W.key)}),h5.jsxs("div",{className:"flex items-center gap-2 px-3.5 py-2.5",children:[h5.jsx(h3,{value:J,onChange:(W)=>B(W.target.value),placeholder:"NEW_KEY","aria-invalid":J.length>0&&!X,className:"h-7 w-40 font-mono text-xs"}),h5.jsx(h3,{value:Q,onChange:(W)=>z(W.target.value),onKeyDown:(W)=>{if(W.key==="Enter")U()},type:"password",placeholder:"value",className:"h-7 flex-1 text-xs"}),h5.jsxs(E0,{variant:"outline",size:"sm",onClick:U,disabled:!G,children:[H.isPending?h5.jsx(y5,{stroke:1.75,className:"animate-spin"}):h5.jsx(O2,{stroke:1.75}),"Add"]})]})]}),h5.jsx(zH,{label:"From .env files",children:h5.jsx(XH,{title:"Inherit .env files",description:Y>0?`Discovered ${F} ${F===1?"key":"keys"} across ${Y} ${Y===1?"file":"files"} in this space.`:"No .env files found in this space.",control:h5.jsx(tp,{checked:Z.data?.inheritDotenv??!0,disabled:Z.isLoading,onCheckedChange:(W)=>H.mutate({inheritDotenv:W})})})})]})}var Fl=_(p(),1);var k4=_(p(),1);var s0=_(p(),1),GH=_(p(),1),a2=_(p(),1),Ic=_(r(),1),pF=_(p(),1),cF=_(p(),1),I1=_(r(),1),yz0=Object.defineProperty,hz0=($,Z)=>{for(var H in Z)yz0($,H,{get:Z[H],enumerable:!0})},F3={};hz0(F3,{ActiveEmoji:()=>ic,Empty:()=>lc,List:()=>pc,Loading:()=>dc,Root:()=>hc,Search:()=>xc,SkinTone:()=>rc,SkinToneSelector:()=>cc,Viewport:()=>vc});var Oc="'Apple Color Emoji', 'Noto Color Emoji', 'Twemoji Mozilla', 'Android Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', EmojiSymbols, sans-serif",oq=["none","light","medium-light","medium","medium-dark","dark"];function aq($){return $.charAt(0).toUpperCase()+$.slice(1)}var f8=2,s4=null;function Uc($){try{s4??=document.createElement("canvas").getContext("2d",{willReadFrequently:!0})}catch{}if(!s4||(queueMicrotask(()=>{s4&&(s4=null)}),s4.canvas.width=f8,s4.canvas.height=f8,s4.font=`2px ${Oc}`,s4.textBaseline="middle",s4.measureText($).width>=f8*2))return!1;s4.fillStyle="#00f",s4.fillText($,0,0);let Z=s4.getImageData(0,0,f8,f8).data;s4.clearRect(0,0,f8,f8),s4.fillStyle="#f00",s4.fillText($,0,0);let H=s4.getImageData(0,0,f8,f8).data;for(let J=0;J<f8*f8*4;J+=4)if(Z[J]!==H[J]||Z[J+1]!==H[J+1]||Z[J+2]!==H[J+2])return!1;return!0}function Kc($,Z,H){try{let J=$.getItem(Z);if(!J)throw Error(`No value found for "${Z}".`);let B=JSON.parse(J);return H(B)}catch{return null}}function Tc($,Z,H){$.setItem(Z,JSON.stringify(H))}function Fc($){return(Z)=>Z===void 0?void 0:$(Z)}function Yc($){return(Z)=>Z===null?null:$(Z)}function I4($){if(typeof $!="string")throw Error();return $}function uF($){if(typeof $!="number")throw Error();return $}function Cc($){if(typeof $!="boolean")throw Error();return $}function I6($){return(Z)=>{if(typeof Z!="object"||Z===null)throw Error();let H={};for(let J in $){let B=Z[J];B===void 0&&$[J](void 0),H[J]=$[J](B)}return H}}function nq($){return(Z)=>{if(!Array.isArray(Z))throw Error();return Z.length>0&&$(Z[0]),Z}}var wc=($,Z)=>`${$}/${Z}/data.json`,Ec=($,Z)=>`${$}/${Z}/messages.json`,xz0=["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"],Wc="en",Sc=($)=>`frimousse/data/${$}`,Ac="frimousse/metadata";async function Nc($,Z){try{return(await fetch($,{method:"HEAD",signal:Z})).headers.get("etag")}catch{return null}}async function vz0($,Z,H){let[{emojis:J,emojisEtag:B},{messages:Q,messagesEtag:z}]=await Promise.all([fetch(wc($,Z),{signal:H}).then(async(X)=>({emojis:await X.json(),emojisEtag:X.headers.get("etag")})),fetch(Ec($,Z),{signal:H}).then(async(X)=>({messages:await X.json(),messagesEtag:X.headers.get("etag")}))]);return{emojis:J,messages:Q,emojisEtag:B,messagesEtag:z}}async function gz0($,Z,H){let[J,B]=await Promise.all([Nc(wc($,Z),H),Nc(Ec($,Z),H)]);return{emojisEtag:J,messagesEtag:B}}function fz0($){return $.skins?$.skins.filter((Z)=>typeof Z.tone=="number").reduce((Z,H)=>{let J=oq[H.tone];return Z[J]=H.emoji,Z},{}):void 0}async function Vc($,Z,H){let{emojis:J,emojisEtag:B,messages:Q,messagesEtag:z}=await vz0($,Z,H),X=Q.subgroups.find((A)=>A.key==="country-flag"||A.key==="subdivision-flag"),G=Q.groups.filter((A)=>A.key!=="component"),U=J.filter((A)=>("group"in A)),K=G.map((A)=>({index:A.order,label:aq(A.message)})),F=Q.skinTones.reduce((A,N)=>(A[N.key]=aq(N.message),A),{}),Y=U.map((A)=>({emoji:A.emoji,category:A.group,version:A.version,label:aq(A.label),tags:A.tags??[],countryFlag:X&&A.subgroup===X.order||void 0,skins:fz0(A)})),W={locale:Z,emojis:Y,categories:K,skinTones:F};return Tc(localStorage,Sc(Z),{data:W,metadata:{emojisEtag:B,messagesEtag:z}}),W}function mz0($,Z){let H=new Map;for(let z of $)H.has(z.version)||H.set(z.version,z.emoji);let J=[...H.keys()].sort((z,X)=>X-z),B=J[0]??0,Q=Uc("\uD83C\uDDEA\uD83C\uDDFA");if(typeof Z=="number")return{emojiVersion:Z,countryFlags:Q};for(let z of J){let X=H.get(z);if(Uc(X))return{emojiVersion:z,countryFlags:Q}}return{emojiVersion:B,countryFlags:Q}}var uz0=I6({emojiVersion:uF,countryFlags:Cc}),pz0=I6({data:I6({locale:I4,emojis:nq(I6({emoji:I4,category:uF,label:I4,version:uF,tags:nq(I4),countryFlag:Fc(Cc),skins:Fc(I6({light:I4,"medium-light":I4,medium:I4,"medium-dark":I4,dark:I4}))})),categories:nq(I6({index:uF,label:I4})),skinTones:I6({light:I4,"medium-light":I4,medium:I4,"medium-dark":I4,dark:I4})}),metadata:I6({emojisEtag:Yc(I4),messagesEtag:Yc(I4)})});async function cz0({locale:$,emojiVersion:Z,emojibaseUrl:H,signal:J}){let B=typeof H=="string"?H:`https://cdn.jsdelivr.net/npm/emojibase-data@${typeof Z=="number"?Math.floor(Z):"latest"}`,Q=Kc(sessionStorage,Ac,uz0),z=Kc(localStorage,Sc($),pz0),X;if(!z)X=await Vc(B,$,J);else if(Q)X=z.data;else try{let{emojisEtag:U,messagesEtag:K}=await gz0(B,$,J);X=!U||!K||U!==z.metadata.emojisEtag||K!==z.metadata.messagesEtag?await Vc(B,$,J):z.data}catch{X=z.data}Q??=mz0(X.emojis,Z),Tc(sessionStorage,Ac,Q);let G=X.emojis.filter((U)=>{let K=U.version<=Q.emojiVersion;return U.countryFlag?K&&Q.countryFlags:K});return{locale:$,emojis:G,categories:X.categories,skinTones:X.skinTones}}function Lc($){return xz0.includes($)?$:(console.warn(`Locale "${$}" is not supported, using "${Wc}" instead.`),Wc)}function Dc($){return oq.includes($)?$:(console.warn(`Skin tone "${$}" is not valid, using "none" instead.`),"none")}function dz0($,Z){let H=[];if(Z<=0)return H;for(let J=0,B=$.length;J<B;J+=Z)H.push($.slice(J,J+Z));return H}function lz0($,Z){if(!Z)return $;let H=Z.toLowerCase().trim(),J=new WeakMap;return $.filter((B)=>{let Q=0;B.label.toLowerCase().includes(H)&&(Q+=10);for(let z of B.tags)z.toLowerCase().includes(H)&&(Q+=1);return Q>0?(J.set(B,Q),!0):!1}).sort((B,Q)=>(J.get(Q)??0)-(J.get(B)??0))}function iz0($,Z,H,J){let B=lz0($.emojis,J),Q=[],z=[],X=[],G={},U=0,K=0;for(let F of B)G[F.category]||(G[F.category]=[]),G[F.category].push({emoji:H&&H!=="none"&&F.skins?F.skins[H]:F.emoji,label:F.label});for(let F of $.categories){let Y=G[F.index];if(!Y||Y.length===0)continue;let W=dz0(Array.from(Y),Z).map((A)=>({categoryIndex:U,emojis:A}));Q.push(...W),z.push({label:F.label,rowsCount:W.length,startRowIndex:K}),X.push(K),U++,K+=W.length}return{count:B.length,categories:z,categoriesStartRowIndices:X,rows:Q,skinTones:$.skinTones}}function rz0($){let Z={},H=null,J=null,B=new Set,Q=()=>{if(H){Z=H,H=null;for(let U of B)U(Z)}J=null},z=()=>H??Z,X=(U)=>{H??=Z,Object.assign(H,typeof U=="function"?U(z()):U),J||(J=requestAnimationFrame(Q))},G=(U)=>(B.add(U),()=>B.delete(U));return Z=$(X,z),{get:z,set:X,subscribe:G}}function az0($){let[Z]=a2.useState($);return Z}function nz0($){let Z=a2.createContext(null);return{useStore:()=>{let H=a2.useContext(Z);if(!H)throw Error($);return H},Provider:({store:H,children:J})=>Ic.jsx(Z.Provider,{value:H,children:J})}}function r2($,Z,H=Object.is){let[J,B]=a2.useState(()=>Z($.get()));return a2.useEffect(()=>$.subscribe(()=>{let Q=Z($.get());B((z)=>H(z,Q)?z:Q)}),[$,Z,H]),a2.useDebugValue(J),J}function R9($,Z,H){let J=a2.useCallback((B)=>B[Z],[Z]);return r2($,J,H)}var qc=2;function oz0($,Z,H,J,B){let Q=0;return rz0((z,X)=>({locale:Z,columns:H,sticky:J,skinTone:B,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:(G)=>{let U=X(),K=G?.data??U.data,F=G?.categoryHeaderHeight??U.categoryHeaderHeight,Y=G?.rowHeight??U.rowHeight,W=G?.viewportHeight??U.viewportHeight;if(!K||K.rows.length===0||!F||!Y||!W)return z({...G,viewportStartCategoryIndex:0,viewportStartRowIndex:0,viewportEndRowIndex:0});let A=0,N=0;for(let C of K.categories)if(N++*F+C.startRowIndex*Y<Q)A+=F;else break;let L=K.categories.length*F+K.rows.length*Y,V=Math.floor(qc*Y/2),D=Math.ceil(qc*Y/2),q=Math.min(Q-A-V,L-W),j=q+W+D,M=Math.max(0,Math.floor(q/Y)),P=Math.min(K.rows.length-1,Math.ceil(j/Y)),T=K.rows[M]?.categoryIndex;return z(T===void 0&&G?G:{...G,viewportStartCategoryIndex:T,viewportStartRowIndex:M,viewportEndRowIndex:P})},onDataChange:(G)=>{X().updateViewportState({data:G,activeColumnIndex:0,activeRowIndex:0})},onSearchChange:(G)=>{z({search:G,interaction:G?"keyboard":"none"})},onActiveEmojiChange:(G,U,K)=>{if(z({interaction:G,activeColumnIndex:U,activeRowIndex:K}),G!=="keyboard")return;let{listRef:F,viewportRef:Y,sticky:W,rowHeight:A,viewportHeight:N,categoryHeaderHeight:L}=X(),V=F?.current,D=Y?.current;if(!V||!D||!A||!L||!N)return;let q=K;q===0&&D.scrollTo({top:0,behavior:"instant"});let j=V.querySelector(`[aria-rowindex="${q}"]`);if(!(j instanceof HTMLElement))return;let M=j.offsetTop,P=getComputedStyle(j),T=Number.parseFloat(P.scrollMarginTop),C=Number.parseFloat(P.scrollMarginBottom),k=Q+T;W&&M<Q+N/2&&(k+=L);let E=k+N-C;(M<k||M+A>E)&&D.scrollTo({top:Math.max(M<k+L?M-Math.max(W?L:0,T):M-N+A+C,0),behavior:"instant"})},onActiveEmojiReset:()=>{z({interaction:"none",activeColumnIndex:0,activeRowIndex:0})},onRowHeightChange:(G)=>{X().updateViewportState({rowHeight:G})},onCategoryHeaderHeightChange:(G)=>{X().updateViewportState({categoryHeaderHeight:G})},onViewportSizeChange:(G,U)=>{X().updateViewportState({viewportWidth:G,viewportHeight:U})},onViewportScroll:(G)=>{Q=G,X().updateViewportState()}}))}var{useStore:R2,Provider:sz0}=nz0("EmojiPicker.Root is missing.");function tz0($){return $.search}function sq($){return $.interaction==="none"?void 0:$.data?.rows[$.activeRowIndex]?.emojis[$.activeColumnIndex]}function ez0($){return $.data===void 0||typeof $.data?.count=="number"&&$.data.count===0}function $X0($){return $.data===null||$.viewportHeight===null||$.rowHeight===null||$.categoryHeaderHeight===null}function kc($){return $.data?.rows.length}function ZX0($){return $.data?.categories.length}function HX0($){return $.data?.categoriesStartRowIndices}function JX0($){return $.data?.skinTones}function Rc($,Z){return $?.emoji===Z?.emoji}function BX0($,Z){return $?.categoryIndex!==Z?.categoryIndex||$?.emojis.length!==Z?.emojis.length?!1:!!$?.emojis.every((H,J)=>Rc(H,Z?.emojis[J]))}var tB="‍",Mc=/\p{Emoji_Modifier_Base}/u,QX0=/\uFE0F$/,zX0=/\u{1F3FB}|\u{1F3FC}|\u{1F3FD}|\u{1F3FE}|\u{1F3FF}/gu,XX0={light:"\uD83C\uDFFB","medium-light":"\uD83C\uDFFC",medium:"\uD83C\uDFFD","medium-dark":"\uD83C\uDFFE",dark:"\uD83C\uDFFF"};function GX0($,Z){if(!$.split(tB).some((J)=>Mc.test(J)))return $;let H=$.split(tB).map((J)=>J.replace(zX0,"")).join(tB);return Z==="none"?H:H.split(tB).map((J,B,Q)=>{let z=Q.length>1;return!Mc.test(J)||z&&J==="\uD83E\uDD1D"?J:J.replace(QX0,"")+XX0[Z]}).join(tB)}function UX0($){return oq.map((Z)=>({skinTone:Z,emoji:GX0($,Z)}))}function bc(){let $=R2(),Z=r2($,sq,Rc);return GH.useDeferredValue(Z)}function yc($="✋"){let Z=R2(),H=R9(Z,"skinTone"),J=GH.useMemo(()=>UX0($),[$]),B=GH.useCallback((Q)=>{Z.set({skinTone:Q})},[]);return[H,B,J]}function tq($,Z){if(Object.is($,Z))return!0;if(typeof $!="object"||typeof Z!="object"||$===null||Z===null||Array.isArray($)!==Array.isArray(Z))return!1;let H=Object.keys($),J=Object.keys(Z);return H.length!==J.length?!1:H.every((B)=>(B in Z)&&$[B]===Z[B])}function KX0(...$){}function FX0($,Z){let H=null;if(typeof window.requestIdleCallback=="function")H=window.requestIdleCallback($,Z);else{let J=Date.now();H=window.setTimeout(()=>{$({didTimeout:!1,timeRemaining:()=>Math.max(0,(Z?.timeout??50)-(Date.now()-J))})},10)}return()=>{typeof window.cancelIdleCallback=="function"?window.cancelIdleCallback(H):window.clearTimeout(H)}}var m8=typeof window<"u"?pF.useLayoutEffect:pF.useEffect;function YX0($){let Z=cF.useRef($);return m8(()=>{Z.current=$}),cF.useCallback((...H)=>Z.current(...H),[])}function WX0({emojiVersion:$,emojibaseUrl:Z}){let[H,J]=s0.useState(void 0),B=R2(),Q=R9(B,"locale"),z=R9(B,"columns"),X=R9(B,"skinTone"),G=R9(B,"search");return s0.useEffect(()=>{let U=new AbortController,K=U.signal;return cz0({locale:Q,emojiVersion:$,emojibaseUrl:Z,signal:K}).then((F)=>{J(F)}).catch((F)=>{K.aborted||console.error(F)}),()=>{U.abort()}},[$,Z,Q]),s0.useEffect(()=>{if(H)return FX0(()=>{B.get().onDataChange(iz0(H,z,X,G))},{timeout:100})},[H,z,X,G]),null}var hc=s0.forwardRef(({locale:$="en",columns:Z=9,skinTone:H="none",onEmojiSelect:J=KX0,emojiVersion:B,emojibaseUrl:Q,onFocusCapture:z,onBlurCapture:X,children:G,style:U,sticky:K=!0,...F},Y)=>{let W=YX0(J),A=az0(()=>oz0(W,Lc($),Z,K,Dc(H))),[N,L]=s0.useState(!1),V=s0.useRef(null),D=s0.useCallback((M)=>{M&&(V.current=M,A.set({rootRef:V}))},[]);m8(()=>{A.set({locale:Lc($)})},[$]),m8(()=>{A.set({columns:Z})},[Z]),m8(()=>{A.set({sticky:K})},[K]),m8(()=>{A.set({skinTone:Dc(H)})},[H]);let q=s0.useCallback((M)=>{z?.(M);let{searchRef:P,viewportRef:T}=A.get(),C=M.target===P?.current||M.target.hasAttribute("frimousse-search"),k=M.target===T?.current||M.target.hasAttribute("frimousse-viewport");M.isDefaultPrevented()||(L(C||k),M.isDefaultPrevented()||(L(C||k),k?A.get().onActiveEmojiChange("keyboard",0,0):C&&A.get().search===""&&A.set({interaction:"none"})))},[z]),j=s0.useCallback((M)=>{X?.(M),!M.isDefaultPrevented()&&!M.currentTarget.contains(M.relatedTarget)&&L(!1)},[X]);return m8(()=>{N||A.get().onActiveEmojiReset()},[N]),s0.useImperativeHandle(Y,()=>V.current),s0.useEffect(()=>{if(!N)return;function M(P){if(P.defaultPrevented||!P.key.startsWith("Arrow")&&P.key!=="Enter")return;let{data:T,onEmojiSelect:C,onActiveEmojiChange:k,interaction:E,activeColumnIndex:h,activeRowIndex:x}=A.get();if(P.key==="Enter"){let R=sq(A.get());R&&(P.preventDefault(),C(R))}if(P.key.startsWith("Arrow")){let R=h,w=x;if(P.preventDefault(),E!=="none"){if(T?.rows&&T.rows.length>0)switch(P.key){case"ArrowLeft":{if(R===0){let S=w-1,I=T.rows[S];I&&(w=S,R=I.emojis.length-1)}else R-=1;break}case"ArrowRight":{if(R===T.rows[w].emojis.length-1){let S=w+1;T.rows[S]&&(w=S,R=0)}else R+=1;break}case"ArrowUp":{let S=T.rows[w-1];S&&(w-=1,S.emojis[R]||(R=S.emojis.length-1));break}case"ArrowDown":{let S=T.rows[w+1];S&&(w+=1,S.emojis[R]||(R=S.emojis.length-1));break}}k("keyboard",R,w)}else k("keyboard",0,0)}}return document.addEventListener("keydown",M),()=>{document.removeEventListener("keydown",M)}},[N]),m8(()=>{let M=null,P=null,T=null,C=null,k=A.subscribe((w)=>{V.current&&(M!==w.viewportWidth&&(M=w.viewportWidth,V.current.style.setProperty("--frimousse-viewport-width",`${w.viewportWidth}px`)),P!==w.viewportHeight&&(P=w.viewportHeight,V.current.style.setProperty("--frimousse-viewport-height",`${w.viewportHeight}px`)),T!==w.rowHeight&&(T=w.rowHeight,V.current.style.setProperty("--frimousse-row-height",`${w.rowHeight}px`)),C!==w.categoryHeaderHeight&&(C=w.categoryHeaderHeight,V.current.style.setProperty("--frimousse-category-header-height",`${w.categoryHeaderHeight}px`)))}),{viewportWidth:E,viewportHeight:h,rowHeight:x,categoryHeaderHeight:R}=A.get();return E&&V.current.style.setProperty("--frimousse-viewport-width",`${E}px`),h&&V.current.style.setProperty("--frimousse-viewport-height",`${h}px`),x&&V.current.style.setProperty("--frimousse-row-height",`${x}px`),R&&V.current.style.setProperty("--frimousse-category-header-height",`${R}px`),k},[]),I1.jsx("div",{"data-focused":N?"":void 0,"frimousse-root":"",onBlurCapture:j,onFocusCapture:q,...F,ref:D,style:{"--frimousse-emoji-font":Oc,...U},children:I1.jsxs(sz0,{store:A,children:[I1.jsx(WX0,{emojiVersion:B,emojibaseUrl:Q}),G]})})}),xc=s0.forwardRef(({value:$,defaultValue:Z,onChange:H,...J},B)=>{let Q=R2(),z=s0.useRef(null),X=s0.useCallback((F)=>{F&&(z.current=F,Q.set({searchRef:z}))},[]),G=typeof $=="string",U=s0.useRef(G);s0.useEffect(()=>{U.current=G},[G]),m8(()=>{Q.set({search:typeof $=="string"?$:typeof Z=="string"?Z:""})},[]),m8(()=>{typeof $=="string"&&Q.get().onSearchChange($)},[$]);let K=s0.useCallback((F)=>{H?.(F),F.isDefaultPrevented()||Q.get().onSearchChange(F.target.value)},[H]);return s0.useImperativeHandle(B,()=>z.current),I1.jsx("input",{autoCapitalize:"off",autoComplete:"off",autoCorrect:"off",enterKeyHint:"done","frimousse-search":"",placeholder:"Search…",spellCheck:!1,type:"search",...J,defaultValue:Z,onChange:K,ref:X,value:$})}),AX0=s0.memo(()=>{let $=bc();return $?I1.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}),vc=s0.forwardRef(({children:$,onScroll:Z,onKeyDown:H,style:J,...B},Q)=>{let z=R2(),X=s0.useRef(null),G=s0.useCallback((Y)=>{Y&&(X.current=Y,z.set({viewportRef:X}))},[]),U=r2(z,kc),K=r2(z,ZX0),F=s0.useCallback((Y)=>{Z?.(Y),z.get().onViewportScroll(Y.currentTarget.scrollTop)},[Z]);return m8(()=>{if(!X.current)return;let Y=new ResizeObserver(([W])=>{let A=W?.borderBoxSize[0]?.inlineSize??0,N=W?.borderBoxSize[0]?.blockSize??0,{onViewportSizeChange:L,viewportHeight:V,viewportWidth:D}=z.get();(V!==N||D!==A)&&L(A,N)});return Y.observe(X.current),z.get().onViewportSizeChange(X.current.offsetWidth,X.current.clientHeight),()=>{Y.disconnect()}},[]),s0.useImperativeHandle(Q,()=>X.current),I1.jsxs("div",{"frimousse-viewport":"",...B,onScroll:F,ref:G,style:{position:"relative",boxSizing:"border-box",contain:"layout paint",containIntrinsicSize:typeof U=="number"&&typeof K=="number"?`var(--frimousse-viewport-width, auto) calc(${U} * var(--frimousse-row-height) + ${K} * var(--frimousse-category-header-height))`:void 0,overflowY:"auto",overscrollBehavior:"contain",scrollbarGutter:"stable",willChange:"scroll-position",...J},children:[I1.jsx(AX0,{}),$]})});function gc($,Z,H){return{emoji:{...$,isActive:H},role:"gridcell","aria-colindex":Z,"aria-selected":H||void 0,"aria-label":$.label,"data-active":H?"":void 0,"frimousse-emoji":"",style:{fontFamily:"var(--frimousse-emoji-font)"},tabIndex:-1}}function fc($,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 mc($,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 uc($,Z=!1,H=!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:H?"sticky":void 0,top:0}}}function Pc($,Z,H,J){return{"frimousse-list-sizer":"",style:{position:"relative",boxSizing:"border-box",height:`calc(${$} * var(--frimousse-row-height) + ${Z} * var(--frimousse-category-header-height))`,paddingTop:`calc(${H} * var(--frimousse-row-height) + ${J} * var(--frimousse-category-header-height))`}}}function _c($,Z,H){return{"aria-colcount":$,"aria-rowcount":Z,"frimousse-list":"",style:{"--frimousse-list-columns":$,...H},role:"grid"}}function NX0($){$.preventDefault()}var VX0=s0.memo(({Emoji:$,emoji:Z,columnIndex:H,rowIndex:J})=>{let B=R2(),Q=r2(B,(U)=>sq(U)?.emoji===Z.emoji),z=s0.useCallback(()=>{B.get().onEmojiSelect(Z)},[Z]),X=s0.useCallback(()=>{B.get().onActiveEmojiChange("pointer",H,J)},[H,J]),G=s0.useCallback(()=>{B.get().onActiveEmojiReset()},[]);return I1.jsx($,{...gc(Z,H,Q),onClick:z,onPointerDown:NX0,onPointerEnter:X,onPointerLeave:G})}),LX0=s0.memo(({Row:$,Emoji:Z,rowIndex:H})=>{let J=R2(),B=r2(J,(Q)=>Q.data?.rows[H],BX0);return B?I1.jsx($,{...fc(H),children:B.emojis.map((Q,z)=>I1.jsx(VX0,{Emoji:Z,columnIndex:z,emoji:Q,rowIndex:H},Q.label))}):null}),DX0=s0.memo(({CategoryHeader:$,categoryIndex:Z})=>{let H=R2(),J=r2(H,(Q)=>Q.data?.categories[Z],tq),B=R9(H,"sticky");return J?I1.jsx("div",{...mc(Z,J),children:I1.jsx($,{...uc({label:J.label},!1,B)})}):null}),jc=s0.memo(({CategoryHeader:$,Row:Z,Emoji:H})=>{let J=s0.useRef(null),B=R2(),Q=R9(B,"columns"),z=s0.useMemo(()=>Array(Q).fill({emoji:"\uD83D\uDE42",label:""}),[Q]),X=s0.useMemo(()=>({label:"Category"}),[]),G=s0.useRef(null),U=s0.useRef(null);return m8(()=>{let K=J.current?.parentElement?.parentElement;if(!K||!G.current||!U.current)return;let F=new ResizeObserver((A)=>{for(let N of A){let L=N.contentRect.height,{onRowHeightChange:V,onCategoryHeaderHeightChange:D,rowHeight:q,categoryHeaderHeight:j}=B.get();N.target===G.current&&q!==L&&V(L),N.target===U.current&&j!==L&&D(L)}});F.observe(K),F.observe(G.current),F.observe(U.current);let{onRowHeightChange:Y,onCategoryHeaderHeightChange:W}=B.get();return Y(G.current.clientHeight),W(U.current.clientHeight),()=>{F.disconnect()}},[]),I1.jsxs("div",{"aria-hidden":!0,ref:J,style:{height:0,visibility:"hidden"},children:[I1.jsx("div",{"frimousse-row-sizer":"",ref:G,children:I1.jsx(Z,{...fc(-1,!0),children:z.map((K,F)=>I1.jsx(H,{...gc(K,F,!1)},F))})}),I1.jsx("div",{...mc(-1),children:I1.jsx("div",{"frimousse-category-header-sizer":"",ref:U,children:I1.jsx($,{...uc(X,!0)})})})]})});function qX0({category:$,...Z}){return I1.jsx("div",{...Z,children:$.label})}function MX0({emoji:$,...Z}){return I1.jsx("button",{type:"button",...Z,children:$.emoji})}function PX0({...$}){return I1.jsx("div",{...$})}var pc=s0.forwardRef(({style:$,components:Z,...H},J)=>{let B=R2(),Q=s0.useRef(null),z=s0.useCallback((V)=>{V&&(Q.current=V,B.set({listRef:Q}))},[]),X=Z?.CategoryHeader??qX0,G=Z?.Emoji??MX0,U=Z?.Row??PX0,K=R9(B,"columns"),F=R9(B,"viewportStartRowIndex"),Y=R9(B,"viewportEndRowIndex"),W=r2(B,kc),A=r2(B,HX0,tq),N=s0.useMemo(()=>A?.filter((V)=>V<F).length??0,[A,F]),L=A?.length??0;return s0.useImperativeHandle(J,()=>Q.current),!W||!A||L===0?I1.jsx("div",{..._c(K,0,$),...H,children:I1.jsx("div",{...Pc(0,0,0,0),children:I1.jsx(jc,{CategoryHeader:X,Emoji:G,Row:U})})}):I1.jsx("div",{..._c(K,W,$),...H,ref:z,children:I1.jsxs("div",{...Pc(W,L,F,N),children:[I1.jsx(jc,{CategoryHeader:X,Emoji:G,Row:U}),Array.from({length:Y-F+1},(V,D)=>{let q=F+D,j=A.indexOf(q);return I1.jsxs(s0.Fragment,{children:[j>=0&&I1.jsx("div",{style:{height:"var(--frimousse-category-header-height)"}}),I1.jsx(LX0,{Emoji:G,Row:U,rowIndex:q})]},q)}),Array.from({length:L},(V,D)=>I1.jsx(DX0,{CategoryHeader:X,categoryIndex:D},D))]})})}),cc=s0.forwardRef(({emoji:$,onClick:Z,"aria-label":H="Change skin tone",...J},B)=>{let Q=R2(),z=r2(Q,JX0,tq),[X,G,U]=yc($),K=s0.useMemo(()=>Math.max(0,U.findIndex((L)=>L.skinTone===X)),[X,U]),F=U[K],Y=U[(K+1)%U.length].skinTone,W=X==="none"?void 0:z?.[X],A=Y==="none"?void 0:z?.[Y],N=s0.useCallback((L)=>{Z?.(L),L.isDefaultPrevented()||G(Y)},[Z,G,Y]);return I1.jsx("button",{type:"button",...J,"aria-label":H+(A?` (${A})`:""),"aria-live":"polite","aria-valuetext":W,"frimousse-skin-tone-selector":"",onClick:N,ref:B,children:F.emoji})});function dc({children:$,...Z}){let H=R2();return r2(H,$X0)?I1.jsx("span",{"frimousse-loading":"",...Z,children:$}):null}function _X0({children:$}){let Z=R2(),H=r2(Z,tz0);return $({search:H})}function lc({children:$,...Z}){let H=R2();return r2(H,ez0)?I1.jsx("span",{"frimousse-empty":"",...Z,children:typeof $=="function"?I1.jsx(_X0,{children:$}):$}):null}function ic({children:$}){let Z=bc();return $({emoji:Z})}function rc({children:$,emoji:Z}){let[H,J,B]=yc(Z);return $({skinTone:H,setSkinTone:J,skinToneVariations:B})}hc.displayName="EmojiPicker.Root";xc.displayName="EmojiPicker.Search";vc.displayName="EmojiPicker.Viewport";pc.displayName="EmojiPicker.List";dc.displayName="EmojiPicker.Loading";lc.displayName="EmojiPicker.Empty";cc.displayName="EmojiPicker.SkinToneSelector";ic.displayName="EmojiPicker.ActiveEmoji";rc.displayName="EmojiPicker.SkinTone";var eB=["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"],jX0=new Set(eB);function ac($){return jX0.has($)}var td={rocket:gd,sparkles:pd,bolt:eJ,flame:Ld,star:cd,heart:jd,diamond:Nd,trophy:ad,target:ld,bulb:Jd,brain:$d,robot:vd,wand:od,atom:sc,flask:Dd,cpu:Fd,code:Ud,terminal:id,api:oc,database:Wd,cube:Yd,hexagon:Od,plug:xd,tool:rd,settings:$Q,bug:Hd,activity:nc,chart:zd,briefcase:Zd,folder:qd,file:OZ,book:ec,message:Sd,mail:wd,bell:tc,paperclip:BK,key:dF,shield:fd,user:nd,home:Td,globe:_d,world:sd,planet:hd,compass:Kd,map:Ed,calendar:Bd,cloud:Gd,sun:dd,moon:Id,snowflake:ud,leaf:Cd,mountain:kd,feather:Vd,ghost:Md,music:Rd,piano:QK,camera:Qd,photo:yd,palette:bd,gamepad:Ad,gift:Pd,cart:md,chef:Xd},eq=eB.map(($)=>({id:$,Icon:td[$]}));function lF($){return $&&ac($)?td[$]:null}var ZM=[{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 $M($,Z,H){let J=H*Math.PI/180,B=Z*Math.cos(J),Q=Z*Math.sin(J),z=($+0.3963377774*B+0.2158037573*Q)**3,X=($-0.1055613458*B-0.0638541728*Q)**3,G=($-0.0894841775*B-1.291485548*Q)**3;return`#${[4.0767416621*z-3.3077115913*X+0.2309699292*G,-1.2684380046*z+2.6097574011*X-0.3413193965*G,-0.0041960863*z-0.7034186147*X+1.707614701*G].map((K)=>{let F=Math.min(1,Math.max(0,K)),Y=F<=0.0031308?12.92*F:1.055*F**0.4166666666666667-0.055;return Math.round(Y*255).toString(16).padStart(2,"0")}).join("")}`}function ed(){let $=Math.random()*360,Z=(35+Math.random()*55)*(Math.random()<0.5?-1:1),H=Math.round(115+Math.random()*55),J=$M(0.83+Math.random()*0.06,0.09+Math.random()*0.06,$),B=$M(0.5+Math.random()*0.14,0.17+Math.random()*0.07,$+Z);if(Math.random()<0.4){let Q=$M(0.7+Math.random()*0.05,0.15,$+Z/2);return{angle:H,stops:[J,Q,B]}}return{angle:H,stops:[J,B]}}var OX0="radial-gradient(120% 100% at 28% 12%, rgba(255,255,255,0.32), rgba(255,255,255,0) 58%)";function iF($){return`${OX0}, linear-gradient(${$.angle}deg, ${$.stops.join(", ")})`}var X4=256;function $l($,Z){let H=Z.angle*Math.PI/180,J=Math.sin(H),B=-Math.cos(H),Q=X4*(Math.abs(J)+Math.abs(B))/2,z=X4/2,X=$.createLinearGradient(z-J*Q,z-B*Q,z+J*Q,z+B*Q),G=Z.stops.length-1;Z.stops.forEach((K,F)=>X.addColorStop(G===0?0:F/G,K)),$.fillStyle=X,$.fillRect(0,0,X4,X4);let U=$.createRadialGradient(X4*0.28,X4*0.12,0,X4*0.28,X4*0.12,X4*1.1);U.addColorStop(0,"rgba(255,255,255,0.32)"),U.addColorStop(0.58,"rgba(255,255,255,0)"),$.fillStyle=U,$.fillRect(0,0,X4,X4)}function Zl($){return new Promise((Z,H)=>{$.toBlob((J)=>J?Z(J):H(Error("Canvas is empty")),"image/png")})}function Hl(){let $=document.createElement("canvas");$.width=X4,$.height=X4;let Z=$.getContext("2d");if(!Z)throw Error("2D canvas unavailable");return[$,Z]}var TX0=0.92,CX0=0.68;async function Jl($,Z){let[H,J]=Hl();if(Z)$l(J,Z);J.textAlign="center",J.textBaseline="middle";let B=Z?CX0:TX0;return J.font=`${Math.round(X4*B)}px "Apple Color Emoji","Segoe UI Emoji","Noto Color Emoji",sans-serif`,J.fillText($,X4/2,X4/2+X4*0.04),Zl(H)}function wX0($){return new Promise((Z,H)=>{let J=new Image;J.onload=()=>Z(J),J.onerror=()=>H(Error("Failed to load SVG")),J.src=$})}var EX0=0.78,SX0=0.6;async function Bl($,Z){let[H,J]=Hl();if(Z)$l(J,Z);let B=Z?"#ffffff":"#18181b",Q=$.replace(/currentColor/g,B),z=await wX0(`data:image/svg+xml;utf8,${encodeURIComponent(Q)}`),X=X4*(Z?SX0:EX0),G=(X4-X)/2;return J.drawImage(z,G,G,X,X),Zl(H)}var Ql=["\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","☕"],rF="font-[Apple_Color_Emoji,Segoe_UI_Emoji,Noto_Color_Emoji,sans-serif]";var Q1=_(r(),1);function IX0({category:$,...Z}){return Q1.jsx("div",{className:"bg-background px-2.5 pt-2.5 pb-1 text-xs font-medium text-muted-foreground",...Z,children:$.label})}function kX0({children:$,...Z}){return Q1.jsx("div",{className:"scroll-my-1 px-1.5",...Z,children:$})}function RX0({emoji:$,...Z}){return Q1.jsx("button",{className:z0("flex size-9 items-center justify-center rounded-xl text-[22px] transition-colors duration-75 data-active:bg-muted",rF),...Z,children:$.emoji})}function Kl({icon:$}){let{workspaceId:Z,provider:H}=P5(),{isPending:J,mutateAsync:B}=Bc(Z),{isPending:Q,mutate:z}=Qc(Z),[X,G]=k4.useState("emoji"),[U,K]=k4.useState({id:"sunrise",gradient:ZM[0].gradient}),[F,Y]=k4.useState(null),[W,A]=k4.useState(null),[N,L]=k4.useState(""),[V,D]=k4.useState(null),[q,j]=k4.useState(null),[M,P]=k4.useState(!1),[T,C]=k4.useState(null),k=k4.useRef(null),E=k4.useRef(null),h=k4.useRef(null),x=eq.find((O)=>O.id===V),R=U.gradient!==null,w=J||Q,S=()=>{let O=ed();Y(O),K({id:"shuffle",gradient:O})},I=(O)=>{C(null),h.current=O,G("upload"),j(URL.createObjectURL(O))};k4.useEffect(()=>{let O=!1,c=async()=>{let b;if(X==="upload"){if(!h.current)return;b=h.current}else if(X==="emoji"){if(!W)return;b=await Jl(W,U.gradient)}else{let d=E.current?.querySelector("svg");if(!d)return;b=await Bl(new XMLSerializer().serializeToString(d),U.gradient)}if(!O)await B(b)};C(null);let o=window.setTimeout(()=>{c().catch((b)=>{if(!O)C(b instanceof Error?b.message:"Failed to save icon")})},150);return()=>{O=!0,window.clearTimeout(o)}},[U.gradient,W,X,B,x,q]),k4.useEffect(()=>{return()=>{if(q)URL.revokeObjectURL(q)}},[q]);let y=()=>{h.current=null,A(null),D(null),j(null),C(null),z()},f=X==="emoji"&&W?"emoji":X==="icon"&&x?"glyph":"image",g=X==="upload"&&q?q:$??I8[H??"claude-code"];return Q1.jsxs("div",{className:"flex gap-6",children:[Q1.jsxs("div",{className:"flex w-24 shrink-0 flex-col items-center gap-2.5",children:[Q1.jsx("div",{className:z0("flex size-24 items-center justify-center overflow-hidden rounded-xl",f!=="image"&&!R&&"bg-[repeating-conic-gradient(#0000000d_0%_25%,transparent_0%_50%)] bg-size-[16px_16px]"),style:f!=="image"&&U.gradient?{background:iF(U.gradient)}:void 0,children:f==="emoji"?Q1.jsx("span",{className:z0("leading-none",rF,R?"text-[64px]":"text-[86px]"),children:W}):f==="glyph"&&x?Q1.jsx(x.Icon,{stroke:1.5,className:z0(R?"size-14 text-white":"size-18 text-foreground")}):Q1.jsx("img",{src:g,alt:"",className:"size-full object-cover"})}),Q1.jsx("button",{type:"button",onClick:y,disabled:w,className:"text-xs text-muted-foreground transition-colors hover:text-foreground disabled:opacity-50",children:"Reset to default"})]}),Q1.jsxs("div",{className:"flex min-w-0 flex-1 flex-col gap-3",children:[Q1.jsx("div",{className:"flex gap-1 self-start rounded-xl bg-muted p-0.5",children:["emoji","icon","upload"].map((O)=>Q1.jsx("button",{type:"button",onClick:()=>G(O),className:z0("rounded-lg px-3.5 py-1 text-xs font-medium capitalize transition-colors",X===O?"bg-background text-foreground shadow-sm":"text-muted-foreground hover:text-foreground"),children:O},O))}),Q1.jsxs("div",{className:z0("flex items-center gap-2",X==="upload"&&"pointer-events-none opacity-35"),children:[Q1.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Background"}),Q1.jsxs("div",{className:"flex items-center gap-2",children:[Q1.jsx("button",{type:"button","aria-label":"No background",onClick:()=>K({id:"none",gradient:null}),className:z0("flex size-7 items-center justify-center rounded-full bg-muted ring-offset-2 ring-offset-card transition-shadow",U.id==="none"?"ring-2 ring-primary":"ring-1 ring-border hover:ring-muted-foreground/30"),children:Q1.jsx(Xl,{size:16,stroke:1.75,className:"text-muted-foreground"})}),ZM.map((O)=>Q1.jsx("button",{type:"button","aria-label":`${O.id} background`,onClick:()=>K({id:O.id,gradient:O.gradient}),style:{background:iF(O.gradient)},className:z0("size-7 rounded-full ring-offset-2 ring-offset-card transition-shadow",U.id===O.id?"ring-2 ring-primary":"hover:ring-2 hover:ring-muted-foreground/30")},O.id)),Q1.jsx("button",{type:"button","aria-label":"Random background",title:"Surprise me",onClick:S,style:F?{background:iF(F)}:void 0,className:z0("flex size-7 items-center justify-center rounded-full ring-offset-2 ring-offset-card transition-shadow",F?"text-white":"bg-muted text-muted-foreground ring-1 ring-border",U.id==="shuffle"?"ring-2 ring-primary":"hover:ring-2 hover:ring-muted-foreground/30"),children:Q1.jsx(zl,{size:16,stroke:1.75})})]})]}),X==="emoji"?Q1.jsxs(F3.Root,{onEmojiSelect:(O)=>A(O.emoji),emojibaseUrl:"/vendor/emojibase",columns:13,className:"isolate flex h-72 flex-col overflow-hidden rounded-xl border border-border bg-background",children:[Q1.jsxs("div",{className:"flex items-center gap-1.5 p-1.5 pb-0",children:[Q1.jsx(F3.Search,{placeholder:"Search emoji…",onChange:(O)=>L(O.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"}),Q1.jsx(F3.SkinToneSelector,{className:"size-8 shrink-0 rounded-lg text-lg hover:bg-accent"})]}),Q1.jsxs(F3.Viewport,{className:"relative scrollbar-thin flex-1 overflow-y-auto outline-none",children:[Q1.jsxs(F3.Loading,{className:"absolute inset-0 flex items-center justify-center gap-2 text-xs text-muted-foreground",children:[Q1.jsx(y5,{size:16,stroke:1.75,className:"animate-spin"}),"Loading emoji…"]}),N.trim()===""&&Q1.jsxs("div",{className:"border-b border-dashed border-border pb-1.5",children:[Q1.jsx("p",{className:"px-2.5 pt-2.5 pb-1 text-xs font-medium text-muted-foreground",children:"Favorites"}),Q1.jsx("div",{className:"grid grid-cols-13 justify-items-start px-1.5",children:Ql.map((O)=>Q1.jsx("button",{type:"button",onClick:()=>A(O),className:z0("flex size-9 items-center justify-center rounded-xl text-[22px] transition-colors duration-75",rF,W===O?"bg-primary/10":"hover:bg-accent"),children:O},O))})]}),Q1.jsxs(F3.Empty,{className:"absolute inset-0 flex flex-col items-center justify-center gap-1 text-xs text-muted-foreground",children:[Q1.jsx(Gl,{size:20,stroke:1.5}),"No emoji found"]}),Q1.jsx(F3.List,{className:"pb-1.5 select-none",components:{CategoryHeader:IX0,Row:kX0,Emoji:RX0}})]})]}):X==="icon"?Q1.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:eq.map(({id:O,Icon:c})=>Q1.jsx("button",{type:"button","aria-label":O,onClick:()=>D(O),className:z0("flex aspect-square items-center justify-center rounded-xl text-muted-foreground transition-colors [&_svg]:size-5",V===O?"bg-primary/10 text-primary":"hover:bg-accent hover:text-accent-foreground"),children:Q1.jsx(c,{stroke:1.5})},O))}):Q1.jsxs("button",{type:"button",onClick:()=>k.current?.click(),onDragOver:(O)=>{O.preventDefault(),P(!0)},onDragLeave:()=>P(!1),onDrop:(O)=>{O.preventDefault(),P(!1);let c=O.dataTransfer.files?.[0];if(c)I(c)},className:z0("flex h-72 flex-col items-center justify-center gap-2 rounded-xl border border-dashed transition-colors",M?"border-primary bg-primary/5 text-primary":"border-border text-muted-foreground hover:border-muted-foreground/30 hover:text-foreground"),children:[Q1.jsx(Ul,{size:24,stroke:1.5}),Q1.jsx("span",{className:"text-xs font-medium",children:"Click or drop an image"}),Q1.jsx("span",{className:"text-[11px] text-muted-foreground/70",children:"PNG, JPG, GIF, or WebP"})]}),Q1.jsx("div",{className:"min-h-4","aria-live":"polite",children:T?Q1.jsx("p",{className:"text-xs text-destructive",children:T}):w?Q1.jsx("p",{className:"text-xs text-muted-foreground",children:"Saving…"}):null})]}),Q1.jsx("input",{ref:k,type:"file",accept:"image/png,image/jpeg,image/gif,image/webp",className:"hidden",onChange:(O)=>{let c=O.target.files?.[0];if(c)I(c);O.target.value=""}}),Q1.jsx("span",{ref:E,"aria-hidden":!0,className:"hidden",children:x&&Q1.jsx(x.Icon,{stroke:1.5})})]})}var M4=_(r(),1);function Yl(){let{cloudDemo:$}=N9(),{name:Z,icon:H,cwd:J,workspaceId:B}=P5(),[,Q]=o2(),z=Jc(B),X=kT(),[G,U]=Fl.useState(Z??"");return M4.jsxs(QH,{title:"General",description:"Basic details for this space.",children:[M4.jsxs(zH,{children:[M4.jsx(XH,{title:"Name",description:"Shown in the sidebar and the workspace header.",control:M4.jsx(h3,{value:G,onChange:(Y)=>U(Y.target.value),onBlur:()=>{let Y=G.trim();if(Y===(Z??""))return;z.mutate(Y===""?null:Y)},onKeyDown:(Y)=>{if(Y.key==="Enter")Y.currentTarget.blur()},placeholder:"Space name",className:"w-56"})}),M4.jsx(XH,{title:"Path",control:M4.jsx(h3,{value:J??"",readOnly:!0,"aria-label":"Workspace path",title:J??void 0,className:"w-56"})}),M4.jsxs("div",{className:"flex flex-col gap-4 px-3.5 py-3.5",children:[M4.jsxs("div",{className:"flex flex-col",children:[M4.jsx("span",{className:"text-sm font-medium",children:"Icon"}),M4.jsx("span",{className:"text-xs text-muted-foreground",children:"Pick an emoji or a glyph on a generated background, or upload an image."})]}),M4.jsx(Kl,{icon:H})]})]}),!$&&M4.jsxs(zH,{label:"Danger zone",children:[M4.jsx(XH,{title:"Remove space",description:"Remove this space from moi. Its folder and sessions stay on disk.",control:M4.jsxs(E0,{type:"button",variant:"destructive",size:"sm",onClick:()=>{let W=`Remove "${Z??J??"this space"}" from your workspaces?
68
-
69
- 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(W))return;X.mutate(B,{onSuccess:()=>Q("/")})},disabled:X.isPending,children:[X.isPending&&M4.jsx(y5,{"data-icon":"inline-start",stroke:1.75,className:"animate-spin"}),"Remove"]})}),X.isError&&M4.jsx("p",{className:"px-3.5 py-3 text-xs text-destructive",children:X.error.message})]})]})}var T5=_(r(),1),bX0=[{id:"general",label:"General",icon:$Q},{id:"connectors",label:"Connectors",icon:gF},{id:"environment",label:"Environment",icon:dF}];function Wl(){let[$,Z]=HM.useState(!1),[H,J]=HM.useState("general");return T5.jsxs(T5.Fragment,{children:[T5.jsxs(l1,{children:[T5.jsx(i1,{render:T5.jsx(E0,{variant:"ghost",size:"icon-sm","aria-label":"Settings",onClick:()=>Z(!0),children:T5.jsx($Q,{stroke:1.75})})}),T5.jsx(r1,{children:"Settings"})]}),T5.jsx(R3,{open:$,onOpenChange:Z,children:T5.jsxs(y$,{showCloseButton:!1,className:"flex h-[min(680px,90vh)] w-[880px] max-w-[94vw] gap-0 overflow-hidden p-0 sm:max-w-[94vw]",children:[T5.jsx(b3,{className:"sr-only",children:"Space settings"}),T5.jsxs("nav",{className:"flex w-48 shrink-0 flex-col gap-0.5 border-r border-border bg-muted/30 p-3",children:[T5.jsx("p",{className:"px-2.5 pt-4 pb-2 text-[11px] font-semibold tracking-wider text-muted-foreground/80 uppercase",children:"Settings"}),bX0.map((B)=>T5.jsxs(E0,{type:"button",variant:H===B.id?"secondary":"ghost",size:"sm",onClick:()=>J(B.id),className:"justify-start",children:[T5.jsx(B.icon,{stroke:1.75}),B.label]},B.id))]}),T5.jsxs("div",{className:"relative scrollbar-thin min-w-0 flex-1 overflow-y-auto",children:[T5.jsxs("div",{className:"px-8 py-7",children:[H==="general"&&T5.jsx(Yl,{}),H==="connectors"&&T5.jsx(cp,{}),H==="environment"&&T5.jsx(Gc,{})]}),T5.jsx(G7,{render:T5.jsx(E0,{variant:"ghost",size:"icon","aria-label":"Close",className:"absolute top-3 right-3",children:T5.jsx(b5,{stroke:1.5})})})]})]})})]})}function yX0($){if($.status==="available")return null;if($.status==="checking")return"this workspace's agent availability has not resolved yet";if($.status==="disconnected")return"this workspace is disconnected from moi";if($.status==="login-required")return"this workspace's agent needs a login";return"this workspace's agent is unavailable"}function Al({send:$,revealChat:Z,agentAvailability:H}){let J=F5();uG(J,"sendChatMessage",(B)=>{let Q=yX0(H);if(Q){E8(J,{source:"runtime",message:`sendChatMessage("${B.message}") was dropped: ${Q}.`});return}let{message:z,...X}=B;Z(),$(z,{applet:X})})}var Y3=_(p(),1);var Ml=_(p(),1);function aF($,Z){let H=$??[];if(H.findIndex((B)=>B.id===Z.id)===-1)return[...H,Z];return H.map((B)=>B.id===Z.id&&B.updatedAt<=Z.updatedAt?Z:B)}function nF($){let Z=z1();return H4((H)=>{if(H.type==="view-builder:updated"&&H.workspaceId===$)Z.setQueryData(S0.viewBuilders($),(J)=>aF(J,H.builder));else if(H.type==="view-builder:deleted"&&H.workspaceId===$)Z.setQueryData(S0.viewBuilders($),(J)=>(J??[]).filter((B)=>B.id!==H.builderId))}),J5({queryKey:S0.viewBuilders($),queryFn:async()=>{return(await q1(`/api/workspaces/${$}/view-builders`)).builders},...c2})}function Nl($){let Z=z1();return B5({mutationFn:()=>q1(`/api/workspaces/${$}/view-builders`,o5("POST"),"Failed to create view builder"),onSuccess:(H)=>{Z.setQueryData(S0.viewBuilders($),(J)=>aF(J,H))}})}function Vl($){let Z=z1();return B5({mutationFn:({builderId:H,requirements:J})=>q1(`/api/workspaces/${$}/view-builders/${H}`,o5("PATCH",{input:{requirements:J}}),"Failed to save view requirements"),onSuccess:(H)=>{Z.setQueryData(S0.viewBuilders($),(J)=>aF(J,H))}})}function Ll($){let Z=z1();return B5({mutationFn:({builderId:H,requirements:J,...B})=>q1(`/api/workspaces/${$}/view-builders/${H}/submit`,o5("POST",{input:{requirements:J},availableIcons:eB,...B}),"Failed to start view builder"),onSuccess:(H)=>{Z.setQueryData(S0.viewBuilders($),(J)=>aF(J,H))}})}function Dl($){let Z=z1();return B5({mutationFn:(H)=>f2(`/api/workspaces/${$}/view-builders/${H}`,{method:"DELETE"},"Failed to discard view builder"),onSuccess:(H,J)=>{Z.setQueryData(S0.viewBuilders($),(B)=>(B??[]).filter((Q)=>Q.id!==J))}})}var ql=new Map;function hX0($){let Z=ql.get($)??[];return ql.delete($),Z}function xX0($,Z=[]){return[...hX0($),...Z]}function vX0($,Z){if(!$.startsWith("view:"))return;return Object.keys(Z).length>0?Z:void 0}function gX0($,Z,H){if($.startsWith("view:"))return Z?.find((J)=>J.id===$.slice(5))?.config.title||void 0;if($.startsWith("view-builder:"))return H?.find((J)=>J.id===$.slice(13))?.title||void 0;return}function Pl({activeTab:$,appletParams:Z}){let H=F5(),J=iG(H).data,B=nF(H).data;return Ml.useCallback((Q={})=>{let z=xX0(H,Q.directives??[]),X=vX0($,Z);return{activeTab:$,tabTitle:gX0($,J,B),...X?{tabParams:X}:{},...Q.applet?{applet:Q.applet}:{},...z.length>0?{directives:z}:{}}},[H,$,Z,J,B])}var _l=!0;function jl($,Z=[]){return($.trim()||Z.filter(Boolean).join(", ")).replace(/\s+/gu," ").trim().slice(0,64).trimEnd()}function oF($){return!$?.applet}function sF($,Z,H){if(!oF(H))return[];return(h1.getState().attachments[z2($,Z)]??[]).filter((B)=>B.status==="ready"&&B.upload)}function tF($){return $.map((Z)=>{if(Z.upload?.kind==="image"&&Z.previewUrl)return{type:"file",mediaType:Z.mediaType,url:Z.previewUrl,filename:Z.name};return{type:"file",mediaType:Z.mediaType,url:"",filename:Z.name}})}function Ol($,Z){if(!oF($))return $;let H=[],J=[],B=0;for(let z of Z){if(z.upload?.kind!=="image")continue;if(B+=1,z.kind==="drawing"&&z.purpose==="annotation")H.push(`${B}. ${JSON.stringify(z.sourceTab)}`);if(z.kind==="drawing"&&z.purpose==="sketch")J.push(`${B}. ${JSON.stringify(z.sourceTab)}`)}if(H.length===0&&J.length===0)return $;let Q=[...$?.directives??[]];if(H.length>0)Q.push(`Annotation attachment sources in attachment order: ${H.join("; ")}.`);if(J.length>0)Q.push(`Sketch attachment sources in attachment order: ${J.join("; ")}. Each sketch shows the intended layout of a new view.`);return{...$,directives:Q}}function eF({queryClient:$,workspaceId:Z,sessionId:H,parts:J}){let B=`optimistic:${crypto.randomUUID()}`;return $.setQueryData(S0.events(Z,H),(Q)=>uz(Q??oH(),{kind:"turn",turn:{id:B,role:"user",origin:{kind:"user-input"},parts:J,timestamp:new Date().toISOString()}})),h1.getState().setActivity(Z,H,"running"),h1.getState().setError(Z,H,null),B}function $Y({queryClient:$,workspaceId:Z,sessionId:H,text:J,filenames:B=[]}){let Q=jl(J,B);if(!Q)return;$.setQueryData(S0.sessions(Z),(z)=>[{sessionId:H,summary:Q,lastModified:Date.now()},...(z??[]).filter((X)=>X.sessionId!==H)])}function ZY($,Z,H,J){let B=$?.models,Q=!Z||!B||B.some((F)=>F.value===Z)?Z:void 0,z=$?.provider==="codex"?zU($.models,Z):B?.find((F)=>F.value===(Q??"default")),X=$?.provider==="codex"&&z?z.resolvedModel??z.value:Q,G=H&&(!z||(z.supportedEffortLevels??[]).includes(H))?H:void 0,U=J===void 0||!z||z.supportsFastMode?J:!1,K=_l&&$?.supportsStreaming?!0:void 0;return{model:X,effort:G,...U!==void 0?{fastMode:U}:{},stream:K}}function fX0($){return $.filter((Z)=>Z.text.length>0).map((Z)=>Z.kind==="reasoning"?{type:"reasoning",text:Z.text}:{type:"text",text:Z.text})}function Tl($){let Z=fX0($?.blocks??[]);if(Z.length===0)return null;return{id:"live-preview",role:"assistant",origin:{kind:"user-input"},parts:Z}}var mX0=oH();function Cl($){let Z=F5(),H=z1(),{layout:J}=P5(),[B,Q]=I3(),z=O9(Z).data,X=BU(Z).data,G=Boolean(B)&&X!==void 0&&!X.some((k)=>k.sessionId===B),U=G?null:B??null;Y3.useEffect(()=>{if(G)Q(null)},[Q,G]);let K=Pl($),F=w4((k)=>U?k.activity[`${Z}:${U}`]??"idle":"idle"),Y=k$(F),W=w4((k)=>U?k.errors[`${Z}:${U}`]??null:null),A=HR(Z,U),{refetch:N}=A,L=Y3.useCallback(()=>void N(),[N]),V=A.data??mX0,D=X!==void 0&&(U===null||A.data!==void 0),q=w4((k)=>FT(k.previews,Z,U).root),j=Y3.useMemo(()=>Tl(q),[q]),M=QU(Z,U).data,P=Y3.useCallback((k,E)=>{let h=k.trim(),x=sF(Z,U,E);if(!h&&x.length===0)return;let R=U,w=!1;if(!R)R=crypto.randomUUID(),w=!0,Q(R),$Y({queryClient:H,workspaceId:Z,sessionId:R,text:h,filenames:x.map((d)=>d.name)});let S=tF(x);if(h)S.push({type:"text",text:h});let I=eF({queryClient:H,workspaceId:Z,sessionId:R,parts:S}),y=M?.model??J.selectedModel,f=M?.effort??J.selectedEffort,g=M?.fastMode??J.selectedFastMode,{model:O,effort:c,fastMode:o,stream:b}=ZY(z,y,f,g);if(dz({type:"chat",workspaceId:Z,content:h,sessionId:R,isNew:w,optimisticId:I,model:O,effort:c,fastMode:o,stream:b,context:K(Ol(E,x)),...x.length>0?{attachments:x.map((d)=>d.upload.id)}:{}}),S5.getState().markMessageSentFromMoi(Z),w)H.invalidateQueries({queryKey:S0.preview(Z)});if(oF(E))h1.getState().clearAttachments(Z,U)},[U,Z,H,J.selectedModel,J.selectedEffort,J.selectedFastMode,K,M?.model,M?.effort,M?.fastMode,Q,z]),T=Y3.useCallback(()=>{if(!U)return;h1.getState().setError(Z,U,null)},[U,Z]),C=Y3.useCallback(()=>{if(!Y||!U)return;dz({type:"stop",workspaceId:Z,sessionId:U})},[Y,U,Z]);return{view:V,chatLoaded:D,previewTurn:j,sessionId:U,processing:Y,error:W,loadError:A.error?.message??null,retryLoad:L,send:P,stop:C,selectSession:Q,dismissError:T}}var El=_(p(),1);var G4=_(p(),1);function wl({active:$,builderId:Z,sessionId:H,sourceTab:J,workspaceId:B,onEditingStart:Q,onContinueInChat:z}){let X=G4.useRef(`sketch:${Z}`),G=G4.useRef(0),U=G4.useRef(null),K=G4.useRef(null),F=G4.useRef(!0),[Y,W]=G4.useState(!1),A=G4.useRef(Q),N=G4.useRef(z);A.current=Q,N.current=z;let L=G4.useCallback((C)=>{if(!F.current)return;if(!C){G.current+=1,U.current=null,K.current=null,h1.getState().removeAttachment(B,H,X.current);return}sG({workspaceId:B,sessionId:H,localId:X.current,purpose:"sketch",sourceTab:J,blob:C})},[H,J,B]),V=G4.useCallback((C)=>{if(!C)return K.current??Promise.resolve();if(C===U.current){if(h1.getState().attachments[z2(B,H)]?.some((x)=>x.localId===X.current&&(x.status==="ready"||x.status==="uploading")))return K.current??Promise.resolve()}U.current=C;let k=++G.current,E=tG({workspaceId:B,sessionId:H,localId:X.current,purpose:"sketch",sourceTab:J,blob:C,isCurrent:()=>G.current===k});return K.current=E,E},[H,J,B]),D=nG({mode:"sketch",onChange:L,onEditingStart:()=>A.current()}),{controls:q}=D,j=G4.useCallback(async()=>{await V(await q.flush())},[q,V]),M=G4.useCallback(async()=>{await V(await q.deactivate())},[q,V]),P=G4.useCallback(async()=>{if(Y)return;W(!0);try{await M(),N.current()}finally{W(!1)}},[Y,M]),T=G4.useCallback(async()=>{F.current=!1,G.current+=1,U.current=null,K.current=null,h1.getState().removeAttachment(B,H,X.current);try{await q.cancel()}finally{F.current=!0}},[q,H,B]);return G4.useEffect(()=>{if(!$&&q.active)M()},[$,q.active,M]),{...D,continuing:Y,continueInChat:P,prepareForSend:j,resetDocument:T}}var _5=_(r(),1);function Sl({ref:$,active:Z,builder:H,chatDocked:J,workspaceId:B,onEditingStart:Q,onContinueInChat:z,onOpenChat:X,onDiscard:G}){let U=wl({active:Z&&H.status==="draft",builderId:H.id,sessionId:H.sessionId,sourceTab:e3(H.id),workspaceId:B,onEditingStart:Q,onContinueInChat:z});switch(El.useImperativeHandle($,()=>({prepareSketchForSend:U.prepareForSend,resetSketch:U.resetDocument}),[U.prepareForSend,U.resetDocument]),H.status){case"ready":return null;case"draft":case"waiting":case"building":return _5.jsx(uX0,{active:Z,chatDocked:J,error:H.error,sketch:U,status:H.status,onDiscard:G,onOpenChat:X})}}function uX0({active:$,chatDocked:Z,error:H,sketch:J,status:B,onDiscard:Q,onOpenChat:z}){let X=B==="draft";return _5.jsxs("div",{className:z0("relative min-h-0 flex-1 overflow-hidden bg-background",$?"flex":"hidden"),children:[X&&_5.jsx(pX0,{chatDocked:Z,sketch:J}),_5.jsx("div",{inert:X?void 0:!0,className:z0("absolute inset-0",B==="building"&&"pointer-events-none opacity-50",B==="waiting"&&"invisible"),children:_5.jsx(rG,{...J.layerProps,children:X&&_5.jsx(oG,{controls:J.controls,title:"Sketch the view",busy:J.continuing,onComplete:()=>void J.continueInChat()})})}),_5.jsx("div",{"aria-hidden":!0,className:z0("pointer-events-none absolute inset-0 transition-shadow duration-500 ease-in-out",B==="building"&&"animate-glow texture-inset-shadow-50% motion-reduce:animate-none")}),B==="building"&&_5.jsx(dX0,{controls:J.controls}),B==="waiting"&&_5.jsx(cX0,{error:H,onDiscard:Q,onOpenChat:z})]})}function pX0({chatDocked:$,sketch:Z}){let{hasStrokes:H}=pJ(Z.controls);return _5.jsx("div",{ref:Z.targetRef,className:"absolute inset-0 flex items-center justify-center texture-checker-20",children:!Z.controls.active&&!H&&_5.jsxs("div",{className:z0("mb-4 flex h-full flex-col items-center justify-center gap-2 p-12 text-center text-sm text-muted-foreground","bg-radial from-background from-10% to-transparent",$?"w-full":"mr-auto w-[calc(100%-var(--chat-max))]"),children:[_5.jsx($B,{size:56,stroke:0.5}),_5.jsx("span",{className:"max-w-32",children:"Sketch how the view should look"})]})})}function cX0({error:$,onDiscard:Z,onOpenChat:H}){return _5.jsx(Il,{children:_5.jsxs("div",{className:"flex max-w-md flex-col items-center gap-4 bg-radial from-background from-50% to-transparent to-75% p-12 text-center",children:[_5.jsxs("div",{className:"flex flex-col gap-1",children:[_5.jsx("h1",{className:"font-medium",children:"The view needs your attention"}),_5.jsx("p",{className:"text-sm text-muted-foreground",children:$??"Open the chat to answer or ask the agent to continue"})]}),_5.jsxs("div",{className:"flex gap-2",children:[_5.jsx(E0,{onClick:H,children:"Open chat"}),_5.jsx(E0,{variant:"secondary",onClick:Z,children:"Discard view"})]})]})})}function dX0({controls:$}){let{hasStrokes:Z}=pJ($);return _5.jsx(Il,{children:!Z&&_5.jsx(m2,{className:"size-6 text-muted-foreground"})})}function Il({children:$,className:Z}){return _5.jsx("div",{className:z0("relative flex min-h-0 flex-1 items-center justify-center texture-checker-20",Z),children:$})}var t4=_(p(),1);function kl($,{activeId:Z,available:H,now:J}){let B=[];if(Z!==null&&H.has(Z))B.push({id:Z,releasedAt:null});for(let Q of $){if(Q.id===Z||!H.has(Q.id))continue;let z=Q.releasedAt??J;if(J-z>=60000)continue;if(B.length>=4)break;B.push({id:Q.id,releasedAt:z})}return B}function Rl($,Z){let H=null;for(let{releasedAt:J}of $){if(J===null)continue;let B=J+60000;if(H===null||B<H)H=B}return H===null?null:Math.max(0,H-Z)}function bl($,Z){return $.length===Z.length&&$.every((H,J)=>{let B=Z[J];return H.id===B.id&&H.releasedAt===B.releasedAt})}var P4=_(r(),1),hl=t4.memo(function({views:Z,activeViewId:H,params:J}){let B=lX0(H,Z),Q=new Set(B.map((z)=>z.id));return P4.jsx("div",{className:z0("relative min-h-0 flex-1 overflow-hidden",!H&&"hidden"),children:Z.filter((z)=>Q.has(z.id)).map((z)=>P4.jsx(iX0,{view:z,active:z.id===H,params:J},z.id))})});function lX0($,Z){let[H,J]=t4.useState([]),B=t4.useRef(Z);B.current=Z;let Q=Z.map((X)=>X.id).join(`
70
- `),z=t4.useCallback(()=>{J((X)=>{let G=kl(X,{activeId:$,available:new Set(B.current.map((U)=>U.id)),now:Date.now()});return bl(X,G)?X:G})},[$]);return t4.useEffect(()=>{z()},[Q,z]),t4.useEffect(()=>{let X=Rl(H,Date.now());if(X===null)return;let G=setTimeout(z,X);return()=>clearTimeout(G)},[z,H]),H}function iX0({view:$,active:Z,params:H}){let J=F5(),B=iI($.id),{current:Q,outgoing:z}=aX0(B,Z),[X,G]=t4.useState(H);if(Z&&X!==H)G(H);qF(cG("views",J,$.id),Q?.version??B.version,Z);let U=B.status==="error";return LF({kind:"view",enabled:Z&&Boolean(Q)&&!U,targets:[{id:$.id,revision:$.revision}]}),P4.jsxs(P4.Fragment,{children:[Z&&U&&P4.jsx("p",{className:"absolute inset-0 p-4 text-xs text-destructive",children:B.error}),Z&&!U&&!Q&&P4.jsx(nX0,{}),Q&&!U&&P4.jsxs(t4.Activity,{mode:Z?"visible":"hidden",children:[z&&P4.jsx(yl,{view:$,build:z,params:X},z.version),P4.jsx(yl,{view:$,build:Q,params:X,entering:z!==null,thumbnailTarget:!0},Q.version)]})]})}function yl({view:$,build:Z,params:H,entering:J,thumbnailTarget:B}){let Q=F5();return P4.jsx("div",{"data-applet-thumbnail":B?`view:${$.id}`:void 0,"data-applet":dG("views",$.id),className:z0("absolute inset-0 isolate",J&&"animate-in duration-200 ease-out blur-in-4 fade-in"),children:P4.jsx("div",{className:"size-full overflow-auto",children:P4.jsx(hB,{name:$.id,kind:"view",workspaceId:Q,resetKey:Z.version,children:P4.jsx(Z.Component,{params:H})})})})}var rX0=200;function aX0($,Z){let[H,J]=t4.useState({current:null,outgoing:null});if($.status==="ready"&&H.current?.version!==$.version){let B={Component:$.Component,version:$.version};J((Q)=>({current:B,outgoing:Z?Q.current:null}))}return t4.useEffect(()=>{if(!H.outgoing)return;let B=setTimeout(()=>J((Q)=>({...Q,outgoing:null})),rX0);return()=>clearTimeout(B)},[H.outgoing]),H}function nX0(){return P4.jsx("div",{className:"absolute inset-0 flex animate-in items-center justify-center delay-150 duration-200 fill-mode-both fade-in",children:P4.jsx(m2,{className:"text-muted-foreground"})})}function xl(){let $=z1(),{workspaceId:Z,layout:H}=P5(),[,J]=I3(),B=O9(Z).data,Q=Nl(Z),z=Vl(Z),X=Ll(Z),G=Dl(Z);return{create:()=>Q.mutateAsync(),save:(W,A)=>z.mutateAsync({builderId:W,requirements:A}),submit:async(W,A)=>{let N=A.trim(),L=sF(Z,W.sessionId);if(!N&&L.length===0)return;$Y({queryClient:$,workspaceId:Z,sessionId:W.sessionId,text:N,filenames:L.map((T)=>T.name)});let V=tF(L);if(N)V.push({type:"text",text:N});let D=eF({queryClient:$,workspaceId:Z,sessionId:W.sessionId,parts:V});J(W.sessionId);let{model:q,effort:j,fastMode:M,stream:P}=ZY(B,H.selectedModel,H.selectedEffort,H.selectedFastMode);try{await X.mutateAsync({builderId:W.id,requirements:N,optimisticId:D,...L.length>0?{attachments:L.map((T)=>T.upload.id)}:{},model:q,effort:j,fastMode:M,stream:P}),h1.getState().clearAttachments(Z,W.sessionId)}catch(T){throw h1.getState().setActivity(Z,W.sessionId,"idle"),h1.getState().setError(Z,W.sessionId,T instanceof Error?T.message:"Could not start view builder"),T}},discard:(W)=>G.mutateAsync(W)}}var b9=_(p(),1);function vl({builders:$,onSave:Z}){let H=b9.useRef(new Map),J=b9.useRef($),B=b9.useRef(Z);J.current=$,B.current=Z;let Q=b9.useCallback((X)=>{let G=H.current.get(X);if(G)clearTimeout(G);H.current.delete(X),S5.getState().setViewBuilderDraft(X,null)},[]),z=b9.useCallback((X,G)=>{S5.getState().setViewBuilderDraft(X,G);let U=H.current.get(X);if(U)clearTimeout(U);H.current.set(X,setTimeout(()=>{H.current.delete(X);let K=J.current.find((F)=>F.id===X);if(!K||K.status!=="draft")return;B.current(X,G).catch(()=>{H8.add({title:"Couldn’t save view description",type:"error"})})},500))},[]);return b9.useEffect(()=>{for(let X of $)if(X.status!=="draft")Q(X.id)},[$,Q]),b9.useEffect(()=>()=>{for(let X of H.current.values())clearTimeout(X)},[]),{change:z,clear:Q}}var UH=_(p(),1);function JM($){let Z=document.documentElement,H=getComputedStyle(Z).getPropertyValue($).trim(),J=Number.parseFloat(H);if(!Number.isFinite(J))return 0;return H.endsWith("rem")?J*Number.parseFloat(getComputedStyle(Z).fontSize):J}function gl(){let $=UH.useRef(null),[Z,H]=UH.useState(null);return UH.useLayoutEffect(()=>{let J=$.current;if(!J)return;let B=(z)=>{let X=JM("--column-w"),G=JM("--chat-min"),U=JM("--chat-max"),K={fits:z-G>=X,workspaceMinWidth:X,chatMinWidth:G,chatMaxWidth:U};H((F)=>F?.fits===K.fits&&F.workspaceMinWidth===K.workspaceMinWidth&&F.chatMinWidth===K.chatMinWidth&&F.chatMaxWidth===K.chatMaxWidth?F:K)};B(J.getBoundingClientRect().width);let Q=()=>B(J.getBoundingClientRect().width);return window.addEventListener("resize",Q),()=>window.removeEventListener("resize",Q)},[]),{ref:$,fits:Z?.fits??!1,constraints:Z?{workspaceMinWidth:Z.workspaceMinWidth,chatMinWidth:Z.chatMinWidth,chatMaxWidth:Z.chatMaxWidth}:null}}function fl($,Z){if(Z)return{status:"disconnected"};return $??{status:"checking"}}var ml=_(r(),1);function BM({agentUnavailable:$,chatError:Z,skillUpdate:H}){return $??Z??H}function k6({className:$,...Z}){return ml.jsx("div",{...Z,className:z0("w-full p-2 text-sm @xl:p-1 @xl:pl-3",$)})}var $$=_(r(),1);function QM({error:$,onDismiss:Z,onRetry:H}){return $$.jsxs(k6,{role:"alert",className:"flex items-center gap-2 text-destructive",children:[$$.jsx("span",{className:"flex-1 wrap-break-word",children:$}),H&&$$.jsx(E0,{type:"button",variant:"ghost",size:"sm",onClick:H,children:"Retry"}),Z&&$$.jsx(E0,{type:"button",variant:"ghost",size:"icon-sm",onClick:Z,className:"text-destructive hover:text-destructive","aria-label":"Dismiss error",children:$$.jsx(b5,{stroke:1.75})})]})}var zM=_(p(),1);var N2=_(r(),1);function ll({availability:$,login:Z,onStartLogin:H}){switch($.status){case"login-required":return N2.jsx(oX0,{login:Z,onStartLogin:H});case"disconnected":return N2.jsx(ul,{icon:dl,children:"Reconnecting to moi…"});case"unavailable":return N2.jsx(ul,{icon:pl,children:$.reason})}}function oX0({login:$,onStartLogin:Z}){let[H,J]=zM.useState(!1),[B,Q]=zM.useState(null),z=$?.state==="failed"?$.reason:null,X=B??z,G=async()=>{let U=window.open("about:blank","moi-agent-login");if(U)U.opener=null;J(!0),Q(null);try{let K=await Z();if(K.url){if(!U)throw Error("Allow pop-ups, then try again");U.location.href=K.url}else U?.close()}catch(K){U?.close(),Q(K instanceof Error?K.message:"Could not start sign-in")}finally{J(!1)}};return N2.jsxs(k6,{role:"alert",className:"flex items-center gap-2",children:[N2.jsx(cl,{size:20,stroke:1.5}),N2.jsxs("div",{className:"min-w-0 flex-1 space-y-1",children:[N2.jsx("div",{className:"wrap-break-word",children:"Log in to your agent to send messages"}),X&&N2.jsx("div",{className:"wrap-break-word text-destructive",children:X})]}),N2.jsxs(E0,{type:"button",size:"sm",onClick:()=>void G(),disabled:H,children:[H&&N2.jsx(y5,{stroke:1.75,className:"animate-spin"}),"Log in"]})]})}function ul({icon:$,children:Z}){return N2.jsxs(k6,{role:"alert",className:"flex items-center gap-2",children:[N2.jsx($,{size:20,stroke:1.5}),N2.jsx("div",{className:"min-w-0 flex-1 wrap-break-word",children:Z})]})}var R4=_(r(),1);function rl({error:$,pendingAction:Z,onUpdate:H,onDismiss:J}){if(!$&&Z==="auto")return R4.jsxs(k6,{role:"status",className:"flex items-center gap-1.5 text-muted-foreground",children:[R4.jsx(y5,{size:20,stroke:1.5,className:"shrink-0 animate-spin"}),R4.jsx("span",{className:"wrap-break-word",children:"Updating moi skills…"})]});let B=Z!==null;return R4.jsxs(k6,{role:$?"alert":"status",className:z0("grid grid-cols-[minmax(0,1fr)_auto] gap-x-2 gap-y-2","@xl:flex @xl:items-center",$&&"text-destructive"),children:[R4.jsxs("div",{className:"flex min-w-0 items-start gap-1.5 @xl:order-1 @xl:flex-1 @xl:items-center",children:[R4.jsx(il,{size:20,stroke:1.5,className:"shrink-0"}),$?R4.jsx("span",{className:"wrap-break-word",children:`Update failed: ${$}`}):R4.jsx("span",{className:"wrap-break-word",children:"This workspace is using old moi skills"})]}),R4.jsx(E0,{type:"button",variant:"ghost",size:"icon-sm",onClick:J,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:R4.jsx(b5,{stroke:1.75})}),R4.jsxs("div",{className:"col-span-2 flex flex-wrap gap-1.5 @xl:contents",children:[R4.jsxs(E0,{type:"button",variant:"default",size:"sm",onClick:()=>H("auto"),disabled:B,className:"@xl:order-2",children:[Z==="auto"&&R4.jsx(y5,{stroke:1.75,className:"animate-spin"}),Z==="auto"?"Updating…":"Auto-update"]}),R4.jsxs(E0,{type:"button",variant:"secondary",size:"sm",onClick:()=>H("once"),disabled:B,className:"@xl:order-3",children:[Z==="once"&&R4.jsx(y5,{stroke:1.75,className:"animate-spin"}),Z==="once"?"Updating…":"Update once"]})]})]})}var R6=_(p(),1);function XM($){return{workspaceId:$,phase:"idle",pendingAction:null,error:null}}function sX0($){return $.phase==="active"||$.phase==="idle"&&$.updateAvailable&&!$.autoUpdateEnabled}function tX0($){return $.updateAvailable&&$.autoUpdateEnabled&&!$.updatePending&&$.phase==="idle"}function al($){let Z=tI($),{isPending:H,mutate:J,reset:B}=eI($),Q=ep(),{mutate:z}=$c(),X=Q.data!==void 0,G=Q.data?.autoUpdateSkills??!1,U=R6.useCallback(()=>z({autoUpdateSkills:!0}),[z]),[K,F]=R6.useState(()=>XM($)),Y=K.workspaceId===$?K:XM($);R6.useEffect(()=>{F(XM($)),B()},[$,B]);let W=R6.useCallback((L)=>{if(H)return;if(L==="auto")U();F({workspaceId:$,phase:"active",pendingAction:L,error:null}),J(void 0,{onSuccess:()=>{F((V)=>V.workspaceId===$?{...V,phase:"dismissed",pendingAction:null,error:null}:V)},onError:(V)=>{F((D)=>D.workspaceId===$&&D.phase!=="dismissed"?{...D,phase:"active",pendingAction:null,error:V.message}:D)}})},[U,H,J,$]),A=Z.data?.updateAvailable??!1;return R6.useEffect(()=>{if(X&&tX0({updateAvailable:A,autoUpdateEnabled:G,updatePending:H,phase:Y.phase}))W("auto")},[G,Y.phase,W,X,A,H]),{bannerProps:X&&sX0({updateAvailable:A,autoUpdateEnabled:G,phase:Y.phase})?{error:Y.error,pendingAction:Y.pendingAction,onUpdate:W,onDismiss:()=>{F((L)=>L.workspaceId===$?{...L,phase:"dismissed",pendingAction:null,error:null}:L)}}:null}}var ZQ=_(r(),1);function nl($,{chatError:Z,onDismissChatError:H,chatLoadError:J,onRetryChatLoad:B}){let{data:Q,error:z}=O9($),X=Q?.availability,{bannerProps:G}=al($),U=fl(X,Boolean(z)),K=U.status==="checking"||U.status==="available"?void 0:U,F=K?{tone:"default",content:ZQ.jsx(ll,{availability:K,login:Q?.login,onStartLogin:()=>sI($)})}:void 0,Y;if(J)Y={tone:"error",content:ZQ.jsx(QM,{error:J,onRetry:B})};else if(Z)Y={tone:"error",content:ZQ.jsx(QM,{error:Z,onDismiss:H})};let W=G?{tone:"default",content:ZQ.jsx(rl,{...G})}:void 0,A=BM({agentUnavailable:F,chatError:Y,skillUpdate:W}),N=BM({agentUnavailable:F,skillUpdate:W});return{agentAvailability:U,composerBanner:A,builderComposerBanner:N}}var GM=ZV();function HY($){if(!$||!Array.isArray($.open))return GM;let Z=$.open.filter((H,J,B)=>B.indexOf(H)===J);if(Z.length===0)return GM;return{open:Z,active:Z.includes($.active)?$.active:Z[0]}}function HQ($,Z,H){if($==="agent"||$==="widgets"||$==="scratchpad")return!0;let J=w7($);if(J)return H.some((Q)=>Q.id===J);let B=t3($);return B?Z.some((Q)=>Q.id===B):!1}function JY($,Z,H){let J=$.open.filter((B)=>HQ(B,Z,H));return J.length>0?J:GM.open}function ol($){if(!$)return!1;let Z=fJ($);return Z===null||t3(Z)!==null}function sl($,Z,H,J,B){if($!==null&&HQ($,H,J)&&!(B&&$==="agent"))return $;let Q=JY(Z,H,J),z=B?Q.filter((X)=>X!=="agent"):Q;return z.includes(Z.active)?Z.active:z[0]??"agent"}var y9=_(p(),1);function tl({views:$,builders:Z,split:H}){let{layout:J,setLayout:B,workspaceId:Q}=P5(),[,z]=o2(),X=bY()["*"]??null,G=KP(),U=y9.useMemo(()=>jI(G),[G]),K=HY(J.tabs),F=y9.useRef(K);F.current=K;let Y=fJ(X),W=sl(Y,K,$,Z,H),A=Y!==null&&Y===W,N=y9.useCallback((V,D)=>{z(hG(Q,V),{replace:!0,...D?{state:{appletParams:D}}:{}})},[z,Q]),L=y9.useCallback((V)=>{F.current=V,B({tabs:V})},[B]);return y9.useEffect(()=>{if(X===W)return;if(ol(X))eX0(Q,X,W);N(W)},[W,N,X,Q]),y9.useEffect(()=>{if(!A)return;let V=F.current,D=V.open.includes(W)?V.open:[...V.open,W];if(D===V.open&&V.active===W)return;L({open:D,active:W})},[W,L,A]),{tabsState:K,activeTab:W,appletParams:U,navigateToTab:N,setTabs:L}}function eX0($,Z,H){let J=fJ(Z),B=J?t3(J):null;E8($,{source:"runtime",...B?{kind:"view",name:B}:{},message:`Tab "${Z}" does not exist in this workspace — the URL redirected to "${H}". A link, bookmark, or focusTab call is pointing at a tab that was deleted or renamed.`})}var C5=_(r(),1),$G0=$i([W7({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 ZG0({items:$}){return C5.jsxs(YZ,{children:[C5.jsx(WZ,{render:C5.jsx(E0,{type:"button",variant:"ghost",size:"icon-sm",className:"text-muted-foreground","aria-label":"Create tab",children:C5.jsx(O2,{stroke:1.75})})}),C5.jsx(AZ,{align:"start",className:"min-w-48",children:C5.jsx(NZ,{children:$.map((Z)=>C5.jsxs(rJ,{onClick:Z.onClick,className:"font-medium",children:[C5.jsx(Z.Icon,{stroke:2}),Z.label]},Z.key))})})]})}function el($){let{tab:Z,active:H}=$,J=$.preview===!0;return C5.jsxs("button",{type:"button","aria-hidden":J||void 0,"aria-label":Z.label,disabled:J,tabIndex:J?-1:void 0,onClick:$.preview?void 0:()=>$.onSelect(Z.key),className:$G0({active:H,dragging:$.preview?!1:$.state.isDragging,preview:J}),...$.preview?{}:$.state.dragHandleProps,children:[C5.jsxs("div",{className:z0("flex items-center gap-1 overflow-hidden select-none",Z.closable&&"group-hover/tab:mr-3"),children:[Z.loading?C5.jsx(m2,{"data-icon":"inline-start"}):C5.jsx(Z.Icon,{"data-icon":"inline-start",stroke:2}),C5.jsx("span",{className:z0("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&&C5.jsx("div",{"aria-label":`Close ${Z.label}`,tabIndex:J?-1:void 0,className:z0("absolute right-2 hidden size-3 items-center justify-center text-muted-foreground group-hover/tab:flex hover:text-foreground",J&&"pointer-events-none"),onClick:$.preview?void 0:(B)=>{B.stopPropagation(),$.onClose(Z.key)},children:C5.jsx(b5,{stroke:1.75})})]})}function Zi({tabs:$,active:Z,createItems:H,onSelect:J,onClose:B,onReorder:Q}){return C5.jsxs("div",{className:"flex min-w-0 flex-1 items-center gap-1",children:[C5.jsx("div",{className:"no-scrollbar min-w-0 scroll-fade-x overflow-x-auto overflow-y-hidden [--scroll-fade-reveal:16px]",children:C5.jsx(hX,{items:$,getId:(z)=>z.key,className:"flex w-max items-center gap-1",onReorder:(z)=>Q(z),renderPlaceholder:()=>C5.jsx("div",{className:"pointer-events-none absolute inset-0 rounded-md bg-muted"}),renderOverlay:(z)=>C5.jsx(el,{tab:z,active:Z===z.key,preview:!0}),renderItem:(z,X)=>C5.jsx(el,{tab:z,active:Z===z.key,state:X,onSelect:J,onClose:B})})}),C5.jsx("div",{className:"shrink-0",children:C5.jsx(ZG0,{items:H})})]})}var h6=_(p(),1);var AH=_(r(),1),w1=_(p(),1);function HG0($,Z){let H=getComputedStyle($),J=parseFloat(H.fontSize);return Z*J}function JG0($,Z){let H=getComputedStyle($.ownerDocument.documentElement),J=parseFloat(H.fontSize);return Z*J}function BG0($){return $/100*window.innerHeight}function QG0($){return $/100*window.innerWidth}function zG0($){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 JQ({groupSize:$,panelElement:Z,styleProp:H}){let J,[B,Q]=zG0(H);switch(Q){case"%":{J=B/100*$;break}case"px":{J=B;break}case"rem":{J=JG0(Z,B);break}case"em":{J=HG0(Z,B);break}case"vh":{J=BG0(B);break}case"vw":{J=QG0(B);break}}return J}function V2($){return parseFloat($.toFixed(3))}function NH({group:$}){let{orientation:Z,panels:H}=$;return H.reduce((J,B)=>(J+=Z==="horizontal"?B.element.offsetWidth:B.element.offsetHeight,J),0)}function KM($){let{panels:Z}=$,H=NH({group:$});return H===0?Z.map((J)=>({groupResizeBehavior:J.panelConstraints.groupResizeBehavior,collapsedSize:0,collapsible:J.panelConstraints.collapsible===!0,defaultSize:void 0,disabled:J.panelConstraints.disabled,minSize:0,maxSize:100,panelId:J.id})):Z.map((J)=>{let{element:B,panelConstraints:Q}=J,z=0;if(Q.collapsedSize!==void 0){let K=JQ({groupSize:H,panelElement:B,styleProp:Q.collapsedSize});z=V2(K/H*100)}let X;if(Q.defaultSize!==void 0){let K=JQ({groupSize:H,panelElement:B,styleProp:Q.defaultSize});X=V2(K/H*100)}let G=0;if(Q.minSize!==void 0){let K=JQ({groupSize:H,panelElement:B,styleProp:Q.minSize});G=V2(K/H*100)}let U=100;if(Q.maxSize!==void 0){let K=JQ({groupSize:H,panelElement:B,styleProp:Q.maxSize});U=V2(K/H*100)}return{groupResizeBehavior:Q.groupResizeBehavior,collapsedSize:z,collapsible:Q.collapsible===!0,defaultSize:X,disabled:Q.disabled,minSize:G,maxSize:U,panelId:J.id}})}function L5($,Z="Assertion error"){if(!$)throw Error(Z)}function FM($,Z){return Array.from(Z).sort($==="horizontal"?XG0:GG0)}function XG0($,Z){let H=$.element.offsetLeft-Z.element.offsetLeft;return H!==0?H:$.element.offsetWidth-Z.element.offsetWidth}function GG0($,Z){let H=$.element.offsetTop-Z.element.offsetTop;return H!==0?H:$.element.offsetHeight-Z.element.offsetHeight}function qi($){return $!==null&&typeof $=="object"&&"nodeType"in $&&$.nodeType===Node.ELEMENT_NODE}function Mi($,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 UG0({orientation:$,rects:Z,targetRect:H}){let J={x:H.x+H.width/2,y:H.y+H.height/2},B,Q=Number.MAX_VALUE;for(let z of Z){let{x:X,y:G}=Mi(J,z),U=$==="horizontal"?X:G;U<Q&&(Q=U,B=z)}return L5(B,"No rect found"),B}var BY;function KG0(){return BY===void 0&&(typeof matchMedia=="function"?BY=!!matchMedia("(pointer:coarse)").matches:BY=!1),BY}function Pi($){let{element:Z,orientation:H,panels:J,separators:B}=$,Q=FM(H,Array.from(Z.children).filter(qi).map((A)=>({element:A}))).map(({element:A})=>A),z=[],X=!1,G=!1,U=-1,K=-1,F=0,Y,W=[];{let A=-1;for(let N of Q)N.hasAttribute("data-panel")&&(A++,N.hasAttribute("data-disabled")||(F++,U===-1&&(U=A),K=A))}if(F>1){let A=-1;for(let N of Q)if(N.hasAttribute("data-panel")){A++;let L=J.find((V)=>V.element===N);if(L){if(Y){let V=Y.element.getBoundingClientRect(),D=N.getBoundingClientRect(),q;if(G){let j=H==="horizontal"?new DOMRect(V.right,V.top,0,V.height):new DOMRect(V.left,V.bottom,V.width,0),M=H==="horizontal"?new DOMRect(D.left,D.top,0,D.height):new DOMRect(D.left,D.top,D.width,0);switch(W.length){case 0:{q=[j,M];break}case 1:{let P=W[0],T=UG0({orientation:H,rects:[V,D],targetRect:P.element.getBoundingClientRect()});q=[P,T===V?M:j];break}default:{q=W;break}}}else W.length?q=W:q=[H==="horizontal"?new DOMRect(V.right,D.top,D.left-V.right,D.height):new DOMRect(D.left,V.bottom,D.width,D.top-V.bottom)];for(let j of q){let M="width"in j?j:j.element.getBoundingClientRect(),P=KG0()?$.resizeTargetMinimumSize.coarse:$.resizeTargetMinimumSize.fine;if(M.width<P){let C=P-M.width;M=new DOMRect(M.x-C/2,M.y,M.width+C,M.height)}if(M.height<P){let C=P-M.height;M=new DOMRect(M.x,M.y-C/2,M.width,M.height+C)}let T=A<=U||A>K;!X&&!T&&z.push({group:$,groupSize:NH({group:$}),panels:[Y,L],separator:"width"in j?void 0:j,rect:M}),X=!1}}G=!1,Y=L,W=[]}}else if(N.hasAttribute("data-separator")){N.ariaDisabled!==null&&(X=!0);let L=B.find((V)=>V.element===N);L?W.push(L):(Y=void 0,W=[])}else G=!0}return z}class YM{#$={};addListener($,Z){let H=this.#$[$];return H===void 0?this.#$[$]=[Z]:H.includes(Z)||H.push(Z),()=>{this.removeListener($,Z)}}emit($,Z){let H=this.#$[$];if(H!==void 0)if(H.length===1)H[0].call(null,Z);else{let J=!1,B=null,Q=Array.from(H);for(let z=0;z<Q.length;z++){let X=Q[z];try{X.call(null,Z)}catch(G){B===null&&(J=!0,B=G)}}if(J)throw B}}removeAllListeners(){this.#$={}}removeListener($,Z){let H=this.#$[$];if(H!==void 0){let J=H.indexOf(Z);J>=0&&H.splice(J,1)}}}var YH={cursorFlags:0,state:"inactive"},WM=new YM;function H$(){return YH}function FG0($){return WM.addListener("change",$)}function YG0($){let Z=YH,H={...YH};H.cursorFlags=$,YH=H,WM.emit("change",{prev:Z,next:H})}function WH($){let Z=YH;YH=$,WM.emit("change",{prev:Z,next:$})}var WG0=($)=>$,UM=()=>{},_i=1,ji=2,Oi=4,Ti=8,Hi=3,Ji=12,QY;function Bi(){return QY===void 0&&(QY=!1,typeof window<"u"&&(window.navigator.userAgent.includes("Chrome")||window.navigator.userAgent.includes("Firefox"))&&(QY=!0)),QY}function AG0({cursorFlags:$,groups:Z,state:H}){let J=0,B=0;switch(H){case"active":case"hover":Z.forEach((Q)=>{if(!Q.mutableState.disableCursor)switch(Q.orientation){case"horizontal":{J++;break}case"vertical":{B++;break}}})}if(!(J===0&&B===0)){switch(H){case"active":{if($&&Bi()){let Q=($&_i)!==0,z=($&ji)!==0,X=($&Oi)!==0,G=($&Ti)!==0;if(Q)return X?"se-resize":G?"ne-resize":"e-resize";if(z)return X?"sw-resize":G?"nw-resize":"w-resize";if(X)return"s-resize";if(G)return"n-resize"}break}}return Bi()?J>0&&B>0?"move":J>0?"ew-resize":"ns-resize":J>0&&B>0?"grab":J>0?"col-resize":"row-resize"}}var Qi=new WeakMap;function AM($){if($.defaultView===null||$.defaultView===void 0)return;let{prevStyle:Z,styleSheet:H}=Qi.get($)??{};H===void 0&&(H=new $.defaultView.CSSStyleSheet,$.adoptedStyleSheets&&(Object.isExtensible($.adoptedStyleSheets)?$.adoptedStyleSheets.push(H):$.adoptedStyleSheets=[...$.adoptedStyleSheets,H]));let J=H$();switch(J.state){case"active":case"hover":{let B=AG0({cursorFlags:J.cursorFlags,groups:J.hitRegions.map((z)=>z.group),state:J.state}),Q=`*, *:hover {cursor: ${B} !important; }`;if(Z===Q)return;Z=Q,B?H.cssRules.length===0?H.insertRule(Q):H.replaceSync(Q):H.cssRules.length===1&&H.deleteRule(0);break}case"inactive":{Z=void 0,H.cssRules.length===1&&H.deleteRule(0);break}}Qi.set($,{prevStyle:Z,styleSheet:H})}var x9=new Map,Ci=new YM;function NG0($){x9=new Map(x9),x9.delete($)}function zi($,Z){for(let[H]of x9)if(H.id===$)return H}function b6($,Z){for(let[H,J]of x9)if(H.id===$)return J;if(Z)throw Error(`Could not find data for Group with id ${$}`)}function Q$(){return x9}function NM($,Z){return Ci.addListener("groupChange",(H)=>{H.group.id===$&&Z(H)})}function W3($,Z,H){let J=x9.get($);x9=new Map(x9),x9.set($,Z),Ci.emit("groupChange",{group:$,isUserInteraction:H?.isUserInteraction===!0,prev:J,next:Z})}function wi($){let Z=H$(),H=!1;switch(Z.state){case"active":WH({cursorFlags:0,state:"inactive"}),Z.hitRegions.length>0&&(AM($),H=!0,Z.hitRegions.forEach((J)=>{let B=b6(J.group.id,!0);W3(J.group,B,{isUserInteraction:!0})}))}return H}function Xi($){$.defaultPrevented||wi($.currentTarget)}function VG0($,Z,H){let J,B={x:1/0,y:1/0};for(let Q of Z){let z=Mi(H,Q.rect);switch($){case"horizontal":{z.x<=B.x&&(J=Q,B=z);break}case"vertical":{z.y<=B.y&&(J=Q,B=z);break}}}return J?{distance:B,hitRegion:J}:void 0}function LG0($){return $!==null&&typeof $=="object"&&"nodeType"in $&&$.nodeType===Node.DOCUMENT_FRAGMENT_NODE}function DG0($,Z){if($===Z)throw Error("Cannot compare node with itself");let H={a:Ki($),b:Ki(Z)},J;for(;H.a.at(-1)===H.b.at(-1);)J=H.a.pop(),H.b.pop();L5(J,"Stacking order can only be calculated for elements with a common ancestor");let B={a:Ui(Gi(H.a)),b:Ui(Gi(H.b))};if(B.a===B.b){let Q=J.childNodes,z={a:H.a.at(-1),b:H.b.at(-1)},X=Q.length;for(;X--;){let G=Q[X];if(G===z.a)return 1;if(G===z.b)return-1}}return Math.sign(B.a-B.b)}var qG0=/\b(?:position|zIndex|opacity|transform|webkitTransform|mixBlendMode|filter|webkitFilter|isolation)\b/;function MG0($){let Z=getComputedStyle(Ei($)??$).display;return Z==="flex"||Z==="inline-flex"}function PG0($){let Z=getComputedStyle($);return!!(Z.position==="fixed"||Z.zIndex!=="auto"&&(Z.position!=="static"||MG0($))||+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"||qG0.test(Z.willChange)||Z.webkitOverflowScrolling==="touch")}function Gi($){let Z=$.length;for(;Z--;){let H=$[Z];if(L5(H,"Missing node"),PG0(H))return H}return null}function Ui($){return $&&Number(getComputedStyle($).zIndex)||0}function Ki($){let Z=[];for(;$;)Z.push($),$=Ei($);return Z}function Ei($){let{parentNode:Z}=$;return LG0(Z)?Z.host:Z}function _G0($,Z){return $.x<Z.x+Z.width&&$.x+$.width>Z.x&&$.y<Z.y+Z.height&&$.y+$.height>Z.y}function jG0({groupElement:$,hitRegion:Z,pointerEventTarget:H}){if(!qi(H)||H.contains($)||$.contains(H))return!0;if(DG0(H,$)>0){let J=H;for(;J;){if(J.contains($))return!0;if(_G0(J.getBoundingClientRect(),Z))return!1;J=J.parentElement}}return!0}function VM($,Z){let H=[];return Z.forEach((J,B)=>{if(B.disabled)return;let Q=Pi(B),z=VG0(B.orientation,Q,{x:$.clientX,y:$.clientY});z&&z.distance.x<=0&&z.distance.y<=0&&jG0({groupElement:B.element,hitRegion:z.hitRegion.rect,pointerEventTarget:$.target})&&H.push(z.hitRegion)}),H}function OG0($,Z){if($.length!==Z.length)return!1;for(let H=0;H<$.length;H++)if($[H]!=Z[H])return!1;return!0}function e4($,Z,H=0){return Math.abs(V2($)-V2(Z))<=H}function h9($,Z){return e4($,Z)?0:$>Z?1:-1}function FH({overrideDisabledPanels:$,panelConstraints:Z,prevSize:H,size:J}){let{collapsedSize:B=0,collapsible:Q,disabled:z,maxSize:X=100,minSize:G=0}=Z;if(z&&!$)return H;if(h9(J,G)<0)if(Q){let U=(B+G)/2;h9(J,U)<0?J=B:J=G}else J=G;return J=Math.min(X,J),J=V2(J),J}function QQ({delta:$,initialLayout:Z,panelConstraints:H,pivotIndices:J,prevLayout:B,trigger:Q}){if(e4($,0))return Z;let z=Q==="imperative-api",X=Object.values(Z),G=Object.values(B),U=[...X],[K,F]=J;L5(K!=null,"Invalid first pivot index"),L5(F!=null,"Invalid second pivot index");let Y=0;switch(Q){case"keyboard":{{let N=$<0?F:K,L=H[N];L5(L,`Panel constraints not found for index ${N}`);let{collapsedSize:V=0,collapsible:D,minSize:q=0}=L;if(D){let j=X[N];if(L5(j!=null,`Previous layout not found for panel index ${N}`),e4(j,V)){let M=q-j;h9(M,Math.abs($))>0&&($=$<0?0-M:M)}}}{let N=$<0?K:F,L=H[N];L5(L,`No panel constraints found for index ${N}`);let{collapsedSize:V=0,collapsible:D,minSize:q=0}=L;if(D){let j=X[N];if(L5(j!=null,`Previous layout not found for panel index ${N}`),e4(j,q)){let M=j-V;h9(M,Math.abs($))>0&&($=$<0?0-M:M)}}}break}default:{let N=$<0?F:K,L=H[N];L5(L,`Panel constraints not found for index ${N}`);let V=X[N],{collapsible:D,collapsedSize:q,minSize:j}=L;if(D&&h9(V,j)<0)if($>0){let M=j-q,P=M/2,T=V+$;h9(T,j)<0&&($=h9($,P)<=0?0:M)}else{let M=j-q,P=100-M/2,T=V-$;h9(T,j)<0&&($=h9(100+$,P)>0?0:-M)}break}}{let N=$<0?1:-1,L=$<0?F:K,V=0;for(;;){let q=X[L];L5(q!=null,`Previous layout not found for panel index ${L}`);let j=FH({overrideDisabledPanels:z,panelConstraints:H[L],prevSize:q,size:100})-q;if(V+=j,L+=N,L<0||L>=H.length)break}let D=Math.min(Math.abs($),Math.abs(V));$=$<0?0-D:D}{let N=$<0?K:F;for(;N>=0&&N<H.length;){let L=Math.abs($)-Math.abs(Y),V=X[N];L5(V!=null,`Previous layout not found for panel index ${N}`);let D=V-L,q=FH({overrideDisabledPanels:z,panelConstraints:H[N],prevSize:V,size:D});if(!e4(V,q)&&(Y+=V-q,U[N]=q,Y.toFixed(3).localeCompare(Math.abs($).toFixed(3),void 0,{numeric:!0})>=0))break;$<0?N--:N++}}if(OG0(G,U))return B;{let N=$<0?F:K,L=X[N];L5(L!=null,`Previous layout not found for panel index ${N}`);let V=L+Y,D=FH({overrideDisabledPanels:z,panelConstraints:H[N],prevSize:L,size:V});if(U[N]=D,!e4(D,V)){let q=V-D,j=$<0?F:K;for(;j>=0&&j<H.length;){let M=U[j];L5(M!=null,`Previous layout not found for panel index ${j}`);let P=M+q,T=FH({overrideDisabledPanels:z,panelConstraints:H[j],prevSize:M,size:P});if(e4(M,T)||(q-=T-M,U[j]=T),e4(q,0))break;$>0?j--:j++}}}let W=Object.values(U).reduce((N,L)=>L+N,0);if(!e4(W,100,0.1))return B;let A=Object.keys(B);return U.reduce((N,L,V)=>(N[A[V]]=L,N),{})}function J$($,Z){if(Object.keys($).length!==Object.keys(Z).length)return!1;for(let H in $)if(Z[H]===void 0||h9($[H],Z[H])!==0)return!1;return!0}function B$({layout:$,panelConstraints:Z}){let H=Object.values($),J=[...H],B=J.reduce((X,G)=>X+G,0);if(J.length!==Z.length)throw Error(`Invalid ${Z.length} panel layout: ${J.map((X)=>`${X}%`).join(", ")}`);if(!e4(B,100)&&J.length>0)for(let X=0;X<Z.length;X++){let G=J[X];L5(G!=null,`No layout data found for index ${X}`);let U=100/B*G;J[X]=U}let Q=0;for(let X=0;X<Z.length;X++){let G=H[X];L5(G!=null,`No layout data found for index ${X}`);let U=J[X];L5(U!=null,`No layout data found for index ${X}`);let K=FH({overrideDisabledPanels:!0,panelConstraints:Z[X],prevSize:G,size:U});U!=K&&(Q+=U-K,J[X]=K)}if(!e4(Q,0))for(let X=0;X<Z.length;X++){let G=J[X];L5(G!=null,`No layout data found for index ${X}`);let U=G+Q,K=FH({overrideDisabledPanels:!0,panelConstraints:Z[X],prevSize:G,size:U});if(G!==K&&(Q-=K-G,J[X]=K,e4(Q,0)))break}let z=Object.keys($);return J.reduce((X,G,U)=>(X[z[U]]=G,X),{})}function Si({groupId:$,panelId:Z}){let H=()=>{let G=Q$();for(let[U,{defaultLayoutDeferred:K,derivedPanelConstraints:F,layout:Y,groupSize:W,separatorToPanels:A}]of G)if(U.id===$)return{defaultLayoutDeferred:K,derivedPanelConstraints:F,group:U,groupSize:W,layout:Y,separatorToPanels:A};throw Error(`Group ${$} not found`)},J=()=>{let G=H().derivedPanelConstraints.find((U)=>U.panelId===Z);if(G!==void 0)return G;throw Error(`Panel constraints not found for Panel ${Z}`)},B=()=>{let G=H().group.panels.find((U)=>U.id===Z);if(G!==void 0)return G;throw Error(`Layout not found for Panel ${Z}`)},Q=()=>{let G=H().layout[Z];if(G!==void 0)return G;throw Error(`Layout not found for Panel ${Z}`)},z=({nextSize:G,panels:U,prevLayout:K,derivedPanelConstraints:F})=>{let Y=Q(),W=U.findIndex((L)=>L.id===Z),A=W===0,N=W===U.length-1;if(N&&G<Y&&(A||U.slice(0,W).every((L,V)=>{let D=F[V];return D?.collapsible&&e4(D.collapsedSize,K[D.panelId])}))){let L=U.slice(0,W).reduce((V,D)=>V+K[D.id],0);return{...K,[Z]:V2(100-L)}}return QQ({delta:N?Y-G:G-Y,initialLayout:K,panelConstraints:F,pivotIndices:N?[W-1,W]:[W,W+1],prevLayout:K,trigger:"imperative-api"})},X=(G)=>{let U=Q();if(G===U)return;let{defaultLayoutDeferred:K,derivedPanelConstraints:F,group:Y,groupSize:W,layout:A,separatorToPanels:N}=H(),L=z({nextSize:G,panels:Y.panels,prevLayout:A,derivedPanelConstraints:F}),V=B$({layout:L,panelConstraints:F});J$(A,V)||W3(Y,{defaultLayoutDeferred:K,derivedPanelConstraints:F,groupSize:W,layout:V,separatorToPanels:N})};return{collapse:()=>{let{collapsible:G,collapsedSize:U}=J(),{mutableValues:K}=B(),F=Q();G&&F!==U&&(K.expandToSize=F,X(U))},expand:()=>{let{collapsible:G,collapsedSize:U,minSize:K}=J(),{mutableValues:F}=B(),Y=Q();if(G&&Y===U){let W=F.expandToSize??K;W===0&&(W=1),X(W)}},getSize:()=>{let{group:G}=H(),U=Q(),{element:K}=B(),F=G.orientation==="horizontal"?K.offsetWidth:K.offsetHeight;return{asPercentage:U,inPixels:F}},isCollapsed:()=>{let{collapsible:G,collapsedSize:U}=J(),K=Q();return G&&e4(U,K)},resize:(G)=>{let{group:U}=H(),{element:K}=B(),F=NH({group:U}),Y=JQ({groupSize:F,panelElement:K,styleProp:G}),W=V2(Y/F*100);X(W)}}}function Fi($){if($.defaultPrevented)return;let Z=Q$();VM($,Z).forEach((H)=>{if(H.separator&&!H.separator.disableDoubleClick){let J=H.panels.find((B)=>B.panelConstraints.defaultSize!==void 0);if(J){let B=J.panelConstraints.defaultSize,Q=Si({groupId:H.group.id,panelId:J.id});Q&&B!==void 0&&(Q.resize(B),$.preventDefault())}}})}function zY($){let Z=Q$();for(let[H]of Z)if(H.separators.some((J)=>J.element===$))return H;throw Error("Could not find parent Group for separator element")}function Ii({groupId:$}){let Z=()=>{let H=Q$();for(let[J,B]of H)if(J.id===$)return{group:J,...B};throw Error(`Could not find Group with id "${$}"`)};return{getLayout(){let{defaultLayoutDeferred:H,layout:J}=Z();return H?{}:J},setLayout(H){let{defaultLayoutDeferred:J,derivedPanelConstraints:B,group:Q,groupSize:z,layout:X,separatorToPanels:G}=Z(),U=B$({layout:H,panelConstraints:B});return J?X:(J$(X,U)||W3(Q,{defaultLayoutDeferred:J,derivedPanelConstraints:B,groupSize:z,layout:U,separatorToPanels:G}),U)}}}function Z$($,Z){let H=zY($),J=b6(H.id,!0),B=H.separators.find((K)=>K.element===$);L5(B,"Matching separator not found");let Q=J.separatorToPanels.get(B);L5(Q,"Matching panels not found");let z=Q.map((K)=>H.panels.indexOf(K)),X=Ii({groupId:H.id}).getLayout(),G=QQ({delta:Z,initialLayout:X,panelConstraints:J.derivedPanelConstraints,pivotIndices:z,prevLayout:X,trigger:"keyboard"}),U=B$({layout:G,panelConstraints:J.derivedPanelConstraints});J$(X,U)||W3(H,{defaultLayoutDeferred:J.defaultLayoutDeferred,derivedPanelConstraints:J.derivedPanelConstraints,groupSize:J.groupSize,layout:U,separatorToPanels:J.separatorToPanels},{isUserInteraction:!0})}function Yi($){if($.defaultPrevented)return;let Z=$.currentTarget,H=zY(Z);if(!H.disabled)switch($.key){case"ArrowDown":{$.preventDefault(),H.orientation==="vertical"&&Z$(Z,5);break}case"ArrowLeft":{$.preventDefault(),H.orientation==="horizontal"&&Z$(Z,-5);break}case"ArrowRight":{$.preventDefault(),H.orientation==="horizontal"&&Z$(Z,5);break}case"ArrowUp":{$.preventDefault(),H.orientation==="vertical"&&Z$(Z,-5);break}case"End":{$.preventDefault(),Z$(Z,100);break}case"Enter":{$.preventDefault();let J=zY(Z),B=b6(J.id,!0),{derivedPanelConstraints:Q,layout:z,separatorToPanels:X}=B,G=J.separators.find((Y)=>Y.element===Z);L5(G,"Matching separator not found");let U=X.get(G);L5(U,"Matching panels not found");let K=U[0],F=Q.find((Y)=>Y.panelId===K.id);if(L5(F,"Panel metadata not found"),F.collapsible){let Y=z[K.id],W=F.collapsedSize===Y?J.mutableState.expandedPanelSizes[K.id]??F.minSize:F.collapsedSize;Z$(Z,W-Y)}break}case"F6":{$.preventDefault();let J=zY(Z).separators.map((z)=>z.element),B=Array.from(J).findIndex((z)=>z===$.currentTarget);L5(B!==null,"Index not found");let Q=$.shiftKey?B>0?B-1:J.length-1:B+1<J.length?B+1:0;J[Q].focus({preventScroll:!0});break}case"Home":{$.preventDefault(),Z$(Z,-100);break}}}function Wi($){if($.defaultPrevented)return;if($.pointerType==="mouse"&&$.button>0)return;let Z=Q$(),H=VM($,Z),J=new Map,B=!1;H.forEach((Q)=>{Q.separator&&(B||(B=!0,Q.separator.element.focus({focusVisible:!1,preventScroll:!0})));let z=Z.get(Q.group);z&&J.set(Q.group,z.layout)}),WH({cursorFlags:0,hitRegions:H,initialLayoutMap:J,pointerDownAtPoint:{x:$.clientX,y:$.clientY},state:"active"}),H.length&&$.preventDefault()}function ki({document:$,event:Z,hitRegions:H,initialLayoutMap:J,mountedGroups:B,pointerDownAtPoint:Q,prevCursorFlags:z}){let X=0;H.forEach((U)=>{let{group:K,groupSize:F}=U,{orientation:Y,panels:W}=K,{disableCursor:A}=K.mutableState,N=0;Q?Y==="horizontal"?N=(Z.clientX-Q.x)/F*100:N=(Z.clientY-Q.y)/F*100:Y==="horizontal"?N=Z.clientX<0?-100:100:N=Z.clientY<0?-100:100;let L=J.get(K),V=B.get(K);if(!L||!V)return;let{defaultLayoutDeferred:D,derivedPanelConstraints:q,groupSize:j,layout:M,separatorToPanels:P}=V;if(q&&M&&P){let T=QQ({delta:N,initialLayout:L,panelConstraints:q,pivotIndices:U.panels.map((C)=>W.indexOf(C)),prevLayout:M,trigger:"mouse-or-touch"});if(J$(T,M)){if(N!==0&&!A)switch(Y){case"horizontal":{X|=N<0?_i:ji;break}case"vertical":{X|=N<0?Oi:Ti;break}}}else W3(U.group,{defaultLayoutDeferred:D,derivedPanelConstraints:q,groupSize:j,layout:T,separatorToPanels:P})}});let G=0;Z.movementX===0?G|=z&Hi:G|=X&Hi,Z.movementY===0?G|=z&Ji:G|=X&Ji,YG0(G),AM($)}function Ai($){let Z=Q$(),H=H$();switch(H.state){case"active":ki({document:$.currentTarget,event:$,hitRegions:H.hitRegions,initialLayoutMap:H.initialLayoutMap,mountedGroups:Z,prevCursorFlags:H.cursorFlags})}}function Ni($){if($.defaultPrevented)return;let Z=H$(),H=Q$();switch(Z.state){case"active":{if($.buttons===0){WH({cursorFlags:0,state:"inactive"}),Z.hitRegions.forEach((J)=>{let B=b6(J.group.id,!0);W3(J.group,B,{isUserInteraction:!0})});return}for(let J of Z.hitRegions)if(J.separator){let{element:B}=J.separator;B.hasPointerCapture?.($.pointerId)||B.setPointerCapture?.($.pointerId)}ki({document:$.currentTarget,event:$,hitRegions:Z.hitRegions,initialLayoutMap:Z.initialLayoutMap,mountedGroups:H,pointerDownAtPoint:Z.pointerDownAtPoint,prevCursorFlags:Z.cursorFlags});break}default:{let J=VM($,H);J.length===0?Z.state!=="inactive"&&WH({cursorFlags:0,state:"inactive"}):WH({cursorFlags:0,hitRegions:J,state:"hover"}),AM($.currentTarget);break}}}function Vi($){if($.relatedTarget instanceof HTMLIFrameElement)switch(H$().state){case"hover":WH({cursorFlags:0,state:"inactive"})}}function Li($){if($.defaultPrevented)return;if($.pointerType==="mouse"&&$.button>0)return;wi($.currentTarget)&&$.preventDefault()}function Di($){let Z=0,H=0,J={};for(let Q of $)if(Q.defaultSize!==void 0){Z++;let z=V2(Q.defaultSize);H+=z,J[Q.panelId]=z}else J[Q.panelId]=void 0;let B=$.length-Z;if(B!==0){let Q=V2((100-H)/B);for(let z of $)z.defaultSize===void 0&&(J[z.panelId]=Q)}return J}function TG0($,Z,H){if(!H[0])return;let J=$.panels.find((G)=>G.element===Z);if(!J||!J.onResize)return;let B=NH({group:$}),Q=$.orientation==="horizontal"?J.element.offsetWidth:J.element.offsetHeight,z=J.mutableValues.prevSize,X={asPercentage:V2(Q/B*100),inPixels:Q};J.mutableValues.prevSize=X,J.onResize(X,J.id,z)}function CG0($,Z){if(Object.keys($).length!==Object.keys(Z).length)return!1;for(let H in $)if($[H]!==Z[H])return!1;return!0}function wG0({group:$,nextGroupSize:Z,prevGroupSize:H,prevLayout:J}){if(H<=0||Z<=0||H===Z)return J;let B=0,Q=0,z=!1,X=new Map,G=[];for(let F of $.panels){let Y=J[F.id]??0;switch(F.panelConstraints.groupResizeBehavior){case"preserve-pixel-size":{z=!0;let W=Y/100*H,A=V2(W/Z*100);X.set(F.id,A),B+=A;break}case"preserve-relative-size":default:{G.push(F.id),Q+=Y;break}}}if(!z||G.length===0)return J;let U=100-B,K={...J};if(X.forEach((F,Y)=>{K[Y]=F}),Q>0)for(let F of G){let Y=J[F]??0;K[F]=V2(Y/Q*U)}else{let F=V2(U/G.length);for(let Y of G)K[Y]=F}return K}function EG0($,Z){let H=$.map((B)=>B.id),J=Object.keys(Z);if(H.length!==J.length)return!1;for(let B of H)if(!J.includes(B))return!1;return!0}var KH=new Map;function SG0($){let Z=!0;L5($.element.ownerDocument.defaultView,"Cannot register an unmounted Group");let H=$.element.ownerDocument.defaultView.ResizeObserver,J=new Set,B=new Set,Q=new H((A)=>{for(let N of A){let{borderBoxSize:L,target:V}=N;if(V===$.element){if(Z){let D=NH({group:$});if(D===0)return;let q=b6($.id);if(!q)return;let j=KM($),M=q.defaultLayoutDeferred?Di(j):q.layout,P=wG0({group:$,nextGroupSize:D,prevGroupSize:q.groupSize,prevLayout:M}),T=B$({layout:P,panelConstraints:j});if(!q.defaultLayoutDeferred&&J$(q.layout,T)&&CG0(q.derivedPanelConstraints,j)&&q.groupSize===D)return;W3($,{defaultLayoutDeferred:!1,derivedPanelConstraints:j,groupSize:D,layout:T,separatorToPanels:q.separatorToPanels})}}else TG0($,V,L)}});Q.observe($.element),$.panels.forEach((A)=>{L5(!J.has(A.id),`Panel ids must be unique; id "${A.id}" was used more than once`),J.add(A.id),A.onResize&&Q.observe(A.element)});let z=NH({group:$}),X=KM($),G=$.panels.map(({id:A})=>A).join(","),U=$.mutableState.defaultLayout;U&&(EG0($.panels,U)||(U=void 0));let K=$.mutableState.layouts[G]??U??Di(X),F=B$({layout:K,panelConstraints:X}),Y=$.element.ownerDocument;KH.set(Y,(KH.get(Y)??0)+1);let W=new Map;return Pi($).forEach((A)=>{A.separator&&W.set(A.separator,A.panels)}),W3($,{defaultLayoutDeferred:z===0,derivedPanelConstraints:X,groupSize:z,layout:F,separatorToPanels:W}),$.separators.forEach((A)=>{L5(!B.has(A.id),`Separator ids must be unique; id "${A.id}" was used more than once`),B.add(A.id),A.element.addEventListener("keydown",Yi)}),KH.get(Y)===1&&(Y.addEventListener("contextmenu",Xi,!0),Y.addEventListener("dblclick",Fi,!0),Y.addEventListener("pointerdown",Wi,!0),Y.addEventListener("pointerleave",Ai),Y.addEventListener("pointermove",Ni),Y.addEventListener("pointerout",Vi),Y.addEventListener("pointerup",Li,!0)),function(){Z=!1,KH.set(Y,Math.max(0,(KH.get(Y)??0)-1)),NG0($),$.separators.forEach((A)=>{A.element.removeEventListener("keydown",Yi)}),KH.get(Y)||(Y.removeEventListener("contextmenu",Xi,!0),Y.removeEventListener("dblclick",Fi,!0),Y.removeEventListener("pointerdown",Wi,!0),Y.removeEventListener("pointerleave",Ai),Y.removeEventListener("pointermove",Ni),Y.removeEventListener("pointerout",Vi),Y.removeEventListener("pointerup",Li,!0)),Q.disconnect()}}function IG0(){let[$,Z]=w1.useState({}),H=w1.useCallback(()=>Z({}),[]);return[$,H]}function LM($){let Z=w1.useId();return`${$??Z}`}var z$=typeof window<"u"?w1.useLayoutEffect:w1.useEffect;function BQ($){let Z=w1.useRef($);return z$(()=>{Z.current=$},[$]),w1.useCallback((...H)=>Z.current?.(...H),[Z])}function DM(...$){return BQ((Z)=>{$.forEach((H)=>{if(H)switch(typeof H){case"function":{H(Z);break}case"object":{H.current=Z;break}}})})}function qM($){let Z=w1.useRef({...$});return z$(()=>{for(let H in $)Z.current[H]=$[H]},[$]),Z.current}var Ri=w1.createContext(null);function kG0($,Z){let H=w1.useRef({getLayout:()=>({}),setLayout:WG0});w1.useImperativeHandle(Z,()=>H.current,[]),z$(()=>{Object.assign(H.current,Ii({groupId:$}))})}function MM({children:$,className:Z,defaultLayout:H,disableCursor:J,disabled:B,elementRef:Q,groupRef:z,id:X,onLayoutChange:G,onLayoutChanged:U,orientation:K="horizontal",resizeTargetMinimumSize:F={coarse:20,fine:10},style:Y,...W}){let A=w1.useRef({onLayoutChange:{},onLayoutChanged:{}}),N=BQ((h)=>{J$(A.current.onLayoutChange,h)||(A.current.onLayoutChange=h,G?.(h))}),L=BQ((h,x)=>{J$(A.current.onLayoutChanged,h)||(A.current.onLayoutChanged=h,U?.(h,{isUserInteraction:x}))}),V=LM(X),D=w1.useRef(null),[q,j]=IG0(),M=w1.useRef({lastExpandedPanelSizes:{},layouts:{},panels:[],resizeTargetMinimumSize:F,separators:[]}),P=DM(D,Q);kG0(V,z);let T=BQ((h,x)=>{let R=H$(),w=zi(h),S=b6(h);if(S){let I=!1;switch(R.state){case"active":{I=R.hitRegions.some((y)=>y.group===w);break}}return{flexGrow:S.layout[x]??1,pointerEvents:I?"none":void 0}}if(H?.[x])return{flexGrow:H?.[x]}}),C=qM({defaultLayout:H,disableCursor:J}),k=w1.useMemo(()=>({get disableCursor(){return!!C.disableCursor},getPanelStyles:T,id:V,orientation:K,registerPanel:(h)=>{let x=M.current;return x.panels=FM(K,[...x.panels,h]),j(),()=>{x.panels=x.panels.filter((R)=>R!==h),j()}},registerSeparator:(h)=>{let x=M.current;return x.separators=FM(K,[...x.separators,h]),j(),()=>{x.separators=x.separators.filter((R)=>R!==h),j()}},updatePanelProps:(h,{disabled:x})=>{let R=M.current.panels.find((I)=>I.id===h);R&&(R.panelConstraints.disabled=x);let w=zi(V),S=b6(V);w&&S&&W3(w,{...S,derivedPanelConstraints:KM(w)})},updateSeparatorProps:(h,{disabled:x,disableDoubleClick:R})=>{let w=M.current.separators.find((S)=>S.id===h);w&&(w.disabled=x,w.disableDoubleClick=R)}}),[T,V,j,K,C]),E=w1.useRef(null);return z$(()=>{let h=D.current;if(h===null)return;let x=M.current,R;if(C.defaultLayout!==void 0&&Object.keys(C.defaultLayout).length===x.panels.length){R={};for(let O of x.panels){let c=C.defaultLayout[O.id];c!==void 0&&(R[O.id]=c)}}let w={disabled:!!B,element:h,id:V,mutableState:{defaultLayout:R,disableCursor:!!C.disableCursor,expandedPanelSizes:M.current.lastExpandedPanelSizes,layouts:M.current.layouts},orientation:K,panels:x.panels,resizeTargetMinimumSize:x.resizeTargetMinimumSize,separators:x.separators};E.current=w;let S=SG0(w),{defaultLayoutDeferred:I,derivedPanelConstraints:y,layout:f}=b6(w.id,!0);!I&&y.length>0&&(N(f),L(f,!1));let g=NM(V,(O)=>{let{defaultLayoutDeferred:c,derivedPanelConstraints:o,layout:b}=O.next;if(c||o.length===0)return;let d=w.panels.map(({id:u})=>u).join(",");w.mutableState.layouts[d]=b,o.forEach((u)=>{if(u.collapsible){let{layout:a}=O.prev??{};if(a){let n=e4(u.collapsedSize,b[u.panelId]),Q0=e4(u.collapsedSize,a[u.panelId]);n&&!Q0&&(w.mutableState.expandedPanelSizes[u.panelId]=a[u.panelId])}}});let t=H$().state!=="active";N(b),t&&L(b,O.isUserInteraction)});return()=>{E.current=null,S(),g()}},[B,V,L,N,K,q,C]),w1.useEffect(()=>{let h=E.current;h&&(h.mutableState.defaultLayout=H,h.mutableState.disableCursor=!!J)}),AH.jsx(Ri.Provider,{value:k,children:AH.jsx("div",{...W,className:Z,"data-group":!0,"data-testid":V,id:V,ref:P,style:{height:"100%",width:"100%",overflow:"hidden",...Y,display:"flex",flexDirection:K==="horizontal"?"row":"column",flexWrap:"nowrap",touchAction:K==="horizontal"?"pan-y":"pan-x"},children:$})})}MM.displayName="Group";function PM(){let $=w1.useContext(Ri);return L5($,"Group Context not found; did you render a Panel or Separator outside of a Group?"),$}function RG0($,Z){let{id:H}=PM(),J=w1.useRef({collapse:UM,expand:UM,getSize:()=>({asPercentage:0,inPixels:0}),isCollapsed:()=>!1,resize:UM});w1.useImperativeHandle(Z,()=>J.current,[]),z$(()=>{Object.assign(J.current,Si({groupId:H,panelId:$}))})}function _M({children:$,className:Z,collapsedSize:H="0%",collapsible:J=!1,defaultSize:B,disabled:Q,elementRef:z,groupResizeBehavior:X="preserve-relative-size",id:G,maxSize:U="100%",minSize:K="0%",onResize:F,panelRef:Y,style:W,...A}){let N=!!G,L=LM(G),V=qM({disabled:Q}),D=w1.useRef(null),q=DM(D,z),{getPanelStyles:j,id:M,orientation:P,registerPanel:T,updatePanelProps:C}=PM(),k=F!==null,E=BQ((w,S,I)=>{F?.(w,G,I)});z$(()=>{let w=D.current;if(w!==null){let S={element:w,id:L,idIsStable:N,mutableValues:{expandToSize:void 0,prevSize:void 0},onResize:k?E:void 0,panelConstraints:{groupResizeBehavior:X,collapsedSize:H,collapsible:J,defaultSize:B,disabled:V.disabled,maxSize:U,minSize:K}};return T(S)}},[X,H,J,B,k,L,N,U,K,E,T,V]),w1.useEffect(()=>{C(L,{disabled:Q})},[Q,L,C]),RG0(L,Y);let h=()=>{let w=j(M,L);if(w)return JSON.stringify(w)},x=w1.useSyncExternalStore((w)=>NM(M,w),h,h),R;return x?R=JSON.parse(x):B!==void 0?R={flexGrow:void 0,flexShrink:void 0,flexBasis:B}:R={flexGrow:1},AH.jsx("div",{...A,"data-disabled":Q||void 0,"data-panel":!0,"data-testid":L,id:L,ref:q,style:{...bG0,display:"flex",flexBasis:0,flexShrink:1,overflow:"visible",...R},children:AH.jsx("div",{className:Z,style:{maxHeight:"100%",maxWidth:"100%",flexGrow:1,overflow:"auto",...W,touchAction:P==="horizontal"?"pan-y":"pan-x"},children:$})})}_M.displayName="Panel";var bG0={minHeight:0,maxHeight:"100%",height:"auto",minWidth:0,maxWidth:"100%",width:"auto",border:"none",borderWidth:0,padding:0,margin:0};function yG0({layout:$,panelConstraints:Z,panelId:H,panelIndex:J}){let B,Q,z=$[H],X=Z.find((G)=>G.panelId===H);if(X){let G=X.maxSize,U=X.collapsible?X.collapsedSize:X.minSize,K=[J,J+1];Q=B$({layout:QQ({delta:U-z,initialLayout:$,panelConstraints:Z,pivotIndices:K,prevLayout:$}),panelConstraints:Z})[H],B=B$({layout:QQ({delta:G-z,initialLayout:$,panelConstraints:Z,pivotIndices:K,prevLayout:$}),panelConstraints:Z})[H]}return{valueControls:H,valueMax:B,valueMin:Q,valueNow:z}}function jM({children:$,className:Z,disabled:H,disableDoubleClick:J,elementRef:B,id:Q,style:z,...X}){let G=LM(Q),U=qM({disabled:H,disableDoubleClick:J}),[K,F]=w1.useState({}),[Y,W]=w1.useState("inactive"),[A,N]=w1.useState(!1),L=w1.useRef(null),V=DM(L,B),{disableCursor:D,id:q,orientation:j,registerSeparator:M,updateSeparatorProps:P}=PM(),T=j==="horizontal"?"vertical":"horizontal";z$(()=>{let E=L.current;if(E!==null){let h={disabled:U.disabled,disableDoubleClick:U.disableDoubleClick,element:E,id:G},x=M(h),R=FG0((S)=>{W(S.next.state!=="inactive"&&S.next.hitRegions.some((I)=>I.separator===h)?S.next.state:"inactive")}),w=NM(q,(S)=>{let{derivedPanelConstraints:I,layout:y,separatorToPanels:f}=S.next,g=f.get(h);if(g){let O=g[0],c=g.indexOf(O);F(yG0({layout:y,panelConstraints:I,panelId:O.id,panelIndex:c}))}});return()=>{R(),w(),x()}}},[q,G,M,U]),w1.useEffect(()=>{P(G,{disabled:H,disableDoubleClick:J})},[H,J,G,P]);let C;H&&!D&&(C="not-allowed");let k;if(H)k="disabled";else switch(Y){case"active":{k="active";break}default:A?k="focus":k=Y}return AH.jsx("div",{...X,"aria-controls":K.valueControls,"aria-disabled":H||void 0,"aria-orientation":T,"aria-valuemax":K.valueMax,"aria-valuemin":K.valueMin,"aria-valuenow":K.valueNow,children:$,className:Z,"data-separator":k,"data-testid":G,id:G,onBlur:()=>N(!1),onFocus:()=>N(!0),ref:V,role:"separator",style:{flexBasis:"auto",cursor:C,...z,flexGrow:0,flexShrink:0,touchAction:"none"},tabIndex:H?void 0:0})}jM.displayName="Separator";var XY=_(r(),1);function bi({className:$,...Z}){return XY.jsx(MM,{"data-slot":"resizable-panel-group",className:d1("flex h-full w-full aria-[orientation=vertical]:flex-col",$),...Z})}function OM({...$}){return XY.jsx(_M,{"data-slot":"resizable-panel",...$})}function yi({showDivider:$=!0,className:Z,...H}){return XY.jsx(jM,{"data-slot":"resizable-handle",className:d1("relative flex 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]: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",$?"w-px bg-border aria-[orientation=horizontal]:h-px":"w-0 aria-[orientation=horizontal]:h-0",Z),...H})}var y6=_(r(),1);function hi({workspace:$,chat:Z,open:H,workspaceMinWidth:J,chatMinWidth:B,chatMaxWidth:Q,chatWidth:z,onCollapse:X,onChatWidthChange:G}){let U=h6.useRef(null),K=h6.useRef(null),[F,Y]=h6.useState(!1),W=Math.min(Math.max(z,B),Q),A=h6.useRef(H?W:0).current;return h6.useLayoutEffect(()=>{let N=U.current;if(!N)return;if(H)N.resize(W);else N.collapse()},[W,H]),y6.jsxs(bi,{orientation:"horizontal",className:z0("overflow-visible!",F&&"[&>#chat]:transition-[flex-grow] [&>#chat]:duration-200 [&>#chat]:ease-in-out motion-reduce:[&>#chat]:transition-none!",F&&"has-[[data-separator=active]]:[&>#chat]:transition-none!"),onLayoutChanged:(N,L)=>{if(!F&&K.current===null)K.current=requestAnimationFrame(()=>{Y(!0)});if(L.isUserInteraction)requestAnimationFrame(()=>{let V=U.current;if(!V)return;let D=V.getSize();if(D.inPixels>0)G(Math.round(D.inPixels))})},children:[y6.jsx(OM,{id:"workspace",className:"overflow-visible!",minSize:J,children:y6.jsx("div",{"data-slot":"workspace-split-workspace",className:"flex h-full min-h-0 min-w-0 flex-col",children:$})}),y6.jsx(yi,{"aria-label":"Resize chat",showDivider:!1,hidden:!H,disabled:!H}),y6.jsx(OM,{id:"chat","aria-hidden":!H,inert:!H,collapsible:!0,collapsedSize:0,defaultSize:A,minSize:B,maxSize:Q,groupResizeBehavior:"preserve-pixel-size",panelRef:U,onResize:(N,L,V)=>{if(H&&N.inPixels===0&&V&&V.inPixels>0)X()},className:z0("overflow-hidden!",F&&"transition-opacity duration-200 ease-in-out motion-reduce:transition-none",H?"opacity-100":"opacity-0"),children:y6.jsx("div",{"data-slot":"workspace-split-chat",className:"flex h-full min-h-0 min-w-(--chat-min) flex-col",children:Z})})]})}var j1=_(r(),1),xG0=L2.lazy(()=>import("/chunk-w482ew2c.js").then(($)=>({default:$.Scratchpad}))),fi=($)=>$.config.title||$.id,mi=($)=>lF($.icon)??ZB;function ui($,Z){let H=Z.find((J)=>J.viewId===$.id);return lF($.config.icon)??lF(H?.icon)??ZB}function vG0({onToggleMode:$}){return j1.jsxs(l1,{children:[j1.jsx(i1,{render:j1.jsx(E0,{variant:"ghost",size:"icon-sm",onClick:$,"aria-label":"Dock agent",children:j1.jsx(vi,{stroke:1.75})})}),j1.jsx(r1,{children:"Dock agent"})]})}function gG0({active:$,onToggle:Z}){return j1.jsxs(l1,{children:[j1.jsx(i1,{render:j1.jsx(E0,{variant:"ghost",size:"icon-sm","aria-label":"Customize","aria-pressed":$,onClick:Z,className:z0($&&"bg-accent"),children:j1.jsx(gi,{stroke:1.75})})}),j1.jsx(r1,{children:"Customize"})]})}function fG0($,Z,H,J,B,Q){if($==="agent")return{key:$,Icon:TM,label:"Agent",closable:J,loading:B};if($==="widgets")return{key:$,Icon:HB,label:"Widgets",closable:J};if($==="scratchpad")return{key:$,Icon:JB,label:"Scratchpad",closable:J};let z=w7($),X=z?H.find((K)=>K.id===z):null;if(X)return{key:$,Icon:mi(X),label:X.title||X.viewId||"New view",closable:J,loading:Q(X.sessionId)};let G=t3($),U=G?Z.find((K)=>K.id===G):null;return U?{key:$,Icon:ui(U,H),label:fi(U),closable:J}:null}function mG0($,Z,H){let J=new Set(Z),B=0;return $.map((Q)=>J.has(Q)?H[B++]:Q)}function pi({widgets:$,views:Z,builders:H}){let{layout:J,setLayout:B,name:Q,icon:z,provider:X,workspaceId:G}=P5(),U=b8(J.theme),K=xl(),{ref:F,fits:Y,constraints:W}=gl(),[A,N]=L2.useState("idle"),[L,V]=L2.useState(!1),[D,q]=L2.useState(0),j=L2.useRef(new Map),M=S5((q0)=>q0.dockedChatWidth),P=S5((q0)=>q0.setDockedChatWidth),T=w4((q0)=>q0.activity),C=mz(T,G),k=vl({builders:H,onSave:(q0,V0)=>K.save(q0,V0)});_I(J.theme);let E=JY(HY(J.tabs),Z,H),h=E.filter((q0)=>q0!=="agent"),x=h.length>0,R=$.length>0||Z.length>0,S=J.layoutMode==="split"&&x&&Y?"split":"fullscreen",I=S==="split",{tabsState:y,activeTab:f,appletParams:g,navigateToTab:O,setTabs:c}=tl({views:Z,builders:H,split:I}),{view:o,chatLoaded:b,previewTurn:d,sessionId:t,processing:u,error:a,loadError:n,retryLoad:Q0,send:Z0,stop:U0,selectSession:B0,dismissError:Y0}=Cl({activeTab:f,appletParams:g}),{composerBanner:A0,builderComposerBanner:D0,agentAvailability:X0}=nl(G,{chatError:a,onDismissChatError:Y0,chatLoadError:n,onRetryChatLoad:Q0}),i=new Set(y.open),l=(q0)=>{B({layoutMode:q0})},e=I?h:E,$0=E.length>1,H0=e.map((q0)=>fG0(q0,Z,H,$0||w7(q0)!==null,C,(V0)=>nH(T,G,V0))).filter((q0)=>Boolean(q0)),O0=t3(f),P0=O0?Z.find((q0)=>q0.id===O0):void 0,N0=w7(f),M0=N0?H.find((q0)=>q0.id===N0):void 0,v=M0?.status==="draft"&&!nH(T,G,M0.sessionId)?M0:void 0,m=v?.id,s=A==="idle"&&(f==="widgets"&&$.length>0||P0!==void 0),G0=Nk({workspaceId:G,sessionId:t,activeTab:f,mode:S,available:s,closePopup:()=>V(!1),openPopup:()=>V(!0)});L2.useEffect(()=>{if(y.open.filter((I0)=>HQ(I0,Z,H)).length===y.open.length)return;let V0=JY(y,Z,H);B({tabs:{open:V0,active:V0.includes(y.active)?y.active:V0[0]}})},[H,B,y,Z]),L2.useEffect(()=>{let q0=new Map;for(let Z1 of H){if(Z1.status!=="ready"||!Z1.viewId)continue;if(!Z.some((k1)=>k1.id===Z1.viewId))continue;q0.set(e3(Z1.id),xG(Z1.viewId))}if(q0.size===0)return;let V0=q0.get(f);if(V0)O(V0);let I0=new Set(q0.values()),c0=new Map([...q0].map(([Z1,k1])=>[k1,Z1])),d0=[],B1=!1;for(let Z1 of y.open){let k1=c0.get(Z1);if(I0.has(Z1)&&k1&&y.open.includes(k1)){B1=!0;continue}let h0=q0.get(Z1),H1=h0??Z1;if(h0)B1=!0;if(!d0.includes(H1))d0.push(H1)}if(!B1)return;let Y1=q0.get(y.active)??y.active;B({tabs:{open:d0.length>0?d0:["agent"],active:Y1}})},[f,H,O,B,y,Z]),L2.useEffect(()=>{if(S!=="fullscreen"||f==="agent")V(!1)},[f,S]),L2.useEffect(()=>{if(!m)return;if(S==="fullscreen")V(!0);q((q0)=>q0+1)},[m,S]);let j0=(q0,V0)=>{if(O(q0,V0),q0==="agent")V(!1),q((I0)=>I0+1)},m0=(q0)=>{if(q0==="views"){let V0=Z[0];if(V0)j0(xG(V0.id));else K.create().then((I0)=>j0(e3(I0.id)))}else j0(q0);V(!1)};uG(G,"focusTab",j0),H4((q0)=>{if(q0.type==="tab:focus"&&q0.workspaceId===G)j0(q0.tab,q0.params)});let v0=(q0)=>{let V0=w7(q0),I0=V0?H.find((Z1)=>Z1.id===V0):void 0;if(!$0&&!I0||!i.has(q0))return;let c0=y.open.filter((Z1)=>Z1!==q0);if(c0.length===0)c0=["agent"];let d0=e.indexOf(q0),B1=e[d0+1]??e[d0-1]??c0.find((Z1)=>HQ(Z1,Z,H))??"agent",Y1=y.active===q0||!c0.includes(y.active)?B1:y.active;if(c({open:c0,active:Y1}),f===q0)O(B1);if(I0?.status==="draft")j.current.get(I0.id)?.resetSketch(),k.clear(I0.id),K.discard(I0.id)},T0=(q0)=>{let V0=e3(q0.id);if(i.has(V0)){let I0=y.open.filter((c0)=>c0!==V0);if(I0.length===0)I0=["agent"];if(c({open:I0,active:y.active===V0?I0[0]:y.active}),f===V0)O(I0[0])}j.current.get(q0.id)?.resetSketch(),k.clear(q0.id),K.discard(q0.id)},p0=(q0)=>{let V0=mG0(y.open,e,q0);if(V0===y.open)return;c({open:V0,active:y.active})},$1=(q0)=>{if(q0!==void 0)S5.getState().setComposerDraft(G,q0);if(S==="fullscreen"&&f!=="agent"){if(V(!0),L)q((V0)=>V0+1);return}q((V0)=>V0+1)};Al({send:Z0,revealChat:$1,agentAvailability:X0});let D1=[...!I&&!i.has("agent")?[{key:"agent",Icon:TM,label:"Agent",onClick:()=>j0("agent")}]:[],...!i.has("widgets")?[{key:"widgets",Icon:HB,label:"Widgets",onClick:()=>j0("widgets")}]:[],...!i.has("scratchpad")?[{key:"scratchpad",Icon:JB,label:"Scratchpad",onClick:()=>j0("scratchpad")}]:[],...Z.map((q0)=>({view:q0,tab:xG(q0.id)})).filter(({tab:q0})=>!i.has(q0)).map(({view:q0,tab:V0})=>({key:V0,Icon:ui(q0,H),label:fi(q0),onClick:()=>j0(V0)})),...H.filter((q0)=>q0.status!=="ready").map((q0)=>({builder:q0,tab:e3(q0.id)})).filter(({tab:q0})=>!i.has(q0)).map(({builder:q0,tab:V0})=>({key:V0,Icon:mi(q0),label:q0.title||q0.viewId||"New view",onClick:()=>j0(V0)})),{key:"create-view",Icon:xi,label:"New view",onClick:()=>{K.create().then((q0)=>j0(e3(q0.id)))}}],u0=v?{sessionId:v.sessionId,builderId:v.id,initialValue:v.input.requirements,onChange:(q0)=>k.change(v.id,q0),onRemoveDrawing:()=>{j.current.get(v.id)?.resetSketch()},onSubmit:async(q0)=>{await j.current.get(v.id)?.prepareSketchForSend(),await K.submit(v,q0),k.clear(v.id)}}:void 0,N1=j1.jsx(WF,{agent:U.agent,active:S==="split",focusRequest:D,chatLoaded:b,hasWorkspaceApplets:R,view:o,previewTurn:d,sessionId:t,processing:u,composerBanner:u0?D0:A0,agentAvailability:X0,send:Z0,stop:U0,onNavigateFromWelcome:m0,onClose:()=>l("fullscreen"),annotation:G0.docked,builderDraft:u0,docked:!0}),H5=j1.jsx(WF,{agent:U.agent,active:S==="fullscreen"&&f==="agent",focusRequest:D,chatLoaded:b,hasWorkspaceApplets:R,view:o,previewTurn:d,sessionId:t,processing:u,composerBanner:A0,agentAvailability:X0,send:Z0,stop:U0,onNavigateFromWelcome:m0}),M1=j1.jsxs("div",{className:z0("@container/workspace relative flex h-full min-h-0 min-w-0 flex-1 flex-col-reverse overflow-hidden bg-background shadow-md transition-[border-radius,background-color] duration-100 ease-out motion-reduce:transition-none",S==="split"&&"rounded-xl"),children:[j1.jsxs("div",{className:"relative flex min-h-0 flex-1",children:[j1.jsxs("div",{ref:G0.targetRef,inert:G0.controls.active||void 0,"aria-hidden":G0.controls.active||void 0,className:"flex min-h-0 min-w-0 flex-1 flex-col overflow-hidden bg-background transition-colors duration-100 ease-out motion-reduce:transition-none",children:[f==="agent"?H5:f==="widgets"?j1.jsx(bp,{editing:A==="editing",onEditingChange:(q0)=>N(q0?"editing":"idle"),widgets:$,onCreateWidget:()=>{B0(null),$1("Create widget")}}):f==="scratchpad"?j1.jsx(L2.Suspense,{fallback:null,children:j1.jsx(xG0,{})}):null,H.filter((q0)=>q0.status!=="ready").map((q0)=>j1.jsx(Sl,{ref:(V0)=>{if(V0)j.current.set(q0.id,V0);else j.current.delete(q0.id)},active:M0?.id===q0.id,builder:q0,chatDocked:S==="split",workspaceId:G,onEditingStart:()=>{if(S==="fullscreen")V(!1)},onContinueInChat:$1,onOpenChat:()=>{B0(q0.sessionId),$1()},onDiscard:()=>T0(q0)},q0.id)),j1.jsx(hl,{views:Z,activeViewId:P0?.id??null,params:g})]}),j1.jsx(rG,{...G0.layerProps,children:j1.jsx(oG,{controls:G0.controls,title:"Draw annotation",busy:G0.controls.finishing,onComplete:()=>void G0.controls.finish()})})]}),j1.jsx(G2,{children:A==="customizing"&&j1.jsx(Xu,{onClose:()=>N("idle")})}),j1.jsxs(yp,{children:[j1.jsxs("div",{className:"flex min-w-0 flex-1 items-center gap-4",children:[j1.jsxs("div",{className:"flex items-center gap-2",children:[j1.jsx("img",{src:z??I8[X??"claude-code"],alt:"",className:"size-5 shrink-0 rounded-xs"}),Q&&j1.jsx("span",{className:"truncate text-sm font-medium text-foreground",children:Q})]}),j1.jsx(Zi,{tabs:H0,active:f,createItems:D1,onSelect:j0,onClose:v0,onReorder:p0})]}),j1.jsxs("div",{className:"flex shrink-0 items-center gap-1",children:[j1.jsx(gG0,{active:A==="customizing",onToggle:()=>N(A==="customizing"?"idle":"customizing")}),j1.jsx(Wl,{}),x&&Y&&S==="fullscreen"&&j1.jsx(vG0,{onToggleMode:()=>l("split")})]})]})]});return j1.jsxs("div",{className:"relative flex h-full min-h-0 flex-col font-sans text-foreground",children:[j1.jsx("div",{ref:F,className:"flex min-h-0 flex-1",children:x&&Y&&W?j1.jsx(hi,{...W,workspace:M1,chat:N1,open:S==="split",chatWidth:M,onCollapse:()=>l("fullscreen"),onChatWidthChange:P}):M1}),S==="fullscreen"&&f!=="agent"&&x&&j1.jsx(zu,{agent:U.agent,loading:C,open:L,onOpenChange:V,onOpenChangeComplete:(q0)=>{if(q0)q((V0)=>V0+1)},children:(q0)=>j1.jsx(WF,{agent:U.agent,active:L,focusRequest:D,chatLoaded:b,hasWorkspaceApplets:R,view:o,previewTurn:d,sessionId:t,processing:u,composerBanner:u0?D0:A0,agentAvailability:X0,send:Z0,stop:U0,onNavigateFromWelcome:m0,onClose:q0,annotation:G0.popup,builderDraft:u0})})]})}var GY=_(p(),1);function ci($,Z,H,J){let B=GY.useRef(null);GY.useEffect(()=>{if(!Z)return;let Q=new Map(Z.map((W)=>[W.id,{w:W.config.colSpan,h:W.config.rowSpan}]));if(B.current?.workspaceId!==$){B.current={workspaceId:$,sizes:Q};return}let z=B.current.sizes,X=new Set(H.widgetGrid.map((W)=>W.i)),G=Z.filter((W)=>{if(!z.has(W.id))return!X.has(W.id);if(!X.has(W.id))return!1;let N=z.get(W.id);return N.w!==W.config.colSpan||N.h!==W.config.rowSpan});if(B.current={workspaceId:$,sizes:Q},G.length===0)return;let U=new Map(Z.map((W)=>[W.id,W.config])),K=H.widgetGrid.filter((W)=>!G.some((A)=>A.id===W.i)&&U.has(W.i)).map((W)=>{let A=U.get(W.i);return{i:W.i,x:W.x,y:W.y,w:A.colSpan,h:A.rowSpan}}),F=K.map(({i:W,x:A,y:N})=>({i:W,x:A,y:N})),Y=[...K];for(let W of G){let A=bB(Y,W.config.colSpan,W.config.rowSpan,4);F.push({i:W.id,x:A.x,y:A.y}),Y.push({i:W.id,x:A.x,y:A.y,w:W.config.colSpan,h:W.config.rowSpan})}J({widgetGrid:F})},[$,Z,H.widgetGrid,J])}var u8=_(r(),1);function li({id:$}){return u8.jsx(di,{id:$,children:u8.jsx(Qk,{id:$,children:u8.jsx(uG0,{id:$})})})}function uG0({id:$}){let Z=z1(),[H]=I3(),{layout:J,setLayout:B,isLoading:Q}=P5(),z=$k($),X=iG($),G=nF($);ci($,z.data,J,B),rI(),H4((K)=>{if(K.type==="theme:updated"||K.type==="workspace:updated")Z.invalidateQueries({queryKey:S0.layout($)});else if(K.type==="widget-layout:updated"||K.type==="widget:updated")Z.invalidateQueries({queryKey:S0.widgets($)});else if(K.type==="view-layout:updated"||K.type==="view:updated")Z.invalidateQueries({queryKey:S0.views($)})});let U=Q||H===void 0||z.isLoading||X.isLoading||G.isLoading;return u8.jsx(u8.Fragment,{children:u8.jsx(xX,{children:U?u8.jsx("div",{className:"flex h-full items-center justify-center",children:u8.jsx(hI,{sprite:"moi",effect:"chaos"})}):u8.jsx(pi,{widgets:z.data??[],views:X.data??[],builders:G.data??[]})})})}var v9=_(r(),1),ii=null;function pG0(){if(!ii)return v9.jsx(OP,{to:"/"});return v9.jsx(UY.Suspense,{fallback:null,children:v9.jsx(ii,{})})}function ri(){let[,$]=o2();return UY.useEffect(()=>{return FA((Z)=>$(`/workspace/${Z}`)),()=>FA(null)},[$]),v9.jsxs(jP,{children:[v9.jsx(PQ,{path:"/",component:SI}),v9.jsx(PQ,{path:"/dev/*?",component:pG0}),v9.jsx(PQ,{path:"/workspace/:id/*?",children:(Z)=>v9.jsx(li,{id:Z.id},Z.id)})]})}var x6=_(r(),1),ni=new _Y;PT(ni);zT();function tV1($){function Z(){return x6.jsx(OY,{client:ni,children:x6.jsxs(gz,{children:[x6.jsx(yY,{children:x6.jsx(ri,{})}),x6.jsx(jO,{}),!1]})})}ai.createRoot($).render(x6.jsx(Z,{}))}export{tV1 as mount};