libre-webui 0.38.0 → 0.39.0

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 (195) hide show
  1. package/README.md +1 -0
  2. package/backend/dist/persistence/postgresMigrationRegistry.d.ts.map +1 -1
  3. package/backend/dist/persistence/postgresMigrationRegistry.js +2 -0
  4. package/backend/dist/persistence/postgresMigrationRegistry.js.map +1 -1
  5. package/backend/dist/persistence/postgresWorkRunThinkMigration.d.ts +9 -0
  6. package/backend/dist/persistence/postgresWorkRunThinkMigration.d.ts.map +1 -0
  7. package/backend/dist/persistence/postgresWorkRunThinkMigration.js +39 -0
  8. package/backend/dist/persistence/postgresWorkRunThinkMigration.js.map +1 -0
  9. package/backend/dist/persistence/sqliteMigrations.d.ts.map +1 -1
  10. package/backend/dist/persistence/sqliteMigrations.js +20 -0
  11. package/backend/dist/persistence/sqliteMigrations.js.map +1 -1
  12. package/backend/dist/persistence/sqliteToPostgresMigration.d.ts.map +1 -1
  13. package/backend/dist/persistence/sqliteToPostgresMigration.js +1 -0
  14. package/backend/dist/persistence/sqliteToPostgresMigration.js.map +1 -1
  15. package/backend/dist/platform/workPersistence/postgresWorkPersistence.d.ts.map +1 -1
  16. package/backend/dist/platform/workPersistence/postgresWorkPersistence.js +3 -2
  17. package/backend/dist/platform/workPersistence/postgresWorkPersistence.js.map +1 -1
  18. package/backend/dist/platform/workPersistence/sqliteWorkPersistence.d.ts.map +1 -1
  19. package/backend/dist/platform/workPersistence/sqliteWorkPersistence.js +3 -3
  20. package/backend/dist/platform/workPersistence/sqliteWorkPersistence.js.map +1 -1
  21. package/backend/dist/platform/workPersistence/types.d.ts +5 -0
  22. package/backend/dist/platform/workPersistence/types.d.ts.map +1 -1
  23. package/backend/dist/platform/workPersistence/types.js.map +1 -1
  24. package/backend/dist/routes/work.d.ts.map +1 -1
  25. package/backend/dist/routes/work.js +17 -2
  26. package/backend/dist/routes/work.js.map +1 -1
  27. package/backend/dist/services/agentCliService.d.ts.map +1 -1
  28. package/backend/dist/services/agentCliService.js +1 -0
  29. package/backend/dist/services/agentCliService.js.map +1 -1
  30. package/backend/dist/services/followUpService.d.ts +4 -1
  31. package/backend/dist/services/followUpService.d.ts.map +1 -1
  32. package/backend/dist/services/followUpService.js +23 -2
  33. package/backend/dist/services/followUpService.js.map +1 -1
  34. package/backend/dist/services/pluginService.d.ts.map +1 -1
  35. package/backend/dist/services/pluginService.js +10 -6
  36. package/backend/dist/services/pluginService.js.map +1 -1
  37. package/backend/dist/services/workAgentService.d.ts.map +1 -1
  38. package/backend/dist/services/workAgentService.js +3 -0
  39. package/backend/dist/services/workAgentService.js.map +1 -1
  40. package/backend/dist/services/workModelProviderService.d.ts.map +1 -1
  41. package/backend/dist/services/workModelProviderService.js +43 -13
  42. package/backend/dist/services/workModelProviderService.js.map +1 -1
  43. package/backend/dist/services/workTaskService.d.ts +3 -2
  44. package/backend/dist/services/workTaskService.d.ts.map +1 -1
  45. package/backend/dist/services/workTaskService.js +10 -6
  46. package/backend/dist/services/workTaskService.js.map +1 -1
  47. package/backend/dist/types/work.d.ts +3 -0
  48. package/backend/dist/types/work.d.ts.map +1 -1
  49. package/backend/dist/types/work.js.map +1 -1
  50. package/backend/dist/utils/bedrockMantle.d.ts +46 -0
  51. package/backend/dist/utils/bedrockMantle.d.ts.map +1 -0
  52. package/backend/dist/utils/bedrockMantle.js +206 -0
  53. package/backend/dist/utils/bedrockMantle.js.map +1 -0
  54. package/backend/dist/utils/pluginChatAdapter.d.ts +36 -0
  55. package/backend/dist/utils/pluginChatAdapter.d.ts.map +1 -1
  56. package/backend/dist/utils/pluginChatAdapter.js +122 -47
  57. package/backend/dist/utils/pluginChatAdapter.js.map +1 -1
  58. package/backend/dist/utils/pluginDefinitionTrust.d.ts.map +1 -1
  59. package/backend/dist/utils/pluginDefinitionTrust.js +3 -2
  60. package/backend/dist/utils/pluginDefinitionTrust.js.map +1 -1
  61. package/backend/dist/utils/pluginValidation.d.ts +1 -1
  62. package/backend/dist/utils/pluginValidation.d.ts.map +1 -1
  63. package/backend/dist/utils/pluginValidation.js +11 -0
  64. package/backend/dist/utils/pluginValidation.js.map +1 -1
  65. package/backend/package.json +3 -3
  66. package/frontend/dist/artifact-runtime/.build-fingerprint +1 -1
  67. package/frontend/dist/artifact-runtime/babel.js +170 -170
  68. package/frontend/dist/artifact-runtime/framer-motion.js +3 -3
  69. package/frontend/dist/artifact-runtime/lucide-react.js +1 -1
  70. package/frontend/dist/artifact-runtime/mathjs.js +1 -1
  71. package/frontend/dist/artifact-runtime/mermaid.js +1 -1
  72. package/frontend/dist/artifact-runtime/plotly.js +1 -1
  73. package/frontend/dist/artifact-runtime/react.js +3 -3
  74. package/frontend/dist/assets/index-D99DS5c6.js +57 -0
  75. package/frontend/dist/assets/index-Dz1JufgZ.css +1 -0
  76. package/frontend/dist/assets/{markdown-math-D1Bj3pDB.css → markdown-math-DzFXvcrH.css} +1 -1
  77. package/frontend/dist/index.html +32 -32
  78. package/frontend/dist/js/{ArtifactContainer-BWTN4QSW.js → ArtifactContainer-Cn7X9HGm.js} +1 -1
  79. package/frontend/dist/js/{ArtifactDemoPage-CCh7lQEw.js → ArtifactDemoPage-Ddpy2O_v.js} +1 -1
  80. package/frontend/dist/js/{ArtifactSandboxFrame-D1ntMsqe.js → ArtifactSandboxFrame-CdsAqv8H.js} +1 -1
  81. package/frontend/dist/js/{ArtifactSlideOutPanel-zPEBPoMh.js → ArtifactSlideOutPanel-cVd9X80o.js} +1 -1
  82. package/frontend/dist/js/{AutomationModal-DN98Eyym.js → AutomationModal-B4UaWjkk.js} +1 -1
  83. package/frontend/dist/js/{AutomationsPage-3DBwRKME.js → AutomationsPage-huCrvLUp.js} +1 -1
  84. package/frontend/dist/js/{AvatarUpload-D5_wGUb5.js → AvatarUpload-CG-w6Mpt.js} +1 -1
  85. package/frontend/dist/js/{Button-CTwi9N3d.js → Button-j68Q8KVh.js} +1 -1
  86. package/frontend/dist/js/{CalendarPage-CUbGH3Tl.js → CalendarPage-CZXT1w99.js} +1 -1
  87. package/frontend/dist/js/ChannelsPage-DbtdHnSL.js +1 -0
  88. package/frontend/dist/js/ChatPage-BZE65kiq.js +14 -0
  89. package/frontend/dist/js/ConnectModels-DD4bLgdq.js +1 -0
  90. package/frontend/dist/js/{EvaluationsPage-BaND2qQM.js → EvaluationsPage-Dq53LaXd.js} +1 -1
  91. package/frontend/dist/js/{FirstTimeSetup-D8ktLJKO.js → FirstTimeSetup-BoJIfuQT.js} +1 -1
  92. package/frontend/dist/js/{GalleryPage-DXQLoU0l.js → GalleryPage-DKwqeB2A.js} +1 -1
  93. package/frontend/dist/js/{HomePage-WVug1vWc.js → HomePage-C8bCJfls.js} +1 -1
  94. package/frontend/dist/js/{LanguageSwitcher-DHHTrDBR.js → LanguageSwitcher-B_YyU5JG.js} +1 -1
  95. package/frontend/dist/js/{Logo-D1o5k_wt.js → Logo-DnfVtjgj.js} +1 -1
  96. package/frontend/dist/js/{LogoMark-lnmc98jv.js → LogoMark-BzObGdA9.js} +1 -1
  97. package/frontend/dist/js/{ModelManagerModals-BPALNMDH.js → ModelManagerModals-BzjZ-QwL.js} +1 -1
  98. package/frontend/dist/js/{NotesPage-CRzX2Wa8.js → NotesPage-CnaAp_w_.js} +1 -1
  99. package/frontend/dist/js/{OptimizedSyntaxHighlighter-CzzV6ONG.js → OptimizedSyntaxHighlighter-B0g8cxZQ.js} +1 -1
  100. package/frontend/dist/js/OptimizedSyntaxHighlighter-B_BbHeO1.js +1 -0
  101. package/frontend/dist/js/{PasswordStrengthMeter-BGrHWG0B.js → PasswordStrengthMeter-DI4RDv67.js} +1 -1
  102. package/frontend/dist/js/{PersonasPage-BRU9151f.js → PersonasPage-CH3GUKph.js} +1 -1
  103. package/frontend/dist/js/{PluginUsagePage-BlhYZq1l.js → PluginUsagePage-d54K2gAj.js} +1 -1
  104. package/frontend/dist/js/{RichMessageContent-OGBLO64L.js → RichMessageContent-BfYbVBFz.js} +2 -2
  105. package/frontend/dist/js/RichMessageContent-CDxxs3Tt.js +1 -0
  106. package/frontend/dist/js/SettingsModal-BvtJcvow.js +19 -0
  107. package/frontend/dist/js/{SettingsToggle-Du2FSUPO.js → SettingsToggle-DrJ0Bapi.js} +1 -1
  108. package/frontend/dist/js/{ShareDialog-DEhxnLfn.js → ShareDialog-DaSxkTKS.js} +1 -1
  109. package/frontend/dist/js/{StrandsPage-DWnUKSb0.js → StrandsPage-BQwz0mWq.js} +1 -1
  110. package/frontend/dist/js/{SystemPage-cqq8lSxB.js → SystemPage-BqNZoFxR.js} +1 -1
  111. package/frontend/dist/js/{TurnstileWidget-CVepEMEQ.js → TurnstileWidget-tI50c7Kc.js} +1 -1
  112. package/frontend/dist/js/{UserManagementPage-2yHv89ZA.js → UserManagementPage-UvPjA9RP.js} +1 -1
  113. package/frontend/dist/js/{UserManagementPanel-NZmoTk6V.js → UserManagementPanel-C3T1ReJJ.js} +1 -1
  114. package/frontend/dist/js/{WhatsNewModal-5SwIdmU1.js → WhatsNewModal-CLcU2Ugk.js} +1 -1
  115. package/frontend/dist/js/WorkPage-BpjGn--1.js +8 -0
  116. package/frontend/dist/js/{api-CnJYEbRz.js → api-BrHW-VGd.js} +1 -1
  117. package/frontend/dist/js/api-K_hhqPdx.js +1 -0
  118. package/frontend/dist/js/{appNavigation-BXNRwrN-.js → appNavigation-B6xYIgLi.js} +1 -1
  119. package/frontend/dist/js/appStore-DkRdQQeY.js +2 -0
  120. package/frontend/dist/js/appVersion-BVtSqLVj.js +1 -0
  121. package/frontend/dist/js/{ar-Bp843BgG.js → ar-XTZGEtBr.js} +1 -1
  122. package/frontend/dist/js/authStore-DBS6Kbvh.js +1 -0
  123. package/frontend/dist/js/{authStore-DwaPsICv.js → authStore-DjAsRpNL.js} +3 -3
  124. package/frontend/dist/js/{bn-DmSGkklY.js → bn-JiK7ZWmy.js} +1 -1
  125. package/frontend/dist/js/{chatStore-j8bGpkeT.js → chatStore-DpVxt9VX.js} +3 -3
  126. package/frontend/dist/js/{client-DQy1iGRM.js → client-DppLngAs.js} +2 -2
  127. package/frontend/dist/js/{config-BbrsmDn2.js → config-4_s8hdqO.js} +1 -1
  128. package/frontend/dist/js/{cs-BcauIRyG.js → cs-D8ju18CO.js} +1 -1
  129. package/frontend/dist/js/{da-CJ14DPJ_.js → da-BJWcAoUc.js} +1 -1
  130. package/frontend/dist/js/{de-ajswyAhq.js → de-CLJLmy69.js} +1 -1
  131. package/frontend/dist/js/{es-rlf8FsMZ.js → es-BvqHEL-3.js} +1 -1
  132. package/frontend/dist/js/{evaluationsApi-KVsH7yXe.js → evaluationsApi-DyuW7IJ_.js} +1 -1
  133. package/frontend/dist/js/{fr-BwkM1wie.js → fr-B8ZoZomI.js} +1 -1
  134. package/frontend/dist/js/{hi-B3eId9-I.js → hi-AzJLALo-.js} +1 -1
  135. package/frontend/dist/js/{id-BcgPFJh2.js → id-DZYGQhvC.js} +1 -1
  136. package/frontend/dist/js/{is-Crvd3K7f.js → is-Da_kvtzW.js} +1 -1
  137. package/frontend/dist/js/{it-DrLx24hb.js → it-B90zSlqn.js} +1 -1
  138. package/frontend/dist/js/{ja-DZMcf-oB.js → ja-DU_K1GOr.js} +1 -1
  139. package/frontend/dist/js/{ko-Cm0NiOE8.js → ko-DicfoO-e.js} +1 -1
  140. package/frontend/dist/js/{markdown-CZ1tYEW8.js → markdown-DU84620G.js} +1 -1
  141. package/frontend/dist/js/{markdown-core-KjS96SYW.js → markdown-core-Cyql92Hg.js} +1 -1
  142. package/frontend/dist/js/{markdown-html-DQEwrWcf.js → markdown-html-CUc2fCgY.js} +1 -1
  143. package/frontend/dist/js/{markdown-math-CKi32S5d.js → markdown-math-DxPfMKvO.js} +1 -1
  144. package/frontend/dist/js/{markdownHtml-lrXhxBhK.js → markdownHtml-KhS0cFNH.js} +1 -1
  145. package/frontend/dist/js/markdownMath-CsfRQAcz.js +1 -0
  146. package/frontend/dist/js/{messageCodeStyles-CDnMKLgo.js → messageCodeStyles-CuQPkfEK.js} +1 -1
  147. package/frontend/dist/js/{ms-ymaG59hx.js → ms-CfH7wjUY.js} +1 -1
  148. package/frontend/dist/js/{nl-CdIdeA9d.js → nl-ELlOz-B3.js} +1 -1
  149. package/frontend/dist/js/{pl-CuO0b605.js → pl-33dayyUk.js} +1 -1
  150. package/frontend/dist/js/{pt-Vy413FG5.js → pt-aIXSQPCT.js} +1 -1
  151. package/frontend/dist/js/react-vendor-CR5VJ85Q.js +9 -0
  152. package/frontend/dist/js/{router-vendor-HZm4FR0A.js → router-vendor-DqMnEJWK.js} +1 -1
  153. package/frontend/dist/js/{ru-D0zOEVrL.js → ru-BSvGtBtW.js} +1 -1
  154. package/frontend/dist/js/{standalone-DbyFjvTU.js → standalone-D_lg5NC9.js} +1 -1
  155. package/frontend/dist/js/{strandsApi-SeoX_IsY.js → strandsApi-BFbeEpAY.js} +1 -1
  156. package/frontend/dist/js/{sv-JoS4krpk.js → sv-B7KOz81W.js} +1 -1
  157. package/frontend/dist/js/{syntax-highlight-DNc3FFCa.js → syntax-highlight-D7dQ5s5-.js} +1 -1
  158. package/frontend/dist/js/{teamEventStream-CZYdpbVw.js → teamEventStream-DsAS6P4m.js} +1 -1
  159. package/frontend/dist/js/{th-afhelaqR.js → th-DgpjGxvA.js} +1 -1
  160. package/frontend/dist/js/{tr-BhSy9UrR.js → tr-BQTbl2h-.js} +1 -1
  161. package/frontend/dist/js/{ui-CW3gJ4Kl.js → ui-Aq8MP7Ph.js} +2 -2
  162. package/frontend/dist/js/{ui-vendor-_fvLnmDx.js → ui-vendor-DVTj_sKN.js} +1 -1
  163. package/frontend/dist/js/{uk-CibXypnZ.js → uk-JLymloot.js} +1 -1
  164. package/frontend/dist/js/{useChat-CBySqLqR.js → useChat-D3ZAGz70.js} +1 -1
  165. package/frontend/dist/js/{useDialogFocus-DbW0oA9H.js → useDialogFocus-zSGHkpE4.js} +1 -1
  166. package/frontend/dist/js/useDictation-B6l8QzeM.js +1 -0
  167. package/frontend/dist/js/{useQuery-hWmQjdLu.js → useQuery-BTKpXudI.js} +1 -1
  168. package/frontend/dist/js/{useTranslation-UHEMTEHd.js → useTranslation-Boi0fB1B.js} +1 -1
  169. package/frontend/dist/js/{utils-DaXuqmQm.js → utils-B-Bhh1pF.js} +1 -1
  170. package/frontend/dist/js/{utils-vendor-CvhktdS_.js → utils-vendor-DPJG-EG_.js} +1 -1
  171. package/frontend/dist/js/{vi-Cg0WKHtb.js → vi-BXdLOJ8q.js} +1 -1
  172. package/frontend/dist/js/workApi-D1xtiG3Q.js +1 -0
  173. package/frontend/dist/js/{workApi-BqkCbCLQ.js → workApi-UPxumrEF.js} +1 -1
  174. package/frontend/dist/js/{zh-DTqys9TE.js → zh-gdUf9sXa.js} +1 -1
  175. package/package.json +3 -3
  176. package/plugins/anthropic.json +3 -1
  177. package/plugins/bedrock.json +86 -0
  178. package/plugins/openrouter.json +2 -0
  179. package/frontend/dist/assets/index-CJHJxwjA.js +0 -68
  180. package/frontend/dist/assets/index-DSHdOZRK.css +0 -1
  181. package/frontend/dist/js/ChannelsPage-B1hC1rRS.js +0 -1
  182. package/frontend/dist/js/ChatPage-B7mEg5z2.js +0 -14
  183. package/frontend/dist/js/ConnectModels-Cby89_Mc.js +0 -1
  184. package/frontend/dist/js/OptimizedSyntaxHighlighter-ajqwyBQm.js +0 -1
  185. package/frontend/dist/js/RichMessageContent-FiuPwDG7.js +0 -1
  186. package/frontend/dist/js/SettingsModal-sLkxG-lW.js +0 -19
  187. package/frontend/dist/js/WorkPage-BIuaVNEC.js +0 -8
  188. package/frontend/dist/js/api-C2k0OqEk.js +0 -1
  189. package/frontend/dist/js/appStore-DULGAJnH.js +0 -2
  190. package/frontend/dist/js/appVersion-DooVk4c_.js +0 -1
  191. package/frontend/dist/js/authStore-CaLdzyAr.js +0 -1
  192. package/frontend/dist/js/markdownMath-B0BpyFBS.js +0 -1
  193. package/frontend/dist/js/react-vendor-wiHys0m2.js +0 -9
  194. package/frontend/dist/js/useDictation-DEAp64eu.js +0 -1
  195. package/frontend/dist/js/workApi-gpxrWwCm.js +0 -1
