@chenpu17/cc-gw 0.7.17 → 0.7.18

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (38) hide show
  1. package/package.json +1 -1
  2. package/src/server/dist/index.js +420 -155
  3. package/src/web/dist/assets/{About-T8buLoTf.js → About-DiMtBAOL.js} +2 -2
  4. package/src/web/dist/assets/ApiKeys-DcKwRUMu.js +16 -0
  5. package/src/web/dist/assets/Dashboard-C6Uai54P.js +16 -0
  6. package/src/web/dist/assets/{Events-BY6QDHf6.js → Events-CP1K4Di7.js} +2 -2
  7. package/src/web/dist/assets/{Help-CXlj66Zk.js → Help-D9w8Z7bi.js} +1 -1
  8. package/src/web/dist/assets/{Login-C227e592.js → Login-LyOFmFDM.js} +1 -1
  9. package/src/web/dist/assets/Logs-qMkJ_LnZ.js +6 -0
  10. package/src/web/dist/assets/ModelManagement-JuXIL4nJ.js +6 -0
  11. package/src/web/dist/assets/{PageHeader-BatC8G-O.js → PageHeader-C2Un_Eq9.js} +1 -1
  12. package/src/web/dist/assets/{PageSection-HTrZH-H0.js → PageSection-B9yrPBCN.js} +1 -1
  13. package/src/web/dist/assets/Settings-yxuIaovZ.js +6 -0
  14. package/src/web/dist/assets/Skeleton-BLdvXQnT.js +1 -0
  15. package/src/web/dist/assets/{card-DQb2ediN.js → card-CtgEZD37.js} +1 -1
  16. package/src/web/dist/assets/{dialog-B9ZBo_5P.js → dialog-DRP_IQxH.js} +3 -3
  17. package/src/web/dist/assets/index-B_ZdlwhD.js +280 -0
  18. package/src/web/dist/assets/{index-CprjNJ8x.js → index-D3x39AFW.js} +1 -1
  19. package/src/web/dist/assets/index-yEbjdbzX.css +1 -0
  20. package/src/web/dist/assets/{info-BSxQbQAp.js → info-B8rDg1M6.js} +1 -1
  21. package/src/web/dist/assets/{input-x0jTfvyD.js → input-BJXToHiR.js} +1 -1
  22. package/src/web/dist/assets/{label-t5tthgxG.js → label-CzVczRHt.js} +1 -1
  23. package/src/web/dist/assets/{refresh-cw-DHAoO4El.js → refresh-cw-BvguPOQm.js} +1 -1
  24. package/src/web/dist/assets/select-B1I4kItt.js +11 -0
  25. package/src/web/dist/assets/shield-DceCQI6h.js +11 -0
  26. package/src/web/dist/assets/switch-DteEzH7T.js +1 -0
  27. package/src/web/dist/assets/{useApiQuery-CkT-JtpV.js → useApiQuery-DNDJWhHp.js} +1 -1
  28. package/src/web/dist/index.html +2 -2
  29. package/src/web/dist/assets/ApiKeys-kkOS5njK.js +0 -16
  30. package/src/web/dist/assets/Dashboard-BuFP7xgE.js +0 -16
  31. package/src/web/dist/assets/Logs-A1_44nYh.js +0 -6
  32. package/src/web/dist/assets/ModelManagement-CZsts9T9.js +0 -1
  33. package/src/web/dist/assets/Settings-DDaFQ7RV.js +0 -11
  34. package/src/web/dist/assets/copy-8Dwvprhw.js +0 -6
  35. package/src/web/dist/assets/index-CsJ3GRy4.css +0 -1
  36. package/src/web/dist/assets/index-D-F4C6n_.js +0 -280
  37. package/src/web/dist/assets/select-fri8gRof.js +0 -11
  38. package/src/web/dist/assets/switch-BrV6LX33.js +0 -1
