pi-mega-compact 0.20.73 → 0.20.74

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 (70) hide show
  1. package/dist/extensions/dashboard-server/routes-setup-cortex-actions.js +7 -0
  2. package/dist/extensions/dashboard-server/routes-setup-enc2a.js +21 -5
  3. package/dist/extensions/dashboard-server/routes-vector-cortex-helpers.js +8 -0
  4. package/extensions/dashboard-client/dist/assets/{AdminTab-ZyVtgYrZ.js → AdminTab-CqhIxrlT.js} +2 -2
  5. package/extensions/dashboard-client/dist/assets/{AdminTab-ZyVtgYrZ.js.map → AdminTab-CqhIxrlT.js.map} +1 -1
  6. package/extensions/dashboard-client/dist/assets/{AreaChart-7ms8Hk1m.js → AreaChart-D4EY7yiY.js} +2 -2
  7. package/extensions/dashboard-client/dist/assets/{AreaChart-7ms8Hk1m.js.map → AreaChart-D4EY7yiY.js.map} +1 -1
  8. package/extensions/dashboard-client/dist/assets/{BarChart-DeTE0NXA.js → BarChart-r_BFpd7a.js} +2 -2
  9. package/extensions/dashboard-client/dist/assets/{BarChart-DeTE0NXA.js.map → BarChart-r_BFpd7a.js.map} +1 -1
  10. package/extensions/dashboard-client/dist/assets/{CacheTab-CpIrpr_X.js → CacheTab-Bf5rwce6.js} +2 -2
  11. package/extensions/dashboard-client/dist/assets/{CacheTab-CpIrpr_X.js.map → CacheTab-Bf5rwce6.js.map} +1 -1
  12. package/extensions/dashboard-client/dist/assets/{ConfigTab-BNMrO7uz.js → ConfigTab-RFUXAUIP.js} +2 -2
  13. package/extensions/dashboard-client/dist/assets/{ConfigTab-BNMrO7uz.js.map → ConfigTab-RFUXAUIP.js.map} +1 -1
  14. package/extensions/dashboard-client/dist/assets/{EventsTab-j42vDTjs.js → EventsTab-DEqHbSHf.js} +2 -2
  15. package/extensions/dashboard-client/dist/assets/{EventsTab-j42vDTjs.js.map → EventsTab-DEqHbSHf.js.map} +1 -1
  16. package/extensions/dashboard-client/dist/assets/{HealthTab-D0Tf8XM_.js → HealthTab-WGEwtqmO.js} +2 -2
  17. package/extensions/dashboard-client/dist/assets/{HealthTab-D0Tf8XM_.js.map → HealthTab-WGEwtqmO.js.map} +1 -1
  18. package/extensions/dashboard-client/dist/assets/{MaintenanceTab-CleWX_RM.js → MaintenanceTab-ClT1D4P9.js} +2 -2
  19. package/extensions/dashboard-client/dist/assets/{MaintenanceTab-CleWX_RM.js.map → MaintenanceTab-ClT1D4P9.js.map} +1 -1
  20. package/extensions/dashboard-client/dist/assets/{MemoryMapTab-LUpPJzNP.js → MemoryMapTab-DaAxLJ5x.js} +2 -2
  21. package/extensions/dashboard-client/dist/assets/{MemoryMapTab-LUpPJzNP.js.map → MemoryMapTab-DaAxLJ5x.js.map} +1 -1
  22. package/extensions/dashboard-client/dist/assets/{MetricsCards-G4_uynTE.js → MetricsCards-CprVx2Yq.js} +2 -2
  23. package/extensions/dashboard-client/dist/assets/{MetricsCards-G4_uynTE.js.map → MetricsCards-CprVx2Yq.js.map} +1 -1
  24. package/extensions/dashboard-client/dist/assets/MetricsTab-8WBHRpRp.js +2 -0
  25. package/extensions/dashboard-client/dist/assets/{MetricsTab-yypKMQXf.js.map → MetricsTab-8WBHRpRp.js.map} +1 -1
  26. package/extensions/dashboard-client/dist/assets/{OverviewTab-M47NMRaT.js → OverviewTab-C5ClXheK.js} +2 -2
  27. package/extensions/dashboard-client/dist/assets/{OverviewTab-M47NMRaT.js.map → OverviewTab-C5ClXheK.js.map} +1 -1
  28. package/extensions/dashboard-client/dist/assets/{ReposTab-BX3ZxrAI.js → ReposTab-BOX5sOBg.js} +2 -2
  29. package/extensions/dashboard-client/dist/assets/{ReposTab-BX3ZxrAI.js.map → ReposTab-BOX5sOBg.js.map} +1 -1
  30. package/extensions/dashboard-client/dist/assets/{SessionsTab-CSUmsNeZ.js → SessionsTab-DKUO5gCp.js} +2 -2
  31. package/extensions/dashboard-client/dist/assets/{SessionsTab-CSUmsNeZ.js.map → SessionsTab-DKUO5gCp.js.map} +1 -1
  32. package/extensions/dashboard-client/dist/assets/{SetupTab-jF9BsQjw.js → SetupTab-CeeRk5Rd.js} +3 -3
  33. package/extensions/dashboard-client/dist/assets/{SetupTab-jF9BsQjw.js.map → SetupTab-CeeRk5Rd.js.map} +1 -1
  34. package/extensions/dashboard-client/dist/assets/{TimeSavedCard-qfwO1WJ3.js → TimeSavedCard-Dlhljae9.js} +2 -2
  35. package/extensions/dashboard-client/dist/assets/{TimeSavedCard-qfwO1WJ3.js.map → TimeSavedCard-Dlhljae9.js.map} +1 -1
  36. package/extensions/dashboard-client/dist/assets/{TurnMemoryView-C7NQo_xi.js → TurnMemoryView-B8fWymMP.js} +2 -2
  37. package/extensions/dashboard-client/dist/assets/{TurnMemoryView-C7NQo_xi.js.map → TurnMemoryView-B8fWymMP.js.map} +1 -1
  38. package/extensions/dashboard-client/dist/assets/TurnsTab-kJ4sfWSd.js +2 -0
  39. package/extensions/dashboard-client/dist/assets/{TurnsTab-D-19giqQ.js.map → TurnsTab-kJ4sfWSd.js.map} +1 -1
  40. package/extensions/dashboard-client/dist/assets/{VcStatusBadge-DTHlwuUJ.js → VcStatusBadge-FJZlkrD7.js} +2 -2
  41. package/extensions/dashboard-client/dist/assets/{VcStatusBadge-DTHlwuUJ.js.map → VcStatusBadge-FJZlkrD7.js.map} +1 -1
  42. package/extensions/dashboard-client/dist/assets/{VectorCortexTab-Dvgdcwvs.js → VectorCortexTab-C1iE6z4c.js} +2 -2
  43. package/extensions/dashboard-client/dist/assets/{VectorCortexTab-Dvgdcwvs.js.map → VectorCortexTab-C1iE6z4c.js.map} +1 -1
  44. package/extensions/dashboard-client/dist/assets/{WikiTab-CYUEAQmZ.js → WikiTab-BXqRiTbt.js} +2 -2
  45. package/extensions/dashboard-client/dist/assets/{WikiTab-CYUEAQmZ.js.map → WikiTab-BXqRiTbt.js.map} +1 -1
  46. package/extensions/dashboard-client/dist/assets/{button-DPOwTRN8.js → button-CUeN3VyF.js} +2 -2
  47. package/extensions/dashboard-client/dist/assets/{button-DPOwTRN8.js.map → button-CUeN3VyF.js.map} +1 -1
  48. package/extensions/dashboard-client/dist/assets/{card-CUipkgi9.js → card-DtOD33bZ.js} +2 -2
  49. package/extensions/dashboard-client/dist/assets/{card-CUipkgi9.js.map → card-DtOD33bZ.js.map} +1 -1
  50. package/extensions/dashboard-client/dist/assets/{client-extra-9lcKX-iO.js → client-extra-_tIKSPZ3.js} +2 -2
  51. package/extensions/dashboard-client/dist/assets/{client-extra-9lcKX-iO.js.map → client-extra-_tIKSPZ3.js.map} +1 -1
  52. package/extensions/dashboard-client/dist/assets/{generateCategoricalChart-_WpiJebf.js → generateCategoricalChart-8AyWGIrK.js} +2 -2
  53. package/extensions/dashboard-client/dist/assets/{generateCategoricalChart-_WpiJebf.js.map → generateCategoricalChart-8AyWGIrK.js.map} +1 -1
  54. package/extensions/dashboard-client/dist/assets/{index-DlHJ7LBL.js → index-BBJ8LglL.js} +3 -3
  55. package/extensions/dashboard-client/dist/assets/{index-DlHJ7LBL.js.map → index-BBJ8LglL.js.map} +1 -1
  56. package/extensions/dashboard-client/dist/assets/{switch-Cx6-1wnT.js → switch-Drm0yRgr.js} +2 -2
  57. package/extensions/dashboard-client/dist/assets/{switch-Cx6-1wnT.js.map → switch-Drm0yRgr.js.map} +1 -1
  58. package/extensions/dashboard-client/dist/assets/{toggle-Y3vbE0NG.js → toggle-DnRtZDPW.js} +2 -2
  59. package/extensions/dashboard-client/dist/assets/{toggle-Y3vbE0NG.js.map → toggle-DnRtZDPW.js.map} +1 -1
  60. package/extensions/dashboard-client/dist/assets/{useSSE-CnJdk56R.js → useSSE-l_bpRt_v.js} +2 -2
  61. package/extensions/dashboard-client/dist/assets/{useSSE-CnJdk56R.js.map → useSSE-l_bpRt_v.js.map} +1 -1
  62. package/extensions/dashboard-client/dist/index.html +1 -1
  63. package/extensions/dashboard-client/src/tabs/SetupTab/CortexRuntimeCard.tsx +6 -11
  64. package/extensions/dashboard-server/api-contracts/setup.ts +4 -2
  65. package/extensions/dashboard-server/routes-setup-cortex-actions.ts +7 -0
  66. package/extensions/dashboard-server/routes-setup-enc2a.ts +20 -10
  67. package/extensions/dashboard-server/routes-vector-cortex-helpers.ts +8 -0
  68. package/package.json +1 -1
  69. package/extensions/dashboard-client/dist/assets/MetricsTab-yypKMQXf.js +0 -2
  70. package/extensions/dashboard-client/dist/assets/TurnsTab-D-19giqQ.js +0 -2
