@inkeep/open-knowledge 0.39.0-beta.7 → 0.39.0-beta.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{acp-harness-probe-CUYWrorr.mjs → acp-harness-probe-DjTv5e1A.mjs} +2 -2
- package/dist/assets/skills/discovery/SKILL.md +1 -1
- package/dist/assets/skills/project/SKILL.md +1 -1
- package/dist/cli.mjs +7 -7
- package/dist/constants-DtCru_h4.mjs +2 -0
- package/dist/git-handle-BGt8xT_1.mjs +1 -0
- package/dist/{git-handle-B30Z3S49.mjs → git-handle-YzX39hWc.mjs} +2 -2
- package/dist/index.mjs +1 -1
- package/dist/{init-DVJ8qrbD.mjs → init-B_KvF9QQ.mjs} +3 -3
- package/dist/init-C_Z3gBHj.mjs +1 -0
- package/dist/{launch-json-removal-CNHYRUOC.mjs → launch-json-removal-DaC6MWYi.mjs} +2 -2
- package/dist/loader-Aakvd0a9.mjs +1 -0
- package/dist/{loader-oy_NkWUH.mjs → loader-DkorwqUF.mjs} +2 -2
- package/dist/md-manager-DPNbV4Up.mjs +2 -0
- package/dist/{open-browser-f7NgugNK.mjs → open-browser-kdF24mgk.mjs} +2 -2
- package/dist/parse-worker.mjs +1 -1
- package/dist/preview-8ufWS_Yg.mjs +1 -0
- package/dist/{preview-D1NzVj36.mjs → preview-Bce8FXXe.mjs} +2 -2
- package/dist/public/assets/{ActivityModeContent-D57-Ku1o.js → ActivityModeContent-But5j0lr.js} +1 -1
- package/dist/public/assets/{AgentDiffPane-B3C8d_Bj.js → AgentDiffPane-oydx_GOA.js} +1 -1
- package/dist/public/assets/{AgentThreadClientBinder-D7HU2baf.js → AgentThreadClientBinder-BKKe4a6D.js} +1 -1
- package/dist/public/assets/CodeMirrorPropInput-Sjp30pzp.js +3 -0
- package/dist/public/assets/DocumentContext-DN3M8p0h.js +38 -0
- package/dist/public/assets/{EnableSyncConfirmDialog-B8E3XigY.js → EnableSyncConfirmDialog-CbuJxerH.js} +1 -1
- package/dist/public/assets/FeedbackForm-MFOBrkxc.js +1 -0
- package/dist/public/assets/{GraphPanel-CWQeoE13.js → GraphPanel-CDzcx7vs.js} +1 -1
- package/dist/public/assets/{ManagedArtifactProperties-C2c-xiZv.js → ManagedArtifactProperties-BB3-9OBw.js} +1 -1
- package/dist/public/assets/{McpConsentDialogBody-_E-zSZcr.js → McpConsentDialogBody-OqDOF7x4.js} +1 -1
- package/dist/public/assets/{MermaidDocEditor-BDEw6KhX.js → MermaidDocEditor-B6KK6qX2.js} +1 -1
- package/dist/public/assets/PropertyPanel-CinI1G1g.js +2 -0
- package/dist/public/assets/{ReportBugDialogBody-Vatcwx0j.js → ReportBugDialogBody-BMOl6KV7.js} +1 -1
- package/dist/public/assets/{SettingsDialogBody-C0UQEFXZ.js → SettingsDialogBody-Gk5e3niv.js} +3 -3
- package/dist/public/assets/{ShareBranchSwitchDialog-yPDcRbbF.js → ShareBranchSwitchDialog-CzeHnBZ6.js} +1 -1
- package/dist/public/assets/{ShareReceiveDialog-XPxnPaw4.js → ShareReceiveDialog-DGTKtAY6.js} +1 -1
- package/dist/public/assets/{ShareReceiveMissDialog-BSTotnwx.js → ShareReceiveMissDialog-BS5BCjjQ.js} +1 -1
- package/dist/public/assets/{SkillEditorActions-Cf43hAWR.js → SkillEditorActions-ZkQKiOQc.js} +1 -1
- package/dist/public/assets/{SourceEditor-fTWc_1_N.js → SourceEditor-4CJXi9kJ.js} +1 -1
- package/dist/public/assets/{TerminalPanel-DNjptZAR.js → TerminalPanel-DyJkPAsZ.js} +3 -3
- package/dist/public/assets/{TerminalSessionsHost-BTaTW1V9.js → TerminalSessionsHost-CaOjEcgq.js} +2 -2
- package/dist/public/assets/{TerminalWindowApp-Bo25OrtB.js → TerminalWindowApp-C2al62bW.js} +1 -1
- package/dist/public/assets/{ThreadView-aWrnhxjd.js → ThreadView-CXI_J3i2.js} +1 -1
- package/dist/public/assets/{TimelineDiffPane-DW_Ed369.js → TimelineDiffPane-C8Qnc4zA.js} +1 -1
- package/dist/public/assets/{agent-diff-store-Bd0NDaYd.js → agent-diff-store-D5yp573E.js} +1 -1
- package/dist/public/assets/{agent-visibility-bo7-lQPw.js → agent-visibility-BUmsS0vL.js} +1 -1
- package/dist/public/assets/{auth-state-cache-DKRhUdiz.js → auth-state-cache-CPrBjd7m.js} +3 -3
- package/dist/public/assets/{client-version-Hh5K6Ltl.js → client-version-CNNfEvD2.js} +1 -1
- package/dist/public/assets/{config-provider-BBWoBQ3A.js → config-provider-BvPGEDTw.js} +2 -2
- package/dist/public/assets/{dist-df-v6kvy.js → dist-CDKZLcnD.js} +68 -68
- package/dist/public/assets/{dist-Cju6fxq6.js → dist-DRspkp5n.js} +1 -1
- package/dist/public/assets/{doc-hash-NyLrtNo2.js → doc-hash-r2oc1gt-.js} +1 -1
- package/dist/public/assets/{documents-events-BHJB8gGz.js → documents-events-DNDUkpJM.js} +1 -1
- package/dist/public/assets/{file-tree-adapter-BnZwo5Ls.js → file-tree-adapter-DOr3Nip1.js} +1 -1
- package/dist/public/assets/{index-JMW0Wfy-.js → index-Lsv_5pDn.js} +13 -13
- package/dist/public/assets/{keyboard-shortcuts-Ctc7xams.js → keyboard-shortcuts-maIyJzSw.js} +1 -1
- package/dist/public/assets/{lint-config-client-BwIg_Zty.js → lint-config-client-C7TVN28Z.js} +1 -1
- package/dist/public/assets/{navigation-targets-D1rdXyAI.js → navigation-targets-DhXblHdl.js} +1 -1
- package/dist/public/assets/{open-managed-artifact-tab-MjzvjrV8.js → open-managed-artifact-tab-DokRsPIe.js} +1 -1
- package/dist/public/assets/{pending-receive-nav-store-DIZcm2qX.js → pending-receive-nav-store-DYgvjLiq.js} +1 -1
- package/dist/public/assets/{prop-types-C0wWXvTx.js → prop-types-IOhQSrD8.js} +1 -1
- package/dist/public/assets/{receive-store-B3ygF-LA.js → receive-store-BwEPjiP1.js} +1 -1
- package/dist/public/assets/{selection-context-ZUAPQrO2.js → selection-context-TzGfTWCl.js} +1 -1
- package/dist/public/assets/{skill-actions-DeZSwOo7.js → skill-actions-CzuWC1X5.js} +1 -1
- package/dist/public/assets/{skills-api-vt4KnCX6.js → skills-api-CGbwE9vp.js} +1 -1
- package/dist/public/assets/{src-C6qvZbZl.js → src-4ThOx6_s.js} +1 -1
- package/dist/public/assets/{target-navigation-intent-DNrmu8Sx.js → target-navigation-intent-Beex9QTj.js} +1 -1
- package/dist/public/assets/{terminal-launch-events-vDhBoD8w.js → terminal-launch-events-C2tfnQr1.js} +1 -1
- package/dist/public/assets/{terminal-telemetry-D1lMQO11.js → terminal-telemetry-zqEIM46I.js} +1 -1
- package/dist/public/assets/{typing-burst-detector-CjccvkIX.js → typing-burst-detector-D-Tl1w8f.js} +1 -1
- package/dist/public/assets/{use-activity-panel-CI9yTIc5.js → use-activity-panel-Dth1RWbL.js} +1 -1
- package/dist/public/assets/{use-apply-config-color-theme-R1RZkk5a.js → use-apply-config-color-theme-Ccfxcl-K.js} +1 -1
- package/dist/public/assets/{use-collab-url-B-LUA0g9.js → use-collab-url-Cf1srbbW.js} +1 -1
- package/dist/public/assets/{use-live-xterm-theme-DW54zfIk.js → use-live-xterm-theme-BpGfJKio.js} +1 -1
- package/dist/public/assets/{use-terminal-enabled-Yhee4_eR.js → use-terminal-enabled-BEEp7vb7.js} +1 -1
- package/dist/public/assets/{use-timeline-entry-diff-8_46BlQG.js → use-timeline-entry-diff-CJ-IHgH7.js} +4 -4
- package/dist/public/assets/{use-workspace-0T1cdRp3.js → use-workspace-C1D_I03G.js} +1 -1
- package/dist/public/assets/{workspace-paths-nkXut9sM.js → workspace-paths-CDfRQ5qH.js} +1 -1
- package/dist/public/index.html +34 -34
- package/dist/{repair-launch-json-BxVkRYZG.mjs → repair-launch-json-BDfwi9-9.mjs} +2 -2
- package/dist/{repair-mcp-configs-D6R0toAP.mjs → repair-mcp-configs-kCwuW5Ze.mjs} +2 -2
- package/dist/{repair-skills-DnkpKCSB.mjs → repair-skills-BaZcFu4I.mjs} +2 -2
- package/dist/repair-skills-BunyY3Wb.mjs +1 -0
- package/dist/{server-lock-1KyShewk.mjs → server-lock-BiAmhJ19.mjs} +2 -2
- package/dist/server-lock-BwO1WEYX.mjs +1 -0
- package/dist/{src-CytrG8h8.mjs → src-BQhUreu4.mjs} +2 -2
- package/dist/{src-FuRMJntf.mjs → src-BTo9m5ju.mjs} +82 -82
- package/dist/{src-DKa-TnuV.mjs → src-DhzHOoTy.mjs} +1 -1
- package/dist/{src-DO_fYaAw.mjs → src-YSGKFci8.mjs} +4 -4
- package/dist/{start-x5T6R5Vy.mjs → start-CmXhmoqo.mjs} +2 -2
- package/dist/start-Dw3sT0mB.mjs +1 -0
- package/dist/{write-project-skill-gbFVJJ2C.mjs → write-project-skill-Dt58S1kj.mjs} +2 -2
- package/package.json +4 -4
- package/dist/constants-Lo6qvo2O.mjs +0 -2
- package/dist/git-handle-RhB108wn.mjs +0 -1
- package/dist/init-D5VPQ7rN.mjs +0 -1
- package/dist/loader-CSw2bCSB.mjs +0 -1
- package/dist/md-manager-DqdW_K1F.mjs +0 -2
- package/dist/preview-BxQH5EQ-.mjs +0 -1
- package/dist/public/assets/CodeMirrorPropInput-BNR51IWy.js +0 -3
- package/dist/public/assets/DocumentContext-Y1Gu1DW-.js +0 -38
- package/dist/public/assets/FeedbackForm-C_cZqAfF.js +0 -1
- package/dist/public/assets/PropertyPanel-Cd0IOo2B.js +0 -2
- package/dist/repair-skills-B8sCkCSw.mjs +0 -1
- package/dist/server-lock-CmiibuTm.mjs +0 -1
- package/dist/start-Dbzf81GV.mjs +0 -1
package/dist/public/assets/{terminal-launch-events-vDhBoD8w.js → terminal-launch-events-C2tfnQr1.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{i as e}from"./chunk-DseTPa7n.js";import{t}from"./jsx-runtime-DyiINK0N.js";import{t as n}from"./react-JNybMug3.js";import{t as r}from"./compiler-runtime-dQcBxOhn.js";import{s as i,t as a}from"./createLucideIcon-BUb14crZ.js";import{r as o}from"./button-DHE6Sx02.js";import{h as s,r as c,t as l}from"./agent-visibility-
|
|
1
|
+
import{i as e}from"./chunk-DseTPa7n.js";import{t}from"./jsx-runtime-DyiINK0N.js";import{t as n}from"./react-JNybMug3.js";import{t as r}from"./compiler-runtime-dQcBxOhn.js";import{s as i,t as a}from"./createLucideIcon-BUb14crZ.js";import{r as o}from"./button-DHE6Sx02.js";import{h as s,r as c,t as l}from"./agent-visibility-BUmsS0vL.js";import{Rt as u}from"./dist-CDKZLcnD.js";import{t as d}from"./input-CsXmpyZP.js";import{c as f,d as p,m}from"./sortable.esm-DcjmFgta.js";import"./textarea-DwJR-19i.js";var ee=a(`history`,[[`path`,{d:`M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8`,key:`1357e3`}],[`path`,{d:`M3 3v5h5`,key:`1xhq8a`}],[`path`,{d:`M12 7v5l4 2`,key:`1fdv2h`}]]),h=a(`panel-right`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M15 3v18`,key:`14nvp0`}]]),g=a(`square-terminal`,[[`path`,{d:`m7 11 2-2-2-2`,key:`1lz0vl`}],[`path`,{d:`M11 13h4`,key:`1p7l4v`}],[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,ry:`2`,key:`1m3agn`}]]),_=e(n(),1),v={},y=new Set;function b(){return v}function x(e){v={...v,...e};for(let e of y)e()}function S(e){return y.add(e),()=>{y.delete(e)}}function te(){return(0,_.useSyncExternalStore)(S,b,b)}var C=`ok-ask-ai-agent-v2`,w=`ok-ask-ai-default-agent-v1`,T=`ok-preferred-agent-v1`,E=`terminal-cli`;function D(e){return`${E}:${e}`}var O=`in-app-thread`;function k(e){return`${O}:${e.source}:${e.id}`}function A(e){if(e===null)return null;if(e===`in-app-thread`)return{kind:`default`};let t=`${O}:`;if(!e.startsWith(t))return null;let n=e.slice(t.length),r=n.indexOf(`:`);if(r<=0)return null;let i=n.slice(0,r),a=n.slice(r+1);return i!==`registry`&&i!==`custom`||a===``?null:{kind:`concrete`,source:i,id:a}}function j(e){return e===null?null:e===`terminal-cli`?`claude`:u.find(t=>e===D(t))??null}function M(e){if(e)return e;if(typeof window>`u`)return null;try{return window.localStorage}catch{return null}}function N(e){let t=M(e);if(!t)return null;try{let e=t.getItem(C);return e===null?t.getItem(w)??t.getItem(T):e}catch{return null}}function P(e,t){let n=M(t);if(n)try{n.setItem(C,e)}catch(e){console.warn(`[ask-ai] Failed to persist default agent:`,e)}}var F=`ok-terminal-new-tab-bare-v1`;function I(e){try{return(e??localStorage).getItem(F)===`1`}catch{return!1}}function L(e,t){try{let n=t??localStorage;e?n.setItem(F,`1`):n.removeItem(F)}catch{}}function R(){try{return typeof localStorage>`u`?!1:I()}catch{return!1}}function z(e,t){return u.filter(n=>c(e,n,t))}function B(e){return s.filter(t=>l(e,t.id)).map(e=>e.id)}function V(e){let{sticky:t,effectiveThreadAgent:n,enabledClis:r,enabledDesktopTargets:i,installedClis:a,terminalAvailable:o,threadsAvailable:s,desktopSelectable:c,preferBareTerminal:l,bareTerminalFallback:u}=e;if(l&&o)return{kind:`terminal`};if(s&&A(t)!==null&&n!==null)return{kind:`thread`,agent:n};if(o){let e=j(t);if(e!==null&&r.includes(e))return{kind:`cli`,cli:e}}return c&&t!==null&&i.includes(t)?{kind:`desktop`,target:t}:s&&n!==null?{kind:`thread`,agent:n}:o&&r.length>0?{kind:`cli`,cli:r.find(e=>a[e]===!0)??r[0]}:c&&i.length>0?{kind:`desktop`,target:i[0]}:u&&o?{kind:`terminal`}:{kind:`none`}}var H=r(),U=t();function ne(e){let t=(0,H.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let a;t[3]===n?a=t[4]:(a=i(`group/input-group relative flex h-8 w-full min-w-0 items-center rounded-lg border border-input transition-colors outline-none in-data-[slot=combobox-content]:focus-within:border-inherit in-data-[slot=combobox-content]:focus-within:ring-0 has-disabled:bg-input/50 has-disabled:opacity-50 has-[[data-slot=input-group-control]:focus-visible]:border-ring has-[[data-slot=input-group-control]:focus-visible]:ring-3 has-[[data-slot=input-group-control]:focus-visible]:ring-ring/50 has-[[data-slot][aria-invalid=true]]:border-destructive has-[[data-slot][aria-invalid=true]]:ring-3 has-[[data-slot][aria-invalid=true]]:ring-destructive/20 has-[>[data-align=block-end]]:h-auto has-[>[data-align=block-end]]:flex-col has-[>[data-align=block-start]]:h-auto has-[>[data-align=block-start]]:flex-col has-[>textarea]:h-auto dark:bg-input/30 dark:has-disabled:bg-input/80 dark:has-[[data-slot][aria-invalid=true]]:ring-destructive/40 has-[>[data-align=block-end]]:[&>input]:pt-3 has-[>[data-align=block-start]]:[&>input]:pb-3 has-[>[data-align=inline-end]]:[&>input]:pr-1.5 has-[>[data-align=inline-start]]:[&>input]:pl-1.5`,n),t[3]=n,t[4]=a);let o;return t[5]!==r||t[6]!==a?(o=(0,U.jsx)(`div`,{"data-slot":`input-group`,className:a,...r}),t[5]=r,t[6]=a,t[7]=o):o=t[7],o}var W=o(`flex h-auto cursor-text items-center justify-center gap-2 py-1.5 text-sm font-medium text-muted-foreground select-none group-data-[disabled=true]/input-group:opacity-50 [&>kbd]:rounded-[calc(var(--radius)-5px)] [&>svg:not([class*='size-'])]:size-4`,{variants:{align:{"inline-start":`order-first pl-2 has-[>button]:ml-[-0.3rem] has-[>kbd]:ml-[-0.15rem]`,"inline-end":`order-last pr-2 has-[>button]:mr-[-0.3rem] has-[>kbd]:mr-[-0.15rem]`,"block-start":`order-first w-full justify-start px-2.5 pt-2 group-has-[>input]/input-group:pt-2 [.border-b]:pb-2`,"block-end":`order-last w-full justify-start px-2.5 pb-2 group-has-[>input]/input-group:pb-2 [.border-t]:pt-2`}},defaultVariants:{align:`inline-start`}});function G(e){let t=(0,H.c)(11),n,r,a;t[0]===e?(n=t[1],r=t[2],a=t[3]):({className:n,align:a,...r}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=a);let o=a===void 0?`inline-start`:a,s;t[4]!==o||t[5]!==n?(s=i(W({align:o}),n),t[4]=o,t[5]=n,t[6]=s):s=t[6];let c;return t[7]!==o||t[8]!==r||t[9]!==s?(c=(0,U.jsx)(`div`,{"data-slot":`input-group-addon`,"data-align":o,className:s,onMouseDown:K,...r}),t[7]=o,t[8]=r,t[9]=s,t[10]=c):c=t[10],c}function K(e){e.target.closest(`button`)||(e.preventDefault(),e.currentTarget.parentElement?.querySelector(`input`)?.focus())}o(`flex items-center gap-2 text-sm shadow-none`,{variants:{size:{xs:`h-6 gap-1 rounded-[calc(var(--radius)-3px)] px-1.5 [&>svg:not([class*='size-'])]:size-3.5`,sm:``,"icon-xs":`size-6 rounded-[calc(var(--radius)-3px)] p-0 has-[>svg]:p-0`,"icon-sm":`size-8 p-0 has-[>svg]:p-0`}},defaultVariants:{size:`xs`}});function q(e){let t=(0,H.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let a;t[3]===n?a=t[4]:(a=i(`flex items-center gap-2 text-sm text-muted-foreground [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4`,n),t[3]=n,t[4]=a);let o;return t[5]!==r||t[6]!==a?(o=(0,U.jsx)(`span`,{className:a,...r}),t[5]=r,t[6]=a,t[7]=o):o=t[7],o}function J(e){let t=(0,H.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let a;t[3]===n?a=t[4]:(a=i(`flex-1 rounded-none border-0 bg-transparent shadow-none ring-0 focus-visible:ring-0 disabled:bg-transparent aria-invalid:ring-0 dark:bg-transparent dark:disabled:bg-transparent`,n),t[3]=n,t[4]=a);let o;return t[5]!==r||t[6]!==a?(o=(0,U.jsx)(d,{"data-slot":`input-group-control`,className:a,...r}),t[5]=r,t[6]=a,t[7]=o):o=t[7],o}var Y=`mr-1.5 flex size-5 shrink-0 cursor-pointer items-center justify-center rounded-sm text-muted-foreground outline-none transition hover:bg-foreground/10 hover:text-foreground hover:opacity-100 focus-visible:ring-2 focus-visible:ring-ring/50`,X=`border-border bg-background text-foreground hover:bg-background focus-visible:bg-background`,Z={start:[f.Space],cancel:[f.Esc],end:[f.Space,f.Enter]};function re(e){return i(Y,e?`opacity-100`:`pointer-events-none opacity-0 group-hover:pointer-events-auto group-hover:opacity-100`)}function ie(e){return e?void 0:-1}function ae({className:e,isDragging:t}){return i(e,t&&X)}function oe(e){return e.code===f.Enter&&e.target===e.currentTarget}function se({event:e,hasKeyboardActivation:t,isDragging:n}){return e.defaultPrevented?`ignore`:!n&&t&&oe(e)?`activate-tab`:`delegate-sortable`}function Q({activeWidth:e,isDragging:t,outerStyle:n,transform:r,transition:i}){let a=t&&e?e:void 0;return{...n,transform:m.Transform.toString(r?{...r,scaleX:1,scaleY:1}:null),transition:i,flexBasis:a??n?.flexBasis,maxWidth:a??n?.maxWidth,minWidth:a??n?.minWidth,opacity:n?.opacity,width:a??n?.width,zIndex:t?20:n?.zIndex}}function ce(e,t){let n=e?.querySelectorAll(t)??[],r=1/0,i=-1/0;for(let e of n){let t=e.getBoundingClientRect();r=Math.min(r,t.left),i=Math.max(i,t.right)}return Number.isFinite(r)&&Number.isFinite(i)?{left:r,right:i}:null}function le(e){return({activeNodeRect:t,transform:n})=>{let r={...n,y:0};if(!e||!t)return r;let i=e.left-t.left,a=e.right-t.right;return r.x=Math.min(Math.max(r.x,i),a),r}}var ue=e=>{let{droppableContainers:t,droppableRects:n,pointerCoordinates:r}=e;if(r){let e=1/0,i=-1/0,a=null,o=null;for(let r of t){let t=n.get(r.id);t&&(t.left<e&&(e=t.left,a=r),t.right>i&&(i=t.right,o=r))}if(!Number.isFinite(e)||!Number.isFinite(i))return[];let s=r.x<e?a:r.x>i?o:null;if(s)return[{id:s.id,data:{droppableContainer:s,value:0}}]}return p(e)};function de(e){Math.abs(e.deltaX)>=Math.abs(e.deltaY)||e.currentTarget.scrollWidth<=e.currentTarget.clientWidth||(e.preventDefault(),e.currentTarget.scrollLeft+=e.deltaY)}var $=`open-knowledge:terminal-launch`;function fe(e,t,n=typeof window>`u`?new EventTarget:window){n.dispatchEvent(new CustomEvent($,{detail:{prompt:e,cli:t}}))}function pe(e,t=typeof window>`u`?new EventTarget:window){let n=t=>{let n=t instanceof CustomEvent?t.detail:void 0;n&&typeof n.prompt==`string`&&e(n.prompt,n.cli)};return t.addEventListener($,n),()=>t.removeEventListener($,n)}export{te as A,O as C,D,P as E,h as M,ee as N,k as O,L as S,j as T,B as _,le as a,R as b,Q as c,ce as d,ue as f,q as g,J as h,Z as i,g as j,x as k,re as l,G as m,pe as n,ae as o,ne as p,de as r,se as s,fe as t,ie as u,z as v,N as w,I as x,V as y};
|
package/dist/public/assets/{terminal-telemetry-D1lMQO11.js → terminal-telemetry-zqEIM46I.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{i as e}from"./chunk-DseTPa7n.js";import{t}from"./react-JNybMug3.js";import{t as n}from"./useQuery-NsPxD6kI.js";import{t as r}from"./compiler-runtime-dQcBxOhn.js";import{S as i}from"./agent-visibility-
|
|
1
|
+
import{i as e}from"./chunk-DseTPa7n.js";import{t}from"./react-JNybMug3.js";import{t as n}from"./useQuery-NsPxD6kI.js";import{t as r}from"./compiler-runtime-dQcBxOhn.js";import{S as i}from"./agent-visibility-BUmsS0vL.js";import{t as a}from"./trace-api-CXljsYUC.js";var o=r(),s=e(t(),1);function c(e){let t=[`claude-acp`,`codex-acp`,`cursor`,`opencode`],n=e=>{let n=t.indexOf(e);return n===-1?t.length:n};return e.filter(e=>e.supported&&e.harness?.availability===`present`).sort((e,t)=>n(e.id)-n(t.id))}async function l(e){let t=await fetch(`/api/acp/catalog`,{signal:e??AbortSignal.timeout(2e4)});if(!t.ok)throw Error(`agent catalog request failed: HTTP ${t.status}`);let n=await t.json();return{agents:Array.isArray(n.agents)?n.agents:[],stale:n.stale===!0,maxThreads:typeof n.maxThreads==`number`?n.maxThreads:8}}function u(){let e=(0,o.c)(4),t;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t={queryKey:[`acp-catalog`],queryFn:f,staleTime:3e5},e[0]=t):t=e[0];let{data:r}=n(t),a=r?.agents,c,l;e[1]===a?(c=e[2],l=e[3]):(c=()=>{a&&i(a.map(d))},l=[a],e[1]=a,e[2]=c,e[3]=l),(0,s.useEffect)(c,l)}function d(e){return{source:e.source,id:e.id,name:e.name,supported:e.supported,...e.iconUrl===void 0?{}:{iconUrl:e.iconUrl}}}function f(e){let{signal:t}=e;return l(t)}var p=`open-knowledge-app`;function m(e){try{a.getTracer(p).startSpan(e).end()}catch(e){console.warn(`[terminal-telemetry] span emit failed:`,e instanceof Error?e:String(e))}}function h(){m(`ok.desktop.terminalOpened`)}function g(){m(`ok.desktop.shellConsentGranted`)}export{u as a,l as i,h as n,c as r,g as t};
|
package/dist/public/assets/{typing-burst-detector-CjccvkIX.js → typing-burst-detector-D-Tl1w8f.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{i as e}from"./chunk-DseTPa7n.js";import{t}from"./jsx-runtime-DyiINK0N.js";import{n}from"./DocumentContext-Y1Gu1DW-.js";import{t as r}from"./react-JNybMug3.js";import{n as i,r as a}from"./dist-DBENJeML.js";import{r as o,t as s}from"./useQuery-NsPxD6kI.js";import{t as c}from"./compiler-runtime-dQcBxOhn.js";import{s as l}from"./createLucideIcon-BUb14crZ.js";import{t as u}from"./button-DHE6Sx02.js";import{n as d,r as f,t as p}from"./collapsible-BIzY37go.js";import{B as m,I as h}from"./CodeMirrorPropInput-BNR51IWy.js";import{n as g,t as _}from"./toggle-group-CxrQL99E.js";import{Yr as v,fr as y,gt as b,pt as x}from"./dist-df-v6kvy.js";import{t as S}from"./chevron-right-zaL9JagC.js";import{n as C}from"./CopyButton-D0gTyMvW.js";import{i as w}from"./prop-types-C0wWXvTx.js";import{l as T}from"./workspace-paths-nkXut9sM.js";import{t as E}from"./refresh-cw-DSH9Of_0.js";import{t as D}from"./triangle-alert-DpxK7pzx.js";import{t as O}from"./wrench-BDWKT3wQ.js";import{n as k}from"./dist-DwCd6eR-.js";import{t as A}from"./dist-BD3698ve.js";import{i as j}from"./startup-marks-CytO17UM.js";import{a as M,s as N}from"./doc-hash-NyLrtNo2.js";import{t as P}from"./badge-BDZGi1Ks.js";import{a as ee,i as F,n as te,o as ne,r as re,s as ie,t as ae}from"./panel-DLUMbyPl.js";import{t as I}from"./skeleton-CA6hvjst.js";import{i as L,r as R}from"./lint-config-client-BwIg_Zty.js";var z=e(r(),1),B=c(),V=3e4,H=new Map;function U(e){return e?Date.now()-e.rememberedAt>V?null:e.navigation:null}function W(e,t){H.set(e,{navigation:t,rememberedAt:Date.now()})}function G(e){return U(H.get(e))}function K(e){let t=H.get(e);return H.delete(e),U(t)}function q(e){H.delete(e)}function oe(e,t){let n=(0,B.c)(4),r=t===void 0?!1:t,[i,a]=(0,z.useState)(void 0),o=(0,z.useRef)(null),s,c;return n[0]!==r||n[1]!==e?(s=()=>{if(r||e.length===0){a(void 0);return}let t=function(){let t=window.innerHeight/2,n,r;for(let i of e){let e=document.getElementById(i);if(!e)continue;let a=e.getBoundingClientRect().top;a<0?n=i:r===void 0&&a<t&&(r=i)}a(r??n??e[0])},n=function(){o.current===null&&(o.current=requestAnimationFrame(()=>{o.current=null,t()}))};return document.addEventListener(`scroll`,n,{capture:!0,passive:!0}),t(),()=>{document.removeEventListener(`scroll`,n,{capture:!0}),o.current!==null&&(cancelAnimationFrame(o.current),o.current=null)}},c=[e,r],n[0]=r,n[1]=e,n[2]=s,n[3]=c):(s=n[2],c=n[3]),(0,z.useEffect)(s,c),i}var J=t(),se=300;async function ce(e){let t=await fetch(`/api/page-headings?docName=${encodeURIComponent(e)}`),n;try{n=await t.json()}catch(e){throw new m(A._({id:`qAQVSD`}),{cause:e,status:t.status})}if(!t.ok){let e=b.safeParse(n);throw e.success?Error(e.data.title):new m(A._({id:`zlErBl`}),{status:t.status})}let r=x.safeParse(n);if(!r.success)throw new m(A._({id:`XW18jo`}),{status:t.status});return r.data.headings??[]}var le=32,Y=12,X=6,ue=`open-knowledge:outline-nav`;function Z(e){let t=(0,B.c)(2),n;return t[0]===e?n=t[1]:(n=(0,J.jsx)(j,{name:`outline-panel`,children:(0,J.jsx)(de,{...e})}),t[0]=e,t[1]=n),n}function de(e){let t=(0,B.c)(50),{docName:r,isSourceMode:c,className:u}=e,d=u===void 0?``:u,{_:f}=a(),{pages:p,loading:m}=w(),h=o(),{activeProvider:g,activeDocName:_}=n(),v,b;t[0]===r?(v=t[1],b=t[2]):(v=[`page-headings`,r],b=()=>ce(r),t[0]=r,t[1]=v,t[2]=b);let x;t[3]!==r||t[4]!==m||t[5]!==p?(x=!m&&(p.has(r)||y(r)),t[3]=r,t[4]=m,t[5]=p,t[6]=x):x=t[6];let S;t[7]!==v||t[8]!==b||t[9]!==x?(S={queryKey:v,queryFn:b,enabled:x,staleTime:1/0},t[7]=v,t[8]=b,t[9]=x,t[10]=S):S=t[10];let{data:C,isLoading:T,error:E}=s(S),D;t[11]===C?D=t[12]:(D=C===void 0?[]:C,t[11]=C,t[12]=D);let O=D,k,A;t[13]!==_||t[14]!==g||t[15]!==r||t[16]!==h?(k=()=>{if(!g||_!==r)return;let e=g.document,t=null,n=()=>{t!==null&&clearTimeout(t),t=setTimeout(()=>{t=null,h.invalidateQueries({queryKey:[`page-headings`,r]})},se)};return e.on(`update`,n),()=>{e.off(`update`,n),t!==null&&clearTimeout(t)}},A=[g,_,r,h],t[13]=_,t[14]=g,t[15]=r,t[16]=h,t[17]=k,t[18]=A):(k=t[17],A=t[18]),(0,z.useEffect)(k,A);let j;t[19]===O?j=t[20]:(j=O.map(fe),t[19]=O,t[20]=j);let M=oe(j,c),N;t[21]!==M||t[22]!==O?(N=M?O.findIndex(e=>e.slug===M):-1,t[21]=M,t[22]=O,t[23]=N):N=t[23];let P=N,I;t[24]!==r||t[25]!==c?(I=function(e,t){let n={index:e,slug:t,mode:c?`source`:`wysiwyg`};n.mode===`source`&&W(r,{kind:`outline`,detail:n}),window.dispatchEvent(new CustomEvent(ue,{detail:n}))},t[24]=r,t[25]=c,t[26]=I):I=t[26];let L=I,R=((P>=0?O[P].level:1)-1)*Y+(Y-X)/2,V=P*le+(le-X)/2,H;t[27]===Symbol.for(`react.memo_cache_sentinel`)?(H=(0,J.jsx)(ie,{children:(0,J.jsx)(i,{id:`dD7NPy`})}),t[27]=H):H=t[27];let U;t[28]!==O.length||t[29]!==T?(U=!T&&(0,J.jsx)(re,{children:O.length}),t[28]=O.length,t[29]=T,t[30]=U):U=t[30];let G;t[31]===U?G=t[32]:(G=(0,J.jsxs)(ne,{children:[H,U]}),t[31]=U,t[32]=G);let K;t[33]!==f||t[34]!==P||t[35]!==M||t[36]!==E||t[37]!==L||t[38]!==O||t[39]!==T||t[40]!==R||t[41]!==V?(K=E?(0,J.jsx)(ee,{className:`px-2`,children:E instanceof Error?E.message:f({id:`GuqOb1`})}):O.length===0&&!T?(0,J.jsx)(F,{className:`px-2`,children:(0,J.jsx)(i,{id:`0BB9ID`})}):(0,J.jsxs)(`nav`,{"aria-label":f({id:`BymzO4`}),className:`relative`,children:[P>=0&&(0,J.jsx)(`div`,{"aria-hidden":`true`,className:`pointer-events-none absolute left-0 top-0 rounded-full bg-primary motion-safe:[transition:transform_0.25s_var(--ease-out-strong)]`,style:{width:X,height:X,transform:`translate(${R}px, ${V}px)`}}),O.map((e,t)=>{let n=e.slug===M;return(0,J.jsx)(`button`,{type:`button`,"aria-current":n?`location`:void 0,onClick:()=>L(t,e.slug),className:l(`w-full cursor-pointer truncate py-1.5 pe-2 text-left text-sm transition-colors`,n?`font-medium text-primary`:`text-muted-foreground hover:text-foreground`),style:{paddingLeft:`${(e.level-1)*Y+20}px`},title:e.text,children:e.text},t)})]}),t[33]=f,t[34]=P,t[35]=M,t[36]=E,t[37]=L,t[38]=O,t[39]=T,t[40]=R,t[41]=V,t[42]=K):K=t[42];let q;t[43]!==T||t[44]!==K?(q=(0,J.jsx)(te,{className:`px-3 py-2`,"aria-busy":T,children:K}),t[43]=T,t[44]=K,t[45]=q):q=t[45];let Z;return t[46]!==d||t[47]!==G||t[48]!==q?(Z=(0,J.jsxs)(ae,{className:d,children:[G,q]}),t[46]=d,t[47]=G,t[48]=q,t[49]=Z):Z=t[49],Z}function fe(e){return e.slug}function pe(e){let t=(0,B.c)(10),{scope:n,onScopeChange:r}=e,{_:o}=a(),s;t[0]===r?s=t[1]:(s=e=>{e&&r(e)},t[0]=r,t[1]=s);let c;t[2]===o?c=t[3]:(c=o({id:`aBgwis`}),t[2]=o,t[3]=c);let l;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,J.jsx)(g,{value:`doc`,className:`flex-1`,"data-testid":`panel-scope-doc`,children:(0,J.jsx)(i,{id:`UpCz01`})}),t[4]=l):l=t[4];let u;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(u=(0,J.jsx)(g,{value:`project`,className:`flex-1`,"data-testid":`panel-scope-project`,children:(0,J.jsx)(i,{id:`e0NrBM`})}),t[5]=u):u=t[5];let d;return t[6]!==n||t[7]!==s||t[8]!==c?(d=(0,J.jsx)(`div`,{className:`shrink-0 px-4 pb-2`,children:(0,J.jsxs)(_,{type:`single`,variant:`segmented`,size:`sm`,spacing:1,value:n,onValueChange:s,"aria-label":c,className:`w-full rounded-md bg-muted p-0.5 dark:bg-background`,children:[l,u]})}),t[6]=n,t[7]=s,t[8]=c,t[9]=d):d=t[9],d}var me=`open-knowledge:lint-nav`;function he(e,t){return e.range.start.line-t.range.start.line||e.range.start.character-t.range.start.character}function ge(e){return{line:e.range.start.line+1,column:e.range.start.character+1}}function _e(e){let t=(0,B.c)(19),{diagnostic:n}=e,{_:r}=a(),i=n.severity===`error`?C:D,o=`${n.source}/${n.code}`,s=n.range.start.line+1,c=n.severity===`error`?`text-destructive`:`text-amber-500`,u;t[0]===c?u=t[1]:(u=l(`mt-0.5 size-3.5 shrink-0`,c),t[0]=c,t[1]=u);let d;t[2]!==i||t[3]!==u?(d=(0,J.jsx)(i,{"aria-hidden":`true`,className:u}),t[2]=i,t[3]=u,t[4]=d):d=t[4];let f;t[5]===n.message?f=t[6]:(f=(0,J.jsx)(`span`,{className:`text-foreground`,children:n.message}),t[5]=n.message,t[6]=f);let p;t[7]!==d||t[8]!==f?(p=(0,J.jsxs)(`span`,{className:`flex items-start gap-1.5 text-sm`,children:[d,f]}),t[7]=d,t[8]=f,t[9]=p):p=t[9];let m;t[10]!==r||t[11]!==s?(m=r({id:`enPTnx`,values:{displayLine:s}}),t[10]=r,t[11]=s,t[12]=m):m=t[12];let h;t[13]!==o||t[14]!==m?(h=(0,J.jsxs)(`span`,{className:`ps-5 font-mono text-xs text-muted-foreground`,children:[o,` · `,m]}),t[13]=o,t[14]=m,t[15]=h):h=t[15];let g;return t[16]!==p||t[17]!==h?(g=(0,J.jsxs)(J.Fragment,{children:[p,h]}),t[16]=p,t[17]=h,t[18]=g):g=t[18],g}function ve(e){return`${e.source}/${e.code}-${e.range.start.line}-${e.range.start.character}-${e.message}`}function ye(e){return e.reduce((e,t)=>e+ +((t.fixes?.length??0)>0),0)}function be(e){let t=(0,B.c)(13),{count:n,disabled:r,onClick:o,children:s}=e,{_:c}=a(),l;t[0]!==c||t[1]!==s||t[2]!==n?(l=s===void 0?c({id:`Izb10l`,values:{count:n}}):void 0,t[0]=c,t[1]=s,t[2]=n,t[3]=l):l=t[3];let d;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(d=(0,J.jsx)(O,{"aria-hidden":`true`,className:`size-3`}),t[4]=d):d=t[4];let f;t[5]!==s||t[6]!==n?(f=s??(0,J.jsx)(i,{id:`5_8TCr`,values:{count:n}}),t[5]=s,t[6]=n,t[7]=f):f=t[7];let p;return t[8]!==r||t[9]!==o||t[10]!==l||t[11]!==f?(p=(0,J.jsxs)(u,{size:`sm`,variant:`ghost`,className:`h-6 shrink-0 px-2 text-xs`,disabled:r,onClick:o,"aria-label":l,"data-testid":`problems-fix-all`,children:[d,f]}),t[8]=r,t[9]=o,t[10]=l,t[11]=f,t[12]=p):p=t[12],p}function xe(e){let t=(0,B.c)(21),{docName:n,diagnostics:r,onFix:o,onFixAll:s,onAskAi:c}=e,{_:l}=a(),[d,f]=(0,z.useState)(`doc`),p;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(p={status:`idle`},t[0]=p):p=t[0];let[m,h]=(0,z.useState)(p),[g,_]=(0,z.useState)(null),v=(0,z.useRef)(!0),y,b;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(y=()=>(v.current=!0,()=>{v.current=!1}),b=[],t[1]=y,t[2]=b):(y=t[1],b=t[2]),(0,z.useEffect)(y,b);let x;if(t[3]!==l||t[4]!==m||t[5]!==r||t[6]!==n||t[7]!==c||t[8]!==o||t[9]!==s||t[10]!==g||t[11]!==d){let e=[...r].sort(he),a=async function(){h({status:`loading`});let e=await L();v.current&&h(e===null?{status:`failed`}:{status:`loaded`,result:e})},p=m.status===`loaded`?m.result.files.filter(we):[],y=async function(){if(g!==null||p.length===0)return;_({done:0,total:p.length});let e=[];for(let t of p){let n=await R(M(t.file));if(!v.current)return;n.ok||e.push({file:t.file,detail:n.errorDetail}),_(Ce)}if(_(null),e.length>0){let t=e[0];k.error(l({id:`fru3T7`,values:{0:e.length,1:p.length}}),{description:t===void 0?void 0:`${t.file}${t.detail===null?``:` — ${t.detail}`}`})}try{await a()}catch{v.current&&h({status:`failed`})}},b=function(e){f(e),e===`project`&&m.status===`idle`&&a()},S;t[13]===n?S=t[14]:(S=function(e){let t=ge(e);W(n,{kind:`lint`,detail:t}),window.dispatchEvent(new CustomEvent(me,{detail:t}))},t[13]=n,t[14]=S);let C=S,w;t[15]!==n||t[16]!==C?(w=function(e,t){let r=M(e);if(r===n){C(t);return}W(r,{kind:`lint`,detail:ge(t)}),window.location.hash=N(r)},t[15]=n,t[16]=C,t[17]=w):w=t[17];let E=w,D;t[18]===Symbol.for(`react.memo_cache_sentinel`)?(D=(0,J.jsx)(ie,{children:(0,J.jsx)(i,{id:`OXdGnd`})}),t[18]=D):D=t[18];let A=d===`doc`&&e.length>0&&(0,J.jsx)(re,{children:e.length}),j;t[19]===A?j=t[20]:(j=(0,J.jsxs)(ne,{children:[D,A]}),t[19]=A,t[20]=j),x=(0,J.jsxs)(ae,{children:[j,(0,J.jsx)(pe,{scope:d,onScopeChange:b}),d===`doc`?(0,J.jsx)(te,{className:`px-2 py-2`,children:e.length===0?(0,J.jsx)(F,{className:`px-2`,children:(0,J.jsx)(i,{id:`ZI8uvA`})}):(0,J.jsxs)(J.Fragment,{children:[s!==void 0&&(0,J.jsx)(`div`,{className:`flex items-center justify-end gap-2 px-2 pb-1`,children:(0,J.jsx)(be,{count:ye(e),disabled:ye(e)===0,onClick:s})}),(0,J.jsx)(`ul`,{"aria-label":l({id:`OXdGnd`}),className:`flex flex-col gap-0.5`,children:e.map(e=>{let t=e.range.start.line+1,n=o!==void 0&&(e.fixes?.length??0)>0,r=`${e.source}/${e.code}`;return(0,J.jsxs)(`li`,{className:`group relative rounded transition-colors hover:bg-muted`,children:[(0,J.jsx)(`button`,{type:`button`,onClick:()=>C(e),className:`flex w-full cursor-pointer flex-col gap-0.5 rounded px-2 py-1.5 text-left`,title:l({id:`aHPdYV`,values:{displayLine:t}}),children:(0,J.jsx)(_e,{diagnostic:e})}),n||c!==void 0?(0,J.jsxs)(`div`,{className:`absolute bottom-1 right-1 flex items-center gap-1 rounded bg-muted opacity-0 transition-opacity focus-within:opacity-100 group-hover:opacity-100 motion-reduce:transition-none`,children:[n?(0,J.jsxs)(u,{size:`sm`,variant:`ghost`,className:`h-6 shrink-0 px-2 text-xs`,onClick:()=>o?.(e),"aria-label":l({id:`fZj9em`,values:{flatId:r}}),"data-testid":`problems-fix`,children:[(0,J.jsx)(O,{"aria-hidden":`true`,className:`size-3`}),(0,J.jsx)(i,{id:`c4fVUV`})]}):null,c===void 0?null:(0,J.jsxs)(u,{size:`sm`,variant:`ghost`,className:`h-6 shrink-0 px-2 text-xs`,onClick:()=>c(e),"aria-label":l({id:`hh4mVC`,values:{flatId:r}}),"data-testid":`problems-ask-ai`,children:[(0,J.jsx)(T,{"aria-hidden":`true`,className:`size-3`}),(0,J.jsx)(i,{id:`xWEvuo`})]})]}):null]},ve(e))})})]})}):(0,J.jsx)(Ee,{audit:m,onRefresh:()=>void a(),onNavigate:E,fixableCount:p.reduce(Se,0),fixing:g,onFixAll:()=>void y()})]}),t[3]=l,t[4]=m,t[5]=r,t[6]=n,t[7]=c,t[8]=o,t[9]=s,t[10]=g,t[11]=d,t[12]=x}else x=t[12];return x}function Se(e,t){return e+ye(t.diagnostics)}function Ce(e){return e===null?e:{...e,done:e.done+1}}function we(e){return e.diagnostics.some(Te)}function Te(e){return(e.fixes?.length??0)>0}function Ee(e){let t=(0,B.c)(43),{audit:n,onRefresh:r,onNavigate:o,fixableCount:s,fixing:c,onFixAll:l}=e,{_:d}=a(),f=n.status===`loading`||n.status===`idle`,p;t[0]!==n.result||t[1]!==n.status?(p=n.status===`loaded`&&(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(i,{id:`DsDwR-`,values:{0:n.result.errorCount}}),` · `,(0,J.jsx)(i,{id:`W1SI2K`,values:{0:n.result.warningCount}})]}),t[0]=n.result,t[1]=n.status,t[2]=p):p=t[2];let m;t[3]===p?m=t[4]:(m=(0,J.jsx)(`p`,{className:`text-xs text-muted-foreground`,"data-testid":`problems-audit-summary`,children:p}),t[3]=p,t[4]=m);let h;t[5]!==d||t[6]!==c?(h=c===null?null:(0,J.jsx)(`span`,{className:`sr-only`,role:`status`,children:d({id:`gZElfU`,values:{0:c.done,1:c.total}})}),t[5]=d,t[6]=c,t[7]=h):h=t[7];let g=f||c!==null||s===0,_;t[8]===c?_=t[9]:(_=c===null?void 0:(0,J.jsx)(i,{id:`S9t1PI`,values:{0:c.done,1:c.total}}),t[8]=c,t[9]=_);let v;t[10]!==s||t[11]!==l||t[12]!==g||t[13]!==_?(v=(0,J.jsx)(be,{count:s,disabled:g,onClick:l,children:_}),t[10]=s,t[11]=l,t[12]=g,t[13]=_,t[14]=v):v=t[14];let y;t[15]===d?y=t[16]:(y=d({id:`WRdYfS`}),t[15]=d,t[16]=y);let b=f||c!==null,x;t[17]===Symbol.for(`react.memo_cache_sentinel`)?(x=(0,J.jsx)(E,{"aria-hidden":`true`,className:`size-3.5`}),t[17]=x):x=t[17];let S;t[18]!==r||t[19]!==y||t[20]!==b?(S=(0,J.jsx)(u,{variant:`ghost`,size:`icon`,className:`size-6 shrink-0 text-muted-foreground`,"aria-label":y,"data-testid":`problems-audit-refresh`,disabled:b,onClick:r,children:x}),t[18]=r,t[19]=y,t[20]=b,t[21]=S):S=t[21];let C;t[22]!==S||t[23]!==h||t[24]!==v?(C=(0,J.jsxs)(`div`,{className:`flex shrink-0 items-center gap-1`,children:[h,v,S]}),t[22]=S,t[23]=h,t[24]=v,t[25]=C):C=t[25];let w;t[26]!==C||t[27]!==m?(w=(0,J.jsxs)(`div`,{className:`flex items-center justify-between gap-2 px-2 pb-1`,children:[m,C]}),t[26]=C,t[27]=m,t[28]=w):w=t[28];let T;t[29]!==d||t[30]!==f?(T=f&&(0,J.jsx)(`div`,{className:`flex flex-col gap-1`,role:`status`,"aria-busy":`true`,"aria-label":d({id:`dx-TwN`}),children:[1,2,3].map(De)}),t[29]=d,t[30]=f,t[31]=T):T=t[31];let D;t[32]===n.status?D=t[33]:(D=n.status===`failed`&&(0,J.jsx)(ee,{className:`px-2 text-xs`,children:(0,J.jsx)(i,{id:`IFezUv`})}),t[32]=n.status,t[33]=D);let O;t[34]!==n.result||t[35]!==n.status||t[36]!==o?(O=n.status===`loaded`&&(0,J.jsx)(Oe,{result:n.result,onNavigate:o}),t[34]=n.result,t[35]=n.status,t[36]=o,t[37]=O):O=t[37];let k;return t[38]!==w||t[39]!==T||t[40]!==D||t[41]!==O?(k=(0,J.jsxs)(te,{className:`px-2 py-2`,"data-testid":`problems-project-scope`,children:[w,T,D,O]}),t[38]=w,t[39]=T,t[40]=D,t[41]=O,t[42]=k):k=t[42],k}function De(e){return(0,J.jsxs)(`div`,{className:`flex items-start gap-2.5 rounded px-2 py-1.5`,children:[(0,J.jsx)(I,{className:`mt-0.5 size-3.5 shrink-0 rounded`}),(0,J.jsxs)(`div`,{className:`flex-1 space-y-1.5`,children:[(0,J.jsx)(I,{className:`h-3 w-28`}),(0,J.jsx)(I,{className:`h-3 w-40`})]})]},e)}function Oe(e){let t=(0,B.c)(10),{result:n,onNavigate:r}=e,{_:o}=a(),s;t[0]!==o||t[1]!==n.warnings?(s=n.warnings.length>0&&(0,J.jsx)(`ul`,{"aria-label":o({id:`Rsdhj9`}),className:`flex flex-col gap-0.5 pb-1`,children:n.warnings.map(ke)}),t[0]=o,t[1]=n.warnings,t[2]=s):s=t[2];let c;t[3]!==r||t[4]!==n.fileCount||t[5]!==n.files?(c=n.files.length===0?(0,J.jsx)(F,{className:`px-2`,children:(0,J.jsx)(i,{id:`k_Dqw1`,values:{0:n.fileCount}})}):n.files.map(e=>(0,J.jsx)(Ae,{file:e,onNavigate:r},e.file)),t[3]=r,t[4]=n.fileCount,t[5]=n.files,t[6]=c):c=t[6];let l;return t[7]!==s||t[8]!==c?(l=(0,J.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[s,c]}),t[7]=s,t[8]=c,t[9]=l):l=t[9],l}function ke(e,t){return(0,J.jsxs)(`li`,{className:`flex items-start gap-1.5 px-2 text-xs`,children:[(0,J.jsx)(D,{"aria-hidden":`true`,className:`mt-0.5 size-3.5 shrink-0 text-amber-500`}),(0,J.jsx)(`span`,{className:`min-w-0 text-foreground`,children:e})]},`${t}-${e}`)}function Ae(e){let t=(0,B.c)(37),{file:n,onNavigate:r}=e,{_:i}=a(),o,s,c,l,u,m,h,g,_;if(t[0]!==i||t[1]!==n.diagnostics||t[2]!==n.file||t[3]!==r){let e=[...n.diagnostics].sort(he);s=p,h=!0,g=`problems-audit-group`;let a;t[13]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,J.jsx)(S,{"aria-hidden":`true`,className:`size-3.5 shrink-0 text-muted-foreground transition-transform group-data-[state=open]:rotate-90 motion-reduce:transition-none`}),t[13]=a):a=t[13];let v;t[14]===n.file?v=t[15]:(v=(0,J.jsx)(`span`,{className:`min-w-0 flex-1 truncate font-mono text-xs text-foreground`,title:n.file,children:n.file}),t[14]=n.file,t[15]=v),_=(0,J.jsxs)(f,{className:`group flex w-full cursor-pointer items-center gap-1.5 rounded px-2 py-1.5 text-left transition-colors hover:bg-muted`,children:[a,v,(0,J.jsx)(P,{variant:`gray`,"data-testid":`problems-audit-file-count`,className:`shrink-0`,children:e.length})]}),o=d,m=`overflow-hidden data-[state=open]:animate-[collapsible-down_150ms_ease-out] data-[state=closed]:animate-[collapsible-up_150ms_ease-in]`,t[16]!==i||t[17]!==n.file?(c=i({id:`zAJzIg`,values:{0:n.file}}),t[16]=i,t[17]=n.file,t[18]=c):c=t[18],l=`flex flex-col gap-0.5 pb-1 ps-3`;let y;t[19]!==i||t[20]!==n.file||t[21]!==r?(y=e=>{let t=e.range.start.line+1;return(0,J.jsx)(`li`,{children:(0,J.jsx)(`button`,{type:`button`,onClick:()=>r(n.file,e),className:`flex w-full cursor-pointer flex-col gap-0.5 rounded px-2 py-1.5 text-left transition-colors hover:bg-muted`,title:i({id:`kDwcbW`,values:{0:n.file,displayLine:t}}),children:(0,J.jsx)(_e,{diagnostic:e})})},ve(e))},t[19]=i,t[20]=n.file,t[21]=r,t[22]=y):y=t[22],u=e.map(y),t[0]=i,t[1]=n.diagnostics,t[2]=n.file,t[3]=r,t[4]=o,t[5]=s,t[6]=c,t[7]=l,t[8]=u,t[9]=m,t[10]=h,t[11]=g,t[12]=_}else o=t[4],s=t[5],c=t[6],l=t[7],u=t[8],m=t[9],h=t[10],g=t[11],_=t[12];let v;t[23]!==c||t[24]!==l||t[25]!==u?(v=(0,J.jsx)(`ul`,{"aria-label":c,className:l,children:u}),t[23]=c,t[24]=l,t[25]=u,t[26]=v):v=t[26];let y;t[27]!==o||t[28]!==m||t[29]!==v?(y=(0,J.jsx)(o,{className:m,children:v}),t[27]=o,t[28]=m,t[29]=v,t[30]=y):y=t[30];let b;return t[31]!==s||t[32]!==h||t[33]!==g||t[34]!==_||t[35]!==y?(b=(0,J.jsxs)(s,{defaultOpen:h,"data-testid":g,children:[_,y]}),t[31]=s,t[32]=h,t[33]=g,t[34]=_,t[35]=y,t[36]=b):b=t[36],b}var je={words:0,chars:0,tokens:0},Me=/[ -〿-ゟ゠-ヿ㐀-䶿一-鿿豈---ក-]/,Ne=/[\p{L}\p{N}]/u,Pe=new Set([`text`,`inlineCode`,`code`,`tag`]),Fe=new Set([`html`,`definition`,`footnoteDefinition`,`yaml`,`toml`,`image`,`imageReference`,`mdxFlowExpression`,`mdxTextExpression`,`mdxjsEsm`,`rawMdxFallback`,`rawMdxFallbackMdast`]),Ie=new Set([`paragraph`,`heading`,`blockquote`,`list`,`listItem`,`thematicBreak`,`table`,`tableRow`,`tableCell`,`mdxJsxFlowElement`,`commentBlock`]);function Le(e,t){if(!e)return;let n=e.type;if(!Fe.has(n)){if(Pe.has(n)){e.value&&(t.push(e.value),n===`code`&&t.push(`
|
|
1
|
+
import{i as e}from"./chunk-DseTPa7n.js";import{t}from"./jsx-runtime-DyiINK0N.js";import{n}from"./DocumentContext-DN3M8p0h.js";import{t as r}from"./react-JNybMug3.js";import{n as i,r as a}from"./dist-DBENJeML.js";import{r as o,t as s}from"./useQuery-NsPxD6kI.js";import{t as c}from"./compiler-runtime-dQcBxOhn.js";import{s as l}from"./createLucideIcon-BUb14crZ.js";import{t as u}from"./button-DHE6Sx02.js";import{n as d,r as f,t as p}from"./collapsible-BIzY37go.js";import{B as m,I as h}from"./CodeMirrorPropInput-Sjp30pzp.js";import{n as g,t as _}from"./toggle-group-CxrQL99E.js";import{Xr as v,fr as y,gt as b,pt as x}from"./dist-CDKZLcnD.js";import{t as S}from"./chevron-right-zaL9JagC.js";import{n as C}from"./CopyButton-D0gTyMvW.js";import{i as w}from"./prop-types-IOhQSrD8.js";import{l as T}from"./workspace-paths-CDfRQ5qH.js";import{t as E}from"./refresh-cw-DSH9Of_0.js";import{t as D}from"./triangle-alert-DpxK7pzx.js";import{t as O}from"./wrench-BDWKT3wQ.js";import{n as k}from"./dist-DwCd6eR-.js";import{t as A}from"./dist-BD3698ve.js";import{i as j}from"./startup-marks-CytO17UM.js";import{a as M,s as N}from"./doc-hash-r2oc1gt-.js";import{t as P}from"./badge-BDZGi1Ks.js";import{a as ee,i as F,n as te,o as ne,r as re,s as ie,t as ae}from"./panel-DLUMbyPl.js";import{t as I}from"./skeleton-CA6hvjst.js";import{i as L,r as R}from"./lint-config-client-C7TVN28Z.js";var z=e(r(),1),B=c(),V=3e4,H=new Map;function U(e){return e?Date.now()-e.rememberedAt>V?null:e.navigation:null}function W(e,t){H.set(e,{navigation:t,rememberedAt:Date.now()})}function G(e){return U(H.get(e))}function K(e){let t=H.get(e);return H.delete(e),U(t)}function q(e){H.delete(e)}function oe(e,t){let n=(0,B.c)(4),r=t===void 0?!1:t,[i,a]=(0,z.useState)(void 0),o=(0,z.useRef)(null),s,c;return n[0]!==r||n[1]!==e?(s=()=>{if(r||e.length===0){a(void 0);return}let t=function(){let t=window.innerHeight/2,n,r;for(let i of e){let e=document.getElementById(i);if(!e)continue;let a=e.getBoundingClientRect().top;a<0?n=i:r===void 0&&a<t&&(r=i)}a(r??n??e[0])},n=function(){o.current===null&&(o.current=requestAnimationFrame(()=>{o.current=null,t()}))};return document.addEventListener(`scroll`,n,{capture:!0,passive:!0}),t(),()=>{document.removeEventListener(`scroll`,n,{capture:!0}),o.current!==null&&(cancelAnimationFrame(o.current),o.current=null)}},c=[e,r],n[0]=r,n[1]=e,n[2]=s,n[3]=c):(s=n[2],c=n[3]),(0,z.useEffect)(s,c),i}var J=t(),se=300;async function ce(e){let t=await fetch(`/api/page-headings?docName=${encodeURIComponent(e)}`),n;try{n=await t.json()}catch(e){throw new m(A._({id:`qAQVSD`}),{cause:e,status:t.status})}if(!t.ok){let e=b.safeParse(n);throw e.success?Error(e.data.title):new m(A._({id:`zlErBl`}),{status:t.status})}let r=x.safeParse(n);if(!r.success)throw new m(A._({id:`XW18jo`}),{status:t.status});return r.data.headings??[]}var le=32,Y=12,X=6,ue=`open-knowledge:outline-nav`;function Z(e){let t=(0,B.c)(2),n;return t[0]===e?n=t[1]:(n=(0,J.jsx)(j,{name:`outline-panel`,children:(0,J.jsx)(de,{...e})}),t[0]=e,t[1]=n),n}function de(e){let t=(0,B.c)(50),{docName:r,isSourceMode:c,className:u}=e,d=u===void 0?``:u,{_:f}=a(),{pages:p,loading:m}=w(),h=o(),{activeProvider:g,activeDocName:_}=n(),v,b;t[0]===r?(v=t[1],b=t[2]):(v=[`page-headings`,r],b=()=>ce(r),t[0]=r,t[1]=v,t[2]=b);let x;t[3]!==r||t[4]!==m||t[5]!==p?(x=!m&&(p.has(r)||y(r)),t[3]=r,t[4]=m,t[5]=p,t[6]=x):x=t[6];let S;t[7]!==v||t[8]!==b||t[9]!==x?(S={queryKey:v,queryFn:b,enabled:x,staleTime:1/0},t[7]=v,t[8]=b,t[9]=x,t[10]=S):S=t[10];let{data:C,isLoading:T,error:E}=s(S),D;t[11]===C?D=t[12]:(D=C===void 0?[]:C,t[11]=C,t[12]=D);let O=D,k,A;t[13]!==_||t[14]!==g||t[15]!==r||t[16]!==h?(k=()=>{if(!g||_!==r)return;let e=g.document,t=null,n=()=>{t!==null&&clearTimeout(t),t=setTimeout(()=>{t=null,h.invalidateQueries({queryKey:[`page-headings`,r]})},se)};return e.on(`update`,n),()=>{e.off(`update`,n),t!==null&&clearTimeout(t)}},A=[g,_,r,h],t[13]=_,t[14]=g,t[15]=r,t[16]=h,t[17]=k,t[18]=A):(k=t[17],A=t[18]),(0,z.useEffect)(k,A);let j;t[19]===O?j=t[20]:(j=O.map(fe),t[19]=O,t[20]=j);let M=oe(j,c),N;t[21]!==M||t[22]!==O?(N=M?O.findIndex(e=>e.slug===M):-1,t[21]=M,t[22]=O,t[23]=N):N=t[23];let P=N,I;t[24]!==r||t[25]!==c?(I=function(e,t){let n={index:e,slug:t,mode:c?`source`:`wysiwyg`};n.mode===`source`&&W(r,{kind:`outline`,detail:n}),window.dispatchEvent(new CustomEvent(ue,{detail:n}))},t[24]=r,t[25]=c,t[26]=I):I=t[26];let L=I,R=((P>=0?O[P].level:1)-1)*Y+(Y-X)/2,V=P*le+(le-X)/2,H;t[27]===Symbol.for(`react.memo_cache_sentinel`)?(H=(0,J.jsx)(ie,{children:(0,J.jsx)(i,{id:`dD7NPy`})}),t[27]=H):H=t[27];let U;t[28]!==O.length||t[29]!==T?(U=!T&&(0,J.jsx)(re,{children:O.length}),t[28]=O.length,t[29]=T,t[30]=U):U=t[30];let G;t[31]===U?G=t[32]:(G=(0,J.jsxs)(ne,{children:[H,U]}),t[31]=U,t[32]=G);let K;t[33]!==f||t[34]!==P||t[35]!==M||t[36]!==E||t[37]!==L||t[38]!==O||t[39]!==T||t[40]!==R||t[41]!==V?(K=E?(0,J.jsx)(ee,{className:`px-2`,children:E instanceof Error?E.message:f({id:`GuqOb1`})}):O.length===0&&!T?(0,J.jsx)(F,{className:`px-2`,children:(0,J.jsx)(i,{id:`0BB9ID`})}):(0,J.jsxs)(`nav`,{"aria-label":f({id:`BymzO4`}),className:`relative`,children:[P>=0&&(0,J.jsx)(`div`,{"aria-hidden":`true`,className:`pointer-events-none absolute left-0 top-0 rounded-full bg-primary motion-safe:[transition:transform_0.25s_var(--ease-out-strong)]`,style:{width:X,height:X,transform:`translate(${R}px, ${V}px)`}}),O.map((e,t)=>{let n=e.slug===M;return(0,J.jsx)(`button`,{type:`button`,"aria-current":n?`location`:void 0,onClick:()=>L(t,e.slug),className:l(`w-full cursor-pointer truncate py-1.5 pe-2 text-left text-sm transition-colors`,n?`font-medium text-primary`:`text-muted-foreground hover:text-foreground`),style:{paddingLeft:`${(e.level-1)*Y+20}px`},title:e.text,children:e.text},t)})]}),t[33]=f,t[34]=P,t[35]=M,t[36]=E,t[37]=L,t[38]=O,t[39]=T,t[40]=R,t[41]=V,t[42]=K):K=t[42];let q;t[43]!==T||t[44]!==K?(q=(0,J.jsx)(te,{className:`px-3 py-2`,"aria-busy":T,children:K}),t[43]=T,t[44]=K,t[45]=q):q=t[45];let Z;return t[46]!==d||t[47]!==G||t[48]!==q?(Z=(0,J.jsxs)(ae,{className:d,children:[G,q]}),t[46]=d,t[47]=G,t[48]=q,t[49]=Z):Z=t[49],Z}function fe(e){return e.slug}function pe(e){let t=(0,B.c)(10),{scope:n,onScopeChange:r}=e,{_:o}=a(),s;t[0]===r?s=t[1]:(s=e=>{e&&r(e)},t[0]=r,t[1]=s);let c;t[2]===o?c=t[3]:(c=o({id:`aBgwis`}),t[2]=o,t[3]=c);let l;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,J.jsx)(g,{value:`doc`,className:`flex-1`,"data-testid":`panel-scope-doc`,children:(0,J.jsx)(i,{id:`UpCz01`})}),t[4]=l):l=t[4];let u;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(u=(0,J.jsx)(g,{value:`project`,className:`flex-1`,"data-testid":`panel-scope-project`,children:(0,J.jsx)(i,{id:`e0NrBM`})}),t[5]=u):u=t[5];let d;return t[6]!==n||t[7]!==s||t[8]!==c?(d=(0,J.jsx)(`div`,{className:`shrink-0 px-4 pb-2`,children:(0,J.jsxs)(_,{type:`single`,variant:`segmented`,size:`sm`,spacing:1,value:n,onValueChange:s,"aria-label":c,className:`w-full rounded-md bg-muted p-0.5 dark:bg-background`,children:[l,u]})}),t[6]=n,t[7]=s,t[8]=c,t[9]=d):d=t[9],d}var me=`open-knowledge:lint-nav`;function he(e,t){return e.range.start.line-t.range.start.line||e.range.start.character-t.range.start.character}function ge(e){return{line:e.range.start.line+1,column:e.range.start.character+1}}function _e(e){let t=(0,B.c)(19),{diagnostic:n}=e,{_:r}=a(),i=n.severity===`error`?C:D,o=`${n.source}/${n.code}`,s=n.range.start.line+1,c=n.severity===`error`?`text-destructive`:`text-amber-500`,u;t[0]===c?u=t[1]:(u=l(`mt-0.5 size-3.5 shrink-0`,c),t[0]=c,t[1]=u);let d;t[2]!==i||t[3]!==u?(d=(0,J.jsx)(i,{"aria-hidden":`true`,className:u}),t[2]=i,t[3]=u,t[4]=d):d=t[4];let f;t[5]===n.message?f=t[6]:(f=(0,J.jsx)(`span`,{className:`text-foreground`,children:n.message}),t[5]=n.message,t[6]=f);let p;t[7]!==d||t[8]!==f?(p=(0,J.jsxs)(`span`,{className:`flex items-start gap-1.5 text-sm`,children:[d,f]}),t[7]=d,t[8]=f,t[9]=p):p=t[9];let m;t[10]!==r||t[11]!==s?(m=r({id:`enPTnx`,values:{displayLine:s}}),t[10]=r,t[11]=s,t[12]=m):m=t[12];let h;t[13]!==o||t[14]!==m?(h=(0,J.jsxs)(`span`,{className:`ps-5 font-mono text-xs text-muted-foreground`,children:[o,` · `,m]}),t[13]=o,t[14]=m,t[15]=h):h=t[15];let g;return t[16]!==p||t[17]!==h?(g=(0,J.jsxs)(J.Fragment,{children:[p,h]}),t[16]=p,t[17]=h,t[18]=g):g=t[18],g}function ve(e){return`${e.source}/${e.code}-${e.range.start.line}-${e.range.start.character}-${e.message}`}function ye(e){return e.reduce((e,t)=>e+ +((t.fixes?.length??0)>0),0)}function be(e){let t=(0,B.c)(13),{count:n,disabled:r,onClick:o,children:s}=e,{_:c}=a(),l;t[0]!==c||t[1]!==s||t[2]!==n?(l=s===void 0?c({id:`Izb10l`,values:{count:n}}):void 0,t[0]=c,t[1]=s,t[2]=n,t[3]=l):l=t[3];let d;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(d=(0,J.jsx)(O,{"aria-hidden":`true`,className:`size-3`}),t[4]=d):d=t[4];let f;t[5]!==s||t[6]!==n?(f=s??(0,J.jsx)(i,{id:`5_8TCr`,values:{count:n}}),t[5]=s,t[6]=n,t[7]=f):f=t[7];let p;return t[8]!==r||t[9]!==o||t[10]!==l||t[11]!==f?(p=(0,J.jsxs)(u,{size:`sm`,variant:`ghost`,className:`h-6 shrink-0 px-2 text-xs`,disabled:r,onClick:o,"aria-label":l,"data-testid":`problems-fix-all`,children:[d,f]}),t[8]=r,t[9]=o,t[10]=l,t[11]=f,t[12]=p):p=t[12],p}function xe(e){let t=(0,B.c)(21),{docName:n,diagnostics:r,onFix:o,onFixAll:s,onAskAi:c}=e,{_:l}=a(),[d,f]=(0,z.useState)(`doc`),p;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(p={status:`idle`},t[0]=p):p=t[0];let[m,h]=(0,z.useState)(p),[g,_]=(0,z.useState)(null),v=(0,z.useRef)(!0),y,b;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(y=()=>(v.current=!0,()=>{v.current=!1}),b=[],t[1]=y,t[2]=b):(y=t[1],b=t[2]),(0,z.useEffect)(y,b);let x;if(t[3]!==l||t[4]!==m||t[5]!==r||t[6]!==n||t[7]!==c||t[8]!==o||t[9]!==s||t[10]!==g||t[11]!==d){let e=[...r].sort(he),a=async function(){h({status:`loading`});let e=await L();v.current&&h(e===null?{status:`failed`}:{status:`loaded`,result:e})},p=m.status===`loaded`?m.result.files.filter(we):[],y=async function(){if(g!==null||p.length===0)return;_({done:0,total:p.length});let e=[];for(let t of p){let n=await R(M(t.file));if(!v.current)return;n.ok||e.push({file:t.file,detail:n.errorDetail}),_(Ce)}if(_(null),e.length>0){let t=e[0];k.error(l({id:`fru3T7`,values:{0:e.length,1:p.length}}),{description:t===void 0?void 0:`${t.file}${t.detail===null?``:` — ${t.detail}`}`})}try{await a()}catch{v.current&&h({status:`failed`})}},b=function(e){f(e),e===`project`&&m.status===`idle`&&a()},S;t[13]===n?S=t[14]:(S=function(e){let t=ge(e);W(n,{kind:`lint`,detail:t}),window.dispatchEvent(new CustomEvent(me,{detail:t}))},t[13]=n,t[14]=S);let C=S,w;t[15]!==n||t[16]!==C?(w=function(e,t){let r=M(e);if(r===n){C(t);return}W(r,{kind:`lint`,detail:ge(t)}),window.location.hash=N(r)},t[15]=n,t[16]=C,t[17]=w):w=t[17];let E=w,D;t[18]===Symbol.for(`react.memo_cache_sentinel`)?(D=(0,J.jsx)(ie,{children:(0,J.jsx)(i,{id:`OXdGnd`})}),t[18]=D):D=t[18];let A=d===`doc`&&e.length>0&&(0,J.jsx)(re,{children:e.length}),j;t[19]===A?j=t[20]:(j=(0,J.jsxs)(ne,{children:[D,A]}),t[19]=A,t[20]=j),x=(0,J.jsxs)(ae,{children:[j,(0,J.jsx)(pe,{scope:d,onScopeChange:b}),d===`doc`?(0,J.jsx)(te,{className:`px-2 py-2`,children:e.length===0?(0,J.jsx)(F,{className:`px-2`,children:(0,J.jsx)(i,{id:`ZI8uvA`})}):(0,J.jsxs)(J.Fragment,{children:[s!==void 0&&(0,J.jsx)(`div`,{className:`flex items-center justify-end gap-2 px-2 pb-1`,children:(0,J.jsx)(be,{count:ye(e),disabled:ye(e)===0,onClick:s})}),(0,J.jsx)(`ul`,{"aria-label":l({id:`OXdGnd`}),className:`flex flex-col gap-0.5`,children:e.map(e=>{let t=e.range.start.line+1,n=o!==void 0&&(e.fixes?.length??0)>0,r=`${e.source}/${e.code}`;return(0,J.jsxs)(`li`,{className:`group relative rounded transition-colors hover:bg-muted`,children:[(0,J.jsx)(`button`,{type:`button`,onClick:()=>C(e),className:`flex w-full cursor-pointer flex-col gap-0.5 rounded px-2 py-1.5 text-left`,title:l({id:`aHPdYV`,values:{displayLine:t}}),children:(0,J.jsx)(_e,{diagnostic:e})}),n||c!==void 0?(0,J.jsxs)(`div`,{className:`absolute bottom-1 right-1 flex items-center gap-1 rounded bg-muted opacity-0 transition-opacity focus-within:opacity-100 group-hover:opacity-100 motion-reduce:transition-none`,children:[n?(0,J.jsxs)(u,{size:`sm`,variant:`ghost`,className:`h-6 shrink-0 px-2 text-xs`,onClick:()=>o?.(e),"aria-label":l({id:`fZj9em`,values:{flatId:r}}),"data-testid":`problems-fix`,children:[(0,J.jsx)(O,{"aria-hidden":`true`,className:`size-3`}),(0,J.jsx)(i,{id:`c4fVUV`})]}):null,c===void 0?null:(0,J.jsxs)(u,{size:`sm`,variant:`ghost`,className:`h-6 shrink-0 px-2 text-xs`,onClick:()=>c(e),"aria-label":l({id:`hh4mVC`,values:{flatId:r}}),"data-testid":`problems-ask-ai`,children:[(0,J.jsx)(T,{"aria-hidden":`true`,className:`size-3`}),(0,J.jsx)(i,{id:`xWEvuo`})]})]}):null]},ve(e))})})]})}):(0,J.jsx)(Ee,{audit:m,onRefresh:()=>void a(),onNavigate:E,fixableCount:p.reduce(Se,0),fixing:g,onFixAll:()=>void y()})]}),t[3]=l,t[4]=m,t[5]=r,t[6]=n,t[7]=c,t[8]=o,t[9]=s,t[10]=g,t[11]=d,t[12]=x}else x=t[12];return x}function Se(e,t){return e+ye(t.diagnostics)}function Ce(e){return e===null?e:{...e,done:e.done+1}}function we(e){return e.diagnostics.some(Te)}function Te(e){return(e.fixes?.length??0)>0}function Ee(e){let t=(0,B.c)(43),{audit:n,onRefresh:r,onNavigate:o,fixableCount:s,fixing:c,onFixAll:l}=e,{_:d}=a(),f=n.status===`loading`||n.status===`idle`,p;t[0]!==n.result||t[1]!==n.status?(p=n.status===`loaded`&&(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(i,{id:`DsDwR-`,values:{0:n.result.errorCount}}),` · `,(0,J.jsx)(i,{id:`W1SI2K`,values:{0:n.result.warningCount}})]}),t[0]=n.result,t[1]=n.status,t[2]=p):p=t[2];let m;t[3]===p?m=t[4]:(m=(0,J.jsx)(`p`,{className:`text-xs text-muted-foreground`,"data-testid":`problems-audit-summary`,children:p}),t[3]=p,t[4]=m);let h;t[5]!==d||t[6]!==c?(h=c===null?null:(0,J.jsx)(`span`,{className:`sr-only`,role:`status`,children:d({id:`gZElfU`,values:{0:c.done,1:c.total}})}),t[5]=d,t[6]=c,t[7]=h):h=t[7];let g=f||c!==null||s===0,_;t[8]===c?_=t[9]:(_=c===null?void 0:(0,J.jsx)(i,{id:`S9t1PI`,values:{0:c.done,1:c.total}}),t[8]=c,t[9]=_);let v;t[10]!==s||t[11]!==l||t[12]!==g||t[13]!==_?(v=(0,J.jsx)(be,{count:s,disabled:g,onClick:l,children:_}),t[10]=s,t[11]=l,t[12]=g,t[13]=_,t[14]=v):v=t[14];let y;t[15]===d?y=t[16]:(y=d({id:`WRdYfS`}),t[15]=d,t[16]=y);let b=f||c!==null,x;t[17]===Symbol.for(`react.memo_cache_sentinel`)?(x=(0,J.jsx)(E,{"aria-hidden":`true`,className:`size-3.5`}),t[17]=x):x=t[17];let S;t[18]!==r||t[19]!==y||t[20]!==b?(S=(0,J.jsx)(u,{variant:`ghost`,size:`icon`,className:`size-6 shrink-0 text-muted-foreground`,"aria-label":y,"data-testid":`problems-audit-refresh`,disabled:b,onClick:r,children:x}),t[18]=r,t[19]=y,t[20]=b,t[21]=S):S=t[21];let C;t[22]!==S||t[23]!==h||t[24]!==v?(C=(0,J.jsxs)(`div`,{className:`flex shrink-0 items-center gap-1`,children:[h,v,S]}),t[22]=S,t[23]=h,t[24]=v,t[25]=C):C=t[25];let w;t[26]!==C||t[27]!==m?(w=(0,J.jsxs)(`div`,{className:`flex items-center justify-between gap-2 px-2 pb-1`,children:[m,C]}),t[26]=C,t[27]=m,t[28]=w):w=t[28];let T;t[29]!==d||t[30]!==f?(T=f&&(0,J.jsx)(`div`,{className:`flex flex-col gap-1`,role:`status`,"aria-busy":`true`,"aria-label":d({id:`dx-TwN`}),children:[1,2,3].map(De)}),t[29]=d,t[30]=f,t[31]=T):T=t[31];let D;t[32]===n.status?D=t[33]:(D=n.status===`failed`&&(0,J.jsx)(ee,{className:`px-2 text-xs`,children:(0,J.jsx)(i,{id:`IFezUv`})}),t[32]=n.status,t[33]=D);let O;t[34]!==n.result||t[35]!==n.status||t[36]!==o?(O=n.status===`loaded`&&(0,J.jsx)(Oe,{result:n.result,onNavigate:o}),t[34]=n.result,t[35]=n.status,t[36]=o,t[37]=O):O=t[37];let k;return t[38]!==w||t[39]!==T||t[40]!==D||t[41]!==O?(k=(0,J.jsxs)(te,{className:`px-2 py-2`,"data-testid":`problems-project-scope`,children:[w,T,D,O]}),t[38]=w,t[39]=T,t[40]=D,t[41]=O,t[42]=k):k=t[42],k}function De(e){return(0,J.jsxs)(`div`,{className:`flex items-start gap-2.5 rounded px-2 py-1.5`,children:[(0,J.jsx)(I,{className:`mt-0.5 size-3.5 shrink-0 rounded`}),(0,J.jsxs)(`div`,{className:`flex-1 space-y-1.5`,children:[(0,J.jsx)(I,{className:`h-3 w-28`}),(0,J.jsx)(I,{className:`h-3 w-40`})]})]},e)}function Oe(e){let t=(0,B.c)(10),{result:n,onNavigate:r}=e,{_:o}=a(),s;t[0]!==o||t[1]!==n.warnings?(s=n.warnings.length>0&&(0,J.jsx)(`ul`,{"aria-label":o({id:`Rsdhj9`}),className:`flex flex-col gap-0.5 pb-1`,children:n.warnings.map(ke)}),t[0]=o,t[1]=n.warnings,t[2]=s):s=t[2];let c;t[3]!==r||t[4]!==n.fileCount||t[5]!==n.files?(c=n.files.length===0?(0,J.jsx)(F,{className:`px-2`,children:(0,J.jsx)(i,{id:`k_Dqw1`,values:{0:n.fileCount}})}):n.files.map(e=>(0,J.jsx)(Ae,{file:e,onNavigate:r},e.file)),t[3]=r,t[4]=n.fileCount,t[5]=n.files,t[6]=c):c=t[6];let l;return t[7]!==s||t[8]!==c?(l=(0,J.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[s,c]}),t[7]=s,t[8]=c,t[9]=l):l=t[9],l}function ke(e,t){return(0,J.jsxs)(`li`,{className:`flex items-start gap-1.5 px-2 text-xs`,children:[(0,J.jsx)(D,{"aria-hidden":`true`,className:`mt-0.5 size-3.5 shrink-0 text-amber-500`}),(0,J.jsx)(`span`,{className:`min-w-0 text-foreground`,children:e})]},`${t}-${e}`)}function Ae(e){let t=(0,B.c)(37),{file:n,onNavigate:r}=e,{_:i}=a(),o,s,c,l,u,m,h,g,_;if(t[0]!==i||t[1]!==n.diagnostics||t[2]!==n.file||t[3]!==r){let e=[...n.diagnostics].sort(he);s=p,h=!0,g=`problems-audit-group`;let a;t[13]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,J.jsx)(S,{"aria-hidden":`true`,className:`size-3.5 shrink-0 text-muted-foreground transition-transform group-data-[state=open]:rotate-90 motion-reduce:transition-none`}),t[13]=a):a=t[13];let v;t[14]===n.file?v=t[15]:(v=(0,J.jsx)(`span`,{className:`min-w-0 flex-1 truncate font-mono text-xs text-foreground`,title:n.file,children:n.file}),t[14]=n.file,t[15]=v),_=(0,J.jsxs)(f,{className:`group flex w-full cursor-pointer items-center gap-1.5 rounded px-2 py-1.5 text-left transition-colors hover:bg-muted`,children:[a,v,(0,J.jsx)(P,{variant:`gray`,"data-testid":`problems-audit-file-count`,className:`shrink-0`,children:e.length})]}),o=d,m=`overflow-hidden data-[state=open]:animate-[collapsible-down_150ms_ease-out] data-[state=closed]:animate-[collapsible-up_150ms_ease-in]`,t[16]!==i||t[17]!==n.file?(c=i({id:`zAJzIg`,values:{0:n.file}}),t[16]=i,t[17]=n.file,t[18]=c):c=t[18],l=`flex flex-col gap-0.5 pb-1 ps-3`;let y;t[19]!==i||t[20]!==n.file||t[21]!==r?(y=e=>{let t=e.range.start.line+1;return(0,J.jsx)(`li`,{children:(0,J.jsx)(`button`,{type:`button`,onClick:()=>r(n.file,e),className:`flex w-full cursor-pointer flex-col gap-0.5 rounded px-2 py-1.5 text-left transition-colors hover:bg-muted`,title:i({id:`kDwcbW`,values:{0:n.file,displayLine:t}}),children:(0,J.jsx)(_e,{diagnostic:e})})},ve(e))},t[19]=i,t[20]=n.file,t[21]=r,t[22]=y):y=t[22],u=e.map(y),t[0]=i,t[1]=n.diagnostics,t[2]=n.file,t[3]=r,t[4]=o,t[5]=s,t[6]=c,t[7]=l,t[8]=u,t[9]=m,t[10]=h,t[11]=g,t[12]=_}else o=t[4],s=t[5],c=t[6],l=t[7],u=t[8],m=t[9],h=t[10],g=t[11],_=t[12];let v;t[23]!==c||t[24]!==l||t[25]!==u?(v=(0,J.jsx)(`ul`,{"aria-label":c,className:l,children:u}),t[23]=c,t[24]=l,t[25]=u,t[26]=v):v=t[26];let y;t[27]!==o||t[28]!==m||t[29]!==v?(y=(0,J.jsx)(o,{className:m,children:v}),t[27]=o,t[28]=m,t[29]=v,t[30]=y):y=t[30];let b;return t[31]!==s||t[32]!==h||t[33]!==g||t[34]!==_||t[35]!==y?(b=(0,J.jsxs)(s,{defaultOpen:h,"data-testid":g,children:[_,y]}),t[31]=s,t[32]=h,t[33]=g,t[34]=_,t[35]=y,t[36]=b):b=t[36],b}var je={words:0,chars:0,tokens:0},Me=/[ -〿-ゟ゠-ヿ㐀-䶿一-鿿豈---ក-]/,Ne=/[\p{L}\p{N}]/u,Pe=new Set([`text`,`inlineCode`,`code`,`tag`]),Fe=new Set([`html`,`definition`,`footnoteDefinition`,`yaml`,`toml`,`image`,`imageReference`,`mdxFlowExpression`,`mdxTextExpression`,`mdxjsEsm`,`rawMdxFallback`,`rawMdxFallbackMdast`]),Ie=new Set([`paragraph`,`heading`,`blockquote`,`list`,`listItem`,`thematicBreak`,`table`,`tableRow`,`tableCell`,`mdxJsxFlowElement`,`commentBlock`]);function Le(e,t){if(!e)return;let n=e.type;if(!Fe.has(n)){if(Pe.has(n)){e.value&&(t.push(e.value),n===`code`&&t.push(`
|
|
2
2
|
`));return}if(n===`wikiLink`||n===`wikiLinkEmbed`){let n=e.data?.alias??e.value??``;n&&t.push(n);return}if(Array.isArray(e.children)){for(let n of e.children)Le(n,t);if(Ie.has(n)&&t.length>0){let e=t[t.length-1];e&&!e.endsWith(`
|
|
3
3
|
`)&&t.push(`
|
|
4
4
|
`)}}}}function Re(e){try{let t=h().parseToMdast(e),n=[];return Le(t,n),n.join(``).trim()}catch(t){return console.warn(`[document-stats] mdast parse failed, falling back to raw text`,t),e.trim()}}function ze(e){if(!e)return 0;let t=0;for(let n of e.split(/\s+/))Ne.test(n)&&t++;return t}function Be(e){let t=globalThis.Intl.Segmenter;if(!t)return ze(e);let n=new t(void 0,{granularity:`word`}),r=0;for(let t of n.segment(e))t.isWordLike&&r++;return r}function Ve(e){let t=Me.test(e)?1.5:4;return Math.ceil(e.length/t)}function He(e){return e?{words:Me.test(e)?Be(e):ze(e),chars:e.length,tokens:Ve(e)}:{words:0,chars:0,tokens:0}}function Ue(e){if(!e)return{words:0,chars:0,tokens:0};let{body:t}=v(e);return t.trim()?He(Re(t)):{words:0,chars:0,tokens:0}}function We(e,{isMarkdown:t}){let n=e.trim();return n?He(t?Re(e):n):je}var Q=new Map,$=new Set,Ge=(e,t)=>`${t}:${e}`;function Ke(){for(let e of $)e()}function qe(e,t,n){let r=Ge(e,t);if(n===null){Q.delete(r)&&Ke();return}let i=Q.get(r);i&&i.words===n.words&&i.chars===n.chars&&i.tokens===n.tokens||(Q.set(r,n),Ke())}function Je(e,t){return e===null?null:Q.get(Ge(e,t))??null}function Ye(e){return $.add(e),()=>{$.delete(e)}}function Xe(e){let{from:t,to:n,empty:r}=e.state.selection;if(r)return null;let i=e.state.doc.textBetween(t,n,`
|
package/dist/public/assets/{use-activity-panel-CI9yTIc5.js → use-activity-panel-Dth1RWbL.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{i as e}from"./chunk-DseTPa7n.js";import{n as t}from"./DocumentContext-
|
|
1
|
+
import{i as e}from"./chunk-DseTPa7n.js";import{n as t}from"./DocumentContext-DN3M8p0h.js";import{t as n}from"./react-JNybMug3.js";import{t as r}from"./compiler-runtime-dQcBxOhn.js";import{B as i}from"./CodeMirrorPropInput-Sjp30pzp.js";import{a,gt as o,i as s}from"./dist-CDKZLcnD.js";import{o as c}from"./documents-events-DNDUkpJM.js";import{n as l}from"./agent-presence-DdJtLtJ1.js";import{t as u}from"./lru-string-cache-D19dwCKJ.js";var d=r(),f=e(n(),1),p=500,m=64;async function h(e){let t=`/api/agent-activity?agentId=${encodeURIComponent(e)}`,n=await fetch(t),r;try{r=await n.json()}catch(e){throw new i(`Could not parse /api/agent-activity response.`,{cause:e,status:n.status})}if(!n.ok){let e=o.safeParse(r);throw e.success?Error(e.data.title):new i(`/api/agent-activity returned a non-RFC-9457 error response.`,{cause:e.error,status:n.status})}let a=s.safeParse(r);if(!a.success)throw new i(`/api/agent-activity returned a body that did not match AgentActivitySuccessSchema.`,{cause:a.error,status:n.status});return a.data}async function g(e,t,n){let r=`/api/agent-burst-diff?agentId=${encodeURIComponent(e)}&docName=${encodeURIComponent(t)}&keptCount=${n}`,s=await fetch(r),c;try{c=await s.json()}catch(e){throw new i(`Could not parse /api/agent-burst-diff response.`,{cause:e,status:s.status})}if(!s.ok){let e=o.safeParse(c);throw e.success?Error(e.data.title):new i(`/api/agent-burst-diff returned a non-RFC-9457 error response.`,{cause:e.error,status:s.status})}let l=a.safeParse(c);if(!l.success)throw new i(`/api/agent-burst-diff returned a body that did not match AgentBurstDiffSuccessSchema.`,{cause:l.error,status:s.status});let{diff:u,before:d,after:f}=l.data;return{diff:u,before:d,after:f}}function _(e){let n=(0,d.c)(23),{systemProvider:r}=t(),[i,a]=(0,f.useState)(null),[o,s]=(0,f.useState)(`idle`),[l,_]=(0,f.useState)(null),b;n[0]===Symbol.for(`react.memo_cache_sentinel`)?(b=new u(m),n[0]=b):b=n[0];let x=(0,f.useRef)(b),S=(0,f.useRef)(0),C;n[1]===r?C=n[2]:(C=e=>{let t=S.current+=1;s(`loading`),_(null),h(e).then(n=>{if(S.current!==t)return;let i=y(r,e);a({...n,writingDocs:i}),s(`ready`)}).catch(e=>{S.current===t&&(_(e instanceof Error?e.message:String(e)),s(`error`))})},n[1]=r,n[2]=C);let w=C,T;n[3]!==e||n[4]!==w?(T=()=>{if(!e){S.current+=1,a(null),s(`idle`),_(null),x.current.clear();return}x.current.clear(),w(e);let t=null,n=c(n=>{n.includes(`session-activity`)&&(t&&clearTimeout(t),t=setTimeout(()=>{t=null,w(e)},p))});return()=>{t&&clearTimeout(t),n()}},n[3]=e,n[4]=w,n[5]=T):T=n[5];let E;n[6]===e?E=n[7]:(E=[e],n[6]=e,n[7]=E),(0,f.useEffect)(T,E);let D,O;n[8]!==e||n[9]!==r?(D=()=>{if(!e||!r)return;let t=()=>{if(!r.awareness)return;let t=y(r,e);a(e=>!e||v(e.writingDocs,t)?e:{...e,writingDocs:t})},n=r.awareness;if(!n||typeof n.on!=`function`){t();return}n.on(`update`,t),t();let i=setInterval(t,1e3);return()=>{clearInterval(i),typeof n.off==`function`&&n.off(`update`,t)}},O=[e,r],n[8]=e,n[9]=r,n[10]=D,n[11]=O):(D=n[10],O=n[11]),(0,f.useEffect)(D,O);let k;n[12]===e?k=n[13]:(k=async(t,n)=>{if(!e)return``;let r=`${t}\0${n}`,i=x.current.get(r);if(i!==void 0)return i;let{diff:a}=await g(e,t,n);return x.current.set(r,a),a},n[12]=e,n[13]=k);let A=k,j;n[14]!==e||n[15]!==w?(j=()=>{e&&w(e)},n[14]=e,n[15]=w,n[16]=j):j=n[16];let M=j,N;return n[17]!==i||n[18]!==l||n[19]!==A||n[20]!==M||n[21]!==o?(N={data:i,status:o,error:l,reload:M,fetchBurstDiff:A},n[17]=i,n[18]=l,n[19]=A,n[20]=M,n[21]=o,n[22]=N):N=n[22],N}function v(e,t){if(e.size!==t.size)return!1;for(let n of e)if(!t.has(n))return!1;return!0}function y(e,t){let n=new Set;if(!e)return n;let r=e.awareness;if(!l(r))return n;let i=[t,t.startsWith(`agent-`)?t.slice(6):`agent-${t}`];for(let e of r.getStates().values()){let t=e.agentPresence;if(t)for(let e of i){let r=t[e];r&&r.mode===`writing`&&r.currentDoc&&n.add(r.currentDoc)}}return n}export{_ as n,g as t};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{i as e}from"./chunk-DseTPa7n.js";import{t}from"./react-JNybMug3.js";import{t as n}from"./compiler-runtime-dQcBxOhn.js";import{
|
|
1
|
+
import{i as e}from"./chunk-DseTPa7n.js";import{t}from"./react-JNybMug3.js";import{t as n}from"./compiler-runtime-dQcBxOhn.js";import{Aa as r,Sa as i}from"./dist-CDKZLcnD.js";var a=e(t(),1),o=n(),s=/^#[0-9a-fA-F]{6}$/,c={background:`#0f172a`,surface:`#1e293b`,foreground:`#e2e8f0`,primary:`#6366f1`,accent:`#22d3ee`,border:`#334155`};function l(e){return typeof e==`string`&&s.test(e)}function u(e){let t={...c};if(e)for(let n of Object.keys(c)){let r=e[n];l(r)&&(t[n]=r)}return t}function d(e){let t=l(e)?e:`#000000`,n=e=>{let n=Number.parseInt(t.slice(1+e*2,3+e*2),16)/255;return n<=.03928?n/12.92:((n+.055)/1.055)**2.4};return .2126*n(0)+.7152*n(1)+.0722*n(2)}function f(e){return d(e.background)<.5?`dark`:`light`}function p(e){return d(e)<.5?`#ffffff`:`#0a0a0a`}function m(e){return{bg:e.background,bgElevated:e.surface,bgSubtle:e.surface,fg:e.foreground,fgMuted:`color-mix(in oklab, ${e.foreground} 55%, ${e.background})`,border:e.border,primary:e.primary,primaryFg:p(e.primary),red:`#e5534b`,green:`#3fb950`,yellow:`#d29922`,blue:e.accent,cyan:e.accent,orange:`#db8d3f`,purple:e.accent}}function h(e){let t=i(m(e)),n=Object.entries(t).map(([e,t])=>` --${e}: ${t};`);return`html[data-color-theme="custom"] {\n color-scheme: ${f(e)};\n${n.join(`
|
|
2
2
|
`)}\n}`}var g=`ok-color-theme-v1`,_=`ok-custom-theme-v1`,v=`data-color-theme`,y=`ok-custom-theme`;function b(e){let t=document.getElementById(y);t||(t=document.createElement(`style`),t.id=y,document.head.appendChild(t)),t.textContent!==e&&(t.textContent=e)}function x(){document.getElementById(y)?.remove()}function S(e,t,n=!0){if(typeof document>`u`)return;let i=r(n?e:`default`),a=document.documentElement;i.id===`default`?a.removeAttribute(v):a.setAttribute(v,i.id);let o=null;if(i.id===`custom`){let e=u(t),n=h(e);b(n),o=JSON.stringify({css:n,dark:f(e)===`dark`})}else x();try{i.id===`default`?localStorage.removeItem(g):localStorage.setItem(g,i.id),o?localStorage.setItem(_,o):localStorage.removeItem(_)}catch{}}function C(e,t,n){let r=(0,o.c)(12),i=n===void 0?!0:n,s;r[0]!==e||r[1]!==t||r[2]!==i?(s=i&&e===`custom`?JSON.stringify(t??null):``,r[0]=e,r[1]=t,r[2]=i,r[3]=s):s=r[3];let c=s,l;r[4]!==e||r[5]!==t||r[6]!==i?(l=()=>{S(e,t,i)},r[4]=e,r[5]=t,r[6]=i,r[7]=l):l=r[7];let u;r[8]!==e||r[9]!==i||r[10]!==c?(u=[e,c,i],r[8]=e,r[9]=i,r[10]=c,r[11]=u):u=r[11],(0,a.useEffect)(l,u)}export{f as a,u as c,c as i,S as n,m as o,C as r,l as s,v as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{i as e}from"./chunk-DseTPa7n.js";import{t}from"./react-JNybMug3.js";import{t as n}from"./compiler-runtime-dQcBxOhn.js";import{d as r,f as i,l as a,m as o,p as s,u as c}from"./dist-
|
|
1
|
+
import{i as e}from"./chunk-DseTPa7n.js";import{t}from"./react-JNybMug3.js";import{t as n}from"./compiler-runtime-dQcBxOhn.js";import{d as r,f as i,l as a,m as o,p as s,u as c}from"./dist-CDKZLcnD.js";var l=e(t(),1),u=n();async function d(e){let t;try{t=await fetch(`/api/config`,{signal:e,headers:{Accept:`application/json`}})}catch(e){if(e.name===`AbortError`)throw e;return{status:`error`,code:`network`}}if(t.status===404||t.status===501)return{status:`absent`};if(!t.ok)return{status:`error`,code:t.status};let n;try{n=await t.json()}catch{return{status:`error`,code:`invalid-body`}}if(typeof n!=`object`||!n||Array.isArray(n))return{status:`error`,code:`invalid-body`};let r=n;return{status:`ok`,config:{collabUrl:typeof r.collabUrl==`string`?r.collabUrl:null,previewUrl:typeof r.previewUrl==`string`?r.previewUrl:null,port:typeof r.port==`number`?r.port:0,singleFile:r.singleFile===!0}}}function f(e){return b(e,i)}function p(e){return b(e,o)}function m(e){return b(e,a)}function h(e){return b(e,r)}function g(e){return b(e,c)}function _(e){let t=b(e,s);if(!t)return null;try{return{docName:t.docName,sv:v(t.sv)}}catch{return null}}function v(e){let t=atob(e),n=new Uint8Array(t.length);for(let e=0;e<t.length;e++)n[e]=t.charCodeAt(e);return n}function y(e,t){let n=p(e);if(n){t.onServerInfo?.(n);return}let r=m(e);if(r){t.onBranchSwitched?.(r);return}let i=_(e);if(i){t.onDiskAck?.(i);return}let a=f(e);if(a){t.onDerivedView?.(a);return}let o=h(e);if(o){t.onConfigValidationRejected?.(o);return}let s=g(e);if(s){t.onConfigIgnoreNestedError?.(s);return}t.onUnknown?.(e)}function b(e,t){let n;try{n=JSON.parse(e)}catch{return null}let r=t.safeParse(n);return r.success?r.data:null}function x(){return typeof location>`u`?`ws://localhost/collab`:`${location.protocol===`https:`?`wss`:`ws`}://${location.host}/collab`}function S(e){if(e===void 0)return null;let t=e.okDesktop;return!t||!t.config.collabUrl||t.config.collabUrl.length===0?null:t}function C(e){return{collabUrl:e.collabUrl,attempts:0,terminal:!1,lastError:null}}var w=2e3,T=15e3;function E(e){let t=e.terminalAfterMs??3e4,n=e.initialDelayMs??w,r=e.maxDelayMs??T,i=e.log??{info:console.info,warn:console.warn},a=new AbortController,o=null,s=n,c=0,l=!1,u=!1,d=null,f=e.now(),p=async()=>{c+=1;let n=null;try{let t=await e.fetchConfig(a.signal);t.status===`absent`?(n=e.fallbackUrl(),d=null):t.status===`ok`&&t.config.collabUrl!==null?(n=t.config.collabUrl,d=null):t.status===`ok`?(u||(u=!0,i.info(`[collab-url] ok ui responded but server.lock has no port yet — retrying`)),d={kind:`null-collab`}):t.status===`error`&&(i.warn(`[collab-url] /api/config error (${t.code}) — retrying in ${s}ms`),d={kind:`error`,code:t.code})}catch(e){if(e.name===`AbortError`)return;d={kind:`error`,code:`network`}}if(!l){if(n!==null){e.onStateChange({collabUrl:n,attempts:c,terminal:!1,lastError:null});return}if(e.now()-f>=t){e.onStateChange({collabUrl:null,attempts:c,terminal:!0,lastError:d});return}e.onStateChange({collabUrl:null,attempts:c,terminal:!1,lastError:d}),o=e.setTimeout(()=>{p()},s),s=Math.min(s*2,r)}};return p(),{cancel:()=>{l=!0,a.abort(),o!==null&&(e.clearTimeout(o),o=null)}}}function D(){let e=(0,u.c)(8),t;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t={collabUrl:null,attempts:0,terminal:!1,lastError:null},e[0]=t):t=e[0];let[n,r]=(0,l.useState)(t),i;e[1]===Symbol.for(`react.memo_cache_sentinel`)?(i={token:0},e[1]=i):i=e[1];let a=(0,l.useRef)(i),[o,s]=(0,l.useState)(0),c;e[2]===Symbol.for(`react.memo_cache_sentinel`)?(c=()=>{let e=a.current.token=a.current.token+1,t=S(window);if(t){r(C(t.config));let n=t.onProjectSwitched(t=>{e===a.current.token&&r(C(t))});return()=>{n()}}let n=E({fetchConfig:d,fallbackUrl:x,now:Date.now,setTimeout:j,clearTimeout:A,onStateChange:t=>{e===a.current.token&&r(t)}});return()=>{n.cancel()}},e[2]=c):c=e[2];let f;e[3]===o?f=e[4]:(f=[o],e[3]=o,e[4]=f),(0,l.useEffect)(c,f);let p;e[5]===Symbol.for(`react.memo_cache_sentinel`)?(p=()=>{a.current.token=a.current.token+1,r(k),s(O)},e[5]=p):p=e[5];let m=p,h;return e[6]===n?h=e[7]:(h={...n,retry:m},e[6]=n,e[7]=h),h}function O(e){return e+1}function k(e){return{...e,terminal:!1,lastError:null}}function A(e){return globalThis.clearTimeout(e)}function j(e,t){return globalThis.setTimeout(e,t)}export{d as i,D as n,y as r,S as t};
|
package/dist/public/assets/{use-live-xterm-theme-DW54zfIk.js → use-live-xterm-theme-BpGfJKio.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{i as e}from"./chunk-DseTPa7n.js";import{t}from"./react-JNybMug3.js";import{t as n}from"./compiler-runtime-dQcBxOhn.js";import{t as r}from"./use-apply-config-color-theme-
|
|
1
|
+
import{i as e}from"./chunk-DseTPa7n.js";import{t}from"./react-JNybMug3.js";import{t as n}from"./compiler-runtime-dQcBxOhn.js";import{t as r}from"./use-apply-config-color-theme-Ccfxcl-K.js";var i=e(t(),1),a=n(),o={background:`#171717`,foreground:`#e5e5e5`,cursor:`#e5e5e5`,cursorAccent:`#171717`,selectionBackground:`#3a3d41`,black:`#000000`,red:`#cd3131`,green:`#0dbc79`,yellow:`#e5e510`,blue:`#2472c8`,magenta:`#bc3fbc`,cyan:`#11a8cd`,white:`#e5e5e5`,brightBlack:`#666666`,brightRed:`#f14c4c`,brightGreen:`#23d18b`,brightYellow:`#f5f543`,brightBlue:`#3b8eea`,brightMagenta:`#d670d6`,brightCyan:`#29b8db`,brightWhite:`#ffffff`},s={background:`#ffffff`,foreground:`#262626`,cursor:`#262626`,cursorAccent:`#ffffff`,selectionBackground:`#add6ff`,black:`#000000`,red:`#cd3131`,green:`#00bc00`,yellow:`#949800`,blue:`#0451a5`,magenta:`#bc05bc`,cyan:`#0598bc`,white:`#555555`,brightBlack:`#666666`,brightRed:`#cd3131`,brightGreen:`#14ce14`,brightYellow:`#b5ba00`,brightBlue:`#0451a5`,brightMagenta:`#bc05bc`,brightCyan:`#0598bc`,brightWhite:`#a5a5a5`};function c(e){return e===`dark`?o:s}function l(e){try{let t=document.createElement(`span`);t.style.display=`none`,t.style.backgroundColor=`var(${e})`,document.body.appendChild(t);try{let e=getComputedStyle(t).backgroundColor;return!e||e===`rgba(0, 0, 0, 0)`||e===`transparent`||e.includes(`var(`)?null:e}finally{t.remove()}}catch{return null}}function u(e,t=l){let n=c(e),r=t(`--background`)??n.background,i=t(`--foreground`)??n.foreground;return{...n,background:r,foreground:i,cursor:i,cursorAccent:r,selectionBackground:t(`--selection-soft`)??n.selectionBackground}}function d(e,t){let n=new Set([...Object.keys(e),...Object.keys(t)]);for(let r of n)if(e[r]!==t[r])return!1;return!0}function f(e){let t=(0,a.c)(5),n;t[0]===e?n=t[1]:(n=()=>u(e),t[0]=e,t[1]=n);let[o,s]=(0,i.useState)(n),c,l;return t[2]===e?(c=t[3],l=t[4]):(c=()=>{let t=()=>{let t=u(e);s(e=>d(e,t)?e:t)};t();let n=new MutationObserver(t);return n.observe(document.documentElement,{attributes:!0,attributeFilter:[r,`class`]}),n.observe(document.head,{childList:!0,subtree:!0,characterData:!0}),()=>n.disconnect()},l=[e],t[2]=e,t[3]=c,t[4]=l),(0,i.useEffect)(c,l),o}export{f as t};
|
package/dist/public/assets/{use-terminal-enabled-Yhee4_eR.js → use-terminal-enabled-BEEp7vb7.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./compiler-runtime-dQcBxOhn.js";import{t}from"./terminal-telemetry-
|
|
1
|
+
import{t as e}from"./compiler-runtime-dQcBxOhn.js";import{t}from"./terminal-telemetry-zqEIM46I.js";import{wa as n}from"./dist-CDKZLcnD.js";import"./config-provider-BvPGEDTw.js";import{n as r}from"./config-context-C5AosGyi.js";var i=e();function a(){let e=(0,i.c)(3),{projectLocalConfig:t,projectLocalSynced:n}=r(),a=t?.terminal?.enabled??null,o;return e[0]!==n||e[1]!==a?(o={enabled:a,synced:n},e[0]=n,e[1]=a,e[2]=o):o=e[2],o}function o(){let e=(0,i.c)(2),{projectLocalBinding:a}=r();if(a===null)return null;let o;return e[0]===a?o=e[1]:(o=e=>{let r=a.patch({terminal:{enabled:e}});return r.ok&&e&&t(),r.ok?{ok:!0}:{ok:!1,error:n(r.error)}},e[0]=a,e[1]=o),o}export{o as n,a as t};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import{i as e,t}from"./chunk-DseTPa7n.js";import{t as n}from"./jsx-runtime-DyiINK0N.js";import{n as r,p as i}from"./DocumentContext-Y1Gu1DW-.js";import{t as a}from"./react-JNybMug3.js";import{t as o}from"./react-dom-Db7zF7dM.js";import{t as s}from"./compiler-runtime-dQcBxOhn.js";import{I as c,et as l,st as u}from"./CodeMirrorPropInput-BNR51IWy.js";import{Bi as d,Gi as f,K as p,Ki as m,Oi as h,Qi as g,Vi as _,Xi as v,Yr as y,ea as b,hi as x,na as S,ta as C}from"./dist-df-v6kvy.js";import{t as ee}from"./libesm-BUX1Jc4h.js";var w=t((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.Pointer=void 0,e.unescapeToken=t,e.escapeToken=n;function t(e){return e.replace(/~1/g,`/`).replace(/~0/g,`~`)}function n(e){return e.replace(/~/g,`~0`).replace(/\//g,`~1`)}e.Pointer=function(){function e(e){e===void 0&&(e=[``]),this.tokens=e}return e.fromJSON=function(n){var r=n.split(`/`).map(t);if(r[0]!==``)throw Error(`Invalid JSON Pointer: ${n}`);return new e(r)},e.prototype.toString=function(){return this.tokens.map(n).join(`/`)},e.prototype.evaluate=function(e){for(var t=null,n=``,r=e,i=1,a=this.tokens.length;i<a;i++)t=r,n=this.tokens[i],!(n==`__proto__`||n==`constructor`||n==`prototype`)&&(r=(t||{})[n]);return{parent:t,key:n,value:r}},e.prototype.get=function(e){return this.evaluate(e).value},e.prototype.set=function(e,t){var n=this.evaluate(e);n.parent&&(n.parent[n.key]=t)},e.prototype.push=function(e){this.tokens.push(e)},e.prototype.add=function(t){return new e(this.tokens.concat(String(t)))},e.prototype.parent=function(){return new e(this.tokens.length>1?this.tokens.slice(0,-1):[``])},e}()})),T=t((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.hasOwnProperty=void 0,e.objectType=t,e.clone=r,e.hasOwnProperty=Object.prototype.hasOwnProperty;function t(e){return e===void 0?`undefined`:e===null?`null`:Array.isArray(e)?`array`:typeof e}function n(e){return typeof e==`object`&&!!e}function r(t){if(!n(t))return t;if(t.constructor==Array){for(var i=t.length,a=Array(i),o=0;o<i;o++)a[o]=r(t[o]);return a}if(t.constructor==Date)return new Date(+t);var s={};for(var c in t)e.hasOwnProperty.call(t,c)&&(s[c]=r(t[c]));return s}})),E=t((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.isDestructive=n,e.subtract=r,e.intersection=i,e.diffArrays=l,e.diffObjects=u,e.diffAny=d;var t=T();function n(e){var t=e.op;return t===`remove`||t===`replace`||t===`copy`||t===`move`}function r(e,n){var r=[];for(var i in e)t.hasOwnProperty.call(e,i)&&e[i]!==void 0&&!(t.hasOwnProperty.call(n,i)&&n[i]!==void 0)&&r.push(i);return r}function i(e){for(var n=e.length,r={},i=0;i<n;i++){var a=e[i];for(var o in a)t.hasOwnProperty.call(a,o)&&a[o]!==void 0&&(r[o]=(r[o]||0)+1)}for(var o in r)r[o]<n&&delete r[o];return Object.keys(r)}function a(e,n){var r=[];for(var i in e)t.hasOwnProperty.call(e,i)&&e[i]!==void 0&&t.hasOwnProperty.call(n,i)&&n[i]!==void 0&&r.push(i);return r}function o(e){return e.op===`add`}function s(e){return e.op===`remove`}function c(e,t){return{operations:e.operations.concat(t),cost:e.cost+1}}function l(e,t,n,r){r===void 0&&(r=d);var i=Math.max(e.length,t.length),a=new Map([[0,{operations:[],cost:0}]]);function l(o,s){var u=o*i+s,d=a.get(u);if(d===void 0){if(o>0&&s>0&&!r(e[o-1],t[s-1],n.add(String(o-1))).length)d=l(o-1,s-1);else{var f=[];if(o>0){var p=l(o-1,s),m={op:`remove`,index:o-1};f.push(c(p,m))}if(s>0){var h=l(o,s-1),g={op:`add`,index:o-1,value:t[s-1]};f.push(c(h,g))}if(o>0&&s>0){var _=l(o-1,s-1),v={op:`replace`,index:o-1,original:e[o-1],value:t[s-1]};f.push(c(_,v))}d=f.sort(function(e,t){return e.cost-t.cost})[0]}a.set(u,d)}return d}var u=isNaN(e.length)||e.length<=0?0:e.length;return l(u,isNaN(t.length)||t.length<=0?0:t.length).operations.reduce(function(e,t){var i=e[0],a=e[1];if(o(t)){var c=t.index+1+a,l=c<u+a?String(c):`-`,d={op:t.op,path:n.add(l).toString(),value:t.value};return[i.concat(d),a+1]}else if(s(t)){var d={op:t.op,path:n.add(String(t.index+a)).toString()};return[i.concat(d),a-1]}else{var f=n.add(String(t.index+a)),p=r(t.original,t.value,f);return[i.concat.apply(i,p),a]}},[[],0])[0]}function u(e,t,n,i){i===void 0&&(i=d);var o=[];return r(e,t).forEach(function(e){o.push({op:`remove`,path:n.add(e).toString()})}),r(t,e).forEach(function(e){o.push({op:`add`,path:n.add(e).toString(),value:t[e]})}),a(e,t).forEach(function(r){o.push.apply(o,i(e[r],t[r],n.add(r)))}),o}function d(e,n,r,i){if(i===void 0&&(i=d),e===n)return[];var a=(0,t.objectType)(e),o=(0,t.objectType)(n);return a==`array`&&o==`array`?l(e,n,r,i):a==`object`&&o==`object`?u(e,n,r,i):[{op:`replace`,path:r.toString(),value:n}]}})),te=t((e=>{var t=e&&e.__extends||(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if(typeof n!=`function`&&n!==null)throw TypeError(`Class extends value `+String(n)+` is not a constructor or null`);e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})();Object.defineProperty(e,`__esModule`,{value:!0}),e.InvalidOperationError=e.TestError=e.MissingError=void 0,e.add=l,e.remove=u,e.replace=d,e.move=f,e.copy=p,e.test=m,e.apply=g;var n=w(),r=T(),i=E(),a=function(e){t(n,e);function n(t){var n=e.call(this,`Value required at path: ${t}`)||this;return n.path=t,n.name=`MissingError`,n}return n}(Error);e.MissingError=a;var o=function(e){t(n,e);function n(t,n){var r=e.call(this,`Test failed: ${t} != ${n}`)||this;return r.actual=t,r.expected=n,r.name=`TestError`,r}return n}(Error);e.TestError=o;function s(e,t,n){if(Array.isArray(e))if(t==`-`)e.push(n);else{var r=parseInt(t,10);e.splice(r,0,n)}else e[t]=n}function c(e,t){if(Array.isArray(e)){var n=parseInt(t,10);e.splice(n,1)}else delete e[t]}function l(e,t,i){var o=n.Pointer.fromJSON(t.path);if(i?.implicitArrayCreation&&o.tokens[o.tokens.length-1]===`-`){var c=o.parent().evaluate(e);c.value===void 0&&(0,r.objectType)(c.parent)===`object`&&(c.parent[c.key]=[])}var l=o.evaluate(e);return l.parent===void 0||i?.implicitArrayCreation&&l.key===`-`&&!Array.isArray(l.parent)?new a(t.path):(s(l.parent,l.key,(0,r.clone)(t.value)),null)}function u(e,t,r){var i=n.Pointer.fromJSON(t.path).evaluate(e);return i.value===void 0?new a(t.path):(c(i.parent,i.key),null)}function d(e,t,i){var o=n.Pointer.fromJSON(t.path).evaluate(e);if(o.parent===null)return new a(t.path);if(Array.isArray(o.parent)){if(parseInt(o.key,10)>=o.parent.length)return new a(t.path)}else if(o.value===void 0)return new a(t.path);return o.parent[o.key]=(0,r.clone)(t.value),null}function f(e,t,r){var i=n.Pointer.fromJSON(t.from).evaluate(e);if(i.value===void 0)return new a(t.from);var o=n.Pointer.fromJSON(t.path).evaluate(e);return o.parent===void 0?new a(t.path):(c(i.parent,i.key),s(o.parent,o.key,i.value),null)}function p(e,t,i){var o=n.Pointer.fromJSON(t.from).evaluate(e);if(o.value===void 0)return new a(t.from);var c=n.Pointer.fromJSON(t.path).evaluate(e);return c.parent===void 0?new a(t.path):(s(c.parent,c.key,(0,r.clone)(o.value)),null)}function m(e,t,r){var a=n.Pointer.fromJSON(t.path).evaluate(e);return(0,i.diffAny)(a.value,t.value,new n.Pointer).length?new o(a.value,t.value):null}var h=function(e){t(n,e);function n(t){var n=e.call(this,`Invalid operation: ${t.op}`)||this;return n.operation=t,n.name=`InvalidOperationError`,n}return n}(Error);e.InvalidOperationError=h;function g(e,t,n){switch(t.op){case`add`:return l(e,t,n);case`remove`:return u(e,t,n);case`replace`:return d(e,t,n);case`move`:return f(e,t,n);case`copy`:return p(e,t,n);case`test`:return m(e,t,n)}return new h(t)}})),ne=t((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.Pointer=void 0,e.applyPatch=i,e.createPatch=o;var t=w();Object.defineProperty(e,`Pointer`,{enumerable:!0,get:function(){return t.Pointer}});var n=te(),r=E();function i(e,t,r){return t.map(function(t){return(0,n.apply)(e,t,r)})}function a(e){function t(n,i,a){var o=e(n,i,a);return Array.isArray(o)?o:(0,r.diffAny)(n,i,a,t)}return t}function o(e,n,i){var o=new t.Pointer;return(i?a(i):r.diffAny)(e,n,o)}})),D=e(a(),1),re=e(o(),1),O=s(),k=ne();function A(){}A.prototype={diff:function(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},r=n.callback;typeof n==`function`&&(r=n,n={}),this.options=n;var i=this;function a(e){return r?(setTimeout(function(){r(void 0,e)},0),!0):e}e=this.castInput(e),t=this.castInput(t),e=this.removeEmpty(this.tokenize(e)),t=this.removeEmpty(this.tokenize(t));var o=t.length,s=e.length,c=1,l=o+s;n.maxEditLength&&(l=Math.min(l,n.maxEditLength));var u=n.timeout??1/0,d=Date.now()+u,f=[{oldPos:-1,lastComponent:void 0}],p=this.extractCommon(f[0],t,e,0);if(f[0].oldPos+1>=s&&p+1>=o)return a([{value:this.join(t),count:t.length}]);var m=-1/0,h=1/0;function g(){for(var n=Math.max(m,-c);n<=Math.min(h,c);n+=2){var r=void 0,l=f[n-1],u=f[n+1];l&&(f[n-1]=void 0);var d=!1;if(u){var g=u.oldPos-n;d=u&&0<=g&&g<o}var _=l&&l.oldPos+1<s;if(!d&&!_){f[n]=void 0;continue}if(r=!_||d&&l.oldPos+1<u.oldPos?i.addToPath(u,!0,void 0,0):i.addToPath(l,void 0,!0,1),p=i.extractCommon(r,t,e,n),r.oldPos+1>=s&&p+1>=o)return a(ie(i,r.lastComponent,t,e,i.useLongestToken));f[n]=r,r.oldPos+1>=s&&(h=Math.min(h,n-1)),p+1>=o&&(m=Math.max(m,n+1))}c++}if(r)(function e(){setTimeout(function(){if(c>l||Date.now()>d)return r();g()||e()},0)})();else for(;c<=l&&Date.now()<=d;){var _=g();if(_)return _}},addToPath:function(e,t,n,r){var i=e.lastComponent;return i&&i.added===t&&i.removed===n?{oldPos:e.oldPos+r,lastComponent:{count:i.count+1,added:t,removed:n,previousComponent:i.previousComponent}}:{oldPos:e.oldPos+r,lastComponent:{count:1,added:t,removed:n,previousComponent:i}}},extractCommon:function(e,t,n,r){for(var i=t.length,a=n.length,o=e.oldPos,s=o-r,c=0;s+1<i&&o+1<a&&this.equals(t[s+1],n[o+1]);)s++,o++,c++;return c&&(e.lastComponent={count:c,previousComponent:e.lastComponent}),e.oldPos=o,s},equals:function(e,t){return this.options.comparator?this.options.comparator(e,t):e===t||this.options.ignoreCase&&e.toLowerCase()===t.toLowerCase()},removeEmpty:function(e){for(var t=[],n=0;n<e.length;n++)e[n]&&t.push(e[n]);return t},castInput:function(e){return e},tokenize:function(e){return e.split(``)},join:function(e){return e.join(``)}};function ie(e,t,n,r,i){for(var a=[],o;t;)a.push(t),o=t.previousComponent,delete t.previousComponent,t=o;a.reverse();for(var s=0,c=a.length,l=0,u=0;s<c;s++){var d=a[s];if(!d.removed){if(!d.added&&i){var f=n.slice(l,l+d.count);f=f.map(function(e,t){var n=r[u+t];return n.length>e.length?n:e}),d.value=e.join(f)}else d.value=e.join(n.slice(l,l+d.count));l+=d.count,d.added||(u+=d.count)}else if(d.value=e.join(r.slice(u,u+d.count)),u+=d.count,s&&a[s-1].added){var p=a[s-1];a[s-1]=a[s],a[s]=p}}var m=a[c-1];return c>1&&typeof m.value==`string`&&(m.added||m.removed)&&e.equals(``,m.value)&&(a[c-2].value+=m.value,a.pop()),a}var j=new A;function ae(e,t,n){return j.diff(e,t,n)}var M=/^[A-Za-z\xC0-\u02C6\u02C8-\u02D7\u02DE-\u02FF\u1E00-\u1EFF]+$/,N=/\S/,P=new A;P.equals=function(e,t){return this.options.ignoreCase&&(e=e.toLowerCase(),t=t.toLowerCase()),e===t||this.options.ignoreWhitespace&&!N.test(e)&&!N.test(t)},P.tokenize=function(e){for(var t=e.split(/([^\S\r\n]+|[()[\]{}'"\r\n]|\b)/),n=0;n<t.length-1;n++)!t[n+1]&&t[n+2]&&M.test(t[n])&&M.test(t[n+2])&&(t[n]+=t[n+2],t.splice(n+1,2),n--);return t};function oe(e,t,n){return P.diff(e,t,n)}var F=new A;F.tokenize=function(e){this.options.stripTrailingCr&&(e=e.replace(/\r\n/g,`
|
|
2
|
-
`));var t=[],n=e.split(/(\n|\r\n)/);n[n.length-1]||n.pop();for(var r=0;r<n.length;r++){var i=n[r];r%2&&!this.options.newlineIsToken?t[t.length-1]+=i:(this.options.ignoreWhitespace&&(i=i.trim()),t.push(i))}return t};var I=new A;I.tokenize=function(e){return e.split(/(\S.+?[.!?])(?=\s+|$)/)};var se=new A;se.tokenize=function(e){return e.split(/([{}:;,]|\s+)/)};function L(e){"@babel/helpers - typeof";return L=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},L(e)}var ce=Object.prototype.toString,R=new A;R.useLongestToken=!0,R.tokenize=F.tokenize,R.castInput=function(e){var t=this.options,n=t.undefinedReplacement,r=t.stringifyReplacer,i=r===void 0?function(e,t){return t===void 0?n:t}:r;return typeof e==`string`?e:JSON.stringify(z(e,null,null,i),i,` `)},R.equals=function(e,t){return A.prototype.equals.call(R,e.replace(/,([\r\n])/g,`$1`),t.replace(/,([\r\n])/g,`$1`))};function z(e,t,n,r,i){t||=[],n||=[],r&&(e=r(i,e));var a;for(a=0;a<t.length;a+=1)if(t[a]===e)return n[a];var o;if(ce.call(e)===`[object Array]`){for(t.push(e),o=Array(e.length),n.push(o),a=0;a<e.length;a+=1)o[a]=z(e[a],t,n,r,i);return t.pop(),n.pop(),o}if(e&&e.toJSON&&(e=e.toJSON()),L(e)===`object`&&e!==null){t.push(e),o={},n.push(o);var s=[],c;for(c in e)e.hasOwnProperty(c)&&s.push(c);for(s.sort(),a=0;a<s.length;a+=1)c=s[a],o[c]=z(e[c],t,n,r,c);t.pop(),n.pop()}else o=e;return o}var B=new A;B.tokenize=function(e){return e.slice()},B.join=B.removeEmpty=function(e){return e};function V(e,t){let n=t.content.findDiffStart(e.content);if(n===null)return!1;let{a:r,b:i}=t.content.findDiffEnd(e.content),a=n-Math.min(r,i);return a>0&&(e.resolve(n-a).depth<t.resolve(r+a).depth?n-=a:(r+=a,i+=a)),new b(n,i,t.slice(n,r))}function le(e){if(!e.steps.length)return;let t=new C(e.docs[0]),n=e.steps.slice();for(;n.length;){let e=n.shift();for(;n.length&&e.merge(n[0]);){let r=n.shift();e=e instanceof b&&r instanceof b?V(t.doc,r.apply(e.apply(t.doc).doc).doc):e.merge(r)}t.step(e)}return t}function H(e){let t=new C(e);return t.removeMark(0,e.nodeSize-2),t.doc}function U(e,t){let n=t.split(`/`);for(n.shift();n.length;){if(typeof e!=`object`)throw Error();let t=n.shift();e=e[t]}return e}function W(e){return JSON.parse(JSON.stringify(e))}var ue=class{fromDoc;toDoc;complexSteps;wordDiffs;simplifyDiff;schema;tr;currentJSON;finalJSON;ops;constructor(e,t,n={}){let r={complexSteps:!0,wordDiffs:!1,simplifyDiff:!0,...n};this.fromDoc=e,this.toDoc=t,this.complexSteps=r.complexSteps,this.wordDiffs=r.wordDiffs,this.simplifyDiff=r.simplifyDiff,this.schema=e.type.schema,this.tr=new C(e),this.currentJSON={},this.finalJSON={},this.ops=[]}init(){return this.complexSteps?(this.currentJSON=H(this.fromDoc).toJSON(),this.finalJSON=H(this.toDoc).toJSON(),this.ops=(0,k.createPatch)(this.currentJSON,this.finalJSON),this.recreateChangeContentSteps(),this.recreateChangeMarkSteps()):(this.currentJSON=this.fromDoc.toJSON(),this.finalJSON=this.toDoc.toJSON(),this.ops=(0,k.createPatch)(this.currentJSON,this.finalJSON),this.recreateChangeContentSteps()),this.simplifyDiff&&(this.tr=le(this.tr)||this.tr),this.tr}recreateChangeContentSteps(){let e=[];for(;this.ops.length;){let t=this.ops.shift();e.push(t);let n,r=W(this.currentJSON),i=t.path.split(`/`);for(;n==null;){(0,k.applyPatch)(r,[t]);try{n=this.schema.nodeFromJSON(r),n.check()}catch{if(n=null,this.ops.length>0)t=this.ops.shift(),e.push(t);else throw Error(`No valid diff possible applying ${t.path}`)}}this.complexSteps&&e.length===1&&(i.includes(`attrs`)||i.includes(`type`))?(this.addSetNodeMarkup(),e=[]):e.length===1&&t.op===`replace`&&i[i.length-1]===`text`?(this.addReplaceTextSteps(t,r),e=[]):this.addReplaceStep(n,r)&&(e=[])}}addSetNodeMarkup(){let e=this.schema.nodeFromJSON(this.currentJSON),t=this.schema.nodeFromJSON(this.finalJSON),n=t.content.findDiffStart(e.content),r=e.nodeAt(n),i=t.nodeAt(n);if(n!=null){let e=r.type===i.type?null:i.type;try{this.tr.setNodeMarkup(n,e,i.attrs,i.marks)}catch(t){if(e&&t.message.includes(`Invalid content`))this.tr.replaceWith(n,n+r.nodeSize,i);else throw t}return this.currentJSON=H(this.tr.doc).toJSON(),this.ops=(0,k.createPatch)(this.currentJSON,this.finalJSON),!0}return!1}recreateChangeMarkSteps(){this.toDoc.descendants((e,t)=>{if(!e.isInline)return!0;this.tr.doc.nodesBetween(t,t+e.nodeSize,(n,r)=>{if(!n.isInline)return!0;let i=Math.max(t,r),a=Math.min(t+e.nodeSize,r+n.nodeSize);n.marks.forEach(t=>{t.isInSet(e.marks)||this.tr.removeMark(i,a,t)}),e.marks.forEach(e=>{e.isInSet(n.marks)||this.tr.addMark(i,a,e)})})})}addReplaceStep(e,t){let n=V(this.schema.nodeFromJSON(this.currentJSON),e);if(!n)return!1;if(!this.tr.maybeStep(n).failed)return this.currentJSON=t,!0;throw Error(`No valid step found.`)}addReplaceTextSteps(e,t){let n={...e,value:`xx`},r={...e,value:`yy`},i=W(this.currentJSON),a=W(this.currentJSON);(0,k.applyPatch)(i,[n]),(0,k.applyPatch)(a,[r]);let o=this.schema.nodeFromJSON(i),s=this.schema.nodeFromJSON(a),c=e.value,l=U(this.currentJSON,e.path),u=this.wordDiffs?oe(l,c):ae(l,c),d=o.content.findDiffStart(s.content),f=o.resolve(d+1).marks();for(;u.length;){let e=u.shift();if(e.added){let t=this.schema.nodeFromJSON({type:`text`,text:e.value}).mark(f);if(u.length&&u[0].removed){let e=u.shift();this.tr.replaceWith(d,d+e.value.length,t)}else this.tr.insert(d,t);d+=e.value.length}else if(e.removed)if(u.length&&u[0].added){let t=u.shift(),n=this.schema.nodeFromJSON({type:`text`,text:t.value}).mark(f);this.tr.replaceWith(d,d+e.value.length,n),d+=t.value.length}else this.tr.delete(d,d+e.value.length);else d+=e.value.length}this.currentJSON=t}};function de(e,t,n={}){return new ue(e,t,n).init()}var G=new Set([`list`,`bulletList`,`orderedList`,`taskList`]);function K(e){let t=[];return e.forEach((e,n)=>{if(G.has(e.type.name)){let r=n+1,i=0;e.forEach(e=>{let n=r+i;t.push({from:n,to:n+e.nodeSize,key:`${e.type.name}:${e.textContent}`}),i+=e.nodeSize})}else t.push({from:n,to:n+e.nodeSize,key:`${e.type.name}:${e.textContent}`})}),t}function fe(e,t){let n=e.length,r=t.length,i=Array.from({length:n+1},()=>Array(r+1).fill(0));for(let a=n-1;a>=0;a--)for(let n=r-1;n>=0;n--)i[a][n]=e[a].key===t[n].key?i[a+1][n+1]+1:Math.max(i[a+1][n],i[a][n+1]);let a=[],o=0,s=0;for(;o<n&&s<r;)e[o].key===t[s].key?(a.push({type:`same`,b:t[s]}),o++,s++):i[o+1][s]>=i[o][s+1]?(a.push({type:`del`,a:e[o]}),o++):(a.push({type:`ins`,b:t[s]}),s++);for(;o<n;)a.push({type:`del`,a:e[o++]});for(;s<r;)a.push({type:`ins`,b:t[s++]});return a}function pe(e,t){let n=fe(K(e),K(t)),r=[],i=0;for(let e of n)e.type===`same`?i=e.b.to:e.type===`ins`?(r.push({fromA:0,toA:0,fromB:e.b.from,toB:e.b.to}),i=e.b.to):r.push({fromA:e.a.from,toA:e.a.to,fromB:i,toB:i});return r}var me=400;function q(e,t,n){return t.nodeFromJSON(e.parseWithFallback(n))}function he(e,t){let n=t.filter(e=>e.toB>e.fromB),r=[];return e.steps.forEach((t,i)=>{let a=t instanceof v?`add`:t instanceof g?`remove`:null;if(a===null)return;let o=t,s=e.mapping.slice(i+1),c=s.map(o.from,-1),l=s.map(o.to,1);if(l<=c||n.some(e=>e.fromB<=c&&l<=e.toB))return;let u=e.mapping.slice(0,i).invert(),d=u.map(o.from),f=u.map(o.to);f<=d||r.push({fromA:d,toA:f,fromB:c,toB:l,markName:o.mark.type.name,kind:a})}),r}function ge(e,t,n,r){if(e.length>2e5||t.length>2e5)return{ok:!1,reason:`ceiling`};let i,a;try{i=q(r,n,e),a=q(r,n,t)}catch{return{ok:!1,reason:`parse`}}let o=a,s=null;try{s=de(i,a,{complexSteps:!0,wordDiffs:!0,simplifyDiff:!0}),o=s.doc}catch{}let c=pe(i,o),l=s?he(s,c):[];return c.length+l.length>me?{ok:!1,reason:`ceiling`}:{ok:!0,afterDoc:o,beforeDoc:i,changes:c,markChanges:l}}var _e=`.ok-diff-ins, .ok-diff-ins-block, [data-diff-deleted]`;function ve(e){return e.changes.length+2*e.markChanges.length}function J(e){let t=!1;return e.forEach(e=>{e.isBlock&&(t=!0)}),t}function ye(e){if(e.childCount===0)return!1;let t=!0;return e.forEach(e=>{e.type.name!==`listItem`&&e.type.name!==`taskItem`&&(t=!1)}),t}function Y(e,t,n){let r=document.createElement(n?`div`:`span`);r.className=n?`ok-diff-del ok-diff-del-block`:`ok-diff-del`,r.setAttribute(`data-diff-deleted`,``);let i=e.serializeFragment(t);if(n&&ye(t)){let e=document.createElement(`ul`);e.appendChild(i),r.appendChild(e)}else r.appendChild(i);return r}function be(e,t,n,r,i){let a=S.fromSchema(i),o=[];for(let e of r){let n=t.slice(e.fromA,e.toA),r=J(n.content);o.push(d.widget(e.fromB,()=>Y(a,n.content,r),{side:-1,ignoreSelection:!0,marks:[]})),o.push(d.inline(e.fromB,e.toB,{class:`ok-diff-ins`},{inclusiveEnd:!0}))}for(let e of n)if(e.toB>e.fromB&&o.push(d.node(e.fromB,e.toB,{class:`ok-diff-ins-block`})),e.toA>e.fromA){let n=t.slice(e.fromA,e.toA),r=J(n.content);o.push(d.widget(e.fromB,()=>Y(a,n.content,r),{side:-1,ignoreSelection:!0,marks:[]}))}return _.create(e,o)}var xe=new Set([`slashCommand`,`blockDragHandle`,`blockMover`,`tableInsertControls`,`fileHandler`,`gfmAutolink`,`inlineLinkInputRule`,`keyboardNav`,`tiptapFindReplace`,`selectionState`,`sourceDirtyObserver`,`tabFocusTrap`]),X=i.filter(e=>!xe.has(e.name)).map(e=>e.name===`jsxComponent`?p:e),Z=n(),Q=h(X);function Se(e,t){return ge(e,t,Q,c())}var Ce=x.create({name:`renderedDiffDecorations`,addOptions(){return{decorations:_.empty}},addProseMirrorPlugins(){let e=this.options.decorations;return[new f({key:new m(`renderedDiffDecorations`),props:{decorations:()=>e}})]}});function we(e){let t=(0,O.c)(31),{diff:n}=e,r,i,a,o;if(t[0]!==n.afterDoc||t[1]!==n.beforeDoc||t[2]!==n.changes||t[3]!==n.markChanges){let e=be(n.afterDoc,n.beforeDoc,n.changes,n.markChanges,Q);o=u,a=!1,r=X,i=Ce.configure({decorations:e}),t[0]=n.afterDoc,t[1]=n.beforeDoc,t[2]=n.changes,t[3]=n.markChanges,t[4]=r,t[5]=i,t[6]=a,t[7]=o}else r=t[4],i=t[5],a=t[6],o=t[7];let s;t[8]!==r||t[9]!==i?(s=[...r,i],t[8]=r,t[9]=i,t[10]=s):s=t[10];let c;t[11]===n.afterDoc?c=t[12]:(c=n.afterDoc.toJSON(),t[11]=n.afterDoc,t[12]=c);let d;t[13]===Symbol.for(`react.memo_cache_sentinel`)?(d={attributes:{class:`pt-4`}},t[13]=d):d=t[13];let f;t[14]!==a||t[15]!==s||t[16]!==c?(f={editable:a,extensions:s,content:c,editorProps:d},t[14]=a,t[15]=s,t[16]=c,t[17]=f):f=t[17];let p;t[18]===n?p=t[19]:(p=[n],t[18]=n,t[19]=p);let m=o(f,p),[h]=(0,D.useState)(Te),g=(0,D.useRef)(null),_,v;t[20]===h?(_=t[21],v=t[22]):(_=()=>{let e=g.current;if(e)return e.appendChild(h),()=>{h.parentNode===e&&e.removeChild(h)}},v=[h],t[20]=h,t[21]=_,t[22]=v),(0,D.useLayoutEffect)(_,v);let y;t[23]===Symbol.for(`react.memo_cache_sentinel`)?(y=(0,Z.jsx)(`div`,{className:`tiptap-editor`,children:(0,Z.jsx)(`div`,{ref:g,style:{display:`contents`}})}),t[23]=y):y=t[23];let b;t[24]===m?b=t[25]:(b=(0,Z.jsx)(l,{editor:m,className:`tiptap-editor-portal-content`}),t[24]=m,t[25]=b);let x;t[26]!==h||t[27]!==b?(x=(0,re.createPortal)(b,h),t[26]=h,t[27]=b,t[28]=x):x=t[28];let S;return t[29]===x?S=t[30]:(S=(0,Z.jsxs)(`div`,{className:`editor-doc-scroll min-h-0 flex-1`,"data-testid":`rendered-diff-view`,children:[y,x]}),t[29]=x,t[30]=S),S}function Te(){let e=document.createElement(`div`);return e.style.display=`contents`,e}function Ee(e){let t=0,n=!1;for(let r of e.split(`
|
|
1
|
+
import{i as e,t}from"./chunk-DseTPa7n.js";import{t as n}from"./jsx-runtime-DyiINK0N.js";import{n as r,p as i}from"./DocumentContext-DN3M8p0h.js";import{t as a}from"./react-JNybMug3.js";import{t as o}from"./react-dom-Db7zF7dM.js";import{t as s}from"./compiler-runtime-dQcBxOhn.js";import{I as c,et as l,st as u}from"./CodeMirrorPropInput-Sjp30pzp.js";import{Ai as d,Hi as f,Ji as p,K as m,Qi as h,Ui as g,Xr as _,_i as v,ea as y,ia as b,na as x,qi as S,ra as C}from"./dist-CDKZLcnD.js";import{t as ee}from"./libesm-BUX1Jc4h.js";var w=t((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.Pointer=void 0,e.unescapeToken=t,e.escapeToken=n;function t(e){return e.replace(/~1/g,`/`).replace(/~0/g,`~`)}function n(e){return e.replace(/~/g,`~0`).replace(/\//g,`~1`)}e.Pointer=function(){function e(e){e===void 0&&(e=[``]),this.tokens=e}return e.fromJSON=function(n){var r=n.split(`/`).map(t);if(r[0]!==``)throw Error(`Invalid JSON Pointer: ${n}`);return new e(r)},e.prototype.toString=function(){return this.tokens.map(n).join(`/`)},e.prototype.evaluate=function(e){for(var t=null,n=``,r=e,i=1,a=this.tokens.length;i<a;i++)t=r,n=this.tokens[i],!(n==`__proto__`||n==`constructor`||n==`prototype`)&&(r=(t||{})[n]);return{parent:t,key:n,value:r}},e.prototype.get=function(e){return this.evaluate(e).value},e.prototype.set=function(e,t){var n=this.evaluate(e);n.parent&&(n.parent[n.key]=t)},e.prototype.push=function(e){this.tokens.push(e)},e.prototype.add=function(t){return new e(this.tokens.concat(String(t)))},e.prototype.parent=function(){return new e(this.tokens.length>1?this.tokens.slice(0,-1):[``])},e}()})),T=t((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.hasOwnProperty=void 0,e.objectType=t,e.clone=r,e.hasOwnProperty=Object.prototype.hasOwnProperty;function t(e){return e===void 0?`undefined`:e===null?`null`:Array.isArray(e)?`array`:typeof e}function n(e){return typeof e==`object`&&!!e}function r(t){if(!n(t))return t;if(t.constructor==Array){for(var i=t.length,a=Array(i),o=0;o<i;o++)a[o]=r(t[o]);return a}if(t.constructor==Date)return new Date(+t);var s={};for(var c in t)e.hasOwnProperty.call(t,c)&&(s[c]=r(t[c]));return s}})),E=t((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.isDestructive=n,e.subtract=r,e.intersection=i,e.diffArrays=l,e.diffObjects=u,e.diffAny=d;var t=T();function n(e){var t=e.op;return t===`remove`||t===`replace`||t===`copy`||t===`move`}function r(e,n){var r=[];for(var i in e)t.hasOwnProperty.call(e,i)&&e[i]!==void 0&&!(t.hasOwnProperty.call(n,i)&&n[i]!==void 0)&&r.push(i);return r}function i(e){for(var n=e.length,r={},i=0;i<n;i++){var a=e[i];for(var o in a)t.hasOwnProperty.call(a,o)&&a[o]!==void 0&&(r[o]=(r[o]||0)+1)}for(var o in r)r[o]<n&&delete r[o];return Object.keys(r)}function a(e,n){var r=[];for(var i in e)t.hasOwnProperty.call(e,i)&&e[i]!==void 0&&t.hasOwnProperty.call(n,i)&&n[i]!==void 0&&r.push(i);return r}function o(e){return e.op===`add`}function s(e){return e.op===`remove`}function c(e,t){return{operations:e.operations.concat(t),cost:e.cost+1}}function l(e,t,n,r){r===void 0&&(r=d);var i=Math.max(e.length,t.length),a=new Map([[0,{operations:[],cost:0}]]);function l(o,s){var u=o*i+s,d=a.get(u);if(d===void 0){if(o>0&&s>0&&!r(e[o-1],t[s-1],n.add(String(o-1))).length)d=l(o-1,s-1);else{var f=[];if(o>0){var p=l(o-1,s),m={op:`remove`,index:o-1};f.push(c(p,m))}if(s>0){var h=l(o,s-1),g={op:`add`,index:o-1,value:t[s-1]};f.push(c(h,g))}if(o>0&&s>0){var _=l(o-1,s-1),v={op:`replace`,index:o-1,original:e[o-1],value:t[s-1]};f.push(c(_,v))}d=f.sort(function(e,t){return e.cost-t.cost})[0]}a.set(u,d)}return d}var u=isNaN(e.length)||e.length<=0?0:e.length;return l(u,isNaN(t.length)||t.length<=0?0:t.length).operations.reduce(function(e,t){var i=e[0],a=e[1];if(o(t)){var c=t.index+1+a,l=c<u+a?String(c):`-`,d={op:t.op,path:n.add(l).toString(),value:t.value};return[i.concat(d),a+1]}else if(s(t)){var d={op:t.op,path:n.add(String(t.index+a)).toString()};return[i.concat(d),a-1]}else{var f=n.add(String(t.index+a)),p=r(t.original,t.value,f);return[i.concat.apply(i,p),a]}},[[],0])[0]}function u(e,t,n,i){i===void 0&&(i=d);var o=[];return r(e,t).forEach(function(e){o.push({op:`remove`,path:n.add(e).toString()})}),r(t,e).forEach(function(e){o.push({op:`add`,path:n.add(e).toString(),value:t[e]})}),a(e,t).forEach(function(r){o.push.apply(o,i(e[r],t[r],n.add(r)))}),o}function d(e,n,r,i){if(i===void 0&&(i=d),e===n)return[];var a=(0,t.objectType)(e),o=(0,t.objectType)(n);return a==`array`&&o==`array`?l(e,n,r,i):a==`object`&&o==`object`?u(e,n,r,i):[{op:`replace`,path:r.toString(),value:n}]}})),te=t((e=>{var t=e&&e.__extends||(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if(typeof n!=`function`&&n!==null)throw TypeError(`Class extends value `+String(n)+` is not a constructor or null`);e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})();Object.defineProperty(e,`__esModule`,{value:!0}),e.InvalidOperationError=e.TestError=e.MissingError=void 0,e.add=l,e.remove=u,e.replace=d,e.move=f,e.copy=p,e.test=m,e.apply=g;var n=w(),r=T(),i=E(),a=function(e){t(n,e);function n(t){var n=e.call(this,`Value required at path: ${t}`)||this;return n.path=t,n.name=`MissingError`,n}return n}(Error);e.MissingError=a;var o=function(e){t(n,e);function n(t,n){var r=e.call(this,`Test failed: ${t} != ${n}`)||this;return r.actual=t,r.expected=n,r.name=`TestError`,r}return n}(Error);e.TestError=o;function s(e,t,n){if(Array.isArray(e))if(t==`-`)e.push(n);else{var r=parseInt(t,10);e.splice(r,0,n)}else e[t]=n}function c(e,t){if(Array.isArray(e)){var n=parseInt(t,10);e.splice(n,1)}else delete e[t]}function l(e,t,i){var o=n.Pointer.fromJSON(t.path);if(i?.implicitArrayCreation&&o.tokens[o.tokens.length-1]===`-`){var c=o.parent().evaluate(e);c.value===void 0&&(0,r.objectType)(c.parent)===`object`&&(c.parent[c.key]=[])}var l=o.evaluate(e);return l.parent===void 0||i?.implicitArrayCreation&&l.key===`-`&&!Array.isArray(l.parent)?new a(t.path):(s(l.parent,l.key,(0,r.clone)(t.value)),null)}function u(e,t,r){var i=n.Pointer.fromJSON(t.path).evaluate(e);return i.value===void 0?new a(t.path):(c(i.parent,i.key),null)}function d(e,t,i){var o=n.Pointer.fromJSON(t.path).evaluate(e);if(o.parent===null)return new a(t.path);if(Array.isArray(o.parent)){if(parseInt(o.key,10)>=o.parent.length)return new a(t.path)}else if(o.value===void 0)return new a(t.path);return o.parent[o.key]=(0,r.clone)(t.value),null}function f(e,t,r){var i=n.Pointer.fromJSON(t.from).evaluate(e);if(i.value===void 0)return new a(t.from);var o=n.Pointer.fromJSON(t.path).evaluate(e);return o.parent===void 0?new a(t.path):(c(i.parent,i.key),s(o.parent,o.key,i.value),null)}function p(e,t,i){var o=n.Pointer.fromJSON(t.from).evaluate(e);if(o.value===void 0)return new a(t.from);var c=n.Pointer.fromJSON(t.path).evaluate(e);return c.parent===void 0?new a(t.path):(s(c.parent,c.key,(0,r.clone)(o.value)),null)}function m(e,t,r){var a=n.Pointer.fromJSON(t.path).evaluate(e);return(0,i.diffAny)(a.value,t.value,new n.Pointer).length?new o(a.value,t.value):null}var h=function(e){t(n,e);function n(t){var n=e.call(this,`Invalid operation: ${t.op}`)||this;return n.operation=t,n.name=`InvalidOperationError`,n}return n}(Error);e.InvalidOperationError=h;function g(e,t,n){switch(t.op){case`add`:return l(e,t,n);case`remove`:return u(e,t,n);case`replace`:return d(e,t,n);case`move`:return f(e,t,n);case`copy`:return p(e,t,n);case`test`:return m(e,t,n)}return new h(t)}})),ne=t((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.Pointer=void 0,e.applyPatch=i,e.createPatch=o;var t=w();Object.defineProperty(e,`Pointer`,{enumerable:!0,get:function(){return t.Pointer}});var n=te(),r=E();function i(e,t,r){return t.map(function(t){return(0,n.apply)(e,t,r)})}function a(e){function t(n,i,a){var o=e(n,i,a);return Array.isArray(o)?o:(0,r.diffAny)(n,i,a,t)}return t}function o(e,n,i){var o=new t.Pointer;return(i?a(i):r.diffAny)(e,n,o)}})),D=e(a(),1),re=e(o(),1),O=s(),k=ne();function A(){}A.prototype={diff:function(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},r=n.callback;typeof n==`function`&&(r=n,n={}),this.options=n;var i=this;function a(e){return r?(setTimeout(function(){r(void 0,e)},0),!0):e}e=this.castInput(e),t=this.castInput(t),e=this.removeEmpty(this.tokenize(e)),t=this.removeEmpty(this.tokenize(t));var o=t.length,s=e.length,c=1,l=o+s;n.maxEditLength&&(l=Math.min(l,n.maxEditLength));var u=n.timeout??1/0,d=Date.now()+u,f=[{oldPos:-1,lastComponent:void 0}],p=this.extractCommon(f[0],t,e,0);if(f[0].oldPos+1>=s&&p+1>=o)return a([{value:this.join(t),count:t.length}]);var m=-1/0,h=1/0;function g(){for(var n=Math.max(m,-c);n<=Math.min(h,c);n+=2){var r=void 0,l=f[n-1],u=f[n+1];l&&(f[n-1]=void 0);var d=!1;if(u){var g=u.oldPos-n;d=u&&0<=g&&g<o}var _=l&&l.oldPos+1<s;if(!d&&!_){f[n]=void 0;continue}if(r=!_||d&&l.oldPos+1<u.oldPos?i.addToPath(u,!0,void 0,0):i.addToPath(l,void 0,!0,1),p=i.extractCommon(r,t,e,n),r.oldPos+1>=s&&p+1>=o)return a(ie(i,r.lastComponent,t,e,i.useLongestToken));f[n]=r,r.oldPos+1>=s&&(h=Math.min(h,n-1)),p+1>=o&&(m=Math.max(m,n+1))}c++}if(r)(function e(){setTimeout(function(){if(c>l||Date.now()>d)return r();g()||e()},0)})();else for(;c<=l&&Date.now()<=d;){var _=g();if(_)return _}},addToPath:function(e,t,n,r){var i=e.lastComponent;return i&&i.added===t&&i.removed===n?{oldPos:e.oldPos+r,lastComponent:{count:i.count+1,added:t,removed:n,previousComponent:i.previousComponent}}:{oldPos:e.oldPos+r,lastComponent:{count:1,added:t,removed:n,previousComponent:i}}},extractCommon:function(e,t,n,r){for(var i=t.length,a=n.length,o=e.oldPos,s=o-r,c=0;s+1<i&&o+1<a&&this.equals(t[s+1],n[o+1]);)s++,o++,c++;return c&&(e.lastComponent={count:c,previousComponent:e.lastComponent}),e.oldPos=o,s},equals:function(e,t){return this.options.comparator?this.options.comparator(e,t):e===t||this.options.ignoreCase&&e.toLowerCase()===t.toLowerCase()},removeEmpty:function(e){for(var t=[],n=0;n<e.length;n++)e[n]&&t.push(e[n]);return t},castInput:function(e){return e},tokenize:function(e){return e.split(``)},join:function(e){return e.join(``)}};function ie(e,t,n,r,i){for(var a=[],o;t;)a.push(t),o=t.previousComponent,delete t.previousComponent,t=o;a.reverse();for(var s=0,c=a.length,l=0,u=0;s<c;s++){var d=a[s];if(!d.removed){if(!d.added&&i){var f=n.slice(l,l+d.count);f=f.map(function(e,t){var n=r[u+t];return n.length>e.length?n:e}),d.value=e.join(f)}else d.value=e.join(n.slice(l,l+d.count));l+=d.count,d.added||(u+=d.count)}else if(d.value=e.join(r.slice(u,u+d.count)),u+=d.count,s&&a[s-1].added){var p=a[s-1];a[s-1]=a[s],a[s]=p}}var m=a[c-1];return c>1&&typeof m.value==`string`&&(m.added||m.removed)&&e.equals(``,m.value)&&(a[c-2].value+=m.value,a.pop()),a}var j=new A;function ae(e,t,n){return j.diff(e,t,n)}var M=/^[A-Za-z\xC0-\u02C6\u02C8-\u02D7\u02DE-\u02FF\u1E00-\u1EFF]+$/,N=/\S/,P=new A;P.equals=function(e,t){return this.options.ignoreCase&&(e=e.toLowerCase(),t=t.toLowerCase()),e===t||this.options.ignoreWhitespace&&!N.test(e)&&!N.test(t)},P.tokenize=function(e){for(var t=e.split(/([^\S\r\n]+|[()[\]{}'"\r\n]|\b)/),n=0;n<t.length-1;n++)!t[n+1]&&t[n+2]&&M.test(t[n])&&M.test(t[n+2])&&(t[n]+=t[n+2],t.splice(n+1,2),n--);return t};function oe(e,t,n){return P.diff(e,t,n)}var F=new A;F.tokenize=function(e){this.options.stripTrailingCr&&(e=e.replace(/\r\n/g,`
|
|
2
|
+
`));var t=[],n=e.split(/(\n|\r\n)/);n[n.length-1]||n.pop();for(var r=0;r<n.length;r++){var i=n[r];r%2&&!this.options.newlineIsToken?t[t.length-1]+=i:(this.options.ignoreWhitespace&&(i=i.trim()),t.push(i))}return t};var I=new A;I.tokenize=function(e){return e.split(/(\S.+?[.!?])(?=\s+|$)/)};var se=new A;se.tokenize=function(e){return e.split(/([{}:;,]|\s+)/)};function L(e){"@babel/helpers - typeof";return L=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},L(e)}var ce=Object.prototype.toString,R=new A;R.useLongestToken=!0,R.tokenize=F.tokenize,R.castInput=function(e){var t=this.options,n=t.undefinedReplacement,r=t.stringifyReplacer,i=r===void 0?function(e,t){return t===void 0?n:t}:r;return typeof e==`string`?e:JSON.stringify(z(e,null,null,i),i,` `)},R.equals=function(e,t){return A.prototype.equals.call(R,e.replace(/,([\r\n])/g,`$1`),t.replace(/,([\r\n])/g,`$1`))};function z(e,t,n,r,i){t||=[],n||=[],r&&(e=r(i,e));var a;for(a=0;a<t.length;a+=1)if(t[a]===e)return n[a];var o;if(ce.call(e)===`[object Array]`){for(t.push(e),o=Array(e.length),n.push(o),a=0;a<e.length;a+=1)o[a]=z(e[a],t,n,r,i);return t.pop(),n.pop(),o}if(e&&e.toJSON&&(e=e.toJSON()),L(e)===`object`&&e!==null){t.push(e),o={},n.push(o);var s=[],c;for(c in e)e.hasOwnProperty(c)&&s.push(c);for(s.sort(),a=0;a<s.length;a+=1)c=s[a],o[c]=z(e[c],t,n,r,c);t.pop(),n.pop()}else o=e;return o}var B=new A;B.tokenize=function(e){return e.slice()},B.join=B.removeEmpty=function(e){return e};function V(e,t){let n=t.content.findDiffStart(e.content);if(n===null)return!1;let{a:r,b:i}=t.content.findDiffEnd(e.content),a=n-Math.min(r,i);return a>0&&(e.resolve(n-a).depth<t.resolve(r+a).depth?n-=a:(r+=a,i+=a)),new x(n,i,t.slice(n,r))}function le(e){if(!e.steps.length)return;let t=new C(e.docs[0]),n=e.steps.slice();for(;n.length;){let e=n.shift();for(;n.length&&e.merge(n[0]);){let r=n.shift();e=e instanceof x&&r instanceof x?V(t.doc,r.apply(e.apply(t.doc).doc).doc):e.merge(r)}t.step(e)}return t}function H(e){let t=new C(e);return t.removeMark(0,e.nodeSize-2),t.doc}function U(e,t){let n=t.split(`/`);for(n.shift();n.length;){if(typeof e!=`object`)throw Error();let t=n.shift();e=e[t]}return e}function W(e){return JSON.parse(JSON.stringify(e))}var ue=class{fromDoc;toDoc;complexSteps;wordDiffs;simplifyDiff;schema;tr;currentJSON;finalJSON;ops;constructor(e,t,n={}){let r={complexSteps:!0,wordDiffs:!1,simplifyDiff:!0,...n};this.fromDoc=e,this.toDoc=t,this.complexSteps=r.complexSteps,this.wordDiffs=r.wordDiffs,this.simplifyDiff=r.simplifyDiff,this.schema=e.type.schema,this.tr=new C(e),this.currentJSON={},this.finalJSON={},this.ops=[]}init(){return this.complexSteps?(this.currentJSON=H(this.fromDoc).toJSON(),this.finalJSON=H(this.toDoc).toJSON(),this.ops=(0,k.createPatch)(this.currentJSON,this.finalJSON),this.recreateChangeContentSteps(),this.recreateChangeMarkSteps()):(this.currentJSON=this.fromDoc.toJSON(),this.finalJSON=this.toDoc.toJSON(),this.ops=(0,k.createPatch)(this.currentJSON,this.finalJSON),this.recreateChangeContentSteps()),this.simplifyDiff&&(this.tr=le(this.tr)||this.tr),this.tr}recreateChangeContentSteps(){let e=[];for(;this.ops.length;){let t=this.ops.shift();e.push(t);let n,r=W(this.currentJSON),i=t.path.split(`/`);for(;n==null;){(0,k.applyPatch)(r,[t]);try{n=this.schema.nodeFromJSON(r),n.check()}catch{if(n=null,this.ops.length>0)t=this.ops.shift(),e.push(t);else throw Error(`No valid diff possible applying ${t.path}`)}}this.complexSteps&&e.length===1&&(i.includes(`attrs`)||i.includes(`type`))?(this.addSetNodeMarkup(),e=[]):e.length===1&&t.op===`replace`&&i[i.length-1]===`text`?(this.addReplaceTextSteps(t,r),e=[]):this.addReplaceStep(n,r)&&(e=[])}}addSetNodeMarkup(){let e=this.schema.nodeFromJSON(this.currentJSON),t=this.schema.nodeFromJSON(this.finalJSON),n=t.content.findDiffStart(e.content),r=e.nodeAt(n),i=t.nodeAt(n);if(n!=null){let e=r.type===i.type?null:i.type;try{this.tr.setNodeMarkup(n,e,i.attrs,i.marks)}catch(t){if(e&&t.message.includes(`Invalid content`))this.tr.replaceWith(n,n+r.nodeSize,i);else throw t}return this.currentJSON=H(this.tr.doc).toJSON(),this.ops=(0,k.createPatch)(this.currentJSON,this.finalJSON),!0}return!1}recreateChangeMarkSteps(){this.toDoc.descendants((e,t)=>{if(!e.isInline)return!0;this.tr.doc.nodesBetween(t,t+e.nodeSize,(n,r)=>{if(!n.isInline)return!0;let i=Math.max(t,r),a=Math.min(t+e.nodeSize,r+n.nodeSize);n.marks.forEach(t=>{t.isInSet(e.marks)||this.tr.removeMark(i,a,t)}),e.marks.forEach(e=>{e.isInSet(n.marks)||this.tr.addMark(i,a,e)})})})}addReplaceStep(e,t){let n=V(this.schema.nodeFromJSON(this.currentJSON),e);if(!n)return!1;if(!this.tr.maybeStep(n).failed)return this.currentJSON=t,!0;throw Error(`No valid step found.`)}addReplaceTextSteps(e,t){let n={...e,value:`xx`},r={...e,value:`yy`},i=W(this.currentJSON),a=W(this.currentJSON);(0,k.applyPatch)(i,[n]),(0,k.applyPatch)(a,[r]);let o=this.schema.nodeFromJSON(i),s=this.schema.nodeFromJSON(a),c=e.value,l=U(this.currentJSON,e.path),u=this.wordDiffs?oe(l,c):ae(l,c),d=o.content.findDiffStart(s.content),f=o.resolve(d+1).marks();for(;u.length;){let e=u.shift();if(e.added){let t=this.schema.nodeFromJSON({type:`text`,text:e.value}).mark(f);if(u.length&&u[0].removed){let e=u.shift();this.tr.replaceWith(d,d+e.value.length,t)}else this.tr.insert(d,t);d+=e.value.length}else if(e.removed)if(u.length&&u[0].added){let t=u.shift(),n=this.schema.nodeFromJSON({type:`text`,text:t.value}).mark(f);this.tr.replaceWith(d,d+e.value.length,n),d+=t.value.length}else this.tr.delete(d,d+e.value.length);else d+=e.value.length}this.currentJSON=t}};function de(e,t,n={}){return new ue(e,t,n).init()}var G=new Set([`list`,`bulletList`,`orderedList`,`taskList`]);function K(e){let t=[];return e.forEach((e,n)=>{if(G.has(e.type.name)){let r=n+1,i=0;e.forEach(e=>{let n=r+i;t.push({from:n,to:n+e.nodeSize,key:`${e.type.name}:${e.textContent}`}),i+=e.nodeSize})}else t.push({from:n,to:n+e.nodeSize,key:`${e.type.name}:${e.textContent}`})}),t}function fe(e,t){let n=e.length,r=t.length,i=Array.from({length:n+1},()=>Array(r+1).fill(0));for(let a=n-1;a>=0;a--)for(let n=r-1;n>=0;n--)i[a][n]=e[a].key===t[n].key?i[a+1][n+1]+1:Math.max(i[a+1][n],i[a][n+1]);let a=[],o=0,s=0;for(;o<n&&s<r;)e[o].key===t[s].key?(a.push({type:`same`,b:t[s]}),o++,s++):i[o+1][s]>=i[o][s+1]?(a.push({type:`del`,a:e[o]}),o++):(a.push({type:`ins`,b:t[s]}),s++);for(;o<n;)a.push({type:`del`,a:e[o++]});for(;s<r;)a.push({type:`ins`,b:t[s++]});return a}function pe(e,t){let n=fe(K(e),K(t)),r=[],i=0;for(let e of n)e.type===`same`?i=e.b.to:e.type===`ins`?(r.push({fromA:0,toA:0,fromB:e.b.from,toB:e.b.to}),i=e.b.to):r.push({fromA:e.a.from,toA:e.a.to,fromB:i,toB:i});return r}var me=400;function q(e,t,n){return t.nodeFromJSON(e.parseWithFallback(n))}function he(e,t){let n=t.filter(e=>e.toB>e.fromB),r=[];return e.steps.forEach((t,i)=>{let a=t instanceof h?`add`:t instanceof y?`remove`:null;if(a===null)return;let o=t,s=e.mapping.slice(i+1),c=s.map(o.from,-1),l=s.map(o.to,1);if(l<=c||n.some(e=>e.fromB<=c&&l<=e.toB))return;let u=e.mapping.slice(0,i).invert(),d=u.map(o.from),f=u.map(o.to);f<=d||r.push({fromA:d,toA:f,fromB:c,toB:l,markName:o.mark.type.name,kind:a})}),r}function ge(e,t,n,r){if(e.length>2e5||t.length>2e5)return{ok:!1,reason:`ceiling`};let i,a;try{i=q(r,n,e),a=q(r,n,t)}catch{return{ok:!1,reason:`parse`}}let o=a,s=null;try{s=de(i,a,{complexSteps:!0,wordDiffs:!0,simplifyDiff:!0}),o=s.doc}catch{}let c=pe(i,o),l=s?he(s,c):[];return c.length+l.length>me?{ok:!1,reason:`ceiling`}:{ok:!0,afterDoc:o,beforeDoc:i,changes:c,markChanges:l}}var _e=`.ok-diff-ins, .ok-diff-ins-block, [data-diff-deleted]`;function ve(e){return e.changes.length+2*e.markChanges.length}function J(e){let t=!1;return e.forEach(e=>{e.isBlock&&(t=!0)}),t}function ye(e){if(e.childCount===0)return!1;let t=!0;return e.forEach(e=>{e.type.name!==`listItem`&&e.type.name!==`taskItem`&&(t=!1)}),t}function Y(e,t,n){let r=document.createElement(n?`div`:`span`);r.className=n?`ok-diff-del ok-diff-del-block`:`ok-diff-del`,r.setAttribute(`data-diff-deleted`,``);let i=e.serializeFragment(t);if(n&&ye(t)){let e=document.createElement(`ul`);e.appendChild(i),r.appendChild(e)}else r.appendChild(i);return r}function be(e,t,n,r,i){let a=b.fromSchema(i),o=[];for(let e of r){let n=t.slice(e.fromA,e.toA),r=J(n.content);o.push(f.widget(e.fromB,()=>Y(a,n.content,r),{side:-1,ignoreSelection:!0,marks:[]})),o.push(f.inline(e.fromB,e.toB,{class:`ok-diff-ins`},{inclusiveEnd:!0}))}for(let e of n)if(e.toB>e.fromB&&o.push(f.node(e.fromB,e.toB,{class:`ok-diff-ins-block`})),e.toA>e.fromA){let n=t.slice(e.fromA,e.toA),r=J(n.content);o.push(f.widget(e.fromB,()=>Y(a,n.content,r),{side:-1,ignoreSelection:!0,marks:[]}))}return g.create(e,o)}var xe=new Set([`slashCommand`,`blockDragHandle`,`blockMover`,`tableInsertControls`,`fileHandler`,`gfmAutolink`,`inlineLinkInputRule`,`keyboardNav`,`tiptapFindReplace`,`selectionState`,`sourceDirtyObserver`,`tabFocusTrap`]),X=i.filter(e=>!xe.has(e.name)).map(e=>e.name===`jsxComponent`?m:e),Z=n(),Q=d(X);function Se(e,t){return ge(e,t,Q,c())}var Ce=v.create({name:`renderedDiffDecorations`,addOptions(){return{decorations:g.empty}},addProseMirrorPlugins(){let e=this.options.decorations;return[new S({key:new p(`renderedDiffDecorations`),props:{decorations:()=>e}})]}});function we(e){let t=(0,O.c)(31),{diff:n}=e,r,i,a,o;if(t[0]!==n.afterDoc||t[1]!==n.beforeDoc||t[2]!==n.changes||t[3]!==n.markChanges){let e=be(n.afterDoc,n.beforeDoc,n.changes,n.markChanges,Q);o=u,a=!1,r=X,i=Ce.configure({decorations:e}),t[0]=n.afterDoc,t[1]=n.beforeDoc,t[2]=n.changes,t[3]=n.markChanges,t[4]=r,t[5]=i,t[6]=a,t[7]=o}else r=t[4],i=t[5],a=t[6],o=t[7];let s;t[8]!==r||t[9]!==i?(s=[...r,i],t[8]=r,t[9]=i,t[10]=s):s=t[10];let c;t[11]===n.afterDoc?c=t[12]:(c=n.afterDoc.toJSON(),t[11]=n.afterDoc,t[12]=c);let d;t[13]===Symbol.for(`react.memo_cache_sentinel`)?(d={attributes:{class:`pt-4`}},t[13]=d):d=t[13];let f;t[14]!==a||t[15]!==s||t[16]!==c?(f={editable:a,extensions:s,content:c,editorProps:d},t[14]=a,t[15]=s,t[16]=c,t[17]=f):f=t[17];let p;t[18]===n?p=t[19]:(p=[n],t[18]=n,t[19]=p);let m=o(f,p),[h]=(0,D.useState)(Te),g=(0,D.useRef)(null),_,v;t[20]===h?(_=t[21],v=t[22]):(_=()=>{let e=g.current;if(e)return e.appendChild(h),()=>{h.parentNode===e&&e.removeChild(h)}},v=[h],t[20]=h,t[21]=_,t[22]=v),(0,D.useLayoutEffect)(_,v);let y;t[23]===Symbol.for(`react.memo_cache_sentinel`)?(y=(0,Z.jsx)(`div`,{className:`tiptap-editor`,children:(0,Z.jsx)(`div`,{ref:g,style:{display:`contents`}})}),t[23]=y):y=t[23];let b;t[24]===m?b=t[25]:(b=(0,Z.jsx)(l,{editor:m,className:`tiptap-editor-portal-content`}),t[24]=m,t[25]=b);let x;t[26]!==h||t[27]!==b?(x=(0,re.createPortal)(b,h),t[26]=h,t[27]=b,t[28]=x):x=t[28];let S;return t[29]===x?S=t[30]:(S=(0,Z.jsxs)(`div`,{className:`editor-doc-scroll min-h-0 flex-1`,"data-testid":`rendered-diff-view`,children:[y,x]}),t[29]=x,t[30]=S),S}function Te(){let e=document.createElement(`div`);return e.style.display=`contents`,e}function Ee(e){let t=0,n=!1;for(let r of e.split(`
|
|
3
3
|
`)){let e=r.startsWith(`+`)&&!r.startsWith(`+++`)||r.startsWith(`-`)&&!r.startsWith(`---`);e&&!n&&(t+=1),n=e}return t}function De(e){let t=Array.from(e.querySelectorAll(`.diff-code-insert, .diff-code-delete`)),n=[],r=null;for(let e of t){let t=e.closest(`tr`);t&&((r===null||t.previousElementSibling!==r)&&n.push(e),r=t)}return n}function $(e){let t=0,n=0;for(let r of e.split(`
|
|
4
|
-
`))r.startsWith(`+`)&&!r.startsWith(`+++`)?t++:r.startsWith(`-`)&&!r.startsWith(`---`)&&n++;return{additions:t,deletions:n}}function Oe(e,t){return`${e}\u0000${t}`}function ke(e,t,n){let r=
|
|
4
|
+
`))r.startsWith(`+`)&&!r.startsWith(`+++`)?t++:r.startsWith(`-`)&&!r.startsWith(`---`)&&n++;return{additions:t,deletions:n}}function Oe(e,t){return`${e}\u0000${t}`}function ke(e,t,n){let r=_(e).body,i=_(t).body;return r===i?``:ee(n,r,i,``,``,{context:Math.max(r.split(`
|
|
5
5
|
`).length,i.split(`
|
|
6
|
-
`).length)})}function Ae(e,t,n,i,a){let o=(0,O.c)(10),s=i===void 0?`vs-live`:i,c=a===void 0?null:a,{activeProvider:l}=r(),u;o[0]===Symbol.for(`react.memo_cache_sentinel`)?(u={status:`idle`,diff:null},o[0]=u):u=o[0];let[d,f]=(0,D.useState)(u),p=(0,D.useRef)(l),m;o[1]===l?m=o[2]:(m=()=>{p.current=l},o[1]=l,o[2]=m),(0,D.useEffect)(m);let h,g;return o[3]!==n||o[4]!==t||o[5]!==s||o[6]!==c||o[7]!==e?(h=()=>{if(!e){f({status:`idle`,diff:null});return}let r=e,i=!1;f({status:`loading`,diff:null});let a=async function(e){let r=Oe(t,e),i=n.get(r);if(i!==void 0)return i;let a=await fetch(`/api/history/${e}?docName=${encodeURIComponent(t)}`);if(!a.ok)return console.error(`[timeline-diff] history fetch returned non-ok response`,{sha:e,docName:t,status:a.status}),null;let o=(await a.json()).content??``;return n.set(r,o),o};return(async function(){try{let e=await a(r);if(i)return;if(e===null){f({status:`error`,diff:null});return}let n,o;if(s===`vs-parent`){let t=c?await a(c):``;if(i)return;if(t===null){f({status:`error`,diff:null});return}n=t,o=e}else n=e,o=p.current?.document.getText(`source`).toString()??``;let l=
|
|
6
|
+
`).length)})}function Ae(e,t,n,i,a){let o=(0,O.c)(10),s=i===void 0?`vs-live`:i,c=a===void 0?null:a,{activeProvider:l}=r(),u;o[0]===Symbol.for(`react.memo_cache_sentinel`)?(u={status:`idle`,diff:null},o[0]=u):u=o[0];let[d,f]=(0,D.useState)(u),p=(0,D.useRef)(l),m;o[1]===l?m=o[2]:(m=()=>{p.current=l},o[1]=l,o[2]=m),(0,D.useEffect)(m);let h,g;return o[3]!==n||o[4]!==t||o[5]!==s||o[6]!==c||o[7]!==e?(h=()=>{if(!e){f({status:`idle`,diff:null});return}let r=e,i=!1;f({status:`loading`,diff:null});let a=async function(e){let r=Oe(t,e),i=n.get(r);if(i!==void 0)return i;let a=await fetch(`/api/history/${e}?docName=${encodeURIComponent(t)}`);if(!a.ok)return console.error(`[timeline-diff] history fetch returned non-ok response`,{sha:e,docName:t,status:a.status}),null;let o=(await a.json()).content??``;return n.set(r,o),o};return(async function(){try{let e=await a(r);if(i)return;if(e===null){f({status:`error`,diff:null});return}let n,o;if(s===`vs-parent`){let t=c?await a(c):``;if(i)return;if(t===null){f({status:`error`,diff:null});return}n=t,o=e}else n=e,o=p.current?.document.getText(`source`).toString()??``;let l=_(n).body,u=_(o).body,d=ke(n,o,t);if(i)return;let{additions:m,deletions:h}=$(d);f({status:`ready`,diff:d,additions:m,deletions:h,before:l,after:u})}catch(e){i||(console.error(`[timeline-diff] failed to load entry diff`,{sha:r,docName:t,mode:s,err:e}),f({status:`error`,diff:null}))}})(),()=>{i=!0}},g=[e,t,n,s,c],o[3]=n,o[4]=t,o[5]=s,o[6]=c,o[7]=e,o[8]=h,o[9]=g):(h=o[8],g=o[9]),(0,D.useEffect)(h,g),d}export{we as a,ve as c,Ee as i,Ae as n,Se as o,De as r,_e as s,$ as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{i as e}from"./chunk-DseTPa7n.js";import{t}from"./react-JNybMug3.js";import{t as n}from"./compiler-runtime-dQcBxOhn.js";import{Gt as r}from"./dist-
|
|
1
|
+
import{i as e}from"./chunk-DseTPa7n.js";import{t}from"./react-JNybMug3.js";import{t as n}from"./compiler-runtime-dQcBxOhn.js";import{Gt as r}from"./dist-CDKZLcnD.js";var i=n(),a=e(t(),1);function o(){let e=(0,i.c)(3),[t,n]=(0,a.useState)(l),o,u;return e[0]===t?(o=e[1],u=e[2]):(o=()=>{if(t!==null||window.okDesktop)return;let e=!0;return fetch(`/api/workspace`).then(async t=>{let i=await t.json().catch(c);if(!e||!t.ok)return;let a=r.safeParse(i);a.success&&n({contentDir:a.data.contentDir,pathSeparator:a.data.pathSeparator})}).catch(s),()=>{e=!1}},u=[t],e[0]=t,e[1]=o,e[2]=u),(0,a.useEffect)(o,u),t}function s(e){console.warn(`[useWorkspace] /api/workspace fetch failed:`,e)}function c(){return null}function l(){return u()}function u(e=typeof window>`u`?void 0:window){if(!e)return null;let t=e.okDesktop;return t?{contentDir:t.config.projectPath,pathSeparator:t.platform===`win32`?`\\`:`/`}:null}export{o as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{i as e}from"./chunk-DseTPa7n.js";import{t}from"./react-JNybMug3.js";import{r as n}from"./dist-DBENJeML.js";import{t as r}from"./createLucideIcon-BUb14crZ.js";import{On as i}from"./dist-
|
|
1
|
+
import{i as e}from"./chunk-DseTPa7n.js";import{t}from"./react-JNybMug3.js";import{r as n}from"./dist-DBENJeML.js";import{t as r}from"./createLucideIcon-BUb14crZ.js";import{On as i}from"./dist-CDKZLcnD.js";var a=r(`copy-plus`,[[`line`,{x1:`15`,x2:`15`,y1:`12`,y2:`18`,key:`1p7wdc`}],[`line`,{x1:`12`,x2:`18`,y1:`15`,y2:`15`,key:`1nscbv`}],[`rect`,{width:`14`,height:`14`,x:`8`,y:`8`,rx:`2`,ry:`2`,key:`17jyea`}],[`path`,{d:`M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2`,key:`zix9uf`}]]),o=r(`pencil`,[[`path`,{d:`M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z`,key:`1a8usu`}],[`path`,{d:`m15 5 4 4`,key:`1mk7zo`}]]),s=r(`sparkles`,[[`path`,{d:`M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z`,key:`1s2grr`}],[`path`,{d:`M20 2v4`,key:`1rf3ol`}],[`path`,{d:`M22 4h-4`,key:`gwowj6`}],[`circle`,{cx:`4`,cy:`20`,r:`2`,key:`6kqj1y`}]]),c=[`global`,`project`];function l(e){return{project:new Set(e.filter(e=>e.scope===`project`).map(e=>e.name)),global:new Set(e.filter(e=>e.scope===`global`).map(e=>e.name))}}var u=`open-knowledge-pack-`;function d(e){return e.startsWith(u)?e.slice(20):e}function f(){let{_:e}=n();return{project:e({id:`e0NrBM`}),global:e({id:`2GT3Hf`})}}function p(){let{_:e}=n();return{project:e({id:`HyvSqq`}),global:e({id:`C7XjNB`})}}var m=e(t(),1);function h(){let[e]=(0,m.useState)(g);return e}function g(){return i()!=null}function _(e,t,n){let r=n===`\\`?t.replaceAll(`/`,`\\`):t;return`${e.endsWith(n)?e.slice(0,-1):e}${n}${r}`}var v=/\.(md|mdx)$/i;function y(e){return v.test(e)?e:`${e}.md`}export{d as a,p as c,a as d,c as i,s as l,_ as n,l as o,h as r,f as s,y as t,o as u};
|
package/dist/public/index.html
CHANGED
|
@@ -58,7 +58,7 @@
|
|
|
58
58
|
-->
|
|
59
59
|
<script>(() => { let t = 'system'; try { const r = localStorage.getItem('ok-theme-v1'); if (r === 'light' || r === 'dark' || r === 'system') t = r; } catch {} let ct = null; try { const c = localStorage.getItem('ok-color-theme-v1'); if (c && ['dracula', 'catppuccin-frappe', 'catppuccin-latte', 'monokai', 'gruvbox', 'solarized', 'custom'].includes(c)) ct = c; } catch {} let dark = t === 'dark'; if (t === 'system') { try { dark = window.matchMedia('(prefers-color-scheme: dark)').matches; } catch {} } let customCss = null; if (ct === 'custom') { try { const raw = localStorage.getItem('ok-custom-theme-v1'); if (raw) { const o = JSON.parse(raw); if (o?.css) { customCss = o.css; dark = !!o.dark; } } } catch {} if (!customCss) ct = null; } else if (ct) { dark = !['catppuccin-latte'].includes(ct); } if (dark) document.documentElement.classList.add('dark'); if (ct) document.documentElement.setAttribute('data-color-theme', ct); if (customCss) { const s = document.createElement('style'); s.id = 'ok-custom-theme'; s.textContent = customCss; document.head.appendChild(s); } if (window.okDesktop) { document.documentElement.classList.add('electron-mode'); document.documentElement.classList.add(`electron-platform-${window.okDesktop.platform}`); } })();</script>
|
|
60
60
|
<style>html { background-color: #fafafa } html.dark { background-color: #171717 }</style>
|
|
61
|
-
<script type="module" crossorigin src="./assets/index-
|
|
61
|
+
<script type="module" crossorigin src="./assets/index-Lsv_5pDn.js"></script>
|
|
62
62
|
<link rel="modulepreload" crossorigin href="./assets/chunk-DseTPa7n.js">
|
|
63
63
|
<link rel="modulepreload" crossorigin href="./assets/preload-helper-2ej06EnG.js">
|
|
64
64
|
<link rel="modulepreload" crossorigin href="./assets/w3c-keyname-Daddi42S.js">
|
|
@@ -76,15 +76,15 @@
|
|
|
76
76
|
<link rel="modulepreload" crossorigin href="./assets/trace-api-CXljsYUC.js">
|
|
77
77
|
<link rel="modulepreload" crossorigin href="./assets/lib-9ZUh4rh4.js">
|
|
78
78
|
<link rel="modulepreload" crossorigin href="./assets/markdownit-BEubyjFu.js">
|
|
79
|
-
<link rel="modulepreload" crossorigin href="./assets/dist-
|
|
79
|
+
<link rel="modulepreload" crossorigin href="./assets/dist-CDKZLcnD.js">
|
|
80
80
|
<link rel="modulepreload" crossorigin href="./assets/react-JNybMug3.js">
|
|
81
81
|
<link rel="modulepreload" crossorigin href="./assets/dist-COAuqNbv.js">
|
|
82
82
|
<link rel="modulepreload" crossorigin href="./assets/compiler-runtime-dQcBxOhn.js">
|
|
83
83
|
<link rel="modulepreload" crossorigin href="./assets/jsx-runtime-DyiINK0N.js">
|
|
84
|
-
<link rel="modulepreload" crossorigin href="./assets/client-version-
|
|
85
|
-
<link rel="modulepreload" crossorigin href="./assets/use-apply-config-color-theme-
|
|
84
|
+
<link rel="modulepreload" crossorigin href="./assets/client-version-CNNfEvD2.js">
|
|
85
|
+
<link rel="modulepreload" crossorigin href="./assets/use-apply-config-color-theme-Ccfxcl-K.js">
|
|
86
86
|
<link rel="modulepreload" crossorigin href="./assets/config-context-C5AosGyi.js">
|
|
87
|
-
<link rel="modulepreload" crossorigin href="./assets/config-provider-
|
|
87
|
+
<link rel="modulepreload" crossorigin href="./assets/config-provider-BvPGEDTw.js">
|
|
88
88
|
<link rel="modulepreload" crossorigin href="./assets/dist-BD3698ve.js">
|
|
89
89
|
<link rel="modulepreload" crossorigin href="./assets/dist-DBENJeML.js">
|
|
90
90
|
<link rel="modulepreload" crossorigin href="./assets/bundle-mjs-Dy8bHgkj.js">
|
|
@@ -94,12 +94,12 @@
|
|
|
94
94
|
<link rel="modulepreload" crossorigin href="./assets/trash-2-DpF__0y9.js">
|
|
95
95
|
<link rel="modulepreload" crossorigin href="./assets/triangle-alert-DpxK7pzx.js">
|
|
96
96
|
<link rel="modulepreload" crossorigin href="./assets/react-dom-Db7zF7dM.js">
|
|
97
|
-
<link rel="modulepreload" crossorigin href="./assets/doc-hash-
|
|
98
|
-
<link rel="modulepreload" crossorigin href="./assets/navigation-targets-
|
|
97
|
+
<link rel="modulepreload" crossorigin href="./assets/doc-hash-r2oc1gt-.js">
|
|
98
|
+
<link rel="modulepreload" crossorigin href="./assets/navigation-targets-DhXblHdl.js">
|
|
99
99
|
<link rel="modulepreload" crossorigin href="./assets/external-link-BtglP1zb.js">
|
|
100
100
|
<link rel="modulepreload" crossorigin href="./assets/documents-fetch-CyAk_i-3.js">
|
|
101
|
-
<link rel="modulepreload" crossorigin href="./assets/CodeMirrorPropInput-
|
|
102
|
-
<link rel="modulepreload" crossorigin href="./assets/dist-
|
|
101
|
+
<link rel="modulepreload" crossorigin href="./assets/CodeMirrorPropInput-Sjp30pzp.js">
|
|
102
|
+
<link rel="modulepreload" crossorigin href="./assets/dist-DRspkp5n.js">
|
|
103
103
|
<link rel="modulepreload" crossorigin href="./assets/sortable.esm-DcjmFgta.js">
|
|
104
104
|
<link rel="modulepreload" crossorigin href="./assets/dist-Bv-DNDka.js">
|
|
105
105
|
<link rel="modulepreload" crossorigin href="./assets/dist-93kZXTH1.js">
|
|
@@ -118,11 +118,11 @@
|
|
|
118
118
|
<link rel="modulepreload" crossorigin href="./assets/chevron-right-zaL9JagC.js">
|
|
119
119
|
<link rel="modulepreload" crossorigin href="./assets/copy-Dwat-rG5.js">
|
|
120
120
|
<link rel="modulepreload" crossorigin href="./assets/CopyButton-D0gTyMvW.js">
|
|
121
|
-
<link rel="modulepreload" crossorigin href="./assets/documents-events-
|
|
121
|
+
<link rel="modulepreload" crossorigin href="./assets/documents-events-DNDUkpJM.js">
|
|
122
122
|
<link rel="modulepreload" crossorigin href="./assets/parse-api-error-DucXvNZh.js">
|
|
123
123
|
<link rel="modulepreload" crossorigin href="./assets/startup-marks-CytO17UM.js">
|
|
124
|
-
<link rel="modulepreload" crossorigin href="./assets/prop-types-
|
|
125
|
-
<link rel="modulepreload" crossorigin href="./assets/workspace-paths-
|
|
124
|
+
<link rel="modulepreload" crossorigin href="./assets/prop-types-IOhQSrD8.js">
|
|
125
|
+
<link rel="modulepreload" crossorigin href="./assets/workspace-paths-CDfRQ5qH.js">
|
|
126
126
|
<link rel="modulepreload" crossorigin href="./assets/eye-CmnH89UE.js">
|
|
127
127
|
<link rel="modulepreload" crossorigin href="./assets/info-DV3bzhzI.js">
|
|
128
128
|
<link rel="modulepreload" crossorigin href="./assets/loader-circle-K7Xwpjny.js">
|
|
@@ -132,58 +132,58 @@
|
|
|
132
132
|
<link rel="modulepreload" crossorigin href="./assets/file-tree-rename-validation-DMHa94fr.js">
|
|
133
133
|
<link rel="modulepreload" crossorigin href="./assets/badge-BDZGi1Ks.js">
|
|
134
134
|
<link rel="modulepreload" crossorigin href="./assets/input-CsXmpyZP.js">
|
|
135
|
-
<link rel="modulepreload" crossorigin href="./assets/use-collab-url-
|
|
136
|
-
<link rel="modulepreload" crossorigin href="./assets/DocumentContext-
|
|
135
|
+
<link rel="modulepreload" crossorigin href="./assets/use-collab-url-Cf1srbbW.js">
|
|
136
|
+
<link rel="modulepreload" crossorigin href="./assets/DocumentContext-DN3M8p0h.js">
|
|
137
137
|
<link rel="modulepreload" crossorigin href="./assets/checkbox-Cn88M3G6.js">
|
|
138
138
|
<link rel="modulepreload" crossorigin href="./assets/dist-BJxDYUHt.js">
|
|
139
139
|
<link rel="modulepreload" crossorigin href="./assets/dist-Cx2QCt5k.js">
|
|
140
140
|
<link rel="modulepreload" crossorigin href="./assets/dropdown-menu-CcKe8PiU.js">
|
|
141
141
|
<link rel="modulepreload" crossorigin href="./assets/label-bn6BDr7p.js">
|
|
142
142
|
<link rel="modulepreload" crossorigin href="./assets/radio-group-DW_ypmKx.js">
|
|
143
|
-
<link rel="modulepreload" crossorigin href="./assets/EnableSyncConfirmDialog-
|
|
143
|
+
<link rel="modulepreload" crossorigin href="./assets/EnableSyncConfirmDialog-CbuJxerH.js">
|
|
144
144
|
<link rel="modulepreload" crossorigin href="./assets/arrow-up-right-BKliW282.js">
|
|
145
145
|
<link rel="modulepreload" crossorigin href="./assets/cursor-AolWKuZw.js">
|
|
146
146
|
<link rel="modulepreload" crossorigin href="./assets/RegisteredAgentIcon--E1135hW.js">
|
|
147
147
|
<link rel="modulepreload" crossorigin href="./assets/refresh-cw-DSH9Of_0.js">
|
|
148
148
|
<link rel="modulepreload" crossorigin href="./assets/copilot-Be7YOjJF.js">
|
|
149
|
-
<link rel="modulepreload" crossorigin href="./assets/keyboard-shortcuts-
|
|
150
|
-
<link rel="modulepreload" crossorigin href="./assets/agent-visibility-
|
|
149
|
+
<link rel="modulepreload" crossorigin href="./assets/keyboard-shortcuts-maIyJzSw.js">
|
|
150
|
+
<link rel="modulepreload" crossorigin href="./assets/agent-visibility-BUmsS0vL.js">
|
|
151
151
|
<link rel="modulepreload" crossorigin href="./assets/clipboard-adapter-BGIXxhKQ.js">
|
|
152
|
-
<link rel="modulepreload" crossorigin href="./assets/skills-api-
|
|
153
|
-
<link rel="modulepreload" crossorigin href="./assets/use-workspace-
|
|
154
|
-
<link rel="modulepreload" crossorigin href="./assets/skill-actions-
|
|
152
|
+
<link rel="modulepreload" crossorigin href="./assets/skills-api-CGbwE9vp.js">
|
|
153
|
+
<link rel="modulepreload" crossorigin href="./assets/use-workspace-C1D_I03G.js">
|
|
154
|
+
<link rel="modulepreload" crossorigin href="./assets/skill-actions-CzuWC1X5.js">
|
|
155
155
|
<link rel="modulepreload" crossorigin href="./assets/download-wdc_OGNY.js">
|
|
156
|
-
<link rel="modulepreload" crossorigin href="./assets/open-managed-artifact-tab-
|
|
156
|
+
<link rel="modulepreload" crossorigin href="./assets/open-managed-artifact-tab-DokRsPIe.js">
|
|
157
157
|
<link rel="modulepreload" crossorigin href="./assets/skeleton-CA6hvjst.js">
|
|
158
158
|
<link rel="modulepreload" crossorigin href="./assets/textarea-DwJR-19i.js">
|
|
159
|
-
<link rel="modulepreload" crossorigin href="./assets/lint-config-client-
|
|
160
|
-
<link rel="modulepreload" crossorigin href="./assets/auth-state-cache-
|
|
159
|
+
<link rel="modulepreload" crossorigin href="./assets/lint-config-client-C7TVN28Z.js">
|
|
160
|
+
<link rel="modulepreload" crossorigin href="./assets/auth-state-cache-CPrBjd7m.js">
|
|
161
161
|
<link rel="modulepreload" crossorigin href="./assets/toggle-group-CxrQL99E.js">
|
|
162
162
|
<link rel="modulepreload" crossorigin href="./assets/useQuery-NsPxD6kI.js">
|
|
163
163
|
<link rel="modulepreload" crossorigin href="./assets/format-Dn5VT_ew.js">
|
|
164
|
-
<link rel="modulepreload" crossorigin href="./assets/selection-context-
|
|
165
|
-
<link rel="modulepreload" crossorigin href="./assets/PropertyPanel-
|
|
164
|
+
<link rel="modulepreload" crossorigin href="./assets/selection-context-TzGfTWCl.js">
|
|
165
|
+
<link rel="modulepreload" crossorigin href="./assets/PropertyPanel-CinI1G1g.js">
|
|
166
166
|
<link rel="modulepreload" crossorigin href="./assets/miss-dialog-store-81J1GwFD.js">
|
|
167
|
-
<link rel="modulepreload" crossorigin href="./assets/pending-receive-nav-store-
|
|
167
|
+
<link rel="modulepreload" crossorigin href="./assets/pending-receive-nav-store-DYgvjLiq.js">
|
|
168
168
|
<link rel="modulepreload" crossorigin href="./assets/chevron-left-fiDaD9J4.js">
|
|
169
|
-
<link rel="modulepreload" crossorigin href="./assets/terminal-launch-events-
|
|
169
|
+
<link rel="modulepreload" crossorigin href="./assets/terminal-launch-events-C2tfnQr1.js">
|
|
170
170
|
<link rel="modulepreload" crossorigin href="./assets/panel-right-open-CBweAP43.js">
|
|
171
171
|
<link rel="modulepreload" crossorigin href="./assets/follow-file-Db721Zx6.js">
|
|
172
172
|
<link rel="modulepreload" crossorigin href="./assets/timeline-diff-store-dt1fl2gd.js">
|
|
173
173
|
<link rel="modulepreload" crossorigin href="./assets/form-CTttIps7.js">
|
|
174
174
|
<link rel="modulepreload" crossorigin href="./assets/wrench-BDWKT3wQ.js">
|
|
175
175
|
<link rel="modulepreload" crossorigin href="./assets/panel-DLUMbyPl.js">
|
|
176
|
-
<link rel="modulepreload" crossorigin href="./assets/typing-burst-detector-
|
|
176
|
+
<link rel="modulepreload" crossorigin href="./assets/typing-burst-detector-D-Tl1w8f.js">
|
|
177
177
|
<link rel="modulepreload" crossorigin href="./assets/project-paths-DcJ4HDNl.js">
|
|
178
|
-
<link rel="modulepreload" crossorigin href="./assets/file-tree-adapter-
|
|
179
|
-
<link rel="modulepreload" crossorigin href="./assets/agent-diff-store-
|
|
180
|
-
<link rel="modulepreload" crossorigin href="./assets/target-navigation-intent-
|
|
181
|
-
<link rel="modulepreload" crossorigin href="./assets/use-live-xterm-theme-
|
|
178
|
+
<link rel="modulepreload" crossorigin href="./assets/file-tree-adapter-DOr3Nip1.js">
|
|
179
|
+
<link rel="modulepreload" crossorigin href="./assets/agent-diff-store-D5yp573E.js">
|
|
180
|
+
<link rel="modulepreload" crossorigin href="./assets/target-navigation-intent-Beex9QTj.js">
|
|
181
|
+
<link rel="modulepreload" crossorigin href="./assets/use-live-xterm-theme-BpGfJKio.js">
|
|
182
182
|
<link rel="modulepreload" crossorigin href="./assets/use-installed-clis-DmVWBoog.js">
|
|
183
|
-
<link rel="modulepreload" crossorigin href="./assets/terminal-telemetry-
|
|
183
|
+
<link rel="modulepreload" crossorigin href="./assets/terminal-telemetry-zqEIM46I.js">
|
|
184
184
|
<link rel="modulepreload" crossorigin href="./assets/agent-presence-DdJtLtJ1.js">
|
|
185
185
|
<link rel="modulepreload" crossorigin href="./assets/mcp-consent-store-rBVJ88Wy.js">
|
|
186
|
-
<link rel="modulepreload" crossorigin href="./assets/receive-store-
|
|
186
|
+
<link rel="modulepreload" crossorigin href="./assets/receive-store-BwEPjiP1.js">
|
|
187
187
|
<link rel="modulepreload" crossorigin href="./assets/worktree-store-1tC864Do.js">
|
|
188
188
|
<link rel="stylesheet" crossorigin href="./assets/DocumentContext-B0sQn39F.css">
|
|
189
189
|
<link rel="stylesheet" crossorigin href="./assets/index-CJ7E0pG6.css">
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{t as e}from"./launch-json-removal-
|
|
2
|
-
//# sourceMappingURL=repair-launch-json-
|
|
1
|
+
import{t as e}from"./launch-json-removal-DaC6MWYi.mjs";import{join as t}from"node:path";function n(n){let i=n.logger??r,a=t(n.projectDir,`.claude`,`launch.json`);if(n.reclaimDisableEnv===`1`)return i({event:`launch-json-repair-skipped`,reason:`reclaim-disabled`}),{outcome:{configPath:a,outcome:`skipped-reclaim-disabled`},repairedCount:0};let o;try{o=e(n.projectDir)}catch(e){let t=e instanceof Error?e.message:String(e);return i({event:`launch-json-repair-write-failed`,configPath:a}),{outcome:{configPath:a,outcome:`write-failed`,error:t},repairedCount:0}}let s=o.kind===`removed`||o.kind===`removed-file`;return s&&i({event:`launch-json-repair-removed`,configPath:a}),{outcome:{configPath:a,outcome:o.kind},repairedCount:+!!s}}function r(e){process.stderr.write(`${JSON.stringify(e)}\n`)}export{n as repairLaunchJson};
|
|
2
|
+
//# sourceMappingURL=repair-launch-json-BDfwi9-9.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{g as e,l as t,s as n}from"./write-project-skill-
|
|
2
|
-
//# sourceMappingURL=repair-mcp-configs-
|
|
1
|
+
import{g as e,l as t,s as n}from"./write-project-skill-Dt58S1kj.mjs";import{d as r,v as i}from"./init-B_KvF9QQ.mjs";import{t as a}from"./mcp-migrate-event-CWx0WLdE.mjs";import{homedir as o}from"node:os";function s(e){let r=e.logger??u,i=e.home??o(),a=[];if(e.reclaimDisableEnv===`1`)return r({event:`mcp-config-repair-skipped`,reason:`reclaim-disabled`}),{outcomes:a,repairedCount:0};for(let o of n){let n=t[o],s=c(()=>n.configPath(``,i));if(s!==null&&a.push(l({scope:`user`,editorId:o,target:n,home:i,cwd:``,configPath:s,configPathOverride:void 0,logger:r})),n.projectConfigPath){let t=n.projectConfigPath,i=c(()=>t(e.projectDir));i!==null&&a.push(l({scope:`project`,editorId:o,target:n,home:void 0,cwd:e.projectDir,configPath:i,configPathOverride:i,logger:r}))}}return{outcomes:a,repairedCount:a.filter(e=>e.outcome===`repaired`).length}}function c(e){try{return e()}catch{return null}}function l(t){let n={scope:t.scope,editorId:t.editorId,configPath:t.configPath},o=r(t.target,t.cwd,t.home,t.configPathOverride);if(o===null)return{...n,outcome:`no-entry`};if(e(o))return{...n,outcome:`canonical`};t.logger(a({scope:t.scope,surface:`cli-repair`,editorId:t.editorId,configPath:t.configPath,priorEntry:o}));let s=i(t.target,t.cwd,{mode:`published`,skipAvailabilityCheck:!0},t.home,t.configPathOverride);if(s.action===`failed`){let e=s.error??`unknown write failure`;return t.logger({event:`mcp-config-repair-write-failed`,scope:t.scope,editorId:t.editorId,configPath:t.configPath,error:e}),{...n,outcome:`write-failed`,error:e}}return s.action===`declined`?(t.logger({event:`mcp-config-repair-declined`,scope:t.scope,editorId:t.editorId,configPath:t.configPath,reason:s.declineReason}),{...n,outcome:`declined`}):{...n,outcome:`repaired`}}function u(e){process.stderr.write(`${JSON.stringify(e)}\n`)}export{s as repairMcpConfigs};
|
|
2
|
+
//# sourceMappingURL=repair-mcp-configs-kCwuW5Ze.mjs.map
|