@@ -1,11 +0,0 @@
1
- import{c as Pe,r as n,j as r,E as _,W as Re,Y as ht,y as be,Z as vt,z as gt,A as Ie,$ as St,H as k,a0 as $,a1 as xt,G as P,D as wt,f as Ee,a2 as yt,I as Ct,N as It,J as Tt,M as bt,O as Nt,Q as Pt,a3 as Rt,a4 as Et,a as G,v as _t}from"./index-D-F4C6n_.js";/**
2
- * @license lucide-react v0.344.0 - ISC
3
- *
4
- * This source code is licensed under the ISC license.
5
- * See the LICENSE file in the root directory of this source tree.
6
- */const _e=Pe("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/**
7
- * @license lucide-react v0.344.0 - ISC
8
- *
9
- * This source code is licensed under the ISC license.
10
- * See the LICENSE file in the root directory of this source tree.
11
- */const jt=Pe("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);function Ne(t,[o,e]){return Math.min(e,Math.max(o,t))}function Mt(t){const o=n.useRef({value:t,previous:t});return n.useMemo(()=>(o.current.value!==t&&(o.current.previous=o.current.value,o.current.value=t),o.current.previous),[t])}var je=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),At="VisuallyHidden",Ot=n.forwardRef((t,o)=>r.jsx(_.span,{...t,ref:o,style:{...je,...t.style}}));Ot.displayName=At;var Dt=[" ","Enter","ArrowUp","ArrowDown"],Lt=[" ","Enter"],Q="Select",[ie,de,kt]=St(Q),[oe]=gt(Q,[kt,Re]),ue=Re(),[Bt,Y]=oe(Q),[Vt,Ht]=oe(Q),Me=t=>{const{__scopeSelect:o,children:e,open:a,defaultOpen:i,onOpenChange:p,value:l,defaultValue:c,onValueChange:s,dir:f,name:g,autoComplete:w,disabled:b,required:N,form:T}=t,d=ue(o),[v,y]=n.useState(null),[u,h]=n.useState(null),[M,A]=n.useState(!1),ne=ht(f),[R,D]=be({prop:a,defaultProp:i??!1,onChange:p,caller:Q}),[F,Z]=be({prop:l,defaultProp:c,onChange:s,caller:Q}),B=n.useRef(null),V=v?T||!!v.closest("form"):!0,[K,H]=n.useState(new Set),U=Array.from(K).map(E=>E.props.value).join(";");return r.jsx(vt,{...d,children:r.jsxs(Bt,{required:N,scope:o,trigger:v,onTriggerChange:y,valueNode:u,onValueNodeChange:h,valueNodeHasChildren:M,onValueNodeHasChildrenChange:A,contentId:Ie(),value:F,onValueChange:Z,open:R,onOpenChange:D,dir:ne,triggerPointerDownPosRef:B,disabled:b,children:[r.jsx(ie.Provider,{scope:o,children:r.jsx(Vt,{scope:t.__scopeSelect,onNativeOptionAdd:n.useCallback(E=>{H(L=>new Set(L).add(E))},[]),onNativeOptionRemove:n.useCallback(E=>{H(L=>{const W=new Set(L);return W.delete(E),W})},[]),children:e})}),V?r.jsxs(ot,{"aria-hidden":!0,required:N,tabIndex:-1,name:g,autoComplete:w,value:F,onChange:E=>Z(E.target.value),disabled:b,form:T,children:[F===void 0?r.jsx("option",{value:""}):null,Array.from(K)]},U):null]})})};Me.displayName=Q;var Ae="SelectTrigger",Oe=n.forwardRef((t,o)=>{const{__scopeSelect:e,disabled:a=!1,...i}=t,p=ue(e),l=Y(Ae,e),c=l.disabled||a,s=k(o,l.onTriggerChange),f=de(e),g=n.useRef("touch"),[w,b,N]=rt(d=>{const v=f().filter(h=>!h.disabled),y=v.find(h=>h.value===l.value),u=st(v,d,y);u!==void 0&&l.onValueChange(u.value)}),T=d=>{c||(l.onOpenChange(!0),N()),d&&(l.triggerPointerDownPosRef.current={x:Math.round(d.pageX),y:Math.round(d.pageY)})};return r.jsx(xt,{asChild:!0,...p,children:r.jsx(_.button,{type:"button",role:"combobox","aria-controls":l.contentId,"aria-expanded":l.open,"aria-required":l.required,"aria-autocomplete":"none",dir:l.dir,"data-state":l.open?"open":"closed",disabled:c,"data-disabled":c?"":void 0,"data-placeholder":nt(l.value)?"":void 0,...i,ref:s,onClick:P(i.onClick,d=>{d.currentTarget.focus(),g.current!=="mouse"&&T(d)}),onPointerDown:P(i.onPointerDown,d=>{g.current=d.pointerType;const v=d.target;v.hasPointerCapture(d.pointerId)&&v.releasePointerCapture(d.pointerId),d.button===0&&d.ctrlKey===!1&&d.pointerType==="mouse"&&(T(d),d.preventDefault())}),onKeyDown:P(i.onKeyDown,d=>{const v=w.current!=="";!(d.ctrlKey||d.altKey||d.metaKey)&&d.key.length===1&&b(d.key),!(v&&d.key===" ")&&Dt.includes(d.key)&&(T(),d.preventDefault())})})})});Oe.displayName=Ae;var De="SelectValue",Le=n.forwardRef((t,o)=>{const{__scopeSelect:e,className:a,style:i,children:p,placeholder:l="",...c}=t,s=Y(De,e),{onValueNodeHasChildrenChange:f}=s,g=p!==void 0,w=k(o,s.onValueNodeChange);return $(()=>{f(g)},[f,g]),r.jsx(_.span,{...c,ref:w,style:{pointerEvents:"none"},children:nt(s.value)?r.jsx(r.Fragment,{children:l}):p})});Le.displayName=De;var Ut="SelectIcon",ke=n.forwardRef((t,o)=>{const{__scopeSelect:e,children:a,...i}=t;return r.jsx(_.span,{"aria-hidden":!0,...i,ref:o,children:a||"▼"})});ke.displayName=Ut;var Wt="SelectPortal",Be=t=>r.jsx(wt,{asChild:!0,...t});Be.displayName=Wt;var ee="SelectContent",Ve=n.forwardRef((t,o)=>{const e=Y(ee,t.__scopeSelect),[a,i]=n.useState();if($(()=>{i(new DocumentFragment)},[]),!e.open){const p=a;return p?Ee.createPortal(r.jsx(He,{scope:t.__scopeSelect,children:r.jsx(ie.Slot,{scope:t.__scopeSelect,children:r.jsx("div",{children:t.children})})}),p):null}return r.jsx(Ue,{...t,ref:o})});Ve.displayName=ee;var O=10,[He,q]=oe(ee),Ft="SelectContentImpl",Kt=bt("SelectContent.RemoveScroll"),Ue=n.forwardRef((t,o)=>{const{__scopeSelect:e,position:a="item-aligned",onCloseAutoFocus:i,onEscapeKeyDown:p,onPointerDownOutside:l,side:c,sideOffset:s,align:f,alignOffset:g,arrowPadding:w,collisionBoundary:b,collisionPadding:N,sticky:T,hideWhenDetached:d,avoidCollisions:v,...y}=t,u=Y(ee,e),[h,M]=n.useState(null),[A,ne]=n.useState(null),R=k(o,m=>M(m)),[D,F]=n.useState(null),[Z,B]=n.useState(null),V=de(e),[K,H]=n.useState(!1),U=n.useRef(!1);n.useEffect(()=>{if(h)return Ct(h)},[h]),It();const E=n.useCallback(m=>{const[I,...j]=V().map(x=>x.ref.current),[C]=j.slice(-1),S=document.activeElement;for(const x of m)if(x===S||(x==null||x.scrollIntoView({block:"nearest"}),x===I&&A&&(A.scrollTop=0),x===C&&A&&(A.scrollTop=A.scrollHeight),x==null||x.focus(),document.activeElement!==S))return},[V,A]),L=n.useCallback(()=>E([D,h]),[E,D,h]);n.useEffect(()=>{K&&L()},[K,L]);const{onOpenChange:W,triggerPointerDownPosRef:z}=u;n.useEffect(()=>{if(h){let m={x:0,y:0};const I=C=>{var S,x;m={x:Math.abs(Math.round(C.pageX)-(((S=z.current)==null?void 0:S.x)??0)),y:Math.abs(Math.round(C.pageY)-(((x=z.current)==null?void 0:x.y)??0))}},j=C=>{m.x<=10&&m.y<=10?C.preventDefault():h.contains(C.target)||W(!1),document.removeEventListener("pointermove",I),z.current=null};return z.current!==null&&(document.addEventListener("pointermove",I),document.addEventListener("pointerup",j,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",I),document.removeEventListener("pointerup",j,{capture:!0})}}},[h,W,z]),n.useEffect(()=>{const m=()=>W(!1);return window.addEventListener("blur",m),window.addEventListener("resize",m),()=>{window.removeEventListener("blur",m),window.removeEventListener("resize",m)}},[W]);const[pe,ae]=rt(m=>{const I=V().filter(S=>!S.disabled),j=I.find(S=>S.ref.current===document.activeElement),C=st(I,m,j);C&&setTimeout(()=>C.ref.current.focus())}),fe=n.useCallback((m,I,j)=>{const C=!U.current&&!j;(u.value!==void 0&&u.value===I||C)&&(F(m),C&&(U.current=!0))},[u.value]),me=n.useCallback(()=>h==null?void 0:h.focus(),[h]),te=n.useCallback((m,I,j)=>{const C=!U.current&&!j;(u.value!==void 0&&u.value===I||C)&&B(m)},[u.value]),le=a==="popper"?Se:We,re=le===Se?{side:c,sideOffset:s,align:f,alignOffset:g,arrowPadding:w,collisionBoundary:b,collisionPadding:N,sticky:T,hideWhenDetached:d,avoidCollisions:v}:{};return r.jsx(He,{scope:e,content:h,viewport:A,onViewportChange:ne,itemRefCallback:fe,selectedItem:D,onItemLeave:me,itemTextRefCallback:te,focusSelectedItem:L,selectedItemText:Z,position:a,isPositioned:K,searchRef:pe,children:r.jsx(Tt,{as:Kt,allowPinchZoom:!0,children:r.jsx(Nt,{asChild:!0,trapped:u.open,onMountAutoFocus:m=>{m.preventDefault()},onUnmountAutoFocus:P(i,m=>{var I;(I=u.trigger)==null||I.focus({preventScroll:!0}),m.preventDefault()}),children:r.jsx(Pt,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:p,onPointerDownOutside:l,onFocusOutside:m=>m.preventDefault(),onDismiss:()=>u.onOpenChange(!1),children:r.jsx(le,{role:"listbox",id:u.contentId,"data-state":u.open?"open":"closed",dir:u.dir,onContextMenu:m=>m.preventDefault(),...y,...re,onPlaced:()=>H(!0),ref:R,style:{display:"flex",flexDirection:"column",outline:"none",...y.style},onKeyDown:P(y.onKeyDown,m=>{const I=m.ctrlKey||m.altKey||m.metaKey;if(m.key==="Tab"&&m.preventDefault(),!I&&m.key.length===1&&ae(m.key),["ArrowUp","ArrowDown","Home","End"].includes(m.key)){let C=V().filter(S=>!S.disabled).map(S=>S.ref.current);if(["ArrowUp","End"].includes(m.key)&&(C=C.slice().reverse()),["ArrowUp","ArrowDown"].includes(m.key)){const S=m.target,x=C.indexOf(S);C=C.slice(x+1)}setTimeout(()=>E(C)),m.preventDefault()}})})})})})})});Ue.displayName=Ft;var zt="SelectItemAlignedPosition",We=n.forwardRef((t,o)=>{const{__scopeSelect:e,onPlaced:a,...i}=t,p=Y(ee,e),l=q(ee,e),[c,s]=n.useState(null),[f,g]=n.useState(null),w=k(o,R=>g(R)),b=de(e),N=n.useRef(!1),T=n.useRef(!0),{viewport:d,selectedItem:v,selectedItemText:y,focusSelectedItem:u}=l,h=n.useCallback(()=>{if(p.trigger&&p.valueNode&&c&&f&&d&&v&&y){const R=p.trigger.getBoundingClientRect(),D=f.getBoundingClientRect(),F=p.valueNode.getBoundingClientRect(),Z=y.getBoundingClientRect();if(p.dir!=="rtl"){const S=Z.left-D.left,x=F.left-S,X=R.left-x,J=R.width+X,he=Math.max(J,D.width),ve=window.innerWidth-O,ge=Ne(x,[O,Math.max(O,ve-he)]);c.style.minWidth=J+"px",c.style.left=ge+"px"}else{const S=D.right-Z.right,x=window.innerWidth-F.right-S,X=window.innerWidth-R.right-x,J=R.width+X,he=Math.max(J,D.width),ve=window.innerWidth-O,ge=Ne(x,[O,Math.max(O,ve-he)]);c.style.minWidth=J+"px",c.style.right=ge+"px"}const B=b(),V=window.innerHeight-O*2,K=d.scrollHeight,H=window.getComputedStyle(f),U=parseInt(H.borderTopWidth,10),E=parseInt(H.paddingTop,10),L=parseInt(H.borderBottomWidth,10),W=parseInt(H.paddingBottom,10),z=U+E+K+W+L,pe=Math.min(v.offsetHeight*5,z),ae=window.getComputedStyle(d),fe=parseInt(ae.paddingTop,10),me=parseInt(ae.paddingBottom,10),te=R.top+R.height/2-O,le=V-te,re=v.offsetHeight/2,m=v.offsetTop+re,I=U+E+m,j=z-I;if(I<=te){const S=B.length>0&&v===B[B.length-1].ref.current;c.style.bottom="0px";const x=f.clientHeight-d.offsetTop-d.offsetHeight,X=Math.max(le,re+(S?me:0)+x+L),J=I+X;c.style.height=J+"px"}else{const S=B.length>0&&v===B[0].ref.current;c.style.top="0px";const X=Math.max(te,U+d.offsetTop+(S?fe:0)+re)+j;c.style.height=X+"px",d.scrollTop=I-te+d.offsetTop}c.style.margin=`${O}px 0`,c.style.minHeight=pe+"px",c.style.maxHeight=V+"px",a==null||a(),requestAnimationFrame(()=>N.current=!0)}},[b,p.trigger,p.valueNode,c,f,d,v,y,p.dir,a]);$(()=>h(),[h]);const[M,A]=n.useState();$(()=>{f&&A(window.getComputedStyle(f).zIndex)},[f]);const ne=n.useCallback(R=>{R&&T.current===!0&&(h(),u==null||u(),T.current=!1)},[h,u]);return r.jsx(Gt,{scope:e,contentWrapper:c,shouldExpandOnScrollRef:N,onScrollButtonChange:ne,children:r.jsx("div",{ref:s,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:M},children:r.jsx(_.div,{...i,ref:w,style:{boxSizing:"border-box",maxHeight:"100%",...i.style}})})})});We.displayName=zt;var $t="SelectPopperPosition",Se=n.forwardRef((t,o)=>{const{__scopeSelect:e,align:a="start",collisionPadding:i=O,...p}=t,l=ue(e);return r.jsx(Rt,{...l,...p,ref:o,align:a,collisionPadding:i,style:{boxSizing:"border-box",...p.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});Se.displayName=$t;var[Gt,Te]=oe(ee,{}),xe="SelectViewport",Fe=n.forwardRef((t,o)=>{const{__scopeSelect:e,nonce:a,...i}=t,p=q(xe,e),l=Te(xe,e),c=k(o,p.onViewportChange),s=n.useRef(0);return r.jsxs(r.Fragment,{children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:a}),r.jsx(ie.Slot,{scope:e,children:r.jsx(_.div,{"data-radix-select-viewport":"",role:"presentation",...i,ref:c,style:{position:"relative",flex:1,overflow:"hidden auto",...i.style},onScroll:P(i.onScroll,f=>{const g=f.currentTarget,{contentWrapper:w,shouldExpandOnScrollRef:b}=l;if(b!=null&&b.current&&w){const N=Math.abs(s.current-g.scrollTop);if(N>0){const T=window.innerHeight-O*2,d=parseFloat(w.style.minHeight),v=parseFloat(w.style.height),y=Math.max(d,v);if(y<T){const u=y+N,h=Math.min(T,u),M=u-h;w.style.height=h+"px",w.style.bottom==="0px"&&(g.scrollTop=M>0?M:0,w.style.justifyContent="flex-end")}}}s.current=g.scrollTop})})})]})});Fe.displayName=xe;var Ke="SelectGroup",[Yt,qt]=oe(Ke),Zt=n.forwardRef((t,o)=>{const{__scopeSelect:e,...a}=t,i=Ie();return r.jsx(Yt,{scope:e,id:i,children:r.jsx(_.div,{role:"group","aria-labelledby":i,...a,ref:o})})});Zt.displayName=Ke;var ze="SelectLabel",$e=n.forwardRef((t,o)=>{const{__scopeSelect:e,...a}=t,i=qt(ze,e);return r.jsx(_.div,{id:i.id,...a,ref:o})});$e.displayName=ze;var ce="SelectItem",[Xt,Ge]=oe(ce),Ye=n.forwardRef((t,o)=>{const{__scopeSelect:e,value:a,disabled:i=!1,textValue:p,...l}=t,c=Y(ce,e),s=q(ce,e),f=c.value===a,[g,w]=n.useState(p??""),[b,N]=n.useState(!1),T=k(o,u=>{var h;return(h=s.itemRefCallback)==null?void 0:h.call(s,u,a,i)}),d=Ie(),v=n.useRef("touch"),y=()=>{i||(c.onValueChange(a),c.onOpenChange(!1))};if(a==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return r.jsx(Xt,{scope:e,value:a,disabled:i,textId:d,isSelected:f,onItemTextChange:n.useCallback(u=>{w(h=>h||((u==null?void 0:u.textContent)??"").trim())},[]),children:r.jsx(ie.ItemSlot,{scope:e,value:a,disabled:i,textValue:g,children:r.jsx(_.div,{role:"option","aria-labelledby":d,"data-highlighted":b?"":void 0,"aria-selected":f&&b,"data-state":f?"checked":"unchecked","aria-disabled":i||void 0,"data-disabled":i?"":void 0,tabIndex:i?void 0:-1,...l,ref:T,onFocus:P(l.onFocus,()=>N(!0)),onBlur:P(l.onBlur,()=>N(!1)),onClick:P(l.onClick,()=>{v.current!=="mouse"&&y()}),onPointerUp:P(l.onPointerUp,()=>{v.current==="mouse"&&y()}),onPointerDown:P(l.onPointerDown,u=>{v.current=u.pointerType}),onPointerMove:P(l.onPointerMove,u=>{var h;v.current=u.pointerType,i?(h=s.onItemLeave)==null||h.call(s):v.current==="mouse"&&u.currentTarget.focus({preventScroll:!0})}),onPointerLeave:P(l.onPointerLeave,u=>{var h;u.currentTarget===document.activeElement&&((h=s.onItemLeave)==null||h.call(s))}),onKeyDown:P(l.onKeyDown,u=>{var M;((M=s.searchRef)==null?void 0:M.current)!==""&&u.key===" "||(Lt.includes(u.key)&&y(),u.key===" "&&u.preventDefault())})})})})});Ye.displayName=ce;var se="SelectItemText",qe=n.forwardRef((t,o)=>{const{__scopeSelect:e,className:a,style:i,...p}=t,l=Y(se,e),c=q(se,e),s=Ge(se,e),f=Ht(se,e),[g,w]=n.useState(null),b=k(o,y=>w(y),s.onItemTextChange,y=>{var u;return(u=c.itemTextRefCallback)==null?void 0:u.call(c,y,s.value,s.disabled)}),N=g==null?void 0:g.textContent,T=n.useMemo(()=>r.jsx("option",{value:s.value,disabled:s.disabled,children:N},s.value),[s.disabled,s.value,N]),{onNativeOptionAdd:d,onNativeOptionRemove:v}=f;return $(()=>(d(T),()=>v(T)),[d,v,T]),r.jsxs(r.Fragment,{children:[r.jsx(_.span,{id:s.textId,...p,ref:b}),s.isSelected&&l.valueNode&&!l.valueNodeHasChildren?Ee.createPortal(p.children,l.valueNode):null]})});qe.displayName=se;var Ze="SelectItemIndicator",Xe=n.forwardRef((t,o)=>{const{__scopeSelect:e,...a}=t;return Ge(Ze,e).isSelected?r.jsx(_.span,{"aria-hidden":!0,...a,ref:o}):null});Xe.displayName=Ze;var we="SelectScrollUpButton",Je=n.forwardRef((t,o)=>{const e=q(we,t.__scopeSelect),a=Te(we,t.__scopeSelect),[i,p]=n.useState(!1),l=k(o,a.onScrollButtonChange);return $(()=>{if(e.viewport&&e.isPositioned){let c=function(){const f=s.scrollTop>0;p(f)};const s=e.viewport;return c(),s.addEventListener("scroll",c),()=>s.removeEventListener("scroll",c)}},[e.viewport,e.isPositioned]),i?r.jsx(et,{...t,ref:l,onAutoScroll:()=>{const{viewport:c,selectedItem:s}=e;c&&s&&(c.scrollTop=c.scrollTop-s.offsetHeight)}}):null});Je.displayName=we;var ye="SelectScrollDownButton",Qe=n.forwardRef((t,o)=>{const e=q(ye,t.__scopeSelect),a=Te(ye,t.__scopeSelect),[i,p]=n.useState(!1),l=k(o,a.onScrollButtonChange);return $(()=>{if(e.viewport&&e.isPositioned){let c=function(){const f=s.scrollHeight-s.clientHeight,g=Math.ceil(s.scrollTop)<f;p(g)};const s=e.viewport;return c(),s.addEventListener("scroll",c),()=>s.removeEventListener("scroll",c)}},[e.viewport,e.isPositioned]),i?r.jsx(et,{...t,ref:l,onAutoScroll:()=>{const{viewport:c,selectedItem:s}=e;c&&s&&(c.scrollTop=c.scrollTop+s.offsetHeight)}}):null});Qe.displayName=ye;var et=n.forwardRef((t,o)=>{const{__scopeSelect:e,onAutoScroll:a,...i}=t,p=q("SelectScrollButton",e),l=n.useRef(null),c=de(e),s=n.useCallback(()=>{l.current!==null&&(window.clearInterval(l.current),l.current=null)},[]);return n.useEffect(()=>()=>s(),[s]),$(()=>{var g;const f=c().find(w=>w.ref.current===document.activeElement);(g=f==null?void 0:f.ref.current)==null||g.scrollIntoView({block:"nearest"})},[c]),r.jsx(_.div,{"aria-hidden":!0,...i,ref:o,style:{flexShrink:0,...i.style},onPointerDown:P(i.onPointerDown,()=>{l.current===null&&(l.current=window.setInterval(a,50))}),onPointerMove:P(i.onPointerMove,()=>{var f;(f=p.onItemLeave)==null||f.call(p),l.current===null&&(l.current=window.setInterval(a,50))}),onPointerLeave:P(i.onPointerLeave,()=>{s()})})}),Jt="SelectSeparator",tt=n.forwardRef((t,o)=>{const{__scopeSelect:e,...a}=t;return r.jsx(_.div,{"aria-hidden":!0,...a,ref:o})});tt.displayName=Jt;var Ce="SelectArrow",Qt=n.forwardRef((t,o)=>{const{__scopeSelect:e,...a}=t,i=ue(e),p=Y(Ce,e),l=q(Ce,e);return p.open&&l.position==="popper"?r.jsx(Et,{...i,...a,ref:o}):null});Qt.displayName=Ce;var eo="SelectBubbleInput",ot=n.forwardRef(({__scopeSelect:t,value:o,...e},a)=>{const i=n.useRef(null),p=k(a,i),l=Mt(o);return n.useEffect(()=>{const c=i.current;if(!c)return;const s=window.HTMLSelectElement.prototype,g=Object.getOwnPropertyDescriptor(s,"value").set;if(l!==o&&g){const w=new Event("change",{bubbles:!0});g.call(c,o),c.dispatchEvent(w)}},[l,o]),r.jsx(_.select,{...e,style:{...je,...e.style},ref:p,defaultValue:o})});ot.displayName=eo;function nt(t){return t===""||t===void 0}function rt(t){const o=yt(t),e=n.useRef(""),a=n.useRef(0),i=n.useCallback(l=>{const c=e.current+l;o(c),function s(f){e.current=f,window.clearTimeout(a.current),f!==""&&(a.current=window.setTimeout(()=>s(""),1e3))}(c)},[o]),p=n.useCallback(()=>{e.current="",window.clearTimeout(a.current)},[]);return n.useEffect(()=>()=>window.clearTimeout(a.current),[]),[e,i,p]}function st(t,o,e){const i=o.length>1&&Array.from(o).every(f=>f===o[0])?o[0]:o,p=e?t.indexOf(e):-1;let l=to(t,Math.max(p,0));i.length===1&&(l=l.filter(f=>f!==e));const s=l.find(f=>f.textValue.toLowerCase().startsWith(i.toLowerCase()));return s!==e?s:void 0}function to(t,o){return t.map((e,a)=>t[(o+a)%t.length])}var oo=Me,at=Oe,no=Le,ro=ke,so=Be,lt=Ve,ao=Fe,ct=$e,it=Ye,lo=qe,co=Xe,dt=Je,ut=Qe,pt=tt;const vo=oo,go=no,io=n.forwardRef(({className:t,children:o,...e},a)=>r.jsxs(at,{ref:a,className:G("flex h-10 w-full items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",t),...e,children:[o,r.jsx(ro,{asChild:!0,children:r.jsx(_e,{className:"h-4 w-4 opacity-50"})})]}));io.displayName=at.displayName;const ft=n.forwardRef(({className:t,...o},e)=>r.jsx(dt,{ref:e,className:G("flex cursor-default items-center justify-center py-1",t),...o,children:r.jsx(jt,{className:"h-4 w-4"})}));ft.displayName=dt.displayName;const mt=n.forwardRef(({className:t,...o},e)=>r.jsx(ut,{ref:e,className:G("flex cursor-default items-center justify-center py-1",t),...o,children:r.jsx(_e,{className:"h-4 w-4"})}));mt.displayName=ut.displayName;const uo=n.forwardRef(({className:t,children:o,position:e="popper",...a},i)=>r.jsx(so,{children:r.jsxs(lt,{ref:i,className:G("relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",t),position:e,...a,children:[r.jsx(ft,{}),r.jsx(ao,{className:G("p-1",e==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:o}),r.jsx(mt,{})]})}));uo.displayName=lt.displayName;const po=n.forwardRef(({className:t,...o},e)=>r.jsx(ct,{ref:e,className:G("py-1.5 pl-8 pr-2 text-sm font-semibold",t),...o}));po.displayName=ct.displayName;const fo=n.forwardRef(({className:t,children:o,...e},a)=>r.jsxs(it,{ref:a,className:G("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t),...e,children:[r.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:r.jsx(co,{children:r.jsx(_t,{className:"h-4 w-4"})})}),r.jsx(lo,{children:o})]}));fo.displayName=it.displayName;const mo=n.forwardRef(({className:t,...o},e)=>r.jsx(pt,{ref:e,className:G("-mx-1 my-1 h-px bg-muted",t),...o}));mo.displayName=pt.displayName;export{vo as S,io as a,go as b,uo as c,fo as d,Mt as u};
@@ -1 +0,0 @@
1
- import{r as s,H as C,y as I,j as a,z as H,E as y,G as M,V as z,a as x}from"./index-D-F4C6n_.js";import{u as A}from"./select-fri8gRof.js";var b="Switch",[U]=H(b),[q,L]=U(b),E=s.forwardRef((t,o)=>{const{__scopeSwitch:e,name:n,checked:r,defaultChecked:m,required:d,disabled:c,value:u="on",onCheckedChange:v,form:i,...w}=t,[l,p]=s.useState(null),S=C(o,h=>p(h)),k=s.useRef(!1),g=l?i||!!l.closest("form"):!0,[f,B]=I({prop:r,defaultProp:m??!1,onChange:v,caller:b});return a.jsxs(q,{scope:e,checked:f,disabled:c,children:[a.jsx(y.button,{type:"button",role:"switch","aria-checked":f,"aria-required":d,"data-state":j(f),"data-disabled":c?"":void 0,disabled:c,value:u,...w,ref:S,onClick:M(t.onClick,h=>{B(T=>!T),g&&(k.current=h.isPropagationStopped(),k.current||h.stopPropagation())})}),g&&a.jsx(N,{control:l,bubbles:!k.current,name:n,value:u,checked:f,required:d,disabled:c,form:i,style:{transform:"translateX(-100%)"}})]})});E.displayName=b;var P="SwitchThumb",R=s.forwardRef((t,o)=>{const{__scopeSwitch:e,...n}=t,r=L(P,e);return a.jsx(y.span,{"data-state":j(r.checked),"data-disabled":r.disabled?"":void 0,...n,ref:o})});R.displayName=P;var O="SwitchBubbleInput",N=s.forwardRef(({__scopeSwitch:t,control:o,checked:e,bubbles:n=!0,...r},m)=>{const d=s.useRef(null),c=C(d,m),u=A(e),v=z(o);return s.useEffect(()=>{const i=d.current;if(!i)return;const w=window.HTMLInputElement.prototype,p=Object.getOwnPropertyDescriptor(w,"checked").set;if(u!==e&&p){const S=new Event("click",{bubbles:n});p.call(i,e),i.dispatchEvent(S)}},[u,e,n]),a.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:e,...r,tabIndex:-1,ref:c,style:{...r.style,...v,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});N.displayName=O;function j(t){return t?"checked":"unchecked"}var _=E,D=R;const F=s.forwardRef(({className:t,...o},e)=>a.jsx(_,{className:x("peer inline-flex h-6 w-11 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input",t),...o,ref:e,children:a.jsx(D,{className:x("pointer-events-none block h-5 w-5 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-5 data-[state=unchecked]:translate-x-0")})}));F.displayName=_.displayName;export{F as S};