tarsk 0.5.82 → 0.5.83

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 (119) hide show
  1. package/dist/index.js +1115 -236
  2. package/dist/public/assets/{account-view-CC_IRw14.js → account-view-CJyN7iRT.js} +1 -1
  3. package/dist/public/assets/{alert-dialog-CVooKafv.js → alert-dialog-Dq9tEk9t.js} +1 -1
  4. package/dist/public/assets/api-CX0sFbpL.js +2 -0
  5. package/dist/public/assets/{async-error-boundary-Did-c5sq.js → async-error-boundary-BS6v_PGo.js} +1 -1
  6. package/dist/public/assets/browser-tab-Cj4ztL1i.js +12 -0
  7. package/dist/public/assets/{button-DVIjvd2G.js → button-zYjzm__g.js} +1 -1
  8. package/dist/public/assets/{card-DaHPdrGh.js → card-CpchkvHM.js} +1 -1
  9. package/dist/public/assets/chat-dock-context-DQmDS2i8.js +1 -0
  10. package/dist/public/assets/{commit-dialog-29_bboof.js → commit-dialog-D6hchKSJ.js} +1 -1
  11. package/dist/public/assets/{commit-error-dialog-ASd71LX_.js → commit-error-dialog-f7e8Qzpk.js} +1 -1
  12. package/dist/public/assets/{commit-method-fields-Bylj8VjO.js → commit-method-fields-6Ag-XY8a.js} +1 -1
  13. package/dist/public/assets/conversation-history-view-Dd6vfz4F.js +1 -0
  14. package/dist/public/assets/create-project-dialog-DkxC6wM-.js +2 -0
  15. package/dist/public/assets/{create-repo-dialog-DKcWU21A.js → create-repo-dialog-Y8dcOitj.js} +1 -1
  16. package/dist/public/assets/{delete-confirm-dialog-C9CQzpYL.js → delete-confirm-dialog-DvJ5VuAy.js} +1 -1
  17. package/dist/public/assets/diff-view-L1jxq-Ig.js +4 -0
  18. package/dist/public/assets/{dist-VhqWx9-S.js → dist-B-I0i8QZ.js} +1 -1
  19. package/dist/public/assets/{dist-GRNTsriM.js → dist-B6u0s1jB.js} +1 -1
  20. package/dist/public/assets/{dist-BYYtqVYm.js → dist-BJaGHz0F.js} +1 -1
  21. package/dist/public/assets/{dist-DqKWH8sc.js → dist-BhdiICUV.js} +1 -1
  22. package/dist/public/assets/{dist-BVQgAd-x.js → dist-CPtOAqwP.js} +1 -1
  23. package/dist/public/assets/{dist-BI_HNW9c.js → dist-CX9ud_WC.js} +1 -1
  24. package/dist/public/assets/dist-FJzwWcMv.js +2 -0
  25. package/dist/public/assets/{dist-BKsOX8kk.js → dist-lnsB93_y.js} +1 -1
  26. package/dist/public/assets/{es2015-CxOm1WGv.js → es2015-D67vh4rt.js} +1 -1
  27. package/dist/public/assets/{explorer-monaco-editor-DMvtDzfX.js → explorer-monaco-editor-C9uTsYgh.js} +1 -1
  28. package/dist/public/assets/explorer-tab-view-BD924tmt.js +2 -0
  29. package/dist/public/assets/explorer-tree-Cn6lp8jD.js +1 -0
  30. package/dist/public/assets/explorer-view-5wUektaN.js +76 -0
  31. package/dist/public/assets/{git-history-dialog-C3tayM-K.js → git-history-dialog-CgH_0Ho0.js} +1 -1
  32. package/dist/public/assets/index-DCWejG57.css +1 -0
  33. package/dist/public/assets/index-DpDgcOE9.js +114 -0
  34. package/dist/public/assets/{lucide-react-C-dX1rVz.js → lucide-react-CMzSV2MP.js} +1 -1
  35. package/dist/public/assets/{model-list-controls-Yu77SyTe.js → model-list-controls-ueD5Yk6B.js} +1 -1
  36. package/dist/public/assets/onboarding-dialog-pDK_d92N.js +1 -0
  37. package/dist/public/assets/{pill-tabs-B_YP0wlG.js → pill-tabs-CVcpOO4f.js} +1 -1
  38. package/dist/public/assets/{progress-indicator-QgGbLfer.js → progress-indicator-_fEKurQg.js} +1 -1
  39. package/dist/public/assets/project-coding-view-CCT83rVv.js +1 -0
  40. package/dist/public/assets/{project-danger-zone-view-y2DDNkUE.js → project-danger-zone-view-CtOeSKHP.js} +1 -1
  41. package/dist/public/assets/{project-env-vars-view-BAiGaui1.js → project-env-vars-view-D8zFtC0r.js} +1 -1
  42. package/dist/public/assets/project-model-aliases-view-t1nijA2C.js +1 -0
  43. package/dist/public/assets/project-settings-view-C4kg3nDX.js +1 -0
  44. package/dist/public/assets/project-tools-view-DrwiTff5.js +1 -0
  45. package/dist/public/assets/providers-list-view-DXRbYpKr.js +1 -0
  46. package/dist/public/assets/pull-request-dialog-D4JEkCWC.js +1 -0
  47. package/dist/public/assets/{pull-with-changes-dialog-DqH8eFaG.js → pull-with-changes-dialog-Mrdm4wbB.js} +1 -1
  48. package/dist/public/assets/{push-before-pr-dialog-CxdsKSp0.js → push-before-pr-dialog-Ce8MMKT-.js} +1 -1
  49. package/dist/public/assets/query-keys-C2vEjHA1.js +1 -0
  50. package/dist/public/assets/{scroll-area-DnAXfBMQ.js → scroll-area-BTpvIsIG.js} +1 -1
  51. package/dist/public/assets/settings-general-tabs-view-Cg4sWryU.js +2 -0
  52. package/dist/public/assets/settings-general-view-Cl1qPgIX.js +1 -0
  53. package/dist/public/assets/{settings-list-CvCGue_y.js → settings-list-DajPoFxt.js} +1 -1
  54. package/dist/public/assets/settings-logs-view-C2SUOaIF.js +5 -0
  55. package/dist/public/assets/settings-mcp-servers-view-BuGFdY9u.js +5 -0
  56. package/dist/public/assets/settings-models-view-Dh8eZR6v.js +1 -0
  57. package/dist/public/assets/settings-plugins-view-CJvYXOb6.js +2 -0
  58. package/dist/public/assets/settings-providers-view-CxZnVxuu.js +2 -0
  59. package/dist/public/assets/settings-setup-view-0NvbMts_.js +2 -0
  60. package/dist/public/assets/settings-skills-view-DT6Ldvfn.js +2 -0
  61. package/dist/public/assets/{settings-slack-view-xWc3HZl5.js → settings-slack-view-DH7r2apv.js} +1 -1
  62. package/dist/public/assets/settings-slash-commands-view-DxlXk7eT.js +1 -0
  63. package/dist/public/assets/{settings-statistics-view-BhrL3BwB.js → settings-statistics-view-mlcoR26Q.js} +1 -1
  64. package/dist/public/assets/settings-storage-view-DuN42zRw.js +1 -0
  65. package/dist/public/assets/{settings-subagents-view-C1WIOO6x.js → settings-subagents-view-C1r3Jtpe.js} +2 -2
  66. package/dist/public/assets/{settings-system-prompt-view-b3IaVlp1.js → settings-system-prompt-view-DcbUbDfa.js} +1 -1
  67. package/dist/public/assets/{settings-tab-bar-cx4BrJIY.js → settings-tab-bar-T8v2_Dfk.js} +1 -1
  68. package/dist/public/assets/settings-view-Bv5QDh0H.js +2 -0
  69. package/dist/public/assets/{slug-utils-D5qfm2sn.js → slug-utils-DhQjuU2J.js} +1 -1
  70. package/dist/public/assets/{store-CEYCdhjW.js → store-DCnnNgwq.js} +3 -3
  71. package/dist/public/assets/{table-DHvBIex4.js → table-DuD2DtkR.js} +1 -1
  72. package/dist/public/assets/tasks-view-D_TwmLgM.js +1 -0
  73. package/dist/public/assets/{terminal-panel-2T2Kc4CN.js → terminal-panel-BmphDRj0.js} +3 -3
  74. package/dist/public/assets/{toggle-group-DaT4acSz.js → toggle-group-D0gDKZ9x.js} +1 -1
  75. package/dist/public/assets/{tooltip-Cqmpv-M5.js → tooltip-6qlOE6WT.js} +1 -1
  76. package/dist/public/assets/{use-active-dock-panel-instance-CuYvC5Us.js → use-active-dock-panel-instance-CDcYJhbD.js} +1 -1
  77. package/dist/public/assets/{use-git-check-CmtXehtR.js → use-git-check-CZxYYnQ8.js} +1 -1
  78. package/dist/public/assets/{use-installed-ai-files-Cdzy29ie.js → use-installed-ai-files-uH9h6W5v.js} +1 -1
  79. package/dist/public/assets/useBaseQuery-DqLwB2Sq.js +1 -0
  80. package/dist/public/assets/{utils-CWTBjUlE.js → utils-uGptTPGm.js} +1 -1
  81. package/dist/public/assets/{web-bYOmn95I.js → web-B5i03FJP.js} +1 -1
  82. package/dist/public/assets/{web-CsChMX5V.js → web-CutQ8Xsm.js} +1 -1
  83. package/dist/public/assets/{web-BlBW8SWJ.js → web-D8PJDFGq.js} +1 -1
  84. package/dist/public/assets/{web-CIGP6pa8.js → web-Us0pibUb.js} +1 -1
  85. package/dist/public/index.html +23 -22
  86. package/package.json +1 -1
  87. package/dist/public/assets/api-IMkL19mR.js +0 -2
  88. package/dist/public/assets/browser-tab-CjdUnNr2.js +0 -12
  89. package/dist/public/assets/chat-dock-context-BA8EIToZ.js +0 -1
  90. package/dist/public/assets/conversation-history-view-CXHmQEA6.js +0 -1
  91. package/dist/public/assets/create-project-dialog-CtEUqqAd.js +0 -2
  92. package/dist/public/assets/diff-view-eYW3Jliv.js +0 -4
  93. package/dist/public/assets/dist-Ch137qdo.js +0 -2
  94. package/dist/public/assets/explorer-tab-view-CPN5epzi.js +0 -2
  95. package/dist/public/assets/explorer-tree-EjBLSWxV.js +0 -1
  96. package/dist/public/assets/explorer-view-DZh1FGrc.js +0 -76
  97. package/dist/public/assets/index-C3E_66vw.js +0 -114
  98. package/dist/public/assets/index-D42A6A6A.css +0 -1
  99. package/dist/public/assets/onboarding-dialog-C3vpTe8y.js +0 -1
  100. package/dist/public/assets/project-coding-view-DXtPNlL1.js +0 -1
  101. package/dist/public/assets/project-model-aliases-view-z5KtzKTK.js +0 -1
  102. package/dist/public/assets/project-settings-view-CvNtaVMG.js +0 -1
  103. package/dist/public/assets/project-tools-view-D3j7nVpp.js +0 -1
  104. package/dist/public/assets/providers-list-view-BY11UIaf.js +0 -1
  105. package/dist/public/assets/pull-request-dialog-D7Tc-DZW.js +0 -1
  106. package/dist/public/assets/settings-general-tabs-view-YngdB7te.js +0 -2
  107. package/dist/public/assets/settings-general-view-BLovSe8Y.js +0 -1
  108. package/dist/public/assets/settings-logs-view-B2vFqetG.js +0 -5
  109. package/dist/public/assets/settings-mcp-servers-view-BiWEZyG-.js +0 -5
  110. package/dist/public/assets/settings-models-view-B7STNfBy.js +0 -1
  111. package/dist/public/assets/settings-plugins-view-D8wypO3V.js +0 -2
  112. package/dist/public/assets/settings-providers-view-C5x9gCg7.js +0 -2
  113. package/dist/public/assets/settings-setup-view-VuWyf9Ey.js +0 -2
  114. package/dist/public/assets/settings-skills-view-cu2mzI28.js +0 -2
  115. package/dist/public/assets/settings-slash-commands-view-C9slbf4z.js +0 -1
  116. package/dist/public/assets/settings-storage-view-y4GyGxD-.js +0 -1
  117. package/dist/public/assets/settings-view-C_ggbCIB.js +0 -2
  118. package/dist/public/assets/tasks-view-DFBi6JaW.js +0 -1
  119. package/dist/public/assets/useBaseQuery-D6c39Xb1.js +0 -1
