cli-jaw 2.2.12 → 2.2.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (64) hide show
  1. package/dist/src/agent/error-classifier.js +11 -2
  2. package/dist/src/agent/error-classifier.js.map +1 -1
  3. package/dist/src/agent/events/claude.js +7 -1
  4. package/dist/src/agent/events/claude.js.map +1 -1
  5. package/dist/src/agent/events/fulltext-bound.js +32 -0
  6. package/dist/src/agent/events/fulltext-bound.js.map +1 -0
  7. package/dist/src/agent/events/grok.js +7 -1
  8. package/dist/src/agent/events/grok.js.map +1 -1
  9. package/dist/src/agent/events/helpers.js +17 -4
  10. package/dist/src/agent/events/helpers.js.map +1 -1
  11. package/dist/src/agent/lifecycle-handler.js +56 -5
  12. package/dist/src/agent/lifecycle-handler.js.map +1 -1
  13. package/dist/src/agent/pi-runtime.js +30 -1
  14. package/dist/src/agent/pi-runtime.js.map +1 -1
  15. package/dist/src/agent/spawn/exit-drain.js +96 -0
  16. package/dist/src/agent/spawn/exit-drain.js.map +1 -0
  17. package/dist/src/agent/spawn/line-buffer.js +26 -0
  18. package/dist/src/agent/spawn/line-buffer.js.map +1 -0
  19. package/dist/src/agent/spawn/process-kill.js +31 -0
  20. package/dist/src/agent/spawn/process-kill.js.map +1 -1
  21. package/dist/src/agent/spawn.js +80 -23
  22. package/dist/src/agent/spawn.js.map +1 -1
  23. package/dist/src/agent/watchdog.js +21 -5
  24. package/dist/src/agent/watchdog.js.map +1 -1
  25. package/dist/src/routes/link-preview.js +14 -0
  26. package/dist/src/routes/link-preview.js.map +1 -1
  27. package/package.json +3 -1
  28. package/public/dist/assets/CodeCanvas-CbfPP7Ad.js +3 -0
  29. package/public/dist/assets/{DocPanel-DtYwv3n3.js → DocPanel-Dz-J_l5M.js} +1 -1
  30. package/public/dist/assets/MarkdownRenderer-CXrilOsG.js +15 -0
  31. package/public/dist/assets/MarkdownRenderer-DZVh_xX2.js +1 -0
  32. package/public/dist/assets/{MilkdownWysiwygEditor-BNoLGbFC.js → MilkdownWysiwygEditor-Em7iC6y9.js} +8 -8
  33. package/public/dist/assets/{react-dom-AWKMTIe7.js → bounded-set-CFlZiEF4.js} +1 -1
  34. package/public/dist/assets/manager-DaN201mN.js +13 -0
  35. package/public/dist/assets/{wiki-link-resolver-BfNXN9px.js → wiki-link-resolver-DyFzBTIQ.js} +1 -1
  36. package/public/dist/manager/index.html +1 -1
  37. package/public/manager/src/SidebarRailRouter.tsx +9 -3
  38. package/public/manager/src/browser-panel/use-embedded-target-sync.ts +19 -1
  39. package/public/manager/src/code/CodeCanvas.tsx +14 -2
  40. package/public/manager/src/code/CodeTranscript.tsx +33 -9
  41. package/public/manager/src/code/CodeWorkbench.tsx +1 -1
  42. package/public/manager/src/code/code-event-dedupe.ts +27 -3
  43. package/public/manager/src/code/use-code-transcript-scroll.ts +28 -3
  44. package/public/manager/src/code/use-throttled-markdown.ts +75 -0
  45. package/public/manager/src/code/useCodeTranscriptVirtualRows.ts +19 -0
  46. package/public/manager/src/electron-metrics.tsx +7 -0
  47. package/public/manager/src/jaw-ceo/useJawCeo.ts +6 -1
  48. package/public/manager/src/jaw-ceo/useJawCeoVirtualTimeline.ts +5 -0
  49. package/public/manager/src/lib/bounded-set.ts +15 -0
  50. package/public/manager/src/lib/fnv1a.ts +14 -0
  51. package/public/manager/src/notes/rendering/CodeBlock.tsx +13 -4
  52. package/public/manager/src/notes/rendering/MarkdownRenderer.tsx +14 -2
  53. package/public/manager/src/notes/rendering/highlight-cache.ts +111 -0
  54. package/public/manager/src/notes/useNotesExternalSync.ts +6 -1
  55. package/scripts/bundle-sidecar.sh +8 -0
  56. package/scripts/check-electron-no-native.cjs +90 -4
  57. package/scripts/check-native-load.cjs +157 -0
  58. package/scripts/check-sidecar-smoke.mjs +151 -0
  59. package/scripts/ensure-native-modules.cjs +222 -18
  60. package/scripts/release-gates.mjs +29 -0
  61. package/public/dist/assets/CodeCanvas-BZo3dohZ.js +0 -3
  62. package/public/dist/assets/MarkdownRenderer-CHacL2M_.js +0 -15
  63. package/public/dist/assets/MarkdownRenderer-DyrB9FbZ.js +0 -1
  64. package/public/dist/assets/manager-DL1GygQL.js +0 -13
