nextclaw 0.16.26 → 0.16.28
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli/index.js +29 -13
- package/package.json +13 -13
- package/templates/USAGE.md +9 -1
- package/ui-dist/assets/ChannelsList-eZfHzvxb.js +8 -0
- package/ui-dist/assets/ChatPage-DKD5hcD8.js +38 -0
- package/ui-dist/assets/DocBrowser-CIHLqoIm.js +1 -0
- package/ui-dist/assets/DocBrowser-DKkE3Y4I.js +1 -0
- package/ui-dist/assets/DocBrowserContext-BcZRBsCg.js +1 -0
- package/ui-dist/assets/LogoBadge-BIPDLEwK.js +1 -0
- package/ui-dist/assets/MarketplacePage-CMPjqEmN.js +1 -0
- package/ui-dist/assets/MarketplacePage-D0iqC5o7.js +49 -0
- package/ui-dist/assets/McpMarketplacePage-CCmRjGwl.js +40 -0
- package/ui-dist/assets/ModelConfig-BiWp8Ymp.js +1 -0
- package/ui-dist/assets/ProvidersList-HaCAzF9F.js +1 -0
- package/ui-dist/assets/RemoteAccessPage-DOF4oEHW.js +1 -0
- package/ui-dist/assets/RuntimeConfig-BnkWf6Eb.js +1 -0
- package/ui-dist/assets/SearchConfig-3ofKM9W4.js +1 -0
- package/ui-dist/assets/SecretsConfig-BRbC2hfo.js +3 -0
- package/ui-dist/assets/SessionsConfig-BpoD_0WD.js +2 -0
- package/ui-dist/assets/book-open-DzSduAaw.js +1 -0
- package/ui-dist/assets/chat-session-display-CGfXhJoT.js +1 -0
- package/ui-dist/assets/chunk-JZWAC4HX-C1vpvW4r.js +3 -0
- package/ui-dist/assets/config-Df97LeLR.js +1 -0
- package/ui-dist/assets/config-hints-fGnUjDe9.js +1 -0
- package/ui-dist/assets/config-layout-B-7erZRN.js +1 -0
- package/ui-dist/assets/createLucideIcon-CcR5wVoU.js +1 -0
- package/ui-dist/assets/dist-BMlnBah3.js +1 -0
- package/ui-dist/assets/dist-Dii9v3X9.js +15 -0
- package/ui-dist/assets/external-link-CnSDrvJE.js +1 -0
- package/ui-dist/assets/hash-CAnX6PNt.js +1 -0
- package/ui-dist/assets/i18n-CXBpwAwA.js +1 -0
- package/ui-dist/assets/index-CjPeKafH.js +6 -0
- package/ui-dist/assets/index-DMy_fKKh.css +1 -0
- package/ui-dist/assets/label-CtIFj7_6.js +1 -0
- package/ui-dist/assets/loader-circle-qgU4zQDw.js +1 -0
- package/ui-dist/assets/logos-3KFNiOej.js +1 -0
- package/ui-dist/assets/marketplace-localization-CXeGRf6E.js +1 -0
- package/ui-dist/assets/page-layout-BMwpn87D.js +1 -0
- package/ui-dist/assets/plus-C9cYVbL-.js +1 -0
- package/ui-dist/assets/popover-BIzq25oH.js +1 -0
- package/ui-dist/assets/provider-models-C8JQUd1E.js +1 -0
- package/ui-dist/assets/react-ji6GGP_j.js +1 -0
- package/ui-dist/assets/save-CMgYkJ-y.js +1 -0
- package/ui-dist/assets/search-sl1OeJFl.js +1 -0
- package/ui-dist/assets/security-config-BcbOF17w.js +1 -0
- package/ui-dist/assets/select-Cz82gl01.js +41 -0
- package/ui-dist/assets/skeleton-rgIt7a5q.js +1 -0
- package/ui-dist/assets/status-dot-C7q1HvLH.js +1 -0
- package/ui-dist/assets/switch-DYswvkYj.js +1 -0
- package/ui-dist/assets/tabs-custom-DKYQxrx1.js +1 -0
- package/ui-dist/assets/trash-2-DfXI7-ap.js +1 -0
- package/ui-dist/assets/useConfirmDialog-Dk15Fj1n.js +1 -0
- package/ui-dist/assets/useMutation-s2sn2yzh.js +1 -0
- package/ui-dist/assets/x-MIimOGs6.js +1 -0
- package/ui-dist/index.html +18 -3
- package/ui-dist/assets/ChannelsList-UKA-5t02.js +0 -8
- package/ui-dist/assets/ChatPage-xdBp-ddG.js +0 -37
- package/ui-dist/assets/DocBrowser-DBUIWJer.js +0 -1
- package/ui-dist/assets/LogoBadge-CsSBHZeV.js +0 -1
- package/ui-dist/assets/MarketplacePage-BSH836_G.js +0 -49
- package/ui-dist/assets/McpMarketplacePage-B9_kPnnM.js +0 -40
- package/ui-dist/assets/ModelConfig-DbEKVVg4.js +0 -1
- package/ui-dist/assets/ProvidersList-Ck5PgTF2.js +0 -1
- package/ui-dist/assets/RemoteAccessPage-4JED9IcK.js +0 -1
- package/ui-dist/assets/RuntimeConfig-CB04ug9v.js +0 -1
- package/ui-dist/assets/SearchConfig-DmuvL9Pn.js +0 -1
- package/ui-dist/assets/SecretsConfig-Dw2sRiSs.js +0 -3
- package/ui-dist/assets/SessionsConfig-c-Z9X3xH.js +0 -2
- package/ui-dist/assets/chat-session-display-z9RvX-D3.js +0 -1
- package/ui-dist/assets/config-hints-CApS3K_7.js +0 -1
- package/ui-dist/assets/config-layout-BHnOoweL.js +0 -1
- package/ui-dist/assets/index-CfVmBgkf.css +0 -1
- package/ui-dist/assets/index-DqzLj8Sw.js +0 -8
- package/ui-dist/assets/label-DPGDZvhm.js +0 -1
- package/ui-dist/assets/marketplace-localization-Dk31LJJJ.js +0 -1
- package/ui-dist/assets/page-layout-DMA_ZiHj.js +0 -1
- package/ui-dist/assets/popover-BBLXwfva.js +0 -1
- package/ui-dist/assets/provider-models-BOeNnjk9.js +0 -1
- package/ui-dist/assets/security-config-FYNEE2eR.js +0 -1
- package/ui-dist/assets/skeleton-DLM_39_P.js +0 -1
- package/ui-dist/assets/status-dot-BOzEprxw.js +0 -1
- package/ui-dist/assets/switch-rE_Ew8fl.js +0 -1
- package/ui-dist/assets/tabs-custom-BkfMUTHE.js +0 -1
- package/ui-dist/assets/useConfirmDialog-0owrqZcT.js +0 -1
- package/ui-dist/assets/vendor-MCpnpiKt.js +0 -461
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{_ as e,m as t}from"./i18n-CXBpwAwA.js";import{C as n,D as r,E as i,M as a,O as o,S as s,T as c,_ as l,b as u,d,g as f,h as p,j as m,m as h,p as g,v as _,w as v,x as y,y as b}from"./dist-Dii9v3X9.js";function x(e){return{onFetch:(t,n)=>{let r=t.options,i=t.fetchOptions?.meta?.fetchMore?.direction,a=t.state.data?.pages||[],o=t.state.data?.pageParams||[],s={pages:[],pageParams:[]},c=0,d=async()=>{let n=!1,d=e=>{l(e,()=>t.signal,()=>n=!0)},f=u(t.options,t.fetchOptions),p=async(e,r,i)=>{if(n)return Promise.reject();if(r==null&&e.pages.length)return Promise.resolve(e);let a=await f((()=>{let e={client:t.client,queryKey:t.queryKey,pageParam:r,direction:i?`backward`:`forward`,meta:t.options.meta};return d(e),e})()),{maxPages:o}=t.options,s=i?b:_;return{pages:s(e.pages,a,o),pageParams:s(e.pageParams,r,o)}};if(i&&a.length){let e=i===`backward`,t=e?C:S,n={pages:a,pageParams:o};s=await p(n,t(r,n),e)}else{let t=e??a.length;do{let e=c===0?o[0]??r.initialPageParam:S(r,s);if(c>0&&e==null)break;s=await p(s,e),c++}while(c<t)}return s};t.options.persister?t.fetchFn=()=>t.options.persister?.(d,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n):t.fetchFn=d}}}function S(e,{pages:t,pageParams:n}){let r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function C(e,{pages:t,pageParams:n}){return t.length>0?e.getPreviousPageParam?.(t[0],t,n[0],n):void 0}var w=class extends a{constructor(e={}){super(),this.config=e,this.#e=new Set,this.#t=new Map,this.#n=0}#e;#t;#n;build(e,t,n){let r=new d({client:e,mutationCache:this,mutationId:++this.#n,options:e.defaultMutationOptions(t),state:n});return this.add(r),r}add(e){this.#e.add(e);let t=T(e);if(typeof t==`string`){let n=this.#t.get(t);n?n.push(e):this.#t.set(t,[e])}this.notify({type:`added`,mutation:e})}remove(e){if(this.#e.delete(e)){let t=T(e);if(typeof t==`string`){let n=this.#t.get(t);if(n)if(n.length>1){let t=n.indexOf(e);t!==-1&&n.splice(t,1)}else n[0]===e&&this.#t.delete(t)}}this.notify({type:`removed`,mutation:e})}canRun(e){let t=T(e);if(typeof t==`string`){let n=this.#t.get(t)?.find(e=>e.state.status===`pending`);return!n||n===e}else return!0}runNext(e){let t=T(e);return typeof t==`string`?(this.#t.get(t)?.find(t=>t!==e&&t.state.isPaused))?.continue()??Promise.resolve():Promise.resolve()}clear(){p.batch(()=>{this.#e.forEach(e=>{this.notify({type:`removed`,mutation:e})}),this.#e.clear(),this.#t.clear()})}getAll(){return Array.from(this.#e)}find(e){let t={exact:!0,...e};return this.getAll().find(e=>v(t,e))}findAll(e={}){return this.getAll().filter(t=>v(e,t))}notify(e){p.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){let e=this.getAll().filter(e=>e.state.isPaused);return p.batch(()=>Promise.all(e.map(e=>e.continue().catch(i))))}};function T(e){return e.options.scope?.id}var E=class extends a{constructor(e={}){super(),this.config=e,this.#e=new Map}#e;build(e,t,r){let i=t.queryKey,a=t.queryHash??n(i,t),o=this.get(a);return o||(o=new g({client:e,queryKey:i,queryHash:a,options:e.defaultQueryOptions(t),state:r,defaultOptions:e.getQueryDefaults(i)}),this.add(o)),o}add(e){this.#e.has(e.queryHash)||(this.#e.set(e.queryHash,e),this.notify({type:`added`,query:e}))}remove(e){let t=this.#e.get(e.queryHash);t&&(e.destroy(),t===e&&this.#e.delete(e.queryHash),this.notify({type:`removed`,query:e}))}clear(){p.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#e.get(e)}getAll(){return[...this.#e.values()]}find(e){let t={exact:!0,...e};return this.getAll().find(e=>c(t,e))}findAll(e={}){let t=this.getAll();return Object.keys(e).length>0?t.filter(t=>c(e,t)):t}notify(e){p.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){p.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){p.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},D=new class{#e;#t;#n;#r;#i;#a;#o;#s;constructor(e={}){this.#e=e.queryCache||new E,this.#t=e.mutationCache||new w,this.#n=e.defaultOptions||{},this.#r=new Map,this.#i=new Map,this.#a=0}mount(){this.#a++,this.#a===1&&(this.#o=f.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#s=h.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onOnline())}))}unmount(){this.#a--,this.#a===0&&(this.#o?.(),this.#o=void 0,this.#s?.(),this.#s=void 0)}isFetching(e){return this.#e.findAll({...e,fetchStatus:`fetching`}).length}isMutating(e){return this.#t.findAll({...e,status:`pending`}).length}getQueryData(e){let t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state.data}ensureQueryData(e){let t=this.defaultQueryOptions(e),n=this.#e.build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(o(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return this.#e.findAll(e).map(({queryKey:e,state:t})=>[e,t.data])}setQueryData(e,t,n){let r=this.defaultQueryOptions({queryKey:e}),i=this.#e.get(r.queryHash)?.state.data,a=y(t,i);if(a!==void 0)return this.#e.build(this,r).setData(a,{...n,manual:!0})}setQueriesData(e,t,n){return p.batch(()=>this.#e.findAll(e).map(({queryKey:e})=>[e,this.setQueryData(e,t,n)]))}getQueryState(e){let t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state}removeQueries(e){let t=this.#e;p.batch(()=>{t.findAll(e).forEach(e=>{t.remove(e)})})}resetQueries(e,t){let n=this.#e;return p.batch(()=>(n.findAll(e).forEach(e=>{e.reset()}),this.refetchQueries({type:`active`,...e},t)))}cancelQueries(e,t={}){let n={revert:!0,...t},r=p.batch(()=>this.#e.findAll(e).map(e=>e.cancel(n)));return Promise.all(r).then(i).catch(i)}invalidateQueries(e,t={}){return p.batch(()=>(this.#e.findAll(e).forEach(e=>{e.invalidate()}),e?.refetchType===`none`?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??`active`},t)))}refetchQueries(e,t={}){let n={...t,cancelRefetch:t.cancelRefetch??!0},r=p.batch(()=>this.#e.findAll(e).filter(e=>!e.isDisabled()&&!e.isStatic()).map(e=>{let t=e.fetch(void 0,n);return n.throwOnError||(t=t.catch(i)),e.state.fetchStatus===`paused`?Promise.resolve():t}));return Promise.all(r).then(i)}fetchQuery(e){let t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);let n=this.#e.build(this,t);return n.isStaleByTime(o(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(i).catch(i)}fetchInfiniteQuery(e){return e.behavior=x(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(i).catch(i)}ensureInfiniteQueryData(e){return e.behavior=x(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return h.isOnline()?this.#t.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#e}getMutationCache(){return this.#t}getDefaultOptions(){return this.#n}setDefaultOptions(e){this.#n=e}setQueryDefaults(e,t){this.#r.set(s(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){let t=[...this.#r.values()],n={};return t.forEach(t=>{r(e,t.queryKey)&&Object.assign(n,t.defaultOptions)}),n}setMutationDefaults(e,t){this.#i.set(s(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){let t=[...this.#i.values()],n={};return t.forEach(t=>{r(e,t.mutationKey)&&Object.assign(n,t.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;let t={...this.#n.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||=n(t.queryKey,t),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!==`always`),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode=`offlineFirst`),t.queryFn===m&&(t.enabled=!1),t}defaultMutationOptions(e){return e?._defaulted?e:{...this.#n.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#e.clear(),this.#t.clear()}}({defaultOptions:{queries:{retry:1,refetchOnWindowFocus:!0}}}),O=e=>{let t,n=new Set,r=(e,r)=>{let i=typeof e==`function`?e(t):e;if(!Object.is(i,t)){let e=t;t=r??(typeof i!=`object`||!i)?i:Object.assign({},t,i),n.forEach(n=>n(t,e))}},i=()=>t,a={setState:r,getState:i,getInitialState:()=>o,subscribe:e=>(n.add(e),()=>n.delete(e))},o=t=e(r,i,a);return a},k=(e=>e?O(e):O),A=e(t(),1),j=e=>e;function M(e,t=j){let n=A.useSyncExternalStore(e.subscribe,A.useCallback(()=>t(e.getState()),[e,t]),A.useCallback(()=>t(e.getInitialState()),[e,t]));return A.useDebugValue(n),n}var N=e=>{let t=k(e),n=e=>M(t,e);return Object.assign(n,t),n},P=(e=>e?N(e):N);export{D as n,P as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{t as e}from"./createLucideIcon-CcR5wVoU.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-CcR5wVoU.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,l as t,m as n,p as r}from"./i18n-CXBpwAwA.js";import{n as i,o as a}from"./dist-Dii9v3X9.js";import{B as o,G as s,H as c,J as l,K as u,R as d,U as f,V as p,W as m,q as h,z as g}from"./index-CjPeKafH.js";import{n as _,t as v}from"./page-layout-BMwpn87D.js";import{t as y}from"./label-CtIFj7_6.js";import{t as b}from"./switch-DYswvkYj.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:(i.error(t(`authPasswordMismatch`)),!1)}function E(){let e=d(),n=o(),r=p(),i=c(),_=g(),[v,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=v.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:v.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 _.mutateAsync()}catch{}};return e.isLoading&&!P?(0,S.jsxs)(m,{children:[(0,S.jsxs)(h,{children:[(0,S.jsx)(l,{children:t(`authSecurityTitle`)}),(0,S.jsx)(u,{children:t(`authSecurityDescription`)})]}),(0,S.jsx)(s,{className:`text-sm text-gray-500`,children:t(`loading`)})]}):e.isError||!P?(0,S.jsxs)(m,{children:[(0,S.jsxs)(h,{children:[(0,S.jsx)(l,{children:t(`authSecurityTitle`)}),(0,S.jsx)(u,{children:t(`authSecurityDescription`)})]}),(0,S.jsxs)(s,{className:`space-y-4`,children:[(0,S.jsx)(`p`,{className:`text-sm text-gray-500`,children:t(`authStatusLoadFailed`)}),(0,S.jsx)(a,{variant:`outline`,onClick:()=>{e.refetch()},children:t(`authRetryStatus`)})]})]}):P.configured?(0,S.jsxs)(m,{children:[(0,S.jsxs)(h,{children:[(0,S.jsx)(l,{children:t(`authSecurityTitle`)}),(0,S.jsx)(u,{children:t(`authSecurityDescription`)})]}),(0,S.jsxs)(s,{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)(y,{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)(y,{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)(a,{type:`button`,disabled:!I,onClick:()=>void R(),children:i.isPending?t(`authPasswordUpdating`):t(`authPasswordAction`)}),P.enabled&&P.authenticated?(0,S.jsx)(a,{type:`button`,variant:`outline`,disabled:_.isPending,onClick:()=>void B(),children:_.isPending?t(`authLoggingOut`):t(`authLogoutAction`)}):null]}),(0,S.jsx)(`p`,{className:`text-xs text-gray-500`,children:t(`authSessionMemoryNotice`)})]})]})]}):(0,S.jsxs)(m,{children:[(0,S.jsxs)(h,{children:[(0,S.jsx)(l,{children:t(`authSecurityTitle`)}),(0,S.jsx)(u,{children:t(`authSecurityDescription`)})]}),(0,S.jsxs)(s,{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)(y,{htmlFor:`auth-setup-username`,children:t(`authUsername`)}),(0,S.jsx)(f,{id:`auth-setup-username`,value:v,onChange:e=>C(e.target.value),placeholder:t(`authUsernamePlaceholder`)})]}),(0,S.jsxs)(`div`,{className:`space-y-2`,children:[(0,S.jsx)(y,{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)(y,{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)(a,{type:`button`,disabled:!F,onClick:()=>void L(),children:n.isPending?t(`authSettingUp`):t(`authSetupAction`)})]})]})}function D(){return(0,S.jsxs)(_,{className:`space-y-6`,children:[(0,S.jsx)(v,{title:t(`authSecurityTitle`),description:t(`authSecurityDescription`)}),(0,S.jsx)(E,{})]})}export{D as SecurityConfig};
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import{_ as e,m as t,p as n,u as r}from"./i18n-CXBpwAwA.js";import{N as i}from"./dist-Dii9v3X9.js";import{t as a}from"./createLucideIcon-CcR5wVoU.js";typeof window<`u`&&window.document&&window.document.createElement;function o(e,t,{checkForDefaultPrevented:n=!0}={}){return function(r){if(e?.(r),n===!1||!r.defaultPrevented)return t?.(r)}}var s=e(t(),1);function c(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}function l(...e){return t=>{let n=!1,r=e.map(e=>{let r=c(e,t);return!n&&typeof r==`function`&&(n=!0),r});if(n)return()=>{for(let t=0;t<r.length;t++){let n=r[t];typeof n==`function`?n():c(e[t],null)}}}}function u(...e){return s.useCallback(l(...e),e)}var d=n();function f(e,t){let n=s.createContext(t),r=e=>{let{children:t,...r}=e,i=s.useMemo(()=>r,Object.values(r));return(0,d.jsx)(n.Provider,{value:i,children:t})};r.displayName=e+`Provider`;function i(r){let i=s.useContext(n);if(i)return i;if(t!==void 0)return t;throw Error(`\`${r}\` must be used within \`${e}\``)}return[r,i]}function p(e,t=[]){let n=[];function r(t,r){let i=s.createContext(r),a=n.length;n=[...n,r];let o=t=>{let{scope:n,children:r,...o}=t,c=n?.[e]?.[a]||i,l=s.useMemo(()=>o,Object.values(o));return(0,d.jsx)(c.Provider,{value:l,children:r})};o.displayName=t+`Provider`;function c(n,o){let c=o?.[e]?.[a]||i,l=s.useContext(c);if(l)return l;if(r!==void 0)return r;throw Error(`\`${n}\` must be used within \`${t}\``)}return[o,c]}let i=()=>{let t=n.map(e=>s.createContext(e));return function(n){let r=n?.[e]||t;return s.useMemo(()=>({[`__scope${e}`]:{...n,[e]:r}}),[n,r])}};return i.scopeName=e,[r,m(i,...t)]}function m(...e){let t=e[0];if(e.length===1)return t;let n=()=>{let n=e.map(e=>({useScope:e(),scopeName:e.scopeName}));return function(e){let r=n.reduce((t,{useScope:n,scopeName:r})=>{let i=n(e)[`__scope${r}`];return{...t,...i}},{});return s.useMemo(()=>({[`__scope${t.scopeName}`]:r}),[r])}};return n.scopeName=t.scopeName,n}var h=globalThis?.document?s.useLayoutEffect:()=>{},g=s.useId||(()=>void 0),_=0;function v(e){let[t,n]=s.useState(g());return h(()=>{e||n(e=>e??String(_++))},[e]),e||(t?`radix-${t}`:``)}var y=s.useInsertionEffect||h;function b({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){let[i,a,o]=x({defaultProp:t,onChange:n}),c=e!==void 0,l=c?e:i;{let t=s.useRef(e!==void 0);s.useEffect(()=>{let e=t.current;e!==c&&console.warn(`${r} is changing from ${e?`controlled`:`uncontrolled`} to ${c?`controlled`:`uncontrolled`}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),t.current=c},[c,r])}return[l,s.useCallback(t=>{if(c){let n=S(t)?t(e):t;n!==e&&o.current?.(n)}else a(t)},[c,e,a,o])]}function x({defaultProp:e,onChange:t}){let[n,r]=s.useState(e),i=s.useRef(n),a=s.useRef(t);return y(()=>{a.current=t},[t]),s.useEffect(()=>{i.current!==n&&(a.current?.(n),i.current=n)},[n,i]),[n,r,a]}function S(e){return typeof e==`function`}function C(e){let t=w(e),n=s.forwardRef((e,n)=>{let{children:r,...i}=e,a=s.Children.toArray(r),o=a.find(D);if(o){let e=o.props.children,r=a.map(t=>t===o?s.Children.count(e)>1?s.Children.only(null):s.isValidElement(e)?e.props.children:null:t);return(0,d.jsx)(t,{...i,ref:n,children:s.isValidElement(e)?s.cloneElement(e,void 0,r):null})}return(0,d.jsx)(t,{...i,ref:n,children:r})});return n.displayName=`${e}.Slot`,n}function w(e){let t=s.forwardRef((e,t)=>{let{children:n,...r}=e;if(s.isValidElement(n)){let e=k(n),i=O(r,n.props);return n.type!==s.Fragment&&(i.ref=t?l(t,e):e),s.cloneElement(n,i)}return s.Children.count(n)>1?s.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var T=Symbol(`radix.slottable`);function E(e){let t=({children:e})=>(0,d.jsx)(d.Fragment,{children:e});return t.displayName=`${e}.Slottable`,t.__radixId=T,t}function D(e){return s.isValidElement(e)&&typeof e.type==`function`&&`__radixId`in e.type&&e.type.__radixId===T}function O(e,t){let n={...t};for(let r in t){let i=e[r],a=t[r];/^on[A-Z]/.test(r)?i&&a?n[r]=(...e)=>{let t=a(...e);return i(...e),t}:i&&(n[r]=i):r===`style`?n[r]={...i,...a}:r===`className`&&(n[r]=[i,a].filter(Boolean).join(` `))}return{...e,...n}}function k(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var A=e(i(),1),j=[`a`,`button`,`div`,`form`,`h2`,`h3`,`img`,`input`,`label`,`li`,`nav`,`ol`,`p`,`select`,`span`,`svg`,`ul`].reduce((e,t)=>{let n=C(`Primitive.${t}`),r=s.forwardRef((e,r)=>{let{asChild:i,...a}=e,o=i?n:t;return typeof window<`u`&&(window[Symbol.for(`radix-ui`)]=!0),(0,d.jsx)(o,{...a,ref:r})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function M(e,t){e&&A.flushSync(()=>e.dispatchEvent(t))}function N(e){let t=s.useRef(e);return s.useEffect(()=>{t.current=e}),s.useMemo(()=>(...e)=>t.current?.(...e),[])}function P(e,t=globalThis?.document){let n=N(e);s.useEffect(()=>{let e=e=>{e.key===`Escape`&&n(e)};return t.addEventListener(`keydown`,e,{capture:!0}),()=>t.removeEventListener(`keydown`,e,{capture:!0})},[n,t])}var F=`DismissableLayer`,ee=`dismissableLayer.update`,te=`dismissableLayer.pointerDownOutside`,ne=`dismissableLayer.focusOutside`,I,L=s.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),re=s.forwardRef((e,t)=>{let{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:i,onFocusOutside:a,onInteractOutside:c,onDismiss:l,...f}=e,p=s.useContext(L),[m,h]=s.useState(null),g=m?.ownerDocument??globalThis?.document,[,_]=s.useState({}),v=u(t,e=>h(e)),y=Array.from(p.layers),[b]=[...p.layersWithOutsidePointerEventsDisabled].slice(-1),x=y.indexOf(b),S=m?y.indexOf(m):-1,C=p.layersWithOutsidePointerEventsDisabled.size>0,w=S>=x,T=oe(e=>{let t=e.target,n=[...p.branches].some(e=>e.contains(t));!w||n||(i?.(e),c?.(e),e.defaultPrevented||l?.())},g),E=se(e=>{let t=e.target;[...p.branches].some(e=>e.contains(t))||(a?.(e),c?.(e),e.defaultPrevented||l?.())},g);return P(e=>{S===p.layers.size-1&&(r?.(e),!e.defaultPrevented&&l&&(e.preventDefault(),l()))},g),s.useEffect(()=>{if(m)return n&&(p.layersWithOutsidePointerEventsDisabled.size===0&&(I=g.body.style.pointerEvents,g.body.style.pointerEvents=`none`),p.layersWithOutsidePointerEventsDisabled.add(m)),p.layers.add(m),ce(),()=>{n&&p.layersWithOutsidePointerEventsDisabled.size===1&&(g.body.style.pointerEvents=I)}},[m,g,n,p]),s.useEffect(()=>()=>{m&&(p.layers.delete(m),p.layersWithOutsidePointerEventsDisabled.delete(m),ce())},[m,p]),s.useEffect(()=>{let e=()=>_({});return document.addEventListener(ee,e),()=>document.removeEventListener(ee,e)},[]),(0,d.jsx)(j.div,{...f,ref:v,style:{pointerEvents:C?w?`auto`:`none`:void 0,...e.style},onFocusCapture:o(e.onFocusCapture,E.onFocusCapture),onBlurCapture:o(e.onBlurCapture,E.onBlurCapture),onPointerDownCapture:o(e.onPointerDownCapture,T.onPointerDownCapture)})});re.displayName=F;var ie=`DismissableLayerBranch`,ae=s.forwardRef((e,t)=>{let n=s.useContext(L),r=s.useRef(null),i=u(t,r);return s.useEffect(()=>{let e=r.current;if(e)return n.branches.add(e),()=>{n.branches.delete(e)}},[n.branches]),(0,d.jsx)(j.div,{...e,ref:i})});ae.displayName=ie;function oe(e,t=globalThis?.document){let n=N(e),r=s.useRef(!1),i=s.useRef(()=>{});return s.useEffect(()=>{let e=e=>{if(e.target&&!r.current){let r=function(){le(te,n,a,{discrete:!0})},a={originalEvent:e};e.pointerType===`touch`?(t.removeEventListener(`click`,i.current),i.current=r,t.addEventListener(`click`,i.current,{once:!0})):r()}else t.removeEventListener(`click`,i.current);r.current=!1},a=window.setTimeout(()=>{t.addEventListener(`pointerdown`,e)},0);return()=>{window.clearTimeout(a),t.removeEventListener(`pointerdown`,e),t.removeEventListener(`click`,i.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function se(e,t=globalThis?.document){let n=N(e),r=s.useRef(!1);return s.useEffect(()=>{let e=e=>{e.target&&!r.current&&le(ne,n,{originalEvent:e},{discrete:!1})};return t.addEventListener(`focusin`,e),()=>t.removeEventListener(`focusin`,e)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function ce(){let e=new CustomEvent(ee);document.dispatchEvent(e)}function le(e,t,n,{discrete:r}){let i=n.originalEvent.target,a=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&i.addEventListener(e,t,{once:!0}),r?M(i,a):i.dispatchEvent(a)}var ue=`focusScope.autoFocusOnMount`,de=`focusScope.autoFocusOnUnmount`,fe={bubbles:!1,cancelable:!0},pe=`FocusScope`,me=s.forwardRef((e,t)=>{let{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:a,...o}=e,[c,l]=s.useState(null),f=N(i),p=N(a),m=s.useRef(null),h=u(t,e=>l(e)),g=s.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;s.useEffect(()=>{if(r){let e=function(e){if(g.paused||!c)return;let t=e.target;c.contains(t)?m.current=t:R(m.current,{select:!0})},t=function(e){if(g.paused||!c)return;let t=e.relatedTarget;t!==null&&(c.contains(t)||R(m.current,{select:!0}))},n=function(e){if(document.activeElement===document.body)for(let t of e)t.removedNodes.length>0&&R(c)};document.addEventListener(`focusin`,e),document.addEventListener(`focusout`,t);let r=new MutationObserver(n);return c&&r.observe(c,{childList:!0,subtree:!0}),()=>{document.removeEventListener(`focusin`,e),document.removeEventListener(`focusout`,t),r.disconnect()}}},[r,c,g.paused]),s.useEffect(()=>{if(c){xe.add(g);let e=document.activeElement;if(!c.contains(e)){let t=new CustomEvent(ue,fe);c.addEventListener(ue,f),c.dispatchEvent(t),t.defaultPrevented||(he(we(_e(c)),{select:!0}),document.activeElement===e&&R(c))}return()=>{c.removeEventListener(ue,f),setTimeout(()=>{let t=new CustomEvent(de,fe);c.addEventListener(de,p),c.dispatchEvent(t),t.defaultPrevented||R(e??document.body,{select:!0}),c.removeEventListener(de,p),xe.remove(g)},0)}}},[c,f,p,g]);let _=s.useCallback(e=>{if(!n&&!r||g.paused)return;let t=e.key===`Tab`&&!e.altKey&&!e.ctrlKey&&!e.metaKey,i=document.activeElement;if(t&&i){let t=e.currentTarget,[r,a]=ge(t);r&&a?!e.shiftKey&&i===a?(e.preventDefault(),n&&R(r,{select:!0})):e.shiftKey&&i===r&&(e.preventDefault(),n&&R(a,{select:!0})):i===t&&e.preventDefault()}},[n,r,g.paused]);return(0,d.jsx)(j.div,{tabIndex:-1,...o,ref:h,onKeyDown:_})});me.displayName=pe;function he(e,{select:t=!1}={}){let n=document.activeElement;for(let r of e)if(R(r,{select:t}),document.activeElement!==n)return}function ge(e){let t=_e(e);return[ve(t,e),ve(t.reverse(),e)]}function _e(e){let t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:e=>{let t=e.tagName===`INPUT`&&e.type===`hidden`;return e.disabled||e.hidden||t?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function ve(e,t){for(let n of e)if(!ye(n,{upTo:t}))return n}function ye(e,{upTo:t}){if(getComputedStyle(e).visibility===`hidden`)return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display===`none`)return!0;e=e.parentElement}return!1}function be(e){return e instanceof HTMLInputElement&&`select`in e}function R(e,{select:t=!1}={}){if(e&&e.focus){let n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&be(e)&&t&&e.select()}}var xe=Se();function Se(){let e=[];return{add(t){let n=e[0];t!==n&&n?.pause(),e=Ce(e,t),e.unshift(t)},remove(t){e=Ce(e,t),e[0]?.resume()}}}function Ce(e,t){let n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function we(e){return e.filter(e=>e.tagName!==`A`)}var Te=`Portal`,Ee=s.forwardRef((e,t)=>{let{container:n,...r}=e,[i,a]=s.useState(!1);h(()=>a(!0),[]);let o=n||i&&globalThis?.document?.body;return o?A.createPortal((0,d.jsx)(j.div,{...r,ref:t}),o):null});Ee.displayName=Te;var De=0;function Oe(){s.useEffect(()=>{let e=document.querySelectorAll(`[data-radix-focus-guard]`);return document.body.insertAdjacentElement(`afterbegin`,e[0]??ke()),document.body.insertAdjacentElement(`beforeend`,e[1]??ke()),De++,()=>{De===1&&document.querySelectorAll(`[data-radix-focus-guard]`).forEach(e=>e.remove()),De--}},[])}function ke(){let e=document.createElement(`span`);return e.setAttribute(`data-radix-focus-guard`,``),e.tabIndex=0,e.style.outline=`none`,e.style.opacity=`0`,e.style.position=`fixed`,e.style.pointerEvents=`none`,e}var z=function(){return z=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n],t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},z.apply(this,arguments)};function Ae(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n}function je(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,a;r<i;r++)(a||!(r in t))&&(a||=Array.prototype.slice.call(t,0,r),a[r]=t[r]);return e.concat(a||Array.prototype.slice.call(t))}var Me=`right-scroll-bar-position`,Ne=`width-before-scroll-bar`,Pe=`with-scroll-bars-hidden`,Fe=`--removed-body-scroll-bar-size`;function Ie(e,t){return typeof e==`function`?e(t):e&&(e.current=t),e}function Le(e,t){var n=(0,s.useState)(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(e){var t=n.value;t!==e&&(n.value=e,n.callback(e,t))}}}})[0];return n.callback=t,n.facade}var Re=typeof window<`u`?s.useLayoutEffect:s.useEffect,ze=new WeakMap;function Be(e,t){var n=Le(t||null,function(t){return e.forEach(function(e){return Ie(e,t)})});return Re(function(){var t=ze.get(n);if(t){var r=new Set(t),i=new Set(e),a=n.current;r.forEach(function(e){i.has(e)||Ie(e,null)}),i.forEach(function(e){r.has(e)||Ie(e,a)})}ze.set(n,e)},[e]),n}function Ve(e){return e}function He(e,t){t===void 0&&(t=Ve);var n=[],r=!1;return{read:function(){if(r)throw Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(e){var i=t(e,r);return n.push(i),function(){n=n.filter(function(e){return e!==i})}},assignSyncMedium:function(e){for(r=!0;n.length;){var t=n;n=[],t.forEach(e)}n={push:function(t){return e(t)},filter:function(){return n}}},assignMedium:function(e){r=!0;var t=[];if(n.length){var i=n;n=[],i.forEach(e),t=n}var a=function(){var n=t;t=[],n.forEach(e)},o=function(){return Promise.resolve().then(a)};o(),n={push:function(e){t.push(e),o()},filter:function(e){return t=t.filter(e),n}}}}}function Ue(e){e===void 0&&(e={});var t=He(null);return t.options=z({async:!0,ssr:!1},e),t}var We=function(e){var t=e.sideCar,n=Ae(e,[`sideCar`]);if(!t)throw Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw Error(`Sidecar medium not found`);return s.createElement(r,z({},n))};We.isSideCarExport=!0;function Ge(e,t){return e.useMedium(t),We}var Ke=Ue(),qe=function(){},Je=s.forwardRef(function(e,t){var n=s.useRef(null),r=s.useState({onScrollCapture:qe,onWheelCapture:qe,onTouchMoveCapture:qe}),i=r[0],a=r[1],o=e.forwardProps,c=e.children,l=e.className,u=e.removeScrollBar,d=e.enabled,f=e.shards,p=e.sideCar,m=e.noRelative,h=e.noIsolation,g=e.inert,_=e.allowPinchZoom,v=e.as,y=v===void 0?`div`:v,b=e.gapMode,x=Ae(e,[`forwardProps`,`children`,`className`,`removeScrollBar`,`enabled`,`shards`,`sideCar`,`noRelative`,`noIsolation`,`inert`,`allowPinchZoom`,`as`,`gapMode`]),S=p,C=Be([n,t]),w=z(z({},x),i);return s.createElement(s.Fragment,null,d&&s.createElement(S,{sideCar:Ke,removeScrollBar:u,shards:f,noRelative:m,noIsolation:h,inert:g,setCallbacks:a,allowPinchZoom:!!_,lockRef:n,gapMode:b}),o?s.cloneElement(s.Children.only(c),z(z({},w),{ref:C})):s.createElement(y,z({},w,{className:l,ref:C}),c))});Je.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},Je.classNames={fullWidth:Ne,zeroRight:Me};var Ye,Xe=function(){if(Ye)return Ye;if(typeof __webpack_nonce__<`u`)return __webpack_nonce__};function Ze(){if(!document)return null;var e=document.createElement(`style`);e.type=`text/css`;var t=Xe();return t&&e.setAttribute(`nonce`,t),e}function Qe(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function $e(e){(document.head||document.getElementsByTagName(`head`)[0]).appendChild(e)}var et=function(){var e=0,t=null;return{add:function(n){e==0&&(t=Ze())&&(Qe(t,n),$e(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},tt=function(){var e=et();return function(t,n){s.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},nt=function(){var e=tt();return function(t){var n=t.styles,r=t.dynamic;return e(n,r),null}},rt={left:0,top:0,right:0,gap:0},it=function(e){return parseInt(e||``,10)||0},at=function(e){var t=window.getComputedStyle(document.body),n=t[e===`padding`?`paddingLeft`:`marginLeft`],r=t[e===`padding`?`paddingTop`:`marginTop`],i=t[e===`padding`?`paddingRight`:`marginRight`];return[it(n),it(r),it(i)]},ot=function(e){if(e===void 0&&(e=`margin`),typeof window>`u`)return rt;var t=at(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},st=nt(),ct=`data-scroll-locked`,lt=function(e,t,n,r){var i=e.left,a=e.top,o=e.right,s=e.gap;return n===void 0&&(n=`margin`),`
|
|
2
|
+
.${Pe} {
|
|
3
|
+
overflow: hidden ${r};
|
|
4
|
+
padding-right: ${s}px ${r};
|
|
5
|
+
}
|
|
6
|
+
body[${ct}] {
|
|
7
|
+
overflow: hidden ${r};
|
|
8
|
+
overscroll-behavior: contain;
|
|
9
|
+
${[t&&`position: relative ${r};`,n===`margin`&&`
|
|
10
|
+
padding-left: ${i}px;
|
|
11
|
+
padding-top: ${a}px;
|
|
12
|
+
padding-right: ${o}px;
|
|
13
|
+
margin-left:0;
|
|
14
|
+
margin-top:0;
|
|
15
|
+
margin-right: ${s}px ${r};
|
|
16
|
+
`,n===`padding`&&`padding-right: ${s}px ${r};`].filter(Boolean).join(``)}
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
.${Me} {
|
|
20
|
+
right: ${s}px ${r};
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
.${Ne} {
|
|
24
|
+
margin-right: ${s}px ${r};
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
.${Me} .${Me} {
|
|
28
|
+
right: 0 ${r};
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
.${Ne} .${Ne} {
|
|
32
|
+
margin-right: 0 ${r};
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
body[${ct}] {
|
|
36
|
+
${Fe}: ${s}px;
|
|
37
|
+
}
|
|
38
|
+
`},ut=function(){var e=parseInt(document.body.getAttribute(`data-scroll-locked`)||`0`,10);return isFinite(e)?e:0},dt=function(){s.useEffect(function(){return document.body.setAttribute(ct,(ut()+1).toString()),function(){var e=ut()-1;e<=0?document.body.removeAttribute(ct):document.body.setAttribute(ct,e.toString())}},[])},ft=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,i=r===void 0?`margin`:r;dt();var a=s.useMemo(function(){return ot(i)},[i]);return s.createElement(st,{styles:lt(a,!t,i,n?``:`!important`)})},pt=!1;if(typeof window<`u`)try{var mt=Object.defineProperty({},`passive`,{get:function(){return pt=!0,!0}});window.addEventListener(`test`,mt,mt),window.removeEventListener(`test`,mt,mt)}catch{pt=!1}var ht=pt?{passive:!1}:!1,gt=function(e){return e.tagName===`TEXTAREA`},_t=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!==`hidden`&&!(n.overflowY===n.overflowX&&!gt(e)&&n[t]===`visible`)},vt=function(e){return _t(e,`overflowY`)},yt=function(e){return _t(e,`overflowX`)},bt=function(e,t){var n=t.ownerDocument,r=t;do{if(typeof ShadowRoot<`u`&&r instanceof ShadowRoot&&(r=r.host),Ct(e,r)){var i=wt(e,r);if(i[1]>i[2])return!0}r=r.parentNode}while(r&&r!==n.body);return!1},xt=function(e){return[e.scrollTop,e.scrollHeight,e.clientHeight]},St=function(e){return[e.scrollLeft,e.scrollWidth,e.clientWidth]},Ct=function(e,t){return e===`v`?vt(t):yt(t)},wt=function(e,t){return e===`v`?xt(t):St(t)},Tt=function(e,t){return e===`h`&&t===`rtl`?-1:1},Et=function(e,t,n,r,i){var a=Tt(e,window.getComputedStyle(t).direction),o=a*r,s=n.target,c=t.contains(s),l=!1,u=o>0,d=0,f=0;do{if(!s)break;var p=wt(e,s),m=p[0],h=p[1]-p[2]-a*m;(m||h)&&Ct(e,s)&&(d+=h,f+=m);var g=s.parentNode;s=g&&g.nodeType===Node.DOCUMENT_FRAGMENT_NODE?g.host:g}while(!c&&s!==document.body||c&&(t.contains(s)||t===s));return(u&&(i&&Math.abs(d)<1||!i&&o>d)||!u&&(i&&Math.abs(f)<1||!i&&-o>f))&&(l=!0),l},Dt=function(e){return`changedTouches`in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},Ot=function(e){return[e.deltaX,e.deltaY]},kt=function(e){return e&&`current`in e?e.current:e},At=function(e,t){return e[0]===t[0]&&e[1]===t[1]},jt=function(e){return`
|
|
39
|
+
.block-interactivity-${e} {pointer-events: none;}
|
|
40
|
+
.allow-interactivity-${e} {pointer-events: all;}
|
|
41
|
+
`},Mt=0,Nt=[];function Pt(e){var t=s.useRef([]),n=s.useRef([0,0]),r=s.useRef(),i=s.useState(Mt++)[0],a=s.useState(nt)[0],o=s.useRef(e);s.useEffect(function(){o.current=e},[e]),s.useEffect(function(){if(e.inert){document.body.classList.add(`block-interactivity-${i}`);var t=je([e.lockRef.current],(e.shards||[]).map(kt),!0).filter(Boolean);return t.forEach(function(e){return e.classList.add(`allow-interactivity-${i}`)}),function(){document.body.classList.remove(`block-interactivity-${i}`),t.forEach(function(e){return e.classList.remove(`allow-interactivity-${i}`)})}}},[e.inert,e.lockRef.current,e.shards]);var c=s.useCallback(function(e,t){if(`touches`in e&&e.touches.length===2||e.type===`wheel`&&e.ctrlKey)return!o.current.allowPinchZoom;var i=Dt(e),a=n.current,s=`deltaX`in e?e.deltaX:a[0]-i[0],c=`deltaY`in e?e.deltaY:a[1]-i[1],l,u=e.target,d=Math.abs(s)>Math.abs(c)?`h`:`v`;if(`touches`in e&&d===`h`&&u.type===`range`)return!1;var f=window.getSelection(),p=f&&f.anchorNode;if(p&&(p===u||p.contains(u)))return!1;var m=bt(d,u);if(!m)return!0;if(m?l=d:(l=d===`v`?`h`:`v`,m=bt(d,u)),!m)return!1;if(!r.current&&`changedTouches`in e&&(s||c)&&(r.current=l),!l)return!0;var h=r.current||l;return Et(h,t,e,h===`h`?s:c,!0)},[]),l=s.useCallback(function(e){var n=e;if(!(!Nt.length||Nt[Nt.length-1]!==a)){var r=`deltaY`in n?Ot(n):Dt(n),i=t.current.filter(function(e){return e.name===n.type&&(e.target===n.target||n.target===e.shadowParent)&&At(e.delta,r)})[0];if(i&&i.should){n.cancelable&&n.preventDefault();return}if(!i){var s=(o.current.shards||[]).map(kt).filter(Boolean).filter(function(e){return e.contains(n.target)});(s.length>0?c(n,s[0]):!o.current.noIsolation)&&n.cancelable&&n.preventDefault()}}},[]),u=s.useCallback(function(e,n,r,i){var a={name:e,delta:n,target:r,should:i,shadowParent:Ft(r)};t.current.push(a),setTimeout(function(){t.current=t.current.filter(function(e){return e!==a})},1)},[]),d=s.useCallback(function(e){n.current=Dt(e),r.current=void 0},[]),f=s.useCallback(function(t){u(t.type,Ot(t),t.target,c(t,e.lockRef.current))},[]),p=s.useCallback(function(t){u(t.type,Dt(t),t.target,c(t,e.lockRef.current))},[]);s.useEffect(function(){return Nt.push(a),e.setCallbacks({onScrollCapture:f,onWheelCapture:f,onTouchMoveCapture:p}),document.addEventListener(`wheel`,l,ht),document.addEventListener(`touchmove`,l,ht),document.addEventListener(`touchstart`,d,ht),function(){Nt=Nt.filter(function(e){return e!==a}),document.removeEventListener(`wheel`,l,ht),document.removeEventListener(`touchmove`,l,ht),document.removeEventListener(`touchstart`,d,ht)}},[]);var m=e.removeScrollBar,h=e.inert;return s.createElement(s.Fragment,null,h?s.createElement(a,{styles:jt(i)}):null,m?s.createElement(ft,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function Ft(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}var It=Ge(Ke,Pt),Lt=s.forwardRef(function(e,t){return s.createElement(Je,z({},e,{ref:t,sideCar:It}))});Lt.classNames=Je.classNames;var Rt=function(e){return typeof document>`u`?null:(Array.isArray(e)?e[0]:e).ownerDocument.body},zt=new WeakMap,Bt=new WeakMap,Vt={},Ht=0,Ut=function(e){return e&&(e.host||Ut(e.parentNode))},Wt=function(e,t){return t.map(function(t){if(e.contains(t))return t;var n=Ut(t);return n&&e.contains(n)?n:(console.error(`aria-hidden`,t,`in not contained inside`,e,`. Doing nothing`),null)}).filter(function(e){return!!e})},Gt=function(e,t,n,r){var i=Wt(t,Array.isArray(e)?e:[e]);Vt[n]||(Vt[n]=new WeakMap);var a=Vt[n],o=[],s=new Set,c=new Set(i),l=function(e){!e||s.has(e)||(s.add(e),l(e.parentNode))};i.forEach(l);var u=function(e){!e||c.has(e)||Array.prototype.forEach.call(e.children,function(e){if(s.has(e))u(e);else try{var t=e.getAttribute(r),i=t!==null&&t!==`false`,c=(zt.get(e)||0)+1,l=(a.get(e)||0)+1;zt.set(e,c),a.set(e,l),o.push(e),c===1&&i&&Bt.set(e,!0),l===1&&e.setAttribute(n,`true`),i||e.setAttribute(r,`true`)}catch(t){console.error(`aria-hidden: cannot operate on `,e,t)}})};return u(t),s.clear(),Ht++,function(){o.forEach(function(e){var t=zt.get(e)-1,i=a.get(e)-1;zt.set(e,t),a.set(e,i),t||(Bt.has(e)||e.removeAttribute(r),Bt.delete(e)),i||e.removeAttribute(n)}),Ht--,Ht||(zt=new WeakMap,zt=new WeakMap,Bt=new WeakMap,Vt={})}},Kt=function(e,t,n){n===void 0&&(n=`data-aria-hidden`);var r=Array.from(Array.isArray(e)?e:[e]),i=t||Rt(e);return i?(r.push.apply(r,Array.from(i.querySelectorAll(`[aria-live], script`))),Gt(r,i,n,`aria-hidden`)):function(){return null}},qt=a(`Check`,[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]]),Jt=a(`ChevronDown`,[[`path`,{d:`m6 9 6 6 6-6`,key:`qrunsl`}]]),Yt=a(`ChevronUp`,[[`path`,{d:`m18 15-6-6-6 6`,key:`153udz`}]]);function Xt(e,[t,n]){return Math.min(n,Math.max(t,e))}function Zt(e){let t=e+`CollectionProvider`,[n,r]=p(t),[i,a]=n(t,{collectionRef:{current:null},itemMap:new Map}),o=e=>{let{scope:t,children:n}=e,r=s.useRef(null),a=s.useRef(new Map).current;return(0,d.jsx)(i,{scope:t,itemMap:a,collectionRef:r,children:n})};o.displayName=t;let c=e+`CollectionSlot`,l=C(c),f=s.forwardRef((e,t)=>{let{scope:n,children:r}=e;return(0,d.jsx)(l,{ref:u(t,a(c,n).collectionRef),children:r})});f.displayName=c;let m=e+`CollectionItemSlot`,h=`data-radix-collection-item`,g=C(m),_=s.forwardRef((e,t)=>{let{scope:n,children:r,...i}=e,o=s.useRef(null),c=u(t,o),l=a(m,n);return s.useEffect(()=>(l.itemMap.set(o,{ref:o,...i}),()=>void l.itemMap.delete(o))),(0,d.jsx)(g,{[h]:``,ref:c,children:r})});_.displayName=m;function v(t){let n=a(e+`CollectionConsumer`,t);return s.useCallback(()=>{let e=n.collectionRef.current;if(!e)return[];let t=Array.from(e.querySelectorAll(`[${h}]`));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:f,ItemSlot:_},v,r]}var Qt=s.createContext(void 0);function $t(e){let t=s.useContext(Qt);return e||t||`ltr`}var en=[`top`,`right`,`bottom`,`left`],B=Math.min,V=Math.max,tn=Math.round,nn=Math.floor,H=e=>({x:e,y:e}),rn={left:`right`,right:`left`,bottom:`top`,top:`bottom`},an={start:`end`,end:`start`};function on(e,t,n){return V(e,B(t,n))}function U(e,t){return typeof e==`function`?e(t):e}function W(e){return e.split(`-`)[0]}function sn(e){return e.split(`-`)[1]}function cn(e){return e===`x`?`y`:`x`}function ln(e){return e===`y`?`height`:`width`}var un=new Set([`top`,`bottom`]);function G(e){return un.has(W(e))?`y`:`x`}function dn(e){return cn(G(e))}function fn(e,t,n){n===void 0&&(n=!1);let r=sn(e),i=dn(e),a=ln(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=xn(o)),[o,xn(o)]}function pn(e){let t=xn(e);return[mn(e),t,mn(t)]}function mn(e){return e.replace(/start|end/g,e=>an[e])}var hn=[`left`,`right`],gn=[`right`,`left`],_n=[`top`,`bottom`],vn=[`bottom`,`top`];function yn(e,t,n){switch(e){case`top`:case`bottom`:return n?t?gn:hn:t?hn:gn;case`left`:case`right`:return t?_n:vn;default:return[]}}function bn(e,t,n,r){let i=sn(e),a=yn(W(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(mn)))),a}function xn(e){return e.replace(/left|right|bottom|top/g,e=>rn[e])}function Sn(e){return{top:0,right:0,bottom:0,left:0,...e}}function Cn(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:Sn(e)}function wn(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 Tn(e,t,n){let{reference:r,floating:i}=e,a=G(t),o=dn(t),s=ln(o),c=W(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(sn(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 En(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}=U(t,e),p=Cn(f),m=o[d?u===`floating`?`reference`:`floating`:u],h=wn(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=wn(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 Dn=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}=Tn(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??En},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}=Tn(l,f,c)),n=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:p}},On=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}=U(e,t)||{};if(l==null)return{};let d=Cn(u),f={x:n,y:r},p=dn(i),m=ln(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,T=C/2-h[m]/2-1,E=B(d[_],T),D=B(d[v],T),O=E,k=C-h[m]-D,A=C/2-h[m]/2+w,j=on(O,A,k),M=!c.arrow&&sn(i)!=null&&A!==j&&a.reference[m]/2-(A<O?E:D)-h[m]/2<0,N=M?A<O?A-O:A-k:0;return{[p]:f[p]+N,data:{[p]:j,centerOffset:A-j-N,...M&&{alignmentOffset:N}},reset:M}}}),kn=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}=U(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};let g=W(r),_=G(o),v=W(o)===o,y=await(s.isRTL==null?void 0:s.isRTL(c.floating)),b=d||(v||!m?[xn(o)]:pn(o)),x=p!==`none`;!d&&x&&b.push(...bn(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=fn(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`&&_!==G(t))||T.every(e=>G(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=G(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 An(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function jn(e){return en.some(t=>e[t]>=0)}var Mn=function(e){return e===void 0&&(e={}),{name:`hide`,options:e,async fn(t){let{rects:n,platform:r}=t,{strategy:i=`referenceHidden`,...a}=U(e,t);switch(i){case`referenceHidden`:{let e=An(await r.detectOverflow(t,{...a,elementContext:`reference`}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:jn(e)}}}case`escaped`:{let e=An(await r.detectOverflow(t,{...a,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:jn(e)}}}default:return{}}}}},Nn=new Set([`left`,`top`]);async function Pn(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=W(n),s=sn(n),c=G(n)===`y`,l=Nn.has(o)?-1:1,u=a&&c?-1:1,d=U(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 Fn=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 Pn(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}}}}},In=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}=U(e,t),u={x:n,y:r},d=await a.detectOverflow(t,l),f=G(W(i)),p=cn(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=on(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=on(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}}}}}},Ln=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}=U(e,t),u={x:n,y:r},d=G(i),f=cn(d),p=u[f],m=u[d],h=U(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=Nn.has(W(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}}}},Rn=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}=U(e,t),u=await o.detectOverflow(t,l),d=W(i),f=sn(i),p=G(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=B(h-u[g],v),x=B(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=V(u.left,0),t=V(u.right,0),n=V(u.top,0),r=V(u.bottom,0);p?w=m-2*(e!==0||t!==0?e+t:V(u.left,u.right)):C=h-2*(n!==0||r!==0?n+r:V(u.top,u.bottom))}await c({...t,availableWidth:w,availableHeight:C});let T=await o.getDimensions(s.floating);return m!==T.width||h!==T.height?{reset:{rects:!0}}:{}}}};function zn(){return typeof window<`u`}function Bn(e){return Vn(e)?(e.nodeName||``).toLowerCase():`#document`}function K(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function q(e){return((Vn(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function Vn(e){return zn()?e instanceof Node||e instanceof K(e).Node:!1}function J(e){return zn()?e instanceof Element||e instanceof K(e).Element:!1}function Y(e){return zn()?e instanceof HTMLElement||e instanceof K(e).HTMLElement:!1}function Hn(e){return!zn()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof K(e).ShadowRoot}var Un=new Set([`inline`,`contents`]);function Wn(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=X(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!Un.has(i)}var Gn=new Set([`table`,`td`,`th`]);function Kn(e){return Gn.has(Bn(e))}var qn=[`:popover-open`,`:modal`];function Jn(e){return qn.some(t=>{try{return e.matches(t)}catch{return!1}})}var Yn=[`transform`,`translate`,`scale`,`rotate`,`perspective`],Xn=[`transform`,`translate`,`scale`,`rotate`,`perspective`,`filter`],Zn=[`paint`,`layout`,`strict`,`content`];function Qn(e){let t=er(),n=J(e)?X(e):e;return Yn.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)||Xn.some(e=>(n.willChange||``).includes(e))||Zn.some(e=>(n.contain||``).includes(e))}function $n(e){let t=Z(e);for(;Y(t)&&!nr(t);){if(Qn(t))return t;if(Jn(t))return null;t=Z(t)}return null}function er(){return typeof CSS>`u`||!CSS.supports?!1:CSS.supports(`-webkit-backdrop-filter`,`none`)}var tr=new Set([`html`,`body`,`#document`]);function nr(e){return tr.has(Bn(e))}function X(e){return K(e).getComputedStyle(e)}function rr(e){return J(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Z(e){if(Bn(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||Hn(e)&&e.host||q(e);return Hn(t)?t.host:t}function ir(e){let t=Z(e);return nr(t)?e.ownerDocument?e.ownerDocument.body:e.body:Y(t)&&Wn(t)?t:ir(t)}function ar(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=ir(e),i=r===e.ownerDocument?.body,a=K(r);if(i){let e=or(a);return t.concat(a,a.visualViewport||[],Wn(r)?r:[],e&&n?ar(e):[])}return t.concat(r,ar(r,[],n))}function or(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function sr(e){let t=X(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=Y(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=tn(n)!==a||tn(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function cr(e){return J(e)?e:e.contextElement}function lr(e){let t=cr(e);if(!Y(t))return H(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=sr(t),o=(a?tn(n.width):n.width)/r,s=(a?tn(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}var ur=H(0);function dr(e){let t=K(e);return!er()||!t.visualViewport?ur:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function fr(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==K(e)?!1:t}function pr(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=cr(e),o=H(1);t&&(r?J(r)&&(o=lr(r)):o=lr(e));let s=fr(a,n,r)?dr(a):H(0),c=(i.left+s.x)/o.x,l=(i.top+s.y)/o.y,u=i.width/o.x,d=i.height/o.y;if(a){let e=K(a),t=r&&J(r)?K(r):r,n=e,i=or(n);for(;i&&r&&t!==n;){let e=lr(i),t=i.getBoundingClientRect(),r=X(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=K(i),i=or(n)}}return wn({width:u,height:d,x:c,y:l})}function mr(e,t){let n=rr(e).scrollLeft;return t?t.left+n:pr(q(e)).left+n}function hr(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-mr(e,n),y:n.top+t.scrollTop}}function gr(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=q(r),s=t?Jn(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=H(1),u=H(0),d=Y(r);if((d||!d&&!a)&&((Bn(r)!==`body`||Wn(o))&&(c=rr(r)),Y(r))){let e=pr(r);l=lr(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=o&&!d&&!a?hr(o,c):H(0);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-c.scrollLeft*l.x+u.x+f.x,y:n.y*l.y-c.scrollTop*l.y+u.y+f.y}}function _r(e){return Array.from(e.getClientRects())}function vr(e){let t=q(e),n=rr(e),r=e.ownerDocument.body,i=V(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),a=V(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight),o=-n.scrollLeft+mr(e),s=-n.scrollTop;return X(r).direction===`rtl`&&(o+=V(t.clientWidth,r.clientWidth)-i),{width:i,height:a,x:o,y:s}}var yr=25;function br(e,t){let n=K(e),r=q(e),i=n.visualViewport,a=r.clientWidth,o=r.clientHeight,s=0,c=0;if(i){a=i.width,o=i.height;let e=er();(!e||e&&t===`fixed`)&&(s=i.offsetLeft,c=i.offsetTop)}let l=mr(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<=yr&&(a-=o)}else l<=yr&&(a+=l);return{width:a,height:o,x:s,y:c}}var xr=new Set([`absolute`,`fixed`]);function Sr(e,t){let n=pr(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=Y(e)?lr(e):H(1);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function Cr(e,t,n){let r;if(t===`viewport`)r=br(e,n);else if(t===`document`)r=vr(q(e));else if(J(t))r=Sr(t,n);else{let n=dr(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return wn(r)}function wr(e,t){let n=Z(e);return n===t||!J(n)||nr(n)?!1:X(n).position===`fixed`||wr(n,t)}function Tr(e,t){let n=t.get(e);if(n)return n;let r=ar(e,[],!1).filter(e=>J(e)&&Bn(e)!==`body`),i=null,a=X(e).position===`fixed`,o=a?Z(e):e;for(;J(o)&&!nr(o);){let t=X(o),n=Qn(o);!n&&t.position===`fixed`&&(i=null),(a?!n&&!i:!n&&t.position===`static`&&i&&xr.has(i.position)||Wn(o)&&!n&&wr(e,o))?r=r.filter(e=>e!==o):i=t,o=Z(o)}return t.set(e,r),r}function Er(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?Jn(t)?[]:Tr(t,this._c):[].concat(n),r],o=a[0],s=a.reduce((e,n)=>{let r=Cr(t,n,i);return e.top=V(r.top,e.top),e.right=B(r.right,e.right),e.bottom=B(r.bottom,e.bottom),e.left=V(r.left,e.left),e},Cr(t,o,i));return{width:s.right-s.left,height:s.bottom-s.top,x:s.left,y:s.top}}function Dr(e){let{width:t,height:n}=sr(e);return{width:t,height:n}}function Or(e,t,n){let r=Y(t),i=q(t),a=n===`fixed`,o=pr(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=H(0);function l(){c.x=mr(i)}if(r||!r&&!a)if((Bn(t)!==`body`||Wn(i))&&(s=rr(t)),r){let e=pr(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?hr(i,s):H(0);return{x:o.left+s.scrollLeft-c.x-u.x,y:o.top+s.scrollTop-c.y-u.y,width:o.width,height:o.height}}function kr(e){return X(e).position===`static`}function Ar(e,t){if(!Y(e)||X(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return q(e)===n&&(n=n.ownerDocument.body),n}function jr(e,t){let n=K(e);if(Jn(e))return n;if(!Y(e)){let t=Z(e);for(;t&&!nr(t);){if(J(t)&&!kr(t))return t;t=Z(t)}return n}let r=Ar(e,t);for(;r&&Kn(r)&&kr(r);)r=Ar(r,t);return r&&nr(r)&&kr(r)&&!Qn(r)?n:r||$n(e)||n}var Mr=async function(e){let t=this.getOffsetParent||jr,n=this.getDimensions,r=await n(e.floating);return{reference:Or(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function Nr(e){return X(e).direction===`rtl`}var Pr={convertOffsetParentRelativeRectToViewportRelativeRect:gr,getDocumentElement:q,getClippingRect:Er,getOffsetParent:jr,getElementRects:Mr,getClientRects:_r,getDimensions:Dr,getScale:lr,isElement:J,isRTL:Nr};function Fr(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Ir(e,t){let n=null,r,i=q(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=nn(d),h=nn(i.clientWidth-(u+f)),g=nn(i.clientHeight-(d+p)),_=nn(u),v={rootMargin:-m+`px `+-h+`px `+-g+`px `+-_+`px`,threshold:V(0,B(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&&!Fr(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 Lr(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=cr(e),u=i||a?[...l?ar(l):[],...ar(t)]:[];u.forEach(e=>{i&&e.addEventListener(`scroll`,n,{passive:!0}),a&&e.addEventListener(`resize`,n)});let d=l&&s?Ir(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?pr(e):null;c&&g();function g(){let t=pr(e);h&&!Fr(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 Rr=Fn,zr=In,Br=kn,Vr=Rn,Hr=Mn,Ur=On,Wr=Ln,Gr=(e,t,n)=>{let r=new Map,i={platform:Pr,...n},a={...i.platform,_c:r};return Dn(e,t,{...i,platform:a})},Kr=typeof document<`u`?s.useLayoutEffect:function(){};function qr(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(!qr(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)&&!qr(e[n],t[n]))return!1}return!0}return e!==e&&t!==t}function Jr(e){return typeof window>`u`?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Yr(e,t){let n=Jr(e);return Math.round(t*n)/n}function Xr(e){let t=s.useRef(e);return Kr(()=>{t.current=e}),t}function Zr(e){e===void 0&&(e={});let{placement:t=`bottom`,strategy:n=`absolute`,middleware:r=[],platform:i,elements:{reference:a,floating:o}={},transform:c=!0,whileElementsMounted:l,open:u}=e,[d,f]=s.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[p,m]=s.useState(r);qr(p,r)||m(r);let[h,g]=s.useState(null),[_,v]=s.useState(null),y=s.useCallback(e=>{e!==C.current&&(C.current=e,g(e))},[]),b=s.useCallback(e=>{e!==w.current&&(w.current=e,v(e))},[]),x=a||h,S=o||_,C=s.useRef(null),w=s.useRef(null),T=s.useRef(d),E=l!=null,D=Xr(l),O=Xr(i),k=Xr(u),j=s.useCallback(()=>{if(!C.current||!w.current)return;let e={placement:t,strategy:n,middleware:p};O.current&&(e.platform=O.current),Gr(C.current,w.current,e).then(e=>{let t={...e,isPositioned:k.current!==!1};M.current&&!qr(T.current,t)&&(T.current=t,A.flushSync(()=>{f(t)}))})},[p,t,n,O,k]);Kr(()=>{u===!1&&T.current.isPositioned&&(T.current.isPositioned=!1,f(e=>({...e,isPositioned:!1})))},[u]);let M=s.useRef(!1);Kr(()=>(M.current=!0,()=>{M.current=!1}),[]),Kr(()=>{if(x&&(C.current=x),S&&(w.current=S),x&&S){if(D.current)return D.current(x,S,j);j()}},[x,S,j,D,E]);let N=s.useMemo(()=>({reference:C,floating:w,setReference:y,setFloating:b}),[y,b]),P=s.useMemo(()=>({reference:x,floating:S}),[x,S]),F=s.useMemo(()=>{let e={position:n,left:0,top:0};if(!P.floating)return e;let t=Yr(P.floating,d.x),r=Yr(P.floating,d.y);return c?{...e,transform:`translate(`+t+`px, `+r+`px)`,...Jr(P.floating)>=1.5&&{willChange:`transform`}}:{position:n,left:t,top:r}},[n,c,P.floating,d.x,d.y]);return s.useMemo(()=>({...d,update:j,refs:N,elements:P,floatingStyles:F}),[d,j,N,P,F])}var Qr=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?{}:Ur({element:r.current,padding:i}).fn(n):r?Ur({element:r,padding:i}).fn(n):{}}}},$r=(e,t)=>({...Rr(e),options:[e,t]}),ei=(e,t)=>({...zr(e),options:[e,t]}),ti=(e,t)=>({...Wr(e),options:[e,t]}),ni=(e,t)=>({...Br(e),options:[e,t]}),ri=(e,t)=>({...Vr(e),options:[e,t]}),ii=(e,t)=>({...Hr(e),options:[e,t]}),ai=(e,t)=>({...Qr(e),options:[e,t]}),oi=`Arrow`,si=s.forwardRef((e,t)=>{let{children:n,width:r=10,height:i=5,...a}=e;return(0,d.jsx)(j.svg,{...a,ref:t,width:r,height:i,viewBox:`0 0 30 10`,preserveAspectRatio:`none`,children:e.asChild?n:(0,d.jsx)(`polygon`,{points:`0,0 30,0 15,10`})})});si.displayName=oi;var ci=si;function li(e){let[t,n]=s.useState(void 0);return h(()=>{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 ui=`Popper`,[di,fi]=p(ui),[pi,mi]=di(ui),hi=e=>{let{__scopePopper:t,children:n}=e,[r,i]=s.useState(null);return(0,d.jsx)(pi,{scope:t,anchor:r,onAnchorChange:i,children:n})};hi.displayName=ui;var gi=`PopperAnchor`,_i=s.forwardRef((e,t)=>{let{__scopePopper:n,virtualRef:r,...i}=e,a=mi(gi,n),o=s.useRef(null),c=u(t,o),l=s.useRef(null);return s.useEffect(()=>{let e=l.current;l.current=r?.current||o.current,e!==l.current&&a.onAnchorChange(l.current)}),r?null:(0,d.jsx)(j.div,{...i,ref:c})});_i.displayName=gi;var vi=`PopperContent`,[yi,bi]=di(vi),xi=s.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:f=[],collisionPadding:p=0,sticky:m=`partial`,hideWhenDetached:g=!1,updatePositionStrategy:_=`optimized`,onPlaced:v,...y}=e,b=mi(vi,n),[x,S]=s.useState(null),C=u(t,e=>S(e)),[w,T]=s.useState(null),E=li(w),D=E?.width??0,O=E?.height??0,k=r+(a===`center`?``:`-`+a),A=typeof p==`number`?p:{top:0,right:0,bottom:0,left:0,...p},M=Array.isArray(f)?f:[f],P=M.length>0,F={padding:A,boundary:M.filter(Ti),altBoundary:P},{refs:ee,floatingStyles:te,placement:ne,isPositioned:I,middlewareData:L}=Zr({strategy:`fixed`,placement:k,whileElementsMounted:(...e)=>Lr(...e,{animationFrame:_===`always`}),elements:{reference:b.anchor},middleware:[$r({mainAxis:i+O,alignmentAxis:o}),l&&ei({mainAxis:!0,crossAxis:!1,limiter:m===`partial`?ti():void 0,...F}),l&&ni({...F}),ri({...F,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&&ai({element:w,padding:c}),Ei({arrowWidth:D,arrowHeight:O}),g&&ii({strategy:`referenceHidden`,...F})]}),[re,ie]=Di(ne),ae=N(v);h(()=>{I&&ae?.()},[I,ae]);let oe=L.arrow?.x,se=L.arrow?.y,ce=L.arrow?.centerOffset!==0,[le,ue]=s.useState();return h(()=>{x&&ue(window.getComputedStyle(x).zIndex)},[x]),(0,d.jsx)(`div`,{ref:ee.setFloating,"data-radix-popper-content-wrapper":``,style:{...te,transform:I?te.transform:`translate(0, -200%)`,minWidth:`max-content`,zIndex:le,"--radix-popper-transform-origin":[L.transformOrigin?.x,L.transformOrigin?.y].join(` `),...L.hide?.referenceHidden&&{visibility:`hidden`,pointerEvents:`none`}},dir:e.dir,children:(0,d.jsx)(yi,{scope:n,placedSide:re,onArrowChange:T,arrowX:oe,arrowY:se,shouldHideArrow:ce,children:(0,d.jsx)(j.div,{"data-side":re,"data-align":ie,...y,ref:C,style:{...y.style,animation:I?void 0:`none`}})})})});xi.displayName=vi;var Si=`PopperArrow`,Ci={top:`bottom`,right:`left`,bottom:`top`,left:`right`},wi=s.forwardRef(function(e,t){let{__scopePopper:n,...r}=e,i=bi(Si,n),a=Ci[i.placedSide];return(0,d.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,d.jsx)(ci,{...r,ref:t,style:{...r.style,display:`block`}})})});wi.displayName=Si;function Ti(e){return e!==null}var Ei=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]=Di(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 Di(e){let[t,n=`center`]=e.split(`-`);return[t,n]}var Oi=hi,ki=_i,Ai=xi,ji=wi;function Mi(e){let t=s.useRef({value:e,previous:e});return s.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var Ni=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`}),Pi=`VisuallyHidden`,Fi=s.forwardRef((e,t)=>(0,d.jsx)(j.span,{...e,ref:t,style:{...Ni,...e.style}}));Fi.displayName=Pi;var Ii=Fi,Li=[` `,`Enter`,`ArrowUp`,`ArrowDown`],Ri=[` `,`Enter`],zi=`Select`,[Bi,Vi,Hi]=Zt(zi),[Ui,Wi]=p(zi,[Hi,fi]),Gi=fi(),[Ki,Q]=Ui(zi),[qi,Ji]=Ui(zi),Yi=e=>{let{__scopeSelect:t,children:n,open:r,defaultOpen:i,onOpenChange:a,value:o,defaultValue:c,onValueChange:l,dir:u,name:f,autoComplete:p,disabled:m,required:h,form:g}=e,_=Gi(t),[y,x]=s.useState(null),[S,C]=s.useState(null),[w,T]=s.useState(!1),E=$t(u),[D,O]=b({prop:r,defaultProp:i??!1,onChange:a,caller:zi}),[k,A]=b({prop:o,defaultProp:c,onChange:l,caller:zi}),j=s.useRef(null),M=y?g||!!y.closest(`form`):!0,[N,P]=s.useState(new Set),F=Array.from(N).map(e=>e.props.value).join(`;`);return(0,d.jsx)(Oi,{..._,children:(0,d.jsxs)(Ki,{required:h,scope:t,trigger:y,onTriggerChange:x,valueNode:S,onValueNodeChange:C,valueNodeHasChildren:w,onValueNodeHasChildrenChange:T,contentId:v(),value:k,onValueChange:A,open:D,onOpenChange:O,dir:E,triggerPointerDownPosRef:j,disabled:m,children:[(0,d.jsx)(Bi.Provider,{scope:t,children:(0,d.jsx)(qi,{scope:e.__scopeSelect,onNativeOptionAdd:s.useCallback(e=>{P(t=>new Set(t).add(e))},[]),onNativeOptionRemove:s.useCallback(e=>{P(t=>{let n=new Set(t);return n.delete(e),n})},[]),children:n})}),M?(0,d.jsxs)(Ua,{"aria-hidden":!0,required:h,tabIndex:-1,name:f,autoComplete:p,value:k,onChange:e=>A(e.target.value),disabled:m,form:g,children:[k===void 0?(0,d.jsx)(`option`,{value:``}):null,Array.from(N)]},F):null]})})};Yi.displayName=zi;var Xi=`SelectTrigger`,Zi=s.forwardRef((e,t)=>{let{__scopeSelect:n,disabled:r=!1,...i}=e,a=Gi(n),c=Q(Xi,n),l=c.disabled||r,f=u(t,c.onTriggerChange),p=Vi(n),m=s.useRef(`touch`),[h,g,_]=Ga(e=>{let t=p().filter(e=>!e.disabled),n=Ka(t,e,t.find(e=>e.value===c.value));n!==void 0&&c.onValueChange(n.value)}),v=e=>{l||(c.onOpenChange(!0),_()),e&&(c.triggerPointerDownPosRef.current={x:Math.round(e.pageX),y:Math.round(e.pageY)})};return(0,d.jsx)(ki,{asChild:!0,...a,children:(0,d.jsx)(j.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":Wa(c.value)?``:void 0,...i,ref:f,onClick:o(i.onClick,e=>{e.currentTarget.focus(),m.current!==`mouse`&&v(e)}),onPointerDown:o(i.onPointerDown,e=>{m.current=e.pointerType;let t=e.target;t.hasPointerCapture(e.pointerId)&&t.releasePointerCapture(e.pointerId),e.button===0&&e.ctrlKey===!1&&e.pointerType===`mouse`&&(v(e),e.preventDefault())}),onKeyDown:o(i.onKeyDown,e=>{let t=h.current!==``;!(e.ctrlKey||e.altKey||e.metaKey)&&e.key.length===1&&g(e.key),!(t&&e.key===` `)&&Li.includes(e.key)&&(v(),e.preventDefault())})})})});Zi.displayName=Xi;var Qi=`SelectValue`,$i=s.forwardRef((e,t)=>{let{__scopeSelect:n,className:r,style:i,children:a,placeholder:o=``,...s}=e,c=Q(Qi,n),{onValueNodeHasChildrenChange:l}=c,f=a!==void 0,p=u(t,c.onValueNodeChange);return h(()=>{l(f)},[l,f]),(0,d.jsx)(j.span,{...s,ref:p,style:{pointerEvents:`none`},children:Wa(c.value)?(0,d.jsx)(d.Fragment,{children:o}):a})});$i.displayName=Qi;var ea=`SelectIcon`,ta=s.forwardRef((e,t)=>{let{__scopeSelect:n,children:r,...i}=e;return(0,d.jsx)(j.span,{"aria-hidden":!0,...i,ref:t,children:r||`▼`})});ta.displayName=ea;var na=`SelectPortal`,ra=e=>(0,d.jsx)(Ee,{asChild:!0,...e});ra.displayName=na;var ia=`SelectContent`,aa=s.forwardRef((e,t)=>{let n=Q(ia,e.__scopeSelect),[r,i]=s.useState();if(h(()=>{i(new DocumentFragment)},[]),!n.open){let t=r;return t?A.createPortal((0,d.jsx)(oa,{scope:e.__scopeSelect,children:(0,d.jsx)(Bi.Slot,{scope:e.__scopeSelect,children:(0,d.jsx)(`div`,{children:e.children})})}),t):null}return(0,d.jsx)(ua,{...e,ref:t})});aa.displayName=ia;var $=10,[oa,sa]=Ui(ia),ca=`SelectContentImpl`,la=C(`SelectContent.RemoveScroll`),ua=s.forwardRef((e,t)=>{let{__scopeSelect:n,position:r=`item-aligned`,onCloseAutoFocus:i,onEscapeKeyDown:a,onPointerDownOutside:c,side:l,sideOffset:f,align:p,alignOffset:m,arrowPadding:h,collisionBoundary:g,collisionPadding:_,sticky:v,hideWhenDetached:y,avoidCollisions:b,...x}=e,S=Q(ia,n),[C,w]=s.useState(null),[T,E]=s.useState(null),D=u(t,e=>w(e)),[O,k]=s.useState(null),[A,j]=s.useState(null),M=Vi(n),[N,P]=s.useState(!1),F=s.useRef(!1);s.useEffect(()=>{if(C)return Kt(C)},[C]),Oe();let ee=s.useCallback(e=>{let[t,...n]=M().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&&T&&(T.scrollTop=0),n===r&&T&&(T.scrollTop=T.scrollHeight),n?.focus(),document.activeElement!==i))return},[M,T]),te=s.useCallback(()=>ee([O,C]),[ee,O,C]);s.useEffect(()=>{N&&te()},[N,te]);let{onOpenChange:ne,triggerPointerDownPosRef:I}=S;s.useEffect(()=>{if(C){let e={x:0,y:0},t=t=>{e={x:Math.abs(Math.round(t.pageX)-(I.current?.x??0)),y:Math.abs(Math.round(t.pageY)-(I.current?.y??0))}},n=n=>{e.x<=10&&e.y<=10?n.preventDefault():C.contains(n.target)||ne(!1),document.removeEventListener(`pointermove`,t),I.current=null};return I.current!==null&&(document.addEventListener(`pointermove`,t),document.addEventListener(`pointerup`,n,{capture:!0,once:!0})),()=>{document.removeEventListener(`pointermove`,t),document.removeEventListener(`pointerup`,n,{capture:!0})}}},[C,ne,I]),s.useEffect(()=>{let e=()=>ne(!1);return window.addEventListener(`blur`,e),window.addEventListener(`resize`,e),()=>{window.removeEventListener(`blur`,e),window.removeEventListener(`resize`,e)}},[ne]);let[L,ie]=Ga(e=>{let t=M().filter(e=>!e.disabled),n=Ka(t,e,t.find(e=>e.ref.current===document.activeElement));n&&setTimeout(()=>n.ref.current.focus())}),ae=s.useCallback((e,t,n)=>{let r=!F.current&&!n;(S.value!==void 0&&S.value===t||r)&&(k(e),r&&(F.current=!0))},[S.value]),oe=s.useCallback(()=>C?.focus(),[C]),se=s.useCallback((e,t,n)=>{let r=!F.current&&!n;(S.value!==void 0&&S.value===t||r)&&j(e)},[S.value]),ce=r===`popper`?ma:fa,le=ce===ma?{side:l,sideOffset:f,align:p,alignOffset:m,arrowPadding:h,collisionBoundary:g,collisionPadding:_,sticky:v,hideWhenDetached:y,avoidCollisions:b}:{};return(0,d.jsx)(oa,{scope:n,content:C,viewport:T,onViewportChange:E,itemRefCallback:ae,selectedItem:O,onItemLeave:oe,itemTextRefCallback:se,focusSelectedItem:te,selectedItemText:A,position:r,isPositioned:N,searchRef:L,children:(0,d.jsx)(Lt,{as:la,allowPinchZoom:!0,children:(0,d.jsx)(me,{asChild:!0,trapped:S.open,onMountAutoFocus:e=>{e.preventDefault()},onUnmountAutoFocus:o(i,e=>{S.trigger?.focus({preventScroll:!0}),e.preventDefault()}),children:(0,d.jsx)(re,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:a,onPointerDownOutside:c,onFocusOutside:e=>e.preventDefault(),onDismiss:()=>S.onOpenChange(!1),children:(0,d.jsx)(ce,{role:`listbox`,id:S.contentId,"data-state":S.open?`open`:`closed`,dir:S.dir,onContextMenu:e=>e.preventDefault(),...x,...le,onPlaced:()=>P(!0),ref:D,style:{display:`flex`,flexDirection:`column`,outline:`none`,...x.style},onKeyDown:o(x.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=M().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(()=>ee(t)),e.preventDefault()}})})})})})})});ua.displayName=ca;var da=`SelectItemAlignedPosition`,fa=s.forwardRef((e,t)=>{let{__scopeSelect:n,onPlaced:r,...i}=e,a=Q(ia,n),o=sa(ia,n),[c,l]=s.useState(null),[f,p]=s.useState(null),m=u(t,e=>p(e)),g=Vi(n),_=s.useRef(!1),v=s.useRef(!0),{viewport:y,selectedItem:b,selectedItemText:x,focusSelectedItem:S}=o,C=s.useCallback(()=>{if(a.trigger&&a.valueNode&&c&&f&&y&&b&&x){let e=a.trigger.getBoundingClientRect(),t=f.getBoundingClientRect(),n=a.valueNode.getBoundingClientRect(),i=x.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-$,d=Xt(a,[$,Math.max($,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-$,d=Xt(a,[$,Math.max($,u-l)]);c.style.minWidth=s+`px`,c.style.right=d+`px`}let o=g(),s=window.innerHeight-$*2,l=y.scrollHeight,u=window.getComputedStyle(f),d=parseInt(u.borderTopWidth,10),p=parseInt(u.paddingTop,10),m=parseInt(u.borderBottomWidth,10),h=parseInt(u.paddingBottom,10),v=d+p+l+h+m,S=Math.min(b.offsetHeight*5,v),C=window.getComputedStyle(y),w=parseInt(C.paddingTop,10),T=parseInt(C.paddingBottom,10),E=e.top+e.height/2-$,D=s-E,O=b.offsetHeight/2,k=b.offsetTop+O,A=d+p+k,j=v-A;if(A<=E){let e=o.length>0&&b===o[o.length-1].ref.current;c.style.bottom=`0px`;let t=f.clientHeight-y.offsetTop-y.offsetHeight,n=A+Math.max(D,O+(e?T:0)+t+m);c.style.height=n+`px`}else{let e=o.length>0&&b===o[0].ref.current;c.style.top=`0px`;let t=Math.max(E,d+y.offsetTop+(e?w:0)+O)+j;c.style.height=t+`px`,y.scrollTop=A-E+y.offsetTop}c.style.margin=`${$}px 0`,c.style.minHeight=S+`px`,c.style.maxHeight=s+`px`,r?.(),requestAnimationFrame(()=>_.current=!0)}},[g,a.trigger,a.valueNode,c,f,y,b,x,a.dir,r]);h(()=>C(),[C]);let[w,T]=s.useState();return h(()=>{f&&T(window.getComputedStyle(f).zIndex)},[f]),(0,d.jsx)(ha,{scope:n,contentWrapper:c,shouldExpandOnScrollRef:_,onScrollButtonChange:s.useCallback(e=>{e&&v.current===!0&&(C(),S?.(),v.current=!1)},[C,S]),children:(0,d.jsx)(`div`,{ref:l,style:{display:`flex`,flexDirection:`column`,position:`fixed`,zIndex:w},children:(0,d.jsx)(j.div,{...i,ref:m,style:{boxSizing:`border-box`,maxHeight:`100%`,...i.style}})})})});fa.displayName=da;var pa=`SelectPopperPosition`,ma=s.forwardRef((e,t)=>{let{__scopeSelect:n,align:r=`start`,collisionPadding:i=$,...a}=e,o=Gi(n);return(0,d.jsx)(Ai,{...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)`}})});ma.displayName=pa;var[ha,ga]=Ui(ia,{}),_a=`SelectViewport`,va=s.forwardRef((e,t)=>{let{__scopeSelect:n,nonce:r,...i}=e,a=sa(_a,n),c=ga(_a,n),l=u(t,a.onViewportChange),f=s.useRef(0);return(0,d.jsxs)(d.Fragment,{children:[(0,d.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,d.jsx)(Bi.Slot,{scope:n,children:(0,d.jsx)(j.div,{"data-radix-select-viewport":``,role:`presentation`,...i,ref:l,style:{position:`relative`,flex:1,overflow:`hidden auto`,...i.style},onScroll:o(i.onScroll,e=>{let t=e.currentTarget,{contentWrapper:n,shouldExpandOnScrollRef:r}=c;if(r?.current&&n){let e=Math.abs(f.current-t.scrollTop);if(e>0){let r=window.innerHeight-$*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`)}}}f.current=t.scrollTop})})})]})});va.displayName=_a;var ya=`SelectGroup`,[ba,xa]=Ui(ya),Sa=s.forwardRef((e,t)=>{let{__scopeSelect:n,...r}=e,i=v();return(0,d.jsx)(ba,{scope:n,id:i,children:(0,d.jsx)(j.div,{role:`group`,"aria-labelledby":i,...r,ref:t})})});Sa.displayName=ya;var Ca=`SelectLabel`,wa=s.forwardRef((e,t)=>{let{__scopeSelect:n,...r}=e,i=xa(Ca,n);return(0,d.jsx)(j.div,{id:i.id,...r,ref:t})});wa.displayName=Ca;var Ta=`SelectItem`,[Ea,Da]=Ui(Ta),Oa=s.forwardRef((e,t)=>{let{__scopeSelect:n,value:r,disabled:i=!1,textValue:a,...c}=e,l=Q(Ta,n),f=sa(Ta,n),p=l.value===r,[m,h]=s.useState(a??``),[g,_]=s.useState(!1),y=u(t,e=>f.itemRefCallback?.(e,r,i)),b=v(),x=s.useRef(`touch`),S=()=>{i||(l.onValueChange(r),l.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,d.jsx)(Ea,{scope:n,value:r,disabled:i,textId:b,isSelected:p,onItemTextChange:s.useCallback(e=>{h(t=>t||(e?.textContent??``).trim())},[]),children:(0,d.jsx)(Bi.ItemSlot,{scope:n,value:r,disabled:i,textValue:m,children:(0,d.jsx)(j.div,{role:`option`,"aria-labelledby":b,"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:y,onFocus:o(c.onFocus,()=>_(!0)),onBlur:o(c.onBlur,()=>_(!1)),onClick:o(c.onClick,()=>{x.current!==`mouse`&&S()}),onPointerUp:o(c.onPointerUp,()=>{x.current===`mouse`&&S()}),onPointerDown:o(c.onPointerDown,e=>{x.current=e.pointerType}),onPointerMove:o(c.onPointerMove,e=>{x.current=e.pointerType,i?f.onItemLeave?.():x.current===`mouse`&&e.currentTarget.focus({preventScroll:!0})}),onPointerLeave:o(c.onPointerLeave,e=>{e.currentTarget===document.activeElement&&f.onItemLeave?.()}),onKeyDown:o(c.onKeyDown,e=>{f.searchRef?.current!==``&&e.key===` `||(Ri.includes(e.key)&&S(),e.key===` `&&e.preventDefault())})})})})});Oa.displayName=Ta;var ka=`SelectItemText`,Aa=s.forwardRef((e,t)=>{let{__scopeSelect:n,className:r,style:i,...a}=e,o=Q(ka,n),c=sa(ka,n),l=Da(ka,n),f=Ji(ka,n),[p,m]=s.useState(null),g=u(t,e=>m(e),l.onItemTextChange,e=>c.itemTextRefCallback?.(e,l.value,l.disabled)),_=p?.textContent,v=s.useMemo(()=>(0,d.jsx)(`option`,{value:l.value,disabled:l.disabled,children:_},l.value),[l.disabled,l.value,_]),{onNativeOptionAdd:y,onNativeOptionRemove:b}=f;return h(()=>(y(v),()=>b(v)),[y,b,v]),(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(j.span,{id:l.textId,...a,ref:g}),l.isSelected&&o.valueNode&&!o.valueNodeHasChildren?A.createPortal(a.children,o.valueNode):null]})});Aa.displayName=ka;var ja=`SelectItemIndicator`,Ma=s.forwardRef((e,t)=>{let{__scopeSelect:n,...r}=e;return Da(ja,n).isSelected?(0,d.jsx)(j.span,{"aria-hidden":!0,...r,ref:t}):null});Ma.displayName=ja;var Na=`SelectScrollUpButton`,Pa=s.forwardRef((e,t)=>{let n=sa(Na,e.__scopeSelect),r=ga(Na,e.__scopeSelect),[i,a]=s.useState(!1),o=u(t,r.onScrollButtonChange);return h(()=>{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,d.jsx)(La,{...e,ref:o,onAutoScroll:()=>{let{viewport:e,selectedItem:t}=n;e&&t&&(e.scrollTop-=t.offsetHeight)}}):null});Pa.displayName=Na;var Fa=`SelectScrollDownButton`,Ia=s.forwardRef((e,t)=>{let n=sa(Fa,e.__scopeSelect),r=ga(Fa,e.__scopeSelect),[i,a]=s.useState(!1),o=u(t,r.onScrollButtonChange);return h(()=>{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,d.jsx)(La,{...e,ref:o,onAutoScroll:()=>{let{viewport:e,selectedItem:t}=n;e&&t&&(e.scrollTop+=t.offsetHeight)}}):null});Ia.displayName=Fa;var La=s.forwardRef((e,t)=>{let{__scopeSelect:n,onAutoScroll:r,...i}=e,a=sa(`SelectScrollButton`,n),c=s.useRef(null),l=Vi(n),u=s.useCallback(()=>{c.current!==null&&(window.clearInterval(c.current),c.current=null)},[]);return s.useEffect(()=>()=>u(),[u]),h(()=>{l().find(e=>e.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:`nearest`})},[l]),(0,d.jsx)(j.div,{"aria-hidden":!0,...i,ref:t,style:{flexShrink:0,...i.style},onPointerDown:o(i.onPointerDown,()=>{c.current===null&&(c.current=window.setInterval(r,50))}),onPointerMove:o(i.onPointerMove,()=>{a.onItemLeave?.(),c.current===null&&(c.current=window.setInterval(r,50))}),onPointerLeave:o(i.onPointerLeave,()=>{u()})})}),Ra=`SelectSeparator`,za=s.forwardRef((e,t)=>{let{__scopeSelect:n,...r}=e;return(0,d.jsx)(j.div,{"aria-hidden":!0,...r,ref:t})});za.displayName=Ra;var Ba=`SelectArrow`,Va=s.forwardRef((e,t)=>{let{__scopeSelect:n,...r}=e,i=Gi(n),a=Q(Ba,n),o=sa(Ba,n);return a.open&&o.position===`popper`?(0,d.jsx)(ji,{...i,...r,ref:t}):null});Va.displayName=Ba;var Ha=`SelectBubbleInput`,Ua=s.forwardRef(({__scopeSelect:e,value:t,...n},r)=>{let i=s.useRef(null),a=u(r,i),o=Mi(t);return s.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,d.jsx)(j.select,{...n,style:{...Ni,...n.style},ref:a,defaultValue:t})});Ua.displayName=Ha;function Wa(e){return e===``||e===void 0}function Ga(e){let t=N(e),n=s.useRef(``),r=s.useRef(0),i=s.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=s.useCallback(()=>{n.current=``,window.clearTimeout(r.current)},[]);return s.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,i,a]}function Ka(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=qa(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 qa(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var Ja=Yi,Ya=Zi,Xa=$i,Za=ta,Qa=ra,$a=aa,eo=va,to=Sa,no=wa,ro=Oa,io=Aa,ao=Ma,oo=Pa,so=Ia,co=za,lo=Ja,uo=Xa,fo=s.forwardRef(({className:e,children:t,...n},i)=>(0,d.jsxs)(Ya,{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,d.jsx)(Za,{asChild:!0,children:(0,d.jsx)(Jt,{className:`h-4 w-4 opacity-50`})})]}));fo.displayName=Ya.displayName;var po=s.forwardRef(({className:e,...t},n)=>(0,d.jsx)(oo,{ref:n,className:r(`flex cursor-default items-center justify-center py-1`,e),...t,children:(0,d.jsx)(Yt,{className:`h-4 w-4`})}));po.displayName=oo.displayName;var mo=s.forwardRef(({className:e,...t},n)=>(0,d.jsx)(so,{ref:n,className:r(`flex cursor-default items-center justify-center py-1`,e),...t,children:(0,d.jsx)(Jt,{className:`h-4 w-4`})}));mo.displayName=so.displayName;var ho=s.forwardRef(({className:e,children:t,position:n=`popper`,...i},a)=>(0,d.jsx)(Qa,{children:(0,d.jsxs)($a,{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,d.jsx)(po,{}),(0,d.jsx)(eo,{className:r(`p-1`,n===`popper`&&`h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]`),children:t}),(0,d.jsx)(mo,{})]})}));ho.displayName=$a.displayName;var go=s.forwardRef(({className:e,...t},n)=>(0,d.jsx)(no,{ref:n,className:r(`px-2 py-1.5 text-sm font-semibold`,e),...t}));go.displayName=no.displayName;var _o=s.forwardRef(({className:e,children:t,...n},i)=>(0,d.jsxs)(ro,{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,d.jsx)(`span`,{className:`absolute right-2 flex h-3.5 w-3.5 items-center justify-center`,children:(0,d.jsx)(ao,{children:(0,d.jsx)(qt,{className:`h-4 w-4`})})}),(0,d.jsx)(io,{children:t})]}));_o.displayName=ro.displayName;var vo=s.forwardRef(({className:e,...t},n)=>(0,d.jsx)(co,{ref:n,className:r(`-mx-1 my-1 h-px bg-muted`,e),...t}));vo.displayName=co.displayName;export{Kt as A,v as B,ji as C,Yt as D,fi as E,re as F,o as G,f as H,j as I,C as L,Oe as M,Ee as N,Jt as O,me as P,E as R,ki as S,Oi as T,p as U,h as V,u as W,co as _,uo as a,eo as b,Za as c,io as d,no as f,oo as g,so as h,fo as i,Lt as j,qt as k,ro as l,Ja as m,ho as n,$a as o,Qa as p,_o as r,to as s,lo as t,ao as u,Ya as v,Ai as w,Ii as x,Xa as y,b as z};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{p as e,u as t}from"./i18n-CXBpwAwA.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};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{p as e,u as t}from"./i18n-CXBpwAwA.js";var n=e(),r={active:{dot:`bg-emerald-500`,text:`text-emerald-600`,bg:`bg-emerald-50`},ready:{dot:`bg-emerald-500`,text:`text-emerald-600`,bg:`bg-emerald-50`},inactive:{dot:`bg-gray-300`,text:`text-gray-400`,bg:`bg-gray-100/80`},setup:{dot:`bg-gray-300`,text:`text-gray-400`,bg:`bg-gray-100/80`},warning:{dot:`bg-amber-400`,text:`text-amber-600`,bg:`bg-amber-50`}};function i({status:e,label:i,className:a}){let o=r[e];return(0,n.jsxs)(`div`,{className:t(`inline-flex shrink-0 items-center gap-1.5 whitespace-nowrap rounded-full px-2 py-0.5`,o.bg,a),children:[(0,n.jsx)(`span`,{className:t(`h-1.5 w-1.5 rounded-full`,o.dot)}),(0,n.jsx)(`span`,{className:t(`text-[11px] font-medium`,o.text),children:i})]})}export{i as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{_ as e,m as t,p as n,u as r}from"./i18n-CXBpwAwA.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};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{i as e,m as t,p as n,u as r}from"./i18n-CXBpwAwA.js";t();var i=n();function a({tabs:t,activeTab:n,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:t.map(t=>{let o=n===t.id;return(0,i.jsxs)(`button`,{onClick:()=>a(t.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:[t.label,t.count!==void 0&&(0,i.jsx)(`span`,{className:r(`text-[11px] font-medium`,`text-gray-500`),children:e(t.count)}),o&&(0,i.jsx)(`div`,{className:`absolute bottom-0 left-0 right-0 h-[2px] bg-primary rounded-full`})]},t.id)})})}export{a as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{t as e}from"./createLucideIcon-CcR5wVoU.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,l as t,m as n,p as r}from"./i18n-CXBpwAwA.js";import{o as i}from"./dist-Dii9v3X9.js";import{$ as a,et as o,it as s,nt as c,rt as l,tt as u}from"./index-CjPeKafH.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)(a,{open:e,onOpenChange:n,children:(0,f.jsxs)(o,{className:`[&>:last-child]:hidden`,onCloseAutoFocus:e=>e.preventDefault(),children:[(0,f.jsxs)(l,{children:[(0,f.jsx)(s,{children:r}),d?(0,f.jsx)(u,{children:d}):null]}),(0,f.jsxs)(c,{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};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{_ as e,m as t}from"./i18n-CXBpwAwA.js";import{A as n,E as r,M as i,S as a,f as o,h as s,k as c,u as l}from"./dist-Dii9v3X9.js";var u=class extends i{#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),c(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 i=l(t),[a]=d.useState(()=>new u(i,e));d.useEffect(()=>{a.setOptions(e)},[a,e]);let o=d.useSyncExternalStore(d.useCallback(e=>a.subscribe(s.batchCalls(e)),[a]),()=>a.getCurrentResult(),()=>a.getCurrentResult()),c=d.useCallback((e,t)=>{a.mutate(e,t).catch(r)},[a]);if(o.error&&n(a.options.throwOnError,[o.error]))throw o.error;return{...o,mutate:c,mutateAsync:o.mutate}}export{f as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{t as e}from"./createLucideIcon-CcR5wVoU.js";var t=e(`X`,[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]);export{t};
|
package/ui-dist/index.html
CHANGED
|
@@ -6,9 +6,24 @@
|
|
|
6
6
|
<link rel="icon" type="image/svg+xml" href="/logo.svg" />
|
|
7
7
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
8
8
|
<title>NextClaw</title>
|
|
9
|
-
<script type="module" crossorigin src="/assets/index-
|
|
10
|
-
<link rel="modulepreload" crossorigin href="/assets/
|
|
11
|
-
<link rel="
|
|
9
|
+
<script type="module" crossorigin src="/assets/index-CjPeKafH.js"></script>
|
|
10
|
+
<link rel="modulepreload" crossorigin href="/assets/i18n-CXBpwAwA.js">
|
|
11
|
+
<link rel="modulepreload" crossorigin href="/assets/chunk-JZWAC4HX-C1vpvW4r.js">
|
|
12
|
+
<link rel="modulepreload" crossorigin href="/assets/dist-Dii9v3X9.js">
|
|
13
|
+
<link rel="modulepreload" crossorigin href="/assets/createLucideIcon-CcR5wVoU.js">
|
|
14
|
+
<link rel="modulepreload" crossorigin href="/assets/select-Cz82gl01.js">
|
|
15
|
+
<link rel="modulepreload" crossorigin href="/assets/dist-BMlnBah3.js">
|
|
16
|
+
<link rel="modulepreload" crossorigin href="/assets/react-ji6GGP_j.js">
|
|
17
|
+
<link rel="modulepreload" crossorigin href="/assets/useMutation-s2sn2yzh.js">
|
|
18
|
+
<link rel="modulepreload" crossorigin href="/assets/book-open-DzSduAaw.js">
|
|
19
|
+
<link rel="modulepreload" crossorigin href="/assets/external-link-CnSDrvJE.js">
|
|
20
|
+
<link rel="modulepreload" crossorigin href="/assets/plus-C9cYVbL-.js">
|
|
21
|
+
<link rel="modulepreload" crossorigin href="/assets/search-sl1OeJFl.js">
|
|
22
|
+
<link rel="modulepreload" crossorigin href="/assets/x-MIimOGs6.js">
|
|
23
|
+
<link rel="modulepreload" crossorigin href="/assets/DocBrowserContext-BcZRBsCg.js">
|
|
24
|
+
<link rel="modulepreload" crossorigin href="/assets/DocBrowser-DKkE3Y4I.js">
|
|
25
|
+
<link rel="modulepreload" crossorigin href="/assets/config-Df97LeLR.js">
|
|
26
|
+
<link rel="stylesheet" crossorigin href="/assets/index-DMy_fKKh.css">
|
|
12
27
|
</head>
|
|
13
28
|
|
|
14
29
|
<body>
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import{r as L,j as u,X as It,K as Pt,aw as Bt,b0 as Tt,b1 as Mt,b2 as Rt,a0 as Lt,g as ut,f as kt,b3 as Me,ae as Re,b4 as Dt,aj as dt,e as q,a3 as Ft,i as Ut,G as qt,H as _t}from"./vendor-MCpnpiKt.js";import{W as zt,t as c,c as K,I as Q,S as Ot,e as Ht,f as Kt,g as Jt,h as Vt,Y as ft,B as je,i as Gt,u as gt,a as ht,b as mt,Z as Yt,_ as Qt}from"./index-DqzLj8Sw.js";import{S as pt}from"./status-dot-BOzEprxw.js";import{L as yt}from"./LogoBadge-CsSBHZeV.js";import{h as Se}from"./config-hints-CApS3K_7.js";import{c as Wt,b as Zt,a as Xt,C as $t}from"./config-layout-BHnOoweL.js";import{L as en}from"./label-DPGDZvhm.js";import{S as tn}from"./switch-rE_Ew8fl.js";import{T as nn}from"./tabs-custom-BkfMUTHE.js";import{P as rn,a as sn}from"./page-layout-DMA_ZiHj.js";function bt(e){var n,t;const s=zt();return((n=e.tutorialUrls)==null?void 0:n[s])||((t=e.tutorialUrls)==null?void 0:t.default)||e.tutorialUrl}const an={telegram:"telegram.svg",slack:"slack.svg",discord:"discord.svg",whatsapp:"whatsapp.svg",qq:"qq.svg",feishu:"feishu.svg",dingtalk:"dingtalk.svg",wecom:"wecom.svg",weixin:"weixin.svg",mochat:"mochat.svg",email:"email.svg"};function on(e,s){const a=s.toLowerCase(),n=e[a];return n?`/logos/${n}`:null}function wt(e){return on(an,e)}function ln({value:e,onChange:s,className:a,placeholder:n=""}){const[t,r]=L.useState(""),i=l=>{l.key==="Enter"&&t.trim()?(l.preventDefault(),s([...e,t.trim()]),r("")):l.key==="Backspace"&&!t&&e.length>0&&s(e.slice(0,-1))},o=l=>{s(e.filter((d,h)=>h!==l))};return u.jsxs("div",{className:K("flex flex-wrap gap-2 p-2 border rounded-md min-h-[42px]",a),children:[e.map((l,d)=>u.jsxs("span",{className:"inline-flex items-center gap-1 px-2 py-1 bg-primary text-primary-foreground rounded text-sm",children:[l,u.jsx("button",{type:"button",onClick:()=>o(d),className:"hover:text-red-300 transition-colors",children:u.jsx(It,{className:"h-3 w-3"})})]},d)),u.jsx("input",{type:"text",value:t,onChange:l=>r(l.target.value),onKeyDown:i,className:"flex-1 outline-none min-w-[100px] bg-transparent text-sm",placeholder:n||c("enterTag")})]})}function cn(e){return e.includes("token")||e.includes("secret")||e.includes("password")?u.jsx(Pt,{className:"h-3.5 w-3.5 text-gray-500"}):e.includes("url")||e.includes("host")?u.jsx(Bt,{className:"h-3.5 w-3.5 text-gray-500"}):e.includes("email")||e.includes("mail")?u.jsx(Tt,{className:"h-3.5 w-3.5 text-gray-500"}):e.includes("id")||e.includes("from")?u.jsx(Mt,{className:"h-3.5 w-3.5 text-gray-500"}):e==="enabled"||e==="consentGranted"?u.jsx(Rt,{className:"h-3.5 w-3.5 text-gray-500"}):u.jsx(Lt,{className:"h-3.5 w-3.5 text-gray-500"})}function Le({channelName:e,fields:s,formData:a,jsonDrafts:n,setJsonDrafts:t,updateField:r,uiHints:i}){return u.jsx(u.Fragment,{children:s.map(o=>{const l=Se(`channels.${e}.${o.name}`,i),d=(l==null?void 0:l.label)??o.label,h=l==null?void 0:l.placeholder;return u.jsxs("div",{className:"space-y-2.5",children:[u.jsxs(en,{htmlFor:o.name,className:"flex items-center gap-2 text-sm font-medium text-gray-900",children:[cn(o.name),d]}),o.type==="boolean"&&u.jsxs("div",{className:"flex items-center justify-between rounded-xl bg-gray-50 p-3",children:[u.jsx("span",{className:"text-sm text-gray-500",children:a[o.name]?c("enabled"):c("disabled")}),u.jsx(tn,{id:o.name,checked:a[o.name]||!1,onCheckedChange:f=>r(o.name,f),className:"data-[state=checked]:bg-emerald-500"})]}),(o.type==="text"||o.type==="email")&&u.jsx(Q,{id:o.name,type:o.type,value:a[o.name]||"",onChange:f=>r(o.name,f.target.value),placeholder:h,className:"rounded-xl"}),o.type==="password"&&u.jsx(Q,{id:o.name,type:"password",value:a[o.name]||"",onChange:f=>r(o.name,f.target.value),placeholder:h??c("leaveBlankToKeepUnchanged"),className:"rounded-xl"}),o.type==="number"&&u.jsx(Q,{id:o.name,type:"number",value:a[o.name]||0,onChange:f=>r(o.name,parseInt(f.target.value,10)||0),placeholder:h,className:"rounded-xl"}),o.type==="tags"&&u.jsx(ln,{value:a[o.name]||[],onChange:f=>r(o.name,f)}),o.type==="select"&&u.jsxs(Ot,{value:a[o.name]||"",onValueChange:f=>r(o.name,f),children:[u.jsx(Ht,{className:"rounded-xl",children:u.jsx(Kt,{})}),u.jsx(Jt,{children:(o.options??[]).map(f=>u.jsx(Vt,{value:f.value,children:f.label},f.value))})]}),o.type==="json"&&u.jsx("textarea",{id:o.name,value:n[o.name]??"{}",onChange:f=>t(x=>({...x,[o.name]:f.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"})]},o.name)})})}const te=[{value:"pairing",label:"pairing"},{value:"allowlist",label:"allowlist"},{value:"open",label:"open"},{value:"disabled",label:"disabled"}],ne=[{value:"open",label:"open"},{value:"allowlist",label:"allowlist"},{value:"disabled",label:"disabled"}],un=[{value:"off",label:"off"},{value:"partial",label:"partial"},{value:"block",label:"block"},{value:"progress",label:"progress"}];function ke(){return{telegram:[{name:"enabled",type:"boolean",label:c("enabled")},{name:"token",type:"password",label:c("botToken")},{name:"allowFrom",type:"tags",label:c("allowFrom")},{name:"proxy",type:"text",label:c("proxy")},{name:"accountId",type:"text",label:c("accountId")},{name:"dmPolicy",type:"select",label:c("dmPolicy"),options:te},{name:"groupPolicy",type:"select",label:c("groupPolicy"),options:ne},{name:"groupAllowFrom",type:"tags",label:c("groupAllowFrom")},{name:"requireMention",type:"boolean",label:c("requireMention")},{name:"mentionPatterns",type:"tags",label:c("mentionPatterns")},{name:"groups",type:"json",label:c("groupRulesJson")}],discord:[{name:"enabled",type:"boolean",label:c("enabled")},{name:"token",type:"password",label:c("botToken")},{name:"allowBots",type:"boolean",label:c("allowBotMessages")},{name:"allowFrom",type:"tags",label:c("allowFrom")},{name:"gatewayUrl",type:"text",label:c("gatewayUrl")},{name:"intents",type:"number",label:c("intents")},{name:"proxy",type:"text",label:c("proxy")},{name:"mediaMaxMb",type:"number",label:c("attachmentMaxSizeMb")},{name:"streaming",type:"select",label:c("streamingMode"),options:un},{name:"draftChunk",type:"json",label:c("draftChunkingJson")},{name:"textChunkLimit",type:"number",label:c("textChunkLimit")},{name:"accountId",type:"text",label:c("accountId")},{name:"dmPolicy",type:"select",label:c("dmPolicy"),options:te},{name:"groupPolicy",type:"select",label:c("groupPolicy"),options:ne},{name:"groupAllowFrom",type:"tags",label:c("groupAllowFrom")},{name:"requireMention",type:"boolean",label:c("requireMention")},{name:"mentionPatterns",type:"tags",label:c("mentionPatterns")},{name:"groups",type:"json",label:c("groupRulesJson")}],whatsapp:[{name:"enabled",type:"boolean",label:c("enabled")},{name:"bridgeUrl",type:"text",label:c("bridgeUrl")},{name:"allowFrom",type:"tags",label:c("allowFrom")}],feishu:[{name:"enabled",type:"boolean",label:c("enabled")},{name:"appId",type:"text",label:c("appId")},{name:"appSecret",type:"password",label:c("appSecret")},{name:"encryptKey",type:"password",label:c("encryptKey")},{name:"verificationToken",type:"password",label:c("verificationToken")},{name:"domain",type:"text",label:"Domain"},{name:"allowFrom",type:"tags",label:c("allowFrom")},{name:"dmPolicy",type:"select",label:c("dmPolicy"),options:te},{name:"groupPolicy",type:"select",label:c("groupPolicy"),options:ne},{name:"groupAllowFrom",type:"tags",label:c("groupAllowFrom")},{name:"requireMention",type:"boolean",label:c("requireMention")},{name:"mentionPatterns",type:"tags",label:c("mentionPatterns")},{name:"groups",type:"json",label:c("groupRulesJson")},{name:"accounts",type:"json",label:c("accountsJson")}],dingtalk:[{name:"enabled",type:"boolean",label:c("enabled")},{name:"clientId",type:"text",label:c("clientId")},{name:"clientSecret",type:"password",label:c("clientSecret")},{name:"allowFrom",type:"tags",label:c("allowFrom")}],wecom:[{name:"enabled",type:"boolean",label:c("enabled")},{name:"corpId",type:"text",label:c("corpId")},{name:"agentId",type:"text",label:c("agentId")},{name:"secret",type:"password",label:c("secret")},{name:"token",type:"password",label:c("token")},{name:"callbackPort",type:"number",label:c("callbackPort")},{name:"callbackPath",type:"text",label:c("callbackPath")},{name:"allowFrom",type:"tags",label:c("allowFrom")}],weixin:[{name:"enabled",type:"boolean",label:c("enabled")},{name:"defaultAccountId",type:"text",label:c("defaultAccountId")},{name:"baseUrl",type:"text",label:c("baseUrl")},{name:"pollTimeoutMs",type:"number",label:c("pollTimeoutMs")},{name:"allowFrom",type:"tags",label:c("allowFrom")},{name:"accounts",type:"json",label:c("accountsJson")}],slack:[{name:"enabled",type:"boolean",label:c("enabled")},{name:"mode",type:"text",label:c("mode")},{name:"webhookPath",type:"text",label:c("webhookPath")},{name:"allowBots",type:"boolean",label:c("allowBotMessages")},{name:"botToken",type:"password",label:c("botToken")},{name:"appToken",type:"password",label:c("appToken")}],email:[{name:"enabled",type:"boolean",label:c("enabled")},{name:"consentGranted",type:"boolean",label:c("consentGranted")},{name:"imapHost",type:"text",label:c("imapHost")},{name:"imapPort",type:"number",label:c("imapPort")},{name:"imapUsername",type:"text",label:c("imapUsername")},{name:"imapPassword",type:"password",label:c("imapPassword")},{name:"fromAddress",type:"email",label:c("fromAddress")}],mochat:[{name:"enabled",type:"boolean",label:c("enabled")},{name:"baseUrl",type:"text",label:c("baseUrl")},{name:"clawToken",type:"password",label:c("clawToken")},{name:"agentUserId",type:"text",label:c("agentUserId")},{name:"allowFrom",type:"tags",label:c("allowFrom")}],qq:[{name:"enabled",type:"boolean",label:c("enabled")},{name:"appId",type:"text",label:c("appId")},{name:"secret",type:"password",label:c("appSecret")},{name:"markdownSupport",type:"boolean",label:c("markdownSupport")},{name:"allowFrom",type:"tags",label:c("allowFrom")}]}}var H={},re,De;function dn(){return De||(De=1,re=function(){return typeof Promise=="function"&&Promise.prototype&&Promise.prototype.then}),re}var se={},U={},Fe;function _(){if(Fe)return U;Fe=1;let e;const s=[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];return U.getSymbolSize=function(n){if(!n)throw new Error('"version" cannot be null or undefined');if(n<1||n>40)throw new Error('"version" should be in range from 1 to 40');return n*4+17},U.getSymbolTotalCodewords=function(n){return s[n]},U.getBCHDigit=function(a){let n=0;for(;a!==0;)n++,a>>>=1;return n},U.setToSJISFunction=function(n){if(typeof n!="function")throw new Error('"toSJISFunc" is not a valid function.');e=n},U.isKanjiModeEnabled=function(){return typeof e<"u"},U.toSJIS=function(n){return e(n)},U}var ae={},Ue;function Ie(){return Ue||(Ue=1,(function(e){e.L={bit:1},e.M={bit:0},e.Q={bit:3},e.H={bit:2};function s(a){if(typeof a!="string")throw new Error("Param is not a string");switch(a.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 new Error("Unknown EC Level: "+a)}}e.isValid=function(n){return n&&typeof n.bit<"u"&&n.bit>=0&&n.bit<4},e.from=function(n,t){if(e.isValid(n))return n;try{return s(n)}catch{return t}}})(ae)),ae}var oe,qe;function fn(){if(qe)return oe;qe=1;function e(){this.buffer=[],this.length=0}return e.prototype={get:function(s){const a=Math.floor(s/8);return(this.buffer[a]>>>7-s%8&1)===1},put:function(s,a){for(let n=0;n<a;n++)this.putBit((s>>>a-n-1&1)===1)},getLengthInBits:function(){return this.length},putBit:function(s){const a=Math.floor(this.length/8);this.buffer.length<=a&&this.buffer.push(0),s&&(this.buffer[a]|=128>>>this.length%8),this.length++}},oe=e,oe}var ie,_e;function gn(){if(_e)return ie;_e=1;function e(s){if(!s||s<1)throw new Error("BitMatrix size must be defined and greater than 0");this.size=s,this.data=new Uint8Array(s*s),this.reservedBit=new Uint8Array(s*s)}return e.prototype.set=function(s,a,n,t){const r=s*this.size+a;this.data[r]=n,t&&(this.reservedBit[r]=!0)},e.prototype.get=function(s,a){return this.data[s*this.size+a]},e.prototype.xor=function(s,a,n){this.data[s*this.size+a]^=n},e.prototype.isReserved=function(s,a){return this.reservedBit[s*this.size+a]},ie=e,ie}var le={},ze;function hn(){return ze||(ze=1,(function(e){const s=_().getSymbolSize;e.getRowColCoords=function(n){if(n===1)return[];const t=Math.floor(n/7)+2,r=s(n),i=r===145?26:Math.ceil((r-13)/(2*t-2))*2,o=[r-7];for(let l=1;l<t-1;l++)o[l]=o[l-1]-i;return o.push(6),o.reverse()},e.getPositions=function(n){const t=[],r=e.getRowColCoords(n),i=r.length;for(let o=0;o<i;o++)for(let l=0;l<i;l++)o===0&&l===0||o===0&&l===i-1||o===i-1&&l===0||t.push([r[o],r[l]]);return t}})(le)),le}var ce={},Oe;function mn(){if(Oe)return ce;Oe=1;const e=_().getSymbolSize,s=7;return ce.getPositions=function(n){const t=e(n);return[[0,0],[t-s,0],[0,t-s]]},ce}var ue={},He;function pn(){return He||(He=1,(function(e){e.Patterns={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7};const s={N1:3,N2:3,N3:40,N4:10};e.isValid=function(t){return t!=null&&t!==""&&!isNaN(t)&&t>=0&&t<=7},e.from=function(t){return e.isValid(t)?parseInt(t,10):void 0},e.getPenaltyN1=function(t){const r=t.size;let i=0,o=0,l=0,d=null,h=null;for(let f=0;f<r;f++){o=l=0,d=h=null;for(let x=0;x<r;x++){let g=t.get(f,x);g===d?o++:(o>=5&&(i+=s.N1+(o-5)),d=g,o=1),g=t.get(x,f),g===h?l++:(l>=5&&(i+=s.N1+(l-5)),h=g,l=1)}o>=5&&(i+=s.N1+(o-5)),l>=5&&(i+=s.N1+(l-5))}return i},e.getPenaltyN2=function(t){const r=t.size;let i=0;for(let o=0;o<r-1;o++)for(let l=0;l<r-1;l++){const d=t.get(o,l)+t.get(o,l+1)+t.get(o+1,l)+t.get(o+1,l+1);(d===4||d===0)&&i++}return i*s.N2},e.getPenaltyN3=function(t){const r=t.size;let i=0,o=0,l=0;for(let d=0;d<r;d++){o=l=0;for(let h=0;h<r;h++)o=o<<1&2047|t.get(d,h),h>=10&&(o===1488||o===93)&&i++,l=l<<1&2047|t.get(h,d),h>=10&&(l===1488||l===93)&&i++}return i*s.N3},e.getPenaltyN4=function(t){let r=0;const i=t.data.length;for(let l=0;l<i;l++)r+=t.data[l];return Math.abs(Math.ceil(r*100/i/5)-10)*s.N4};function a(n,t,r){switch(n){case e.Patterns.PATTERN000:return(t+r)%2===0;case e.Patterns.PATTERN001:return t%2===0;case e.Patterns.PATTERN010:return r%3===0;case e.Patterns.PATTERN011:return(t+r)%3===0;case e.Patterns.PATTERN100:return(Math.floor(t/2)+Math.floor(r/3))%2===0;case e.Patterns.PATTERN101:return t*r%2+t*r%3===0;case e.Patterns.PATTERN110:return(t*r%2+t*r%3)%2===0;case e.Patterns.PATTERN111:return(t*r%3+(t+r)%2)%2===0;default:throw new Error("bad maskPattern:"+n)}}e.applyMask=function(t,r){const i=r.size;for(let o=0;o<i;o++)for(let l=0;l<i;l++)r.isReserved(l,o)||r.xor(l,o,a(t,l,o))},e.getBestMask=function(t,r){const i=Object.keys(e.Patterns).length;let o=0,l=1/0;for(let d=0;d<i;d++){r(d),e.applyMask(d,t);const h=e.getPenaltyN1(t)+e.getPenaltyN2(t)+e.getPenaltyN3(t)+e.getPenaltyN4(t);e.applyMask(d,t),h<l&&(l=h,o=d)}return o}})(ue)),ue}var Y={},Ke;function xt(){if(Ke)return Y;Ke=1;const e=Ie(),s=[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],a=[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];return Y.getBlocksCount=function(t,r){switch(r){case e.L:return s[(t-1)*4+0];case e.M:return s[(t-1)*4+1];case e.Q:return s[(t-1)*4+2];case e.H:return s[(t-1)*4+3];default:return}},Y.getTotalCodewordsCount=function(t,r){switch(r){case e.L:return a[(t-1)*4+0];case e.M:return a[(t-1)*4+1];case e.Q:return a[(t-1)*4+2];case e.H:return a[(t-1)*4+3];default:return}},Y}var de={},V={},Je;function yn(){if(Je)return V;Je=1;const e=new Uint8Array(512),s=new Uint8Array(256);return(function(){let n=1;for(let t=0;t<255;t++)e[t]=n,s[n]=t,n<<=1,n&256&&(n^=285);for(let t=255;t<512;t++)e[t]=e[t-255]})(),V.log=function(n){if(n<1)throw new Error("log("+n+")");return s[n]},V.exp=function(n){return e[n]},V.mul=function(n,t){return n===0||t===0?0:e[s[n]+s[t]]},V}var Ve;function bn(){return Ve||(Ve=1,(function(e){const s=yn();e.mul=function(n,t){const r=new Uint8Array(n.length+t.length-1);for(let i=0;i<n.length;i++)for(let o=0;o<t.length;o++)r[i+o]^=s.mul(n[i],t[o]);return r},e.mod=function(n,t){let r=new Uint8Array(n);for(;r.length-t.length>=0;){const i=r[0];for(let l=0;l<t.length;l++)r[l]^=s.mul(t[l],i);let o=0;for(;o<r.length&&r[o]===0;)o++;r=r.slice(o)}return r},e.generateECPolynomial=function(n){let t=new Uint8Array([1]);for(let r=0;r<n;r++)t=e.mul(t,new Uint8Array([1,s.exp(r)]));return t}})(de)),de}var fe,Ge;function wn(){if(Ge)return fe;Ge=1;const e=bn();function s(a){this.genPoly=void 0,this.degree=a,this.degree&&this.initialize(this.degree)}return s.prototype.initialize=function(n){this.degree=n,this.genPoly=e.generateECPolynomial(this.degree)},s.prototype.encode=function(n){if(!this.genPoly)throw new Error("Encoder not initialized");const t=new Uint8Array(n.length+this.degree);t.set(n);const r=e.mod(t,this.genPoly),i=this.degree-r.length;if(i>0){const o=new Uint8Array(this.degree);return o.set(r,i),o}return r},fe=s,fe}var ge={},he={},me={},Ye;function Ct(){return Ye||(Ye=1,me.isValid=function(s){return!isNaN(s)&&s>=1&&s<=40}),me}var k={},Qe;function At(){if(Qe)return k;Qe=1;const e="[0-9]+",s="[A-Z $%*+\\-./:]+";let a="(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+";a=a.replace(/u/g,"\\u");const n="(?:(?![A-Z0-9 $%*+\\-./:]|"+a+`)(?:.|[\r
|
|
2
|
-
]))+`;k.KANJI=new RegExp(a,"g"),k.BYTE_KANJI=new RegExp("[^A-Z0-9 $%*+\\-./:]+","g"),k.BYTE=new RegExp(n,"g"),k.NUMERIC=new RegExp(e,"g"),k.ALPHANUMERIC=new RegExp(s,"g");const t=new RegExp("^"+a+"$"),r=new RegExp("^"+e+"$"),i=new RegExp("^[A-Z0-9 $%*+\\-./:]+$");return k.testKanji=function(l){return t.test(l)},k.testNumeric=function(l){return r.test(l)},k.testAlphanumeric=function(l){return i.test(l)},k}var We;function z(){return We||(We=1,(function(e){const s=Ct(),a=At();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(r,i){if(!r.ccBits)throw new Error("Invalid mode: "+r);if(!s.isValid(i))throw new Error("Invalid version: "+i);return i>=1&&i<10?r.ccBits[0]:i<27?r.ccBits[1]:r.ccBits[2]},e.getBestModeForData=function(r){return a.testNumeric(r)?e.NUMERIC:a.testAlphanumeric(r)?e.ALPHANUMERIC:a.testKanji(r)?e.KANJI:e.BYTE},e.toString=function(r){if(r&&r.id)return r.id;throw new Error("Invalid mode")},e.isValid=function(r){return r&&r.bit&&r.ccBits};function n(t){if(typeof t!="string")throw new 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 new Error("Unknown mode: "+t)}}e.from=function(r,i){if(e.isValid(r))return r;try{return n(r)}catch{return i}}})(he)),he}var Ze;function xn(){return Ze||(Ze=1,(function(e){const s=_(),a=xt(),n=Ie(),t=z(),r=Ct(),i=7973,o=s.getBCHDigit(i);function l(x,g,y){for(let A=1;A<=40;A++)if(g<=e.getCapacity(A,y,x))return A}function d(x,g){return t.getCharCountIndicator(x,g)+4}function h(x,g){let y=0;return x.forEach(function(A){const T=d(A.mode,g);y+=T+A.getBitsLength()}),y}function f(x,g){for(let y=1;y<=40;y++)if(h(x,y)<=e.getCapacity(y,g,t.MIXED))return y}e.from=function(g,y){return r.isValid(g)?parseInt(g,10):y},e.getCapacity=function(g,y,A){if(!r.isValid(g))throw new Error("Invalid QR Code version");typeof A>"u"&&(A=t.BYTE);const T=s.getSymbolTotalCodewords(g),E=a.getTotalCodewordsCount(g,y),B=(T-E)*8;if(A===t.MIXED)return B;const b=B-d(A,g);switch(A){case t.NUMERIC:return Math.floor(b/10*3);case t.ALPHANUMERIC:return Math.floor(b/11*2);case t.KANJI:return Math.floor(b/13);case t.BYTE:default:return Math.floor(b/8)}},e.getBestVersionForData=function(g,y){let A;const T=n.from(y,n.M);if(Array.isArray(g)){if(g.length>1)return f(g,T);if(g.length===0)return 1;A=g[0]}else A=g;return l(A.mode,A.getLength(),T)},e.getEncodedBits=function(g){if(!r.isValid(g)||g<7)throw new Error("Invalid QR Code version");let y=g<<12;for(;s.getBCHDigit(y)-o>=0;)y^=i<<s.getBCHDigit(y)-o;return g<<12|y}})(ge)),ge}var pe={},Xe;function Cn(){if(Xe)return pe;Xe=1;const e=_(),s=1335,a=21522,n=e.getBCHDigit(s);return pe.getEncodedBits=function(r,i){const o=r.bit<<3|i;let l=o<<10;for(;e.getBCHDigit(l)-n>=0;)l^=s<<e.getBCHDigit(l)-n;return(o<<10|l)^a},pe}var ye={},be,$e;function An(){if($e)return be;$e=1;const e=z();function s(a){this.mode=e.NUMERIC,this.data=a.toString()}return s.getBitsLength=function(n){return 10*Math.floor(n/3)+(n%3?n%3*3+1:0)},s.prototype.getLength=function(){return this.data.length},s.prototype.getBitsLength=function(){return s.getBitsLength(this.data.length)},s.prototype.write=function(n){let t,r,i;for(t=0;t+3<=this.data.length;t+=3)r=this.data.substr(t,3),i=parseInt(r,10),n.put(i,10);const o=this.data.length-t;o>0&&(r=this.data.substr(t),i=parseInt(r,10),n.put(i,o*3+1))},be=s,be}var we,et;function vn(){if(et)return we;et=1;const e=z(),s=["0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"," ","$","%","*","+","-",".","/",":"];function a(n){this.mode=e.ALPHANUMERIC,this.data=n}return a.getBitsLength=function(t){return 11*Math.floor(t/2)+6*(t%2)},a.prototype.getLength=function(){return this.data.length},a.prototype.getBitsLength=function(){return a.getBitsLength(this.data.length)},a.prototype.write=function(t){let r;for(r=0;r+2<=this.data.length;r+=2){let i=s.indexOf(this.data[r])*45;i+=s.indexOf(this.data[r+1]),t.put(i,11)}this.data.length%2&&t.put(s.indexOf(this.data[r]),6)},we=a,we}var xe,tt;function Nn(){if(tt)return xe;tt=1;const e=z();function s(a){this.mode=e.BYTE,typeof a=="string"?this.data=new TextEncoder().encode(a):this.data=new Uint8Array(a)}return s.getBitsLength=function(n){return n*8},s.prototype.getLength=function(){return this.data.length},s.prototype.getBitsLength=function(){return s.getBitsLength(this.data.length)},s.prototype.write=function(a){for(let n=0,t=this.data.length;n<t;n++)a.put(this.data[n],8)},xe=s,xe}var Ce,nt;function En(){if(nt)return Ce;nt=1;const e=z(),s=_();function a(n){this.mode=e.KANJI,this.data=n}return a.getBitsLength=function(t){return t*13},a.prototype.getLength=function(){return this.data.length},a.prototype.getBitsLength=function(){return a.getBitsLength(this.data.length)},a.prototype.write=function(n){let t;for(t=0;t<this.data.length;t++){let r=s.toSJIS(this.data[t]);if(r>=33088&&r<=40956)r-=33088;else if(r>=57408&&r<=60351)r-=49472;else throw new Error("Invalid SJIS character: "+this.data[t]+`
|
|
3
|
-
Make sure your charset is UTF-8`);r=(r>>>8&255)*192+(r&255),n.put(r,13)}},Ce=a,Ce}var Ae={exports:{}},rt;function jn(){return rt||(rt=1,(function(e){var s={single_source_shortest_paths:function(a,n,t){var r={},i={};i[n]=0;var o=s.PriorityQueue.make();o.push(n,0);for(var l,d,h,f,x,g,y,A,T;!o.empty();){l=o.pop(),d=l.value,f=l.cost,x=a[d]||{};for(h in x)x.hasOwnProperty(h)&&(g=x[h],y=f+g,A=i[h],T=typeof i[h]>"u",(T||A>y)&&(i[h]=y,o.push(h,y),r[h]=d))}if(typeof t<"u"&&typeof i[t]>"u"){var E=["Could not find a path from ",n," to ",t,"."].join("");throw new Error(E)}return r},extract_shortest_path_from_predecessor_list:function(a,n){for(var t=[],r=n;r;)t.push(r),a[r],r=a[r];return t.reverse(),t},find_path:function(a,n,t){var r=s.single_source_shortest_paths(a,n,t);return s.extract_shortest_path_from_predecessor_list(r,t)},PriorityQueue:{make:function(a){var n=s.PriorityQueue,t={},r;a=a||{};for(r in n)n.hasOwnProperty(r)&&(t[r]=n[r]);return t.queue=[],t.sorter=a.sorter||n.default_sorter,t},default_sorter:function(a,n){return a.cost-n.cost},push:function(a,n){var t={value:a,cost:n};this.queue.push(t),this.queue.sort(this.sorter)},pop:function(){return this.queue.shift()},empty:function(){return this.queue.length===0}}};e.exports=s})(Ae)),Ae.exports}var st;function Sn(){return st||(st=1,(function(e){const s=z(),a=An(),n=vn(),t=Nn(),r=En(),i=At(),o=_(),l=jn();function d(E){return unescape(encodeURIComponent(E)).length}function h(E,B,b){const N=[];let M;for(;(M=E.exec(b))!==null;)N.push({data:M[0],index:M.index,mode:B,length:M[0].length});return N}function f(E){const B=h(i.NUMERIC,s.NUMERIC,E),b=h(i.ALPHANUMERIC,s.ALPHANUMERIC,E);let N,M;return o.isKanjiModeEnabled()?(N=h(i.BYTE,s.BYTE,E),M=h(i.KANJI,s.KANJI,E)):(N=h(i.BYTE_KANJI,s.BYTE,E),M=[]),B.concat(b,N,M).sort(function(S,I){return S.index-I.index}).map(function(S){return{data:S.data,mode:S.mode,length:S.length}})}function x(E,B){switch(B){case s.NUMERIC:return a.getBitsLength(E);case s.ALPHANUMERIC:return n.getBitsLength(E);case s.KANJI:return r.getBitsLength(E);case s.BYTE:return t.getBitsLength(E)}}function g(E){return E.reduce(function(B,b){const N=B.length-1>=0?B[B.length-1]:null;return N&&N.mode===b.mode?(B[B.length-1].data+=b.data,B):(B.push(b),B)},[])}function y(E){const B=[];for(let b=0;b<E.length;b++){const N=E[b];switch(N.mode){case s.NUMERIC:B.push([N,{data:N.data,mode:s.ALPHANUMERIC,length:N.length},{data:N.data,mode:s.BYTE,length:N.length}]);break;case s.ALPHANUMERIC:B.push([N,{data:N.data,mode:s.BYTE,length:N.length}]);break;case s.KANJI:B.push([N,{data:N.data,mode:s.BYTE,length:d(N.data)}]);break;case s.BYTE:B.push([{data:N.data,mode:s.BYTE,length:d(N.data)}])}}return B}function A(E,B){const b={},N={start:{}};let M=["start"];for(let w=0;w<E.length;w++){const S=E[w],I=[];for(let v=0;v<S.length;v++){const P=S[v],j=""+w+v;I.push(j),b[j]={node:P,lastCount:0},N[j]={};for(let m=0;m<M.length;m++){const p=M[m];b[p]&&b[p].node.mode===P.mode?(N[p][j]=x(b[p].lastCount+P.length,P.mode)-x(b[p].lastCount,P.mode),b[p].lastCount+=P.length):(b[p]&&(b[p].lastCount=P.length),N[p][j]=x(P.length,P.mode)+4+s.getCharCountIndicator(P.mode,B))}}M=I}for(let w=0;w<M.length;w++)N[M[w]].end=0;return{map:N,table:b}}function T(E,B){let b;const N=s.getBestModeForData(E);if(b=s.from(B,N),b!==s.BYTE&&b.bit<N.bit)throw new Error('"'+E+'" cannot be encoded with mode '+s.toString(b)+`.
|
|
4
|
-
Suggested mode is: `+s.toString(N));switch(b===s.KANJI&&!o.isKanjiModeEnabled()&&(b=s.BYTE),b){case s.NUMERIC:return new a(E);case s.ALPHANUMERIC:return new n(E);case s.KANJI:return new r(E);case s.BYTE:return new t(E)}}e.fromArray=function(B){return B.reduce(function(b,N){return typeof N=="string"?b.push(T(N,null)):N.data&&b.push(T(N.data,N.mode)),b},[])},e.fromString=function(B,b){const N=f(B,o.isKanjiModeEnabled()),M=y(N),w=A(M,b),S=l.find_path(w.map,"start","end"),I=[];for(let v=1;v<S.length-1;v++)I.push(w.table[S[v]].node);return e.fromArray(g(I))},e.rawSplit=function(B){return e.fromArray(f(B,o.isKanjiModeEnabled()))}})(ye)),ye}var at;function In(){if(at)return se;at=1;const e=_(),s=Ie(),a=fn(),n=gn(),t=hn(),r=mn(),i=pn(),o=xt(),l=wn(),d=xn(),h=Cn(),f=z(),x=Sn();function g(w,S){const I=w.size,v=r.getPositions(S);for(let P=0;P<v.length;P++){const j=v[P][0],m=v[P][1];for(let p=-1;p<=7;p++)if(!(j+p<=-1||I<=j+p))for(let C=-1;C<=7;C++)m+C<=-1||I<=m+C||(p>=0&&p<=6&&(C===0||C===6)||C>=0&&C<=6&&(p===0||p===6)||p>=2&&p<=4&&C>=2&&C<=4?w.set(j+p,m+C,!0,!0):w.set(j+p,m+C,!1,!0))}}function y(w){const S=w.size;for(let I=8;I<S-8;I++){const v=I%2===0;w.set(I,6,v,!0),w.set(6,I,v,!0)}}function A(w,S){const I=t.getPositions(S);for(let v=0;v<I.length;v++){const P=I[v][0],j=I[v][1];for(let m=-2;m<=2;m++)for(let p=-2;p<=2;p++)m===-2||m===2||p===-2||p===2||m===0&&p===0?w.set(P+m,j+p,!0,!0):w.set(P+m,j+p,!1,!0)}}function T(w,S){const I=w.size,v=d.getEncodedBits(S);let P,j,m;for(let p=0;p<18;p++)P=Math.floor(p/3),j=p%3+I-8-3,m=(v>>p&1)===1,w.set(P,j,m,!0),w.set(j,P,m,!0)}function E(w,S,I){const v=w.size,P=h.getEncodedBits(S,I);let j,m;for(j=0;j<15;j++)m=(P>>j&1)===1,j<6?w.set(j,8,m,!0):j<8?w.set(j+1,8,m,!0):w.set(v-15+j,8,m,!0),j<8?w.set(8,v-j-1,m,!0):j<9?w.set(8,15-j-1+1,m,!0):w.set(8,15-j-1,m,!0);w.set(v-8,8,1,!0)}function B(w,S){const I=w.size;let v=-1,P=I-1,j=7,m=0;for(let p=I-1;p>0;p-=2)for(p===6&&p--;;){for(let C=0;C<2;C++)if(!w.isReserved(P,p-C)){let R=!1;m<S.length&&(R=(S[m]>>>j&1)===1),w.set(P,p-C,R),j--,j===-1&&(m++,j=7)}if(P+=v,P<0||I<=P){P-=v,v=-v;break}}}function b(w,S,I){const v=new a;I.forEach(function(C){v.put(C.mode.bit,4),v.put(C.getLength(),f.getCharCountIndicator(C.mode,w)),C.write(v)});const P=e.getSymbolTotalCodewords(w),j=o.getTotalCodewordsCount(w,S),m=(P-j)*8;for(v.getLengthInBits()+4<=m&&v.put(0,4);v.getLengthInBits()%8!==0;)v.putBit(0);const p=(m-v.getLengthInBits())/8;for(let C=0;C<p;C++)v.put(C%2?17:236,8);return N(v,w,S)}function N(w,S,I){const v=e.getSymbolTotalCodewords(S),P=o.getTotalCodewordsCount(S,I),j=v-P,m=o.getBlocksCount(S,I),p=v%m,C=m-p,R=Math.floor(v/m),J=Math.floor(j/m),Et=J+1,Pe=R-J,jt=new l(Pe);let Z=0;const G=new Array(m),Be=new Array(m);let X=0;const St=new Uint8Array(w.buffer);for(let O=0;O<m;O++){const ee=O<C?J:Et;G[O]=St.slice(Z,Z+ee),Be[O]=jt.encode(G[O]),Z+=ee,X=Math.max(X,ee)}const $=new Uint8Array(v);let Te=0,D,F;for(D=0;D<X;D++)for(F=0;F<m;F++)D<G[F].length&&($[Te++]=G[F][D]);for(D=0;D<Pe;D++)for(F=0;F<m;F++)$[Te++]=Be[F][D];return $}function M(w,S,I,v){let P;if(Array.isArray(w))P=x.fromArray(w);else if(typeof w=="string"){let R=S;if(!R){const J=x.rawSplit(w);R=d.getBestVersionForData(J,I)}P=x.fromString(w,R||40)}else throw new Error("Invalid data");const j=d.getBestVersionForData(P,I);if(!j)throw new Error("The amount of data is too big to be stored in a QR Code");if(!S)S=j;else if(S<j)throw new Error(`
|
|
5
|
-
The chosen QR Code version cannot contain this amount of data.
|
|
6
|
-
Minimum version required to store current data is: `+j+`.
|
|
7
|
-
`);const m=b(S,I,P),p=e.getSymbolSize(S),C=new n(p);return g(C,S),y(C),A(C,S),E(C,I,0),S>=7&&T(C,S),B(C,m),isNaN(v)&&(v=i.getBestMask(C,E.bind(null,C,I))),i.applyMask(v,C),E(C,I,v),{modules:C,version:S,errorCorrectionLevel:I,maskPattern:v,segments:P}}return se.create=function(S,I){if(typeof S>"u"||S==="")throw new Error("No input text");let v=s.M,P,j;return typeof I<"u"&&(v=s.from(I.errorCorrectionLevel,s.M),P=d.from(I.version),j=i.from(I.maskPattern),I.toSJISFunc&&e.setToSJISFunction(I.toSJISFunc)),M(S,P,v,j)},se}var ve={},Ne={},ot;function vt(){return ot||(ot=1,(function(e){function s(a){if(typeof a=="number"&&(a=a.toString()),typeof a!="string")throw new Error("Color should be defined as hex string");let n=a.slice().replace("#","").split("");if(n.length<3||n.length===5||n.length>8)throw new Error("Invalid hex color: "+a);(n.length===3||n.length===4)&&(n=Array.prototype.concat.apply([],n.map(function(r){return[r,r]}))),n.length===6&&n.push("F","F");const t=parseInt(n.join(""),16);return{r:t>>24&255,g:t>>16&255,b:t>>8&255,a:t&255,hex:"#"+n.slice(0,6).join("")}}e.getOptions=function(n){n||(n={}),n.color||(n.color={});const t=typeof n.margin>"u"||n.margin===null||n.margin<0?4:n.margin,r=n.width&&n.width>=21?n.width:void 0,i=n.scale||4;return{width:r,scale:r?4:i,margin:t,color:{dark:s(n.color.dark||"#000000ff"),light:s(n.color.light||"#ffffffff")},type:n.type,rendererOpts:n.rendererOpts||{}}},e.getScale=function(n,t){return t.width&&t.width>=n+t.margin*2?t.width/(n+t.margin*2):t.scale},e.getImageWidth=function(n,t){const r=e.getScale(n,t);return Math.floor((n+t.margin*2)*r)},e.qrToImageData=function(n,t,r){const i=t.modules.size,o=t.modules.data,l=e.getScale(i,r),d=Math.floor((i+r.margin*2)*l),h=r.margin*l,f=[r.color.light,r.color.dark];for(let x=0;x<d;x++)for(let g=0;g<d;g++){let y=(x*d+g)*4,A=r.color.light;if(x>=h&&g>=h&&x<d-h&&g<d-h){const T=Math.floor((x-h)/l),E=Math.floor((g-h)/l);A=f[o[T*i+E]?1:0]}n[y++]=A.r,n[y++]=A.g,n[y++]=A.b,n[y]=A.a}}})(Ne)),Ne}var it;function Pn(){return it||(it=1,(function(e){const s=vt();function a(t,r,i){t.clearRect(0,0,r.width,r.height),r.style||(r.style={}),r.height=i,r.width=i,r.style.height=i+"px",r.style.width=i+"px"}function n(){try{return document.createElement("canvas")}catch{throw new Error("You need to specify a canvas element")}}e.render=function(r,i,o){let l=o,d=i;typeof l>"u"&&(!i||!i.getContext)&&(l=i,i=void 0),i||(d=n()),l=s.getOptions(l);const h=s.getImageWidth(r.modules.size,l),f=d.getContext("2d"),x=f.createImageData(h,h);return s.qrToImageData(x.data,r,l),a(f,d,h),f.putImageData(x,0,0),d},e.renderToDataURL=function(r,i,o){let l=o;typeof l>"u"&&(!i||!i.getContext)&&(l=i,i=void 0),l||(l={});const d=e.render(r,i,l),h=l.type||"image/png",f=l.rendererOpts||{};return d.toDataURL(h,f.quality)}})(ve)),ve}var Ee={},lt;function Bn(){if(lt)return Ee;lt=1;const e=vt();function s(t,r){const i=t.a/255,o=r+'="'+t.hex+'"';return i<1?o+" "+r+'-opacity="'+i.toFixed(2).slice(1)+'"':o}function a(t,r,i){let o=t+r;return typeof i<"u"&&(o+=" "+i),o}function n(t,r,i){let o="",l=0,d=!1,h=0;for(let f=0;f<t.length;f++){const x=Math.floor(f%r),g=Math.floor(f/r);!x&&!d&&(d=!0),t[f]?(h++,f>0&&x>0&&t[f-1]||(o+=d?a("M",x+i,.5+g+i):a("m",l,0),l=0,d=!1),x+1<r&&t[f+1]||(o+=a("h",h),h=0)):l++}return o}return Ee.render=function(r,i,o){const l=e.getOptions(i),d=r.modules.size,h=r.modules.data,f=d+l.margin*2,x=l.color.light.a?"<path "+s(l.color.light,"fill")+' d="M0 0h'+f+"v"+f+'H0z"/>':"",g="<path "+s(l.color.dark,"stroke")+' d="'+n(h,d,l.margin)+'"/>',y='viewBox="0 0 '+f+" "+f+'"',T='<svg xmlns="http://www.w3.org/2000/svg" '+(l.width?'width="'+l.width+'" height="'+l.width+'" ':"")+y+' shape-rendering="crispEdges">'+x+g+`</svg>
|
|
8
|
-
`;return typeof o=="function"&&o(null,T),T},Ee}var ct;function Tn(){if(ct)return H;ct=1;const e=dn(),s=In(),a=Pn(),n=Bn();function t(r,i,o,l,d){const h=[].slice.call(arguments,1),f=h.length,x=typeof h[f-1]=="function";if(!x&&!e())throw new Error("Callback required as last argument");if(x){if(f<2)throw new Error("Too few arguments provided");f===2?(d=o,o=i,i=l=void 0):f===3&&(i.getContext&&typeof d>"u"?(d=l,l=void 0):(d=l,l=o,o=i,i=void 0))}else{if(f<1)throw new Error("Too few arguments provided");return f===1?(o=i,i=l=void 0):f===2&&!i.getContext&&(l=o,o=i,i=void 0),new Promise(function(g,y){try{const A=s.create(o,l);g(r(A,i,l))}catch(A){y(A)}})}try{const g=s.create(o,l);d(null,r(g,i,l))}catch(g){d(g)}}return H.create=s.create,H.toCanvas=t.bind(null,a.render),H.toDataURL=t.bind(null,a.renderToDataURL),H.toString=t.bind(null,function(r,i,o){return n.render(r,o)}),H}var Mn=Tn();async function Rn(e,s={}){const a=await ft.post(`/api/config/channels/${e}/auth/start`,s);if(!a.ok)throw new Error(a.error.message);return a.data}async function Ln(e,s){const a=await ft.post(`/api/config/channels/${e}/auth/poll`,s);if(!a.ok)throw new Error(a.error.message);return a.data}function kn(){return ut({mutationFn:({channel:e,data:s})=>Rn(e,s)})}function Dn(){return ut({mutationFn:({channel:e,data:s})=>Ln(e,s)})}function Fn(e){const s=e.accounts,a=new Set;if(typeof e.defaultAccountId=="string"&&e.defaultAccountId.trim()&&a.add(e.defaultAccountId.trim()),s&&typeof s=="object"&&!Array.isArray(s))for(const n of Object.keys(s)){const t=n.trim();t&&a.add(t)}return[...a]}function Un(e,s){if(typeof e.baseUrl=="string"&&e.baseUrl.trim())return e.baseUrl.trim();if(typeof s.baseUrl=="string"&&s.baseUrl.trim())return s.baseUrl.trim()}function qn({channelConfig:e,formData:s,disabled:a=!1}){const n=kt(),t=kn(),r=Dn(),[i,o]=L.useState(null),[l,d]=L.useState(null),[h,f]=L.useState(null),x=L.useMemo(()=>Fn(e),[e]),g=x[0],y=Un(s,e),A=x.length>0;L.useEffect(()=>{A&&(o(null),d(b=>(b==null?void 0:b.status)==="authorized"?b:{channel:"weixin",status:"authorized",message:c("weixinAuthAuthorized"),accountId:g??null}))},[A,g]),L.useEffect(()=>{if(!i){f(null);return}let b=!1;return Mn.toDataURL(i.qrCodeUrl,{errorCorrectionLevel:"M",margin:1,width:480}).then(N=>{b||f(N)}).catch(()=>{b||f(null)}),()=>{b=!0}},[i]),L.useEffect(()=>{if(!i)return;let b=!1,N=null;const M=async()=>{try{const w=await r.mutateAsync({channel:"weixin",data:{sessionId:i.sessionId}});if(b)return;if(d(w),w.status==="authorized"){await n.invalidateQueries({queryKey:["config"]}),await n.invalidateQueries({queryKey:["config-meta"]}),q.success(w.message||c("weixinAuthAuthorized")),o(null);return}if(w.status==="expired"||w.status==="error"){q.error(w.message||c("weixinAuthRetryRequired")),o(null);return}N=setTimeout(M,w.nextPollMs??i.intervalMs)}catch(w){if(b)return;const S=w instanceof Error?w.message:String(w);q.error(`${c("error")}: ${S}`),o(null)}};return N=setTimeout(M,i.intervalMs),()=>{b=!0,N&&clearTimeout(N)}},[i,r,n]);const T=async()=>{try{const b=await t.mutateAsync({channel:"weixin",data:{baseUrl:y,accountId:typeof s.defaultAccountId=="string"&&s.defaultAccountId.trim()?s.defaultAccountId.trim():void 0}});o(b),d({channel:"weixin",status:"pending",message:b.note,nextPollMs:b.intervalMs})}catch(b){const N=b instanceof Error?b.message:String(b);q.error(`${c("error")}: ${N}`)}},E=i?(l==null?void 0:l.status)==="scanned"?c("weixinAuthScanned"):c("weixinAuthWaiting"):A?c("weixinAuthAuthorized"):c("weixinAuthNotConnected"),B=t.isPending?c("weixinAuthStarting"):i?c("weixinAuthWaiting"):A?c("weixinAuthReconnect"):c("weixinAuthConnect");return u.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:u.jsxs("div",{className:"flex flex-col gap-4 lg:flex-row lg:items-start lg:justify-between",children:[u.jsxs("div",{className:"space-y-3",children:[u.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:[u.jsx(Me,{className:"h-3.5 w-3.5"}),c("weixinAuthTitle")]}),u.jsxs("div",{children:[u.jsx("h4",{className:"text-base font-semibold text-gray-900",children:c("weixinAuthDescription")}),u.jsx("p",{className:"mt-1 text-sm text-gray-600",children:c("weixinAuthHint")})]}),u.jsxs("div",{className:K("inline-flex w-fit items-center gap-2 rounded-full px-3 py-1 text-xs font-medium",i?"bg-amber-50 text-amber-700":A?"bg-emerald-50 text-emerald-700":"bg-gray-100 text-gray-600"),children:[i?u.jsx(Re,{className:"h-3.5 w-3.5 animate-spin"}):u.jsx(Dt,{className:"h-3.5 w-3.5"}),E]}),u.jsxs("div",{className:"space-y-1 text-sm text-gray-600",children:[u.jsx("p",{children:c("weixinAuthCapabilityHint")}),g?u.jsxs("p",{children:[c("weixinAuthPrimaryAccount"),": ",u.jsx("span",{className:"font-mono text-xs text-gray-900",children:g})]}):null,x.length>1?u.jsxs("p",{children:[c("weixinAuthConnectedAccounts"),": ",u.jsx("span",{className:"font-mono text-xs text-gray-900",children:x.join(", ")})]}):null,y?u.jsxs("p",{children:[c("weixinAuthBaseUrl"),": ",u.jsx("span",{className:"font-mono text-xs text-gray-900",children:y})]}):null]}),u.jsx(je,{type:"button",onClick:T,disabled:a||t.isPending||!!i,className:"rounded-xl",children:B})]}),u.jsx("div",{className:"w-full max-w-sm rounded-2xl border border-dashed border-primary/25 bg-white/85 p-4 shadow-sm",children:i?u.jsxs("div",{className:"space-y-3",children:[u.jsx("div",{className:"overflow-hidden rounded-2xl border border-gray-100 bg-white p-3",children:h?u.jsx("img",{src:h,alt:c("weixinAuthQrAlt"),className:"mx-auto aspect-square w-full max-w-[240px] object-contain"}):u.jsx("div",{className:"flex aspect-square w-full items-center justify-center rounded-xl bg-gray-50 text-gray-500",children:u.jsxs("div",{className:"flex flex-col items-center gap-2 text-center",children:[u.jsx(Re,{className:"h-5 w-5 animate-spin"}),u.jsx("p",{className:"text-xs",children:c("weixinAuthStarting")})]})})}),u.jsxs("div",{className:"space-y-1 text-xs text-gray-500",children:[u.jsx("p",{children:(l==null?void 0:l.message)||i.note||c("weixinAuthScanPrompt")}),u.jsxs("p",{children:[c("weixinAuthExpiresAt"),": ",Gt(i.expiresAt)]})]}),u.jsxs("a",{href:i.qrCodeUrl,target:"_blank",rel:"noreferrer",className:"inline-flex items-center gap-1.5 text-xs text-primary transition-colors hover:text-primary-hover",children:[u.jsx(dt,{className:"h-3.5 w-3.5"}),c("weixinAuthOpenQr")]})]}):u.jsxs("div",{className:"flex min-h-[280px] flex-col items-center justify-center rounded-2xl bg-gray-50/80 px-6 text-center",children:[u.jsx(Me,{className:"h-9 w-9 text-gray-300"}),u.jsx("p",{className:"mt-3 text-sm font-medium text-gray-700",children:c("weixinAuthReadyTitle")}),u.jsx("p",{className:"mt-1 text-xs leading-5 text-gray-500",children:c("weixinAuthReadyDescription")})]})})]})})}function W(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function Nt(e,s){const a={...e};for(const[n,t]of Object.entries(s)){const r=a[n];if(W(r)&&W(t)){a[n]=Nt(r,t);continue}a[n]=t}return a}function _n(e,s){const a=e.split("."),n={};let t=n;for(let r=0;r<a.length-1;r+=1){const i=a[r];t[i]={},t=t[i]}return t[a[a.length-1]]=s,n}function zn({channelName:e}){var P,j;const{data:s}=gt(),{data:a}=ht(),{data:n}=mt(),t=Yt(),r=Qt(),[i,o]=L.useState({}),[l,d]=L.useState({}),[h,f]=L.useState(null),x=e?s==null?void 0:s.channels[e]:null,g=e?ke()[e]??[]:[],y=n==null?void 0:n.uiHints,A=e?`channels.${e}`:null,T=((P=n==null?void 0:n.actions)==null?void 0:P.filter(m=>m.scope===A))??[],E=e&&(((j=Se(`channels.${e}`,y))==null?void 0:j.label)??e),B=a==null?void 0:a.channels.find(m=>m.name===e),b=B?bt(B):void 0,N=e==="weixin";L.useEffect(()=>{if(x){o({...x});const m={};(e?ke()[e]??[]:[]).filter(C=>C.type==="json").forEach(C=>{const R=x[C.name];m[C.name]=JSON.stringify(R??{},null,2)}),d(m)}else o({}),d({})},[x,e]);const M=(m,p)=>{o(C=>({...C,[m]:p}))},w=m=>{if(m.preventDefault(),!e)return;const p={...i};for(const C of g){if(C.type!=="password")continue;const R=p[C.name];(typeof R!="string"||R.length===0)&&delete p[C.name]}for(const C of g){if(C.type!=="json")continue;const R=l[C.name]??"";try{p[C.name]=R.trim()?JSON.parse(R):{}}catch{q.error(`${c("invalidJson")}: ${C.name}`);return}}t.mutate({channel:e,data:p})},S=m=>{if(!m||!e)return;const p=m.channels;if(!W(p))return;const C=p[e];W(C)&&o(R=>Nt(R,C))},I=async m=>{if(!(!e||!A)){f(m.id);try{let p={...i};m.saveBeforeRun&&(p={...p,...m.savePatch??{}},o(p),await t.mutateAsync({channel:e,data:p}));const C=await r.mutateAsync({actionId:m.id,data:{scope:A,draftConfig:_n(A,p)}});S(C.patch),C.ok?q.success(C.message||c("success")):q.error(C.message||c("error"))}catch(p){const C=p instanceof Error?p.message:String(p);q.error(`${c("error")}: ${C}`)}finally{f(null)}}};if(!e||!B||!x)return u.jsx("div",{className:Wt,children:u.jsxs("div",{children:[u.jsx("h3",{className:"text-base font-semibold text-gray-900",children:c("channelsSelectTitle")}),u.jsx("p",{className:"mt-2 text-sm text-gray-500",children:c("channelsSelectDescription")})]})});const v=!!x.enabled;return u.jsxs("div",{className:Zt,children:[u.jsx("div",{className:"border-b border-gray-100 px-6 py-5",children:u.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[u.jsxs("div",{className:"min-w-0",children:[u.jsxs("div",{className:"flex items-center gap-3",children:[u.jsx(yt,{name:e,src:wt(e),className:K("h-9 w-9 rounded-lg border",v?"border-primary/30 bg-white":"border-gray-200/70 bg-white"),imgClassName:"h-5 w-5 object-contain",fallback:u.jsx("span",{className:"text-sm font-semibold uppercase text-gray-500",children:e[0]})}),u.jsx("h3",{className:"truncate text-lg font-semibold text-gray-900 capitalize",children:E})]}),u.jsx("p",{className:"mt-2 text-sm text-gray-500",children:c("channelsFormDescription")}),b&&u.jsxs("a",{href:b,className:"mt-2 inline-flex items-center gap-1.5 text-xs text-primary transition-colors hover:text-primary-hover",children:[u.jsx(Ft,{className:"h-3.5 w-3.5"}),c("channelsGuideTitle")]})]}),u.jsx(pt,{status:v?"active":"inactive",label:v?c("statusActive"):c("statusInactive")})]})}),u.jsxs("form",{onSubmit:w,className:"flex min-h-0 flex-1 flex-col",children:[u.jsx("div",{className:"min-h-0 flex-1 space-y-6 overflow-y-auto overscroll-contain px-6 py-5",children:N?u.jsxs(u.Fragment,{children:[u.jsx(qn,{channelConfig:x,formData:i,disabled:t.isPending||!!h}),u.jsxs("details",{className:"group rounded-2xl border border-gray-200/80 bg-white",children:[u.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:[u.jsxs("div",{children:[u.jsx("p",{children:c("weixinAuthAdvancedTitle")}),u.jsx("p",{className:"mt-1 text-xs font-normal text-gray-500",children:c("weixinAuthAdvancedDescription")})]}),u.jsx(Ut,{className:"h-4 w-4 text-gray-400 transition-transform group-open:rotate-180"})]}),u.jsx("div",{className:"space-y-6 border-t border-gray-100 px-5 py-5",children:u.jsx(Le,{channelName:e,fields:g,formData:i,jsonDrafts:l,setJsonDrafts:d,updateField:M,uiHints:y})})]})]}):u.jsx(Le,{channelName:e,fields:g,formData:i,jsonDrafts:l,setJsonDrafts:d,updateField:M,uiHints:y})}),u.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3 border-t border-gray-100 px-6 py-4",children:[u.jsx("div",{className:"flex flex-wrap items-center gap-2",children:T.filter(m=>m.trigger==="manual").map(m=>u.jsx(je,{type:"button",onClick:()=>I(m),disabled:t.isPending||!!h,variant:"secondary",children:h===m.id?c("connecting"):m.title},m.id))}),u.jsx(je,{type:"submit",disabled:t.isPending||!!h,children:t.isPending?c("saving"):c("save")})]})]})]})}const On={telegram:"channelDescTelegram",slack:"channelDescSlack",email:"channelDescEmail",webhook:"channelDescWebhook",discord:"channelDescDiscord",feishu:"channelDescFeishu",weixin:"channelDescWeixin"};function $n(){const{data:e}=gt(),{data:s}=ht(),{data:a}=mt(),[n,t]=L.useState("enabled"),[r,i]=L.useState(),[o,l]=L.useState(""),d=a==null?void 0:a.uiHints,h=s==null?void 0:s.channels,f=e==null?void 0:e.channels,x=[{id:"enabled",label:c("channelsTabEnabled"),count:(h??[]).filter(y=>{var A;return(A=f==null?void 0:f[y.name])==null?void 0:A.enabled}).length},{id:"all",label:c("channelsTabAll"),count:(h??[]).length}],g=L.useMemo(()=>{const y=o.trim().toLowerCase();return(h??[]).filter(A=>{var E;const T=((E=f==null?void 0:f[A.name])==null?void 0:E.enabled)||!1;return n==="enabled"?T:!0}).filter(A=>y?(A.displayName||A.name).toLowerCase().includes(y)||A.name.toLowerCase().includes(y):!0)},[n,f,h,o]);return L.useEffect(()=>{if(g.length===0){i(void 0);return}g.some(A=>A.name===r)||i(g[0].name)},[g,r]),!e||!s?u.jsx("div",{className:"p-8 text-gray-400",children:c("channelsLoading")}):u.jsxs(rn,{className:"xl:flex xl:h-full xl:min-h-0 xl:flex-col xl:pb-0",children:[u.jsx(sn,{title:c("channelsPageTitle"),description:c("channelsPageDescription")}),u.jsxs("div",{className:K($t,"xl:min-h-0 xl:flex-1"),children:[u.jsxs("section",{className:Xt,children:[u.jsx("div",{className:"border-b border-gray-100 px-4 pt-4",children:u.jsx(nn,{tabs:x,activeTab:n,onChange:t,className:"mb-0"})}),u.jsx("div",{className:"border-b border-gray-100 px-4 py-3",children:u.jsxs("div",{className:"relative",children:[u.jsx(qt,{className:"pointer-events-none absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-gray-400"}),u.jsx(Q,{value:o,onChange:y=>l(y.target.value),placeholder:c("channelsFilterPlaceholder"),className:"h-10 rounded-xl pl-9"})]})}),u.jsxs("div",{className:"min-h-0 flex-1 space-y-2 overflow-y-auto overscroll-contain p-3",children:[g.map(y=>{const A=e.channels[y.name],T=(A==null?void 0:A.enabled)||!1,E=Se(`channels.${y.name}`,d),B=bt(y),b=(E==null?void 0:E.help)||c(On[y.name]||"channelDescriptionDefault"),N=r===y.name;return u.jsx("button",{type:"button",onClick:()=>i(y.name),className:K("w-full rounded-xl border p-2.5 text-left transition-all",N?"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:u.jsxs("div",{className:"flex items-start justify-between gap-3",children:[u.jsxs("div",{className:"flex min-w-0 items-center gap-3",children:[u.jsx(yt,{name:y.name,src:wt(y.name),className:K("h-10 w-10 rounded-lg border",T?"border-primary/30 bg-white":"border-gray-200/70 bg-white"),imgClassName:"h-5 w-5 object-contain",fallback:u.jsx("span",{className:"text-sm font-semibold uppercase text-gray-500",children:y.name[0]})}),u.jsxs("div",{className:"min-w-0",children:[u.jsx("p",{className:"truncate text-sm font-semibold text-gray-900",children:y.displayName||y.name}),u.jsx("p",{className:"line-clamp-1 text-[11px] text-gray-500",children:b})]})]}),u.jsxs("div",{className:"flex items-center gap-2",children:[B&&u.jsx("a",{href:B,onClick:M=>M.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:c("channelsGuideTitle"),children:u.jsx(dt,{className:"h-3.5 w-3.5"})}),u.jsx(pt,{status:T?"active":"inactive",label:T?c("statusActive"):c("statusInactive"),className:"min-w-[56px] justify-center"})]})]})},y.name)}),g.length===0&&u.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:[u.jsx("div",{className:"mb-3 flex h-10 w-10 items-center justify-center rounded-lg bg-white",children:u.jsx(_t,{className:"h-5 w-5 text-gray-300"})}),u.jsx("p",{className:"text-sm font-medium text-gray-700",children:c("channelsNoMatch")})]})]})]}),u.jsx(zn,{channelName:r})]})]})}export{$n as ChannelsList};
|