@@ -0,0 +1,2 @@
1
+ import{t as e}from"./rolldown-runtime-aKtaBQYM.js";Object.entries({"VS Code":{name:`VS Code`,appName:[`Visual Studio Code`,`code`]},Cursor:{name:`Cursor`,appName:[`Cursor`,`cursor`]},Windsurf:{name:`Windsurf`,appName:[`Windsurf`,`windsurf`]},Xcode:{name:`Xcode`,appName:`Xcode`},"Android Studio":{name:`Android Studio`,appName:[`Android Studio`,`studio`]},Kiro:{name:`Kiro`,appName:[`Kiro`,`kiro`]},Terminal:{name:`Terminal`,appName:`Terminal`},"Devin Desktop":{name:`Devin Desktop`,appName:[`Devin`,`Devin Desktop`]},Antigravity:{name:`Antigravity`,appName:[`com.google.antigravity-ide`,`Antigravity IDE`]}}).reduce((e,[t,n])=>(e[t]=n.appName,e),{});var t=new Set([`minimal`,`low`,`medium`,`high`,`xhigh`,`max`]);function n(e){return t.has(e)}function r(e){return e===`off`||n(e)}function i(e){return e?e.reasoningEffort===void 0?e.reasoning===void 0?{reasoningEffort:`off`}:{reasoningEffort:e.reasoning?`medium`:`off`}:{reasoningEffort:e.reasoningEffort}:{reasoningEffort:`off`}}function a(e){return e===`off`?`Off`:e===`xhigh`?`Extra high`:e===`max`?`Max`:e.charAt(0).toUpperCase()+e.slice(1)}function o(e,t){return e===`off`||t.length===0?`off`:t.includes(e)?e:t.includes(`medium`)?`medium`:t[0]??`off`}function s(e){return e?e.reasoningEffort!==void 0||e.reasoning!==void 0:!1}function c(e){return e.length===0?`off`:e.includes(`medium`)?`medium`:e[0]??`off`}function l(e,t){return!s(e)&&t.length>0?c(t):o(i(e).reasoningEffort??`off`,t)}var u=[`default`,`fast`,`local`,`cheap`,`smart`],d={default:`Default`,fast:`Fast`,local:`Local`,cheap:`Cheap`,smart:`Smart`},f={default:`Default model for new chats`,fast:`Quick responses for lightweight tasks`,local:`On-device or local inference`,cheap:`Lower-cost models for routine work`,smart:`Most capable models for complex tasks`},p=new Set(u);function m(e){return p.has(e)}function ee(e){return`${e.provider}::${e.model}`}function h(e){let t=e.indexOf(`::`);if(t<=0||t>=e.length-2)return null;let n=e.slice(0,t).trim(),r=e.slice(t+2).trim();return!n||!r?null:{provider:n,model:r}}function g(e,t){return m(e)?t?.[e]??null:null}function _(e){return!e?.model?.trim()||!e.provider?.trim()?null:e}function v(e){return _(g(`default`,e))!==null}function y(e){return _(g(`cheap`,e))!==null}function b(e){return _(g(`fast`,e))??_(g(`cheap`,e))}function te(e){return b(e)!==null}function ne(e){return g(`smart`,e)}function x(e,t){let n=e.toLowerCase();return t[n]?t[n]:Object.entries(t).find(([e])=>e.toLowerCase()===n)?.[1]??[]}function re(e,t){return x(e.provider,t).includes(e.model)}function ie(e,t){for(let n of u){let r=e[n];if(r&&!re(r,t))throw Error(`Model alias '${n}' must reference an enabled model. '${r.provider}/${r.model}' is not enabled.`)}}var ae=[`build`,`plan`,`image`,`orchestrate`],oe={build:`Agent`,plan:`Plan Agent`,image:`Image Agent`,orchestrate:`Orchestrator Agent`};function se(e){return e.orchestrateMode?`orchestrate`:e.planMode?`plan`:e.imageMode?`image`:`build`}function ce(e){return e?oe[e]:oe.build}var le=[`auto`,...ae],ue=`auto`,de=new Set(le);function fe(e){return typeof e==`string`&&de.has(e)}function pe(e){return e.autoMode?`auto`:se(e)}function me(e){return{autoMode:e===`auto`,planMode:e===`plan`,imageMode:e===`image`,ralphMode:!1,orchestrateMode:e===`orchestrate`}}function he(e,t,n){return`The pull request for branch ${e} was merged and fresh branch from ${t} was created called ${n}.`}function ge(e){return`The pull request for branch ${e} was merged, but the fresh branch was not created because this workspace has uncommitted changes. Commit or stash the changes, then try again.`}var _e=[`cheap`,`smart`,`default`],ve=`Picking a model...`,ye={cheap:`Cheap`,smart:`Smart`,default:`Default`};new Set(_e),RegExp(`\\b(${_e.join(`|`)})\\b`);var S;(function(e){e.PullRequest=`pull-request`,e.Direct=`direct`})(S||={}),S.PullRequest,S.PullRequest,S.Direct,S.Direct;var C={bun:{id:`bun`,label:`bun`},npm:{id:`npm`,label:`npm`},yarn:{id:`yarn`,label:`yarn`},pnpm:{id:`pnpm`,label:`pnpm`}};function be(e,t=0,n=0){let r=Number.isFinite(e)&&e>0?e:0,i=(Number.isFinite(t)&&t>0?t:0)+(Number.isFinite(n)&&n>0?n:0);return r>=i?r:r+i}function xe(e,t){return!Number.isFinite(e)||!Number.isFinite(t)||t<=0||e<=0?0:Math.min(1,e/t)}function Se(e){return e==null||e<=0?`~$0.00`:`~$${(Math.round(e*100)/100).toFixed(2)}`}function Ce(e){return e==null||!Number.isFinite(e)||e<=0?`$0.00`:`$${(Math.round(e*100)/100).toFixed(2)}`}function we(e){if(e==null||!Number.isFinite(e)||e<=0)return`0`;let t=Math.round(e);return t>=1e6?`${(t/1e6).toFixed(1)}mil`:`${(t/1e3).toFixed(1)}K`}function Te(e){if(e==null||!Number.isFinite(e)||e<=0)return`0 tokens`;let t=Math.round(e/4);return t<1e3?`${t} tokens`:t<1e6?`${(t/1e3).toFixed(1)}K tokens`:`${(t/1e6).toFixed(1)}M tokens`}function Ee(e){return e?Math.ceil(e.length/4):0}var De=2.5;function Oe(e){return e?Math.ceil(e.length/De):0}function ke(e){let t=new Map;for(let n of e){if(!n.server)continue;let e=t.get(n.server)??[];e.push(n),t.set(n.server,e)}return Array.from(t,([e,t])=>({server:e,tokens:t.reduce((e,t)=>e+t.tokens,0),tools:t})).sort((e,t)=>t.tokens-e.tokens)}function Ae(e){let t=(e??``).replace(/\s+/g,` `).trim().replace(/^["'“”‘’]+|["'“”‘’]+$/g,``).trim();return t?t.length>100?`${t.slice(0,100).trimEnd()}…`:t:``}var je=`order`,Me=`updated`,Ne=`obs_`,Pe=2e3;RegExp(`${Ne}[a-f0-9]{64}`,`i`);function Fe(e){return RegExp(`^${Ne}[a-f0-9]{64}$`).test(e)}function Ie(e){if(!e||typeof e!=`object`)return!1;let t=e;return typeof t.id==`string`&&Fe(t.id)&&typeof t.byteLength==`number`&&typeof t.lineCount==`number`&&typeof t.previewByteLength==`number`}function Le(e){return e!==void 0&&e<.05}new Set([`read`,`bash`,`grep`,`find`,`ls`,`web_search`,`fetch`,`edit`,`write`,`browser`,`get_observation`,`run_js`]);var Re=`Processing...`,ze=`Thinking...`,Be=3e3,Ve=[`Loading...`,`Brewing...`,`Summoning...`,`Searching...`,`Generating...`,`Herding...`,`Scanning...`,`Following...`,`Building...`,`Finishing...`],He=2e3,Ue=3e4;function w(e){return typeof e==`string`&&e.startsWith(`data:image`)}function We(e){let t=e.indexOf(`,`);return t===-1?{imageUrl:e}:{imageUrl:e,imageData:e.slice(t+1)}}function T(e){let t=typeof e.imageUrl==`string`?e.imageUrl:void 0,n=typeof e.imageData==`string`?e.imageData:void 0;return!t&&!n?null:t&&w(t)&&!n?We(t):{imageUrl:t,imageData:n}}function Ge(e){if(typeof e==`string`)return[e];if(!Array.isArray(e))return[];let t=[];for(let n of e)typeof n==`object`&&n&&`text`in n&&typeof n.text==`string`&&t.push(n.text);return t}function E(e){for(let t of e){let e=t.trim();if(!e.startsWith(`{`)){if(w(e))return We(e);continue}try{let t=Ke(JSON.parse(e));if(t)return t}catch{}}return null}function Ke(e){if(e==null)return null;if(typeof e==`object`&&!Array.isArray(e)){let t=T(e);if(t)return t}let t=Ge(e);return t.length>0?E(t):null}function qe(e){let t={...e};return delete t.imageData,delete t.image_data,typeof t.imageUrl==`string`&&w(t.imageUrl)&&delete t.imageUrl,t}var Je=/^(localhost|127\.0\.0\.1)$/i;function Ye(e){return Je.test(e)}function Xe(e){return!e||e.startsWith(`data:`)||/^https?:\/\//i.test(e)}function Ze(e,t){let n=e.trim();if(!n||n.startsWith(`data:`)||!/^https?:\/\//i.test(n))return e;let r;try{r=new URL(n)}catch{return e}if(!Ye(r.hostname))return e;let i;try{i=new URL(t)}catch{return e}return`${i.origin}${r.pathname}${r.search}${r.hash}`}function D(e,t){return Xe(e)?e:`${t.replace(/\/$/,``)}${e.startsWith(`/`)?e:`/${e}`}`}function Qe(e){try{let t=new URL(e,`http://localhost`),n=t.searchParams.get(`path`);if(n){let e=n.split(/[/\\]/).pop();if(e)return e}let r=t.pathname.split(`/`).pop();if(r?.includes(`.`))return r}catch{}}var $e={pageTitle:`text-3xl font-bold`,pageSubtitle:`text-base text-muted-foreground`,sectionTitle:`text-xl font-semibold`,subSectionTitle:`text-lg font-semibold`,sectionSubtitle:`text-base font-medium`,emptyStateTitle:`text-base font-semibold text-muted-foreground`,body:`text-base`,bodyMuted:`text-base text-muted-foreground`,conversationBody:`text-sm`,caption:`text-sm text-muted-foreground`,compact:`text-xs`,captionForeground:`text-sm`,dropdownGroupHeading:`text-xs font-semibold text-muted-foreground`,mono:`font-mono text-base`,error:`text-base text-destructive`,dialogTitle:`text-xl font-semibold leading-none tracking-tight`,dialogDescription:`text-base text-muted-foreground`,label:`text-base font-medium leading-none`,labelNormal:`text-base font-normal leading-none`,labelMuted:`text-base font-normal leading-none text-muted-foreground`,stat:`text-2xl font-bold`,infoBanner:`text-base text-muted-foreground bg-muted rounded-md px-3 py-2 mb-4`,hintBanner:`text-sm text-muted-foreground bg-muted rounded-md px-3 py-2 mb-4`},et={settingsPage:`@container/settings-page w-full px-6 pb-6`,accountPage:`max-w-2xl mx-auto px-6 pb-6 pt-6`,formPage:`max-w-2xl mx-auto px-6 pb-6 pt-6`,tableWrapper:`overflow-hidden rounded-md border border-table-border`,settingsFieldRow:`flex w-full flex-col gap-2 @md/settings-page:flex-row @md/settings-page:items-center @md/settings-page:gap-4`,settingsFieldLabel:`flex min-w-0 flex-col justify-center @md/settings-page:min-h-10 @md/settings-page:w-44 @md/settings-page:shrink-0 @min-[52rem]/settings-page:w-52`,settingsFieldControl:`flex min-w-0 w-full flex-1 flex-col items-stretch`,settingsFieldStack:`flex w-full flex-col gap-4`};function tt(e,t){return t?e*1:e}function nt(e,t){return tt(e,t)/100*100}var rt=[{name:`agent`,enabled:!0,displayName:`Subagent`,activeDisplayName:`Subagent`},{name:`ask_user`,enabled:!0,displayName:`Ask`,activeDisplayName:`Asking`},{name:`propose_branch`,enabled:!0,displayName:`Propose Branch`,activeDisplayName:`Proposing Branch`},{name:`bash`,enabled:!0,displayName:`Run`,activeDisplayName:`Running`},{name:`browser`,enabled:!0,displayName:`Browser`,activeDisplayName:`Browsing`},{name:`chat_title`,enabled:!0,displayName:`Chat Title`,activeDisplayName:`Titling Chat`},{name:`edit`,enabled:!0,displayName:`Edit`,activeDisplayName:`Editing`},{name:`execute_skill_script`,enabled:!0,displayName:`Run Skill Script`,activeDisplayName:`Running Script`},{name:`fetch`,enabled:!0,displayName:`Fetch`,activeDisplayName:`Fetching`},{name:`find`,enabled:!0,displayName:`Find`,activeDisplayName:`Finding`},{name:`find_images`,enabled:!0,displayName:`Find Images`,activeDisplayName:`Finding Images`},{name:`generate_image`,enabled:!0,displayName:`Make Image`,activeDisplayName:`Making Image`},{name:`get_observation`,enabled:!0,displayName:`Observe`,activeDisplayName:`Observing`},{name:`grep`,enabled:!0,displayName:`Search`,activeDisplayName:`Searching`},{name:`history`,enabled:!0,displayName:`History`,activeDisplayName:`Searching History`},{name:`ls`,enabled:!1,displayName:`List`,activeDisplayName:`Listing`},{name:`mcp`,enabled:!0,displayName:`MCP Tool`,activeDisplayName:`Tool`},{name:`notes`,enabled:!0,displayName:`Notes`,activeDisplayName:`Updating Notes`},{name:`projects`,enabled:!0,defaultEnabled:!1,displayName:`Projects`,activeDisplayName:`Getting Projects`},{name:`prompt_project`,enabled:!0,defaultEnabled:!1,displayName:`Prompt`,activeDisplayName:`Prompting`},{name:`read`,enabled:!0,displayName:`Read`,activeDisplayName:`Reading`},{name:`read_skill`,enabled:!0,displayName:`Read Skill`,activeDisplayName:`Reading Skill`},{name:`read_skill_reference`,enabled:!0,displayName:`Read Reference`,activeDisplayName:`Reading Reference`},{name:`run_js`,enabled:!0,displayName:`Run JS`,activeDisplayName:`Running JS`},{name:`todo`,enabled:!0,defaultEnabled:!1,displayName:`Todo`,activeDisplayName:`Updating`},{name:`tasks`,enabled:!0,displayName:`Tasks`,activeDisplayName:`Managing Tasks`},{name:`tool_search`,enabled:!0,displayName:`Find Tools`,activeDisplayName:`Finding Tools`},{name:`web_search`,enabled:!0,displayName:`Web Search`,activeDisplayName:`Searching Web`},{name:`write`,enabled:!0,displayName:`Write`,activeDisplayName:`Writing`}],it=new Map(rt.map(e=>[e.name,e]));function at(e){return e.charAt(0).toUpperCase()+e.slice(1)}var O=new Map([[`run_web_worker`,`run_js`],[`file_read`,`read`],[`ast_grep`,`grep`]]);function k(e){if(e.includes(`bash`)||e.includes(`terminal`)||e.includes(`shell`))return it.get(`bash`);if(e.includes(`web_fetch`))return it.get(`fetch`);if(e.includes(`read`))return it.get(`read`)}function ot(e){let t=e.toLowerCase(),n=it.get(t);if(n)return n;let r=O.get(t);return r?it.get(r):void 0}function st(e){return ot(e)??k(e.toLowerCase())}function A(e){return st(e)?.displayName??at(e)}function ct(e){return ot(e)?.displayName??e}function lt(e){let t=st(e);return t?t.activeDisplayName:A(e)}function j(e,t,n){return`${e} ${e===1?t:n}`}function ut(e,t){let n=e.toLowerCase();return n===`agent`||n.includes(`subagent`)?!0:!!(t&&typeof t==`object`&&`description`in t&&(`prompt`in t||`agentName`in t))}function dt(e){return`${j(e,`subagent`,`subagents`)} working`}function M(e,t,n){return{formatPhrase:r=>e===null?j(r,t,n):`${e} ${j(r,t,n)}`,formatNeutral:e=>j(e,t,n)}}var ft={id:`other`,toolNames:[],...M(null,`tool call`,`tool calls`)},pt=[{id:`files`,toolNames:[`edit`,`write`],...M(`edited`,`file`,`files`)},{id:`commands`,toolNames:[`bash`,`execute_skill_script`,`run_js`],...M(`ran`,`command`,`commands`)},{id:`reads`,toolNames:[`read`,`get_observation`],...M(`read`,`file`,`files`)},{id:`notes`,toolNames:[`notes`],formatPhrase:e=>`${j(e,`note`,`notes`)} captured`,formatNeutral:e=>j(e,`note`,`notes`)},{id:`history`,toolNames:[`history`],formatPhrase:e=>`${j(e,`note`,`notes`)} recalled`,formatNeutral:e=>j(e,`note`,`notes`)},{id:`searches`,toolNames:[`grep`,`find`],...M(null,`search`,`searches`)},{id:`webSearches`,toolNames:[`web_search`],...M(null,`web search`,`web searches`)},{id:`pages`,toolNames:[`fetch`],...M(`fetched`,`page`,`pages`)},{id:`browserActions`,toolNames:[`browser`],...M(null,`browser action`,`browser actions`)},{id:`images`,toolNames:[`generate_image`],...M(`generated`,`image`,`images`)},{id:`subagents`,toolNames:[`agent`],...M(null,`subagent`,`subagents`)},{id:`projects`,toolNames:[`projects`],formatPhrase:()=>`got projects`,formatNeutral:e=>j(e,`project list`,`project lists`)},{id:`prompts`,toolNames:[`prompt_project`],formatPhrase:e=>`${j(e,`prompt`,`prompts`)} sent`,formatNeutral:e=>j(e,`prompt`,`prompts`)},{id:`chatTitle`,toolNames:[`chat_title`],formatPhrase:e=>`${j(e,`chat title`,`chat titles`)} set`,formatNeutral:e=>j(e,`chat title`,`chat titles`)},ft],mt={file_read:`read`,run_web_worker:`run_js`,ast_grep:`grep`,get_projects:`projects`},ht=new Map(pt.flatMap(e=>e.toolNames.map(t=>[t,e])));function gt(e){let t=e.toLowerCase(),n=mt[t]??t;return ht.get(n)??ft}function _t(e){return pt.find(t=>t.id===e)??ft}var vt=new Set([`tool_search`]),N=rt.filter(e=>e.enabled&&!vt.has(e.name)).map(e=>e.name),P=new Set(N);function yt(e){if(!Array.isArray(e))return[];let t=new Set,n=[];for(let r of e){if(typeof r!=`string`)continue;let e=r.trim().toLowerCase();!e||!P.has(e)||t.has(e)||(t.add(e),n.push(e))}return n.sort()}function bt(){return N.map(e=>({name:e,displayName:ct(e)})).sort((e,t)=>e.displayName.localeCompare(t.displayName))}var xt=new Set([`tool_search`]),St=rt.filter(e=>e.enabled&&!xt.has(e.name)).map(e=>e.name),Ct=`standard`,wt=[`ask_user`,`projects`,`prompt_project`,`read_skill`,`web_search`,`execute_skill_script`],Tt=[`projects`,`prompt_project`];function Et(e){return e===`bot`?`bot`:Ct}function F(e){return Et(e.type)===`bot`}function Dt(e){return Et(e.type)===Ct}function I(){let e=new Set(wt);return St.filter(t=>!e.has(t)).sort()}function Ot(e){return F(e)?I():yt([...e.disabledTools??[],...Tt])}new Set([`version`,`name`,`setupScript`,`runCommand`,`commitMethod`,`disabledTools`,`commands`]),new TextEncoder,new TextDecoder;var L=[`run_js`,`ask_user`,`agent`,`tool_search`];new Set(L);var R={defaultMaxChars:16e3,stepMaxChars:4e3,minMaxChars:512,maxMaxChars:64e3,defaultLimit:40,maxDepth:50,maxCaptureBytes:64*1024*1024,maxStepIdChars:256},z=Object.freeze({maxSteps:100,maxCalls:500,maxConcurrency:8,defaultMaxChars:16e3,maxOutputChars:64e3,minOutputChars:128,minSmartOutputChars:R.minMaxChars,maxStepIdChars:R.maxStepIdChars,maxNesting:50,maxErrorChars:500,blockedTools:L}),kt=[`steps`,`return`,`maxChars`],At=[`id`,`tool`,`args`,`foreach`,`dependsOn`,`select`,`limit`,`maxChars`,`query`,`dedupe`];function jt(e){let t=new Set;function n(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function r(e){return e===null||typeof e==`string`||typeof e==`boolean`||typeof e==`number`&&Number.isFinite(e)}function i(e){if(Array.isArray(e))return!0;let t=Object.getPrototypeOf(e);return t===Object.prototype||t===null}function a(e,t){if(Array.isArray(e)&&t.length!==e.length+1)throw Error(`Plan arrays must be dense without extra properties`)}function o(e,t){return typeof e==`string`&&t.enumerable===!0&&Object.prototype.hasOwnProperty.call(t,`value`)}function s(e){return e===`__proto__`||e===`prototype`||e===`constructor`}function c(e,t){return/^(0|[1-9]\d*)$/.test(e)&&Number(e)<t.length}function l(e,t,n,r){if(n&&t===`length`)return;let i=Object.getOwnPropertyDescriptor(e,t);if(!o(t,i))throw Error(`Plan must contain enumerable JSON data properties`);if(s(t))throw Error(`Unsafe plan property`);if(n&&!c(t,e))throw Error(`Plan arrays cannot have extra properties`);u(i.value,r+1)}function u(e,n){if(n>z.maxNesting)throw Error(`Plan nesting limit exceeded`);if(r(e))return;if(typeof e!=`object`||!e)throw Error(`Plan must contain only JSON data`);if(!i(e))throw Error(`Plan must contain plain JSON objects`);if(t.has(e))throw Error(`Cyclic plan`);t.add(e);let o=Reflect.ownKeys(e);a(e,o);let s=Array.isArray(e);for(let t of o)l(e,t,s,n);t.delete(e)}function d(e){if(!n(e)||!Array.isArray(e.steps)||!e.steps.length||e.steps.length>z.maxSteps)throw Error(`Plan must have a nonempty steps array within the step limit`);for(let t of Object.keys(e))if(!kt.includes(t))throw Error(`Unknown plan field: ${t}`);return{steps:e.steps,maxChars:e.maxChars}}function f(e){if(e!==void 0&&(typeof e!=`number`||!Number.isInteger(e)||e<z.minOutputChars||e>z.maxOutputChars))throw Error(`Invalid plan maxChars`)}function p(e){if(!n(e)||typeof e.id!=`string`||!e.id||typeof e.tool!=`string`||!e.tool.trim())throw Error(`Plan steps require id and tool`);return e}function m(e){for(let t of Object.keys(e))if(!At.includes(t))throw Error(`Unknown step field: ${t}`)}function ee(e){if(e.args!==void 0&&!n(e.args))throw Error(`Step args must be an object`)}function h(e){return typeof e!=`string`}function g(e){if(e.dependsOn!==void 0&&(!Array.isArray(e.dependsOn)||e.dependsOn.some(h)))throw Error(`Step dependsOn must be an array of ids`)}function _(e){if(!Object.prototype.hasOwnProperty.call(e,`foreach`))return;let t=e.foreach;if(!Array.isArray(t)&&!(typeof t==`string`&&t.startsWith(`$`)&&!t.startsWith(`$$`)))throw Error(`Step foreach must be an array or reference`)}function v(e){for(let t of e){let e=p(t);m(e),ee(e),g(e),_(e)}}u(e,0);let y=d(e);return f(y.maxChars),v(y.steps),`return await runPlan(${JSON.stringify(e)});`}function Mt(e){if(typeof e!=`object`||!e||Array.isArray(e))return null;let t=Object.getPrototypeOf(e);if(t!==Object.prototype&&t!==null)return null;let n=Object.getOwnPropertyDescriptor(e,`code`),r=Object.getOwnPropertyDescriptor(e,`plan`);if(!!n==!!r||r&&Object.getOwnPropertyDescriptor(e,`patches`))return null;if(n)return typeof n.value==`string`&&n.value.trim()?n.value:null;try{return jt(r.value)}catch{return null}}z.defaultMaxChars;var Nt=String.raw`(?:(['"])\\n\1|\`\\n\`|\/(?:\\r\?\\n|\\n)\/[dgimsuy]*)`;new RegExp(String.raw`(?:const|let|var)\s+lines\s*=\s*[^\n;]*?\.split\s*\(\s*${Nt}\s*\)`),new RegExp(String.raw`\blines\s*\.slice\s*\(\s*(?<start>\d+)\s*(?:,\s*(?<end>\d+)\s*)?\)`,`g`),new RegExp(String.raw`\.split\s*\(\s*${Nt}\s*\)\s*\.slice\s*\(\s*(?<start>\d+)\s*(?:,\s*(?<end>\d+)\s*)?\)`,`g`);var Pt=`local`,Ft=`http://127.0.0.1:8000/v1`,It=`LOCAL_API_URL`;function Lt(e){return e[It]?.trim()||Ft}function Rt(e){return e.toLowerCase()===Pt}var zt=[{value:`providers`,label:`Providers`},{value:`model-aliases`,label:`Default Models`},{value:`models`,label:`List`}];function Bt(e){let t=e.replace(/\/+$/,``);return t===`/settings/providers`||t.startsWith(`/settings/providers/`)?`providers`:t===`/settings/models`?`models`:t===`/settings/model-aliases`?`model-aliases`:null}var Vt=[{value:`general`,label:`General`},{value:`history`,label:`History`},{value:`storage`,label:`Storage`},{value:`statistics`,label:`Statistics`},{value:`logs`,label:`Logs`},{value:`slack`,label:`Slack`}];function Ht(e){let t=e.replace(/\/+$/,``);if(t===`/settings/general`)return`general`;for(let e of Vt)if(t===`/settings/general/${e.value}`||e.value!==`general`&&t===`/settings/${e.value}`)return e.value;return null}var Ut={darwin:`macOS`,win32:`Windows`,linux:`Linux`,unknown:`System`},Wt=[{value:`skills`,label:`Skills`},{value:`mcp-servers`,label:`MCP`},{value:`system-prompt`,label:`System Prompt`},{value:`tools`,label:`Tools`},{value:`slash-commands`,label:`Slash Commands`},{value:`subagents`,label:`Subagents`}];function Gt(e){let t=e.replace(/\/+$/,``);if(/^\/settings\/project\/[^/]+\/plugins$/.test(t)||t===`/settings/plugins`)return`skills`;if(/^\/settings\/project\/[^/]+\/tools$/.test(t))return`tools`;for(let e of Wt)if(RegExp(`^/settings/project/[^/]+/plugins/${e.value}$`).test(t)||t===`/settings/plugins/${e.value}`||e.value!==`tools`&&t===`/settings/${e.value}`)return e.value;return null}var Kt=[{value:`setup`,label:`Setup`},{value:`commands`,label:`Commands`}];function qt(e){let t=e.replace(/\/+$/,``);return/^\/settings\/project\/[^/]+\/coding$/.test(t)?`setup`:/^\/settings\/project\/[^/]+\/coding\/commands$/.test(t)?`commands`:null}var Jt=`User declined to run this command:`,Yt=`User declined to fetch from this domain:`,Xt=new Set([`png`,`jpg`,`jpeg`,`gif`,`webp`,`svg`,`ico`,`bmp`,`tiff`,`tif`]),Zt=new Set([`mp4`,`webm`,`mov`,`avi`]),Qt=new Set([`mp3`,`wav`,`ogg`,`m4a`,`aac`,`flac`]),$t={png:`image/png`,jpg:`image/jpeg`,jpeg:`image/jpeg`,gif:`image/gif`,webp:`image/webp`,svg:`image/svg+xml`,ico:`image/x-icon`,bmp:`image/bmp`,tiff:`image/tiff`,tif:`image/tiff`,mp4:`video/mp4`,webm:`video/webm`,mov:`video/quicktime`,avi:`video/x-msvideo`,mp3:`audio/mpeg`,wav:`audio/wav`,ogg:`audio/ogg`,m4a:`audio/mp4`,aac:`audio/aac`,flac:`audio/flac`};function en(e){if(!e)return``;let t=e.trim(),n=t.split(/[/\\]/).pop()??t,r=n.lastIndexOf(`.`);return r<=0||r===n.length-1?``:n.slice(r+1).toLowerCase()}function tn(e,t){let n=en(e)||(t?en(t):``);return n?Xt.has(n)?`image`:Zt.has(n)?`video`:Qt.has(n)?`audio`:null:null}function nn(e,t){return t?.trim()||($t[en(e)]??`application/octet-stream`)}var rn={md:{name:`text`,className:`text-sky-500`},mdc:{name:`text`,className:`text-sky-500`},mdx:{name:`text`,className:`text-sky-500`},txt:{name:`document`,className:`text-muted-foreground`},pdf:{name:`text`,className:`text-red-500`},doc:{name:`text`,className:`text-blue-500`},docx:{name:`text`,className:`text-blue-500`},rtf:{name:`text`,className:`text-blue-500`},csv:{name:`spreadsheet`,className:`text-emerald-600`},tsv:{name:`spreadsheet`,className:`text-emerald-600`},xls:{name:`spreadsheet`,className:`text-emerald-600`},xlsx:{name:`spreadsheet`,className:`text-emerald-600`},ppt:{name:`presentation`,className:`text-orange-500`},pptx:{name:`presentation`,className:`text-orange-500`},key:{name:`presentation`,className:`text-orange-500`},json:{name:`json`,className:`text-amber-500`},jsonc:{name:`json`,className:`text-amber-500`},json5:{name:`json`,className:`text-amber-500`},yaml:{name:`code`,className:`text-violet-500`},yml:{name:`code`,className:`text-violet-500`},toml:{name:`config`,className:`text-zinc-500`},ini:{name:`config`,className:`text-zinc-500`},env:{name:`security`,className:`text-lime-600`},lock:{name:`security`,className:`text-lime-600`},ts:{name:`code`,className:`text-blue-500`},tsx:{name:`code`,className:`text-cyan-500`},js:{name:`code`,className:`text-yellow-500`},jsx:{name:`code`,className:`text-sky-500`},mjs:{name:`code`,className:`text-yellow-500`},cjs:{name:`code`,className:`text-yellow-500`},py:{name:`code`,className:`text-green-600`},rb:{name:`code`,className:`text-red-500`},php:{name:`code`,className:`text-indigo-500`},java:{name:`code`,className:`text-orange-600`},kt:{name:`code`,className:`text-purple-500`},swift:{name:`code`,className:`text-orange-500`},go:{name:`code`,className:`text-cyan-600`},rs:{name:`code`,className:`text-orange-700`},c:{name:`code`,className:`text-slate-500`},h:{name:`code`,className:`text-slate-500`},cpp:{name:`code`,className:`text-blue-600`},cxx:{name:`code`,className:`text-blue-600`},cc:{name:`code`,className:`text-blue-600`},hpp:{name:`code`,className:`text-blue-600`},cs:{name:`code`,className:`text-violet-600`},sh:{name:`config`,className:`text-emerald-500`},bash:{name:`config`,className:`text-emerald-500`},zsh:{name:`config`,className:`text-emerald-500`},fish:{name:`config`,className:`text-emerald-500`},sql:{name:`data`,className:`text-fuchsia-500`},html:{name:`web`,className:`text-orange-500`},htm:{name:`web`,className:`text-orange-500`},css:{name:`code`,className:`text-blue-500`},scss:{name:`code`,className:`text-pink-500`},sass:{name:`code`,className:`text-pink-500`},less:{name:`code`,className:`text-indigo-500`},xml:{name:`code`,className:`text-orange-500`},zip:{name:`archive`,className:`text-amber-700`},tar:{name:`archive`,className:`text-amber-700`},gz:{name:`archive`,className:`text-amber-700`},tgz:{name:`archive`,className:`text-amber-700`},rar:{name:`archive`,className:`text-amber-700`},"7z":{name:`archive`,className:`text-amber-700`}};function an(e){let t=en(e);return rn[t]||(Xt.has(t)?{name:`image`,className:`text-pink-500`}:Zt.has(t)?{name:`video`,className:`text-purple-500`}:Qt.has(t)?{name:`audio`,className:`text-green-500`}:{name:`file`,className:`text-muted-foreground`})}function on(e){let t=e.toLowerCase();return t.includes(`token`)||t.includes(`password`)||t.includes(`key`)}var sn=`https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/managing-your-personal-access-tokens`,cn=`https://docs.gitlab.com/user/profile/personal_access_tokens/`,ln=`https://support.atlassian.com/bitbucket-cloud/docs/app-passwords/`,un=`https://git-scm.com/docs/gitcredentials`;function B(e){let t=e.trim().toLowerCase();return t===`github.com`||t.endsWith(`.github.com`)?{host:e,name:`GitHub`,secretLabel:`Personal Access Token (Classic)`,secretHelpTitle:`How to get a Personal Access Token`,secretHelpUrl:sn}:t===`gitlab.com`||t.endsWith(`.gitlab.com`)?{host:e,name:`GitLab`,secretLabel:`Personal Access Token`,secretHelpTitle:`How to get a Personal Access Token`,secretHelpUrl:cn}:t===`bitbucket.org`||t.endsWith(`.bitbucket.org`)?{host:e,name:`Bitbucket`,secretLabel:`App Password`,secretHelpTitle:`How to get an App Password`,secretHelpUrl:ln}:{host:e,name:e,secretLabel:`Password / Token`,secretHelpTitle:`How to get a Personal Access Token`,secretHelpUrl:un}}var dn=`primary`,fn=1440;function pn(e){return e<fn}function mn(e){if(!e||typeof e.closest!=`function`)return!1;let t=e;return t.closest(`.electrobun-webkit-app-region-drag`)!==null&&t.closest(`.electrobun-webkit-app-region-no-drag`)===null}var hn=[{from:`#FCD1F5`,to:`#EFBBF0`},{from:`#EFBBF0`,to:`#B795E4`},{from:`#B795E4`,to:`#97A5EE`},{from:`#97A5EE`,to:`#95DFF2`},{from:`#B7EDF7`,to:`#B4DAF9`},{from:`#B4DAF9`,to:`#FEDBEC`},{from:`#FEDBEC`,to:`#F8B1D3`},{from:`#F8B1D3`,to:`#FFF1C2`},{from:`#CEFFC4`,to:`#B3F9FF`},{from:`#B3F9FF`,to:`#B9D4FF`},{from:`#B9D4FF`,to:`#FFD1FF`},{from:`#F770E5`,to:`#FF8ECC`},{from:`#FF8ECC`,to:`#FFAEBD`},{from:`#FFAEBD`,to:`#FFC897`},{from:`#FFC897`,to:`#FFE791`},{from:`#B1E0F3`,to:`#72DDF7`},{from:`#72DDF7`,to:`#79B8F4`},{from:`#79B8F4`,to:`#8093F1`},{from:`#D8CAF6`,to:`#C2A9EF`},{from:`#C2A9EF`,to:`#AC88E8`},{from:`#AC88E8`,to:`#9667E0`},{from:`#9BF6FF`,to:`#CAFFBF`},{from:`#CAFFBF`,to:`#FDFFB6`},{from:`#FDFFB6`,to:`#FFD6A5`},{from:`#FFD6A5`,to:`#FFADAD`},{from:`#FFAAFF`,to:`#7FB0FF`}],gn={from:`#B2FFA3`,to:`#94F6FF`};function _n(e){let t=e.trim();if(!t)return gn;let n=t.charCodeAt(0),r=n>=97&&n<=122?n-32:n;return r>=65&&r<=90?hn[r-65]??gn:hn[n%hn.length]??gn}function vn(e){let{from:t,to:n}=_n(e);return`linear-gradient(145deg, ${t}, ${n})`}var yn=[`security`,`feature`,`fix`,`important`],bn=[`#EF4444`,`#F97316`,`#EAB308`,`#22C55E`,`#14B8A6`,`#06B6D4`,`#3B82F6`,`#8B5CF6`,`#EC4899`,`#78716C`],xn=/[\p{Cc}\p{Cf}]/u;function Sn(e){return e.trim().replace(/\s+/g,` `)}function Cn(e){return e.toLowerCase()}function wn(e){return e?Array.from(e).length>40?`Tag name must be 40 characters or fewer`:xn.test(e)?`Tag name must not contain control characters`:null:`Tag name is required`}function Tn(e){let t=2166136261;for(let n=0;n<e.length;n++)t^=e.charCodeAt(n),t=Math.imul(t,16777619);return t>>>0}function En(e){return bn[Tn(e)%bn.length]??bn[0]}var Dn=[`reload`,`go_back`,`go_forward`,`get_state`,`set_viewport`];function On(e){return Dn.includes(e)}function kn(e){return e===`changes`||e===`open-pr`||e===`update-pr`||e===`no-pr`?e:e===!0?`changes`:!1}function An(e){return e===`open-pr`||e===`update-pr`||e===`no-pr`}function jn(e){return e===`open-pr`||e===`update-pr`}function Mn(e){switch(e){case`changes`:return`Uncommitted changes on this branch`;case`open-pr`:return`Open pull request`;case`update-pr`:return`Unpushed commits on open pull request`;case`no-pr`:return`Committed changes, no pull request yet`;default:return}}var Nn=`custom-`;function Pn(e){return e.startsWith(Nn)}function Fn(e,t){return typeof e==`string`?{stack:e}:t?{stack:t}:{}}function In(e,t){return typeof e==`string`?e:t}function Ln(e){let t=e.toJSON;if(typeof t!=`function`)return null;let n=t.call(e);return typeof n==`object`&&n&&!Array.isArray(n)?n:null}function Rn(e,t){return{...t,name:In(t.name,e.name),message:In(t.message,e.message),...Fn(t.stack,e.stack)}}function zn(e){return{name:e.name,message:e.message,...Fn(void 0,e.stack)}}function Bn(e){let t=Ln(e);return t?Rn(e,t):zn(e)}function Vn(){let e=new WeakSet;return function(t,n){if(n instanceof Error)return Bn(n);if(typeof n==`object`&&n){if(e.has(n))return`[circular]`;e.add(n)}return n}}function Hn(e,t=new WeakMap){if(e instanceof Error)return Bn(e);if(typeof e!=`object`||!e)return e;let n=t.get(e);if(n!==void 0)return n;if(Array.isArray(e)){let n=[];t.set(e,n);for(let r of e)n.push(Hn(r,t));return n}let r={};t.set(e,r);for(let[n,i]of Object.entries(e))r[n]=Hn(i,t);return r}var V;(function(e){e[e.DEBUG=0]=`DEBUG`,e[e.INFO=1]=`INFO`,e[e.WARN=2]=`WARN`,e[e.ERROR=3]=`ERROR`,e[e.SILENT=4]=`SILENT`})(V||={});var Un=5e3,Wn=V.INFO,Gn={[V.DEBUG]:`DEBUG`,[V.INFO]:`INFO`,[V.WARN]:`WARN`,[V.ERROR]:`ERROR`};function Kn(e){return e===V.DEBUG||e===V.INFO||e===V.WARN||e===V.ERROR?Gn[e]:`UNKNOWN`}var qn=V.INFO,Jn=[],Yn=1,Xn=[],Zn=new Set;function Qn(e){Jn.push(e)}function $n(e){for(let t of Zn)try{t(e)}catch{}}function er(e){if(e.level<Wn||e.level>=V.SILENT)return;let t={...e,id:Yn++};Xn.push(t),Xn.length>5e3&&Xn.splice(0,Xn.length-Un),$n({type:`entry`,entry:t})}function tr(e){try{return JSON.stringify(e,Vn())}catch{return`[non-serializable]`}}var nr={[V.DEBUG]:`debug`,[V.INFO]:`info`,[V.WARN]:`warn`,[V.ERROR]:`error`};function rr(e){let t=nr[e.level],n=`[${e.event}]`;e.data===void 0?console[t](n,e.message):console[t](n,e.message,typeof e.data==`string`?e.data:tr(e.data));for(let t of Jn)try{t(e)}catch{}}function ir(e){return e instanceof Error?{error:Bn(e)}:Hn(e)}function ar(e){function t(t,n,r){let i=t>=Wn&&t<V.SILENT,a=t>=qn;if(!i&&!a)return;let o={ts:new Date().toISOString(),level:t,event:e,message:n,...r===void 0?{}:{data:ir(r)}};i&&er(o),a&&rr(o)}return{debug:(e,n)=>t(V.DEBUG,e,n),info:(e,n)=>t(V.INFO,e,n),warn:(e,n)=>t(V.WARN,e,n),error:(e,n)=>t(V.ERROR,e,n)}}V.DEBUG,V.INFO,V.WARN,V.ERROR;function or(e){let t=Array.from(e,e=>e.toString(16).padStart(2,`0`)).join(``);return`${t.slice(0,8)}-${t.slice(8,12)}-${t.slice(12,16)}-${t.slice(16,20)}-${t.slice(20)}`}function sr(){let e=globalThis.crypto;if(!e?.getRandomValues)throw Error(`crypto.getRandomValues is unavailable`);let t=new Uint8Array(16);return e.getRandomValues(t),t[6]=t[6]&15|64,t[8]=t[8]&63|128,or(t)}function cr(){let e=globalThis.crypto?.randomUUID;return typeof e==`function`?e.call(globalThis.crypto):sr()}var lr=`projectPath`,ur=`vscode`;function dr(e){let t=e.startsWith(`?`)?e.slice(1):e;return new URLSearchParams(t).get(`host`)===`vscode`?ur:null}function fr(e){let t=e.startsWith(`?`)?e.slice(1):e;return new URLSearchParams(t).get(lr)||null}var H=`STREAM_REPETITION`,pr=`The model was stuck repeating itself, so the run was stopped.`,mr=`TOOL_MARKUP_LEAK`,U=`The model's output broke down (it leaked raw tool-call markup), so the run was stopped.`;Math.max(...[`<arg_key>`,`</arg_key>`,`<arg_value>`,`</arg_value>`,`<tool_call>`,`</tool_call>`,`<|tool▁calls▁begin|>`,`<|tool▁call▁begin|>`,`<|tool▁sep|>`,`<|tool_calls_section_begin|>`,`<|tool_call_begin|>`,`<|im_start|>`,`<|im_end|>`].map(e=>e.length));var hr=Object.entries({stopped:`stopped before it replied.`,stream_repetition:`stopped because the model was stuck repeating.`,failed:`failed before it replied.`,empty:`finished with no reply.`}),W=/^(.+?) \(`([^`]+)`(?:, (.+))?\)$/;function gr(e){return e.outcome===`answer`?`${e.projectName} returned a response`:e.outcome===`stopped`?`${e.projectName} stopped before it replied`:e.outcome===`stream_repetition`?`${e.projectName} stopped (stuck repeating)`:e.outcome===`failed`?`${e.projectName} failed before it replied`:`${e.projectName} finished with no reply`}function _r(e){if(typeof e!=`string`)return null;let t=e.trim(),n=t.indexOf(`**:`);if(!t.startsWith(`From **`)||n===-1)return null;let r=t.slice(7,n),i=W.exec(r);if(!i)return null;let[,a,o,s]=i,c=t.slice(n+3).trim(),l={projectName:a,conversationId:o,label:s??null};if(!c)return{outcome:`empty`,...l,answerText:``};for(let[e,t]of hr)if(c===t)return{outcome:e,...l,answerText:``};return{outcome:`answer`,...l,answerText:c}}var vr=/^(\d{3})\s*:\s*([\s\S]+)$/,G=new Set([`provider returned error`,`error`]);function yr(e){let t=e.trim();if(!t)return t;let n=br(t);if(n)return n;let r=t.match(vr);if(r){let e=r[1],t=K(Sr(r[2]?.trim()??``));if(t)return t;if(e===`429`)return`This model is temporarily rate-limited. Please retry shortly.`}return K(Sr(t))||t}function br(e){let t=e.lastIndexOf(`}`);if(t===-1||t>=e.length-1)return;let n=e.slice(t+1).trim();if(!n||n.startsWith(`{`)||n.startsWith(`[`))return;let r=e.slice(0,t+1).trim();if(!vr.test(r))return;let i=r.match(vr);if(!(!i||Sr(i[2]?.trim()??``)===void 0))return n}function K(e){if(!e||typeof e!=`object`)return;let t=e,n=xr(t.metadata);if(n)return n;if(t.error&&typeof t.error==`object`){let e=K(t.error);if(e)return e}if(typeof t.message==`string`){let e=t.message.trim();if(e&&!G.has(e.toLowerCase()))return e}if(t.code===429||t.code===`429`)return`This model is temporarily rate-limited. Please retry shortly.`}function xr(e){if(!e||typeof e!=`object`)return;let t=e;if(typeof t.raw==`string`&&t.raw.trim())return t.raw.trim();if(Array.isArray(t.previouserrors))for(let e of t.previouserrors){if(!e||typeof e!=`object`)continue;let t=e.raw;if(typeof t==`string`&&t.trim())return t.trim()}}function Sr(e){if(e)try{return JSON.parse(e)}catch{return}}var Cr=e((e=>{Object.defineProperty(e,"__esModule",{value:!0})})),q=e((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.CronField=void 0,e.CronField=class e{#e=!1;#t=!1;#n=!1;#r=[];options={rawValue:``};static get min(){throw Error(`min must be overridden`)}static get max(){throw Error(`max must be overridden`)}static get chars(){return Object.freeze([])}static get validChars(){return/^[?,*\dH/-]+$|^.*H\(\d+-\d+\)\/\d+.*$|^.*H\(\d+-\d+\).*$|^.*H\/\d+.*$/}static get constraints(){return{min:this.min,max:this.max,chars:this.chars,validChars:this.validChars}}constructor(t,n={rawValue:``}){if(!Array.isArray(t))throw Error(`${this.constructor.name} Validation error, values is not an array`);if(!(t.length>0))throw Error(`${this.constructor.name} Validation error, values contains no values`);this.options={...n,rawValue:n.rawValue??``},this.#r=[...t].sort(e.sorter),this.#n=this.options.wildcard===void 0?this.#i():this.options.wildcard,this.#e=this.options.rawValue.includes(`L`)||t.includes(`L`),this.#t=this.options.rawValue.includes(`?`)||t.includes(`?`)}get min(){return this.constructor.min}get max(){return this.constructor.max}get chars(){return this.constructor.chars}get hasLastChar(){return this.#e}get hasQuestionMarkChar(){return this.#t}get isWildcard(){return this.#n}get values(){return this.#r}static sorter(e,t){let n=typeof e==`number`,r=typeof t==`number`;return n&&r?e-t:!n&&!r?e.localeCompare(t):n?-1:1}static findNearestValueInList(e,t,n){if(n){for(let n=e.length-1;n>=0;n--)if(e[n]<t)return e[n];return null}for(let n=0;n<e.length;n++)if(e[n]>t)return e[n];return null}findNearestValue(e,t){return this.constructor.findNearestValueInList(this.values,e,t)}serialize(){return{wildcard:this.#n,values:this.#r}}validate(){let e,t=this.chars.length>0?` or chars ${this.chars.join(``)}`:``,n=e=>t=>RegExp(`^\\d{0,2}${t}$`).test(e);if(!this.#r.every(t=>(e=t,typeof t==`number`?t>=this.min&&t<=this.max:this.chars.some(n(t)))))throw Error(`${this.constructor.name} Validation error, got value ${e} expected range ${this.min}-${this.max}${t}`);let r=this.#r.find((e,t)=>this.#r.indexOf(e)!==t);if(r)throw Error(`${this.constructor.name} Validation error, duplicate values found: ${r}`)}#i(){return this.options.rawValue.length>0?[`*`,`?`].includes(this.options.rawValue):Array.from({length:this.max-this.min+1},(e,t)=>t+this.min).every(e=>this.#r.includes(e))}}})),wr=e((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.CronDayOfMonth=void 0;var t=q(),n=1,r=31,i=Object.freeze([`L`]);e.CronDayOfMonth=class extends t.CronField{static get min(){return n}static get max(){return r}static get chars(){return i}static get validChars(){return/^[?,*\dLH/-]+$|^.*H\(\d+-\d+\)\/\d+.*$|^.*H\(\d+-\d+\).*$|^.*H\/\d+.*$/}constructor(e,t){super(e,t),this.validate()}get values(){return super.values}}})),J=e((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.CronDayOfWeek=void 0;var t=q(),n=0,r=7,i=Object.freeze([`L`]);e.CronDayOfWeek=class extends t.CronField{static get min(){return n}static get max(){return r}static get chars(){return i}static get validChars(){return/^[?,*\dLH#/-]+$|^.*H\(\d+-\d+\)\/\d+.*$|^.*H\(\d+-\d+\).*$|^.*H\/\d+.*$/}constructor(e,t){if(super(e,t),this.validate(),this.values.some(e=>e===`L`))throw Error(`${this.constructor.name} Validation error, unexpected standalone L`)}get values(){return super.values}get nthDay(){return this.options.nthDayOfWeek??0}}})),Tr=e((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.CronHour=void 0;var t=q(),n=0,r=23,i=Object.freeze([]);e.CronHour=class extends t.CronField{static get min(){return n}static get max(){return r}static get chars(){return i}constructor(e,t){super(e,t),this.validate()}get values(){return super.values}}})),Er=e((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.CronMinute=void 0;var t=q(),n=0,r=59,i=Object.freeze([]);e.CronMinute=class extends t.CronField{static get min(){return n}static get max(){return r}static get chars(){return i}constructor(e,t){super(e,t),this.validate()}get values(){return super.values}}})),Dr=e((e=>{Object.defineProperty(e,"__esModule",{value:!0});var t=class extends Error{},n=class extends t{constructor(e){super(`Invalid DateTime: ${e.toMessage()}`)}},r=class extends t{constructor(e){super(`Invalid Interval: ${e.toMessage()}`)}},i=class extends t{constructor(e){super(`Invalid Duration: ${e.toMessage()}`)}},a=class extends t{},o=class extends t{constructor(e){super(`Invalid unit ${e}`)}},s=class extends t{},c=class extends t{constructor(){super(`Zone is an abstract class`)}},l=`numeric`,u=`short`,d=`long`,f={year:l,month:l,day:l},p={year:l,month:u,day:l},m={year:l,month:u,day:l,weekday:u},ee={year:l,month:d,day:l},h={year:l,month:d,day:l,weekday:d},g={hour:l,minute:l},_={hour:l,minute:l,second:l},v={hour:l,minute:l,second:l,timeZoneName:u},y={hour:l,minute:l,second:l,timeZoneName:d},b={hour:l,minute:l,hourCycle:`h23`},te={hour:l,minute:l,second:l,hourCycle:`h23`},ne={hour:l,minute:l,second:l,hourCycle:`h23`,timeZoneName:u},x={hour:l,minute:l,second:l,hourCycle:`h23`,timeZoneName:d},re={year:l,month:l,day:l,hour:l,minute:l},ie={year:l,month:l,day:l,hour:l,minute:l,second:l},ae={year:l,month:u,day:l,hour:l,minute:l},oe={year:l,month:u,day:l,hour:l,minute:l,second:l},se={year:l,month:u,day:l,weekday:u,hour:l,minute:l},ce={year:l,month:d,day:l,hour:l,minute:l,timeZoneName:u},le={year:l,month:d,day:l,hour:l,minute:l,second:l,timeZoneName:u},ue={year:l,month:d,day:l,weekday:d,hour:l,minute:l,timeZoneName:d},de={year:l,month:d,day:l,weekday:d,hour:l,minute:l,second:l,timeZoneName:d},fe=class{get type(){throw new c}get name(){throw new c}get ianaName(){return this.name}get isUniversal(){throw new c}offsetName(e,t){throw new c}formatOffset(e,t){throw new c}offset(e){throw new c}equals(e){throw new c}get isValid(){throw new c}},pe=null,me=class e extends fe{static get instance(){return pe===null&&(pe=new e),pe}get type(){return`system`}get name(){return new Intl.DateTimeFormat().resolvedOptions().timeZone}get isUniversal(){return!1}offsetName(e,{format:t,locale:n}){return Rt(e,t,n)}formatOffset(e,t){return Ht(this.offset(e),t)}offset(e){return-new Date(e).getTimezoneOffset()}equals(e){return e.type===`system`}get isValid(){return!0}},he=new Map;function ge(e){let t=he.get(e);return t===void 0&&(t=new Intl.DateTimeFormat(`en-US`,{hour12:!1,timeZone:e,year:`numeric`,month:`2-digit`,day:`2-digit`,hour:`2-digit`,minute:`2-digit`,second:`2-digit`,era:`short`}),he.set(e,t)),t}var _e={year:0,month:1,day:2,era:3,hour:4,minute:5,second:6};function ve(e,t){let n=e.format(t).replace(/\u200E/g,``),[,r,i,a,o,s,c,l]=/(\d+)\/(\d+)\/(\d+) (AD|BC),? (\d+):(\d+):(\d+)/.exec(n);return[a,r,i,o,s,c,l]}function ye(e,t){let n=e.formatToParts(t),r=[];for(let e=0;e<n.length;e++){let{type:t,value:i}=n[e],a=_e[t];t===`era`?r[a]=i:N(a)||(r[a]=parseInt(i,10))}return r}var S=new Map,C=class e extends fe{static create(t){let n=S.get(t);return n===void 0&&S.set(t,n=new e(t)),n}static resetCache(){S.clear(),he.clear()}static isValidSpecifier(e){return this.isValidZone(e)}static isValidZone(e){if(!e)return!1;try{return new Intl.DateTimeFormat(`en-US`,{timeZone:e}).format(),!0}catch{return!1}}constructor(t){super(),this.zoneName=t,this.valid=e.isValidZone(t)}get type(){return`iana`}get name(){return this.zoneName}get isUniversal(){return!1}offsetName(e,{format:t,locale:n}){return Rt(e,t,n,this.name)}formatOffset(e,t){return Ht(this.offset(e),t)}offset(e){if(!this.valid)return NaN;let t=new Date(e);if(isNaN(t))return NaN;let n=ge(this.name),[r,i,a,o,s,c,l]=n.formatToParts?ye(n,t):ve(n,t);o===`BC`&&(r=-Math.abs(r)+1);let u=Pt({year:r,month:i,day:a,hour:s===24?0:s,minute:c,second:l,millisecond:0}),d=+t,f=d%1e3;return d-=f>=0?f:1e3+f,(u-d)/(60*1e3)}equals(e){return e.type===`iana`&&e.name===this.name}get isValid(){return this.valid}},be={};function xe(e,t={}){let n=JSON.stringify([e,t]),r=be[n];return r||(r=new Intl.ListFormat(e,t),be[n]=r),r}var Se=new Map;function Ce(e,t={}){let n=JSON.stringify([e,t]),r=Se.get(n);return r===void 0&&(r=new Intl.DateTimeFormat(e,t),Se.set(n,r)),r}var we=new Map;function Te(e,t={}){let n=JSON.stringify([e,t]),r=we.get(n);return r===void 0&&(r=new Intl.NumberFormat(e,t),we.set(n,r)),r}var Ee=new Map;function De(e,t={}){let{base:n,...r}=t,i=JSON.stringify([e,r]),a=Ee.get(i);return a===void 0&&(a=new Intl.RelativeTimeFormat(e,t),Ee.set(i,a)),a}var Oe=null;function ke(){return Oe||(Oe=new Intl.DateTimeFormat().resolvedOptions().locale,Oe)}var Ae=new Map;function je(e){let t=Ae.get(e);return t===void 0&&(t=new Intl.DateTimeFormat(e).resolvedOptions(),Ae.set(e,t)),t}var Me=new Map;function Ne(e){let t=Me.get(e);if(!t){let n=new Intl.Locale(e);t=`getWeekInfo`in n?n.getWeekInfo():n.weekInfo,`minimalDays`in t||(t={...Ue,...t}),Me.set(e,t)}return t}function Pe(e){let t=e.indexOf(`-x-`);t!==-1&&(e=e.substring(0,t));let n=e.indexOf(`-u-`);if(n===-1)return[e];{let t,r;try{t=Ce(e).resolvedOptions(),r=e}catch{let i=e.substring(0,n);t=Ce(i).resolvedOptions(),r=i}let{numberingSystem:i,calendar:a}=t;return[r,i,a]}}function Fe(e,t,n){return n||t?(e.includes(`-u-`)||(e+=`-u`),n&&(e+=`-ca-${n}`),t&&(e+=`-nu-${t}`),e):e}function Ie(e){let t=[];for(let n=1;n<=12;n++){let r=$.utc(2009,n,1);t.push(e(r))}return t}function Le(e){let t=[];for(let n=1;n<=7;n++){let r=$.utc(2016,11,13+n);t.push(e(r))}return t}function Re(e,t,n,r){let i=e.listingMode();return i===`error`?null:i===`en`?n(t):r(t)}function ze(e){return e.numberingSystem&&e.numberingSystem!==`latn`?!1:e.numberingSystem===`latn`||!e.locale||e.locale.startsWith(`en`)||je(e.locale).numberingSystem===`latn`}var Be=class{constructor(e,t,n){this.padTo=n.padTo||0,this.floor=n.floor||!1;let{padTo:r,floor:i,...a}=n;if(!t||Object.keys(a).length>0){let t={useGrouping:!1,...n};n.padTo>0&&(t.minimumIntegerDigits=n.padTo),this.inf=Te(e,t)}}format(e){if(this.inf){let t=this.floor?Math.floor(e):e;return this.inf.format(t)}else return L(this.floor?Math.floor(e):At(e,3),this.padTo)}},Ve=class{constructor(e,t,n){this.opts=n,this.originalZone=void 0;let r;if(this.opts.timeZone)this.dt=e;else if(e.zone.type===`fixed`){let t=-1*(e.offset/60),n=t>=0?`Etc/GMT+${t}`:`Etc/GMT${t}`;e.offset!==0&&C.create(n).valid?(r=n,this.dt=e):(r=`UTC`,this.dt=e.offset===0?e:e.setZone(`UTC`).plus({minutes:e.offset}),this.originalZone=e.zone)}else e.zone.type===`system`?this.dt=e:e.zone.type===`iana`?(this.dt=e,r=e.zone.name):(r=`UTC`,this.dt=e.setZone(`UTC`).plus({minutes:e.offset}),this.originalZone=e.zone);let i={...this.opts};i.timeZone=i.timeZone||r,this.dtf=Ce(t,i)}format(){return this.originalZone?this.formatToParts().map(({value:e})=>e).join(``):this.dtf.format(this.dt.toJSDate())}formatToParts(){let e=this.dtf.formatToParts(this.dt.toJSDate());return this.originalZone?e.map(e=>{if(e.type===`timeZoneName`){let t=this.originalZone.offsetName(this.dt.ts,{locale:this.dt.locale,format:this.opts.timeZoneName});return{...e,value:t}}else return e}):e}resolvedOptions(){return this.dtf.resolvedOptions()}},He=class{constructor(e,t,n){this.opts={style:`long`,...n},!t&&St()&&(this.rtf=De(e,n))}format(e,t){return this.rtf?this.rtf.format(e,t):cn(t,e,this.opts.numeric,this.opts.style!==`long`)}formatToParts(e,t){return this.rtf?this.rtf.formatToParts(e,t):[]}},Ue={firstDay:1,minimalDays:4,weekend:[6,7]},w=class e{static fromOpts(t){return e.create(t.locale,t.numberingSystem,t.outputCalendar,t.weekSettings,t.defaultToEN)}static create(t,n,r,i,a=!1){let o=t||O.defaultLocale;return new e(o||(a?`en-US`:ke()),n||O.defaultNumberingSystem,r||O.defaultOutputCalendar,Dt(i)||O.defaultWeekSettings,o)}static resetCache(){Oe=null,Se.clear(),we.clear(),Ee.clear(),Ae.clear(),Me.clear()}static fromObject({locale:t,numberingSystem:n,outputCalendar:r,weekSettings:i}={}){return e.create(t,n,r,i)}constructor(e,t,n,r,i){let[a,o,s]=Pe(e);this.locale=a,this.numberingSystem=t||o||null,this.outputCalendar=n||s||null,this.weekSettings=r,this.intl=Fe(this.locale,this.numberingSystem,this.outputCalendar),this.weekdaysCache={format:{},standalone:{}},this.monthsCache={format:{},standalone:{}},this.meridiemCache=null,this.eraCache={},this.specifiedLocale=i,this.fastNumbersCached=null}get fastNumbers(){return this.fastNumbersCached??=ze(this),this.fastNumbersCached}listingMode(){let e=this.isEnglish(),t=(this.numberingSystem===null||this.numberingSystem===`latn`)&&(this.outputCalendar===null||this.outputCalendar===`gregory`);return e&&t?`en`:`intl`}clone(t){return!t||Object.getOwnPropertyNames(t).length===0?this:e.create(t.locale||this.specifiedLocale,t.numberingSystem||this.numberingSystem,t.outputCalendar||this.outputCalendar,Dt(t.weekSettings)||this.weekSettings,t.defaultToEN||!1)}redefaultToEN(e={}){return this.clone({...e,defaultToEN:!0})}redefaultToSystem(e={}){return this.clone({...e,defaultToEN:!1})}months(e,t=!1){return Re(this,e,qt,()=>{let n=this.intl===`ja`||this.intl.startsWith(`ja-`);t&=!n;let r=t?{month:e,day:`numeric`}:{month:e},i=t?`format`:`standalone`;if(!this.monthsCache[i][e]){let t=n?e=>this.dtFormatter(e,r).format():e=>this.extract(e,r,`month`);this.monthsCache[i][e]=Ie(t)}return this.monthsCache[i][e]})}weekdays(e,t=!1){return Re(this,e,Zt,()=>{let n=t?{weekday:e,year:`numeric`,month:`long`,day:`numeric`}:{weekday:e},r=t?`format`:`standalone`;return this.weekdaysCache[r][e]||(this.weekdaysCache[r][e]=Le(e=>this.extract(e,n,`weekday`))),this.weekdaysCache[r][e]})}meridiems(){return Re(this,void 0,()=>Qt,()=>{if(!this.meridiemCache){let e={hour:`numeric`,hourCycle:`h12`};this.meridiemCache=[$.utc(2016,11,13,9),$.utc(2016,11,13,19)].map(t=>this.extract(t,e,`dayperiod`))}return this.meridiemCache})}eras(e){return Re(this,e,nn,()=>{let t={era:e};return this.eraCache[e]||(this.eraCache[e]=[$.utc(-40,1,1),$.utc(2017,1,1)].map(e=>this.extract(e,t,`era`))),this.eraCache[e]})}extract(e,t,n){let r=this.dtFormatter(e,t).formatToParts().find(e=>e.type.toLowerCase()===n);return r?r.value:null}numberFormatter(e={}){return new Be(this.intl,e.forceSimple||this.fastNumbers,e)}dtFormatter(e,t={}){return new Ve(e,this.intl,t)}relFormatter(e={}){return new He(this.intl,this.isEnglish(),e)}listFormatter(e={}){return xe(this.intl,e)}isEnglish(){return this.locale===`en`||this.locale.toLowerCase()===`en-us`||je(this.intl).locale.startsWith(`en-us`)}getWeekSettings(){return this.weekSettings?this.weekSettings:Ct()?Ne(this.locale):Ue}getStartOfWeek(){return this.getWeekSettings().firstDay}getMinDaysInFirstWeek(){return this.getWeekSettings().minimalDays}getWeekendDays(){return this.getWeekSettings().weekend}equals(e){return this.locale===e.locale&&this.numberingSystem===e.numberingSystem&&this.outputCalendar===e.outputCalendar}toString(){return`Locale(${this.locale}, ${this.numberingSystem}, ${this.outputCalendar})`}},We=null,T=class e extends fe{static get utcInstance(){return We===null&&(We=new e(0)),We}static instance(t){return t===0?e.utcInstance:new e(t)}static parseSpecifier(t){if(t){let n=t.match(/^utc(?:([+-]\d{1,2})(?::(\d{2}))?)?$/i);if(n)return new e(zt(n[1],n[2]))}return null}constructor(e){super(),this.fixed=e}get type(){return`fixed`}get name(){return this.fixed===0?`UTC`:`UTC${Ht(this.fixed,`narrow`)}`}get ianaName(){return this.fixed===0?`Etc/UTC`:`Etc/GMT${Ht(-this.fixed,`narrow`)}`}offsetName(){return this.name}formatOffset(e,t){return Ht(this.fixed,t)}get isUniversal(){return!0}offset(){return this.fixed}equals(e){return e.type===`fixed`&&e.fixed===this.fixed}get isValid(){return!0}},Ge=class extends fe{constructor(e){super(),this.zoneName=e}get type(){return`invalid`}get name(){return this.zoneName}get isUniversal(){return!1}offsetName(){return null}formatOffset(){return``}offset(){return NaN}equals(){return!1}get isValid(){return!1}};function E(e,t){if(N(e)||e===null)return t;if(e instanceof fe)return e;if(bt(e)){let n=e.toLowerCase();return n==="default"?t:n===`local`||n===`system`?me.instance:n===`utc`||n===`gmt`?T.utcInstance:T.parseSpecifier(n)||C.create(e)}else if(P(e))return T.instance(e);else if(typeof e==`object`&&`offset`in e&&typeof e.offset==`function`)return e;else return new Ge(e)}var Ke={arab:`[٠-٩]`,arabext:`[۰-۹]`,bali:`[᭐-᭙]`,beng:`[০-৯]`,deva:`[०-९]`,fullwide:`[0-9]`,gujr:`[૦-૯]`,hanidec:`[〇|一|二|三|四|五|六|七|八|九]`,khmr:`[០-៩]`,knda:`[೦-೯]`,laoo:`[໐-໙]`,limb:`[᥆-᥏]`,mlym:`[൦-൯]`,mong:`[᠐-᠙]`,mymr:`[၀-၉]`,orya:`[୦-୯]`,tamldec:`[௦-௯]`,telu:`[౦-౯]`,thai:`[๐-๙]`,tibt:`[༠-༩]`,latn:`\\d`},qe={arab:[1632,1641],arabext:[1776,1785],bali:[6992,7001],beng:[2534,2543],deva:[2406,2415],fullwide:[65296,65303],gujr:[2790,2799],khmr:[6112,6121],knda:[3302,3311],laoo:[3792,3801],limb:[6470,6479],mlym:[3430,3439],mong:[6160,6169],mymr:[4160,4169],orya:[2918,2927],tamldec:[3046,3055],telu:[3174,3183],thai:[3664,3673],tibt:[3872,3881]},Je=Ke.hanidec.replace(/[\[|\]]/g,``).split(``);function Ye(e){let t=parseInt(e,10);if(isNaN(t)){t=``;for(let n=0;n<e.length;n++){let r=e.charCodeAt(n);if(e[n].search(Ke.hanidec)!==-1)t+=Je.indexOf(e[n]);else for(let e in qe){let[n,i]=qe[e];r>=n&&r<=i&&(t+=r-n)}}return parseInt(t,10)}else return t}var Xe=new Map;function Ze(){Xe.clear()}function D({numberingSystem:e},t=``){let n=e||`latn`,r=Xe.get(n);r===void 0&&(r=new Map,Xe.set(n,r));let i=r.get(t);return i===void 0&&(i=RegExp(`${Ke[n]}${t}`),r.set(t,i)),i}var Qe=()=>Date.now(),$e=`system`,et=null,tt=null,nt=null,rt=60,it,at=null,O=class{static get now(){return Qe}static set now(e){Qe=e}static set defaultZone(e){$e=e}static get defaultZone(){return E($e,me.instance)}static get defaultLocale(){return et}static set defaultLocale(e){et=e}static get defaultNumberingSystem(){return tt}static set defaultNumberingSystem(e){tt=e}static get defaultOutputCalendar(){return nt}static set defaultOutputCalendar(e){nt=e}static get defaultWeekSettings(){return at}static set defaultWeekSettings(e){at=Dt(e)}static get twoDigitCutoffYear(){return rt}static set twoDigitCutoffYear(e){rt=e%100}static get throwOnInvalid(){return it}static set throwOnInvalid(e){it=e}static resetCaches(){w.resetCache(),C.resetCache(),$.resetCache(),Ze()}},k=class{constructor(e,t){this.reason=e,this.explanation=t}toMessage(){return this.explanation?`${this.reason}: ${this.explanation}`:this.reason}},ot=[0,31,59,90,120,151,181,212,243,273,304,334],st=[0,31,60,91,121,152,182,213,244,274,305,335];function A(e,t){return new k(`unit out of range`,`you specified ${t} (of type ${typeof t}) as a ${e}, which is invalid`)}function ct(e,t,n){let r=new Date(Date.UTC(e,t-1,n));e<100&&e>=0&&r.setUTCFullYear(r.getUTCFullYear()-1900);let i=r.getUTCDay();return i===0?7:i}function lt(e,t,n){return n+(jt(e)?st:ot)[t-1]}function j(e,t){let n=jt(e)?st:ot,r=n.findIndex(e=>e<t),i=t-n[r];return{month:r+1,day:i}}function ut(e,t){return(e-t+7)%7+1}function dt(e,t=4,n=1){let{year:r,month:i,day:a}=e,o=lt(r,i,a),s=ut(ct(r,i,a),n),c=Math.floor((o-s+14-t)/7),l;return c<1?(l=r-1,c=It(l,t,n)):c>It(r,t,n)?(l=r+1,c=1):l=r,{weekYear:l,weekNumber:c,weekday:s,...Ut(e)}}function M(e,t=4,n=1){let{weekYear:r,weekNumber:i,weekday:a}=e,o=ut(ct(r,1,t),n),s=Mt(r),c=i*7+a-o-7+t,l;c<1?(l=r-1,c+=Mt(l)):c>s?(l=r+1,c-=Mt(r)):l=r;let{month:u,day:d}=j(l,c);return{year:l,month:u,day:d,...Ut(e)}}function ft(e){let{year:t,month:n,day:r}=e;return{year:t,ordinal:lt(t,n,r),...Ut(e)}}function pt(e){let{year:t,ordinal:n}=e,{month:r,day:i}=j(t,n);return{year:t,month:r,day:i,...Ut(e)}}function mt(e,t){if(!N(e.localWeekday)||!N(e.localWeekNumber)||!N(e.localWeekYear)){if(!N(e.weekday)||!N(e.weekNumber)||!N(e.weekYear))throw new a(`Cannot mix locale-based week fields with ISO-based week fields`);return N(e.localWeekday)||(e.weekday=e.localWeekday),N(e.localWeekNumber)||(e.weekNumber=e.localWeekNumber),N(e.localWeekYear)||(e.weekYear=e.localWeekYear),delete e.localWeekday,delete e.localWeekNumber,delete e.localWeekYear,{minDaysInFirstWeek:t.getMinDaysInFirstWeek(),startOfWeek:t.getStartOfWeek()}}else return{minDaysInFirstWeek:4,startOfWeek:1}}function ht(e,t=4,n=1){let r=yt(e.weekYear),i=I(e.weekNumber,1,It(e.weekYear,t,n)),a=I(e.weekday,1,7);return r?i?a?!1:A(`weekday`,e.weekday):A(`week`,e.weekNumber):A(`weekYear`,e.weekYear)}function gt(e){let t=yt(e.year),n=I(e.ordinal,1,Mt(e.year));return t?n?!1:A(`ordinal`,e.ordinal):A(`year`,e.year)}function _t(e){let t=yt(e.year),n=I(e.month,1,12),r=I(e.day,1,Nt(e.year,e.month));return t?n?r?!1:A(`day`,e.day):A(`month`,e.month):A(`year`,e.year)}function vt(e){let{hour:t,minute:n,second:r,millisecond:i}=e,a=I(t,0,23)||t===24&&n===0&&r===0&&i===0,o=I(n,0,59),s=I(r,0,59),c=I(i,0,999);return a?o?s?c?!1:A(`millisecond`,i):A(`second`,r):A(`minute`,n):A(`hour`,t)}function N(e){return e===void 0}function P(e){return typeof e==`number`}function yt(e){return typeof e==`number`&&e%1==0}function bt(e){return typeof e==`string`}function xt(e){return Object.prototype.toString.call(e)===`[object Date]`}function St(){try{return typeof Intl<`u`&&!!Intl.RelativeTimeFormat}catch{return!1}}function Ct(){try{return typeof Intl<`u`&&!!Intl.Locale&&(`weekInfo`in Intl.Locale.prototype||`getWeekInfo`in Intl.Locale.prototype)}catch{return!1}}function wt(e){return Array.isArray(e)?e:[e]}function Tt(e,t,n){if(e.length!==0)return e.reduce((e,r)=>{let i=[t(r),r];return e&&n(e[0],i[0])===e[0]?e:i},null)[1]}function Et(e,t){return t.reduce((t,n)=>(t[n]=e[n],t),{})}function F(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function Dt(e){if(e==null)return null;if(typeof e!=`object`)throw new s(`Week settings must be an object`);if(!I(e.firstDay,1,7)||!I(e.minimalDays,1,7)||!Array.isArray(e.weekend)||e.weekend.some(e=>!I(e,1,7)))throw new s(`Invalid week settings`);return{firstDay:e.firstDay,minimalDays:e.minimalDays,weekend:Array.from(e.weekend)}}function I(e,t,n){return yt(e)&&e>=t&&e<=n}function Ot(e,t){return e-t*Math.floor(e/t)}function L(e,t=2){let n=e<0,r;return r=n?`-`+(``+-e).padStart(t,`0`):(``+e).padStart(t,`0`),r}function R(e){if(!(N(e)||e===null||e===``))return parseInt(e,10)}function z(e){if(!(N(e)||e===null||e===``))return parseFloat(e)}function kt(e){if(!(N(e)||e===null||e===``)){let t=parseFloat(`0.`+e)*1e3;return Math.floor(t)}}function At(e,t,n=`round`){let r=10**t;switch(n){case`expand`:return e>0?Math.ceil(e*r)/r:Math.floor(e*r)/r;case`trunc`:return Math.trunc(e*r)/r;case`round`:return Math.round(e*r)/r;case`floor`:return Math.floor(e*r)/r;case`ceil`:return Math.ceil(e*r)/r;default:throw RangeError(`Value rounding ${n} is out of range`)}}function jt(e){return e%4==0&&(e%100!=0||e%400==0)}function Mt(e){return jt(e)?366:365}function Nt(e,t){let n=Ot(t-1,12)+1,r=e+(t-n)/12;return n===2?jt(r)?29:28:[31,null,31,30,31,30,31,31,30,31,30,31][n-1]}function Pt(e){let t=Date.UTC(e.year,e.month-1,e.day,e.hour,e.minute,e.second,e.millisecond);return e.year<100&&e.year>=0&&(t=new Date(t),t.setUTCFullYear(e.year,e.month-1,e.day)),+t}function Ft(e,t,n){return-ut(ct(e,1,t),n)+t-1}function It(e,t=4,n=1){let r=Ft(e,t,n),i=Ft(e+1,t,n);return(Mt(e)-r+i)/7}function Lt(e){return e>99?e:e>O.twoDigitCutoffYear?1900+e:2e3+e}function Rt(e,t,n,r=null){let i=new Date(e),a={hourCycle:`h23`,year:`numeric`,month:`2-digit`,day:`2-digit`,hour:`2-digit`,minute:`2-digit`};r&&(a.timeZone=r);let o={timeZoneName:t,...a},s=new Intl.DateTimeFormat(n,o).formatToParts(i).find(e=>e.type.toLowerCase()===`timezonename`);return s?s.value:null}function zt(e,t){let n=parseInt(e,10);Number.isNaN(n)&&(n=0);let r=parseInt(t,10)||0,i=n<0||Object.is(n,-0)?-r:r;return n*60+i}function Bt(e){let t=Number(e);if(typeof e==`boolean`||e===``||!Number.isFinite(t))throw new s(`Invalid unit value ${e}`);return t}function Vt(e,t){let n={};for(let r in e)if(F(e,r)){let i=e[r];if(i==null)continue;n[t(r)]=Bt(i)}return n}function Ht(e,t){let n=Math.trunc(Math.abs(e/60)),r=Math.trunc(Math.abs(e%60)),i=e>=0?`+`:`-`;switch(t){case`short`:return`${i}${L(n,2)}:${L(r,2)}`;case`narrow`:return`${i}${n}${r>0?`:${r}`:``}`;case`techie`:return`${i}${L(n,2)}${L(r,2)}`;default:throw RangeError(`Value format ${t} is out of range for property format`)}}function Ut(e){return Et(e,[`hour`,`minute`,`second`,`millisecond`])}var Wt=[`January`,`February`,`March`,`April`,`May`,`June`,`July`,`August`,`September`,`October`,`November`,`December`],Gt=[`Jan`,`Feb`,`Mar`,`Apr`,`May`,`Jun`,`Jul`,`Aug`,`Sep`,`Oct`,`Nov`,`Dec`],Kt=[`J`,`F`,`M`,`A`,`M`,`J`,`J`,`A`,`S`,`O`,`N`,`D`];function qt(e){switch(e){case`narrow`:return[...Kt];case`short`:return[...Gt];case`long`:return[...Wt];case`numeric`:return[`1`,`2`,`3`,`4`,`5`,`6`,`7`,`8`,`9`,`10`,`11`,`12`];case`2-digit`:return[`01`,`02`,`03`,`04`,`05`,`06`,`07`,`08`,`09`,`10`,`11`,`12`];default:return null}}var Jt=[`Monday`,`Tuesday`,`Wednesday`,`Thursday`,`Friday`,`Saturday`,`Sunday`],Yt=[`Mon`,`Tue`,`Wed`,`Thu`,`Fri`,`Sat`,`Sun`],Xt=[`M`,`T`,`W`,`T`,`F`,`S`,`S`];function Zt(e){switch(e){case`narrow`:return[...Xt];case`short`:return[...Yt];case`long`:return[...Jt];case`numeric`:return[`1`,`2`,`3`,`4`,`5`,`6`,`7`];default:return null}}var Qt=[`AM`,`PM`],$t=[`Before Christ`,`Anno Domini`],en=[`BC`,`AD`],tn=[`B`,`A`];function nn(e){switch(e){case`narrow`:return[...tn];case`short`:return[...en];case`long`:return[...$t];default:return null}}function rn(e){return Qt[e.hour<12?0:1]}function an(e,t){return Zt(t)[e.weekday-1]}function on(e,t){return qt(t)[e.month-1]}function sn(e,t){return nn(t)[e.year<0?0:1]}function cn(e,t,n=`always`,r=!1){let i={years:[`year`,`yr.`],quarters:[`quarter`,`qtr.`],months:[`month`,`mo.`],weeks:[`week`,`wk.`],days:[`day`,`day`,`days`],hours:[`hour`,`hr.`],minutes:[`minute`,`min.`],seconds:[`second`,`sec.`]},a=[`hours`,`minutes`,`seconds`].indexOf(e)===-1;if(n===`auto`&&a){let n=e===`days`;switch(t){case 1:return n?`tomorrow`:`next ${i[e][0]}`;case-1:return n?`yesterday`:`last ${i[e][0]}`;case 0:return n?`today`:`this ${i[e][0]}`}}let o=Object.is(t,-0)||t<0,s=Math.abs(t),c=s===1,l=i[e],u=r?c?l[1]:l[2]||l[1]:c?i[e][0]:e;return o?`${s} ${u} ago`:`in ${s} ${u}`}function ln(e,t){let n=``;for(let r of e)r.literal?n+=r.val:n+=t(r.val);return n}var un={D:f,DD:p,DDD:ee,DDDD:h,t:g,tt:_,ttt:v,tttt:y,T:b,TT:te,TTT:ne,TTTT:x,f:re,ff:ae,fff:ce,ffff:ue,F:ie,FF:oe,FFF:le,FFFF:de},B=class e{static create(t,n={}){return new e(t,n)}static parseFormat(e){let t=null,n=``,r=!1,i=[];for(let a=0;a<e.length;a++){let o=e.charAt(a);o===`'`?((n.length>0||r)&&i.push({literal:r||/^\s+$/.test(n),val:n===``?`'`:n}),t=null,n=``,r=!r):r||o===t?n+=o:(n.length>0&&i.push({literal:/^\s+$/.test(n),val:n}),n=o,t=o)}return n.length>0&&i.push({literal:r||/^\s+$/.test(n),val:n}),i}static macroTokenToFormatOpts(e){return un[e]}constructor(e,t){this.opts=t,this.loc=e,this.systemLoc=null}formatWithSystemDefault(e,t){return this.systemLoc===null&&(this.systemLoc=this.loc.redefaultToSystem()),this.systemLoc.dtFormatter(e,{...this.opts,...t}).format()}dtFormatter(e,t={}){return this.loc.dtFormatter(e,{...this.opts,...t})}formatDateTime(e,t){return this.dtFormatter(e,t).format()}formatDateTimeParts(e,t){return this.dtFormatter(e,t).formatToParts()}formatInterval(e,t){return this.dtFormatter(e.start,t).dtf.formatRange(e.start.toJSDate(),e.end.toJSDate())}resolvedOptions(e,t){return this.dtFormatter(e,t).resolvedOptions()}num(e,t=0,n=void 0){if(this.opts.forceSimple)return L(e,t);let r={...this.opts};return t>0&&(r.padTo=t),n&&(r.signDisplay=n),this.loc.numberFormatter(r).format(e)}formatDateTimeFromString(t,n){let r=this.loc.listingMode()===`en`,i=this.loc.outputCalendar&&this.loc.outputCalendar!==`gregory`,a=(e,n)=>this.loc.extract(t,e,n),o=e=>t.isOffsetFixed&&t.offset===0&&e.allowZ?`Z`:t.isValid?t.zone.formatOffset(t.ts,e.format):``,s=()=>r?rn(t):a({hour:`numeric`,hourCycle:`h12`},`dayperiod`),c=(e,n)=>r?on(t,e):a(n?{month:e}:{month:e,day:`numeric`},`month`),l=(e,n)=>r?an(t,e):a(n?{weekday:e}:{weekday:e,month:`long`,day:`numeric`},`weekday`),u=n=>{let r=e.macroTokenToFormatOpts(n);return r?this.formatWithSystemDefault(t,r):n},d=e=>r?sn(t,e):a({era:e},`era`);return ln(e.parseFormat(n),e=>{switch(e){case`S`:return this.num(t.millisecond);case`u`:case`SSS`:return this.num(t.millisecond,3);case`s`:return this.num(t.second);case`ss`:return this.num(t.second,2);case`uu`:return this.num(Math.floor(t.millisecond/10),2);case`uuu`:return this.num(Math.floor(t.millisecond/100));case`m`:return this.num(t.minute);case`mm`:return this.num(t.minute,2);case`h`:return this.num(t.hour%12==0?12:t.hour%12);case`hh`:return this.num(t.hour%12==0?12:t.hour%12,2);case`H`:return this.num(t.hour);case`HH`:return this.num(t.hour,2);case`Z`:return o({format:`narrow`,allowZ:this.opts.allowZ});case`ZZ`:return o({format:`short`,allowZ:this.opts.allowZ});case`ZZZ`:return o({format:`techie`,allowZ:this.opts.allowZ});case`ZZZZ`:return t.zone.offsetName(t.ts,{format:`short`,locale:this.loc.locale});case`ZZZZZ`:return t.zone.offsetName(t.ts,{format:`long`,locale:this.loc.locale});case`z`:return t.zoneName;case`a`:return s();case`d`:return i?a({day:`numeric`},`day`):this.num(t.day);case`dd`:return i?a({day:`2-digit`},`day`):this.num(t.day,2);case`c`:return this.num(t.weekday);case`ccc`:return l(`short`,!0);case`cccc`:return l(`long`,!0);case`ccccc`:return l(`narrow`,!0);case`E`:return this.num(t.weekday);case`EEE`:return l(`short`,!1);case`EEEE`:return l(`long`,!1);case`EEEEE`:return l(`narrow`,!1);case`L`:return i?a({month:`numeric`,day:`numeric`},`month`):this.num(t.month);case`LL`:return i?a({month:`2-digit`,day:`numeric`},`month`):this.num(t.month,2);case`LLL`:return c(`short`,!0);case`LLLL`:return c(`long`,!0);case`LLLLL`:return c(`narrow`,!0);case`M`:return i?a({month:`numeric`},`month`):this.num(t.month);case`MM`:return i?a({month:`2-digit`},`month`):this.num(t.month,2);case`MMM`:return c(`short`,!1);case`MMMM`:return c(`long`,!1);case`MMMMM`:return c(`narrow`,!1);case`y`:return i?a({year:`numeric`},`year`):this.num(t.year);case`yy`:return i?a({year:`2-digit`},`year`):this.num(t.year.toString().slice(-2),2);case`yyyy`:return i?a({year:`numeric`},`year`):this.num(t.year,4);case`yyyyyy`:return i?a({year:`numeric`},`year`):this.num(t.year,6);case`G`:return d(`short`);case`GG`:return d(`long`);case`GGGGG`:return d(`narrow`);case`kk`:return this.num(t.weekYear.toString().slice(-2),2);case`kkkk`:return this.num(t.weekYear,4);case`W`:return this.num(t.weekNumber);case`WW`:return this.num(t.weekNumber,2);case`n`:return this.num(t.localWeekNumber);case`nn`:return this.num(t.localWeekNumber,2);case`ii`:return this.num(t.localWeekYear.toString().slice(-2),2);case`iiii`:return this.num(t.localWeekYear,4);case`o`:return this.num(t.ordinal);case`ooo`:return this.num(t.ordinal,3);case`q`:return this.num(t.quarter);case`qq`:return this.num(t.quarter,2);case`X`:return this.num(Math.floor(t.ts/1e3));case`x`:return this.num(t.ts);default:return u(e)}})}formatDurationFromString(t,n){let r=this.opts.signMode===`negativeLargestOnly`?-1:1,i=e=>{switch(e[0]){case`S`:return`milliseconds`;case`s`:return`seconds`;case`m`:return`minutes`;case`h`:return`hours`;case`d`:return`days`;case`w`:return`weeks`;case`M`:return`months`;case`y`:return`years`;default:return null}},a=(e,t)=>n=>{let a=i(n);if(a){let i=t.isNegativeDuration&&a!==t.largestUnit?r:1,o;return o=this.opts.signMode===`negativeLargestOnly`&&a!==t.largestUnit?`never`:this.opts.signMode===`all`?`always`:`auto`,this.num(e.get(a)*i,n.length,o)}else return n},o=e.parseFormat(n),s=o.reduce((e,{literal:t,val:n})=>t?e:e.concat(n),[]),c=t.shiftTo(...s.map(i).filter(e=>e));return ln(o,a(c,{isNegativeDuration:c<0,largestUnit:Object.keys(c.values)[0]}))}},dn=/[A-Za-z_+-]{1,256}(?::?\/[A-Za-z0-9_+-]{1,256}(?:\/[A-Za-z0-9_+-]{1,256})?)?/;function fn(...e){let t=e.reduce((e,t)=>e+t.source,``);return RegExp(`^${t}$`)}function pn(...e){return t=>e.reduce(([e,n,r],i)=>{let[a,o,s]=i(t,r);return[{...e,...a},o||n,s]},[{},null,1]).slice(0,2)}function mn(e,...t){if(e==null)return[null,null];for(let[n,r]of t){let t=n.exec(e);if(t)return r(t)}return[null,null]}function hn(...e){return(t,n)=>{let r={},i;for(i=0;i<e.length;i++)r[e[i]]=R(t[n+i]);return[r,null,n+i]}}var gn=/(?:([Zz])|([+-]\d\d)(?::?(\d\d))?)/,_n=`(?:${gn.source}?(?:\\[(${dn.source})\\])?)?`,vn=/(\d\d)(?::?(\d\d)(?::?(\d\d)(?:[.,](\d{1,30}))?)?)?/,yn=RegExp(`${vn.source}${_n}`),bn=RegExp(`(?:[Tt]${yn.source})?`),xn=/([+-]\d{6}|\d{4})(?:-?(\d\d)(?:-?(\d\d))?)?/,Sn=/(\d{4})-?W(\d\d)(?:-?(\d))?/,Cn=/(\d{4})-?(\d{3})/,wn=hn(`weekYear`,`weekNumber`,`weekDay`),Tn=hn(`year`,`ordinal`),En=/(\d{4})-(\d\d)-(\d\d)/,Dn=RegExp(`${vn.source} ?(?:${gn.source}|(${dn.source}))?`),On=RegExp(`(?: ${Dn.source})?`);function kn(e,t,n){let r=e[t];return N(r)?n:R(r)}function An(e,t){return[{year:kn(e,t),month:kn(e,t+1,1),day:kn(e,t+2,1)},null,t+3]}function jn(e,t){return[{hours:kn(e,t,0),minutes:kn(e,t+1,0),seconds:kn(e,t+2,0),milliseconds:kt(e[t+3])},null,t+4]}function Mn(e,t){let n=!e[t]&&!e[t+1],r=zt(e[t+1],e[t+2]);return[{},n?null:T.instance(r),t+3]}function Nn(e,t){return[{},e[t]?C.create(e[t]):null,t+1]}var Pn=RegExp(`^T?${vn.source}$`),Fn=/^-?P(?:(?:(-?\d{1,20}(?:\.\d{1,20})?)Y)?(?:(-?\d{1,20}(?:\.\d{1,20})?)M)?(?:(-?\d{1,20}(?:\.\d{1,20})?)W)?(?:(-?\d{1,20}(?:\.\d{1,20})?)D)?(?:T(?:(-?\d{1,20}(?:\.\d{1,20})?)H)?(?:(-?\d{1,20}(?:\.\d{1,20})?)M)?(?:(-?\d{1,20})(?:[.,](-?\d{1,20}))?S)?)?)$/;function In(e){let[t,n,r,i,a,o,s,c,l]=e,u=t[0]===`-`,d=c&&c[0]===`-`,f=(e,t=!1)=>e!==void 0&&(t||e&&u)?-e:e;return[{years:f(z(n)),months:f(z(r)),weeks:f(z(i)),days:f(z(a)),hours:f(z(o)),minutes:f(z(s)),seconds:f(z(c),c===`-0`),milliseconds:f(kt(l),d)}]}var Ln={GMT:0,EDT:-240,EST:-300,CDT:-300,CST:-360,MDT:-360,MST:-420,PDT:-420,PST:-480};function Rn(e,t,n,r,i,a,o){let s={year:t.length===2?Lt(R(t)):R(t),month:Gt.indexOf(n)+1,day:R(r),hour:R(i),minute:R(a)};return o&&(s.second=R(o)),e&&(s.weekday=e.length>3?Jt.indexOf(e)+1:Yt.indexOf(e)+1),s}var zn=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|(?:([+-]\d\d)(\d\d)))$/;function Bn(e){let[,t,n,r,i,a,o,s,c,l,u,d]=e,f=Rn(t,i,r,n,a,o,s),p;return p=c?Ln[c]:l?0:zt(u,d),[f,new T(p)]}function Vn(e){return e.replace(/\([^()]*\)|[\n\t]/g,` `).replace(/(\s\s+)/g,` `).trim()}var Hn=/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun), (\d\d) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) (\d{4}) (\d\d):(\d\d):(\d\d) GMT$/,V=/^(Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Sunday), (\d\d)-(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)-(\d\d) (\d\d):(\d\d):(\d\d) GMT$/,Un=/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) ( \d|\d\d) (\d\d):(\d\d):(\d\d) (\d{4})$/;function Wn(e){let[,t,n,r,i,a,o,s]=e;return[Rn(t,i,r,n,a,o,s),T.utcInstance]}function Gn(e){let[,t,n,r,i,a,o,s]=e;return[Rn(t,s,n,r,i,a,o),T.utcInstance]}var Kn=fn(xn,bn),qn=fn(Sn,bn),Jn=fn(Cn,bn),Yn=fn(yn),Xn=pn(An,jn,Mn,Nn),Zn=pn(wn,jn,Mn,Nn),Qn=pn(Tn,jn,Mn,Nn),$n=pn(jn,Mn,Nn);function er(e){return mn(e,[Kn,Xn],[qn,Zn],[Jn,Qn],[Yn,$n])}function tr(e){return mn(Vn(e),[zn,Bn])}function nr(e){return mn(e,[Hn,Wn],[V,Wn],[Un,Gn])}function rr(e){return mn(e,[Fn,In])}var ir=pn(jn);function ar(e){return mn(e,[Pn,ir])}var or=fn(En,On),sr=fn(Dn),cr=pn(jn,Mn,Nn);function lr(e){return mn(e,[or,Xn],[sr,cr])}var ur=`Invalid Duration`,dr={weeks:{days:7,hours:168,minutes:10080,seconds:10080*60,milliseconds:10080*60*1e3},days:{hours:24,minutes:1440,seconds:1440*60,milliseconds:1440*60*1e3},hours:{minutes:60,seconds:3600,milliseconds:3600*1e3},minutes:{seconds:60,milliseconds:60*1e3},seconds:{milliseconds:1e3}},fr={years:{quarters:4,months:12,weeks:52,days:365,hours:365*24,minutes:365*24*60,seconds:365*24*60*60,milliseconds:365*24*60*60*1e3},quarters:{months:3,weeks:13,days:91,hours:2184,minutes:2184*60,seconds:2184*60*60,milliseconds:2184*60*60*1e3},months:{weeks:4,days:30,hours:720,minutes:720*60,seconds:720*60*60,milliseconds:720*60*60*1e3},...dr},H=146097/400,pr=146097/4800,mr={years:{quarters:4,months:12,weeks:H/7,days:H,hours:H*24,minutes:H*24*60,seconds:H*24*60*60,milliseconds:H*24*60*60*1e3},quarters:{months:3,weeks:H/28,days:H/4,hours:H*24/4,minutes:H*24*60/4,seconds:H*24*60*60/4,milliseconds:H*24*60*60*1e3/4},months:{weeks:pr/7,days:pr,hours:pr*24,minutes:pr*24*60,seconds:pr*24*60*60,milliseconds:pr*24*60*60*1e3},...dr},U=[`years`,`quarters`,`months`,`weeks`,`days`,`hours`,`minutes`,`seconds`,`milliseconds`],hr=U.slice(0).reverse();function W(e,t,n=!1){return new G({values:n?t.values:{...e.values,...t.values||{}},loc:e.loc.clone(t.loc),conversionAccuracy:t.conversionAccuracy||e.conversionAccuracy,matrix:t.matrix||e.matrix})}function gr(e,t){let n=t.milliseconds??0;for(let r of hr.slice(1))t[r]&&(n+=t[r]*e[r].milliseconds);return n}function _r(e,t){let n=gr(e,t)<0?-1:1;U.reduceRight((r,i)=>{if(N(t[i]))return r;if(r){let a=t[r]*n,o=e[i][r],s=Math.floor(a/o);t[i]+=s*n,t[r]-=s*o*n}return i},null),U.reduce((n,r)=>{if(N(t[r]))return n;if(n){let i=t[n]%1;t[n]-=i,t[r]+=i*e[n][r]}return r},null)}function vr(e){let t={};for(let[n,r]of Object.entries(e))r!==0&&(t[n]=r);return t}var G=class e{constructor(e){let t=e.conversionAccuracy===`longterm`||!1,n=t?mr:fr;e.matrix&&(n=e.matrix),this.values=e.values,this.loc=e.loc||w.create(),this.conversionAccuracy=t?`longterm`:`casual`,this.invalid=e.invalid||null,this.matrix=n,this.isLuxonDuration=!0}static fromMillis(t,n){return e.fromObject({milliseconds:t},n)}static fromObject(t,n={}){if(typeof t!=`object`||!t)throw new s(`Duration.fromObject: argument expected to be an object, got ${t===null?`null`:typeof t}`);return new e({values:Vt(t,e.normalizeUnit),loc:w.fromObject(n),conversionAccuracy:n.conversionAccuracy,matrix:n.matrix})}static fromDurationLike(t){if(P(t))return e.fromMillis(t);if(e.isDuration(t))return t;if(typeof t==`object`)return e.fromObject(t);throw new s(`Unknown duration argument ${t} of type ${typeof t}`)}static fromISO(t,n){let[r]=rr(t);return r?e.fromObject(r,n):e.invalid(`unparsable`,`the input "${t}" can't be parsed as ISO 8601`)}static fromISOTime(t,n){let[r]=ar(t);return r?e.fromObject(r,n):e.invalid(`unparsable`,`the input "${t}" can't be parsed as ISO 8601`)}static invalid(t,n=null){if(!t)throw new s(`need to specify a reason the Duration is invalid`);let r=t instanceof k?t:new k(t,n);if(O.throwOnInvalid)throw new i(r);return new e({invalid:r})}static normalizeUnit(e){let t={year:`years`,years:`years`,quarter:`quarters`,quarters:`quarters`,month:`months`,months:`months`,week:`weeks`,weeks:`weeks`,day:`days`,days:`days`,hour:`hours`,hours:`hours`,minute:`minutes`,minutes:`minutes`,second:`seconds`,seconds:`seconds`,millisecond:`milliseconds`,milliseconds:`milliseconds`}[e&&e.toLowerCase()];if(!t)throw new o(e);return t}static isDuration(e){return e&&e.isLuxonDuration||!1}get locale(){return this.isValid?this.loc.locale:null}get numberingSystem(){return this.isValid?this.loc.numberingSystem:null}toFormat(e,t={}){let n={...t,floor:t.round!==!1&&t.floor!==!1};return this.isValid?B.create(this.loc,n).formatDurationFromString(this,e):ur}toHuman(e={}){if(!this.isValid)return ur;let t=e.showZeros!==!1,n=U.map(n=>{let r=this.values[n];return N(r)||r===0&&!t?null:this.loc.numberFormatter({style:`unit`,unitDisplay:`long`,...e,unit:n.slice(0,-1)}).format(r)}).filter(e=>e);return this.loc.listFormatter({type:`conjunction`,style:e.listStyle||`narrow`,...e}).format(n)}toObject(){return this.isValid?{...this.values}:{}}toISO(){if(!this.isValid)return null;let e=`P`;return this.years!==0&&(e+=this.years+`Y`),(this.months!==0||this.quarters!==0)&&(e+=this.months+this.quarters*3+`M`),this.weeks!==0&&(e+=this.weeks+`W`),this.days!==0&&(e+=this.days+`D`),(this.hours!==0||this.minutes!==0||this.seconds!==0||this.milliseconds!==0)&&(e+=`T`),this.hours!==0&&(e+=this.hours+`H`),this.minutes!==0&&(e+=this.minutes+`M`),(this.seconds!==0||this.milliseconds!==0)&&(e+=At(this.seconds+this.milliseconds/1e3,3)+`S`),e===`P`&&(e+=`T0S`),e}toISOTime(e={}){if(!this.isValid)return null;let t=this.toMillis();return t<0||t>=864e5?null:(e={suppressMilliseconds:!1,suppressSeconds:!1,includePrefix:!1,format:`extended`,...e,includeOffset:!1},$.fromMillis(t,{zone:`UTC`}).toISOTime(e))}toJSON(){return this.toISO()}toString(){return this.toISO()}[Symbol.for(`nodejs.util.inspect.custom`)](){return this.isValid?`Duration { values: ${JSON.stringify(this.values)} }`:`Duration { Invalid, reason: ${this.invalidReason} }`}toMillis(){return this.isValid?gr(this.matrix,this.values):NaN}valueOf(){return this.toMillis()}plus(t){if(!this.isValid)return this;let n=e.fromDurationLike(t),r={};for(let e of U)(F(n.values,e)||F(this.values,e))&&(r[e]=n.get(e)+this.get(e));return W(this,{values:r},!0)}minus(t){if(!this.isValid)return this;let n=e.fromDurationLike(t);return this.plus(n.negate())}mapUnits(e){if(!this.isValid)return this;let t={};for(let n of Object.keys(this.values))t[n]=Bt(e(this.values[n],n));return W(this,{values:t},!0)}get(t){return this[e.normalizeUnit(t)]}set(t){if(!this.isValid)return this;let n={...this.values,...Vt(t,e.normalizeUnit)};return W(this,{values:n})}reconfigure({locale:e,numberingSystem:t,conversionAccuracy:n,matrix:r}={}){let i={loc:this.loc.clone({locale:e,numberingSystem:t}),matrix:r,conversionAccuracy:n};return W(this,i)}as(e){return this.isValid?this.shiftTo(e).get(e):NaN}normalize(){if(!this.isValid)return this;let e=this.toObject();return _r(this.matrix,e),W(this,{values:e},!0)}rescale(){if(!this.isValid)return this;let e=vr(this.normalize().shiftToAll().toObject());return W(this,{values:e},!0)}shiftTo(...t){if(!this.isValid||t.length===0)return this;t=t.map(t=>e.normalizeUnit(t));let n={},r={},i=this.toObject(),a;for(let e of U)if(t.indexOf(e)>=0){a=e;let t=0;for(let n in r)t+=this.matrix[n][e]*r[n],r[n]=0;P(i[e])&&(t+=i[e]);let o=Math.trunc(t);n[e]=o,r[e]=(t*1e3-o*1e3)/1e3}else P(i[e])&&(r[e]=i[e]);for(let e in r)r[e]!==0&&(n[a]+=e===a?r[e]:r[e]/this.matrix[a][e]);return _r(this.matrix,n),W(this,{values:n},!0)}shiftToAll(){return this.isValid?this.shiftTo(`years`,`months`,`weeks`,`days`,`hours`,`minutes`,`seconds`,`milliseconds`):this}negate(){if(!this.isValid)return this;let e={};for(let t of Object.keys(this.values))e[t]=this.values[t]===0?0:-this.values[t];return W(this,{values:e},!0)}removeZeros(){if(!this.isValid)return this;let e=vr(this.values);return W(this,{values:e},!0)}get years(){return this.isValid?this.values.years||0:NaN}get quarters(){return this.isValid?this.values.quarters||0:NaN}get months(){return this.isValid?this.values.months||0:NaN}get weeks(){return this.isValid?this.values.weeks||0:NaN}get days(){return this.isValid?this.values.days||0:NaN}get hours(){return this.isValid?this.values.hours||0:NaN}get minutes(){return this.isValid?this.values.minutes||0:NaN}get seconds(){return this.isValid?this.values.seconds||0:NaN}get milliseconds(){return this.isValid?this.values.milliseconds||0:NaN}get isValid(){return this.invalid===null}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}equals(e){if(!this.isValid||!e.isValid||!this.loc.equals(e.loc))return!1;function t(e,t){return e===void 0||e===0?t===void 0||t===0:e===t}for(let n of U)if(!t(this.values[n],e.values[n]))return!1;return!0}},yr=`Invalid Interval`;function br(e,t){return!e||!e.isValid?K.invalid(`missing or invalid start`):!t||!t.isValid?K.invalid(`missing or invalid end`):t<e?K.invalid(`end before start`,`The end of an interval must be after its start, but you had start=${e.toISO()} and end=${t.toISO()}`):null}var K=class e{constructor(e){this.s=e.start,this.e=e.end,this.invalid=e.invalid||null,this.isLuxonInterval=!0}static invalid(t,n=null){if(!t)throw new s(`need to specify a reason the Interval is invalid`);let i=t instanceof k?t:new k(t,n);if(O.throwOnInvalid)throw new r(i);return new e({invalid:i})}static fromDateTimes(t,n){let r=_i(t),i=_i(n);return br(r,i)??new e({start:r,end:i})}static after(t,n){let r=G.fromDurationLike(n),i=_i(t);return e.fromDateTimes(i,i.plus(r))}static before(t,n){let r=G.fromDurationLike(n),i=_i(t);return e.fromDateTimes(i.minus(r),i)}static fromISO(t,n){let[r,i]=(t||``).split(`/`,2);if(r&&i){let t,a;try{t=$.fromISO(r,n),a=t.isValid}catch{a=!1}let o,s;try{o=$.fromISO(i,n),s=o.isValid}catch{s=!1}if(a&&s)return e.fromDateTimes(t,o);if(a){let r=G.fromISO(i,n);if(r.isValid)return e.after(t,r)}else if(s){let t=G.fromISO(r,n);if(t.isValid)return e.before(o,t)}}return e.invalid(`unparsable`,`the input "${t}" can't be parsed as ISO 8601`)}static isInterval(e){return e&&e.isLuxonInterval||!1}get start(){return this.isValid?this.s:null}get end(){return this.isValid?this.e:null}get lastDateTime(){return this.isValid&&this.e?this.e.minus(1):null}get isValid(){return this.invalidReason===null}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}length(e=`milliseconds`){return this.isValid?this.toDuration(e).get(e):NaN}count(e=`milliseconds`,t){if(!this.isValid)return NaN;let n=this.start.startOf(e,t),r;return r=t!=null&&t.useLocaleWeeks?this.end.reconfigure({locale:n.locale}):this.end,r=r.startOf(e,t),Math.floor(r.diff(n,e).get(e))+(r.valueOf()!==this.end.valueOf())}hasSame(e){return this.isValid?this.isEmpty()||this.e.minus(1).hasSame(this.s,e):!1}isEmpty(){return this.s.valueOf()===this.e.valueOf()}isAfter(e){return this.isValid?this.s>e:!1}isBefore(e){return this.isValid?this.e<=e:!1}contains(e){return this.isValid?this.s<=e&&this.e>e:!1}set({start:t,end:n}={}){return this.isValid?e.fromDateTimes(t||this.s,n||this.e):this}splitAt(...t){if(!this.isValid)return[];let n=t.map(_i).filter(e=>this.contains(e)).sort((e,t)=>e.toMillis()-t.toMillis()),r=[],{s:i}=this,a=0;for(;i<this.e;){let t=n[a]||this.e,o=+t>+this.e?this.e:t;r.push(e.fromDateTimes(i,o)),i=o,a+=1}return r}splitBy(t){let n=G.fromDurationLike(t);if(!this.isValid||!n.isValid||n.as(`milliseconds`)===0)return[];let{s:r}=this,i=1,a,o=[];for(;r<this.e;){let t=this.start.plus(n.mapUnits(e=>e*i));a=+t>+this.e?this.e:t,o.push(e.fromDateTimes(r,a)),r=a,i+=1}return o}divideEqually(e){return this.isValid?this.splitBy(this.length()/e).slice(0,e):[]}overlaps(e){return this.e>e.s&&this.s<e.e}abutsStart(e){return this.isValid?+this.e==+e.s:!1}abutsEnd(e){return this.isValid?+e.e==+this.s:!1}engulfs(e){return this.isValid?this.s<=e.s&&this.e>=e.e:!1}equals(e){return!this.isValid||!e.isValid?!1:this.s.equals(e.s)&&this.e.equals(e.e)}intersection(t){if(!this.isValid)return this;let n=this.s>t.s?this.s:t.s,r=this.e<t.e?this.e:t.e;return n>=r?null:e.fromDateTimes(n,r)}union(t){if(!this.isValid)return this;let n=this.s<t.s?this.s:t.s,r=this.e>t.e?this.e:t.e;return e.fromDateTimes(n,r)}static merge(e){let[t,n]=e.sort((e,t)=>e.s-t.s).reduce(([e,t],n)=>t?t.overlaps(n)||t.abutsStart(n)?[e,t.union(n)]:[e.concat([t]),n]:[e,n],[[],null]);return n&&t.push(n),t}static xor(t){let n=null,r=0,i=[],a=t.map(e=>[{time:e.s,type:`s`},{time:e.e,type:`e`}]),o=Array.prototype.concat(...a).sort((e,t)=>e.time-t.time);for(let t of o)r+=t.type===`s`?1:-1,r===1?n=t.time:(n&&+n!=+t.time&&i.push(e.fromDateTimes(n,t.time)),n=null);return e.merge(i)}difference(...t){return e.xor([this].concat(t)).map(e=>this.intersection(e)).filter(e=>e&&!e.isEmpty())}toString(){return this.isValid?`[${this.s.toISO()} – ${this.e.toISO()})`:yr}[Symbol.for(`nodejs.util.inspect.custom`)](){return this.isValid?`Interval { start: ${this.s.toISO()}, end: ${this.e.toISO()} }`:`Interval { Invalid, reason: ${this.invalidReason} }`}toLocaleString(e=f,t={}){return this.isValid?B.create(this.s.loc.clone(t),e).formatInterval(this):yr}toISO(e){return this.isValid?`${this.s.toISO(e)}/${this.e.toISO(e)}`:yr}toISODate(){return this.isValid?`${this.s.toISODate()}/${this.e.toISODate()}`:yr}toISOTime(e){return this.isValid?`${this.s.toISOTime(e)}/${this.e.toISOTime(e)}`:yr}toFormat(e,{separator:t=` – `}={}){return this.isValid?`${this.s.toFormat(e)}${t}${this.e.toFormat(e)}`:yr}toDuration(e,t){return this.isValid?this.e.diff(this.s,e,t):G.invalid(this.invalidReason)}mapEndpoints(t){return e.fromDateTimes(t(this.s),t(this.e))}},xr=class{static hasDST(e=O.defaultZone){let t=$.now().setZone(e).set({month:12});return!e.isUniversal&&t.offset!==t.set({month:6}).offset}static isValidIANAZone(e){return C.isValidZone(e)}static normalizeZone(e){return E(e,O.defaultZone)}static getStartOfWeek({locale:e=null,locObj:t=null}={}){return(t||w.create(e)).getStartOfWeek()}static getMinimumDaysInFirstWeek({locale:e=null,locObj:t=null}={}){return(t||w.create(e)).getMinDaysInFirstWeek()}static getWeekendWeekdays({locale:e=null,locObj:t=null}={}){return(t||w.create(e)).getWeekendDays().slice()}static months(e=`long`,{locale:t=null,numberingSystem:n=null,locObj:r=null,outputCalendar:i=`gregory`}={}){return(r||w.create(t,n,i)).months(e)}static monthsFormat(e=`long`,{locale:t=null,numberingSystem:n=null,locObj:r=null,outputCalendar:i=`gregory`}={}){return(r||w.create(t,n,i)).months(e,!0)}static weekdays(e=`long`,{locale:t=null,numberingSystem:n=null,locObj:r=null}={}){return(r||w.create(t,n,null)).weekdays(e)}static weekdaysFormat(e=`long`,{locale:t=null,numberingSystem:n=null,locObj:r=null}={}){return(r||w.create(t,n,null)).weekdays(e,!0)}static meridiems({locale:e=null}={}){return w.create(e).meridiems()}static eras(e=`short`,{locale:t=null}={}){return w.create(t,null,`gregory`).eras(e)}static features(){return{relative:St(),localeWeek:Ct()}}};function Sr(e,t){let n=e=>e.toUTC(0,{keepLocalTime:!0}).startOf(`day`).valueOf(),r=n(t)-n(e);return Math.floor(G.fromMillis(r).as(`days`))}function Cr(e,t,n){let r=[[`years`,(e,t)=>t.year-e.year],[`quarters`,(e,t)=>t.quarter-e.quarter+(t.year-e.year)*4],[`months`,(e,t)=>t.month-e.month+(t.year-e.year)*12],[`weeks`,(e,t)=>{let n=Sr(e,t);return(n-n%7)/7}],[`days`,Sr]],i={},a=e,o,s;for(let[c,l]of r)n.indexOf(c)>=0&&(o=c,i[c]=l(e,t),s=a.plus(i),s>t?(i[c]--,e=a.plus(i),e>t&&(s=e,i[c]--,e=a.plus(i))):e=s);return[e,i,s,o]}function q(e,t,n,r){let[i,a,o,s]=Cr(e,t,n),c=t-i,l=n.filter(e=>[`hours`,`minutes`,`seconds`,`milliseconds`].indexOf(e)>=0);l.length===0&&(o<t&&(o=i.plus({[s]:1})),o!==i&&(a[s]=(a[s]||0)+c/(o-i)));let u=G.fromObject(a,r);return l.length>0?G.fromMillis(c,r).shiftTo(...l).plus(u):u}var wr=`missing Intl.DateTimeFormat.formatToParts support`;function J(e,t=e=>e){return{regex:e,deser:([e])=>t(Ye(e))}}var Tr=`[ \xA0]`,Er=new RegExp(Tr,`g`);function Dr(e){return e.replace(/\./g,`\\.?`).replace(Er,Tr)}function Or(e){return e.replace(/\./g,``).replace(Er,` `).toLowerCase()}function Y(e,t){return e===null?null:{regex:RegExp(e.map(Dr).join(`|`)),deser:([n])=>e.findIndex(e=>Or(n)===Or(e))+t}}function kr(e,t){return{regex:e,deser:([,e,t])=>zt(e,t),groups:t}}function Ar(e){return{regex:e,deser:([e])=>e}}function jr(e){return e.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,`\\$&`)}function Mr(e,t){let n=D(t),r=D(t,`{2}`),i=D(t,`{3}`),a=D(t,`{4}`),o=D(t,`{6}`),s=D(t,`{1,2}`),c=D(t,`{1,3}`),l=D(t,`{1,6}`),u=D(t,`{1,9}`),d=D(t,`{2,4}`),f=D(t,`{4,6}`),p=e=>({regex:RegExp(jr(e.val)),deser:([e])=>e,literal:!0}),m=(m=>{if(e.literal)return p(m);switch(m.val){case`G`:return Y(t.eras(`short`),0);case`GG`:return Y(t.eras(`long`),0);case`y`:return J(l);case`yy`:return J(d,Lt);case`yyyy`:return J(a);case`yyyyy`:return J(f);case`yyyyyy`:return J(o);case`M`:return J(s);case`MM`:return J(r);case`MMM`:return Y(t.months(`short`,!0),1);case`MMMM`:return Y(t.months(`long`,!0),1);case`L`:return J(s);case`LL`:return J(r);case`LLL`:return Y(t.months(`short`,!1),1);case`LLLL`:return Y(t.months(`long`,!1),1);case`d`:return J(s);case`dd`:return J(r);case`o`:return J(c);case`ooo`:return J(i);case`HH`:return J(r);case`H`:return J(s);case`hh`:return J(r);case`h`:return J(s);case`mm`:return J(r);case`m`:return J(s);case`q`:return J(s);case`qq`:return J(r);case`s`:return J(s);case`ss`:return J(r);case`S`:return J(c);case`SSS`:return J(i);case`u`:return Ar(u);case`uu`:return Ar(s);case`uuu`:return J(n);case`a`:return Y(t.meridiems(),0);case`kkkk`:return J(a);case`kk`:return J(d,Lt);case`W`:return J(s);case`WW`:return J(r);case`E`:case`c`:return J(n);case`EEE`:return Y(t.weekdays(`short`,!1),1);case`EEEE`:return Y(t.weekdays(`long`,!1),1);case`ccc`:return Y(t.weekdays(`short`,!0),1);case`cccc`:return Y(t.weekdays(`long`,!0),1);case`Z`:case`ZZ`:return kr(RegExp(`([+-]${s.source})(?::(${r.source}))?`),2);case`ZZZ`:return kr(RegExp(`([+-]${s.source})(${r.source})?`),2);case`z`:return Ar(/[a-z_+-/]{1,256}?/i);case` `:return Ar(/[^\S\n\r]/);default:return p(m)}})(e)||{invalidReason:wr};return m.token=e,m}var Nr={year:{"2-digit":`yy`,numeric:`yyyyy`},month:{numeric:`M`,"2-digit":`MM`,short:`MMM`,long:`MMMM`},day:{numeric:`d`,"2-digit":`dd`},weekday:{short:`EEE`,long:`EEEE`},dayperiod:`a`,dayPeriod:`a`,hour12:{numeric:`h`,"2-digit":`hh`},hour24:{numeric:`H`,"2-digit":`HH`},minute:{numeric:`m`,"2-digit":`mm`},second:{numeric:`s`,"2-digit":`ss`},timeZoneName:{long:`ZZZZZ`,short:`ZZZ`}};function Pr(e,t,n){let{type:r,value:i}=e;if(r===`literal`){let e=/^\s+$/.test(i);return{literal:!e,val:e?` `:i}}let a=t[r],o=r;r===`hour`&&(o=t.hour12==null?t.hourCycle==null?n.hour12?`hour12`:`hour24`:t.hourCycle===`h11`||t.hourCycle===`h12`?`hour12`:`hour24`:t.hour12?`hour12`:`hour24`);let s=Nr[o];if(typeof s==`object`&&(s=s[a]),s)return{literal:!1,val:s}}function Fr(e){return[`^${e.map(e=>e.regex).reduce((e,t)=>`${e}(${t.source})`,``)}$`,e]}function Ir(e,t,n){let r=e.match(t);if(r){let e={},t=1;for(let i in n)if(F(n,i)){let a=n[i],o=a.groups?a.groups+1:1;!a.literal&&a.token&&(e[a.token.val[0]]=a.deser(r.slice(t,t+o))),t+=o}return[r,e]}else return[r,{}]}function Lr(e){let t=e=>{switch(e){case`S`:return`millisecond`;case`s`:return`second`;case`m`:return`minute`;case`h`:case`H`:return`hour`;case`d`:return`day`;case`o`:return`ordinal`;case`L`:case`M`:return`month`;case`y`:return`year`;case`E`:case`c`:return`weekday`;case`W`:return`weekNumber`;case`k`:return`weekYear`;case`q`:return`quarter`;default:return null}},n=null,r;return N(e.z)||(n=C.create(e.z)),N(e.Z)||(n||=new T(e.Z),r=e.Z),N(e.q)||(e.M=(e.q-1)*3+1),N(e.h)||(e.h<12&&e.a===1?e.h+=12:e.h===12&&e.a===0&&(e.h=0)),e.G===0&&e.y&&(e.y=-e.y),N(e.u)||(e.S=kt(e.u)),[Object.keys(e).reduce((n,r)=>{let i=t(r);return i&&(n[i]=e[r]),n},{}),n,r]}var Rr=null;function zr(){return Rr||=$.fromMillis(1555555555555),Rr}function Br(e,t){if(e.literal)return e;let n=Gr(B.macroTokenToFormatOpts(e.val),t);return n==null||n.includes(void 0)?e:n}function Vr(e,t){return Array.prototype.concat(...e.map(e=>Br(e,t)))}var Hr=class{constructor(e,t){if(this.locale=e,this.format=t,this.tokens=Vr(B.parseFormat(t),e),this.units=this.tokens.map(t=>Mr(t,e)),this.disqualifyingUnit=this.units.find(e=>e.invalidReason),!this.disqualifyingUnit){let[e,t]=Fr(this.units);this.regex=RegExp(e,`i`),this.handlers=t}}explainFromTokens(e){if(this.isValid){let[t,n]=Ir(e,this.regex,this.handlers),[r,i,o]=n?Lr(n):[null,null,void 0];if(F(n,`a`)&&F(n,`H`))throw new a(`Can't include meridiem when specifying 24-hour format`);return{input:e,tokens:this.tokens,regex:this.regex,rawMatches:t,matches:n,result:r,zone:i,specificOffset:o}}else return{input:e,tokens:this.tokens,invalidReason:this.invalidReason}}get isValid(){return!this.disqualifyingUnit}get invalidReason(){return this.disqualifyingUnit?this.disqualifyingUnit.invalidReason:null}};function Ur(e,t,n){return new Hr(e,n).explainFromTokens(t)}function Wr(e,t,n){let{result:r,zone:i,specificOffset:a,invalidReason:o}=Ur(e,t,n);return[r,i,a,o]}function Gr(e,t){if(!e)return null;let n=B.create(t,e).dtFormatter(zr()),r=n.formatToParts(),i=n.resolvedOptions();return r.map(t=>Pr(t,e,i))}var Kr=`Invalid DateTime`,qr=864e13;function Jr(e){return new k(`unsupported zone`,`the zone "${e.name}" is not supported`)}function Yr(e){return e.weekData===null&&(e.weekData=dt(e.c)),e.weekData}function Xr(e){return e.localWeekData===null&&(e.localWeekData=dt(e.c,e.loc.getMinDaysInFirstWeek(),e.loc.getStartOfWeek())),e.localWeekData}function X(e,t){let n={ts:e.ts,zone:e.zone,c:e.c,o:e.o,loc:e.loc,invalid:e.invalid};return new $({...n,...t,old:n})}function Zr(e,t,n){let r=e-t*60*1e3,i=n.offset(r);if(t===i)return[r,t];r-=(i-t)*60*1e3;let a=n.offset(r);return i===a?[r,i]:[e-Math.min(i,a)*60*1e3,Math.max(i,a)]}function Qr(e,t){e+=t*60*1e3;let n=new Date(e);return{year:n.getUTCFullYear(),month:n.getUTCMonth()+1,day:n.getUTCDate(),hour:n.getUTCHours(),minute:n.getUTCMinutes(),second:n.getUTCSeconds(),millisecond:n.getUTCMilliseconds()}}function $r(e,t,n){return Zr(Pt(e),t,n)}function ei(e,t){let n=e.o,r=e.c.year+Math.trunc(t.years),i=e.c.month+Math.trunc(t.months)+Math.trunc(t.quarters)*3,a={...e.c,year:r,month:i,day:Math.min(e.c.day,Nt(r,i))+Math.trunc(t.days)+Math.trunc(t.weeks)*7},o=G.fromObject({years:t.years-Math.trunc(t.years),quarters:t.quarters-Math.trunc(t.quarters),months:t.months-Math.trunc(t.months),weeks:t.weeks-Math.trunc(t.weeks),days:t.days-Math.trunc(t.days),hours:t.hours,minutes:t.minutes,seconds:t.seconds,milliseconds:t.milliseconds}).as(`milliseconds`),[s,c]=Zr(Pt(a),n,e.zone);return o!==0&&(s+=o,c=e.zone.offset(s)),{ts:s,o:c}}function Z(e,t,n,r,i,a){let{setZone:o,zone:s}=n;if(e&&Object.keys(e).length!==0||t){let r=t||s,i=$.fromObject(e,{...n,zone:r,specificOffset:a});return o?i:i.setZone(s)}else return $.invalid(new k(`unparsable`,`the input "${i}" can't be parsed as ${r}`))}function ti(e,t,n=!0){return e.isValid?B.create(w.create(`en-US`),{allowZ:n,forceSimple:!0}).formatDateTimeFromString(e,t):null}function ni(e,t,n){let r=e.c.year>9999||e.c.year<0,i=``;if(r&&e.c.year>=0&&(i+=`+`),i+=L(e.c.year,r?6:4),n===`year`)return i;if(t){if(i+=`-`,i+=L(e.c.month),n===`month`)return i;i+=`-`}else if(i+=L(e.c.month),n===`month`)return i;return i+=L(e.c.day),i}function Q(e,t,n,r,i,a,o){let s=!n||e.c.millisecond!==0||e.c.second!==0,c=``;switch(o){case`day`:case`month`:case`year`:break;default:if(c+=L(e.c.hour),o===`hour`)break;if(t){if(c+=`:`,c+=L(e.c.minute),o===`minute`)break;s&&(c+=`:`,c+=L(e.c.second))}else{if(c+=L(e.c.minute),o===`minute`)break;s&&(c+=L(e.c.second))}if(o===`second`)break;s&&(!r||e.c.millisecond!==0)&&(c+=`.`,c+=L(e.c.millisecond,3))}return i&&(e.isOffsetFixed&&e.offset===0&&!a?c+=`Z`:e.o<0?(c+=`-`,c+=L(Math.trunc(-e.o/60)),c+=`:`,c+=L(Math.trunc(-e.o%60))):(c+=`+`,c+=L(Math.trunc(e.o/60)),c+=`:`,c+=L(Math.trunc(e.o%60)))),a&&(c+=`[`+e.zone.ianaName+`]`),c}var ri={month:1,day:1,hour:0,minute:0,second:0,millisecond:0},ii={weekNumber:1,weekday:1,hour:0,minute:0,second:0,millisecond:0},ai={ordinal:1,hour:0,minute:0,second:0,millisecond:0},oi=[`year`,`month`,`day`,`hour`,`minute`,`second`,`millisecond`],si=[`weekYear`,`weekNumber`,`weekday`,`hour`,`minute`,`second`,`millisecond`],ci=[`year`,`ordinal`,`hour`,`minute`,`second`,`millisecond`];function li(e){let t={year:`year`,years:`year`,month:`month`,months:`month`,day:`day`,days:`day`,hour:`hour`,hours:`hour`,minute:`minute`,minutes:`minute`,quarter:`quarter`,quarters:`quarter`,second:`second`,seconds:`second`,millisecond:`millisecond`,milliseconds:`millisecond`,weekday:`weekday`,weekdays:`weekday`,weeknumber:`weekNumber`,weeksnumber:`weekNumber`,weeknumbers:`weekNumber`,weekyear:`weekYear`,weekyears:`weekYear`,ordinal:`ordinal`}[e.toLowerCase()];if(!t)throw new o(e);return t}function ui(e){switch(e.toLowerCase()){case`localweekday`:case`localweekdays`:return`localWeekday`;case`localweeknumber`:case`localweeknumbers`:return`localWeekNumber`;case`localweekyear`:case`localweekyears`:return`localWeekYear`;default:return li(e)}}function di(e){if(hi===void 0&&(hi=O.now()),e.type!==`iana`)return e.offset(hi);let t=e.name,n=gi.get(t);return n===void 0&&(n=e.offset(hi),gi.set(t,n)),n}function fi(e,t){let n=E(t.zone,O.defaultZone);if(!n.isValid)return $.invalid(Jr(n));let r=w.fromObject(t),i,a;if(N(e.year))i=O.now();else{for(let t of oi)N(e[t])&&(e[t]=ri[t]);let t=_t(e)||vt(e);if(t)return $.invalid(t);let r=di(n);[i,a]=$r(e,r,n)}return new $({ts:i,zone:n,loc:r,o:a})}function pi(e,t,n){let r=N(n.round)?!0:n.round,i=N(n.rounding)?`trunc`:n.rounding,a=(e,a)=>(e=At(e,r||n.calendary?0:2,n.calendary?`round`:i),t.loc.clone(n).relFormatter(n).format(e,a)),o=r=>n.calendary?t.hasSame(e,r)?0:t.startOf(r).diff(e.startOf(r),r).get(r):t.diff(e,r).get(r);if(n.unit)return a(o(n.unit),n.unit);for(let e of n.units){let t=o(e);if(Math.abs(t)>=1)return a(t,e)}return a(e>t?-0:0,n.units[n.units.length-1])}function mi(e){let t={},n;return e.length>0&&typeof e[e.length-1]==`object`?(t=e[e.length-1],n=Array.from(e).slice(0,e.length-1)):n=Array.from(e),[t,n]}var hi,gi=new Map,$=class e{constructor(e){let t=e.zone||O.defaultZone,n=e.invalid||(Number.isNaN(e.ts)?new k(`invalid input`):null)||(t.isValid?null:Jr(t));this.ts=N(e.ts)?O.now():e.ts;let r=null,i=null;if(!n)if(e.old&&e.old.ts===this.ts&&e.old.zone.equals(t))[r,i]=[e.old.c,e.old.o];else{let a=P(e.o)&&!e.old?e.o:t.offset(this.ts);r=Qr(this.ts,a),n=Number.isNaN(r.year)?new k(`invalid input`):null,r=n?null:r,i=n?null:a}this._zone=t,this.loc=e.loc||w.create(),this.invalid=n,this.weekData=null,this.localWeekData=null,this.c=r,this.o=i,this.isLuxonDateTime=!0}static now(){return new e({})}static local(){let[e,t]=mi(arguments),[n,r,i,a,o,s,c]=t;return fi({year:n,month:r,day:i,hour:a,minute:o,second:s,millisecond:c},e)}static utc(){let[e,t]=mi(arguments),[n,r,i,a,o,s,c]=t;return e.zone=T.utcInstance,fi({year:n,month:r,day:i,hour:a,minute:o,second:s,millisecond:c},e)}static fromJSDate(t,n={}){let r=xt(t)?t.valueOf():NaN;if(Number.isNaN(r))return e.invalid(`invalid input`);let i=E(n.zone,O.defaultZone);return i.isValid?new e({ts:r,zone:i,loc:w.fromObject(n)}):e.invalid(Jr(i))}static fromMillis(t,n={}){if(!P(t))throw new s(`fromMillis requires a numerical input, but received a ${typeof t} with value ${t}`);return t<-864e13||t>qr?e.invalid(`Timestamp out of range`):new e({ts:t,zone:E(n.zone,O.defaultZone),loc:w.fromObject(n)})}static fromSeconds(t,n={}){if(P(t))return new e({ts:t*1e3,zone:E(n.zone,O.defaultZone),loc:w.fromObject(n)});throw new s(`fromSeconds requires a numerical input`)}static fromObject(t,n={}){t||={};let r=E(n.zone,O.defaultZone);if(!r.isValid)return e.invalid(Jr(r));let i=w.fromObject(n),o=Vt(t,ui),{minDaysInFirstWeek:s,startOfWeek:c}=mt(o,i),l=O.now(),u=N(n.specificOffset)?r.offset(l):n.specificOffset,d=!N(o.ordinal),f=!N(o.year),p=!N(o.month)||!N(o.day),m=f||p,ee=o.weekYear||o.weekNumber;if((m||d)&&ee)throw new a(`Can't mix weekYear/weekNumber units with year/month/day or ordinals`);if(p&&d)throw new a(`Can't mix ordinal dates with month/day`);let h=ee||o.weekday&&!m,g,_,v=Qr(l,u);h?(g=si,_=ii,v=dt(v,s,c)):d?(g=ci,_=ai,v=ft(v)):(g=oi,_=ri);let y=!1;for(let e of g){let t=o[e];N(t)?y?o[e]=_[e]:o[e]=v[e]:y=!0}let b=(h?ht(o,s,c):d?gt(o):_t(o))||vt(o);if(b)return e.invalid(b);let[te,ne]=$r(h?M(o,s,c):d?pt(o):o,u,r),x=new e({ts:te,zone:r,o:ne,loc:i});return o.weekday&&m&&t.weekday!==x.weekday?e.invalid(`mismatched weekday`,`you can't specify both a weekday of ${o.weekday} and a date of ${x.toISO()}`):x.isValid?x:e.invalid(x.invalid)}static fromISO(e,t={}){let[n,r]=er(e);return Z(n,r,t,`ISO 8601`,e)}static fromRFC2822(e,t={}){let[n,r]=tr(e);return Z(n,r,t,`RFC 2822`,e)}static fromHTTP(e,t={}){let[n,r]=nr(e);return Z(n,r,t,`HTTP`,t)}static fromFormat(t,n,r={}){if(N(t)||N(n))throw new s(`fromFormat requires an input string and a format`);let{locale:i=null,numberingSystem:a=null}=r,[o,c,l,u]=Wr(w.fromOpts({locale:i,numberingSystem:a,defaultToEN:!0}),t,n);return u?e.invalid(u):Z(o,c,r,`format ${n}`,t,l)}static fromString(t,n,r={}){return e.fromFormat(t,n,r)}static fromSQL(e,t={}){let[n,r]=lr(e);return Z(n,r,t,`SQL`,e)}static invalid(t,r=null){if(!t)throw new s(`need to specify a reason the DateTime is invalid`);let i=t instanceof k?t:new k(t,r);if(O.throwOnInvalid)throw new n(i);return new e({invalid:i})}static isDateTime(e){return e&&e.isLuxonDateTime||!1}static parseFormatForOpts(e,t={}){let n=Gr(e,w.fromObject(t));return n?n.map(e=>e?e.val:null).join(``):null}static expandFormat(e,t={}){return Vr(B.parseFormat(e),w.fromObject(t)).map(e=>e.val).join(``)}static resetCache(){hi=void 0,gi.clear()}get(e){return this[e]}get isValid(){return this.invalid===null}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}get locale(){return this.isValid?this.loc.locale:null}get numberingSystem(){return this.isValid?this.loc.numberingSystem:null}get outputCalendar(){return this.isValid?this.loc.outputCalendar:null}get zone(){return this._zone}get zoneName(){return this.isValid?this.zone.name:null}get year(){return this.isValid?this.c.year:NaN}get quarter(){return this.isValid?Math.ceil(this.c.month/3):NaN}get month(){return this.isValid?this.c.month:NaN}get day(){return this.isValid?this.c.day:NaN}get hour(){return this.isValid?this.c.hour:NaN}get minute(){return this.isValid?this.c.minute:NaN}get second(){return this.isValid?this.c.second:NaN}get millisecond(){return this.isValid?this.c.millisecond:NaN}get weekYear(){return this.isValid?Yr(this).weekYear:NaN}get weekNumber(){return this.isValid?Yr(this).weekNumber:NaN}get weekday(){return this.isValid?Yr(this).weekday:NaN}get isWeekend(){return this.isValid&&this.loc.getWeekendDays().includes(this.weekday)}get localWeekday(){return this.isValid?Xr(this).weekday:NaN}get localWeekNumber(){return this.isValid?Xr(this).weekNumber:NaN}get localWeekYear(){return this.isValid?Xr(this).weekYear:NaN}get ordinal(){return this.isValid?ft(this.c).ordinal:NaN}get monthShort(){return this.isValid?xr.months(`short`,{locObj:this.loc})[this.month-1]:null}get monthLong(){return this.isValid?xr.months(`long`,{locObj:this.loc})[this.month-1]:null}get weekdayShort(){return this.isValid?xr.weekdays(`short`,{locObj:this.loc})[this.weekday-1]:null}get weekdayLong(){return this.isValid?xr.weekdays(`long`,{locObj:this.loc})[this.weekday-1]:null}get offset(){return this.isValid?+this.o:NaN}get offsetNameShort(){return this.isValid?this.zone.offsetName(this.ts,{format:`short`,locale:this.locale}):null}get offsetNameLong(){return this.isValid?this.zone.offsetName(this.ts,{format:`long`,locale:this.locale}):null}get isOffsetFixed(){return this.isValid?this.zone.isUniversal:null}get isInDST(){return this.isOffsetFixed?!1:this.offset>this.set({month:1,day:1}).offset||this.offset>this.set({month:5}).offset}getPossibleOffsets(){if(!this.isValid||this.isOffsetFixed)return[this];let e=864e5,t=6e4,n=Pt(this.c),r=this.zone.offset(n-e),i=this.zone.offset(n+e),a=this.zone.offset(n-r*t),o=this.zone.offset(n-i*t);if(a===o)return[this];let s=n-a*t,c=n-o*t,l=Qr(s,a),u=Qr(c,o);return l.hour===u.hour&&l.minute===u.minute&&l.second===u.second&&l.millisecond===u.millisecond?[X(this,{ts:s}),X(this,{ts:c})]:[this]}get isInLeapYear(){return jt(this.year)}get daysInMonth(){return Nt(this.year,this.month)}get daysInYear(){return this.isValid?Mt(this.year):NaN}get weeksInWeekYear(){return this.isValid?It(this.weekYear):NaN}get weeksInLocalWeekYear(){return this.isValid?It(this.localWeekYear,this.loc.getMinDaysInFirstWeek(),this.loc.getStartOfWeek()):NaN}resolvedLocaleOptions(e={}){let{locale:t,numberingSystem:n,calendar:r}=B.create(this.loc.clone(e),e).resolvedOptions(this);return{locale:t,numberingSystem:n,outputCalendar:r}}toUTC(e=0,t={}){return this.setZone(T.instance(e),t)}toLocal(){return this.setZone(O.defaultZone)}setZone(t,{keepLocalTime:n=!1,keepCalendarTime:r=!1}={}){if(t=E(t,O.defaultZone),t.equals(this.zone))return this;if(t.isValid){let e=this.ts;if(n||r){let n=t.offset(this.ts),r=this.toObject();[e]=$r(r,n,t)}return X(this,{ts:e,zone:t})}else return e.invalid(Jr(t))}reconfigure({locale:e,numberingSystem:t,outputCalendar:n}={}){let r=this.loc.clone({locale:e,numberingSystem:t,outputCalendar:n});return X(this,{loc:r})}setLocale(e){return this.reconfigure({locale:e})}set(e){if(!this.isValid)return this;let t=Vt(e,ui),{minDaysInFirstWeek:n,startOfWeek:r}=mt(t,this.loc),i=!N(t.weekYear)||!N(t.weekNumber)||!N(t.weekday),o=!N(t.ordinal),s=!N(t.year),c=!N(t.month)||!N(t.day),l=s||c,u=t.weekYear||t.weekNumber;if((l||o)&&u)throw new a(`Can't mix weekYear/weekNumber units with year/month/day or ordinals`);if(c&&o)throw new a(`Can't mix ordinal dates with month/day`);let d;i?d=M({...dt(this.c,n,r),...t},n,r):N(t.ordinal)?(d={...this.toObject(),...t},N(t.day)&&(d.day=Math.min(Nt(d.year,d.month),d.day))):d=pt({...ft(this.c),...t});let[f,p]=$r(d,this.o,this.zone);return X(this,{ts:f,o:p})}plus(e){if(!this.isValid)return this;let t=G.fromDurationLike(e);return X(this,ei(this,t))}minus(e){if(!this.isValid)return this;let t=G.fromDurationLike(e).negate();return X(this,ei(this,t))}startOf(e,{useLocaleWeeks:t=!1}={}){if(!this.isValid)return this;let n={},r=G.normalizeUnit(e);switch(r){case`years`:n.month=1;case`quarters`:case`months`:n.day=1;case`weeks`:case`days`:n.hour=0;case`hours`:n.minute=0;case`minutes`:n.second=0;case`seconds`:n.millisecond=0;break}if(r===`weeks`)if(t){let e=this.loc.getStartOfWeek(),{weekday:t}=this;t<e&&(n.weekNumber=this.weekNumber-1),n.weekday=e}else n.weekday=1;return r===`quarters`&&(n.month=(Math.ceil(this.month/3)-1)*3+1),this.set(n)}endOf(e,t){return this.isValid?this.plus({[e]:1}).startOf(e,t).minus(1):this}toFormat(e,t={}){return this.isValid?B.create(this.loc.redefaultToEN(t)).formatDateTimeFromString(this,e):Kr}toLocaleString(e=f,t={}){return this.isValid?B.create(this.loc.clone(t),e).formatDateTime(this):Kr}toLocaleParts(e={}){return this.isValid?B.create(this.loc.clone(e),e).formatDateTimeParts(this):[]}toISO({format:e=`extended`,suppressSeconds:t=!1,suppressMilliseconds:n=!1,includeOffset:r=!0,extendedZone:i=!1,precision:a=`milliseconds`}={}){if(!this.isValid)return null;a=li(a);let o=e===`extended`,s=ni(this,o,a);return oi.indexOf(a)>=3&&(s+=`T`),s+=Q(this,o,t,n,r,i,a),s}toISODate({format:e=`extended`,precision:t=`day`}={}){return this.isValid?ni(this,e===`extended`,li(t)):null}toISOWeekDate(){return ti(this,`kkkk-'W'WW-c`)}toISOTime({suppressMilliseconds:e=!1,suppressSeconds:t=!1,includeOffset:n=!0,includePrefix:r=!1,extendedZone:i=!1,format:a=`extended`,precision:o=`milliseconds`}={}){return this.isValid?(o=li(o),(r&&oi.indexOf(o)>=3?`T`:``)+Q(this,a===`extended`,t,e,n,i,o)):null}toRFC2822(){return ti(this,`EEE, dd LLL yyyy HH:mm:ss ZZZ`,!1)}toHTTP(){return ti(this.toUTC(),`EEE, dd LLL yyyy HH:mm:ss 'GMT'`)}toSQLDate(){return this.isValid?ni(this,!0):null}toSQLTime({includeOffset:e=!0,includeZone:t=!1,includeOffsetSpace:n=!0}={}){let r=`HH:mm:ss.SSS`;return(t||e)&&(n&&(r+=` `),t?r+=`z`:e&&(r+=`ZZ`)),ti(this,r,!0)}toSQL(e={}){return this.isValid?`${this.toSQLDate()} ${this.toSQLTime(e)}`:null}toString(){return this.isValid?this.toISO():Kr}[Symbol.for(`nodejs.util.inspect.custom`)](){return this.isValid?`DateTime { ts: ${this.toISO()}, zone: ${this.zone.name}, locale: ${this.locale} }`:`DateTime { Invalid, reason: ${this.invalidReason} }`}valueOf(){return this.toMillis()}toMillis(){return this.isValid?this.ts:NaN}toSeconds(){return this.isValid?this.ts/1e3:NaN}toUnixInteger(){return this.isValid?Math.floor(this.ts/1e3):NaN}toJSON(){return this.toISO()}toBSON(){return this.toJSDate()}toObject(e={}){if(!this.isValid)return{};let t={...this.c};return e.includeConfig&&(t.outputCalendar=this.outputCalendar,t.numberingSystem=this.loc.numberingSystem,t.locale=this.loc.locale),t}toJSDate(){return new Date(this.isValid?this.ts:NaN)}diff(e,t=`milliseconds`,n={}){if(!this.isValid||!e.isValid)return G.invalid(`created by diffing an invalid DateTime`);let r={locale:this.locale,numberingSystem:this.numberingSystem,...n},i=wt(t).map(G.normalizeUnit),a=e.valueOf()>this.valueOf(),o=q(a?this:e,a?e:this,i,r);return a?o.negate():o}diffNow(t=`milliseconds`,n={}){return this.diff(e.now(),t,n)}until(e){return this.isValid?K.fromDateTimes(this,e):this}hasSame(e,t,n){if(!this.isValid)return!1;let r=e.valueOf(),i=this.setZone(e.zone,{keepLocalTime:!0});return i.startOf(t,n)<=r&&r<=i.endOf(t,n)}equals(e){return this.isValid&&e.isValid&&this.valueOf()===e.valueOf()&&this.zone.equals(e.zone)&&this.loc.equals(e.loc)}toRelative(t={}){if(!this.isValid)return null;let n=t.base||e.fromObject({},{zone:this.zone}),r=t.padding?this<n?-t.padding:t.padding:0,i=[`years`,`months`,`days`,`hours`,`minutes`,`seconds`],a=t.unit;return Array.isArray(t.unit)&&(i=t.unit,a=void 0),pi(n,this.plus(r),{...t,numeric:`always`,units:i,unit:a})}toRelativeCalendar(t={}){return this.isValid?pi(t.base||e.fromObject({},{zone:this.zone}),this,{...t,numeric:`auto`,units:[`years`,`months`,`days`],calendary:!0}):null}static min(...t){if(!t.every(e.isDateTime))throw new s(`min requires all arguments be DateTimes`);return Tt(t,e=>e.valueOf(),Math.min)}static max(...t){if(!t.every(e.isDateTime))throw new s(`max requires all arguments be DateTimes`);return Tt(t,e=>e.valueOf(),Math.max)}static fromFormatExplain(e,t,n={}){let{locale:r=null,numberingSystem:i=null}=n;return Ur(w.fromOpts({locale:r,numberingSystem:i,defaultToEN:!0}),e,t)}static fromStringExplain(t,n,r={}){return e.fromFormatExplain(t,n,r)}static buildFormatParser(e,t={}){let{locale:n=null,numberingSystem:r=null}=t;return new Hr(w.fromOpts({locale:n,numberingSystem:r,defaultToEN:!0}),e)}static fromFormatParser(t,n,r={}){if(N(t)||N(n))throw new s(`fromFormatParser requires an input string and a format parser`);let{locale:i=null,numberingSystem:a=null}=r,o=w.fromOpts({locale:i,numberingSystem:a,defaultToEN:!0});if(!o.equals(n.locale))throw new s(`fromFormatParser called with a locale of ${o}, but the format parser was created for ${n.locale}`);let{result:c,zone:l,specificOffset:u,invalidReason:d}=n.explainFromTokens(t);return d?e.invalid(d):Z(c,l,r,`format ${n.format}`,t,u)}static get DATE_SHORT(){return f}static get DATE_MED(){return p}static get DATE_MED_WITH_WEEKDAY(){return m}static get DATE_FULL(){return ee}static get DATE_HUGE(){return h}static get TIME_SIMPLE(){return g}static get TIME_WITH_SECONDS(){return _}static get TIME_WITH_SHORT_OFFSET(){return v}static get TIME_WITH_LONG_OFFSET(){return y}static get TIME_24_SIMPLE(){return b}static get TIME_24_WITH_SECONDS(){return te}static get TIME_24_WITH_SHORT_OFFSET(){return ne}static get TIME_24_WITH_LONG_OFFSET(){return x}static get DATETIME_SHORT(){return re}static get DATETIME_SHORT_WITH_SECONDS(){return ie}static get DATETIME_MED(){return ae}static get DATETIME_MED_WITH_SECONDS(){return oe}static get DATETIME_MED_WITH_WEEKDAY(){return se}static get DATETIME_FULL(){return ce}static get DATETIME_FULL_WITH_SECONDS(){return le}static get DATETIME_HUGE(){return ue}static get DATETIME_HUGE_WITH_SECONDS(){return de}};function _i(e){if($.isDateTime(e))return e;if(e&&e.valueOf&&P(e.valueOf()))return $.fromJSDate(e);if(e&&typeof e==`object`)return $.fromObject(e);throw new s(`Unknown datetime argument: ${e}, of type ${typeof e}`)}e.DateTime=$,e.Duration=G,e.FixedOffsetZone=T,e.IANAZone=C,e.Info=xr,e.Interval=K,e.InvalidZone=Ge,e.Settings=O,e.SystemZone=me,e.VERSION=`3.7.2`,e.Zone=fe})),Or=e((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.CronDate=e.DAYS_IN_MONTH=e.DateMathOp=e.TimeUnit=void 0;var t=Dr(),n;(function(e){e.Second=`Second`,e.Minute=`Minute`,e.Hour=`Hour`,e.Day=`Day`,e.Month=`Month`,e.Year=`Year`})(n||(e.TimeUnit=n={}));var r;(function(e){e.Add=`Add`,e.Subtract=`Subtract`})(r||(e.DateMathOp=r={})),e.DAYS_IN_MONTH=Object.freeze([31,29,31,30,31,30,31,31,30,31,30,31]);var i=class i{#e;#t=null;#n=null;constructor(e,n){let r={zone:n};if(e?e instanceof i?(this.#e=e.#e,this.#t=e.#t,this.#n=e.#n):e instanceof Date?this.#e=t.DateTime.fromJSDate(e,r):typeof e==`number`?this.#e=t.DateTime.fromMillis(e,r):(this.#e=t.DateTime.fromISO(e,r),this.#e.isValid||(this.#e=t.DateTime.fromRFC2822(e,r)),this.#e.isValid||(this.#e=t.DateTime.fromSQL(e,r)),this.#e.isValid||(this.#e=t.DateTime.fromFormat(e,`EEE, d MMM yyyy HH:mm:ss`,r))):this.#e=t.DateTime.local(),!this.#e.isValid)throw Error(`CronDate: unhandled timestamp: ${e}`);n&&n!==this.#e.zoneName&&(this.#e=this.#e.setZone(n))}static#r(e){return e%4==0&&e%100!=0||e%400==0}get dstStart(){return this.#t}set dstStart(e){this.#t=e}get dstEnd(){return this.#n}set dstEnd(e){this.#n=e}addYear(){this.#e=this.#e.plus({years:1})}addMonth(){this.#e=this.#e.plus({months:1}).startOf(`month`)}addDay(){this.#e=this.#e.plus({days:1}).startOf(`day`)}addHour(){this.#e=this.#e.plus({hours:1}).startOf(`hour`)}addMinute(){this.#e=this.#e.plus({minutes:1}).startOf(`minute`)}addSecond(){this.#e=this.#e.plus({seconds:1})}subtractYear(){this.#e=this.#e.minus({years:1})}subtractMonth(){this.#e=this.#e.minus({months:1}).endOf(`month`).startOf(`second`)}subtractDay(){this.#e=this.#e.minus({days:1}).endOf(`day`).startOf(`second`)}subtractHour(){this.#e=this.#e.minus({hours:1}).endOf(`hour`).startOf(`second`)}subtractMinute(){this.#e=this.#e.minus({minutes:1}).endOf(`minute`).startOf(`second`)}subtractSecond(){this.#e=this.#e.minus({seconds:1})}addUnit(e){switch(e){case n.Year:return this.addYear();case n.Month:return this.addMonth();case n.Day:return this.addDay();case n.Hour:return this.addHour();case n.Minute:return this.addMinute();case n.Second:return this.addSecond()}}subtractUnit(e){switch(e){case n.Year:return this.subtractYear();case n.Month:return this.subtractMonth();case n.Day:return this.subtractDay();case n.Hour:return this.subtractHour();case n.Minute:return this.subtractMinute();case n.Second:return this.subtractSecond()}}invokeDateOperation(e,t){if(e===r.Add){this.addUnit(t);return}if(e===r.Subtract){this.subtractUnit(t);return}throw Error(`Invalid verb: ${e}`)}getDate(){return this.#e.day}getFullYear(){return this.#e.year}getDay(){let e=this.#e.weekday;return e===7?0:e}getMonth(){return this.#e.month-1}getHours(){return this.#e.hour}getMinutes(){return this.#e.minute}getSeconds(){return this.#e.second}getMilliseconds(){return this.#e.millisecond}getUTCOffset(){return this.#e.offset}setStartOfDay(){this.#e=this.#e.startOf(`day`)}setEndOfDay(){this.#e=this.#e.endOf(`day`)}getTime(){return this.#e.valueOf()}getUTCDate(){return this.#i().day}getUTCFullYear(){return this.#i().year}getUTCDay(){let e=this.#i().weekday;return e===7?0:e}getUTCMonth(){return this.#i().month-1}getUTCHours(){return this.#i().hour}getUTCMinutes(){return this.#i().minute}getUTCSeconds(){return this.#i().second}toISOString(){return this.#e.toUTC().toISO()}toJSON(){return this.#e.toJSON()}setDate(e){this.#e=this.#e.set({day:e})}setFullYear(e){this.#e=this.#e.set({year:e})}setDay(e){this.#e=this.#e.set({weekday:e})}setMonth(e){this.#e=this.#e.set({month:e+1})}setHours(e){this.#e=this.#e.set({hour:e})}setMinutes(e){this.#e=this.#e.set({minute:e})}setSeconds(e){this.#e=this.#e.set({second:e})}setMilliseconds(e){this.#e=this.#e.set({millisecond:e})}toString(){return this.toDate().toString()}toDate(){return this.#e.toJSDate()}isLastDayOfMonth(){let{day:t,month:n}=this.#e;if(n===2){let r=i.#r(this.#e.year);return t===e.DAYS_IN_MONTH[n-1]-+!r}return t===e.DAYS_IN_MONTH[n-1]}isLastWeekdayOfMonth(){let{day:t,month:n}=this.#e,r;return r=n===2?e.DAYS_IN_MONTH[n-1]-+!i.#r(this.#e.year):e.DAYS_IN_MONTH[n-1],t>r-7}applyDateOperation(e,t,r){if(t===n.Month||t===n.Day){this.invokeDateOperation(e,t);return}let i=this.getHours();this.invokeDateOperation(e,t);let a=this.getHours(),o=a-i;o===2?r!==24&&(this.dstStart=i+1):o===0&&this.getMinutes()===0&&this.getSeconds()===0&&r!==24&&(this.dstEnd=a)}#i(){return this.#e.toUTC()}};e.CronDate=i,e.default=i})),Y=e((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.CronMonth=void 0;var t=Or(),n=q(),r=1,i=12,a=Object.freeze([]);e.CronMonth=class extends n.CronField{static get min(){return r}static get max(){return i}static get chars(){return a}static get daysInMonth(){return t.DAYS_IN_MONTH}constructor(e,t){super(e,t),this.validate()}get values(){return super.values}}})),kr=e((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.CronSecond=void 0;var t=q(),n=0,r=59,i=Object.freeze([]);e.CronSecond=class extends t.CronField{static get min(){return n}static get max(){return r}static get chars(){return i}constructor(e,t){super(e,t),this.validate()}get values(){return super.values}}})),Ar=e((e=>{var t=e&&e.__createBinding||(Object.create?(function(e,t,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||(`get`in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}):(function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]})),n=e&&e.__exportStar||function(e,n){for(var r in e)r!=="default"&&!Object.prototype.hasOwnProperty.call(n,r)&&t(n,e,r)};Object.defineProperty(e,"__esModule",{value:!0}),n(Cr(),e),n(wr(),e),n(J(),e),n(q(),e),n(Tr(),e),n(Er(),e),n(Y(),e),n(kr(),e)})),jr=e((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.CronFieldCollection=void 0;var t=Ar();e.CronFieldCollection=class e{#e;#t;#n;#r;#i;#a;static from(n,r){return new e({second:this.resolveField(t.CronSecond,n.second,r.second),minute:this.resolveField(t.CronMinute,n.minute,r.minute),hour:this.resolveField(t.CronHour,n.hour,r.hour),dayOfMonth:this.resolveField(t.CronDayOfMonth,n.dayOfMonth,r.dayOfMonth),month:this.resolveField(t.CronMonth,n.month,r.month),dayOfWeek:this.resolveField(t.CronDayOfWeek,n.dayOfWeek,r.dayOfWeek)})}static resolveField(e,n,r){return r?r instanceof t.CronField?r:new e(r):n}constructor({second:e,minute:n,hour:r,dayOfMonth:i,month:a,dayOfWeek:o}){if(!e)throw Error(`Validation error, Field second is missing`);if(!n)throw Error(`Validation error, Field minute is missing`);if(!r)throw Error(`Validation error, Field hour is missing`);if(!i)throw Error(`Validation error, Field dayOfMonth is missing`);if(!a)throw Error(`Validation error, Field month is missing`);if(!o)throw Error(`Validation error, Field dayOfWeek is missing`);if(a.values.length===1&&!i.hasLastChar&&o.isWildcard&&!(parseInt(i.values[0],10)<=t.CronMonth.daysInMonth[a.values[0]-1]))throw Error(`Invalid explicit day of month definition`);this.#e=e,this.#t=n,this.#n=r,this.#i=a,this.#a=o,this.#r=i}get second(){return this.#e}get minute(){return this.#t}get hour(){return this.#n}get dayOfMonth(){return this.#r}get month(){return this.#i}get dayOfWeek(){return this.#a}static compactField(e){if(e.length===0)return[];let t=[],n;return e.forEach((e,r,i)=>{if(n===void 0){n={start:e,count:1};return}let a=i[r-1]||n.start,o=i[r+1];if(e===`L`||e===`W`){t.push(n),t.push({start:e,count:1}),n=void 0;return}if(n.step===void 0&&o!==void 0){let t=e-a;if(t<=o-e){n={...n,count:2,end:e,step:t};return}n.step=1}e-(n.end??0)===n.step?(n.count++,n.end=e):(n.count===1?t.push({start:n.start,count:1}):n.count===2?(t.push({start:n.start,count:1}),t.push({start:n.end??a,count:1})):t.push(n),n={start:e,count:1})}),n&&t.push(n),t}static#o(e,t,n){let r=t.step;return r?r===1&&t.start===e.min&&t.end&&t.end>=n?e.hasQuestionMarkChar?`?`:`*`:r!==1&&t.start===e.min&&t.end&&t.end>=n-r+1?`*/${r}`:null:null}static#s(e,t){let n=e.step;if(n===1)return`${e.start}-${e.end}`;let r=e.start===0?e.count-1:e.count;if(!n)throw Error(`Unexpected range step`);if(!e.end)throw Error(`Unexpected range end`);if(n*r>e.end){let t=(t,r)=>{if(typeof e.start!=`number`)throw Error(`Unexpected range start`);return r%n===0?e.start+r:null};if(typeof e.start!=`number`)throw Error(`Unexpected range start`);let r={length:e.end-e.start+1};return Array.from(r,t).filter(e=>e!==null).join(`,`)}return e.end===t-n+1?`${e.start}/${n}`:`${e.start}-${e.end}/${n}`}stringifyField(n){let r=n.max,i=n.values;if(n instanceof t.CronDayOfWeek){r=6;let e=this.#a.values;i=e[e.length-1]===7?e.slice(0,-1):e}n instanceof t.CronDayOfMonth&&(r=this.#i.values.length===1?t.CronMonth.daysInMonth[this.#i.values[0]-1]:n.max);let a=e.compactField(i);if(a.length===1){let t=e.#o(n,a[0],r);if(t)return t}return a.map(i=>{let a=i.count===1?i.start.toString():e.#s(i,r);return n instanceof t.CronDayOfWeek&&n.nthDay>0?`${a}#${n.nthDay}`:a}).join(`,`)}stringify(e=!1){let t=[];return e&&t.push(this.stringifyField(this.#e)),t.push(this.stringifyField(this.#t),this.stringifyField(this.#n),this.stringifyField(this.#r),this.stringifyField(this.#i),this.stringifyField(this.#a)),t.join(` `)}serialize(){return{second:this.#e.serialize(),minute:this.#t.serialize(),hour:this.#n.serialize(),dayOfMonth:this.#r.serialize(),month:this.#i.serialize(),dayOfWeek:this.#a.serialize()}}}})),Mr=e((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.CronExpression=e.LOOPS_LIMIT_EXCEEDED_ERROR_MESSAGE=e.TIME_SPAN_OUT_OF_BOUNDS_ERROR_MESSAGE=void 0;var t=Or();e.TIME_SPAN_OUT_OF_BOUNDS_ERROR_MESSAGE=`Out of the time span range`,e.LOOPS_LIMIT_EXCEEDED_ERROR_MESSAGE=`Invalid expression, loop limit exceeded`;var n=1e4,r=class r{#e;#t;#n;#r;#i;#a;#o=null;#s=!1;constructor(e,n){this.#e=n,this.#t=n.tz,this.#r=n.startDate?new t.CronDate(n.startDate,this.#t):null,this.#i=n.endDate?new t.CronDate(n.endDate,this.#t):null;let r=n.currentDate??n.startDate;if(r){let e=new t.CronDate(r,this.#t);this.#r&&e.getTime()<this.#r.getTime()?r=this.#r:this.#i&&e.getTime()>this.#i.getTime()&&(r=this.#i)}this.#n=new t.CronDate(r,this.#t),this.#a=e}get fields(){return this.#a}static fieldsToExpression(e,t){return new r(e,t||{})}static#c(e,t){return t.some(t=>t===e)}#l(e,t){return e[t?e.length-1:0]}#u(e){let n=`${e.getFullYear()}-${e.getMonth()+1}-${e.getDate()}`;if(this.#o===n)return this.#s;let r=new t.CronDate(e);r.setStartOfDay();let i=new t.CronDate(e);return i.setEndOfDay(),this.#o=n,this.#s=r.getUTCOffset()!==i.getUTCOffset(),this.#s}#d(e,n,r){let i=this.#a.second.values,a=e.getSeconds(),o=this.#a.second.findNearestValue(a,r);if(o!==null){e.setSeconds(o);return}e.applyDateOperation(n,t.TimeUnit.Minute,this.#a.hour.values.length),e.setSeconds(this.#l(i,r))}#f(e,n,r){let i=this.#a.minute.values,a=this.#a.second.values,o=e.getMinutes(),s=this.#a.minute.findNearestValue(o,r);if(s!==null){e.setMinutes(s),e.setSeconds(this.#l(a,r));return}e.applyDateOperation(n,t.TimeUnit.Hour,this.#a.hour.values.length),e.setMinutes(this.#l(i,r)),e.setSeconds(this.#l(a,r))}static#p(e,t){if(!t.isLastWeekdayOfMonth())return!1;let n=t.getDay();return e.some(e=>n===parseInt(e.toString().charAt(0),10)%7)}static#m(e,t){return e<=0||Math.ceil(t.getDate()/7)===e}next(){return this.#v()}prev(){return this.#v(!0)}hasNext(){let e=this.#n;try{return this.#v(),!0}catch{return!1}finally{this.#n=e}}hasPrev(){let e=this.#n;try{return this.#v(!0),!0}catch{return!1}finally{this.#n=e}}take(e){let t=[];if(e>=0)for(let n=0;n<e;n++)try{t.push(this.next())}catch{return t}else for(let n=0;n>e;n--)try{t.push(this.prev())}catch{return t}return t}reset(e){this.#n=new t.CronDate(e||this.#e.currentDate,this.#t)}stringify(e=!1){return this.#a.stringify(e)}includesDate(e){let{second:n,minute:r,hour:i,month:a}=this.#a,o=new t.CronDate(e,this.#t);return!(!n.values.includes(o.getSeconds())||!r.values.includes(o.getMinutes())||!i.values.includes(o.getHours())||!a.values.includes(o.getMonth()+1)||!this.#h(o))}toString(){return this.#e.expression||this.stringify(!0)}#h(e){let t=this.#a.dayOfMonth.isWildcard,n=!t,i=this.#a.dayOfWeek.isWildcard,a=!i,o=r.#c(e.getDate(),this.#a.dayOfMonth.values)||this.#a.dayOfMonth.hasLastChar&&e.isLastDayOfMonth(),s=this.#a.dayOfWeek.nthDay,c=r.#c(e.getDay(),this.#a.dayOfWeek.values)&&r.#m(s,e)||this.#a.dayOfWeek.hasLastChar&&r.#p(this.#a.dayOfWeek.values,e);return!!(n&&a&&(o||c)||o&&!a||t&&!i&&c)}#g(e,n,i){let a=this.#a.hour.values,o=a,s=e.getHours(),c=r.#c(s,a),l=e.dstEnd===s;if(e.dstStart!==null&&e.dstStart===s-1&&r.#c(e.dstStart,a))return!0;if(l&&!i)return e.dstEnd=null,e.applyDateOperation(t.DateMathOp.Add,t.TimeUnit.Hour,o.length),!1;if(c)return!0;e.dstStart=null;let u=this.#a.hour.findNearestValue(s,i);if(u===null)return e.applyDateOperation(n,t.TimeUnit.Day,o.length),!1;if(this.#u(e)){let r=i?s-u:u-s;for(let a=0;a<r&&(e.applyDateOperation(n,t.TimeUnit.Hour,o.length),!(!i&&e.getHours()>=u||i&&e.getHours()<=u));a++);}else e.setHours(u);return e.setMinutes(this.#l(this.#a.minute.values,i)),e.setSeconds(this.#l(this.#a.second.values,i)),!1}#_(t){if(!this.#r&&!this.#i)return;let n=t.getTime();if(this.#r&&n<this.#r.getTime()||this.#i&&n>this.#i.getTime())throw Error(e.TIME_SPAN_OUT_OF_BOUNDS_ERROR_MESSAGE)}#v(i=!1){let a=i?t.DateMathOp.Subtract:t.DateMathOp.Add,o=new t.CronDate(this.#n),s=o.getTime(),c=0;for(;++c<n;){if(this.#_(o),!this.#h(o)){o.applyDateOperation(a,t.TimeUnit.Day,this.#a.hour.values.length);continue}if(!r.#c(o.getMonth()+1,this.#a.month.values)){o.applyDateOperation(a,t.TimeUnit.Month,this.#a.hour.values.length);continue}if(this.#g(o,a,i)){if(!r.#c(o.getMinutes(),this.#a.minute.values)){this.#f(o,a,i);continue}if(!r.#c(o.getSeconds(),this.#a.second.values)){this.#d(o,a,i);continue}if(s===o.getTime()&&(a===`Add`||o.getMilliseconds()===0)){o.applyDateOperation(a,t.TimeUnit.Second,this.#a.hour.values.length);continue}break}}if(c>=n)throw Error(e.LOOPS_LIMIT_EXCEEDED_ERROR_MESSAGE);return o.getMilliseconds()!==0&&o.setMilliseconds(0),this.#n=o,o}[Symbol.iterator](){return{next:()=>{try{return{value:this.#v(),done:!1}}catch{return{value:void 0,done:!0}}}}}};e.CronExpression=r,e.default=r})),Nr=e((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.seededRandom=r;function t(e){let t=2166136261;for(let n=0;n<e.length;n++)t^=e.charCodeAt(n),t=Math.imul(t,16777619);return()=>t>>>0}function n(e){return()=>{let t=e+=1831565813;return t=Math.imul(t^t>>>15,t|1),t^=t+Math.imul(t^t>>>7,t|61),((t^t>>>14)>>>0)/4294967296}}function r(e){return n(e?t(e)():Math.floor(Math.random()*1e10))}})),Pr=e((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.CronExpressionParser=e.DayOfWeek=e.Months=e.CronUnit=e.PredefinedExpressions=void 0;var t=jr(),n=Mr(),r=Nr(),i=Ar(),a;(function(e){e[`@yearly`]=`0 0 0 1 1 *`,e[`@annually`]=`0 0 0 1 1 *`,e[`@monthly`]=`0 0 0 1 * *`,e[`@weekly`]=`0 0 0 * * 0`,e[`@daily`]=`0 0 0 * * *`,e[`@hourly`]=`0 0 * * * *`,e[`@minutely`]=`0 * * * * *`,e[`@secondly`]=`* * * * * *`,e[`@weekdays`]=`0 0 0 * * 1-5`,e[`@weekends`]=`0 0 0 * * 0,6`})(a||(e.PredefinedExpressions=a={}));var o;(function(e){e.Second=`Second`,e.Minute=`Minute`,e.Hour=`Hour`,e.DayOfMonth=`DayOfMonth`,e.Month=`Month`,e.DayOfWeek=`DayOfWeek`})(o||(e.CronUnit=o={}));var s;(function(e){e[e.jan=1]=`jan`,e[e.feb=2]=`feb`,e[e.mar=3]=`mar`,e[e.apr=4]=`apr`,e[e.may=5]=`may`,e[e.jun=6]=`jun`,e[e.jul=7]=`jul`,e[e.aug=8]=`aug`,e[e.sep=9]=`sep`,e[e.oct=10]=`oct`,e[e.nov=11]=`nov`,e[e.dec=12]=`dec`})(s||(e.Months=s={}));var c;(function(e){e[e.sun=0]=`sun`,e[e.mon=1]=`mon`,e[e.tue=2]=`tue`,e[e.wed=3]=`wed`,e[e.thu=4]=`thu`,e[e.fri=5]=`fri`,e[e.sat=6]=`sat`})(c||(e.DayOfWeek=c={})),e.CronExpressionParser=class e{static parse(s,c={}){let{strict:l=!1,hashSeed:u}=c,d=(0,r.seededRandom)(u);s=a[s]||s;let f=e.#e(s,l);if(!(f.dayOfMonth===`*`||f.dayOfWeek===`*`||!l))throw Error(`Cannot use both dayOfMonth and dayOfWeek together in strict mode!`);let p=e.#t(o.Second,f.second,i.CronSecond.constraints,d),m=e.#t(o.Minute,f.minute,i.CronMinute.constraints,d),ee=e.#t(o.Hour,f.hour,i.CronHour.constraints,d),h=e.#t(o.Month,f.month,i.CronMonth.constraints,d),g=e.#t(o.DayOfMonth,f.dayOfMonth,i.CronDayOfMonth.constraints,d),{dayOfWeek:_,nthDayOfWeek:v}=e.#u(f.dayOfWeek),y=e.#t(o.DayOfWeek,_,i.CronDayOfWeek.constraints,d),b=new t.CronFieldCollection({second:new i.CronSecond(p,{rawValue:f.second}),minute:new i.CronMinute(m,{rawValue:f.minute}),hour:new i.CronHour(ee,{rawValue:f.hour}),dayOfMonth:new i.CronDayOfMonth(g,{rawValue:f.dayOfMonth}),month:new i.CronMonth(h,{rawValue:f.month}),dayOfWeek:new i.CronDayOfWeek(y,{rawValue:f.dayOfWeek,nthDayOfWeek:v})});return new n.CronExpression(b,{...c,expression:s})}static#e(e,t){if(t&&!e.length)throw Error(`Invalid cron expression`);e||=`0 * * * * *`;let n=e.trim().split(/\s+/);if(t&&n.length<6)throw Error(`Invalid cron expression, expected 6 fields`);if(n.length>6)throw Error(`Invalid cron expression, too many fields`);let r=[`*`,`*`,`*`,`*`,`*`,`0`];n.length<r.length&&n.unshift(...r.slice(n.length));let[i,a,o,s,c,l]=n;return{second:i,minute:a,hour:o,dayOfMonth:s,month:c,dayOfWeek:l}}static#t(e,t,n,r){if((e===o.Month||e===o.DayOfWeek)&&(t=t.replace(/[a-z]{3}/gi,e=>{e=e.toLowerCase();let t=s[e]||c[e];if(t===void 0)throw Error(`Validation error, cannot resolve alias "${e}"`);return t.toString()})),!n.validChars.test(t))throw Error(`Invalid characters, got value: ${t}`);return t=this.#n(t,n),t=this.#r(t,n,r),this.#i(e,t,n)}static#n(e,t){return e.replace(/[*?]/g,t.min+`-`+t.max)}static#r(e,t,n){let r=n();return e.replace(/H(?:\((\d+)-(\d+)\))?(?:\/(\d+))?/g,(e,n,i,a)=>{if(n&&i&&a){let e=parseInt(n,10),o=parseInt(i,10),s=parseInt(a,10);if(e>o)throw Error(`Invalid range: ${e}-${o}, min > max`);if(s<=0)throw Error(`Invalid step: ${s}, must be positive`);let c=Math.max(e,t.min),l=Math.floor(r*s),u=[];for(let e=Math.floor(c/s)*s+l;e<=o;e+=s)e>=c&&u.push(e);return u.join(`,`)}else if(n&&i){let e=parseInt(n,10),t=parseInt(i,10);if(e>t)throw Error(`Invalid range: ${e}-${t}, min > max`);return String(Math.floor(r*(t-e+1))+e)}else if(a){let e=parseInt(a,10);if(e<=0)throw Error(`Invalid step: ${e}, must be positive`);let n=Math.floor(r*e),i=[];for(let r=Math.floor(t.min/e)*e+n;r<=t.max;r+=e)r>=t.min&&i.push(r);return i.join(`,`)}else return String(Math.floor(r*(t.max-t.min+1)+t.min))})}static#i(t,n,r){let i=[];function a(n,r){if(Array.isArray(n))i.push(...n);else if(e.#d(r,n))i.push(n);else{let e=parseInt(n.toString(),10);if(!(e>=r.min&&e<=r.max))throw Error(`Constraint error, got value ${n} expected range ${r.min}-${r.max}`);i.push(t===o.DayOfWeek?e%7:n)}}return n.split(`,`).forEach(n=>{if(!(n.length>0))throw Error(`Invalid list value format`);a(e.#a(t,n,r),r)}),i}static#a(t,n,r){let i=n.split(`/`);if(i.length>2)throw Error(`Invalid repeat: ${n}`);return i.length===2?(i[0].includes(`-`)||(i[0]=`${i[0]}-${r.max}`),e.#l(t,i[0],parseInt(i[1],10),r)):e.#l(t,n,1,r)}static#o(e,t,n){if(!(!isNaN(e)&&!isNaN(t)&&e>=n.min&&t<=n.max))throw Error(`Constraint error, got range ${e}-${t} expected range ${n.min}-${n.max}`);if(e>t)throw Error(`Invalid range: ${e}-${t}, min(${e}) > max(${t})`)}static#s(e){if(!(!isNaN(e)&&e>0))throw Error(`Constraint error, cannot repeat at every ${e} time.`)}static#c(e,t,n,r){let i=[];e===o.DayOfWeek&&n%7==0&&i.push(0);for(let e=t;e<=n;e+=r)i.indexOf(e)===-1&&i.push(e);return i}static#l(e,t,n,r){let i=t.split(`-`);if(i.length<=1)return isNaN(+t)?t:+t;let[a,o]=i.map(e=>parseInt(e,10));return this.#o(a,o,r),this.#s(n),this.#c(e,a,o,n)}static#u(e){let t=e.split(`#`);if(t.length<=1)return{dayOfWeek:t[0]};let n=+t[t.length-1],r=e.match(/([,\-/])/);if(r!==null)throw Error(`Constraint error, invalid dayOfWeek \`#\` and \`${r?.[0]}\` special characters are incompatible`);if(!(t.length<=2&&!isNaN(n)&&n>=1&&n<=5))throw Error(`Constraint error, invalid dayOfWeek occurrence number (#)`);return{dayOfWeek:t[0],nthDayOfWeek:n}}static#d(e,t){return e.chars.some(e=>t.toString().includes(e))}}})),Fr=e(((e,t)=>{t.exports={}})),Ir=e((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.CronFileParser=void 0;var t=Pr();e.CronFileParser=class e{static async parseFile(t){let{readFile:n}=Fr(),r=await n(t,`utf8`);return e.#e(r)}static parseFileSync(t){let{readFileSync:n}=Fr(),r=n(t,`utf8`);return e.#e(r)}static#e(t){let n=t.split(`
2
+ `),r={variables:{},expressions:[],errors:{}};for(let t of n){let n=t.trim();if(n.length===0||n.startsWith(`#`))continue;let i=n.match(/^(.*)=(.*)$/);if(i){let[,e,t]=i;r.variables[e]=t.replace(/["']/g,``);continue}try{let t=e.#t(n);r.expressions.push(t.interval)}catch(e){r.errors[n]=e}}return r}static#t(e){let n=e.split(` `);return{interval:t.CronExpressionParser.parse(n.slice(0,5).join(` `)),command:n.slice(5,n.length)}}}})),Lr=e((e=>{var t=e&&e.__createBinding||(Object.create?(function(e,t,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||(`get`in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}):(function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]})),n=e&&e.__exportStar||function(e,n){for(var r in e)r!=="default"&&!Object.prototype.hasOwnProperty.call(n,r)&&t(n,e,r)};Object.defineProperty(e,"__esModule",{value:!0}),e.CronFileParser=e.CronExpressionParser=e.CronExpression=e.CronFieldCollection=e.CronDate=void 0;var r=Pr(),i=Or();Object.defineProperty(e,"CronDate",{enumerable:!0,get:function(){return i.CronDate}});var a=jr();Object.defineProperty(e,"CronFieldCollection",{enumerable:!0,get:function(){return a.CronFieldCollection}});var o=Mr();Object.defineProperty(e,"CronExpression",{enumerable:!0,get:function(){return o.CronExpression}});var s=Pr();Object.defineProperty(e,"CronExpressionParser",{enumerable:!0,get:function(){return s.CronExpressionParser}});var c=Ir();Object.defineProperty(e,"CronFileParser",{enumerable:!0,get:function(){return c.CronFileParser}}),n(Ar(),e),e.default=r.CronExpressionParser}))(),Rr=/^([01]\d|2[0-3]):([0-5]\d)$/,zr=1e3,Br=`@interval:`;function Vr(e){return Number.isInteger(e)&&e>=0&&e<=59}function Hr(e){return Number.isInteger(e)&&e>=1&&e<=1e3}function Ur(e){if(!Hr(e))throw Error(`interval minutes must be an integer between 1 and ${zr}`);return`${Br}${e}`}function Wr(e){let t=/^@interval:(\d+)$/.exec(e);if(!t)return null;let n=Number(t[1]);return Hr(n)?n:null}function Gr(e){if(!Vr(e))throw Error(`minute must be an integer between 0 and 59`);return`${e} * * * *`}function Kr(e){let t=e.trim();if(!t)return!1;try{return Intl.DateTimeFormat(void 0,{timeZone:t}),!0}catch{return!1}}function qr(){return Intl.DateTimeFormat().resolvedOptions().timeZone}function Jr(e,t,n=new Date().getDay()){if(e===`interval`)throw Error(`interval presets must be compiled with compileIntervalCron`);if(e===`hourly`)return Gr(0);let r=t.trim().match(Rr);if(!r)throw Error(`time must be HH:mm`);let i=Number(r[1]),a=Number(r[2]);return e===`daily`?`${a} ${i} * * *`:e===`weekdays`?`${a} ${i} * * 1-5`:`${a} ${i} * * ${n}`}function Yr(e){let t=e.trim(),n=Wr(t);if(n!==null)return{preset:`interval`,time:``,intervalMinutes:n};let r=t.match(/^(\d{1,2}) \* \* \* \*$/);if(r){let e=Number(r[1]);return Vr(e)?{preset:`hourly`,time:``,minute:e}:null}let i=t.match(/^(\d{1,2}) (\d{1,2}) \* \* (\*|[0-6]|1-5)$/);if(!i)return null;let a=Number(i[1]),o=Number(i[2]),s=i[3],c=`${String(o).padStart(2,`0`)}:${String(a).padStart(2,`0`)}`;return s===`*`?{preset:`daily`,time:c}:s===`1-5`?{preset:`weekdays`,time:c}:{preset:`weekly`,time:c,dayOfWeek:Number(s)}}function Xr(e){let t=[`Sunday`,`Monday`,`Tuesday`,`Wednesday`,`Thursday`,`Friday`,`Saturday`],n=X(e.time);if(e.preset===`interval`){let t=e.intervalMinutes??5;return t===1?`Every minute`:`Every ${t} minutes`}if(e.preset===`hourly`){let t=e.minute??0;return t>0?`Every hour at :${String(t).padStart(2,`0`)}`:`Every hour`}return e.preset===`daily`?`Every day at ${n}`:e.preset===`weekdays`?`Every weekday at ${n}`:`Every ${t[e.dayOfWeek??0]??`Sunday`} at ${n}`}function X(e){let t=e.match(Rr);if(!t)return e;let n=Number(t[1]),r=t[2],i=n>=12?`PM`:`AM`;return`${n%12==0?12:n%12}:${r} ${i}`}function Zr(e){return e*6e4}function Qr(e,t){let n=Zr(e);return(Math.floor(t.getTime()/n)+1)*n}function $r(e,t,n=new Date){if(!Kr(t))return null;let r=Wr(e);if(r!==null)return new Date(Qr(r,n));try{return Lr.CronExpressionParser.parse(e,{tz:t,currentDate:n}).next().toDate()}catch{return null}}function ei(e,t=new Date){let n=e.getTime()-t.getTime();if(n<=0)return`Next run soon`;let r=Math.round(n/6e4);if(r<60)return`Next run in ${r} min`;let i=Math.round(r/60);return i<48?`Next run in ${i} hours`:`Next run in ${Math.round(i/24)} days`}var Z=`Set a Default model alias in Settings → Default Models before scheduling a task`,ti=/^[a-zA-Z0-9._:-]+$/;function ni(e){let t=e.trim();return t?t.length>100?`eventKey must be 100 characters or fewer`:ti.test(t)?null:`eventKey may only contain letters, numbers, dots, colons, underscores, and hyphens`:`eventKey is required for event triggers`}function Q(e){return e!=null&&e.trim()!==``}function ri(e){return Q(e.scheduledAt)?`scheduledAt requires triggerType 'schedule'`:Q(e.scheduleCron)?`scheduleCron requires triggerType 'schedule'`:Q(e.timezone)?`timezone requires triggerType 'schedule'`:Q(e.eventKey)?`eventKey requires triggerType 'event'`:null}function ii(e){let t=e.scheduledAt?.trim()??null,n=e.scheduleCron?.trim()??null,r=e.timezone?.trim()??null;return t&&n?`Provide either scheduledAt or scheduleCron, not both`:!t&&!n?`scheduledAt or scheduleCron is required for schedule triggers`:r?Kr(r)?t&&Number.isNaN(Date.parse(t))?`scheduledAt must be an ISO timestamp`:Q(e.eventKey)?`eventKey is only allowed for event triggers`:null:`timezone must be a valid IANA timezone`:`timezone is required for schedule triggers`}function ai(e){return ni(e.eventKey??``)||(Q(e.scheduledAt)?`scheduledAt is only allowed for schedule triggers`:Q(e.scheduleCron)?`scheduleCron is only allowed for schedule triggers`:Q(e.timezone)?`timezone is only allowed for schedule triggers`:null)}function oi(e,t){return e===`schedule`?v(t)?null:Z:null}function si(e){let t=e.triggerType??null;return t===null?ri(e):t===`schedule`?ii(e):ai(e)}var ci=`{tarsk}`;function li(e,t){let n=e.replace(/\/$/,``);if(t===n)return ci;let r=`${n}/`;return t.startsWith(r)?`${ci}/${t.slice(r.length)}`:t}var ui=3e4,di=2e3;function fi(e){return typeof process<`u`&&process.platform===`win32`?`for /f "tokens=5" %a in ('netstat -aon ^| findstr :${e}') do taskkill /F /PID %a`:`lsof -ti :${e} | xargs kill -9`}function pi(e){return e.replace(/\x1b\[[0-9;]*m/g,``)}var mi=[{pattern:/https?:\/\/localhost[:/](\d+)/i},{pattern:/https?:\/\/127\.0\.0\.1:(\d+)/i},{pattern:/localhost:(\d+)/i,portGroup:1},{pattern:/127\.0\.0\.1:(\d+)/i,portGroup:1},{pattern:/https?:\/\/(0\.0\.0\.0|\[::?\]):(\d+)/i,portGroup:2},{pattern:/https?:\/\/(192\.168\.\d+\.\d+):(\d+)/i,portGroup:2},{pattern:/https?:\/\/\[::1\]:(\d+)/i}];function hi(e){let t=e[0];return t.includes(`://`)?t.replace(/\/+$/,``):t.startsWith(`127.0.0.1:`)?`http://${t}`:`http://localhost:${e[1]}`}function gi(e){let t=pi(e);for(let{pattern:e,portGroup:n}of mi){let r=t.match(e);if(r)return n!=null&&r[n]&&r[0].includes(`://`),hi(r)}}var $=`tarsk://`,_i=`https://tarsk.io`,vi=`/redirect`,yi=`tarsk.invalid`,bi=`/chat`;function xi(e){let t=new URLSearchParams;e.projectId&&t.set(`project`,e.projectId),e.threadId&&t.set(`thread`,e.threadId),e.conversationId&&t.set(`conversation`,e.conversationId);let n=t.toString();return`${$}chat${n?`?${n}`:``}`}function Si(e){if(!e.startsWith($))return null;let t=e.slice(8);try{let e=new URL(`https://${yi}/${t}`);return e.pathname.replace(/\/+$/,``)===bi?{projectId:e.searchParams.get(`project`)??void 0,threadId:e.searchParams.get(`thread`)??void 0,conversationId:e.searchParams.get(`conversation`)??void 0}:null}catch{return null}}function Ci(e){let t=e.trim(),n=Si(t);if(n)return n;try{let e=new URL(t);if(e.origin!==_i||e.pathname!==vi)return null;let n=e.searchParams.get(`url`);return n?Si(n):null}catch{return null}}var wi=`home.tarsk.io`,Ti=`tarsk.net`,Ei=`Sign in with the account that owns this Tarsk.`,Di=`abcdefghijkmnpqrstuvwxyz23456789`,Oi=10;function ki(e){return e.trim().toLowerCase().replace(/:\d+$/,``)}function Ai(e){return ki(e)===wi}function ji(e){if(e.length!==Oi)return!1;for(let t of e)if(!Di.includes(t))return!1;return!0}function Mi(e){let t=ki(e),n=`.${Ti}`;if(!t.endsWith(n))return null;let r=t.slice(0,-n.length);return ji(r)?r:null}function Ni(e){return Mi(e)!==null}function Pi(e){return ji(e)?`${e}.${Ti}`:null}function Fi(e){let t=Pi(e);return t?`https://${t}`:null}var Ii=[`paused`,`blocked`,`awaiting-human`];function Li(e){return Ii.some(t=>t===e)}function Ri(e){let t=Math.max(0,Math.floor(e/1e3)),n=t%60,r=Math.floor(t/60)%60,i=Math.floor(t/3600),a=e=>String(e).padStart(2,`0`);return i>0?`${i}:${a(r)}:${a(n)}`:`${r}:${a(n)}`}function zi(e){let t=Bi(e);if(!t)throw Error(!e||typeof e!=`object`?`ask_user question must be an object`:"ask_user question requires a non-empty `question` string");return t}function Bi(e){if(!e||typeof e!=`object`)return null;let t=e;if(typeof t.question!=`string`||!t.question.trim())return null;let n=Vi(t.options);return{question:t.question,header:typeof t.header==`string`?t.header:void 0,options:n.length>0?n:void 0,multiple:typeof t.multiple==`boolean`?t.multiple:void 0}}function Vi(e){if(!Array.isArray(e))return[];let t=[];for(let n of e)if(typeof n==`string`&&n.trim())t.push({label:n,description:``});else if(n&&typeof n==`object`){let e=n;typeof e.label==`string`&&e.label.trim()&&t.push({label:e.label,description:typeof e.description==`string`?e.description:``})}return t}function Hi(e){if(!e||typeof e!=`object`)throw Error("ask_user requires an object containing `questions` or `question`");let t=e;if(Array.isArray(t.questions)){if(t.questions.length===0)throw Error("ask_user `questions` must contain at least one question");return t.questions.map(zi)}if(typeof t.question==`string`&&t.question.trim())return[{question:t.question,header:typeof t.context==`string`?t.context:void 0,options:Vi(t.options)}];throw Error("ask_user requires `questions` (array) or `question` (string)")}export{En as $,Ue as $t,yr as A,me as An,F as At,cr as B,ne as Bn,A as Bt,Jr as C,ge as Cn,Bt as Ct,$r as D,fe as Dn,Mt as Dt,qr as E,ce as En,Lt as Et,H as F,ee as Fn,gt as Ft,Kn as G,Qe as Gt,V as H,a as Hn,nt as Ht,pr as I,te as In,_t as It,jn as J,D as Jt,Pn as K,Xe as Kt,ur as L,y as Ln,ut as Lt,_r as M,d as Mn,Ot as Mt,mr as N,u as Nn,bt as Nt,Hr as O,se as On,Ct as Ot,U as P,h as Pn,dt as Pt,yn as Q,He as Qt,dr as R,b as Rn,pt as Rt,Ur as S,ye as Sn,zt as St,ei as T,ue as Tn,Rt as Tt,Qn as U,r as Un,et as Ut,Un as V,ie as Vn,ct as Vt,ar as W,l as Wn,$e as Wt,kn as X,Ke as Xt,An as Y,Ze as Yt,On as Z,qe as Zt,li as _,Se as _n,Wt as _t,Ei as a,Pe as an,dn as at,zr as b,S as bn,Vt as bt,Mi as c,je as cn,on as ct,Si as d,xe as dn,en as dt,Re as en,Cn as et,Ci as f,Oe as fn,nn as ft,fi as g,we as gn,qt as gt,ui as h,Ce as hn,Kt as ht,Ti as i,Le as in,mn as it,gr as j,f as jn,Dt as jt,Yr as k,pe as kn,Tt as kt,Fi as l,Ae as ln,an as lt,di as m,Te as mn,Yt as mt,Ri as n,Be as nn,wn as nt,Ai as o,Ie as on,pn as ot,gi as p,Ee as pn,Jt as pt,Mn as q,Ye as qt,Li as r,ze as rn,vn as rt,Ni as s,Me as sn,B as st,Hi as t,Ve as tn,Sn as tt,xi as u,be as un,tn as ut,oi as v,ke as vn,Gt as vt,Xr as w,he as wn,It as wt,Gr as x,ve as xn,Ht as xt,si as y,C as yn,Ut as yt,fr as z,g as zn,lt as zt};
@@ -1 +1 @@
1
- import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{a as t,o as n,t as r}from"./react-vendor-Ee0-5T4I.js";import{s as i}from"./utils-CWTBjUlE.js";import{a,h as o,l as s,u as c}from"./dist-DqKWH8sc.js";var l=e(n(),1),u=[`top`,`right`,`bottom`,`left`],d=Math.min,f=Math.max,p=Math.round,m=Math.floor,h=e=>({x:e,y:e}),g={left:`right`,right:`left`,bottom:`top`,top:`bottom`},_={start:`end`,end:`start`};function v(e,t,n){return f(e,d(t,n))}function y(e,t){return typeof e==`function`?e(t):e}function b(e){return e.split(`-`)[0]}function x(e){return e.split(`-`)[1]}function S(e){return e===`x`?`y`:`x`}function C(e){return e===`y`?`height`:`width`}var w=new Set([`top`,`bottom`]);function T(e){return w.has(b(e))?`y`:`x`}function E(e){return S(T(e))}function D(e,t,n){n===void 0&&(n=!1);let r=x(e),i=E(e),a=C(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=F(o)),[o,F(o)]}function O(e){let t=F(e);return[k(e),t,k(t)]}function k(e){return e.replace(/start|end/g,e=>_[e])}var A=[`left`,`right`],j=[`right`,`left`],M=[`top`,`bottom`],N=[`bottom`,`top`];function P(e,t,n){switch(e){case`top`:case`bottom`:return n?t?j:A:t?A:j;case`left`:case`right`:return t?M:N;default:return[]}}function ee(e,t,n,r){let i=x(e),a=P(b(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(k)))),a}function F(e){return e.replace(/left|right|bottom|top/g,e=>g[e])}function I(e){return{top:0,right:0,bottom:0,left:0,...e}}function L(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:I(e)}function R(e){let{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function z(e,t,n){let{reference:r,floating:i}=e,a=T(t),o=E(t),s=C(o),c=b(t),l=a===`y`,u=r.x+r.width/2-i.width/2,d=r.y+r.height/2-i.height/2,f=r[s]/2-i[s]/2,p;switch(c){case`top`:p={x:u,y:r.y-i.height};break;case`bottom`:p={x:u,y:r.y+r.height};break;case`right`:p={x:r.x+r.width,y:d};break;case`left`:p={x:r.x-i.width,y:d};break;default:p={x:r.x,y:r.y}}switch(x(t)){case`start`:p[o]-=f*(n&&l?-1:1);break;case`end`:p[o]+=f*(n&&l?-1:1);break}return p}async function te(e,t){t===void 0&&(t={});let{x:n,y:r,platform:i,rects:a,elements:o,strategy:s}=e,{boundary:c=`clippingAncestors`,rootBoundary:l=`viewport`,elementContext:u=`floating`,altBoundary:d=!1,padding:f=0}=y(t,e),p=L(f),m=o[d?u===`floating`?`reference`:`floating`:u],h=R(await i.getClippingRect({element:await(i.isElement==null?void 0:i.isElement(m))??!0?m:m.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(o.floating)),boundary:c,rootBoundary:l,strategy:s})),g=u===`floating`?{x:n,y:r,width:a.floating.width,height:a.floating.height}:a.reference,_=await(i.getOffsetParent==null?void 0:i.getOffsetParent(o.floating)),v=await(i.isElement==null?void 0:i.isElement(_))&&await(i.getScale==null?void 0:i.getScale(_))||{x:1,y:1},b=R(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:o,rect:g,offsetParent:_,strategy:s}):g);return{top:(h.top-b.top+p.top)/v.y,bottom:(b.bottom-h.bottom+p.bottom)/v.y,left:(h.left-b.left+p.left)/v.x,right:(b.right-h.right+p.right)/v.x}}var ne=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=a.filter(Boolean),c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=z(l,r,c),f=r,p={},m=0;for(let n=0;n<s.length;n++){let{name:a,fn:h}=s[n],{x:g,y:_,data:v,reset:y}=await h({x:u,y:d,initialPlacement:r,placement:f,strategy:i,middlewareData:p,rects:l,platform:{...o,detectOverflow:o.detectOverflow??te},elements:{reference:e,floating:t}});u=g??u,d=_??d,p={...p,[a]:{...p[a],...v}},y&&m<=50&&(m++,typeof y==`object`&&(y.placement&&(f=y.placement),y.rects&&(l=y.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:i}):y.rects),{x:u,y:d}=z(l,f,c)),n=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:p}},re=e=>({name:`arrow`,options:e,async fn(t){let{x:n,y:r,placement:i,rects:a,platform:o,elements:s,middlewareData:c}=t,{element:l,padding:u=0}=y(e,t)||{};if(l==null)return{};let f=L(u),p={x:n,y:r},m=E(i),h=C(m),g=await o.getDimensions(l),_=m===`y`,b=_?`top`:`left`,S=_?`bottom`:`right`,w=_?`clientHeight`:`clientWidth`,T=a.reference[h]+a.reference[m]-p[m]-a.floating[h],D=p[m]-a.reference[m],O=await(o.getOffsetParent==null?void 0:o.getOffsetParent(l)),k=O?O[w]:0;(!k||!await(o.isElement==null?void 0:o.isElement(O)))&&(k=s.floating[w]||a.floating[h]);let A=T/2-D/2,j=k/2-g[h]/2-1,M=d(f[b],j),N=d(f[S],j),P=M,ee=k-g[h]-N,F=k/2-g[h]/2+A,I=v(P,F,ee),R=!c.arrow&&x(i)!=null&&F!==I&&a.reference[h]/2-(F<P?M:N)-g[h]/2<0,z=R?F<P?F-P:F-ee:0;return{[m]:p[m]+z,data:{[m]:I,centerOffset:F-I-z,...R&&{alignmentOffset:z}},reset:R}}}),ie=function(e){return e===void 0&&(e={}),{name:`flip`,options:e,async fn(t){var n;let{placement:r,middlewareData:i,rects:a,initialPlacement:o,platform:s,elements:c}=t,{mainAxis:l=!0,crossAxis:u=!0,fallbackPlacements:d,fallbackStrategy:f=`bestFit`,fallbackAxisSideDirection:p=`none`,flipAlignment:m=!0,...h}=y(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};let g=b(r),_=T(o),v=b(o)===o,x=await(s.isRTL==null?void 0:s.isRTL(c.floating)),S=d||(v||!m?[F(o)]:O(o)),C=p!==`none`;!d&&C&&S.push(...ee(o,m,p,x));let w=[o,...S],E=await s.detectOverflow(t,h),k=[],A=i.flip?.overflows||[];if(l&&k.push(E[g]),u){let e=D(r,a,x);k.push(E[e[0]],E[e[1]])}if(A=[...A,{placement:r,overflows:k}],!k.every(e=>e<=0)){let e=(i.flip?.index||0)+1,t=w[e];if(t&&(!(u===`alignment`&&_!==T(t))||A.every(e=>T(e.placement)===_?e.overflows[0]>0:!0)))return{data:{index:e,overflows:A},reset:{placement:t}};let n=A.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0]?.placement;if(!n)switch(f){case`bestFit`:{let e=A.filter(e=>{if(C){let t=T(e.placement);return t===_||t===`y`}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0]?.[0];e&&(n=e);break}case`initialPlacement`:n=o;break}if(r!==n)return{reset:{placement:n}}}return{}}}};function ae(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function oe(e){return u.some(t=>e[t]>=0)}var se=function(e){return e===void 0&&(e={}),{name:`hide`,options:e,async fn(t){let{rects:n,platform:r}=t,{strategy:i=`referenceHidden`,...a}=y(e,t);switch(i){case`referenceHidden`:{let e=ae(await r.detectOverflow(t,{...a,elementContext:`reference`}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:oe(e)}}}case`escaped`:{let e=ae(await r.detectOverflow(t,{...a,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:oe(e)}}}default:return{}}}}},ce=new Set([`left`,`top`]);async function le(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=b(n),s=x(n),c=T(n)===`y`,l=ce.has(o)?-1:1,u=a&&c?-1:1,d=y(t,e),{mainAxis:f,crossAxis:p,alignmentAxis:m}=typeof d==`number`?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&typeof m==`number`&&(p=s===`end`?m*-1:m),c?{x:p*u,y:f*l}:{x:f*l,y:p*u}}var ue=function(e){return e===void 0&&(e=0),{name:`offset`,options:e,async fn(t){var n;let{x:r,y:i,placement:a,middlewareData:o}=t,s=await le(t,e);return a===o.offset?.placement&&(n=o.arrow)!=null&&n.alignmentOffset?{}:{x:r+s.x,y:i+s.y,data:{...s,placement:a}}}}},de=function(e){return e===void 0&&(e={}),{name:`shift`,options:e,async fn(t){let{x:n,y:r,placement:i,platform:a}=t,{mainAxis:o=!0,crossAxis:s=!1,limiter:c={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...l}=y(e,t),u={x:n,y:r},d=await a.detectOverflow(t,l),f=T(b(i)),p=S(f),m=u[p],h=u[f];if(o){let e=p===`y`?`top`:`left`,t=p===`y`?`bottom`:`right`,n=m+d[e],r=m-d[t];m=v(n,m,r)}if(s){let e=f===`y`?`top`:`left`,t=f===`y`?`bottom`:`right`,n=h+d[e],r=h-d[t];h=v(n,h,r)}let g=c.fn({...t,[p]:m,[f]:h});return{...g,data:{x:g.x-n,y:g.y-r,enabled:{[p]:o,[f]:s}}}}}},fe=function(e){return e===void 0&&(e={}),{options:e,fn(t){let{x:n,y:r,placement:i,rects:a,middlewareData:o}=t,{offset:s=0,mainAxis:c=!0,crossAxis:l=!0}=y(e,t),u={x:n,y:r},d=T(i),f=S(d),p=u[f],m=u[d],h=y(s,t),g=typeof h==`number`?{mainAxis:h,crossAxis:0}:{mainAxis:0,crossAxis:0,...h};if(c){let e=f===`y`?`height`:`width`,t=a.reference[f]-a.floating[e]+g.mainAxis,n=a.reference[f]+a.reference[e]-g.mainAxis;p<t?p=t:p>n&&(p=n)}if(l){let e=f===`y`?`width`:`height`,t=ce.has(b(i)),n=a.reference[d]-a.floating[e]+(t&&o.offset?.[d]||0)+(t?0:g.crossAxis),r=a.reference[d]+a.reference[e]+(t?0:o.offset?.[d]||0)-(t?g.crossAxis:0);m<n?m=n:m>r&&(m=r)}return{[f]:p,[d]:m}}}},pe=function(e){return e===void 0&&(e={}),{name:`size`,options:e,async fn(t){var n,r;let{placement:i,rects:a,platform:o,elements:s}=t,{apply:c=()=>{},...l}=y(e,t),u=await o.detectOverflow(t,l),p=b(i),m=x(i),h=T(i)===`y`,{width:g,height:_}=a.floating,v,S;p===`top`||p===`bottom`?(v=p,S=m===(await(o.isRTL==null?void 0:o.isRTL(s.floating))?`start`:`end`)?`left`:`right`):(S=p,v=m===`end`?`top`:`bottom`);let C=_-u.top-u.bottom,w=g-u.left-u.right,E=d(_-u[v],C),D=d(g-u[S],w),O=!t.middlewareData.shift,k=E,A=D;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(A=w),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(k=C),O&&!m){let e=f(u.left,0),t=f(u.right,0),n=f(u.top,0),r=f(u.bottom,0);h?A=g-2*(e!==0||t!==0?e+t:f(u.left,u.right)):k=_-2*(n!==0||r!==0?n+r:f(u.top,u.bottom))}await c({...t,availableWidth:A,availableHeight:k});let j=await o.getDimensions(s.floating);return g!==j.width||_!==j.height?{reset:{rects:!0}}:{}}}};function B(){return typeof window<`u`}function V(e){return me(e)?(e.nodeName||``).toLowerCase():`#document`}function H(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function U(e){return((me(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function me(e){return B()?e instanceof Node||e instanceof H(e).Node:!1}function W(e){return B()?e instanceof Element||e instanceof H(e).Element:!1}function G(e){return B()?e instanceof HTMLElement||e instanceof H(e).HTMLElement:!1}function he(e){return!B()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof H(e).ShadowRoot}var ge=new Set([`inline`,`contents`]);function K(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=J(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!ge.has(i)}var _e=new Set([`table`,`td`,`th`]);function ve(e){return _e.has(V(e))}var ye=[`:popover-open`,`:modal`];function be(e){return ye.some(t=>{try{return e.matches(t)}catch{return!1}})}var xe=[`transform`,`translate`,`scale`,`rotate`,`perspective`],Se=[`transform`,`translate`,`scale`,`rotate`,`perspective`,`filter`],Ce=[`paint`,`layout`,`strict`,`content`];function we(e){let t=Ee(),n=W(e)?J(e):e;return xe.some(e=>n[e]?n[e]!==`none`:!1)||(n.containerType?n.containerType!==`normal`:!1)||!t&&(n.backdropFilter?n.backdropFilter!==`none`:!1)||!t&&(n.filter?n.filter!==`none`:!1)||Se.some(e=>(n.willChange||``).includes(e))||Ce.some(e=>(n.contain||``).includes(e))}function Te(e){let t=Y(e);for(;G(t)&&!q(t);){if(we(t))return t;if(be(t))return null;t=Y(t)}return null}function Ee(){return typeof CSS>`u`||!CSS.supports?!1:CSS.supports(`-webkit-backdrop-filter`,`none`)}var De=new Set([`html`,`body`,`#document`]);function q(e){return De.has(V(e))}function J(e){return H(e).getComputedStyle(e)}function Oe(e){return W(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Y(e){if(V(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||he(e)&&e.host||U(e);return he(t)?t.host:t}function ke(e){let t=Y(e);return q(t)?e.ownerDocument?e.ownerDocument.body:e.body:G(t)&&K(t)?t:ke(t)}function X(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=ke(e),i=r===e.ownerDocument?.body,a=H(r);if(i){let e=Ae(a);return t.concat(a,a.visualViewport||[],K(r)?r:[],e&&n?X(e):[])}return t.concat(r,X(r,[],n))}function Ae(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function je(e){let t=J(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=G(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=p(n)!==a||p(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function Me(e){return W(e)?e:e.contextElement}function Z(e){let t=Me(e);if(!G(t))return h(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=je(t),o=(a?p(n.width):n.width)/r,s=(a?p(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}var Ne=h(0);function Pe(e){let t=H(e);return!Ee()||!t.visualViewport?Ne:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Fe(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==H(e)?!1:t}function Q(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=Me(e),o=h(1);t&&(r?W(r)&&(o=Z(r)):o=Z(e));let s=Fe(a,n,r)?Pe(a):h(0),c=(i.left+s.x)/o.x,l=(i.top+s.y)/o.y,u=i.width/o.x,d=i.height/o.y;if(a){let e=H(a),t=r&&W(r)?H(r):r,n=e,i=Ae(n);for(;i&&r&&t!==n;){let e=Z(i),t=i.getBoundingClientRect(),r=J(i),a=t.left+(i.clientLeft+parseFloat(r.paddingLeft))*e.x,o=t.top+(i.clientTop+parseFloat(r.paddingTop))*e.y;c*=e.x,l*=e.y,u*=e.x,d*=e.y,c+=a,l+=o,n=H(i),i=Ae(n)}}return R({width:u,height:d,x:c,y:l})}function Ie(e,t){let n=Oe(e).scrollLeft;return t?t.left+n:Q(U(e)).left+n}function Le(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-Ie(e,n),y:n.top+t.scrollTop}}function Re(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=U(r),s=t?be(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=h(1),u=h(0),d=G(r);if((d||!d&&!a)&&((V(r)!==`body`||K(o))&&(c=Oe(r)),G(r))){let e=Q(r);l=Z(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=o&&!d&&!a?Le(o,c):h(0);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-c.scrollLeft*l.x+u.x+f.x,y:n.y*l.y-c.scrollTop*l.y+u.y+f.y}}function ze(e){return Array.from(e.getClientRects())}function Be(e){let t=U(e),n=Oe(e),r=e.ownerDocument.body,i=f(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),a=f(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight),o=-n.scrollLeft+Ie(e),s=-n.scrollTop;return J(r).direction===`rtl`&&(o+=f(t.clientWidth,r.clientWidth)-i),{width:i,height:a,x:o,y:s}}var Ve=25;function He(e,t){let n=H(e),r=U(e),i=n.visualViewport,a=r.clientWidth,o=r.clientHeight,s=0,c=0;if(i){a=i.width,o=i.height;let e=Ee();(!e||e&&t===`fixed`)&&(s=i.offsetLeft,c=i.offsetTop)}let l=Ie(r);if(l<=0){let e=r.ownerDocument,t=e.body,n=getComputedStyle(t),i=e.compatMode===`CSS1Compat`&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,o=Math.abs(r.clientWidth-t.clientWidth-i);o<=Ve&&(a-=o)}else l<=Ve&&(a+=l);return{width:a,height:o,x:s,y:c}}var Ue=new Set([`absolute`,`fixed`]);function We(e,t){let n=Q(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=G(e)?Z(e):h(1);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function Ge(e,t,n){let r;if(t===`viewport`)r=He(e,n);else if(t===`document`)r=Be(U(e));else if(W(t))r=We(t,n);else{let n=Pe(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return R(r)}function Ke(e,t){let n=Y(e);return n===t||!W(n)||q(n)?!1:J(n).position===`fixed`||Ke(n,t)}function qe(e,t){let n=t.get(e);if(n)return n;let r=X(e,[],!1).filter(e=>W(e)&&V(e)!==`body`),i=null,a=J(e).position===`fixed`,o=a?Y(e):e;for(;W(o)&&!q(o);){let t=J(o),n=we(o);!n&&t.position===`fixed`&&(i=null),(a?!n&&!i:!n&&t.position===`static`&&i&&Ue.has(i.position)||K(o)&&!n&&Ke(e,o))?r=r.filter(e=>e!==o):i=t,o=Y(o)}return t.set(e,r),r}function Je(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?be(t)?[]:qe(t,this._c):[].concat(n),r],o=a[0],s=a.reduce((e,n)=>{let r=Ge(t,n,i);return e.top=f(r.top,e.top),e.right=d(r.right,e.right),e.bottom=d(r.bottom,e.bottom),e.left=f(r.left,e.left),e},Ge(t,o,i));return{width:s.right-s.left,height:s.bottom-s.top,x:s.left,y:s.top}}function Ye(e){let{width:t,height:n}=je(e);return{width:t,height:n}}function Xe(e,t,n){let r=G(t),i=U(t),a=n===`fixed`,o=Q(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=h(0);function l(){c.x=Ie(i)}if(r||!r&&!a)if((V(t)!==`body`||K(i))&&(s=Oe(t)),r){let e=Q(t,!0,a,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}else i&&l();a&&!r&&i&&l();let u=i&&!r&&!a?Le(i,s):h(0);return{x:o.left+s.scrollLeft-c.x-u.x,y:o.top+s.scrollTop-c.y-u.y,width:o.width,height:o.height}}function Ze(e){return J(e).position===`static`}function Qe(e,t){if(!G(e)||J(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return U(e)===n&&(n=n.ownerDocument.body),n}function $e(e,t){let n=H(e);if(be(e))return n;if(!G(e)){let t=Y(e);for(;t&&!q(t);){if(W(t)&&!Ze(t))return t;t=Y(t)}return n}let r=Qe(e,t);for(;r&&ve(r)&&Ze(r);)r=Qe(r,t);return r&&q(r)&&Ze(r)&&!we(r)?n:r||Te(e)||n}var et=async function(e){let t=this.getOffsetParent||$e,n=this.getDimensions,r=await n(e.floating);return{reference:Xe(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function tt(e){return J(e).direction===`rtl`}var nt={convertOffsetParentRelativeRectToViewportRelativeRect:Re,getDocumentElement:U,getClippingRect:Je,getOffsetParent:$e,getElementRects:et,getClientRects:ze,getDimensions:Ye,getScale:Z,isElement:W,isRTL:tt};function rt(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function it(e,t){let n=null,r,i=U(e);function a(){var e;clearTimeout(r),(e=n)==null||e.disconnect(),n=null}function o(s,c){s===void 0&&(s=!1),c===void 0&&(c=1),a();let l=e.getBoundingClientRect(),{left:u,top:p,width:h,height:g}=l;if(s||t(),!h||!g)return;let _=m(p),v=m(i.clientWidth-(u+h)),y=m(i.clientHeight-(p+g)),b=m(u),x={rootMargin:-_+`px `+-v+`px `+-y+`px `+-b+`px`,threshold:f(0,d(1,c))||1},S=!0;function C(t){let n=t[0].intersectionRatio;if(n!==c){if(!S)return o();n?o(!1,n):r=setTimeout(()=>{o(!1,1e-7)},1e3)}n===1&&!rt(l,e.getBoundingClientRect())&&o(),S=!1}try{n=new IntersectionObserver(C,{...x,root:i.ownerDocument})}catch{n=new IntersectionObserver(C,x)}n.observe(e)}return o(!0),a}function at(e,t,n,r){r===void 0&&(r={});let{ancestorScroll:i=!0,ancestorResize:a=!0,elementResize:o=typeof ResizeObserver==`function`,layoutShift:s=typeof IntersectionObserver==`function`,animationFrame:c=!1}=r,l=Me(e),u=i||a?[...l?X(l):[],...X(t)]:[];u.forEach(e=>{i&&e.addEventListener(`scroll`,n,{passive:!0}),a&&e.addEventListener(`resize`,n)});let d=l&&s?it(l,n):null,f=-1,p=null;o&&(p=new ResizeObserver(e=>{let[r]=e;r&&r.target===l&&p&&(p.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var e;(e=p)==null||e.observe(t)})),n()}),l&&!c&&p.observe(l),p.observe(t));let m,h=c?Q(e):null;c&&g();function g(){let t=Q(e);h&&!rt(h,t)&&n(),h=t,m=requestAnimationFrame(g)}return n(),()=>{var e;u.forEach(e=>{i&&e.removeEventListener(`scroll`,n),a&&e.removeEventListener(`resize`,n)}),d?.(),(e=p)==null||e.disconnect(),p=null,c&&cancelAnimationFrame(m)}}var ot=ue,st=de,ct=ie,lt=pe,ut=se,dt=re,ft=fe,pt=(e,t,n)=>{let r=new Map,i={platform:nt,...n},a={...i.platform,_c:r};return ne(e,t,{...i,platform:a})},mt=e(t(),1),ht=typeof document<`u`?l.useLayoutEffect:function(){};function gt(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e==`function`&&e.toString()===t.toString())return!0;let n,r,i;if(e&&t&&typeof e==`object`){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!gt(e[r],t[r]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,i[r]))return!1;for(r=n;r--!==0;){let n=i[r];if(!(n===`_owner`&&e.$$typeof)&&!gt(e[n],t[n]))return!1}return!0}return e!==e&&t!==t}function _t(e){return typeof window>`u`?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function vt(e,t){let n=_t(e);return Math.round(t*n)/n}function yt(e){let t=l.useRef(e);return ht(()=>{t.current=e}),t}function bt(e){e===void 0&&(e={});let{placement:t=`bottom`,strategy:n=`absolute`,middleware:r=[],platform:i,elements:{reference:a,floating:o}={},transform:s=!0,whileElementsMounted:c,open:u}=e,[d,f]=l.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[p,m]=l.useState(r);gt(p,r)||m(r);let[h,g]=l.useState(null),[_,v]=l.useState(null),y=l.useCallback(e=>{e!==C.current&&(C.current=e,g(e))},[]),b=l.useCallback(e=>{e!==w.current&&(w.current=e,v(e))},[]),x=a||h,S=o||_,C=l.useRef(null),w=l.useRef(null),T=l.useRef(d),E=c!=null,D=yt(c),O=yt(i),k=yt(u),A=l.useCallback(()=>{if(!C.current||!w.current)return;let e={placement:t,strategy:n,middleware:p};O.current&&(e.platform=O.current),pt(C.current,w.current,e).then(e=>{let t={...e,isPositioned:k.current!==!1};j.current&&!gt(T.current,t)&&(T.current=t,mt.flushSync(()=>{f(t)}))})},[p,t,n,O,k]);ht(()=>{u===!1&&T.current.isPositioned&&(T.current.isPositioned=!1,f(e=>({...e,isPositioned:!1})))},[u]);let j=l.useRef(!1);ht(()=>(j.current=!0,()=>{j.current=!1}),[]),ht(()=>{if(x&&(C.current=x),S&&(w.current=S),x&&S){if(D.current)return D.current(x,S,A);A()}},[x,S,A,D,E]);let M=l.useMemo(()=>({reference:C,floating:w,setReference:y,setFloating:b}),[y,b]),N=l.useMemo(()=>({reference:x,floating:S}),[x,S]),P=l.useMemo(()=>{let e={position:n,left:0,top:0};if(!N.floating)return e;let t=vt(N.floating,d.x),r=vt(N.floating,d.y);return s?{...e,transform:`translate(`+t+`px, `+r+`px)`,..._t(N.floating)>=1.5&&{willChange:`transform`}}:{position:n,left:t,top:r}},[n,s,N.floating,d.x,d.y]);return l.useMemo(()=>({...d,update:A,refs:M,elements:N,floatingStyles:P}),[d,A,M,N,P])}var xt=e=>{function t(e){return{}.hasOwnProperty.call(e,`current`)}return{name:`arrow`,options:e,fn(n){let{element:r,padding:i}=typeof e==`function`?e(n):e;return r&&t(r)?r.current==null?{}:dt({element:r.current,padding:i}).fn(n):r?dt({element:r,padding:i}).fn(n):{}}}},St=(e,t)=>({...ot(e),options:[e,t]}),Ct=(e,t)=>({...st(e),options:[e,t]}),wt=(e,t)=>({...ft(e),options:[e,t]}),Tt=(e,t)=>({...ct(e),options:[e,t]}),Et=(e,t)=>({...lt(e),options:[e,t]}),Dt=(e,t)=>({...ut(e),options:[e,t]}),Ot=(e,t)=>({...xt(e),options:[e,t]}),$=r(),kt=`Arrow`,At=l.forwardRef((e,t)=>{let{children:n,width:r=10,height:i=5,...a}=e;return(0,$.jsx)(c.svg,{...a,ref:t,width:r,height:i,viewBox:`0 0 30 10`,preserveAspectRatio:`none`,children:e.asChild?n:(0,$.jsx)(`polygon`,{points:`0,0 30,0 15,10`})})});At.displayName=kt;var jt=At;function Mt(e){let[t,n]=l.useState(void 0);return a(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});let t=new ResizeObserver(t=>{if(!Array.isArray(t)||!t.length)return;let r=t[0],i,a;if(`borderBoxSize`in r){let e=r.borderBoxSize,t=Array.isArray(e)?e[0]:e;i=t.inlineSize,a=t.blockSize}else i=e.offsetWidth,a=e.offsetHeight;n({width:i,height:a})});return t.observe(e,{box:`border-box`}),()=>t.unobserve(e)}else n(void 0)},[e]),t}var Nt=`Popper`,[Pt,Ft]=o(Nt),[It,Lt]=Pt(Nt),Rt=e=>{let{__scopePopper:t,children:n}=e,[r,i]=l.useState(null);return(0,$.jsx)(It,{scope:t,anchor:r,onAnchorChange:i,children:n})};Rt.displayName=Nt;var zt=`PopperAnchor`,Bt=l.forwardRef((e,t)=>{let{__scopePopper:n,virtualRef:r,...a}=e,o=Lt(zt,n),s=l.useRef(null),u=i(t,s),d=l.useRef(null);return l.useEffect(()=>{let e=d.current;d.current=r?.current||s.current,e!==d.current&&o.onAnchorChange(d.current)}),r?null:(0,$.jsx)(c.div,{...a,ref:u})});Bt.displayName=zt;var Vt=`PopperContent`,[Ht,Ut]=Pt(Vt),Wt=l.forwardRef((e,t)=>{let{__scopePopper:n,side:r=`bottom`,sideOffset:o=0,align:u=`center`,alignOffset:d=0,arrowPadding:f=0,avoidCollisions:p=!0,collisionBoundary:m=[],collisionPadding:h=0,sticky:g=`partial`,hideWhenDetached:_=!1,updatePositionStrategy:v=`optimized`,onPlaced:y,...b}=e,x=Lt(Vt,n),[S,C]=l.useState(null),w=i(t,e=>C(e)),[T,E]=l.useState(null),D=Mt(T),O=D?.width??0,k=D?.height??0,A=r+(u===`center`?``:`-`+u),j=typeof h==`number`?h:{top:0,right:0,bottom:0,left:0,...h},M=Array.isArray(m)?m:[m],N=M.length>0,P={padding:j,boundary:M.filter(Jt),altBoundary:N},{refs:ee,floatingStyles:F,placement:I,isPositioned:L,middlewareData:R}=bt({strategy:`fixed`,placement:A,whileElementsMounted:(...e)=>at(...e,{animationFrame:v===`always`}),elements:{reference:x.anchor},middleware:[St({mainAxis:o+k,alignmentAxis:d}),p&&Ct({mainAxis:!0,crossAxis:!1,limiter:g===`partial`?wt():void 0,...P}),p&&Tt({...P}),Et({...P,apply:({elements:e,rects:t,availableWidth:n,availableHeight:r})=>{let{width:i,height:a}=t.reference,o=e.floating.style;o.setProperty(`--radix-popper-available-width`,`${n}px`),o.setProperty(`--radix-popper-available-height`,`${r}px`),o.setProperty(`--radix-popper-anchor-width`,`${i}px`),o.setProperty(`--radix-popper-anchor-height`,`${a}px`)}}),T&&Ot({element:T,padding:f}),Yt({arrowWidth:O,arrowHeight:k}),_&&Dt({strategy:`referenceHidden`,...P})]}),[z,te]=Xt(I),ne=s(y);a(()=>{L&&ne?.()},[L,ne]);let re=R.arrow?.x,ie=R.arrow?.y,ae=R.arrow?.centerOffset!==0,[oe,se]=l.useState();return a(()=>{S&&se(window.getComputedStyle(S).zIndex)},[S]),(0,$.jsx)(`div`,{ref:ee.setFloating,"data-radix-popper-content-wrapper":``,style:{...F,transform:L?F.transform:`translate(0, -200%)`,minWidth:`max-content`,zIndex:oe,"--radix-popper-transform-origin":[R.transformOrigin?.x,R.transformOrigin?.y].join(` `),...R.hide?.referenceHidden&&{visibility:`hidden`,pointerEvents:`none`}},dir:e.dir,children:(0,$.jsx)(Ht,{scope:n,placedSide:z,onArrowChange:E,arrowX:re,arrowY:ie,shouldHideArrow:ae,children:(0,$.jsx)(c.div,{"data-side":z,"data-align":te,...b,ref:w,style:{...b.style,animation:L?void 0:`none`}})})})});Wt.displayName=Vt;var Gt=`PopperArrow`,Kt={top:`bottom`,right:`left`,bottom:`top`,left:`right`},qt=l.forwardRef(function(e,t){let{__scopePopper:n,...r}=e,i=Ut(Gt,n),a=Kt[i.placedSide];return(0,$.jsx)(`span`,{ref:i.onArrowChange,style:{position:`absolute`,left:i.arrowX,top:i.arrowY,[a]:0,transformOrigin:{top:``,right:`0 0`,bottom:`center 0`,left:`100% 0`}[i.placedSide],transform:{top:`translateY(100%)`,right:`translateY(50%) rotate(90deg) translateX(-50%)`,bottom:`rotate(180deg)`,left:`translateY(50%) rotate(-90deg) translateX(50%)`}[i.placedSide],visibility:i.shouldHideArrow?`hidden`:void 0},children:(0,$.jsx)(jt,{...r,ref:t,style:{...r.style,display:`block`}})})});qt.displayName=Gt;function Jt(e){return e!==null}var Yt=e=>({name:`transformOrigin`,options:e,fn(t){let{placement:n,rects:r,middlewareData:i}=t,a=i.arrow?.centerOffset!==0,o=a?0:e.arrowWidth,s=a?0:e.arrowHeight,[c,l]=Xt(n),u={start:`0%`,center:`50%`,end:`100%`}[l],d=(i.arrow?.x??0)+o/2,f=(i.arrow?.y??0)+s/2,p=``,m=``;return c===`bottom`?(p=a?u:`${d}px`,m=`${-s}px`):c===`top`?(p=a?u:`${d}px`,m=`${r.floating.height+s}px`):c===`right`?(p=`${-s}px`,m=a?u:`${f}px`):c===`left`&&(p=`${r.floating.width+s}px`,m=a?u:`${f}px`),{data:{x:p,y:m}}}});function Xt(e){let[t,n=`center`]=e.split(`-`);return[t,n]}var Zt=Rt,Qt=Bt,$t=Wt,en=qt;export{Ft as a,Zt as i,en as n,Mt as o,$t as r,Qt as t};
1
+ import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{a as t,o as n,t as r}from"./react-vendor-Ee0-5T4I.js";import{s as i}from"./utils-uGptTPGm.js";import{a,h as o,l as s,u as c}from"./dist-BhdiICUV.js";var l=e(n(),1),u=[`top`,`right`,`bottom`,`left`],d=Math.min,f=Math.max,p=Math.round,m=Math.floor,h=e=>({x:e,y:e}),g={left:`right`,right:`left`,bottom:`top`,top:`bottom`},_={start:`end`,end:`start`};function v(e,t,n){return f(e,d(t,n))}function y(e,t){return typeof e==`function`?e(t):e}function b(e){return e.split(`-`)[0]}function x(e){return e.split(`-`)[1]}function S(e){return e===`x`?`y`:`x`}function C(e){return e===`y`?`height`:`width`}var w=new Set([`top`,`bottom`]);function T(e){return w.has(b(e))?`y`:`x`}function E(e){return S(T(e))}function D(e,t,n){n===void 0&&(n=!1);let r=x(e),i=E(e),a=C(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=F(o)),[o,F(o)]}function O(e){let t=F(e);return[k(e),t,k(t)]}function k(e){return e.replace(/start|end/g,e=>_[e])}var A=[`left`,`right`],j=[`right`,`left`],M=[`top`,`bottom`],N=[`bottom`,`top`];function P(e,t,n){switch(e){case`top`:case`bottom`:return n?t?j:A:t?A:j;case`left`:case`right`:return t?M:N;default:return[]}}function ee(e,t,n,r){let i=x(e),a=P(b(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(k)))),a}function F(e){return e.replace(/left|right|bottom|top/g,e=>g[e])}function I(e){return{top:0,right:0,bottom:0,left:0,...e}}function L(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:I(e)}function R(e){let{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function z(e,t,n){let{reference:r,floating:i}=e,a=T(t),o=E(t),s=C(o),c=b(t),l=a===`y`,u=r.x+r.width/2-i.width/2,d=r.y+r.height/2-i.height/2,f=r[s]/2-i[s]/2,p;switch(c){case`top`:p={x:u,y:r.y-i.height};break;case`bottom`:p={x:u,y:r.y+r.height};break;case`right`:p={x:r.x+r.width,y:d};break;case`left`:p={x:r.x-i.width,y:d};break;default:p={x:r.x,y:r.y}}switch(x(t)){case`start`:p[o]-=f*(n&&l?-1:1);break;case`end`:p[o]+=f*(n&&l?-1:1);break}return p}async function te(e,t){t===void 0&&(t={});let{x:n,y:r,platform:i,rects:a,elements:o,strategy:s}=e,{boundary:c=`clippingAncestors`,rootBoundary:l=`viewport`,elementContext:u=`floating`,altBoundary:d=!1,padding:f=0}=y(t,e),p=L(f),m=o[d?u===`floating`?`reference`:`floating`:u],h=R(await i.getClippingRect({element:await(i.isElement==null?void 0:i.isElement(m))??!0?m:m.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(o.floating)),boundary:c,rootBoundary:l,strategy:s})),g=u===`floating`?{x:n,y:r,width:a.floating.width,height:a.floating.height}:a.reference,_=await(i.getOffsetParent==null?void 0:i.getOffsetParent(o.floating)),v=await(i.isElement==null?void 0:i.isElement(_))&&await(i.getScale==null?void 0:i.getScale(_))||{x:1,y:1},b=R(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:o,rect:g,offsetParent:_,strategy:s}):g);return{top:(h.top-b.top+p.top)/v.y,bottom:(b.bottom-h.bottom+p.bottom)/v.y,left:(h.left-b.left+p.left)/v.x,right:(b.right-h.right+p.right)/v.x}}var ne=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=a.filter(Boolean),c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=z(l,r,c),f=r,p={},m=0;for(let n=0;n<s.length;n++){let{name:a,fn:h}=s[n],{x:g,y:_,data:v,reset:y}=await h({x:u,y:d,initialPlacement:r,placement:f,strategy:i,middlewareData:p,rects:l,platform:{...o,detectOverflow:o.detectOverflow??te},elements:{reference:e,floating:t}});u=g??u,d=_??d,p={...p,[a]:{...p[a],...v}},y&&m<=50&&(m++,typeof y==`object`&&(y.placement&&(f=y.placement),y.rects&&(l=y.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:i}):y.rects),{x:u,y:d}=z(l,f,c)),n=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:p}},re=e=>({name:`arrow`,options:e,async fn(t){let{x:n,y:r,placement:i,rects:a,platform:o,elements:s,middlewareData:c}=t,{element:l,padding:u=0}=y(e,t)||{};if(l==null)return{};let f=L(u),p={x:n,y:r},m=E(i),h=C(m),g=await o.getDimensions(l),_=m===`y`,b=_?`top`:`left`,S=_?`bottom`:`right`,w=_?`clientHeight`:`clientWidth`,T=a.reference[h]+a.reference[m]-p[m]-a.floating[h],D=p[m]-a.reference[m],O=await(o.getOffsetParent==null?void 0:o.getOffsetParent(l)),k=O?O[w]:0;(!k||!await(o.isElement==null?void 0:o.isElement(O)))&&(k=s.floating[w]||a.floating[h]);let A=T/2-D/2,j=k/2-g[h]/2-1,M=d(f[b],j),N=d(f[S],j),P=M,ee=k-g[h]-N,F=k/2-g[h]/2+A,I=v(P,F,ee),R=!c.arrow&&x(i)!=null&&F!==I&&a.reference[h]/2-(F<P?M:N)-g[h]/2<0,z=R?F<P?F-P:F-ee:0;return{[m]:p[m]+z,data:{[m]:I,centerOffset:F-I-z,...R&&{alignmentOffset:z}},reset:R}}}),ie=function(e){return e===void 0&&(e={}),{name:`flip`,options:e,async fn(t){var n;let{placement:r,middlewareData:i,rects:a,initialPlacement:o,platform:s,elements:c}=t,{mainAxis:l=!0,crossAxis:u=!0,fallbackPlacements:d,fallbackStrategy:f=`bestFit`,fallbackAxisSideDirection:p=`none`,flipAlignment:m=!0,...h}=y(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};let g=b(r),_=T(o),v=b(o)===o,x=await(s.isRTL==null?void 0:s.isRTL(c.floating)),S=d||(v||!m?[F(o)]:O(o)),C=p!==`none`;!d&&C&&S.push(...ee(o,m,p,x));let w=[o,...S],E=await s.detectOverflow(t,h),k=[],A=i.flip?.overflows||[];if(l&&k.push(E[g]),u){let e=D(r,a,x);k.push(E[e[0]],E[e[1]])}if(A=[...A,{placement:r,overflows:k}],!k.every(e=>e<=0)){let e=(i.flip?.index||0)+1,t=w[e];if(t&&(!(u===`alignment`&&_!==T(t))||A.every(e=>T(e.placement)===_?e.overflows[0]>0:!0)))return{data:{index:e,overflows:A},reset:{placement:t}};let n=A.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0]?.placement;if(!n)switch(f){case`bestFit`:{let e=A.filter(e=>{if(C){let t=T(e.placement);return t===_||t===`y`}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0]?.[0];e&&(n=e);break}case`initialPlacement`:n=o;break}if(r!==n)return{reset:{placement:n}}}return{}}}};function ae(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function oe(e){return u.some(t=>e[t]>=0)}var se=function(e){return e===void 0&&(e={}),{name:`hide`,options:e,async fn(t){let{rects:n,platform:r}=t,{strategy:i=`referenceHidden`,...a}=y(e,t);switch(i){case`referenceHidden`:{let e=ae(await r.detectOverflow(t,{...a,elementContext:`reference`}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:oe(e)}}}case`escaped`:{let e=ae(await r.detectOverflow(t,{...a,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:oe(e)}}}default:return{}}}}},ce=new Set([`left`,`top`]);async function le(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=b(n),s=x(n),c=T(n)===`y`,l=ce.has(o)?-1:1,u=a&&c?-1:1,d=y(t,e),{mainAxis:f,crossAxis:p,alignmentAxis:m}=typeof d==`number`?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&typeof m==`number`&&(p=s===`end`?m*-1:m),c?{x:p*u,y:f*l}:{x:f*l,y:p*u}}var ue=function(e){return e===void 0&&(e=0),{name:`offset`,options:e,async fn(t){var n;let{x:r,y:i,placement:a,middlewareData:o}=t,s=await le(t,e);return a===o.offset?.placement&&(n=o.arrow)!=null&&n.alignmentOffset?{}:{x:r+s.x,y:i+s.y,data:{...s,placement:a}}}}},de=function(e){return e===void 0&&(e={}),{name:`shift`,options:e,async fn(t){let{x:n,y:r,placement:i,platform:a}=t,{mainAxis:o=!0,crossAxis:s=!1,limiter:c={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...l}=y(e,t),u={x:n,y:r},d=await a.detectOverflow(t,l),f=T(b(i)),p=S(f),m=u[p],h=u[f];if(o){let e=p===`y`?`top`:`left`,t=p===`y`?`bottom`:`right`,n=m+d[e],r=m-d[t];m=v(n,m,r)}if(s){let e=f===`y`?`top`:`left`,t=f===`y`?`bottom`:`right`,n=h+d[e],r=h-d[t];h=v(n,h,r)}let g=c.fn({...t,[p]:m,[f]:h});return{...g,data:{x:g.x-n,y:g.y-r,enabled:{[p]:o,[f]:s}}}}}},fe=function(e){return e===void 0&&(e={}),{options:e,fn(t){let{x:n,y:r,placement:i,rects:a,middlewareData:o}=t,{offset:s=0,mainAxis:c=!0,crossAxis:l=!0}=y(e,t),u={x:n,y:r},d=T(i),f=S(d),p=u[f],m=u[d],h=y(s,t),g=typeof h==`number`?{mainAxis:h,crossAxis:0}:{mainAxis:0,crossAxis:0,...h};if(c){let e=f===`y`?`height`:`width`,t=a.reference[f]-a.floating[e]+g.mainAxis,n=a.reference[f]+a.reference[e]-g.mainAxis;p<t?p=t:p>n&&(p=n)}if(l){let e=f===`y`?`width`:`height`,t=ce.has(b(i)),n=a.reference[d]-a.floating[e]+(t&&o.offset?.[d]||0)+(t?0:g.crossAxis),r=a.reference[d]+a.reference[e]+(t?0:o.offset?.[d]||0)-(t?g.crossAxis:0);m<n?m=n:m>r&&(m=r)}return{[f]:p,[d]:m}}}},pe=function(e){return e===void 0&&(e={}),{name:`size`,options:e,async fn(t){var n,r;let{placement:i,rects:a,platform:o,elements:s}=t,{apply:c=()=>{},...l}=y(e,t),u=await o.detectOverflow(t,l),p=b(i),m=x(i),h=T(i)===`y`,{width:g,height:_}=a.floating,v,S;p===`top`||p===`bottom`?(v=p,S=m===(await(o.isRTL==null?void 0:o.isRTL(s.floating))?`start`:`end`)?`left`:`right`):(S=p,v=m===`end`?`top`:`bottom`);let C=_-u.top-u.bottom,w=g-u.left-u.right,E=d(_-u[v],C),D=d(g-u[S],w),O=!t.middlewareData.shift,k=E,A=D;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(A=w),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(k=C),O&&!m){let e=f(u.left,0),t=f(u.right,0),n=f(u.top,0),r=f(u.bottom,0);h?A=g-2*(e!==0||t!==0?e+t:f(u.left,u.right)):k=_-2*(n!==0||r!==0?n+r:f(u.top,u.bottom))}await c({...t,availableWidth:A,availableHeight:k});let j=await o.getDimensions(s.floating);return g!==j.width||_!==j.height?{reset:{rects:!0}}:{}}}};function B(){return typeof window<`u`}function V(e){return me(e)?(e.nodeName||``).toLowerCase():`#document`}function H(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function U(e){return((me(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function me(e){return B()?e instanceof Node||e instanceof H(e).Node:!1}function W(e){return B()?e instanceof Element||e instanceof H(e).Element:!1}function G(e){return B()?e instanceof HTMLElement||e instanceof H(e).HTMLElement:!1}function he(e){return!B()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof H(e).ShadowRoot}var ge=new Set([`inline`,`contents`]);function K(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=J(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!ge.has(i)}var _e=new Set([`table`,`td`,`th`]);function ve(e){return _e.has(V(e))}var ye=[`:popover-open`,`:modal`];function be(e){return ye.some(t=>{try{return e.matches(t)}catch{return!1}})}var xe=[`transform`,`translate`,`scale`,`rotate`,`perspective`],Se=[`transform`,`translate`,`scale`,`rotate`,`perspective`,`filter`],Ce=[`paint`,`layout`,`strict`,`content`];function we(e){let t=Ee(),n=W(e)?J(e):e;return xe.some(e=>n[e]?n[e]!==`none`:!1)||(n.containerType?n.containerType!==`normal`:!1)||!t&&(n.backdropFilter?n.backdropFilter!==`none`:!1)||!t&&(n.filter?n.filter!==`none`:!1)||Se.some(e=>(n.willChange||``).includes(e))||Ce.some(e=>(n.contain||``).includes(e))}function Te(e){let t=Y(e);for(;G(t)&&!q(t);){if(we(t))return t;if(be(t))return null;t=Y(t)}return null}function Ee(){return typeof CSS>`u`||!CSS.supports?!1:CSS.supports(`-webkit-backdrop-filter`,`none`)}var De=new Set([`html`,`body`,`#document`]);function q(e){return De.has(V(e))}function J(e){return H(e).getComputedStyle(e)}function Oe(e){return W(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Y(e){if(V(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||he(e)&&e.host||U(e);return he(t)?t.host:t}function ke(e){let t=Y(e);return q(t)?e.ownerDocument?e.ownerDocument.body:e.body:G(t)&&K(t)?t:ke(t)}function X(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=ke(e),i=r===e.ownerDocument?.body,a=H(r);if(i){let e=Ae(a);return t.concat(a,a.visualViewport||[],K(r)?r:[],e&&n?X(e):[])}return t.concat(r,X(r,[],n))}function Ae(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function je(e){let t=J(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=G(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=p(n)!==a||p(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function Me(e){return W(e)?e:e.contextElement}function Z(e){let t=Me(e);if(!G(t))return h(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=je(t),o=(a?p(n.width):n.width)/r,s=(a?p(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}var Ne=h(0);function Pe(e){let t=H(e);return!Ee()||!t.visualViewport?Ne:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Fe(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==H(e)?!1:t}function Q(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=Me(e),o=h(1);t&&(r?W(r)&&(o=Z(r)):o=Z(e));let s=Fe(a,n,r)?Pe(a):h(0),c=(i.left+s.x)/o.x,l=(i.top+s.y)/o.y,u=i.width/o.x,d=i.height/o.y;if(a){let e=H(a),t=r&&W(r)?H(r):r,n=e,i=Ae(n);for(;i&&r&&t!==n;){let e=Z(i),t=i.getBoundingClientRect(),r=J(i),a=t.left+(i.clientLeft+parseFloat(r.paddingLeft))*e.x,o=t.top+(i.clientTop+parseFloat(r.paddingTop))*e.y;c*=e.x,l*=e.y,u*=e.x,d*=e.y,c+=a,l+=o,n=H(i),i=Ae(n)}}return R({width:u,height:d,x:c,y:l})}function Ie(e,t){let n=Oe(e).scrollLeft;return t?t.left+n:Q(U(e)).left+n}function Le(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-Ie(e,n),y:n.top+t.scrollTop}}function Re(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=U(r),s=t?be(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=h(1),u=h(0),d=G(r);if((d||!d&&!a)&&((V(r)!==`body`||K(o))&&(c=Oe(r)),G(r))){let e=Q(r);l=Z(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=o&&!d&&!a?Le(o,c):h(0);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-c.scrollLeft*l.x+u.x+f.x,y:n.y*l.y-c.scrollTop*l.y+u.y+f.y}}function ze(e){return Array.from(e.getClientRects())}function Be(e){let t=U(e),n=Oe(e),r=e.ownerDocument.body,i=f(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),a=f(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight),o=-n.scrollLeft+Ie(e),s=-n.scrollTop;return J(r).direction===`rtl`&&(o+=f(t.clientWidth,r.clientWidth)-i),{width:i,height:a,x:o,y:s}}var Ve=25;function He(e,t){let n=H(e),r=U(e),i=n.visualViewport,a=r.clientWidth,o=r.clientHeight,s=0,c=0;if(i){a=i.width,o=i.height;let e=Ee();(!e||e&&t===`fixed`)&&(s=i.offsetLeft,c=i.offsetTop)}let l=Ie(r);if(l<=0){let e=r.ownerDocument,t=e.body,n=getComputedStyle(t),i=e.compatMode===`CSS1Compat`&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,o=Math.abs(r.clientWidth-t.clientWidth-i);o<=Ve&&(a-=o)}else l<=Ve&&(a+=l);return{width:a,height:o,x:s,y:c}}var Ue=new Set([`absolute`,`fixed`]);function We(e,t){let n=Q(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=G(e)?Z(e):h(1);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function Ge(e,t,n){let r;if(t===`viewport`)r=He(e,n);else if(t===`document`)r=Be(U(e));else if(W(t))r=We(t,n);else{let n=Pe(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return R(r)}function Ke(e,t){let n=Y(e);return n===t||!W(n)||q(n)?!1:J(n).position===`fixed`||Ke(n,t)}function qe(e,t){let n=t.get(e);if(n)return n;let r=X(e,[],!1).filter(e=>W(e)&&V(e)!==`body`),i=null,a=J(e).position===`fixed`,o=a?Y(e):e;for(;W(o)&&!q(o);){let t=J(o),n=we(o);!n&&t.position===`fixed`&&(i=null),(a?!n&&!i:!n&&t.position===`static`&&i&&Ue.has(i.position)||K(o)&&!n&&Ke(e,o))?r=r.filter(e=>e!==o):i=t,o=Y(o)}return t.set(e,r),r}function Je(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?be(t)?[]:qe(t,this._c):[].concat(n),r],o=a[0],s=a.reduce((e,n)=>{let r=Ge(t,n,i);return e.top=f(r.top,e.top),e.right=d(r.right,e.right),e.bottom=d(r.bottom,e.bottom),e.left=f(r.left,e.left),e},Ge(t,o,i));return{width:s.right-s.left,height:s.bottom-s.top,x:s.left,y:s.top}}function Ye(e){let{width:t,height:n}=je(e);return{width:t,height:n}}function Xe(e,t,n){let r=G(t),i=U(t),a=n===`fixed`,o=Q(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=h(0);function l(){c.x=Ie(i)}if(r||!r&&!a)if((V(t)!==`body`||K(i))&&(s=Oe(t)),r){let e=Q(t,!0,a,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}else i&&l();a&&!r&&i&&l();let u=i&&!r&&!a?Le(i,s):h(0);return{x:o.left+s.scrollLeft-c.x-u.x,y:o.top+s.scrollTop-c.y-u.y,width:o.width,height:o.height}}function Ze(e){return J(e).position===`static`}function Qe(e,t){if(!G(e)||J(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return U(e)===n&&(n=n.ownerDocument.body),n}function $e(e,t){let n=H(e);if(be(e))return n;if(!G(e)){let t=Y(e);for(;t&&!q(t);){if(W(t)&&!Ze(t))return t;t=Y(t)}return n}let r=Qe(e,t);for(;r&&ve(r)&&Ze(r);)r=Qe(r,t);return r&&q(r)&&Ze(r)&&!we(r)?n:r||Te(e)||n}var et=async function(e){let t=this.getOffsetParent||$e,n=this.getDimensions,r=await n(e.floating);return{reference:Xe(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function tt(e){return J(e).direction===`rtl`}var nt={convertOffsetParentRelativeRectToViewportRelativeRect:Re,getDocumentElement:U,getClippingRect:Je,getOffsetParent:$e,getElementRects:et,getClientRects:ze,getDimensions:Ye,getScale:Z,isElement:W,isRTL:tt};function rt(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function it(e,t){let n=null,r,i=U(e);function a(){var e;clearTimeout(r),(e=n)==null||e.disconnect(),n=null}function o(s,c){s===void 0&&(s=!1),c===void 0&&(c=1),a();let l=e.getBoundingClientRect(),{left:u,top:p,width:h,height:g}=l;if(s||t(),!h||!g)return;let _=m(p),v=m(i.clientWidth-(u+h)),y=m(i.clientHeight-(p+g)),b=m(u),x={rootMargin:-_+`px `+-v+`px `+-y+`px `+-b+`px`,threshold:f(0,d(1,c))||1},S=!0;function C(t){let n=t[0].intersectionRatio;if(n!==c){if(!S)return o();n?o(!1,n):r=setTimeout(()=>{o(!1,1e-7)},1e3)}n===1&&!rt(l,e.getBoundingClientRect())&&o(),S=!1}try{n=new IntersectionObserver(C,{...x,root:i.ownerDocument})}catch{n=new IntersectionObserver(C,x)}n.observe(e)}return o(!0),a}function at(e,t,n,r){r===void 0&&(r={});let{ancestorScroll:i=!0,ancestorResize:a=!0,elementResize:o=typeof ResizeObserver==`function`,layoutShift:s=typeof IntersectionObserver==`function`,animationFrame:c=!1}=r,l=Me(e),u=i||a?[...l?X(l):[],...X(t)]:[];u.forEach(e=>{i&&e.addEventListener(`scroll`,n,{passive:!0}),a&&e.addEventListener(`resize`,n)});let d=l&&s?it(l,n):null,f=-1,p=null;o&&(p=new ResizeObserver(e=>{let[r]=e;r&&r.target===l&&p&&(p.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var e;(e=p)==null||e.observe(t)})),n()}),l&&!c&&p.observe(l),p.observe(t));let m,h=c?Q(e):null;c&&g();function g(){let t=Q(e);h&&!rt(h,t)&&n(),h=t,m=requestAnimationFrame(g)}return n(),()=>{var e;u.forEach(e=>{i&&e.removeEventListener(`scroll`,n),a&&e.removeEventListener(`resize`,n)}),d?.(),(e=p)==null||e.disconnect(),p=null,c&&cancelAnimationFrame(m)}}var ot=ue,st=de,ct=ie,lt=pe,ut=se,dt=re,ft=fe,pt=(e,t,n)=>{let r=new Map,i={platform:nt,...n},a={...i.platform,_c:r};return ne(e,t,{...i,platform:a})},mt=e(t(),1),ht=typeof document<`u`?l.useLayoutEffect:function(){};function gt(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e==`function`&&e.toString()===t.toString())return!0;let n,r,i;if(e&&t&&typeof e==`object`){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!gt(e[r],t[r]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,i[r]))return!1;for(r=n;r--!==0;){let n=i[r];if(!(n===`_owner`&&e.$$typeof)&&!gt(e[n],t[n]))return!1}return!0}return e!==e&&t!==t}function _t(e){return typeof window>`u`?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function vt(e,t){let n=_t(e);return Math.round(t*n)/n}function yt(e){let t=l.useRef(e);return ht(()=>{t.current=e}),t}function bt(e){e===void 0&&(e={});let{placement:t=`bottom`,strategy:n=`absolute`,middleware:r=[],platform:i,elements:{reference:a,floating:o}={},transform:s=!0,whileElementsMounted:c,open:u}=e,[d,f]=l.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[p,m]=l.useState(r);gt(p,r)||m(r);let[h,g]=l.useState(null),[_,v]=l.useState(null),y=l.useCallback(e=>{e!==C.current&&(C.current=e,g(e))},[]),b=l.useCallback(e=>{e!==w.current&&(w.current=e,v(e))},[]),x=a||h,S=o||_,C=l.useRef(null),w=l.useRef(null),T=l.useRef(d),E=c!=null,D=yt(c),O=yt(i),k=yt(u),A=l.useCallback(()=>{if(!C.current||!w.current)return;let e={placement:t,strategy:n,middleware:p};O.current&&(e.platform=O.current),pt(C.current,w.current,e).then(e=>{let t={...e,isPositioned:k.current!==!1};j.current&&!gt(T.current,t)&&(T.current=t,mt.flushSync(()=>{f(t)}))})},[p,t,n,O,k]);ht(()=>{u===!1&&T.current.isPositioned&&(T.current.isPositioned=!1,f(e=>({...e,isPositioned:!1})))},[u]);let j=l.useRef(!1);ht(()=>(j.current=!0,()=>{j.current=!1}),[]),ht(()=>{if(x&&(C.current=x),S&&(w.current=S),x&&S){if(D.current)return D.current(x,S,A);A()}},[x,S,A,D,E]);let M=l.useMemo(()=>({reference:C,floating:w,setReference:y,setFloating:b}),[y,b]),N=l.useMemo(()=>({reference:x,floating:S}),[x,S]),P=l.useMemo(()=>{let e={position:n,left:0,top:0};if(!N.floating)return e;let t=vt(N.floating,d.x),r=vt(N.floating,d.y);return s?{...e,transform:`translate(`+t+`px, `+r+`px)`,..._t(N.floating)>=1.5&&{willChange:`transform`}}:{position:n,left:t,top:r}},[n,s,N.floating,d.x,d.y]);return l.useMemo(()=>({...d,update:A,refs:M,elements:N,floatingStyles:P}),[d,A,M,N,P])}var xt=e=>{function t(e){return{}.hasOwnProperty.call(e,`current`)}return{name:`arrow`,options:e,fn(n){let{element:r,padding:i}=typeof e==`function`?e(n):e;return r&&t(r)?r.current==null?{}:dt({element:r.current,padding:i}).fn(n):r?dt({element:r,padding:i}).fn(n):{}}}},St=(e,t)=>({...ot(e),options:[e,t]}),Ct=(e,t)=>({...st(e),options:[e,t]}),wt=(e,t)=>({...ft(e),options:[e,t]}),Tt=(e,t)=>({...ct(e),options:[e,t]}),Et=(e,t)=>({...lt(e),options:[e,t]}),Dt=(e,t)=>({...ut(e),options:[e,t]}),Ot=(e,t)=>({...xt(e),options:[e,t]}),$=r(),kt=`Arrow`,At=l.forwardRef((e,t)=>{let{children:n,width:r=10,height:i=5,...a}=e;return(0,$.jsx)(c.svg,{...a,ref:t,width:r,height:i,viewBox:`0 0 30 10`,preserveAspectRatio:`none`,children:e.asChild?n:(0,$.jsx)(`polygon`,{points:`0,0 30,0 15,10`})})});At.displayName=kt;var jt=At;function Mt(e){let[t,n]=l.useState(void 0);return a(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});let t=new ResizeObserver(t=>{if(!Array.isArray(t)||!t.length)return;let r=t[0],i,a;if(`borderBoxSize`in r){let e=r.borderBoxSize,t=Array.isArray(e)?e[0]:e;i=t.inlineSize,a=t.blockSize}else i=e.offsetWidth,a=e.offsetHeight;n({width:i,height:a})});return t.observe(e,{box:`border-box`}),()=>t.unobserve(e)}else n(void 0)},[e]),t}var Nt=`Popper`,[Pt,Ft]=o(Nt),[It,Lt]=Pt(Nt),Rt=e=>{let{__scopePopper:t,children:n}=e,[r,i]=l.useState(null);return(0,$.jsx)(It,{scope:t,anchor:r,onAnchorChange:i,children:n})};Rt.displayName=Nt;var zt=`PopperAnchor`,Bt=l.forwardRef((e,t)=>{let{__scopePopper:n,virtualRef:r,...a}=e,o=Lt(zt,n),s=l.useRef(null),u=i(t,s),d=l.useRef(null);return l.useEffect(()=>{let e=d.current;d.current=r?.current||s.current,e!==d.current&&o.onAnchorChange(d.current)}),r?null:(0,$.jsx)(c.div,{...a,ref:u})});Bt.displayName=zt;var Vt=`PopperContent`,[Ht,Ut]=Pt(Vt),Wt=l.forwardRef((e,t)=>{let{__scopePopper:n,side:r=`bottom`,sideOffset:o=0,align:u=`center`,alignOffset:d=0,arrowPadding:f=0,avoidCollisions:p=!0,collisionBoundary:m=[],collisionPadding:h=0,sticky:g=`partial`,hideWhenDetached:_=!1,updatePositionStrategy:v=`optimized`,onPlaced:y,...b}=e,x=Lt(Vt,n),[S,C]=l.useState(null),w=i(t,e=>C(e)),[T,E]=l.useState(null),D=Mt(T),O=D?.width??0,k=D?.height??0,A=r+(u===`center`?``:`-`+u),j=typeof h==`number`?h:{top:0,right:0,bottom:0,left:0,...h},M=Array.isArray(m)?m:[m],N=M.length>0,P={padding:j,boundary:M.filter(Jt),altBoundary:N},{refs:ee,floatingStyles:F,placement:I,isPositioned:L,middlewareData:R}=bt({strategy:`fixed`,placement:A,whileElementsMounted:(...e)=>at(...e,{animationFrame:v===`always`}),elements:{reference:x.anchor},middleware:[St({mainAxis:o+k,alignmentAxis:d}),p&&Ct({mainAxis:!0,crossAxis:!1,limiter:g===`partial`?wt():void 0,...P}),p&&Tt({...P}),Et({...P,apply:({elements:e,rects:t,availableWidth:n,availableHeight:r})=>{let{width:i,height:a}=t.reference,o=e.floating.style;o.setProperty(`--radix-popper-available-width`,`${n}px`),o.setProperty(`--radix-popper-available-height`,`${r}px`),o.setProperty(`--radix-popper-anchor-width`,`${i}px`),o.setProperty(`--radix-popper-anchor-height`,`${a}px`)}}),T&&Ot({element:T,padding:f}),Yt({arrowWidth:O,arrowHeight:k}),_&&Dt({strategy:`referenceHidden`,...P})]}),[z,te]=Xt(I),ne=s(y);a(()=>{L&&ne?.()},[L,ne]);let re=R.arrow?.x,ie=R.arrow?.y,ae=R.arrow?.centerOffset!==0,[oe,se]=l.useState();return a(()=>{S&&se(window.getComputedStyle(S).zIndex)},[S]),(0,$.jsx)(`div`,{ref:ee.setFloating,"data-radix-popper-content-wrapper":``,style:{...F,transform:L?F.transform:`translate(0, -200%)`,minWidth:`max-content`,zIndex:oe,"--radix-popper-transform-origin":[R.transformOrigin?.x,R.transformOrigin?.y].join(` `),...R.hide?.referenceHidden&&{visibility:`hidden`,pointerEvents:`none`}},dir:e.dir,children:(0,$.jsx)(Ht,{scope:n,placedSide:z,onArrowChange:E,arrowX:re,arrowY:ie,shouldHideArrow:ae,children:(0,$.jsx)(c.div,{"data-side":z,"data-align":te,...b,ref:w,style:{...b.style,animation:L?void 0:`none`}})})})});Wt.displayName=Vt;var Gt=`PopperArrow`,Kt={top:`bottom`,right:`left`,bottom:`top`,left:`right`},qt=l.forwardRef(function(e,t){let{__scopePopper:n,...r}=e,i=Ut(Gt,n),a=Kt[i.placedSide];return(0,$.jsx)(`span`,{ref:i.onArrowChange,style:{position:`absolute`,left:i.arrowX,top:i.arrowY,[a]:0,transformOrigin:{top:``,right:`0 0`,bottom:`center 0`,left:`100% 0`}[i.placedSide],transform:{top:`translateY(100%)`,right:`translateY(50%) rotate(90deg) translateX(-50%)`,bottom:`rotate(180deg)`,left:`translateY(50%) rotate(-90deg) translateX(50%)`}[i.placedSide],visibility:i.shouldHideArrow?`hidden`:void 0},children:(0,$.jsx)(jt,{...r,ref:t,style:{...r.style,display:`block`}})})});qt.displayName=Gt;function Jt(e){return e!==null}var Yt=e=>({name:`transformOrigin`,options:e,fn(t){let{placement:n,rects:r,middlewareData:i}=t,a=i.arrow?.centerOffset!==0,o=a?0:e.arrowWidth,s=a?0:e.arrowHeight,[c,l]=Xt(n),u={start:`0%`,center:`50%`,end:`100%`}[l],d=(i.arrow?.x??0)+o/2,f=(i.arrow?.y??0)+s/2,p=``,m=``;return c===`bottom`?(p=a?u:`${d}px`,m=`${-s}px`):c===`top`?(p=a?u:`${d}px`,m=`${r.floating.height+s}px`):c===`right`?(p=`${-s}px`,m=a?u:`${f}px`):c===`left`&&(p=`${r.floating.width+s}px`,m=a?u:`${f}px`),{data:{x:p,y:m}}}});function Xt(e){let[t,n=`center`]=e.split(`-`);return[t,n]}var Zt=Rt,Qt=Bt,$t=Wt,en=qt;export{Ft as a,Zt as i,en as n,Mt as o,$t as r,Qt as t};
@@ -1,4 +1,4 @@
1
- import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{o as t,t as n}from"./react-vendor-Ee0-5T4I.js";import{s as r}from"./utils-CWTBjUlE.js";import{l as i,u as a}from"./dist-DqKWH8sc.js";var o=e(t(),1),s=n(),c=`focusScope.autoFocusOnMount`,l=`focusScope.autoFocusOnUnmount`,u={bubbles:!1,cancelable:!0},d=`FocusScope`,f=o.forwardRef((e,t)=>{let{loop:n=!1,trapped:d=!1,onMountAutoFocus:f,onUnmountAutoFocus:g,..._}=e,[v,x]=o.useState(null),S=i(f),w=i(g),T=o.useRef(null),E=r(t,e=>x(e)),D=o.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;o.useEffect(()=>{if(d){let e=function(e){if(D.paused||!v)return;let t=e.target;v.contains(t)?T.current=t:y(T.current,{select:!0})},t=function(e){if(D.paused||!v)return;let t=e.relatedTarget;t!==null&&(v.contains(t)||y(T.current,{select:!0}))},n=function(e){if(document.activeElement===document.body)for(let t of e)t.removedNodes.length>0&&y(v)};document.addEventListener(`focusin`,e),document.addEventListener(`focusout`,t);let r=new MutationObserver(n);return v&&r.observe(v,{childList:!0,subtree:!0}),()=>{document.removeEventListener(`focusin`,e),document.removeEventListener(`focusout`,t),r.disconnect()}}},[d,v,D.paused]),o.useEffect(()=>{if(v){b.add(D);let e=document.activeElement;if(!v.contains(e)){let t=new CustomEvent(c,u);v.addEventListener(c,S),v.dispatchEvent(t),t.defaultPrevented||(p(C(h(v)),{select:!0}),document.activeElement===e&&y(v))}return()=>{v.removeEventListener(c,S),setTimeout(()=>{let t=new CustomEvent(l,u);v.addEventListener(l,w),v.dispatchEvent(t),t.defaultPrevented||y(e??document.body,{select:!0}),v.removeEventListener(l,w),b.remove(D)},0)}}},[v,S,w,D]);let O=o.useCallback(e=>{if(!n&&!d||D.paused)return;let t=e.key===`Tab`&&!e.altKey&&!e.ctrlKey&&!e.metaKey,r=document.activeElement;if(t&&r){let t=e.currentTarget,[i,a]=m(t);i&&a?!e.shiftKey&&r===a?(e.preventDefault(),n&&y(i,{select:!0})):e.shiftKey&&r===i&&(e.preventDefault(),n&&y(a,{select:!0})):r===t&&e.preventDefault()}},[n,d,D.paused]);return(0,s.jsx)(a.div,{tabIndex:-1,..._,ref:E,onKeyDown:O})});f.displayName=d;function p(e,{select:t=!1}={}){let n=document.activeElement;for(let r of e)if(y(r,{select:t}),document.activeElement!==n)return}function m(e){let t=h(e);return[g(t,e),g(t.reverse(),e)]}function h(e){let t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:e=>{let t=e.tagName===`INPUT`&&e.type===`hidden`;return e.disabled||e.hidden||t?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function g(e,t){for(let n of e)if(!_(n,{upTo:t}))return n}function _(e,{upTo:t}){if(getComputedStyle(e).visibility===`hidden`)return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display===`none`)return!0;e=e.parentElement}return!1}function v(e){return e instanceof HTMLInputElement&&`select`in e}function y(e,{select:t=!1}={}){if(e&&e.focus){let n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&v(e)&&t&&e.select()}}var b=x();function x(){let e=[];return{add(t){let n=e[0];t!==n&&n?.pause(),e=S(e,t),e.unshift(t)},remove(t){e=S(e,t),e[0]?.resume()}}}function S(e,t){let n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function C(e){return e.filter(e=>e.tagName!==`A`)}var w=0;function T(){o.useEffect(()=>{let e=document.querySelectorAll(`[data-radix-focus-guard]`);return document.body.insertAdjacentElement(`afterbegin`,e[0]??E()),document.body.insertAdjacentElement(`beforeend`,e[1]??E()),w++,()=>{w===1&&document.querySelectorAll(`[data-radix-focus-guard]`).forEach(e=>e.remove()),w--}},[])}function E(){let e=document.createElement(`span`);return e.setAttribute(`data-radix-focus-guard`,``),e.tabIndex=0,e.style.outline=`none`,e.style.opacity=`0`,e.style.position=`fixed`,e.style.pointerEvents=`none`,e}var D=function(){return D=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n],t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},D.apply(this,arguments)};function O(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n}function ee(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,a;r<i;r++)(a||!(r in t))&&(a||=Array.prototype.slice.call(t,0,r),a[r]=t[r]);return e.concat(a||Array.prototype.slice.call(t))}var k=`right-scroll-bar-position`,A=`width-before-scroll-bar`,te=`with-scroll-bars-hidden`,ne=`--removed-body-scroll-bar-size`;function j(e,t){return typeof e==`function`?e(t):e&&(e.current=t),e}function re(e,t){var n=(0,o.useState)(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(e){var t=n.value;t!==e&&(n.value=e,n.callback(e,t))}}}})[0];return n.callback=t,n.facade}var ie=typeof window<`u`?o.useLayoutEffect:o.useEffect,M=new WeakMap;function ae(e,t){var n=re(t||null,function(t){return e.forEach(function(e){return j(e,t)})});return ie(function(){var t=M.get(n);if(t){var r=new Set(t),i=new Set(e),a=n.current;r.forEach(function(e){i.has(e)||j(e,null)}),i.forEach(function(e){r.has(e)||j(e,a)})}M.set(n,e)},[e]),n}function oe(e){return e}function se(e,t){t===void 0&&(t=oe);var n=[],r=!1;return{read:function(){if(r)throw Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(e){var i=t(e,r);return n.push(i),function(){n=n.filter(function(e){return e!==i})}},assignSyncMedium:function(e){for(r=!0;n.length;){var t=n;n=[],t.forEach(e)}n={push:function(t){return e(t)},filter:function(){return n}}},assignMedium:function(e){r=!0;var t=[];if(n.length){var i=n;n=[],i.forEach(e),t=n}var a=function(){var n=t;t=[],n.forEach(e)},o=function(){return Promise.resolve().then(a)};o(),n={push:function(e){t.push(e),o()},filter:function(e){return t=t.filter(e),n}}}}}function ce(e){e===void 0&&(e={});var t=se(null);return t.options=D({async:!0,ssr:!1},e),t}var N=function(e){var t=e.sideCar,n=O(e,[`sideCar`]);if(!t)throw Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw Error(`Sidecar medium not found`);return o.createElement(r,D({},n))};N.isSideCarExport=!0;function le(e,t){return e.useMedium(t),N}var P=ce(),F=function(){},I=o.forwardRef(function(e,t){var n=o.useRef(null),r=o.useState({onScrollCapture:F,onWheelCapture:F,onTouchMoveCapture:F}),i=r[0],a=r[1],s=e.forwardProps,c=e.children,l=e.className,u=e.removeScrollBar,d=e.enabled,f=e.shards,p=e.sideCar,m=e.noRelative,h=e.noIsolation,g=e.inert,_=e.allowPinchZoom,v=e.as,y=v===void 0?`div`:v,b=e.gapMode,x=O(e,[`forwardProps`,`children`,`className`,`removeScrollBar`,`enabled`,`shards`,`sideCar`,`noRelative`,`noIsolation`,`inert`,`allowPinchZoom`,`as`,`gapMode`]),S=p,C=ae([n,t]),w=D(D({},x),i);return o.createElement(o.Fragment,null,d&&o.createElement(S,{sideCar:P,removeScrollBar:u,shards:f,noRelative:m,noIsolation:h,inert:g,setCallbacks:a,allowPinchZoom:!!_,lockRef:n,gapMode:b}),s?o.cloneElement(o.Children.only(c),D(D({},w),{ref:C})):o.createElement(y,D({},w,{className:l,ref:C}),c))});I.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},I.classNames={fullWidth:A,zeroRight:k};var L,ue=function(){if(L)return L;if(typeof __webpack_nonce__<`u`)return __webpack_nonce__};function de(){if(!document)return null;var e=document.createElement(`style`);e.type=`text/css`;var t=ue();return t&&e.setAttribute(`nonce`,t),e}function fe(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function pe(e){(document.head||document.getElementsByTagName(`head`)[0]).appendChild(e)}var me=function(){var e=0,t=null;return{add:function(n){e==0&&(t=de())&&(fe(t,n),pe(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},he=function(){var e=me();return function(t,n){o.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},R=function(){var e=he();return function(t){var n=t.styles,r=t.dynamic;return e(n,r),null}},ge={left:0,top:0,right:0,gap:0},z=function(e){return parseInt(e||``,10)||0},_e=function(e){var t=window.getComputedStyle(document.body),n=t[e===`padding`?`paddingLeft`:`marginLeft`],r=t[e===`padding`?`paddingTop`:`marginTop`],i=t[e===`padding`?`paddingRight`:`marginRight`];return[z(n),z(r),z(i)]},ve=function(e){if(e===void 0&&(e=`margin`),typeof window>`u`)return ge;var t=_e(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},ye=R(),B=`data-scroll-locked`,be=function(e,t,n,r){var i=e.left,a=e.top,o=e.right,s=e.gap;return n===void 0&&(n=`margin`),`
1
+ import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{o as t,t as n}from"./react-vendor-Ee0-5T4I.js";import{s as r}from"./utils-uGptTPGm.js";import{l as i,u as a}from"./dist-BhdiICUV.js";var o=e(t(),1),s=n(),c=`focusScope.autoFocusOnMount`,l=`focusScope.autoFocusOnUnmount`,u={bubbles:!1,cancelable:!0},d=`FocusScope`,f=o.forwardRef((e,t)=>{let{loop:n=!1,trapped:d=!1,onMountAutoFocus:f,onUnmountAutoFocus:g,..._}=e,[v,x]=o.useState(null),S=i(f),w=i(g),T=o.useRef(null),E=r(t,e=>x(e)),D=o.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;o.useEffect(()=>{if(d){let e=function(e){if(D.paused||!v)return;let t=e.target;v.contains(t)?T.current=t:y(T.current,{select:!0})},t=function(e){if(D.paused||!v)return;let t=e.relatedTarget;t!==null&&(v.contains(t)||y(T.current,{select:!0}))},n=function(e){if(document.activeElement===document.body)for(let t of e)t.removedNodes.length>0&&y(v)};document.addEventListener(`focusin`,e),document.addEventListener(`focusout`,t);let r=new MutationObserver(n);return v&&r.observe(v,{childList:!0,subtree:!0}),()=>{document.removeEventListener(`focusin`,e),document.removeEventListener(`focusout`,t),r.disconnect()}}},[d,v,D.paused]),o.useEffect(()=>{if(v){b.add(D);let e=document.activeElement;if(!v.contains(e)){let t=new CustomEvent(c,u);v.addEventListener(c,S),v.dispatchEvent(t),t.defaultPrevented||(p(C(h(v)),{select:!0}),document.activeElement===e&&y(v))}return()=>{v.removeEventListener(c,S),setTimeout(()=>{let t=new CustomEvent(l,u);v.addEventListener(l,w),v.dispatchEvent(t),t.defaultPrevented||y(e??document.body,{select:!0}),v.removeEventListener(l,w),b.remove(D)},0)}}},[v,S,w,D]);let O=o.useCallback(e=>{if(!n&&!d||D.paused)return;let t=e.key===`Tab`&&!e.altKey&&!e.ctrlKey&&!e.metaKey,r=document.activeElement;if(t&&r){let t=e.currentTarget,[i,a]=m(t);i&&a?!e.shiftKey&&r===a?(e.preventDefault(),n&&y(i,{select:!0})):e.shiftKey&&r===i&&(e.preventDefault(),n&&y(a,{select:!0})):r===t&&e.preventDefault()}},[n,d,D.paused]);return(0,s.jsx)(a.div,{tabIndex:-1,..._,ref:E,onKeyDown:O})});f.displayName=d;function p(e,{select:t=!1}={}){let n=document.activeElement;for(let r of e)if(y(r,{select:t}),document.activeElement!==n)return}function m(e){let t=h(e);return[g(t,e),g(t.reverse(),e)]}function h(e){let t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:e=>{let t=e.tagName===`INPUT`&&e.type===`hidden`;return e.disabled||e.hidden||t?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function g(e,t){for(let n of e)if(!_(n,{upTo:t}))return n}function _(e,{upTo:t}){if(getComputedStyle(e).visibility===`hidden`)return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display===`none`)return!0;e=e.parentElement}return!1}function v(e){return e instanceof HTMLInputElement&&`select`in e}function y(e,{select:t=!1}={}){if(e&&e.focus){let n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&v(e)&&t&&e.select()}}var b=x();function x(){let e=[];return{add(t){let n=e[0];t!==n&&n?.pause(),e=S(e,t),e.unshift(t)},remove(t){e=S(e,t),e[0]?.resume()}}}function S(e,t){let n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function C(e){return e.filter(e=>e.tagName!==`A`)}var w=0;function T(){o.useEffect(()=>{let e=document.querySelectorAll(`[data-radix-focus-guard]`);return document.body.insertAdjacentElement(`afterbegin`,e[0]??E()),document.body.insertAdjacentElement(`beforeend`,e[1]??E()),w++,()=>{w===1&&document.querySelectorAll(`[data-radix-focus-guard]`).forEach(e=>e.remove()),w--}},[])}function E(){let e=document.createElement(`span`);return e.setAttribute(`data-radix-focus-guard`,``),e.tabIndex=0,e.style.outline=`none`,e.style.opacity=`0`,e.style.position=`fixed`,e.style.pointerEvents=`none`,e}var D=function(){return D=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n],t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},D.apply(this,arguments)};function O(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n}function ee(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,a;r<i;r++)(a||!(r in t))&&(a||=Array.prototype.slice.call(t,0,r),a[r]=t[r]);return e.concat(a||Array.prototype.slice.call(t))}var k=`right-scroll-bar-position`,A=`width-before-scroll-bar`,te=`with-scroll-bars-hidden`,ne=`--removed-body-scroll-bar-size`;function j(e,t){return typeof e==`function`?e(t):e&&(e.current=t),e}function re(e,t){var n=(0,o.useState)(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(e){var t=n.value;t!==e&&(n.value=e,n.callback(e,t))}}}})[0];return n.callback=t,n.facade}var ie=typeof window<`u`?o.useLayoutEffect:o.useEffect,M=new WeakMap;function ae(e,t){var n=re(t||null,function(t){return e.forEach(function(e){return j(e,t)})});return ie(function(){var t=M.get(n);if(t){var r=new Set(t),i=new Set(e),a=n.current;r.forEach(function(e){i.has(e)||j(e,null)}),i.forEach(function(e){r.has(e)||j(e,a)})}M.set(n,e)},[e]),n}function oe(e){return e}function se(e,t){t===void 0&&(t=oe);var n=[],r=!1;return{read:function(){if(r)throw Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(e){var i=t(e,r);return n.push(i),function(){n=n.filter(function(e){return e!==i})}},assignSyncMedium:function(e){for(r=!0;n.length;){var t=n;n=[],t.forEach(e)}n={push:function(t){return e(t)},filter:function(){return n}}},assignMedium:function(e){r=!0;var t=[];if(n.length){var i=n;n=[],i.forEach(e),t=n}var a=function(){var n=t;t=[],n.forEach(e)},o=function(){return Promise.resolve().then(a)};o(),n={push:function(e){t.push(e),o()},filter:function(e){return t=t.filter(e),n}}}}}function ce(e){e===void 0&&(e={});var t=se(null);return t.options=D({async:!0,ssr:!1},e),t}var N=function(e){var t=e.sideCar,n=O(e,[`sideCar`]);if(!t)throw Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw Error(`Sidecar medium not found`);return o.createElement(r,D({},n))};N.isSideCarExport=!0;function le(e,t){return e.useMedium(t),N}var P=ce(),F=function(){},I=o.forwardRef(function(e,t){var n=o.useRef(null),r=o.useState({onScrollCapture:F,onWheelCapture:F,onTouchMoveCapture:F}),i=r[0],a=r[1],s=e.forwardProps,c=e.children,l=e.className,u=e.removeScrollBar,d=e.enabled,f=e.shards,p=e.sideCar,m=e.noRelative,h=e.noIsolation,g=e.inert,_=e.allowPinchZoom,v=e.as,y=v===void 0?`div`:v,b=e.gapMode,x=O(e,[`forwardProps`,`children`,`className`,`removeScrollBar`,`enabled`,`shards`,`sideCar`,`noRelative`,`noIsolation`,`inert`,`allowPinchZoom`,`as`,`gapMode`]),S=p,C=ae([n,t]),w=D(D({},x),i);return o.createElement(o.Fragment,null,d&&o.createElement(S,{sideCar:P,removeScrollBar:u,shards:f,noRelative:m,noIsolation:h,inert:g,setCallbacks:a,allowPinchZoom:!!_,lockRef:n,gapMode:b}),s?o.cloneElement(o.Children.only(c),D(D({},w),{ref:C})):o.createElement(y,D({},w,{className:l,ref:C}),c))});I.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},I.classNames={fullWidth:A,zeroRight:k};var L,ue=function(){if(L)return L;if(typeof __webpack_nonce__<`u`)return __webpack_nonce__};function de(){if(!document)return null;var e=document.createElement(`style`);e.type=`text/css`;var t=ue();return t&&e.setAttribute(`nonce`,t),e}function fe(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function pe(e){(document.head||document.getElementsByTagName(`head`)[0]).appendChild(e)}var me=function(){var e=0,t=null;return{add:function(n){e==0&&(t=de())&&(fe(t,n),pe(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},he=function(){var e=me();return function(t,n){o.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},R=function(){var e=he();return function(t){var n=t.styles,r=t.dynamic;return e(n,r),null}},ge={left:0,top:0,right:0,gap:0},z=function(e){return parseInt(e||``,10)||0},_e=function(e){var t=window.getComputedStyle(document.body),n=t[e===`padding`?`paddingLeft`:`marginLeft`],r=t[e===`padding`?`paddingTop`:`marginTop`],i=t[e===`padding`?`paddingRight`:`marginRight`];return[z(n),z(r),z(i)]},ve=function(e){if(e===void 0&&(e=`margin`),typeof window>`u`)return ge;var t=_e(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},ye=R(),B=`data-scroll-locked`,be=function(e,t,n,r){var i=e.left,a=e.top,o=e.right,s=e.gap;return n===void 0&&(n=`margin`),`
2
2
  .${te} {
3
3
  overflow: hidden ${r};
4
4
  padding-right: ${s}px ${r};
@@ -1 +1 @@
1
- import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{o as t,t as n}from"./react-vendor-Ee0-5T4I.js";import"./dist-Ch137qdo.js";import{t as r}from"./monaco-setup-DU2h1v3K.js";var i=e(t(),1),a=n();function o(e){e?.getModel()?.dispose(),e?.dispose()}function s(e,t,n){!t||!e||(e.focus(),n?.())}function c({language:e,value:t,theme:n,autoFocus:c=!1,onChange:l,onReady:u}){let d=(0,i.useRef)(null),f=(0,i.useRef)(u);f.current=u,(0,i.useEffect)(()=>()=>{o(d.current),d.current=null},[]),(0,i.useEffect)(()=>{s(d.current,c,f.current)},[c]);function p(e){d.current=e,s(e,c,f.current)}return(0,a.jsx)(r,{height:`100%`,language:e,value:t,onChange:function(e){l(e??``)},onMount:p,theme:n,options:{minimap:{enabled:!1},scrollBeyondLastLine:!1,wordWrap:`on`,automaticLayout:!0,fontSize:14,lineNumbers:`on`,renderLineHighlight:`line`,scrollbar:{vertical:`auto`,horizontal:`auto`}}})}export{c as default};
1
+ import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{o as t,t as n}from"./react-vendor-Ee0-5T4I.js";import"./dist-FJzwWcMv.js";import{t as r}from"./monaco-setup-DU2h1v3K.js";var i=e(t(),1),a=n();function o(e){e?.getModel()?.dispose(),e?.dispose()}function s(e,t,n){!t||!e||(e.focus(),n?.())}function c({language:e,value:t,theme:n,autoFocus:c=!1,onChange:l,onReady:u}){let d=(0,i.useRef)(null),f=(0,i.useRef)(u);f.current=u,(0,i.useEffect)(()=>()=>{o(d.current),d.current=null},[]),(0,i.useEffect)(()=>{s(d.current,c,f.current)},[c]);function p(e){d.current=e,s(e,c,f.current)}return(0,a.jsx)(r,{height:`100%`,language:e,value:t,onChange:function(e){l(e??``)},onMount:p,theme:n,options:{minimap:{enabled:!1},scrollBeyondLastLine:!1,wordWrap:`on`,automaticLayout:!0,fontSize:14,lineNumbers:`on`,renderLineHighlight:`line`,scrollbar:{vertical:`auto`,horizontal:`auto`}}})}export{c as default};
@@ -0,0 +1,2 @@
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/explorer-tree-Cn6lp8jD.js","assets/rolldown-runtime-aKtaBQYM.js","assets/index-DpDgcOE9.js","assets/react-vendor-Ee0-5T4I.js","assets/progress-indicator-_fEKurQg.js","assets/utils-uGptTPGm.js","assets/dist-FJzwWcMv.js","assets/alert-dialog-Dq9tEk9t.js","assets/button-zYjzm__g.js","assets/use-browser-overlay-block-DyprQSIG.js","assets/browser-overlay-block-CiDtkfup.js","assets/dist-BhdiICUV.js","assets/dist-CPtOAqwP.js","assets/es2015-D67vh4rt.js","assets/scroll-area-BTpvIsIG.js","assets/dist-OixawqbU.js","assets/tooltip-6qlOE6WT.js","assets/dist-lnsB93_y.js","assets/use-toast-xpb5jNtN.js","assets/chat-dock-context-DQmDS2i8.js","assets/api-CX0sFbpL.js","assets/store-DCnnNgwq.js","assets/explorer-tab-context-BxUVwWQQ.js","assets/main-tab-context-CNgxXqnH.js","assets/terminal-output-activity-B1bjjsl7.js","assets/query-keys-C2vEjHA1.js","assets/suspense-resource-DzlMlIgR.js","assets/dist-BJaGHz0F.js","assets/dist-B-I0i8QZ.js","assets/dist-B6u0s1jB.js","assets/dist-CX9ud_WC.js","assets/dist-CSssbxDI.js","assets/useBaseQuery-DqLwB2Sq.js","assets/lucide-react-CMzSV2MP.js","assets/chunk-QFMPRPBF-COsSkB7x.js","assets/index-DCWejG57.css","assets/async-error-boundary-BS6v_PGo.js","assets/card-CpchkvHM.js","assets/explorer-view-5wUektaN.js"])))=>i.map(i=>d[i]);
2
+ import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{o as t,r as n,t as r}from"./react-vendor-Ee0-5T4I.js";import{Wt as i}from"./dist-FJzwWcMv.js";import{r as a}from"./store-DCnnNgwq.js";import{t as o}from"./utils-uGptTPGm.js";import{c as ee}from"./lucide-react-CMzSV2MP.js";import{n as s}from"./scroll-area-BTpvIsIG.js";import{n as c}from"./explorer-tab-context-BxUVwWQQ.js";import{t as l}from"./progress-indicator-_fEKurQg.js";import{t as u}from"./use-toast-xpb5jNtN.js";import{Hn as d,J as f,K as p,P as te,Un as ne,Vn as m,X as h,Y as g,in as _,nr as v,q as y}from"./index-DpDgcOE9.js";import{t as b}from"./async-error-boundary-BS6v_PGo.js";var x=e(t(),1),S=r(),C=(0,x.lazy)(()=>n(()=>import(`./explorer-tree-Cn6lp8jD.js`),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37]))),re=(0,x.lazy)(()=>n(()=>import(`./explorer-view-5wUektaN.js`),__vite__mapDeps([38,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37])));function w({instanceId:e}){let t=a(e=>e.selectedThreadId),n=v(),[r,w]=(0,x.useState)(null),[T,E]=(0,x.useState)(!0),[D,O]=(0,x.useState)(null),[k,A]=(0,x.useState)(!1),[j,M]=(0,x.useState)(!1),N=(0,x.useRef)(0),{pendingExplorerPath:P,setPendingExplorerPath:F,explorerClearPath:I,setExplorerClearPath:L,triggerExplorerRefresh:R}=c();(0,x.useEffect)(()=>{function e(e){h(e.dataTransfer)&&e.preventDefault()}return window.addEventListener(`dragover`,e),window.addEventListener(`drop`,e),()=>{window.removeEventListener(`dragover`,e),window.removeEventListener(`drop`,e)}},[]),(0,x.useEffect)(()=>{E(!0)},[t]);let z=(0,x.useCallback)(e=>{w(e),n&&E(!1)},[n]),B=(0,x.useCallback)(()=>{E(!0)},[]),V=(0,x.useCallback)(e=>{w(e),n&&E(!1)},[n]);(0,x.useEffect)(()=>{P&&(w({name:P.split(`/`).pop()??P,path:P,type:`file`}),n&&E(!1),F(null))},[n,P,F]),(0,x.useEffect)(()=>{I&&(r&&(r.path===I||r.path.startsWith(I+`/`))&&(w(null),n&&E(!0)),L(null))},[I,n,r,L]);function H(){N.current=0,M(!1)}function U(e){h(e.dataTransfer)&&(N.current+=1,M(!0))}function W(e){h(e.dataTransfer)&&(e.preventDefault(),e.dataTransfer.dropEffect=`copy`)}function G(e){h(e.dataTransfer)&&(N.current=Math.max(0,N.current-1),N.current===0&&M(!1))}function K(e){if(!h(e.dataTransfer))return;e.preventDefault(),H();let{files:t,skippedFolders:n}=g(e.dataTransfer);n>0&&u({title:`Folders skipped`,description:`Only files can be copied. Drop individual files instead of folders.`}),t.length!==0&&O({files:t,dirPath:``})}let q=(0,x.useCallback)((e,t)=>{N.current=0,M(!1),O({files:e,dirPath:t})},[]);async function J(){if(!(!D||!t||k)){A(!0);try{let{copied:e,failures:n}=await f(t,D.dirPath,D.files);e.length>0&&R(),u(y(D,e.length,n))}finally{A(!1),O(null)}}}let Y={onDragEnter:U,onDragOver:W,onDragLeave:G,onDrop:K},X=j?(0,S.jsx)(`div`,{className:`pointer-events-none absolute inset-0 z-50 flex items-center justify-center bg-background/70`,children:(0,S.jsxs)(`div`,{className:`flex items-center gap-2 rounded-lg border-2 border-dashed border-primary bg-background px-6 py-4`,children:[(0,S.jsx)(ee,{className:`h-4 w-4 text-primary`}),(0,S.jsx)(`span`,{className:i.label,children:`Drop files to copy them into the repository`})]})}):null,Z=(0,S.jsx)(s,{className:`h-full`,children:t?(0,S.jsx)(_,{threadId:t,children:(0,S.jsx)(b,{fallbackTitle:`Failed to load files`,children:(0,S.jsx)(x.Suspense,{fallback:(0,S.jsx)(te,{}),children:(0,S.jsx)(C,{instanceId:e,threadId:t,selectedPath:r?.path??null,onNodeSelect:z,onFilesDrop:q})})})}):(0,S.jsx)(`p`,{className:o(i.caption,`px-3 py-4 text-center`),children:`No thread selected.`})}),Q=(0,S.jsx)(x.Suspense,{fallback:(0,S.jsx)(l,{centered:!0,label:`Loading file viewer...`}),children:(0,S.jsx)(re,{selectedFile:r,showTreeBackButton:n&&!T,onShowTree:B,onFileCreated:V})}),$=(0,S.jsx)(p,{pendingDrop:D,dropCopying:k,onConfirm:()=>{J()},onDismiss:()=>{O(null)}});return n?(0,S.jsxs)(`div`,{className:`relative flex h-full flex-col overflow-hidden`,...Y,children:[X,$,(0,S.jsx)(`div`,{className:o(`flex-1 min-h-0 overflow-hidden`,!T&&`hidden`),children:Z}),(0,S.jsx)(`div`,{className:o(`flex-1 min-h-0 overflow-hidden`,T&&`hidden`),children:Q})]}):(0,S.jsxs)(`div`,{className:`relative flex h-full flex-col overflow-hidden`,...Y,children:[X,$,(0,S.jsxs)(ne,{direction:`horizontal`,className:`flex-1 overflow-hidden`,children:[(0,S.jsx)(d,{defaultSize:25,minSize:15,maxSize:50,className:`overflow-hidden border-r border-border`,children:Z}),(0,S.jsx)(m,{withHandle:!0}),(0,S.jsx)(d,{className:`overflow-hidden`,children:Q})]})]})}export{w as default};