@inkeep/open-knowledge 0.33.0-beta.8 → 0.33.0-beta.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/skills/discovery/SKILL.md +1 -1
- package/dist/assets/skills/project/SKILL.md +1 -1
- package/dist/cli.mjs +7 -7
- package/dist/config-schema.json +3 -3
- package/dist/config.project-local.schema.json +3 -3
- package/dist/constants-DhO9HwoR.mjs +2 -0
- package/dist/{dist-petOQDm6.mjs → dist-ByRE-TiH.mjs} +6 -6
- package/dist/{dist-gqZDYmIG.mjs → dist-CCGDZSiV.mjs} +2 -2
- package/dist/{dist-DNDjbkqL.mjs → dist-CPJ9FkgX.mjs} +1 -1
- package/dist/{gh-detect-DT6DqKGM.mjs → gh-detect-DRASN_qx.mjs} +2 -2
- package/dist/git-handle-CetHWc5A-BpfHLi3S.mjs +1 -0
- package/dist/{git-handle-dKyep_oZ-B7s7m6CJ.mjs → git-handle-dKyep_oZ-eDHPK5PI.mjs} +2 -2
- package/dist/index.mjs +1 -1
- package/dist/{init-Cd8PBJVt.mjs → init-BGjbl-F7.mjs} +3 -3
- package/dist/init-sNMP_ZQL.mjs +1 -0
- package/dist/{launch-json-removal-IVHDIhZ7.mjs → launch-json-removal-BkOXBtkU.mjs} +2 -2
- package/dist/{loader-BQIdrq0w.mjs → loader-C0JuN2jI.mjs} +2 -2
- package/dist/loader-ECrQWruE.mjs +1 -0
- package/dist/{open-browser-BMVg3r9e.mjs → open-browser-DNqvAiIh.mjs} +2 -2
- package/dist/preview-C1BQRhhO.mjs +1 -0
- package/dist/{preview-BMzX6OEA.mjs → preview-mEnD1Tq1.mjs} +2 -2
- package/dist/public/assets/{ActivityModeContent-Cxs8_d9h.js → ActivityModeContent-jsCTPiun.js} +1 -1
- package/dist/public/assets/{CodeMirrorPropInput-f5pC607I.js → CodeMirrorPropInput-cmSiPzan.js} +1 -1
- package/dist/public/assets/{DocumentContext-ogFq9Apo.js → DocumentContext-CNzSFsI-.js} +1 -1
- package/dist/public/assets/{EnableSyncConfirmDialog-CEMiBdy3.js → EnableSyncConfirmDialog-D_NbuJ59.js} +1 -1
- package/dist/public/assets/{GraphPanel-CT4Uax7w.js → GraphPanel-BrqHgLjs.js} +1 -1
- package/dist/public/assets/{ManagedArtifactProperties-BfEt7bIb.js → ManagedArtifactProperties-DqTT5fPT.js} +1 -1
- package/dist/public/assets/{McpConsentDialogBody-DoSFKWJ-.js → McpConsentDialogBody-BrfdQb16.js} +1 -1
- package/dist/public/assets/{MermaidDocEditor-CJFsgS7x.js → MermaidDocEditor-B_dNhePY.js} +1 -1
- package/dist/public/assets/{PropertyPanel-DpYcGGW2.js → PropertyPanel-Dkz1gPoU.js} +1 -1
- package/dist/public/assets/{ReportBugDialogBody-C0pCt3Po.js → ReportBugDialogBody-CCKV6nZY.js} +1 -1
- package/dist/public/assets/{SettingsDialogBody-04WyfuHT.js → SettingsDialogBody-BxTayjY8.js} +1 -1
- package/dist/public/assets/{ShareBranchSwitchDialog-DGcSbhKt.js → ShareBranchSwitchDialog-BhekOXUp.js} +1 -1
- package/dist/public/assets/{ShareReceiveDialog-Dp0wMb0C.js → ShareReceiveDialog-o5dNBk6Q.js} +1 -1
- package/dist/public/assets/{ShareReceiveMissDialog-BaOnOALv.js → ShareReceiveMissDialog-UODMw9si.js} +1 -1
- package/dist/public/assets/{SkillEditorActions-RqGqr20K.js → SkillEditorActions-euGEb-E6.js} +1 -1
- package/dist/public/assets/{SourceEditor-DeLqYSaV.js → SourceEditor-CORtf1FY.js} +1 -1
- package/dist/public/assets/{TerminalPanel-D93QQMrM.js → TerminalPanel-g64JYtbc.js} +1 -1
- package/dist/public/assets/{agent-presence-D2eASrH_.js → agent-presence-D3uA1hrz.js} +1 -1
- package/dist/public/assets/{auth-state-cache-CijiQXmK.js → auth-state-cache-DCv4Whjc.js} +1 -1
- package/dist/public/assets/{config-provider-BGFykK9q.js → config-provider-DVy-GqC5.js} +1 -1
- package/dist/public/assets/{dist-CurDB4OA.js → dist-DkRtDyLN.js} +1 -1
- package/dist/public/assets/{dist-TX_NQU76.js → dist-Dl_HewkW.js} +1 -1
- package/dist/public/assets/{doc-hash-CZiGDoto.js → doc-hash-BDRwCcvB.js} +1 -1
- package/dist/public/assets/{documents-events-BgIyZo2W.js → documents-events-CJpJUM_N.js} +1 -1
- package/dist/public/assets/{file-tree-adapter-Dubqn9yJ.js → file-tree-adapter-_1h6_EGw.js} +1 -1
- package/dist/public/assets/{index-CxZGz7om.js → index-FValh7LC.js} +8 -8
- package/dist/public/assets/{lint-config-client-VuF6BI2d.js → lint-config-client-CX_cssoL.js} +1 -1
- package/dist/public/assets/{navigation-targets-D_g_oD3p.js → navigation-targets-S-8o5DE_.js} +1 -1
- package/dist/public/assets/{open-managed-artifact-tab-jUT5uxaf.js → open-managed-artifact-tab-tiXawScj.js} +1 -1
- package/dist/public/assets/{pending-receive-nav-store-BqFe0QyH.js → pending-receive-nav-store-BUhyCKTL.js} +1 -1
- package/dist/public/assets/{prop-types-r4lrTXmC.js → prop-types-Cr0Uib4q.js} +1 -1
- package/dist/public/assets/{receive-store-DL3XQSe9.js → receive-store-DYDEnyEg.js} +1 -1
- package/dist/public/assets/{selection-context-DRS0xWzo.js → selection-context-BjmeTT0v.js} +1 -1
- package/dist/public/assets/{skill-actions-CqFXEGI_.js → skill-actions-32qU2dgG.js} +1 -1
- package/dist/public/assets/{skills-api-ChqmqNEn.js → skills-api-UJqRM51N.js} +1 -1
- package/dist/public/assets/{src-B_OV9KU-.js → src-CBkac3Ms.js} +1 -1
- package/dist/public/assets/{target-navigation-intent-CYYSTgIq.js → target-navigation-intent-BFsJN8Kr.js} +1 -1
- package/dist/public/assets/{typing-burst-detector-ByylQ2W5.js → typing-burst-detector-CekoPsaO.js} +1 -1
- package/dist/public/assets/{use-apply-config-color-theme-DJU29ygF.js → use-apply-config-color-theme-CUJwxTbn.js} +1 -1
- package/dist/public/assets/{workspace-paths-DGpjh0_R.js → workspace-paths-r1tSwfOd.js} +1 -1
- package/dist/public/index.html +26 -26
- package/dist/{repair-launch-json-7_q6bQTJ.mjs → repair-launch-json-DX3G-SfV.mjs} +2 -2
- package/dist/{repair-mcp-configs-DBYbPrkl.mjs → repair-mcp-configs-CUHrcUTa.mjs} +2 -2
- package/dist/{repair-skills-BSRgI3Qd.mjs → repair-skills-BLdSucBd.mjs} +2 -2
- package/dist/repair-skills-BOkpuUWV.mjs +1 -0
- package/dist/schemas/v0/config.project-local.schema.json +3 -3
- package/dist/server-lock-GuuouVft-BJoBhhhn.mjs +1 -0
- package/dist/{server-lock-iLcBw_q0-CSsXlPB8.mjs → server-lock-iLcBw_q0-Bmk5FT76.mjs} +2 -2
- package/dist/{src-DXDSmJ9V.mjs → src-Bzia_wR-.mjs} +2 -2
- package/dist/{start-BE4eU7Mm.mjs → start-B3oqzXtV.mjs} +2 -2
- package/dist/start-DMf1yZZ6.mjs +1 -0
- package/dist/{write-project-skill-CQSo7jpP.mjs → write-project-skill-0vVDpckX.mjs} +2 -2
- package/package.json +1 -1
- package/dist/constants-DYHcCRbP.mjs +0 -2
- package/dist/git-handle-CetHWc5A-BcCPg15N.mjs +0 -1
- package/dist/init-EQZFWmhG.mjs +0 -1
- package/dist/loader-BEGv7CMu.mjs +0 -1
- package/dist/preview-DPIJSR9a.mjs +0 -1
- package/dist/repair-skills-DMIeifIr.mjs +0 -1
- package/dist/server-lock-GuuouVft-mEG_NG6z.mjs +0 -1
- package/dist/start-DrtigDx4.mjs +0 -1
|
@@ -143,7 +143,7 @@ $&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,`$1$2`).replace(/\
|
|
|
143
143
|
|
|
144
144
|
`)}t.write(`payload.value = newResult;`),t.write(`return payload;`);let s=t.compile();return(t,n)=>s(e,t,n)},a,o=Fr,s=!br.jitless,c=s&&Ir.value,l=t.catchall,u;e._zod.parse=(d,f)=>{u??=r.value;let p=d.value;return o(p)?s&&c&&f?.async===!1&&f.jitless!==!0?(a||=i(t.shape),d=a(d,f),l?Ua([],p,d,f,u,e):d):n(d,f):(d.issues.push({expected:`object`,code:`invalid_type`,input:p,inst:e}),d)}});function Ka(e,t,n,r){for(let n of e)if(n.issues.length===0)return t.value=n.value,t;let i=e.filter(e=>!Jr(e));return i.length===1?(t.value=i[0].value,i[0]):(t.issues.push({code:`invalid_union`,input:t.value,inst:n,errors:e.map(e=>e.issues.map(e=>Zr(e,r,xr())))}),t)}var qa=D(`$ZodUnion`,(e,t)=>{ia.init(e,t),kr(e._zod,`optin`,()=>t.options.some(e=>e._zod.optin===`optional`)?`optional`:void 0),kr(e._zod,`optout`,()=>t.options.some(e=>e._zod.optout===`optional`)?`optional`:void 0),kr(e._zod,`values`,()=>{if(t.options.every(e=>e._zod.values))return new Set(t.options.flatMap(e=>Array.from(e._zod.values)))}),kr(e._zod,`pattern`,()=>{if(t.options.every(e=>e._zod.pattern)){let e=t.options.map(e=>e._zod.pattern);return RegExp(`^(${e.map(e=>Er(e.source)).join(`|`)})$`)}});let n=t.options.length===1,r=t.options[0]._zod.run;e._zod.parse=(i,a)=>{if(n)return r(i,a);let o=!1,s=[];for(let e of t.options){let t=e._zod.run({value:i.value,issues:[]},a);if(t instanceof Promise)s.push(t),o=!0;else{if(t.issues.length===0)return t;s.push(t)}}return o?Promise.all(s).then(t=>Ka(t,i,e,a)):Ka(s,i,e,a)}}),Ja=D(`$ZodDiscriminatedUnion`,(e,t)=>{t.inclusive=!1,qa.init(e,t);let n=e._zod.parse;kr(e._zod,`propValues`,()=>{let e={};for(let n of t.options){let r=n._zod.propValues;if(!r||Object.keys(r).length===0)throw Error(`Invalid discriminated union option at index "${t.options.indexOf(n)}"`);for(let[t,n]of Object.entries(r)){e[t]||(e[t]=new Set);for(let r of n)e[t].add(r)}}return e});let r=wr(()=>{let e=t.options,n=new Map;for(let r of e){let e=r._zod.propValues?.[t.discriminator];if(!e||e.size===0)throw Error(`Invalid discriminated union option at index "${t.options.indexOf(r)}"`);for(let t of e){if(n.has(t))throw Error(`Duplicate discriminator value "${String(t)}"`);n.set(t,r)}}return n});e._zod.parse=(i,a)=>{let o=i.value;if(!Fr(o))return i.issues.push({code:`invalid_type`,expected:`object`,input:o,inst:e}),i;let s=r.value.get(o?.[t.discriminator]);return s?s._zod.run(i,a):t.unionFallback?n(i,a):(i.issues.push({code:`invalid_union`,errors:[],note:`No matching discriminator`,discriminator:t.discriminator,input:o,path:[t.discriminator],inst:e}),i)}}),Ya=D(`$ZodIntersection`,(e,t)=>{ia.init(e,t),e._zod.parse=(e,n)=>{let r=e.value,i=t.left._zod.run({value:r,issues:[]},n),a=t.right._zod.run({value:r,issues:[]},n);return i instanceof Promise||a instanceof Promise?Promise.all([i,a]).then(([t,n])=>Za(e,t,n)):Za(e,i,a)}});function Xa(e,t){if(e===t||e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(Lr(e)&&Lr(t)){let n=Object.keys(t),r=Object.keys(e).filter(e=>n.indexOf(e)!==-1),i={...e,...t};for(let n of r){let r=Xa(e[n],t[n]);if(!r.valid)return{valid:!1,mergeErrorPath:[n,...r.mergeErrorPath]};i[n]=r.data}return{valid:!0,data:i}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};let n=[];for(let r=0;r<e.length;r++){let i=e[r],a=t[r],o=Xa(i,a);if(!o.valid)return{valid:!1,mergeErrorPath:[r,...o.mergeErrorPath]};n.push(o.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function Za(e,t,n){let r=new Map,i;for(let n of t.issues)if(n.code===`unrecognized_keys`){i??=n;for(let e of n.keys)r.has(e)||r.set(e,{}),r.get(e).l=!0}else e.issues.push(n);for(let t of n.issues)if(t.code===`unrecognized_keys`)for(let e of t.keys)r.has(e)||r.set(e,{}),r.get(e).r=!0;else e.issues.push(t);let a=[...r].filter(([,e])=>e.l&&e.r).map(([e])=>e);if(a.length&&i&&e.issues.push({...i,keys:a}),Jr(e))return e;let o=Xa(t.value,n.value);if(!o.valid)throw Error(`Unmergable intersection. Error path: ${JSON.stringify(o.mergeErrorPath)}`);return e.value=o.data,e}var Qa=D(`$ZodRecord`,(e,t)=>{ia.init(e,t),e._zod.parse=(n,r)=>{let i=n.value;if(!Lr(i))return n.issues.push({expected:`record`,code:`invalid_type`,input:i,inst:e}),n;let a=[],o=t.keyType._zod.values;if(o){n.value={};let s=new Set;for(let e of o)if(typeof e==`string`||typeof e==`number`||typeof e==`symbol`){s.add(typeof e==`number`?e.toString():e);let o=t.valueType._zod.run({value:i[e],issues:[]},r);o instanceof Promise?a.push(o.then(t=>{t.issues.length&&n.issues.push(...Yr(e,t.issues)),n.value[e]=t.value})):(o.issues.length&&n.issues.push(...Yr(e,o.issues)),n.value[e]=o.value)}let c;for(let e in i)s.has(e)||(c??=[],c.push(e));c&&c.length>0&&n.issues.push({code:`unrecognized_keys`,input:i,inst:e,keys:c})}else{n.value={};for(let o of Reflect.ownKeys(i)){if(o===`__proto__`)continue;let s=t.keyType._zod.run({value:o,issues:[]},r);if(s instanceof Promise)throw Error(`Async schemas not supported in object keys currently`);if(typeof o==`string`&&Pi.test(o)&&s.issues.length){let e=t.keyType._zod.run({value:Number(o),issues:[]},r);if(e instanceof Promise)throw Error(`Async schemas not supported in object keys currently`);e.issues.length===0&&(s=e)}if(s.issues.length){t.mode===`loose`?n.value[o]=i[o]:n.issues.push({code:`invalid_key`,origin:`record`,issues:s.issues.map(e=>Zr(e,r,xr())),input:o,path:[o],inst:e});continue}let c=t.valueType._zod.run({value:i[o],issues:[]},r);c instanceof Promise?a.push(c.then(e=>{e.issues.length&&n.issues.push(...Yr(o,e.issues)),n.value[s.value]=e.value})):(c.issues.length&&n.issues.push(...Yr(o,c.issues)),n.value[s.value]=c.value)}}return a.length?Promise.all(a).then(()=>n):n}}),$a=D(`$ZodEnum`,(e,t)=>{ia.init(e,t);let n=Sr(t.entries),r=new Set(n);e._zod.values=r,e._zod.pattern=RegExp(`^(${n.filter(e=>zr.has(typeof e)).map(e=>typeof e==`string`?Br(e):e.toString()).join(`|`)})$`),e._zod.parse=(t,i)=>{let a=t.value;return r.has(a)||t.issues.push({code:`invalid_value`,values:n,input:a,inst:e}),t}}),eo=D(`$ZodLiteral`,(e,t)=>{if(ia.init(e,t),t.values.length===0)throw Error(`Cannot create literal schema with no valid values`);let n=new Set(t.values);e._zod.values=n,e._zod.pattern=RegExp(`^(${t.values.map(e=>typeof e==`string`?Br(e):e?Br(e.toString()):String(e)).join(`|`)})$`),e._zod.parse=(r,i)=>{let a=r.value;return n.has(a)||r.issues.push({code:`invalid_value`,values:t.values,input:a,inst:e}),r}}),to=D(`$ZodTransform`,(e,t)=>{ia.init(e,t),e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new yr(e.constructor.name);let i=t.transform(n.value,n);if(r.async)return(i instanceof Promise?i:Promise.resolve(i)).then(e=>(n.value=e,n));if(i instanceof Promise)throw new vr;return n.value=i,n}});function no(e,t){return e.issues.length&&t===void 0?{issues:[],value:void 0}:e}var ro=D(`$ZodOptional`,(e,t)=>{ia.init(e,t),e._zod.optin=`optional`,e._zod.optout=`optional`,kr(e._zod,`values`,()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),kr(e._zod,`pattern`,()=>{let e=t.innerType._zod.pattern;return e?RegExp(`^(${Er(e.source)})?$`):void 0}),e._zod.parse=(e,n)=>{if(t.innerType._zod.optin===`optional`){let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(t=>no(t,e.value)):no(r,e.value)}return e.value===void 0?e:t.innerType._zod.run(e,n)}}),io=D(`$ZodExactOptional`,(e,t)=>{ro.init(e,t),kr(e._zod,`values`,()=>t.innerType._zod.values),kr(e._zod,`pattern`,()=>t.innerType._zod.pattern),e._zod.parse=(e,n)=>t.innerType._zod.run(e,n)}),ao=D(`$ZodNullable`,(e,t)=>{ia.init(e,t),kr(e._zod,`optin`,()=>t.innerType._zod.optin),kr(e._zod,`optout`,()=>t.innerType._zod.optout),kr(e._zod,`pattern`,()=>{let e=t.innerType._zod.pattern;return e?RegExp(`^(${Er(e.source)}|null)$`):void 0}),kr(e._zod,`values`,()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(e,n)=>e.value===null?e:t.innerType._zod.run(e,n)}),oo=D(`$ZodDefault`,(e,t)=>{ia.init(e,t),e._zod.optin=`optional`,kr(e._zod,`values`,()=>t.innerType._zod.values),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);if(e.value===void 0)return e.value=t.defaultValue,e;let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(e=>so(e,t)):so(r,t)}});function so(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}var co=D(`$ZodPrefault`,(e,t)=>{ia.init(e,t),e._zod.optin=`optional`,kr(e._zod,`values`,()=>t.innerType._zod.values),e._zod.parse=(e,n)=>(n.direction===`backward`||e.value===void 0&&(e.value=t.defaultValue),t.innerType._zod.run(e,n))}),lo=D(`$ZodNonOptional`,(e,t)=>{ia.init(e,t),kr(e._zod,`values`,()=>{let e=t.innerType._zod.values;return e?new Set([...e].filter(e=>e!==void 0)):void 0}),e._zod.parse=(n,r)=>{let i=t.innerType._zod.run(n,r);return i instanceof Promise?i.then(t=>uo(t,e)):uo(i,e)}});function uo(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:`invalid_type`,expected:`nonoptional`,input:e.value,inst:t}),e}var fo=D(`$ZodCatch`,(e,t)=>{ia.init(e,t),kr(e._zod,`optin`,()=>t.innerType._zod.optin),kr(e._zod,`optout`,()=>t.innerType._zod.optout),kr(e._zod,`values`,()=>t.innerType._zod.values),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(r=>(e.value=r.value,r.issues.length&&(e.value=t.catchValue({...e,error:{issues:r.issues.map(e=>Zr(e,n,xr()))},input:e.value}),e.issues=[]),e)):(e.value=r.value,r.issues.length&&(e.value=t.catchValue({...e,error:{issues:r.issues.map(e=>Zr(e,n,xr()))},input:e.value}),e.issues=[]),e)}}),po=D(`$ZodPipe`,(e,t)=>{ia.init(e,t),kr(e._zod,`values`,()=>t.in._zod.values),kr(e._zod,`optin`,()=>t.in._zod.optin),kr(e._zod,`optout`,()=>t.out._zod.optout),kr(e._zod,`propValues`,()=>t.in._zod.propValues),e._zod.parse=(e,n)=>{if(n.direction===`backward`){let r=t.out._zod.run(e,n);return r instanceof Promise?r.then(e=>mo(e,t.in,n)):mo(r,t.in,n)}let r=t.in._zod.run(e,n);return r instanceof Promise?r.then(e=>mo(e,t.out,n)):mo(r,t.out,n)}});function mo(e,t,n){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},n)}var ho=D(`$ZodReadonly`,(e,t)=>{ia.init(e,t),kr(e._zod,`propValues`,()=>t.innerType._zod.propValues),kr(e._zod,`values`,()=>t.innerType._zod.values),kr(e._zod,`optin`,()=>t.innerType?._zod?.optin),kr(e._zod,`optout`,()=>t.innerType?._zod?.optout),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(go):go(r)}});function go(e){return e.value=Object.freeze(e.value),e}var _o=D(`$ZodLazy`,(e,t)=>{ia.init(e,t),kr(e._zod,`innerType`,()=>t.getter()),kr(e._zod,`pattern`,()=>e._zod.innerType?._zod?.pattern),kr(e._zod,`propValues`,()=>e._zod.innerType?._zod?.propValues),kr(e._zod,`optin`,()=>e._zod.innerType?._zod?.optin??void 0),kr(e._zod,`optout`,()=>e._zod.innerType?._zod?.optout??void 0),e._zod.parse=(t,n)=>e._zod.innerType._zod.run(t,n)}),vo=D(`$ZodCustom`,(e,t)=>{zi.init(e,t),ia.init(e,t),e._zod.parse=(e,t)=>e,e._zod.check=n=>{let r=n.value,i=t.fn(r);if(i instanceof Promise)return i.then(t=>yo(t,n,r,e));yo(i,n,r,e)}});function yo(e,t,n,r){if(!e){let e={code:`custom`,input:n,inst:r,path:[...r._zod.def.path??[]],continue:!r._zod.def.abort};r._zod.def.params&&(e.params=r._zod.def.params),t.issues.push($r(e))}}var bo,xo=class{constructor(){this._map=new WeakMap,this._idmap=new Map}add(e,...t){let n=t[0];return this._map.set(e,n),n&&typeof n==`object`&&`id`in n&&this._idmap.set(n.id,e),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(e){let t=this._map.get(e);return t&&typeof t==`object`&&`id`in t&&this._idmap.delete(t.id),this._map.delete(e),this}get(e){let t=e._zod.parent;if(t){let n={...this.get(t)??{}};delete n.id;let r={...n,...this._map.get(e)};return Object.keys(r).length?r:void 0}return this._map.get(e)}has(e){return this._map.has(e)}};function So(){return new xo}(bo=globalThis).__zod_globalRegistry??(bo.__zod_globalRegistry=So());var Co=globalThis.__zod_globalRegistry;function wo(e,t){return new e({type:`string`,...O(t)})}function To(e,t){return new e({type:`string`,format:`email`,check:`string_format`,abort:!1,...O(t)})}function Eo(e,t){return new e({type:`string`,format:`guid`,check:`string_format`,abort:!1,...O(t)})}function Do(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,...O(t)})}function Oo(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v4`,...O(t)})}function ko(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v6`,...O(t)})}function Ao(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v7`,...O(t)})}function jo(e,t){return new e({type:`string`,format:`url`,check:`string_format`,abort:!1,...O(t)})}function Mo(e,t){return new e({type:`string`,format:`emoji`,check:`string_format`,abort:!1,...O(t)})}function No(e,t){return new e({type:`string`,format:`nanoid`,check:`string_format`,abort:!1,...O(t)})}function Po(e,t){return new e({type:`string`,format:`cuid`,check:`string_format`,abort:!1,...O(t)})}function Fo(e,t){return new e({type:`string`,format:`cuid2`,check:`string_format`,abort:!1,...O(t)})}function Io(e,t){return new e({type:`string`,format:`ulid`,check:`string_format`,abort:!1,...O(t)})}function Lo(e,t){return new e({type:`string`,format:`xid`,check:`string_format`,abort:!1,...O(t)})}function Ro(e,t){return new e({type:`string`,format:`ksuid`,check:`string_format`,abort:!1,...O(t)})}function zo(e,t){return new e({type:`string`,format:`ipv4`,check:`string_format`,abort:!1,...O(t)})}function Bo(e,t){return new e({type:`string`,format:`ipv6`,check:`string_format`,abort:!1,...O(t)})}function Vo(e,t){return new e({type:`string`,format:`cidrv4`,check:`string_format`,abort:!1,...O(t)})}function Ho(e,t){return new e({type:`string`,format:`cidrv6`,check:`string_format`,abort:!1,...O(t)})}function Uo(e,t){return new e({type:`string`,format:`base64`,check:`string_format`,abort:!1,...O(t)})}function Wo(e,t){return new e({type:`string`,format:`base64url`,check:`string_format`,abort:!1,...O(t)})}function Go(e,t){return new e({type:`string`,format:`e164`,check:`string_format`,abort:!1,...O(t)})}function Ko(e,t){return new e({type:`string`,format:`jwt`,check:`string_format`,abort:!1,...O(t)})}function qo(e,t){return new e({type:`string`,format:`datetime`,check:`string_format`,offset:!1,local:!1,precision:null,...O(t)})}function Jo(e,t){return new e({type:`string`,format:`date`,check:`string_format`,...O(t)})}function Yo(e,t){return new e({type:`string`,format:`time`,check:`string_format`,precision:null,...O(t)})}function Xo(e,t){return new e({type:`string`,format:`duration`,check:`string_format`,...O(t)})}function Zo(e,t){return new e({type:`number`,checks:[],...O(t)})}function Qo(e,t){return new e({type:`number`,check:`number_format`,abort:!1,format:`safeint`,...O(t)})}function $o(e,t){return new e({type:`boolean`,...O(t)})}function es(e,t){return new e({type:`null`,...O(t)})}function ts(e){return new e({type:`unknown`})}function ns(e,t){return new e({type:`never`,...O(t)})}function rs(e,t){return new Vi({check:`less_than`,...O(t),value:e,inclusive:!1})}function is(e,t){return new Vi({check:`less_than`,...O(t),value:e,inclusive:!0})}function as(e,t){return new Hi({check:`greater_than`,...O(t),value:e,inclusive:!1})}function ss(e,t){return new Hi({check:`greater_than`,...O(t),value:e,inclusive:!0})}function cs(e,t){return new Ui({check:`multiple_of`,...O(t),value:e})}function ls(e,t){return new Gi({check:`max_length`,...O(t),maximum:e})}function us(e,t){return new Ki({check:`min_length`,...O(t),minimum:e})}function ds(e,t){return new qi({check:`length_equals`,...O(t),length:e})}function fs(e,t){return new Yi({check:`string_format`,format:`regex`,...O(t),pattern:e})}function ps(e){return new Xi({check:`string_format`,format:`lowercase`,...O(e)})}function ms(e){return new Zi({check:`string_format`,format:`uppercase`,...O(e)})}function hs(e,t){return new Qi({check:`string_format`,format:`includes`,...O(t),includes:e})}function gs(e,t){return new $i({check:`string_format`,format:`starts_with`,...O(t),prefix:e})}function _s(e,t){return new ea({check:`string_format`,format:`ends_with`,...O(t),suffix:e})}function vs(e){return new ta({check:`overwrite`,tx:e})}function ys(e){return vs(t=>t.normalize(e))}function bs(){return vs(e=>e.trim())}function xs(){return vs(e=>e.toLowerCase())}function Ss(){return vs(e=>e.toUpperCase())}function Cs(){return vs(e=>Nr(e))}function ws(e,t,n){return new e({type:`array`,element:t,...O(n)})}function Ts(e,t,n){let r=O(n);return r.abort??=!0,new e({type:`custom`,check:`custom`,fn:t,...r})}function Es(e,t,n){return new e({type:`custom`,check:`custom`,fn:t,...O(n)})}function Ds(e){let t=Os(n=>(n.addIssue=e=>{if(typeof e==`string`)n.issues.push($r(e,n.value,t._zod.def));else{let r=e;r.fatal&&(r.continue=!1),r.code??=`custom`,r.input??=n.value,r.inst??=t,r.continue??=!t._zod.def.abort,n.issues.push($r(r))}},e(n.value,n)));return t}function Os(e,t){let n=new zi({check:`custom`,...O(t)});return n._zod.check=e,n}function ks(e){let t=e?.target??`draft-2020-12`;return t===`draft-4`&&(t=`draft-04`),t===`draft-7`&&(t=`draft-07`),{processors:e.processors??{},metadataRegistry:e?.metadata??Co,target:t,unrepresentable:e?.unrepresentable??`throw`,override:e?.override??(()=>{}),io:e?.io??`output`,counter:0,seen:new Map,cycles:e?.cycles??`ref`,reused:e?.reused??`inline`,external:e?.external??void 0}}function As(e,t,n={path:[],schemaPath:[]}){var r;let i=e._zod.def,a=t.seen.get(e);if(a)return a.count++,n.schemaPath.includes(e)&&(a.cycle=n.path),a.schema;let o={schema:{},count:1,cycle:void 0,path:n.path};t.seen.set(e,o);let s=e._zod.toJSONSchema?.();if(s)o.schema=s;else{let r={...n,schemaPath:[...n.schemaPath,e],path:n.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,o.schema,r);else{let n=o.schema,a=t.processors[i.type];if(!a)throw Error(`[toJSONSchema]: Non-representable type encountered: ${i.type}`);a(e,t,n,r)}let a=e._zod.parent;a&&(o.ref||=a,As(a,t,r),t.seen.get(a).isParent=!0)}let c=t.metadataRegistry.get(e);return c&&Object.assign(o.schema,c),t.io===`input`&&Ns(e)&&(delete o.schema.examples,delete o.schema.default),t.io===`input`&&o.schema._prefault&&((r=o.schema).default??(r.default=o.schema._prefault)),delete o.schema._prefault,t.seen.get(e).schema}function js(e,t){let n=e.seen.get(t);if(!n)throw Error(`Unprocessed schema. This is a bug in Zod.`);let r=new Map;for(let t of e.seen.entries()){let n=e.metadataRegistry.get(t[0])?.id;if(n){let e=r.get(n);if(e&&e!==t[0])throw Error(`Duplicate schema id "${n}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);r.set(n,t[0])}}let i=t=>{let r=e.target===`draft-2020-12`?`$defs`:`definitions`;if(e.external){let n=e.external.registry.get(t[0])?.id,i=e.external.uri??(e=>e);if(n)return{ref:i(n)};let a=t[1].defId??t[1].schema.id??`schema${e.counter++}`;return t[1].defId=a,{defId:a,ref:`${i(`__shared`)}#/${r}/${a}`}}if(t[1]===n)return{ref:`#`};let i=`#/${r}/`,a=t[1].schema.id??`__schema${e.counter++}`;return{defId:a,ref:i+a}},a=e=>{if(e[1].schema.$ref)return;let t=e[1],{ref:n,defId:r}=i(e);t.def={...t.schema},r&&(t.defId=r);let a=t.schema;for(let e in a)delete a[e];a.$ref=n};if(e.cycles===`throw`)for(let t of e.seen.entries()){let e=t[1];if(e.cycle)throw Error(`Cycle detected: #/${e.cycle?.join(`/`)}/<root>
|
|
145
145
|
|
|
146
|
-
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let n of e.seen.entries()){let r=n[1];if(t===n[0]){a(n);continue}if(e.external){let r=e.external.registry.get(n[0])?.id;if(t!==n[0]&&r){a(n);continue}}if(e.metadataRegistry.get(n[0])?.id){a(n);continue}if(r.cycle){a(n);continue}if(r.count>1&&e.reused===`ref`){a(n);continue}}}function Ms(e,t){let n=e.seen.get(t);if(!n)throw Error(`Unprocessed schema. This is a bug in Zod.`);let r=t=>{let n=e.seen.get(t);if(n.ref===null)return;let i=n.def??n.schema,a={...i},o=n.ref;if(n.ref=null,o){r(o);let n=e.seen.get(o),s=n.schema;if(s.$ref&&(e.target===`draft-07`||e.target===`draft-04`||e.target===`openapi-3.0`)?(i.allOf=i.allOf??[],i.allOf.push(s)):Object.assign(i,s),Object.assign(i,a),t._zod.parent===o)for(let e in i)e===`$ref`||e===`allOf`||e in a||delete i[e];if(s.$ref&&n.def)for(let e in i)e===`$ref`||e===`allOf`||e in n.def&&JSON.stringify(i[e])===JSON.stringify(n.def[e])&&delete i[e]}let s=t._zod.parent;if(s&&s!==o){r(s);let t=e.seen.get(s);if(t?.schema.$ref&&(i.$ref=t.schema.$ref,t.def))for(let e in i)e===`$ref`||e===`allOf`||e in t.def&&JSON.stringify(i[e])===JSON.stringify(t.def[e])&&delete i[e]}e.override({zodSchema:t,jsonSchema:i,path:n.path??[]})};for(let t of[...e.seen.entries()].reverse())r(t[0]);let i={};if(e.target===`draft-2020-12`?i.$schema=`https://json-schema.org/draft/2020-12/schema`:e.target===`draft-07`?i.$schema=`http://json-schema.org/draft-07/schema#`:e.target===`draft-04`?i.$schema=`http://json-schema.org/draft-04/schema#`:e.target,e.external?.uri){let n=e.external.registry.get(t)?.id;if(!n)throw Error("Schema is missing an `id` property");i.$id=e.external.uri(n)}Object.assign(i,n.def??n.schema);let a=e.external?.defs??{};for(let t of e.seen.entries()){let e=t[1];e.def&&e.defId&&(a[e.defId]=e.def)}e.external||Object.keys(a).length>0&&(e.target===`draft-2020-12`?i.$defs=a:i.definitions=a);try{let n=JSON.parse(JSON.stringify(i));return Object.defineProperty(n,`~standard`,{value:{...t[`~standard`],jsonSchema:{input:Fs(t,`input`,e.processors),output:Fs(t,`output`,e.processors)}},enumerable:!1,writable:!1}),n}catch{throw Error(`Error converting schema to JSON.`)}}function Ns(e,t){let n=t??{seen:new Set};if(n.seen.has(e))return!1;n.seen.add(e);let r=e._zod.def;if(r.type===`transform`)return!0;if(r.type===`array`)return Ns(r.element,n);if(r.type===`set`)return Ns(r.valueType,n);if(r.type===`lazy`)return Ns(r.getter(),n);if(r.type===`promise`||r.type===`optional`||r.type===`nonoptional`||r.type===`nullable`||r.type===`readonly`||r.type===`default`||r.type===`prefault`)return Ns(r.innerType,n);if(r.type===`intersection`)return Ns(r.left,n)||Ns(r.right,n);if(r.type===`record`||r.type===`map`)return Ns(r.keyType,n)||Ns(r.valueType,n);if(r.type===`pipe`)return Ns(r.in,n)||Ns(r.out,n);if(r.type===`object`){for(let e in r.shape)if(Ns(r.shape[e],n))return!0;return!1}if(r.type===`union`){for(let e of r.options)if(Ns(e,n))return!0;return!1}if(r.type===`tuple`){for(let e of r.items)if(Ns(e,n))return!0;return!!(r.rest&&Ns(r.rest,n))}return!1}var Ps=(e,t={})=>n=>{let r=ks({...n,processors:t});return As(e,r),js(r,e),Ms(r,e)},Fs=(e,t,n={})=>r=>{let{libraryOptions:i,target:a}=r??{},o=ks({...i??{},target:a,io:t,processors:n});return As(e,o),js(o,e),Ms(o,e)},Is={guid:`uuid`,url:`uri`,datetime:`date-time`,json_string:`json-string`,regex:``},Ls=(e,t,n,r)=>{let i=n;i.type=`string`;let{minimum:a,maximum:o,format:s,patterns:c,contentEncoding:l}=e._zod.bag;if(typeof a==`number`&&(i.minLength=a),typeof o==`number`&&(i.maxLength=o),s&&(i.format=Is[s]??s,i.format===``&&delete i.format,s===`time`&&delete i.format),l&&(i.contentEncoding=l),c&&c.size>0){let e=[...c];e.length===1?i.pattern=e[0].source:e.length>1&&(i.allOf=[...e.map(e=>({...t.target===`draft-07`||t.target===`draft-04`||t.target===`openapi-3.0`?{type:`string`}:{},pattern:e.source}))])}},Rs=(e,t,n,r)=>{let i=n,{minimum:a,maximum:o,format:s,multipleOf:c,exclusiveMaximum:l,exclusiveMinimum:u}=e._zod.bag;typeof s==`string`&&s.includes(`int`)?i.type=`integer`:i.type=`number`,typeof u==`number`&&(t.target===`draft-04`||t.target===`openapi-3.0`?(i.minimum=u,i.exclusiveMinimum=!0):i.exclusiveMinimum=u),typeof a==`number`&&(i.minimum=a,typeof u==`number`&&t.target!==`draft-04`&&(u>=a?delete i.minimum:delete i.exclusiveMinimum)),typeof l==`number`&&(t.target===`draft-04`||t.target===`openapi-3.0`?(i.maximum=l,i.exclusiveMaximum=!0):i.exclusiveMaximum=l),typeof o==`number`&&(i.maximum=o,typeof l==`number`&&t.target!==`draft-04`&&(l<=o?delete i.maximum:delete i.exclusiveMaximum)),typeof c==`number`&&(i.multipleOf=c)},zs=(e,t,n,r)=>{n.type=`boolean`},Bs=(e,t,n,r)=>{t.target===`openapi-3.0`?(n.type=`string`,n.nullable=!0,n.enum=[null]):n.type=`null`},Vs=(e,t,n,r)=>{n.not={}},Hs=(e,t,n,r)=>{let i=e._zod.def,a=Sr(i.entries);a.every(e=>typeof e==`number`)&&(n.type=`number`),a.every(e=>typeof e==`string`)&&(n.type=`string`),n.enum=a},Us=(e,t,n,r)=>{let i=e._zod.def,a=[];for(let e of i.values)if(e===void 0){if(t.unrepresentable===`throw`)throw Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof e==`bigint`){if(t.unrepresentable===`throw`)throw Error(`BigInt literals cannot be represented in JSON Schema`);a.push(Number(e))}else a.push(e);if(a.length!==0)if(a.length===1){let e=a[0];n.type=e===null?`null`:typeof e,t.target===`draft-04`||t.target===`openapi-3.0`?n.enum=[e]:n.const=e}else a.every(e=>typeof e==`number`)&&(n.type=`number`),a.every(e=>typeof e==`string`)&&(n.type=`string`),a.every(e=>typeof e==`boolean`)&&(n.type=`boolean`),a.every(e=>e===null)&&(n.type=`null`),n.enum=a},Ws=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Custom types cannot be represented in JSON Schema`)},kee=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Transforms cannot be represented in JSON Schema`)},Aee=(e,t,n,r)=>{let i=n,a=e._zod.def,{minimum:o,maximum:s}=e._zod.bag;typeof o==`number`&&(i.minItems=o),typeof s==`number`&&(i.maxItems=s),i.type=`array`,i.items=As(a.element,t,{...r,path:[...r.path,`items`]})},jee=(e,t,n,r)=>{let i=n,a=e._zod.def;i.type=`object`,i.properties={};let o=a.shape;for(let e in o)i.properties[e]=As(o[e],t,{...r,path:[...r.path,`properties`,e]});let s=new Set(Object.keys(o)),c=new Set([...s].filter(e=>{let n=a.shape[e]._zod;return t.io===`input`?n.optin===void 0:n.optout===void 0}));c.size>0&&(i.required=Array.from(c)),a.catchall?._zod.def.type===`never`?i.additionalProperties=!1:a.catchall?a.catchall&&(i.additionalProperties=As(a.catchall,t,{...r,path:[...r.path,`additionalProperties`]})):t.io===`output`&&(i.additionalProperties=!1)},Mee=(e,t,n,r)=>{let i=e._zod.def,a=i.inclusive===!1,o=i.options.map((e,n)=>As(e,t,{...r,path:[...r.path,a?`oneOf`:`anyOf`,n]}));a?n.oneOf=o:n.anyOf=o},Nee=(e,t,n,r)=>{let i=e._zod.def,a=As(i.left,t,{...r,path:[...r.path,`allOf`,0]}),o=As(i.right,t,{...r,path:[...r.path,`allOf`,1]}),s=e=>`allOf`in e&&Object.keys(e).length===1;n.allOf=[...s(a)?a.allOf:[a],...s(o)?o.allOf:[o]]},Pee=(e,t,n,r)=>{let i=n,a=e._zod.def;i.type=`object`;let o=a.keyType,s=o._zod.bag?.patterns;if(a.mode===`loose`&&s&&s.size>0){let e=As(a.valueType,t,{...r,path:[...r.path,`patternProperties`,`*`]});i.patternProperties={};for(let t of s)i.patternProperties[t.source]=e}else (t.target===`draft-07`||t.target===`draft-2020-12`)&&(i.propertyNames=As(a.keyType,t,{...r,path:[...r.path,`propertyNames`]})),i.additionalProperties=As(a.valueType,t,{...r,path:[...r.path,`additionalProperties`]});let c=o._zod.values;if(c){let e=[...c].filter(e=>typeof e==`string`||typeof e==`number`);e.length>0&&(i.required=e)}},Fee=(e,t,n,r)=>{let i=e._zod.def,a=As(i.innerType,t,r),o=t.seen.get(e);t.target===`openapi-3.0`?(o.ref=i.innerType,n.nullable=!0):n.anyOf=[a,{type:`null`}]},Iee=(e,t,n,r)=>{let i=e._zod.def;As(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},Lee=(e,t,n,r)=>{let i=e._zod.def;As(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,n.default=JSON.parse(JSON.stringify(i.defaultValue))},Ree=(e,t,n,r)=>{let i=e._zod.def;As(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,t.io===`input`&&(n._prefault=JSON.parse(JSON.stringify(i.defaultValue)))},zee=(e,t,n,r)=>{let i=e._zod.def;As(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType;let o;try{o=i.catchValue(void 0)}catch{throw Error(`Dynamic catch values are not supported in JSON Schema`)}n.default=o},Bee=(e,t,n,r)=>{let i=e._zod.def,a=t.io===`input`?i.in._zod.def.type===`transform`?i.out:i.in:i.out;As(a,t,r);let o=t.seen.get(e);o.ref=a},Vee=(e,t,n,r)=>{let i=e._zod.def;As(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,n.readOnly=!0},Gs=(e,t,n,r)=>{let i=e._zod.def;As(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},Hee=(e,t,n,r)=>{let i=e._zod.innerType;As(i,t,r);let a=t.seen.get(e);a.ref=i},Uee=D(`ZodISODateTime`,(e,t)=>{va.init(e,t),Zs.init(e,t)});function Ks(e){return qo(Uee,e)}var Wee=D(`ZodISODate`,(e,t)=>{ya.init(e,t),Zs.init(e,t)});function Gee(e){return Jo(Wee,e)}var Kee=D(`ZodISOTime`,(e,t)=>{ba.init(e,t),Zs.init(e,t)});function qee(e){return Yo(Kee,e)}var Jee=D(`ZodISODuration`,(e,t)=>{xa.init(e,t),Zs.init(e,t)});function Yee(e){return Xo(Jee,e)}var qs=(e,t)=>{ti.init(e,t),e.name=`ZodError`,Object.defineProperties(e,{format:{value:t=>_ee(e,t)},flatten:{value:t=>gee(e,t)},addIssue:{value:t=>{e.issues.push(t),e.message=JSON.stringify(e.issues,Cr,2)}},addIssues:{value:t=>{e.issues.push(...t),e.message=JSON.stringify(e.issues,Cr,2)}},isEmpty:{get(){return e.issues.length===0}}})};D(`ZodError`,qs);var Js=D(`ZodError`,qs,{Parent:Error}),Xee=ri(Js),Zee=ii(Js),Qee=ai(Js),$ee=oi(Js),ete=See(Js),tte=Cee(Js),nte=wee(Js),rte=Tee(Js),ite=Eee(Js),ate=Dee(Js),ote=Oee(Js),ste=si(Js),Ys=D(`ZodType`,(e,t)=>(ia.init(e,t),Object.assign(e[`~standard`],{jsonSchema:{input:Fs(e,`input`),output:Fs(e,`output`)}}),e.toJSONSchema=Ps(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,`_def`,{value:t}),e.check=(...n)=>e.clone(jr(t,{checks:[...t.checks??[],...n.map(e=>typeof e==`function`?{_zod:{check:e,def:{check:`custom`},onattach:[]}}:e)]}),{parent:!0}),e.with=e.check,e.clone=(t,n)=>Vr(e,t,n),e.brand=()=>e,e.register=((t,n)=>(t.add(e,n),e)),e.parse=(t,n)=>Xee(e,t,n,{callee:e.parse}),e.safeParse=(t,n)=>Qee(e,t,n),e.parseAsync=async(t,n)=>Zee(e,t,n,{callee:e.parseAsync}),e.safeParseAsync=async(t,n)=>$ee(e,t,n),e.spa=e.safeParseAsync,e.encode=(t,n)=>ete(e,t,n),e.decode=(t,n)=>tte(e,t,n),e.encodeAsync=async(t,n)=>nte(e,t,n),e.decodeAsync=async(t,n)=>rte(e,t,n),e.safeEncode=(t,n)=>ite(e,t,n),e.safeDecode=(t,n)=>ate(e,t,n),e.safeEncodeAsync=async(t,n)=>ote(e,t,n),e.safeDecodeAsync=async(t,n)=>ste(e,t,n),e.refine=(t,n)=>e.check(Lc(t,n)),e.superRefine=t=>e.check(Rc(t)),e.overwrite=t=>e.check(vs(t)),e.optional=()=>gc(e),e.exactOptional=()=>vc(e),e.nullable=()=>bc(e),e.nullish=()=>gc(bc(e)),e.nonoptional=t=>Ec(e,t),e.array=()=>M(e),e.or=t=>lc([e,t]),e.and=t=>Fte(e,t),e.transform=t=>Ac(e,mc(t)),e.default=t=>Sc(e,t),e.prefault=t=>wc(e,t),e.catch=t=>Oc(e,t),e.pipe=t=>Ac(e,t),e.readonly=()=>Mc(e),e.describe=t=>{let n=e.clone();return Co.add(n,{description:t}),n},Object.defineProperty(e,`description`,{get(){return Co.get(e)?.description},configurable:!0}),e.meta=(...t)=>{if(t.length===0)return Co.get(e);let n=e.clone();return Co.add(n,t[0]),n},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e.apply=t=>t(e),e)),Xs=D(`_ZodString`,(e,t)=>{aa.init(e,t),Ys.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ls(e,t,n,r);let n=e._zod.bag;e.format=n.format??null,e.minLength=n.minimum??null,e.maxLength=n.maximum??null,e.regex=(...t)=>e.check(fs(...t)),e.includes=(...t)=>e.check(hs(...t)),e.startsWith=(...t)=>e.check(gs(...t)),e.endsWith=(...t)=>e.check(_s(...t)),e.min=(...t)=>e.check(us(...t)),e.max=(...t)=>e.check(ls(...t)),e.length=(...t)=>e.check(ds(...t)),e.nonempty=(...t)=>e.check(us(1,...t)),e.lowercase=t=>e.check(ps(t)),e.uppercase=t=>e.check(ms(t)),e.trim=()=>e.check(bs()),e.normalize=(...t)=>e.check(ys(...t)),e.toLowerCase=()=>e.check(xs()),e.toUpperCase=()=>e.check(Ss()),e.slugify=()=>e.check(Cs())}),cte=D(`ZodString`,(e,t)=>{aa.init(e,t),Xs.init(e,t),e.email=t=>e.check(To(Qs,t)),e.url=t=>e.check(jo(tc,t)),e.jwt=t=>e.check(Ko(Tte,t)),e.emoji=t=>e.check(Mo(dte,t)),e.guid=t=>e.check(Eo($s,t)),e.uuid=t=>e.check(Do(ec,t)),e.uuidv4=t=>e.check(Oo(ec,t)),e.uuidv6=t=>e.check(ko(ec,t)),e.uuidv7=t=>e.check(Ao(ec,t)),e.nanoid=t=>e.check(No(fte,t)),e.guid=t=>e.check(Eo($s,t)),e.cuid=t=>e.check(Po(pte,t)),e.cuid2=t=>e.check(Fo(mte,t)),e.ulid=t=>e.check(Io(hte,t)),e.base64=t=>e.check(Uo(Ste,t)),e.base64url=t=>e.check(Wo(Cte,t)),e.xid=t=>e.check(Lo(gte,t)),e.ksuid=t=>e.check(Ro(_te,t)),e.ipv4=t=>e.check(zo(vte,t)),e.ipv6=t=>e.check(Bo(yte,t)),e.cidrv4=t=>e.check(Vo(bte,t)),e.cidrv6=t=>e.check(Ho(xte,t)),e.e164=t=>e.check(Go(wte,t)),e.datetime=t=>e.check(Ks(t)),e.date=t=>e.check(Gee(t)),e.time=t=>e.check(qee(t)),e.duration=t=>e.check(Yee(t))});function k(e){return wo(cte,e)}var Zs=D(`ZodStringFormat`,(e,t)=>{oa.init(e,t),Xs.init(e,t)}),Qs=D(`ZodEmail`,(e,t)=>{la.init(e,t),Zs.init(e,t)});function lte(e){return To(Qs,e)}var $s=D(`ZodGUID`,(e,t)=>{sa.init(e,t),Zs.init(e,t)}),ec=D(`ZodUUID`,(e,t)=>{ca.init(e,t),Zs.init(e,t)}),tc=D(`ZodURL`,(e,t)=>{ua.init(e,t),Zs.init(e,t)});function ute(e){return jo(tc,e)}var dte=D(`ZodEmoji`,(e,t)=>{da.init(e,t),Zs.init(e,t)}),fte=D(`ZodNanoID`,(e,t)=>{fa.init(e,t),Zs.init(e,t)}),pte=D(`ZodCUID`,(e,t)=>{pa.init(e,t),Zs.init(e,t)}),mte=D(`ZodCUID2`,(e,t)=>{ma.init(e,t),Zs.init(e,t)}),hte=D(`ZodULID`,(e,t)=>{ha.init(e,t),Zs.init(e,t)}),gte=D(`ZodXID`,(e,t)=>{ga.init(e,t),Zs.init(e,t)}),_te=D(`ZodKSUID`,(e,t)=>{_a.init(e,t),Zs.init(e,t)}),vte=D(`ZodIPv4`,(e,t)=>{Sa.init(e,t),Zs.init(e,t)}),yte=D(`ZodIPv6`,(e,t)=>{Ca.init(e,t),Zs.init(e,t)}),bte=D(`ZodCIDRv4`,(e,t)=>{wa.init(e,t),Zs.init(e,t)}),xte=D(`ZodCIDRv6`,(e,t)=>{Ta.init(e,t),Zs.init(e,t)}),Ste=D(`ZodBase64`,(e,t)=>{Da.init(e,t),Zs.init(e,t)}),Cte=D(`ZodBase64URL`,(e,t)=>{ka.init(e,t),Zs.init(e,t)}),wte=D(`ZodE164`,(e,t)=>{Aa.init(e,t),Zs.init(e,t)}),Tte=D(`ZodJWT`,(e,t)=>{Ma.init(e,t),Zs.init(e,t)}),nc=D(`ZodNumber`,(e,t)=>{Na.init(e,t),Ys.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Rs(e,t,n,r),e.gt=(t,n)=>e.check(as(t,n)),e.gte=(t,n)=>e.check(ss(t,n)),e.min=(t,n)=>e.check(ss(t,n)),e.lt=(t,n)=>e.check(rs(t,n)),e.lte=(t,n)=>e.check(is(t,n)),e.max=(t,n)=>e.check(is(t,n)),e.int=t=>e.check(rc(t)),e.safe=t=>e.check(rc(t)),e.positive=t=>e.check(as(0,t)),e.nonnegative=t=>e.check(ss(0,t)),e.negative=t=>e.check(rs(0,t)),e.nonpositive=t=>e.check(is(0,t)),e.multipleOf=(t,n)=>e.check(cs(t,n)),e.step=(t,n)=>e.check(cs(t,n)),e.finite=()=>e;let n=e._zod.bag;e.minValue=Math.max(n.minimum??-1/0,n.exclusiveMinimum??-1/0)??null,e.maxValue=Math.min(n.maximum??1/0,n.exclusiveMaximum??1/0)??null,e.isInt=(n.format??``).includes(`int`)||Number.isSafeInteger(n.multipleOf??.5),e.isFinite=!0,e.format=n.format??null});function A(e){return Zo(nc,e)}var Ete=D(`ZodNumberFormat`,(e,t)=>{Pa.init(e,t),nc.init(e,t)});function rc(e){return Qo(Ete,e)}var Dte=D(`ZodBoolean`,(e,t)=>{Fa.init(e,t),Ys.init(e,t),e._zod.processJSONSchema=(t,n,r)=>zs(e,t,n,r)});function j(e){return $o(Dte,e)}var Ote=D(`ZodNull`,(e,t)=>{Ia.init(e,t),Ys.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Bs(e,t,n,r)});function ic(e){return es(Ote,e)}var kte=D(`ZodUnknown`,(e,t)=>{La.init(e,t),Ys.init(e,t),e._zod.processJSONSchema=(e,t,n)=>void 0});function ac(){return ts(kte)}var Ate=D(`ZodNever`,(e,t)=>{Ra.init(e,t),Ys.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Vs(e,t,n,r)});function jte(e){return ns(Ate,e)}var Mte=D(`ZodArray`,(e,t)=>{Ba.init(e,t),Ys.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Aee(e,t,n,r),e.element=t.element,e.min=(t,n)=>e.check(us(t,n)),e.nonempty=t=>e.check(us(1,t)),e.max=(t,n)=>e.check(ls(t,n)),e.length=(t,n)=>e.check(ds(t,n)),e.unwrap=()=>e.element});function M(e,t){return ws(Mte,e,t)}var oc=D(`ZodObject`,(e,t)=>{Ga.init(e,t),Ys.init(e,t),e._zod.processJSONSchema=(t,n,r)=>jee(e,t,n,r),kr(e,`shape`,()=>t.shape),e.keyof=()=>P(Object.keys(e._zod.def.shape)),e.catchall=t=>e.clone({...e._zod.def,catchall:t}),e.passthrough=()=>e.clone({...e._zod.def,catchall:ac()}),e.loose=()=>e.clone({...e._zod.def,catchall:ac()}),e.strict=()=>e.clone({...e._zod.def,catchall:jte()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=t=>Kr(e,t),e.safeExtend=t=>qr(e,t),e.merge=t=>pee(e,t),e.pick=t=>Wr(e,t),e.omit=t=>Gr(e,t),e.partial=(...t)=>mee(hc,e,t[0]),e.required=(...t)=>hee(Tc,e,t[0])});function N(e,t){return new oc({type:`object`,shape:e??{},...O(t)})}function sc(e,t){return new oc({type:`object`,shape:e,catchall:ac(),...O(t)})}var cc=D(`ZodUnion`,(e,t)=>{qa.init(e,t),Ys.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Mee(e,t,n,r),e.options=t.options});function lc(e,t){return new cc({type:`union`,options:e,...O(t)})}var Nte=D(`ZodDiscriminatedUnion`,(e,t)=>{cc.init(e,t),Ja.init(e,t)});function uc(e,t,n){return new Nte({type:`union`,options:t,discriminator:e,...O(n)})}var Pte=D(`ZodIntersection`,(e,t)=>{Ya.init(e,t),Ys.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Nee(e,t,n,r)});function Fte(e,t){return new Pte({type:`intersection`,left:e,right:t})}var Ite=D(`ZodRecord`,(e,t)=>{Qa.init(e,t),Ys.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Pee(e,t,n,r),e.keyType=t.keyType,e.valueType=t.valueType});function dc(e,t,n){return new Ite({type:`record`,keyType:e,valueType:t,...O(n)})}var fc=D(`ZodEnum`,(e,t)=>{$a.init(e,t),Ys.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Hs(e,t,n,r),e.enum=t.entries,e.options=Object.values(t.entries);let n=new Set(Object.keys(t.entries));e.extract=(e,r)=>{let i={};for(let r of e)if(n.has(r))i[r]=t.entries[r];else throw Error(`Key ${r} not found in enum`);return new fc({...t,checks:[],...O(r),entries:i})},e.exclude=(e,r)=>{let i={...t.entries};for(let t of e)if(n.has(t))delete i[t];else throw Error(`Key ${t} not found in enum`);return new fc({...t,checks:[],...O(r),entries:i})}});function P(e,t){return new fc({type:`enum`,entries:Array.isArray(e)?Object.fromEntries(e.map(e=>[e,e])):e,...O(t)})}var Lte=D(`ZodLiteral`,(e,t)=>{eo.init(e,t),Ys.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Us(e,t,n,r),e.values=new Set(t.values),Object.defineProperty(e,`value`,{get(){if(t.values.length>1)throw Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function F(e,t){return new Lte({type:`literal`,values:Array.isArray(e)?e:[e],...O(t)})}var pc=D(`ZodTransform`,(e,t)=>{to.init(e,t),Ys.init(e,t),e._zod.processJSONSchema=(t,n,r)=>kee(e,t,n,r),e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new yr(e.constructor.name);n.addIssue=r=>{if(typeof r==`string`)n.issues.push($r(r,n.value,t));else{let t=r;t.fatal&&(t.continue=!1),t.code??=`custom`,t.input??=n.value,t.inst??=e,n.issues.push($r(t))}};let i=t.transform(n.value,n);return i instanceof Promise?i.then(e=>(n.value=e,n)):(n.value=i,n)}});function mc(e){return new pc({type:`transform`,transform:e})}var hc=D(`ZodOptional`,(e,t)=>{ro.init(e,t),Ys.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Gs(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function gc(e){return new hc({type:`optional`,innerType:e})}var _c=D(`ZodExactOptional`,(e,t)=>{io.init(e,t),Ys.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Gs(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function vc(e){return new _c({type:`optional`,innerType:e})}var yc=D(`ZodNullable`,(e,t)=>{ao.init(e,t),Ys.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Fee(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function bc(e){return new yc({type:`nullable`,innerType:e})}var xc=D(`ZodDefault`,(e,t)=>{oo.init(e,t),Ys.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Lee(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function Sc(e,t){return new xc({type:`default`,innerType:e,get defaultValue(){return typeof t==`function`?t():Rr(t)}})}var Cc=D(`ZodPrefault`,(e,t)=>{co.init(e,t),Ys.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ree(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function wc(e,t){return new Cc({type:`prefault`,innerType:e,get defaultValue(){return typeof t==`function`?t():Rr(t)}})}var Tc=D(`ZodNonOptional`,(e,t)=>{lo.init(e,t),Ys.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Iee(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Ec(e,t){return new Tc({type:`nonoptional`,innerType:e,...O(t)})}var Dc=D(`ZodCatch`,(e,t)=>{fo.init(e,t),Ys.init(e,t),e._zod.processJSONSchema=(t,n,r)=>zee(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function Oc(e,t){return new Dc({type:`catch`,innerType:e,catchValue:typeof t==`function`?t:()=>t})}var kc=D(`ZodPipe`,(e,t)=>{po.init(e,t),Ys.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Bee(e,t,n,r),e.in=t.in,e.out=t.out});function Ac(e,t){return new kc({type:`pipe`,in:e,out:t})}var jc=D(`ZodReadonly`,(e,t)=>{ho.init(e,t),Ys.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Vee(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Mc(e){return new jc({type:`readonly`,innerType:e})}var Nc=D(`ZodLazy`,(e,t)=>{_o.init(e,t),Ys.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Hee(e,t,n,r),e.unwrap=()=>e._zod.def.getter()});function Pc(e){return new Nc({type:`lazy`,getter:e})}var Fc=D(`ZodCustom`,(e,t)=>{vo.init(e,t),Ys.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ws(e,t,n,r)});function Ic(e,t){return Ts(Fc,e??(()=>!0),t)}function Lc(e,t={}){return Es(Fc,e,t)}function Rc(e){return Ds(e)}function zc(e,t){return Ac(mc(e),t)}var Bc={sh:`bash`,zsh:`bash`,bash:`bash`,c:`c`,cc:`cpp`,cpp:`cpp`,cxx:`cpp`,"c++":`cpp`,h:`c`,hh:`cpp`,hpp:`cpp`,cs:`csharp`,css:`css`,less:`less`,scss:`scss`,sass:`scss`,diff:`diff`,patch:`diff`,go:`go`,gql:`graphql`,graphql:`graphql`,ini:`ini`,cfg:`ini`,conf:`ini`,properties:`ini`,java:`java`,js:`javascript`,jsx:`javascript`,mjs:`javascript`,cjs:`javascript`,json:`json`,jsonc:`json`,kt:`kotlin`,kts:`kotlin`,lua:`lua`,makefile:`makefile`,md:`markdown`,mdx:`markdown`,m:`objectivec`,mm:`objectivec`,pl:`perl`,pm:`perl`,php:`php`,phtml:`php`,py:`python`,pyi:`python`,pyx:`python`,r:`r`,rb:`ruby`,rs:`rust`,sql:`sql`,swift:`swift`,ts:`typescript`,tsx:`typescript`,xml:`xml`,yaml:`yaml`,yml:`yaml`},Vc=new Set(Object.keys(Bc));function Hc(e){return Bc[e.toLowerCase().replace(/^\./,``)]??null}var Uc=[`image/jpeg`,`image/png`,`image/gif`,`image/webp`,`image/svg+xml`],Wc=[`video/mp4`,`video/webm`,`video/ogg`],Gc=[`audio/mpeg`,`audio/wav`,`audio/ogg`],Kc=[`application/pdf`],qc=new Set([`png`,`jpg`,`jpeg`,`gif`,`webp`,`avif`,`svg`]),Jc=new Set([`mp4`,`webm`,`mov`,`m4v`,`mkv`]),Yc=new Set([`pdf`]),Xc=new Set([`mp3`,`wav`,`ogg`,`m4a`,`flac`,`aac`,`opus`]),Zc=new Set(`pdf.docx.xlsx.pptx.doc.xls.ppt.zip.7z.tar.gz.rar.csv.tsv.rtf.json.yaml.yml.xml.txt.pages.numbers.key.odt.ods.odp.epub.mobi`.split(`.`)),Qc=new Set(`png.jpg.jpeg.gif.webp.avif.svg.apng.heic.heif.tiff.bmp.ico.pdf.mp4.webm.mov.m4v.mkv.avi.flv.wmv.mpeg.mpg.mp3.wav.ogg.m4a.flac.aac.opus.zip.7z.tar.gz.rar.woff.woff2.ttf.otf.eot.docx.xlsx.pptx.doc.xls.ppt.odt.ods.odp.pages.numbers.key.epub.mobi.csv.tsv.txt.rtf.json.yaml.yml.xml.toml.lock.gpx.html.htm`.split(`.`)),$c=new Set(`png.jpg.jpeg.gif.webp.avif.apng.heic.heif.tiff.bmp.ico.svg.pdf.mp4.webm.mov.m4v.mkv.mp3.wav.ogg.m4a.flac.aac.opus.json.toml.lock`.split(`.`)),el=`wikiembed`,tl=`toast`,nl=new Set(`png.jpg.jpeg.gif.webp.avif.svg.pdf.mp4.webm.mov.m4v.mkv.mp3.wav.ogg.m4a.flac.aac.opus.docx.xlsx.pptx.doc.xls.ppt.zip.7z.tar.gz.rar.csv.tsv.rtf.json.yaml.yml.xml.txt.pages.numbers.key.odt.ods.odp.epub.mobi`.split(`.`)),rl=[`png`,`jpg`,`jpeg`,`gif`,`webp`,`avif`],il=[`mp4`,`webm`,`mov`,`m4v`],al=[`mp3`,`wav`,`ogg`,`m4a`,`flac`,`aac`,`opus`],ol=[`pdf`],sl=[`json`,`toml`,`lock`];function cl(e,t,n){for(let r of t)if(!n.has(r))throw Error(`${e}: ${r} is not present in canonical upload constants`)}cl(`SIDEBAR_IMAGE_ASSET_EXTENSIONS`,rl,qc),cl(`SIDEBAR_VIDEO_ASSET_EXTENSIONS`,il,Jc),cl(`SIDEBAR_AUDIO_ASSET_EXTENSIONS`,al,Xc),cl(`SIDEBAR_PDF_ASSET_EXTENSIONS`,ol,Yc),cl(`FILE_ATTACHMENT_EXTENSIONS`,[...Zc],nl),cl(`WIKI_EMBED_EXTENSIONS`,[...nl],Qc);var ll=new Set(rl),ul=new Set(il),dl=new Set(al),fl=new Set(ol),pl=new Set(sl);cl(`SIDEBAR_RENDERABLE_ASSET_EXTENSIONS`,[...new Set([...rl,...il,...al,...ol,...sl])],$c);var ml=new Set([`base`,`canvas`]),hl=new Set([`mmd`,`mermaid`]);function gl(e){let t=e.lastIndexOf(`.`);return t<0?!1:hl.has(e.slice(t+1).toLowerCase())}new Set([...Qc,...ml,...hl]);function _l(e){let t=e.toLowerCase().replace(/^\./,``);return ll.has(t)?`image`:ul.has(t)?`video`:dl.has(t)?`audio`:fl.has(t)?`pdf`:pl.has(t)||ml.has(t)?`text`:hl.has(t)?`mermaid`:Vc.has(t)?`text`:null}var vl={bg:`#282a36`,bgElevated:`#343746`,bgSubtle:`#21222c`,fg:`#f8f8f2`,fgMuted:`#9aa0c5`,border:`#44475a`,primary:`#bd93f9`,primaryFg:`#282a36`,red:`#ff5555`,green:`#50fa7b`,yellow:`#f1fa8c`,blue:`#8be9fd`,cyan:`#8be9fd`,orange:`#ffb86c`,purple:`#ff79c6`},yl={bg:`#303446`,bgElevated:`#414559`,bgSubtle:`#292c3c`,fg:`#c6d0f5`,fgMuted:`#a5adce`,border:`#51576d`,primary:`#ca9ee6`,primaryFg:`#303446`,red:`#e78284`,green:`#a6d189`,yellow:`#e5c890`,blue:`#8caaee`,cyan:`#81c8be`,orange:`#ef9f76`,purple:`#ca9ee6`},bl={bg:`#eff1f5`,bgElevated:`#ffffff`,bgSubtle:`#e6e9ef`,fg:`#4c4f69`,fgMuted:`#6c6f85`,border:`#ccd0da`,primary:`#8839ef`,primaryFg:`#ffffff`,red:`#d20f39`,green:`#40a02b`,yellow:`#df8e1d`,blue:`#1e66f5`,cyan:`#179299`,orange:`#fe640b`,purple:`#8839ef`},xl={bg:`#272822`,bgElevated:`#31322b`,bgSubtle:`#1e1f1a`,fg:`#f8f8f2`,fgMuted:`#a6a28c`,border:`#49483e`,primary:`#66d9ef`,primaryFg:`#272822`,red:`#f92672`,green:`#a6e22e`,yellow:`#e6db74`,blue:`#66d9ef`,cyan:`#66d9ef`,orange:`#fd971f`,purple:`#ae81ff`},Sl={bg:`#282828`,bgElevated:`#32302f`,bgSubtle:`#1d2021`,fg:`#ebdbb2`,fgMuted:`#a89984`,border:`#3c3836`,primary:`#83a598`,primaryFg:`#1d2021`,red:`#fb4934`,green:`#b8bb26`,yellow:`#fabd2f`,blue:`#83a598`,cyan:`#8ec07c`,orange:`#fe8019`,purple:`#d3869b`},Cl={bg:`#002b36`,bgElevated:`#073642`,bgSubtle:`#00252e`,fg:`#93a1a1`,fgMuted:`#6a7f86`,border:`#0e4a56`,primary:`#268bd2`,primaryFg:`#fdf6e3`,red:`#dc322f`,green:`#859900`,yellow:`#b58900`,blue:`#268bd2`,cyan:`#2aa198`,orange:`#cb4b16`,purple:`#6c71c4`};function wl(e){return{background:e.bg,foreground:e.fg,card:e.bgElevated,"card-foreground":e.fg,popover:e.bgElevated,"popover-foreground":e.fg,primary:e.primary,"primary-foreground":e.primaryFg,secondary:e.bgElevated,"secondary-foreground":e.fg,muted:e.bgElevated,"muted-foreground":e.fgMuted,accent:e.bgElevated,"accent-foreground":e.fg,destructive:e.red,border:e.border,input:e.border,ring:e.primary,"selection-soft":`oklch(from var(--primary) l c h / 0.3)`,"chart-1":e.primary,"chart-2":e.green,"chart-3":e.yellow,"chart-4":e.purple,"chart-5":e.red,sidebar:e.bgSubtle,"sidebar-foreground":e.fg,"sidebar-primary":e.primary,"sidebar-primary-foreground":e.primaryFg,"sidebar-accent":`oklch(from var(--primary) l c h / 0.14)`,"sidebar-accent-foreground":e.primary,"sidebar-hover":e.bgElevated,"sidebar-border":e.border,"sidebar-ring":e.primary,"syntax-keyword":e.purple,"syntax-tag":e.red,"syntax-attr":e.blue,"syntax-string":e.green,"syntax-number":e.orange,"syntax-atom":e.cyan}}function Tl(e,t,n){return{id:e,label:t,kind:`dark`,base:n,toTokens:()=>wl(n)}}function El(e,t,n){return{id:e,label:t,kind:`light`,base:n,toTokens:()=>wl(n)}}function Dl(e,t){return{id:e,label:t,kind:`system`}}var Ol=[Dl(`default`,`Default`),Tl(`dracula`,`Dracula`,vl),Tl(`catppuccin-frappe`,`Catppuccin Frappé`,yl),El(`catppuccin-latte`,`Catppuccin Latte`,bl),Tl(`monokai`,`Monokai`,xl),Tl(`gruvbox`,`Gruvbox`,Sl),Tl(`solarized`,`Solarized`,Cl),Dl(`custom`,`Custom`)],kl=Ol.map(e=>e.id),Al=new Map(Ol.map(e=>[e.id,e]));function jl(e){return e&&Al.get(e)||Ol[0]}function Ml(e){let t=jl(e).kind;return t===`system`?void 0:t}var Nl=Symbol.for(`@inkeep/open-knowledge/field-registry`),Pl=globalThis;Pl[Nl]===void 0&&(Pl[Nl]=So());var Fl=Pl[Nl];function Il(e){let t=e;for(let e=0;e<16;e++){if(t==null)return;let e=Ll(t)?Fl.get(t):void 0;if(e!==void 0)return e;let n=t._zod?.def?.innerType;if(n===void 0)return;t=n}}function Ll(e){return typeof e==`object`&&!!e&&`_zod`in e&&`parse`in e}var Rl=Object.freeze([`authorization`,`auth.token`,`auth.bearer`,`cookie`,`set-cookie`,`x-api-key`,`password`,`secret`]),zl=52428800,Bl=26214400,Vl=`https://api.openai.com/v1`,Hl=`text-embedding-3-small`;function Ul(e){let t;try{t=new URL(e)}catch{return`invalid-url`}if(t.protocol===`https:`)return null;let n=t.hostname.toLowerCase(),r=n===`localhost`||n===`127.0.0.1`||n===`[::1]`;return t.protocol===`http:`&&r?null:`insecure-scheme`}function Wl(e){let t=e.trim();return t===``?`./`:t}function Gl(e){let t=Wl(e);return t.includes(`\0`)||t.includes(`\\`)?!1:t===`/`?!0:!(t.startsWith(`/`)||/^[A-Za-z]:/.test(t)||t.split(`/`).some(e=>e===`..`))}var Kl=sc({content:sc({dir:k().register(Fl,{scope:`project`,agentSettable:!1,defaultScope:`project`,description:`Folder OpenKnowledge reads and writes documents under, relative to the project root (the folder that contains .ok/). Defaults to the project root. Exclude paths with .okignore.`}).default(`.`),attachmentFolderPath:k().register(Fl,{scope:`project`,agentSettable:!1,defaultScope:`project`,description:`Where pasted and dropped assets are stored, relative to the content root. './' colocates beside the current document (default); '/' targets the content root; './subdir' targets a subfolder under the current document folder; 'folder' targets a fixed folder under the content root. Whitespace-only values are treated as './'.`}).refine(Gl,{message:`Invalid attachment folder path: must not contain '..' segments, NUL bytes, backslashes, or OS absolute paths (use '/' for the content root).`}).default(`./`)}).default({dir:`.`,attachmentFolderPath:`./`}),appearance:sc({theme:P([`light`,`dark`,`system`]).register(Fl,{scope:`user`,agentSettable:!1,defaultScope:`user`,description:`Editor color theme: 'light', 'dark', or 'system' (follow the OS). A personal preference (user scope) — not shared with the project.`}).optional(),colorTheme:P(kl).register(Fl,{scope:`user`,agentSettable:!1,defaultScope:`user`,description:`IDE color palette: 'default' (follows the light/dark theme), one of 'dracula', 'catppuccin-frappe', 'catppuccin-latte', 'monokai', 'gruvbox', 'solarized', or 'custom' (your own colors from appearance.customTheme). A personal preference (user scope) — not shared with the project.`}).optional(),colorThemeEnabled:j().register(Fl,{scope:`user`,agentSettable:!1,defaultScope:`user`,description:`Whether the Themes plugin appears in Settings → Plugins. A personal preference (user scope). Default on.`}).optional(),customTheme:sc({background:k().register(Fl,{scope:`user`,agentSettable:!1,defaultScope:`user`,description:`Custom theme: editor canvas background, as a #rrggbb hex string.`}).optional(),surface:k().register(Fl,{scope:`user`,agentSettable:!1,defaultScope:`user`,description:`Custom theme: elevated surfaces (cards, sidebar, popovers), as a #rrggbb hex string.`}).optional(),foreground:k().register(Fl,{scope:`user`,agentSettable:!1,defaultScope:`user`,description:`Custom theme: primary text color, as a #rrggbb hex string.`}).optional(),primary:k().register(Fl,{scope:`user`,agentSettable:!1,defaultScope:`user`,description:`Custom theme: accent color for buttons, links, and focus, as a #rrggbb hex string.`}).optional(),accent:k().register(Fl,{scope:`user`,agentSettable:!1,defaultScope:`user`,description:`Custom theme: secondary accent (syntax highlights, charts), as a #rrggbb hex string.`}).optional(),border:k().register(Fl,{scope:`user`,agentSettable:!1,defaultScope:`user`,description:`Custom theme: hairline border + input color, as a #rrggbb hex string.`}).optional()}).optional(),preview:sc({autoOpen:j().register(Fl,{scope:`user`,agentSettable:!1,defaultScope:`user`,description:`When on, the agent opens or refreshes the live preview after each edit. Turn off if you manage your own preview window. A personal preference (user scope).`}).default(!0)}).default({autoOpen:!0}),sidebar:sc({showHiddenFiles:j().register(Fl,{scope:`project-local`,agentSettable:!1,defaultScope:`project-local`,description:`Show dot-prefixed entries (e.g. .ok/, .okignore) in the file tree. Per-machine (project-local) — not shared with collaborators.`}).default(!1),showOnlyMarkdownFiles:j().register(Fl,{scope:`project-local`,agentSettable:!1,defaultScope:`project-local`,description:`Show only markdown documents (.md/.mdx) and folders in the file tree, hiding other file types from view. View-only: hidden files stay on disk and remain reachable via links and search. Per-machine (project-local) — not shared with collaborators.`}).default(!1),showSkillsSection:j().register(Fl,{scope:`project-local`,agentSettable:!1,defaultScope:`project-local`,description:`Show the Skills section in the sidebar. Skill documents remain reachable via links and search while the section is hidden. Per-machine (project-local) — not shared with collaborators.`}).default(!0),showOkFolders:j().register(Fl,{scope:`project-local`,agentSettable:!1,defaultScope:`project-local`,description:`Show .ok folders (skills, templates, and other OpenKnowledge-managed state) in the file tree as read-only entries. .ok/worktrees and .ok/local never appear. Per-machine (project-local) — not shared with collaborators.`}).default(!1)}).optional()}).default({preview:{autoOpen:!0}}),editor:sc({wordWrap:j().register(Fl,{scope:`user`,agentSettable:!1,defaultScope:`user`,description:`Soft-wrap long lines in the source (CodeMirror) editor. A personal preference (user scope).`}).default(!0)}).default({wordWrap:!0}),agents:sc({autoApproveOkTools:j().register(Fl,{scope:`user`,agentSettable:!1,defaultScope:`user`,description:"Auto-approve OpenKnowledge's own tools (and `ok open` on Claude) for agents launched from the built-in terminal. Destructive tools (delete/move/share/install) still prompt. Per-machine personal preference (user scope)."}).default(!0)}).default({autoApproveOkTools:!0}),autoSync:sc({enabled:j().register(Fl,{scope:`project-local`,agentSettable:!1,defaultScope:`project-local`,description:`Whether this machine auto-pulls and auto-pushes git commits for this project. null = not chosen yet (onboarding asks). Per-machine (project-local) — not shared.`}).nullable().default(null),default:j().register(Fl,{scope:`project`,agentSettable:!1,defaultScope:`project`,description:`Committed project default for a machine's autoSync.enabled on first open: true = auto-sync on, false = off, null = ask (show the onboarding prompt). Shared via git. A per-machine autoSync.enabled choice overrides it.`}).nullable().default(null)}).default({enabled:null,default:null}),terminal:sc({enabled:j().register(Fl,{scope:`project-local`,agentSettable:!1,defaultScope:`project-local`,description:`Opt-out for the in-app terminal (a real OS shell at full user privilege). The terminal is on by default; set false to disable it for this project on this machine. Per-machine (project-local) — never shared via git, clone, or sync.`}).nullable().default(null)}).default({enabled:null}),telemetry:sc({localSink:sc({enabled:j().register(Fl,{scope:`project`,agentSettable:!1,defaultScope:`project`,description:"Write local diagnostic spans + logs under .ok/local/ for `ok diagnose bundle`. Local-only — never leaves the machine until you run bundle. Set false for sensitive workspaces. Shared across collaborators."}).default(!0),spans:sc({maxBytes:A().register(Fl,{scope:`project`,agentSettable:!1,defaultScope:`project`,description:`Maximum size, in bytes, of the local diagnostic spans file before it rotates (default ~50 MB).`}).default(zl)}).default({maxBytes:zl}),logs:sc({maxBytes:A().register(Fl,{scope:`project`,agentSettable:!1,defaultScope:`project`,description:`Maximum size, in bytes, of the local diagnostic logs file before it rotates (default ~25 MB).`}).default(Bl)}).default({maxBytes:Bl}),attributeDenylist:M(k()).register(Fl,{scope:`project`,agentSettable:!1,defaultScope:`project`,description:`Telemetry attribute keys whose values are redacted before any local span/log is written (credential / secret guard). Extends the built-in denylist.`}).default([...Rl])}).default({enabled:!0,spans:{maxBytes:zl},logs:{maxBytes:Bl},attributeDenylist:[...Rl]})}).default({localSink:{enabled:!0,spans:{maxBytes:zl},logs:{maxBytes:Bl},attributeDenylist:[...Rl]}}),search:sc({semantic:sc({enabled:j().register(Fl,{scope:`project-local`,agentSettable:!1,defaultScope:`project-local`,description:"Add semantic (embeddings) ranking to the MCP search tool, fused with the lexical engine so conceptually-related pages surface even with no shared keywords. When ON and an API key is set (`ok embeddings set-key`), the search query and matching document content are sent to the configured embeddings provider — content egress. Default OFF. Per-machine (project-local) — not shared with collaborators."}).default(!1),baseUrl:k().register(Fl,{scope:`project-local`,agentSettable:!1,defaultScope:`project-local`,description:"Base URL of the OpenAI-compatible embeddings API (default https://api.openai.com/v1). Override for Azure / self-hosted / other providers. The API key is NOT stored here — set it with `ok embeddings set-key` (OS keyring)."}).default(Vl),model:k().register(Fl,{scope:`project-local`,agentSettable:!1,defaultScope:`project-local`,description:`Embeddings model id (default text-embedding-3-small). Must be served by the provider at baseUrl. Changing it re-embeds the corpus (the cache is keyed by provider + model + dimensions).`}).default(Hl),dimensions:A().int().positive().register(Fl,{scope:`project-local`,agentSettable:!1,defaultScope:`project-local`,description:`Optional output vector dimensions. Omit to use the model's native size (1536 for text-embedding-3-small). Set a smaller value (text-embedding-3 supports e.g. 512 / 1024) to shrink the on-disk cache, trading a little retrieval quality. Changing it re-embeds the corpus.`}).optional(),similarityFloor:A().min(0).max(1).register(Fl,{scope:`project-local`,agentSettable:!1,defaultScope:`project-local`,description:`Optional hard cutoff: drop any "by meaning" match whose cosine similarity is below this value. Off by default (0) because retrieval is rank-based (the closest pages are returned regardless of absolute score) and the right cutoff is model-specific. Set it only to suppress weak matches for a specific provider/model whose cosine scale you know. Most setups should leave it unset and rely on the result-count cap.`}).optional()}).default({enabled:!1,baseUrl:Vl,model:Hl})}).default({semantic:{enabled:!1,baseUrl:Vl,model:Hl}}),contentRules:sc({markdownlint:N({enabled:j().register(Fl,{scope:`project`,agentSettable:!1,defaultScope:`project`,description:`Whether the markdownlint plugin (body rules) contributes diagnostics.`}).default(!1)}).default({enabled:!1})}).default({markdownlint:{enabled:!1}}),linkPreviews:sc({enabled:j().register(Fl,{scope:`project-local`,agentSettable:!1,defaultScope:`project-local`,description:`Show a rich preview card (site name, page title, description, favicon) when you hover an external link in the editor. When ON, hovering an external link sends that link's URL to the destination site to fetch its preview metadata — outbound egress, one request per previewed link. Default OFF. Per-machine (project-local) — not shared with collaborators. Previews of links to other documents in this project are read from the local index with no network request and are always on.`}).default(!1)}).default({enabled:!1})}),ql=`open-knowledge-config`;function Jl(e,t,n){let r=o.getTracer(ql),i=t?{attributes:t}:{};return r.startActiveSpan(e,i,e=>{try{return n(e)}catch(t){throw e.recordException(t),e.setStatus({code:a.ERROR,message:t instanceof Error?t.message:String(t)}),t}finally{e.end()}})}function Yl(e,t){let n=o.getActiveSpan();n&&n.addEvent(e,t)}function Xl(e){let t=e;for(let e=0;e<16;e++){if(t==null||t?._zod?.def?.shape!==void 0)return t;let e=t?._zod?.def?.innerType;if(e===void 0)return t;t=e}return t}function Zl(e,t){let n=e;for(let e of t){n=Xl(n);let t=n?._zod?.def?.shape;if(!t||(n=t[String(e)],n===void 0))return}return n}function Ql(e,t){let n=Zl(e,t);if(n!==void 0)return Il(n)}function $l(e,t){return e===`either`?!0:e===t}function eu(e,t){let n=null;function r(e,i){if(n!==null||e===void 0)return;if(typeof e==`object`&&e&&!Array.isArray(e)){for(let[t,a]of Object.entries(e))if(r(a,[...i,t]),n!==null)return;return}let a=Ql(Kl,i);a?.scope!==void 0&&($l(a.scope,t)||(n={code:`SCOPE_VIOLATION`,path:i,expectedScope:a.scope,actualScope:t}))}for(let[t,i]of Object.entries(e))if(r(i,[t]),n!==null)break;return n}function tu(e,t){for(let n=1;n<t.length;n++){let r=t.slice(0,n);e.hasIn(r)&&(w(e.getIn(r,!0))||e.deleteIn(r))}}function nu(e,t){let n=[];function r(t,i){if(t!==void 0){if(t===null){e.deleteIn(i),n.push(i.join(`.`));return}if(Array.isArray(t)){tu(e,i),e.setIn(i,t),n.push(i.join(`.`));return}if(typeof t==`object`){for(let[e,n]of Object.entries(t))r(n,[...i,e]);return}tu(e,i),e.setIn(i,t),n.push(i.join(`.`))}}for(let[e,n]of Object.entries(t))r(n,[e]);return n}function ru(e){return{path:e.path.map(e=>typeof e==`symbol`?String(e):e),message:e.message,issueCode:e.code}}var iu=N({file:k(),line:A().int().min(1),column:A().int().min(1),snippet:k().optional()}),au=N({path:M(lc([k(),A()])),message:k(),issueCode:k(),params:dc(k(),ac()).optional(),source:iu.optional()}),ou=P([`user`,`project`,`project-local`,`either`]),su=P([`user`,`project`,`project-local`]),cu=uc(`code`,[N({code:F(`YAML_PARSE`),detail:k()}),N({code:F(`SCHEMA_INVALID`),issues:M(au)}),N({code:F(`SCOPE_VIOLATION`),path:M(k()),expectedScope:ou,actualScope:su}),N({code:F(`NOT_AGENT_SETTABLE`),path:M(k())}),N({code:F(`MIXED_SCOPE`),paths:M(N({path:M(k()),scope:su}))}),N({code:F(`REMOVED_KEY`),path:M(k()),redirect:k(),source:iu.optional()}),N({code:F(`WRITE_ERROR`),detail:k()}),N({code:F(`OKIGNORE_INVALID`),detail:k(),lineNumber:A().int().min(1).optional()}),N({code:F(`UNKNOWN`),message:k().optional()})]),lu=new Set(cu.options.map(e=>e.shape.code.value)),uu=lc([cu,sc({code:k(),message:k().optional()})]);function du(e){return lu.has(e.code)}function fu(e){switch(e){case`user`:return`~/.ok/global.yml`;case`project`:return`.ok/config.yml`;case`project-local`:return`.ok/local/config.yml`;case`either`:return`.ok/config.yml or ~/.ok/global.yml`}}function pu(e){switch(e){case`user`:return`personal to you, across all projects`;case`project`:return`shared with your team via git`;case`project-local`:return`this machine only, not shared`;case`either`:return`user or project`}}function mu(e){if(!du(e))return e.message??`Unknown error (${e.code}).`;switch(e.code){case`YAML_PARSE`:return`Failed to parse YAML: ${e.detail}`;case`SCHEMA_INVALID`:{if(e.issues.length===0)return`Invalid configuration.`;let t=new Map;for(let n of e.issues){let e=n.source?.file??`<no source>`,r=t.get(e)??[];r.push(n),t.set(e,r)}let n=[];for(let[e,r]of t){e===`<no source>`?n.push(`Invalid configuration:`):n.push(`Invalid configuration at ${e}:`);for(let t of r){let r=t.path.length===0?`<root>`:t.path.join(`.`);if(t.source){if(n.push(` ${e}:${t.source.line}:${t.source.column}`),n.push(` ${r}: ${t.message}`),t.source.snippet&&t.source.snippet.length>0)for(let e of t.source.snippet.split(`
|
|
146
|
+
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let n of e.seen.entries()){let r=n[1];if(t===n[0]){a(n);continue}if(e.external){let r=e.external.registry.get(n[0])?.id;if(t!==n[0]&&r){a(n);continue}}if(e.metadataRegistry.get(n[0])?.id){a(n);continue}if(r.cycle){a(n);continue}if(r.count>1&&e.reused===`ref`){a(n);continue}}}function Ms(e,t){let n=e.seen.get(t);if(!n)throw Error(`Unprocessed schema. This is a bug in Zod.`);let r=t=>{let n=e.seen.get(t);if(n.ref===null)return;let i=n.def??n.schema,a={...i},o=n.ref;if(n.ref=null,o){r(o);let n=e.seen.get(o),s=n.schema;if(s.$ref&&(e.target===`draft-07`||e.target===`draft-04`||e.target===`openapi-3.0`)?(i.allOf=i.allOf??[],i.allOf.push(s)):Object.assign(i,s),Object.assign(i,a),t._zod.parent===o)for(let e in i)e===`$ref`||e===`allOf`||e in a||delete i[e];if(s.$ref&&n.def)for(let e in i)e===`$ref`||e===`allOf`||e in n.def&&JSON.stringify(i[e])===JSON.stringify(n.def[e])&&delete i[e]}let s=t._zod.parent;if(s&&s!==o){r(s);let t=e.seen.get(s);if(t?.schema.$ref&&(i.$ref=t.schema.$ref,t.def))for(let e in i)e===`$ref`||e===`allOf`||e in t.def&&JSON.stringify(i[e])===JSON.stringify(t.def[e])&&delete i[e]}e.override({zodSchema:t,jsonSchema:i,path:n.path??[]})};for(let t of[...e.seen.entries()].reverse())r(t[0]);let i={};if(e.target===`draft-2020-12`?i.$schema=`https://json-schema.org/draft/2020-12/schema`:e.target===`draft-07`?i.$schema=`http://json-schema.org/draft-07/schema#`:e.target===`draft-04`?i.$schema=`http://json-schema.org/draft-04/schema#`:e.target,e.external?.uri){let n=e.external.registry.get(t)?.id;if(!n)throw Error("Schema is missing an `id` property");i.$id=e.external.uri(n)}Object.assign(i,n.def??n.schema);let a=e.external?.defs??{};for(let t of e.seen.entries()){let e=t[1];e.def&&e.defId&&(a[e.defId]=e.def)}e.external||Object.keys(a).length>0&&(e.target===`draft-2020-12`?i.$defs=a:i.definitions=a);try{let n=JSON.parse(JSON.stringify(i));return Object.defineProperty(n,`~standard`,{value:{...t[`~standard`],jsonSchema:{input:Fs(t,`input`,e.processors),output:Fs(t,`output`,e.processors)}},enumerable:!1,writable:!1}),n}catch{throw Error(`Error converting schema to JSON.`)}}function Ns(e,t){let n=t??{seen:new Set};if(n.seen.has(e))return!1;n.seen.add(e);let r=e._zod.def;if(r.type===`transform`)return!0;if(r.type===`array`)return Ns(r.element,n);if(r.type===`set`)return Ns(r.valueType,n);if(r.type===`lazy`)return Ns(r.getter(),n);if(r.type===`promise`||r.type===`optional`||r.type===`nonoptional`||r.type===`nullable`||r.type===`readonly`||r.type===`default`||r.type===`prefault`)return Ns(r.innerType,n);if(r.type===`intersection`)return Ns(r.left,n)||Ns(r.right,n);if(r.type===`record`||r.type===`map`)return Ns(r.keyType,n)||Ns(r.valueType,n);if(r.type===`pipe`)return Ns(r.in,n)||Ns(r.out,n);if(r.type===`object`){for(let e in r.shape)if(Ns(r.shape[e],n))return!0;return!1}if(r.type===`union`){for(let e of r.options)if(Ns(e,n))return!0;return!1}if(r.type===`tuple`){for(let e of r.items)if(Ns(e,n))return!0;return!!(r.rest&&Ns(r.rest,n))}return!1}var Ps=(e,t={})=>n=>{let r=ks({...n,processors:t});return As(e,r),js(r,e),Ms(r,e)},Fs=(e,t,n={})=>r=>{let{libraryOptions:i,target:a}=r??{},o=ks({...i??{},target:a,io:t,processors:n});return As(e,o),js(o,e),Ms(o,e)},Is={guid:`uuid`,url:`uri`,datetime:`date-time`,json_string:`json-string`,regex:``},Ls=(e,t,n,r)=>{let i=n;i.type=`string`;let{minimum:a,maximum:o,format:s,patterns:c,contentEncoding:l}=e._zod.bag;if(typeof a==`number`&&(i.minLength=a),typeof o==`number`&&(i.maxLength=o),s&&(i.format=Is[s]??s,i.format===``&&delete i.format,s===`time`&&delete i.format),l&&(i.contentEncoding=l),c&&c.size>0){let e=[...c];e.length===1?i.pattern=e[0].source:e.length>1&&(i.allOf=[...e.map(e=>({...t.target===`draft-07`||t.target===`draft-04`||t.target===`openapi-3.0`?{type:`string`}:{},pattern:e.source}))])}},Rs=(e,t,n,r)=>{let i=n,{minimum:a,maximum:o,format:s,multipleOf:c,exclusiveMaximum:l,exclusiveMinimum:u}=e._zod.bag;typeof s==`string`&&s.includes(`int`)?i.type=`integer`:i.type=`number`,typeof u==`number`&&(t.target===`draft-04`||t.target===`openapi-3.0`?(i.minimum=u,i.exclusiveMinimum=!0):i.exclusiveMinimum=u),typeof a==`number`&&(i.minimum=a,typeof u==`number`&&t.target!==`draft-04`&&(u>=a?delete i.minimum:delete i.exclusiveMinimum)),typeof l==`number`&&(t.target===`draft-04`||t.target===`openapi-3.0`?(i.maximum=l,i.exclusiveMaximum=!0):i.exclusiveMaximum=l),typeof o==`number`&&(i.maximum=o,typeof l==`number`&&t.target!==`draft-04`&&(l<=o?delete i.maximum:delete i.exclusiveMaximum)),typeof c==`number`&&(i.multipleOf=c)},zs=(e,t,n,r)=>{n.type=`boolean`},Bs=(e,t,n,r)=>{t.target===`openapi-3.0`?(n.type=`string`,n.nullable=!0,n.enum=[null]):n.type=`null`},Vs=(e,t,n,r)=>{n.not={}},Hs=(e,t,n,r)=>{let i=e._zod.def,a=Sr(i.entries);a.every(e=>typeof e==`number`)&&(n.type=`number`),a.every(e=>typeof e==`string`)&&(n.type=`string`),n.enum=a},Us=(e,t,n,r)=>{let i=e._zod.def,a=[];for(let e of i.values)if(e===void 0){if(t.unrepresentable===`throw`)throw Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof e==`bigint`){if(t.unrepresentable===`throw`)throw Error(`BigInt literals cannot be represented in JSON Schema`);a.push(Number(e))}else a.push(e);if(a.length!==0)if(a.length===1){let e=a[0];n.type=e===null?`null`:typeof e,t.target===`draft-04`||t.target===`openapi-3.0`?n.enum=[e]:n.const=e}else a.every(e=>typeof e==`number`)&&(n.type=`number`),a.every(e=>typeof e==`string`)&&(n.type=`string`),a.every(e=>typeof e==`boolean`)&&(n.type=`boolean`),a.every(e=>e===null)&&(n.type=`null`),n.enum=a},Ws=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Custom types cannot be represented in JSON Schema`)},kee=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Transforms cannot be represented in JSON Schema`)},Aee=(e,t,n,r)=>{let i=n,a=e._zod.def,{minimum:o,maximum:s}=e._zod.bag;typeof o==`number`&&(i.minItems=o),typeof s==`number`&&(i.maxItems=s),i.type=`array`,i.items=As(a.element,t,{...r,path:[...r.path,`items`]})},jee=(e,t,n,r)=>{let i=n,a=e._zod.def;i.type=`object`,i.properties={};let o=a.shape;for(let e in o)i.properties[e]=As(o[e],t,{...r,path:[...r.path,`properties`,e]});let s=new Set(Object.keys(o)),c=new Set([...s].filter(e=>{let n=a.shape[e]._zod;return t.io===`input`?n.optin===void 0:n.optout===void 0}));c.size>0&&(i.required=Array.from(c)),a.catchall?._zod.def.type===`never`?i.additionalProperties=!1:a.catchall?a.catchall&&(i.additionalProperties=As(a.catchall,t,{...r,path:[...r.path,`additionalProperties`]})):t.io===`output`&&(i.additionalProperties=!1)},Mee=(e,t,n,r)=>{let i=e._zod.def,a=i.inclusive===!1,o=i.options.map((e,n)=>As(e,t,{...r,path:[...r.path,a?`oneOf`:`anyOf`,n]}));a?n.oneOf=o:n.anyOf=o},Nee=(e,t,n,r)=>{let i=e._zod.def,a=As(i.left,t,{...r,path:[...r.path,`allOf`,0]}),o=As(i.right,t,{...r,path:[...r.path,`allOf`,1]}),s=e=>`allOf`in e&&Object.keys(e).length===1;n.allOf=[...s(a)?a.allOf:[a],...s(o)?o.allOf:[o]]},Pee=(e,t,n,r)=>{let i=n,a=e._zod.def;i.type=`object`;let o=a.keyType,s=o._zod.bag?.patterns;if(a.mode===`loose`&&s&&s.size>0){let e=As(a.valueType,t,{...r,path:[...r.path,`patternProperties`,`*`]});i.patternProperties={};for(let t of s)i.patternProperties[t.source]=e}else (t.target===`draft-07`||t.target===`draft-2020-12`)&&(i.propertyNames=As(a.keyType,t,{...r,path:[...r.path,`propertyNames`]})),i.additionalProperties=As(a.valueType,t,{...r,path:[...r.path,`additionalProperties`]});let c=o._zod.values;if(c){let e=[...c].filter(e=>typeof e==`string`||typeof e==`number`);e.length>0&&(i.required=e)}},Fee=(e,t,n,r)=>{let i=e._zod.def,a=As(i.innerType,t,r),o=t.seen.get(e);t.target===`openapi-3.0`?(o.ref=i.innerType,n.nullable=!0):n.anyOf=[a,{type:`null`}]},Iee=(e,t,n,r)=>{let i=e._zod.def;As(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},Lee=(e,t,n,r)=>{let i=e._zod.def;As(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,n.default=JSON.parse(JSON.stringify(i.defaultValue))},Ree=(e,t,n,r)=>{let i=e._zod.def;As(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,t.io===`input`&&(n._prefault=JSON.parse(JSON.stringify(i.defaultValue)))},zee=(e,t,n,r)=>{let i=e._zod.def;As(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType;let o;try{o=i.catchValue(void 0)}catch{throw Error(`Dynamic catch values are not supported in JSON Schema`)}n.default=o},Bee=(e,t,n,r)=>{let i=e._zod.def,a=t.io===`input`?i.in._zod.def.type===`transform`?i.out:i.in:i.out;As(a,t,r);let o=t.seen.get(e);o.ref=a},Vee=(e,t,n,r)=>{let i=e._zod.def;As(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,n.readOnly=!0},Gs=(e,t,n,r)=>{let i=e._zod.def;As(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},Hee=(e,t,n,r)=>{let i=e._zod.innerType;As(i,t,r);let a=t.seen.get(e);a.ref=i},Uee=D(`ZodISODateTime`,(e,t)=>{va.init(e,t),Zs.init(e,t)});function Ks(e){return qo(Uee,e)}var Wee=D(`ZodISODate`,(e,t)=>{ya.init(e,t),Zs.init(e,t)});function Gee(e){return Jo(Wee,e)}var Kee=D(`ZodISOTime`,(e,t)=>{ba.init(e,t),Zs.init(e,t)});function qee(e){return Yo(Kee,e)}var Jee=D(`ZodISODuration`,(e,t)=>{xa.init(e,t),Zs.init(e,t)});function Yee(e){return Xo(Jee,e)}var qs=(e,t)=>{ti.init(e,t),e.name=`ZodError`,Object.defineProperties(e,{format:{value:t=>_ee(e,t)},flatten:{value:t=>gee(e,t)},addIssue:{value:t=>{e.issues.push(t),e.message=JSON.stringify(e.issues,Cr,2)}},addIssues:{value:t=>{e.issues.push(...t),e.message=JSON.stringify(e.issues,Cr,2)}},isEmpty:{get(){return e.issues.length===0}}})};D(`ZodError`,qs);var Js=D(`ZodError`,qs,{Parent:Error}),Xee=ri(Js),Zee=ii(Js),Qee=ai(Js),$ee=oi(Js),ete=See(Js),tte=Cee(Js),nte=wee(Js),rte=Tee(Js),ite=Eee(Js),ate=Dee(Js),ote=Oee(Js),ste=si(Js),Ys=D(`ZodType`,(e,t)=>(ia.init(e,t),Object.assign(e[`~standard`],{jsonSchema:{input:Fs(e,`input`),output:Fs(e,`output`)}}),e.toJSONSchema=Ps(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,`_def`,{value:t}),e.check=(...n)=>e.clone(jr(t,{checks:[...t.checks??[],...n.map(e=>typeof e==`function`?{_zod:{check:e,def:{check:`custom`},onattach:[]}}:e)]}),{parent:!0}),e.with=e.check,e.clone=(t,n)=>Vr(e,t,n),e.brand=()=>e,e.register=((t,n)=>(t.add(e,n),e)),e.parse=(t,n)=>Xee(e,t,n,{callee:e.parse}),e.safeParse=(t,n)=>Qee(e,t,n),e.parseAsync=async(t,n)=>Zee(e,t,n,{callee:e.parseAsync}),e.safeParseAsync=async(t,n)=>$ee(e,t,n),e.spa=e.safeParseAsync,e.encode=(t,n)=>ete(e,t,n),e.decode=(t,n)=>tte(e,t,n),e.encodeAsync=async(t,n)=>nte(e,t,n),e.decodeAsync=async(t,n)=>rte(e,t,n),e.safeEncode=(t,n)=>ite(e,t,n),e.safeDecode=(t,n)=>ate(e,t,n),e.safeEncodeAsync=async(t,n)=>ote(e,t,n),e.safeDecodeAsync=async(t,n)=>ste(e,t,n),e.refine=(t,n)=>e.check(Lc(t,n)),e.superRefine=t=>e.check(Rc(t)),e.overwrite=t=>e.check(vs(t)),e.optional=()=>gc(e),e.exactOptional=()=>vc(e),e.nullable=()=>bc(e),e.nullish=()=>gc(bc(e)),e.nonoptional=t=>Ec(e,t),e.array=()=>M(e),e.or=t=>lc([e,t]),e.and=t=>Fte(e,t),e.transform=t=>Ac(e,mc(t)),e.default=t=>Sc(e,t),e.prefault=t=>wc(e,t),e.catch=t=>Oc(e,t),e.pipe=t=>Ac(e,t),e.readonly=()=>Mc(e),e.describe=t=>{let n=e.clone();return Co.add(n,{description:t}),n},Object.defineProperty(e,`description`,{get(){return Co.get(e)?.description},configurable:!0}),e.meta=(...t)=>{if(t.length===0)return Co.get(e);let n=e.clone();return Co.add(n,t[0]),n},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e.apply=t=>t(e),e)),Xs=D(`_ZodString`,(e,t)=>{aa.init(e,t),Ys.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ls(e,t,n,r);let n=e._zod.bag;e.format=n.format??null,e.minLength=n.minimum??null,e.maxLength=n.maximum??null,e.regex=(...t)=>e.check(fs(...t)),e.includes=(...t)=>e.check(hs(...t)),e.startsWith=(...t)=>e.check(gs(...t)),e.endsWith=(...t)=>e.check(_s(...t)),e.min=(...t)=>e.check(us(...t)),e.max=(...t)=>e.check(ls(...t)),e.length=(...t)=>e.check(ds(...t)),e.nonempty=(...t)=>e.check(us(1,...t)),e.lowercase=t=>e.check(ps(t)),e.uppercase=t=>e.check(ms(t)),e.trim=()=>e.check(bs()),e.normalize=(...t)=>e.check(ys(...t)),e.toLowerCase=()=>e.check(xs()),e.toUpperCase=()=>e.check(Ss()),e.slugify=()=>e.check(Cs())}),cte=D(`ZodString`,(e,t)=>{aa.init(e,t),Xs.init(e,t),e.email=t=>e.check(To(Qs,t)),e.url=t=>e.check(jo(tc,t)),e.jwt=t=>e.check(Ko(Tte,t)),e.emoji=t=>e.check(Mo(dte,t)),e.guid=t=>e.check(Eo($s,t)),e.uuid=t=>e.check(Do(ec,t)),e.uuidv4=t=>e.check(Oo(ec,t)),e.uuidv6=t=>e.check(ko(ec,t)),e.uuidv7=t=>e.check(Ao(ec,t)),e.nanoid=t=>e.check(No(fte,t)),e.guid=t=>e.check(Eo($s,t)),e.cuid=t=>e.check(Po(pte,t)),e.cuid2=t=>e.check(Fo(mte,t)),e.ulid=t=>e.check(Io(hte,t)),e.base64=t=>e.check(Uo(Ste,t)),e.base64url=t=>e.check(Wo(Cte,t)),e.xid=t=>e.check(Lo(gte,t)),e.ksuid=t=>e.check(Ro(_te,t)),e.ipv4=t=>e.check(zo(vte,t)),e.ipv6=t=>e.check(Bo(yte,t)),e.cidrv4=t=>e.check(Vo(bte,t)),e.cidrv6=t=>e.check(Ho(xte,t)),e.e164=t=>e.check(Go(wte,t)),e.datetime=t=>e.check(Ks(t)),e.date=t=>e.check(Gee(t)),e.time=t=>e.check(qee(t)),e.duration=t=>e.check(Yee(t))});function k(e){return wo(cte,e)}var Zs=D(`ZodStringFormat`,(e,t)=>{oa.init(e,t),Xs.init(e,t)}),Qs=D(`ZodEmail`,(e,t)=>{la.init(e,t),Zs.init(e,t)});function lte(e){return To(Qs,e)}var $s=D(`ZodGUID`,(e,t)=>{sa.init(e,t),Zs.init(e,t)}),ec=D(`ZodUUID`,(e,t)=>{ca.init(e,t),Zs.init(e,t)}),tc=D(`ZodURL`,(e,t)=>{ua.init(e,t),Zs.init(e,t)});function ute(e){return jo(tc,e)}var dte=D(`ZodEmoji`,(e,t)=>{da.init(e,t),Zs.init(e,t)}),fte=D(`ZodNanoID`,(e,t)=>{fa.init(e,t),Zs.init(e,t)}),pte=D(`ZodCUID`,(e,t)=>{pa.init(e,t),Zs.init(e,t)}),mte=D(`ZodCUID2`,(e,t)=>{ma.init(e,t),Zs.init(e,t)}),hte=D(`ZodULID`,(e,t)=>{ha.init(e,t),Zs.init(e,t)}),gte=D(`ZodXID`,(e,t)=>{ga.init(e,t),Zs.init(e,t)}),_te=D(`ZodKSUID`,(e,t)=>{_a.init(e,t),Zs.init(e,t)}),vte=D(`ZodIPv4`,(e,t)=>{Sa.init(e,t),Zs.init(e,t)}),yte=D(`ZodIPv6`,(e,t)=>{Ca.init(e,t),Zs.init(e,t)}),bte=D(`ZodCIDRv4`,(e,t)=>{wa.init(e,t),Zs.init(e,t)}),xte=D(`ZodCIDRv6`,(e,t)=>{Ta.init(e,t),Zs.init(e,t)}),Ste=D(`ZodBase64`,(e,t)=>{Da.init(e,t),Zs.init(e,t)}),Cte=D(`ZodBase64URL`,(e,t)=>{ka.init(e,t),Zs.init(e,t)}),wte=D(`ZodE164`,(e,t)=>{Aa.init(e,t),Zs.init(e,t)}),Tte=D(`ZodJWT`,(e,t)=>{Ma.init(e,t),Zs.init(e,t)}),nc=D(`ZodNumber`,(e,t)=>{Na.init(e,t),Ys.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Rs(e,t,n,r),e.gt=(t,n)=>e.check(as(t,n)),e.gte=(t,n)=>e.check(ss(t,n)),e.min=(t,n)=>e.check(ss(t,n)),e.lt=(t,n)=>e.check(rs(t,n)),e.lte=(t,n)=>e.check(is(t,n)),e.max=(t,n)=>e.check(is(t,n)),e.int=t=>e.check(rc(t)),e.safe=t=>e.check(rc(t)),e.positive=t=>e.check(as(0,t)),e.nonnegative=t=>e.check(ss(0,t)),e.negative=t=>e.check(rs(0,t)),e.nonpositive=t=>e.check(is(0,t)),e.multipleOf=(t,n)=>e.check(cs(t,n)),e.step=(t,n)=>e.check(cs(t,n)),e.finite=()=>e;let n=e._zod.bag;e.minValue=Math.max(n.minimum??-1/0,n.exclusiveMinimum??-1/0)??null,e.maxValue=Math.min(n.maximum??1/0,n.exclusiveMaximum??1/0)??null,e.isInt=(n.format??``).includes(`int`)||Number.isSafeInteger(n.multipleOf??.5),e.isFinite=!0,e.format=n.format??null});function A(e){return Zo(nc,e)}var Ete=D(`ZodNumberFormat`,(e,t)=>{Pa.init(e,t),nc.init(e,t)});function rc(e){return Qo(Ete,e)}var Dte=D(`ZodBoolean`,(e,t)=>{Fa.init(e,t),Ys.init(e,t),e._zod.processJSONSchema=(t,n,r)=>zs(e,t,n,r)});function j(e){return $o(Dte,e)}var Ote=D(`ZodNull`,(e,t)=>{Ia.init(e,t),Ys.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Bs(e,t,n,r)});function ic(e){return es(Ote,e)}var kte=D(`ZodUnknown`,(e,t)=>{La.init(e,t),Ys.init(e,t),e._zod.processJSONSchema=(e,t,n)=>void 0});function ac(){return ts(kte)}var Ate=D(`ZodNever`,(e,t)=>{Ra.init(e,t),Ys.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Vs(e,t,n,r)});function jte(e){return ns(Ate,e)}var Mte=D(`ZodArray`,(e,t)=>{Ba.init(e,t),Ys.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Aee(e,t,n,r),e.element=t.element,e.min=(t,n)=>e.check(us(t,n)),e.nonempty=t=>e.check(us(1,t)),e.max=(t,n)=>e.check(ls(t,n)),e.length=(t,n)=>e.check(ds(t,n)),e.unwrap=()=>e.element});function M(e,t){return ws(Mte,e,t)}var oc=D(`ZodObject`,(e,t)=>{Ga.init(e,t),Ys.init(e,t),e._zod.processJSONSchema=(t,n,r)=>jee(e,t,n,r),kr(e,`shape`,()=>t.shape),e.keyof=()=>P(Object.keys(e._zod.def.shape)),e.catchall=t=>e.clone({...e._zod.def,catchall:t}),e.passthrough=()=>e.clone({...e._zod.def,catchall:ac()}),e.loose=()=>e.clone({...e._zod.def,catchall:ac()}),e.strict=()=>e.clone({...e._zod.def,catchall:jte()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=t=>Kr(e,t),e.safeExtend=t=>qr(e,t),e.merge=t=>pee(e,t),e.pick=t=>Wr(e,t),e.omit=t=>Gr(e,t),e.partial=(...t)=>mee(hc,e,t[0]),e.required=(...t)=>hee(Tc,e,t[0])});function N(e,t){return new oc({type:`object`,shape:e??{},...O(t)})}function sc(e,t){return new oc({type:`object`,shape:e,catchall:ac(),...O(t)})}var cc=D(`ZodUnion`,(e,t)=>{qa.init(e,t),Ys.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Mee(e,t,n,r),e.options=t.options});function lc(e,t){return new cc({type:`union`,options:e,...O(t)})}var Nte=D(`ZodDiscriminatedUnion`,(e,t)=>{cc.init(e,t),Ja.init(e,t)});function uc(e,t,n){return new Nte({type:`union`,options:t,discriminator:e,...O(n)})}var Pte=D(`ZodIntersection`,(e,t)=>{Ya.init(e,t),Ys.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Nee(e,t,n,r)});function Fte(e,t){return new Pte({type:`intersection`,left:e,right:t})}var Ite=D(`ZodRecord`,(e,t)=>{Qa.init(e,t),Ys.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Pee(e,t,n,r),e.keyType=t.keyType,e.valueType=t.valueType});function dc(e,t,n){return new Ite({type:`record`,keyType:e,valueType:t,...O(n)})}var fc=D(`ZodEnum`,(e,t)=>{$a.init(e,t),Ys.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Hs(e,t,n,r),e.enum=t.entries,e.options=Object.values(t.entries);let n=new Set(Object.keys(t.entries));e.extract=(e,r)=>{let i={};for(let r of e)if(n.has(r))i[r]=t.entries[r];else throw Error(`Key ${r} not found in enum`);return new fc({...t,checks:[],...O(r),entries:i})},e.exclude=(e,r)=>{let i={...t.entries};for(let t of e)if(n.has(t))delete i[t];else throw Error(`Key ${t} not found in enum`);return new fc({...t,checks:[],...O(r),entries:i})}});function P(e,t){return new fc({type:`enum`,entries:Array.isArray(e)?Object.fromEntries(e.map(e=>[e,e])):e,...O(t)})}var Lte=D(`ZodLiteral`,(e,t)=>{eo.init(e,t),Ys.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Us(e,t,n,r),e.values=new Set(t.values),Object.defineProperty(e,`value`,{get(){if(t.values.length>1)throw Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function F(e,t){return new Lte({type:`literal`,values:Array.isArray(e)?e:[e],...O(t)})}var pc=D(`ZodTransform`,(e,t)=>{to.init(e,t),Ys.init(e,t),e._zod.processJSONSchema=(t,n,r)=>kee(e,t,n,r),e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new yr(e.constructor.name);n.addIssue=r=>{if(typeof r==`string`)n.issues.push($r(r,n.value,t));else{let t=r;t.fatal&&(t.continue=!1),t.code??=`custom`,t.input??=n.value,t.inst??=e,n.issues.push($r(t))}};let i=t.transform(n.value,n);return i instanceof Promise?i.then(e=>(n.value=e,n)):(n.value=i,n)}});function mc(e){return new pc({type:`transform`,transform:e})}var hc=D(`ZodOptional`,(e,t)=>{ro.init(e,t),Ys.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Gs(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function gc(e){return new hc({type:`optional`,innerType:e})}var _c=D(`ZodExactOptional`,(e,t)=>{io.init(e,t),Ys.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Gs(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function vc(e){return new _c({type:`optional`,innerType:e})}var yc=D(`ZodNullable`,(e,t)=>{ao.init(e,t),Ys.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Fee(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function bc(e){return new yc({type:`nullable`,innerType:e})}var xc=D(`ZodDefault`,(e,t)=>{oo.init(e,t),Ys.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Lee(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function Sc(e,t){return new xc({type:`default`,innerType:e,get defaultValue(){return typeof t==`function`?t():Rr(t)}})}var Cc=D(`ZodPrefault`,(e,t)=>{co.init(e,t),Ys.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ree(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function wc(e,t){return new Cc({type:`prefault`,innerType:e,get defaultValue(){return typeof t==`function`?t():Rr(t)}})}var Tc=D(`ZodNonOptional`,(e,t)=>{lo.init(e,t),Ys.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Iee(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Ec(e,t){return new Tc({type:`nonoptional`,innerType:e,...O(t)})}var Dc=D(`ZodCatch`,(e,t)=>{fo.init(e,t),Ys.init(e,t),e._zod.processJSONSchema=(t,n,r)=>zee(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function Oc(e,t){return new Dc({type:`catch`,innerType:e,catchValue:typeof t==`function`?t:()=>t})}var kc=D(`ZodPipe`,(e,t)=>{po.init(e,t),Ys.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Bee(e,t,n,r),e.in=t.in,e.out=t.out});function Ac(e,t){return new kc({type:`pipe`,in:e,out:t})}var jc=D(`ZodReadonly`,(e,t)=>{ho.init(e,t),Ys.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Vee(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Mc(e){return new jc({type:`readonly`,innerType:e})}var Nc=D(`ZodLazy`,(e,t)=>{_o.init(e,t),Ys.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Hee(e,t,n,r),e.unwrap=()=>e._zod.def.getter()});function Pc(e){return new Nc({type:`lazy`,getter:e})}var Fc=D(`ZodCustom`,(e,t)=>{vo.init(e,t),Ys.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ws(e,t,n,r)});function Ic(e,t){return Ts(Fc,e??(()=>!0),t)}function Lc(e,t={}){return Es(Fc,e,t)}function Rc(e){return Ds(e)}function zc(e,t){return Ac(mc(e),t)}var Bc={sh:`bash`,zsh:`bash`,bash:`bash`,c:`c`,cc:`cpp`,cpp:`cpp`,cxx:`cpp`,"c++":`cpp`,h:`c`,hh:`cpp`,hpp:`cpp`,cs:`csharp`,css:`css`,less:`less`,scss:`scss`,sass:`scss`,diff:`diff`,patch:`diff`,go:`go`,gql:`graphql`,graphql:`graphql`,ini:`ini`,cfg:`ini`,conf:`ini`,properties:`ini`,java:`java`,js:`javascript`,jsx:`javascript`,mjs:`javascript`,cjs:`javascript`,json:`json`,jsonc:`json`,kt:`kotlin`,kts:`kotlin`,lua:`lua`,makefile:`makefile`,md:`markdown`,mdx:`markdown`,m:`objectivec`,mm:`objectivec`,pl:`perl`,pm:`perl`,php:`php`,phtml:`php`,py:`python`,pyi:`python`,pyx:`python`,r:`r`,rb:`ruby`,rs:`rust`,sql:`sql`,swift:`swift`,ts:`typescript`,tsx:`typescript`,xml:`xml`,yaml:`yaml`,yml:`yaml`},Vc=new Set(Object.keys(Bc));function Hc(e){return Bc[e.toLowerCase().replace(/^\./,``)]??null}var Uc=[`image/jpeg`,`image/png`,`image/gif`,`image/webp`,`image/svg+xml`],Wc=[`video/mp4`,`video/webm`,`video/ogg`],Gc=[`audio/mpeg`,`audio/wav`,`audio/ogg`],Kc=[`application/pdf`],qc=new Set([`png`,`jpg`,`jpeg`,`gif`,`webp`,`avif`,`svg`]),Jc=new Set([`mp4`,`webm`,`mov`,`m4v`,`mkv`]),Yc=new Set([`pdf`]),Xc=new Set([`mp3`,`wav`,`ogg`,`m4a`,`flac`,`aac`,`opus`]),Zc=new Set(`pdf.docx.xlsx.pptx.doc.xls.ppt.zip.7z.tar.gz.rar.csv.tsv.rtf.json.yaml.yml.xml.txt.pages.numbers.key.odt.ods.odp.epub.mobi`.split(`.`)),Qc=new Set(`png.jpg.jpeg.gif.webp.avif.svg.apng.heic.heif.tiff.bmp.ico.pdf.mp4.webm.mov.m4v.mkv.avi.flv.wmv.mpeg.mpg.mp3.wav.ogg.m4a.flac.aac.opus.zip.7z.tar.gz.rar.woff.woff2.ttf.otf.eot.docx.xlsx.pptx.doc.xls.ppt.odt.ods.odp.pages.numbers.key.epub.mobi.csv.tsv.txt.rtf.json.yaml.yml.xml.toml.lock.gpx.html.htm`.split(`.`)),$c=new Set(`png.jpg.jpeg.gif.webp.avif.apng.heic.heif.tiff.bmp.ico.svg.pdf.mp4.webm.mov.m4v.mkv.mp3.wav.ogg.m4a.flac.aac.opus.json.toml.lock`.split(`.`)),el=`wikiembed`,tl=`toast`,nl=new Set(`png.jpg.jpeg.gif.webp.avif.svg.pdf.mp4.webm.mov.m4v.mkv.mp3.wav.ogg.m4a.flac.aac.opus.docx.xlsx.pptx.doc.xls.ppt.zip.7z.tar.gz.rar.csv.tsv.rtf.json.yaml.yml.xml.txt.pages.numbers.key.odt.ods.odp.epub.mobi`.split(`.`)),rl=[`png`,`jpg`,`jpeg`,`gif`,`webp`,`avif`],il=[`mp4`,`webm`,`mov`,`m4v`],al=[`mp3`,`wav`,`ogg`,`m4a`,`flac`,`aac`,`opus`],ol=[`pdf`],sl=[`json`,`toml`,`lock`];function cl(e,t,n){for(let r of t)if(!n.has(r))throw Error(`${e}: ${r} is not present in canonical upload constants`)}cl(`SIDEBAR_IMAGE_ASSET_EXTENSIONS`,rl,qc),cl(`SIDEBAR_VIDEO_ASSET_EXTENSIONS`,il,Jc),cl(`SIDEBAR_AUDIO_ASSET_EXTENSIONS`,al,Xc),cl(`SIDEBAR_PDF_ASSET_EXTENSIONS`,ol,Yc),cl(`FILE_ATTACHMENT_EXTENSIONS`,[...Zc],nl),cl(`WIKI_EMBED_EXTENSIONS`,[...nl],Qc);var ll=new Set(rl),ul=new Set(il),dl=new Set(al),fl=new Set(ol),pl=new Set(sl);cl(`SIDEBAR_RENDERABLE_ASSET_EXTENSIONS`,[...new Set([...rl,...il,...al,...ol,...sl])],$c);var ml=new Set([`base`,`canvas`]),hl=new Set([`mmd`,`mermaid`]);function gl(e){let t=e.lastIndexOf(`.`);return t<0?!1:hl.has(e.slice(t+1).toLowerCase())}new Set([...Qc,...ml,...hl]);function _l(e){let t=e.toLowerCase().replace(/^\./,``);return ll.has(t)?`image`:ul.has(t)?`video`:dl.has(t)?`audio`:fl.has(t)?`pdf`:pl.has(t)||ml.has(t)?`text`:hl.has(t)?`mermaid`:Vc.has(t)?`text`:null}var vl={bg:`#282a36`,bgElevated:`#343746`,bgSubtle:`#21222c`,fg:`#f8f8f2`,fgMuted:`#9aa0c5`,border:`#44475a`,primary:`#bd93f9`,primaryFg:`#282a36`,red:`#ff5555`,green:`#50fa7b`,yellow:`#f1fa8c`,blue:`#8be9fd`,cyan:`#8be9fd`,orange:`#ffb86c`,purple:`#ff79c6`},yl={bg:`#303446`,bgElevated:`#414559`,bgSubtle:`#292c3c`,fg:`#c6d0f5`,fgMuted:`#a5adce`,border:`#51576d`,primary:`#ca9ee6`,primaryFg:`#303446`,red:`#e78284`,green:`#a6d189`,yellow:`#e5c890`,blue:`#8caaee`,cyan:`#81c8be`,orange:`#ef9f76`,purple:`#ca9ee6`},bl={bg:`#eff1f5`,bgElevated:`#ffffff`,bgSubtle:`#e6e9ef`,fg:`#4c4f69`,fgMuted:`#6c6f85`,border:`#ccd0da`,primary:`#8839ef`,primaryFg:`#ffffff`,red:`#d20f39`,green:`#40a02b`,yellow:`#df8e1d`,blue:`#1e66f5`,cyan:`#179299`,orange:`#fe640b`,purple:`#8839ef`},xl={bg:`#272822`,bgElevated:`#31322b`,bgSubtle:`#1e1f1a`,fg:`#f8f8f2`,fgMuted:`#a6a28c`,border:`#49483e`,primary:`#66d9ef`,primaryFg:`#272822`,red:`#f92672`,green:`#a6e22e`,yellow:`#e6db74`,blue:`#66d9ef`,cyan:`#66d9ef`,orange:`#fd971f`,purple:`#ae81ff`},Sl={bg:`#282828`,bgElevated:`#32302f`,bgSubtle:`#1d2021`,fg:`#ebdbb2`,fgMuted:`#a89984`,border:`#3c3836`,primary:`#83a598`,primaryFg:`#1d2021`,red:`#fb4934`,green:`#b8bb26`,yellow:`#fabd2f`,blue:`#83a598`,cyan:`#8ec07c`,orange:`#fe8019`,purple:`#d3869b`},Cl={bg:`#002b36`,bgElevated:`#073642`,bgSubtle:`#00252e`,fg:`#93a1a1`,fgMuted:`#6a7f86`,border:`#0e4a56`,primary:`#268bd2`,primaryFg:`#fdf6e3`,red:`#dc322f`,green:`#859900`,yellow:`#b58900`,blue:`#268bd2`,cyan:`#2aa198`,orange:`#cb4b16`,purple:`#6c71c4`};function wl(e){return{background:e.bg,foreground:e.fg,card:e.bgElevated,"card-foreground":e.fg,popover:e.bgElevated,"popover-foreground":e.fg,primary:e.primary,"primary-foreground":e.primaryFg,secondary:e.bgElevated,"secondary-foreground":e.fg,muted:e.bgElevated,"muted-foreground":e.fgMuted,accent:e.bgElevated,"accent-foreground":e.fg,destructive:e.red,border:e.border,input:e.border,ring:e.primary,"selection-soft":`oklch(from var(--primary) l c h / 0.3)`,"chart-1":e.primary,"chart-2":e.green,"chart-3":e.yellow,"chart-4":e.purple,"chart-5":e.red,sidebar:e.bgSubtle,"sidebar-foreground":e.fg,"sidebar-primary":e.primary,"sidebar-primary-foreground":e.primaryFg,"sidebar-accent":`oklch(from var(--primary) l c h / 0.14)`,"sidebar-accent-foreground":e.primary,"sidebar-hover":e.bgElevated,"sidebar-border":e.border,"sidebar-ring":e.primary,"syntax-keyword":e.purple,"syntax-tag":e.red,"syntax-attr":e.blue,"syntax-string":e.green,"syntax-number":e.orange,"syntax-atom":e.cyan}}function Tl(e,t,n){return{id:e,label:t,kind:`dark`,base:n,toTokens:()=>wl(n)}}function El(e,t,n){return{id:e,label:t,kind:`light`,base:n,toTokens:()=>wl(n)}}function Dl(e,t){return{id:e,label:t,kind:`system`}}var Ol=[Dl(`default`,`Default`),Tl(`dracula`,`Dracula`,vl),Tl(`catppuccin-frappe`,`Catppuccin Frappé`,yl),El(`catppuccin-latte`,`Catppuccin Latte`,bl),Tl(`monokai`,`Monokai`,xl),Tl(`gruvbox`,`Gruvbox`,Sl),Tl(`solarized`,`Solarized`,Cl),Dl(`custom`,`Custom`)],kl=Ol.map(e=>e.id),Al=new Map(Ol.map(e=>[e.id,e]));function jl(e){return e&&Al.get(e)||Ol[0]}function Ml(e){let t=jl(e).kind;return t===`system`?void 0:t}var Nl=Symbol.for(`@inkeep/open-knowledge/field-registry`),Pl=globalThis;Pl[Nl]===void 0&&(Pl[Nl]=So());var Fl=Pl[Nl];function Il(e){let t=e;for(let e=0;e<16;e++){if(t==null)return;let e=Ll(t)?Fl.get(t):void 0;if(e!==void 0)return e;let n=t._zod?.def?.innerType;if(n===void 0)return;t=n}}function Ll(e){return typeof e==`object`&&!!e&&`_zod`in e&&`parse`in e}var Rl=Object.freeze([`authorization`,`auth.token`,`auth.bearer`,`cookie`,`set-cookie`,`x-api-key`,`password`,`secret`]),zl=52428800,Bl=26214400,Vl=`https://api.openai.com/v1`,Hl=`text-embedding-3-small`;function Ul(e){let t;try{t=new URL(e)}catch{return`invalid-url`}if(t.protocol===`https:`)return null;let n=t.hostname.toLowerCase(),r=n===`localhost`||n===`127.0.0.1`||n===`[::1]`;return t.protocol===`http:`&&r?null:`insecure-scheme`}function Wl(e){let t=e.trim();return t===``?`./`:t}function Gl(e){let t=Wl(e);return t.includes(`\0`)||t.includes(`\\`)?!1:t===`/`?!0:!(t.startsWith(`/`)||/^[A-Za-z]:/.test(t)||t.split(`/`).some(e=>e===`..`))}var Kl=sc({content:sc({dir:k().register(Fl,{scope:`project`,agentSettable:!1,defaultScope:`project`,description:`Folder OpenKnowledge reads and writes documents under, relative to the project root (the folder that contains .ok/). Defaults to the project root. Exclude paths with .okignore.`}).default(`.`),attachmentFolderPath:k().register(Fl,{scope:`project`,agentSettable:!1,defaultScope:`project`,description:`Where pasted and dropped assets are stored, relative to the content root. './' colocates beside the current document (default); '/' targets the content root; './subdir' targets a subfolder under the current document folder; 'folder' targets a fixed folder under the content root. Whitespace-only values are treated as './'.`}).refine(Gl,{message:`Invalid attachment folder path: must not contain '..' segments, NUL bytes, backslashes, or OS absolute paths (use '/' for the content root).`}).default(`./`)}).default({dir:`.`,attachmentFolderPath:`./`}),appearance:sc({theme:P([`light`,`dark`,`system`]).register(Fl,{scope:`user`,agentSettable:!1,defaultScope:`user`,description:`Editor color theme: 'light', 'dark', or 'system' (follow the OS). A personal preference (user scope) — not shared with the project.`}).optional(),colorTheme:P(kl).register(Fl,{scope:`user`,agentSettable:!1,defaultScope:`user`,description:`IDE color palette: 'default' (follows the light/dark theme), one of 'dracula', 'catppuccin-frappe', 'catppuccin-latte', 'monokai', 'gruvbox', 'solarized', or 'custom' (your own colors from appearance.customTheme). A personal preference (user scope) — not shared with the project.`}).optional(),colorThemeEnabled:j().register(Fl,{scope:`user`,agentSettable:!1,defaultScope:`user`,description:`Whether the Themes plugin appears in Settings → Plugins. A personal preference (user scope). Default on.`}).optional(),customTheme:sc({background:k().register(Fl,{scope:`user`,agentSettable:!1,defaultScope:`user`,description:`Custom theme: editor canvas background, as a #rrggbb hex string.`}).optional(),surface:k().register(Fl,{scope:`user`,agentSettable:!1,defaultScope:`user`,description:`Custom theme: elevated surfaces (cards, sidebar, popovers), as a #rrggbb hex string.`}).optional(),foreground:k().register(Fl,{scope:`user`,agentSettable:!1,defaultScope:`user`,description:`Custom theme: primary text color, as a #rrggbb hex string.`}).optional(),primary:k().register(Fl,{scope:`user`,agentSettable:!1,defaultScope:`user`,description:`Custom theme: accent color for buttons, links, and focus, as a #rrggbb hex string.`}).optional(),accent:k().register(Fl,{scope:`user`,agentSettable:!1,defaultScope:`user`,description:`Custom theme: secondary accent (syntax highlights, charts), as a #rrggbb hex string.`}).optional(),border:k().register(Fl,{scope:`user`,agentSettable:!1,defaultScope:`user`,description:`Custom theme: hairline border + input color, as a #rrggbb hex string.`}).optional()}).optional(),preview:sc({autoOpen:j().register(Fl,{scope:`user`,agentSettable:!1,defaultScope:`user`,description:`When on, the agent opens or refreshes the live preview after each edit. Turn off if you manage your own preview window. A personal preference (user scope).`}).default(!0)}).default({autoOpen:!0}),sidebar:sc({showHiddenFiles:j().register(Fl,{scope:`project-local`,agentSettable:!1,defaultScope:`project-local`,description:`Show dot-prefixed entries (e.g. .ok/, .okignore) in the file tree. Per-machine (project-local) — not shared with collaborators.`}).default(!1),showOnlyMarkdownFiles:j().register(Fl,{scope:`project-local`,agentSettable:!1,defaultScope:`project-local`,description:`Show only markdown documents (.md/.mdx) and folders in the file tree, hiding other file types from view. View-only: hidden files stay on disk and remain reachable via links and search. Per-machine (project-local) — not shared with collaborators.`}).default(!1),showSkillsSection:j().register(Fl,{scope:`project-local`,agentSettable:!1,defaultScope:`project-local`,description:`Show the Skills section in the sidebar. Skill documents remain reachable via links and search while the section is hidden. Per-machine (project-local) — not shared with collaborators.`}).default(!0),showOkFolders:j().register(Fl,{scope:`project-local`,agentSettable:!1,defaultScope:`project-local`,description:`Show .ok folders (skills, templates, and other OpenKnowledge-managed state) in the file tree as read-only entries. .ok/worktrees and .ok/local never appear. Per-machine (project-local) — not shared with collaborators.`}).default(!1)}).optional()}).default({preview:{autoOpen:!0}}),editor:sc({wordWrap:j().register(Fl,{scope:`user`,agentSettable:!1,defaultScope:`user`,description:`Soft-wrap long lines in the source (CodeMirror) editor. A personal preference (user scope).`}).default(!0)}).default({wordWrap:!0}),agents:sc({autoApproveOkTools:j().register(Fl,{scope:`user`,agentSettable:!1,defaultScope:`user`,description:"Auto-approve OpenKnowledge's own tools (and `ok open` on Claude) for agents launched from the built-in terminal. Destructive tools (delete/move/share/install) still prompt. Per-machine personal preference (user scope)."}).default(!0)}).default({autoApproveOkTools:!0}),autoSync:sc({enabled:j().register(Fl,{scope:`project-local`,agentSettable:!1,defaultScope:`project-local`,description:`Whether this machine auto-pulls and auto-pushes git commits for this project. null = not chosen yet (onboarding asks). Per-machine (project-local) — not shared.`}).nullable().default(null),default:j().register(Fl,{scope:`project`,agentSettable:!1,defaultScope:`project`,description:`Committed project default for a machine's autoSync.enabled on first open: true = auto-sync on, false = off, null = ask (show the onboarding prompt). Shared via git. A per-machine autoSync.enabled choice overrides it.`}).nullable().default(null)}).default({enabled:null,default:null}),terminal:sc({enabled:j().register(Fl,{scope:`project-local`,agentSettable:!1,defaultScope:`project-local`,description:`Opt-out for the in-app terminal (a real OS shell at full user privilege). The terminal is on by default; set false to disable it for this project on this machine. Per-machine (project-local) — never shared via git, clone, or sync.`}).nullable().default(null)}).default({enabled:null}),telemetry:sc({localSink:sc({enabled:j().register(Fl,{scope:`project`,agentSettable:!1,defaultScope:`project`,description:"Write local diagnostic spans + logs under .ok/local/ for `ok diagnose bundle`. Local-only — never leaves the machine until you run bundle. Set false for sensitive workspaces. Shared across collaborators."}).default(!0),spans:sc({maxBytes:A().register(Fl,{scope:`project`,agentSettable:!1,defaultScope:`project`,description:`Maximum size, in bytes, of the local diagnostic spans file before it rotates (default ~50 MB).`}).default(zl)}).default({maxBytes:zl}),logs:sc({maxBytes:A().register(Fl,{scope:`project`,agentSettable:!1,defaultScope:`project`,description:`Maximum size, in bytes, of the local diagnostic logs file before it rotates (default ~25 MB).`}).default(Bl)}).default({maxBytes:Bl}),attributeDenylist:M(k()).register(Fl,{scope:`project`,agentSettable:!1,defaultScope:`project`,description:`Telemetry attribute keys whose values are redacted before any local span/log is written (credential / secret guard). Extends the built-in denylist.`}).default([...Rl])}).default({enabled:!0,spans:{maxBytes:zl},logs:{maxBytes:Bl},attributeDenylist:[...Rl]})}).default({localSink:{enabled:!0,spans:{maxBytes:zl},logs:{maxBytes:Bl},attributeDenylist:[...Rl]}}),search:sc({semantic:sc({enabled:j().register(Fl,{scope:`project-local`,agentSettable:!1,defaultScope:`project-local`,description:"Add semantic (embeddings) ranking to the MCP search tool, fused with the lexical engine so conceptually-related pages surface even with no shared keywords. When ON and an API key is set (`ok embeddings set-key`), the search query and matching document content are sent to the configured embeddings provider — content egress. Default OFF. Per-machine (project-local) — not shared with collaborators."}).default(!1),baseUrl:k().register(Fl,{scope:`project-local`,agentSettable:!1,defaultScope:`project-local`,description:"Base URL of the OpenAI-compatible embeddings API (default https://api.openai.com/v1). Override for Azure / self-hosted / other providers. The API key is NOT stored here — set it with `ok embeddings set-key` (OS keyring)."}).default(Vl),model:k().register(Fl,{scope:`project-local`,agentSettable:!1,defaultScope:`project-local`,description:`Embeddings model id (default text-embedding-3-small). Must be served by the provider at baseUrl. Changing it re-embeds the corpus (the cache is keyed by provider + model + dimensions).`}).default(Hl),dimensions:A().int().positive().register(Fl,{scope:`project-local`,agentSettable:!1,defaultScope:`project-local`,description:`Optional output vector dimensions. Omit to use the model's native size (1536 for text-embedding-3-small). Set a smaller value (text-embedding-3 supports e.g. 512 / 1024) to shrink the on-disk cache, trading a little retrieval quality. Changing it re-embeds the corpus.`}).optional(),similarityFloor:A().min(0).max(1).register(Fl,{scope:`project-local`,agentSettable:!1,defaultScope:`project-local`,description:`Optional hard cutoff: drop any "by meaning" match whose cosine similarity is below this value. Off by default (0) because retrieval is rank-based (the closest pages are returned regardless of absolute score) and the right cutoff is model-specific. Set it only to suppress weak matches for a specific provider/model whose cosine scale you know. Most setups should leave it unset and rely on the result-count cap.`}).optional()}).default({enabled:!1,baseUrl:Vl,model:Hl})}).default({semantic:{enabled:!1,baseUrl:Vl,model:Hl}}),contentRules:sc({markdownlint:N({enabled:j().register(Fl,{scope:`project`,agentSettable:!1,defaultScope:`project`,description:`Whether the markdownlint plugin (body rules) contributes diagnostics.`}).default(!1)}).default({enabled:!1})}).default({markdownlint:{enabled:!1}}),linkPreviews:sc({enabled:j().register(Fl,{scope:`project-local`,agentSettable:!1,defaultScope:`project-local`,description:`Show a rich preview card (site name, page title, description, favicon) when you hover an external link in the editor. When ON, hovering an external link sends that link's URL to the destination site to fetch its preview metadata — outbound egress, one request per previewed link. Default ON; set to false to turn external previews off. Per-machine (project-local) — not shared with collaborators. Previews of links to other documents in this project are read from the local index with no network request and are always on.`}).default(!0)}).default({enabled:!0})}),ql=`open-knowledge-config`;function Jl(e,t,n){let r=o.getTracer(ql),i=t?{attributes:t}:{};return r.startActiveSpan(e,i,e=>{try{return n(e)}catch(t){throw e.recordException(t),e.setStatus({code:a.ERROR,message:t instanceof Error?t.message:String(t)}),t}finally{e.end()}})}function Yl(e,t){let n=o.getActiveSpan();n&&n.addEvent(e,t)}function Xl(e){let t=e;for(let e=0;e<16;e++){if(t==null||t?._zod?.def?.shape!==void 0)return t;let e=t?._zod?.def?.innerType;if(e===void 0)return t;t=e}return t}function Zl(e,t){let n=e;for(let e of t){n=Xl(n);let t=n?._zod?.def?.shape;if(!t||(n=t[String(e)],n===void 0))return}return n}function Ql(e,t){let n=Zl(e,t);if(n!==void 0)return Il(n)}function $l(e,t){return e===`either`?!0:e===t}function eu(e,t){let n=null;function r(e,i){if(n!==null||e===void 0)return;if(typeof e==`object`&&e&&!Array.isArray(e)){for(let[t,a]of Object.entries(e))if(r(a,[...i,t]),n!==null)return;return}let a=Ql(Kl,i);a?.scope!==void 0&&($l(a.scope,t)||(n={code:`SCOPE_VIOLATION`,path:i,expectedScope:a.scope,actualScope:t}))}for(let[t,i]of Object.entries(e))if(r(i,[t]),n!==null)break;return n}function tu(e,t){for(let n=1;n<t.length;n++){let r=t.slice(0,n);e.hasIn(r)&&(w(e.getIn(r,!0))||e.deleteIn(r))}}function nu(e,t){let n=[];function r(t,i){if(t!==void 0){if(t===null){e.deleteIn(i),n.push(i.join(`.`));return}if(Array.isArray(t)){tu(e,i),e.setIn(i,t),n.push(i.join(`.`));return}if(typeof t==`object`){for(let[e,n]of Object.entries(t))r(n,[...i,e]);return}tu(e,i),e.setIn(i,t),n.push(i.join(`.`))}}for(let[e,n]of Object.entries(t))r(n,[e]);return n}function ru(e){return{path:e.path.map(e=>typeof e==`symbol`?String(e):e),message:e.message,issueCode:e.code}}var iu=N({file:k(),line:A().int().min(1),column:A().int().min(1),snippet:k().optional()}),au=N({path:M(lc([k(),A()])),message:k(),issueCode:k(),params:dc(k(),ac()).optional(),source:iu.optional()}),ou=P([`user`,`project`,`project-local`,`either`]),su=P([`user`,`project`,`project-local`]),cu=uc(`code`,[N({code:F(`YAML_PARSE`),detail:k()}),N({code:F(`SCHEMA_INVALID`),issues:M(au)}),N({code:F(`SCOPE_VIOLATION`),path:M(k()),expectedScope:ou,actualScope:su}),N({code:F(`NOT_AGENT_SETTABLE`),path:M(k())}),N({code:F(`MIXED_SCOPE`),paths:M(N({path:M(k()),scope:su}))}),N({code:F(`REMOVED_KEY`),path:M(k()),redirect:k(),source:iu.optional()}),N({code:F(`WRITE_ERROR`),detail:k()}),N({code:F(`OKIGNORE_INVALID`),detail:k(),lineNumber:A().int().min(1).optional()}),N({code:F(`UNKNOWN`),message:k().optional()})]),lu=new Set(cu.options.map(e=>e.shape.code.value)),uu=lc([cu,sc({code:k(),message:k().optional()})]);function du(e){return lu.has(e.code)}function fu(e){switch(e){case`user`:return`~/.ok/global.yml`;case`project`:return`.ok/config.yml`;case`project-local`:return`.ok/local/config.yml`;case`either`:return`.ok/config.yml or ~/.ok/global.yml`}}function pu(e){switch(e){case`user`:return`personal to you, across all projects`;case`project`:return`shared with your team via git`;case`project-local`:return`this machine only, not shared`;case`either`:return`user or project`}}function mu(e){if(!du(e))return e.message??`Unknown error (${e.code}).`;switch(e.code){case`YAML_PARSE`:return`Failed to parse YAML: ${e.detail}`;case`SCHEMA_INVALID`:{if(e.issues.length===0)return`Invalid configuration.`;let t=new Map;for(let n of e.issues){let e=n.source?.file??`<no source>`,r=t.get(e)??[];r.push(n),t.set(e,r)}let n=[];for(let[e,r]of t){e===`<no source>`?n.push(`Invalid configuration:`):n.push(`Invalid configuration at ${e}:`);for(let t of r){let r=t.path.length===0?`<root>`:t.path.join(`.`);if(t.source){if(n.push(` ${e}:${t.source.line}:${t.source.column}`),n.push(` ${r}: ${t.message}`),t.source.snippet&&t.source.snippet.length>0)for(let e of t.source.snippet.split(`
|
|
147
147
|
`))n.push(` ${e}`)}else n.push(` ${r}: ${t.message}`)}}return n.join(`
|
|
148
148
|
`)}case`SCOPE_VIOLATION`:return[`Setting ${e.path.join(`.`)} belongs in your ${e.expectedScope} config`,`(${fu(e.expectedScope)} — ${pu(e.expectedScope)}),`,`but it was set in the ${e.actualScope} config (${fu(e.actualScope)}).`,`Move it to ${fu(e.expectedScope)}.`].join(` `);case`NOT_AGENT_SETTABLE`:return[`Setting ${e.path.join(`.`)} is human-only and can't be changed by an agent.`,`Change it in the Settings pane, or edit the config.yml by hand.`].join(` `);case`MIXED_SCOPE`:return[`This change touches settings that live in different config files. Apply them one file at a time:`,e.paths.map(({path:e,scope:t})=>` ${e.join(`.`)} → ${fu(t)} (${t})`).join(`
|
|
149
149
|
`)].join(`
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{M as e,N as t,j as n}from"./CodeMirrorPropInput-
|
|
1
|
+
import{M as e,N as t,j as n}from"./CodeMirrorPropInput-cmSiPzan.js";import{$ as r,At as i,Bt as a,Dt as o,E as s,Et as c,Ft as l,Ht as u,J as d,Mt as f,N as p,Ot as m,Pt as h,Q as ee,Rt as te,Ut as ne,X as g,_ as re,_t as _,ct as ie,dt as ae,et as oe,f as se,gt as ce,ht as le,l as ue,lt as de,mt as fe,nt as pe,ot as me,rt as v,st as he,tt as ge,ut as _e,wt as y,y as ve,yt as b,zt as ye}from"./dist-CdtMC9tO.js";import{i as be,n as xe,o as Se,r as Ce}from"./dist-zn0VptDw.js";var we=typeof String.prototype.normalize==`function`?e=>e.normalize(`NFKD`):e=>e,x=class{constructor(e,t,n=0,r=e.length,i,a){this.test=a,this.value={from:0,to:0},this.done=!1,this.matches=[],this.buffer=``,this.bufferPos=0,this.iter=e.iterRange(n,r),this.bufferStart=n,this.normalize=i?e=>i(we(e)):we,this.query=this.normalize(t)}peek(){if(this.bufferPos==this.buffer.length){if(this.bufferStart+=this.buffer.length,this.iter.next(),this.iter.done)return-1;this.bufferPos=0,this.buffer=this.iter.value}return te(this.buffer,this.bufferPos)}next(){for(;this.matches.length;)this.matches.pop();return this.nextOverlapping()}nextOverlapping(){for(;;){let e=this.peek();if(e<0)return this.done=!0,this;let t=ne(e),n=this.bufferStart+this.bufferPos;this.bufferPos+=ye(e);let r=this.normalize(t);if(r.length)for(let e=0,i=n;;e++){let a=r.charCodeAt(e),o=this.match(a,i,this.bufferPos+this.bufferStart);if(e==r.length-1){if(o)return this.value=o,this;break}i==n&&e<t.length&&t.charCodeAt(e)==a&&i++}}}match(e,t,n){let r=null;for(let t=0;t<this.matches.length;t+=2){let i=this.matches[t],a=!1;this.query.charCodeAt(i)==e&&(i==this.query.length-1?r={from:this.matches[t+1],to:n}:(this.matches[t]++,a=!0)),a||(this.matches.splice(t,2),t-=2)}return this.query.charCodeAt(0)==e&&(this.query.length==1?r={from:t,to:n}:this.matches.push(1,t)),r&&this.test&&!this.test(r.from,r.to,this.buffer,this.bufferStart)&&(r=null),r}};typeof Symbol<`u`&&(x.prototype[Symbol.iterator]=function(){return this});var Te={from:-1,to:-1,match:/.*/.exec(``)},S=`gm`+(/x/.unicode==null?``:`u`),Ee=class{constructor(e,t,n,r=0,i=e.length){if(this.text=e,this.to=i,this.curLine=``,this.done=!1,this.value=Te,/\\[sWDnr]|\n|\r|\[\^/.test(t))return new De(e,t,n,r,i);this.re=new RegExp(t,S+(n?.ignoreCase?`i`:``)),this.test=n?.test,this.iter=e.iter(),this.curLineStart=e.lineAt(r).from,this.matchPos=T(e,r),this.getLine(this.curLineStart)}getLine(e){this.iter.next(e),this.iter.lineBreak?this.curLine=``:(this.curLine=this.iter.value,this.curLineStart+this.curLine.length>this.to&&(this.curLine=this.curLine.slice(0,this.to-this.curLineStart)),this.iter.next())}nextLine(){this.curLineStart=this.curLineStart+this.curLine.length+1,this.curLineStart>this.to?this.curLine=``:this.getLine(0)}next(){for(let e=this.matchPos-this.curLineStart;;){this.re.lastIndex=e;let t=this.matchPos<=this.to&&this.re.exec(this.curLine);if(t){let n=this.curLineStart+t.index,r=n+t[0].length;if(this.matchPos=T(this.text,r+ +(n==r)),n==this.curLineStart+this.curLine.length&&this.nextLine(),(n<r||n>this.value.to)&&(!this.test||this.test(n,r,t)))return this.value={from:n,to:r,match:t},this;e=this.matchPos-this.curLineStart}else if(this.curLineStart+this.curLine.length<this.to)this.nextLine(),e=0;else return this.done=!0,this}}},C=new WeakMap,w=class e{constructor(e,t){this.from=e,this.text=t}get to(){return this.from+this.text.length}static get(t,n,r){let i=C.get(t);if(!i||i.from>=r||i.to<=n){let i=new e(n,t.sliceString(n,r));return C.set(t,i),i}if(i.from==n&&i.to==r)return i;let{text:a,from:o}=i;return o>n&&(a=t.sliceString(n,o)+a,o=n),i.to<r&&(a+=t.sliceString(i.to,r)),C.set(t,new e(o,a)),new e(n,a.slice(n-o,r-o))}},De=class{constructor(e,t,n,r,i){this.text=e,this.to=i,this.done=!1,this.value=Te,this.matchPos=T(e,r),this.re=new RegExp(t,S+(n?.ignoreCase?`i`:``)),this.test=n?.test,this.flat=w.get(e,r,this.chunkEnd(r+5e3))}chunkEnd(e){return e>=this.to?this.to:this.text.lineAt(e).to}next(){for(;;){let e=this.re.lastIndex=this.matchPos-this.flat.from,t=this.re.exec(this.flat.text);if(t&&!t[0]&&t.index==e&&(this.re.lastIndex=e+1,t=this.re.exec(this.flat.text)),t){let e=this.flat.from+t.index,n=e+t[0].length;if((this.flat.to>=this.to||t.index+t[0].length<=this.flat.text.length-10)&&(!this.test||this.test(e,n,t)))return this.value={from:e,to:n,match:t},this.matchPos=T(this.text,n+ +(e==n)),this}if(this.flat.to==this.to)return this.done=!0,this;this.flat=w.get(this.text,this.flat.from,this.chunkEnd(this.flat.from+this.flat.text.length*2))}}};typeof Symbol<`u`&&(Ee.prototype[Symbol.iterator]=De.prototype[Symbol.iterator]=function(){return this});function Oe(e){try{return new RegExp(e,S),!0}catch{return!1}}function T(e,t){if(t>=e.length)return t;let n=e.lineAt(t),r;for(;t<n.to&&(r=n.text.charCodeAt(t-n.from))>=56320&&r<57344;)t++;return t}var ke=e=>{let{state:t}=e,n=String(t.doc.lineAt(e.state.selection.main.head).number),{close:r,result:i}=ce(e,{label:t.phrase(`Go to line`),input:{type:`text`,name:`line`,value:n},focus:!0,submitLabel:t.phrase(`go`)});return i.then(n=>{let i=n&&/^([+-])?(\d+)?(:\d+)?(%)?$/.exec(n.elements.line.value);if(!i){e.dispatch({effects:r});return}let a=t.doc.lineAt(t.selection.main.head),[,o,s,l,u]=i,d=l?+l.slice(1):0,f=s?+s:a.number;if(s&&u){let e=f/100;o&&(e=e*(o==`-`?-1:1)+a.number/t.doc.lines),f=Math.round(t.doc.lines*e)}else s&&o&&(f=f*(o==`-`?-1:1)+a.number);let p=t.doc.line(Math.max(1,Math.min(t.doc.lines,f))),m=c.cursor(p.from+Math.max(0,Math.min(d,p.length)));e.dispatch({effects:[r,g.scrollIntoView(m.from,{y:`center`})],selection:m})}),!0},Ae={highlightWordAroundCursor:!1,minSelectionLength:1,maxMatches:100,wholeWords:!1},E=m.define({combine(e){return a(e,Ae,{highlightWordAroundCursor:(e,t)=>e||t,minSelectionLength:Math.min,maxMatches:Math.min})}});function je(e){let t=[Le,Ie];return e&&t.push(E.of(e)),t}var Me=d.mark({class:`cm-selectionMatch`}),Ne=d.mark({class:`cm-selectionMatch cm-selectionMatch-main`});function Pe(e,t,n,r){return(n==0||e(t.sliceDoc(n-1,n))!=y.Word)&&(r==t.doc.length||e(t.sliceDoc(r,r+1))!=y.Word)}function Fe(e,t,n,r){return e(t.sliceDoc(n,n+1))==y.Word&&e(t.sliceDoc(r-1,r))==y.Word}var Ie=ee.fromClass(class{constructor(e){this.decorations=this.getDeco(e)}update(e){(e.selectionSet||e.docChanged||e.viewportChanged)&&(this.decorations=this.getDeco(e.view))}getDeco(e){let t=e.state.facet(E),{state:n}=e,r=n.selection;if(r.ranges.length>1)return d.none;let i=r.main,a,o=null;if(i.empty){if(!t.highlightWordAroundCursor)return d.none;let e=n.wordAt(i.head);if(!e)return d.none;o=n.charCategorizer(i.head),a=n.sliceDoc(e.from,e.to)}else{let e=i.to-i.from;if(e<t.minSelectionLength||e>200)return d.none;if(t.wholeWords){if(a=n.sliceDoc(i.from,i.to),o=n.charCategorizer(i.head),!(Pe(o,n,i.from,i.to)&&Fe(o,n,i.from,i.to)))return d.none}else if(a=n.sliceDoc(i.from,i.to),!a)return d.none}let s=[];for(let r of e.visibleRanges){let e=new x(n.doc,a,r.from,r.to);for(;!e.next().done;){let{from:r,to:a}=e.value;if((!o||Pe(o,n,r,a))&&(i.empty&&r<=i.from&&a>=i.to?s.push(Ne.range(r,a)):(r>=i.to||a<=i.from)&&s.push(Me.range(r,a)),s.length>t.maxMatches))return d.none}}return d.set(s)}},{decorations:e=>e.decorations}),Le=g.baseTheme({".cm-selectionMatch":{backgroundColor:`#99ff7780`},".cm-searchMatch .cm-selectionMatch":{backgroundColor:`transparent`}}),Re=({state:e,dispatch:t})=>{let{selection:n}=e,r=c.create(n.ranges.map(t=>e.wordAt(t.head)||c.cursor(t.head)),n.mainIndex);return r.eq(n)?!1:(t(e.update({selection:r})),!0)};function ze(e,t){let{main:n,ranges:r}=e.selection,i=e.wordAt(n.head),a=i&&i.from==n.from&&i.to==n.to;for(let n=!1,i=new x(e.doc,t,r[r.length-1].to);;)if(i.next(),i.done){if(n)return null;i=new x(e.doc,t,0,Math.max(0,r[r.length-1].from-1)),n=!0}else{if(n&&r.some(e=>e.from==i.value.from))continue;if(a){let t=e.wordAt(i.value.from);if(!t||t.from!=i.value.from||t.to!=i.value.to)continue}return i.value}}var Be=({state:e,dispatch:t})=>{let{ranges:n}=e.selection;if(n.some(e=>e.from===e.to))return Re({state:e,dispatch:t});let r=e.sliceDoc(n[0].from,n[0].to);if(e.selection.ranges.some(t=>e.sliceDoc(t.from,t.to)!=r))return!1;let i=ze(e,r);return i?(t(e.update({selection:e.selection.addRange(c.range(i.from,i.to),!1),effects:g.scrollIntoView(i.to)})),!0):!1},D=m.define({combine(e){return a(e,{top:!1,caseSensitive:!1,literal:!1,regexp:!1,wholeWord:!1,createPanel:e=>new ct(e),scrollToMatch:e=>g.scrollIntoView(e)})}});function Ve(e){return e?[D.of(e),G]:G}var He=class{constructor(e){this.search=e.search,this.caseSensitive=!!e.caseSensitive,this.literal=!!e.literal,this.regexp=!!e.regexp,this.replace=e.replace||``,this.valid=!!this.search&&(!this.regexp||Oe(this.search)),this.unquoted=this.unquote(this.search),this.wholeWord=!!e.wholeWord,this.test=e.test}unquote(e){return this.literal?e:e.replace(/\\([nrt\\])/g,(e,t)=>t==`n`?`
|
|
2
2
|
`:t==`r`?`\r`:t==`t`?` `:`\\`)}eq(e){return this.search==e.search&&this.replace==e.replace&&this.caseSensitive==e.caseSensitive&&this.regexp==e.regexp&&this.wholeWord==e.wholeWord&&this.test==e.test}create(){return this.regexp?new Ye(this):new Ke(this)}getCursor(e,t=0,n){let r=e.doc?e:o.create({doc:e});return n??=r.doc.length,this.regexp?k(this,r,t,n):O(this,r,t,n)}},Ue=class{constructor(e){this.spec=e}};function We(e,t,n){return(r,i,a,o)=>n&&!n(r,i,a,o)?!1:e(r>=o&&i<=o+a.length?a.slice(r-o,i-o):t.doc.sliceString(r,i),t,r,i)}function O(e,t,n,r){let i;return e.wholeWord&&(i=Ge(t.doc,t.charCategorizer(t.selection.main.head))),e.test&&(i=We(e.test,t,i)),new x(t.doc,e.unquoted,n,r,e.caseSensitive?void 0:e=>e.toLowerCase(),i)}function Ge(e,t){return(n,r,i,a)=>((a>n||a+i.length<r)&&(a=Math.max(0,n-2),i=e.sliceString(a,Math.min(e.length,r+2))),(t(A(i,n-a))!=y.Word||t(j(i,n-a))!=y.Word)&&(t(j(i,r-a))!=y.Word||t(A(i,r-a))!=y.Word))}var Ke=class extends Ue{constructor(e){super(e)}nextMatch(e,t,n){let r=O(this.spec,e,n,e.doc.length).nextOverlapping();if(r.done){let n=Math.min(e.doc.length,t+this.spec.unquoted.length);r=O(this.spec,e,0,n).nextOverlapping()}return r.done||r.value.from==t&&r.value.to==n?null:r.value}prevMatchInRange(e,t,n){for(let r=n;;){let n=Math.max(t,r-1e4-this.spec.unquoted.length),i=O(this.spec,e,n,r),a=null;for(;!i.nextOverlapping().done;)a=i.value;if(a)return a;if(n==t)return null;r-=1e4}}prevMatch(e,t,n){let r=this.prevMatchInRange(e,0,t);return r||=this.prevMatchInRange(e,Math.max(0,n-this.spec.unquoted.length),e.doc.length),r&&(r.from!=t||r.to!=n)?r:null}getReplacement(e){return this.spec.unquote(this.spec.replace)}matchAll(e,t){let n=O(this.spec,e,0,e.doc.length),r=[];for(;!n.next().done;){if(r.length>=t)return null;r.push(n.value)}return r}highlight(e,t,n,r){let i=O(this.spec,e,Math.max(0,t-this.spec.unquoted.length),Math.min(n+this.spec.unquoted.length,e.doc.length));for(;!i.next().done;)r(i.value.from,i.value.to)}};function qe(e,t,n){return(r,i,a)=>(!n||n(r,i,a))&&e(a[0],t,r,i)}function k(e,t,n,r){let i;return e.wholeWord&&(i=Je(t.charCategorizer(t.selection.main.head))),e.test&&(i=qe(e.test,t,i)),new Ee(t.doc,e.search,{ignoreCase:!e.caseSensitive,test:i},n,r)}function A(e,t){return e.slice(u(e,t,!1),t)}function j(e,t){return e.slice(t,u(e,t))}function Je(e){return(t,n,r)=>!r[0].length||(e(A(r.input,r.index))!=y.Word||e(j(r.input,r.index))!=y.Word)&&(e(j(r.input,r.index+r[0].length))!=y.Word||e(A(r.input,r.index+r[0].length))!=y.Word)}var Ye=class extends Ue{nextMatch(e,t,n){let r=k(this.spec,e,n,e.doc.length).next();return r.done&&(r=k(this.spec,e,0,t).next()),r.done?null:r.value}prevMatchInRange(e,t,n){for(let r=1;;r++){let i=Math.max(t,n-r*1e4),a=k(this.spec,e,i,n),o=null;for(;!a.next().done;)o=a.value;if(o&&(i==t||o.from>i+10))return o;if(i==t)return null}}prevMatch(e,t,n){return this.prevMatchInRange(e,0,t)||this.prevMatchInRange(e,n,e.doc.length)}getReplacement(e){return this.spec.unquote(this.spec.replace).replace(/\$([$&]|\d+)/g,(t,n)=>{if(n==`&`)return e.match[0];if(n==`$`)return`$`;for(let t=n.length;t>0;t--){let r=+n.slice(0,t);if(r>0&&r<e.match.length)return e.match[r]+n.slice(t)}return t})}matchAll(e,t){let n=k(this.spec,e,0,e.doc.length),r=[];for(;!n.next().done;){if(r.length>=t)return null;r.push(n.value)}return r}highlight(e,t,n,r){let i=k(this.spec,e,Math.max(0,t-250),Math.min(n+250,e.doc.length));for(;!i.next().done;)r(i.value.from,i.value.to)}},M=h.define(),N=h.define(),P=l.define({create(e){return new F(B(e).create(),null)},update(e,t){for(let n of t.effects)n.is(M)?e=new F(n.value.create(),e.panel):n.is(N)&&(e=new F(e.query,n.value?z:null));return e},provide:e=>_.from(e,e=>e.panel)}),F=class{constructor(e,t){this.query=e,this.panel=t}},Xe=d.mark({class:`cm-searchMatch`}),Ze=d.mark({class:`cm-searchMatch cm-searchMatch-selected`}),Qe=ee.fromClass(class{constructor(e){this.view=e,this.decorations=this.highlight(e.state.field(P))}update(e){let t=e.state.field(P);(t!=e.startState.field(P)||e.docChanged||e.selectionSet||e.viewportChanged)&&(this.decorations=this.highlight(t))}highlight({query:e,panel:t}){if(!t||!e.spec.valid)return d.none;let{view:n}=this,r=new f;for(let t=0,i=n.visibleRanges,a=i.length;t<a;t++){let{from:o,to:s}=i[t];for(;t<a-1&&s>i[t+1].from-500;)s=i[++t].to;e.highlight(n.state,o,s,(e,t)=>{let i=n.state.selection.ranges.some(n=>n.from==e&&n.to==t);r.add(e,t,i?Ze:Xe)})}return r.finish()}},{decorations:e=>e.decorations});function I(e){return t=>{let n=t.state.field(P,!1);return n&&n.query.spec.valid?e(t,n):at(t)}}var L=I((e,{query:t})=>{let{to:n}=e.state.selection.main,r=t.nextMatch(e.state,n,n);if(!r)return!1;let i=c.single(r.from,r.to),a=e.state.facet(D);return e.dispatch({selection:i,effects:[W(e,r),a.scrollToMatch(i.main,e)],userEvent:`select.search`}),it(e),!0}),R=I((e,{query:t})=>{let{state:n}=e,{from:r}=n.selection.main,i=t.prevMatch(n,r,r);if(!i)return!1;let a=c.single(i.from,i.to),o=e.state.facet(D);return e.dispatch({selection:a,effects:[W(e,i),o.scrollToMatch(a.main,e)],userEvent:`select.search`}),it(e),!0}),$e=I((e,{query:t})=>{let n=t.matchAll(e.state,1e3);return!n||!n.length?!1:(e.dispatch({selection:c.create(n.map(e=>c.range(e.from,e.to))),userEvent:`select.search.matches`}),!0)}),et=({state:e,dispatch:t})=>{let n=e.selection;if(n.ranges.length>1||n.main.empty)return!1;let{from:r,to:i}=n.main,a=[],o=0;for(let t=new x(e.doc,e.sliceDoc(r,i));!t.next().done;){if(a.length>1e3)return!1;t.value.from==r&&(o=a.length),a.push(c.range(t.value.from,t.value.to))}return t(e.update({selection:c.create(a,o),userEvent:`select.search.matches`})),!0},tt=I((e,{query:t})=>{let{state:n}=e,{from:r,to:i}=n.selection.main;if(n.readOnly)return!1;let a=t.nextMatch(n,r,r);if(!a)return!1;let o=a,s=[],l,u,d=[];o.from==r&&o.to==i&&(u=n.toText(t.getReplacement(o)),s.push({from:o.from,to:o.to,insert:u}),o=t.nextMatch(n,o.from,o.to),d.push(g.announce.of(n.phrase(`replaced match on line $`,n.doc.lineAt(r).number)+`.`)));let f=e.state.changes(s);return o&&(l=c.single(o.from,o.to).map(f),d.push(W(e,o)),d.push(n.facet(D).scrollToMatch(l.main,e))),e.dispatch({changes:f,selection:l,effects:d,userEvent:`input.replace`}),!0}),nt=I((e,{query:t})=>{if(e.state.readOnly)return!1;let n=t.matchAll(e.state,1e9).map(e=>{let{from:n,to:r}=e;return{from:n,to:r,insert:t.getReplacement(e)}});if(!n.length)return!1;let r=e.state.phrase(`replaced $ matches`,n.length)+`.`;return e.dispatch({changes:n,effects:g.announce.of(r),userEvent:`input.replace.all`}),!0});function z(e){return e.state.facet(D).createPanel(e)}function B(e,t){let n=e.selection.main,r=n.empty||n.to>n.from+100?``:e.sliceDoc(n.from,n.to);if(t&&!r)return t;let i=e.facet(D);return new He({search:t?.literal??i.literal?r:r.replace(/\n/g,`\\n`),caseSensitive:t?.caseSensitive??i.caseSensitive,literal:t?.literal??i.literal,regexp:t?.regexp??i.regexp,wholeWord:t?.wholeWord??i.wholeWord})}function rt(e){let t=v(e,z);return t&&t.dom.querySelector(`[main-field]`)}function it(e){let t=rt(e);t&&t==e.root.activeElement&&t.select()}var at=e=>{let t=e.state.field(P,!1);if(t&&t.panel){let n=rt(e);if(n&&n!=e.root.activeElement){let r=B(e.state,t.query.spec);r.valid&&e.dispatch({effects:M.of(r)}),n.focus(),n.select()}}else e.dispatch({effects:[N.of(!0),t?M.of(B(e.state,t.query.spec)):h.appendConfig.of(G)]});return!0},ot=e=>{let t=e.state.field(P,!1);if(!t||!t.panel)return!1;let n=v(e,z);return n&&n.dom.contains(e.root.activeElement)&&e.focus(),e.dispatch({effects:N.of(!1)}),!0},st=[{key:`Mod-f`,run:at,scope:`editor search-panel`},{key:`F3`,run:L,shift:R,scope:`editor search-panel`,preventDefault:!0},{key:`Mod-g`,run:L,shift:R,scope:`editor search-panel`,preventDefault:!0},{key:`Escape`,run:ot,scope:`editor search-panel`},{key:`Mod-Shift-l`,run:et},{key:`Mod-Alt-g`,run:ke},{key:`Mod-d`,run:Be,preventDefault:!0}],ct=class{constructor(e){this.view=e;let t=this.query=e.state.field(P).query.spec;this.commit=this.commit.bind(this),this.searchField=b(`input`,{value:t.search,placeholder:V(e,`Find`),"aria-label":V(e,`Find`),class:`cm-textfield`,name:`search`,form:``,"main-field":`true`,onchange:this.commit,onkeyup:this.commit}),this.replaceField=b(`input`,{value:t.replace,placeholder:V(e,`Replace`),"aria-label":V(e,`Replace`),class:`cm-textfield`,name:`replace`,form:``,onchange:this.commit,onkeyup:this.commit}),this.caseField=b(`input`,{type:`checkbox`,name:`case`,form:``,checked:t.caseSensitive,onchange:this.commit}),this.reField=b(`input`,{type:`checkbox`,name:`re`,form:``,checked:t.regexp,onchange:this.commit}),this.wordField=b(`input`,{type:`checkbox`,name:`word`,form:``,checked:t.wholeWord,onchange:this.commit});function n(e,t,n){return b(`button`,{class:`cm-button`,name:e,onclick:t,type:`button`},n)}this.dom=b(`div`,{onkeydown:e=>this.keydown(e),class:`cm-search`},[this.searchField,n(`next`,()=>L(e),[V(e,`next`)]),n(`prev`,()=>R(e),[V(e,`previous`)]),n(`select`,()=>$e(e),[V(e,`all`)]),b(`label`,null,[this.caseField,V(e,`match case`)]),b(`label`,null,[this.reField,V(e,`regexp`)]),b(`label`,null,[this.wordField,V(e,`by word`)]),...e.state.readOnly?[]:[b(`br`),this.replaceField,n(`replace`,()=>tt(e),[V(e,`replace`)]),n(`replaceAll`,()=>nt(e),[V(e,`replace all`)])],b(`button`,{name:`close`,onclick:()=>ot(e),"aria-label":V(e,`close`),type:`button`},[`×`])])}commit(){let e=new He({search:this.searchField.value,caseSensitive:this.caseField.checked,regexp:this.reField.checked,wholeWord:this.wordField.checked,replace:this.replaceField.value});e.eq(this.query)||(this.query=e,this.view.dispatch({effects:M.of(e)}))}keydown(e){le(this.view,e,`search-panel`)?e.preventDefault():e.keyCode==13&&e.target==this.searchField?(e.preventDefault(),(e.shiftKey?R:L)(this.view)):e.keyCode==13&&e.target==this.replaceField&&(e.preventDefault(),tt(this.view))}update(e){for(let t of e.transactions)for(let e of t.effects)e.is(M)&&!e.value.eq(this.query)&&this.setQuery(e.value)}setQuery(e){this.query=e,this.searchField.value=e.search,this.replaceField.value=e.replace,this.caseField.checked=e.caseSensitive,this.reField.checked=e.regexp,this.wordField.checked=e.wholeWord}mount(){this.searchField.select()}get pos(){return 80}get top(){return this.view.state.facet(D).top}};function V(e,t){return e.state.phrase(t)}var H=30,U=/[\s\.,:;?!]/;function W(e,{from:t,to:n}){let r=e.state.doc.lineAt(t),i=e.state.doc.lineAt(n).to,a=Math.max(r.from,t-H),o=Math.min(i,n+H),s=e.state.sliceDoc(a,o);if(a!=r.from){for(let e=0;e<H;e++)if(!U.test(s[e+1])&&U.test(s[e])){s=s.slice(e);break}}if(o!=i){for(let e=s.length-1;e>s.length-H;e--)if(!U.test(s[e-1])&&U.test(s[e])){s=s.slice(0,e);break}}return g.announce.of(`${e.state.phrase(`current match`)}. ${s} ${e.state.phrase(`on line`)} ${r.number}.`)}var lt=g.baseTheme({".cm-panel.cm-search":{padding:`2px 6px 4px`,position:`relative`,"& [name=close]":{position:`absolute`,top:`0`,right:`4px`,backgroundColor:`inherit`,border:`none`,font:`inherit`,padding:0,margin:0},"& input, & button, & label":{margin:`.2em .6em .2em 0`},"& input[type=checkbox]":{marginRight:`.2em`},"& label":{fontSize:`80%`,whiteSpace:`pre`}},"&light .cm-searchMatch":{backgroundColor:`#ffff0054`},"&dark .cm-searchMatch":{backgroundColor:`#00ffff8a`},"&light .cm-searchMatch-selected":{backgroundColor:`#ff6a0054`},"&dark .cm-searchMatch-selected":{backgroundColor:`#ff00ff8a`}}),G=[P,i.low(Qe),lt],ut=class{constructor(e,t,n){this.from=e,this.to=t,this.diagnostic=n}},K=class e{constructor(e,t,n){this.diagnostics=e,this.panel=t,this.selected=n}static init(t,n,r){let i=r.facet(Z).markerFilter;i&&(t=i(t,r));let a=t.slice().sort((e,t)=>e.from-t.from||e.to-t.to),o=new f,s=[],c=0,l=r.doc.iter(),u=0,p=r.doc.length;for(let e=0;;){let t=e==a.length?null:a[e];if(!t&&!s.length)break;let n,r;if(s.length)n=c,r=s.reduce((e,t)=>Math.min(e,t.to),t&&t.from>n?t.from:1e8);else{if(n=t.from,n>p)break;r=t.to,s.push(t),e++}for(;e<a.length;){let t=a[e];if(t.from==n&&(t.to>t.from||t.to==n))s.push(t),e++,r=Math.min(t.to,r);else{r=Math.min(t.from,r);break}}r=Math.min(r,p);let i=!1;if(s.some(e=>e.from==n&&(e.to==r||r==p))&&(i=n==r,!i&&r-n<10)){let e=n-(u+l.value.length);e>0&&(l.next(e),u=n);for(let e=n;;){if(e>=r){i=!0;break}if(!l.lineBreak&&u+l.value.length>e)break;e=u+l.value.length,u+=l.value.length,l.next()}}let f=Ot(s);if(i)o.add(n,n,d.widget({widget:new Ct(f),diagnostics:s.slice()}));else{let e=s.reduce((e,t)=>t.markClass?e+` `+t.markClass:e,``);o.add(n,r,d.mark({class:`cm-lintRange cm-lintRange-`+f+e,diagnostics:s.slice(),inclusiveEnd:s.some(e=>e.to>r)}))}if(c=r,c==p)break;for(let e=0;e<s.length;e++)s[e].to<=c&&s.splice(e--,1)}let m=o.finish();return new e(m,n,q(m))}};function q(e,t=null,n=0){let r=null;return e.between(n,1e9,(e,n,{spec:i})=>{if(!(t&&i.diagnostics.indexOf(t)<0))if(!r)r=new ut(e,n,t||i.diagnostics[0]);else if(i.diagnostics.indexOf(r.diagnostic)<0)return!1;else r=new ut(r.from,n,r.diagnostic)}),r}function dt(e,t){let n=t.pos,r=t.end||n,i=e.state.facet(Z).hideOn(e,n,r);if(i!=null)return i;let a=e.startState.doc.lineAt(t.pos);return!!(e.effects.some(e=>e.is(J))||e.changes.touchesRange(a.from,Math.max(a.to,r)))}function ft(e,t){return e.field(X,!1)?t:t.concat(h.appendConfig.of(kt))}var J=h.define(),Y=h.define(),pt=h.define(),X=l.define({create(){return new K(d.none,null,null)},update(e,t){if(t.docChanged&&e.diagnostics.size){let n=e.diagnostics.map(t.changes),r=null,i=e.panel;if(e.selected){let i=t.changes.mapPos(e.selected.from,1);r=q(n,e.selected.diagnostic,i)||q(n,null,i)}!n.size&&i&&t.state.facet(Z).autoPanel&&(i=null),e=new K(n,i,r)}for(let n of t.effects)if(n.is(J)){let r=t.state.facet(Z).autoPanel?n.value.length?Q.open:null:e.panel;e=K.init(n.value,r,t.state)}else n.is(Y)?e=new K(e.diagnostics,n.value?Q.open:null,e.selected):n.is(pt)&&(e=new K(e.diagnostics,e.panel,n.value));return e},provide:e=>[_.from(e,e=>e.panel),g.decorations.from(e,e=>e.diagnostics)]}),mt=d.mark({class:`cm-lintRange cm-lintRange-active`});function ht(e,t,n){let{diagnostics:r}=e.state.field(X),i,a=-1,o=-1;r.between(t-+(n<0),t+ +(n>0),(e,r,{spec:s})=>{if(t>=e&&t<=r&&(e==r||(t>e||n>0)&&(t<r||n<0)))return i=s.diagnostics,a=e,o=r,!1});let s=e.state.facet(Z).tooltipFilter;return i&&s&&(i=s(i,e.state)),i?{pos:a,end:o,above:e.state.doc.lineAt(a).to<o,create(){return{dom:gt(e,i)}}}:null}function gt(e,t){return b(`ul`,{class:`cm-tooltip-lint`},t.map(t=>St(e,t,!1)))}var _t=e=>{let t=e.state.field(X,!1);(!t||!t.panel)&&e.dispatch({effects:ft(e.state,[Y.of(!0)])});let n=v(e,Q.open);return n&&n.dom.querySelector(`.cm-panel-lint ul`).focus(),!0},vt=e=>{let t=e.state.field(X,!1);return!t||!t.panel?!1:(e.dispatch({effects:Y.of(!1)}),!0)},yt=[{key:`Mod-Shift-m`,run:_t,preventDefault:!0},{key:`F8`,run:e=>{let t=e.state.field(X,!1);if(!t)return!1;let n=e.state.selection.main,r=q(t.diagnostics,null,n.to+1);return!r&&(r=q(t.diagnostics,null,0),!r||r.from==n.from&&r.to==n.to)?!1:(e.dispatch({selection:{anchor:r.from,head:r.to},scrollIntoView:!0}),!0)}}],Z=m.define({combine(e){return{sources:e.map(e=>e.source).filter(e=>e!=null),...a(e.map(e=>e.config),{delay:750,markerFilter:null,tooltipFilter:null,needsRefresh:null,hideOn:()=>null},{delay:Math.max,markerFilter:bt,tooltipFilter:bt,needsRefresh:(e,t)=>e?t?n=>e(n)||t(n):e:t,hideOn:(e,t)=>e?t?(n,r,i)=>e(n,r,i)||t(n,r,i):e:t,autoPanel:(e,t)=>e||t})}}});function bt(e,t){return e?t?(n,r)=>t(e(n,r),r):e:t}function xt(e){let t=[];if(e)actions:for(let{name:n}of e){for(let e=0;e<n.length;e++){let r=n[e];if(/[a-zA-Z]/.test(r)&&!t.some(e=>e.toLowerCase()==r.toLowerCase())){t.push(r);continue actions}}t.push(``)}return t}function St(e,t,n){let r=n?xt(t.actions):[];return b(`li`,{class:`cm-diagnostic cm-diagnostic-`+t.severity},b(`span`,{class:`cm-diagnosticText`},t.renderMessage?t.renderMessage(e):t.message),t.actions?.map((n,i)=>{let a=!1,o=r=>{if(r.preventDefault(),a)return;a=!0;let i=q(e.state.field(X).diagnostics,t);i&&n.apply(e,i.from,i.to)},{name:s}=n,c=r[i]?s.indexOf(r[i]):-1,l=c<0?s:[s.slice(0,c),b(`u`,s.slice(c,c+1)),s.slice(c+1)];return b(`button`,{type:`button`,class:`cm-diagnosticAction`+(n.markClass?` `+n.markClass:``),onclick:o,onmousedown:o,"aria-label":` Action: ${s}${c<0?``:` (access key "${r[i]})"`}.`},l)}),t.source&&b(`div`,{class:`cm-diagnosticSource`},t.source))}var Ct=class extends r{constructor(e){super(),this.sev=e}eq(e){return e.sev==this.sev}toDOM(){return b(`span`,{class:`cm-lintPoint cm-lintPoint-`+this.sev})}},wt=class{constructor(e,t){this.diagnostic=t,this.id=`item_`+Math.floor(Math.random()*4294967295).toString(16),this.dom=St(e,t,!0),this.dom.id=this.id,this.dom.setAttribute(`role`,`option`)}},Q=class e{constructor(e){this.view=e,this.items=[],this.list=b(`ul`,{tabIndex:0,role:`listbox`,"aria-label":this.view.state.phrase(`Diagnostics`),onkeydown:t=>{if(!(t.ctrlKey||t.altKey||t.metaKey)){if(t.keyCode==27)vt(this.view),this.view.focus();else if(t.keyCode==38||t.keyCode==33)this.moveSelection((this.selectedIndex-1+this.items.length)%this.items.length);else if(t.keyCode==40||t.keyCode==34)this.moveSelection((this.selectedIndex+1)%this.items.length);else if(t.keyCode==36)this.moveSelection(0);else if(t.keyCode==35)this.moveSelection(this.items.length-1);else if(t.keyCode==13)this.view.focus();else if(t.keyCode>=65&&t.keyCode<=90&&this.selectedIndex>=0){let{diagnostic:n}=this.items[this.selectedIndex],r=xt(n.actions);for(let i=0;i<r.length;i++)if(r[i].toUpperCase().charCodeAt(0)==t.keyCode){let t=q(this.view.state.field(X).diagnostics,n);t&&n.actions[i].apply(e,t.from,t.to)}}else return;t.preventDefault()}},onclick:e=>{for(let t=0;t<this.items.length;t++)this.items[t].dom.contains(e.target)&&this.moveSelection(t)}}),this.dom=b(`div`,{class:`cm-panel-lint`},this.list,b(`button`,{type:`button`,name:`close`,"aria-label":this.view.state.phrase(`close`),onclick:()=>vt(this.view)},`×`)),this.update()}get selectedIndex(){let e=this.view.state.field(X).selected;if(!e)return-1;for(let t=0;t<this.items.length;t++)if(this.items[t].diagnostic==e.diagnostic)return t;return-1}update(){let{diagnostics:e,selected:t}=this.view.state.field(X),n=0,r=!1,i=null,a=new Set;for(e.between(0,this.view.state.doc.length,(e,o,{spec:s})=>{for(let e of s.diagnostics){if(a.has(e))continue;a.add(e);let o=-1,s;for(let t=n;t<this.items.length;t++)if(this.items[t].diagnostic==e){o=t;break}o<0?(s=new wt(this.view,e),this.items.splice(n,0,s),r=!0):(s=this.items[o],o>n&&(this.items.splice(n,o-n),r=!0)),t&&s.diagnostic==t.diagnostic?s.dom.hasAttribute(`aria-selected`)||(s.dom.setAttribute(`aria-selected`,`true`),i=s):s.dom.hasAttribute(`aria-selected`)&&s.dom.removeAttribute(`aria-selected`),n++}});n<this.items.length&&!(this.items.length==1&&this.items[0].diagnostic.from<0);)r=!0,this.items.pop();this.items.length==0&&(this.items.push(new wt(this.view,{from:-1,to:-1,severity:`info`,message:this.view.state.phrase(`No diagnostics`)})),r=!0),i?(this.list.setAttribute(`aria-activedescendant`,i.id),this.view.requestMeasure({key:this,read:()=>({sel:i.dom.getBoundingClientRect(),panel:this.list.getBoundingClientRect()}),write:({sel:e,panel:t})=>{let n=t.height/this.list.offsetHeight;e.top<t.top?this.list.scrollTop-=(t.top-e.top)/n:e.bottom>t.bottom&&(this.list.scrollTop+=(e.bottom-t.bottom)/n)}})):this.selectedIndex<0&&this.list.removeAttribute(`aria-activedescendant`),r&&this.sync()}sync(){let e=this.list.firstChild;function t(){let t=e;e=t.nextSibling,t.remove()}for(let n of this.items)if(n.dom.parentNode==this.list){for(;e!=n.dom;)t();e=n.dom.nextSibling}else this.list.insertBefore(n.dom,e);for(;e;)t()}moveSelection(e){if(this.selectedIndex<0)return;let t=q(this.view.state.field(X).diagnostics,this.items[e].diagnostic);t&&this.view.dispatch({selection:{anchor:t.from,head:t.to},scrollIntoView:!0,effects:pt.of(t)})}static open(t){return new e(t)}};function Tt(e,t=`viewBox="0 0 40 40"`){return`url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" ${t}>${encodeURIComponent(e)}</svg>')`}function $(e){return Tt(`<path d="m0 2.5 l2 -1.5 l1 0 l2 1.5 l1 0" stroke="${e}" fill="none" stroke-width=".7"/>`,`width="6" height="3"`)}var Et=g.baseTheme({".cm-diagnostic":{padding:`3px 6px 3px 8px`,marginLeft:`-1px`,display:`block`,whiteSpace:`pre-wrap`},".cm-diagnostic-error":{borderLeft:`5px solid #d11`},".cm-diagnostic-warning":{borderLeft:`5px solid orange`},".cm-diagnostic-info":{borderLeft:`5px solid #999`},".cm-diagnostic-hint":{borderLeft:`5px solid #66d`},".cm-diagnosticAction":{font:`inherit`,border:`none`,padding:`2px 4px`,backgroundColor:`#444`,color:`white`,borderRadius:`3px`,marginLeft:`8px`,cursor:`pointer`},".cm-diagnosticSource":{fontSize:`70%`,opacity:.7},".cm-lintRange":{backgroundPosition:`left bottom`,backgroundRepeat:`repeat-x`,paddingBottom:`0.7px`},".cm-lintRange-error":{backgroundImage:$(`#d11`)},".cm-lintRange-warning":{backgroundImage:$(`orange`)},".cm-lintRange-info":{backgroundImage:$(`#999`)},".cm-lintRange-hint":{backgroundImage:$(`#66d`)},".cm-lintRange-active":{backgroundColor:`#ffdd9980`},".cm-tooltip-lint":{padding:0,margin:0},".cm-lintPoint":{position:`relative`,"&:after":{content:`""`,position:`absolute`,bottom:0,left:`-2px`,borderLeft:`3px solid transparent`,borderRight:`3px solid transparent`,borderBottom:`4px solid #d11`}},".cm-lintPoint-warning":{"&:after":{borderBottomColor:`orange`}},".cm-lintPoint-info":{"&:after":{borderBottomColor:`#999`}},".cm-lintPoint-hint":{"&:after":{borderBottomColor:`#66d`}},".cm-panel.cm-panel-lint":{position:`relative`,"& ul":{maxHeight:`100px`,overflowY:`auto`,"& [aria-selected]":{backgroundColor:`#ddd`,"& u":{textDecoration:`underline`}},"&:focus [aria-selected]":{background_fallback:`#bdf`,backgroundColor:`Highlight`,color_fallback:`white`,color:`HighlightText`},"& u":{textDecoration:`none`},padding:0,margin:0},"& [name=close]":{position:`absolute`,top:`0`,right:`2px`,background:`inherit`,border:`none`,font:`inherit`,padding:0,margin:0}},"&dark .cm-lintRange-active":{backgroundColor:`#86714a80`},"&dark .cm-panel.cm-panel-lint ul":{"& [aria-selected]":{backgroundColor:`#2e343e`}}});function Dt(e){return e==`error`?4:e==`warning`?3:e==`info`?2:1}function Ot(e){let t=`hint`,n=1;for(let r of e){let e=Dt(r.severity);e>n&&(n=e,t=r.severity)}return t}var kt=[X,g.decorations.compute([X],e=>{let{selected:t,panel:n}=e.field(X);return!t||!n||t.from==t.to?d.none:d.set([mt.range(t.from,t.to)])}),de(ht,{hideOn:dt}),Et],At=[ae(),he(),ie(),e(),re(),ge(),pe(),o.allowMultipleSelections.of(!0),s(),p(se,{fallback:!0}),ue(),Ce(),xe(),fe(),oe(),me(),je(),_e.of([...be,...n,...st,...t,...ve,...Se,...yt])];ie(),e(),ge(),p(se,{fallback:!0}),_e.of([...n,...t]);export{Ve as n,At as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{$ as e}from"./dist-
|
|
1
|
+
import{$ as e}from"./dist-DkRtDyLN.js";var t=/\.(md|mdx)$/i;function n(e){return e.trim().replace(/^\.\/+/,``).replace(/^\/+/,``)}function r(e){return n(e).replace(t,``)}function i(e){let r=n(e);return r?t.test(r)?r:`${r}.md`:`untitled.md`}function a(e){let t=r(e),n=t.lastIndexOf(`/`);return{initialDir:n>0?t.slice(0,n):``,suggestedName:`${n>=0?t.slice(n+1):t||`untitled`}.md`}}function o(t){return e.includes(t)}function s(e){if(e.startsWith(h)||e.startsWith(y)||!e.startsWith(`#/`))return null;let t=e.slice(2),n=g(t),r=n>=0?t.slice(0,n):t;if(!r)return null;try{return r.split(`/`).map(decodeURIComponent).join(`/`)}catch{return r}}function c(e){if(e.startsWith(h)||!e.startsWith(`#/`))return null;let t=e.slice(2),n=t.indexOf(`#`);if(n<0)return null;let r=t.slice(n+1);if(!r)return null;try{return decodeURIComponent(r)}catch{return r}}function l(e,t){let n=`#/${e}`;return t?`${n}#${encodeURIComponent(t)}`:n}function u(e){if(window.location.hash===e)return;let{pathname:t,search:n}=window.location;window.history.replaceState(null,``,`${t}${n}${e}`)}function d(e){return e.endsWith(`.mdx`)?e.slice(0,-4):e.endsWith(`.md`)?e.slice(0,-3):e}function f(e,t){let n=e.replace(/^\/+|\/+$/g,``),r=n?`#/${n}/`:`#/`;return t?`${r}#${encodeURIComponent(t)}`:r}function p(e,t,n){if(e===`folder`)return f(t);let r=`#/${encodeURIComponent(t)}`;return n==null||n===``?r:`${r}?branch=${encodeURIComponent(n)}`}function m(e){if(e===`#/`)return!0;if(!e.startsWith(`#/`))return!1;let t=e.slice(2);return t.length>0&&t[0]===`?`}var h=`#/__asset__/`;function g(e){let t=e.indexOf(`?`),n=e.indexOf(`#`);return t<0?n:n<0?t:Math.min(t,n)}function _(e){if(!e.startsWith(h))return null;let t=e.slice(12);if(!t)return null;try{return t.split(`/`).map(decodeURIComponent).join(`/`)}catch{return t}}function v(e){return`${h}${e.split(`/`).map(encodeURIComponent).join(`/`)}`}var y=`#/__skill-file__/`;function b(e){return`${y}${[e.scope,e.name].map(encodeURIComponent).join(`/`)}/${e.path.split(`/`).map(encodeURIComponent).join(`/`)}`}function x(e){if(!e.startsWith(y))return null;let t=e.slice(17);if(!t)return null;let n;try{n=t.split(`/`).map(decodeURIComponent)}catch{return null}if(n.length<3)return null;let[r,i,...a]=n,s=a.join(`/`);return!r||!i||!s||!o(r)?null:{scope:r,name:i,path:s}}export{d as a,f as c,u as d,x as f,r as h,p as i,b as l,i as m,_ as n,v as o,a as p,s as r,l as s,c as t,m as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{O as e}from"./dist-
|
|
1
|
+
import{O as e}from"./dist-DkRtDyLN.js";var t=`open-knowledge:documents-changed`,n=new Set(e.options);function r(e){return e===void 0||!Array.isArray(e)?[`files`]:[...new Set(e.filter(e=>n.has(e)))]}function i(e=[`files`]){window.dispatchEvent(new CustomEvent(t,{detail:{channels:r(e)}}))}function a(e){let n=t=>{e(r(t instanceof CustomEvent?t.detail?.channels:void 0))};return window.addEventListener(t,n),()=>window.removeEventListener(t,n)}var o=`open-knowledge:branch-changed`;function s(e){window.dispatchEvent(new CustomEvent(o,{detail:{branch:e}}))}function c(e){let t=t=>{if(!(t instanceof CustomEvent))return;let n=t.detail;e(n?.branch??null)};return window.addEventListener(o,t),()=>window.removeEventListener(o,t)}var l=`open-knowledge:templates-changed`;function u(){window.dispatchEvent(new CustomEvent(l))}function d(e){let t=()=>e();return window.addEventListener(l,t),()=>window.removeEventListener(l,t)}var f=`open-knowledge:skills-changed`;function p(){window.dispatchEvent(new CustomEvent(f))}function m(e){let t=()=>e();return window.addEventListener(f,t),()=>window.removeEventListener(f,t)}export{c as a,d as c,u as i,i as n,a as o,p as r,m as s,s as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{s as e}from"./chunk-Bj-mKKzh.js";import{n as t,t as n}from"./compiler-runtime-B6sxACDP.js";import{la as r,ua as i}from"./dist-
|
|
1
|
+
import{s as e}from"./chunk-Bj-mKKzh.js";import{n as t,t as n}from"./compiler-runtime-B6sxACDP.js";import{la as r,ua as i}from"./dist-DkRtDyLN.js";import{t as a}from"./file-tree-rename-validation-DgUQ0I0S.js";import{b as o,i as s,x as c,y as l}from"./navigation-targets-S-8o5DE_.js";import{c as u,o as ee,s as d}from"./doc-hash-BDRwCcvB.js";import{t as f}from"./use-apply-config-color-theme-CUJwxTbn.js";var p=e(t(),1),m=n(),h=`application/x-open-knowledge-sidebar-item+json`,g={image:!0,video:!0,audio:!0,pdf:!0,text:!0,mermaid:!0};function _(e){return JSON.stringify(e)}function v(e){return e.kind===`folder`?{target:{kind:`folder`,target:e.folderPath,folderPath:e.folderPath},hash:u(e.folderPath)}:e.kind===`asset`?{target:{kind:`asset`,target:e.assetPath,assetPath:e.assetPath,mediaKind:e.mediaKind},hash:ee(e.assetPath)}:{target:s(e.docName,e.size)??{kind:`doc`,target:e.docName,docName:e.docName},hash:d(e.docName)}}function y(e){if(!e||!Array.from(e.types).includes(`application/x-open-knowledge-sidebar-item+json`))return null;let t=e.getData(h);if(!t)return null;let n;try{n=JSON.parse(t)}catch{return null}if(!b(n)||n.v!==1||typeof n.kind!=`string`)return null;if(n.kind===`doc`){if(typeof n.docName!=`string`||n.docName.length===0)return null;let e=n.size;return e!==null&&typeof e!=`number`?null:{v:1,kind:`doc`,docName:n.docName,size:e}}if(n.kind===`folder`)return typeof n.folderPath==`string`?{v:1,kind:`folder`,folderPath:n.folderPath}:null;if(n.kind===`asset`){if(typeof n.assetPath!=`string`||n.assetPath.length===0)return null;let e=n.mediaKind;return e!==null&&!x(e)?null:{v:1,kind:`asset`,assetPath:n.assetPath,mediaKind:e}}return null}function b(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function x(e){return typeof e==`string`&&Object.hasOwn(g,e)}var S={background:`#171717`,foreground:`#e5e5e5`,cursor:`#e5e5e5`,cursorAccent:`#171717`,selectionBackground:`#3a3d41`,black:`#000000`,red:`#cd3131`,green:`#0dbc79`,yellow:`#e5e510`,blue:`#2472c8`,magenta:`#bc3fbc`,cyan:`#11a8cd`,white:`#e5e5e5`,brightBlack:`#666666`,brightRed:`#f14c4c`,brightGreen:`#23d18b`,brightYellow:`#f5f543`,brightBlue:`#3b8eea`,brightMagenta:`#d670d6`,brightCyan:`#29b8db`,brightWhite:`#ffffff`},C={background:`#ffffff`,foreground:`#262626`,cursor:`#262626`,cursorAccent:`#ffffff`,selectionBackground:`#add6ff`,black:`#000000`,red:`#cd3131`,green:`#00bc00`,yellow:`#949800`,blue:`#0451a5`,magenta:`#bc05bc`,cyan:`#0598bc`,white:`#555555`,brightBlack:`#666666`,brightRed:`#cd3131`,brightGreen:`#14ce14`,brightYellow:`#b5ba00`,brightBlue:`#0451a5`,brightMagenta:`#bc05bc`,brightCyan:`#0598bc`,brightWhite:`#a5a5a5`};function w(e){return e===`dark`?S:C}function te(e){try{let t=document.createElement(`span`);t.style.display=`none`,t.style.backgroundColor=`var(${e})`,document.body.appendChild(t);try{let e=getComputedStyle(t).backgroundColor;return!e||e===`rgba(0, 0, 0, 0)`||e===`transparent`||e.includes(`var(`)?null:e}finally{t.remove()}}catch{return null}}function T(e,t=te){let n=w(e),r=t(`--background`)??n.background,i=t(`--foreground`)??n.foreground;return{...n,background:r,foreground:i,cursor:i,cursorAccent:r,selectionBackground:t(`--selection-soft`)??n.selectionBackground}}function ne(e,t){let n=new Set([...Object.keys(e),...Object.keys(t)]);for(let r of n)if(e[r]!==t[r])return!1;return!0}function E(e){let t=(0,m.c)(5),n;t[0]===e?n=t[1]:(n=()=>T(e),t[0]=e,t[1]=n);let[r,i]=(0,p.useState)(n),a,o;return t[2]===e?(a=t[3],o=t[4]):(a=()=>{let t=()=>{let t=T(e);i(e=>ne(e,t)?e:t)};t();let n=new MutationObserver(t);return n.observe(document.documentElement,{attributes:!0,attributeFilter:[f,`class`]}),n.observe(document.head,{childList:!0,subtree:!0,characterData:!0}),()=>n.disconnect()},o=[e],t[2]=e,t[3]=a,t[4]=o),(0,p.useEffect)(a,o),r}var D=`.md`,O=/\.(md|mdx)$/i;function k(e,t=D){return O.test(e)||r(e)?e:`${e}${t}`}function A(e){return $(e).replace(O,``)}function j(e,t){let n=$(e),r=t.find(e=>o(e)&&M(e)===n);if(r)return r.docName;let i=A(n);return t.find(e=>{let t=M(e);return t!==n&&O.test(t)&&A(t)===i})&&O.test(n)?n:i}function M(e){return c(e)?F(e.path):l(e)?e.path:k(e.docName,e.docExt)}function N(e){let t=$(e).match(O);return t?`.${t[1].toLowerCase()}`:void 0}function P(e){return $(e)}function F(e){let t=$(e.trim());return t?`${t}/`:``}function I(e){return e.endsWith(`/`)?P(e):A(e)}function L(e){return e.map(M)}function R(e){return[...e].sort().join(`\0`)}function z(e){return R(L(e))}function B(e,t={}){let n=new Set;for(let r of e){let e=(c(r)||l(r)?r.path:r.docName).split(`/`).filter(Boolean);if(!t.includeOkFolders&&e.includes(`.ok`))continue;if(c(r)){let e=F(r.path);e&&n.add(e)}let i=c(r)?e.length:e.length-1;for(let t=1;t<=i;t++)n.add(`${e.slice(0,t).join(`/`)}/`)}return[...n].sort()}function V(e){if(!e)return[];let t=$(e.replace(O,``)).split(`/`).filter(Boolean),n=[],r=e.endsWith(`/`)?t.length:t.length-1;for(let e=1;e<=r;e++)n.push(`${t.slice(0,e).join(`/`)}/`);return n}function re(e,t,n){let r=N(e);if(r)return r;let i=n.find(e=>o(e)&&e.docName===t);return i?i.docExt??D:Q(e).includes(`.`)?void 0:D}function H(e,t){let n=e.lastIndexOf(`/`),r=n===-1?``:e.slice(0,n+1),i=n===-1?e:e.slice(n+1),a=t.filter(e=>{if(!l(e)||!e.path.startsWith(r))return!1;let t=e.path.slice(r.length);return!t.includes(`/`)&&t.startsWith(`${i}.`)});return a.length===1?a[0].path:null}function U(e,t,n){if(N(e))return null;let r=n.find(e=>l(e)&&e.path===t);return r?r.path:Q(e).includes(`.`)?t:H(t,n)}function W(e,t){let n=e.kind===`directory`,r=n?P(e.path):j(e.path,t);if(n)return{kind:`folder`,name:$(Q(e.path)).replace(O,``),path:r,treePath:K(e.path,!0)};let i=U(e.path,r,t);if(i)return{kind:`asset`,name:$(Q(i)),path:i,treePath:i};let a=re(e.path,r,t);return{kind:`file`,name:$(Q(e.path)).replace(O,``),path:r,treePath:K(e.path,!1),docExt:a}}function G(e){return e.kind===`directory`?P(e.path):e.path}function K(e,t){return t?F(e):O.test(e)?e:`${e}${D}`}function q(e,t,n){let r=F(t),i=new Set(n);for(let t=0;t<100;t++){let n=t===0?``:` ${t+1}`;if(e===`file`){let e=`${r}Untitled${n}${D}`;if(!i.has(e))return{addPath:e,renamePath:e};continue}let a=`${r}New Folder${n}/`;if(!i.has(a))return{addPath:a,renamePath:a}}throw Error(`Could not allocate a unique tree placeholder`)}function J(e,t){return e===`file`?K(t,!1):`${P(t)}/index${D}`}function Y(e,t){return t.kind===`root`||t.directoryPath==null?Q(e):`${t.directoryPath}${Q(e)}`}function X(e,t){if(t)return P(F(e));let n=A(e),r=n.lastIndexOf(`/`);return r===-1?``:n.slice(0,r)}function Z(e,t){let n=P(F(e));return n?`${n}/${t}`:t}function ie(e,t,n){e.append(`parentDocName`,Z(t,n)),e.append(`placement`,`parent-dir`)}function ae(e,t){return(t.path??Z(e,t.src)).replace(/^\/+/,``)}function oe(e){let t=e.dataTransfer?.types;if(!t)return!1;let n=Array.from(t);return n.includes(`Files`)&&!n.includes(`application/x-open-knowledge-sidebar-item+json`)}function se(e){return Array.from(e.dataTransfer?.files??[]).filter(e=>e.name.length>0||e.size>0)}function ce(e,t){let n=a(e).toLowerCase();if(n===``)return null;let r=new Date().toISOString();if(n===`.md`||n===`.mdx`)return{kind:`document`,docName:A(e),docExt:n,modified:r,size:t.size};let o=n.startsWith(`.`)?n.slice(1):n;return{kind:`asset`,path:e,assetExt:o,mediaKind:i(o),modified:r,size:t.size}}function Q(e){let t=$(e),n=t.lastIndexOf(`/`),r=n===-1?t:t.slice(n+1);return e.endsWith(`/`)?`${r}/`:r}function $(e){return e.endsWith(`/`)?e.slice(0,-1):e}export{_ as A,R as C,h as D,E,v as O,W as S,ae as T,G as _,J as a,A as b,L as c,M as d,se as f,X as g,K as h,Y as i,y as k,z as l,oe as m,B as n,q as o,F as p,V as r,k as s,ie as t,ce as u,H as v,I as w,j as x,P as y};
|