claude-code-session-manager 0.2.3 → 0.2.4

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.
@@ -1,4 +1,4 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./editor.main-B4ZYzZWy.js","./editor-BTnBOi8r.css"])))=>i.map(i=>d[i]);
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./editor.main-oQ1CG2BW.js","./editor-BTnBOi8r.css"])))=>i.map(i=>d[i]);
2
2
  var X_=Object.defineProperty;var J_=(t,s,i)=>s in t?X_(t,s,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[s]=i;var hc=(t,s,i)=>J_(t,typeof s!="symbol"?s+"":s,i);(function(){const s=document.createElement("link").relList;if(s&&s.supports&&s.supports("modulepreload"))return;for(const d of document.querySelectorAll('link[rel="modulepreload"]'))o(d);new MutationObserver(d=>{for(const w of d)if(w.type==="childList")for(const g of w.addedNodes)g.tagName==="LINK"&&g.rel==="modulepreload"&&o(g)}).observe(document,{childList:!0,subtree:!0});function i(d){const w={};return d.integrity&&(w.integrity=d.integrity),d.referrerPolicy&&(w.referrerPolicy=d.referrerPolicy),d.crossOrigin==="use-credentials"?w.credentials="include":d.crossOrigin==="anonymous"?w.credentials="omit":w.credentials="same-origin",w}function o(d){if(d.ep)return;d.ep=!0;const w=i(d);fetch(d.href,w)}})();function zm(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var fc={exports:{}},en={},pc={exports:{}},Te={};/**
3
3
  * @license React
4
4
  * react.production.min.js
@@ -62,7 +62,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
62
62
  monaco.config({ paths: { vs: '...' } })
63
63
 
64
64
  For more please check the link https://github.com/suren-atoyan/monaco-loader#config
65
- `},dp=mx(_x)(Jm),xx={config:vx},wx=function(){for(var s=arguments.length,i=new Array(s),o=0;o<s;o++)i[o]=arguments[o];return function(d){return i.reduceRight(function(w,g){return g(w)},d)}};function Ym(t,s){return Object.keys(s).forEach(function(i){s[i]instanceof Object&&t[i]&&Object.assign(s[i],Ym(t[i],s[i]))}),lp(lp({},t),s)}var Sx={type:"cancelation",msg:"operation is manually canceled"};function Cc(t){var s=!1,i=new Promise(function(o,d){t.then(function(w){return s?d(Sx):o(w)}),t.catch(d)});return i.cancel=function(){return s=!0},i}var bx=["monaco"],Cx=fx.create({config:px,isInitialized:!1,resolve:null,reject:null,monaco:null}),Qm=X0(Cx,2),_n=Qm[0],ma=Qm[1];function kx(t){var s=xx.config(t),i=s.monaco,o=q0(s,bx);ma(function(d){return{config:Ym(d.config,o),monaco:i}})}function Ex(){var t=_n(function(s){var i=s.monaco,o=s.isInitialized,d=s.resolve;return{monaco:i,isInitialized:o,resolve:d}});if(!t.isInitialized){if(ma({isInitialized:!0}),t.monaco)return t.resolve(t.monaco),Cc(kc);if(window.monaco&&window.monaco.editor)return Zm(window.monaco),t.resolve(window.monaco),Cc(kc);wx(Tx,Px)(Lx)}return Cc(kc)}function Tx(t){return document.body.appendChild(t)}function Rx(t){var s=document.createElement("script");return t&&(s.src=t),s}function Px(t){var s=_n(function(o){var d=o.config,w=o.reject;return{config:d,reject:w}}),i=Rx("".concat(s.config.paths.vs,"/loader.js"));return i.onload=function(){return t()},i.onerror=s.reject,i}function Lx(){var t=_n(function(i){var o=i.config,d=i.resolve,w=i.reject;return{config:o,resolve:d,reject:w}}),s=window.require;s.config(t.config),s(["vs/editor/editor.main"],function(i){var o=i.m||i;Zm(o),t.resolve(o)},function(i){t.reject(i)})}function Zm(t){_n().monaco||ma({monaco:t})}function Dx(){return _n(function(t){var s=t.monaco;return s})}var kc=new Promise(function(t,s){return ma({resolve:t,reject:s})}),eg={config:kx,init:Ex,__getMonacoInstance:Dx},Ax={wrapper:{display:"flex",position:"relative",textAlign:"initial"},fullWidth:{width:"100%"},hide:{display:"none"}},Ec=Ax,jx={container:{display:"flex",height:"100%",width:"100%",justifyContent:"center",alignItems:"center"}},Mx=jx;function Ox({children:t}){return fr.createElement("div",{style:Mx.container},t)}var Ix=Ox,Nx=Ix;function Bx({width:t,height:s,isEditorReady:i,loading:o,_ref:d,className:w,wrapperProps:g}){return fr.createElement("section",{style:{...Ec.wrapper,width:t,height:s},...g},!i&&fr.createElement(Nx,null,o),fr.createElement("div",{ref:d,style:{...Ec.fullWidth,...!i&&Ec.hide},className:w}))}var Fx=Bx,tg=W.memo(Fx);function Hx(t){W.useEffect(t,[])}var rg=Hx;function Ux(t,s,i=!0){let o=W.useRef(!0);W.useEffect(o.current||!i?()=>{o.current=!1}:t,s)}var Mt=Ux;function ln(){}function ni(t,s,i,o){return Wx(t,o)||Vx(t,s,i,o)}function Wx(t,s){return t.editor.getModel(sg(t,s))}function Vx(t,s,i,o){return t.editor.createModel(s,i,o?sg(t,o):void 0)}function sg(t,s){return t.Uri.parse(s)}function $x({original:t,modified:s,language:i,originalLanguage:o,modifiedLanguage:d,originalModelPath:w,modifiedModelPath:g,keepCurrentOriginalModel:a=!1,keepCurrentModifiedModel:l=!1,theme:p="light",loading:m="Loading...",options:u={},height:x="100%",width:b="100%",className:E,wrapperProps:S={},beforeMount:c=ln,onMount:y=ln}){let[h,v]=W.useState(!1),[C,R]=W.useState(!0),L=W.useRef(null),D=W.useRef(null),T=W.useRef(null),A=W.useRef(y),I=W.useRef(c),H=W.useRef(!1);rg(()=>{let K=eg.init();return K.then(z=>(D.current=z)&&R(!1)).catch(z=>(z==null?void 0:z.type)!=="cancelation"&&console.error("Monaco initialization: error:",z)),()=>L.current?J():K.cancel()}),Mt(()=>{if(L.current&&D.current){let K=L.current.getOriginalEditor(),z=ni(D.current,t||"",o||i||"text",w||"");z!==K.getModel()&&K.setModel(z)}},[w],h),Mt(()=>{if(L.current&&D.current){let K=L.current.getModifiedEditor(),z=ni(D.current,s||"",d||i||"text",g||"");z!==K.getModel()&&K.setModel(z)}},[g],h),Mt(()=>{let K=L.current.getModifiedEditor();K.getOption(D.current.editor.EditorOption.readOnly)?K.setValue(s||""):s!==K.getValue()&&(K.executeEdits("",[{range:K.getModel().getFullModelRange(),text:s||"",forceMoveMarkers:!0}]),K.pushUndoStop())},[s],h),Mt(()=>{var K,z;(z=(K=L.current)==null?void 0:K.getModel())==null||z.original.setValue(t||"")},[t],h),Mt(()=>{let{original:K,modified:z}=L.current.getModel();D.current.editor.setModelLanguage(K,o||i||"text"),D.current.editor.setModelLanguage(z,d||i||"text")},[i,o,d],h),Mt(()=>{var K;(K=D.current)==null||K.editor.setTheme(p)},[p],h),Mt(()=>{var K;(K=L.current)==null||K.updateOptions(u)},[u],h);let $=W.useCallback(()=>{var re;if(!D.current)return;I.current(D.current);let K=ni(D.current,t||"",o||i||"text",w||""),z=ni(D.current,s||"",d||i||"text",g||"");(re=L.current)==null||re.setModel({original:K,modified:z})},[i,s,d,t,o,w,g]),N=W.useCallback(()=>{var K;!H.current&&T.current&&(L.current=D.current.editor.createDiffEditor(T.current,{automaticLayout:!0,...u}),$(),(K=D.current)==null||K.editor.setTheme(p),v(!0),H.current=!0)},[u,p,$]);W.useEffect(()=>{h&&A.current(L.current,D.current)},[h]),W.useEffect(()=>{!C&&!h&&N()},[C,h,N]);function J(){var z,re,G,j;let K=(z=L.current)==null?void 0:z.getModel();a||((re=K==null?void 0:K.original)==null||re.dispose()),l||((G=K==null?void 0:K.modified)==null||G.dispose()),(j=L.current)==null||j.dispose()}return fr.createElement(tg,{width:b,height:x,isEditorReady:h,loading:m,_ref:T,className:E,wrapperProps:S})}var zx=$x;W.memo(zx);function Kx(t){let s=W.useRef();return W.useEffect(()=>{s.current=t},[t]),s.current}var qx=Kx,No=new Map;function Gx({defaultValue:t,defaultLanguage:s,defaultPath:i,value:o,language:d,path:w,theme:g="light",line:a,loading:l="Loading...",options:p={},overrideServices:m={},saveViewState:u=!0,keepCurrentModel:x=!1,width:b="100%",height:E="100%",className:S,wrapperProps:c={},beforeMount:y=ln,onMount:h=ln,onChange:v,onValidate:C=ln}){let[R,L]=W.useState(!1),[D,T]=W.useState(!0),A=W.useRef(null),I=W.useRef(null),H=W.useRef(null),$=W.useRef(h),N=W.useRef(y),J=W.useRef(),K=W.useRef(o),z=qx(w),re=W.useRef(!1),G=W.useRef(!1);rg(()=>{let M=eg.init();return M.then(U=>(A.current=U)&&T(!1)).catch(U=>(U==null?void 0:U.type)!=="cancelation"&&console.error("Monaco initialization: error:",U)),()=>I.current?F():M.cancel()}),Mt(()=>{var U,ee,ne,ce;let M=ni(A.current,t||o||"",s||d||"",w||i||"");M!==((U=I.current)==null?void 0:U.getModel())&&(u&&No.set(z,(ee=I.current)==null?void 0:ee.saveViewState()),(ne=I.current)==null||ne.setModel(M),u&&((ce=I.current)==null||ce.restoreViewState(No.get(w))))},[w],R),Mt(()=>{var M;(M=I.current)==null||M.updateOptions(p)},[p],R),Mt(()=>{!I.current||o===void 0||(I.current.getOption(A.current.editor.EditorOption.readOnly)?I.current.setValue(o):o!==I.current.getValue()&&(G.current=!0,I.current.executeEdits("",[{range:I.current.getModel().getFullModelRange(),text:o,forceMoveMarkers:!0}]),I.current.pushUndoStop(),G.current=!1))},[o],R),Mt(()=>{var U,ee;let M=(U=I.current)==null?void 0:U.getModel();M&&d&&((ee=A.current)==null||ee.editor.setModelLanguage(M,d))},[d],R),Mt(()=>{var M;a!==void 0&&((M=I.current)==null||M.revealLine(a))},[a],R),Mt(()=>{var M;(M=A.current)==null||M.editor.setTheme(g)},[g],R);let j=W.useCallback(()=>{var M;if(!(!H.current||!A.current)&&!re.current){N.current(A.current);let U=w||i,ee=ni(A.current,o||t||"",s||d||"",U||"");I.current=(M=A.current)==null?void 0:M.editor.create(H.current,{model:ee,automaticLayout:!0,...p},m),u&&I.current.restoreViewState(No.get(U)),A.current.editor.setTheme(g),a!==void 0&&I.current.revealLine(a),L(!0),re.current=!0}},[t,s,i,o,d,w,p,m,u,g,a]);W.useEffect(()=>{R&&$.current(I.current,A.current)},[R]),W.useEffect(()=>{!D&&!R&&j()},[D,R,j]),K.current=o,W.useEffect(()=>{var M,U;R&&v&&((M=J.current)==null||M.dispose(),J.current=(U=I.current)==null?void 0:U.onDidChangeModelContent(ee=>{G.current||v(I.current.getValue(),ee)}))},[R,v]),W.useEffect(()=>{if(R){let M=A.current.editor.onDidChangeMarkers(U=>{var ne;let ee=(ne=I.current.getModel())==null?void 0:ne.uri;if(ee&&U.find(ce=>ce.path===ee.path)){let ce=A.current.editor.getModelMarkers({resource:ee});C==null||C(ce)}});return()=>{M==null||M.dispose()}}return()=>{}},[R,C]);function F(){var M,U;(M=J.current)==null||M.dispose(),x?u&&No.set(w,I.current.saveViewState()):(U=I.current.getModel())==null||U.dispose(),I.current.dispose()}return fr.createElement(tg,{width:b,height:E,isEditorReady:R,loading:l,_ref:H,className:S,wrapperProps:c})}var Xx=Gx,Jx=W.memo(Xx),ig=Jx;function ng({value:t,onChange:s,path:i,readOnly:o}){const d=W.useRef(null),w=g=>{d.current=g};return _.jsx(ig,{path:`file://${i}`,defaultLanguage:"json",value:t,onChange:g=>s(g??""),onMount:w,theme:"vs-dark",options:{minimap:{enabled:!1},fontSize:12,fontFamily:"JetBrains Mono, ui-monospace, Menlo, monospace",lineNumbers:"on",renderLineHighlight:"line",scrollBeyondLastLine:!1,tabSize:2,formatOnPaste:!0,readOnly:o,automaticLayout:!0,bracketPairColorization:{enabled:!0},wordWrap:"on"}})}let hp=!1;async function Yx(t){if(hp)return;const s=await W0(()=>import("./editor.main-B4ZYzZWy.js").then(d=>d.b),__vite__mapDeps([0,1]),import.meta.url),i=await Promise.all(t.map(async d=>{let w=d.schema;if(!w){const g=["https://json.schemastore.org","https://www.schemastore.org","https://code.claude.com"];try{const a=new URL(d.uri).origin;if(!g.includes(a))throw new Error("untrusted origin");const l=await fetch(d.uri);l.ok&&(w=await l.json())}catch{}}return{uri:d.uri,fileMatch:d.fileMatch,schema:w}}));s.languages.json.jsonDefaults.setDiagnosticsOptions({validate:!0,allowComments:!1,schemas:i.filter(d=>d.schema),enableSchemaRequest:!0}),hp=!0}function _u({node:t,targetScope:s,onOverride:i,schema:o,rootLabel:d}){const[w,g]=W.useState(""),[a,l]=W.useState(!0),p=[],m=t.kind==="object"&&Object.keys(t.children).length===0,x=((o==null?void 0:o.rootKeys())??[]).length>0;return _.jsxs("div",{className:"h-full flex flex-col",children:[_.jsxs("div",{className:"shrink-0 border-b border-line bg-bg-elev px-3 py-1.5 flex items-center gap-2 text-xs",children:[_.jsxs("span",{className:"text-fg-faint",children:["merged · overrides → ",_.jsx("span",{className:"text-fg-dim",children:vt[s].label})]}),x&&_.jsxs("label",{className:"flex items-center gap-1 text-fg-faint cursor-pointer",children:[_.jsx("input",{type:"checkbox",checked:a,onChange:b=>l(b.target.checked),className:"accent-accent"}),"show unset keys"]}),_.jsx("div",{className:"flex-1"}),_.jsx("input",{value:w,onChange:b=>g(b.target.value),placeholder:"filter keys or descriptions…",className:"bg-bg border border-line rounded px-2 py-0.5 text-xs text-fg w-56"})]}),_.jsx("div",{className:"flex-1 overflow-auto px-3 py-2 font-mono text-xs",children:m&&!a?_.jsx("div",{className:"text-fg-faint italic px-2 py-4",children:"no settings resolved — all scope files empty or missing"}):_.jsx(og,{node:t,path:p,label:d??"(root)",targetScope:s,onOverride:i,filter:w,depth:0,schema:o,showGhosts:a,defaultOpen:!0})})]})}function og(t){return t.node.kind==="object"?_.jsx(Qx,{...t,node:t.node}):t.node.kind==="array"?_.jsx(Zx,{...t,node:t.node}):_.jsx(ew,{...t,node:t.node})}function fp(t,s){return s.trim()?t.toLowerCase().includes(s.toLowerCase()):!0}function di(t,s,i){return!!(!i.trim()||t.some(o=>fp(o,i))||s!=null&&s.description&&fp(s.description,i))}function Qx({node:t,path:s,label:i,targetScope:o,onOverride:d,filter:w,depth:g,schema:a,showGhosts:l,defaultOpen:p}){const[m,u]=W.useState(p??g<2),x=(a==null?void 0:a.at(s))??null,b=new Set(Object.keys(t.children)),E=l?(x==null?void 0:x.knownChildren)??[]:[],S=Array.from(new Set([...b,...E])).sort(),c=W.useMemo(()=>w.trim()?S.filter(h=>{const v=(a==null?void 0:a.at([...s,h]))??null;return di([...s,h],v,w)?!0:b.has(h)?ag(t.children[h],[...s,h],w,a):!1}):S,[S.join(","),w,t,s.join("."),a]);if(w.trim()&&c.length===0&&!di(s,x,w))return null;if(s.length===0)return _.jsx("div",{children:c.map(h=>y(h))});return _.jsxs("div",{children:[_.jsxs("div",{className:"flex items-center gap-1 py-0.5 hover:bg-bg-elev/50 rounded cursor-pointer",style:{paddingLeft:g*14},onClick:()=>u(!m),children:[_.jsx("span",{className:"text-fg-faint w-3 shrink-0",children:m?"▾":"▸"}),_.jsx("span",{className:"text-fg",children:i}),_.jsxs("span",{className:"text-fg-faint",children:[" {",b.size,E.length>b.size?`/${new Set([...b,...E]).size}`:"","}"]}),(x==null?void 0:x.description)&&_.jsxs("span",{className:"text-fg-faint truncate max-w-md",title:x.description,children:["— ",x.description]})]}),m&&c.map(h=>y(h))]});function y(h){if(b.has(h))return _.jsx(og,{node:t.children[h],path:[...s,h],label:h,targetScope:o,onOverride:d,filter:w,depth:g+1,schema:a,showGhosts:l},h);const v=(a==null?void 0:a.at([...s,h]))??null;return v?_.jsx(tw,{path:[...s,h],label:h,info:v,targetScope:o,onSet:d,depth:g+1,filter:w},h):null}}function ag(t,s,i,o){const d=(o==null?void 0:o.at(s))??null;if(di(s,d,i))return!0;if(t.kind!=="object")return!1;for(const w of Object.keys(t.children))if(ag(t.children[w],[...s,w],i,o))return!0;return!1}function Zx({node:t,path:s,label:i,filter:o,depth:d,schema:w}){const[g,a]=W.useState(!0),l=(w==null?void 0:w.at(s))??null;return di(s,l,o)?_.jsxs("div",{children:[_.jsxs("div",{className:"flex items-center gap-1 py-0.5 hover:bg-bg-elev/50 rounded cursor-pointer",style:{paddingLeft:d*14},onClick:()=>a(!g),children:[_.jsx("span",{className:"text-fg-faint w-3 shrink-0",children:g?"▾":"▸"}),_.jsx("span",{className:"text-fg",children:i}),_.jsxs("span",{className:"text-fg-faint",children:[" [",t.items.length,"]"]}),_.jsx(pn,{tone:"warn",children:"accumulated"}),(l==null?void 0:l.description)&&_.jsxs("span",{className:"text-fg-faint truncate max-w-md",title:l.description,children:["— ",l.description]})]}),g&&t.items.map((p,m)=>_.jsxs("div",{className:"flex items-start gap-2 py-0.5",style:{paddingLeft:(d+1)*14},children:[_.jsx("span",{className:"text-fg-faint w-3 shrink-0"}),_.jsxs("span",{className:"text-fg-faint",children:[m,":"]}),_.jsx("span",{className:"text-fg-dim truncate max-w-xl",children:sa(p.value)}),_.jsx(qc,{scope:p.fromScope})]},m))]}):null}function ew({node:t,path:s,label:i,targetScope:o,onOverride:d,filter:w,depth:g,schema:a}){const[l,p]=W.useState(!1),m=(a==null?void 0:a.at(s))??null;if(!di(s,m,w))return null;const u=t.winner!==o,x=t.shadowed.length>0;return _.jsxs("div",{children:[_.jsxs("div",{className:"group flex items-center gap-2 py-0.5 hover:bg-bg-elev/50 rounded",style:{paddingLeft:g*14},children:[_.jsx("span",{className:`w-3 shrink-0 ${x?"text-fg-faint cursor-pointer":""}`,onClick:()=>x&&p(!l),children:x?l?"▾":"▸":""}),_.jsxs("span",{className:"text-fg",children:[i,":"]}),_.jsx("span",{className:"text-fg-dim truncate max-w-md",children:sa(t.value)}),_.jsx(qc,{scope:t.winner}),(m==null?void 0:m.deprecated)&&_.jsx(pn,{tone:"warn",children:"deprecated"}),(m==null?void 0:m.default)!==void 0&&rw(t.value,m.default)&&_.jsx(pn,{tone:"dim",children:"= default"}),t.typeMismatch&&_.jsx("span",{className:"text-yellow-500/80",title:"shadowed scopes have a different value type",children:"⚠"}),(m==null?void 0:m.description)&&_.jsxs("span",{className:"text-fg-faint truncate max-w-md",title:m.description,children:["— ",m.description]}),_.jsx("div",{className:"flex-1"}),(m==null?void 0:m.enum)&&_.jsx(lg,{values:m.enum}),_.jsx("button",{disabled:!u,onClick:()=>d(s,t.value),className:`opacity-0 group-hover:opacity-100 px-1.5 py-0 text-[10px] border rounded transition-opacity ${u?"border-accent/50 text-accent hover:bg-accent hover:text-bg":"border-line text-fg-faint cursor-not-allowed"}`,title:u?`copy into ${vt[o].label} draft`:`already winning in ${vt[o].label}`,children:"override"})]}),l&&t.shadowed.map((b,E)=>_.jsxs("div",{className:"flex items-center gap-2 py-0.5 text-fg-faint line-through",style:{paddingLeft:(g+1)*14+12},children:[_.jsx("span",{children:"shadowed:"}),_.jsx("span",{className:"truncate max-w-xl",children:sa(b.value)}),_.jsx(qc,{scope:b.scope,dim:!0})]},E))]})}function tw({path:t,label:s,info:i,targetScope:o,onSet:d,depth:w,filter:g}){if(!di(t,i,g))return null;const a=i.default!==void 0?i.default:sw(i.type),l=Array.isArray(i.type)?i.type.join("|"):i.type??"?";return _.jsxs("div",{className:"group flex items-center gap-2 py-0.5 hover:bg-bg-elev/50 rounded opacity-60",style:{paddingLeft:w*14},children:[_.jsx("span",{className:"w-3 shrink-0"}),_.jsx("span",{className:"text-fg-dim",children:s}),_.jsx(pn,{tone:"dim",children:l}),i.required&&_.jsx(pn,{tone:"warn",children:"required"}),i.default!==void 0&&_.jsxs("span",{className:"text-fg-faint",children:["default: ",sa(i.default)]}),i.description&&_.jsxs("span",{className:"text-fg-faint truncate max-w-md",title:i.description,children:["— ",i.description]}),_.jsx("div",{className:"flex-1"}),i.enum&&_.jsx(lg,{values:i.enum}),_.jsx("button",{onClick:()=>d(t,a),className:"opacity-0 group-hover:opacity-100 px-1.5 py-0 text-[10px] border border-accent/50 rounded text-accent hover:bg-accent hover:text-bg transition-opacity",title:`write to ${vt[o].label} draft`,children:"set"})]})}function rw(t,s){return t===s?!0:typeof t!=typeof s?!1:t&&s&&typeof t=="object"?JSON.stringify(t)===JSON.stringify(s):!1}function sw(t){switch(Array.isArray(t)?t[0]:t){case"boolean":return!1;case"integer":case"number":return 0;case"string":return"";case"array":return[];case"object":return{};case"null":return null;default:return null}}function sa(t){if(typeof t=="string")return JSON.stringify(t);if(t===null)return"null";if(typeof t=="object"){const s=JSON.stringify(t);return s.length>100?s.slice(0,100)+"…":s}return String(t)}function qc({scope:t,dim:s}){const i=t==="user"?"bg-bg-hi text-fg-dim border-line":t==="project"?"bg-blue-950/30 text-blue-400/80 border-blue-900/40":"bg-purple-950/30 text-purple-400/80 border-purple-900/40";return _.jsx("span",{className:`text-[10px] px-1 py-0 rounded border uppercase tracking-wide shrink-0 ${i} ${s?"opacity-60":""}`,children:vt[t].label})}function pn({children:t,tone:s="default"}){const i={default:"bg-bg-hi text-fg-dim border-line",warn:"bg-yellow-950/30 text-yellow-500/80 border-yellow-900/40",dim:"bg-bg-elev text-fg-faint border-line"}[s];return _.jsx("span",{className:`text-[10px] px-1 py-0 rounded border uppercase tracking-wide shrink-0 ${i}`,children:t})}function lg({values:t}){const s=t.map(i=>String(i)).join(" | ");return _.jsxs("span",{className:"text-[10px] text-fg-faint truncate max-w-xs",title:`allowed: ${s}`,children:["∈ ",s.length>30?s.slice(0,30)+"…":s]})}const iw=[{id:"essentials",title:"Essentials",summary:"The knobs you reach for first.",keys:["model","language","outputStyle","permissions"]},{id:"git",title:"Git & Commits",summary:"How Claude writes commits and pull requests on your behalf.",keys:["attribution","includeGitInstructions","includeCoAuthoredBy"]},{id:"memory",title:"Memory & Plans",summary:"Context Claude keeps between sessions and where it files plans.",keys:["autoMemoryEnabled","plansDirectory","claudeMdExcludes","respectGitignore"]},{id:"model",title:"Model & Reasoning",summary:"Which model runs, how hard it thinks, and fast-mode toggles.",keys:["availableModels","modelOverrides","effortLevel","fastMode","fastModePerSessionOptIn","alwaysThinkingEnabled"]},{id:"interface",title:"Interface",summary:"Visual polish — spinners, progress bars, motion.",keys:["spinnerTipsEnabled","spinnerTipsOverride","spinnerVerbs","terminalProgressBarEnabled","showTurnDuration","prefersReducedMotion","companyAnnouncements","statusLine","teammateMode"]},{id:"updates",title:"Updates & Cleanup",summary:"Release channel and how long transcripts stick around.",keys:["autoUpdatesChannel","cleanupPeriodDays"]},{id:"env",title:"Environment & Auth",summary:"Environment variables and auth-helper scripts.",keys:["env","apiKeyHelper","awsCredentialExport","awsAuthRefresh"]},{id:"hooks",title:"Hooks",summary:"Scripts Claude runs before/after tool use.",keys:["hooks","disableAllHooks","allowedHttpHookUrls","httpHookAllowedEnvVars"]},{id:"mcp",title:"MCP Servers",summary:"External tool providers Claude can talk to.",keys:["enableAllProjectMcpServers","enabledMcpjsonServers","disabledMcpjsonServers"]},{id:"plugins",title:"Plugins",summary:"Installed plugins, marketplaces, and per-plugin configuration.",keys:["enabledPlugins","extraKnownMarketplaces","skippedPlugins","skippedMarketplaces","pluginConfigs"]},{id:"filesystem",title:"File Picker & Sandbox",summary:"How Claude browses files and the sandbox it runs in.",keys:["fileSuggestion","sandbox","worktree"]},{id:"login",title:"Login",summary:"Which login method to force on startup.",keys:["forceLoginMethod","forceLoginOrgUUID"]},{id:"feedback",title:"Feedback",summary:"Session-quality surveys.",keys:["feedbackSurveyRate"]},{id:"advanced",title:"Advanced / Enterprise",summary:"Managed-settings-only keys and enterprise allow/denylists.",advanced:!0,keys:["allowedMcpServers","deniedMcpServers","allowManagedHooksOnly","allowManagedPermissionRulesOnly","allowManagedMcpServersOnly","strictKnownMarketplaces","blockedMarketplaces","pluginTrustMessage","otelHeadersHelper","skipWebFetchPreflight"]}],nw={mcp:"MCP",url:"URL",urls:"URLs",http:"HTTP",ui:"UI",id:"ID",uuid:"UUID",api:"API",aws:"AWS",otel:"OTel",json:"JSON"};function cg(t){return t.replace(/^\$/,"").replace(/([a-z])([A-Z])/g,"$1 $2").replace(/([A-Z]+)([A-Z][a-z])/g,"$1 $2").toLowerCase().split(/\s+/).filter(Boolean).map((o,d)=>{const w=nw[o];return w||(d===0?o.charAt(0).toUpperCase()+o.slice(1):o)}).join(" ")}function ow(t){const s=new Set,i=[];for(const d of iw){const w=d.keys.filter(g=>t.has(g));w.forEach(g=>s.add(g)),w.length!==0&&i.push({id:d.id,title:d.title,summary:d.summary,advanced:!!d.advanced,keys:w})}const o=Array.from(t).filter(d=>!s.has(d)&&d!=="$schema").sort();return o.length>0&&i.push({id:"other",title:"Other",summary:"Keys not yet grouped.",advanced:!1,keys:o}),i}function aw({node:t,targetScope:s,onOverride:i,schema:o}){const[d,w]=W.useState(""),[g,a]=W.useState(!1),[l,p]=W.useState(!0),m=t.kind==="object"?t:null,u=m?Object.keys(m.children):[],x=o.rootKeys(),b=new Set([...u,...x]),E=W.useMemo(()=>ow(b),[Array.from(b).sort().join(",")]),S=W.useMemo(()=>E.filter(c=>g||!c.advanced).map(c=>({...c,keys:c.keys.filter(y=>{const h=(m==null?void 0:m.children[y])!==void 0;if(!l&&!h)return!1;if(!d.trim())return!0;const v=o.at([y]);return[y,cg(y),(v==null?void 0:v.description)??""].join(" ").toLowerCase().includes(d.toLowerCase())})})).filter(c=>c.keys.length>0),[E,d,g,l,m,o]);return _.jsxs("div",{className:"h-full flex flex-col",children:[_.jsxs("div",{className:"shrink-0 border-b border-line bg-bg-elev px-3 py-1.5 flex items-center gap-3 text-xs",children:[_.jsxs("span",{className:"text-fg-faint",children:["writing overrides to"," ",_.jsx("span",{className:"text-fg-dim font-medium",children:vt[s].label})]}),_.jsxs("label",{className:"flex items-center gap-1 text-fg-faint cursor-pointer",children:[_.jsx("input",{type:"checkbox",checked:l,onChange:c=>p(c.target.checked),className:"accent-accent"}),"show not-yet-configured"]}),_.jsxs("label",{className:"flex items-center gap-1 text-fg-faint cursor-pointer",children:[_.jsx("input",{type:"checkbox",checked:g,onChange:c=>a(c.target.checked),className:"accent-accent"}),"show advanced"]}),_.jsx("div",{className:"flex-1"}),_.jsx("input",{value:d,onChange:c=>w(c.target.value),placeholder:"search settings…",className:"bg-bg border border-line rounded px-2 py-1 text-xs text-fg w-64"})]}),_.jsxs("div",{className:"flex-1 overflow-auto",children:[S.map(c=>_.jsx(lw,{title:c.title,summary:c.summary,advanced:c.advanced,children:c.keys.map(y=>{const h=m==null?void 0:m.children[y],v=o.at([y]);return _.jsx(cw,{keyName:y,node:h,info:v,targetScope:s,onOverride:C=>i([y],C)},y)})},c.id)),S.length===0&&_.jsxs("div",{className:"px-6 py-12 text-center text-fg-faint text-sm",children:['no settings match "',d,'"']})]})]})}function lw({title:t,summary:s,advanced:i,children:o}){const[d,w]=W.useState(!0);return _.jsxs("section",{className:"border-b border-line",children:[_.jsxs("header",{className:"px-4 py-2.5 bg-bg-elev/40 cursor-pointer hover:bg-bg-elev flex items-center gap-3",onClick:()=>w(!d),children:[_.jsx("span",{className:"text-fg-faint w-3",children:d?"▾":"▸"}),_.jsxs("div",{className:"flex-1",children:[_.jsxs("div",{className:"flex items-center gap-2",children:[_.jsx("h2",{className:"text-fg text-sm font-medium",children:t}),i&&_.jsx("span",{className:"text-[9px] px-1.5 py-0 rounded border border-yellow-900/40 bg-yellow-950/30 text-yellow-500/80 uppercase tracking-wide",children:"advanced"})]}),_.jsx("p",{className:"text-fg-faint text-xs",children:s})]})]}),d&&_.jsx("div",{className:"divide-y divide-line/60",children:o})]})}function cw({keyName:t,node:s,info:i,targetScope:o,onOverride:d}){const[w,g]=W.useState(!1),a=cg(t),l=s!==void 0,m=(s==null?void 0:s.kind)==="leaf"?s:null,u=(s==null?void 0:s.kind)==="object"||(s==null?void 0:s.kind)==="array",x=i==null?void 0:i.default,b=m&&x!==void 0&&dg(m.value,x),E=mw({isSet:l,leafNode:m,defaultVal:x,isDefault:!!b,node:s});return _.jsx("div",{className:"px-4 py-3 hover:bg-bg-elev/20",children:_.jsxs("div",{className:"flex items-start gap-3",children:[_.jsx("button",{onClick:()=>g(!w),className:"text-fg-faint hover:text-fg w-3 mt-0.5",title:w?"collapse":"expand",children:w?"▾":"▸"}),_.jsxs("div",{className:"flex-1 min-w-0",children:[_.jsxs("div",{className:"flex items-baseline gap-2 flex-wrap",children:[_.jsx("h3",{className:"text-fg text-sm",children:a}),_.jsx(gw,{kind:E.kind,label:E.label}),(i==null?void 0:i.deprecated)&&_.jsx("span",{className:"text-[9px] px-1 py-0 rounded border border-yellow-900/40 bg-yellow-950/30 text-yellow-500/80 uppercase tracking-wide",children:"deprecated"}),(i==null?void 0:i.required)&&!l&&_.jsx("span",{className:"text-[9px] px-1 py-0 rounded border border-red-900/40 bg-red-950/30 text-red-400/80 uppercase tracking-wide",children:"required"})]}),(i==null?void 0:i.description)&&_.jsx("p",{className:"text-fg-dim text-xs mt-0.5 leading-relaxed",children:vw(i.description)}),w&&_.jsx(uw,{keyName:t,node:s,info:i,targetScope:o,onOverride:d})]}),_.jsx("div",{className:"shrink-0",children:!w&&_.jsx(pw,{node:s,info:i,onSet:S=>{d(S)},disabled:u&&l})})]})})}function uw({keyName:t,node:s,info:i,targetScope:o,onOverride:d}){const g=(s==null?void 0:s.kind)==="leaf"?s:null;return _.jsxs("div",{className:"mt-3 space-y-2 text-xs",children:[(i==null?void 0:i.description)&&_.jsx("p",{className:"text-fg-dim leading-relaxed whitespace-pre-wrap",children:i.description}),_.jsxs("dl",{className:"grid grid-cols-[auto_1fr] gap-x-3 gap-y-1 text-fg-faint",children:[(i==null?void 0:i.type)&&_.jsxs(_.Fragment,{children:[_.jsx("dt",{children:"Type"}),_.jsx("dd",{className:"text-fg-dim font-mono",children:Array.isArray(i.type)?i.type.join(" | "):i.type})]}),(i==null?void 0:i.default)!==void 0&&_.jsxs(_.Fragment,{children:[_.jsx("dt",{children:"Default"}),_.jsx("dd",{className:"text-fg-dim font-mono",children:zo(i.default)})]}),(i==null?void 0:i.enum)&&_.jsxs(_.Fragment,{children:[_.jsx("dt",{children:"Options"}),_.jsx("dd",{className:"text-fg-dim font-mono",children:i.enum.map(a=>String(a)).join(" | ")})]}),g&&_.jsxs(_.Fragment,{children:[_.jsx("dt",{children:"Current"}),_.jsxs("dd",{className:"font-mono",children:[_.jsx("span",{className:"text-fg-dim",children:zo(g.value)}),_.jsxs("span",{className:"ml-2 text-fg-faint",children:["from ",vt[g.winner].label]})]})]}),g&&g.shadowed.length>0&&_.jsxs(_.Fragment,{children:[_.jsx("dt",{children:"Shadowed"}),_.jsx("dd",{className:"space-y-0.5",children:g.shadowed.map((a,l)=>_.jsxs("div",{className:"font-mono text-fg-faint line-through",children:[zo(a.value)," —"," ",_.jsx("span",{className:"no-underline",children:vt[a.scope].label})]},l))})]}),(s==null?void 0:s.kind)==="array"&&_.jsxs(_.Fragment,{children:[_.jsx("dt",{children:"Accumulated"}),_.jsxs("dd",{className:"text-fg-dim",children:[s.items.length," items across all scopes"]})]})]}),_.jsx("div",{className:"pt-2 flex items-center gap-2 flex-wrap border-t border-line/60",children:_.jsx(dw,{keyName:t,node:s,info:i,onChange:d,targetScope:o})})]})}function dw({node:t,info:s,onChange:i,targetScope:o}){const w=(t==null?void 0:t.kind)==="leaf"?t.value:s==null?void 0:s.default,g=ug(s==null?void 0:s.type);if(g==="boolean"){const a=w===!0;return _.jsxs("div",{className:"flex items-center gap-2",children:[_.jsx("span",{className:"text-fg-faint",children:"Set to:"}),_.jsx("div",{className:"inline-flex rounded border border-line overflow-hidden",children:[{v:!0,label:"on"},{v:!1,label:"off"}].map(({v:l,label:p})=>_.jsx("button",{onClick:()=>i(l),className:`px-3 py-0.5 text-xs transition-colors ${a===l?"bg-accent text-bg":"bg-bg-elev text-fg-dim hover:bg-bg-hi hover:text-fg"}`,children:p},p))}),_.jsxs("span",{className:"text-fg-faint",children:["→ ",vt[o].label]})]})}return s!=null&&s.enum?_.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[_.jsx("span",{className:"text-fg-faint",children:"Choose:"}),s.enum.map(a=>{const l=dg(w,a);return _.jsx("button",{onClick:()=>i(a),className:`px-2 py-0.5 text-xs rounded border ${l?"bg-accent text-bg border-accent":"bg-bg-elev text-fg-dim border-line hover:text-fg hover:bg-bg-hi"}`,children:String(a)},String(a))}),_.jsxs("span",{className:"text-fg-faint",children:["→ ",vt[o].label]})]}):g==="integer"||g==="number"?_.jsx(hw,{value:typeof w=="number"?w:void 0,integer:g==="integer",onCommit:i,target:vt[o].label}):g==="string"?_.jsx(fw,{value:typeof w=="string"?w:"",onCommit:i,target:vt[o].label}):_.jsxs("div",{className:"text-fg-faint",children:["Complex value (",g??"object/array",") — use the"," ",_.jsx("span",{className:"text-fg-dim",children:"Raw"})," tab to edit."]})}function hw({value:t,integer:s,onCommit:i,target:o}){const[d,w]=W.useState(t!==void 0?String(t):""),g=()=>{const a=s?parseInt(d,10):parseFloat(d);Number.isNaN(a)||i(a)};return _.jsxs("div",{className:"flex items-center gap-2",children:[_.jsx("span",{className:"text-fg-faint",children:"Set to:"}),_.jsx("input",{type:"number",value:d,onChange:a=>w(a.target.value),onBlur:g,onKeyDown:a=>{a.key==="Enter"&&a.target.blur()},className:"w-24 bg-bg border border-line rounded px-2 py-0.5 text-xs text-fg"}),_.jsxs("button",{onClick:g,className:"px-2 py-0.5 text-xs border border-accent/50 rounded text-accent hover:bg-accent hover:text-bg",children:["save → ",o]})]})}function fw({value:t,onCommit:s,target:i}){const[o,d]=W.useState(t);return _.jsxs("div",{className:"flex items-center gap-2 flex-1 min-w-0",children:[_.jsx("span",{className:"text-fg-faint shrink-0",children:"Set to:"}),_.jsx("input",{type:"text",value:o,onChange:w=>d(w.target.value),onKeyDown:w=>{w.key==="Enter"&&s(o)},className:"flex-1 min-w-0 bg-bg border border-line rounded px-2 py-0.5 text-xs text-fg"}),_.jsxs("button",{onClick:()=>s(o),className:"shrink-0 px-2 py-0.5 text-xs border border-accent/50 rounded text-accent hover:bg-accent hover:text-bg",children:["save → ",i]})]})}function pw({node:t,info:s,onSet:i,disabled:o}){const d=(t==null?void 0:t.kind)==="leaf",w=ug(s==null?void 0:s.type);if(o)return null;if(w==="boolean"){const g=d&&t.value===!0;return _.jsx("button",{onClick:()=>i(!g),className:`px-2.5 py-0.5 text-xs rounded border transition-colors ${g?"bg-accent/15 text-accent border-accent/40 hover:bg-accent hover:text-bg":"bg-bg-elev text-fg-dim border-line hover:text-fg hover:bg-bg-hi"}`,title:"toggle",children:g?"on":"off"})}return null}function mw({isSet:t,leafNode:s,defaultVal:i,isDefault:o,node:d}){return t?(d==null?void 0:d.kind)==="array"?{kind:"accumulated",label:`${d.items.length} items`}:(d==null?void 0:d.kind)==="object"?{kind:"set",label:"configured"}:s?o?{kind:"default",label:`= default · ${vt[s.winner].label}`}:s.shadowed.length>0?{kind:"override",label:`overriding ${s.shadowed.length} scope(s)`}:{kind:"set",label:`set in ${vt[s.winner].label}`}:{kind:"set",label:"configured"}:i!==void 0?{kind:"default",label:`using default: ${zo(i)}`}:{kind:"unset",label:"not configured"}}function gw({kind:t,label:s}){const i={set:"bg-accent/15 text-accent border-accent/30",default:"bg-bg-hi text-fg-dim border-line",unset:"bg-bg-elev text-fg-faint border-line",override:"bg-purple-950/30 text-purple-400/80 border-purple-900/40",accumulated:"bg-blue-950/30 text-blue-400/80 border-blue-900/40"}[t];return _.jsx("span",{className:`text-[9px] px-1.5 py-0 rounded border uppercase tracking-wide ${i}`,children:s})}function ug(t){if(t)return Array.isArray(t)?t.find(i=>i!=="null")??t[0]:t}function dg(t,s){return t===s?!0:typeof t!=typeof s?!1:t&&s&&typeof t=="object"?JSON.stringify(t)===JSON.stringify(s):!1}function vw(t){const s=t.trim().split(`
65
+ `},dp=mx(_x)(Jm),xx={config:vx},wx=function(){for(var s=arguments.length,i=new Array(s),o=0;o<s;o++)i[o]=arguments[o];return function(d){return i.reduceRight(function(w,g){return g(w)},d)}};function Ym(t,s){return Object.keys(s).forEach(function(i){s[i]instanceof Object&&t[i]&&Object.assign(s[i],Ym(t[i],s[i]))}),lp(lp({},t),s)}var Sx={type:"cancelation",msg:"operation is manually canceled"};function Cc(t){var s=!1,i=new Promise(function(o,d){t.then(function(w){return s?d(Sx):o(w)}),t.catch(d)});return i.cancel=function(){return s=!0},i}var bx=["monaco"],Cx=fx.create({config:px,isInitialized:!1,resolve:null,reject:null,monaco:null}),Qm=X0(Cx,2),_n=Qm[0],ma=Qm[1];function kx(t){var s=xx.config(t),i=s.monaco,o=q0(s,bx);ma(function(d){return{config:Ym(d.config,o),monaco:i}})}function Ex(){var t=_n(function(s){var i=s.monaco,o=s.isInitialized,d=s.resolve;return{monaco:i,isInitialized:o,resolve:d}});if(!t.isInitialized){if(ma({isInitialized:!0}),t.monaco)return t.resolve(t.monaco),Cc(kc);if(window.monaco&&window.monaco.editor)return Zm(window.monaco),t.resolve(window.monaco),Cc(kc);wx(Tx,Px)(Lx)}return Cc(kc)}function Tx(t){return document.body.appendChild(t)}function Rx(t){var s=document.createElement("script");return t&&(s.src=t),s}function Px(t){var s=_n(function(o){var d=o.config,w=o.reject;return{config:d,reject:w}}),i=Rx("".concat(s.config.paths.vs,"/loader.js"));return i.onload=function(){return t()},i.onerror=s.reject,i}function Lx(){var t=_n(function(i){var o=i.config,d=i.resolve,w=i.reject;return{config:o,resolve:d,reject:w}}),s=window.require;s.config(t.config),s(["vs/editor/editor.main"],function(i){var o=i.m||i;Zm(o),t.resolve(o)},function(i){t.reject(i)})}function Zm(t){_n().monaco||ma({monaco:t})}function Dx(){return _n(function(t){var s=t.monaco;return s})}var kc=new Promise(function(t,s){return ma({resolve:t,reject:s})}),eg={config:kx,init:Ex,__getMonacoInstance:Dx},Ax={wrapper:{display:"flex",position:"relative",textAlign:"initial"},fullWidth:{width:"100%"},hide:{display:"none"}},Ec=Ax,jx={container:{display:"flex",height:"100%",width:"100%",justifyContent:"center",alignItems:"center"}},Mx=jx;function Ox({children:t}){return fr.createElement("div",{style:Mx.container},t)}var Ix=Ox,Nx=Ix;function Bx({width:t,height:s,isEditorReady:i,loading:o,_ref:d,className:w,wrapperProps:g}){return fr.createElement("section",{style:{...Ec.wrapper,width:t,height:s},...g},!i&&fr.createElement(Nx,null,o),fr.createElement("div",{ref:d,style:{...Ec.fullWidth,...!i&&Ec.hide},className:w}))}var Fx=Bx,tg=W.memo(Fx);function Hx(t){W.useEffect(t,[])}var rg=Hx;function Ux(t,s,i=!0){let o=W.useRef(!0);W.useEffect(o.current||!i?()=>{o.current=!1}:t,s)}var Mt=Ux;function ln(){}function ni(t,s,i,o){return Wx(t,o)||Vx(t,s,i,o)}function Wx(t,s){return t.editor.getModel(sg(t,s))}function Vx(t,s,i,o){return t.editor.createModel(s,i,o?sg(t,o):void 0)}function sg(t,s){return t.Uri.parse(s)}function $x({original:t,modified:s,language:i,originalLanguage:o,modifiedLanguage:d,originalModelPath:w,modifiedModelPath:g,keepCurrentOriginalModel:a=!1,keepCurrentModifiedModel:l=!1,theme:p="light",loading:m="Loading...",options:u={},height:x="100%",width:b="100%",className:E,wrapperProps:S={},beforeMount:c=ln,onMount:y=ln}){let[h,v]=W.useState(!1),[C,R]=W.useState(!0),L=W.useRef(null),D=W.useRef(null),T=W.useRef(null),A=W.useRef(y),I=W.useRef(c),H=W.useRef(!1);rg(()=>{let K=eg.init();return K.then(z=>(D.current=z)&&R(!1)).catch(z=>(z==null?void 0:z.type)!=="cancelation"&&console.error("Monaco initialization: error:",z)),()=>L.current?J():K.cancel()}),Mt(()=>{if(L.current&&D.current){let K=L.current.getOriginalEditor(),z=ni(D.current,t||"",o||i||"text",w||"");z!==K.getModel()&&K.setModel(z)}},[w],h),Mt(()=>{if(L.current&&D.current){let K=L.current.getModifiedEditor(),z=ni(D.current,s||"",d||i||"text",g||"");z!==K.getModel()&&K.setModel(z)}},[g],h),Mt(()=>{let K=L.current.getModifiedEditor();K.getOption(D.current.editor.EditorOption.readOnly)?K.setValue(s||""):s!==K.getValue()&&(K.executeEdits("",[{range:K.getModel().getFullModelRange(),text:s||"",forceMoveMarkers:!0}]),K.pushUndoStop())},[s],h),Mt(()=>{var K,z;(z=(K=L.current)==null?void 0:K.getModel())==null||z.original.setValue(t||"")},[t],h),Mt(()=>{let{original:K,modified:z}=L.current.getModel();D.current.editor.setModelLanguage(K,o||i||"text"),D.current.editor.setModelLanguage(z,d||i||"text")},[i,o,d],h),Mt(()=>{var K;(K=D.current)==null||K.editor.setTheme(p)},[p],h),Mt(()=>{var K;(K=L.current)==null||K.updateOptions(u)},[u],h);let $=W.useCallback(()=>{var re;if(!D.current)return;I.current(D.current);let K=ni(D.current,t||"",o||i||"text",w||""),z=ni(D.current,s||"",d||i||"text",g||"");(re=L.current)==null||re.setModel({original:K,modified:z})},[i,s,d,t,o,w,g]),N=W.useCallback(()=>{var K;!H.current&&T.current&&(L.current=D.current.editor.createDiffEditor(T.current,{automaticLayout:!0,...u}),$(),(K=D.current)==null||K.editor.setTheme(p),v(!0),H.current=!0)},[u,p,$]);W.useEffect(()=>{h&&A.current(L.current,D.current)},[h]),W.useEffect(()=>{!C&&!h&&N()},[C,h,N]);function J(){var z,re,G,j;let K=(z=L.current)==null?void 0:z.getModel();a||((re=K==null?void 0:K.original)==null||re.dispose()),l||((G=K==null?void 0:K.modified)==null||G.dispose()),(j=L.current)==null||j.dispose()}return fr.createElement(tg,{width:b,height:x,isEditorReady:h,loading:m,_ref:T,className:E,wrapperProps:S})}var zx=$x;W.memo(zx);function Kx(t){let s=W.useRef();return W.useEffect(()=>{s.current=t},[t]),s.current}var qx=Kx,No=new Map;function Gx({defaultValue:t,defaultLanguage:s,defaultPath:i,value:o,language:d,path:w,theme:g="light",line:a,loading:l="Loading...",options:p={},overrideServices:m={},saveViewState:u=!0,keepCurrentModel:x=!1,width:b="100%",height:E="100%",className:S,wrapperProps:c={},beforeMount:y=ln,onMount:h=ln,onChange:v,onValidate:C=ln}){let[R,L]=W.useState(!1),[D,T]=W.useState(!0),A=W.useRef(null),I=W.useRef(null),H=W.useRef(null),$=W.useRef(h),N=W.useRef(y),J=W.useRef(),K=W.useRef(o),z=qx(w),re=W.useRef(!1),G=W.useRef(!1);rg(()=>{let M=eg.init();return M.then(U=>(A.current=U)&&T(!1)).catch(U=>(U==null?void 0:U.type)!=="cancelation"&&console.error("Monaco initialization: error:",U)),()=>I.current?F():M.cancel()}),Mt(()=>{var U,ee,ne,ce;let M=ni(A.current,t||o||"",s||d||"",w||i||"");M!==((U=I.current)==null?void 0:U.getModel())&&(u&&No.set(z,(ee=I.current)==null?void 0:ee.saveViewState()),(ne=I.current)==null||ne.setModel(M),u&&((ce=I.current)==null||ce.restoreViewState(No.get(w))))},[w],R),Mt(()=>{var M;(M=I.current)==null||M.updateOptions(p)},[p],R),Mt(()=>{!I.current||o===void 0||(I.current.getOption(A.current.editor.EditorOption.readOnly)?I.current.setValue(o):o!==I.current.getValue()&&(G.current=!0,I.current.executeEdits("",[{range:I.current.getModel().getFullModelRange(),text:o,forceMoveMarkers:!0}]),I.current.pushUndoStop(),G.current=!1))},[o],R),Mt(()=>{var U,ee;let M=(U=I.current)==null?void 0:U.getModel();M&&d&&((ee=A.current)==null||ee.editor.setModelLanguage(M,d))},[d],R),Mt(()=>{var M;a!==void 0&&((M=I.current)==null||M.revealLine(a))},[a],R),Mt(()=>{var M;(M=A.current)==null||M.editor.setTheme(g)},[g],R);let j=W.useCallback(()=>{var M;if(!(!H.current||!A.current)&&!re.current){N.current(A.current);let U=w||i,ee=ni(A.current,o||t||"",s||d||"",U||"");I.current=(M=A.current)==null?void 0:M.editor.create(H.current,{model:ee,automaticLayout:!0,...p},m),u&&I.current.restoreViewState(No.get(U)),A.current.editor.setTheme(g),a!==void 0&&I.current.revealLine(a),L(!0),re.current=!0}},[t,s,i,o,d,w,p,m,u,g,a]);W.useEffect(()=>{R&&$.current(I.current,A.current)},[R]),W.useEffect(()=>{!D&&!R&&j()},[D,R,j]),K.current=o,W.useEffect(()=>{var M,U;R&&v&&((M=J.current)==null||M.dispose(),J.current=(U=I.current)==null?void 0:U.onDidChangeModelContent(ee=>{G.current||v(I.current.getValue(),ee)}))},[R,v]),W.useEffect(()=>{if(R){let M=A.current.editor.onDidChangeMarkers(U=>{var ne;let ee=(ne=I.current.getModel())==null?void 0:ne.uri;if(ee&&U.find(ce=>ce.path===ee.path)){let ce=A.current.editor.getModelMarkers({resource:ee});C==null||C(ce)}});return()=>{M==null||M.dispose()}}return()=>{}},[R,C]);function F(){var M,U;(M=J.current)==null||M.dispose(),x?u&&No.set(w,I.current.saveViewState()):(U=I.current.getModel())==null||U.dispose(),I.current.dispose()}return fr.createElement(tg,{width:b,height:E,isEditorReady:R,loading:l,_ref:H,className:S,wrapperProps:c})}var Xx=Gx,Jx=W.memo(Xx),ig=Jx;function ng({value:t,onChange:s,path:i,readOnly:o}){const d=W.useRef(null),w=g=>{d.current=g};return _.jsx(ig,{path:`file://${i}`,defaultLanguage:"json",value:t,onChange:g=>s(g??""),onMount:w,theme:"vs-dark",options:{minimap:{enabled:!1},fontSize:12,fontFamily:"JetBrains Mono, ui-monospace, Menlo, monospace",lineNumbers:"on",renderLineHighlight:"line",scrollBeyondLastLine:!1,tabSize:2,formatOnPaste:!0,readOnly:o,automaticLayout:!0,bracketPairColorization:{enabled:!0},wordWrap:"on"}})}let hp=!1;async function Yx(t){if(hp)return;const s=await W0(()=>import("./editor.main-oQ1CG2BW.js").then(d=>d.b),__vite__mapDeps([0,1]),import.meta.url),i=await Promise.all(t.map(async d=>{let w=d.schema;if(!w){const g=["https://json.schemastore.org","https://www.schemastore.org","https://code.claude.com"];try{const a=new URL(d.uri).origin;if(!g.includes(a))throw new Error("untrusted origin");const l=await fetch(d.uri);l.ok&&(w=await l.json())}catch{}}return{uri:d.uri,fileMatch:d.fileMatch,schema:w}}));s.languages.json.jsonDefaults.setDiagnosticsOptions({validate:!0,allowComments:!1,schemas:i.filter(d=>d.schema),enableSchemaRequest:!0}),hp=!0}function _u({node:t,targetScope:s,onOverride:i,schema:o,rootLabel:d}){const[w,g]=W.useState(""),[a,l]=W.useState(!0),p=[],m=t.kind==="object"&&Object.keys(t.children).length===0,x=((o==null?void 0:o.rootKeys())??[]).length>0;return _.jsxs("div",{className:"h-full flex flex-col",children:[_.jsxs("div",{className:"shrink-0 border-b border-line bg-bg-elev px-3 py-1.5 flex items-center gap-2 text-xs",children:[_.jsxs("span",{className:"text-fg-faint",children:["merged · overrides → ",_.jsx("span",{className:"text-fg-dim",children:vt[s].label})]}),x&&_.jsxs("label",{className:"flex items-center gap-1 text-fg-faint cursor-pointer",children:[_.jsx("input",{type:"checkbox",checked:a,onChange:b=>l(b.target.checked),className:"accent-accent"}),"show unset keys"]}),_.jsx("div",{className:"flex-1"}),_.jsx("input",{value:w,onChange:b=>g(b.target.value),placeholder:"filter keys or descriptions…",className:"bg-bg border border-line rounded px-2 py-0.5 text-xs text-fg w-56"})]}),_.jsx("div",{className:"flex-1 overflow-auto px-3 py-2 font-mono text-xs",children:m&&!a?_.jsx("div",{className:"text-fg-faint italic px-2 py-4",children:"no settings resolved — all scope files empty or missing"}):_.jsx(og,{node:t,path:p,label:d??"(root)",targetScope:s,onOverride:i,filter:w,depth:0,schema:o,showGhosts:a,defaultOpen:!0})})]})}function og(t){return t.node.kind==="object"?_.jsx(Qx,{...t,node:t.node}):t.node.kind==="array"?_.jsx(Zx,{...t,node:t.node}):_.jsx(ew,{...t,node:t.node})}function fp(t,s){return s.trim()?t.toLowerCase().includes(s.toLowerCase()):!0}function di(t,s,i){return!!(!i.trim()||t.some(o=>fp(o,i))||s!=null&&s.description&&fp(s.description,i))}function Qx({node:t,path:s,label:i,targetScope:o,onOverride:d,filter:w,depth:g,schema:a,showGhosts:l,defaultOpen:p}){const[m,u]=W.useState(p??g<2),x=(a==null?void 0:a.at(s))??null,b=new Set(Object.keys(t.children)),E=l?(x==null?void 0:x.knownChildren)??[]:[],S=Array.from(new Set([...b,...E])).sort(),c=W.useMemo(()=>w.trim()?S.filter(h=>{const v=(a==null?void 0:a.at([...s,h]))??null;return di([...s,h],v,w)?!0:b.has(h)?ag(t.children[h],[...s,h],w,a):!1}):S,[S.join(","),w,t,s.join("."),a]);if(w.trim()&&c.length===0&&!di(s,x,w))return null;if(s.length===0)return _.jsx("div",{children:c.map(h=>y(h))});return _.jsxs("div",{children:[_.jsxs("div",{className:"flex items-center gap-1 py-0.5 hover:bg-bg-elev/50 rounded cursor-pointer",style:{paddingLeft:g*14},onClick:()=>u(!m),children:[_.jsx("span",{className:"text-fg-faint w-3 shrink-0",children:m?"▾":"▸"}),_.jsx("span",{className:"text-fg",children:i}),_.jsxs("span",{className:"text-fg-faint",children:[" {",b.size,E.length>b.size?`/${new Set([...b,...E]).size}`:"","}"]}),(x==null?void 0:x.description)&&_.jsxs("span",{className:"text-fg-faint truncate max-w-md",title:x.description,children:["— ",x.description]})]}),m&&c.map(h=>y(h))]});function y(h){if(b.has(h))return _.jsx(og,{node:t.children[h],path:[...s,h],label:h,targetScope:o,onOverride:d,filter:w,depth:g+1,schema:a,showGhosts:l},h);const v=(a==null?void 0:a.at([...s,h]))??null;return v?_.jsx(tw,{path:[...s,h],label:h,info:v,targetScope:o,onSet:d,depth:g+1,filter:w},h):null}}function ag(t,s,i,o){const d=(o==null?void 0:o.at(s))??null;if(di(s,d,i))return!0;if(t.kind!=="object")return!1;for(const w of Object.keys(t.children))if(ag(t.children[w],[...s,w],i,o))return!0;return!1}function Zx({node:t,path:s,label:i,filter:o,depth:d,schema:w}){const[g,a]=W.useState(!0),l=(w==null?void 0:w.at(s))??null;return di(s,l,o)?_.jsxs("div",{children:[_.jsxs("div",{className:"flex items-center gap-1 py-0.5 hover:bg-bg-elev/50 rounded cursor-pointer",style:{paddingLeft:d*14},onClick:()=>a(!g),children:[_.jsx("span",{className:"text-fg-faint w-3 shrink-0",children:g?"▾":"▸"}),_.jsx("span",{className:"text-fg",children:i}),_.jsxs("span",{className:"text-fg-faint",children:[" [",t.items.length,"]"]}),_.jsx(pn,{tone:"warn",children:"accumulated"}),(l==null?void 0:l.description)&&_.jsxs("span",{className:"text-fg-faint truncate max-w-md",title:l.description,children:["— ",l.description]})]}),g&&t.items.map((p,m)=>_.jsxs("div",{className:"flex items-start gap-2 py-0.5",style:{paddingLeft:(d+1)*14},children:[_.jsx("span",{className:"text-fg-faint w-3 shrink-0"}),_.jsxs("span",{className:"text-fg-faint",children:[m,":"]}),_.jsx("span",{className:"text-fg-dim truncate max-w-xl",children:sa(p.value)}),_.jsx(qc,{scope:p.fromScope})]},m))]}):null}function ew({node:t,path:s,label:i,targetScope:o,onOverride:d,filter:w,depth:g,schema:a}){const[l,p]=W.useState(!1),m=(a==null?void 0:a.at(s))??null;if(!di(s,m,w))return null;const u=t.winner!==o,x=t.shadowed.length>0;return _.jsxs("div",{children:[_.jsxs("div",{className:"group flex items-center gap-2 py-0.5 hover:bg-bg-elev/50 rounded",style:{paddingLeft:g*14},children:[_.jsx("span",{className:`w-3 shrink-0 ${x?"text-fg-faint cursor-pointer":""}`,onClick:()=>x&&p(!l),children:x?l?"▾":"▸":""}),_.jsxs("span",{className:"text-fg",children:[i,":"]}),_.jsx("span",{className:"text-fg-dim truncate max-w-md",children:sa(t.value)}),_.jsx(qc,{scope:t.winner}),(m==null?void 0:m.deprecated)&&_.jsx(pn,{tone:"warn",children:"deprecated"}),(m==null?void 0:m.default)!==void 0&&rw(t.value,m.default)&&_.jsx(pn,{tone:"dim",children:"= default"}),t.typeMismatch&&_.jsx("span",{className:"text-yellow-500/80",title:"shadowed scopes have a different value type",children:"⚠"}),(m==null?void 0:m.description)&&_.jsxs("span",{className:"text-fg-faint truncate max-w-md",title:m.description,children:["— ",m.description]}),_.jsx("div",{className:"flex-1"}),(m==null?void 0:m.enum)&&_.jsx(lg,{values:m.enum}),_.jsx("button",{disabled:!u,onClick:()=>d(s,t.value),className:`opacity-0 group-hover:opacity-100 px-1.5 py-0 text-[10px] border rounded transition-opacity ${u?"border-accent/50 text-accent hover:bg-accent hover:text-bg":"border-line text-fg-faint cursor-not-allowed"}`,title:u?`copy into ${vt[o].label} draft`:`already winning in ${vt[o].label}`,children:"override"})]}),l&&t.shadowed.map((b,E)=>_.jsxs("div",{className:"flex items-center gap-2 py-0.5 text-fg-faint line-through",style:{paddingLeft:(g+1)*14+12},children:[_.jsx("span",{children:"shadowed:"}),_.jsx("span",{className:"truncate max-w-xl",children:sa(b.value)}),_.jsx(qc,{scope:b.scope,dim:!0})]},E))]})}function tw({path:t,label:s,info:i,targetScope:o,onSet:d,depth:w,filter:g}){if(!di(t,i,g))return null;const a=i.default!==void 0?i.default:sw(i.type),l=Array.isArray(i.type)?i.type.join("|"):i.type??"?";return _.jsxs("div",{className:"group flex items-center gap-2 py-0.5 hover:bg-bg-elev/50 rounded opacity-60",style:{paddingLeft:w*14},children:[_.jsx("span",{className:"w-3 shrink-0"}),_.jsx("span",{className:"text-fg-dim",children:s}),_.jsx(pn,{tone:"dim",children:l}),i.required&&_.jsx(pn,{tone:"warn",children:"required"}),i.default!==void 0&&_.jsxs("span",{className:"text-fg-faint",children:["default: ",sa(i.default)]}),i.description&&_.jsxs("span",{className:"text-fg-faint truncate max-w-md",title:i.description,children:["— ",i.description]}),_.jsx("div",{className:"flex-1"}),i.enum&&_.jsx(lg,{values:i.enum}),_.jsx("button",{onClick:()=>d(t,a),className:"opacity-0 group-hover:opacity-100 px-1.5 py-0 text-[10px] border border-accent/50 rounded text-accent hover:bg-accent hover:text-bg transition-opacity",title:`write to ${vt[o].label} draft`,children:"set"})]})}function rw(t,s){return t===s?!0:typeof t!=typeof s?!1:t&&s&&typeof t=="object"?JSON.stringify(t)===JSON.stringify(s):!1}function sw(t){switch(Array.isArray(t)?t[0]:t){case"boolean":return!1;case"integer":case"number":return 0;case"string":return"";case"array":return[];case"object":return{};case"null":return null;default:return null}}function sa(t){if(typeof t=="string")return JSON.stringify(t);if(t===null)return"null";if(typeof t=="object"){const s=JSON.stringify(t);return s.length>100?s.slice(0,100)+"…":s}return String(t)}function qc({scope:t,dim:s}){const i=t==="user"?"bg-bg-hi text-fg-dim border-line":t==="project"?"bg-blue-950/30 text-blue-400/80 border-blue-900/40":"bg-purple-950/30 text-purple-400/80 border-purple-900/40";return _.jsx("span",{className:`text-[10px] px-1 py-0 rounded border uppercase tracking-wide shrink-0 ${i} ${s?"opacity-60":""}`,children:vt[t].label})}function pn({children:t,tone:s="default"}){const i={default:"bg-bg-hi text-fg-dim border-line",warn:"bg-yellow-950/30 text-yellow-500/80 border-yellow-900/40",dim:"bg-bg-elev text-fg-faint border-line"}[s];return _.jsx("span",{className:`text-[10px] px-1 py-0 rounded border uppercase tracking-wide shrink-0 ${i}`,children:t})}function lg({values:t}){const s=t.map(i=>String(i)).join(" | ");return _.jsxs("span",{className:"text-[10px] text-fg-faint truncate max-w-xs",title:`allowed: ${s}`,children:["∈ ",s.length>30?s.slice(0,30)+"…":s]})}const iw=[{id:"essentials",title:"Essentials",summary:"The knobs you reach for first.",keys:["model","language","outputStyle","permissions"]},{id:"git",title:"Git & Commits",summary:"How Claude writes commits and pull requests on your behalf.",keys:["attribution","includeGitInstructions","includeCoAuthoredBy"]},{id:"memory",title:"Memory & Plans",summary:"Context Claude keeps between sessions and where it files plans.",keys:["autoMemoryEnabled","plansDirectory","claudeMdExcludes","respectGitignore"]},{id:"model",title:"Model & Reasoning",summary:"Which model runs, how hard it thinks, and fast-mode toggles.",keys:["availableModels","modelOverrides","effortLevel","fastMode","fastModePerSessionOptIn","alwaysThinkingEnabled"]},{id:"interface",title:"Interface",summary:"Visual polish — spinners, progress bars, motion.",keys:["spinnerTipsEnabled","spinnerTipsOverride","spinnerVerbs","terminalProgressBarEnabled","showTurnDuration","prefersReducedMotion","companyAnnouncements","statusLine","teammateMode"]},{id:"updates",title:"Updates & Cleanup",summary:"Release channel and how long transcripts stick around.",keys:["autoUpdatesChannel","cleanupPeriodDays"]},{id:"env",title:"Environment & Auth",summary:"Environment variables and auth-helper scripts.",keys:["env","apiKeyHelper","awsCredentialExport","awsAuthRefresh"]},{id:"hooks",title:"Hooks",summary:"Scripts Claude runs before/after tool use.",keys:["hooks","disableAllHooks","allowedHttpHookUrls","httpHookAllowedEnvVars"]},{id:"mcp",title:"MCP Servers",summary:"External tool providers Claude can talk to.",keys:["enableAllProjectMcpServers","enabledMcpjsonServers","disabledMcpjsonServers"]},{id:"plugins",title:"Plugins",summary:"Installed plugins, marketplaces, and per-plugin configuration.",keys:["enabledPlugins","extraKnownMarketplaces","skippedPlugins","skippedMarketplaces","pluginConfigs"]},{id:"filesystem",title:"File Picker & Sandbox",summary:"How Claude browses files and the sandbox it runs in.",keys:["fileSuggestion","sandbox","worktree"]},{id:"login",title:"Login",summary:"Which login method to force on startup.",keys:["forceLoginMethod","forceLoginOrgUUID"]},{id:"feedback",title:"Feedback",summary:"Session-quality surveys.",keys:["feedbackSurveyRate"]},{id:"advanced",title:"Advanced / Enterprise",summary:"Managed-settings-only keys and enterprise allow/denylists.",advanced:!0,keys:["allowedMcpServers","deniedMcpServers","allowManagedHooksOnly","allowManagedPermissionRulesOnly","allowManagedMcpServersOnly","strictKnownMarketplaces","blockedMarketplaces","pluginTrustMessage","otelHeadersHelper","skipWebFetchPreflight"]}],nw={mcp:"MCP",url:"URL",urls:"URLs",http:"HTTP",ui:"UI",id:"ID",uuid:"UUID",api:"API",aws:"AWS",otel:"OTel",json:"JSON"};function cg(t){return t.replace(/^\$/,"").replace(/([a-z])([A-Z])/g,"$1 $2").replace(/([A-Z]+)([A-Z][a-z])/g,"$1 $2").toLowerCase().split(/\s+/).filter(Boolean).map((o,d)=>{const w=nw[o];return w||(d===0?o.charAt(0).toUpperCase()+o.slice(1):o)}).join(" ")}function ow(t){const s=new Set,i=[];for(const d of iw){const w=d.keys.filter(g=>t.has(g));w.forEach(g=>s.add(g)),w.length!==0&&i.push({id:d.id,title:d.title,summary:d.summary,advanced:!!d.advanced,keys:w})}const o=Array.from(t).filter(d=>!s.has(d)&&d!=="$schema").sort();return o.length>0&&i.push({id:"other",title:"Other",summary:"Keys not yet grouped.",advanced:!1,keys:o}),i}function aw({node:t,targetScope:s,onOverride:i,schema:o}){const[d,w]=W.useState(""),[g,a]=W.useState(!1),[l,p]=W.useState(!0),m=t.kind==="object"?t:null,u=m?Object.keys(m.children):[],x=o.rootKeys(),b=new Set([...u,...x]),E=W.useMemo(()=>ow(b),[Array.from(b).sort().join(",")]),S=W.useMemo(()=>E.filter(c=>g||!c.advanced).map(c=>({...c,keys:c.keys.filter(y=>{const h=(m==null?void 0:m.children[y])!==void 0;if(!l&&!h)return!1;if(!d.trim())return!0;const v=o.at([y]);return[y,cg(y),(v==null?void 0:v.description)??""].join(" ").toLowerCase().includes(d.toLowerCase())})})).filter(c=>c.keys.length>0),[E,d,g,l,m,o]);return _.jsxs("div",{className:"h-full flex flex-col",children:[_.jsxs("div",{className:"shrink-0 border-b border-line bg-bg-elev px-3 py-1.5 flex items-center gap-3 text-xs",children:[_.jsxs("span",{className:"text-fg-faint",children:["writing overrides to"," ",_.jsx("span",{className:"text-fg-dim font-medium",children:vt[s].label})]}),_.jsxs("label",{className:"flex items-center gap-1 text-fg-faint cursor-pointer",children:[_.jsx("input",{type:"checkbox",checked:l,onChange:c=>p(c.target.checked),className:"accent-accent"}),"show not-yet-configured"]}),_.jsxs("label",{className:"flex items-center gap-1 text-fg-faint cursor-pointer",children:[_.jsx("input",{type:"checkbox",checked:g,onChange:c=>a(c.target.checked),className:"accent-accent"}),"show advanced"]}),_.jsx("div",{className:"flex-1"}),_.jsx("input",{value:d,onChange:c=>w(c.target.value),placeholder:"search settings…",className:"bg-bg border border-line rounded px-2 py-1 text-xs text-fg w-64"})]}),_.jsxs("div",{className:"flex-1 overflow-auto",children:[S.map(c=>_.jsx(lw,{title:c.title,summary:c.summary,advanced:c.advanced,children:c.keys.map(y=>{const h=m==null?void 0:m.children[y],v=o.at([y]);return _.jsx(cw,{keyName:y,node:h,info:v,targetScope:s,onOverride:C=>i([y],C)},y)})},c.id)),S.length===0&&_.jsxs("div",{className:"px-6 py-12 text-center text-fg-faint text-sm",children:['no settings match "',d,'"']})]})]})}function lw({title:t,summary:s,advanced:i,children:o}){const[d,w]=W.useState(!0);return _.jsxs("section",{className:"border-b border-line",children:[_.jsxs("header",{className:"px-4 py-2.5 bg-bg-elev/40 cursor-pointer hover:bg-bg-elev flex items-center gap-3",onClick:()=>w(!d),children:[_.jsx("span",{className:"text-fg-faint w-3",children:d?"▾":"▸"}),_.jsxs("div",{className:"flex-1",children:[_.jsxs("div",{className:"flex items-center gap-2",children:[_.jsx("h2",{className:"text-fg text-sm font-medium",children:t}),i&&_.jsx("span",{className:"text-[9px] px-1.5 py-0 rounded border border-yellow-900/40 bg-yellow-950/30 text-yellow-500/80 uppercase tracking-wide",children:"advanced"})]}),_.jsx("p",{className:"text-fg-faint text-xs",children:s})]})]}),d&&_.jsx("div",{className:"divide-y divide-line/60",children:o})]})}function cw({keyName:t,node:s,info:i,targetScope:o,onOverride:d}){const[w,g]=W.useState(!1),a=cg(t),l=s!==void 0,m=(s==null?void 0:s.kind)==="leaf"?s:null,u=(s==null?void 0:s.kind)==="object"||(s==null?void 0:s.kind)==="array",x=i==null?void 0:i.default,b=m&&x!==void 0&&dg(m.value,x),E=mw({isSet:l,leafNode:m,defaultVal:x,isDefault:!!b,node:s});return _.jsx("div",{className:"px-4 py-3 hover:bg-bg-elev/20",children:_.jsxs("div",{className:"flex items-start gap-3",children:[_.jsx("button",{onClick:()=>g(!w),className:"text-fg-faint hover:text-fg w-3 mt-0.5",title:w?"collapse":"expand",children:w?"▾":"▸"}),_.jsxs("div",{className:"flex-1 min-w-0",children:[_.jsxs("div",{className:"flex items-baseline gap-2 flex-wrap",children:[_.jsx("h3",{className:"text-fg text-sm",children:a}),_.jsx(gw,{kind:E.kind,label:E.label}),(i==null?void 0:i.deprecated)&&_.jsx("span",{className:"text-[9px] px-1 py-0 rounded border border-yellow-900/40 bg-yellow-950/30 text-yellow-500/80 uppercase tracking-wide",children:"deprecated"}),(i==null?void 0:i.required)&&!l&&_.jsx("span",{className:"text-[9px] px-1 py-0 rounded border border-red-900/40 bg-red-950/30 text-red-400/80 uppercase tracking-wide",children:"required"})]}),(i==null?void 0:i.description)&&_.jsx("p",{className:"text-fg-dim text-xs mt-0.5 leading-relaxed",children:vw(i.description)}),w&&_.jsx(uw,{keyName:t,node:s,info:i,targetScope:o,onOverride:d})]}),_.jsx("div",{className:"shrink-0",children:!w&&_.jsx(pw,{node:s,info:i,onSet:S=>{d(S)},disabled:u&&l})})]})})}function uw({keyName:t,node:s,info:i,targetScope:o,onOverride:d}){const g=(s==null?void 0:s.kind)==="leaf"?s:null;return _.jsxs("div",{className:"mt-3 space-y-2 text-xs",children:[(i==null?void 0:i.description)&&_.jsx("p",{className:"text-fg-dim leading-relaxed whitespace-pre-wrap",children:i.description}),_.jsxs("dl",{className:"grid grid-cols-[auto_1fr] gap-x-3 gap-y-1 text-fg-faint",children:[(i==null?void 0:i.type)&&_.jsxs(_.Fragment,{children:[_.jsx("dt",{children:"Type"}),_.jsx("dd",{className:"text-fg-dim font-mono",children:Array.isArray(i.type)?i.type.join(" | "):i.type})]}),(i==null?void 0:i.default)!==void 0&&_.jsxs(_.Fragment,{children:[_.jsx("dt",{children:"Default"}),_.jsx("dd",{className:"text-fg-dim font-mono",children:zo(i.default)})]}),(i==null?void 0:i.enum)&&_.jsxs(_.Fragment,{children:[_.jsx("dt",{children:"Options"}),_.jsx("dd",{className:"text-fg-dim font-mono",children:i.enum.map(a=>String(a)).join(" | ")})]}),g&&_.jsxs(_.Fragment,{children:[_.jsx("dt",{children:"Current"}),_.jsxs("dd",{className:"font-mono",children:[_.jsx("span",{className:"text-fg-dim",children:zo(g.value)}),_.jsxs("span",{className:"ml-2 text-fg-faint",children:["from ",vt[g.winner].label]})]})]}),g&&g.shadowed.length>0&&_.jsxs(_.Fragment,{children:[_.jsx("dt",{children:"Shadowed"}),_.jsx("dd",{className:"space-y-0.5",children:g.shadowed.map((a,l)=>_.jsxs("div",{className:"font-mono text-fg-faint line-through",children:[zo(a.value)," —"," ",_.jsx("span",{className:"no-underline",children:vt[a.scope].label})]},l))})]}),(s==null?void 0:s.kind)==="array"&&_.jsxs(_.Fragment,{children:[_.jsx("dt",{children:"Accumulated"}),_.jsxs("dd",{className:"text-fg-dim",children:[s.items.length," items across all scopes"]})]})]}),_.jsx("div",{className:"pt-2 flex items-center gap-2 flex-wrap border-t border-line/60",children:_.jsx(dw,{keyName:t,node:s,info:i,onChange:d,targetScope:o})})]})}function dw({node:t,info:s,onChange:i,targetScope:o}){const w=(t==null?void 0:t.kind)==="leaf"?t.value:s==null?void 0:s.default,g=ug(s==null?void 0:s.type);if(g==="boolean"){const a=w===!0;return _.jsxs("div",{className:"flex items-center gap-2",children:[_.jsx("span",{className:"text-fg-faint",children:"Set to:"}),_.jsx("div",{className:"inline-flex rounded border border-line overflow-hidden",children:[{v:!0,label:"on"},{v:!1,label:"off"}].map(({v:l,label:p})=>_.jsx("button",{onClick:()=>i(l),className:`px-3 py-0.5 text-xs transition-colors ${a===l?"bg-accent text-bg":"bg-bg-elev text-fg-dim hover:bg-bg-hi hover:text-fg"}`,children:p},p))}),_.jsxs("span",{className:"text-fg-faint",children:["→ ",vt[o].label]})]})}return s!=null&&s.enum?_.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[_.jsx("span",{className:"text-fg-faint",children:"Choose:"}),s.enum.map(a=>{const l=dg(w,a);return _.jsx("button",{onClick:()=>i(a),className:`px-2 py-0.5 text-xs rounded border ${l?"bg-accent text-bg border-accent":"bg-bg-elev text-fg-dim border-line hover:text-fg hover:bg-bg-hi"}`,children:String(a)},String(a))}),_.jsxs("span",{className:"text-fg-faint",children:["→ ",vt[o].label]})]}):g==="integer"||g==="number"?_.jsx(hw,{value:typeof w=="number"?w:void 0,integer:g==="integer",onCommit:i,target:vt[o].label}):g==="string"?_.jsx(fw,{value:typeof w=="string"?w:"",onCommit:i,target:vt[o].label}):_.jsxs("div",{className:"text-fg-faint",children:["Complex value (",g??"object/array",") — use the"," ",_.jsx("span",{className:"text-fg-dim",children:"Raw"})," tab to edit."]})}function hw({value:t,integer:s,onCommit:i,target:o}){const[d,w]=W.useState(t!==void 0?String(t):""),g=()=>{const a=s?parseInt(d,10):parseFloat(d);Number.isNaN(a)||i(a)};return _.jsxs("div",{className:"flex items-center gap-2",children:[_.jsx("span",{className:"text-fg-faint",children:"Set to:"}),_.jsx("input",{type:"number",value:d,onChange:a=>w(a.target.value),onBlur:g,onKeyDown:a=>{a.key==="Enter"&&a.target.blur()},className:"w-24 bg-bg border border-line rounded px-2 py-0.5 text-xs text-fg"}),_.jsxs("button",{onClick:g,className:"px-2 py-0.5 text-xs border border-accent/50 rounded text-accent hover:bg-accent hover:text-bg",children:["save → ",o]})]})}function fw({value:t,onCommit:s,target:i}){const[o,d]=W.useState(t);return _.jsxs("div",{className:"flex items-center gap-2 flex-1 min-w-0",children:[_.jsx("span",{className:"text-fg-faint shrink-0",children:"Set to:"}),_.jsx("input",{type:"text",value:o,onChange:w=>d(w.target.value),onKeyDown:w=>{w.key==="Enter"&&s(o)},className:"flex-1 min-w-0 bg-bg border border-line rounded px-2 py-0.5 text-xs text-fg"}),_.jsxs("button",{onClick:()=>s(o),className:"shrink-0 px-2 py-0.5 text-xs border border-accent/50 rounded text-accent hover:bg-accent hover:text-bg",children:["save → ",i]})]})}function pw({node:t,info:s,onSet:i,disabled:o}){const d=(t==null?void 0:t.kind)==="leaf",w=ug(s==null?void 0:s.type);if(o)return null;if(w==="boolean"){const g=d&&t.value===!0;return _.jsx("button",{onClick:()=>i(!g),className:`px-2.5 py-0.5 text-xs rounded border transition-colors ${g?"bg-accent/15 text-accent border-accent/40 hover:bg-accent hover:text-bg":"bg-bg-elev text-fg-dim border-line hover:text-fg hover:bg-bg-hi"}`,title:"toggle",children:g?"on":"off"})}return null}function mw({isSet:t,leafNode:s,defaultVal:i,isDefault:o,node:d}){return t?(d==null?void 0:d.kind)==="array"?{kind:"accumulated",label:`${d.items.length} items`}:(d==null?void 0:d.kind)==="object"?{kind:"set",label:"configured"}:s?o?{kind:"default",label:`= default · ${vt[s.winner].label}`}:s.shadowed.length>0?{kind:"override",label:`overriding ${s.shadowed.length} scope(s)`}:{kind:"set",label:`set in ${vt[s.winner].label}`}:{kind:"set",label:"configured"}:i!==void 0?{kind:"default",label:`using default: ${zo(i)}`}:{kind:"unset",label:"not configured"}}function gw({kind:t,label:s}){const i={set:"bg-accent/15 text-accent border-accent/30",default:"bg-bg-hi text-fg-dim border-line",unset:"bg-bg-elev text-fg-faint border-line",override:"bg-purple-950/30 text-purple-400/80 border-purple-900/40",accumulated:"bg-blue-950/30 text-blue-400/80 border-blue-900/40"}[t];return _.jsx("span",{className:`text-[9px] px-1.5 py-0 rounded border uppercase tracking-wide ${i}`,children:s})}function ug(t){if(t)return Array.isArray(t)?t.find(i=>i!=="null")??t[0]:t}function dg(t,s){return t===s?!0:typeof t!=typeof s?!1:t&&s&&typeof t=="object"?JSON.stringify(t)===JSON.stringify(s):!1}function vw(t){const s=t.trim().split(`
66
66
  `)[0],i=s.match(/^([^.!?]+[.!?])/);return i?i[1]:s.length>120?s.slice(0,120)+"…":s}function zo(t){if(typeof t=="string")return t===""?'""':JSON.stringify(t);if(t===null)return"null";if(t===void 0)return"—";if(typeof t=="object"){const s=JSON.stringify(t);return s.length>60?s.slice(0,60)+"…":s}return String(t)}function xu({options:t,active:s,onChange:i}){return _.jsx("div",{className:"flex rounded border border-line overflow-hidden",children:t.map(({key:o,label:d})=>_.jsx("button",{onClick:()=>i(o),className:`px-2 py-0.5 text-xs ${s===o?"bg-bg-hi text-fg":"text-fg-dim hover:text-fg hover:bg-bg-hi"}`,children:d},o))})}function tn(t){return{path:t,diskRaw:"",draftRaw:"",diskData:null,exists:!1,parseError:null,loadError:null,mtimeMs:0,dirty:!1,busy:!1,lastSavedAt:null}}function Tc(t,s,i){const o={...t,diskRaw:s.raw,diskData:s.data,exists:s.exists,parseError:s.parseError,loadError:s.error,mtimeMs:s.mtimeMs,busy:!1};return!i||!t.dirty?(o.draftRaw=s.raw,o.dirty=!1):o.dirty=o.draftRaw!==o.diskRaw,o}function pp(t,s,i){const o={...t,diskRaw:s.text,diskData:null,exists:s.exists,parseError:null,loadError:s.error,mtimeMs:s.mtimeMs,busy:!1};return o.draftRaw=s.text,o.dirty=!1,o}const xe=pa((t,s)=>({files:{},watchRefs:{},loadJson:async i=>{const o=s().files[i];t({files:{...s().files,[i]:{...o??tn(i),busy:!0}}});const d=await window.api.config.readJson(i),w=s().files[i]??tn(i);t({files:{...s().files,[i]:Tc(w,d,!1)}})},loadText:async i=>{const o=s().files[i];t({files:{...s().files,[i]:{...o??tn(i),busy:!0}}});const d=await window.api.config.readText(i),w=s().files[i]??tn(i);t({files:{...s().files,[i]:pp(w,d)}})},setDraft:(i,o)=>{const d=s().files[i]??tn(i),w=o!==d.diskRaw;t({files:{...s().files,[i]:{...d,draftRaw:o,dirty:w}}})},revert:i=>{const o=s().files[i];o&&t({files:{...s().files,[i]:{...o,draftRaw:o.diskRaw,dirty:!1}}})},saveJson:async i=>{const o=s().files[i];if(!o)return{ok:!1,error:"not loaded"};let d;try{d=o.draftRaw.trim()===""?{}:JSON.parse(o.draftRaw)}catch(l){return{ok:!1,error:`invalid JSON: ${l.message}`}}t({files:{...s().files,[i]:{...o,busy:!0}}});const w=await window.api.config.writeJson(i,d);if(!w.ok)return t({files:{...s().files,[i]:{...o,busy:!1}}}),{ok:!1,error:w.error};const g=await window.api.config.readJson(i),a=Tc({...o,busy:!1},g,!1);return t({files:{...s().files,[i]:{...a,lastSavedAt:Date.now()}}}),{ok:!0}},saveText:async i=>{const o=s().files[i];if(!o)return{ok:!1,error:"not loaded"};t({files:{...s().files,[i]:{...o,busy:!0}}});const d=await window.api.config.writeText(i,o.draftRaw);if(!d.ok)return t({files:{...s().files,[i]:{...o,busy:!1}}}),{ok:!1,error:d.error};const w=await window.api.config.readText(i),g=pp({...o,busy:!1},w);return t({files:{...s().files,[i]:{...g,lastSavedAt:Date.now()}}}),{ok:!0}},watchFile:i=>{const o={...s().watchRefs};o[i]=(o[i]??0)+1,t({watchRefs:o}),o[i]===1&&window.api.config.watch([i])},unwatchFile:i=>{const o={...s().watchRefs};o[i]&&(o[i]--,o[i]<=0&&(delete o[i],window.api.config.unwatch([i])),t({watchRefs:o}))},onExternalChange:i=>{s().files[i]&&window.api.config.readJson(i).then(d=>{const w=s().files[i];w&&t({files:{...s().files,[i]:Tc(w,d,!0)}})})}}));function yw(){return window.api.config.onChanged(({path:t})=>{xe.getState().onExternalChange(t)})}const _w=[];function Bo(t){return Array.isArray(t)?"array":t!==null&&typeof t=="object"?"object":"scalar"}function wu(t){const s=t.filter(i=>i.data!==void 0);return s.length===0?{kind:"object",children:{}}:hg(s,[])}function hg(t,s){const i=_w.includes(s.join(".")),o=t.every(m=>Bo(m.data)==="object"),d=t.every(m=>Bo(m.data)==="array");if(o){const m=new Set;for(const x of t)for(const b of Object.keys(x.data))m.add(b);const u={};for(const x of m){const b=t.filter(E=>x in E.data).map(E=>({scope:E.scope,data:E.data[x]}));u[x]=hg(b,[...s,x])}return{kind:"object",children:u}}if(d&&!i){const m=[];for(const u of[...t].reverse())for(const x of u.data)m.push({value:x,fromScope:u.scope,index:m.length});return{kind:"array",items:m}}const w=[...t].reverse(),g=w[0],a=w.slice(1).map(m=>({scope:m.scope,value:m.data})),l=Bo(g.data),p=a.some(m=>Bo(m.value)!==l);return{kind:"leaf",value:g.data,winner:g.scope,shadowed:a,...p?{typeMismatch:!0}:{}}}function Su(t,s){if(s.length===0)return t;if(t.kind!=="object")return null;const[i,...o]=s,d=t.children[i];return d?Su(d,o):null}function ga(t,s,i){if(s.length===0)return i;const[o,...d]=s,w=t&&typeof t=="object"&&!Array.isArray(t)?{...t}:{};return w[o]=ga(w[o],d,i),w}const xw=["user","project","local"];function bu(t,s){const i=[];for(const o of xw){const d=s[o];if(!d)continue;const w=t[d];if(!w||!w.exists)continue;const g=w.draftRaw??"";if(g.trim())try{i.push({scope:o,data:JSON.parse(g)})}catch{}}return i}const ww="http://json-schema.org/draft-07/schema#",Sw="https://json.schemastore.org/claude-code-settings.json",bw={permissionRule:{type:"string",description:`Tool permission rule.
67
67
  See https://code.claude.com/docs/en/settings#permission-rule-syntax
68
68
  See https://code.claude.com/docs/en/settings#tools-available-to-claude for full list of tools available to Claude.`,pattern:"^((Agent|Bash|Edit|ExitPlanMode|Glob|Grep|KillShell|LSP|NotebookEdit|Read|Skill|TaskCreate|TaskGet|TaskList|TaskOutput|TaskStop|TaskUpdate|TodoWrite|ToolSearch|WebFetch|WebSearch|Write)(\\((?=.*[^)*?])[^)]+\\))?|mcp__.*)$",examples:["Bash","Bash(npm run build)","Bash(git commit *)","Bash(npm run *)","Bash(ls*)","Bash(git * main)","Edit","Edit(/src/**/*.ts)","Read(./.env)","Read(./secrets/**)","Read(//Users/alice/secrets/**)","Read(~/Documents/*.pdf)","Agent(Explore)","WebFetch","WebFetch(domain:example.com)","mcp__puppeteer","mcp__github__search_repositories"]},hookCommand:{anyOf:[{type:"object",description:"Bash command hook",additionalProperties:!1,required:["type","command"],properties:{type:{type:"string",description:"Hook type",const:"command"},command:{type:"string",description:"Shell command to execute",minLength:1},timeout:{type:"number",description:"Optional timeout in seconds",exclusiveMinimum:0},async:{type:"boolean",description:"Run this hook asynchronously without blocking Claude Code"},statusMessage:{type:"string",description:"Custom spinner message displayed while the hook runs"}}},{type:"object",description:"LLM prompt hook. See https://code.claude.com/docs/en/hooks#prompt-based-hooks",additionalProperties:!1,required:["type","prompt"],properties:{type:{type:"string",description:"Hook type",const:"prompt"},prompt:{type:"string",description:"Prompt to evaluate with LLM. Use $ARGUMENTS placeholder for hook input JSON.",minLength:1},model:{type:"string",description:"Model to use for evaluation. Defaults to a fast model"},timeout:{type:"number",description:"Optional timeout in seconds (default: 30)",exclusiveMinimum:0},statusMessage:{type:"string",description:"Custom spinner message displayed while the hook runs"}}},{type:"object",description:"Agent hook with multi-turn tool access for verification. See https://code.claude.com/docs/en/hooks#agent-based-hooks",additionalProperties:!1,required:["type","prompt"],properties:{type:{type:"string",description:"Hook type",const:"agent"},prompt:{type:"string",description:"Prompt describing what to verify. Use $ARGUMENTS placeholder for hook input JSON.",minLength:1},model:{type:"string",description:"Model to use for evaluation. Defaults to a fast model"},timeout:{type:"number",description:"Optional timeout in seconds (default: 60)",exclusiveMinimum:0},statusMessage:{type:"string",description:"Custom spinner message displayed while the hook runs"}}},{type:"object",description:"HTTP webhook hook. POST JSON to a URL and receive JSON response. See https://code.claude.com/docs/en/hooks#http-hooks",additionalProperties:!1,required:["type","url"],properties:{type:{type:"string",description:"Hook type",const:"http"},url:{type:"string",description:"URL to POST hook input JSON to. Endpoint must accept POST requests and return JSON.",minLength:1},headers:{type:"object",additionalProperties:{type:"string"},description:"Custom HTTP headers (e.g., Authorization: Bearer token). Values support $VAR_NAME or ${VAR_NAME} interpolation."},allowedEnvVars:{type:"array",items:{type:"string",minLength:1},description:"List of environment variable names permitted for interpolation in headers. If not set, no env var interpolation is allowed."},timeout:{type:"number",description:"Optional timeout in seconds (default: 30)",exclusiveMinimum:0},statusMessage:{type:"string",description:"Custom spinner message displayed while the hook runs"}}}]},hookMatcher:{type:"object",description:"Hook matcher configuration with multiple hooks",additionalProperties:!1,required:["hooks"],properties:{matcher:{type:"string",description:"Optional pattern to match event contexts, case-sensitive. Behavior depends on event type. See https://code.claude.com/docs/en/hooks#matcher-patterns for event-specific details and examples"},hooks:{type:"array",description:"Array of hooks to execute",items:{$ref:"#/$defs/hookCommand"}}}}},Cw="Configuration settings for Claude Code. Learn more: https://code.claude.com/docs/en/settings",kw=!0,Ew=!0,Tw="object",Rw=JSON.parse(`{"$schema":{"type":"string","description":"JSON Schema reference for Claude Code settings"},"apiKeyHelper":{"type":"string","description":"Path to a script that outputs authentication values","examples":["/bin/generate_temp_api_key.sh"],"minLength":1},"autoMemoryEnabled":{"type":"boolean","description":"Enable automatic memory saves that capture useful context to .claude/memory/. Also configurable via CLAUDE_CODE_DISABLE_AUTO_MEMORY environment variable (set to 1 to disable, 0 to enable). See https://code.claude.com/docs/en/memory#auto-memory","default":true},"autoUpdatesChannel":{"type":"string","enum":["stable","latest"],"description":"Release channel to follow for updates. Use \\"stable\\" for a version that is typically about one week old and skips versions with major regressions, or \\"latest\\" (default) for the most recent release. Set DISABLE_AUTOUPDATER=1 to disable updates entirely.","default":"latest"},"awsCredentialExport":{"type":"string","description":"Path to a script that exports AWS credentials","examples":["/bin/generate_aws_grant.sh"],"minLength":1},"awsAuthRefresh":{"type":"string","description":"Path to a script that refreshes AWS authentication","examples":["aws sso login --profile myprofile"],"minLength":1},"claudeMdExcludes":{"type":"array","items":{"type":"string","minLength":1},"description":"Glob patterns for CLAUDE.md files to exclude from loading. Useful in monorepos to skip irrelevant instructions from other teams. Patterns match against absolute file paths. Arrays merge across settings layers. Managed policy CLAUDE.md files cannot be excluded. See https://code.claude.com/docs/en/memory#exclude-specific-claudemd-files","examples":[["**/monorepo/CLAUDE.md","/home/user/monorepo/other-team/.claude/rules/**"]]},"cleanupPeriodDays":{"type":"integer","minimum":0,"description":"Number of days to retain chat transcripts (0 to disable cleanup)","examples":[20,30,60],"default":30},"env":{"type":"object","additionalProperties":false,"description":"Environment variables to set for Claude Code sessions. Many environment variables provide settings dimensions not available as dedicated settings.json properties (e.g., thinking tokens, prompt caching, bash timeouts, shell configuration). See https://code.claude.com/docs/en/settings#environment-variables for the full list.\\nUNDOCUMENTED: CLAUDE_CODE_PLUGIN_GIT_TIMEOUT_MS (plugin marketplace git timeout in ms, default 120000, see https://github.com/anthropics/claude-code/blob/main/CHANGELOG.md#2151).\\nUNDOCUMENTED: ENABLE_CLAUDEAI_MCP_SERVERS (set to false to opt out of claude.ai MCP servers, see https://github.com/anthropics/claude-code/blob/main/CHANGELOG.md#2163).","examples":[{"ANTHROPIC_MODEL":"claude-opus-4-1","ANTHROPIC_SMALL_FAST_MODEL":"claude-3-5-haiku-latest"}],"default":{},"patternProperties":{"^[A-Z_][A-Z0-9_]*$":{"type":"string","description":"Environment variable value"}}},"attribution":{"type":"object","description":"Customize attribution for git commits and pull requests. See https://code.claude.com/docs/en/settings#attribution-settings","additionalProperties":false,"properties":{"commit":{"type":"string","description":"Attribution for git commits, including any trailers. Empty string hides commit attribution"},"pr":{"type":"string","description":"Attribution for pull request descriptions. Empty string hides pull request attribution"}}},"includeGitInstructions":{"type":"boolean","description":"Include built-in git commit and PR workflow instructions in Claude's system prompt. Also configurable via CLAUDE_CODE_DISABLE_GIT_INSTRUCTIONS environment variable (set to 1 to disable). See https://code.claude.com/docs/en/settings#available-settings","default":true},"includeCoAuthoredBy":{"type":"boolean","description":"DEPRECATED. Use 'attribution' instead. Whether to include the co-authored-by Claude byline in git commits and pull requests (default: true)","default":true},"plansDirectory":{"type":"string","description":"Customize where plan files are stored. Path is relative to project root (default: ~/.claude/plans)","default":"~/.claude/plans","examples":["./plans"]},"respectGitignore":{"type":"boolean","description":"Control whether the @ file picker respects .gitignore patterns. When true (default), files matching .gitignore patterns are excluded from suggestions","default":true},"permissions":{"type":"object","properties":{"allow":{"type":"array","items":{"$ref":"#/$defs/permissionRule"},"description":"List of permission rules for allowed operations","uniqueItems":true},"deny":{"type":"array","items":{"$ref":"#/$defs/permissionRule"},"description":"List of permission rules for denied operations","uniqueItems":true},"ask":{"type":"array","items":{"$ref":"#/$defs/permissionRule"},"description":"List of permission rules that should always prompt for confirmation","uniqueItems":true},"defaultMode":{"type":"string","enum":["acceptEdits","bypassPermissions","default","delegate","dontAsk","plan"],"description":"Default permission mode.\\n\\"default\\": prompts on first use.\\n\\"acceptEdits\\": auto-accepts file edits.\\n\\"plan\\": read-only, no modifications.\\nUNDOCUMENTED. \\"delegate\\": coordination-only for agent team leads (agent teams are experimental; enable via CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS).\\n\\"dontAsk\\": auto-denies unless pre-approved via permissions.\\n\\"bypassPermissions\\": skips all prompts (use only in isolated environments).\\nSee https://code.claude.com/docs/en/permissions"},"disableBypassPermissionsMode":{"type":"string","enum":["disable"],"description":"Disable the ability to bypass permission prompts"},"additionalDirectories":{"type":"array","items":{"type":"string","minLength":1},"description":"Additional directories to include in the permission scope","examples":[["//Users/alice/Documents","~/projects"]],"uniqueItems":true}},"additionalProperties":false,"description":"Tool usage permissions configuration.\\nSee https://code.claude.com/docs/en/permissions and https://code.claude.com/docs/en/settings#permission-settings\\nSee https://code.claude.com/docs/en/settings#tools-available-to-claude for full list of tools available to Claude.","examples":[{"allow":["Bash(git add:*)"],"ask":["Bash(gh pr create:*)","Bash(git commit:*)"],"deny":["Read(*.env)","Bash(rm:*)","Bash(curl:*)"],"defaultMode":"default"}]},"language":{"type":"string","description":"Preferred language for Claude's responses","examples":["japanese","spanish","french"]},"model":{"type":"string","description":"Override the default model used by Claude Code. For finer control, use environment variables: ANTHROPIC_MODEL (runtime override), ANTHROPIC_DEFAULT_OPUS_MODEL, ANTHROPIC_DEFAULT_SONNET_MODEL, ANTHROPIC_DEFAULT_HAIKU_MODEL (per-class pinning), CLAUDE_CODE_SUBAGENT_MODEL (subagent model). See https://code.claude.com/docs/en/model-config"},"availableModels":{"type":"array","items":{"type":"string"},"description":"Restrict which models users can select. When defined at multiple settings levels (user, project, etc.), arrays are merged and deduplicated. See https://code.claude.com/docs/en/model-config#restrict-model-selection","examples":[["sonnet","haiku"]]},"modelOverrides":{"type":"object","additionalProperties":{"type":"string"},"description":"Map Anthropic model IDs to provider-specific model IDs such as Bedrock inference profile ARNs, Vertex AI version names, or Foundry deployment names. Each model picker entry uses its mapped value when calling the provider API. Unknown keys are ignored. See https://code.claude.com/docs/en/model-config#override-model-ids-per-version","examples":[{"claude-opus-4-6":"arn:aws:bedrock:us-east-2:123456789012:application-inference-profile/opus-prod"}]},"effortLevel":{"type":"string","enum":["low","medium","high"],"description":"Control Opus 4.6 adaptive reasoning effort. Lower effort is faster and cheaper for straightforward tasks, higher effort provides deeper reasoning. Defaults vary by model and plan (Opus 4.6 defaults to medium for Max and Team subscribers). Use /effort auto to reset to model default. Also configurable via CLAUDE_CODE_EFFORT_LEVEL environment variable. See https://code.claude.com/docs/en/model-config#adjust-effort-level"},"fastMode":{"type":"boolean","description":"Enable fast mode for Opus 4.6 (research preview). Fast mode uses the same model with 2.5x faster output at higher per-token cost. Requires extra usage enabled. Alternatively, toggle with /fast command. See https://code.claude.com/docs/en/fast-mode","default":false},"fastModePerSessionOptIn":{"type":"boolean","description":"Require per-session opt-in for fast mode. When true, fast mode does not persist across sessions and users must enable it with /fast each session. Useful for controlling costs. See https://code.claude.com/docs/en/fast-mode","default":false},"feedbackSurveyRate":{"type":"number","minimum":0,"maximum":1,"description":"Probability (0–1) that the session quality survey appears when eligible. A value of 0.05 means 5% of eligible sessions. See https://code.claude.com/docs/en/settings","examples":[0.05]},"enableAllProjectMcpServers":{"type":"boolean","description":"Whether to automatically approve all MCP servers in the project. See https://code.claude.com/docs/en/mcp","examples":[true]},"enabledMcpjsonServers":{"type":"array","items":{"type":"string","minLength":1},"description":"List of approved MCP servers from .mcp.json. See https://code.claude.com/docs/en/mcp","examples":[["memory","github"]]},"disabledMcpjsonServers":{"type":"array","items":{"type":"string","minLength":1},"description":"List of rejected MCP servers from .mcp.json. See https://code.claude.com/docs/en/mcp","examples":[["filesystem"]]},"allowedMcpServers":{"type":"array","items":{"anyOf":[{"type":"object","properties":{"serverName":{"type":"string","pattern":"^[a-zA-Z0-9_-]+$","description":"Name of the MCP server that users are allowed to configure"}},"required":["serverName"],"additionalProperties":false},{"type":"object","properties":{"serverCommand":{"type":"array","items":{"type":"string"},"description":"Exact command and arguments used to start stdio servers"}},"required":["serverCommand"],"additionalProperties":false},{"type":"object","properties":{"serverUrl":{"type":"string","description":"URL pattern for remote servers, supports wildcards (e.g., https://*.example.com/*)"}},"required":["serverUrl"],"additionalProperties":false}]},"description":"Enterprise allowlist of MCP servers that can be used. Applies to all scopes including enterprise servers from managed-mcp.json. If undefined, all servers are allowed. If empty array, no servers are allowed. Denylist takes precedence - if a server is on both lists, it is denied. See https://code.claude.com/docs/en/mcp#restriction-options"},"deniedMcpServers":{"type":"array","items":{"anyOf":[{"type":"object","properties":{"serverName":{"type":"string","pattern":"^[a-zA-Z0-9_-]+$","description":"Name of the MCP server that is explicitly blocked"}},"required":["serverName"],"additionalProperties":false},{"type":"object","properties":{"serverCommand":{"type":"array","items":{"type":"string"},"description":"Exact command and arguments used to start stdio servers"}},"required":["serverCommand"],"additionalProperties":false},{"type":"object","properties":{"serverUrl":{"type":"string","description":"URL pattern for remote servers, supports wildcards (e.g., https://*.example.com/*)"}},"required":["serverUrl"],"additionalProperties":false}]},"description":"Enterprise denylist of MCP servers that are explicitly blocked. If a server is on the denylist, it will be blocked across all scopes including enterprise. Denylist takes precedence over allowlist - if a server is on both lists, it is denied. See https://code.claude.com/docs/en/mcp#restriction-options"},"httpHookAllowedEnvVars":{"type":"array","items":{"type":"string","minLength":1},"description":"Allowlist of environment variable names HTTP hooks may interpolate into headers. When set, each hook's effective allowedEnvVars is the intersection with this list. Undefined = no restriction. Arrays merge across settings sources. See https://code.claude.com/docs/en/settings#hook-configuration","examples":[["MY_TOKEN","HOOK_SECRET"]]},"hooks":{"type":"object","additionalProperties":false,"description":"Custom commands to run before/after tool executions. See https://code.claude.com/docs/en/hooks","examples":[{"PostToolUse":[{"matcher":"Edit|Write","hooks":[{"type":"command","command":"prettier --write","timeout":5}]}]}],"properties":{"PreToolUse":{"type":"array","description":"Hooks that run before tool calls","items":{"$ref":"#/$defs/hookMatcher"}},"PostToolUse":{"type":"array","description":"Hooks that run after tool completion","items":{"$ref":"#/$defs/hookMatcher"}},"PostToolUseFailure":{"type":"array","description":"Hooks that run after a tool fails","items":{"$ref":"#/$defs/hookMatcher"}},"PermissionRequest":{"type":"array","description":"Hooks that run when a permission dialog appears","items":{"$ref":"#/$defs/hookMatcher"}},"Notification":{"type":"array","description":"Hooks that trigger on notifications","items":{"$ref":"#/$defs/hookMatcher"}},"UserPromptSubmit":{"type":"array","description":"Hooks that run when a user submits a prompt","items":{"$ref":"#/$defs/hookMatcher"}},"Stop":{"type":"array","description":"Hooks that run when agents finish responding. Does not run on user interrupt","items":{"$ref":"#/$defs/hookMatcher"}},"SubagentStart":{"type":"array","description":"Hooks that run when a subagent is spawned","items":{"$ref":"#/$defs/hookMatcher"}},"SubagentStop":{"type":"array","description":"Hooks that run when subagents finish responding","items":{"$ref":"#/$defs/hookMatcher"}},"PreCompact":{"type":"array","description":"Hooks that run before the context is compacted","items":{"$ref":"#/$defs/hookMatcher"}},"PostCompact":{"type":"array","description":"Hooks that run after the context is compacted. See https://code.claude.com/docs/en/hooks","items":{"$ref":"#/$defs/hookMatcher"}},"Elicitation":{"type":"array","description":"Hooks that run when an MCP server requests user input during a tool call. See https://code.claude.com/docs/en/hooks","items":{"$ref":"#/$defs/hookMatcher"}},"ElicitationResult":{"type":"array","description":"Hooks that run after a user responds to an MCP elicitation, before the response is sent back to the server. See https://code.claude.com/docs/en/hooks","items":{"$ref":"#/$defs/hookMatcher"}},"TeammateIdle":{"type":"array","description":"Hooks that run when an agent team teammate is about to go idle. Exit code 2 sends feedback and keeps the teammate working. Does not support matchers. Agent teams are experimental. See https://code.claude.com/docs/en/hooks#teammateidle","items":{"$ref":"#/$defs/hookMatcher"}},"TaskCompleted":{"type":"array","description":"Hooks that run when a task is being marked as completed. Exit code 2 prevents completion and sends feedback. Does not support matchers. See https://code.claude.com/docs/en/hooks#taskcompleted","items":{"$ref":"#/$defs/hookMatcher"}},"Setup":{"type":"array","description":"UNDOCUMENTED. Hooks that run during repository initialization (--init, --init-only) or maintenance (--maintenance)","items":{"$ref":"#/$defs/hookMatcher"}},"InstructionsLoaded":{"type":"array","description":"Hooks that run when a CLAUDE.md or .claude/rules/*.md file is loaded into context. Fires at session start and when files are lazily loaded (e.g., nested traversal, path glob match). No decision control; used for audit logging and observability. Does not support matchers. See https://code.claude.com/docs/en/hooks#instructionsloaded","items":{"$ref":"#/$defs/hookMatcher"}},"ConfigChange":{"type":"array","description":"Hooks that run when settings, managed settings, or skill files change during a session. Supports matchers: user_settings, project_settings, local_settings, policy_settings, skills. Command handlers only. Exit code 2 blocks the change (except policy_settings which is audit-only). See https://code.claude.com/docs/en/hooks#configchange","items":{"$ref":"#/$defs/hookMatcher"}},"WorktreeCreate":{"type":"array","description":"Hooks that run when a worktree is created via --worktree or isolation: \\"worktree\\" in subagents. Command handlers only, no matchers. Hook must print absolute path to created worktree on stdout; non-zero exit fails creation. See https://code.claude.com/docs/en/hooks#worktreecreate","items":{"$ref":"#/$defs/hookMatcher"}},"WorktreeRemove":{"type":"array","description":"Hooks that run when a worktree is being removed at session exit or when a subagent finishes. Command handlers only, no matchers. Used for cleanup tasks; cannot block removal. See https://code.claude.com/docs/en/hooks#worktreeremove","items":{"$ref":"#/$defs/hookMatcher"}},"SessionStart":{"type":"array","description":"Hooks that run when a new session starts","items":{"$ref":"#/$defs/hookMatcher"}},"SessionEnd":{"type":"array","description":"Hooks that run when a session ends","items":{"$ref":"#/$defs/hookMatcher"}}}},"disableAllHooks":{"type":"boolean","description":"Disable all hooks and statusLine execution. When true in managed settings, user and project-level disableAllHooks cannot override it. See https://code.claude.com/docs/en/hooks#disable-or-remove-hooks"},"allowedHttpHookUrls":{"type":"array","items":{"type":"string","minLength":1},"description":"Allowlist of URL patterns that HTTP hooks may target. Supports * as a wildcard. When set, hooks with non-matching URLs are blocked. Undefined = no restriction, empty array = block all HTTP hooks. Arrays merge across settings sources. See https://code.claude.com/docs/en/settings#hook-configuration","examples":[["https://hooks.example.com/*","http://localhost:*"]]},"allowManagedHooksOnly":{"type":"boolean","description":"(Managed settings only) Prevent loading of user, project, and plugin hooks. Only allows managed hooks and SDK hooks. See https://code.claude.com/docs/en/settings#hook-configuration"},"allowManagedPermissionRulesOnly":{"type":"boolean","description":"(Managed settings only) Prevent user and project settings from defining allow, ask, or deny permission rules. Only rules in managed settings apply. See https://code.claude.com/docs/en/settings#permission-settings"},"statusLine":{"type":"object","properties":{"type":{"type":"string","description":"The type of status line handler; must be set to \\"command\\" to run a custom shell script that receives JSON session data via stdin.","const":"command"},"command":{"type":"string","description":"A shell command or path to a script that displays session information (context usage, costs, git status, etc.) by reading JSON data from stdin and writing output to stdout. See https://code.claude.com/docs/en/statusline"},"padding":{"type":"number","description":"Optional number of extra horizontal spacing characters added to the status line content; defaults to 0."}},"required":["type","command"],"additionalProperties":false,"description":"Custom status line display configuration. See https://code.claude.com/docs/en/statusline","examples":[{"type":"command","command":"~/.claude/statusline.sh"}]},"fileSuggestion":{"type":"object","properties":{"type":{"type":"string","description":"The type of file suggestion handler; must be set to \\"command\\" to execute a custom shell script that generates file suggestions for the @ file picker.","const":"command"},"command":{"type":"string","description":"Shell command to execute for file suggestions"}},"required":["type","command"],"additionalProperties":false,"description":"Configure a custom script for @ file autocomplete. See https://code.claude.com/docs/en/settings#file-suggestion-settings","examples":[{"type":"command","command":"~/.claude/file-suggestion.sh"}]},"enabledPlugins":{"type":"object","additionalProperties":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"boolean"},{"not":{}}]},"description":"Enabled plugins using plugin-id@marketplace-id format. Example: { \\"formatter@anthropic-tools\\": true }. See https://code.claude.com/docs/en/plugins"},"extraKnownMarketplaces":{"type":"object","additionalProperties":{"type":"object","properties":{"source":{"anyOf":[{"type":"object","properties":{"source":{"type":"string","description":"Identifies the marketplace source type","const":"url"},"url":{"type":"string","format":"uri","description":"Direct URL to marketplace.json file"}},"required":["source","url"],"additionalProperties":false},{"type":"object","properties":{"source":{"type":"string","description":"Identifies the marketplace source type","const":"hostPattern"},"hostPattern":{"type":"string","description":"Git host pattern to trust for repositories in source specifications"}},"required":["source","hostPattern"],"additionalProperties":false},{"type":"object","properties":{"source":{"type":"string","description":"Identifies the marketplace source type","const":"github"},"repo":{"type":"string","description":"GitHub repository in owner/repo format"},"ref":{"type":"string","description":"Git branch or tag to use (e.g., \\"main\\", \\"v1.0.0\\"). Defaults to repository default branch."},"path":{"type":"string","description":"Path to marketplace.json within repo (defaults to .claude-plugin/marketplace.json)"}},"required":["source","repo"],"additionalProperties":false},{"type":"object","properties":{"source":{"type":"string","description":"Identifies the marketplace source type","const":"git"},"url":{"type":"string","pattern":"\\\\.git$","description":"Full git repository URL"},"ref":{"type":"string","description":"Git branch or tag to use (e.g., \\"main\\", \\"v1.0.0\\"). Defaults to repository default branch."},"path":{"type":"string","description":"Path to marketplace.json within repo (defaults to .claude-plugin/marketplace.json)"}},"required":["source","url"],"additionalProperties":false},{"type":"object","properties":{"source":{"type":"string","description":"Identifies the marketplace source type","const":"npm"},"package":{"type":"string","description":"NPM package containing marketplace.json"}},"required":["source","package"],"additionalProperties":false},{"type":"object","properties":{"source":{"type":"string","description":"Identifies the marketplace source type","const":"file"},"path":{"type":"string","description":"Local file path to marketplace.json"}},"required":["source","path"],"additionalProperties":false},{"type":"object","properties":{"source":{"type":"string","description":"Identifies the marketplace source type","const":"directory"},"path":{"type":"string","description":"Local directory containing .claude-plugin/marketplace.json"}},"required":["source","path"],"additionalProperties":false}],"description":"Where to fetch the marketplace from"},"installLocation":{"type":"string","description":"Local cache path where marketplace manifest is stored (auto-generated if not provided)"}},"required":["source"],"additionalProperties":false},"description":"Additional marketplaces to make available for this repository. Typically used in repository .claude/settings.json to ensure team members have required plugin sources. See https://code.claude.com/docs/en/plugin-marketplaces"},"strictKnownMarketplaces":{"type":"array","description":"(Managed settings only) Allowlist of plugin marketplaces users can add. Undefined = no restrictions, empty array = lockdown. Uses exact matching for source specifications. See https://code.claude.com/docs/en/settings#strictknownmarketplaces","items":{"anyOf":[{"type":"object","properties":{"source":{"type":"string","description":"Identifies the marketplace source type","const":"hostPattern"},"hostPattern":{"type":"string","description":"Git host pattern to trust for repositories in source specifications"}},"required":["source","hostPattern"],"additionalProperties":false},{"type":"object","properties":{"source":{"type":"string","description":"Identifies the marketplace source type","const":"github"},"repo":{"type":"string","description":"GitHub repository in owner/repo format"},"ref":{"type":"string","description":"Git branch, tag, or SHA"},"path":{"type":"string","description":"Subdirectory path"}},"required":["source","repo"],"additionalProperties":false},{"type":"object","properties":{"source":{"type":"string","description":"Identifies the marketplace source type","const":"git"},"url":{"type":"string","description":"Full git repository URL"},"ref":{"type":"string","description":"Git branch, tag, or SHA"},"path":{"type":"string","description":"Subdirectory path"}},"required":["source","url"],"additionalProperties":false},{"type":"object","properties":{"source":{"type":"string","description":"Identifies the marketplace source type","const":"url"},"url":{"type":"string","format":"uri","description":"Direct URL to marketplace.json"},"headers":{"type":"object","additionalProperties":{"type":"string"},"description":"HTTP headers for authenticated access"}},"required":["source","url"],"additionalProperties":false},{"type":"object","properties":{"source":{"type":"string","description":"Identifies the marketplace source type","const":"npm"},"package":{"type":"string","description":"NPM package name (supports scoped packages)"}},"required":["source","package"],"additionalProperties":false},{"type":"object","properties":{"source":{"type":"string","description":"Identifies the marketplace source type","const":"file"},"path":{"type":"string","description":"Absolute path to marketplace.json file"}},"required":["source","path"],"additionalProperties":false},{"type":"object","properties":{"source":{"type":"string","description":"Identifies the marketplace source type","const":"directory"},"path":{"type":"string","description":"Absolute path to directory containing .claude-plugin/marketplace.json"}},"required":["source","path"],"additionalProperties":false},{"type":"object","properties":{"source":{"type":"string","description":"Identifies the marketplace source type","const":"pathPattern"},"pathPattern":{"type":"string","description":"Regex pattern to match file or directory paths for marketplace sources"}},"required":["source","pathPattern"],"additionalProperties":false}]},"examples":[[{"source":"github","repo":"acme-corp/approved-plugins"},{"source":"npm","package":"@acme-corp/compliance-plugins"}]]},"skippedMarketplaces":{"type":"array","items":{"type":"string","minLength":1},"description":"List of marketplace names the user has chosen not to install when prompted"},"skippedPlugins":{"type":"array","items":{"type":"string","minLength":1},"description":"List of plugin IDs (plugin@marketplace format) the user has chosen not to install when prompted"},"forceLoginMethod":{"type":"string","enum":["claudeai","console"],"description":"Force a specific login method: \\"claudeai\\" for Claude Pro/Max, \\"console\\" for Console billing","examples":["claudeai"]},"forceLoginOrgUUID":{"type":"string","description":"Organization UUID to use for OAuth login","examples":["xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"],"minLength":1},"otelHeadersHelper":{"type":"string","description":"Path to a script that outputs OpenTelemetry headers","minLength":1},"outputStyle":{"type":"string","description":"Controls the output style for assistant responses. Built-in styles: default, Explanatory, Learning. Custom styles can be added in ~/.claude/output-styles/ or .claude/output-styles/. See https://code.claude.com/docs/en/output-styles","examples":["default","Explanatory","Learning"],"minLength":1},"skipWebFetchPreflight":{"type":"boolean","description":"Skip the WebFetch blocklist check for enterprise environments with restrictive security policies"},"sandbox":{"type":"object","description":"Sandbox execution configuration. See https://code.claude.com/docs/en/sandboxing","properties":{"network":{"type":"object","description":"Configures network isolation settings for the sandboxed bash environment, including domain restrictions, Unix socket access, and custom proxy configuration.","properties":{"allowUnixSockets":{"type":"array","items":{"type":"string"},"description":"Allow Unix domain sockets for local IPC (SSH agent, Docker, etc.). Provide an array of specific paths. Defaults to blocking if not specified"},"allowLocalBinding":{"type":"boolean","description":"Allow binding to local network addresses (e.g., localhost ports). Defaults to false if not specified"},"httpProxyPort":{"type":"integer","minimum":1,"maximum":65535,"description":"HTTP proxy port to use for network filtering. If not specified, a proxy server will be started automatically"},"socksProxyPort":{"type":"integer","minimum":1,"maximum":65535,"description":"SOCKS proxy port to use for network filtering. If not specified, a proxy server will be started automatically"},"allowAllUnixSockets":{"type":"boolean","description":"Allow all Unix domain socket connections. If true, this overrides allowUnixSockets"},"allowedDomains":{"type":"array","items":{"type":"string","minLength":1},"description":"Allowlist of network domains for sandboxed commands. Supports wildcard patterns like *.example.com"},"allowManagedDomainsOnly":{"type":"boolean","description":"(Managed settings only) Only allowedDomains and WebFetch(domain:...) allow rules from managed settings are respected. User, project, local, and flag settings domains are ignored. Denied domains are still respected from all sources. Non-allowed domains are automatically blocked without user prompts."}},"additionalProperties":false},"ignoreViolations":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"},"description":"List of filesystem paths to ignore sandbox violations for when this command pattern matches"},"description":"Map of command patterns to filesystem paths to ignore violations for. Use \\"*\\" to match all commands"},"excludedCommands":{"type":"array","items":{"type":"string"},"description":"Commands that should never run in the sandbox (e.g., [\\"git\\", \\"docker\\"])"},"autoAllowBashIfSandboxed":{"type":"boolean","description":"Automatically allow bash commands without prompting when they run in the sandbox. Only applies to commands that will run sandboxed.","default":true},"enableWeakerNetworkIsolation":{"type":"boolean","description":"macOS only. Allow access to the system TLS trust service (com.apple.trustd.agent) in the sandbox. Required for Go-based tools like gh, gcloud, and terraform to verify TLS certificates when using httpProxyPort with a MITM proxy and custom CA. Reduces security by opening a potential data exfiltration path. Default: false. See https://code.claude.com/docs/en/settings#sandbox-settings","default":false},"enableWeakerNestedSandbox":{"type":"boolean","description":"Enable weaker sandbox mode for unprivileged docker environments where --proc mounting fails. This significantly reduces the strength of the sandbox and should only be used when this risk is acceptable.Default: false (secure)."},"allowUnsandboxedCommands":{"type":"boolean","description":"Allow commands to run outside the sandbox via the dangerouslyDisableSandbox parameter. When false, the dangerouslyDisableSandbox parameter is completely ignored and all commands must run sandboxed. Default: true."},"enabled":{"type":"boolean","description":"Enable sandboxed bash"},"filesystem":{"type":"object","description":"Filesystem access control for sandboxed commands. See https://code.claude.com/docs/en/sandboxing#filesystem-isolation","properties":{"allowWrite":{"type":"array","items":{"type":"string","minLength":1},"description":"Paths where subprocesses are allowed to write. Supports prefixes: // (absolute), ~/ (home directory), / (relative to settings file), ./ or no prefix (relative path)"},"denyWrite":{"type":"array","items":{"type":"string","minLength":1},"description":"Paths where subprocesses are explicitly denied write access. Takes precedence over allowWrite"},"denyRead":{"type":"array","items":{"type":"string","minLength":1},"description":"Paths where subprocesses are explicitly denied read access"},"allowRead":{"type":"array","items":{"type":"string","minLength":1},"description":"Paths to re-allow reading within denyRead regions. Takes precedence over denyRead for matching paths"},"allowManagedReadPathsOnly":{"type":"boolean","description":"When true (managed settings only), only allowRead paths from managed settings are used"}},"additionalProperties":false}},"additionalProperties":false},"spinnerVerbs":{"type":"object","description":"Customize the verbs shown in spinner progress messages","properties":{"mode":{"type":"string","enum":["append","replace"],"description":"How to combine custom verbs with default spinner verbs: 'append' adds custom verbs to the default list, 'replace' uses only custom verbs"},"verbs":{"type":"array","items":{"type":"string","minLength":1},"minItems":1,"description":"Custom verbs used in spinner progress text"}},"required":["verbs"],"additionalProperties":false},"spinnerTipsEnabled":{"type":"boolean","description":"Show tips in the spinner while Claude is working. Set to false to disable tips (default: true)","default":true},"spinnerTipsOverride":{"type":"object","description":"Customize the tips displayed in the spinner while Claude is working. See https://code.claude.com/docs/en/settings#available-settings","properties":{"excludeDefault":{"type":"boolean","description":"If true, only show custom tips. If false or absent, custom tips merge with built-in tips","default":false},"tips":{"type":"array","items":{"type":"string","minLength":1},"description":"Custom tip strings to display in the spinner","minItems":1}},"required":["tips"],"additionalProperties":false},"terminalProgressBarEnabled":{"type":"boolean","description":"Enable the terminal progress bar that shows progress in supported terminals like Windows Terminal and iTerm2 (default: true)","default":true},"showTurnDuration":{"type":"boolean","description":"Show turn duration messages after responses (e.g., \\"Cooked for 1m 6s\\"). Set to false to hide these messages (default: true)","default":true},"prefersReducedMotion":{"type":"boolean","description":"Reduce or disable UI animations (spinners, shimmer, flash effects) for accessibility","default":false},"alwaysThinkingEnabled":{"type":"boolean","description":"Enable extended thinking by default for all sessions. Typically configured via the /config command rather than editing directly. See https://code.claude.com/docs/en/common-workflows#use-extended-thinking-thinking-mode"},"companyAnnouncements":{"type":"array","items":{"type":"string","minLength":1},"description":"Company announcements to display at startup (one will be randomly selected if multiple are provided)"},"teammateMode":{"type":"string","enum":["auto","in-process","tmux"],"description":"How agent team teammates display: \\"auto\\" picks split panes in tmux or iTerm2, in-process otherwise. Agent teams are experimental and disabled by default. Enable them by adding CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS to your settings.json or environment. See https://code.claude.com/docs/en/agent-teams","default":"auto"},"worktree":{"type":"object","additionalProperties":false,"description":"Configuration for --worktree sessions. See https://code.claude.com/docs/en/settings","properties":{"sparsePaths":{"type":"array","items":{"type":"string","minLength":1},"description":"Directories to check out in each worktree via git sparse-checkout (cone mode). Only the listed paths are written to disk, which is faster in large monorepos.","examples":[["packages/my-app","shared/utils"]]}}},"pluginTrustMessage":{"type":"string","description":"(Managed settings only) Custom message appended to the plugin trust warning shown before installation. Use to provide organization-specific context about approved plugins. See https://code.claude.com/docs/en/settings#plugin-settings","minLength":1},"pluginConfigs":{"type":"object","additionalProperties":{"type":"object","properties":{"mcpServers":{"type":"object","additionalProperties":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"array","items":{"type":"string"}}]}},"description":"User configuration values for MCP servers keyed by server name"}},"additionalProperties":false},"description":"Per-plugin configuration including MCP server user configs, keyed by plugin ID (plugin@marketplace format). See https://code.claude.com/docs/en/plugins"},"allowManagedMcpServersOnly":{"type":"boolean","description":"(Managed settings only) Only allowedMcpServers from managed settings are respected. deniedMcpServers still merges from all sources. Users can still add their own MCP servers, but only the admin-defined allowlist applies."},"blockedMarketplaces":{"type":"array","description":"(Managed settings only) Blocklist of marketplace sources. These exact sources are blocked from being added as marketplaces. The check happens before downloading, so blocked sources never touch the filesystem.","items":{"anyOf":[{"type":"object","additionalProperties":false,"properties":{"source":{"type":"string","const":"url","description":"Block marketplace fetched from direct URL"},"url":{"type":"string","format":"uri","description":"Direct URL to marketplace.json file"},"headers":{"type":"object","additionalProperties":{"type":"string"},"description":"Custom HTTP headers (e.g., for authentication)"}},"required":["source","url"]},{"type":"object","additionalProperties":false,"properties":{"source":{"type":"string","const":"github","description":"Block marketplace from GitHub repository"},"repo":{"type":"string","description":"GitHub repository in owner/repo format"},"ref":{"type":"string","description":"Git branch or tag to use"},"path":{"type":"string","description":"Path to marketplace.json within repo"}},"required":["source","repo"]},{"type":"object","additionalProperties":false,"properties":{"source":{"type":"string","const":"git","description":"Block marketplace from git repository URL"},"url":{"type":"string","pattern":".*\\\\.git$","description":"Full git repository URL"},"ref":{"type":"string","description":"Git branch or tag to use"},"path":{"type":"string","description":"Path to marketplace.json within repo"}},"required":["source","url"]},{"type":"object","additionalProperties":false,"properties":{"source":{"type":"string","const":"npm","description":"Block marketplace from NPM package"},"package":{"type":"string","description":"NPM package containing marketplace.json"}},"required":["source","package"]},{"type":"object","additionalProperties":false,"properties":{"source":{"type":"string","const":"file","description":"Block marketplace from local file"},"path":{"type":"string","description":"Local file path to marketplace.json"}},"required":["source","path"]},{"type":"object","additionalProperties":false,"properties":{"source":{"type":"string","const":"directory","description":"Block marketplace from local directory"},"path":{"type":"string","description":"Local directory containing .claude-plugin/marketplace.json"}},"required":["source","path"]},{"type":"object","additionalProperties":false,"properties":{"source":{"type":"string","const":"hostPattern","description":"Block marketplace by host pattern matching"},"hostPattern":{"type":"string","description":"Regex pattern to match the host/domain extracted from any marketplace source type"}},"required":["source","hostPattern"]},{"type":"object","additionalProperties":false,"properties":{"source":{"type":"string","const":"pathPattern","description":"Block marketplace by file/directory path pattern matching"},"pathPattern":{"type":"string","description":"Regex pattern to match file or directory paths for marketplace sources"}},"required":["source","pathPattern"]}]}}}`),Pw="Claude Code Settings",Lw={$schema:ww,$id:Sw,$defs:bw,description:Cw,allowTrailingCommas:kw,additionalProperties:Ew,type:Tw,properties:Rw,title:Pw};function Dw(t){const s=t??{},i={...s.$defs??{},...s.definitions??{}},o=b=>{if(!b)return{};if(!b.$ref)return g(b);const E=/^#\/(\$defs|definitions)\/(.+)$/.exec(b.$ref);if(!E)return g(b);const S=i[E[2]];return S?o({...S,...a(b)}):g(b)},d=new Set(["__proto__","constructor","prototype"]),w=b=>{if(!b)return{};const E={};for(const[S,c]of Object.entries(b))d.has(S)||(E[S]=c);return E},g=b=>{if(!b.allOf||b.allOf.length===0)return b;const E={...b};delete E.allOf;for(const S of b.allOf){const c=o(S);Object.assign(E,{properties:{...w(E.properties),...w(c.properties)},required:Aw([...E.required??[],...c.required??[]])}),!E.description&&c.description&&(E.description=c.description),E.default===void 0&&c.default!==void 0&&(E.default=c.default),!E.type&&c.type&&(E.type=c.type)}return E},a=b=>{const{$ref:E,...S}=b;return S},l=(b,E)=>{let S=o(b);for(const c of E){if(!S)return null;if(/^\d+$/.test(c)){const v=Array.isArray(S.items)?S.items[Number(c)]:S.items;S=v?o(v):null;continue}const y=S.properties;if(y&&!d.has(c)&&c in y){S=o(y[c]);continue}const h=S.additionalProperties;if(h&&typeof h=="object"){S=o(h);continue}return null}return S},p=(b,E,S)=>{if(!b)return null;const c={};if(b.description&&(c.description=b.description),b.type&&(c.type=b.type),b.default!==void 0&&(c.default=b.default),b.enum&&(c.enum=b.enum),b.const!==void 0&&(c.const=b.const),b.deprecated&&(c.deprecated=!0),b.examples&&(c.examples=b.examples),b.properties&&(c.knownChildren=Object.keys(b.properties)),S&&(E!=null&&E.includes(S))&&(c.required=!0),b.items&&!Array.isArray(b.items)){const y=o(b.items),h=p(y,void 0,null);h&&(c.itemsInfo=h)}return(b.additionalProperties===!0||typeof b.additionalProperties=="object")&&(c.open=!0),c},m=b=>E=>{if(E.length===0)return p(o(b),void 0,null);const S=l(b,E.slice(0,-1));if(!S)return null;const c=E[E.length-1],y=l(S,[c]);return p(y,S.required,c)},u=b=>{const E=o(b);return Object.keys(E.properties??{})},x=b=>({at:m(b),rootKeys:()=>u(b),rootedAt:E=>{const S=l(b,E);return x(S??{})}});return x(s)}function Aw(t){return Array.from(new Set(t))}let Rc=null;function ia(){return Rc||(Rc=Dw(Lw)),Rc}function jw(){const t=et(),s=Re(T=>T.tabs),i=Re(T=>T.activeTabId),o=s.find(T=>T.id===i)??null,d=(o==null?void 0:o.cwd)??null,[w,g]=W.useState("user"),[a,l]=W.useState("effective"),p=W.useMemo(()=>{const T={};for(const A of ui.scopes){const I=ui.resolve(A,t??"",d);I&&(T[A]=I)}return T},[t,d]),m=p[w]??null,u=xe(T=>T.files),x=xe(T=>T.loadJson),b=xe(T=>T.setDraft),E=xe(T=>T.saveJson),S=xe(T=>T.revert),c=xe(T=>T.watchFile),y=xe(T=>T.unwatchFile);W.useEffect(()=>{const T=Object.values(p).filter(Boolean);return T.forEach(A=>{u[A]||x(A),c(A)}),()=>{T.forEach(A=>y(A))}},[JSON.stringify(p)]);const[h,v]=W.useState(null),C=W.useMemo(()=>wu(bu(u,p)),[u,p]),R=(T,A)=>{var J;const I=p[w];if(!I)return;v(null);const H=((J=u[I])==null?void 0:J.draftRaw)??"";let $={};if(H.trim())try{$=JSON.parse(H)}catch{$={}}const N=ga($,T,A);b(I,JSON.stringify(N,null,2)+`
@@ -118,7 +118,7 @@ ${t.replace(/^\s+/,"")}`:i+`
118
118
  `)};if(!t)return _.jsx(be,{title:"loading…"});if(w==="presets")return _.jsx(je,{toolbar:h,children:_.jsx(Kw,{})});const R=N=>N!=="user"&&!i,L=l?p[l]:null,{perms:D,full:T,err:A}=L?tS(L.draftRaw):{perms:{},full:{},err:null},I=N=>{l&&(y(null),u(l,rS(T,N)))},H=(N,J)=>{const K=J.trim();if(!K)return;const z=D[N]??[];z.includes(K)||I({...D,[N]:[...z,K]})},$=(N,J)=>{const K=D[N]??[];I({...D,[N]:K.filter((z,re)=>re!==J)})};return _.jsx(je,{toolbar:_.jsxs(_.Fragment,{children:[h,_.jsx("span",{className:"mx-2 text-fg-faint",children:"·"}),_.jsx(gr,{scopes:bc.scopes,active:o,onChange:d,annotate:N=>{if(R(N))return{exists:!1};const J=a[N];if(!J)return null;const K=p[J];return{exists:(K==null?void 0:K.exists)??!1,dirty:(K==null?void 0:K.dirty)??!1}}}),_.jsx("span",{className:"ml-3 text-fg-faint truncate",children:l??"—"}),_.jsx("div",{className:"flex-1"}),_.jsx("a",{href:"https://code.claude.com/docs/en/settings#permissions",target:"_blank",rel:"noreferrer",className:"text-fg-faint hover:text-fg-dim underline-offset-2 hover:underline",children:"rule syntax ↗"})]}),footer:l&&L?_.jsx(is,{dirty:L.dirty,busy:L.busy,parseError:c||A||L.parseError,lastSavedAt:L.lastSavedAt,onSave:async()=>{y(null);const N=await x(l);N.ok||y(N.error??"save failed")},onRevert:()=>{y(null),b(l)}}):null,children:R(o)?_.jsx(be,{title:"no active project",hint:"open a tab in a project directory to edit project or local permissions"}):w==="effective"?_.jsx(_u,{node:v,targetScope:o,onOverride:C,schema:ia().rootedAt(["permissions"]),rootLabel:"permissions"}):l&&L?_.jsxs("div",{className:"p-4 space-y-5 max-w-3xl",children:[_.jsx(iS,{value:D.defaultMode??"default",onChange:N=>I({...D,defaultMode:N})}),eS.map(N=>_.jsx(nS,{list:N,rules:D[N]??[],onAdd:J=>H(N,J),onRemove:J=>$(N,J)},N)),_.jsx(oS,{dirs:D.additionalDirectories??[],onChange:N=>I({...D,additionalDirectories:N})})]}):_.jsx(be,{title:"resolving…"})})}function iS({value:t,onChange:s}){const i=["default","acceptEdits","plan","bypassPermissions"];return _.jsxs("section",{children:[_.jsx("h3",{className:"text-xs text-fg uppercase tracking-wider mb-2",children:"Default Mode"}),_.jsx("div",{className:"inline-flex rounded border border-line overflow-hidden",children:i.map(o=>_.jsx("button",{onClick:()=>s(o),className:`px-2.5 py-1 text-xs transition-colors ${t===o?"bg-bg-hi text-fg":"bg-bg-elev text-fg-dim hover:text-fg hover:bg-bg-hi"}`,children:o},o))})]})}function nS({list:t,rules:s,onAdd:i,onRemove:o}){const[d,w]=W.useState(""),g=t==="allow"?"text-green-400":t==="deny"?"text-red-400":"text-yellow-400";return _.jsxs("section",{children:[_.jsx("h3",{className:`text-xs uppercase tracking-wider mb-2 ${g}`,children:t}),_.jsxs("div",{className:"flex gap-2 mb-2",children:[_.jsx("input",{value:d,onChange:a=>w(a.target.value),onKeyDown:a=>{a.key==="Enter"&&(i(d),w(""))},placeholder:t==="allow"?"e.g. Bash(ls:*) or Read(~/.claude/**)":"e.g. Write(/etc/**)",className:"flex-1 bg-bg-elev border border-line rounded px-2 py-1 text-xs text-fg placeholder-fg-faint"}),_.jsx("button",{onClick:()=>{i(d),w("")},disabled:!d.trim(),className:"px-2.5 py-1 border border-line rounded text-xs text-fg-dim hover:text-fg hover:bg-bg-hi disabled:opacity-40",children:"add"})]}),s.length===0?_.jsx("div",{className:"text-fg-faint text-xs",children:"no rules"}):_.jsx("ul",{className:"space-y-0.5",children:s.map((a,l)=>_.jsxs("li",{className:"flex items-center gap-2 text-xs font-mono bg-bg-elev border border-line rounded px-2 py-1",children:[_.jsx("span",{className:"flex-1 text-fg-dim truncate",children:a}),_.jsx("button",{onClick:()=>o(l),className:"text-fg-faint hover:text-red-400",title:"remove",children:"×"})]},`${l}-${a}`))})]})}function oS({dirs:t,onChange:s}){const[i,o]=W.useState("");return _.jsxs("section",{children:[_.jsx("h3",{className:"text-xs text-fg uppercase tracking-wider mb-2",children:"Additional Directories"}),_.jsx("div",{className:"flex gap-2 mb-2",children:_.jsx("input",{value:i,onChange:d=>o(d.target.value),onKeyDown:d=>{d.key==="Enter"&&i.trim()&&(s([...t,i.trim()]),o(""))},placeholder:"/absolute/path/to/dir",className:"flex-1 bg-bg-elev border border-line rounded px-2 py-1 text-xs text-fg placeholder-fg-faint"})}),_.jsx("ul",{className:"space-y-0.5",children:t.map((d,w)=>_.jsxs("li",{className:"flex items-center gap-2 text-xs font-mono bg-bg-elev border border-line rounded px-2 py-1",children:[_.jsx("span",{className:"flex-1 text-fg-dim truncate",children:d}),_.jsx("button",{onClick:()=>s(t.filter((g,a)=>a!==w)),className:"text-fg-faint hover:text-red-400",children:"×"})]},`${w}-${d}`))})]})}function ya({sidebar:t,detail:s,sidebarWidth:i="18rem"}){return _.jsxs("div",{className:"h-full flex",children:[_.jsx("div",{className:"shrink-0 border-r border-line overflow-y-auto",style:{width:i},children:t}),_.jsx("div",{className:"flex-1 min-w-0 overflow-auto",children:s})]})}function aS(t,s){return{user:{skills:`${t}/.claude/skills`,commands:`${t}/.claude/commands`},project:s?{skills:`${s}/.claude/skills`,commands:`${s}/.claude/commands`}:null}}function lS(){const t=et(),s=ns(),i=(s==null?void 0:s.cwd)??null,[o,d]=W.useState("user"),[w,g]=W.useState([]),[a,l]=W.useState(null),[p,m]=W.useState("installed"),[u,x]=W.useState(""),b=W.useMemo(()=>t?aS(t,i):null,[t,i]);W.useEffect(()=>{if(!b)return;let A=!1;const I=o==="user"?b.user:b.project;if(!I){g([]);return}return(async()=>{var J;const H=[],$=await window.api.config.listDir(I.skills,{dirsOnly:!0});for(const K of $.entries)if((await window.api.config.readText(`${K.path}/SKILL.md`)).exists)H.push({kind:"skills",scope:o,name:K.name,path:`${K.path}/SKILL.md`,dir:K.path});else{const re=await window.api.config.listDir(K.path,{dirsOnly:!0});for(const G of re.entries)(await window.api.config.readText(`${G.path}/SKILL.md`)).exists&&H.push({kind:"skills",scope:o,name:G.name,path:`${G.path}/SKILL.md`,dir:G.path})}const N=await window.api.config.listDir(I.commands,{filesOnly:!0});for(const K of N.entries)K.name.endsWith(".md")&&H.push({kind:"commands",scope:o,name:K.name.replace(/\.md$/,""),path:K.path,dir:null});A||(H.sort((K,z)=>K.kind===z.kind?K.name.localeCompare(z.name):K.kind==="skills"?-1:1),g(H),H.find(K=>K.path===a)||l(((J=H[0])==null?void 0:J.path)??null))})(),()=>{A=!0}},[o,b]);const E=xe(A=>A.files),S=xe(A=>A.loadText),c=xe(A=>A.setDraft),y=xe(A=>A.saveText),h=xe(A=>A.revert),v=xe(A=>A.watchFile),C=xe(A=>A.unwatchFile);W.useEffect(()=>{if(a)return E[a]||S(a),v(a),()=>C(a)},[a]);const[R,L]=W.useState(null);if(!t)return _.jsx(be,{title:"loading…"});if(p==="library")return _.jsx(je,{toolbar:_.jsx(pr,{active:p,onChange:m,installedLabel:"Installed",libraryLabel:"Library"}),children:_.jsx(Uw,{})});if(o==="project"&&!i)return _.jsx(je,{toolbar:_.jsxs(_.Fragment,{children:[_.jsx(pr,{active:p,onChange:m}),_.jsx("span",{className:"mx-2 text-fg-faint",children:"·"}),_.jsx(gr,{scopes:["user","project"],active:o,onChange:d})]}),children:_.jsx(be,{title:"no active project",hint:"open a tab in a project directory to view project skills & commands"})});const D=w.find(A=>A.path===a)??null,T=a?E[a]:null;return _.jsx(je,{toolbar:_.jsxs(_.Fragment,{children:[_.jsx(pr,{active:p,onChange:m}),_.jsx("span",{className:"mx-2 text-fg-faint",children:"·"}),_.jsx(gr,{scopes:["user","project"],active:o,onChange:d}),_.jsxs("span",{className:"ml-3 text-fg-faint",children:[w.length," ",w.length===1?"item":"items"]}),_.jsx("div",{className:"flex-1"}),_.jsx("span",{className:"text-fg-faint truncate",children:(D==null?void 0:D.path)??""})]}),footer:a&&T?_.jsx(is,{dirty:T.dirty,busy:T.busy,parseError:R,lastSavedAt:T.lastSavedAt,onSave:async()=>{L(null);const A=await y(a);A.ok||L(A.error??"save failed")},onRevert:()=>{L(null),h(a)}}):null,children:_.jsx(ya,{sidebar:_.jsxs("div",{className:"py-1",children:[_.jsx("div",{className:"px-2 pb-1",children:_.jsx("input",{value:u,onChange:A=>x(A.target.value),placeholder:"filter…",className:"w-full bg-bg border border-line rounded px-2 py-0.5 text-xs text-fg"})}),["skills","commands"].map(A=>{const I=u.toLowerCase(),H=w.filter($=>$.kind===A&&(!I||$.name.toLowerCase().includes(I)));return _.jsxs("div",{className:"mb-3",children:[_.jsx("div",{className:"px-3 py-1 text-xs uppercase tracking-wider text-fg-faint",children:A==="skills"?"Skills":"Slash Commands"}),H.length===0?_.jsx("div",{className:"px-3 py-1 text-xs text-fg-faint italic",children:"none"}):H.map($=>{var N;return _.jsxs("button",{onClick:()=>l($.path),className:`w-full text-left px-3 py-1 text-xs flex items-center justify-between ${a===$.path?"bg-bg-hi text-fg":"text-fg-dim hover:text-fg hover:bg-bg-hi"}`,children:[_.jsxs("span",{className:"truncate",children:[$.kind==="commands"?"/":"",$.name]}),((N=E[$.path])==null?void 0:N.dirty)&&_.jsx("span",{className:"w-1 h-1 rounded-full bg-accent shrink-0 ml-2"})]},$.path)})]},A)})]}),detail:a&&T?_.jsx("div",{className:"h-full",children:_.jsx(Cu,{path:a,value:T.draftRaw,onChange:A=>{L(null),c(a,A)}})}):_.jsx(be,{title:w.length===0?"no skills or commands":"select an item"})})})}function Tu({columns:t,rows:s,getKey:i,onRowClick:o,activeKey:d,empty:w}){return s.length===0?_.jsx("div",{className:"p-6 text-fg-faint text-xs text-center",children:w??"no entries"}):_.jsxs("table",{className:"w-full text-xs",children:[_.jsx("thead",{className:"sticky top-0 bg-bg-elev text-fg-faint uppercase tracking-wider",children:_.jsx("tr",{className:"border-b border-line",children:t.map(g=>_.jsx("th",{className:`text-left font-normal px-3 py-1.5 ${g.className??""}`,style:g.width?{width:g.width}:void 0,children:g.header},g.key))})}),_.jsx("tbody",{children:s.map(g=>{const a=i(g),l=d===a;return _.jsx("tr",{onClick:()=>o==null?void 0:o(g),className:`border-b border-line/50 transition-colors ${o?"cursor-pointer":""} ${l?"bg-bg-hi text-fg":"text-fg-dim hover:bg-bg-hi/50"}`,children:t.map(p=>_.jsx("td",{className:`px-3 py-1 ${p.className??""}`,children:p.render(g)},p.key))},a)})})]})}function cS(){const t=et(),[s,i]=W.useState([]),[o,d]=W.useState(!0),[w,g]=W.useState(null),[a,l]=W.useState("installed");W.useEffect(()=>{if(!t)return;let m=!1;return(async()=>{d(!0);const u=await window.api.config.listDir(`${t}/.claude/plugins`,{dirsOnly:!0});if(m)return;const x=[];for(const b of u.entries){const E=await window.api.config.exists(`${b.path}/plugin.json`);x.push({name:b.name,path:b.path,mtimeMs:b.mtimeMs,hasManifest:E})}x.sort((b,E)=>b.name.localeCompare(E.name)),m||(i(x),d(!1))})(),()=>{m=!0}},[t]);const p=[{key:"name",header:"name",render:m=>m.name,width:"12rem"},{key:"manifest",header:"manifest",render:m=>m.hasManifest?"plugin.json":_.jsx("span",{className:"text-fg-faint",children:"—"}),width:"8rem"},{key:"path",header:"path",render:m=>_.jsx("span",{className:"font-mono text-fg-faint truncate",children:m.path})}];return a==="library"?_.jsx(je,{toolbar:_.jsx(pr,{active:a,onChange:l}),children:_.jsx(Ww,{})}):_.jsx(je,{toolbar:_.jsxs(_.Fragment,{children:[_.jsx(pr,{active:a,onChange:l}),_.jsx("span",{className:"mx-2 text-fg-faint",children:"·"}),_.jsxs("span",{className:"text-fg-faint",children:[s.length," plugins"]}),_.jsx("div",{className:"flex-1"}),_.jsx("span",{className:"text-fg-faint font-mono truncate",children:"~/.claude/plugins/"})]}),children:o?_.jsx(be,{title:"scanning plugins…"}):_.jsx(Tu,{columns:p,rows:s,getKey:m=>m.path,activeKey:w,onRowClick:m=>g(m.path),empty:_.jsxs(_.Fragment,{children:["no plugins installed",_.jsxs("div",{className:"mt-2 text-fg-faint",children:["drop a plugin into ",_.jsx("code",{children:"~/.claude/plugins/"})]})]})})})}function uS(t,s,i){return t==="user"?`${s}/.claude.json`:i?`${i}/.mcp.json`:null}function dS(t){if(t.trim()==="")return{full:{},servers:{},err:null};try{const s=JSON.parse(t),i=s.mcpServers??{};return{full:s,servers:i,err:null}}catch(s){return{full:{},servers:{},err:s.message}}}function hS(t,s){return JSON.stringify({...t,mcpServers:s},null,2)+`
119
119
  `}function fS(){const t=et(),s=ns(),i=(s==null?void 0:s.cwd)??null,[o,d]=W.useState("user"),[w,g]=W.useState(null),[a,l]=W.useState("installed"),[p,m]=W.useState(""),u=W.useMemo(()=>t?uS(o,t,i):null,[t,o,i]),x=xe(z=>z.files),b=xe(z=>z.loadJson),E=xe(z=>z.setDraft),S=xe(z=>z.saveJson),c=xe(z=>z.revert),y=xe(z=>z.watchFile),h=xe(z=>z.unwatchFile);W.useEffect(()=>{if(u)return x[u]||b(u),y(u),()=>h(u)},[u]);const[v,C]=W.useState(null);if(!t)return _.jsx(be,{title:"loading…"});if(a==="library")return _.jsx(je,{toolbar:_.jsx(pr,{active:a,onChange:l}),children:_.jsx(Hw,{})});if(o==="project"&&!i)return _.jsx(je,{toolbar:_.jsxs(_.Fragment,{children:[_.jsx(pr,{active:a,onChange:l}),_.jsx("span",{className:"mx-2 text-fg-faint",children:"·"}),_.jsx(gr,{scopes:["user","project"],active:o,onChange:d})]}),children:_.jsx(be,{title:"no active project"})});if(!u)return _.jsx(be,{title:"loading…"});const R=x[u],{full:L,servers:D,err:T}=R?dS(R.draftRaw):{full:{},servers:{},err:null},A=Object.keys(D).sort(),I=w?D[w]:null,H=z=>{C(null),E(u,hS(L,z))},$=()=>{const z=`server-${Object.keys(D).length+1}`;H({...D,[z]:{type:"stdio",command:"",args:[]}}),g(z)},N=z=>{const re={...D};delete re[z],H(re),w===z&&g(null)},J=(z,re)=>{if(!re||re===z||D[re])return;const G={};for(const j of Object.keys(D))G[j===z?re:j]=D[j];H(G),g(re)},K=(z,re)=>{H({...D,[z]:re})};return _.jsx(je,{toolbar:_.jsxs(_.Fragment,{children:[_.jsx(pr,{active:a,onChange:l}),_.jsx("span",{className:"mx-2 text-fg-faint",children:"·"}),_.jsx(gr,{scopes:["user","project"],active:o,onChange:d}),_.jsx("span",{className:"ml-3 text-fg-faint truncate",children:u}),_.jsx("div",{className:"flex-1"}),_.jsx("button",{onClick:$,className:"px-2 py-0.5 text-xs border border-line rounded text-fg-dim hover:text-fg hover:bg-bg-hi",children:"+ new server"})]}),footer:R?_.jsx(is,{dirty:R.dirty,busy:R.busy,parseError:v||T||R.parseError,lastSavedAt:R.lastSavedAt,onSave:async()=>{C(null);const z=await S(u);z.ok||C(z.error??"save failed")},onRevert:()=>{C(null),c(u)}}):null,children:_.jsx(ya,{sidebar:_.jsxs("div",{className:"py-2",children:[_.jsx("div",{className:"px-2 pb-1",children:_.jsx("input",{value:p,onChange:z=>m(z.target.value),placeholder:"filter…",className:"w-full bg-bg border border-line rounded px-2 py-0.5 text-xs text-fg"})}),A.length===0?_.jsx("div",{className:"px-3 py-1 text-xs text-fg-faint italic",children:"no servers"}):A.filter(z=>!p||z.toLowerCase().includes(p.toLowerCase())).map(z=>_.jsxs("button",{onClick:()=>g(z),className:`w-full text-left px-3 py-1 text-xs flex items-center justify-between ${w===z?"bg-bg-hi text-fg":"text-fg-dim hover:text-fg hover:bg-bg-hi"}`,children:[_.jsx("span",{className:"truncate",children:z}),_.jsx("span",{className:"text-fg-faint ml-2 shrink-0",children:D[z].type??"stdio"})]},z))]}),detail:w&&I?_.jsx(pS,{name:w,server:I,onRename:z=>J(w,z),onChange:z=>K(w,z),onRemove:()=>N(w)}):_.jsx(be,{title:"select a server or click + new"})})})}function pS({name:t,server:s,onRename:i,onChange:o,onRemove:d}){const w=s.type??"stdio";return _.jsxs("div",{className:"p-4 space-y-4 max-w-2xl",children:[_.jsxs("div",{className:"flex items-center gap-2",children:[_.jsx("label",{className:"text-xs text-fg-faint w-20",children:"name"}),_.jsx("input",{defaultValue:t,onBlur:g=>i(g.target.value.trim()),className:"flex-1 bg-bg-elev border border-line rounded px-2 py-1 text-xs text-fg font-mono"}),_.jsx("button",{onClick:d,className:"text-xs text-fg-faint hover:text-red-400 px-2 py-1 border border-line rounded",children:"delete"})]}),_.jsxs("div",{className:"flex items-center gap-2",children:[_.jsx("label",{className:"text-xs text-fg-faint w-20",children:"type"}),_.jsxs("select",{value:w,onChange:g=>o({...s,type:g.target.value}),className:"bg-bg-elev border border-line rounded px-2 py-1 text-xs text-fg",children:[_.jsx("option",{value:"stdio",children:"stdio"}),_.jsx("option",{value:"http",children:"http"}),_.jsx("option",{value:"sse",children:"sse"})]})]}),w==="stdio"?_.jsxs(_.Fragment,{children:[_.jsx(Pc,{label:"command",value:s.command??"",onChange:g=>o({...s,command:g}),placeholder:"npx / node / python …"}),_.jsx(Pc,{label:"args",value:(s.args??[]).join(" "),onChange:g=>o({...s,args:g.split(/\s+/).filter(Boolean)}),placeholder:"space-separated args"}),_.jsx(wp,{label:"env",value:s.env??{},onChange:g=>o({...s,env:g})})]}):_.jsxs(_.Fragment,{children:[_.jsx(Pc,{label:"url",value:s.url??"",onChange:g=>o({...s,url:g}),placeholder:"https://…"}),_.jsx(wp,{label:"headers",value:s.headers??{},onChange:g=>o({...s,headers:g})})]})]})}function Pc({label:t,value:s,onChange:i,placeholder:o}){return _.jsxs("div",{className:"flex items-center gap-2",children:[_.jsx("label",{className:"text-xs text-fg-faint w-20",children:t}),_.jsx("input",{value:s,onChange:d=>i(d.target.value),placeholder:o,className:"flex-1 bg-bg-elev border border-line rounded px-2 py-1 text-xs text-fg font-mono"})]})}function wp({label:t,value:s,onChange:i}){const[o,d]=W.useState(""),[w,g]=W.useState(""),a=Object.entries(s);return _.jsxs("div",{className:"flex items-start gap-2",children:[_.jsx("label",{className:"text-xs text-fg-faint w-20 pt-1",children:t}),_.jsxs("div",{className:"flex-1 space-y-1",children:[a.map(([l,p])=>_.jsxs("div",{className:"flex gap-2",children:[_.jsx("input",{value:l,onChange:m=>{const u={...s};delete u[l],u[m.target.value]=p,i(u)},className:"w-32 bg-bg-elev border border-line rounded px-2 py-0.5 text-xs text-fg font-mono"}),_.jsx("input",{value:p,onChange:m=>i({...s,[l]:m.target.value}),className:"flex-1 bg-bg-elev border border-line rounded px-2 py-0.5 text-xs text-fg font-mono"}),_.jsx("button",{onClick:()=>{const m={...s};delete m[l],i(m)},className:"text-fg-faint hover:text-red-400 text-xs px-1",children:"×"})]},l)),_.jsxs("div",{className:"flex gap-2",children:[_.jsx("input",{value:o,onChange:l=>d(l.target.value),placeholder:"key",className:"w-32 bg-bg border border-line rounded px-2 py-0.5 text-xs text-fg-dim font-mono"}),_.jsx("input",{value:w,onChange:l=>g(l.target.value),placeholder:"value",className:"flex-1 bg-bg border border-line rounded px-2 py-0.5 text-xs text-fg-dim font-mono"}),_.jsx("button",{onClick:()=>{o.trim()&&(i({...s,[o.trim()]:w}),d(""),g(""))},className:"px-2 text-xs border border-line rounded text-fg-dim hover:text-fg hover:bg-bg-hi",children:"+"})]})]})]})}const mS=["PreToolUse","PostToolUse","UserPromptSubmit","Notification","Stop","SubagentStop","SessionStart","SessionEnd","PreCompact","PostCompact","PreBash","PostBash","PreEdit","PostEdit","PreRead","PostRead","PreWrite","PostWrite","PreGlob","PreGrep","PreTaskCreate","PreTaskUpdate","PreWebFetch","PreWebSearch","PreMcpToolUse","PostMcpToolUse"],gS=["command","http","prompt","agent"];function vS(t){if(t.trim()==="")return{full:{},hooks:{},err:null};try{const s=JSON.parse(t);return{full:s,hooks:s.hooks??{},err:null}}catch(s){return{full:{},hooks:{},err:s.message}}}function yS(t,s){return JSON.stringify({...t,hooks:s},null,2)+`
120
120
  `}function _S(t,s){return(t[s]??[]).reduce((i,o)=>{var d;return i+(((d=o.hooks)==null?void 0:d.length)??0)},0)}function xS(){const t=et(),s=ns(),i=(s==null?void 0:s.cwd)??null,[o,d]=W.useState("user"),[w,g]=W.useState("PreToolUse"),[a,l]=W.useState("effective"),p=W.useMemo(()=>{const z={};for(const re of ui.scopes){const G=ui.resolve(re,t??"",i);G&&(z[re]=G)}return z},[t,i]),m=p[o]??null,u=xe(z=>z.files),x=xe(z=>z.loadJson),b=xe(z=>z.setDraft),E=xe(z=>z.saveJson),S=xe(z=>z.revert),c=xe(z=>z.watchFile),y=xe(z=>z.unwatchFile);W.useEffect(()=>{const z=Object.values(p).filter(Boolean);return z.forEach(re=>{u[re]||x(re),c(re)}),()=>z.forEach(re=>y(re))},[JSON.stringify(p)]);const[h,v]=W.useState(null),C=_.jsx(xu,{options:[{key:"effective",label:"Effective"},{key:"events",label:"Events"},{key:"library",label:"Library"}],active:a,onChange:l}),R=W.useMemo(()=>{const z=wu(bu(u,p));return Su(z,["hooks"])??{kind:"object",children:{}}},[u,p]),L=(z,re)=>{var ee;const G=p[o];if(!G)return;v(null);const j=((ee=u[G])==null?void 0:ee.draftRaw)??"";let F={};if(j.trim())try{F=JSON.parse(j)}catch{F={}}const M=ga(F.hooks??{},z,re),U={...F,hooks:M};b(G,JSON.stringify(U,null,2)+`
121
- `)};if(!t)return _.jsx(be,{title:"loading…"});if(a==="library")return _.jsx(je,{toolbar:C,children:_.jsx($w,{})});if(o!=="user"&&!i)return _.jsx(je,{toolbar:_.jsxs(_.Fragment,{children:[C,_.jsx("span",{className:"mx-2 text-fg-faint",children:"·"}),_.jsx(gr,{scopes:["user","project","local"],active:o,onChange:d})]}),children:_.jsx(be,{title:"no active project"})});if(!m)return _.jsx(be,{title:"loading…"});const D=u[m],{full:T,hooks:A,err:I}=D?vS(D.draftRaw):{full:{},hooks:{},err:null},H=z=>{v(null),b(m,yS(T,z))},$=A[w]??[],N=()=>{H({...A,[w]:[...$,{matcher:"",hooks:[{type:"command",command:""}]}]})},J=(z,re)=>{const G=$.slice();G[z]=re,H({...A,[w]:G})},K=z=>{H({...A,[w]:$.filter((re,G)=>G!==z)})};return _.jsx(je,{toolbar:_.jsxs(_.Fragment,{children:[C,_.jsx("span",{className:"mx-2 text-fg-faint",children:"·"}),_.jsx(gr,{scopes:["user","project","local"],active:o,onChange:d}),_.jsx("span",{className:"ml-3 text-fg-faint truncate",children:a==="effective"?`overrides → ${m}`:m}),_.jsx("div",{className:"flex-1"}),_.jsx("a",{href:"https://code.claude.com/docs/en/hooks",target:"_blank",rel:"noreferrer",className:"text-fg-faint hover:text-fg-dim underline-offset-2 hover:underline",children:"hook reference ↗"})]}),footer:D?_.jsx(is,{dirty:D.dirty,busy:D.busy,parseError:h||I||D.parseError,lastSavedAt:D.lastSavedAt,onSave:async()=>{v(null);const z=await E(m);z.ok||v(z.error??"save failed")},onRevert:()=>{v(null),S(m)}}):null,children:a==="effective"?_.jsx(_u,{node:R,targetScope:o,onOverride:L,schema:ia().rootedAt(["hooks"]),rootLabel:"hooks"}):_.jsx(ya,{sidebarWidth:"14rem",sidebar:_.jsx("div",{className:"py-1",children:mS.map(z=>{const re=_S(A,z);return _.jsxs("button",{onClick:()=>g(z),className:`w-full text-left px-3 py-1 text-xs flex items-center justify-between ${w===z?"bg-bg-hi text-fg":"text-fg-dim hover:text-fg hover:bg-bg-hi"}`,children:[_.jsx("span",{className:"truncate",children:z}),re>0&&_.jsx("span",{className:"text-accent shrink-0 ml-2",children:re})]},z)})}),detail:_.jsxs("div",{className:"p-4 space-y-3 max-w-3xl",children:[_.jsxs("div",{className:"flex items-center justify-between",children:[_.jsx("h3",{className:"text-xs uppercase tracking-wider text-fg",children:w}),_.jsx("button",{onClick:N,className:"px-2 py-0.5 text-xs border border-line rounded text-fg-dim hover:text-fg hover:bg-bg-hi",children:"+ add group"})]}),$.length===0?_.jsx("div",{className:"text-fg-faint text-xs",children:"no hooks for this event"}):$.map((z,re)=>_.jsx(wS,{group:z,onChange:G=>J(re,G),onRemove:()=>K(re)},re))]})})})}function wS({group:t,onChange:s,onRemove:i}){const o=()=>s({...t,hooks:[...t.hooks??[],{type:"command",command:""}]}),d=(g,a)=>{const l=t.hooks.slice();l[g]=a,s({...t,hooks:l})},w=g=>s({...t,hooks:t.hooks.filter((a,l)=>l!==g)});return _.jsxs("div",{className:"border border-line rounded p-3 bg-bg-elev space-y-2",children:[_.jsxs("div",{className:"flex items-center gap-2",children:[_.jsx("span",{className:"text-xs text-fg-faint w-16",children:"matcher"}),_.jsx("input",{value:t.matcher??"",onChange:g=>s({...t,matcher:g.target.value}),placeholder:"tool name regex or exact match (optional)",className:"flex-1 bg-bg border border-line rounded px-2 py-0.5 text-xs text-fg font-mono"}),_.jsx("button",{onClick:i,className:"text-fg-faint hover:text-red-400 text-xs",title:"remove group",children:"× group"})]}),(t.hooks??[]).map((g,a)=>_.jsx(SS,{rule:g,onChange:l=>d(a,l),onRemove:()=>w(a)},a)),_.jsx("button",{onClick:o,className:"text-xs text-fg-faint hover:text-fg",children:"+ add hook"})]})}function SS({rule:t,onChange:s,onRemove:i}){const o=g=>({command:"e.g. node ./scripts/lint.js $FILE",http:"e.g. https://hooks.example.com/notify",prompt:"e.g. Review this change for security issues",agent:"e.g. security-reviewer"})[g],d=t.type==="command"?"command":t.type==="http"?"url":t.type==="prompt"?"prompt":"agent",w=t[d]??"";return _.jsxs("div",{className:"flex items-center gap-2",children:[_.jsx("select",{value:t.type,onChange:g=>s({type:g.target.value}),className:"bg-bg border border-line rounded px-1 py-0.5 text-xs text-fg",children:gS.map(g=>_.jsx("option",{value:g,children:g},g))}),_.jsx("input",{value:w,onChange:g=>s({...t,[d]:g.target.value}),placeholder:o(t.type),className:`flex-1 bg-bg border rounded px-2 py-0.5 text-xs text-fg font-mono ${w.trim()?"border-line":"border-yellow-600/50"}`}),_.jsx("input",{value:t.timeout??"",onChange:g=>s({...t,timeout:g.target.value?Number(g.target.value):void 0}),placeholder:"timeout ms",className:"w-20 bg-bg border border-line rounded px-2 py-0.5 text-xs text-fg"}),_.jsx("button",{onClick:i,className:"text-fg-faint hover:text-red-400 text-xs",children:"×"})]})}function bS(t,s,i){return{tabId:t,sessionUuid:i,cwd:s,path:null,todos:[],lastToolUses:[],plans:[],agents:[],usage:{inputTokens:0,outputTokens:0},lastEventAt:0}}const xt=pa((t,s)=>({tabs:{},refs:{},unsubs:{},subscribe:(i,o,d)=>{const w={...s().refs};if(w[i]=(w[i]??0)+1,t({refs:w}),w[i]>1)return;t({tabs:{...s().tabs,[i]:bS(i,o,d)}});const g=window.api.transcripts.onEvent(i,a=>s().ingest(i,a));t({unsubs:{...s().unsubs,[i]:g}}),window.api.transcripts.subscribe({tabId:i,cwd:o,sessionUuid:d}).then(async a=>{const l=s().tabs[i];if(!l)return;t({tabs:{...s().tabs,[i]:{...l,path:a.path}}});const p=await window.api.transcripts.buffer(i);for(const m of p)s().ingest(i,m)}).catch(a=>console.error("[live] transcripts.subscribe failed:",i,a))},unsubscribe:i=>{const o={...s().refs};if(!o[i])return;if(o[i]--,o[i]>0){t({refs:o});return}delete o[i];const d=s().unsubs[i];d==null||d();const w={...s().unsubs};delete w[i];const g={...s().tabs};delete g[i],window.api.transcripts.unsubscribe(i),t({refs:o,unsubs:w,tabs:g})},ingest:(i,o)=>{const d=s().tabs[i];if(!d)return;const w={...d,lastEventAt:Date.now()};switch(o.kind){case"todo_write":{const g=Array.isArray(o.data)?o.data:[];w.todos=g;break}case"tool_use":{const g=o.data;w.lastToolUses=[{id:g.id,name:g.name,input:g.input,at:Date.now()},...d.lastToolUses].slice(0,50);break}case"plan":{const g=o.data,a=typeof g=="string"?g:(g==null?void 0:g.plan)??JSON.stringify(g);w.plans=[{at:Date.now(),content:a??""},...d.plans].slice(0,20);break}case"agent_spawn":{const g=o.data;w.agents=[{at:Date.now(),subagentType:g==null?void 0:g.subagent_type,description:g==null?void 0:g.description},...d.agents].slice(0,50);break}case"usage":{const g=o.data;w.usage={inputTokens:(d.usage.inputTokens||0)+(g.input_tokens??g.inputTokens??0),outputTokens:(d.usage.outputTokens||0)+(g.output_tokens??g.outputTokens??0),cacheCreationInputTokens:(d.usage.cacheCreationInputTokens||0)+(g.cache_creation_input_tokens??g.cacheCreationInputTokens??0),cacheReadInputTokens:(d.usage.cacheReadInputTokens||0)+(g.cache_read_input_tokens??g.cacheReadInputTokens??0)};break}default:return}t({tabs:{...s().tabs,[i]:w}})}}));function CS(t,s,i){return i==="user"?`${t}/.claude/agents`:s?`${s}/.claude/agents`:null}function kS(){const t=et(),s=ns(),i=(s==null?void 0:s.cwd)??null,[o,d]=W.useState("user"),[w,g]=W.useState([]),[a,l]=W.useState(null),[p,m]=W.useState("configured"),[u,x]=W.useState(""),b=W.useMemo(()=>t?CS(t,i,o):null,[t,i,o]);W.useEffect(()=>{if(!b){g([]);return}let H=!1;return(async()=>{var $;try{const N=await window.api.config.listDir(b,{filesOnly:!0});if(H)return;const J=N.entries.filter(K=>K.name.endsWith(".md")).map(K=>({scope:o,name:K.name.replace(/\.md$/,""),path:K.path})).sort((K,z)=>K.name.localeCompare(z.name));g(J),J.find(K=>K.path===a)||l((($=J[0])==null?void 0:$.path)??null)}catch(N){console.error("[Subagents] listDir failed:",b,N),H||g([])}})(),()=>{H=!0}},[b]);const E=xe(H=>H.files),S=xe(H=>H.loadText),c=xe(H=>H.setDraft),y=xe(H=>H.saveText),h=xe(H=>H.revert),v=xe(H=>H.watchFile),C=xe(H=>H.unwatchFile);W.useEffect(()=>{if(a)return E[a]||S(a),v(a),()=>C(a)},[a]);const R=xt(H=>H.subscribe),L=xt(H=>H.unsubscribe),D=xt(H=>H.tabs);W.useEffect(()=>{if(!(p!=="live"||!s))return R(s.id,s.cwd,s.claudeSessionId),()=>L(s.id)},[p,s,R,L]);const[T,A]=W.useState(null);if(!t)return _.jsx(be,{title:"loading…"});const I=a?E[a]:null;return _.jsx(je,{toolbar:_.jsxs(_.Fragment,{children:[_.jsx("div",{className:"inline-flex rounded border border-line overflow-hidden",children:["configured","live","library"].map(H=>_.jsx("button",{onClick:()=>m(H),className:`px-2.5 py-1 text-xs ${p===H?"bg-bg-hi text-fg":"bg-bg-elev text-fg-dim hover:text-fg hover:bg-bg-hi"}`,children:H},H))}),p==="configured"&&_.jsxs(_.Fragment,{children:[_.jsx("div",{className:"ml-2",children:_.jsx(gr,{scopes:["user","project"],active:o,onChange:d})}),_.jsxs("span",{className:"ml-3 text-fg-faint",children:[w.length," agents"]})]}),_.jsx("div",{className:"flex-1"})]}),footer:p==="configured"&&a&&I?_.jsx(is,{dirty:I.dirty,busy:I.busy,parseError:T,lastSavedAt:I.lastSavedAt,onSave:async()=>{A(null);const H=await y(a);H.ok||A(H.error??"save failed")},onRevert:()=>{A(null),h(a)}}):null,children:p==="library"?_.jsx(zw,{}):p==="configured"?o==="project"&&!i?_.jsx(be,{title:"no active project"}):_.jsx(ya,{sidebar:_.jsxs("div",{className:"py-2",children:[_.jsx("div",{className:"px-2 pb-1",children:_.jsx("input",{value:u,onChange:H=>x(H.target.value),placeholder:"filter…",className:"w-full bg-bg border border-line rounded px-2 py-0.5 text-xs text-fg"})}),w.length===0?_.jsx("div",{className:"px-3 py-1 text-xs text-fg-faint italic",children:"no agents defined"}):w.filter(H=>!u||H.name.toLowerCase().includes(u.toLowerCase())).map(H=>_.jsx("button",{onClick:()=>l(H.path),className:`w-full text-left px-3 py-1 text-xs ${a===H.path?"bg-bg-hi text-fg":"text-fg-dim hover:text-fg hover:bg-bg-hi"}`,children:H.name},H.path))]}),detail:a&&I?_.jsx(Cu,{path:a,value:I.draftRaw,onChange:H=>{A(null),c(a,H)}}):_.jsx(be,{title:"select an agent"})}):s?_.jsx(ES,{tabId:s.id,live:D[s.id]}):_.jsx(be,{title:"no active session",hint:"open a terminal tab to watch live subagents"})})}function ES({tabId:t,live:s}){return s?s.agents.length===0?_.jsx(be,{title:"no subagent spawns observed yet",hint:"this updates in real-time"}):_.jsx("div",{className:"p-4 space-y-2 max-w-3xl",children:s.agents.map((i,o)=>_.jsxs("div",{className:"border border-line rounded p-3 bg-bg-elev",children:[_.jsxs("div",{className:"flex items-center justify-between mb-1",children:[_.jsx("span",{className:"text-xs font-medium text-fg",children:i.subagentType??"general-purpose"}),_.jsx("span",{className:"text-xs text-fg-faint",children:new Date(i.at).toLocaleTimeString()})]}),i.description&&_.jsx("div",{className:"text-xs text-fg-dim",children:i.description})]},o))}):_.jsx(be,{title:`waiting for transcript (tab ${t.slice(0,8)})`})}function TS(){const t=ns(),s=xt(w=>w.subscribe),i=xt(w=>w.unsubscribe),o=xt(w=>t?w.tabs[t.id]:void 0);if(W.useEffect(()=>{if(t)return s(t.id,t.cwd,t.claudeSessionId),()=>i(t.id)},[t,s,i]),!t)return _.jsx(je,{children:_.jsx(be,{title:"no active session"})});const d=(o==null?void 0:o.plans)??[];return _.jsx(je,{toolbar:_.jsxs(_.Fragment,{children:[_.jsxs("span",{className:"text-fg-faint",children:["session ",t.claudeSessionId.slice(0,8)]}),_.jsx("div",{className:"flex-1"}),_.jsxs("span",{className:"text-fg-faint",children:[d.length," plans"]})]}),children:d.length===0?_.jsx(be,{title:"no plans captured",hint:"plans appear when claude uses ExitPlanMode"}):_.jsx("div",{className:"p-4 space-y-4 max-w-4xl",children:d.map((w,g)=>_.jsxs("div",{className:"border border-line rounded p-3 bg-bg-elev",children:[_.jsx("div",{className:"text-xs text-fg-faint mb-2",children:new Date(w.at).toLocaleString()}),_.jsx("pre",{className:"text-xs text-fg-dim whitespace-pre-wrap font-mono",children:w.content})]},g))})})}function RS(){const t=ns(),s=xt(g=>g.subscribe),i=xt(g=>g.unsubscribe),o=xt(g=>t?g.tabs[t.id]:void 0);if(W.useEffect(()=>{if(t)return s(t.id,t.cwd,t.claudeSessionId),()=>i(t.id)},[t,s,i]),!t)return _.jsx(je,{children:_.jsx(be,{title:"no active session",hint:"open a terminal tab and run claude to see tasks"})});const d=(o==null?void 0:o.todos)??[],w={completed:d.filter(g=>g.status==="completed").length,in_progress:d.filter(g=>g.status==="in_progress").length,pending:d.filter(g=>g.status==="pending").length};return _.jsx(je,{toolbar:_.jsxs(_.Fragment,{children:[_.jsxs("span",{className:"text-fg-faint",children:["session ",t.claudeSessionId.slice(0,8)]}),_.jsx("div",{className:"flex-1"}),_.jsxs("span",{className:"text-fg-faint",children:[_.jsx("span",{className:"text-green-400",children:w.completed})," done ·"," ",_.jsx("span",{className:"text-accent",children:w.in_progress})," active ·"," ",_.jsx("span",{className:"text-fg-dim",children:w.pending})," pending"]})]}),children:d.length===0?_.jsx(be,{title:"no todos yet",hint:"todos appear when claude calls TodoWrite"}):_.jsx("ul",{className:"p-4 space-y-1 max-w-3xl",children:d.map((g,a)=>_.jsxs("li",{className:`flex items-start gap-3 py-1.5 px-2 rounded text-xs ${g.status==="in_progress"?"bg-bg-elev":""}`,children:[_.jsx(PS,{status:g.status}),_.jsx("span",{className:`flex-1 ${g.status==="completed"?"text-fg-faint line-through":g.status==="in_progress"?"text-fg":"text-fg-dim"}`,children:g.status==="in_progress"&&g.activeForm?g.activeForm:g.content})]},a))})})}function PS({status:t}){return t==="completed"?_.jsx("span",{className:"text-green-400 w-4 shrink-0",children:"✓"}):t==="in_progress"?_.jsx("span",{className:"text-accent w-4 shrink-0",children:_.jsx("span",{className:"inline-block w-2 h-2 rounded-full bg-accent animate-pulse"})}):_.jsx("span",{className:"text-fg-faint w-4 shrink-0",children:"○"})}function LS(t){return t.replace(/-/g,"/")}async function DS(t){const i=(await window.api.config.listDir(t,{filesOnly:!0})).entries.filter(o=>o.name.endsWith(".jsonl")).sort((o,d)=>o.size-d.size);for(const o of i){const d=await window.api.config.readText(o.path);if(!(!d.exists||!d.text)){for(const w of d.text.split(`
121
+ `)};if(!t)return _.jsx(be,{title:"loading…"});if(a==="library")return _.jsx(je,{toolbar:C,children:_.jsx($w,{})});if(o!=="user"&&!i)return _.jsx(je,{toolbar:_.jsxs(_.Fragment,{children:[C,_.jsx("span",{className:"mx-2 text-fg-faint",children:"·"}),_.jsx(gr,{scopes:["user","project","local"],active:o,onChange:d})]}),children:_.jsx(be,{title:"no active project"})});if(!m)return _.jsx(be,{title:"loading…"});const D=u[m],{full:T,hooks:A,err:I}=D?vS(D.draftRaw):{full:{},hooks:{},err:null},H=z=>{v(null),b(m,yS(T,z))},$=A[w]??[],N=()=>{H({...A,[w]:[...$,{matcher:"",hooks:[{type:"command",command:""}]}]})},J=(z,re)=>{const G=$.slice();G[z]=re,H({...A,[w]:G})},K=z=>{H({...A,[w]:$.filter((re,G)=>G!==z)})};return _.jsx(je,{toolbar:_.jsxs(_.Fragment,{children:[C,_.jsx("span",{className:"mx-2 text-fg-faint",children:"·"}),_.jsx(gr,{scopes:["user","project","local"],active:o,onChange:d}),_.jsx("span",{className:"ml-3 text-fg-faint truncate",children:a==="effective"?`overrides → ${m}`:m}),_.jsx("div",{className:"flex-1"}),_.jsx("a",{href:"https://code.claude.com/docs/en/hooks",target:"_blank",rel:"noreferrer",className:"text-fg-faint hover:text-fg-dim underline-offset-2 hover:underline",children:"hook reference ↗"})]}),footer:D?_.jsx(is,{dirty:D.dirty,busy:D.busy,parseError:h||I||D.parseError,lastSavedAt:D.lastSavedAt,onSave:async()=>{v(null);const z=await E(m);z.ok||v(z.error??"save failed")},onRevert:()=>{v(null),S(m)}}):null,children:a==="effective"?_.jsx(_u,{node:R,targetScope:o,onOverride:L,schema:ia().rootedAt(["hooks"]),rootLabel:"hooks"}):_.jsx(ya,{sidebarWidth:"14rem",sidebar:_.jsx("div",{className:"py-1",children:mS.map(z=>{const re=_S(A,z);return _.jsxs("button",{onClick:()=>g(z),className:`w-full text-left px-3 py-1 text-xs flex items-center justify-between ${w===z?"bg-bg-hi text-fg":"text-fg-dim hover:text-fg hover:bg-bg-hi"}`,children:[_.jsx("span",{className:"truncate",children:z}),re>0&&_.jsx("span",{className:"text-accent shrink-0 ml-2",children:re})]},z)})}),detail:_.jsxs("div",{className:"p-4 space-y-3 max-w-3xl",children:[_.jsxs("div",{className:"flex items-center justify-between",children:[_.jsx("h3",{className:"text-xs uppercase tracking-wider text-fg",children:w}),_.jsx("button",{onClick:N,className:"px-2 py-0.5 text-xs border border-line rounded text-fg-dim hover:text-fg hover:bg-bg-hi",children:"+ add group"})]}),$.length===0?_.jsx("div",{className:"text-fg-faint text-xs",children:"no hooks for this event"}):$.map((z,re)=>_.jsx(wS,{group:z,onChange:G=>J(re,G),onRemove:()=>K(re)},re))]})})})}function wS({group:t,onChange:s,onRemove:i}){const o=()=>s({...t,hooks:[...t.hooks??[],{type:"command",command:""}]}),d=(g,a)=>{const l=t.hooks.slice();l[g]=a,s({...t,hooks:l})},w=g=>s({...t,hooks:t.hooks.filter((a,l)=>l!==g)});return _.jsxs("div",{className:"border border-line rounded p-3 bg-bg-elev space-y-2",children:[_.jsxs("div",{className:"flex items-center gap-2",children:[_.jsx("span",{className:"text-xs text-fg-faint w-16",children:"matcher"}),_.jsx("input",{value:t.matcher??"",onChange:g=>s({...t,matcher:g.target.value}),placeholder:"tool name regex or exact match (optional)",className:"flex-1 bg-bg border border-line rounded px-2 py-0.5 text-xs text-fg font-mono"}),_.jsx("button",{onClick:i,className:"text-fg-faint hover:text-red-400 text-xs",title:"remove group",children:"× group"})]}),(t.hooks??[]).map((g,a)=>_.jsx(SS,{rule:g,onChange:l=>d(a,l),onRemove:()=>w(a)},a)),_.jsx("button",{onClick:o,className:"text-xs text-fg-faint hover:text-fg",children:"+ add hook"})]})}function SS({rule:t,onChange:s,onRemove:i}){const o=g=>({command:"e.g. node ./scripts/lint.js $FILE",http:"e.g. https://hooks.example.com/notify",prompt:"e.g. Review this change for security issues",agent:"e.g. security-reviewer"})[g],d=t.type==="command"?"command":t.type==="http"?"url":t.type==="prompt"?"prompt":"agent",w=t[d]??"";return _.jsxs("div",{className:"flex items-center gap-2",children:[_.jsx("select",{value:t.type,onChange:g=>s({type:g.target.value}),className:"bg-bg border border-line rounded px-1 py-0.5 text-xs text-fg",children:gS.map(g=>_.jsx("option",{value:g,children:g},g))}),_.jsx("input",{value:w,onChange:g=>s({...t,[d]:g.target.value}),placeholder:o(t.type),className:`flex-1 bg-bg border rounded px-2 py-0.5 text-xs text-fg font-mono ${w.trim()?"border-line":"border-yellow-600/50"}`}),_.jsx("input",{value:t.timeout??"",onChange:g=>s({...t,timeout:g.target.value?Number(g.target.value):void 0}),placeholder:"timeout ms",className:"w-20 bg-bg border border-line rounded px-2 py-0.5 text-xs text-fg"}),_.jsx("button",{onClick:i,className:"text-fg-faint hover:text-red-400 text-xs",children:"×"})]})}function bS(t,s,i){return{tabId:t,sessionUuid:i,cwd:s,path:null,todos:[],lastToolUses:[],plans:[],agents:[],usage:{inputTokens:0,outputTokens:0},lastEventAt:0}}const xt=pa((t,s)=>({tabs:{},refs:{},unsubs:{},subscribe:(i,o,d)=>{const w={...s().refs};if(w[i]=(w[i]??0)+1,t({refs:w}),w[i]>1)return;t({tabs:{...s().tabs,[i]:bS(i,o,d)}});const g=window.api.transcripts.onEvent(i,a=>s().ingest(i,a));t({unsubs:{...s().unsubs,[i]:g}}),window.api.transcripts.subscribe({tabId:i,cwd:o,sessionUuid:d}).then(async a=>{const l=s().tabs[i];if(!l)return;t({tabs:{...s().tabs,[i]:{...l,path:a.path}}});const p=await window.api.transcripts.buffer(i);for(const m of p)s().ingest(i,m,{replay:!0})}).catch(a=>console.error("[live] transcripts.subscribe failed:",i,a))},unsubscribe:i=>{const o={...s().refs};if(!o[i])return;if(o[i]--,o[i]>0){t({refs:o});return}delete o[i];const d=s().unsubs[i];d==null||d();const w={...s().unsubs};delete w[i];const g={...s().tabs};delete g[i],window.api.transcripts.unsubscribe(i),t({refs:o,unsubs:w,tabs:g})},ingest:(i,o,d)=>{const w=s().tabs[i];if(!w)return;const g={...w,lastEventAt:d!=null&&d.replay?w.lastEventAt:Date.now()};switch(o.kind){case"todo_write":{const a=Array.isArray(o.data)?o.data:[];g.todos=a;break}case"tool_use":{const a=o.data;g.lastToolUses=[{id:a.id,name:a.name,input:a.input,at:Date.now()},...w.lastToolUses].slice(0,50);break}case"plan":{const a=o.data,l=typeof a=="string"?a:(a==null?void 0:a.plan)??JSON.stringify(a);g.plans=[{at:Date.now(),content:l??""},...w.plans].slice(0,20);break}case"agent_spawn":{const a=o.data;g.agents=[{at:Date.now(),subagentType:a==null?void 0:a.subagent_type,description:a==null?void 0:a.description},...w.agents].slice(0,50);break}case"usage":{const a=o.data;g.usage={inputTokens:(w.usage.inputTokens||0)+(a.input_tokens??a.inputTokens??0),outputTokens:(w.usage.outputTokens||0)+(a.output_tokens??a.outputTokens??0),cacheCreationInputTokens:(w.usage.cacheCreationInputTokens||0)+(a.cache_creation_input_tokens??a.cacheCreationInputTokens??0),cacheReadInputTokens:(w.usage.cacheReadInputTokens||0)+(a.cache_read_input_tokens??a.cacheReadInputTokens??0)};break}default:return}t({tabs:{...s().tabs,[i]:g}})}}));function CS(t,s,i){return i==="user"?`${t}/.claude/agents`:s?`${s}/.claude/agents`:null}function kS(){const t=et(),s=ns(),i=(s==null?void 0:s.cwd)??null,[o,d]=W.useState("user"),[w,g]=W.useState([]),[a,l]=W.useState(null),[p,m]=W.useState("configured"),[u,x]=W.useState(""),b=W.useMemo(()=>t?CS(t,i,o):null,[t,i,o]);W.useEffect(()=>{if(!b){g([]);return}let H=!1;return(async()=>{var $;try{const N=await window.api.config.listDir(b,{filesOnly:!0});if(H)return;const J=N.entries.filter(K=>K.name.endsWith(".md")).map(K=>({scope:o,name:K.name.replace(/\.md$/,""),path:K.path})).sort((K,z)=>K.name.localeCompare(z.name));g(J),J.find(K=>K.path===a)||l((($=J[0])==null?void 0:$.path)??null)}catch(N){console.error("[Subagents] listDir failed:",b,N),H||g([])}})(),()=>{H=!0}},[b]);const E=xe(H=>H.files),S=xe(H=>H.loadText),c=xe(H=>H.setDraft),y=xe(H=>H.saveText),h=xe(H=>H.revert),v=xe(H=>H.watchFile),C=xe(H=>H.unwatchFile);W.useEffect(()=>{if(a)return E[a]||S(a),v(a),()=>C(a)},[a]);const R=xt(H=>H.subscribe),L=xt(H=>H.unsubscribe),D=xt(H=>H.tabs);W.useEffect(()=>{if(!(p!=="live"||!s))return R(s.id,s.cwd,s.claudeSessionId),()=>L(s.id)},[p,s,R,L]);const[T,A]=W.useState(null);if(!t)return _.jsx(be,{title:"loading…"});const I=a?E[a]:null;return _.jsx(je,{toolbar:_.jsxs(_.Fragment,{children:[_.jsx("div",{className:"inline-flex rounded border border-line overflow-hidden",children:["configured","live","library"].map(H=>_.jsx("button",{onClick:()=>m(H),className:`px-2.5 py-1 text-xs ${p===H?"bg-bg-hi text-fg":"bg-bg-elev text-fg-dim hover:text-fg hover:bg-bg-hi"}`,children:H},H))}),p==="configured"&&_.jsxs(_.Fragment,{children:[_.jsx("div",{className:"ml-2",children:_.jsx(gr,{scopes:["user","project"],active:o,onChange:d})}),_.jsxs("span",{className:"ml-3 text-fg-faint",children:[w.length," agents"]})]}),_.jsx("div",{className:"flex-1"})]}),footer:p==="configured"&&a&&I?_.jsx(is,{dirty:I.dirty,busy:I.busy,parseError:T,lastSavedAt:I.lastSavedAt,onSave:async()=>{A(null);const H=await y(a);H.ok||A(H.error??"save failed")},onRevert:()=>{A(null),h(a)}}):null,children:p==="library"?_.jsx(zw,{}):p==="configured"?o==="project"&&!i?_.jsx(be,{title:"no active project"}):_.jsx(ya,{sidebar:_.jsxs("div",{className:"py-2",children:[_.jsx("div",{className:"px-2 pb-1",children:_.jsx("input",{value:u,onChange:H=>x(H.target.value),placeholder:"filter…",className:"w-full bg-bg border border-line rounded px-2 py-0.5 text-xs text-fg"})}),w.length===0?_.jsx("div",{className:"px-3 py-1 text-xs text-fg-faint italic",children:"no agents defined"}):w.filter(H=>!u||H.name.toLowerCase().includes(u.toLowerCase())).map(H=>_.jsx("button",{onClick:()=>l(H.path),className:`w-full text-left px-3 py-1 text-xs ${a===H.path?"bg-bg-hi text-fg":"text-fg-dim hover:text-fg hover:bg-bg-hi"}`,children:H.name},H.path))]}),detail:a&&I?_.jsx(Cu,{path:a,value:I.draftRaw,onChange:H=>{A(null),c(a,H)}}):_.jsx(be,{title:"select an agent"})}):s?_.jsx(ES,{tabId:s.id,live:D[s.id]}):_.jsx(be,{title:"no active session",hint:"open a terminal tab to watch live subagents"})})}function ES({tabId:t,live:s}){return s?s.agents.length===0?_.jsx(be,{title:"no subagent spawns observed yet",hint:"this updates in real-time"}):_.jsx("div",{className:"p-4 space-y-2 max-w-3xl",children:s.agents.map((i,o)=>_.jsxs("div",{className:"border border-line rounded p-3 bg-bg-elev",children:[_.jsxs("div",{className:"flex items-center justify-between mb-1",children:[_.jsx("span",{className:"text-xs font-medium text-fg",children:i.subagentType??"general-purpose"}),_.jsx("span",{className:"text-xs text-fg-faint",children:new Date(i.at).toLocaleTimeString()})]}),i.description&&_.jsx("div",{className:"text-xs text-fg-dim",children:i.description})]},o))}):_.jsx(be,{title:`waiting for transcript (tab ${t.slice(0,8)})`})}function TS(){const t=ns(),s=xt(w=>w.subscribe),i=xt(w=>w.unsubscribe),o=xt(w=>t?w.tabs[t.id]:void 0);if(W.useEffect(()=>{if(t)return s(t.id,t.cwd,t.claudeSessionId),()=>i(t.id)},[t,s,i]),!t)return _.jsx(je,{children:_.jsx(be,{title:"no active session"})});const d=(o==null?void 0:o.plans)??[];return _.jsx(je,{toolbar:_.jsxs(_.Fragment,{children:[_.jsxs("span",{className:"text-fg-faint",children:["session ",t.claudeSessionId.slice(0,8)]}),_.jsx("div",{className:"flex-1"}),_.jsxs("span",{className:"text-fg-faint",children:[d.length," plans"]})]}),children:d.length===0?_.jsx(be,{title:"no plans captured",hint:"plans appear when claude uses ExitPlanMode"}):_.jsx("div",{className:"p-4 space-y-4 max-w-4xl",children:d.map((w,g)=>_.jsxs("div",{className:"border border-line rounded p-3 bg-bg-elev",children:[_.jsx("div",{className:"text-xs text-fg-faint mb-2",children:new Date(w.at).toLocaleString()}),_.jsx("pre",{className:"text-xs text-fg-dim whitespace-pre-wrap font-mono",children:w.content})]},g))})})}function RS(){const t=ns(),s=xt(g=>g.subscribe),i=xt(g=>g.unsubscribe),o=xt(g=>t?g.tabs[t.id]:void 0);if(W.useEffect(()=>{if(t)return s(t.id,t.cwd,t.claudeSessionId),()=>i(t.id)},[t,s,i]),!t)return _.jsx(je,{children:_.jsx(be,{title:"no active session",hint:"open a terminal tab and run claude to see tasks"})});const d=(o==null?void 0:o.todos)??[],w={completed:d.filter(g=>g.status==="completed").length,in_progress:d.filter(g=>g.status==="in_progress").length,pending:d.filter(g=>g.status==="pending").length};return _.jsx(je,{toolbar:_.jsxs(_.Fragment,{children:[_.jsxs("span",{className:"text-fg-faint",children:["session ",t.claudeSessionId.slice(0,8)]}),_.jsx("div",{className:"flex-1"}),_.jsxs("span",{className:"text-fg-faint",children:[_.jsx("span",{className:"text-green-400",children:w.completed})," done ·"," ",_.jsx("span",{className:"text-accent",children:w.in_progress})," active ·"," ",_.jsx("span",{className:"text-fg-dim",children:w.pending})," pending"]})]}),children:d.length===0?_.jsx(be,{title:"no todos yet",hint:"todos appear when claude calls TodoWrite"}):_.jsx("ul",{className:"p-4 space-y-1 max-w-3xl",children:d.map((g,a)=>_.jsxs("li",{className:`flex items-start gap-3 py-1.5 px-2 rounded text-xs ${g.status==="in_progress"?"bg-bg-elev":""}`,children:[_.jsx(PS,{status:g.status}),_.jsx("span",{className:`flex-1 ${g.status==="completed"?"text-fg-faint line-through":g.status==="in_progress"?"text-fg":"text-fg-dim"}`,children:g.status==="in_progress"&&g.activeForm?g.activeForm:g.content})]},a))})})}function PS({status:t}){return t==="completed"?_.jsx("span",{className:"text-green-400 w-4 shrink-0",children:"✓"}):t==="in_progress"?_.jsx("span",{className:"text-accent w-4 shrink-0",children:_.jsx("span",{className:"inline-block w-2 h-2 rounded-full bg-accent animate-pulse"})}):_.jsx("span",{className:"text-fg-faint w-4 shrink-0",children:"○"})}function LS(t){return t.replace(/-/g,"/")}async function DS(t){const i=(await window.api.config.listDir(t,{filesOnly:!0})).entries.filter(o=>o.name.endsWith(".jsonl")).sort((o,d)=>o.size-d.size);for(const o of i){const d=await window.api.config.readText(o.path);if(!(!d.exists||!d.text)){for(const w of d.text.split(`
122
122
  `))if(w.includes('"cwd"'))try{const g=JSON.parse(w);if(typeof g.cwd=="string"&&g.cwd.length>0)return g.cwd}catch{}}}return null}function AS(){const t=et(),[s,i]=W.useState([]),[o,d]=W.useState(!0),w=Re(l=>l.addTab);W.useEffect(()=>{if(!t)return;let l=!1;return(async()=>{d(!0);try{const p=await window.api.config.listDir(`${t}/.claude/projects`,{dirsOnly:!0});if(l)return;const m=[];for(const u of p.entries){if(l)return;const b=(await window.api.config.listDir(u.path,{filesOnly:!0})).entries.filter(S=>S.name.endsWith(".jsonl")),E=b.reduce((S,c)=>Math.max(S,c.mtimeMs),0);m.push({encoded:u.name,displayPath:LS(u.name),sessionCount:b.length,lastSession:E,path:u.path})}m.sort((u,x)=>x.lastSession-u.lastSession),l||i(m)}catch(p){console.error("[Projects] scan failed:",p)}finally{l||d(!1)}})(),()=>{l=!0}},[t]);const g=async l=>{let p=await DS(l.path);if(!p&&(p=await window.api.app.pickDirectory(),!p))return;const m=crypto.randomUUID();w({id:m,cwd:p,startupCommand:`claude --dangerously-skip-permissions --session-id ${ir(m)}`,presetId:"projects-tab"})},a=[{key:"path",header:"project",render:l=>_.jsxs("span",{className:"font-mono text-fg-dim truncate",children:["/",l.displayPath]})},{key:"count",header:"sessions",render:l=>l.sessionCount,width:"6rem"},{key:"last",header:"last active",render:l=>l.lastSession?new Date(l.lastSession).toLocaleString():"—",width:"12rem"},{key:"action",header:"",render:l=>_.jsx("button",{onClick:p=>{p.stopPropagation(),g(l)},className:"px-2 py-0.5 text-xs border border-line rounded text-fg-dim hover:text-fg hover:bg-bg-hi",children:"open"}),width:"4rem"}];return _.jsx(je,{toolbar:_.jsxs(_.Fragment,{children:[_.jsxs("span",{className:"text-fg-faint",children:[s.length," projects"]}),_.jsx("div",{className:"flex-1"}),_.jsx("span",{className:"text-fg-faint font-mono truncate",children:"~/.claude/projects/"})]}),children:o?_.jsx(be,{title:"scanning projects…"}):_.jsx(Tu,{columns:a,rows:s,getKey:l=>l.encoded,empty:"no projects with claude session history"})})}function jS(){const t=et(),[s,i]=W.useState([]),[o,d]=W.useState(!0),[w,g]=W.useState(""),a=Re(u=>u.addTab);W.useEffect(()=>{if(!t)return;let u=!1;return(async()=>{d(!0);try{const x=await window.api.config.listDir(`${t}/.claude/projects`,{dirsOnly:!0}),b=[];for(const E of x.entries){if(u)return;const S=await window.api.config.listDir(E.path,{filesOnly:!0});for(const c of S.entries)c.name.endsWith(".jsonl")&&b.push({sessionId:c.name.replace(/\.jsonl$/,""),projectEncoded:E.name,path:c.path,mtimeMs:c.mtimeMs,sizeBytes:c.size})}b.sort((E,S)=>S.mtimeMs-E.mtimeMs),u||i(b)}catch(x){console.error("[History] scan failed:",x)}finally{u||d(!1)}})(),()=>{u=!0}},[t]);const l=W.useMemo(()=>{if(!w.trim())return s;const u=w.toLowerCase();return s.filter(x=>x.sessionId.toLowerCase().includes(u)||x.projectEncoded.toLowerCase().includes(u))},[s,w]),p=async u=>{const x=await window.api.app.pickDirectory();x&&a({cwd:x,startupCommand:`claude --resume ${ir(u.sessionId)}`,presetId:"history-resume"})},m=[{key:"id",header:"session",render:u=>_.jsx("span",{className:"font-mono text-fg-dim",children:u.sessionId.slice(0,8)}),width:"7rem"},{key:"proj",header:"project",render:u=>_.jsxs("span",{className:"font-mono text-fg-faint truncate",children:["/",u.projectEncoded.replace(/-/g,"/")]})},{key:"size",header:"size",render:u=>`${Math.round(u.sizeBytes/1024)}k`,width:"5rem"},{key:"when",header:"when",render:u=>new Date(u.mtimeMs).toLocaleString(),width:"12rem"},{key:"action",header:"",render:u=>_.jsx("button",{onClick:x=>{x.stopPropagation(),p(u)},className:"px-2 py-0.5 text-xs border border-line rounded text-fg-dim hover:text-fg hover:bg-bg-hi",children:"resume"}),width:"5rem"}];return _.jsx(je,{toolbar:_.jsxs(_.Fragment,{children:[_.jsx("input",{value:w,onChange:u=>g(u.target.value),placeholder:"filter by id or project",className:"bg-bg-elev border border-line rounded px-2 py-1 text-xs text-fg placeholder-fg-faint w-64"}),_.jsxs("span",{className:"ml-2 text-fg-faint",children:[l.length,"/",s.length]}),_.jsx("div",{className:"flex-1"})]}),children:o?_.jsx(be,{title:"scanning transcripts…"}):_.jsx(Tu,{columns:m,rows:l,getKey:u=>u.path,empty:"no session transcripts found"})})}const Sp={"opus-4.6":{input:5,output:25},"sonnet-4.6":{input:3,output:15},"haiku-4.5":{input:1,output:5}};function MS(){const t=ns(),s=xt(x=>x.subscribe),i=xt(x=>x.unsubscribe),o=xt(x=>t?x.tabs[t.id]:void 0),[d,w]=W.useState("opus-4.6"),[g,a]=W.useState(()=>{try{const x=localStorage.getItem("sm:pricing");if(x)return{...Sp,...JSON.parse(x)}}catch{}return Sp}),l=x=>{a(x);try{localStorage.setItem("sm:pricing",JSON.stringify(x))}catch{}};if(W.useEffect(()=>{if(t)return s(t.id,t.cwd,t.claudeSessionId),()=>i(t.id)},[t,s,i]),!t)return _.jsx(je,{children:_.jsx(be,{title:"no active session"})});const p=(o==null?void 0:o.usage)??{inputTokens:0,outputTokens:0},m=g[d],u=p.inputTokens*m.input/1e6+p.outputTokens*m.output/1e6;return _.jsx(je,{toolbar:_.jsxs(_.Fragment,{children:[_.jsxs("span",{className:"text-fg-faint",children:["session ",t.claudeSessionId.slice(0,8)]}),_.jsx("div",{className:"flex-1"}),_.jsxs("label",{className:"text-fg-faint flex items-center gap-2",children:["model",_.jsx("select",{value:d,onChange:x=>w(x.target.value),className:"bg-bg-elev border border-line rounded px-2 py-0.5 text-xs text-fg",children:Object.keys(g).map(x=>_.jsx("option",{value:x,children:x},x))})]})]}),children:_.jsxs("div",{className:"p-6 max-w-2xl space-y-6",children:[_.jsxs("section",{className:"grid grid-cols-2 gap-4",children:[_.jsx(rn,{label:"input tokens",value:p.inputTokens.toLocaleString()}),_.jsx(rn,{label:"output tokens",value:p.outputTokens.toLocaleString()}),p.cacheCreationInputTokens!=null&&_.jsx(rn,{label:"cache creation",value:p.cacheCreationInputTokens.toLocaleString()}),p.cacheReadInputTokens!=null&&_.jsx(rn,{label:"cache read",value:p.cacheReadInputTokens.toLocaleString()}),_.jsx(rn,{label:"estimated cost",value:`$${u.toFixed(4)}`,highlight:!0})]}),_.jsxs("section",{children:[_.jsx("h3",{className:"text-xs uppercase tracking-wider text-fg mb-2",children:"Pricing ($/MTok)"}),_.jsxs("table",{className:"text-xs",children:[_.jsx("thead",{className:"text-fg-faint",children:_.jsxs("tr",{children:[_.jsx("th",{className:"text-left px-2 py-1",children:"model"}),_.jsx("th",{className:"text-left px-2 py-1",children:"input"}),_.jsx("th",{className:"text-left px-2 py-1",children:"output"})]})}),_.jsx("tbody",{children:Object.entries(g).map(([x,b])=>_.jsxs("tr",{className:"border-t border-line",children:[_.jsx("td",{className:"px-2 py-1 text-fg-dim",children:x}),_.jsx("td",{className:"px-2 py-1",children:_.jsx("input",{type:"number",step:"0.1",value:b.input,onChange:E=>l({...g,[x]:{...b,input:Number(E.target.value)}}),className:"w-16 bg-bg-elev border border-line rounded px-1 py-0.5 text-fg"})}),_.jsx("td",{className:"px-2 py-1",children:_.jsx("input",{type:"number",step:"0.1",value:b.output,onChange:E=>l({...g,[x]:{...b,output:Number(E.target.value)}}),className:"w-16 bg-bg-elev border border-line rounded px-1 py-0.5 text-fg"})})]},x))})]}),_.jsx("div",{className:"mt-2 text-fg-faint text-xs",children:"edits are saved locally and persist across sessions."})]})]})})}function rn({label:t,value:s,highlight:i}){return _.jsxs("div",{className:"border border-line rounded p-3 bg-bg-elev",children:[_.jsx("div",{className:"text-xs text-fg-faint uppercase tracking-wider mb-1",children:t}),_.jsx("div",{className:`text-lg font-mono ${i?"text-accent":"text-fg"}`,children:s})]})}const Ru=W.createContext({});function Pu(t){const s=W.useRef(null);return s.current===null&&(s.current=t()),s.current}const OS=typeof window<"u",pg=OS?W.useLayoutEffect:W.useEffect,_a=W.createContext(null);function Lu(t,s){t.indexOf(s)===-1&&t.push(s)}function na(t,s){const i=t.indexOf(s);i>-1&&t.splice(i,1)}const vr=(t,s,i)=>i>s?s:i<t?t:i;let Du=()=>{};const rs={},mg=t=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(t);function gg(t){return typeof t=="object"&&t!==null}const vg=t=>/^0[^.\s]+$/u.test(t);function yg(t){let s;return()=>(s===void 0&&(s=t()),s)}const Kt=t=>t,IS=(t,s)=>i=>s(t(i)),xn=(...t)=>t.reduce(IS),mn=(t,s,i)=>{const o=s-t;return o===0?1:(i-t)/o};class Au{constructor(){this.subscriptions=[]}add(s){return Lu(this.subscriptions,s),()=>na(this.subscriptions,s)}notify(s,i,o){const d=this.subscriptions.length;if(d)if(d===1)this.subscriptions[0](s,i,o);else for(let w=0;w<d;w++){const g=this.subscriptions[w];g&&g(s,i,o)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const It=t=>t*1e3,zt=t=>t/1e3;function _g(t,s){return s?t*(1e3/s):0}const xg=(t,s,i)=>(((1-3*i+3*s)*t+(3*i-6*s))*t+3*s)*t,NS=1e-7,BS=12;function FS(t,s,i,o,d){let w,g,a=0;do g=s+(i-s)/2,w=xg(g,o,d)-t,w>0?i=g:s=g;while(Math.abs(w)>NS&&++a<BS);return g}function wn(t,s,i,o){if(t===s&&i===o)return Kt;const d=w=>FS(w,0,1,t,i);return w=>w===0||w===1?w:xg(d(w),s,o)}const wg=t=>s=>s<=.5?t(2*s)/2:(2-t(2*(1-s)))/2,Sg=t=>s=>1-t(1-s),bg=wn(.33,1.53,.69,.99),ju=Sg(bg),Cg=wg(ju),kg=t=>t>=1?1:(t*=2)<1?.5*ju(t):.5*(2-Math.pow(2,-10*(t-1))),Mu=t=>1-Math.sin(Math.acos(t)),Eg=Sg(Mu),Tg=wg(Mu),HS=wn(.42,0,1,1),US=wn(0,0,.58,1),Rg=wn(.42,0,.58,1),WS=t=>Array.isArray(t)&&typeof t[0]!="number",Pg=t=>Array.isArray(t)&&typeof t[0]=="number",VS={linear:Kt,easeIn:HS,easeInOut:Rg,easeOut:US,circIn:Mu,circInOut:Tg,circOut:Eg,backIn:ju,backInOut:Cg,backOut:bg,anticipate:kg},$S=t=>typeof t=="string",bp=t=>{if(Pg(t)){Du(t.length===4);const[s,i,o,d]=t;return wn(s,i,o,d)}else if($S(t))return VS[t];return t},Fo=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function zS(t,s){let i=new Set,o=new Set,d=!1,w=!1;const g=new WeakSet;let a={delta:0,timestamp:0,isProcessing:!1};function l(m){g.has(m)&&(p.schedule(m),t()),m(a)}const p={schedule:(m,u=!1,x=!1)=>{const E=x&&d?i:o;return u&&g.add(m),E.add(m),m},cancel:m=>{o.delete(m),g.delete(m)},process:m=>{if(a=m,d){w=!0;return}d=!0;const u=i;i=o,o=u,i.forEach(l),i.clear(),d=!1,w&&(w=!1,p.process(m))}};return p}const KS=40;function Lg(t,s){let i=!1,o=!0;const d={delta:0,timestamp:0,isProcessing:!1},w=()=>i=!0,g=Fo.reduce((v,C)=>(v[C]=zS(w),v),{}),{setup:a,read:l,resolveKeyframes:p,preUpdate:m,update:u,preRender:x,render:b,postRender:E}=g,S=()=>{const v=rs.useManualTiming,C=v?d.timestamp:performance.now();i=!1,v||(d.delta=o?1e3/60:Math.max(Math.min(C-d.timestamp,KS),1)),d.timestamp=C,d.isProcessing=!0,a.process(d),l.process(d),p.process(d),m.process(d),u.process(d),x.process(d),b.process(d),E.process(d),d.isProcessing=!1,i&&s&&(o=!1,t(S))},c=()=>{i=!0,o=!0,d.isProcessing||t(S)};return{schedule:Fo.reduce((v,C)=>{const R=g[C];return v[C]=(L,D=!1,T=!1)=>(i||c(),R.schedule(L,D,T)),v},{}),cancel:v=>{for(let C=0;C<Fo.length;C++)g[Fo[C]].cancel(v)},state:d,steps:g}}const{schedule:Ae,cancel:ss,state:at,steps:Lc}=Lg(typeof requestAnimationFrame<"u"?requestAnimationFrame:Kt,!0);let Ko;function qS(){Ko=void 0}const yt={now:()=>(Ko===void 0&&yt.set(at.isProcessing||rs.useManualTiming?at.timestamp:performance.now()),Ko),set:t=>{Ko=t,queueMicrotask(qS)}},Dg=t=>s=>typeof s=="string"&&s.startsWith(t),Ag=Dg("--"),GS=Dg("var(--"),Ou=t=>GS(t)?XS.test(t.split("/*")[0].trim()):!1,XS=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function Cp(t){return typeof t!="string"?!1:t.split("/*")[0].includes("var(--")}const mi={test:t=>typeof t=="number",parse:parseFloat,transform:t=>t},gn={...mi,transform:t=>vr(0,1,t)},Ho={...mi,default:1},cn=t=>Math.round(t*1e5)/1e5,Iu=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function JS(t){return t==null}const YS=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,Nu=(t,s)=>i=>!!(typeof i=="string"&&YS.test(i)&&i.startsWith(t)||s&&!JS(i)&&Object.prototype.hasOwnProperty.call(i,s)),jg=(t,s,i)=>o=>{if(typeof o!="string")return o;const[d,w,g,a]=o.match(Iu);return{[t]:parseFloat(d),[s]:parseFloat(w),[i]:parseFloat(g),alpha:a!==void 0?parseFloat(a):1}},QS=t=>vr(0,255,t),Dc={...mi,transform:t=>Math.round(QS(t))},Ts={test:Nu("rgb","red"),parse:jg("red","green","blue"),transform:({red:t,green:s,blue:i,alpha:o=1})=>"rgba("+Dc.transform(t)+", "+Dc.transform(s)+", "+Dc.transform(i)+", "+cn(gn.transform(o))+")"};function ZS(t){let s="",i="",o="",d="";return t.length>5?(s=t.substring(1,3),i=t.substring(3,5),o=t.substring(5,7),d=t.substring(7,9)):(s=t.substring(1,2),i=t.substring(2,3),o=t.substring(3,4),d=t.substring(4,5),s+=s,i+=i,o+=o,d+=d),{red:parseInt(s,16),green:parseInt(i,16),blue:parseInt(o,16),alpha:d?parseInt(d,16)/255:1}}const Gc={test:Nu("#"),parse:ZS,transform:Ts.transform},Sn=t=>({test:s=>typeof s=="string"&&s.endsWith(t)&&s.split(" ").length===1,parse:parseFloat,transform:s=>`${s}${t}`}),Qr=Sn("deg"),mr=Sn("%"),ve=Sn("px"),eb=Sn("vh"),tb=Sn("vw"),kp={...mr,parse:t=>mr.parse(t)/100,transform:t=>mr.transform(t*100)},oi={test:Nu("hsl","hue"),parse:jg("hue","saturation","lightness"),transform:({hue:t,saturation:s,lightness:i,alpha:o=1})=>"hsla("+Math.round(t)+", "+mr.transform(cn(s))+", "+mr.transform(cn(i))+", "+cn(gn.transform(o))+")"},Je={test:t=>Ts.test(t)||Gc.test(t)||oi.test(t),parse:t=>Ts.test(t)?Ts.parse(t):oi.test(t)?oi.parse(t):Gc.parse(t),transform:t=>typeof t=="string"?t:t.hasOwnProperty("red")?Ts.transform(t):oi.transform(t),getAnimatableNone:t=>{const s=Je.parse(t);return s.alpha=0,Je.transform(s)}},rb=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function sb(t){var s,i;return isNaN(t)&&typeof t=="string"&&(((s=t.match(Iu))==null?void 0:s.length)||0)+(((i=t.match(rb))==null?void 0:i.length)||0)>0}const Mg="number",Og="color",ib="var",nb="var(",Ep="${}",ob=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function hi(t){const s=t.toString(),i=[],o={color:[],number:[],var:[]},d=[];let w=0;const a=s.replace(ob,l=>(Je.test(l)?(o.color.push(w),d.push(Og),i.push(Je.parse(l))):l.startsWith(nb)?(o.var.push(w),d.push(ib),i.push(l)):(o.number.push(w),d.push(Mg),i.push(parseFloat(l))),++w,Ep)).split(Ep);return{values:i,split:a,indexes:o,types:d}}function ab(t){return hi(t).values}function Ig({split:t,types:s}){const i=t.length;return o=>{let d="";for(let w=0;w<i;w++)if(d+=t[w],o[w]!==void 0){const g=s[w];g===Mg?d+=cn(o[w]):g===Og?d+=Je.transform(o[w]):d+=o[w]}return d}}function lb(t){return Ig(hi(t))}const cb=t=>typeof t=="number"?0:Je.test(t)?Je.getAnimatableNone(t):t,ub=(t,s)=>typeof t=="number"?s!=null&&s.trim().endsWith("/")?t:0:cb(t);function db(t){const s=hi(t);return Ig(s)(s.values.map((o,d)=>ub(o,s.split[d])))}const sr={test:sb,parse:ab,createTransformer:lb,getAnimatableNone:db};function Ac(t,s,i){return i<0&&(i+=1),i>1&&(i-=1),i<1/6?t+(s-t)*6*i:i<1/2?s:i<2/3?t+(s-t)*(2/3-i)*6:t}function hb({hue:t,saturation:s,lightness:i,alpha:o}){t/=360,s/=100,i/=100;let d=0,w=0,g=0;if(!s)d=w=g=i;else{const a=i<.5?i*(1+s):i+s-i*s,l=2*i-a;d=Ac(l,a,t+1/3),w=Ac(l,a,t),g=Ac(l,a,t-1/3)}return{red:Math.round(d*255),green:Math.round(w*255),blue:Math.round(g*255),alpha:o}}function oa(t,s){return i=>i>0?s:t}const Ue=(t,s,i)=>t+(s-t)*i,jc=(t,s,i)=>{const o=t*t,d=i*(s*s-o)+o;return d<0?0:Math.sqrt(d)},fb=[Gc,Ts,oi],pb=t=>fb.find(s=>s.test(t));function Tp(t){const s=pb(t);if(!s)return!1;let i=s.parse(t);return s===oi&&(i=hb(i)),i}const Rp=(t,s)=>{const i=Tp(t),o=Tp(s);if(!i||!o)return oa(t,s);const d={...i};return w=>(d.red=jc(i.red,o.red,w),d.green=jc(i.green,o.green,w),d.blue=jc(i.blue,o.blue,w),d.alpha=Ue(i.alpha,o.alpha,w),Ts.transform(d))},Xc=new Set(["none","hidden"]);function mb(t,s){return Xc.has(t)?i=>i<=0?t:s:i=>i>=1?s:t}function gb(t,s){return i=>Ue(t,s,i)}function Bu(t){return typeof t=="number"?gb:typeof t=="string"?Ou(t)?oa:Je.test(t)?Rp:_b:Array.isArray(t)?Ng:typeof t=="object"?Je.test(t)?Rp:vb:oa}function Ng(t,s){const i=[...t],o=i.length,d=t.map((w,g)=>Bu(w)(w,s[g]));return w=>{for(let g=0;g<o;g++)i[g]=d[g](w);return i}}function vb(t,s){const i={...t,...s},o={};for(const d in i)t[d]!==void 0&&s[d]!==void 0&&(o[d]=Bu(t[d])(t[d],s[d]));return d=>{for(const w in o)i[w]=o[w](d);return i}}function yb(t,s){const i=[],o={color:0,var:0,number:0};for(let d=0;d<s.values.length;d++){const w=s.types[d],g=t.indexes[w][o[w]],a=t.values[g]??0;i[d]=a,o[w]++}return i}const _b=(t,s)=>{const i=sr.createTransformer(s),o=hi(t),d=hi(s);return o.indexes.var.length===d.indexes.var.length&&o.indexes.color.length===d.indexes.color.length&&o.indexes.number.length>=d.indexes.number.length?Xc.has(t)&&!d.values.length||Xc.has(s)&&!o.values.length?mb(t,s):xn(Ng(yb(o,d),d.values),i):oa(t,s)};function Bg(t,s,i){return typeof t=="number"&&typeof s=="number"&&typeof i=="number"?Ue(t,s,i):Bu(t)(t,s)}const xb=t=>{const s=({timestamp:i})=>t(i);return{start:(i=!0)=>Ae.update(s,i),stop:()=>ss(s),now:()=>at.isProcessing?at.timestamp:yt.now()}},Fg=(t,s,i=10)=>{let o="";const d=Math.max(Math.round(s/i),2);for(let w=0;w<d;w++)o+=Math.round(t(w/(d-1))*1e4)/1e4+", ";return`linear(${o.substring(0,o.length-2)})`},aa=2e4;function Fu(t){let s=0;const i=50;let o=t.next(s);for(;!o.done&&s<aa;)s+=i,o=t.next(s);return s>=aa?1/0:s}function wb(t,s=100,i){const o=i({...t,keyframes:[0,s]}),d=Math.min(Fu(o),aa);return{type:"keyframes",ease:w=>o.next(d*w).value/s,duration:zt(d)}}const Ke={stiffness:100,damping:10,mass:1,velocity:0,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05,maxDamping:1};function Jc(t,s){return t*Math.sqrt(1-s*s)}const Sb=12;function bb(t,s,i){let o=i;for(let d=1;d<Sb;d++)o=o-t(o)/s(o);return o}const Mc=.001;function Cb({duration:t=Ke.duration,bounce:s=Ke.bounce,velocity:i=Ke.velocity,mass:o=Ke.mass}){let d,w,g=1-s;g=vr(Ke.minDamping,Ke.maxDamping,g),t=vr(Ke.minDuration,Ke.maxDuration,zt(t)),g<1?(d=p=>{const m=p*g,u=m*t,x=m-i,b=Jc(p,g),E=Math.exp(-u);return Mc-x/b*E},w=p=>{const u=p*g*t,x=u*i+i,b=Math.pow(g,2)*Math.pow(p,2)*t,E=Math.exp(-u),S=Jc(Math.pow(p,2),g);return(-d(p)+Mc>0?-1:1)*((x-b)*E)/S}):(d=p=>{const m=Math.exp(-p*t),u=(p-i)*t+1;return-Mc+m*u},w=p=>{const m=Math.exp(-p*t),u=(i-p)*(t*t);return m*u});const a=5/t,l=bb(d,w,a);if(t=It(t),isNaN(l))return{stiffness:Ke.stiffness,damping:Ke.damping,duration:t};{const p=Math.pow(l,2)*o;return{stiffness:p,damping:g*2*Math.sqrt(o*p),duration:t}}}const kb=["duration","bounce"],Eb=["stiffness","damping","mass"];function Pp(t,s){return s.some(i=>t[i]!==void 0)}function Tb(t){let s={velocity:Ke.velocity,stiffness:Ke.stiffness,damping:Ke.damping,mass:Ke.mass,isResolvedFromDuration:!1,...t};if(!Pp(t,Eb)&&Pp(t,kb))if(s.velocity=0,t.visualDuration){const i=t.visualDuration,o=2*Math.PI/(i*1.2),d=o*o,w=2*vr(.05,1,1-(t.bounce||0))*Math.sqrt(d);s={...s,mass:Ke.mass,stiffness:d,damping:w}}else{const i=Cb({...t,velocity:0});s={...s,...i,mass:Ke.mass},s.isResolvedFromDuration=!0}return s}function la(t=Ke.visualDuration,s=Ke.bounce){const i=typeof t!="object"?{visualDuration:t,keyframes:[0,1],bounce:s}:t;let{restSpeed:o,restDelta:d}=i;const w=i.keyframes[0],g=i.keyframes[i.keyframes.length-1],a={done:!1,value:w},{stiffness:l,damping:p,mass:m,duration:u,velocity:x,isResolvedFromDuration:b}=Tb({...i,velocity:-zt(i.velocity||0)}),E=x||0,S=p/(2*Math.sqrt(l*m)),c=g-w,y=zt(Math.sqrt(l/m)),h=Math.abs(c)<5;o||(o=h?Ke.restSpeed.granular:Ke.restSpeed.default),d||(d=h?Ke.restDelta.granular:Ke.restDelta.default);let v,C,R,L,D,T;if(S<1)R=Jc(y,S),L=(E+S*y*c)/R,v=I=>{const H=Math.exp(-S*y*I);return g-H*(L*Math.sin(R*I)+c*Math.cos(R*I))},D=S*y*L+c*R,T=S*y*c-L*R,C=I=>Math.exp(-S*y*I)*(D*Math.sin(R*I)+T*Math.cos(R*I));else if(S===1){v=H=>g-Math.exp(-y*H)*(c+(E+y*c)*H);const I=E+y*c;C=H=>Math.exp(-y*H)*(y*I*H-E)}else{const I=y*Math.sqrt(S*S-1);v=J=>{const K=Math.exp(-S*y*J),z=Math.min(I*J,300);return g-K*((E+S*y*c)*Math.sinh(z)+I*c*Math.cosh(z))/I};const H=(E+S*y*c)/I,$=S*y*H-c*I,N=S*y*c-H*I;C=J=>{const K=Math.exp(-S*y*J),z=Math.min(I*J,300);return K*($*Math.sinh(z)+N*Math.cosh(z))}}const A={calculatedDuration:b&&u||null,velocity:I=>It(C(I)),next:I=>{if(!b&&S<1){const $=Math.exp(-S*y*I),N=Math.sin(R*I),J=Math.cos(R*I),K=g-$*(L*N+c*J),z=It($*(D*N+T*J));return a.done=Math.abs(z)<=o&&Math.abs(g-K)<=d,a.value=a.done?g:K,a}const H=v(I);if(b)a.done=I>=u;else{const $=It(C(I));a.done=Math.abs($)<=o&&Math.abs(g-H)<=d}return a.value=a.done?g:H,a},toString:()=>{const I=Math.min(Fu(A),aa),H=Fg($=>A.next(I*$).value,I,30);return I+"ms "+H},toTransition:()=>{}};return A}la.applyToOptions=t=>{const s=wb(t,100,la);return t.ease=s.ease,t.duration=It(s.duration),t.type="keyframes",t};const Rb=5;function Hg(t,s,i){const o=Math.max(s-Rb,0);return _g(i-t(o),s-o)}function Yc({keyframes:t,velocity:s=0,power:i=.8,timeConstant:o=325,bounceDamping:d=10,bounceStiffness:w=500,modifyTarget:g,min:a,max:l,restDelta:p=.5,restSpeed:m}){const u=t[0],x={done:!1,value:u},b=T=>a!==void 0&&T<a||l!==void 0&&T>l,E=T=>a===void 0?l:l===void 0||Math.abs(a-T)<Math.abs(l-T)?a:l;let S=i*s;const c=u+S,y=g===void 0?c:g(c);y!==c&&(S=y-u);const h=T=>-S*Math.exp(-T/o),v=T=>y+h(T),C=T=>{const A=h(T),I=v(T);x.done=Math.abs(A)<=p,x.value=x.done?y:I};let R,L;const D=T=>{b(x.value)&&(R=T,L=la({keyframes:[x.value,E(x.value)],velocity:Hg(v,T,x.value),damping:d,stiffness:w,restDelta:p,restSpeed:m}))};return D(0),{calculatedDuration:null,next:T=>{let A=!1;return!L&&R===void 0&&(A=!0,C(T),D(T)),R!==void 0&&T>=R?L.next(T-R):(!A&&C(T),x)}}}function Pb(t,s,i){const o=[],d=i||rs.mix||Bg,w=t.length-1;for(let g=0;g<w;g++){let a=d(t[g],t[g+1]);if(s){const l=Array.isArray(s)?s[g]||Kt:s;a=xn(l,a)}o.push(a)}return o}function Lb(t,s,{clamp:i=!0,ease:o,mixer:d}={}){const w=t.length;if(Du(w===s.length),w===1)return()=>s[0];if(w===2&&s[0]===s[1])return()=>s[1];const g=t[0]===t[1];t[0]>t[w-1]&&(t=[...t].reverse(),s=[...s].reverse());const a=Pb(s,o,d),l=a.length,p=m=>{if(g&&m<t[0])return s[0];let u=0;if(l>1)for(;u<t.length-2&&!(m<t[u+1]);u++);const x=mn(t[u],t[u+1],m);return a[u](x)};return i?m=>p(vr(t[0],t[w-1],m)):p}function Db(t,s){const i=t[t.length-1];for(let o=1;o<=s;o++){const d=mn(0,s,o);t.push(Ue(i,1,d))}}function Ab(t){const s=[0];return Db(s,t.length-1),s}function jb(t,s){return t.map(i=>i*s)}function Mb(t,s){return t.map(()=>s||Rg).splice(0,t.length-1)}function un({duration:t=300,keyframes:s,times:i,ease:o="easeInOut"}){const d=WS(o)?o.map(bp):bp(o),w={done:!1,value:s[0]},g=jb(i&&i.length===s.length?i:Ab(s),t),a=Lb(g,s,{ease:Array.isArray(d)?d:Mb(s,d)});return{calculatedDuration:t,next:l=>(w.value=a(l),w.done=l>=t,w)}}const Ob=t=>t!==null;function xa(t,{repeat:s,repeatType:i="loop"},o,d=1){const w=t.filter(Ob),a=d<0||s&&i!=="loop"&&s%2===1?0:w.length-1;return!a||o===void 0?w[a]:o}const Ib={decay:Yc,inertia:Yc,tween:un,keyframes:un,spring:la};function Ug(t){typeof t.type=="string"&&(t.type=Ib[t.type])}class Hu{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(s=>{this.resolve=s})}notifyFinished(){this.resolve()}then(s,i){return this.finished.then(s,i)}}const Nb=t=>t/100;class ca extends Hu{constructor(s){super(),this.state="idle",this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.delayState={done:!1,value:void 0},this.stop=()=>{var o,d;const{motionValue:i}=this.options;i&&i.updatedAt!==yt.now()&&this.tick(yt.now()),this.isStopped=!0,this.state!=="idle"&&(this.teardown(),(d=(o=this.options).onStop)==null||d.call(o))},this.options=s,this.initAnimation(),this.play(),s.autoplay===!1&&this.pause()}initAnimation(){const{options:s}=this;Ug(s);const{type:i=un,repeat:o=0,repeatDelay:d=0,repeatType:w,velocity:g=0}=s;let{keyframes:a}=s;const l=i||un;l!==un&&typeof a[0]!="number"&&(this.mixKeyframes=xn(Nb,Bg(a[0],a[1])),a=[0,100]);const p=l({...s,keyframes:a});w==="mirror"&&(this.mirroredGenerator=l({...s,keyframes:[...a].reverse(),velocity:-g})),p.calculatedDuration===null&&(p.calculatedDuration=Fu(p));const{calculatedDuration:m}=p;this.calculatedDuration=m,this.resolvedDuration=m+d,this.totalDuration=this.resolvedDuration*(o+1)-d,this.generator=p}updateTime(s){const i=Math.round(s-this.startTime)*this.playbackSpeed;this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=i}tick(s,i=!1){const{generator:o,totalDuration:d,mixKeyframes:w,mirroredGenerator:g,resolvedDuration:a,calculatedDuration:l}=this;if(this.startTime===null)return o.next(0);const{delay:p=0,keyframes:m,repeat:u,repeatType:x,repeatDelay:b,type:E,onUpdate:S,finalKeyframe:c}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,s):this.speed<0&&(this.startTime=Math.min(s-d/this.speed,this.startTime)),i?this.currentTime=s:this.updateTime(s);const y=this.currentTime-p*(this.playbackSpeed>=0?1:-1),h=this.playbackSpeed>=0?y<0:y>d;this.currentTime=Math.max(y,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=d);let v=this.currentTime,C=o;if(u){const T=Math.min(this.currentTime,d)/a;let A=Math.floor(T),I=T%1;!I&&T>=1&&(I=1),I===1&&A--,A=Math.min(A,u+1),!!(A%2)&&(x==="reverse"?(I=1-I,b&&(I-=b/a)):x==="mirror"&&(C=g)),v=vr(0,1,I)*a}let R;h?(this.delayState.value=m[0],R=this.delayState):R=C.next(v),w&&!h&&(R.value=w(R.value));let{done:L}=R;!h&&l!==null&&(L=this.playbackSpeed>=0?this.currentTime>=d:this.currentTime<=0);const D=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&L);return D&&E!==Yc&&(R.value=xa(m,this.options,c,this.speed)),S&&S(R.value),D&&this.finish(),R}then(s,i){return this.finished.then(s,i)}get duration(){return zt(this.calculatedDuration)}get iterationDuration(){const{delay:s=0}=this.options||{};return this.duration+zt(s)}get time(){return zt(this.currentTime)}set time(s){s=It(s),this.currentTime=s,this.startTime===null||this.holdTime!==null||this.playbackSpeed===0?this.holdTime=s:this.driver&&(this.startTime=this.driver.now()-s/this.playbackSpeed),this.driver?this.driver.start(!1):(this.startTime=0,this.state="paused",this.holdTime=s,this.tick(s))}getGeneratorVelocity(){const s=this.currentTime;if(s<=0)return this.options.velocity||0;if(this.generator.velocity)return this.generator.velocity(s);const i=this.generator.next(s).value;return Hg(o=>this.generator.next(o).value,s,i)}get speed(){return this.playbackSpeed}set speed(s){const i=this.playbackSpeed!==s;i&&this.driver&&this.updateTime(yt.now()),this.playbackSpeed=s,i&&this.driver&&(this.time=zt(this.currentTime))}play(){var d,w;if(this.isStopped)return;const{driver:s=xb,startTime:i}=this.options;this.driver||(this.driver=s(g=>this.tick(g))),(w=(d=this.options).onPlay)==null||w.call(d);const o=this.driver.now();this.state==="finished"?(this.updateFinished(),this.startTime=o):this.holdTime!==null?this.startTime=o-this.holdTime:this.startTime||(this.startTime=i??o),this.state==="finished"&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state="running",this.driver.start()}pause(){this.state="paused",this.updateTime(yt.now()),this.holdTime=this.currentTime}complete(){this.state!=="running"&&this.play(),this.state="finished",this.holdTime=null}finish(){var s,i;this.notifyFinished(),this.teardown(),this.state="finished",(i=(s=this.options).onComplete)==null||i.call(s)}cancel(){var s,i;this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),(i=(s=this.options).onCancel)==null||i.call(s)}teardown(){this.state="idle",this.stopDriver(),this.startTime=this.holdTime=null}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(s){return this.startTime=0,this.tick(s,!0)}attachTimeline(s){var i;return this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear",this.initAnimation()),(i=this.driver)==null||i.stop(),s.observe(this)}}function Bb(t){for(let s=1;s<t.length;s++)t[s]??(t[s]=t[s-1])}const Rs=t=>t*180/Math.PI,Qc=t=>{const s=Rs(Math.atan2(t[1],t[0]));return Zc(s)},Fb={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:t=>(Math.abs(t[0])+Math.abs(t[3]))/2,rotate:Qc,rotateZ:Qc,skewX:t=>Rs(Math.atan(t[1])),skewY:t=>Rs(Math.atan(t[2])),skew:t=>(Math.abs(t[1])+Math.abs(t[2]))/2},Zc=t=>(t=t%360,t<0&&(t+=360),t),Lp=Qc,Dp=t=>Math.sqrt(t[0]*t[0]+t[1]*t[1]),Ap=t=>Math.sqrt(t[4]*t[4]+t[5]*t[5]),Hb={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:Dp,scaleY:Ap,scale:t=>(Dp(t)+Ap(t))/2,rotateX:t=>Zc(Rs(Math.atan2(t[6],t[5]))),rotateY:t=>Zc(Rs(Math.atan2(-t[2],t[0]))),rotateZ:Lp,rotate:Lp,skewX:t=>Rs(Math.atan(t[4])),skewY:t=>Rs(Math.atan(t[1])),skew:t=>(Math.abs(t[1])+Math.abs(t[4]))/2};function eu(t){return t.includes("scale")?1:0}function tu(t,s){if(!t||t==="none")return eu(s);const i=t.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let o,d;if(i)o=Hb,d=i;else{const a=t.match(/^matrix\(([-\d.e\s,]+)\)$/u);o=Fb,d=a}if(!d)return eu(s);const w=o[s],g=d[1].split(",").map(Wb);return typeof w=="function"?w(g):g[w]}const Ub=(t,s)=>{const{transform:i="none"}=getComputedStyle(t);return tu(i,s)};function Wb(t){return parseFloat(t.trim())}const gi=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],vi=new Set(gi),jp=t=>t===mi||t===ve,Vb=new Set(["x","y","z"]),$b=gi.filter(t=>!Vb.has(t));function zb(t){const s=[];return $b.forEach(i=>{const o=t.getValue(i);o!==void 0&&(s.push([i,o.get()]),o.set(i.startsWith("scale")?1:0))}),s}const es={width:({x:t},{paddingLeft:s="0",paddingRight:i="0",boxSizing:o})=>{const d=t.max-t.min;return o==="border-box"?d:d-parseFloat(s)-parseFloat(i)},height:({y:t},{paddingTop:s="0",paddingBottom:i="0",boxSizing:o})=>{const d=t.max-t.min;return o==="border-box"?d:d-parseFloat(s)-parseFloat(i)},top:(t,{top:s})=>parseFloat(s),left:(t,{left:s})=>parseFloat(s),bottom:({y:t},{top:s})=>parseFloat(s)+(t.max-t.min),right:({x:t},{left:s})=>parseFloat(s)+(t.max-t.min),x:(t,{transform:s})=>tu(s,"x"),y:(t,{transform:s})=>tu(s,"y")};es.translateX=es.x;es.translateY=es.y;const Ds=new Set;let ru=!1,su=!1,iu=!1;function Wg(){if(su){const t=Array.from(Ds).filter(o=>o.needsMeasurement),s=new Set(t.map(o=>o.element)),i=new Map;s.forEach(o=>{const d=zb(o);d.length&&(i.set(o,d),o.render())}),t.forEach(o=>o.measureInitialState()),s.forEach(o=>{o.render();const d=i.get(o);d&&d.forEach(([w,g])=>{var a;(a=o.getValue(w))==null||a.set(g)})}),t.forEach(o=>o.measureEndState()),t.forEach(o=>{o.suspendedScrollY!==void 0&&window.scrollTo(0,o.suspendedScrollY)})}su=!1,ru=!1,Ds.forEach(t=>t.complete(iu)),Ds.clear()}function Vg(){Ds.forEach(t=>{t.readKeyframes(),t.needsMeasurement&&(su=!0)})}function Kb(){iu=!0,Vg(),Wg(),iu=!1}class Uu{constructor(s,i,o,d,w,g=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...s],this.onComplete=i,this.name=o,this.motionValue=d,this.element=w,this.isAsync=g}scheduleResolve(){this.state="scheduled",this.isAsync?(Ds.add(this),ru||(ru=!0,Ae.read(Vg),Ae.resolveKeyframes(Wg))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:s,name:i,element:o,motionValue:d}=this;if(s[0]===null){const w=d==null?void 0:d.get(),g=s[s.length-1];if(w!==void 0)s[0]=w;else if(o&&i){const a=o.readValue(i,g);a!=null&&(s[0]=a)}s[0]===void 0&&(s[0]=g),d&&w===void 0&&d.set(s[0])}Bb(s)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(s=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,s),Ds.delete(this)}cancel(){this.state==="scheduled"&&(Ds.delete(this),this.state="pending")}resume(){this.state==="pending"&&this.scheduleResolve()}}const qb=t=>t.startsWith("--");function $g(t,s,i){qb(s)?t.style.setProperty(s,i):t.style[s]=i}const Gb={};function zg(t,s){const i=yg(t);return()=>Gb[s]??i()}const Xb=zg(()=>window.ScrollTimeline!==void 0,"scrollTimeline"),Kg=zg(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),an=([t,s,i,o])=>`cubic-bezier(${t}, ${s}, ${i}, ${o})`,Mp={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:an([0,.65,.55,1]),circOut:an([.55,0,1,.45]),backIn:an([.31,.01,.66,-.59]),backOut:an([.33,1.53,.69,.99])};function qg(t,s){if(t)return typeof t=="function"?Kg()?Fg(t,s):"ease-out":Pg(t)?an(t):Array.isArray(t)?t.map(i=>qg(i,s)||Mp.easeOut):Mp[t]}function Jb(t,s,i,{delay:o=0,duration:d=300,repeat:w=0,repeatType:g="loop",ease:a="easeOut",times:l}={},p=void 0){const m={[s]:i};l&&(m.offset=l);const u=qg(a,d);Array.isArray(u)&&(m.easing=u);const x={delay:o,duration:d,easing:Array.isArray(u)?"linear":u,fill:"both",iterations:w+1,direction:g==="reverse"?"alternate":"normal"};return p&&(x.pseudoElement=p),t.animate(m,x)}function Gg(t){return typeof t=="function"&&"applyToOptions"in t}function Yb({type:t,...s}){return Gg(t)&&Kg()?t.applyToOptions(s):(s.duration??(s.duration=300),s.ease??(s.ease="easeOut"),s)}class Xg extends Hu{constructor(s){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!s)return;const{element:i,name:o,keyframes:d,pseudoElement:w,allowFlatten:g=!1,finalKeyframe:a,onComplete:l}=s;this.isPseudoElement=!!w,this.allowFlatten=g,this.options=s,Du(typeof s.type!="string");const p=Yb(s);this.animation=Jb(i,o,d,p,w),p.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!w){const m=xa(d,this.options,a,this.speed);this.updateMotionValue&&this.updateMotionValue(m),$g(i,o,m),this.animation.cancel()}l==null||l(),this.notifyFinished()}}play(){this.isStopped||(this.manualStartTime=null,this.animation.play(),this.state==="finished"&&this.updateFinished())}pause(){this.animation.pause()}complete(){var s,i;(i=(s=this.animation).finish)==null||i.call(s)}cancel(){try{this.animation.cancel()}catch{}}stop(){if(this.isStopped)return;this.isStopped=!0;const{state:s}=this;s==="idle"||s==="finished"||(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){var i,o,d;const s=(i=this.options)==null?void 0:i.element;!this.isPseudoElement&&(s!=null&&s.isConnected)&&((d=(o=this.animation).commitStyles)==null||d.call(o))}get duration(){var i,o;const s=((o=(i=this.animation.effect)==null?void 0:i.getComputedTiming)==null?void 0:o.call(i).duration)||0;return zt(Number(s))}get iterationDuration(){const{delay:s=0}=this.options||{};return this.duration+zt(s)}get time(){return zt(Number(this.animation.currentTime)||0)}set time(s){const i=this.finishedTime!==null;this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=It(s),i&&this.animation.pause()}get speed(){return this.animation.playbackRate}set speed(s){s<0&&(this.finishedTime=null),this.animation.playbackRate=s}get state(){return this.finishedTime!==null?"finished":this.animation.playState}get startTime(){return this.manualStartTime??Number(this.animation.startTime)}set startTime(s){this.manualStartTime=this.animation.startTime=s}attachTimeline({timeline:s,rangeStart:i,rangeEnd:o,observe:d}){var w;return this.allowFlatten&&((w=this.animation.effect)==null||w.updateTiming({easing:"linear"})),this.animation.onfinish=null,s&&Xb()?(this.animation.timeline=s,i&&(this.animation.rangeStart=i),o&&(this.animation.rangeEnd=o),Kt):d(this)}}const Jg={anticipate:kg,backInOut:Cg,circInOut:Tg};function Qb(t){return t in Jg}function Zb(t){typeof t.ease=="string"&&Qb(t.ease)&&(t.ease=Jg[t.ease])}const Oc=10;class e1 extends Xg{constructor(s){Zb(s),Ug(s),super(s),s.startTime!==void 0&&s.autoplay!==!1&&(this.startTime=s.startTime),this.options=s}updateMotionValue(s){const{motionValue:i,onUpdate:o,onComplete:d,element:w,...g}=this.options;if(!i)return;if(s!==void 0){i.set(s);return}const a=new ca({...g,autoplay:!1}),l=Math.max(Oc,yt.now()-this.startTime),p=vr(0,Oc,l-Oc),m=a.sample(l).value,{name:u}=this.options;w&&u&&$g(w,u,m),i.setWithVelocity(a.sample(Math.max(0,l-p)).value,m,p),a.stop()}}const Op=(t,s)=>s==="zIndex"?!1:!!(typeof t=="number"||Array.isArray(t)||typeof t=="string"&&(sr.test(t)||t==="0")&&!t.startsWith("url("));function t1(t){const s=t[0];if(t.length===1)return!0;for(let i=0;i<t.length;i++)if(t[i]!==s)return!0}function r1(t,s,i,o){const d=t[0];if(d===null)return!1;if(s==="display"||s==="visibility")return!0;const w=t[t.length-1],g=Op(d,s),a=Op(w,s);return!g||!a?!1:t1(t)||(i==="spring"||Gg(i))&&o}function nu(t){t.duration=0,t.type="keyframes"}const Yg=new Set(["opacity","clipPath","filter","transform"]),s1=/^(?:oklch|oklab|lab|lch|color|color-mix|light-dark)\(/;function i1(t){for(let s=0;s<t.length;s++)if(typeof t[s]=="string"&&s1.test(t[s]))return!0;return!1}const n1=new Set(["color","backgroundColor","outlineColor","fill","stroke","borderColor","borderTopColor","borderRightColor","borderBottomColor","borderLeftColor"]),o1=yg(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function a1(t){var u;const{motionValue:s,name:i,repeatDelay:o,repeatType:d,damping:w,type:g,keyframes:a}=t;if(!(((u=s==null?void 0:s.owner)==null?void 0:u.current)instanceof HTMLElement))return!1;const{onUpdate:p,transformTemplate:m}=s.owner.getProps();return o1()&&i&&(Yg.has(i)||n1.has(i)&&i1(a))&&(i!=="transform"||!m)&&!p&&!o&&d!=="mirror"&&w!==0&&g!=="inertia"}const l1=40;class c1 extends Hu{constructor({autoplay:s=!0,delay:i=0,type:o="keyframes",repeat:d=0,repeatDelay:w=0,repeatType:g="loop",keyframes:a,name:l,motionValue:p,element:m,...u}){var E;super(),this.stop=()=>{var S,c;this._animation&&(this._animation.stop(),(S=this.stopTimeline)==null||S.call(this)),(c=this.keyframeResolver)==null||c.cancel()},this.createdAt=yt.now();const x={autoplay:s,delay:i,type:o,repeat:d,repeatDelay:w,repeatType:g,name:l,motionValue:p,element:m,...u},b=(m==null?void 0:m.KeyframeResolver)||Uu;this.keyframeResolver=new b(a,(S,c,y)=>this.onKeyframesResolved(S,c,x,!y),l,p,m),(E=this.keyframeResolver)==null||E.scheduleResolve()}onKeyframesResolved(s,i,o,d){var y,h;this.keyframeResolver=void 0;const{name:w,type:g,velocity:a,delay:l,isHandoff:p,onUpdate:m}=o;this.resolvedAt=yt.now();let u=!0;r1(s,w,g,a)||(u=!1,(rs.instantAnimations||!l)&&(m==null||m(xa(s,o,i))),s[0]=s[s.length-1],nu(o),o.repeat=0);const b={startTime:d?this.resolvedAt?this.resolvedAt-this.createdAt>l1?this.resolvedAt:this.createdAt:this.createdAt:void 0,finalKeyframe:i,...o,keyframes:s},E=u&&!p&&a1(b),S=(h=(y=b.motionValue)==null?void 0:y.owner)==null?void 0:h.current;let c;if(E)try{c=new e1({...b,element:S})}catch{c=new ca(b)}else c=new ca(b);c.finished.then(()=>{this.notifyFinished()}).catch(Kt),this.pendingTimeline&&(this.stopTimeline=c.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=c}get finished(){return this._animation?this.animation.finished:this._finished}then(s,i){return this.finished.finally(s).then(()=>{})}get animation(){var s;return this._animation||((s=this.keyframeResolver)==null||s.resume(),Kb()),this._animation}get duration(){return this.animation.duration}get iterationDuration(){return this.animation.iterationDuration}get time(){return this.animation.time}set time(s){this.animation.time=s}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(s){this.animation.speed=s}get startTime(){return this.animation.startTime}attachTimeline(s){return this._animation?this.stopTimeline=this.animation.attachTimeline(s):this.pendingTimeline=s,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){var s;this._animation&&this.animation.cancel(),(s=this.keyframeResolver)==null||s.cancel()}}function Qg(t,s,i,o=0,d=1){const w=Array.from(t).sort((p,m)=>p.sortNodePosition(m)).indexOf(s),g=t.size,a=(g-1)*o;return typeof i=="function"?i(w,g):d===1?w*o:a-w*o}const u1=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function d1(t){const s=u1.exec(t);if(!s)return[,];const[,i,o,d]=s;return[`--${i??o}`,d]}function Zg(t,s,i=1){const[o,d]=d1(t);if(!o)return;const w=window.getComputedStyle(s).getPropertyValue(o);if(w){const g=w.trim();return mg(g)?parseFloat(g):g}return Ou(d)?Zg(d,s,i+1):d}const h1={type:"spring",stiffness:500,damping:25,restSpeed:10},f1=t=>({type:"spring",stiffness:550,damping:t===0?2*Math.sqrt(550):30,restSpeed:10}),p1={type:"keyframes",duration:.8},m1={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},g1=(t,{keyframes:s})=>s.length>2?p1:vi.has(t)?t.startsWith("scale")?f1(s[1]):h1:m1;function ev(t,s){if(t!=null&&t.inherit&&s){const{inherit:i,...o}=t;return{...s,...o}}return t}function Wu(t,s){const i=(t==null?void 0:t[s])??(t==null?void 0:t.default)??t;return i!==t?ev(i,t):i}const v1=new Set(["when","delay","delayChildren","staggerChildren","staggerDirection","repeat","repeatType","repeatDelay","from","elapsed"]);function y1(t){for(const s in t)if(!v1.has(s))return!0;return!1}const Vu=(t,s,i,o={},d,w)=>g=>{const a=Wu(o,t)||{},l=a.delay||o.delay||0;let{elapsed:p=0}=o;p=p-It(l);const m={keyframes:Array.isArray(i)?i:[null,i],ease:"easeOut",velocity:s.getVelocity(),...a,delay:-p,onUpdate:x=>{s.set(x),a.onUpdate&&a.onUpdate(x)},onComplete:()=>{g(),a.onComplete&&a.onComplete()},name:t,motionValue:s,element:w?void 0:d};y1(a)||Object.assign(m,g1(t,m)),m.duration&&(m.duration=It(m.duration)),m.repeatDelay&&(m.repeatDelay=It(m.repeatDelay)),m.from!==void 0&&(m.keyframes[0]=m.from);let u=!1;if((m.type===!1||m.duration===0&&!m.repeatDelay)&&(nu(m),m.delay===0&&(u=!0)),(rs.instantAnimations||rs.skipAnimations||d!=null&&d.shouldSkipAnimations)&&(u=!0,nu(m),m.delay=0),m.allowFlatten=!a.type&&!a.ease,u&&!w&&s.get()!==void 0){const x=xa(m.keyframes,a);if(x!==void 0){Ae.update(()=>{m.onUpdate(x),m.onComplete()});return}}return a.isSync?new ca(m):new c1(m)};function Ip(t){const s=[{},{}];return t==null||t.values.forEach((i,o)=>{s[0][o]=i.get(),s[1][o]=i.getVelocity()}),s}function $u(t,s,i,o){if(typeof s=="function"){const[d,w]=Ip(o);s=s(i!==void 0?i:t.custom,d,w)}if(typeof s=="string"&&(s=t.variants&&t.variants[s]),typeof s=="function"){const[d,w]=Ip(o);s=s(i!==void 0?i:t.custom,d,w)}return s}function As(t,s,i){const o=t.getProps();return $u(o,s,i!==void 0?i:o.custom,t)}const tv=new Set(["width","height","top","left","right","bottom",...gi]),Np=30,_1=t=>!isNaN(parseFloat(t));class x1{constructor(s,i={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=o=>{var w;const d=yt.now();if(this.updatedAt!==d&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(o),this.current!==this.prev&&((w=this.events.change)==null||w.notify(this.current),this.dependents))for(const g of this.dependents)g.dirty()},this.hasAnimated=!1,this.setCurrent(s),this.owner=i.owner}setCurrent(s){this.current=s,this.updatedAt=yt.now(),this.canTrackVelocity===null&&s!==void 0&&(this.canTrackVelocity=_1(this.current))}setPrevFrameValue(s=this.current){this.prevFrameValue=s,this.prevUpdatedAt=this.updatedAt}onChange(s){return this.on("change",s)}on(s,i){this.events[s]||(this.events[s]=new Au);const o=this.events[s].add(i);return s==="change"?()=>{o(),Ae.read(()=>{this.events.change.getSize()||this.stop()})}:o}clearListeners(){for(const s in this.events)this.events[s].clear()}attach(s,i){this.passiveEffect=s,this.stopPassiveEffect=i}set(s){this.passiveEffect?this.passiveEffect(s,this.updateAndNotify):this.updateAndNotify(s)}setWithVelocity(s,i,o){this.set(i),this.prev=void 0,this.prevFrameValue=s,this.prevUpdatedAt=this.updatedAt-o}jump(s,i=!0){this.updateAndNotify(s),this.prev=s,this.prevUpdatedAt=this.prevFrameValue=void 0,i&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){var s;(s=this.events.change)==null||s.notify(this.current)}addDependent(s){this.dependents||(this.dependents=new Set),this.dependents.add(s)}removeDependent(s){this.dependents&&this.dependents.delete(s)}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const s=yt.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||s-this.updatedAt>Np)return 0;const i=Math.min(this.updatedAt-this.prevUpdatedAt,Np);return _g(parseFloat(this.current)-parseFloat(this.prevFrameValue),i)}start(s){return this.stop(),new Promise(i=>{this.hasAnimated=!0,this.animation=s(i),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){var s,i;(s=this.dependents)==null||s.clear(),(i=this.events.destroy)==null||i.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function fi(t,s){return new x1(t,s)}const ou=t=>Array.isArray(t);function w1(t,s,i){t.hasValue(s)?t.getValue(s).set(i):t.addValue(s,fi(i))}function S1(t){return ou(t)?t[t.length-1]||0:t}function b1(t,s){const i=As(t,s);let{transitionEnd:o={},transition:d={},...w}=i||{};w={...w,...o};for(const g in w){const a=S1(w[g]);w1(t,g,a)}}const lt=t=>!!(t&&t.getVelocity);function C1(t){return!!(lt(t)&&t.add)}function au(t,s){const i=t.getValue("willChange");if(C1(i))return i.add(s);if(!i&&rs.WillChange){const o=new rs.WillChange("auto");t.addValue("willChange",o),o.add(s)}}function zu(t){return t.replace(/([A-Z])/g,s=>`-${s.toLowerCase()}`)}const k1="framerAppearId",rv="data-"+zu(k1);function sv(t){return t.props[rv]}function E1({protectedKeys:t,needsAnimating:s},i){const o=t.hasOwnProperty(i)&&s[i]!==!0;return s[i]=!1,o}function iv(t,s,{delay:i=0,transitionOverride:o,type:d}={}){let{transition:w,transitionEnd:g,...a}=s;const l=t.getDefaultTransition();w=w?ev(w,l):l;const p=w==null?void 0:w.reduceMotion;o&&(w=o);const m=[],u=d&&t.animationState&&t.animationState.getState()[d];for(const x in a){const b=t.getValue(x,t.latestValues[x]??null),E=a[x];if(E===void 0||u&&E1(u,x))continue;const S={delay:i,...Wu(w||{},x)},c=b.get();if(c!==void 0&&!b.isAnimating()&&!Array.isArray(E)&&E===c&&!S.velocity){Ae.update(()=>b.set(E));continue}let y=!1;if(window.MotionHandoffAnimation){const C=sv(t);if(C){const R=window.MotionHandoffAnimation(C,x,Ae);R!==null&&(S.startTime=R,y=!0)}}au(t,x);const h=p??t.shouldReduceMotion;b.start(Vu(x,b,E,h&&tv.has(x)?{type:!1}:S,t,y));const v=b.animation;v&&m.push(v)}if(g){const x=()=>Ae.update(()=>{g&&b1(t,g)});m.length?Promise.all(m).then(x):x()}return m}function lu(t,s,i={}){var l;const o=As(t,s,i.type==="exit"?(l=t.presenceContext)==null?void 0:l.custom:void 0);let{transition:d=t.getDefaultTransition()||{}}=o||{};i.transitionOverride&&(d=i.transitionOverride);const w=o?()=>Promise.all(iv(t,o,i)):()=>Promise.resolve(),g=t.variantChildren&&t.variantChildren.size?(p=0)=>{const{delayChildren:m=0,staggerChildren:u,staggerDirection:x}=d;return T1(t,s,p,m,u,x,i)}:()=>Promise.resolve(),{when:a}=d;if(a){const[p,m]=a==="beforeChildren"?[w,g]:[g,w];return p().then(()=>m())}else return Promise.all([w(),g(i.delay)])}function T1(t,s,i=0,o=0,d=0,w=1,g){const a=[];for(const l of t.variantChildren)l.notify("AnimationStart",s),a.push(lu(l,s,{...g,delay:i+(typeof o=="function"?0:o)+Qg(t.variantChildren,l,o,d,w)}).then(()=>l.notify("AnimationComplete",s)));return Promise.all(a)}function R1(t,s,i={}){t.notify("AnimationStart",s);let o;if(Array.isArray(s)){const d=s.map(w=>lu(t,w,i));o=Promise.all(d)}else if(typeof s=="string")o=lu(t,s,i);else{const d=typeof s=="function"?As(t,s,i.custom):s;o=Promise.all(iv(t,d,i))}return o.then(()=>{t.notify("AnimationComplete",s)})}const P1={test:t=>t==="auto",parse:t=>t},nv=t=>s=>s.test(t),ov=[mi,ve,mr,Qr,tb,eb,P1],Bp=t=>ov.find(nv(t));function L1(t){return typeof t=="number"?t===0:t!==null?t==="none"||t==="0"||vg(t):!0}const D1=new Set(["brightness","contrast","saturate","opacity"]);function A1(t){const[s,i]=t.slice(0,-1).split("(");if(s==="drop-shadow")return t;const[o]=i.match(Iu)||[];if(!o)return t;const d=i.replace(o,"");let w=D1.has(s)?1:0;return o!==i&&(w*=100),s+"("+w+d+")"}const j1=/\b([a-z-]*)\(.*?\)/gu,cu={...sr,getAnimatableNone:t=>{const s=t.match(j1);return s?s.map(A1).join(" "):t}},uu={...sr,getAnimatableNone:t=>{const s=sr.parse(t);return sr.createTransformer(t)(s.map(o=>typeof o=="number"?0:typeof o=="object"?{...o,alpha:1}:o))}},Fp={...mi,transform:Math.round},M1={rotate:Qr,rotateX:Qr,rotateY:Qr,rotateZ:Qr,scale:Ho,scaleX:Ho,scaleY:Ho,scaleZ:Ho,skew:Qr,skewX:Qr,skewY:Qr,distance:ve,translateX:ve,translateY:ve,translateZ:ve,x:ve,y:ve,z:ve,perspective:ve,transformPerspective:ve,opacity:gn,originX:kp,originY:kp,originZ:ve},Ku={borderWidth:ve,borderTopWidth:ve,borderRightWidth:ve,borderBottomWidth:ve,borderLeftWidth:ve,borderRadius:ve,borderTopLeftRadius:ve,borderTopRightRadius:ve,borderBottomRightRadius:ve,borderBottomLeftRadius:ve,width:ve,maxWidth:ve,height:ve,maxHeight:ve,top:ve,right:ve,bottom:ve,left:ve,inset:ve,insetBlock:ve,insetBlockStart:ve,insetBlockEnd:ve,insetInline:ve,insetInlineStart:ve,insetInlineEnd:ve,padding:ve,paddingTop:ve,paddingRight:ve,paddingBottom:ve,paddingLeft:ve,paddingBlock:ve,paddingBlockStart:ve,paddingBlockEnd:ve,paddingInline:ve,paddingInlineStart:ve,paddingInlineEnd:ve,margin:ve,marginTop:ve,marginRight:ve,marginBottom:ve,marginLeft:ve,marginBlock:ve,marginBlockStart:ve,marginBlockEnd:ve,marginInline:ve,marginInlineStart:ve,marginInlineEnd:ve,fontSize:ve,backgroundPositionX:ve,backgroundPositionY:ve,...M1,zIndex:Fp,fillOpacity:gn,strokeOpacity:gn,numOctaves:Fp},O1={...Ku,color:Je,backgroundColor:Je,outlineColor:Je,fill:Je,stroke:Je,borderColor:Je,borderTopColor:Je,borderRightColor:Je,borderBottomColor:Je,borderLeftColor:Je,filter:cu,WebkitFilter:cu,mask:uu,WebkitMask:uu},av=t=>O1[t],I1=new Set([cu,uu]);function lv(t,s){let i=av(t);return I1.has(i)||(i=sr),i.getAnimatableNone?i.getAnimatableNone(s):void 0}const N1=new Set(["auto","none","0"]);function B1(t,s,i){let o=0,d;for(;o<t.length&&!d;){const w=t[o];typeof w=="string"&&!N1.has(w)&&hi(w).values.length&&(d=t[o]),o++}if(d&&i)for(const w of s)t[w]=lv(i,d)}class F1 extends Uu{constructor(s,i,o,d,w){super(s,i,o,d,w,!0)}readKeyframes(){const{unresolvedKeyframes:s,element:i,name:o}=this;if(!i||!i.current)return;super.readKeyframes();for(let m=0;m<s.length;m++){let u=s[m];if(typeof u=="string"&&(u=u.trim(),Ou(u))){const x=Zg(u,i.current);x!==void 0&&(s[m]=x),m===s.length-1&&(this.finalKeyframe=u)}}if(this.resolveNoneKeyframes(),!tv.has(o)||s.length!==2)return;const[d,w]=s,g=Bp(d),a=Bp(w),l=Cp(d),p=Cp(w);if(l!==p&&es[o]){this.needsMeasurement=!0;return}if(g!==a)if(jp(g)&&jp(a))for(let m=0;m<s.length;m++){const u=s[m];typeof u=="string"&&(s[m]=parseFloat(u))}else es[o]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){const{unresolvedKeyframes:s,name:i}=this,o=[];for(let d=0;d<s.length;d++)(s[d]===null||L1(s[d]))&&o.push(d);o.length&&B1(s,o,i)}measureInitialState(){const{element:s,unresolvedKeyframes:i,name:o}=this;if(!s||!s.current)return;o==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=es[o](s.measureViewportBox(),window.getComputedStyle(s.current)),i[0]=this.measuredOrigin;const d=i[i.length-1];d!==void 0&&s.getValue(o,d).jump(d,!1)}measureEndState(){var a;const{element:s,name:i,unresolvedKeyframes:o}=this;if(!s||!s.current)return;const d=s.getValue(i);d&&d.jump(this.measuredOrigin,!1);const w=o.length-1,g=o[w];o[w]=es[i](s.measureViewportBox(),window.getComputedStyle(s.current)),g!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=g),(a=this.removedTransforms)!=null&&a.length&&this.removedTransforms.forEach(([l,p])=>{s.getValue(l).set(p)}),this.resolveNoneKeyframes()}}function cv(t,s,i){if(t==null)return[];if(t instanceof EventTarget)return[t];if(typeof t=="string"){let o=document;const d=(i==null?void 0:i[t])??o.querySelectorAll(t);return d?Array.from(d):[]}return Array.from(t).filter(o=>o!=null)}const uv=(t,s)=>s&&typeof t=="number"?s.transform(t):t;function qo(t){return gg(t)&&"offsetHeight"in t&&!("ownerSVGElement"in t)}const{schedule:qu}=Lg(queueMicrotask,!1),rr={x:!1,y:!1};function dv(){return rr.x||rr.y}function H1(t){return t==="x"||t==="y"?rr[t]?null:(rr[t]=!0,()=>{rr[t]=!1}):rr.x||rr.y?null:(rr.x=rr.y=!0,()=>{rr.x=rr.y=!1})}function hv(t,s){const i=cv(t),o=new AbortController,d={passive:!0,...s,signal:o.signal};return[i,d,()=>o.abort()]}function U1(t){return!(t.pointerType==="touch"||dv())}function W1(t,s,i={}){const[o,d,w]=hv(t,i);return o.forEach(g=>{let a=!1,l=!1,p;const m=()=>{g.removeEventListener("pointerleave",E)},u=c=>{p&&(p(c),p=void 0),m()},x=c=>{a=!1,window.removeEventListener("pointerup",x),window.removeEventListener("pointercancel",x),l&&(l=!1,u(c))},b=()=>{a=!0,window.addEventListener("pointerup",x,d),window.addEventListener("pointercancel",x,d)},E=c=>{if(c.pointerType!=="touch"){if(a){l=!0;return}u(c)}},S=c=>{if(!U1(c))return;l=!1;const y=s(g,c);typeof y=="function"&&(p=y,g.addEventListener("pointerleave",E,d))};g.addEventListener("pointerenter",S,d),g.addEventListener("pointerdown",b,d)}),w}const fv=(t,s)=>s?t===s?!0:fv(t,s.parentElement):!1,Gu=t=>t.pointerType==="mouse"?typeof t.button!="number"||t.button<=0:t.isPrimary!==!1,V1=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function $1(t){return V1.has(t.tagName)||t.isContentEditable===!0}const z1=new Set(["INPUT","SELECT","TEXTAREA"]);function K1(t){return z1.has(t.tagName)||t.isContentEditable===!0}const Go=new WeakSet;function Hp(t){return s=>{s.key==="Enter"&&t(s)}}function Ic(t,s){t.dispatchEvent(new PointerEvent("pointer"+s,{isPrimary:!0,bubbles:!0}))}const q1=(t,s)=>{const i=t.currentTarget;if(!i)return;const o=Hp(()=>{if(Go.has(i))return;Ic(i,"down");const d=Hp(()=>{Ic(i,"up")}),w=()=>Ic(i,"cancel");i.addEventListener("keyup",d,s),i.addEventListener("blur",w,s)});i.addEventListener("keydown",o,s),i.addEventListener("blur",()=>i.removeEventListener("keydown",o),s)};function Up(t){return Gu(t)&&!dv()}const Wp=new WeakSet;function G1(t,s,i={}){const[o,d,w]=hv(t,i),g=a=>{const l=a.currentTarget;if(!Up(a)||Wp.has(a))return;Go.add(l),i.stopPropagation&&Wp.add(a);const p=s(l,a),m=(b,E)=>{window.removeEventListener("pointerup",u),window.removeEventListener("pointercancel",x),Go.has(l)&&Go.delete(l),Up(b)&&typeof p=="function"&&p(b,{success:E})},u=b=>{m(b,l===window||l===document||i.useGlobalTarget||fv(l,b.target))},x=b=>{m(b,!1)};window.addEventListener("pointerup",u,d),window.addEventListener("pointercancel",x,d)};return o.forEach(a=>{(i.useGlobalTarget?window:a).addEventListener("pointerdown",g,d),qo(a)&&(a.addEventListener("focus",p=>q1(p,d)),!$1(a)&&!a.hasAttribute("tabindex")&&(a.tabIndex=0))}),w}function Xu(t){return gg(t)&&"ownerSVGElement"in t}const Xo=new WeakMap;let Zr;const pv=(t,s,i)=>(o,d)=>d&&d[0]?d[0][t+"Size"]:Xu(o)&&"getBBox"in o?o.getBBox()[s]:o[i],X1=pv("inline","width","offsetWidth"),J1=pv("block","height","offsetHeight");function Y1({target:t,borderBoxSize:s}){var i;(i=Xo.get(t))==null||i.forEach(o=>{o(t,{get width(){return X1(t,s)},get height(){return J1(t,s)}})})}function Q1(t){t.forEach(Y1)}function Z1(){typeof ResizeObserver>"u"||(Zr=new ResizeObserver(Q1))}function eC(t,s){Zr||Z1();const i=cv(t);return i.forEach(o=>{let d=Xo.get(o);d||(d=new Set,Xo.set(o,d)),d.add(s),Zr==null||Zr.observe(o)}),()=>{i.forEach(o=>{const d=Xo.get(o);d==null||d.delete(s),d!=null&&d.size||Zr==null||Zr.unobserve(o)})}}const Jo=new Set;let ai;function tC(){ai=()=>{const t={get width(){return window.innerWidth},get height(){return window.innerHeight}};Jo.forEach(s=>s(t))},window.addEventListener("resize",ai)}function rC(t){return Jo.add(t),ai||tC(),()=>{Jo.delete(t),!Jo.size&&typeof ai=="function"&&(window.removeEventListener("resize",ai),ai=void 0)}}function Vp(t,s){return typeof t=="function"?rC(t):eC(t,s)}function sC(t){return Xu(t)&&t.tagName==="svg"}const iC=[...ov,Je,sr],nC=t=>iC.find(nv(t)),$p=()=>({translate:0,scale:1,origin:0,originPoint:0}),li=()=>({x:$p(),y:$p()}),zp=()=>({min:0,max:0}),Ze=()=>({x:zp(),y:zp()}),oC=new WeakMap;function wa(t){return t!==null&&typeof t=="object"&&typeof t.start=="function"}function vn(t){return typeof t=="string"||Array.isArray(t)}const Ju=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],Yu=["initial",...Ju];function Sa(t){return wa(t.animate)||Yu.some(s=>vn(t[s]))}function mv(t){return!!(Sa(t)||t.variants)}function aC(t,s,i){for(const o in s){const d=s[o],w=i[o];if(lt(d))t.addValue(o,d);else if(lt(w))t.addValue(o,fi(d,{owner:t}));else if(w!==d)if(t.hasValue(o)){const g=t.getValue(o);g.liveStyle===!0?g.jump(d):g.hasAnimated||g.set(d)}else{const g=t.getStaticValue(o);t.addValue(o,fi(g!==void 0?g:d,{owner:t}))}}for(const o in i)s[o]===void 0&&t.removeValue(o);return s}const du={current:null},gv={current:!1},lC=typeof window<"u";function cC(){if(gv.current=!0,!!lC)if(window.matchMedia){const t=window.matchMedia("(prefers-reduced-motion)"),s=()=>du.current=t.matches;t.addEventListener("change",s),s()}else du.current=!1}const Kp=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];let ua={};function vv(t){ua=t}function uC(){return ua}class dC{scrapeMotionValuesFromProps(s,i,o){return{}}constructor({parent:s,props:i,presenceContext:o,reducedMotionConfig:d,skipAnimations:w,blockInitialAnimation:g,visualState:a},l={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.shouldSkipAnimations=!1,this.values=new Map,this.KeyframeResolver=Uu,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.hasBeenMounted=!1,this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const b=yt.now();this.renderScheduledAt<b&&(this.renderScheduledAt=b,Ae.render(this.render,!1,!0))};const{latestValues:p,renderState:m}=a;this.latestValues=p,this.baseTarget={...p},this.initialValues=i.initial?{...p}:{},this.renderState=m,this.parent=s,this.props=i,this.presenceContext=o,this.depth=s?s.depth+1:0,this.reducedMotionConfig=d,this.skipAnimationsConfig=w,this.options=l,this.blockInitialAnimation=!!g,this.isControllingVariants=Sa(i),this.isVariantNode=mv(i),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(s&&s.current);const{willChange:u,...x}=this.scrapeMotionValuesFromProps(i,{},this);for(const b in x){const E=x[b];p[b]!==void 0&&lt(E)&&E.set(p[b])}}mount(s){var i,o;if(this.hasBeenMounted)for(const d in this.initialValues)(i=this.values.get(d))==null||i.jump(this.initialValues[d]),this.latestValues[d]=this.initialValues[d];this.current=s,oC.set(s,this),this.projection&&!this.projection.instance&&this.projection.mount(s),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((d,w)=>this.bindToMotionValue(w,d)),this.reducedMotionConfig==="never"?this.shouldReduceMotion=!1:this.reducedMotionConfig==="always"?this.shouldReduceMotion=!0:(gv.current||cC(),this.shouldReduceMotion=du.current),this.shouldSkipAnimations=this.skipAnimationsConfig??!1,(o=this.parent)==null||o.addChild(this),this.update(this.props,this.presenceContext),this.hasBeenMounted=!0}unmount(){var s;this.projection&&this.projection.unmount(),ss(this.notifyUpdate),ss(this.render),this.valueSubscriptions.forEach(i=>i()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),(s=this.parent)==null||s.removeChild(this);for(const i in this.events)this.events[i].clear();for(const i in this.features){const o=this.features[i];o&&(o.unmount(),o.isMounted=!1)}this.current=null}addChild(s){this.children.add(s),this.enteringChildren??(this.enteringChildren=new Set),this.enteringChildren.add(s)}removeChild(s){this.children.delete(s),this.enteringChildren&&this.enteringChildren.delete(s)}bindToMotionValue(s,i){if(this.valueSubscriptions.has(s)&&this.valueSubscriptions.get(s)(),i.accelerate&&Yg.has(s)&&this.current instanceof HTMLElement){const{factory:g,keyframes:a,times:l,ease:p,duration:m}=i.accelerate,u=new Xg({element:this.current,name:s,keyframes:a,times:l,ease:p,duration:It(m)}),x=g(u);this.valueSubscriptions.set(s,()=>{x(),u.cancel()});return}const o=vi.has(s);o&&this.onBindTransform&&this.onBindTransform();const d=i.on("change",g=>{this.latestValues[s]=g,this.props.onUpdate&&Ae.preRender(this.notifyUpdate),o&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()});let w;typeof window<"u"&&window.MotionCheckAppearSync&&(w=window.MotionCheckAppearSync(this,s,i)),this.valueSubscriptions.set(s,()=>{d(),w&&w(),i.owner&&i.stop()})}sortNodePosition(s){return!this.current||!this.sortInstanceNodePosition||this.type!==s.type?0:this.sortInstanceNodePosition(this.current,s.current)}updateFeatures(){let s="animation";for(s in ua){const i=ua[s];if(!i)continue;const{isEnabled:o,Feature:d}=i;if(!this.features[s]&&d&&o(this.props)&&(this.features[s]=new d(this)),this.features[s]){const w=this.features[s];w.isMounted?w.update():(w.mount(),w.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):Ze()}getStaticValue(s){return this.latestValues[s]}setStaticValue(s,i){this.latestValues[s]=i}update(s,i){(s.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=s,this.prevPresenceContext=this.presenceContext,this.presenceContext=i;for(let o=0;o<Kp.length;o++){const d=Kp[o];this.propEventSubscriptions[d]&&(this.propEventSubscriptions[d](),delete this.propEventSubscriptions[d]);const w="on"+d,g=s[w];g&&(this.propEventSubscriptions[d]=this.on(d,g))}this.prevMotionValues=aC(this,this.scrapeMotionValuesFromProps(s,this.prevProps||{},this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(s){return this.props.variants?this.props.variants[s]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(s){const i=this.getClosestVariantNode();if(i)return i.variantChildren&&i.variantChildren.add(s),()=>i.variantChildren.delete(s)}addValue(s,i){const o=this.values.get(s);i!==o&&(o&&this.removeValue(s),this.bindToMotionValue(s,i),this.values.set(s,i),this.latestValues[s]=i.get())}removeValue(s){this.values.delete(s);const i=this.valueSubscriptions.get(s);i&&(i(),this.valueSubscriptions.delete(s)),delete this.latestValues[s],this.removeValueFromRenderState(s,this.renderState)}hasValue(s){return this.values.has(s)}getValue(s,i){if(this.props.values&&this.props.values[s])return this.props.values[s];let o=this.values.get(s);return o===void 0&&i!==void 0&&(o=fi(i===null?void 0:i,{owner:this}),this.addValue(s,o)),o}readValue(s,i){let o=this.latestValues[s]!==void 0||!this.current?this.latestValues[s]:this.getBaseTargetFromProps(this.props,s)??this.readValueFromInstance(this.current,s,this.options);return o!=null&&(typeof o=="string"&&(mg(o)||vg(o))?o=parseFloat(o):!nC(o)&&sr.test(i)&&(o=lv(s,i)),this.setBaseTarget(s,lt(o)?o.get():o)),lt(o)?o.get():o}setBaseTarget(s,i){this.baseTarget[s]=i}getBaseTarget(s){var w;const{initial:i}=this.props;let o;if(typeof i=="string"||typeof i=="object"){const g=$u(this.props,i,(w=this.presenceContext)==null?void 0:w.custom);g&&(o=g[s])}if(i&&o!==void 0)return o;const d=this.getBaseTargetFromProps(this.props,s);return d!==void 0&&!lt(d)?d:this.initialValues[s]!==void 0&&o===void 0?void 0:this.baseTarget[s]}on(s,i){return this.events[s]||(this.events[s]=new Au),this.events[s].add(i)}notify(s,...i){this.events[s]&&this.events[s].notify(...i)}scheduleRenderMicrotask(){qu.render(this.render)}}class yv extends dC{constructor(){super(...arguments),this.KeyframeResolver=F1}sortInstanceNodePosition(s,i){return s.compareDocumentPosition(i)&2?1:-1}getBaseTargetFromProps(s,i){const o=s.style;return o?o[i]:void 0}removeValueFromRenderState(s,{vars:i,style:o}){delete i[s],delete o[s]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:s}=this.props;lt(s)&&(this.childSubscription=s.on("change",i=>{this.current&&(this.current.textContent=`${i}`)}))}}class os{constructor(s){this.isMounted=!1,this.node=s}update(){}}function _v({top:t,left:s,right:i,bottom:o}){return{x:{min:s,max:i},y:{min:t,max:o}}}function hC({x:t,y:s}){return{top:s.min,right:t.max,bottom:s.max,left:t.min}}function fC(t,s){if(!s)return t;const i=s({x:t.left,y:t.top}),o=s({x:t.right,y:t.bottom});return{top:i.y,left:i.x,bottom:o.y,right:o.x}}function Nc(t){return t===void 0||t===1}function hu({scale:t,scaleX:s,scaleY:i}){return!Nc(t)||!Nc(s)||!Nc(i)}function ks(t){return hu(t)||xv(t)||t.z||t.rotate||t.rotateX||t.rotateY||t.skewX||t.skewY}function xv(t){return qp(t.x)||qp(t.y)}function qp(t){return t&&t!=="0%"}function da(t,s,i){const o=t-i,d=s*o;return i+d}function Gp(t,s,i,o,d){return d!==void 0&&(t=da(t,d,o)),da(t,i,o)+s}function fu(t,s=0,i=1,o,d){t.min=Gp(t.min,s,i,o,d),t.max=Gp(t.max,s,i,o,d)}function wv(t,{x:s,y:i}){fu(t.x,s.translate,s.scale,s.originPoint),fu(t.y,i.translate,i.scale,i.originPoint)}const Xp=.999999999999,Jp=1.0000000000001;function pC(t,s,i,o=!1){var a;const d=i.length;if(!d)return;s.x=s.y=1;let w,g;for(let l=0;l<d;l++){w=i[l],g=w.projectionDelta;const{visualElement:p}=w.options;p&&p.props.style&&p.props.style.display==="contents"||(o&&w.options.layoutScroll&&w.scroll&&w!==w.root&&(hr(t.x,-w.scroll.offset.x),hr(t.y,-w.scroll.offset.y)),g&&(s.x*=g.x.scale,s.y*=g.y.scale,wv(t,g)),o&&ks(w.latestValues)&&Yo(t,w.latestValues,(a=w.layout)==null?void 0:a.layoutBox))}s.x<Jp&&s.x>Xp&&(s.x=1),s.y<Jp&&s.y>Xp&&(s.y=1)}function hr(t,s){t.min+=s,t.max+=s}function Yp(t,s,i,o,d=.5){const w=Ue(t.min,t.max,d);fu(t,s,i,w,o)}function Qp(t,s){return typeof t=="string"?parseFloat(t)/100*(s.max-s.min):t}function Yo(t,s,i){const o=i??t;Yp(t.x,Qp(s.x,o.x),s.scaleX,s.scale,s.originX),Yp(t.y,Qp(s.y,o.y),s.scaleY,s.scale,s.originY)}function Sv(t,s){return _v(fC(t.getBoundingClientRect(),s))}function mC(t,s,i){const o=Sv(t,i),{scroll:d}=s;return d&&(hr(o.x,d.offset.x),hr(o.y,d.offset.y)),o}const gC={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},vC=gi.length;function yC(t,s,i){let o="",d=!0;for(let w=0;w<vC;w++){const g=gi[w],a=t[g];if(a===void 0)continue;let l=!0;if(typeof a=="number")l=a===(g.startsWith("scale")?1:0);else{const p=parseFloat(a);l=g.startsWith("scale")?p===1:p===0}if(!l||i){const p=uv(a,Ku[g]);if(!l){d=!1;const m=gC[g]||g;o+=`${m}(${p}) `}i&&(s[g]=p)}}return o=o.trim(),i?o=i(s,d?"":o):d&&(o="none"),o}function Qu(t,s,i){const{style:o,vars:d,transformOrigin:w}=t;let g=!1,a=!1;for(const l in s){const p=s[l];if(vi.has(l)){g=!0;continue}else if(Ag(l)){d[l]=p;continue}else{const m=uv(p,Ku[l]);l.startsWith("origin")?(a=!0,w[l]=m):o[l]=m}}if(s.transform||(g||i?o.transform=yC(s,t.transform,i):o.transform&&(o.transform="none")),a){const{originX:l="50%",originY:p="50%",originZ:m=0}=w;o.transformOrigin=`${l} ${p} ${m}`}}function bv(t,{style:s,vars:i},o,d){const w=t.style;let g;for(g in s)w[g]=s[g];d==null||d.applyProjectionStyles(w,o);for(g in i)w.setProperty(g,i[g])}function Zp(t,s){return s.max===s.min?0:t/(s.max-s.min)*100}const sn={correct:(t,s)=>{if(!s.target)return t;if(typeof t=="string")if(ve.test(t))t=parseFloat(t);else return t;const i=Zp(t,s.target.x),o=Zp(t,s.target.y);return`${i}% ${o}%`}},_C={correct:(t,{treeScale:s,projectionDelta:i})=>{const o=t,d=sr.parse(t);if(d.length>5)return o;const w=sr.createTransformer(t),g=typeof d[0]!="number"?1:0,a=i.x.scale*s.x,l=i.y.scale*s.y;d[0+g]/=a,d[1+g]/=l;const p=Ue(a,l,.5);return typeof d[2+g]=="number"&&(d[2+g]/=p),typeof d[3+g]=="number"&&(d[3+g]/=p),w(d)}},pu={borderRadius:{...sn,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:sn,borderTopRightRadius:sn,borderBottomLeftRadius:sn,borderBottomRightRadius:sn,boxShadow:_C};function Cv(t,{layout:s,layoutId:i}){return vi.has(t)||t.startsWith("origin")||(s||i!==void 0)&&(!!pu[t]||t==="opacity")}function Zu(t,s,i){var g;const o=t.style,d=s==null?void 0:s.style,w={};if(!o)return w;for(const a in o)(lt(o[a])||d&&lt(d[a])||Cv(a,t)||((g=i==null?void 0:i.getValue(a))==null?void 0:g.liveStyle)!==void 0)&&(w[a]=o[a]);return w}function xC(t){return window.getComputedStyle(t)}class wC extends yv{constructor(){super(...arguments),this.type="html",this.renderInstance=bv}readValueFromInstance(s,i){var o;if(vi.has(i))return(o=this.projection)!=null&&o.isProjecting?eu(i):Ub(s,i);{const d=xC(s),w=(Ag(i)?d.getPropertyValue(i):d[i])||0;return typeof w=="string"?w.trim():w}}measureInstanceViewportBox(s,{transformPagePoint:i}){return Sv(s,i)}build(s,i,o){Qu(s,i,o.transformTemplate)}scrapeMotionValuesFromProps(s,i,o){return Zu(s,i,o)}}const SC={offset:"stroke-dashoffset",array:"stroke-dasharray"},bC={offset:"strokeDashoffset",array:"strokeDasharray"};function CC(t,s,i=1,o=0,d=!0){t.pathLength=1;const w=d?SC:bC;t[w.offset]=`${-o}`,t[w.array]=`${s} ${i}`}const kC=["offsetDistance","offsetPath","offsetRotate","offsetAnchor"];function kv(t,{attrX:s,attrY:i,attrScale:o,pathLength:d,pathSpacing:w=1,pathOffset:g=0,...a},l,p,m){if(Qu(t,a,p),l){t.style.viewBox&&(t.attrs.viewBox=t.style.viewBox);return}t.attrs=t.style,t.style={};const{attrs:u,style:x}=t;u.transform&&(x.transform=u.transform,delete u.transform),(x.transform||u.transformOrigin)&&(x.transformOrigin=u.transformOrigin??"50% 50%",delete u.transformOrigin),x.transform&&(x.transformBox=(m==null?void 0:m.transformBox)??"fill-box",delete u.transformBox);for(const b of kC)u[b]!==void 0&&(x[b]=u[b],delete u[b]);s!==void 0&&(u.x=s),i!==void 0&&(u.y=i),o!==void 0&&(u.scale=o),d!==void 0&&CC(u,d,w,g,!1)}const Ev=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]),Tv=t=>typeof t=="string"&&t.toLowerCase()==="svg";function EC(t,s,i,o){bv(t,s,void 0,o);for(const d in s.attrs)t.setAttribute(Ev.has(d)?d:zu(d),s.attrs[d])}function Rv(t,s,i){const o=Zu(t,s,i);for(const d in t)if(lt(t[d])||lt(s[d])){const w=gi.indexOf(d)!==-1?"attr"+d.charAt(0).toUpperCase()+d.substring(1):d;o[w]=t[d]}return o}class TC extends yv{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=Ze}getBaseTargetFromProps(s,i){return s[i]}readValueFromInstance(s,i){if(vi.has(i)){const o=av(i);return o&&o.default||0}return i=Ev.has(i)?i:zu(i),s.getAttribute(i)}scrapeMotionValuesFromProps(s,i,o){return Rv(s,i,o)}build(s,i,o){kv(s,i,this.isSVGTag,o.transformTemplate,o.style)}renderInstance(s,i,o,d){EC(s,i,o,d)}mount(s){this.isSVGTag=Tv(s.tagName),super.mount(s)}}const RC=Yu.length;function Pv(t){if(!t)return;if(!t.isControllingVariants){const i=t.parent?Pv(t.parent)||{}:{};return t.props.initial!==void 0&&(i.initial=t.props.initial),i}const s={};for(let i=0;i<RC;i++){const o=Yu[i],d=t.props[o];(vn(d)||d===!1)&&(s[o]=d)}return s}function Lv(t,s){if(!Array.isArray(s))return!1;const i=s.length;if(i!==t.length)return!1;for(let o=0;o<i;o++)if(s[o]!==t[o])return!1;return!0}const PC=[...Ju].reverse(),LC=Ju.length;function DC(t){return s=>Promise.all(s.map(({animation:i,options:o})=>R1(t,i,o)))}function AC(t){let s=DC(t),i=em(),o=!0,d=!1;const w=p=>(m,u)=>{var b;const x=As(t,u,p==="exit"?(b=t.presenceContext)==null?void 0:b.custom:void 0);if(x){const{transition:E,transitionEnd:S,...c}=x;m={...m,...c,...S}}return m};function g(p){s=p(t)}function a(p){const{props:m}=t,u=Pv(t.parent)||{},x=[],b=new Set;let E={},S=1/0;for(let y=0;y<LC;y++){const h=PC[y],v=i[h],C=m[h]!==void 0?m[h]:u[h],R=vn(C),L=h===p?v.isActive:null;L===!1&&(S=y);let D=C===u[h]&&C!==m[h]&&R;if(D&&(o||d)&&t.manuallyAnimateOnMount&&(D=!1),v.protectedKeys={...E},!v.isActive&&L===null||!C&&!v.prevProp||wa(C)||typeof C=="boolean")continue;if(h==="exit"&&v.isActive&&L!==!0){v.prevResolvedValues&&(E={...E,...v.prevResolvedValues});continue}const T=jC(v.prevProp,C);let A=T||h===p&&v.isActive&&!D&&R||y>S&&R,I=!1;const H=Array.isArray(C)?C:[C];let $=H.reduce(w(h),{});L===!1&&($={});const{prevResolvedValues:N={}}=v,J={...N,...$},K=G=>{A=!0,b.has(G)&&(I=!0,b.delete(G)),v.needsAnimating[G]=!0;const j=t.getValue(G);j&&(j.liveStyle=!1)};for(const G in J){const j=$[G],F=N[G];if(E.hasOwnProperty(G))continue;let M=!1;ou(j)&&ou(F)?M=!Lv(j,F):M=j!==F,M?j!=null?K(G):b.add(G):j!==void 0&&b.has(G)?K(G):v.protectedKeys[G]=!0}v.prevProp=C,v.prevResolvedValues=$,v.isActive&&(E={...E,...$}),(o||d)&&t.blockInitialAnimation&&(A=!1);const z=D&&T;A&&(!z||I)&&x.push(...H.map(G=>{const j={type:h};if(typeof G=="string"&&(o||d)&&!z&&t.manuallyAnimateOnMount&&t.parent){const{parent:F}=t,M=As(F,G);if(F.enteringChildren&&M){const{delayChildren:U}=M.transition||{};j.delay=Qg(F.enteringChildren,t,U)}}return{animation:G,options:j}}))}if(b.size){const y={};if(typeof m.initial!="boolean"){const h=As(t,Array.isArray(m.initial)?m.initial[0]:m.initial);h&&h.transition&&(y.transition=h.transition)}b.forEach(h=>{const v=t.getBaseTarget(h),C=t.getValue(h);C&&(C.liveStyle=!0),y[h]=v??null}),x.push({animation:y})}let c=!!x.length;return o&&(m.initial===!1||m.initial===m.animate)&&!t.manuallyAnimateOnMount&&(c=!1),o=!1,d=!1,c?s(x):Promise.resolve()}function l(p,m){var x;if(i[p].isActive===m)return Promise.resolve();(x=t.variantChildren)==null||x.forEach(b=>{var E;return(E=b.animationState)==null?void 0:E.setActive(p,m)}),i[p].isActive=m;const u=a(p);for(const b in i)i[b].protectedKeys={};return u}return{animateChanges:a,setActive:l,setAnimateFunction:g,getState:()=>i,reset:()=>{i=em(),d=!0}}}function jC(t,s){return typeof s=="string"?s!==t:Array.isArray(s)?!Lv(s,t):!1}function bs(t=!1){return{isActive:t,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function em(){return{animate:bs(!0),whileInView:bs(),whileHover:bs(),whileTap:bs(),whileDrag:bs(),whileFocus:bs(),exit:bs()}}function mu(t,s){t.min=s.min,t.max=s.max}function tr(t,s){mu(t.x,s.x),mu(t.y,s.y)}function tm(t,s){t.translate=s.translate,t.scale=s.scale,t.originPoint=s.originPoint,t.origin=s.origin}const Dv=1e-4,MC=1-Dv,OC=1+Dv,Av=.01,IC=0-Av,NC=0+Av;function _t(t){return t.max-t.min}function BC(t,s,i){return Math.abs(t-s)<=i}function rm(t,s,i,o=.5){t.origin=o,t.originPoint=Ue(s.min,s.max,t.origin),t.scale=_t(i)/_t(s),t.translate=Ue(i.min,i.max,t.origin)-t.originPoint,(t.scale>=MC&&t.scale<=OC||isNaN(t.scale))&&(t.scale=1),(t.translate>=IC&&t.translate<=NC||isNaN(t.translate))&&(t.translate=0)}function dn(t,s,i,o){rm(t.x,s.x,i.x,o?o.originX:void 0),rm(t.y,s.y,i.y,o?o.originY:void 0)}function sm(t,s,i,o=0){const d=o?Ue(i.min,i.max,o):i.min;t.min=d+s.min,t.max=t.min+_t(s)}function FC(t,s,i,o){sm(t.x,s.x,i.x,o==null?void 0:o.x),sm(t.y,s.y,i.y,o==null?void 0:o.y)}function im(t,s,i,o=0){const d=o?Ue(i.min,i.max,o):i.min;t.min=s.min-d,t.max=t.min+_t(s)}function ha(t,s,i,o){im(t.x,s.x,i.x,o==null?void 0:o.x),im(t.y,s.y,i.y,o==null?void 0:o.y)}function nm(t,s,i,o,d){return t-=s,t=da(t,1/i,o),d!==void 0&&(t=da(t,1/d,o)),t}function HC(t,s=0,i=1,o=.5,d,w=t,g=t){if(mr.test(s)&&(s=parseFloat(s),s=Ue(g.min,g.max,s/100)-g.min),typeof s!="number")return;let a=Ue(w.min,w.max,o);t===w&&(a-=s),t.min=nm(t.min,s,i,a,d),t.max=nm(t.max,s,i,a,d)}function om(t,s,[i,o,d],w,g){HC(t,s[i],s[o],s[d],s.scale,w,g)}const UC=["x","scaleX","originX"],WC=["y","scaleY","originY"];function am(t,s,i,o){om(t.x,s,UC,i?i.x:void 0,o?o.x:void 0),om(t.y,s,WC,i?i.y:void 0,o?o.y:void 0)}function lm(t){return t.translate===0&&t.scale===1}function jv(t){return lm(t.x)&&lm(t.y)}function cm(t,s){return t.min===s.min&&t.max===s.max}function VC(t,s){return cm(t.x,s.x)&&cm(t.y,s.y)}function um(t,s){return Math.round(t.min)===Math.round(s.min)&&Math.round(t.max)===Math.round(s.max)}function Mv(t,s){return um(t.x,s.x)&&um(t.y,s.y)}function dm(t){return _t(t.x)/_t(t.y)}function hm(t,s){return t.translate===s.translate&&t.scale===s.scale&&t.originPoint===s.originPoint}function dr(t){return[t("x"),t("y")]}function $C(t,s,i){let o="";const d=t.x.translate/s.x,w=t.y.translate/s.y,g=(i==null?void 0:i.z)||0;if((d||w||g)&&(o=`translate3d(${d}px, ${w}px, ${g}px) `),(s.x!==1||s.y!==1)&&(o+=`scale(${1/s.x}, ${1/s.y}) `),i){const{transformPerspective:p,rotate:m,rotateX:u,rotateY:x,skewX:b,skewY:E}=i;p&&(o=`perspective(${p}px) ${o}`),m&&(o+=`rotate(${m}deg) `),u&&(o+=`rotateX(${u}deg) `),x&&(o+=`rotateY(${x}deg) `),b&&(o+=`skewX(${b}deg) `),E&&(o+=`skewY(${E}deg) `)}const a=t.x.scale*s.x,l=t.y.scale*s.y;return(a!==1||l!==1)&&(o+=`scale(${a}, ${l})`),o||"none"}const Ov=["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"],zC=Ov.length,fm=t=>typeof t=="string"?parseFloat(t):t,pm=t=>typeof t=="number"||ve.test(t);function KC(t,s,i,o,d,w){d?(t.opacity=Ue(0,i.opacity??1,qC(o)),t.opacityExit=Ue(s.opacity??1,0,GC(o))):w&&(t.opacity=Ue(s.opacity??1,i.opacity??1,o));for(let g=0;g<zC;g++){const a=Ov[g];let l=mm(s,a),p=mm(i,a);if(l===void 0&&p===void 0)continue;l||(l=0),p||(p=0),l===0||p===0||pm(l)===pm(p)?(t[a]=Math.max(Ue(fm(l),fm(p),o),0),(mr.test(p)||mr.test(l))&&(t[a]+="%")):t[a]=p}(s.rotate||i.rotate)&&(t.rotate=Ue(s.rotate||0,i.rotate||0,o))}function mm(t,s){return t[s]!==void 0?t[s]:t.borderRadius}const qC=Iv(0,.5,Eg),GC=Iv(.5,.95,Kt);function Iv(t,s,i){return o=>o<t?0:o>s?1:i(mn(t,s,o))}function XC(t,s,i){const o=lt(t)?t:fi(t);return o.start(Vu("",o,s,i)),o.animation}function yn(t,s,i,o={passive:!0}){return t.addEventListener(s,i,o),()=>t.removeEventListener(s,i)}const JC=(t,s)=>t.depth-s.depth;class YC{constructor(){this.children=[],this.isDirty=!1}add(s){Lu(this.children,s),this.isDirty=!0}remove(s){na(this.children,s),this.isDirty=!0}forEach(s){this.isDirty&&this.children.sort(JC),this.isDirty=!1,this.children.forEach(s)}}function QC(t,s){const i=yt.now(),o=({timestamp:d})=>{const w=d-i;w>=s&&(ss(o),t(w-s))};return Ae.setup(o,!0),()=>ss(o)}function Qo(t){return lt(t)?t.get():t}class ZC{constructor(){this.members=[]}add(s){Lu(this.members,s);for(let i=this.members.length-1;i>=0;i--){const o=this.members[i];if(o===s||o===this.lead||o===this.prevLead)continue;const d=o.instance;(!d||d.isConnected===!1)&&!o.snapshot&&(na(this.members,o),o.unmount())}s.scheduleRender()}remove(s){if(na(this.members,s),s===this.prevLead&&(this.prevLead=void 0),s===this.lead){const i=this.members[this.members.length-1];i&&this.promote(i)}}relegate(s){var i;for(let o=this.members.indexOf(s)-1;o>=0;o--){const d=this.members[o];if(d.isPresent!==!1&&((i=d.instance)==null?void 0:i.isConnected)!==!1)return this.promote(d),!0}return!1}promote(s,i){var d;const o=this.lead;if(s!==o&&(this.prevLead=o,this.lead=s,s.show(),o)){o.updateSnapshot(),s.scheduleRender();const{layoutDependency:w}=o.options,{layoutDependency:g}=s.options;(w===void 0||w!==g)&&(s.resumeFrom=o,i&&(o.preserveOpacity=!0),o.snapshot&&(s.snapshot=o.snapshot,s.snapshot.latestValues=o.animationValues||o.latestValues),(d=s.root)!=null&&d.isUpdating&&(s.isLayoutDirty=!0)),s.options.crossfade===!1&&o.hide()}}exitAnimationComplete(){this.members.forEach(s=>{var i,o,d,w,g;(o=(i=s.options).onExitComplete)==null||o.call(i),(g=(d=s.resumingFrom)==null?void 0:(w=d.options).onExitComplete)==null||g.call(w)})}scheduleRender(){this.members.forEach(s=>s.instance&&s.scheduleRender(!1))}removeLeadSnapshot(){var s;(s=this.lead)!=null&&s.snapshot&&(this.lead.snapshot=void 0)}}const Zo={hasAnimatedSinceResize:!0,hasEverUpdated:!1},Bc=["","X","Y","Z"],ek=1e3;let tk=0;function Fc(t,s,i,o){const{latestValues:d}=s;d[t]&&(i[t]=d[t],s.setStaticValue(t,0),o&&(o[t]=0))}function Nv(t){if(t.hasCheckedOptimisedAppear=!0,t.root===t)return;const{visualElement:s}=t.options;if(!s)return;const i=sv(s);if(window.MotionHasOptimisedAnimation(i,"transform")){const{layout:d,layoutId:w}=t.options;window.MotionCancelOptimisedAnimation(i,"transform",Ae,!(d||w))}const{parent:o}=t;o&&!o.hasCheckedOptimisedAppear&&Nv(o)}function Bv({attachResizeListener:t,defaultParent:s,measureScroll:i,checkIsScrollRoot:o,resetTransform:d}){return class{constructor(g={},a=s==null?void 0:s()){this.id=tk++,this.animationId=0,this.animationCommitId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.layoutVersion=0,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,this.nodes.forEach(ik),this.nodes.forEach(uk),this.nodes.forEach(dk),this.nodes.forEach(nk)},this.resolvedRelativeTargetAt=0,this.linkedParentVersion=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=g,this.root=a?a.root||a:this,this.path=a?[...a.path,a]:[],this.parent=a,this.depth=a?a.depth+1:0;for(let l=0;l<this.path.length;l++)this.path[l].shouldResetTransform=!0;this.root===this&&(this.nodes=new YC)}addEventListener(g,a){return this.eventHandlers.has(g)||this.eventHandlers.set(g,new Au),this.eventHandlers.get(g).add(a)}notifyListeners(g,...a){const l=this.eventHandlers.get(g);l&&l.notify(...a)}hasListeners(g){return this.eventHandlers.has(g)}mount(g){if(this.instance)return;this.isSVG=Xu(g)&&!sC(g),this.instance=g;const{layoutId:a,layout:l,visualElement:p}=this.options;if(p&&!p.current&&p.mount(g),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),this.root.hasTreeAnimated&&(l||a)&&(this.isLayoutDirty=!0),t){let m,u=0;const x=()=>this.root.updateBlockedByResize=!1;Ae.read(()=>{u=window.innerWidth}),t(g,()=>{const b=window.innerWidth;b!==u&&(u=b,this.root.updateBlockedByResize=!0,m&&m(),m=QC(x,250),Zo.hasAnimatedSinceResize&&(Zo.hasAnimatedSinceResize=!1,this.nodes.forEach(ym)))})}a&&this.root.registerSharedNode(a,this),this.options.animate!==!1&&p&&(a||l)&&this.addEventListener("didUpdate",({delta:m,hasLayoutChanged:u,hasRelativeLayoutChanged:x,layout:b})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const E=this.options.transition||p.getDefaultTransition()||gk,{onLayoutAnimationStart:S,onLayoutAnimationComplete:c}=p.getProps(),y=!this.targetLayout||!Mv(this.targetLayout,b),h=!u&&x;if(this.options.layoutRoot||this.resumeFrom||h||u&&(y||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);const v={...Wu(E,"layout"),onPlay:S,onComplete:c};(p.shouldReduceMotion||this.options.layoutRoot)&&(v.delay=0,v.type=!1),this.startAnimation(v),this.setAnimationOrigin(m,h)}else u||ym(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=b})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const g=this.getStack();g&&g.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),ss(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(hk),this.animationId++)}getTransformTemplate(){const{visualElement:g}=this.options;return g&&g.getProps().transformTemplate}willUpdate(g=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&Nv(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let m=0;m<this.path.length;m++){const u=this.path[m];u.shouldResetTransform=!0,(typeof u.latestValues.x=="string"||typeof u.latestValues.y=="string")&&(u.isLayoutDirty=!0),u.updateScroll("snapshot"),u.options.layoutRoot&&u.willUpdate(!1)}const{layoutId:a,layout:l}=this.options;if(a===void 0&&!l)return;const p=this.getTransformTemplate();this.prevTransformTemplateValue=p?p(this.latestValues,""):void 0,this.updateSnapshot(),g&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){const l=this.updateBlockedByResize;this.unblockUpdate(),this.updateBlockedByResize=!1,this.clearAllSnapshots(),l&&this.nodes.forEach(ak),this.nodes.forEach(gm);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach(vm);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(lk),this.nodes.forEach(ck),this.nodes.forEach(rk),this.nodes.forEach(sk)):this.nodes.forEach(vm),this.clearAllSnapshots();const a=yt.now();at.delta=vr(0,1e3/60,a-at.timestamp),at.timestamp=a,at.isProcessing=!0,Lc.update.process(at),Lc.preRender.process(at),Lc.render.process(at),at.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,qu.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(ok),this.sharedNodes.forEach(fk)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,Ae.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){Ae.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!_t(this.snapshot.measuredBox.x)&&!_t(this.snapshot.measuredBox.y)&&(this.snapshot=void 0))}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let l=0;l<this.path.length;l++)this.path[l].updateScroll();const g=this.layout;this.layout=this.measure(!1),this.layoutVersion++,this.layoutCorrected||(this.layoutCorrected=Ze()),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:a}=this.options;a&&a.notify("LayoutMeasure",this.layout.layoutBox,g?g.layoutBox:void 0)}updateScroll(g="measure"){let a=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===g&&(a=!1),a&&this.instance){const l=o(this.instance);this.scroll={animationId:this.root.animationId,phase:g,isRoot:l,offset:i(this.instance),wasRoot:this.scroll?this.scroll.isRoot:l}}}resetTransform(){if(!d)return;const g=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,a=this.projectionDelta&&!jv(this.projectionDelta),l=this.getTransformTemplate(),p=l?l(this.latestValues,""):void 0,m=p!==this.prevTransformTemplateValue;g&&this.instance&&(a||ks(this.latestValues)||m)&&(d(this.instance,p),this.shouldResetTransform=!1,this.scheduleRender())}measure(g=!0){const a=this.measurePageBox();let l=this.removeElementScroll(a);return g&&(l=this.removeTransform(l)),vk(l),{animationId:this.root.animationId,measuredBox:a,layoutBox:l,latestValues:{},source:this.id}}measurePageBox(){var p;const{visualElement:g}=this.options;if(!g)return Ze();const a=g.measureViewportBox();if(!(((p=this.scroll)==null?void 0:p.wasRoot)||this.path.some(yk))){const{scroll:m}=this.root;m&&(hr(a.x,m.offset.x),hr(a.y,m.offset.y))}return a}removeElementScroll(g){var l;const a=Ze();if(tr(a,g),(l=this.scroll)!=null&&l.wasRoot)return a;for(let p=0;p<this.path.length;p++){const m=this.path[p],{scroll:u,options:x}=m;m!==this.root&&u&&x.layoutScroll&&(u.wasRoot&&tr(a,g),hr(a.x,u.offset.x),hr(a.y,u.offset.y))}return a}applyTransform(g,a=!1,l){var m,u;const p=l||Ze();tr(p,g);for(let x=0;x<this.path.length;x++){const b=this.path[x];!a&&b.options.layoutScroll&&b.scroll&&b!==b.root&&(hr(p.x,-b.scroll.offset.x),hr(p.y,-b.scroll.offset.y)),ks(b.latestValues)&&Yo(p,b.latestValues,(m=b.layout)==null?void 0:m.layoutBox)}return ks(this.latestValues)&&Yo(p,this.latestValues,(u=this.layout)==null?void 0:u.layoutBox),p}removeTransform(g){var l;const a=Ze();tr(a,g);for(let p=0;p<this.path.length;p++){const m=this.path[p];if(!ks(m.latestValues))continue;let u;m.instance&&(hu(m.latestValues)&&m.updateSnapshot(),u=Ze(),tr(u,m.measurePageBox())),am(a,m.latestValues,(l=m.snapshot)==null?void 0:l.layoutBox,u)}return ks(this.latestValues)&&am(a,this.latestValues),a}setTargetDelta(g){this.targetDelta=g,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(g){this.options={...this.options,...g,crossfade:g.crossfade!==void 0?g.crossfade:!0}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==at.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(g=!1){var b;const a=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=a.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=a.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=a.isSharedProjectionDirty);const l=!!this.resumingFrom||this!==a;if(!(g||l&&this.isSharedProjectionDirty||this.isProjectionDirty||(b=this.parent)!=null&&b.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:m,layoutId:u}=this.options;if(!this.layout||!(m||u))return;this.resolvedRelativeTargetAt=at.timestamp;const x=this.getClosestProjectingParent();x&&this.linkedParentVersion!==x.layoutVersion&&!x.options.layoutRoot&&this.removeRelativeTarget(),!this.targetDelta&&!this.relativeTarget&&(this.options.layoutAnchor!==!1&&x&&x.layout?this.createRelativeTarget(x,this.layout.layoutBox,x.layout.layoutBox):this.removeRelativeTarget()),!(!this.relativeTarget&&!this.targetDelta)&&(this.target||(this.target=Ze(),this.targetWithTransforms=Ze()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),FC(this.target,this.relativeTarget,this.relativeParent.target,this.options.layoutAnchor||void 0)):this.targetDelta?(this.resumingFrom?this.applyTransform(this.layout.layoutBox,!1,this.target):tr(this.target,this.layout.layoutBox),wv(this.target,this.targetDelta)):tr(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget&&(this.attemptToResolveRelativeTarget=!1,this.options.layoutAnchor!==!1&&x&&!!x.resumingFrom==!!this.resumingFrom&&!x.options.layoutScroll&&x.target&&this.animationProgress!==1?this.createRelativeTarget(x,this.target,x.target):this.relativeParent=this.relativeTarget=void 0))}getClosestProjectingParent(){if(!(!this.parent||hu(this.parent.latestValues)||xv(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}createRelativeTarget(g,a,l){this.relativeParent=g,this.linkedParentVersion=g.layoutVersion,this.forceRelativeParentToResolveTarget(),this.relativeTarget=Ze(),this.relativeTargetOrigin=Ze(),ha(this.relativeTargetOrigin,a,l,this.options.layoutAnchor||void 0),tr(this.relativeTarget,this.relativeTargetOrigin)}removeRelativeTarget(){this.relativeParent=this.relativeTarget=void 0}calcProjection(){var E;const g=this.getLead(),a=!!this.resumingFrom||this!==g;let l=!0;if((this.isProjectionDirty||(E=this.parent)!=null&&E.isProjectionDirty)&&(l=!1),a&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(l=!1),this.resolvedRelativeTargetAt===at.timestamp&&(l=!1),l)return;const{layout:p,layoutId:m}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(p||m))return;tr(this.layoutCorrected,this.layout.layoutBox);const u=this.treeScale.x,x=this.treeScale.y;pC(this.layoutCorrected,this.treeScale,this.path,a),g.layout&&!g.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(g.target=g.layout.layoutBox,g.targetWithTransforms=Ze());const{target:b}=g;if(!b){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(tm(this.prevProjectionDelta.x,this.projectionDelta.x),tm(this.prevProjectionDelta.y,this.projectionDelta.y)),dn(this.projectionDelta,this.layoutCorrected,b,this.latestValues),(this.treeScale.x!==u||this.treeScale.y!==x||!hm(this.projectionDelta.x,this.prevProjectionDelta.x)||!hm(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",b))}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(g=!0){var a;if((a=this.options.visualElement)==null||a.scheduleRender(),g){const l=this.getStack();l&&l.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=li(),this.projectionDelta=li(),this.projectionDeltaWithTransform=li()}setAnimationOrigin(g,a=!1){const l=this.snapshot,p=l?l.latestValues:{},m={...this.latestValues},u=li();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!a;const x=Ze(),b=l?l.source:void 0,E=this.layout?this.layout.source:void 0,S=b!==E,c=this.getStack(),y=!c||c.members.length<=1,h=!!(S&&!y&&this.options.crossfade===!0&&!this.path.some(mk));this.animationProgress=0;let v;this.mixTargetDelta=C=>{const R=C/1e3;_m(u.x,g.x,R),_m(u.y,g.y,R),this.setTargetDelta(u),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(ha(x,this.layout.layoutBox,this.relativeParent.layout.layoutBox,this.options.layoutAnchor||void 0),pk(this.relativeTarget,this.relativeTargetOrigin,x,R),v&&VC(this.relativeTarget,v)&&(this.isProjectionDirty=!1),v||(v=Ze()),tr(v,this.relativeTarget)),S&&(this.animationValues=m,KC(m,p,this.latestValues,R,h,y)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=R},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(g){var a,l,p;this.notifyListeners("animationStart"),(a=this.currentAnimation)==null||a.stop(),(p=(l=this.resumingFrom)==null?void 0:l.currentAnimation)==null||p.stop(),this.pendingAnimation&&(ss(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=Ae.update(()=>{Zo.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=fi(0)),this.motionValue.jump(0,!1),this.currentAnimation=XC(this.motionValue,[0,1e3],{...g,velocity:0,isSync:!0,onUpdate:m=>{this.mixTargetDelta(m),g.onUpdate&&g.onUpdate(m)},onStop:()=>{},onComplete:()=>{g.onComplete&&g.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const g=this.getStack();g&&g.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(ek),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const g=this.getLead();let{targetWithTransforms:a,target:l,layout:p,latestValues:m}=g;if(!(!a||!l||!p)){if(this!==g&&this.layout&&p&&Fv(this.options.animationType,this.layout.layoutBox,p.layoutBox)){l=this.target||Ze();const u=_t(this.layout.layoutBox.x);l.x.min=g.target.x.min,l.x.max=l.x.min+u;const x=_t(this.layout.layoutBox.y);l.y.min=g.target.y.min,l.y.max=l.y.min+x}tr(a,l),Yo(a,m),dn(this.projectionDeltaWithTransform,this.layoutCorrected,a,m)}}registerSharedNode(g,a){this.sharedNodes.has(g)||this.sharedNodes.set(g,new ZC),this.sharedNodes.get(g).add(a);const p=a.options.initialPromotionConfig;a.promote({transition:p?p.transition:void 0,preserveFollowOpacity:p&&p.shouldPreserveFollowOpacity?p.shouldPreserveFollowOpacity(a):void 0})}isLead(){const g=this.getStack();return g?g.lead===this:!0}getLead(){var a;const{layoutId:g}=this.options;return g?((a=this.getStack())==null?void 0:a.lead)||this:this}getPrevLead(){var a;const{layoutId:g}=this.options;return g?(a=this.getStack())==null?void 0:a.prevLead:void 0}getStack(){const{layoutId:g}=this.options;if(g)return this.root.sharedNodes.get(g)}promote({needsReset:g,transition:a,preserveFollowOpacity:l}={}){const p=this.getStack();p&&p.promote(this,l),g&&(this.projectionDelta=void 0,this.needsReset=!0),a&&this.setOptions({transition:a})}relegate(){const g=this.getStack();return g?g.relegate(this):!1}resetSkewAndRotation(){const{visualElement:g}=this.options;if(!g)return;let a=!1;const{latestValues:l}=g;if((l.z||l.rotate||l.rotateX||l.rotateY||l.rotateZ||l.skewX||l.skewY)&&(a=!0),!a)return;const p={};l.z&&Fc("z",g,p,this.animationValues);for(let m=0;m<Bc.length;m++)Fc(`rotate${Bc[m]}`,g,p,this.animationValues),Fc(`skew${Bc[m]}`,g,p,this.animationValues);g.render();for(const m in p)g.setStaticValue(m,p[m]),this.animationValues&&(this.animationValues[m]=p[m]);g.scheduleRender()}applyProjectionStyles(g,a){if(!this.instance||this.isSVG)return;if(!this.isVisible){g.visibility="hidden";return}const l=this.getTransformTemplate();if(this.needsReset){this.needsReset=!1,g.visibility="",g.opacity="",g.pointerEvents=Qo(a==null?void 0:a.pointerEvents)||"",g.transform=l?l(this.latestValues,""):"none";return}const p=this.getLead();if(!this.projectionDelta||!this.layout||!p.target){this.options.layoutId&&(g.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,g.pointerEvents=Qo(a==null?void 0:a.pointerEvents)||""),this.hasProjected&&!ks(this.latestValues)&&(g.transform=l?l({},""):"none",this.hasProjected=!1);return}g.visibility="";const m=p.animationValues||p.latestValues;this.applyTransformsToTarget();let u=$C(this.projectionDeltaWithTransform,this.treeScale,m);l&&(u=l(m,u)),g.transform=u;const{x,y:b}=this.projectionDelta;g.transformOrigin=`${x.origin*100}% ${b.origin*100}% 0`,p.animationValues?g.opacity=p===this?m.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:m.opacityExit:g.opacity=p===this?m.opacity!==void 0?m.opacity:"":m.opacityExit!==void 0?m.opacityExit:0;for(const E in pu){if(m[E]===void 0)continue;const{correct:S,applyTo:c,isCSSVariable:y}=pu[E],h=u==="none"?m[E]:S(m[E],p);if(c){const v=c.length;for(let C=0;C<v;C++)g[c[C]]=h}else y?this.options.visualElement.renderState.vars[E]=h:g[E]=h}this.options.layoutId&&(g.pointerEvents=p===this?Qo(a==null?void 0:a.pointerEvents)||"":"none")}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(g=>{var a;return(a=g.currentAnimation)==null?void 0:a.stop()}),this.root.nodes.forEach(gm),this.root.sharedNodes.clear()}}}function rk(t){t.updateLayout()}function sk(t){var i;const s=((i=t.resumeFrom)==null?void 0:i.snapshot)||t.snapshot;if(t.isLead()&&t.layout&&s&&t.hasListeners("didUpdate")){const{layoutBox:o,measuredBox:d}=t.layout,{animationType:w}=t.options,g=s.source!==t.layout.source;if(w==="size")dr(u=>{const x=g?s.measuredBox[u]:s.layoutBox[u],b=_t(x);x.min=o[u].min,x.max=x.min+b});else if(w==="x"||w==="y"){const u=w==="x"?"y":"x";mu(g?s.measuredBox[u]:s.layoutBox[u],o[u])}else Fv(w,s.layoutBox,o)&&dr(u=>{const x=g?s.measuredBox[u]:s.layoutBox[u],b=_t(o[u]);x.max=x.min+b,t.relativeTarget&&!t.currentAnimation&&(t.isProjectionDirty=!0,t.relativeTarget[u].max=t.relativeTarget[u].min+b)});const a=li();dn(a,o,s.layoutBox);const l=li();g?dn(l,t.applyTransform(d,!0),s.measuredBox):dn(l,o,s.layoutBox);const p=!jv(a);let m=!1;if(!t.resumeFrom){const u=t.getClosestProjectingParent();if(u&&!u.resumeFrom){const{snapshot:x,layout:b}=u;if(x&&b){const E=t.options.layoutAnchor||void 0,S=Ze();ha(S,s.layoutBox,x.layoutBox,E);const c=Ze();ha(c,o,b.layoutBox,E),Mv(S,c)||(m=!0),u.options.layoutRoot&&(t.relativeTarget=c,t.relativeTargetOrigin=S,t.relativeParent=u)}}}t.notifyListeners("didUpdate",{layout:o,snapshot:s,delta:l,layoutDelta:a,hasLayoutChanged:p,hasRelativeLayoutChanged:m})}else if(t.isLead()){const{onExitComplete:o}=t.options;o&&o()}t.options.transition=void 0}function ik(t){t.parent&&(t.isProjecting()||(t.isProjectionDirty=t.parent.isProjectionDirty),t.isSharedProjectionDirty||(t.isSharedProjectionDirty=!!(t.isProjectionDirty||t.parent.isProjectionDirty||t.parent.isSharedProjectionDirty)),t.isTransformDirty||(t.isTransformDirty=t.parent.isTransformDirty))}function nk(t){t.isProjectionDirty=t.isSharedProjectionDirty=t.isTransformDirty=!1}function ok(t){t.clearSnapshot()}function gm(t){t.clearMeasurements()}function ak(t){t.isLayoutDirty=!0,t.updateLayout()}function vm(t){t.isLayoutDirty=!1}function lk(t){t.isAnimationBlocked&&t.layout&&!t.isLayoutDirty&&(t.snapshot=t.layout,t.isLayoutDirty=!0)}function ck(t){const{visualElement:s}=t.options;s&&s.getProps().onBeforeLayoutMeasure&&s.notify("BeforeLayoutMeasure"),t.resetTransform()}function ym(t){t.finishAnimation(),t.targetDelta=t.relativeTarget=t.target=void 0,t.isProjectionDirty=!0}function uk(t){t.resolveTargetDelta()}function dk(t){t.calcProjection()}function hk(t){t.resetSkewAndRotation()}function fk(t){t.removeLeadSnapshot()}function _m(t,s,i){t.translate=Ue(s.translate,0,i),t.scale=Ue(s.scale,1,i),t.origin=s.origin,t.originPoint=s.originPoint}function xm(t,s,i,o){t.min=Ue(s.min,i.min,o),t.max=Ue(s.max,i.max,o)}function pk(t,s,i,o){xm(t.x,s.x,i.x,o),xm(t.y,s.y,i.y,o)}function mk(t){return t.animationValues&&t.animationValues.opacityExit!==void 0}const gk={duration:.45,ease:[.4,0,.1,1]},wm=t=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(t),Sm=wm("applewebkit/")&&!wm("chrome/")?Math.round:Kt;function bm(t){t.min=Sm(t.min),t.max=Sm(t.max)}function vk(t){bm(t.x),bm(t.y)}function Fv(t,s,i){return t==="position"||t==="preserve-aspect"&&!BC(dm(s),dm(i),.2)}function yk(t){var s;return t!==t.root&&((s=t.scroll)==null?void 0:s.wasRoot)}const _k=Bv({attachResizeListener:(t,s)=>yn(t,"resize",s),measureScroll:()=>{var t,s;return{x:document.documentElement.scrollLeft||((t=document.body)==null?void 0:t.scrollLeft)||0,y:document.documentElement.scrollTop||((s=document.body)==null?void 0:s.scrollTop)||0}},checkIsScrollRoot:()=>!0}),Hc={current:void 0},Hv=Bv({measureScroll:t=>({x:t.scrollLeft,y:t.scrollTop}),defaultParent:()=>{if(!Hc.current){const t=new _k({});t.mount(window),t.setOptions({layoutScroll:!0}),Hc.current=t}return Hc.current},resetTransform:(t,s)=>{t.style.transform=s!==void 0?s:"none"},checkIsScrollRoot:t=>window.getComputedStyle(t).position==="fixed"}),ed=W.createContext({transformPagePoint:t=>t,isStatic:!1,reducedMotion:"never"});function Cm(t,s){if(typeof t=="function")return t(s);t!=null&&(t.current=s)}function xk(...t){return s=>{let i=!1;const o=t.map(d=>{const w=Cm(d,s);return!i&&typeof w=="function"&&(i=!0),w});if(i)return()=>{for(let d=0;d<o.length;d++){const w=o[d];typeof w=="function"?w():Cm(t[d],null)}}}}function wk(...t){return W.useCallback(xk(...t),t)}class Sk extends W.Component{getSnapshotBeforeUpdate(s){const i=this.props.childRef.current;if(qo(i)&&s.isPresent&&!this.props.isPresent&&this.props.pop!==!1){const o=i.offsetParent,d=qo(o)&&o.offsetWidth||0,w=qo(o)&&o.offsetHeight||0,g=getComputedStyle(i),a=this.props.sizeRef.current;a.height=parseFloat(g.height),a.width=parseFloat(g.width),a.top=i.offsetTop,a.left=i.offsetLeft,a.right=d-a.width-a.left,a.bottom=w-a.height-a.top}return null}componentDidUpdate(){}render(){return this.props.children}}function bk({children:t,isPresent:s,anchorX:i,anchorY:o,root:d,pop:w}){var x;const g=W.useId(),a=W.useRef(null),l=W.useRef({width:0,height:0,top:0,left:0,right:0,bottom:0}),{nonce:p}=W.useContext(ed),m=((x=t.props)==null?void 0:x.ref)??(t==null?void 0:t.ref),u=wk(a,m);return W.useInsertionEffect(()=>{const{width:b,height:E,top:S,left:c,right:y,bottom:h}=l.current;if(s||w===!1||!a.current||!b||!E)return;const v=i==="left"?`left: ${c}`:`right: ${y}`,C=o==="bottom"?`bottom: ${h}`:`top: ${S}`;a.current.dataset.motionPopId=g;const R=document.createElement("style");p&&(R.nonce=p);const L=d??document.head;return L.appendChild(R),R.sheet&&R.sheet.insertRule(`
123
123
  [data-motion-pop-id="${g}"] {
124
124
  position: absolute !important;