@aidotnet/server-linux-arm64 0.5.2 → 0.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/astra-server +2 -2
- package/bin/wwwroot/assets/ClientsPage-CcTgjJ-D.js +11 -0
- package/bin/wwwroot/assets/ModelDetailPage-B9205fOF.js +1 -0
- package/bin/wwwroot/assets/ModelsPage-CAXCnMox.js +1 -0
- package/bin/wwwroot/assets/Page-CsiaycmK.css +1 -0
- package/bin/wwwroot/assets/Page-iMwsVZGv.js +3 -0
- package/bin/wwwroot/assets/PluginsPage-1htR9MlO.js +2 -0
- package/bin/wwwroot/assets/PrivacyPage-C227LcwP.css +1 -0
- package/bin/wwwroot/assets/PrivacyPage-DDrC7ZN2.js +1 -0
- package/bin/wwwroot/assets/ProviderDetailPage-BrLQ3wxI.js +3 -0
- package/bin/wwwroot/assets/ProvidersPage-B19CIw-g.css +1 -0
- package/bin/wwwroot/assets/ProvidersPage-DEwFPi0w.js +2 -0
- package/bin/wwwroot/assets/SettingsPage-BWff0tKT.css +1 -0
- package/bin/wwwroot/assets/SettingsPage-vDXq5KMg.js +1 -0
- package/bin/wwwroot/assets/TokensPage-nnTsXi1X.js +1 -0
- package/bin/wwwroot/assets/TrayPanelPage-BLLZAck0.js +1 -0
- package/bin/wwwroot/assets/arrow-down-Bgpt1Ug2.js +1 -0
- package/bin/wwwroot/assets/arrow-up-DqX0vZ8v.js +1 -0
- package/bin/wwwroot/assets/checkbox-BQx1e8t-.js +1 -0
- package/bin/wwwroot/assets/checkbox-OZlTRG3n.css +1 -0
- package/bin/wwwroot/assets/cloud-download-B-iX6FzV.js +1 -0
- package/bin/wwwroot/assets/confirm-morph-C56YfpDu.css +1 -0
- package/bin/wwwroot/assets/confirm-morph-C93BpFKZ.js +1 -0
- package/bin/wwwroot/assets/download-Bbci4NYa.js +1 -0
- package/bin/wwwroot/assets/ellipsis-O3neUtss.js +1 -0
- package/bin/wwwroot/assets/external-link-BotneeB5.js +1 -0
- package/bin/wwwroot/assets/folder-open-BReAI4XO.js +1 -0
- package/bin/wwwroot/assets/format-CkDcAs-_.js +55 -0
- package/bin/wwwroot/assets/format-Cnf3vGpI.css +1 -0
- package/bin/wwwroot/assets/index-C6Mqffdm.js +15 -0
- package/bin/wwwroot/assets/index-C8BQ1yWd.css +1 -0
- package/bin/wwwroot/assets/log-out-BSESm3Q8.js +1 -0
- package/bin/wwwroot/assets/pencil-C5urmout.js +1 -0
- package/bin/wwwroot/assets/power-rKYGhi1K.js +1 -0
- package/bin/wwwroot/assets/quota-fdOyhiov.js +1 -0
- package/bin/wwwroot/assets/radio-cards-CKDDH2FI.js +1 -0
- package/bin/wwwroot/assets/radio-cards-CxuojLkJ.css +1 -0
- package/bin/wwwroot/assets/rotate-ccw-CJ2l4No1.js +1 -0
- package/bin/wwwroot/assets/use-transform-CJhlgN8s.js +1 -0
- package/bin/wwwroot/assets/useTrayData-CUUZrKRf.js +1 -0
- package/bin/wwwroot/index.html +8 -2
- package/package.json +1 -1
- package/bin/wwwroot/assets/index-CtmOEnFy.js +0 -82
- package/bin/wwwroot/assets/index-DDEz0hKe.css +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{C as e,Ci as t,Di as n,Dt as r,Ei as i,Ot as a,Q as o,Qr as s,S as c,Si as l,Ut as u,Vt as d,X as f,Z as p,at as m,b as h,bt as g,c as _,cr as v,ct as y,dt as b,ft as x,ha as S,it as C,lr as w,lt as T,ma as E,mt as D,nt as ee,or as O,pt as k,rt as A,s as j,sr as M,un as te,ut as ne,va as N,wi as P,x as F,xi as I,yt as L}from"./format-CkDcAs-_.js";import{t as R}from"./use-transform-CJhlgN8s.js";import{b as re,i as z,p as B,s as ie,t as ae,x as oe}from"./Page-iMwsVZGv.js";import{E as se,M as V,O as ce,T as le,_ as H,b as ue,c as de,g as fe,k as pe,r as me,u as he,v as ge,y as _e}from"./index-C6Mqffdm.js";var ve={name:`shield-off`,size:24,node:[[`path`,{d:`m2 2 20 20`,key:`1ooewy`}],[`path`,{d:`M5 5a1 1 0 0 0-1 1v7c0 5 3.5 7.5 7.67 8.94a1 1 0 0 0 .67.01c2.35-.82 4.48-1.97 5.9-3.71`,key:`1jlk70`}],[`path`,{d:`M9.309 3.652A12.252 12.252 0 0 0 11.24 2.28a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1v7a9.784 9.784 0 0 1-.08 1.264`,key:`18rp1v`}]]};ve.node;var ye=a(ve),U=N(S(),1),W={toolbar:`_toolbar_1p5c5_1`,leading:`_leading_1p5c5_2`,frame:`_frame_1p5c5_4`,chips:`_chips_1p5c5_5`,slot:`_slot_1p5c5_7`,chip:`_chip_1p5c5_5`,chipLabel:`_chipLabel_1p5c5_10`,value:`_value_1p5c5_11`,separator:`_separator_1p5c5_12`,morphText:`_morphText_1p5c5_13`,morphValue:`_morphValue_1p5c5_14`,measure:`_measure_1p5c5_15`,empty:`_empty_1p5c5_18`,actions:`_actions_1p5c5_19`,clear:`_clear_1p5c5_20`,clearText:`_clearText_1p5c5_21`,srOnly:`_srOnly_1p5c5_23`,menu:`_menu_1p5c5_27`,trigger:`_trigger_1p5c5_29`,face:`_face_1p5c5_31`,surface:`_surface_1p5c5_34`,panel:`_panel_1p5c5_42`,head:`_head_1p5c5_45`,back:`_back_1p5c5_47`,title:`_title_1p5c5_49`,titleText:`_titleText_1p5c5_50`,stage:`_stage_1p5c5_51`,step:`_step_1p5c5_52`,list:`_list_1p5c5_53`,highlight:`_highlight_1p5c5_54`,item:`_item_1p5c5_55`,itemIcon:`_itemIcon_1p5c5_57`,itemLabel:`_itemLabel_1p5c5_58`,itemMeta:`_itemMeta_1p5c5_59`,metaValue:`_metaValue_1p5c5_60`,hint:`_hint_1p5c5_61`,check:`_check_1p5c5_62`,noOptions:`_noOptions_1p5c5_64`},G=E(),K={duration:L.duration.standard,ease:[...L.ease.enter]},be={duration:L.duration.instant,ease:[...L.ease.standard]},q={duration:0},xe={duration:L.duration.instant,ease:[...L.ease.standard]},J=e=>`blur(${e}px)`,Se=e=>Math.min(1,Math.max(0,e)),Ce=e=>typeof e==`string`?{value:e}:e,we=e=>e.label??e.value,Te=e=>({initial:e?{opacity:0}:{opacity:0,y:`0.3em`,filter:J(L.blur.soft)},animate:{opacity:1,y:0,filter:J(0)},exit:e?{opacity:0,transition:q}:{opacity:0,y:`-0.3em`,filter:J(L.blur.subtle),transition:be},transition:e?xe:K});function Ee({text:e}){let n=t()??!1,r=(0,U.useRef)(null),a=P(`auto`);return(0,U.useLayoutEffect)(()=>{let e=r.current;if(!e||typeof ResizeObserver>`u`)return;let t=null,i=new ResizeObserver(([r])=>{let i=Math.ceil(r.borderBoxSize?.[0]?.inlineSize??e.offsetWidth),o=t!==null&&t!==e.textContent;t=e.textContent,o&&!n?l(a,i,L.spring.morph):a.jump(i)});return i.observe(e),()=>i.disconnect()},[n,a]),(0,G.jsxs)(I.span,{className:W.morphText,style:{width:a},children:[(0,G.jsx)(`span`,{ref:r,className:W.measure,"aria-hidden":`true`,children:e}),(0,G.jsx)(i,{mode:`popLayout`,initial:!1,children:(0,G.jsx)(I.span,{className:W.morphValue,...Te(n),children:e},e)})]})}function De(e,t,n){let r=P(`auto`);return(0,U.useLayoutEffect)(()=>{let i=e.current;if(!i||typeof ResizeObserver>`u`)return;let a=!1,o=new ResizeObserver(()=>{let e=i.offsetHeight;if(!a||n||performance.now()>t.current){a=!0,r.jump(e);return}l(r,e,L.spring.smooth)});return o.observe(i),()=>o.disconnect()},[t,r,e,n]),r}function Oe(e,t,n){(0,U.useLayoutEffect)(()=>{let r=e.current;if(!r||typeof ResizeObserver>`u`)return;let i=new Map,a=()=>{let e=performance.now();for(let a of Array.from(r.children)){let r=a.offsetLeft,o=a.offsetTop,s=i.get(a);if(!s){i.set(a,{x:r,y:o,dx:0,dy:0});continue}let c=s.x-r,u=s.y-o;if(s.x=r,s.y=o,n||e>t.current||Math.abs(u)<1&&Math.abs(c)<40)continue;s.stop?.();let d=s.dx+c,f=s.dy+u,p=e=>{s.dx=d*(1-e),s.dy=f*(1-e),a.style.translate=e>=1?``:`${s.dx}px ${s.dy}px`};p(0),s.stop=l(0,1,{...L.spring.smooth,onUpdate:p,onComplete:()=>p(1)}).stop}for(let e of i.keys())e.parentElement!==r&&i.delete(e)},o=new ResizeObserver(a),s=()=>{for(let e of Array.from(r.children))o.observe(e)},c=new MutationObserver(()=>{s(),a()});return o.observe(r),s(),c.observe(r,{childList:!0}),()=>{o.disconnect(),c.disconnect();for(let e of i.values())e.stop?.()}},[t,e,n])}var Y=e=>e.valueLabel??e.value,X=e=>Y(e)?`${e.label}: ${Y(e)}`:e.label,ke={empty:`No filters applied`,clearAll:`Clear all`,back:`Back to fields`,noOptions:`No options available`,cleared:`All filters cleared`,remove:e=>`Remove ${X(e)}`,added:e=>`Added ${X(e)}`,changed:e=>`Changed ${X(e)}`,removed:e=>`Removed ${X(e)}`};function Ae(e,t,n){let r=e.filter(e=>!t.some(t=>t.id===e.id));if(!t.length&&r.length>1)return n.cleared;let i=t.filter(t=>!e.some(e=>e.id===t.id)),a=t.filter(t=>e.some(e=>e.id===t.id&&e.value!==t.value));return[...i.map(n.added),...a.map(n.changed),...r.map(n.removed)].join(`. `)}function je({rows:e,labelledBy:r,onChoose:i,onBack:a,onLeave:o,radio:s,emptyMessage:c}){let l=t()??!1,u=n(),d=(0,U.useRef)(null),f=(0,U.useRef)(!1),p=(0,U.useRef)({text:``,at:0}),[m,h]=(0,U.useState)(()=>Math.max(0,e.findIndex(e=>e.checked))),[g,_]=(0,U.useState)(null),v=()=>Array.from(d.current?.querySelectorAll(`[data-row]`)??[]),y=e=>{let t=d.current;e&&t&&(e.focus({preventScroll:!0}),e.offsetTop<t.scrollTop?t.scrollTop=e.offsetTop:e.offsetTop+e.offsetHeight>t.scrollTop+t.clientHeight&&(t.scrollTop=e.offsetTop+e.offsetHeight-t.clientHeight))};function b(t){let n=v(),r=n.indexOf(document.activeElement),o=e=>{t.preventDefault(),f.current=!1,y(n[e])};if(t.key===`ArrowDown`)return o(r<0?0:(r+1)%n.length);if(t.key===`ArrowUp`)return o(r<0?n.length-1:(r-1+n.length)%n.length);if(t.key===`Home`)return o(0);if(t.key===`End`)return o(n.length-1);if(t.key===`ArrowRight`&&r>=0&&e[r]?.drill){t.preventDefault(),i(e[r],!0);return}if(t.key===`ArrowLeft`&&a){t.preventDefault(),a(!0);return}if(t.key.length===1&&/\S/.test(t.key)&&!t.metaKey&&!t.ctrlKey&&!t.altKey){let e=performance.now();p.current={text:e-p.current.at<700?p.current.text+t.key.toLowerCase():t.key.toLowerCase(),at:e};let i=[...n.slice(r+(p.current.text.length>1?0:1)),...n.slice(0,r+(p.current.text.length>1?0:1))].find(e=>(e.dataset.text??``).toLowerCase().startsWith(p.current.text));i&&o(n.indexOf(i))}}function x(e){let t=e.target.closest(`[data-row]`);if(!t)return;h(v().indexOf(t));let n=f.current&&!l,r=!f.current&&t.matches(`:focus-visible`);_(e=>({top:t.offsetTop,height:t.offsetHeight,glide:n&&!!e?.shown,ring:r,shown:!0}))}function S(e){d.current?.contains(e.relatedTarget)||_(e=>e&&{...e,glide:!1,ring:!1,shown:!1})}return(0,G.jsxs)(`div`,{ref:d,className:W.list,role:`menu`,"aria-labelledby":r,"data-current":u?``:void 0,onKeyDown:b,onFocus:x,onBlur:S,onPointerLeave:()=>{f.current&&d.current?.contains(document.activeElement)&&o()},children:[(0,G.jsx)(I.span,{className:W.highlight,"data-ring":g?.ring||void 0,"aria-hidden":`true`,initial:!1,animate:g?{y:g.top,height:g.height,opacity:+!!g.shown}:{opacity:0},transition:{default:g?.glide?L.spring.snappy:q,opacity:{duration:l?0:.08}}}),e.length===0?(0,G.jsx)(`p`,{className:W.noOptions,children:c}):null,e.map((e,t)=>(0,G.jsxs)(`button`,{type:`button`,className:W.item,role:s?`menuitemradio`:`menuitem`,"aria-checked":s?!!e.checked:void 0,tabIndex:t===m?0:-1,"data-row":e.key,"data-text":e.label,onPointerMove:e=>{f.current=!0,document.activeElement!==e.currentTarget&&e.currentTarget.focus({preventScroll:!0})},onClick:t=>i(e,t.detail===0),children:[e.icon?(0,G.jsx)(`span`,{className:W.itemIcon,"aria-hidden":`true`,children:e.icon}):null,(0,G.jsx)(`span`,{className:W.itemLabel,children:e.label}),e.meta?(0,G.jsx)(`span`,{className:W.itemMeta,children:e.meta}):null]},e.key))]})}function Me(e){let t={left:0,top:0,right:document.documentElement.clientWidth,bottom:window.innerHeight};for(let n=e.parentElement;n&&n!==document.body;n=n.parentElement){let e=getComputedStyle(n);if(e.overflowX===`visible`&&e.overflowY===`visible`)continue;let r=n.getBoundingClientRect();e.overflowX!==`visible`&&(t.left=Math.max(t.left,r.left),t.right=Math.min(t.right,r.right)),e.overflowY!==`visible`&&(t.top=Math.max(t.top,r.top),t.bottom=Math.min(t.bottom,r.bottom))}return t}function Ne({fields:e,onSelect:n,active:a=[],label:o=`Add filter`,align:s=`end`,messages:c}){let u={...ke,...c},d=t()??!1,f=(0,U.useId)(),p=`${f}panel`,m=`${f}title`,h=(0,U.useRef)(null),g=(0,U.useRef)(null),_=(0,U.useRef)(null),v=(0,U.useRef)(`closed`),y=(0,U.useRef)(0),b=(0,U.useRef)(null),[x,S]=(0,U.useState)(`closed`),[C,w]=(0,U.useState)(null),[T,E]=(0,U.useState)(1),[D,ee]=(0,U.useState)(!1),[O,k]=(0,U.useState)(`100% 0`),A=P(`100%`),j=P(`100%`),M=P(0),te=P(0),ne=R(()=>te.get()-M.get()),N=P(0),F=P(0),re=R(()=>{let e=A.get(),t=N.get(),n=F.get();return typeof e==`number`?n>t?Se((e-t)/(n-t)):1:0}),z=R(()=>Se(re.get()/.35)),B=R(()=>Se((re.get()-.4)/.5)),ae={opacity:R(()=>1-z.get()),scale:R(()=>1-z.get()*.04),filter:R(()=>z.get()?J(z.get()*L.blur.subtle):`none`)},oe={opacity:B,transformOrigin:O,scale:R(()=>.96+B.get()*.04),y:R(()=>(1-B.get())*(D?-6:6)),filter:R(()=>B.get()===1?`none`:J((1-B.get())*L.blur.soft))},se=x===`open`,V=e.find(e=>e.id===C)??null,le=(0,U.useCallback)(e=>{let t=g.current,n=_.current;if(!t||!n)return;let r=t.getBoundingClientRect(),i=n.offsetWidth+2,a=n.offsetHeight+2,o=Me(h.current??t),c=o.left+16-r.left,u=o.right-16-r.left-i,f=r.width-i,p=s===`end`?f>=c?f:0<=u?0:f:0<=u?0:f>=c?f:0;p=Math.round(Math.min(Math.max(p,c),Math.max(c,u)));let m=o.bottom-r.top,x=r.bottom-o.top,C=m<a+16&&x>m;v.current===`closed`&&(A.jump(r.width),j.jump(r.height),M.jump(0)),te.jump(p),N.jump(r.width),F.jump(i),v.current=`open`,y.current+=1,b.current=e,S(`open`),ee(C),w(null),E(-1),k(`${Math.round(r.width/2-p)}px ${C?`100%`:`0`}`);let T=d?q:L.spring.morph;l(M,p,T),l(A,i,T),l(j,a,T)},[s,N,j,M,d,te,F,A]),H=(0,U.useCallback)(e=>{let t=g.current;if(v.current!==`open`||!t)return;v.current=`closing`;let n=y.current+=1;S(`closing`),e&&t.focus({preventScroll:!0,focusVisible:e===`keyboard`});let r=d?q:L.spring.snappy;l(M,0,r);let i=t.getBoundingClientRect();l(j,i.height,r),l(A,i.width,{...r,onComplete:()=>{n===y.current&&(v.current=`closed`,A.jump(`100%`),j.jump(`100%`),S(`closed`),w(null))}})},[j,M,d,A]);(0,U.useLayoutEffect)(()=>{let e=_.current;if(!e||typeof ResizeObserver>`u`)return;let t=new ResizeObserver(()=>{v.current===`open`&&l(j,e.offsetHeight+2,d?q:L.spring.smooth)});return t.observe(e),()=>t.disconnect()},[j,d]),(0,U.useLayoutEffect)(()=>{let e=b.current,t=_.current;if(!e||!t||x!==`open`)return;if(b.current=null,e===`panel`){t.focus({preventScroll:!0});return}let n=Array.from(t.querySelectorAll(`[data-current] [data-row]`));(e===`first`?n[0]:e===`last`?n.at(-1):e===`checked`?n.find(e=>e.getAttribute(`aria-checked`)===`true`)??n[0]:n.find(t=>t.dataset.row===e.key)??n[0])?.focus({preventScroll:!0})},[x,C]),(0,U.useEffect)(()=>{if(x!==`open`)return;let e=e=>{let t=h.current,n=e.target;!t||n&&t.contains(n)||(H(!1),n?.closest?.(`button, a[href], input, select, textarea, [tabindex], [contenteditable]`)||window.setTimeout(()=>{let e=document.activeElement;(!e||e===document.body||t.contains(e))&&g.current?.focus({preventScroll:!0,focusVisible:!1})},0))};return document.addEventListener(`pointerdown`,e,!0),()=>document.removeEventListener(`pointerdown`,e,!0)},[H,x]);function ue(e){if(e.defaultPrevented)return;let t=Array.from(_.current?.querySelectorAll(`[data-current] [data-row]`)??[]);(e.key===`ArrowDown`||e.key===`ArrowUp`)&&(e.preventDefault(),(e.key===`ArrowDown`?t[0]:t.at(-1))?.focus({preventScroll:!0})),e.key===`ArrowLeft`&&V&&(e.preventDefault(),de(!0))}function de(e){V&&(b.current=e?{key:V.id}:`panel`,E(-1),w(null))}function fe(e,t){b.current=t?`checked`:`panel`,E(1),w(e.key)}function me(e,t){V&&(n({id:V.id,label:V.label,value:e.key,valueLabel:e.label},V),H(t?`keyboard`:`pointer`))}let he=e=>a.find(t=>t.id===e.id),ge=e.map(e=>({key:e.id,label:e.label,icon:e.icon,drill:!0,meta:(0,G.jsxs)(G.Fragment,{children:[he(e)?(0,G.jsx)(`span`,{className:W.metaValue,children:Y(he(e))}):null,(0,G.jsx)(ce,{size:15,strokeWidth:1.8,"aria-hidden":`true`})]})})),_e=V?V.options.map(Ce).map(e=>{let t=we(e),n=he(V)?.value===e.value;return{key:e.value,label:t,icon:e.icon,checked:n,meta:e.hint!=null||n?(0,G.jsxs)(G.Fragment,{children:[e.hint==null?null:(0,G.jsx)(`span`,{className:W.hint,children:e.hint}),(0,G.jsx)(`span`,{className:W.check,"data-on":n||void 0,children:(0,G.jsx)(r,{size:15,strokeWidth:2,"aria-hidden":`true`})})]}):null}}):[],ve={enter:e=>d?{opacity:0}:{opacity:0,x:e*18,filter:J(L.blur.soft)},center:{opacity:1,x:0,filter:J(0),transition:d?xe:{...K,x:L.spring.smooth}},exit:e=>d?{opacity:0,transition:q}:{opacity:0,x:e*-18,filter:J(L.blur.subtle),transition:be}};return(0,G.jsxs)(`div`,{ref:h,className:W.menu,"data-state":x,"data-y":D?`up`:`down`,onKeyDown:e=>{e.key===`Escape`&&v.current===`open`&&(e.preventDefault(),e.stopPropagation(),H(`keyboard`))},onBlur:e=>{let t=e.relatedTarget;v.current===`open`&&t&&!h.current?.contains(t)&&H(!1)},children:[(0,G.jsx)(`button`,{ref:g,type:`button`,className:W.trigger,"data-filter-trigger":``,"aria-haspopup":`dialog`,"aria-expanded":se,"aria-controls":p,tabIndex:se?-1:void 0,onClick:e=>{v.current!==`open`&&le(e.detail===0?`first`:`panel`)},onKeyDown:e=>{(e.key===`ArrowDown`||e.key===`ArrowUp`)&&(e.preventDefault(),le(e.key===`ArrowDown`?`first`:`last`))},children:(0,G.jsxs)(I.span,{className:W.face,style:ae,children:[(0,G.jsx)(ie,{size:15,strokeWidth:1.8,"aria-hidden":`true`}),o]})}),(0,G.jsx)(I.div,{className:W.surface,style:{left:M,width:A,height:j},children:(0,G.jsx)(I.div,{ref:_,id:p,className:W.panel,role:`dialog`,"aria-labelledby":m,tabIndex:-1,inert:!se,style:{x:ne},onKeyDown:ue,children:(0,G.jsxs)(I.div,{style:oe,children:[(0,G.jsxs)(`div`,{className:W.head,children:[(0,G.jsx)(i,{initial:!1,children:V?(0,G.jsx)(I.button,{type:`button`,className:W.back,"aria-label":u.back,onClick:e=>de(e.detail===0),initial:d?{opacity:0,width:28,marginRight:2}:{opacity:0,width:0,marginRight:0,scale:.6},animate:{opacity:1,width:28,marginRight:2,scale:1},exit:d?{opacity:0,transition:q}:{opacity:0,width:0,marginRight:0,scale:.6,transition:{...L.spring.snappy,opacity:be}},transition:d?xe:{...L.spring.snappy,opacity:K},children:(0,G.jsx)(pe,{size:16,strokeWidth:1.8,"aria-hidden":`true`})},`back`):null}),(0,G.jsx)(`span`,{className:W.title,id:m,children:(0,G.jsx)(i,{mode:`popLayout`,initial:!1,children:(0,G.jsx)(I.span,{className:W.titleText,...Te(d),children:V?V.label:o},V?.id??`fields`)})})]}),(0,G.jsx)(`div`,{className:W.stage,children:(0,G.jsx)(i,{mode:`popLayout`,initial:!1,custom:T,children:(0,G.jsx)(I.div,{className:W.step,custom:T,variants:ve,initial:`enter`,animate:`center`,exit:`exit`,children:V?(0,G.jsx)(je,{rows:_e,labelledBy:m,emptyMessage:u.noOptions,radio:!0,onChoose:me,onBack:de,onLeave:()=>_.current?.focus({preventScroll:!0})}):(0,G.jsx)(je,{rows:ge,labelledBy:m,emptyMessage:u.noOptions,onChoose:fe,onLeave:()=>_.current?.focus({preventScroll:!0})})},V?.id??`fields`)})})]})})})]})}function Pe({filters:e,onRemove:n,onClearAll:r,leading:a,children:o,label:s=`Active filters`,addFilter:c,messages:l}){let u={...ke,...l},d=t()??!1,f=(0,U.useRef)(null),p=(0,U.useRef)(null),m=(0,U.useRef)(0),h=(0,U.useRef)(null),[_,v]=(0,U.useState)(e),[y,b]=(0,U.useState)(``);if(_!==e){v(e);let t=Ae(_,e,u);t&&b(t)}let x=e.map(e=>`${e.id}:${e.value??``}`).join(`|`);(0,U.useLayoutEffect)(()=>{m.current=performance.now()+900},[x]);let S=De(p,m,d);Oe(p,m,d),(0,U.useLayoutEffect)(()=>{let t=h.current,n=f.current;if(t===null||!n)return;h.current=null;let r=e[Math.min(t,e.length-1)];(r?n.querySelector(`[data-chip-remove="${CSS.escape(r.id)}"]`):n.querySelector(`[data-filter-trigger]`))?.focus({preventScroll:!0})},[e]);let C={duration:0},w=e=>({initial:!d&&{width:0,marginRight:-e,overflow:`clip`,"--slot-moving":1},animate:{width:`auto`,marginRight:0,transitionEnd:{overflow:`visible`,"--slot-moving":0}},exit:d?{opacity:0,transition:C}:{width:0,marginRight:-e,overflow:`clip`,"--slot-moving":1,pointerEvents:`none`,transition:{...L.spring.smooth,"--slot-moving":C}},transition:d?C:L.spring.smooth}),T={initial:!d&&{opacity:0,scale:.9,filter:J(L.blur.soft)},animate:{opacity:1,scale:1,filter:J(0)},exit:d?{opacity:0,transition:C}:{opacity:0,scale:.9,filter:J(L.blur.subtle),transition:be},transition:d?C:{...K,scale:L.spring.snappy}},E=d?{...Te(!0),initial:!1}:Te(!1),D=d?E:{...E,transition:{...K,delay:L.duration.instant*.75}};return(0,G.jsxs)(`div`,{ref:f,className:W.toolbar,role:`group`,"aria-label":s,children:[a?(0,G.jsx)(`div`,{className:W.leading,children:a}):null,(0,G.jsx)(I.div,{className:W.frame,style:{height:S},children:(0,G.jsxs)(`div`,{ref:p,className:W.chips,children:[(0,G.jsx)(i,{initial:!1,children:e.map((e,t)=>(0,G.jsx)(I.span,{className:W.slot,...w(8),children:(0,G.jsxs)(I.span,{className:W.chip,...T,children:[(0,G.jsxs)(`span`,{className:W.chipLabel,title:X(e),children:[e.label,Y(e)?(0,G.jsxs)(`span`,{className:W.value,children:[(0,G.jsx)(`span`,{className:W.separator,children:` · `}),(0,G.jsx)(Ee,{text:Y(e)})]}):null]}),(0,G.jsx)(`button`,{type:`button`,"data-chip-remove":e.id,"aria-label":u.remove(e),onClick:r=>{document.activeElement===r.currentTarget&&(h.current=t),n(e.id)},children:(0,G.jsx)(g,{size:14,strokeWidth:1.8,"aria-hidden":`true`})})]})},e.id))}),(0,G.jsx)(i,{initial:!1,children:e.length?null:(0,G.jsx)(I.span,{className:W.empty,...D,children:u.empty},`empty`)})]})}),(0,G.jsxs)(`div`,{className:W.actions,children:[c?(0,G.jsx)(Ne,{fields:c.fields,onSelect:c.onAdd,active:e,label:c.label,align:c.align,messages:u}):null,o,(0,G.jsx)(i,{initial:!1,children:e.length>0&&r?(0,G.jsx)(I.span,{className:W.slot,...w(12),children:(0,G.jsx)(`button`,{className:W.clear,type:`button`,onClick:()=>{h.current=-1,r?.()},children:(0,G.jsx)(I.span,{className:W.clearText,...E,children:u.clearAll})})},`clear`):null})]}),(0,G.jsx)(`span`,{className:W.srOnly,role:`status`,children:y})]})}var Fe={api_key:`settings.privacy.category.api_key`,aws_key:`settings.privacy.category.aws_key`,jwt:`settings.privacy.category.jwt`,private_key:`settings.privacy.category.private_key`,email:`settings.privacy.category.email`,phone:`settings.privacy.category.phone`,intranet:`settings.privacy.category.intranet`,credit_card:`settings.privacy.category.credit_card`,national_id:`settings.privacy.category.national_id`,credential:`settings.privacy.category.credential`,custom:`settings.privacy.category.custom`},Ie={warn:`settings.privacy.action.warn`,block:`settings.privacy.action.block`,redact:`settings.privacy.action.redact`};function Z(){let{t:e}=u();return t=>{let n=Fe[t];return n?e(n):t}}function Le({action:e}){let{t}=u();return(0,G.jsx)(p,{tone:e===`block`?`red`:e===`redact`?`orange`:`neutral`,children:t(Ie[e]??`settings.privacy.action.warn`)})}var Re=50,ze=[`block`,`redact`,`warn`];function Be(){let{t:e,locale:t}=u(),n=Z(),[r,i]=(0,U.useState)(``),[a,s]=(0,U.useState)({client:``,category:``,action:``,blocked:``}),[l,p]=(0,U.useState)(1),[m,h]=(0,U.useState)(null),g=B(r),v=te(),y=O(),b={model:g,...a,page:l,pageSize:Re},S=w(b,l===1),C=S.data,E=C?Math.max(1,Math.ceil(C.total/Re)):1,D=e=>e?he[e]?.name??e:`—`,k=[...new Set((y.data?.rules??[]).map(e=>e.category))],A={client:(v.data??[]).map(e=>({value:e.kind,label:e.name})),category:k.map(e=>({value:e,label:n(e)})),action:ze.map(t=>({value:t,label:e(`settings.privacy.action.${t}`)})),blocked:[{value:`true`,label:e(`privacy.logs.blockedOnly`)},{value:`false`,label:e(`privacy.logs.passedOnly`)}]},M={client:e(`requests.col.client`),category:e(`privacy.stats.col.category`),action:e(`privacy.logs.col.action`),blocked:e(`privacy.logs.col.outcome`)},ne=Object.keys(A).map(e=>({id:e,label:M[e],options:A[e].map(e=>e.label)})),N=Object.keys(a).filter(e=>a[e]).map(e=>({id:e,label:M[e],value:A[e].find(t=>t.value===a[e])?.label??a[e]})),P=(e,t)=>{s(n=>({...n,[e]:t})),p(1)},F=(C?.items??[]).map(e=>({id:e.id,time:Date.parse(e.startedAtUtc),client:D(e.clientKind),model:e.requestedModel??``,outcome:Ve(e),hits:e.hits.reduce((e,t)=>e+t.count,0),e})),I=[{key:`time`,label:e(`requests.col.time`),width:92,render:(e,n)=>(0,G.jsx)(`span`,{className:`num`,children:j(n.e.startedAtUtc,t)})},{key:`model`,label:e(`requests.col.model`),render:(t,n)=>(0,G.jsxs)(`button`,{type:`button`,className:`block w-full min-w-0 text-left`,onClick:()=>h(n.id),"aria-label":e(`privacy.logs.viewRequest`,{model:n.model||n.id}),children:[(0,G.jsx)(`span`,{className:`block truncate font-medium hover:text-[var(--accent)]`,children:n.model||`—`}),(0,G.jsx)(`span`,{className:`block truncate text-[11px] text-[var(--text-muted)]`,children:D(n.e.clientKind)})]})},{key:`outcome`,label:e(`privacy.logs.col.outcome`),width:130,render:(e,t)=>(0,G.jsx)(He,{event:t.e})},{key:`hits`,label:e(`privacy.logs.col.hits`),render:(e,t)=>(0,G.jsx)(Ue,{event:t.e})},{key:`client`,label:e(`requests.col.client`),width:110,render:e=>(0,G.jsx)(`span`,{className:`block truncate`,children:String(e||`—`)})}];return(0,G.jsxs)(G.Fragment,{children:[(0,G.jsxs)(`div`,{className:`mb-3 flex items-center gap-2`,children:[(0,G.jsx)(T,{className:`w-52`,value:r,onChange:e=>{i(e),p(1)},placeholder:e(`requests.searchModel`)}),(0,G.jsx)(o,{variant:`plain`,icon:(0,G.jsx)(se,{className:d(`size-4`,S.isFetching&&`animate-spin`)}),"aria-label":e(`common.refresh`),onClick:()=>void S.refetch()})]}),(0,G.jsx)(`div`,{className:`mb-3`,children:(0,G.jsx)(Pe,{label:e(`requests.filters`),filters:N,onRemove:e=>P(e,``),onClearAll:()=>{s({client:``,category:``,action:``,blocked:``}),p(1)},addFilter:{fields:ne,label:e(`requests.addFilter`),onAdd:e=>{let t=e.id,n=A[t].find(t=>t.label===e.value)?.value;n&&P(t,n)}}})}),S.isLoading&&(0,G.jsx)(x,{lines:4,className:`py-6`}),S.isError&&(0,G.jsx)(f,{tone:`danger`,title:e(`common.error`),children:c(S.error)}),C&&C.items.length===0&&(0,G.jsx)(ee,{icon:(0,G.jsx)(ye,{className:`size-6`}),title:e(`privacy.logs.empty`),detail:e(`privacy.logs.empty.detail`)}),C&&C.items.length>0&&(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(`p`,{className:`mb-2 text-[12px] text-[var(--text-secondary)]`,children:e(`privacy.logs.total`,{count:_(C.total)})}),(0,G.jsx)(ue,{caption:e(`privacy.tab.logs`),rows:F,columns:I,rowKey:`id`,emptyMessage:e(`privacy.logs.empty`)})]}),C&&E>1&&(0,G.jsx)(`div`,{className:`mt-4 flex justify-center`,children:(0,G.jsx)(de,{page:l,pageCount:E,onPageChange:p,label:e(`requests.page`,{page:l,pages:E})})}),(0,G.jsx)(me,{id:m,onClose:()=>h(null)})]})}function Ve(e){return e.blocked?`blocked`:e.redactions>0?`redact`:e.dryRun?`dryRun`:`warn`}function He({event:e}){let{t}=u();return e.blocked?(0,G.jsx)(p,{tone:`red`,children:t(`privacy.logs.outcome.blocked`)}):e.redactions>0?(0,G.jsx)(p,{tone:`orange`,children:t(`privacy.logs.outcome.redacted`,{count:e.redactions})}):e.dryRun?(0,G.jsx)(p,{tone:`neutral`,children:t(`privacy.logs.outcome.dryRun`)}):(0,G.jsx)(p,{tone:`neutral`,children:t(`settings.privacy.action.warn`)})}function Ue({event:e}){let t=Z(),{t:n}=u();if(e.hits.length===0)return(0,G.jsx)(`span`,{className:`text-[var(--text-muted)]`,children:`—`});let r=e.hits.slice(0,2),i=e.hits.length-r.length;return(0,G.jsxs)(`span`,{className:`flex flex-wrap items-center gap-x-2 gap-y-0.5 text-[12px]`,children:[r.map(e=>(0,G.jsxs)(`span`,{className:`inline-flex items-center gap-1`,children:[(0,G.jsx)(Le,{action:e.action}),(0,G.jsxs)(`span`,{children:[t(e.category),` × `,e.count]}),e.samples&&e.samples.length>0&&(0,G.jsx)(`span`,{className:`font-mono text-[11px] text-[var(--text-muted)]`,children:e.samples.slice(0,2).join(` `)})]},`${e.ruleId}:${e.action}`)),i>0&&(0,G.jsx)(`span`,{className:`text-[var(--text-muted)]`,children:n(`privacy.logs.moreHits`,{count:i})})]})}var Q={counter:`_counter_dnoch_1`,label:`_label_dnoch_2`,value:`_value_dnoch_4`,column:`_column_dnoch_6`,sizer:`_sizer_dnoch_7`,glyph:`_glyph_dnoch_8`,labelText:`_labelText_dnoch_9`,labelSwap:`_labelSwap_dnoch_10`,symbol:`_symbol_dnoch_11`,srOnly:`_srOnly_dnoch_12`},We=[0,1,2,3,4,5,6,7,8,9],Ge={hidden:{opacity:0,y:`0.3em`,filter:`blur(${L.blur.soft}px)`},shown:{opacity:1,y:0,filter:`blur(0px)`,transition:{duration:L.duration.standard,ease:[...L.ease.enter]}},gone:{opacity:0,y:`-0.3em`,filter:`blur(${L.blur.subtle}px)`,transition:{duration:L.duration.fast,ease:[...L.ease.standard]}}},Ke={hidden:{opacity:0,y:0,filter:`blur(0px)`},shown:{opacity:1,y:0,filter:`blur(0px)`,transition:{duration:L.duration.instant}},gone:{opacity:0,y:0,filter:`blur(0px)`,transition:{duration:L.duration.instant}}},qe={...L.spring.smooth,visualDuration:L.duration.considered};function Je(e,t,n){let r=new Intl.NumberFormat(n,{minimumFractionDigits:t,maximumFractionDigits:t,numberingSystem:`latn`}).formatToParts(e),i=r.reduce((e,t)=>e+(t.type===`integer`?t.value.length:0),0),a=0,o=0;return r.flatMap((e,t)=>e.type===`integer`?[...e.value].map(e=>({key:`i${--i}`,digit:Number(e),order:o++})):e.type===`fraction`?[...e.value].map(e=>({key:`f${a++}`,digit:Number(e),order:o++})):[{key:e.type===`group`?`g${i}`:e.type===`decimal`?`d`:`${e.type}${t}`,text:e.value}])}function Ye({position:e,digit:t}){let n=R(e,e=>((t-e)%10+15)%10-5),r=R(n,e=>`${e}em`),i=R(n,e=>Math.max(0,1-Math.abs(e))),a=R(n,e=>Math.abs(e)>=1?`hidden`:`visible`),o=R(n,e=>Math.abs(e)<.02||Math.abs(e)>=1?`none`:`blur(${(Math.abs(e)*L.blur.subtle).toFixed(2)}px)`);return(0,G.jsx)(I.span,{className:Q.glyph,style:{y:r,opacity:i,filter:o,visibility:a},children:t})}var Xe={initial:{width:0,opacity:0},animate:{width:`auto`,opacity:1},exit:{width:0,opacity:0}};function Ze({digit:e,direction:t,armed:n,delay:r,reduceMotion:i}){let a=P(n?0:e),o=(0,U.useRef)({digit:n?0:e,target:n?0:e,revealed:!n});return(0,U.useEffect)(()=>{let s=o.current;if(n||s.digit===e){n||(s.revealed=!0);return}s.target+=t<0&&s.revealed?-((s.digit-e+10)%10):(e-s.digit+10)%10,s.digit=e,i?a.jump(s.target):l(a,s.target,s.revealed?L.spring.smooth:{...qe,delay:r}),s.revealed=!0},[n,r,e,t,a,i]),(0,G.jsxs)(I.span,{className:Q.column,...Xe,transition:i?{duration:0}:L.spring.morph,children:[(0,G.jsx)(`span`,{className:Q.sizer,children:`0`}),We.map(e=>(0,G.jsx)(Ye,{position:a,digit:e},e))]})}function Qe({value:e,label:n,prefix:r=``,suffix:a=``,decimals:o=0,animateOnView:s=!1,locale:c=`en-US`}){let l=(0,U.useRef)(null),u=V(l,{once:!0,amount:.6}),d=!!t(),[f,p]=(0,U.useState)(e),[m,h]=(0,U.useState)(1);e!==f&&(p(e),h(e>f?1:-1));let g=Je(e,o,c),_=`${r}${g.map(e=>`text`in e?e.text:e.digit).join(``)}${a}`,v=s&&!u;return(0,G.jsxs)(`span`,{ref:l,className:Q.counter,children:[n&&(0,G.jsx)(`span`,{className:Q.label,children:(0,G.jsx)(`span`,{className:Q.labelSwap,children:(0,G.jsx)(i,{mode:`popLayout`,initial:!1,children:(0,G.jsx)(I.span,{className:Q.labelText,variants:d?Ke:Ge,initial:`hidden`,animate:`shown`,exit:`gone`,children:n},n)})})}),(0,G.jsx)(`span`,{className:Q.srOnly,children:_}),(0,G.jsxs)(`span`,{className:Q.value,"aria-hidden":`true`,children:[r&&(0,G.jsx)(`span`,{className:Q.symbol,children:r}),(0,G.jsx)(i,{initial:!1,children:g.map(e=>`digit`in e?(0,G.jsx)(Ze,{digit:e.digit,direction:m,armed:v,delay:Math.min(e.order*L.stagger.item,.25),reduceMotion:d},e.key):(0,G.jsx)(I.span,{className:Q.symbol,...Xe,transition:d?{duration:0}:L.spring.morph,children:e.text},e.key))}),a&&(0,G.jsx)(`span`,{className:Q.symbol,children:a})]})]})}var $={card:`_card_1r6t9_1`,top:`_top_1r6t9_2`,swap:`_swap_1r6t9_8`,swapBlock:`_swapBlock_1r6t9_8`,text:`_text_1r6t9_11`,sizer:`_sizer_1r6t9_13`},$e={hidden:e=>({opacity:0,y:`${.3*e}em`,filter:`blur(${L.blur.soft}px)`}),shown:{opacity:1,y:0,filter:`blur(0px)`,transition:{duration:L.duration.standard,ease:[...L.ease.enter]}},gone:e=>({opacity:0,y:`${-.3*e}em`,filter:`blur(${L.blur.subtle}px)`,transition:{duration:L.duration.fast,ease:[...L.ease.standard]}})},et={hidden:{opacity:0,y:0,filter:`blur(0px)`},shown:{opacity:1,y:0,filter:`blur(0px)`,transition:{duration:L.duration.instant}},gone:{opacity:0,y:0,filter:`blur(0px)`,transition:{duration:L.duration.instant}}},tt=e=>Number(e.replace(/,/g,``).match(/-?\d+(?:\.\d+)?/)?.[0]??NaN);function nt({text:e,morph:n=!1,block:r=!1}){let a=!!t(),o=(0,U.useRef)(null),s=P(`auto`),[c,u]=(0,U.useState)({text:e,direction:1});return c.text!==e&&u({text:e,direction:tt(e)<tt(c.text)?-1:1}),(0,U.useEffect)(()=>{let e=o.current;if(!e||typeof ResizeObserver>`u`)return;let t=null,n=new ResizeObserver(([n])=>{let r=n.borderBoxSize?.[0]?.inlineSize??e.offsetWidth;r&&t!==null&&t!==e.textContent&&!a?l(s,r,L.spring.morph):s.jump(r||`auto`),t=r?e.textContent:null});return n.observe(e),()=>n.disconnect()},[n,a,s]),(0,G.jsxs)(I.span,{className:r?$.swapBlock:$.swap,style:n?{width:s}:void 0,children:[n&&(0,G.jsx)(`span`,{ref:o,className:$.sizer,"aria-hidden":`true`,children:e}),(0,G.jsx)(i,{mode:`popLayout`,initial:!1,custom:c.direction,children:(0,G.jsx)(I.span,{className:$.text,custom:c.direction,variants:a?et:$e,initial:`hidden`,animate:`shown`,exit:`gone`,children:e},e)})]})}function rt({label:e,value:n,suffix:r,context:a,change:o}){let s=!!t();return(0,G.jsxs)(`article`,{className:$.card,children:[(0,G.jsxs)(`div`,{className:$.top,children:[(0,G.jsx)(`span`,{children:(0,G.jsx)(nt,{text:e,block:!0})}),(0,G.jsx)(i,{initial:!1,children:o&&(0,G.jsx)(I.small,{"data-trend":/^[+]/.test(o)?`up`:/^[-−]/.test(o)?`down`:void 0,initial:{opacity:0,scale:s?1:.96},animate:{opacity:1,scale:1},exit:{opacity:0,scale:s?1:.96,transition:{duration:L.duration.fast,ease:[...L.ease.standard]}},transition:s?{duration:0}:L.spring.snappy,children:(0,G.jsx)(nt,{text:o,morph:!0})},`change`)})]}),(0,G.jsx)(Qe,{value:n,suffix:r,animateOnView:!0}),(0,G.jsx)(`p`,{children:(0,G.jsx)(nt,{text:a,block:!0})})]})}var it=[{id:`ipv4-all`,nameKey:`settings.privacy.template.ipv4All`,hintKey:`settings.privacy.template.ipv4AllHint`,pattern:String.raw`(?<![\d.])(?:\d{1,3}\.){3}\d{1,3}(?![\d.])`},{id:`landline`,nameKey:`settings.privacy.template.landline`,hintKey:`settings.privacy.template.genericHint`,pattern:String.raw`(?<!\d)0\d{2,3}[- ]?\d{7,8}(?!\d)`},{id:`license-plate`,nameKey:`settings.privacy.template.licensePlate`,hintKey:`settings.privacy.template.genericHint`,pattern:String.raw`[京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼使领][A-HJ-NP-Z][A-HJ-NP-Z0-9]{4,5}[A-HJ-NP-Z0-9挂学警港澳]`},{id:`passport-cn`,nameKey:`settings.privacy.template.passportCn`,hintKey:`settings.privacy.template.genericHint`,pattern:String.raw`(?<![A-Za-z0-9])[EG]\d{8}(?!\d)`},{id:`uscc`,nameKey:`settings.privacy.template.uscc`,hintKey:`settings.privacy.template.genericHint`,pattern:String.raw`(?<![0-9A-HJ-NPQRTUWXY])[0-9A-HJ-NPQRTUWXY]{18}(?![0-9A-HJ-NPQRTUWXY])`},{id:`long-token`,nameKey:`settings.privacy.template.longToken`,hintKey:`settings.privacy.template.longTokenHint`,pattern:String.raw`(?<![A-Za-z0-9])[A-Za-z0-9_\-]{32,}(?![A-Za-z0-9])`},{id:`mac-address`,nameKey:`settings.privacy.template.macAddress`,hintKey:`settings.privacy.template.genericHint`,pattern:String.raw`(?<![0-9A-Fa-f:])(?:[0-9A-Fa-f]{2}:){5}[0-9A-Fa-f]{2}(?![0-9A-Fa-f:])`},{id:`unix-home`,nameKey:`settings.privacy.template.unixHome`,hintKey:`settings.privacy.template.unixHomeHint`,pattern:String.raw`/(?:Users|home)/[A-Za-z0-9_.\-]+`},{id:`windows-profile`,nameKey:`settings.privacy.template.windowsProfile`,hintKey:`settings.privacy.template.unixHomeHint`,pattern:String.raw`[A-Za-z]:\\+Users\\+[A-Za-z0-9_.\-]+`},{id:`cloud-accesskey`,nameKey:`settings.privacy.template.cloudAccessKey`,hintKey:`settings.privacy.template.genericHint`,pattern:String.raw`(?<![A-Za-z0-9])(?:LTAI[A-Za-z0-9]{12,20}|AKID[A-Za-z0-9]{13,40})(?![A-Za-z0-9])`},{id:`aws-secret-key`,nameKey:`settings.privacy.template.awsSecretKey`,hintKey:`settings.privacy.template.genericHint`,pattern:String.raw`(?<![A-Za-z0-9/+=])[A-Za-z0-9/+=]{40}(?![A-Za-z0-9/+=])`},{id:`im-webhook`,nameKey:`settings.privacy.template.imWebhook`,hintKey:`settings.privacy.template.imWebhookHint`,pattern:String.raw`oapi\.dingtalk\.com/robot/send\?access_token=[0-9a-f]{64}|qyapi\.weixin\.qq\.com/cgi-bin/webhook/send\?key=[0-9a-f]{32}|open\.feishu\.cn/open-apis/bot/v2/hook/[0-9a-f\-]{20,}|hooks\.slack\.com/services/T[A-Za-z0-9]+/B[A-Za-z0-9]+/[A-Za-z0-9]+`},{id:`internal-service`,nameKey:`settings.privacy.template.internalService`,hintKey:`settings.privacy.template.genericHint`,pattern:String.raw`(?:gitlab|jenkins|jira|confluence|wiki|nexus|harbor|grafana|kibana|sonarqube|oa|sso)\.[A-Za-z0-9\-]+(?:\.[A-Za-z0-9\-]+)+`},{id:`jdbc-conn`,nameKey:`settings.privacy.template.jdbcConn`,hintKey:`settings.privacy.template.jdbcHint`,pattern:String.raw`jdbc:[A-Za-z0-9]+:[^\s"']*(?:[Uu]ser(?:[ _]?[Ii][Dd])?|[Pp]assword)=[^\s"&';]+`},{id:`smtp-conn`,nameKey:`settings.privacy.template.smtpConn`,hintKey:`settings.privacy.template.jdbcHint`,pattern:String.raw`(?:smtp|imap|pop3)s?://[^\s:@/]+:[^\s@]+@[^\s]+`},{id:`key-file-ref`,nameKey:`settings.privacy.template.keyFileRef`,hintKey:`settings.privacy.template.genericHint`,pattern:String.raw`[A-Za-z0-9_\-./\\]+\.(?:pem|key|pfx|p12|jks|keystore)\b`},{id:`confidential-marker`,nameKey:`settings.privacy.template.confidentialMarker`,hintKey:`settings.privacy.template.confidentialHint`,pattern:String.raw`(?:绝密|机密|商业秘密|内部资料|内部公开|仅限内部|请勿外传|Confidential|Internal Use Only|Internal Only|Company Private)`},{id:`employee-id`,nameKey:`settings.privacy.template.employeeId`,hintKey:`settings.privacy.template.genericHint`,pattern:String.raw`(?<![A-Za-z0-9])(?:[Ee][Mm][Pp]|工号)[::\- ]?\d{4,10}(?!\d)`},{id:`labeled-number`,nameKey:`settings.privacy.template.labeledNumber`,hintKey:`settings.privacy.template.genericHint`,pattern:String.raw`(?:合同|订单|采购单|工单|项目)编号[::]?\s*[A-Za-z0-9_\-]{4,32}`}],at=[`off`,`warn`,`block`,`redact`],ot=Ie;function st(){let{t}=u(),{toast:n}=e(),r=O(),i=s(),a=r.data?.settings,o=e=>{a&&i.mutate({...a,...e},{onError:e=>n(c(e),`error`)})},l=at.map(e=>({value:e,label:t(e===`off`?`settings.privacy.action.off`:ot[e])}));return(0,G.jsxs)(C,{title:t(`settings.privacy`),footer:t(`settings.privacy.footer`),children:[r.isLoading&&(0,G.jsx)(x,{className:`my-4`}),r.isError&&(0,G.jsx)(`div`,{className:`px-4 py-3 text-[12px] text-[var(--danger)]`,children:c(r.error)}),a&&(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(y,{label:t(`settings.privacy.enabled`),detail:t(`settings.privacy.enabledHint`),children:(0,G.jsx)(k,{checked:a.enabled,label:t(`settings.privacy.enabled`),onChange:e=>o({enabled:e})})}),(0,G.jsx)(y,{label:t(`settings.privacy.dryRun`),detail:t(`settings.privacy.dryRunHint`),children:(0,G.jsx)(k,{checked:a.dryRun,disabled:!a.enabled,label:t(`settings.privacy.dryRun`),onChange:e=>o({dryRun:e})})}),(0,G.jsx)(y,{label:t(`settings.privacy.restore`),detail:t(`settings.privacy.restoreHint`),children:(0,G.jsx)(k,{checked:a.restoreResponses,disabled:!a.enabled,label:t(`settings.privacy.restore`),onChange:e=>o({restoreResponses:e})})}),(0,G.jsx)(y,{label:t(`settings.privacy.recordSamples`),detail:t(`settings.privacy.recordSamplesHint`),children:(0,G.jsx)(k,{checked:a.recordSamples,disabled:!a.enabled,label:t(`settings.privacy.recordSamples`),onChange:e=>o({recordSamples:e})})}),(0,G.jsx)(y,{label:t(`settings.privacy.defaultAction`),children:(0,G.jsx)(h,{className:`w-36`,ariaLabel:t(`settings.privacy.defaultAction`),value:a.defaultAction,disabled:!a.enabled,onChange:e=>o({defaultAction:e}),options:l})})]})]})}function ct(){let{t}=u(),{toast:n}=e(),r=O(),i=s(),a=r.data?.settings,l=Z(),d=e=>{a&&i.mutate({...a,...e},{onError:e=>n(c(e),`error`)})},f=(e,t)=>d({categoryActions:{...a?.categoryActions,[e]:t}}),m=at.map(e=>({value:e,label:t(e===`off`?`settings.privacy.action.off`:ot[e])})),g=[...new Set((r.data?.rules??[]).map(e=>e.category))],_=e=>r.data?.rules.find(t=>t.category===e)?.description;return r.isLoading?(0,G.jsx)(`div`,{className:`mx-auto max-w-[720px]`,children:(0,G.jsx)(x,{className:`my-4`})}):a?(0,G.jsxs)(`div`,{className:`mx-auto flex max-w-[720px] flex-col gap-4`,children:[(0,G.jsx)(C,{title:t(`settings.privacy.categories`),children:g.map(e=>{let n=a.categoryActions[e]??a.defaultAction,r=!a.enabled||n===`off`;return(0,G.jsxs)(y,{label:l(e),detail:_(e),children:[n===`off`?(0,G.jsx)(p,{children:t(`settings.privacy.action.off`)}):(0,G.jsx)(h,{className:`w-36`,ariaLabel:l(e),value:n,disabled:!a.enabled,onChange:t=>f(e,t),options:m.filter(e=>e.value!==`off`)}),r&&(0,G.jsx)(o,{size:`sm`,variant:`plain`,disabled:!a.enabled,onClick:()=>f(e,a.categoryActions[e]??a.defaultAction),children:t(`settings.privacy.enableCategory`)})]},e)})}),(0,G.jsx)(lt,{s:a,onPatch:d})]}):null}function lt({s:t,onPatch:n}){let{t:r}=u(),{confirm:i}=e(),[a,s]=(0,U.useState)(!1),c=(e,r)=>n({customRules:t.customRules.map(t=>t.id===e.id?{...t,enabled:r}:t)}),l=async e=>{await i({title:r(`settings.privacy.deleteRuleConfirm`,{name:e.name}),destructive:!0,confirmLabel:r(`common.delete`)})&&n({customRules:t.customRules.filter(t=>t.id!==e.id)})};return(0,G.jsxs)(C,{title:r(`settings.privacy.customRules`),children:[t.customRules.length===0&&(0,G.jsx)(`div`,{className:`px-4 py-4 text-[12px] text-[var(--text-secondary)]`,children:r(`settings.privacy.noCustomRules`)}),t.customRules.map(e=>(0,G.jsxs)(y,{label:e.name,detail:e.pattern,children:[(0,G.jsx)(k,{checked:e.enabled,disabled:!t.enabled,label:e.name,onChange:t=>c(e,t)}),(0,G.jsx)(o,{size:`sm`,variant:`plain`,icon:(0,G.jsx)(le,{className:`size-3.5`}),"aria-label":`${r(`common.delete`)} ${e.name}`,onClick:()=>void l(e)})]},e.id)),(0,G.jsx)(`div`,{className:`px-4 py-2`,children:(0,G.jsx)(o,{size:`sm`,icon:(0,G.jsx)(ie,{className:`size-3.5`}),disabled:!t.enabled,onClick:()=>s(!0),children:r(`settings.privacy.addRule`)})}),(0,G.jsx)(ut,{open:a,onOpenChange:s,onAdd:e=>n({customRules:[...t.customRules,e]})})]})}function ut({open:t,onOpenChange:n,onAdd:r}){let{t:i}=u(),{toast:a}=e(),[s,l]=(0,U.useState)(``),[d,f]=(0,U.useState)(``),[p,g]=(0,U.useState)(``);return(0,G.jsx)(F,{open:t,onOpenChange:n,title:i(`settings.privacy.addRule`),width:480,footer:(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(o,{onClick:()=>n(!1),children:i(`common.cancel`)}),(0,G.jsx)(o,{variant:`primary`,disabled:!s.trim()||!d.trim(),onClick:()=>{if(s.trim()&&d.trim()){try{new RegExp(d)}catch(e){a(`${i(`settings.privacy.invalidPattern`)}: ${c(e)}`,`error`);return}r({id:`custom-${Date.now().toString(36)}`,name:s.trim(),pattern:d.trim(),enabled:!0}),l(``),f(``),g(``),n(!1)}},children:i(`common.create`)})]}),children:(0,G.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,G.jsx)(A,{label:i(`settings.privacy.ruleTemplates`),hint:i(`settings.privacy.ruleTemplatesHint`),children:(0,G.jsx)(h,{ariaLabel:i(`settings.privacy.ruleTemplates`),value:p,onChange:e=>{g(e);let t=it.find(t=>t.id===e);t&&(l(i(t.nameKey)),f(t.pattern))},options:[{value:``,label:i(`settings.privacy.ruleTemplateNone`)},...it.map(e=>({value:e.id,label:i(e.nameKey)}))]})}),(0,G.jsx)(m,{label:i(`settings.privacy.ruleName`),value:s,onChange:e=>l(e.target.value),autoFocus:!0}),(0,G.jsx)(A,{label:i(`settings.privacy.rulePattern`),hint:i(`settings.privacy.rulePatternHint`),children:(0,G.jsx)(D,{mono:!0,rows:3,value:d,onChange:e=>f(e.target.value)})})]})})}function dt(){let{t}=u(),{toast:n}=e(),r=Z(),i=O(),a=M(),[s,l]=(0,U.useState)(``),d=a.data,f=i.data?.settings.enabled??!1;return(0,G.jsx)(C,{title:t(`settings.privacy.tester`),footer:t(`settings.privacy.testerHint`),children:(0,G.jsxs)(`div`,{className:`flex flex-col gap-3 px-4 py-3`,children:[(0,G.jsx)(D,{"aria-label":t(`settings.privacy.tester`),placeholder:t(`settings.privacy.testerPlaceholder`),rows:4,mono:!0,value:s,onChange:e=>l(e.target.value)}),(0,G.jsx)(`div`,{children:(0,G.jsx)(o,{icon:(0,G.jsx)(z,{className:`size-3.5`}),disabled:!f||!s.trim(),loading:a.isPending,onClick:()=>a.mutate({text:s},{onError:e=>n(c(e),`error`)}),children:t(`settings.privacy.runTest`)})}),d&&(0,G.jsxs)(`div`,{className:`rounded-lg border border-[var(--border)] px-3 py-2 text-[12px]`,children:[(0,G.jsxs)(`div`,{className:`flex items-center gap-2`,children:[d.blocked&&(0,G.jsx)(p,{tone:`red`,children:t(`settings.privacy.wouldBlock`)}),d.wouldRedact>0&&(0,G.jsx)(p,{tone:`orange`,children:t(`settings.privacy.wouldRedact`,{count:d.wouldRedact})}),!d.blocked&&d.wouldRedact===0&&(0,G.jsx)(p,{tone:`green`,children:t(`settings.privacy.noHits`)})]}),d.hits.length>0&&(0,G.jsx)(`ul`,{className:`mt-2 space-y-1`,children:d.hits.map(e=>(0,G.jsxs)(`li`,{className:`flex flex-wrap items-center gap-2`,children:[(0,G.jsx)(p,{tone:e.action===`block`?`red`:e.action===`redact`?`orange`:`neutral`,children:t(ot[e.action])}),(0,G.jsxs)(`span`,{children:[r(e.category),` · `,e.ruleId,` × `,e.count]}),e.samples&&e.samples.length>0&&(0,G.jsx)(`span`,{className:`font-mono text-[11px] text-[var(--text-muted)]`,children:e.samples.join(` `)})]},`${e.ruleId}:${e.action}`))})]})]})})}var ft=[`today`,`7d`,`30d`,`all`];function pt(){let{t:e}=u(),t=Z(),[n,r]=(0,U.useState)(`7d`),i=v(n),a=i.data,o=[{key:`category`,label:e(`privacy.stats.col.category`),render:e=>t(String(e))},{key:`requests`,label:e(`privacy.stats.col.requests`),numeric:!0,width:110},{key:`hits`,label:e(`privacy.stats.col.hits`),numeric:!0,width:96},{key:`warnHits`,label:e(`privacy.stats.col.warn`),numeric:!0,width:84},{key:`blockHits`,label:e(`privacy.stats.col.block`),numeric:!0,width:84},{key:`redactHits`,label:e(`privacy.stats.col.redact`),numeric:!0,width:84}],s=(a?.categories??[]).map(e=>({...e}));return(0,G.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,G.jsxs)(`section`,{children:[(0,G.jsx)(ne,{action:(0,G.jsx)(b,{ariaLabel:e(`overview.range`),value:n,onChange:r,items:ft.map(t=>({value:t,label:e(`range.${t}`)}))}),children:e(`privacy.stats`)}),i.isLoading&&(0,G.jsx)(x,{lines:3,className:`py-4`}),i.isError&&(0,G.jsx)(f,{tone:`danger`,title:e(`common.error`),children:c(i.error)}),a&&(0,G.jsxs)(`div`,{className:`grid grid-cols-2 gap-3 lg:grid-cols-4`,children:[(0,G.jsx)(rt,{label:e(`privacy.stats.events`),value:a.events,context:e(`range.${n}`)}),(0,G.jsx)(rt,{label:e(`privacy.stats.blocked`),value:a.blocked,context:e(`range.${n}`)}),(0,G.jsx)(rt,{label:e(`privacy.stats.redactions`),value:a.redactions,context:e(`range.${n}`)}),(0,G.jsx)(rt,{label:e(`privacy.stats.dryRun`),value:a.dryRun,context:e(`range.${n}`)})]})]}),(0,G.jsxs)(`section`,{children:[(0,G.jsx)(ne,{children:e(`privacy.stats.byCategory`)}),a&&a.categories.length===0&&(0,G.jsx)(`div`,{className:`card`,children:(0,G.jsx)(mt,{})}),a&&a.categories.length>0&&(0,G.jsx)(ue,{caption:e(`privacy.stats.byCategory`),rows:s,columns:o,rowKey:`category`,defaultSort:{key:`hits`,direction:`desc`}})]}),(0,G.jsx)(`div`,{className:`mx-auto w-full max-w-[720px]`,children:(0,G.jsx)(st,{})})]})}function mt(){let{t:e}=u();return(0,G.jsxs)(`div`,{className:`flex flex-col items-center gap-2 px-4 py-8 text-center`,children:[(0,G.jsx)(z,{className:`size-6 text-[var(--text-muted)]`}),(0,G.jsx)(`div`,{className:`text-[13px]`,children:e(`privacy.logs.empty`)}),(0,G.jsx)(`div`,{className:`text-[12px] text-[var(--text-secondary)]`,children:e(`privacy.logs.empty.detail`)})]})}var ht=[`overview`,`logs`,`rules`,`tester`];function gt(){let{t:e}=u(),{tab:t}=oe(),n=re(),r=ht.includes(t)?t:`overview`;return(0,G.jsx)(ae,{title:e(`nav.privacy`),subtitle:e(`settings.privacy.footer`),children:(0,G.jsxs)(fe,{value:r,onValueChange:e=>n(`/privacy/${e}`,{replace:!0}),children:[(0,G.jsx)(ge,{"aria-label":e(`nav.privacy`),children:ht.map(t=>(0,G.jsx)(_e,{value:t,children:e(`privacy.tab.${t}`)},t))}),(0,G.jsx)(H,{value:`overview`,className:`pt-5`,children:(0,G.jsx)(pt,{})}),(0,G.jsx)(H,{value:`logs`,className:`pt-4`,children:(0,G.jsx)(Be,{})}),(0,G.jsx)(H,{value:`rules`,className:`pt-5`,children:(0,G.jsx)(ct,{})}),(0,G.jsx)(H,{value:`tester`,className:`pt-5 [&>div]:mx-auto [&>div]:max-w-[680px]`,children:(0,G.jsx)(dt,{})})]})})}export{gt as PrivacyPage};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import{$ as e,$n as t,$r as n,$t as r,An as i,Br as a,C as o,Cn as s,Gn as c,Gt as l,Hn as u,In as d,Kn as f,Kt as p,Ln as m,Lr as h,Nr as g,Ot as _,Q as v,Qn as y,Rr as b,S as x,Tn as S,Ut as C,Vr as ee,Vt as w,Wn as te,Wr as ne,X as T,Xn as re,Xt as ie,Yt as ae,Z as E,_r as oe,ar as se,at as D,b as O,bn as ce,br as le,bt as ue,ci as k,ct as A,dn as de,dr as fe,dt as pe,ei as me,en as he,er as ge,et as _e,fn as ve,fr as j,ft as M,g as ye,gr as be,h as N,ha as xe,ii as Se,it as P,jn as Ce,kn as we,lt as Te,ma as Ee,mt as F,n as I,nr as De,nt as Oe,ot as L,pa as ke,pt as R,qt as z,rt as B,st as V,t as Ae,ti as je,ur as Me,va as Ne,vn as Pe,wr as Fe,wt as Ie,x as H,y as Le,yn as Re}from"./format-CkDcAs-_.js";import{b as ze,c as Be,s as U,t as Ve,x as W}from"./Page-iMwsVZGv.js";import{t as G}from"./arrow-down-Bgpt1Ug2.js";import{n as K,t as q}from"./checkbox-BQx1e8t-.js";import{t as He}from"./arrow-up-DqX0vZ8v.js";import{t as Ue}from"./cloud-download-B-iX6FzV.js";import{t as We}from"./download-Bbci4NYa.js";import{t as Ge}from"./ellipsis-O3neUtss.js";import{t as Ke}from"./external-link-BotneeB5.js";import{t as qe}from"./log-out-BSESm3Q8.js";import{t as Je}from"./power-rKYGhi1K.js";import{t as Ye}from"./rotate-ccw-CJ2l4No1.js";import{A as Xe,T as J,_ as Ze,a as Y,g as Qe,o as $e,s as X,u as et,v as tt,y as Z}from"./index-C6Mqffdm.js";import{t as nt}from"./confirm-morph-C93BpFKZ.js";import{AUTH_OPTIONS as rt,PROTOCOL_OPTIONS as it,i as at,n as ot,r as st,t as ct}from"./ProvidersPage-DEwFPi0w.js";var lt={name:`arrow-right-left`,size:24,node:[[`path`,{d:`m16 3 4 4-4 4`,key:`1x1c3m`}],[`path`,{d:`M20 7H4`,key:`zbl0bi`}],[`path`,{d:`m8 21-4-4 4-4`,key:`h9nckh`}],[`path`,{d:`M4 17h16`,key:`g4d7ey`}]]};lt.node;var ut=_(lt),dt={name:`gift`,size:24,node:[[`path`,{d:`M12 7v14`,key:`1akyts`}],[`path`,{d:`M20 11v8a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2v-8`,key:`1sqzm4`}],[`path`,{d:`M7.5 7a1 1 0 0 1 0-5A4.8 8 0 0 1 12 7a4.8 8 0 0 1 4.5-5 1 1 0 0 1 0 5`,key:`kc0143`}],[`rect`,{x:`3`,y:`7`,width:`18`,height:`4`,rx:`1`,key:`1hberx`}]]};dt.node;var ft=_(dt),pt={name:`globe`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20`,key:`13o1zl`}],[`path`,{d:`M2 12h20`,key:`9i4pu4`}]]};pt.node;var mt=_(pt),ht={name:`list-plus`,size:24,node:[[`path`,{d:`M16 5H3`,key:`m91uny`}],[`path`,{d:`M11 12H3`,key:`51ecnj`}],[`path`,{d:`M16 19H3`,key:`zzsher`}],[`path`,{d:`M18 9v6`,key:`1twb98`}],[`path`,{d:`M21 12h-6`,key:`bt1uis`}]]};ht.node;var gt=_(ht),_t={name:`log-in`,size:24,node:[[`path`,{d:`m10 17 5-5-5-5`,key:`1bsop3`}],[`path`,{d:`M15 12H3`,key:`6jk70r`}],[`path`,{d:`M15 3h4a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2h-4`,key:`u53s6r`}]]};_t.node;var vt=_(_t),yt={name:`plug`,size:24,node:[[`path`,{d:`M12 22v-5`,key:`1ega77`}],[`path`,{d:`M15 8V2`,key:`18g5xt`}],[`path`,{d:`M17 8a1 1 0 0 1 1 1v4a4 4 0 0 1-4 4h-4a4 4 0 0 1-4-4V9a1 1 0 0 1 1-1z`,key:`1xoxul`}],[`path`,{d:`M9 8V2`,key:`14iosj`}]]};yt.node;var bt=_(yt),xt={name:`sparkles`,size:24,node:[[`path`,{d:`M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z`,key:`1s2grr`}],[`path`,{d:`M20 2v4`,key:`1rf3ol`}],[`path`,{d:`M22 4h-4`,key:`gwowj6`}],[`circle`,{cx:`4`,cy:`20`,r:`2`,key:`6kqj1y`}]],aliases:[`stars`]};xt.node;var St=_(xt),Ct={name:`ticket`,size:24,node:[[`path`,{d:`M2 9a3 3 0 0 1 0 6v2a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-2a3 3 0 0 1 0-6V7a2 2 0 0 0-2-2H4a2 2 0 0 0-2 2Z`,key:`qn84l0`}],[`path`,{d:`M13 5v2`,key:`dyzc3o`}],[`path`,{d:`M13 17v2`,key:`1ont0d`}],[`path`,{d:`M13 11v2`,key:`1wjjxi`}]]};Ct.node;var wt=_(Ct),Q=Ne(xe(),1),$=Ee(),Tt={imported:`providers.subscription.importBatchStatus.imported`,updated:`providers.subscription.importBatchStatus.updated`,duplicate:`providers.subscription.importBatchStatus.duplicate`,invalid_format:`providers.subscription.importBatchStatus.invalid_format`,failed:`providers.subscription.importBatchStatus.failed`,ready:`providers.subscription.importBatchStatus.ready`},Et={imported:`green`,updated:`accent`,ready:`accent`,duplicate:`neutral`,invalid_format:`orange`,failed:`red`},Dt={batch:`providers.accounts.import.batchTitle`,token:`providers.accounts.import.tokenTitle`,apiKey:`providers.accounts.import.apiKeyTitle`};function Ot(e){return e.split(/[,\s]+/).flatMap(e=>{let t=e.replace(/^["']+|["']+$/g,``);return t.startsWith(`tid=`)||t.startsWith(`exp=`)?[t]:t.split(`;`)}).filter(e=>e.replace(/^["']+|["']+$/g,``).length>0).length}function kt(e){let t=e.trim();if(t.length===0)return 0;if(t.startsWith(`{`)||t.startsWith(`[`))try{let e=JSON.parse(t);if(Array.isArray(e))return e.filter(e=>typeof e==`object`&&!!e||typeof e==`string`&&e.trim().length>0).length;if(typeof e==`object`&&e)return 1}catch{}let n=0;for(let t of e.split(`
|
|
2
|
+
`)){let e=t.trim();e.length===0||e.startsWith(`#`)||(n+=e.startsWith(`{`)?1:Ot(e))}return n}function At({providerId:e,info:t,mode:n,providerProxy:r,onClose:i}){let{t:a}=C(),{toast:s}=o(),c=we(e),[l,u]=(0,Q.useState)(``),[d,f]=(0,Q.useState)(``),[p,m]=(0,Q.useState)(null),h=(0,Q.useMemo)(()=>kt(l),[l]);if((0,Q.useEffect)(()=>{n!==null&&(u(``),m(null))},[n]),n===null)return(0,$.jsx)(H,{open:!1,onOpenChange:i,title:``});let g=n===`apiKey`,_=g?t.formats.filter(e=>e.endsWith(`-api-key`)):t.formats,y=!g&&t.formats.some(e=>e.includes(`refresh-token`)||e.endsWith(`-json`)),b=a(g?`providers.accounts.import.apiKeyLabel`:`providers.accounts.import.label`),S=e=>c.mutate({text:l,asApiKey:g||void 0,dryRun:e||void 0,httpProxy:d.trim()||void 0},{onSuccess:t=>{m({...t,dryRun:e}),!e&&(s(a(`providers.accounts.import.summary`,{ok:t.imported,dup:t.duplicates,fail:t.failed}),t.failed>0?`info`:`success`),!(t.failed>0)&&(n===`batch`?u(``):i()))},onError:e=>s(x(e),`error`)});return(0,$.jsx)(H,{open:!0,onOpenChange:e=>!e&&i(),title:a(Dt[n]),description:a(`providers.accounts.import.desc`),width:560,children:(0,$.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[_.length>0&&(0,$.jsx)(`p`,{className:`text-[11.5px] text-[var(--text-secondary)]`,children:a(`providers.accounts.import.formats`,{formats:_.map(e=>a(`providers.accounts.format.${e}`)).join(` · `)})}),(0,$.jsx)(F,{mono:!0,rows:n===`batch`?8:3,value:l,onChange:e=>u(e.target.value),"aria-label":b,placeholder:b,spellCheck:!1}),(0,$.jsx)(D,{mono:!0,label:a(`providers.accounts.import.proxy`),placeholder:r||a(`providers.accounts.proxyFallbackSystem`),value:d,onChange:e=>f(e.target.value)}),y&&(0,$.jsx)(T,{tone:`info`,title:a(`providers.accounts.import.rotateWarning`)}),(0,$.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,$.jsx)(`span`,{className:`text-[11px] text-[var(--text-muted)]`,children:a(`providers.accounts.import.count`,{n:h})}),(0,$.jsxs)(`div`,{className:`flex gap-2`,children:[n===`batch`&&(0,$.jsx)(v,{disabled:h===0,loading:c.isPending&&c.variables?.dryRun===!0,onClick:()=>S(!0),children:a(`providers.accounts.import.preview`)}),(0,$.jsx)(v,{variant:`primary`,disabled:h===0||h>t.maxBatch,loading:c.isPending&&!c.variables?.dryRun,onClick:()=>S(!1),children:a(`providers.accounts.import.run`)})]})]}),p&&(0,$.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,$.jsx)(`div`,{className:`text-[12px] font-medium`,children:a(p.dryRun?`providers.accounts.import.previewSummary`:`providers.accounts.import.summary`,{ok:p.imported,dup:p.duplicates,fail:p.failed})}),(0,$.jsx)(`ul`,{className:`card max-h-72 divide-y divide-[var(--border)] overflow-auto`,children:p.items.map(e=>(0,$.jsxs)(`li`,{className:`flex items-start gap-2 px-3 py-1.5 text-[12px]`,children:[(0,$.jsx)(`span`,{className:`w-6 shrink-0 text-[var(--text-muted)]`,children:e.index}),(0,$.jsx)(`span`,{className:`selectable w-28 shrink-0 truncate font-mono`,children:e.source}),(0,$.jsx)(E,{tone:Et[e.status],children:a(Tt[e.status])}),e.kind&&(0,$.jsx)(`span`,{className:`shrink-0 text-[11px] text-[var(--text-muted)]`,children:a(`providers.accounts.credential.${e.kind}`)}),(0,$.jsx)(`span`,{className:`selectable min-w-0 flex-1 break-words text-[var(--text-secondary)]`,children:e.account?.displayName&&(e.status===`imported`||e.status===`updated`)?`${e.account.displayName}${e.message?` · ${e.message}`:``}`:e.message??``})]},e.index))})]})]})})}function jt(e,t=Date.now()){return e.enabled?e.status===`active`?e.cooldownUntilUtc&&new Date(e.cooldownUntilUtc).getTime()>t?`cooling`:`usable`:`dead`:`disabled`}var Mt={usable:`var(--success)`,cooling:`var(--warning)`,dead:`var(--danger)`,disabled:`var(--text-muted)`},Nt={active:`providers.subscription.status.active`,expired:`providers.subscription.status.expired`,revoked:`providers.subscription.status.revoked`};function Pt(e,t){let n=(e??``).toLowerCase(),r=t?`110,115,135`:/max|ultra/.test(n)?`47,124,246`:/pro|plus|premium/.test(n)?`52,195,143`:/team|business|enterprise|allegro|vivace/.test(n)?`130,100,230`:`110,115,135`;return`linear-gradient(135deg, rgba(${r},.34), rgba(${r},.08))`}function Ft({account:e,index:t,actions:n,selected:r,selecting:i,onToggleSelect:a,onMove:o,quotaPending:s}){let{t:c,locale:l}=C(),u=jt(e),d=e.displayName||e.accountEmail||e.keyMasked||e.id,f=e.kind===`api_key`,p=e.plan?.trim(),m=u===`cooling`?{text:c(`providers.subscription.cooldown`,{when:I(e.cooldownUntilUtc,l)}),tone:`var(--warning)`}:u===`dead`?{text:e.lastError||c(Nt[e.status]),tone:`var(--danger)`}:f?{text:e.keyMasked??c(`providers.accounts.neverExpires`),tone:void 0}:e.expiresAtUtc?{text:c(`providers.accounts.expiresAt`,{when:I(e.expiresAtUtc,l)}),tone:void 0}:null,h=[{id:`activate`,label:c(`providers.subscription.activate`),icon:(0,$.jsx)(ut,{className:`size-3.5`}),disabled:e.isCurrent||u===`dead`,onSelect:()=>n.activate(e)},{id:`toggle`,label:c(e.enabled?`providers.subscription.disable`:`providers.subscription.enable`),icon:(0,$.jsx)(Je,{className:`size-3.5`}),onSelect:()=>n.toggleEnabled(e)},...o?[{id:`up`,label:c(`providers.subscription.moveUp`),icon:(0,$.jsx)(He,{className:`size-3.5`}),disabled:!o.up,onSelect:()=>o.up?.()},{id:`down`,label:c(`providers.subscription.moveDown`),icon:(0,$.jsx)(G,{className:`size-3.5`}),disabled:!o.down,onSelect:()=>o.down?.()}]:[],{id:`quota`,separatorBefore:!0,label:c(`providers.subscription.quotaRefresh`),icon:(0,$.jsx)(st,{className:`size-3.5`}),disabled:u===`dead`,onSelect:()=>n.refreshQuota(e)},...f?[]:[{id:`refresh`,label:c(`providers.subscription.refreshToken`),icon:(0,$.jsx)(Ye,{className:`size-3.5`}),disabled:e.status===`revoked`,onSelect:()=>n.refreshToken(e)},{id:`relogin`,label:c(`providers.subscription.relogin`),disabled:e.status===`active`,onSelect:()=>n.relogin(e)}],{id:`remove`,label:c(`providers.subscription.logout`),icon:(0,$.jsx)(J,{className:`size-3.5`}),destructive:!0,separatorBefore:!0,onSelect:()=>n.remove(e)}],g=c(u===`disabled`?`providers.subscription.disabled`:Nt[e.status]),_=c(f?`providers.accounts.kind.api_key`:`providers.accounts.kind.oauth`),y=e.quota?.session?.usedPercent!=null||e.quota?.weekly?.usedPercent!=null||e.quota?.credits?.usedPercent!=null;return(0,$.jsxs)(`div`,{"data-testid":`account-card`,className:w(`group card relative flex aspect-square min-w-0 cursor-pointer flex-col overflow-hidden transition-colors hover:bg-[var(--fill)]`,e.isCurrent&&`ring-1 ring-[var(--accent)]`,r&&`bg-[var(--accent-subtle)]`,u===`disabled`&&`opacity-55`),onClick:()=>i?a(e.id):n.open(e),children:[(0,$.jsxs)(`div`,{className:`relative shrink-0 px-3 pb-3 pt-2.5`,style:{background:Pt(p,f)},children:[(u===`cooling`||u===`dead`)&&(0,$.jsx)(`span`,{"aria-hidden":!0,className:`absolute inset-y-0 left-0 w-[3px]`,style:{background:Mt[u]}}),(0,$.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,$.jsx)(`span`,{className:w(`flex size-5 items-center justify-center`,!i&&!r&&`hidden group-hover:flex`),onClick:e=>e.stopPropagation(),children:(0,$.jsx)(q,{checked:r,onCheckedChange:()=>a(e.id),"aria-label":c(`providers.accounts.select`,{name:d})})}),(0,$.jsxs)(`span`,{className:`flex items-center gap-1 text-[11px] text-[var(--text-secondary)]`,children:[(0,$.jsx)(`span`,{role:`img`,"aria-label":g,className:`size-1.5 shrink-0 rounded-full`,style:{background:Mt[u]}}),(0,$.jsx)(`span`,{"aria-hidden":!0,children:g})]}),e.httpProxy&&(0,$.jsx)(`span`,{title:`${c(`providers.accounts.proxyBadge`)}: ${e.httpProxy}`,className:`shrink-0 text-[var(--text-muted)]`,children:(0,$.jsx)(mt,{className:`size-3.5`,"aria-label":c(`providers.accounts.proxyBadge`)})}),(0,$.jsx)(`span`,{className:`-mr-1.5 ml-auto shrink-0`,onClick:e=>e.stopPropagation(),children:(0,$.jsx)(Le,{iconOnly:!0,label:c(`common.more`),icon:(0,$.jsx)(Ge,{className:`size-4`}),items:h})})]}),(0,$.jsx)(`div`,{className:`mt-1.5 truncate text-[17px] font-bold tracking-[.01em]`,title:p||_,children:p||_})]}),(0,$.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col px-3 pb-3 pt-2.5`,children:[(0,$.jsx)(`button`,{type:`button`,className:`block max-w-full truncate text-left text-[13px] font-medium outline-none focus-visible:underline`,title:d,onClick:t=>{t.stopPropagation(),i?a(e.id):n.open(e)},children:d}),(0,$.jsxs)(`div`,{className:`mt-0.5 flex min-w-0 items-center gap-1 whitespace-nowrap text-[11px] text-[var(--text-muted)]`,children:[e.isCurrent&&(0,$.jsxs)(`span`,{className:`flex shrink-0 items-center gap-1 text-[var(--success)]`,children:[(0,$.jsx)(`span`,{"aria-hidden":!0,children:`●`}),(0,$.jsx)(`span`,{children:c(`providers.subscription.current`)})]}),e.isCurrent&&(0,$.jsx)(`span`,{"aria-hidden":!0,children:`·`}),(0,$.jsx)(`span`,{className:`shrink-0`,children:_}),e.source&&(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(`span`,{"aria-hidden":!0,children:`·`}),(0,$.jsx)(`span`,{className:`truncate`,children:c(`providers.accounts.source.${e.source}`)})]}),(0,$.jsx)(`span`,{className:`ml-auto shrink-0 pl-1 opacity-0 group-hover:opacity-100`,children:c(`providers.accounts.order`,{n:t+1})})]}),m&&(u===`cooling`||u===`dead`||!y)&&(0,$.jsx)(`div`,{className:`mt-1.5 line-clamp-2 text-[11px] leading-snug`,style:{color:m.tone??`var(--text-muted)`},title:m.text,children:m.text}),u===`dead`?(0,$.jsxs)(`div`,{className:`mt-auto flex items-center gap-2 pt-2`,children:[(0,$.jsx)(`span`,{className:`text-[11px] text-[var(--text-muted)]`,children:c(`providers.accounts.signedOut`)}),!f&&(0,$.jsx)(v,{size:`sm`,className:`ml-auto`,onClick:t=>{t.stopPropagation(),n.relogin(e)},children:c(`providers.subscription.relogin`)})]}):(0,$.jsx)(Lt,{quota:e.quota??null,pending:s})]})]})}var It=10;function Lt({quota:e,pending:t}){let{t:n,locale:r}=C(),i=[];return e?.session?.usedPercent!=null&&i.push({key:`session`,label:e.session.windowMinutes?`${Math.round(e.session.windowMinutes/60)}h`:n(`providers.accounts.quotaShortSession`),percent:e.session.usedPercent,reset:e.session.resetsAtUtc}),e?.weekly?.usedPercent!=null&&i.push({key:`weekly`,label:n(`providers.accounts.quotaShortWeekly`),percent:e.weekly.usedPercent,reset:e.weekly.resetsAtUtc}),i.length<2&&e?.credits?.usedPercent!=null&&i.push({key:`credits`,label:n(e.entitlement==null?`providers.accounts.quotaShortCredits`:`providers.accounts.quotaShortPremium`),percent:e.credits.usedPercent,reset:e.credits.resetsAtUtc}),i.length===0?null:(0,$.jsx)(`div`,{className:w(`mt-auto flex flex-col gap-2 pt-2`,t&&`opacity-60`),children:i.slice(0,2).map(e=>{let t=Math.max(0,Math.min(100,Math.round(e.percent))),i=t>=90?`var(--danger)`:t>=70?`var(--warning)`:`var(--accent)`,a=Math.round(t/100*It),o=e.reset?n(`providers.subscription.quotaResets`,{when:I(e.reset,r)}):void 0;return(0,$.jsxs)(`div`,{className:`min-w-0`,title:o,children:[(0,$.jsxs)(`div`,{className:`flex justify-between text-[11px] text-[var(--text-secondary)]`,children:[(0,$.jsx)(`span`,{children:e.label}),(0,$.jsxs)(`span`,{className:`font-mono tabular-nums`,children:[t,`%`]})]}),(0,$.jsx)(`div`,{role:`progressbar`,"aria-label":e.label,"aria-valuenow":t,"aria-valuemin":0,"aria-valuemax":100,className:`mt-0.5 flex gap-[3px]`,children:Array.from({length:It},(e,t)=>(0,$.jsx)(`i`,{className:`h-[5px] flex-1 rounded-[2px] bg-[var(--surface-muted)]`,style:t<a?{background:i}:void 0},t))})]},e.key)})})}function Rt({quota:e,className:t}){let{t:n,locale:r}=C(),i=e=>{if(!e)return null;let t=new Date(e);return Number.isNaN(t.getTime())?null:n(`providers.subscription.quotaResets`,{when:t.toLocaleString(r)})},a=[];e.session?.usedPercent!=null&&a.push({key:`session`,label:n(`providers.subscription.quotaWindowSession`),window:e.session}),e.weekly?.usedPercent!=null&&a.push({key:`weekly`,label:n(`providers.subscription.quotaWindowWeekly`),window:e.weekly}),e.credits?.usedPercent!=null&&a.push({key:`credits`,label:e.entitlement==null?n(`providers.subscription.quotaWindowCredits`):n(`providers.subscription.quotaWindowPremium`),window:{usedPercent:e.credits.usedPercent,resetsAtUtc:e.credits.resetsAtUtc??null}});let o=e.credits?.prepaidBalance==null?null:n(`providers.subscription.quotaBalance`,{balance:e.credits.prepaidBalance}),s=e.entitlement!=null&&e.entitlement>=0?[n(`providers.subscription.quotaPremiumCount`,{used:Math.max(0,(e.entitlement??0)-(e.remaining??0)),total:e.entitlement}),e.overageUsed?n(`providers.subscription.quotaOverage`,{count:e.overageUsed}):null,e.overagePermitted===!1?n(`providers.subscription.quotaOverageOff`):null].filter(Boolean).join(` · `):null,c=e.planLabel??(e.fetchedAtUtc?n(`providers.subscription.quotaFetchedAt`,{when:new Date(e.fetchedAtUtc).toLocaleString(r)}):null);return(0,$.jsx)(`div`,{className:w(`px-4 py-1`,t),children:(0,$.jsxs)(`div`,{className:`card flex flex-col gap-3 p-3`,children:[(c||o)&&(0,$.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3 text-[11px] text-[var(--text-secondary)]`,children:[c&&(0,$.jsx)(`span`,{children:c}),o&&(0,$.jsx)(`span`,{children:o})]}),a.length===0?(0,$.jsx)(`div`,{className:`text-[12px] text-[var(--text-muted)]`,children:n(`providers.subscription.quotaNoWindows`)}):a.map(e=>(0,$.jsx)(zt,{label:e.label,window:e.window,reset:i(e.window.resetsAtUtc)},e.key)),s&&(0,$.jsx)(`div`,{className:`text-[10.5px] text-[var(--text-muted)]`,children:s})]})})}function zt({label:e,window:t,reset:n}){let r=Math.max(0,Math.min(100,Math.round(t.usedPercent??0))),[i,a]=(0,Q.useState)(0);(0,Q.useEffect)(()=>{if(typeof matchMedia==`function`&&matchMedia(`(prefers-reduced-motion: reduce)`).matches){a(r);return}let e=requestAnimationFrame(()=>a(r));return()=>cancelAnimationFrame(e)},[r]);let o=r>=90?`var(--danger)`:r>=70?`var(--warning)`:`var(--accent)`,s=t.windowMinutes?Math.round(t.windowMinutes/60):null;return(0,$.jsxs)(`div`,{children:[(0,$.jsxs)(`div`,{className:`mb-1 flex items-baseline justify-between gap-2 text-[11.5px]`,children:[(0,$.jsxs)(`span`,{className:`text-[var(--text-secondary)]`,children:[e,s!=null&&(0,$.jsxs)(`span`,{className:`text-[var(--text-muted)]`,children:[` · `,s,`h`]})]}),(0,$.jsxs)(`span`,{className:`font-mono tabular-nums`,children:[r,`%`]})]}),(0,$.jsx)(`div`,{role:`progressbar`,"aria-valuenow":r,"aria-valuemin":0,"aria-valuemax":100,"aria-label":e,className:`h-1.5 w-full overflow-hidden rounded-full bg-[var(--surface-muted)]`,children:(0,$.jsx)(`div`,{className:`h-full rounded-full transition-[width] duration-500 ease-out`,style:{width:`${i}%`,background:o}})}),n&&(0,$.jsx)(`div`,{className:`mt-1 text-[10.5px] text-[var(--text-muted)]`,children:n})]})}var Bt={available:`green`,redeemed:`neutral`,expired:`orange`};function Vt({account:e,providerId:t}){let{t:n}=C(),{toast:r,confirm:i}=o(),a=Fe(e.id,e.status===`active`),s=ve(t),c=a.data?.credits??[],l=a.data?.available_count??c.filter(e=>e.status===`available`).length,u=async t=>{await i({title:n(`providers.subscription.credits.consumeConfirm`,{title:t.title??t.reset_type??``}),detail:n(`providers.subscription.credits.consumeDetail`),confirmLabel:n(`providers.subscription.credits.consume`),destructive:!0})&&s.mutate({accountId:e.id,creditId:t.id},{onSuccess:()=>r(n(`providers.subscription.credits.consumed`),`success`),onError:e=>r(e instanceof k&&e.status===409?x(e):`${n(`providers.subscription.credits.consumeFailed`)}:${x(e)}`,`error`)})};return(0,$.jsxs)(P,{title:n(`providers.subscription.credits.title`),footer:n(`providers.subscription.credits.footer`),children:[a.isLoading&&(0,$.jsx)(M,{className:`my-4`}),a.isError&&(0,$.jsx)(`div`,{className:`px-4 py-3 text-[12px] text-[var(--text-secondary)]`,children:n(`providers.subscription.credits.unavailable`)}),a.data&&c.length===0&&(0,$.jsx)(`div`,{className:`px-4 py-5 text-center text-[12px] text-[var(--text-secondary)]`,children:n(`providers.subscription.credits.none`)}),c.map(e=>{let t=e.status!==`available`;return(0,$.jsxs)(A,{className:w(t&&`opacity-55`),label:(0,$.jsxs)(`span`,{className:`flex items-center gap-2`,children:[(0,$.jsx)(ft,{className:`size-3.5 text-[var(--text-secondary)]`}),e.title??e.reset_type??e.id]}),detail:[e.description,e.expires_at?n(`providers.subscription.credits.expires`,{when:new Date(e.expires_at).toLocaleString()}):null,e.redeemed_at?n(`providers.subscription.credits.redeemedAt`,{when:new Date(e.redeemed_at).toLocaleString()}):null,e.is_supported_by_plan===!1?n(`providers.subscription.credits.notInPlan`):null].filter(Boolean).join(` · `),children:[(0,$.jsx)(E,{tone:Bt[e.status]??`neutral`,children:n(`providers.subscription.credits.status.${e.status}`)}),(0,$.jsx)(v,{size:`sm`,variant:`plain`,icon:(0,$.jsx)(wt,{className:`size-3.5`}),disabled:t,loading:s.isPending&&s.variables?.creditId===e.id,onClick:()=>void u(e),children:n(`providers.subscription.credits.consume`)})]},e.id)}),a.data&&c.length>0&&(0,$.jsx)(`div`,{className:`px-4 py-2 text-[11px] text-[var(--text-muted)]`,children:n(`providers.subscription.credits.availableCount`,{count:l})})]})}var Ht={active:`providers.subscription.status.active`,expired:`providers.subscription.status.expired`,revoked:`providers.subscription.status.revoked`};function Ut({provider:e,account:t,index:n,actions:r,onClose:i}){let{t:a,locale:s}=C(),{toast:c}=o(),l=me(e.id),[u,d]=(0,Q.useState)(``),[f,p]=(0,Q.useState)(``);if((0,Q.useEffect)(()=>{d(t?.displayName??``),p(t?.httpProxy??``)},[t?.id,t?.displayName,t?.httpProxy]),!t)return(0,$.jsx)(H,{open:!1,onOpenChange:i,title:``});let m=jt(t),h=t.kind===`api_key`,g=e.templateId===`openai-subscription`,_=e.httpProxy||a(`providers.accounts.proxyFallbackSystem`),y=e=>e?I(e,s):`—`,b=(e,n)=>l.mutate({id:t.id,...e},{onSuccess:()=>c(a(n),`success`),onError:e=>c(x(e),`error`)});return(0,$.jsx)(H,{open:!0,onOpenChange:e=>!e&&i(),title:t.displayName||t.keyMasked||t.id,description:[t.plan,a(h?`providers.accounts.kind.api_key`:`providers.accounts.kind.oauth`)].filter(Boolean).join(` · `),width:520,children:(0,$.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,$.jsxs)(`div`,{className:`flex flex-wrap gap-1.5`,children:[(0,$.jsx)(v,{size:`sm`,icon:(0,$.jsx)(ut,{className:`size-3.5`}),disabled:t.isCurrent||m===`dead`,onClick:()=>r.activate(t),children:a(`providers.subscription.activate`)}),(0,$.jsx)(v,{size:`sm`,icon:(0,$.jsx)(st,{className:`size-3.5`}),disabled:m===`dead`,onClick:()=>r.refreshQuota(t),children:a(`providers.subscription.quotaRefresh`)}),!h&&(0,$.jsx)(v,{size:`sm`,icon:(0,$.jsx)(Ye,{className:`size-3.5`}),disabled:t.status===`revoked`,onClick:()=>r.refreshToken(t),children:a(`providers.subscription.refreshToken`)}),!h&&t.status!==`active`&&(0,$.jsx)(v,{size:`sm`,variant:`primary`,onClick:()=>r.relogin(t),children:a(`providers.subscription.relogin`)}),(0,$.jsx)(v,{size:`sm`,variant:`plain`,className:`ml-auto text-[var(--danger)]`,icon:(0,$.jsx)(J,{className:`size-3.5`}),onClick:()=>r.remove(t),children:a(`providers.subscription.logout`)})]}),m===`dead`&&t.lastError&&(0,$.jsx)(T,{tone:`danger`,title:t.lastError}),(0,$.jsxs)(`section`,{className:`flex flex-col gap-2`,children:[(0,$.jsx)(`h4`,{className:`text-[11px] font-medium text-[var(--text-secondary)]`,children:a(`providers.accounts.detail.identity`)}),(0,$.jsxs)(`div`,{className:`flex items-end gap-2`,children:[(0,$.jsx)(D,{className:`flex-1`,label:a(`providers.accounts.detail.name`),value:u,onChange:e=>d(e.target.value)}),(0,$.jsx)(v,{disabled:u.trim().length===0||u.trim()===t.displayName,loading:l.isPending&&l.variables?.displayName!==void 0,onClick:()=>b({displayName:u.trim()},`providers.accounts.renamed`),children:a(`common.save`)})]}),(0,$.jsxs)(`div`,{className:`flex items-end gap-2`,children:[(0,$.jsx)(D,{className:`flex-1`,mono:!0,label:a(`providers.accounts.detail.proxy`),placeholder:_,value:f,onChange:e=>p(e.target.value)}),(0,$.jsx)(v,{disabled:f.trim()===(t.httpProxy??``),loading:l.isPending&&l.variables?.httpProxy!==void 0,onClick:()=>b({httpProxy:f.trim()},`providers.accounts.proxySaved`),children:a(`common.save`)})]}),(0,$.jsx)(`p`,{className:`text-[11px] text-[var(--text-muted)]`,children:a(`providers.accounts.detail.proxyHint`,{fallback:_})})]}),t.quota&&(0,$.jsxs)(`section`,{className:`-mx-4 flex flex-col gap-1`,children:[(0,$.jsx)(`h4`,{className:`px-4 text-[11px] font-medium text-[var(--text-secondary)]`,children:a(`providers.accounts.detail.quota`)}),(0,$.jsx)(Rt,{quota:t.quota})]}),g&&m!==`dead`&&(0,$.jsx)(`div`,{className:`-mx-4`,children:(0,$.jsx)(Vt,{account:t,providerId:e.id})}),(0,$.jsxs)(`section`,{className:`flex flex-col gap-1`,children:[(0,$.jsx)(`h4`,{className:`text-[11px] font-medium text-[var(--text-secondary)]`,children:a(`providers.accounts.detail.credentials`)}),(0,$.jsxs)(`div`,{className:`card divide-y divide-[var(--border)] px-3`,children:[(0,$.jsx)(L,{label:a(`providers.accounts.detail.status`),children:(0,$.jsx)(E,{tone:m===`usable`?`green`:m===`cooling`?`orange`:m===`dead`?`red`:`neutral`,children:a(m===`disabled`?`providers.subscription.disabled`:Ht[t.status])})}),t.source&&(0,$.jsx)(L,{label:a(`providers.accounts.detail.source`),children:a(`providers.accounts.source.${t.source}`)}),h?(0,$.jsx)(L,{label:a(`providers.accounts.detail.key`),mono:!0,children:t.keyMasked??`••••`}):(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(L,{label:a(`providers.accounts.detail.expires`),children:y(t.expiresAtUtc)}),(0,$.jsx)(L,{label:a(`providers.accounts.detail.lastRefresh`),children:y(t.lastRefreshAtUtc)})]}),m===`cooling`&&(0,$.jsx)(L,{label:a(`providers.accounts.filter.cooling`),children:y(t.cooldownUntilUtc)}),(0,$.jsx)(L,{label:a(`providers.accounts.detail.order`),children:a(`providers.accounts.order`,{n:n+1})}),(0,$.jsx)(L,{label:a(`providers.accounts.detail.created`),children:y(t.createdAt)}),t.lastError&&m!==`dead`&&(0,$.jsx)(L,{label:a(`providers.accounts.detail.lastError`),children:t.lastError})]})]})]})})}function Wt({provider:e}){let{t}=C(),{toast:n}=o(),r=e.authScheme===`oauth-subscription`,i=ee(e.id,r),a=Se(e.id);if(!r||!i.data)return null;let s=i.data,c=e=>a.mutate(e,{onError:e=>n(x(e),`error`)}),l=s.claudeSubscription||s.clientPolicy===`claude-code-only`;return!l&&!s.claudeSubscription?null:(0,$.jsxs)(P,{title:t(`providers.subscription.policy.title`),footer:t(`providers.subscription.policy.footer`),children:[l&&(0,$.jsx)(A,{label:t(`providers.subscription.policy.claudeCodeOnly`),detail:t(`providers.subscription.policy.claudeCodeOnlyDetail`),children:(0,$.jsx)(R,{label:t(`providers.subscription.policy.claudeCodeOnly`),checked:s.clientPolicy===`claude-code-only`,disabled:a.isPending,onChange:e=>c({clientPolicy:e?`claude-code-only`:`any`})})}),s.claudeSubscription&&(0,$.jsx)(A,{label:t(`providers.subscription.policy.mimic`),detail:t(`providers.subscription.policy.mimicDetail`),children:(0,$.jsx)(R,{label:t(`providers.subscription.policy.mimic`),checked:s.mimicClaudeCode,disabled:a.isPending,onChange:e=>c({mimicClaudeCode:e})})}),l&&s.clientPolicy===`any`&&(0,$.jsx)(`div`,{className:`px-4 py-3`,children:s.mimicClaudeCode?(0,$.jsx)(T,{tone:`warning`,title:t(`providers.subscription.policy.mimicWarning`)}):(0,$.jsx)(T,{tone:`warning`,title:t(`providers.subscription.policy.anyWarning`)})})]})}var Gt=[{value:`all`,label:`providers.accounts.filter.all`},{value:`usable`,label:`providers.accounts.filter.usable`},{value:`cooling`,label:`providers.accounts.filter.cooling`},{value:`dead`,label:`providers.accounts.filter.dead`},{value:`disabled`,label:`providers.accounts.filter.disabled`}],Kt=3e5;function qt({provider:e}){let{t}=C(),{toast:n,confirm:r}=o(),a=ke(),s=e.authScheme===`oauth-subscription`,c=fe(e.id,s),u=ee(e.id,s),f=Se(e.id),p=ae(e.id,s),h=b(e.id),g=De(e.id),_=de(e.id),y=S(e.id),te=be(e.id),ne=Re(e.id),re=ie(e.id),E=me(e.id),oe=le(e.id),se=e.templateId===`openai-subscription`,O=d(s&&se),ce=i(e.id),ue=e.templateId===`github-copilot-subscription`,A=m(s&&ue),pe=Ce(e.id),[he,ge]=(0,Q.useState)(`all`),[_e,ve]=(0,Q.useState)(``),[j,ye]=(0,Q.useState)(new Set),[N,xe]=(0,Q.useState)(null),[P,we]=(0,Q.useState)(null),[Ee,F]=(0,Q.useState)(!1),[I,Oe]=(0,Q.useState)(``),[L,R]=(0,Q.useState)(!1),[z,B]=(0,Q.useState)(!1),[V,Ae]=(0,Q.useState)(null),[je,Me]=(0,Q.useState)(null),[Ne,Pe]=(0,Q.useState)(!1),[Fe,Ie]=(0,Q.useState)(``),ze=(0,Q.useRef)(new Set),Ve=(0,Q.useRef)(new Set),W=(0,Q.useMemo)(()=>c.data??[],[c.data]);if((0,Q.useEffect)(()=>{if(s)for(let e of W){if(e.status!==`active`||Ve.current.has(e.id))continue;let t=e.quota?.fetchedAtUtc?new Date(e.quota.fetchedAtUtc).getTime():0;Number.isFinite(t)&&Date.now()-t<Kt||(Ve.current.add(e.id),y.mutate(e.id,{onError:()=>{}}))}},[W,s]),(0,Q.useEffect)(()=>{let e=new Set(W.map(e=>e.id));ye(t=>Array.from(t).every(t=>e.has(t))?t:new Set(Array.from(t).filter(t=>e.has(t)))),N&&!e.has(N)&&xe(null)},[W,N]),(0,Q.useEffect)(()=>{if(!z||V?.mode!==`pkce`)return;let e=setInterval(()=>void c.refetch(),3e3);return()=>clearInterval(e)},[z,V,c]),(0,Q.useEffect)(()=>{if(!z||V?.mode!==`pkce`)return;let e=W.find(e=>!ze.current.has(e.id));e&&K(!0,e.displayName||e.accountEmail||e.id)},[W,z,V]),(0,Q.useEffect)(()=>{if(!z||V?.mode!==`device`&&V?.mode!==`cli`)return;let e=!1,t=0,n=async()=>{try{let n=await g.mutateAsync(V.state);if(e)return;t=0,n.status===`done`?K(!0,n.account.displayName||n.account.accountEmail||n.account.id):n.status!==`pending`&&n.status!==`slow_down`&&K(!1,void 0,`error`in n?n.error??n.status:n.status)}catch(n){if(e)return;if(n instanceof k&&(n.status===404||n.status===400)){K(!1,void 0,x(n));return}++t>=5&&K(!1,void 0,x(n))}},r=setInterval(()=>void n(),Math.max(V.interval||5,3)*1e3);return()=>{e=!0,clearInterval(r)}},[z,V]),!s)return null;let G=e=>e.displayName||e.accountEmail||e.keyMasked||e.id,K=(r,i,o)=>{if(a.invalidateQueries({queryKey:l.providerAccounts(e.id)}),r){Ae(null),Me(null),B(!1),n(t(`providers.subscription.loginOk`,{name:i??``}),`success`);return}o&&Me(o)},q=(e,r)=>{ze.current=new Set(W.map(e=>e.id)),Me(null),h.mutate({accountId:e,httpProxy:r},{onSuccess:e=>{F(!1),Ae(e),B(!0),e.mode!==`device`&&window.open(e.authorizeUrl,`_blank`,`noopener`)},onError:e=>{e instanceof k&&e.details?.needsVerification?n(t(`providers.subscription.needsVerification`),`error`):n(x(e),`error`)}})},He=async()=>{if(V){Pe(!0);try{let e=await g.mutateAsync(V.state);e.status===`done`?K(!0,e.account.displayName||e.account.accountEmail||e.account.id):e.status===`pending`||e.status===`slow_down`?n(t(`providers.subscription.stillWaiting`),`info`):K(!1,void 0,`error`in e?e.error??e.status:e.status)}catch(e){if(e instanceof k&&e.status===404){let t=((await c.refetch()).data??[]).find(e=>!ze.current.has(e.id));t?K(!0,t.displayName||t.accountEmail||t.id):K(!1,void 0,x(e))}else K(!1,void 0,x(e))}finally{Pe(!1)}}},Ue=async()=>{if(V&&V.mode===`paste`&&Fe.trim().length!==0){Pe(!0);try{let e=await _.mutateAsync({state:V.state,code:Fe.trim()});e.status===`done`?(Ie(``),K(!0,e.account.displayName||e.account.accountEmail||e.account.id)):K(!1,void 0,`error`in e?e.error??e.status:e.status)}catch(e){K(!1,void 0,x(e))}finally{Pe(!1)}}},Ge=()=>ce.mutate(void 0,{onSuccess:e=>{n(t(`providers.subscription.importOk`,{name:G(e.account)}),e.warning?`info`:`success`),e.warning&&n(e.warning,`error`),O.refetch()},onError:e=>n(x(e),`error`)}),Ke=()=>pe.mutate(``,{onSuccess:e=>{n(t(`providers.subscription.importOk`,{name:G(e.account)}),e.warning?`info`:`success`),e.warning&&n(e.warning,`error`)},onError:e=>n(x(e),`error`)}),qe=(e,t)=>{let r=W.map(e=>e.id),i=e+t;i<0||i>=r.length||([r[e],r[i]]=[r[i],r[e]],oe.mutate(r,{onError:e=>n(x(e),`error`)}))},Ye=async e=>{let i=G(e);await r({title:t(`providers.subscription.logoutConfirm`,{name:i}),destructive:!0,confirmLabel:t(`providers.subscription.logout`)})&&ne.mutate(e.id,{onError:e=>n(x(e),`error`)})},Xe={open:e=>xe(e.id),activate:e=>re.mutate(e.id,{onSuccess:()=>n(t(`providers.subscription.activated`,{name:G(e)}),`success`),onError:e=>n(x(e),`error`)}),toggleEnabled:e=>E.mutate({id:e.id,enabled:!e.enabled},{onError:e=>n(x(e),`error`)}),refreshQuota:e=>y.mutate(e.id,{onError:e=>{e instanceof k&&e.status===501?n(t(`providers.subscription.quotaUnsupported`),`error`):n(x(e),`error`)}}),refreshToken:e=>te.mutate(e.id,{onSuccess:()=>n(t(`providers.subscription.tokenRefreshed`),`success`),onError:e=>n(x(e),`error`)}),relogin:e=>q(e.id),remove:e=>void Ye(e)},Ze=e=>ye(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n}),Y=async r=>{let i=W.filter(e=>j.has(e.id));R(!0);let o=0;for(let e of i)try{await r(e),o++}catch(t){n(`${G(e)}: ${x(t)}`,`error`)}R(!1),ye(new Set),a.invalidateQueries({queryKey:l.providerAccounts(e.id)}),o>0&&n(t(`providers.accounts.bulkDone`,{n:o}),`success`)},Qe=async()=>{await r({title:t(`providers.accounts.bulkDeleteConfirm`,{n:j.size}),detail:t(`providers.accounts.bulkDeleteDetail`),destructive:!0,confirmLabel:t(`common.delete`)})&&await Y(e=>ne.mutateAsync(e.id))},$e=W.map(e=>jt(e)),X=e=>e===`all`?W.length:$e.filter(t=>t===e).length,et=_e.trim().toLowerCase(),tt=W.map((e,t)=>({a:e,index:t,state:$e[t]})).filter(({a:e,state:t})=>(he===`all`||t===he)&&(et.length===0||[e.displayName,e.accountEmail,e.keyMasked,e.plan].some(e=>e?.toLowerCase().includes(et)))),Z=W.find(e=>e.id===N)??null,nt=p.data,rt=j.size>0,it=[{id:`login`,label:t(`providers.accounts.addLogin`),icon:(0,$.jsx)(vt,{className:`size-3.5`}),onSelect:()=>q()},{id:`login-proxy`,label:t(`providers.accounts.addLoginProxy`),onSelect:()=>F(!0)},...se&&O.data?.available?[{id:`codex`,separatorBefore:!0,label:t(`providers.subscription.importCodex`),icon:(0,$.jsx)(We,{className:`size-3.5`}),onSelect:Ge}]:[],...ue?[{id:`copilot`,separatorBefore:!0,label:t(`providers.subscription.importCopilot`),icon:(0,$.jsx)(We,{className:`size-3.5`}),onSelect:Ke}]:[],...nt?.supported?[{id:`token`,separatorBefore:!(se&&O.data?.available)&&!ue,label:t(`providers.accounts.addToken`),onSelect:()=>we(`token`)}]:[],...nt?.apiKey?[{id:`apikey`,label:t(`providers.accounts.addApiKey`),icon:(0,$.jsx)(Be,{className:`size-3.5`}),onSelect:()=>we(`apiKey`)}]:[]];return(0,$.jsxs)($.Fragment,{children:[(0,$.jsxs)(`div`,{className:`card mb-3 flex flex-wrap items-center gap-x-4 gap-y-2 px-3 py-2`,children:[(0,$.jsxs)(`div`,{className:`mr-auto flex flex-wrap items-center gap-x-3 gap-y-1 text-[12px] text-[var(--text-secondary)]`,children:[(0,$.jsx)(`span`,{className:`font-medium text-[var(--text)]`,children:t(`providers.accounts.statTotal`,{n:W.length})}),(0,$.jsx)(`span`,{style:{color:`var(--success)`},children:t(`providers.accounts.statUsable`,{n:X(`usable`)})}),X(`cooling`)>0&&(0,$.jsx)(`span`,{style:{color:`var(--warning)`},children:t(`providers.accounts.statCooling`,{n:X(`cooling`)})}),X(`dead`)>0&&(0,$.jsx)(`span`,{style:{color:`var(--danger)`},children:t(`providers.accounts.statDead`,{n:X(`dead`)})}),(0,$.jsx)(`span`,{className:`text-[11px] text-[var(--text-muted)]`,children:t(`providers.accounts.providerProxy`,{proxy:e.httpProxy||t(`providers.accounts.proxyFallbackSystem`)})})]}),u.data&&(0,$.jsx)(Jt,{policy:u.data,onChange:e=>f.mutate({switchMode:e},{onError:e=>n(x(e),`error`)})})]}),u.data&&(0,$.jsx)(`p`,{className:`-mt-1 mb-3 px-1 text-[11px] text-[var(--text-muted)]`,children:t(u.data.switchMode===`balanced`?`providers.subscription.policy.balancedDetail`:u.data.switchMode===`failover`?`providers.subscription.policy.failoverDetail`:`providers.subscription.policy.manualDetail`)}),(0,$.jsxs)(`div`,{className:`mb-2 flex flex-wrap items-center gap-2`,children:[(0,$.jsx)(Te,{className:`w-52`,value:_e,onChange:ve,placeholder:t(`providers.accounts.search`)}),(0,$.jsx)(`div`,{role:`group`,"aria-label":t(`providers.accounts.filterLabel`),className:`mr-auto flex flex-wrap gap-1`,children:Gt.filter(e=>e.value===`all`||X(e.value)>0).map(e=>(0,$.jsxs)(`button`,{type:`button`,"aria-pressed":he===e.value,onClick:()=>ge(e.value),className:w(`rounded-full px-2.5 py-0.5 text-[11.5px] text-[var(--text-secondary)] transition-colors hover:bg-[var(--fill)]`,he===e.value&&`bg-[var(--fill)] text-[var(--text)]`),children:[t(e.label),(0,$.jsx)(`span`,{className:`ml-1 text-[var(--text-muted)]`,children:X(e.value)})]},e.value))}),nt?.supported&&(0,$.jsx)(v,{size:`sm`,icon:(0,$.jsx)(gt,{className:`size-3.5`}),onClick:()=>we(`batch`),children:t(`providers.accounts.batchImport`)}),(0,$.jsx)(Le,{label:t(`providers.accounts.add`),icon:(0,$.jsx)(U,{className:`size-3.5`}),items:it})]}),se&&O.data?.available&&(0,$.jsxs)(`p`,{className:`mb-2 px-1 text-[11px] text-[var(--text-muted)]`,children:[t(`providers.subscription.localCodexFound`,{who:O.data.accountEmail??O.data.plan??t(`providers.subscription.unknownAccount`)}),O.data.detail?` · ${O.data.detail}`:``]}),ue&&(0,$.jsxs)(`p`,{className:`mb-2 px-1 text-[11px] text-[var(--text-muted)]`,children:[A.data?.available?t(`providers.subscription.localCopilotFound`,{source:A.data.source??``}):t(`providers.subscription.localCopilotHint`),A.data?.detail?` · ${A.data.detail}`:``]}),c.isLoading?(0,$.jsx)(M,{className:`my-4`}):W.length===0?(0,$.jsxs)(`button`,{type:`button`,onClick:()=>q(),className:`flex w-full flex-col items-center gap-1 rounded-[var(--radius-card,12px)] border border-dashed border-[var(--border)] px-4 py-6 text-[12px] text-[var(--text-secondary)] hover:border-[var(--accent)] hover:text-[var(--text)]`,children:[(0,$.jsx)(`span`,{children:t(`providers.subscription.none`)}),(0,$.jsxs)(`span`,{className:`flex items-center gap-1 text-[var(--accent)]`,children:[(0,$.jsx)(U,{className:`size-3.5`}),` `,t(`providers.subscription.login`)]})]}):tt.length===0?(0,$.jsx)(`div`,{className:`px-4 py-5 text-center text-[12px] text-[var(--text-secondary)]`,children:t(`providers.accounts.noMatch`)}):(0,$.jsx)(`div`,{className:`grid grid-cols-[repeat(auto-fill,minmax(190px,1fr))] gap-3`,children:tt.map(({a:e,index:t})=>(0,$.jsx)(Ft,{account:e,index:t,actions:Xe,selected:j.has(e.id),selecting:rt,onToggleSelect:Ze,quotaPending:y.isPending&&y.variables===e.id,onMove:W.length>1?{up:t>0?()=>qe(t,-1):void 0,down:t<W.length-1?()=>qe(t,1):void 0}:void 0},e.id))}),(0,$.jsx)(`p`,{className:`mt-2 px-1 text-[11px] text-[var(--text-muted)]`,children:t(`providers.subscription.footer`)}),rt&&(0,$.jsxs)(`div`,{className:`card sticky bottom-3 z-10 mt-3 flex flex-wrap items-center gap-1.5 px-3 py-1.5 shadow-lg`,children:[(0,$.jsx)(`span`,{className:`mr-auto text-[12px] text-[var(--text-secondary)]`,children:t(`providers.accounts.selected`,{n:j.size})}),(0,$.jsx)(v,{size:`sm`,icon:(0,$.jsx)(Je,{className:`size-3.5`}),disabled:L,onClick:()=>void Y(e=>E.mutateAsync({id:e.id,enabled:!0})),children:t(`providers.subscription.enable`)}),(0,$.jsx)(v,{size:`sm`,disabled:L,onClick:()=>void Y(e=>E.mutateAsync({id:e.id,enabled:!1})),children:t(`providers.subscription.disable`)}),(0,$.jsx)(v,{size:`sm`,disabled:L,onClick:()=>void Y(e=>y.mutateAsync(e.id)),children:t(`providers.subscription.quotaRefresh`)}),(0,$.jsx)(v,{size:`sm`,className:`text-[var(--danger)]`,icon:(0,$.jsx)(J,{className:`size-3.5`}),disabled:L,onClick:()=>void Qe(),children:t(`common.delete`)}),(0,$.jsx)(v,{size:`sm`,variant:`plain`,onClick:()=>ye(new Set),children:t(`providers.accounts.clearSelection`)})]}),(0,$.jsx)(`div`,{className:`mt-5`,children:(0,$.jsx)(Wt,{provider:e})}),(0,$.jsx)(Ut,{provider:e,account:Z,index:Z?W.indexOf(Z):0,actions:Xe,onClose:()=>xe(null)}),nt&&(0,$.jsx)(At,{providerId:e.id,info:nt,mode:P,providerProxy:e.httpProxy,onClose:()=>we(null)}),(0,$.jsx)(H,{open:Ee,onOpenChange:F,title:t(`providers.accounts.loginProxyTitle`),description:t(`providers.accounts.loginProxyDesc`),footer:(0,$.jsx)(v,{variant:`primary`,loading:h.isPending,disabled:I.trim().length===0,onClick:()=>q(void 0,I),children:t(`providers.accounts.loginProxyStart`)}),children:(0,$.jsx)(D,{mono:!0,label:t(`providers.accounts.detail.proxy`),placeholder:`socks5://127.0.0.1:1080`,value:I,onChange:e=>Oe(e.target.value)})}),(0,$.jsxs)(H,{open:z,onOpenChange:e=>{B(e),e||(Ae(null),Me(null))},title:t(`providers.subscription.login`),description:t(`providers.subscription.loginDesc`),children:[je&&(0,$.jsx)(T,{tone:`danger`,title:t(`providers.subscription.loginFailed`),children:je}),V?.mode===`paste`&&(0,$.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,$.jsx)(T,{tone:`info`,title:t(`providers.subscription.pasteTitle`),children:t(`providers.subscription.pasteDetail`)}),(0,$.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:(0,$.jsx)(v,{onClick:()=>window.open(V.authorizeUrl,`_blank`,`noopener`),children:t(`providers.subscription.openAuthorize`)})}),(0,$.jsx)(D,{mono:!0,value:Fe,onChange:e=>Ie(e.target.value),placeholder:t(`providers.subscription.pastePlaceholder`),"aria-label":t(`providers.subscription.pasteCode`)}),(0,$.jsx)(v,{variant:`primary`,loading:Ne,onClick:()=>void Ue(),children:t(`providers.subscription.pasteSubmit`)})]}),V?.mode===`pkce`&&(0,$.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,$.jsx)(T,{tone:`info`,title:t(`providers.subscription.waiting`),children:t(`providers.subscription.waitingDetail`)}),(0,$.jsxs)(`div`,{className:`flex gap-2`,children:[(0,$.jsx)(v,{onClick:()=>window.open(V.authorizeUrl,`_blank`,`noopener`),children:t(`providers.subscription.openAuthorize`)}),(0,$.jsx)(v,{variant:`primary`,onClick:()=>{a.invalidateQueries({queryKey:l.providerAccounts(e.id)}),c.refetch()},children:t(`providers.subscription.doneAuthorize`)})]})]}),V?.mode===`cli`&&(0,$.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,$.jsx)(T,{tone:`info`,title:t(`providers.subscription.waiting`),children:t(`providers.subscription.cliDetail`)}),(0,$.jsx)(v,{onClick:()=>window.open(V.authorizeUrl,`_blank`,`noopener`),children:t(`providers.subscription.openAuthorize`)})]}),V?.mode===`device`&&(0,$.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,$.jsxs)(`div`,{children:[(0,$.jsx)(`div`,{className:`text-[11px] text-[var(--text-secondary)]`,children:t(`providers.subscription.deviceCode`)}),(0,$.jsx)(`div`,{className:`selectable font-mono text-[18px] font-medium tracking-wide`,children:V.userCode})]}),(0,$.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[V.verificationUrl&&(0,$.jsx)(v,{onClick:()=>window.open(V.verificationUrl??void 0,`_blank`,`noopener`),children:t(`providers.subscription.visitPage`)}),(0,$.jsx)(v,{variant:`primary`,loading:Ne,onClick:()=>void He(),children:t(`providers.subscription.checkNow`)})]}),(0,$.jsx)(T,{tone:`info`,title:t(`providers.subscription.waiting`),children:t(`providers.subscription.checkNowHint`)})]})]})]})}function Jt({policy:e,onChange:t}){let{t:n}=C();return(0,$.jsx)(pe,{ariaLabel:n(`providers.subscription.policy.switchMode`),value:e.switchMode,onChange:t,items:[{value:`manual`,label:n(`providers.subscription.policy.manual`)},{value:`failover`,label:n(`providers.subscription.policy.failover`)},{value:`balanced`,label:n(`providers.subscription.policy.balanced`)}]})}function Yt({provider:e}){let{t}=C(),n=fe(e.id),r=re(e.id),i=ee(e.id,!0),a=Se(e.id),{toast:s}=o(),[c,l]=(0,Q.useState)(null);return(0,$.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,$.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[r.isLoading&&(0,$.jsx)(M,{lines:1}),r.isError&&(0,$.jsx)(T,{tone:`danger`,title:t(`pluginAccounts.noPlugin`),children:x(r.error)}),r.data?.map(e=>(0,$.jsx)(v,{variant:e.index===0?`primary`:void 0,icon:e.type===`api`?(0,$.jsx)(Be,{className:`size-3.5`}):(0,$.jsx)(vt,{className:`size-3.5`}),onClick:()=>l(e),children:e.label||t(e.type===`api`?`pluginAccounts.apiKey`:`pluginAccounts.browser`)},e.index))]}),n.isLoading&&(0,$.jsx)(M,{lines:3}),n.data?.length===0&&(0,$.jsx)(`div`,{className:`card`,children:(0,$.jsx)(Oe,{icon:(0,$.jsx)(bt,{className:`size-6`}),title:t(`pluginAccounts.empty`),detail:t(`pluginAccounts.emptyDetail`)})}),n.data&&n.data.length>1&&i.data&&(0,$.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3 px-1`,children:[(0,$.jsx)(`p`,{className:`min-w-0 flex-1 text-[12px] text-[var(--text-secondary)]`,children:t(i.data.switchMode===`balanced`?`providers.subscription.policy.balancedDetail`:i.data.switchMode===`failover`?`providers.subscription.policy.failoverDetail`:`providers.subscription.policy.manualDetail`)}),(0,$.jsx)(Jt,{policy:i.data,onChange:e=>a.mutate({switchMode:e},{onError:e=>s(x(e),`error`)})})]}),n.data&&n.data.length>0&&(0,$.jsx)(`div`,{className:`card divide-y divide-[var(--border-subtle)] overflow-hidden p-0`,children:n.data.map(t=>(0,$.jsx)(Zt,{provider:e,account:t},t.id))}),(0,$.jsx)(Xt,{provider:e}),c&&(0,$.jsx)(Qt,{provider:e,method:c,onClose:()=>l(null)})]})}function Xt({provider:e}){let{t,locale:n}=C(),{toast:r}=o(),i=c(e.id),a=f(e.id);if(!i.data?.supported)return null;let s=e=>a.mutate(e,{onError:e=>r(x(e),`error`)});return(0,$.jsxs)(`section`,{className:`card flex flex-col gap-2`,children:[(0,$.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3`,children:[(0,$.jsx)(`span`,{className:`flex-1 text-[13px] font-medium`,children:t(`pluginAccounts.checkin`)}),(0,$.jsx)(R,{checked:i.data.on,label:t(`pluginAccounts.checkinOn`),onChange:e=>s(e)}),(0,$.jsx)(v,{size:`sm`,disabled:a.isPending,onClick:()=>s(),children:t(`pluginAccounts.checkinNow`)})]}),(0,$.jsx)(`p`,{className:`text-[12px] text-[var(--text-secondary)]`,children:t(`pluginAccounts.checkinDetail`)}),i.data.accounts.map(e=>(0,$.jsx)(L,{label:e.account,children:e.outcome?[t(`pluginAccounts.outcome.${e.outcome}`),e.credit?t(`pluginAccounts.credit`,{credit:e.credit}):null,e.streak?t(`pluginAccounts.streak`,{days:e.streak}):null,e.message,e.at?I(e.at,n):null].filter(Boolean).join(` · `):t(`pluginAccounts.checkinNever`)},e.accountId))]})}function Zt({provider:e,account:n}){let{t:r,locale:i}=C(),{toast:a,confirm:s}=o(),c=t(e.id),[l,u]=(0,Q.useState)(!1),d=e.settings?.plugin?.usage===!0,f=ge(e.id,n.id,l),p=async()=>{await s({title:r(`pluginAccounts.signOutConfirm`,{name:n.displayName}),confirmLabel:r(`pluginAccounts.signOut`),destructive:!0})&&c.mutate(n.id,{onError:e=>a(x(e),`error`)})};return(0,$.jsxs)(`article`,{className:`flex flex-col gap-2 px-4 py-3`,children:[(0,$.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,$.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-[13px] font-medium`,children:n.displayName}),n.isCurrent&&(0,$.jsx)(E,{tone:`accent`,children:r(`pluginAccounts.current`)}),(0,$.jsx)(E,{tone:n.status===`active`?`green`:`red`,children:r(n.status===`active`?`pluginAccounts.active`:`pluginAccounts.lapsed`)}),d&&(0,$.jsx)(v,{size:`sm`,onClick:()=>u(e=>!e),children:r(`pluginAccounts.usage`)}),(0,$.jsx)(v,{size:`sm`,variant:`destructive`,icon:(0,$.jsx)(qe,{className:`size-3.5`}),onClick:()=>void p(),children:r(`pluginAccounts.signOut`)})]}),n.status!==`active`&&(0,$.jsx)(`p`,{className:`text-[12px] text-[var(--danger)]`,children:r(`pluginAccounts.lapsedDetail`)}),l&&(0,$.jsxs)(`div`,{className:`flex flex-col gap-1 rounded-md bg-[var(--surface-muted)] px-3 py-2`,children:[f.isLoading&&(0,$.jsx)(M,{lines:2}),f.isError&&(0,$.jsx)(`span`,{className:`text-[12px] text-[var(--danger)]`,children:x(f.error)}),f.data?.error&&(0,$.jsx)(`span`,{className:`text-[12px] text-[var(--danger)]`,children:f.data.error}),f.data?.plan&&(0,$.jsx)(L,{label:r(`pluginAccounts.plan`),children:f.data.plan}),f.data?.until&&(0,$.jsx)(L,{label:r(`pluginAccounts.until`),children:I(f.data.until,i)}),f.data?.windows?.map(e=>(0,$.jsxs)(L,{label:e.name,children:[e.display??(e.limit?`${e.amount??e.used??0} / ${e.limit} ${e.unit??``}`:`${e.used??0}%`),e.resetsAt?` · ${r(`pluginAccounts.resets`,{at:I(new Date(e.resetsAt>0xe8d4a51000?e.resetsAt:e.resetsAt*1e3).toISOString(),i)})}`:``]},e.name))]})]})}function Qt({provider:e,method:t,onClose:n}){let{t:r}=C(),{toast:i}=o(),[s,c]=(0,Q.useState)({}),[l,u]=(0,Q.useState)(void 0),[d,f]=(0,Q.useState)(``),[m,g]=(0,Q.useState)(null),[_,b]=(0,Q.useState)(``),[S,ee]=(0,Q.useState)(``),[w,ne]=(0,Q.useState)(null),re=h(e.id),ie=te(e.id),ae=a(e.id),E=y(e.id,w).data;(0,Q.useEffect)(()=>{let n=!0;return p(e.id,t.index,s).then(e=>{n&&(u(e.prompt),f(e.prompt?.type===`select`?e.prompt.options?.[0]?.value??``:``))}).catch(e=>n&&i(x(e),`error`)),()=>{n=!1}},[e.id,t.index,s,i]),(0,Q.useEffect)(()=>{E?.state===`done`&&(i(r(`pluginAccounts.signedIn`),`success`),n())},[E?.state,n,r,i]);let oe=async()=>{if(!l)return;let n=await z(e.id,t.index,l.key,d).catch(()=>({error:null}));if(n.error)return g(n.error);g(null),c(e=>({...e,[l.key]:d}))};return(0,$.jsxs)(H,{open:!0,onOpenChange:e=>!e&&n(),title:r(`pluginAccounts.signInTitle`,{name:e.name}),description:t.label,width:520,children:[l===void 0&&(0,$.jsx)(M,{lines:2}),l&&(0,$.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,$.jsx)(B,{label:l.message,error:m??void 0,children:l.type===`select`?(0,$.jsx)(O,{value:d,onChange:f,options:(l.options??[]).map(e=>({value:e.value,label:e.label,description:e.hint??void 0}))}):(0,$.jsx)(D,{value:d,placeholder:l.placeholder??void 0,onChange:e=>f(e.target.value),autoFocus:!0})}),(0,$.jsx)(`div`,{className:`flex justify-end`,children:(0,$.jsx)(v,{variant:`primary`,onClick:()=>void oe(),children:r(`pluginAccounts.continue`)})})]}),l===null&&t.type===`api`&&(0,$.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,$.jsx)(B,{label:r(`pluginAccounts.key`),children:(0,$.jsx)(D,{mono:!0,type:`password`,value:_,placeholder:t.placeholder??void 0,onChange:e=>b(e.target.value),autoFocus:!0})}),(0,$.jsx)(`div`,{className:`flex justify-end`,children:(0,$.jsx)(v,{variant:`primary`,disabled:!_.trim()||ie.isPending,onClick:()=>ie.mutate({method:t.index,inputs:s,key:_},{onSuccess:()=>(i(r(`pluginAccounts.signedIn`),`success`),n()),onError:e=>i(x(e),`error`)}),children:r(`pluginAccounts.signIn`)})})]}),l===null&&t.type!==`api`&&!E&&(0,$.jsx)(`div`,{className:`flex justify-end`,children:(0,$.jsx)(v,{variant:`primary`,icon:(0,$.jsx)(Ke,{className:`size-3.5`}),disabled:re.isPending,onClick:()=>re.mutate({method:t.index,inputs:s},{onSuccess:e=>{ne(e.id),e.url&&window.open(e.url,`_blank`,`noopener`)},onError:e=>i(x(e),`error`)}),children:r(`pluginAccounts.openPage`)})}),E&&E.state!==`done`&&(0,$.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[E.instructions&&(0,$.jsx)(`p`,{className:`whitespace-pre-wrap text-[12px] text-[var(--text-secondary)]`,children:E.instructions}),E.deviceCode&&(0,$.jsx)(L,{label:r(`pluginAccounts.deviceCode`),mono:!0,children:E.deviceCode}),E.url&&(0,$.jsx)(v,{icon:(0,$.jsx)(Ke,{className:`size-3.5`}),onClick:()=>window.open(E.url,`_blank`,`noopener`),children:r(`pluginAccounts.openAgain`)}),E.state===`waiting`&&E.pasteCode&&(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(B,{label:r(`pluginAccounts.code`),children:(0,$.jsx)(D,{mono:!0,value:S,onChange:e=>ee(e.target.value),autoFocus:!0})}),(0,$.jsx)(`div`,{className:`flex justify-end`,children:(0,$.jsx)(v,{variant:`primary`,disabled:!S.trim()||ae.isPending,onClick:()=>ae.mutate({flow:E.id,code:S.trim()},{onError:e=>i(x(e),`error`)}),children:r(`pluginAccounts.signIn`)})})]}),E.state===`waiting`&&!E.pasteCode&&(0,$.jsx)(`p`,{className:`text-[12px] text-[var(--text-muted)]`,children:r(`pluginAccounts.waiting`)}),E.state===`failed`&&(0,$.jsx)(T,{tone:`danger`,title:r(`pluginAccounts.failed`),children:E.error})]})]})}function $t(e){let t=e?.model_map,n={};if(!t||typeof t!=`object`||Array.isArray(t))return n;for(let[e,r]of Object.entries(t))e&&typeof r==`string`&&r&&(n[e]=r);return n}function en(){let{t:e}=C(),{id:t=``}=W(),n=ze(),r=Me(t),[i,a]=(0,Q.useState)(`models`),[o,s]=(0,Q.useState)(null),c=j(t),l=c.data?.find(e=>e.id===o)??null;if(r.isError)return(0,$.jsx)(Ve,{title:e(`nav.providers`),leading:(0,$.jsx)(tn,{onClick:()=>n(`/providers`)}),children:(0,$.jsx)(T,{tone:`danger`,title:e(`common.error`),children:x(r.error)})});let u=r.data;return(0,$.jsx)(Ve,{title:u?u.name:``,subtitle:u?[u.templateId,u.priceKey?e(`providers.priceKeyShort`,{key:u.priceKey}):null].filter(Boolean).join(` · `):void 0,leading:(0,$.jsx)(tn,{onClick:()=>n(`/providers`)}),actions:u&&(0,$.jsx)(nn,{p:u}),children:u?(0,$.jsxs)(Qe,{className:`mx-auto max-w-[860px]`,value:i,onValueChange:e=>a(e),children:[(0,$.jsxs)(tt,{"aria-label":u.name,children:[(0,$.jsx)(Z,{value:`models`,children:e(`providers.tab.models`)}),(0,$.jsx)(Z,{value:`accounts`,children:e(u.authScheme===`oauth-subscription`||u.authScheme===`plugin`?`providers.tab.accounts`:`providers.tab.apiKey`)}),(0,$.jsx)(Z,{value:`settings`,children:e(`providers.tab.settings`)})]}),(0,$.jsx)(Ze,{value:`models`,className:`pt-4`,children:(0,$.jsx)(an,{provider:u,models:c.data,loading:c.isLoading,selected:o,onSelect:s})}),(0,$.jsx)(Ze,{value:`accounts`,className:`pt-4`,children:u.authScheme===`plugin`?(0,$.jsx)(Yt,{provider:u}):u.authScheme===`oauth-subscription`?(0,$.jsx)(qt,{provider:u}):(0,$.jsx)(fn,{provider:u})}),(0,$.jsx)(Ze,{value:`settings`,className:`pt-4`,children:(0,$.jsx)(mn,{provider:u})}),(0,$.jsx)(dn,{provider:u,pm:i===`models`?l:null,onClose:()=>s(null)})]}):(0,$.jsx)(M,{lines:4,className:`mx-auto mt-6 max-w-[860px]`})})}function tn({onClick:e}){let{t}=C();return(0,$.jsx)(v,{variant:`glass`,icon:(0,$.jsx)(K,{className:`size-4`}),"aria-label":t(`common.back`),onClick:e})}function nn({p:e}){let{t}=C(),n=ze(),{toast:r,confirm:i}=o(),a=s(),c=Pe(),[l,u]=(0,Q.useState)(!1),[d,f]=(0,Q.useState)(!1),p=async()=>{await i({title:t(`providers.deleteConfirm`,{name:e.name}),detail:t(`providers.deleteDetail`),destructive:!0,confirmLabel:t(`common.delete`)})&&c.mutate(e.id,{onSuccess:()=>{r(t(`providers.deleted`)),n(`/providers`)},onError:e=>{let n=e instanceof k&&e.status===409?e.details?.boundClients??[]:[];r(n.length?t(`providers.deleteBound`,{clients:n.map(e=>et[e]?.name??e).join(`, `)}):x(e),`error`)}})};return(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(v,{icon:(0,$.jsx)(at,{className:`size-3.5`}),onClick:()=>f(!0),children:t(`providers.test`)}),(0,$.jsx)(Le,{label:t(`common.more`),icon:(0,$.jsx)(Ge,{className:`size-4`}),items:[{id:`dup`,label:t(`providers.duplicate`),icon:(0,$.jsx)(Ie,{className:`size-3.5`}),onSelect:()=>a.mutate(e.id,{onSuccess:e=>n(`/providers/${e.id}`),onError:e=>r(x(e),`error`)})},{id:`tpl`,label:t(`providers.templateUpdate`),icon:(0,$.jsx)(St,{className:`size-3.5`}),disabled:!e.templateId,onSelect:()=>u(!0)},{id:`del`,label:t(`common.delete`),icon:(0,$.jsx)(J,{className:`size-3.5`}),destructive:!0,separatorBefore:!0,onSelect:()=>void p()}]}),(0,$.jsx)(rn,{open:l,onOpenChange:u,provider:e}),(0,$.jsx)(ct,{provider:e,open:d,onOpenChange:f})]})}function rn({open:e,onOpenChange:t,provider:n}){let{t:r}=C(),{toast:i}=o(),a=ne(n.id,e),s=he(n.id),c=a.data&&a.data.latestVersion<=a.data.currentVersion;return(0,$.jsxs)(H,{open:e,onOpenChange:t,title:r(`providers.templateUpdate`),description:a.data?r(`providers.templateVersions`,{current:a.data.currentVersion,latest:a.data.latestVersion}):void 0,footer:(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(v,{onClick:()=>t(!1),children:r(`common.cancel`)}),(0,$.jsx)(v,{variant:`primary`,disabled:!a.data||c,loading:s.isPending,onClick:()=>s.mutate(void 0,{onSuccess:()=>{t(!1),i(r(`providers.templateApplied`),`success`)},onError:e=>i(x(e),`error`)}),children:r(`common.apply`)})]}),children:[a.isLoading&&(0,$.jsx)(M,{}),a.isError&&(0,$.jsx)(T,{tone:`danger`,title:r(`common.error`),children:x(a.error)}),c&&(0,$.jsx)(T,{tone:`success`,title:r(`providers.templateUpToDate`)}),a.data&&!c&&(0,$.jsx)(`ul`,{className:`list-disc pl-5 text-[12px]`,children:a.data.changes.map((e,t)=>(0,$.jsx)(`li`,{children:e},t))})]})}function an({provider:e,models:t,loading:n,selected:r,onSelect:i}){let{t:a}=C(),{toast:s}=o(),[c,l]=(0,Q.useState)(``),[u,d]=(0,Q.useState)(!1),[f,p]=(0,Q.useState)(!1),m=je(e.id),h=(t??[]).filter(e=>!c||e.modelId.toLowerCase().includes(c.toLowerCase())||e.effective.displayName.toLowerCase().includes(c.toLowerCase()));return(0,$.jsxs)($.Fragment,{children:[(0,$.jsxs)(`div`,{className:`mb-3 flex flex-wrap items-center gap-2`,children:[(0,$.jsx)(Te,{className:`w-56`,value:c,onChange:l,placeholder:a(`providers.searchModels`)}),(0,$.jsxs)(`div`,{className:`ml-auto flex items-center gap-2`,children:[(0,$.jsx)(v,{icon:(0,$.jsx)(U,{className:`size-3.5`}),onClick:()=>p(!0),children:a(`providers.addModels`)}),(0,$.jsx)(v,{variant:`primary`,icon:(0,$.jsx)(Ue,{className:`size-3.5`}),onClick:()=>d(!0),children:a(`providers.fetchRemote`)})]})]}),n&&(0,$.jsx)(M,{lines:4}),t?.length===0&&(0,$.jsx)(`div`,{className:`card`,children:(0,$.jsx)(Oe,{title:a(`providers.noModels`),detail:a(`providers.noModelsDetail`)})}),h.length>0&&(0,$.jsx)(P,{footer:a(`providers.modelsFooter`),children:h.map(e=>(0,$.jsxs)(A,{selected:e.id===r,onClick:()=>i(e.id),label:(0,$.jsxs)(`span`,{className:`flex items-center gap-2`,children:[(0,$.jsx)(`span`,{className:w(`font-mono text-[12.5px]`,!e.enabled&&`text-[var(--text-muted)]`),children:e.modelId}),!e.systemModelId&&(0,$.jsx)(E,{tone:`orange`,children:a(`providers.unlinked`)})]}),detail:[e.effective.displayName===e.modelId?null:e.effective.displayName,e.effective.contextWindow?Ae(e.effective.contextWindow):null,ye(e.effectivePricing)].filter(Boolean).join(` · `),children:[(0,$.jsx)(Y,{source:e.pricingSource,priceKey:e.priceKey}),(0,$.jsx)(R,{checked:e.enabled,label:a(`common.enabled`),onChange:t=>m.mutate({pmId:e.id,enabled:t},{onError:e=>s(x(e),`error`)})})]},e.id))}),t&&(0,$.jsx)(on,{provider:e,models:t}),(0,$.jsx)(cn,{open:f,onOpenChange:p,provider:e}),(0,$.jsx)(ln,{open:u,onOpenChange:d,provider:e})]})}function on({provider:e,models:t}){let{t:n}=C(),{toast:r}=o(),i=g(e.id),[a,s]=(0,Q.useState)(!1),c=$t(e.settings),l=Object.entries(c),u=new Set(t.map(e=>e.modelId)),d=(e,t)=>i.mutate(e,{onSuccess:()=>{t?.(),r(n(`providers.modelMap.saved`),`success`)},onError:e=>r(x(e),`error`)});return(0,$.jsxs)($.Fragment,{children:[(0,$.jsxs)(P,{title:n(`providers.modelMap.title`),footer:n(`providers.modelMap.footer`),children:[l.map(([e,t])=>(0,$.jsx)(A,{label:(0,$.jsxs)(`span`,{className:`flex items-center gap-2 font-mono text-[12.5px]`,children:[(0,$.jsx)(`span`,{className:`truncate`,children:e}),(0,$.jsx)(Xe,{className:`size-3.5 shrink-0 text-[var(--text-muted)]`,"aria-hidden":!0}),(0,$.jsx)(`span`,{className:w(`truncate`,!u.has(t)&&`text-[var(--text-muted)]`),children:t}),!u.has(t)&&(0,$.jsx)(E,{tone:`orange`,children:n(`providers.modelMap.missingTarget`)})]}),children:(0,$.jsx)(v,{size:`sm`,variant:`plain`,icon:(0,$.jsx)(ue,{className:`size-3.5`}),"aria-label":n(`providers.modelMap.remove`,{from:e}),title:n(`providers.modelMap.remove`,{from:e}),disabled:i.isPending,onClick:()=>d(Object.fromEntries(l.filter(([t])=>t!==e)))})},e)),(0,$.jsx)(A,{icon:(0,$.jsx)(U,{className:`size-4 text-[var(--text-secondary)]`}),label:n(`providers.modelMap.add`),detail:t.length===0?n(`providers.modelMap.needModels`):void 0,onClick:t.length===0?void 0:()=>s(!0)})]}),(0,$.jsx)(sn,{open:a,onOpenChange:s,models:t,saving:i.isPending,onSave:(e,t)=>d({...c,[e]:t},()=>s(!1))})]})}function sn({open:e,onOpenChange:t,models:n,saving:r,onSave:i}){let{t:a}=C(),[o,s]=(0,Q.useState)(``),[c,l]=(0,Q.useState)(``);(0,Q.useEffect)(()=>{e&&(s(``),l(``))},[e]);let u=o.trim();return(0,$.jsx)(H,{open:e,onOpenChange:t,title:a(`providers.modelMap.add`),description:a(`providers.modelMap.addDetail`),footer:(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(v,{onClick:()=>t(!1),children:a(`common.cancel`)}),(0,$.jsx)(v,{variant:`primary`,disabled:!u||!c||u===c,loading:r,onClick:()=>i(u,c),children:a(`common.save`)})]}),children:(0,$.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,$.jsx)(D,{autoFocus:!0,mono:!0,label:a(`providers.modelMap.from`),placeholder:`deepseek-v4.1`,spellCheck:!1,value:o,onChange:e=>s(e.target.value)}),(0,$.jsx)(O,{label:a(`providers.modelMap.to`),value:c,onChange:l,placeholder:a(`providers.modelMap.toPlaceholder`),options:n.map(e=>({value:e.modelId,label:e.modelId}))})]})})}function cn({open:e,onOpenChange:t,provider:n}){let{t:i}=C(),{toast:a}=o(),s=r(n.id),[c,l]=(0,Q.useState)(``);(0,Q.useEffect)(()=>{e&&l(``)},[e]);let u=[...new Set(c.split(/[\s,]+/).map(e=>e.trim()).filter(Boolean))];return(0,$.jsx)(H,{open:e,onOpenChange:t,title:i(`providers.addModels`),description:i(`providers.addModelsDetail`),footer:(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(v,{onClick:()=>t(!1),children:i(`common.cancel`)}),(0,$.jsx)(v,{variant:`primary`,disabled:u.length===0,loading:s.isPending,onClick:()=>s.mutate(u,{onSuccess:e=>{t(!1),a(i(`providers.modelsAdded`,{count:e.length}),`success`)},onError:e=>a(x(e),`error`)}),children:i(`providers.addSelected`,{count:u.length})})]}),children:(0,$.jsx)(F,{autoFocus:!0,label:i(`providers.modelIds`),rows:6,spellCheck:!1,className:`w-full font-mono text-[12px]`,placeholder:`deepseek-v4-pro
|
|
3
|
+
claude-sonnet-4-6`,value:c,onChange:e=>l(e.target.value)})})}function ln({open:e,onOpenChange:t,provider:n}){let{t:i}=C(),{toast:a}=o(),s=oe(n.id,e),c=r(n.id),[l,u]=(0,Q.useState)(new Set),[d,f]=(0,Q.useState)(``);(0,Q.useEffect)(()=>{e&&u(new Set)},[e]);let p=(s.data??[]).filter(e=>!d||e.id.toLowerCase().includes(d.toLowerCase())),m=e=>u(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n});return(0,$.jsxs)(H,{open:e,onOpenChange:t,width:560,title:i(`providers.fetchRemote`),description:i(`providers.fetchRemoteDetail`),footer:(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(v,{variant:`plain`,className:`mr-auto`,onClick:()=>u(new Set(p.filter(e=>!e.alreadyAdded).map(e=>e.id))),disabled:p.length===0,children:i(`common.selectAll`)}),(0,$.jsx)(v,{onClick:()=>t(!1),children:i(`common.cancel`)}),(0,$.jsx)(v,{variant:`primary`,disabled:l.size===0,loading:c.isPending,onClick:()=>c.mutate([...l],{onSuccess:e=>{t(!1),a(i(`providers.modelsAdded`,{count:e.length}),`success`)},onError:e=>a(x(e),`error`)}),children:i(`providers.addSelected`,{count:l.size})})]}),children:[(0,$.jsx)(Te,{className:`mb-3`,value:d,onChange:f,placeholder:i(`providers.searchModels`)}),s.isLoading&&(0,$.jsx)(M,{lines:4}),s.isError&&(0,$.jsx)(T,{tone:`danger`,title:i(`common.error`),children:x(s.error)}),(0,$.jsx)(`div`,{className:`card divide-y divide-[var(--border)]`,children:p.map(e=>(0,$.jsx)(A,{onClick:e.alreadyAdded?void 0:()=>m(e.id),label:(0,$.jsx)(`span`,{className:`font-mono text-[12px]`,children:e.id}),detail:e.linkedSystemModelId?i(`providers.linksTo`,{id:e.linkedSystemModelId}):i(`providers.noLink`),children:e.alreadyAdded?(0,$.jsx)(E,{children:i(`providers.added`)}):(0,$.jsx)(`span`,{onClick:e=>e.stopPropagation(),children:(0,$.jsx)(q,{"aria-label":e.id,checked:l.has(e.id),onCheckedChange:()=>m(e.id)})})},e.id))})]})}function un({origin:e}){let{t}=C();return e===`overridden`?(0,$.jsx)(E,{tone:`orange`,children:t(`origin.overridden`)}):e===`inherited`?(0,$.jsx)(E,{children:t(`origin.inherited`)}):(0,$.jsx)(E,{tone:`red`,children:t(`origin.unset`)})}function dn({provider:t,pm:n,onClose:r}){let{t:i}=C(),{toast:a}=o(),s=je(t.id),c=ce(t.id),l=u(),[d,f]=(0,Q.useState)({}),[p,m]=(0,Q.useState)(``),[h,g]=(0,Q.useState)(!1);if((0,Q.useEffect)(()=>{n&&(f(n.overrides),m(n.systemModelId??``),g(n.overrides.pricing!=null))},[n]),!n)return(0,$.jsx)(H,{open:!1,onOpenChange:()=>r(),title:i(`providers.tab.models`)});let _={...d,pricing:h?d.pricing??null:null},y=JSON.stringify(_)!==JSON.stringify({...n.overrides,pricing:n.overrides.pricing??null})||p!==(n.systemModelId??``),b=()=>s.mutate({pmId:n.id,overrides:_,systemModelId:p||null},{onSuccess:()=>{a(i(`common.saved`),`success`),r()},onError:e=>a(x(e),`error`)}),S=(e,t,r)=>(0,$.jsxs)(`div`,{children:[(0,$.jsxs)(`div`,{className:`mb-1 flex items-center justify-between gap-2`,children:[(0,$.jsx)(`span`,{className:`text-[13px] font-medium`,children:t}),(0,$.jsxs)(`span`,{className:`flex items-center gap-1`,children:[(0,$.jsx)(un,{origin:d[e]==null?n.origins[e]===`overridden`?`inherited`:n.origins[e]:`overridden`}),d[e]!=null&&(0,$.jsx)(v,{size:`sm`,variant:`plain`,icon:(0,$.jsx)(Ye,{className:`size-3`}),title:i(`origin.reset`),"aria-label":i(`origin.reset`),onClick:()=>f({...d,[e]:null})})]})]}),r]});return(0,$.jsx)(H,{open:!0,onOpenChange:e=>!e&&r(),width:720,title:n.modelId,description:t.name,footer:(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(`div`,{className:`mr-auto`,children:(0,$.jsx)(nt,{label:i(`providers.removeModelShort`),icon:(0,$.jsx)(J,{className:`size-4`}),prompt:i(`providers.removeModel`,{id:n.modelId}),confirmLabel:i(`common.delete`),cancelLabel:i(`common.cancel`),pendingLabel:i(`common.deleting`),doneLabel:i(`common.deleted`),errorLabel:i(`common.error`),retryLabel:i(`common.retry`),onConfirm:async()=>{await c.mutateAsync(n.id),r()}})}),(0,$.jsx)(v,{onClick:r,children:i(`common.cancel`)}),(0,$.jsx)(v,{variant:`primary`,disabled:!y,loading:s.isPending,onClick:b,children:i(`common.save`)})]}),children:(0,$.jsxs)(`div`,{className:`flex flex-col gap-6`,children:[(0,$.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,$.jsx)(Y,{source:n.pricingSource,priceKey:n.priceKey}),n.multiplier!==1&&n.pricingSource!==`provider_override`&&(0,$.jsxs)(E,{children:[`×`,n.multiplier]})]}),(0,$.jsxs)(_e,{title:i(`providers.linkedModel`),children:[(0,$.jsx)(O,{className:`w-full`,ariaLabel:i(`providers.linkedModel`),value:p,onChange:m,options:[{value:``,label:i(`providers.noLink`)},...(l.data??[]).map(e=>({value:e.id,label:e.id,detail:e.displayName}))]}),(0,$.jsx)(`p`,{className:`mt-2 text-[11px] text-[var(--text-muted)]`,children:i(`providers.linkedModelHint`)})]}),(0,$.jsx)(_e,{title:i(`providers.overrides`),children:(0,$.jsxs)(`div`,{className:`grid gap-3 sm:grid-cols-3`,children:[S(`displayName`,i(`models.field.displayName`),(0,$.jsx)(D,{className:`w-full`,"aria-label":i(`models.field.displayName`),placeholder:n.effective.displayName,value:d.displayName??``,onChange:e=>f({...d,displayName:e.target.value||null})})),S(`contextWindow`,i(`models.field.contextWindow`),(0,$.jsx)(V,{className:`w-full`,label:i(`models.field.contextWindow`),placeholder:String(n.effective.contextWindow??``),value:d.contextWindow,onChange:e=>f({...d,contextWindow:e})})),S(`maxOutputTokens`,i(`models.field.maxOutputTokens`),(0,$.jsx)(V,{className:`w-full`,label:i(`models.field.maxOutputTokens`),placeholder:String(n.effective.maxOutputTokens??``),value:d.maxOutputTokens,onChange:e=>f({...d,maxOutputTokens:e})}))]})}),(0,$.jsxs)(_e,{title:i(`providers.price`),action:(0,$.jsxs)(`label`,{className:`flex items-center gap-2 text-[12px] text-[var(--text-secondary)]`,children:[i(`providers.customPrice`),(0,$.jsx)(R,{checked:h,label:i(`providers.customPrice`),onChange:e=>{g(e),e&&d.pricing==null&&f({...d,pricing:n.effectivePricing??{currency:`USD`,unit:`per_1m_tokens`,base:{input:null,output:null}}})}})]}),children:[(0,$.jsx)(`p`,{className:`mb-3 text-[11px] text-[var(--text-muted)]`,children:i(h?`providers.customPriceHint`:`providers.inheritedPriceHint`)}),h?(0,$.jsx)(`div`,{className:`card p-4`,children:(0,$.jsx)($e,{value:d.pricing??null,onChange:e=>f({...d,pricing:e})})}):n.effectivePricing?(0,$.jsx)(e,{maxHeight:220,children:N(n.effectivePricing)}):(0,$.jsx)(T,{tone:`warning`,title:i(`pricingSource.none`)})]})]})})}function fn({provider:e}){let{t}=C(),{toast:r}=o(),i=n(e.id),[a,s]=(0,Q.useState)(``);return(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(P,{title:t(`providers.section.auth`),footer:t(`providers.apiKeyStored`),children:(0,$.jsx)(A,{label:t(`providers.apiKey`),detail:e.hasApiKey?e.apiKeyMasked??`••••`:t(`providers.noKey`),children:(0,$.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,$.jsx)(D,{type:`password`,autoComplete:`off`,className:`w-64 font-mono`,"aria-label":t(`providers.apiKey`),placeholder:t(`providers.replaceKey`),value:a,onChange:e=>s(e.target.value)}),(0,$.jsx)(v,{variant:`primary`,disabled:a.trim().length===0,loading:i.isPending,onClick:()=>i.mutate({apiKey:a},{onSuccess:()=>{s(``),r(t(`common.saved`),`success`)},onError:e=>r(x(e),`error`)}),children:t(`common.save`)})]})})}),(0,$.jsx)(ot,{provider:e})]})}function pn(e){return{name:e.name,apiKey:``,endpoints:e.endpoints,preferredUpstreamProtocols:e.preferredUpstreamProtocols,authScheme:e.authScheme,extraHeaders:e.extraHeaders,httpProxy:e.httpProxy??null,priceMultiplier:e.priceMultiplier,priceKey:e.priceKey??null,settings:e.settings,enabled:e.enabled,notes:e.notes??null}}function mn({provider:e}){let{t}=C(),{toast:r}=o(),i=n(e.id),a=se(),s=(0,Q.useMemo)(()=>pn(e),[e]),[c,l]=(0,Q.useState)(s),[u,d]=(0,Q.useState)(Object.entries(e.extraHeaders)),[f,p]=(0,Q.useState)(!1),[m,h]=(0,Q.useState)(!1);(0,Q.useEffect)(()=>{l(s),d(Object.entries(s.extraHeaders))},[s]);let g=e=>l(t=>({...t,...e})),_={...c,extraHeaders:Object.fromEntries(u.filter(([e])=>e.trim()))},y=JSON.stringify(_)!==JSON.stringify(s),b=()=>{let e={};for(let t of Object.keys(_))t!==`apiKey`&&JSON.stringify(_[t])!==JSON.stringify(s[t])&&(e[t]=_[t]);c.apiKey&&(e.apiKey=c.apiKey),i.mutate(e,{onSuccess:()=>r(t(`common.saved`),`success`),onError:e=>r(x(e),`error`)})},S=(e,t)=>g({endpoints:c.endpoints.map((n,r)=>r===e?{...n,...t}:n)});return(0,$.jsxs)($.Fragment,{children:[(0,$.jsxs)(P,{title:t(`providers.section.basic`),children:[(0,$.jsx)(A,{label:t(`providers.name`),children:(0,$.jsx)(D,{className:`w-64`,"aria-label":t(`providers.name`),value:c.name,onChange:e=>g({name:e.target.value})})}),(0,$.jsx)(A,{label:t(`common.enabled`),children:(0,$.jsx)(R,{checked:c.enabled,label:t(`common.enabled`),onChange:e=>g({enabled:e})})}),(0,$.jsx)(A,{label:t(`providers.notes`),children:(0,$.jsx)(D,{className:`w-64`,"aria-label":t(`providers.notes`),value:c.notes??``,onChange:e=>g({notes:e.target.value||null})})})]}),(0,$.jsx)(P,{title:t(`providers.section.auth`),children:(0,$.jsx)(A,{label:t(`providers.authScheme`),children:(0,$.jsx)(O,{className:`w-48`,value:c.authScheme,onChange:e=>g({authScheme:e}),options:rt})})}),(0,$.jsxs)(P,{title:t(`providers.section.endpoints`),footer:t(`providers.endpointsFooter`),children:[c.endpoints.map((e,n)=>(0,$.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2 px-4 py-3`,children:[(0,$.jsx)(O,{className:`w-48`,value:e.protocol,onChange:e=>S(n,{protocol:e}),options:it}),(0,$.jsx)(D,{className:`min-w-60 flex-1 font-mono`,"aria-label":t(`providers.baseUrl`),value:e.baseUrl,onChange:e=>S(n,{baseUrl:e.target.value})}),(0,$.jsxs)(`label`,{className:`flex items-center gap-2 text-[12px] text-[var(--text-secondary)]`,children:[(0,$.jsx)(R,{checked:!!e.fullUrl,label:t(`providers.fullUrl`),onChange:e=>S(n,{fullUrl:e})}),t(`providers.fullUrl`)]}),(0,$.jsx)(v,{size:`sm`,variant:`plain`,icon:(0,$.jsx)(J,{className:`size-3.5`}),"aria-label":t(`common.delete`),onClick:()=>g({endpoints:c.endpoints.filter((e,t)=>t!==n)})})]},n)),(0,$.jsx)(`div`,{className:`px-4 py-2`,children:(0,$.jsx)(v,{size:`sm`,variant:`plain`,icon:(0,$.jsx)(U,{className:`size-3.5`}),onClick:()=>p(!0),children:t(`providers.addEndpoint`)})}),(0,$.jsx)(A,{label:t(`providers.preferred`),detail:(0,$.jsxs)($.Fragment,{children:[t(`providers.preferredHint`),c.preferredUpstreamProtocols.filter(e=>!c.endpoints.some(t=>t.protocol===e)).map(e=>(0,$.jsx)(`span`,{className:`mt-1 block text-[var(--warning)]`,children:t(`providers.preferredMissing`,{protocol:it.find(t=>t.value===e)?.label??e})},e))]}),children:(0,$.jsx)(X,{label:t(`providers.preferred`),options:it.map(e=>{let t=c.preferredUpstreamProtocols.indexOf(e.value);return{value:e.value,label:t>=0?`${t+1}. ${e.label}`:e.label}}),value:c.preferredUpstreamProtocols,onValueChange:e=>{let t=c.preferredUpstreamProtocols.filter(t=>e.includes(t)),n=e.filter(e=>!t.includes(e));g({preferredUpstreamProtocols:[...t,...n]})}})})]}),(0,$.jsxs)(P,{title:t(`providers.section.billing`),footer:t(`providers.billingFooter`),children:[(0,$.jsx)(A,{label:t(`providers.priceKey`),detail:t(`providers.priceKeyHint`),children:(0,$.jsx)(O,{className:`w-56`,value:c.priceKey==null?`inherit`:`price:${c.priceKey}`,onChange:e=>g({priceKey:e===`inherit`?null:e.slice(6)}),options:[{value:`inherit`,label:t(`providers.priceKeyDefault`,{id:e.templateId??`—`})},{value:`price:`,label:t(`providers.priceKeyNone`)},...(a.data??[]).map(e=>({value:`price:${e.priceKey}`,label:e.label,detail:e.priceKey}))]})}),(0,$.jsx)(A,{label:t(`providers.multiplier`),detail:t(`providers.multiplierHint`),children:(0,$.jsx)(V,{className:`w-28`,label:t(`providers.multiplier`),step:.01,min:0,value:c.priceMultiplier,onChange:e=>g({priceMultiplier:e??1})})})]}),(0,$.jsxs)(P,{title:t(`providers.section.advanced`),children:[(0,$.jsx)(A,{label:t(`providers.proxy`),detail:t(`providers.proxyHint`),children:(0,$.jsx)(D,{className:`w-64 font-mono`,"aria-label":t(`providers.proxy`),placeholder:`http://127.0.0.1:7890`,value:c.httpProxy??``,onChange:e=>g({httpProxy:e.target.value||null})})}),(0,$.jsxs)(`div`,{className:`px-4 py-3`,children:[(0,$.jsx)(`div`,{className:`mb-2 text-[13px]`,children:t(`providers.headers`)}),u.map(([e,n],r)=>(0,$.jsxs)(`div`,{className:`mb-2 flex gap-2`,children:[(0,$.jsx)(D,{className:`w-48 font-mono`,"aria-label":t(`providers.headerName`),placeholder:`Header`,value:e,onChange:e=>d(u.map((t,n)=>n===r?[e.target.value,t[1]]:t))}),(0,$.jsx)(D,{className:`flex-1 font-mono`,"aria-label":t(`providers.headerValue`),placeholder:`value`,value:n,onChange:e=>d(u.map((t,n)=>n===r?[t[0],e.target.value]:t))}),(0,$.jsx)(v,{size:`sm`,variant:`plain`,icon:(0,$.jsx)(J,{className:`size-3.5`}),"aria-label":t(`common.delete`),onClick:()=>d(u.filter((e,t)=>t!==r))})]},r)),(0,$.jsx)(v,{size:`sm`,variant:`plain`,icon:(0,$.jsx)(U,{className:`size-3.5`}),onClick:()=>h(!0),children:t(`providers.addHeader`)})]}),Object.keys(e.settings).length>0&&(0,$.jsx)(`div`,{className:`px-4 py-3`,children:(0,$.jsx)(F,{label:t(`providers.adapterSettings`),rows:4,className:`w-full font-mono`,defaultValue:N(c.settings),onBlur:e=>{try{g({settings:JSON.parse(e.target.value)})}catch{r(t(`common.invalidJson`),`error`)}}})})]}),(0,$.jsx)(P,{title:t(`providers.section.info`),children:(0,$.jsxs)(`div`,{className:`px-4 py-3`,children:[(0,$.jsx)(L,{label:`ID`,children:e.id}),e.adapterId&&(0,$.jsx)(L,{label:t(`providers.adapter`),children:e.adapterId}),(0,$.jsx)(L,{label:t(`providers.boundClients`),children:e.boundClients.map(e=>et[e]?.name??e).join(`, `)||`—`})]})}),(0,$.jsx)(hn,{open:f,onOpenChange:p,onAdd:e=>g({endpoints:[...c.endpoints,e]})}),(0,$.jsx)(gn,{open:m,onOpenChange:h,onAdd:e=>d([...u.filter(([t])=>t.toLowerCase()!==e[0].toLowerCase()),e])}),(0,$.jsx)(`div`,{className:`sticky bottom-2 flex justify-end`,children:y&&(0,$.jsxs)(`div`,{className:`glass flex items-center gap-2 rounded-full p-1 pl-4 text-[12px]`,children:[(0,$.jsx)(`span`,{className:`text-[var(--text-secondary)]`,children:t(`common.unsaved`)}),(0,$.jsx)(v,{size:`sm`,onClick:()=>{l(s),d(Object.entries(s.extraHeaders))},children:t(`common.revert`)}),(0,$.jsx)(v,{size:`sm`,variant:`primary`,loading:i.isPending,onClick:b,children:t(`common.save`)})]})})]})}function hn({open:e,onOpenChange:t,onAdd:n}){let{t:r}=C(),[i,a]=(0,Q.useState)(`openai-chat`),[o,s]=(0,Q.useState)(``),[c,l]=(0,Q.useState)(!1);(0,Q.useEffect)(()=>{e&&(s(``),l(!1))},[e]);let u=/^https?:\/\/\S+$/.test(o.trim());return(0,$.jsx)(H,{open:e,onOpenChange:t,title:r(`providers.addEndpoint`),description:r(`providers.addEndpointDetail`),footer:(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(v,{onClick:()=>t(!1),children:r(`common.cancel`)}),(0,$.jsx)(v,{variant:`primary`,disabled:!u,onClick:()=>{n({protocol:i,baseUrl:o.trim(),...c?{fullUrl:!0}:{}}),t(!1)},children:r(`common.add`)})]}),children:(0,$.jsxs)(`div`,{className:`grid gap-3`,children:[(0,$.jsx)(B,{label:r(`providers.protocol`),children:(0,$.jsx)(O,{value:i,onChange:a,options:it})}),(0,$.jsx)(B,{label:r(`providers.baseUrl`),hint:r(c?`providers.fullUrlHint`:`providers.baseUrlHint`),children:(0,$.jsx)(D,{autoFocus:!0,className:`font-mono`,placeholder:`https://api.example.com/v1`,value:o,invalid:o!==``&&!u,onChange:e=>s(e.target.value)})}),(0,$.jsxs)(`label`,{className:`flex items-center gap-2 text-[12px] text-[var(--text-secondary)]`,children:[(0,$.jsx)(R,{checked:c,onChange:l,label:r(`providers.fullUrl`)}),r(`providers.fullUrl`)]})]})})}function gn({open:e,onOpenChange:t,onAdd:n}){let{t:r}=C(),[i,a]=(0,Q.useState)(``),[o,s]=(0,Q.useState)(``);(0,Q.useEffect)(()=>{e&&(a(``),s(``))},[e]);let c=/^[A-Za-z0-9-]+$/.test(i.trim());return(0,$.jsx)(H,{open:e,onOpenChange:t,title:r(`providers.addHeader`),description:r(`providers.addHeaderDetail`),footer:(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(v,{onClick:()=>t(!1),children:r(`common.cancel`)}),(0,$.jsx)(v,{variant:`primary`,disabled:!c,onClick:()=>{n([i.trim(),o]),t(!1)},children:r(`common.add`)})]}),children:(0,$.jsxs)(`div`,{className:`grid gap-3`,children:[(0,$.jsx)(B,{label:r(`providers.headerName`),children:(0,$.jsx)(D,{autoFocus:!0,className:`font-mono`,placeholder:`X-Custom-Header`,value:i,invalid:i!==``&&!c,onChange:e=>a(e.target.value)})}),(0,$.jsx)(B,{label:r(`providers.headerValue`),children:(0,$.jsx)(D,{className:`font-mono`,value:o,onChange:e=>s(e.target.value)})})]})})}export{en as ProviderDetailPage};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
._card_i7fo0_3{isolation:isolate;border:1px solid var(--border);border-radius:var(--radius-panel);background:var(--surface);min-width:0;color:var(--foreground);transition:border-color var(--duration-fast) var(--ease-standard), box-shadow var(--duration-standard) var(--ease-standard);position:relative;overflow:hidden}._card_i7fo0_3[data-hover]{border-color:var(--border-strong);box-shadow:var(--shadow-raised)}._card_i7fo0_3:has(._trigger_i7fo0_6:focus-visible){border-color:var(--border-strong)}._media_i7fo0_7{background:var(--surface-muted);position:relative;overflow:hidden}._zoom_i7fo0_8{place-items:center;min-height:112px;display:grid}._content_i7fo0_9{padding:var(--space-5)}._card_i7fo0_3[data-density=compact] ._zoom_i7fo0_8{min-height:80px}._card_i7fo0_3[data-density=compact] ._content_i7fo0_9{padding:14px}._card_i7fo0_3[data-density=compact] ._description_i7fo0_12{margin-top:4px}._card_i7fo0_3[data-density=compact] ._footer_i7fo0_13{margin-top:12px}._title_i7fo0_15{width:fit-content;max-width:100%;font-size:var(--text-lg);letter-spacing:var(--tracking-body);text-wrap:balance;margin:0;font-weight:500;line-height:1.3}._trigger_i7fo0_6{color:inherit;font:inherit;letter-spacing:inherit;text-align:inherit;cursor:pointer;-webkit-tap-highlight-color:transparent;background:0 0;border:0;padding:0}._trigger_i7fo0_6:after{content:"";position:absolute;inset:0}._trigger_i7fo0_6:focus-visible{outline:none}._description_i7fo0_12{max-width:34ch;margin:var(--space-2) 0 0;color:var(--text-secondary);font-size:var(--text-sm);line-height:var(--leading-body);text-wrap:pretty}._footer_i7fo0_13{justify-content:space-between;align-items:center;gap:var(--space-3);margin-top:var(--space-5);display:flex}._byline_i7fo0_22{align-items:center;gap:var(--space-3);flex:auto;min-width:0;display:flex}._avatar_i7fo0_23{width:var(--space-8);height:var(--space-8);border-radius:var(--radius-pill);background:var(--surface-muted);flex:none;display:grid;overflow:hidden}._avatar_i7fo0_23>*{object-fit:cover;width:100%;height:100%}._bylineText_i7fo0_26{min-width:0;font-size:var(--text-xs);line-height:var(--leading-body);grid-template-columns:minmax(0,1fr);display:grid}._meta_i7fo0_27{color:var(--foreground);text-overflow:ellipsis;white-space:nowrap;font-weight:500;overflow:hidden}._status_i7fo0_28{color:var(--text-muted);white-space:nowrap;font-variant-numeric:tabular-nums;position:relative;overflow:clip visible}._roll_i7fo0_30{display:block;position:relative}._line_i7fo0_31{text-overflow:ellipsis;display:block;overflow:clip visible}._word_i7fo0_32{white-space:pre;display:inline-block}._srOnly_i7fo0_33{clip-path:inset(50%);white-space:nowrap;width:1px;height:1px;position:absolute;overflow:hidden}._action_i7fo0_34{z-index:1;gap:var(--space-3);flex-wrap:wrap;flex:none;display:flex;position:relative}._overlay_i7fo0_36{z-index:50;-webkit-backdrop-filter:blur(7px);backdrop-filter:blur(7px);background:oklch(10% 0 0/.46);position:fixed;inset:0}._panel_i7fo0_38{z-index:51;width:min(calc(100vw - var(--space-8)), 30rem);height:fit-content;max-height:calc(100dvh - var(--space-8));overscroll-behavior:contain;border:1px solid var(--border);border-radius:var(--radius-surface);background:var(--surface-raised);color:var(--foreground);box-shadow:var(--shadow-floating);transition:background-color var(--duration-standard) var(--ease-standard), box-shadow var(--duration-standard) var(--ease-standard);margin:auto;position:fixed;inset:0;overflow:hidden auto}._panel_i7fo0_38:focus{outline:none}._panel_i7fo0_38[data-returning]{inset:auto;top:var(--landing-top);left:var(--landing-left);width:var(--landing-width);height:var(--landing-height);border-color:var(--border);background:var(--surface);max-height:none;box-shadow:none;pointer-events:none;margin:0;overflow:hidden}._panel_i7fo0_38[data-returning] ._content_i7fo0_9{padding:var(--space-5)}._panel_i7fo0_38[data-returning] ._title_i7fo0_15{font-size:var(--text-lg)}._panel_i7fo0_38 ._content_i7fo0_9{padding:var(--space-6)}._panel_i7fo0_38 ._title_i7fo0_15{font-size:var(--text-xl)}._panel_i7fo0_38 ._description_i7fo0_12{max-width:var(--card-measure,34ch)}._closeSlot_i7fo0_48{top:var(--space-4);right:var(--space-4);z-index:2;display:grid;position:absolute}._close_i7fo0_48{width:var(--space-8);height:var(--space-8);border:1px solid color-mix(in oklab, var(--border) 70%, transparent);border-radius:var(--radius-pill);background:color-mix(in oklab, var(--surface-raised) 74%, transparent);-webkit-backdrop-filter:blur(12px);backdrop-filter:blur(12px);color:var(--foreground);cursor:pointer;-webkit-tap-highlight-color:transparent;transition:background-color var(--duration-fast) var(--ease-standard);place-items:center;padding:0;display:grid}@media (hover:hover) and (pointer:fine){._close_i7fo0_48:hover{background:var(--surface-raised)}}._details_i7fo0_51{margin-top:var(--space-6);padding-top:var(--space-5);border-top:1px solid var(--border);color:var(--text-secondary);font-size:var(--text-sm);line-height:var(--leading-body)}@media (prefers-reduced-motion:reduce){._card_i7fo0_3,._close_i7fo0_48{transition-duration:var(--duration-instant)}}._figure_1clu4_1{gap:var(--space-3);min-width:0;color:var(--foreground);margin:0;display:grid}._caption_1clu4_1{align-items:baseline;gap:var(--space-2);min-width:0;color:var(--text-secondary);font-size:var(--text-sm);display:flex}._label_1clu4_1{white-space:nowrap;min-width:0;overflow:hidden}._caption_1clu4_1 strong{color:var(--foreground);font-size:var(--text-lg);letter-spacing:var(--tracking-body);font-variant-numeric:tabular-nums;margin-left:auto;font-weight:500}._caption_1clu4_1 small{font-size:var(--text-xs);font-variant-numeric:tabular-nums;transition:color var(--duration-standard) var(--ease-standard);flex:none;font-weight:500}._accent_1clu4_2{color:var(--accent-strong);stroke:var(--accent)}._success_1clu4_2{color:var(--success);stroke:var(--success)}._warning_1clu4_2{color:var(--warning);stroke:var(--warning)}._danger_1clu4_2{color:var(--danger);stroke:var(--danger)}._point_1clu4_4{color:var(--text-secondary)}._roll_1clu4_7{white-space:pre;vertical-align:top;max-width:100%;display:inline-flex;position:relative;overflow-x:clip}._roll_1clu4_7[data-end]{justify-content:flex-end}._track_1clu4_9,._slot_1clu4_9,._glyph_1clu4_9{white-space:pre;display:inline-block;position:relative}._roll_1clu4_7[data-whole] ._track_1clu4_9,._roll_1clu4_7[data-whole] ._slot_1clu4_9,._roll_1clu4_7[data-whole] ._glyph_1clu4_9{text-overflow:ellipsis;vertical-align:top;max-width:100%;overflow:hidden}._sizer_1clu4_11{visibility:hidden;white-space:pre;pointer-events:none;position:absolute;top:0;left:0}._plot_1clu4_14{border-radius:calc(var(--radius-control) / 2);-webkit-tap-highlight-color:transparent;outline:none;min-width:0;position:relative}._plot_1clu4_14[data-interactive]{touch-action:pan-y;cursor:default;-webkit-user-select:none;user-select:none}._plot_1clu4_14:focus-visible{--focus-outline-offset:8px}._chart_1clu4_17{width:100%;height:auto;display:block;overflow:visible}._baseline_1clu4_18{stroke:var(--border);stroke-width:1px}._area_1clu4_20._area_1clu4_20{fill:color-mix(in oklab, currentColor 9%, transparent);stroke:none}._line_1clu4_21,._trail_1clu4_21{fill:none;stroke-width:2.5px;stroke-linecap:round;stroke-linejoin:round}._line_1clu4_21{transition:stroke var(--duration-standard) var(--ease-standard)}._trail_1clu4_21{stroke:var(--border-strong)}._cursor_1clu4_24{stroke:var(--border-strong);stroke-width:1px}._end_1clu4_25{transition:stroke var(--duration-standard) var(--ease-standard)}@media (prefers-reduced-motion:reduce){._line_1clu4_21,._end_1clu4_25,._caption_1clu4_1 small{transition:none}}._root_1cea8_1{--marker:1.75rem;--halo:4px;min-width:0;color:var(--foreground);font-family:var(--font-body);letter-spacing:var(--tracking-body)}._horizontal_1cea8_3{width:100%;container:stepper/inline-size}._list_1cea8_4{margin:0;padding:0;list-style:none;display:grid}._item_1cea8_5{min-width:0;position:relative}._horizontal_1cea8_3 ._item_1cea8_5:not(:last-child){padding-inline-end:var(--space-4)}._vertical_1cea8_7 ._item_1cea8_5:not(:last-child){padding-bottom:var(--space-5)}._compact_1cea8_8._vertical_1cea8_7 ._item_1cea8_5:not(:last-child){padding-bottom:var(--space-6)}._head_1cea8_11{border-radius:var(--space-2);color:inherit;font:inherit;letter-spacing:inherit;text-align:start;cursor:default;-webkit-tap-highlight-color:transparent;background:0 0;border:0;margin:0;padding:0;display:grid}._head_1cea8_11[data-clickable]{cursor:pointer}._horizontal_1cea8_3 ._head_1cea8_11{justify-items:start;row-gap:var(--space-3);width:fit-content;max-width:100%}._vertical_1cea8_7 ._head_1cea8_11{grid-template-columns:var(--marker) minmax(0, 1fr);column-gap:var(--space-3);align-items:start;width:100%}._compact_1cea8_8._vertical_1cea8_7 ._head_1cea8_11{grid-template-columns:var(--marker);column-gap:0}._head_1cea8_11:focus-visible{outline:2px solid var(--focus-ring);outline-offset:4px}._head_1cea8_11:focus:not(:focus-visible){outline:none}._marker_1cea8_20{width:var(--marker);height:var(--marker);flex:none;place-items:center;display:grid;position:relative}._ring_1cea8_21{inset:calc(var(--halo) * -1);border-radius:var(--radius-pill);background:var(--accent-subtle);transition:background-color var(--duration-standard) var(--ease-standard);position:absolute}._disc_1cea8_22{border-radius:var(--radius-pill);background:var(--surface);width:100%;height:100%;box-shadow:inset 0 0 0 1px var(--border-strong);color:var(--text-muted);font-size:var(--text-xs);font-variant-numeric:tabular-nums;transition:background-color var(--duration-standard) var(--ease-standard), box-shadow var(--duration-standard) var(--ease-standard), color var(--duration-standard) var(--ease-standard), transform var(--duration-spring) var(--ease-spring);place-items:center;font-weight:500;line-height:1;display:grid;position:relative}._glyph_1cea8_23{grid-area:1/1;place-items:center;display:grid}._icon_1cea8_24{width:.875rem;height:.875rem}._item_1cea8_5[data-status=current] ._disc_1cea8_22{box-shadow:inset 0 0 0 1.5px var(--accent);color:var(--foreground)}._item_1cea8_5[data-status=complete] ._disc_1cea8_22{background:var(--accent);box-shadow:inset 0 0 0 1px var(--accent);color:var(--accent-foreground)}._item_1cea8_5[data-status=error] ._disc_1cea8_22{background:color-mix(in oklab, var(--danger) 10%, var(--surface));box-shadow:inset 0 0 0 1.5px var(--danger);color:var(--danger)}._item_1cea8_5[data-status=error] ._ring_1cea8_21{background:color-mix(in oklab, var(--danger) 16%, transparent)}._connector_1cea8_31{border-radius:var(--radius-pill);background:var(--border);pointer-events:none;position:absolute;overflow:hidden}._horizontal_1cea8_3 ._connector_1cea8_31{top:calc(var(--marker) / 2 - 1px);inset-inline:calc(var(--marker) + var(--halo) + var(--space-1)) calc(var(--halo) + var(--space-1));height:2px}._vertical_1cea8_7 ._connector_1cea8_31{top:calc(var(--marker) + var(--halo) + 2px);bottom:calc(var(--halo) + 2px);width:2px;inset-inline-start:calc(var(--marker) / 2 - 1px)}._fill_1cea8_35{border-radius:inherit;background:var(--accent);position:absolute;inset:0}._horizontal_1cea8_3 ._fill_1cea8_35{transform-origin:0}._horizontal_1cea8_3 ._fill_1cea8_35:is(:lang(ae),:lang(ar),:lang(arc),:lang(bcc),:lang(bqi),:lang(ckb),:lang(dv),:lang(fa),:lang(glk),:lang(he),:lang(ku),:lang(mzn),:lang(nqo),:lang(pnb),:lang(ps),:lang(sd),:lang(ug),:lang(ur),:lang(yi)){transform-origin:100%}._vertical_1cea8_7 ._fill_1cea8_35{transform-origin:top}._text_1cea8_40{min-width:0;display:grid}._vertical_1cea8_7 ._text_1cea8_40{padding-top:.25rem}._label_1cea8_43{color:var(--text-muted);font-size:var(--text-sm);overflow-wrap:break-word;transition:color var(--duration-standard) var(--ease-standard);font-weight:500;line-height:1.25rem;display:block}._item_1cea8_5[data-status=complete] ._label_1cea8_43{color:var(--text-secondary)}._item_1cea8_5[data-status=current] ._label_1cea8_43,._item_1cea8_5[data-status=error] ._label_1cea8_43{color:var(--foreground)}._slot_1cea8_47{display:block}._slotInner_1cea8_48{display:block;position:relative}._description_1cea8_49,._error_1cea8_49{font-size:var(--text-xs);font-weight:400;line-height:var(--leading-body);overflow-wrap:break-word;padding-top:2px;display:block}._description_1cea8_49{color:var(--text-muted)}._error_1cea8_49{color:var(--danger)}._caption_1cea8_53{margin-top:var(--space-3);display:none}._captionLabel_1cea8_54{color:var(--foreground);font-size:var(--text-sm);font-weight:500;line-height:1.25rem;display:block}@media (hover:hover) and (pointer:fine){._head_1cea8_11[data-clickable]:hover ._label_1cea8_43{color:var(--foreground)}._item_1cea8_5[data-status=complete] ._head_1cea8_11[data-clickable]:hover ._disc_1cea8_22{background:var(--accent-strong);box-shadow:inset 0 0 0 1px var(--accent-strong)}._item_1cea8_5[data-status=error] ._head_1cea8_11[data-clickable]:hover ._disc_1cea8_22{background:color-mix(in oklab, var(--danger) 18%, var(--surface))}}._head_1cea8_11[data-clickable]:active ._disc_1cea8_22{transform:scale(.92)}._srOnly_1cea8_63,._compact_1cea8_8 ._text_1cea8_40{clip-path:inset(50%);white-space:nowrap;width:1px;height:1px;margin:0;padding:0;position:absolute;overflow:hidden}._compact_1cea8_8._horizontal_1cea8_3 ._caption_1cea8_53{display:grid}@container stepper (width<=30rem){._horizontal_1cea8_3 ._text_1cea8_40{clip-path:inset(50%);white-space:nowrap;width:1px;height:1px;margin:0;padding:0;position:absolute;overflow:hidden}._horizontal_1cea8_3 ._caption_1cea8_53{display:grid}}@media (prefers-reduced-motion:reduce){._disc_1cea8_22,._ring_1cea8_21,._label_1cea8_43{transition:none}._head_1cea8_11[data-clickable]:active ._disc_1cea8_22{transform:none}}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{$ as e,$r as t,B as n,C as r,Ci as i,Ei as a,En as o,Et as s,G as c,Gr as l,H as u,Jt as d,K as f,Kr as p,Nn as m,Ot as h,Pn as g,Q as _,S as v,Si as y,Ti as b,U as x,Ut as S,V as C,Vt as w,W as T,X as E,Z as D,_t as O,ar as k,at as A,b as j,bt as M,c as N,ci as P,ct as F,d as I,dt as ee,fr as L,ft as R,ha as z,i as B,it as V,kr as H,lt as U,ma as te,mn as W,mr as G,mt as ne,nt as re,ot as ie,pa as ae,pr as oe,pt as se,q as ce,qr as le,rt as ue,st as de,tt as fe,va as pe,wi as K,x as me,xi as q,yt as J}from"./format-CkDcAs-_.js";import{t as he}from"./use-transform-CJhlgN8s.js";import{S as ge,a as _e,b as ve,f as ye,n as be,s as xe,t as Se}from"./Page-iMwsVZGv.js";import{n as Ce,t as we}from"./checkbox-BQx1e8t-.js";import{t as Te}from"./download-Bbci4NYa.js";import{E as Ee,M as De,h as Oe,j as ke,m as Ae,p as je,u as Me,w as Ne}from"./index-C6Mqffdm.js";import{t as Pe}from"./radio-cards-CKDDH2FI.js";import{a as Fe,b as Ie,i as Le,o as Re,r as ze,s as Be,t as Ve}from"./quota-fdOyhiov.js";var Y=pe(z(),1);function He(e,t,n){(0,Y.useInsertionEffect)(()=>e.on(t,n),[e,t,n])}var Ue={name:`circle-question-mark`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3`,key:`1u773s`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}]],aliases:[`help-circle`,`circle-help`]};Ue.node;var We=h(Ue),Ge={name:`flask-conical`,size:24,node:[[`path`,{d:`M14 2v6a2 2 0 0 0 .245.96l5.51 10.08A2 2 0 0 1 18 22H6a2 2 0 0 1-1.755-2.96l5.51-10.08A2 2 0 0 0 10 8V2`,key:`18mbvz`}],[`path`,{d:`M6.453 15h11.094`,key:`3shlmq`}],[`path`,{d:`M8.5 2h7`,key:`csnxdl`}]]};Ge.node;var Ke=h(Ge),qe={name:`gauge`,size:24,node:[[`path`,{d:`m12 14 4-4`,key:`9kzdfg`}],[`path`,{d:`M3.34 19a10 10 0 1 1 17.32 0`,key:`19p75a`}]]};qe.node;var Je=h(qe),Ye={name:`square`,size:24,node:[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}]]};Ye.node;var Xe=h(Ye),X={card:`_card_i7fo0_3`,trigger:`_trigger_i7fo0_6`,media:`_media_i7fo0_7`,zoom:`_zoom_i7fo0_8`,content:`_content_i7fo0_9`,description:`_description_i7fo0_12`,footer:`_footer_i7fo0_13`,title:`_title_i7fo0_15`,byline:`_byline_i7fo0_22`,avatar:`_avatar_i7fo0_23`,bylineText:`_bylineText_i7fo0_26`,meta:`_meta_i7fo0_27`,status:`_status_i7fo0_28`,roll:`_roll_i7fo0_30`,line:`_line_i7fo0_31`,word:`_word_i7fo0_32`,srOnly:`_srOnly_i7fo0_33`,action:`_action_i7fo0_34`,overlay:`_overlay_i7fo0_36`,panel:`_panel_i7fo0_38`,closeSlot:`_closeSlot_i7fo0_48`,close:`_close_i7fo0_48`,details:`_details_i7fo0_51`},Z=te(),{blur:Ze,duration:Qe,ease:$e,spring:et,stagger:tt}=J,nt={...et.smooth,visualDuration:.3},rt={...et.smooth,visualDuration:.26},it=300,at={duration:Qe.instant},ot=1.04,st={duration:Qe.considered*2,ease:[...$e.standard]},ct={duration:Qe.considered,ease:[...$e.standard]},lt={delay:Qe.instant,duration:Qe.standard,ease:[...$e.enter]},ut={delay:Qe.instant,duration:Qe.fast,ease:[...$e.enter]},dt={enter:{},center:{},exit:{opacity:0,y:`-.3em`,filter:`blur(${Ze.subtle}px)`,transition:{duration:Qe.fast,ease:[...$e.standard]}}},ft={enter:{opacity:0,y:`.3em`,filter:`blur(${Ze.soft}px)`},center:e=>({opacity:1,y:0,filter:`blur(0px)`,transition:{duration:Qe.standard,ease:[...$e.enter],delay:e*tt.word}})};function pt({text:e,reduced:t}){return(0,Z.jsxs)(`span`,{className:X.status,role:`status`,children:[(0,Z.jsx)(`span`,{className:X.srOnly,children:e}),(0,Z.jsx)(`span`,{className:X.roll,"aria-hidden":`true`,children:(0,Z.jsx)(a,{mode:`popLayout`,initial:!1,children:(0,Z.jsx)(q.span,{className:X.line,variants:dt,initial:!t&&`enter`,animate:`center`,exit:t?void 0:`exit`,children:e.split(/(\s+)/).map((e,t)=>(0,Z.jsx)(q.span,{className:X.word,custom:t/2,variants:ft,children:e},t))},e)})})]})}function mt(e,t){let n=parseFloat(t);if(Number.isFinite(n))return t.trim().endsWith(`rem`)?n*parseFloat(getComputedStyle(e.ownerDocument.documentElement).fontSize):n}function ht({title:e,description:t,media:r,action:o,avatar:s,meta:l,status:d,details:p,open:m,defaultOpen:h=!1,onOpenChange:g,children:_,className:v,style:y,...S}){let w=i()??!1,E=(0,Y.useId)(),D=(0,Y.useRef)(null),O=(0,Y.useRef)(null),[k,A]=(0,Y.useState)(h),[j,N]=(0,Y.useState)(!1),[P,F]=(0,Y.useState)({}),[I,ee]=(0,Y.useState)(null),L=p?m??k:!1,R=!!p&&!w,z=!L&&I!==null,B=!!t,V=(0,Y.useCallback)(e=>{m===void 0&&A(e),g?.(e)},[m,g]);(0,Y.useEffect)(()=>{let e=D.current,t=O.current;if(!R||!e||typeof ResizeObserver>`u`)return;let n=new ResizeObserver(()=>{let n=getComputedStyle(e),r=mt(e,n.borderTopLeftRadius),i=mt(e,n.getPropertyValue(`--radius-surface`)),a=t?.offsetWidth||void 0;F(e=>e.card!==void 0&&e.measure===a?e:{card:e.card??r,panel:e.panel??i,measure:a})});return n.observe(e),t&&n.observe(t),()=>n.disconnect()},[R,B]);let H=(0,Y.useRef)(L);(0,Y.useLayoutEffect)(()=>{let e=H.current&&!L;H.current=L;let t=D.current;if(L)ee(null);else if(e&&R&&t){let e=t.getBoundingClientRect();ee({top:e.top,left:e.left,width:e.width,height:e.height})}},[L,R]),(0,Y.useEffect)(()=>{if(!z)return;let e=window.setTimeout(()=>ee(null),it);return()=>window.clearTimeout(e)},[z]);let U=(e,t,n=!0)=>R?{layoutId:e,layout:n,layoutCrossfade:!1,layoutDependency:t===`card`?L:z?`return`:`panel`,transition:{layout:t===`card`?rt:nt}}:{},te=e=>s||l||d||o?(0,Z.jsxs)(`div`,{className:X.footer,children:[s||l||d?(0,Z.jsxs)(q.div,{className:X.byline,...U(`byline`,e,`position`),children:[s?(0,Z.jsx)(`span`,{className:X.avatar,children:s}):null,(0,Z.jsxs)(`span`,{className:X.bylineText,children:[l?(0,Z.jsx)(`span`,{className:X.meta,children:l}):null,d?(0,Z.jsx)(pt,{text:d,reduced:w}):null]})]}):null,o?(0,Z.jsx)(q.div,{className:X.action,...U(`action`,e,`position`),children:o}):null]}):null,W=(0,Z.jsxs)(q.article,{...S,ref:D,className:[X.card,v].filter(Boolean).join(` `),style:{...y,borderRadius:P.card??y?.borderRadius},"data-hover":j||void 0,whileHover:w?void 0:{y:-2},onHoverStart:()=>N(!0),onHoverEnd:()=>N(!1),...U(`card`,`card`),transition:{default:et.snappy,layout:rt},children:[r?(0,Z.jsx)(q.div,{className:X.media,...U(`media`,`card`),children:(0,Z.jsx)(q.div,{className:X.zoom,initial:!1,animate:{scale:j&&!w?ot:1},transition:j?st:ct,children:r})}):null,(0,Z.jsxs)(`div`,{className:X.content,children:[(0,Z.jsx)(q.h3,{className:X.title,...U(`title`,`card`),children:p?(0,Z.jsx)(ce,{asChild:!0,children:(0,Z.jsx)(`button`,{type:`button`,className:X.trigger,children:e})}):e}),t?(0,Z.jsx)(q.p,{ref:O,className:X.description,...U(`description`,`card`,`position`),children:t}):null,_,te(`card`)]})]});return p?(0,Z.jsx)(n,{open:L,onOpenChange:V,children:(0,Z.jsxs)(b,{id:E,children:[W,(0,Z.jsx)(a,{children:(L||z)&&(0,Z.jsxs)(c,{forceMount:!0,children:[(0,Z.jsx)(a,{children:L&&(0,Z.jsx)(T,{asChild:!0,forceMount:!0,children:(0,Z.jsx)(q.div,{className:X.overlay,initial:{opacity:0},animate:{opacity:1},exit:{opacity:0,transition:w?at:{duration:Qe.exit,ease:[...$e.standard]}},transition:w?at:{duration:Qe.standard,ease:[...$e.enter]}})},`overlay`)}),(0,Z.jsx)(u,{asChild:!0,forceMount:!0,...t?{}:{"aria-describedby":void 0},children:(0,Z.jsxs)(q.div,{className:X.panel,"data-framer-portal-id":E,"data-returning":z||void 0,layoutScroll:!0,style:{borderRadius:P.panel,"--card-measure":P.measure?`${P.measure}px`:void 0,...I&&z?{"--landing-top":`${I.top}px`,"--landing-left":`${I.left}px`,"--landing-width":`${I.width}px`,"--landing-height":`${I.height}px`}:{}},...R?{...U(`card`,`panel`),initial:!1,animate:P.card!==void 0&&P.panel!==void 0?{borderRadius:z?P.card:P.panel}:void 0,transition:{layout:z?rt:nt,borderRadius:z?rt:nt},exit:{opacity:0,transition:{duration:0}}}:{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0,transition:at},transition:at},children:[r?(0,Z.jsx)(q.div,{className:X.media,...U(`media`,`panel`),children:(0,Z.jsx)(q.div,{className:X.zoom,initial:{scale:j&&!w?ot:1},animate:{scale:1},transition:nt,children:r})}):null,(0,Z.jsx)(q.span,{className:X.closeSlot,initial:w?{opacity:0}:{opacity:0,scale:.9},animate:z?{opacity:0,scale:.9}:{opacity:1,scale:1},transition:z||w?at:ut,children:(0,Z.jsx)(C,{asChild:!0,children:(0,Z.jsx)(q.button,{type:`button`,className:X.close,"aria-label":`Close quick look`,whileTap:w?void 0:{scale:.94},transition:et.snappy,children:(0,Z.jsx)(M,{width:16,height:16,strokeWidth:1.75,"aria-hidden":`true`})})})}),(0,Z.jsxs)(`div`,{className:X.content,children:[(0,Z.jsx)(f,{asChild:!0,children:(0,Z.jsx)(q.h2,{className:X.title,...U(`title`,`panel`),children:e})}),t?(0,Z.jsx)(x,{asChild:!0,children:(0,Z.jsx)(q.p,{className:X.description,...U(`description`,`panel`,`position`),children:t})}):null,_,te(`panel`),(0,Z.jsx)(q.div,{className:X.details,initial:!w&&{opacity:0,y:6},animate:z?{opacity:0,y:0}:{opacity:1,y:0},exit:{opacity:0,transition:at},transition:z||w?at:lt,children:p})]})]})})]},`quick-look`)})]})}):W}var Q={figure:`_figure_1clu4_1`,caption:`_caption_1clu4_1`,label:`_label_1clu4_1`,accent:`_accent_1clu4_2`,success:`_success_1clu4_2`,warning:`_warning_1clu4_2`,danger:`_danger_1clu4_2`,point:`_point_1clu4_4`,roll:`_roll_1clu4_7`,track:`_track_1clu4_9`,slot:`_slot_1clu4_9`,glyph:`_glyph_1clu4_9`,sizer:`_sizer_1clu4_11`,plot:`_plot_1clu4_14`,chart:`_chart_1clu4_17`,baseline:`_baseline_1clu4_18`,area:`_area_1clu4_20`,line:`_line_1clu4_21`,trail:`_trail_1clu4_21`,cursor:`_cursor_1clu4_24`,end:`_end_1clu4_25`},gt={hidden:e=>({opacity:0,y:`${.3*e}em`,filter:`blur(${J.blur.soft}px)`}),shown:{opacity:1,y:0,filter:`blur(0px)`,transition:{duration:J.duration.standard,ease:[...J.ease.enter]}},gone:e=>({opacity:0,y:`${-.3*e}em`,filter:`blur(${J.blur.subtle}px)`,transition:{duration:J.duration.fast,ease:[...J.ease.standard]}})},_t={hidden:{opacity:0,y:0,filter:`blur(0px)`},shown:{opacity:1,y:0,filter:`blur(0px)`,transition:{duration:J.duration.instant}},gone:{opacity:0,y:0,filter:`blur(0px)`,transition:{duration:J.duration.instant}}},vt=e=>Number(e.replace(/,/g,``).replace(/−/g,`-`).match(/-?\d+(?:\.\d+)?/)?.[0]??NaN),yt=new Intl.NumberFormat(`en-US`),bt={duration:J.duration.considered*1.75,ease:[...J.ease.inOut]},xt={duration:J.duration.fast,ease:[...J.ease.standard]};function St(e,t){if(!e)return[];if(t)return[{slot:`all`,key:e,text:e}];if(!/\p{L}/u.test(e))return[...e].map((e,t,n)=>({slot:`n${n.length-t}`,key:e,text:e}));let n=e.split(/(?<=\s)/);return n.map((e,t)=>({slot:`w${t}`,key:n.slice(0,t+1).join(``),text:e}))}function Ct({text:e,direction:t,whole:n=!1,morph:r=!1,tone:o}){let s=!!i(),c=(0,Y.useRef)(null),l=K(`auto`),[u,d]=(0,Y.useState)({text:e,direction:1});u.text!==e&&d({text:e,direction:t??(vt(e)<vt(u.text)?-1:1)}),(0,Y.useEffect)(()=>{let e=c.current;if(!e||typeof ResizeObserver>`u`)return;let t=null,n=new ResizeObserver(([n])=>{if(!n)return;let r=n.borderBoxSize?.[0]?.inlineSize??e.offsetWidth;t!==null&&t!==e.textContent&&!s?y(l,r,J.spring.morph):l.jump(r),t=e.textContent});return n.observe(e),()=>n.disconnect()},[r,s,l]);let f=!n&&!/\p{L}/u.test(e),p=s?_t:gt,m=f?`right`:`left`;return(0,Z.jsxs)(q.span,{className:Q.roll,"data-end":f||void 0,"data-whole":n||void 0,style:r?{width:l}:void 0,children:[r&&(0,Z.jsx)(`span`,{ref:c,className:Q.sizer,"aria-hidden":`true`,children:e}),(0,Z.jsx)(`span`,{className:Q.track,children:(0,Z.jsx)(a,{mode:`popLayout`,initial:!1,custom:u.direction,anchorX:m,children:St(e,n).map(e=>(0,Z.jsx)(q.span,{className:Q.slot,custom:u.direction,variants:p,initial:`hidden`,animate:`shown`,exit:`gone`,children:(0,Z.jsx)(a,{mode:`popLayout`,initial:!1,custom:u.direction,anchorX:m,children:(0,Z.jsx)(q.span,{className:o?`${Q.glyph} ${o}`:Q.glyph,custom:u.direction,variants:p,initial:`hidden`,animate:`shown`,exit:`gone`,children:e.text},`${o??``}${e.key}`)})},e.slot))})})]})}var wt=5,Tt=1.25,Et=Array.from({length:161},(e,t)=>t/160);function Dt(e){let t=Math.min(...e),n=Math.max(...e)-t,r=e.map(e=>n?(e-t)/n:.5),i=r.length-1,a=1/i,o=r.slice(1).map((e,t)=>(e-r[t])/a),s=r.map((e,t)=>t===0||t===i?o[0]:(Math.sign(o[t-1])+Math.sign(o[t]))*Math.min(Math.abs(o[t-1]),Math.abs(o[t]),Math.abs(o[t-1]+o[t])/4)||0);i>1&&(s[0]=(3*o[0]-s[1])/2,s[i]=(3*o[i-1]-s[i-1])/2);let c=Math.max(1,Math.min(16,Math.round(128/i))),l=[];for(let e=0;e<i;e++)for(let t=0;t<c;t++){let n=t/c,i=n*n,o=i*n,u=(2*o-3*i+1)*r[e]+(o-2*i+n)*a*s[e]+(3*i-2*o)*r[e+1]+(o-i)*a*s[e+1];l.push([(e+n)*a,Math.min(1,Math.max(0,u))])}return l.push([1,r[i]]),l}function Ot(e,t){let n=0,r=e.length-1;if(t<=e[n][0])return e[n][1];if(t>=e[r][0])return e[r][1];for(;r-n>1;){let i=n+r>>1;e[i][0]<t?n=i:r=i}let[i,a]=e[n],[o,s]=e[r];return o===i?s:a+(s-a)*(t-i)/(o-i)}function kt(e,t,n,r){let i=e=>wt+(1-e)*(n-10),a=e.map(([e,n])=>[e*t,i(n)]),o=a.map(([e,t])=>`${e.toFixed(2)},${t.toFixed(2)}`),s=r*t,c=i(Ot(e,r));return{points:a,line:o.join(` `),trail:`M${o.join(`L`)}`,fill:`M${o.join(`L`)}L${t},${n}L0,${n}Z`,dot:`${s},${c} ${s},${c}`,cx:s}}function At(e,t){let n=e.slice(1).map(([t,n],r)=>Math.hypot(t-e[r][0],n-e[r][1])),r=t*n.reduce((e,t)=>e+t,0);for(let t=0;t<n.length;t++){let i=n[t],a=e[t][0];if(r<=i)return a+(e[t+1][0]-a)*(i?r/i:1);r-=i}return e[e.length-1][0]}function jt({data:e,label:t,value:n,change:r,tone:a=`accent`,width:o=160,height:s=52,labels:c,formatValue:l,area:u=!0,interactive:d=!0}){let f=e.length>1?e:[e[0]??0,e[0]??0],p=f.length-1,m=f.join(`,`),h=(0,Y.useMemo)(()=>Dt(m.split(`,`).map(Number)),[m]),g=`${t}: ${n??f[p]}. ${r??``}`.trim(),_=`sparkline${(0,Y.useId)().replace(/[^a-zA-Z0-9_-]/g,``)}`,v=(0,Y.useRef)(null),b=(0,Y.useRef)(null),x=De(v,{once:!0,amount:.5}),S=!!i(),[C,w]=(0,Y.useState)({w:o,h:s}),[T,E]=(0,Y.useState)(null),[D,O]=(0,Y.useState)(!1),k=T===null?null:Math.min(T,p),[A,j]=(0,Y.useState)({index:k,direction:1});A.index!==k&&j({index:k,direction:k===null||A.index===null?1:Math.sign(k-A.index)||1});let[M]=(0,Y.useState)(()=>kt(h,o,s,1)),N=(0,Y.useRef)(h),P=(0,Y.useRef)(C),F=K(0),I=K(1),ee=K(M.line),L=K(M.trail),R=K(M.fill),z=K(M.dot),B=K(M.cx),V=K(M.cx+Tt+16),H=K(M.cx+Tt),U=K(0),te=he(F,e=>+(e>.001)),W=(0,Y.useCallback)(()=>{let{w:e,h:t}=P.current,n=F.get(),r=kt(N.current,e,t,I.get());ee.set(r.line),L.set(r.trail),R.set(r.fill),z.set(r.dot),B.set(r.cx),V.set(r.cx+Tt+16),H.set(r.cx+Tt),U.set(n>=1?e+32:At(r.points,n)+16)},[I,B,H,z,F,R,ee,V,U,L]);He(I,`change`,W),He(F,`change`,W),(0,Y.useLayoutEffect)(()=>{let e=b.current;if(!e||typeof ResizeObserver>`u`)return;let t=new ResizeObserver(()=>{let t=e.clientWidth;t&&w(e=>Math.abs(e.w-t)<.5?e:{w:t,h:t*s/o})});return t.observe(e),()=>t.disconnect()},[s,o]),(0,Y.useLayoutEffect)(()=>{P.current=C,W()},[C,W]),(0,Y.useEffect)(()=>{if(S){F.jump(1);let e=requestAnimationFrame(()=>O(!0));return()=>cancelAnimationFrame(e)}if(!x)return;let e=y(F,1,{...bt,onComplete:()=>O(!0)});return()=>e.stop()},[F,x,S]),(0,Y.useEffect)(()=>{let e=N.current;if(e===h)return;if(S){N.current=h,W();return}let t=[...new Set([...Et,...h.map(([e])=>e)])].sort((e,t)=>e-t),n=t.map(t=>Ot(e,t)),r=t.map(e=>Ot(h,e)),i=y(0,1,{...J.spring.smooth,onUpdate:e=>{N.current=t.map((t,i)=>[t,n[i]+(r[i]-n[i])*e]),W()},onComplete:()=>{N.current=h,W()}});return()=>i.stop()},[W,S,h]),(0,Y.useEffect)(()=>{let e=k===null?1:k/p;if(S){I.jump(e);return}let t=y(I,e,J.spring.snappy);return()=>t.stop()},[I,k,p,S]);let G=k!==null,ne=(e=>l?l(f[e],e):yt.format(f[e]))(k??p),re=c?.[k??p],ie=n===void 0?void 0:G?ne:n,ae=k===null?r??``:n===void 0?[ne,re].filter(Boolean).join(` · `):re??`${k+1} of ${p+1}`,oe=e=>{let t=b.current?.getBoundingClientRect();return t?.width?Math.max(0,Math.min(p,Math.round((e-t.left)/t.width*p))):p},se=d?{role:`slider`,tabIndex:0,"aria-label":`${t}, explore values`,"aria-valuemin":1,"aria-valuemax":p+1,"aria-valuenow":(k??p)+1,"aria-valuetext":`${re??(k===null?`Latest`:`Point ${k+1} of ${p+1}`)}: ${ne}`,onPointerDown:e=>E(oe(e.clientX)),onPointerMove:e=>{(e.pointerType===`mouse`||e.buttons)&&E(oe(e.clientX))},onPointerUp:e=>{e.pointerType!==`mouse`&&E(null)},onPointerLeave:()=>E(null),onPointerCancel:()=>E(null),onBlur:()=>E(null),onKeyDown:e=>{if(e.key===`Escape`&&G){e.preventDefault(),E(null);return}let t=k??p,n=Math.max(1,Math.round((p+1)/6)),r={ArrowLeft:t-1,ArrowDown:t-1,ArrowRight:t+1,ArrowUp:t+1,PageDown:t-n,PageUp:t+n,Home:0,End:p}[e.key];r!==void 0&&(e.preventDefault(),E(Math.max(0,Math.min(p,r))))}}:{};return(0,Z.jsxs)(`figure`,{ref:v,className:Q.figure,"aria-label":g,children:[(0,Z.jsxs)(`figcaption`,{className:Q.caption,children:[(0,Z.jsx)(`span`,{className:Q.label,children:(0,Z.jsx)(Ct,{text:t,whole:!0})}),ie!==void 0&&(0,Z.jsx)(`strong`,{children:(0,Z.jsx)(Ct,{text:ie,morph:!0})}),(0,Z.jsx)(`small`,{className:Q[a],children:(0,Z.jsx)(Ct,{text:ae,direction:G?A.direction:void 0,tone:G?Q.point:void 0,morph:!0})})]}),(0,Z.jsx)(`div`,{ref:b,className:Q.plot,"data-interactive":d||void 0,...se,children:(0,Z.jsxs)(`svg`,{className:Q.chart,viewBox:`0 0 ${C.w} ${C.h}`,"aria-hidden":`true`,focusable:`false`,children:[(0,Z.jsxs)(`defs`,{children:[(0,Z.jsx)(`clipPath`,{id:`${_}-lit`,clipPathUnits:`userSpaceOnUse`,children:(0,Z.jsx)(q.rect,{x:-16,y:-16,width:V,height:C.h+32})}),(0,Z.jsx)(`clipPath`,{id:`${_}-dim`,clipPathUnits:`userSpaceOnUse`,children:(0,Z.jsx)(q.rect,{x:H,y:-16,width:C.w+32,height:C.h+32})}),(0,Z.jsx)(`clipPath`,{id:`${_}-fill`,clipPathUnits:`userSpaceOnUse`,children:(0,Z.jsx)(q.rect,{x:-16,y:-16,width:U,height:C.h+32})})]}),u&&(0,Z.jsx)(q.path,{className:`${Q.area} ${Q[a]}`,d:R,clipPath:`url(#${_}-fill)`}),(0,Z.jsx)(`line`,{className:Q.baseline,x1:`0`,y1:C.h-.5,x2:C.w,y2:C.h-.5}),(0,Z.jsx)(q.path,{className:Q.trail,d:L,clipPath:`url(#${_}-dim)`,initial:!1,animate:{opacity:G&&D?1:0},transition:S?{duration:0}:xt}),(0,Z.jsx)(q.polyline,{className:[Q.line,Q[a]].join(` `),points:ee,clipPath:`url(#${_}-lit)`,style:{pathLength:F,opacity:te}}),(0,Z.jsx)(q.line,{className:Q.cursor,x1:B,x2:B,y1:0,y2:C.h,initial:!1,animate:{opacity:+!!G},transition:S?{duration:0}:xt}),(0,Z.jsx)(q.polyline,{className:[Q.end,Q[a]].join(` `),points:z,initial:!1,animate:{opacity:+!!D,strokeWidth:D?G?10:7:0},transition:S?{duration:0}:{opacity:xt,strokeWidth:J.spring.snappy},fill:`none`,strokeLinecap:`round`})]})})]})}var $={root:`_root_1cea8_1`,horizontal:`_horizontal_1cea8_3`,list:`_list_1cea8_4`,item:`_item_1cea8_5`,vertical:`_vertical_1cea8_7`,compact:`_compact_1cea8_8`,head:`_head_1cea8_11`,marker:`_marker_1cea8_20`,ring:`_ring_1cea8_21`,disc:`_disc_1cea8_22`,glyph:`_glyph_1cea8_23`,icon:`_icon_1cea8_24`,connector:`_connector_1cea8_31`,fill:`_fill_1cea8_35`,text:`_text_1cea8_40`,label:`_label_1cea8_43`,slot:`_slot_1cea8_47`,slotInner:`_slotInner_1cea8_48`,description:`_description_1cea8_49`,error:`_error_1cea8_49`,caption:`_caption_1cea8_53`,captionLabel:`_captionLabel_1cea8_54`,srOnly:`_srOnly_1cea8_63`},Mt=e=>`blur(${e}px)`,Nt={duration:0},Pt={duration:J.duration.fast,ease:[...J.ease.standard]},Ft={duration:J.duration.standard,ease:[...J.ease.enter]},It={opacity:0,y:`0.3em`,filter:Mt(J.blur.soft)},Lt={opacity:1,y:0,filter:Mt(0)},Rt={opacity:0,y:`-0.3em`,filter:Mt(J.blur.subtle)},zt={opacity:0,scale:.5,filter:Mt(J.blur.subtle)},Bt={opacity:1,scale:1,filter:Mt(0)};function Vt({text:e,className:t,reduced:n}){let r=(0,Y.useRef)(null),i=(0,Y.useRef)(0),o=K(`auto`);return(0,Y.useLayoutEffect)(()=>{i.current=performance.now()+700},[e]),(0,Y.useEffect)(()=>{let e=r.current,t=e?.parentElement;if(!e||!t||typeof ResizeObserver>`u`)return;let a=!1,s=new ResizeObserver(()=>{let t=e.offsetHeight;if(!a||n||performance.now()>i.current){a=!0,o.jump(t);return}y(o,t,J.spring.smooth)});return s.observe(e),()=>s.disconnect()},[o,n]),(0,Z.jsx)(q.span,{className:$.slot,style:{height:o},children:(0,Z.jsx)(`span`,{ref:r,className:$.slotInner,children:(0,Z.jsx)(a,{mode:`popLayout`,initial:!1,children:e?(0,Z.jsx)(q.span,{className:t,initial:It,animate:Lt,exit:{...Rt,transition:n?Nt:Pt},transition:n?Nt:Ft,children:e},`${t}:${e}`):null})})})}function Ht({kind:e,number:t,delay:n,reduced:r}){let i=r?Nt:{scale:{...J.spring.snappy,delay:n},opacity:{duration:J.duration.fast,delay:n},filter:{duration:J.duration.fast,delay:n}},a={...zt,transition:r?Nt:Pt},o=r?Nt:{duration:J.duration.standard,ease:J.ease.enter,delay:n+.04};return e===`number`?(0,Z.jsx)(q.span,{className:$.glyph,initial:zt,animate:Bt,exit:a,transition:i,children:t}):(0,Z.jsx)(q.svg,{className:`${$.glyph} ${$.icon}`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:2.5,strokeLinecap:`round`,strokeLinejoin:`round`,initial:zt,animate:Bt,exit:a,transition:i,children:e===`check`?(0,Z.jsx)(q.path,{d:`M5.5 12.5l4.25 4.25L18.5 8`,initial:{pathLength:0},animate:{pathLength:1},transition:o}):(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(q.path,{d:`M12 6.75v6.5`,initial:{pathLength:0},animate:{pathLength:1},transition:o}),(0,Z.jsx)(q.circle,{cx:12,cy:17.4,r:1.4,fill:`currentColor`,stroke:`none`,initial:{scale:0},animate:{scale:1},transition:r?Nt:{...J.spring.snappy,delay:n+.16}})]})})}function Ut({number:e,kind:t,current:n,glyphDelay:r,ringDelay:i,reduced:o}){return(0,Z.jsxs)(`span`,{className:$.marker,"aria-hidden":`true`,children:[(0,Z.jsx)(a,{initial:!1,children:n?(0,Z.jsx)(q.span,{className:$.ring,initial:{opacity:0,scale:.6},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.6,transition:o?Nt:Pt},transition:o?Nt:{scale:{...J.spring.snappy,delay:i},opacity:{duration:J.duration.fast,delay:i}}},`ring`):null}),(0,Z.jsx)(`span`,{className:$.disc,children:(0,Z.jsx)(a,{initial:!1,children:(0,Z.jsx)(Ht,{kind:t,number:e,delay:r,reduced:o},t)})})]})}var Wt={complete:`Completed`,current:``,upcoming:`Not started`,error:`Error`};function Gt({steps:e,current:t,orientation:n=`horizontal`,onStepSelect:r,details:a=`all`,compact:o=!1,label:s=`Progress`,completeLabel:c=`All steps complete`,className:l}){let u=i()??!1,d=e.length,f=Math.min(Math.max(Math.round(t),0),d),[p,m]=(0,Y.useState)({to:f,from:f});p.to!==f&&m({to:f,from:p.to});let h=p.from,g=J.stagger.line,_=e=>u?0:f>h?e>=h&&e<f?(e-h)*g:0:e>=f&&e<h?(h-1-e)*g:0,v=u?0:Math.max(0,Math.abs(f-h)-1)*g+.12,y=!!r,b=n===`vertical`,x=f>=d?void 0:e[f];function S(e){let t=!b&&getComputedStyle(e.currentTarget).direction===`rtl`,n=[`ArrowUp`,t?`ArrowRight`:`ArrowLeft`],r=[`ArrowDown`,t?`ArrowLeft`:`ArrowRight`];if(![...n,...r,`Home`,`End`].includes(e.key))return;let i=Array.from(e.currentTarget.querySelectorAll(`button[data-reachable]`)),a=i.indexOf(e.target);a<0||(e.preventDefault(),i[e.key===`Home`?0:e.key===`End`?i.length-1:n.includes(e.key)?Math.max(0,a-1):Math.min(i.length-1,a+1)]?.focus())}let C=y?`nav`:`div`,w=[$.root,b?$.vertical:$.horizontal,o?$.compact:``,l].filter(Boolean).join(` `);return(0,Z.jsxs)(C,{className:w,"aria-label":s,role:y?void 0:`group`,children:[(0,Z.jsx)(`ol`,{className:$.list,style:b?void 0:{gridTemplateColumns:d>1?`repeat(${d-1}, minmax(0, 1fr)) auto`:`auto`},onKeyDown:y?S:void 0,children:e.map((e,t)=>{let i=t===f,o=e.error?`error`:t<f?`complete`:i?`current`:`upcoming`,s=y&&t<f,c=e.error??(a===`all`||i?e.description:void 0),l=e.error?`error`:t<f?`check`:`number`,p=(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(Ut,{number:t+1,kind:l,current:i,glyphDelay:_(t),ringDelay:v,reduced:u}),(0,Z.jsxs)(`span`,{className:$.text,children:[(0,Z.jsx)(`span`,{className:$.label,children:e.label}),Wt[o]?(0,Z.jsxs)(`span`,{className:$.srOnly,children:[`, `,Wt[o]]}):null,(0,Z.jsx)(Vt,{text:c,className:e.error?$.error:$.description,reduced:u})]})]});return(0,Z.jsxs)(`li`,{className:$.item,"data-status":o,children:[t<d-1?(0,Z.jsx)(`span`,{className:$.connector,"aria-hidden":`true`,children:(0,Z.jsx)(q.span,{className:$.fill,initial:!1,animate:b?{scaleY:+(t<f)}:{scaleX:+(t<f)},transition:u?Nt:{...J.spring.smooth,delay:_(t)}},n)}):null,y?(0,Z.jsx)(`button`,{type:`button`,className:$.head,"data-clickable":s||void 0,"data-reachable":t<=f||void 0,"aria-current":i?`step`:void 0,"aria-disabled":!s||void 0,tabIndex:s?void 0:-1,onClick:s?()=>r?.(t):void 0,children:p}):(0,Z.jsx)(`span`,{className:$.head,"aria-current":i?`step`:void 0,children:p})]},e.id)})}),b?null:(0,Z.jsxs)(`span`,{className:$.caption,"aria-hidden":`true`,children:[(0,Z.jsx)(Vt,{text:x?.label??c,className:$.captionLabel,reduced:u}),(0,Z.jsx)(Vt,{text:x?.error??x?.description,className:x?.error?$.error:$.description,reduced:u})]}),(0,Z.jsx)(`span`,{className:$.srOnly,"aria-live":`polite`,children:x?`Step ${f+1} of ${d}: ${x.label}`:c})]})}var Kt={"openai-chat":`Chat`,"openai-responses":`Responses`,anthropic:`Anthropic`,gemini:`Gemini`},qt={new:`green`,same:`neutral`,sameHost:`orange`,off:`neutral`,skip:`red`},Jt=e=>`${e.source}\u0000${e.ref}`,Yt=e=>e.status!==`skip`&&e.status!==`same`;function Xt(e){try{return new URL(e).host}catch{return e}}function Zt({open:e,onOpenChange:t}){let{t:n}=S(),{toast:i}=r(),a=g(e),o=m(),[s,c]=(0,Y.useState)(``),[l,u]=(0,Y.useState)(new Set),[d,f]=(0,Y.useState)(null);(0,Y.useEffect)(()=>{a.data&&u(new Set(a.data.flatMap(e=>e.items).filter(e=>e.status===`new`).map(Jt)))},[a.data]),(0,Y.useEffect)(()=>{e&&(c(``),f(null))},[e]);let p=s.trim().toLowerCase(),h=e=>!p||e.name.toLowerCase().includes(p)||e.endpoints.some(e=>e.baseUrl.toLowerCase().includes(p)),y=(0,Y.useMemo)(()=>(a.data??[]).flatMap(e=>e.items).filter(e=>l.has(Jt(e))&&Yt(e)),[a.data,l]),b=(e,t)=>u(n=>{let r=new Set(n);return t?r.add(Jt(e)):r.delete(Jt(e)),r});return(0,Z.jsx)(me,{open:e,onOpenChange:t,width:680,title:n(`import.title`),description:n(`import.detail`),footer:(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(_,{icon:(0,Z.jsx)(Ee,{className:`size-3.5`}),onClick:()=>void a.refetch(),disabled:a.isFetching||o.isPending,children:n(`import.rescan`)}),(0,Z.jsx)(_,{variant:`primary`,disabled:y.length===0||o.isPending,onClick:()=>{f(null),o.mutate(y.map(e=>({source:e.source,ref:e.ref})),{onSuccess:e=>{let r=e.skipped.length;i(r>0?n(`import.doneSkipped`,{count:e.added.length,skipped:r}):n(`import.done`,{count:e.added.length})),t(!1)},onError:e=>{f(v(e)),a.refetch()}})},children:n(`import.selected`,{count:y.length})})]}),children:(0,Z.jsxs)(`div`,{className:`grid gap-4`,children:[(0,Z.jsx)(U,{value:s,onChange:c,placeholder:n(`import.search`)}),d&&(0,Z.jsx)(E,{tone:`danger`,title:n(`common.error`),children:d}),a.isLoading&&(0,Z.jsx)(R,{lines:3}),a.isError&&(0,Z.jsx)(E,{tone:`danger`,title:n(`common.error`),children:v(a.error)}),(0,Z.jsx)(`div`,{className:`grid max-h-[460px] gap-4 overflow-auto pr-1`,children:a.data?.map(e=>(0,Z.jsx)(Qt,{source:e,matches:h,selected:l,onToggle:b,filtering:p.length>0},e.id))}),(0,Z.jsx)(`p`,{className:`text-[11px] text-[var(--text-muted)]`,children:n(`import.footnote`)})]})})}function Qt({source:e,matches:t,selected:n,onToggle:r,filtering:i}){let{t:a}=S(),o=e.items.filter(t);return(0,Z.jsxs)(`section`,{"aria-label":e.name,children:[(0,Z.jsxs)(`div`,{className:`mb-1.5 flex flex-wrap items-baseline gap-x-2 px-1`,children:[(0,Z.jsx)(`h3`,{className:`text-[13px] font-medium`,children:e.name}),e.path&&(0,Z.jsx)(`span`,{className:`min-w-0 truncate font-mono text-[11px] text-[var(--text-muted)]`,title:a(`import.path`,{path:e.path}),children:e.path})]}),e.error?(0,Z.jsx)(E,{tone:`danger`,title:a(`import.sourceError`,{error:e.error})}):e.found?o.length===0?(0,Z.jsx)(`p`,{className:`px-1 text-[12px] text-[var(--text-muted)]`,children:a(i?`import.noMatch`:`import.noItems`)}):(0,Z.jsx)(`ul`,{className:`card divide-y divide-[var(--border)]`,children:o.map(e=>(0,Z.jsx)($t,{c:e,checked:n.has(Jt(e)),onToggle:t=>r(e,t)},Jt(e)))}):(0,Z.jsx)(`p`,{className:`px-1 text-[12px] text-[var(--text-muted)]`,children:a(`import.notFound`)})]})}function $t({c:e,checked:t,onToggle:n}){let{t:r}=S(),i=Yt(e),a=e.status===`skip`&&e.skipReason?r(`import.skip.${e.skipReason}`):e.status===`same`&&e.existing?r(`import.existing`,{name:e.existing.name}):e.status===`sameHost`&&e.existing?r(`import.sameHostHint`,{name:e.existing.name}):null,o=e.endpoints.map(e=>`${Kt[e.protocol]??e.protocol} · ${Xt(e.baseUrl)}`).join(` / `);return(0,Z.jsxs)(`li`,{className:w(`flex items-start gap-3 px-4 py-3`,!i&&`opacity-60`),children:[(0,Z.jsx)(we,{checked:t&&i,disabled:!i,onCheckedChange:e=>n(e===!0),"aria-label":e.name}),(0,Z.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,Z.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,Z.jsx)(`span`,{className:`min-w-0 truncate text-[13px] font-medium`,title:e.name,children:e.name}),(0,Z.jsx)(D,{tone:qt[e.status],children:r(`import.status.${e.status}`)}),e.fromApp&&(0,Z.jsx)(`span`,{className:`text-[11px] text-[var(--text-muted)]`,children:e.fromApp})]}),o&&(0,Z.jsx)(`div`,{className:`mt-0.5 truncate font-mono text-[11px] text-[var(--text-muted)]`,title:o,children:o}),(0,Z.jsxs)(`div`,{className:`mt-0.5 flex flex-wrap gap-x-3 text-[11px] text-[var(--text-muted)]`,children:[(0,Z.jsx)(`span`,{className:`font-mono`,children:e.hasKey?e.keyMasked??`••••`:r(`import.noKey`)}),e.models.length>0&&(0,Z.jsx)(`span`,{children:r(`import.models`,{count:e.models.length})}),e.templateId&&(0,Z.jsx)(`span`,{children:r(`import.template`,{id:e.templateId})})]}),a&&(0,Z.jsx)(`div`,{className:`mt-1 text-[11px] text-[var(--text-secondary,var(--text-muted))]`,children:a}),e.ignoredFields.length>0&&(0,Z.jsx)(`div`,{className:`mt-1 text-[11px] text-[var(--warning)]`,children:r(`import.ignored`,{fields:e.ignoredFields.join(`, `)})})]})]})}var en=``,tn=`custom`,nn=[{name:`userId`,secret:!1,required:!1},{name:`accessToken`,secret:!0,required:!1}],rn={method:`GET`,url:`{{baseUrl}}/user/balance`,auth:`provider`,headers:{}},an={isValid:`is_active`,remaining:`balance`,unit:{$const:`USD`}},on=e=>JSON.stringify(e??{},null,2);function sn(e){return{enabled:e.enabled,template:e.template??en,intervalMinutes:e.intervalMinutes??null,timeoutSec:e.timeoutSec,baseUrl:e.baseUrl??``,params:{...e.params},secrets:{},method:e.request?.method??`GET`,url:e.request?.url??``,auth:e.request?.auth??`provider`,headers:on(e.request?.headers),extract:e.extract?on(e.extract):``}}function cn(e){try{let t=JSON.parse(e||`{}`);return t&&typeof t==`object`&&!Array.isArray(t)?t:null}catch{return null}}function ln({provider:t}){let{t:n}=S(),{toast:i}=r(),a=G(),s=H(t.id),c=p(t.id),l=o(),u=t.quotaConfig,d=(0,Y.useMemo)(()=>sn(u),[u]),[f,m]=(0,Y.useState)(d),[h,g]=(0,Y.useState)(null);(0,Y.useEffect)(()=>m(d),[d]);let y=a.data??[],b=y.find(e=>e.id===u.suggestedTemplate),x=f.template===en?b:y.find(e=>e.id===f.template),C=f.template===tn,w=C?nn:x?.params??[],T=e=>m(t=>({...t,...e})),D=JSON.stringify(f)!==JSON.stringify(d),O=e=>{if(e!==tn||f.url)return T({template:e});let t=x??b;T({template:e,method:t?.request.method??rn.method,url:t?.request.url??rn.url,auth:t?.request.auth??rn.auth,headers:on(t?.request.headers??rn.headers),extract:on(t?.extract??an)})},k=()=>{let e={enabled:f.enabled,template:f.template===en?null:f.template,intervalMinutes:f.intervalMinutes,timeoutSec:f.timeoutSec??10,baseUrl:f.baseUrl.trim()||null,params:Object.fromEntries(Object.entries(f.params).filter(([,e])=>e.trim()!==``).map(([e,t])=>[e,t.trim()])),secrets:Object.fromEntries(Object.entries(f.secrets).filter(([,e])=>e.trim()!==``))};if(C){let t=cn(f.headers),r=cn(f.extract);if(!t||!r)return i(n(`providers.quota.invalidJson`,{field:n(t?`providers.quota.extract`:`providers.quota.headers`)}),`error`),null;e.request={method:f.method,url:f.url.trim(),auth:f.auth,headers:t},e.extract=r}return e},M=()=>{let e=k();if(!e)return;let r=e.enabled&&!u.enabled;s.mutate(e,{onSuccess:()=>{i(n(`common.saved`),`success`),r&&l.mutate(t.id,{onError:e=>i(v(e),`error`)})},onError:e=>i(v(e),`error`)})},N=()=>{let e=k();e&&c.mutate(e,{onSuccess:g,onError:e=>i(v(e),`error`)})},P=u.effectiveIntervalMinutes>0?n(`providers.quota.intervalEvery`,{minutes:u.effectiveIntervalMinutes}):n(`providers.quota.intervalOff`),I=[{value:en,label:b?n(`providers.quota.templateAuto`,{name:b.name}):n(`providers.quota.templateNone`)},...y.map(e=>({value:e.id,label:e.name,detail:n(`providers.quota.kind.${e.kind}`)})),{value:tn,label:n(`providers.quota.custom`)}];return(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsxs)(V,{title:n(`providers.quota.title`),footer:n(`providers.quota.footer`),children:[(0,Z.jsx)(F,{label:n(`providers.quota.enable`),detail:n(`providers.quota.enableHint`),children:(0,Z.jsx)(se,{checked:f.enabled,label:n(`providers.quota.enable`),onChange:e=>T({enabled:e})})}),(0,Z.jsx)(F,{label:n(`providers.quota.template`),children:(0,Z.jsx)(j,{className:`w-64`,ariaLabel:n(`providers.quota.template`),value:f.template,onChange:O,options:I})}),w.map(e=>{let t=n(`providers.quota.param.${e.name}`),r=u.secrets.includes(e.name);return e.secret?(0,Z.jsx)(F,{label:t,detail:r?n(`providers.quota.secretStored`):void 0,children:(0,Z.jsx)(A,{type:`password`,autoComplete:`off`,className:`w-64 font-mono`,"aria-label":t,placeholder:r?`••••••••`:``,value:f.secrets[e.name]??``,onChange:t=>T({secrets:{...f.secrets,[e.name]:t.target.value}})})},e.name):(0,Z.jsx)(F,{label:t,children:(0,Z.jsx)(A,{className:`w-64 font-mono`,"aria-label":t,value:f.params[e.name]??``,onChange:t=>T({params:{...f.params,[e.name]:t.target.value}})})},e.name)}),w.length>0&&(0,Z.jsx)(`div`,{className:`px-4 pb-2 text-[11px] text-[var(--text-muted)]`,children:n(`providers.quota.paramsHint`)}),C&&(0,Z.jsxs)(`div`,{className:`flex flex-col gap-3 px-4 py-3`,children:[(0,Z.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,Z.jsx)(j,{className:`w-28`,ariaLabel:n(`providers.quota.method`),value:f.method,onChange:e=>T({method:e}),options:[{value:`GET`,label:`GET`},{value:`POST`,label:`POST`}]}),(0,Z.jsx)(A,{className:`min-w-60 flex-1 font-mono`,"aria-label":n(`providers.quota.url`),value:f.url,onChange:e=>T({url:e.target.value})}),(0,Z.jsx)(j,{className:`w-52`,ariaLabel:n(`providers.quota.auth`),value:f.auth,onChange:e=>T({auth:e}),options:[{value:`provider`,label:n(`providers.quota.auth.provider`)},{value:`none`,label:n(`providers.quota.auth.none`)}]})]}),(0,Z.jsx)(`div`,{className:`text-[11px] text-[var(--text-muted)]`,children:n(`providers.quota.urlHint`)}),(0,Z.jsx)(ne,{label:n(`providers.quota.headers`),mono:!0,rows:3,value:f.headers,onChange:e=>T({headers:e.target.value})}),(0,Z.jsx)(ne,{label:n(`providers.quota.extract`),mono:!0,rows:8,value:f.extract,onChange:e=>T({extract:e.target.value})}),(0,Z.jsx)(`div`,{className:`text-[11px] text-[var(--text-muted)]`,children:n(`providers.quota.extractHint`)})]}),(0,Z.jsx)(F,{label:n(`providers.quota.interval`),detail:n(`providers.quota.intervalHint`,{value:P}),children:(0,Z.jsx)(de,{className:`w-28`,label:n(`providers.quota.interval`),min:0,step:1,value:f.intervalMinutes,onChange:e=>T({intervalMinutes:e})})}),(0,Z.jsx)(F,{label:n(`providers.quota.timeout`),children:(0,Z.jsx)(de,{className:`w-28`,label:n(`providers.quota.timeout`),min:1,step:1,value:f.timeoutSec,onChange:e=>T({timeoutSec:e})})}),(0,Z.jsx)(F,{label:n(`providers.quota.baseUrl`),detail:n(`providers.quota.baseUrlHint`),children:(0,Z.jsx)(A,{className:`w-64 font-mono`,"aria-label":n(`providers.quota.baseUrl`),placeholder:t.endpoints[0]?.baseUrl,value:f.baseUrl,onChange:e=>T({baseUrl:e.target.value})})}),(0,Z.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2 px-4 py-3`,children:[(0,Z.jsx)(_,{size:`sm`,variant:`primary`,disabled:!D,loading:s.isPending,onClick:M,children:n(`common.save`)}),(0,Z.jsx)(_,{size:`sm`,icon:(0,Z.jsx)(Ke,{className:`size-3.5`}),loading:c.isPending,onClick:N,title:n(`providers.quota.testDesc`),children:n(`providers.quota.test`)}),(0,Z.jsx)(_,{size:`sm`,icon:(0,Z.jsx)(Je,{className:`size-3.5`}),disabled:D,loading:l.isPending,onClick:()=>l.mutate(t.id,{onError:e=>i(v(e),`error`)}),children:n(`providers.quota.fetch`)})]}),(0,Z.jsx)(`div`,{className:`px-4 pb-4`,children:(0,Z.jsx)(un,{snapshot:t.quota,checkedAtUtc:t.quotaCheckedAtUtc})})]}),(0,Z.jsx)(me,{open:h!==null,onOpenChange:e=>!e&&g(null),title:n(`providers.quota.test`),description:n(`providers.quota.testDesc`),width:560,children:h&&(0,Z.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,Z.jsxs)(E,{tone:h.ok?`success`:`danger`,title:h.ok?n(`providers.quota.testOk`):n(`providers.quota.testFailed`),children:[!h.ok&&Ve({code:h.errorCode??null,message:h.error??``},n),!h.ok&&h.error&&h.errorCode&&(0,Z.jsx)(`div`,{className:`mt-1 text-[11px] opacity-80`,children:h.error})]}),h.url&&(0,Z.jsx)(ie,{label:n(`providers.quota.requestUrl`),mono:!0,children:h.url}),h.httpStatus!=null&&(0,Z.jsx)(ie,{label:n(`providers.quota.httpStatus`),children:h.httpStatus}),h.snapshot&&(0,Z.jsxs)(`div`,{children:[(0,Z.jsx)(`div`,{className:`mb-1 text-[12px] text-[var(--text-secondary)]`,children:n(`providers.quota.extracted`)}),(0,Z.jsx)(un,{snapshot:h.snapshot})]}),h.raw!==void 0&&h.raw!==null&&(0,Z.jsxs)(`div`,{children:[(0,Z.jsx)(`div`,{className:`mb-1 text-[12px] text-[var(--text-secondary)]`,children:n(`providers.quota.rawResponse`)}),(0,Z.jsx)(e,{children:on(h.raw)})]})]})})]})}function un({snapshot:e,checkedAtUtc:t}){let{t:n,locale:r}=S(),i=Re(e),a=e?.plans??[],o=e?.fetchedAtUtc?new Date(e.fetchedAtUtc).getTime():0;return!e&&!t?(0,Z.jsx)(`div`,{className:`text-[12px] text-[var(--text-muted)]`,children:n(`providers.quota.never`)}):(0,Z.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[i&&(0,Z.jsxs)(E,{tone:`warning`,title:n(`providers.quota.failed`,{error:Ve(i,n)}),children:[(0,Z.jsx)(`span`,{className:`text-[11px]`,children:i.message}),a.length>0&&(0,Z.jsx)(`div`,{className:`mt-1 text-[11px]`,children:n(`providers.quota.lastGood`)})]}),e?.isValid===!1&&(0,Z.jsx)(E,{tone:`warning`,title:n(`providers.quota.invalid`),children:e.invalidMessage}),a.length>0&&(0,Z.jsx)(`div`,{className:`flex flex-col gap-1`,children:a.map((e,t)=>(0,Z.jsxs)(`div`,{className:`flex flex-wrap items-baseline gap-x-2 text-[13px]`,children:[e.name&&(0,Z.jsx)(D,{children:e.name}),(0,Z.jsx)(`span`,{className:`num`,children:ze(e,n,r)??`—`}),Le(e,n,r)&&(0,Z.jsx)(`span`,{className:`text-[11px] text-[var(--text-muted)]`,children:Le(e,n,r)}),e.extra&&(0,Z.jsx)(`span`,{className:`text-[11px] text-[var(--text-muted)]`,children:e.extra})]},t))}),(0,Z.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2 text-[11px] text-[var(--text-muted)]`,children:[e?.planLabel&&(0,Z.jsx)(D,{tone:`accent`,children:e.planLabel}),o>0&&(0,Z.jsx)(`span`,{children:n(`providers.quota.fetchedAt`,{time:Ie(o,r,n(`tray.justNow`))??``})})]})]})}function dn({provider:e}){let{t,locale:n}=S(),{toast:i}=r(),a=o();if(!Fe(e))return null;let s=Be(e.quota,t,n),c=Re(e.quota);return(0,Z.jsxs)(`div`,{className:`mt-3 flex min-w-0 items-center gap-2 text-[12px]`,children:[(0,Z.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[s&&(0,Z.jsx)(`div`,{className:`num truncate text-[var(--text-secondary)]`,title:s,children:s}),c&&(0,Z.jsx)(`div`,{className:`truncate text-[var(--warning)]`,title:c.message,children:t(`providers.quota.failed`,{error:Ve(c,t)})}),!s&&!c&&(0,Z.jsx)(`div`,{className:`text-[var(--text-muted)]`,children:t(`providers.quota.never`)})]}),(0,Z.jsx)(_,{size:`sm`,variant:`plain`,icon:(0,Z.jsx)(Je,{className:`size-3.5`}),"aria-label":t(`providers.quota.refresh`),title:t(`providers.quota.refresh`),loading:a.isPending,onClick:()=>a.mutate(e.id,{onError:e=>i(v(e),`error`)})})]})}var fn=[{value:`openai-chat`,label:`OpenAI Chat`},{value:`openai-responses`,label:`OpenAI Responses`},{value:`anthropic`,label:`Anthropic Messages`},{value:`gemini`,label:`Gemini`}],pn=[{value:`bearer`,label:`Authorization: Bearer`},{value:`x-api-key`,label:`x-api-key`},{value:`x-goog-api-key`,label:`x-goog-api-key`},{value:`query-key`,label:`?key=`},{value:`none`,label:`—`},{value:`oauth-subscription`,label:`OAuth 订阅`}];function mn(){let{t:e}=S(),t=ve(),[n,r]=ge(),i=oe(),[a,o]=(0,Y.useState)(n.get(`new`)===`1`),[s,c]=(0,Y.useState)(!1);(0,Y.useEffect)(()=>{n.get(`new`)===`1`&&(o(!0),n.delete(`new`),r(n,{replace:!0}))},[n,r]),ye(e=>{e===`new-provider`&&o(!0)});let l=le(`7d`,`day`,`provider`),[u,d]=(0,Y.useState)(null),f=(0,Y.useMemo)(()=>{let e=gn(hn),t=new Map;for(let n of l.data??[]){let r=e.indexOf(n.bucket);if(r<0)continue;let i=t.get(n.key);i||t.set(n.key,i={requests:e.map(()=>0),costUsd:0}),i.requests[r]=(i.requests[r]??0)+n.requests,i.costUsd+=n.costUsd}return{days:e,byProvider:t}},[l.data]);return(0,Z.jsxs)(Se,{title:e(`nav.providers`),subtitle:i.data?e(`providers.count`,{count:i.data.length}):void 0,actions:(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(_,{icon:(0,Z.jsx)(Te,{className:`size-3.5`}),onClick:()=>c(!0),children:e(`providers.import`)}),(0,Z.jsx)(_,{variant:`primary`,icon:(0,Z.jsx)(xe,{className:`size-3.5`}),onClick:()=>o(!0),children:e(`providers.add`)})]}),children:[(0,Z.jsxs)(`div`,{className:`mx-auto max-w-[1100px]`,children:[i.isLoading&&(0,Z.jsx)(R,{lines:4}),i.isError&&(0,Z.jsx)(E,{tone:`danger`,title:e(`common.error`),children:v(i.error)}),i.data?.length===0&&(0,Z.jsx)(`div`,{className:`card`,children:(0,Z.jsx)(re,{icon:(0,Z.jsx)(_e,{className:`size-6`}),title:e(`providers.empty`),detail:e(`providers.emptyDetail`),action:(0,Z.jsxs)(`div`,{className:`flex flex-wrap items-center justify-center gap-2`,children:[(0,Z.jsx)(_,{variant:`primary`,icon:(0,Z.jsx)(xe,{className:`size-3.5`}),onClick:()=>o(!0),children:e(`providers.add`)}),(0,Z.jsx)(_,{icon:(0,Z.jsx)(Te,{className:`size-3.5`}),onClick:()=>c(!0),children:e(`providers.import`)})]})})}),i.data&&i.data.length>0&&(0,Z.jsx)(`div`,{className:`grid grid-cols-[repeat(auto-fill,minmax(min(100%,260px),1fr))] gap-3`,children:i.data.map(e=>(0,Z.jsx)(yn,{p:e,days:f.days,usage:f.byProvider.get(e.name),onOpen:()=>t(`/providers/${e.id}`),onTest:()=>d(e)},e.id))})]}),(0,Z.jsx)(Zt,{open:s,onOpenChange:c}),(0,Z.jsx)(Sn,{open:a,onOpenChange:o,onCreated:e=>t(`/providers/${e.id}`)}),u&&(0,Z.jsx)(An,{provider:u,open:!0,onOpenChange:e=>!e&&d(null)})]})}var hn=7;function gn(e){let t=new Date;return Array.from({length:e},(n,r)=>{let i=new Date(t.getFullYear(),t.getMonth(),t.getDate()-(e-1-r));return`${i.getFullYear()}-${String(i.getMonth()+1).padStart(2,`0`)}-${String(i.getDate()).padStart(2,`0`)}`})}function _n(e){if(!e)return null;try{return new URL(e).host}catch{return e}}var vn=e=>e.stopPropagation();function yn({p:e,days:n,usage:i,onOpen:a,onTest:o}){let{t:s}=S(),c=t(e.id),{toast:l}=r(),u=[...new Set(e.endpoints.map(e=>e.protocol))],d=!e.hasApiKey&&e.authScheme!==`none`&&e.authScheme!==`oauth-subscription`&&e.authScheme!==`plugin`,f=[e.priceKey?s(`providers.priceKeyShort`,{key:e.priceKey}):null,e.priceMultiplier===1?null:`×${e.priceMultiplier}`].filter(Boolean).join(` · `),p=e.authScheme===`plugin`?s(`providers.card.plugin`):e.authScheme===`oauth-subscription`?s(`providers.card.subscription`):e.authScheme===`none`?s(`providers.card.noAuth`):e.hasApiKey?e.apiKeyMasked??`••••`:s(`providers.noKey`),m=e.enabled?d?{tone:`orange`,label:s(`providers.noKey`)}:{tone:`green`,label:s(`providers.card.active`)}:{tone:`neutral`,label:s(`providers.card.disabled`)},h=i?.requests??n.map(()=>0),g=h.reduce((e,t)=>e+t,0),y=e.templateUpdateAvailable?5:8;return(0,Z.jsxs)(ht,{className:`flex flex-col [&>div:first-child>div]:min-h-0! [&>div:last-child]:flex [&>div:last-child]:flex-1 [&>div:last-child]:flex-col [&>div:last-child]:p-3 [&>div:last-child>:last-child]:mt-auto! [&>div:last-child>:last-child]:min-h-[44px] [&>div:last-child>:last-child]:pt-2 [&>div:last-child>h3]:line-clamp-1 [&>div:last-child>h3]:text-[15px] [&>div:last-child>p]:line-clamp-2 [&>div:last-child>p]:min-h-[2lh] [&>div:last-child>p]:text-[12px]`,"data-density":`compact`,role:`button`,tabIndex:0,"aria-label":e.name,onClick:a,onKeyDown:e=>{e.target===e.currentTarget&&(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),a())},style:{backgroundColor:`var(--surface)`},title:e.name,description:u.map(e=>fn.find(t=>t.value===e)?.label??e).join(` / `),media:(0,Z.jsxs)(`div`,{className:`flex flex-col justify-between gap-1.5 self-stretch justify-self-stretch px-3 py-2.5`,style:{background:`linear-gradient(135deg, color-mix(in oklab, var(--accent) 12%, transparent), transparent 70%)`},children:[(0,Z.jsxs)(`div`,{className:`flex items-start justify-between gap-2`,children:[(0,Z.jsx)(`span`,{className:w(`transition-[filter,opacity]`,!e.enabled&&`opacity-50 grayscale`),children:(0,Z.jsx)(Ae,{name:e.name,icon:e.icon,colorKey:e.templateId,size:28})}),(0,Z.jsxs)(`span`,{className:`inline-flex items-center gap-1.5 rounded-full border border-[var(--border)] bg-[color-mix(in_oklab,var(--surface)_80%,transparent)] px-2 py-0.5 text-[11px] text-[var(--text-secondary)]`,children:[(0,Z.jsx)(fe,{tone:m.tone}),m.label]})]}),(0,Z.jsxs)(`div`,{className:`flex items-baseline justify-between gap-3 text-[11px] text-[var(--text-muted)]`,children:[(0,Z.jsx)(`span`,{className:`min-w-0 truncate font-mono`,title:e.endpoints[0]?.baseUrl,children:_n(e.endpoints[0]?.baseUrl)??`—`}),(0,Z.jsx)(`span`,{className:`shrink-0`,children:s(`providers.modelCount`,{count:e.modelCount})})]})]}),meta:(0,Z.jsx)(`span`,{className:w(e.hasApiKey&&e.authScheme!==`oauth-subscription`&&`font-mono`),children:p}),status:f||void 0,action:(0,Z.jsxs)(`div`,{className:`flex items-center gap-1`,onClick:vn,children:[(0,Z.jsx)(_,{variant:`plain`,size:`sm`,icon:(0,Z.jsx)(Ke,{className:`size-3.5`}),"aria-label":s(`providers.test`),title:s(`providers.test`),onClick:o}),(0,Z.jsx)(`span`,{className:`ml-1 inline-flex`,children:(0,Z.jsx)(se,{checked:e.enabled,label:s(`common.enabled`),onChange:e=>c.mutate({enabled:e},{onError:e=>l(v(e),`error`)})})})]}),children:[(0,Z.jsxs)(`div`,{className:`mt-1.5 flex h-5 flex-nowrap items-center gap-1 overflow-hidden`,children:[e.templateUpdateAvailable&&(0,Z.jsx)(D,{tone:`accent`,children:s(`providers.templateUpdate`)}),e.boundClients.slice(0,y).map(e=>e in Me?(0,Z.jsx)(`span`,{title:Oe(e),className:`inline-flex shrink-0`,children:(0,Z.jsx)(je,{kind:e,size:18})},e):(0,Z.jsx)(D,{tone:`green`,children:e},e)),e.boundClients.length>y&&(0,Z.jsxs)(`span`,{title:e.boundClients.slice(y).map(e=>Me[e]?.name??e).join(`, `),className:`shrink-0 text-[11px] text-[var(--text-muted)]`,children:[`+`,e.boundClients.length-y]})]}),(0,Z.jsx)(`div`,{className:`min-h-[32px] [&>div]:mt-1`,onClick:vn,children:(0,Z.jsx)(dn,{provider:e})}),(0,Z.jsx)(`div`,{className:`mt-2`,onClick:vn,children:g>0?(0,Z.jsx)(jt,{label:s(`providers.card.requests7d`),data:h,labels:n.map(e=>e.slice(5)),value:N(g,!0),change:I(i?.costUsd??0),width:320,height:28,formatValue:e=>N(e,!0)}):(0,Z.jsxs)(`div`,{className:`grid gap-2`,children:[(0,Z.jsx)(`div`,{className:`text-[13px] text-[var(--text-secondary)]`,children:s(`providers.card.requests7d`)}),(0,Z.jsx)(`div`,{className:`grid aspect-[320/28] place-items-center border-b border-dashed border-[var(--border)] text-[11px] text-[var(--text-muted)]`,children:s(`providers.card.noRequests`)})]})})]})}var bn=`plugin:`,xn=[`recommended`,`official`,`subscription`,`cn`,`aggregator`,`local`,`custom`];function Sn({open:e,onOpenChange:t,onCreated:n}){let{t:i}=S(),{toast:a}=r(),o=l(),s=k(),c=W(),u=oe(),d=(0,Y.useMemo)(()=>new Set((u.data??[]).filter(e=>e.authScheme===`oauth-subscription`&&e.templateId).map(e=>e.templateId)),[u.data]),f=ve(),[p,m]=(0,Y.useState)(``),[h,g]=(0,Y.useState)(null),[y,b]=(0,Y.useState)(null),[x,C]=(0,Y.useState)(``),[w,T]=(0,Y.useState)(``),[D,O]=(0,Y.useState)(``),[M,N]=(0,Y.useState)(``),[P,F]=(0,Y.useState)(``),[I,ee]=(0,Y.useState)(`openai-chat`),[L,z]=(0,Y.useState)(`bearer`);(0,Y.useEffect)(()=>{e||(g(null),b(null),m(``),C(``),T(``),O(``),N(``),F(``))},[e]);let B=(0,Y.useMemo)(()=>{let e=p.trim().toLowerCase(),t=(o.data??[]).filter(t=>!e||t.name.toLowerCase().includes(e)||t.id.includes(e));return xn.map(e=>({category:e,items:t.filter(t=>t.category===e)})).filter(e=>e.items.length)},[o.data,p]),V=(0,Y.useMemo)(()=>{let e=p.trim().toLowerCase();return(u.data??[]).filter(t=>t.authScheme===`plugin`&&!t.settings.plugin?.absent&&(!e||t.name.toLowerCase().includes(e)||t.id.includes(e)))},[u.data,p]),H=e=>{g(e),e===`custom`?(C(``),N(``),O(``)):(C(e.name),N(e.priceKey??e.id),O(``),z(e.auth.scheme))},te=()=>{let e=h===`custom`;c.mutate({templateId:e?null:h.id,variantId:D||null,name:x.trim()||null,apiKey:w.trim()||null,priceKey:M,...e?{endpoints:[{protocol:I,baseUrl:P.trim()}],authScheme:L}:{}},{onSuccess:e=>{t(!1),a(i(`providers.created`,{name:e.name}),`success`),n(e)},onError:e=>a(v(e),`error`)})},G=h&&h!==`custom`?h:null,ne=()=>{if(y===`custom`)H(`custom`);else if(y?.startsWith(bn)){let e=V.find(e=>bn+e.id===y);e&&(t(!1),n(e))}else{let e=(o.data??[]).find(e=>e.id===y);e&&!d.has(e.id)&&H(e)}},re=h!==null&&(h===`custom`?/^https?:\/\//.test(P.trim())&&x.trim()!==``:!G.requiresApiKey||w.trim()!==``);return(0,Z.jsxs)(me,{open:e,onOpenChange:t,width:640,title:i(h?`providers.addTitleDetails`:`providers.addTitle`),description:h?G?G.name:i(`providers.custom`):i(`providers.addDetail`),footer:h?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(_,{className:`mr-auto`,variant:`plain`,onClick:()=>g(null),children:i(`common.back`)}),(0,Z.jsx)(_,{onClick:()=>t(!1),children:i(`common.cancel`)}),(0,Z.jsx)(_,{variant:`primary`,disabled:!re,loading:c.isPending,onClick:te,children:i(`providers.create`)})]}):(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(_,{onClick:()=>t(!1),children:i(`common.cancel`)}),(0,Z.jsx)(_,{variant:`primary`,disabled:!y,onClick:ne,children:i(`common.continue`)})]}),children:[(0,Z.jsx)(Gt,{className:`mb-6`,label:i(`providers.addTitle`),current:+!!h,steps:[{id:`template`,label:i(`providers.step.template`)},{id:`details`,label:i(`providers.step.details`)}]}),h?(0,Z.jsxs)(`div`,{className:`grid gap-4`,children:[(0,Z.jsx)(ue,{label:i(`providers.name`),children:(0,Z.jsx)(A,{value:x,onChange:e=>C(e.target.value)})}),G?.variants&&G.variants.length>0&&(0,Z.jsx)(ue,{label:i(`providers.variant`),children:(0,Z.jsx)(j,{value:D,onChange:e=>{O(e);let t=G.variants?.find(t=>t.id===e);N(t?.priceKey??G.priceKey??G.id)},options:[{value:``,label:i(`providers.variantDefault`)},...G.variants.map(e=>({value:e.id,label:e.name}))]})}),h===`custom`&&(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(ue,{label:i(`providers.baseUrl`),hint:i(`providers.baseUrlHint`),children:(0,Z.jsx)(A,{value:P,onChange:e=>F(e.target.value),placeholder:`https://api.example.com/v1`,className:`font-mono`})}),(0,Z.jsxs)(`div`,{className:`grid grid-cols-2 gap-3`,children:[(0,Z.jsx)(ue,{label:i(`providers.protocol`),children:(0,Z.jsx)(j,{value:I,onChange:ee,options:fn})}),(0,Z.jsx)(ue,{label:i(`providers.authScheme`),children:(0,Z.jsx)(j,{value:L,onChange:z,options:pn})})]})]}),G?.authScheme===`oauth-subscription`?(0,Z.jsx)(E,{tone:`info`,title:i(`providers.subscriptionWizardHint`),children:i(`providers.subscriptionWizardDetail`)}):(0,Z.jsxs)(`div`,{className:`font-mono`,children:[(0,Z.jsx)(Ne,{label:i(`providers.apiKey`),description:i(`providers.apiKeyHint`),autoComplete:`off`,placeholder:`sk-…`,value:w,onChange:e=>T(e.target.value)}),G?.apiKeyUrl&&(0,Z.jsx)(`a`,{className:`mt-2 inline-block font-sans text-[12px] text-[var(--accent)]`,href:G.apiKeyUrl,target:`_blank`,rel:`noreferrer`,children:i(`providers.getKey`)})]}),(0,Z.jsx)(ue,{label:i(`providers.priceKey`),hint:i(`providers.priceKeyHint`),children:(0,Z.jsx)(j,{value:M,onChange:N,options:[{value:``,label:i(`providers.priceKeyNone`)},...(s.data??[]).map(e=>({value:e.priceKey,label:e.label,detail:e.priceKey}))]})}),G&&G.models.length>0&&(0,Z.jsx)(`p`,{className:`text-[12px] text-[var(--text-secondary)]`,children:i(`providers.templateModels`,{count:G.models.length})})]}):(0,Z.jsxs)(`div`,{className:`flex flex-col gap-5`,children:[(0,Z.jsx)(U,{value:p,onChange:m,placeholder:i(`providers.searchTemplates`)}),o.isLoading&&(0,Z.jsx)(R,{lines:4}),o.isError&&(0,Z.jsx)(E,{tone:`danger`,title:i(`common.error`),children:v(o.error)}),B.map(e=>(0,Z.jsxs)(`section`,{children:[(0,Z.jsx)(`h3`,{className:`mb-2 text-[12px] font-medium text-[var(--text-secondary)]`,children:i(`providers.category.${e.category}`)}),(0,Z.jsx)(Pe,{name:`provider-template`,"aria-label":i(`providers.category.${e.category}`),minColumnWidth:170,value:e.items.some(e=>e.id===y)?y:null,onValueChange:b,options:e.items.map(e=>({value:e.id,label:e.name,description:[...new Set(e.endpoints.map(e=>e.protocol))].join(` · `),icon:(0,Z.jsx)(Ae,{name:e.name,icon:e.icon,colorKey:e.id,size:24}),disabled:d.has(e.id),disabledReason:i(`providers.subscriptionAdded`)}))})]},e.category)),(0,Z.jsxs)(`section`,{children:[(0,Z.jsx)(`h3`,{className:`mb-2 text-[12px] font-medium text-[var(--text-secondary)]`,children:i(`providers.category.plugin`)}),V.length>0?(0,Z.jsx)(Pe,{name:`provider-template-plugin`,"aria-label":i(`providers.category.plugin`),minColumnWidth:170,value:y?.startsWith(bn)?y:null,onValueChange:b,options:V.map(e=>({value:bn+e.id,label:e.name,description:i(`providers.pluginProvided`),icon:(0,Z.jsx)(Ae,{name:e.name,icon:e.icon,colorKey:e.id,size:24})}))}):(0,Z.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3 rounded-[var(--radius-md)] border border-dashed border-[var(--border)] px-3 py-2.5`,children:[(0,Z.jsx)(`p`,{className:`min-w-0 flex-1 text-[12px] text-[var(--text-secondary)]`,children:i(`providers.pluginHint`)}),(0,Z.jsx)(_,{size:`sm`,onClick:()=>{t(!1),f(`/plugins/market`)},children:i(`plugins.browseMarket`)})]})]}),(0,Z.jsxs)(`section`,{children:[(0,Z.jsx)(`h3`,{className:`mb-2 text-[12px] font-medium text-[var(--text-secondary)]`,children:i(`providers.custom`)}),(0,Z.jsx)(Pe,{name:`provider-template-custom`,"aria-label":i(`providers.custom`),layout:`list`,value:y===`custom`?`custom`:null,onValueChange:b,options:[{value:`custom`,label:i(`providers.custom`),description:i(`providers.customDetail`),icon:(0,Z.jsx)(xe,{className:`size-4`})}]})]})]})]})}var Cn=3,wn=256,Tn=4096,En={idle:`providers.testDialog.status.idle`,queued:`providers.testDialog.status.queued`,running:`providers.testDialog.status.running`,success:`providers.testDialog.status.success`,failed:`providers.testDialog.status.failed`,cancelled:`providers.testDialog.status.cancelled`};function Dn(e){let t=e.endpoints.map(e=>e.protocol);return e.preferredUpstreamProtocols.find(e=>t.includes(e))??t[0]??`openai-chat`}var On=e=>typeof e==`number`?e:null,kn=e=>typeof e==`string`?e:null;function An({provider:e,open:t,onOpenChange:n}){let{t:r}=S(),i=ae(),a=L(t?e.id:void 0),o=e.endpoints.map(e=>e.protocol),[s,c]=(0,Y.useState)(`single`),[l,u]=(0,Y.useState)(()=>Dn(e)),[d,f]=(0,Y.useState)(!0),[p,m]=(0,Y.useState)(``),[h,g]=(0,Y.useState)(wn),[v,y]=(0,Y.useState)(``),[b,x]=(0,Y.useState)(null),[C,w]=(0,Y.useState)({}),[T,E]=(0,Y.useState)([]),[D,O]=(0,Y.useState)(new Set),[k,A]=(0,Y.useState)([]),[j,N]=(0,Y.useState)(``),[P,F]=(0,Y.useState)(null),[I,R]=(0,Y.useState)(!1),z=(0,Y.useRef)(null),B=(0,Y.useRef)(new Map),V=(0,Y.useRef)(!1),H=(0,Y.useRef)(!1),U=(0,Y.useMemo)(()=>{let e=[...a.data??[]].sort((e,t)=>Number(t.enabled)-Number(e.enabled)||e.sortOrder-t.sortOrder).map(e=>e.modelId);return[...e,...k.filter(t=>!e.includes(t))]},[a.data,k]);(0,Y.useEffect)(()=>{if(t){y(e=>e||(a.data??[]).find(e=>e.enabled)?.modelId||(a.data??[])[0]?.modelId||``);return}H.current=!1,z.current?.abort();for(let e of B.current.values())e.abort();B.current.clear(),x(null),w({}),E([]),O(new Set),A([]),N(``),F(null)},[t,a.data]);let te=(0,Y.useCallback)(e=>({modelId:e,protocol:l,stream:d,prompt:p.trim()||null,maxOutputTokens:h??wn}),[l,d,p,h]),W=(0,Y.useCallback)((t,n,r)=>zn(e.id,t,te(t),n,r),[e.id,te]),G=()=>{let e=v.trim();if(!e)return;z.current?.abort();let t=new AbortController;z.current=t,H.current=!0,F(null),x({modelId:e,status:`running`,text:``,reasoning:``}),W(e,t.signal,e=>{e.status!==`running`&&e.status!==`queued`&&re(),x(e)})},ne=e=>{if(e.length===0)return;H.current=!0,V.current=!1,F(null),E(e),w(Object.fromEntries(e.map(e=>[e,{modelId:e,status:`queued`,text:``,reasoning:``}])));let t=0;Promise.all(Array.from({length:Math.min(Cn,e.length)},async()=>{for(;;){if(!H.current)return;let n=e[t++];if(n===void 0)return;if(V.current){w(e=>({...e,[n]:{...e[n],status:`cancelled`}}));continue}let r=new AbortController;B.current.set(n,r),await W(n,r.signal,e=>w(t=>({...t,[n]:e}))),B.current.delete(n),re()}}))},re=()=>void i.invalidateQueries({queryKey:[`requests`]}),ie=()=>{V.current=!0,w(e=>Object.fromEntries(Object.entries(e).map(([e,t])=>[e,t.status===`queued`?{...t,status:`cancelled`}:t])))},oe=b?.status===`running`||T.some(e=>C[e]?.status===`running`||C[e]?.status===`queued`&&!V.current),se=T.filter(e=>C[e]&&C[e].status!==`queued`&&C[e].status!==`running`).length,ce=T.filter(e=>C[e]?.status===`success`).length,le=T.filter(e=>C[e]?.status===`failed`).length,de=(e,t)=>O(n=>{let r=new Set(n);return t?r.add(e):r.delete(e),r}),fe=()=>{oe||n(!1)},pe=e=>e.stopPropagation();return(0,Z.jsx)(`span`,{onClick:pe,onKeyDown:pe,children:(0,Z.jsxs)(me,{open:t,onOpenChange:e=>e?n(!0):fe(),width:1040,title:r(`providers.testDialog.title`,{name:e.name}),description:r(`providers.testDialog.subtitle`),footer:(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(`span`,{className:`mr-auto text-[11px] text-[var(--text-muted)]`,children:r(`providers.testDialog.realRequest`)}),(0,Z.jsx)(_,{disabled:oe,onClick:()=>n(!1),icon:(0,Z.jsx)(M,{className:`size-3.5`}),children:r(`common.close`)}),s===`single`?oe?(0,Z.jsx)(_,{variant:`primary`,icon:(0,Z.jsx)(Xe,{className:`size-3.5`}),onClick:()=>z.current?.abort(),children:r(`providers.testDialog.stop`)}):(0,Z.jsx)(_,{variant:`primary`,disabled:v.trim()===``,icon:(0,Z.jsx)(Ke,{className:`size-3.5`}),onClick:G,children:r(b?`providers.testDialog.retest`:`providers.testDialog.start`)}):oe?(0,Z.jsx)(_,{variant:`primary`,icon:(0,Z.jsx)(Xe,{className:`size-3.5`}),onClick:ie,children:r(`providers.testDialog.stopRest`)}):(0,Z.jsx)(_,{variant:`primary`,disabled:D.size===0,icon:(0,Z.jsx)(Ke,{className:`size-3.5`}),onClick:()=>ne([...D]),children:r(`providers.testDialog.testN`,{count:D.size})})]}),children:[(0,Z.jsxs)(`div`,{className:`flex items-center justify-between gap-3 pb-4`,children:[(0,Z.jsx)(Ae,{name:e.name,icon:e.icon,colorKey:e.templateId,size:32}),(0,Z.jsx)(ee,{items:[{value:`single`,label:r(`providers.testDialog.modeSingle`)},{value:`batch`,label:r(`providers.testDialog.modeBatch`)}],value:s,onChange:e=>{c(e),F(null)},ariaLabel:r(`providers.testDialog.config`)})]}),s===`single`?(0,Z.jsxs)(`div`,{className:`grid grid-cols-[minmax(0,300px)_minmax(0,1fr)] gap-6`,children:[(0,Z.jsxs)(`div`,{className:`flex flex-col gap-4 border-r border-[var(--border)] pr-6`,children:[(0,Z.jsx)(`h3`,{className:`text-[13px] font-medium`,children:r(`providers.testDialog.config`)}),(0,Z.jsx)(ue,{label:r(`providers.testDialog.model`),children:(0,Z.jsx)(jn,{value:v,models:U,onChange:y})}),(0,Z.jsx)(Mn,{protocols:o,protocol:l,onProtocol:u,stream:d,onStream:f,maxTokens:h,onMaxTokens:g,prompt:p,onPrompt:m}),(0,Z.jsx)(`p`,{className:`mt-auto text-[11px] text-[var(--text-muted)]`,children:r(`providers.testDialog.savedCredentials`)})]}),(0,Z.jsx)(Nn,{run:b,onRetest:G})]}):P===null?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(Ln,{known:U,selected:D,onToggle:de,onSelectAll:e=>O(e?new Set(U):new Set),onClear:()=>O(new Set),search:j,onSearch:N,onAdd:e=>{A(t=>t.includes(e)?t:[...t,e]),O(t=>new Set(t).add(e)),N(``)},configOpen:I,onConfigOpen:R,protocols:o,protocol:l,onProtocol:u,stream:d,onStream:f,maxTokens:h,onMaxTokens:g,prompt:p,onPrompt:m}),T.length>0?(0,Z.jsxs)(`div`,{className:`mt-4 grid gap-2`,children:[(0,Z.jsx)(`div`,{className:`text-[12px] text-[var(--text-secondary)]`,children:oe?r(`providers.testDialog.progress`,{done:se,total:T.length,ok:ce,failed:le}):r(`providers.testDialog.progressDone`,{total:T.length,ok:ce,failed:le})}),(0,Z.jsx)(`div`,{className:`h-1 overflow-hidden rounded-full bg-[var(--surface-strong)]`,children:(0,Z.jsx)(`div`,{className:`h-full rounded-full transition-[width]`,style:{width:`${se/T.length*100}%`,background:`var(--accent)`}})})]}):null,T.length>0?(0,Z.jsx)(`div`,{className:`mt-4`,children:(0,Z.jsx)(Rn,{order:T,runs:C,onView:F})}):null]}):(0,Z.jsxs)(`div`,{className:`grid gap-4`,children:[(0,Z.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3`,children:[(0,Z.jsx)(_,{variant:`plain`,icon:(0,Z.jsx)(Ce,{className:`size-4`}),"aria-label":r(`common.back`),onClick:()=>F(null)}),(0,Z.jsx)(`span`,{className:`font-mono text-[13px]`,children:P})]}),(0,Z.jsx)(Nn,{run:C[P]??null})]})]})})}function jn({value:e,models:t,onChange:n}){let{t:r}=S(),[i,a]=(0,Y.useState)(!1),[o,c]=(0,Y.useState)(0),[l,u]=(0,Y.useState)(null),d=l===null?t:t.filter(e=>e.toLowerCase().includes(l.trim().toLowerCase())),f=()=>{u(null),c(Math.max(0,t.indexOf(e))),a(!0)},p=e=>{n(e),u(null),a(!1)};return(0,Z.jsxs)(`div`,{className:`relative`,children:[(0,Z.jsx)(A,{className:`pr-9 font-mono`,value:e,placeholder:r(`providers.testDialog.modelPlaceholder`),"aria-expanded":i,role:`combobox`,onFocus:f,onClick:f,onChange:e=>{n(e.target.value),u(e.target.value),c(0),a(!0)},onKeyDown:e=>{if(e.key===`ArrowDown`||e.key===`ArrowUp`){if(e.preventDefault(),!i)return f();if(d.length===0)return;let t=e.key===`ArrowDown`?1:-1;c(e=>(e+t+d.length)%d.length)}else e.key===`Enter`&&i?(e.preventDefault(),d[o]&&p(d[o])):e.key===`Escape`&&a(!1)}}),(0,Z.jsx)(`button`,{type:`button`,className:`absolute inset-y-0 right-0 grid w-8 place-items-center text-[var(--text-muted)] hover:text-[var(--text)]`,"aria-label":r(`providers.testDialog.showModels`),onClick:()=>i?a(!1):f(),children:(0,Z.jsx)(s,{className:`size-4`})}),i&&(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(`div`,{className:`fixed inset-0 z-40`,onMouseDown:()=>a(!1)}),(0,Z.jsx)(`ul`,{className:`absolute inset-x-0 top-full z-50 mt-1 max-h-64 overflow-auto rounded-lg border border-[var(--border)] bg-[var(--surface-raised)] py-1 shadow-lg`,children:d.length===0?(0,Z.jsx)(`li`,{className:`px-3 py-2 text-[12px] text-[var(--text-muted)]`,children:r(`providers.testDialog.noModels`)}):d.map((e,t)=>(0,Z.jsx)(`li`,{children:(0,Z.jsx)(`button`,{type:`button`,className:w(`block w-full truncate px-3 py-1.5 text-left font-mono text-[12px] hover:bg-[var(--surface-strong)]`,t===o&&`bg-[var(--surface-strong)]`),onMouseEnter:()=>c(t),onMouseDown:t=>{t.preventDefault(),p(e)},children:e})},e))})]})]})}function Mn({protocols:e,...t}){let{t:n}=S(),r=e.map(e=>({value:e,label:fn.find(t=>t.value===e)?.label??e}));return(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(ue,{label:n(`providers.testDialog.protocol`),children:(0,Z.jsx)(j,{value:t.protocol,onChange:t.onProtocol,options:r})}),(0,Z.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,Z.jsx)(`span`,{className:`text-[12px] text-[var(--text-secondary)]`,children:n(`providers.testDialog.stream`)}),(0,Z.jsx)(se,{checked:t.stream,label:n(`providers.testDialog.stream`),onChange:t.onStream})]}),(0,Z.jsx)(ue,{label:n(`providers.testDialog.maxTokens`),children:(0,Z.jsx)(de,{value:t.maxTokens,min:1,placeholder:String(wn),label:n(`providers.testDialog.maxTokens`),onChange:e=>t.onMaxTokens(e===null?null:Math.min(Tn,Math.max(1,Math.round(e))))})}),(0,Z.jsx)(ue,{label:n(`providers.testDialog.prompt`),hint:n(`providers.testDialog.promptHint`),children:(0,Z.jsx)(ne,{rows:4,value:t.prompt,placeholder:`Reply with OK.`,onChange:e=>t.onPrompt(e.target.value)})})]})}function Nn({run:e,onRetest:t}){let{t:n}=S(),[r,i]=(0,Y.useState)(`preview`),a=e?.text??``,o=e?.raw??``,s=Object.entries(e?.headers??{}),c=e?.ttftMs!=null&&e?.httpMs!=null?Math.max(0,e.ttftMs-e.httpMs):null,l=r===`raw`?o:r===`headers`?s.map(([e,t])=>`${e}: ${t}`).join(`
|
|
2
|
+
`):a;return(0,Z.jsxs)(`div`,{className:`grid min-w-0 content-start gap-4`,children:[(0,Z.jsxs)(`div`,{className:`flex flex-wrap items-center justify-end gap-2`,children:[t&&e&&e.status!==`running`?(0,Z.jsx)(_,{size:`sm`,icon:(0,Z.jsx)(Ke,{className:`size-3.5`}),onClick:t,children:n(`providers.testDialog.retest`)}):null,(0,Z.jsx)(be,{content:n(`providers.testDialog.metricsHelp`),children:(0,Z.jsx)(`span`,{className:`inline-flex size-4 items-center justify-center text-[var(--text-muted)]`,tabIndex:0,children:(0,Z.jsx)(We,{className:`size-4`})})}),(0,Z.jsx)(In,{run:e}),e?.httpStatus?(0,Z.jsxs)(D,{tone:`neutral`,children:[`HTTP `,e.httpStatus]}):null]}),(0,Z.jsxs)(`div`,{className:`grid grid-cols-2 gap-px overflow-hidden rounded-lg border border-[var(--border)] bg-[var(--border)] sm:grid-cols-4`,children:[(0,Z.jsx)(Fn,{label:n(`providers.testDialog.metrics.http`),value:e?.httpMs}),(0,Z.jsx)(Fn,{label:n(`providers.testDialog.metrics.firstWait`),value:c}),(0,Z.jsx)(Fn,{label:n(`providers.testDialog.metrics.ttft`),value:e?.ttftMs}),(0,Z.jsx)(Fn,{label:n(`providers.testDialog.metrics.total`),value:e?.totalMs})]}),(0,Z.jsxs)(`section`,{className:`card overflow-hidden`,children:[(0,Z.jsxs)(`header`,{className:`flex flex-wrap items-center gap-2 border-b border-[var(--border)] px-4 py-2.5`,children:[(0,Z.jsx)(`h3`,{className:`text-[12px] font-medium`,children:n(`providers.testDialog.reply`)}),(0,Z.jsxs)(`div`,{className:`ml-auto flex items-center gap-2`,children:[(0,Z.jsx)(ee,{items:[{value:`preview`,label:n(`providers.testDialog.preview`)},{value:`raw`,label:n(`providers.testDialog.raw`)},{value:`headers`,label:n(`providers.testDialog.headers`)}],value:r,onChange:i,ariaLabel:n(`providers.testDialog.reply`)}),(0,Z.jsx)(O,{value:l,label:n(r===`headers`?`providers.testDialog.headers`:`providers.testDialog.reply`),iconOnly:!0})]})]}),(0,Z.jsx)(`div`,{className:`h-[360px] overflow-auto px-4 py-3`,children:r===`headers`?s.length===0?(0,Z.jsx)(`p`,{className:`text-[12px] text-[var(--text-muted)]`,children:n(`providers.testDialog.headersEmpty`)}):(0,Z.jsx)(`table`,{className:`w-full text-[11px]`,children:(0,Z.jsx)(`tbody`,{children:s.map(([e,t])=>(0,Z.jsxs)(`tr`,{className:`border-b border-[var(--border)] last:border-0 align-top`,children:[(0,Z.jsx)(`th`,{className:`w-[220px] py-1.5 pr-4 text-left font-mono font-normal text-[var(--text-secondary)]`,children:e}),(0,Z.jsx)(`td`,{className:`py-1.5 font-mono break-all whitespace-pre-wrap selectable`,children:t})]},e))})}):r===`raw`?o?(0,Z.jsxs)(`div`,{className:`grid gap-2`,children:[(0,Z.jsxs)(`p`,{className:`text-[11px] text-[var(--text-muted)]`,children:[n(`providers.testDialog.rawNote`),e?.contentType?` · ${e.contentType}`:``]}),(0,Z.jsx)(`pre`,{className:`font-mono text-[11px] leading-[1.6] break-all whitespace-pre-wrap selectable`,children:o}),e?.rawTruncated?(0,Z.jsx)(`p`,{className:`text-[11px] text-[var(--warning)]`,children:n(`providers.testDialog.rawTruncated`)}):null]}):(0,Z.jsx)(Pn,{run:e}):e?.error?(0,Z.jsx)(E,{tone:`danger`,title:n(`providers.testDialog.status.failed`),children:e.error}):a||e?.reasoning?(0,Z.jsxs)(`div`,{className:`grid gap-3`,children:[e?.reasoning?(0,Z.jsxs)(`div`,{className:`rounded-md border border-[var(--border)] bg-[var(--surface-strong)] p-3`,children:[(0,Z.jsx)(`div`,{className:`mb-1 text-[11px] text-[var(--text-muted)]`,children:n(`providers.testDialog.reasoning`)}),(0,Z.jsx)(`pre`,{className:`font-mono text-[11px] leading-[1.6] whitespace-pre-wrap selectable`,children:e.reasoning})]}):null,a?(0,Z.jsx)(`pre`,{className:`font-mono text-[12px] leading-[1.7] break-words whitespace-pre-wrap selectable`,children:a}):null]}):e?.status===`success`?(0,Z.jsx)(`p`,{className:`text-[12px] text-[var(--text-muted)]`,children:n(`providers.testDialog.noText`)}):(0,Z.jsx)(Pn,{run:e})})]})]})}function Pn({run:e}){let{t}=S();return e?.status===`running`||e?.status===`queued`?(0,Z.jsx)(`div`,{className:`grid h-full place-items-center text-[12px] text-[var(--text-muted)]`,children:t(En[e.status])}):(0,Z.jsxs)(`div`,{className:`grid h-full place-items-center content-center gap-2 text-center`,children:[(0,Z.jsx)(ke,{className:`mx-auto size-6 text-[var(--text-muted)]`}),(0,Z.jsx)(`div`,{className:`text-[13px]`,children:t(`providers.testDialog.emptyTitle`)}),(0,Z.jsx)(`p`,{className:`mx-auto max-w-[320px] text-[11px] text-[var(--text-muted)]`,children:t(`providers.testDialog.emptyDetail`)})]})}function Fn({label:e,value:t}){return(0,Z.jsxs)(`div`,{className:`bg-[var(--surface)] px-4 py-3`,children:[(0,Z.jsx)(`div`,{className:`text-[11px] text-[var(--text-muted)]`,children:e}),(0,Z.jsx)(`div`,{className:`mt-1 font-mono text-[15px] tabular-nums`,children:t==null?`—`:B(t)})]})}function In({run:e}){let{t}=S(),n=e?.status??`idle`;return(0,Z.jsxs)(`span`,{className:`inline-flex items-center gap-1.5 text-[12px] text-[var(--text-secondary)]`,children:[(0,Z.jsx)(fe,{tone:n===`success`?`green`:n===`failed`?`red`:n===`running`?`orange`:`neutral`}),t(En[n])]})}function Ln({known:e,selected:t,onToggle:n,onSelectAll:r,onClear:i,search:a,onSearch:o,onAdd:s,configOpen:c,onConfigOpen:l,...u}){let{t:d}=S(),f=a.trim(),p=f.toLowerCase(),m=p?e.filter(e=>e.toLowerCase().includes(p)):e,h=f!==``&&!e.some(e=>e.toLowerCase()===p);return(0,Z.jsxs)(`div`,{className:`grid gap-3`,children:[(0,Z.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,Z.jsx)(`span`,{className:`shrink-0 text-[12px] text-[var(--text-secondary)]`,children:d(`providers.testDialog.selected`,{n:t.size,total:e.length})}),(0,Z.jsx)(`div`,{className:`min-w-[220px] flex-1`,children:(0,Z.jsx)(U,{value:a,onChange:o,placeholder:d(`providers.testDialog.searchModels`)})}),(0,Z.jsx)(_,{variant:`plain`,disabled:t.size===0,onClick:i,children:d(`providers.testDialog.clearSelection`)}),(0,Z.jsx)(_,{icon:(0,Z.jsx)(Ke,{className:`size-3.5`}),onClick:()=>l(!0),children:d(`providers.testDialog.config`)})]}),(0,Z.jsx)(`div`,{className:`card max-h-[420px] overflow-auto`,children:m.length===0&&!h?(0,Z.jsx)(`p`,{className:`px-4 py-6 text-center text-[12px] text-[var(--text-muted)]`,children:d(`providers.testDialog.noModels`)}):(0,Z.jsxs)(`ul`,{className:`divide-y divide-[var(--border)]`,children:[(0,Z.jsxs)(`li`,{className:`flex items-center gap-3 px-4 py-2`,children:[(0,Z.jsx)(we,{checked:t.size===e.length&&e.length>0||t.size!==0&&`indeterminate`,onCheckedChange:e=>r(e!==!1),"aria-label":d(`providers.testDialog.clearSelection`)}),(0,Z.jsx)(`span`,{className:`text-[11px] text-[var(--text-muted)]`,children:d(`providers.testDialog.ownFilter`)})]}),h?(0,Z.jsxs)(`li`,{className:`flex items-center gap-3 px-4 py-2.5`,children:[(0,Z.jsx)(xe,{className:`size-3.5 shrink-0 text-[var(--accent)]`}),(0,Z.jsx)(`button`,{type:`button`,className:`text-left font-mono text-[12px] text-[var(--accent)]`,onClick:()=>s(f),children:d(`providers.testDialog.addModel`,{id:f})})]}):null,m.map(e=>(0,Z.jsxs)(`li`,{className:`flex items-center gap-3 px-4 py-2.5`,children:[(0,Z.jsx)(we,{checked:t.has(e),onCheckedChange:t=>n(e,t!==!1),"aria-label":e}),(0,Z.jsx)(`span`,{className:`min-w-0 truncate font-mono text-[12px]`,title:e,children:e})]},e))]})}),(0,Z.jsx)(me,{open:c,onOpenChange:l,width:480,title:d(`providers.testDialog.config`),description:d(`providers.testDialog.savedCredentials`),children:(0,Z.jsx)(`div`,{className:`grid gap-4`,children:(0,Z.jsx)(Mn,{...u})})})]})}function Rn({order:e,runs:t,onView:n}){let{t:r}=S();return(0,Z.jsx)(`div`,{className:`card overflow-hidden`,children:(0,Z.jsxs)(`table`,{className:`w-full text-[12px]`,children:[(0,Z.jsx)(`thead`,{children:(0,Z.jsxs)(`tr`,{className:`border-b border-[var(--border)] text-left text-[11px] text-[var(--text-muted)]`,children:[(0,Z.jsx)(`th`,{className:`px-4 py-2 font-normal`,children:r(`providers.testDialog.model`)}),(0,Z.jsx)(`th`,{className:`px-4 py-2 font-normal`,children:r(`providers.testDialog.statusColumn`)}),(0,Z.jsx)(`th`,{className:`px-4 py-2 font-normal`,children:r(`providers.testDialog.metrics.ttft`)}),(0,Z.jsx)(`th`,{className:`px-4 py-2 font-normal`,children:r(`providers.testDialog.metrics.total`)}),(0,Z.jsx)(`th`,{className:`px-4 py-2 font-normal`,children:r(`providers.testDialog.reply`)})]})}),(0,Z.jsx)(`tbody`,{children:e.map(e=>{let i=t[e];return(0,Z.jsxs)(`tr`,{className:`border-b border-[var(--border)] last:border-0`,children:[(0,Z.jsx)(`td`,{className:`px-4 py-2 font-mono`,children:e}),(0,Z.jsx)(`td`,{className:`px-4 py-2`,children:(0,Z.jsx)(In,{run:i??null})}),(0,Z.jsx)(`td`,{className:`px-4 py-2 font-mono tabular-nums`,children:i?.ttftMs==null?`—`:B(i.ttftMs)}),(0,Z.jsx)(`td`,{className:`px-4 py-2 font-mono tabular-nums`,children:i?.totalMs==null?`—`:B(i.totalMs)}),(0,Z.jsx)(`td`,{className:`px-4 py-2`,children:(0,Z.jsx)(`button`,{type:`button`,className:`text-[var(--accent)] disabled:text-[var(--text-muted)]`,disabled:!i,onClick:()=>n(e),children:r(`providers.testDialog.view`)})})]},e)})})]})})}async function zn(e,t,n,r,i){let a={modelId:t,status:`running`,text:``,reasoning:``};i(a);let o=e=>{a={...a,...e},i(a)};try{await d(e,n,e=>{let t=e.data??{};switch(e.event){case`headers`:o({httpStatus:On(t.httpStatus),httpMs:On(t.httpMs),contentType:kn(t.contentType),headers:Bn(t.headers)});break;case`delta`:{let e=kn(t.text)??``;kn(t.kind)===`reasoning`?o({reasoning:a.reasoning+e}):o({text:a.text+e});break}case`done`:{let t=e.data;o({status:t.ok?`success`:`failed`,error:t.error??null,httpStatus:t.httpStatus??null,httpMs:t.httpMs??null,ttftMs:t.ttftMs??null,totalMs:t.totalMs??null,text:t.text??``,reasoning:t.reasoning??``,raw:t.raw??``,rawTruncated:t.rawTruncated??!1,contentType:t.contentType??null,headers:Bn(t.headers)});break}}},r)}catch(e){e?.name===`AbortError`?o({status:`cancelled`,error:null}):o({status:`failed`,error:e instanceof P?e.message:String(e)})}}function Bn(e){if(typeof e!=`object`||!e)return{};let t={};for(let[n,r]of Object.entries(e))typeof r==`string`?t[n]=r:r!=null&&(t[n]=String(r));return t}export{pn as AUTH_OPTIONS,fn as PROTOCOL_OPTIONS,mn as ProvidersPage,Ke as i,ln as n,Je as r,An as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
._field_bhhp1_1{--nf-height:var(--control-height-md);--nf-step:34px;--nf-inset:3px;--nf-text:var(--text-base);--nf-width:var(--number-field-width,196px);--nf-limit:color-mix(in oklab, var(--warning) 72%, var(--foreground));min-width:0;display:grid}._field_bhhp1_1[data-size=sm]{--nf-height:var(--control-height-sm);--nf-step:28px;--nf-inset:3px;--nf-text:var(--text-sm);--nf-width:var(--number-field-width,164px)}._field_bhhp1_1[data-size=lg]{--nf-height:var(--control-height-lg);--nf-step:40px;--nf-inset:4px;--nf-text:var(--text-lg);--nf-width:var(--number-field-width,228px)}:root[data-theme=dark] ._field_bhhp1_1{--nf-limit:color-mix(in oklab, var(--warning) 88%, var(--foreground))}._head_bhhp1_6{width:min(100%, var(--nf-width));justify-content:space-between;align-items:baseline;gap:var(--space-3);margin-bottom:var(--space-2);display:flex}._label_bhhp1_7{min-width:0;color:var(--foreground);font-size:var(--text-sm);font-weight:500;line-height:var(--leading-body);letter-spacing:var(--tracking-body)}._field_bhhp1_1[data-size=sm] ._label_bhhp1_7{font-size:var(--text-xs)}._limit_bhhp1_9{color:var(--nf-limit);font-size:var(--text-xs);font-weight:500;line-height:var(--leading-body);letter-spacing:var(--tracking-body);font-variant-numeric:tabular-nums;white-space:nowrap;flex:none}._label_bhhp1_7[data-scrub]{cursor:ew-resize;touch-action:pan-y;-webkit-user-select:none;user-select:none}._control_bhhp1_14{width:min(100%, var(--nf-width));min-height:var(--nf-height);border:1px solid var(--border);border-radius:var(--radius-control);padding:var(--nf-inset);background:var(--surface);transition:border-color var(--duration-fast) var(--ease-standard), background-color var(--duration-standard) var(--ease-standard), opacity var(--duration-fast) var(--ease-standard);align-items:center;gap:2px;display:flex}@media (hover:hover) and (pointer:fine){:is(._control_bhhp1_14:hover,._field_bhhp1_1:has(._label_bhhp1_7[data-scrub]:hover) ._control_bhhp1_14){border-color:var(--border-strong)}}._control_bhhp1_14[data-scrubbing]{border-color:var(--foreground)}._control_bhhp1_14:has(input:focus){border-color:var(--foreground)}._control_bhhp1_14[data-warn],._control_bhhp1_14[data-warn]:hover{border-color:color-mix(in oklab, var(--warning) 55%, var(--border));background:color-mix(in oklab, var(--warning) 5%, var(--surface))}._control_bhhp1_14[data-warn]:has(input:focus){border-color:color-mix(in oklab, var(--warning) 80%, var(--border))}._control_bhhp1_14[data-disabled]{opacity:.5;background:var(--surface-muted)}._step_bhhp1_22{width:var(--nf-step);height:var(--nf-step);flex:0 0 var(--nf-step);border-radius:calc(var(--radius-control) - var(--nf-inset) - 1px);color:var(--text-secondary);cursor:pointer;touch-action:manipulation;-webkit-user-select:none;user-select:none;-webkit-touch-callout:none;-webkit-tap-highlight-color:transparent;transition:background-color var(--duration-fast) var(--ease-standard), color var(--duration-fast) var(--ease-standard), opacity var(--duration-standard) var(--ease-standard);background:0 0;border:0;place-items:center;padding:0;display:grid}._icon_bhhp1_23{place-items:center;display:grid}._icon_bhhp1_23 svg{transition:transform var(--duration-spring) var(--ease-spring)}@media (hover:hover) and (pointer:fine){._step_bhhp1_22:hover:not(:disabled,[aria-disabled=true]){background:var(--surface-muted);color:var(--foreground)}}._step_bhhp1_22:is(:active,[data-pressed]):not(:disabled,[aria-disabled=true]){background:color-mix(in oklab, var(--foreground) 10%, var(--surface));color:var(--foreground);transition:background-color 60ms linear,color 60ms linear}._step_bhhp1_22:is(:active,[data-pressed]):not(:disabled,[aria-disabled=true]) svg{transition:transform 90ms var(--ease-standard);transform:scale(.82)}._step_bhhp1_22:focus-visible{background:var(--surface-muted);color:var(--foreground);outline:none}._step_bhhp1_22[aria-disabled=true]{opacity:.32;cursor:not-allowed}._step_bhhp1_22:disabled{opacity:.35;cursor:not-allowed}._control_bhhp1_14[data-strain=max] ._step_bhhp1_22[aria-disabled=true]:last-child,._control_bhhp1_14[data-strain=min] ._step_bhhp1_22[aria-disabled=true]:first-child{opacity:.6;color:var(--nf-limit);transition:opacity 60ms linear,color 60ms linear}._valueWrap_bhhp1_34{cursor:text;flex:1;justify-content:center;align-self:stretch;align-items:center;min-width:0;display:flex;position:relative}._control_bhhp1_14[data-disabled] ._valueWrap_bhhp1_34{cursor:not-allowed}._value_bhhp1_34{white-space:nowrap;color:var(--foreground);font-size:var(--nf-text);transition:color var(--duration-standard) var(--ease-standard);font-weight:500;line-height:var(--leading-body);letter-spacing:var(--tracking-body);font-variant-numeric:tabular-nums;align-items:center;display:inline-flex}._affix_bhhp1_38{color:var(--text-secondary);font-weight:400;display:inline-flex}._char_bhhp1_39{white-space:pre;display:inline-block;overflow-x:clip}._number_bhhp1_42{align-items:center;display:inline-grid;position:relative}._display_bhhp1_43{grid-area:1/1;display:inline-flex}._display_bhhp1_43[data-hidden]{visibility:hidden;position:absolute;top:0;left:0}._mirror_bhhp1_45{white-space:pre;grid-area:1/1}._input_bhhp1_46{z-index:1;color:#0000;width:calc(100% + 1em);height:100%;caret-color:var(--foreground);font:inherit;font-variant-numeric:inherit;letter-spacing:inherit;line-height:inherit;text-align:left;background:0 0;border:0;outline:none;margin:0;padding:0;position:absolute;top:0;left:0}._input_bhhp1_46:focus-visible{outline:none}._input_bhhp1_46::selection{background:color-mix(in oklab, var(--foreground) 16%, transparent);color:#0000}._input_bhhp1_46:disabled{cursor:not-allowed}._column_bhhp1_52{--feather:.2em;margin-block:calc(var(--feather) * -1);padding-block:var(--feather);-webkit-mask-image:linear-gradient(to bottom, transparent, #000 calc(var(--feather) * 1.5), #000 calc(100% - var(--feather) * 1.5), transparent);mask-image:linear-gradient(to bottom, transparent, #000 calc(var(--feather) * 1.5), #000 calc(100% - var(--feather) * 1.5), transparent);display:inline-block;position:relative;overflow:visible clip;-webkit-mask-repeat:repeat-x;mask-repeat:repeat-x;-webkit-mask-clip:no-clip;mask-clip:no-clip}._sizer_bhhp1_53{visibility:hidden}._glyph_bhhp1_54{inset:var(--feather) 0;text-align:center;position:absolute}._symbol_bhhp1_55{white-space:pre;display:inline-block;overflow-x:clip}._messageSlot_bhhp1_57{display:block;overflow:hidden}._hint_bhhp1_58{padding-top:var(--space-2);color:var(--text-muted);font-size:var(--text-xs);line-height:var(--leading-body);letter-spacing:var(--tracking-body);font-variant-numeric:tabular-nums;display:block}._words_bhhp1_60{display:block;position:relative}._wordSlot_bhhp1_61{vertical-align:top;white-space:pre;display:inline-block;position:relative}._wordSizer_bhhp1_62{visibility:hidden;white-space:pre;position:absolute;top:0;left:0}._word_bhhp1_60{white-space:pre;display:inline-block}._srOnly_bhhp1_64{clip-path:inset(50%);white-space:nowrap;width:1px;height:1px;position:absolute;overflow:hidden}@media (prefers-reduced-motion:reduce){._control_bhhp1_14,._step_bhhp1_22{transition:opacity var(--duration-instant) linear, border-color var(--duration-instant) linear, background-color var(--duration-instant) linear}._step_bhhp1_22:is(:active,[data-pressed]):not(:disabled,[aria-disabled=true]) svg,._icon_bhhp1_23 svg{transition:none;transform:none}._control_bhhp1_14[data-strain] ._value_bhhp1_34{color:var(--nf-limit);transition:none}}
|