@kaitranntt/ccs 7.75.0-dev.9 → 7.76.0-dev.1
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/auth/profile-registry.d.ts.map +1 -1
- package/dist/auth/profile-registry.js +9 -0
- package/dist/auth/profile-registry.js.map +1 -1
- package/dist/ccs.js +77 -9
- package/dist/ccs.js.map +1 -1
- package/dist/cliproxy/auth/oauth-handler.d.ts.map +1 -1
- package/dist/cliproxy/auth/oauth-handler.js +20 -0
- package/dist/cliproxy/auth/oauth-handler.js.map +1 -1
- package/dist/cliproxy/binary/platform-detector.d.ts +4 -4
- package/dist/cliproxy/binary/platform-detector.d.ts.map +1 -1
- package/dist/cliproxy/binary/platform-detector.js +2 -2
- package/dist/cliproxy/binary/platform-detector.js.map +1 -1
- package/dist/cliproxy/quota/quota-fetcher.d.ts.map +1 -1
- package/dist/cliproxy/quota/quota-fetcher.js +28 -9
- package/dist/cliproxy/quota/quota-fetcher.js.map +1 -1
- package/dist/commands/command-catalog.d.ts.map +1 -1
- package/dist/commands/command-catalog.js +4 -0
- package/dist/commands/command-catalog.js.map +1 -1
- package/dist/commands/doctor-command.d.ts.map +1 -1
- package/dist/commands/doctor-command.js +9 -0
- package/dist/commands/doctor-command.js.map +1 -1
- package/dist/copilot/copilot-auth.d.ts.map +1 -1
- package/dist/copilot/copilot-auth.js +22 -0
- package/dist/copilot/copilot-auth.js.map +1 -1
- package/dist/copilot/copilot-daemon.d.ts.map +1 -1
- package/dist/copilot/copilot-daemon.js +26 -0
- package/dist/copilot/copilot-daemon.js.map +1 -1
- package/dist/copilot/copilot-executor.d.ts.map +1 -1
- package/dist/copilot/copilot-executor.js +22 -0
- package/dist/copilot/copilot-executor.js.map +1 -1
- package/dist/cursor/cursor-daemon.d.ts.map +1 -1
- package/dist/cursor/cursor-daemon.js +28 -1
- package/dist/cursor/cursor-daemon.js.map +1 -1
- package/dist/cursor/cursor-executor.d.ts.map +1 -1
- package/dist/cursor/cursor-executor.js +17 -1
- package/dist/cursor/cursor-executor.js.map +1 -1
- package/dist/delegation/delegation-handler.d.ts.map +1 -1
- package/dist/delegation/delegation-handler.js +4 -1
- package/dist/delegation/delegation-handler.js.map +1 -1
- package/dist/glmt/glmt-proxy.d.ts.map +1 -1
- package/dist/glmt/glmt-proxy.js +7 -0
- package/dist/glmt/glmt-proxy.js.map +1 -1
- package/dist/glmt/glmt-transformer.d.ts.map +1 -1
- package/dist/glmt/glmt-transformer.js +1 -3
- package/dist/glmt/glmt-transformer.js.map +1 -1
- package/dist/management/instance-manager.d.ts.map +1 -1
- package/dist/management/instance-manager.js +9 -0
- package/dist/management/instance-manager.js.map +1 -1
- package/dist/proxy/server/messages-route.d.ts.map +1 -1
- package/dist/proxy/server/messages-route.js +27 -7
- package/dist/proxy/server/messages-route.js.map +1 -1
- package/dist/proxy/server/proxy-server.d.ts.map +1 -1
- package/dist/proxy/server/proxy-server.js +24 -6
- package/dist/proxy/server/proxy-server.js.map +1 -1
- package/dist/services/logging/index.d.ts +6 -1
- package/dist/services/logging/index.d.ts.map +1 -1
- package/dist/services/logging/index.js +16 -1
- package/dist/services/logging/index.js.map +1 -1
- package/dist/services/logging/log-context.d.ts +41 -0
- package/dist/services/logging/log-context.d.ts.map +1 -0
- package/dist/services/logging/log-context.js +51 -0
- package/dist/services/logging/log-context.js.map +1 -0
- package/dist/services/logging/log-redaction.d.ts +8 -0
- package/dist/services/logging/log-redaction.d.ts.map +1 -1
- package/dist/services/logging/log-redaction.js +40 -3
- package/dist/services/logging/log-redaction.js.map +1 -1
- package/dist/services/logging/log-types.d.ts +30 -0
- package/dist/services/logging/log-types.d.ts.map +1 -1
- package/dist/services/logging/log-types.js +15 -1
- package/dist/services/logging/log-types.js.map +1 -1
- package/dist/services/logging/logger.d.ts +17 -0
- package/dist/services/logging/logger.d.ts.map +1 -1
- package/dist/services/logging/logger.js +23 -4
- package/dist/services/logging/logger.js.map +1 -1
- package/dist/targets/claude-adapter.d.ts.map +1 -1
- package/dist/targets/claude-adapter.js +11 -0
- package/dist/targets/claude-adapter.js.map +1 -1
- package/dist/targets/codex-adapter.d.ts.map +1 -1
- package/dist/targets/codex-adapter.js +11 -0
- package/dist/targets/codex-adapter.js.map +1 -1
- package/dist/targets/droid-adapter.d.ts.map +1 -1
- package/dist/targets/droid-adapter.js +11 -0
- package/dist/targets/droid-adapter.js.map +1 -1
- package/dist/ui/assets/{accounts-C11yNnFn.js → accounts-CybVGDsm.js} +1 -1
- package/dist/ui/assets/{alert-dialog-BDhZ9T12.js → alert-dialog-C6npAhT0.js} +1 -1
- package/dist/ui/assets/{api-DXFMasvG.js → api-DZosWVkR.js} +1 -1
- package/dist/ui/assets/{auth-section-BQpO_21y.js → auth-section-D4MZkgcP.js} +1 -1
- package/dist/ui/assets/{backups-section-BM2lP-ap.js → backups-section-DvMJrmHH.js} +1 -1
- package/dist/ui/assets/{channels-qstH8YTZ.js → channels-BVftYfOn.js} +1 -1
- package/dist/ui/assets/{charts-BBPXh0Ar.js → charts-CeK2xCSo.js} +1 -1
- package/dist/ui/assets/{checkbox-BPx7K8To.js → checkbox-BLRznRTO.js} +1 -1
- package/dist/ui/assets/{claude-extension-BD6uQlc-.js → claude-extension-C6OeBQ73.js} +1 -1
- package/dist/ui/assets/cliproxy-B3Jyu3r9.js +3 -0
- package/dist/ui/assets/{cliproxy-ai-providers-BNffQh5X.js → cliproxy-ai-providers-BAJ78pUc.js} +1 -1
- package/dist/ui/assets/{cliproxy-control-panel-CjExrU2o.js → cliproxy-control-panel-XEvUMVJe.js} +1 -1
- package/dist/ui/assets/{code-highlight-BRUf_pqB.js → code-highlight-D4E79GKQ.js} +1 -1
- package/dist/ui/assets/{codex-Dd2XIT8b.js → codex-CY2vikqX.js} +1 -1
- package/dist/ui/assets/{confirm-dialog-BZP3xwZi.js → confirm-dialog-DjLHh1qX.js} +1 -1
- package/dist/ui/assets/{copilot-gf-rTcY8.js → copilot-afee2lL9.js} +1 -1
- package/dist/ui/assets/{cursor-CJGCGy-H.js → cursor-DuWy60wp.js} +1 -1
- package/dist/ui/assets/{droid-D1Wq6rRO.js → droid-FlceoQ6k.js} +1 -1
- package/dist/ui/assets/{form-utils-Bcoyqxpq.js → form-utils-CuHzLhJZ.js} +1 -1
- package/dist/ui/assets/{globalenv-section-DBqYbsuu.js → globalenv-section-DpJ7unxC.js} +1 -1
- package/dist/ui/assets/{health-DW8M92nq.js → health-BEMgcKD3.js} +1 -1
- package/dist/ui/assets/icons-DQFHtVq5.js +1 -0
- package/dist/ui/assets/{index-JIaHpwil.js → index-0GkznW41.js} +1 -1
- package/dist/ui/assets/{index-B0dun58L.js → index-0n_43sCZ.js} +1 -1
- package/dist/ui/assets/index-6xrth3Oz.css +1 -0
- package/dist/ui/assets/{index-ubH9RpKo.js → index-BRtgic66.js} +3 -3
- package/dist/ui/assets/{index-BczU222d.js → index-Ba4ysocb.js} +1 -1
- package/dist/ui/assets/{index-CoeauyY0.js → index-Cj7EjEq6.js} +1 -1
- package/dist/ui/assets/{index-IiaQMFco.js → index-Cq9VySs6.js} +1 -1
- package/dist/ui/assets/{index-B5cw5Mhf.js → index-DOC7_hun.js} +1 -1
- package/dist/ui/assets/logs-Dth4naJl.js +1 -0
- package/dist/ui/assets/{masked-input-Bmo6mlTB.js → masked-input-DL6pJ8pE.js} +1 -1
- package/dist/ui/assets/{notifications-B2HqRBj7.js → notifications-B4_o8bcr.js} +1 -1
- package/dist/ui/assets/{proxy-g4_N-fbB.js → proxy-C4-M_9kB.js} +1 -1
- package/dist/ui/assets/{proxy-status-widget-EX_Raok7.js → proxy-status-widget-DW4cPFeD.js} +1 -1
- package/dist/ui/assets/{radix-ui-Zb8sVEtn.js → radix-ui-nu4wz29m.js} +1 -1
- package/dist/ui/assets/{raw-json-settings-editor-panel-C4DFuY4g.js → raw-json-settings-editor-panel-Dcumu3Qi.js} +1 -1
- package/dist/ui/assets/{react-vendor-CNOkPC89.js → react-vendor-Bjx91N7w.js} +1 -1
- package/dist/ui/assets/{searchable-select-CLhlrHkQ.js → searchable-select-CWL2D5Ft.js} +1 -1
- package/dist/ui/assets/{separator-BEJQ4e4O.js → separator-Do_vqTQD.js} +1 -1
- package/dist/ui/assets/{shared-4QlIu64T.js → shared-CwWuZx24.js} +1 -1
- package/dist/ui/assets/{table-B6xzmyfm.js → table-BP6nBZzg.js} +1 -1
- package/dist/ui/assets/{tanstack-CrmUhA7Z.js → tanstack-bhJxV1h8.js} +1 -1
- package/dist/ui/assets/{updates-DBkXWRpR.js → updates-BTHJZ7Rk.js} +1 -1
- package/dist/ui/index.html +9 -9
- package/package.json +1 -1
- package/scripts/run-test-bucket.js +2 -0
- package/dist/ui/assets/cliproxy-5-BIu9Wb.js +0 -3
- package/dist/ui/assets/icons-DyorC3Xk.js +0 -1
- package/dist/ui/assets/index-Bbiq6Xkt.css +0 -1
- package/dist/ui/assets/logs-DbWcj2t5.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as e}from"./radix-ui-Zb8sVEtn.js";import{g as Ie,r as b}from"./react-vendor-CNOkPC89.js";import{bB as Ce,bC as Ae,bD as ke,bE as Fe,bF as q,bG as ie,bH as M,bI as Le,bJ as Ue,a as pe,c as I,B as U,d as Z,bx as Ge,aZ as Me,bK as Be,bL as qe,bM as ze,bN as He,bO as Ke,bP as Ze,bQ as Qe,bR as Ye,bS as Je,aM as Xe,M as et,O as tt,r as st,s as nt,t as rt,v as at,w as it,T as ot,p as lt,q as ct,Y as ut}from"./index-ubH9RpKo.js";import{A as dt,a as mt,b as xt,c as pt,d as gt,e as ft,f as ht,g as bt}from"./alert-dialog-BDhZ9T12.js";import{u as Ee,a as yt,b as jt,h as vt}from"./tanstack-CrmUhA7Z.js";import{t as oe}from"./notifications-B2HqRBj7.js";import{be as ye,R as K,t as Nt,s as St,u as wt,A as Ct,bf as At,bg as kt,bh as Et,X as Tt,e as Pt,bi as Vt,bj as $t,U as Ot,v as Rt,m as Dt,w as Wt,aF as _t,T as le,aP as It}from"./icons-DyorC3Xk.js";var ce,je;function Ft(){return je||(je=1,ce={area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0}),ce}var Lt=Ft();const Ut=Ie(Lt);var Gt=/\s([^'"/\s><]+?)[\s/>]|([^\s=]+)=\s?(".*?"|'.*?')/g;function ve(t){var s={type:"tag",name:"",voidElement:!1,attrs:{},children:[]},n=t.match(/<\/?([^\s]+?)[/\s>]/);if(n&&(s.name=n[1],(Ut[n[1]]||t.charAt(t.length-2)==="/")&&(s.voidElement=!0),s.name.startsWith("!--"))){var r=t.indexOf("-->");return{type:"comment",comment:r!==-1?t.slice(4,r):""}}for(var a=new RegExp(Gt),i=null;(i=a.exec(t))!==null;)if(i[0].trim())if(i[1]){var o=i[1].trim(),u=[o,""];o.indexOf("=")>-1&&(u=o.split("=")),s.attrs[u[0]]=u[1],a.lastIndex--}else i[2]&&(s.attrs[i[2]]=i[3].trim().substring(1,i[3].length-1));return s}var Mt=/<[a-zA-Z0-9\-\!\/](?:"[^"]*"|'[^']*'|[^'">])*>/g,Bt=/^\s*$/,qt=Object.create(null);function Te(t,s){switch(s.type){case"text":return t+s.content;case"tag":return t+="<"+s.name+(s.attrs?(function(n){var r=[];for(var a in n)r.push(a+'="'+n[a]+'"');return r.length?" "+r.join(" "):""})(s.attrs):"")+(s.voidElement?"/>":">"),s.voidElement?t:t+s.children.reduce(Te,"")+"</"+s.name+">";case"comment":return t+"<!--"+s.comment+"-->"}}var zt={parse:function(t,s){s||(s={}),s.components||(s.components=qt);var n,r=[],a=[],i=-1,o=!1;if(t.indexOf("<")!==0){var u=t.indexOf("<");r.push({type:"text",content:u===-1?t:t.substring(0,u)})}return t.replace(Mt,function(f,l){if(o){if(f!=="</"+n.name+">")return;o=!1}var x,v=f.charAt(1)!=="/",A=f.startsWith("<!--"),m=l+f.length,d=t.charAt(m);if(A){var O=ve(f);return i<0?(r.push(O),r):((x=a[i]).children.push(O),r)}if(v&&(i++,(n=ve(f)).type==="tag"&&s.components[n.name]&&(n.type="component",o=!0),n.voidElement||o||!d||d==="<"||n.children.push({type:"text",content:t.slice(m,t.indexOf("<",m))}),i===0&&r.push(n),(x=a[i-1])&&x.children.push(n),a[i]=n),(!v||n.voidElement)&&(i>-1&&(n.voidElement||n.name===f.slice(2,-1))&&(i--,n=i===-1?r:a[i]),!o&&d!=="<"&&d)){x=i===-1?r:a[i].children;var p=t.indexOf("<",m),P=t.slice(m,p===-1?void 0:p);Bt.test(P)&&(P=" "),(p>-1&&i+x.length>=0||P!==" ")&&x.push({type:"text",content:P})}}),r},stringify:function(t){return t.reduce(function(s,n){return s+Te("",n)},"")}};const ee=(t,s)=>{if(!t)return!1;const n=t.props?.children??t.children;return s?n.length>0:!!n},te=t=>{if(!t)return[];const s=t.props?.children??t.children;return t.props?.i18nIsDynamicList?B(s):s},Ht=t=>Array.isArray(t)&&t.every(b.isValidElement),B=t=>Array.isArray(t)?t:[t],Kt=(t,s)=>{const n={...s};return n.props={...s.props,...t.props},n},Zt=t=>{const s={};if(!t)return s;const n=r=>{B(r).forEach(i=>{q(i)||(ee(i)?n(te(i)):M(i)&&!b.isValidElement(i)&&Object.assign(s,i))})};return n(t),s},Pe=(t,s,n,r)=>{if(!t)return"";let a="";const i=B(t),o=s?.transSupportBasicHtmlNodes?s.transKeepBasicHtmlNodesFor??[]:[];return i.forEach((u,f)=>{if(q(u)){a+=`${u}`;return}if(b.isValidElement(u)){const{props:l,type:x}=u,v=Object.keys(l).length,A=o.indexOf(x)>-1,m=l.children;if(!m&&A&&!v){a+=`<${x}/>`;return}if(!m&&(!A||v)||l.i18nIsDynamicList){a+=`<${f}></${f}>`;return}if(A&&v===1&&q(m)){a+=`<${x}>${m}</${x}>`;return}const d=Pe(m,s,n,r);a+=`<${f}>${d}</${f}>`;return}if(u===null){ie(n,"TRANS_NULL_VALUE","Passed in a null value as child",{i18nKey:r});return}if(M(u)){const{format:l,...x}=u,v=Object.keys(x);if(v.length===1){const A=l?`${v[0]}, ${l}`:v[0];a+=`{{${A}}}`;return}ie(n,"TRANS_INVALID_OBJ","Invalid child - Object should only have keys {{ value, format }} (format is optional).",{i18nKey:r,child:u});return}ie(n,"TRANS_INVALID_VAR","Passed in a variable like {number} - pass variables for interpolation as full objects like {{number}}.",{i18nKey:r,child:u})}),a},Qt=(t,s=[],n={})=>{if(!t)return t;const r=Object.keys(n),a=[...s,...r];let i="",o=0;for(;o<t.length;)if(t[o]==="<"){let u=!1;const f=t.slice(o).match(/^<\/(\d+|[a-zA-Z][a-zA-Z0-9_-]*)>/);if(f){const l=f[1];(/^\d+$/.test(l)||a.includes(l))&&(u=!0,i+=f[0],o+=f[0].length)}if(!u){const l=t.slice(o).match(/^<(\d+|[a-zA-Z][a-zA-Z0-9_-]*)(\s+[\w-]+(?:=(?:"[^"]*"|'[^']*'|[^\s>]+))?)*\s*(\/)?>/);if(l){const x=l[1];(/^\d+$/.test(x)||a.includes(x))&&(u=!0,i+=l[0],o+=l[0].length)}}u||(i+="<",o+=1)}else i+=t[o],o+=1;return i},Yt=(t,s,n,r,a,i,o)=>{if(n==="")return[];const u=a.transKeepBasicHtmlNodesFor||[],f=n&&new RegExp(u.map(y=>`<${y}`).join("|")).test(n);if(!t&&!s&&!f&&!o)return[n];const l=s??{},x=y=>{B(y).forEach(N=>{q(N)||(ee(N)?x(te(N)):M(N)&&!b.isValidElement(N)&&Object.assign(l,N))})};x(t);const v=Qt(n,u,l),A=zt.parse(`<0>${v}</0>`),m={...l,...i},d=(y,k,N)=>{const V=te(y),W=p(V,k.children,N);return Ht(V)&&W.length===0||y.props?.i18nIsDynamicList?V:W},O=(y,k,N,V,W)=>{y.dummy?(y.children=k,N.push(b.cloneElement(y,{key:V},W?void 0:k))):N.push(...b.Children.map([y],h=>{const c="data-i18n-is-dynamic-list",S={key:V,[c]:void 0};return h&&h.props&&Object.keys(h.props).forEach($=>{$==="ref"||$==="children"||$==="i18nIsDynamicList"||$===c||(S[$]=h.props[$])}),b.cloneElement(h,S,W?null:k)}))},p=(y,k,N)=>{const V=B(y);return B(k).reduce((h,c,S)=>{const $=c.children?.[0]?.content&&r.services.interpolator.interpolate(c.children[0].content,m,r.language);if(c.type==="tag"){let T=V[parseInt(c.name,10)];!T&&s&&(T=s[c.name]),N.length===1&&!T&&(T=N[0][c.name]),T||(T={});const R={...c.attrs};o&&Object.keys(R).forEach(E=>{const F=R[E];q(F)&&(R[E]=Le(F))});const w=Object.keys(R).length!==0?Kt({props:R},T):T,D=b.isValidElement(w),g=D&&ee(c,!0)&&!c.voidElement,C=f&&M(w)&&w.dummy&&!D,_=M(s)&&Object.hasOwnProperty.call(s,c.name);if(q(w)){const E=r.services.interpolator.interpolate(w,m,r.language);h.push(E)}else if(ee(w)||g){const E=d(w,c,N);O(w,E,h,S)}else if(C){const E=p(V,c.children,N);O(w,E,h,S)}else if(Number.isNaN(parseFloat(c.name)))if(_){const E=d(w,c,N);O(w,E,h,S,c.voidElement)}else if(a.transSupportBasicHtmlNodes&&u.indexOf(c.name)>-1)if(c.voidElement)h.push(b.createElement(c.name,{key:`${c.name}-${S}`}));else{const E=p(V,c.children,N);h.push(b.createElement(c.name,{key:`${c.name}-${S}`},E))}else if(c.voidElement)h.push(`<${c.name} />`);else{const E=p(V,c.children,N);h.push(`<${c.name}>${E}</${c.name}>`)}else if(M(w)&&!D){const E=c.children[0]?$:null;E&&h.push(E)}else O(w,$,h,S,c.children.length!==1||!$)}else if(c.type==="text"){const T=a.transWrapTextNodes,R=typeof a.unescape=="function"?a.unescape:ke().unescape,w=o?R(r.services.interpolator.interpolate(c.content,m,r.language)):r.services.interpolator.interpolate(c.content,m,r.language);T?h.push(b.createElement(T,{key:`${c.name}-${S}`},w)):h.push(w)}return h},[])},P=p([{dummy:!0,children:t||[]}],A,B(t||[]));return te(P[0])},Ve=(t,s,n)=>{const r=t.key||s,a=b.cloneElement(t,{key:r});if(!a.props||!a.props.children||n.indexOf(`${s}/>`)<0&&n.indexOf(`${s} />`)<0)return a;function i(){return b.createElement(b.Fragment,null,a)}return b.createElement(i,{key:r})},Jt=(t,s)=>t.map((n,r)=>Ve(n,r,s)),Xt=(t,s)=>{const n={};return Object.keys(t).forEach(r=>{Object.assign(n,{[r]:Ve(t[r],r,s)})}),n},es=(t,s,n,r)=>t?Array.isArray(t)?Jt(t,s):M(t)?Xt(t,s):(Ce(n,"TRANS_INVALID_COMPONENTS",'<Trans /> "components" prop expects an object or array',{i18nKey:r}),null):null,ts=t=>!M(t)||Array.isArray(t)?!1:Object.keys(t).reduce((s,n)=>s&&Number.isNaN(Number.parseFloat(n)),!0);function ss({children:t,count:s,parent:n,i18nKey:r,context:a,tOptions:i={},values:o,defaults:u,components:f,ns:l,i18n:x,t:v,shouldUnescape:A,...m}){const d=x||Ae();if(!d)return Ce(d,"NO_I18NEXT_INSTANCE","Trans: You need to pass in an i18next instance using i18nextReactModule",{i18nKey:r}),t;const O=v||d.t.bind(d)||(Q=>Q),p={...ke(),...d.options?.react};let P=l||O.ns||d.options?.defaultNS;P=q(P)?[P]:P||["translation"];const{transDefaultProps:y}=p,k=y?.tOptions?{...y.tOptions,...i}:i,N=A??y?.shouldUnescape,V=y?.values?{...y.values,...o}:o,W=y?.components?{...y.components,...f}:f,h=Pe(t,p,d,r),c=u||k?.defaultValue||h||p.transEmptyNodeValue||(typeof r=="function"?Fe(r):r),{hashTransKey:S}=p,$=r||(S?S(h||c):h||c);d.options?.interpolation?.defaultVariables?o=V&&Object.keys(V).length>0?{...V,...d.options.interpolation.defaultVariables}:{...d.options.interpolation.defaultVariables}:o=V;const T=Zt(t);T&&typeof T.count=="number"&&s===void 0&&(s=T.count);const R=o||s!==void 0&&!d.options?.interpolation?.alwaysFormat||!t?k.interpolation:{interpolation:{...k.interpolation,prefix:"#$?",suffix:"?$#"}},w={...k,context:a||k.context,count:s,...o,...R,defaultValue:c,ns:P};let D=$?O($,w):c;D===$&&c&&(D=c);const g=es(W,D,d,r);let C=g||t,_=null;ts(g)&&(_=g,C=t);const E=Yt(C,_,D,d,p,w,N),F=n??p.defaultTransParent;return F?b.createElement(F,m,E):E}function Ne({children:t,count:s,parent:n,i18nKey:r,context:a,tOptions:i={},values:o,defaults:u,components:f,ns:l,i18n:x,t:v,shouldUnescape:A,...m}){const{i18n:d,defaultNS:O}=b.useContext(Ue)||{},p=x||d||Ae(),P=v||p?.t.bind(p);return ss({children:t,count:s,parent:n,i18nKey:r,context:a,tOptions:i,values:o,defaults:u,components:f,ns:l||P?.ns||O||p?.options?.defaultNS,i18n:p,t:v,shouldUnescape:A,...m})}async function ns(){const t=await fetch("/api/cliproxy/sync/status");if(!t.ok){let s="Failed to fetch sync status";try{const n=await t.json();s=n.error||n.message||s}catch{}throw new Error(s)}return t.json()}async function rs(){const t=new AbortController,s=setTimeout(()=>t.abort(),3e4);try{const n=await fetch("/api/cliproxy/sync",{method:"POST",headers:{"Content-Type":"application/json"},signal:t.signal});if(!n.ok){let r="Sync failed";try{const a=await n.json();r=a.error||a.message||r}catch{}throw new Error(r)}return n.json()}catch(n){throw n instanceof Error&&n.name==="AbortError"?new Error("Sync request timed out after 30 seconds"):n}finally{clearTimeout(s)}}function as(){return Ee({queryKey:["cliproxy-sync-status"],queryFn:ns,refetchInterval:3e4,retry:1,staleTime:1e4})}function is(){const t=yt(),{t:s}=pe();return jt({mutationFn:rs,onSuccess:n=>{t.invalidateQueries({queryKey:["cliproxy-sync-status"]}),t.invalidateQueries({queryKey:["cliproxy-sync-preview"]}),n.syncedCount===0?oe.info(s("toasts.noProfilesToSync")):oe.success(`Synced ${n.syncedCount} profile${n.syncedCount===1?"":"s"} to CLIProxy`)},onError:n=>{oe.error(s("toasts.syncFailed",{error:n.message}))}})}function Se(t){return t.replace(/-\d+$/,"").split(".").map(Number)}function xe(t,s){const n=Se(t),r=Se(s);for(let a=0;a<3;a+=1){const i=n[a]||0,o=r[a]||0;if(i>o)return 1;if(i<o)return-1}return 0}function ue(t,s){return xe(t,s)>0}function de(t,s,n){return xe(t,s)>=0&&xe(t,n)<=0}const me={"round-robin":{title:"Round Robin",description:"Spread requests across matching accounts for even usage."},"fill-first":{title:"Fill First",description:"Drain one healthy account first and keep backups untouched until needed."}};function we({className:t,compact:s=!1,state:n,sessionAffinityState:r,isLoading:a,isSaving:i,error:o,onApply:u,onApplyAffinity:f}){const{t:l}=pe(),x=n?.strategy??"round-robin",v=r?.enabled??!1,A=r?.ttl??"1h",m=r?.manageable??!0,[d,O]=b.useState(x),[p,P]=b.useState(v),[y,k]=b.useState(A),[N,V]=b.useState(!1),W=n?.source==="live"?"Live CLIProxy":"Saved startup default",h=a||i||!n||d===x,c=N?"Hide details":"Show details",S=a||i||!!o||!m,$=l(m?p?"routingGuidance.disableSessionAffinity":"routingGuidance.enableSessionAffinity":"routingGuidance.sessionAffinityUnavailable"),T=b.useRef(null),R=b.useRef(!1);b.useEffect(()=>{O(x)},[x]),b.useEffect(()=>{P(v),k(A)},[v,A]),b.useEffect(()=>{if(i||!T.current)return;const g=T.current;g.enabled===v&&g.ttl===A||(P(v),k(A)),T.current=null},[i,v,A]);const w=()=>{if(!m)return;const g=!p,C=y.trim()||"1h";T.current={enabled:g,ttl:C},P(g),f({enabled:g,ttl:C})},D=()=>{if(!m||o)return;if(R.current){R.current=!1;return}const g=y.trim()||"1h";g!==A&&(T.current={enabled:p,ttl:g},f({enabled:p,ttl:g}))};if(s){const g=C=>{O(C),C!==x&&u(C)};return e.jsxs("div",{className:I("group/routing mt-1 space-y-2 -mx-1 rounded-lg p-1",t),children:[e.jsxs("div",{className:"flex items-center justify-between rounded-lg transition-colors hover:bg-primary/5",children:[e.jsxs("div",{className:"flex items-center gap-2 px-1 text-xs font-medium text-foreground",children:[e.jsxs("div",{className:"relative flex h-6 w-6 shrink-0 items-center justify-center rounded-md bg-background border border-border/60 text-muted-foreground shadow-sm overflow-hidden transition-all duration-300 group-hover/routing:border-primary/40 group-hover/routing:text-primary group-hover/routing:shadow-[0_0_12px_rgba(59,130,246,0.15)] dark:group-hover/routing:shadow-[0_0_12px_rgba(59,130,246,0.1)]",children:[e.jsx("div",{className:"absolute inset-0 bg-primary/10 translate-y-full group-hover/routing:translate-y-0 transition-transform duration-300 ease-out"}),e.jsx(ye,{className:"relative z-10 h-3.5 w-3.5 transition-transform duration-300 group-hover/routing:scale-110"})]}),e.jsx("span",{className:"tracking-tight transition-colors duration-300 group-hover/routing:text-primary group-hover/routing:font-semibold",children:"Routing"}),i&&e.jsx(K,{className:"ml-1 h-3 w-3 shrink-0 animate-spin text-primary"})]}),e.jsxs("div",{className:"relative grid grid-cols-2 p-0.5 gap-0.5 rounded-lg border border-border/60 bg-muted/30 shadow-[inset_0_1px_2px_rgba(0,0,0,0.05)] dark:shadow-[inset_0_1px_3px_rgba(0,0,0,0.2)] transition-colors duration-300 group-hover/routing:border-primary/20 group-hover/routing:bg-primary/5",children:[e.jsx("div",{className:I("absolute inset-y-0.5 left-0.5 w-[calc(50%-0.1875rem)] rounded bg-background shadow-[0_1px_3px_rgba(0,0,0,0.1),0_1px_2px_rgba(0,0,0,0.06)] ring-1 ring-black/5 dark:ring-white/10 transition-all duration-300",d==="fill-first"?"translate-x-[calc(100%+0.125rem)]":"translate-x-0","group-hover/routing:shadow-[0_0_8px_rgba(59,130,246,0.15)] dark:group-hover/routing:shadow-[0_0_8px_rgba(59,130,246,0.1)] group-hover/routing:ring-primary/30"),style:{transitionTimingFunction:"cubic-bezier(0.175, 0.885, 0.32, 1.275)"}}),Object.entries(me).map(([C,_])=>{const E=d===C;return e.jsx("button",{type:"button",className:I("relative z-10 flex items-center justify-center rounded px-2.5 py-0.5 text-[10px] font-medium whitespace-nowrap transition-colors duration-200",E?"text-foreground group-hover/routing:text-primary":"text-muted-foreground/70 hover:text-foreground/90 group-hover/routing:text-muted-foreground/90"),onClick:()=>g(C),disabled:a||i||!!o,title:_.description,children:_.title},C)})]})]}),e.jsxs("div",{className:"flex items-center justify-between gap-2 rounded-lg border border-border/60 bg-muted/20 px-2 py-1.5",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsx("div",{className:"text-[10px] font-medium text-foreground",children:l("routingGuidance.sessionAffinity")}),e.jsx("div",{className:"text-[10px] text-muted-foreground",children:m?l("routingGuidance.ttlBadge",{ttl:A}):l("routingGuidance.localOnlySetting")})]}),e.jsxs("div",{className:"flex items-center gap-1",children:[m?e.jsx("input",{"aria-label":"Session affinity TTL",className:"h-6 w-14 rounded border border-border/70 bg-background px-2 text-[10px] text-foreground",value:y,onChange:C=>k(C.target.value),onBlur:D,disabled:S}):null,e.jsx("button",{type:"button","aria-label":$,className:I("rounded border px-2 py-1 text-[10px] font-medium transition-colors",m?"border-border/70 bg-background text-foreground hover:border-primary/40 hover:text-primary":"border-border/60 bg-muted/40 text-muted-foreground"),onMouseDown:()=>{R.current=!0},onClick:w,disabled:S,title:r?.message,children:l(m?p?"routingGuidance.sessionAffinityOn":"routingGuidance.sessionAffinityOff":"routingGuidance.sessionAffinityUnavailable")})]})]}),r?.message?e.jsx("div",{className:"rounded-lg border border-border/60 bg-muted/20 px-2 py-1.5 text-[10px] text-muted-foreground",children:r.message}):null]})}return e.jsx("section",{className:I("rounded-xl border border-border/70 bg-background",t),children:e.jsxs("div",{className:"grid gap-3 px-4 py-3 xl:grid-cols-[minmax(0,1fr)_auto] xl:items-start",children:[e.jsxs("div",{className:"min-w-0 space-y-2",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsx("div",{className:"inline-flex h-7 w-7 items-center justify-center rounded-lg bg-muted text-primary",children:e.jsx(ye,{className:"h-4 w-4"})}),e.jsx("div",{className:"text-sm font-medium",children:l("routingGuidance.routingStrategy")}),e.jsx(U,{variant:"secondary",children:x}),n?e.jsx(U,{variant:"outline",children:W}):null,n?e.jsx(U,{variant:"outline",children:n.target}):null]}),e.jsx("p",{className:"max-w-3xl text-xs leading-5 text-muted-foreground",children:"Proxy-wide account rotation. CCS keeps round-robin as the default until you explicitly change it."})]}),e.jsxs("div",{className:"flex flex-col gap-2 xl:items-end",children:[e.jsx("div",{className:"inline-flex flex-wrap rounded-lg border border-border/70 bg-muted/35 p-1",children:Object.entries(me).map(([g,C])=>{const _=d===g;return e.jsx("button",{type:"button",className:I("rounded-md px-3 py-1.5 text-sm font-medium transition-colors",_?"bg-background text-foreground shadow-sm":"text-muted-foreground hover:text-foreground"),onClick:()=>O(g),disabled:a||i||!!o,children:C.title},g)})}),e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsxs(Z,{type:"button",variant:"ghost",size:"sm",className:"h-8 px-2 text-xs text-muted-foreground",onClick:()=>V(g=>!g),children:[N?e.jsx(Nt,{className:"mr-1 h-3.5 w-3.5"}):e.jsx(St,{className:"mr-1 h-3.5 w-3.5"}),c]}),e.jsx(Z,{size:"sm",onClick:()=>u(d),disabled:h||!!o,children:i?"Saving...":`Use ${d}`})]})]}),e.jsxs("div",{className:"flex flex-wrap items-center gap-x-2 gap-y-1 text-[11px] text-muted-foreground xl:col-span-2",children:[e.jsx("span",{children:l("routingGuidance.roundRobin")}),e.jsx("span",{className:"hidden text-border sm:inline",children:"•"}),e.jsx("span",{children:l("routingGuidance.fillFirst")})]}),e.jsxs("div",{className:"grid gap-3 rounded-lg border border-border/70 bg-muted/20 px-3 py-3 xl:col-span-2",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsx("div",{className:"text-sm font-medium",children:l("routingGuidance.sessionAffinity")}),e.jsx(U,{variant:"secondary",children:l(p?"routingGuidance.sessionAffinityOn":"routingGuidance.sessionAffinityOff")}),r?.ttl?e.jsx(U,{variant:"outline",children:l("routingGuidance.ttlBadge",{ttl:A})}):null,m?null:e.jsx(U,{variant:"outline",children:l("routingGuidance.localOnly")})]}),e.jsx("p",{className:"text-xs leading-5 text-muted-foreground",children:l("routingGuidance.sessionAffinityDescription")}),e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsx("input",{"aria-label":"Session affinity TTL",className:"h-9 w-24 rounded-md border border-border/70 bg-background px-3 text-sm text-foreground",value:y,onChange:g=>k(g.target.value),onBlur:D,disabled:S}),e.jsx(Z,{type:"button",variant:"outline",onMouseDown:()=>{R.current=!0},onClick:w,disabled:S,"aria-label":$,children:$})]}),r?.message?e.jsx("div",{className:"rounded-lg border border-border/70 bg-background/70 px-3 py-2 text-xs text-muted-foreground",children:r.message}):null]}),o?e.jsx("div",{className:"rounded-lg border border-destructive/25 bg-destructive/5 px-3 py-2 text-sm xl:col-span-2",children:o.message}):null,!o&&n?.message?e.jsx("div",{className:"rounded-lg border border-border/70 bg-muted/35 px-3 py-2 text-xs text-muted-foreground xl:col-span-2",children:n.message}):null,N?e.jsxs("div",{className:"grid gap-4 border-t border-border/60 pt-3 md:grid-cols-2 xl:col-span-2",children:[Object.entries(me).map(([g,C])=>{const _=x===g;return e.jsxs("div",{className:"space-y-1",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsx("div",{className:"text-sm font-medium",children:C.title}),_?e.jsx(U,{variant:"secondary",children:"Current"}):null]}),e.jsx("p",{className:"text-xs leading-5 text-muted-foreground",children:C.description})]},g)}),e.jsxs("div",{className:"space-y-1 md:col-span-2",children:[e.jsx("div",{className:"text-sm font-medium",children:l("routingGuidance.sessionRecognitionTitle")}),e.jsx("p",{className:"text-xs leading-5 text-muted-foreground",children:l("routingGuidance.sessionRecognitionDescription")})]})]}):null]})})}function os(t){if(!t)return"";const s=new Date(t).getTime(),r=Date.now()-s,a=Math.floor(r/(1e3*60*60)),i=Math.floor(r%(1e3*60*60)/(1e3*60));return a>0?`${a}h ${i}m`:`${i}m`}function ls(t,s){if(!t)return"";const n=Date.now()-t,r=Math.floor(n/(1e3*60)),a=Math.floor(n/(1e3*60*60));return r<1?s("proxyStatusWidget.justNow"):r<60?s("proxyStatusWidget.minutesAgo",{count:r}):s("proxyStatusWidget.hoursAgo",{count:a})}function X({icon:t,tooltip:s,onClick:n,disabled:r,isPending:a,className:i,variant:o="ghost"}){return e.jsxs(ot,{children:[e.jsx(lt,{asChild:!0,children:e.jsx(Z,{variant:o==="destructive-ghost"?"ghost":o,size:"sm",className:I("h-7 w-7 p-0",o==="destructive-ghost"&&"hover:bg-destructive/10 hover:text-destructive hover:border-destructive/30",i),onClick:n,disabled:r,children:a?e.jsx(K,{className:"w-3.5 h-3.5 animate-spin"}):e.jsx(t,{className:"w-3.5 h-3.5"})})}),e.jsx(ct,{side:"bottom",className:"text-xs",children:s})]})}function fs(){const{t}=pe(),{data:s,isLoading:n}=Ge(),{data:r}=Me(),{data:a,isLoading:i}=Be(),{data:o,isLoading:u,error:f}=qe(),l=ze(),{data:x,isLoading:v,error:A}=He(),m=Ke(),d=l.isPending||m.isPending,O=f instanceof Error?f:null,p=Ze(),P=Qe(),y=Ye(),k=Je(),{data:N}=as(),{mutate:V,isPending:W}=is(),[h,c]=b.useState(!1),[S,$]=b.useState(""),[T,R]=b.useState(!1),[w,D]=b.useState(null),[g,C]=b.useState(null),{data:_}=Ee({queryKey:["cliproxy-server-config"],queryFn:()=>ut.cliproxyServer.get(),staleTime:3e4}),E=vt({mutationKey:["update-backend"]})>0,F=_?.remote,Q=F?.enabled&&F?.host,G=x??(A instanceof Error?{source:"unsupported",target:o?.target??(Q?"remote":"local"),reachable:!1,manageable:!1,message:A.message}:void 0),Y=s?.running??!1,se=p.isPending||P.isPending||y.isPending||k.isPending||E||W,$e=r?.hasUpdate??!1,z=r?.isStable===!1,ge=r?.currentVersion,J=N?.configured??!1,Oe=t(J?"proxyStatusWidget.syncReady":"proxyStatusWidget.noConfig"),ne=z?r?.maxStableVersion||a?.latestStable:r?.latestVersion,fe=a?.maxStableVersion||r?.maxStableVersion||"6.6.80",H=a?.faultyRange,Re=H&&`${H.min.replace(/-\d+$/,"")}-${H.max.replace(/-\d+$/,"")}`,re=(j,L)=>{D(j),C(L),R(!0)},he=async j=>{if(!j)return;const L=ue(j,fe);if(H!==void 0&&de(j,H.min,H.max)){re(j,"faulty");return}if(L){re(j,"experimental");return}try{const be=await k.mutateAsync({version:j});be.requiresConfirmation&&re(j,be.isFaulty?"faulty":"experimental")}catch{}},De=()=>{w&&k.mutate({version:w,force:!0}),R(!1),D(null),C(null)},We=()=>{R(!1),D(null),C(null)},_e=Q?(()=>{const j=F.protocol||"http",L=F.port||(j==="https"?443:80);return j==="https"&&L===443||j==="http"&&L===80?F.host:`${F.host}:${L}`})():null;return Q?e.jsxs("div",{className:I("rounded-lg border p-3 transition-colors","border-blue-500/30 bg-blue-500/5"),children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(wt,{className:"w-4 h-4 text-blue-500"}),e.jsx("span",{className:"text-sm font-medium",children:t("proxyStatusWidget.remoteProxy")}),e.jsx(U,{variant:"secondary",className:"text-[10px] h-4 px-1.5 bg-blue-100 text-blue-700 dark:bg-blue-900/30 dark:text-blue-400",children:t("proxyStatusWidget.active")})]}),e.jsx(Ct,{className:"w-3 h-3 text-blue-600"})]}),e.jsxs("div",{className:"mt-2 text-xs text-muted-foreground",children:[e.jsx("div",{className:"flex items-center gap-1 mb-1",children:e.jsx("span",{className:"font-mono",children:_e})}),e.jsx("p",{className:"text-[10px] text-muted-foreground/70 leading-tight",children:t("proxyStatusWidget.trafficAutoRouted")})]}),e.jsx(we,{compact:!0,className:"mt-3",state:o,sessionAffinityState:G,isLoading:u||v,isSaving:d,error:O,onApply:j=>l.mutate(j),onApplyAffinity:j=>m.mutate(j)},`remote:${o?.strategy??"round-robin"}:${G?.enabled??"na"}:${G?.ttl??"na"}:${G?.manageable??"na"}`)]}):e.jsx(Xe,{delayDuration:300,children:e.jsxs("div",{className:I("rounded-lg border p-3 transition-colors",Y?"border-green-500/30 bg-green-500/5":"border-muted bg-muted/30"),children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:I("w-2 h-2 rounded-full",Y?"bg-green-500 animate-pulse":"bg-muted-foreground/30")}),e.jsx("span",{className:"text-sm font-medium",children:r?.backendLabel??"CLIProxy"})]}),e.jsxs("div",{className:"flex items-center gap-1",children:[n?e.jsx(K,{className:"w-3 h-3 animate-spin text-muted-foreground"}):Y?e.jsxs(e.Fragment,{children:[e.jsx(X,{icon:W?K:At,tooltip:t("proxyStatusWidget.tooltipSync"),onClick:()=>V(),disabled:!J||se,isPending:W}),e.jsx(X,{icon:kt,tooltip:t("proxyStatusWidget.tooltipRestart"),onClick:()=>y.mutate(),disabled:se,isPending:y.isPending}),e.jsx(X,{icon:Et,tooltip:t("proxyStatusWidget.tooltipStop"),onClick:()=>P.mutate(),disabled:se,isPending:P.isPending,variant:"destructive-ghost"})]}):null,e.jsx(X,{icon:h?Tt:Pt,tooltip:t(h?"proxyStatusWidget.tooltipClose":"proxyStatusWidget.tooltipVersionSettings"),onClick:()=>c(!h),className:h?"bg-muted":void 0})]})]}),ge&&e.jsxs("div",{className:"mt-1.5 flex items-center gap-2",children:[e.jsxs("span",{className:I("text-xs font-mono text-muted-foreground",z&&"text-amber-600 dark:text-amber-400"),children:["v",ge]}),($e||z)&&ne&&e.jsxs(U,{variant:"secondary",className:I("text-[10px] h-4 px-1.5 gap-0.5 cursor-pointer transition-colors",z?"bg-amber-100 text-amber-700 hover:bg-amber-200 dark:bg-amber-900/30 dark:text-amber-400 dark:hover:bg-amber-900/50":"bg-green-100 text-green-700 hover:bg-green-200 dark:bg-green-900/30 dark:text-green-400 dark:hover:bg-green-900/50"),onClick:()=>void he(ne),title:t(z?"proxyStatusWidget.clickToDowngrade":"proxyStatusWidget.clickToUpdate"),children:[z?e.jsx(Vt,{className:"w-2.5 h-2.5"}):e.jsx($t,{className:"w-2.5 h-2.5"}),ne]})]}),Y&&s&&e.jsxs("div",{className:"mt-2 flex items-center gap-4 text-xs text-muted-foreground",children:[e.jsx("span",{className:"flex items-center gap-1",children:t("proxyStatusWidget.port",{port:s.port})}),s.sessionCount!==void 0&&s.sessionCount>0&&e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(Ot,{className:"w-3 h-3"}),t("proxyStatusWidget.sessionCount",{count:s.sessionCount})]}),s.startedAt&&e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(Rt,{className:"w-3 h-3"}),os(s.startedAt)]})]}),e.jsxs("div",{className:"mt-2 flex items-center gap-1.5 text-xs",children:[J?e.jsx(Dt,{className:"w-3 h-3 text-green-600 dark:text-green-400"}):e.jsx(Wt,{className:"w-3 h-3 text-muted-foreground"}),e.jsx("span",{className:I("text-xs",J?"text-green-600 dark:text-green-400":"text-muted-foreground"),children:Oe})]}),e.jsx(we,{compact:!0,className:"mt-3",state:o,sessionAffinityState:G,isLoading:u||v,isSaving:d,error:O,onApply:j=>l.mutate(j),onApplyAffinity:j=>m.mutate(j)},`local:${o?.strategy??"round-robin"}:${G?.enabled??"na"}:${G?.ttl??"na"}:${G?.manageable??"na"}`),e.jsx(et,{open:h,onOpenChange:c,children:e.jsxs(tt,{className:"mt-3 pt-3 border-t border-muted",children:[e.jsx("h4",{className:"text-xs font-medium text-muted-foreground mb-3",children:t("proxyStatusWidget.versionManagement")}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs(st,{value:S,onValueChange:$,disabled:i,children:[e.jsx(nt,{className:"h-8 text-xs flex-1",children:e.jsx(rt,{placeholder:t("proxyStatusWidget.selectVersionPlaceholder")})}),e.jsx(at,{children:a?.versions.slice(0,20).map(j=>{const L=a?.maxStableVersion&&ue(j,a.maxStableVersion),ae=a?.faultyRange&&de(j,a.faultyRange.min,a.faultyRange.max);return e.jsx(it,{value:j,className:"text-xs",children:e.jsxs("span",{className:"flex items-center gap-2",children:["v",j,j===a.latestStable&&e.jsx("span",{className:"text-green-600 dark:text-green-400",children:t("proxyStatusWidget.stable")}),(ae||L)&&e.jsx("span",{className:"text-amber-600 dark:text-amber-400",children:"⚠"})]})},j)})})]}),e.jsxs(Z,{variant:"outline",size:"sm",className:"h-8 text-xs gap-1.5 px-3",onClick:()=>void he(S),disabled:k.isPending||!S,children:[k.isPending?e.jsx(K,{className:"w-3.5 h-3.5 animate-spin"}):e.jsx(_t,{className:"w-3.5 h-3.5"}),t("proxyStatusWidget.install")]})]}),S&&a?.maxStableVersion&&ue(S,a.maxStableVersion)&&e.jsxs("div",{className:"mt-2 flex items-center gap-1.5 text-[11px] text-amber-600 dark:text-amber-400",children:[e.jsx(le,{className:"w-3.5 h-3.5 flex-shrink-0"}),e.jsx("span",{children:t("proxyStatusWidget.versionsAboveUnstable",{version:a.maxStableVersion})})]}),S&&a?.faultyRange&&de(S,a.faultyRange.min,a.faultyRange.max)&&e.jsxs("div",{className:"mt-2 flex items-center gap-1.5 text-[11px] text-amber-600 dark:text-amber-400",children:[e.jsx(le,{className:"w-3.5 h-3.5 flex-shrink-0"}),e.jsx("span",{children:t("proxyStatusWidget.versionsKnownIssues",{version:S})})]}),r?.checkedAt&&e.jsx("div",{className:"mt-2 text-[10px] text-muted-foreground/60",children:t("proxyStatusWidget.lastChecked",{time:ls(r.checkedAt,t)})})]})}),!Y&&e.jsxs("div",{className:"mt-2 flex items-center justify-between",children:[e.jsx("span",{className:"text-xs text-muted-foreground",children:t("proxyStatusWidget.notRunning")}),e.jsxs(Z,{variant:"outline",size:"sm",className:"h-7 text-xs gap-1",onClick:()=>p.mutate(),disabled:p.isPending,children:[p.isPending?e.jsx(K,{className:"w-3 h-3 animate-spin"}):e.jsx(It,{className:"w-3 h-3"}),t("proxyStatusWidget.start")]})]}),e.jsx(dt,{open:T,onOpenChange:R,children:e.jsxs(mt,{children:[e.jsxs(xt,{children:[e.jsxs(pt,{className:"flex items-center gap-2",children:[e.jsx(le,{className:"w-5 h-5 text-amber-500"}),t(g==="faulty"?"proxyStatusWidget.installFaultyTitle":"proxyStatusWidget.installUnstableTitle")]}),e.jsxs(gt,{className:"space-y-2",children:[g==="faulty"?e.jsx("p",{children:e.jsx(Ne,{i18nKey:"proxyStatusWidget.installFaultyDesc",values:{version:w??"",range:Re||""},components:{strong:e.jsx("strong",{})}})}):e.jsx("p",{children:e.jsx(Ne,{i18nKey:"proxyStatusWidget.installUnstableDesc",values:{version:w??"",maxStable:fe},components:{strong:e.jsx("strong",{})}})}),e.jsx("p",{className:"text-amber-600 dark:text-amber-400",children:t(g==="faulty"?"proxyStatusWidget.installFaultyWarning":"proxyStatusWidget.installUnstableWarning")}),e.jsx("p",{children:t("proxyStatusWidget.installUnstableConfirm")})]})]}),e.jsxs(ft,{children:[e.jsx(ht,{onClick:We,children:t("proxyStatusWidget.cancel")}),e.jsx(bt,{onClick:De,className:"bg-amber-500 hover:bg-amber-600 text-white",children:t("proxyStatusWidget.installAnyway")})]})]})})]})})}export{fs as P};
|
|
1
|
+
import{j as e}from"./radix-ui-nu4wz29m.js";import{g as Ie,r as b}from"./react-vendor-Bjx91N7w.js";import{bG as Ce,bH as Ae,bI as ke,bJ as Le,bK as q,bL as ie,bM as M,bN as Fe,bO as Ue,a as pe,c as I,B as U,d as Z,bC as Ge,aZ as Me,bP as Be,bQ as qe,bR as ze,bS as He,bT as Ke,bU as Ze,bV as Qe,bW as Ye,bX as Xe,aM as Je,M as et,O as tt,r as st,s as nt,t as rt,v as at,w as it,T as ot,p as lt,q as ct,Y as ut}from"./index-BRtgic66.js";import{A as dt,a as mt,b as xt,c as pt,d as gt,e as ft,f as ht,g as bt}from"./alert-dialog-C6npAhT0.js";import{u as Ee,a as yt,b as jt,h as vt}from"./tanstack-bhJxV1h8.js";import{t as oe}from"./notifications-B4_o8bcr.js";import{be as ye,R as K,t as Nt,s as St,u as wt,A as Ct,bf as At,bg as kt,bh as Et,X as Tt,e as Pt,bi as Vt,bj as $t,U as Ot,v as Rt,m as Dt,w as Wt,aF as _t,T as le,aP as It}from"./icons-DQFHtVq5.js";var ce,je;function Lt(){return je||(je=1,ce={area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0}),ce}var Ft=Lt();const Ut=Ie(Ft);var Gt=/\s([^'"/\s><]+?)[\s/>]|([^\s=]+)=\s?(".*?"|'.*?')/g;function ve(t){var s={type:"tag",name:"",voidElement:!1,attrs:{},children:[]},n=t.match(/<\/?([^\s]+?)[/\s>]/);if(n&&(s.name=n[1],(Ut[n[1]]||t.charAt(t.length-2)==="/")&&(s.voidElement=!0),s.name.startsWith("!--"))){var r=t.indexOf("-->");return{type:"comment",comment:r!==-1?t.slice(4,r):""}}for(var a=new RegExp(Gt),i=null;(i=a.exec(t))!==null;)if(i[0].trim())if(i[1]){var o=i[1].trim(),u=[o,""];o.indexOf("=")>-1&&(u=o.split("=")),s.attrs[u[0]]=u[1],a.lastIndex--}else i[2]&&(s.attrs[i[2]]=i[3].trim().substring(1,i[3].length-1));return s}var Mt=/<[a-zA-Z0-9\-\!\/](?:"[^"]*"|'[^']*'|[^'">])*>/g,Bt=/^\s*$/,qt=Object.create(null);function Te(t,s){switch(s.type){case"text":return t+s.content;case"tag":return t+="<"+s.name+(s.attrs?(function(n){var r=[];for(var a in n)r.push(a+'="'+n[a]+'"');return r.length?" "+r.join(" "):""})(s.attrs):"")+(s.voidElement?"/>":">"),s.voidElement?t:t+s.children.reduce(Te,"")+"</"+s.name+">";case"comment":return t+"<!--"+s.comment+"-->"}}var zt={parse:function(t,s){s||(s={}),s.components||(s.components=qt);var n,r=[],a=[],i=-1,o=!1;if(t.indexOf("<")!==0){var u=t.indexOf("<");r.push({type:"text",content:u===-1?t:t.substring(0,u)})}return t.replace(Mt,function(f,l){if(o){if(f!=="</"+n.name+">")return;o=!1}var x,v=f.charAt(1)!=="/",A=f.startsWith("<!--"),m=l+f.length,d=t.charAt(m);if(A){var O=ve(f);return i<0?(r.push(O),r):((x=a[i]).children.push(O),r)}if(v&&(i++,(n=ve(f)).type==="tag"&&s.components[n.name]&&(n.type="component",o=!0),n.voidElement||o||!d||d==="<"||n.children.push({type:"text",content:t.slice(m,t.indexOf("<",m))}),i===0&&r.push(n),(x=a[i-1])&&x.children.push(n),a[i]=n),(!v||n.voidElement)&&(i>-1&&(n.voidElement||n.name===f.slice(2,-1))&&(i--,n=i===-1?r:a[i]),!o&&d!=="<"&&d)){x=i===-1?r:a[i].children;var p=t.indexOf("<",m),P=t.slice(m,p===-1?void 0:p);Bt.test(P)&&(P=" "),(p>-1&&i+x.length>=0||P!==" ")&&x.push({type:"text",content:P})}}),r},stringify:function(t){return t.reduce(function(s,n){return s+Te("",n)},"")}};const ee=(t,s)=>{if(!t)return!1;const n=t.props?.children??t.children;return s?n.length>0:!!n},te=t=>{if(!t)return[];const s=t.props?.children??t.children;return t.props?.i18nIsDynamicList?B(s):s},Ht=t=>Array.isArray(t)&&t.every(b.isValidElement),B=t=>Array.isArray(t)?t:[t],Kt=(t,s)=>{const n={...s};return n.props={...s.props,...t.props},n},Zt=t=>{const s={};if(!t)return s;const n=r=>{B(r).forEach(i=>{q(i)||(ee(i)?n(te(i)):M(i)&&!b.isValidElement(i)&&Object.assign(s,i))})};return n(t),s},Pe=(t,s,n,r)=>{if(!t)return"";let a="";const i=B(t),o=s?.transSupportBasicHtmlNodes?s.transKeepBasicHtmlNodesFor??[]:[];return i.forEach((u,f)=>{if(q(u)){a+=`${u}`;return}if(b.isValidElement(u)){const{props:l,type:x}=u,v=Object.keys(l).length,A=o.indexOf(x)>-1,m=l.children;if(!m&&A&&!v){a+=`<${x}/>`;return}if(!m&&(!A||v)||l.i18nIsDynamicList){a+=`<${f}></${f}>`;return}if(A&&v===1&&q(m)){a+=`<${x}>${m}</${x}>`;return}const d=Pe(m,s,n,r);a+=`<${f}>${d}</${f}>`;return}if(u===null){ie(n,"TRANS_NULL_VALUE","Passed in a null value as child",{i18nKey:r});return}if(M(u)){const{format:l,...x}=u,v=Object.keys(x);if(v.length===1){const A=l?`${v[0]}, ${l}`:v[0];a+=`{{${A}}}`;return}ie(n,"TRANS_INVALID_OBJ","Invalid child - Object should only have keys {{ value, format }} (format is optional).",{i18nKey:r,child:u});return}ie(n,"TRANS_INVALID_VAR","Passed in a variable like {number} - pass variables for interpolation as full objects like {{number}}.",{i18nKey:r,child:u})}),a},Qt=(t,s=[],n={})=>{if(!t)return t;const r=Object.keys(n),a=[...s,...r];let i="",o=0;for(;o<t.length;)if(t[o]==="<"){let u=!1;const f=t.slice(o).match(/^<\/(\d+|[a-zA-Z][a-zA-Z0-9_-]*)>/);if(f){const l=f[1];(/^\d+$/.test(l)||a.includes(l))&&(u=!0,i+=f[0],o+=f[0].length)}if(!u){const l=t.slice(o).match(/^<(\d+|[a-zA-Z][a-zA-Z0-9_-]*)(\s+[\w-]+(?:=(?:"[^"]*"|'[^']*'|[^\s>]+))?)*\s*(\/)?>/);if(l){const x=l[1];(/^\d+$/.test(x)||a.includes(x))&&(u=!0,i+=l[0],o+=l[0].length)}}u||(i+="<",o+=1)}else i+=t[o],o+=1;return i},Yt=(t,s,n,r,a,i,o)=>{if(n==="")return[];const u=a.transKeepBasicHtmlNodesFor||[],f=n&&new RegExp(u.map(y=>`<${y}`).join("|")).test(n);if(!t&&!s&&!f&&!o)return[n];const l=s??{},x=y=>{B(y).forEach(N=>{q(N)||(ee(N)?x(te(N)):M(N)&&!b.isValidElement(N)&&Object.assign(l,N))})};x(t);const v=Qt(n,u,l),A=zt.parse(`<0>${v}</0>`),m={...l,...i},d=(y,k,N)=>{const V=te(y),W=p(V,k.children,N);return Ht(V)&&W.length===0||y.props?.i18nIsDynamicList?V:W},O=(y,k,N,V,W)=>{y.dummy?(y.children=k,N.push(b.cloneElement(y,{key:V},W?void 0:k))):N.push(...b.Children.map([y],h=>{const c="data-i18n-is-dynamic-list",S={key:V,[c]:void 0};return h&&h.props&&Object.keys(h.props).forEach($=>{$==="ref"||$==="children"||$==="i18nIsDynamicList"||$===c||(S[$]=h.props[$])}),b.cloneElement(h,S,W?null:k)}))},p=(y,k,N)=>{const V=B(y);return B(k).reduce((h,c,S)=>{const $=c.children?.[0]?.content&&r.services.interpolator.interpolate(c.children[0].content,m,r.language);if(c.type==="tag"){let T=V[parseInt(c.name,10)];!T&&s&&(T=s[c.name]),N.length===1&&!T&&(T=N[0][c.name]),T||(T={});const R={...c.attrs};o&&Object.keys(R).forEach(E=>{const L=R[E];q(L)&&(R[E]=Fe(L))});const w=Object.keys(R).length!==0?Kt({props:R},T):T,D=b.isValidElement(w),g=D&&ee(c,!0)&&!c.voidElement,C=f&&M(w)&&w.dummy&&!D,_=M(s)&&Object.hasOwnProperty.call(s,c.name);if(q(w)){const E=r.services.interpolator.interpolate(w,m,r.language);h.push(E)}else if(ee(w)||g){const E=d(w,c,N);O(w,E,h,S)}else if(C){const E=p(V,c.children,N);O(w,E,h,S)}else if(Number.isNaN(parseFloat(c.name)))if(_){const E=d(w,c,N);O(w,E,h,S,c.voidElement)}else if(a.transSupportBasicHtmlNodes&&u.indexOf(c.name)>-1)if(c.voidElement)h.push(b.createElement(c.name,{key:`${c.name}-${S}`}));else{const E=p(V,c.children,N);h.push(b.createElement(c.name,{key:`${c.name}-${S}`},E))}else if(c.voidElement)h.push(`<${c.name} />`);else{const E=p(V,c.children,N);h.push(`<${c.name}>${E}</${c.name}>`)}else if(M(w)&&!D){const E=c.children[0]?$:null;E&&h.push(E)}else O(w,$,h,S,c.children.length!==1||!$)}else if(c.type==="text"){const T=a.transWrapTextNodes,R=typeof a.unescape=="function"?a.unescape:ke().unescape,w=o?R(r.services.interpolator.interpolate(c.content,m,r.language)):r.services.interpolator.interpolate(c.content,m,r.language);T?h.push(b.createElement(T,{key:`${c.name}-${S}`},w)):h.push(w)}return h},[])},P=p([{dummy:!0,children:t||[]}],A,B(t||[]));return te(P[0])},Ve=(t,s,n)=>{const r=t.key||s,a=b.cloneElement(t,{key:r});if(!a.props||!a.props.children||n.indexOf(`${s}/>`)<0&&n.indexOf(`${s} />`)<0)return a;function i(){return b.createElement(b.Fragment,null,a)}return b.createElement(i,{key:r})},Xt=(t,s)=>t.map((n,r)=>Ve(n,r,s)),Jt=(t,s)=>{const n={};return Object.keys(t).forEach(r=>{Object.assign(n,{[r]:Ve(t[r],r,s)})}),n},es=(t,s,n,r)=>t?Array.isArray(t)?Xt(t,s):M(t)?Jt(t,s):(Ce(n,"TRANS_INVALID_COMPONENTS",'<Trans /> "components" prop expects an object or array',{i18nKey:r}),null):null,ts=t=>!M(t)||Array.isArray(t)?!1:Object.keys(t).reduce((s,n)=>s&&Number.isNaN(Number.parseFloat(n)),!0);function ss({children:t,count:s,parent:n,i18nKey:r,context:a,tOptions:i={},values:o,defaults:u,components:f,ns:l,i18n:x,t:v,shouldUnescape:A,...m}){const d=x||Ae();if(!d)return Ce(d,"NO_I18NEXT_INSTANCE","Trans: You need to pass in an i18next instance using i18nextReactModule",{i18nKey:r}),t;const O=v||d.t.bind(d)||(Q=>Q),p={...ke(),...d.options?.react};let P=l||O.ns||d.options?.defaultNS;P=q(P)?[P]:P||["translation"];const{transDefaultProps:y}=p,k=y?.tOptions?{...y.tOptions,...i}:i,N=A??y?.shouldUnescape,V=y?.values?{...y.values,...o}:o,W=y?.components?{...y.components,...f}:f,h=Pe(t,p,d,r),c=u||k?.defaultValue||h||p.transEmptyNodeValue||(typeof r=="function"?Le(r):r),{hashTransKey:S}=p,$=r||(S?S(h||c):h||c);d.options?.interpolation?.defaultVariables?o=V&&Object.keys(V).length>0?{...V,...d.options.interpolation.defaultVariables}:{...d.options.interpolation.defaultVariables}:o=V;const T=Zt(t);T&&typeof T.count=="number"&&s===void 0&&(s=T.count);const R=o||s!==void 0&&!d.options?.interpolation?.alwaysFormat||!t?k.interpolation:{interpolation:{...k.interpolation,prefix:"#$?",suffix:"?$#"}},w={...k,context:a||k.context,count:s,...o,...R,defaultValue:c,ns:P};let D=$?O($,w):c;D===$&&c&&(D=c);const g=es(W,D,d,r);let C=g||t,_=null;ts(g)&&(_=g,C=t);const E=Yt(C,_,D,d,p,w,N),L=n??p.defaultTransParent;return L?b.createElement(L,m,E):E}function Ne({children:t,count:s,parent:n,i18nKey:r,context:a,tOptions:i={},values:o,defaults:u,components:f,ns:l,i18n:x,t:v,shouldUnescape:A,...m}){const{i18n:d,defaultNS:O}=b.useContext(Ue)||{},p=x||d||Ae(),P=v||p?.t.bind(p);return ss({children:t,count:s,parent:n,i18nKey:r,context:a,tOptions:i,values:o,defaults:u,components:f,ns:l||P?.ns||O||p?.options?.defaultNS,i18n:p,t:v,shouldUnescape:A,...m})}async function ns(){const t=await fetch("/api/cliproxy/sync/status");if(!t.ok){let s="Failed to fetch sync status";try{const n=await t.json();s=n.error||n.message||s}catch{}throw new Error(s)}return t.json()}async function rs(){const t=new AbortController,s=setTimeout(()=>t.abort(),3e4);try{const n=await fetch("/api/cliproxy/sync",{method:"POST",headers:{"Content-Type":"application/json"},signal:t.signal});if(!n.ok){let r="Sync failed";try{const a=await n.json();r=a.error||a.message||r}catch{}throw new Error(r)}return n.json()}catch(n){throw n instanceof Error&&n.name==="AbortError"?new Error("Sync request timed out after 30 seconds"):n}finally{clearTimeout(s)}}function as(){return Ee({queryKey:["cliproxy-sync-status"],queryFn:ns,refetchInterval:3e4,retry:1,staleTime:1e4})}function is(){const t=yt(),{t:s}=pe();return jt({mutationFn:rs,onSuccess:n=>{t.invalidateQueries({queryKey:["cliproxy-sync-status"]}),t.invalidateQueries({queryKey:["cliproxy-sync-preview"]}),n.syncedCount===0?oe.info(s("toasts.noProfilesToSync")):oe.success(`Synced ${n.syncedCount} profile${n.syncedCount===1?"":"s"} to CLIProxy`)},onError:n=>{oe.error(s("toasts.syncFailed",{error:n.message}))}})}function Se(t){return t.replace(/-\d+$/,"").split(".").map(Number)}function xe(t,s){const n=Se(t),r=Se(s);for(let a=0;a<3;a+=1){const i=n[a]||0,o=r[a]||0;if(i>o)return 1;if(i<o)return-1}return 0}function ue(t,s){return xe(t,s)>0}function de(t,s,n){return xe(t,s)>=0&&xe(t,n)<=0}const me={"round-robin":{title:"Round Robin",description:"Spread requests across matching accounts for even usage."},"fill-first":{title:"Fill First",description:"Drain one healthy account first and keep backups untouched until needed."}};function we({className:t,compact:s=!1,state:n,sessionAffinityState:r,isLoading:a,isSaving:i,error:o,onApply:u,onApplyAffinity:f}){const{t:l}=pe(),x=n?.strategy??"round-robin",v=r?.enabled??!1,A=r?.ttl??"1h",m=r?.manageable??!0,[d,O]=b.useState(x),[p,P]=b.useState(v),[y,k]=b.useState(A),[N,V]=b.useState(!1),W=n?.source==="live"?"Live CLIProxy":"Saved startup default",h=a||i||!n||d===x,c=N?"Hide details":"Show details",S=a||i||!!o||!m,$=l(m?p?"routingGuidance.disableSessionAffinity":"routingGuidance.enableSessionAffinity":"routingGuidance.sessionAffinityUnavailable"),T=b.useRef(null),R=b.useRef(!1);b.useEffect(()=>{O(x)},[x]),b.useEffect(()=>{P(v),k(A)},[v,A]),b.useEffect(()=>{if(i||!T.current)return;const g=T.current;g.enabled===v&&g.ttl===A||(P(v),k(A)),T.current=null},[i,v,A]);const w=()=>{if(!m)return;const g=!p,C=y.trim()||"1h";T.current={enabled:g,ttl:C},P(g),f({enabled:g,ttl:C})},D=()=>{if(!m||o)return;if(R.current){R.current=!1;return}const g=y.trim()||"1h";g!==A&&(T.current={enabled:p,ttl:g},f({enabled:p,ttl:g}))};if(s){const g=C=>{O(C),C!==x&&u(C)};return e.jsxs("div",{className:I("group/routing mt-1 space-y-2 -mx-1 rounded-lg p-1",t),children:[e.jsxs("div",{className:"flex items-center justify-between rounded-lg transition-colors hover:bg-primary/5",children:[e.jsxs("div",{className:"flex items-center gap-2 px-1 text-xs font-medium text-foreground",children:[e.jsxs("div",{className:"relative flex h-6 w-6 shrink-0 items-center justify-center rounded-md bg-background border border-border/60 text-muted-foreground shadow-sm overflow-hidden transition-all duration-300 group-hover/routing:border-primary/40 group-hover/routing:text-primary group-hover/routing:shadow-[0_0_12px_rgba(59,130,246,0.15)] dark:group-hover/routing:shadow-[0_0_12px_rgba(59,130,246,0.1)]",children:[e.jsx("div",{className:"absolute inset-0 bg-primary/10 translate-y-full group-hover/routing:translate-y-0 transition-transform duration-300 ease-out"}),e.jsx(ye,{className:"relative z-10 h-3.5 w-3.5 transition-transform duration-300 group-hover/routing:scale-110"})]}),e.jsx("span",{className:"tracking-tight transition-colors duration-300 group-hover/routing:text-primary group-hover/routing:font-semibold",children:"Routing"}),i&&e.jsx(K,{className:"ml-1 h-3 w-3 shrink-0 animate-spin text-primary"})]}),e.jsxs("div",{className:"relative grid grid-cols-2 p-0.5 gap-0.5 rounded-lg border border-border/60 bg-muted/30 shadow-[inset_0_1px_2px_rgba(0,0,0,0.05)] dark:shadow-[inset_0_1px_3px_rgba(0,0,0,0.2)] transition-colors duration-300 group-hover/routing:border-primary/20 group-hover/routing:bg-primary/5",children:[e.jsx("div",{className:I("absolute inset-y-0.5 left-0.5 w-[calc(50%-0.1875rem)] rounded bg-background shadow-[0_1px_3px_rgba(0,0,0,0.1),0_1px_2px_rgba(0,0,0,0.06)] ring-1 ring-black/5 dark:ring-white/10 transition-all duration-300",d==="fill-first"?"translate-x-[calc(100%+0.125rem)]":"translate-x-0","group-hover/routing:shadow-[0_0_8px_rgba(59,130,246,0.15)] dark:group-hover/routing:shadow-[0_0_8px_rgba(59,130,246,0.1)] group-hover/routing:ring-primary/30"),style:{transitionTimingFunction:"cubic-bezier(0.175, 0.885, 0.32, 1.275)"}}),Object.entries(me).map(([C,_])=>{const E=d===C;return e.jsx("button",{type:"button",className:I("relative z-10 flex items-center justify-center rounded px-2.5 py-0.5 text-[10px] font-medium whitespace-nowrap transition-colors duration-200",E?"text-foreground group-hover/routing:text-primary":"text-muted-foreground/70 hover:text-foreground/90 group-hover/routing:text-muted-foreground/90"),onClick:()=>g(C),disabled:a||i||!!o,title:_.description,children:_.title},C)})]})]}),e.jsxs("div",{className:"flex items-center justify-between gap-2 rounded-lg border border-border/60 bg-muted/20 px-2 py-1.5",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsx("div",{className:"text-[10px] font-medium text-foreground",children:l("routingGuidance.sessionAffinity")}),e.jsx("div",{className:"text-[10px] text-muted-foreground",children:m?l("routingGuidance.ttlBadge",{ttl:A}):l("routingGuidance.localOnlySetting")})]}),e.jsxs("div",{className:"flex items-center gap-1",children:[m?e.jsx("input",{"aria-label":"Session affinity TTL",className:"h-6 w-14 rounded border border-border/70 bg-background px-2 text-[10px] text-foreground",value:y,onChange:C=>k(C.target.value),onBlur:D,disabled:S}):null,e.jsx("button",{type:"button","aria-label":$,className:I("rounded border px-2 py-1 text-[10px] font-medium transition-colors",m?"border-border/70 bg-background text-foreground hover:border-primary/40 hover:text-primary":"border-border/60 bg-muted/40 text-muted-foreground"),onMouseDown:()=>{R.current=!0},onClick:w,disabled:S,title:r?.message,children:l(m?p?"routingGuidance.sessionAffinityOn":"routingGuidance.sessionAffinityOff":"routingGuidance.sessionAffinityUnavailable")})]})]}),r?.message?e.jsx("div",{className:"rounded-lg border border-border/60 bg-muted/20 px-2 py-1.5 text-[10px] text-muted-foreground",children:r.message}):null]})}return e.jsx("section",{className:I("rounded-xl border border-border/70 bg-background",t),children:e.jsxs("div",{className:"grid gap-3 px-4 py-3 xl:grid-cols-[minmax(0,1fr)_auto] xl:items-start",children:[e.jsxs("div",{className:"min-w-0 space-y-2",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsx("div",{className:"inline-flex h-7 w-7 items-center justify-center rounded-lg bg-muted text-primary",children:e.jsx(ye,{className:"h-4 w-4"})}),e.jsx("div",{className:"text-sm font-medium",children:l("routingGuidance.routingStrategy")}),e.jsx(U,{variant:"secondary",children:x}),n?e.jsx(U,{variant:"outline",children:W}):null,n?e.jsx(U,{variant:"outline",children:n.target}):null]}),e.jsx("p",{className:"max-w-3xl text-xs leading-5 text-muted-foreground",children:"Proxy-wide account rotation. CCS keeps round-robin as the default until you explicitly change it."})]}),e.jsxs("div",{className:"flex flex-col gap-2 xl:items-end",children:[e.jsx("div",{className:"inline-flex flex-wrap rounded-lg border border-border/70 bg-muted/35 p-1",children:Object.entries(me).map(([g,C])=>{const _=d===g;return e.jsx("button",{type:"button",className:I("rounded-md px-3 py-1.5 text-sm font-medium transition-colors",_?"bg-background text-foreground shadow-sm":"text-muted-foreground hover:text-foreground"),onClick:()=>O(g),disabled:a||i||!!o,children:C.title},g)})}),e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsxs(Z,{type:"button",variant:"ghost",size:"sm",className:"h-8 px-2 text-xs text-muted-foreground",onClick:()=>V(g=>!g),children:[N?e.jsx(Nt,{className:"mr-1 h-3.5 w-3.5"}):e.jsx(St,{className:"mr-1 h-3.5 w-3.5"}),c]}),e.jsx(Z,{size:"sm",onClick:()=>u(d),disabled:h||!!o,children:i?"Saving...":`Use ${d}`})]})]}),e.jsxs("div",{className:"flex flex-wrap items-center gap-x-2 gap-y-1 text-[11px] text-muted-foreground xl:col-span-2",children:[e.jsx("span",{children:l("routingGuidance.roundRobin")}),e.jsx("span",{className:"hidden text-border sm:inline",children:"•"}),e.jsx("span",{children:l("routingGuidance.fillFirst")})]}),e.jsxs("div",{className:"grid gap-3 rounded-lg border border-border/70 bg-muted/20 px-3 py-3 xl:col-span-2",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsx("div",{className:"text-sm font-medium",children:l("routingGuidance.sessionAffinity")}),e.jsx(U,{variant:"secondary",children:l(p?"routingGuidance.sessionAffinityOn":"routingGuidance.sessionAffinityOff")}),r?.ttl?e.jsx(U,{variant:"outline",children:l("routingGuidance.ttlBadge",{ttl:A})}):null,m?null:e.jsx(U,{variant:"outline",children:l("routingGuidance.localOnly")})]}),e.jsx("p",{className:"text-xs leading-5 text-muted-foreground",children:l("routingGuidance.sessionAffinityDescription")}),e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsx("input",{"aria-label":"Session affinity TTL",className:"h-9 w-24 rounded-md border border-border/70 bg-background px-3 text-sm text-foreground",value:y,onChange:g=>k(g.target.value),onBlur:D,disabled:S}),e.jsx(Z,{type:"button",variant:"outline",onMouseDown:()=>{R.current=!0},onClick:w,disabled:S,"aria-label":$,children:$})]}),r?.message?e.jsx("div",{className:"rounded-lg border border-border/70 bg-background/70 px-3 py-2 text-xs text-muted-foreground",children:r.message}):null]}),o?e.jsx("div",{className:"rounded-lg border border-destructive/25 bg-destructive/5 px-3 py-2 text-sm xl:col-span-2",children:o.message}):null,!o&&n?.message?e.jsx("div",{className:"rounded-lg border border-border/70 bg-muted/35 px-3 py-2 text-xs text-muted-foreground xl:col-span-2",children:n.message}):null,N?e.jsxs("div",{className:"grid gap-4 border-t border-border/60 pt-3 md:grid-cols-2 xl:col-span-2",children:[Object.entries(me).map(([g,C])=>{const _=x===g;return e.jsxs("div",{className:"space-y-1",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsx("div",{className:"text-sm font-medium",children:C.title}),_?e.jsx(U,{variant:"secondary",children:"Current"}):null]}),e.jsx("p",{className:"text-xs leading-5 text-muted-foreground",children:C.description})]},g)}),e.jsxs("div",{className:"space-y-1 md:col-span-2",children:[e.jsx("div",{className:"text-sm font-medium",children:l("routingGuidance.sessionRecognitionTitle")}),e.jsx("p",{className:"text-xs leading-5 text-muted-foreground",children:l("routingGuidance.sessionRecognitionDescription")})]})]}):null]})})}function os(t){if(!t)return"";const s=new Date(t).getTime(),r=Date.now()-s,a=Math.floor(r/(1e3*60*60)),i=Math.floor(r%(1e3*60*60)/(1e3*60));return a>0?`${a}h ${i}m`:`${i}m`}function ls(t,s){if(!t)return"";const n=Date.now()-t,r=Math.floor(n/(1e3*60)),a=Math.floor(n/(1e3*60*60));return r<1?s("proxyStatusWidget.justNow"):r<60?s("proxyStatusWidget.minutesAgo",{count:r}):s("proxyStatusWidget.hoursAgo",{count:a})}function J({icon:t,tooltip:s,onClick:n,disabled:r,isPending:a,className:i,variant:o="ghost"}){return e.jsxs(ot,{children:[e.jsx(lt,{asChild:!0,children:e.jsx(Z,{variant:o==="destructive-ghost"?"ghost":o,size:"sm",className:I("h-7 w-7 p-0",o==="destructive-ghost"&&"hover:bg-destructive/10 hover:text-destructive hover:border-destructive/30",i),onClick:n,disabled:r,children:a?e.jsx(K,{className:"w-3.5 h-3.5 animate-spin"}):e.jsx(t,{className:"w-3.5 h-3.5"})})}),e.jsx(ct,{side:"bottom",className:"text-xs",children:s})]})}function fs(){const{t}=pe(),{data:s,isLoading:n}=Ge(),{data:r}=Me(),{data:a,isLoading:i}=Be(),{data:o,isLoading:u,error:f}=qe(),l=ze(),{data:x,isLoading:v,error:A}=He(),m=Ke(),d=l.isPending||m.isPending,O=f instanceof Error?f:null,p=Ze(),P=Qe(),y=Ye(),k=Xe(),{data:N}=as(),{mutate:V,isPending:W}=is(),[h,c]=b.useState(!1),[S,$]=b.useState(""),[T,R]=b.useState(!1),[w,D]=b.useState(null),[g,C]=b.useState(null),{data:_}=Ee({queryKey:["cliproxy-server-config"],queryFn:()=>ut.cliproxyServer.get(),staleTime:3e4}),E=vt({mutationKey:["update-backend"]})>0,L=_?.remote,Q=L?.enabled&&L?.host,G=x??(A instanceof Error?{source:"unsupported",target:o?.target??(Q?"remote":"local"),reachable:!1,manageable:!1,message:A.message}:void 0),Y=s?.running??!1,se=p.isPending||P.isPending||y.isPending||k.isPending||E||W,$e=r?.hasUpdate??!1,z=r?.isStable===!1,ge=r?.currentVersion,X=N?.configured??!1,Oe=t(X?"proxyStatusWidget.syncReady":"proxyStatusWidget.noConfig"),ne=z?r?.maxStableVersion||a?.latestStable:r?.latestVersion,fe=a?.maxStableVersion||r?.maxStableVersion||"6.6.80",H=a?.faultyRange,Re=H&&`${H.min.replace(/-\d+$/,"")}-${H.max.replace(/-\d+$/,"")}`,re=(j,F)=>{D(j),C(F),R(!0)},he=async j=>{if(!j)return;const F=ue(j,fe);if(H!==void 0&&de(j,H.min,H.max)){re(j,"faulty");return}if(F){re(j,"experimental");return}try{const be=await k.mutateAsync({version:j});be.requiresConfirmation&&re(j,be.isFaulty?"faulty":"experimental")}catch{}},De=()=>{w&&k.mutate({version:w,force:!0}),R(!1),D(null),C(null)},We=()=>{R(!1),D(null),C(null)},_e=Q?(()=>{const j=L.protocol||"http",F=L.port||(j==="https"?443:80);return j==="https"&&F===443||j==="http"&&F===80?L.host:`${L.host}:${F}`})():null;return Q?e.jsxs("div",{className:I("rounded-lg border p-3 transition-colors","border-blue-500/30 bg-blue-500/5"),children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(wt,{className:"w-4 h-4 text-blue-500"}),e.jsx("span",{className:"text-sm font-medium",children:t("proxyStatusWidget.remoteProxy")}),e.jsx(U,{variant:"secondary",className:"text-[10px] h-4 px-1.5 bg-blue-100 text-blue-700 dark:bg-blue-900/30 dark:text-blue-400",children:t("proxyStatusWidget.active")})]}),e.jsx(Ct,{className:"w-3 h-3 text-blue-600"})]}),e.jsxs("div",{className:"mt-2 text-xs text-muted-foreground",children:[e.jsx("div",{className:"flex items-center gap-1 mb-1",children:e.jsx("span",{className:"font-mono",children:_e})}),e.jsx("p",{className:"text-[10px] text-muted-foreground/70 leading-tight",children:t("proxyStatusWidget.trafficAutoRouted")})]}),e.jsx(we,{compact:!0,className:"mt-3",state:o,sessionAffinityState:G,isLoading:u||v,isSaving:d,error:O,onApply:j=>l.mutate(j),onApplyAffinity:j=>m.mutate(j)},`remote:${o?.strategy??"round-robin"}:${G?.enabled??"na"}:${G?.ttl??"na"}:${G?.manageable??"na"}`)]}):e.jsx(Je,{delayDuration:300,children:e.jsxs("div",{className:I("rounded-lg border p-3 transition-colors",Y?"border-green-500/30 bg-green-500/5":"border-muted bg-muted/30"),children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:I("w-2 h-2 rounded-full",Y?"bg-green-500 animate-pulse":"bg-muted-foreground/30")}),e.jsx("span",{className:"text-sm font-medium",children:r?.backendLabel??"CLIProxy"})]}),e.jsxs("div",{className:"flex items-center gap-1",children:[n?e.jsx(K,{className:"w-3 h-3 animate-spin text-muted-foreground"}):Y?e.jsxs(e.Fragment,{children:[e.jsx(J,{icon:W?K:At,tooltip:t("proxyStatusWidget.tooltipSync"),onClick:()=>V(),disabled:!X||se,isPending:W}),e.jsx(J,{icon:kt,tooltip:t("proxyStatusWidget.tooltipRestart"),onClick:()=>y.mutate(),disabled:se,isPending:y.isPending}),e.jsx(J,{icon:Et,tooltip:t("proxyStatusWidget.tooltipStop"),onClick:()=>P.mutate(),disabled:se,isPending:P.isPending,variant:"destructive-ghost"})]}):null,e.jsx(J,{icon:h?Tt:Pt,tooltip:t(h?"proxyStatusWidget.tooltipClose":"proxyStatusWidget.tooltipVersionSettings"),onClick:()=>c(!h),className:h?"bg-muted":void 0})]})]}),ge&&e.jsxs("div",{className:"mt-1.5 flex items-center gap-2",children:[e.jsxs("span",{className:I("text-xs font-mono text-muted-foreground",z&&"text-amber-600 dark:text-amber-400"),children:["v",ge]}),($e||z)&&ne&&e.jsxs(U,{variant:"secondary",className:I("text-[10px] h-4 px-1.5 gap-0.5 cursor-pointer transition-colors",z?"bg-amber-100 text-amber-700 hover:bg-amber-200 dark:bg-amber-900/30 dark:text-amber-400 dark:hover:bg-amber-900/50":"bg-green-100 text-green-700 hover:bg-green-200 dark:bg-green-900/30 dark:text-green-400 dark:hover:bg-green-900/50"),onClick:()=>void he(ne),title:t(z?"proxyStatusWidget.clickToDowngrade":"proxyStatusWidget.clickToUpdate"),children:[z?e.jsx(Vt,{className:"w-2.5 h-2.5"}):e.jsx($t,{className:"w-2.5 h-2.5"}),ne]})]}),Y&&s&&e.jsxs("div",{className:"mt-2 flex items-center gap-4 text-xs text-muted-foreground",children:[e.jsx("span",{className:"flex items-center gap-1",children:t("proxyStatusWidget.port",{port:s.port})}),s.sessionCount!==void 0&&s.sessionCount>0&&e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(Ot,{className:"w-3 h-3"}),t("proxyStatusWidget.sessionCount",{count:s.sessionCount})]}),s.startedAt&&e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(Rt,{className:"w-3 h-3"}),os(s.startedAt)]})]}),e.jsxs("div",{className:"mt-2 flex items-center gap-1.5 text-xs",children:[X?e.jsx(Dt,{className:"w-3 h-3 text-green-600 dark:text-green-400"}):e.jsx(Wt,{className:"w-3 h-3 text-muted-foreground"}),e.jsx("span",{className:I("text-xs",X?"text-green-600 dark:text-green-400":"text-muted-foreground"),children:Oe})]}),e.jsx(we,{compact:!0,className:"mt-3",state:o,sessionAffinityState:G,isLoading:u||v,isSaving:d,error:O,onApply:j=>l.mutate(j),onApplyAffinity:j=>m.mutate(j)},`local:${o?.strategy??"round-robin"}:${G?.enabled??"na"}:${G?.ttl??"na"}:${G?.manageable??"na"}`),e.jsx(et,{open:h,onOpenChange:c,children:e.jsxs(tt,{className:"mt-3 pt-3 border-t border-muted",children:[e.jsx("h4",{className:"text-xs font-medium text-muted-foreground mb-3",children:t("proxyStatusWidget.versionManagement")}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs(st,{value:S,onValueChange:$,disabled:i,children:[e.jsx(nt,{className:"h-8 text-xs flex-1",children:e.jsx(rt,{placeholder:t("proxyStatusWidget.selectVersionPlaceholder")})}),e.jsx(at,{children:a?.versions.slice(0,20).map(j=>{const F=a?.maxStableVersion&&ue(j,a.maxStableVersion),ae=a?.faultyRange&&de(j,a.faultyRange.min,a.faultyRange.max);return e.jsx(it,{value:j,className:"text-xs",children:e.jsxs("span",{className:"flex items-center gap-2",children:["v",j,j===a.latestStable&&e.jsx("span",{className:"text-green-600 dark:text-green-400",children:t("proxyStatusWidget.stable")}),(ae||F)&&e.jsx("span",{className:"text-amber-600 dark:text-amber-400",children:"⚠"})]})},j)})})]}),e.jsxs(Z,{variant:"outline",size:"sm",className:"h-8 text-xs gap-1.5 px-3",onClick:()=>void he(S),disabled:k.isPending||!S,children:[k.isPending?e.jsx(K,{className:"w-3.5 h-3.5 animate-spin"}):e.jsx(_t,{className:"w-3.5 h-3.5"}),t("proxyStatusWidget.install")]})]}),S&&a?.maxStableVersion&&ue(S,a.maxStableVersion)&&e.jsxs("div",{className:"mt-2 flex items-center gap-1.5 text-[11px] text-amber-600 dark:text-amber-400",children:[e.jsx(le,{className:"w-3.5 h-3.5 flex-shrink-0"}),e.jsx("span",{children:t("proxyStatusWidget.versionsAboveUnstable",{version:a.maxStableVersion})})]}),S&&a?.faultyRange&&de(S,a.faultyRange.min,a.faultyRange.max)&&e.jsxs("div",{className:"mt-2 flex items-center gap-1.5 text-[11px] text-amber-600 dark:text-amber-400",children:[e.jsx(le,{className:"w-3.5 h-3.5 flex-shrink-0"}),e.jsx("span",{children:t("proxyStatusWidget.versionsKnownIssues",{version:S})})]}),r?.checkedAt&&e.jsx("div",{className:"mt-2 text-[10px] text-muted-foreground/60",children:t("proxyStatusWidget.lastChecked",{time:ls(r.checkedAt,t)})})]})}),!Y&&e.jsxs("div",{className:"mt-2 flex items-center justify-between",children:[e.jsx("span",{className:"text-xs text-muted-foreground",children:t("proxyStatusWidget.notRunning")}),e.jsxs(Z,{variant:"outline",size:"sm",className:"h-7 text-xs gap-1",onClick:()=>p.mutate(),disabled:p.isPending,children:[p.isPending?e.jsx(K,{className:"w-3 h-3 animate-spin"}):e.jsx(It,{className:"w-3 h-3"}),t("proxyStatusWidget.start")]})]}),e.jsx(dt,{open:T,onOpenChange:R,children:e.jsxs(mt,{children:[e.jsxs(xt,{children:[e.jsxs(pt,{className:"flex items-center gap-2",children:[e.jsx(le,{className:"w-5 h-5 text-amber-500"}),t(g==="faulty"?"proxyStatusWidget.installFaultyTitle":"proxyStatusWidget.installUnstableTitle")]}),e.jsxs(gt,{className:"space-y-2",children:[g==="faulty"?e.jsx("p",{children:e.jsx(Ne,{i18nKey:"proxyStatusWidget.installFaultyDesc",values:{version:w??"",range:Re||""},components:{strong:e.jsx("strong",{})}})}):e.jsx("p",{children:e.jsx(Ne,{i18nKey:"proxyStatusWidget.installUnstableDesc",values:{version:w??"",maxStable:fe},components:{strong:e.jsx("strong",{})}})}),e.jsx("p",{className:"text-amber-600 dark:text-amber-400",children:t(g==="faulty"?"proxyStatusWidget.installFaultyWarning":"proxyStatusWidget.installUnstableWarning")}),e.jsx("p",{children:t("proxyStatusWidget.installUnstableConfirm")})]})]}),e.jsxs(ft,{children:[e.jsx(ht,{onClick:We,children:t("proxyStatusWidget.cancel")}),e.jsx(bt,{onClick:De,className:"bg-amber-500 hover:bg-amber-600 text-white",children:t("proxyStatusWidget.installAnyway")})]})]})})]})})}export{fs as P};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{r as i,R as Gn,a as Bt,b as Oa,c as je}from"./react-vendor-CNOkPC89.js";var xn={exports:{}},ot={};var Ao;function Ma(){if(Ao)return ot;Ao=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function n(o,r,s){var a=null;if(s!==void 0&&(a=""+s),r.key!==void 0&&(a=""+r.key),"key"in r){s={};for(var c in r)c!=="key"&&(s[c]=r[c])}else s=r;return r=s.ref,{$$typeof:e,type:o,key:a,ref:r!==void 0?r:null,props:s}}return ot.Fragment=t,ot.jsx=n,ot.jsxs=n,ot}var To;function Na(){return To||(To=1,xn.exports=Ma()),xn.exports}var p=Na();function _o(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function we(...e){return t=>{let n=!1;const o=e.map(r=>{const s=_o(r,t);return!n&&typeof s=="function"&&(n=!0),s});if(n)return()=>{for(let r=0;r<o.length;r++){const s=o[r];typeof s=="function"?s():_o(e[r],null)}}}}function j(...e){return i.useCallback(we(...e),e)}var Da=Symbol.for("react.lazy"),It=Gn[" use ".trim().toString()];function ja(e){return typeof e=="object"&&e!==null&&"then"in e}function or(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===Da&&"_payload"in e&&ja(e._payload)}function Kn(e){const t=La(e),n=i.forwardRef((o,r)=>{let{children:s,...a}=o;or(s)&&typeof It=="function"&&(s=It(s._payload));const c=i.Children.toArray(s),l=c.find($a);if(l){const u=l.props.children,d=c.map(f=>f===l?i.Children.count(u)>1?i.Children.only(null):i.isValidElement(u)?u.props.children:null:f);return p.jsx(t,{...a,ref:r,children:i.isValidElement(u)?i.cloneElement(u,void 0,d):null})}return p.jsx(t,{...a,ref:r,children:s})});return n.displayName=`${e}.Slot`,n}var Ih=Kn("Slot");function La(e){const t=i.forwardRef((n,o)=>{let{children:r,...s}=n;if(or(r)&&typeof It=="function"&&(r=It(r._payload)),i.isValidElement(r)){const a=Wa(r),c=Fa(s,r.props);return r.type!==i.Fragment&&(c.ref=o?we(o,a):a),i.cloneElement(r,c)}return i.Children.count(r)>1?i.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var ka=Symbol("radix.slottable");function $a(e){return i.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===ka}function Fa(e,t){const n={...t};for(const o in t){const r=e[o],s=t[o];/^on[A-Z]/.test(o)?r&&s?n[o]=(...c)=>{const l=s(...c);return r(...c),l}:r&&(n[o]=r):o==="style"?n[o]={...r,...s}:o==="className"&&(n[o]=[r,s].filter(Boolean).join(" "))}return{...e,...n}}function Wa(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 Ba=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Va=Ba.reduce((e,t)=>{const n=Kn(`Primitive.${t}`),o=i.forwardRef((r,s)=>{const{asChild:a,...c}=r,l=a?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),p.jsx(l,{...c,ref:s})});return o.displayName=`Primitive.${t}`,{...e,[t]:o}},{}),Ha="Separator",Io="horizontal",Ua=["horizontal","vertical"],rr=i.forwardRef((e,t)=>{const{decorative:n,orientation:o=Io,...r}=e,s=Ga(o)?o:Io,c=n?{role:"none"}:{"aria-orientation":s==="vertical"?s:void 0,role:"separator"};return p.jsx(Va.div,{"data-orientation":s,...c,...r,ref:t})});rr.displayName=Ha;function Ga(e){return Ua.includes(e)}var Oh=rr;function R(e,t,{checkForDefaultPrevented:n=!0}={}){return function(r){if(e?.(r),n===!1||!r.defaultPrevented)return t?.(r)}}function Ka(e,t){const n=i.createContext(t),o=s=>{const{children:a,...c}=s,l=i.useMemo(()=>c,Object.values(c));return p.jsx(n.Provider,{value:l,children:a})};o.displayName=e+"Provider";function r(s){const a=i.useContext(n);if(a)return a;if(t!==void 0)return t;throw new Error(`\`${s}\` must be used within \`${e}\``)}return[o,r]}function J(e,t=[]){let n=[];function o(s,a){const c=i.createContext(a),l=n.length;n=[...n,a];const u=f=>{const{scope:h,children:v,...w}=f,m=h?.[e]?.[l]||c,g=i.useMemo(()=>w,Object.values(w));return p.jsx(m.Provider,{value:g,children:v})};u.displayName=s+"Provider";function d(f,h){const v=h?.[e]?.[l]||c,w=i.useContext(v);if(w)return w;if(a!==void 0)return a;throw new Error(`\`${f}\` must be used within \`${s}\``)}return[u,d]}const r=()=>{const s=n.map(a=>i.createContext(a));return function(c){const l=c?.[e]||s;return i.useMemo(()=>({[`__scope${e}`]:{...c,[e]:l}}),[c,l])}};return r.scopeName=e,[o,za(r,...t)]}function za(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const o=e.map(r=>({useScope:r(),scopeName:r.scopeName}));return function(s){const a=o.reduce((c,{useScope:l,scopeName:u})=>{const f=l(s)[`__scope${u}`];return{...c,...f}},{});return i.useMemo(()=>({[`__scope${t.scopeName}`]:a}),[a])}};return n.scopeName=t.scopeName,n}var Y=globalThis?.document?i.useLayoutEffect:()=>{},Ya=Gn[" useId ".trim().toString()]||(()=>{}),Xa=0;function ne(e){const[t,n]=i.useState(Ya());return Y(()=>{n(o=>o??String(Xa++))},[e]),t?`radix-${t}`:""}var qa=Gn[" useInsertionEffect ".trim().toString()]||Y;function ue({prop:e,defaultProp:t,onChange:n=()=>{},caller:o}){const[r,s,a]=Za({defaultProp:t,onChange:n}),c=e!==void 0,l=c?e:r;{const d=i.useRef(e!==void 0);i.useEffect(()=>{const f=d.current;f!==c&&console.warn(`${o} is changing from ${f?"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.`),d.current=c},[c,o])}const u=i.useCallback(d=>{if(c){const f=Ja(d)?d(e):d;f!==e&&a.current?.(f)}else s(d)},[c,e,s,a]);return[l,u]}function Za({defaultProp:e,onChange:t}){const[n,o]=i.useState(e),r=i.useRef(n),s=i.useRef(t);return qa(()=>{s.current=t},[t]),i.useEffect(()=>{r.current!==n&&(s.current?.(n),r.current=n)},[n,r]),[n,o,s]}function Ja(e){return typeof e=="function"}function Qa(e){const t=ec(e),n=i.forwardRef((o,r)=>{const{children:s,...a}=o,c=i.Children.toArray(s),l=c.find(nc);if(l){const u=l.props.children,d=c.map(f=>f===l?i.Children.count(u)>1?i.Children.only(null):i.isValidElement(u)?u.props.children:null:f);return p.jsx(t,{...a,ref:r,children:i.isValidElement(u)?i.cloneElement(u,void 0,d):null})}return p.jsx(t,{...a,ref:r,children:s})});return n.displayName=`${e}.Slot`,n}function ec(e){const t=i.forwardRef((n,o)=>{const{children:r,...s}=n;if(i.isValidElement(r)){const a=rc(r),c=oc(s,r.props);return r.type!==i.Fragment&&(c.ref=o?we(o,a):a),i.cloneElement(r,c)}return i.Children.count(r)>1?i.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var tc=Symbol("radix.slottable");function nc(e){return i.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===tc}function oc(e,t){const n={...t};for(const o in t){const r=e[o],s=t[o];/^on[A-Z]/.test(o)?r&&s?n[o]=(...c)=>{const l=s(...c);return r(...c),l}:r&&(n[o]=r):o==="style"?n[o]={...r,...s}:o==="className"&&(n[o]=[r,s].filter(Boolean).join(" "))}return{...e,...n}}function rc(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 sc=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],O=sc.reduce((e,t)=>{const n=Qa(`Primitive.${t}`),o=i.forwardRef((r,s)=>{const{asChild:a,...c}=r,l=a?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),p.jsx(l,{...c,ref:s})});return o.displayName=`Primitive.${t}`,{...e,[t]:o}},{});function sr(e,t){e&&Bt.flushSync(()=>e.dispatchEvent(t))}function X(e){const t=i.useRef(e);return i.useEffect(()=>{t.current=e}),i.useMemo(()=>(...n)=>t.current?.(...n),[])}function ic(e,t=globalThis?.document){const n=X(e);i.useEffect(()=>{const o=r=>{r.key==="Escape"&&n(r)};return t.addEventListener("keydown",o,{capture:!0}),()=>t.removeEventListener("keydown",o,{capture:!0})},[n,t])}var ac="DismissableLayer",In="dismissableLayer.update",cc="dismissableLayer.pointerDownOutside",lc="dismissableLayer.focusOutside",Oo,ir=i.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Je=i.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:o,onPointerDownOutside:r,onFocusOutside:s,onInteractOutside:a,onDismiss:c,...l}=e,u=i.useContext(ir),[d,f]=i.useState(null),h=d?.ownerDocument??globalThis?.document,[,v]=i.useState({}),w=j(t,E=>f(E)),m=Array.from(u.layers),[g]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),x=m.indexOf(g),y=d?m.indexOf(d):-1,b=u.layersWithOutsidePointerEventsDisabled.size>0,C=y>=x,S=fc(E=>{const _=E.target,I=[...u.branches].some(M=>M.contains(_));!C||I||(r?.(E),a?.(E),E.defaultPrevented||c?.())},h),A=pc(E=>{const _=E.target;[...u.branches].some(M=>M.contains(_))||(s?.(E),a?.(E),E.defaultPrevented||c?.())},h);return ic(E=>{y===u.layers.size-1&&(o?.(E),!E.defaultPrevented&&c&&(E.preventDefault(),c()))},h),i.useEffect(()=>{if(d)return n&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(Oo=h.body.style.pointerEvents,h.body.style.pointerEvents="none"),u.layersWithOutsidePointerEventsDisabled.add(d)),u.layers.add(d),Mo(),()=>{n&&u.layersWithOutsidePointerEventsDisabled.size===1&&(h.body.style.pointerEvents=Oo)}},[d,h,n,u]),i.useEffect(()=>()=>{d&&(u.layers.delete(d),u.layersWithOutsidePointerEventsDisabled.delete(d),Mo())},[d,u]),i.useEffect(()=>{const E=()=>v({});return document.addEventListener(In,E),()=>document.removeEventListener(In,E)},[]),p.jsx(O.div,{...l,ref:w,style:{pointerEvents:b?C?"auto":"none":void 0,...e.style},onFocusCapture:R(e.onFocusCapture,A.onFocusCapture),onBlurCapture:R(e.onBlurCapture,A.onBlurCapture),onPointerDownCapture:R(e.onPointerDownCapture,S.onPointerDownCapture)})});Je.displayName=ac;var uc="DismissableLayerBranch",dc=i.forwardRef((e,t)=>{const n=i.useContext(ir),o=i.useRef(null),r=j(t,o);return i.useEffect(()=>{const s=o.current;if(s)return n.branches.add(s),()=>{n.branches.delete(s)}},[n.branches]),p.jsx(O.div,{...e,ref:r})});dc.displayName=uc;function fc(e,t=globalThis?.document){const n=X(e),o=i.useRef(!1),r=i.useRef(()=>{});return i.useEffect(()=>{const s=c=>{if(c.target&&!o.current){let l=function(){ar(cc,n,u,{discrete:!0})};const u={originalEvent:c};c.pointerType==="touch"?(t.removeEventListener("click",r.current),r.current=l,t.addEventListener("click",r.current,{once:!0})):l()}else t.removeEventListener("click",r.current);o.current=!1},a=window.setTimeout(()=>{t.addEventListener("pointerdown",s)},0);return()=>{window.clearTimeout(a),t.removeEventListener("pointerdown",s),t.removeEventListener("click",r.current)}},[t,n]),{onPointerDownCapture:()=>o.current=!0}}function pc(e,t=globalThis?.document){const n=X(e),o=i.useRef(!1);return i.useEffect(()=>{const r=s=>{s.target&&!o.current&&ar(lc,n,{originalEvent:s},{discrete:!1})};return t.addEventListener("focusin",r),()=>t.removeEventListener("focusin",r)},[t,n]),{onFocusCapture:()=>o.current=!0,onBlurCapture:()=>o.current=!1}}function Mo(){const e=new CustomEvent(In);document.dispatchEvent(e)}function ar(e,t,n,{discrete:o}){const r=n.originalEvent.target,s=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&r.addEventListener(e,t,{once:!0}),o?sr(r,s):r.dispatchEvent(s)}var yn="focusScope.autoFocusOnMount",bn="focusScope.autoFocusOnUnmount",No={bubbles:!1,cancelable:!0},hc="FocusScope",dt=i.forwardRef((e,t)=>{const{loop:n=!1,trapped:o=!1,onMountAutoFocus:r,onUnmountAutoFocus:s,...a}=e,[c,l]=i.useState(null),u=X(r),d=X(s),f=i.useRef(null),h=j(t,m=>l(m)),v=i.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;i.useEffect(()=>{if(o){let m=function(b){if(v.paused||!c)return;const C=b.target;c.contains(C)?f.current=C:Pe(f.current,{select:!0})},g=function(b){if(v.paused||!c)return;const C=b.relatedTarget;C!==null&&(c.contains(C)||Pe(f.current,{select:!0}))},x=function(b){if(document.activeElement===document.body)for(const S of b)S.removedNodes.length>0&&Pe(c)};document.addEventListener("focusin",m),document.addEventListener("focusout",g);const y=new MutationObserver(x);return c&&y.observe(c,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",m),document.removeEventListener("focusout",g),y.disconnect()}}},[o,c,v.paused]),i.useEffect(()=>{if(c){jo.add(v);const m=document.activeElement;if(!c.contains(m)){const x=new CustomEvent(yn,No);c.addEventListener(yn,u),c.dispatchEvent(x),x.defaultPrevented||(mc(yc(cr(c)),{select:!0}),document.activeElement===m&&Pe(c))}return()=>{c.removeEventListener(yn,u),setTimeout(()=>{const x=new CustomEvent(bn,No);c.addEventListener(bn,d),c.dispatchEvent(x),x.defaultPrevented||Pe(m??document.body,{select:!0}),c.removeEventListener(bn,d),jo.remove(v)},0)}}},[c,u,d,v]);const w=i.useCallback(m=>{if(!n&&!o||v.paused)return;const g=m.key==="Tab"&&!m.altKey&&!m.ctrlKey&&!m.metaKey,x=document.activeElement;if(g&&x){const y=m.currentTarget,[b,C]=vc(y);b&&C?!m.shiftKey&&x===C?(m.preventDefault(),n&&Pe(b,{select:!0})):m.shiftKey&&x===b&&(m.preventDefault(),n&&Pe(C,{select:!0})):x===y&&m.preventDefault()}},[n,o,v.paused]);return p.jsx(O.div,{tabIndex:-1,...a,ref:h,onKeyDown:w})});dt.displayName=hc;function mc(e,{select:t=!1}={}){const n=document.activeElement;for(const o of e)if(Pe(o,{select:t}),document.activeElement!==n)return}function vc(e){const t=cr(e),n=Do(t,e),o=Do(t.reverse(),e);return[n,o]}function cr(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:o=>{const r=o.tagName==="INPUT"&&o.type==="hidden";return o.disabled||o.hidden||r?NodeFilter.FILTER_SKIP:o.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function Do(e,t){for(const n of e)if(!gc(n,{upTo:t}))return n}function gc(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 wc(e){return e instanceof HTMLInputElement&&"select"in e}function Pe(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&wc(e)&&t&&e.select()}}var jo=xc();function xc(){let e=[];return{add(t){const n=e[0];t!==n&&n?.pause(),e=Lo(e,t),e.unshift(t)},remove(t){e=Lo(e,t),e[0]?.resume()}}}function Lo(e,t){const n=[...e],o=n.indexOf(t);return o!==-1&&n.splice(o,1),n}function yc(e){return e.filter(t=>t.tagName!=="A")}var bc="Portal",Qe=i.forwardRef((e,t)=>{const{container:n,...o}=e,[r,s]=i.useState(!1);Y(()=>s(!0),[]);const a=n||r&&globalThis?.document?.body;return a?Oa.createPortal(p.jsx(O.div,{...o,ref:t}),a):null});Qe.displayName=bc;function Cc(e,t){return i.useReducer((n,o)=>t[n][o]??n,e)}var z=e=>{const{present:t,children:n}=e,o=Sc(t),r=typeof n=="function"?n({present:o.isPresent}):i.Children.only(n),s=j(o.ref,Ec(r));return typeof n=="function"||o.isPresent?i.cloneElement(r,{ref:s}):null};z.displayName="Presence";function Sc(e){const[t,n]=i.useState(),o=i.useRef(null),r=i.useRef(e),s=i.useRef("none"),a=e?"mounted":"unmounted",[c,l]=Cc(a,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return i.useEffect(()=>{const u=bt(o.current);s.current=c==="mounted"?u:"none"},[c]),Y(()=>{const u=o.current,d=r.current;if(d!==e){const h=s.current,v=bt(u);e?l("MOUNT"):v==="none"||u?.display==="none"?l("UNMOUNT"):l(d&&h!==v?"ANIMATION_OUT":"UNMOUNT"),r.current=e}},[e,l]),Y(()=>{if(t){let u;const d=t.ownerDocument.defaultView??window,f=v=>{const m=bt(o.current).includes(CSS.escape(v.animationName));if(v.target===t&&m&&(l("ANIMATION_END"),!r.current)){const g=t.style.animationFillMode;t.style.animationFillMode="forwards",u=d.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=g)})}},h=v=>{v.target===t&&(s.current=bt(o.current))};return t.addEventListener("animationstart",h),t.addEventListener("animationcancel",f),t.addEventListener("animationend",f),()=>{d.clearTimeout(u),t.removeEventListener("animationstart",h),t.removeEventListener("animationcancel",f),t.removeEventListener("animationend",f)}}else l("ANIMATION_END")},[t,l]),{isPresent:["mounted","unmountSuspended"].includes(c),ref:i.useCallback(u=>{o.current=u?getComputedStyle(u):null,n(u)},[])}}function bt(e){return e?.animationName||"none"}function Ec(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 Cn=0;function Vt(){i.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??ko()),document.body.insertAdjacentElement("beforeend",e[1]??ko()),Cn++,()=>{Cn===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),Cn--}},[])}function ko(){const 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 he=function(){return he=Object.assign||function(t){for(var n,o=1,r=arguments.length;o<r;o++){n=arguments[o];for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(t[s]=n[s])}return t},he.apply(this,arguments)};function lr(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,o=Object.getOwnPropertySymbols(e);r<o.length;r++)t.indexOf(o[r])<0&&Object.prototype.propertyIsEnumerable.call(e,o[r])&&(n[o[r]]=e[o[r]]);return n}function Rc(e,t,n){if(n||arguments.length===2)for(var o=0,r=t.length,s;o<r;o++)(s||!(o in t))&&(s||(s=Array.prototype.slice.call(t,0,o)),s[o]=t[o]);return e.concat(s||Array.prototype.slice.call(t))}var At="right-scroll-bar-position",Tt="width-before-scroll-bar",Pc="with-scroll-bars-hidden",Ac="--removed-body-scroll-bar-size";function Sn(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function Tc(e,t){var n=i.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(o){var r=n.value;r!==o&&(n.value=o,n.callback(o,r))}}}})[0];return n.callback=t,n.facade}var _c=typeof window<"u"?i.useLayoutEffect:i.useEffect,$o=new WeakMap;function Ic(e,t){var n=Tc(null,function(o){return e.forEach(function(r){return Sn(r,o)})});return _c(function(){var o=$o.get(n);if(o){var r=new Set(o),s=new Set(e),a=n.current;r.forEach(function(c){s.has(c)||Sn(c,null)}),s.forEach(function(c){r.has(c)||Sn(c,a)})}$o.set(n,e)},[e]),n}function Oc(e){return e}function Mc(e,t){t===void 0&&(t=Oc);var n=[],o=!1,r={read:function(){if(o)throw new 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(s){var a=t(s,o);return n.push(a),function(){n=n.filter(function(c){return c!==a})}},assignSyncMedium:function(s){for(o=!0;n.length;){var a=n;n=[],a.forEach(s)}n={push:function(c){return s(c)},filter:function(){return n}}},assignMedium:function(s){o=!0;var a=[];if(n.length){var c=n;n=[],c.forEach(s),a=n}var l=function(){var d=a;a=[],d.forEach(s)},u=function(){return Promise.resolve().then(l)};u(),n={push:function(d){a.push(d),u()},filter:function(d){return a=a.filter(d),n}}}};return r}function Nc(e){e===void 0&&(e={});var t=Mc(null);return t.options=he({async:!0,ssr:!1},e),t}var ur=function(e){var t=e.sideCar,n=lr(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var o=t.read();if(!o)throw new Error("Sidecar medium not found");return i.createElement(o,he({},n))};ur.isSideCarExport=!0;function Dc(e,t){return e.useMedium(t),ur}var dr=Nc(),En=function(){},Ht=i.forwardRef(function(e,t){var n=i.useRef(null),o=i.useState({onScrollCapture:En,onWheelCapture:En,onTouchMoveCapture:En}),r=o[0],s=o[1],a=e.forwardProps,c=e.children,l=e.className,u=e.removeScrollBar,d=e.enabled,f=e.shards,h=e.sideCar,v=e.noRelative,w=e.noIsolation,m=e.inert,g=e.allowPinchZoom,x=e.as,y=x===void 0?"div":x,b=e.gapMode,C=lr(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),S=h,A=Ic([n,t]),E=he(he({},C),r);return i.createElement(i.Fragment,null,d&&i.createElement(S,{sideCar:dr,removeScrollBar:u,shards:f,noRelative:v,noIsolation:w,inert:m,setCallbacks:s,allowPinchZoom:!!g,lockRef:n,gapMode:b}),a?i.cloneElement(i.Children.only(c),he(he({},E),{ref:A})):i.createElement(y,he({},E,{className:l,ref:A}),c))});Ht.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};Ht.classNames={fullWidth:Tt,zeroRight:At};var jc=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function Lc(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=jc();return t&&e.setAttribute("nonce",t),e}function kc(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function $c(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var Fc=function(){var e=0,t=null;return{add:function(n){e==0&&(t=Lc())&&(kc(t,n),$c(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},Wc=function(){var e=Fc();return function(t,n){i.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},fr=function(){var e=Wc(),t=function(n){var o=n.styles,r=n.dynamic;return e(o,r),null};return t},Bc={left:0,top:0,right:0,gap:0},Rn=function(e){return parseInt(e||"",10)||0},Vc=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],o=t[e==="padding"?"paddingTop":"marginTop"],r=t[e==="padding"?"paddingRight":"marginRight"];return[Rn(n),Rn(o),Rn(r)]},Hc=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return Bc;var t=Vc(e),n=document.documentElement.clientWidth,o=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,o-n+t[2]-t[0])}},Uc=fr(),Ge="data-scroll-locked",Gc=function(e,t,n,o){var r=e.left,s=e.top,a=e.right,c=e.gap;return n===void 0&&(n="margin"),`
|
|
1
|
+
import{r as i,R as Gn,a as Bt,f as Oa,E as je}from"./react-vendor-Bjx91N7w.js";var xn={exports:{}},ot={};var Ao;function Ma(){if(Ao)return ot;Ao=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function n(o,r,s){var a=null;if(s!==void 0&&(a=""+s),r.key!==void 0&&(a=""+r.key),"key"in r){s={};for(var c in r)c!=="key"&&(s[c]=r[c])}else s=r;return r=s.ref,{$$typeof:e,type:o,key:a,ref:r!==void 0?r:null,props:s}}return ot.Fragment=t,ot.jsx=n,ot.jsxs=n,ot}var To;function Na(){return To||(To=1,xn.exports=Ma()),xn.exports}var p=Na();function _o(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function we(...e){return t=>{let n=!1;const o=e.map(r=>{const s=_o(r,t);return!n&&typeof s=="function"&&(n=!0),s});if(n)return()=>{for(let r=0;r<o.length;r++){const s=o[r];typeof s=="function"?s():_o(e[r],null)}}}}function j(...e){return i.useCallback(we(...e),e)}var Da=Symbol.for("react.lazy"),It=Gn[" use ".trim().toString()];function ja(e){return typeof e=="object"&&e!==null&&"then"in e}function or(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===Da&&"_payload"in e&&ja(e._payload)}function Kn(e){const t=La(e),n=i.forwardRef((o,r)=>{let{children:s,...a}=o;or(s)&&typeof It=="function"&&(s=It(s._payload));const c=i.Children.toArray(s),l=c.find($a);if(l){const u=l.props.children,d=c.map(f=>f===l?i.Children.count(u)>1?i.Children.only(null):i.isValidElement(u)?u.props.children:null:f);return p.jsx(t,{...a,ref:r,children:i.isValidElement(u)?i.cloneElement(u,void 0,d):null})}return p.jsx(t,{...a,ref:r,children:s})});return n.displayName=`${e}.Slot`,n}var Ih=Kn("Slot");function La(e){const t=i.forwardRef((n,o)=>{let{children:r,...s}=n;if(or(r)&&typeof It=="function"&&(r=It(r._payload)),i.isValidElement(r)){const a=Wa(r),c=Fa(s,r.props);return r.type!==i.Fragment&&(c.ref=o?we(o,a):a),i.cloneElement(r,c)}return i.Children.count(r)>1?i.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var ka=Symbol("radix.slottable");function $a(e){return i.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===ka}function Fa(e,t){const n={...t};for(const o in t){const r=e[o],s=t[o];/^on[A-Z]/.test(o)?r&&s?n[o]=(...c)=>{const l=s(...c);return r(...c),l}:r&&(n[o]=r):o==="style"?n[o]={...r,...s}:o==="className"&&(n[o]=[r,s].filter(Boolean).join(" "))}return{...e,...n}}function Wa(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 Ba=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Va=Ba.reduce((e,t)=>{const n=Kn(`Primitive.${t}`),o=i.forwardRef((r,s)=>{const{asChild:a,...c}=r,l=a?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),p.jsx(l,{...c,ref:s})});return o.displayName=`Primitive.${t}`,{...e,[t]:o}},{}),Ha="Separator",Io="horizontal",Ua=["horizontal","vertical"],rr=i.forwardRef((e,t)=>{const{decorative:n,orientation:o=Io,...r}=e,s=Ga(o)?o:Io,c=n?{role:"none"}:{"aria-orientation":s==="vertical"?s:void 0,role:"separator"};return p.jsx(Va.div,{"data-orientation":s,...c,...r,ref:t})});rr.displayName=Ha;function Ga(e){return Ua.includes(e)}var Oh=rr;function R(e,t,{checkForDefaultPrevented:n=!0}={}){return function(r){if(e?.(r),n===!1||!r.defaultPrevented)return t?.(r)}}function Ka(e,t){const n=i.createContext(t),o=s=>{const{children:a,...c}=s,l=i.useMemo(()=>c,Object.values(c));return p.jsx(n.Provider,{value:l,children:a})};o.displayName=e+"Provider";function r(s){const a=i.useContext(n);if(a)return a;if(t!==void 0)return t;throw new Error(`\`${s}\` must be used within \`${e}\``)}return[o,r]}function J(e,t=[]){let n=[];function o(s,a){const c=i.createContext(a),l=n.length;n=[...n,a];const u=f=>{const{scope:h,children:v,...w}=f,m=h?.[e]?.[l]||c,g=i.useMemo(()=>w,Object.values(w));return p.jsx(m.Provider,{value:g,children:v})};u.displayName=s+"Provider";function d(f,h){const v=h?.[e]?.[l]||c,w=i.useContext(v);if(w)return w;if(a!==void 0)return a;throw new Error(`\`${f}\` must be used within \`${s}\``)}return[u,d]}const r=()=>{const s=n.map(a=>i.createContext(a));return function(c){const l=c?.[e]||s;return i.useMemo(()=>({[`__scope${e}`]:{...c,[e]:l}}),[c,l])}};return r.scopeName=e,[o,za(r,...t)]}function za(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const o=e.map(r=>({useScope:r(),scopeName:r.scopeName}));return function(s){const a=o.reduce((c,{useScope:l,scopeName:u})=>{const f=l(s)[`__scope${u}`];return{...c,...f}},{});return i.useMemo(()=>({[`__scope${t.scopeName}`]:a}),[a])}};return n.scopeName=t.scopeName,n}var Y=globalThis?.document?i.useLayoutEffect:()=>{},Ya=Gn[" useId ".trim().toString()]||(()=>{}),Xa=0;function ne(e){const[t,n]=i.useState(Ya());return Y(()=>{n(o=>o??String(Xa++))},[e]),t?`radix-${t}`:""}var qa=Gn[" useInsertionEffect ".trim().toString()]||Y;function ue({prop:e,defaultProp:t,onChange:n=()=>{},caller:o}){const[r,s,a]=Za({defaultProp:t,onChange:n}),c=e!==void 0,l=c?e:r;{const d=i.useRef(e!==void 0);i.useEffect(()=>{const f=d.current;f!==c&&console.warn(`${o} is changing from ${f?"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.`),d.current=c},[c,o])}const u=i.useCallback(d=>{if(c){const f=Ja(d)?d(e):d;f!==e&&a.current?.(f)}else s(d)},[c,e,s,a]);return[l,u]}function Za({defaultProp:e,onChange:t}){const[n,o]=i.useState(e),r=i.useRef(n),s=i.useRef(t);return qa(()=>{s.current=t},[t]),i.useEffect(()=>{r.current!==n&&(s.current?.(n),r.current=n)},[n,r]),[n,o,s]}function Ja(e){return typeof e=="function"}function Qa(e){const t=ec(e),n=i.forwardRef((o,r)=>{const{children:s,...a}=o,c=i.Children.toArray(s),l=c.find(nc);if(l){const u=l.props.children,d=c.map(f=>f===l?i.Children.count(u)>1?i.Children.only(null):i.isValidElement(u)?u.props.children:null:f);return p.jsx(t,{...a,ref:r,children:i.isValidElement(u)?i.cloneElement(u,void 0,d):null})}return p.jsx(t,{...a,ref:r,children:s})});return n.displayName=`${e}.Slot`,n}function ec(e){const t=i.forwardRef((n,o)=>{const{children:r,...s}=n;if(i.isValidElement(r)){const a=rc(r),c=oc(s,r.props);return r.type!==i.Fragment&&(c.ref=o?we(o,a):a),i.cloneElement(r,c)}return i.Children.count(r)>1?i.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var tc=Symbol("radix.slottable");function nc(e){return i.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===tc}function oc(e,t){const n={...t};for(const o in t){const r=e[o],s=t[o];/^on[A-Z]/.test(o)?r&&s?n[o]=(...c)=>{const l=s(...c);return r(...c),l}:r&&(n[o]=r):o==="style"?n[o]={...r,...s}:o==="className"&&(n[o]=[r,s].filter(Boolean).join(" "))}return{...e,...n}}function rc(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 sc=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],O=sc.reduce((e,t)=>{const n=Qa(`Primitive.${t}`),o=i.forwardRef((r,s)=>{const{asChild:a,...c}=r,l=a?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),p.jsx(l,{...c,ref:s})});return o.displayName=`Primitive.${t}`,{...e,[t]:o}},{});function sr(e,t){e&&Bt.flushSync(()=>e.dispatchEvent(t))}function X(e){const t=i.useRef(e);return i.useEffect(()=>{t.current=e}),i.useMemo(()=>(...n)=>t.current?.(...n),[])}function ic(e,t=globalThis?.document){const n=X(e);i.useEffect(()=>{const o=r=>{r.key==="Escape"&&n(r)};return t.addEventListener("keydown",o,{capture:!0}),()=>t.removeEventListener("keydown",o,{capture:!0})},[n,t])}var ac="DismissableLayer",In="dismissableLayer.update",cc="dismissableLayer.pointerDownOutside",lc="dismissableLayer.focusOutside",Oo,ir=i.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Je=i.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:o,onPointerDownOutside:r,onFocusOutside:s,onInteractOutside:a,onDismiss:c,...l}=e,u=i.useContext(ir),[d,f]=i.useState(null),h=d?.ownerDocument??globalThis?.document,[,v]=i.useState({}),w=j(t,E=>f(E)),m=Array.from(u.layers),[g]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),x=m.indexOf(g),y=d?m.indexOf(d):-1,b=u.layersWithOutsidePointerEventsDisabled.size>0,C=y>=x,S=fc(E=>{const _=E.target,I=[...u.branches].some(M=>M.contains(_));!C||I||(r?.(E),a?.(E),E.defaultPrevented||c?.())},h),A=pc(E=>{const _=E.target;[...u.branches].some(M=>M.contains(_))||(s?.(E),a?.(E),E.defaultPrevented||c?.())},h);return ic(E=>{y===u.layers.size-1&&(o?.(E),!E.defaultPrevented&&c&&(E.preventDefault(),c()))},h),i.useEffect(()=>{if(d)return n&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(Oo=h.body.style.pointerEvents,h.body.style.pointerEvents="none"),u.layersWithOutsidePointerEventsDisabled.add(d)),u.layers.add(d),Mo(),()=>{n&&u.layersWithOutsidePointerEventsDisabled.size===1&&(h.body.style.pointerEvents=Oo)}},[d,h,n,u]),i.useEffect(()=>()=>{d&&(u.layers.delete(d),u.layersWithOutsidePointerEventsDisabled.delete(d),Mo())},[d,u]),i.useEffect(()=>{const E=()=>v({});return document.addEventListener(In,E),()=>document.removeEventListener(In,E)},[]),p.jsx(O.div,{...l,ref:w,style:{pointerEvents:b?C?"auto":"none":void 0,...e.style},onFocusCapture:R(e.onFocusCapture,A.onFocusCapture),onBlurCapture:R(e.onBlurCapture,A.onBlurCapture),onPointerDownCapture:R(e.onPointerDownCapture,S.onPointerDownCapture)})});Je.displayName=ac;var uc="DismissableLayerBranch",dc=i.forwardRef((e,t)=>{const n=i.useContext(ir),o=i.useRef(null),r=j(t,o);return i.useEffect(()=>{const s=o.current;if(s)return n.branches.add(s),()=>{n.branches.delete(s)}},[n.branches]),p.jsx(O.div,{...e,ref:r})});dc.displayName=uc;function fc(e,t=globalThis?.document){const n=X(e),o=i.useRef(!1),r=i.useRef(()=>{});return i.useEffect(()=>{const s=c=>{if(c.target&&!o.current){let l=function(){ar(cc,n,u,{discrete:!0})};const u={originalEvent:c};c.pointerType==="touch"?(t.removeEventListener("click",r.current),r.current=l,t.addEventListener("click",r.current,{once:!0})):l()}else t.removeEventListener("click",r.current);o.current=!1},a=window.setTimeout(()=>{t.addEventListener("pointerdown",s)},0);return()=>{window.clearTimeout(a),t.removeEventListener("pointerdown",s),t.removeEventListener("click",r.current)}},[t,n]),{onPointerDownCapture:()=>o.current=!0}}function pc(e,t=globalThis?.document){const n=X(e),o=i.useRef(!1);return i.useEffect(()=>{const r=s=>{s.target&&!o.current&&ar(lc,n,{originalEvent:s},{discrete:!1})};return t.addEventListener("focusin",r),()=>t.removeEventListener("focusin",r)},[t,n]),{onFocusCapture:()=>o.current=!0,onBlurCapture:()=>o.current=!1}}function Mo(){const e=new CustomEvent(In);document.dispatchEvent(e)}function ar(e,t,n,{discrete:o}){const r=n.originalEvent.target,s=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&r.addEventListener(e,t,{once:!0}),o?sr(r,s):r.dispatchEvent(s)}var yn="focusScope.autoFocusOnMount",bn="focusScope.autoFocusOnUnmount",No={bubbles:!1,cancelable:!0},hc="FocusScope",dt=i.forwardRef((e,t)=>{const{loop:n=!1,trapped:o=!1,onMountAutoFocus:r,onUnmountAutoFocus:s,...a}=e,[c,l]=i.useState(null),u=X(r),d=X(s),f=i.useRef(null),h=j(t,m=>l(m)),v=i.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;i.useEffect(()=>{if(o){let m=function(b){if(v.paused||!c)return;const C=b.target;c.contains(C)?f.current=C:Pe(f.current,{select:!0})},g=function(b){if(v.paused||!c)return;const C=b.relatedTarget;C!==null&&(c.contains(C)||Pe(f.current,{select:!0}))},x=function(b){if(document.activeElement===document.body)for(const S of b)S.removedNodes.length>0&&Pe(c)};document.addEventListener("focusin",m),document.addEventListener("focusout",g);const y=new MutationObserver(x);return c&&y.observe(c,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",m),document.removeEventListener("focusout",g),y.disconnect()}}},[o,c,v.paused]),i.useEffect(()=>{if(c){jo.add(v);const m=document.activeElement;if(!c.contains(m)){const x=new CustomEvent(yn,No);c.addEventListener(yn,u),c.dispatchEvent(x),x.defaultPrevented||(mc(yc(cr(c)),{select:!0}),document.activeElement===m&&Pe(c))}return()=>{c.removeEventListener(yn,u),setTimeout(()=>{const x=new CustomEvent(bn,No);c.addEventListener(bn,d),c.dispatchEvent(x),x.defaultPrevented||Pe(m??document.body,{select:!0}),c.removeEventListener(bn,d),jo.remove(v)},0)}}},[c,u,d,v]);const w=i.useCallback(m=>{if(!n&&!o||v.paused)return;const g=m.key==="Tab"&&!m.altKey&&!m.ctrlKey&&!m.metaKey,x=document.activeElement;if(g&&x){const y=m.currentTarget,[b,C]=vc(y);b&&C?!m.shiftKey&&x===C?(m.preventDefault(),n&&Pe(b,{select:!0})):m.shiftKey&&x===b&&(m.preventDefault(),n&&Pe(C,{select:!0})):x===y&&m.preventDefault()}},[n,o,v.paused]);return p.jsx(O.div,{tabIndex:-1,...a,ref:h,onKeyDown:w})});dt.displayName=hc;function mc(e,{select:t=!1}={}){const n=document.activeElement;for(const o of e)if(Pe(o,{select:t}),document.activeElement!==n)return}function vc(e){const t=cr(e),n=Do(t,e),o=Do(t.reverse(),e);return[n,o]}function cr(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:o=>{const r=o.tagName==="INPUT"&&o.type==="hidden";return o.disabled||o.hidden||r?NodeFilter.FILTER_SKIP:o.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function Do(e,t){for(const n of e)if(!gc(n,{upTo:t}))return n}function gc(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 wc(e){return e instanceof HTMLInputElement&&"select"in e}function Pe(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&wc(e)&&t&&e.select()}}var jo=xc();function xc(){let e=[];return{add(t){const n=e[0];t!==n&&n?.pause(),e=Lo(e,t),e.unshift(t)},remove(t){e=Lo(e,t),e[0]?.resume()}}}function Lo(e,t){const n=[...e],o=n.indexOf(t);return o!==-1&&n.splice(o,1),n}function yc(e){return e.filter(t=>t.tagName!=="A")}var bc="Portal",Qe=i.forwardRef((e,t)=>{const{container:n,...o}=e,[r,s]=i.useState(!1);Y(()=>s(!0),[]);const a=n||r&&globalThis?.document?.body;return a?Oa.createPortal(p.jsx(O.div,{...o,ref:t}),a):null});Qe.displayName=bc;function Cc(e,t){return i.useReducer((n,o)=>t[n][o]??n,e)}var z=e=>{const{present:t,children:n}=e,o=Sc(t),r=typeof n=="function"?n({present:o.isPresent}):i.Children.only(n),s=j(o.ref,Ec(r));return typeof n=="function"||o.isPresent?i.cloneElement(r,{ref:s}):null};z.displayName="Presence";function Sc(e){const[t,n]=i.useState(),o=i.useRef(null),r=i.useRef(e),s=i.useRef("none"),a=e?"mounted":"unmounted",[c,l]=Cc(a,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return i.useEffect(()=>{const u=bt(o.current);s.current=c==="mounted"?u:"none"},[c]),Y(()=>{const u=o.current,d=r.current;if(d!==e){const h=s.current,v=bt(u);e?l("MOUNT"):v==="none"||u?.display==="none"?l("UNMOUNT"):l(d&&h!==v?"ANIMATION_OUT":"UNMOUNT"),r.current=e}},[e,l]),Y(()=>{if(t){let u;const d=t.ownerDocument.defaultView??window,f=v=>{const m=bt(o.current).includes(CSS.escape(v.animationName));if(v.target===t&&m&&(l("ANIMATION_END"),!r.current)){const g=t.style.animationFillMode;t.style.animationFillMode="forwards",u=d.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=g)})}},h=v=>{v.target===t&&(s.current=bt(o.current))};return t.addEventListener("animationstart",h),t.addEventListener("animationcancel",f),t.addEventListener("animationend",f),()=>{d.clearTimeout(u),t.removeEventListener("animationstart",h),t.removeEventListener("animationcancel",f),t.removeEventListener("animationend",f)}}else l("ANIMATION_END")},[t,l]),{isPresent:["mounted","unmountSuspended"].includes(c),ref:i.useCallback(u=>{o.current=u?getComputedStyle(u):null,n(u)},[])}}function bt(e){return e?.animationName||"none"}function Ec(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 Cn=0;function Vt(){i.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??ko()),document.body.insertAdjacentElement("beforeend",e[1]??ko()),Cn++,()=>{Cn===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),Cn--}},[])}function ko(){const 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 he=function(){return he=Object.assign||function(t){for(var n,o=1,r=arguments.length;o<r;o++){n=arguments[o];for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(t[s]=n[s])}return t},he.apply(this,arguments)};function lr(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,o=Object.getOwnPropertySymbols(e);r<o.length;r++)t.indexOf(o[r])<0&&Object.prototype.propertyIsEnumerable.call(e,o[r])&&(n[o[r]]=e[o[r]]);return n}function Rc(e,t,n){if(n||arguments.length===2)for(var o=0,r=t.length,s;o<r;o++)(s||!(o in t))&&(s||(s=Array.prototype.slice.call(t,0,o)),s[o]=t[o]);return e.concat(s||Array.prototype.slice.call(t))}var At="right-scroll-bar-position",Tt="width-before-scroll-bar",Pc="with-scroll-bars-hidden",Ac="--removed-body-scroll-bar-size";function Sn(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function Tc(e,t){var n=i.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(o){var r=n.value;r!==o&&(n.value=o,n.callback(o,r))}}}})[0];return n.callback=t,n.facade}var _c=typeof window<"u"?i.useLayoutEffect:i.useEffect,$o=new WeakMap;function Ic(e,t){var n=Tc(null,function(o){return e.forEach(function(r){return Sn(r,o)})});return _c(function(){var o=$o.get(n);if(o){var r=new Set(o),s=new Set(e),a=n.current;r.forEach(function(c){s.has(c)||Sn(c,null)}),s.forEach(function(c){r.has(c)||Sn(c,a)})}$o.set(n,e)},[e]),n}function Oc(e){return e}function Mc(e,t){t===void 0&&(t=Oc);var n=[],o=!1,r={read:function(){if(o)throw new 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(s){var a=t(s,o);return n.push(a),function(){n=n.filter(function(c){return c!==a})}},assignSyncMedium:function(s){for(o=!0;n.length;){var a=n;n=[],a.forEach(s)}n={push:function(c){return s(c)},filter:function(){return n}}},assignMedium:function(s){o=!0;var a=[];if(n.length){var c=n;n=[],c.forEach(s),a=n}var l=function(){var d=a;a=[],d.forEach(s)},u=function(){return Promise.resolve().then(l)};u(),n={push:function(d){a.push(d),u()},filter:function(d){return a=a.filter(d),n}}}};return r}function Nc(e){e===void 0&&(e={});var t=Mc(null);return t.options=he({async:!0,ssr:!1},e),t}var ur=function(e){var t=e.sideCar,n=lr(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var o=t.read();if(!o)throw new Error("Sidecar medium not found");return i.createElement(o,he({},n))};ur.isSideCarExport=!0;function Dc(e,t){return e.useMedium(t),ur}var dr=Nc(),En=function(){},Ht=i.forwardRef(function(e,t){var n=i.useRef(null),o=i.useState({onScrollCapture:En,onWheelCapture:En,onTouchMoveCapture:En}),r=o[0],s=o[1],a=e.forwardProps,c=e.children,l=e.className,u=e.removeScrollBar,d=e.enabled,f=e.shards,h=e.sideCar,v=e.noRelative,w=e.noIsolation,m=e.inert,g=e.allowPinchZoom,x=e.as,y=x===void 0?"div":x,b=e.gapMode,C=lr(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),S=h,A=Ic([n,t]),E=he(he({},C),r);return i.createElement(i.Fragment,null,d&&i.createElement(S,{sideCar:dr,removeScrollBar:u,shards:f,noRelative:v,noIsolation:w,inert:m,setCallbacks:s,allowPinchZoom:!!g,lockRef:n,gapMode:b}),a?i.cloneElement(i.Children.only(c),he(he({},E),{ref:A})):i.createElement(y,he({},E,{className:l,ref:A}),c))});Ht.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};Ht.classNames={fullWidth:Tt,zeroRight:At};var jc=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function Lc(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=jc();return t&&e.setAttribute("nonce",t),e}function kc(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function $c(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var Fc=function(){var e=0,t=null;return{add:function(n){e==0&&(t=Lc())&&(kc(t,n),$c(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},Wc=function(){var e=Fc();return function(t,n){i.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},fr=function(){var e=Wc(),t=function(n){var o=n.styles,r=n.dynamic;return e(o,r),null};return t},Bc={left:0,top:0,right:0,gap:0},Rn=function(e){return parseInt(e||"",10)||0},Vc=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],o=t[e==="padding"?"paddingTop":"marginTop"],r=t[e==="padding"?"paddingRight":"marginRight"];return[Rn(n),Rn(o),Rn(r)]},Hc=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return Bc;var t=Vc(e),n=document.documentElement.clientWidth,o=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,o-n+t[2]-t[0])}},Uc=fr(),Ge="data-scroll-locked",Gc=function(e,t,n,o){var r=e.left,s=e.top,a=e.right,c=e.gap;return n===void 0&&(n="margin"),`
|
|
2
2
|
.`.concat(Pc,` {
|
|
3
3
|
overflow: hidden `).concat(o,`;
|
|
4
4
|
padding-right: `).concat(c,"px ").concat(o,`;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as e}from"./radix-ui-
|
|
1
|
+
import{j as e}from"./radix-ui-nu4wz29m.js";import{r as y}from"./react-vendor-Bjx91N7w.js";import{t as k}from"./notifications-B4_o8bcr.js";import{B as R,d as a,c as E,bc as z,W as S}from"./index-BRtgic66.js";import{aX as B,L as m,au as L,o as P,R as T}from"./icons-DQFHtVq5.js";function F({title:c,pathLabel:x,loading:t,parseWarning:r,readWarning:i,value:s,dirty:n,readOnly:h=!1,saving:f,saveDisabled:j,onChange:p,onSave:u,onRefresh:b,onDiscard:l,language:v="json",loadingLabel:N="Loading settings.json...",parseWarningLabel:g="Parse warning",ownershipNotice:d}){const[w,o]=y.useState(!1),C=async()=>{s&&(await navigator.clipboard.writeText(s),o(!0),k.success(S.t("commonToast.settingsCopied")),window.setTimeout(()=>o(!1),1500))};return e.jsxs("div",{className:"h-full flex flex-col",children:[e.jsxs("div",{className:"p-4 border-b bg-background flex items-center justify-between gap-2",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsxs("h2",{className:"font-semibold flex items-center gap-2",children:[e.jsx(B,{className:"h-4 w-4 text-primary"}),c,n&&e.jsx(R,{variant:"secondary",className:"text-[10px]",children:"Unsaved"})]}),e.jsx("p",{className:"text-xs text-muted-foreground font-mono truncate",children:x})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs(a,{size:"sm",onClick:u,disabled:j,children:[f?e.jsx(m,{className:"h-4 w-4 mr-1 animate-spin"}):e.jsx(L,{className:"h-4 w-4 mr-1"}),"Save"]}),l?e.jsx(a,{variant:"outline",size:"sm",onClick:l,disabled:!n||t,children:"Discard"}):null,e.jsxs(a,{variant:"outline",size:"sm",onClick:C,disabled:!s,children:[e.jsx(P,{className:"h-4 w-4 mr-1"}),w?"Copied":"Copy"]}),e.jsx(a,{variant:"outline",size:"sm",onClick:b,"aria-label":"Refresh raw config",children:e.jsx(T,{className:E("h-4 w-4",t?"animate-spin":"")})})]})]}),e.jsx("div",{className:"flex-1 overflow-auto",children:t?e.jsxs("div",{className:"h-full flex items-center justify-center text-muted-foreground",children:[e.jsx(m,{className:"h-5 w-5 animate-spin mr-2"}),N]}):e.jsxs("div",{className:"flex h-full min-h-0 flex-col",children:[d&&e.jsx("div",{className:"mx-4 mt-4",children:d}),r&&e.jsxs("div",{className:"mx-4 mt-4 rounded-md border border-amber-300 bg-amber-50 px-3 py-2 text-sm text-amber-800 dark:bg-amber-950/20 dark:text-amber-300",children:[g,": ",r]}),i&&e.jsxs("div",{className:"mx-4 mt-4 rounded-md border border-destructive/40 bg-destructive/5 px-3 py-2 text-sm text-destructive",children:["Read-only: ",i]}),e.jsx("div",{className:"min-h-0 flex-1 p-4 pt-3",children:e.jsx("div",{className:"h-full rounded-md border overflow-hidden bg-background",children:e.jsx(z,{value:s,onChange:p,language:v,readonly:h,minHeight:"100%",heightMode:"fill-parent"})})})]})})]})}const q=F;export{F as R,q as a};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
function at(e,t){for(var r=0;r<t.length;r++){const n=t[r];if(typeof n!="string"&&!Array.isArray(n)){for(const i in n)if(i!=="default"&&!(i in e)){const u=Object.getOwnPropertyDescriptor(n,i);u&&Object.defineProperty(e,i,u.get?u:{enumerable:!0,get:()=>n[i]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}var Mr=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Ie(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var ce={exports:{}},R={};var be;function ot(){if(be)return R;be=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),n=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),u=Symbol.for("react.consumer"),s=Symbol.for("react.context"),f=Symbol.for("react.forward_ref"),l=Symbol.for("react.suspense"),a=Symbol.for("react.memo"),d=Symbol.for("react.lazy"),h=Symbol.for("react.activity"),m=Symbol.iterator;function v(o){return o===null||typeof o!="object"?null:(o=m&&o[m]||o["@@iterator"],typeof o=="function"?o:null)}var w={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},S=Object.assign,y={};function g(o,p,_){this.props=o,this.context=p,this.refs=y,this.updater=_||w}g.prototype.isReactComponent={},g.prototype.setState=function(o,p){if(typeof o!="object"&&typeof o!="function"&&o!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,o,p,"setState")},g.prototype.forceUpdate=function(o){this.updater.enqueueForceUpdate(this,o,"forceUpdate")};function E(){}E.prototype=g.prototype;function P(o,p,_){this.props=o,this.context=p,this.refs=y,this.updater=_||w}var $=P.prototype=new E;$.constructor=P,S($,g.prototype),$.isPureReactComponent=!0;var A=Array.isArray;function U(){}var x={H:null,A:null,T:null,S:null},q=Object.prototype.hasOwnProperty;function F(o,p,_){var C=_.ref;return{$$typeof:e,type:o,key:p,ref:C!==void 0?C:null,props:_}}function I(o,p){return F(o.type,p,o.props)}function z(o){return typeof o=="object"&&o!==null&&o.$$typeof===e}function te(o){var p={"=":"=0",":":"=2"};return"$"+o.replace(/[=:]/g,function(_){return p[_]})}var Pe=/\/+/g;function se(o,p){return typeof o=="object"&&o!==null&&o.key!=null?te(""+o.key):p.toString(36)}function et(o){switch(o.status){case"fulfilled":return o.value;case"rejected":throw o.reason;default:switch(typeof o.status=="string"?o.then(U,U):(o.status="pending",o.then(function(p){o.status==="pending"&&(o.status="fulfilled",o.value=p)},function(p){o.status==="pending"&&(o.status="rejected",o.reason=p)})),o.status){case"fulfilled":return o.value;case"rejected":throw o.reason}}throw o}function K(o,p,_,C,b){var T=typeof o;(T==="undefined"||T==="boolean")&&(o=null);var L=!1;if(o===null)L=!0;else switch(T){case"bigint":case"string":case"number":L=!0;break;case"object":switch(o.$$typeof){case e:case t:L=!0;break;case d:return L=o._init,K(L(o._payload),p,_,C,b)}}if(L)return b=b(o),L=C===""?"."+se(o,0):C,A(b)?(_="",L!=null&&(_=L.replace(Pe,"$&/")+"/"),K(b,p,_,"",function(nt){return nt})):b!=null&&(z(b)&&(b=I(b,_+(b.key==null||o&&o.key===b.key?"":(""+b.key).replace(Pe,"$&/")+"/")+L)),p.push(b)),1;L=0;var j=C===""?".":C+":";if(A(o))for(var N=0;N<o.length;N++)C=o[N],T=j+se(C,N),L+=K(C,p,_,T,b);else if(N=v(o),typeof N=="function")for(o=N.call(o),N=0;!(C=o.next()).done;)C=C.value,T=j+se(C,N++),L+=K(C,p,_,T,b);else if(T==="object"){if(typeof o.then=="function")return K(et(o),p,_,C,b);throw p=String(o),Error("Objects are not valid as a React child (found: "+(p==="[object Object]"?"object with keys {"+Object.keys(o).join(", ")+"}":p)+"). If you meant to render a collection of children, use an array instead.")}return L}function re(o,p,_){if(o==null)return o;var C=[],b=0;return K(o,C,"","",function(T){return p.call(_,T,b++)}),C}function tt(o){if(o._status===-1){var p=o._result;p=p(),p.then(function(_){(o._status===0||o._status===-1)&&(o._status=1,o._result=_)},function(_){(o._status===0||o._status===-1)&&(o._status=2,o._result=_)}),o._status===-1&&(o._status=0,o._result=p)}if(o._status===1)return o._result.default;throw o._result}var xe=typeof reportError=="function"?reportError:function(o){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var p=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof o=="object"&&o!==null&&typeof o.message=="string"?String(o.message):String(o),error:o});if(!window.dispatchEvent(p))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",o);return}console.error(o)},rt={map:re,forEach:function(o,p,_){re(o,function(){p.apply(this,arguments)},_)},count:function(o){var p=0;return re(o,function(){p++}),p},toArray:function(o){return re(o,function(p){return p})||[]},only:function(o){if(!z(o))throw Error("React.Children.only expected to receive a single React element child.");return o}};return R.Activity=h,R.Children=rt,R.Component=g,R.Fragment=r,R.Profiler=i,R.PureComponent=P,R.StrictMode=n,R.Suspense=l,R.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=x,R.__COMPILER_RUNTIME={__proto__:null,c:function(o){return x.H.useMemoCache(o)}},R.cache=function(o){return function(){return o.apply(null,arguments)}},R.cacheSignal=function(){return null},R.cloneElement=function(o,p,_){if(o==null)throw Error("The argument must be a React element, but you passed "+o+".");var C=S({},o.props),b=o.key;if(p!=null)for(T in p.key!==void 0&&(b=""+p.key),p)!q.call(p,T)||T==="key"||T==="__self"||T==="__source"||T==="ref"&&p.ref===void 0||(C[T]=p[T]);var T=arguments.length-2;if(T===1)C.children=_;else if(1<T){for(var L=Array(T),j=0;j<T;j++)L[j]=arguments[j+2];C.children=L}return F(o.type,b,C)},R.createContext=function(o){return o={$$typeof:s,_currentValue:o,_currentValue2:o,_threadCount:0,Provider:null,Consumer:null},o.Provider=o,o.Consumer={$$typeof:u,_context:o},o},R.createElement=function(o,p,_){var C,b={},T=null;if(p!=null)for(C in p.key!==void 0&&(T=""+p.key),p)q.call(p,C)&&C!=="key"&&C!=="__self"&&C!=="__source"&&(b[C]=p[C]);var L=arguments.length-2;if(L===1)b.children=_;else if(1<L){for(var j=Array(L),N=0;N<L;N++)j[N]=arguments[N+2];b.children=j}if(o&&o.defaultProps)for(C in L=o.defaultProps,L)b[C]===void 0&&(b[C]=L[C]);return F(o,T,b)},R.createRef=function(){return{current:null}},R.forwardRef=function(o){return{$$typeof:f,render:o}},R.isValidElement=z,R.lazy=function(o){return{$$typeof:d,_payload:{_status:-1,_result:o},_init:tt}},R.memo=function(o,p){return{$$typeof:a,type:o,compare:p===void 0?null:p}},R.startTransition=function(o){var p=x.T,_={};x.T=_;try{var C=o(),b=x.S;b!==null&&b(_,C),typeof C=="object"&&C!==null&&typeof C.then=="function"&&C.then(U,xe)}catch(T){xe(T)}finally{p!==null&&_.types!==null&&(p.types=_.types),x.T=p}},R.unstable_useCacheRefresh=function(){return x.H.useCacheRefresh()},R.use=function(o){return x.H.use(o)},R.useActionState=function(o,p,_){return x.H.useActionState(o,p,_)},R.useCallback=function(o,p){return x.H.useCallback(o,p)},R.useContext=function(o){return x.H.useContext(o)},R.useDebugValue=function(){},R.useDeferredValue=function(o,p){return x.H.useDeferredValue(o,p)},R.useEffect=function(o,p){return x.H.useEffect(o,p)},R.useEffectEvent=function(o){return x.H.useEffectEvent(o)},R.useId=function(){return x.H.useId()},R.useImperativeHandle=function(o,p,_){return x.H.useImperativeHandle(o,p,_)},R.useInsertionEffect=function(o,p){return x.H.useInsertionEffect(o,p)},R.useLayoutEffect=function(o,p){return x.H.useLayoutEffect(o,p)},R.useMemo=function(o,p){return x.H.useMemo(o,p)},R.useOptimistic=function(o,p){return x.H.useOptimistic(o,p)},R.useReducer=function(o,p,_){return x.H.useReducer(o,p,_)},R.useRef=function(o){return x.H.useRef(o)},R.useState=function(o){return x.H.useState(o)},R.useSyncExternalStore=function(o,p,_){return x.H.useSyncExternalStore(o,p,_)},R.useTransition=function(){return x.H.useTransition()},R.version="19.2.1",R}var Te;function He(){return Te||(Te=1,ce.exports=ot()),ce.exports}var c=He();const it=Ie(c),Ir=at({__proto__:null,default:it},[c]);var fe={exports:{}},k={};var Le;function ut(){if(Le)return k;Le=1;var e=He();function t(l){var a="https://react.dev/errors/"+l;if(1<arguments.length){a+="?args[]="+encodeURIComponent(arguments[1]);for(var d=2;d<arguments.length;d++)a+="&args[]="+encodeURIComponent(arguments[d])}return"Minified React error #"+l+"; visit "+a+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function r(){}var n={d:{f:r,r:function(){throw Error(t(522))},D:r,C:r,L:r,m:r,X:r,S:r,M:r},p:0,findDOMNode:null},i=Symbol.for("react.portal");function u(l,a,d){var h=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:i,key:h==null?null:""+h,children:l,containerInfo:a,implementation:d}}var s=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function f(l,a){if(l==="font")return"";if(typeof a=="string")return a==="use-credentials"?a:""}return k.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=n,k.createPortal=function(l,a){var d=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!a||a.nodeType!==1&&a.nodeType!==9&&a.nodeType!==11)throw Error(t(299));return u(l,a,null,d)},k.flushSync=function(l){var a=s.T,d=n.p;try{if(s.T=null,n.p=2,l)return l()}finally{s.T=a,n.p=d,n.d.f()}},k.preconnect=function(l,a){typeof l=="string"&&(a?(a=a.crossOrigin,a=typeof a=="string"?a==="use-credentials"?a:"":void 0):a=null,n.d.C(l,a))},k.prefetchDNS=function(l){typeof l=="string"&&n.d.D(l)},k.preinit=function(l,a){if(typeof l=="string"&&a&&typeof a.as=="string"){var d=a.as,h=f(d,a.crossOrigin),m=typeof a.integrity=="string"?a.integrity:void 0,v=typeof a.fetchPriority=="string"?a.fetchPriority:void 0;d==="style"?n.d.S(l,typeof a.precedence=="string"?a.precedence:void 0,{crossOrigin:h,integrity:m,fetchPriority:v}):d==="script"&&n.d.X(l,{crossOrigin:h,integrity:m,fetchPriority:v,nonce:typeof a.nonce=="string"?a.nonce:void 0})}},k.preinitModule=function(l,a){if(typeof l=="string")if(typeof a=="object"&&a!==null){if(a.as==null||a.as==="script"){var d=f(a.as,a.crossOrigin);n.d.M(l,{crossOrigin:d,integrity:typeof a.integrity=="string"?a.integrity:void 0,nonce:typeof a.nonce=="string"?a.nonce:void 0})}}else a==null&&n.d.M(l)},k.preload=function(l,a){if(typeof l=="string"&&typeof a=="object"&&a!==null&&typeof a.as=="string"){var d=a.as,h=f(d,a.crossOrigin);n.d.L(l,d,{crossOrigin:h,integrity:typeof a.integrity=="string"?a.integrity:void 0,nonce:typeof a.nonce=="string"?a.nonce:void 0,type:typeof a.type=="string"?a.type:void 0,fetchPriority:typeof a.fetchPriority=="string"?a.fetchPriority:void 0,referrerPolicy:typeof a.referrerPolicy=="string"?a.referrerPolicy:void 0,imageSrcSet:typeof a.imageSrcSet=="string"?a.imageSrcSet:void 0,imageSizes:typeof a.imageSizes=="string"?a.imageSizes:void 0,media:typeof a.media=="string"?a.media:void 0})}},k.preloadModule=function(l,a){if(typeof l=="string")if(a){var d=f(a.as,a.crossOrigin);n.d.m(l,{as:typeof a.as=="string"&&a.as!=="script"?a.as:void 0,crossOrigin:d,integrity:typeof a.integrity=="string"?a.integrity:void 0})}else n.d.m(l)},k.requestFormReset=function(l){n.d.r(l)},k.unstable_batchedUpdates=function(l,a){return l(a)},k.useFormState=function(l,a,d){return s.H.useFormState(l,a,d)},k.useFormStatus=function(){return s.H.useHostTransitionStatus()},k.version="19.2.1",k}var Oe;function lt(){if(Oe)return fe.exports;Oe=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),fe.exports=ut(),fe.exports}var $e="popstate";function st(e={}){function t(n,i){let{pathname:u,search:s,hash:f}=n.location;return pe("",{pathname:u,search:s,hash:f},i.state&&i.state.usr||null,i.state&&i.state.key||"default")}function r(n,i){return typeof i=="string"?i:Q(i)}return ft(t,r,null,e)}function O(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function D(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function ct(){return Math.random().toString(36).substring(2,10)}function ke(e,t){return{usr:e.state,key:e.key,idx:t}}function pe(e,t,r=null,n){return{pathname:typeof e=="string"?e:e.pathname,search:"",hash:"",...typeof t=="string"?V(t):t,state:r,key:t&&t.key||n||ct()}}function Q({pathname:e="/",search:t="",hash:r=""}){return t&&t!=="?"&&(e+=t.charAt(0)==="?"?t:"?"+t),r&&r!=="#"&&(e+=r.charAt(0)==="#"?r:"#"+r),e}function V(e){let t={};if(e){let r=e.indexOf("#");r>=0&&(t.hash=e.substring(r),e=e.substring(0,r));let n=e.indexOf("?");n>=0&&(t.search=e.substring(n),e=e.substring(0,n)),e&&(t.pathname=e)}return t}function ft(e,t,r,n={}){let{window:i=document.defaultView,v5Compat:u=!1}=n,s=i.history,f="POP",l=null,a=d();a==null&&(a=0,s.replaceState({...s.state,idx:a},""));function d(){return(s.state||{idx:null}).idx}function h(){f="POP";let y=d(),g=y==null?null:y-a;a=y,l&&l({action:f,location:S.location,delta:g})}function m(y,g){f="PUSH";let E=pe(S.location,y,g);a=d()+1;let P=ke(E,a),$=S.createHref(E);try{s.pushState(P,"",$)}catch(A){if(A instanceof DOMException&&A.name==="DataCloneError")throw A;i.location.assign($)}u&&l&&l({action:f,location:S.location,delta:1})}function v(y,g){f="REPLACE";let E=pe(S.location,y,g);a=d();let P=ke(E,a),$=S.createHref(E);s.replaceState(P,"",$),u&&l&&l({action:f,location:S.location,delta:0})}function w(y){return dt(y)}let S={get action(){return f},get location(){return e(i,s)},listen(y){if(l)throw new Error("A history only accepts one active listener");return i.addEventListener($e,h),l=y,()=>{i.removeEventListener($e,h),l=null}},createHref(y){return t(i,y)},createURL:w,encodeLocation(y){let g=w(y);return{pathname:g.pathname,search:g.search,hash:g.hash}},push:m,replace:v,go(y){return s.go(y)}};return S}function dt(e,t=!1){let r="http://localhost";typeof window<"u"&&(r=window.location.origin!=="null"?window.location.origin:window.location.href),O(r,"No window.location.(origin|href) available to create URL");let n=typeof e=="string"?e:Q(e);return n=n.replace(/ $/,"%20"),!t&&n.startsWith("//")&&(n=r+n),new URL(n,r)}function Ue(e,t,r="/"){return ht(e,t,r,!1)}function ht(e,t,r,n){let i=typeof t=="string"?V(t):t,u=W(i.pathname||"/",r);if(u==null)return null;let s=Fe(e);pt(s);let f=null;for(let l=0;f==null&&l<s.length;++l){let a=Pt(u);f=_t(s[l],a,n)}return f}function Fe(e,t=[],r=[],n="",i=!1){let u=(s,f,l=i,a)=>{let d={relativePath:a===void 0?s.path||"":a,caseSensitive:s.caseSensitive===!0,childrenIndex:f,route:s};if(d.relativePath.startsWith("/")){if(!d.relativePath.startsWith(n)&&l)return;O(d.relativePath.startsWith(n),`Absolute route path "${d.relativePath}" nested under path "${n}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),d.relativePath=d.relativePath.slice(n.length)}let h=B([n,d.relativePath]),m=r.concat(d);s.children&&s.children.length>0&&(O(s.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${h}".`),Fe(s.children,t,m,h,l)),!(s.path==null&&!s.index)&&t.push({path:h,score:wt(h,s.index),routesMeta:m})};return e.forEach((s,f)=>{if(s.path===""||!s.path?.includes("?"))u(s,f);else for(let l of je(s.path))u(s,f,!0,l)}),t}function je(e){let t=e.split("/");if(t.length===0)return[];let[r,...n]=t,i=r.endsWith("?"),u=r.replace(/\?$/,"");if(n.length===0)return i?[u,""]:[u];let s=je(n.join("/")),f=[];return f.push(...s.map(l=>l===""?u:[u,l].join("/"))),i&&f.push(...s),f.map(l=>e.startsWith("/")&&l===""?"/":l)}function pt(e){e.sort((t,r)=>t.score!==r.score?r.score-t.score:Ct(t.routesMeta.map(n=>n.childrenIndex),r.routesMeta.map(n=>n.childrenIndex)))}var mt=/^:[\w-]+$/,yt=3,gt=2,vt=1,Et=10,Rt=-2,Ae=e=>e==="*";function wt(e,t){let r=e.split("/"),n=r.length;return r.some(Ae)&&(n+=Rt),t&&(n+=gt),r.filter(i=>!Ae(i)).reduce((i,u)=>i+(mt.test(u)?yt:u===""?vt:Et),n)}function Ct(e,t){return e.length===t.length&&e.slice(0,-1).every((n,i)=>n===t[i])?e[e.length-1]-t[t.length-1]:0}function _t(e,t,r=!1){let{routesMeta:n}=e,i={},u="/",s=[];for(let f=0;f<n.length;++f){let l=n[f],a=f===n.length-1,d=u==="/"?t:t.slice(u.length)||"/",h=ie({path:l.relativePath,caseSensitive:l.caseSensitive,end:a},d),m=l.route;if(!h&&a&&r&&!n[n.length-1].route.index&&(h=ie({path:l.relativePath,caseSensitive:l.caseSensitive,end:!1},d)),!h)return null;Object.assign(i,h.params),s.push({params:i,pathname:B([u,h.pathname]),pathnameBase:Ot(B([u,h.pathnameBase])),route:m}),h.pathnameBase!=="/"&&(u=B([u,h.pathnameBase]))}return s}function ie(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[r,n]=St(e.path,e.caseSensitive,e.end),i=t.match(r);if(!i)return null;let u=i[0],s=u.replace(/(.)\/+$/,"$1"),f=i.slice(1);return{params:n.reduce((a,{paramName:d,isOptional:h},m)=>{if(d==="*"){let w=f[m]||"";s=u.slice(0,u.length-w.length).replace(/(.)\/+$/,"$1")}const v=f[m];return h&&!v?a[d]=void 0:a[d]=(v||"").replace(/%2F/g,"/"),a},{}),pathname:u,pathnameBase:s,pattern:e}}function St(e,t=!1,r=!0){D(e==="*"||!e.endsWith("*")||e.endsWith("/*"),`Route path "${e}" will be treated as if it were "${e.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${e.replace(/\*$/,"/*")}".`);let n=[],i="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(s,f,l)=>(n.push({paramName:f,isOptional:l!=null}),l?"/?([^\\/]+)?":"/([^\\/]+)")).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return e.endsWith("*")?(n.push({paramName:"*"}),i+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):r?i+="\\/*$":e!==""&&e!=="/"&&(i+="(?:(?=\\/|$))"),[new RegExp(i,t?void 0:"i"),n]}function Pt(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return D(!1,`The URL path "${e}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${t}).`),e}}function W(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let r=t.endsWith("/")?t.length-1:t.length,n=e.charAt(r);return n&&n!=="/"?null:e.slice(r)||"/"}var xt=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,bt=e=>xt.test(e);function Tt(e,t="/"){let{pathname:r,search:n="",hash:i=""}=typeof e=="string"?V(e):e,u;if(r)if(bt(r))u=r;else{if(r.includes("//")){let s=r;r=r.replace(/\/\/+/g,"/"),D(!1,`Pathnames cannot have embedded double slashes - normalizing ${s} -> ${r}`)}r.startsWith("/")?u=Ne(r.substring(1),"/"):u=Ne(r,t)}else u=t;return{pathname:u,search:$t(n),hash:kt(i)}}function Ne(e,t){let r=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(i=>{i===".."?r.length>1&&r.pop():i!=="."&&r.push(i)}),r.length>1?r.join("/"):"/"}function de(e,t,r,n){return`Cannot include a '${e}' character in a manually specified \`to.${t}\` field [${JSON.stringify(n)}]. Please separate it out to the \`to.${r}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function Lt(e){return e.filter((t,r)=>r===0||t.route.path&&t.route.path.length>0)}function ge(e){let t=Lt(e);return t.map((r,n)=>n===t.length-1?r.pathname:r.pathnameBase)}function ve(e,t,r,n=!1){let i;typeof e=="string"?i=V(e):(i={...e},O(!i.pathname||!i.pathname.includes("?"),de("?","pathname","search",i)),O(!i.pathname||!i.pathname.includes("#"),de("#","pathname","hash",i)),O(!i.search||!i.search.includes("#"),de("#","search","hash",i)));let u=e===""||i.pathname==="",s=u?"/":i.pathname,f;if(s==null)f=r;else{let h=t.length-1;if(!n&&s.startsWith("..")){let m=s.split("/");for(;m[0]==="..";)m.shift(),h-=1;i.pathname=m.join("/")}f=h>=0?t[h]:"/"}let l=Tt(i,f),a=s&&s!=="/"&&s.endsWith("/"),d=(u||s===".")&&r.endsWith("/");return!l.pathname.endsWith("/")&&(a||d)&&(l.pathname+="/"),l}var B=e=>e.join("/").replace(/\/\/+/g,"/"),Ot=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),$t=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,kt=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;function At(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}function Nt(e){return e.map(t=>t.route.path).filter(Boolean).join("/").replace(/\/\/*/g,"/")||"/"}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var Be=["POST","PUT","PATCH","DELETE"];new Set(Be);var Dt=["GET",...Be];new Set(Dt);var G=c.createContext(null);G.displayName="DataRouter";var ue=c.createContext(null);ue.displayName="DataRouterState";c.createContext(!1);var We=c.createContext({isTransitioning:!1});We.displayName="ViewTransition";var Mt=c.createContext(new Map);Mt.displayName="Fetchers";var It=c.createContext(null);It.displayName="Await";var M=c.createContext(null);M.displayName="Navigation";var Z=c.createContext(null);Z.displayName="Location";var H=c.createContext({outlet:null,matches:[],isDataRoute:!1});H.displayName="Route";var Ee=c.createContext(null);Ee.displayName="RouteError";function Ht(e,{relative:t}={}){O(J(),"useHref() may be used only in the context of a <Router> component.");let{basename:r,navigator:n}=c.useContext(M),{hash:i,pathname:u,search:s}=ee(e,{relative:t}),f=u;return r!=="/"&&(f=u==="/"?r:B([r,u])),n.createHref({pathname:f,search:s,hash:i})}function J(){return c.useContext(Z)!=null}function Y(){return O(J(),"useLocation() may be used only in the context of a <Router> component."),c.useContext(Z).location}var Ye="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function ze(e){c.useContext(M).static||c.useLayoutEffect(e)}function Re(){let{isDataRoute:e}=c.useContext(H);return e?Zt():Ut()}function Ut(){O(J(),"useNavigate() may be used only in the context of a <Router> component.");let e=c.useContext(G),{basename:t,navigator:r}=c.useContext(M),{matches:n}=c.useContext(H),{pathname:i}=Y(),u=JSON.stringify(ge(n)),s=c.useRef(!1);return ze(()=>{s.current=!0}),c.useCallback((l,a={})=>{if(D(s.current,Ye),!s.current)return;if(typeof l=="number"){r.go(l);return}let d=ve(l,JSON.parse(u),i,a.relative==="path");e==null&&t!=="/"&&(d.pathname=d.pathname==="/"?t:B([t,d.pathname])),(a.replace?r.replace:r.push)(d,a.state,a)},[t,r,u,i,e])}var Ft=c.createContext(null);function jt(e){let t=c.useContext(H).outlet;return c.useMemo(()=>t&&c.createElement(Ft.Provider,{value:e},t),[t,e])}function ee(e,{relative:t}={}){let{matches:r}=c.useContext(H),{pathname:n}=Y(),i=JSON.stringify(ge(r));return c.useMemo(()=>ve(e,JSON.parse(i),n,t==="path"),[e,i,n,t])}function Bt(e,t){return qe(e,t)}function qe(e,t,r,n,i){O(J(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:u}=c.useContext(M),{matches:s}=c.useContext(H),f=s[s.length-1],l=f?f.params:{},a=f?f.pathname:"/",d=f?f.pathnameBase:"/",h=f&&f.route;{let E=h&&h.path||"";Ke(a,!h||E.endsWith("*")||E.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${a}" (under <Route path="${E}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
|
|
2
2
|
|
|
3
|
-
Please change the parent <Route path="${E}"> to <Route path="${E==="/"?"*":`${E}/*`}">.`)}let m=Y(),v;if(t){let E=typeof t=="string"?V(t):t;O(d==="/"||E.pathname?.startsWith(d),`When overriding the location using \`<Routes location>\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${d}" but pathname "${E.pathname}" was given in the \`location\` prop.`),v=E}else v=m;let w=v.pathname||"/",S=w;if(d!=="/"){let E=d.replace(/^\//,"").split("/");S="/"+w.replace(/^\//,"").split("/").slice(E.length).join("/")}let y=Ue(e,{pathname:S});D(h||y!=null,`No routes matched location "${v.pathname}${v.search}${v.hash}" `),D(y==null||y[y.length-1].route.element!==void 0||y[y.length-1].route.Component!==void 0||y[y.length-1].route.lazy!==void 0,`Matched leaf route at location "${v.pathname}${v.search}${v.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`);let g=Kt(y&&y.map(E=>Object.assign({},E,{params:Object.assign({},l,E.params),pathname:B([d,u.encodeLocation?u.encodeLocation(E.pathname.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:E.pathname]),pathnameBase:E.pathnameBase==="/"?d:B([d,u.encodeLocation?u.encodeLocation(E.pathnameBase.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:E.pathnameBase])})),s,r,n,i);return t&&g?c.createElement(Z.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",...v},navigationType:"POP"}},g):g}function Wt(){let e=Qt(),t=At(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),r=e instanceof Error?e.stack:null,n="rgba(200,200,200, 0.5)",i={padding:"0.5rem",backgroundColor:n},u={padding:"2px 4px",backgroundColor:n},s=null;return console.error("Error handled by React Router default ErrorBoundary:",e),s=c.createElement(c.Fragment,null,c.createElement("p",null,"💿 Hey developer 👋"),c.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",c.createElement("code",{style:u},"ErrorBoundary")," or"," ",c.createElement("code",{style:u},"errorElement")," prop on your route.")),c.createElement(c.Fragment,null,c.createElement("h2",null,"Unexpected Application Error!"),c.createElement("h3",{style:{fontStyle:"italic"}},t),r?c.createElement("pre",{style:i},r):null,s)}var Yt=c.createElement(Wt,null),zt=class extends c.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||t.revalidation!=="idle"&&e.revalidation==="idle"?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error!==void 0?e.error:t.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){this.props.onError?this.props.onError(e,t):console.error("React Router caught the following error during render",e)}render(){return this.state.error!==void 0?c.createElement(H.Provider,{value:this.props.routeContext},c.createElement(Ee.Provider,{value:this.state.error,children:this.props.component})):this.props.children}};function qt({routeContext:e,match:t,children:r}){let n=c.useContext(G);return n&&n.static&&n.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(n.staticContext._deepestRenderedBoundaryId=t.route.id),c.createElement(H.Provider,{value:e},r)}function Kt(e,t=[],r=null,n=null,i=null){if(e==null){if(!r)return null;if(r.errors)e=r.matches;else if(t.length===0&&!r.initialized&&r.matches.length>0)e=r.matches;else return null}let u=e,s=r?.errors;if(s!=null){let d=u.findIndex(h=>h.route.id&&s?.[h.route.id]!==void 0);O(d>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(s).join(",")}`),u=u.slice(0,Math.min(u.length,d+1))}let f=!1,l=-1;if(r)for(let d=0;d<u.length;d++){let h=u[d];if((h.route.HydrateFallback||h.route.hydrateFallbackElement)&&(l=d),h.route.id){let{loaderData:m,errors:v}=r,w=h.route.loader&&!m.hasOwnProperty(h.route.id)&&(!v||v[h.route.id]===void 0);if(h.route.lazy||w){f=!0,l>=0?u=u.slice(0,l+1):u=[u[0]];break}}}let a=r&&n?(d,h)=>{n(d,{location:r.location,params:r.matches?.[0]?.params??{},unstable_pattern:Nt(r.matches),errorInfo:h})}:void 0;return u.reduceRight((d,h,m)=>{let v,w=!1,S=null,y=null;r&&(v=s&&h.route.id?s[h.route.id]:void 0,S=h.route.errorElement||Yt,f&&(l<0&&m===0?(Ke("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),w=!0,y=null):l===m&&(w=!0,y=h.route.hydrateFallbackElement||null)));let g=t.concat(u.slice(0,m+1)),E=()=>{let P;return v?P=S:w?P=y:h.route.Component?P=c.createElement(h.route.Component,null):h.route.element?P=h.route.element:P=d,c.createElement(qt,{match:h,routeContext:{outlet:d,matches:g,isDataRoute:r!=null},children:P})};return r&&(h.route.ErrorBoundary||h.route.errorElement||m===0)?c.createElement(zt,{location:r.location,revalidation:r.revalidation,component:S,error:v,children:E(),routeContext:{outlet:null,matches:g,isDataRoute:!0},onError:a}):E()},null)}function we(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function Vt(e){let t=c.useContext(G);return O(t,we(e)),t}function Gt(e){let t=c.useContext(ue);return O(t,we(e)),t}function Jt(e){let t=c.useContext(H);return O(t,we(e)),t}function Ce(e){let t=Jt(e),r=t.matches[t.matches.length-1];return O(r.route.id,`${e} can only be used on routes that contain a unique "id"`),r.route.id}function Xt(){return Ce("useRouteId")}function Qt(){let e=c.useContext(Ee),t=Gt("useRouteError"),r=Ce("useRouteError");return e!==void 0?e:t.errors?.[r]}function Zt(){let{router:e}=Vt("useNavigate"),t=Ce("useNavigate"),r=c.useRef(!1);return ze(()=>{r.current=!0}),c.useCallback(async(i,u={})=>{D(r.current,Ye),r.current&&(typeof i=="number"?await e.navigate(i):await e.navigate(i,{fromRouteId:t,...u}))},[e,t])}var De={};function Ke(e,t,r){!t&&!De[e]&&(De[e]=!0,D(!1,r))}c.memo(er);function er({routes:e,future:t,state:r,unstable_onError:n}){return qe(e,void 0,r,n,t)}function Hr({to:e,replace:t,state:r,relative:n}){O(J(),"<Navigate> may be used only in the context of a <Router> component.");let{static:i}=c.useContext(M);D(!i,"<Navigate> must not be used on the initial render in a <StaticRouter>. This is a no-op, but you should modify your code so the <Navigate> is only ever rendered in response to some user interaction or state change.");let{matches:u}=c.useContext(H),{pathname:s}=Y(),f=Re(),l=ve(e,ge(u),s,n==="path"),a=JSON.stringify(l);return c.useEffect(()=>{f(JSON.parse(a),{replace:t,state:r,relative:n})},[f,a,n,t,r]),null}function Ur(e){return jt(e.context)}function tr(e){O(!1,"A <Route> is only ever to be used as the child of <Routes> element, never rendered directly. Please wrap your <Route> in a <Routes>.")}function rr({basename:e="/",children:t=null,location:r,navigationType:n="POP",navigator:i,static:u=!1,unstable_useTransitions:s}){O(!J(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let f=e.replace(/^\/*/,"/"),l=c.useMemo(()=>({basename:f,navigator:i,static:u,unstable_useTransitions:s,future:{}}),[f,i,u,s]);typeof r=="string"&&(r=V(r));let{pathname:a="/",search:d="",hash:h="",state:m=null,key:v="default"}=r,w=c.useMemo(()=>{let S=W(a,f);return S==null?null:{location:{pathname:S,search:d,hash:h,state:m,key:v},navigationType:n}},[f,a,d,h,m,v,n]);return D(w!=null,`<Router basename="${f}"> is not able to match the URL "${a}${d}${h}" because it does not start with the basename, so the <Router> won't render anything.`),w==null?null:c.createElement(M.Provider,{value:l},c.createElement(Z.Provider,{children:t,value:w}))}function Fr({children:e,location:t}){return Bt(me(e),t)}function me(e,t=[]){let r=[];return c.Children.forEach(e,(n,i)=>{if(!c.isValidElement(n))return;let u=[...t,i];if(n.type===c.Fragment){r.push.apply(r,me(n.props.children,u));return}O(n.type===tr,`[${typeof n.type=="string"?n.type:n.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),O(!n.props.index||!n.props.children,"An index route cannot have child routes.");let s={id:n.props.id||u.join("-"),caseSensitive:n.props.caseSensitive,element:n.props.element,Component:n.props.Component,index:n.props.index,path:n.props.path,middleware:n.props.middleware,loader:n.props.loader,action:n.props.action,hydrateFallbackElement:n.props.hydrateFallbackElement,HydrateFallback:n.props.HydrateFallback,errorElement:n.props.errorElement,ErrorBoundary:n.props.ErrorBoundary,hasErrorBoundary:n.props.hasErrorBoundary===!0||n.props.ErrorBoundary!=null||n.props.errorElement!=null,shouldRevalidate:n.props.shouldRevalidate,handle:n.props.handle,lazy:n.props.lazy};n.props.children&&(s.children=me(n.props.children,u)),r.push(s)}),r}var ae="get",oe="application/x-www-form-urlencoded";function le(e){return typeof HTMLElement<"u"&&e instanceof HTMLElement}function nr(e){return le(e)&&e.tagName.toLowerCase()==="button"}function ar(e){return le(e)&&e.tagName.toLowerCase()==="form"}function or(e){return le(e)&&e.tagName.toLowerCase()==="input"}function ir(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function ur(e,t){return e.button===0&&(!t||t==="_self")&&!ir(e)}function ye(e=""){return new URLSearchParams(typeof e=="string"||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,r)=>{let n=e[r];return t.concat(Array.isArray(n)?n.map(i=>[r,i]):[[r,n]])},[]))}function lr(e,t){let r=ye(e);return t&&t.forEach((n,i)=>{r.has(i)||t.getAll(i).forEach(u=>{r.append(i,u)})}),r}var ne=null;function sr(){if(ne===null)try{new FormData(document.createElement("form"),0),ne=!1}catch{ne=!0}return ne}var cr=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function he(e){return e!=null&&!cr.has(e)?(D(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${oe}"`),null):e}function fr(e,t){let r,n,i,u,s;if(ar(e)){let f=e.getAttribute("action");n=f?W(f,t):null,r=e.getAttribute("method")||ae,i=he(e.getAttribute("enctype"))||oe,u=new FormData(e)}else if(nr(e)||or(e)&&(e.type==="submit"||e.type==="image")){let f=e.form;if(f==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let l=e.getAttribute("formaction")||f.getAttribute("action");if(n=l?W(l,t):null,r=e.getAttribute("formmethod")||f.getAttribute("method")||ae,i=he(e.getAttribute("formenctype"))||he(f.getAttribute("enctype"))||oe,u=new FormData(f,e),!sr()){let{name:a,type:d,value:h}=e;if(d==="image"){let m=a?`${a}.`:"";u.append(`${m}x`,"0"),u.append(`${m}y`,"0")}else a&&u.append(a,h)}}else{if(le(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');r=ae,n=null,i=oe,s=e}return u&&i==="text/plain"&&(s=u,u=void 0),{action:n,method:r.toLowerCase(),encType:i,formData:u,body:s}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function _e(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function dr(e,t,r){let n=typeof e=="string"?new URL(e,typeof window>"u"?"server://singlefetch/":window.location.origin):e;return n.pathname==="/"?n.pathname=`_root.${r}`:t&&W(n.pathname,t)==="/"?n.pathname=`${t.replace(/\/$/,"")}/_root.${r}`:n.pathname=`${n.pathname.replace(/\/$/,"")}.${r}`,n}async function hr(e,t){if(e.id in t)return t[e.id];try{let r=await import(e.module);return t[e.id]=r,r}catch(r){return console.error(`Error loading route module \`${e.module}\`, reloading page...`),console.error(r),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function pr(e){return e==null?!1:e.href==null?e.rel==="preload"&&typeof e.imageSrcSet=="string"&&typeof e.imageSizes=="string":typeof e.rel=="string"&&typeof e.href=="string"}async function mr(e,t,r){let n=await Promise.all(e.map(async i=>{let u=t.routes[i.route.id];if(u){let s=await hr(u,r);return s.links?s.links():[]}return[]}));return Er(n.flat(1).filter(pr).filter(i=>i.rel==="stylesheet"||i.rel==="preload").map(i=>i.rel==="stylesheet"?{...i,rel:"prefetch",as:"style"}:{...i,rel:"prefetch"}))}function Me(e,t,r,n,i,u){let s=(l,a)=>r[a]?l.route.id!==r[a].route.id:!0,f=(l,a)=>r[a].pathname!==l.pathname||r[a].route.path?.endsWith("*")&&r[a].params["*"]!==l.params["*"];return u==="assets"?t.filter((l,a)=>s(l,a)||f(l,a)):u==="data"?t.filter((l,a)=>{let d=n.routes[l.route.id];if(!d||!d.hasLoader)return!1;if(s(l,a)||f(l,a))return!0;if(l.route.shouldRevalidate){let h=l.route.shouldRevalidate({currentUrl:new URL(i.pathname+i.search+i.hash,window.origin),currentParams:r[0]?.params||{},nextUrl:new URL(e,window.origin),nextParams:l.params,defaultShouldRevalidate:!0});if(typeof h=="boolean")return h}return!0}):[]}function yr(e,t,{includeHydrateFallback:r}={}){return gr(e.map(n=>{let i=t.routes[n.route.id];if(!i)return[];let u=[i.module];return i.clientActionModule&&(u=u.concat(i.clientActionModule)),i.clientLoaderModule&&(u=u.concat(i.clientLoaderModule)),r&&i.hydrateFallbackModule&&(u=u.concat(i.hydrateFallbackModule)),i.imports&&(u=u.concat(i.imports)),u}).flat(1))}function gr(e){return[...new Set(e)]}function vr(e){let t={},r=Object.keys(e).sort();for(let n of r)t[n]=e[n];return t}function Er(e,t){let r=new Set;return new Set(t),e.reduce((n,i)=>{let u=JSON.stringify(vr(i));return r.has(u)||(r.add(u),n.push({key:u,link:i})),n},[])}function Ve(){let e=c.useContext(G);return _e(e,"You must render this element inside a <DataRouterContext.Provider> element"),e}function Rr(){let e=c.useContext(ue);return _e(e,"You must render this element inside a <DataRouterStateContext.Provider> element"),e}var Se=c.createContext(void 0);Se.displayName="FrameworkContext";function Ge(){let e=c.useContext(Se);return _e(e,"You must render this element inside a <HydratedRouter> element"),e}function wr(e,t){let r=c.useContext(Se),[n,i]=c.useState(!1),[u,s]=c.useState(!1),{onFocus:f,onBlur:l,onMouseEnter:a,onMouseLeave:d,onTouchStart:h}=t,m=c.useRef(null);c.useEffect(()=>{if(e==="render"&&s(!0),e==="viewport"){let S=g=>{g.forEach(E=>{s(E.isIntersecting)})},y=new IntersectionObserver(S,{threshold:.5});return m.current&&y.observe(m.current),()=>{y.disconnect()}}},[e]),c.useEffect(()=>{if(n){let S=setTimeout(()=>{s(!0)},100);return()=>{clearTimeout(S)}}},[n]);let v=()=>{i(!0)},w=()=>{i(!1),s(!1)};return r?e!=="intent"?[u,m,{}]:[u,m,{onFocus:X(f,v),onBlur:X(l,w),onMouseEnter:X(a,v),onMouseLeave:X(d,w),onTouchStart:X(h,v)}]:[!1,m,{}]}function X(e,t){return r=>{e&&e(r),r.defaultPrevented||t(r)}}function Cr({page:e,...t}){let{router:r}=Ve(),n=c.useMemo(()=>Ue(r.routes,e,r.basename),[r.routes,e,r.basename]);return n?c.createElement(Sr,{page:e,matches:n,...t}):null}function _r(e){let{manifest:t,routeModules:r}=Ge(),[n,i]=c.useState([]);return c.useEffect(()=>{let u=!1;return mr(e,t,r).then(s=>{u||i(s)}),()=>{u=!0}},[e,t,r]),n}function Sr({page:e,matches:t,...r}){let n=Y(),{manifest:i,routeModules:u}=Ge(),{basename:s}=Ve(),{loaderData:f,matches:l}=Rr(),a=c.useMemo(()=>Me(e,t,l,i,n,"data"),[e,t,l,i,n]),d=c.useMemo(()=>Me(e,t,l,i,n,"assets"),[e,t,l,i,n]),h=c.useMemo(()=>{if(e===n.pathname+n.search+n.hash)return[];let w=new Set,S=!1;if(t.forEach(g=>{let E=i.routes[g.route.id];!E||!E.hasLoader||(!a.some(P=>P.route.id===g.route.id)&&g.route.id in f&&u[g.route.id]?.shouldRevalidate||E.hasClientLoader?S=!0:w.add(g.route.id))}),w.size===0)return[];let y=dr(e,s,"data");return S&&w.size>0&&y.searchParams.set("_routes",t.filter(g=>w.has(g.route.id)).map(g=>g.route.id).join(",")),[y.pathname+y.search]},[s,f,n,i,a,t,e,u]),m=c.useMemo(()=>yr(d,i),[d,i]),v=_r(d);return c.createElement(c.Fragment,null,h.map(w=>c.createElement("link",{key:w,rel:"prefetch",as:"fetch",href:w,...r})),m.map(w=>c.createElement("link",{key:w,rel:"modulepreload",href:w,...r})),v.map(({key:w,link:S})=>c.createElement("link",{key:w,nonce:r.nonce,...S})))}function Pr(...e){return t=>{e.forEach(r=>{typeof r=="function"?r(t):r!=null&&(r.current=t)})}}var Je=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{Je&&(window.__reactRouterVersion="7.10.1")}catch{}function jr({basename:e,children:t,unstable_useTransitions:r,window:n}){let i=c.useRef();i.current==null&&(i.current=st({window:n,v5Compat:!0}));let u=i.current,[s,f]=c.useState({action:u.action,location:u.location}),l=c.useCallback(a=>{r===!1?f(a):c.startTransition(()=>f(a))},[r]);return c.useLayoutEffect(()=>u.listen(l),[u,l]),c.createElement(rr,{basename:e,children:t,location:s.location,navigationType:s.action,navigator:u,unstable_useTransitions:r===!0})}var Xe=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Qe=c.forwardRef(function({onClick:t,discover:r="render",prefetch:n="none",relative:i,reloadDocument:u,replace:s,state:f,target:l,to:a,preventScrollReset:d,viewTransition:h,...m},v){let{basename:w,unstable_useTransitions:S}=c.useContext(M),y=typeof a=="string"&&Xe.test(a),g,E=!1;if(typeof a=="string"&&y&&(g=a,Je))try{let I=new URL(window.location.href),z=a.startsWith("//")?new URL(I.protocol+a):new URL(a),te=W(z.pathname,w);z.origin===I.origin&&te!=null?a=te+z.search+z.hash:E=!0}catch{D(!1,`<Link to="${a}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}let P=Ht(a,{relative:i}),[$,A,U]=wr(n,m),x=Lr(a,{replace:s,state:f,target:l,preventScrollReset:d,relative:i,viewTransition:h,unstable_useTransitions:S});function q(I){t&&t(I),I.defaultPrevented||x(I)}let F=c.createElement("a",{...m,...U,href:g||P,onClick:E||u?t:q,ref:Pr(v,A),target:l,"data-discover":!y&&r==="render"?"true":void 0});return $&&!y?c.createElement(c.Fragment,null,F,c.createElement(Cr,{page:P})):F});Qe.displayName="Link";var xr=c.forwardRef(function({"aria-current":t="page",caseSensitive:r=!1,className:n="",end:i=!1,style:u,to:s,viewTransition:f,children:l,...a},d){let h=ee(s,{relative:a.relative}),m=Y(),v=c.useContext(ue),{navigator:w,basename:S}=c.useContext(M),y=v!=null&&Nr(h)&&f===!0,g=w.encodeLocation?w.encodeLocation(h).pathname:h.pathname,E=m.pathname,P=v&&v.navigation&&v.navigation.location?v.navigation.location.pathname:null;r||(E=E.toLowerCase(),P=P?P.toLowerCase():null,g=g.toLowerCase()),P&&S&&(P=W(P,S)||P);const $=g!=="/"&&g.endsWith("/")?g.length-1:g.length;let A=E===g||!i&&E.startsWith(g)&&E.charAt($)==="/",U=P!=null&&(P===g||!i&&P.startsWith(g)&&P.charAt(g.length)==="/"),x={isActive:A,isPending:U,isTransitioning:y},q=A?t:void 0,F;typeof n=="function"?F=n(x):F=[n,A?"active":null,U?"pending":null,y?"transitioning":null].filter(Boolean).join(" ");let I=typeof u=="function"?u(x):u;return c.createElement(Qe,{...a,"aria-current":q,className:F,ref:d,style:I,to:s,viewTransition:f},typeof l=="function"?l(x):l)});xr.displayName="NavLink";var br=c.forwardRef(({discover:e="render",fetcherKey:t,navigate:r,reloadDocument:n,replace:i,state:u,method:s=ae,action:f,onSubmit:l,relative:a,preventScrollReset:d,viewTransition:h,...m},v)=>{let{unstable_useTransitions:w}=c.useContext(M),S=kr(),y=Ar(f,{relative:a}),g=s.toLowerCase()==="get"?"get":"post",E=typeof f=="string"&&Xe.test(f),P=$=>{if(l&&l($),$.defaultPrevented)return;$.preventDefault();let A=$.nativeEvent.submitter,U=A?.getAttribute("formmethod")||s,x=()=>S(A||$.currentTarget,{fetcherKey:t,method:U,navigate:r,replace:i,state:u,relative:a,preventScrollReset:d,viewTransition:h});w&&r!==!1?c.startTransition(()=>x()):x()};return c.createElement("form",{ref:v,method:g,action:y,onSubmit:n?l:P,...m,"data-discover":!E&&e==="render"?"true":void 0})});br.displayName="Form";function Tr(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function Ze(e){let t=c.useContext(G);return O(t,Tr(e)),t}function Lr(e,{target:t,replace:r,state:n,preventScrollReset:i,relative:u,viewTransition:s,unstable_useTransitions:f}={}){let l=Re(),a=Y(),d=ee(e,{relative:u});return c.useCallback(h=>{if(ur(h,t)){h.preventDefault();let m=r!==void 0?r:Q(a)===Q(d),v=()=>l(e,{replace:m,state:n,preventScrollReset:i,relative:u,viewTransition:s});f?c.startTransition(()=>v()):v()}},[a,l,d,r,n,t,e,i,u,s,f])}function Br(e){D(typeof URLSearchParams<"u","You cannot use the `useSearchParams` hook in a browser that does not support the URLSearchParams API. If you need to support Internet Explorer 11, we recommend you load a polyfill such as https://github.com/ungap/url-search-params.");let t=c.useRef(ye(e)),r=c.useRef(!1),n=Y(),i=c.useMemo(()=>lr(n.search,r.current?null:t.current),[n.search]),u=Re(),s=c.useCallback((f,l)=>{const a=ye(typeof f=="function"?f(new URLSearchParams(i)):f);r.current=!0,u("?"+a,l)},[u,i]);return[i,s]}var Or=0,$r=()=>`__${String(++Or)}__`;function kr(){let{router:e}=Ze("useSubmit"),{basename:t}=c.useContext(M),r=Xt(),n=e.fetch,i=e.navigate;return c.useCallback(async(u,s={})=>{let{action:f,method:l,encType:a,formData:d,body:h}=fr(u,t);if(s.navigate===!1){let m=s.fetcherKey||$r();await n(m,r,s.action||f,{preventScrollReset:s.preventScrollReset,formData:d,body:h,formMethod:s.method||l,formEncType:s.encType||a,flushSync:s.flushSync})}else await i(s.action||f,{preventScrollReset:s.preventScrollReset,formData:d,body:h,formMethod:s.method||l,formEncType:s.encType||a,replace:s.replace,state:s.state,fromRouteId:r,flushSync:s.flushSync,viewTransition:s.viewTransition})},[n,i,t,r])}function Ar(e,{relative:t}={}){let{basename:r}=c.useContext(M),n=c.useContext(H);O(n,"useFormAction must be used inside a RouteContext");let[i]=n.matches.slice(-1),u={...ee(e||".",{relative:t})},s=Y();if(e==null){u.search=s.search;let f=new URLSearchParams(u.search),l=f.getAll("index");if(l.some(d=>d==="")){f.delete("index"),l.filter(h=>h).forEach(h=>f.append("index",h));let d=f.toString();u.search=d?`?${d}`:""}}return(!e||e===".")&&i.route.index&&(u.search=u.search?u.search.replace(/^\?/,"?index&"):"?index"),r!=="/"&&(u.pathname=u.pathname==="/"?r:B([r,u.pathname])),Q(u)}function Nr(e,{relative:t}={}){let r=c.useContext(We);O(r!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:n}=Ze("useViewTransitionState"),i=ee(e,{relative:t});if(!r.isTransitioning)return!1;let u=W(r.currentLocation.pathname,n)||r.currentLocation.pathname,s=W(r.nextLocation.pathname,n)||r.nextLocation.pathname;return ie(i.pathname,s)!=null||ie(i.pathname,u)!=null}var Dr=lt();const Wr=Ie(Dr);export{jr as B,Qe as L,Hr as N,Ur as O,Ir as R,Dr as a,Wr as b,it as c,Mr as d,He as e,lt as f,Ie as g,Re as h,Br as i,Fr as j,tr as k,c as r,Y as u};
|
|
3
|
+
Please change the parent <Route path="${E}"> to <Route path="${E==="/"?"*":`${E}/*`}">.`)}let m=Y(),v;if(t){let E=typeof t=="string"?V(t):t;O(d==="/"||E.pathname?.startsWith(d),`When overriding the location using \`<Routes location>\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${d}" but pathname "${E.pathname}" was given in the \`location\` prop.`),v=E}else v=m;let w=v.pathname||"/",S=w;if(d!=="/"){let E=d.replace(/^\//,"").split("/");S="/"+w.replace(/^\//,"").split("/").slice(E.length).join("/")}let y=Ue(e,{pathname:S});D(h||y!=null,`No routes matched location "${v.pathname}${v.search}${v.hash}" `),D(y==null||y[y.length-1].route.element!==void 0||y[y.length-1].route.Component!==void 0||y[y.length-1].route.lazy!==void 0,`Matched leaf route at location "${v.pathname}${v.search}${v.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`);let g=Kt(y&&y.map(E=>Object.assign({},E,{params:Object.assign({},l,E.params),pathname:B([d,u.encodeLocation?u.encodeLocation(E.pathname.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:E.pathname]),pathnameBase:E.pathnameBase==="/"?d:B([d,u.encodeLocation?u.encodeLocation(E.pathnameBase.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:E.pathnameBase])})),s,r,n,i);return t&&g?c.createElement(Z.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",...v},navigationType:"POP"}},g):g}function Wt(){let e=Qt(),t=At(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),r=e instanceof Error?e.stack:null,n="rgba(200,200,200, 0.5)",i={padding:"0.5rem",backgroundColor:n},u={padding:"2px 4px",backgroundColor:n},s=null;return console.error("Error handled by React Router default ErrorBoundary:",e),s=c.createElement(c.Fragment,null,c.createElement("p",null,"💿 Hey developer 👋"),c.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",c.createElement("code",{style:u},"ErrorBoundary")," or"," ",c.createElement("code",{style:u},"errorElement")," prop on your route.")),c.createElement(c.Fragment,null,c.createElement("h2",null,"Unexpected Application Error!"),c.createElement("h3",{style:{fontStyle:"italic"}},t),r?c.createElement("pre",{style:i},r):null,s)}var Yt=c.createElement(Wt,null),zt=class extends c.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||t.revalidation!=="idle"&&e.revalidation==="idle"?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error!==void 0?e.error:t.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){this.props.onError?this.props.onError(e,t):console.error("React Router caught the following error during render",e)}render(){return this.state.error!==void 0?c.createElement(H.Provider,{value:this.props.routeContext},c.createElement(Ee.Provider,{value:this.state.error,children:this.props.component})):this.props.children}};function qt({routeContext:e,match:t,children:r}){let n=c.useContext(G);return n&&n.static&&n.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(n.staticContext._deepestRenderedBoundaryId=t.route.id),c.createElement(H.Provider,{value:e},r)}function Kt(e,t=[],r=null,n=null,i=null){if(e==null){if(!r)return null;if(r.errors)e=r.matches;else if(t.length===0&&!r.initialized&&r.matches.length>0)e=r.matches;else return null}let u=e,s=r?.errors;if(s!=null){let d=u.findIndex(h=>h.route.id&&s?.[h.route.id]!==void 0);O(d>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(s).join(",")}`),u=u.slice(0,Math.min(u.length,d+1))}let f=!1,l=-1;if(r)for(let d=0;d<u.length;d++){let h=u[d];if((h.route.HydrateFallback||h.route.hydrateFallbackElement)&&(l=d),h.route.id){let{loaderData:m,errors:v}=r,w=h.route.loader&&!m.hasOwnProperty(h.route.id)&&(!v||v[h.route.id]===void 0);if(h.route.lazy||w){f=!0,l>=0?u=u.slice(0,l+1):u=[u[0]];break}}}let a=r&&n?(d,h)=>{n(d,{location:r.location,params:r.matches?.[0]?.params??{},unstable_pattern:Nt(r.matches),errorInfo:h})}:void 0;return u.reduceRight((d,h,m)=>{let v,w=!1,S=null,y=null;r&&(v=s&&h.route.id?s[h.route.id]:void 0,S=h.route.errorElement||Yt,f&&(l<0&&m===0?(Ke("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),w=!0,y=null):l===m&&(w=!0,y=h.route.hydrateFallbackElement||null)));let g=t.concat(u.slice(0,m+1)),E=()=>{let P;return v?P=S:w?P=y:h.route.Component?P=c.createElement(h.route.Component,null):h.route.element?P=h.route.element:P=d,c.createElement(qt,{match:h,routeContext:{outlet:d,matches:g,isDataRoute:r!=null},children:P})};return r&&(h.route.ErrorBoundary||h.route.errorElement||m===0)?c.createElement(zt,{location:r.location,revalidation:r.revalidation,component:S,error:v,children:E(),routeContext:{outlet:null,matches:g,isDataRoute:!0},onError:a}):E()},null)}function we(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function Vt(e){let t=c.useContext(G);return O(t,we(e)),t}function Gt(e){let t=c.useContext(ue);return O(t,we(e)),t}function Jt(e){let t=c.useContext(H);return O(t,we(e)),t}function Ce(e){let t=Jt(e),r=t.matches[t.matches.length-1];return O(r.route.id,`${e} can only be used on routes that contain a unique "id"`),r.route.id}function Xt(){return Ce("useRouteId")}function Qt(){let e=c.useContext(Ee),t=Gt("useRouteError"),r=Ce("useRouteError");return e!==void 0?e:t.errors?.[r]}function Zt(){let{router:e}=Vt("useNavigate"),t=Ce("useNavigate"),r=c.useRef(!1);return ze(()=>{r.current=!0}),c.useCallback(async(i,u={})=>{D(r.current,Ye),r.current&&(typeof i=="number"?await e.navigate(i):await e.navigate(i,{fromRouteId:t,...u}))},[e,t])}var De={};function Ke(e,t,r){!t&&!De[e]&&(De[e]=!0,D(!1,r))}c.memo(er);function er({routes:e,future:t,state:r,unstable_onError:n}){return qe(e,void 0,r,n,t)}function Hr({to:e,replace:t,state:r,relative:n}){O(J(),"<Navigate> may be used only in the context of a <Router> component.");let{static:i}=c.useContext(M);D(!i,"<Navigate> must not be used on the initial render in a <StaticRouter>. This is a no-op, but you should modify your code so the <Navigate> is only ever rendered in response to some user interaction or state change.");let{matches:u}=c.useContext(H),{pathname:s}=Y(),f=Re(),l=ve(e,ge(u),s,n==="path"),a=JSON.stringify(l);return c.useEffect(()=>{f(JSON.parse(a),{replace:t,state:r,relative:n})},[f,a,n,t,r]),null}function Ur(e){return jt(e.context)}function tr(e){O(!1,"A <Route> is only ever to be used as the child of <Routes> element, never rendered directly. Please wrap your <Route> in a <Routes>.")}function rr({basename:e="/",children:t=null,location:r,navigationType:n="POP",navigator:i,static:u=!1,unstable_useTransitions:s}){O(!J(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let f=e.replace(/^\/*/,"/"),l=c.useMemo(()=>({basename:f,navigator:i,static:u,unstable_useTransitions:s,future:{}}),[f,i,u,s]);typeof r=="string"&&(r=V(r));let{pathname:a="/",search:d="",hash:h="",state:m=null,key:v="default"}=r,w=c.useMemo(()=>{let S=W(a,f);return S==null?null:{location:{pathname:S,search:d,hash:h,state:m,key:v},navigationType:n}},[f,a,d,h,m,v,n]);return D(w!=null,`<Router basename="${f}"> is not able to match the URL "${a}${d}${h}" because it does not start with the basename, so the <Router> won't render anything.`),w==null?null:c.createElement(M.Provider,{value:l},c.createElement(Z.Provider,{children:t,value:w}))}function Fr({children:e,location:t}){return Bt(me(e),t)}function me(e,t=[]){let r=[];return c.Children.forEach(e,(n,i)=>{if(!c.isValidElement(n))return;let u=[...t,i];if(n.type===c.Fragment){r.push.apply(r,me(n.props.children,u));return}O(n.type===tr,`[${typeof n.type=="string"?n.type:n.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),O(!n.props.index||!n.props.children,"An index route cannot have child routes.");let s={id:n.props.id||u.join("-"),caseSensitive:n.props.caseSensitive,element:n.props.element,Component:n.props.Component,index:n.props.index,path:n.props.path,middleware:n.props.middleware,loader:n.props.loader,action:n.props.action,hydrateFallbackElement:n.props.hydrateFallbackElement,HydrateFallback:n.props.HydrateFallback,errorElement:n.props.errorElement,ErrorBoundary:n.props.ErrorBoundary,hasErrorBoundary:n.props.hasErrorBoundary===!0||n.props.ErrorBoundary!=null||n.props.errorElement!=null,shouldRevalidate:n.props.shouldRevalidate,handle:n.props.handle,lazy:n.props.lazy};n.props.children&&(s.children=me(n.props.children,u)),r.push(s)}),r}var ae="get",oe="application/x-www-form-urlencoded";function le(e){return typeof HTMLElement<"u"&&e instanceof HTMLElement}function nr(e){return le(e)&&e.tagName.toLowerCase()==="button"}function ar(e){return le(e)&&e.tagName.toLowerCase()==="form"}function or(e){return le(e)&&e.tagName.toLowerCase()==="input"}function ir(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function ur(e,t){return e.button===0&&(!t||t==="_self")&&!ir(e)}function ye(e=""){return new URLSearchParams(typeof e=="string"||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,r)=>{let n=e[r];return t.concat(Array.isArray(n)?n.map(i=>[r,i]):[[r,n]])},[]))}function lr(e,t){let r=ye(e);return t&&t.forEach((n,i)=>{r.has(i)||t.getAll(i).forEach(u=>{r.append(i,u)})}),r}var ne=null;function sr(){if(ne===null)try{new FormData(document.createElement("form"),0),ne=!1}catch{ne=!0}return ne}var cr=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function he(e){return e!=null&&!cr.has(e)?(D(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${oe}"`),null):e}function fr(e,t){let r,n,i,u,s;if(ar(e)){let f=e.getAttribute("action");n=f?W(f,t):null,r=e.getAttribute("method")||ae,i=he(e.getAttribute("enctype"))||oe,u=new FormData(e)}else if(nr(e)||or(e)&&(e.type==="submit"||e.type==="image")){let f=e.form;if(f==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let l=e.getAttribute("formaction")||f.getAttribute("action");if(n=l?W(l,t):null,r=e.getAttribute("formmethod")||f.getAttribute("method")||ae,i=he(e.getAttribute("formenctype"))||he(f.getAttribute("enctype"))||oe,u=new FormData(f,e),!sr()){let{name:a,type:d,value:h}=e;if(d==="image"){let m=a?`${a}.`:"";u.append(`${m}x`,"0"),u.append(`${m}y`,"0")}else a&&u.append(a,h)}}else{if(le(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');r=ae,n=null,i=oe,s=e}return u&&i==="text/plain"&&(s=u,u=void 0),{action:n,method:r.toLowerCase(),encType:i,formData:u,body:s}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function _e(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function dr(e,t,r){let n=typeof e=="string"?new URL(e,typeof window>"u"?"server://singlefetch/":window.location.origin):e;return n.pathname==="/"?n.pathname=`_root.${r}`:t&&W(n.pathname,t)==="/"?n.pathname=`${t.replace(/\/$/,"")}/_root.${r}`:n.pathname=`${n.pathname.replace(/\/$/,"")}.${r}`,n}async function hr(e,t){if(e.id in t)return t[e.id];try{let r=await import(e.module);return t[e.id]=r,r}catch(r){return console.error(`Error loading route module \`${e.module}\`, reloading page...`),console.error(r),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function pr(e){return e==null?!1:e.href==null?e.rel==="preload"&&typeof e.imageSrcSet=="string"&&typeof e.imageSizes=="string":typeof e.rel=="string"&&typeof e.href=="string"}async function mr(e,t,r){let n=await Promise.all(e.map(async i=>{let u=t.routes[i.route.id];if(u){let s=await hr(u,r);return s.links?s.links():[]}return[]}));return Er(n.flat(1).filter(pr).filter(i=>i.rel==="stylesheet"||i.rel==="preload").map(i=>i.rel==="stylesheet"?{...i,rel:"prefetch",as:"style"}:{...i,rel:"prefetch"}))}function Me(e,t,r,n,i,u){let s=(l,a)=>r[a]?l.route.id!==r[a].route.id:!0,f=(l,a)=>r[a].pathname!==l.pathname||r[a].route.path?.endsWith("*")&&r[a].params["*"]!==l.params["*"];return u==="assets"?t.filter((l,a)=>s(l,a)||f(l,a)):u==="data"?t.filter((l,a)=>{let d=n.routes[l.route.id];if(!d||!d.hasLoader)return!1;if(s(l,a)||f(l,a))return!0;if(l.route.shouldRevalidate){let h=l.route.shouldRevalidate({currentUrl:new URL(i.pathname+i.search+i.hash,window.origin),currentParams:r[0]?.params||{},nextUrl:new URL(e,window.origin),nextParams:l.params,defaultShouldRevalidate:!0});if(typeof h=="boolean")return h}return!0}):[]}function yr(e,t,{includeHydrateFallback:r}={}){return gr(e.map(n=>{let i=t.routes[n.route.id];if(!i)return[];let u=[i.module];return i.clientActionModule&&(u=u.concat(i.clientActionModule)),i.clientLoaderModule&&(u=u.concat(i.clientLoaderModule)),r&&i.hydrateFallbackModule&&(u=u.concat(i.hydrateFallbackModule)),i.imports&&(u=u.concat(i.imports)),u}).flat(1))}function gr(e){return[...new Set(e)]}function vr(e){let t={},r=Object.keys(e).sort();for(let n of r)t[n]=e[n];return t}function Er(e,t){let r=new Set;return new Set(t),e.reduce((n,i)=>{let u=JSON.stringify(vr(i));return r.has(u)||(r.add(u),n.push({key:u,link:i})),n},[])}function Ve(){let e=c.useContext(G);return _e(e,"You must render this element inside a <DataRouterContext.Provider> element"),e}function Rr(){let e=c.useContext(ue);return _e(e,"You must render this element inside a <DataRouterStateContext.Provider> element"),e}var Se=c.createContext(void 0);Se.displayName="FrameworkContext";function Ge(){let e=c.useContext(Se);return _e(e,"You must render this element inside a <HydratedRouter> element"),e}function wr(e,t){let r=c.useContext(Se),[n,i]=c.useState(!1),[u,s]=c.useState(!1),{onFocus:f,onBlur:l,onMouseEnter:a,onMouseLeave:d,onTouchStart:h}=t,m=c.useRef(null);c.useEffect(()=>{if(e==="render"&&s(!0),e==="viewport"){let S=g=>{g.forEach(E=>{s(E.isIntersecting)})},y=new IntersectionObserver(S,{threshold:.5});return m.current&&y.observe(m.current),()=>{y.disconnect()}}},[e]),c.useEffect(()=>{if(n){let S=setTimeout(()=>{s(!0)},100);return()=>{clearTimeout(S)}}},[n]);let v=()=>{i(!0)},w=()=>{i(!1),s(!1)};return r?e!=="intent"?[u,m,{}]:[u,m,{onFocus:X(f,v),onBlur:X(l,w),onMouseEnter:X(a,v),onMouseLeave:X(d,w),onTouchStart:X(h,v)}]:[!1,m,{}]}function X(e,t){return r=>{e&&e(r),r.defaultPrevented||t(r)}}function Cr({page:e,...t}){let{router:r}=Ve(),n=c.useMemo(()=>Ue(r.routes,e,r.basename),[r.routes,e,r.basename]);return n?c.createElement(Sr,{page:e,matches:n,...t}):null}function _r(e){let{manifest:t,routeModules:r}=Ge(),[n,i]=c.useState([]);return c.useEffect(()=>{let u=!1;return mr(e,t,r).then(s=>{u||i(s)}),()=>{u=!0}},[e,t,r]),n}function Sr({page:e,matches:t,...r}){let n=Y(),{manifest:i,routeModules:u}=Ge(),{basename:s}=Ve(),{loaderData:f,matches:l}=Rr(),a=c.useMemo(()=>Me(e,t,l,i,n,"data"),[e,t,l,i,n]),d=c.useMemo(()=>Me(e,t,l,i,n,"assets"),[e,t,l,i,n]),h=c.useMemo(()=>{if(e===n.pathname+n.search+n.hash)return[];let w=new Set,S=!1;if(t.forEach(g=>{let E=i.routes[g.route.id];!E||!E.hasLoader||(!a.some(P=>P.route.id===g.route.id)&&g.route.id in f&&u[g.route.id]?.shouldRevalidate||E.hasClientLoader?S=!0:w.add(g.route.id))}),w.size===0)return[];let y=dr(e,s,"data");return S&&w.size>0&&y.searchParams.set("_routes",t.filter(g=>w.has(g.route.id)).map(g=>g.route.id).join(",")),[y.pathname+y.search]},[s,f,n,i,a,t,e,u]),m=c.useMemo(()=>yr(d,i),[d,i]),v=_r(d);return c.createElement(c.Fragment,null,h.map(w=>c.createElement("link",{key:w,rel:"prefetch",as:"fetch",href:w,...r})),m.map(w=>c.createElement("link",{key:w,rel:"modulepreload",href:w,...r})),v.map(({key:w,link:S})=>c.createElement("link",{key:w,nonce:r.nonce,...S})))}function Pr(...e){return t=>{e.forEach(r=>{typeof r=="function"?r(t):r!=null&&(r.current=t)})}}var Je=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{Je&&(window.__reactRouterVersion="7.10.1")}catch{}function jr({basename:e,children:t,unstable_useTransitions:r,window:n}){let i=c.useRef();i.current==null&&(i.current=st({window:n,v5Compat:!0}));let u=i.current,[s,f]=c.useState({action:u.action,location:u.location}),l=c.useCallback(a=>{r===!1?f(a):c.startTransition(()=>f(a))},[r]);return c.useLayoutEffect(()=>u.listen(l),[u,l]),c.createElement(rr,{basename:e,children:t,location:s.location,navigationType:s.action,navigator:u,unstable_useTransitions:r===!0})}var Xe=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Qe=c.forwardRef(function({onClick:t,discover:r="render",prefetch:n="none",relative:i,reloadDocument:u,replace:s,state:f,target:l,to:a,preventScrollReset:d,viewTransition:h,...m},v){let{basename:w,unstable_useTransitions:S}=c.useContext(M),y=typeof a=="string"&&Xe.test(a),g,E=!1;if(typeof a=="string"&&y&&(g=a,Je))try{let I=new URL(window.location.href),z=a.startsWith("//")?new URL(I.protocol+a):new URL(a),te=W(z.pathname,w);z.origin===I.origin&&te!=null?a=te+z.search+z.hash:E=!0}catch{D(!1,`<Link to="${a}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}let P=Ht(a,{relative:i}),[$,A,U]=wr(n,m),x=Lr(a,{replace:s,state:f,target:l,preventScrollReset:d,relative:i,viewTransition:h,unstable_useTransitions:S});function q(I){t&&t(I),I.defaultPrevented||x(I)}let F=c.createElement("a",{...m,...U,href:g||P,onClick:E||u?t:q,ref:Pr(v,A),target:l,"data-discover":!y&&r==="render"?"true":void 0});return $&&!y?c.createElement(c.Fragment,null,F,c.createElement(Cr,{page:P})):F});Qe.displayName="Link";var xr=c.forwardRef(function({"aria-current":t="page",caseSensitive:r=!1,className:n="",end:i=!1,style:u,to:s,viewTransition:f,children:l,...a},d){let h=ee(s,{relative:a.relative}),m=Y(),v=c.useContext(ue),{navigator:w,basename:S}=c.useContext(M),y=v!=null&&Nr(h)&&f===!0,g=w.encodeLocation?w.encodeLocation(h).pathname:h.pathname,E=m.pathname,P=v&&v.navigation&&v.navigation.location?v.navigation.location.pathname:null;r||(E=E.toLowerCase(),P=P?P.toLowerCase():null,g=g.toLowerCase()),P&&S&&(P=W(P,S)||P);const $=g!=="/"&&g.endsWith("/")?g.length-1:g.length;let A=E===g||!i&&E.startsWith(g)&&E.charAt($)==="/",U=P!=null&&(P===g||!i&&P.startsWith(g)&&P.charAt(g.length)==="/"),x={isActive:A,isPending:U,isTransitioning:y},q=A?t:void 0,F;typeof n=="function"?F=n(x):F=[n,A?"active":null,U?"pending":null,y?"transitioning":null].filter(Boolean).join(" ");let I=typeof u=="function"?u(x):u;return c.createElement(Qe,{...a,"aria-current":q,className:F,ref:d,style:I,to:s,viewTransition:f},typeof l=="function"?l(x):l)});xr.displayName="NavLink";var br=c.forwardRef(({discover:e="render",fetcherKey:t,navigate:r,reloadDocument:n,replace:i,state:u,method:s=ae,action:f,onSubmit:l,relative:a,preventScrollReset:d,viewTransition:h,...m},v)=>{let{unstable_useTransitions:w}=c.useContext(M),S=kr(),y=Ar(f,{relative:a}),g=s.toLowerCase()==="get"?"get":"post",E=typeof f=="string"&&Xe.test(f),P=$=>{if(l&&l($),$.defaultPrevented)return;$.preventDefault();let A=$.nativeEvent.submitter,U=A?.getAttribute("formmethod")||s,x=()=>S(A||$.currentTarget,{fetcherKey:t,method:U,navigate:r,replace:i,state:u,relative:a,preventScrollReset:d,viewTransition:h});w&&r!==!1?c.startTransition(()=>x()):x()};return c.createElement("form",{ref:v,method:g,action:y,onSubmit:n?l:P,...m,"data-discover":!E&&e==="render"?"true":void 0})});br.displayName="Form";function Tr(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function Ze(e){let t=c.useContext(G);return O(t,Tr(e)),t}function Lr(e,{target:t,replace:r,state:n,preventScrollReset:i,relative:u,viewTransition:s,unstable_useTransitions:f}={}){let l=Re(),a=Y(),d=ee(e,{relative:u});return c.useCallback(h=>{if(ur(h,t)){h.preventDefault();let m=r!==void 0?r:Q(a)===Q(d),v=()=>l(e,{replace:m,state:n,preventScrollReset:i,relative:u,viewTransition:s});f?c.startTransition(()=>v()):v()}},[a,l,d,r,n,t,e,i,u,s,f])}function Br(e){D(typeof URLSearchParams<"u","You cannot use the `useSearchParams` hook in a browser that does not support the URLSearchParams API. If you need to support Internet Explorer 11, we recommend you load a polyfill such as https://github.com/ungap/url-search-params.");let t=c.useRef(ye(e)),r=c.useRef(!1),n=Y(),i=c.useMemo(()=>lr(n.search,r.current?null:t.current),[n.search]),u=Re(),s=c.useCallback((f,l)=>{const a=ye(typeof f=="function"?f(new URLSearchParams(i)):f);r.current=!0,u("?"+a,l)},[u,i]);return[i,s]}var Or=0,$r=()=>`__${String(++Or)}__`;function kr(){let{router:e}=Ze("useSubmit"),{basename:t}=c.useContext(M),r=Xt(),n=e.fetch,i=e.navigate;return c.useCallback(async(u,s={})=>{let{action:f,method:l,encType:a,formData:d,body:h}=fr(u,t);if(s.navigate===!1){let m=s.fetcherKey||$r();await n(m,r,s.action||f,{preventScrollReset:s.preventScrollReset,formData:d,body:h,formMethod:s.method||l,formEncType:s.encType||a,flushSync:s.flushSync})}else await i(s.action||f,{preventScrollReset:s.preventScrollReset,formData:d,body:h,formMethod:s.method||l,formEncType:s.encType||a,replace:s.replace,state:s.state,fromRouteId:r,flushSync:s.flushSync,viewTransition:s.viewTransition})},[n,i,t,r])}function Ar(e,{relative:t}={}){let{basename:r}=c.useContext(M),n=c.useContext(H);O(n,"useFormAction must be used inside a RouteContext");let[i]=n.matches.slice(-1),u={...ee(e||".",{relative:t})},s=Y();if(e==null){u.search=s.search;let f=new URLSearchParams(u.search),l=f.getAll("index");if(l.some(d=>d==="")){f.delete("index"),l.filter(h=>h).forEach(h=>f.append("index",h));let d=f.toString();u.search=d?`?${d}`:""}}return(!e||e===".")&&i.route.index&&(u.search=u.search?u.search.replace(/^\?/,"?index&"):"?index"),r!=="/"&&(u.pathname=u.pathname==="/"?r:B([r,u.pathname])),Q(u)}function Nr(e,{relative:t}={}){let r=c.useContext(We);O(r!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:n}=Ze("useViewTransitionState"),i=ee(e,{relative:t});if(!r.isTransitioning)return!1;let u=W(r.currentLocation.pathname,n)||r.currentLocation.pathname,s=W(r.nextLocation.pathname,n)||r.nextLocation.pathname;return ie(i.pathname,s)!=null||ie(i.pathname,u)!=null}var Dr=lt();const Wr=Ie(Dr);export{jr as B,it as E,Qe as L,Hr as N,Ur as O,Ir as R,Dr as a,He as b,Mr as c,lt as d,Re as e,Wr as f,Ie as g,Br as h,Fr as i,tr as j,c as r,Y as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as n}from"./radix-ui-
|
|
1
|
+
import{j as n}from"./radix-ui-nu4wz29m.js";import{r as a}from"./react-vendor-Bjx91N7w.js";import{e as P,f as Q,d as $,c as w,g as B,I as G}from"./index-BRtgic66.js";import{aR as H,av as L,m as V}from"./icons-DQFHtVq5.js";function S(o){return o.trim().toLowerCase()}function M(o,h){return`${o}-option-${h.replace(/[^a-z0-9_-]+/gi,"-")}`}function Z({value:o,onChange:h,options:f,groups:g,placeholder:j,searchPlaceholder:k,emptyText:E,disabled:F,className:R,triggerClassName:q,contentClassName:K}){const[l,T]=a.useState(!1),[y,A]=a.useState(""),[i,c]=a.useState(),m=a.useId(),I=a.useRef(null),N=a.useRef({}),O=a.useMemo(()=>f.find(e=>e.value===o),[f,o]),d=a.useMemo(()=>{const e=S(y);return e?f.filter(t=>[t.searchText,...t.keywords??[]].some(u=>S(u).includes(e))):f},[f,y]),z=a.useMemo(()=>{const e=new Map((g??[]).map(r=>[r.key,r])),t=d.filter(r=>!r.groupKey||!e.has(r.groupKey)),u=(g??[]).map(r=>({...r,options:d.filter(x=>x.groupKey===r.key)})).filter(r=>r.options.length>0);return t.length===0?u:[{key:"__default",options:t},...u]},[d,g]),s=a.useMemo(()=>d.filter(e=>!e.disabled),[d]),D=O?.triggerContent??O?.itemContent,v=e=>{T(e),e||(A(""),c(void 0))},b=()=>I.current?.focus();a.useEffect(()=>{if(l){if(s.length===0){c(void 0);return}c(e=>e&&s.some(t=>t.value===e)?e:s.find(t=>t.value===o)?.value??s[0]?.value)}},[s,l,o]),a.useEffect(()=>{!l||!i||N.current[i]?.scrollIntoView({block:"nearest"})},[i,l]);const p=e=>{if(s.length===0)return;if(e==="first"){c(s[0]?.value);return}if(e==="last"){c(s.at(-1)?.value);return}const t=s.findIndex(_=>_.value===i),u=e==="next"?-1:s.length,r=t>=0?t:u,x=e==="next"?Math.min(r+1,s.length-1):Math.max(r-1,0);c(s[x]?.value)},C=e=>{h(e),v(!1)},U=()=>{if(!i)return;const e=s.find(t=>t.value===i);e&&C(e.value)};return n.jsxs(P,{open:l,onOpenChange:v,children:[n.jsx(Q,{asChild:!0,children:n.jsxs($,{type:"button",variant:"outline","aria-expanded":l,"aria-controls":l?m:void 0,"aria-haspopup":"dialog",disabled:F,onKeyDown:e=>{if(e.key!=="ArrowDown"&&e.key!=="ArrowUp")return;e.preventDefault(),v(!0);const t=()=>{b(),p(e.key==="ArrowDown"?"first":"last")};if(typeof requestAnimationFrame=="function"){requestAnimationFrame(t);return}setTimeout(t,0)},className:w("w-full justify-between font-normal",R,q,!D&&"text-muted-foreground"),children:[n.jsx("div",{className:"min-w-0 flex-1 text-left",children:D??n.jsx("span",{children:j})}),n.jsx(H,{className:"ml-2 h-4 w-4 shrink-0 opacity-50"})]})}),n.jsxs(B,{align:"start",className:w("w-[var(--radix-popover-trigger-width)] p-0",K),onOpenAutoFocus:e=>{if(e.preventDefault(),typeof requestAnimationFrame=="function"){requestAnimationFrame(b);return}setTimeout(b,0)},children:[n.jsx("div",{className:"border-b p-2",children:n.jsxs("div",{className:"relative",children:[n.jsx(L,{className:"text-muted-foreground absolute left-2.5 top-1/2 h-4 w-4 -translate-y-1/2"}),n.jsx(G,{ref:I,value:y,onChange:e=>A(e.target.value),role:"combobox","aria-label":k,"aria-autocomplete":"list","aria-expanded":l,"aria-controls":m,"aria-activedescendant":i?M(m,i):void 0,onKeyDown:e=>{if(e.key==="ArrowDown"){e.preventDefault(),p("next");return}if(e.key==="ArrowUp"){e.preventDefault(),p("previous");return}if(e.key==="Home"){e.preventDefault(),p("first");return}if(e.key==="End"){e.preventDefault(),p("last");return}if(e.key==="Enter"){e.preventDefault(),U();return}e.key==="Escape"&&(e.preventDefault(),v(!1))},placeholder:k,className:"pl-8"})]})}),n.jsx("div",{"data-slot":"searchable-select-scroll-container","data-testid":"searchable-select-scroll-container",className:"max-h-72 overflow-y-auto overscroll-contain",children:d.length===0?n.jsx("div",{className:"px-3 py-6 text-center text-sm text-muted-foreground",children:E}):n.jsx("div",{id:m,role:"listbox","aria-label":j,className:"p-1",children:z.map(e=>n.jsxs("div",{children:[e.label&&n.jsx("div",{className:"px-2 py-1.5 text-xs font-medium text-muted-foreground",children:e.label}),e.options.map(t=>{const u=t.value===i,r=t.value===o;return n.jsxs("button",{id:M(m,t.value),type:"button",role:"option","aria-selected":r,disabled:t.disabled,tabIndex:-1,ref:x=>{N.current[t.value]=x},onMouseMove:()=>{t.disabled||c(t.value)},onFocus:()=>{t.disabled||c(t.value)},onClick:()=>C(t.value),className:w("hover:bg-accent hover:text-accent-foreground flex w-full items-center gap-2 rounded-sm px-2 py-1.5 text-left text-sm outline-none","focus-visible:ring-ring focus-visible:ring-1",u&&"bg-accent text-accent-foreground",r&&"bg-accent text-accent-foreground",t.disabled&&"pointer-events-none opacity-50"),children:[n.jsx("div",{className:"min-w-0 flex-1",children:t.itemContent}),r&&n.jsx(V,{className:"h-4 w-4 shrink-0"})]},t.value)})]},e.key))})})]})]})}export{Z as S};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as i,a0 as n}from"./radix-ui-
|
|
1
|
+
import{j as i,a0 as n}from"./radix-ui-nu4wz29m.js";import"./react-vendor-Bjx91N7w.js";import{c as e}from"./index-BRtgic66.js";function m({className:t,orientation:a="horizontal",decorative:o=!0,...r}){return i.jsx(n,{"data-slot":"separator",decorative:o,orientation:a,className:e("bg-border shrink-0 data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px",t),...r})}export{m as S};
|