nextclaw 0.18.0 → 0.18.2

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 (102) hide show
  1. package/dist/cli/{index.js → app/index.js} +11531 -9137
  2. package/package.json +20 -20
  3. package/resources/USAGE.md +30 -3
  4. package/ui-dist/assets/ChannelsList-SQ7Oxotv.js +8 -0
  5. package/ui-dist/assets/DocBrowser-BCO2k6XD.js +1 -0
  6. package/ui-dist/assets/{DocBrowser-6ReNjvzF.js → DocBrowser-rDOjI3ga.js} +1 -1
  7. package/ui-dist/assets/{DocBrowserContext-B6SpA7Qs.js → DocBrowserContext-BUq3Wo8O.js} +1 -1
  8. package/ui-dist/assets/{LogoBadge-ByNLYg65.js → LogoBadge-DP8Ye7wJ.js} +1 -1
  9. package/ui-dist/assets/ModelConfig-C77Ae9ru.js +1 -0
  10. package/ui-dist/assets/ProviderScopedModelInput-CEnK61uo.js +1 -0
  11. package/ui-dist/assets/ProvidersList-BCupBayq.js +1 -0
  12. package/ui-dist/assets/RuntimeConfig-Ad-CAcmy.js +1 -0
  13. package/ui-dist/assets/SearchConfig-BfCz4wJ4.js +1 -0
  14. package/ui-dist/assets/SecretsConfig-DjmBIhyy.js +3 -0
  15. package/ui-dist/assets/{SessionsConfig-ChHQ7M5c.js → SessionsConfig-CvjxU40H.js} +2 -2
  16. package/ui-dist/assets/{book-open-BdcxxoQu.js → book-open-BE8M56IM.js} +1 -1
  17. package/ui-dist/assets/chat-page-JKC6ln-y.js +58 -0
  18. package/ui-dist/assets/chat-session-display-YcRMrAMa.js +1 -0
  19. package/ui-dist/assets/{chunk-JZWAC4HX-DK5HPmIK.js → chunk-JZWAC4HX-erTUn3b8.js} +1 -1
  20. package/ui-dist/assets/client-CszWMVKi.js +7 -0
  21. package/ui-dist/assets/config-split-page-BAGSzUR3.js +1 -0
  22. package/ui-dist/assets/{createLucideIcon-BSeTgkZW.js → createLucideIcon-CCiTGX8L.js} +1 -1
  23. package/ui-dist/assets/desktop-DfkLlkG2.js +1 -0
  24. package/ui-dist/assets/desktop-update-config-BXeGlqHD.js +1 -0
  25. package/ui-dist/assets/dialog-BghZFPch.js +5 -0
  26. package/ui-dist/assets/{dist-6TrrnPCR.js → dist-Dd9cr-kz.js} +1 -1
  27. package/ui-dist/assets/dist-ZwoAXs46.js +9 -0
  28. package/ui-dist/assets/{download-BhDxnyvU.js → download-D7LOizcW.js} +1 -1
  29. package/ui-dist/assets/es2015-CEAreese.js +41 -0
  30. package/ui-dist/assets/{external-link-BgErLCNT.js → external-link-qsnCMhw1.js} +1 -1
  31. package/ui-dist/assets/{hash-Bl7dr_UG.js → hash-0zjWsNl-.js} +1 -1
  32. package/ui-dist/assets/{i18n-eDHeDY0n.js → i18n-DvzXOGQX.js} +1 -1
  33. package/ui-dist/assets/index-DvVTC9FF.css +1 -0
  34. package/ui-dist/assets/index-lr6rQUSd.js +2 -0
  35. package/ui-dist/assets/key-round-BLe9D8ND.js +1 -0
  36. package/ui-dist/assets/loader-circle-wj7kARHv.js +1 -0
  37. package/ui-dist/assets/{logos-x89HbrZ4.js → logos-_v5b2SdG.js} +1 -1
  38. package/ui-dist/assets/marketplace-page-CAAk1Khc.js +1 -0
  39. package/ui-dist/assets/marketplace-page-CfCiq90S.js +49 -0
  40. package/ui-dist/assets/mcp-marketplace-page-D0Pp9Hs-.js +40 -0
  41. package/ui-dist/assets/play-o6NmwGTi.js +1 -0
  42. package/ui-dist/assets/plus-I9pBS4Fl.js +1 -0
  43. package/ui-dist/assets/{refresh-cw-C47QSEwg.js → refresh-cw-MNqgR3LZ.js} +1 -1
  44. package/ui-dist/assets/remote-C9fXm4V5.js +1 -0
  45. package/ui-dist/assets/{save-3S6-H3Xw.js → save-D4bObrmH.js} +1 -1
  46. package/ui-dist/assets/search-DxmL3IWE.js +1 -0
  47. package/ui-dist/assets/security-config-BUm6FFfl.js +1 -0
  48. package/ui-dist/assets/select-BILPf7zs.js +1 -0
  49. package/ui-dist/assets/setting-row-BATDgg4r.js +1 -0
  50. package/ui-dist/assets/skeleton-COKMAnJy.js +1 -0
  51. package/ui-dist/assets/{switch-BsLtHOH-.js → switch-CBOzecWS.js} +1 -1
  52. package/ui-dist/assets/{tabs-custom-D3HYMt6k.js → tabs-custom-Bx3cNhD-.js} +1 -1
  53. package/ui-dist/assets/tag-chip-zUaDE2-H.js +1 -0
  54. package/ui-dist/assets/{trash-2-G48scll7.js → trash-2-CQUgYyRn.js} +1 -1
  55. package/ui-dist/assets/use-infinite-scroll-loader-B5V2Klve.js +1 -0
  56. package/ui-dist/assets/useConfirmDialog-patAnl1g.js +1 -0
  57. package/ui-dist/assets/{useMutation-CBWjE2uj.js → useMutation-__AYv-Pz.js} +1 -1
  58. package/ui-dist/assets/x-BHUGQIUv.js +1 -0
  59. package/ui-dist/index.html +22 -22
  60. package/ui-dist/runtime-icons/claude.ico +0 -0
  61. package/ui-dist/runtime-icons/codex-openai.svg +6 -0
  62. package/ui-dist/runtime-icons/hermes-agent.png +0 -0
  63. package/ui-dist/assets/ChannelsList-Ita2Zm1_.js +0 -8
  64. package/ui-dist/assets/DocBrowser-BNwbPHf4.js +0 -1
  65. package/ui-dist/assets/MarketplacePage-CjX2MWww.js +0 -1
  66. package/ui-dist/assets/MarketplacePage-D0sDlYX4.js +0 -49
  67. package/ui-dist/assets/McpMarketplacePage-BGKJm1sJ.js +0 -40
  68. package/ui-dist/assets/ModelConfig-BzZenCH-.js +0 -1
  69. package/ui-dist/assets/ProviderScopedModelInput-Da7khnBA.js +0 -1
  70. package/ui-dist/assets/ProvidersList-BbVzRxjY.js +0 -1
  71. package/ui-dist/assets/RemoteAccessPage-BaDH_X1Q.js +0 -1
  72. package/ui-dist/assets/RuntimeConfig-F_XKGgLm.js +0 -1
  73. package/ui-dist/assets/SearchConfig-BGkzXQP-.js +0 -1
  74. package/ui-dist/assets/SecretsConfig-D281Rotl.js +0 -3
  75. package/ui-dist/assets/app-query-client-VnFElj4E.js +0 -1
  76. package/ui-dist/assets/chat-page-Doe0yTtB.js +0 -58
  77. package/ui-dist/assets/chat-session-display-cw78aiI_.js +0 -1
  78. package/ui-dist/assets/client-_i4MU2bB.js +0 -7
  79. package/ui-dist/assets/config-DtIQwrHF.js +0 -1
  80. package/ui-dist/assets/config-layout-CHs0mAaR.js +0 -1
  81. package/ui-dist/assets/desktop-update-config-Dpcf4BKG.js +0 -1
  82. package/ui-dist/assets/dist-ccBFUi-o.js +0 -9
  83. package/ui-dist/assets/index-CF9xve0E.js +0 -6
  84. package/ui-dist/assets/index-FgA52VBt.css +0 -1
  85. package/ui-dist/assets/infiniteQueryBehavior-ZDS92Qpp.js +0 -1
  86. package/ui-dist/assets/loader-circle-ACM1s51e.js +0 -1
  87. package/ui-dist/assets/page-layout-vZnghcFy.js +0 -1
  88. package/ui-dist/assets/play-CFUwCA2E.js +0 -1
  89. package/ui-dist/assets/plus-rYsv72JG.js +0 -1
  90. package/ui-dist/assets/popover-Bg1VoTZ6.js +0 -1
  91. package/ui-dist/assets/refresh-ccw-DT98i__E.js +0 -1
  92. package/ui-dist/assets/rotate-cw-JtFzpNn6.js +0 -1
  93. package/ui-dist/assets/search-3kFR_zh9.js +0 -1
  94. package/ui-dist/assets/security-config-BWaiARNk.js +0 -1
  95. package/ui-dist/assets/select-DJ2MUjBB.js +0 -41
  96. package/ui-dist/assets/skeleton-ByQepn0M.js +0 -1
  97. package/ui-dist/assets/status-dot-vbanNPFU.js +0 -1
  98. package/ui-dist/assets/use-infinite-scroll-loader-DkNhD-42.js +0 -1
  99. package/ui-dist/assets/useConfirmDialog-BkvTN-vd.js +0 -1
  100. package/ui-dist/assets/x-ByDbItbq.js +0 -1
  101. /package/dist/cli/{index.d.ts → app/index.d.ts} +0 -0
  102. /package/ui-dist/assets/{config-hints-BhTmc9P1.js → config-hints-DSQQbeOA.js} +0 -0