@@ -1,4 +1,4 @@
1
- import{r as e}from"./rolldown-runtime-hePW80VL.js";import{i as t}from"./react-vendor-wiHys0m2.js";import{a as n,t as r}from"./logger-BR4forr_.js";import{g as i,t as a}from"./chatStore-j8bGpkeT.js";import{t as o}from"./useTranslation-UHEMTEHd.js";import{a as s,c,s as l}from"./utils-DaXuqmQm.js";import{Tr as u}from"./ui-vendor-_fvLnmDx.js";import{t as d}from"./config-BbrsmDn2.js";import{N as f,d as p}from"./api-CnJYEbRz.js";import{n as m}from"./authStore-DwaPsICv.js";import{t as h}from"./appStore-DULGAJnH.js";import{c as g,s as _}from"./artifactHtml-DDmfpcB0.js";var v=e(t(),1),y=/```([^\n`]*)\n([\s\S]*?)\n```/g,b=/^(?:%%|flowchart|graph|sequenceDiagram|classDiagram|stateDiagram(?:-v2)?|erDiagram|journey|gantt|pie|mindmap|timeline|gitGraph|quadrantChart|requirementDiagram|sankey-beta|xychart-beta|block-beta|architecture-beta|packet-beta|kanban|radar-beta|treemap-beta|C4Context)\b/i,x=/[\w@./-]+\.(?:html?|css|mjs|js|jsx|ts|tsx|svg|json|py)/i,ee=[`html`,`react`,`svg`,`mermaid`,`chart`,`code`,`text`,`json`],S=[{regex:/<artifact\s+type="([^"]+)"\s+title="([^"]+)"[^>]*>([\s\S]*?)<\/artifact>/gi,extract:e=>({type:A(e[1]),title:C(e[2]).trim()||`Artifact`,content:e[3].trim()})},{regex:/<artifact\s+type="([^"]+)"[^>]*>([\s\S]*?)<\/artifact>/gi,extract:e=>{let t=A(e[1]);return{type:t,title:`${t.toUpperCase()} Artifact`,content:e[2].trim()}}}];function C(e){if(typeof document<`u`){let t=document.createElement(`div`);return t.innerHTML=e,t.textContent||t.innerText||``}return T(w(e))}function w(e){return e.replace(/&(lt|gt|quot|apos|#39);/gi,(e,t)=>{switch(t.toLowerCase()){case`lt`:return`<`;case`gt`:return`>`;case`quot`:return`"`;case`apos`:case`#39`:return`'`;default:return``}}).replace(/&amp;/gi,`&`)}function T(e){let t=``,n=!1,r=null;for(let i=0;i<e.length;i+=1){let a=e[i];if(n){if(r){a===r&&(r=null);continue}if(a===`"`||a===`'`){r=a;continue}a===`>`&&(n=!1);continue}if(a===`<`){let t=e[i+1];if(t&&/[!/A-Za-z?]/.test(t)){n=!0;continue}}t+=a}return t}function E(e){let t=e.match(/<title[^>]*>([\s\S]*?)<\/title>/i);if(t)return C(t[1]).trim()||null;let n=e.match(/<h1[^>]*>([\s\S]*?)<\/h1>/i);return n&&C(n[1]).trim()||null}function D(e){for(let t of[/export\s+default\s+(?:function|class)\s+([A-Z]\w*)/,/export\s+default\s+([A-Z]\w*)\s*(?:;|$)/m,/(?:function|class)\s+([A-Z]\w*)/,/const\s+([A-Z]\w*)\s*[:=]/,/(?:function|const|class)\s+(\w+)/]){let n=e.match(t);if(n)return n[1]}return null}function O(e){let t=e.match(/^\s*title\s+(.+)$/im);if(t)return t[1].trim();let n=e.trim().match(/^([A-Za-z][\w-]*)/);if(!n)return null;let r=n[1].replace(/-(?:beta|v2)$/i,``).replace(/([a-z])([A-Z])/g,`$1 $2`);return`${r.charAt(0).toUpperCase()}${r.slice(1)}`}function k(e){if(e.includes(`def main(`))return`Python Script`;let t=e.match(/class\s+(\w+)/);if(t)return`${t[1]} Class`;let n=e.match(/def\s+(\w+)/);return n&&n[1]!==`__init__`?`${n[1]} Function`:null}function te(e){let t=e.match(/function\s+(\w+)/);if(t)return`${t[1]} Function`;let n=e.match(/(?:const|let)\s+(\w+)\s*=/);return n?n[1]:null}function A(e){let t=e.trim().toLowerCase();return ee.includes(t)?t:`text`}function j(e){if(!e)return;let t=e.trim().toLowerCase().replace(/^\./,``).replace(/[,:;]+$/,``);switch(t){case`htm`:case`html`:return`html`;case`js`:case`mjs`:case`javascript`:return`javascript`;case`jsx`:case`tsx`:case`react`:return`react`;case`ts`:case`typescript`:return`typescript`;case`py`:case`python`:return`python`;case`css`:case`svg`:case`json`:return t;default:return t||void 0}}function M(e){let t=[],n=new RegExp(y),r;for(;(r=n.exec(e))!==null;){let n=r[1].trim(),i=ne(n,N(e,r.index));t.push({raw:r[0],info:n,content:r[2].trim(),start:r.index,end:r.index+r[0].length,language:i.language,fileName:i.fileName})}return t}function ne(e,t){let n=re(e)||t,r=e.split(/\s+/).filter(Boolean)[0]?.replace(/[{}[\]()]/g,``);return{language:(r&&!x.test(r)&&!r.includes(`=`)?j(r):void 0)||j(F(n)),fileName:n}}function re(e){let t=e.match(/(?:file(?:name)?|path|name)\s*=\s*["']?([^"'\s]+)["']?/i);if(t&&x.test(t[1]))return P(t[1]);let n=e.match(x);return n?P(n[0]):void 0}function N(e,t){let n=e.slice(Math.max(0,t-180),t).split(`
1
+ import{r as e}from"./rolldown-runtime-hePW80VL.js";import{i as t}from"./react-vendor-CR5VJ85Q.js";import{a as n,t as r}from"./logger-BR4forr_.js";import{g as i,t as a}from"./chatStore-DpVxt9VX.js";import{t as o}from"./useTranslation-Boi0fB1B.js";import{a as s,c,s as l}from"./utils-B-Bhh1pF.js";import{Tr as u}from"./ui-vendor-DVTj_sKN.js";import{t as d}from"./config-4_s8hdqO.js";import{N as f,d as p}from"./api-BrHW-VGd.js";import{n as m}from"./authStore-DjAsRpNL.js";import{t as h}from"./appStore-DkRdQQeY.js";import{c as g,s as _}from"./artifactHtml-DDmfpcB0.js";var v=e(t(),1),y=/```([^\n`]*)\n([\s\S]*?)\n```/g,b=/^(?:%%|flowchart|graph|sequenceDiagram|classDiagram|stateDiagram(?:-v2)?|erDiagram|journey|gantt|pie|mindmap|timeline|gitGraph|quadrantChart|requirementDiagram|sankey-beta|xychart-beta|block-beta|architecture-beta|packet-beta|kanban|radar-beta|treemap-beta|C4Context)\b/i,x=/[\w@./-]+\.(?:html?|css|mjs|js|jsx|ts|tsx|svg|json|py)/i,ee=[`html`,`react`,`svg`,`mermaid`,`chart`,`code`,`text`,`json`],S=[{regex:/<artifact\s+type="([^"]+)"\s+title="([^"]+)"[^>]*>([\s\S]*?)<\/artifact>/gi,extract:e=>({type:A(e[1]),title:C(e[2]).trim()||`Artifact`,content:e[3].trim()})},{regex:/<artifact\s+type="([^"]+)"[^>]*>([\s\S]*?)<\/artifact>/gi,extract:e=>{let t=A(e[1]);return{type:t,title:`${t.toUpperCase()} Artifact`,content:e[2].trim()}}}];function C(e){if(typeof document<`u`){let t=document.createElement(`div`);return t.innerHTML=e,t.textContent||t.innerText||``}return T(w(e))}function w(e){return e.replace(/&(lt|gt|quot|apos|#39);/gi,(e,t)=>{switch(t.toLowerCase()){case`lt`:return`<`;case`gt`:return`>`;case`quot`:return`"`;case`apos`:case`#39`:return`'`;default:return``}}).replace(/&amp;/gi,`&`)}function T(e){let t=``,n=!1,r=null;for(let i=0;i<e.length;i+=1){let a=e[i];if(n){if(r){a===r&&(r=null);continue}if(a===`"`||a===`'`){r=a;continue}a===`>`&&(n=!1);continue}if(a===`<`){let t=e[i+1];if(t&&/[!/A-Za-z?]/.test(t)){n=!0;continue}}t+=a}return t}function E(e){let t=e.match(/<title[^>]*>([\s\S]*?)<\/title>/i);if(t)return C(t[1]).trim()||null;let n=e.match(/<h1[^>]*>([\s\S]*?)<\/h1>/i);return n&&C(n[1]).trim()||null}function D(e){for(let t of[/export\s+default\s+(?:function|class)\s+([A-Z]\w*)/,/export\s+default\s+([A-Z]\w*)\s*(?:;|$)/m,/(?:function|class)\s+([A-Z]\w*)/,/const\s+([A-Z]\w*)\s*[:=]/,/(?:function|const|class)\s+(\w+)/]){let n=e.match(t);if(n)return n[1]}return null}function O(e){let t=e.match(/^\s*title\s+(.+)$/im);if(t)return t[1].trim();let n=e.trim().match(/^([A-Za-z][\w-]*)/);if(!n)return null;let r=n[1].replace(/-(?:beta|v2)$/i,``).replace(/([a-z])([A-Z])/g,`$1 $2`);return`${r.charAt(0).toUpperCase()}${r.slice(1)}`}function k(e){if(e.includes(`def main(`))return`Python Script`;let t=e.match(/class\s+(\w+)/);if(t)return`${t[1]} Class`;let n=e.match(/def\s+(\w+)/);return n&&n[1]!==`__init__`?`${n[1]} Function`:null}function te(e){let t=e.match(/function\s+(\w+)/);if(t)return`${t[1]} Function`;let n=e.match(/(?:const|let)\s+(\w+)\s*=/);return n?n[1]:null}function A(e){let t=e.trim().toLowerCase();return ee.includes(t)?t:`text`}function j(e){if(!e)return;let t=e.trim().toLowerCase().replace(/^\./,``).replace(/[,:;]+$/,``);switch(t){case`htm`:case`html`:return`html`;case`js`:case`mjs`:case`javascript`:return`javascript`;case`jsx`:case`tsx`:case`react`:return`react`;case`ts`:case`typescript`:return`typescript`;case`py`:case`python`:return`python`;case`css`:case`svg`:case`json`:return t;default:return t||void 0}}function M(e){let t=[],n=new RegExp(y),r;for(;(r=n.exec(e))!==null;){let n=r[1].trim(),i=ne(n,N(e,r.index));t.push({raw:r[0],info:n,content:r[2].trim(),start:r.index,end:r.index+r[0].length,language:i.language,fileName:i.fileName})}return t}function ne(e,t){let n=re(e)||t,r=e.split(/\s+/).filter(Boolean)[0]?.replace(/[{}[\]()]/g,``);return{language:(r&&!x.test(r)&&!r.includes(`=`)?j(r):void 0)||j(F(n)),fileName:n}}function re(e){let t=e.match(/(?:file(?:name)?|path|name)\s*=\s*["']?([^"'\s]+)["']?/i);if(t&&x.test(t[1]))return P(t[1]);let n=e.match(x);return n?P(n[0]):void 0}function N(e,t){let n=e.slice(Math.max(0,t-180),t).split(`
2
2
  `).slice(-3).reverse();for(let e of n){let t=e.trim().replace(/^#{1,6}\s*/,``).replace(/^[-*]\s*/,``).replace(/[::]\s*$/,``).match(x);if(t)return P(t[0])}}function P(e){return e.replace(/^["'`]+|["'`:]+$/g,``)}function F(e){return e?.match(/\.([a-z0-9]+)$/i)?.[1]}function I(e){return e?.split(/[\\/]/).pop()}function L(e){let t=I(e);if(!t)return null;let n=t.replace(/\.[^.]+$/,``);return/^(index|main|app)$/i.test(n)?null:n.replace(/[-_]+/g,` `).replace(/\b\w/g,e=>e.toUpperCase())}function R(e){let t=Date.now();return{...e,id:`artifact-${t}-${c(9)}`,createdAt:t,updatedAt:t}}function z(e){let t=j(e.language)||j(F(e.fileName));switch(t){case`html`:return{type:`html`,title:E(e.content)||L(e.fileName)||`HTML Document`};case`svg`:return{type:`svg`,title:L(e.fileName)||`SVG Image`};case`react`:return{type:`react`,title:D(e.content)||L(e.fileName)||`React Component`,language:`jsx`};case`mermaid`:return{type:`mermaid`,title:O(e.content)||`Diagram`,language:`mermaid`};case`json`:return{type:`json`,title:L(e.fileName)||`JSON Data`};case`python`:return{type:`code`,title:k(e.content)||L(e.fileName)||`Python Code`,language:`python`};case`css`:return{type:`code`,title:L(e.fileName)||`CSS Styles`,language:`css`};case`javascript`:return{type:`code`,title:te(e.content)||L(e.fileName)||`JavaScript Code`,language:`javascript`};case`typescript`:return{type:`code`,title:L(e.fileName)||`TypeScript Code`,language:`typescript`};default:return t?{type:`code`,title:L(e.fileName)||`${t.toUpperCase()} Code`,language:t}:null}}function B(e){return(j(e.language)||j(F(e.fileName)))===`html`}function V(e){return(j(e.language)||j(F(e.fileName)))===`css`}function ie(e){return(j(e.language)||j(F(e.fileName)))===`javascript`}function H(e){let t=M(e),n=t.filter(B);if(n.length===0)return null;let r=t.filter(V),i=t.filter(ie);if(r.length===0&&i.length===0)return null;let a=n.find(e=>/(^|[/\\])index\.html?$/i.test(e.fileName||``))||n[0],o=U(a.content,r,i),s=g(o,r.map(e=>e.content),i.map(e=>e.content));return q(s,`html`)?{artifact:R({type:`html`,title:E(s)||L(a.fileName)||`Interactive HTML App`,description:`Bundled generated HTML, CSS, and JavaScript files into one runnable artifact.`,content:s}),ranges:[a,...r,...i]}:null}function U(e,t,n){let r=e;for(let e of t){let t=I(e.fileName);t&&(r=r.replace(RegExp(`<link\\b[^>]*href=["'][^"']*${K(t)}["'][^>]*>`,`gi`),``))}for(let e of n){let t=I(e.fileName);t&&(r=r.replace(RegExp(`<script\\b[^>]*src=["'][^"']*${K(t)}["'][^>]*>\\s*<\\/script>`,`gi`),``))}return r}function ae(e){let t=/<!doctype\s+html|<html[\s>]/i.exec(e);if(!t||t.index===void 0)return null;let n=M(e);if(W(t.index,n))return null;let r=t.index,i=/<\/html>/gi;i.lastIndex=r;let a=i.exec(e),o=a?a.index+a[0].length:e.length,s=e.slice(r,o).trim();return q(s,`html`)?{artifact:R({type:`html`,title:E(s)||`HTML Document`,content:s}),ranges:[{start:r,end:o}]}:null}function W(e,t){return t.some(t=>e>=t.start&&e<=t.end)}function G(e,t){return[...t].sort((e,t)=>t.start-e.start).reduce((e,t)=>`${e.slice(0,t.start)}${e.slice(t.end)}`,e)}function K(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}function q(e,t){if(t===`html`){let t=e.trim(),n=/<[^>]+>/.test(t),r=/<(canvas|script|style|button|form|input|select|textarea|video|audio)\b/i.test(t)||/\bon(?:click|input|submit|keydown|keyup|mousemove)=/i.test(t);return n&&(_(t)||t.length>160||r)}if(t===`svg`)return/<svg[^>]*>/.test(e);if(t===`react`)return/<[A-Za-z][^>]*>/.test(e)&&/\b(?:export\s+default|return\s*[(<]|=>\s*[(<]|createRoot|render\s*\()/.test(e);if(t===`mermaid`)return b.test(e.trim());if(t===`json`)try{return JSON.parse(e),e.trim().length>100}catch{return!1}if(t===`code`){let t=e.split(`
3
3
  `).length,n=e.trim().length,r=/function|class|def |import |from |const |let |var |if |for |while |try |catch/.test(e);return(n>500||t>15)&&r}return e.trim().length>200}function oe(e){let t=[],n=e;for(let e of S){e.regex.lastIndex=0;let r=[],i;for(;(i=e.regex.exec(n))!==null;){let n=e.extract(i);q(n.content,n.type)&&(t.push(R({type:n.type,title:n.title,content:n.content})),r.push({start:i.index,end:i.index+i[0].length}))}n=G(n,r)}let r=H(n);for(;r;)t.push(r.artifact),n=G(n,r.ranges),r=H(n);let i=ae(n);i&&(t.push(i.artifact),n=G(n,i.ranges));let a=M(n),o=[];for(let e of a){let n=z(e);n&&q(e.content,n.type)&&(t.push(R({type:n.type,title:n.title,content:e.content,language:n.language})),o.push(e))}return n=G(n,o),{content:n.trim(),artifacts:t}}var J=new Map;function se(e,t,n=``){let r=J.get(e);if(n){if((!r||r.state===`none`)&&(J.set(e,{state:`open`,startedAt:Date.now()}),!t))return;let n=J.get(e);t&&n?.state===`open`&&J.set(e,{state:`done`,durationMs:Date.now()-n.startedAt});return}if(r&&r.state!==`open`||!t)return;let i=l(t);if(!r){i.thinkingComplete?J.set(e,{state:`none`}):J.set(e,{state:`open`,startedAt:Date.now()});return}i.thinkingComplete&&J.set(e,{state:`done`,durationMs:Date.now()-r.startedAt})}function Y(e){let t=J.get(e);if(t){if(t.state===`done`)return t.durationMs;if(t.state===`open`)return Date.now()-t.startedAt}}function ce(e){let t=J.get(e);if(J.delete(e),t){if(t.state===`done`)return t.durationMs;if(t.state===`open`)return Date.now()-t.startedAt}}function le(e){let t=e/1e3;if(t<.95)return`${Math.max(.1,Math.round(t*10)/10)}s`;if(t<60)return`${Math.round(t)}s`;let n=Math.floor(t/60),r=Math.round(t%60);return r>0?`${n}m ${r}s`:`${n}m`}var ue=(e,t)=>{a.setState(n=>{let r=n=>n&&n.id===e?{...n,settings:{...n.settings,...t.length>0?{promptQueue:t}:{promptQueue:void 0}}}:n;return{currentSession:r(n.currentSession),sessions:n.sessions.map(e=>r(e))}})},de=(e,t)=>{t?.add(e.assistantMessageId),e.cancelRequested=!0,e.jobId&&e.abort.abort()},fe=async e=>{if(!e.cancelledMessageIds.has(e.assistantMessageId))return!1;try{let t=await(e.cancelByIdentity??Q)(e.sessionId,e.assistantMessageId);await e.settle(t)}catch(t){e.onError?.(t)}return!0},pe=e=>{e.retainForContinuation||e.cancelledMessageIds.delete(e.assistantMessageId)},me=async(e,t,n={})=>{if(e.jobId=t.jobId,!e.cancelRequested)return`stream`;e.abort.abort();let[,r]=await Promise.allSettled([(n.byJob??ye)(t.jobId),(n.byIdentity??Q)(e.sessionId,e.assistantMessageId)]);if(r.status===`rejected`)throw r.reason;return r.value.completed?`completed`:`cancelled`},he=async e=>{let t=await e.loadSession(e.sessionId);if(t.id!==e.sessionId)throw Error(`Reloaded chat session does not match the completed turn.`);if(!t.messages.find(t=>t.id===e.assistantMessageId&&t.role===`assistant`))throw Error(`Completed assistant message is absent from chat storage.`);return e.applySession(t),t},X=async e=>{try{let t=await e.json(),n=typeof t.error==`string`?t.error:typeof t.message==`string`?t.message:void 0;if(n)return Error(n)}catch{}return Error(`Chat event request failed with status ${e.status}.`)},Z=()=>{let e=localStorage.getItem(`auth-token`);return e?{Authorization:`Bearer ${e}`}:{}},ge=async e=>{let t=await fetch(`${d}/chat/sessions/${encodeURIComponent(e.sessionId)}/generations`,{method:`POST`,headers:{"Content-Type":`application/json`,...Z()},credentials:`same-origin`,signal:e.signal,body:JSON.stringify({message:e.message,images:e.images,userMessageId:e.userMessageId,assistantMessageId:e.assistantMessageId,options:e.options,webSearch:e.webSearch,tools:e.tools===!0,...e.toolSelection?{toolSelection:e.toolSelection}:{},regenerate:e.regenerate===!0,originalMessageId:e.originalMessageId,...e.modelOverride?{modelOverride:e.modelOverride}:{},...e.compare?{compare:!0}:{}})});if(!t.ok)throw await X(t);let n=await t.json();if(!n.data?.jobId)throw Error(`Chat generation response did not include a durable job.`);return n.data},_e=async(e,t)=>{if(!e.body)throw Error(`Chat event stream has no response body.`);let n=e.body.getReader(),r=new TextDecoder,i=``,a=0,o=!1,s=e=>{let n,r=[];for(let t of e.split(`
4
4
  `))t.startsWith(`id:`)&&(n=Number(t.slice(3).trim())),t.startsWith(`data:`)&&r.push(t.slice(5).trimStart());if(!Number.isSafeInteger(n)||!r.length)return;let i=JSON.parse(r.join(`
@@ -1 +1 @@
1
- import{r as e}from"./rolldown-runtime-hePW80VL.js";import{i as t}from"./react-vendor-wiHys0m2.js";var n=e(t(),1),r=`button, [href], input, select, textarea, [tabindex], [contenteditable="true"]`;function i(e,{onClose:t,enabled:i=!0,initialFocusRef:a}){let[o]=(0,n.useState)(()=>document.activeElement),s=(0,n.useRef)(null),c=(0,n.useRef)(t);(0,n.useEffect)(()=>{c.current=t},[t]),(0,n.useEffect)(()=>{let t=e.current;if(!i||!t)return;let n=document.activeElement,l=t.contains(n)?o:n,u=e=>e.getClientRects().length>0&&getComputedStyle(e).visibility!==`hidden`&&!e.closest(`[inert], [aria-hidden="true"]`),d=()=>{let e=Array.from(t.querySelectorAll(r)).filter(e=>e.tabIndex>=0&&!e.matches(`:disabled`)&&u(e));return e.filter(t=>{if(!(t instanceof HTMLInputElement)||t.type!==`radio`||!t.name)return!0;let n=e.filter(e=>e instanceof HTMLInputElement&&e.type===`radio`&&e.name===t.name&&e.form===t.form);return t===(n.find(e=>e.checked)??n[0])})},f=()=>{let e=Array.from(document.querySelectorAll(`[role="dialog"][aria-modal="true"]`)).filter(u);return e[e.length-1]===t},p=a?.current;if(p&&t.contains(p)&&u(p)&&!p.matches(`:disabled`))s.current=p,p.focus({preventScroll:!0});else if(n instanceof HTMLElement&&t.contains(n))s.current=n;else{let e=s.current;(e&&t.contains(e)&&u(e)&&!e.matches(`:disabled`)?e:d()[0]??t).focus({preventScroll:!0})}let m=e=>{if(!(e.defaultPrevented||!f()||e.isComposing)){if(e.key===`Escape`&&c.current)e.preventDefault(),e.stopPropagation(),c.current();else if(e.key===`Tab`){let n=d(),r=n[0];if(e.preventDefault(),!r)t.focus();else{let t=n.indexOf(document.activeElement);n[e.shiftKey?t<=0?n.length-1:t-1:(t+1)%n.length]?.focus()}}}},h=e=>{if(e.defaultPrevented||e.button!==0||!f())return;let t=e.target instanceof Element?e.target.closest(`button`):null;t&&d().includes(t)&&(e.preventDefault(),t.focus({preventScroll:!0}))};return document.addEventListener(`keydown`,m),document.addEventListener(`mousedown`,h),()=>{document.removeEventListener(`keydown`,m),document.removeEventListener(`mousedown`,h),l instanceof HTMLElement&&l.isConnected&&l.focus({preventScroll:!0})}},[e,i,o,a])}export{i as t};
1
+ import{r as e}from"./rolldown-runtime-hePW80VL.js";import{i as t}from"./react-vendor-CR5VJ85Q.js";var n=e(t(),1),r=`button, [href], input, select, textarea, [tabindex], [contenteditable="true"]`;function i(e,{onClose:t,enabled:i=!0,initialFocusRef:a}){let[o]=(0,n.useState)(()=>document.activeElement),s=(0,n.useRef)(null),c=(0,n.useRef)(t);(0,n.useEffect)(()=>{c.current=t},[t]),(0,n.useEffect)(()=>{let t=e.current;if(!i||!t)return;let n=document.activeElement,l=t.contains(n)?o:n,u=e=>e.getClientRects().length>0&&getComputedStyle(e).visibility!==`hidden`&&!e.closest(`[inert], [aria-hidden="true"]`),d=()=>{let e=Array.from(t.querySelectorAll(r)).filter(e=>e.tabIndex>=0&&!e.matches(`:disabled`)&&u(e));return e.filter(t=>{if(!(t instanceof HTMLInputElement)||t.type!==`radio`||!t.name)return!0;let n=e.filter(e=>e instanceof HTMLInputElement&&e.type===`radio`&&e.name===t.name&&e.form===t.form);return t===(n.find(e=>e.checked)??n[0])})},f=()=>{let e=Array.from(document.querySelectorAll(`[role="dialog"][aria-modal="true"]`)).filter(u);return e[e.length-1]===t},p=a?.current;if(p&&t.contains(p)&&u(p)&&!p.matches(`:disabled`))s.current=p,p.focus({preventScroll:!0});else if(n instanceof HTMLElement&&t.contains(n))s.current=n;else{let e=s.current;(e&&t.contains(e)&&u(e)&&!e.matches(`:disabled`)?e:d()[0]??t).focus({preventScroll:!0})}let m=e=>{if(!(e.defaultPrevented||!f()||e.isComposing)){if(e.key===`Escape`&&c.current)e.preventDefault(),e.stopPropagation(),c.current();else if(e.key===`Tab`){let n=d(),r=n[0];if(e.preventDefault(),!r)t.focus();else{let t=n.indexOf(document.activeElement);n[e.shiftKey?t<=0?n.length-1:t-1:(t+1)%n.length]?.focus()}}}},h=e=>{if(e.defaultPrevented||e.button!==0||!f())return;let t=e.target instanceof Element?e.target.closest(`button`):null;t&&d().includes(t)&&(e.preventDefault(),t.focus({preventScroll:!0}))};return document.addEventListener(`keydown`,m),document.addEventListener(`mousedown`,h),()=>{document.removeEventListener(`keydown`,m),document.removeEventListener(`mousedown`,h),l instanceof HTMLElement&&l.isConnected&&l.focus({preventScroll:!0})}},[e,i,o,a])}export{i as t};
@@ -0,0 +1 @@
1
+ import{r as e}from"./rolldown-runtime-hePW80VL.js";import{i as t,r as n,t as r}from"./react-vendor-CR5VJ85Q.js";import{t as i}from"./useQuery-BTKpXudI.js";import{d as a}from"./router-vendor-DqMnEJWK.js";import{t as o}from"./logger-BR4forr_.js";import{h as s,s as c,t as l}from"./chatStore-DpVxt9VX.js";import{t as u}from"./useTranslation-Boi0fB1B.js";import{t as d}from"./utils-B-Bhh1pF.js";import{An as f,G as p,It as m,Kt as h,Ln as g,M as _,On as v,Qn as y,S as b,Tn as x,Tr as S,Yn as C,Yt as ee,Z as te,Zn as w,Zt as T,c as ne,cr as E,et as D,ir as O,n as re,t as ie}from"./ui-vendor-DVTj_sKN.js";import{t as ae}from"./Button-j68Q8KVh.js";import{S as oe,g as se,t as k,y as A}from"./api-BrHW-VGd.js";import{t as ce}from"./authStore-DjAsRpNL.js";import"./ui-Aq8MP7Ph.js";import{i as j,n as M,r as N,t as P}from"./thinking-DwlkTfPX.js";var F=e(t(),1),le=n(),ue=` · `,de=`strands:plugin:`,fe=new Intl.Collator(void 0,{numeric:!0,sensitivity:`base`});function pe(e){return e.agentId||e.name.split(`:`)[0]||e.name}function me(e){return/embed/i.test(e.name)?!0:[e.details?.family,...e.details?.families??[]].filter(e=>!!e).some(e=>/bert$/i.test(e))}function I(e){return!!(e.isAgent&&e.agentId&&e.name===e.agentId)}function L(e,t){let n=e.find(I);if(n?.agentName)return n.agentName;for(let t of e){let e=t.agentName??``,n=e.indexOf(ue);if(n>0)return e.slice(0,n)}return t}function he(e,t){let n=e.agentName||e.name;if(I(e))return{title:n,isDefault:!0};let r=`${t}${ue}`,i=n.startsWith(r)?n.slice(r.length):n,a;if(e.name.startsWith(de)){let e=/^(.*\S)\s+\(([^()]+)\)$/.exec(i);e&&(i=e[1],a=e[2])}return{title:i,...a?{provider:a}:{},isDefault:!1}}function R(e,t){return[...e].sort((e,n)=>{let r=I(e);return r===I(n)?fe.compare(t(e),t(n)):r?-1:1})}function ge(e,t){let n=[],r=[],i=[],a=[],o=new Map,c=new Map;for(let t of e)if(t.isLegacySelection)n.push(t);else if(t.isUnavailable)r.push(t);else if(t.isPersona)i.push(t);else if(t.isAgent){let e=pe(t);c.set(e,[...c.get(e)??[],t])}else if(t.isPlugin){let e=t.pluginId||t.pluginName||``;o.set(e,[...o.get(e)??[],t])}else s(t)&&!me(t)&&a.push(t);let l=[{key:`legacy`,kind:`legacy`,label:t.legacy,models:n},{key:`unavailable`,kind:`unavailable`,label:t.unavailable,models:r},{key:`personas`,kind:`personas`,label:t.personas,models:i},{key:`ollama`,kind:`ollama`,label:t.ollama,models:a}];for(let[e,n]of o)l.push({key:`plugin:${e}`,kind:`plugin`,label:n[0]?.pluginName||e||t.plugins,models:R(n,e=>e.name)});for(let[e,n]of c){let r=L(n,e||t.agents);l.push({key:`agent:${e}`,kind:`agent`,label:r,models:R(n,e=>he(e,r).title)})}return l.filter(e=>e.models.length>0)}function z(e){return e.toLowerCase().replace(/[\s\-_./:·()[\],]+/g,` `).trim()}function _e(e,t,n,r=``){let i=z(n).split(` `).filter(Boolean);if(i.length===0)return!0;let a=z([e.name,r,e.personaName,e.pluginName,e.agentName,t.label].filter(Boolean).join(` `)),o=a.replace(/ /g,``);return i.every(e=>a.includes(e)||o.includes(e))}function ve(e,t){if(e.length<=8)return{visible:e,hidden:0};let n=e.slice(0,5);if(!n.some(t)){let r=e.find(t);r&&(n[n.length-1]=r)}return{visible:n,hidden:e.length-n.length}}var ye={ai:`AI`,api:`API`,awq:`AWQ`,bf16:`BF16`,chatgpt:`ChatGPT`,deepseek:`DeepSeek`,fp16:`FP16`,fp8:`FP8`,glm:`GLM`,gpt:`GPT`,gptq:`GPTQ`,hd:`HD`,lfm:`LFM`,llm:`LLM`,minimax:`MiniMax`,mlx:`MLX`,ml:`ML`,moe:`MoE`,openai:`OpenAI`,oss:`OSS`,qwq:`QwQ`,tts:`TTS`,vl:`VL`,xl:`XL`},be={"meta-llama":`Meta`,"x-ai":`xAI`,"z-ai":`Z.ai`,amazon:`Amazon`,anthropic:`Anthropic`,cohere:`Cohere`,deepseek:`DeepSeek`,google:`Google`,liquid:`Liquid AI`,microsoft:`Microsoft`,minimax:`MiniMax`,mistralai:`Mistral`,moonshotai:`Moonshot AI`,nvidia:`NVIDIA`,openai:`OpenAI`,perplexity:`Perplexity`,qwen:`Qwen`},xe=/^(?:hf\.co|huggingface\.co)\//i,B=new Set([`gguf`]);function V(e){let t=e.toLowerCase();return ye[t]?ye[t]:e!==t||/^o\d/.test(e)?e:/^\d+(?:\.\d+)?[bkmt]$/.test(e)||/^[a-z]\d+(?:\.\d+)?[a-z]?$/.test(e)?e.toUpperCase():/^\d/.test(e)?e:e.charAt(0).toUpperCase()+e.slice(1)}function H(e){let t=e.split(/[-_\s]+/).filter(Boolean),n=t.length>1?t.filter(e=>!B.has(e.toLowerCase())):t,r=[];for(let e of n){let t=r[r.length-1];if(t&&/^\d{1,2}$/.test(e)&&/^\d{1,2}$/.test(t)&&r.length>1&&!/^\d/.test(r[r.length-2])){r[r.length-1]=`${t}.${e}`;continue}r.push(V(e))}return r.join(` `)||e}function U(e){let t=e.toLowerCase();return be[t]?be[t]:e===t?H(e):e}function Se(e,t={}){let n=e.trim(),r=n.startsWith(`~`),i=(r?n.slice(1):n).replace(xe,``).split(`/`).filter(Boolean);if(!(t.prettify??i.length>1)||i.length===0)return{name:n};let a=i[i.length-1],o,s=a.lastIndexOf(`:`);s>0&&(o=a.slice(s+1)||void 0,a=a.slice(0,s)),r&&/[-_]latest$/i.test(a)&&(a=a.replace(/[-_]latest$/i,``),o??=`latest`),o===`latest`&&!r&&(o=void 0);let c=i.length>1?U(i[i.length-2]):void 0;return{name:H(a),...c?{vendor:c}:{},...o?{tag:o}:{}}}function Ce(e){if(!Number.isFinite(e)||e<=0)return``;if(e>=1e6){let t=e%1048576==0?e/1048576:e/1e6;return`${Number(t.toFixed(1))}M`}if(e>=1e3){let t=e%1024==0?e/1024:e/1e3;return`${Math.round(t)}K`}return String(e)}function we(e){if(!Number.isFinite(e)||e<=0)return``;let t=[`B`,`KB`,`MB`,`GB`,`TB`],n=e,r=0;for(;n>=1e3&&r<t.length-1;)n/=1e3,r+=1;return`${n>=10||r===0?Math.round(n):n.toFixed(1)} ${t[r]}`}var W=r(),Te=[`bg-amber-500/15 text-amber-700 dark:text-amber-300`,`bg-emerald-500/15 text-emerald-700 dark:text-emerald-300`,`bg-sky-500/15 text-sky-700 dark:text-sky-300`,`bg-violet-500/15 text-violet-700 dark:text-violet-300`,`bg-rose-500/15 text-rose-700 dark:text-rose-300`,`bg-indigo-500/15 text-indigo-700 dark:text-indigo-300`,`bg-teal-500/15 text-teal-700 dark:text-teal-300`,`bg-orange-500/15 text-orange-700 dark:text-orange-300`];function Ee(e){let t=0;for(let n of e.toLowerCase())t=t*31+n.charCodeAt(0)>>>0;return Te[t%Te.length]}function De({seed:e,size:t=`sm`,className:n}){let r=(/[\p{L}\p{N}]/u.exec(e)?.[0]??`?`).toUpperCase();return(0,W.jsx)(`span`,{"aria-hidden":`true`,className:d(`inline-flex shrink-0 select-none items-center justify-center font-semibold leading-none`,t===`md`?`h-6 w-6 rounded-md text-[11px]`:`h-4 w-4 rounded text-[9px]`,Ee(e),n),children:r})}function Oe(e){return e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${(e/1e3).toFixed(1)}K`:e.toString()}function ke({hfTask:e,hfSort:t,canInstallModels:n,loadingHf:r,hfModels:i,expandedHfModel:a,hfGgufFiles:o,loadingGguf:s,pullingModel:c,pullProgress:l,setHfTask:f,setHfSort:p,onToggleHfModel:h,onPullHfGguf:g,onCancelPull:_,onRefreshHfModels:y}){let{t:b}=u();return(0,W.jsxs)(`div`,{className:`flex-1 flex flex-col overflow-hidden`,children:[(0,W.jsx)(`div`,{className:`px-3 py-2 border-b border-gray-200 dark:border-dark-300 flex-shrink-0 space-y-2`,children:(0,W.jsxs)(`div`,{className:`flex gap-2`,children:[(0,W.jsxs)(`select`,{value:e,onChange:e=>f(e.target.value),onMouseDown:e=>e.stopPropagation(),className:`flex-1 px-2 py-1.5 rounded-lg border text-xs bg-gray-50 dark:bg-dark-50 border-gray-200 dark:border-dark-300 text-gray-900 dark:text-gray-100`,children:[(0,W.jsx)(`option`,{value:`text-generation`,children:b(`modelManager.huggingface.taskTextGeneration`)}),(0,W.jsx)(`option`,{value:`text-to-speech`,children:b(`modelManager.huggingface.taskTextToSpeech`)}),(0,W.jsx)(`option`,{value:`text-to-image`,children:b(`modelManager.huggingface.taskTextToImage`)}),(0,W.jsx)(`option`,{value:`automatic-speech-recognition`,children:b(`modelManager.huggingface.taskSpeechRecognition`)})]}),(0,W.jsxs)(`select`,{value:t,onChange:e=>p(e.target.value),onMouseDown:e=>e.stopPropagation(),className:`px-2 py-1.5 rounded-lg border text-xs bg-gray-50 dark:bg-dark-50 border-gray-200 dark:border-dark-300 text-gray-900 dark:text-gray-100`,children:[(0,W.jsx)(`option`,{value:`downloads`,children:b(`modelManager.huggingface.sortDownloads`)}),(0,W.jsx)(`option`,{value:`likes`,children:b(`modelManager.huggingface.sortLikes`)}),(0,W.jsx)(`option`,{value:`lastModified`,children:b(`modelManager.huggingface.sortRecent`)})]})]})}),(0,W.jsxs)(`div`,{className:`scroll-region min-h-0 flex-1 scrollbar-thin`,children:[!n&&(0,W.jsx)(`div`,{className:`mx-3 mb-1 mt-3 rounded-lg border border-amber-200 bg-amber-500/10 px-3 py-2 text-xs text-ink dark:border-amber-800 dark:bg-amber-900/20`,children:b(`modelSelector.pullRestricted`)}),r?(0,W.jsx)(`div`,{className:`flex items-center justify-center py-12`,children:(0,W.jsx)(m,{className:`h-6 w-6 animate-spin text-gray-400`})}):i.length===0?(0,W.jsxs)(`div`,{className:`px-4 py-8 text-center text-gray-500 dark:text-gray-400`,children:[(0,W.jsx)(ie,{className:`h-8 w-8 mx-auto mb-2 text-gray-300 dark:text-gray-600`}),(0,W.jsx)(`p`,{className:`text-sm`,children:b(`modelManager.huggingface.noModelsFound`)})]}):(0,W.jsx)(`div`,{className:`divide-y divide-gray-100 dark:divide-dark-200`,children:i.map(e=>{let t=a===e.id,r=o[e.id]||[],i=s===e.id;return(0,W.jsxs)(`div`,{className:`bg-white dark:bg-dark-100`,children:[(0,W.jsx)(`div`,{className:`px-3 py-3 cursor-pointer hover:bg-gray-50 dark:hover:bg-dark-200`,onMouseDown:t=>{t.preventDefault(),t.stopPropagation(),h(e.id)},children:(0,W.jsxs)(`div`,{className:`flex items-start gap-3`,children:[(0,W.jsx)(`div`,{className:`flex-shrink-0 rounded-lg bg-yellow-500/20 p-2 dark:bg-yellow-900/30`,children:(0,W.jsx)(ie,{className:`h-4 w-4 text-yellow-600 dark:text-yellow-400`})}),(0,W.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[(0,W.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,W.jsx)(`h4`,{dir:`ltr`,className:`text-sm font-medium text-gray-900 dark:text-gray-100 truncate`,children:e.id}),e.gated&&(0,W.jsx)(`span`,{className:`rounded bg-yellow-500/20 px-1.5 py-0.5 text-xs text-ink dark:bg-yellow-900/30`,children:`Gated`})]}),(0,W.jsxs)(`p`,{className:`text-xs text-gray-500 dark:text-gray-400 mt-0.5`,children:[`by `,e.author]}),(0,W.jsxs)(`div`,{className:`flex items-center gap-3 mt-1.5 text-xs text-gray-400 dark:text-gray-500`,children:[(0,W.jsxs)(`span`,{className:`flex items-center gap-1`,children:[(0,W.jsx)(v,{className:`h-3 w-3`}),Oe(e.downloads)]}),(0,W.jsxs)(`span`,{className:`flex items-center gap-1`,children:[(0,W.jsx)(ee,{className:`h-3 w-3`}),Oe(e.likes)]}),e.pipeline_tag&&(0,W.jsx)(`span`,{className:`px-1.5 py-0.5 rounded bg-gray-100 dark:bg-dark-200`,children:e.pipeline_tag})]})]}),(0,W.jsxs)(`div`,{className:`flex items-center gap-2 flex-shrink-0`,children:[(0,W.jsx)(`a`,{href:`https://huggingface.co/${e.id}`,target:`_blank`,rel:`noopener noreferrer`,onMouseDown:e=>e.stopPropagation(),className:`p-1.5 rounded-lg hover:bg-gray-100 dark:hover:bg-dark-200`,children:(0,W.jsx)(x,{className:`h-4 w-4 text-gray-400`})}),(0,W.jsx)(w,{className:d(`h-4 w-4 text-gray-400 transition-transform`,t&&`rotate-180`)})]})]})}),t&&(0,W.jsx)(`div`,{className:`px-3 pb-3 pt-1 border-t border-gray-100 dark:border-dark-200 bg-gray-50 dark:bg-dark-200`,children:i?(0,W.jsxs)(`div`,{className:`flex items-center justify-center py-4`,children:[(0,W.jsx)(m,{className:`h-4 w-4 animate-spin text-gray-400`}),(0,W.jsx)(`span`,{className:`ml-2 text-xs text-gray-500`,children:b(`modelManager.huggingface.checkingGguf`)})]}):r.length===0?(0,W.jsx)(`div`,{className:`py-4 text-center text-xs text-gray-500 dark:text-gray-400`,children:b(`modelManager.huggingface.noGgufAvailable`)}):(0,W.jsxs)(`div`,{className:`space-y-2`,children:[(0,W.jsx)(`div`,{className:`text-xs font-medium text-gray-600 dark:text-gray-300 mb-2`,children:b(`modelManager.huggingface.ggufFilesCount`,{count:r.length})}),r.map(e=>{let t=c===e.ollamaCommand;return(0,W.jsxs)(`div`,{className:`flex items-center gap-2 p-2 rounded-lg bg-white dark:bg-dark-100 border border-gray-200 dark:border-dark-300`,children:[(0,W.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[(0,W.jsx)(`div`,{className:`text-xs font-medium text-gray-800 dark:text-gray-200 truncate`,children:e.filename}),(0,W.jsxs)(`div`,{className:`flex items-center gap-2 mt-0.5 text-xs text-gray-500 dark:text-gray-400`,children:[(0,W.jsx)(`span`,{children:e.sizeFormatted}),e.quantization&&(0,W.jsx)(`span`,{className:`px-1.5 py-0.5 rounded bg-purple-100 dark:bg-purple-900/30 text-purple-700 dark:text-purple-400`,children:e.quantization})]})]}),t?(0,W.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,W.jsx)(`div`,{className:`text-xs text-gray-500 w-12 text-right`,children:l?.percent===void 0?`...`:`${l.percent}%`}),(0,W.jsx)(`button`,{onMouseDown:e=>{e.preventDefault(),e.stopPropagation(),_()},className:`p-1.5 rounded-lg text-red-500 hover:bg-red-50 dark:hover:bg-red-900/20`,children:(0,W.jsx)(re,{className:`h-4 w-4`})})]}):n?(0,W.jsxs)(`button`,{onMouseDown:t=>{t.preventDefault(),t.stopPropagation(),g(e.ollamaCommand,e.filename)},disabled:!!c,className:d(`px-3 py-1.5 rounded-lg text-xs font-medium`,`bg-primary-100 dark:bg-primary-900/30`,`text-primary-700 dark:text-primary-400`,`hover:bg-primary-200 dark:hover:bg-primary-900/50`,`disabled:opacity-50 disabled:cursor-not-allowed`),children:[(0,W.jsx)(v,{className:`h-3 w-3 inline mr-1`}),b(`models.pull`)]}):(0,W.jsx)(`span`,{className:`rounded bg-amber-500/20 px-2 py-1 text-[11px] font-medium text-ink dark:bg-amber-900/30`,children:b(`modelSelector.adminOnlyPull`)})]},e.filename)}),c?.startsWith(`hf.co/`)&&c.includes(e.id)&&l?.percent!==void 0&&(0,W.jsx)(`div`,{className:`w-full bg-gray-200 dark:bg-dark-300 rounded-full h-1.5 overflow-hidden mt-2`,children:(0,W.jsx)(`div`,{className:`h-1.5 rounded-full bg-primary-500 transition-all duration-300`,style:{width:`${l.percent}%`}})})]})})]},e.id)})})]}),(0,W.jsxs)(`div`,{className:`px-3 py-2 border-t border-gray-200 dark:border-dark-300 flex items-center justify-between flex-shrink-0`,children:[(0,W.jsxs)(`a`,{href:`https://huggingface.co/models`,target:`_blank`,rel:`noopener noreferrer`,onMouseDown:e=>e.stopPropagation(),className:`text-xs text-primary-600 dark:text-primary-400 hover:underline flex items-center gap-1`,children:[(0,W.jsx)(x,{className:`h-3 w-3`}),b(`modelManager.huggingface.browseAllLink`)]}),(0,W.jsx)(`button`,{onMouseDown:e=>{e.preventDefault(),e.stopPropagation(),y()},className:`p-1.5 rounded-lg hover:bg-gray-100 dark:hover:bg-dark-200`,children:(0,W.jsx)(te,{className:d(`h-3.5 w-3.5 text-gray-400`,r&&`animate-spin`)})})]})]})}var Ae=`[data-testid="model-selector-option"], [data-testid="model-selector-show-all"]`;function je(e,t){if(e.key!==`ArrowDown`&&e.key!==`ArrowUp`)return;let n=Array.from(e.currentTarget.querySelectorAll(Ae)),r=n.indexOf(document.activeElement);if(r===-1)return;e.preventDefault();let i=r+(e.key===`ArrowDown`?1:-1);if(i<0){t();return}n[Math.min(i,n.length-1)]?.focus()}function Me({groups:e,selectedModel:t,showImageGen:n,getModelValue:r,getModelIcon:i,getModelLabel:a,getModelTag:o,getModelSubLabel:s,onModelSelect:c,onShowAll:l,onOpenGallery:p,onExitTop:m}){let{t:g}=u();return(0,W.jsxs)(`div`,{className:`scroll-region min-h-0 flex-1 scrollbar-thin scrollbar-thumb-gray-300 dark:scrollbar-thumb-dark-400`,onKeyDown:e=>je(e,m),children:[e.length>0?e.map(e=>(0,W.jsxs)(`div`,{"data-testid":`model-selector-group`,children:[e.showHeader&&(0,W.jsxs)(`div`,{className:`sticky top-0 z-[1] flex items-center gap-2 border-b border-gray-200 bg-gray-100 px-3 py-2 text-xs font-semibold text-gray-500 dark:border-dark-400 dark:bg-dark-300 dark:text-gray-400`,children:[e.icon,(0,W.jsx)(`span`,{className:`min-w-0 truncate`,children:e.label}),(0,W.jsx)(`span`,{className:`font-normal tabular-nums text-gray-400 dark:text-dark-500`,children:e.total})]}),e.models.map(n=>{let l=r(n),u=s(n,e),f=o(n,e);return(0,W.jsx)(`button`,{type:`button`,"data-testid":`model-selector-option`,"data-model-value":l,"aria-pressed":t===l,title:n.isPersona?void 0:n.name,onClick:()=>c(l),className:d(`block w-full cursor-pointer border-b border-gray-100 px-3 py-2 text-start last:border-b-0 dark:border-dark-200`,`hover:bg-gray-50 dark:hover:bg-dark-200`,`bg-white dark:bg-dark-100 transition-colors`,`focus-visible:relative focus-visible:z-10 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-primary-500/50`,t===l&&`bg-primary-50 dark:bg-primary-900/30`),children:(0,W.jsxs)(`div`,{className:`flex items-center gap-3`,children:[i(n),(0,W.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[(0,W.jsxs)(`div`,{className:`flex min-w-0 items-center gap-1.5`,children:[(0,W.jsx)(`span`,{dir:n.isPersona?`auto`:`ltr`,className:`min-w-0 truncate text-sm font-medium text-gray-900 dark:text-gray-100`,children:a(n,e)}),f&&(0,W.jsx)(`span`,{dir:`ltr`,className:`shrink-0 rounded border border-black/[0.08] px-1 py-px font-mono text-[10px] leading-4 text-gray-500 dark:border-white/[0.1] dark:text-dark-600`,children:f})]}),u&&(0,W.jsx)(`div`,{dir:`auto`,className:`text-xs text-gray-500 dark:text-gray-400 truncate`,children:u})]}),t===l&&(0,W.jsx)(y,{className:`h-4 w-4 text-primary-600 dark:text-primary-400 flex-shrink-0`})]})},l)}),e.hidden>0&&(0,W.jsxs)(`button`,{type:`button`,"data-testid":`model-selector-show-all`,onClick:()=>l(e.key),className:d(`flex w-full items-center justify-between gap-2 border-b border-gray-100 bg-white px-3 py-2 text-start text-xs font-medium text-primary-600 dark:border-dark-200 dark:bg-dark-100 dark:text-primary-400`,`hover:bg-gray-50 dark:hover:bg-dark-200`,`focus-visible:relative focus-visible:z-10 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-primary-500/50`),children:[(0,W.jsx)(`span`,{className:`truncate`,children:g(`modelSelector.showAll`,{total:e.total})}),(0,W.jsx)(C,{className:`h-3.5 w-3.5 shrink-0 rtl:rotate-180`})]})]},e.key)):(0,W.jsxs)(`div`,{className:`px-4 py-8 text-center text-gray-500 dark:text-gray-400`,children:[(0,W.jsx)(f,{className:`h-8 w-8 mx-auto mb-2 text-gray-300 dark:text-gray-600`}),(0,W.jsx)(`p`,{className:`text-sm`,children:g(`models.noModelsFound`)})]}),n&&(0,W.jsxs)(`div`,{className:`border-t border-gray-200 dark:border-dark-300`,children:[(0,W.jsx)(`div`,{className:`px-3 py-2 text-xs font-semibold text-gray-500 dark:text-gray-400 bg-gray-100 dark:bg-dark-300`,children:(0,W.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,W.jsx)(D,{className:`h-4 w-4 text-blue-600 dark:text-blue-400`}),g(`modelSelector.actions`)]})}),(0,W.jsx)(`div`,{onMouseDown:e=>{e.preventDefault(),p()},className:`px-3 py-3 cursor-pointer hover:bg-blue-50 dark:hover:bg-blue-900/20 bg-white dark:bg-dark-100`,children:(0,W.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,W.jsx)(h,{className:`h-4 w-4 text-blue-600 dark:text-blue-400`}),(0,W.jsxs)(`div`,{className:`flex-1`,children:[(0,W.jsx)(`div`,{className:`text-sm font-medium text-gray-900 dark:text-gray-100`,children:g(`gallery.generate`)}),(0,W.jsx)(`div`,{className:`text-xs text-gray-500 dark:text-gray-400`,children:g(`gallery.generateDescription`)})]})]})})]})]})}function Ne({sources:e,active:t,onChange:n}){let{t:r}=u(),i=(0,F.useRef)([]),a=e.reduce((e,t)=>e+t.count,0),o=[{key:`all`,label:r(`common.all`),count:a},...e],s=(e,t)=>{let r=getComputedStyle(e.currentTarget).direction===`rtl`,a=r?`ArrowLeft`:`ArrowRight`,s=r?`ArrowRight`:`ArrowLeft`,c=null;e.key===a?c=(t+1)%o.length:e.key===s?c=(t-1+o.length)%o.length:e.key===`Home`?c=0:e.key===`End`&&(c=o.length-1),c!==null&&(e.preventDefault(),n(o[c].key),i.current[c]?.focus())};return(0,W.jsx)(`div`,{role:`radiogroup`,"aria-label":r(`modelSelector.sources`),"data-testid":`model-selector-sources`,className:`flex gap-1.5 overflow-x-auto px-4 pb-3 sm:px-5 [scrollbar-width:none] [&::-webkit-scrollbar]:hidden`,children:o.map((e,r)=>{let a=e.key===t;return(0,W.jsxs)(`button`,{ref:e=>{i.current[r]=e},type:`button`,role:`radio`,"aria-checked":a,tabIndex:a?0:-1,"data-source-key":e.key,onClick:()=>n(e.key),onKeyDown:e=>s(e,r),className:d(`flex shrink-0 items-center gap-1.5 rounded-full border px-3 py-1 text-xs font-medium transition-colors`,`focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary-500/50`,a?`border-transparent bg-gray-900 text-white dark:bg-dark-900 dark:text-dark-25`:`border-black/[0.08] text-gray-600 hover:bg-gray-100 dark:border-white/[0.09] dark:text-dark-600 dark:hover:bg-dark-200`,e.count===0&&!a&&`opacity-50`),children:[(0,W.jsx)(`span`,{className:`whitespace-nowrap`,children:e.label}),(0,W.jsx)(`span`,{className:d(`tabular-nums`,a?`text-white/70 dark:text-dark-25/70`:`text-gray-400 dark:text-dark-500`),children:e.count})]},e.key)})})}function Pe({libraryCategories:e,libraryCategory:t,canInstallModels:n,loadingLibrary:r,filteredLibraryModels:i,pullingModel:a,pullProgress:o,setLibraryCategory:s,isModelInstalled:c,onModelSelect:l,onPullModel:f,onCancelPull:p,onRefreshLibrary:h}){let{t:_}=u();return(0,W.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col overflow-hidden`,children:[(0,W.jsx)(`div`,{className:`px-3 py-2 border-b border-gray-200 dark:border-dark-300 flex-shrink-0`,children:(0,W.jsx)(`div`,{className:`flex flex-wrap gap-1.5`,children:e.map(e=>(0,W.jsx)(`button`,{onMouseDown:t=>{t.preventDefault(),t.stopPropagation(),s(e)},className:d(`px-2.5 py-1 rounded-full text-xs font-medium transition-colors`,t===e?`bg-primary-100 dark:bg-primary-900/30 text-primary-700 dark:text-primary-400`:`bg-gray-100 dark:bg-dark-200 text-gray-600 dark:text-gray-400 hover:bg-gray-200 dark:hover:bg-dark-300`),children:e.charAt(0).toUpperCase()+e.slice(1)},e))})}),(0,W.jsxs)(`div`,{className:`scroll-region min-h-0 flex-1 scrollbar-thin`,children:[!n&&(0,W.jsx)(`div`,{className:`mx-3 mb-1 mt-3 rounded-lg border border-amber-200 bg-amber-500/10 px-3 py-2 text-xs text-ink dark:border-amber-800 dark:bg-amber-900/20`,children:_(`modelSelector.pullRestricted`)}),r?(0,W.jsx)(`div`,{className:`flex items-center justify-center py-12`,children:(0,W.jsx)(m,{className:`h-6 w-6 animate-spin text-gray-400`})}):i.length===0?(0,W.jsxs)(`div`,{className:`px-4 py-8 text-center text-gray-500 dark:text-gray-400`,children:[(0,W.jsx)(g,{className:`h-8 w-8 mx-auto mb-2 text-gray-300 dark:text-gray-600`}),(0,W.jsx)(`p`,{className:`text-sm`,children:_(`models.noModelsFound`)})]}):(0,W.jsx)(`div`,{className:`divide-y divide-gray-100 dark:divide-dark-200`,children:i.map(e=>{let t=c(e.name),r=a===e.name;return(0,W.jsxs)(`div`,{className:d(`px-3 py-3 bg-white dark:bg-dark-100`,t&&`bg-green-50/50 dark:bg-green-900/10`),children:[(0,W.jsxs)(`div`,{className:`flex items-start gap-3`,children:[(0,W.jsx)(`div`,{className:`p-2 rounded-lg bg-blue-100 dark:bg-blue-900/30 flex-shrink-0`,children:(0,W.jsx)(g,{className:`h-4 w-4 text-blue-600 dark:text-blue-400`})}),(0,W.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[(0,W.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,W.jsx)(`h4`,{dir:`ltr`,className:`text-sm font-medium text-gray-900 dark:text-gray-100 truncate`,children:e.name}),t&&(0,W.jsx)(`span`,{className:`px-1.5 py-0.5 rounded text-xs bg-green-100 dark:bg-green-900/30 text-green-700 dark:text-green-400`,children:_(`modelSelector.installed`)}),(e.category===`cloud`||e.tags?.includes(`cloud`))&&(0,W.jsxs)(`span`,{className:`px-1.5 py-0.5 rounded text-xs bg-blue-100 dark:bg-blue-900/30 text-blue-700 dark:text-blue-400 flex items-center gap-1`,children:[(0,W.jsx)(g,{className:`h-3 w-3`}),`Cloud`]})]}),(0,W.jsx)(`p`,{className:`text-xs text-gray-500 dark:text-gray-400 line-clamp-1 mt-0.5`,children:e.description}),(0,W.jsxs)(`div`,{className:`flex items-center gap-2 mt-1.5`,children:[e.sizes.slice(0,3).map(e=>(0,W.jsx)(`span`,{className:`px-1.5 py-0.5 rounded text-xs bg-gray-100 dark:bg-dark-200 text-gray-600 dark:text-gray-400`,children:e},e)),e.pulls&&(0,W.jsxs)(`span`,{className:`text-xs text-gray-400 dark:text-gray-500 flex items-center gap-1`,children:[(0,W.jsx)(v,{className:`h-3 w-3`}),e.pulls]})]})]}),(0,W.jsx)(`div`,{className:`flex-shrink-0`,children:r?(0,W.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,W.jsx)(`div`,{className:`text-xs text-gray-500 w-12 text-right`,children:o?.percent===void 0?`...`:`${o.percent}%`}),(0,W.jsx)(`button`,{onClick:p,className:`p-1.5 rounded-lg text-red-500 hover:bg-red-50 dark:hover:bg-red-900/20`,children:(0,W.jsx)(re,{className:`h-4 w-4`})})]}):t?(0,W.jsx)(`button`,{onClick:()=>l(e.name),className:`px-3 py-1.5 rounded-lg text-xs font-medium bg-green-100 dark:bg-green-900/30 text-green-700 dark:text-green-400 hover:bg-green-200 dark:hover:bg-green-900/50`,children:_(`modelSelector.use`)}):n?(0,W.jsxs)(`button`,{onClick:()=>f(e.name),className:`px-3 py-1.5 rounded-lg text-xs font-medium bg-primary-100 dark:bg-primary-900/30 text-primary-700 dark:text-primary-400 hover:bg-primary-200 dark:hover:bg-primary-900/50`,children:[(0,W.jsx)(v,{className:`h-3 w-3 inline mr-1`}),_(`modelSelector.pull`)]}):(0,W.jsx)(`span`,{className:`rounded bg-amber-500/20 px-2 py-1 text-[11px] font-medium text-ink dark:bg-amber-900/30`,children:_(`modelSelector.adminOnlyPull`)})})]}),r&&o?.percent!==void 0&&(0,W.jsx)(`div`,{className:`mt-2 w-full bg-gray-200 dark:bg-dark-300 rounded-full h-1.5 overflow-hidden`,children:(0,W.jsx)(`div`,{className:`h-1.5 rounded-full bg-primary-500 transition-all duration-300`,style:{width:`${o.percent}%`}})})]},e.name)})})]}),(0,W.jsxs)(`div`,{className:`px-3 py-2 border-t border-gray-200 dark:border-dark-300 flex items-center justify-between flex-shrink-0`,children:[(0,W.jsxs)(`a`,{href:`https://ollama.com/library`,target:`_blank`,rel:`noopener noreferrer`,onMouseDown:e=>e.stopPropagation(),className:`text-xs text-primary-600 dark:text-primary-400 hover:underline flex items-center gap-1`,children:[(0,W.jsx)(x,{className:`h-3 w-3`}),_(`modelManager.huggingface.browseAllLink`)]}),(0,W.jsx)(`button`,{onMouseDown:e=>{e.preventDefault(),e.stopPropagation(),h()},className:`p-1.5 rounded-lg hover:bg-gray-100 dark:hover:bg-dark-200`,children:(0,W.jsx)(te,{className:d(`h-3.5 w-3.5 text-gray-400`,r&&`animate-spin`)})})]})]})}var Fe=o(`components:model-selector`),Ie=({models:e,selectedModel:t,onModelChange:n,currentPersona:r,className:o,disabled:f=!1,compact:m=!1,showImageGen:h=!1,onModelsRefresh:v,getModelValue:y,getModelId:x,getModelLabel:C,getModelTitle:ee,triggerRef:te,triggerTestId:D,selectTestId:ae,ariaLabel:k})=>{let{t:j}=u(),[M,N]=(0,F.useState)(!1),[P,ue]=(0,F.useState)(``),[de,fe]=(0,F.useState)(`installed`),[pe,me]=(0,F.useState)(`all`),I=(0,F.useRef)(null),L=(0,F.useRef)(null),R=(0,F.useRef)(null),z=(0,F.useRef)(null),ye=a(),{user:be,systemInfo:xe}=ce(),B=be?.role===`admin`||xe?.requiresAuth===!1,V=xe?.ollamaEnabled!==!1,H=V?de:`installed`,[U,Te]=(0,F.useState)(`all`),[Ee,Oe]=(0,F.useState)(``),[Ae,je]=(0,F.useState)(`text-generation`),[Ie,Le]=(0,F.useState)(`downloads`),[G,Re]=(0,F.useState)(``),[ze,Be]=(0,F.useState)(null),[Ve,He]=(0,F.useState)({}),[Ue,We]=(0,F.useState)(null),[K,q]=(0,F.useState)(null),[Ge,J]=(0,F.useState)(null),[Ke,Y]=(0,F.useState)(null),qe=[`all`,`general`,`coding`,`reasoning`,`vision`,`embedding`,`cloud`],Je=(0,F.useMemo)(()=>ge(e,{legacy:j(`modelSelector.providerNotRecorded`,`Provider not recorded`),unavailable:j(`modelSelector.unavailableSelections`,`Unavailable selections`),personas:j(`modelSelector.personas`),ollama:`Ollama`,plugins:j(`modelSelector.pluginModels`),agents:j(`modelSelector.agentModels`,`Agents`)}),[e,j]),Ye=e=>{let t=`h-4 w-4 shrink-0 text-gray-500 dark:text-dark-600`;switch(e.kind){case`legacy`:return(0,W.jsx)(O,{className:t});case`unavailable`:return(0,W.jsx)(re,{className:t});case`personas`:return(0,W.jsx)(ne,{className:t});case`agent`:return(0,W.jsx)(b,{className:t});default:return(0,W.jsx)(De,{seed:e.label})}},X=e=>y?.(e)??e.name,Xe=e=>Se(x?.(e)??e.name,e.isPlugin?{prettify:!0}:{}),Ze=e=>{let t=Xe(e);return t.tag?`${t.name} ${t.tag}`:t.name},Qe=l(e=>e.modelMetadata),$e=l(e=>e.personas),Z=e.find(e=>X(e)===t),et=e=>{if(!e.name.startsWith(`persona:`))return;let t=e.name.slice(8),n=t;try{n=decodeURIComponent(t)}catch{}let r=$e[t]??$e[n];if(r?.name)return r.name;if(e.personaName&&e.personaName!==t)return e.personaName},tt=e=>{if(!e.name.startsWith(`persona:`))return;let t=e.name.slice(8),n=t;try{n=decodeURIComponent(t)}catch{}return $e[t]??$e[n]};(0,F.useImperativeHandle)(te,()=>R.current);let Q=(0,F.useCallback)((e=!0)=>{N(!1),ue(``),e&&window.requestAnimationFrame(()=>R.current?.focus())},[]),{data:nt=[],isLoading:rt,refetch:it}=i({queryKey:[`ollama-library-selector`,Ee,U===`cloud`?`cloud`:`all`],queryFn:async()=>{let e=await A.getLibraryModels({search:Ee||void 0,sort:`popular`,category:U===`cloud`?`cloud`:void 0});return e.success&&e.data?e.data:[]},enabled:M&&H===`ollama`}),{data:at=[],isLoading:ot,refetch:st}=i({queryKey:[`hf-models-selector`,Ae,G,Ie],queryFn:async()=>{let e=await oe.getModels({task:Ae,search:G||void 0,sort:Ie,limit:30});return e.success&&e.data?e.data:[]},enabled:M&&H===`huggingface`}),ct=nt.filter(e=>{let t=!P||e.name.toLowerCase().includes(P.toLowerCase())||e.description.toLowerCase().includes(P.toLowerCase()),n=U===`all`||e.category===U;return t&&n}),lt=(0,F.useCallback)(async e=>{let[t,n]=e.split(`/`);if(t&&n){We(e);try{let r=await oe.getGgufFiles(t,n);r.success&&r.data&&He(t=>({...t,[e]:r.data}))}catch(e){Fe.error(`Failed to load GGUF files:`,e)}finally{We(null)}}},[]),ut=(0,F.useCallback)(e=>{ze===e?Be(null):(Be(e),Ve[e]||lt(e))},[ze,Ve,lt]),dt=(0,F.useCallback)((e,t)=>{if(!B){S.error(j(`modelSelector.pullRestricted`));return}if(!K){q(e),J({status:`starting`});try{let n=A.pullModelStream(e,e=>{J(e)},()=>{J(null),q(null),Y(null),S.success(j(`modelDownload.success`,{name:t})),v?.()},e=>{J(null),q(null),Y(null),S.error(j(`modelDownload.failed`,{error:e}))});Y(()=>n)}catch{J(null),q(null),S.error(j(`modelDownload.startFailed`))}}},[B,v,K,j]);(0,F.useEffect)(()=>{let e=setTimeout(()=>{H===`huggingface`?Re(P):H===`ollama`&&Oe(P)},300);return()=>clearTimeout(e)},[P,H]),(0,F.useEffect)(()=>{if(!M)return;let e=e=>{if(e.key===`Escape`){e.preventDefault(),Q();return}if(e.key===`Tab`&&L.current){let t=Array.from(L.current.querySelectorAll(`button:not([disabled]), input:not([disabled]), [tabindex]:not([tabindex="-1"])`)).filter(e=>e.offsetParent!==null),n=t[0],r=t[t.length-1];if(!n||!r)return;e.shiftKey&&document.activeElement===n?(e.preventDefault(),r.focus()):!e.shiftKey&&document.activeElement===r&&(e.preventDefault(),n.focus())}};return document.addEventListener(`keydown`,e),()=>document.removeEventListener(`keydown`,e)},[Q,M]),(0,F.useEffect)(()=>{M&&z.current&&z.current.focus()},[M]);let ft=async t=>{let r=e.find(e=>X(e)===t)??e.find(e=>!e.isPlugin&&!e.isPersona&&e.name===t),i=r?X(r):t,a=r?.name??t;if(Q(),!V){n({target:{value:i}});return}try{let e=await A.listRunningModels();if(e.success&&e.data){let t=e.data;t.length>0&&(r?.isPlugin!==!0&&t.some(e=>e.name===a||a.startsWith(`persona:`))||await A.unloadAllModels())}}catch(e){Fe.warn(`Failed to unload models before switch:`,e)}n({target:{value:i}})},pt=async e=>{if(!B){S.error(j(`modelSelector.pullRestricted`));return}if(!K){q(e),J({status:`starting`});try{let t=A.pullModelStream(e,e=>{J(e)},()=>{J(null),q(null),Y(null),S.success(j(`modelDownload.success`,{name:e})),v?.()},e=>{J(null),q(null),Y(null),S.error(j(`modelDownload.failed`,{error:e}))});Y(()=>t)}catch{J(null),q(null),S.error(j(`modelDownload.startFailed`))}}},mt=()=>{Ke&&(Ke(),Y(null),q(null),J(null),S.success(j(`modelDownload.cancelled`)))},ht=t=>e.some(e=>s(e)&&(e.name===t||e.name.startsWith(t+`:`))),gt=(e,t=`sm`)=>{let n=t===`md`?`h-6 w-6 rounded-md`:`h-4 w-4 rounded`,r=Qe[c(e)]?.avatar;if(r&&!e.isPersona)return(0,W.jsx)(`img`,{src:r,alt:``,className:d(n,`shrink-0 rounded-full object-cover`)});if(e.isPersona||e.isLegacySelection){let t=tt(e);if(t)return(0,W.jsx)(`img`,{src:se(t,64),alt:``,className:d(n,`shrink-0 object-cover`)})}if(e.isLegacySelection||e.isPersona||e.isAgent){let r=e.isLegacySelection?O:e.isPersona?ne:b,i=(0,W.jsx)(r,{className:`h-4 w-4 shrink-0 text-gray-500 dark:text-dark-600`});return t===`md`?(0,W.jsx)(`span`,{className:d(n,`flex shrink-0 items-center justify-center bg-gray-100 dark:bg-dark-200`),children:i}):i}let i=Xe(e),a=e.isPlugin?i.vendor||e.pluginName||e.pluginId||i.name:i.vendor||i.name;return(0,W.jsx)(De,{seed:a,size:t})},$=e=>{let t=Qe[c(e)]?.label;if(t&&!e.isPersona)return t;if(C)return C(e);if(e.isLegacySelection)return`${et(e)??e.name} (${j(`modelSelector.legacyProvider`,`provider not recorded`)})`;if(e.isPersona)return et(e)||e.personaName||e.name;if(e.isAgent)return e.isUnavailable?`${e.agentName||e.name} (${j(`modelSelector.unavailable`,`unavailable`)})`:e.agentName||e.name;let n=Ze(e);return e.isUnavailable?`${n} (${j(`modelSelector.unavailable`,`unavailable`)})`:n},_t=e=>e.isLegacySelection?e.isUnavailable?j(`modelSelector.providerUnavailable`,`provider unavailable`):j(`modelSelector.reselectProvider`,`reselect a provider to pin this model`):e.isPersona?`via ${e.model}`:e.isPlugin?e.isUnavailable?`via ${e.pluginName||e.pluginId} · ${j(`modelSelector.providerUnavailable`,`provider unavailable`)}`:`via ${e.pluginName}`:e.isUnavailable?j(`modelSelector.providerUnavailable`,`provider unavailable`):null,vt=e=>e.kind===`plugin`||e.kind===`ollama`,yt=e=>{let t=Xe(e);if(e.isPlugin||t.vendor||t.tag)return t;let n=t.name.lastIndexOf(`:`);if(n<=0)return t;let r=t.name.slice(n+1);return{name:t.name.slice(0,n),...r&&r!==`latest`?{tag:r}:{}}},bt=e=>!!Qe[c(e)]?.label,xt=(e,t)=>C||bt(e)?$(e):vt(t)?yt(e).name:t.kind===`agent`?he(e,t.label).title:$(e),St=(e,t)=>!vt(t)||C||bt(e)?null:yt(e).tag??null,Ct=(e,t)=>{if(t.kind===`agent`){let n=he(e,t.label);return n.isDefault?j(`modelSelector.defaultModel`):n.provider?`via ${n.provider}`:null}if(!vt(t))return _t(e);let n=yt(e),r=e.details??{},i=/(^|[-:])cloud$/i.test(e.name),a=[n.vendor,e.isPlugin?void 0:r.parameter_size,e.isPlugin||r.quantization_level===n.tag?void 0:r.quantization_level,e.contextLength?j(`modelSelector.contextSize`,{size:Ce(e.contextLength),defaultValue:`{{size}} context`}):void 0,e.isPlugin||i?void 0:we(e.size)].filter(e=>!!e);return a.length>0?a.join(` · `):null},wt=e=>X(e)===t,Tt=Je.map(e=>({source:e,matches:e.models.filter(t=>_e(t,e,P,$(t)))})),Et=Je.length>1,Dt=Et&&Je.some(e=>e.key===pe)?pe:`all`,Ot=Dt===`all`,kt=Tt.filter(({source:e})=>Ot||e.key===Dt).map(({source:e,matches:t})=>{let n=Ot&&Et?ve(t,wt):{visible:t,hidden:0};return{key:e.key,kind:e.kind,label:e.label,icon:Ye(e),models:n.visible,total:t.length,hidden:n.hidden,showHeader:Ot}}).filter(e=>e.models.length>0),At=Tt.map(({source:e,matches:t})=>({key:e.key,label:e.label,count:t.length}));return(0,W.jsxs)(`div`,{className:d(`relative min-w-0`,o),ref:I,children:[(0,W.jsxs)(`button`,{ref:R,"data-testid":D,type:`button`,onClick:()=>!f&&N(!M),disabled:f,"aria-haspopup":`dialog`,"aria-expanded":M,"aria-label":k&&Z?`${k}: ${$(Z)}`:k,className:d(m?`flex h-9 w-full min-w-0 items-center justify-between gap-2 px-2.5 text-start`:`w-full flex items-center justify-between gap-2 px-3 py-2.5 text-start`,`rounded-xl border border-line bg-surface-subtle text-sm text-ink hover:bg-hover-solid`,`transition-colors duration-150 focus:outline-none focus:ring-2 focus:ring-primary-500/20 focus:border-primary-500/40`,f?`opacity-50 cursor-not-allowed`:`cursor-pointer`),title:m?Z?ee?.(Z)??$(Z):j(`modelSelector.selectModel`):void 0,children:[(()=>{if(!Z)return m?(0,W.jsxs)(`div`,{className:`flex min-w-0 flex-1 items-center gap-2`,children:[(0,W.jsx)(E,{className:`h-4 w-4 shrink-0`}),(0,W.jsx)(`span`,{className:`truncate text-xs font-medium text-ink-subtle`,children:j(`modelSelector.selectModel`)})]}):j(`modelSelector.selectModel`);if(m){let e=$(Z);return(0,W.jsxs)(`div`,{className:`flex min-w-0 flex-1 items-center gap-2`,children:[(0,W.jsx)(`span`,{className:`shrink-0`,children:gt(Z)}),(0,W.jsx)(`span`,{dir:Z.isPersona?`auto`:`ltr`,className:`truncate text-xs font-medium text-ink`,children:e})]})}let e=$(Z),t=_t(Z);return(0,W.jsxs)(`div`,{className:`flex items-center gap-2 min-w-0`,children:[gt(Z),(0,W.jsxs)(`div`,{className:`flex flex-col min-w-0`,children:[(0,W.jsx)(`span`,{dir:Z.isPersona?`auto`:`ltr`,className:`text-sm font-medium truncate`,children:e}),t&&(0,W.jsx)(`span`,{dir:`auto`,className:`text-xs text-gray-500 dark:text-gray-400 truncate`,children:t})]}),Z.isPersona&&r&&(0,W.jsxs)(`div`,{className:`flex items-center gap-1 ms-auto`,children:[(0,W.jsx)(O,{className:`h-3 w-3 text-gray-500 dark:text-dark-600`}),r.embedding_model&&(0,W.jsx)(_,{className:`h-3 w-3 text-gray-400 dark:text-dark-500`})]})]})})(),(0,W.jsx)(w,{className:d(m?`h-3 w-3`:`h-4 w-4`,`shrink-0 text-ink-subtle transition-transform duration-150 motion-reduce:transition-none`,M&&`rotate-180`)})]}),M&&(0,le.createPortal)((0,W.jsxs)(`div`,{className:`fixed inset-0 z-[999999] flex items-center justify-center p-3 sm:p-6`,children:[(0,W.jsx)(`div`,{className:`absolute inset-0 bg-gray-950/55 backdrop-blur-md`,onClick:()=>Q()}),(0,W.jsxs)(`div`,{ref:L,role:`dialog`,"aria-modal":`true`,"aria-label":j(`modelSelector.selectModel`),className:d(`relative flex w-full max-w-xl flex-col overflow-hidden bg-white/[0.98] dark:bg-dark-25/[0.98]`,`h-[min(620px,88vh)] rounded-[1.5rem] border border-black/[0.08] dark:border-white/[0.09]`,`shadow-[0_30px_100px_rgba(0,0,0,0.28)] backdrop-blur-xl animate-scale-in`),onClick:e=>e.stopPropagation(),children:[(0,W.jsxs)(`div`,{className:`flex-shrink-0`,children:[(0,W.jsxs)(`div`,{className:`flex items-center justify-between px-4 pb-2 pt-4 sm:px-5 sm:pt-5`,children:[(0,W.jsx)(`h2`,{className:`text-lg font-medium tracking-[-0.025em] text-gray-950 dark:text-dark-950 rtl:tracking-normal`,children:j(`modelSelector.selectModel`)}),(0,W.jsx)(`button`,{type:`button`,onClick:()=>Q(),className:`flex h-9 w-9 items-center justify-center rounded-full text-gray-400 transition-colors hover:bg-gray-100 hover:text-gray-950 dark:text-dark-500 dark:hover:bg-dark-200 dark:hover:text-dark-950`,title:j(`common.close`),children:(0,W.jsx)(re,{className:`h-4 w-4`})})]}),(0,W.jsx)(`div`,{className:`px-4 pb-3 sm:px-5`,children:(0,W.jsxs)(`div`,{className:`relative`,children:[(0,W.jsx)(p,{className:`absolute start-3 top-1/2 -translate-y-1/2 h-4 w-4 text-gray-400`}),(0,W.jsx)(`input`,{ref:z,type:`text`,placeholder:j(H===`installed`?V?`modelSelector.searchInstalled`:`modelSelector.searchModels`:H===`ollama`?`modelSelector.searchOllama`:`modelSelector.searchHuggingFace`),value:P,onChange:e=>ue(e.target.value),onKeyDown:e=>{if(H!==`installed`)return;let t=L.current?.querySelector(`[data-testid="model-selector-option"]`);e.key===`ArrowDown`&&t?(e.preventDefault(),t.focus()):e.key===`Enter`&&P.trim()&&t&&(e.preventDefault(),t.click())},className:d(`w-full rounded-xl border border-black/[0.07] bg-gray-100/70 py-2.5 ps-10 pe-4 text-sm dark:border-white/[0.07] dark:bg-dark-200/70`,`focus:outline-none focus:ring-2 focus:ring-primary-500/20`,`text-gray-900 dark:text-dark-900 placeholder:text-gray-400 dark:placeholder:text-dark-500`)})]})}),V&&(0,W.jsxs)(`div`,{className:`mx-4 mb-3 flex rounded-xl bg-gray-100/70 p-1 dark:bg-dark-200/70 sm:mx-5`,children:[(0,W.jsxs)(`button`,{onClick:()=>{fe(`installed`)},className:d(`flex-1 rounded-lg px-2 py-2 text-xs font-medium transition-colors sm:px-4`,H===`installed`?`bg-white text-gray-950 shadow-sm dark:bg-dark-300 dark:text-dark-950`:`text-gray-500 hover:text-gray-800 dark:text-dark-500 dark:hover:text-dark-800`),"aria-pressed":H===`installed`,children:[(0,W.jsx)(T,{className:`h-4 w-4 inline me-1.5`}),j(`modelSelector.installed`)]}),(0,W.jsxs)(`button`,{onClick:()=>{fe(`ollama`)},className:d(`flex-1 rounded-lg px-2 py-2 text-xs font-medium transition-colors sm:px-4`,H===`ollama`?`bg-white text-gray-950 shadow-sm dark:bg-dark-300 dark:text-dark-950`:`text-gray-500 hover:text-gray-800 dark:text-dark-500 dark:hover:text-dark-800`),"aria-pressed":H===`ollama`,children:[(0,W.jsx)(g,{className:`h-4 w-4 inline me-1.5`}),`Ollama`]}),(0,W.jsxs)(`button`,{onClick:()=>{fe(`huggingface`)},className:d(`flex-1 rounded-lg px-2 py-2 text-xs font-medium transition-colors sm:px-4`,H===`huggingface`?`bg-white text-gray-950 shadow-sm dark:bg-dark-300 dark:text-dark-950`:`text-gray-500 hover:text-gray-800 dark:text-dark-500 dark:hover:text-dark-800`),"aria-pressed":H===`huggingface`,children:[(0,W.jsx)(ie,{className:`h-4 w-4 inline me-1.5`}),`HuggingFace`]})]}),H===`installed`&&Et&&(0,W.jsx)(Ne,{sources:At,active:Dt,onChange:me})]}),H===`installed`&&(0,W.jsx)(Me,{groups:kt,selectedModel:t,showImageGen:h&&Ot,getModelValue:X,getModelIcon:e=>gt(e,`md`),getModelLabel:xt,getModelTag:St,getModelSubLabel:Ct,onExitTop:()=>z.current?.focus(),onModelSelect:ft,onShowAll:e=>{me(e),z.current?.focus()},onOpenGallery:()=>{Q(!1),ye(`/gallery`)}},Dt),H===`ollama`&&(0,W.jsx)(Pe,{libraryCategories:qe,libraryCategory:U,canInstallModels:B,loadingLibrary:rt,filteredLibraryModels:ct,pullingModel:K,pullProgress:Ge,setLibraryCategory:Te,isModelInstalled:ht,onModelSelect:ft,onPullModel:pt,onCancelPull:mt,onRefreshLibrary:()=>{it()}}),H===`huggingface`&&(0,W.jsx)(ke,{hfTask:Ae,hfSort:Ie,canInstallModels:B,loadingHf:ot,hfModels:at,expandedHfModel:ze,hfGgufFiles:Ve,loadingGguf:Ue,pullingModel:K,pullProgress:Ge,setHfTask:je,setHfSort:Le,onToggleHfModel:ut,onPullHfGguf:dt,onCancelPull:mt,onRefreshHfModels:()=>{st()}})]})]}),document.body),(0,W.jsx)(`select`,{"data-testid":ae,"aria-label":k,"aria-hidden":`true`,dir:`ltr`,value:t,onChange:n,className:`hidden`,tabIndex:-1,children:e.map(e=>(0,W.jsx)(`option`,{value:X(e),children:$(e)},`${e.isLegacySelection?`legacy`:e.isPersona?`persona`:e.isPlugin?`plugin`:`ollama`}:${e.pluginId||``}:${X(e)}`))})]})},Le=({value:e,inheritedValue:t,onChange:n})=>{let{t:r}=u(),[i,a]=(0,F.useState)(!1),o=(0,F.useRef)(null),s=e??t,c=M(s),l=N(s),f=N(e),p=t==null?void 0:N(t);return(0,F.useEffect)(()=>{if(!i)return;let e=e=>{o.current?.contains(e.target)||a(!1)},t=e=>{e.key===`Escape`&&a(!1)};return window.addEventListener(`mousedown`,e),window.addEventListener(`keydown`,t),()=>{window.removeEventListener(`mousedown`,e),window.removeEventListener(`keydown`,t)}},[i]),(0,W.jsxs)(`div`,{ref:o,className:`relative flex-shrink-0`,children:[(0,W.jsxs)(ae,{type:`button`,variant:`ghost`,size:`sm`,onClick:()=>a(e=>!e),className:d(`h-9 rounded-full p-0 flex items-center justify-center gap-1 touch-manipulation transition-colors duration-150`,c?`w-auto px-2.5`:`w-9`,`text-ink-muted hover:bg-interactive-hover hover:text-ink`,c&&`bg-primary-50 text-primary-600 dark:bg-primary-900/25 dark:text-primary-400`),title:c?r(`chat.input.thinkingOn`,{level:r(`settings.generation.thinkingLevels.${l}`)}):r(`chat.input.thinkingOff`),"aria-haspopup":`menu`,"aria-expanded":i,"aria-pressed":c,children:[(0,W.jsx)(O,{className:`h-4 w-4`}),c&&(0,W.jsx)(`span`,{className:`text-[11px] font-medium`,children:r(`settings.generation.thinkingLevels.${l}`)})]}),i&&(0,W.jsxs)(`div`,{role:`menu`,className:`absolute bottom-full end-0 z-30 mb-2 w-48 rounded-2xl border border-black/[0.08] bg-surface/95 p-1.5 shadow-[0_16px_48px_rgba(15,23,42,0.16)] backdrop-blur-xl animate-scale-in dark:border-white/[0.09] dark:bg-dark-100/95`,children:[(0,W.jsx)(`p`,{className:`mb-1 px-2 pt-1 text-[11px] font-medium text-gray-500 dark:text-dark-600`,children:r(`chat.controls.thinking`)}),P.map(e=>{let t=e===f;return(0,W.jsxs)(`button`,{type:`button`,role:`menuitemradio`,"aria-checked":t,onClick:()=>{n(j(e)),a(!1)},className:d(`flex w-full items-center justify-between gap-2 rounded-xl px-2.5 py-2 text-start text-[13px] text-gray-700 hover:bg-gray-100 dark:text-dark-800 dark:hover:bg-dark-200`,t&&`text-primary-600 dark:text-primary-400`),children:[(0,W.jsx)(`span`,{className:`truncate`,children:e==="default"&&p!==void 0?r(`settings.generation.thinkingLevels.defaultWith`,{level:r(`settings.generation.thinkingLevels.${p}`)}):r(`settings.generation.thinkingLevels.${e}`)}),t&&(0,W.jsx)(y,{className:`h-3.5 w-3.5 shrink-0`})]},e)})]})]})},G=o(`hooks:dictation`),Re=()=>{if(typeof window>`u`)return;let e=window;return e.SpeechRecognition||e.webkitSpeechRecognition},ze=[{mimeType:`audio/webm;codecs=opus`,format:`webm`}],Be=300,Ve=.25,He=e=>`${encodeURIComponent(e.plugin)}:${encodeURIComponent(e.model)}`;function Ue(e){if(typeof MediaRecorder>`u`)return;let t=new Set((e.config?.formats||[]).map(e=>e.toLowerCase()));return ze.find(e=>(t.size===0||t.has(e.format))&&(typeof MediaRecorder.isTypeSupported!=`function`||MediaRecorder.isTypeSupported(e.mimeType)))?.mimeType}function We({onStart:e,onText:t,ownerKey:n}){let{t:r,i18n:i}=u(),[a,o]=(0,F.useState)(`idle`),[s,c]=(0,F.useState)([]),l=(0,F.useRef)(null),d=(0,F.useRef)(null),f=(0,F.useRef)(null),p=(0,F.useRef)(null),m=(0,F.useRef)(null),h=(0,F.useRef)(0),g=(0,F.useRef)(`idle`),_=(0,F.useRef)(void 0),v=(0,F.useRef)(e),y=(0,F.useRef)(t);(0,F.useEffect)(()=>{v.current=e,y.current=t},[e,t]),(0,F.useEffect)(()=>{let e=!1;return k.getModels().then(t=>{!e&&t.success&&t.data&&c(t.data)}).catch(()=>{e||c([])}),()=>{e=!0}},[]);let b=(0,F.useMemo)(()=>typeof window<`u`&&window.isSecureContext&&typeof navigator<`u`&&!!navigator.mediaDevices&&!!Re(),[]),x=typeof window<`u`&&window.isSecureContext&&typeof navigator<`u`&&!!navigator.mediaDevices?.getUserMedia,C=(0,F.useMemo)(()=>[...b?[{key:`browser`,kind:`browser`}]:[],...x?s.filter(e=>!!Ue(e)).map(e=>({key:He(e),kind:`provider`,model:e})):[]],[b,x,s]),[ee,te]=(0,F.useState)(``),w=(0,F.useMemo)(()=>C.find(e=>e.key===ee)??C[0],[ee,C]),T=w?.kind===`provider`?w.model:void 0,ne=C.length>0,E=(0,F.useCallback)(()=>{m.current!==null&&(window.clearTimeout(m.current),m.current=null)},[]),D=(0,F.useCallback)(e=>{g.current=e,o(e)},[]),O=(0,F.useCallback)(()=>{h.current+=1,E(),l.current?.stop(),l.current=null,p.current?.abort(),p.current=null;let e=d.current;d.current=null,e&&(e.ondataavailable=null,e.onerror=null,e.onstop=null,e.state===`recording`&&e.stop()),f.current?.getTracks().forEach(e=>e.stop()),f.current=null,D(`idle`)},[E,D]);return(0,F.useEffect)(()=>(_.current=n,O),[O,n]),{supported:ne,phase:a,toggle:(0,F.useCallback)(async()=>{let e=g.current;if(e===`starting`||e===`transcribing`){O();return}if(e===`recording`){d.current?.state===`recording`?(D(`transcribing`),d.current.stop()):O();return}if(T){let e=h.current+1;h.current=e;let t=_.current;v.current(),D(`starting`);try{let n=await navigator.mediaDevices.getUserMedia({audio:!0});if(h.current!==e||_.current!==t){n.getTracks().forEach(e=>e.stop());return}f.current=n;let a=Ue(T),o=a?new MediaRecorder(n,{mimeType:a}):new MediaRecorder(n),s=[];o.ondataavailable=e=>{e.data.size>0&&s.push(e.data)},o.onerror=()=>{n.getTracks().forEach(e=>e.stop()),E(),h.current===e&&(d.current=null,f.current=null,D(`idle`),S.error(r(`voiceMode.transcriptionFailed`)))},o.onstop=()=>{if(n.getTracks().forEach(e=>e.stop()),E(),h.current!==e||_.current!==t)return;if(d.current=null,f.current=null,s.length===0){D(`idle`);return}let a=new Blob(s,{type:o.mimeType||s[0].type||`audio/webm`}),c=new AbortController;p.current=c,D(`transcribing`),k.transcribe(a,T,{language:i.language,signal:c.signal,fallbackMessage:r(`voiceMode.transcriptionFailed`)}).then(n=>{h.current!==e||_.current!==t||c.signal.aborted||y.current(n.text.trim())}).catch(e=>{c.signal.aborted||(G.error(`Provider transcription failed:`,e),S.error(e instanceof Error?e.message:r(`voiceMode.transcriptionFailed`)))}).finally(()=>{p.current===c&&h.current===e&&(p.current=null,D(`idle`))})},d.current=o,o.start(250);let c=T.config?.max_duration_seconds,l=typeof c==`number`&&c>0?Math.min(c,Be):Be;m.current=window.setTimeout(()=>{h.current===e&&o.state===`recording`&&o.stop()},Math.max(.1,l-Ve)*1e3),D(`recording`);return}catch(t){if(h.current!==e)return;G.error(`Failed to start provider dictation:`,t),E(),f.current?.getTracks().forEach(e=>e.stop()),f.current=null,d.current=null,D(`idle`),S.error(r(`voiceMode.transcriptionFailed`));return}}let t=Re();if(!t)return;let n=h.current+1;h.current=n;let a=_.current,o=new t;o.lang=i.language,o.continuous=!0,o.interimResults=!0,v.current(),o.onresult=e=>{if(h.current!==n||_.current!==a||l.current!==o)return;let t=``;for(let n=0;n<e.results.length;n++)t+=e.results[n][0]?.transcript??``;y.current(t.trim())},o.onend=()=>{h.current===n&&(l.current=null,D(`idle`))},o.onerror=()=>{h.current===n&&(l.current=null,D(`idle`))},l.current=o,D(`recording`);try{o.start()}catch(e){G.error(`Failed to start dictation:`,e),l.current=null,D(`idle`)}},[O,E,i.language,T,D,r]),cancel:O,sources:C,activeSourceKey:w?.key??``,setSourceKey:te,providerModel:T}}export{Le as n,Ie as r,We as t};
@@ -1 +1 @@
1
- import{r as e}from"./rolldown-runtime-hePW80VL.js";import{i as t,t as n}from"./react-vendor-wiHys0m2.js";var r=e(t(),1),i=n(),a=r.createContext(void 0),o=e=>{let t=r.useContext(a);if(e)return e;if(!t)throw Error(`No QueryClient set, use QueryClientProvider to set one`);return t},s=({client:e,children:t})=>(r.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),(0,i.jsx)(a.Provider,{value:e,children:t})),c={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},l=new class{#e=c;setTimeoutProvider(e){this.#e=e}setTimeout(e,t){return this.#e.setTimeout(e,t)}clearTimeout(e){this.#e.clearTimeout(e)}setInterval(e,t){return this.#e.setInterval(e,t)}clearInterval(e){this.#e.clearInterval(e)}};function u(e){setTimeout(e,0)}var d=typeof window>`u`||`Deno`in globalThis;function f(){}function p(e,t){return typeof e==`function`?e(t):e}function m(e){return typeof e==`number`&&e>=0&&e!==1/0}function h(e,t){return Math.max(e+(t||0)-Date.now(),0)}function g(e,t){return typeof e==`function`?e(t):e}function _(e,t){let{type:n=`all`,exact:r,fetchStatus:i,predicate:a,queryKey:o,stale:s}=e;if(o){if(r){if(t.queryHash!==y(o,t.options))return!1}else if(!x(t.queryKey,o))return!1}if(n!==`all`){let e=t.isActive();if(n===`active`&&!e||n===`inactive`&&e)return!1}return!(typeof s==`boolean`&&t.isStale()!==s||i&&i!==t.state.fetchStatus||a&&!a(t))}function v(e,t){let{exact:n,status:r,predicate:i,mutationKey:a}=e;if(a){if(!t.options.mutationKey)return!1;if(n){if(b(t.options.mutationKey)!==b(a))return!1}else if(!x(t.options.mutationKey,a))return!1}return!(r&&t.state.status!==r||i&&!i(t))}function y(e,t){return(t?.queryKeyHashFn||b)(e)}function b(e){return JSON.stringify(e,(e,t)=>T(t)?Object.keys(t).sort().reduce((e,n)=>(e[n]=t[n],e),{}):t)}function x(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(e&&t&&typeof e==`object`&&typeof t==`object`){if(Array.isArray(e)&&Array.isArray(t)){if(t.length>e.length)return!1;for(let n=0;n<t.length;n++)if(!x(e[n],t[n]))return!1;return!0}let n=Object.keys(t);for(let r of n)if(!x(e[r],t[r]))return!1;return!0}return!1}var ee=Object.prototype.hasOwnProperty;function S(e,t,n=0){if(e===t)return e;if(n>500)return t;let r=w(e)&&w(t);if(!r&&!(T(e)&&T(t)))return t;let i=(r?e:Object.keys(e)).length,a=r?t:Object.keys(t),o=a.length,s=r?Array(o):{},c=0;for(let l=0;l<o;l++){let o=r?l:a[l],u=e[o],d=t[o];if(u===d){s[o]=u,(r?l<i:ee.call(e,o))&&c++;continue}if(u===null||d===null||typeof u!=`object`||typeof d!=`object`){s[o]=d;continue}let f=S(u,d,n+1);s[o]=f,f===u&&c++}return i===o&&c===i?e:s}function C(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(let n in e)if(e[n]!==t[n])return!1;return!0}function w(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function T(e){if(!E(e))return!1;let t=Object.getPrototypeOf(e),n=t?.constructor;if(n===void 0)return!0;if(typeof n!=`function`)return!1;let r=n.prototype;return!(!E(r)||!r.hasOwnProperty(`isPrototypeOf`)||t!==Object.prototype)}function E(e){return Object.prototype.toString.call(e)===`[object Object]`}function te(e){return new Promise(t=>{l.setTimeout(t,e)})}function D(e,t,n){return typeof n.structuralSharing==`function`?n.structuralSharing(e,t):n.structuralSharing===!1?t:S(e,t)}function ne(e,t,n=0){let r=[...e,t];return n&&r.length>n?r.slice(1):r}function re(e,t,n=0){let r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var O=Symbol();function k(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===O?()=>Promise.reject(Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function A(e,t){return typeof e==`function`?e(...t):!!e}function ie(e,t,n){let r=!1,i;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(i??=t(),r?i:(r=!0,i.aborted?n():i.addEventListener(`abort`,n,{once:!0}),i))}),e}var ae=()=>d,j=()=>ae(),M=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},N=new class extends M{#e;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<`u`&&window.addEventListener){let t=()=>e();return window.addEventListener(`visibilitychange`,t,!1),()=>{window.removeEventListener(`visibilitychange`,t)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(e=>{typeof e==`boolean`?this.setFocused(e):this.onFocus()})}setFocused(e){this.#e!==e&&(this.#e=e,this.onFocus())}onFocus(){let e=this.isFocused();this.listeners.forEach(t=>{t(e)})}isFocused(){return typeof this.#e==`boolean`?this.#e:globalThis.document?.visibilityState!==`hidden`}},oe=u;function se(){let e=[],t=0,n=e=>{e()},r=e=>{e()},i=oe,a=r=>{t?e.push(r):i(()=>{n(r)})},o=()=>{let t=e;e=[],t.length&&i(()=>{r(()=>{t.forEach(e=>{n(e)})})})};return{batch:e=>{let n;t++;try{n=e()}finally{t--,t||o()}return n},batchCalls:e=>(...t)=>{a(()=>{e(...t)})},schedule:a,setNotifyFunction:e=>{n=e},setBatchNotifyFunction:e=>{r=e},setScheduler:e=>{i=e}}}var P=se(),F=new class extends M{#e=!0;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<`u`&&window.addEventListener){let t=()=>e(!0),n=()=>e(!1);return window.addEventListener(`online`,t,!1),window.addEventListener(`offline`,n,!1),()=>{window.removeEventListener(`online`,t),window.removeEventListener(`offline`,n)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(this.setOnline.bind(this))}setOnline(e){this.#e!==e&&(this.#e=e,this.listeners.forEach(t=>{t(e)}))}isOnline(){return this.#e}};function ce(e){return Math.min(1e3*2**e,3e4)}function I(e){return(e??`online`)!==`online`||F.isOnline()}var L=class extends Error{constructor(e){super(`CancelledError`),this.revert=e?.revert,this.silent=e?.silent}};function R(e){let t=!1,n=0,r,i=`pending`,a,o,s=new Promise((e,t)=>{a=e,o=t});s.catch(f);let c=()=>i!==`pending`,l=t=>{if(!c()){let n=new L(t);g(n),e.onCancel?.(n)}},u=()=>{t=!0},d=()=>{t=!1},p=()=>N.isFocused()&&(e.networkMode===`always`||F.isOnline())&&e.canRun(),m=()=>I(e.networkMode)&&e.canRun(),h=e=>{c()||(r?.(),i=`resolved`,a(e))},g=e=>{c()||(r?.(),i=`rejected`,o(e))},_=()=>new Promise(t=>{r=e=>{(c()||p())&&t(e)},e.onPause?.()}).then(()=>{r=void 0,c()||e.onContinue?.()}),v=()=>{if(c())return;let r,i=n===0?e.initialPromise:void 0;try{r=i??e.fn()}catch(e){r=Promise.reject(e)}Promise.resolve(r).then(h).catch(r=>{if(c())return;let i=e.retry??(j()?0:3),a=e.retryDelay??ce,o=typeof a==`function`?a(n,r):a,s=i===!0||typeof i==`number`&&n<i||typeof i==`function`&&i(n,r);if(t||!s){g(r);return}n++,e.onFail?.(n,r),te(o).then(()=>p()?void 0:_()).then(()=>{t?g(r):v()})})};return{promise:s,status:()=>i,cancel:l,continue:()=>(r?.(),s),cancelRetry:u,continueRetry:d,canStart:m,start:()=>(m()?v():_().then(v),s)}}var z=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),m(this.gcTime)&&(this.#e=l.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(j()?1/0:3e5))}clearGcTimeout(){this.#e!==void 0&&(l.clearTimeout(this.#e),this.#e=void 0)}};function le(e){return{onFetch:(t,n)=>{let r=t.options,i=t.fetchOptions?.meta?.fetchMore?.direction,a=t.state.data?.pages||[],o=t.state.data?.pageParams||[],s={pages:[],pageParams:[]},c=0,l=async()=>{let n=!1,l=e=>{ie(e,()=>t.signal,()=>n=!0)},u=k(t.options,t.fetchOptions),d=async(e,r,i)=>{if(n)return Promise.reject(t.signal.reason);if(r==null&&e.pages.length)return Promise.resolve(e);let a=(()=>{let e={client:t.client,queryKey:t.queryKey,pageParam:r,direction:i?`backward`:`forward`,meta:t.options.meta};return l(e),e})(),o=await u(a),{maxPages:s}=t.options,c=i?re:ne;return{pages:c(e.pages,o,s),pageParams:c(e.pageParams,r,s)}};if(i&&a.length){let e=i===`backward`,t=e?V:B,n={pages:a,pageParams:o};s=await d(n,t(r,n),e)}else{let t=e??a.length;do{let e=c===0?o[0]??r.initialPageParam:B(r,s);if(c>0&&e==null)break;s=await d(s,e),c++}while(c<t)}return s};t.fetchFn=t.options.persister?()=>t.options.persister?.(l,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n):l}}}function B(e,{pages:t,pageParams:n}){let r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function V(e,{pages:t,pageParams:n}){return t.length>0?e.getPreviousPageParam?.(t[0],t,n[0],n):void 0}function ue(e,t){return t?B(e,t)!=null:!1}function H(e,t){return!t||!e.getPreviousPageParam?!1:V(e,t)!=null}var de=class extends z{#e;#t;#n;#r;#i;#a;#o;#s;constructor(e){super(),this.#s=!1,this.#o=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#i=e.client,this.#r=this.#i.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#t=G(this.options),this.state=e.state??this.#t,this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return this.#e}get promise(){return this.#a?.promise}setOptions(e){if(this.options={...this.#o,...e},e?._type&&(this.#e=e._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){let e=G(this.options);e.data!==void 0&&(this.setState(W(e.data,e.dataUpdatedAt)),this.#t=e)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus===`idle`&&this.#r.remove(this)}setData(e,t){let n=D(this.state.data,e,this.options);return this.#c({data:n,type:`success`,dataUpdatedAt:t?.updatedAt,manual:t?.manual}),n}setState(e){this.#c({type:`setState`,state:e})}cancel(e){let t=this.#a?.promise;return this.#a?.cancel(e),t?t.then(f).catch(f):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return this.#t}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(e=>g(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===O||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0&&this.observers.some(e=>g(e.options.staleTime,this)===`static`)}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(e=0){return this.state.data===void 0?!0:e===`static`?!1:this.state.isInvalidated?!0:!h(this.state.dataUpdatedAt,e)}onFocus(){this.observers.find(e=>e.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#a?.continue()}onOnline(){this.observers.find(e=>e.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#a?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#r.notify({type:`observerAdded`,query:this,observer:e}))}removeObserver(e){let t=this.observers.indexOf(e);t!==-1&&(this.observers.splice(t,1),this.observers.length||(this.#a&&(this.#s||this.state.fetchStatus===`paused`&&this.state.status===`pending`?this.#a.cancel({revert:!0}):this.#a.cancelRetry()),this.scheduleGc()),this.#r.notify({type:`observerRemoved`,query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.#c({type:`invalidate`})}async fetch(e,t){if(this.state.fetchStatus!==`idle`&&this.#a?.status()!==`rejected`){if(this.state.data!==void 0&&t?.cancelRefetch)this.cancel({silent:!0});else if(this.#a)return this.#a.continueRetry(),this.#a.promise}if(e&&this.setOptions(e),!this.options.queryFn){let e=this.observers.find(e=>e.options.queryFn);e&&this.setOptions(e.options)}let n=new AbortController,r=e=>{Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(this.#s=!0,n.signal)})},i=()=>{let e=k(this.options,t),n=(()=>{let e={client:this.#i,queryKey:this.queryKey,meta:this.meta};return r(e),e})();return this.#s=!1,this.options.persister?this.options.persister(e,n,this):e(n)},a=(()=>{let e={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:this.#i,state:this.state,fetchFn:i};return r(e),e})();(this.#e===`infinite`?le(this.options.pages):this.options.behavior)?.onFetch(a,this),this.#n=this.state,(this.state.fetchStatus===`idle`||this.state.fetchMeta!==a.fetchOptions?.meta)&&this.#c({type:`fetch`,meta:a.fetchOptions?.meta});let o=this.#a=R({initialPromise:t?.initialPromise,fn:a.fetchFn,onCancel:e=>{e instanceof L&&e.revert&&this.setState({...this.#n,fetchStatus:`idle`}),n.abort()},onFail:(e,t)=>{this.#c({type:`failed`,failureCount:e,error:t})},onPause:()=>{this.#c({type:`pause`})},onContinue:()=>{this.#c({type:`continue`})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode,canRun:()=>!0});try{let e=await o.start();if(e===void 0)throw Error(`${this.queryHash} data is undefined`);return this.setData(e),this.#r.config.onSuccess?.(e,this),this.#r.config.onSettled?.(e,this.state.error,this),e}catch(e){if(e instanceof L){if(e.silent)return this.#a.promise;if(e.revert){if(this.state.data===void 0)throw e;return this.state.data}}throw this.#c({type:`error`,error:e}),this.#r.config.onError?.(e,this),this.#r.config.onSettled?.(this.state.data,e,this),e}finally{this.#a===o&&(this.#a=void 0),this.scheduleGc()}}#c(e){let t=t=>{switch(e.type){case`failed`:return{...t,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case`pause`:return{...t,fetchStatus:`paused`};case`continue`:return{...t,fetchStatus:`fetching`};case`fetch`:return{...t,...U(t.data,this.options),fetchMeta:e.meta??null};case`success`:let n={...t,...W(e.data,e.dataUpdatedAt),dataUpdateCount:t.dataUpdateCount+1,...!e.manual&&{fetchStatus:`idle`,fetchFailureCount:0,fetchFailureReason:null}};return this.#n=e.manual?n:void 0,n;case`error`:let r=e.error;return{...t,error:r,errorUpdateCount:t.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:t.fetchFailureCount+1,fetchFailureReason:r,fetchStatus:`idle`,status:`error`,isInvalidated:!0};case`invalidate`:return{...t,isInvalidated:!0};case`setState`:return{...t,...e.state}}};this.state=t(this.state),P.batch(()=>{this.observers.slice().forEach(e=>{e.onQueryUpdate()}),this.#r.notify({query:this,type:`updated`,action:e})})}};function U(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:I(t.networkMode)?`fetching`:`paused`,...e===void 0&&{error:null,status:`pending`}}}function W(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:`success`}}function G(e){let t=typeof e.initialData==`function`?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt==`function`?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?`success`:`pending`,fetchStatus:`idle`}}var K=class extends M{#e;#t=void 0;#n=void 0;#r=void 0;#i;#a;#o;#s;#c;#l;#u;#d;#f;#p=new Set;constructor(e,t){super(),this.options=t,this.#e=e,this.#o=null,this.bindMethods(),this.setOptions(t)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#t.addObserver(this),q(this.#t,this.options)?this.#m():this.updateResult(),this.#y())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return J(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return J(this.#t,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#b(),this.#x(),this.#t.removeObserver(this)}setOptions(e){let t=this.options,n=this.#t;if(this.options=this.#e.defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!=`boolean`&&typeof this.options.enabled!=`function`&&typeof g(this.options.enabled,this.#t)!=`boolean`)throw Error(`Expected enabled to be a boolean or a callback that returns a boolean`);this.#S(),this.#t.setOptions(this.options),t._defaulted&&!C(this.options,t)&&this.#e.getQueryCache().notify({type:`observerOptionsUpdated`,query:this.#t,observer:this});let r=this.hasListeners();r&&Y(this.#t,n,this.options,t)&&this.#m(),this.updateResult(),r&&(this.#t!==n||g(this.options.enabled,this.#t)!==g(t.enabled,this.#t)||g(this.options.staleTime,this.#t)!==g(t.staleTime,this.#t))&&this.#g();let i=this.#_();r&&(this.#t!==n||g(this.options.enabled,this.#t)!==g(t.enabled,this.#t)||i!==this.#f)&&this.#v(i)}getOptimisticResult(e){let t=this.#e.getQueryCache().build(this.#e,e),n=this.createResult(t,e);return C(this.getCurrentResult(),n)||(this.#r=n,this.#a=this.options,this.#i=this.#t.state),n}getCurrentResult(){return this.#r}trackResult(e,t){return new Proxy(e,{get:(e,n)=>(this.trackProp(n),t?.(n),Reflect.get(e,n))})}trackProp(e){this.#p.add(e)}getCurrentQuery(){return this.#t}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){let t=this.#e.defaultQueryOptions(e),n=this.#e.getQueryCache().build(this.#e,t),r=()=>{},i,a=new Promise(e=>{i=e,r=this.#e.getQueryCache().subscribe(i=>{i.type===`updated`&&i.query.queryHash===n.queryHash&&n.state.data!==void 0&&(r(),e(this.createResult(n,t)))})});return Promise.race([n.fetch().then(()=>{let e=this.createResult(n,t);return i?.(e),e}).finally(()=>{r()}),a])}fetch(e){return this.#m({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#r))}#m(e){this.#S();let t=this.#t.fetch(this.options,e);return e?.throwOnError||(t=t.catch(f)),t}#h(e){return!j()&&g(this.options.enabled,this.#t)!==!1&&m(e)}#g(){this.#b();let e=g(this.options.staleTime,this.#t);if(this.#r.isStale||!this.#h(e))return;let t=h(this.#r.dataUpdatedAt,e)+1;this.#u=l.setTimeout(()=>{this.#r.isStale||this.updateResult()},t)}#_(){return g(this.options.refetchInterval,this.#t)??!1}#v(e){this.#x(),this.#f=e,this.#f!==0&&this.#h(this.#f)&&(this.#d=l.setInterval(()=>{(this.options.refetchIntervalInBackground||N.isFocused())&&this.#m()},this.#f))}#y(){this.#g(),this.#v(this.#_())}#b(){this.#u!==void 0&&(l.clearTimeout(this.#u),this.#u=void 0)}#x(){this.#d!==void 0&&(l.clearInterval(this.#d),this.#d=void 0)}createResult(e,t){let n=this.#t,r=this.options,i=this.#r,a=this.#i,o=this.#a,s=e===n?this.#n:e.state,{state:c}=e,l={...c},u=!1,d;if(t._optimisticResults){let i=this.hasListeners(),a=!i&&q(e,t),o=i&&Y(e,n,t,r);(a||o)&&(l={...l,...U(c.data,e.options)}),t._optimisticResults===`isRestoring`&&(l.fetchStatus=`idle`)}let{error:f,errorUpdatedAt:p,status:m}=l;d=l.data;let h=!1;if(t.placeholderData!==void 0&&d===void 0&&m===`pending`){let e;i?.isPlaceholderData&&t.placeholderData===o?.placeholderData?(e=i.data,h=!0):e=typeof t.placeholderData==`function`?t.placeholderData(this.#l?.state.data,this.#l):t.placeholderData,e!==void 0&&(m=`success`,d=D(i?.data,e,t),u=!0)}if(t.select&&d!==void 0&&!h){if(i&&d===a?.data&&t.select===this.#s)d=this.#c;else try{this.#s=t.select,d=t.select(d),d=D(i?.data,d,t),this.#c=d,this.#o=null}catch(e){this.#o=e}}else d===void 0&&(this.#o=null);this.#o&&(f=this.#o,d=this.#c,p=Date.now(),m=`error`,u=!1);let _=l.fetchStatus===`fetching`,v=m===`pending`,y=m===`error`,b=v&&_,x=d!==void 0;return{status:m,fetchStatus:l.fetchStatus,isPending:v,isSuccess:m===`success`,isError:y,isInitialLoading:b,isLoading:b,data:d,dataUpdatedAt:l.dataUpdatedAt,error:f,errorUpdatedAt:p,failureCount:l.fetchFailureCount,failureReason:l.fetchFailureReason,errorUpdateCount:l.errorUpdateCount,isFetched:e.isFetched(),isFetchedAfterMount:l.dataUpdateCount>s.dataUpdateCount||l.errorUpdateCount>s.errorUpdateCount,isFetching:_,isRefetching:_&&!v,isLoadingError:y&&!x,isPaused:l.fetchStatus===`paused`,isPlaceholderData:u,isRefetchError:y&&x,isStale:X(e,t),refetch:this.refetch,isEnabled:g(t.enabled,e)!==!1}}updateResult(){let e=this.#r,t=this.createResult(this.#t,this.options);if(this.#i=this.#t.state,this.#a=this.options,this.#i.data!==void 0&&(this.#l=this.#t),C(t,e))return;this.#r=t;let n=(()=>{if(!e)return!0;let{notifyOnChangeProps:t}=this.options,n=typeof t==`function`?t():t;if(n===`all`||!n&&!this.#p.size)return!0;let r=new Set(n??this.#p);return this.options.throwOnError&&r.add(`error`),Object.keys(this.#r).some(t=>{let n=t;return this.#r[n]!==e[n]&&r.has(n)})})();P.batch(()=>{n&&this.listeners.forEach(e=>{e(this.#r)}),this.#e.getQueryCache().notify({query:this.#t,type:`observerResultsUpdated`})})}#S(){let e=this.#e.getQueryCache().build(this.#e,this.options);if(e===this.#t)return;let t=this.#t;this.#t=e,this.#n=e.state,this.hasListeners()&&(t?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#y()}};function fe(e,t){return g(t.enabled,e)!==!1&&e.state.data===void 0&&(e.state.status!==`error`||g(t.retryOnMount,e)!==!1)}function q(e,t){return fe(e,t)||e.state.data!==void 0&&J(e,t,t.refetchOnMount)}function J(e,t,n){if(g(t.enabled,e)!==!1&&g(t.staleTime,e)!==`static`){let r=g(n,e);return r===`always`||r!==!1&&X(e,t)}return!1}function Y(e,t,n,r){return(e!==t||g(r.enabled,e)===!1)&&(!n.suspense||e.state.status!==`error`)&&X(e,n)}function X(e,t){return g(t.enabled,e)!==!1&&e.isStaleByTime(g(t.staleTime,e))}var Z=r.createContext(!1),pe=()=>r.useContext(Z);Z.Provider;function me(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var he=r.createContext(me()),ge=()=>r.useContext(he),_e=(e,t,n)=>{let r=n?.state.error&&typeof e.throwOnError==`function`?A(e.throwOnError,[n.state.error,n]):e.throwOnError;(e.suspense||r)&&(t.isReset()||(e.retryOnMount=!1))},Q=e=>{r.useEffect(()=>{e.clearReset()},[e])},ve=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:i})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(i&&e.data===void 0||A(n,[e.error,r])),ye=e=>{if(e.suspense){let t=1e3,n=e=>e===`static`?e:Math.max(e??t,t),r=e.staleTime;e.staleTime=typeof r==`function`?(...e)=>n(r(...e)):n(r),typeof e.gcTime==`number`&&(e.gcTime=Math.max(e.gcTime,t))}},be=(e,t)=>e?.suspense&&t.isPending,xe=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function $(e,t,n){let i=pe(),a=ge(),s=o(n),c=s.defaultQueryOptions(e),l=s.getQueryCache().get(c.queryHash),u=e.subscribed!==!1;c._optimisticResults=i?`isRestoring`:u?`optimistic`:void 0,ye(c),_e(c,a,l),Q(a);let[d]=r.useState(()=>new t(s,c)),p=d.getOptimisticResult(c),m=!i&&u;if(r.useSyncExternalStore(r.useCallback(e=>{let t=m?d.subscribe(P.batchCalls(e)):f;return d.updateResult(),t},[d,m]),()=>d.getCurrentResult(),()=>d.getCurrentResult()),r.useEffect(()=>{d.setOptions(c)},[c,d]),be(c,p))throw xe(c,d,a);if(ve({result:p,errorResetBoundary:a,throwOnError:c.throwOnError,query:l,suspense:c.suspense}))throw p.error;return c.notifyOnChangeProps?p:d.trackResult(p)}function Se(e,t){return $(e,K,t)}export{o as C,s as S,_,ue as a,g as b,R as c,N as d,M as f,v as g,y as h,de as i,F as l,b as m,$ as n,H as o,p,K as r,z as s,Se as t,P as u,f as v,O as x,x as y};
1
+ import{r as e}from"./rolldown-runtime-hePW80VL.js";import{i as t,t as n}from"./react-vendor-CR5VJ85Q.js";var r=e(t(),1),i=n(),a=r.createContext(void 0),o=e=>{let t=r.useContext(a);if(e)return e;if(!t)throw Error(`No QueryClient set, use QueryClientProvider to set one`);return t},s=({client:e,children:t})=>(r.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),(0,i.jsx)(a.Provider,{value:e,children:t})),c={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},l=new class{#e=c;setTimeoutProvider(e){this.#e=e}setTimeout(e,t){return this.#e.setTimeout(e,t)}clearTimeout(e){this.#e.clearTimeout(e)}setInterval(e,t){return this.#e.setInterval(e,t)}clearInterval(e){this.#e.clearInterval(e)}};function u(e){setTimeout(e,0)}var d=typeof window>`u`||`Deno`in globalThis;function f(){}function p(e,t){return typeof e==`function`?e(t):e}function m(e){return typeof e==`number`&&e>=0&&e!==1/0}function h(e,t){return Math.max(e+(t||0)-Date.now(),0)}function g(e,t){return typeof e==`function`?e(t):e}function _(e,t){let{type:n=`all`,exact:r,fetchStatus:i,predicate:a,queryKey:o,stale:s}=e;if(o){if(r){if(t.queryHash!==y(o,t.options))return!1}else if(!x(t.queryKey,o))return!1}if(n!==`all`){let e=t.isActive();if(n===`active`&&!e||n===`inactive`&&e)return!1}return!(typeof s==`boolean`&&t.isStale()!==s||i&&i!==t.state.fetchStatus||a&&!a(t))}function v(e,t){let{exact:n,status:r,predicate:i,mutationKey:a}=e;if(a){if(!t.options.mutationKey)return!1;if(n){if(b(t.options.mutationKey)!==b(a))return!1}else if(!x(t.options.mutationKey,a))return!1}return!(r&&t.state.status!==r||i&&!i(t))}function y(e,t){return(t?.queryKeyHashFn||b)(e)}function b(e){return JSON.stringify(e,(e,t)=>T(t)?Object.keys(t).sort().reduce((e,n)=>(e[n]=t[n],e),{}):t)}function x(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(e&&t&&typeof e==`object`&&typeof t==`object`){if(Array.isArray(e)&&Array.isArray(t)){if(t.length>e.length)return!1;for(let n=0;n<t.length;n++)if(!x(e[n],t[n]))return!1;return!0}let n=Object.keys(t);for(let r of n)if(!x(e[r],t[r]))return!1;return!0}return!1}var ee=Object.prototype.hasOwnProperty;function S(e,t,n=0){if(e===t)return e;if(n>500)return t;let r=w(e)&&w(t);if(!r&&!(T(e)&&T(t)))return t;let i=(r?e:Object.keys(e)).length,a=r?t:Object.keys(t),o=a.length,s=r?Array(o):{},c=0;for(let l=0;l<o;l++){let o=r?l:a[l],u=e[o],d=t[o];if(u===d){s[o]=u,(r?l<i:ee.call(e,o))&&c++;continue}if(u===null||d===null||typeof u!=`object`||typeof d!=`object`){s[o]=d;continue}let f=S(u,d,n+1);s[o]=f,f===u&&c++}return i===o&&c===i?e:s}function C(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(let n in e)if(e[n]!==t[n])return!1;return!0}function w(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function T(e){if(!E(e))return!1;let t=Object.getPrototypeOf(e),n=t?.constructor;if(n===void 0)return!0;if(typeof n!=`function`)return!1;let r=n.prototype;return!(!E(r)||!r.hasOwnProperty(`isPrototypeOf`)||t!==Object.prototype)}function E(e){return Object.prototype.toString.call(e)===`[object Object]`}function te(e){return new Promise(t=>{l.setTimeout(t,e)})}function D(e,t,n){return typeof n.structuralSharing==`function`?n.structuralSharing(e,t):n.structuralSharing===!1?t:S(e,t)}function ne(e,t,n=0){let r=[...e,t];return n&&r.length>n?r.slice(1):r}function re(e,t,n=0){let r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var O=Symbol();function k(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===O?()=>Promise.reject(Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function A(e,t){return typeof e==`function`?e(...t):!!e}function ie(e,t,n){let r=!1,i;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(i??=t(),r?i:(r=!0,i.aborted?n():i.addEventListener(`abort`,n,{once:!0}),i))}),e}var ae=()=>d,j=()=>ae(),M=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},N=new class extends M{#e;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<`u`&&window.addEventListener){let t=()=>e();return window.addEventListener(`visibilitychange`,t,!1),()=>{window.removeEventListener(`visibilitychange`,t)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(e=>{typeof e==`boolean`?this.setFocused(e):this.onFocus()})}setFocused(e){this.#e!==e&&(this.#e=e,this.onFocus())}onFocus(){let e=this.isFocused();this.listeners.forEach(t=>{t(e)})}isFocused(){return typeof this.#e==`boolean`?this.#e:globalThis.document?.visibilityState!==`hidden`}},oe=u;function se(){let e=[],t=0,n=e=>{e()},r=e=>{e()},i=oe,a=r=>{t?e.push(r):i(()=>{n(r)})},o=()=>{let t=e;e=[],t.length&&i(()=>{r(()=>{t.forEach(e=>{n(e)})})})};return{batch:e=>{let n;t++;try{n=e()}finally{t--,t||o()}return n},batchCalls:e=>(...t)=>{a(()=>{e(...t)})},schedule:a,setNotifyFunction:e=>{n=e},setBatchNotifyFunction:e=>{r=e},setScheduler:e=>{i=e}}}var P=se(),F=new class extends M{#e=!0;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<`u`&&window.addEventListener){let t=()=>e(!0),n=()=>e(!1);return window.addEventListener(`online`,t,!1),window.addEventListener(`offline`,n,!1),()=>{window.removeEventListener(`online`,t),window.removeEventListener(`offline`,n)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(this.setOnline.bind(this))}setOnline(e){this.#e!==e&&(this.#e=e,this.listeners.forEach(t=>{t(e)}))}isOnline(){return this.#e}};function ce(e){return Math.min(1e3*2**e,3e4)}function I(e){return(e??`online`)!==`online`||F.isOnline()}var L=class extends Error{constructor(e){super(`CancelledError`),this.revert=e?.revert,this.silent=e?.silent}};function R(e){let t=!1,n=0,r,i=`pending`,a,o,s=new Promise((e,t)=>{a=e,o=t});s.catch(f);let c=()=>i!==`pending`,l=t=>{if(!c()){let n=new L(t);g(n),e.onCancel?.(n)}},u=()=>{t=!0},d=()=>{t=!1},p=()=>N.isFocused()&&(e.networkMode===`always`||F.isOnline())&&e.canRun(),m=()=>I(e.networkMode)&&e.canRun(),h=e=>{c()||(r?.(),i=`resolved`,a(e))},g=e=>{c()||(r?.(),i=`rejected`,o(e))},_=()=>new Promise(t=>{r=e=>{(c()||p())&&t(e)},e.onPause?.()}).then(()=>{r=void 0,c()||e.onContinue?.()}),v=()=>{if(c())return;let r,i=n===0?e.initialPromise:void 0;try{r=i??e.fn()}catch(e){r=Promise.reject(e)}Promise.resolve(r).then(h).catch(r=>{if(c())return;let i=e.retry??(j()?0:3),a=e.retryDelay??ce,o=typeof a==`function`?a(n,r):a,s=i===!0||typeof i==`number`&&n<i||typeof i==`function`&&i(n,r);if(t||!s){g(r);return}n++,e.onFail?.(n,r),te(o).then(()=>p()?void 0:_()).then(()=>{t?g(r):v()})})};return{promise:s,status:()=>i,cancel:l,continue:()=>(r?.(),s),cancelRetry:u,continueRetry:d,canStart:m,start:()=>(m()?v():_().then(v),s)}}var z=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),m(this.gcTime)&&(this.#e=l.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(j()?1/0:3e5))}clearGcTimeout(){this.#e!==void 0&&(l.clearTimeout(this.#e),this.#e=void 0)}};function le(e){return{onFetch:(t,n)=>{let r=t.options,i=t.fetchOptions?.meta?.fetchMore?.direction,a=t.state.data?.pages||[],o=t.state.data?.pageParams||[],s={pages:[],pageParams:[]},c=0,l=async()=>{let n=!1,l=e=>{ie(e,()=>t.signal,()=>n=!0)},u=k(t.options,t.fetchOptions),d=async(e,r,i)=>{if(n)return Promise.reject(t.signal.reason);if(r==null&&e.pages.length)return Promise.resolve(e);let a=(()=>{let e={client:t.client,queryKey:t.queryKey,pageParam:r,direction:i?`backward`:`forward`,meta:t.options.meta};return l(e),e})(),o=await u(a),{maxPages:s}=t.options,c=i?re:ne;return{pages:c(e.pages,o,s),pageParams:c(e.pageParams,r,s)}};if(i&&a.length){let e=i===`backward`,t=e?V:B,n={pages:a,pageParams:o};s=await d(n,t(r,n),e)}else{let t=e??a.length;do{let e=c===0?o[0]??r.initialPageParam:B(r,s);if(c>0&&e==null)break;s=await d(s,e),c++}while(c<t)}return s};t.fetchFn=t.options.persister?()=>t.options.persister?.(l,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n):l}}}function B(e,{pages:t,pageParams:n}){let r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function V(e,{pages:t,pageParams:n}){return t.length>0?e.getPreviousPageParam?.(t[0],t,n[0],n):void 0}function ue(e,t){return t?B(e,t)!=null:!1}function H(e,t){return!t||!e.getPreviousPageParam?!1:V(e,t)!=null}var de=class extends z{#e;#t;#n;#r;#i;#a;#o;#s;constructor(e){super(),this.#s=!1,this.#o=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#i=e.client,this.#r=this.#i.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#t=G(this.options),this.state=e.state??this.#t,this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return this.#e}get promise(){return this.#a?.promise}setOptions(e){if(this.options={...this.#o,...e},e?._type&&(this.#e=e._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){let e=G(this.options);e.data!==void 0&&(this.setState(W(e.data,e.dataUpdatedAt)),this.#t=e)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus===`idle`&&this.#r.remove(this)}setData(e,t){let n=D(this.state.data,e,this.options);return this.#c({data:n,type:`success`,dataUpdatedAt:t?.updatedAt,manual:t?.manual}),n}setState(e){this.#c({type:`setState`,state:e})}cancel(e){let t=this.#a?.promise;return this.#a?.cancel(e),t?t.then(f).catch(f):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return this.#t}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(e=>g(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===O||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0&&this.observers.some(e=>g(e.options.staleTime,this)===`static`)}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(e=0){return this.state.data===void 0?!0:e===`static`?!1:this.state.isInvalidated?!0:!h(this.state.dataUpdatedAt,e)}onFocus(){this.observers.find(e=>e.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#a?.continue()}onOnline(){this.observers.find(e=>e.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#a?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#r.notify({type:`observerAdded`,query:this,observer:e}))}removeObserver(e){let t=this.observers.indexOf(e);t!==-1&&(this.observers.splice(t,1),this.observers.length||(this.#a&&(this.#s||this.state.fetchStatus===`paused`&&this.state.status===`pending`?this.#a.cancel({revert:!0}):this.#a.cancelRetry()),this.scheduleGc()),this.#r.notify({type:`observerRemoved`,query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.#c({type:`invalidate`})}async fetch(e,t){if(this.state.fetchStatus!==`idle`&&this.#a?.status()!==`rejected`){if(this.state.data!==void 0&&t?.cancelRefetch)this.cancel({silent:!0});else if(this.#a)return this.#a.continueRetry(),this.#a.promise}if(e&&this.setOptions(e),!this.options.queryFn){let e=this.observers.find(e=>e.options.queryFn);e&&this.setOptions(e.options)}let n=new AbortController,r=e=>{Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(this.#s=!0,n.signal)})},i=()=>{let e=k(this.options,t),n=(()=>{let e={client:this.#i,queryKey:this.queryKey,meta:this.meta};return r(e),e})();return this.#s=!1,this.options.persister?this.options.persister(e,n,this):e(n)},a=(()=>{let e={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:this.#i,state:this.state,fetchFn:i};return r(e),e})();(this.#e===`infinite`?le(this.options.pages):this.options.behavior)?.onFetch(a,this),this.#n=this.state,(this.state.fetchStatus===`idle`||this.state.fetchMeta!==a.fetchOptions?.meta)&&this.#c({type:`fetch`,meta:a.fetchOptions?.meta});let o=this.#a=R({initialPromise:t?.initialPromise,fn:a.fetchFn,onCancel:e=>{e instanceof L&&e.revert&&this.setState({...this.#n,fetchStatus:`idle`}),n.abort()},onFail:(e,t)=>{this.#c({type:`failed`,failureCount:e,error:t})},onPause:()=>{this.#c({type:`pause`})},onContinue:()=>{this.#c({type:`continue`})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode,canRun:()=>!0});try{let e=await o.start();if(e===void 0)throw Error(`${this.queryHash} data is undefined`);return this.setData(e),this.#r.config.onSuccess?.(e,this),this.#r.config.onSettled?.(e,this.state.error,this),e}catch(e){if(e instanceof L){if(e.silent)return this.#a.promise;if(e.revert){if(this.state.data===void 0)throw e;return this.state.data}}throw this.#c({type:`error`,error:e}),this.#r.config.onError?.(e,this),this.#r.config.onSettled?.(this.state.data,e,this),e}finally{this.#a===o&&(this.#a=void 0),this.scheduleGc()}}#c(e){let t=t=>{switch(e.type){case`failed`:return{...t,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case`pause`:return{...t,fetchStatus:`paused`};case`continue`:return{...t,fetchStatus:`fetching`};case`fetch`:return{...t,...U(t.data,this.options),fetchMeta:e.meta??null};case`success`:let n={...t,...W(e.data,e.dataUpdatedAt),dataUpdateCount:t.dataUpdateCount+1,...!e.manual&&{fetchStatus:`idle`,fetchFailureCount:0,fetchFailureReason:null}};return this.#n=e.manual?n:void 0,n;case`error`:let r=e.error;return{...t,error:r,errorUpdateCount:t.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:t.fetchFailureCount+1,fetchFailureReason:r,fetchStatus:`idle`,status:`error`,isInvalidated:!0};case`invalidate`:return{...t,isInvalidated:!0};case`setState`:return{...t,...e.state}}};this.state=t(this.state),P.batch(()=>{this.observers.slice().forEach(e=>{e.onQueryUpdate()}),this.#r.notify({query:this,type:`updated`,action:e})})}};function U(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:I(t.networkMode)?`fetching`:`paused`,...e===void 0&&{error:null,status:`pending`}}}function W(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:`success`}}function G(e){let t=typeof e.initialData==`function`?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt==`function`?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?`success`:`pending`,fetchStatus:`idle`}}var K=class extends M{#e;#t=void 0;#n=void 0;#r=void 0;#i;#a;#o;#s;#c;#l;#u;#d;#f;#p=new Set;constructor(e,t){super(),this.options=t,this.#e=e,this.#o=null,this.bindMethods(),this.setOptions(t)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#t.addObserver(this),q(this.#t,this.options)?this.#m():this.updateResult(),this.#y())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return J(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return J(this.#t,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#b(),this.#x(),this.#t.removeObserver(this)}setOptions(e){let t=this.options,n=this.#t;if(this.options=this.#e.defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!=`boolean`&&typeof this.options.enabled!=`function`&&typeof g(this.options.enabled,this.#t)!=`boolean`)throw Error(`Expected enabled to be a boolean or a callback that returns a boolean`);this.#S(),this.#t.setOptions(this.options),t._defaulted&&!C(this.options,t)&&this.#e.getQueryCache().notify({type:`observerOptionsUpdated`,query:this.#t,observer:this});let r=this.hasListeners();r&&Y(this.#t,n,this.options,t)&&this.#m(),this.updateResult(),r&&(this.#t!==n||g(this.options.enabled,this.#t)!==g(t.enabled,this.#t)||g(this.options.staleTime,this.#t)!==g(t.staleTime,this.#t))&&this.#g();let i=this.#_();r&&(this.#t!==n||g(this.options.enabled,this.#t)!==g(t.enabled,this.#t)||i!==this.#f)&&this.#v(i)}getOptimisticResult(e){let t=this.#e.getQueryCache().build(this.#e,e),n=this.createResult(t,e);return C(this.getCurrentResult(),n)||(this.#r=n,this.#a=this.options,this.#i=this.#t.state),n}getCurrentResult(){return this.#r}trackResult(e,t){return new Proxy(e,{get:(e,n)=>(this.trackProp(n),t?.(n),Reflect.get(e,n))})}trackProp(e){this.#p.add(e)}getCurrentQuery(){return this.#t}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){let t=this.#e.defaultQueryOptions(e),n=this.#e.getQueryCache().build(this.#e,t),r=()=>{},i,a=new Promise(e=>{i=e,r=this.#e.getQueryCache().subscribe(i=>{i.type===`updated`&&i.query.queryHash===n.queryHash&&n.state.data!==void 0&&(r(),e(this.createResult(n,t)))})});return Promise.race([n.fetch().then(()=>{let e=this.createResult(n,t);return i?.(e),e}).finally(()=>{r()}),a])}fetch(e){return this.#m({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#r))}#m(e){this.#S();let t=this.#t.fetch(this.options,e);return e?.throwOnError||(t=t.catch(f)),t}#h(e){return!j()&&g(this.options.enabled,this.#t)!==!1&&m(e)}#g(){this.#b();let e=g(this.options.staleTime,this.#t);if(this.#r.isStale||!this.#h(e))return;let t=h(this.#r.dataUpdatedAt,e)+1;this.#u=l.setTimeout(()=>{this.#r.isStale||this.updateResult()},t)}#_(){return g(this.options.refetchInterval,this.#t)??!1}#v(e){this.#x(),this.#f=e,this.#f!==0&&this.#h(this.#f)&&(this.#d=l.setInterval(()=>{(this.options.refetchIntervalInBackground||N.isFocused())&&this.#m()},this.#f))}#y(){this.#g(),this.#v(this.#_())}#b(){this.#u!==void 0&&(l.clearTimeout(this.#u),this.#u=void 0)}#x(){this.#d!==void 0&&(l.clearInterval(this.#d),this.#d=void 0)}createResult(e,t){let n=this.#t,r=this.options,i=this.#r,a=this.#i,o=this.#a,s=e===n?this.#n:e.state,{state:c}=e,l={...c},u=!1,d;if(t._optimisticResults){let i=this.hasListeners(),a=!i&&q(e,t),o=i&&Y(e,n,t,r);(a||o)&&(l={...l,...U(c.data,e.options)}),t._optimisticResults===`isRestoring`&&(l.fetchStatus=`idle`)}let{error:f,errorUpdatedAt:p,status:m}=l;d=l.data;let h=!1;if(t.placeholderData!==void 0&&d===void 0&&m===`pending`){let e;i?.isPlaceholderData&&t.placeholderData===o?.placeholderData?(e=i.data,h=!0):e=typeof t.placeholderData==`function`?t.placeholderData(this.#l?.state.data,this.#l):t.placeholderData,e!==void 0&&(m=`success`,d=D(i?.data,e,t),u=!0)}if(t.select&&d!==void 0&&!h){if(i&&d===a?.data&&t.select===this.#s)d=this.#c;else try{this.#s=t.select,d=t.select(d),d=D(i?.data,d,t),this.#c=d,this.#o=null}catch(e){this.#o=e}}else d===void 0&&(this.#o=null);this.#o&&(f=this.#o,d=this.#c,p=Date.now(),m=`error`,u=!1);let _=l.fetchStatus===`fetching`,v=m===`pending`,y=m===`error`,b=v&&_,x=d!==void 0;return{status:m,fetchStatus:l.fetchStatus,isPending:v,isSuccess:m===`success`,isError:y,isInitialLoading:b,isLoading:b,data:d,dataUpdatedAt:l.dataUpdatedAt,error:f,errorUpdatedAt:p,failureCount:l.fetchFailureCount,failureReason:l.fetchFailureReason,errorUpdateCount:l.errorUpdateCount,isFetched:e.isFetched(),isFetchedAfterMount:l.dataUpdateCount>s.dataUpdateCount||l.errorUpdateCount>s.errorUpdateCount,isFetching:_,isRefetching:_&&!v,isLoadingError:y&&!x,isPaused:l.fetchStatus===`paused`,isPlaceholderData:u,isRefetchError:y&&x,isStale:X(e,t),refetch:this.refetch,isEnabled:g(t.enabled,e)!==!1}}updateResult(){let e=this.#r,t=this.createResult(this.#t,this.options);if(this.#i=this.#t.state,this.#a=this.options,this.#i.data!==void 0&&(this.#l=this.#t),C(t,e))return;this.#r=t;let n=(()=>{if(!e)return!0;let{notifyOnChangeProps:t}=this.options,n=typeof t==`function`?t():t;if(n===`all`||!n&&!this.#p.size)return!0;let r=new Set(n??this.#p);return this.options.throwOnError&&r.add(`error`),Object.keys(this.#r).some(t=>{let n=t;return this.#r[n]!==e[n]&&r.has(n)})})();P.batch(()=>{n&&this.listeners.forEach(e=>{e(this.#r)}),this.#e.getQueryCache().notify({query:this.#t,type:`observerResultsUpdated`})})}#S(){let e=this.#e.getQueryCache().build(this.#e,this.options);if(e===this.#t)return;let t=this.#t;this.#t=e,this.#n=e.state,this.hasListeners()&&(t?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#y()}};function fe(e,t){return g(t.enabled,e)!==!1&&e.state.data===void 0&&(e.state.status!==`error`||g(t.retryOnMount,e)!==!1)}function q(e,t){return fe(e,t)||e.state.data!==void 0&&J(e,t,t.refetchOnMount)}function J(e,t,n){if(g(t.enabled,e)!==!1&&g(t.staleTime,e)!==`static`){let r=g(n,e);return r===`always`||r!==!1&&X(e,t)}return!1}function Y(e,t,n,r){return(e!==t||g(r.enabled,e)===!1)&&(!n.suspense||e.state.status!==`error`)&&X(e,n)}function X(e,t){return g(t.enabled,e)!==!1&&e.isStaleByTime(g(t.staleTime,e))}var Z=r.createContext(!1),pe=()=>r.useContext(Z);Z.Provider;function me(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var he=r.createContext(me()),ge=()=>r.useContext(he),_e=(e,t,n)=>{let r=n?.state.error&&typeof e.throwOnError==`function`?A(e.throwOnError,[n.state.error,n]):e.throwOnError;(e.suspense||r)&&(t.isReset()||(e.retryOnMount=!1))},Q=e=>{r.useEffect(()=>{e.clearReset()},[e])},ve=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:i})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(i&&e.data===void 0||A(n,[e.error,r])),ye=e=>{if(e.suspense){let t=1e3,n=e=>e===`static`?e:Math.max(e??t,t),r=e.staleTime;e.staleTime=typeof r==`function`?(...e)=>n(r(...e)):n(r),typeof e.gcTime==`number`&&(e.gcTime=Math.max(e.gcTime,t))}},be=(e,t)=>e?.suspense&&t.isPending,xe=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function $(e,t,n){let i=pe(),a=ge(),s=o(n),c=s.defaultQueryOptions(e),l=s.getQueryCache().get(c.queryHash),u=e.subscribed!==!1;c._optimisticResults=i?`isRestoring`:u?`optimistic`:void 0,ye(c),_e(c,a,l),Q(a);let[d]=r.useState(()=>new t(s,c)),p=d.getOptimisticResult(c),m=!i&&u;if(r.useSyncExternalStore(r.useCallback(e=>{let t=m?d.subscribe(P.batchCalls(e)):f;return d.updateResult(),t},[d,m]),()=>d.getCurrentResult(),()=>d.getCurrentResult()),r.useEffect(()=>{d.setOptions(c)},[c,d]),be(c,p))throw xe(c,d,a);if(ve({result:p,errorResetBoundary:a,throwOnError:c.throwOnError,query:l,suspense:c.suspense}))throw p.error;return c.notifyOnChangeProps?p:d.trackResult(p)}function Se(e,t){return $(e,K,t)}export{o as C,s as S,_,ue as a,g as b,R as c,N as d,M as f,v as g,y as h,de as i,F as l,b as m,$ as n,H as o,p,K as r,z as s,Se as t,P as u,f as v,O as x,x as y};
@@ -1 +1 @@
1
- import{r as e,t}from"./rolldown-runtime-hePW80VL.js";import{i as n}from"./react-vendor-wiHys0m2.js";import{f as r,u as i}from"./utils-DaXuqmQm.js";var a=e(n()),o=(e,t,n,r)=>{let i=[n,{code:t,...r||{}}];if(e?.services?.logger?.forward)return e.services.logger.forward(i,`warn`,`react-i18next::`,!0);p(i[0])&&(i[0]=`react-i18next:: ${i[0]}`),e?.services?.logger?.warn?e.services.logger.warn(...i):console?.warn&&console.warn(...i)},s={},c=(e,t,n,r)=>{p(n)&&s[n]||(p(n)&&(s[n]=new Date),o(e,t,n,r))},l=(e,t)=>()=>{if(e.isInitialized)t();else{let n=()=>{setTimeout(()=>{e.off(`initialized`,n)},0),t()};e.on(`initialized`,n)}},u=(e,t,n)=>{e.loadNamespaces(t,l(e,n))},d=(e,t,n,r)=>{if(p(n)&&(n=[n]),e.options.preload&&e.options.preload.indexOf(t)>-1)return u(e,n,r);n.forEach(t=>{e.options.ns.indexOf(t)<0&&e.options.ns.push(t)}),e.loadLanguages(t,l(e,r))},f=(e,t,n={})=>!t.languages||!t.languages.length?(c(t,`NO_LANGUAGES`,`i18n.languages were undefined or empty`,{languages:t.languages}),!0):t.hasLoadedNamespace(e,{lng:n.lng,precheck:(t,r)=>{if(n.bindI18n&&n.bindI18n.indexOf(`languageChanging`)>-1&&t.services.backendConnector.backend&&t.isLanguageChangingTo&&!r(t.isLanguageChangingTo,e))return!1}}),p=e=>typeof e==`string`,m=e=>typeof e==`object`&&!!e,h=(0,a.createContext)(),g=class{constructor(){this.usedNamespaces={}}addUsedNamespaces(e){e.forEach(e=>{this.usedNamespaces[e]||(this.usedNamespaces[e]=!0)})}getUsedNamespaces(){return Object.keys(this.usedNamespaces)}},_=t((e=>{var t=n();function r(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var i=typeof Object.is==`function`?Object.is:r,a=t.useState,o=t.useEffect,s=t.useLayoutEffect,c=t.useDebugValue;function l(e,t){var n=t(),r=a({inst:{value:n,getSnapshot:t}}),i=r[0].inst,l=r[1];return s(function(){i.value=n,i.getSnapshot=t,u(i)&&l({inst:i})},[e,n,t]),o(function(){return u(i)&&l({inst:i}),e(function(){u(i)&&l({inst:i})})},[e]),c(n),n}function u(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!i(e,n)}catch{return!0}}function d(e,t){return t()}var f=typeof window>`u`||window.document===void 0||window.document.createElement===void 0?d:l;e.useSyncExternalStore=t.useSyncExternalStore===void 0?f:t.useSyncExternalStore})),v=t(((e,t)=>{t.exports=_()}))(),y={t:(e,t)=>{if(p(t))return t;if(m(t)&&p(t.defaultValue))return t.defaultValue;if(typeof e==`function`)return``;if(Array.isArray(e)){let t=e[e.length-1];return typeof t==`function`?``:t}return e},ready:!1},b=()=>()=>{},x=(e,t={})=>{let{i18n:n}=t,{i18n:o,defaultNS:s}=(0,a.useContext)(h)||{},l=n||o||i();l&&!l.reportNamespaces&&(l.reportNamespaces=new g),l||c(l,`NO_I18NEXT_INSTANCE`,`useTranslation: You will need to pass in an i18next instance by using initReactI18next or by passing it via props or context. In monorepo setups, make sure there is only one instance of react-i18next.`);let m=(0,a.useMemo)(()=>({...r(),...l?.options?.react,...t}),[l,t]),{useSuspense:_,keyPrefix:x}=m,S=e||s||l?.options?.defaultNS,C=p(S)?[S]:S||[`translation`],w=(0,a.useMemo)(()=>C,C);l?.reportNamespaces?.addUsedNamespaces?.(w);let T=(0,a.useRef)(0),E=(0,a.useCallback)(e=>{if(!l)return b;let{bindI18n:t,bindI18nStore:n}=m,r=()=>{T.current+=1,e()};return t&&l.on(t,r),n&&l.store.on(n,r),()=>{t&&t.split(` `).forEach(e=>l.off(e,r)),n&&n.split(` `).forEach(e=>l.store.off(e,r))}},[l,m]),D=(0,a.useRef)(),O=(0,a.useCallback)(()=>{if(!l)return y;let e=!!(l.isInitialized||l.initializedStoreOnce)&&w.every(e=>f(e,l,m)),n=t.lng||l.language,r=T.current,i=D.current;if(i&&i.ready===e&&i.lng===n&&i.keyPrefix===x&&i.revision===r)return i;let a={t:l.getFixedT(n,m.nsMode===`fallback`?w:w[0],x,{scopeNs:w}),ready:e,lng:n,keyPrefix:x,revision:r};return D.current=a,a},[l,w,x,m,t.lng]),[k,A]=(0,a.useState)(0),{t:j,ready:M}=(0,v.useSyncExternalStore)(E,O,O);(0,a.useEffect)(()=>{if(l&&!M&&!_){let e=()=>A(e=>e+1);t.lng?d(l,t.lng,w,e):u(l,w,e)}},[l,t.lng,w,M,_,k]);let N=l||{},P=(0,a.useRef)(null),F=(0,a.useRef)(),I=e=>`${e.language}|${e.resolvedLanguage}|${e.languages?.join(`,`)}`,L=e=>{let t=Object.getOwnPropertyDescriptors(e);t.__original&&delete t.__original;let n=Object.create(Object.getPrototypeOf(e),t);if(!Object.prototype.hasOwnProperty.call(n,`__original`))try{Object.defineProperty(n,"__original",{value:e,writable:!1,enumerable:!1,configurable:!1})}catch{}return n},R=(0,a.useMemo)(()=>{let e=N,t=e&&I(e),n=e;e&&(P.current&&P.current.__original===e&&F.current===t?n=P.current:(n=L(e),P.current=n,F.current=t));let r=!M&&!_?(...e)=>(c(l,`USE_T_BEFORE_READY`,`useTranslation: t was called before ready. When using useSuspense: false, make sure to check the ready flag before using t.`),j(...e)):j,i=[r,n,M];return i.t=r,i.i18n=n,i.ready=M,i},[j,N,M,N.resolvedLanguage,N.language,N.languages]);if(l&&_&&!M){let e=!1;try{e=!1}catch{}throw e&&c(l,`SUSPENDED_WHILE_LOADING`,`useTranslation: suspended while translations are loading (useSuspense is true by default). Add a <Suspense> boundary above this component, or set react.useSuspense: false in the i18next init options. https://react.i18next.com/latest/usetranslation-hook`),new Promise(e=>{let n=()=>e();t.lng?d(l,t.lng,w,n):u(l,w,n)})}return R};export{x as t};
1
+ import{r as e,t}from"./rolldown-runtime-hePW80VL.js";import{i as n}from"./react-vendor-CR5VJ85Q.js";import{f as r,u as i}from"./utils-B-Bhh1pF.js";var a=e(n()),o=(e,t,n,r)=>{let i=[n,{code:t,...r||{}}];if(e?.services?.logger?.forward)return e.services.logger.forward(i,`warn`,`react-i18next::`,!0);p(i[0])&&(i[0]=`react-i18next:: ${i[0]}`),e?.services?.logger?.warn?e.services.logger.warn(...i):console?.warn&&console.warn(...i)},s={},c=(e,t,n,r)=>{p(n)&&s[n]||(p(n)&&(s[n]=new Date),o(e,t,n,r))},l=(e,t)=>()=>{if(e.isInitialized)t();else{let n=()=>{setTimeout(()=>{e.off(`initialized`,n)},0),t()};e.on(`initialized`,n)}},u=(e,t,n)=>{e.loadNamespaces(t,l(e,n))},d=(e,t,n,r)=>{if(p(n)&&(n=[n]),e.options.preload&&e.options.preload.indexOf(t)>-1)return u(e,n,r);n.forEach(t=>{e.options.ns.indexOf(t)<0&&e.options.ns.push(t)}),e.loadLanguages(t,l(e,r))},f=(e,t,n={})=>!t.languages||!t.languages.length?(c(t,`NO_LANGUAGES`,`i18n.languages were undefined or empty`,{languages:t.languages}),!0):t.hasLoadedNamespace(e,{lng:n.lng,precheck:(t,r)=>{if(n.bindI18n&&n.bindI18n.indexOf(`languageChanging`)>-1&&t.services.backendConnector.backend&&t.isLanguageChangingTo&&!r(t.isLanguageChangingTo,e))return!1}}),p=e=>typeof e==`string`,m=e=>typeof e==`object`&&!!e,h=(0,a.createContext)(),g=class{constructor(){this.usedNamespaces={}}addUsedNamespaces(e){e.forEach(e=>{this.usedNamespaces[e]||(this.usedNamespaces[e]=!0)})}getUsedNamespaces(){return Object.keys(this.usedNamespaces)}},_=t((e=>{var t=n();function r(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var i=typeof Object.is==`function`?Object.is:r,a=t.useState,o=t.useEffect,s=t.useLayoutEffect,c=t.useDebugValue;function l(e,t){var n=t(),r=a({inst:{value:n,getSnapshot:t}}),i=r[0].inst,l=r[1];return s(function(){i.value=n,i.getSnapshot=t,u(i)&&l({inst:i})},[e,n,t]),o(function(){return u(i)&&l({inst:i}),e(function(){u(i)&&l({inst:i})})},[e]),c(n),n}function u(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!i(e,n)}catch{return!0}}function d(e,t){return t()}var f=typeof window>`u`||window.document===void 0||window.document.createElement===void 0?d:l;e.useSyncExternalStore=t.useSyncExternalStore===void 0?f:t.useSyncExternalStore})),v=t(((e,t)=>{t.exports=_()}))(),y={t:(e,t)=>{if(p(t))return t;if(m(t)&&p(t.defaultValue))return t.defaultValue;if(typeof e==`function`)return``;if(Array.isArray(e)){let t=e[e.length-1];return typeof t==`function`?``:t}return e},ready:!1},b=()=>()=>{},x=(e,t={})=>{let{i18n:n}=t,{i18n:o,defaultNS:s}=(0,a.useContext)(h)||{},l=n||o||i();l&&!l.reportNamespaces&&(l.reportNamespaces=new g),l||c(l,`NO_I18NEXT_INSTANCE`,`useTranslation: You will need to pass in an i18next instance by using initReactI18next or by passing it via props or context. In monorepo setups, make sure there is only one instance of react-i18next.`);let m=(0,a.useMemo)(()=>({...r(),...l?.options?.react,...t}),[l,t]),{useSuspense:_,keyPrefix:x}=m,S=e||s||l?.options?.defaultNS,C=p(S)?[S]:S||[`translation`],w=(0,a.useMemo)(()=>C,C);l?.reportNamespaces?.addUsedNamespaces?.(w);let T=(0,a.useRef)(0),E=(0,a.useCallback)(e=>{if(!l)return b;let{bindI18n:t,bindI18nStore:n}=m,r=()=>{T.current+=1,e()};return t&&l.on(t,r),n&&l.store.on(n,r),()=>{t&&t.split(` `).forEach(e=>l.off(e,r)),n&&n.split(` `).forEach(e=>l.store.off(e,r))}},[l,m]),D=(0,a.useRef)(),O=(0,a.useCallback)(()=>{if(!l)return y;let e=!!(l.isInitialized||l.initializedStoreOnce)&&w.every(e=>f(e,l,m)),n=t.lng||l.language,r=T.current,i=D.current;if(i&&i.ready===e&&i.lng===n&&i.keyPrefix===x&&i.revision===r)return i;let a={t:l.getFixedT(n,m.nsMode===`fallback`?w:w[0],x,{scopeNs:w}),ready:e,lng:n,keyPrefix:x,revision:r};return D.current=a,a},[l,w,x,m,t.lng]),[k,A]=(0,a.useState)(0),{t:j,ready:M}=(0,v.useSyncExternalStore)(E,O,O);(0,a.useEffect)(()=>{if(l&&!M&&!_){let e=()=>A(e=>e+1);t.lng?d(l,t.lng,w,e):u(l,w,e)}},[l,t.lng,w,M,_,k]);let N=l||{},P=(0,a.useRef)(null),F=(0,a.useRef)(),I=e=>`${e.language}|${e.resolvedLanguage}|${e.languages?.join(`,`)}`,L=e=>{let t=Object.getOwnPropertyDescriptors(e);t.__original&&delete t.__original;let n=Object.create(Object.getPrototypeOf(e),t);if(!Object.prototype.hasOwnProperty.call(n,`__original`))try{Object.defineProperty(n,"__original",{value:e,writable:!1,enumerable:!1,configurable:!1})}catch{}return n},R=(0,a.useMemo)(()=>{let e=N,t=e&&I(e),n=e;e&&(P.current&&P.current.__original===e&&F.current===t?n=P.current:(n=L(e),P.current=n,F.current=t));let r=!M&&!_?(...e)=>(c(l,`USE_T_BEFORE_READY`,`useTranslation: t was called before ready. When using useSuspense: false, make sure to check the ready flag before using t.`),j(...e)):j,i=[r,n,M];return i.t=r,i.i18n=n,i.ready=M,i},[j,N,M,N.resolvedLanguage,N.language,N.languages]);if(l&&_&&!M){let e=!1;try{e=!1}catch{}throw e&&c(l,`SUSPENDED_WHILE_LOADING`,`useTranslation: suspended while translations are loading (useSuspense is true by default). Add a <Suspense> boundary above this component, or set react.useSuspense: false in the i18next init options. https://react.i18next.com/latest/usetranslation-hook`),new Promise(e=>{let n=()=>e();t.lng?d(l,t.lng,w,n):u(l,w,n)})}return R};export{x as t};
@@ -1 +1 @@
1
- import{i as e,r as t}from"./utils-vendor-CvhktdS_.js";var n=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,r={"&amp;":`&`,"&#38;":`&`,"&lt;":`<`,"&#60;":`<`,"&gt;":`>`,"&#62;":`>`,"&apos;":`'`,"&#39;":`'`,"&quot;":`"`,"&#34;":`"`,"&nbsp;":` `,"&#160;":` `,"&copy;":`©`,"&#169;":`©`,"&reg;":`®`,"&#174;":`®`,"&hellip;":`…`,"&#8230;":`…`,"&#x2F;":`/`,"&#47;":`/`},i=e=>r[e],a={bindI18n:`languageChanged`,bindI18nStore:``,transEmptyNodeValue:``,transSupportBasicHtmlNodes:!0,transWrapTextNodes:``,transKeepBasicHtmlNodesFor:[`br`,`strong`,`i`,`p`],useSuspense:!0,unescape:e=>e.replace(n,i),transDefaultProps:void 0},o=(e={})=>{a={...a,...e}},s=()=>a,c,l=e=>{c=e},u=()=>c;function d(...n){return t(e(n))}function f(){return typeof navigator<`u`&&/Mac|iPhone|iPad/.test(navigator.platform)}var p=new Map,m=new Map,h=e=>{let t=p.get(e);return t||(t=new Intl.RelativeTimeFormat(e,{numeric:`auto`,style:`narrow`}),p.set(e,t)),t},g=e=>{let t=m.get(e);return t||(t=new Intl.DateTimeFormat(e),m.set(e,t)),t};function _(e,t=`en`){let n=new Date(e),r=Math.max(0,new Date().getTime()-n.getTime()),i=Math.floor(r/6e4),a=Math.floor(r/36e5),o=Math.floor(r/864e5);if(t.toLowerCase().split(`-`)[0]===`en`)return i<1?`Just now`:i<60?`${i}m ago`:a<24?`${a}h ago`:o<7?`${o}d ago`:g(t).format(n);let s=h(t);return i<1?s.format(0,`second`):i<60?s.format(-i,`minute`):a<24?s.format(-a,`hour`):o<7?s.format(-o,`day`):g(t).format(n)}function v(e,t=`en`,n=Date.now()){let r=Math.round((e-n)/1e3),i=Math.abs(r),a=h(t);return i<60?a.format(r,`second`):i<3600?a.format(Math.round(r/60),`minute`):i<86400?a.format(Math.round(r/3600),`hour`):a.format(Math.round(r/86400),`day`)}function y(e){let t=[`B`,`KB`,`MB`,`GB`],n=e,r=0;for(;n>=1024&&r<t.length-1;)n/=1024,r++;return`${n.toFixed(1)} ${t[r]}`}function b(e=12){let t=new Uint8Array(e);globalThis.crypto.getRandomValues(t);let n=``;for(let e of t)n+=`0123456789abcdefghijklmnopqrstuvwxyz`[e%36];return n}function x(){return b(11)+Date.now().toString(36)}function S(e,t){return e.length<=t?e:e.substring(0,t)+`...`}function C(e){for(let t of[/^\[Thinking:\s*([\s\S]*?)\]\s*/i,/^<thinking>([\s\S]*?)<\/thinking>\s*/i,/^<think>([\s\S]*?)<\/think>\s*/i]){let n=e.match(t);if(n)return{thinking:n[1].trim(),content:e.slice(n[0].length).trim(),thinkingComplete:!0}}for(let[t,n]of[[/^\[Thinking:\s*/i,`]`],[/^<thinking>\s*/i,`</thinking>`],[/^<think>\s*/i,`</think>`]]){let r=e.match(t);if(r&&!e.toLowerCase().includes(n))return{thinking:e.slice(r[0].length).trim()||null,content:``,thinkingComplete:!1}}return{thinking:null,content:e,thinkingComplete:!0}}export{x as a,b as c,l as d,s as f,_ as i,S as l,y as n,f as o,o as p,v as r,C as s,d as t,u};
1
+ import{i as e,r as t}from"./utils-vendor-DPJG-EG_.js";var n=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,r={"&amp;":`&`,"&#38;":`&`,"&lt;":`<`,"&#60;":`<`,"&gt;":`>`,"&#62;":`>`,"&apos;":`'`,"&#39;":`'`,"&quot;":`"`,"&#34;":`"`,"&nbsp;":` `,"&#160;":` `,"&copy;":`©`,"&#169;":`©`,"&reg;":`®`,"&#174;":`®`,"&hellip;":`…`,"&#8230;":`…`,"&#x2F;":`/`,"&#47;":`/`},i=e=>r[e],a={bindI18n:`languageChanged`,bindI18nStore:``,transEmptyNodeValue:``,transSupportBasicHtmlNodes:!0,transWrapTextNodes:``,transKeepBasicHtmlNodesFor:[`br`,`strong`,`i`,`p`],useSuspense:!0,unescape:e=>e.replace(n,i),transDefaultProps:void 0},o=(e={})=>{a={...a,...e}},s=()=>a,c,l=e=>{c=e},u=()=>c;function d(...n){return t(e(n))}function f(){return typeof navigator<`u`&&/Mac|iPhone|iPad/.test(navigator.platform)}var p=new Map,m=new Map,h=e=>{let t=p.get(e);return t||(t=new Intl.RelativeTimeFormat(e,{numeric:`auto`,style:`narrow`}),p.set(e,t)),t},g=e=>{let t=m.get(e);return t||(t=new Intl.DateTimeFormat(e),m.set(e,t)),t};function _(e,t=`en`){let n=new Date(e),r=Math.max(0,new Date().getTime()-n.getTime()),i=Math.floor(r/6e4),a=Math.floor(r/36e5),o=Math.floor(r/864e5);if(t.toLowerCase().split(`-`)[0]===`en`)return i<1?`Just now`:i<60?`${i}m ago`:a<24?`${a}h ago`:o<7?`${o}d ago`:g(t).format(n);let s=h(t);return i<1?s.format(0,`second`):i<60?s.format(-i,`minute`):a<24?s.format(-a,`hour`):o<7?s.format(-o,`day`):g(t).format(n)}function v(e,t=`en`,n=Date.now()){let r=Math.round((e-n)/1e3),i=Math.abs(r),a=h(t);return i<60?a.format(r,`second`):i<3600?a.format(Math.round(r/60),`minute`):i<86400?a.format(Math.round(r/3600),`hour`):a.format(Math.round(r/86400),`day`)}function y(e){let t=[`B`,`KB`,`MB`,`GB`],n=e,r=0;for(;n>=1024&&r<t.length-1;)n/=1024,r++;return`${n.toFixed(1)} ${t[r]}`}function b(e=12){let t=new Uint8Array(e);globalThis.crypto.getRandomValues(t);let n=``;for(let e of t)n+=`0123456789abcdefghijklmnopqrstuvwxyz`[e%36];return n}function x(){return b(11)+Date.now().toString(36)}function S(e,t){return e.length<=t?e:e.substring(0,t)+`...`}function C(e){for(let t of[/^\[Thinking:\s*([\s\S]*?)\]\s*/i,/^<thinking>([\s\S]*?)<\/thinking>\s*/i,/^<think>([\s\S]*?)<\/think>\s*/i]){let n=e.match(t);if(n)return{thinking:n[1].trim(),content:e.slice(n[0].length).trim(),thinkingComplete:!0}}for(let[t,n]of[[/^\[Thinking:\s*/i,`]`],[/^<thinking>\s*/i,`</thinking>`],[/^<think>\s*/i,`</think>`]]){let r=e.match(t);if(r&&!e.toLowerCase().includes(n))return{thinking:e.slice(r[0].length).trim()||null,content:``,thinkingComplete:!1}}return{thinking:null,content:e,thinkingComplete:!0}}export{x as a,b as c,l as d,s as f,_ as i,S as l,y as n,f as o,o as p,v as r,C as s,d as t,u};
@@ -1 +1 @@
1
- import{r as e}from"./rolldown-runtime-hePW80VL.js";import{i as t}from"./react-vendor-wiHys0m2.js";function n(e){var t,r,i=``;if(typeof e==`string`||typeof e==`number`)i+=e;else if(typeof e==`object`){if(Array.isArray(e)){var a=e.length;for(t=0;t<a;t++)e[t]&&(r=n(e[t]))&&(i&&(i+=` `),i+=r)}else for(r in e)e[r]&&(i&&(i+=` `),i+=r)}return i}function r(){for(var e,t,r=0,i=``,a=arguments.length;r<a;r++)(e=arguments[r])&&(t=n(e))&&(i&&(i+=` `),i+=t);return i}var i=(e,t)=>{let n=Array(e.length+t.length);for(let t=0;t<e.length;t++)n[t]=e[t];for(let r=0;r<t.length;r++)n[e.length+r]=t[r];return n},a=(e,t)=>({classGroupId:e,validator:t}),o=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),s=`-`,c=[],l=`arbitrary..`,u=e=>{let t=p(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:e=>{if(e.startsWith(`[`)&&e.endsWith(`]`))return f(e);let n=e.split(s);return d(n,+(n[0]===``&&n.length>1),t)},getConflictingClassGroupIds:(e,t)=>{if(t){let t=r[e],a=n[e];return t?a?i(a,t):t:a||c}return n[e]||c}}},d=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;let r=e[t],i=n.nextPart.get(r);if(i){let n=d(e,t+1,i);if(n)return n}let a=n.validators;if(a===null)return;let o=t===0?e.join(s):e.slice(t).join(s),c=a.length;for(let e=0;e<c;e++){let t=a[e];if(t.validator(o))return t.classGroupId}},f=e=>e.slice(1,-1).indexOf(`:`)===-1?void 0:(()=>{let t=e.slice(1,-1),n=t.indexOf(`:`),r=t.slice(0,n);return r?l+r:void 0})(),p=e=>{let{theme:t,classGroups:n}=e;return m(n,t)},m=(e,t)=>{let n=o();for(let r in e){let i=e[r];h(i,n,r,t)}return n},h=(e,t,n,r)=>{let i=e.length;for(let a=0;a<i;a++){let i=e[a];g(i,t,n,r)}},g=(e,t,n,r)=>{if(typeof e==`string`){_(e,t,n);return}if(typeof e==`function`){ee(e,t,n,r);return}v(e,t,n,r)},_=(e,t,n)=>{let r=e===``?t:y(t,e);r.classGroupId=n},ee=(e,t,n,r)=>{if(b(e)){h(e(r),t,n,r);return}t.validators===null&&(t.validators=[]),t.validators.push(a(n,e))},v=(e,t,n,r)=>{let i=Object.entries(e),a=i.length;for(let e=0;e<a;e++){let[a,o]=i[e];h(o,y(t,a),n,r)}},y=(e,t)=>{let n=e,r=t.split(s),i=r.length;for(let e=0;e<i;e++){let t=r[e],i=n.nextPart.get(t);i||(i=o(),n.nextPart.set(t,i)),n=i}return n},b=e=>`isThemeGetter`in e&&e.isThemeGetter===!0,x=e=>{if(e<1)return{get:()=>void 0,set:()=>{}};let t=0,n=Object.create(null),r=Object.create(null),i=(i,a)=>{n[i]=a,t++,t>e&&(t=0,r=n,n=Object.create(null))};return{get(e){let t=n[e];if(t!==void 0)return t;if((t=r[e])!==void 0)return i(e,t),t},set(e,t){e in n?n[e]=t:i(e,t)}}},S=`!`,C=`:`,w=[],te=(e,t,n,r,i)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:i}),ne=e=>{let{prefix:t,experimentalParseClassName:n}=e,r=e=>{let t=[],n=0,r=0,i=0,a,o=e.length;for(let s=0;s<o;s++){let o=e[s];if(n===0&&r===0){if(o===C){t.push(e.slice(i,s)),i=s+1;continue}if(o===`/`){a=s;continue}}o===`[`?n++:o===`]`?n--:o===`(`?r++:o===`)`&&r--}let s=t.length===0?e:e.slice(i),c=s,l=!1;s.endsWith(S)?(c=s.slice(0,-1),l=!0):s.startsWith(S)&&(c=s.slice(1),l=!0);let u=a&&a>i?a-i:void 0;return te(t,l,c,u)};if(t){let e=t+C,n=r;r=t=>t.startsWith(e)?n(t.slice(e.length)):te(w,!1,t,void 0,!0)}if(n){let e=r;r=t=>n({className:t,parseClassName:e})}return r},T=e=>{let t=new Map;return e.orderSensitiveModifiers.forEach((e,n)=>{t.set(e,1e6+n)}),e=>{let n=[],r=[];for(let i=0;i<e.length;i++){let a=e[i],o=a[0]===`[`,s=t.has(a);o||s?(r.length>0&&(r.sort(),n.push(...r),r=[]),n.push(a)):r.push(a)}return r.length>0&&(r.sort(),n.push(...r)),n}},re=e=>({cache:x(e.cacheSize),parseClassName:ne(e),sortModifiers:T(e),postfixLookupClassGroupIds:E(e),...u(e)}),E=e=>{let t=Object.create(null),n=e.postfixLookupClassGroups;if(n)for(let e=0;e<n.length;e++)t[n[e]]=!0;return t},D=/\s+/,O=(e,t)=>{let{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:i,sortModifiers:a,postfixLookupClassGroupIds:o}=t,s=[],c=e.trim().split(D),l=``;for(let e=c.length-1;e>=0;--e){let t=c[e],{isExternal:u,modifiers:d,hasImportantModifier:f,baseClassName:p,maybePostfixModifierPosition:m}=n(t);if(u){l=t+(l.length>0?` `+l:l);continue}let h=!!m,g;if(h){g=r(p.substring(0,m));let e=g&&o[g]?r(p):void 0;e&&e!==g&&(g=e,h=!1)}else g=r(p);if(!g){if(!h){l=t+(l.length>0?` `+l:l);continue}if(g=r(p),!g){l=t+(l.length>0?` `+l:l);continue}h=!1}let _=d.length===0?``:d.length===1?d[0]:a(d).join(`:`),ee=f?_+S:_,v=ee+g;if(s.indexOf(v)>-1)continue;s.push(v);let y=i(g,h);for(let e=0;e<y.length;++e){let t=y[e];s.push(ee+t)}l=t+(l.length>0?` `+l:l)}return l},k=(...e)=>{let t=0,n,r,i=``;for(;t<e.length;)(n=e[t++])&&(r=A(n))&&(i&&(i+=` `),i+=r);return i},A=e=>{if(typeof e==`string`)return e;let t,n=``;for(let r=0;r<e.length;r++)e[r]&&(t=A(e[r]))&&(n&&(n+=` `),n+=t);return n},j=(e,...t)=>{let n,r,i,a,o=o=>(n=re(t.reduce((e,t)=>t(e),e())),r=n.cache.get,i=n.cache.set,a=s,s(o)),s=e=>{let t=r(e);if(t)return t;let a=O(e,n);return i(e,a),a};return a=o,(...e)=>a(k(...e))},M=[],N=e=>{let t=t=>t[e]||M;return t.isThemeGetter=!0,t.themeKey=e,t},P=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,F=/^\((?:(\w[\w-]*):)?(.+)\)$/i,ie=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,I=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,L=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,R=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix|color|light-dark)\(.+\)$/,z=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,ae=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,B=e=>ie.test(e),V=e=>!!e&&!Number.isNaN(Number(e)),H=e=>!!e&&Number.isInteger(Number(e)),oe=e=>e.endsWith(`%`)&&V(e.slice(0,-1)),U=e=>I.test(e),se=()=>!0,W=e=>L.test(e)&&!R.test(e),G=()=>!1,K=e=>z.test(e),q=e=>ae.test(e),ce=e=>!J(e)&&!X(e),le=e=>e.startsWith(`@container`)&&(e[10]===`/`&&e[11]!==void 0||e[11]===`s`&&e[16]!==void 0&&e.startsWith(`-size/`,10)||e[11]===`n`&&e[18]!==void 0&&e.startsWith(`-normal/`,10)),ue=e=>Q(e,Te,G),J=e=>P.test(e),Y=e=>Q(e,Ee,W),de=e=>Q(e,De,V),fe=e=>Q(e,ke,se),pe=e=>Q(e,Oe,G),me=e=>Q(e,Ce,G),he=e=>Q(e,we,q),ge=e=>Q(e,Ae,K),X=e=>F.test(e),Z=e=>$(e,Ee),_e=e=>$(e,Oe),ve=e=>$(e,Ce),ye=e=>$(e,Te),be=e=>$(e,we),xe=e=>$(e,Ae,!0),Se=e=>$(e,ke,!0),Q=(e,t,n)=>{let r=P.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},$=(e,t,n=!1)=>{let r=F.exec(e);return r?r[1]?t(r[1]):n:!1},Ce=e=>e===`position`||e===`percentage`,we=e=>e===`image`||e===`url`,Te=e=>e===`length`||e===`size`||e===`bg-size`,Ee=e=>e===`length`,De=e=>e===`number`,Oe=e=>e===`family-name`,ke=e=>e===`number`||e===`weight`,Ae=e=>e===`shadow`,je=j(()=>{let e=N(`color`),t=N(`font`),n=N(`text`),r=N(`font-weight`),i=N(`tracking`),a=N(`leading`),o=N(`breakpoint`),s=N(`container`),c=N(`spacing`),l=N(`radius`),u=N(`shadow`),d=N(`inset-shadow`),f=N(`text-shadow`),p=N(`drop-shadow`),m=N(`blur`),h=N(`perspective`),g=N(`aspect`),_=N(`ease`),ee=N(`animate`),v=()=>[`auto`,`avoid`,`all`,`avoid-page`,`page`,`left`,`right`,`column`],y=()=>[`center`,`top`,`bottom`,`left`,`right`,`top-left`,`left-top`,`top-right`,`right-top`,`bottom-right`,`right-bottom`,`bottom-left`,`left-bottom`],b=()=>[...y(),X,J],x=()=>[`auto`,`hidden`,`clip`,`visible`,`scroll`],S=()=>[`auto`,`contain`,`none`],C=()=>[X,J,c],w=()=>[B,`full`,`auto`,...C()],te=()=>[H,`none`,`subgrid`,X,J],ne=()=>[`auto`,{span:[`full`,H,X,J]},H,X,J],T=()=>[H,`auto`,X,J],re=()=>[`auto`,`min`,`max`,`fr`,X,J],E=()=>[`start`,`end`,`center`,`between`,`around`,`evenly`,`stretch`,`baseline`,`center-safe`,`end-safe`],D=()=>[`start`,`end`,`center`,`stretch`,`center-safe`,`end-safe`],O=()=>[`auto`,...C()],k=()=>[B,`auto`,`full`,`dvw`,`dvh`,`lvw`,`lvh`,`svw`,`svh`,`min`,`max`,`fit`,...C()],A=()=>[s,B,`screen`,`full`,`dvw`,`lvw`,`svw`,`min`,`max`,`fit`,...C()],j=()=>[B,`screen`,`full`,`lh`,`dvh`,`lvh`,`svh`,`min`,`max`,`fit`,...C()],M=()=>[e,X,J],P=()=>[...y(),ve,me,{position:[X,J]}],F=()=>[`no-repeat`,{repeat:[``,`x`,`y`,`space`,`round`]}],ie=()=>[`auto`,`cover`,`contain`,ye,ue,{size:[X,J]}],I=()=>[oe,Z,Y],L=()=>[``,`none`,`full`,l,X,J],R=()=>[``,V,Z,Y],z=()=>[`solid`,`dashed`,`dotted`,`double`],ae=()=>[`normal`,`multiply`,`screen`,`overlay`,`darken`,`lighten`,`color-dodge`,`color-burn`,`hard-light`,`soft-light`,`difference`,`exclusion`,`hue`,`saturation`,`color`,`luminosity`],W=()=>[V,oe,ve,me],G=()=>[``,`none`,m,X,J],K=()=>[`none`,V,X,J],q=()=>[`none`,V,X,J],Q=()=>[V,X,J],$=()=>[B,`full`,...C()];return{cacheSize:500,theme:{animate:[`spin`,`ping`,`pulse`,`bounce`],aspect:[`video`],blur:[U],breakpoint:[U],color:[se],container:[U],"drop-shadow":[U],ease:[`in`,`out`,`in-out`],font:[ce],"font-weight":[`thin`,`extralight`,`light`,`normal`,`medium`,`semibold`,`bold`,`extrabold`,`black`],"inset-shadow":[U],leading:[`none`,`tight`,`snug`,`normal`,`relaxed`,`loose`],perspective:[`dramatic`,`near`,`normal`,`midrange`,`distant`,`none`],radius:[U],shadow:[U],spacing:[`px`,V],text:[U],"text-shadow":[U],tracking:[`tighter`,`tight`,`normal`,`wide`,`wider`,`widest`]},classGroups:{aspect:[{aspect:[`auto`,`square`,B,J,X,g]}],container:[`container`],"container-type":[{"@container":[``,`normal`,`size`,X,J]}],"container-named":[le],columns:[{columns:[V,`auto`,J,X,s]}],"break-after":[{"break-after":v()}],"break-before":[{"break-before":v()}],"break-inside":[{"break-inside":[`auto`,`avoid`,`avoid-page`,`avoid-column`]}],"box-decoration":[{"box-decoration":[`slice`,`clone`]}],box:[{box:[`border`,`content`]}],display:[`block`,`inline-block`,`inline`,`flex`,`inline-flex`,`table`,`inline-table`,`table-caption`,`table-cell`,`table-column`,`table-column-group`,`table-footer-group`,`table-header-group`,`table-row-group`,`table-row`,`flow-root`,`grid`,`inline-grid`,`contents`,`list-item`,`hidden`],sr:[`sr-only`,`not-sr-only`],float:[{float:[`right`,`left`,`none`,`start`,`end`]}],clear:[{clear:[`left`,`right`,`both`,`none`,`start`,`end`]}],isolation:[`isolate`,`isolation-auto`],"object-fit":[{object:[`contain`,`cover`,`fill`,`none`,`scale-down`]}],"object-position":[{object:b()}],overflow:[{overflow:x()}],"overflow-x":[{"overflow-x":x()}],"overflow-y":[{"overflow-y":x()}],overscroll:[{overscroll:S()}],"overscroll-x":[{"overscroll-x":S()}],"overscroll-y":[{"overscroll-y":S()}],position:[`static`,`fixed`,`absolute`,`relative`,`sticky`],inset:[{inset:w()}],"inset-x":[{"inset-x":w()}],"inset-y":[{"inset-y":w()}],start:[{"inset-s":w(),start:w()}],end:[{"inset-e":w(),end:w()}],"inset-bs":[{"inset-bs":w()}],"inset-be":[{"inset-be":w()}],top:[{top:w()}],right:[{right:w()}],bottom:[{bottom:w()}],left:[{left:w()}],visibility:[`visible`,`invisible`,`collapse`],z:[{z:[H,`auto`,X,J]}],basis:[{basis:[B,`full`,`auto`,s,...C()]}],"flex-direction":[{flex:[`row`,`row-reverse`,`col`,`col-reverse`]}],"flex-wrap":[{flex:[`nowrap`,`wrap`,`wrap-reverse`]}],flex:[{flex:[V,B,`auto`,`initial`,`none`,J]}],grow:[{grow:[``,V,X,J]}],shrink:[{shrink:[``,V,X,J]}],order:[{order:[H,`first`,`last`,`none`,X,J]}],"grid-cols":[{"grid-cols":te()}],"col-start-end":[{col:ne()}],"col-start":[{"col-start":T()}],"col-end":[{"col-end":T()}],"grid-rows":[{"grid-rows":te()}],"row-start-end":[{row:ne()}],"row-start":[{"row-start":T()}],"row-end":[{"row-end":T()}],"grid-flow":[{"grid-flow":[`row`,`col`,`dense`,`row-dense`,`col-dense`]}],"auto-cols":[{"auto-cols":re()}],"auto-rows":[{"auto-rows":re()}],gap:[{gap:C()}],"gap-x":[{"gap-x":C()}],"gap-y":[{"gap-y":C()}],"justify-content":[{justify:[...E(),`normal`]}],"justify-items":[{"justify-items":[...D(),`normal`]}],"justify-self":[{"justify-self":[`auto`,...D()]}],"align-content":[{content:[`normal`,...E()]}],"align-items":[{items:[...D(),{baseline:[``,`last`]}]}],"align-self":[{self:[`auto`,...D(),{baseline:[``,`last`]}]}],"place-content":[{"place-content":E()}],"place-items":[{"place-items":[...D(),`baseline`]}],"place-self":[{"place-self":[`auto`,...D()]}],p:[{p:C()}],px:[{px:C()}],py:[{py:C()}],ps:[{ps:C()}],pe:[{pe:C()}],pbs:[{pbs:C()}],pbe:[{pbe:C()}],pt:[{pt:C()}],pr:[{pr:C()}],pb:[{pb:C()}],pl:[{pl:C()}],m:[{m:O()}],mx:[{mx:O()}],my:[{my:O()}],ms:[{ms:O()}],me:[{me:O()}],mbs:[{mbs:O()}],mbe:[{mbe:O()}],mt:[{mt:O()}],mr:[{mr:O()}],mb:[{mb:O()}],ml:[{ml:O()}],"space-x":[{"space-x":C()}],"space-x-reverse":[`space-x-reverse`],"space-y":[{"space-y":C()}],"space-y-reverse":[`space-y-reverse`],size:[{size:k()}],"inline-size":[{inline:[`auto`,...A()]}],"min-inline-size":[{"min-inline":[`auto`,...A()]}],"max-inline-size":[{"max-inline":[`none`,...A()]}],"block-size":[{block:[`auto`,...j()]}],"min-block-size":[{"min-block":[`auto`,...j()]}],"max-block-size":[{"max-block":[`none`,...j()]}],w:[{w:[s,`screen`,...k()]}],"min-w":[{"min-w":[s,`screen`,`none`,...k()]}],"max-w":[{"max-w":[s,`screen`,`none`,`prose`,{screen:[o]},...k()]}],h:[{h:[`screen`,`lh`,...k()]}],"min-h":[{"min-h":[`screen`,`lh`,`none`,...k()]}],"max-h":[{"max-h":[`screen`,`lh`,`none`,...k()]}],"font-size":[{text:[`base`,n,Z,Y]}],"font-smoothing":[`antialiased`,`subpixel-antialiased`],"font-style":[`italic`,`not-italic`],"font-weight":[{font:[r,Se,fe]}],"font-stretch":[{"font-stretch":[`ultra-condensed`,`extra-condensed`,`condensed`,`semi-condensed`,`normal`,`semi-expanded`,`expanded`,`extra-expanded`,`ultra-expanded`,oe,J]}],"font-family":[{font:[_e,pe,t]}],"font-features":[{"font-features":[J]}],"fvn-normal":[`normal-nums`],"fvn-ordinal":[`ordinal`],"fvn-slashed-zero":[`slashed-zero`],"fvn-figure":[`lining-nums`,`oldstyle-nums`],"fvn-spacing":[`proportional-nums`,`tabular-nums`],"fvn-fraction":[`diagonal-fractions`,`stacked-fractions`],tracking:[{tracking:[i,X,J]}],"line-clamp":[{"line-clamp":[V,`none`,X,de]}],leading:[{leading:[`none`,a,...C()]}],"list-image":[{"list-image":[`none`,X,J]}],"list-style-position":[{list:[`inside`,`outside`]}],"list-style-type":[{list:[`disc`,`decimal`,`none`,X,J]}],"text-alignment":[{text:[`left`,`center`,`right`,`justify`,`start`,`end`]}],"placeholder-color":[{placeholder:M()}],"text-color":[{text:M()}],"text-decoration":[`underline`,`overline`,`line-through`,`no-underline`],"text-decoration-style":[{decoration:[...z(),`wavy`]}],"text-decoration-thickness":[{decoration:[V,`from-font`,`auto`,X,Y]}],"text-decoration-color":[{decoration:M()}],"underline-offset":[{"underline-offset":[V,`auto`,X,J]}],"text-transform":[`uppercase`,`lowercase`,`capitalize`,`normal-case`],"text-overflow":[`truncate`,`text-ellipsis`,`text-clip`],"text-wrap":[{text:[`wrap`,`nowrap`,`balance`,`pretty`]}],indent:[{indent:C()}],"tab-size":[{tab:[H,X,J]}],"vertical-align":[{align:[`baseline`,`top`,`middle`,`bottom`,`text-top`,`text-bottom`,`sub`,`super`,X,J]}],whitespace:[{whitespace:[`normal`,`nowrap`,`pre`,`pre-line`,`pre-wrap`,`break-spaces`]}],break:[{break:[`normal`,`words`,`all`,`keep`]}],wrap:[{wrap:[`break-word`,`anywhere`,`normal`]}],hyphens:[{hyphens:[`none`,`manual`,`auto`]}],content:[{content:[`none`,X,J]}],"bg-attachment":[{bg:[`fixed`,`local`,`scroll`]}],"bg-clip":[{"bg-clip":[`border`,`padding`,`content`,`text`]}],"bg-origin":[{"bg-origin":[`border`,`padding`,`content`]}],"bg-position":[{bg:P()}],"bg-repeat":[{bg:F()}],"bg-size":[{bg:ie()}],"bg-image":[{bg:[`none`,{linear:[{to:[`t`,`tr`,`r`,`br`,`b`,`bl`,`l`,`tl`]},H,X,J],radial:[``,X,J],conic:[``,H,X,J]},be,he]}],"bg-color":[{bg:M()}],"gradient-from-pos":[{from:I()}],"gradient-via-pos":[{via:I()}],"gradient-to-pos":[{to:I()}],"gradient-from":[{from:M()}],"gradient-via":[{via:M()}],"gradient-to":[{to:M()}],rounded:[{rounded:L()}],"rounded-s":[{"rounded-s":L()}],"rounded-e":[{"rounded-e":L()}],"rounded-t":[{"rounded-t":L()}],"rounded-r":[{"rounded-r":L()}],"rounded-b":[{"rounded-b":L()}],"rounded-l":[{"rounded-l":L()}],"rounded-ss":[{"rounded-ss":L()}],"rounded-se":[{"rounded-se":L()}],"rounded-ee":[{"rounded-ee":L()}],"rounded-es":[{"rounded-es":L()}],"rounded-tl":[{"rounded-tl":L()}],"rounded-tr":[{"rounded-tr":L()}],"rounded-br":[{"rounded-br":L()}],"rounded-bl":[{"rounded-bl":L()}],"border-w":[{border:R()}],"border-w-x":[{"border-x":R()}],"border-w-y":[{"border-y":R()}],"border-w-s":[{"border-s":R()}],"border-w-e":[{"border-e":R()}],"border-w-bs":[{"border-bs":R()}],"border-w-be":[{"border-be":R()}],"border-w-t":[{"border-t":R()}],"border-w-r":[{"border-r":R()}],"border-w-b":[{"border-b":R()}],"border-w-l":[{"border-l":R()}],"divide-x":[{"divide-x":R()}],"divide-x-reverse":[`divide-x-reverse`],"divide-y":[{"divide-y":R()}],"divide-y-reverse":[`divide-y-reverse`],"border-style":[{border:[...z(),`hidden`,`none`]}],"divide-style":[{divide:[...z(),`hidden`,`none`]}],"border-color":[{border:M()}],"border-color-x":[{"border-x":M()}],"border-color-y":[{"border-y":M()}],"border-color-s":[{"border-s":M()}],"border-color-e":[{"border-e":M()}],"border-color-bs":[{"border-bs":M()}],"border-color-be":[{"border-be":M()}],"border-color-t":[{"border-t":M()}],"border-color-r":[{"border-r":M()}],"border-color-b":[{"border-b":M()}],"border-color-l":[{"border-l":M()}],"divide-color":[{divide:M()}],"outline-style":[{outline:[...z(),`none`,`hidden`]}],"outline-offset":[{"outline-offset":[V,X,J]}],"outline-w":[{outline:[``,V,Z,Y]}],"outline-color":[{outline:M()}],shadow:[{shadow:[``,`inner`,`none`,u,xe,ge]}],"shadow-color":[{shadow:M()}],"inset-shadow":[{"inset-shadow":[`none`,d,xe,ge]}],"inset-shadow-color":[{"inset-shadow":M()}],"ring-w":[{ring:R()}],"ring-w-inset":[`ring-inset`],"ring-color":[{ring:M()}],"ring-offset-w":[{"ring-offset":[V,Y]}],"ring-offset-color":[{"ring-offset":M()}],"inset-ring-w":[{"inset-ring":R()}],"inset-ring-color":[{"inset-ring":M()}],"text-shadow":[{"text-shadow":[`none`,f,xe,ge]}],"text-shadow-color":[{"text-shadow":M()}],opacity:[{opacity:[V,X,J]}],"mix-blend":[{"mix-blend":[...ae(),`plus-darker`,`plus-lighter`]}],"bg-blend":[{"bg-blend":ae()}],"mask-clip":[{"mask-clip":[`border`,`padding`,`content`,`fill`,`stroke`,`view`]},`mask-no-clip`],"mask-composite":[{mask:[`add`,`subtract`,`intersect`,`exclude`]}],"mask-image-linear-pos":[{"mask-linear":[V]}],"mask-image-linear-from-pos":[{"mask-linear-from":W()}],"mask-image-linear-to-pos":[{"mask-linear-to":W()}],"mask-image-linear-from-color":[{"mask-linear-from":M()}],"mask-image-linear-to-color":[{"mask-linear-to":M()}],"mask-image-t-from-pos":[{"mask-t-from":W()}],"mask-image-t-to-pos":[{"mask-t-to":W()}],"mask-image-t-from-color":[{"mask-t-from":M()}],"mask-image-t-to-color":[{"mask-t-to":M()}],"mask-image-r-from-pos":[{"mask-r-from":W()}],"mask-image-r-to-pos":[{"mask-r-to":W()}],"mask-image-r-from-color":[{"mask-r-from":M()}],"mask-image-r-to-color":[{"mask-r-to":M()}],"mask-image-b-from-pos":[{"mask-b-from":W()}],"mask-image-b-to-pos":[{"mask-b-to":W()}],"mask-image-b-from-color":[{"mask-b-from":M()}],"mask-image-b-to-color":[{"mask-b-to":M()}],"mask-image-l-from-pos":[{"mask-l-from":W()}],"mask-image-l-to-pos":[{"mask-l-to":W()}],"mask-image-l-from-color":[{"mask-l-from":M()}],"mask-image-l-to-color":[{"mask-l-to":M()}],"mask-image-x-from-pos":[{"mask-x-from":W()}],"mask-image-x-to-pos":[{"mask-x-to":W()}],"mask-image-x-from-color":[{"mask-x-from":M()}],"mask-image-x-to-color":[{"mask-x-to":M()}],"mask-image-y-from-pos":[{"mask-y-from":W()}],"mask-image-y-to-pos":[{"mask-y-to":W()}],"mask-image-y-from-color":[{"mask-y-from":M()}],"mask-image-y-to-color":[{"mask-y-to":M()}],"mask-image-radial":[{"mask-radial":[X,J]}],"mask-image-radial-from-pos":[{"mask-radial-from":W()}],"mask-image-radial-to-pos":[{"mask-radial-to":W()}],"mask-image-radial-from-color":[{"mask-radial-from":M()}],"mask-image-radial-to-color":[{"mask-radial-to":M()}],"mask-image-radial-shape":[{"mask-radial":[`circle`,`ellipse`]}],"mask-image-radial-size":[{"mask-radial":[{closest:[`side`,`corner`],farthest:[`side`,`corner`]}]}],"mask-image-radial-pos":[{"mask-radial-at":y()}],"mask-image-conic-pos":[{"mask-conic":[V]}],"mask-image-conic-from-pos":[{"mask-conic-from":W()}],"mask-image-conic-to-pos":[{"mask-conic-to":W()}],"mask-image-conic-from-color":[{"mask-conic-from":M()}],"mask-image-conic-to-color":[{"mask-conic-to":M()}],"mask-mode":[{mask:[`alpha`,`luminance`,`match`]}],"mask-origin":[{"mask-origin":[`border`,`padding`,`content`,`fill`,`stroke`,`view`]}],"mask-position":[{mask:P()}],"mask-repeat":[{mask:F()}],"mask-size":[{mask:ie()}],"mask-type":[{"mask-type":[`alpha`,`luminance`]}],"mask-image":[{mask:[`none`,X,J]}],filter:[{filter:[``,`none`,X,J]}],blur:[{blur:G()}],brightness:[{brightness:[V,X,J]}],contrast:[{contrast:[V,X,J]}],"drop-shadow":[{"drop-shadow":[``,`none`,p,xe,ge]}],"drop-shadow-color":[{"drop-shadow":M()}],grayscale:[{grayscale:[``,V,X,J]}],"hue-rotate":[{"hue-rotate":[V,X,J]}],invert:[{invert:[``,V,X,J]}],saturate:[{saturate:[V,X,J]}],sepia:[{sepia:[``,V,X,J]}],"backdrop-filter":[{"backdrop-filter":[``,`none`,X,J]}],"backdrop-blur":[{"backdrop-blur":G()}],"backdrop-brightness":[{"backdrop-brightness":[V,X,J]}],"backdrop-contrast":[{"backdrop-contrast":[V,X,J]}],"backdrop-grayscale":[{"backdrop-grayscale":[``,V,X,J]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[V,X,J]}],"backdrop-invert":[{"backdrop-invert":[``,V,X,J]}],"backdrop-opacity":[{"backdrop-opacity":[V,X,J]}],"backdrop-saturate":[{"backdrop-saturate":[V,X,J]}],"backdrop-sepia":[{"backdrop-sepia":[``,V,X,J]}],"border-collapse":[{border:[`collapse`,`separate`]}],"border-spacing":[{"border-spacing":C()}],"border-spacing-x":[{"border-spacing-x":C()}],"border-spacing-y":[{"border-spacing-y":C()}],"table-layout":[{table:[`auto`,`fixed`]}],caption:[{caption:[`top`,`bottom`]}],transition:[{transition:[``,`all`,`colors`,`opacity`,`shadow`,`transform`,`none`,X,J]}],"transition-behavior":[{transition:[`normal`,`discrete`]}],duration:[{duration:[V,`initial`,X,J]}],ease:[{ease:[`linear`,`initial`,_,X,J]}],delay:[{delay:[V,X,J]}],animate:[{animate:[`none`,ee,X,J]}],backface:[{backface:[`hidden`,`visible`]}],perspective:[{perspective:[h,X,J]}],"perspective-origin":[{"perspective-origin":b()}],rotate:[{rotate:K()}],"rotate-x":[{"rotate-x":K()}],"rotate-y":[{"rotate-y":K()}],"rotate-z":[{"rotate-z":K()}],scale:[{scale:q()}],"scale-x":[{"scale-x":q()}],"scale-y":[{"scale-y":q()}],"scale-z":[{"scale-z":q()}],"scale-3d":[`scale-3d`],skew:[{skew:Q()}],"skew-x":[{"skew-x":Q()}],"skew-y":[{"skew-y":Q()}],transform:[{transform:[X,J,``,`none`,`gpu`,`cpu`]}],"transform-origin":[{origin:b()}],"transform-style":[{transform:[`3d`,`flat`]}],translate:[{translate:$()}],"translate-x":[{"translate-x":$()}],"translate-y":[{"translate-y":$()}],"translate-z":[{"translate-z":$()}],"translate-none":[`translate-none`],zoom:[{zoom:[H,X,J]}],accent:[{accent:M()}],appearance:[{appearance:[`none`,`auto`]}],"caret-color":[{caret:M()}],"color-scheme":[{scheme:[`normal`,`dark`,`light`,`light-dark`,`only-dark`,`only-light`]}],cursor:[{cursor:[`auto`,`default`,`pointer`,`wait`,`text`,`move`,`help`,`not-allowed`,`none`,`context-menu`,`progress`,`cell`,`crosshair`,`vertical-text`,`alias`,`copy`,`no-drop`,`grab`,`grabbing`,`all-scroll`,`col-resize`,`row-resize`,`n-resize`,`e-resize`,`s-resize`,`w-resize`,`ne-resize`,`nw-resize`,`se-resize`,`sw-resize`,`ew-resize`,`ns-resize`,`nesw-resize`,`nwse-resize`,`zoom-in`,`zoom-out`,X,J]}],"field-sizing":[{"field-sizing":[`fixed`,`content`]}],"pointer-events":[{"pointer-events":[`auto`,`none`]}],resize:[{resize:[`none`,``,`y`,`x`]}],"scroll-behavior":[{scroll:[`auto`,`smooth`]}],"scrollbar-thumb-color":[{"scrollbar-thumb":M()}],"scrollbar-track-color":[{"scrollbar-track":M()}],"scrollbar-gutter":[{"scrollbar-gutter":[`auto`,`stable`,`both`]}],"scrollbar-w":[{scrollbar:[`auto`,`thin`,`none`]}],"scroll-m":[{"scroll-m":C()}],"scroll-mx":[{"scroll-mx":C()}],"scroll-my":[{"scroll-my":C()}],"scroll-ms":[{"scroll-ms":C()}],"scroll-me":[{"scroll-me":C()}],"scroll-mbs":[{"scroll-mbs":C()}],"scroll-mbe":[{"scroll-mbe":C()}],"scroll-mt":[{"scroll-mt":C()}],"scroll-mr":[{"scroll-mr":C()}],"scroll-mb":[{"scroll-mb":C()}],"scroll-ml":[{"scroll-ml":C()}],"scroll-p":[{"scroll-p":C()}],"scroll-px":[{"scroll-px":C()}],"scroll-py":[{"scroll-py":C()}],"scroll-ps":[{"scroll-ps":C()}],"scroll-pe":[{"scroll-pe":C()}],"scroll-pbs":[{"scroll-pbs":C()}],"scroll-pbe":[{"scroll-pbe":C()}],"scroll-pt":[{"scroll-pt":C()}],"scroll-pr":[{"scroll-pr":C()}],"scroll-pb":[{"scroll-pb":C()}],"scroll-pl":[{"scroll-pl":C()}],"snap-align":[{snap:[`start`,`end`,`center`,`align-none`]}],"snap-stop":[{snap:[`normal`,`always`]}],"snap-type":[{snap:[`none`,`x`,`y`,`both`]}],"snap-strictness":[{snap:[`mandatory`,`proximity`]}],touch:[{touch:[`auto`,`none`,`manipulation`]}],"touch-x":[{"touch-pan":[`x`,`left`,`right`]}],"touch-y":[{"touch-pan":[`y`,`up`,`down`]}],"touch-pz":[`touch-pinch-zoom`],select:[{select:[`none`,`text`,`all`,`auto`]}],"will-change":[{"will-change":[`auto`,`scroll`,`contents`,`transform`,X,J]}],fill:[{fill:[`none`,...M()]}],"stroke-w":[{stroke:[V,Z,Y,de]}],stroke:[{stroke:[`none`,...M()]}],"forced-color-adjust":[{"forced-color-adjust":[`auto`,`none`]}]},conflictingClassGroups:{"container-named":[`container-type`],overflow:[`overflow-x`,`overflow-y`],overscroll:[`overscroll-x`,`overscroll-y`],inset:[`inset-x`,`inset-y`,`inset-bs`,`inset-be`,`start`,`end`,`top`,`right`,`bottom`,`left`],"inset-x":[`start`,`end`,`right`,`left`],"inset-y":[`inset-bs`,`inset-be`,`top`,`bottom`],flex:[`basis`,`grow`,`shrink`],gap:[`gap-x`,`gap-y`],p:[`px`,`py`,`ps`,`pe`,`pbs`,`pbe`,`pt`,`pr`,`pb`,`pl`],px:[`ps`,`pe`,`pr`,`pl`],py:[`pbs`,`pbe`,`pt`,`pb`],m:[`mx`,`my`,`ms`,`me`,`mbs`,`mbe`,`mt`,`mr`,`mb`,`ml`],mx:[`ms`,`me`,`mr`,`ml`],my:[`mbs`,`mbe`,`mt`,`mb`],size:[`w`,`h`],"font-size":[`leading`],"fvn-normal":[`fvn-ordinal`,`fvn-slashed-zero`,`fvn-figure`,`fvn-spacing`,`fvn-fraction`],"fvn-ordinal":[`fvn-normal`],"fvn-slashed-zero":[`fvn-normal`],"fvn-figure":[`fvn-normal`],"fvn-spacing":[`fvn-normal`],"fvn-fraction":[`fvn-normal`],"line-clamp":[`display`,`overflow`],rounded:[`rounded-s`,`rounded-e`,`rounded-t`,`rounded-r`,`rounded-b`,`rounded-l`,`rounded-ss`,`rounded-se`,`rounded-ee`,`rounded-es`,`rounded-tl`,`rounded-tr`,`rounded-br`,`rounded-bl`],"rounded-s":[`rounded-ss`,`rounded-es`],"rounded-e":[`rounded-se`,`rounded-ee`],"rounded-t":[`rounded-tl`,`rounded-tr`],"rounded-r":[`rounded-tr`,`rounded-br`],"rounded-b":[`rounded-br`,`rounded-bl`],"rounded-l":[`rounded-tl`,`rounded-bl`],"border-spacing":[`border-spacing-x`,`border-spacing-y`],"border-w":[`border-w-x`,`border-w-y`,`border-w-s`,`border-w-e`,`border-w-bs`,`border-w-be`,`border-w-t`,`border-w-r`,`border-w-b`,`border-w-l`],"border-w-x":[`border-w-s`,`border-w-e`,`border-w-r`,`border-w-l`],"border-w-y":[`border-w-bs`,`border-w-be`,`border-w-t`,`border-w-b`],"border-color":[`border-color-x`,`border-color-y`,`border-color-s`,`border-color-e`,`border-color-bs`,`border-color-be`,`border-color-t`,`border-color-r`,`border-color-b`,`border-color-l`],"border-color-x":[`border-color-s`,`border-color-e`,`border-color-r`,`border-color-l`],"border-color-y":[`border-color-bs`,`border-color-be`,`border-color-t`,`border-color-b`],translate:[`translate-x`,`translate-y`,`translate-none`],"translate-none":[`translate`,`translate-x`,`translate-y`,`translate-z`],"scroll-m":[`scroll-mx`,`scroll-my`,`scroll-ms`,`scroll-me`,`scroll-mbs`,`scroll-mbe`,`scroll-mt`,`scroll-mr`,`scroll-mb`,`scroll-ml`],"scroll-mx":[`scroll-ms`,`scroll-me`,`scroll-mr`,`scroll-ml`],"scroll-my":[`scroll-mbs`,`scroll-mbe`,`scroll-mt`,`scroll-mb`],"scroll-p":[`scroll-px`,`scroll-py`,`scroll-ps`,`scroll-pe`,`scroll-pbs`,`scroll-pbe`,`scroll-pt`,`scroll-pr`,`scroll-pb`,`scroll-pl`],"scroll-px":[`scroll-ps`,`scroll-pe`,`scroll-pr`,`scroll-pl`],"scroll-py":[`scroll-pbs`,`scroll-pbe`,`scroll-pt`,`scroll-pb`],touch:[`touch-x`,`touch-y`,`touch-pz`],"touch-x":[`touch`],"touch-y":[`touch`],"touch-pz":[`touch`]},conflictingClassGroupModifiers:{"font-size":[`leading`]},postfixLookupClassGroups:[`container-type`],orderSensitiveModifiers:[`*`,`**`,`after`,`backdrop`,`before`,`details-content`,`file`,`first-letter`,`first-line`,`marker`,`placeholder`,`selection`]}}),Me=e(t(),1),Ne=e=>{let t,n=new Set,r=(e,r)=>{let i=typeof e==`function`?e(t):e;if(!Object.is(i,t)){let e=t;t=r??(typeof i!=`object`||!i)?i:Object.assign({},t,i),n.forEach(n=>n(t,e))}},i=()=>t,a={setState:r,getState:i,getInitialState:()=>o,subscribe:e=>(n.add(e),()=>n.delete(e))},o=t=e(r,i,a);return a},Pe=(e=>e?Ne(e):Ne),Fe=e=>e;function Ie(e,t=Fe){let n=Me.useSyncExternalStore(e.subscribe,Me.useCallback(()=>t(e.getState()),[e,t]),Me.useCallback(()=>t(e.getInitialState()),[e,t]));return Me.useDebugValue(n),n}var Le=e=>{let t=Pe(e),n=e=>Ie(t,e);return Object.assign(n,t),n},Re=(e=>e?Le(e):Le);function ze(e,t){let n;try{n=e()}catch{return}return{getItem:e=>{let r=e=>e===null?null:JSON.parse(e,t?.reviver),i=n.getItem(e)??null;return i instanceof Promise?i.then(r):r(i)},setItem:(e,r)=>n.setItem(e,JSON.stringify(r,t?.replacer)),removeItem:e=>n.removeItem(e)}}var Be=e=>t=>{try{let n=e(t);return n instanceof Promise?n:{then(e){return Be(e)(n)},catch(e){return this}}}catch(e){return{then(e){return this},catch(t){return Be(t)(e)}}}},Ve=(e,t)=>(n,r,i)=>{let a={storage:ze(()=>window.localStorage),partialize:e=>e,version:0,merge:(e,t)=>({...t,...e}),...t},o=!1,s=0,c=new Set,l=new Set,u=a.storage;if(!u)return e((...e)=>{console.warn(`[zustand persist middleware] Unable to update item '${a.name}', the given storage is currently unavailable.`),n(...e)},r,i);let d=()=>{let e=a.partialize({...r()});return u.setItem(a.name,{state:e,version:a.version})},f=i.setState;i.setState=(e,t)=>(f(e,t),d());let p=e((...e)=>(n(...e),d()),r,i);i.getInitialState=()=>p;let m,h=()=>{if(!u)return;let e=++s;o=!1,c.forEach(e=>e(r()??p));let t=a.onRehydrateStorage?.call(a,r()??p)||void 0;return Be(u.getItem.bind(u))(a.name).then(e=>{if(e){if(typeof e.version==`number`&&e.version!==a.version){if(a.migrate){let t=a.migrate(e.state,e.version);return t instanceof Promise?t.then(e=>[!0,e]):[!0,t]}console.error(`State loaded from storage couldn't be migrated since no migrate function was provided`)}else return[!1,e.state]}return[!1,void 0]}).then(t=>{if(e!==s)return;let[i,o]=t;if(m=a.merge(o,r()??p),n(m,!0),i)return d()}).then(()=>{e===s&&(t?.(r(),void 0),m=r(),o=!0,l.forEach(e=>e(m)))}).catch(n=>{e===s&&t?.(void 0,n)})};return i.persist={setOptions:e=>{a={...a,...e},e.storage&&(u=e.storage)},clearStorage:()=>{++s,u?.removeItem(a.name)},getOptions:()=>a,rehydrate:()=>h(),hasHydrated:()=>o,onHydrate:e=>(c.add(e),()=>{c.delete(e)}),onFinishHydration:e=>(l.add(e),()=>{l.delete(e)})},a.skipHydration||h(),m||p};export{r as i,Re as n,je as r,Ve as t};
1
+ import{r as e}from"./rolldown-runtime-hePW80VL.js";import{i as t}from"./react-vendor-CR5VJ85Q.js";function n(e){var t,r,i=``;if(typeof e==`string`||typeof e==`number`)i+=e;else if(typeof e==`object`){if(Array.isArray(e)){var a=e.length;for(t=0;t<a;t++)e[t]&&(r=n(e[t]))&&(i&&(i+=` `),i+=r)}else for(r in e)e[r]&&(i&&(i+=` `),i+=r)}return i}function r(){for(var e,t,r=0,i=``,a=arguments.length;r<a;r++)(e=arguments[r])&&(t=n(e))&&(i&&(i+=` `),i+=t);return i}var i=(e,t)=>{let n=Array(e.length+t.length);for(let t=0;t<e.length;t++)n[t]=e[t];for(let r=0;r<t.length;r++)n[e.length+r]=t[r];return n},a=(e,t)=>({classGroupId:e,validator:t}),o=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),s=`-`,c=[],l=`arbitrary..`,u=e=>{let t=p(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:e=>{if(e.startsWith(`[`)&&e.endsWith(`]`))return f(e);let n=e.split(s);return d(n,+(n[0]===``&&n.length>1),t)},getConflictingClassGroupIds:(e,t)=>{if(t){let t=r[e],a=n[e];return t?a?i(a,t):t:a||c}return n[e]||c}}},d=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;let r=e[t],i=n.nextPart.get(r);if(i){let n=d(e,t+1,i);if(n)return n}let a=n.validators;if(a===null)return;let o=t===0?e.join(s):e.slice(t).join(s),c=a.length;for(let e=0;e<c;e++){let t=a[e];if(t.validator(o))return t.classGroupId}},f=e=>e.slice(1,-1).indexOf(`:`)===-1?void 0:(()=>{let t=e.slice(1,-1),n=t.indexOf(`:`),r=t.slice(0,n);return r?l+r:void 0})(),p=e=>{let{theme:t,classGroups:n}=e;return m(n,t)},m=(e,t)=>{let n=o();for(let r in e){let i=e[r];h(i,n,r,t)}return n},h=(e,t,n,r)=>{let i=e.length;for(let a=0;a<i;a++){let i=e[a];g(i,t,n,r)}},g=(e,t,n,r)=>{if(typeof e==`string`){_(e,t,n);return}if(typeof e==`function`){ee(e,t,n,r);return}v(e,t,n,r)},_=(e,t,n)=>{let r=e===``?t:y(t,e);r.classGroupId=n},ee=(e,t,n,r)=>{if(b(e)){h(e(r),t,n,r);return}t.validators===null&&(t.validators=[]),t.validators.push(a(n,e))},v=(e,t,n,r)=>{let i=Object.entries(e),a=i.length;for(let e=0;e<a;e++){let[a,o]=i[e];h(o,y(t,a),n,r)}},y=(e,t)=>{let n=e,r=t.split(s),i=r.length;for(let e=0;e<i;e++){let t=r[e],i=n.nextPart.get(t);i||(i=o(),n.nextPart.set(t,i)),n=i}return n},b=e=>`isThemeGetter`in e&&e.isThemeGetter===!0,x=e=>{if(e<1)return{get:()=>void 0,set:()=>{}};let t=0,n=Object.create(null),r=Object.create(null),i=(i,a)=>{n[i]=a,t++,t>e&&(t=0,r=n,n=Object.create(null))};return{get(e){let t=n[e];if(t!==void 0)return t;if((t=r[e])!==void 0)return i(e,t),t},set(e,t){e in n?n[e]=t:i(e,t)}}},S=`!`,C=`:`,w=[],te=(e,t,n,r,i)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:i}),ne=e=>{let{prefix:t,experimentalParseClassName:n}=e,r=e=>{let t=[],n=0,r=0,i=0,a,o=e.length;for(let s=0;s<o;s++){let o=e[s];if(n===0&&r===0){if(o===C){t.push(e.slice(i,s)),i=s+1;continue}if(o===`/`){a=s;continue}}o===`[`?n++:o===`]`?n--:o===`(`?r++:o===`)`&&r--}let s=t.length===0?e:e.slice(i),c=s,l=!1;s.endsWith(S)?(c=s.slice(0,-1),l=!0):s.startsWith(S)&&(c=s.slice(1),l=!0);let u=a&&a>i?a-i:void 0;return te(t,l,c,u)};if(t){let e=t+C,n=r;r=t=>t.startsWith(e)?n(t.slice(e.length)):te(w,!1,t,void 0,!0)}if(n){let e=r;r=t=>n({className:t,parseClassName:e})}return r},T=e=>{let t=new Map;return e.orderSensitiveModifiers.forEach((e,n)=>{t.set(e,1e6+n)}),e=>{let n=[],r=[];for(let i=0;i<e.length;i++){let a=e[i],o=a[0]===`[`,s=t.has(a);o||s?(r.length>0&&(r.sort(),n.push(...r),r=[]),n.push(a)):r.push(a)}return r.length>0&&(r.sort(),n.push(...r)),n}},re=e=>({cache:x(e.cacheSize),parseClassName:ne(e),sortModifiers:T(e),postfixLookupClassGroupIds:E(e),...u(e)}),E=e=>{let t=Object.create(null),n=e.postfixLookupClassGroups;if(n)for(let e=0;e<n.length;e++)t[n[e]]=!0;return t},D=/\s+/,O=(e,t)=>{let{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:i,sortModifiers:a,postfixLookupClassGroupIds:o}=t,s=[],c=e.trim().split(D),l=``;for(let e=c.length-1;e>=0;--e){let t=c[e],{isExternal:u,modifiers:d,hasImportantModifier:f,baseClassName:p,maybePostfixModifierPosition:m}=n(t);if(u){l=t+(l.length>0?` `+l:l);continue}let h=!!m,g;if(h){g=r(p.substring(0,m));let e=g&&o[g]?r(p):void 0;e&&e!==g&&(g=e,h=!1)}else g=r(p);if(!g){if(!h){l=t+(l.length>0?` `+l:l);continue}if(g=r(p),!g){l=t+(l.length>0?` `+l:l);continue}h=!1}let _=d.length===0?``:d.length===1?d[0]:a(d).join(`:`),ee=f?_+S:_,v=ee+g;if(s.indexOf(v)>-1)continue;s.push(v);let y=i(g,h);for(let e=0;e<y.length;++e){let t=y[e];s.push(ee+t)}l=t+(l.length>0?` `+l:l)}return l},k=(...e)=>{let t=0,n,r,i=``;for(;t<e.length;)(n=e[t++])&&(r=A(n))&&(i&&(i+=` `),i+=r);return i},A=e=>{if(typeof e==`string`)return e;let t,n=``;for(let r=0;r<e.length;r++)e[r]&&(t=A(e[r]))&&(n&&(n+=` `),n+=t);return n},j=(e,...t)=>{let n,r,i,a,o=o=>(n=re(t.reduce((e,t)=>t(e),e())),r=n.cache.get,i=n.cache.set,a=s,s(o)),s=e=>{let t=r(e);if(t)return t;let a=O(e,n);return i(e,a),a};return a=o,(...e)=>a(k(...e))},M=[],N=e=>{let t=t=>t[e]||M;return t.isThemeGetter=!0,t.themeKey=e,t},P=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,F=/^\((?:(\w[\w-]*):)?(.+)\)$/i,ie=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,I=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,L=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,R=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix|color|light-dark)\(.+\)$/,z=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,ae=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,B=e=>ie.test(e),V=e=>!!e&&!Number.isNaN(Number(e)),H=e=>!!e&&Number.isInteger(Number(e)),oe=e=>e.endsWith(`%`)&&V(e.slice(0,-1)),U=e=>I.test(e),se=()=>!0,W=e=>L.test(e)&&!R.test(e),G=()=>!1,K=e=>z.test(e),q=e=>ae.test(e),ce=e=>!J(e)&&!X(e),le=e=>e.startsWith(`@container`)&&(e[10]===`/`&&e[11]!==void 0||e[11]===`s`&&e[16]!==void 0&&e.startsWith(`-size/`,10)||e[11]===`n`&&e[18]!==void 0&&e.startsWith(`-normal/`,10)),ue=e=>Q(e,Te,G),J=e=>P.test(e),Y=e=>Q(e,Ee,W),de=e=>Q(e,De,V),fe=e=>Q(e,ke,se),pe=e=>Q(e,Oe,G),me=e=>Q(e,Ce,G),he=e=>Q(e,we,q),ge=e=>Q(e,Ae,K),X=e=>F.test(e),Z=e=>$(e,Ee),_e=e=>$(e,Oe),ve=e=>$(e,Ce),ye=e=>$(e,Te),be=e=>$(e,we),xe=e=>$(e,Ae,!0),Se=e=>$(e,ke,!0),Q=(e,t,n)=>{let r=P.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},$=(e,t,n=!1)=>{let r=F.exec(e);return r?r[1]?t(r[1]):n:!1},Ce=e=>e===`position`||e===`percentage`,we=e=>e===`image`||e===`url`,Te=e=>e===`length`||e===`size`||e===`bg-size`,Ee=e=>e===`length`,De=e=>e===`number`,Oe=e=>e===`family-name`,ke=e=>e===`number`||e===`weight`,Ae=e=>e===`shadow`,je=j(()=>{let e=N(`color`),t=N(`font`),n=N(`text`),r=N(`font-weight`),i=N(`tracking`),a=N(`leading`),o=N(`breakpoint`),s=N(`container`),c=N(`spacing`),l=N(`radius`),u=N(`shadow`),d=N(`inset-shadow`),f=N(`text-shadow`),p=N(`drop-shadow`),m=N(`blur`),h=N(`perspective`),g=N(`aspect`),_=N(`ease`),ee=N(`animate`),v=()=>[`auto`,`avoid`,`all`,`avoid-page`,`page`,`left`,`right`,`column`],y=()=>[`center`,`top`,`bottom`,`left`,`right`,`top-left`,`left-top`,`top-right`,`right-top`,`bottom-right`,`right-bottom`,`bottom-left`,`left-bottom`],b=()=>[...y(),X,J],x=()=>[`auto`,`hidden`,`clip`,`visible`,`scroll`],S=()=>[`auto`,`contain`,`none`],C=()=>[X,J,c],w=()=>[B,`full`,`auto`,...C()],te=()=>[H,`none`,`subgrid`,X,J],ne=()=>[`auto`,{span:[`full`,H,X,J]},H,X,J],T=()=>[H,`auto`,X,J],re=()=>[`auto`,`min`,`max`,`fr`,X,J],E=()=>[`start`,`end`,`center`,`between`,`around`,`evenly`,`stretch`,`baseline`,`center-safe`,`end-safe`],D=()=>[`start`,`end`,`center`,`stretch`,`center-safe`,`end-safe`],O=()=>[`auto`,...C()],k=()=>[B,`auto`,`full`,`dvw`,`dvh`,`lvw`,`lvh`,`svw`,`svh`,`min`,`max`,`fit`,...C()],A=()=>[s,B,`screen`,`full`,`dvw`,`lvw`,`svw`,`min`,`max`,`fit`,...C()],j=()=>[B,`screen`,`full`,`lh`,`dvh`,`lvh`,`svh`,`min`,`max`,`fit`,...C()],M=()=>[e,X,J],P=()=>[...y(),ve,me,{position:[X,J]}],F=()=>[`no-repeat`,{repeat:[``,`x`,`y`,`space`,`round`]}],ie=()=>[`auto`,`cover`,`contain`,ye,ue,{size:[X,J]}],I=()=>[oe,Z,Y],L=()=>[``,`none`,`full`,l,X,J],R=()=>[``,V,Z,Y],z=()=>[`solid`,`dashed`,`dotted`,`double`],ae=()=>[`normal`,`multiply`,`screen`,`overlay`,`darken`,`lighten`,`color-dodge`,`color-burn`,`hard-light`,`soft-light`,`difference`,`exclusion`,`hue`,`saturation`,`color`,`luminosity`],W=()=>[V,oe,ve,me],G=()=>[``,`none`,m,X,J],K=()=>[`none`,V,X,J],q=()=>[`none`,V,X,J],Q=()=>[V,X,J],$=()=>[B,`full`,...C()];return{cacheSize:500,theme:{animate:[`spin`,`ping`,`pulse`,`bounce`],aspect:[`video`],blur:[U],breakpoint:[U],color:[se],container:[U],"drop-shadow":[U],ease:[`in`,`out`,`in-out`],font:[ce],"font-weight":[`thin`,`extralight`,`light`,`normal`,`medium`,`semibold`,`bold`,`extrabold`,`black`],"inset-shadow":[U],leading:[`none`,`tight`,`snug`,`normal`,`relaxed`,`loose`],perspective:[`dramatic`,`near`,`normal`,`midrange`,`distant`,`none`],radius:[U],shadow:[U],spacing:[`px`,V],text:[U],"text-shadow":[U],tracking:[`tighter`,`tight`,`normal`,`wide`,`wider`,`widest`]},classGroups:{aspect:[{aspect:[`auto`,`square`,B,J,X,g]}],container:[`container`],"container-type":[{"@container":[``,`normal`,`size`,X,J]}],"container-named":[le],columns:[{columns:[V,`auto`,J,X,s]}],"break-after":[{"break-after":v()}],"break-before":[{"break-before":v()}],"break-inside":[{"break-inside":[`auto`,`avoid`,`avoid-page`,`avoid-column`]}],"box-decoration":[{"box-decoration":[`slice`,`clone`]}],box:[{box:[`border`,`content`]}],display:[`block`,`inline-block`,`inline`,`flex`,`inline-flex`,`table`,`inline-table`,`table-caption`,`table-cell`,`table-column`,`table-column-group`,`table-footer-group`,`table-header-group`,`table-row-group`,`table-row`,`flow-root`,`grid`,`inline-grid`,`contents`,`list-item`,`hidden`],sr:[`sr-only`,`not-sr-only`],float:[{float:[`right`,`left`,`none`,`start`,`end`]}],clear:[{clear:[`left`,`right`,`both`,`none`,`start`,`end`]}],isolation:[`isolate`,`isolation-auto`],"object-fit":[{object:[`contain`,`cover`,`fill`,`none`,`scale-down`]}],"object-position":[{object:b()}],overflow:[{overflow:x()}],"overflow-x":[{"overflow-x":x()}],"overflow-y":[{"overflow-y":x()}],overscroll:[{overscroll:S()}],"overscroll-x":[{"overscroll-x":S()}],"overscroll-y":[{"overscroll-y":S()}],position:[`static`,`fixed`,`absolute`,`relative`,`sticky`],inset:[{inset:w()}],"inset-x":[{"inset-x":w()}],"inset-y":[{"inset-y":w()}],start:[{"inset-s":w(),start:w()}],end:[{"inset-e":w(),end:w()}],"inset-bs":[{"inset-bs":w()}],"inset-be":[{"inset-be":w()}],top:[{top:w()}],right:[{right:w()}],bottom:[{bottom:w()}],left:[{left:w()}],visibility:[`visible`,`invisible`,`collapse`],z:[{z:[H,`auto`,X,J]}],basis:[{basis:[B,`full`,`auto`,s,...C()]}],"flex-direction":[{flex:[`row`,`row-reverse`,`col`,`col-reverse`]}],"flex-wrap":[{flex:[`nowrap`,`wrap`,`wrap-reverse`]}],flex:[{flex:[V,B,`auto`,`initial`,`none`,J]}],grow:[{grow:[``,V,X,J]}],shrink:[{shrink:[``,V,X,J]}],order:[{order:[H,`first`,`last`,`none`,X,J]}],"grid-cols":[{"grid-cols":te()}],"col-start-end":[{col:ne()}],"col-start":[{"col-start":T()}],"col-end":[{"col-end":T()}],"grid-rows":[{"grid-rows":te()}],"row-start-end":[{row:ne()}],"row-start":[{"row-start":T()}],"row-end":[{"row-end":T()}],"grid-flow":[{"grid-flow":[`row`,`col`,`dense`,`row-dense`,`col-dense`]}],"auto-cols":[{"auto-cols":re()}],"auto-rows":[{"auto-rows":re()}],gap:[{gap:C()}],"gap-x":[{"gap-x":C()}],"gap-y":[{"gap-y":C()}],"justify-content":[{justify:[...E(),`normal`]}],"justify-items":[{"justify-items":[...D(),`normal`]}],"justify-self":[{"justify-self":[`auto`,...D()]}],"align-content":[{content:[`normal`,...E()]}],"align-items":[{items:[...D(),{baseline:[``,`last`]}]}],"align-self":[{self:[`auto`,...D(),{baseline:[``,`last`]}]}],"place-content":[{"place-content":E()}],"place-items":[{"place-items":[...D(),`baseline`]}],"place-self":[{"place-self":[`auto`,...D()]}],p:[{p:C()}],px:[{px:C()}],py:[{py:C()}],ps:[{ps:C()}],pe:[{pe:C()}],pbs:[{pbs:C()}],pbe:[{pbe:C()}],pt:[{pt:C()}],pr:[{pr:C()}],pb:[{pb:C()}],pl:[{pl:C()}],m:[{m:O()}],mx:[{mx:O()}],my:[{my:O()}],ms:[{ms:O()}],me:[{me:O()}],mbs:[{mbs:O()}],mbe:[{mbe:O()}],mt:[{mt:O()}],mr:[{mr:O()}],mb:[{mb:O()}],ml:[{ml:O()}],"space-x":[{"space-x":C()}],"space-x-reverse":[`space-x-reverse`],"space-y":[{"space-y":C()}],"space-y-reverse":[`space-y-reverse`],size:[{size:k()}],"inline-size":[{inline:[`auto`,...A()]}],"min-inline-size":[{"min-inline":[`auto`,...A()]}],"max-inline-size":[{"max-inline":[`none`,...A()]}],"block-size":[{block:[`auto`,...j()]}],"min-block-size":[{"min-block":[`auto`,...j()]}],"max-block-size":[{"max-block":[`none`,...j()]}],w:[{w:[s,`screen`,...k()]}],"min-w":[{"min-w":[s,`screen`,`none`,...k()]}],"max-w":[{"max-w":[s,`screen`,`none`,`prose`,{screen:[o]},...k()]}],h:[{h:[`screen`,`lh`,...k()]}],"min-h":[{"min-h":[`screen`,`lh`,`none`,...k()]}],"max-h":[{"max-h":[`screen`,`lh`,`none`,...k()]}],"font-size":[{text:[`base`,n,Z,Y]}],"font-smoothing":[`antialiased`,`subpixel-antialiased`],"font-style":[`italic`,`not-italic`],"font-weight":[{font:[r,Se,fe]}],"font-stretch":[{"font-stretch":[`ultra-condensed`,`extra-condensed`,`condensed`,`semi-condensed`,`normal`,`semi-expanded`,`expanded`,`extra-expanded`,`ultra-expanded`,oe,J]}],"font-family":[{font:[_e,pe,t]}],"font-features":[{"font-features":[J]}],"fvn-normal":[`normal-nums`],"fvn-ordinal":[`ordinal`],"fvn-slashed-zero":[`slashed-zero`],"fvn-figure":[`lining-nums`,`oldstyle-nums`],"fvn-spacing":[`proportional-nums`,`tabular-nums`],"fvn-fraction":[`diagonal-fractions`,`stacked-fractions`],tracking:[{tracking:[i,X,J]}],"line-clamp":[{"line-clamp":[V,`none`,X,de]}],leading:[{leading:[`none`,a,...C()]}],"list-image":[{"list-image":[`none`,X,J]}],"list-style-position":[{list:[`inside`,`outside`]}],"list-style-type":[{list:[`disc`,`decimal`,`none`,X,J]}],"text-alignment":[{text:[`left`,`center`,`right`,`justify`,`start`,`end`]}],"placeholder-color":[{placeholder:M()}],"text-color":[{text:M()}],"text-decoration":[`underline`,`overline`,`line-through`,`no-underline`],"text-decoration-style":[{decoration:[...z(),`wavy`]}],"text-decoration-thickness":[{decoration:[V,`from-font`,`auto`,X,Y]}],"text-decoration-color":[{decoration:M()}],"underline-offset":[{"underline-offset":[V,`auto`,X,J]}],"text-transform":[`uppercase`,`lowercase`,`capitalize`,`normal-case`],"text-overflow":[`truncate`,`text-ellipsis`,`text-clip`],"text-wrap":[{text:[`wrap`,`nowrap`,`balance`,`pretty`]}],indent:[{indent:C()}],"tab-size":[{tab:[H,X,J]}],"vertical-align":[{align:[`baseline`,`top`,`middle`,`bottom`,`text-top`,`text-bottom`,`sub`,`super`,X,J]}],whitespace:[{whitespace:[`normal`,`nowrap`,`pre`,`pre-line`,`pre-wrap`,`break-spaces`]}],break:[{break:[`normal`,`words`,`all`,`keep`]}],wrap:[{wrap:[`break-word`,`anywhere`,`normal`]}],hyphens:[{hyphens:[`none`,`manual`,`auto`]}],content:[{content:[`none`,X,J]}],"bg-attachment":[{bg:[`fixed`,`local`,`scroll`]}],"bg-clip":[{"bg-clip":[`border`,`padding`,`content`,`text`]}],"bg-origin":[{"bg-origin":[`border`,`padding`,`content`]}],"bg-position":[{bg:P()}],"bg-repeat":[{bg:F()}],"bg-size":[{bg:ie()}],"bg-image":[{bg:[`none`,{linear:[{to:[`t`,`tr`,`r`,`br`,`b`,`bl`,`l`,`tl`]},H,X,J],radial:[``,X,J],conic:[``,H,X,J]},be,he]}],"bg-color":[{bg:M()}],"gradient-from-pos":[{from:I()}],"gradient-via-pos":[{via:I()}],"gradient-to-pos":[{to:I()}],"gradient-from":[{from:M()}],"gradient-via":[{via:M()}],"gradient-to":[{to:M()}],rounded:[{rounded:L()}],"rounded-s":[{"rounded-s":L()}],"rounded-e":[{"rounded-e":L()}],"rounded-t":[{"rounded-t":L()}],"rounded-r":[{"rounded-r":L()}],"rounded-b":[{"rounded-b":L()}],"rounded-l":[{"rounded-l":L()}],"rounded-ss":[{"rounded-ss":L()}],"rounded-se":[{"rounded-se":L()}],"rounded-ee":[{"rounded-ee":L()}],"rounded-es":[{"rounded-es":L()}],"rounded-tl":[{"rounded-tl":L()}],"rounded-tr":[{"rounded-tr":L()}],"rounded-br":[{"rounded-br":L()}],"rounded-bl":[{"rounded-bl":L()}],"border-w":[{border:R()}],"border-w-x":[{"border-x":R()}],"border-w-y":[{"border-y":R()}],"border-w-s":[{"border-s":R()}],"border-w-e":[{"border-e":R()}],"border-w-bs":[{"border-bs":R()}],"border-w-be":[{"border-be":R()}],"border-w-t":[{"border-t":R()}],"border-w-r":[{"border-r":R()}],"border-w-b":[{"border-b":R()}],"border-w-l":[{"border-l":R()}],"divide-x":[{"divide-x":R()}],"divide-x-reverse":[`divide-x-reverse`],"divide-y":[{"divide-y":R()}],"divide-y-reverse":[`divide-y-reverse`],"border-style":[{border:[...z(),`hidden`,`none`]}],"divide-style":[{divide:[...z(),`hidden`,`none`]}],"border-color":[{border:M()}],"border-color-x":[{"border-x":M()}],"border-color-y":[{"border-y":M()}],"border-color-s":[{"border-s":M()}],"border-color-e":[{"border-e":M()}],"border-color-bs":[{"border-bs":M()}],"border-color-be":[{"border-be":M()}],"border-color-t":[{"border-t":M()}],"border-color-r":[{"border-r":M()}],"border-color-b":[{"border-b":M()}],"border-color-l":[{"border-l":M()}],"divide-color":[{divide:M()}],"outline-style":[{outline:[...z(),`none`,`hidden`]}],"outline-offset":[{"outline-offset":[V,X,J]}],"outline-w":[{outline:[``,V,Z,Y]}],"outline-color":[{outline:M()}],shadow:[{shadow:[``,`inner`,`none`,u,xe,ge]}],"shadow-color":[{shadow:M()}],"inset-shadow":[{"inset-shadow":[`none`,d,xe,ge]}],"inset-shadow-color":[{"inset-shadow":M()}],"ring-w":[{ring:R()}],"ring-w-inset":[`ring-inset`],"ring-color":[{ring:M()}],"ring-offset-w":[{"ring-offset":[V,Y]}],"ring-offset-color":[{"ring-offset":M()}],"inset-ring-w":[{"inset-ring":R()}],"inset-ring-color":[{"inset-ring":M()}],"text-shadow":[{"text-shadow":[`none`,f,xe,ge]}],"text-shadow-color":[{"text-shadow":M()}],opacity:[{opacity:[V,X,J]}],"mix-blend":[{"mix-blend":[...ae(),`plus-darker`,`plus-lighter`]}],"bg-blend":[{"bg-blend":ae()}],"mask-clip":[{"mask-clip":[`border`,`padding`,`content`,`fill`,`stroke`,`view`]},`mask-no-clip`],"mask-composite":[{mask:[`add`,`subtract`,`intersect`,`exclude`]}],"mask-image-linear-pos":[{"mask-linear":[V]}],"mask-image-linear-from-pos":[{"mask-linear-from":W()}],"mask-image-linear-to-pos":[{"mask-linear-to":W()}],"mask-image-linear-from-color":[{"mask-linear-from":M()}],"mask-image-linear-to-color":[{"mask-linear-to":M()}],"mask-image-t-from-pos":[{"mask-t-from":W()}],"mask-image-t-to-pos":[{"mask-t-to":W()}],"mask-image-t-from-color":[{"mask-t-from":M()}],"mask-image-t-to-color":[{"mask-t-to":M()}],"mask-image-r-from-pos":[{"mask-r-from":W()}],"mask-image-r-to-pos":[{"mask-r-to":W()}],"mask-image-r-from-color":[{"mask-r-from":M()}],"mask-image-r-to-color":[{"mask-r-to":M()}],"mask-image-b-from-pos":[{"mask-b-from":W()}],"mask-image-b-to-pos":[{"mask-b-to":W()}],"mask-image-b-from-color":[{"mask-b-from":M()}],"mask-image-b-to-color":[{"mask-b-to":M()}],"mask-image-l-from-pos":[{"mask-l-from":W()}],"mask-image-l-to-pos":[{"mask-l-to":W()}],"mask-image-l-from-color":[{"mask-l-from":M()}],"mask-image-l-to-color":[{"mask-l-to":M()}],"mask-image-x-from-pos":[{"mask-x-from":W()}],"mask-image-x-to-pos":[{"mask-x-to":W()}],"mask-image-x-from-color":[{"mask-x-from":M()}],"mask-image-x-to-color":[{"mask-x-to":M()}],"mask-image-y-from-pos":[{"mask-y-from":W()}],"mask-image-y-to-pos":[{"mask-y-to":W()}],"mask-image-y-from-color":[{"mask-y-from":M()}],"mask-image-y-to-color":[{"mask-y-to":M()}],"mask-image-radial":[{"mask-radial":[X,J]}],"mask-image-radial-from-pos":[{"mask-radial-from":W()}],"mask-image-radial-to-pos":[{"mask-radial-to":W()}],"mask-image-radial-from-color":[{"mask-radial-from":M()}],"mask-image-radial-to-color":[{"mask-radial-to":M()}],"mask-image-radial-shape":[{"mask-radial":[`circle`,`ellipse`]}],"mask-image-radial-size":[{"mask-radial":[{closest:[`side`,`corner`],farthest:[`side`,`corner`]}]}],"mask-image-radial-pos":[{"mask-radial-at":y()}],"mask-image-conic-pos":[{"mask-conic":[V]}],"mask-image-conic-from-pos":[{"mask-conic-from":W()}],"mask-image-conic-to-pos":[{"mask-conic-to":W()}],"mask-image-conic-from-color":[{"mask-conic-from":M()}],"mask-image-conic-to-color":[{"mask-conic-to":M()}],"mask-mode":[{mask:[`alpha`,`luminance`,`match`]}],"mask-origin":[{"mask-origin":[`border`,`padding`,`content`,`fill`,`stroke`,`view`]}],"mask-position":[{mask:P()}],"mask-repeat":[{mask:F()}],"mask-size":[{mask:ie()}],"mask-type":[{"mask-type":[`alpha`,`luminance`]}],"mask-image":[{mask:[`none`,X,J]}],filter:[{filter:[``,`none`,X,J]}],blur:[{blur:G()}],brightness:[{brightness:[V,X,J]}],contrast:[{contrast:[V,X,J]}],"drop-shadow":[{"drop-shadow":[``,`none`,p,xe,ge]}],"drop-shadow-color":[{"drop-shadow":M()}],grayscale:[{grayscale:[``,V,X,J]}],"hue-rotate":[{"hue-rotate":[V,X,J]}],invert:[{invert:[``,V,X,J]}],saturate:[{saturate:[V,X,J]}],sepia:[{sepia:[``,V,X,J]}],"backdrop-filter":[{"backdrop-filter":[``,`none`,X,J]}],"backdrop-blur":[{"backdrop-blur":G()}],"backdrop-brightness":[{"backdrop-brightness":[V,X,J]}],"backdrop-contrast":[{"backdrop-contrast":[V,X,J]}],"backdrop-grayscale":[{"backdrop-grayscale":[``,V,X,J]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[V,X,J]}],"backdrop-invert":[{"backdrop-invert":[``,V,X,J]}],"backdrop-opacity":[{"backdrop-opacity":[V,X,J]}],"backdrop-saturate":[{"backdrop-saturate":[V,X,J]}],"backdrop-sepia":[{"backdrop-sepia":[``,V,X,J]}],"border-collapse":[{border:[`collapse`,`separate`]}],"border-spacing":[{"border-spacing":C()}],"border-spacing-x":[{"border-spacing-x":C()}],"border-spacing-y":[{"border-spacing-y":C()}],"table-layout":[{table:[`auto`,`fixed`]}],caption:[{caption:[`top`,`bottom`]}],transition:[{transition:[``,`all`,`colors`,`opacity`,`shadow`,`transform`,`none`,X,J]}],"transition-behavior":[{transition:[`normal`,`discrete`]}],duration:[{duration:[V,`initial`,X,J]}],ease:[{ease:[`linear`,`initial`,_,X,J]}],delay:[{delay:[V,X,J]}],animate:[{animate:[`none`,ee,X,J]}],backface:[{backface:[`hidden`,`visible`]}],perspective:[{perspective:[h,X,J]}],"perspective-origin":[{"perspective-origin":b()}],rotate:[{rotate:K()}],"rotate-x":[{"rotate-x":K()}],"rotate-y":[{"rotate-y":K()}],"rotate-z":[{"rotate-z":K()}],scale:[{scale:q()}],"scale-x":[{"scale-x":q()}],"scale-y":[{"scale-y":q()}],"scale-z":[{"scale-z":q()}],"scale-3d":[`scale-3d`],skew:[{skew:Q()}],"skew-x":[{"skew-x":Q()}],"skew-y":[{"skew-y":Q()}],transform:[{transform:[X,J,``,`none`,`gpu`,`cpu`]}],"transform-origin":[{origin:b()}],"transform-style":[{transform:[`3d`,`flat`]}],translate:[{translate:$()}],"translate-x":[{"translate-x":$()}],"translate-y":[{"translate-y":$()}],"translate-z":[{"translate-z":$()}],"translate-none":[`translate-none`],zoom:[{zoom:[H,X,J]}],accent:[{accent:M()}],appearance:[{appearance:[`none`,`auto`]}],"caret-color":[{caret:M()}],"color-scheme":[{scheme:[`normal`,`dark`,`light`,`light-dark`,`only-dark`,`only-light`]}],cursor:[{cursor:[`auto`,`default`,`pointer`,`wait`,`text`,`move`,`help`,`not-allowed`,`none`,`context-menu`,`progress`,`cell`,`crosshair`,`vertical-text`,`alias`,`copy`,`no-drop`,`grab`,`grabbing`,`all-scroll`,`col-resize`,`row-resize`,`n-resize`,`e-resize`,`s-resize`,`w-resize`,`ne-resize`,`nw-resize`,`se-resize`,`sw-resize`,`ew-resize`,`ns-resize`,`nesw-resize`,`nwse-resize`,`zoom-in`,`zoom-out`,X,J]}],"field-sizing":[{"field-sizing":[`fixed`,`content`]}],"pointer-events":[{"pointer-events":[`auto`,`none`]}],resize:[{resize:[`none`,``,`y`,`x`]}],"scroll-behavior":[{scroll:[`auto`,`smooth`]}],"scrollbar-thumb-color":[{"scrollbar-thumb":M()}],"scrollbar-track-color":[{"scrollbar-track":M()}],"scrollbar-gutter":[{"scrollbar-gutter":[`auto`,`stable`,`both`]}],"scrollbar-w":[{scrollbar:[`auto`,`thin`,`none`]}],"scroll-m":[{"scroll-m":C()}],"scroll-mx":[{"scroll-mx":C()}],"scroll-my":[{"scroll-my":C()}],"scroll-ms":[{"scroll-ms":C()}],"scroll-me":[{"scroll-me":C()}],"scroll-mbs":[{"scroll-mbs":C()}],"scroll-mbe":[{"scroll-mbe":C()}],"scroll-mt":[{"scroll-mt":C()}],"scroll-mr":[{"scroll-mr":C()}],"scroll-mb":[{"scroll-mb":C()}],"scroll-ml":[{"scroll-ml":C()}],"scroll-p":[{"scroll-p":C()}],"scroll-px":[{"scroll-px":C()}],"scroll-py":[{"scroll-py":C()}],"scroll-ps":[{"scroll-ps":C()}],"scroll-pe":[{"scroll-pe":C()}],"scroll-pbs":[{"scroll-pbs":C()}],"scroll-pbe":[{"scroll-pbe":C()}],"scroll-pt":[{"scroll-pt":C()}],"scroll-pr":[{"scroll-pr":C()}],"scroll-pb":[{"scroll-pb":C()}],"scroll-pl":[{"scroll-pl":C()}],"snap-align":[{snap:[`start`,`end`,`center`,`align-none`]}],"snap-stop":[{snap:[`normal`,`always`]}],"snap-type":[{snap:[`none`,`x`,`y`,`both`]}],"snap-strictness":[{snap:[`mandatory`,`proximity`]}],touch:[{touch:[`auto`,`none`,`manipulation`]}],"touch-x":[{"touch-pan":[`x`,`left`,`right`]}],"touch-y":[{"touch-pan":[`y`,`up`,`down`]}],"touch-pz":[`touch-pinch-zoom`],select:[{select:[`none`,`text`,`all`,`auto`]}],"will-change":[{"will-change":[`auto`,`scroll`,`contents`,`transform`,X,J]}],fill:[{fill:[`none`,...M()]}],"stroke-w":[{stroke:[V,Z,Y,de]}],stroke:[{stroke:[`none`,...M()]}],"forced-color-adjust":[{"forced-color-adjust":[`auto`,`none`]}]},conflictingClassGroups:{"container-named":[`container-type`],overflow:[`overflow-x`,`overflow-y`],overscroll:[`overscroll-x`,`overscroll-y`],inset:[`inset-x`,`inset-y`,`inset-bs`,`inset-be`,`start`,`end`,`top`,`right`,`bottom`,`left`],"inset-x":[`start`,`end`,`right`,`left`],"inset-y":[`inset-bs`,`inset-be`,`top`,`bottom`],flex:[`basis`,`grow`,`shrink`],gap:[`gap-x`,`gap-y`],p:[`px`,`py`,`ps`,`pe`,`pbs`,`pbe`,`pt`,`pr`,`pb`,`pl`],px:[`ps`,`pe`,`pr`,`pl`],py:[`pbs`,`pbe`,`pt`,`pb`],m:[`mx`,`my`,`ms`,`me`,`mbs`,`mbe`,`mt`,`mr`,`mb`,`ml`],mx:[`ms`,`me`,`mr`,`ml`],my:[`mbs`,`mbe`,`mt`,`mb`],size:[`w`,`h`],"font-size":[`leading`],"fvn-normal":[`fvn-ordinal`,`fvn-slashed-zero`,`fvn-figure`,`fvn-spacing`,`fvn-fraction`],"fvn-ordinal":[`fvn-normal`],"fvn-slashed-zero":[`fvn-normal`],"fvn-figure":[`fvn-normal`],"fvn-spacing":[`fvn-normal`],"fvn-fraction":[`fvn-normal`],"line-clamp":[`display`,`overflow`],rounded:[`rounded-s`,`rounded-e`,`rounded-t`,`rounded-r`,`rounded-b`,`rounded-l`,`rounded-ss`,`rounded-se`,`rounded-ee`,`rounded-es`,`rounded-tl`,`rounded-tr`,`rounded-br`,`rounded-bl`],"rounded-s":[`rounded-ss`,`rounded-es`],"rounded-e":[`rounded-se`,`rounded-ee`],"rounded-t":[`rounded-tl`,`rounded-tr`],"rounded-r":[`rounded-tr`,`rounded-br`],"rounded-b":[`rounded-br`,`rounded-bl`],"rounded-l":[`rounded-tl`,`rounded-bl`],"border-spacing":[`border-spacing-x`,`border-spacing-y`],"border-w":[`border-w-x`,`border-w-y`,`border-w-s`,`border-w-e`,`border-w-bs`,`border-w-be`,`border-w-t`,`border-w-r`,`border-w-b`,`border-w-l`],"border-w-x":[`border-w-s`,`border-w-e`,`border-w-r`,`border-w-l`],"border-w-y":[`border-w-bs`,`border-w-be`,`border-w-t`,`border-w-b`],"border-color":[`border-color-x`,`border-color-y`,`border-color-s`,`border-color-e`,`border-color-bs`,`border-color-be`,`border-color-t`,`border-color-r`,`border-color-b`,`border-color-l`],"border-color-x":[`border-color-s`,`border-color-e`,`border-color-r`,`border-color-l`],"border-color-y":[`border-color-bs`,`border-color-be`,`border-color-t`,`border-color-b`],translate:[`translate-x`,`translate-y`,`translate-none`],"translate-none":[`translate`,`translate-x`,`translate-y`,`translate-z`],"scroll-m":[`scroll-mx`,`scroll-my`,`scroll-ms`,`scroll-me`,`scroll-mbs`,`scroll-mbe`,`scroll-mt`,`scroll-mr`,`scroll-mb`,`scroll-ml`],"scroll-mx":[`scroll-ms`,`scroll-me`,`scroll-mr`,`scroll-ml`],"scroll-my":[`scroll-mbs`,`scroll-mbe`,`scroll-mt`,`scroll-mb`],"scroll-p":[`scroll-px`,`scroll-py`,`scroll-ps`,`scroll-pe`,`scroll-pbs`,`scroll-pbe`,`scroll-pt`,`scroll-pr`,`scroll-pb`,`scroll-pl`],"scroll-px":[`scroll-ps`,`scroll-pe`,`scroll-pr`,`scroll-pl`],"scroll-py":[`scroll-pbs`,`scroll-pbe`,`scroll-pt`,`scroll-pb`],touch:[`touch-x`,`touch-y`,`touch-pz`],"touch-x":[`touch`],"touch-y":[`touch`],"touch-pz":[`touch`]},conflictingClassGroupModifiers:{"font-size":[`leading`]},postfixLookupClassGroups:[`container-type`],orderSensitiveModifiers:[`*`,`**`,`after`,`backdrop`,`before`,`details-content`,`file`,`first-letter`,`first-line`,`marker`,`placeholder`,`selection`]}}),Me=e(t(),1),Ne=e=>{let t,n=new Set,r=(e,r)=>{let i=typeof e==`function`?e(t):e;if(!Object.is(i,t)){let e=t;t=r??(typeof i!=`object`||!i)?i:Object.assign({},t,i),n.forEach(n=>n(t,e))}},i=()=>t,a={setState:r,getState:i,getInitialState:()=>o,subscribe:e=>(n.add(e),()=>n.delete(e))},o=t=e(r,i,a);return a},Pe=(e=>e?Ne(e):Ne),Fe=e=>e;function Ie(e,t=Fe){let n=Me.useSyncExternalStore(e.subscribe,Me.useCallback(()=>t(e.getState()),[e,t]),Me.useCallback(()=>t(e.getInitialState()),[e,t]));return Me.useDebugValue(n),n}var Le=e=>{let t=Pe(e),n=e=>Ie(t,e);return Object.assign(n,t),n},Re=(e=>e?Le(e):Le);function ze(e,t){let n;try{n=e()}catch{return}return{getItem:e=>{let r=e=>e===null?null:JSON.parse(e,t?.reviver),i=n.getItem(e)??null;return i instanceof Promise?i.then(r):r(i)},setItem:(e,r)=>n.setItem(e,JSON.stringify(r,t?.replacer)),removeItem:e=>n.removeItem(e)}}var Be=e=>t=>{try{let n=e(t);return n instanceof Promise?n:{then(e){return Be(e)(n)},catch(e){return this}}}catch(e){return{then(e){return this},catch(t){return Be(t)(e)}}}},Ve=(e,t)=>(n,r,i)=>{let a={storage:ze(()=>window.localStorage),partialize:e=>e,version:0,merge:(e,t)=>({...t,...e}),...t},o=!1,s=0,c=new Set,l=new Set,u=a.storage;if(!u)return e((...e)=>{console.warn(`[zustand persist middleware] Unable to update item '${a.name}', the given storage is currently unavailable.`),n(...e)},r,i);let d=()=>{let e=a.partialize({...r()});return u.setItem(a.name,{state:e,version:a.version})},f=i.setState;i.setState=(e,t)=>(f(e,t),d());let p=e((...e)=>(n(...e),d()),r,i);i.getInitialState=()=>p;let m,h=()=>{if(!u)return;let e=++s;o=!1,c.forEach(e=>e(r()??p));let t=a.onRehydrateStorage?.call(a,r()??p)||void 0;return Be(u.getItem.bind(u))(a.name).then(e=>{if(e){if(typeof e.version==`number`&&e.version!==a.version){if(a.migrate){let t=a.migrate(e.state,e.version);return t instanceof Promise?t.then(e=>[!0,e]):[!0,t]}console.error(`State loaded from storage couldn't be migrated since no migrate function was provided`)}else return[!1,e.state]}return[!1,void 0]}).then(t=>{if(e!==s)return;let[i,o]=t;if(m=a.merge(o,r()??p),n(m,!0),i)return d()}).then(()=>{e===s&&(t?.(r(),void 0),m=r(),o=!0,l.forEach(e=>e(m)))}).catch(n=>{e===s&&t?.(void 0,n)})};return i.persist={setOptions:e=>{a={...a,...e},e.storage&&(u=e.storage)},clearStorage:()=>{++s,u?.removeItem(a.name)},getOptions:()=>a,rehydrate:()=>h(),hasHydrated:()=>o,onHydrate:e=>(c.add(e),()=>{c.delete(e)}),onFinishHydration:e=>(l.add(e),()=>{l.delete(e)})},a.skipHydration||h(),m||p};export{r as i,Re as n,je as r,Ve as t};