@@ -1,2 +1,2 @@
1
- import{r as c,j as v,a3 as O,a as we,t as q}from"./index-DlHJ7LBL.js";var Ee=Object.defineProperty,R=(e,t)=>Ee(e,"name",{value:t,configurable:!0}),Z=!!(typeof window<"u"&&window.document&&window.document.createElement);function B(e,t,{checkForDefaultPrevented:n=!0}={}){return R(function(r){if(e?.(r),n===!1||!r||!r.defaultPrevented)return t?.(r)},"handleEvent")}R(B,"composeEventHandlers");function Ce(e){if(!Z)throw new Error("Cannot access window outside of the DOM");return e?.ownerDocument?.defaultView??window}R(Ce,"getOwnerWindow");function N(e){if(!Z)throw new Error("Cannot access document outside of the DOM");return e?.ownerDocument??document}R(N,"getOwnerDocument");function J(e,t=!1){const{activeElement:n}=N(e);if(!n?.nodeName)return null;if(K(n)&&n.contentDocument)return J(n.contentDocument.body,t);if(t){const o=n.getAttribute("aria-activedescendant");if(o){const r=N(n).getElementById(o);if(r)return r}}return n}R(J,"getActiveElement");function K(e){return e.tagName==="IFRAME"}R(K,"isFrame");var _e=Object.defineProperty,M=(e,t)=>_e(e,"name",{value:t,configurable:!0});function A(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}M(A,"setRef");function Q(...e){return t=>{let n=!1;const o=e.map(r=>{const s=A(r,t);return!n&&typeof s=="function"&&(n=!0),s});if(n)return()=>{for(let r=0;r<o.length;r++){const s=o[r];typeof s=="function"?s():A(e[r],null)}}}}M(Q,"composeRefs");function T(...e){return c.useCallback(Q(...e),e)}M(T,"useComposedRefs");var ye=Object.defineProperty,w=(e,t)=>ye(e,"name",{value:t,configurable:!0});function xe(e,t){const n=c.createContext(t);n.displayName=e+"Context";const o=w(s=>{const{children:i,...u}=s,a=c.useMemo(()=>u,Object.values(u));return v.jsx(n.Provider,{value:a,children:i})},"Provider");o.displayName=e+"Provider";function r(s,i={}){const{optional:u=!1}=i,a=c.useContext(n);if(a)return a;if(t!==void 0)return t;if(!u)throw new Error(`\`${s}\` must be used within \`${e}\``)}return w(r,"useContext"),[o,r]}w(xe,"createContext");function ee(e,t=[]){let n=[];function o(s,i){const u=c.createContext(i);u.displayName=s+"Context";const a=n.length;n=[...n,i];const f=w(l=>{const{scope:m,children:d,...h}=l,S=m?.[e]?.[a]||u,b=c.useMemo(()=>h,Object.values(h));return v.jsx(S.Provider,{value:b,children:d})},"Provider");f.displayName=s+"Provider";function p(l,m,d={}){const{optional:h=!1}=d,S=m?.[e]?.[a]||u,b=c.useContext(S);if(b)return b;if(i!==void 0)return i;if(!h)throw new Error(`\`${l}\` must be used within \`${s}\``)}return w(p,"useContext"),[f,p]}w(o,"createContext");const r=w(()=>{const s=n.map(i=>c.createContext(i));return w(function(u){const a=u?.[e]||s;return c.useMemo(()=>({[`__scope${e}`]:{...u,[e]:a}}),[u,a])},"useScope")},"createScope");return r.scopeName=e,[o,te(r,...t)]}w(ee,"createContextScope");function te(...e){const t=e[0];if(e.length===1)return t;const n=w(()=>{const o=e.map(r=>({useScope:r(),scopeName:r.scopeName}));return w(function(s){const i=o.reduce((u,{useScope:a,scopeName:f})=>{const l=a(s)[`__scope${f}`];return{...u,...l}},{});return c.useMemo(()=>({[`__scope${t.scopeName}`]:i}),[i])},"useComposedScopes")},"createScope");return n.scopeName=t.scopeName,n}w(te,"composeContextScopes");var z=globalThis?.document?c.useLayoutEffect:()=>{},Pe=Object.defineProperty,Re=(e,t)=>Pe(e,"name",{value:t,configurable:!0}),Y=O[" useEffectEvent ".trim().toString()],G=O[" useInsertionEffect ".trim().toString()];function ne(e){if(typeof Y=="function")return Y(e);const t=c.useRef(()=>{throw new Error("Cannot call an event handler while rendering.")});return typeof G=="function"?G(()=>{t.current=e}):z(()=>{t.current=e}),c.useMemo(()=>(...n)=>t.current?.(...n),[])}Re(ne,"useEffectEvent");var ke=Object.defineProperty,k=(e,t)=>ke(e,"name",{value:t,configurable:!0}),Ie=O[" useInsertionEffect ".trim().toString()]||z;function re({prop:e,defaultProp:t,onChange:n=k(()=>{},"onChange"),caller:o}){const[r,s,i]=oe({defaultProp:t,onChange:n}),u=e!==void 0,a=u?e:r,f=c.useCallback(p=>{if(u){const l=ce(p)?p(e):p;l!==e&&i.current?.(l)}else s(p)},[u,e,s,i]);return[a,f]}k(re,"useControllableState");function oe({defaultProp:e,onChange:t}){const[n,o]=c.useState(e),r=c.useRef(n),s=c.useRef(t);return Ie(()=>{s.current=t},[t]),c.useEffect(()=>{r.current!==n&&(s.current?.(n),r.current=n)},[n,r]),[n,o,s]}k(oe,"useUncontrolledState");function ce(e){return typeof e=="function"}k(ce,"isFunction");var X=Symbol("RADIX:SYNC_STATE");function $e(e,t,n,o){const{prop:r,defaultProp:s,onChange:i,caller:u}=t,a=r!==void 0,f=ne(i),p=[{...n,state:s}];o&&p.push(o);const[l,m]=c.useReducer((b,C)=>{if(C.type===X)return{...b,state:C.state};const _=e(b,C);return a&&!Object.is(_.state,b.state)&&f(_.state),_},...p),d=l.state,h=c.useRef(d);c.useEffect(()=>{h.current!==d&&(h.current=d,a||f(d))},[d,h,a]);const S=c.useMemo(()=>r!==void 0?{...l,state:r}:l,[l,r]);return c.useEffect(()=>{a&&!Object.is(r,l.state)&&m({type:X,state:r})},[r,l.state,a]),[S,m]}k($e,"useControllableStateReducer");var je=Object.defineProperty,Oe=(e,t)=>je(e,"name",{value:t,configurable:!0});function se(e){const[t,n]=c.useState(void 0);return z(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const o=new ResizeObserver(r=>{if(!Array.isArray(r)||!r.length)return;const s=r[0];let i,u;if("borderBoxSize"in s){const a=s.borderBoxSize,f=Array.isArray(a)?a[0]:a;i=f.inlineSize,u=f.blockSize}else i=e.offsetWidth,u=e.offsetHeight;n({width:i,height:u})});return o.observe(e,{box:"border-box"}),()=>o.unobserve(e)}else n(void 0)},[e]),t}Oe(se,"useSize");var Te=Object.defineProperty,E=(e,t)=>Te(e,"name",{value:t,configurable:!0});function ie(e){const t=c.forwardRef((n,o)=>{let{children:r,...s}=n,i=null,u=!1;const a=[];D(r)&&typeof j=="function"&&(r=j(r._payload)),c.Children.forEach(r,m=>{if(fe(m)){u=!0;const d=m;let h="child"in d.props?d.props.child:d.props.children;D(h)&&typeof j=="function"&&(h=j(h._payload)),i=Ae(d,h),a.push(i?.props?.children)}else a.push(m)}),i?i=c.cloneElement(i,void 0,a):!u&&c.Children.count(r)===1&&c.isValidElement(r)&&(i=r);const f=i?le(i):void 0,p=T(o,f);if(!i){if(r||r===0)throw new Error(u?Me(e):Be(e));return r}const l=ue(s,i.props??{});return i.type!==c.Fragment&&(l.ref=o?p:f),c.cloneElement(i,l)});return t.displayName=`${e}.Slot`,t}E(ie,"createSlot");var ae=Symbol.for("radix.slottable");function Ne(e){const t=E(n=>"child"in n?n.children(n.child):n.children,"Slottable");return t.displayName=`${e}.Slottable`,t.__radixId=ae,t}E(Ne,"createSlottable");var Ae=E((e,t)=>{if("child"in e.props){const n=e.props.child;return c.isValidElement(n)?c.cloneElement(n,void 0,e.props.children(n.props.children)):null}return c.isValidElement(t)?t:null},"getSlottableElementFromSlottable");function ue(e,t){const n={...t};for(const o in t){const r=e[o],s=t[o];/^on[A-Z]/.test(o)?r&&s?n[o]=(...u)=>{const a=s(...u);return r(...u),a}:r&&(n[o]=r):o==="style"?n[o]={...r,...s}:o==="className"&&(n[o]=[r,s].filter(Boolean).join(" "))}return{...e,...n}}E(ue,"mergeProps");function le(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}E(le,"getElementRef");function fe(e){return c.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===ae}E(fe,"isSlottable");var De=Symbol.for("react.lazy");function D(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===De&&"_payload"in e&&de(e._payload)}E(D,"isLazyComponent");function de(e){return typeof e=="object"&&e!==null&&"then"in e}E(de,"isPromiseLike");var Be=E(e=>`${e} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,"createSlotError"),Me=E(e=>`${e} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,"createSlottableError"),j=O[" use ".trim().toString()],ze=Object.defineProperty,Fe=(e,t)=>ze(e,"name",{value:t,configurable:!0}),Le=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],F=Le.reduce((e,t)=>{const n=ie(`Primitive.${t}`),o=c.forwardRef((r,s)=>{const{asChild:i,...u}=r,a=i?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),v.jsx(a,{...u,ref:s})});return o.displayName=`Primitive.${t}`,{...e,[t]:o}},{});function He(e,t){e&&we.flushSync(()=>e.dispatchEvent(t))}Fe(He,"dispatchDiscreteCustomEvent");var Ue=Object.defineProperty,x=(e,t)=>Ue(e,"name",{value:t,configurable:!0}),L="Switch",[We,tt]=ee(L),[Ve,H]=We(L);function pe(e){const{__scopeSwitch:t,checked:n,children:o,defaultChecked:r,disabled:s,form:i,name:u,onCheckedChange:a,required:f,value:p="on",internal_do_not_use_render:l}=e,[m,d]=re({prop:n,defaultProp:r??!1,onChange:a,caller:L}),[h,S]=c.useState(null),[b,C]=c.useState(null),_=c.useRef(!1),[g,y]=c.useReducer(P=>P+1,0),I=h?!!i||!!h.closest("form"):!0,$={checked:m,setChecked:d,disabled:s,control:h,setControl:S,name:u,form:i,value:p,hasConsumerStoppedPropagationRef:_,userInteractionCount:g,onUserInteraction:y,required:f,defaultChecked:r,isFormControl:I,bubbleInput:b,setBubbleInput:C};return v.jsx(Ve,{scope:t,...$,children:me(l)?l($):o})}x(pe,"SwitchProvider");var qe="SwitchTrigger",Ye=c.forwardRef(x(function({__scopeSwitch:t,onClick:n,...o},r){const{control:s,form:i,value:u,disabled:a,checked:f,required:p,setControl:l,setChecked:m,hasConsumerStoppedPropagationRef:d,onUserInteraction:h,isFormControl:S,bubbleInput:b}=H(qe,t),C=T(r,l),_=c.useRef(f);return c.useEffect(()=>{const g=i?s?.ownerDocument.getElementById(i):s?.form;if(g instanceof HTMLFormElement){const y=x(()=>m(_.current),"reset");return g.addEventListener("reset",y),()=>g.removeEventListener("reset",y)}},[s,i,m]),v.jsx(F.button,{type:"button",role:"switch","aria-checked":f,"aria-required":p,"data-state":U(f),"data-disabled":a?"":void 0,disabled:a,value:u,...o,ref:C,onClick:B(n,g=>{h(),m(y=>!y),b&&S&&(d.current=g.isPropagationStopped(),d.current||g.stopPropagation())})})},"SwitchTrigger")),he=c.forwardRef(x(function(t,n){const{__scopeSwitch:o,name:r,checked:s,defaultChecked:i,required:u,disabled:a,value:f,onCheckedChange:p,form:l,...m}=t;return v.jsx(pe,{__scopeSwitch:o,checked:s,defaultChecked:i,disabled:a,required:u,onCheckedChange:p,name:r,form:l,value:f,internal_do_not_use_render:({isFormControl:d})=>v.jsxs(v.Fragment,{children:[v.jsx(Ye,{...m,ref:n,__scopeSwitch:o}),d&&v.jsx(Je,{__scopeSwitch:o})]})})},"Switch")),Ge="SwitchThumb",Xe=c.forwardRef(x(function(t,n){const{__scopeSwitch:o,...r}=t,s=H(Ge,o);return v.jsx(F.span,{"data-state":U(s.checked),"data-disabled":s.disabled?"":void 0,...r,ref:n})},"SwitchThumb")),Ze="SwitchBubbleInput",Je=c.forwardRef(x(function({__scopeSwitch:t,onClick:n,...o},r){const{control:s,hasConsumerStoppedPropagationRef:i,userInteractionCount:u,checked:a,defaultChecked:f,required:p,disabled:l,name:m,value:d,form:h,bubbleInput:S,setBubbleInput:b}=H(Ze,t),C=T(r,b),_=se(s),g=c.useRef(!1),y=c.useRef(a),I=c.useRef(u);c.useEffect(()=>{const P=S;if(!P)return;const be=window.HTMLInputElement.prototype,W=Object.getOwnPropertyDescriptor(be,"checked").set,V=u!==I.current;I.current=u;const ve=y.current!==a;y.current=a;const Se=!(V&&i.current);if(ve&&W){g.current=!V;const ge=new Event("click",{bubbles:Se});W.call(P,a),P.dispatchEvent(ge),g.current=!1}},[S,a,i,u]);const $=c.useRef(a);return v.jsx(F.input,{type:"checkbox","aria-hidden":!0,defaultChecked:f??$.current,required:p,disabled:l,name:m,value:d,form:h,...o,tabIndex:-1,ref:C,onClick:B(n,P=>{g.current&&P.stopPropagation()}),style:{...o.style,..._,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})},"SwitchBubbleInput"));function me(e){return typeof e=="function"}x(me,"isFunction");function U(e){return e?"checked":"unchecked"}x(U,"getState");const Ke=c.forwardRef(({className:e,...t},n)=>v.jsx(he,{ref:n,className:q("peer inline-flex h-5 w-9 shrink-0 cursor-pointer items-center rounded-full border border-border transition-colors data-[state=checked]:bg-primary data-[state=unchecked]:bg-bg-elevated focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary/60 disabled:cursor-not-allowed disabled:opacity-50",e),...t,children:v.jsx(Xe,{className:q("pointer-events-none block h-4 w-4 rounded-full bg-foreground shadow-lg transition-transform data-[state=checked]:translate-x-4 data-[state=unchecked]:translate-x-0.5")})}));Ke.displayName=he.displayName;export{Ke as S};
2
- //# sourceMappingURL=switch-Cx6-1wnT.js.map
1
+ import{r as c,j as v,a3 as O,a as we,t as q}from"./index-BBJ8LglL.js";var Ee=Object.defineProperty,R=(e,t)=>Ee(e,"name",{value:t,configurable:!0}),Z=!!(typeof window<"u"&&window.document&&window.document.createElement);function B(e,t,{checkForDefaultPrevented:n=!0}={}){return R(function(r){if(e?.(r),n===!1||!r||!r.defaultPrevented)return t?.(r)},"handleEvent")}R(B,"composeEventHandlers");function Ce(e){if(!Z)throw new Error("Cannot access window outside of the DOM");return e?.ownerDocument?.defaultView??window}R(Ce,"getOwnerWindow");function N(e){if(!Z)throw new Error("Cannot access document outside of the DOM");return e?.ownerDocument??document}R(N,"getOwnerDocument");function J(e,t=!1){const{activeElement:n}=N(e);if(!n?.nodeName)return null;if(K(n)&&n.contentDocument)return J(n.contentDocument.body,t);if(t){const o=n.getAttribute("aria-activedescendant");if(o){const r=N(n).getElementById(o);if(r)return r}}return n}R(J,"getActiveElement");function K(e){return e.tagName==="IFRAME"}R(K,"isFrame");var _e=Object.defineProperty,M=(e,t)=>_e(e,"name",{value:t,configurable:!0});function A(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}M(A,"setRef");function Q(...e){return t=>{let n=!1;const o=e.map(r=>{const s=A(r,t);return!n&&typeof s=="function"&&(n=!0),s});if(n)return()=>{for(let r=0;r<o.length;r++){const s=o[r];typeof s=="function"?s():A(e[r],null)}}}}M(Q,"composeRefs");function T(...e){return c.useCallback(Q(...e),e)}M(T,"useComposedRefs");var ye=Object.defineProperty,w=(e,t)=>ye(e,"name",{value:t,configurable:!0});function xe(e,t){const n=c.createContext(t);n.displayName=e+"Context";const o=w(s=>{const{children:i,...u}=s,a=c.useMemo(()=>u,Object.values(u));return v.jsx(n.Provider,{value:a,children:i})},"Provider");o.displayName=e+"Provider";function r(s,i={}){const{optional:u=!1}=i,a=c.useContext(n);if(a)return a;if(t!==void 0)return t;if(!u)throw new Error(`\`${s}\` must be used within \`${e}\``)}return w(r,"useContext"),[o,r]}w(xe,"createContext");function ee(e,t=[]){let n=[];function o(s,i){const u=c.createContext(i);u.displayName=s+"Context";const a=n.length;n=[...n,i];const f=w(l=>{const{scope:m,children:d,...h}=l,S=m?.[e]?.[a]||u,b=c.useMemo(()=>h,Object.values(h));return v.jsx(S.Provider,{value:b,children:d})},"Provider");f.displayName=s+"Provider";function p(l,m,d={}){const{optional:h=!1}=d,S=m?.[e]?.[a]||u,b=c.useContext(S);if(b)return b;if(i!==void 0)return i;if(!h)throw new Error(`\`${l}\` must be used within \`${s}\``)}return w(p,"useContext"),[f,p]}w(o,"createContext");const r=w(()=>{const s=n.map(i=>c.createContext(i));return w(function(u){const a=u?.[e]||s;return c.useMemo(()=>({[`__scope${e}`]:{...u,[e]:a}}),[u,a])},"useScope")},"createScope");return r.scopeName=e,[o,te(r,...t)]}w(ee,"createContextScope");function te(...e){const t=e[0];if(e.length===1)return t;const n=w(()=>{const o=e.map(r=>({useScope:r(),scopeName:r.scopeName}));return w(function(s){const i=o.reduce((u,{useScope:a,scopeName:f})=>{const l=a(s)[`__scope${f}`];return{...u,...l}},{});return c.useMemo(()=>({[`__scope${t.scopeName}`]:i}),[i])},"useComposedScopes")},"createScope");return n.scopeName=t.scopeName,n}w(te,"composeContextScopes");var z=globalThis?.document?c.useLayoutEffect:()=>{},Pe=Object.defineProperty,Re=(e,t)=>Pe(e,"name",{value:t,configurable:!0}),Y=O[" useEffectEvent ".trim().toString()],G=O[" useInsertionEffect ".trim().toString()];function ne(e){if(typeof Y=="function")return Y(e);const t=c.useRef(()=>{throw new Error("Cannot call an event handler while rendering.")});return typeof G=="function"?G(()=>{t.current=e}):z(()=>{t.current=e}),c.useMemo(()=>(...n)=>t.current?.(...n),[])}Re(ne,"useEffectEvent");var ke=Object.defineProperty,k=(e,t)=>ke(e,"name",{value:t,configurable:!0}),Ie=O[" useInsertionEffect ".trim().toString()]||z;function re({prop:e,defaultProp:t,onChange:n=k(()=>{},"onChange"),caller:o}){const[r,s,i]=oe({defaultProp:t,onChange:n}),u=e!==void 0,a=u?e:r,f=c.useCallback(p=>{if(u){const l=ce(p)?p(e):p;l!==e&&i.current?.(l)}else s(p)},[u,e,s,i]);return[a,f]}k(re,"useControllableState");function oe({defaultProp:e,onChange:t}){const[n,o]=c.useState(e),r=c.useRef(n),s=c.useRef(t);return Ie(()=>{s.current=t},[t]),c.useEffect(()=>{r.current!==n&&(s.current?.(n),r.current=n)},[n,r]),[n,o,s]}k(oe,"useUncontrolledState");function ce(e){return typeof e=="function"}k(ce,"isFunction");var X=Symbol("RADIX:SYNC_STATE");function $e(e,t,n,o){const{prop:r,defaultProp:s,onChange:i,caller:u}=t,a=r!==void 0,f=ne(i),p=[{...n,state:s}];o&&p.push(o);const[l,m]=c.useReducer((b,C)=>{if(C.type===X)return{...b,state:C.state};const _=e(b,C);return a&&!Object.is(_.state,b.state)&&f(_.state),_},...p),d=l.state,h=c.useRef(d);c.useEffect(()=>{h.current!==d&&(h.current=d,a||f(d))},[d,h,a]);const S=c.useMemo(()=>r!==void 0?{...l,state:r}:l,[l,r]);return c.useEffect(()=>{a&&!Object.is(r,l.state)&&m({type:X,state:r})},[r,l.state,a]),[S,m]}k($e,"useControllableStateReducer");var je=Object.defineProperty,Oe=(e,t)=>je(e,"name",{value:t,configurable:!0});function se(e){const[t,n]=c.useState(void 0);return z(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const o=new ResizeObserver(r=>{if(!Array.isArray(r)||!r.length)return;const s=r[0];let i,u;if("borderBoxSize"in s){const a=s.borderBoxSize,f=Array.isArray(a)?a[0]:a;i=f.inlineSize,u=f.blockSize}else i=e.offsetWidth,u=e.offsetHeight;n({width:i,height:u})});return o.observe(e,{box:"border-box"}),()=>o.unobserve(e)}else n(void 0)},[e]),t}Oe(se,"useSize");var Te=Object.defineProperty,E=(e,t)=>Te(e,"name",{value:t,configurable:!0});function ie(e){const t=c.forwardRef((n,o)=>{let{children:r,...s}=n,i=null,u=!1;const a=[];D(r)&&typeof j=="function"&&(r=j(r._payload)),c.Children.forEach(r,m=>{if(fe(m)){u=!0;const d=m;let h="child"in d.props?d.props.child:d.props.children;D(h)&&typeof j=="function"&&(h=j(h._payload)),i=Ae(d,h),a.push(i?.props?.children)}else a.push(m)}),i?i=c.cloneElement(i,void 0,a):!u&&c.Children.count(r)===1&&c.isValidElement(r)&&(i=r);const f=i?le(i):void 0,p=T(o,f);if(!i){if(r||r===0)throw new Error(u?Me(e):Be(e));return r}const l=ue(s,i.props??{});return i.type!==c.Fragment&&(l.ref=o?p:f),c.cloneElement(i,l)});return t.displayName=`${e}.Slot`,t}E(ie,"createSlot");var ae=Symbol.for("radix.slottable");function Ne(e){const t=E(n=>"child"in n?n.children(n.child):n.children,"Slottable");return t.displayName=`${e}.Slottable`,t.__radixId=ae,t}E(Ne,"createSlottable");var Ae=E((e,t)=>{if("child"in e.props){const n=e.props.child;return c.isValidElement(n)?c.cloneElement(n,void 0,e.props.children(n.props.children)):null}return c.isValidElement(t)?t:null},"getSlottableElementFromSlottable");function ue(e,t){const n={...t};for(const o in t){const r=e[o],s=t[o];/^on[A-Z]/.test(o)?r&&s?n[o]=(...u)=>{const a=s(...u);return r(...u),a}:r&&(n[o]=r):o==="style"?n[o]={...r,...s}:o==="className"&&(n[o]=[r,s].filter(Boolean).join(" "))}return{...e,...n}}E(ue,"mergeProps");function le(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}E(le,"getElementRef");function fe(e){return c.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===ae}E(fe,"isSlottable");var De=Symbol.for("react.lazy");function D(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===De&&"_payload"in e&&de(e._payload)}E(D,"isLazyComponent");function de(e){return typeof e=="object"&&e!==null&&"then"in e}E(de,"isPromiseLike");var Be=E(e=>`${e} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,"createSlotError"),Me=E(e=>`${e} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,"createSlottableError"),j=O[" use ".trim().toString()],ze=Object.defineProperty,Fe=(e,t)=>ze(e,"name",{value:t,configurable:!0}),Le=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],F=Le.reduce((e,t)=>{const n=ie(`Primitive.${t}`),o=c.forwardRef((r,s)=>{const{asChild:i,...u}=r,a=i?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),v.jsx(a,{...u,ref:s})});return o.displayName=`Primitive.${t}`,{...e,[t]:o}},{});function He(e,t){e&&we.flushSync(()=>e.dispatchEvent(t))}Fe(He,"dispatchDiscreteCustomEvent");var Ue=Object.defineProperty,x=(e,t)=>Ue(e,"name",{value:t,configurable:!0}),L="Switch",[We,tt]=ee(L),[Ve,H]=We(L);function pe(e){const{__scopeSwitch:t,checked:n,children:o,defaultChecked:r,disabled:s,form:i,name:u,onCheckedChange:a,required:f,value:p="on",internal_do_not_use_render:l}=e,[m,d]=re({prop:n,defaultProp:r??!1,onChange:a,caller:L}),[h,S]=c.useState(null),[b,C]=c.useState(null),_=c.useRef(!1),[g,y]=c.useReducer(P=>P+1,0),I=h?!!i||!!h.closest("form"):!0,$={checked:m,setChecked:d,disabled:s,control:h,setControl:S,name:u,form:i,value:p,hasConsumerStoppedPropagationRef:_,userInteractionCount:g,onUserInteraction:y,required:f,defaultChecked:r,isFormControl:I,bubbleInput:b,setBubbleInput:C};return v.jsx(Ve,{scope:t,...$,children:me(l)?l($):o})}x(pe,"SwitchProvider");var qe="SwitchTrigger",Ye=c.forwardRef(x(function({__scopeSwitch:t,onClick:n,...o},r){const{control:s,form:i,value:u,disabled:a,checked:f,required:p,setControl:l,setChecked:m,hasConsumerStoppedPropagationRef:d,onUserInteraction:h,isFormControl:S,bubbleInput:b}=H(qe,t),C=T(r,l),_=c.useRef(f);return c.useEffect(()=>{const g=i?s?.ownerDocument.getElementById(i):s?.form;if(g instanceof HTMLFormElement){const y=x(()=>m(_.current),"reset");return g.addEventListener("reset",y),()=>g.removeEventListener("reset",y)}},[s,i,m]),v.jsx(F.button,{type:"button",role:"switch","aria-checked":f,"aria-required":p,"data-state":U(f),"data-disabled":a?"":void 0,disabled:a,value:u,...o,ref:C,onClick:B(n,g=>{h(),m(y=>!y),b&&S&&(d.current=g.isPropagationStopped(),d.current||g.stopPropagation())})})},"SwitchTrigger")),he=c.forwardRef(x(function(t,n){const{__scopeSwitch:o,name:r,checked:s,defaultChecked:i,required:u,disabled:a,value:f,onCheckedChange:p,form:l,...m}=t;return v.jsx(pe,{__scopeSwitch:o,checked:s,defaultChecked:i,disabled:a,required:u,onCheckedChange:p,name:r,form:l,value:f,internal_do_not_use_render:({isFormControl:d})=>v.jsxs(v.Fragment,{children:[v.jsx(Ye,{...m,ref:n,__scopeSwitch:o}),d&&v.jsx(Je,{__scopeSwitch:o})]})})},"Switch")),Ge="SwitchThumb",Xe=c.forwardRef(x(function(t,n){const{__scopeSwitch:o,...r}=t,s=H(Ge,o);return v.jsx(F.span,{"data-state":U(s.checked),"data-disabled":s.disabled?"":void 0,...r,ref:n})},"SwitchThumb")),Ze="SwitchBubbleInput",Je=c.forwardRef(x(function({__scopeSwitch:t,onClick:n,...o},r){const{control:s,hasConsumerStoppedPropagationRef:i,userInteractionCount:u,checked:a,defaultChecked:f,required:p,disabled:l,name:m,value:d,form:h,bubbleInput:S,setBubbleInput:b}=H(Ze,t),C=T(r,b),_=se(s),g=c.useRef(!1),y=c.useRef(a),I=c.useRef(u);c.useEffect(()=>{const P=S;if(!P)return;const be=window.HTMLInputElement.prototype,W=Object.getOwnPropertyDescriptor(be,"checked").set,V=u!==I.current;I.current=u;const ve=y.current!==a;y.current=a;const Se=!(V&&i.current);if(ve&&W){g.current=!V;const ge=new Event("click",{bubbles:Se});W.call(P,a),P.dispatchEvent(ge),g.current=!1}},[S,a,i,u]);const $=c.useRef(a);return v.jsx(F.input,{type:"checkbox","aria-hidden":!0,defaultChecked:f??$.current,required:p,disabled:l,name:m,value:d,form:h,...o,tabIndex:-1,ref:C,onClick:B(n,P=>{g.current&&P.stopPropagation()}),style:{...o.style,..._,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})},"SwitchBubbleInput"));function me(e){return typeof e=="function"}x(me,"isFunction");function U(e){return e?"checked":"unchecked"}x(U,"getState");const Ke=c.forwardRef(({className:e,...t},n)=>v.jsx(he,{ref:n,className:q("peer inline-flex h-5 w-9 shrink-0 cursor-pointer items-center rounded-full border border-border transition-colors data-[state=checked]:bg-primary data-[state=unchecked]:bg-bg-elevated focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary/60 disabled:cursor-not-allowed disabled:opacity-50",e),...t,children:v.jsx(Xe,{className:q("pointer-events-none block h-4 w-4 rounded-full bg-foreground shadow-lg transition-transform data-[state=checked]:translate-x-4 data-[state=unchecked]:translate-x-0.5")})}));Ke.displayName=he.displayName;export{Ke as S};
2
+ //# sourceMappingURL=switch-Drm0yRgr.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"switch-Cx6-1wnT.js","sources":["../../node_modules/@radix-ui/primitive/dist/index.mjs","../../node_modules/@radix-ui/react-compose-refs/dist/index.mjs","../../node_modules/@radix-ui/react-context/dist/index.mjs","../../node_modules/@radix-ui/react-use-layout-effect/dist/index.mjs","../../node_modules/@radix-ui/react-use-effect-event/dist/index.mjs","../../node_modules/@radix-ui/react-use-controllable-state/dist/index.mjs","../../node_modules/@radix-ui/react-use-size/dist/index.mjs","../../node_modules/@radix-ui/react-slot/dist/index.mjs","../../node_modules/@radix-ui/react-primitive/dist/index.mjs","../../node_modules/@radix-ui/react-switch/dist/index.mjs","../../src/components/ui/switch.tsx"],"sourcesContent":["var __defProp = Object.defineProperty;\nvar __name = (target, value) => __defProp(target, \"name\", { value, configurable: true });\n\n// src/primitive.tsx\nvar canUseDOM = !!(typeof window !== \"undefined\" && window.document && window.document.createElement);\nfunction composeEventHandlers(originalEventHandler, ourEventHandler, { checkForDefaultPrevented = true } = {}) {\n return /* @__PURE__ */ __name(function handleEvent(event) {\n originalEventHandler?.(event);\n if (checkForDefaultPrevented === false || !event || !event.defaultPrevented) {\n return ourEventHandler?.(event);\n }\n }, \"handleEvent\");\n}\n__name(composeEventHandlers, \"composeEventHandlers\");\nfunction getOwnerWindow(element) {\n if (!canUseDOM) {\n throw new Error(\"Cannot access window outside of the DOM\");\n }\n return element?.ownerDocument?.defaultView ?? window;\n}\n__name(getOwnerWindow, \"getOwnerWindow\");\nfunction getOwnerDocument(element) {\n if (!canUseDOM) {\n throw new Error(\"Cannot access document outside of the DOM\");\n }\n return element?.ownerDocument ?? document;\n}\n__name(getOwnerDocument, \"getOwnerDocument\");\nfunction getActiveElement(node, activeDescendant = false) {\n const { activeElement } = getOwnerDocument(node);\n if (!activeElement?.nodeName) {\n return null;\n }\n if (isFrame(activeElement) && activeElement.contentDocument) {\n return getActiveElement(activeElement.contentDocument.body, activeDescendant);\n }\n if (activeDescendant) {\n const id = activeElement.getAttribute(\"aria-activedescendant\");\n if (id) {\n const element = getOwnerDocument(activeElement).getElementById(id);\n if (element) {\n return element;\n }\n }\n }\n return activeElement;\n}\n__name(getActiveElement, \"getActiveElement\");\nfunction isFrame(element) {\n return element.tagName === \"IFRAME\";\n}\n__name(isFrame, \"isFrame\");\nexport {\n canUseDOM,\n composeEventHandlers,\n getActiveElement,\n getOwnerDocument,\n getOwnerWindow,\n isFrame\n};\n//# sourceMappingURL=index.mjs.map\n","var __defProp = Object.defineProperty;\nvar __name = (target, value) => __defProp(target, \"name\", { value, configurable: true });\n\n// src/compose-refs.tsx\nimport * as React from \"react\";\nfunction setRef(ref, value) {\n if (typeof ref === \"function\") {\n return ref(value);\n } else if (ref !== null && ref !== void 0) {\n ref.current = value;\n }\n}\n__name(setRef, \"setRef\");\nfunction composeRefs(...refs) {\n return (node) => {\n let hasCleanup = false;\n const cleanups = refs.map((ref) => {\n const cleanup = setRef(ref, node);\n if (!hasCleanup && typeof cleanup == \"function\") {\n hasCleanup = true;\n }\n return cleanup;\n });\n if (hasCleanup) {\n return () => {\n for (let i = 0; i < cleanups.length; i++) {\n const cleanup = cleanups[i];\n if (typeof cleanup == \"function\") {\n cleanup();\n } else {\n setRef(refs[i], null);\n }\n }\n };\n }\n };\n}\n__name(composeRefs, \"composeRefs\");\nfunction useComposedRefs(...refs) {\n return React.useCallback(composeRefs(...refs), refs);\n}\n__name(useComposedRefs, \"useComposedRefs\");\nexport {\n composeRefs,\n useComposedRefs\n};\n//# sourceMappingURL=index.mjs.map\n","var __defProp = Object.defineProperty;\nvar __name = (target, value) => __defProp(target, \"name\", { value, configurable: true });\n\n// src/create-context.tsx\nimport * as React from \"react\";\nimport { jsx } from \"react/jsx-runtime\";\n// @__NO_SIDE_EFFECTS__\nfunction createContext2(rootComponentName, defaultContext) {\n const Context = React.createContext(defaultContext);\n Context.displayName = rootComponentName + \"Context\";\n const Provider = /* @__PURE__ */ __name((props) => {\n const { children, ...context } = props;\n const value = React.useMemo(() => context, Object.values(context));\n return /* @__PURE__ */ jsx(Context.Provider, { value, children });\n }, \"Provider\");\n Provider.displayName = rootComponentName + \"Provider\";\n function useContext2(consumerName, options = {}) {\n const { optional = false } = options;\n const context = React.useContext(Context);\n if (context) return context;\n if (defaultContext !== void 0) return defaultContext;\n if (optional) return void 0;\n throw new Error(`\\`${consumerName}\\` must be used within \\`${rootComponentName}\\``);\n }\n __name(useContext2, \"useContext\");\n return [Provider, useContext2];\n}\n__name(createContext2, \"createContext\");\n// @__NO_SIDE_EFFECTS__\nfunction createContextScope(scopeName, createContextScopeDeps = []) {\n let defaultContexts = [];\n function createContext3(rootComponentName, defaultContext) {\n const BaseContext = React.createContext(defaultContext);\n BaseContext.displayName = rootComponentName + \"Context\";\n const index = defaultContexts.length;\n defaultContexts = [...defaultContexts, defaultContext];\n const Provider = /* @__PURE__ */ __name((props) => {\n const { scope, children, ...context } = props;\n const Context = scope?.[scopeName]?.[index] || BaseContext;\n const value = React.useMemo(() => context, Object.values(context));\n return /* @__PURE__ */ jsx(Context.Provider, { value, children });\n }, \"Provider\");\n Provider.displayName = rootComponentName + \"Provider\";\n function useContext2(consumerName, scope, options = {}) {\n const { optional = false } = options;\n const Context = scope?.[scopeName]?.[index] || BaseContext;\n const context = React.useContext(Context);\n if (context) return context;\n if (defaultContext !== void 0) return defaultContext;\n if (optional) return void 0;\n throw new Error(`\\`${consumerName}\\` must be used within \\`${rootComponentName}\\``);\n }\n __name(useContext2, \"useContext\");\n return [Provider, useContext2];\n }\n __name(createContext3, \"createContext\");\n const createScope = /* @__PURE__ */ __name(() => {\n const scopeContexts = defaultContexts.map((defaultContext) => {\n return React.createContext(defaultContext);\n });\n return /* @__PURE__ */ __name(function useScope(scope) {\n const contexts = scope?.[scopeName] || scopeContexts;\n return React.useMemo(\n () => ({ [`__scope${scopeName}`]: { ...scope, [scopeName]: contexts } }),\n [scope, contexts]\n );\n }, \"useScope\");\n }, \"createScope\");\n createScope.scopeName = scopeName;\n return [createContext3, composeContextScopes(createScope, ...createContextScopeDeps)];\n}\n__name(createContextScope, \"createContextScope\");\nfunction composeContextScopes(...scopes) {\n const baseScope = scopes[0];\n if (scopes.length === 1) return baseScope;\n const createScope = /* @__PURE__ */ __name(() => {\n const scopeHooks = scopes.map((createScope2) => ({\n useScope: createScope2(),\n scopeName: createScope2.scopeName\n }));\n return /* @__PURE__ */ __name(function useComposedScopes(overrideScopes) {\n const nextScopes = scopeHooks.reduce((nextScopes2, { useScope, scopeName }) => {\n const scopeProps = useScope(overrideScopes);\n const currentScope = scopeProps[`__scope${scopeName}`];\n return { ...nextScopes2, ...currentScope };\n }, {});\n return React.useMemo(() => ({ [`__scope${baseScope.scopeName}`]: nextScopes }), [nextScopes]);\n }, \"useComposedScopes\");\n }, \"createScope\");\n createScope.scopeName = baseScope.scopeName;\n return createScope;\n}\n__name(composeContextScopes, \"composeContextScopes\");\nexport {\n createContext2 as createContext,\n createContextScope\n};\n//# sourceMappingURL=index.mjs.map\n","// src/use-layout-effect.tsx\nimport * as React from \"react\";\nvar useLayoutEffect2 = globalThis?.document ? React.useLayoutEffect : () => {\n};\nexport {\n useLayoutEffect2 as useLayoutEffect\n};\n//# sourceMappingURL=index.mjs.map\n","var __defProp = Object.defineProperty;\nvar __name = (target, value) => __defProp(target, \"name\", { value, configurable: true });\n\n// src/use-effect-event.tsx\nimport { useLayoutEffect } from \"@radix-ui/react-use-layout-effect\";\nimport * as React from \"react\";\nvar useReactEffectEvent = React[\" useEffectEvent \".trim().toString()];\nvar useReactInsertionEffect = React[\" useInsertionEffect \".trim().toString()];\nfunction useEffectEvent(callback) {\n if (typeof useReactEffectEvent === \"function\") {\n return useReactEffectEvent(callback);\n }\n const ref = React.useRef(() => {\n throw new Error(\"Cannot call an event handler while rendering.\");\n });\n if (typeof useReactInsertionEffect === \"function\") {\n useReactInsertionEffect(() => {\n ref.current = callback;\n });\n } else {\n useLayoutEffect(() => {\n ref.current = callback;\n });\n }\n return React.useMemo(() => ((...args) => ref.current?.(...args)), []);\n}\n__name(useEffectEvent, \"useEffectEvent\");\nexport {\n useEffectEvent\n};\n//# sourceMappingURL=index.mjs.map\n","var __defProp = Object.defineProperty;\nvar __name = (target, value) => __defProp(target, \"name\", { value, configurable: true });\n\n// src/use-controllable-state.tsx\nimport * as React from \"react\";\nimport { IS_DEVELOPMENT } from \"@radix-ui/primitive/is-development\";\nimport { useLayoutEffect } from \"@radix-ui/react-use-layout-effect\";\nvar useInsertionEffect = React[\" useInsertionEffect \".trim().toString()] || useLayoutEffect;\nfunction useControllableState({\n prop,\n defaultProp,\n onChange = /* @__PURE__ */ __name(() => {\n }, \"onChange\"),\n caller\n}) {\n const [uncontrolledProp, setUncontrolledProp, onChangeRef] = useUncontrolledState({\n defaultProp,\n onChange\n });\n const isControlled = prop !== void 0;\n const value = isControlled ? prop : uncontrolledProp;\n if (IS_DEVELOPMENT) {\n const isControlledRef = React.useRef(prop !== void 0);\n React.useEffect(() => {\n const wasControlled = isControlledRef.current;\n if (wasControlled !== isControlled) {\n const from = wasControlled ? \"controlled\" : \"uncontrolled\";\n const to = isControlled ? \"controlled\" : \"uncontrolled\";\n console.warn(\n `${caller} is changing from ${from} to ${to}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`\n );\n }\n isControlledRef.current = isControlled;\n }, [isControlled, caller]);\n }\n const setValue = React.useCallback(\n (nextValue) => {\n if (isControlled) {\n const value2 = isFunction(nextValue) ? nextValue(prop) : nextValue;\n if (value2 !== prop) {\n onChangeRef.current?.(value2);\n }\n } else {\n setUncontrolledProp(nextValue);\n }\n },\n [isControlled, prop, setUncontrolledProp, onChangeRef]\n );\n return [value, setValue];\n}\n__name(useControllableState, \"useControllableState\");\nfunction useUncontrolledState({\n defaultProp,\n onChange\n}) {\n const [value, setValue] = React.useState(defaultProp);\n const prevValueRef = React.useRef(value);\n const onChangeRef = React.useRef(onChange);\n useInsertionEffect(() => {\n onChangeRef.current = onChange;\n }, [onChange]);\n React.useEffect(() => {\n if (prevValueRef.current !== value) {\n onChangeRef.current?.(value);\n prevValueRef.current = value;\n }\n }, [value, prevValueRef]);\n return [value, setValue, onChangeRef];\n}\n__name(useUncontrolledState, \"useUncontrolledState\");\nfunction isFunction(value) {\n return typeof value === \"function\";\n}\n__name(isFunction, \"isFunction\");\n\n// src/use-controllable-state-reducer.tsx\nimport * as React2 from \"react\";\nimport { IS_DEVELOPMENT as IS_DEVELOPMENT2 } from \"@radix-ui/primitive/is-development\";\nimport { useEffectEvent } from \"@radix-ui/react-use-effect-event\";\nvar SYNC_STATE = Symbol(\"RADIX:SYNC_STATE\");\nfunction useControllableStateReducer(reducer, userArgs, initialArg, init) {\n const { prop: controlledState, defaultProp, onChange: onChangeProp, caller } = userArgs;\n const isControlled = controlledState !== void 0;\n const onChange = useEffectEvent(onChangeProp);\n if (IS_DEVELOPMENT2) {\n const isControlledRef = React2.useRef(controlledState !== void 0);\n React2.useEffect(() => {\n const wasControlled = isControlledRef.current;\n if (wasControlled !== isControlled) {\n const from = wasControlled ? \"controlled\" : \"uncontrolled\";\n const to = isControlled ? \"controlled\" : \"uncontrolled\";\n console.warn(\n `${caller} is changing from ${from} to ${to}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`\n );\n }\n isControlledRef.current = isControlled;\n }, [isControlled, caller]);\n }\n const args = [{ ...initialArg, state: defaultProp }];\n if (init) {\n args.push(init);\n }\n const [internalState, dispatch] = React2.useReducer(\n (state2, action) => {\n if (action.type === SYNC_STATE) {\n return { ...state2, state: action.state };\n }\n const next = reducer(state2, action);\n if (isControlled && !Object.is(next.state, state2.state)) {\n onChange(next.state);\n }\n return next;\n },\n ...args\n );\n const uncontrolledState = internalState.state;\n const prevValueRef = React2.useRef(uncontrolledState);\n React2.useEffect(() => {\n if (prevValueRef.current !== uncontrolledState) {\n prevValueRef.current = uncontrolledState;\n if (!isControlled) {\n onChange(uncontrolledState);\n }\n }\n }, [uncontrolledState, prevValueRef, isControlled]);\n const state = React2.useMemo(() => {\n const isControlled2 = controlledState !== void 0;\n if (isControlled2) {\n return { ...internalState, state: controlledState };\n }\n return internalState;\n }, [internalState, controlledState]);\n React2.useEffect(() => {\n if (isControlled && !Object.is(controlledState, internalState.state)) {\n dispatch({ type: SYNC_STATE, state: controlledState });\n }\n }, [controlledState, internalState.state, isControlled]);\n return [state, dispatch];\n}\n__name(useControllableStateReducer, \"useControllableStateReducer\");\nexport {\n useControllableState,\n useControllableStateReducer\n};\n//# sourceMappingURL=index.mjs.map\n","var __defProp = Object.defineProperty;\nvar __name = (target, value) => __defProp(target, \"name\", { value, configurable: true });\n\n// src/use-size.tsx\nimport * as React from \"react\";\nimport { useLayoutEffect } from \"@radix-ui/react-use-layout-effect\";\nfunction useSize(element) {\n const [size, setSize] = React.useState(void 0);\n useLayoutEffect(() => {\n if (element) {\n setSize({ width: element.offsetWidth, height: element.offsetHeight });\n const resizeObserver = new ResizeObserver((entries) => {\n if (!Array.isArray(entries)) {\n return;\n }\n if (!entries.length) {\n return;\n }\n const entry = entries[0];\n let width;\n let height;\n if (\"borderBoxSize\" in entry) {\n const borderSizeEntry = entry[\"borderBoxSize\"];\n const borderSize = Array.isArray(borderSizeEntry) ? borderSizeEntry[0] : borderSizeEntry;\n width = borderSize[\"inlineSize\"];\n height = borderSize[\"blockSize\"];\n } else {\n width = element.offsetWidth;\n height = element.offsetHeight;\n }\n setSize({ width, height });\n });\n resizeObserver.observe(element, { box: \"border-box\" });\n return () => resizeObserver.unobserve(element);\n } else {\n setSize(void 0);\n }\n }, [element]);\n return size;\n}\n__name(useSize, \"useSize\");\nexport {\n useSize\n};\n//# sourceMappingURL=index.mjs.map\n","var __defProp = Object.defineProperty;\nvar __name = (target, value) => __defProp(target, \"name\", { value, configurable: true });\n\n// src/slot.tsx\nimport * as React from \"react\";\nimport { useComposedRefs } from \"@radix-ui/react-compose-refs\";\n// @__NO_SIDE_EFFECTS__\nfunction createSlot(ownerName) {\n const Slot2 = React.forwardRef((props, forwardedRef) => {\n let { children, ...slotProps } = props;\n let slottableElement = null;\n let hasSlottable = false;\n const newChildren = [];\n if (isLazyComponent(children) && typeof use === \"function\") {\n children = use(children._payload);\n }\n React.Children.forEach(children, (maybeSlottable) => {\n if (isSlottable(maybeSlottable)) {\n hasSlottable = true;\n const slottable = maybeSlottable;\n let child = \"child\" in slottable.props ? slottable.props.child : slottable.props.children;\n if (isLazyComponent(child) && typeof use === \"function\") {\n child = use(child._payload);\n }\n slottableElement = getSlottableElementFromSlottable(slottable, child);\n newChildren.push(slottableElement?.props?.children);\n } else {\n newChildren.push(maybeSlottable);\n }\n });\n if (slottableElement) {\n slottableElement = React.cloneElement(slottableElement, void 0, newChildren);\n } else if (\n // A `Slottable` was found but it didn't resolve to a single element (e.g.\n // it wrapped multiple elements, text, or a render-prop `child` that\n // wasn't an element). Don't fall back to treating the `Slottable` wrapper\n // itself as the slot target — throw a descriptive error below instead.\n !hasSlottable && React.Children.count(children) === 1 && React.isValidElement(children)\n ) {\n slottableElement = children;\n }\n const slottableElementRef = slottableElement ? getElementRef(slottableElement) : void 0;\n const composedRef = useComposedRefs(forwardedRef, slottableElementRef);\n if (!slottableElement) {\n if (children || children === 0) {\n throw new Error(\n hasSlottable ? createSlottableError(ownerName) : createSlotError(ownerName)\n );\n }\n return children;\n }\n const mergedProps = mergeProps(slotProps, slottableElement.props ?? {});\n if (slottableElement.type !== React.Fragment) {\n mergedProps.ref = forwardedRef ? composedRef : slottableElementRef;\n }\n return React.cloneElement(slottableElement, mergedProps);\n });\n Slot2.displayName = `${ownerName}.Slot`;\n return Slot2;\n}\n__name(createSlot, \"createSlot\");\nvar Slot = /* @__PURE__ */ createSlot(\"Slot\");\nvar SLOTTABLE_IDENTIFIER = Symbol.for(\"radix.slottable\");\n// @__NO_SIDE_EFFECTS__\nfunction createSlottable(ownerName) {\n const Slottable2 = /* @__PURE__ */ __name((props) => \"child\" in props ? props.children(props.child) : props.children, \"Slottable\");\n Slottable2.displayName = `${ownerName}.Slottable`;\n Slottable2.__radixId = SLOTTABLE_IDENTIFIER;\n return Slottable2;\n}\n__name(createSlottable, \"createSlottable\");\nvar Slottable = /* @__PURE__ */ createSlottable(\"Slottable\");\nvar getSlottableElementFromSlottable = /* @__PURE__ */ __name((slottable, child) => {\n if (\"child\" in slottable.props) {\n const child2 = slottable.props.child;\n if (!React.isValidElement(child2)) return null;\n return React.cloneElement(child2, void 0, slottable.props.children(child2.props.children));\n }\n return React.isValidElement(child) ? child : null;\n}, \"getSlottableElementFromSlottable\");\nfunction mergeProps(slotProps, childProps) {\n const overrideProps = { ...childProps };\n for (const propName in childProps) {\n const slotPropValue = slotProps[propName];\n const childPropValue = childProps[propName];\n const isHandler = /^on[A-Z]/.test(propName);\n if (isHandler) {\n if (slotPropValue && childPropValue) {\n overrideProps[propName] = (...args) => {\n const result = childPropValue(...args);\n slotPropValue(...args);\n return result;\n };\n } else if (slotPropValue) {\n overrideProps[propName] = slotPropValue;\n }\n } else if (propName === \"style\") {\n overrideProps[propName] = { ...slotPropValue, ...childPropValue };\n } else if (propName === \"className\") {\n overrideProps[propName] = [slotPropValue, childPropValue].filter(Boolean).join(\" \");\n }\n }\n return { ...slotProps, ...overrideProps };\n}\n__name(mergeProps, \"mergeProps\");\nfunction getElementRef(element) {\n let getter = Object.getOwnPropertyDescriptor(element.props, \"ref\")?.get;\n let mayWarn = getter && \"isReactWarning\" in getter && getter.isReactWarning;\n if (mayWarn) {\n return element.ref;\n }\n getter = Object.getOwnPropertyDescriptor(element, \"ref\")?.get;\n mayWarn = getter && \"isReactWarning\" in getter && getter.isReactWarning;\n if (mayWarn) {\n return element.props.ref;\n }\n return element.props.ref || element.ref;\n}\n__name(getElementRef, \"getElementRef\");\nfunction isSlottable(child) {\n return React.isValidElement(child) && typeof child.type === \"function\" && \"__radixId\" in child.type && child.type.__radixId === SLOTTABLE_IDENTIFIER;\n}\n__name(isSlottable, \"isSlottable\");\nvar REACT_LAZY_TYPE = Symbol.for(\"react.lazy\");\nfunction isLazyComponent(element) {\n return element != null && typeof element === \"object\" && \"$$typeof\" in element && element.$$typeof === REACT_LAZY_TYPE && \"_payload\" in element && isPromiseLike(element._payload);\n}\n__name(isLazyComponent, \"isLazyComponent\");\nfunction isPromiseLike(value) {\n return typeof value === \"object\" && value !== null && \"then\" in value;\n}\n__name(isPromiseLike, \"isPromiseLike\");\nvar createSlotError = /* @__PURE__ */ __name((ownerName) => {\n return `${ownerName} failed to slot onto its children. Expected a single React element child or \\`Slottable\\`.`;\n}, \"createSlotError\");\nvar createSlottableError = /* @__PURE__ */ __name((ownerName) => {\n return `${ownerName} failed to slot onto its \\`Slottable\\`. Expected \\`Slottable\\` to receive a single React element child.`;\n}, \"createSlottableError\");\nvar use = React[\" use \".trim().toString()];\nexport {\n Slot as Root,\n Slot,\n Slottable,\n createSlot,\n createSlottable\n};\n//# sourceMappingURL=index.mjs.map\n","var __defProp = Object.defineProperty;\nvar __name = (target, value) => __defProp(target, \"name\", { value, configurable: true });\n\n// src/primitive.tsx\nimport * as React from \"react\";\nimport * as ReactDOM from \"react-dom\";\nimport { createSlot } from \"@radix-ui/react-slot\";\nimport { jsx } from \"react/jsx-runtime\";\nvar NODES = [\n \"a\",\n \"button\",\n \"div\",\n \"form\",\n \"h2\",\n \"h3\",\n \"img\",\n \"input\",\n \"label\",\n \"li\",\n \"nav\",\n \"ol\",\n \"p\",\n \"select\",\n \"span\",\n \"svg\",\n \"ul\"\n];\nvar Primitive = NODES.reduce((primitive, node) => {\n const Slot = createSlot(`Primitive.${node}`);\n const Node = React.forwardRef((props, forwardedRef) => {\n const { asChild, ...primitiveProps } = props;\n const Comp = asChild ? Slot : node;\n if (typeof window !== \"undefined\") {\n window[Symbol.for(\"radix-ui\")] = true;\n }\n return /* @__PURE__ */ jsx(Comp, { ...primitiveProps, ref: forwardedRef });\n });\n Node.displayName = `Primitive.${node}`;\n return { ...primitive, [node]: Node };\n}, {});\nfunction dispatchDiscreteCustomEvent(target, event) {\n if (target) ReactDOM.flushSync(() => target.dispatchEvent(event));\n}\n__name(dispatchDiscreteCustomEvent, \"dispatchDiscreteCustomEvent\");\nvar Root = Primitive;\nexport {\n Primitive,\n Root,\n dispatchDiscreteCustomEvent\n};\n//# sourceMappingURL=index.mjs.map\n","\"use client\";\nvar __defProp = Object.defineProperty;\nvar __name = (target, value) => __defProp(target, \"name\", { value, configurable: true });\n\n// src/switch.tsx\nimport * as React from \"react\";\nimport { composeEventHandlers } from \"@radix-ui/primitive\";\nimport { useComposedRefs } from \"@radix-ui/react-compose-refs\";\nimport { createContextScope } from \"@radix-ui/react-context\";\nimport { useControllableState } from \"@radix-ui/react-use-controllable-state\";\nimport { useSize } from \"@radix-ui/react-use-size\";\nimport { Primitive } from \"@radix-ui/react-primitive\";\nimport { Fragment, jsx, jsxs } from \"react/jsx-runtime\";\nvar SWITCH_NAME = \"Switch\";\nvar [createSwitchContext, createSwitchScope] = createContextScope(SWITCH_NAME);\nvar [SwitchProviderImpl, useSwitchContext] = createSwitchContext(SWITCH_NAME);\nfunction SwitchProvider(props) {\n const {\n __scopeSwitch,\n checked: checkedProp,\n children,\n defaultChecked,\n disabled,\n form,\n name,\n onCheckedChange,\n required,\n value = \"on\",\n // @ts-expect-error\n internal_do_not_use_render\n } = props;\n const [checked, setChecked] = useControllableState({\n prop: checkedProp,\n defaultProp: defaultChecked ?? false,\n onChange: onCheckedChange,\n caller: SWITCH_NAME\n });\n const [control, setControl] = React.useState(null);\n const [bubbleInput, setBubbleInput] = React.useState(null);\n const hasConsumerStoppedPropagationRef = React.useRef(false);\n const [userInteractionCount, onUserInteraction] = React.useReducer(\n (count) => count + 1,\n 0\n );\n const isFormControl = control ? !!form || !!control.closest(\"form\") : (\n // We set this to true by default so that events bubble to forms without JS (SSR)\n true\n );\n const context = {\n checked,\n setChecked,\n disabled,\n control,\n setControl,\n name,\n form,\n value,\n hasConsumerStoppedPropagationRef,\n userInteractionCount,\n onUserInteraction,\n required,\n defaultChecked,\n isFormControl,\n bubbleInput,\n setBubbleInput\n };\n return /* @__PURE__ */ jsx(SwitchProviderImpl, { scope: __scopeSwitch, ...context, children: isFunction(internal_do_not_use_render) ? internal_do_not_use_render(context) : children });\n}\n__name(SwitchProvider, \"SwitchProvider\");\nvar TRIGGER_NAME = \"SwitchTrigger\";\nvar SwitchTrigger = /* @__PURE__ */ React.forwardRef(\n /* @__PURE__ */ __name(function SwitchTrigger2({ __scopeSwitch, onClick, ...switchProps }, forwardedRef) {\n const {\n control,\n form,\n value,\n disabled,\n checked,\n required,\n setControl,\n setChecked,\n hasConsumerStoppedPropagationRef,\n onUserInteraction,\n isFormControl,\n bubbleInput\n } = useSwitchContext(TRIGGER_NAME, __scopeSwitch);\n const composedRefs = useComposedRefs(forwardedRef, setControl);\n const initialCheckedStateRef = React.useRef(checked);\n React.useEffect(() => {\n const associatedForm = form ? control?.ownerDocument.getElementById(form) : control?.form;\n if (associatedForm instanceof HTMLFormElement) {\n const reset = /* @__PURE__ */ __name(() => setChecked(initialCheckedStateRef.current), \"reset\");\n associatedForm.addEventListener(\"reset\", reset);\n return () => associatedForm.removeEventListener(\"reset\", reset);\n }\n }, [control, form, setChecked]);\n return /* @__PURE__ */ jsx(\n Primitive.button,\n {\n type: \"button\",\n role: \"switch\",\n \"aria-checked\": checked,\n \"aria-required\": required,\n \"data-state\": getState(checked),\n \"data-disabled\": disabled ? \"\" : void 0,\n disabled,\n value,\n ...switchProps,\n ref: composedRefs,\n onClick: composeEventHandlers(onClick, (event) => {\n onUserInteraction();\n setChecked((prevChecked) => !prevChecked);\n if (bubbleInput && isFormControl) {\n hasConsumerStoppedPropagationRef.current = event.isPropagationStopped();\n if (!hasConsumerStoppedPropagationRef.current) event.stopPropagation();\n }\n })\n }\n );\n }, \"SwitchTrigger\")\n);\nvar Switch = /* @__PURE__ */ React.forwardRef(\n // blank line to reduce diff noise\n /* @__PURE__ */ __name(function Switch2(props, forwardedRef) {\n const {\n __scopeSwitch,\n name,\n checked,\n defaultChecked,\n required,\n disabled,\n value,\n onCheckedChange,\n form,\n ...switchProps\n } = props;\n return /* @__PURE__ */ jsx(\n SwitchProvider,\n {\n __scopeSwitch,\n checked,\n defaultChecked,\n disabled,\n required,\n onCheckedChange,\n name,\n form,\n value,\n internal_do_not_use_render: ({ isFormControl }) => /* @__PURE__ */ jsxs(Fragment, { children: [\n /* @__PURE__ */ jsx(\n SwitchTrigger,\n {\n ...switchProps,\n ref: forwardedRef,\n __scopeSwitch\n }\n ),\n isFormControl && /* @__PURE__ */ jsx(\n SwitchBubbleInput,\n {\n __scopeSwitch\n }\n )\n ] })\n }\n );\n }, \"Switch\")\n);\nvar THUMB_NAME = \"SwitchThumb\";\nvar SwitchThumb = /* @__PURE__ */ React.forwardRef(\n /* @__PURE__ */ __name(function SwitchThumb2(props, forwardedRef) {\n const { __scopeSwitch, ...thumbProps } = props;\n const context = useSwitchContext(THUMB_NAME, __scopeSwitch);\n return /* @__PURE__ */ jsx(\n Primitive.span,\n {\n \"data-state\": getState(context.checked),\n \"data-disabled\": context.disabled ? \"\" : void 0,\n ...thumbProps,\n ref: forwardedRef\n }\n );\n }, \"SwitchThumb\")\n);\nvar BUBBLE_INPUT_NAME = \"SwitchBubbleInput\";\nvar SwitchBubbleInput = /* @__PURE__ */ React.forwardRef(\n // blank line to reduce diff noise\n /* @__PURE__ */ __name(function SwitchBubbleInput2({ __scopeSwitch, onClick, ...props }, forwardedRef) {\n const {\n control,\n hasConsumerStoppedPropagationRef,\n userInteractionCount,\n checked,\n defaultChecked,\n required,\n disabled,\n name,\n value,\n form,\n bubbleInput,\n setBubbleInput\n } = useSwitchContext(BUBBLE_INPUT_NAME, __scopeSwitch);\n const composedRefs = useComposedRefs(forwardedRef, setBubbleInput);\n const controlSize = useSize(control);\n const shouldStopClickPropagationRef = React.useRef(false);\n const prevCheckedRef = React.useRef(checked);\n const prevUserInteractionCountRef = React.useRef(userInteractionCount);\n React.useEffect(() => {\n const input = bubbleInput;\n if (!input) return;\n const inputProto = window.HTMLInputElement.prototype;\n const descriptor = Object.getOwnPropertyDescriptor(\n inputProto,\n \"checked\"\n );\n const setChecked = descriptor.set;\n const isUserInteraction = userInteractionCount !== prevUserInteractionCountRef.current;\n prevUserInteractionCountRef.current = userInteractionCount;\n const checkedChanged = prevCheckedRef.current !== checked;\n prevCheckedRef.current = checked;\n const bubbles = !(isUserInteraction && hasConsumerStoppedPropagationRef.current);\n if (checkedChanged && setChecked) {\n shouldStopClickPropagationRef.current = !isUserInteraction;\n const event = new Event(\"click\", { bubbles });\n setChecked.call(input, checked);\n input.dispatchEvent(event);\n shouldStopClickPropagationRef.current = false;\n }\n }, [bubbleInput, checked, hasConsumerStoppedPropagationRef, userInteractionCount]);\n const defaultCheckedRef = React.useRef(checked);\n return /* @__PURE__ */ jsx(\n Primitive.input,\n {\n type: \"checkbox\",\n \"aria-hidden\": true,\n defaultChecked: defaultChecked ?? defaultCheckedRef.current,\n required,\n disabled,\n name,\n value,\n form,\n ...props,\n tabIndex: -1,\n ref: composedRefs,\n onClick: composeEventHandlers(onClick, (event) => {\n if (shouldStopClickPropagationRef.current) {\n event.stopPropagation();\n }\n }),\n style: {\n ...props.style,\n ...controlSize,\n position: \"absolute\",\n pointerEvents: \"none\",\n opacity: 0,\n margin: 0,\n // We transform because the input is absolutely positioned but we have\n // rendered it **after** the button. This pulls it back to sit on top\n // of the button.\n transform: \"translateX(-100%)\"\n }\n }\n );\n }, \"SwitchBubbleInput\")\n);\nfunction isFunction(value) {\n return typeof value === \"function\";\n}\n__name(isFunction, \"isFunction\");\nfunction getState(checked) {\n return checked ? \"checked\" : \"unchecked\";\n}\n__name(getState, \"getState\");\nexport {\n Switch as Root,\n Switch,\n SwitchThumb,\n SwitchThumb as Thumb,\n createSwitchScope,\n SwitchBubbleInput as unstable_BubbleInput,\n SwitchProvider as unstable_Provider,\n SwitchBubbleInput as unstable_SwitchBubbleInput,\n SwitchProvider as unstable_SwitchProvider,\n SwitchTrigger as unstable_SwitchTrigger,\n SwitchTrigger as unstable_Trigger\n};\n//# sourceMappingURL=index.mjs.map\n","import * as React from \"react\";\nimport * as SwitchPrimitives from \"@radix-ui/react-switch\";\nimport { cn } from \"../../utils/cn\";\n\nconst Switch = React.forwardRef<\n React.ElementRef<typeof SwitchPrimitives.Root>,\n React.ComponentPropsWithoutRef<typeof SwitchPrimitives.Root>\n>(({ className, ...props }, ref) => (\n <SwitchPrimitives.Root\n ref={ref}\n className={cn(\n \"peer inline-flex h-5 w-9 shrink-0 cursor-pointer items-center rounded-full border border-border transition-colors data-[state=checked]:bg-primary data-[state=unchecked]:bg-bg-elevated focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary/60 disabled:cursor-not-allowed disabled:opacity-50\",\n className,\n )}\n {...props}\n >\n <SwitchPrimitives.Thumb\n className={cn(\n \"pointer-events-none block h-4 w-4 rounded-full bg-foreground shadow-lg transition-transform data-[state=checked]:translate-x-4 data-[state=unchecked]:translate-x-0.5\",\n )}\n />\n </SwitchPrimitives.Root>\n));\nSwitch.displayName = SwitchPrimitives.Root.displayName;\n\nexport { Switch };\n"],"names":["__defProp","__name","target","value","canUseDOM","composeEventHandlers","originalEventHandler","ourEventHandler","checkForDefaultPrevented","event","getOwnerWindow","element","getOwnerDocument","getActiveElement","node","activeDescendant","activeElement","isFrame","id","setRef","ref","composeRefs","refs","hasCleanup","cleanups","cleanup","i","useComposedRefs","React.useCallback","createContext2","rootComponentName","defaultContext","Context","React.createContext","Provider","props","children","context","React.useMemo","jsx","useContext2","consumerName","options","optional","React.useContext","createContextScope","scopeName","createContextScopeDeps","defaultContexts","createContext3","BaseContext","index","scope","createScope","scopeContexts","contexts","composeContextScopes","scopes","baseScope","scopeHooks","createScope2","overrideScopes","nextScopes","nextScopes2","useScope","currentScope","useLayoutEffect2","React.useLayoutEffect","useReactEffectEvent","React","useReactInsertionEffect","useEffectEvent","callback","React.useRef","useLayoutEffect","args","useInsertionEffect","useControllableState","prop","defaultProp","onChange","caller","uncontrolledProp","setUncontrolledProp","onChangeRef","useUncontrolledState","isControlled","setValue","nextValue","value2","isFunction","React.useState","prevValueRef","React.useEffect","SYNC_STATE","useControllableStateReducer","reducer","userArgs","initialArg","init","controlledState","onChangeProp","internalState","dispatch","React2.useReducer","state2","action","next","uncontrolledState","React2.useRef","React2.useEffect","state","React2.useMemo","useSize","size","setSize","resizeObserver","entries","entry","width","height","borderSizeEntry","borderSize","createSlot","ownerName","Slot2","React.forwardRef","forwardedRef","slotProps","slottableElement","hasSlottable","newChildren","isLazyComponent","use","React.Children","maybeSlottable","isSlottable","slottable","child","getSlottableElementFromSlottable","React.cloneElement","React.isValidElement","slottableElementRef","getElementRef","composedRef","createSlottableError","createSlotError","mergedProps","mergeProps","React.Fragment","SLOTTABLE_IDENTIFIER","createSlottable","Slottable2","child2","childProps","overrideProps","propName","slotPropValue","childPropValue","result","getter","mayWarn","REACT_LAZY_TYPE","isPromiseLike","NODES","Primitive","primitive","Slot","Node","asChild","primitiveProps","Comp","dispatchDiscreteCustomEvent","ReactDOM.flushSync","SWITCH_NAME","createSwitchContext","createSwitchScope","SwitchProviderImpl","useSwitchContext","SwitchProvider","__scopeSwitch","checkedProp","defaultChecked","disabled","form","name","onCheckedChange","required","internal_do_not_use_render","checked","setChecked","control","setControl","bubbleInput","setBubbleInput","hasConsumerStoppedPropagationRef","userInteractionCount","onUserInteraction","React.useReducer","count","isFormControl","TRIGGER_NAME","SwitchTrigger","onClick","switchProps","composedRefs","initialCheckedStateRef","associatedForm","reset","getState","prevChecked","Switch","jsxs","Fragment","SwitchBubbleInput","THUMB_NAME","SwitchThumb","thumbProps","BUBBLE_INPUT_NAME","controlSize","shouldStopClickPropagationRef","prevCheckedRef","prevUserInteractionCountRef","input","inputProto","isUserInteraction","checkedChanged","bubbles","defaultCheckedRef","className","SwitchPrimitives.Root","cn","SwitchPrimitives.Thumb"],"mappings":"sEAAA,IAAIA,GAAY,OAAO,eACnBC,EAAS,CAACC,EAAQC,IAAUH,GAAUE,EAAQ,OAAQ,CAAE,MAAAC,EAAO,aAAc,GAAM,EAGnFC,EAAY,CAAC,EAAE,OAAO,OAAW,KAAe,OAAO,UAAY,OAAO,SAAS,eACvF,SAASC,EAAqBC,EAAsBC,EAAiB,CAAE,yBAAAC,EAA2B,EAAI,EAAK,GAAI,CAC7G,OAAuBP,EAAO,SAAqBQ,EAAO,CAExD,GADAH,IAAuBG,CAAK,EACxBD,IAA6B,IAAS,CAACC,GAAS,CAACA,EAAM,iBACzD,OAAOF,IAAkBE,CAAK,CAElC,EAAG,aAAa,CAClB,CACAR,EAAOI,EAAsB,sBAAsB,EACnD,SAASK,GAAeC,EAAS,CAC/B,GAAI,CAACP,EACH,MAAM,IAAI,MAAM,yCAAyC,EAE3D,OAAOO,GAAS,eAAe,aAAe,MAChD,CACAV,EAAOS,GAAgB,gBAAgB,EACvC,SAASE,EAAiBD,EAAS,CACjC,GAAI,CAACP,EACH,MAAM,IAAI,MAAM,2CAA2C,EAE7D,OAAOO,GAAS,eAAiB,QACnC,CACAV,EAAOW,EAAkB,kBAAkB,EAC3C,SAASC,EAAiBC,EAAMC,EAAmB,GAAO,CACxD,KAAM,CAAE,cAAAC,CAAa,EAAKJ,EAAiBE,CAAI,EAC/C,GAAI,CAACE,GAAe,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mN,EACT,wTACAF,CAAA,EAED,GAAGlM,EAEJ,SAAAI,EAAAA,IAACiM,GAAA,CACC,UAAWD,EACT,uKAAA,CACF,CAAA,CACF,CACF,CACD,EACDpB,GAAO,YAAcmB,GAAsB","x_google_ignoreList":[0,1,2,3,4,5,6,7,8,9]}
1
+ {"version":3,"file":"switch-Drm0yRgr.js","sources":["../../node_modules/@radix-ui/primitive/dist/index.mjs","../../node_modules/@radix-ui/react-compose-refs/dist/index.mjs","../../node_modules/@radix-ui/react-context/dist/index.mjs","../../node_modules/@radix-ui/react-use-layout-effect/dist/index.mjs","../../node_modules/@radix-ui/react-use-effect-event/dist/index.mjs","../../node_modules/@radix-ui/react-use-controllable-state/dist/index.mjs","../../node_modules/@radix-ui/react-use-size/dist/index.mjs","../../node_modules/@radix-ui/react-slot/dist/index.mjs","../../node_modules/@radix-ui/react-primitive/dist/index.mjs","../../node_modules/@radix-ui/react-switch/dist/index.mjs","../../src/components/ui/switch.tsx"],"sourcesContent":["var __defProp = Object.defineProperty;\nvar __name = (target, value) => __defProp(target, \"name\", { value, configurable: true });\n\n// src/primitive.tsx\nvar canUseDOM = !!(typeof window !== \"undefined\" && window.document && window.document.createElement);\nfunction composeEventHandlers(originalEventHandler, ourEventHandler, { checkForDefaultPrevented = true } = {}) {\n return /* @__PURE__ */ __name(function handleEvent(event) {\n originalEventHandler?.(event);\n if (checkForDefaultPrevented === false || !event || !event.defaultPrevented) {\n return ourEventHandler?.(event);\n }\n }, \"handleEvent\");\n}\n__name(composeEventHandlers, \"composeEventHandlers\");\nfunction getOwnerWindow(element) {\n if (!canUseDOM) {\n throw new Error(\"Cannot access window outside of the DOM\");\n }\n return element?.ownerDocument?.defaultView ?? window;\n}\n__name(getOwnerWindow, \"getOwnerWindow\");\nfunction getOwnerDocument(element) {\n if (!canUseDOM) {\n throw new Error(\"Cannot access document outside of the DOM\");\n }\n return element?.ownerDocument ?? document;\n}\n__name(getOwnerDocument, \"getOwnerDocument\");\nfunction getActiveElement(node, activeDescendant = false) {\n const { activeElement } = getOwnerDocument(node);\n if (!activeElement?.nodeName) {\n return null;\n }\n if (isFrame(activeElement) && activeElement.contentDocument) {\n return getActiveElement(activeElement.contentDocument.body, activeDescendant);\n }\n if (activeDescendant) {\n const id = activeElement.getAttribute(\"aria-activedescendant\");\n if (id) {\n const element = getOwnerDocument(activeElement).getElementById(id);\n if (element) {\n return element;\n }\n }\n }\n return activeElement;\n}\n__name(getActiveElement, \"getActiveElement\");\nfunction isFrame(element) {\n return element.tagName === \"IFRAME\";\n}\n__name(isFrame, \"isFrame\");\nexport {\n canUseDOM,\n composeEventHandlers,\n getActiveElement,\n getOwnerDocument,\n getOwnerWindow,\n isFrame\n};\n//# sourceMappingURL=index.mjs.map\n","var __defProp = Object.defineProperty;\nvar __name = (target, value) => __defProp(target, \"name\", { value, configurable: true });\n\n// src/compose-refs.tsx\nimport * as React from \"react\";\nfunction setRef(ref, value) {\n if (typeof ref === \"function\") {\n return ref(value);\n } else if (ref !== null && ref !== void 0) {\n ref.current = value;\n }\n}\n__name(setRef, \"setRef\");\nfunction composeRefs(...refs) {\n return (node) => {\n let hasCleanup = false;\n const cleanups = refs.map((ref) => {\n const cleanup = setRef(ref, node);\n if (!hasCleanup && typeof cleanup == \"function\") {\n hasCleanup = true;\n }\n return cleanup;\n });\n if (hasCleanup) {\n return () => {\n for (let i = 0; i < cleanups.length; i++) {\n const cleanup = cleanups[i];\n if (typeof cleanup == \"function\") {\n cleanup();\n } else {\n setRef(refs[i], null);\n }\n }\n };\n }\n };\n}\n__name(composeRefs, \"composeRefs\");\nfunction useComposedRefs(...refs) {\n return React.useCallback(composeRefs(...refs), refs);\n}\n__name(useComposedRefs, \"useComposedRefs\");\nexport {\n composeRefs,\n useComposedRefs\n};\n//# sourceMappingURL=index.mjs.map\n","var __defProp = Object.defineProperty;\nvar __name = (target, value) => __defProp(target, \"name\", { value, configurable: true });\n\n// src/create-context.tsx\nimport * as React from \"react\";\nimport { jsx } from \"react/jsx-runtime\";\n// @__NO_SIDE_EFFECTS__\nfunction createContext2(rootComponentName, defaultContext) {\n const Context = React.createContext(defaultContext);\n Context.displayName = rootComponentName + \"Context\";\n const Provider = /* @__PURE__ */ __name((props) => {\n const { children, ...context } = props;\n const value = React.useMemo(() => context, Object.values(context));\n return /* @__PURE__ */ jsx(Context.Provider, { value, children });\n }, \"Provider\");\n Provider.displayName = rootComponentName + \"Provider\";\n function useContext2(consumerName, options = {}) {\n const { optional = false } = options;\n const context = React.useContext(Context);\n if (context) return context;\n if (defaultContext !== void 0) return defaultContext;\n if (optional) return void 0;\n throw new Error(`\\`${consumerName}\\` must be used within \\`${rootComponentName}\\``);\n }\n __name(useContext2, \"useContext\");\n return [Provider, useContext2];\n}\n__name(createContext2, \"createContext\");\n// @__NO_SIDE_EFFECTS__\nfunction createContextScope(scopeName, createContextScopeDeps = []) {\n let defaultContexts = [];\n function createContext3(rootComponentName, defaultContext) {\n const BaseContext = React.createContext(defaultContext);\n BaseContext.displayName = rootComponentName + \"Context\";\n const index = defaultContexts.length;\n defaultContexts = [...defaultContexts, defaultContext];\n const Provider = /* @__PURE__ */ __name((props) => {\n const { scope, children, ...context } = props;\n const Context = scope?.[scopeName]?.[index] || BaseContext;\n const value = React.useMemo(() => context, Object.values(context));\n return /* @__PURE__ */ jsx(Context.Provider, { value, children });\n }, \"Provider\");\n Provider.displayName = rootComponentName + \"Provider\";\n function useContext2(consumerName, scope, options = {}) {\n const { optional = false } = options;\n const Context = scope?.[scopeName]?.[index] || BaseContext;\n const context = React.useContext(Context);\n if (context) return context;\n if (defaultContext !== void 0) return defaultContext;\n if (optional) return void 0;\n throw new Error(`\\`${consumerName}\\` must be used within \\`${rootComponentName}\\``);\n }\n __name(useContext2, \"useContext\");\n return [Provider, useContext2];\n }\n __name(createContext3, \"createContext\");\n const createScope = /* @__PURE__ */ __name(() => {\n const scopeContexts = defaultContexts.map((defaultContext) => {\n return React.createContext(defaultContext);\n });\n return /* @__PURE__ */ __name(function useScope(scope) {\n const contexts = scope?.[scopeName] || scopeContexts;\n return React.useMemo(\n () => ({ [`__scope${scopeName}`]: { ...scope, [scopeName]: contexts } }),\n [scope, contexts]\n );\n }, \"useScope\");\n }, \"createScope\");\n createScope.scopeName = scopeName;\n return [createContext3, composeContextScopes(createScope, ...createContextScopeDeps)];\n}\n__name(createContextScope, \"createContextScope\");\nfunction composeContextScopes(...scopes) {\n const baseScope = scopes[0];\n if (scopes.length === 1) return baseScope;\n const createScope = /* @__PURE__ */ __name(() => {\n const scopeHooks = scopes.map((createScope2) => ({\n useScope: createScope2(),\n scopeName: createScope2.scopeName\n }));\n return /* @__PURE__ */ __name(function useComposedScopes(overrideScopes) {\n const nextScopes = scopeHooks.reduce((nextScopes2, { useScope, scopeName }) => {\n const scopeProps = useScope(overrideScopes);\n const currentScope = scopeProps[`__scope${scopeName}`];\n return { ...nextScopes2, ...currentScope };\n }, {});\n return React.useMemo(() => ({ [`__scope${baseScope.scopeName}`]: nextScopes }), [nextScopes]);\n }, \"useComposedScopes\");\n }, \"createScope\");\n createScope.scopeName = baseScope.scopeName;\n return createScope;\n}\n__name(composeContextScopes, \"composeContextScopes\");\nexport {\n createContext2 as createContext,\n createContextScope\n};\n//# sourceMappingURL=index.mjs.map\n","// src/use-layout-effect.tsx\nimport * as React from \"react\";\nvar useLayoutEffect2 = globalThis?.document ? React.useLayoutEffect : () => {\n};\nexport {\n useLayoutEffect2 as useLayoutEffect\n};\n//# sourceMappingURL=index.mjs.map\n","var __defProp = Object.defineProperty;\nvar __name = (target, value) => __defProp(target, \"name\", { value, configurable: true });\n\n// src/use-effect-event.tsx\nimport { useLayoutEffect } from \"@radix-ui/react-use-layout-effect\";\nimport * as React from \"react\";\nvar useReactEffectEvent = React[\" useEffectEvent \".trim().toString()];\nvar useReactInsertionEffect = React[\" useInsertionEffect \".trim().toString()];\nfunction useEffectEvent(callback) {\n if (typeof useReactEffectEvent === \"function\") {\n return useReactEffectEvent(callback);\n }\n const ref = React.useRef(() => {\n throw new Error(\"Cannot call an event handler while rendering.\");\n });\n if (typeof useReactInsertionEffect === \"function\") {\n useReactInsertionEffect(() => {\n ref.current = callback;\n });\n } else {\n useLayoutEffect(() => {\n ref.current = callback;\n });\n }\n return React.useMemo(() => ((...args) => ref.current?.(...args)), []);\n}\n__name(useEffectEvent, \"useEffectEvent\");\nexport {\n useEffectEvent\n};\n//# sourceMappingURL=index.mjs.map\n","var __defProp = Object.defineProperty;\nvar __name = (target, value) => __defProp(target, \"name\", { value, configurable: true });\n\n// src/use-controllable-state.tsx\nimport * as React from \"react\";\nimport { IS_DEVELOPMENT } from \"@radix-ui/primitive/is-development\";\nimport { useLayoutEffect } from \"@radix-ui/react-use-layout-effect\";\nvar useInsertionEffect = React[\" useInsertionEffect \".trim().toString()] || useLayoutEffect;\nfunction useControllableState({\n prop,\n defaultProp,\n onChange = /* @__PURE__ */ __name(() => {\n }, \"onChange\"),\n caller\n}) {\n const [uncontrolledProp, setUncontrolledProp, onChangeRef] = useUncontrolledState({\n defaultProp,\n onChange\n });\n const isControlled = prop !== void 0;\n const value = isControlled ? prop : uncontrolledProp;\n if (IS_DEVELOPMENT) {\n const isControlledRef = React.useRef(prop !== void 0);\n React.useEffect(() => {\n const wasControlled = isControlledRef.current;\n if (wasControlled !== isControlled) {\n const from = wasControlled ? \"controlled\" : \"uncontrolled\";\n const to = isControlled ? \"controlled\" : \"uncontrolled\";\n console.warn(\n `${caller} is changing from ${from} to ${to}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`\n );\n }\n isControlledRef.current = isControlled;\n }, [isControlled, caller]);\n }\n const setValue = React.useCallback(\n (nextValue) => {\n if (isControlled) {\n const value2 = isFunction(nextValue) ? nextValue(prop) : nextValue;\n if (value2 !== prop) {\n onChangeRef.current?.(value2);\n }\n } else {\n setUncontrolledProp(nextValue);\n }\n },\n [isControlled, prop, setUncontrolledProp, onChangeRef]\n );\n return [value, setValue];\n}\n__name(useControllableState, \"useControllableState\");\nfunction useUncontrolledState({\n defaultProp,\n onChange\n}) {\n const [value, setValue] = React.useState(defaultProp);\n const prevValueRef = React.useRef(value);\n const onChangeRef = React.useRef(onChange);\n useInsertionEffect(() => {\n onChangeRef.current = onChange;\n }, [onChange]);\n React.useEffect(() => {\n if (prevValueRef.current !== value) {\n onChangeRef.current?.(value);\n prevValueRef.current = value;\n }\n }, [value, prevValueRef]);\n return [value, setValue, onChangeRef];\n}\n__name(useUncontrolledState, \"useUncontrolledState\");\nfunction isFunction(value) {\n return typeof value === \"function\";\n}\n__name(isFunction, \"isFunction\");\n\n// src/use-controllable-state-reducer.tsx\nimport * as React2 from \"react\";\nimport { IS_DEVELOPMENT as IS_DEVELOPMENT2 } from \"@radix-ui/primitive/is-development\";\nimport { useEffectEvent } from \"@radix-ui/react-use-effect-event\";\nvar SYNC_STATE = Symbol(\"RADIX:SYNC_STATE\");\nfunction useControllableStateReducer(reducer, userArgs, initialArg, init) {\n const { prop: controlledState, defaultProp, onChange: onChangeProp, caller } = userArgs;\n const isControlled = controlledState !== void 0;\n const onChange = useEffectEvent(onChangeProp);\n if (IS_DEVELOPMENT2) {\n const isControlledRef = React2.useRef(controlledState !== void 0);\n React2.useEffect(() => {\n const wasControlled = isControlledRef.current;\n if (wasControlled !== isControlled) {\n const from = wasControlled ? \"controlled\" : \"uncontrolled\";\n const to = isControlled ? \"controlled\" : \"uncontrolled\";\n console.warn(\n `${caller} is changing from ${from} to ${to}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`\n );\n }\n isControlledRef.current = isControlled;\n }, [isControlled, caller]);\n }\n const args = [{ ...initialArg, state: defaultProp }];\n if (init) {\n args.push(init);\n }\n const [internalState, dispatch] = React2.useReducer(\n (state2, action) => {\n if (action.type === SYNC_STATE) {\n return { ...state2, state: action.state };\n }\n const next = reducer(state2, action);\n if (isControlled && !Object.is(next.state, state2.state)) {\n onChange(next.state);\n }\n return next;\n },\n ...args\n );\n const uncontrolledState = internalState.state;\n const prevValueRef = React2.useRef(uncontrolledState);\n React2.useEffect(() => {\n if (prevValueRef.current !== uncontrolledState) {\n prevValueRef.current = uncontrolledState;\n if (!isControlled) {\n onChange(uncontrolledState);\n }\n }\n }, [uncontrolledState, prevValueRef, isControlled]);\n const state = React2.useMemo(() => {\n const isControlled2 = controlledState !== void 0;\n if (isControlled2) {\n return { ...internalState, state: controlledState };\n }\n return internalState;\n }, [internalState, controlledState]);\n React2.useEffect(() => {\n if (isControlled && !Object.is(controlledState, internalState.state)) {\n dispatch({ type: SYNC_STATE, state: controlledState });\n }\n }, [controlledState, internalState.state, isControlled]);\n return [state, dispatch];\n}\n__name(useControllableStateReducer, \"useControllableStateReducer\");\nexport {\n useControllableState,\n useControllableStateReducer\n};\n//# sourceMappingURL=index.mjs.map\n","var __defProp = Object.defineProperty;\nvar __name = (target, value) => __defProp(target, \"name\", { value, configurable: true });\n\n// src/use-size.tsx\nimport * as React from \"react\";\nimport { useLayoutEffect } from \"@radix-ui/react-use-layout-effect\";\nfunction useSize(element) {\n const [size, setSize] = React.useState(void 0);\n useLayoutEffect(() => {\n if (element) {\n setSize({ width: element.offsetWidth, height: element.offsetHeight });\n const resizeObserver = new ResizeObserver((entries) => {\n if (!Array.isArray(entries)) {\n return;\n }\n if (!entries.length) {\n return;\n }\n const entry = entries[0];\n let width;\n let height;\n if (\"borderBoxSize\" in entry) {\n const borderSizeEntry = entry[\"borderBoxSize\"];\n const borderSize = Array.isArray(borderSizeEntry) ? borderSizeEntry[0] : borderSizeEntry;\n width = borderSize[\"inlineSize\"];\n height = borderSize[\"blockSize\"];\n } else {\n width = element.offsetWidth;\n height = element.offsetHeight;\n }\n setSize({ width, height });\n });\n resizeObserver.observe(element, { box: \"border-box\" });\n return () => resizeObserver.unobserve(element);\n } else {\n setSize(void 0);\n }\n }, [element]);\n return size;\n}\n__name(useSize, \"useSize\");\nexport {\n useSize\n};\n//# sourceMappingURL=index.mjs.map\n","var __defProp = Object.defineProperty;\nvar __name = (target, value) => __defProp(target, \"name\", { value, configurable: true });\n\n// src/slot.tsx\nimport * as React from \"react\";\nimport { useComposedRefs } from \"@radix-ui/react-compose-refs\";\n// @__NO_SIDE_EFFECTS__\nfunction createSlot(ownerName) {\n const Slot2 = React.forwardRef((props, forwardedRef) => {\n let { children, ...slotProps } = props;\n let slottableElement = null;\n let hasSlottable = false;\n const newChildren = [];\n if (isLazyComponent(children) && typeof use === \"function\") {\n children = use(children._payload);\n }\n React.Children.forEach(children, (maybeSlottable) => {\n if (isSlottable(maybeSlottable)) {\n hasSlottable = true;\n const slottable = maybeSlottable;\n let child = \"child\" in slottable.props ? slottable.props.child : slottable.props.children;\n if (isLazyComponent(child) && typeof use === \"function\") {\n child = use(child._payload);\n }\n slottableElement = getSlottableElementFromSlottable(slottable, child);\n newChildren.push(slottableElement?.props?.children);\n } else {\n newChildren.push(maybeSlottable);\n }\n });\n if (slottableElement) {\n slottableElement = React.cloneElement(slottableElement, void 0, newChildren);\n } else if (\n // A `Slottable` was found but it didn't resolve to a single element (e.g.\n // it wrapped multiple elements, text, or a render-prop `child` that\n // wasn't an element). Don't fall back to treating the `Slottable` wrapper\n // itself as the slot target — throw a descriptive error below instead.\n !hasSlottable && React.Children.count(children) === 1 && React.isValidElement(children)\n ) {\n slottableElement = children;\n }\n const slottableElementRef = slottableElement ? getElementRef(slottableElement) : void 0;\n const composedRef = useComposedRefs(forwardedRef, slottableElementRef);\n if (!slottableElement) {\n if (children || children === 0) {\n throw new Error(\n hasSlottable ? createSlottableError(ownerName) : createSlotError(ownerName)\n );\n }\n return children;\n }\n const mergedProps = mergeProps(slotProps, slottableElement.props ?? {});\n if (slottableElement.type !== React.Fragment) {\n mergedProps.ref = forwardedRef ? composedRef : slottableElementRef;\n }\n return React.cloneElement(slottableElement, mergedProps);\n });\n Slot2.displayName = `${ownerName}.Slot`;\n return Slot2;\n}\n__name(createSlot, \"createSlot\");\nvar Slot = /* @__PURE__ */ createSlot(\"Slot\");\nvar SLOTTABLE_IDENTIFIER = Symbol.for(\"radix.slottable\");\n// @__NO_SIDE_EFFECTS__\nfunction createSlottable(ownerName) {\n const Slottable2 = /* @__PURE__ */ __name((props) => \"child\" in props ? props.children(props.child) : props.children, \"Slottable\");\n Slottable2.displayName = `${ownerName}.Slottable`;\n Slottable2.__radixId = SLOTTABLE_IDENTIFIER;\n return Slottable2;\n}\n__name(createSlottable, \"createSlottable\");\nvar Slottable = /* @__PURE__ */ createSlottable(\"Slottable\");\nvar getSlottableElementFromSlottable = /* @__PURE__ */ __name((slottable, child) => {\n if (\"child\" in slottable.props) {\n const child2 = slottable.props.child;\n if (!React.isValidElement(child2)) return null;\n return React.cloneElement(child2, void 0, slottable.props.children(child2.props.children));\n }\n return React.isValidElement(child) ? child : null;\n}, \"getSlottableElementFromSlottable\");\nfunction mergeProps(slotProps, childProps) {\n const overrideProps = { ...childProps };\n for (const propName in childProps) {\n const slotPropValue = slotProps[propName];\n const childPropValue = childProps[propName];\n const isHandler = /^on[A-Z]/.test(propName);\n if (isHandler) {\n if (slotPropValue && childPropValue) {\n overrideProps[propName] = (...args) => {\n const result = childPropValue(...args);\n slotPropValue(...args);\n return result;\n };\n } else if (slotPropValue) {\n overrideProps[propName] = slotPropValue;\n }\n } else if (propName === \"style\") {\n overrideProps[propName] = { ...slotPropValue, ...childPropValue };\n } else if (propName === \"className\") {\n overrideProps[propName] = [slotPropValue, childPropValue].filter(Boolean).join(\" \");\n }\n }\n return { ...slotProps, ...overrideProps };\n}\n__name(mergeProps, \"mergeProps\");\nfunction getElementRef(element) {\n let getter = Object.getOwnPropertyDescriptor(element.props, \"ref\")?.get;\n let mayWarn = getter && \"isReactWarning\" in getter && getter.isReactWarning;\n if (mayWarn) {\n return element.ref;\n }\n getter = Object.getOwnPropertyDescriptor(element, \"ref\")?.get;\n mayWarn = getter && \"isReactWarning\" in getter && getter.isReactWarning;\n if (mayWarn) {\n return element.props.ref;\n }\n return element.props.ref || element.ref;\n}\n__name(getElementRef, \"getElementRef\");\nfunction isSlottable(child) {\n return React.isValidElement(child) && typeof child.type === \"function\" && \"__radixId\" in child.type && child.type.__radixId === SLOTTABLE_IDENTIFIER;\n}\n__name(isSlottable, \"isSlottable\");\nvar REACT_LAZY_TYPE = Symbol.for(\"react.lazy\");\nfunction isLazyComponent(element) {\n return element != null && typeof element === \"object\" && \"$$typeof\" in element && element.$$typeof === REACT_LAZY_TYPE && \"_payload\" in element && isPromiseLike(element._payload);\n}\n__name(isLazyComponent, \"isLazyComponent\");\nfunction isPromiseLike(value) {\n return typeof value === \"object\" && value !== null && \"then\" in value;\n}\n__name(isPromiseLike, \"isPromiseLike\");\nvar createSlotError = /* @__PURE__ */ __name((ownerName) => {\n return `${ownerName} failed to slot onto its children. Expected a single React element child or \\`Slottable\\`.`;\n}, \"createSlotError\");\nvar createSlottableError = /* @__PURE__ */ __name((ownerName) => {\n return `${ownerName} failed to slot onto its \\`Slottable\\`. Expected \\`Slottable\\` to receive a single React element child.`;\n}, \"createSlottableError\");\nvar use = React[\" use \".trim().toString()];\nexport {\n Slot as Root,\n Slot,\n Slottable,\n createSlot,\n createSlottable\n};\n//# sourceMappingURL=index.mjs.map\n","var __defProp = Object.defineProperty;\nvar __name = (target, value) => __defProp(target, \"name\", { value, configurable: true });\n\n// src/primitive.tsx\nimport * as React from \"react\";\nimport * as ReactDOM from \"react-dom\";\nimport { createSlot } from \"@radix-ui/react-slot\";\nimport { jsx } from \"react/jsx-runtime\";\nvar NODES = [\n \"a\",\n \"button\",\n \"div\",\n \"form\",\n \"h2\",\n \"h3\",\n \"img\",\n \"input\",\n \"label\",\n \"li\",\n \"nav\",\n \"ol\",\n \"p\",\n \"select\",\n \"span\",\n \"svg\",\n \"ul\"\n];\nvar Primitive = NODES.reduce((primitive, node) => {\n const Slot = createSlot(`Primitive.${node}`);\n const Node = React.forwardRef((props, forwardedRef) => {\n const { asChild, ...primitiveProps } = props;\n const Comp = asChild ? Slot : node;\n if (typeof window !== \"undefined\") {\n window[Symbol.for(\"radix-ui\")] = true;\n }\n return /* @__PURE__ */ jsx(Comp, { ...primitiveProps, ref: forwardedRef });\n });\n Node.displayName = `Primitive.${node}`;\n return { ...primitive, [node]: Node };\n}, {});\nfunction dispatchDiscreteCustomEvent(target, event) {\n if (target) ReactDOM.flushSync(() => target.dispatchEvent(event));\n}\n__name(dispatchDiscreteCustomEvent, \"dispatchDiscreteCustomEvent\");\nvar Root = Primitive;\nexport {\n Primitive,\n Root,\n dispatchDiscreteCustomEvent\n};\n//# sourceMappingURL=index.mjs.map\n","\"use client\";\nvar __defProp = Object.defineProperty;\nvar __name = (target, value) => __defProp(target, \"name\", { value, configurable: true });\n\n// src/switch.tsx\nimport * as React from \"react\";\nimport { composeEventHandlers } from \"@radix-ui/primitive\";\nimport { useComposedRefs } from \"@radix-ui/react-compose-refs\";\nimport { createContextScope } from \"@radix-ui/react-context\";\nimport { useControllableState } from \"@radix-ui/react-use-controllable-state\";\nimport { useSize } from \"@radix-ui/react-use-size\";\nimport { Primitive } from \"@radix-ui/react-primitive\";\nimport { Fragment, jsx, jsxs } from \"react/jsx-runtime\";\nvar SWITCH_NAME = \"Switch\";\nvar [createSwitchContext, createSwitchScope] = createContextScope(SWITCH_NAME);\nvar [SwitchProviderImpl, useSwitchContext] = createSwitchContext(SWITCH_NAME);\nfunction SwitchProvider(props) {\n const {\n __scopeSwitch,\n checked: checkedProp,\n children,\n defaultChecked,\n disabled,\n form,\n name,\n onCheckedChange,\n required,\n value = \"on\",\n // @ts-expect-error\n internal_do_not_use_render\n } = props;\n const [checked, setChecked] = useControllableState({\n prop: checkedProp,\n defaultProp: defaultChecked ?? false,\n onChange: onCheckedChange,\n caller: SWITCH_NAME\n });\n const [control, setControl] = React.useState(null);\n const [bubbleInput, setBubbleInput] = React.useState(null);\n const hasConsumerStoppedPropagationRef = React.useRef(false);\n const [userInteractionCount, onUserInteraction] = React.useReducer(\n (count) => count + 1,\n 0\n );\n const isFormControl = control ? !!form || !!control.closest(\"form\") : (\n // We set this to true by default so that events bubble to forms without JS (SSR)\n true\n );\n const context = {\n checked,\n setChecked,\n disabled,\n control,\n setControl,\n name,\n form,\n value,\n hasConsumerStoppedPropagationRef,\n userInteractionCount,\n onUserInteraction,\n required,\n defaultChecked,\n isFormControl,\n bubbleInput,\n setBubbleInput\n };\n return /* @__PURE__ */ jsx(SwitchProviderImpl, { scope: __scopeSwitch, ...context, children: isFunction(internal_do_not_use_render) ? internal_do_not_use_render(context) : children });\n}\n__name(SwitchProvider, \"SwitchProvider\");\nvar TRIGGER_NAME = \"SwitchTrigger\";\nvar SwitchTrigger = /* @__PURE__ */ React.forwardRef(\n /* @__PURE__ */ __name(function SwitchTrigger2({ __scopeSwitch, onClick, ...switchProps }, forwardedRef) {\n const {\n control,\n form,\n value,\n disabled,\n checked,\n required,\n setControl,\n setChecked,\n hasConsumerStoppedPropagationRef,\n onUserInteraction,\n isFormControl,\n bubbleInput\n } = useSwitchContext(TRIGGER_NAME, __scopeSwitch);\n const composedRefs = useComposedRefs(forwardedRef, setControl);\n const initialCheckedStateRef = React.useRef(checked);\n React.useEffect(() => {\n const associatedForm = form ? control?.ownerDocument.getElementById(form) : control?.form;\n if (associatedForm instanceof HTMLFormElement) {\n const reset = /* @__PURE__ */ __name(() => setChecked(initialCheckedStateRef.current), \"reset\");\n associatedForm.addEventListener(\"reset\", reset);\n return () => associatedForm.removeEventListener(\"reset\", reset);\n }\n }, [control, form, setChecked]);\n return /* @__PURE__ */ jsx(\n Primitive.button,\n {\n type: \"button\",\n role: \"switch\",\n \"aria-checked\": checked,\n \"aria-required\": required,\n \"data-state\": getState(checked),\n \"data-disabled\": disabled ? \"\" : void 0,\n disabled,\n value,\n ...switchProps,\n ref: composedRefs,\n onClick: composeEventHandlers(onClick, (event) => {\n onUserInteraction();\n setChecked((prevChecked) => !prevChecked);\n if (bubbleInput && isFormControl) {\n hasConsumerStoppedPropagationRef.current = event.isPropagationStopped();\n if (!hasConsumerStoppedPropagationRef.current) event.stopPropagation();\n }\n })\n }\n );\n }, \"SwitchTrigger\")\n);\nvar Switch = /* @__PURE__ */ React.forwardRef(\n // blank line to reduce diff noise\n /* @__PURE__ */ __name(function Switch2(props, forwardedRef) {\n const {\n __scopeSwitch,\n name,\n checked,\n defaultChecked,\n required,\n disabled,\n value,\n onCheckedChange,\n form,\n ...switchProps\n } = props;\n return /* @__PURE__ */ jsx(\n SwitchProvider,\n {\n __scopeSwitch,\n checked,\n defaultChecked,\n disabled,\n required,\n onCheckedChange,\n name,\n form,\n value,\n internal_do_not_use_render: ({ isFormControl }) => /* @__PURE__ */ jsxs(Fragment, { children: [\n /* @__PURE__ */ jsx(\n SwitchTrigger,\n {\n ...switchProps,\n ref: forwardedRef,\n __scopeSwitch\n }\n ),\n isFormControl && /* @__PURE__ */ jsx(\n SwitchBubbleInput,\n {\n __scopeSwitch\n }\n )\n ] })\n }\n );\n }, \"Switch\")\n);\nvar THUMB_NAME = \"SwitchThumb\";\nvar SwitchThumb = /* @__PURE__ */ React.forwardRef(\n /* @__PURE__ */ __name(function SwitchThumb2(props, forwardedRef) {\n const { __scopeSwitch, ...thumbProps } = props;\n const context = useSwitchContext(THUMB_NAME, __scopeSwitch);\n return /* @__PURE__ */ jsx(\n Primitive.span,\n {\n \"data-state\": getState(context.checked),\n \"data-disabled\": context.disabled ? \"\" : void 0,\n ...thumbProps,\n ref: forwardedRef\n }\n );\n }, \"SwitchThumb\")\n);\nvar BUBBLE_INPUT_NAME = \"SwitchBubbleInput\";\nvar SwitchBubbleInput = /* @__PURE__ */ React.forwardRef(\n // blank line to reduce diff noise\n /* @__PURE__ */ __name(function SwitchBubbleInput2({ __scopeSwitch, onClick, ...props }, forwardedRef) {\n const {\n control,\n hasConsumerStoppedPropagationRef,\n userInteractionCount,\n checked,\n defaultChecked,\n required,\n disabled,\n name,\n value,\n form,\n bubbleInput,\n setBubbleInput\n } = useSwitchContext(BUBBLE_INPUT_NAME, __scopeSwitch);\n const composedRefs = useComposedRefs(forwardedRef, setBubbleInput);\n const controlSize = useSize(control);\n const shouldStopClickPropagationRef = React.useRef(false);\n const prevCheckedRef = React.useRef(checked);\n const prevUserInteractionCountRef = React.useRef(userInteractionCount);\n React.useEffect(() => {\n const input = bubbleInput;\n if (!input) return;\n const inputProto = window.HTMLInputElement.prototype;\n const descriptor = Object.getOwnPropertyDescriptor(\n inputProto,\n \"checked\"\n );\n const setChecked = descriptor.set;\n const isUserInteraction = userInteractionCount !== prevUserInteractionCountRef.current;\n prevUserInteractionCountRef.current = userInteractionCount;\n const checkedChanged = prevCheckedRef.current !== checked;\n prevCheckedRef.current = checked;\n const bubbles = !(isUserInteraction && hasConsumerStoppedPropagationRef.current);\n if (checkedChanged && setChecked) {\n shouldStopClickPropagationRef.current = !isUserInteraction;\n const event = new Event(\"click\", { bubbles });\n setChecked.call(input, checked);\n input.dispatchEvent(event);\n shouldStopClickPropagationRef.current = false;\n }\n }, [bubbleInput, checked, hasConsumerStoppedPropagationRef, userInteractionCount]);\n const defaultCheckedRef = React.useRef(checked);\n return /* @__PURE__ */ jsx(\n Primitive.input,\n {\n type: \"checkbox\",\n \"aria-hidden\": true,\n defaultChecked: defaultChecked ?? defaultCheckedRef.current,\n required,\n disabled,\n name,\n value,\n form,\n ...props,\n tabIndex: -1,\n ref: composedRefs,\n onClick: composeEventHandlers(onClick, (event) => {\n if (shouldStopClickPropagationRef.current) {\n event.stopPropagation();\n }\n }),\n style: {\n ...props.style,\n ...controlSize,\n position: \"absolute\",\n pointerEvents: \"none\",\n opacity: 0,\n margin: 0,\n // We transform because the input is absolutely positioned but we have\n // rendered it **after** the button. This pulls it back to sit on top\n // of the button.\n transform: \"translateX(-100%)\"\n }\n }\n );\n }, \"SwitchBubbleInput\")\n);\nfunction isFunction(value) {\n return typeof value === \"function\";\n}\n__name(isFunction, \"isFunction\");\nfunction getState(checked) {\n return checked ? \"checked\" : \"unchecked\";\n}\n__name(getState, \"getState\");\nexport {\n Switch as Root,\n Switch,\n SwitchThumb,\n SwitchThumb as Thumb,\n createSwitchScope,\n SwitchBubbleInput as unstable_BubbleInput,\n SwitchProvider as unstable_Provider,\n SwitchBubbleInput as unstable_SwitchBubbleInput,\n SwitchProvider as unstable_SwitchProvider,\n SwitchTrigger as unstable_SwitchTrigger,\n SwitchTrigger as unstable_Trigger\n};\n//# sourceMappingURL=index.mjs.map\n","import * as React from \"react\";\nimport * as SwitchPrimitives from \"@radix-ui/react-switch\";\nimport { cn } from \"../../utils/cn\";\n\nconst Switch = React.forwardRef<\n React.ElementRef<typeof SwitchPrimitives.Root>,\n React.ComponentPropsWithoutRef<typeof SwitchPrimitives.Root>\n>(({ className, ...props }, ref) => (\n <SwitchPrimitives.Root\n ref={ref}\n className={cn(\n \"peer inline-flex h-5 w-9 shrink-0 cursor-pointer items-center rounded-full border border-border transition-colors data-[state=checked]:bg-primary data-[state=unchecked]:bg-bg-elevated focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary/60 disabled:cursor-not-allowed disabled:opacity-50\",\n className,\n )}\n {...props}\n >\n <SwitchPrimitives.Thumb\n className={cn(\n \"pointer-events-none block h-4 w-4 rounded-full bg-foreground shadow-lg transition-transform data-[state=checked]:translate-x-4 data-[state=unchecked]:translate-x-0.5\",\n )}\n />\n </SwitchPrimitives.Root>\n));\nSwitch.displayName = SwitchPrimitives.Root.displayName;\n\nexport { Switch };\n"],"names":["__defProp","__name","target","value","canUseDOM","composeEventHandlers","originalEventHandler","ourEventHandler","checkForDefaultPrevented","event","getOwnerWindow","element","getOwnerDocument","getActiveElement","node","activeDescendant","activeElement","isFrame","id","setRef","ref","composeRefs","refs","hasCleanup","cleanups","cleanup","i","useComposedRefs","React.useCallback","createContext2","rootComponentName","defaultContext","Context","React.createContext","Provider","props","children","context","React.useMemo","jsx","useContext2","consumerName","options","optional","React.useContext","createContextScope","scopeName","createContextScopeDeps","defaultContexts","createContext3","BaseContext","index","scope","createScope","scopeContexts","contexts","composeContextScopes","scopes","baseScope","scopeHooks","createScope2","overrideScopes","nextScopes","nextScopes2","useScope","currentScope","useLayoutEffect2","React.useLayoutEffect","useReactEffectEvent","React","useReactInsertionEffect","useEffectEvent","callback","React.useRef","useLayoutEffect","args","useInsertionEffect","useControllableState","prop","defaultProp","onChange","caller","uncontrolledProp","setUncontrolledProp","onChangeRef","useUncontrolledState","isControlled","setValue","nextValue","value2","isFunction","React.useState","prevValueRef","React.useEffect","SYNC_STATE","useControllableStateReducer","reducer","userArgs","initialArg","init","controlledState","onChangeProp","internalState","dispatch","React2.useReducer","state2","action","next","uncontrolledState","React2.useRef","React2.useEffect","state","React2.useMemo","useSize","size","setSize","resizeObserver","entries","entry","width","height","borderSizeEntry","borderSize","createSlot","ownerName","Slot2","React.forwardRef","forwardedRef","slotProps","slottableElement","hasSlottable","newChildren","isLazyComponent","use","React.Children","maybeSlottable","isSlottable","slottable","child","getSlottableElementFromSlottable","React.cloneElement","React.isValidElement","slottableElementRef","getElementRef","composedRef","createSlottableError","createSlotError","mergedProps","mergeProps","React.Fragment","SLOTTABLE_IDENTIFIER","createSlottable","Slottable2","child2","childProps","overrideProps","propName","slotPropValue","childPropValue","result","getter","mayWarn","REACT_LAZY_TYPE","isPromiseLike","NODES","Primitive","primitive","Slot","Node","asChild","primitiveProps","Comp","dispatchDiscreteCustomEvent","ReactDOM.flushSync","SWITCH_NAME","createSwitchContext","createSwitchScope","SwitchProviderImpl","useSwitchContext","SwitchProvider","__scopeSwitch","checkedProp","defaultChecked","disabled","form","name","onCheckedChange","required","internal_do_not_use_render","checked","setChecked","control","setControl","bubbleInput","setBubbleInput","hasConsumerStoppedPropagationRef","userInteractionCount","onUserInteraction","React.useReducer","count","isFormControl","TRIGGER_NAME","SwitchTrigger","onClick","switchProps","composedRefs","initialCheckedStateRef","associatedForm","reset","getState","prevChecked","Switch","jsxs","Fragment","SwitchBubbleInput","THUMB_NAME","SwitchThumb","thumbProps","BUBBLE_INPUT_NAME","controlSize","shouldStopClickPropagationRef","prevCheckedRef","prevUserInteractionCountRef","input","inputProto","isUserInteraction","checkedChanged","bubbles","defaultCheckedRef","className","SwitchPrimitives.Root","cn","SwitchPrimitives.Thumb"],"mappings":"sEAAA,IAAIA,GAAY,OAAO,eACnBC,EAAS,CAACC,EAAQC,IAAUH,GAAUE,EAAQ,OAAQ,CAAE,MAAAC,EAAO,aAAc,GAAM,EAGnFC,EAAY,CAAC,EAAE,OAAO,OAAW,KAAe,OAAO,UAAY,OAAO,SAAS,eACvF,SAASC,EAAqBC,EAAsBC,EAAiB,CAAE,yBAAAC,EAA2B,EAAI,EAAK,GAAI,CAC7G,OAAuBP,EAAO,SAAqBQ,EAAO,CAExD,GADAH,IAAuBG,CAAK,EACxBD,IAA6B,IAAS,CAACC,GAAS,CAACA,EAAM,iBACzD,OAAOF,IAAkBE,CAAK,CAElC,EAAG,aAAa,CAClB,CACAR,EAAOI,EAAsB,sBAAsB,EACnD,SAASK,GAAeC,EAAS,CAC/B,GAAI,CAACP,EACH,MAAM,IAAI,MAAM,yCAAyC,EAE3D,OAAOO,GAAS,eAAe,aAAe,MAChD,CACAV,EAAOS,GAAgB,gBAAgB,EACvC,SAASE,EAAiBD,EAAS,CACjC,GAAI,CAACP,EACH,MAAM,IAAI,MAAM,2CAA2C,EAE7D,OAAOO,GAAS,eAAiB,QACnC,CACAV,EAAOW,EAAkB,kBAAkB,EAC3C,SAASC,EAAiBC,EAAMC,EAAmB,GAAO,CACxD,KAAM,CAAE,cAAAC,CAAa,EAAKJ,EAAiBE,CAAI,EAC/C,GAAI,CAACE,GAAe,SAClB,OAAO,KAET,GAAIC,EAAQD,CAAa,GAAKA,EAAc,gBAC1C,OAAOH,EAAiBG,EAAc,gBAAgB,KAAMD,CAAgB,EAE9E,GAAIA,EAAkB,CACpB,MAAMG,EAAKF,EAAc,aAAa,uBAAuB,EAC7D,GAAIE,EAAI,CACN,MAAMP,EAAUC,EAAiBI,CAAa,EAAE,eAAeE,CAAE,EACjE,GAAIP,EACF,OAAOA,CAEX,CACF,CACA,OAAOK,CACT,CACAf,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CrC,EAAW,KAAKiC,EAAOlC,CAAO,EAC9BkC,EAAM,cAActN,EAAK,EACzBmN,EAA8B,QAAU,EAC1C,CACF,EAAG,CAAC3B,EAAaJ,EAASM,EAAkCC,CAAoB,CAAC,EACjF,MAAMgC,EAAoB3J,EAAAA,OAAaoH,CAAO,EAC9C,OAAuBtJ,EAAAA,IACrB8H,EAAU,MACV,CACE,KAAM,WACN,cAAe,GACf,eAAgBiB,GAAkB8C,EAAkB,QACpD,SAAAzC,EACA,SAAAJ,EACA,KAAAE,EACA,MAAAtL,EACA,KAAAqL,EACA,GAAGrJ,EACH,SAAU,GACV,IAAK0K,EACL,QAASxM,EAAqBsM,EAAUlM,GAAU,CAC5CmN,EAA8B,SAChCnN,EAAM,gBAAe,CAEzB,CAAC,EACD,MAAO,CACL,GAAG0B,EAAM,MACT,GAAGwL,EACH,SAAU,WACV,cAAe,OACf,QAAS,EACT,OAAQ,EAIR,UAAW,mBACrB,CACA,CACA,CACE,EAAG,mBAAmB,CACxB,EACA,SAASjI,GAAWvF,EAAO,CACzB,OAAO,OAAOA,GAAU,UAC1B,CACAF,EAAOyF,GAAY,YAAY,EAC/B,SAASuH,EAASpB,EAAS,CACzB,OAAOA,EAAU,UAAY,WAC/B,CACA5L,EAAOgN,EAAU,UAAU,EC5Q3B,MAAME,GAASrF,EAAAA,WAGb,CAAC,CAAE,UAAAuG,EAAW,GAAGlM,CAAA,EAASf,IAC1BmB,EAAAA,IAAC+L,GAAA,CACC,IAAAlN,EACA,UAAWmN,EACT,wTACAF,CAAA,EAED,GAAGlM,EAEJ,SAAAI,EAAAA,IAACiM,GAAA,CACC,UAAWD,EACT,uKAAA,CACF,CAAA,CACF,CACF,CACD,EACDpB,GAAO,YAAcmB,GAAsB","x_google_ignoreList":[0,1,2,3,4,5,6,7,8,9]}
@@ -1,2 +1,2 @@
1
- import{j as a,t as m}from"./index-DlHJ7LBL.js";function u({pressed:t,onPressedChange:r,className:e,onClick:n,...o}){return a.jsx("button",{type:"button","aria-pressed":t,onClick:i=>{n?.(i),r?.(!t)},className:m("inline-flex items-center justify-center rounded-md border px-3 py-1.5 text-sm font-medium transition-all",t?"border-primary/50 bg-primary/15 text-neon glow-primary":"border-border bg-transparent text-muted hover:text-foreground",e),...o})}export{u as T};
2
- //# sourceMappingURL=toggle-Y3vbE0NG.js.map
1
+ import{j as a,t as m}from"./index-BBJ8LglL.js";function u({pressed:t,onPressedChange:r,className:e,onClick:n,...o}){return a.jsx("button",{type:"button","aria-pressed":t,onClick:i=>{n?.(i),r?.(!t)},className:m("inline-flex items-center justify-center rounded-md border px-3 py-1.5 text-sm font-medium transition-all",t?"border-primary/50 bg-primary/15 text-neon glow-primary":"border-border bg-transparent text-muted hover:text-foreground",e),...o})}export{u as T};
2
+ //# sourceMappingURL=toggle-DnRtZDPW.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"toggle-Y3vbE0NG.js","sources":["../../src/components/ui/toggle.tsx"],"sourcesContent":["import * as React from \"react\";\nimport { cn } from \"../../utils/cn\";\n\nexport interface ToggleProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {\n pressed?: boolean;\n onPressedChange?: (pressed: boolean) => void;\n}\n\nexport function Toggle({ pressed, onPressedChange, className, onClick, ...props }: ToggleProps) {\n return (\n <button\n type=\"button\"\n aria-pressed={pressed}\n onClick={(e) => {\n onClick?.(e);\n onPressedChange?.(!pressed);\n }}\n className={cn(\n \"inline-flex items-center justify-center rounded-md border px-3 py-1.5 text-sm font-medium transition-all\",\n pressed\n ? \"border-primary/50 bg-primary/15 text-neon glow-primary\"\n : \"border-border bg-transparent text-muted hover:text-foreground\",\n className,\n )}\n {...props}\n />\n );\n}\n"],"names":["Toggle","pressed","onPressedChange","className","onClick","props","jsx","e","cn"],"mappings":"+CAQO,SAASA,EAAO,CAAE,QAAAC,EAAS,gBAAAC,EAAiB,UAAAC,EAAW,QAAAC,EAAS,GAAGC,GAAsB,CAC9F,OACEC,EAAAA,IAAC,SAAA,CACC,KAAK,SACL,eAAcL,EACd,QAAUM,GAAM,CACdH,IAAUG,CAAC,EACXL,IAAkB,CAACD,CAAO,CAC5B,EACA,UAAWO,EACT,2GACAP,EACI,yDACA,gEACJE,CAAA,EAED,GAAGE,CAAA,CAAA,CAGV"}
1
+ {"version":3,"file":"toggle-DnRtZDPW.js","sources":["../../src/components/ui/toggle.tsx"],"sourcesContent":["import * as React from \"react\";\nimport { cn } from \"../../utils/cn\";\n\nexport interface ToggleProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {\n pressed?: boolean;\n onPressedChange?: (pressed: boolean) => void;\n}\n\nexport function Toggle({ pressed, onPressedChange, className, onClick, ...props }: ToggleProps) {\n return (\n <button\n type=\"button\"\n aria-pressed={pressed}\n onClick={(e) => {\n onClick?.(e);\n onPressedChange?.(!pressed);\n }}\n className={cn(\n \"inline-flex items-center justify-center rounded-md border px-3 py-1.5 text-sm font-medium transition-all\",\n pressed\n ? \"border-primary/50 bg-primary/15 text-neon glow-primary\"\n : \"border-border bg-transparent text-muted hover:text-foreground\",\n className,\n )}\n {...props}\n />\n );\n}\n"],"names":["Toggle","pressed","onPressedChange","className","onClick","props","jsx","e","cn"],"mappings":"+CAQO,SAASA,EAAO,CAAE,QAAAC,EAAS,gBAAAC,EAAiB,UAAAC,EAAW,QAAAC,EAAS,GAAGC,GAAsB,CAC9F,OACEC,EAAAA,IAAC,SAAA,CACC,KAAK,SACL,eAAcL,EACd,QAAUM,GAAM,CACdH,IAAUG,CAAC,EACXL,IAAkB,CAACD,CAAO,CAC5B,EACA,UAAWO,EACT,2GACAP,EACI,yDACA,gEACJE,CAAA,EAED,GAAGE,CAAA,CAAA,CAGV"}
@@ -1,2 +1,2 @@
1
- import{r as e}from"./index-DlHJ7LBL.js";function R(i={}){const{maxEvents:c=500,maxReconnects:l=5}=i,[f,v]=e.useState([]),[E,n]=e.useState("connecting"),[S,p]=e.useState(0),[m,d]=e.useState(null),o=e.useRef(0),s=e.useRef(null),r=e.useCallback(()=>{s.current&&s.current.close(),n("connecting");const t=new EventSource("/api/events");s.current=t,t.onopen=()=>{n("connected"),o.current=0},t.onmessage=g=>{try{const x=JSON.parse(g.data);v(u=>{const a=[...u,x];return a.length>c?a.slice(-c):a}),p(u=>u+1),d(Date.now())}catch{}},t.onerror=()=>{t.close(),o.current<l?(o.current+=1,n("connecting"),setTimeout(r,1e3)):n("disconnected")}},[c,l]);return e.useEffect(()=>(r(),()=>{s.current?.close()}),[r]),{events:f,status:E,eventCount:S,lastEventAt:m}}export{R as u};
2
- //# sourceMappingURL=useSSE-CnJdk56R.js.map
1
+ import{r as e}from"./index-BBJ8LglL.js";function R(i={}){const{maxEvents:c=500,maxReconnects:l=5}=i,[f,v]=e.useState([]),[E,n]=e.useState("connecting"),[S,p]=e.useState(0),[m,d]=e.useState(null),o=e.useRef(0),s=e.useRef(null),r=e.useCallback(()=>{s.current&&s.current.close(),n("connecting");const t=new EventSource("/api/events");s.current=t,t.onopen=()=>{n("connected"),o.current=0},t.onmessage=g=>{try{const x=JSON.parse(g.data);v(u=>{const a=[...u,x];return a.length>c?a.slice(-c):a}),p(u=>u+1),d(Date.now())}catch{}},t.onerror=()=>{t.close(),o.current<l?(o.current+=1,n("connecting"),setTimeout(r,1e3)):n("disconnected")}},[c,l]);return e.useEffect(()=>(r(),()=>{s.current?.close()}),[r]),{events:f,status:E,eventCount:S,lastEventAt:m}}export{R as u};
2
+ //# sourceMappingURL=useSSE-l_bpRt_v.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"useSSE-CnJdk56R.js","sources":["../../src/hooks/useSSE.ts"],"sourcesContent":["/**\n * dashboard-client/src/hooks/useSSE.ts — Server-Sent Events hook.\n *\n * Connects to /api/events, provides real-time event stream.\n * SPRINT-B1: basic connection. SPRINT-D1: reconnect with backoff.\n */\n\nimport { useState, useEffect, useRef, useCallback } from 'react';\nimport type { SseEvent } from '../../../dashboard-server/api-contracts';\n\nexport type SseStatus = 'connecting' | 'connected' | 'disconnected' | 'error';\n\nexport interface UseSSEResult {\n events: SseEvent[];\n status: SseStatus;\n eventCount: number;\n lastEventAt: number | null;\n}\n\nexport interface UseSSEOptions {\n /** Max events to keep in memory (ring buffer). */\n maxEvents?: number;\n /** Max reconnect attempts before giving up. */\n maxReconnects?: number;\n}\n\n// SPRINT-D1-REMAINING: exponential backoff (1s → 2s → 4s → max 30s).\n// SPRINT-D1-REMAINING: after 5 failures, set status='disconnected'.\n\nexport function useSSE(options: UseSSEOptions = {}): UseSSEResult {\n const { maxEvents = 500, maxReconnects = 5 } = options;\n const [events, setEvents] = useState<SseEvent[]>([]);\n const [status, setStatus] = useState<SseStatus>('connecting');\n const [eventCount, setEventCount] = useState(0);\n const [lastEventAt, setLastEventAt] = useState<number | null>(null);\n const reconnectCount = useRef(0);\n const sourceRef = useRef<EventSource | null>(null);\n\n const connect = useCallback(() => {\n if (sourceRef.current) {\n sourceRef.current.close();\n }\n setStatus('connecting');\n const source = new EventSource('/api/events');\n sourceRef.current = source;\n\n source.onopen = () => {\n setStatus('connected');\n reconnectCount.current = 0;\n };\n\n source.onmessage = (event) => {\n try {\n const parsed = JSON.parse(event.data) as SseEvent;\n setEvents(prev => {\n const next = [...prev, parsed];\n return next.length > maxEvents ? next.slice(-maxEvents) : next;\n });\n setEventCount(c => c + 1);\n setLastEventAt(Date.now());\n } catch {\n // non-fatal: skip malformed events\n }\n };\n\n source.onerror = () => {\n source.close();\n if (reconnectCount.current < maxReconnects) {\n reconnectCount.current += 1;\n setStatus('connecting');\n // SPRINT-D1: use exponential backoff instead of fixed delay\n setTimeout(connect, 1000);\n } else {\n setStatus('disconnected');\n }\n };\n }, [maxEvents, maxReconnects]);\n\n useEffect(() => {\n connect();\n return () => {\n sourceRef.current?.close();\n };\n }, [connect]);\n\n return { events, status, eventCount, lastEventAt };\n}\n"],"names":["useSSE","options","maxEvents","maxReconnects","events","setEvents","useState","status","setStatus","eventCount","setEventCount","lastEventAt","setLastEventAt","reconnectCount","useRef","sourceRef","connect","useCallback","source","event","parsed","prev","next","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,CAAO,CAAC,EAEL,CAAE,OAAAZ,EAAQ,OAAAG,EAAQ,WAAAE,EAAY,YAAAE,CAAA,CACvC"}
1
+ {"version":3,"file":"useSSE-l_bpRt_v.js","sources":["../../src/hooks/useSSE.ts"],"sourcesContent":["/**\n * dashboard-client/src/hooks/useSSE.ts — Server-Sent Events hook.\n *\n * Connects to /api/events, provides real-time event stream.\n * SPRINT-B1: basic connection. SPRINT-D1: reconnect with backoff.\n */\n\nimport { useState, useEffect, useRef, useCallback } from 'react';\nimport type { SseEvent } from '../../../dashboard-server/api-contracts';\n\nexport type SseStatus = 'connecting' | 'connected' | 'disconnected' | 'error';\n\nexport interface UseSSEResult {\n events: SseEvent[];\n status: SseStatus;\n eventCount: number;\n lastEventAt: number | null;\n}\n\nexport interface UseSSEOptions {\n /** Max events to keep in memory (ring buffer). */\n maxEvents?: number;\n /** Max reconnect attempts before giving up. */\n maxReconnects?: number;\n}\n\n// SPRINT-D1-REMAINING: exponential backoff (1s → 2s → 4s → max 30s).\n// SPRINT-D1-REMAINING: after 5 failures, set status='disconnected'.\n\nexport function useSSE(options: UseSSEOptions = {}): UseSSEResult {\n const { maxEvents = 500, maxReconnects = 5 } = options;\n const [events, setEvents] = useState<SseEvent[]>([]);\n const [status, setStatus] = useState<SseStatus>('connecting');\n const [eventCount, setEventCount] = useState(0);\n const [lastEventAt, setLastEventAt] = useState<number | null>(null);\n const reconnectCount = useRef(0);\n const sourceRef = useRef<EventSource | null>(null);\n\n const connect = useCallback(() => {\n if (sourceRef.current) {\n sourceRef.current.close();\n }\n setStatus('connecting');\n const source = new EventSource('/api/events');\n sourceRef.current = source;\n\n source.onopen = () => {\n setStatus('connected');\n reconnectCount.current = 0;\n };\n\n source.onmessage = (event) => {\n try {\n const parsed = JSON.parse(event.data) as SseEvent;\n setEvents(prev => {\n const next = [...prev, parsed];\n return next.length > maxEvents ? next.slice(-maxEvents) : next;\n });\n setEventCount(c => c + 1);\n setLastEventAt(Date.now());\n } catch {\n // non-fatal: skip malformed events\n }\n };\n\n source.onerror = () => {\n source.close();\n if (reconnectCount.current < maxReconnects) {\n reconnectCount.current += 1;\n setStatus('connecting');\n // SPRINT-D1: use exponential backoff instead of fixed delay\n setTimeout(connect, 1000);\n } else {\n setStatus('disconnected');\n }\n };\n }, [maxEvents, maxReconnects]);\n\n useEffect(() => {\n connect();\n return () => {\n sourceRef.current?.close();\n };\n }, [connect]);\n\n return { events, status, eventCount, lastEventAt };\n}\n"],"names":["useSSE","options","maxEvents","maxReconnects","events","setEvents","useState","status","setStatus","eventCount","setEventCount","lastEventAt","setLastEventAt","reconnectCount","useRef","sourceRef","connect","useCallback","source","event","parsed","prev","next","c","useEffect"],"mappings":"wCA6BO,SAASA,EAAOC,EAAyB,GAAkB,CAChE,KAAM,CAAE,UAAAC,EAAY,IAAK,cAAAC,EAAgB,GAAMF,EACzC,CAACG,EAAQC,CAAS,EAAIC,EAAAA,SAAqB,CAAA,CAAE,EAC7C,CAACC,EAAQC,CAAS,EAAIF,EAAAA,SAAoB,YAAY,EACtD,CAACG,EAAYC,CAAa,EAAIJ,EAAAA,SAAS,CAAC,EACxC,CAACK,EAAaC,CAAc,EAAIN,EAAAA,SAAwB,IAAI,EAC5DO,EAAiBC,EAAAA,OAAO,CAAC,EACzBC,EAAYD,EAAAA,OAA2B,IAAI,EAE3CE,EAAUC,EAAAA,YAAY,IAAM,CAC5BF,EAAU,SACZA,EAAU,QAAQ,MAAA,EAEpBP,EAAU,YAAY,EACtB,MAAMU,EAAS,IAAI,YAAY,aAAa,EAC5CH,EAAU,QAAUG,EAEpBA,EAAO,OAAS,IAAM,CACpBV,EAAU,WAAW,EACrBK,EAAe,QAAU,CAC3B,EAEAK,EAAO,UAAaC,GAAU,CAC5B,GAAI,CACF,MAAMC,EAAS,KAAK,MAAMD,EAAM,IAAI,EACpCd,EAAUgB,GAAQ,CAChB,MAAMC,EAAO,CAAC,GAAGD,EAAMD,CAAM,EAC7B,OAAOE,EAAK,OAASpB,EAAYoB,EAAK,MAAM,CAACpB,CAAS,EAAIoB,CAC5D,CAAC,EACDZ,EAAca,GAAKA,EAAI,CAAC,EACxBX,EAAe,KAAK,KAAK,CAC3B,MAAQ,CAER,CACF,EAEAM,EAAO,QAAU,IAAM,CACrBA,EAAO,MAAA,EACHL,EAAe,QAAUV,GAC3BU,EAAe,SAAW,EAC1BL,EAAU,YAAY,EAEtB,WAAWQ,EAAS,GAAI,GAExBR,EAAU,cAAc,CAE5B,CACF,EAAG,CAACN,EAAWC,CAAa,CAAC,EAE7BqB,OAAAA,EAAAA,UAAU,KACRR,EAAA,EACO,IAAM,CACXD,EAAU,SAAS,MAAA,CACrB,GACC,CAACC,CAAO,CAAC,EAEL,CAAE,OAAAZ,EAAQ,OAAAG,EAAQ,WAAAE,EAAY,YAAAE,CAAA,CACvC"}
@@ -4,7 +4,7 @@
4
4
  <meta charset="UTF-8" />
5
5
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
6
6
  <title>mega-compact dashboard</title>
7
- <script type="module" crossorigin src="./assets/index-DlHJ7LBL.js"></script>
7
+ <script type="module" crossorigin src="./assets/index-BBJ8LglL.js"></script>
8
8
  <link rel="stylesheet" crossorigin href="./assets/index-D7CJBr8R.css">
9
9
  </head>
10
10
  <body>
@@ -68,15 +68,14 @@ export default function CortexRuntimeCard(): React.ReactElement {
68
68
  }
69
69
  }, [budgetSeeded, status]);