@@ -0,0 +1 @@
1
+ import{t as e}from"./createLucideIcon-CCiTGX8L.js";var t=e(`Plus`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`M12 5v14`,key:`s699le`}]]);export{t};
@@ -1 +1 @@
1
- import{t as e}from"./createLucideIcon-BSeTgkZW.js";var t=e(`RefreshCw`,[[`path`,{d:`M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8`,key:`v9h5vc`}],[`path`,{d:`M21 3v5h-5`,key:`1q7to0`}],[`path`,{d:`M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16`,key:`3uifl3`}],[`path`,{d:`M8 16H3v5`,key:`1cv678`}]]);export{t};
1
+ import{t as e}from"./createLucideIcon-CCiTGX8L.js";var t=e(`RefreshCw`,[[`path`,{d:`M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8`,key:`v9h5vc`}],[`path`,{d:`M21 3v5h-5`,key:`1q7to0`}],[`path`,{d:`M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16`,key:`3uifl3`}],[`path`,{d:`M8 16H3v5`,key:`1cv678`}]]);export{t};
@@ -0,0 +1 @@
1
+ import{st as e}from"./index-lr6rQUSd.js";export{e as RemoteAccessPage};
@@ -1 +1 @@
1
- import{t as e}from"./createLucideIcon-BSeTgkZW.js";var t=e(`Save`,[[`path`,{d:`M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z`,key:`1c8476`}],[`path`,{d:`M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7`,key:`1ydtos`}],[`path`,{d:`M7 3v4a1 1 0 0 0 1 1h7`,key:`t51u73`}]]);export{t};
1
+ import{t as e}from"./createLucideIcon-CCiTGX8L.js";var t=e(`Save`,[[`path`,{d:`M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z`,key:`1c8476`}],[`path`,{d:`M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7`,key:`1ydtos`}],[`path`,{d:`M7 3v4a1 1 0 0 0 1 1h7`,key:`t51u73`}]]);export{t};
@@ -0,0 +1 @@
1
+ import{t as e}from"./createLucideIcon-CCiTGX8L.js";var t=e(`Search`,[[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}],[`path`,{d:`m21 21-4.3-4.3`,key:`1qie3q`}]]);export{t};
@@ -0,0 +1 @@
1
+ import{_ as e,i as t,m as n,p as r}from"./i18n-DvzXOGQX.js";import{a as i,i as a,n as o,o as s}from"./dist-ZwoAXs46.js";import{J as c,X as l,Y as u,Z as d,_t as f,dt as p,ft as m,gt as h,mt as g,pt as _,q as v,ut as y}from"./index-lr6rQUSd.js";import{t as b}from"./switch-CBOzecWS.js";var x=e(n(),1),S=r(),C=8;function w(e){return e.trim().length>=C}function T(e,n){return e===n?!0:(o.error(t(`authPasswordMismatch`)),!1)}function E(){let e=v(),n=u(),r=l(),i=d(),a=c(),[o,C]=(0,x.useState)(``),[E,D]=(0,x.useState)(``),[O,k]=(0,x.useState)(``),[A,j]=(0,x.useState)(``),[M,N]=(0,x.useState)(``),P=e.data,F=o.trim().length>0&&w(E)&&E===O&&!n.isPending,I=w(A)&&A===M&&!i.isPending,L=async()=>{if(T(E,O))try{await n.mutateAsync({username:o.trim(),password:E}),D(``),k(``)}catch{}},R=async()=>{if(T(A,M))try{await i.mutateAsync({password:A}),j(``),N(``)}catch{}},z=async e=>{try{await r.mutateAsync({enabled:e})}catch{}},B=async()=>{try{await a.mutateAsync()}catch{}};return e.isLoading&&!P?(0,S.jsxs)(y,{children:[(0,S.jsxs)(_,{children:[(0,S.jsx)(g,{children:t(`authSecurityTitle`)}),(0,S.jsx)(m,{children:t(`authSecurityDescription`)})]}),(0,S.jsx)(p,{className:`text-sm text-gray-500`,children:t(`loading`)})]}):e.isError||!P?(0,S.jsxs)(y,{children:[(0,S.jsxs)(_,{children:[(0,S.jsx)(g,{children:t(`authSecurityTitle`)}),(0,S.jsx)(m,{children:t(`authSecurityDescription`)})]}),(0,S.jsxs)(p,{className:`space-y-4`,children:[(0,S.jsx)(`p`,{className:`text-sm text-gray-500`,children:t(`authStatusLoadFailed`)}),(0,S.jsx)(s,{variant:`outline`,onClick:()=>{e.refetch()},children:t(`authRetryStatus`)})]})]}):P.configured?(0,S.jsxs)(y,{children:[(0,S.jsxs)(_,{children:[(0,S.jsx)(g,{children:t(`authSecurityTitle`)}),(0,S.jsx)(m,{children:t(`authSecurityDescription`)})]}),(0,S.jsxs)(p,{className:`space-y-6`,children:[(0,S.jsxs)(`div`,{className:`rounded-xl border border-gray-200 p-4`,children:[(0,S.jsxs)(`div`,{className:`flex flex-col gap-4 md:flex-row md:items-start md:justify-between`,children:[(0,S.jsxs)(`div`,{className:`space-y-1`,children:[(0,S.jsx)(`p`,{className:`text-sm font-medium text-gray-900`,children:t(`authStatusLabel`)}),(0,S.jsx)(`p`,{className:`text-sm text-gray-600`,children:t(`authStatusConfiguredUser`).replace(`{username}`,P.username??``)}),(0,S.jsx)(`p`,{className:`text-xs text-gray-500`,children:t(`authUsernameFixedHelp`)})]}),(0,S.jsx)(`span`,{className:`inline-flex items-center rounded-full bg-gray-100 px-3 py-1 text-xs font-medium text-gray-700`,children:P.enabled?t(`enabled`):t(`disabled`)})]}),(0,S.jsxs)(`div`,{className:`mt-4 flex flex-col gap-4 border-t border-gray-200 pt-4 md:flex-row md:items-center md:justify-between`,children:[(0,S.jsxs)(`div`,{className:`space-y-1`,children:[(0,S.jsx)(`p`,{className:`text-sm font-medium text-gray-900`,children:t(`authEnableLabel`)}),(0,S.jsx)(`p`,{className:`text-xs text-gray-500`,children:P.enabled?t(`authEnableOnHelp`):t(`authEnableOffHelp`)})]}),(0,S.jsx)(b,{checked:P.enabled,disabled:r.isPending,onCheckedChange:e=>{z(e)}})]})]}),(0,S.jsxs)(`div`,{className:`rounded-xl border border-gray-200 p-4 space-y-4`,children:[(0,S.jsxs)(`div`,{className:`space-y-1`,children:[(0,S.jsx)(`p`,{className:`text-sm font-medium text-gray-900`,children:t(`authPasswordSectionTitle`)}),(0,S.jsx)(`p`,{className:`text-xs text-gray-500`,children:t(`authPasswordSectionDescription`)})]}),(0,S.jsxs)(`div`,{className:`grid gap-4 md:grid-cols-2`,children:[(0,S.jsxs)(`div`,{className:`space-y-2`,children:[(0,S.jsx)(h,{htmlFor:`auth-password-next`,children:t(`authPassword`)}),(0,S.jsx)(f,{id:`auth-password-next`,type:`password`,value:A,onChange:e=>j(e.target.value),placeholder:t(`authPasswordPlaceholder`)})]}),(0,S.jsxs)(`div`,{className:`space-y-2`,children:[(0,S.jsx)(h,{htmlFor:`auth-password-confirm`,children:t(`authConfirmPassword`)}),(0,S.jsx)(f,{id:`auth-password-confirm`,type:`password`,value:M,onChange:e=>N(e.target.value),placeholder:t(`authConfirmPasswordPlaceholder`)})]})]}),(0,S.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3`,children:[(0,S.jsx)(s,{type:`button`,disabled:!I,onClick:()=>void R(),children:i.isPending?t(`authPasswordUpdating`):t(`authPasswordAction`)}),P.enabled&&P.authenticated?(0,S.jsx)(s,{type:`button`,variant:`outline`,disabled:a.isPending,onClick:()=>void B(),children:a.isPending?t(`authLoggingOut`):t(`authLogoutAction`)}):null]}),(0,S.jsx)(`p`,{className:`text-xs text-gray-500`,children:t(`authSessionMemoryNotice`)})]})]})]}):(0,S.jsxs)(y,{children:[(0,S.jsxs)(_,{children:[(0,S.jsx)(g,{children:t(`authSecurityTitle`)}),(0,S.jsx)(m,{children:t(`authSecurityDescription`)})]}),(0,S.jsxs)(p,{className:`space-y-5`,children:[(0,S.jsxs)(`div`,{className:`rounded-xl border border-dashed border-gray-200 bg-gray-50/70 p-4`,children:[(0,S.jsx)(`p`,{className:`text-sm font-medium text-gray-900`,children:t(`authSetupTitle`)}),(0,S.jsx)(`p`,{className:`mt-1 text-sm text-gray-500`,children:t(`authSetupDescription`)})]}),(0,S.jsxs)(`div`,{className:`grid gap-4 md:grid-cols-2`,children:[(0,S.jsxs)(`div`,{className:`space-y-2`,children:[(0,S.jsx)(h,{htmlFor:`auth-setup-username`,children:t(`authUsername`)}),(0,S.jsx)(f,{id:`auth-setup-username`,value:o,onChange:e=>C(e.target.value),placeholder:t(`authUsernamePlaceholder`)})]}),(0,S.jsxs)(`div`,{className:`space-y-2`,children:[(0,S.jsx)(h,{htmlFor:`auth-setup-password`,children:t(`authPassword`)}),(0,S.jsx)(f,{id:`auth-setup-password`,type:`password`,value:E,onChange:e=>D(e.target.value),placeholder:t(`authPasswordPlaceholder`)})]})]}),(0,S.jsxs)(`div`,{className:`space-y-2`,children:[(0,S.jsx)(h,{htmlFor:`auth-setup-confirm`,children:t(`authConfirmPassword`)}),(0,S.jsx)(f,{id:`auth-setup-confirm`,type:`password`,value:O,onChange:e=>k(e.target.value),placeholder:t(`authConfirmPasswordPlaceholder`)}),(0,S.jsx)(`p`,{className:`text-xs text-gray-500`,children:t(`authPasswordMinLengthHint`)})]}),(0,S.jsx)(s,{type:`button`,disabled:!F,onClick:()=>void L(),children:n.isPending?t(`authSettingUp`):t(`authSetupAction`)})]})]})}function D(){return(0,S.jsxs)(i,{className:`space-y-6`,children:[(0,S.jsx)(a,{title:t(`authSecurityTitle`),description:t(`authSecurityDescription`)}),(0,S.jsx)(E,{})]})}export{D as SecurityConfig};
@@ -0,0 +1 @@
1
+ import{_ as e,m as t,p as n,u as r}from"./i18n-DvzXOGQX.js";import{c as i}from"./dist-ZwoAXs46.js";import{_ as a,a as o,c as s,d as c,f as l,g as u,h as d,i as f,l as p,n as m,o as h,p as g,r as _,s as v,t as y}from"./es2015-CEAreese.js";import{t as b}from"./createLucideIcon-CCiTGX8L.js";var x=b(`Check`,[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]]),S=b(`ChevronDown`,[[`path`,{d:`m6 9 6 6 6-6`,key:`qrunsl`}]]),C=b(`ChevronUp`,[[`path`,{d:`m18 15-6-6-6 6`,key:`153udz`}]]),w=[`top`,`right`,`bottom`,`left`],T=Math.min,E=Math.max,D=Math.round,O=Math.floor,k=e=>({x:e,y:e}),A={left:`right`,right:`left`,bottom:`top`,top:`bottom`},j={start:`end`,end:`start`};function M(e,t,n){return E(e,T(t,n))}function N(e,t){return typeof e==`function`?e(t):e}function P(e){return e.split(`-`)[0]}function F(e){return e.split(`-`)[1]}function I(e){return e===`x`?`y`:`x`}function L(e){return e===`y`?`height`:`width`}var R=new Set([`top`,`bottom`]);function z(e){return R.has(P(e))?`y`:`x`}function ee(e){return I(z(e))}function te(e,t,n){n===void 0&&(n=!1);let r=F(e),i=ee(e),a=L(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=ue(o)),[o,ue(o)]}function ne(e){let t=ue(e);return[re(e),t,re(t)]}function re(e){return e.replace(/start|end/g,e=>j[e])}var ie=[`left`,`right`],ae=[`right`,`left`],oe=[`top`,`bottom`],se=[`bottom`,`top`];function ce(e,t,n){switch(e){case`top`:case`bottom`:return n?t?ae:ie:t?ie:ae;case`left`:case`right`:return t?oe:se;default:return[]}}function le(e,t,n,r){let i=F(e),a=ce(P(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(re)))),a}function ue(e){return e.replace(/left|right|bottom|top/g,e=>A[e])}function de(e){return{top:0,right:0,bottom:0,left:0,...e}}function fe(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:de(e)}function pe(e){let{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function me(e,t,n){let{reference:r,floating:i}=e,a=z(t),o=ee(t),s=L(o),c=P(t),l=a===`y`,u=r.x+r.width/2-i.width/2,d=r.y+r.height/2-i.height/2,f=r[s]/2-i[s]/2,p;switch(c){case`top`:p={x:u,y:r.y-i.height};break;case`bottom`:p={x:u,y:r.y+r.height};break;case`right`:p={x:r.x+r.width,y:d};break;case`left`:p={x:r.x-i.width,y:d};break;default:p={x:r.x,y:r.y}}switch(F(t)){case`start`:p[o]-=f*(n&&l?-1:1);break;case`end`:p[o]+=f*(n&&l?-1:1);break}return p}async function he(e,t){t===void 0&&(t={});let{x:n,y:r,platform:i,rects:a,elements:o,strategy:s}=e,{boundary:c=`clippingAncestors`,rootBoundary:l=`viewport`,elementContext:u=`floating`,altBoundary:d=!1,padding:f=0}=N(t,e),p=fe(f),m=o[d?u===`floating`?`reference`:`floating`:u],h=pe(await i.getClippingRect({element:await(i.isElement==null?void 0:i.isElement(m))??!0?m:m.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(o.floating)),boundary:c,rootBoundary:l,strategy:s})),g=u===`floating`?{x:n,y:r,width:a.floating.width,height:a.floating.height}:a.reference,_=await(i.getOffsetParent==null?void 0:i.getOffsetParent(o.floating)),v=await(i.isElement==null?void 0:i.isElement(_))&&await(i.getScale==null?void 0:i.getScale(_))||{x:1,y:1},y=pe(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:o,rect:g,offsetParent:_,strategy:s}):g);return{top:(h.top-y.top+p.top)/v.y,bottom:(y.bottom-h.bottom+p.bottom)/v.y,left:(h.left-y.left+p.left)/v.x,right:(y.right-h.right+p.right)/v.x}}var ge=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=a.filter(Boolean),c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=me(l,r,c),f=r,p={},m=0;for(let n=0;n<s.length;n++){let{name:a,fn:h}=s[n],{x:g,y:_,data:v,reset:y}=await h({x:u,y:d,initialPlacement:r,placement:f,strategy:i,middlewareData:p,rects:l,platform:{...o,detectOverflow:o.detectOverflow??he},elements:{reference:e,floating:t}});u=g??u,d=_??d,p={...p,[a]:{...p[a],...v}},y&&m<=50&&(m++,typeof y==`object`&&(y.placement&&(f=y.placement),y.rects&&(l=y.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:i}):y.rects),{x:u,y:d}=me(l,f,c)),n=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:p}},_e=e=>({name:`arrow`,options:e,async fn(t){let{x:n,y:r,placement:i,rects:a,platform:o,elements:s,middlewareData:c}=t,{element:l,padding:u=0}=N(e,t)||{};if(l==null)return{};let d=fe(u),f={x:n,y:r},p=ee(i),m=L(p),h=await o.getDimensions(l),g=p===`y`,_=g?`top`:`left`,v=g?`bottom`:`right`,y=g?`clientHeight`:`clientWidth`,b=a.reference[m]+a.reference[p]-f[p]-a.floating[m],x=f[p]-a.reference[p],S=await(o.getOffsetParent==null?void 0:o.getOffsetParent(l)),C=S?S[y]:0;(!C||!await(o.isElement==null?void 0:o.isElement(S)))&&(C=s.floating[y]||a.floating[m]);let w=b/2-x/2,E=C/2-h[m]/2-1,D=T(d[_],E),O=T(d[v],E),k=D,A=C-h[m]-O,j=C/2-h[m]/2+w,P=M(k,j,A),I=!c.arrow&&F(i)!=null&&j!==P&&a.reference[m]/2-(j<k?D:O)-h[m]/2<0,R=I?j<k?j-k:j-A:0;return{[p]:f[p]+R,data:{[p]:P,centerOffset:j-P-R,...I&&{alignmentOffset:R}},reset:I}}}),ve=function(e){return e===void 0&&(e={}),{name:`flip`,options:e,async fn(t){var n;let{placement:r,middlewareData:i,rects:a,initialPlacement:o,platform:s,elements:c}=t,{mainAxis:l=!0,crossAxis:u=!0,fallbackPlacements:d,fallbackStrategy:f=`bestFit`,fallbackAxisSideDirection:p=`none`,flipAlignment:m=!0,...h}=N(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};let g=P(r),_=z(o),v=P(o)===o,y=await(s.isRTL==null?void 0:s.isRTL(c.floating)),b=d||(v||!m?[ue(o)]:ne(o)),x=p!==`none`;!d&&x&&b.push(...le(o,m,p,y));let S=[o,...b],C=await s.detectOverflow(t,h),w=[],T=i.flip?.overflows||[];if(l&&w.push(C[g]),u){let e=te(r,a,y);w.push(C[e[0]],C[e[1]])}if(T=[...T,{placement:r,overflows:w}],!w.every(e=>e<=0)){let e=(i.flip?.index||0)+1,t=S[e];if(t&&(!(u===`alignment`&&_!==z(t))||T.every(e=>z(e.placement)===_?e.overflows[0]>0:!0)))return{data:{index:e,overflows:T},reset:{placement:t}};let n=T.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0]?.placement;if(!n)switch(f){case`bestFit`:{let e=T.filter(e=>{if(x){let t=z(e.placement);return t===_||t===`y`}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0]?.[0];e&&(n=e);break}case`initialPlacement`:n=o;break}if(r!==n)return{reset:{placement:n}}}return{}}}};function ye(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function be(e){return w.some(t=>e[t]>=0)}var xe=function(e){return e===void 0&&(e={}),{name:`hide`,options:e,async fn(t){let{rects:n,platform:r}=t,{strategy:i=`referenceHidden`,...a}=N(e,t);switch(i){case`referenceHidden`:{let e=ye(await r.detectOverflow(t,{...a,elementContext:`reference`}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:be(e)}}}case`escaped`:{let e=ye(await r.detectOverflow(t,{...a,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:be(e)}}}default:return{}}}}},Se=new Set([`left`,`top`]);async function Ce(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=P(n),s=F(n),c=z(n)===`y`,l=Se.has(o)?-1:1,u=a&&c?-1:1,d=N(t,e),{mainAxis:f,crossAxis:p,alignmentAxis:m}=typeof d==`number`?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&typeof m==`number`&&(p=s===`end`?m*-1:m),c?{x:p*u,y:f*l}:{x:f*l,y:p*u}}var we=function(e){return e===void 0&&(e=0),{name:`offset`,options:e,async fn(t){var n;let{x:r,y:i,placement:a,middlewareData:o}=t,s=await Ce(t,e);return a===o.offset?.placement&&(n=o.arrow)!=null&&n.alignmentOffset?{}:{x:r+s.x,y:i+s.y,data:{...s,placement:a}}}}},Te=function(e){return e===void 0&&(e={}),{name:`shift`,options:e,async fn(t){let{x:n,y:r,placement:i,platform:a}=t,{mainAxis:o=!0,crossAxis:s=!1,limiter:c={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...l}=N(e,t),u={x:n,y:r},d=await a.detectOverflow(t,l),f=z(P(i)),p=I(f),m=u[p],h=u[f];if(o){let e=p===`y`?`top`:`left`,t=p===`y`?`bottom`:`right`,n=m+d[e],r=m-d[t];m=M(n,m,r)}if(s){let e=f===`y`?`top`:`left`,t=f===`y`?`bottom`:`right`,n=h+d[e],r=h-d[t];h=M(n,h,r)}let g=c.fn({...t,[p]:m,[f]:h});return{...g,data:{x:g.x-n,y:g.y-r,enabled:{[p]:o,[f]:s}}}}}},Ee=function(e){return e===void 0&&(e={}),{options:e,fn(t){let{x:n,y:r,placement:i,rects:a,middlewareData:o}=t,{offset:s=0,mainAxis:c=!0,crossAxis:l=!0}=N(e,t),u={x:n,y:r},d=z(i),f=I(d),p=u[f],m=u[d],h=N(s,t),g=typeof h==`number`?{mainAxis:h,crossAxis:0}:{mainAxis:0,crossAxis:0,...h};if(c){let e=f===`y`?`height`:`width`,t=a.reference[f]-a.floating[e]+g.mainAxis,n=a.reference[f]+a.reference[e]-g.mainAxis;p<t?p=t:p>n&&(p=n)}if(l){let e=f===`y`?`width`:`height`,t=Se.has(P(i)),n=a.reference[d]-a.floating[e]+(t&&o.offset?.[d]||0)+(t?0:g.crossAxis),r=a.reference[d]+a.reference[e]+(t?0:o.offset?.[d]||0)-(t?g.crossAxis:0);m<n?m=n:m>r&&(m=r)}return{[f]:p,[d]:m}}}},De=function(e){return e===void 0&&(e={}),{name:`size`,options:e,async fn(t){var n,r;let{placement:i,rects:a,platform:o,elements:s}=t,{apply:c=()=>{},...l}=N(e,t),u=await o.detectOverflow(t,l),d=P(i),f=F(i),p=z(i)===`y`,{width:m,height:h}=a.floating,g,_;d===`top`||d===`bottom`?(g=d,_=f===(await(o.isRTL==null?void 0:o.isRTL(s.floating))?`start`:`end`)?`left`:`right`):(_=d,g=f===`end`?`top`:`bottom`);let v=h-u.top-u.bottom,y=m-u.left-u.right,b=T(h-u[g],v),x=T(m-u[_],y),S=!t.middlewareData.shift,C=b,w=x;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(w=y),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(C=v),S&&!f){let e=E(u.left,0),t=E(u.right,0),n=E(u.top,0),r=E(u.bottom,0);p?w=m-2*(e!==0||t!==0?e+t:E(u.left,u.right)):C=h-2*(n!==0||r!==0?n+r:E(u.top,u.bottom))}await c({...t,availableWidth:w,availableHeight:C});let D=await o.getDimensions(s.floating);return m!==D.width||h!==D.height?{reset:{rects:!0}}:{}}}};function Oe(){return typeof window<`u`}function ke(e){return Ae(e)?(e.nodeName||``).toLowerCase():`#document`}function B(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function V(e){return((Ae(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function Ae(e){return Oe()?e instanceof Node||e instanceof B(e).Node:!1}function H(e){return Oe()?e instanceof Element||e instanceof B(e).Element:!1}function U(e){return Oe()?e instanceof HTMLElement||e instanceof B(e).HTMLElement:!1}function je(e){return!Oe()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof B(e).ShadowRoot}var Me=new Set([`inline`,`contents`]);function Ne(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=W(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!Me.has(i)}var Pe=new Set([`table`,`td`,`th`]);function Fe(e){return Pe.has(ke(e))}var Ie=[`:popover-open`,`:modal`];function Le(e){return Ie.some(t=>{try{return e.matches(t)}catch{return!1}})}var Re=[`transform`,`translate`,`scale`,`rotate`,`perspective`],ze=[`transform`,`translate`,`scale`,`rotate`,`perspective`,`filter`],Be=[`paint`,`layout`,`strict`,`content`];function Ve(e){let t=Ue(),n=H(e)?W(e):e;return Re.some(e=>n[e]?n[e]!==`none`:!1)||(n.containerType?n.containerType!==`normal`:!1)||!t&&(n.backdropFilter?n.backdropFilter!==`none`:!1)||!t&&(n.filter?n.filter!==`none`:!1)||ze.some(e=>(n.willChange||``).includes(e))||Be.some(e=>(n.contain||``).includes(e))}function He(e){let t=G(e);for(;U(t)&&!Ge(t);){if(Ve(t))return t;if(Le(t))return null;t=G(t)}return null}function Ue(){return typeof CSS>`u`||!CSS.supports?!1:CSS.supports(`-webkit-backdrop-filter`,`none`)}var We=new Set([`html`,`body`,`#document`]);function Ge(e){return We.has(ke(e))}function W(e){return B(e).getComputedStyle(e)}function Ke(e){return H(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function G(e){if(ke(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||je(e)&&e.host||V(e);return je(t)?t.host:t}function qe(e){let t=G(e);return Ge(t)?e.ownerDocument?e.ownerDocument.body:e.body:U(t)&&Ne(t)?t:qe(t)}function Je(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=qe(e),i=r===e.ownerDocument?.body,a=B(r);if(i){let e=Ye(a);return t.concat(a,a.visualViewport||[],Ne(r)?r:[],e&&n?Je(e):[])}return t.concat(r,Je(r,[],n))}function Ye(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Xe(e){let t=W(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=U(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=D(n)!==a||D(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function Ze(e){return H(e)?e:e.contextElement}function Qe(e){let t=Ze(e);if(!U(t))return k(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=Xe(t),o=(a?D(n.width):n.width)/r,s=(a?D(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}var $e=k(0);function et(e){let t=B(e);return!Ue()||!t.visualViewport?$e:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function tt(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==B(e)?!1:t}function K(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=Ze(e),o=k(1);t&&(r?H(r)&&(o=Qe(r)):o=Qe(e));let s=tt(a,n,r)?et(a):k(0),c=(i.left+s.x)/o.x,l=(i.top+s.y)/o.y,u=i.width/o.x,d=i.height/o.y;if(a){let e=B(a),t=r&&H(r)?B(r):r,n=e,i=Ye(n);for(;i&&r&&t!==n;){let e=Qe(i),t=i.getBoundingClientRect(),r=W(i),a=t.left+(i.clientLeft+parseFloat(r.paddingLeft))*e.x,o=t.top+(i.clientTop+parseFloat(r.paddingTop))*e.y;c*=e.x,l*=e.y,u*=e.x,d*=e.y,c+=a,l+=o,n=B(i),i=Ye(n)}}return pe({width:u,height:d,x:c,y:l})}function nt(e,t){let n=Ke(e).scrollLeft;return t?t.left+n:K(V(e)).left+n}function rt(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-nt(e,n),y:n.top+t.scrollTop}}function it(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=V(r),s=t?Le(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=k(1),u=k(0),d=U(r);if((d||!d&&!a)&&((ke(r)!==`body`||Ne(o))&&(c=Ke(r)),U(r))){let e=K(r);l=Qe(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=o&&!d&&!a?rt(o,c):k(0);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-c.scrollLeft*l.x+u.x+f.x,y:n.y*l.y-c.scrollTop*l.y+u.y+f.y}}function at(e){return Array.from(e.getClientRects())}function ot(e){let t=V(e),n=Ke(e),r=e.ownerDocument.body,i=E(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),a=E(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight),o=-n.scrollLeft+nt(e),s=-n.scrollTop;return W(r).direction===`rtl`&&(o+=E(t.clientWidth,r.clientWidth)-i),{width:i,height:a,x:o,y:s}}var st=25;function ct(e,t){let n=B(e),r=V(e),i=n.visualViewport,a=r.clientWidth,o=r.clientHeight,s=0,c=0;if(i){a=i.width,o=i.height;let e=Ue();(!e||e&&t===`fixed`)&&(s=i.offsetLeft,c=i.offsetTop)}let l=nt(r);if(l<=0){let e=r.ownerDocument,t=e.body,n=getComputedStyle(t),i=e.compatMode===`CSS1Compat`&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,o=Math.abs(r.clientWidth-t.clientWidth-i);o<=st&&(a-=o)}else l<=st&&(a+=l);return{width:a,height:o,x:s,y:c}}var lt=new Set([`absolute`,`fixed`]);function ut(e,t){let n=K(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=U(e)?Qe(e):k(1);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function dt(e,t,n){let r;if(t===`viewport`)r=ct(e,n);else if(t===`document`)r=ot(V(e));else if(H(t))r=ut(t,n);else{let n=et(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return pe(r)}function ft(e,t){let n=G(e);return n===t||!H(n)||Ge(n)?!1:W(n).position===`fixed`||ft(n,t)}function pt(e,t){let n=t.get(e);if(n)return n;let r=Je(e,[],!1).filter(e=>H(e)&&ke(e)!==`body`),i=null,a=W(e).position===`fixed`,o=a?G(e):e;for(;H(o)&&!Ge(o);){let t=W(o),n=Ve(o);!n&&t.position===`fixed`&&(i=null),(a?!n&&!i:!n&&t.position===`static`&&i&&lt.has(i.position)||Ne(o)&&!n&&ft(e,o))?r=r.filter(e=>e!==o):i=t,o=G(o)}return t.set(e,r),r}function mt(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?Le(t)?[]:pt(t,this._c):[].concat(n),r],o=a[0],s=a.reduce((e,n)=>{let r=dt(t,n,i);return e.top=E(r.top,e.top),e.right=T(r.right,e.right),e.bottom=T(r.bottom,e.bottom),e.left=E(r.left,e.left),e},dt(t,o,i));return{width:s.right-s.left,height:s.bottom-s.top,x:s.left,y:s.top}}function ht(e){let{width:t,height:n}=Xe(e);return{width:t,height:n}}function gt(e,t,n){let r=U(t),i=V(t),a=n===`fixed`,o=K(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=k(0);function l(){c.x=nt(i)}if(r||!r&&!a)if((ke(t)!==`body`||Ne(i))&&(s=Ke(t)),r){let e=K(t,!0,a,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}else i&&l();a&&!r&&i&&l();let u=i&&!r&&!a?rt(i,s):k(0);return{x:o.left+s.scrollLeft-c.x-u.x,y:o.top+s.scrollTop-c.y-u.y,width:o.width,height:o.height}}function _t(e){return W(e).position===`static`}function vt(e,t){if(!U(e)||W(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return V(e)===n&&(n=n.ownerDocument.body),n}function yt(e,t){let n=B(e);if(Le(e))return n;if(!U(e)){let t=G(e);for(;t&&!Ge(t);){if(H(t)&&!_t(t))return t;t=G(t)}return n}let r=vt(e,t);for(;r&&Fe(r)&&_t(r);)r=vt(r,t);return r&&Ge(r)&&_t(r)&&!Ve(r)?n:r||He(e)||n}var bt=async function(e){let t=this.getOffsetParent||yt,n=this.getDimensions,r=await n(e.floating);return{reference:gt(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function xt(e){return W(e).direction===`rtl`}var St={convertOffsetParentRelativeRectToViewportRelativeRect:it,getDocumentElement:V,getClippingRect:mt,getOffsetParent:yt,getElementRects:bt,getClientRects:at,getDimensions:ht,getScale:Qe,isElement:H,isRTL:xt};function Ct(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function wt(e,t){let n=null,r,i=V(e);function a(){var e;clearTimeout(r),(e=n)==null||e.disconnect(),n=null}function o(s,c){s===void 0&&(s=!1),c===void 0&&(c=1),a();let l=e.getBoundingClientRect(),{left:u,top:d,width:f,height:p}=l;if(s||t(),!f||!p)return;let m=O(d),h=O(i.clientWidth-(u+f)),g=O(i.clientHeight-(d+p)),_=O(u),v={rootMargin:-m+`px `+-h+`px `+-g+`px `+-_+`px`,threshold:E(0,T(1,c))||1},y=!0;function b(t){let n=t[0].intersectionRatio;if(n!==c){if(!y)return o();n?o(!1,n):r=setTimeout(()=>{o(!1,1e-7)},1e3)}n===1&&!Ct(l,e.getBoundingClientRect())&&o(),y=!1}try{n=new IntersectionObserver(b,{...v,root:i.ownerDocument})}catch{n=new IntersectionObserver(b,v)}n.observe(e)}return o(!0),a}function Tt(e,t,n,r){r===void 0&&(r={});let{ancestorScroll:i=!0,ancestorResize:a=!0,elementResize:o=typeof ResizeObserver==`function`,layoutShift:s=typeof IntersectionObserver==`function`,animationFrame:c=!1}=r,l=Ze(e),u=i||a?[...l?Je(l):[],...Je(t)]:[];u.forEach(e=>{i&&e.addEventListener(`scroll`,n,{passive:!0}),a&&e.addEventListener(`resize`,n)});let d=l&&s?wt(l,n):null,f=-1,p=null;o&&(p=new ResizeObserver(e=>{let[r]=e;r&&r.target===l&&p&&(p.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var e;(e=p)==null||e.observe(t)})),n()}),l&&!c&&p.observe(l),p.observe(t));let m,h=c?K(e):null;c&&g();function g(){let t=K(e);h&&!Ct(h,t)&&n(),h=t,m=requestAnimationFrame(g)}return n(),()=>{var e;u.forEach(e=>{i&&e.removeEventListener(`scroll`,n),a&&e.removeEventListener(`resize`,n)}),d?.(),(e=p)==null||e.disconnect(),p=null,c&&cancelAnimationFrame(m)}}var Et=we,Dt=Te,Ot=ve,kt=De,At=xe,jt=_e,Mt=Ee,Nt=(e,t,n)=>{let r=new Map,i={platform:St,...n},a={...i.platform,_c:r};return ge(e,t,{...i,platform:a})},q=e(t(),1),Pt=e(i(),1),Ft=typeof document<`u`?q.useLayoutEffect:function(){};function It(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e==`function`&&e.toString()===t.toString())return!0;let n,r,i;if(e&&t&&typeof e==`object`){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!It(e[r],t[r]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,i[r]))return!1;for(r=n;r--!==0;){let n=i[r];if(!(n===`_owner`&&e.$$typeof)&&!It(e[n],t[n]))return!1}return!0}return e!==e&&t!==t}function Lt(e){return typeof window>`u`?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Rt(e,t){let n=Lt(e);return Math.round(t*n)/n}function zt(e){let t=q.useRef(e);return Ft(()=>{t.current=e}),t}function Bt(e){e===void 0&&(e={});let{placement:t=`bottom`,strategy:n=`absolute`,middleware:r=[],platform:i,elements:{reference:a,floating:o}={},transform:s=!0,whileElementsMounted:c,open:l}=e,[u,d]=q.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[f,p]=q.useState(r);It(f,r)||p(r);let[m,h]=q.useState(null),[g,_]=q.useState(null),v=q.useCallback(e=>{e!==S.current&&(S.current=e,h(e))},[]),y=q.useCallback(e=>{e!==C.current&&(C.current=e,_(e))},[]),b=a||m,x=o||g,S=q.useRef(null),C=q.useRef(null),w=q.useRef(u),T=c!=null,E=zt(c),D=zt(i),O=zt(l),k=q.useCallback(()=>{if(!S.current||!C.current)return;let e={placement:t,strategy:n,middleware:f};D.current&&(e.platform=D.current),Nt(S.current,C.current,e).then(e=>{let t={...e,isPositioned:O.current!==!1};A.current&&!It(w.current,t)&&(w.current=t,Pt.flushSync(()=>{d(t)}))})},[f,t,n,D,O]);Ft(()=>{l===!1&&w.current.isPositioned&&(w.current.isPositioned=!1,d(e=>({...e,isPositioned:!1})))},[l]);let A=q.useRef(!1);Ft(()=>(A.current=!0,()=>{A.current=!1}),[]),Ft(()=>{if(b&&(S.current=b),x&&(C.current=x),b&&x){if(E.current)return E.current(b,x,k);k()}},[b,x,k,E,T]);let j=q.useMemo(()=>({reference:S,floating:C,setReference:v,setFloating:y}),[v,y]),M=q.useMemo(()=>({reference:b,floating:x}),[b,x]),N=q.useMemo(()=>{let e={position:n,left:0,top:0};if(!M.floating)return e;let t=Rt(M.floating,u.x),r=Rt(M.floating,u.y);return s?{...e,transform:`translate(`+t+`px, `+r+`px)`,...Lt(M.floating)>=1.5&&{willChange:`transform`}}:{position:n,left:t,top:r}},[n,s,M.floating,u.x,u.y]);return q.useMemo(()=>({...u,update:k,refs:j,elements:M,floatingStyles:N}),[u,k,j,M,N])}var Vt=e=>{function t(e){return{}.hasOwnProperty.call(e,`current`)}return{name:`arrow`,options:e,fn(n){let{element:r,padding:i}=typeof e==`function`?e(n):e;return r&&t(r)?r.current==null?{}:jt({element:r.current,padding:i}).fn(n):r?jt({element:r,padding:i}).fn(n):{}}}},Ht=(e,t)=>({...Et(e),options:[e,t]}),Ut=(e,t)=>({...Dt(e),options:[e,t]}),Wt=(e,t)=>({...Mt(e),options:[e,t]}),Gt=(e,t)=>({...Ot(e),options:[e,t]}),Kt=(e,t)=>({...kt(e),options:[e,t]}),qt=(e,t)=>({...At(e),options:[e,t]}),Jt=(e,t)=>({...Vt(e),options:[e,t]}),J=n(),Yt=`Arrow`,Xt=q.forwardRef((e,t)=>{let{children:n,width:r=10,height:i=5,...a}=e;return(0,J.jsx)(s.svg,{...a,ref:t,width:r,height:i,viewBox:`0 0 30 10`,preserveAspectRatio:`none`,children:e.asChild?n:(0,J.jsx)(`polygon`,{points:`0,0 30,0 15,10`})})});Xt.displayName=Yt;var Zt=Xt;function Qt(e){let[t,n]=q.useState(void 0);return g(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});let t=new ResizeObserver(t=>{if(!Array.isArray(t)||!t.length)return;let r=t[0],i,a;if(`borderBoxSize`in r){let e=r.borderBoxSize,t=Array.isArray(e)?e[0]:e;i=t.inlineSize,a=t.blockSize}else i=e.offsetWidth,a=e.offsetHeight;n({width:i,height:a})});return t.observe(e,{box:`border-box`}),()=>t.unobserve(e)}else n(void 0)},[e]),t}var $t=`Popper`,[en,tn]=d($t),[nn,rn]=en($t),an=e=>{let{__scopePopper:t,children:n}=e,[r,i]=q.useState(null);return(0,J.jsx)(nn,{scope:t,anchor:r,onAnchorChange:i,children:n})};an.displayName=$t;var on=`PopperAnchor`,sn=q.forwardRef((e,t)=>{let{__scopePopper:n,virtualRef:r,...i}=e,a=rn(on,n),o=q.useRef(null),c=u(t,o),l=q.useRef(null);return q.useEffect(()=>{let e=l.current;l.current=r?.current||o.current,e!==l.current&&a.onAnchorChange(l.current)}),r?null:(0,J.jsx)(s.div,{...i,ref:c})});sn.displayName=on;var cn=`PopperContent`,[ln,un]=en(cn),dn=q.forwardRef((e,t)=>{let{__scopePopper:n,side:r=`bottom`,sideOffset:i=0,align:a=`center`,alignOffset:o=0,arrowPadding:c=0,avoidCollisions:l=!0,collisionBoundary:d=[],collisionPadding:f=0,sticky:p=`partial`,hideWhenDetached:m=!1,updatePositionStrategy:h=`optimized`,onPlaced:_,...y}=e,b=rn(cn,n),[x,S]=q.useState(null),C=u(t,e=>S(e)),[w,T]=q.useState(null),E=Qt(w),D=E?.width??0,O=E?.height??0,k=r+(a===`center`?``:`-`+a),A=typeof f==`number`?f:{top:0,right:0,bottom:0,left:0,...f},j=Array.isArray(d)?d:[d],M=j.length>0,N={padding:A,boundary:j.filter(hn),altBoundary:M},{refs:P,floatingStyles:F,placement:I,isPositioned:L,middlewareData:R}=Bt({strategy:`fixed`,placement:k,whileElementsMounted:(...e)=>Tt(...e,{animationFrame:h===`always`}),elements:{reference:b.anchor},middleware:[Ht({mainAxis:i+O,alignmentAxis:o}),l&&Ut({mainAxis:!0,crossAxis:!1,limiter:p===`partial`?Wt():void 0,...N}),l&&Gt({...N}),Kt({...N,apply:({elements:e,rects:t,availableWidth:n,availableHeight:r})=>{let{width:i,height:a}=t.reference,o=e.floating.style;o.setProperty(`--radix-popper-available-width`,`${n}px`),o.setProperty(`--radix-popper-available-height`,`${r}px`),o.setProperty(`--radix-popper-anchor-width`,`${i}px`),o.setProperty(`--radix-popper-anchor-height`,`${a}px`)}}),w&&Jt({element:w,padding:c}),gn({arrowWidth:D,arrowHeight:O}),m&&qt({strategy:`referenceHidden`,...N})]}),[z,ee]=_n(I),te=v(_);g(()=>{L&&te?.()},[L,te]);let ne=R.arrow?.x,re=R.arrow?.y,ie=R.arrow?.centerOffset!==0,[ae,oe]=q.useState();return g(()=>{x&&oe(window.getComputedStyle(x).zIndex)},[x]),(0,J.jsx)(`div`,{ref:P.setFloating,"data-radix-popper-content-wrapper":``,style:{...F,transform:L?F.transform:`translate(0, -200%)`,minWidth:`max-content`,zIndex:ae,"--radix-popper-transform-origin":[R.transformOrigin?.x,R.transformOrigin?.y].join(` `),...R.hide?.referenceHidden&&{visibility:`hidden`,pointerEvents:`none`}},dir:e.dir,children:(0,J.jsx)(ln,{scope:n,placedSide:z,onArrowChange:T,arrowX:ne,arrowY:re,shouldHideArrow:ie,children:(0,J.jsx)(s.div,{"data-side":z,"data-align":ee,...y,ref:C,style:{...y.style,animation:L?void 0:`none`}})})})});dn.displayName=cn;var fn=`PopperArrow`,pn={top:`bottom`,right:`left`,bottom:`top`,left:`right`},mn=q.forwardRef(function(e,t){let{__scopePopper:n,...r}=e,i=un(fn,n),a=pn[i.placedSide];return(0,J.jsx)(`span`,{ref:i.onArrowChange,style:{position:`absolute`,left:i.arrowX,top:i.arrowY,[a]:0,transformOrigin:{top:``,right:`0 0`,bottom:`center 0`,left:`100% 0`}[i.placedSide],transform:{top:`translateY(100%)`,right:`translateY(50%) rotate(90deg) translateX(-50%)`,bottom:`rotate(180deg)`,left:`translateY(50%) rotate(-90deg) translateX(50%)`}[i.placedSide],visibility:i.shouldHideArrow?`hidden`:void 0},children:(0,J.jsx)(Zt,{...r,ref:t,style:{...r.style,display:`block`}})})});mn.displayName=fn;function hn(e){return e!==null}var gn=e=>({name:`transformOrigin`,options:e,fn(t){let{placement:n,rects:r,middlewareData:i}=t,a=i.arrow?.centerOffset!==0,o=a?0:e.arrowWidth,s=a?0:e.arrowHeight,[c,l]=_n(n),u={start:`0%`,center:`50%`,end:`100%`}[l],d=(i.arrow?.x??0)+o/2,f=(i.arrow?.y??0)+s/2,p=``,m=``;return c===`bottom`?(p=a?u:`${d}px`,m=`${-s}px`):c===`top`?(p=a?u:`${d}px`,m=`${r.floating.height+s}px`):c===`right`?(p=`${-s}px`,m=a?u:`${f}px`):c===`left`&&(p=`${r.floating.width+s}px`,m=a?u:`${f}px`),{data:{x:p,y:m}}}});function _n(e){let[t,n=`center`]=e.split(`-`);return[t,n]}var vn=an,yn=sn,bn=dn,xn=mn;function Sn(e,[t,n]){return Math.min(n,Math.max(t,e))}function Cn(e){let t=e+`CollectionProvider`,[n,r]=d(t),[i,a]=n(t,{collectionRef:{current:null},itemMap:new Map}),o=e=>{let{scope:t,children:n}=e,r=q.useRef(null),a=q.useRef(new Map).current;return(0,J.jsx)(i,{scope:t,itemMap:a,collectionRef:r,children:n})};o.displayName=t;let s=e+`CollectionSlot`,c=p(s),l=q.forwardRef((e,t)=>{let{scope:n,children:r}=e;return(0,J.jsx)(c,{ref:u(t,a(s,n).collectionRef),children:r})});l.displayName=s;let f=e+`CollectionItemSlot`,m=`data-radix-collection-item`,h=p(f),g=q.forwardRef((e,t)=>{let{scope:n,children:r,...i}=e,o=q.useRef(null),s=u(t,o),c=a(f,n);return q.useEffect(()=>(c.itemMap.set(o,{ref:o,...i}),()=>void c.itemMap.delete(o))),(0,J.jsx)(h,{[m]:``,ref:s,children:r})});g.displayName=f;function _(t){let n=a(e+`CollectionConsumer`,t);return q.useCallback(()=>{let e=n.collectionRef.current;if(!e)return[];let t=Array.from(e.querySelectorAll(`[${m}]`));return Array.from(n.itemMap.values()).sort((e,n)=>t.indexOf(e.ref.current)-t.indexOf(n.ref.current))},[n.collectionRef,n.itemMap])}return[{Provider:o,Slot:l,ItemSlot:g},_,r]}var wn=q.createContext(void 0);function Tn(e){let t=q.useContext(wn);return e||t||`ltr`}function En(e){let t=q.useRef({value:e,previous:e});return q.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var Dn=Object.freeze({position:`absolute`,border:0,width:1,height:1,padding:0,margin:-1,overflow:`hidden`,clip:`rect(0, 0, 0, 0)`,whiteSpace:`nowrap`,wordWrap:`normal`}),On=`VisuallyHidden`,kn=q.forwardRef((e,t)=>(0,J.jsx)(s.span,{...e,ref:t,style:{...Dn,...e.style}}));kn.displayName=On;var An=kn,jn=[` `,`Enter`,`ArrowUp`,`ArrowDown`],Mn=[` `,`Enter`],Y=`Select`,[Nn,Pn,Fn]=Cn(Y),[In,Ln]=d(Y,[Fn,tn]),Rn=tn(),[zn,X]=In(Y),[Bn,Vn]=In(Y),Hn=e=>{let{__scopeSelect:t,children:n,open:r,defaultOpen:i,onOpenChange:a,value:o,defaultValue:s,onValueChange:u,dir:d,name:f,autoComplete:p,disabled:m,required:h,form:g}=e,_=Rn(t),[v,y]=q.useState(null),[b,x]=q.useState(null),[S,C]=q.useState(!1),w=Tn(d),[T,E]=c({prop:r,defaultProp:i??!1,onChange:a,caller:Y}),[D,O]=c({prop:o,defaultProp:s,onChange:u,caller:Y}),k=q.useRef(null),A=v?g||!!v.closest(`form`):!0,[j,M]=q.useState(new Set),N=Array.from(j).map(e=>e.props.value).join(`;`);return(0,J.jsx)(vn,{..._,children:(0,J.jsxs)(zn,{required:h,scope:t,trigger:v,onTriggerChange:y,valueNode:b,onValueNodeChange:x,valueNodeHasChildren:S,onValueNodeHasChildrenChange:C,contentId:l(),value:D,onValueChange:O,open:T,onOpenChange:E,dir:w,triggerPointerDownPosRef:k,disabled:m,children:[(0,J.jsx)(Nn.Provider,{scope:t,children:(0,J.jsx)(Bn,{scope:e.__scopeSelect,onNativeOptionAdd:q.useCallback(e=>{M(t=>new Set(t).add(e))},[]),onNativeOptionRemove:q.useCallback(e=>{M(t=>{let n=new Set(t);return n.delete(e),n})},[]),children:n})}),A?(0,J.jsxs)(Pr,{"aria-hidden":!0,required:h,tabIndex:-1,name:f,autoComplete:p,value:D,onChange:e=>O(e.target.value),disabled:m,form:g,children:[D===void 0?(0,J.jsx)(`option`,{value:``}):null,Array.from(j)]},N):null]})})};Hn.displayName=Y;var Un=`SelectTrigger`,Wn=q.forwardRef((e,t)=>{let{__scopeSelect:n,disabled:r=!1,...i}=e,o=Rn(n),c=X(Un,n),l=c.disabled||r,d=u(t,c.onTriggerChange),f=Pn(n),p=q.useRef(`touch`),[m,h,g]=Ir(e=>{let t=f().filter(e=>!e.disabled),n=Lr(t,e,t.find(e=>e.value===c.value));n!==void 0&&c.onValueChange(n.value)}),_=e=>{l||(c.onOpenChange(!0),g()),e&&(c.triggerPointerDownPosRef.current={x:Math.round(e.pageX),y:Math.round(e.pageY)})};return(0,J.jsx)(yn,{asChild:!0,...o,children:(0,J.jsx)(s.button,{type:`button`,role:`combobox`,"aria-controls":c.contentId,"aria-expanded":c.open,"aria-required":c.required,"aria-autocomplete":`none`,dir:c.dir,"data-state":c.open?`open`:`closed`,disabled:l,"data-disabled":l?``:void 0,"data-placeholder":Fr(c.value)?``:void 0,...i,ref:d,onClick:a(i.onClick,e=>{e.currentTarget.focus(),p.current!==`mouse`&&_(e)}),onPointerDown:a(i.onPointerDown,e=>{p.current=e.pointerType;let t=e.target;t.hasPointerCapture(e.pointerId)&&t.releasePointerCapture(e.pointerId),e.button===0&&e.ctrlKey===!1&&e.pointerType===`mouse`&&(_(e),e.preventDefault())}),onKeyDown:a(i.onKeyDown,e=>{let t=m.current!==``;!(e.ctrlKey||e.altKey||e.metaKey)&&e.key.length===1&&h(e.key),!(t&&e.key===` `)&&jn.includes(e.key)&&(_(),e.preventDefault())})})})});Wn.displayName=Un;var Gn=`SelectValue`,Kn=q.forwardRef((e,t)=>{let{__scopeSelect:n,className:r,style:i,children:a,placeholder:o=``,...c}=e,l=X(Gn,n),{onValueNodeHasChildrenChange:d}=l,f=a!==void 0,p=u(t,l.onValueNodeChange);return g(()=>{d(f)},[d,f]),(0,J.jsx)(s.span,{...c,ref:p,style:{pointerEvents:`none`},children:Fr(l.value)?(0,J.jsx)(J.Fragment,{children:o}):a})});Kn.displayName=Gn;var qn=`SelectIcon`,Jn=q.forwardRef((e,t)=>{let{__scopeSelect:n,children:r,...i}=e;return(0,J.jsx)(s.span,{"aria-hidden":!0,...i,ref:t,children:r||`▼`})});Jn.displayName=qn;var Yn=`SelectPortal`,Xn=e=>(0,J.jsx)(f,{asChild:!0,...e});Xn.displayName=Yn;var Z=`SelectContent`,Zn=q.forwardRef((e,t)=>{let n=X(Z,e.__scopeSelect),[r,i]=q.useState();if(g(()=>{i(new DocumentFragment)},[]),!n.open){let t=r;return t?Pt.createPortal((0,J.jsx)(Qn,{scope:e.__scopeSelect,children:(0,J.jsx)(Nn.Slot,{scope:e.__scopeSelect,children:(0,J.jsx)(`div`,{children:e.children})})}),t):null}return(0,J.jsx)(tr,{...e,ref:t})});Zn.displayName=Z;var Q=10,[Qn,$]=In(Z),$n=`SelectContentImpl`,er=p(`SelectContent.RemoveScroll`),tr=q.forwardRef((e,t)=>{let{__scopeSelect:n,position:r=`item-aligned`,onCloseAutoFocus:i,onEscapeKeyDown:s,onPointerDownOutside:c,side:l,sideOffset:d,align:f,alignOffset:p,arrowPadding:g,collisionBoundary:v,collisionPadding:b,sticky:x,hideWhenDetached:S,avoidCollisions:C,...w}=e,T=X(Z,n),[E,D]=q.useState(null),[O,k]=q.useState(null),A=u(t,e=>D(e)),[j,M]=q.useState(null),[N,P]=q.useState(null),F=Pn(n),[I,L]=q.useState(!1),R=q.useRef(!1);q.useEffect(()=>{if(E)return y(E)},[E]),_();let z=q.useCallback(e=>{let[t,...n]=F().map(e=>e.ref.current),[r]=n.slice(-1),i=document.activeElement;for(let n of e)if(n===i||(n?.scrollIntoView({block:`nearest`}),n===t&&O&&(O.scrollTop=0),n===r&&O&&(O.scrollTop=O.scrollHeight),n?.focus(),document.activeElement!==i))return},[F,O]),ee=q.useCallback(()=>z([j,E]),[z,j,E]);q.useEffect(()=>{I&&ee()},[I,ee]);let{onOpenChange:te,triggerPointerDownPosRef:ne}=T;q.useEffect(()=>{if(E){let e={x:0,y:0},t=t=>{e={x:Math.abs(Math.round(t.pageX)-(ne.current?.x??0)),y:Math.abs(Math.round(t.pageY)-(ne.current?.y??0))}},n=n=>{e.x<=10&&e.y<=10?n.preventDefault():E.contains(n.target)||te(!1),document.removeEventListener(`pointermove`,t),ne.current=null};return ne.current!==null&&(document.addEventListener(`pointermove`,t),document.addEventListener(`pointerup`,n,{capture:!0,once:!0})),()=>{document.removeEventListener(`pointermove`,t),document.removeEventListener(`pointerup`,n,{capture:!0})}}},[E,te,ne]),q.useEffect(()=>{let e=()=>te(!1);return window.addEventListener(`blur`,e),window.addEventListener(`resize`,e),()=>{window.removeEventListener(`blur`,e),window.removeEventListener(`resize`,e)}},[te]);let[re,ie]=Ir(e=>{let t=F().filter(e=>!e.disabled),n=Lr(t,e,t.find(e=>e.ref.current===document.activeElement));n&&setTimeout(()=>n.ref.current.focus())}),ae=q.useCallback((e,t,n)=>{let r=!R.current&&!n;(T.value!==void 0&&T.value===t||r)&&(M(e),r&&(R.current=!0))},[T.value]),oe=q.useCallback(()=>E?.focus(),[E]),se=q.useCallback((e,t,n)=>{let r=!R.current&&!n;(T.value!==void 0&&T.value===t||r)&&P(e)},[T.value]),ce=r===`popper`?ar:rr,le=ce===ar?{side:l,sideOffset:d,align:f,alignOffset:p,arrowPadding:g,collisionBoundary:v,collisionPadding:b,sticky:x,hideWhenDetached:S,avoidCollisions:C}:{};return(0,J.jsx)(Qn,{scope:n,content:E,viewport:O,onViewportChange:k,itemRefCallback:ae,selectedItem:j,onItemLeave:oe,itemTextRefCallback:se,focusSelectedItem:ee,selectedItemText:N,position:r,isPositioned:I,searchRef:re,children:(0,J.jsx)(m,{as:er,allowPinchZoom:!0,children:(0,J.jsx)(o,{asChild:!0,trapped:T.open,onMountAutoFocus:e=>{e.preventDefault()},onUnmountAutoFocus:a(i,e=>{T.trigger?.focus({preventScroll:!0}),e.preventDefault()}),children:(0,J.jsx)(h,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:s,onPointerDownOutside:c,onFocusOutside:e=>e.preventDefault(),onDismiss:()=>T.onOpenChange(!1),children:(0,J.jsx)(ce,{role:`listbox`,id:T.contentId,"data-state":T.open?`open`:`closed`,dir:T.dir,onContextMenu:e=>e.preventDefault(),...w,...le,onPlaced:()=>L(!0),ref:A,style:{display:`flex`,flexDirection:`column`,outline:`none`,...w.style},onKeyDown:a(w.onKeyDown,e=>{let t=e.ctrlKey||e.altKey||e.metaKey;if(e.key===`Tab`&&e.preventDefault(),!t&&e.key.length===1&&ie(e.key),[`ArrowUp`,`ArrowDown`,`Home`,`End`].includes(e.key)){let t=F().filter(e=>!e.disabled).map(e=>e.ref.current);if([`ArrowUp`,`End`].includes(e.key)&&(t=t.slice().reverse()),[`ArrowUp`,`ArrowDown`].includes(e.key)){let n=e.target,r=t.indexOf(n);t=t.slice(r+1)}setTimeout(()=>z(t)),e.preventDefault()}})})})})})})});tr.displayName=$n;var nr=`SelectItemAlignedPosition`,rr=q.forwardRef((e,t)=>{let{__scopeSelect:n,onPlaced:r,...i}=e,a=X(Z,n),o=$(Z,n),[c,l]=q.useState(null),[d,f]=q.useState(null),p=u(t,e=>f(e)),m=Pn(n),h=q.useRef(!1),_=q.useRef(!0),{viewport:v,selectedItem:y,selectedItemText:b,focusSelectedItem:x}=o,S=q.useCallback(()=>{if(a.trigger&&a.valueNode&&c&&d&&v&&y&&b){let e=a.trigger.getBoundingClientRect(),t=d.getBoundingClientRect(),n=a.valueNode.getBoundingClientRect(),i=b.getBoundingClientRect();if(a.dir!==`rtl`){let r=i.left-t.left,a=n.left-r,o=e.left-a,s=e.width+o,l=Math.max(s,t.width),u=window.innerWidth-Q,d=Sn(a,[Q,Math.max(Q,u-l)]);c.style.minWidth=s+`px`,c.style.left=d+`px`}else{let r=t.right-i.right,a=window.innerWidth-n.right-r,o=window.innerWidth-e.right-a,s=e.width+o,l=Math.max(s,t.width),u=window.innerWidth-Q,d=Sn(a,[Q,Math.max(Q,u-l)]);c.style.minWidth=s+`px`,c.style.right=d+`px`}let o=m(),s=window.innerHeight-Q*2,l=v.scrollHeight,u=window.getComputedStyle(d),f=parseInt(u.borderTopWidth,10),p=parseInt(u.paddingTop,10),g=parseInt(u.borderBottomWidth,10),_=parseInt(u.paddingBottom,10),x=f+p+l+_+g,S=Math.min(y.offsetHeight*5,x),C=window.getComputedStyle(v),w=parseInt(C.paddingTop,10),T=parseInt(C.paddingBottom,10),E=e.top+e.height/2-Q,D=s-E,O=y.offsetHeight/2,k=y.offsetTop+O,A=f+p+k,j=x-A;if(A<=E){let e=o.length>0&&y===o[o.length-1].ref.current;c.style.bottom=`0px`;let t=d.clientHeight-v.offsetTop-v.offsetHeight,n=A+Math.max(D,O+(e?T:0)+t+g);c.style.height=n+`px`}else{let e=o.length>0&&y===o[0].ref.current;c.style.top=`0px`;let t=Math.max(E,f+v.offsetTop+(e?w:0)+O)+j;c.style.height=t+`px`,v.scrollTop=A-E+v.offsetTop}c.style.margin=`${Q}px 0`,c.style.minHeight=S+`px`,c.style.maxHeight=s+`px`,r?.(),requestAnimationFrame(()=>h.current=!0)}},[m,a.trigger,a.valueNode,c,d,v,y,b,a.dir,r]);g(()=>S(),[S]);let[C,w]=q.useState();return g(()=>{d&&w(window.getComputedStyle(d).zIndex)},[d]),(0,J.jsx)(or,{scope:n,contentWrapper:c,shouldExpandOnScrollRef:h,onScrollButtonChange:q.useCallback(e=>{e&&_.current===!0&&(S(),x?.(),_.current=!1)},[S,x]),children:(0,J.jsx)(`div`,{ref:l,style:{display:`flex`,flexDirection:`column`,position:`fixed`,zIndex:C},children:(0,J.jsx)(s.div,{...i,ref:p,style:{boxSizing:`border-box`,maxHeight:`100%`,...i.style}})})})});rr.displayName=nr;var ir=`SelectPopperPosition`,ar=q.forwardRef((e,t)=>{let{__scopeSelect:n,align:r=`start`,collisionPadding:i=Q,...a}=e,o=Rn(n);return(0,J.jsx)(bn,{...o,...a,ref:t,align:r,collisionPadding:i,style:{boxSizing:`border-box`,...a.style,"--radix-select-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-select-content-available-width":`var(--radix-popper-available-width)`,"--radix-select-content-available-height":`var(--radix-popper-available-height)`,"--radix-select-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-select-trigger-height":`var(--radix-popper-anchor-height)`}})});ar.displayName=ir;var[or,sr]=In(Z,{}),cr=`SelectViewport`,lr=q.forwardRef((e,t)=>{let{__scopeSelect:n,nonce:r,...i}=e,o=$(cr,n),c=sr(cr,n),l=u(t,o.onViewportChange),d=q.useRef(0);return(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(`style`,{dangerouslySetInnerHTML:{__html:`[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}`},nonce:r}),(0,J.jsx)(Nn.Slot,{scope:n,children:(0,J.jsx)(s.div,{"data-radix-select-viewport":``,role:`presentation`,...i,ref:l,style:{position:`relative`,flex:1,overflow:`hidden auto`,...i.style},onScroll:a(i.onScroll,e=>{let t=e.currentTarget,{contentWrapper:n,shouldExpandOnScrollRef:r}=c;if(r?.current&&n){let e=Math.abs(d.current-t.scrollTop);if(e>0){let r=window.innerHeight-Q*2,i=parseFloat(n.style.minHeight),a=parseFloat(n.style.height),o=Math.max(i,a);if(o<r){let i=o+e,a=Math.min(r,i),s=i-a;n.style.height=a+`px`,n.style.bottom===`0px`&&(t.scrollTop=s>0?s:0,n.style.justifyContent=`flex-end`)}}}d.current=t.scrollTop})})})]})});lr.displayName=cr;var ur=`SelectGroup`,[dr,fr]=In(ur),pr=q.forwardRef((e,t)=>{let{__scopeSelect:n,...r}=e,i=l();return(0,J.jsx)(dr,{scope:n,id:i,children:(0,J.jsx)(s.div,{role:`group`,"aria-labelledby":i,...r,ref:t})})});pr.displayName=ur;var mr=`SelectLabel`,hr=q.forwardRef((e,t)=>{let{__scopeSelect:n,...r}=e,i=fr(mr,n);return(0,J.jsx)(s.div,{id:i.id,...r,ref:t})});hr.displayName=mr;var gr=`SelectItem`,[_r,vr]=In(gr),yr=q.forwardRef((e,t)=>{let{__scopeSelect:n,value:r,disabled:i=!1,textValue:o,...c}=e,d=X(gr,n),f=$(gr,n),p=d.value===r,[m,h]=q.useState(o??``),[g,_]=q.useState(!1),v=u(t,e=>f.itemRefCallback?.(e,r,i)),y=l(),b=q.useRef(`touch`),x=()=>{i||(d.onValueChange(r),d.onOpenChange(!1))};if(r===``)throw Error(`A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.`);return(0,J.jsx)(_r,{scope:n,value:r,disabled:i,textId:y,isSelected:p,onItemTextChange:q.useCallback(e=>{h(t=>t||(e?.textContent??``).trim())},[]),children:(0,J.jsx)(Nn.ItemSlot,{scope:n,value:r,disabled:i,textValue:m,children:(0,J.jsx)(s.div,{role:`option`,"aria-labelledby":y,"data-highlighted":g?``:void 0,"aria-selected":p&&g,"data-state":p?`checked`:`unchecked`,"aria-disabled":i||void 0,"data-disabled":i?``:void 0,tabIndex:i?void 0:-1,...c,ref:v,onFocus:a(c.onFocus,()=>_(!0)),onBlur:a(c.onBlur,()=>_(!1)),onClick:a(c.onClick,()=>{b.current!==`mouse`&&x()}),onPointerUp:a(c.onPointerUp,()=>{b.current===`mouse`&&x()}),onPointerDown:a(c.onPointerDown,e=>{b.current=e.pointerType}),onPointerMove:a(c.onPointerMove,e=>{b.current=e.pointerType,i?f.onItemLeave?.():b.current===`mouse`&&e.currentTarget.focus({preventScroll:!0})}),onPointerLeave:a(c.onPointerLeave,e=>{e.currentTarget===document.activeElement&&f.onItemLeave?.()}),onKeyDown:a(c.onKeyDown,e=>{f.searchRef?.current!==``&&e.key===` `||(Mn.includes(e.key)&&x(),e.key===` `&&e.preventDefault())})})})})});yr.displayName=gr;var br=`SelectItemText`,xr=q.forwardRef((e,t)=>{let{__scopeSelect:n,className:r,style:i,...a}=e,o=X(br,n),c=$(br,n),l=vr(br,n),d=Vn(br,n),[f,p]=q.useState(null),m=u(t,e=>p(e),l.onItemTextChange,e=>c.itemTextRefCallback?.(e,l.value,l.disabled)),h=f?.textContent,_=q.useMemo(()=>(0,J.jsx)(`option`,{value:l.value,disabled:l.disabled,children:h},l.value),[l.disabled,l.value,h]),{onNativeOptionAdd:v,onNativeOptionRemove:y}=d;return g(()=>(v(_),()=>y(_)),[v,y,_]),(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(s.span,{id:l.textId,...a,ref:m}),l.isSelected&&o.valueNode&&!o.valueNodeHasChildren?Pt.createPortal(a.children,o.valueNode):null]})});xr.displayName=br;var Sr=`SelectItemIndicator`,Cr=q.forwardRef((e,t)=>{let{__scopeSelect:n,...r}=e;return vr(Sr,n).isSelected?(0,J.jsx)(s.span,{"aria-hidden":!0,...r,ref:t}):null});Cr.displayName=Sr;var wr=`SelectScrollUpButton`,Tr=q.forwardRef((e,t)=>{let n=$(wr,e.__scopeSelect),r=sr(wr,e.__scopeSelect),[i,a]=q.useState(!1),o=u(t,r.onScrollButtonChange);return g(()=>{if(n.viewport&&n.isPositioned){let e=function(){a(t.scrollTop>0)},t=n.viewport;return e(),t.addEventListener(`scroll`,e),()=>t.removeEventListener(`scroll`,e)}},[n.viewport,n.isPositioned]),i?(0,J.jsx)(Or,{...e,ref:o,onAutoScroll:()=>{let{viewport:e,selectedItem:t}=n;e&&t&&(e.scrollTop-=t.offsetHeight)}}):null});Tr.displayName=wr;var Er=`SelectScrollDownButton`,Dr=q.forwardRef((e,t)=>{let n=$(Er,e.__scopeSelect),r=sr(Er,e.__scopeSelect),[i,a]=q.useState(!1),o=u(t,r.onScrollButtonChange);return g(()=>{if(n.viewport&&n.isPositioned){let e=function(){let e=t.scrollHeight-t.clientHeight;a(Math.ceil(t.scrollTop)<e)},t=n.viewport;return e(),t.addEventListener(`scroll`,e),()=>t.removeEventListener(`scroll`,e)}},[n.viewport,n.isPositioned]),i?(0,J.jsx)(Or,{...e,ref:o,onAutoScroll:()=>{let{viewport:e,selectedItem:t}=n;e&&t&&(e.scrollTop+=t.offsetHeight)}}):null});Dr.displayName=Er;var Or=q.forwardRef((e,t)=>{let{__scopeSelect:n,onAutoScroll:r,...i}=e,o=$(`SelectScrollButton`,n),c=q.useRef(null),l=Pn(n),u=q.useCallback(()=>{c.current!==null&&(window.clearInterval(c.current),c.current=null)},[]);return q.useEffect(()=>()=>u(),[u]),g(()=>{l().find(e=>e.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:`nearest`})},[l]),(0,J.jsx)(s.div,{"aria-hidden":!0,...i,ref:t,style:{flexShrink:0,...i.style},onPointerDown:a(i.onPointerDown,()=>{c.current===null&&(c.current=window.setInterval(r,50))}),onPointerMove:a(i.onPointerMove,()=>{o.onItemLeave?.(),c.current===null&&(c.current=window.setInterval(r,50))}),onPointerLeave:a(i.onPointerLeave,()=>{u()})})}),kr=`SelectSeparator`,Ar=q.forwardRef((e,t)=>{let{__scopeSelect:n,...r}=e;return(0,J.jsx)(s.div,{"aria-hidden":!0,...r,ref:t})});Ar.displayName=kr;var jr=`SelectArrow`,Mr=q.forwardRef((e,t)=>{let{__scopeSelect:n,...r}=e,i=Rn(n),a=X(jr,n),o=$(jr,n);return a.open&&o.position===`popper`?(0,J.jsx)(xn,{...i,...r,ref:t}):null});Mr.displayName=jr;var Nr=`SelectBubbleInput`,Pr=q.forwardRef(({__scopeSelect:e,value:t,...n},r)=>{let i=q.useRef(null),a=u(r,i),o=En(t);return q.useEffect(()=>{let e=i.current;if(!e)return;let n=window.HTMLSelectElement.prototype,r=Object.getOwnPropertyDescriptor(n,`value`).set;if(o!==t&&r){let n=new Event(`change`,{bubbles:!0});r.call(e,t),e.dispatchEvent(n)}},[o,t]),(0,J.jsx)(s.select,{...n,style:{...Dn,...n.style},ref:a,defaultValue:t})});Pr.displayName=Nr;function Fr(e){return e===``||e===void 0}function Ir(e){let t=v(e),n=q.useRef(``),r=q.useRef(0),i=q.useCallback(e=>{let i=n.current+e;t(i),(function e(t){n.current=t,window.clearTimeout(r.current),t!==``&&(r.current=window.setTimeout(()=>e(``),1e3))})(i)},[t]),a=q.useCallback(()=>{n.current=``,window.clearTimeout(r.current)},[]);return q.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,i,a]}function Lr(e,t,n){let r=t.length>1&&Array.from(t).every(e=>e===t[0])?t[0]:t,i=n?e.indexOf(n):-1,a=Rr(e,Math.max(i,0));r.length===1&&(a=a.filter(e=>e!==n));let o=a.find(e=>e.textValue.toLowerCase().startsWith(r.toLowerCase()));return o===n?void 0:o}function Rr(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var zr=Hn,Br=Wn,Vr=Kn,Hr=Jn,Ur=Xn,Wr=Zn,Gr=lr,Kr=pr,qr=hr,Jr=yr,Yr=xr,Xr=Cr,Zr=Tr,Qr=Dr,$r=Ar,ei=zr,ti=Vr,ni=q.forwardRef(({className:e,children:t,...n},i)=>(0,J.jsxs)(Br,{ref:i,className:r(`flex h-9 w-full items-center justify-between whitespace-nowrap rounded-xl border border-gray-200/80 bg-transparent px-3 py-2 text-sm shadow-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-1 focus:ring-primary/40 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1 bg-white`,e),...n,children:[t,(0,J.jsx)(Hr,{asChild:!0,children:(0,J.jsx)(S,{className:`h-4 w-4 opacity-50`})})]}));ni.displayName=Br.displayName;var ri=q.forwardRef(({className:e,...t},n)=>(0,J.jsx)(Zr,{ref:n,className:r(`flex cursor-default items-center justify-center py-1`,e),...t,children:(0,J.jsx)(C,{className:`h-4 w-4`})}));ri.displayName=Zr.displayName;var ii=q.forwardRef(({className:e,...t},n)=>(0,J.jsx)(Qr,{ref:n,className:r(`flex cursor-default items-center justify-center py-1`,e),...t,children:(0,J.jsx)(S,{className:`h-4 w-4`})}));ii.displayName=Qr.displayName;var ai=q.forwardRef(({className:e,children:t,position:n=`popper`,...i},a)=>(0,J.jsx)(Ur,{children:(0,J.jsxs)(Wr,{ref:a,className:r(`relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 bg-white`,n===`popper`&&`data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1`,e),position:n,...i,children:[(0,J.jsx)(ri,{}),(0,J.jsx)(Gr,{className:r(`p-1`,n===`popper`&&`h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]`),children:t}),(0,J.jsx)(ii,{})]})}));ai.displayName=Wr.displayName;var oi=q.forwardRef(({className:e,...t},n)=>(0,J.jsx)(qr,{ref:n,className:r(`px-2 py-1.5 text-sm font-semibold`,e),...t}));oi.displayName=qr.displayName;var si=q.forwardRef(({className:e,children:t,...n},i)=>(0,J.jsxs)(Jr,{ref:i,className:r(`relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-2 pr-8 text-sm outline-none focus:bg-gray-100 focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 hover:bg-gray-100`,e),...n,children:[(0,J.jsx)(`span`,{className:`absolute right-2 flex h-3.5 w-3.5 items-center justify-center`,children:(0,J.jsx)(Xr,{children:(0,J.jsx)(x,{className:`h-4 w-4`})})}),(0,J.jsx)(Yr,{children:t})]}));si.displayName=Jr.displayName;var ci=q.forwardRef(({className:e,...t},n)=>(0,J.jsx)($r,{ref:n,className:r(`-mx-1 my-1 h-px bg-muted`,e),...t}));ci.displayName=$r.displayName;export{xn as C,C as D,tn as E,S as O,yn as S,vn as T,$r as _,ti as a,Gr as b,Hr as c,Yr as d,qr as f,Zr as g,Qr as h,ni as i,x as k,Jr as l,zr as m,ai as n,Wr as o,Ur as p,si as r,Kr as s,ei as t,Xr as u,Br as v,bn as w,An as x,Vr as y};
@@ -0,0 +1 @@
1
+ import{_ as e,m as t,p as n,u as r}from"./i18n-DvzXOGQX.js";import{s as i}from"./dist-ZwoAXs46.js";var a=e(t(),1),o=n(),s=i(`flex items-start justify-between gap-4 rounded-xl border p-4`,{variants:{tone:{default:`border-gray-200 bg-white`,muted:`border-gray-200 bg-gray-50`}},defaultVariants:{tone:`default`}}),c=a.forwardRef(({className:e,tone:t,title:n,description:i,control:a,children:c,...l},u)=>(0,o.jsxs)(`div`,{ref:u,className:r(s({tone:t}),e),...l,children:[(0,o.jsxs)(`div`,{className:`min-w-0 flex-1 space-y-2`,children:[(0,o.jsx)(`div`,{className:`text-sm font-medium text-gray-900`,children:n}),i?(0,o.jsx)(`p`,{className:`text-sm leading-6 text-gray-500`,children:i}):null,c]}),a?(0,o.jsx)(`div`,{className:`shrink-0`,children:a}):null]}));c.displayName=`SettingRow`;export{c as t};
@@ -0,0 +1 @@
1
+ import{p as e,u as t}from"./i18n-DvzXOGQX.js";var n=e();function r({className:e,...r}){return(0,n.jsx)(`div`,{className:t(`animate-pulse rounded-md bg-slate-200`,e),...r})}export{r as t};
@@ -1 +1 @@
1
- import{_ as e,m as t,p as n,u as r}from"./i18n-eDHeDY0n.js";var i=e(t(),1),a=n(),o=i.forwardRef(({className:e,checked:t=!1,onCheckedChange:n,...i},o)=>(0,a.jsx)(`button`,{type:`button`,role:`switch`,"aria-checked":t,ref:o,className:r(`peer inline-flex h-[22px] w-10 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors duration-fast focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary focus-visible:ring-offset-2 focus-visible:ring-offset-white disabled:cursor-not-allowed disabled:opacity-50`,t?`bg-primary`:`bg-gray-200/80 hover:bg-gray-300/80`,e),onClick:()=>n?.(!t),...i,children:(0,a.jsx)(`span`,{className:r(`pointer-events-none block h-5 w-5 rounded-full bg-white shadow-md ring-0 transition-transform duration-fast`,t?`translate-x-5`:`translate-x-0`)})}));o.displayName=`Switch`;export{o as t};
1
+ import{_ as e,m as t,p as n,u as r}from"./i18n-DvzXOGQX.js";var i=e(t(),1),a=n(),o=i.forwardRef(({className:e,checked:t=!1,onCheckedChange:n,...i},o)=>(0,a.jsx)(`button`,{type:`button`,role:`switch`,"aria-checked":t,ref:o,className:r(`peer inline-flex h-[22px] w-10 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors duration-fast focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary focus-visible:ring-offset-2 focus-visible:ring-offset-white disabled:cursor-not-allowed disabled:opacity-50`,t?`bg-primary`:`bg-gray-200/80 hover:bg-gray-300/80`,e),onClick:()=>n?.(!t),...i,children:(0,a.jsx)(`span`,{className:r(`pointer-events-none block h-5 w-5 rounded-full bg-white shadow-md ring-0 transition-transform duration-fast`,t?`translate-x-5`:`translate-x-0`)})}));o.displayName=`Switch`;export{o as t};
@@ -1 +1 @@
1
- import{m as e,p as t,r as n,u as r}from"./i18n-eDHeDY0n.js";e();var i=t();function a({tabs:e,activeTab:t,onChange:a,className:o}){return(0,i.jsx)(`div`,{className:r(`flex items-center gap-6 border-b border-gray-200/60 mb-6`,o),children:e.map(e=>{let o=t===e.id;return(0,i.jsxs)(`button`,{onClick:()=>a(e.id),className:r(`relative pb-3 text-[14px] font-medium transition-all duration-fast flex items-center gap-1.5`,o?`text-gray-900`:`text-gray-600 hover:text-gray-900`),children:[e.label,e.count!==void 0&&(0,i.jsx)(`span`,{className:r(`text-[11px] font-medium`,`text-gray-500`),children:n(e.count)}),o&&(0,i.jsx)(`div`,{className:`absolute bottom-0 left-0 right-0 h-[2px] bg-primary rounded-full`})]},e.id)})})}export{a as t};
1
+ import{m as e,p as t,r as n,u as r}from"./i18n-DvzXOGQX.js";e();var i=t();function a({tabs:e,activeTab:t,onChange:a,className:o}){return(0,i.jsx)(`div`,{className:r(`flex items-center gap-6 border-b border-gray-200/60 mb-6`,o),children:e.map(e=>{let o=t===e.id;return(0,i.jsxs)(`button`,{onClick:()=>a(e.id),className:r(`relative pb-3 text-[14px] font-medium transition-all duration-fast flex items-center gap-1.5`,o?`text-gray-900`:`text-gray-600 hover:text-gray-900`),children:[e.label,e.count!==void 0&&(0,i.jsx)(`span`,{className:r(`text-[11px] font-medium`,`text-gray-500`),children:n(e.count)}),o&&(0,i.jsx)(`div`,{className:`absolute bottom-0 left-0 right-0 h-[2px] bg-primary rounded-full`})]},e.id)})})}export{a as t};
@@ -0,0 +1 @@
1
+ import{_ as e,m as t,p as n,u as r}from"./i18n-DvzXOGQX.js";import{s as i}from"./dist-ZwoAXs46.js";var a=e(t(),1),o=n(),s=i(`inline-flex items-center gap-1 rounded-full border px-2 py-0.5 text-[11px] font-medium`,{variants:{tone:{subtle:`border-gray-200 bg-gray-50 text-gray-600`,neutral:`border-gray-200 bg-white text-gray-600`,success:`border-emerald-200 bg-emerald-50 text-emerald-700`,warning:`border-amber-200 bg-amber-50 text-amber-800`,danger:`border-rose-200 bg-rose-50 text-rose-600`,info:`border-primary/20 bg-primary/10 text-primary`}},defaultVariants:{tone:`subtle`}}),c=a.forwardRef(({className:e,tone:t,...n},i)=>(0,o.jsx)(`span`,{ref:i,className:r(s({tone:t}),e),...n}));c.displayName=`TagChip`;export{c as t};
@@ -1 +1 @@
1
- import{t as e}from"./createLucideIcon-BSeTgkZW.js";var t=e(`Trash2`,[[`path`,{d:`M3 6h18`,key:`d0wm0j`}],[`path`,{d:`M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6`,key:`4alrt4`}],[`path`,{d:`M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2`,key:`v07s0e`}],[`line`,{x1:`10`,x2:`10`,y1:`11`,y2:`17`,key:`1uufr5`}],[`line`,{x1:`14`,x2:`14`,y1:`11`,y2:`17`,key:`xtxkd`}]]);export{t};
1
+ import{t as e}from"./createLucideIcon-CCiTGX8L.js";var t=e(`Trash2`,[[`path`,{d:`M3 6h18`,key:`d0wm0j`}],[`path`,{d:`M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6`,key:`4alrt4`}],[`path`,{d:`M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2`,key:`v07s0e`}],[`line`,{x1:`10`,x2:`10`,y1:`11`,y2:`17`,key:`1uufr5`}],[`line`,{x1:`14`,x2:`14`,y1:`11`,y2:`17`,key:`xtxkd`}]]);export{t};
@@ -0,0 +1 @@
1
+ import{_ as e,i as t,m as n,p as r}from"./i18n-DvzXOGQX.js";import{B as i,G as a,K as o,W as s,q as c}from"./client-CszWMVKi.js";import{t as l}from"./createLucideIcon-CCiTGX8L.js";import{a as u,i as d,n as f,r as p,t as m}from"./select-BILPf7zs.js";import{t as h}from"./skeleton-COKMAnJy.js";var g=class extends c{constructor(e,t){super(e,t)}bindMethods(){super.bindMethods(),this.fetchNextPage=this.fetchNextPage.bind(this),this.fetchPreviousPage=this.fetchPreviousPage.bind(this)}setOptions(e){super.setOptions({...e,behavior:o()})}getOptimisticResult(e){return e.behavior=o(),super.getOptimisticResult(e)}fetchNextPage(e){return this.fetch({...e,meta:{fetchMore:{direction:`forward`}}})}fetchPreviousPage(e){return this.fetch({...e,meta:{fetchMore:{direction:`backward`}}})}createResult(e,t){let{state:n}=e,r=super.createResult(e,t),{isFetching:i,isRefetching:o,isError:c,isRefetchError:l}=r,u=n.fetchMeta?.fetchMore?.direction,d=c&&u===`forward`,f=i&&u===`forward`,p=c&&u===`backward`,m=i&&u===`backward`;return{...r,fetchNextPage:this.fetchNextPage,fetchPreviousPage:this.fetchPreviousPage,hasNextPage:s(t,n.data),hasPreviousPage:a(t,n.data),isFetchNextPageError:d,isFetchingNextPage:f,isFetchPreviousPageError:p,isFetchingPreviousPage:m,isRefetchError:l&&!d&&!p,isRefetching:o&&!f&&!m}}};function _(e,t){return i(e,g,t)}var v=l(`PackageSearch`,[[`path`,{d:`M21 10V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l2-1.14`,key:`e7tb2h`}],[`path`,{d:`m7.5 4.27 9 5.15`,key:`1c824w`}],[`polyline`,{points:`3.29 7 12 12 20.71 7`,key:`ousv84`}],[`line`,{x1:`12`,x2:`12`,y1:`22`,y2:`12`,key:`a4e8g8`}],[`circle`,{cx:`18.5`,cy:`15.5`,r:`2.5`,key:`b5zd12`}],[`path`,{d:`M20.27 17.27 22 19`,key:`1l4muz`}]]);function y(e){if(!e||e.pages.length===0)return;let t=e.pages.flatMap(e=>e.items);return{...e.pages[e.pages.length-1],items:t,pages:e.pages,loadedItems:t.length,loadedPages:e.pages.length}}var b=r();function x(e){return(0,b.jsx)(`div`,{className:`mb-4`,children:(0,b.jsxs)(`div`,{className:`flex gap-3 items-center`,children:[(0,b.jsxs)(`div`,{className:`flex-1 min-w-0 relative`,children:[(0,b.jsx)(v,{className:`h-4 w-4 text-gray-400 absolute left-3 top-1/2 -translate-y-1/2`}),(0,b.jsx)(`input`,{value:e.searchText,onChange:t=>e.onSearchTextChange(t.target.value),placeholder:e.searchPlaceholder,className:`w-full h-9 border border-gray-200/80 rounded-xl pl-9 pr-3 text-sm focus:outline-none focus:ring-1 focus:ring-primary/40`})]}),e.scope===`all`&&(0,b.jsxs)(m,{value:e.sort,onValueChange:t=>e.onSortChange(t),children:[(0,b.jsx)(d,{className:`h-9 w-[150px] shrink-0 rounded-lg`,children:(0,b.jsx)(u,{})}),(0,b.jsxs)(f,{children:[(0,b.jsx)(p,{value:`relevance`,children:t(`marketplaceSortRelevance`)}),(0,b.jsx)(p,{value:`updated`,children:t(`marketplaceSortUpdated`)})]})]})]})})}function S(e){return(0,b.jsx)(b.Fragment,{children:Array.from({length:e.count},(e,t)=>(0,b.jsx)(`article`,{className:`rounded-2xl border border-gray-200/40 bg-white px-5 py-4 shadow-sm`,children:(0,b.jsxs)(`div`,{className:`flex items-start gap-3.5 justify-between`,children:[(0,b.jsxs)(`div`,{className:`flex min-w-0 flex-1 gap-3`,children:[(0,b.jsx)(h,{className:`h-10 w-10 shrink-0 rounded-xl`}),(0,b.jsxs)(`div`,{className:`min-w-0 flex-1 space-y-2 pt-0.5`,children:[(0,b.jsx)(h,{className:`h-4 w-32 max-w-[70%]`}),(0,b.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,b.jsx)(h,{className:`h-3 w-12`}),(0,b.jsx)(h,{className:`h-3 w-24`})]}),(0,b.jsx)(h,{className:`h-3 w-full`})]})]}),(0,b.jsx)(h,{className:`h-8 w-20 shrink-0 rounded-xl`})]})},`marketplace-skeleton-${t}`))})}function C(e){return!e.hasMore&&!e.loading?null:(0,b.jsxs)(`div`,{className:`py-4`,children:[e.hasMore&&(0,b.jsx)(`div`,{ref:e.sentinelRef,className:`h-1 w-full`,"aria-hidden":`true`}),e.loading&&(0,b.jsx)(`div`,{"data-testid":`marketplace-loading-more`,className:`pt-3 text-center text-xs text-gray-500`,children:t(`loading`)})]})}function w(e){let t=e.trim().toLowerCase().replace(/_/g,`-`),n=[t,t.split(`-`)[0],`en`];return Array.from(new Set(n.filter(Boolean)))}function T(e){return e.trim().toLowerCase().replace(/_/g,`-`)}function E(e,t,n){if(e){let t=Object.entries(e).map(([e,t])=>({locale:T(e),text:typeof t==`string`?t.trim():``})).filter(e=>e.text.length>0);if(t.length>0){let e=new Map(t.map(e=>[e.locale,e.text]));for(let t of n){let n=T(t),r=e.get(n);if(r)return r}for(let e of n){let n=T(e).split(`-`)[0];if(!n)continue;let r=t.find(e=>e.locale===n||e.locale.startsWith(`${n}-`));if(r)return r.text}return t[0]?.text??``}}return t?.trim()??``}function D(e,t){if(!e)return``;for(let n of t)if(T(n).split(`-`)[0]===`zh`&&e.descriptionZh?.trim())return e.descriptionZh.trim();return e.description?.trim()?e.description.trim():e.descriptionZh?.trim()?e.descriptionZh.trim():``}var O=e(n(),1),k=160;function A(e){let t=(0,O.useRef)(null),n=(0,O.useRef)(null),r=(0,O.useRef)(e.onLoadMore),i=(0,O.useRef)(!1);return(0,O.useEffect)(()=>{r.current=e.onLoadMore},[e.onLoadMore]),(0,O.useEffect)(()=>{e.disabled&&(i.current=!1)},[e.disabled]),(0,O.useEffect)(()=>{let a=t.current,o=n.current,s=e.thresholdPx??k;if(e.disabled||!a||!o)return;let c=()=>{i.current||e.disabled||(i.current=!0,Promise.resolve(r.current()).finally(()=>{i.current=!1}))},l=()=>{o.getBoundingClientRect().top-a.getBoundingClientRect().bottom<=s&&c()};if(typeof IntersectionObserver==`function`){let e=new IntersectionObserver(e=>{e.some(e=>e.isIntersecting)&&c()},{root:a,rootMargin:`0px 0px ${s}px 0px`});return e.observe(o),l(),()=>{e.disconnect()}}return a.addEventListener(`scroll`,l,{passive:!0}),l(),()=>{a.removeEventListener(`scroll`,l)}},[e.disabled,e.thresholdPx,e.watchValue]),{containerRef:t,sentinelRef:n}}export{x as a,y as c,E as i,_ as l,w as n,C as o,D as r,S as s,A as t};
@@ -0,0 +1 @@
1
+ import{_ as e,i as t,m as n,p as r}from"./i18n-DvzXOGQX.js";import{o as i}from"./dist-ZwoAXs46.js";import{a,i as o,n as s,o as c,r as l,t as u}from"./dialog-BghZFPch.js";var d=e(n(),1),f=r(),p=({open:e,onOpenChange:n,title:r,description:d,confirmLabel:p=t(`confirm`),cancelLabel:m=t(`cancel`),variant:h=`default`,onConfirm:g,onCancel:_})=>(0,f.jsx)(u,{open:e,onOpenChange:n,children:(0,f.jsxs)(s,{className:`[&>:last-child]:hidden`,onCloseAutoFocus:e=>e.preventDefault(),children:[(0,f.jsxs)(a,{children:[(0,f.jsx)(c,{children:r}),d?(0,f.jsx)(l,{children:d}):null]}),(0,f.jsxs)(o,{className:`gap-2 sm:gap-0`,children:[(0,f.jsx)(i,{type:`button`,variant:`outline`,onClick:()=>{_(),n(!1)},children:m}),(0,f.jsx)(i,{type:`button`,variant:h===`destructive`?`destructive`:`default`,onClick:()=>{g(),n(!1)},children:p})]})]})}),m={open:!1,title:``,description:``,confirmLabel:t(`confirm`),cancelLabel:t(`cancel`),variant:`default`,resolve:null};function h(){let[e,n]=(0,d.useState)(m),r=(0,d.useCallback)(e=>new Promise(r=>{n({open:!0,title:e.title,description:e.description??``,confirmLabel:e.confirmLabel??t(`confirm`),cancelLabel:e.cancelLabel??t(`cancel`),variant:e.variant??`default`,resolve:e=>{r(e),n(e=>({...e,open:!1,resolve:null}))}})}),[]),i=(0,d.useCallback)(e=>{n(t=>(!e&&t.resolve&&t.resolve(!1),{...t,open:e,resolve:e?t.resolve:null}))},[]);return{confirm:r,ConfirmDialog:(0,d.useCallback)(()=>(0,f.jsx)(p,{open:e.open,onOpenChange:i,title:e.title,description:e.description||void 0,confirmLabel:e.confirmLabel,cancelLabel:e.cancelLabel,variant:e.variant,onConfirm:()=>e.resolve?.(!0),onCancel:()=>e.resolve?.(!1)}),[e,i])}}export{h as t};
@@ -1 +1 @@
1
- import{_ as e,m as t}from"./i18n-eDHeDY0n.js";import{A as n,D as r,O as i,b as a,l as o,p as s,s as c,w as l}from"./client-_i4MU2bB.js";var u=class extends n{#e;#t=void 0;#n;#r;constructor(e,t){super(),this.#e=e,this.setOptions(t),this.bindMethods(),this.#i()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(e){let t=this.options;this.options=this.#e.defaultMutationOptions(e),r(this.options,t)||this.#e.getMutationCache().notify({type:`observerOptionsUpdated`,mutation:this.#n,observer:this}),t?.mutationKey&&this.options.mutationKey&&a(t.mutationKey)!==a(this.options.mutationKey)?this.reset():this.#n?.state.status===`pending`&&this.#n.setOptions(this.options)}onUnsubscribe(){this.hasListeners()||this.#n?.removeObserver(this)}onMutationUpdate(e){this.#i(),this.#a(e)}getCurrentResult(){return this.#t}reset(){this.#n?.removeObserver(this),this.#n=void 0,this.#i(),this.#a()}mutate(e,t){return this.#r=t,this.#n?.removeObserver(this),this.#n=this.#e.getMutationCache().build(this.#e,this.options),this.#n.addObserver(this),this.#n.execute(e)}#i(){let e=this.#n?.state??o();this.#t={...e,isPending:e.status===`pending`,isSuccess:e.status===`success`,isError:e.status===`error`,isIdle:e.status===`idle`,mutate:this.mutate,reset:this.reset}}#a(e){s.batch(()=>{if(this.#r&&this.hasListeners()){let t=this.#t.variables,n=this.#t.context,r={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};if(e?.type===`success`){try{this.#r.onSuccess?.(e.data,t,n,r)}catch(e){Promise.reject(e)}try{this.#r.onSettled?.(e.data,null,t,n,r)}catch(e){Promise.reject(e)}}else if(e?.type===`error`){try{this.#r.onError?.(e.error,t,n,r)}catch(e){Promise.reject(e)}try{this.#r.onSettled?.(void 0,e.error,t,n,r)}catch(e){Promise.reject(e)}}}this.listeners.forEach(e=>{e(this.#t)})})}},d=e(t(),1);function f(e,t){let n=c(t),[r]=d.useState(()=>new u(n,e));d.useEffect(()=>{r.setOptions(e)},[r,e]);let a=d.useSyncExternalStore(d.useCallback(e=>r.subscribe(s.batchCalls(e)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),o=d.useCallback((e,t)=>{r.mutate(e,t).catch(l)},[r]);if(a.error&&i(r.options.throwOnError,[a.error]))throw a.error;return{...a,mutate:o,mutateAsync:a.mutate}}export{f as t};
1
+ import{_ as e,m as t}from"./i18n-DvzXOGQX.js";import{$ as n,H as r,J as i,Q as a,U as o,X as s,Y as c,Z as l}from"./client-CszWMVKi.js";var u=class extends n{#e;#t=void 0;#n;#r;constructor(e,t){super(),this.#e=e,this.setOptions(t),this.bindMethods(),this.#i()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(e){let t=this.options;this.options=this.#e.defaultMutationOptions(e),l(this.options,t)||this.#e.getMutationCache().notify({type:`observerOptionsUpdated`,mutation:this.#n,observer:this}),t?.mutationKey&&this.options.mutationKey&&c(t.mutationKey)!==c(this.options.mutationKey)?this.reset():this.#n?.state.status===`pending`&&this.#n.setOptions(this.options)}onUnsubscribe(){this.hasListeners()||this.#n?.removeObserver(this)}onMutationUpdate(e){this.#i(),this.#a(e)}getCurrentResult(){return this.#t}reset(){this.#n?.removeObserver(this),this.#n=void 0,this.#i(),this.#a()}mutate(e,t){return this.#r=t,this.#n?.removeObserver(this),this.#n=this.#e.getMutationCache().build(this.#e,this.options),this.#n.addObserver(this),this.#n.execute(e)}#i(){let e=this.#n?.state??o();this.#t={...e,isPending:e.status===`pending`,isSuccess:e.status===`success`,isError:e.status===`error`,isIdle:e.status===`idle`,mutate:this.mutate,reset:this.reset}}#a(e){i.batch(()=>{if(this.#r&&this.hasListeners()){let t=this.#t.variables,n=this.#t.context,r={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};if(e?.type===`success`){try{this.#r.onSuccess?.(e.data,t,n,r)}catch(e){Promise.reject(e)}try{this.#r.onSettled?.(e.data,null,t,n,r)}catch(e){Promise.reject(e)}}else if(e?.type===`error`){try{this.#r.onError?.(e.error,t,n,r)}catch(e){Promise.reject(e)}try{this.#r.onSettled?.(void 0,e.error,t,n,r)}catch(e){Promise.reject(e)}}}this.listeners.forEach(e=>{e(this.#t)})})}},d=e(t(),1);function f(e,t){let n=r(t),[o]=d.useState(()=>new u(n,e));d.useEffect(()=>{o.setOptions(e)},[o,e]);let c=d.useSyncExternalStore(d.useCallback(e=>o.subscribe(i.batchCalls(e)),[o]),()=>o.getCurrentResult(),()=>o.getCurrentResult()),l=d.useCallback((e,t)=>{o.mutate(e,t).catch(s)},[o]);if(c.error&&a(o.options.throwOnError,[c.error]))throw c.error;return{...c,mutate:l,mutateAsync:c.mutate}}export{f as t};
@@ -0,0 +1 @@
1
+ import{t as e}from"./createLucideIcon-CCiTGX8L.js";var t=e(`X`,[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]);export{t};
@@ -78,28 +78,28 @@
78
78
  })();
79
79
  </script>
80
80
  <title>NextClaw</title>
81
- <script type="module" crossorigin src="/assets/index-CF9xve0E.js"></script>
82
- <link rel="modulepreload" crossorigin href="/assets/i18n-eDHeDY0n.js">
83
- <link rel="modulepreload" crossorigin href="/assets/chunk-JZWAC4HX-DK5HPmIK.js">
84
- <link rel="modulepreload" crossorigin href="/assets/dist-ccBFUi-o.js">
85
- <link rel="modulepreload" crossorigin href="/assets/createLucideIcon-BSeTgkZW.js">
86
- <link rel="modulepreload" crossorigin href="/assets/select-DJ2MUjBB.js">
87
- <link rel="modulepreload" crossorigin href="/assets/dist-6TrrnPCR.js">
88
- <link rel="modulepreload" crossorigin href="/assets/client-_i4MU2bB.js">
89
- <link rel="modulepreload" crossorigin href="/assets/infiniteQueryBehavior-ZDS92Qpp.js">
90
- <link rel="modulepreload" crossorigin href="/assets/app-query-client-VnFElj4E.js">
91
- <link rel="modulepreload" crossorigin href="/assets/useMutation-CBWjE2uj.js">
92
- <link rel="modulepreload" crossorigin href="/assets/book-open-BdcxxoQu.js">
93
- <link rel="modulepreload" crossorigin href="/assets/external-link-BgErLCNT.js">
94
- <link rel="modulepreload" crossorigin href="/assets/plus-rYsv72JG.js">
95
- <link rel="modulepreload" crossorigin href="/assets/search-3kFR_zh9.js">
96
- <link rel="modulepreload" crossorigin href="/assets/x-ByDbItbq.js">
97
- <link rel="modulepreload" crossorigin href="/assets/DocBrowserContext-B6SpA7Qs.js">
98
- <link rel="modulepreload" crossorigin href="/assets/DocBrowser-6ReNjvzF.js">
99
- <link rel="modulepreload" crossorigin href="/assets/download-BhDxnyvU.js">
100
- <link rel="modulepreload" crossorigin href="/assets/refresh-cw-C47QSEwg.js">
101
- <link rel="modulepreload" crossorigin href="/assets/config-DtIQwrHF.js">
102
- <link rel="stylesheet" crossorigin href="/assets/index-FgA52VBt.css">
81
+ <script type="module" crossorigin src="/assets/index-lr6rQUSd.js"></script>
82
+ <link rel="modulepreload" crossorigin href="/assets/i18n-DvzXOGQX.js">
83
+ <link rel="modulepreload" crossorigin href="/assets/chunk-JZWAC4HX-erTUn3b8.js">
84
+ <link rel="modulepreload" crossorigin href="/assets/dist-ZwoAXs46.js">
85
+ <link rel="modulepreload" crossorigin href="/assets/es2015-CEAreese.js">
86
+ <link rel="modulepreload" crossorigin href="/assets/createLucideIcon-CCiTGX8L.js">
87
+ <link rel="modulepreload" crossorigin href="/assets/select-BILPf7zs.js">
88
+ <link rel="modulepreload" crossorigin href="/assets/dist-Dd9cr-kz.js">
89
+ <link rel="modulepreload" crossorigin href="/assets/x-BHUGQIUv.js">
90
+ <link rel="modulepreload" crossorigin href="/assets/dialog-BghZFPch.js">
91
+ <link rel="modulepreload" crossorigin href="/assets/client-CszWMVKi.js">
92
+ <link rel="modulepreload" crossorigin href="/assets/useMutation-__AYv-Pz.js">
93
+ <link rel="modulepreload" crossorigin href="/assets/book-open-BE8M56IM.js">
94
+ <link rel="modulepreload" crossorigin href="/assets/external-link-qsnCMhw1.js">
95
+ <link rel="modulepreload" crossorigin href="/assets/plus-I9pBS4Fl.js">
96
+ <link rel="modulepreload" crossorigin href="/assets/search-DxmL3IWE.js">
97
+ <link rel="modulepreload" crossorigin href="/assets/DocBrowserContext-BUq3Wo8O.js">
98
+ <link rel="modulepreload" crossorigin href="/assets/DocBrowser-rDOjI3ga.js">
99
+ <link rel="modulepreload" crossorigin href="/assets/download-D7LOizcW.js">
100
+ <link rel="modulepreload" crossorigin href="/assets/key-round-BLe9D8ND.js">
101
+ <link rel="modulepreload" crossorigin href="/assets/refresh-cw-MNqgR3LZ.js">
102
+ <link rel="stylesheet" crossorigin href="/assets/index-DvVTC9FF.css">
103
103
  </head>
104
104
 
105
105
  <body>
Binary file
@@ -0,0 +1,6 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="146 227 268 265" fill="none">
2
+ <path
3
+ d="M249.176 323.434V298.276C249.176 296.158 249.971 294.569 251.825 293.509L302.406 264.381C309.29 260.409 317.5 258.555 325.973 258.555C357.75 258.555 377.877 283.185 377.877 309.399C377.877 311.253 377.877 313.371 377.611 315.49L325.178 284.771C322.001 282.919 318.822 282.919 315.645 284.771L249.176 323.434ZM367.283 421.415V361.301C367.283 357.592 365.694 354.945 362.516 353.092L296.048 314.43L317.763 301.982C319.617 300.925 321.206 300.925 323.058 301.982L373.639 331.112C388.205 339.586 398.003 357.592 398.003 375.069C398.003 395.195 386.087 413.733 367.283 421.412V421.415ZM233.553 368.452L211.838 355.742C209.986 354.684 209.19 353.095 209.19 350.975V292.718C209.19 264.383 230.905 242.932 260.301 242.932C271.423 242.932 281.748 246.641 290.49 253.26L238.321 283.449C235.146 285.303 233.555 287.951 233.555 291.659V368.455L233.553 368.452ZM280.292 395.462L249.176 377.985V340.913L280.292 323.436L311.407 340.913V377.985L280.292 395.462ZM300.286 475.968C289.163 475.968 278.837 472.259 270.097 465.64L322.264 435.449C325.441 433.597 327.03 430.949 327.03 427.239V350.445L349.011 363.155C350.865 364.213 351.66 365.802 351.66 367.922V426.179C351.66 454.514 329.679 475.965 300.286 475.965V475.968ZM237.525 416.915L186.944 387.785C172.378 379.31 162.582 361.305 162.582 343.827C162.582 323.436 174.763 305.164 193.563 297.485V357.861C193.563 361.571 195.154 364.217 198.33 366.071L264.535 404.467L242.82 416.915C240.967 417.972 239.377 417.972 237.525 416.915ZM234.614 460.343C204.689 460.343 182.71 437.833 182.71 410.028C182.71 407.91 182.976 405.792 183.238 403.672L235.405 433.863C238.582 435.715 241.763 435.715 244.938 433.863L311.407 395.466V420.622C311.407 422.742 310.612 424.331 308.758 425.389L258.179 454.519C251.293 458.491 243.083 460.343 234.611 460.343H234.614ZM300.286 491.854C332.329 491.854 359.073 469.082 365.167 438.892C394.825 431.211 413.892 403.406 413.892 375.073C413.892 356.535 405.948 338.529 391.648 325.552C392.972 319.991 393.766 314.43 393.766 308.87C393.766 271.003 363.048 242.666 327.562 242.666C320.413 242.666 313.528 243.723 306.644 246.109C294.725 234.457 278.307 227.042 260.301 227.042C228.258 227.042 201.513 249.815 195.42 280.004C165.761 287.685 146.694 315.49 146.694 343.824C146.694 362.362 154.638 380.368 168.938 393.344C167.613 398.906 166.819 404.467 166.819 410.027C166.819 447.894 197.538 476.231 233.024 476.231C240.172 476.231 247.058 475.173 253.943 472.788C265.859 484.441 282.278 491.854 300.286 491.854Z"
4
+ fill="#111111"
5
+ />
6
+ </svg>
@@ -1,8 +0,0 @@
1
- import{_ as e,h as t,i as n,m as r,n as i,o as a,p as o,u as s}from"./i18n-eDHeDY0n.js";import{n as c,r as l}from"./dist-ccBFUi-o.js";import{s as u,t as d}from"./client-_i4MU2bB.js";import{t as f}from"./useMutation-CBWjE2uj.js";import{O as p,a as m,i as h,n as g,r as _,t as v}from"./select-DJ2MUjBB.js";import{t as y}from"./createLucideIcon-BSeTgkZW.js";import{t as b}from"./book-open-BdcxxoQu.js";import{t as x}from"./external-link-BgErLCNT.js";import{n as S,t as C}from"./logos-x89HbrZ4.js";import{t as w}from"./hash-Bl7dr_UG.js";import{t as T}from"./loader-circle-ACM1s51e.js";import{t as E}from"./search-3kFR_zh9.js";import{t as D}from"./x-ByDbItbq.js";import{D as ee,_ as te,_t as O,d as k,ft as A,l as j,mt as M,nt as N,tt as P,u as ne}from"./index-CF9xve0E.js";import{t as re}from"./LogoBadge-ByNLYg65.js";import{n as F,t as I}from"./page-layout-vZnghcFy.js";import{t as L}from"./tabs-custom-D3HYMt6k.js";import{t as R}from"./status-dot-vbanNPFU.js";import{t as z}from"./config-hints-BhTmc9P1.js";import{i as B,n as ie,r as ae,t as oe}from"./config-layout-CHs0mAaR.js";import{t as se}from"./switch-BsLtHOH-.js";var ce=y(`Mail`,[[`rect`,{width:`20`,height:`16`,x:`2`,y:`4`,rx:`2`,key:`18n3k1`}],[`path`,{d:`m22 7-8.97 5.7a1.94 1.94 0 0 1-2.06 0L2 7`,key:`1ocrg3`}]]),le=y(`MessageCircleMore`,[[`path`,{d:`M7.9 20A9 9 0 1 0 4 16.1L2 22Z`,key:`vv11sd`}],[`path`,{d:`M8 12h.01`,key:`czm47f`}],[`path`,{d:`M12 12h.01`,key:`1mp3jc`}],[`path`,{d:`M16 12h.01`,key:`1l6xoz`}]]),V=y(`QrCode`,[[`rect`,{width:`5`,height:`5`,x:`3`,y:`3`,rx:`1`,key:`1tu5fj`}],[`rect`,{width:`5`,height:`5`,x:`16`,y:`3`,rx:`1`,key:`1v8r4q`}],[`rect`,{width:`5`,height:`5`,x:`3`,y:`16`,rx:`1`,key:`1x03jg`}],[`path`,{d:`M21 16h-3a2 2 0 0 0-2 2v3`,key:`177gqh`}],[`path`,{d:`M21 21v.01`,key:`ents32`}],[`path`,{d:`M12 7v3a2 2 0 0 1-2 2H7`,key:`8crl2c`}],[`path`,{d:`M3 12h.01`,key:`nlz23k`}],[`path`,{d:`M12 3h.01`,key:`n36tog`}],[`path`,{d:`M12 16v.01`,key:`133mhm`}],[`path`,{d:`M16 12h1`,key:`1slzba`}],[`path`,{d:`M21 12v.01`,key:`1lwtk9`}],[`path`,{d:`M12 21v-1`,key:`1880an`}]]),ue=y(`ToggleLeft`,[[`rect`,{width:`20`,height:`12`,x:`2`,y:`6`,rx:`6`,ry:`6`,key:`f2vt7d`}],[`circle`,{cx:`8`,cy:`12`,r:`2`,key:`1nvbw3`}]]),H=e(r(),1);function U(e){let t=a();return e.tutorialUrls?.[t]||e.tutorialUrls?.default||e.tutorialUrl}var W=o();function de({value:e,onChange:t,className:r,placeholder:i=``}){let[a,o]=(0,H.useState)(``),c=n=>{n.key===`Enter`&&a.trim()?(n.preventDefault(),t([...e,a.trim()]),o(``)):n.key===`Backspace`&&!a&&e.length>0&&t(e.slice(0,-1))},l=n=>{t(e.filter((e,t)=>t!==n))};return(0,W.jsxs)(`div`,{className:s(`flex flex-wrap gap-2 p-2 border rounded-md min-h-[42px]`,r),children:[e.map((e,t)=>(0,W.jsxs)(`span`,{className:`inline-flex items-center gap-1 px-2 py-1 bg-primary text-primary-foreground rounded text-sm`,children:[e,(0,W.jsx)(`button`,{type:`button`,onClick:()=>l(t),className:`hover:text-red-300 transition-colors`,children:(0,W.jsx)(D,{className:`h-3 w-3`})})]},t)),(0,W.jsx)(`input`,{type:`text`,value:a,onChange:e=>o(e.target.value),onKeyDown:c,className:`flex-1 outline-none min-w-[100px] bg-transparent text-sm`,placeholder:i||n(`enterTag`)})]})}function fe(e){return e.includes(`token`)||e.includes(`secret`)||e.includes(`password`)?(0,W.jsx)(O,{className:`h-3.5 w-3.5 text-gray-500`}):e.includes(`url`)||e.includes(`host`)?(0,W.jsx)(S,{className:`h-3.5 w-3.5 text-gray-500`}):e.includes(`email`)||e.includes(`mail`)?(0,W.jsx)(ce,{className:`h-3.5 w-3.5 text-gray-500`}):e.includes(`id`)||e.includes(`from`)?(0,W.jsx)(w,{className:`h-3.5 w-3.5 text-gray-500`}):e===`enabled`||e===`consentGranted`?(0,W.jsx)(ue,{className:`h-3.5 w-3.5 text-gray-500`}):(0,W.jsx)(A,{className:`h-3.5 w-3.5 text-gray-500`})}function G({channelName:e,fields:t,formData:r,jsonDrafts:i,setJsonDrafts:a,updateField:o,uiHints:s}){return(0,W.jsx)(W.Fragment,{children:t.map(t=>{let c=z(`channels.${e}.${t.name}`,s),l=c?.label??t.label,u=c?.placeholder;return(0,W.jsxs)(`div`,{className:`space-y-2.5`,children:[(0,W.jsxs)(P,{htmlFor:t.name,className:`flex items-center gap-2 text-sm font-medium text-gray-900`,children:[fe(t.name),l]}),t.type===`boolean`&&(0,W.jsxs)(`div`,{className:`flex items-center justify-between rounded-xl bg-gray-50 p-3`,children:[(0,W.jsx)(`span`,{className:`text-sm text-gray-500`,children:r[t.name]?n(`enabled`):n(`disabled`)}),(0,W.jsx)(se,{id:t.name,checked:r[t.name]||!1,onCheckedChange:e=>o(t.name,e),className:`data-[state=checked]:bg-emerald-500`})]}),(t.type===`text`||t.type===`email`)&&(0,W.jsx)(N,{id:t.name,type:t.type,value:r[t.name]||``,onChange:e=>o(t.name,e.target.value),placeholder:u,className:`rounded-xl`}),t.type===`password`&&(0,W.jsx)(N,{id:t.name,type:`password`,value:r[t.name]||``,onChange:e=>o(t.name,e.target.value),placeholder:u??n(`leaveBlankToKeepUnchanged`),className:`rounded-xl`}),t.type===`number`&&(0,W.jsx)(N,{id:t.name,type:`number`,value:r[t.name]||0,onChange:e=>o(t.name,parseInt(e.target.value,10)||0),placeholder:u,className:`rounded-xl`}),t.type===`tags`&&(0,W.jsx)(de,{value:r[t.name]||[],onChange:e=>o(t.name,e)}),t.type===`select`&&(0,W.jsxs)(v,{value:r[t.name]||``,onValueChange:e=>o(t.name,e),children:[(0,W.jsx)(h,{className:`rounded-xl`,children:(0,W.jsx)(m,{})}),(0,W.jsx)(g,{children:(t.options??[]).map(e=>(0,W.jsx)(_,{value:e.value,children:e.label},e.value))})]}),t.type===`json`&&(0,W.jsx)(`textarea`,{id:t.name,value:i[t.name]??`{}`,onChange:e=>a(n=>({...n,[t.name]:e.target.value})),className:`min-h-[120px] w-full resize-none rounded-lg border border-gray-200 bg-white px-3 py-2 text-xs font-mono`})]},t.name)})})}var K=[{value:`pairing`,label:`pairing`},{value:`allowlist`,label:`allowlist`},{value:`open`,label:`open`},{value:`disabled`,label:`disabled`}],q=[{value:`open`,label:`open`},{value:`allowlist`,label:`allowlist`},{value:`disabled`,label:`disabled`}],pe=[{value:`off`,label:`off`},{value:`partial`,label:`partial`},{value:`block`,label:`block`},{value:`progress`,label:`progress`}];function me(){return{telegram:{fields:[{name:`enabled`,type:`boolean`,label:n(`enabled`)},{name:`token`,type:`password`,label:n(`botToken`)},{name:`allowFrom`,type:`tags`,label:n(`allowFrom`)},{name:`proxy`,type:`text`,label:n(`proxy`)},{name:`accountId`,type:`text`,label:n(`accountId`)},{name:`dmPolicy`,type:`select`,label:n(`dmPolicy`),options:K},{name:`groupPolicy`,type:`select`,label:n(`groupPolicy`),options:q},{name:`groupAllowFrom`,type:`tags`,label:n(`groupAllowFrom`)},{name:`requireMention`,type:`boolean`,label:n(`requireMention`)},{name:`mentionPatterns`,type:`tags`,label:n(`mentionPatterns`)},{name:`groups`,type:`json`,label:n(`groupRulesJson`)}]},discord:{fields:[{name:`enabled`,type:`boolean`,label:n(`enabled`)},{name:`token`,type:`password`,label:n(`botToken`)},{name:`allowBots`,type:`boolean`,label:n(`allowBotMessages`)},{name:`allowFrom`,type:`tags`,label:n(`allowFrom`)},{name:`gatewayUrl`,type:`text`,label:n(`gatewayUrl`)},{name:`intents`,type:`number`,label:n(`intents`)},{name:`proxy`,type:`text`,label:n(`proxy`)},{name:`mediaMaxMb`,type:`number`,label:n(`attachmentMaxSizeMb`)},{name:`streaming`,type:`select`,label:n(`streamingMode`),options:pe},{name:`draftChunk`,type:`json`,label:n(`draftChunkingJson`)},{name:`textChunkLimit`,type:`number`,label:n(`textChunkLimit`)},{name:`accountId`,type:`text`,label:n(`accountId`)},{name:`dmPolicy`,type:`select`,label:n(`dmPolicy`),options:K},{name:`groupPolicy`,type:`select`,label:n(`groupPolicy`),options:q},{name:`groupAllowFrom`,type:`tags`,label:n(`groupAllowFrom`)},{name:`requireMention`,type:`boolean`,label:n(`requireMention`)},{name:`mentionPatterns`,type:`tags`,label:n(`mentionPatterns`)},{name:`groups`,type:`json`,label:n(`groupRulesJson`)}]},whatsapp:{fields:[{name:`enabled`,type:`boolean`,label:n(`enabled`)},{name:`bridgeUrl`,type:`text`,label:n(`bridgeUrl`)},{name:`allowFrom`,type:`tags`,label:n(`allowFrom`)}]},feishu:{fields:[{name:`enabled`,type:`boolean`,label:n(`enabled`)},{name:`appId`,type:`text`,label:n(`appId`)},{name:`appSecret`,type:`password`,label:n(`appSecret`)},{name:`encryptKey`,type:`password`,label:n(`encryptKey`)},{name:`verificationToken`,type:`password`,label:n(`verificationToken`)},{name:`domain`,type:`text`,label:`Domain`},{name:`allowFrom`,type:`tags`,label:n(`allowFrom`)},{name:`dmPolicy`,type:`select`,label:n(`dmPolicy`),options:K},{name:`groupPolicy`,type:`select`,label:n(`groupPolicy`),options:q},{name:`groupAllowFrom`,type:`tags`,label:n(`groupAllowFrom`)},{name:`requireMention`,type:`boolean`,label:n(`requireMention`)},{name:`mentionPatterns`,type:`tags`,label:n(`mentionPatterns`)},{name:`groups`,type:`json`,label:n(`groupRulesJson`)},{name:`accounts`,type:`json`,label:n(`accountsJson`)}]},dingtalk:{fields:[{name:`enabled`,type:`boolean`,label:n(`enabled`)},{name:`clientId`,type:`text`,label:n(`clientId`)},{name:`clientSecret`,type:`password`,label:n(`clientSecret`)},{name:`allowFrom`,type:`tags`,label:n(`allowFrom`)}]},wecom:{fields:[{name:`enabled`,type:`boolean`,label:n(`enabled`)},{name:`corpId`,type:`text`,label:n(`corpId`)},{name:`agentId`,type:`text`,label:n(`agentId`)},{name:`secret`,type:`password`,label:n(`secret`)},{name:`token`,type:`password`,label:n(`token`)},{name:`callbackPort`,type:`number`,label:n(`callbackPort`)},{name:`callbackPath`,type:`text`,label:n(`callbackPath`)},{name:`allowFrom`,type:`tags`,label:n(`allowFrom`)}]},weixin:{fields:[{name:`enabled`,type:`boolean`,label:n(`enabled`),section:`primary`},{name:`defaultAccountId`,type:`text`,label:n(`defaultAccountId`)},{name:`baseUrl`,type:`text`,label:n(`baseUrl`)},{name:`pollTimeoutMs`,type:`number`,label:n(`pollTimeoutMs`)},{name:`allowFrom`,type:`tags`,label:n(`allowFrom`)},{name:`accounts`,type:`json`,label:n(`accountsJson`)}],layout:[{type:`fields`,section:`primary`},{type:`custom`,sectionId:`weixin-auth`},{type:`fields`,section:`advanced`,collapsible:{title:n(`weixinAuthAdvancedTitle`),description:n(`weixinAuthAdvancedDescription`)}}]},slack:{fields:[{name:`enabled`,type:`boolean`,label:n(`enabled`)},{name:`mode`,type:`text`,label:n(`mode`)},{name:`webhookPath`,type:`text`,label:n(`webhookPath`)},{name:`allowBots`,type:`boolean`,label:n(`allowBotMessages`)},{name:`botToken`,type:`password`,label:n(`botToken`)},{name:`appToken`,type:`password`,label:n(`appToken`)}]},email:{fields:[{name:`enabled`,type:`boolean`,label:n(`enabled`)},{name:`consentGranted`,type:`boolean`,label:n(`consentGranted`)},{name:`imapHost`,type:`text`,label:n(`imapHost`)},{name:`imapPort`,type:`number`,label:n(`imapPort`)},{name:`imapUsername`,type:`text`,label:n(`imapUsername`)},{name:`imapPassword`,type:`password`,label:n(`imapPassword`)},{name:`fromAddress`,type:`email`,label:n(`fromAddress`)}]},mochat:{fields:[{name:`enabled`,type:`boolean`,label:n(`enabled`)},{name:`baseUrl`,type:`text`,label:n(`baseUrl`)},{name:`clawToken`,type:`password`,label:n(`clawToken`)},{name:`agentUserId`,type:`text`,label:n(`agentUserId`)},{name:`allowFrom`,type:`tags`,label:n(`allowFrom`)}]},qq:{fields:[{name:`enabled`,type:`boolean`,label:n(`enabled`)},{name:`appId`,type:`text`,label:n(`appId`)},{name:`secret`,type:`password`,label:n(`appSecret`)},{name:`markdownSupport`,type:`boolean`,label:n(`markdownSupport`)},{name:`allowFrom`,type:`tags`,label:n(`allowFrom`)}]}}}var he=t(((e,t)=>{t.exports=function(){return typeof Promise==`function`&&Promise.prototype&&Promise.prototype.then}})),J=t((e=>{var t,n=[0,26,44,70,100,134,172,196,242,292,346,404,466,532,581,655,733,815,901,991,1085,1156,1258,1364,1474,1588,1706,1828,1921,2051,2185,2323,2465,2611,2761,2876,3034,3196,3362,3532,3706];e.getSymbolSize=function(e){if(!e)throw Error(`"version" cannot be null or undefined`);if(e<1||e>40)throw Error(`"version" should be in range from 1 to 40`);return e*4+17},e.getSymbolTotalCodewords=function(e){return n[e]},e.getBCHDigit=function(e){let t=0;for(;e!==0;)t++,e>>>=1;return t},e.setToSJISFunction=function(e){if(typeof e!=`function`)throw Error(`"toSJISFunc" is not a valid function.`);t=e},e.isKanjiModeEnabled=function(){return t!==void 0},e.toSJIS=function(e){return t(e)}})),Y=t((e=>{e.L={bit:1},e.M={bit:0},e.Q={bit:3},e.H={bit:2};function t(t){if(typeof t!=`string`)throw Error(`Param is not a string`);switch(t.toLowerCase()){case`l`:case`low`:return e.L;case`m`:case`medium`:return e.M;case`q`:case`quartile`:return e.Q;case`h`:case`high`:return e.H;default:throw Error(`Unknown EC Level: `+t)}}e.isValid=function(e){return e&&e.bit!==void 0&&e.bit>=0&&e.bit<4},e.from=function(n,r){if(e.isValid(n))return n;try{return t(n)}catch{return r}}})),ge=t(((e,t)=>{function n(){this.buffer=[],this.length=0}n.prototype={get:function(e){let t=Math.floor(e/8);return(this.buffer[t]>>>7-e%8&1)==1},put:function(e,t){for(let n=0;n<t;n++)this.putBit((e>>>t-n-1&1)==1)},getLengthInBits:function(){return this.length},putBit:function(e){let t=Math.floor(this.length/8);this.buffer.length<=t&&this.buffer.push(0),e&&(this.buffer[t]|=128>>>this.length%8),this.length++}},t.exports=n})),_e=t(((e,t)=>{function n(e){if(!e||e<1)throw Error(`BitMatrix size must be defined and greater than 0`);this.size=e,this.data=new Uint8Array(e*e),this.reservedBit=new Uint8Array(e*e)}n.prototype.set=function(e,t,n,r){let i=e*this.size+t;this.data[i]=n,r&&(this.reservedBit[i]=!0)},n.prototype.get=function(e,t){return this.data[e*this.size+t]},n.prototype.xor=function(e,t,n){this.data[e*this.size+t]^=n},n.prototype.isReserved=function(e,t){return this.reservedBit[e*this.size+t]},t.exports=n})),ve=t((e=>{var t=J().getSymbolSize;e.getRowColCoords=function(e){if(e===1)return[];let n=Math.floor(e/7)+2,r=t(e),i=r===145?26:Math.ceil((r-13)/(2*n-2))*2,a=[r-7];for(let e=1;e<n-1;e++)a[e]=a[e-1]-i;return a.push(6),a.reverse()},e.getPositions=function(t){let n=[],r=e.getRowColCoords(t),i=r.length;for(let e=0;e<i;e++)for(let t=0;t<i;t++)e===0&&t===0||e===0&&t===i-1||e===i-1&&t===0||n.push([r[e],r[t]]);return n}})),ye=t((e=>{var t=J().getSymbolSize,n=7;e.getPositions=function(e){let r=t(e);return[[0,0],[r-n,0],[0,r-n]]}})),be=t((e=>{e.Patterns={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7};var t={N1:3,N2:3,N3:40,N4:10};e.isValid=function(e){return e!=null&&e!==``&&!isNaN(e)&&e>=0&&e<=7},e.from=function(t){return e.isValid(t)?parseInt(t,10):void 0},e.getPenaltyN1=function(e){let n=e.size,r=0,i=0,a=0,o=null,s=null;for(let c=0;c<n;c++){i=a=0,o=s=null;for(let l=0;l<n;l++){let n=e.get(c,l);n===o?i++:(i>=5&&(r+=t.N1+(i-5)),o=n,i=1),n=e.get(l,c),n===s?a++:(a>=5&&(r+=t.N1+(a-5)),s=n,a=1)}i>=5&&(r+=t.N1+(i-5)),a>=5&&(r+=t.N1+(a-5))}return r},e.getPenaltyN2=function(e){let n=e.size,r=0;for(let t=0;t<n-1;t++)for(let i=0;i<n-1;i++){let n=e.get(t,i)+e.get(t,i+1)+e.get(t+1,i)+e.get(t+1,i+1);(n===4||n===0)&&r++}return r*t.N2},e.getPenaltyN3=function(e){let n=e.size,r=0,i=0,a=0;for(let t=0;t<n;t++){i=a=0;for(let o=0;o<n;o++)i=i<<1&2047|e.get(t,o),o>=10&&(i===1488||i===93)&&r++,a=a<<1&2047|e.get(o,t),o>=10&&(a===1488||a===93)&&r++}return r*t.N3},e.getPenaltyN4=function(e){let n=0,r=e.data.length;for(let t=0;t<r;t++)n+=e.data[t];return Math.abs(Math.ceil(n*100/r/5)-10)*t.N4};function n(t,n,r){switch(t){case e.Patterns.PATTERN000:return(n+r)%2==0;case e.Patterns.PATTERN001:return n%2==0;case e.Patterns.PATTERN010:return r%3==0;case e.Patterns.PATTERN011:return(n+r)%3==0;case e.Patterns.PATTERN100:return(Math.floor(n/2)+Math.floor(r/3))%2==0;case e.Patterns.PATTERN101:return n*r%2+n*r%3==0;case e.Patterns.PATTERN110:return(n*r%2+n*r%3)%2==0;case e.Patterns.PATTERN111:return(n*r%3+(n+r)%2)%2==0;default:throw Error(`bad maskPattern:`+t)}}e.applyMask=function(e,t){let r=t.size;for(let i=0;i<r;i++)for(let a=0;a<r;a++)t.isReserved(a,i)||t.xor(a,i,n(e,a,i))},e.getBestMask=function(t,n){let r=Object.keys(e.Patterns).length,i=0,a=1/0;for(let o=0;o<r;o++){n(o),e.applyMask(o,t);let r=e.getPenaltyN1(t)+e.getPenaltyN2(t)+e.getPenaltyN3(t)+e.getPenaltyN4(t);e.applyMask(o,t),r<a&&(a=r,i=o)}return i}})),X=t((e=>{var t=Y(),n=[1,1,1,1,1,1,1,1,1,1,2,2,1,2,2,4,1,2,4,4,2,4,4,4,2,4,6,5,2,4,6,6,2,5,8,8,4,5,8,8,4,5,8,11,4,8,10,11,4,9,12,16,4,9,16,16,6,10,12,18,6,10,17,16,6,11,16,19,6,13,18,21,7,14,21,25,8,16,20,25,8,17,23,25,9,17,23,34,9,18,25,30,10,20,27,32,12,21,29,35,12,23,34,37,12,25,34,40,13,26,35,42,14,28,38,45,15,29,40,48,16,31,43,51,17,33,45,54,18,35,48,57,19,37,51,60,19,38,53,63,20,40,56,66,21,43,59,70,22,45,62,74,24,47,65,77,25,49,68,81],r=[7,10,13,17,10,16,22,28,15,26,36,44,20,36,52,64,26,48,72,88,36,64,96,112,40,72,108,130,48,88,132,156,60,110,160,192,72,130,192,224,80,150,224,264,96,176,260,308,104,198,288,352,120,216,320,384,132,240,360,432,144,280,408,480,168,308,448,532,180,338,504,588,196,364,546,650,224,416,600,700,224,442,644,750,252,476,690,816,270,504,750,900,300,560,810,960,312,588,870,1050,336,644,952,1110,360,700,1020,1200,390,728,1050,1260,420,784,1140,1350,450,812,1200,1440,480,868,1290,1530,510,924,1350,1620,540,980,1440,1710,570,1036,1530,1800,570,1064,1590,1890,600,1120,1680,1980,630,1204,1770,2100,660,1260,1860,2220,720,1316,1950,2310,750,1372,2040,2430];e.getBlocksCount=function(e,r){switch(r){case t.L:return n[(e-1)*4+0];case t.M:return n[(e-1)*4+1];case t.Q:return n[(e-1)*4+2];case t.H:return n[(e-1)*4+3];default:return}},e.getTotalCodewordsCount=function(e,n){switch(n){case t.L:return r[(e-1)*4+0];case t.M:return r[(e-1)*4+1];case t.Q:return r[(e-1)*4+2];case t.H:return r[(e-1)*4+3];default:return}}})),xe=t((e=>{var t=new Uint8Array(512),n=new Uint8Array(256);(function(){let e=1;for(let r=0;r<255;r++)t[r]=e,n[e]=r,e<<=1,e&256&&(e^=285);for(let e=255;e<512;e++)t[e]=t[e-255]})(),e.log=function(e){if(e<1)throw Error(`log(`+e+`)`);return n[e]},e.exp=function(e){return t[e]},e.mul=function(e,r){return e===0||r===0?0:t[n[e]+n[r]]}})),Se=t((e=>{var t=xe();e.mul=function(e,n){let r=new Uint8Array(e.length+n.length-1);for(let i=0;i<e.length;i++)for(let a=0;a<n.length;a++)r[i+a]^=t.mul(e[i],n[a]);return r},e.mod=function(e,n){let r=new Uint8Array(e);for(;r.length-n.length>=0;){let e=r[0];for(let i=0;i<n.length;i++)r[i]^=t.mul(n[i],e);let i=0;for(;i<r.length&&r[i]===0;)i++;r=r.slice(i)}return r},e.generateECPolynomial=function(n){let r=new Uint8Array([1]);for(let i=0;i<n;i++)r=e.mul(r,new Uint8Array([1,t.exp(i)]));return r}})),Ce=t(((e,t)=>{var n=Se();function r(e){this.genPoly=void 0,this.degree=e,this.degree&&this.initialize(this.degree)}r.prototype.initialize=function(e){this.degree=e,this.genPoly=n.generateECPolynomial(this.degree)},r.prototype.encode=function(e){if(!this.genPoly)throw Error(`Encoder not initialized`);let t=new Uint8Array(e.length+this.degree);t.set(e);let r=n.mod(t,this.genPoly),i=this.degree-r.length;if(i>0){let e=new Uint8Array(this.degree);return e.set(r,i),e}return r},t.exports=r})),Z=t((e=>{e.isValid=function(e){return!isNaN(e)&&e>=1&&e<=40}})),we=t((e=>{var t=`[0-9]+`,n=`[A-Z $%*+\\-./:]+`,r=`(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+`;r=r.replace(/u/g,`\\u`);var i=`(?:(?![A-Z0-9 $%*+\\-./:]|`+r+`)(?:.|[\r
2
- ]))+`;e.KANJI=new RegExp(r,`g`),e.BYTE_KANJI=RegExp(`[^A-Z0-9 $%*+\\-./:]+`,`g`),e.BYTE=new RegExp(i,`g`),e.NUMERIC=new RegExp(t,`g`),e.ALPHANUMERIC=new RegExp(n,`g`);var a=RegExp(`^`+r+`$`),o=RegExp(`^`+t+`$`),s=RegExp(`^[A-Z0-9 $%*+\\-./:]+$`);e.testKanji=function(e){return a.test(e)},e.testNumeric=function(e){return o.test(e)},e.testAlphanumeric=function(e){return s.test(e)}})),Q=t((e=>{var t=Z(),n=we();e.NUMERIC={id:`Numeric`,bit:1,ccBits:[10,12,14]},e.ALPHANUMERIC={id:`Alphanumeric`,bit:2,ccBits:[9,11,13]},e.BYTE={id:`Byte`,bit:4,ccBits:[8,16,16]},e.KANJI={id:`Kanji`,bit:8,ccBits:[8,10,12]},e.MIXED={bit:-1},e.getCharCountIndicator=function(e,n){if(!e.ccBits)throw Error(`Invalid mode: `+e);if(!t.isValid(n))throw Error(`Invalid version: `+n);return n>=1&&n<10?e.ccBits[0]:n<27?e.ccBits[1]:e.ccBits[2]},e.getBestModeForData=function(t){return n.testNumeric(t)?e.NUMERIC:n.testAlphanumeric(t)?e.ALPHANUMERIC:n.testKanji(t)?e.KANJI:e.BYTE},e.toString=function(e){if(e&&e.id)return e.id;throw Error(`Invalid mode`)},e.isValid=function(e){return e&&e.bit&&e.ccBits};function r(t){if(typeof t!=`string`)throw Error(`Param is not a string`);switch(t.toLowerCase()){case`numeric`:return e.NUMERIC;case`alphanumeric`:return e.ALPHANUMERIC;case`kanji`:return e.KANJI;case`byte`:return e.BYTE;default:throw Error(`Unknown mode: `+t)}}e.from=function(t,n){if(e.isValid(t))return t;try{return r(t)}catch{return n}}})),Te=t((e=>{var t=J(),n=X(),r=Y(),i=Q(),a=Z(),o=7973,s=t.getBCHDigit(o);function c(t,n,r){for(let i=1;i<=40;i++)if(n<=e.getCapacity(i,r,t))return i}function l(e,t){return i.getCharCountIndicator(e,t)+4}function u(e,t){let n=0;return e.forEach(function(e){let r=l(e.mode,t);n+=r+e.getBitsLength()}),n}function d(t,n){for(let r=1;r<=40;r++)if(u(t,r)<=e.getCapacity(r,n,i.MIXED))return r}e.from=function(e,t){return a.isValid(e)?parseInt(e,10):t},e.getCapacity=function(e,r,o){if(!a.isValid(e))throw Error(`Invalid QR Code version`);o===void 0&&(o=i.BYTE);let s=(t.getSymbolTotalCodewords(e)-n.getTotalCodewordsCount(e,r))*8;if(o===i.MIXED)return s;let c=s-l(o,e);switch(o){case i.NUMERIC:return Math.floor(c/10*3);case i.ALPHANUMERIC:return Math.floor(c/11*2);case i.KANJI:return Math.floor(c/13);case i.BYTE:default:return Math.floor(c/8)}},e.getBestVersionForData=function(e,t){let n,i=r.from(t,r.M);if(Array.isArray(e)){if(e.length>1)return d(e,i);if(e.length===0)return 1;n=e[0]}else n=e;return c(n.mode,n.getLength(),i)},e.getEncodedBits=function(e){if(!a.isValid(e)||e<7)throw Error(`Invalid QR Code version`);let n=e<<12;for(;t.getBCHDigit(n)-s>=0;)n^=o<<t.getBCHDigit(n)-s;return e<<12|n}})),Ee=t((e=>{var t=J(),n=1335,r=21522,i=t.getBCHDigit(n);e.getEncodedBits=function(e,a){let o=e.bit<<3|a,s=o<<10;for(;t.getBCHDigit(s)-i>=0;)s^=n<<t.getBCHDigit(s)-i;return(o<<10|s)^r}})),De=t(((e,t)=>{var n=Q();function r(e){this.mode=n.NUMERIC,this.data=e.toString()}r.getBitsLength=function(e){return 10*Math.floor(e/3)+(e%3?e%3*3+1:0)},r.prototype.getLength=function(){return this.data.length},r.prototype.getBitsLength=function(){return r.getBitsLength(this.data.length)},r.prototype.write=function(e){let t,n,r;for(t=0;t+3<=this.data.length;t+=3)n=this.data.substr(t,3),r=parseInt(n,10),e.put(r,10);let i=this.data.length-t;i>0&&(n=this.data.substr(t),r=parseInt(n,10),e.put(r,i*3+1))},t.exports=r})),Oe=t(((e,t)=>{var n=Q(),r=`0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:`.split(``);function i(e){this.mode=n.ALPHANUMERIC,this.data=e}i.getBitsLength=function(e){return 11*Math.floor(e/2)+e%2*6},i.prototype.getLength=function(){return this.data.length},i.prototype.getBitsLength=function(){return i.getBitsLength(this.data.length)},i.prototype.write=function(e){let t;for(t=0;t+2<=this.data.length;t+=2){let n=r.indexOf(this.data[t])*45;n+=r.indexOf(this.data[t+1]),e.put(n,11)}this.data.length%2&&e.put(r.indexOf(this.data[t]),6)},t.exports=i})),ke=t(((e,t)=>{var n=Q();function r(e){this.mode=n.BYTE,typeof e==`string`?this.data=new TextEncoder().encode(e):this.data=new Uint8Array(e)}r.getBitsLength=function(e){return e*8},r.prototype.getLength=function(){return this.data.length},r.prototype.getBitsLength=function(){return r.getBitsLength(this.data.length)},r.prototype.write=function(e){for(let t=0,n=this.data.length;t<n;t++)e.put(this.data[t],8)},t.exports=r})),Ae=t(((e,t)=>{var n=Q(),r=J();function i(e){this.mode=n.KANJI,this.data=e}i.getBitsLength=function(e){return e*13},i.prototype.getLength=function(){return this.data.length},i.prototype.getBitsLength=function(){return i.getBitsLength(this.data.length)},i.prototype.write=function(e){let t;for(t=0;t<this.data.length;t++){let n=r.toSJIS(this.data[t]);if(n>=33088&&n<=40956)n-=33088;else if(n>=57408&&n<=60351)n-=49472;else throw Error(`Invalid SJIS character: `+this.data[t]+`
3
- Make sure your charset is UTF-8`);n=(n>>>8&255)*192+(n&255),e.put(n,13)}},t.exports=i})),je=t(((e,t)=>{var n={single_source_shortest_paths:function(e,t,r){var i={},a={};a[t]=0;var o=n.PriorityQueue.make();o.push(t,0);for(var s,c,l,u,d,f,p,m,h;!o.empty();)for(l in s=o.pop(),c=s.value,u=s.cost,d=e[c]||{},d)d.hasOwnProperty(l)&&(f=d[l],p=u+f,m=a[l],h=a[l]===void 0,(h||m>p)&&(a[l]=p,o.push(l,p),i[l]=c));if(r!==void 0&&a[r]===void 0){var g=[`Could not find a path from `,t,` to `,r,`.`].join(``);throw Error(g)}return i},extract_shortest_path_from_predecessor_list:function(e,t){for(var n=[],r=t;r;)n.push(r),e[r],r=e[r];return n.reverse(),n},find_path:function(e,t,r){var i=n.single_source_shortest_paths(e,t,r);return n.extract_shortest_path_from_predecessor_list(i,r)},PriorityQueue:{make:function(e){var t=n.PriorityQueue,r={},i;for(i in e||={},t)t.hasOwnProperty(i)&&(r[i]=t[i]);return r.queue=[],r.sorter=e.sorter||t.default_sorter,r},default_sorter:function(e,t){return e.cost-t.cost},push:function(e,t){var n={value:e,cost:t};this.queue.push(n),this.queue.sort(this.sorter)},pop:function(){return this.queue.shift()},empty:function(){return this.queue.length===0}}};t!==void 0&&(t.exports=n)})),Me=t((e=>{var t=Q(),n=De(),r=Oe(),i=ke(),a=Ae(),o=we(),s=J(),c=je();function l(e){return unescape(encodeURIComponent(e)).length}function u(e,t,n){let r=[],i;for(;(i=e.exec(n))!==null;)r.push({data:i[0],index:i.index,mode:t,length:i[0].length});return r}function d(e){let n=u(o.NUMERIC,t.NUMERIC,e),r=u(o.ALPHANUMERIC,t.ALPHANUMERIC,e),i,a;return s.isKanjiModeEnabled()?(i=u(o.BYTE,t.BYTE,e),a=u(o.KANJI,t.KANJI,e)):(i=u(o.BYTE_KANJI,t.BYTE,e),a=[]),n.concat(r,i,a).sort(function(e,t){return e.index-t.index}).map(function(e){return{data:e.data,mode:e.mode,length:e.length}})}function f(e,o){switch(o){case t.NUMERIC:return n.getBitsLength(e);case t.ALPHANUMERIC:return r.getBitsLength(e);case t.KANJI:return a.getBitsLength(e);case t.BYTE:return i.getBitsLength(e)}}function p(e){return e.reduce(function(e,t){let n=e.length-1>=0?e[e.length-1]:null;return n&&n.mode===t.mode?(e[e.length-1].data+=t.data,e):(e.push(t),e)},[])}function m(e){let n=[];for(let r=0;r<e.length;r++){let i=e[r];switch(i.mode){case t.NUMERIC:n.push([i,{data:i.data,mode:t.ALPHANUMERIC,length:i.length},{data:i.data,mode:t.BYTE,length:i.length}]);break;case t.ALPHANUMERIC:n.push([i,{data:i.data,mode:t.BYTE,length:i.length}]);break;case t.KANJI:n.push([i,{data:i.data,mode:t.BYTE,length:l(i.data)}]);break;case t.BYTE:n.push([{data:i.data,mode:t.BYTE,length:l(i.data)}])}}return n}function h(e,n){let r={},i={start:{}},a=[`start`];for(let o=0;o<e.length;o++){let s=e[o],c=[];for(let e=0;e<s.length;e++){let l=s[e],u=``+o+e;c.push(u),r[u]={node:l,lastCount:0},i[u]={};for(let e=0;e<a.length;e++){let o=a[e];r[o]&&r[o].node.mode===l.mode?(i[o][u]=f(r[o].lastCount+l.length,l.mode)-f(r[o].lastCount,l.mode),r[o].lastCount+=l.length):(r[o]&&(r[o].lastCount=l.length),i[o][u]=f(l.length,l.mode)+4+t.getCharCountIndicator(l.mode,n))}}a=c}for(let e=0;e<a.length;e++)i[a[e]].end=0;return{map:i,table:r}}function g(e,o){let c,l=t.getBestModeForData(e);if(c=t.from(o,l),c!==t.BYTE&&c.bit<l.bit)throw Error(`"`+e+`" cannot be encoded with mode `+t.toString(c)+`.
4
- Suggested mode is: `+t.toString(l));switch(c===t.KANJI&&!s.isKanjiModeEnabled()&&(c=t.BYTE),c){case t.NUMERIC:return new n(e);case t.ALPHANUMERIC:return new r(e);case t.KANJI:return new a(e);case t.BYTE:return new i(e)}}e.fromArray=function(e){return e.reduce(function(e,t){return typeof t==`string`?e.push(g(t,null)):t.data&&e.push(g(t.data,t.mode)),e},[])},e.fromString=function(t,n){let r=h(m(d(t,s.isKanjiModeEnabled())),n),i=c.find_path(r.map,`start`,`end`),a=[];for(let e=1;e<i.length-1;e++)a.push(r.table[i[e]].node);return e.fromArray(p(a))},e.rawSplit=function(t){return e.fromArray(d(t,s.isKanjiModeEnabled()))}})),Ne=t((e=>{var t=J(),n=Y(),r=ge(),i=_e(),a=ve(),o=ye(),s=be(),c=X(),l=Ce(),u=Te(),d=Ee(),f=Q(),p=Me();function m(e,t){let n=e.size,r=o.getPositions(t);for(let t=0;t<r.length;t++){let i=r[t][0],a=r[t][1];for(let t=-1;t<=7;t++)if(!(i+t<=-1||n<=i+t))for(let r=-1;r<=7;r++)a+r<=-1||n<=a+r||(t>=0&&t<=6&&(r===0||r===6)||r>=0&&r<=6&&(t===0||t===6)||t>=2&&t<=4&&r>=2&&r<=4?e.set(i+t,a+r,!0,!0):e.set(i+t,a+r,!1,!0))}}function h(e){let t=e.size;for(let n=8;n<t-8;n++){let t=n%2==0;e.set(n,6,t,!0),e.set(6,n,t,!0)}}function g(e,t){let n=a.getPositions(t);for(let t=0;t<n.length;t++){let r=n[t][0],i=n[t][1];for(let t=-2;t<=2;t++)for(let n=-2;n<=2;n++)t===-2||t===2||n===-2||n===2||t===0&&n===0?e.set(r+t,i+n,!0,!0):e.set(r+t,i+n,!1,!0)}}function _(e,t){let n=e.size,r=u.getEncodedBits(t),i,a,o;for(let t=0;t<18;t++)i=Math.floor(t/3),a=t%3+n-8-3,o=(r>>t&1)==1,e.set(i,a,o,!0),e.set(a,i,o,!0)}function v(e,t,n){let r=e.size,i=d.getEncodedBits(t,n),a,o;for(a=0;a<15;a++)o=(i>>a&1)==1,a<6?e.set(a,8,o,!0):a<8?e.set(a+1,8,o,!0):e.set(r-15+a,8,o,!0),a<8?e.set(8,r-a-1,o,!0):a<9?e.set(8,15-a-1+1,o,!0):e.set(8,15-a-1,o,!0);e.set(r-8,8,1,!0)}function y(e,t){let n=e.size,r=-1,i=n-1,a=7,o=0;for(let s=n-1;s>0;s-=2)for(s===6&&s--;;){for(let n=0;n<2;n++)if(!e.isReserved(i,s-n)){let r=!1;o<t.length&&(r=(t[o]>>>a&1)==1),e.set(i,s-n,r),a--,a===-1&&(o++,a=7)}if(i+=r,i<0||n<=i){i-=r,r=-r;break}}}function b(e,n,i){let a=new r;i.forEach(function(t){a.put(t.mode.bit,4),a.put(t.getLength(),f.getCharCountIndicator(t.mode,e)),t.write(a)});let o=(t.getSymbolTotalCodewords(e)-c.getTotalCodewordsCount(e,n))*8;for(a.getLengthInBits()+4<=o&&a.put(0,4);a.getLengthInBits()%8!=0;)a.putBit(0);let s=(o-a.getLengthInBits())/8;for(let e=0;e<s;e++)a.put(e%2?17:236,8);return x(a,e,n)}function x(e,n,r){let i=t.getSymbolTotalCodewords(n),a=i-c.getTotalCodewordsCount(n,r),o=c.getBlocksCount(n,r),s=o-i%o,u=Math.floor(i/o),d=Math.floor(a/o),f=d+1,p=u-d,m=new l(p),h=0,g=Array(o),_=Array(o),v=0,y=new Uint8Array(e.buffer);for(let e=0;e<o;e++){let t=e<s?d:f;g[e]=y.slice(h,h+t),_[e]=m.encode(g[e]),h+=t,v=Math.max(v,t)}let b=new Uint8Array(i),x=0,S,C;for(S=0;S<v;S++)for(C=0;C<o;C++)S<g[C].length&&(b[x++]=g[C][S]);for(S=0;S<p;S++)for(C=0;C<o;C++)b[x++]=_[C][S];return b}function S(e,n,r,a){let o;if(Array.isArray(e))o=p.fromArray(e);else if(typeof e==`string`){let t=n;if(!t){let n=p.rawSplit(e);t=u.getBestVersionForData(n,r)}o=p.fromString(e,t||40)}else throw Error(`Invalid data`);let c=u.getBestVersionForData(o,r);if(!c)throw Error(`The amount of data is too big to be stored in a QR Code`);if(!n)n=c;else if(n<c)throw Error(`
5
- The chosen QR Code version cannot contain this amount of data.
6
- Minimum version required to store current data is: `+c+`.
7
- `);let l=b(n,r,o),d=new i(t.getSymbolSize(n));return m(d,n),h(d),g(d,n),v(d,r,0),n>=7&&_(d,n),y(d,l),isNaN(a)&&(a=s.getBestMask(d,v.bind(null,d,r))),s.applyMask(a,d),v(d,r,a),{modules:d,version:n,errorCorrectionLevel:r,maskPattern:a,segments:o}}e.create=function(e,r){if(e===void 0||e===``)throw Error(`No input text`);let i=n.M,a,o;return r!==void 0&&(i=n.from(r.errorCorrectionLevel,n.M),a=u.from(r.version),o=s.from(r.maskPattern),r.toSJISFunc&&t.setToSJISFunction(r.toSJISFunc)),S(e,a,i,o)}})),Pe=t((e=>{function t(e){if(typeof e==`number`&&(e=e.toString()),typeof e!=`string`)throw Error(`Color should be defined as hex string`);let t=e.slice().replace(`#`,``).split(``);if(t.length<3||t.length===5||t.length>8)throw Error(`Invalid hex color: `+e);(t.length===3||t.length===4)&&(t=Array.prototype.concat.apply([],t.map(function(e){return[e,e]}))),t.length===6&&t.push(`F`,`F`);let n=parseInt(t.join(``),16);return{r:n>>24&255,g:n>>16&255,b:n>>8&255,a:n&255,hex:`#`+t.slice(0,6).join(``)}}e.getOptions=function(e){e||={},e.color||={};let n=e.margin===void 0||e.margin===null||e.margin<0?4:e.margin,r=e.width&&e.width>=21?e.width:void 0,i=e.scale||4;return{width:r,scale:r?4:i,margin:n,color:{dark:t(e.color.dark||`#000000ff`),light:t(e.color.light||`#ffffffff`)},type:e.type,rendererOpts:e.rendererOpts||{}}},e.getScale=function(e,t){return t.width&&t.width>=e+t.margin*2?t.width/(e+t.margin*2):t.scale},e.getImageWidth=function(t,n){let r=e.getScale(t,n);return Math.floor((t+n.margin*2)*r)},e.qrToImageData=function(t,n,r){let i=n.modules.size,a=n.modules.data,o=e.getScale(i,r),s=Math.floor((i+r.margin*2)*o),c=r.margin*o,l=[r.color.light,r.color.dark];for(let e=0;e<s;e++)for(let n=0;n<s;n++){let u=(e*s+n)*4,d=r.color.light;if(e>=c&&n>=c&&e<s-c&&n<s-c){let t=Math.floor((e-c)/o),r=Math.floor((n-c)/o);d=l[a[t*i+r]?1:0]}t[u++]=d.r,t[u++]=d.g,t[u++]=d.b,t[u]=d.a}}})),Fe=t((e=>{var t=Pe();function n(e,t,n){e.clearRect(0,0,t.width,t.height),t.style||={},t.height=n,t.width=n,t.style.height=n+`px`,t.style.width=n+`px`}function r(){try{return document.createElement(`canvas`)}catch{throw Error(`You need to specify a canvas element`)}}e.render=function(e,i,a){let o=a,s=i;o===void 0&&(!i||!i.getContext)&&(o=i,i=void 0),i||(s=r()),o=t.getOptions(o);let c=t.getImageWidth(e.modules.size,o),l=s.getContext(`2d`),u=l.createImageData(c,c);return t.qrToImageData(u.data,e,o),n(l,s,c),l.putImageData(u,0,0),s},e.renderToDataURL=function(t,n,r){let i=r;i===void 0&&(!n||!n.getContext)&&(i=n,n=void 0),i||={};let a=e.render(t,n,i),o=i.type||`image/png`,s=i.rendererOpts||{};return a.toDataURL(o,s.quality)}})),Ie=t((e=>{var t=Pe();function n(e,t){let n=e.a/255,r=t+`="`+e.hex+`"`;return n<1?r+` `+t+`-opacity="`+n.toFixed(2).slice(1)+`"`:r}function r(e,t,n){let r=e+t;return n!==void 0&&(r+=` `+n),r}function i(e,t,n){let i=``,a=0,o=!1,s=0;for(let c=0;c<e.length;c++){let l=Math.floor(c%t),u=Math.floor(c/t);!l&&!o&&(o=!0),e[c]?(s++,c>0&&l>0&&e[c-1]||(i+=o?r(`M`,l+n,.5+u+n):r(`m`,a,0),a=0,o=!1),l+1<t&&e[c+1]||(i+=r(`h`,s),s=0)):a++}return i}e.render=function(e,r,a){let o=t.getOptions(r),s=e.modules.size,c=e.modules.data,l=s+o.margin*2,u=o.color.light.a?`<path `+n(o.color.light,`fill`)+` d="M0 0h`+l+`v`+l+`H0z"/>`:``,d=`<path `+n(o.color.dark,`stroke`)+` d="`+i(c,s,o.margin)+`"/>`,f=`viewBox="0 0 `+l+` `+l+`"`,p=`<svg xmlns="http://www.w3.org/2000/svg" `+(o.width?`width="`+o.width+`" height="`+o.width+`" `:``)+f+` shape-rendering="crispEdges">`+u+d+`</svg>
8
- `;return typeof a==`function`&&a(null,p),p}})),Le=t((e=>{var t=he(),n=Ne(),r=Fe(),i=Ie();function a(e,r,i,a,o){let s=[].slice.call(arguments,1),c=s.length,l=typeof s[c-1]==`function`;if(!l&&!t())throw Error(`Callback required as last argument`);if(l){if(c<2)throw Error(`Too few arguments provided`);c===2?(o=i,i=r,r=a=void 0):c===3&&(r.getContext&&o===void 0?(o=a,a=void 0):(o=a,a=i,i=r,r=void 0))}else{if(c<1)throw Error(`Too few arguments provided`);return c===1?(i=r,r=a=void 0):c===2&&!r.getContext&&(a=i,i=r,r=void 0),new Promise(function(t,o){try{t(e(n.create(i,a),r,a))}catch(e){o(e)}})}try{let t=n.create(i,a);o(null,e(t,r,a))}catch(e){o(e)}}e.create=n.create,e.toCanvas=a.bind(null,r.render),e.toDataURL=a.bind(null,r.renderToDataURL),e.toString=a.bind(null,function(e,t,n){return i.render(e,n)})}))();async function Re(e,t={}){let n=await d.post(`/api/config/channels/${e}/auth/start`,t);if(!n.ok)throw Error(n.error.message);return n.data}async function ze(e,t){let n=await d.post(`/api/config/channels/${e}/auth/poll`,t);if(!n.ok)throw Error(n.error.message);return n.data}function Be(){return f({mutationFn:({channel:e,data:t})=>Re(e,t)})}function Ve(){return f({mutationFn:({channel:e,data:t})=>ze(e,t)})}function He(e){let t=e.accounts,n=new Set;if(typeof e.defaultAccountId==`string`&&e.defaultAccountId.trim()&&n.add(e.defaultAccountId.trim()),t&&typeof t==`object`&&!Array.isArray(t))for(let e of Object.keys(t)){let t=e.trim();t&&n.add(t)}return[...n]}function Ue(e,t){if(typeof e.baseUrl==`string`&&e.baseUrl.trim())return e.baseUrl.trim();if(typeof t.baseUrl==`string`&&t.baseUrl.trim())return t.baseUrl.trim()}function We({channelConfig:e,formData:t,channelEnabled:r,disabled:a=!1}){let o=u(),d=Be(),f=Ve(),[p,m]=(0,H.useState)(null),[h,g]=(0,H.useState)(null),[_,v]=(0,H.useState)(null),y=(0,H.useMemo)(()=>He(e),[e]),b=y[0],S=Ue(t,e),C=y.length>0;(0,H.useEffect)(()=>{C&&(m(null),g(e=>e?.status===`authorized`?e:{channel:`weixin`,status:`authorized`,message:n(`weixinAuthAuthorized`),accountId:b??null}))},[C,b]),(0,H.useEffect)(()=>{if(!p){v(null);return}let e=!1;return(0,Le.toDataURL)(p.qrCodeUrl,{errorCorrectionLevel:`M`,margin:1,width:480}).then(t=>{e||v(t)}).catch(()=>{e||v(null)}),()=>{e=!0}},[p]),(0,H.useEffect)(()=>{if(!p)return;let e=!1,t=null,r=async()=>{try{let i=await f.mutateAsync({channel:`weixin`,data:{sessionId:p.sessionId}});if(e)return;if(g(i),i.status===`authorized`){await o.invalidateQueries({queryKey:[`config`]}),await o.invalidateQueries({queryKey:[`config-meta`]}),c.success(i.message||n(`weixinAuthAuthorized`)),m(null);return}if(i.status===`expired`||i.status===`error`){c.error(i.message||n(`weixinAuthRetryRequired`)),m(null);return}t=setTimeout(r,i.nextPollMs??p.intervalMs)}catch(t){if(e)return;let r=t instanceof Error?t.message:String(t);c.error(`${n(`error`)}: ${r}`),m(null)}};return t=setTimeout(r,p.intervalMs),()=>{e=!0,t&&clearTimeout(t)}},[p,f,o]);let w=async()=>{try{let e=await d.mutateAsync({channel:`weixin`,data:{baseUrl:S,accountId:typeof t.defaultAccountId==`string`&&t.defaultAccountId.trim()?t.defaultAccountId.trim():void 0}});m(e),g({channel:`weixin`,status:`pending`,message:e.note,nextPollMs:e.intervalMs})}catch(e){let t=e instanceof Error?e.message:String(e);c.error(`${n(`error`)}: ${t}`)}},E=p?h?.status===`scanned`?n(`weixinAuthScanned`):n(`weixinAuthWaiting`):n(C?r?`weixinAuthAuthorized`:`weixinAuthConnectedDisabled`:`weixinAuthNotConnected`),D=d.isPending?n(`weixinAuthStarting`):n(p?`weixinAuthWaiting`:C?`weixinAuthReconnect`:`weixinAuthConnect`);return(0,W.jsx)(`section`,{className:`rounded-2xl border border-primary/20 bg-gradient-to-br from-primary-50/70 via-white to-emerald-50/60 p-5`,children:(0,W.jsxs)(`div`,{className:`flex flex-col gap-4 lg:flex-row lg:items-start lg:justify-between`,children:[(0,W.jsxs)(`div`,{className:`space-y-3`,children:[(0,W.jsxs)(`div`,{className:`inline-flex items-center gap-2 rounded-full bg-white/90 px-3 py-1 text-xs font-medium text-primary shadow-sm`,children:[(0,W.jsx)(V,{className:`h-3.5 w-3.5`}),n(`weixinAuthTitle`)]}),(0,W.jsxs)(`div`,{children:[(0,W.jsx)(`h4`,{className:`text-base font-semibold text-gray-900`,children:n(`weixinAuthDescription`)}),(0,W.jsx)(`p`,{className:`mt-1 text-sm text-gray-600`,children:n(`weixinAuthHint`)})]}),(0,W.jsxs)(`div`,{className:s(`inline-flex w-fit items-center gap-2 rounded-full px-3 py-1 text-xs font-medium`,p?`bg-amber-50 text-amber-700`:C?`bg-emerald-50 text-emerald-700`:`bg-gray-100 text-gray-600`),children:[p?(0,W.jsx)(T,{className:`h-3.5 w-3.5 animate-spin`}):(0,W.jsx)(le,{className:`h-3.5 w-3.5`}),E]}),(0,W.jsxs)(`div`,{className:`space-y-1 text-sm text-gray-600`,children:[(0,W.jsx)(`p`,{children:n(r||!C?`weixinAuthCapabilityHint`:`weixinAuthDisabledHint`)}),b?(0,W.jsxs)(`p`,{children:[n(`weixinAuthPrimaryAccount`),`: `,(0,W.jsx)(`span`,{className:`font-mono text-xs text-gray-900`,children:b})]}):null,y.length>1?(0,W.jsxs)(`p`,{children:[n(`weixinAuthConnectedAccounts`),`: `,(0,W.jsx)(`span`,{className:`font-mono text-xs text-gray-900`,children:y.join(`, `)})]}):null,S?(0,W.jsxs)(`p`,{children:[n(`weixinAuthBaseUrl`),`: `,(0,W.jsx)(`span`,{className:`font-mono text-xs text-gray-900`,children:S})]}):null]}),(0,W.jsx)(l,{type:`button`,onClick:w,disabled:a||d.isPending||!!p,className:`rounded-xl`,children:D})]}),(0,W.jsx)(`div`,{className:`w-full max-w-sm rounded-2xl border border-dashed border-primary/25 bg-white/85 p-4 shadow-sm`,children:p?(0,W.jsxs)(`div`,{className:`space-y-3`,children:[(0,W.jsx)(`div`,{className:`overflow-hidden rounded-2xl border border-gray-100 bg-white p-3`,children:_?(0,W.jsx)(`img`,{src:_,alt:n(`weixinAuthQrAlt`),className:`mx-auto aspect-square w-full max-w-[240px] object-contain`}):(0,W.jsx)(`div`,{className:`flex aspect-square w-full items-center justify-center rounded-xl bg-gray-50 text-gray-500`,children:(0,W.jsxs)(`div`,{className:`flex flex-col items-center gap-2 text-center`,children:[(0,W.jsx)(T,{className:`h-5 w-5 animate-spin`}),(0,W.jsx)(`p`,{className:`text-xs`,children:n(`weixinAuthStarting`)})]})})}),(0,W.jsxs)(`div`,{className:`space-y-1 text-xs text-gray-500`,children:[(0,W.jsx)(`p`,{children:h?.message||p.note||n(`weixinAuthScanPrompt`)}),(0,W.jsxs)(`p`,{children:[n(`weixinAuthExpiresAt`),`: `,i(p.expiresAt)]})]}),(0,W.jsxs)(`a`,{href:p.qrCodeUrl,target:`_blank`,rel:`noreferrer`,className:`inline-flex items-center gap-1.5 text-xs text-primary transition-colors hover:text-primary-hover`,children:[(0,W.jsx)(x,{className:`h-3.5 w-3.5`}),n(`weixinAuthOpenQr`)]})]}):(0,W.jsxs)(`div`,{className:`flex min-h-[280px] flex-col items-center justify-center rounded-2xl bg-gray-50/80 px-6 text-center`,children:[(0,W.jsx)(V,{className:`h-9 w-9 text-gray-300`}),(0,W.jsx)(`p`,{className:`mt-3 text-sm font-medium text-gray-700`,children:n(`weixinAuthReadyTitle`)}),(0,W.jsx)(`p`,{className:`mt-1 text-xs leading-5 text-gray-500`,children:n(`weixinAuthReadyDescription`)})]})})]})})}var Ge=[],Ke=[{type:`fields`,section:`all`}];function $(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function qe(e,t){let n={...e};for(let[e,r]of Object.entries(t)){let t=n[e];if($(t)&&$(r)){n[e]=qe(t,r);continue}n[e]=r}return n}function Je(e,t){let n=e.split(`.`),r={},i=r;for(let e=0;e<n.length-1;e+=1){let t=n[e];i[t]={},i=i[t]}return i[n[n.length-1]]=t,r}function Ye(e,t){return t===`all`?e:t===`primary`?e.filter(e=>e.section===`primary`):e.filter(e=>e.section!==`primary`)}function Xe(e,t){let n={};return t.filter(e=>e.type===`json`).forEach(t=>{n[t.name]=JSON.stringify(e[t.name]??{},null,2)}),n}function Ze(e,t,n){return!e||!t?`empty:${e??``}`:JSON.stringify({channelName:e,channelConfig:t,jsonFields:n.filter(e=>e.type===`json`).map(e=>e.name)})}function Qe({channelName:e}){let{data:t}=j(),{data:r}=ne(),{data:i}=k(),a=ee(),o=te(),[u,d]=(0,H.useState)({}),[f,m]=(0,H.useState)({}),[h,g]=(0,H.useState)(null),_=(0,H.useRef)(null),v=e?t?.channels[e]:null,y=(0,H.useMemo)(()=>me(),[]),x=e?y[e]:void 0,S=x?.fields??Ge,w=x?.layout??Ke,T=i?.uiHints,E=e?`channels.${e}`:null,D=i?.actions?.filter(e=>e.scope===E)??[],O=e&&(z(`channels.${e}`,T)?.label??e),A=r?.channels.find(t=>t.name===e),M=A?U(A):void 0,N=Ze(e,v,S);(0,H.useEffect)(()=>{_.current!==N&&(_.current=N,v?(d({...v}),m(Xe(v,S))):(d({}),m({})))},[v,S,N]);let P=(e,t)=>{d(n=>({...n,[e]:t}))},F=t=>{if(t.preventDefault(),!e)return;let r={...u};for(let e of S){if(e.type!==`password`)continue;let t=r[e.name];(typeof t!=`string`||t.length===0)&&delete r[e.name]}for(let e of S){if(e.type!==`json`)continue;let t=f[e.name]??``;try{r[e.name]=t.trim()?JSON.parse(t):{}}catch{c.error(`${n(`invalidJson`)}: ${e.name}`);return}}a.mutate({channel:e,data:r})},I=t=>{if(!t||!e)return;let n=t.channels;if(!$(n))return;let r=n[e];$(r)&&(d(e=>qe(e,r)),m(e=>{let t=!1,n={...e};for(let e of S)e.type!==`json`||!Object.prototype.hasOwnProperty.call(r,e.name)||(n[e.name]=JSON.stringify(r[e.name]??{},null,2),t=!0);return t?n:e}))},L=async t=>{if(!(!e||!E)){g(t.id);try{let r={...u};t.saveBeforeRun&&(r={...r,...t.savePatch??{}},d(r),await a.mutateAsync({channel:e,data:r}));let i=await o.mutateAsync({actionId:t.id,data:{scope:E,draftConfig:Je(E,r)}});I(i.patch),i.ok?c.success(i.message||n(`success`)):c.error(i.message||n(`error`))}catch(e){let t=e instanceof Error?e.message:String(e);c.error(`${n(`error`)}: ${t}`)}finally{g(null)}}};if(!e||!A||!v)return(0,W.jsx)(`div`,{className:ie,children:(0,W.jsxs)(`div`,{children:[(0,W.jsx)(`h3`,{className:`text-base font-semibold text-gray-900`,children:n(`channelsSelectTitle`)}),(0,W.jsx)(`p`,{className:`mt-2 text-sm text-gray-500`,children:n(`channelsSelectDescription`)})]})});let B=typeof u.enabled==`boolean`?u.enabled:!!v.enabled;return(0,W.jsxs)(`div`,{className:oe,children:[(0,W.jsx)(`div`,{className:`border-b border-gray-100 px-6 py-5`,children:(0,W.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3`,children:[(0,W.jsxs)(`div`,{className:`min-w-0`,children:[(0,W.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,W.jsx)(re,{name:e,src:C(e),className:s(`h-9 w-9 rounded-lg border`,B?`border-primary/30 bg-white`:`border-gray-200/70 bg-white`),imgClassName:`h-5 w-5 object-contain`,fallback:(0,W.jsx)(`span`,{className:`text-sm font-semibold uppercase text-gray-500`,children:e[0]})}),(0,W.jsx)(`h3`,{className:`truncate text-lg font-semibold text-gray-900 capitalize`,children:O})]}),(0,W.jsx)(`p`,{className:`mt-2 text-sm text-gray-500`,children:n(`channelsFormDescription`)}),M&&(0,W.jsxs)(`a`,{href:M,className:`mt-2 inline-flex items-center gap-1.5 text-xs text-primary transition-colors hover:text-primary-hover`,children:[(0,W.jsx)(b,{className:`h-3.5 w-3.5`}),n(`channelsGuideTitle`)]})]}),(0,W.jsx)(R,{status:B?`active`:`inactive`,label:n(B?`statusActive`:`statusInactive`)})]})}),(0,W.jsxs)(`form`,{onSubmit:F,className:`flex min-h-0 flex-1 flex-col`,children:[(0,W.jsx)(`div`,{className:`min-h-0 flex-1 space-y-6 overflow-y-auto overscroll-contain px-6 py-5`,children:w.map((t,n)=>{if(t.type===`fields`){let r=Ye(S,t.section);return r.length===0?null:t.collapsible?(0,W.jsxs)(`details`,{className:`group rounded-2xl border border-gray-200/80 bg-white`,children:[(0,W.jsxs)(`summary`,{className:`flex cursor-pointer list-none items-center justify-between gap-3 px-5 py-4 text-sm font-medium text-gray-900`,children:[(0,W.jsxs)(`div`,{children:[(0,W.jsx)(`p`,{children:t.collapsible.title}),t.collapsible.description?(0,W.jsx)(`p`,{className:`mt-1 text-xs font-normal text-gray-500`,children:t.collapsible.description}):null]}),(0,W.jsx)(p,{className:`h-4 w-4 text-gray-400 transition-transform group-open:rotate-180`})]}),(0,W.jsx)(`div`,{className:`space-y-6 border-t border-gray-100 px-5 py-5`,children:(0,W.jsx)(G,{channelName:e,fields:r,formData:u,jsonDrafts:f,setJsonDrafts:m,updateField:P,uiHints:T})})]},`${t.type}-${t.section}-${n}`):(0,W.jsx)(G,{channelName:e,fields:r,formData:u,jsonDrafts:f,setJsonDrafts:m,updateField:P,uiHints:T},`${t.type}-${t.section}-${n}`)}return t.sectionId===`weixin-auth`?(0,W.jsx)(We,{channelConfig:v,formData:u,channelEnabled:B,disabled:a.isPending||!!h},`${t.type}-${t.sectionId}-${n}`):null})}),(0,W.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3 border-t border-gray-100 px-6 py-4`,children:[(0,W.jsx)(`div`,{className:`flex flex-wrap items-center gap-2`,children:D.filter(e=>e.trigger===`manual`).map(e=>(0,W.jsx)(l,{type:`button`,onClick:()=>L(e),disabled:a.isPending||!!h,variant:`secondary`,children:h===e.id?n(`connecting`):e.title},e.id))}),(0,W.jsx)(l,{type:`submit`,disabled:a.isPending||!!h,children:a.isPending?n(`saving`):n(`save`)})]})]})]})}var $e={telegram:`channelDescTelegram`,slack:`channelDescSlack`,email:`channelDescEmail`,webhook:`channelDescWebhook`,discord:`channelDescDiscord`,feishu:`channelDescFeishu`,weixin:`channelDescWeixin`},et=[`weixin`,`feishu`,`discord`,`qq`];function tt(e){let t=new Map(et.map((e,t)=>[e,t]));return e.map((e,t)=>({channel:e,index:t})).sort((e,n)=>{let r=t.get(e.channel.name)??1/0,i=t.get(n.channel.name)??1/0;return r===i?e.index-n.index:r-i}).map(({channel:e})=>e)}function nt(){let{data:e}=j(),{data:t}=ne(),{data:r}=k(),[i,a]=(0,H.useState)(`enabled`),[o,c]=(0,H.useState)(),[l,u]=(0,H.useState)(``),d=r?.uiHints,f=(0,H.useMemo)(()=>tt(t?.channels??[]),[t?.channels]),p=e?.channels,m=[{id:`enabled`,label:n(`channelsTabEnabled`),count:f.filter(e=>p?.[e.name]?.enabled).length},{id:`all`,label:n(`channelsTabAll`),count:f.length}],h=(0,H.useMemo)(()=>{let e=l.trim().toLowerCase();return f.filter(e=>{let t=p?.[e.name]?.enabled||!1;return i===`enabled`?t:!0}).filter(t=>e?(t.displayName||t.name).toLowerCase().includes(e)||t.name.toLowerCase().includes(e):!0)},[i,p,f,l]);return(0,H.useEffect)(()=>{if(h.length===0){c(void 0);return}h.some(e=>e.name===o)||c(h[0].name)},[h,o]),!e||!t?(0,W.jsx)(`div`,{className:`p-8 text-gray-400`,children:n(`channelsLoading`)}):(0,W.jsxs)(F,{className:`xl:flex xl:h-full xl:min-h-0 xl:flex-col xl:pb-0`,children:[(0,W.jsx)(I,{title:n(`channelsPageTitle`),description:n(`channelsPageDescription`)}),(0,W.jsxs)(`div`,{className:s(B,`xl:min-h-0 xl:flex-1`),children:[(0,W.jsxs)(`section`,{className:ae,children:[(0,W.jsx)(`div`,{className:`border-b border-gray-100 px-4 pt-4`,children:(0,W.jsx)(L,{tabs:m,activeTab:i,onChange:a,className:`mb-0`})}),(0,W.jsx)(`div`,{className:`border-b border-gray-100 px-4 py-3`,children:(0,W.jsxs)(`div`,{className:`relative`,children:[(0,W.jsx)(E,{className:`pointer-events-none absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-gray-400`}),(0,W.jsx)(N,{value:l,onChange:e=>u(e.target.value),placeholder:n(`channelsFilterPlaceholder`),className:`h-10 rounded-xl pl-9`})]})}),(0,W.jsxs)(`div`,{className:`min-h-0 flex-1 space-y-2 overflow-y-auto overscroll-contain p-3`,children:[h.map(t=>{let r=e.channels[t.name]?.enabled||!1,i=z(`channels.${t.name}`,d),a=U(t),l=i?.help||n($e[t.name]||`channelDescriptionDefault`);return(0,W.jsx)(`button`,{type:`button`,onClick:()=>c(t.name),className:s(`w-full rounded-xl border p-2.5 text-left transition-all`,o===t.name?`border-primary/30 bg-primary-50/40 shadow-sm`:`border-gray-200/70 bg-white hover:border-gray-300 hover:bg-gray-50/70`),children:(0,W.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[(0,W.jsxs)(`div`,{className:`flex min-w-0 items-center gap-3`,children:[(0,W.jsx)(re,{name:t.name,src:C(t.name),className:s(`h-10 w-10 rounded-lg border`,r?`border-primary/30 bg-white`:`border-gray-200/70 bg-white`),imgClassName:`h-5 w-5 object-contain`,fallback:(0,W.jsx)(`span`,{className:`text-sm font-semibold uppercase text-gray-500`,children:t.name[0]})}),(0,W.jsxs)(`div`,{className:`min-w-0`,children:[(0,W.jsx)(`p`,{className:`truncate text-sm font-semibold text-gray-900`,children:t.displayName||t.name}),(0,W.jsx)(`p`,{className:`line-clamp-1 text-[11px] text-gray-500`,children:l})]})]}),(0,W.jsxs)(`div`,{className:`flex items-center gap-2`,children:[a&&(0,W.jsx)(`a`,{href:a,onClick:e=>e.stopPropagation(),className:`inline-flex h-7 w-7 items-center justify-center rounded-md text-gray-300 transition-colors hover:bg-gray-100/70 hover:text-gray-500`,title:n(`channelsGuideTitle`),children:(0,W.jsx)(x,{className:`h-3.5 w-3.5`})}),(0,W.jsx)(R,{status:r?`active`:`inactive`,label:n(r?`statusActive`:`statusInactive`),className:`min-w-[56px] justify-center`})]})]})},t.name)}),h.length===0&&(0,W.jsxs)(`div`,{className:`flex h-full min-h-[220px] flex-col items-center justify-center rounded-xl border border-dashed border-gray-200 bg-gray-50/70 py-10 text-center`,children:[(0,W.jsx)(`div`,{className:`mb-3 flex h-10 w-10 items-center justify-center rounded-lg bg-white`,children:(0,W.jsx)(M,{className:`h-5 w-5 text-gray-300`})}),(0,W.jsx)(`p`,{className:`text-sm font-medium text-gray-700`,children:n(`channelsNoMatch`)})]})]})]}),(0,W.jsx)(Qe,{channelName:o})]})]})}export{nt as ChannelsList};
@@ -1 +0,0 @@
1
- import{t as e}from"./DocBrowser-6ReNjvzF.js";export{e as DocBrowser};
@@ -1 +0,0 @@
1
- import{t as e}from"./MarketplacePage-D0sDlYX4.js";export{e as MarketplacePage};
@@ -1,49 +0,0 @@
1
- import{_ as e,i as t,m as n,p as r,u as i}from"./i18n-eDHeDY0n.js";import{n as a}from"./dist-ccBFUi-o.js";import{c as o,s}from"./chunk-JZWAC4HX-DK5HPmIK.js";import{i as c,s as l,t as u}from"./client-_i4MU2bB.js";import{a as d,c as f,i as p,l as m,n as h,o as g,s as _,t as v}from"./use-infinite-scroll-loader-DkNhD-42.js";import{t as y}from"./useMutation-CBWjE2uj.js";import{B as ee,C as b,E as x,F as S,G as C,I as w,N as te,R as T,S as ne,T as re,U as ie,W as E,w as D,x as O,z as ae}from"./select-DJ2MUjBB.js";import{t as k}from"./dist-6TrrnPCR.js";import{i as oe}from"./DocBrowserContext-B6SpA7Qs.js";import{i as se}from"./index-CF9xve0E.js";import{n as ce,t as le}from"./page-layout-vZnghcFy.js";import{t as ue}from"./useConfirmDialog-BkvTN-vd.js";import{t as de}from"./tabs-custom-D3HYMt6k.js";var A=e(n(),1),j=r(),[M,fe]=ie(`Tooltip`,[x]),N=x(),P=`TooltipProvider`,F=700,I=`tooltip.open`,[L,R]=M(P),z=e=>{let{__scopeTooltip:t,delayDuration:n=F,skipDelayDuration:r=300,disableHoverableContent:i=!1,children:a}=e,o=A.useRef(!0),s=A.useRef(!1),c=A.useRef(0);return A.useEffect(()=>{let e=c.current;return()=>window.clearTimeout(e)},[]),(0,j.jsx)(L,{scope:t,isOpenDelayedRef:o,delayDuration:n,onOpen:A.useCallback(()=>{window.clearTimeout(c.current),o.current=!1},[]),onClose:A.useCallback(()=>{window.clearTimeout(c.current),c.current=window.setTimeout(()=>o.current=!0,r)},[r]),isPointerInTransitRef:s,onPointerInTransitChange:A.useCallback(e=>{s.current=e},[]),disableHoverableContent:i,children:a})};z.displayName=P;var B=`Tooltip`,[V,H]=M(B),U=e=>{let{__scopeTooltip:t,children:n,open:r,defaultOpen:i,onOpenChange:a,disableHoverableContent:o,delayDuration:s}=e,c=R(B,e.__scopeTooltip),l=N(t),[u,d]=A.useState(null),f=ee(),p=A.useRef(0),m=o??c.disableHoverableContent,h=s??c.delayDuration,g=A.useRef(!1),[_,v]=ae({prop:r,defaultProp:i??!1,onChange:e=>{e?(c.onOpen(),document.dispatchEvent(new CustomEvent(I))):c.onClose(),a?.(e)},caller:B}),y=A.useMemo(()=>_?g.current?`delayed-open`:`instant-open`:`closed`,[_]),b=A.useCallback(()=>{window.clearTimeout(p.current),p.current=0,g.current=!1,v(!0)},[v]),x=A.useCallback(()=>{window.clearTimeout(p.current),p.current=0,v(!1)},[v]),S=A.useCallback(()=>{window.clearTimeout(p.current),p.current=window.setTimeout(()=>{g.current=!0,v(!0),p.current=0},h)},[h,v]);return A.useEffect(()=>()=>{p.current&&=(window.clearTimeout(p.current),0)},[]),(0,j.jsx)(re,{...l,children:(0,j.jsx)(V,{scope:t,contentId:f,open:_,stateAttribute:y,trigger:u,onTriggerChange:d,onTriggerEnter:A.useCallback(()=>{c.isOpenDelayedRef.current?S():b()},[c.isOpenDelayedRef,S,b]),onTriggerLeave:A.useCallback(()=>{m?x():(window.clearTimeout(p.current),p.current=0)},[x,m]),onOpen:b,onClose:x,disableHoverableContent:m,children:n})})};U.displayName=B;var W=`TooltipTrigger`,pe=A.forwardRef((e,t)=>{let{__scopeTooltip:n,...r}=e,i=H(W,n),a=R(W,n),o=N(n),s=E(t,A.useRef(null),i.onTriggerChange),c=A.useRef(!1),l=A.useRef(!1),u=A.useCallback(()=>c.current=!1,[]);return A.useEffect(()=>()=>document.removeEventListener(`pointerup`,u),[u]),(0,j.jsx)(ne,{asChild:!0,...o,children:(0,j.jsx)(w.button,{"aria-describedby":i.open?i.contentId:void 0,"data-state":i.stateAttribute,...r,ref:s,onPointerMove:C(e.onPointerMove,e=>{e.pointerType!==`touch`&&!l.current&&!a.isPointerInTransitRef.current&&(i.onTriggerEnter(),l.current=!0)}),onPointerLeave:C(e.onPointerLeave,()=>{i.onTriggerLeave(),l.current=!1}),onPointerDown:C(e.onPointerDown,()=>{i.open&&i.onClose(),c.current=!0,document.addEventListener(`pointerup`,u,{once:!0})}),onFocus:C(e.onFocus,()=>{c.current||i.onOpen()}),onBlur:C(e.onBlur,i.onClose),onClick:C(e.onClick,i.onClose)})})});pe.displayName=W;var G=`TooltipPortal`,[me,he]=M(G,{forceMount:void 0}),ge=e=>{let{__scopeTooltip:t,forceMount:n,children:r,container:i}=e,a=H(G,t);return(0,j.jsx)(me,{scope:t,forceMount:n,children:(0,j.jsx)(k,{present:n||a.open,children:(0,j.jsx)(te,{asChild:!0,container:i,children:r})})})};ge.displayName=G;var K=`TooltipContent`,_e=A.forwardRef((e,t)=>{let n=he(K,e.__scopeTooltip),{forceMount:r=n.forceMount,side:i=`top`,...a}=e,o=H(K,e.__scopeTooltip);return(0,j.jsx)(k,{present:r||o.open,children:o.disableHoverableContent?(0,j.jsx)(Se,{side:i,...a,ref:t}):(0,j.jsx)(ve,{side:i,...a,ref:t})})}),ve=A.forwardRef((e,t)=>{let n=H(K,e.__scopeTooltip),r=R(K,e.__scopeTooltip),i=A.useRef(null),a=E(t,i),[o,s]=A.useState(null),{trigger:c,onClose:l}=n,u=i.current,{onPointerInTransitChange:d}=r,f=A.useCallback(()=>{s(null),d(!1)},[d]),p=A.useCallback((e,t)=>{let n=e.currentTarget,r={x:e.clientX,y:e.clientY},i=Ee(r,Te(r,n.getBoundingClientRect())),a=De(t.getBoundingClientRect());s(ke([...i,...a])),d(!0)},[d]);return A.useEffect(()=>()=>f(),[f]),A.useEffect(()=>{if(c&&u){let e=e=>p(e,u),t=e=>p(e,c);return c.addEventListener(`pointerleave`,e),u.addEventListener(`pointerleave`,t),()=>{c.removeEventListener(`pointerleave`,e),u.removeEventListener(`pointerleave`,t)}}},[c,u,p,f]),A.useEffect(()=>{if(o){let e=e=>{let t=e.target,n={x:e.clientX,y:e.clientY},r=c?.contains(t)||u?.contains(t),i=!Oe(n,o);r?f():i&&(f(),l())};return document.addEventListener(`pointermove`,e),()=>document.removeEventListener(`pointermove`,e)}},[c,u,o,l,f]),(0,j.jsx)(Se,{...e,ref:a})}),[ye,be]=M(B,{isInside:!1}),xe=T(`TooltipContent`),Se=A.forwardRef((e,t)=>{let{__scopeTooltip:n,children:r,"aria-label":i,onEscapeKeyDown:a,onPointerDownOutside:o,...s}=e,c=H(K,n),l=N(n),{onClose:u}=c;return A.useEffect(()=>(document.addEventListener(I,u),()=>document.removeEventListener(I,u)),[u]),A.useEffect(()=>{if(c.trigger){let e=e=>{e.target?.contains(c.trigger)&&u()};return window.addEventListener(`scroll`,e,{capture:!0}),()=>window.removeEventListener(`scroll`,e,{capture:!0})}},[c.trigger,u]),(0,j.jsx)(S,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:a,onPointerDownOutside:o,onFocusOutside:e=>e.preventDefault(),onDismiss:u,children:(0,j.jsxs)(D,{"data-state":c.stateAttribute,...l,...s,ref:t,style:{...s.style,"--radix-tooltip-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-tooltip-content-available-width":`var(--radix-popper-available-width)`,"--radix-tooltip-content-available-height":`var(--radix-popper-available-height)`,"--radix-tooltip-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-tooltip-trigger-height":`var(--radix-popper-anchor-height)`},children:[(0,j.jsx)(xe,{children:r}),(0,j.jsx)(ye,{scope:n,isInside:!0,children:(0,j.jsx)(O,{id:c.contentId,role:`tooltip`,children:i||r})})]})})});_e.displayName=K;var Ce=`TooltipArrow`,we=A.forwardRef((e,t)=>{let{__scopeTooltip:n,...r}=e,i=N(n);return be(Ce,n).isInside?null:(0,j.jsx)(b,{...i,...r,ref:t})});we.displayName=Ce;function Te(e,t){let n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),i=Math.abs(t.right-e.x),a=Math.abs(t.left-e.x);switch(Math.min(n,r,i,a)){case a:return`left`;case i:return`right`;case n:return`top`;case r:return`bottom`;default:throw Error(`unreachable`)}}function Ee(e,t,n=5){let r=[];switch(t){case`top`:r.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case`bottom`:r.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case`left`:r.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case`right`:r.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n});break}return r}function De(e){let{top:t,right:n,bottom:r,left:i}=e;return[{x:i,y:t},{x:n,y:t},{x:n,y:r},{x:i,y:r}]}function Oe(e,t){let{x:n,y:r}=e,i=!1;for(let e=0,a=t.length-1;e<t.length;a=e++){let o=t[e],s=t[a],c=o.x,l=o.y,u=s.x,d=s.y;l>r!=d>r&&n<(u-c)*(r-l)/(d-l)+c&&(i=!i)}return i}function ke(e){let t=e.slice();return t.sort((e,t)=>e.x<t.x?-1:e.x>t.x?1:e.y<t.y?-1:e.y>t.y?1:0),Ae(t)}function Ae(e){if(e.length<=1)return e.slice();let t=[];for(let n=0;n<e.length;n++){let r=e[n];for(;t.length>=2;){let e=t[t.length-1],n=t[t.length-2];if((e.x-n.x)*(r.y-n.y)>=(e.y-n.y)*(r.x-n.x))t.pop();else break}t.push(r)}t.pop();let n=[];for(let t=e.length-1;t>=0;t--){let r=e[t];for(;n.length>=2;){let e=n[n.length-1],t=n[n.length-2];if((e.x-t.x)*(r.y-t.y)>=(e.y-t.y)*(r.x-t.x))n.pop();else break}n.push(r)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}var je=z,Me=U,Ne=pe,Pe=ge,Fe=_e,Ie=je,q=Me,J=Ne,Y=A.forwardRef(({className:e,sideOffset:t=4,...n},r)=>(0,j.jsx)(Pe,{children:(0,j.jsx)(Fe,{ref:r,sideOffset:t,className:i(`z-[var(--z-tooltip)] overflow-hidden rounded-md border bg-popover px-3 py-1.5 text-sm text-popover-foreground shadow-md animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2`,e),...n})}));Y.displayName=Fe.displayName;function X(e){return e===`plugin`?`plugins`:e===`skill`?`skills`:`mcp`}async function Le(e){let t=new URLSearchParams,n=X(e.type);e.q?.trim()&&t.set(`q`,e.q.trim()),e.tag?.trim()&&t.set(`tag`,e.tag.trim()),e.sort&&t.set(`sort`,e.sort),typeof e.page==`number`&&Number.isFinite(e.page)&&t.set(`page`,String(Math.max(1,Math.trunc(e.page)))),typeof e.pageSize==`number`&&Number.isFinite(e.pageSize)&&t.set(`pageSize`,String(Math.max(1,Math.trunc(e.pageSize))));let r=t.toString(),i=await u.get(r?`/api/marketplace/${n}/items?${r}`:`/api/marketplace/${n}/items`);if(!i.ok)throw Error(i.error.message);return i.data}async function Re(e){let t=await u.get(`/api/marketplace/skills/items/${encodeURIComponent(e)}/content`);if(!t.ok)throw Error(t.error.message);return t.data}async function ze(e){let t=await u.get(`/api/marketplace/plugins/items/${encodeURIComponent(e)}/content`);if(!t.ok)throw Error(t.error.message);return t.data}async function Be(e){let t=X(e.type),n=await u.post(`/api/marketplace/${t}/install`,e);if(!n.ok)throw Error(n.error.message);return n.data}async function Ve(e){let t=X(e),n=await u.get(`/api/marketplace/${t}/installed`);if(!n.ok)throw Error(n.error.message);return n.data}async function He(e){let t=X(e.type),n=await u.post(`/api/marketplace/${t}/manage`,e);if(!n.ok)throw Error(n.error.message);return n.data}function Ue(e){return Array.from(new Set(e.map(e=>e.spec).filter(Boolean)))}function We(e){let t=new Date().toISOString();return e.result.type===`skill`?{type:`skill`,spec:e.result.spec,id:e.request.skill??e.result.spec,label:e.request.skill??e.result.name??e.result.spec,source:`workspace`,installPath:e.request.installPath,installedAt:t}:{type:e.result.type,spec:e.result.spec,id:e.result.name??e.result.spec,label:e.result.name??e.result.spec,source:`marketplace`,origin:`marketplace`,enabled:e.request.enabled??!0,runtimeStatus:e.request.enabled===!1?`disabled`:`ready`,installedAt:t}}function Ge(e,t){return!!(t.spec&&e.spec===t.spec||t.id&&e.id===t.id)}function Ke(e,t){return t??{type:e,total:0,specs:[],records:[]}}function qe(e){let t=Ke(e.result.type,e.view),n=We(e),r=t.records.findIndex(e=>Ge(e,{id:n.id,spec:n.spec})),i=[...t.records];return r>=0?i[r]={...i[r],...n}:i.unshift(n),{...t,type:e.result.type,records:i,specs:Ue(i),total:i.length}}function Je(e){let t=Ke(e.result.type,e.view);if(e.result.action===`uninstall`||e.result.action===`remove`){let n=t.records.filter(t=>!Ge(t,{id:e.result.id,spec:e.request.spec}));return{...t,records:n,specs:Ue(n),total:n.length}}let n=t.records.map(t=>Ge(t,{id:e.result.id,spec:e.request.spec})?e.result.action===`disable`?{...t,enabled:!1,runtimeStatus:`disabled`}:{...t,enabled:!0,runtimeStatus:`ready`}:t);return{...t,records:n,specs:Ue(n),total:n.length}}function Ye(e){let t=m({queryKey:[`marketplace-items`,e],initialPageParam:1,queryFn:({pageParam:t})=>Le({...e,page:t}),getNextPageParam:e=>e.page<e.totalPages?e.page+1:void 0,placeholderData:(t,n)=>{let r=n?.queryKey?.[1];if(!(!r||typeof r!=`object`||!r))return(`type`in r?r.type:void 0)===e.type?t:void 0},staleTime:15e3}),n=(0,A.useMemo)(()=>f(t.data),[t.data]);return{...t,data:n}}function Xe(e){return c({queryKey:[`marketplace-installed`,e],queryFn:()=>Ve(e),staleTime:1e4})}function Ze(){let e=l();return y({mutationFn:e=>Be(e),onSuccess:(n,r)=>{e.setQueryData([`marketplace-installed`,n.type],e=>qe({view:e,request:r,result:n})),e.invalidateQueries({queryKey:[`marketplace-installed`,n.type],refetchType:`inactive`}),n.type===`plugin`&&e.invalidateQueries({queryKey:[`ncp-session-types`]});let i=n.type===`plugin`?t(`marketplaceInstallSuccessPlugin`):t(`marketplaceInstallSuccessSkill`);a.success(n.message||i)},onError:e=>{a.error(e.message||t(`marketplaceInstallFailed`))}})}function Qe(){let e=l();return y({mutationFn:e=>He(e),onSuccess:(n,r)=>{e.setQueryData([`marketplace-installed`,n.type],e=>Je({view:e,request:r,result:n})),e.invalidateQueries({queryKey:[`marketplace-installed`,n.type],refetchType:`inactive`}),n.type===`plugin`&&e.invalidateQueries({queryKey:[`ncp-session-types`]});let i=n.action===`enable`?t(`marketplaceEnableSuccess`):n.action===`disable`?t(`marketplaceDisableSuccess`):t(`marketplaceUninstallSuccess`);a.success(n.message||i)},onError:e=>{a.error(e.message||t(`marketplaceOperationFailed`))}})}var $e=12,et=$e;function tt(e){return(e??``).trim().toLowerCase()}function Z(e,t){let n=tt(t);return n.length>0?`${e}:${n}`:``}function nt(e){let t=new Map;for(let n of e){let e=[n.install.spec,n.slug,n.id];for(let r of e){let e=Z(n.type,r);!e||t.has(e)||t.set(e,n)}}return t}function rt(e){let t=new Map;for(let n of e){let e=[n.spec,n.id,n.label];for(let r of e){let e=Z(n.type,r);!e||t.has(e)||t.set(e,n)}}return t}function it(e,t){let n=[e.install.spec,e.slug,e.id];for(let r of n){let n=Z(e.type,r);if(!n)continue;let i=t.get(n);if(i)return i}}function at(e,t){return t.get(Z(e.type,e.spec))||t.get(Z(e.type,e.id))||t.get(Z(e.type,e.label))}function ot(e,t,n,r){let i=tt(n);if(!i)return!0;let a=p(t?.summaryI18n,t?.summary,r);return[e.id,e.spec,e.label,t?.name,t?.slug,t?.summary,a,...t?.tags??[]].map(e=>tt(e)).filter(Boolean).some(e=>e.includes(i))}function st(e){let t=[`bg-amber-600`,`bg-orange-500`,`bg-yellow-600`,`bg-emerald-600`,`bg-teal-600`,`bg-cyan-600`,`bg-stone-600`,`bg-rose-500`,`bg-violet-500`],n=0;for(let t=0;t<e.length;t++)n=e.charCodeAt(t)+((n<<5)-n);return t[Math.abs(n)%t.length]}function ct({name:e,fallback:t}){let n=e||t,r=n.substring(0,2).toUpperCase();return(0,j.jsx)(`div`,{className:i(`flex items-center justify-center w-10 h-10 rounded-xl text-white font-semibold text-sm shrink-0`,st(n)),children:r})}function Q(e){return e.replace(/&/g,`&amp;`).replace(/</g,`&lt;`).replace(/>/g,`&gt;`).replace(/"/g,`&quot;`).replace(/'/g,`&#39;`)}function $(e){let t=e.metadataRaw?.trim()||`-`,n=e.contentRaw?.trim()||`-`,r=e.summary?.trim(),i=e.description?.trim(),a=!!i&&i!==r,o=`<!doctype html>
2
- <html>
3
- <head>
4
- <meta charset="utf-8" />
5
- <meta name="viewport" content="width=device-width, initial-scale=1" />
6
- <title>${Q(e.title)}</title>
7
- <style>
8
- :root { color-scheme: light; }
9
- body { margin: 0; background: #f7f9fc; color: #0f172a; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; }
10
- .wrap { max-width: 980px; margin: 0 auto; padding: 28px 20px 40px; }
11
- .hero { border: 1px solid #dbeafe; border-radius: 16px; background: linear-gradient(180deg, #eff6ff, #ffffff); padding: 20px; box-shadow: 0 6px 20px rgba(30, 64, 175, 0.08); }
12
- .hero h1 { margin: 0; font-size: 26px; }
13
- .meta { margin-top: 8px; color: #475569; font-size: 13px; overflow-wrap: anywhere; word-break: break-word; }
14
- .summary { margin-top: 14px; font-size: 14px; line-height: 1.7; color: #334155; }
15
- .grid { display: grid; grid-template-columns: 260px 1fr; gap: 14px; margin-top: 16px; }
16
- .card { border: 1px solid #e2e8f0; background: #fff; border-radius: 14px; overflow: hidden; }
17
- .card h2 { margin: 0; padding: 12px 14px; font-size: 13px; font-weight: 700; color: #1d4ed8; border-bottom: 1px solid #e2e8f0; background: #f8fafc; }
18
- .card .body { padding: 12px 14px; font-size: 13px; color: #334155; line-height: 1.7; }
19
- .code { white-space: pre-wrap; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; line-height: 1.6; margin: 0; }
20
- .tags { margin-top: 10px; }
21
- .tag { display: inline-block; margin: 0 6px 6px 0; padding: 4px 9px; border-radius: 999px; background: #e0e7ff; color: #3730a3; font-size: 11px; }
22
- .source { color: #2563eb; text-decoration: none; overflow-wrap: anywhere; word-break: break-all; }
23
- @media (max-width: 860px) { .grid { grid-template-columns: 1fr; } }
24
- </style>
25
- </head>
26
- <body>
27
- <main class="wrap">
28
- <section class="hero">
29
- <h1>${Q(e.title)}</h1>
30
- <div class="meta">${Q(e.typeLabel)} · ${Q(e.spec)}${e.author?` · ${Q(e.author)}`:``}</div>
31
- ${r?`<p class="summary">${Q(r)}</p>`:``}
32
- ${a?`<p class="summary">${Q(i)}</p>`:``}
33
- ${e.tags&&e.tags.length>0?`<div class="tags">${e.tags.map(e=>`<span class="tag">${Q(e)}</span>`).join(``)}</div>`:``}
34
- ${e.sourceUrl?`<p class="meta" style="margin-top:12px;">${Q(e.sourceLabel??`Source`)}: <a class="source" href="${Q(e.sourceUrl)}" target="_blank" rel="noopener noreferrer">${Q(e.sourceUrl)}</a></p>`:``}
35
- </section>
36
-
37
- <section class="grid">
38
- <article class="card">
39
- <h2>Metadata</h2>
40
- <div class="body"><pre class="code">${Q(t)}</pre></div>
41
- </article>
42
- <article class="card">
43
- <h2>Content</h2>
44
- <div class="body"><pre class="code">${Q(n)}</pre></div>
45
- </article>
46
- </section>
47
- </main>
48
- </body>
49
- </html>`;return`data:text/html;charset=utf-8,${encodeURIComponent(o)}`}function lt(e){let{item:n,record:r,localeFallbacks:i,installState:a,manageState:o,onOpen:s,onInstall:c,onManage:l}=e,u=r?.type===`plugin`?r:void 0,d=n?.name??r?.label??r?.id??r?.spec??t(`marketplaceUnknownItem`),f=p(n?.summaryI18n,n?.summary,i)||(r?t(`marketplaceInstalledLocalSummary`):``),m=n?.install.spec??r?.spec??``,h=r?.id||r?.spec,g=h?o.actionsByTarget.get(h):void 0,_=!!g,v=!!u,y=r?.type===`plugin`&&r.origin!==`bundled`,ee=r?.type===`skill`&&r.source===`workspace`,b=!!(y||ee),x=r?r.enabled===!1||r.runtimeStatus===`disabled`:!1,S=n?.install.spec,C=typeof S==`string`&&a.installingSpecs.has(S);return(0,j.jsxs)(`article`,{onClick:s,className:`group bg-white border border-gray-200/40 hover:border-blue-300/80 rounded-2xl px-5 py-4 hover:shadow-md shadow-sm transition-all flex items-start gap-3.5 justify-between cursor-pointer`,children:[(0,j.jsxs)(`div`,{className:`flex gap-3 min-w-0 flex-1 h-full items-start`,children:[(0,j.jsx)(ct,{name:d,fallback:m||t(`marketplaceTypeExtension`)}),(0,j.jsx)(`div`,{className:`min-w-0 flex-1 flex flex-col justify-center h-full`,children:(0,j.jsxs)(Ie,{delayDuration:400,children:[(0,j.jsxs)(q,{children:[(0,j.jsx)(J,{asChild:!0,children:(0,j.jsx)(`div`,{className:`text-[14px] font-semibold text-gray-900 truncate leading-tight`,children:d})}),(0,j.jsx)(Y,{className:`max-w-[300px] text-xs`,children:d})]}),(0,j.jsx)(`div`,{className:`flex items-center gap-1.5 mt-0.5 mb-1.5`,children:m&&(0,j.jsxs)(q,{children:[(0,j.jsx)(J,{asChild:!0,children:(0,j.jsx)(`span`,{className:`text-[11px] text-gray-400 truncate max-w-full font-mono`,children:m})}),(0,j.jsx)(Y,{className:`max-w-[300px] text-xs font-mono break-all`,children:m})]})}),(0,j.jsxs)(q,{children:[(0,j.jsx)(J,{asChild:!0,children:(0,j.jsx)(`p`,{className:`text-[12px] text-gray-500/90 line-clamp-1 transition-colors leading-relaxed text-left`,children:f})}),f&&(0,j.jsx)(Y,{className:`max-w-[400px] text-xs leading-relaxed`,children:f})]})]})})]}),(0,j.jsxs)(`div`,{className:`shrink-0 flex items-center h-full`,children:[n&&!r&&(0,j.jsx)(`button`,{onClick:e=>{e.stopPropagation(),c(n)},disabled:C,className:`inline-flex items-center gap-1.5 h-8 px-4 rounded-xl text-xs font-medium bg-primary text-white hover:bg-primary-600 disabled:opacity-50 transition-colors`,children:t(C?`marketplaceInstalling`:`marketplaceInstall`)}),u&&v&&(0,j.jsx)(`button`,{disabled:_,onClick:e=>{e.stopPropagation(),l(x?`enable`:`disable`,u)},className:`inline-flex items-center h-8 px-4 rounded-xl text-xs font-medium border border-gray-200/80 text-gray-600 bg-white hover:bg-gray-50 hover:border-gray-300 disabled:opacity-50 transition-colors`,children:t(g&&g!==`uninstall`?g===`enable`?`marketplaceEnabling`:`marketplaceDisabling`:x?`marketplaceEnable`:`marketplaceDisable`)}),r&&b&&(0,j.jsx)(`button`,{disabled:_,onClick:e=>{e.stopPropagation(),l(`uninstall`,r)},className:`inline-flex items-center h-8 px-4 rounded-xl text-xs font-medium border border-rose-100 text-rose-500 bg-white hover:bg-rose-50 hover:border-rose-200 disabled:opacity-50 transition-colors`,children:t(g===`uninstall`?`marketplaceRemoving`:`marketplaceUninstall`)})]})]})}function ut(e={}){let{forcedType:n}=e,r=s(),i=o(),{language:a}=se(),c=oe(),l=(0,A.useMemo)(()=>n===`plugins`||n===`skills`?n:i.type===`plugins`||i.type===`skills`?i.type:null,[n,i.type]);(0,A.useEffect)(()=>{n||l||r(`/marketplace/plugins`,{replace:!0})},[n,l,r]);let u=l===`skills`?`skill`:`plugin`,f=(0,A.useMemo)(()=>h(a),[a]),m=u===`plugin`?{pageTitle:`marketplacePluginsPageTitle`,pageDescription:`marketplacePluginsPageDescription`,tabMarketplace:`marketplaceTabMarketplacePlugins`,tabInstalled:`marketplaceTabInstalledPlugins`,searchPlaceholder:`marketplaceSearchPlaceholderPlugins`,sectionCatalog:`marketplaceSectionPlugins`,sectionInstalled:`marketplaceSectionInstalledPlugins`,errorLoadData:`marketplaceErrorLoadingPluginsData`,errorLoadInstalled:`marketplaceErrorLoadingInstalledPlugins`,emptyData:`marketplaceNoPlugins`,emptyInstalled:`marketplaceNoInstalledPlugins`,installedCountSuffix:`marketplaceInstalledPluginsCountSuffix`}:{pageTitle:`marketplaceSkillsPageTitle`,pageDescription:`marketplaceSkillsPageDescription`,tabMarketplace:`marketplaceTabMarketplaceSkills`,tabInstalled:`marketplaceTabInstalledSkills`,searchPlaceholder:`marketplaceSearchPlaceholderSkills`,sectionCatalog:`marketplaceSectionSkills`,sectionInstalled:`marketplaceSectionInstalledSkills`,errorLoadData:`marketplaceErrorLoadingSkillsData`,errorLoadInstalled:`marketplaceErrorLoadingInstalledSkills`,emptyData:`marketplaceNoSkills`,emptyInstalled:`marketplaceNoInstalledSkills`,installedCountSuffix:`marketplaceInstalledSkillsCountSuffix`},[y,ee]=(0,A.useState)(``),[b,x]=(0,A.useState)(``),[S,C]=(0,A.useState)(`all`),[w,te]=(0,A.useState)(`relevance`),[T,ne]=(0,A.useState)(new Set),[re,ie]=(0,A.useState)(new Map);(0,A.useEffect)(()=>{let e=setTimeout(()=>{x(y.trim())},250);return()=>clearTimeout(e)},[y]);let E=Xe(u),D=Ye({q:b||void 0,type:u,sort:w,pageSize:$e}),O=v({disabled:S!==`all`||D.isError||!D.hasNextPage||D.isFetchingNextPage,onLoadMore:()=>D.fetchNextPage(),watchValue:`${u}:${S}:${b}:${w}:${D.data?.loadedItems??0}:${D.data?.loadedPages??0}`});(0,A.useEffect)(()=>{let e=O.containerRef.current;e&&typeof e.scrollTo==`function`&&e.scrollTo({top:0})},[O.containerRef,b,S,w,u]);let ae=Ze(),k=Qe(),{confirm:M,ConfirmDialog:fe}=ue(),N=(0,A.useMemo)(()=>E.data?.records??[],[E.data?.records]),P=(0,A.useMemo)(()=>D.data?.items??[],[D.data?.items]),F=(0,A.useMemo)(()=>nt(P),[P]),I=(0,A.useMemo)(()=>rt(N),[N]),L=(0,A.useMemo)(()=>{let e=N.filter(e=>e.type===u).map(e=>({key:`${e.type}:${e.spec}:${e.id??``}`,record:e,item:at(e,F)})).filter(e=>ot(e.record,e.item,b,f));return e.sort((e,t)=>{let n=e.record.installedAt?Date.parse(e.record.installedAt):NaN,r=t.record.installedAt?Date.parse(t.record.installedAt):NaN;return!Number.isNaN(n)&&!Number.isNaN(r)&&n!==r?r-n:e.record.spec.localeCompare(t.record.spec)}),e},[N,u,F,b,f]),R=S===`installed`?L.length:D.data?.total??0,z=S===`all`&&D.isLoading&&!D.data,B=S===`installed`&&E.isLoading&&!E.data,V=z||B,H=(0,A.useMemo)(()=>S===`installed`?E.isLoading&&!E.data?t(`loading`):`${L.length} ${t(m.installedCountSuffix)}`:D.data?`${P.length} / ${R}`:t(`loading`),[S,E.data,E.isLoading,L.length,D.data,P.length,R,m.installedCountSuffix]),U={installingSpecs:T},W={actionsByTarget:re},pe=[{id:`all`,label:t(m.tabMarketplace)},{id:`installed`,label:t(m.tabInstalled),count:E.data?.total??0}],G=async e=>{let t=e.install.spec;if(!T.has(t)){ne(e=>{let n=new Set(e);return n.add(t),n});try{await ae.mutateAsync({type:e.type,spec:t,kind:e.install.kind,...e.type===`skill`?{skill:e.slug,installPath:`skills/${e.slug}`}:{}})}catch{}finally{ne(e=>{if(!e.has(t))return e;let n=new Set(e);return n.delete(t),n})}}},me=async(e,n)=>{let r=n.id||n.spec;if(r&&!re.has(r)&&!(e===`uninstall`&&!await M({title:`${t(`marketplaceUninstallTitle`)} ${r}?`,description:t(`marketplaceUninstallDescription`),confirmLabel:t(`marketplaceUninstall`),variant:`destructive`}))){ie(t=>{let n=new Map(t);return n.set(r,e),n});try{await k.mutateAsync({type:n.type,action:e,id:r,spec:n.spec})}finally{ie(e=>{if(!e.has(r))return e;let t=new Map(e);return t.delete(r),t})}}},he=async(e,n)=>{let r=e?.name??n?.label??n?.id??n?.spec??t(`marketplaceUnknownItem`);if(!e){let e=$({title:r,typeLabel:n?.type===`plugin`?t(`marketplaceTypePlugin`):t(`marketplaceTypeSkill`),spec:n?.spec??`-`,summary:t(`marketplaceInstalledLocalSummary`),metadataRaw:JSON.stringify(n??{},null,2),contentRaw:`-`});c.open(e,{newTab:!0,title:r,kind:`content`});return}let i=p(e.summaryI18n,e.summary,f);if(e.type===`skill`){try{let n=await Re(e.slug),a=$({title:r,typeLabel:t(`marketplaceTypeSkill`),spec:e.install.spec,summary:i,metadataRaw:n.metadataRaw,contentRaw:n.bodyRaw||n.raw,sourceUrl:n.sourceUrl,sourceLabel:`Source (${n.source})`,tags:e.tags,author:e.author});c.open(a,{newTab:!0,title:r,kind:`content`})}catch(n){let a=$({title:r,typeLabel:t(`marketplaceTypeSkill`),spec:e.install.spec,summary:i,metadataRaw:JSON.stringify({error:n instanceof Error?n.message:String(n)},null,2),contentRaw:t(`marketplaceOperationFailed`)});c.open(a,{newTab:!0,title:r,kind:`content`})}return}try{let n=await ze(e.slug),a=$({title:r,typeLabel:t(`marketplaceTypePlugin`),spec:e.install.spec,summary:i,metadataRaw:n.metadataRaw,contentRaw:n.bodyRaw||n.raw||e.summary,sourceUrl:n.sourceUrl,sourceLabel:`Source (${n.source})`,tags:e.tags,author:e.author});c.open(a,{newTab:!0,title:r,kind:`content`})}catch(n){let a=$({title:r,typeLabel:t(`marketplaceTypePlugin`),spec:e.install.spec,summary:i,metadataRaw:JSON.stringify({error:n instanceof Error?n.message:String(n)},null,2),contentRaw:`-`});c.open(a,{newTab:!0,title:r,kind:`content`})}};return(0,j.jsxs)(ce,{className:`flex h-full min-h-0 flex-col pb-0`,children:[(0,j.jsx)(le,{title:t(m.pageTitle),description:t(m.pageDescription)}),(0,j.jsx)(de,{tabs:pe,activeTab:S,onChange:e=>C(e),className:`mb-4`}),(0,j.jsx)(d,{scope:S,searchText:y,searchPlaceholder:t(m.searchPlaceholder),sort:w,onSearchTextChange:ee,onSortChange:te}),(0,j.jsxs)(`section`,{className:`flex min-h-0 flex-1 flex-col`,children:[(0,j.jsxs)(`div`,{className:`flex items-center justify-between mb-3`,children:[(0,j.jsx)(`h3`,{className:`text-[14px] font-semibold text-gray-900`,children:t(S===`installed`?m.sectionInstalled:m.sectionCatalog)}),(0,j.jsx)(`span`,{className:`text-[12px] text-gray-500`,children:H})]}),S===`all`&&D.isError&&(0,j.jsxs)(`div`,{className:`p-4 rounded-xl bg-rose-50 border border-rose-200 text-rose-700 text-sm`,children:[t(m.errorLoadData),`: `,D.error.message]}),S===`installed`&&E.isError&&(0,j.jsxs)(`div`,{className:`p-4 rounded-xl bg-rose-50 border border-rose-200 text-rose-700 text-sm`,children:[t(m.errorLoadInstalled),`: `,E.error.message]}),(0,j.jsxs)(`div`,{ref:O.containerRef,className:`min-h-0 flex-1 overflow-y-auto custom-scrollbar pr-1`,"aria-busy":V||D.isFetchingNextPage,children:[(0,j.jsxs)(`div`,{"data-testid":V?`marketplace-list-skeleton`:void 0,className:`grid grid-cols-1 gap-3 lg:grid-cols-2 2xl:grid-cols-3`,children:[V&&(0,j.jsx)(_,{count:et}),!V&&S===`all`&&P.map(e=>(0,j.jsx)(lt,{item:e,record:it(e,I),localeFallbacks:f,installState:U,manageState:W,onOpen:()=>void he(e,it(e,I)),onInstall:G,onManage:me},e.id)),!V&&S===`installed`&&L.map(e=>(0,j.jsx)(lt,{item:e.item,record:e.record,localeFallbacks:f,installState:U,manageState:W,onOpen:()=>void he(e.item,e.record),onInstall:G,onManage:me},e.key))]}),S===`all`&&!V&&!D.isError&&P.length===0&&(0,j.jsx)(`div`,{className:`text-[13px] text-gray-500 py-8 text-center`,children:t(m.emptyData)}),S===`installed`&&!V&&!E.isError&&L.length===0&&(0,j.jsx)(`div`,{className:`text-[13px] text-gray-500 py-8 text-center`,children:t(m.emptyInstalled)}),S===`all`&&!z&&!D.isError&&(0,j.jsx)(g,{hasMore:!!D.hasNextPage,loading:D.isFetchingNextPage,sentinelRef:O.sentinelRef})]})]}),(0,j.jsx)(fe,{})]})}export{J as a,je as c,Ie as i,Me as l,q as n,Fe as o,Y as r,Pe as s,ut as t,Ne as u};