@@ -1 +1 @@
1
- {"version":3,"file":"link-preview.js","sourceRoot":"","sources":["../../../src/routes/link-preview.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAC3C,OAAO,EAAE,IAAI,EAAE,MAAM,UAAU,CAAC;AAEhC,OAAO,EAAE,kBAAkB,EAAE,MAAM,sCAAsC,CAAC;AAC1E,OAAO,EAAE,uBAAuB,EAAE,MAAM,uCAAuC,CAAC;AAChF,OAAO,EAAE,uBAAuB,EAAE,iBAAiB,EAAE,8BAA8B,EAAE,MAAM,qCAAqC,CAAC;AACjI,OAAO,EAAE,IAAI,EAAE,EAAE,EAAE,MAAM,qBAAqB,CAAC;AAE/C,MAAM,kBAAkB,GAAG,IAAI,CAAC;AAChC,MAAM,sBAAsB,GAAG,GAAG,GAAG,IAAI,CAAC;AAC1C,MAAM,sBAAsB,GAAG,CAAC,CAAC;AACjC,MAAM,gBAAgB,GAAG,IAAI,CAAC;AAC9B,MAAM,eAAe,GAAG,CAAC,GAAG,IAAI,GAAG,IAAI,CAAC;AACxC,MAAM,YAAY,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,IAAI,CAAC;AACzC,MAAM,qBAAqB,GAAG,CAAC,GAAG,EAAE,GAAG,IAAI,CAAC;AAC5C,MAAM,iBAAiB,GAAG,GAAG,CAAC;AAC9B,MAAM,oBAAoB,GAAG,EAAE,GAAG,IAAI,CAAC;AACvC,MAAM,cAAc,GAAG,EAAE,CAAC;AAmC1B,MAAM,YAAY,GAAG,IAAI,GAAG,EAAmC,CAAC;AAChE,MAAM,YAAY,GAAG,IAAI,GAAG,EAAsB,CAAC;AAEnD,SAAS,SAAS,CAAI,KAAiC;IACnD,OAAO,KAAK,CAAC,IAAI,GAAG,iBAA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,CAAC;gBACR,IAAI,CAAC,GAAG,EAAE,GAAG,EAAE,iBAAiB,CAAC,CAAC;gBAClC,OAAO;YACX,CAAC;YACD,GAAG,CAAC,SAAS,CAAC,cAAc,EAAE,WAAW,CAAC,CAAC;YAC3C,GAAG,CAAC,SAAS,CAAC,eAAe,EAAE,wBAAwB,CAAC,CAAC;YACzD,GAAG,CAAC,SAAS,CAAC,wBAAwB,EAAE,SAAS,CAAC,CAAC;YACnD,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;YACf,OAAO;QACX,CAAC;QACD,IAAI,CAAC,GAAG,EAAE,GAAG,EAAE,yBAAyB,CAAC,CAAC;IAC9C,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACb,cAAc,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;IAC/B,CAAC;AACL,CAAC;AAED,MAAM,UAAU,yBAAyB,CAAC,GAAY,EAAE,WAA2B,EAAE,UAAmC,EAAE;IACtH,GAAG,CAAC,GAAG,CAAC,mBAAmB,EAAE,WAAW,EAAE,cAAc,EAAE,CAAC,GAAG,EAAE,GAAG,EAAE,EAAE;QACnE,KAAK,aAAa,CAAC,GAAG,EAAE,GAAG,EAAE,OAAO,CAAC,CAAC;IAC1C,CAAC,CAAC,CAAC;IACH,GAAG,CAAC,GAAG,CAAC,yBAAyB,EAAE,WAAW,EAAE,cAAc,EAAE,CAAC,GAAG,EAAE,GAAG,EAAE,EAAE;QACzE,KAAK,gBAAgB,CAAC,GAAG,EAAE,GAAG,EAAE,OAAO,CAAC,CAAC;IAC7C,CAAC,CAAC,CAAC;AACP,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cli-jaw",
3
- "version": "2.2.12",
3
+ "version": "2.2.13",
4
4
  "description": "Personal AI assistant powered by Pi, Antigravity, AI-E, Claude, Claude E, Codex, Codex App, Cursor, Grok, Kiro, OpenCode, and Copilot — Web, Terminal, Telegram, and Discord interfaces with 107 built-in skills",
5
5
  "type": "module",
6
6
  "keywords": [
@@ -112,6 +112,8 @@
112
112
  "gate:electron-version": "node scripts/release-gates.mjs electron-version",
113
113
  "gate:gate-docs": "node scripts/release-gates.mjs gate-docs",
114
114
  "gate:sidecar-prune-safety": "node scripts/release-gates.mjs sidecar-prune-safety",
115
+ "gate:native-load": "node scripts/release-gates.mjs native-load",
116
+ "gate:sidecar-smoke": "node scripts/release-gates.mjs sidecar-smoke",
115
117
  "check:sidecar-prune-safety": "node scripts/check-sidecar-prune-safety.mjs",
116
118
  "sync:electron-version": "node scripts/sync-electron-version.cjs",
117
119
  "gate:all": "node scripts/release-gates.mjs",
@@ -0,0 +1,3 @@
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/vendor-render-Bjnw0wQ6.css"])))=>i.map(i=>d[i]);
2
+ import{r as e}from"./rolldown-runtime-XQCOJYun.js";import{t}from"./preload-helper-DFYRRz9w.js";import{a as n,i as r,n as i,r as a,t as o}from"./esm-CT1xxdH5.js";import{n as s,t as c}from"./jsx-runtime-gFMgZ0TQ.js";import{n as l,t as u}from"./bounded-set-CFlZiEF4.js";import{t as d}from"./desktop-bridge-CvdhnJQo.js";var f=e(s(),1),p=l();function m(e){let t=typeof window<`u`?window.location.origin:``,n=typeof window<`u`?window.location.port:``,r=t&&n===String(e)?t:`http://127.0.0.1:${e}`;async function i(e,t,n){let i={method:e};n&&(i.headers={"Content-Type":`application/json`},i.body=JSON.stringify(n));let a=await(await fetch(`${r}${t}`,i)).json();if(!a.ok)throw Error(a.error||`${e} ${t} failed`);return a}return{async listSessions(){return(await i(`GET`,`/api/code/sessions`)).sessions},async listStoredSessions(e={}){let t=e.scope??`all`,n=new URLSearchParams({scope:t});return t===`cwd`&&e.cwd&&n.set(`cwd`,e.cwd),(await i(`GET`,`/api/code/sessions/stored${`?${n.toString()}`}`)).sessions},async listModelOptions(){return i(`GET`,`/api/code/models`)},async setDefaultModel(e){return i(`POST`,`/api/code/model-default`,{modelId:e})},async listModelAssignments(){return i(`GET`,`/api/code/model-assignments`)},async setModelAssignment(e,t){let n=typeof t==`string`?{modelId:t}:t;return i(`PUT`,`/api/code/model-assignments/${encodeURIComponent(e)}`,n)},async clearModelAssignment(e){return i(`DELETE`,`/api/code/model-assignments/${encodeURIComponent(e)}`)},async listModelPresets(){return i(`GET`,`/api/code/model-presets`)},async getGitInfo(e){return await i(`GET`,`/api/code/git-info?cwd=${encodeURIComponent(e)}`)},async loadSession(e,t){return(await i(`POST`,`/api/code/sessions/load`,{sessionId:e,cwd:t})).session},async createSession(e,t){return(await i(`POST`,`/api/code/sessions`,{cwd:e,...t?{model:t}:{}})).session},async sendPrompt(e,t){return i(`POST`,`/api/code/sessions/${e}/prompt`,{text:t})},async cancelPrompt(e){await i(`POST`,`/api/code/sessions/${e}/cancel`)},async closeSession(e){await i(`DELETE`,`/api/code/sessions/${e}`)},async answerPermission(e,t){await i(`POST`,`/api/code/permissions/${e}`,{optionId:t})},async setSessionConfig(e,t,n){await i(`POST`,`/api/code/sessions/${e}/config`,{configId:t,valueId:n})},async extMethod(e,t,n){return(await i(`POST`,`/api/code/sessions/${e}/ext`,{method:t,params:n})).result},async forkSession(e,t){return(await i(`POST`,`/api/code/sessions/${e}/fork`,{cwd:t})).session},async setSessionModel(e,t){await i(`POST`,`/api/code/sessions/${e}/model`,{modelId:t})},pickWorkspace(){return i(`POST`,`/api/code/workspace/pick`)}}}var h=c();function g({client:e,activeSessionId:t,workingDir:n,onSelectSession:r,onLoadSession:i,onNewSession:a}){let[o,s]=(0,f.useState)([]),[c,l]=(0,f.useState)([]),[u,d]=(0,f.useState)(!0),[p,m]=(0,f.useState)(``),[g,_]=(0,f.useState)(``),[v,y]=(0,f.useState)(`all`),b=(0,f.useCallback)(async()=>{d(!0),m(``);let t=e=>e instanceof Error?e.message:String(e),r=v===`cwd`?{scope:`cwd`,cwd:n}:{scope:`all`},[i,a]=await Promise.allSettled([e.listSessions(),e.listStoredSessions(r)]),o=[];if(i.status===`fulfilled`){let e=i.value;s(e.filter(e=>e.status!==`closed`));let n=new Set(e.map(e=>e.sessionId));a.status===`fulfilled`?l(a.value.filter(e=>!n.has(e.sessionId))):(l([]),o.push(`History: ${t(a.reason)}`))}else s([]),o.push(`Live: ${t(i.reason)}`),a.status===`fulfilled`?l(a.value):(l([]),o.push(`History: ${t(a.reason)}`));o.length>0&&m(o.join(` · `)),d(!1)},[e,v,n]);(0,f.useEffect)(()=>{b()},[b]);let x=e=>e.split(`/`).pop()||e,S=e=>{let t=e.replayEvents?.find(e=>e.event===`code_user_message_chunk`)?.update??{},n=t.content;return String(n?.text??t.text??``).split(/\r?\n/)[0]?.replace(/\s+/g,` `).trim()||``},C=e=>e.title?.trim()||S(e)||x(e.cwd)||e.sessionId.slice(0,12)||`Untitled session`,w=e=>x(e.cwd),T=e=>[e.sessionId,e.title??``,S(e),e.cwd].join(` `).toLowerCase(),E=e=>e.title?.trim()||e.firstMessage?.replace(/\s+/g,` `).trim()||e.sessionId.slice(0,12)||`Untitled session`,D=e=>{if(typeof e.lastModified==`number`)return e.lastModified;if(e.updatedAt){let t=Date.parse(e.updatedAt);if(Number.isFinite(t))return t}return 0},O=e=>{let t=[x(e.cwd)];return e.messageCount!==void 0&&t.push(`${e.messageCount} messages`),t.filter(Boolean).join(` · `)},k=e=>[e.sessionId,e.title??``,e.firstMessage??``,e.cwd].join(` `).toLowerCase(),A=c.filter(e=>!g||k(e).includes(g.toLowerCase())).sort((e,t)=>D(t)-D(e)).slice(0,20),j=A.reduce((e,t)=>{let n=e.find(e=>e.cwd===t.cwd);return n?n.sessions.push(t):e.push({cwd:t.cwd,sessions:[t]}),e},[]),M=p?`Session data could not fully load.`:v===`cwd`?`No sessions for this cwd. Switch to All to browse global history.`:`No JWC sessions found.`;return(0,h.jsxs)(`div`,{className:`code-session-list`,children:[(0,h.jsxs)(`div`,{className:`code-session-list-header`,children:[(0,h.jsx)(`span`,{className:`code-session-list-title`,children:`Sessions`}),(0,h.jsx)(`button`,{type:`button`,className:`code-session-new-btn`,onClick:a,"aria-label":`New code session`,children:`+`})]}),(0,h.jsxs)(`div`,{className:`code-session-view-toggle`,"aria-label":`Session view`,children:[(0,h.jsx)(`button`,{type:`button`,className:`code-session-view-btn${v===`all`?` active`:``}`,onClick:()=>y(`all`),children:`All`}),(0,h.jsx)(`button`,{type:`button`,className:`code-session-view-btn${v===`cwd`?` active`:``}`,onClick:()=>y(`cwd`),children:`This cwd`}),(0,h.jsx)(`button`,{type:`button`,className:`code-session-view-btn${v===`grouped`?` active`:``}`,onClick:()=>y(`grouped`),children:`Group`})]}),v===`cwd`&&(0,h.jsx)(`div`,{className:`code-session-view-hint`,children:x(n)}),p&&(0,h.jsx)(`div`,{className:`code-session-list-error`,role:`status`,children:p}),o.length+c.length>3&&(0,h.jsx)(`input`,{className:`code-session-search`,type:`text`,value:g,onChange:e=>_(e.target.value),placeholder:`Search sessions...`}),u?(0,h.jsx)(`div`,{className:`code-session-list-loading`,children:`Loading...`}):(0,h.jsxs)(h.Fragment,{children:[o.length>0&&(0,h.jsx)(`ul`,{className:`code-session-list-items`,children:o.filter(e=>!g||T(e).includes(g.toLowerCase())).map(e=>(0,h.jsx)(`li`,{children:(0,h.jsxs)(`button`,{type:`button`,className:`code-session-item ${e.sessionId===t?`active`:``}`,onClick:()=>r(e),children:[(0,h.jsx)(`span`,{className:`code-session-cwd`,children:C(e)}),(0,h.jsx)(`span`,{className:`code-session-meta`,children:w(e)}),(0,h.jsx)(`span`,{className:`code-session-status code-session-status-${e.status}`,children:e.status})]})},e.sessionId))}),A.length>0&&v!==`grouped`&&(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(`div`,{className:`code-session-list-divider`,children:`History`}),(0,h.jsx)(`ul`,{className:`code-session-list-items`,children:A.map(e=>(0,h.jsx)(`li`,{children:(0,h.jsxs)(`button`,{type:`button`,className:`code-session-item`,onClick:()=>i(e.sessionId,e.cwd),children:[(0,h.jsx)(`span`,{className:`code-session-cwd`,children:E(e)}),(0,h.jsx)(`span`,{className:`code-session-meta`,children:O(e)}),(0,h.jsx)(`span`,{className:`code-session-status`,children:`stored`})]})},e.sessionId))})]}),A.length>0&&v===`grouped`&&(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(`div`,{className:`code-session-list-divider`,children:`History by cwd`}),j.map(e=>(0,h.jsxs)(`section`,{className:`code-session-group`,children:[(0,h.jsxs)(`div`,{className:`code-session-group-title`,title:e.cwd,children:[x(e.cwd),` `,(0,h.jsx)(`span`,{children:e.sessions.length})]}),(0,h.jsx)(`ul`,{className:`code-session-list-items`,children:e.sessions.map(e=>(0,h.jsx)(`li`,{children:(0,h.jsxs)(`button`,{type:`button`,className:`code-session-item`,onClick:()=>i(e.sessionId,e.cwd),children:[(0,h.jsx)(`span`,{className:`code-session-cwd`,children:E(e)}),(0,h.jsx)(`span`,{className:`code-session-meta`,children:O(e)}),(0,h.jsx)(`span`,{className:`code-session-status`,children:`stored`})]})},e.sessionId))})]},e.cwd))]}),o.length===0&&A.length===0&&(0,h.jsx)(`div`,{className:`code-session-list-empty`,children:M})]})]})}function _(e,t){for(let n=e.length-1;n>=0;n--){let r=e[n];if(r?.role===`tool`&&r.toolCallId===t)return n}return-1}function v(e,t){return e?`${e}/${t}`:t}var y=[`allow_once`,`allow_always`,`reject_once`,`reject_always`],b={allow_once:`Allow once`,allow_always:`Always allow`,reject_once:`Deny once`,reject_always:`Always deny`},x={allow_once:`allow-once`,allow_always:`allow-always`,reject_once:`deny-once`,reject_always:`deny-always`},S=[{value:`always-allow`,label:`Always allow`,detail:`Auto-allow gated tools`,tone:`allow`},{value:`ask`,label:`Ask first`,detail:`Review each gated tool`,tone:`ask`},{value:`always-deny`,label:`Always deny`,detail:`Auto-deny gated tools`,tone:`deny`}],C={ask:`Review each gated tool`,"always-allow":`Auto-allow gated tools`,"always-deny":`Auto-deny gated tools`},w={allow_once:/^(allow[_\s-]?once|allow once)$/i,allow_always:/^(allow[_\s-]?always|always allow|always approve)$/i,reject_once:/^(reject[_\s-]?once|deny[_\s-]?once|reject|deny)$/i,reject_always:/^(reject[_\s-]?always|deny[_\s-]?always|always reject|always deny)$/i};function T(e){return[e.kind,e.optionId,e.id,e.name,e.label].map(e=>String(e??``)).join(` `).trim()}function E(e){let t=e.optionId??e.id;return t==null||t===``?null:String(t)}function D(e,t){let n=e.name??e.label;return n==null||n===``?b[t]:String(n)}function O(e,t){let n=e.find(e=>e.kind===t),r=e.find(e=>e.optionId===t||e.id===t),i=e.find(e=>w[t].test(T(e))),a=n??r??i;if(!a)return null;let o=E(a);return o?{kind:t,optionId:o,label:D(a,t),raw:a}:null}function k(e){return String(e.toolName??e.title??e.name??`tool`)}function A(e,t){let n={permissionId:e.permissionId,toolName:k(e.toolCall),...t};return{role:`permission`,text:n.error??n.optionLabel??n.decision,permissionAudit:n}}function j(e){if(typeof e==`string`)return e;try{return JSON.stringify(e,null,2)}catch{return String(e)}}function M(e){if(!Array.isArray(e))return null;let t=[];for(let n of e){if(typeof n==`string`){n&&t.push(n);continue}if(!n||typeof n!=`object`||Array.isArray(n))continue;let e=n,r=typeof e.type==`string`?e.type.toLowerCase():``,i=e.text;(!r||r===`text`)&&typeof i==`string`&&i&&t.push(i)}return t.length>0?t.join(`
3
+ `):null}function ee(e){if(typeof e==`string`)return e;if(!e||typeof e!=`object`||Array.isArray(e))return null;let t=e,n=M(t.content);if(n)return n;let r=t.details;if(r&&typeof r==`object`&&!Array.isArray(r)){let e=r.displayContent;if(e&&typeof e==`object`&&!Array.isArray(e)){let t=e.text;if(typeof t==`string`&&t)return t}}return null}function N(e){return ee(e)??j(e)}function P(e){if(typeof e==`string`)return{type:`text`,text:e};if(!e||typeof e!=`object`||Array.isArray(e))return null;let t=e,n=typeof t.type==`string`?t.type.toLowerCase():``,r=typeof t.label==`string`?t.label:void 0;if(n===`diff`&&typeof t.diff==`string`)return{type:`diff`,diff:t.diff,...r?{label:r}:{}};if(n===`error`)return{type:`error`,text:j(t.text??t.error??t.message??t),...r?{label:r}:{}};if(n===`args`||n===`arguments`||n===`input`)return{type:`args`,json:t.json??t.args??t.arguments??t.input??t,...r?{label:r}:{}};if(n===`output`)return{type:`output`,text:N(t.text??t.output??t),...r?{label:r}:{}};if(n===`json`)return{type:`json`,json:t.json??t.value??t,...r?{label:r}:{}};if(typeof t.diff==`string`)return{type:`diff`,diff:t.diff,...r?{label:r}:{}};if(typeof t.text==`string`)return{type:`text`,text:t.text,...r?{label:r}:{}};let i=ee(t);return i?{type:`text`,text:i,...r?{label:r}:{}}:{type:`json`,json:t,...r?{label:r}:{}}}function F(e,t,n,r){r==null||r===``||(t===`args`||t===`json`?e.push({type:t,label:n,json:r}):e.push({type:t,label:n,text:t===`output`?N(r):j(r)}))}function te(e){let t=[],n=e.content;if(Array.isArray(n))for(let e of n){let n=P(e);n&&t.push(n)}else{let e=P(n);e&&t.push(e)}return F(t,`args`,`Args`,e.args??e.arguments??e.input??e.rawInput),F(t,`output`,`Output`,e.rawOutput??e.output),F(t,`error`,`Error`,e.error??e.errorMessage??e.reason),t}var I={settings:{category:`settings`,popupKind:`settings`},theme:{category:`settings`,popupKind:`settings`},identity:{category:`settings`,popupKind:`settings`},"identity-auto":{category:`settings`,popupKind:`settings`},model:{category:`model`,popupKind:`model`},provider:{category:`provider`,popupKind:`provider`},login:{category:`provider`,popupKind:`provider`}},L={session:`session`,orchestrate:`workflow`,pabcd:`workflow`,goal:`workflow`,mcp:`utility`,move:`utility`,compact:`utility`,dump:`utility`,help:`utility`};function ne(e){return e.trim().replace(/^\/+/,``)}function R(e,t){let n=typeof e.source==`string`?e.source:``,r=typeof e.path==`string`?e.path:``;return n.includes(`skill`)||t.includes(`:`)?`jwc-skill`:n.includes(`custom`)?`jwc-custom`:n.includes(`file`)||r?`jwc-file`:I[t]||L[t]?`jwc-builtin`:`unknown`}function z(e){let t=e.input;if(!t||typeof t!=`object`)return;let n=t.hint;return typeof n==`string`&&n.trim()?n:void 0}function B(e){if(!e||typeof e!=`object`)return null;let t=e,n=ne(String(t.name??``));if(!n)return null;let r=I[n],i=r?.category??L[n]??`unknown`,a=R(t,n),o=t.supported!==!1&&t.disabled!==!0?r?`popup`:i===`unknown`?`pass-through`:`insert`:`unsupported`,s=typeof t.description==`string`&&t.description.trim()?t.description:void 0,c=z(t),l={name:n,displayName:`/${n}`,category:i,actionType:o,source:a,raw:t};return s&&(l.description=s),c&&(l.inputHint=c),r&&(l.popupKind=r.popupKind),o===`unsupported`&&(l.disabledReason=typeof t.disabledReason==`string`&&t.disabledReason.trim()?t.disabledReason:`Unsupported in Code mode`),l}function re(e){let t=Array.isArray(e)?e:[],n=new Set,r=[];for(let e of t){let t=B(e);!t||n.has(t.name)||(n.add(t.name),r.push(t))}return r}function V(e){return[e.name,e.displayName,e.description??``,e.inputHint??``,e.category,e.source].join(` `).toLowerCase()}function ie(e,t){let n=ne(t.split(/\s+/)[0]??``).toLowerCase();if(!n)return e;let r=[],i=[];for(let t of e)t.name.toLowerCase().startsWith(n)?r.push(t):V(t).includes(n)&&i.push(t);return[...r,...i]}function ae({value:e,disabled:t,onChange:n}){let r=S.find(t=>t.value===e)??S[0];return(0,h.jsxs)(`div`,{className:`code-permission-mode-field`,children:[(0,h.jsxs)(`div`,{className:`code-permission-mode-label`,children:[(0,h.jsx)(`span`,{children:`Permission mode`}),(0,h.jsx)(`strong`,{children:`Default: Always allow`})]}),(0,h.jsx)(`div`,{className:`code-permission-mode-list`,role:`listbox`,"aria-label":`Permission mode`,children:S.map(r=>(0,h.jsxs)(`button`,{type:`button`,role:`option`,"aria-selected":r.value===e,disabled:t,className:`code-permission-mode-option is-${r.tone}${r.value===e?` is-selected`:``}`,title:r.detail,onClick:()=>n(r.value),children:[(0,h.jsxs)(`span`,{children:[(0,h.jsx)(`strong`,{children:r.label}),(0,h.jsx)(`small`,{children:r.detail})]}),r.value===e&&(0,h.jsx)(`em`,{"aria-hidden":`true`,children:`✓`})]},r.value))}),(0,h.jsx)(`p`,{className:`code-permission-mode-note is-${r?.tone??`ask`}`,children:`Automatic modes answer with JWC persistent options and write a transcript audit row.`})]})}function oe(e){return e===`provider`?`Provider`:e===`model`?`Model`:e===`permission`?`Permissions`:e===`session`?`Session`:`Settings`}function H(e){return e===`jwc-cache`?`JWC cache`:`static fallback`}function se({popupKind:e,command:t,modelOptions:n,provider:r,model:i,modelAssignments:a,modelPresets:o,permissionMode:s,disabled:c,activeSessionId:l,error:u,onClose:d,onRefreshProviders:p,onProviderChange:m,onUseModel:g,onUseForNewSessions:_,onSetDefaultModel:v,onSetModelAssignment:y,onClearModelAssignment:b,onPermissionModeChange:x}){let S=(0,f.useRef)(null),C=(0,f.useRef)(null),w=n.providers.find(e=>e.id===r)??n.providers[0],[T,E]=(0,f.useState)(``),[D,O]=(0,f.useState)(`models`),[k,A]=(0,f.useState)(r),[j,M]=(0,f.useState)(i),[ee,N]=(0,f.useState)({}),P=n.providers.find(e=>e.id===k)??w,F=T.trim().toLowerCase(),te=(0,f.useMemo)(()=>n.providers.filter(e=>F?e.id.toLowerCase().includes(F)||e.models.some(e=>e.toLowerCase().includes(F)):!0),[n.providers,F]),I=(0,f.useMemo)(()=>{let e=P?.models??[];return F?e.filter(e=>e.toLowerCase().includes(F)):e},[P?.models,F]),L=oe(e),ne=(0,f.useMemo)(()=>{let e=n.providers.length;return`${e} authenticated provider${e===1?``:`s`}`},[n.providers.length]),R=!!(l&&k&&j&&!c),z=!!(k&&j&&!c),B=(0,f.useMemo)(()=>[`inherit`,...P?.efforts??[]].map(e=>e===`min`?`minimal`:e).filter((e,t,n)=>e&&n.indexOf(e)===t).map(e=>({value:e,label:e===`inherit`?`inherit`:e===`minimal`?`min`:e})),[P?.efforts]);return(0,f.useEffect)(()=>{S.current?.focus()},[e,t.name]),(0,f.useEffect)(()=>{let e=document.activeElement;return()=>{e?.focus?.()}},[]),(0,f.useEffect)(()=>{e===`model`&&(E(``),A(r),M(i))},[i,e,r]),(0,f.useEffect)(()=>{if(e!==`model`)return;let t=P?.models??[];t.length>0&&!t.includes(j)&&M(t[0]??``)},[j,P?.models,e]),(0,f.useEffect)(()=>{if(e!==`model`||!a)return;let t={};for(let e of a.roles){let n=e.thinkingLevel===`min`?`minimal`:e.thinkingLevel;t[e.role]=n||`inherit`}N(t)},[a,e]),(0,f.useEffect)(()=>{let e=e=>{if(e.key===`Escape`){e.preventDefault(),d();return}if(e.key===`Tab`&&C.current){let t=C.current.querySelectorAll(`a[href], button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])`),n=t[0],r=t[t.length-1];if(!n||!r)return;let i=document.activeElement;e.shiftKey&&i===n?(e.preventDefault(),r.focus()):!e.shiftKey&&i===r&&(e.preventDefault(),n.focus())}};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[d]),(0,h.jsx)(`div`,{className:`code-popup-backdrop`,role:`presentation`,onMouseDown:e=>{e.target===e.currentTarget&&d()},children:(0,h.jsxs)(`section`,{ref:C,className:`code-popup`,role:`dialog`,"aria-modal":`true`,"aria-labelledby":`code-command-popup-title`,children:[(0,h.jsxs)(`header`,{className:`code-popup-header`,children:[(0,h.jsxs)(`div`,{children:[(0,h.jsx)(`p`,{className:`code-popup-command`,children:t.displayName}),(0,h.jsx)(`h2`,{id:`code-command-popup-title`,children:L})]}),(0,h.jsx)(`button`,{ref:S,type:`button`,className:`code-popup-close`,onClick:d,"aria-label":`Close popup`,children:`x`})]}),e===`provider`&&(0,h.jsxs)(`div`,{className:`code-popup-section`,children:[(0,h.jsxs)(`div`,{className:`code-popup-section-head`,children:[(0,h.jsx)(`span`,{children:ne}),(0,h.jsx)(`button`,{type:`button`,className:`code-popup-secondary`,disabled:c,onClick:p,children:`Refresh`})]}),n.degraded&&(0,h.jsx)(`p`,{className:`code-popup-warning`,children:n.error??`Provider discovery is degraded.`}),u&&(0,h.jsx)(`p`,{className:`code-popup-error`,children:u}),(0,h.jsx)(`div`,{className:`code-provider-list`,role:`list`,children:n.providers.map(e=>(0,h.jsxs)(`button`,{type:`button`,className:`code-provider-row${e.id===r?` is-selected`:``}`,onClick:()=>m(e.id),disabled:c,children:[(0,h.jsx)(`span`,{className:`code-provider-name`,children:e.id}),(0,h.jsxs)(`span`,{className:`code-provider-meta`,children:[e.models.length,` models · `,H(e.modelSource)]})]},e.id))}),(0,h.jsxs)(`div`,{className:`code-popup-placeholder-actions`,children:[(0,h.jsx)(`button`,{type:`button`,disabled:!0,className:`code-popup-secondary`,children:`Add provider`}),(0,h.jsx)(`button`,{type:`button`,disabled:!0,className:`code-popup-secondary`,children:`Login`}),(0,h.jsx)(`span`,{children:`Provider add/login execution is next slice.`})]})]}),(e===`settings`||e===`permission`)&&(0,h.jsxs)(`div`,{className:`code-popup-section`,children:[(0,h.jsx)(ae,{value:s,disabled:!!c,onChange:x}),e===`settings`&&(0,h.jsxs)(`div`,{className:`code-popup-summary`,children:[(0,h.jsx)(`span`,{children:`Provider`}),(0,h.jsx)(`strong`,{children:r||`-`}),(0,h.jsx)(`span`,{children:`Model`}),(0,h.jsx)(`strong`,{children:i||`-`})]})]}),e===`model`&&(0,h.jsxs)(`div`,{className:`code-popup-section`,children:[u&&(0,h.jsx)(`p`,{className:`code-popup-error`,children:u}),(0,h.jsx)(`div`,{className:`code-model-tablist`,role:`tablist`,"aria-label":`Model settings tabs`,children:[`models`,`roles`,`profiles`].map(e=>(0,h.jsx)(`button`,{type:`button`,role:`tab`,id:`code-model-tab-${e}`,"aria-selected":D===e,"aria-controls":`code-model-panel-${e}`,tabIndex:D===e?0:-1,className:`code-model-tab${D===e?` is-active`:``}`,onClick:()=>O(e),onKeyDown:e=>{if(e.key!==`ArrowRight`&&e.key!==`ArrowLeft`)return;e.preventDefault();let t=[`models`,`roles`,`profiles`],n=e.key===`ArrowRight`?1:t.length-1;O(t[(t.indexOf(D)+n)%t.length]??`models`)},children:e===`models`?`Models`:e===`roles`?`Roles`:`Profiles`},e))}),D===`models`&&(0,h.jsxs)(`div`,{className:`code-popup-tabpanel`,role:`tabpanel`,id:`code-model-panel-models`,"aria-labelledby":`code-model-tab-models`,children:[(0,h.jsxs)(`label`,{className:`code-popup-field`,children:[(0,h.jsx)(`span`,{children:`Search models`}),(0,h.jsx)(`input`,{type:`search`,className:`code-model-search`,placeholder:`Search provider or model`,value:T,onChange:e=>E(e.target.value),disabled:c})]}),n.usageOrder&&n.usageOrder.length>0&&(0,h.jsxs)(`div`,{className:`code-model-mru-strip`,"aria-label":`Recently used models`,children:[(0,h.jsx)(`span`,{children:`Recently used`}),n.usageOrder.slice(0,3).map(e=>(0,h.jsx)(`strong`,{children:e},e))]}),(0,h.jsxs)(`div`,{className:`code-model-layout`,children:[(0,h.jsx)(`div`,{className:`code-model-providers`,role:`list`,"aria-label":`Providers`,children:te.map(e=>(0,h.jsxs)(`button`,{type:`button`,className:`code-model-provider${e.id===k?` is-selected`:``}`,onClick:()=>{A(e.id),M(e.models[0]??``)},disabled:c,children:[(0,h.jsx)(`span`,{children:e.id}),(0,h.jsx)(`small`,{children:e.models.length})]},e.id))}),(0,h.jsxs)(`div`,{className:`code-model-list`,role:`list`,"aria-label":`Models`,children:[(0,h.jsxs)(`div`,{className:`code-model-list-head`,children:[(0,h.jsx)(`strong`,{children:P?.id??`No provider`}),(0,h.jsxs)(`span`,{children:[I.length,` models · `,H(P?.modelSource)]})]}),I.length===0?(0,h.jsx)(`p`,{className:`code-popup-note`,children:`No models match this search.`}):I.map(e=>{let t=k===r&&e===i,n=e===j;return(0,h.jsxs)(`button`,{type:`button`,className:`code-model-row${t?` is-active`:``}${n?` is-draft`:``}`,onClick:()=>M(e),disabled:c,children:[(0,h.jsx)(`span`,{children:e}),(0,h.jsx)(`small`,{children:t?`Active`:n?`Selected`:`Available`})]},e)})]})]}),(0,h.jsxs)(`div`,{className:`code-popup-action-row`,children:[(0,h.jsxs)(`div`,{className:`code-popup-summary code-popup-summary-compact`,children:[(0,h.jsx)(`span`,{children:`Active`}),(0,h.jsxs)(`strong`,{children:[r||`-`,` / `,i||`-`]}),(0,h.jsx)(`span`,{children:`Selected`}),(0,h.jsxs)(`strong`,{children:[k||`-`,` / `,j||`-`]}),(0,h.jsx)(`span`,{children:`Default`}),(0,h.jsxs)(`strong`,{children:[n.defaultProvider||`-`,` / `,n.defaultModel||`-`]})]}),(0,h.jsxs)(`div`,{className:`code-popup-action-stack`,children:[(0,h.jsx)(`button`,{type:`button`,className:`code-popup-primary`,disabled:!R,onClick:()=>{g(k,j)},children:`Use now`}),(0,h.jsx)(`button`,{type:`button`,className:`code-popup-secondary`,disabled:!z,onClick:()=>{_(k,j)},children:`Use for new sessions`}),(0,h.jsx)(`button`,{type:`button`,className:`code-popup-secondary`,disabled:!z,onClick:()=>{v(k,j)},children:`Set default`})]})]}),!l&&(0,h.jsx)(`p`,{className:`code-popup-note`,children:`Start or load a Code session to apply a live model. Use “Use for new sessions” to set the next session’s model.`})]}),D===`roles`&&(0,h.jsx)(`div`,{className:`code-popup-tabpanel`,role:`tabpanel`,id:`code-model-panel-roles`,"aria-labelledby":`code-model-tab-roles`,children:(0,h.jsxs)(`div`,{className:`code-role-assignment-panel`,"aria-label":`Model role assignments`,children:[(0,h.jsxs)(`div`,{className:`code-role-assignment-head`,children:[(0,h.jsx)(`strong`,{children:`Role assignments`}),(0,h.jsx)(`span`,{children:a?.activeModel.note??`Role assignments do not mutate the active Code session model.`})]}),(0,h.jsx)(`div`,{className:`code-role-assignment-grid`,role:`list`,children:(a?.roles??[]).map(e=>{let t=e.modelId?e.modelId:`Unset`,n=ee[e.role]??(e.thinkingLevel===`min`?`minimal`:e.thinkingLevel)??`inherit`,r=!!(k&&j&&!c),i=!!(e.modelId&&!c);return(0,h.jsxs)(`article`,{className:`code-role-card`,role:`listitem`,children:[(0,h.jsxs)(`div`,{className:`code-role-card-head`,children:[(0,h.jsx)(`span`,{className:`code-role-tag`,children:e.tag}),(0,h.jsx)(`strong`,{children:e.name})]}),(0,h.jsx)(`p`,{className:`code-role-path`,children:e.settingsPath}),(0,h.jsx)(`p`,{className:`code-role-model`,title:t,children:t}),(0,h.jsxs)(`label`,{className:`code-role-thinking`,children:[(0,h.jsx)(`span`,{children:`Thinking`}),(0,h.jsx)(`select`,{value:n,disabled:c,onChange:t=>{let n=t.target.value;N(t=>({...t,[e.role]:n}))},children:B.map(e=>(0,h.jsx)(`option`,{value:e.value,children:e.label},e.value))})]}),(0,h.jsxs)(`div`,{className:`code-role-actions`,children:[(0,h.jsx)(`button`,{type:`button`,className:`code-popup-secondary`,disabled:!r,onClick:()=>{y(e.role,k,j,n===`inherit`?null:n)},children:`Assign selected`}),(0,h.jsx)(`button`,{type:`button`,className:`code-popup-secondary`,disabled:!i,onClick:()=>{b(e.role)},children:`Clear`})]})]},e.role)})}),!a&&(0,h.jsx)(`p`,{className:`code-popup-note`,children:`Loading role assignments.`})]})}),D===`profiles`&&(0,h.jsx)(`div`,{className:`code-popup-tabpanel`,role:`tabpanel`,id:`code-model-panel-profiles`,"aria-labelledby":`code-model-tab-profiles`,children:(0,h.jsxs)(`div`,{className:`code-model-preset-panel`,"aria-label":`Model profiles and presets`,children:[(0,h.jsxs)(`div`,{className:`code-role-assignment-head`,children:[(0,h.jsx)(`strong`,{children:`Profiles and presets`}),(0,h.jsx)(`span`,{children:o?.applyReason??`Loading JWC profile state.`})]}),(0,h.jsxs)(`div`,{className:`code-model-preset-summary`,children:[(0,h.jsx)(`span`,{children:`Startup profile`}),(0,h.jsx)(`strong`,{children:o?.defaultProfile??`Unset`}),(0,h.jsx)(`span`,{children:`Task presets`}),(0,h.jsx)(`strong`,{children:o?o.taskPresets.length:`-`}),(0,h.jsx)(`span`,{children:`Built-in profiles`}),(0,h.jsx)(`strong`,{children:o?o.builtinProfiles.length:`-`})]}),o&&o.taskPresets.length>0&&(0,h.jsx)(`div`,{className:`code-model-preset-list`,role:`list`,"aria-label":`Task model presets`,children:o.taskPresets.slice(0,4).map(e=>(0,h.jsxs)(`div`,{className:`code-model-preset-row`,role:`listitem`,children:[(0,h.jsx)(`strong`,{children:e.name}),(0,h.jsx)(`span`,{children:e.best?`best ${e.best}`:`best unset`}),(0,h.jsx)(`span`,{children:e.cheap?`cheap ${e.cheap}`:`cheap unset`})]},e.name))}),o&&(0,h.jsx)(`div`,{className:`code-model-profile-chips`,"aria-label":`Built-in profile candidates`,children:o.builtinProfiles.slice(0,8).map(e=>(0,h.jsx)(`span`,{children:e.name},e.name))}),(0,h.jsxs)(`div`,{className:`code-popup-placeholder-actions`,children:[(0,h.jsx)(`button`,{type:`button`,disabled:!0,className:`code-popup-secondary`,children:`Apply profile`}),(0,h.jsx)(`span`,{children:`Profile activation is read-only here; JWC runtime owns credential checks and rollback.`})]})]})})]})]})})}function U(e,t,n){return n<=0?0:(e+t+n)%n}function ce(e){return e.disabledReason?`Disabled`:e.actionType===`popup`?e.popupKind?`${e.popupKind} popup`:`Popup`:e.actionType===`pass-through`?`Pass-through`:e.actionType===`unsupported`?`Unsupported`:`Insert`}function le(e){let[t,n]=(0,f.useState)(0),r=(0,f.useMemo)(()=>ie(e.availableCommands,e.inputText).slice(0,10),[e.availableCommands,e.inputText]),i=r[t],a=i?`code-command-option-${i.name.replace(/[^a-z0-9_-]/gi,`-`)}`:void 0;(0,f.useEffect)(()=>{n(0)},[e.inputText,e.availableCommands]),(0,f.useEffect)(()=>{t>=r.length&&n(Math.max(0,r.length-1))},[t,r.length]);let o=t=>{!t||t.disabledReason||e.onCommandSelect(t)};return(0,h.jsxs)(`div`,{className:`code-composer`,children:[e.showCommands&&r.length>0&&(0,h.jsx)(`div`,{className:`code-command-palette`,role:`listbox`,"aria-label":`Code commands`,id:`code-command-palette`,children:r.map((e,r)=>{let i=r===t;return(0,h.jsxs)(`button`,{id:`code-command-option-${e.name.replace(/[^a-z0-9_-]/gi,`-`)}`,type:`button`,role:`option`,"aria-selected":i,"aria-disabled":e.disabledReason?!0:void 0,className:`code-command-item${i?` is-active`:``}${e.disabledReason?` is-disabled`:``}`,onMouseEnter:()=>n(r),onClick:()=>o(e),children:[(0,h.jsxs)(`span`,{className:`code-command-row-main`,children:[(0,h.jsx)(`span`,{className:`code-command-name`,children:e.displayName}),e.description&&(0,h.jsx)(`span`,{className:`code-command-desc`,children:e.description})]}),(0,h.jsxs)(`span`,{className:`code-command-row-meta`,children:[(0,h.jsx)(`span`,{className:`code-command-chip`,children:e.category}),(0,h.jsx)(`span`,{className:`code-command-chip`,children:e.source}),(0,h.jsx)(`span`,{className:`code-command-chip`,children:ce(e)})]})]},e.name)})}),(0,h.jsxs)(`div`,{className:`code-composer-input-shell`,children:[(0,h.jsx)(`textarea`,{className:`code-composer-input`,value:e.inputText,onChange:t=>e.onInputChange(t.target.value),onKeyDown:t=>{if(t.key===`Escape`&&e.showCommands){t.preventDefault(),e.onShowCommandsChange(!1);return}if(e.showCommands&&r.length>0){if(t.key===`ArrowDown`){t.preventDefault(),n(e=>U(e,1,r.length));return}if(t.key===`ArrowUp`){t.preventDefault(),n(e=>U(e,-1,r.length));return}if(t.key===`Enter`&&!t.shiftKey){t.preventDefault(),o(i);return}}t.key===`Enter`&&!t.shiftKey&&(t.preventDefault(),e.onSubmit())},"aria-controls":e.showCommands?`code-command-palette`:void 0,"aria-activedescendant":e.showCommands?a:void 0,"aria-expanded":e.showCommands,placeholder:`Describe a task or ask a question...`,rows:1,disabled:e.sending}),(0,h.jsx)(`span`,{className:`code-composer-hint`,children:`Enter to send · / for commands`})]}),(0,h.jsx)(`button`,{type:`button`,className:`code-composer-send`,onClick:e.onSubmit,disabled:!e.inputText.trim()||e.sending,"aria-label":`Send prompt`,children:`Send`})]})}function W({permissions:e,onAnswer:t}){return e.length===0?null:(0,h.jsx)(`div`,{className:`code-permissions`,children:e.map(e=>(0,h.jsxs)(`div`,{className:`code-permission-card`,children:[(0,h.jsxs)(`div`,{className:`code-permission-title`,children:[(0,h.jsx)(`span`,{children:`Permission request`}),(0,h.jsx)(`strong`,{children:k(e.toolCall)}),(0,h.jsxs)(`small`,{children:[e.options.length,` JWC options`]})]}),(0,h.jsx)(`div`,{className:`code-permission-actions`,children:y.map(n=>{let r=O(e.options,n),i=x[n];return(0,h.jsx)(`button`,{type:`button`,className:`code-permission-btn is-${i}`,disabled:!r,title:r?r.optionId:`${b[n]} option was not provided by JWC`,onClick:()=>t(e,n),children:r?.label??b[n]},n)})})]},e.permissionId))})}var ue=92,de=6;function fe(e){let[{virtualItems:t,totalSize:s},c]=(0,f.useState)({virtualItems:[],totalSize:0}),l=(0,f.useRef)(null);l.current||=new o({count:e.count,getScrollElement:()=>e.scrollElementRef.current,estimateSize:e.estimateSize||(()=>ue),overscan:de,getItemKey:e.getItemKey,indexAttribute:`data-code-transcript-idx`,useAnimationFrameWithResizeObserver:!0,observeElementRect:n,observeElementOffset:r,scrollToFn:i,measureElement:a,onChange:e=>{c({virtualItems:e.getVirtualItems(),totalSize:e.getTotalSize()})}});let u=l.current;return(0,f.useEffect)(()=>u._didMount(),[u]),(0,f.useEffect)(()=>{u.measure()},[u,e.resetKey]),(0,f.useEffect)(()=>()=>{l.current=null},[]),(0,f.useLayoutEffect)(()=>{u.setOptions({...u.options,count:e.count,getItemKey:e.getItemKey,estimateSize:e.estimateSize||(()=>ue)}),u._willUpdate(),c({virtualItems:u.getVirtualItems(),totalSize:u.getTotalSize()})},[e.count,e.estimateSize,e.getItemKey,u]),{measureElement:e=>{e&&u.measureElement(e)},virtualItems:t,totalSize:s}}var G=2e3,pe=80,K=400;function me(e){if(e<=G)return pe;let t=e/G*pe;return Math.min(K,Math.round(t))}function he(e){let[t,n]=(0,f.useState)(e),r=(0,f.useRef)(0),i=(0,f.useRef)(null);return(0,f.useEffect)(()=>{if(!(e.length>=t.length&&e.startsWith(t))){i.current!==null&&(window.clearTimeout(i.current),i.current=null),r.current=Date.now(),n(e);return}if(e===t)return;let a=me(e.length),o=Date.now()-r.current;if(o>=a){r.current=Date.now(),n(e);return}i.current!==null&&window.clearTimeout(i.current),i.current=window.setTimeout(()=>{i.current=null,r.current=Date.now(),n(e)},a-o)},[e,t]),(0,f.useEffect)(()=>()=>{i.current!==null&&window.clearTimeout(i.current)},[]),t}var ge=(0,f.lazy)(()=>t(()=>import(`./MarkdownRenderer-DZVh_xX2.js`).then(e=>({default:e.MarkdownRenderer})),__vite__mapDeps([0])));function _e({text:e,onOpenLocalFile:t}){let n=he(e);return(0,h.jsx)(f.Suspense,{fallback:(0,h.jsx)(`span`,{children:n}),children:(0,h.jsx)(ge,{markdown:n,tableMode:`linear`,onLocalFileOpen:t})})}function q(e,t){let n=e.label??(e.type===`args`?`Args`:e.type===`output`?`Output`:e.type===`error`?`Error`:``),r=`code-tool-${e.type}`,i=e.type===`diff`&&e.diff?e.diff:e.type===`json`||e.type===`args`?JSON.stringify(e.json??e,null,2):e.text??JSON.stringify(e,null,2);return n?(0,h.jsxs)(`div`,{className:`code-tool-section`,children:[(0,h.jsx)(`span`,{className:`code-tool-section-label`,children:n}),(0,h.jsx)(`pre`,{className:r,children:i})]},t):e.type===`diff`&&e.diff?(0,h.jsx)(`pre`,{className:`code-tool-diff`,children:e.diff},t):e.text?(0,h.jsx)(`pre`,{className:`code-tool-text`,children:e.text},t):(0,h.jsx)(`pre`,{className:r,children:i},t)}function ve(e){if(!(e instanceof HTMLElement))return!1;let t=e.tagName.toLowerCase();return t===`input`||t===`textarea`||t===`select`||e.isContentEditable}function J(e){return(e.toolContent?.find(e=>typeof e.text==`string`&&e.text.trim())?.text??e.toolOutput??``).replace(/\s+/g,` `).trim().slice(0,240)}function Y(e){return e.split(/\r?\n/)[0]?.replace(/\s+/g,` `).trim()??``}function X(e){let t=e.toolContent?.find(e=>e.type===`args`||e.type===`text`||e.type===`json`);if(!t)return null;if(typeof t.text==`string`){let e=Y(t.text);return e?{text:e,...t.type===`args`?{name:`bash`}:/^https?:\/\//.test(e)||e.startsWith(`/`)?{name:`read`}:{}}:null}if(typeof t.json==`string`){let e=Y(t.json);return e?{text:e,...t.type===`args`?{name:`bash`}:{}}:null}if(t.json&&typeof t.json==`object`&&!Array.isArray(t.json)){let e=t.json;for(let[t,n]of[[`command`,`bash`],[`cmd`,`bash`],[`path`,`read`],[`url`,`read`],[`file`,`read`],[`query`,`search`]]){let r=e[t];if(typeof r==`string`&&r.trim())return{name:n,text:Y(r)}}}return null}function Z(e){let t=Y(e.toolName||e.text||`tool`)||`tool`,n=X(e);return t.includes(`:`)||!n?t:t===`tool`?n.name?`${n.name}: ${n.text}`:n.text:`${t}: ${n.text}`}function ye(e){return e===`pending`?`Pending`:e===`allow_once`?`Allow once`:e===`allow_always`?`Always allow`:e===`reject_once`?`Deny once`:e===`reject_always`?`Always deny`:e===`missing_option`?`Missing JWC option`:e===`answer_error`?`Answer failed`:`Cancelled`}function be(e,t){return`${t}:${e.toolCallId||e.permissionAudit?.permissionId||`${e.role}:${e.text.slice(0,48)}`}`}function xe(e){return e?e.role===`tool`?e.toolStatus===`running`?44:64+Math.min(320,(e.toolOutput?.length??0)/5):e.role===`permission`?72:e.role===`thinking`?48+Math.min(180,e.text.length/8):56+Math.min(420,e.text.length/6):48}function Se(e,t,n){return(0,h.jsx)(`div`,{className:`code-message code-message-${e.role}`,children:e.role===`tool`?(()=>{let t=e.toolStatus??`done`,n=t===`failed`||t===`error`,r=n?J(e):``;return(0,h.jsxs)(`details`,{className:`code-tool-card code-tool-${t}`,open:t===`running`||n,children:[(0,h.jsxs)(`summary`,{className:`code-tool-summary`,children:[(0,h.jsx)(`span`,{className:`code-tool-chevron`,children:`>`}),(0,h.jsx)(`span`,{className:`code-tool-name`,children:Z(e)}),(0,h.jsx)(`span`,{className:`code-tool-status`,children:t})]}),r&&(0,h.jsx)(`div`,{className:`code-tool-error-snippet`,children:r}),(e.toolContent?.length??0)>0&&(0,h.jsx)(`div`,{className:`code-tool-content`,children:e.toolContent.map(q)}),e.toolOutput&&(0,h.jsxs)(`pre`,{className:`code-tool-output`,children:[e.toolOutput.slice(0,2e3),e.toolOutput.length>2e3?`...`:``]})]})})():e.role===`permission`&&e.permissionAudit?(()=>{let t=e.permissionAudit,n=t.decision.startsWith(`allow`)?`is-allow`:t.decision.startsWith(`reject`)?`is-deny`:``;return(0,h.jsxs)(`div`,{className:`code-permission-audit is-${t.decision} ${n}`.trim(),children:[(0,h.jsxs)(`div`,{className:`code-permission-audit-head`,children:[(0,h.jsx)(`span`,{children:`Permission`}),(0,h.jsx)(`strong`,{children:t.toolName}),(0,h.jsx)(`em`,{children:ye(t.decision)})]}),(0,h.jsxs)(`div`,{className:`code-permission-audit-meta`,children:[(0,h.jsxs)(`span`,{children:[`mode `,t.mode]}),(0,h.jsx)(`span`,{children:t.decisionMode}),t.optionId&&(0,h.jsx)(`span`,{children:t.optionId})]}),t.error&&(0,h.jsx)(`div`,{className:`code-permission-audit-error`,children:t.error})]})})():e.role===`thinking`?(0,h.jsxs)(`details`,{className:`code-thinking`,children:[(0,h.jsx)(`summary`,{className:`code-thinking-summary`,children:`Thinking...`}),(0,h.jsx)(`div`,{className:`code-thinking-text`,children:e.text})]}):(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(`span`,{className:`code-message-role`,children:e.role===`user`?`You`:`JWC`}),(0,h.jsx)(`div`,{className:`code-message-text`,children:e.role===`assistant`?(0,h.jsx)(_e,{text:e.text,onOpenLocalFile:n}):e.text})]})},t)}function Ce(){return(0,h.jsxs)(`div`,{className:`code-message code-message-assistant`,children:[(0,h.jsx)(`span`,{className:`code-message-role`,children:`JWC`}),(0,h.jsx)(`div`,{className:`code-message-text code-streaming`,children:`Thinking...`})]})}function Q({messages:e,sending:t,workingDir:n,transcriptRef:r,onOpenLocalFile:i,sessionId:a}){let o=t&&e[e.length-1]?.role!==`assistant`,s=e.length+ +!!o,c=(0,f.useRef)(e);c.current=e;let l=(0,f.useCallback)(e=>{let t=c.current[e];return t?be(t,e):`sending-${e}`},[]),u=(0,f.useCallback)(e=>xe(c.current[e]),[]),d=fe({count:s,resetKey:a??null,scrollElementRef:r,getItemKey:l,estimateSize:u});function p(e){if(ve(e.target))return;let t=r.current;if(!t)return;let n=e.key.toLowerCase(),i=Math.max(160,Math.floor(t.clientHeight*.78));n===`d`||n===`j`||e.key===`PageDown`?(e.preventDefault(),t.scrollBy({top:i,behavior:`smooth`})):n===`u`||n===`k`||e.key===`PageUp`?(e.preventDefault(),t.scrollBy({top:-i,behavior:`smooth`})):e.key===`End`?(e.preventDefault(),t.scrollTo({top:t.scrollHeight,behavior:`smooth`})):e.key===`Home`&&(e.preventDefault(),t.scrollTo({top:0,behavior:`smooth`}))}return(0,h.jsx)(`div`,{className:`code-transcript`,ref:r,role:`log`,"aria-live":`polite`,tabIndex:0,onKeyDown:p,children:e.length===0?(0,h.jsxs)(`div`,{className:`code-transcript-empty`,children:[(0,h.jsx)(`p`,{children:`Start a Code session by typing a prompt below.`}),(0,h.jsxs)(`p`,{className:`code-transcript-cwd`,children:[`cwd: `,n||`not set`]})]}):(0,h.jsx)(`div`,{className:`code-transcript-virtual-spacer`,style:{height:`${d.totalSize}px`},children:d.virtualItems.map(t=>{let n=e[t.index];return(0,h.jsx)(`div`,{ref:d.measureElement,className:`code-transcript-virtual-row`,"data-code-transcript-idx":t.index,style:{transform:`translateY(${t.start}px)`},children:n?Se(n,t.index,i):Ce()},t.key)})})})}function we(e){return e.split(`/`).filter(Boolean).slice(-2).join(`/`)||e}function Te({workingDir:e,gitInfo:t,modelOptions:n,sessionTitle:r,usage:i,planEntries:a,onWorkingDirChange:o,cwdLocked:s=!1,workspaceFrozen:c=!1,onPickWorkingDir:l}){let[u,d]=(0,f.useState)(!1),[p,m]=(0,f.useState)(``),g=t?.status?.dirty,_=t?.worktrees.length??0,v=c||s,y=!!(!v&&l&&o);async function b(){if(!(!y||!l)){d(!0),m(``);try{let e=await l();e&&o?.(e)}catch(e){m(e instanceof Error?e.message:String(e))}finally{d(!1)}}}return(0,h.jsxs)(`div`,{className:`code-workspace-header`,children:[(0,h.jsxs)(`div`,{className:`code-workspace-primary`,children:[v?(0,h.jsx)(`span`,{className:`code-workspace-chip`,title:e,"aria-label":`Current Code workspace: ${e}`,children:we(e||`/tmp`)}):(0,h.jsxs)(`button`,{type:`button`,className:`code-workspace-picker`,disabled:!y||u,title:e||`Select Code workspace folder`,"aria-label":`Code workspace: ${e||`not set`}. Choose a folder.`,onClick:()=>void b(),children:[(0,h.jsx)(`span`,{className:`code-workspace-picker-label`,children:we(e||`/tmp`)}),(0,h.jsx)(`span`,{className:`code-workspace-picker-caret`,"aria-hidden":`true`,children:`▾`})]}),!v&&p&&(0,h.jsx)(`span`,{className:`code-workspace-cwd-error`,children:p}),t?.isRepo&&(0,h.jsxs)(h.Fragment,{children:[(0,h.jsxs)(`span`,{className:`code-workspace-pill`,children:[t.branch??`detached`,t.head?` · ${t.head}`:``]}),(0,h.jsx)(`span`,{className:`code-workspace-pill ${g?`is-dirty`:``}`,children:g?`${t.status?.changed??0} changed · ${t.status?.untracked??0} untracked`:`clean`}),(0,h.jsxs)(`span`,{className:`code-workspace-pill`,title:t.currentWorktree?.path??void 0,children:[`worktree `,_]})]}),n?.degraded&&(0,h.jsx)(`span`,{className:`code-workspace-pill is-warning`,title:n.error,children:`provider fallback`})]}),(r||i.contextTokens!==void 0||a.length>0)&&(0,h.jsxs)(`div`,{className:`code-session-header`,children:[r&&(0,h.jsx)(`span`,{className:`code-session-title`,children:r}),i.contextTokens!==void 0&&i.contextLimit?(0,h.jsx)(`span`,{className:`code-context-meter`,title:`${i.contextTokens.toLocaleString()} / ${i.contextLimit.toLocaleString()} tokens${i.cost===void 0?``:` · $${i.cost.toFixed(4)}`}`,children:(0,h.jsx)(`span`,{className:`code-context-bar`,style:{width:`${Math.min(100,i.contextTokens/i.contextLimit*100)}%`}})}):null,a.length>0&&(0,h.jsx)(`div`,{className:`code-plan-entries`,children:a.map((e,t)=>(0,h.jsxs)(`span`,{className:`code-plan-entry code-plan-${e.status}`,children:[e.status===`completed`?`✓`:e.status===`in_progress`?`↻`:`○`,` `,e.title]},t))})]})]})}function Ee({label:e,value:t,options:n,disabled:r,title:i,className:a=``,onChange:o}){let s=(0,f.useId)(),c=(0,f.useRef)(null),[l,u]=(0,f.useState)(!1),d=n.find(e=>e.value===t)??n[0],p=Math.max(0,n.findIndex(e=>e.value===d?.value));(0,f.useEffect)(()=>{if(!l)return;let e=e=>{c.current?.contains(e.target)||u(!1)};return document.addEventListener(`pointerdown`,e),()=>document.removeEventListener(`pointerdown`,e)},[l]);let m=e=>{o(e),u(!1)};return(0,h.jsxs)(`div`,{ref:c,className:`code-footer-menu ${a}`.trim(),children:[(0,h.jsxs)(`button`,{type:`button`,className:`code-footer-menu-trigger`,disabled:r,title:i,"aria-label":e,"aria-haspopup":`listbox`,"aria-expanded":l,"aria-controls":s,onClick:()=>u(e=>!e),onKeyDown:e=>{if(!r){if(e.key===`Escape`){u(!1);return}if(e.key===`ArrowDown`||e.key===`ArrowUp`){e.preventDefault();let t=n[(p+(e.key===`ArrowDown`?1:-1)+n.length)%n.length];t&&m(t.value);return}(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),u(e=>!e))}},children:[(0,h.jsx)(`span`,{className:`code-footer-label`,children:e}),(0,h.jsx)(`strong`,{children:d?.label??t}),(0,h.jsx)(`span`,{className:`code-footer-chevron`,"aria-hidden":`true`,children:`⌃`})]}),l&&(0,h.jsx)(`div`,{id:s,className:`code-footer-dropup`,role:`listbox`,"aria-label":e,children:n.map(e=>(0,h.jsxs)(`button`,{type:`button`,className:`code-footer-dropup-option${e.value===t?` is-selected`:``}`,role:`option`,"aria-selected":e.value===t,onClick:()=>m(e.value),children:[(0,h.jsxs)(`span`,{children:[(0,h.jsx)(`strong`,{children:e.label}),e.detail&&(0,h.jsx)(`small`,{children:e.detail})]}),e.value===t&&(0,h.jsx)(`em`,{"aria-hidden":`true`,children:`✓`})]},e.value))})]})}function De({provider:e,providerOptions:t,model:n,modelOptions:r,effort:i,effortOptions:a,permissionMode:o,disabled:s,onProviderChange:c,onModelChange:l,onEffortChange:u,onPermissionModeChange:d}){return(0,h.jsxs)(`div`,{className:`code-composer-footer`,children:[(0,h.jsx)(Ee,{label:`Permission`,value:o,options:S,disabled:s,title:C[o],onChange:d}),t.length>0&&(0,h.jsx)(Ee,{label:`Provider`,value:e,options:t.map(e=>({value:e,label:e})),disabled:s,title:e,onChange:c}),(0,h.jsx)(Ee,{label:`Model`,value:n,options:r.map(e=>({value:e,label:e})),disabled:s,title:n,className:`code-footer-field-model`,onChange:l}),a.length>0&&(0,h.jsx)(Ee,{label:`Effort`,value:i,options:a.map(e=>({value:e,label:e})),disabled:s,title:i,onChange:u})]})}function Oe(e){return(0,h.jsxs)(`div`,{className:`code-canvas-main`,children:[(0,h.jsx)(Te,{gitInfo:e.gitInfo,modelOptions:e.modelOptions,sessionTitle:e.sessionTitle,usage:e.usage,planEntries:e.planEntries,workingDir:e.codeWorkingDir,cwdLocked:!!e.activeSessionId,onWorkingDirChange:e.onWorkingDirChange,workspaceFrozen:e.workspaceFrozen,onPickWorkingDir:e.onPickWorkingDir}),e.childRecovery&&(0,h.jsxs)(`section`,{className:`code-child-recovery`,role:`status`,"aria-live":`polite`,children:[(0,h.jsxs)(`div`,{children:[(0,h.jsx)(`span`,{children:`JWC child recovery`}),(0,h.jsxs)(`strong`,{children:[`ACP child exited: `,e.childRecovery.code]})]}),(0,h.jsx)(`p`,{children:e.childRecovery.message})]}),e.transportState!==`connected`&&(0,h.jsx)(`section`,{className:`code-transport-status is-${e.transportState}`,role:`status`,"aria-live":`polite`,children:e.transportState===`reconnecting`?`Live updates reconnecting…`:`Live updates disconnected — retrying.`}),(0,h.jsx)(Q,{messages:e.messages,sending:e.sending,workingDir:e.codeWorkingDir,transcriptRef:e.transcriptRef,onOpenLocalFile:e.onOpenLocalFile,sessionId:e.activeSessionId}),(0,h.jsx)(W,{permissions:e.permissions,onAnswer:e.onPermissionAnswer}),(0,h.jsx)(`div`,{className:`code-composer-dock`,children:(0,h.jsxs)(`div`,{className:`code-composer-surface`,"aria-label":`Code composer controls`,children:[(0,h.jsx)(le,{inputText:e.inputText,sending:e.sending,showCommands:e.showCommands,availableCommands:e.availableCommands,onInputChange:e.onInputChange,onCommandSelect:e.onCommandSelect,onSubmit:e.onSubmit,onShowCommandsChange:e.onShowCommandsChange}),(0,h.jsx)(De,{provider:e.provider,providerOptions:e.providerOptions,model:e.model,modelOptions:e.currentModelOptions,effort:e.effort,effortOptions:e.currentEffortOptions,permissionMode:e.permissionMode,disabled:e.disabled,onProviderChange:e.onFooterProviderChange,onModelChange:e.onModelChange,onEffortChange:e.onEffortChange,onPermissionModeChange:e.onPermissionModeChange})]})}),e.activePopup&&(0,h.jsx)(se,{popupKind:e.activePopup.kind,command:e.activePopup.command,modelOptions:e.modelOptions,provider:e.provider,model:e.model,modelAssignments:e.modelAssignments,modelPresets:e.modelPresets,permissionMode:e.permissionMode,disabled:e.disabled,activeSessionId:e.activeSessionId,error:e.error,onClose:e.onClosePopup,onRefreshProviders:e.onRefreshProviders,onProviderChange:e.onProviderChange,onUseModel:e.onUseModel,onUseForNewSessions:e.onUseForNewSessions,onSetDefaultModel:e.onSetDefaultModel,onSetModelAssignment:e.onSetModelAssignment,onClearModelAssignment:e.onClearModelAssignment,onPermissionModeChange:e.onPermissionModeChange})]})}var ke={providers:[{id:`anthropic`,models:[`claude-sonnet-4-6`,`claude-opus-5`,`claude-opus-4-8`,`claude-opus-4-7`,`claude-opus-4-6`,`claude-haiku-4-5`,`claude-fable-5`],efforts:[`off`,`min`,`low`,`medium`,`high`,`xhigh`]}],defaultProvider:`anthropic`,defaultModel:`claude-sonnet-4-6`,degraded:!0},Ae=re([{name:`/model`,description:`Choose provider, model, roles, thinking, profiles, and MRU state.`,source:`cli-jaw`},{name:`/provider`,description:`Review authenticated JWC providers.`,source:`cli-jaw`},{name:`/settings`,description:`Adjust Code mode session controls.`,source:`cli-jaw`}]);function je(e){let t=new Set,n=[];for(let r of[...e,...Ae])t.has(r.name)||(t.add(r.name),n.push(r));return n}function Me(e,t,n,r){if(r.appendMessage(A(n,{mode:t,decision:`pending`,decisionMode:t===`ask`?`pending`:`automatic`})),t===`ask`){r.enqueuePermission(n);return}let i=t===`always-allow`?`allow_always`:`reject_always`,a=O(n.options,i);if(!a){r.appendMessage(A(n,{mode:t,decision:`missing_option`,decisionMode:`system`,error:`${i} was not provided by JWC for this request.`})),r.enqueuePermission(n);return}(async()=>{try{await e.answerPermission(n.permissionId,a.optionId),r.appendMessage(A(n,{mode:t,decision:i,decisionMode:`automatic`,optionId:a.optionId,optionLabel:a.label}))}catch(e){r.appendMessage(A(n,{mode:t,decision:`answer_error`,decisionMode:`system`,optionId:a.optionId,optionLabel:a.label,error:e instanceof Error?e.message:String(e)}))}})()}async function Ne(e,t,n,r,i){let a=O(n.options,r);if(!a)return i(A(n,{mode:t,decision:`missing_option`,decisionMode:`system`,error:`${r} was not provided by JWC for this request.`})),!1;try{await e.answerPermission(n.permissionId,a.optionId),i(A(n,{mode:t,decision:r,decisionMode:`manual`,optionId:a.optionId,optionLabel:a.label}))}catch(e){i(A(n,{mode:t,decision:`answer_error`,decisionMode:`system`,optionId:a.optionId,optionLabel:a.label,error:e instanceof Error?e.message:String(e)}))}return!0}function Pe(e){let t=2166136261;for(let n=0;n<e.length;n+=1)t^=e.charCodeAt(n),t=Math.imul(t,16777619)>>>0;return t.toString(36)}var Fe=2e3,Ie=new Set([`code_user_message_chunk`,`code_agent_message_chunk`,`code_agent_thought_chunk`]);function Le(e){let t=e?.content;return String(t?.text??e?.text??``)}function $(e){let t=e?.messageId;return typeof t==`string`?t.trim():``}function Re(e,t){if(!Ie.has(e.event)||!t)return null;let n=$(e.update??{}),r=typeof e.sseEventId==`string`&&e.sseEventId.trim()?e.sseEventId.trim():``,i=n?`msg:${n}`:r?`sse:${r}`:``;return i?`${e.sessionId??``}:${e.event}:${i}:${t.length}:${Pe(t)}`:null}function ze(e,t){for(let n of t){let r=Re(n,Le(n.update));r&&u(e,r,Math.max(Fe,t.length))}}function Be(e,t,n){let r=Re(t,n);return r?e.has(r)?!0:(u(e,r,Fe),!1):!1}function Ve(e,t){let n=e.trim(),r=t.trim();return r.length<80?!1:n===r}var He=80,Ue=.7,We=.78,Ge=32,Ke=8;function qe(e){return e.replace(/\s+/g,` `).trim()}function Je(e){return e.split(/\r?\n/).map(e=>e.replace(/\s+/g,` `).trim()).filter(e=>e.length>=4)}function Ye(e,t){if(e.length===0)return 0;let n=0;for(let r of e)t.has(r)&&(n+=1);return n/e.length}function Xe(e){let t=qe(e);if(t.length<Ge)return[];let n=[];for(let e=0;e<=t.length-Ge;e+=Ke)n.push(t.slice(e,e+Ge));return n}function Ze(e,t){let n=qe(e),r=qe(t);if(n.length<He||r.length<He)return!1;if(r.includes(n))return!0;let i=Je(e),a=new Set(Je(t));if(i.length>=4&&Ye(i,a)>=Ue)return!0;let o=Xe(n);return o.length<3?!1:Ye(o,new Set(Xe(r)))>=We}function Qe(e,t){return!e||!t?`append`:e===t?`drop`:t.startsWith(e)?`replace`:e.startsWith(t)?`drop`:t.length>=e.length&&Ze(e,t)?`replace`:e.length>t.length&&Ze(t,e)?`drop`:`append`}function $e(e){let t=e.toLowerCase();return t===`failed`||t===`error`||t===`errored`?`failed`:t===`completed`||t===`done`||t===`success`?`done`:`running`}function et(e){let t=[];for(let n of e){let e=n.update??{};if(n.event===`code_user_message_chunk`){let n=e.content,r=String(n?.text??e.text??``),i=$(e);r&&t.push({role:`user`,text:r,...i?{messageId:i}:{}})}else if(n.event===`code_agent_message_chunk`){let n=e.content,r=String(n?.text??e.text??``);if(!r)continue;let i=$(e),a=t[t.length-1];if(a?.role===`assistant`){let e=Qe(a.text,r);if(a.messageId&&i&&a.messageId!==i){if(e===`replace`){a.text=r,a.messageId=i;continue}t.push({role:`assistant`,text:r,messageId:i});continue}if(e===`drop`)continue;a.text=e===`replace`?r:a.text+r,i&&!a.messageId&&(a.messageId=i)}else t.push({role:`assistant`,text:r,...i?{messageId:i}:{}})}else if(n.event===`code_agent_thought_chunk`){let n=e.content,r=String(n?.text??e.text??``);if(!r)continue;let i=$(e),a=t[t.length-1];a?.role===`thinking`&&(!a.messageId||!i||a.messageId===i)?(a.text+=r,i&&!a.messageId&&(a.messageId=i)):t.push({role:`thinking`,text:r,...i?{messageId:i}:{}})}else if(n.event===`code_tool_call`){let n=String(e.title??e.toolName??`tool`),r=String(e.toolCallId??``),i=String(e.status??`pending`),a=te(e);t.push({role:`tool`,text:n,toolName:n,toolCallId:r,toolContent:a,toolStatus:$e(i)})}else if(n.event===`code_tool_call_update`){let n=String(e.toolCallId??``),r=String(e.status??``),i=te(e),a=_(t,n);if(a<0)continue;let o={...t[a]};r&&(o.toolStatus=$e(r)),i.length>0&&(o.toolContent=i),t[a]=o}}return t}function tt(e){if(!(e instanceof HTMLElement))return!1;let t=e.tagName.toLowerCase();return t===`input`||t===`textarea`||t===`select`||e.isContentEditable}function nt(e,t,n){let r=(0,f.useRef)(null),i=(0,f.useMemo)(()=>{let t=e[e.length-1];if(!t)return`empty`;let n=t.toolContent?.reduce((e,t)=>{let n=t;return e+(n.text?.length??0)+(n.diff?.length??0)+(n.output?.length??0)},0)??0;return`${e.length}:${t.role}:${t.text.length}:${t.toolOutput?.length??0}:${n}:${t.toolStatus??``}`},[e]),a=(0,f.useRef)(null),o=(0,f.useRef)(null);(0,f.useEffect)(()=>()=>{a.current!==null&&cancelAnimationFrame(a.current),o.current!==null&&window.clearTimeout(o.current)},[]);let s=(0,f.useCallback)((e=`smooth`)=>{a.current===null&&(a.current=window.requestAnimationFrame(()=>{a.current=null;let t=r.current;t&&(t.scrollTo({top:t.scrollHeight,behavior:e}),o.current!==null&&window.clearTimeout(o.current),o.current=window.setTimeout(()=>{o.current=null;let e=r.current;e&&e.scrollTo({top:e.scrollHeight,behavior:`auto`})},80))}))},[]),c=(0,f.useCallback)((e,t=`smooth`)=>{window.requestAnimationFrame(()=>{let n=r.current;n&&n.scrollBy({top:e,behavior:t})})},[]),l=(0,f.useCallback)((e=`smooth`)=>{window.requestAnimationFrame(()=>{let t=r.current;t&&t.scrollTo({top:0,behavior:e})})},[]);return(0,f.useEffect)(()=>{s(e.length>1?`smooth`:`auto`)},[i,e.length,t,s]),(0,f.useEffect)(()=>{let e=e=>{if(e.defaultPrevented||n||e.metaKey||e.ctrlKey||e.altKey||tt(e.target))return;let t=r.current;if(!t)return;let i=e.key.toLowerCase(),a=Math.max(160,Math.floor(t.clientHeight*.78));i===`d`||i===`j`||e.key===`PageDown`?(e.preventDefault(),c(a)):i===`u`||i===`k`||e.key===`PageUp`?(e.preventDefault(),c(-a)):e.key===`End`?(e.preventDefault(),s(`smooth`)):e.key===`Home`&&(e.preventDefault(),l(`smooth`))};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[n,c,s,l]),{transcriptRef:r,scrollTranscriptToBottom:s}}function rt(e){return typeof window<`u`&&window.location.port===String(e)?`${window.location.origin}/api/events`:`http://127.0.0.1:${e}/api/events`}function it({port:e,sessionId:t,sessionIdRef:n,onEvent:r,onTransport:i}){let a=(0,f.useRef)(r);a.current=r;let o=(0,f.useRef)(i);o.current=i;let s=(0,f.useRef)(t);s.current=t,(0,f.useEffect)(()=>{if(!e)return;let t=new EventSource(rt(e));return t.onopen=()=>{o.current?.(`connected`)},t.onmessage=e=>{try{let t={...JSON.parse(e.data),sseEventId:e.lastEventId||void 0};if(t.topic!==`jwc`)return;let r=t.event===`code_child_exit`,i=n?.current??s.current;if(!i&&!r||!r&&t.sessionId&&t.sessionId!==i)return;a.current(t)}catch{}},t.onerror=()=>{o.current?.(t.readyState===EventSource.CLOSED?`disconnected`:`reconnecting`)},()=>t.close()},[e])}function at({port:e,workingDir:t,onWorkingDirChange:n,onOpenLocalFile:r}){let i=(0,f.useMemo)(()=>m(e),[e]),[a,o]=(0,f.useState)(t),[s,c]=(0,f.useState)(null),[l,u]=(0,f.useState)(!1),[y,b]=(0,f.useState)(``),[x,S]=(0,f.useState)(!1),[C,w]=(0,f.useState)([]),[T,E]=(0,f.useState)([]),[D,O]=(0,f.useState)(Ae),[k,A]=(0,f.useState)(!1),[j,M]=(0,f.useState)(null),[ee,N]=(0,f.useState)(``),[P,F]=(0,f.useState)(``),[I,L]=(0,f.useState)({}),[ne,R]=(0,f.useState)([]),[z,B]=(0,f.useState)(`anthropic`),[V,ie]=(0,f.useState)(`claude-sonnet-4-6`),[ae,oe]=(0,f.useState)(`high`),[H,se]=(0,f.useState)(`always-allow`),[U,ce]=(0,f.useState)(ke),[le,W]=(0,f.useState)(null),[ue,de]=(0,f.useState)(null),[fe,G]=(0,f.useState)(null),[pe,K]=(0,f.useState)(null),[me,he]=(0,f.useState)(`connected`),[ge,_e]=(0,f.useState)(null),q=(0,f.useRef)(null),ve=(0,f.useRef)(!1),J=(0,f.useRef)(null),Y=(0,f.useRef)(null),X=(0,f.useRef)(new Set),Z=(0,f.useRef)(new Set),ye=(0,f.useMemo)(()=>V?v(z,V):``,[z,V]),{transcriptRef:be,scrollTranscriptToBottom:xe}=nt(C,x,!!j);(0,f.useEffect)(()=>{q.current||s||o(t)},[s,t]);let Se=(0,f.useCallback)(e=>{q.current||s||l||(o(e??``),n?.(e))},[s,n,l]),Ce=(0,f.useCallback)(async()=>{let e=d();if(e?.folder?.pickFolder){let t=await e.folder.pickFolder();if(t.ok&&t.path)return t.path;if(t.error&&t.error!==`cancelled`)throw Error(t.error);return null}let t=await i.pickWorkspace();return t.ok&&t.path?t.path:null},[i]),Q=(0,f.useCallback)(e=>{ce(e);let t=e.providers.find(t=>t.id===e.defaultProvider)??e.providers[0],n=t?.models.includes(e.defaultModel)?e.defaultModel:t?.models[0]??``;B(t?.id??`anthropic`),ie(n);let r=t?.efforts??[];r.length>0&&oe(r.includes(`high`)?`high`:r[0]??``)},[]);(0,f.useEffect)(()=>{q.current=s},[s]),(0,f.useEffect)(()=>{if(typeof document>`u`){_e(null);return}return _e(document.getElementById(`code-session-sidebar-host`)),()=>_e(null)},[]);let we=(0,f.useCallback)(async()=>{Q(await i.listModelOptions())},[Q,i]),Te=(0,f.useCallback)(async()=>{W(await i.listModelAssignments())},[i]);(0,f.useEffect)(()=>{let e=!1;return(async()=>{try{let[t,n,r]=await Promise.all([i.listModelOptions(),i.listModelAssignments(),i.listModelPresets()]);if(e)return;Q(t),W(n),de(r)}catch(t){e||(ce({...ke,error:t instanceof Error?t.message:String(t)}),W(null),de(null))}})(),()=>{e=!0}},[Q,i]),(0,f.useEffect)(()=>{if(!a){G(null);return}let e=!1;return i.getGitInfo(a).then(t=>{e||G(t)},()=>{e||G(null)}),()=>{e=!0}},[i,a]),(0,f.useEffect)(()=>{if(ve.current){ve.current=!1;return}c(null),q.current=null,w([]),E([]),R([]),F(``),L({}),S(!1),K(null),Z.current=new Set},[a]),it({port:e,sessionId:s,sessionIdRef:q,onEvent:(0,f.useCallback)(e=>{let t=e.update??{},n=e.event;if(!(Y.current&&e.sessionId===Y.current&&n!==`code_child_exit`))if(n===`code_agent_message_chunk`){let n=Le(t);if(!n)return;let r=$(t);if(Be(Z.current,e,n))return;w(e=>{if(X.current.has(n)&&e[e.length-1]?.role===`user`)return X.current.delete(n),e;let t=e[e.length-1];if(t?.role===`assistant`&&Ve(t.text,n))return e;if(t?.role===`assistant`){let i=Qe(t.text,n);if(t.messageId&&r&&t.messageId!==r)return i===`replace`?[...e.slice(0,-1),{...t,text:n,messageId:r}]:[...e,{role:`assistant`,text:n,messageId:r}];if(i===`drop`)return e;let a=i===`replace`?n:t.text+n;return[...e.slice(0,-1),{...t,text:a,...r&&!t.messageId?{messageId:r}:{}}]}return[...e,{role:`assistant`,text:n,...r?{messageId:r}:{}}]})}else if(n===`code_user_message_chunk`){let n=Le(t);if(!n)return;let r=$(t);if(Be(Z.current,e,n))return;w(e=>{if(J.current===n){let t=-1;for(let r=e.length-1;r>=0;--r){let i=e[r];if(i?.role===`user`&&i.text===n&&i.transient===`pending-user-echo`){t=r;break}}if(t>=0){J.current=null;let i=[...e];return i[t]={role:`user`,text:n,...r?{messageId:r}:{}},i}}return[...e,{role:`user`,text:n,...r?{messageId:r}:{}}]})}else if(n===`code_agent_thought_chunk`){let n=Le(t);if(!n)return;let r=$(t);if(Be(Z.current,e,n))return;w(e=>{let t=e[e.length-1];return t?.role===`thinking`&&(!t.messageId||!r||t.messageId===r)?[...e.slice(0,-1),{...t,text:t.text+n,...r&&!t.messageId?{messageId:r}:{}}]:[...e,{role:`thinking`,text:n,...r?{messageId:r}:{}}]})}else if(n===`code_tool_call`){let e=String(t.title??t.toolName??`tool`),n=String(t.toolCallId??``),r=String(t.status??`pending`),i=te(t);w(t=>[...t,{role:`tool`,text:e,toolName:e,toolCallId:n,toolContent:i,toolStatus:$e(r)}])}else if(n===`code_tool_call_update`){let e=String(t.toolCallId??``),n=String(t.status??``),r=te(t);w(t=>{let i=_(t,e);if(i<0)return t;let a=[...t],o={...a[i]};return n&&(o.toolStatus=$e(n)),r.length>0&&(o.toolContent=r),a[i]=o,a})}else if(n===`code_permission_request`){let t=String(e.permissionId??``),n=e.toolCall??{},r=e.options??[];t&&Me(i,H,{permissionId:t,toolCall:n,options:r},{appendMessage:e=>w(t=>[...t,e]),enqueuePermission:e=>{E(t=>[...t,e]),xe(`smooth`)}})}else if(n===`code_session_info_update`){let e=t.title;typeof e==`string`&&F(e)}else if(n===`code_usage_update`){let e={};typeof t.contextTokens==`number`&&(e.contextTokens=t.contextTokens),typeof t.contextLimit==`number`&&(e.contextLimit=t.contextLimit),typeof t.totalCost==`number`&&(e.cost=t.totalCost),L(e)}else if(n===`code_plan`)R((t.entries??[]).filter(e=>e.title).map(e=>({title:String(e.title),status:String(e.status??`pending`)}))),xe(`smooth`);else if(n===`code_available_commands_update`)O(je(re(t.availableCommands)));else if(n===`code_child_exit`){let t=e.code===null||e.code===void 0?`unknown`:String(e.code),n=`JWC ACP child exited (code ${t}). Active Code sessions were closed. Send the prompt again to start a fresh session, or load a stored session from the sidebar.`;q.current=null,c(null),S(!1),E([]),K({code:t,message:n}),w(e=>[...e,{role:`assistant`,text:n}])}else n===`code_turn_done`?S(!1):n===`code_session_error`&&(w(t=>[...t,{role:`assistant`,text:`Error: ${e.reason??`unknown`}`}]),S(!1))},[i,H,xe]),onTransport:he});let Ee=(0,f.useCallback)(async()=>{let e=y.trim();if(!(!e||x)){Y.current=null,S(!0),u(!0),K(null),J.current=e,w(t=>[...t,{role:`user`,text:e,transient:`pending-user-echo`}]),b(``);try{let t=s;if(!t){let e=a||`/tmp`;t=(await i.createSession(e,ye||void 0)).sessionId,q.current=t,c(t)}await i.sendPrompt(t,e)}catch(e){J.current=null,w(t=>[...t,{role:`assistant`,text:`Error: ${e instanceof Error?e.message:String(e)}`}]),S(!1)}}},[y,x,s,i,a,ye]),De=(0,f.useCallback)(e=>{b(e),A(e===`/`||e.startsWith(`/`)&&!e.includes(` `))},[]),Pe=(0,f.useCallback)(e=>{if(!e.disabledReason){if(e.actionType===`popup`&&e.popupKind){N(``),M({kind:e.popupKind,command:e}),A(!1);return}b(`${e.displayName} `),A(!1)}},[]),Fe=(0,f.useCallback)(async(e,t)=>{await Ne(i,H,e,t,e=>w(t=>[...t,e]))&&E(t=>t.filter(t=>t.permissionId!==e.permissionId))},[i,H]),Ie=(0,f.useCallback)(async(e,t,n)=>{N(``),B(e),ie(t);let r=n?.closePopup??!0,a=n?.requireActiveSession??!0;if(!s){a&&N(`Start or load a Code session before applying a live model.`);return}try{await i.setSessionModel(s,v(e,t)),r&&M(null)}catch(e){N(e instanceof Error?e.message:String(e))}},[s,i]),Re=(0,f.useCallback)(async(e,t)=>{N(``);try{Q(await i.setDefaultModel(v(e,t))),Te()}catch(e){N(e instanceof Error?e.message:String(e))}},[Q,i,Te]),He=(0,f.useCallback)(async(e,t,n,r)=>{N(``);try{W(await i.setModelAssignment(e,{provider:t,model:n,...r===void 0?{}:{thinkingLevel:r}}))}catch(e){N(e instanceof Error?e.message:String(e))}},[i]),Ue=(0,f.useCallback)(async e=>{N(``);try{W(await i.clearModelAssignment(e))}catch(e){N(e instanceof Error?e.message:String(e))}},[i]),We=U.providers.find(e=>e.id===z)??U.providers[0],Ge=U.providers.map(e=>e.id),Ke=We?.models??[],qe=We?.efforts??[],Je=e=>{let t=et(e.replayEvents??[]);Z.current=new Set,ze(Z.current,e.replayEvents??[]),X.current=new Set(t.filter(e=>e.role===`assistant`&&e.text).map(e=>e.text)),q.current=e.sessionId,c(e.sessionId),e.cwd!==a&&(ve.current=!0,o(e.cwd)),w(t),E([]),R([]),F(e.title?.trim()||t.find(e=>e.role===`user`)?.text.split(/\r?\n/)[0]?.replace(/\s+/g,` `).trim()||``),L({}),S(!1),K(null)};if(!e)return(0,h.jsx)(`div`,{className:`code-canvas`,children:(0,h.jsx)(`div`,{className:`code-transcript-empty`,children:(0,h.jsx)(`p`,{children:`Server not available.`})})});let Ye=(0,h.jsx)(g,{client:i,activeSessionId:s,workingDir:a,onSelectSession:Je,onLoadSession:(e,t)=>{(async()=>{Y.current=e,q.current=e,c(e),J.current=null,X.current=new Set,Z.current=new Set,w([]),R([]),F(``),S(!1);try{let n=await i.loadSession(e,t);if(q.current!==e)return;n.title&&F(n.title);let r=et(n.replayEvents??[]);Z.current=new Set,ze(Z.current,n.replayEvents??[]),X.current=new Set(r.filter(e=>e.role===`assistant`&&e.text).map(e=>e.text)),w(r),S(!1)}catch(t){q.current===e&&(q.current=null,c(null)),w(e=>[...e,{role:`assistant`,text:`Failed to load session: ${t instanceof Error?t.message:String(t)}`}])}finally{Y.current===e&&(Y.current=null)}})()},onNewSession:()=>{q.current=null,Y.current=null,J.current=null,X.current=new Set,Z.current=new Set,c(null),w([]),R([]),F(``),S(!1),u(!1)}}),Xe=e=>{B(e),ie(U.providers.find(t=>t.id===e)?.models[0]??``)},Ze=(0,h.jsx)(Oe,{activePopup:j,activeSessionId:s,availableCommands:D,codeWorkingDir:a,currentEffortOptions:qe,currentModelOptions:Ke,disabled:x,effort:ae,gitInfo:fe,childRecovery:pe,transportState:me,inputText:y,messages:C,model:V,modelAssignments:le,modelOptions:U,modelPresets:ue,permissionMode:H,permissions:T,planEntries:ne,error:ee,provider:z,providerOptions:Ge,sending:x,sessionTitle:P,showCommands:k,transcriptRef:be,usage:I,onClearModelAssignment:Ue,onClosePopup:()=>{N(``),M(null)},onCommandSelect:Pe,onEffortChange:e=>{oe(e),s&&i.setSessionConfig(s,`thinking`,e)},onFooterProviderChange:e=>{Xe(e);let t=U.providers.find(t=>t.id===e),n=t?.models[0]??``;oe(t?.efforts.includes(`high`)?`high`:t?.efforts[0]??``),n&&Ie(e,n,{closePopup:!1,requireActiveSession:!1})},onInputChange:De,onModelChange:e=>{Ie(z,e,{closePopup:!1,requireActiveSession:!1})},onPermissionAnswer:Fe,onPermissionModeChange:se,onProviderChange:Xe,onRefreshProviders:()=>{we()},onSetDefaultModel:Re,onSetModelAssignment:He,onShowCommandsChange:A,onSubmit:()=>{Ee()},onUseModel:Ie,onUseForNewSessions:(e,t)=>{Ie(e,t,{requireActiveSession:!1,closePopup:!1}),M(null)},onWorkingDirChange:Se,onOpenLocalFile:r,workspaceFrozen:l,onPickWorkingDir:Ce});return ge?(0,h.jsxs)(h.Fragment,{children:[(0,p.createPortal)((0,h.jsx)(`div`,{className:`code-manager-session-navigator-content`,children:Ye}),ge),(0,h.jsx)(`div`,{className:`code-canvas code-canvas-workbench`,children:Ze})]}):(0,h.jsxs)(`div`,{className:`code-canvas`,children:[(0,h.jsx)(`div`,{className:`code-canvas-sidebar`,children:Ye}),Ze]})}export{at as CodeCanvas};
@@ -1 +1 @@
1
- import{r as e}from"./rolldown-runtime-XQCOJYun.js";import{n as t,t as n}from"./jsx-runtime-gFMgZ0TQ.js";import{c as r}from"./api-C9dOxby7.js";import{t as i}from"./desktop-bridge-CvdhnJQo.js";import{t as a}from"./copy-text-BDs2wKjA.js";import{n as o,t as s}from"./MarkdownRenderer-CHacL2M_.js";var c=e(t(),1),l=n(),u={ts:`typescript`,tsx:`typescript`,js:`javascript`,jsx:`javascript`,py:`python`,rs:`rust`,go:`go`,java:`java`,cpp:`cpp`,c:`cpp`,css:`css`,html:`html`,htm:`html`,xml:`xml`,json:`json`,yaml:`yaml`,yml:`yaml`,sh:`bash`,bash:`bash`,sql:`sql`};function d(e){let t=e.split(`.`).pop()?.toLowerCase();return t?u[t]??null:null}function f(e){return/\.(md|mdx)$/i.test(e)}function p(e){return/\.html?$/i.test(e)}function m(){return i()?.folder??null}function h(e){return!e.startsWith(`/`)&&!/^[a-zA-Z]:[\\/]/.test(e)}function g(e){return e.split(/[\\/]/).pop()||e}function _(e){return[`<!doctype html>`,`<html>`,`<head>`,`<meta http-equiv="Content-Security-Policy" content="${[`default-src 'none'`,`img-src data: blob:`,`style-src 'unsafe-inline' data:`,`font-src data:`,`script-src 'none'`,`connect-src 'none'`,`object-src 'none'`,`base-uri 'none'`,`form-action 'none'`,`frame-src 'none'`].join(`; `)}">`,`<meta charset="utf-8">`,`<style>html,body{margin:0;min-height:100%;}body{font-family:system-ui,sans-serif;}</style>`,`</head>`,`<body>`,e,`</body>`,`</html>`].join(``)}function v(e){return(0,l.jsx)(`iframe`,{className:`doc-html-preview`,title:e.title,sandbox:``,referrerPolicy:`no-referrer`,srcDoc:_(e.content)})}function y(e){if(e.raw)return(0,l.jsx)(`pre`,{className:`doc-pre`,children:(0,l.jsx)(`code`,{children:e.content})});if(f(e.filePath))return(0,l.jsx)(`article`,{className:`notes-preview doc-markdown`,children:(0,l.jsx)(s,{markdown:e.content,onLocalFileOpen:e.onOpenLocalFile})});if(p(e.filePath))return(0,l.jsx)(v,{content:e.content,title:`Rendered preview of ${g(e.filePath)}`});let t=d(e.filePath);return t?(0,l.jsx)(o,{code:e.content,language:t}):(0,l.jsx)(`pre`,{className:`doc-pre`,children:(0,l.jsx)(`code`,{children:e.content})})}function b(e){let t=m(),n=(0,c.useRef)(null),i=(0,c.useRef)(null),o=(0,c.useRef)(void 0),s=(0,c.useRef)({filePath:``,scrollTop:0}),u=(0,c.useRef)(null),d=(0,c.useRef)(null),[f,p]=(0,c.useState)(``),[_,v]=(0,c.useState)(null),[b,x]=(0,c.useState)(!1),[S,C]=(0,c.useState)(!1),[w,T]=(0,c.useState)(!1),[E,D]=(0,c.useState)(null),O=(0,c.useCallback)(e=>{d.current!==null&&window.clearTimeout(d.current),D(e),d.current=window.setTimeout(()=>{d.current=null,D(t=>t===e?null:t)},1200)},[]),k=(0,c.useCallback)(()=>{let t=e.filePath;t&&a(t).then(e=>{e.ok?O(`path`):console.error(`[doc-panel:path-copy]`,e.error)})},[O,e.filePath]),A=(0,c.useCallback)(()=>{a(f).then(e=>{e.ok?O(`content`):console.error(`[doc-panel:content-copy]`,e.error)})},[f,O]),j=(0,c.useCallback)(e=>{u.current!==null&&cancelAnimationFrame(u.current);let t=s.current.filePath===e?s.current.scrollTop:0;u.current=requestAnimationFrame(()=>{u.current=null;let r=n.current;!r||s.current.filePath!==e||(r.scrollTop=t)})},[]);return(0,c.useEffect)(()=>{if(!e.filePath){p(``),v(null),C(!1),D(null),T(!1);return}let n=e.filePath,i=!1;return D(null),T(!1),(async()=>{if(t){let e=await t.readFile(n);if(!e.ok&&e.error?.includes(`path not allowed`)){if(await t.getDefaultRoot(),i)return;e=await t.readFile(n)}if(i)return;e.ok&&e.content!==void 0?(x(e.binary===!0),C(e.truncated===!0&&e.binary!==!0),p(e.binary||e.truncated?``:e.content),v(null)):v(e.error??`Failed to read file`);return}if(!h(n)){i||v(`Document preview for arbitrary local files requires Electron desktop app`);return}try{let e=await r(n);if(i)return;x(!1),C(!1),p(e.content),v(null)}catch(e){i||v(e.message)}})(),()=>{i=!0}},[t,e.filePath]),(0,c.useLayoutEffect)(()=>{let t=n.current,r=e.filePath;if(!(!t||!r)){if(o.current!==r){o.current=r,t.scrollTop=0,s.current={filePath:r,scrollTop:0};return}j(r)}},[f,e.filePath,j]),(0,c.useEffect)(()=>{let t=i.current,n=e.filePath;if(!t||!n)return;let r=new ResizeObserver(()=>{s.current.filePath===n&&j(n)});return r.observe(t),()=>{r.disconnect()}},[f,e.filePath,j]),(0,c.useEffect)(()=>()=>{u.current!==null&&(cancelAnimationFrame(u.current),u.current=null),d.current!==null&&(window.clearTimeout(d.current),d.current=null)},[]),e.filePath?_?(0,l.jsx)(`div`,{className:`doc-panel doc-error`,children:_}):b?(0,l.jsx)(`div`,{className:`doc-panel doc-binary`,children:`Binary file — cannot preview`}):S?(0,l.jsx)(`div`,{className:`doc-panel doc-binary`,children:`File too large to preview (512KB cap) — open it in an editor instead.`}):(0,l.jsxs)(`div`,{className:`doc-panel`,children:[(0,l.jsxs)(`div`,{className:`doc-toolbar`,children:[(0,l.jsx)(`span`,{className:`doc-file-name`,title:e.filePath,children:g(e.filePath)}),(0,l.jsxs)(`div`,{className:`doc-toolbar-actions`,"aria-label":`Document actions`,children:[(0,l.jsx)(`button`,{type:`button`,className:`doc-toolbar-button ${w?`is-active`:``}`,"aria-pressed":w,title:`Show raw source`,onClick:()=>T(e=>!e),children:`Raw`}),(0,l.jsx)(`button`,{type:`button`,className:`doc-toolbar-button`,title:`Copy full path`,onClick:k,children:E===`path`?`Copied`:`Path`}),(0,l.jsx)(`button`,{type:`button`,className:`doc-toolbar-button`,title:`Copy file content`,onClick:A,children:E===`content`?`Copied`:`Copy`})]})]}),(0,l.jsx)(`div`,{className:`doc-content`,ref:n,onScroll:t=>{e.filePath&&(s.current={filePath:e.filePath,scrollTop:t.currentTarget.scrollTop})},children:(0,l.jsx)(`div`,{className:`doc-content-body`,ref:i,children:(0,l.jsx)(y,{filePath:e.filePath,content:f,raw:w,onOpenLocalFile:e.onOpenLocalFile})})})]}):(0,l.jsx)(`div`,{className:`doc-panel doc-empty`,children:`Open Folders and select a file to preview it here.`})}export{b as DocPanel};
1
+ import{r as e}from"./rolldown-runtime-XQCOJYun.js";import{n as t,t as n}from"./jsx-runtime-gFMgZ0TQ.js";import{c as r}from"./api-C9dOxby7.js";import{t as i}from"./desktop-bridge-CvdhnJQo.js";import{t as a}from"./copy-text-BDs2wKjA.js";import{n as o,t as s}from"./MarkdownRenderer-CXrilOsG.js";var c=e(t(),1),l=n(),u={ts:`typescript`,tsx:`typescript`,js:`javascript`,jsx:`javascript`,py:`python`,rs:`rust`,go:`go`,java:`java`,cpp:`cpp`,c:`cpp`,css:`css`,html:`html`,htm:`html`,xml:`xml`,json:`json`,yaml:`yaml`,yml:`yaml`,sh:`bash`,bash:`bash`,sql:`sql`};function d(e){let t=e.split(`.`).pop()?.toLowerCase();return t?u[t]??null:null}function f(e){return/\.(md|mdx)$/i.test(e)}function p(e){return/\.html?$/i.test(e)}function m(){return i()?.folder??null}function h(e){return!e.startsWith(`/`)&&!/^[a-zA-Z]:[\\/]/.test(e)}function g(e){return e.split(/[\\/]/).pop()||e}function _(e){return[`<!doctype html>`,`<html>`,`<head>`,`<meta http-equiv="Content-Security-Policy" content="${[`default-src 'none'`,`img-src data: blob:`,`style-src 'unsafe-inline' data:`,`font-src data:`,`script-src 'none'`,`connect-src 'none'`,`object-src 'none'`,`base-uri 'none'`,`form-action 'none'`,`frame-src 'none'`].join(`; `)}">`,`<meta charset="utf-8">`,`<style>html,body{margin:0;min-height:100%;}body{font-family:system-ui,sans-serif;}</style>`,`</head>`,`<body>`,e,`</body>`,`</html>`].join(``)}function v(e){return(0,l.jsx)(`iframe`,{className:`doc-html-preview`,title:e.title,sandbox:``,referrerPolicy:`no-referrer`,srcDoc:_(e.content)})}function y(e){if(e.raw)return(0,l.jsx)(`pre`,{className:`doc-pre`,children:(0,l.jsx)(`code`,{children:e.content})});if(f(e.filePath))return(0,l.jsx)(`article`,{className:`notes-preview doc-markdown`,children:(0,l.jsx)(s,{markdown:e.content,onLocalFileOpen:e.onOpenLocalFile})});if(p(e.filePath))return(0,l.jsx)(v,{content:e.content,title:`Rendered preview of ${g(e.filePath)}`});let t=d(e.filePath);return t?(0,l.jsx)(o,{code:e.content,language:t}):(0,l.jsx)(`pre`,{className:`doc-pre`,children:(0,l.jsx)(`code`,{children:e.content})})}function b(e){let t=m(),n=(0,c.useRef)(null),i=(0,c.useRef)(null),o=(0,c.useRef)(void 0),s=(0,c.useRef)({filePath:``,scrollTop:0}),u=(0,c.useRef)(null),d=(0,c.useRef)(null),[f,p]=(0,c.useState)(``),[_,v]=(0,c.useState)(null),[b,x]=(0,c.useState)(!1),[S,C]=(0,c.useState)(!1),[w,T]=(0,c.useState)(!1),[E,D]=(0,c.useState)(null),O=(0,c.useCallback)(e=>{d.current!==null&&window.clearTimeout(d.current),D(e),d.current=window.setTimeout(()=>{d.current=null,D(t=>t===e?null:t)},1200)},[]),k=(0,c.useCallback)(()=>{let t=e.filePath;t&&a(t).then(e=>{e.ok?O(`path`):console.error(`[doc-panel:path-copy]`,e.error)})},[O,e.filePath]),A=(0,c.useCallback)(()=>{a(f).then(e=>{e.ok?O(`content`):console.error(`[doc-panel:content-copy]`,e.error)})},[f,O]),j=(0,c.useCallback)(e=>{u.current!==null&&cancelAnimationFrame(u.current);let t=s.current.filePath===e?s.current.scrollTop:0;u.current=requestAnimationFrame(()=>{u.current=null;let r=n.current;!r||s.current.filePath!==e||(r.scrollTop=t)})},[]);return(0,c.useEffect)(()=>{if(!e.filePath){p(``),v(null),C(!1),D(null),T(!1);return}let n=e.filePath,i=!1;return D(null),T(!1),(async()=>{if(t){let e=await t.readFile(n);if(!e.ok&&e.error?.includes(`path not allowed`)){if(await t.getDefaultRoot(),i)return;e=await t.readFile(n)}if(i)return;e.ok&&e.content!==void 0?(x(e.binary===!0),C(e.truncated===!0&&e.binary!==!0),p(e.binary||e.truncated?``:e.content),v(null)):v(e.error??`Failed to read file`);return}if(!h(n)){i||v(`Document preview for arbitrary local files requires Electron desktop app`);return}try{let e=await r(n);if(i)return;x(!1),C(!1),p(e.content),v(null)}catch(e){i||v(e.message)}})(),()=>{i=!0}},[t,e.filePath]),(0,c.useLayoutEffect)(()=>{let t=n.current,r=e.filePath;if(!(!t||!r)){if(o.current!==r){o.current=r,t.scrollTop=0,s.current={filePath:r,scrollTop:0};return}j(r)}},[f,e.filePath,j]),(0,c.useEffect)(()=>{let t=i.current,n=e.filePath;if(!t||!n)return;let r=new ResizeObserver(()=>{s.current.filePath===n&&j(n)});return r.observe(t),()=>{r.disconnect()}},[f,e.filePath,j]),(0,c.useEffect)(()=>()=>{u.current!==null&&(cancelAnimationFrame(u.current),u.current=null),d.current!==null&&(window.clearTimeout(d.current),d.current=null)},[]),e.filePath?_?(0,l.jsx)(`div`,{className:`doc-panel doc-error`,children:_}):b?(0,l.jsx)(`div`,{className:`doc-panel doc-binary`,children:`Binary file — cannot preview`}):S?(0,l.jsx)(`div`,{className:`doc-panel doc-binary`,children:`File too large to preview (512KB cap) — open it in an editor instead.`}):(0,l.jsxs)(`div`,{className:`doc-panel`,children:[(0,l.jsxs)(`div`,{className:`doc-toolbar`,children:[(0,l.jsx)(`span`,{className:`doc-file-name`,title:e.filePath,children:g(e.filePath)}),(0,l.jsxs)(`div`,{className:`doc-toolbar-actions`,"aria-label":`Document actions`,children:[(0,l.jsx)(`button`,{type:`button`,className:`doc-toolbar-button ${w?`is-active`:``}`,"aria-pressed":w,title:`Show raw source`,onClick:()=>T(e=>!e),children:`Raw`}),(0,l.jsx)(`button`,{type:`button`,className:`doc-toolbar-button`,title:`Copy full path`,onClick:k,children:E===`path`?`Copied`:`Path`}),(0,l.jsx)(`button`,{type:`button`,className:`doc-toolbar-button`,title:`Copy file content`,onClick:A,children:E===`content`?`Copied`:`Copy`})]})]}),(0,l.jsx)(`div`,{className:`doc-content`,ref:n,onScroll:t=>{e.filePath&&(s.current={filePath:e.filePath,scrollTop:t.currentTarget.scrollTop})},children:(0,l.jsx)(`div`,{className:`doc-content-body`,ref:i,children:(0,l.jsx)(y,{filePath:e.filePath,content:f,raw:w,onOpenLocalFile:e.onOpenLocalFile})})})]}):(0,l.jsx)(`div`,{className:`doc-panel doc-empty`,children:`Open Folders and select a file to preview it here.`})}export{b as DocPanel};
@@ -0,0 +1,15 @@
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/vendor-render-Bjnw0wQ6.css"])))=>i.map(i=>d[i]);
2
+ import{n as e,r as t,t as n}from"./rolldown-runtime-XQCOJYun.js";import{A as r}from"./vendor-render-DCb9B75Q.js";import{t as i}from"./preload-helper-DFYRRz9w.js";import{i as a,n as o,o as s,r as c,t as l}from"./mermaid-preprocess-0hqEN7sn.js";import{n as u,t as d}from"./jsx-runtime-gFMgZ0TQ.js";import{t as f}from"./copy-text-BDs2wKjA.js";import{A as p,C as m,D as ee,E as h,O as g,S as te,T as _,a as v,b as y,c as b,d as x,f as ne,i as re,j as ie,l as ae,m as oe,n as se,o as ce,p as le,r as ue,s as de,t as fe,u as pe,w as me,x as he}from"./wiki-link-resolver-DyFzBTIQ.js";function ge(e){let t=[],n=String(e||``),r=n.indexOf(`,`),i=0,a=!1;for(;!a;){r===-1&&(r=n.length,a=!0);let e=n.slice(i,r).trim();(e||!a)&&t.push(e),i=r+1,r=n.indexOf(`,`,i)}return t}function _e(e,t){let n=t||{};return(e[e.length-1]===``?[...e,``]:e).join((n.padRight?` `:``)+`,`+(n.padLeft===!1?``:` `)).trim()}var ve=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,ye=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,be={};function xe(e,t){return((t||be).jsx?ye:ve).test(e)}var Se=/[ \t\n\f\r]/g;function Ce(e){return typeof e==`object`?e.type===`text`?we(e.value):!1:we(e)}function we(e){return e.replace(Se,``)===``}var S=class{constructor(e,t,n){this.normal=t,this.property=e,n&&(this.space=n)}};S.prototype.normal={},S.prototype.property={},S.prototype.space=void 0;function Te(e,t){let n={},r={};for(let t of e)Object.assign(n,t.property),Object.assign(r,t.normal);return new S(n,r,t)}function C(e){return e.toLowerCase()}var w=class{constructor(e,t){this.attribute=t,this.property=e}};w.prototype.attribute=``,w.prototype.booleanish=!1,w.prototype.boolean=!1,w.prototype.commaOrSpaceSeparated=!1,w.prototype.commaSeparated=!1,w.prototype.defined=!1,w.prototype.mustUseProperty=!1,w.prototype.number=!1,w.prototype.overloadedBoolean=!1,w.prototype.property=``,w.prototype.spaceSeparated=!1,w.prototype.space=void 0;var T=e({boolean:()=>E,booleanish:()=>D,commaOrSpaceSeparated:()=>j,commaSeparated:()=>A,number:()=>O,overloadedBoolean:()=>De,spaceSeparated:()=>k}),Ee=0,E=M(),D=M(),De=M(),O=M(),k=M(),A=M(),j=M();function M(){return 2**++Ee}var N=Object.keys(T),P=class extends w{constructor(e,t,n,r){let i=-1;if(super(e,t),Oe(this,`space`,r),typeof n==`number`)for(;++i<N.length;){let e=N[i];Oe(this,N[i],(n&T[e])===T[e])}}};P.prototype.defined=!0;function Oe(e,t,n){n&&(e[t]=n)}function F(e){let t={},n={};for(let[r,i]of Object.entries(e.properties)){let a=new P(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(a.mustUseProperty=!0),t[r]=a,n[C(r)]=r,n[C(a.attribute)]=r}return new S(t,n,e.space)}var ke=F({properties:{ariaActiveDescendant:null,ariaAtomic:D,ariaAutoComplete:null,ariaBusy:D,ariaChecked:D,ariaColCount:O,ariaColIndex:O,ariaColSpan:O,ariaControls:k,ariaCurrent:null,ariaDescribedBy:k,ariaDetails:null,ariaDisabled:D,ariaDropEffect:k,ariaErrorMessage:null,ariaExpanded:D,ariaFlowTo:k,ariaGrabbed:D,ariaHasPopup:null,ariaHidden:D,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:k,ariaLevel:O,ariaLive:null,ariaModal:D,ariaMultiLine:D,ariaMultiSelectable:D,ariaOrientation:null,ariaOwns:k,ariaPlaceholder:null,ariaPosInSet:O,ariaPressed:D,ariaReadOnly:D,ariaRelevant:null,ariaRequired:D,ariaRoleDescription:k,ariaRowCount:O,ariaRowIndex:O,ariaRowSpan:O,ariaSelected:D,ariaSetSize:O,ariaSort:null,ariaValueMax:O,ariaValueMin:O,ariaValueNow:O,ariaValueText:null,role:null},transform(e,t){return t===`role`?t:`aria-`+t.slice(4).toLowerCase()}});function Ae(e,t){return t in e?e[t]:t}function je(e,t){return Ae(e,t.toLowerCase())}var Me=F({attributes:{acceptcharset:`accept-charset`,classname:`class`,htmlfor:`for`,httpequiv:`http-equiv`},mustUseProperty:[`checked`,`multiple`,`muted`,`selected`],properties:{abbr:null,accept:A,acceptCharset:k,accessKey:k,action:null,allow:null,allowFullScreen:E,allowPaymentRequest:E,allowUserMedia:E,alt:null,as:null,async:E,autoCapitalize:null,autoComplete:k,autoFocus:E,autoPlay:E,blocking:k,capture:null,charSet:null,checked:E,cite:null,className:k,cols:O,colSpan:null,content:null,contentEditable:D,controls:E,controlsList:k,coords:O|A,crossOrigin:null,data:null,dateTime:null,decoding:null,default:E,defer:E,dir:null,dirName:null,disabled:E,download:De,draggable:D,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:E,formTarget:null,headers:k,height:O,hidden:De,high:O,href:null,hrefLang:null,htmlFor:k,httpEquiv:k,id:null,imageSizes:null,imageSrcSet:null,inert:E,inputMode:null,integrity:null,is:null,isMap:E,itemId:null,itemProp:k,itemRef:k,itemScope:E,itemType:k,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:E,low:O,manifest:null,max:null,maxLength:O,media:null,method:null,min:null,minLength:O,multiple:E,muted:E,name:null,nonce:null,noModule:E,noValidate:E,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:E,optimum:O,pattern:null,ping:k,placeholder:null,playsInline:E,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:E,referrerPolicy:null,rel:k,required:E,reversed:E,rows:O,rowSpan:O,sandbox:k,scope:null,scoped:E,seamless:E,selected:E,shadowRootClonable:E,shadowRootDelegatesFocus:E,shadowRootMode:null,shape:null,size:O,sizes:null,slot:null,span:O,spellCheck:D,src:null,srcDoc:null,srcLang:null,srcSet:null,start:O,step:null,style:null,tabIndex:O,target:null,title:null,translate:null,type:null,typeMustMatch:E,useMap:null,value:D,width:O,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:k,axis:null,background:null,bgColor:null,border:O,borderColor:null,bottomMargin:O,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:E,declare:E,event:null,face:null,frame:null,frameBorder:null,hSpace:O,leftMargin:O,link:null,longDesc:null,lowSrc:null,marginHeight:O,marginWidth:O,noResize:E,noHref:E,noShade:E,noWrap:E,object:null,profile:null,prompt:null,rev:null,rightMargin:O,rules:null,scheme:null,scrolling:D,standby:null,summary:null,text:null,topMargin:O,valueType:null,version:null,vAlign:null,vLink:null,vSpace:O,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:E,disableRemotePlayback:E,prefix:null,property:null,results:O,security:null,unselectable:null},space:`html`,transform:je}),Ne=F({attributes:{accentHeight:`accent-height`,alignmentBaseline:`alignment-baseline`,arabicForm:`arabic-form`,baselineShift:`baseline-shift`,capHeight:`cap-height`,className:`class`,clipPath:`clip-path`,clipRule:`clip-rule`,colorInterpolation:`color-interpolation`,colorInterpolationFilters:`color-interpolation-filters`,colorProfile:`color-profile`,colorRendering:`color-rendering`,crossOrigin:`crossorigin`,dataType:`datatype`,dominantBaseline:`dominant-baseline`,enableBackground:`enable-background`,fillOpacity:`fill-opacity`,fillRule:`fill-rule`,floodColor:`flood-color`,floodOpacity:`flood-opacity`,fontFamily:`font-family`,fontSize:`font-size`,fontSizeAdjust:`font-size-adjust`,fontStretch:`font-stretch`,fontStyle:`font-style`,fontVariant:`font-variant`,fontWeight:`font-weight`,glyphName:`glyph-name`,glyphOrientationHorizontal:`glyph-orientation-horizontal`,glyphOrientationVertical:`glyph-orientation-vertical`,hrefLang:`hreflang`,horizAdvX:`horiz-adv-x`,horizOriginX:`horiz-origin-x`,horizOriginY:`horiz-origin-y`,imageRendering:`image-rendering`,letterSpacing:`letter-spacing`,lightingColor:`lighting-color`,markerEnd:`marker-end`,markerMid:`marker-mid`,markerStart:`marker-start`,navDown:`nav-down`,navDownLeft:`nav-down-left`,navDownRight:`nav-down-right`,navLeft:`nav-left`,navNext:`nav-next`,navPrev:`nav-prev`,navRight:`nav-right`,navUp:`nav-up`,navUpLeft:`nav-up-left`,navUpRight:`nav-up-right`,onAbort:`onabort`,onActivate:`onactivate`,onAfterPrint:`onafterprint`,onBeforePrint:`onbeforeprint`,onBegin:`onbegin`,onCancel:`oncancel`,onCanPlay:`oncanplay`,onCanPlayThrough:`oncanplaythrough`,onChange:`onchange`,onClick:`onclick`,onClose:`onclose`,onCopy:`oncopy`,onCueChange:`oncuechange`,onCut:`oncut`,onDblClick:`ondblclick`,onDrag:`ondrag`,onDragEnd:`ondragend`,onDragEnter:`ondragenter`,onDragExit:`ondragexit`,onDragLeave:`ondragleave`,onDragOver:`ondragover`,onDragStart:`ondragstart`,onDrop:`ondrop`,onDurationChange:`ondurationchange`,onEmptied:`onemptied`,onEnd:`onend`,onEnded:`onended`,onError:`onerror`,onFocus:`onfocus`,onFocusIn:`onfocusin`,onFocusOut:`onfocusout`,onHashChange:`onhashchange`,onInput:`oninput`,onInvalid:`oninvalid`,onKeyDown:`onkeydown`,onKeyPress:`onkeypress`,onKeyUp:`onkeyup`,onLoad:`onload`,onLoadedData:`onloadeddata`,onLoadedMetadata:`onloadedmetadata`,onLoadStart:`onloadstart`,onMessage:`onmessage`,onMouseDown:`onmousedown`,onMouseEnter:`onmouseenter`,onMouseLeave:`onmouseleave`,onMouseMove:`onmousemove`,onMouseOut:`onmouseout`,onMouseOver:`onmouseover`,onMouseUp:`onmouseup`,onMouseWheel:`onmousewheel`,onOffline:`onoffline`,onOnline:`ononline`,onPageHide:`onpagehide`,onPageShow:`onpageshow`,onPaste:`onpaste`,onPause:`onpause`,onPlay:`onplay`,onPlaying:`onplaying`,onPopState:`onpopstate`,onProgress:`onprogress`,onRateChange:`onratechange`,onRepeat:`onrepeat`,onReset:`onreset`,onResize:`onresize`,onScroll:`onscroll`,onSeeked:`onseeked`,onSeeking:`onseeking`,onSelect:`onselect`,onShow:`onshow`,onStalled:`onstalled`,onStorage:`onstorage`,onSubmit:`onsubmit`,onSuspend:`onsuspend`,onTimeUpdate:`ontimeupdate`,onToggle:`ontoggle`,onUnload:`onunload`,onVolumeChange:`onvolumechange`,onWaiting:`onwaiting`,onZoom:`onzoom`,overlinePosition:`overline-position`,overlineThickness:`overline-thickness`,paintOrder:`paint-order`,panose1:`panose-1`,pointerEvents:`pointer-events`,referrerPolicy:`referrerpolicy`,renderingIntent:`rendering-intent`,shapeRendering:`shape-rendering`,stopColor:`stop-color`,stopOpacity:`stop-opacity`,strikethroughPosition:`strikethrough-position`,strikethroughThickness:`strikethrough-thickness`,strokeDashArray:`stroke-dasharray`,strokeDashOffset:`stroke-dashoffset`,strokeLineCap:`stroke-linecap`,strokeLineJoin:`stroke-linejoin`,strokeMiterLimit:`stroke-miterlimit`,strokeOpacity:`stroke-opacity`,strokeWidth:`stroke-width`,tabIndex:`tabindex`,textAnchor:`text-anchor`,textDecoration:`text-decoration`,textRendering:`text-rendering`,transformOrigin:`transform-origin`,typeOf:`typeof`,underlinePosition:`underline-position`,underlineThickness:`underline-thickness`,unicodeBidi:`unicode-bidi`,unicodeRange:`unicode-range`,unitsPerEm:`units-per-em`,vAlphabetic:`v-alphabetic`,vHanging:`v-hanging`,vIdeographic:`v-ideographic`,vMathematical:`v-mathematical`,vectorEffect:`vector-effect`,vertAdvY:`vert-adv-y`,vertOriginX:`vert-origin-x`,vertOriginY:`vert-origin-y`,wordSpacing:`word-spacing`,writingMode:`writing-mode`,xHeight:`x-height`,playbackOrder:`playbackorder`,timelineBegin:`timelinebegin`},properties:{about:j,accentHeight:O,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:O,amplitude:O,arabicForm:null,ascent:O,attributeName:null,attributeType:null,azimuth:O,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:O,by:null,calcMode:null,capHeight:O,className:k,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:O,diffuseConstant:O,direction:null,display:null,dur:null,divisor:O,dominantBaseline:null,download:E,dx:null,dy:null,edgeMode:null,editable:null,elevation:O,enableBackground:null,end:null,event:null,exponent:O,externalResourcesRequired:null,fill:null,fillOpacity:O,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:A,g2:A,glyphName:A,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:O,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:O,horizOriginX:O,horizOriginY:O,id:null,ideographic:O,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:O,k:O,k1:O,k2:O,k3:O,k4:O,kernelMatrix:j,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:O,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:O,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:O,overlineThickness:O,paintOrder:null,panose1:null,path:null,pathLength:O,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:k,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:O,pointsAtY:O,pointsAtZ:O,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:j,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:j,rev:j,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:j,requiredFeatures:j,requiredFonts:j,requiredFormats:j,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:O,specularExponent:O,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:O,strikethroughThickness:O,string:null,stroke:null,strokeDashArray:j,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:O,strokeOpacity:O,strokeWidth:null,style:null,surfaceScale:O,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:j,tabIndex:O,tableValues:null,target:null,targetX:O,targetY:O,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:j,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:O,underlineThickness:O,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:O,values:null,vAlphabetic:O,vMathematical:O,vectorEffect:null,vHanging:O,vIdeographic:O,version:null,vertAdvY:O,vertOriginX:O,vertOriginY:O,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:O,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:`svg`,transform:Ae}),Pe=F({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:`xlink`,transform(e,t){return`xlink:`+t.slice(5).toLowerCase()}}),Fe=F({attributes:{xmlnsxlink:`xmlns:xlink`},properties:{xmlnsXLink:null,xmlns:null},space:`xmlns`,transform:je}),Ie=F({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:`xml`,transform(e,t){return`xml:`+t.slice(3).toLowerCase()}}),Le={classId:`classID`,dataType:`datatype`,itemId:`itemID`,strokeDashArray:`strokeDasharray`,strokeDashOffset:`strokeDashoffset`,strokeLineCap:`strokeLinecap`,strokeLineJoin:`strokeLinejoin`,strokeMiterLimit:`strokeMiterlimit`,typeOf:`typeof`,xLinkActuate:`xlinkActuate`,xLinkArcRole:`xlinkArcrole`,xLinkHref:`xlinkHref`,xLinkRole:`xlinkRole`,xLinkShow:`xlinkShow`,xLinkTitle:`xlinkTitle`,xLinkType:`xlinkType`,xmlnsXLink:`xmlnsXlink`},Re=/[A-Z]/g,ze=/-[a-z]/g,Be=/^data[-\w.:]+$/i;function Ve(e,t){let n=C(t),r=t,i=w;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)===`data`&&Be.test(t)){if(t.charAt(4)===`-`){let e=t.slice(5).replace(ze,Ue);r=`data`+e.charAt(0).toUpperCase()+e.slice(1)}else{let e=t.slice(4);if(!ze.test(e)){let n=e.replace(Re,He);n.charAt(0)!==`-`&&(n=`-`+n),t=`data`+n}}i=P}return new i(r,t)}function He(e){return`-`+e.toLowerCase()}function Ue(e){return e.charAt(1).toUpperCase()}var We=Te([ke,Me,Pe,Fe,Ie],`html`),I=Te([ke,Ne,Pe,Fe,Ie],`svg`);function Ge(e){let t=String(e||``).trim();return t?t.split(/[ \t\n\r\f]+/g):[]}function Ke(e){return e.join(` `).trim()}var qe=n(((e,t)=>{var n=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,r=/\n/g,i=/^\s*/,a=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,o=/^:\s*/,s=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,c=/^[;\s]*/,l=/^\s+|\s+$/g,u=`
3
+ `,d=`/`,f=`*`,p=``,m=`comment`,ee=`declaration`;function h(e,t){if(typeof e!=`string`)throw TypeError(`First argument must be a string`);if(!e)return[];t||={};var l=1,h=1;function te(e){var t=e.match(r);t&&(l+=t.length);var n=e.lastIndexOf(u);h=~n?e.length-n:h+e.length}function _(){var e={line:l,column:h};return function(t){return t.position=new v(e),x(),t}}function v(e){this.start=e,this.end={line:l,column:h},this.source=t.source}v.prototype.content=e;function y(n){var r=Error(t.source+`:`+l+`:`+h+`: `+n);if(r.reason=n,r.filename=t.source,r.line=l,r.column=h,r.source=e,!t.silent)throw r}function b(t){var n=t.exec(e);if(n){var r=n[0];return te(r),e=e.slice(r.length),n}}function x(){b(i)}function ne(e){var t;for(e||=[];t=re();)t!==!1&&e.push(t);return e}function re(){var t=_();if(!(d!=e.charAt(0)||f!=e.charAt(1))){for(var n=2;p!=e.charAt(n)&&(f!=e.charAt(n)||d!=e.charAt(n+1));)++n;if(n+=2,p===e.charAt(n-1))return y(`End of comment missing`);var r=e.slice(2,n-2);return h+=2,te(r),e=e.slice(n),h+=2,t({type:m,comment:r})}}function ie(){var e=_(),t=b(a);if(t){if(re(),!b(o))return y(`property missing ':'`);var r=b(s),i=e({type:ee,property:g(t[0].replace(n,p)),value:r?g(r[0].replace(n,p)):p});return b(c),i}}function ae(){var e=[];ne(e);for(var t;t=ie();)t!==!1&&(e.push(t),ne(e));return e}return x(),ae()}function g(e){return e?e.replace(l,p):p}t.exports=h})),Je=n((e=>{var t=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,`__esModule`,{value:!0}),e.default=r;var n=t(qe());function r(e,t){let r=null;if(!e||typeof e!=`string`)return r;let i=(0,n.default)(e),a=typeof t==`function`;return i.forEach(e=>{if(e.type!==`declaration`)return;let{property:n,value:i}=e;a?t(n,i,e):i&&(r||={},r[n]=i)}),r}})),Ye=n((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.camelCase=void 0;var t=/^--[a-zA-Z0-9_-]+$/,n=/-([a-z])/g,r=/^[^-]+$/,i=/^-(webkit|moz|ms|o|khtml)-/,a=/^-(ms)-/,o=function(e){return!e||r.test(e)||t.test(e)},s=function(e,t){return t.toUpperCase()},c=function(e,t){return`${t}-`};e.camelCase=function(e,t){return t===void 0&&(t={}),o(e)?e:(e=e.toLowerCase(),e=t.reactCompat?e.replace(a,c):e.replace(i,c),e.replace(n,s))}})),Xe=n(((e,t)=>{var n=(e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}})(Je()),r=Ye();function i(e,t){var i={};return!e||typeof e!=`string`||(0,n.default)(e,function(e,n){e&&n&&(i[(0,r.camelCase)(e,t)]=n)}),i}i.default=i,t.exports=i})),Ze=$e(`end`),Qe=$e(`start`);function $e(e){return t;function t(t){let n=t&&t.position&&t.position[e]||{};if(typeof n.line==`number`&&n.line>0&&typeof n.column==`number`&&n.column>0)return{line:n.line,column:n.column,offset:typeof n.offset==`number`&&n.offset>-1?n.offset:void 0}}}function et(e){let t=Qe(e),n=Ze(e);if(t&&n)return{start:t,end:n}}var tt=t(Xe(),1),nt={}.hasOwnProperty,rt=new Map,it=/[A-Z]/g,at=new Set([`table`,`tbody`,`thead`,`tfoot`,`tr`]),ot=new Set([`td`,`th`]),st=`https://github.com/syntax-tree/hast-util-to-jsx-runtime`;function ct(e,t){if(!t||t.Fragment===void 0)throw TypeError("Expected `Fragment` in options");let n=t.filePath||void 0,r;if(t.development){if(typeof t.jsxDEV!=`function`)throw TypeError("Expected `jsxDEV` in options when `development: true`");r=yt(n,t.jsxDEV)}else{if(typeof t.jsx!=`function`)throw TypeError("Expected `jsx` in production options");if(typeof t.jsxs!=`function`)throw TypeError("Expected `jsxs` in production options");r=vt(n,t.jsx,t.jsxs)}let i={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:r,elementAttributeNameCase:t.elementAttributeNameCase||`react`,evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space===`svg`?I:We,stylePropertyNameCase:t.stylePropertyNameCase||`dom`,tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},a=lt(i,e,void 0);return a&&typeof a!=`string`?a:i.create(e,i.Fragment,{children:a||void 0},void 0)}function lt(e,t,n){if(t.type===`element`)return ut(e,t,n);if(t.type===`mdxFlowExpression`||t.type===`mdxTextExpression`)return dt(e,t);if(t.type===`mdxJsxFlowElement`||t.type===`mdxJsxTextElement`)return pt(e,t,n);if(t.type===`mdxjsEsm`)return ft(e,t);if(t.type===`root`)return mt(e,t,n);if(t.type===`text`)return ht(e,t)}function ut(e,t,n){let r=e.schema,i=r;t.tagName.toLowerCase()===`svg`&&r.space===`html`&&(i=I,e.schema=i),e.ancestors.push(t);let a=Tt(e,t.tagName,!1),o=bt(e,t),s=St(e,t);return at.has(t.tagName)&&(s=s.filter(function(e){return typeof e==`string`?!Ce(e):!0})),gt(e,o,a,t),_t(o,s),e.ancestors.pop(),e.schema=r,e.create(t,a,o,n)}function dt(e,t){if(t.data&&t.data.estree&&e.evaluater){let n=t.data.estree.body[0];return n.type,e.evaluater.evaluateExpression(n.expression)}L(e,t.position)}function ft(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);L(e,t.position)}function pt(e,t,n){let r=e.schema,i=r;t.name===`svg`&&r.space===`html`&&(i=I,e.schema=i),e.ancestors.push(t);let a=t.name===null?e.Fragment:Tt(e,t.name,!0),o=xt(e,t),s=St(e,t);return gt(e,o,a,t),_t(o,s),e.ancestors.pop(),e.schema=r,e.create(t,a,o,n)}function mt(e,t,n){let r={};return _t(r,St(e,t)),e.create(t,e.Fragment,r,n)}function ht(e,t){return t.value}function gt(e,t,n,r){typeof n!=`string`&&n!==e.Fragment&&e.passNode&&(t.node=r)}function _t(e,t){if(t.length>0){let n=t.length>1?t:t[0];n&&(e.children=n)}}function vt(e,t,n){return r;function r(e,r,i,a){let o=Array.isArray(i.children)?n:t;return a?o(r,i,a):o(r,i)}}function yt(e,t){return n;function n(n,r,i,a){let o=Array.isArray(i.children),s=Qe(n);return t(r,i,a,o,{columnNumber:s?s.column-1:void 0,fileName:e,lineNumber:s?s.line:void 0},void 0)}}function bt(e,t){let n={},r,i;for(i in t.properties)if(i!==`children`&&nt.call(t.properties,i)){let a=Ct(e,i,t.properties[i]);if(a){let[i,o]=a;e.tableCellAlignToStyle&&i===`align`&&typeof o==`string`&&ot.has(t.tagName)?r=o:n[i]=o}}if(r){let t=n.style||={};t[e.stylePropertyNameCase===`css`?`text-align`:`textAlign`]=r}return n}function xt(e,t){let n={};for(let r of t.attributes)if(r.type===`mdxJsxExpressionAttribute`)if(r.data&&r.data.estree&&e.evaluater){let t=r.data.estree.body[0];t.type;let i=t.expression;i.type;let a=i.properties[0];a.type,Object.assign(n,e.evaluater.evaluateExpression(a.argument))}else L(e,t.position);else{let i=r.name,a;if(r.value&&typeof r.value==`object`)if(r.value.data&&r.value.data.estree&&e.evaluater){let t=r.value.data.estree.body[0];t.type,a=e.evaluater.evaluateExpression(t.expression)}else L(e,t.position);else a=r.value===null?!0:r.value;n[i]=a}return n}function St(e,t){let n=[],r=-1,i=e.passKeys?new Map:rt;for(;++r<t.children.length;){let a=t.children[r],o;if(e.passKeys){let e=a.type===`element`?a.tagName:a.type===`mdxJsxFlowElement`||a.type===`mdxJsxTextElement`?a.name:void 0;if(e){let t=i.get(e)||0;o=e+`-`+t,i.set(e,t+1)}}let s=lt(e,a,o);s!==void 0&&n.push(s)}return n}function Ct(e,t,n){let r=Ve(e.schema,t);if(!(n==null||typeof n==`number`&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?_e(n):Ke(n)),r.property===`style`){let t=typeof n==`object`?n:wt(e,String(n));return e.stylePropertyNameCase===`css`&&(t=Et(t)),[`style`,t]}return[e.elementAttributeNameCase===`react`&&r.space?Le[r.property]||r.property:r.attribute,n]}}function wt(e,t){try{return(0,tt.default)(t,{reactCompat:!0})}catch(t){if(e.ignoreInvalidStyle)return{};let n=t,r=new ie("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:n,ruleId:`style`,source:`hast-util-to-jsx-runtime`});throw r.file=e.filePath||void 0,r.url=st+`#cannot-parse-style-attribute`,r}}function Tt(e,t,n){let r;if(!n)r={type:`Literal`,value:t};else if(t.includes(`.`)){let e=t.split(`.`),n=-1,i;for(;++n<e.length;){let t=xe(e[n])?{type:`Identifier`,name:e[n]}:{type:`Literal`,value:e[n]};i=i?{type:`MemberExpression`,object:i,property:t,computed:!!(n&&t.type===`Literal`),optional:!1}:t}r=i}else r=xe(t)&&!/^[a-z]/.test(t)?{type:`Identifier`,name:t}:{type:`Literal`,value:t};if(r.type===`Literal`){let t=r.value;return nt.call(e.components,t)?e.components[t]:t}if(e.evaluater)return e.evaluater.evaluateExpression(r);L(e)}function L(e,t){let n=new ie("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:`mdx-estree`,source:`hast-util-to-jsx-runtime`});throw n.file=e.filePath||void 0,n.url=st+`#cannot-handle-mdx-estrees-without-createevaluater`,n}function Et(e){let t={},n;for(n in e)nt.call(e,n)&&(t[Dt(n)]=e[n]);return t}function Dt(e){let t=e.replace(it,Ot);return t.slice(0,3)===`ms-`&&(t=`-`+t),t}function Ot(e){return`-`+e.toLowerCase()}var R={action:[`form`],cite:[`blockquote`,`del`,`ins`,`q`],data:[`object`],formAction:[`button`,`input`],href:[`a`,`area`,`base`,`link`],icon:[`menuitem`],itemId:null,manifest:[`html`],ping:[`a`,`area`],poster:[`video`],src:[`audio`,`embed`,`iframe`,`img`,`input`,`script`,`source`,`track`,`video`]};function z(e){let t=[],n=-1,r=0,i=0;for(;++n<e.length;){let a=e.charCodeAt(n),o=``;if(a===37&&p(e.charCodeAt(n+1))&&p(e.charCodeAt(n+2)))i=2;else if(a<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(a))||(o=String.fromCharCode(a));else if(a>55295&&a<57344){let t=e.charCodeAt(n+1);a<56320&&t>56319&&t<57344?(o=String.fromCharCode(a,t),i=1):o=`�`}else o=String.fromCharCode(a);o&&=(t.push(e.slice(r,n),encodeURIComponent(o)),r=n+i+1,``),i&&=(n+=i,0)}return t.join(``)+e.slice(r)}function kt(e,t){let n={type:`element`,tagName:`blockquote`,properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)}function At(e,t){let n={type:`element`,tagName:`br`,properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:`text`,value:`
4
+ `}]}function jt(e,t){let n=t.value?t.value+`
5
+ `:``,r={},i=t.lang?t.lang.split(/\s+/):[];i.length>0&&(r.className=[`language-`+i[0]]);let a={type:`element`,tagName:`code`,properties:r,children:[{type:`text`,value:n}]};return t.meta&&(a.data={meta:t.meta}),e.patch(t,a),a=e.applyData(t,a),a={type:`element`,tagName:`pre`,properties:{},children:[a]},e.patch(t,a),a}function Mt(e,t){let n={type:`element`,tagName:`del`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Nt(e,t){let n={type:`element`,tagName:`em`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Pt(e,t){let n=typeof e.options.clobberPrefix==`string`?e.options.clobberPrefix:`user-content-`,r=String(t.identifier).toUpperCase(),i=z(r.toLowerCase()),a=e.footnoteOrder.indexOf(r),o,s=e.footnoteCounts.get(r);s===void 0?(s=0,e.footnoteOrder.push(r),o=e.footnoteOrder.length):o=a+1,s+=1,e.footnoteCounts.set(r,s);let c={type:`element`,tagName:`a`,properties:{href:`#`+n+`fn-`+i,id:n+`fnref-`+i+(s>1?`-`+s:``),dataFootnoteRef:!0,ariaDescribedBy:[`footnote-label`]},children:[{type:`text`,value:String(o)}]};e.patch(t,c);let l={type:`element`,tagName:`sup`,properties:{},children:[c]};return e.patch(t,l),e.applyData(t,l)}function Ft(e,t){let n={type:`element`,tagName:`h`+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function It(e,t){if(e.options.allowDangerousHtml){let n={type:`raw`,value:t.value};return e.patch(t,n),e.applyData(t,n)}}function Lt(e,t){let n=t.referenceType,r=`]`;if(n===`collapsed`?r+=`[]`:n===`full`&&(r+=`[`+(t.label||t.identifier)+`]`),t.type===`imageReference`)return[{type:`text`,value:`![`+t.alt+r}];let i=e.all(t),a=i[0];a&&a.type===`text`?a.value=`[`+a.value:i.unshift({type:`text`,value:`[`});let o=i[i.length-1];return o&&o.type===`text`?o.value+=r:i.push({type:`text`,value:r}),i}function Rt(e,t){let n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return Lt(e,t);let i={src:z(r.url||``),alt:t.alt};r.title!==null&&r.title!==void 0&&(i.title=r.title);let a={type:`element`,tagName:`img`,properties:i,children:[]};return e.patch(t,a),e.applyData(t,a)}function zt(e,t){let n={src:z(t.url)};t.alt!==null&&t.alt!==void 0&&(n.alt=t.alt),t.title!==null&&t.title!==void 0&&(n.title=t.title);let r={type:`element`,tagName:`img`,properties:n,children:[]};return e.patch(t,r),e.applyData(t,r)}function Bt(e,t){let n={type:`text`,value:t.value.replace(/\r?\n|\r/g,` `)};e.patch(t,n);let r={type:`element`,tagName:`code`,properties:{},children:[n]};return e.patch(t,r),e.applyData(t,r)}function Vt(e,t){let n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return Lt(e,t);let i={href:z(r.url||``)};r.title!==null&&r.title!==void 0&&(i.title=r.title);let a={type:`element`,tagName:`a`,properties:i,children:e.all(t)};return e.patch(t,a),e.applyData(t,a)}function Ht(e,t){let n={href:z(t.url)};t.title!==null&&t.title!==void 0&&(n.title=t.title);let r={type:`element`,tagName:`a`,properties:n,children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function Ut(e,t,n){let r=e.all(t),i=n?Wt(n):Gt(t),a={},o=[];if(typeof t.checked==`boolean`){let e=r[0],n;e&&e.type===`element`&&e.tagName===`p`?n=e:(n={type:`element`,tagName:`p`,properties:{},children:[]},r.unshift(n)),n.children.length>0&&n.children.unshift({type:`text`,value:` `}),n.children.unshift({type:`element`,tagName:`input`,properties:{type:`checkbox`,checked:t.checked,disabled:!0},children:[]}),a.className=[`task-list-item`]}let s=-1;for(;++s<r.length;){let e=r[s];(i||s!==0||e.type!==`element`||e.tagName!==`p`)&&o.push({type:`text`,value:`
6
+ `}),e.type===`element`&&e.tagName===`p`&&!i?o.push(...e.children):o.push(e)}let c=r[r.length-1];c&&(i||c.type!==`element`||c.tagName!==`p`)&&o.push({type:`text`,value:`
7
+ `});let l={type:`element`,tagName:`li`,properties:a,children:o};return e.patch(t,l),e.applyData(t,l)}function Wt(e){let t=!1;if(e.type===`list`){t=e.spread||!1;let n=e.children,r=-1;for(;!t&&++r<n.length;)t=Gt(n[r])}return t}function Gt(e){return e.spread??e.children.length>1}function Kt(e,t){let n={},r=e.all(t),i=-1;for(typeof t.start==`number`&&t.start!==1&&(n.start=t.start);++i<r.length;){let e=r[i];if(e.type===`element`&&e.tagName===`li`&&e.properties&&Array.isArray(e.properties.className)&&e.properties.className.includes(`task-list-item`)){n.className=[`contains-task-list`];break}}let a={type:`element`,tagName:t.ordered?`ol`:`ul`,properties:n,children:e.wrap(r,!0)};return e.patch(t,a),e.applyData(t,a)}function qt(e,t){let n={type:`element`,tagName:`p`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Jt(e,t){let n={type:`root`,children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function Yt(e,t){let n={type:`element`,tagName:`strong`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Xt(e,t){let n=e.all(t),r=n.shift(),i=[];if(r){let n={type:`element`,tagName:`thead`,properties:{},children:e.wrap([r],!0)};e.patch(t.children[0],n),i.push(n)}if(n.length>0){let r={type:`element`,tagName:`tbody`,properties:{},children:e.wrap(n,!0)},a=Qe(t.children[1]),o=Ze(t.children[t.children.length-1]);a&&o&&(r.position={start:a,end:o}),i.push(r)}let a={type:`element`,tagName:`table`,properties:{},children:e.wrap(i,!0)};return e.patch(t,a),e.applyData(t,a)}function Zt(e,t,n){let r=n?n.children:void 0,i=(r?r.indexOf(t):1)===0?`th`:`td`,a=n&&n.type===`table`?n.align:void 0,o=a?a.length:t.children.length,s=-1,c=[];for(;++s<o;){let n=t.children[s],r={},o=a?a[s]:void 0;o&&(r.align=o);let l={type:`element`,tagName:i,properties:r,children:[]};n&&(l.children=e.all(n),e.patch(n,l),l=e.applyData(n,l)),c.push(l)}let l={type:`element`,tagName:`tr`,properties:{},children:e.wrap(c,!0)};return e.patch(t,l),e.applyData(t,l)}function Qt(e,t){let n={type:`element`,tagName:`td`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}var $t=9,en=32;function tn(e){let t=String(e),n=/\r?\n|\r/g,r=n.exec(t),i=0,a=[];for(;r;)a.push(nn(t.slice(i,r.index),i>0,!0),r[0]),i=r.index+r[0].length,r=n.exec(t);return a.push(nn(t.slice(i),i>0,!1)),a.join(``)}function nn(e,t,n){let r=0,i=e.length;if(t){let t=e.codePointAt(r);for(;t===$t||t===en;)r++,t=e.codePointAt(r)}if(n){let t=e.codePointAt(i-1);for(;t===$t||t===en;)i--,t=e.codePointAt(i-1)}return i>r?e.slice(r,i):``}function rn(e,t){let n={type:`text`,value:tn(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function an(e,t){let n={type:`element`,tagName:`hr`,properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}var on={blockquote:kt,break:At,code:jt,delete:Mt,emphasis:Nt,footnoteReference:Pt,heading:Ft,html:It,imageReference:Rt,image:zt,inlineCode:Bt,linkReference:Vt,link:Ht,listItem:Ut,list:Kt,paragraph:qt,root:Jt,strong:Yt,table:Xt,tableCell:Qt,tableRow:Zt,text:rn,thematicBreak:an,toml:B,yaml:B,definition:B,footnoteDefinition:B};function B(){}var sn=typeof self==`object`?self:globalThis,cn=(e,t)=>{let n=(t,n)=>(e.set(n,t),t),r=i=>{if(e.has(i))return e.get(i);let[a,o]=t[i];switch(a){case 0:case-1:return n(o,i);case 1:{let e=n([],i);for(let t of o)e.push(r(t));return e}case 2:{let e=n({},i);for(let[t,n]of o)e[r(t)]=r(n);return e}case 3:return n(new Date(o),i);case 4:{let{source:e,flags:t}=o;return n(new RegExp(e,t),i)}case 5:{let e=n(new Map,i);for(let[t,n]of o)e.set(r(t),r(n));return e}case 6:{let e=n(new Set,i);for(let t of o)e.add(r(t));return e}case 7:{let{name:e,message:t}=o;return n(new sn[e](t),i)}case 8:return n(BigInt(o),i);case`BigInt`:return n(Object(BigInt(o)),i);case`ArrayBuffer`:return n(new Uint8Array(o).buffer,o);case`DataView`:{let{buffer:e}=new Uint8Array(o);return n(new DataView(e),o)}}return n(new sn[a](o),i)};return r},ln=e=>cn(new Map,e)(0),V=``,{toString:un}={},{keys:dn}=Object,H=e=>{let t=typeof e;if(t!==`object`||!e)return[0,t];let n=un.call(e).slice(8,-1);switch(n){case`Array`:return[1,V];case`Object`:return[2,V];case`Date`:return[3,V];case`RegExp`:return[4,V];case`Map`:return[5,V];case`Set`:return[6,V];case`DataView`:return[1,n]}return n.includes(`Array`)?[1,n]:n.includes(`Error`)?[7,n]:[2,n]},U=([e,t])=>e===0&&(t===`function`||t===`symbol`),fn=(e,t,n,r)=>{let i=(e,t)=>{let i=r.push(e)-1;return n.set(t,i),i},a=r=>{if(n.has(r))return n.get(r);let[o,s]=H(r);switch(o){case 0:{let t=r;switch(s){case`bigint`:o=8,t=r.toString();break;case`function`:case`symbol`:if(e)throw TypeError(`unable to serialize `+s);t=null;break;case`undefined`:return i([-1],r)}return i([o,t],r)}case 1:{if(s){let e=r;return s===`DataView`?e=new Uint8Array(r.buffer):s===`ArrayBuffer`&&(e=new Uint8Array(r)),i([s,[...e]],r)}let e=[],t=i([o,e],r);for(let t of r)e.push(a(t));return t}case 2:{if(s)switch(s){case`BigInt`:return i([s,r.toString()],r);case`Boolean`:case`Number`:case`String`:return i([s,r.valueOf()],r)}if(t&&`toJSON`in r)return a(r.toJSON());let n=[],c=i([o,n],r);for(let t of dn(r))(e||!U(H(r[t])))&&n.push([a(t),a(r[t])]);return c}case 3:return i([o,r.toISOString()],r);case 4:{let{source:e,flags:t}=r;return i([o,{source:e,flags:t}],r)}case 5:{let t=[],n=i([o,t],r);for(let[n,i]of r)(e||!(U(H(n))||U(H(i))))&&t.push([a(n),a(i)]);return n}case 6:{let t=[],n=i([o,t],r);for(let n of r)(e||!U(H(n)))&&t.push(a(n));return n}}let{message:c}=r;return i([o,{name:s,message:c}],r)};return a},pn=(e,{json:t,lossy:n}={})=>{let r=[];return fn(!(t||n),!!t,new Map,r)(e),r},W=typeof structuredClone==`function`?(e,t)=>t&&(`json`in t||`lossy`in t)?ln(pn(e,t)):structuredClone(e):(e,t)=>ln(pn(e,t));function mn(e,t){let n=[{type:`text`,value:`↩`}];return t>1&&n.push({type:`element`,tagName:`sup`,properties:{},children:[{type:`text`,value:String(t)}]}),n}function hn(e,t){return`Back to reference `+(e+1)+(t>1?`-`+t:``)}function gn(e){let t=typeof e.options.clobberPrefix==`string`?e.options.clobberPrefix:`user-content-`,n=e.options.footnoteBackContent||mn,r=e.options.footnoteBackLabel||hn,i=e.options.footnoteLabel||`Footnotes`,a=e.options.footnoteLabelTagName||`h2`,o=e.options.footnoteLabelProperties||{className:[`sr-only`]},s=[],c=-1;for(;++c<e.footnoteOrder.length;){let i=e.footnoteById.get(e.footnoteOrder[c]);if(!i)continue;let a=e.all(i),o=String(i.identifier).toUpperCase(),l=z(o.toLowerCase()),u=0,d=[],f=e.footnoteCounts.get(o);for(;f!==void 0&&++u<=f;){d.length>0&&d.push({type:`text`,value:` `});let e=typeof n==`string`?n:n(c,u);typeof e==`string`&&(e={type:`text`,value:e}),d.push({type:`element`,tagName:`a`,properties:{href:`#`+t+`fnref-`+l+(u>1?`-`+u:``),dataFootnoteBackref:``,ariaLabel:typeof r==`string`?r:r(c,u),className:[`data-footnote-backref`]},children:Array.isArray(e)?e:[e]})}let p=a[a.length-1];if(p&&p.type===`element`&&p.tagName===`p`){let e=p.children[p.children.length-1];e&&e.type===`text`?e.value+=` `:p.children.push({type:`text`,value:` `}),p.children.push(...d)}else a.push(...d);let m={type:`element`,tagName:`li`,properties:{id:t+`fn-`+l},children:e.wrap(a,!0)};e.patch(i,m),s.push(m)}if(s.length!==0)return{type:`element`,tagName:`section`,properties:{dataFootnotes:!0,className:[`footnotes`]},children:[{type:`element`,tagName:a,properties:{...W(o),id:`footnote-label`},children:[{type:`text`,value:i}]},{type:`text`,value:`
8
+ `},{type:`element`,tagName:`ol`,properties:{},children:e.wrap(s,!0)},{type:`text`,value:`
9
+ `}]}}var _n={}.hasOwnProperty,vn={};function yn(e,t){let n=t||vn,r=new Map,i=new Map,a={all:s,applyData:xn,definitionById:r,footnoteById:i,footnoteCounts:new Map,footnoteOrder:[],handlers:{...on,...n.handlers},one:o,options:n,patch:bn,wrap:Cn};return me(e,function(e){if(e.type===`definition`||e.type===`footnoteDefinition`){let t=e.type===`definition`?r:i,n=String(e.identifier).toUpperCase();t.has(n)||t.set(n,e)}}),a;function o(e,t){let n=e.type,r=a.handlers[n];if(_n.call(a.handlers,n)&&r)return r(a,e,t);if(a.options.passThrough&&a.options.passThrough.includes(n)){if(`children`in e){let{children:t,...n}=e,r=W(n);return r.children=a.all(e),r}return W(e)}return(a.options.unknownHandler||Sn)(a,e,t)}function s(e){let t=[];if(`children`in e){let n=e.children,r=-1;for(;++r<n.length;){let i=a.one(n[r],e);if(i){if(r&&n[r-1].type===`break`&&(!Array.isArray(i)&&i.type===`text`&&(i.value=wn(i.value)),!Array.isArray(i)&&i.type===`element`)){let e=i.children[0];e&&e.type===`text`&&(e.value=wn(e.value))}Array.isArray(i)?t.push(...i):t.push(i)}}}return t}}function bn(e,t){e.position&&(t.position=et(e))}function xn(e,t){let n=t;if(e&&e.data){let t=e.data.hName,r=e.data.hChildren,i=e.data.hProperties;typeof t==`string`&&(n.type===`element`?n.tagName=t:n={type:`element`,tagName:t,properties:{},children:`children`in n?n.children:[n]}),n.type===`element`&&i&&Object.assign(n.properties,W(i)),`children`in n&&n.children&&r!=null&&(n.children=r)}return n}function Sn(e,t){let n=t.data||{},r=`value`in t&&!(_n.call(n,`hProperties`)||_n.call(n,`hChildren`))?{type:`text`,value:t.value}:{type:`element`,tagName:`div`,properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function Cn(e,t){let n=[],r=-1;for(t&&n.push({type:`text`,value:`
10
+ `});++r<e.length;)r&&n.push({type:`text`,value:`
11
+ `}),n.push(e[r]);return t&&e.length>0&&n.push({type:`text`,value:`
12
+ `}),n}function wn(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function Tn(e,t){let n=yn(e,t),r=n.one(e,void 0),i=gn(n),a=Array.isArray(r)?{type:`root`,children:r}:r||{type:`root`,children:[]};return i&&(`children`in a,a.children.push({type:`text`,value:`
13
+ `},i)),a}function En(e,t){return e&&`run`in e?async function(n,r){let i=Tn(n,{file:r,...t});await e.run(i,r)}:function(n,r){return Tn(n,{file:r,...e||t})}}var G=d(),K=t(u(),1),Dn=[],On={allowDangerousHtml:!0},kn=/^(https?|ircs?|mailto|xmpp)$/i,An=[{from:`astPlugins`,id:`remove-buggy-html-in-markdown-parser`},{from:`allowDangerousHtml`,id:`remove-buggy-html-in-markdown-parser`},{from:`allowNode`,id:`replace-allownode-allowedtypes-and-disallowedtypes`,to:`allowElement`},{from:`allowedTypes`,id:`replace-allownode-allowedtypes-and-disallowedtypes`,to:`allowedElements`},{from:`className`,id:`remove-classname`},{from:`disallowedTypes`,id:`replace-allownode-allowedtypes-and-disallowedtypes`,to:`disallowedElements`},{from:`escapeHtml`,id:`remove-buggy-html-in-markdown-parser`},{from:`includeElementIndex`,id:`#remove-includeelementindex`},{from:`includeNodeIndex`,id:`change-includenodeindex-to-includeelementindex`},{from:`linkTarget`,id:`remove-linktarget`},{from:`plugins`,id:`change-plugins-to-remarkplugins`,to:`remarkPlugins`},{from:`rawSourcePos`,id:`#remove-rawsourcepos`},{from:`renderers`,id:`change-renderers-to-components`,to:`components`},{from:`source`,id:`change-source-to-children`,to:`children`},{from:`sourcePos`,id:`#remove-sourcepos`},{from:`transformImageUri`,id:`#add-urltransform`,to:`urlTransform`},{from:`transformLinkUri`,id:`#add-urltransform`,to:`urlTransform`}];function jn(e){let t=Mn(e),n=Nn(e);return Pn(t.runSync(t.parse(n),n),e)}function Mn(e){let t=e.rehypePlugins||Dn,n=e.remarkPlugins||Dn,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...On}:On;return te().use(g).use(n).use(En,r).use(t)}function Nn(e){let t=e.children||``,n=new m;return typeof t==`string`?n.value=t:``+t,n}function Pn(e,t){let n=t.allowedElements,r=t.allowElement,i=t.components,a=t.disallowedElements,o=t.skipHtml,s=t.unwrapDisallowed,c=t.urlTransform||Fn;for(let e of An)Object.hasOwn(t,e.from)&&``+e.from+(e.to?"use `"+e.to+"` instead":`remove it`)+e.id;return me(e,l),ct(e,{Fragment:G.Fragment,components:i,ignoreInvalidStyle:!0,jsx:G.jsx,jsxs:G.jsxs,passKeys:!0,passNode:!0});function l(e,t,i){if(e.type===`raw`&&i&&typeof t==`number`)return o?i.children.splice(t,1):i.children[t]={type:`text`,value:e.value},t;if(e.type===`element`){let t;for(t in R)if(Object.hasOwn(R,t)&&Object.hasOwn(e.properties,t)){let n=e.properties[t],r=R[t];(r===null||r.includes(e.tagName))&&(e.properties[t]=c(String(n||``),t,e))}}if(e.type===`element`){let o=n?!n.includes(e.tagName):a?a.includes(e.tagName):!1;if(!o&&r&&typeof t==`number`&&(o=!r(e,t,i)),o&&i&&typeof t==`number`)return s&&e.children?i.children.splice(t,1,...e.children):i.children.splice(t,1),t}}}function Fn(e){let t=e.indexOf(`:`),n=e.indexOf(`?`),r=e.indexOf(`#`),i=e.indexOf(`/`);return t===-1||i!==-1&&t>i||n!==-1&&t>n||r!==-1&&t>r||kn.test(e.slice(0,t))?e:``}var In=/[#.]/g;function Ln(e,t){let n=e||``,r={},i=0,a,o;for(;i<n.length;){In.lastIndex=i;let e=In.exec(n),t=n.slice(i,e?e.index:n.length);t&&(a?a===`#`?r.id=t:Array.isArray(r.className)?r.className.push(t):r.className=[t]:o=t,i+=t.length),e&&(a=e[0],i++)}return{type:`element`,tagName:o||t||`div`,properties:r,children:[]}}function Rn(e,t,n){let r=n?Wn(n):void 0;function i(n,i,...a){let o;if(n==null){o={type:`root`,children:[]};let e=i;a.unshift(e)}else{o=Ln(n,t);let s=o.tagName.toLowerCase(),c=r?r.get(s):void 0;if(o.tagName=c||s,zn(i))a.unshift(i);else for(let[t,n]of Object.entries(i))Bn(e,o.properties,t,n)}for(let e of a)Vn(o.children,e);return o.type===`element`&&o.tagName===`template`&&(o.content={type:`root`,children:o.children},o.children=[]),o}return i}function zn(e){if(typeof e!=`object`||!e||Array.isArray(e))return!0;if(typeof e.type!=`string`)return!1;let t=e,n=Object.keys(e);for(let e of n){let n=t[e];if(n&&typeof n==`object`){if(!Array.isArray(n))return!0;let e=n;for(let t of e)if(typeof t!=`number`&&typeof t!=`string`)return!0}}return!!(`children`in e&&Array.isArray(e.children))}function Bn(e,t,n,r){let i=Ve(e,n),a;if(r!=null){if(typeof r==`number`){if(Number.isNaN(r))return;a=r}else a=typeof r==`boolean`?r:typeof r==`string`?i.spaceSeparated?Ge(r):i.commaSeparated?ge(r):i.commaOrSpaceSeparated?Ge(ge(r).join(` `)):Hn(i,i.property,r):Array.isArray(r)?[...r]:i.property===`style`?Un(r):String(r);if(Array.isArray(a)){let e=[];for(let t of a)e.push(Hn(i,i.property,t));a=e}i.property===`className`&&Array.isArray(t.className)&&(a=t.className.concat(a)),t[i.property]=a}}function Vn(e,t){if(t!=null)if(typeof t==`number`||typeof t==`string`)e.push({type:`text`,value:String(t)});else if(Array.isArray(t))for(let n of t)Vn(e,n);else if(typeof t==`object`&&`type`in t)t.type===`root`?Vn(e,t.children):e.push(t);else throw Error("Expected node, nodes, or string, got `"+t+"`")}function Hn(e,t,n){if(typeof n==`string`){if(e.number&&n&&!Number.isNaN(Number(n)))return Number(n);if((e.boolean||e.overloadedBoolean)&&(n===``||C(n)===C(t)))return!0}return n}function Un(e){let t=[];for(let[n,r]of Object.entries(e))t.push([n,r].join(`: `));return t.join(`; `)}function Wn(e){let t=new Map;for(let n of e)t.set(n.toLowerCase(),n);return t}var Gn=`altGlyph.altGlyphDef.altGlyphItem.animateColor.animateMotion.animateTransform.clipPath.feBlend.feColorMatrix.feComponentTransfer.feComposite.feConvolveMatrix.feDiffuseLighting.feDisplacementMap.feDistantLight.feDropShadow.feFlood.feFuncA.feFuncB.feFuncG.feFuncR.feGaussianBlur.feImage.feMerge.feMergeNode.feMorphology.feOffset.fePointLight.feSpecularLighting.feSpotLight.feTile.feTurbulence.foreignObject.glyphRef.linearGradient.radialGradient.solidColor.textArea.textPath`.split(`.`),Kn=Rn(We,`div`),qn=Rn(I,`g`,Gn),Jn={html:`http://www.w3.org/1999/xhtml`,mathml:`http://www.w3.org/1998/Math/MathML`,svg:`http://www.w3.org/2000/svg`,xlink:`http://www.w3.org/1999/xlink`,xml:`http://www.w3.org/XML/1998/namespace`,xmlns:`http://www.w3.org/2000/xmlns/`};function Yn(e,t){return Xn(e,t||{})||{type:`root`,children:[]}}function Xn(e,t){let n=Zn(e,t);return n&&t.afterTransform&&t.afterTransform(e,n),n}function Zn(e,t){switch(e.nodeType){case 1:return nr(e,t);case 3:return er(e);case 8:return tr(e);case 9:return Qn(e,t);case 10:return $n();case 11:return Qn(e,t);default:return}}function Qn(e,t){return{type:`root`,children:rr(e,t)}}function $n(){return{type:`doctype`}}function er(e){return{type:`text`,value:e.nodeValue||``}}function tr(e){return{type:`comment`,value:e.nodeValue||``}}function nr(e,t){let n=e.namespaceURI,r=n===Jn.svg?qn:Kn,i=n===Jn.html?e.tagName.toLowerCase():e.tagName,a=n===Jn.html&&i===`template`?e.content:e,o=e.getAttributeNames(),s={},c=-1;for(;++c<o.length;)s[o[c]]=e.getAttribute(o[c])||``;return r(i,s,rr(a,t))}function rr(e,t){let n=e.childNodes,r=[],i=-1;for(;++i<n.length;){let e=Xn(n[i],t);e!==void 0&&r.push(e)}return r}var ir=new DOMParser;function ar(e,t){return Yn(t?.fragment?or(e):ir.parseFromString(e,`text/html`))}function or(e){let t=document.createElement(`template`);return t.innerHTML=e,t.content}var sr=(function(e,t,n){let r=ee(n);if(!e||!e.type||!e.children)throw Error(`Expected parent node`);if(typeof t==`number`){if(t<0||t===1/0)throw Error(`Expected positive finite number as index`)}else if(t=e.children.indexOf(t),t<0)throw Error(`Expected child node or index`);for(;++t<e.children.length;)if(r(e.children[t],t,e))return e.children[t]}),q=(function(e){if(e==null)return dr;if(typeof e==`string`)return lr(e);if(typeof e==`object`)return cr(e);if(typeof e==`function`)return ur(e);throw Error("Expected function, string, or array as `test`")});function cr(e){let t=[],n=-1;for(;++n<e.length;)t[n]=q(e[n]);return ur(r);function r(...e){let n=-1;for(;++n<t.length;)if(t[n].apply(this,e))return!0;return!1}}function lr(e){return ur(t);function t(t){return t.tagName===e}}function ur(e){return t;function t(t,n,r){return!!(fr(t)&&e.call(this,t,typeof n==`number`?n:void 0,r||void 0))}}function dr(e){return!!(e&&typeof e==`object`&&`type`in e&&e.type===`element`&&`tagName`in e&&typeof e.tagName==`string`)}function fr(e){return typeof e==`object`&&!!e&&`type`in e&&`tagName`in e}var pr=/\n/g,mr=/[\t ]+/g,J=q(`br`),hr=q(Or),gr=q(`p`),_r=q(`tr`),vr=q([`datalist`,`head`,`noembed`,`noframes`,`noscript`,`rp`,`script`,`style`,`template`,`title`,Dr,kr]),yr=q(`address.article.aside.blockquote.body.caption.center.dd.dialog.dir.dl.dt.div.figure.figcaption.footer.form,.h1.h2.h3.h4.h5.h6.header.hgroup.hr.html.legend.li.listing.main.menu.nav.ol.p.plaintext.pre.section.ul.xmp`.split(`.`));function br(e,t){let n=t||{},r=`children`in e?e.children:[],i=yr(e),a=Er(e,{whitespace:n.whitespace||`normal`,breakBefore:!1,breakAfter:!1}),o=[];(e.type===`text`||e.type===`comment`)&&o.push(...Cr(e,{whitespace:a,breakBefore:!0,breakAfter:!0}));let s=-1;for(;++s<r.length;)o.push(...xr(r[s],e,{whitespace:a,breakBefore:s?void 0:i,breakAfter:s<r.length-1?J(r[s+1]):i}));let c=[],l;for(s=-1;++s<o.length;){let e=o[s];typeof e==`number`?l!==void 0&&e>l&&(l=e):e&&(l!==void 0&&l>-1&&c.push(`
14
+ `.repeat(l)||` `),l=-1,c.push(e))}return c.join(``)}function xr(e,t,n){return e.type===`element`?Sr(e,t,n):e.type===`text`?n.whitespace===`normal`?Cr(e,n):wr(e):[]}function Sr(e,t,n){let r=Er(e,n),i=e.children||[],a=-1,o=[];if(vr(e))return o;let s,c;for(J(e)||_r(e)&&sr(t,e,_r)?c=`
15
+ `:gr(e)?(s=2,c=2):yr(e)&&(s=1,c=1);++a<i.length;)o=o.concat(xr(i[a],e,{whitespace:r,breakBefore:a?void 0:s,breakAfter:a<i.length-1?J(i[a+1]):c}));return hr(e)&&sr(t,e,hr)&&o.push(` `),s&&o.unshift(s),c&&o.push(c),o}function Cr(e,t){let n=String(e.value),r=[],i=[],a=0;for(;a<=n.length;){pr.lastIndex=a;let e=pr.exec(n),i=e&&`index`in e?e.index:n.length;r.push(Tr(n.slice(a,i).replace(/[\u061C\u200E\u200F\u202A-\u202E\u2066-\u2069]/g,``),a===0?t.breakBefore:!0,i===n.length?t.breakAfter:!0)),a=i+1}let o=-1,s;for(;++o<r.length;)r[o].charCodeAt(r[o].length-1)===8203||o<r.length-1&&r[o+1].charCodeAt(0)===8203?(i.push(r[o]),s=void 0):r[o]?(typeof s==`number`&&i.push(s),i.push(r[o]),s=0):(o===0||o===r.length-1)&&i.push(0);return i}function wr(e){return[String(e.value)]}function Tr(e,t,n){let r=[],i=0,a;for(;i<e.length;){mr.lastIndex=i;let n=mr.exec(e);a=n?n.index:e.length,!i&&!a&&n&&!t&&r.push(``),i!==a&&r.push(e.slice(i,a)),i=n?a+n[0].length:a}return i!==a&&!n&&r.push(``),r.join(` `)}function Er(e,t){if(e.type===`element`){let n=e.properties||{};switch(e.tagName){case`listing`:case`plaintext`:case`xmp`:return`pre`;case`nobr`:return`nowrap`;case`pre`:return n.wrap?`pre-wrap`:`pre`;case`td`:case`th`:return n.noWrap?`nowrap`:t.whitespace;case`textarea`:return`pre-wrap`;default:}}return t.whitespace}function Dr(e){return!!(e.properties||{}).hidden}function Or(e){return e.tagName===`td`||e.tagName===`th`}function kr(e){return e.tagName===`dialog`&&!(e.properties||{}).open}var Ar={},jr=[];function Mr(e){let t=e||Ar;return function(e,n){h(e,`element`,function(e,i){let a=Array.isArray(e.properties.className)?e.properties.className:jr,o=a.includes(`language-math`),s=a.includes(`math-display`),c=a.includes(`math-inline`),l=s;if(!o&&!s&&!c)return;let u=i[i.length-1],d=e;if(e.tagName===`code`&&o&&u&&u.type===`element`&&u.tagName===`pre`&&(d=u,u=i[i.length-2],l=!0),!u)return;let f=br(d,{whitespace:`pre`}),p;try{p=r.renderToString(f,{...t,displayMode:l,throwOnError:!0})}catch(a){let o=a,s=o.name.toLowerCase();n.message(`Could not render math with KaTeX`,{ancestors:[...i,e],cause:o,place:e.position,ruleId:s,source:`rehype-katex`});try{p=r.renderToString(f,{...t,displayMode:l,strict:`ignore`,throwOnError:!1})}catch{p=[{type:`element`,tagName:`span`,properties:{className:[`katex-error`],style:`color:`+(t.errorColor||`#cc0000`),title:String(a)},children:[{type:`text`,value:f}]}]}}typeof p==`string`&&(p=ar(p,{fragment:!0}).children);let m=u.children.indexOf(d);return u.children.splice(m,1,...p),_})}}var Y={}.hasOwnProperty;function Nr(e,t){let n={type:`root`,children:[]},r=Pr({schema:t?{...he,...t}:he,stack:[]},e);return r&&(Array.isArray(r)?r.length===1?n=r[0]:n.children=r:n=r),n}function Pr(e,t){if(t&&typeof t==`object`){let n=t;switch(typeof n.type==`string`?n.type:``){case`comment`:return Fr(e,n);case`doctype`:return Ir(e,n);case`element`:return Lr(e,n);case`root`:return Rr(e,n);case`text`:return zr(e,n);default:}}}function Fr(e,t){if(e.schema.allowComments){let e=typeof t.value==`string`?t.value:``,n=e.indexOf(`-->`),r={type:`comment`,value:n<0?e:e.slice(0,n)};return X(r,t),r}}function Ir(e,t){if(e.schema.allowDoctypes){let e={type:`doctype`};return X(e,t),e}}function Lr(e,t){let n=typeof t.tagName==`string`?t.tagName:``;e.stack.push(n);let r=Br(e,t.children),i=Vr(e,t.properties);e.stack.pop();let a=!1;if(n&&n!==`*`&&(!e.schema.tagNames||e.schema.tagNames.includes(n))&&(a=!0,e.schema.ancestors&&Y.call(e.schema.ancestors,n))){let t=e.schema.ancestors[n],r=-1;for(a=!1;++r<t.length;)e.stack.includes(t[r])&&(a=!0)}if(!a)return e.schema.strip&&!e.schema.strip.includes(n)?r:void 0;let o={type:`element`,tagName:n,properties:i,children:r};return X(o,t),o}function Rr(e,t){let n={type:`root`,children:Br(e,t.children)};return X(n,t),n}function zr(e,t){let n={type:`text`,value:typeof t.value==`string`?t.value:``};return X(n,t),n}function Br(e,t){let n=[];if(Array.isArray(t)){let r=t,i=-1;for(;++i<r.length;){let t=Pr(e,r[i]);t&&(Array.isArray(t)?n.push(...t):n.push(t))}}return n}function Vr(e,t){let n=e.stack[e.stack.length-1],r=e.schema.attributes,i=e.schema.required,a=r&&Y.call(r,n)?r[n]:void 0,o=r&&Y.call(r,`*`)?r[`*`]:void 0,s=t&&typeof t==`object`?t:{},c={},l;for(l in s)if(Y.call(s,l)){let t=s[l],n=Hr(e,Kr(a,l),l,t);n??=Hr(e,Kr(o,l),l,t),n!=null&&(c[l]=n)}if(i&&Y.call(i,n)){let e=i[n];for(l in e)Y.call(e,l)&&!Y.call(c,l)&&(c[l]=e[l])}return c}function Hr(e,t,n,r){return t?Array.isArray(r)?Ur(e,t,n,r):Wr(e,t,n,r):void 0}function Ur(e,t,n,r){let i=-1,a=[];for(;++i<r.length;){let o=Wr(e,t,n,r[i]);(typeof o==`number`||typeof o==`string`)&&a.push(o)}return a}function Wr(e,t,n,r){if(!(typeof r!=`boolean`&&typeof r!=`number`&&typeof r!=`string`)&&Gr(e,n,r)){if(typeof t==`object`&&t.length>1){let e=!1,n=0;for(;++n<t.length;){let i=t[n];if(i&&typeof i==`object`&&`flags`in i){if(i.test(String(r))){e=!0;break}}else if(i===r){e=!0;break}}if(!e)return}return e.schema.clobber&&e.schema.clobberPrefix&&e.schema.clobber.includes(n)?e.schema.clobberPrefix+r:r}}function Gr(e,t,n){let r=e.schema.protocols&&Y.call(e.schema.protocols,t)?e.schema.protocols[t]:void 0;if(!r||r.length===0)return!0;let i=String(n),a=i.indexOf(`:`),o=i.indexOf(`?`),s=i.indexOf(`#`),c=i.indexOf(`/`);if(a<0||c>-1&&a>c||o>-1&&a>o||s>-1&&a>s)return!0;let l=-1;for(;++l<r.length;){let e=r[l];if(a===e.length&&i.slice(0,e.length)===e)return!0}return!1}function X(e,t){let n=et(t);t.data&&(e.data=W(t.data)),n&&(e.position=n)}function Kr(e,t){let n,r=-1;if(e)for(;++r<e.length;){let i=e[r],a=typeof i==`string`?i:i[0];if(a===t)return i;a===`data*`&&(n=i)}if(t.length>4&&t.slice(0,4).toLowerCase()===`data`)return n}function qr(e){return function(t){return Nr(t,e)}}function Jr(e){y(e,[/\r?\n|\r/g,Yr])}function Yr(){return{type:`break`}}function Xr(){return function(e){Jr(e)}}var Zr=200,Qr=8*1024*1024,$r=1e5,ei=1e3,Z=new Map,ti=0;function ni(e,t){return(e.length+t.html.length)*2}function ri(){for(;(Z.size>Zr||ti>Qr)&&Z.size>0;){let e=Z.keys().next();if(e.done)break;let t=Z.get(e.value);Z.delete(e.value),t&&(ti-=t.bytes)}}function ii(e){return e.replace(/[&<>"']/g,e=>({"&":`&amp;`,"<":`&lt;`,">":`&gt;`,'"':`&quot;`,"'":`&#39;`})[e]??e)}function ai(e){let t=0;for(let n=0;n<e.length;n+=1)if(e.charCodeAt(n)===10){if(n-t>ei)return!0;t=n+1}return e.length-t>ei}function oi(e,t){let n=ne(t);if(e.length>$r||ai(e))return{html:ii(e),language:n,highlighted:!1};let r=`${n}\u0000${e}`,i=Z.get(r);if(i)return Z.delete(r),Z.set(r,i),i.result;let a=x(e,t),o=ni(r,a);return o<=Qr&&(Z.set(r,{result:a,bytes:o}),ti+=o,ri()),a}function si(e){let[t,n]=(0,K.useState)(!1),r=(0,K.useMemo)(()=>oi(e.code,e.language),[e.code,e.language]),i=r.language||`text`;async function a(){let t=await f(e.code);if(t.ok){n(!0),window.setTimeout(()=>n(!1),1200);return}console.error(`[notes:code-copy]`,t.error)}return(0,G.jsxs)(`div`,{className:`notes-code-block`,children:[(0,G.jsx)(`div`,{className:`notes-code-header`,children:(0,G.jsx)(`button`,{type:`button`,onClick:()=>void a(),children:t?`Copied`:i})}),(0,G.jsx)(`pre`,{children:(0,G.jsx)(`code`,{className:`hljs language-${i}`,"data-highlighted":r.highlighted?`yes`:`no`,dangerouslySetInnerHTML:{__html:r.html}})})]})}var ci=(0,K.memo)(si),li=100,ui=null,Q=new Map;async function di(){return ui||=(await i(()=>import(`./mermaid.core-TSG49mwm.js`),__vite__mapDeps([0]))).default,ui.initialize(c()),ui}function fi(){return document.documentElement.getAttribute(`data-theme`)??`default`}function pi(e,t){if(Q.set(e,t),Q.size<=li)return;let n=Q.keys().next().value;n&&Q.delete(n)}function mi(e){let t=(0,K.useId)().replace(/[^a-zA-Z0-9_-]/g,``),n=(0,K.useMemo)(()=>l(e.code),[e.code]),r=fi(),i=(0,K.useMemo)(()=>`${r}\n${n}`,[n,r]),[c,u]=(0,K.useState)(()=>Q.get(i)??{status:`loading`,sourceKey:i});return(0,K.useEffect)(()=>{let e=!1,r=Q.get(i);if(r)return u(r),()=>{e=!0};async function c(){u(e=>e.status===`ready`&&e.sourceKey===i?e:{status:`loading`,sourceKey:i});try{let r=await di(),c=`notes-mermaid-${t}`,l;try{({svg:l}=await r.render(c,n))}catch(e){let t=o(n);if(!t)throw e;({svg:l}=await r.render(`${c}-retry`,t))}if(!e){let e={status:`ready`,sourceKey:i,svg:s(l),wide:a(n)};pi(i,e),u(e)}}catch(t){e||u({status:`error`,sourceKey:i,message:t instanceof Error?t.message:`Mermaid render failed`})}}return c(),()=>{e=!0}},[n,t,i]),c.status===`ready`?(0,G.jsx)(`div`,{className:`notes-mermaid-block is-ready${c.wide?` mermaid-type-wide`:``}`,dangerouslySetInnerHTML:{__html:c.svg}}):c.status===`error`?(0,G.jsxs)(`div`,{className:`notes-mermaid-block is-error`,children:[(0,G.jsx)(`strong`,{children:`Mermaid render failed`}),(0,G.jsx)(`span`,{children:c.message}),(0,G.jsx)(`pre`,{children:(0,G.jsx)(`code`,{children:e.code})})]}):(0,G.jsx)(`div`,{className:`notes-mermaid-block is-loading`,role:`status`,"aria-label":`Diagram loading`,children:`Rendering diagram...`})}function hi(e){return se(e)}function gi(e,t,n){if(!e)return[e];let r=!!t.notes?.length;if(t.lookup.size===0&&!r)return[e];fe.lastIndex=0;let i=[],a=0,o=0,s;for(;(s=fe.exec(e))!==null;){let r=s.index,c=r+s[0].length;if(ue(e,r))continue;let l=t.lookup.get(s[0])??re(s[0],t.outgoing,t.notes,r);if(!l)continue;r>a&&i.push(e.slice(a,r));let u=v(l,s[0]),d=`${n}-wl-${o++}`;if(l.status===`resolved`&&l.resolvedPath){let e=l.resolvedPath;i.push((0,K.createElement)(`a`,{key:d,className:`notes-wikilink`,href:`#${encodeURIComponent(e)}`,title:e,"data-notes-wiki-status":l.status,onClick:n=>{n.preventDefault(),t.onNavigate(e)}},u))}else{let e=ce(l);i.push((0,K.createElement)(`span`,{key:d,className:`notes-wikilink is-broken`,title:e,"data-notes-wiki-status":l.status,"aria-label":`Broken wikilink: ${s[1]}`},u))}a=c}return a===0?[e]:(a<e.length&&i.push(e.slice(a)),i)}function _i(e,t,n){if(t.lookup.size===0&&!t.notes?.length)return e;let r=[],i=0;return K.Children.forEach(e,(e,a)=>{if(typeof e==`string`){let o=gi(e,t,`${n}-${i++}-${a}`);for(let e of o)r.push(e);return}if(typeof e==`number`||typeof e==`boolean`||e==null){r.push(e);return}if((0,K.isValidElement)(e)){r.push(e);return}r.push(e)}),r}var vi=/^---[ \t]*\r?\n[\s\S]*?\r?\n---[ \t]*(?:\r?\n|$)/;function yi(e){let t=vi.exec(e);if(!t)return{frontmatterRaw:null,body:e};let n=t[0];return{frontmatterRaw:n,body:e.slice(n.length)}}function $(e,t){return t?`${e} ${t}`:e}function bi(e){let t=0,n=e=>{if(Array.isArray(e)){e.forEach(n);return}(0,K.isValidElement)(e)&&(e.props.node?.tagName===`tr`&&(t=Math.max(t,K.Children.count(e.props.children))),K.Children.forEach(e.props.children,n))};return K.Children.forEach(e,n),Math.max(1,t)}function xi(e){return e<=1?`minmax(0, 1fr)`:e===2?`max-content minmax(16rem, 1fr)`:e===3?`max-content minmax(12rem, .45fr) minmax(18rem, 1fr)`:`max-content repeat(${e-1}, minmax(12rem, 1fr))`}function Si(e){return typeof e==`string`||typeof e==`number`?String(e):Array.isArray(e)?e.map(Si).join(``):(0,K.isValidElement)(e)?Si(e.props.children):``}function Ci(e){return(0,K.isValidElement)(e)?(e.props.className??``).match(/language-([^\s]+)/)?.[1]??`text`:`text`}var wi=e=>{},Ti=/(?:~\/[^\s)`\]"'<>]+|\/(?:Users|home|tmp|var|opt|private)\/[^\s)`\]"'<>]+)/g,Ei=/[.,!?:;]+$/;function Di(e){return e.startsWith(`~/`)||/^\/(?:Users|home|tmp|var|opt|private)\//.test(e)}function Oi(e){let t=e.split(`/`).pop()||e;return/\.\w{1,10}$/.test(t)?t:e}function ki(e,t,n){if(!e||!t)return[e];Ti.lastIndex=0;let r=[],i=0,a=0,o;for(;(o=Ti.exec(e))!==null;){let s=o[0],c=s.replace(Ei,``);if(!Di(c))continue;o.index>i&&r.push(e.slice(i,o.index));let l=s.slice(c.length);r.push((0,K.createElement)(`button`,{key:`${n}-lf-${a++}`,type:`button`,className:`markdown-local-file-link`,title:c,onClick:e=>{e.preventDefault(),t(c)}},Oi(c))),l&&r.push(l),i=o.index+s.length}return i===0?[e]:(i<e.length&&r.push(e.slice(i)),r)}function Ai(e,t,n){if(!t)return e;let r=[],i=0;return K.Children.forEach(e,(e,a)=>{if(typeof e==`string`){let o=ki(e,t,`${n}-${i++}-${a}`);for(let e of o)r.push(e);return}r.push(e)}),r}function ji(e){let t=(0,K.useMemo)(()=>yi(e.markdown).body,[e.markdown]),n=(0,K.useMemo)(()=>({lookup:hi(e.outgoing),outgoing:e.outgoing,notes:e.notes,onNavigate:e.onWikiLinkNavigate??wi}),[e.outgoing,e.notes,e.onWikiLinkNavigate]),r=(0,K.useMemo)(()=>{let t=(t,r)=>Ai(_i(t,n,r),e.onLocalFileOpen,r),r=e=>n=>{let{children:r,node:i,className:a,id:o,style:s}=n,c=t(r,e);return(0,K.createElement)(e,{className:a,id:o,style:s},c)},i=e=>n=>{let{children:r,node:i,className:a,style:o,align:s}=n,c=t(r,e);return(0,G.jsx)(`span`,{className:$(`markdown-linear-table-cell markdown-linear-table-${e}`,a),style:o,"data-align":s||void 0,children:c})},a={a:({href:e,children:t,node:n,...r})=>{let i=typeof e==`string`&&de(e)?e:void 0,a=!!(i&&/^https?:\/\//i.test(i));return(0,G.jsx)(`a`,{...r,href:i,target:a?`_blank`:void 0,rel:a?`noreferrer noopener`:void 0,children:t})},code:({className:e,children:t})=>(0,G.jsx)(`code`,{className:e,children:t}),pre:({children:e})=>{let t=Ci(e),n=Si(e).replace(/\n$/,``);return t===`mermaid`?(0,G.jsx)(mi,{code:n}):(0,G.jsx)(ci,{code:n,language:t})},img:({src:e,alt:t,...n})=>{let r=typeof e==`string`?ae(e):``;return r?r.endsWith(`.pdf`)?(0,G.jsx)(`iframe`,{src:r,title:t??`PDF embed`,className:`notes-pdf-embed`}):(0,G.jsx)(`img`,{...n,src:r,alt:t??``,loading:`lazy`}):null},p:r(`p`),li:r(`li`),h1:r(`h1`),h2:r(`h2`),h3:r(`h3`),h4:r(`h4`),h5:r(`h5`),h6:r(`h6`),blockquote:r(`blockquote`),td:r(`td`),th:r(`th`),em:r(`em`),strong:r(`strong`),del:r(`del`)};return e.tableMode===`linear`&&(a.table=({children:e,node:t,className:n,style:r})=>{let i={...r,"--markdown-linear-table-grid":xi(bi(e))};return(0,G.jsx)(`div`,{className:$(`markdown-linear-table`,n),style:i,role:`list`,children:e})},a.thead=({children:e,node:t,className:n,style:r})=>(0,G.jsx)(`div`,{className:$(`markdown-linear-table-head`,n),style:r,children:e}),a.tbody=({children:e,node:t,className:n,style:r})=>(0,G.jsx)(`div`,{className:$(`markdown-linear-table-body`,n),style:r,children:e}),a.tr=({children:e,node:t,className:n,style:r})=>(0,G.jsx)(`div`,{className:$(`markdown-linear-table-row`,n),style:r,role:`listitem`,children:e}),a.th=i(`th`),a.td=i(`td`)),a},[n,e.onLocalFileOpen,e.tableMode]);return(0,G.jsx)(jn,{skipHtml:!0,urlTransform:pe,remarkPlugins:[oe,Xr,le],rehypePlugins:[[qr,b],Mr],components:r,children:t})}var Mi=(0,K.memo)(ji);export{ci as n,Mi as t};
@@ -0,0 +1 @@
1
+ import{t as e}from"./MarkdownRenderer-CXrilOsG.js";export{e as MarkdownRenderer};