70
70
 
71
+ // Omit embedder/url when the card only manages runtime keys — the server's
72
+ // tryEnc1bConfigure handles pure additive configure (no embedder change) and
73
+ // returns before the embedder-validation gate.
71
74
  const toggleNative = useCallback(
72
75
  (next: boolean) => {
73
76
  setSaving(true);
74
77
  setError(null);
75
- configureEmbedder({
76
- embedder: "custom",
77
- url: status?.embeddingEndpointUrl ?? undefined,
78
- encoderNativeOptIn: next,
79
- })
78
+ configureEmbedder({ encoderNativeOptIn: next })
80
79
  .then(() => {
81
80
  setSaving(false);
82
81
  loadStatus();
@@ -86,7 +85,7 @@ export default function CortexRuntimeCard(): React.ReactElement {
86
85
  setSaving(false);
87
86
  });
88
87
  },
89
- [status, loadStatus],
88
+ [loadStatus],
90
89
  );
91
90
 
92
91
  const saveBudget = useCallback(() => {
@@ -104,11 +103,7 @@ export default function CortexRuntimeCard(): React.ReactElement {
104
103
  }
105
104
  setSaving(true);
106
105
  setError(null);
107
- configureEmbedder({
108
- embedder: "custom",
109
- url: status?.embeddingEndpointUrl ?? undefined,
110
- nativeOrtBudgetMib: trimmed,
111
- })
106
+ configureEmbedder({ nativeOrtBudgetMib: trimmed })
112
107
  .then(() => {
113
108
  setSaving(false);
114
109
  loadStatus();
@@ -148,8 +148,10 @@ export interface SetupConfigureRequest {
148
148
  /** Which embedder to configure. "trigram" clears the URL (uses built-in).
149
149
  * "custom" writes a user-supplied URL and opts in to non-loopback endpoints
150
150
  * (sets MEGACOMPACT_ALLOW_REMOTE_EMBEDDER=1) for third-party / hosted APIs.
151
- * "onnx" points at a local ONNX text-embeddings-inference server. */
152
- readonly embedder: "ollama" | "llama" | "trigram" | "custom" | "onnx";
151
+ * "onnx" points at a local ONNX text-embeddings-inference server.
152
+ * Optional: absent when the payload carries only ENC-1b/ENC-2a additive
153
+ * keys (pure additive configure, no embedder change). */
154
+ readonly embedder?: "ollama" | "llama" | "trigram" | "custom" | "onnx";
153
155
  /** Override URL (required for "custom"; optional defaults for ollama/llama/onnx). */
154
156
  readonly url?: string;
155
157
  /** ENC-1a: external embedder endpoint URL, persisted to the per-repo
@@ -37,6 +37,7 @@ import {
37
37
  readQualificationRecord,
38
38
  encoderStateDir,
39
39
  } from "./qualification-record.js";
40
+ import { readEnc2aGuide } from "./routes-setup-enc2a.js";
40
41
  import {
41
42
  runSetupCortexAction,
42
43
  readActionLogTail,
@@ -87,6 +88,12 @@ function liveActionBlockers(): ReturnType<typeof computeSetupCortexBlockers> | n
87
88
  platform: detectPlatform(),
88
89
  qualification: record,
89
90
  headCount,
91
+ // ENC-2c: the install action's HG-3 gate closes when the native binding is
92
+ // installed on this device. The action would be a no-op without this — a
93
+ // stale "open" HG-3 permanently blocks the install button even after the
94
+ // binding is on disk, because the compute default is nativeOrtInstalledVersion
95
+ // = null (not installed). Read the ENC-2a guide probe to get the true state.
96
+ nativeOrtInstalledVersion: readEnc2aGuide(encoderStateDir()).installedVersion,
90
97
  });
91
98
  }
92
99
 
@@ -45,8 +45,12 @@ import type { SetupConfigureRequest } from "./api-contracts/setup.js";
45
45
  const ENC_2A_SCRIPT_PATH = "scripts/encoder/install-native-ort.mjs";
46
46
 
47
47
  /** Where the operator script installs the native binding (absolute install
48
- * prefix used verbatim in the guide commands + the version probe). */
48
+ * prefix used verbatim in the guide commands + the version probe). The
49
+ * MEGACOMPACT_NATIVE_ORT_ROOT override exists so tests can point at an empty
50
+ * dir (isolation from a globally-installed binding). */
49
51
  function nativeOrtDir(): string {
52
+ const override = process.env.MEGACOMPACT_NATIVE_ORT_ROOT;
53
+ if (override !== undefined && override.length > 0) return override;
50
54
  return join(process.env.HOME ?? "", ".pi", "mega-compact", "native-ort");
51
55
  }
52
56
 
@@ -111,19 +115,25 @@ export function readEnc2aGuide(stateDir: string): {
111
115
  };
112
116
  }
113
117
 
114
- return { guide, installedVersion: probeInstalledVersion() };
118
+ return { guide, installedVersion: probeInstalledVersion(stateDir) };
115
119
  }
116
120
 
117
121
  /** Probe the local native-ort package.json for the installed onnxruntime-node
118
- * version. Null when the package is absent/unreadable (reader-only, local). */
119
- function probeInstalledVersion(): string | null {
122
+ * version. Probes `<stateDir>/native-ort/` first (test isolation), then the
123
+ * global `~/.pi/mega-compact/native-ort/`. Null when the package is
124
+ * absent/unreadable in both roots (reader-only, local). */
125
+ function probeInstalledVersion(stateDir: string): string | null {
126
+ for (const root of [join(stateDir, "native-ort"), nativeOrtDir()]) {
127
+ const v = probeVersionAt(root);
128
+ if (v !== null) return v;
129
+ }
130
+ return null;
131
+ }
132
+
133
+ /** Version probe for one candidate root. */
134
+ function probeVersionAt(root: string): string | null {
120
135
  try {
121
- const pkgPath = join(
122
- nativeOrtDir(),
123
- "node_modules",
124
- NATIVE_ORT_PACKAGE,
125
- "package.json",
126
- );
136
+ const pkgPath = join(root, "node_modules", NATIVE_ORT_PACKAGE, "package.json");
127
137
  if (!existsSync(pkgPath)) return null;
128
138
  const raw = JSON.parse(readFileSync(pkgPath, "utf8")) as unknown;
129
139
  if (
@@ -72,6 +72,14 @@ export async function withServer<T>(
72
72
  env: {
73
73
  ...process.env,
74
74
  MEGACOMPACT_INDEX_DIR: dir,
75
+ // Forward test-isolation overrides so the spawned server's readers
76
+ // resolve to the test temp dir, not the operator's global install.
77
+ ...(process.env.MEGACOMPACT_STATE_DIR !== undefined
78
+ ? { MEGACOMPACT_STATE_DIR: process.env.MEGACOMPACT_STATE_DIR }
79
+ : {}),
80
+ ...(process.env.MEGACOMPACT_NATIVE_ORT_ROOT !== undefined
81
+ ? { MEGACOMPACT_NATIVE_ORT_ROOT: process.env.MEGACOMPACT_NATIVE_ORT_ROOT }
82
+ : {}),
75
83
  },
76
84
  });
77
85
  try {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pi-mega-compact",
3
- "version": "0.20.73",
3
+ "version": "0.20.74",
4
4
  "description": "Layered, local, vector-backed context compressor for pi — supersede/collapse/cluster compaction with deduped inline recall.",
5
5
  "type": "module",
6
6
  "license": "BSD-3-Clause",
@@ -1,2 +0,0 @@
1
- import{j as r}from"./index-DlHJ7LBL.js";import{M as t}from"./MetricsCards-G4_uynTE.js";import"./card-CUipkgi9.js";import"./generateCategoricalChart-_WpiJebf.js";import"./BarChart-DeTE0NXA.js";import"./AreaChart-7ms8Hk1m.js";function e(){return r.jsx(t,{})}export{e as default};
2
- //# sourceMappingURL=MetricsTab-yypKMQXf.js.map
@@ -1,2 +0,0 @@
1
- import{j as r}from"./index-DlHJ7LBL.js";import{T as o}from"./TurnMemoryView-C7NQo_xi.js";import"./card-CUipkgi9.js";import"./button-DPOwTRN8.js";function e(){return r.jsx(o,{})}export{e as default};
2
- //# sourceMappingURL=TurnsTab-D-19giqQ.js.map