@chenpu17/cc-gw 0.7.21 → 0.8.0-alpha.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/LICENSE +1 -1
- package/README.md +98 -548
- package/package.json +41 -62
- package/src/cli/dist/index.js +95 -32
- package/src/web/dist/assets/About-g7O_JA6K.js +1 -0
- package/src/web/dist/assets/ApiKeys-CEJ9-jBz.js +1 -0
- package/src/web/dist/assets/ConfirmDialog-DwZk3ejq.js +1 -0
- package/src/web/dist/assets/Dashboard-OPVlXupp.js +1 -0
- package/src/web/dist/assets/EChart-CfTG8iSv.js +1 -0
- package/src/web/dist/assets/Events-D7p4pym8.js +1 -0
- package/src/web/dist/assets/Help-DbNTCxxV.js +8 -0
- package/src/web/dist/assets/Login-h9CRbinI.js +1 -0
- package/src/web/dist/assets/Logs-DN-Cl2dm.js +1 -0
- package/src/web/dist/assets/ModelManagement-CrpcomEc.js +1 -0
- package/src/web/dist/assets/PageHeader-CbpaEUEn.js +1 -0
- package/src/web/dist/assets/PageSection-6q9HngU5.js +1 -0
- package/src/web/dist/assets/Settings-Bp_GpSh3.js +1 -0
- package/src/web/dist/assets/Skeleton-DFeA7kZw.js +1 -0
- package/src/web/dist/assets/card-DRsnBFyp.js +1 -0
- package/src/web/dist/assets/charts-core-BjxPMAw_.js +12 -0
- package/src/web/dist/assets/charts-engine-B4YVo-Wh.js +16 -0
- package/src/web/dist/assets/charts-react-BxiU3S4Y.js +1 -0
- package/src/web/dist/assets/i18n-qAxAISVU.js +1 -0
- package/src/web/dist/assets/index-BKEgpvTe.js +61 -0
- package/src/web/dist/assets/index-BfFWdxjR.css +1 -0
- package/src/web/dist/assets/input-BCUUQfiv.js +1 -0
- package/src/web/dist/assets/label-CtuP7N6a.js +1 -0
- package/src/web/dist/assets/query-BnTlXVsy.js +1 -0
- package/src/web/dist/assets/radix-CwKvZelb.js +5 -0
- package/src/web/dist/assets/router-Ju3lwB-M.js +19 -0
- package/src/web/dist/assets/select-C-e-41FP.js +1 -0
- package/src/web/dist/assets/switch-D72iMnTO.js +1 -0
- package/src/web/dist/assets/useApiQuery-C4-HjWYY.js +1 -0
- package/src/web/dist/assets/vendor-UrUELLAG.js +317 -0
- package/src/web/dist/index.html +7 -2
- package/src/server/dist/index.js +0 -18202
- package/src/web/dist/assets/About-Bjq70P_K.js +0 -6
- package/src/web/dist/assets/ApiKeys-BHwlIBRG.js +0 -16
- package/src/web/dist/assets/Dashboard-Bv6E5M2u.js +0 -16
- package/src/web/dist/assets/Events-DyqUKr1b.js +0 -16
- package/src/web/dist/assets/Help-BNn_Zuo4.js +0 -23
- package/src/web/dist/assets/Login-BHXuuVq3.js +0 -1
- package/src/web/dist/assets/Logs-CRnJOy2J.js +0 -6
- package/src/web/dist/assets/ModelManagement-DAE8AYAE.js +0 -6
- package/src/web/dist/assets/PageHeader-D2u2opjK.js +0 -1
- package/src/web/dist/assets/PageSection-jfq2rgUu.js +0 -1
- package/src/web/dist/assets/Settings-CssUPWdg.js +0 -6
- package/src/web/dist/assets/Skeleton-BwMNCVcg.js +0 -1
- package/src/web/dist/assets/card-C9wVDhpJ.js +0 -1
- package/src/web/dist/assets/dialog-DbEoPxgf.js +0 -10
- package/src/web/dist/assets/index-B1EJcuR-.css +0 -1
- package/src/web/dist/assets/index-BjqieXJo.js +0 -48
- package/src/web/dist/assets/index-Blclkvp7.js +0 -280
- package/src/web/dist/assets/info-BmVX8zJd.js +0 -6
- package/src/web/dist/assets/input-CGgq_gCJ.js +0 -1
- package/src/web/dist/assets/label-BGUvZ4t2.js +0 -1
- package/src/web/dist/assets/refresh-cw-D7rJxbFV.js +0 -6
- package/src/web/dist/assets/select-Chuh7X1A.js +0 -11
- package/src/web/dist/assets/shield-Beuqdf31.js +0 -11
- package/src/web/dist/assets/switch-XbPwmM_b.js +0 -1
- package/src/web/dist/assets/useApiQuery-DiX6xcfY.js +0 -1
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import{c}from"./index-Blclkvp7.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 o=c("Info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]);export{o as I};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as s,j as i,a as n}from"./index-Blclkvp7.js";const a=s.forwardRef(({className:e,type:r,...o},t)=>i.jsx("input",{type:r,className:n("flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-base ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",e),ref:t,...o}));a.displayName="Input";export{a as I};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as o,j as r,a as t}from"./index-Blclkvp7.js";const l=o.forwardRef(({className:e,...a},s)=>r.jsx("label",{ref:s,className:t("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",e),...a}));l.displayName="Label";export{l as L};
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import{c as e}from"./index-Blclkvp7.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 t=e("RefreshCw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]]);export{t as R};
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import{c as Pe,r as n,o as Re,a5 as mt,p as be,j as r,R as ht,q as vt,v as Ie,a6 as gt,w as k,a7 as $,P as j,a8 as St,A as xt,x as P,z as wt,f as Ee,a9 as yt,D as Ct,H as It,E as Tt,G as bt,I as Nt,J as Pt,K as Rt,M as Et,a as G,Z as _t}from"./index-Blclkvp7.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 At=[" ","Enter","ArrowUp","ArrowDown"],Dt=[" ","Enter"],Q="Select",[ie,de,Ot]=gt(Q),[oe]=vt(Q,[Ot,Re]),ue=Re(),[Lt,Y]=oe(Q),[kt,Bt]=oe(Q),je=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=mt(f),[R,O]=be({prop:a,defaultProp:i??!1,onChange:p,caller:Q}),[W,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(ht,{...d,children:r.jsxs(Lt,{required:N,scope:o,trigger:v,onTriggerChange:y,valueNode:u,onValueNodeChange:h,valueNodeHasChildren:M,onValueNodeHasChildrenChange:A,contentId:Ie(),value:W,onValueChange:Z,open:R,onOpenChange:O,dir:ne,triggerPointerDownPosRef:B,disabled:b,children:[r.jsx(ie.Provider,{scope:o,children:r.jsx(kt,{scope:t.__scopeSelect,onNativeOptionAdd:n.useCallback(E=>{H(L=>new Set(L).add(E))},[]),onNativeOptionRemove:n.useCallback(E=>{H(L=>{const F=new Set(L);return F.delete(E),F})},[]),children:e})}),V?r.jsxs(tt,{"aria-hidden":!0,required:N,tabIndex:-1,name:g,autoComplete:w,value:W,onChange:E=>Z(E.target.value),disabled:b,form:T,children:[W===void 0?r.jsx("option",{value:""}):null,Array.from(K)]},U):null]})})};je.displayName=Q;var Me="SelectTrigger",Ae=n.forwardRef((t,o)=>{const{__scopeSelect:e,disabled:a=!1,...i}=t,p=ue(e),l=Y(Me,e),c=l.disabled||a,s=k(o,l.onTriggerChange),f=de(e),g=n.useRef("touch"),[w,b,N]=nt(d=>{const v=f().filter(h=>!h.disabled),y=v.find(h=>h.value===l.value),u=rt(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(j.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":ot(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===" ")&&At.includes(d.key)&&(T(),d.preventDefault())})})})});Ae.displayName=Me;var De="SelectValue",Oe=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(j.span,{...c,ref:w,style:{pointerEvents:"none"},children:ot(s.value)?r.jsx(r.Fragment,{children:l}):p})});Oe.displayName=De;var Vt="SelectIcon",Le=n.forwardRef((t,o)=>{const{__scopeSelect:e,children:a,...i}=t;return r.jsx(j.span,{"aria-hidden":!0,...i,ref:o,children:a||"▼"})});Le.displayName=Vt;var Ht="SelectPortal",ke=t=>r.jsx(wt,{asChild:!0,...t});ke.displayName=Ht;var ee="SelectContent",Be=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(Ve,{scope:t.__scopeSelect,children:r.jsx(ie.Slot,{scope:t.__scopeSelect,children:r.jsx("div",{children:t.children})})}),p):null}return r.jsx(He,{...t,ref:o})});Be.displayName=ee;var D=10,[Ve,q]=oe(ee),Ut="SelectContentImpl",Ft=bt("SelectContent.RemoveScroll"),He=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)),[O,W]=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,..._]=V().map(x=>x.ref.current),[C]=_.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([O,h]),[E,O,h]);n.useEffect(()=>{K&&L()},[K,L]);const{onOpenChange:F,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))}},_=C=>{m.x<=10&&m.y<=10?C.preventDefault():h.contains(C.target)||F(!1),document.removeEventListener("pointermove",I),z.current=null};return z.current!==null&&(document.addEventListener("pointermove",I),document.addEventListener("pointerup",_,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",I),document.removeEventListener("pointerup",_,{capture:!0})}}},[h,F,z]),n.useEffect(()=>{const m=()=>F(!1);return window.addEventListener("blur",m),window.addEventListener("resize",m),()=>{window.removeEventListener("blur",m),window.removeEventListener("resize",m)}},[F]);const[pe,ae]=nt(m=>{const I=V().filter(S=>!S.disabled),_=I.find(S=>S.ref.current===document.activeElement),C=rt(I,m,_);C&&setTimeout(()=>C.ref.current.focus())}),fe=n.useCallback((m,I,_)=>{const C=!U.current&&!_;(u.value!==void 0&&u.value===I||C)&&(W(m),C&&(U.current=!0))},[u.value]),me=n.useCallback(()=>h==null?void 0:h.focus(),[h]),te=n.useCallback((m,I,_)=>{const C=!U.current&&!_;(u.value!==void 0&&u.value===I||C)&&B(m)},[u.value]),le=a==="popper"?Se:Ue,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(Ve,{scope:e,content:h,viewport:A,onViewportChange:ne,itemRefCallback:fe,selectedItem:O,onItemLeave:me,itemTextRefCallback:te,focusSelectedItem:L,selectedItemText:Z,position:a,isPositioned:K,searchRef:pe,children:r.jsx(Tt,{as:Ft,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()}})})})})})})});He.displayName=Ut;var Wt="SelectItemAlignedPosition",Ue=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(),O=f.getBoundingClientRect(),W=p.valueNode.getBoundingClientRect(),Z=y.getBoundingClientRect();if(p.dir!=="rtl"){const S=Z.left-O.left,x=W.left-S,X=R.left-x,J=R.width+X,he=Math.max(J,O.width),ve=window.innerWidth-D,ge=Ne(x,[D,Math.max(D,ve-he)]);c.style.minWidth=J+"px",c.style.left=ge+"px"}else{const S=O.right-Z.right,x=window.innerWidth-W.right-S,X=window.innerWidth-R.right-x,J=R.width+X,he=Math.max(J,O.width),ve=window.innerWidth-D,ge=Ne(x,[D,Math.max(D,ve-he)]);c.style.minWidth=J+"px",c.style.right=ge+"px"}const B=b(),V=window.innerHeight-D*2,K=d.scrollHeight,H=window.getComputedStyle(f),U=parseInt(H.borderTopWidth,10),E=parseInt(H.paddingTop,10),L=parseInt(H.borderBottomWidth,10),F=parseInt(H.paddingBottom,10),z=U+E+K+F+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-D,le=V-te,re=v.offsetHeight/2,m=v.offsetTop+re,I=U+E+m,_=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)+_;c.style.height=X+"px",d.scrollTop=I-te+d.offsetTop}c.style.margin=`${D}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(zt,{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(j.div,{...i,ref:w,style:{boxSizing:"border-box",maxHeight:"100%",...i.style}})})})});Ue.displayName=Wt;var Kt="SelectPopperPosition",Se=n.forwardRef((t,o)=>{const{__scopeSelect:e,align:a="start",collisionPadding:i=D,...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=Kt;var[zt,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(j.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-D*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 We="SelectGroup",[$t,Gt]=oe(We),Yt=n.forwardRef((t,o)=>{const{__scopeSelect:e,...a}=t,i=Ie();return r.jsx($t,{scope:e,id:i,children:r.jsx(j.div,{role:"group","aria-labelledby":i,...a,ref:o})})});Yt.displayName=We;var Ke="SelectLabel",ze=n.forwardRef((t,o)=>{const{__scopeSelect:e,...a}=t,i=Gt(Ke,e);return r.jsx(j.div,{id:i.id,...a,ref:o})});ze.displayName=Ke;var ce="SelectItem",[qt,$e]=oe(ce),Ge=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(qt,{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(j.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===" "||(Dt.includes(u.key)&&y(),u.key===" "&&u.preventDefault())})})})})});Ge.displayName=ce;var se="SelectItemText",Ye=n.forwardRef((t,o)=>{const{__scopeSelect:e,className:a,style:i,...p}=t,l=Y(se,e),c=q(se,e),s=$e(se,e),f=Bt(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(j.span,{id:s.textId,...p,ref:b}),s.isSelected&&l.valueNode&&!l.valueNodeHasChildren?Ee.createPortal(p.children,l.valueNode):null]})});Ye.displayName=se;var qe="SelectItemIndicator",Ze=n.forwardRef((t,o)=>{const{__scopeSelect:e,...a}=t;return $e(qe,e).isSelected?r.jsx(j.span,{"aria-hidden":!0,...a,ref:o}):null});Ze.displayName=qe;var we="SelectScrollUpButton",Xe=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(Qe,{...t,ref:l,onAutoScroll:()=>{const{viewport:c,selectedItem:s}=e;c&&s&&(c.scrollTop=c.scrollTop-s.offsetHeight)}}):null});Xe.displayName=we;var ye="SelectScrollDownButton",Je=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(Qe,{...t,ref:l,onAutoScroll:()=>{const{viewport:c,selectedItem:s}=e;c&&s&&(c.scrollTop=c.scrollTop+s.offsetHeight)}}):null});Je.displayName=ye;var Qe=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(j.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()})})}),Zt="SelectSeparator",et=n.forwardRef((t,o)=>{const{__scopeSelect:e,...a}=t;return r.jsx(j.div,{"aria-hidden":!0,...a,ref:o})});et.displayName=Zt;var Ce="SelectArrow",Xt=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});Xt.displayName=Ce;var Jt="SelectBubbleInput",tt=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(j.select,{...e,style:{...St,...e.style},ref:p,defaultValue:o})});tt.displayName=Jt;function ot(t){return t===""||t===void 0}function nt(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 rt(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=Qt(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 Qt(t,o){return t.map((e,a)=>t[(o+a)%t.length])}var eo=je,st=Ae,to=Oe,oo=Le,no=ke,at=Be,ro=Fe,lt=ze,ct=Ge,so=Ye,ao=Ze,it=Xe,dt=Je,ut=et;const mo=eo,ho=to,lo=n.forwardRef(({className:t,children:o,...e},a)=>r.jsxs(st,{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(oo,{asChild:!0,children:r.jsx(_e,{className:"h-4 w-4 opacity-50"})})]}));lo.displayName=st.displayName;const pt=n.forwardRef(({className:t,...o},e)=>r.jsx(it,{ref:e,className:G("flex cursor-default items-center justify-center py-1",t),...o,children:r.jsx(jt,{className:"h-4 w-4"})}));pt.displayName=it.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(_e,{className:"h-4 w-4"})}));ft.displayName=dt.displayName;const co=n.forwardRef(({className:t,children:o,position:e="popper",...a},i)=>r.jsx(no,{children:r.jsxs(at,{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(pt,{}),r.jsx(ro,{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(ft,{})]})}));co.displayName=at.displayName;const io=n.forwardRef(({className:t,...o},e)=>r.jsx(lt,{ref:e,className:G("py-1.5 pl-8 pr-2 text-sm font-semibold",t),...o}));io.displayName=lt.displayName;const uo=n.forwardRef(({className:t,children:o,...e},a)=>r.jsxs(ct,{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(ao,{children:r.jsx(_t,{className:"h-4 w-4"})})}),r.jsx(so,{children:o})]}));uo.displayName=ct.displayName;const po=n.forwardRef(({className:t,...o},e)=>r.jsx(ut,{ref:e,className:G("-mx-1 my-1 h-px bg-muted",t),...o}));po.displayName=ut.displayName;export{jt as C,mo as S,lo as a,ho as b,co as c,uo as d,_e as e,Mt as u};
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import{c as e}from"./index-Blclkvp7.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 a=e("Copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);/**
|
|
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 t=e("Shield",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}]]);export{a as C,t as S};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as s,w as C,p as I,j as a,q as M,P as y,x as H,a4 as q,a as g}from"./index-Blclkvp7.js";import{u as A}from"./select-Chuh7X1A.js";var b="Switch",[U]=M(b),[z,L]=U(b),P=s.forwardRef((t,o)=>{const{__scopeSwitch:e,name:n,checked:r,defaultChecked:m,required:d,disabled:c,value:u="on",onCheckedChange:w,form:i,...v}=t,[l,p]=s.useState(null),S=C(o,h=>p(h)),k=s.useRef(!1),x=l?i||!!l.closest("form"):!0,[f,B]=I({prop:r,defaultProp:m??!1,onChange:w,caller:b});return a.jsxs(z,{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,...v,ref:S,onClick:H(t.onClick,h=>{B(T=>!T),x&&(k.current=h.isPropagationStopped(),k.current||h.stopPropagation())})}),x&&a.jsx(N,{control:l,bubbles:!k.current,name:n,value:u,checked:f,required:d,disabled:c,form:i,style:{transform:"translateX(-100%)"}})]})});P.displayName=b;var E="SwitchThumb",R=s.forwardRef((t,o)=>{const{__scopeSwitch:e,...n}=t,r=L(E,e);return a.jsx(y.span,{"data-state":j(r.checked),"data-disabled":r.disabled?"":void 0,...n,ref:o})});R.displayName=E;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),w=q(o);return s.useEffect(()=>{const i=d.current;if(!i)return;const v=window.HTMLInputElement.prototype,p=Object.getOwnPropertyDescriptor(v,"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,...w,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});N.displayName=O;function j(t){return t?"checked":"unchecked"}var _=P,D=R;const F=s.forwardRef(({className:t,...o},e)=>a.jsx(_,{className:g("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:g("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};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var ft=e=>{throw TypeError(e)};var Y=(e,t,s)=>t.has(e)||ft("Cannot "+s);var i=(e,t,s)=>(Y(e,t,"read from private field"),s?s.call(e):t.get(e)),b=(e,t,s)=>t.has(e)?ft("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,s),u=(e,t,s,r)=>(Y(e,t,"write to private field"),r?r.call(e,s):t.set(e,s),s),d=(e,t,s)=>(Y(e,t,"access private method"),s);import{S as It,ab as pt,ac as S,s as Z,ad as j,l as $,ae as tt,af as bt,ag as Ot,ah as q,ai as Tt,aj as wt,ak as yt,n as St,r as I,m as Qt,k as Mt,al as xt,d as _t,t as Ut}from"./index-Blclkvp7.js";var g,a,H,y,Q,U,E,O,z,F,D,M,x,T,P,n,B,et,st,it,rt,at,nt,ht,Ct,vt,Ft=(vt=class extends It{constructor(t,s){super();b(this,n);b(this,g);b(this,a);b(this,H);b(this,y);b(this,Q);b(this,U);b(this,E);b(this,O);b(this,z);b(this,F);b(this,D);b(this,M);b(this,x);b(this,T);b(this,P,new Set);this.options=s,u(this,g,t),u(this,O,null),u(this,E,pt()),this.bindMethods(),this.setOptions(s)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(i(this,a).addObserver(this),gt(i(this,a),this.options)?d(this,n,B).call(this):this.updateResult(),d(this,n,rt).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return ot(i(this,a),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return ot(i(this,a),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,d(this,n,at).call(this),d(this,n,nt).call(this),i(this,a).removeObserver(this)}setOptions(t){const s=this.options,r=i(this,a);if(this.options=i(this,g).defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof S(this.options.enabled,i(this,a))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");d(this,n,ht).call(this),i(this,a).setOptions(this.options),s._defaulted&&!Z(this.options,s)&&i(this,g).getQueryCache().notify({type:"observerOptionsUpdated",query:i(this,a),observer:this});const h=this.hasListeners();h&&mt(i(this,a),r,this.options,s)&&d(this,n,B).call(this),this.updateResult(),h&&(i(this,a)!==r||S(this.options.enabled,i(this,a))!==S(s.enabled,i(this,a))||j(this.options.staleTime,i(this,a))!==j(s.staleTime,i(this,a)))&&d(this,n,et).call(this);const o=d(this,n,st).call(this);h&&(i(this,a)!==r||S(this.options.enabled,i(this,a))!==S(s.enabled,i(this,a))||o!==i(this,T))&&d(this,n,it).call(this,o)}getOptimisticResult(t){const s=i(this,g).getQueryCache().build(i(this,g),t),r=this.createResult(s,t);return Pt(this,r)&&(u(this,y,r),u(this,U,this.options),u(this,Q,i(this,a).state)),r}getCurrentResult(){return i(this,y)}trackResult(t,s){return new Proxy(t,{get:(r,h)=>(this.trackProp(h),s==null||s(h),h==="promise"&&!this.options.experimental_prefetchInRender&&i(this,E).status==="pending"&&i(this,E).reject(new Error("experimental_prefetchInRender feature flag is not enabled")),Reflect.get(r,h))})}trackProp(t){i(this,P).add(t)}getCurrentQuery(){return i(this,a)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const s=i(this,g).defaultQueryOptions(t),r=i(this,g).getQueryCache().build(i(this,g),s);return r.fetch().then(()=>this.createResult(r,s))}fetch(t){return d(this,n,B).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),i(this,y)))}createResult(t,s){var dt;const r=i(this,a),h=this.options,o=i(this,y),c=i(this,Q),w=i(this,U),v=t!==r?t.state:i(this,H),{state:L}=t;let l={...L},N=!1,f;if(s._optimisticResults){const R=this.hasListeners(),W=!R&>(t,s),_=R&&mt(t,r,s,h);(W||_)&&(l={...l,...wt(L.data,t.options)}),s._optimisticResults==="isRestoring"&&(l.fetchStatus="idle")}let{error:k,errorUpdatedAt:A,status:m}=l;f=l.data;let V=!1;if(s.placeholderData!==void 0&&f===void 0&&m==="pending"){let R;o!=null&&o.isPlaceholderData&&s.placeholderData===(w==null?void 0:w.placeholderData)?(R=o.data,V=!0):R=typeof s.placeholderData=="function"?s.placeholderData((dt=i(this,D))==null?void 0:dt.state.data,i(this,D)):s.placeholderData,R!==void 0&&(m="success",f=yt(o==null?void 0:o.data,R,s),N=!0)}if(s.select&&f!==void 0&&!V)if(o&&f===(c==null?void 0:c.data)&&s.select===i(this,z))f=i(this,F);else try{u(this,z,s.select),f=s.select(f),f=yt(o==null?void 0:o.data,f,s),u(this,F,f),u(this,O,null)}catch(R){u(this,O,R)}i(this,O)&&(k=i(this,O),f=i(this,F),A=Date.now(),m="error");const G=l.fetchStatus==="fetching",J=m==="pending",X=m==="error",ut=J&&G,lt=f!==void 0,C={status:m,fetchStatus:l.fetchStatus,isPending:J,isSuccess:m==="success",isError:X,isInitialLoading:ut,isLoading:ut,data:f,dataUpdatedAt:l.dataUpdatedAt,error:k,errorUpdatedAt:A,failureCount:l.fetchFailureCount,failureReason:l.fetchFailureReason,errorUpdateCount:l.errorUpdateCount,isFetched:l.dataUpdateCount>0||l.errorUpdateCount>0,isFetchedAfterMount:l.dataUpdateCount>v.dataUpdateCount||l.errorUpdateCount>v.errorUpdateCount,isFetching:G,isRefetching:G&&!J,isLoadingError:X&&!lt,isPaused:l.fetchStatus==="paused",isPlaceholderData:N,isRefetchError:X&<,isStale:ct(t,s),refetch:this.refetch,promise:i(this,E),isEnabled:S(s.enabled,t)!==!1};if(this.options.experimental_prefetchInRender){const R=K=>{C.status==="error"?K.reject(C.error):C.data!==void 0&&K.resolve(C.data)},W=()=>{const K=u(this,E,C.promise=pt());R(K)},_=i(this,E);switch(_.status){case"pending":t.queryHash===r.queryHash&&R(_);break;case"fulfilled":(C.status==="error"||C.data!==_.value)&&W();break;case"rejected":(C.status!=="error"||C.error!==_.reason)&&W();break}}return C}updateResult(){const t=i(this,y),s=this.createResult(i(this,a),this.options);if(u(this,Q,i(this,a).state),u(this,U,this.options),i(this,Q).data!==void 0&&u(this,D,i(this,a)),Z(s,t))return;u(this,y,s);const r=()=>{if(!t)return!0;const{notifyOnChangeProps:h}=this.options,o=typeof h=="function"?h():h;if(o==="all"||!o&&!i(this,P).size)return!0;const c=new Set(o??i(this,P));return this.options.throwOnError&&c.add("error"),Object.keys(i(this,y)).some(w=>{const p=w;return i(this,y)[p]!==t[p]&&c.has(p)})};d(this,n,Ct).call(this,{listeners:r()})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&d(this,n,rt).call(this)}},g=new WeakMap,a=new WeakMap,H=new WeakMap,y=new WeakMap,Q=new WeakMap,U=new WeakMap,E=new WeakMap,O=new WeakMap,z=new WeakMap,F=new WeakMap,D=new WeakMap,M=new WeakMap,x=new WeakMap,T=new WeakMap,P=new WeakMap,n=new WeakSet,B=function(t){d(this,n,ht).call(this);let s=i(this,a).fetch(this.options,t);return t!=null&&t.throwOnError||(s=s.catch($)),s},et=function(){d(this,n,at).call(this);const t=j(this.options.staleTime,i(this,a));if(tt||i(this,y).isStale||!bt(t))return;const r=Ot(i(this,y).dataUpdatedAt,t)+1;u(this,M,q.setTimeout(()=>{i(this,y).isStale||this.updateResult()},r))},st=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(i(this,a)):this.options.refetchInterval)??!1},it=function(t){d(this,n,nt).call(this),u(this,T,t),!(tt||S(this.options.enabled,i(this,a))===!1||!bt(i(this,T))||i(this,T)===0)&&u(this,x,q.setInterval(()=>{(this.options.refetchIntervalInBackground||Tt.isFocused())&&d(this,n,B).call(this)},i(this,T)))},rt=function(){d(this,n,et).call(this),d(this,n,it).call(this,d(this,n,st).call(this))},at=function(){i(this,M)&&(q.clearTimeout(i(this,M)),u(this,M,void 0))},nt=function(){i(this,x)&&(q.clearInterval(i(this,x)),u(this,x,void 0))},ht=function(){const t=i(this,g).getQueryCache().build(i(this,g),this.options);if(t===i(this,a))return;const s=i(this,a);u(this,a,t),u(this,H,t.state),this.hasListeners()&&(s==null||s.removeObserver(this),t.addObserver(this))},Ct=function(t){St.batch(()=>{t.listeners&&this.listeners.forEach(s=>{s(i(this,y))}),i(this,g).getQueryCache().notify({query:i(this,a),type:"observerResultsUpdated"})})},vt);function Dt(e,t){return S(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===!1)}function gt(e,t){return Dt(e,t)||e.state.data!==void 0&&ot(e,t,t.refetchOnMount)}function ot(e,t,s){if(S(t.enabled,e)!==!1&&j(t.staleTime,e)!=="static"){const r=typeof s=="function"?s(e):s;return r==="always"||r!==!1&&ct(e,t)}return!1}function mt(e,t,s,r){return(e!==t||S(r.enabled,e)===!1)&&(!s.suspense||e.state.status!=="error")&&ct(e,s)}function ct(e,t){return S(t.enabled,e)!==!1&&e.isStaleByTime(j(t.staleTime,e))}function Pt(e,t){return!Z(e.getCurrentResult(),t)}var Et=I.createContext(!1),Lt=()=>I.useContext(Et);Et.Provider;function Nt(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var kt=I.createContext(Nt()),At=()=>I.useContext(kt),Bt=(e,t)=>{(e.suspense||e.throwOnError||e.experimental_prefetchInRender)&&(t.isReset()||(e.retryOnMount=!1))},jt=e=>{I.useEffect(()=>{e.clearReset()},[e])},Ht=({result:e,errorResetBoundary:t,throwOnError:s,query:r,suspense:h})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(h&&e.data===void 0||Qt(s,[e.error,r])),zt=e=>{if(e.suspense){const s=h=>h==="static"?h:Math.max(h??1e3,1e3),r=e.staleTime;e.staleTime=typeof r=="function"?(...h)=>s(r(...h)):s(r),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3))}},Vt=(e,t)=>e.isLoading&&e.isFetching&&!t,Wt=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,Rt=(e,t,s)=>t.fetchOptimistic(e).catch(()=>{s.clearReset()});function Kt(e,t,s){var l,N,f,k,A;const r=Lt(),h=At(),o=Mt(),c=o.defaultQueryOptions(e);(N=(l=o.getDefaultOptions().queries)==null?void 0:l._experimental_beforeQuery)==null||N.call(l,c),c._optimisticResults=r?"isRestoring":"optimistic",zt(c),Bt(c,h),jt(h);const w=!o.getQueryCache().get(c.queryHash),[p]=I.useState(()=>new t(o,c)),v=p.getOptimisticResult(c),L=!r&&e.subscribed!==!1;if(I.useSyncExternalStore(I.useCallback(m=>{const V=L?p.subscribe(St.batchCalls(m)):$;return p.updateResult(),V},[p,L]),()=>p.getCurrentResult(),()=>p.getCurrentResult()),I.useEffect(()=>{p.setOptions(c)},[c,p]),Wt(c,v))throw Rt(c,p,h);if(Ht({result:v,errorResetBoundary:h,throwOnError:c.throwOnError,query:o.getQueryCache().get(c.queryHash),suspense:c.suspense}))throw v.error;if((k=(f=o.getDefaultOptions().queries)==null?void 0:f._experimental_afterQuery)==null||k.call(f,c,v),c.experimental_prefetchInRender&&!tt&&Vt(v,r)){const m=w?Rt(c,p,h):(A=o.getQueryCache().get(c.queryHash))==null?void 0:A.promise;m==null||m.catch($).finally(()=>{p.updateResult()})}return c.notifyOnChangeProps?v:p.trackResult(v)}function qt(e,t){return Kt(e,Ft)}function Yt(e,t,s){return qt({queryKey:e,placeholderData:xt,...s,queryFn:async()=>{try{return(await _t.request(t)).data}catch(r){throw Ut(r)}}})}export{qt as a,Yt as u};
|