@inkeep/open-knowledge 0.85.0-beta.2 → 0.85.0-beta.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (95) hide show
  1. package/dist/cli.mjs +6 -6
  2. package/dist/constants-D5w683OR.mjs +1 -0
  3. package/dist/{dist-CqZISrZN.mjs → dist-BCYVWHsR.mjs} +318 -318
  4. package/dist/{dist-DjEZX3vG.mjs → dist-NhLRGMzw.mjs} +1 -1
  5. package/dist/index.mjs +1 -1
  6. package/dist/init-CzUtIxs8.mjs +1 -0
  7. package/dist/{init-BontxrPQ.mjs → init-iH-arA2G.mjs} +2 -2
  8. package/dist/{launch-json-removal-CDHWF-ku.mjs → launch-json-removal-7EPfW1gR.mjs} +1 -1
  9. package/dist/{loader-DMoA9Hv1.mjs → loader-BPBqgr-2.mjs} +1 -1
  10. package/dist/loader-C15d7cmm.mjs +1 -0
  11. package/dist/{open-browser-CbRl45f4.mjs → open-browser-BA4x7USG.mjs} +1 -1
  12. package/dist/{preview-vc6NgNe_.mjs → preview-C8nGyFNQ.mjs} +1 -1
  13. package/dist/preview-CVz9i5jg.mjs +1 -0
  14. package/dist/public/assets/{AccountSection-adN2rwhj.js → AccountSection-uEZl_mju.js} +1 -1
  15. package/dist/public/assets/{ActivityModeContent-Bdl6OmHI.js → ActivityModeContent-D6bm4kJT.js} +1 -1
  16. package/dist/public/assets/AddPropertiesButton-BbxqMedS.js +2 -0
  17. package/dist/public/assets/{AgentDiffPane-Cecw3Mrv.js → AgentDiffPane-DxqfS7to.js} +1 -1
  18. package/dist/public/assets/{AttachmentsSection-NIZW2veu.js → AttachmentsSection-D4gD9K5F.js} +1 -1
  19. package/dist/public/assets/{CodeMirrorPropInput-Doo-cuhn.js → CodeMirrorPropInput-Buv5WUqJ.js} +1 -1
  20. package/dist/public/assets/{ContentRulesSection-Bxk1NLVc.js → ContentRulesSection-Br-l422Z.js} +1 -1
  21. package/dist/public/assets/{DocumentContext-raAZ6wU_.js → DocumentContext-CorZvYgo.js} +14 -14
  22. package/dist/public/assets/{EditorModeToggle-Codw9OqM.js → EditorModeToggle-CRzHwk_c.js} +1 -1
  23. package/dist/public/assets/{ExcalidrawDocEditor-U8ndHRsw.js → ExcalidrawDocEditor-EQVCkgpX.js} +1 -1
  24. package/dist/public/assets/FeedbackForm-B3LCnaN-.js +1 -0
  25. package/dist/public/assets/{ImportSkillDialog-3MZYBShq.js → ImportSkillDialog-DuG9JEye.js} +1 -1
  26. package/dist/public/assets/{LinkPreviewsSection-BoSX9Y5f.js → LinkPreviewsSection--PnKeBLD.js} +1 -1
  27. package/dist/public/assets/{LintConfigEditor-CS35dOCn.js → LintConfigEditor-jcGxgQwc.js} +1 -1
  28. package/dist/public/assets/{LintingSection-Bw-7lE63.js → LintingSection-Dvgj5Ttf.js} +1 -1
  29. package/dist/public/assets/{ManagedArtifactProperties-DuJcCo7W.js → ManagedArtifactProperties-Bsvat-ju.js} +1 -1
  30. package/dist/public/assets/ManagedArtifactProperties-DQGljSd5.js +1 -0
  31. package/dist/public/assets/{MermaidDocEditor-CdTiKD4M.js → MermaidDocEditor-VR7GsjSm.js} +1 -1
  32. package/dist/public/assets/{NetworkAccessSection-BtuXAqBC.js → NetworkAccessSection-D43WDwx9.js} +1 -1
  33. package/dist/public/assets/{PropertyDisplayRow-iK21Zw0T.js → PropertyDisplayRow-CWrQAKBl.js} +1 -1
  34. package/dist/public/assets/{PublishToGitHubDialog-DGTwvn4-.js → PublishToGitHubDialog-C3wLeehy.js} +1 -1
  35. package/dist/public/assets/ReportBugMenuTrigger-B7ha_vzT.js +1 -0
  36. package/dist/public/assets/{SchemaConfigEditor-GopsnCZi.js → SchemaConfigEditor-CGaJB0xn.js} +1 -1
  37. package/dist/public/assets/{SearchSection-k_3iYUVu.js → SearchSection-a8lszdwH.js} +1 -1
  38. package/dist/public/assets/SessionsHost-BjkYqOzo.js +2 -0
  39. package/dist/public/assets/{SettingsDialogBody-B4Xc27xN.js → SettingsDialogBody-Cg5j6OJH.js} +2 -2
  40. package/dist/public/assets/{ShareReceiveMissDialog-EQZ57mKG.js → ShareReceiveMissDialog-DRGvyccq.js} +1 -1
  41. package/dist/public/assets/{SkillToolbarControls-Cm-CL6Lw.js → SkillToolbarControls-uJO_ykPP.js} +1 -1
  42. package/dist/public/assets/{SourceEditor-DGT7q2vJ.js → SourceEditor-D0RSGDUt.js} +1 -1
  43. package/dist/public/assets/{SyncSection-Ba_tWnaD.js → SyncSection-CRG2LkSG.js} +1 -1
  44. package/dist/public/assets/{SyncStatusBadge-DsP-NJ9v.js → SyncStatusBadge-DoYJzvIT.js} +1 -1
  45. package/dist/public/assets/{TerminalSection-DqzX_FyW.js → TerminalSection-6ExXD5z5.js} +1 -1
  46. package/dist/public/assets/{TerminalWindowApp-D6dgChoj.js → TerminalWindowApp-B2mnEA0Z.js} +1 -1
  47. package/dist/public/assets/{TextDocEditor-hRlsB7CJ.js → TextDocEditor-CzwNYI5Q.js} +1 -1
  48. package/dist/public/assets/{ThreadView-nZLg8IBy.js → ThreadView-CAfBkY-n.js} +1 -1
  49. package/dist/public/assets/{TimelineDiffPane-B6pKH3m8.js → TimelineDiffPane-Oj5zOvzN.js} +1 -1
  50. package/dist/public/assets/client-version-DDIvS8RB.js +1 -0
  51. package/dist/public/assets/{comment-chips-Od0yEqg-.js → comment-chips-DNwQbxLO.js} +1 -1
  52. package/dist/public/assets/{config-provider-D7tAjHlA.js → config-provider-2W1hFFiT.js} +1 -1
  53. package/dist/public/assets/{doc-undo-manager-CpjaremK.js → doc-undo-manager-1o5q5gwi.js} +1 -1
  54. package/dist/public/assets/index-ClMapCCf.js +2205 -0
  55. package/dist/public/assets/{lint-plugins-Cxhn9QhZ.js → lint-plugins-BTxsaGaY.js} +1 -1
  56. package/dist/public/assets/{constants-embedded-host-Cc7UiZn-.js → local-menu-action-bus-Dyh2UJJF.js} +1 -1
  57. package/dist/public/assets/{pending-receive-nav-store-DdinvxKF.js → pending-receive-nav-store-CsnZS_Ro.js} +1 -1
  58. package/dist/public/assets/preferred-session-events-DhdzT8Vr.js +1 -0
  59. package/dist/public/assets/{progress-Bt6heYrW.js → progress-CLlmYVN5.js} +1 -1
  60. package/dist/public/assets/{selection-context--RG_zbL1.js → selection-context-BiUjqAKb.js} +1 -1
  61. package/dist/public/assets/{src-DFrY4htS.js → src-DGY0VXnv.js} +1 -1
  62. package/dist/public/assets/telemetry-impl-C_SzfD38.js +2 -0
  63. package/dist/public/assets/{telemetry-startup-D2JgukUW.js → telemetry-startup-CrBJFhWz.js} +1 -1
  64. package/dist/public/assets/terminal-launch-events-BCKO9apj.js +1 -0
  65. package/dist/public/assets/{typing-burst-detector-NbMMCwJS.js → typing-burst-detector-BvJppmhO.js} +1 -1
  66. package/dist/public/assets/{use-activity-panel-BKll2Lbb.js → use-activity-panel-vwUB_0Q4.js} +1 -1
  67. package/dist/public/assets/{use-open-skill-DhCIdizW.js → use-open-skill-D0ybF2gq.js} +1 -1
  68. package/dist/public/assets/{use-terminal-enabled-BpmUhMxt.js → use-terminal-enabled-BAfmRgEk.js} +1 -1
  69. package/dist/public/assets/{use-timeline-entry-diff-Crd78V2q.js → use-timeline-entry-diff-CFyLJSDJ.js} +1 -1
  70. package/dist/public/index.html +21 -21
  71. package/dist/{registry-probes-Cwx6O6kv.mjs → registry-probes-CM3GVnGY.mjs} +1 -1
  72. package/dist/{removal-file-path-D0LbC71-.mjs → removal-file-path-oz6iBHDK.mjs} +1 -1
  73. package/dist/{repair-launch-json-sysIcyZL.mjs → repair-launch-json-DNSuSUsH.mjs} +1 -1
  74. package/dist/{repair-mcp-configs-mZrdQ93t.mjs → repair-mcp-configs-Bahn7_bp.mjs} +1 -1
  75. package/dist/{src-BKnvpIkn.mjs → src-BqzHUD_W.mjs} +1 -1
  76. package/dist/src-DKF_fAWB.mjs +1 -0
  77. package/dist/start-BueKHDx7.mjs +1 -0
  78. package/dist/{start-lQOFYtsk.mjs → start-CEEWMHcQ.mjs} +3 -3
  79. package/package.json +4 -4
  80. package/dist/constants-CEWqiFCf.mjs +0 -1
  81. package/dist/init-BtiXJkEo.mjs +0 -1
  82. package/dist/loader-CkxCQRBx.mjs +0 -1
  83. package/dist/preview-Cf5VnxW_.mjs +0 -1
  84. package/dist/public/assets/AddPropertiesButton-DK0-byQh.js +0 -2
  85. package/dist/public/assets/FeedbackForm-CUfwmv_p.js +0 -1
  86. package/dist/public/assets/ManagedArtifactProperties-yEbsB8JQ.js +0 -1
  87. package/dist/public/assets/ReportBugMenuTrigger-D6HmlS6i.js +0 -1
  88. package/dist/public/assets/SessionsHost-yRLL-gt6.js +0 -2
  89. package/dist/public/assets/client-version-BJKWodjV.js +0 -1
  90. package/dist/public/assets/index-CfvFSmB5.js +0 -2205
  91. package/dist/public/assets/preferred-session-events-6GbGlu8P.js +0 -1
  92. package/dist/public/assets/telemetry-impl-BXY-sj8p.js +0 -2
  93. package/dist/public/assets/terminal-launch-events-C-sad7ou.js +0 -1
  94. package/dist/src-DWEbxzXJ.mjs +0 -1
  95. package/dist/start-Dh1mqp4M.mjs +0 -1
@@ -0,0 +1,2 @@
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./SkillForkDialog-QqHr4a1o.js","./chunk-CYidjpOJ.js","./dist-Nvb76hAm.js","./jsx-runtime-BUgB2tll.js","./react-f2sANaYj.js","./pierre-theme-CVT0rO1h.js","./preload-helper-Chd9yIcd.js","./engine-compile-CXIMXtDL.js","./lib-TFtgHRaJ.js","./ccount-BoHE53_k.js","./lib-DlDYgFfS.js","./space-separated-tokens-l9yufOSK.js","./lib-7Zm1Z07d.js","./ok-syntax-theme-Blw5Xy2g.js","./MultiFileDiff-BiPNiqPB.js","./label-CvMpFFbN.js","./dist-DTFuvKje.js","./dist-CSCUSbQc.js","./react-dom-DPxgxlDT.js","./compiler-runtime-BfE3aGVn.js","./utils-CPqDy6Hr.js","./bundle-mjs-SHeFpKGC.js","./dist-BGzUo_18.js","./schemas-api-BbYGQuTW.js","./schemas-B93JY9Ef.js","./_envelope-Dwl6i2K9-DPqJ_Q4W.js","./share-D-LUU2aX-DfD-mrg-.js","./util-doc-name-D-_o-n0R.js","./constants-cc1-Bt4QPTUe.js","./constants-github-DOek7bCt.js","./doc-extensions-CcO7K8uD-B004ggqh.js","./logging-renderer-log-Bvxj7ztp.js","./skill-targets-schema-BujW07bM.js","./constants-editors-DLxv8SuP.js","./constants-product-C4Nt9vD3.js","./button-DzgjsZzC.js","./dist-BsJYDohW.js","./dialog-BJEjKJjL.js","./electron-drag-strip-D9GZhMg_.js","./dist-CxbWbOvU.js","./es2015-Dtr4fzLT.js","./x-DM2drskU.js","./createLucideIcon-DdBzwsHe.js","./input-C-Qm8YDT.js","./skill-scope-N3jmnGIX.js","./constants-skills-BLHVRW90.js","./skills-api-DronAhV9.js","./dist-C_FzPxEX2.js","./documents-events-ckNvVQCr.js","./schemas-cc1-DNrPPikD.js","./config-errors-tVoeK4OC.js","./parse-api-error-B5EVRh3T.js"])))=>i.map(i=>d[i]);
2
+ import{o as e}from"./chunk-CYidjpOJ.js";import{t}from"./preload-helper-Chd9yIcd.js";import{t as n}from"./jsx-runtime-BUgB2tll.js";import{Sr as r,at as i,i as a,in as o}from"./DocumentContext-CorZvYgo.js";import{t as s}from"./react-f2sANaYj.js";import{n as c,r as l}from"./dist-Nvb76hAm.js";import{t as u}from"./compiler-runtime-BfE3aGVn.js";import{t as d}from"./utils-CPqDy6Hr.js";import{n as f}from"./AgentIconCluster-Qf_VPGzc.js";import{i as p,n as m,t as h}from"./tooltip-DBqLYfio.js";import{t as g}from"./alert-dialog-BA3e7-10.js";import{t as _}from"./label-CvMpFFbN.js";import{t as v}from"./button-DzgjsZzC.js";import{b as y,i as b,n as x,r as S,t as C,u as w}from"./RegisteredAgentIcon-DjlAkIlP.js";import{n as T}from"./dist-BGzUo_18.js";import{t as E}from"./dist-C_FzPxEX2.js";import{S as D,g as O,h as k,p as A}from"./constants-cc1-Bt4QPTUe.js";import{d as j,h as M,m as N,n as P,p as F,r as I,u as L}from"./documents-events-ckNvVQCr.js";import{O as R}from"./schemas-api-BbYGQuTW.js";import{n as z}from"./constants-editors-DLxv8SuP.js";import{a as B,r as V}from"./local-menu-action-bus-Dyh2UJJF.js";import{_ as H,a as U,b as W,c as G,f as K,g as q,h as J,i as Y,l as X,m as ee,n as te,o as ne,r as re,s as ie,t as ae,u as oe,v as se,y as ce}from"./handoff-ClTYrgLm.js";import{i as le}from"./use-apply-config-theme-CYFG76sS.js";import{t as ue}from"./parse-api-error-B5EVRh3T.js";import{f as de,t as fe}from"./OpenInAgentMenuItem-Bd9Zl2ks.js";import{l as pe,u as me}from"./agent-registry-B4dxoiaL.js";import{c as he,n as ge,r as _e,s as ve}from"./TerminalLaunchContext-CJTkwtCs.js";import{n as ye,t as be}from"./workspace-paths-BjilyZF6.js";import{t as xe}from"./createLucideIcon-DdBzwsHe.js";import{t as Se}from"./arrow-up-right-nJaICi16.js";import{t as Ce}from"./chevron-down-CEv6N8LG.js";import{a as we,c as Te,f as Ee,h as De,i as Oe,l as ke,m as Ae,o as je,p as Me,r as Ne,t as Pe,u as Fe}from"./dropdown-menu-DtLu9NwU.js";import{t as Ie}from"./copy-DpWa6i2v.js";import{t as Le}from"./file-plus-DKxOZh2k.js";import{n as Re,r as ze}from"./ManagedArtifactProperties-Bsvat-ju.js";import{t as Be}from"./folder-open-COGOeTzI.js";import{t as Ve}from"./list-plus-CYMJBvrm.js";import{c as He,d as Ue,f as We,l as Ge,n as Ke,o as qe,r as Je,s as Ye,t as Xe,u as Ze}from"./SkillInstallMenu-BQHSpQsX.js";import{t as Qe}from"./sparkles-BS2TX_Um.js";import{t as $e}from"./trash-2-CchZ0T47.js";import{t as et}from"./badge-DmdA1C7r.js";import{a as tt,c as nt,i as rt,o as it,r as at,s as ot,t as st}from"./dialog-BJEjKJjL.js";import{s as ct}from"./use-settings-route-CikTq5Vq.js";import{n as lt}from"./use-workspace-Dyz_XHeI.js";import{l as ut,u as dt}from"./navigation-targets-DTSxcGor.js";import{a as ft,o as pt,p as mt}from"./skill-scope-N3jmnGIX.js";import{L as ht,N as gt,T as _t,a as vt,b as yt,h as bt,n as xt,r as St,t as Ct,w as wt}from"./skills-api-DronAhV9.js";import{t as Tt}from"./input-C-Qm8YDT.js";import{t as Et}from"./use-skills-D9Qpt2AT.js";import{t as Dt}from"./use-open-skill-D0ybF2gq.js";import{a as Ot,c as kt,i as At,l as jt,o as Mt,s as Nt,u as Pt}from"./context-menu-CKOBjlWm.js";import{n as Ft}from"./agent-launcher-labels-BtrP7a_g.js";import{n as It}from"./terminal-cli-display-BbrhD8t2.js";import{n as Lt}from"./clipboard-adapter-DOdbK8py.js";import{t as Rt}from"./DeleteConfirmationDialog-CCv72H-k.js";import{r as zt}from"./platform-labels-BXA2LpOw.js";var Z=e(s(),1),Q=u();function Bt(e){return{async install(t){let n;try{n=await e.buildAndOpen(t?.force?{force:!0}:void 0)}catch(e){return{ok:!1,reason:`bridge-error`,message:e instanceof Error?e.message:String(e)}}return n.ok?{ok:!0,path:n.path}:{ok:!1,reason:n.reason,message:n.message}}}}function Vt(e={}){let t=e.fetch??globalThis.fetch,n=`${e.apiOrigin??``}/api/install-skill`;return{async install(e){let r;try{r=await t(n,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(e?.force?{force:!0}:{})})}catch(e){return{ok:!1,reason:`network-error`,message:e instanceof Error?e.message:String(e)}}if(!r.ok){let e=`HTTP ${r.status}`;try{let t=ue(await r.json());t&&(e=t)}catch{}return{ok:!1,reason:`http-error`,message:e}}let i;try{i=await r.json()}catch(e){return{ok:!1,reason:`parse-error`,message:e instanceof Error?e.message:E._({id:`1vn0CI`})}}return!i||typeof i.status!=`string`?{ok:!1,reason:`parse-error`,message:E._({id:`NoY1k4`})}:i.status===`failed`?{ok:!1,reason:`build-failed`,message:i.buildError??E._({id:`MrUmCD`})}:{ok:!0,path:i.outputPath,handoffWarning:i.handoffError?.message}}}}function Ht(){if(typeof window>`u`)return null;let e=window.okDesktop?.skill;return e?Bt(e):Vt()}var Ut=`ok:skill:cowork:installed`,Wt=`1`,Gt=250,Kt=`/api/skill/install-state`;function qt(e){return`${Ut}:v${e}`}var Jt=new Map;async function Yt(e={},t={}){let n=t.force?`__force__`:`__default__`,r=Jt.get(n);if(r)return r;let i=Xt(e,t);return Jt.set(n,i),i.finally(()=>{Jt.get(n)===i&&Jt.delete(n)}),i}async function Xt(e,t){let n=e.installer===void 0?Ht():e.installer,r=Zt(e.storage),i=e.fetchSnapshot??$t,a=e.serverTimeoutMs??Gt,o=null;if(!t.force){try{o=await en(i(),a)}catch(e){console.warn(`[cowork-skill] server install-state check failed; falling through:`,e)}if(o){let e=o.targets[`claude-cowork`]??null;if(e&&e.version===o.currentVersion)return{kind:`already-installed`,source:`server`}}}let s=qt(o?.currentVersion??e.fallbackSkillVersion??Qt());if(!t.force&&r?.getItem(s)===Wt)return{kind:`already-installed`,source:`local`};if(!n)return{kind:`host-unsupported`};let c=await n.install({force:t.force??!1});if(!c.ok)return{kind:`install-failed`,reason:c.reason,message:c.message};try{r?.setItem(s,Wt)}catch(e){console.warn(`[cowork-skill] storage.setItem failed (guard will not persist):`,e)}return{kind:`installed-now`,path:c.path,handoffWarning:c.handoffWarning}}function Zt(e){if(e!==void 0)return e;if(typeof window>`u`)return null;try{return window.localStorage}catch{return null}}function Qt(){return typeof window>`u`?`unknown`:window.okDesktop?.appVersion??`unknown`}async function $t(){let e;try{e=await fetch(Kt,{method:`GET`,cache:`no-store`})}catch{return null}if(!e.ok)return null;try{let t=await e.json();return typeof t?.currentVersion==`string`?t:null}catch{return null}}async function en(e,t){return Promise.race([e,new Promise(e=>{setTimeout(()=>e(null),t)})])}function tn(e){return Yt({},e)}function nn(){return Yt({},{force:!0})}async function rn(e,t){let n;try{n=await t(`/api/handoff`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(e)})}catch(e){return{ok:!1,reason:`dispatch-error`,detail:e instanceof Error?e.message:String(e)}}return n.status===200?{ok:!0}:n.status===404?{ok:!1,reason:`not-installed`,detail:`POST /api/handoff returned 404`}:n.status===422?{ok:!1,reason:`not-installed`,detail:`POST /api/handoff returned ${n.status}`}:{ok:!1,reason:`dispatch-error`,detail:`POST /api/handoff returned ${n.status}`}}async function an(e,t={}){let n=t.fetch??globalThis.fetch.bind(globalThis);switch(e.target){case`claude-cowork`:return rn({target:`claude-cowork`,url:Y({mode:`cowork`},e)},n);case`claude-code`:return rn({target:`claude-code`,url:Y({mode:`code`},e)},n);case`codex`:return rn({target:`codex`,url:U(e)},n);case`cursor`:return rn({target:`cursor`,url:ne(e),workspacePath:e.projectDir},n);case`copilot`:return{ok:!1,reason:`invalid-payload`,detail:`copilot is terminal-only; launch via requestTerminalLaunch`};case`opencode`:return{ok:!1,reason:`invalid-payload`,detail:`opencode is terminal-only; launch via requestTerminalLaunch`};case`pi`:return{ok:!1,reason:`invalid-payload`,detail:`pi is terminal-only; launch via requestTerminalLaunch`};case`antigravity`:return{ok:!1,reason:`invalid-payload`,detail:`antigravity is terminal-only; launch via requestTerminalLaunch`};case`openclaw`:return{ok:!1,reason:`invalid-payload`,detail:`openclaw is terminal-only; launch via requestTerminalLaunch`};case`hermes`:return{ok:!1,reason:`invalid-payload`,detail:`hermes is terminal-only; launch via requestTerminalLaunch`};default:{let t=e.target;return{ok:!1,reason:`invalid-payload`,detail:`unknown target: ${String(t)}`}}}}var on=xe(`arrow-left-right`,[[`path`,{d:`M8 3 4 7l4 4`,key:`9rb6wj`}],[`path`,{d:`M4 7h16`,key:`6tx8e3`}],[`path`,{d:`m16 21 4-4-4-4`,key:`siv7j2`}],[`path`,{d:`M20 17H4`,key:`h6l3hr`}]]),sn=xe(`cloud-download`,[[`path`,{d:`M12 13v8l-4-4`,key:`1f5nwf`}],[`path`,{d:`m12 21 4-4`,key:`1lfcce`}],[`path`,{d:`M4.393 15.269A7 7 0 1 1 15.71 8h1.79a4.5 4.5 0 0 1 2.436 8.284`,key:`ui1hmy`}]]),cn=xe(`pencil-line`,[[`path`,{d:`M13 21h8`,key:`1jsn5i`}],[`path`,{d:`m15 5 4 4`,key:`1mk7zo`}],[`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`}]]),ln=`open-knowledge:agent-thread-launch`;function un(e){let{agentSource:t,agentId:n,prompt:r,docName:i,titleHint:a}=e;return{kind:`agent-thread`,agentSource:t,agentId:n,prompt:r,docName:i,titleHint:a}}function dn(e,t){let n=new Set(Object.keys(t));for(let[t,r]of Object.entries(e)){if(n.has(t))continue;let e=Array.isArray(r)?r.length:r==null?0:1;e>0&&console.warn(`[agent-threads] the note-window launch channel carries no ${t} — dropping`,e,`value(s) from the forwarded launch`)}}function fn(e,t=typeof window>`u`?new EventTarget:window){let n=un(e);if(B(n,t)){dn(e,n);return}t.dispatchEvent(new CustomEvent(ln,{detail:e}))}function pn(e,t=typeof window>`u`?new EventTarget:window){let n=t=>{let n=t instanceof CustomEvent?t.detail:void 0;n&&typeof n.agentId==`string`&&e(n)};return t.addEventListener(ln,n),()=>t.removeEventListener(ln,n)}function mn(e){if(!e.docName||!e.workspace)return null;let t=be(e.docName),{contentDir:n,pathSeparator:r}=e.workspace;return{docContext:{relativePath:t},projectDir:n,docPath:ye(n,t,r)}}function hn(e){return e.workspace?.contentDir?{docContext:null,projectDir:e.workspace.contentDir,docPath:``}:null}function gn(e){return e.workspace?.contentDir?{docContext:null,createDescription:e.description,createScenario:e.scenario,createMentions:e.mentions,...e.attachments!==void 0&&e.attachments.length>0?{attachments:e.attachments}:{},projectDir:e.workspace.contentDir,docPath:``}:null}function _n(e){return de(e.installUrl).then(()=>void 0)}function vn(e){return!e.workspace?.contentDir||!e.folderRelativePath?null:{docContext:null,folderRelativePath:e.folderRelativePath,projectDir:e.workspace.contentDir,docPath:``}}function yn(e){return!e.workspace?.contentDir||!e.skillName?null:{docContext:null,skill:{name:e.skillName,scope:e.scope},projectDir:e.workspace.contentDir,docPath:``}}function bn(e){if(!e.workspace?.contentDir)return null;let{contentDir:t,pathSeparator:n}=e.workspace,r=e.attachments!==void 0&&e.attachments.length>0?{attachments:e.attachments}:{};if(e.docName){let i=e.docRelativePath??be(e.docName),a={scope:`doc`,docRelativePath:i,instruction:e.instruction,mentions:e.mentions};return{docContext:null,compose:e.selection===void 0?a:{...a,selection:e.selection},...r,projectDir:t,docPath:ye(t,i,n)}}return e.folderRelativePath?{docContext:null,compose:{scope:`folder`,folderRelativePath:e.folderRelativePath,instruction:e.instruction,mentions:e.mentions},...r,projectDir:t,docPath:``}:{docContext:null,compose:{scope:`project`,instruction:e.instruction,mentions:e.mentions},...r,projectDir:t,docPath:``}}function xn(e){return`Opened in ${e}.`}function Sn(e,t=1){return t>=3?E._({id:`bi2C2s`,values:{displayName:e}}):t===2?E._({id:`1J0c0X`,values:{displayName:e}}):E._({id:`Xs7IcT`,values:{displayName:e}})}function Cn(e){return e>=3?null:e===2?E._({id:`Xp94R1`}):E._({id:`6gRgw8`})}function wn(e,t,n,r,i){let a=i===void 0?{}:{scope:i};return t.ok?{target:e,host:n,outcome:`ok`,ts:r,...a}:{target:e,host:n,outcome:`error`,ts:r,reason:t.reason,...a}}function Tn(e,t,n,r){if(e.scope===`doc`){let i={scope:`doc`,docRelativePath:e.docRelativePath,instruction:e.instruction,mentions:e.mentions,target:t,autoOpen:n,transport:r};return e.selection===void 0?i:{...i,selection:e.selection}}return e.scope===`folder`?{scope:`folder`,folderRelativePath:e.folderRelativePath,instruction:e.instruction,mentions:e.mentions,target:t,autoOpen:n,transport:r}:{scope:`project`,instruction:e.instruction,mentions:e.mentions,target:t,autoOpen:n,transport:r}}function En(e,t,n,r){return e.compose?re(Tn(e.compose,t,n,r)):e.selection?ee({...e.selection,target:t,transport:r}):e.skill?J(e.skill.name,e.skill.scope,n):e.ask?ie(e.ask.relativePath,e.ask.instruction,n,t,r):se(e.docContext===null?e.folderRelativePath?K(e.folderRelativePath,n,e.instruction,r):e.createDescription===void 0?X(n,e.instruction,r):G(e.createDescription,n,e.createScenario??`new-project`,e.createMentions??[],r):oe(e.docContext.relativePath,n,e.instruction,r))}function Dn(e,t){let n=typeof e.instruction==`string`&&e.instruction.trim()!==``;return e.compose!==void 0||e.createDescription!==void 0||e.skill!==void 0||n?`${ae} ${En(e,ce[t].handoffTarget,!1,`terminal`)}`:q(e.docContext?.relativePath??null)}function On(e){let t=typeof e.instruction==`string`&&e.instruction.trim()!==``;return e.compose!==void 0||e.createDescription!==void 0||e.skill!==void 0||t?`${te} ${En(e,`claude-code`,!1,`terminal`)}`:H(e.docContext?.relativePath??null)}function kn(e){let t=e.docContext?.relativePath;return typeof t!=`string`||t===``?null:t.replace(/\.(md|mdx)$/,``)}function An(e){let t=[e.compose?.instruction,e.selection?.instruction,e.ask?.instruction,e.createDescription,e.instruction];for(let e of t)if(typeof e==`string`&&e.trim()!==``)return e;return null}function jn(e,t){fn({agentSource:t?.agent?.source??`registry`,agentId:t?.agent?.id??``,prompt:On(e),docName:kn(e),titleHint:An(e),attachments:e.attachments??null})}async function Mn(e,t,n,r=1,i){if(e===`claude-cowork`&&r===1){let e;try{e=await n.ensureCoworkSkillInstalled()}catch(e){let t=e instanceof Error?e.message:String(e);return n.toast.error(E._({id:`wbpoGe`,values:{message:t}})),{ok:!1,reason:`dispatch-error`,detail:`install-error: ${t}`}}if(e.kind===`installed-now`)return n.toast.success(E._({id:`PezM4_`})),{ok:!0};if(e.kind===`install-failed`){let t=e.message??e.reason;return n.toast.error(E._({id:`wbpoGe`,values:{message:t}})),{ok:!1,reason:`dispatch-error`,detail:`install-failed: ${t}`}}}let a={target:e,projectDir:t.projectDir,docPath:t.docPath,prompt:En(t,e,n.autoOpen,`url`)},o=await n.dispatchHandoff(a),s=n.isElectronHost()?`electron`:`web`,c=n.now().toISOString(),l=t.compose,u=wn(e,o,s,c,t.selection!=null||l?.scope===`doc`&&l.selection!==void 0?`selection`:void 0);await n.recordHandoff(u);let d=n.getDisplayName(e);if(o.ok)n.toast.success(xn(d));else{let a=Cn(r),o=Sn(d,r);a===null?n.toast.error(o):n.toast.error(o,{action:{label:a,onClick:()=>{(i?.(r+1)??Mn(e,t,n,r+1)).then(e=>{!e.ok&&e.reason===`superseded`&&n.toast.error(E._({id:`Ji6oie`}))})}}})}return o}function Nn(e){return pe.find(t=>t.id===e)?.displayName??e}function Pn(e=typeof window<`u`?window:void 0){return e?.okDesktop!=null}function Fn(){return{dispatchHandoff:an,recordHandoff:he,toast:{success:e=>{T.success(e)},error:(e,t)=>{T.error(e,t?{action:t.action}:void 0)}},now:()=>new Date,isElectronHost:()=>Pn(),getDisplayName:Nn,ensureCoworkSkillInstalled:tn,autoOpen:!0}}function In(){let e=(0,Q.c)(3),{merged:t}=le(),n=ve(),r=t?.appearance?.preview?.autoOpen??!0,i;if(e[0]!==r||e[1]!==n){let t=(e,i,a,o)=>n.dispatch(e,()=>Mn(e,i,{...Fn(),autoOpen:r},a,n=>t(e,i,n,o)),{...o,projectDir:i.projectDir});i={dispatch:(e,n,r)=>t(e,n,1,r),reinstallCoworkSkill:nn},e[0]=r,e[1]=n,e[2]=i}else i=e[2];return i}var $=n();function Ln(e){return e?E._({id:`wTcjov`}):null}function Rn(e){let t=(0,Q.c)(49),{_:n}=l(),r=i(),a=ge(),o=y(),s=w();if(r)return null;let{input:u,installStates:d,dispatch:f,onBeforeLaunch:p,restoreFocus:m}=e,h=u===null,g,_,v,T,E,D,O,k,A,j,M;if(t[0]!==n||t[1]!==f||t[2]!==u||t[3]!==h||t[4]!==d||t[5]!==p||t[6]!==s||t[7]!==o||t[8]!==m||t[9]!==a){let e=Ln(h),r;t[21]!==d||t[22]!==s?(r=e=>x(s,e.id,d[e.id]?.installed),t[21]=d,t[22]=s,t[23]=r):r=t[23];let i=me.filter(r),l;t[24]===s?l=t[25]:(l=e=>S(s,e.source,e.id,!0,e.supported),t[24]=s,t[25]=l);let y=o.filter(l),w=a?W.filter(e=>b(s,e,a.installedClis)):[];v=i.length>0,T=a!==null&&w.length>0,E=y.length>0,_=Ee,t[26]===Symbol.for(`react.memo_cache_sentinel`)?(M=(0,$.jsxs)(Ae,{children:[(0,$.jsx)(Qe,{"aria-hidden":`true`}),(0,$.jsx)(c,{id:`O7_W_a`})]}),t[26]=M):M=t[26],g=Me,D=`max-h-80`,O=E?(0,$.jsxs)(Oe,{"aria-label":n({id:`RXEbZy`}),children:[(0,$.jsx)(je,{children:(0,$.jsx)(c,{id:`RXEbZy`})}),y.map(t=>{let r=t.name;return(0,$.jsxs)(we,{onSelect:()=>{u!==null&&(p?.(),jn(u,{agent:{source:t.source,id:t.id}}))},disabled:h,"data-testid":`file-tree-open-in-thread-${t.id}`,"aria-label":n(e?{id:`7Ag-Xu`,values:{agentName:r,hint:e}}:{id:`g4e0hS`,values:{agentName:r}}),children:[(0,$.jsx)(C,{agentId:t.id,iconUrl:t.iconUrl,className:`size-4`}),(0,$.jsx)(`span`,{className:`flex-1`,children:r}),e?(0,$.jsx)(`span`,{"aria-hidden":`true`,className:`ml-2 text-muted-foreground text-xs`,children:e}):null]},`${t.source}:${t.id}`)})]}):null,t[27]!==v||t[28]!==T||t[29]!==E?(k=E&&(T||v)?(0,$.jsx)(Fe,{}):null,t[27]=v,t[28]=T,t[29]=E,t[30]=k):k=t[30],A=T?(0,$.jsxs)(Oe,{"aria-label":n({id:`ALhMYW`}),children:[(0,$.jsx)(je,{children:(0,$.jsx)(c,{id:`ALhMYW`})}),w.map(t=>{let{displayName:r}=ce[t];return(0,$.jsxs)(we,{onSelect:()=>{u!==null&&(p?.(),a.launchInTerminal(u,t))},disabled:h,"data-testid":`file-tree-open-in-terminal-${t}`,"aria-label":n(e?{id:`AIn2Yv`,values:{displayName:r,hint:e}}:{id:`QYfQdv`,values:{displayName:r}}),children:[(0,$.jsx)(fe,{id:It(t),"aria-hidden":`true`}),(0,$.jsx)(`span`,{className:`flex-1`,children:r}),e?(0,$.jsx)(`span`,{"aria-hidden":`true`,className:`ml-2 text-muted-foreground text-xs`,children:e}):null]},t)})]}):null,j=v?(0,$.jsxs)($.Fragment,{children:[T?(0,$.jsx)(Fe,{}):null,(0,$.jsxs)(Oe,{"aria-label":n({id:`BwKH4d`}),children:[(0,$.jsxs)(je,{className:`flex items-center gap-1.5`,children:[(0,$.jsx)(c,{id:`BwKH4d`}),(0,$.jsx)(Se,{"aria-hidden":`true`,className:`size-3`})]}),i.map(t=>{let r=!h,{displayName:i}=t,a=n(e?{id:`rl35Vz`,values:{displayName:i,hint:e}}:{id:`wHZ58m`,values:{displayName:i}});return(0,$.jsxs)(we,{disabled:!r,onSelect:()=>{if(u){if(p?.(),d[t.id]?.installed!==!0){_n(t);return}f(t.id,u,{installState:d[t.id],restoreFocus:m})}},"data-testid":`file-tree-open-in-${t.id}`,"aria-label":a,children:[(0,$.jsx)(fe,{id:t.id,"aria-hidden":`true`}),(0,$.jsx)(`span`,{className:`flex-1`,children:(0,$.jsx)(Ft,{displayName:i})}),e?(0,$.jsx)(`span`,{"aria-hidden":`true`,className:`ml-2 text-muted-foreground text-xs`,children:e}):null]},t.id)})]})]}):null,t[0]=n,t[1]=f,t[2]=u,t[3]=h,t[4]=d,t[5]=p,t[6]=s,t[7]=o,t[8]=m,t[9]=a,t[10]=g,t[11]=_,t[12]=v,t[13]=T,t[14]=E,t[15]=D,t[16]=O,t[17]=k,t[18]=A,t[19]=j,t[20]=M}else g=t[10],_=t[11],v=t[12],T=t[13],E=t[14],D=t[15],O=t[16],k=t[17],A=t[18],j=t[19],M=t[20];let N;t[31]!==v||t[32]!==T||t[33]!==E?(N=E||T||v?(0,$.jsx)(Fe,{}):null,t[31]=v,t[32]=T,t[33]=E,t[34]=N):N=t[34];let P;t[35]===Symbol.for(`react.memo_cache_sentinel`)?(P=(0,$.jsx)(V,{"aria-hidden":`true`}),t[35]=P):P=t[35];let F;t[36]===Symbol.for(`react.memo_cache_sentinel`)?(F=(0,$.jsxs)(we,{onSelect:ct,"data-testid":`file-tree-open-in-settings`,children:[P,(0,$.jsx)(`span`,{className:`flex-1`,children:(0,$.jsx)(c,{id:`jRAGrQ`})})]}),t[36]=F):F=t[36];let I;t[37]!==g||t[38]!==D||t[39]!==O||t[40]!==k||t[41]!==A||t[42]!==j||t[43]!==N?(I=(0,$.jsxs)(g,{className:D,children:[O,k,A,j,N,F]}),t[37]=g,t[38]=D,t[39]=O,t[40]=k,t[41]=A,t[42]=j,t[43]=N,t[44]=I):I=t[44];let L;return t[45]!==_||t[46]!==M||t[47]!==I?(L=(0,$.jsxs)(_,{children:[M,I]}),t[45]=_,t[46]=M,t[47]=I,t[48]=L):L=t[48],L}function zn(e){return e?E._({id:`wTcjov`}):null}function Bn(e){let t=(0,Q.c)(47),{_:n}=l(),r=i(),a=ge(),o=y(),s=w();if(r)return null;let{input:u,installStates:d,dispatch:f}=e,p=u===null,m,h,g,_,v,T,E,D,O,k,A;if(t[0]!==n||t[1]!==f||t[2]!==u||t[3]!==p||t[4]!==d||t[5]!==s||t[6]!==o||t[7]!==a){let e=zn(p),r;t[19]!==d||t[20]!==s?(r=e=>x(s,e.id,d[e.id]?.installed),t[19]=d,t[20]=s,t[21]=r):r=t[21];let i=me.filter(r),l;t[22]===s?l=t[23]:(l=e=>S(s,e.source,e.id,!0,e.supported),t[22]=s,t[23]=l);let y=o.filter(l),w=a?W.filter(e=>b(s,e,a.installedClis)):[];g=i.length>0,_=a!==null&&w.length>0,v=y.length>0,h=kt,t[24]===Symbol.for(`react.memo_cache_sentinel`)?(A=(0,$.jsxs)(Pt,{children:[(0,$.jsx)(Qe,{"aria-hidden":`true`}),(0,$.jsx)(c,{id:`O7_W_a`})]}),t[24]=A):A=t[24],m=jt,T=`max-h-80`,E=v?(0,$.jsxs)(At,{"aria-label":n({id:`RXEbZy`}),children:[(0,$.jsx)(Mt,{children:(0,$.jsx)(c,{id:`RXEbZy`})}),y.map(t=>{let r=t.name;return(0,$.jsxs)(Ot,{onSelect:()=>{u!==null&&jn(u,{agent:{source:t.source,id:t.id}})},disabled:p,"data-testid":`empty-space-open-in-thread-${t.id}`,"aria-label":n(e?{id:`7Ag-Xu`,values:{agentName:r,hint:e}}:{id:`g4e0hS`,values:{agentName:r}}),children:[(0,$.jsx)(C,{agentId:t.id,iconUrl:t.iconUrl,className:`size-4`}),(0,$.jsx)(`span`,{className:`flex-1`,children:r}),e?(0,$.jsx)(`span`,{"aria-hidden":`true`,className:`ml-2 text-muted-foreground text-xs`,children:e}):null]},`${t.source}:${t.id}`)})]}):null,t[25]!==g||t[26]!==_||t[27]!==v?(D=v&&(_||g)?(0,$.jsx)(Nt,{}):null,t[25]=g,t[26]=_,t[27]=v,t[28]=D):D=t[28],O=_?(0,$.jsxs)(At,{"aria-label":n({id:`ALhMYW`}),children:[(0,$.jsx)(Mt,{children:(0,$.jsx)(c,{id:`ALhMYW`})}),w.map(t=>{let{displayName:r}=ce[t];return(0,$.jsxs)(Ot,{onSelect:()=>{u!==null&&a.launchInTerminal(u,t)},disabled:p,"data-testid":`empty-space-open-in-terminal-${t}`,"aria-label":n(e?{id:`AIn2Yv`,values:{displayName:r,hint:e}}:{id:`QYfQdv`,values:{displayName:r}}),children:[(0,$.jsx)(fe,{id:It(t),"aria-hidden":`true`}),(0,$.jsx)(`span`,{className:`flex-1`,children:r}),e?(0,$.jsx)(`span`,{"aria-hidden":`true`,className:`ml-2 text-muted-foreground text-xs`,children:e}):null]},t)})]}):null,k=g?(0,$.jsxs)($.Fragment,{children:[_?(0,$.jsx)(Nt,{}):null,(0,$.jsxs)(At,{"aria-label":n({id:`BwKH4d`}),children:[(0,$.jsxs)(Mt,{className:`flex items-center gap-1.5`,children:[(0,$.jsx)(c,{id:`BwKH4d`}),(0,$.jsx)(Se,{"aria-hidden":`true`,className:`size-3`})]}),i.map(t=>{let r=!p,{displayName:i}=t,a=n(e?{id:`rl35Vz`,values:{displayName:i,hint:e}}:{id:`wHZ58m`,values:{displayName:i}});return(0,$.jsxs)(Ot,{disabled:!r,onSelect:()=>{if(u){if(d[t.id]?.installed!==!0){_n(t);return}f(t.id,u,{installState:d[t.id]})}},"data-testid":`empty-space-open-in-${t.id}`,"aria-label":a,children:[(0,$.jsx)(fe,{id:t.id,"aria-hidden":`true`}),(0,$.jsx)(`span`,{className:`flex-1`,children:(0,$.jsx)(Ft,{displayName:i})}),e?(0,$.jsx)(`span`,{"aria-hidden":`true`,className:`ml-2 text-muted-foreground text-xs`,children:e}):null]},t.id)})]})]}):null,t[0]=n,t[1]=f,t[2]=u,t[3]=p,t[4]=d,t[5]=s,t[6]=o,t[7]=a,t[8]=m,t[9]=h,t[10]=g,t[11]=_,t[12]=v,t[13]=T,t[14]=E,t[15]=D,t[16]=O,t[17]=k,t[18]=A}else m=t[8],h=t[9],g=t[10],_=t[11],v=t[12],T=t[13],E=t[14],D=t[15],O=t[16],k=t[17],A=t[18];let j;t[29]!==g||t[30]!==_||t[31]!==v?(j=v||_||g?(0,$.jsx)(Nt,{}):null,t[29]=g,t[30]=_,t[31]=v,t[32]=j):j=t[32];let M;t[33]===Symbol.for(`react.memo_cache_sentinel`)?(M=(0,$.jsx)(V,{"aria-hidden":`true`}),t[33]=M):M=t[33];let N;t[34]===Symbol.for(`react.memo_cache_sentinel`)?(N=(0,$.jsxs)(Ot,{onSelect:ct,"data-testid":`empty-space-open-in-settings`,children:[M,(0,$.jsx)(`span`,{className:`flex-1`,children:(0,$.jsx)(c,{id:`jRAGrQ`})})]}),t[34]=N):N=t[34];let P;t[35]!==m||t[36]!==T||t[37]!==E||t[38]!==D||t[39]!==O||t[40]!==k||t[41]!==j?(P=(0,$.jsxs)(m,{className:T,children:[E,D,O,k,j,N]}),t[35]=m,t[36]=T,t[37]=E,t[38]=D,t[39]=O,t[40]=k,t[41]=j,t[42]=P):P=t[42];let F;return t[43]!==h||t[44]!==A||t[45]!==P?(F=(0,$.jsxs)(h,{children:[A,P]}),t[43]=h,t[44]=A,t[45]=P,t[46]=F):F=t[46],F}var Vn=/^\.[A-Za-z0-9_-]+\/skills\/([^/]+)\/(.+)$/;function Hn(e){let t=O(e);if(t)return{scope:`project`,name:t.name,rel:t.rel};let n=A(e);if(n)return{scope:`global`,name:n.name,rel:n.rel};let r=k(e);if(r?.kind===`skill`)return{scope:r.scope,name:r.name,rel:r.rel};let i=Vn.exec(e);return i?{scope:`project`,name:i[1],rel:i[2]}:null}function Un(e,t,n){return e.filter(e=>{let r=o(e);if(r.kind===`skill-file`)return r.scope===t&&r.name===n;if(r.kind!==`doc`)return!1;let i=Hn(r.docName);return i?.scope===t&&i.name===n})}function Wn(e,t,n){let r=ut(t,n);return e.filter(e=>{let i=o(e);return i.kind===`skill-file`?i.scope===t.scope&&i.name===t.name&&i.path===n:i.kind===`doc`&&i.docName===r})}function Gn(e,t,n){let r=Hn(e);if(!r||r.rel===null)return null;let i=t.find(e=>e.scope===r.scope&&e.name===r.name);if(!i||i.managed)return null;let a=`references/${r.rel}${n}`;return ut(i,a)===e?{skill:i,filePath:a}:null}function Kn(e,t,n=(e,t)=>F(e,t)||N(e,t)){let r=new Map(t.map(e=>[`${e.scope}\u0000${e.name}`,e])),i=[],a=new Set;for(let t of e){let e=Hn(t);e!==null&&e.rel===null&&a.add(`${e.scope}\u0000${e.name}`)}for(let t of e){let e=Hn(t);if(!e||r.has(`${e.scope}\u0000${e.name}`))continue;let o=e.scope===`project`?`global`:`project`,s=r.get(`${o}\u0000${e.name}`);e.rel===null&&s!==void 0?i.push({kind:`retarget`,fromDocName:t,toDocName:dt(s)}):n(e.scope,e.name)||(s!==void 0&&!a.has(`${e.scope}\u0000${e.name}`)?(a.add(`${e.scope}\u0000${e.name}`),i.push({kind:`retarget`,fromDocName:t,toDocName:dt(s)})):i.push({kind:`close`,docName:t}))}return i}function qn(){let e=(0,Q.c)(15),{openTabs:t,closeDocument:n}=a(),r=Re(),i;e[0]===t?i=e[1]:(i=t.some(Yn),e[0]=t,e[1]=i);let o=i,s;e[2]===o?s=e[3]:(s={enabled:o},e[2]=o,e[3]=s);let c=Et(s),l=(0,Z.useRef)(null),u;e[4]!==n||e[5]!==t||e[6]!==r||e[7]!==c.data||e[8]!==c.status?(u=()=>{if(c.status!==`ready`)return;let e=c.data,i=`${t.join(``)}\u0002${e.map(Jn).sort().join(``)}\u0002${M()}`;if(l.current===i)return;l.current=i;let a=Kn(t,e);for(let e of a)e.kind===`retarget`?r(e.fromDocName,e.toDocName):n(e.docName)},e[4]=n,e[5]=t,e[6]=r,e[7]=c.data,e[8]=c.status,e[9]=u):u=e[9];let d;e[10]!==n||e[11]!==t||e[12]!==r||e[13]!==c?(d=[c,t,r,n],e[10]=n,e[11]=t,e[12]=r,e[13]=c,e[14]=d):d=e[14],(0,Z.useEffect)(u,d)}function Jn(e){return`${e.scope}\u0000${e.name}`}function Yn(e){return Hn(e)!==null}function Xn(e){let t=(0,Q.c)(18),{skill:n,onOpenChange:r,onDeleted:i}=e,{_:o}=l(),{closeTabs:s,openTabs:c}=a(),[u,d]=(0,Z.useState)(!1),f;t[0]!==o||t[1]!==s||t[2]!==i||t[3]!==r||t[4]!==c?(f=async function(e){d(!0);let t=await xt(e.scope,e.name,e.hostQualifier);if(d(!1),!t.ok){let{error:e}=t;T.error(o({id:`AtBdnD`,values:{error:e}}));return}let n=o({id:`h9QFb9`,values:{0:e.name}});t.warnings.length>0?T.warning(n,{description:t.warnings.join(` `),duration:3e4}):T.success(n),s(Un(c,e.scope,e.name),{force:!0}),i(),r(!1)},t[0]=o,t[1]=s,t[2]=i,t[3]=r,t[4]=c,t[5]=f):f=t[5];let p=f,m=n!==null,h;t[6]!==u||t[7]!==r?(h=e=>{!e&&!u&&r(!1)},t[6]=u,t[7]=r,t[8]=h):h=t[8];let _;t[9]!==o||t[10]!==u||t[11]!==p||t[12]!==n?(_=n?(0,$.jsx)(Rt,{itemName:o({id:`ExUzM4`,values:{0:n.name}}),isSubmitting:u,onDelete:()=>p(n),customDescription:n.origin?.source&&/\/plugins\/(?:cache|marketplaces)\//.test(n.origin.source)?o({id:`WnsbUT`,values:{0:n.path}}):o({id:`E1Da_b`,values:{0:n.path}})}):null,t[9]=o,t[10]=u,t[11]=p,t[12]=n,t[13]=_):_=t[13];let v;return t[14]!==m||t[15]!==h||t[16]!==_?(v=(0,$.jsx)(g,{open:m,onOpenChange:h,children:_}),t[14]=m,t[15]=h,t[16]=_,t[17]=v):v=t[17],v}function Zn(e){let t=e.split(`/`);return t.some(e=>e===``||e===`.`||e===`..`)||t.length===0||t.length===1&&t[0].toLowerCase()===`skill.md`?!1:!/\s/.test(e)}function Qn(e){if(/\s/.test(e))return E._({id:`_fQGOp`});let t=e.split(`/`);return t.some(e=>e===`.`||e===`..`)?E._({id:`Zt7Ktx`}):t.some(e=>e===``)?E._({id:`ipCibE`}):t.length===1&&e.toLowerCase()===`skill.md`?E._({id:`yJkw6t`}):Zn(e)?null:E._({id:`oP-FQW`})}function $n(e){let t=(0,Q.c)(70),{target:n,onOpenChange:r}=e,{_:i}=l(),{openTarget:o}=a(),s=(0,Z.useId)(),[u,d]=(0,Z.useState)(``),[f,p]=(0,Z.useState)(!1),m;t[0]===n?m=t[1]:(m=()=>{n&&d(n.prefix??`references/`)},t[0]=n,t[1]=m);let h=n?.skill.scope,g=n?.skill.name,y=n?.prefix,b;if(t[2]!==h||t[3]!==g||t[4]!==y?(b=[h,g,y],t[2]=h,t[3]=g,t[4]=y,t[5]=b):b=t[5],(0,Z.useEffect)(m,b),!n)return null;let x,S,C,w,E,D;if(t[6]!==u||t[7]!==f){D=u.trim(),C=D===``||D.endsWith(`/`),w=C?null:Qn(D),x=!(C||w!==null)&&!f,S=D.includes(`/`)?D.split(`/`).slice(0,-1).join(`/`):null;let e=D.split(`/`).pop()??``;E=e!==``&&!e.includes(`.`)?`${D}.md`:D,t[6]=u,t[7]=f,t[8]=x,t[9]=S,t[10]=C,t[11]=w,t[12]=E,t[13]=D}else x=t[8],S=t[9],C=t[10],w=t[11],E=t[12],D=t[13];let O=E,k;t[14]!==i||t[15]!==x||t[16]!==O||t[17]!==r||t[18]!==o||t[19]!==n?(k=async function(){if(!n||!x)return;p(!0);let e=/\.mdx?$/i.test(O),t=await ht({scope:n.skill.scope,name:n.skill.name,path:O,content:e?`# ${O.split(`/`).pop()?.replace(/\.mdx?$/i,``)??``}\n`:``});if(p(!1),!t.ok){T.error(i({id:`DvGkXq`,values:{0:t.error,effective:O}}));return}if(T.success(i({id:`MXSt4t`,values:{0:t.path}})),e){let e=ut(n.skill,O);o({kind:`doc`,target:e,docName:e})}r(!1)},t[14]=i,t[15]=x,t[16]=O,t[17]=r,t[18]=o,t[19]=n,t[20]=k):k=t[20];let A=k,j;t[21]!==r||t[22]!==f?(j=e=>{!e&&!f&&r(!1)},t[21]=r,t[22]=f,t[23]=j):j=t[23];let M;t[24]===Symbol.for(`react.memo_cache_sentinel`)?(M=(0,$.jsx)(nt,{children:(0,$.jsx)(c,{id:`wQvvZY`})}),t[24]=M):M=t[24];let N;t[25]===Symbol.for(`react.memo_cache_sentinel`)?(N=(0,$.jsxs)(ot,{children:[M,(0,$.jsx)(tt,{children:(0,$.jsx)(c,{id:`lM4c-I`})})]}),t[25]=N):N=t[25];let P;t[26]===Symbol.for(`react.memo_cache_sentinel`)?(P=(0,$.jsx)(c,{id:`I6gXOa`}),t[26]=P):P=t[26];let F;t[27]===s?F=t[28]:(F=(0,$.jsx)(_,{htmlFor:s,children:P}),t[27]=s,t[28]=F);let I;t[29]===Symbol.for(`react.memo_cache_sentinel`)?(I=e=>d(e.target.value),t[29]=I):I=t[29];let L=w!==null,R;t[30]===A?R=t[31]:(R=e=>{e.key===`Enter`&&A()},t[30]=A,t[31]=R);let z;t[32]!==s||t[33]!==u||t[34]!==L||t[35]!==R?(z=(0,$.jsx)(Tt,{id:s,value:u,onChange:I,placeholder:`references/notes.md`,"aria-invalid":L,onKeyDown:R}),t[32]=s,t[33]=u,t[34]=L,t[35]=R,t[36]=z):z=t[36];let B;t[37]!==O||t[38]!==S||t[39]!==C||t[40]!==w||t[41]!==D?(B=w===null?C&&D!==``?(0,$.jsx)(`p`,{className:`text-muted-foreground text-xs`,children:(0,$.jsx)(c,{id:`Vy6XCg`})}):O===D?S?(0,$.jsx)(`p`,{className:`text-muted-foreground text-xs`,children:(0,$.jsx)(c,{id:`9lso1Y`,values:{folderPart:S},components:{0:(0,$.jsx)(`span`,{className:`font-mono text-foreground/80`})}})}):null:(0,$.jsx)(`p`,{className:`text-muted-foreground text-xs`,children:(0,$.jsx)(c,{id:`zC5jrM`,values:{effective:O},components:{0:(0,$.jsx)(`span`,{className:`font-mono text-foreground/80`})}})}):(0,$.jsx)(`p`,{className:`text-destructive text-xs`,children:w}),t[37]=O,t[38]=S,t[39]=C,t[40]=w,t[41]=D,t[42]=B):B=t[42];let V;t[43]!==F||t[44]!==z||t[45]!==B?(V=(0,$.jsxs)(`div`,{className:`space-y-1.5`,children:[F,z,B]}),t[43]=F,t[44]=z,t[45]=B,t[46]=V):V=t[46];let H;t[47]===r?H=t[48]:(H=()=>r(!1),t[47]=r,t[48]=H);let U;t[49]===Symbol.for(`react.memo_cache_sentinel`)?(U=(0,$.jsx)(c,{id:`dEgA5A`}),t[49]=U):U=t[49];let W;t[50]!==f||t[51]!==H?(W=(0,$.jsx)(v,{variant:`outline`,onClick:H,disabled:f,children:U}),t[50]=f,t[51]=H,t[52]=W):W=t[52];let G;t[53]===A?G=t[54]:(G=()=>void A(),t[53]=A,t[54]=G);let K=!x,q;t[55]===f?q=t[56]:(q=f?(0,$.jsx)(c,{id:`E9bKSA`}):(0,$.jsx)(c,{id:`hYgDIe`}),t[55]=f,t[56]=q);let J;t[57]!==G||t[58]!==K||t[59]!==q?(J=(0,$.jsx)(v,{onClick:G,disabled:K,children:q}),t[57]=G,t[58]=K,t[59]=q,t[60]=J):J=t[60];let Y;t[61]!==W||t[62]!==J?(Y=(0,$.jsxs)(it,{children:[W,J]}),t[61]=W,t[62]=J,t[63]=Y):Y=t[63];let X;t[64]!==V||t[65]!==Y?(X=(0,$.jsxs)(rt,{className:`sm:max-w-md`,children:[N,V,Y]}),t[64]=V,t[65]=Y,t[66]=X):X=t[66];let ee;return t[67]!==X||t[68]!==j?(ee=(0,$.jsx)(st,{open:!0,onOpenChange:j,children:X}),t[67]=X,t[68]=j,t[69]=ee):ee=t[69],ee}function er(e){let t=(0,Q.c)(17),{target:n,onOpenChange:r}=e,{_:i}=l(),{closeTabs:o,openTabs:s}=a(),[c,u]=(0,Z.useState)(!1),d;t[0]!==i||t[1]!==o||t[2]!==r||t[3]!==s?(d=async function(e){let{skill:t,filePath:n}=e;u(!0);let a=await St({scope:t.scope,name:t.name,path:n});if(u(!1),!a.ok){T.error(i({id:`CBT70t`,values:{0:a.error}}));return}if(!a.existed){T.error(i({id:`q4efaG`,values:{filePath:n}})),r(!1);return}T.success(i({id:`gOmloS`,values:{filePath:n}})),o(Wn(s,t,n),{force:!0}),r(!1)},t[0]=i,t[1]=o,t[2]=r,t[3]=s,t[4]=d):d=t[4];let f=d,p=n!==null,m;t[5]!==c||t[6]!==r?(m=e=>{!e&&!c&&r(!1)},t[5]=c,t[6]=r,t[7]=m):m=t[7];let h;t[8]!==i||t[9]!==c||t[10]!==f||t[11]!==n?(h=n?(0,$.jsx)(Rt,{itemName:i({id:`wZPUJx`,values:{0:n.filePath}}),isSubmitting:c,onDelete:()=>f(n),customDescription:i({id:`ppzof_`,values:{0:pt(n.skill.path),1:n.filePath,2:n.skill.name}})}):null,t[8]=i,t[9]=c,t[10]=f,t[11]=n,t[12]=h):h=t[12];let _;return t[13]!==p||t[14]!==m||t[15]!==h?(_=(0,$.jsx)(g,{open:p,onOpenChange:m,children:h}),t[13]=p,t[14]=m,t[15]=h,t[16]=_):_=t[16],_}function tr(e){let t=(0,Q.c)(64),{target:n,onOpenChange:r}=e,{_:i}=l(),a=Re(),o=(0,Z.useId)(),[s,u]=(0,Z.useState)(``),[d,f]=(0,Z.useState)(!1),p;t[0]===n?p=t[1]:(p=()=>{n&&u(n.filePath)},t[0]=n,t[1]=p);let m=n?.skill.scope,h=n?.skill.name,g=n?.filePath,y;if(t[2]!==m||t[3]!==h||t[4]!==g?(y=[m,h,g],t[2]=m,t[3]=h,t[4]=g,t[5]=y):y=t[5],(0,Z.useEffect)(p,y),!n)return null;let b,x,S;t[6]!==s||t[7]!==n.filePath?(x=s.trim(),S=x===n.filePath,b=x===``||!Zn(x),t[6]=s,t[7]=n.filePath,t[8]=b,t[9]=x,t[10]=S):(b=t[8],x=t[9],S=t[10]);let C=b,w=!C&&!S&&!d,E;t[11]!==i||t[12]!==w||t[13]!==r||t[14]!==a||t[15]!==n||t[16]!==x?(E=async function(){if(!n||!w)return;f(!0);let e=await _t({scope:n.skill.scope,name:n.skill.name,from:n.filePath,to:x});if(f(!1),!e.ok){T.error(i({id:`11ukmX`,values:{0:e.error}}));return}e.fromDocName!==void 0&&e.toDocName!==void 0&&a(e.fromDocName,e.toDocName),T.success(i({id:`XszXjc`,values:{0:e.to}})),r(!1)},t[11]=i,t[12]=w,t[13]=r,t[14]=a,t[15]=n,t[16]=x,t[17]=E):E=t[17];let D=E,O;t[18]!==r||t[19]!==d?(O=e=>{!e&&!d&&r(!1)},t[18]=r,t[19]=d,t[20]=O):O=t[20];let k;t[21]===Symbol.for(`react.memo_cache_sentinel`)?(k=(0,$.jsx)(nt,{children:(0,$.jsx)(c,{id:`yckias`})}),t[21]=k):k=t[21];let A;t[22]===Symbol.for(`react.memo_cache_sentinel`)?(A=(0,$.jsxs)(ot,{children:[k,(0,$.jsx)(tt,{children:(0,$.jsx)(c,{id:`HzVAoz`})})]}),t[22]=A):A=t[22];let j;t[23]===Symbol.for(`react.memo_cache_sentinel`)?(j=(0,$.jsx)(c,{id:`I6gXOa`}),t[23]=j):j=t[23];let M;t[24]===o?M=t[25]:(M=(0,$.jsx)(_,{htmlFor:o,children:j}),t[24]=o,t[25]=M);let N;t[26]===Symbol.for(`react.memo_cache_sentinel`)?(N=e=>u(e.target.value),t[26]=N):N=t[26];let P=C&&x!==``,F;t[27]===D?F=t[28]:(F=e=>{e.key===`Enter`&&D()},t[27]=D,t[28]=F);let I;t[29]!==o||t[30]!==s||t[31]!==P||t[32]!==F?(I=(0,$.jsx)(Tt,{id:o,value:s,onChange:N,"aria-invalid":P,onKeyDown:F}),t[29]=o,t[30]=s,t[31]=P,t[32]=F,t[33]=I):I=t[33];let L;t[34]!==C||t[35]!==x?(L=C&&x!==``?(0,$.jsx)(`p`,{className:`text-destructive text-xs`,children:(0,$.jsx)(c,{id:`fVzizW`})}):null,t[34]=C,t[35]=x,t[36]=L):L=t[36];let R;t[37]!==M||t[38]!==I||t[39]!==L?(R=(0,$.jsxs)(`div`,{className:`space-y-1.5`,children:[M,I,L]}),t[37]=M,t[38]=I,t[39]=L,t[40]=R):R=t[40];let z;t[41]===r?z=t[42]:(z=()=>r(!1),t[41]=r,t[42]=z);let B;t[43]===Symbol.for(`react.memo_cache_sentinel`)?(B=(0,$.jsx)(c,{id:`dEgA5A`}),t[43]=B):B=t[43];let V;t[44]!==d||t[45]!==z?(V=(0,$.jsx)(v,{variant:`outline`,onClick:z,disabled:d,children:B}),t[44]=d,t[45]=z,t[46]=V):V=t[46];let H;t[47]===D?H=t[48]:(H=()=>void D(),t[47]=D,t[48]=H);let U=!w,W;t[49]===d?W=t[50]:(W=d?(0,$.jsx)(c,{id:`tHKQ6j`}):(0,$.jsx)(c,{id:`2wxgft`}),t[49]=d,t[50]=W);let G;t[51]!==H||t[52]!==U||t[53]!==W?(G=(0,$.jsx)(v,{onClick:H,disabled:U,children:W}),t[51]=H,t[52]=U,t[53]=W,t[54]=G):G=t[54];let K;t[55]!==V||t[56]!==G?(K=(0,$.jsxs)(it,{children:[V,G]}),t[55]=V,t[56]=G,t[57]=K):K=t[57];let q;t[58]!==R||t[59]!==K?(q=(0,$.jsxs)(rt,{className:`sm:max-w-md`,children:[A,R,K]}),t[58]=R,t[59]=K,t[60]=q):q=t[60];let J;return t[61]!==q||t[62]!==O?(J=(0,$.jsx)(st,{open:!0,onOpenChange:O,children:q}),t[61]=q,t[62]=O,t[63]=J):J=t[63],J}function nr(e){let t=(0,Q.c)(75),{skill:n,existingNames:r,onOpenChange:i,onRenamed:a}=e,o=ze(),s=n!==null,l=(0,Z.useId)(),[u,d]=(0,Z.useState)(``),[f,p]=(0,Z.useState)(!1),m;t[0]===n?m=t[1]:(m=()=>{n&&d(n.name)},t[0]=n,t[1]=m);let h=n?.scope,g=n?.name,y;if(t[2]!==h||t[3]!==g?(y=[h,g],t[2]=h,t[3]=g,t[4]=y):y=t[4],(0,Z.useEffect)(m,y),!n)return null;let b,x,S,C,w,T;if(t[5]!==r||t[6]!==u||t[7]!==n.name){w=u.trim(),T=w===n.name;let e;t[14]===Symbol.for(`react.memo_cache_sentinel`)?(e=/\s/,t[14]=e):e=t[14];let i;t[15]===u?i=t[16]:(i=e.test(u),t[15]=u,t[16]=i),b=i,C=w.length>64,x=w===``||!R.test(w)||C,S=!x&&!T&&r.has(w),t[5]=r,t[6]=u,t[7]=n.name,t[8]=b,t[9]=x,t[10]=S,t[11]=C,t[12]=w,t[13]=T}else b=t[8],x=t[9],S=t[10],C=t[11],w=t[12],T=t[13];let E=S,D=!x&&!E&&!T&&!f,O;t[17]!==D||t[18]!==i||t[19]!==a||t[20]!==o||t[21]!==n||t[22]!==w?(O=async function(){if(!n||!D)return;p(!0);let e=await o({scope:n.scope,name:n.name},w);p(!1),e.ok&&(a?.(w),i(!1))},t[17]=D,t[18]=i,t[19]=a,t[20]=o,t[21]=n,t[22]=w,t[23]=O):O=t[23];let k=O,A;t[24]===i?A=t[25]:(A=e=>e?null:i(!1),t[24]=i,t[25]=A);let j;t[26]===Symbol.for(`react.memo_cache_sentinel`)?(j=(0,$.jsx)(nt,{children:(0,$.jsx)(c,{id:`dw_3cv`})}),t[26]=j):j=t[26];let M;t[27]===Symbol.for(`react.memo_cache_sentinel`)?(M=(0,$.jsxs)(ot,{children:[j,(0,$.jsx)(tt,{children:(0,$.jsx)(c,{id:`R9IDFz`})})]}),t[27]=M):M=t[27];let N;t[28]===Symbol.for(`react.memo_cache_sentinel`)?(N=(0,$.jsx)(c,{id:`6YtxFj`}),t[28]=N):N=t[28];let P;t[29]===l?P=t[30]:(P=(0,$.jsx)(_,{htmlFor:l,children:N}),t[29]=l,t[30]=P);let F;t[31]===Symbol.for(`react.memo_cache_sentinel`)?(F=e=>d(e.target.value),t[31]=F):F=t[31];let I;t[32]===k?I=t[33]:(I=e=>{e.key===`Enter`&&k()},t[32]=k,t[33]=I);let L=x||E,z=x&&w!==``||E?`${l}-error`:void 0,B;t[34]!==l||t[35]!==u||t[36]!==I||t[37]!==L||t[38]!==z?(B=(0,$.jsx)(Tt,{id:l,value:u,onChange:F,onKeyDown:I,spellCheck:!1,autoCapitalize:`off`,autoCorrect:`off`,maxLength:64,"aria-invalid":L,"aria-describedby":z,className:`font-mono`}),t[34]=l,t[35]=u,t[36]=I,t[37]=L,t[38]=z,t[39]=B):B=t[39];let V;t[40]!==E||t[41]!==b||t[42]!==l||t[43]!==x||t[44]!==C||t[45]!==w?(V=x&&w!==``?(0,$.jsx)(`p`,{id:`${l}-error`,className:`text-xs text-destructive`,children:b?(0,$.jsx)(c,{id:`iUwpZI`,components:{0:(0,$.jsx)(`code`,{className:`font-mono`})}}):C?(0,$.jsx)(c,{id:`lK9c4T`}):(0,$.jsx)(c,{id:`A50vr3`,components:{0:(0,$.jsx)(`code`,{className:`font-mono`})}})}):E?(0,$.jsx)(`p`,{id:`${l}-error`,className:`text-xs text-destructive`,children:(0,$.jsx)(c,{id:`YJ1BTp`})}):null,t[40]=E,t[41]=b,t[42]=l,t[43]=x,t[44]=C,t[45]=w,t[46]=V):V=t[46];let H;t[47]!==P||t[48]!==B||t[49]!==V?(H=(0,$.jsxs)(`div`,{className:`space-y-1.5`,children:[P,B,V]}),t[47]=P,t[48]=B,t[49]=V,t[50]=H):H=t[50];let U;t[51]===i?U=t[52]:(U=()=>i(!1),t[51]=i,t[52]=U);let W;t[53]===Symbol.for(`react.memo_cache_sentinel`)?(W=(0,$.jsx)(c,{id:`dEgA5A`}),t[53]=W):W=t[53];let G;t[54]!==f||t[55]!==U?(G=(0,$.jsx)(v,{variant:`outline`,onClick:U,disabled:f,children:W}),t[54]=f,t[55]=U,t[56]=G):G=t[56];let K;t[57]===k?K=t[58]:(K=()=>void k(),t[57]=k,t[58]=K);let q=!D,J;t[59]===f?J=t[60]:(J=f?(0,$.jsx)(c,{id:`tHKQ6j`}):(0,$.jsx)(c,{id:`2wxgft`}),t[59]=f,t[60]=J);let Y;t[61]!==K||t[62]!==q||t[63]!==J?(Y=(0,$.jsx)(v,{onClick:K,disabled:q,children:J}),t[61]=K,t[62]=q,t[63]=J,t[64]=Y):Y=t[64];let X;t[65]!==G||t[66]!==Y?(X=(0,$.jsxs)(it,{children:[G,Y]}),t[65]=G,t[66]=Y,t[67]=X):X=t[67];let ee;t[68]!==H||t[69]!==X?(ee=(0,$.jsxs)(rt,{children:[M,H,X]}),t[68]=H,t[69]=X,t[70]=ee):ee=t[70];let te;return t[71]!==s||t[72]!==ee||t[73]!==A?(te=(0,$.jsx)(st,{open:s,onOpenChange:A,children:ee}),t[71]=s,t[72]=ee,t[73]=A,t[74]=te):te=t[74],te}function rr(){let e=(0,Q.c)(6),{_:t}=l(),n=mt(),r=Re(),{openTabs:i}=a(),o=Et(),s;return e[0]!==t||e[1]!==i||e[2]!==r||e[3]!==n||e[4]!==o?(s=async(e,a)=>{if(a===e.scope)return!1;I(e.scope,e.name),P(e.scope,e.name);let s=await yt({name:e.name,fromScope:e.scope,toScope:a});if(L(e.scope,e.name),!s.ok)return j(e.scope,e.name),T.error(t({id:`07eGJB`,values:{0:s.error}}),gt({outcome:s.outcome,name:e.name,toScope:a,scopeLabel:n[a]})),!1;T.success(t({id:`yhI6P0`,values:{0:e.name,1:n[a]}}));let c=o.status===`ready`?o.data.find(t=>t.scope===e.scope&&t.name===e.name):void 0,l=i.map(ar).filter(t=>{if(t.kind!==`doc`)return!1;let n=Hn(t.docName);return n?.scope===e.scope&&n.name===e.name}),u=l.find(ir)??l[0],d=u?.kind===`doc`?u.docName:c?dt(c):e.scope===`global`?D(e.scope,e.name):null,f=a===`project`&&s.path!==void 0?`${s.path.replace(/\/+$/,``)}/SKILL`:D(a,e.name);try{d!==null&&r(d,f)}catch(e){console.error(`[skill-move-scope] retarget failed after a successful move`,e)}return j(e.scope,e.name),!0},e[0]=t,e[1]=i,e[2]=r,e[3]=n,e[4]=o,e[5]=s):s=e[5],s}function ir(e){return e.kind===`doc`&&Hn(e.docName)?.rel===null}function ar(e){return o(e)}function or(e){let t=(0,Q.c)(38),{target:n,onOpenChange:r}=e,i=mt(),a=rr(),[o,s]=(0,Z.useState)(!1);if(!n)return null;let{scope:l,name:u,toScope:d}=n,f;t[0]!==o||t[1]!==r?(f=e=>!e&&!o&&r(!1),t[0]=o,t[1]=r,t[2]=f):f=t[2];let p=i[d],m;t[3]===p?m=t[4]:(m=(0,$.jsx)(nt,{children:(0,$.jsx)(c,{id:`SXEdCq`,values:{0:p}})}),t[3]=p,t[4]=m);let h=i[l],g=i[d],_=i[d],y;t[5]!==u||t[6]!==h||t[7]!==g||t[8]!==_?(y={0:h,1:g,2:_,name:u},t[5]=u,t[6]=h,t[7]=g,t[8]=_,t[9]=y):y=t[9];let b;t[10]===Symbol.for(`react.memo_cache_sentinel`)?(b={0:(0,$.jsx)(`code`,{className:`font-mono`})},t[10]=b):b=t[10];let x;t[11]===y?x=t[12]:(x=(0,$.jsx)(tt,{children:(0,$.jsx)(c,{id:`7bIiJ7`,values:y,components:b})}),t[11]=y,t[12]=x);let S;t[13]!==m||t[14]!==x?(S=(0,$.jsxs)(ot,{children:[m,x]}),t[13]=m,t[14]=x,t[15]=S):S=t[15];let C;t[16]===Symbol.for(`react.memo_cache_sentinel`)?(C=(0,$.jsx)(c,{id:`dEgA5A`}),t[16]=C):C=t[16];let w;t[17]===o?w=t[18]:(w=(0,$.jsx)(at,{asChild:!0,children:(0,$.jsx)(v,{variant:`outline`,disabled:o,children:C})}),t[17]=o,t[18]=w);let T;t[19]!==a||t[20]!==u||t[21]!==r||t[22]!==l||t[23]!==d?(T=async()=>{s(!0),await a({scope:l,name:u},d),s(!1),r(!1)},t[19]=a,t[20]=u,t[21]=r,t[22]=l,t[23]=d,t[24]=T):T=t[24];let E;t[25]===Symbol.for(`react.memo_cache_sentinel`)?(E=(0,$.jsx)(c,{id:`QWdKwH`}),t[25]=E):E=t[25];let D;t[26]!==o||t[27]!==T?(D=(0,$.jsx)(v,{"data-testid":`skill-scope-move-confirm`,disabled:o,onClick:T,children:E}),t[26]=o,t[27]=T,t[28]=D):D=t[28];let O;t[29]!==w||t[30]!==D?(O=(0,$.jsxs)(it,{children:[w,D]}),t[29]=w,t[30]=D,t[31]=O):O=t[31];let k;t[32]!==S||t[33]!==O?(k=(0,$.jsxs)(rt,{className:`sm:max-w-md`,children:[S,O]}),t[32]=S,t[33]=O,t[34]=k):k=t[34];let A;return t[35]!==f||t[36]!==k?(A=(0,$.jsx)(st,{open:!0,onOpenChange:f,children:k}),t[35]=f,t[36]=k,t[37]=A):A=t[37],A}var sr=(0,Z.lazy)(async()=>({default:(await t(()=>import(`./SkillForkDialog-QqHr4a1o.js`),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51]),import.meta.url)).SkillForkDialog}));function cr(){let e=(0,Q.c)(52),{_:t}=l(),n=Dt(),[r,i]=(0,Z.useState)(null),[a,o]=(0,Z.useState)(null),[s,c]=(0,Z.useState)(null),[u,d]=(0,Z.useState)(null),[f,p]=(0,Z.useState)(null),[m,h]=(0,Z.useState)(null),[g,_]=(0,Z.useState)(null),[v,y]=(0,Z.useState)(null),b;e[0]===t?b=e[1]:(b=async function(e,n,r){y(e.name),I(e.scope,e.name);let i=await bt({scope:e.scope,name:e.name,...n?{targets:[...n]}:{},...r?.linkMode===void 0?{}:{linkMode:r.linkMode}});if(j(e.scope,e.name),y(null),!i.ok)return T.error(t({id:`Mj8R8K`,values:{0:i.error}})),i;let a=dr,o=new Set(i.hosts),s=i.hosts.filter(t=>!e.hosts.includes(t)),c=e.hosts.filter(e=>!o.has(e)),l=e=>{let t=i.warningCodes.indexOf(e);return t>=0?i.warnings[t]:void 0},u=l(`no-targets`);if(u)return T.warning(u),i;if(s.length>0){let e=l(`scripts-present`);e&&T.warning(e);let t=l(`no-description`);t&&T.warning(t)}return i.hosts.length===0?T.success(t({id:`4pDZ2N`,values:{0:e.name}})):s.length>0&&c.length===0?T.success(t({id:`PPFQ3o`,values:{0:e.name,1:a(s)}})):c.length>0&&s.length===0?T.success(t({id:`OOIVJo`,values:{0:e.name,1:a(c)}})):s.length>0&&c.length>0?T.success(t({id:`OxplNM`,values:{0:e.name,1:a(s),2:a(c)}})):T.success(t({id:`wDgmsr`,values:{0:e.name,1:a(i.hosts)}})),i},e[0]=t,e[1]=b);let x=b,S;e[2]===Symbol.for(`react.memo_cache_sentinel`)?(S=async function(e,t){if(t.length!==0){y(e.name),I(e.scope,e.name);for(let{target:n,mode:r}of t){let t=await Ct({scope:e.scope,name:e.name,target:n,mode:r});if(!t.ok){T.error(t.error);break}}j(e.scope,e.name),y(null)}},e[2]=S):S=e[2];let C=S,w;e[3]===Symbol.for(`react.memo_cache_sentinel`)?(w=async function(e,t){y(e.name),I(e.scope,e.name);let n=await t();return j(e.scope,e.name),y(null),n},e[3]=w):w=e[3];let E=w,D;e[4]!==t||e[5]!==n?(D=async function(e,r){let i=await vt({scope:e.scope,name:e.name,existingNames:r});if(!i.ok){T.error(t({id:`UPjaXD`,values:{0:e.name,1:i.error}}));return}T.success(t({id:`0g7rCZ`,values:{0:i.name}})),n(e.scope,i.name)},e[4]=t,e[5]=n,e[6]=D):D=e[6];let O=D,k;e[7]===t?k=e[8]:(k=async function(e){let n=[...e.names];if(n.length===0)return;for(let t of n)I(e.scope,t);y(n[0]??null);let r=await wt({scope:e.scope,names:n});for(let t of n)j(e.scope,t);if(y(null),!r.ok){T.error(t({id:`nXHOFU`,values:{0:e.sourceLabel,1:r.error}}));return}let i=r.results.filter(ur),a=e.sourceLabel,o=r.updated,s=r.upToDate;if(i.length>0){let e=i.map(lr).join(`, `),n=i.length;T.warning(t({id:`AgoIW4`,values:{source:a,updated:o,upToDate:s,failed:n,detail:e}}));return}T.success(t(o>0?{id:`qd7L1J`,values:{source:a,updated:o,upToDate:s}}:{id:`XF1kgP`,values:{source:a}}))},e[7]=t,e[8]=k);let A=k,M,N;e[9]===Symbol.for(`react.memo_cache_sentinel`)?(M=e=>{e||i(null)},N=()=>i(null),e[9]=M,e[10]=N):(M=e[9],N=e[10]);let P;e[11]===r?P=e[12]:(P=(0,$.jsx)(Xn,{skill:r,onOpenChange:M,onDeleted:N}),e[11]=r,e[12]=P);let F=a?.skill??null,L=a?.existingNames??pr,R,z;e[13]===Symbol.for(`react.memo_cache_sentinel`)?(R=e=>{e||o(null)},z=()=>o(null),e[13]=R,e[14]=z):(R=e[13],z=e[14]);let B;e[15]!==F||e[16]!==L?(B=(0,$.jsx)(nr,{skill:F,existingNames:L,onOpenChange:R,onRenamed:z}),e[15]=F,e[16]=L,e[17]=B):B=e[17];let V;e[18]===Symbol.for(`react.memo_cache_sentinel`)?(V=e=>{e||c(null)},e[18]=V):V=e[18];let H;e[19]===s?H=e[20]:(H=(0,$.jsx)(or,{target:s,onOpenChange:V}),e[19]=s,e[20]=H);let U;e[21]===Symbol.for(`react.memo_cache_sentinel`)?(U=e=>{e||d(null)},e[21]=U):U=e[21];let W;e[22]===u?W=e[23]:(W=(0,$.jsx)(tr,{target:u,onOpenChange:U}),e[22]=u,e[23]=W);let G;e[24]===Symbol.for(`react.memo_cache_sentinel`)?(G=e=>{e||p(null)},e[24]=G):G=e[24];let K;e[25]===f?K=e[26]:(K=(0,$.jsx)(er,{target:f,onOpenChange:G}),e[25]=f,e[26]=K);let q;e[27]===Symbol.for(`react.memo_cache_sentinel`)?(q=e=>{e||h(null)},e[27]=q):q=e[27];let J;e[28]===m?J=e[29]:(J=(0,$.jsx)($n,{target:m,onOpenChange:q}),e[28]=m,e[29]=J);let Y;e[30]===g?Y=e[31]:(Y=g?(0,$.jsx)(Z.Suspense,{fallback:null,children:(0,$.jsx)(sr,{target:g,onOpenChange:e=>{e||_(null)}})}):null,e[30]=g,e[31]=Y);let X;e[32]!==B||e[33]!==H||e[34]!==W||e[35]!==K||e[36]!==J||e[37]!==Y||e[38]!==P?(X=(0,$.jsxs)($.Fragment,{children:[P,B,H,W,K,J,Y]}),e[32]=B,e[33]=H,e[34]=W,e[35]=K,e[36]=J,e[37]=Y,e[38]=P,e[39]=X):X=e[39];let ee=X,te,ne,re,ie,ae,oe;e[40]===Symbol.for(`react.memo_cache_sentinel`)?(te=(e,t)=>o({skill:e,existingNames:t}),ne=(e,t)=>c({scope:e.scope,name:e.name,toScope:t}),re=(e,t)=>d({skill:e,filePath:t}),ie=(e,t)=>p({skill:e,filePath:t}),ae=(e,t)=>h(t===void 0?{skill:e}:{skill:e,prefix:t}),oe=(e,t)=>_({skill:e,editor:t}),e[40]=te,e[41]=ne,e[42]=re,e[43]=ie,e[44]=ae,e[45]=oe):(te=e[40],ne=e[41],re=e[42],ie=e[43],ae=e[44],oe=e[45]);let se;return e[46]!==ee||e[47]!==O||e[48]!==x||e[49]!==v||e[50]!==A?(se={installingName:v,install:x,convertLocations:C,runLocationWrite:E,duplicate:O,updateAllFromSource:A,requestDelete:i,requestRename:te,requestScopeMove:ne,requestFileRename:re,requestFileDelete:ie,requestFileCreate:ae,requestForkResolve:oe,dialogs:ee},e[46]=ee,e[47]=O,e[48]=x,e[49]=v,e[50]=A,e[51]=se):se=e[51],se}function lr(e){return e.error?`${e.requested} (${e.error})`:e.requested}function ur(e){return e.status===`failed`||e.status===`not-found`}function dr(e){return e.map(fr).join(`, `)}function fr(e){return z[e]??e}var pr=new Set;function mr(e){let t=(0,Q.c)(7),{absolutePath:n,menuKind:r}=e,i=r===void 0?`dropdown`:r,a=typeof window<`u`?window.okDesktop:void 0;if(!a||!n)return null;let o;t[0]===n?o=t[1]:(o=()=>void a.shell.showItemInFolder(n),t[0]=n,t[1]=o);let s,c;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,$.jsx)(Be,{"aria-hidden":!0}),c=zt(a.platform),t[2]=s,t[3]=c):(s=t[2],c=t[3]);let l;return t[4]!==i||t[5]!==o?(l=(0,$.jsxs)(Ye,{menuKind:i,onSelect:o,children:[s,c]}),t[4]=i,t[5]=o,t[6]=l):l=t[6],l}function hr(e){let t=(0,Q.c)(68),{skill:n,filePath:r,actions:i,menuKind:a}=e,o=a===void 0?`dropdown`:a,{_:s}=l(),u;t[0]!==r||t[1]!==n.absolutePath?(u=n.absolutePath?`${pt(n.absolutePath)}/${r}`:void 0,t[0]=r,t[1]=n.absolutePath,t[2]=u):u=t[2];let d=u,f;t[3]===n.path?f=t[4]:(f=pt(n.path),t[3]=n.path,t[4]=f);let p=`${f}/${r}`,m;t[5]===s?m=t[6]:(m=async function(e){try{await Lt(e),T.success(s({id:`SXCSQd`}))}catch{T.error(s({id:`cRHuuI`}))}},t[5]=s,t[6]=m);let h=m,g;t[7]!==i||t[8]!==r||t[9]!==n?(g=()=>i.requestFileRename(n,r),t[7]=i,t[8]=r,t[9]=n,t[10]=g):g=t[10];let _,v;t[11]===Symbol.for(`react.memo_cache_sentinel`)?(_=(0,$.jsx)(cn,{"aria-hidden":!0}),v=(0,$.jsx)(c,{id:`2wxgft`}),t[11]=_,t[12]=v):(_=t[11],v=t[12]);let y;t[13]!==o||t[14]!==g?(y=(0,$.jsxs)(Ye,{menuKind:o,onSelect:g,children:[_,v]}),t[13]=o,t[14]=g,t[15]=y):y=t[15];let b;t[16]!==d||t[17]!==o?(b=(0,$.jsx)(mr,{absolutePath:d,menuKind:o}),t[16]=d,t[17]=o,t[18]=b):b=t[18];let x,S;t[19]===Symbol.for(`react.memo_cache_sentinel`)?(x=(0,$.jsx)(Ie,{"aria-hidden":!0}),S=(0,$.jsx)(c,{id:`zd00pH`}),t[19]=x,t[20]=S):(x=t[19],S=t[20]);let C;t[21]===o?C=t[22]:(C=(0,$.jsxs)(We,{menuKind:o,children:[x,S]}),t[21]=o,t[22]=C);let w;t[23]!==d||t[24]!==h||t[25]!==o?(w=d?(0,$.jsx)(Ye,{menuKind:o,onSelect:()=>void h(d),children:(0,$.jsx)(c,{id:`z2funE`})}):null,t[23]=d,t[24]=h,t[25]=o,t[26]=w):w=t[26];let E;t[27]!==h||t[28]!==p?(E=()=>void h(p),t[27]=h,t[28]=p,t[29]=E):E=t[29];let D;t[30]===Symbol.for(`react.memo_cache_sentinel`)?(D=(0,$.jsx)(c,{id:`xloBjn`}),t[30]=D):D=t[30];let O;t[31]!==o||t[32]!==E?(O=(0,$.jsx)(Ye,{menuKind:o,onSelect:E,children:D}),t[31]=o,t[32]=E,t[33]=O):O=t[33];let k;t[34]!==o||t[35]!==w||t[36]!==O?(k=(0,$.jsxs)(qe,{menuKind:o,children:[w,O]}),t[34]=o,t[35]=w,t[36]=O,t[37]=k):k=t[37];let A;t[38]!==o||t[39]!==k?(A=(0,$.jsx)(Ue,{menuKind:o,children:k}),t[38]=o,t[39]=k,t[40]=A):A=t[40];let j;t[41]!==o||t[42]!==C||t[43]!==A?(j=(0,$.jsxs)(Ze,{menuKind:o,children:[C,A]}),t[41]=o,t[42]=C,t[43]=A,t[44]=j):j=t[44];let M;t[45]!==o||t[46]!==j||t[47]!==y||t[48]!==b?(M=(0,$.jsxs)(qe,{menuKind:o,children:[y,b,j]}),t[45]=o,t[46]=j,t[47]=y,t[48]=b,t[49]=M):M=t[49];let N;t[50]===o?N=t[51]:(N=(0,$.jsx)(Ge,{menuKind:o}),t[50]=o,t[51]=N);let P;t[52]!==i||t[53]!==r||t[54]!==n?(P=()=>i.requestFileDelete(n,r),t[52]=i,t[53]=r,t[54]=n,t[55]=P):P=t[55];let F,I;t[56]===Symbol.for(`react.memo_cache_sentinel`)?(F=(0,$.jsx)($e,{"aria-hidden":!0}),I=(0,$.jsx)(c,{id:`cnGeoo`}),t[56]=F,t[57]=I):(F=t[56],I=t[57]);let L;t[58]!==o||t[59]!==P?(L=(0,$.jsxs)(Ye,{menuKind:o,variant:`destructive`,onSelect:P,children:[F,I]}),t[58]=o,t[59]=P,t[60]=L):L=t[60];let R;t[61]!==o||t[62]!==L?(R=(0,$.jsx)(qe,{menuKind:o,children:L}),t[61]=o,t[62]=L,t[63]=R):R=t[63];let z;return t[64]!==M||t[65]!==N||t[66]!==R?(z=(0,$.jsxs)($.Fragment,{children:[M,N,R]}),t[64]=M,t[65]=N,t[66]=R,t[67]=z):z=t[67],z}function gr(e){let t=(0,Q.c)(42),{skill:n,actions:r,beforeDelete:i}=e,{_:a}=l(),o=Je(n,r),s=n.absolutePath,u;t[0]===a?u=t[1]:(u=async function(e){try{await Lt(e),T.success(a({id:`SXCSQd`}))}catch{T.error(a({id:`cRHuuI`}))}},t[0]=a,t[1]=u);let d=u,f;t[2]===s?f=t[3]:(f=(0,$.jsx)(mr,{absolutePath:s}),t[2]=s,t[3]=f);let p;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(p=(0,$.jsxs)(We,{menuKind:`dropdown`,children:[(0,$.jsx)(Ie,{"aria-hidden":!0}),(0,$.jsx)(c,{id:`zd00pH`})]}),t[4]=p):p=t[4];let m;t[5]!==s||t[6]!==d?(m=s?(0,$.jsx)(Ye,{menuKind:`dropdown`,onSelect:()=>void d(s),children:(0,$.jsx)(c,{id:`z2funE`})}):null,t[5]=s,t[6]=d,t[7]=m):m=t[7];let h;t[8]!==d||t[9]!==n.path?(h=()=>void d(n.path),t[8]=d,t[9]=n.path,t[10]=h):h=t[10];let g;t[11]===Symbol.for(`react.memo_cache_sentinel`)?(g=(0,$.jsx)(c,{id:`xloBjn`}),t[11]=g):g=t[11];let _;t[12]===h?_=t[13]:(_=(0,$.jsx)(Ye,{menuKind:`dropdown`,onSelect:h,children:g}),t[12]=h,t[13]=_);let v;t[14]!==m||t[15]!==_?(v=(0,$.jsxs)(Ze,{menuKind:`dropdown`,children:[p,(0,$.jsx)(Ue,{menuKind:`dropdown`,children:(0,$.jsxs)(qe,{menuKind:`dropdown`,children:[m,_]})})]}),t[14]=m,t[15]=_,t[16]=v):v=t[16];let y;t[17]!==f||t[18]!==v?(y=(0,$.jsxs)(qe,{menuKind:`dropdown`,children:[f,v]}),t[17]=f,t[18]=v,t[19]=y):y=t[19];let b;t[20]===Symbol.for(`react.memo_cache_sentinel`)?(b=(0,$.jsx)(Ge,{menuKind:`dropdown`}),t[20]=b):b=t[20];let x;t[21]===Symbol.for(`react.memo_cache_sentinel`)?(x=(0,$.jsxs)(We,{menuKind:`dropdown`,children:[(0,$.jsx)(sn,{"aria-hidden":!0}),(0,$.jsx)(c,{id:`TKQ7K-`})]}),t[21]=x):x=t[21];let S;t[22]!==r||t[23]!==n?(S=e=>r.requestForkResolve(n,e),t[22]=r,t[23]=n,t[24]=S):S=t[24];let C;t[25]!==o||t[26]!==n||t[27]!==S?(C=(0,$.jsx)(qe,{menuKind:`dropdown`,children:(0,$.jsxs)(Ze,{menuKind:`dropdown`,children:[x,(0,$.jsx)(Ue,{menuKind:`dropdown`,className:Xe,children:(0,$.jsx)(qe,{menuKind:`dropdown`,children:(0,$.jsx)(Ke,{toggles:o,skill:n,menuKind:`dropdown`,onResolveFork:S})})})]})}),t[25]=o,t[26]=n,t[27]=S,t[28]=C):C=t[28];let w;t[29]===Symbol.for(`react.memo_cache_sentinel`)?(w=(0,$.jsx)(Ge,{menuKind:`dropdown`}),t[29]=w):w=t[29];let E;t[30]!==r||t[31]!==n?(E=()=>r.requestDelete(n),t[30]=r,t[31]=n,t[32]=E):E=t[32];let D,O;t[33]===Symbol.for(`react.memo_cache_sentinel`)?(D=(0,$.jsx)($e,{"aria-hidden":!0}),O=(0,$.jsx)(c,{id:`cnGeoo`}),t[33]=D,t[34]=O):(D=t[33],O=t[34]);let k;t[35]===E?k=t[36]:(k=(0,$.jsx)(qe,{menuKind:`dropdown`,children:(0,$.jsxs)(Ye,{menuKind:`dropdown`,variant:`destructive`,onSelect:E,children:[D,O]})}),t[35]=E,t[36]=k);let A;return t[37]!==i||t[38]!==C||t[39]!==k||t[40]!==y?(A=(0,$.jsxs)($.Fragment,{children:[y,b,C,i,w,k]}),t[37]=i,t[38]=C,t[39]=k,t[40]=y,t[41]=A):A=t[41],A}function _r(e){let t=(0,Q.c)(15),{skill:n,actions:r,existingNames:i,menuKind:a}=e,o=a===void 0?`dropdown`:a,s=lt(),c=_e().states,{dispatch:l}=In(),u=typeof window<`u`?window.okDesktop:void 0,d;t[0]!==n.name||t[1]!==n.scope||t[2]!==s?(d=yn({skillName:n.name,scope:n.scope,workspace:s}),t[0]=n.name,t[1]=n.scope,t[2]=s,t[3]=d):d=t[3];let f=d,p;t[4]!==l||t[5]!==f||t[6]!==c||t[7]!==o?(p=o===`context`?(0,$.jsx)(Bn,{input:f,installStates:c,dispatch:l}):(0,$.jsx)(Rn,{input:f,installStates:c,isElectronHost:u!=null,dispatch:l}),t[4]=l,t[5]=f,t[6]=c,t[7]=o,t[8]=p):p=t[8];let m;return t[9]!==r||t[10]!==i||t[11]!==o||t[12]!==n||t[13]!==p?(m=(0,$.jsx)(vr,{actions:r,existingNames:i,menuKind:o,skill:n,openWithAi:p}),t[9]=r,t[10]=i,t[11]=o,t[12]=n,t[13]=p,t[14]=m):m=t[14],m}function vr(e){let t=(0,Q.c)(65),{actions:n,existingNames:i,menuKind:a,openWithAi:o,skill:s}=e,{_:u}=l(),d=mt(),f=Je(s,n),p=s.absolutePath,m=s.hostQualifier!==void 0,h;t[0]===u?h=t[1]:(h=async function(e){try{await Lt(e),T.success(u({id:`SXCSQd`}))}catch{T.error(u({id:`cRHuuI`}))}},t[0]=u,t[1]=h);let g=h,_;t[2]!==p||t[3]!==a?(_=(0,$.jsx)(mr,{absolutePath:p,menuKind:a}),t[2]=p,t[3]=a,t[4]=_):_=t[4];let v,y;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(v=(0,$.jsx)(Ie,{"aria-hidden":!0}),y=(0,$.jsx)(c,{id:`zd00pH`}),t[5]=v,t[6]=y):(v=t[5],y=t[6]);let b;t[7]===a?b=t[8]:(b=(0,$.jsxs)(We,{menuKind:a,children:[v,y]}),t[7]=a,t[8]=b);let x;t[9]!==p||t[10]!==g||t[11]!==a?(x=p?(0,$.jsx)(Ye,{menuKind:a,onSelect:()=>void g(p),children:(0,$.jsx)(c,{id:`z2funE`})}):null,t[9]=p,t[10]=g,t[11]=a,t[12]=x):x=t[12];let S;t[13]!==g||t[14]!==s.path?(S=()=>void g(s.path),t[13]=g,t[14]=s.path,t[15]=S):S=t[15];let C;t[16]===Symbol.for(`react.memo_cache_sentinel`)?(C=(0,$.jsx)(c,{id:`xloBjn`}),t[16]=C):C=t[16];let w;t[17]!==a||t[18]!==S?(w=(0,$.jsx)(Ye,{menuKind:a,onSelect:S,children:C}),t[17]=a,t[18]=S,t[19]=w):w=t[19];let E;t[20]!==a||t[21]!==x||t[22]!==w?(E=(0,$.jsxs)(qe,{menuKind:a,children:[x,w]}),t[20]=a,t[21]=x,t[22]=w,t[23]=E):E=t[23];let D;t[24]!==a||t[25]!==E?(D=(0,$.jsx)(Ue,{menuKind:a,children:E}),t[24]=a,t[25]=E,t[26]=D):D=t[26];let O;t[27]!==a||t[28]!==D||t[29]!==b?(O=(0,$.jsxs)(Ze,{menuKind:a,children:[b,D]}),t[27]=a,t[28]=D,t[29]=b,t[30]=O):O=t[30];let k;t[31]!==a||t[32]!==o||t[33]!==O||t[34]!==_?(k=(0,$.jsxs)(qe,{menuKind:a,children:[_,o,O]}),t[31]=a,t[32]=o,t[33]=O,t[34]=_,t[35]=k):k=t[35];let A;t[36]===a?A=t[37]:(A=(0,$.jsx)(Ge,{menuKind:a}),t[36]=a,t[37]=A);let j;t[38]!==n||t[39]!==i||t[40]!==f||t[41]!==a||t[42]!==m||t[43]!==d||t[44]!==s?(j=m?(0,$.jsx)(qe,{menuKind:a,children:(0,$.jsx)(He,{menuKind:a,className:`max-w-56 whitespace-normal font-normal text-muted-foreground text-xs`,children:(0,$.jsx)(c,{id:`D0CegO`})})}):(0,$.jsxs)(qe,{menuKind:a,children:[(0,$.jsxs)(Ye,{menuKind:a,onSelect:()=>void n.duplicate(s,i),children:[(0,$.jsx)(r,{"aria-hidden":!0}),(0,$.jsx)(c,{id:`euc6Ns`})]}),(0,$.jsxs)(Ye,{menuKind:a,onSelect:()=>n.requestRename(s,i),children:[(0,$.jsx)(cn,{"aria-hidden":!0}),(0,$.jsx)(c,{id:`2wxgft`})]}),(0,$.jsxs)(Ye,{menuKind:a,onSelect:()=>n.requestFileCreate(s),children:[(0,$.jsx)(Le,{"aria-hidden":!0}),(0,$.jsx)(c,{id:`HdkSiO`})]}),(0,$.jsxs)(Ze,{menuKind:a,children:[(0,$.jsxs)(We,{menuKind:a,children:[(0,$.jsx)(sn,{"aria-hidden":!0}),(0,$.jsx)(c,{id:`TKQ7K-`})]}),(0,$.jsx)(Ue,{menuKind:a,className:Xe,children:(0,$.jsx)(qe,{menuKind:a,children:(0,$.jsx)(Ke,{toggles:f,skill:s,menuKind:a,onResolveFork:e=>n.requestForkResolve(s,e)})})})]}),(0,$.jsxs)(Ye,{menuKind:a,onSelect:()=>n.requestScopeMove(s,s.scope===`project`?`global`:`project`),children:[(0,$.jsx)(on,{"aria-hidden":!0}),s.scope===`project`?(0,$.jsx)(c,{id:`bpytj4`,values:{0:d.global}}):(0,$.jsx)(c,{id:`bpytj4`,values:{0:d.project}})]})]}),t[38]=n,t[39]=i,t[40]=f,t[41]=a,t[42]=m,t[43]=d,t[44]=s,t[45]=j):j=t[45];let M;t[46]===a?M=t[47]:(M=(0,$.jsx)(Ge,{menuKind:a}),t[46]=a,t[47]=M);let N;t[48]!==n||t[49]!==s?(N=()=>n.requestDelete(s),t[48]=n,t[49]=s,t[50]=N):N=t[50];let P,F;t[51]===Symbol.for(`react.memo_cache_sentinel`)?(P=(0,$.jsx)($e,{"aria-hidden":!0}),F=(0,$.jsx)(c,{id:`cnGeoo`}),t[51]=P,t[52]=F):(P=t[51],F=t[52]);let I;t[53]!==a||t[54]!==N?(I=(0,$.jsxs)(Ye,{menuKind:a,variant:`destructive`,onSelect:N,children:[P,F]}),t[53]=a,t[54]=N,t[55]=I):I=t[55];let L;t[56]!==a||t[57]!==I?(L=(0,$.jsx)(qe,{menuKind:a,children:I}),t[56]=a,t[57]=I,t[58]=L):L=t[58];let R;return t[59]!==k||t[60]!==A||t[61]!==j||t[62]!==M||t[63]!==L?(R=(0,$.jsxs)($.Fragment,{children:[k,A,j,M,L]}),t[59]=k,t[60]=A,t[61]=j,t[62]=M,t[63]=L,t[64]=R):R=t[64],R}function yr(e){let t=(0,Q.c)(48),{scope:n,name:r,showNewFile:i}=e,a=i===void 0?!0:i,{_:o}=l(),s=Et(),u=cr(),p=s.status===`ready`?s.data:void 0,m;t[0]!==p||t[1]!==r||t[2]!==n?(m=p?.find(e=>e.scope===n&&e.name===r),t[0]=p,t[1]=r,t[2]=n,t[3]=m):m=t[3];let h=m,g;t[4]!==h||t[5]!==p||t[6]!==r?(g=h===void 0?p?.filter(e=>e.name===r):void 0,t[4]=h,t[5]=p,t[6]=r,t[7]=g):g=t[7];let _=g,y=h??(_?.length===1?_[0]:void 0),b;t[8]!==y||t[9]!==r||t[10]!==n?(b=y??{scope:n,name:r,path:r,description:``,installed:!1,hosts:[]},t[8]=y,t[9]=r,t[10]=n,t[11]=b):b=t[11];let x=b,[S,C]=(0,Z.useState)(!1),w=Je(x,u),{installed:T,installing:E,hostSet:D}=w,O=y===void 0&&!T,k;t[12]!==y||t[13]!==D?(k=y?ft(y,[...D]):[],t[12]=y,t[13]=D,t[14]=k):k=t[14];let A=k,j;t[15]!==o||t[16]!==u||t[17]!==a||t[18]!==x?(j=a?(0,$.jsx)(v,{variant:`outline`,size:`icon-sm`,className:`shrink-0 text-muted-foreground`,onClick:()=>u.requestFileCreate(x),title:o({id:`leF0i_`}),"aria-label":o({id:`leF0i_`}),"data-testid":`skill-editor-new-file`,children:(0,$.jsx)(Le,{className:`size-4`,"aria-hidden":!0})}):null,t[15]=o,t[16]=u,t[17]=a,t[18]=x,t[19]=j):j=t[19];let M=O?`resolving`:`installed`,N=O?`border-border bg-muted/50 text-muted-foreground`:`border-primary/50 bg-primary/5 text-primary hover:bg-primary/10 hover:text-primary aria-expanded:bg-primary/10 aria-expanded:text-primary`,P;t[20]===N?P=t[21]:(P=d(`h-7 shrink-0 gap-1 rounded-lg border px-2 font-normal text-xs shadow-xs font-mono uppercase`,N),t[20]=N,t[21]=P);let F;t[22]!==A||t[23]!==E||t[24]!==O?(F=E?(0,$.jsx)(c,{id:`b4itZn`}):O?(0,$.jsx)(c,{id:`iKvAeG`}):(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(c,{id:`eQkgKV`}),(0,$.jsx)(f,{hosts:A,className:`text-muted-foreground`})]}),t[22]=A,t[23]=E,t[24]=O,t[25]=F):F=t[25];let I;t[26]===Symbol.for(`react.memo_cache_sentinel`)?(I=(0,$.jsx)(Ce,{className:`size-4 shrink-0 opacity-50`,"aria-hidden":!0}),t[26]=I):I=t[26];let L;t[27]!==E||t[28]!==F||t[29]!==M||t[30]!==P?(L=(0,$.jsx)(De,{asChild:!0,children:(0,$.jsxs)(v,{variant:`outline`,size:`sm`,disabled:E,"data-testid":`skill-install-menu-trigger`,"data-state":M,className:P,children:[F,I]})}),t[27]=E,t[28]=F,t[29]=M,t[30]=P,t[31]=L):L=t[31];let R;t[32]!==u||t[33]!==x?(R=e=>u.requestForkResolve(x,e),t[32]=u,t[33]=x,t[34]=R):R=t[34];let z;t[35]===Symbol.for(`react.memo_cache_sentinel`)?(z=()=>C(!1),t[35]=z):z=t[35];let B;t[36]!==x||t[37]!==R||t[38]!==w?(B=(0,$.jsx)(Ne,{align:`end`,className:Xe,children:(0,$.jsx)(Ke,{toggles:w,skill:x,onResolveFork:R,onRunStart:z})}),t[36]=x,t[37]=R,t[38]=w,t[39]=B):B=t[39];let V;t[40]!==S||t[41]!==L||t[42]!==B?(V=(0,$.jsxs)(Pe,{modal:!1,open:S,onOpenChange:C,children:[L,B]}),t[40]=S,t[41]=L,t[42]=B,t[43]=V):V=t[43];let H;return t[44]!==u.dialogs||t[45]!==V||t[46]!==j?(H=(0,$.jsxs)(`div`,{className:`flex min-w-0 items-center gap-1.5`,children:[j,V,u.dialogs]}),t[44]=u.dialogs,t[45]=V,t[46]=j,t[47]=H):H=t[47],H}var br=`justify-center rounded-[5px] px-2 text-xs font-medium data-[state=checked]:bg-background data-[state=checked]:text-foreground data-[state=checked]:shadow-sm [&_[data-slot=dropdown-menu-radio-item-indicator]]:hidden`;function xr(e){let t=(0,Q.c)(24),{value:n,onSelect:r,disabled:i}=e,a=(0,Z.useId)(),o;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,$.jsx)(je,{children:(0,$.jsx)(c,{id:`YvwwqC`})}),t[0]=o):o=t[0];let s;t[1]===r?s=t[2]:(s=e=>r(e),t[1]=r,t[2]=s);let l;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,$.jsx)(c,{id:`ZWyHmq`}),t[3]=l):l=t[3];let u;t[4]!==a||t[5]!==i?(u=(0,$.jsx)(ke,{value:`project`,disabled:i,onSelect:Cr,"aria-describedby":a,className:br,children:l}),t[4]=a,t[5]=i,t[6]=u):u=t[6];let d;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(d=(0,$.jsx)(c,{id:`ImTzPZ`}),t[7]=d):d=t[7];let f;t[8]!==a||t[9]!==i?(f=(0,$.jsx)(ke,{value:`global`,disabled:i,onSelect:Sr,"aria-describedby":a,className:br,children:d}),t[8]=a,t[9]=i,t[10]=f):f=t[10];let p;t[11]!==s||t[12]!==u||t[13]!==f||t[14]!==n?(p=(0,$.jsxs)(Te,{value:n,onValueChange:s,className:`mx-1 grid grid-cols-2 gap-0.5 rounded-md bg-muted/50 p-0.5`,"data-testid":`skill-scope-segment`,children:[u,f]}),t[11]=s,t[12]=u,t[13]=f,t[14]=n,t[15]=p):p=t[15];let m;t[16]===n?m=t[17]:(m=n===`project`?(0,$.jsx)(c,{id:`9x-lMu`}):(0,$.jsx)(c,{id:`AyKwqp`}),t[16]=n,t[17]=m);let h;t[18]!==a||t[19]!==m?(h=(0,$.jsx)(`div`,{id:a,className:`px-2 pt-1 pb-1.5 text-xs leading-snug text-muted-foreground`,"data-testid":`skill-scope-consequence`,children:m}),t[18]=a,t[19]=m,t[20]=h):h=t[20];let g;return t[21]!==p||t[22]!==h?(g=(0,$.jsxs)($.Fragment,{children:[o,p,h]}),t[21]=p,t[22]=h,t[23]=g):g=t[23],g}function Sr(e){return e.preventDefault()}function Cr(e){return e.preventDefault()}function wr(e){let t=(0,Q.c)(23),{onAddProperty:n,className:r,problemCount:i,problemMessages:a}=e,o=i===void 0?0:i,{_:s}=l(),u=o>0,f;t[0]!==s||t[1]!==u||t[2]!==o?(f=s(u?{id:`3KOHFt`,values:{problemCount:o}}:{id:`81H_23`}),t[0]=s,t[1]=u,t[2]=o,t[3]=f):f=t[3];let g=f,_;t[4]===r?_=t[5]:(_=d(`relative`,r),t[4]=r,t[5]=_);let y;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(y=(0,$.jsx)(Ve,{}),t[6]=y):y=t[6];let b;t[7]!==u||t[8]!==o?(b=u?(0,$.jsx)(et,{variant:`notification`,"aria-hidden":`true`,"data-testid":`add-properties-problem-badge`,className:`pointer-events-none absolute -top-0.5 -right-0.5 size-3.5 rounded-full p-0 font-sans text-[9px] leading-none tabular-nums`,children:o>9?`9+`:o}):null,t[7]=u,t[8]=o,t[9]=b):b=t[9];let x;t[10]===b?x=t[11]:(x=(0,$.jsxs)(p,{children:[y,b]}),t[10]=b,t[11]=x);let S;t[12]!==g||t[13]!==n||t[14]!==_||t[15]!==x?(S=(0,$.jsx)(v,{variant:`ghost`,size:`icon`,"aria-label":g,onClick:n,"data-testid":`add-properties-button`,className:_,asChild:!0,children:x}),t[12]=g,t[13]=n,t[14]=_,t[15]=x,t[16]=S):S=t[16];let C;t[17]!==u||t[18]!==a?(C=(0,$.jsx)(m,{side:`bottom`,children:u?(0,$.jsxs)(`span`,{className:`flex flex-col gap-0.5`,children:[(0,$.jsx)(`span`,{className:`font-medium`,children:(0,$.jsx)(c,{id:`AwrGuz`})}),a?.map(Tr),(0,$.jsx)(`span`,{className:`pt-0.5 opacity-70`,children:(0,$.jsx)(c,{id:`yh5-4s`})})]}):(0,$.jsx)(c,{id:`81H_23`})}),t[17]=u,t[18]=a,t[19]=C):C=t[19];let w;return t[20]!==S||t[21]!==C?(w=(0,$.jsxs)(h,{children:[S,C]}),t[20]=S,t[21]=C,t[22]=w):w=t[22],w}function Tr(e,t){return(0,$.jsx)(`span`,{className:`opacity-90`,children:e},t)}export{_n as C,pn as D,fn as E,sn as O,Nn as S,In as T,vn as _,hr as a,yn as b,cr as c,Un as d,qn as f,gn as g,bn as h,_r as i,on as k,or as l,Rn as m,xr as n,gr as o,Bn as p,yr as r,mr as s,wr as t,Gn as u,mn as v,jn as w,Dn as x,hn as y};
@@ -1,2 +1,2 @@
1
1
  const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./ActivityPanelDiffView-bWh_w_3E.js","./dist-Nvb76hAm.js","./chunk-CYidjpOJ.js","./jsx-runtime-BUgB2tll.js","./react-f2sANaYj.js","./pierre-theme-CVT0rO1h.js","./preload-helper-Chd9yIcd.js","./engine-compile-CXIMXtDL.js","./lib-TFtgHRaJ.js","./ccount-BoHE53_k.js","./lib-DlDYgFfS.js","./space-separated-tokens-l9yufOSK.js","./lib-7Zm1Z07d.js","./ok-syntax-theme-Blw5Xy2g.js","./MultiFileDiff-BiPNiqPB.js","./react-error-boundary-6ac6QM6R.js","./compiler-runtime-BfE3aGVn.js"])))=>i.map(i=>d[i]);
2
- import{o as e}from"./chunk-CYidjpOJ.js";import{t}from"./preload-helper-Chd9yIcd.js";import{t as n}from"./jsx-runtime-BUgB2tll.js";import{t as r}from"./react-f2sANaYj.js";import{n as i,r as a}from"./dist-Nvb76hAm.js";import{t as o}from"./compiler-runtime-BfE3aGVn.js";import{t as s}from"./overlay-layers-CKMAjef3.js";import{i as ee,n as te,t as ne}from"./tooltip-DBqLYfio.js";import{n as c,t as l}from"./toggle-group-B7p69Qfd.js";import{t as re}from"./button-DzgjsZzC.js";import{t as u}from"./spinner-Bx8xD6f8.js";import{n as d,t as f}from"./panel-right-open-BSU2gtLb.js";import{t as ie}from"./x-DM2drskU.js";import{o as ae,r as p,t as oe}from"./agent-diff-store-C4k2G19B.js";import{t as m}from"./lru-string-cache-BXtJBFf3.js";import{t as se}from"./use-activity-panel-BKll2Lbb.js";import{a as ce,i as le,o as ue,s as de,t as fe,u as pe}from"./use-timeline-entry-diff-Crd78V2q.js";var me=o(),h=e(r(),1),g=n(),he=(0,h.lazy)(async()=>({default:(await t(()=>import(`./ActivityPanelDiffView-bWh_w_3E.js`),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16]),import.meta.url)).ActivityPanelDiffView})),_=64,ge={changes:[],unparseable:null};function v(e){let t=(0,me.c)(130),{view:n,isPanelCollapsed:r,onTogglePanel:o}=e,{_:m}=a(),{agentId:_,agentName:v,agentColor:y,agentIcon:b,docName:x,keptCount:S}=n,[C]=(0,h.useState)(ve),ye=(0,h.useRef)(null),[w,be]=(0,h.useState)(`rendered`),xe;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(xe={status:`loading`,diff:``,before:``,after:``,properties:ge},t[0]=xe):xe=t[0];let[T,Se]=(0,h.useState)(xe),Ce,we;t[1]!==_||t[2]!==C||t[3]!==x||t[4]!==S?(Ce=()=>{let e=!1;Se({status:`loading`,diff:``,before:``,after:``,properties:ge});let t=`${_}\0${x}\0${S}`,n=C.get(t);if(n!==void 0){Se({status:`ready`,...JSON.parse(n)});return}return se(_,x,S).then(n=>{e||(C.set(t,JSON.stringify(n)),Se({status:`ready`,...n}))}).catch(t=>{e||(console.error(`[agent-diff] failed to load burst diff`,{agentId:_,docName:x,keptCount:S,err:t}),Se({status:`error`,diff:``,before:``,after:``,properties:ge}))}),()=>{e=!0}},we=[_,x,S,C],t[1]=_,t[2]=C,t[3]=x,t[4]=S,t[5]=Ce,t[6]=we):(Ce=t[5],we=t[6]),(0,h.useEffect)(Ce,we);let Te;t[7]!==T.after||t[8]!==T.before||t[9]!==T.status?(Te=T.status===`ready`?de(T.before,T.after):null,t[7]=T.after,t[8]=T.before,t[9]=T.status,t[10]=Te):Te=t[10];let Ee=Te,E=T.status===`ready`?`${w}:${S}:${T.diff}`:``,D,O;t[11]===E?(D=t[12],O=t[13]):(D=()=>{let e=ye.current;if(E===``||!e)return;let t=!1,n=null,r,i,a=()=>{if(t)return;s.sync();let r=e.querySelector(`[data-property-change]`)??e.querySelector(`.ok-diff-ins, .ok-diff-ins-block, [data-diff-deleted]`)??le(e)[0];if(!r)return;t=!0,n?.disconnect(),s.disconnect();let i=window.matchMedia?.(`(prefers-reduced-motion: reduce)`).matches;r.scrollIntoView({block:`center`,behavior:i?`auto`:`smooth`})},o=()=>{t||(r!==void 0&&clearTimeout(r),r=setTimeout(()=>{i!==void 0&&cancelAnimationFrame(i),i=requestAnimationFrame(()=>{i=requestAnimationFrame(a)})},120))},s=ce(e,o);n=new MutationObserver(o),n.observe(e,{childList:!0,subtree:!0}),o();let ee=setTimeout(()=>{n?.disconnect(),s.disconnect()},5e3);return()=>{n?.disconnect(),s.disconnect(),r!==void 0&&clearTimeout(r),i!==void 0&&cancelAnimationFrame(i),clearTimeout(ee)}},O=[E],t[11]=E,t[12]=D,t[13]=O),(0,h.useEffect)(D,O);let De,Oe;t[14]===S?(De=t[15],Oe=t[16]):(De=()=>{let e=e=>{if(e.key===`Escape`&&e.defaultPrevented||s())return;let t=e.target;t&&(t.tagName===`INPUT`||t.tagName===`TEXTAREA`||t.isContentEditable)||(e.key===`Escape`?oe():e.key===`j`||e.key===`ArrowRight`?(e.preventDefault(),p(S+1)):(e.key===`k`||e.key===`ArrowLeft`)&&(e.preventDefault(),p(S-1)))};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},Oe=[S],t[14]=S,t[15]=De,t[16]=Oe),(0,h.useEffect)(De,Oe);let k,A,j,M,N,P,F,I,L,R;if(t[17]!==m||t[18]!==y||t[19]!==b||t[20]!==v||t[21]!==x||t[22]!==T.diff||t[23]!==T.properties.changes.length||t[24]!==T.properties.unparseable||t[25]!==T.status){let e=T.status===`ready`?fe(T.diff):{additions:0,deletions:0},n=e.additions>0||e.deletions>0,r=T.properties.changes.length;k=T.properties.changes.length>0||T.properties.unparseable!==null,I=`absolute inset-0 z-20 flex flex-col bg-background`,L=`agent-diff-pane`,M=`flex flex-wrap items-center gap-x-2 gap-y-1.5 border-b border-border px-3 py-2`;let a;t[36]===m?a=t[37]:(a=m({id:`b18t0_`}),t[36]=m,t[37]=a);let o;t[38]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,g.jsx)(ie,{className:`size-4`}),t[38]=o):o=t[38];let s;t[39]===a?s=t[40]:(s=(0,g.jsx)(ee,{asChild:!0,children:(0,g.jsx)(re,{variant:`ghost`,size:`icon`,className:`size-7 shrink-0`,"data-testid":`agent-diff-close`,"aria-label":a,onClick:_e,children:o})}),t[39]=a,t[40]=s);let c;t[41]===m?c=t[42]:(c=m({id:`b18t0_`}),t[41]=m,t[42]=c);let l;t[43]===c?l=t[44]:(l=(0,g.jsx)(te,{side:`bottom`,children:c}),t[43]=c,t[44]=l),t[45]!==s||t[46]!==l?(N=(0,g.jsxs)(ne,{children:[s,l]}),t[45]=s,t[46]=l,t[47]=N):N=t[47];let u;t[48]===y?u=t[49]:(u={backgroundColor:y},t[48]=y,t[49]=u);let d;t[50]===b?d=t[51]:(d=(0,g.jsx)(ae,{icon:b,width:13,height:13}),t[50]=b,t[51]=d),t[52]!==u||t[53]!==d?(P=(0,g.jsx)(`span`,{className:`flex size-6 shrink-0 items-center justify-center rounded-full text-white`,style:u,children:d}),t[52]=u,t[53]=d,t[54]=P):P=t[54];let f;t[55]===x?f=t[56]:(f=(0,g.jsx)(`div`,{className:`truncate text-sm font-medium text-foreground`,children:x}),t[55]=x,t[56]=f);let p;t[57]===v?p=t[58]:(p=(0,g.jsx)(`div`,{className:`truncate text-xs text-muted-foreground`,children:v}),t[57]=v,t[58]=p),t[59]!==f||t[60]!==p?(F=(0,g.jsxs)(`div`,{className:`min-w-0 max-w-[14rem] shrink`,children:[f,p]}),t[59]=f,t[60]=p,t[61]=F):F=t[61],R=`ml-auto flex flex-wrap items-center justify-end gap-2`,t[62]===r?A=t[63]:(A=r>0&&(0,g.jsx)(`span`,{className:`shrink-0 text-xs text-muted-foreground tabular-nums`,"data-testid":`agent-diff-property-stat`,children:(0,g.jsx)(i,{id:`UI0WPT`,values:{propertyCount:r}})}),t[62]=r,t[63]=A),j=n&&(0,g.jsxs)(`span`,{role:`img`,className:`shrink-0 text-xs tabular-nums`,"data-testid":`agent-diff-stat`,"aria-label":m({id:`8lwQlE`,values:{0:e.additions,1:e.deletions}}),children:[(0,g.jsxs)(`span`,{"aria-hidden":`true`,className:`text-emerald-600 dark:text-emerald-500`,children:[`+`,e.additions]}),` `,(0,g.jsxs)(`span`,{"aria-hidden":`true`,className:`text-red-600 dark:text-red-500`,children:[`−`,e.deletions]})]}),t[17]=m,t[18]=y,t[19]=b,t[20]=v,t[21]=x,t[22]=T.diff,t[23]=T.properties.changes.length,t[24]=T.properties.unparseable,t[25]=T.status,t[26]=k,t[27]=A,t[28]=j,t[29]=M,t[30]=N,t[31]=P,t[32]=F,t[33]=I,t[34]=L,t[35]=R}else k=t[26],A=t[27],j=t[28],M=t[29],N=t[30],P=t[31],F=t[32],I=t[33],L=t[34],R=t[35];let ke;t[64]===Symbol.for(`react.memo_cache_sentinel`)?(ke=e=>{(e===`rendered`||e===`source`)&&be(e)},t[64]=ke):ke=t[64];let z;t[65]===m?z=t[66]:(z=m({id:`ZW3mlR`}),t[65]=m,t[66]=z);let Ae;t[67]===Symbol.for(`react.memo_cache_sentinel`)?(Ae=(0,g.jsx)(c,{value:`rendered`,className:`h-6 px-2 text-xs`,"data-testid":`agent-diff-render-rendered`,children:(0,g.jsx)(i,{id:`4z_1j2`})}),t[67]=Ae):Ae=t[67];let je;t[68]===Symbol.for(`react.memo_cache_sentinel`)?(je=(0,g.jsx)(c,{value:`source`,className:`h-6 px-2 text-xs`,"data-testid":`agent-diff-render-source`,children:(0,g.jsx)(i,{id:`wdxz7K`})}),t[68]=je):je=t[68];let B;t[69]!==w||t[70]!==z?(B=(0,g.jsxs)(l,{type:`single`,value:w,onValueChange:ke,"aria-label":z,variant:`segmented`,size:`sm`,spacing:1,className:`shrink-0 rounded-md bg-muted p-0.5 dark:bg-background`,children:[Ae,je]}),t[69]=w,t[70]=z,t[71]=B):B=t[71];let V;t[72]!==m||t[73]!==r?(V=m(r?{id:`6iDEWA`}:{id:`170Js2`}),t[72]=m,t[73]=r,t[74]=V):V=t[74];let Me=!r,H;t[75]===r?H=t[76]:(H=r?(0,g.jsx)(f,{className:`size-4`}):(0,g.jsx)(d,{className:`size-4`}),t[75]=r,t[76]=H);let U;t[77]!==o||t[78]!==V||t[79]!==Me||t[80]!==H?(U=(0,g.jsx)(ee,{asChild:!0,children:(0,g.jsx)(re,{variant:`ghost`,size:`icon`,className:`size-7 shrink-0`,"data-testid":`agent-diff-toggle-panel`,"aria-label":V,"aria-expanded":Me,onClick:o,children:H})}),t[77]=o,t[78]=V,t[79]=Me,t[80]=H,t[81]=U):U=t[81];let W;t[82]!==m||t[83]!==r?(W=m(r?{id:`6iDEWA`}:{id:`170Js2`}),t[82]=m,t[83]=r,t[84]=W):W=t[84];let G;t[85]===W?G=t[86]:(G=(0,g.jsx)(te,{side:`bottom`,children:W}),t[85]=W,t[86]=G);let K;t[87]!==U||t[88]!==G?(K=(0,g.jsxs)(ne,{children:[U,G]}),t[87]=U,t[88]=G,t[89]=K):K=t[89];let q;t[90]!==A||t[91]!==j||t[92]!==B||t[93]!==K||t[94]!==R?(q=(0,g.jsxs)(`div`,{className:R,children:[A,j,B,K]}),t[90]=A,t[91]=j,t[92]=B,t[93]=K,t[94]=R,t[95]=q):q=t[95];let J;t[96]!==M||t[97]!==N||t[98]!==P||t[99]!==F||t[100]!==q?(J=(0,g.jsxs)(`div`,{className:M,children:[N,P,F,q]}),t[96]=M,t[97]=N,t[98]=P,t[99]=F,t[100]=q,t[101]=J):J=t[101];let Y;t[102]===T.status?Y=t[103]:(Y=T.status===`loading`&&(0,g.jsxs)(`div`,{className:`flex items-center gap-2 px-4 py-3 text-xs text-muted-foreground`,children:[(0,g.jsx)(u,{"aria-hidden":`true`,className:`size-3`}),(0,g.jsx)(i,{id:`38foVZ`})]}),t[102]=T.status,t[103]=Y);let X;t[104]===T.status?X=t[105]:(X=T.status===`error`&&(0,g.jsx)(`p`,{className:`px-4 py-3 text-xs text-destructive`,children:(0,g.jsx)(i,{id:`vvWZnu`})}),t[104]=T.status,t[105]=X);let Z;t[106]!==T.properties||t[107]!==T.status?(Z=T.status===`ready`&&(0,g.jsx)(pe,{delta:T.properties}),t[106]=T.properties,t[107]=T.status,t[108]=Z):Z=t[108];let Q;t[109]!==_||t[110]!==x||t[111]!==k||t[112]!==S||t[113]!==w||t[114]!==Ee||t[115]!==T.after||t[116]!==T.before||t[117]!==T.diff||t[118]!==T.status?(Q=T.status===`ready`&&(w===`rendered`&&Ee?.ok?(0,g.jsx)(ue,{diff:Ee}):T.diff===``?(0,g.jsxs)(g.Fragment,{children:[(0,g.jsx)(`p`,{className:`border-b border-border px-4 py-2 text-xs text-muted-foreground italic`,children:S===0?(0,g.jsx)(i,{id:`klPS-L`}):k?(0,g.jsx)(i,{id:`15ZHCt`}):(0,g.jsx)(i,{id:`k7Hoig`})}),(0,g.jsx)(`pre`,{className:`whitespace-pre-wrap px-4 py-3 font-mono text-xs text-foreground/90`,children:T.after})]}):(0,g.jsx)(h.Suspense,{fallback:(0,g.jsxs)(`div`,{className:`flex items-center gap-2 px-4 py-3 text-xs text-muted-foreground`,children:[(0,g.jsx)(u,{"aria-hidden":`true`,className:`size-3`}),(0,g.jsx)(i,{id:`EDm3wJ`})]}),children:(0,g.jsx)(he,{before:T.before,after:T.after,cacheKey:`${_}@${x}@v${S}`})})),t[109]=_,t[110]=x,t[111]=k,t[112]=S,t[113]=w,t[114]=Ee,t[115]=T.after,t[116]=T.before,t[117]=T.diff,t[118]=T.status,t[119]=Q):Q=t[119];let $;t[120]!==Y||t[121]!==X||t[122]!==Z||t[123]!==Q?($=(0,g.jsxs)(`div`,{ref:ye,className:`min-h-0 flex-1 overflow-auto subtle-scrollbar`,children:[Y,X,Z,Q]}),t[120]=Y,t[121]=X,t[122]=Z,t[123]=Q,t[124]=$):$=t[124];let Ne;return t[125]!==I||t[126]!==L||t[127]!==J||t[128]!==$?(Ne=(0,g.jsxs)(`div`,{className:I,"data-testid":L,children:[J,$]}),t[125]=I,t[126]=L,t[127]=J,t[128]=$,t[129]=Ne):Ne=t[129],Ne}function _e(){return oe()}function ve(){return new m(_)}export{v as AgentDiffPane};
2
+ import{o as e}from"./chunk-CYidjpOJ.js";import{t}from"./preload-helper-Chd9yIcd.js";import{t as n}from"./jsx-runtime-BUgB2tll.js";import{t as r}from"./react-f2sANaYj.js";import{n as i,r as a}from"./dist-Nvb76hAm.js";import{t as o}from"./compiler-runtime-BfE3aGVn.js";import{t as s}from"./overlay-layers-CKMAjef3.js";import{i as ee,n as te,t as ne}from"./tooltip-DBqLYfio.js";import{n as c,t as l}from"./toggle-group-B7p69Qfd.js";import{t as re}from"./button-DzgjsZzC.js";import{t as u}from"./spinner-Bx8xD6f8.js";import{n as d,t as f}from"./panel-right-open-BSU2gtLb.js";import{t as ie}from"./x-DM2drskU.js";import{o as ae,r as p,t as oe}from"./agent-diff-store-C4k2G19B.js";import{t as m}from"./lru-string-cache-BXtJBFf3.js";import{t as se}from"./use-activity-panel-vwUB_0Q4.js";import{a as ce,i as le,o as ue,s as de,t as fe,u as pe}from"./use-timeline-entry-diff-CFyLJSDJ.js";var me=o(),h=e(r(),1),g=n(),he=(0,h.lazy)(async()=>({default:(await t(()=>import(`./ActivityPanelDiffView-bWh_w_3E.js`),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16]),import.meta.url)).ActivityPanelDiffView})),_=64,ge={changes:[],unparseable:null};function v(e){let t=(0,me.c)(130),{view:n,isPanelCollapsed:r,onTogglePanel:o}=e,{_:m}=a(),{agentId:_,agentName:v,agentColor:y,agentIcon:b,docName:x,keptCount:S}=n,[C]=(0,h.useState)(ve),ye=(0,h.useRef)(null),[w,be]=(0,h.useState)(`rendered`),xe;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(xe={status:`loading`,diff:``,before:``,after:``,properties:ge},t[0]=xe):xe=t[0];let[T,Se]=(0,h.useState)(xe),Ce,we;t[1]!==_||t[2]!==C||t[3]!==x||t[4]!==S?(Ce=()=>{let e=!1;Se({status:`loading`,diff:``,before:``,after:``,properties:ge});let t=`${_}\0${x}\0${S}`,n=C.get(t);if(n!==void 0){Se({status:`ready`,...JSON.parse(n)});return}return se(_,x,S).then(n=>{e||(C.set(t,JSON.stringify(n)),Se({status:`ready`,...n}))}).catch(t=>{e||(console.error(`[agent-diff] failed to load burst diff`,{agentId:_,docName:x,keptCount:S,err:t}),Se({status:`error`,diff:``,before:``,after:``,properties:ge}))}),()=>{e=!0}},we=[_,x,S,C],t[1]=_,t[2]=C,t[3]=x,t[4]=S,t[5]=Ce,t[6]=we):(Ce=t[5],we=t[6]),(0,h.useEffect)(Ce,we);let Te;t[7]!==T.after||t[8]!==T.before||t[9]!==T.status?(Te=T.status===`ready`?de(T.before,T.after):null,t[7]=T.after,t[8]=T.before,t[9]=T.status,t[10]=Te):Te=t[10];let Ee=Te,E=T.status===`ready`?`${w}:${S}:${T.diff}`:``,D,O;t[11]===E?(D=t[12],O=t[13]):(D=()=>{let e=ye.current;if(E===``||!e)return;let t=!1,n=null,r,i,a=()=>{if(t)return;s.sync();let r=e.querySelector(`[data-property-change]`)??e.querySelector(`.ok-diff-ins, .ok-diff-ins-block, [data-diff-deleted]`)??le(e)[0];if(!r)return;t=!0,n?.disconnect(),s.disconnect();let i=window.matchMedia?.(`(prefers-reduced-motion: reduce)`).matches;r.scrollIntoView({block:`center`,behavior:i?`auto`:`smooth`})},o=()=>{t||(r!==void 0&&clearTimeout(r),r=setTimeout(()=>{i!==void 0&&cancelAnimationFrame(i),i=requestAnimationFrame(()=>{i=requestAnimationFrame(a)})},120))},s=ce(e,o);n=new MutationObserver(o),n.observe(e,{childList:!0,subtree:!0}),o();let ee=setTimeout(()=>{n?.disconnect(),s.disconnect()},5e3);return()=>{n?.disconnect(),s.disconnect(),r!==void 0&&clearTimeout(r),i!==void 0&&cancelAnimationFrame(i),clearTimeout(ee)}},O=[E],t[11]=E,t[12]=D,t[13]=O),(0,h.useEffect)(D,O);let De,Oe;t[14]===S?(De=t[15],Oe=t[16]):(De=()=>{let e=e=>{if(e.key===`Escape`&&e.defaultPrevented||s())return;let t=e.target;t&&(t.tagName===`INPUT`||t.tagName===`TEXTAREA`||t.isContentEditable)||(e.key===`Escape`?oe():e.key===`j`||e.key===`ArrowRight`?(e.preventDefault(),p(S+1)):(e.key===`k`||e.key===`ArrowLeft`)&&(e.preventDefault(),p(S-1)))};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},Oe=[S],t[14]=S,t[15]=De,t[16]=Oe),(0,h.useEffect)(De,Oe);let k,A,j,M,N,P,F,I,L,R;if(t[17]!==m||t[18]!==y||t[19]!==b||t[20]!==v||t[21]!==x||t[22]!==T.diff||t[23]!==T.properties.changes.length||t[24]!==T.properties.unparseable||t[25]!==T.status){let e=T.status===`ready`?fe(T.diff):{additions:0,deletions:0},n=e.additions>0||e.deletions>0,r=T.properties.changes.length;k=T.properties.changes.length>0||T.properties.unparseable!==null,I=`absolute inset-0 z-20 flex flex-col bg-background`,L=`agent-diff-pane`,M=`flex flex-wrap items-center gap-x-2 gap-y-1.5 border-b border-border px-3 py-2`;let a;t[36]===m?a=t[37]:(a=m({id:`b18t0_`}),t[36]=m,t[37]=a);let o;t[38]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,g.jsx)(ie,{className:`size-4`}),t[38]=o):o=t[38];let s;t[39]===a?s=t[40]:(s=(0,g.jsx)(ee,{asChild:!0,children:(0,g.jsx)(re,{variant:`ghost`,size:`icon`,className:`size-7 shrink-0`,"data-testid":`agent-diff-close`,"aria-label":a,onClick:_e,children:o})}),t[39]=a,t[40]=s);let c;t[41]===m?c=t[42]:(c=m({id:`b18t0_`}),t[41]=m,t[42]=c);let l;t[43]===c?l=t[44]:(l=(0,g.jsx)(te,{side:`bottom`,children:c}),t[43]=c,t[44]=l),t[45]!==s||t[46]!==l?(N=(0,g.jsxs)(ne,{children:[s,l]}),t[45]=s,t[46]=l,t[47]=N):N=t[47];let u;t[48]===y?u=t[49]:(u={backgroundColor:y},t[48]=y,t[49]=u);let d;t[50]===b?d=t[51]:(d=(0,g.jsx)(ae,{icon:b,width:13,height:13}),t[50]=b,t[51]=d),t[52]!==u||t[53]!==d?(P=(0,g.jsx)(`span`,{className:`flex size-6 shrink-0 items-center justify-center rounded-full text-white`,style:u,children:d}),t[52]=u,t[53]=d,t[54]=P):P=t[54];let f;t[55]===x?f=t[56]:(f=(0,g.jsx)(`div`,{className:`truncate text-sm font-medium text-foreground`,children:x}),t[55]=x,t[56]=f);let p;t[57]===v?p=t[58]:(p=(0,g.jsx)(`div`,{className:`truncate text-xs text-muted-foreground`,children:v}),t[57]=v,t[58]=p),t[59]!==f||t[60]!==p?(F=(0,g.jsxs)(`div`,{className:`min-w-0 max-w-[14rem] shrink`,children:[f,p]}),t[59]=f,t[60]=p,t[61]=F):F=t[61],R=`ml-auto flex flex-wrap items-center justify-end gap-2`,t[62]===r?A=t[63]:(A=r>0&&(0,g.jsx)(`span`,{className:`shrink-0 text-xs text-muted-foreground tabular-nums`,"data-testid":`agent-diff-property-stat`,children:(0,g.jsx)(i,{id:`UI0WPT`,values:{propertyCount:r}})}),t[62]=r,t[63]=A),j=n&&(0,g.jsxs)(`span`,{role:`img`,className:`shrink-0 text-xs tabular-nums`,"data-testid":`agent-diff-stat`,"aria-label":m({id:`8lwQlE`,values:{0:e.additions,1:e.deletions}}),children:[(0,g.jsxs)(`span`,{"aria-hidden":`true`,className:`text-emerald-600 dark:text-emerald-500`,children:[`+`,e.additions]}),` `,(0,g.jsxs)(`span`,{"aria-hidden":`true`,className:`text-red-600 dark:text-red-500`,children:[`−`,e.deletions]})]}),t[17]=m,t[18]=y,t[19]=b,t[20]=v,t[21]=x,t[22]=T.diff,t[23]=T.properties.changes.length,t[24]=T.properties.unparseable,t[25]=T.status,t[26]=k,t[27]=A,t[28]=j,t[29]=M,t[30]=N,t[31]=P,t[32]=F,t[33]=I,t[34]=L,t[35]=R}else k=t[26],A=t[27],j=t[28],M=t[29],N=t[30],P=t[31],F=t[32],I=t[33],L=t[34],R=t[35];let ke;t[64]===Symbol.for(`react.memo_cache_sentinel`)?(ke=e=>{(e===`rendered`||e===`source`)&&be(e)},t[64]=ke):ke=t[64];let z;t[65]===m?z=t[66]:(z=m({id:`ZW3mlR`}),t[65]=m,t[66]=z);let Ae;t[67]===Symbol.for(`react.memo_cache_sentinel`)?(Ae=(0,g.jsx)(c,{value:`rendered`,className:`h-6 px-2 text-xs`,"data-testid":`agent-diff-render-rendered`,children:(0,g.jsx)(i,{id:`4z_1j2`})}),t[67]=Ae):Ae=t[67];let je;t[68]===Symbol.for(`react.memo_cache_sentinel`)?(je=(0,g.jsx)(c,{value:`source`,className:`h-6 px-2 text-xs`,"data-testid":`agent-diff-render-source`,children:(0,g.jsx)(i,{id:`wdxz7K`})}),t[68]=je):je=t[68];let B;t[69]!==w||t[70]!==z?(B=(0,g.jsxs)(l,{type:`single`,value:w,onValueChange:ke,"aria-label":z,variant:`segmented`,size:`sm`,spacing:1,className:`shrink-0 rounded-md bg-muted p-0.5 dark:bg-background`,children:[Ae,je]}),t[69]=w,t[70]=z,t[71]=B):B=t[71];let V;t[72]!==m||t[73]!==r?(V=m(r?{id:`6iDEWA`}:{id:`170Js2`}),t[72]=m,t[73]=r,t[74]=V):V=t[74];let Me=!r,H;t[75]===r?H=t[76]:(H=r?(0,g.jsx)(f,{className:`size-4`}):(0,g.jsx)(d,{className:`size-4`}),t[75]=r,t[76]=H);let U;t[77]!==o||t[78]!==V||t[79]!==Me||t[80]!==H?(U=(0,g.jsx)(ee,{asChild:!0,children:(0,g.jsx)(re,{variant:`ghost`,size:`icon`,className:`size-7 shrink-0`,"data-testid":`agent-diff-toggle-panel`,"aria-label":V,"aria-expanded":Me,onClick:o,children:H})}),t[77]=o,t[78]=V,t[79]=Me,t[80]=H,t[81]=U):U=t[81];let W;t[82]!==m||t[83]!==r?(W=m(r?{id:`6iDEWA`}:{id:`170Js2`}),t[82]=m,t[83]=r,t[84]=W):W=t[84];let G;t[85]===W?G=t[86]:(G=(0,g.jsx)(te,{side:`bottom`,children:W}),t[85]=W,t[86]=G);let K;t[87]!==U||t[88]!==G?(K=(0,g.jsxs)(ne,{children:[U,G]}),t[87]=U,t[88]=G,t[89]=K):K=t[89];let q;t[90]!==A||t[91]!==j||t[92]!==B||t[93]!==K||t[94]!==R?(q=(0,g.jsxs)(`div`,{className:R,children:[A,j,B,K]}),t[90]=A,t[91]=j,t[92]=B,t[93]=K,t[94]=R,t[95]=q):q=t[95];let J;t[96]!==M||t[97]!==N||t[98]!==P||t[99]!==F||t[100]!==q?(J=(0,g.jsxs)(`div`,{className:M,children:[N,P,F,q]}),t[96]=M,t[97]=N,t[98]=P,t[99]=F,t[100]=q,t[101]=J):J=t[101];let Y;t[102]===T.status?Y=t[103]:(Y=T.status===`loading`&&(0,g.jsxs)(`div`,{className:`flex items-center gap-2 px-4 py-3 text-xs text-muted-foreground`,children:[(0,g.jsx)(u,{"aria-hidden":`true`,className:`size-3`}),(0,g.jsx)(i,{id:`38foVZ`})]}),t[102]=T.status,t[103]=Y);let X;t[104]===T.status?X=t[105]:(X=T.status===`error`&&(0,g.jsx)(`p`,{className:`px-4 py-3 text-xs text-destructive`,children:(0,g.jsx)(i,{id:`vvWZnu`})}),t[104]=T.status,t[105]=X);let Z;t[106]!==T.properties||t[107]!==T.status?(Z=T.status===`ready`&&(0,g.jsx)(pe,{delta:T.properties}),t[106]=T.properties,t[107]=T.status,t[108]=Z):Z=t[108];let Q;t[109]!==_||t[110]!==x||t[111]!==k||t[112]!==S||t[113]!==w||t[114]!==Ee||t[115]!==T.after||t[116]!==T.before||t[117]!==T.diff||t[118]!==T.status?(Q=T.status===`ready`&&(w===`rendered`&&Ee?.ok?(0,g.jsx)(ue,{diff:Ee}):T.diff===``?(0,g.jsxs)(g.Fragment,{children:[(0,g.jsx)(`p`,{className:`border-b border-border px-4 py-2 text-xs text-muted-foreground italic`,children:S===0?(0,g.jsx)(i,{id:`klPS-L`}):k?(0,g.jsx)(i,{id:`15ZHCt`}):(0,g.jsx)(i,{id:`k7Hoig`})}),(0,g.jsx)(`pre`,{className:`whitespace-pre-wrap px-4 py-3 font-mono text-xs text-foreground/90`,children:T.after})]}):(0,g.jsx)(h.Suspense,{fallback:(0,g.jsxs)(`div`,{className:`flex items-center gap-2 px-4 py-3 text-xs text-muted-foreground`,children:[(0,g.jsx)(u,{"aria-hidden":`true`,className:`size-3`}),(0,g.jsx)(i,{id:`EDm3wJ`})]}),children:(0,g.jsx)(he,{before:T.before,after:T.after,cacheKey:`${_}@${x}@v${S}`})})),t[109]=_,t[110]=x,t[111]=k,t[112]=S,t[113]=w,t[114]=Ee,t[115]=T.after,t[116]=T.before,t[117]=T.diff,t[118]=T.status,t[119]=Q):Q=t[119];let $;t[120]!==Y||t[121]!==X||t[122]!==Z||t[123]!==Q?($=(0,g.jsxs)(`div`,{ref:ye,className:`min-h-0 flex-1 overflow-auto subtle-scrollbar`,children:[Y,X,Z,Q]}),t[120]=Y,t[121]=X,t[122]=Z,t[123]=Q,t[124]=$):$=t[124];let Ne;return t[125]!==I||t[126]!==L||t[127]!==J||t[128]!==$?(Ne=(0,g.jsxs)(`div`,{className:I,"data-testid":L,children:[J,$]}),t[125]=I,t[126]=L,t[127]=J,t[128]=$,t[129]=Ne):Ne=t[129],Ne}function _e(){return oe()}function ve(){return new m(_)}export{v as AgentDiffPane};
@@ -1 +1 @@
1
- import{o as e}from"./chunk-CYidjpOJ.js";import{t}from"./jsx-runtime-BUgB2tll.js";import{t as n}from"./react-f2sANaYj.js";import{n as r,r as i}from"./dist-Nvb76hAm.js";import{t as a}from"./compiler-runtime-BfE3aGVn.js";import{t as ee}from"./utils-CPqDy6Hr.js";import{i as o,n as te,o as ne,s as re,t as ie}from"./select-Bu4Wm3Rf.js";import"./constants-upload-CVKO8P4d.js";import{n as ae}from"./dist-BGzUo_18.js";import{n as oe}from"./config-errors-tVoeK4OC.js";import"./constants-cc1-Bt4QPTUe.js";import{i as s}from"./use-apply-config-theme-CYFG76sS.js";import{g as c}from"./saved-themes-client-CSjCi4YD.js";import"./config-provider-D7tAjHlA.js";import{t as se}from"./input-C-Qm8YDT.js";import{n as ce}from"./config-validation-events-01z0iLZK.js";import{t as le}from"./SettingsSectionHeader-D-JSH4bX.js";import"./config-schema-DSj91SAu.js";import{a as l,i as ue,n as u,t as de}from"./field-controls-BLwJrin4.js";var d=a(),f=e(n(),1),p=t(),m=`content.attachmentFolderPath`,h=`attachments`;function fe(e){let t=c(e);return t===`./`?`same-folder`:t===`/`?`content-root`:t.startsWith(`./`)?`current-folder-subfolder`:`content-root-folder`}function pe(e){let t=c(e);return t===`./`||t===`/`?h:t.startsWith(`./`)?t.slice(2)||h:t}function me(e){return e.trim().replace(/^(?:\.\/)+/,``).replace(/\/{2,}/g,`/`).replace(/\/+$/g,``)}function g(e,t){let n=me(t)||h;return e===`same-folder`?`./`:e===`content-root`?`/`:e===`current-folder-subfolder`?`./${n}`:n}function _(){let e=(0,d.c)(4),{projectBinding:t,projectConfig:n,projectSynced:r}=s();if(!t||!r||!n){let t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,p.jsx)(u,{}),e[0]=t):t=e[0],t}let i=n.content.attachmentFolderPath??`./`,a;return e[1]!==i||e[2]!==t?(a=(0,p.jsx)(v,{binding:t,value:i},i),e[1]=i,e[2]=t,e[3]=a):a=e[3],a}function v(e){let t=(0,d.c)(50),{binding:n,value:a}=e,{_:s}=i(),c;t[0]===a?c=t[1]:(c=()=>fe(a),t[0]=a,t[1]=c);let[u,me]=(0,f.useState)(c),_;t[2]===a?_=t[3]:(_=()=>pe(a),t[2]=a,t[3]=_);let[v,y]=(0,f.useState)(_),[b,x]=(0,f.useState)(null),[S,he]=(0,f.useState)(!1),[ge,_e]=(0,f.useState)(!1),C=(0,f.useRef)(null),w=(0,f.useRef)(null),T,E;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(T=()=>()=>{C.current&&clearTimeout(C.current),w.current&&clearTimeout(w.current)},E=[],t[4]=T,t[5]=E):(T=t[4],E=t[5]),(0,f.useEffect)(T,E);let D,O;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(D=()=>ce(e=>{if(e.docName!==`__config__/project`||ue(e.error)!==m)return;let t=l(e.error,m);ae.error(oe(e.error),{duration:8e3}),x(t),_e(!0),w.current&&clearTimeout(w.current),w.current=setTimeout(()=>{_e(!1),x(null)},600)}),O=[],t[6]=D,t[7]=O):(D=t[6],O=t[7]),(0,f.useEffect)(D,O);let k;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(k=()=>{he(!0),C.current&&clearTimeout(C.current),C.current=setTimeout(()=>he(!1),1200)},t[8]=k):k=t[8];let ve=k,A;t[9]!==s||t[10]!==n?(A=e=>{let t=n.patch({content:{attachmentFolderPath:e}});if(t.ok){x(null),ve();return}let r=l(t.error,m);x(r),ae.error(s({id:`eQxm13`,values:{detail:r}}))},t[9]=s,t[10]=n,t[11]=A):A=t[11];let j=A,M;t[12]!==j||t[13]!==v?(M=e=>{if(e!==`same-folder`&&e!==`content-root`&&e!==`current-folder-subfolder`&&e!==`content-root-folder`)return;let t=e,n=t===`current-folder-subfolder`||t===`content-root-folder`?v||h:v;me(t),y(n),j(g(t,n))},t[12]=j,t[13]=v,t[14]=M):M=t[14];let N=M,P;t[15]!==j||t[16]!==v||t[17]!==u?(P=()=>{let e=g(u,v);y(pe(e)),j(e)},t[15]=j,t[16]=v,t[17]=u,t[18]=P):P=t[18];let F=P,I=u===`current-folder-subfolder`||u===`content-root-folder`,L;t[19]===Symbol.for(`react.memo_cache_sentinel`)?(L=(0,p.jsx)(r,{id:`w_Sphq`}),t[19]=L):L=t[19];let R;t[20]===Symbol.for(`react.memo_cache_sentinel`)?(R=(0,p.jsx)(le,{titleId:`settings-attachments-title`,title:L,scope:`project`,level:`block`,children:(0,p.jsx)(r,{id:`Hnl9nT`})}),t[20]=R):R=t[20];let z=ge&&`animate-settings-flash`,B;t[21]===z?B=t[22]:(B=ee(`rounded-md border p-3`,z),t[21]=z,t[22]=B);let V;t[23]===Symbol.for(`react.memo_cache_sentinel`)?(V=(0,p.jsx)(`div`,{className:`text-sm font-medium`,id:`settings-attachments-location-label`,children:(0,p.jsx)(r,{id:`AsqRE_`})}),t[23]=V):V=t[23];let H;t[24]===Symbol.for(`react.memo_cache_sentinel`)?(H=(0,p.jsxs)(`div`,{className:`space-y-0.5`,children:[V,(0,p.jsx)(`p`,{className:`text-muted-foreground text-1sm`,children:(0,p.jsx)(r,{id:`vppAju`})})]}),t[24]=H):H=t[24];let U;t[25]===Symbol.for(`react.memo_cache_sentinel`)?(U=(0,p.jsx)(ne,{"aria-labelledby":`settings-attachments-location-label`,"data-testid":`settings-attachments-mode`,size:`sm`,children:(0,p.jsx)(re,{})}),t[25]=U):U=t[25];let W;t[26]===Symbol.for(`react.memo_cache_sentinel`)?(W=(0,p.jsx)(o,{value:`same-folder`,children:(0,p.jsx)(r,{id:`Q7W-mC`})}),t[26]=W):W=t[26];let G;t[27]===Symbol.for(`react.memo_cache_sentinel`)?(G=(0,p.jsx)(o,{value:`content-root`,children:(0,p.jsx)(r,{id:`yWSvcf`})}),t[27]=G):G=t[27];let K;t[28]===Symbol.for(`react.memo_cache_sentinel`)?(K=(0,p.jsx)(o,{value:`current-folder-subfolder`,children:(0,p.jsx)(r,{id:`0YUS3Q`})}),t[28]=K):K=t[28];let q;t[29]===Symbol.for(`react.memo_cache_sentinel`)?(q=(0,p.jsxs)(te,{children:[W,G,K,(0,p.jsx)(o,{value:`content-root-folder`,children:(0,p.jsx)(r,{id:`qAx7xG`})})]}),t[29]=q):q=t[29];let J;t[30]!==u||t[31]!==N?(J=(0,p.jsxs)(`div`,{className:`grid gap-3 sm:grid-cols-[minmax(0,1fr)_minmax(16rem,18rem)] sm:items-start`,children:[H,(0,p.jsxs)(ie,{value:u,onValueChange:N,children:[U,q]})]}),t[30]=u,t[31]=N,t[32]=J):J=t[32];let Y;t[33]!==s||t[34]!==F||t[35]!==v||t[36]!==I?(Y=I?(0,p.jsxs)(`div`,{className:`mt-3 max-w-sm space-y-1`,children:[(0,p.jsx)(`label`,{className:`text-sm font-medium`,htmlFor:`settings-attachments-folder-input`,children:(0,p.jsx)(r,{id:`kNqMMd`})}),(0,p.jsx)(se,{id:`settings-attachments-folder-input`,value:v,placeholder:s({id:`OeAl1e`}),onChange:e=>y(e.target.value),onBlur:F,onKeyDown:e=>{e.key===`Enter`&&(e.preventDefault(),F())},className:`h-8 text-sm`,"data-testid":`settings-attachments-folder`})]}):null,t[33]=s,t[34]=F,t[35]=v,t[36]=I,t[37]=Y):Y=t[37];let X;t[38]===b?X=t[39]:(X=b?(0,p.jsx)(`p`,{className:`text-1sm text-destructive`,"data-field-error":m,role:`alert`,children:b}):null,t[38]=b,t[39]=X);let Z;t[40]===S?Z=t[41]:(Z=(0,p.jsx)(de,{visible:S}),t[40]=S,t[41]=Z);let Q;t[42]!==X||t[43]!==Z?(Q=(0,p.jsxs)(`div`,{className:`mt-2 flex min-h-5 items-center gap-2`,children:[X,Z]}),t[42]=X,t[43]=Z,t[44]=Q):Q=t[44];let $;return t[45]!==B||t[46]!==J||t[47]!==Y||t[48]!==Q?($=(0,p.jsxs)(`section`,{"aria-labelledby":`settings-attachments-title`,className:`space-y-3`,"data-testid":`settings-attachments`,children:[R,(0,p.jsxs)(`div`,{className:B,"data-field":m,"data-scope":`project`,children:[J,Y,Q]})]}),t[45]=B,t[46]=J,t[47]=Y,t[48]=Q,t[49]=$):$=t[49],$}export{_ as AttachmentsSection};
1
+ import{o as e}from"./chunk-CYidjpOJ.js";import{t}from"./jsx-runtime-BUgB2tll.js";import{t as n}from"./react-f2sANaYj.js";import{n as r,r as i}from"./dist-Nvb76hAm.js";import{t as a}from"./compiler-runtime-BfE3aGVn.js";import{t as ee}from"./utils-CPqDy6Hr.js";import{i as o,n as te,o as ne,s as re,t as ie}from"./select-Bu4Wm3Rf.js";import"./constants-upload-CVKO8P4d.js";import{n as ae}from"./dist-BGzUo_18.js";import{n as oe}from"./config-errors-tVoeK4OC.js";import"./constants-cc1-Bt4QPTUe.js";import{i as s}from"./use-apply-config-theme-CYFG76sS.js";import{g as c}from"./saved-themes-client-CSjCi4YD.js";import"./config-provider-2W1hFFiT.js";import{t as se}from"./input-C-Qm8YDT.js";import{n as ce}from"./config-validation-events-01z0iLZK.js";import{t as le}from"./SettingsSectionHeader-D-JSH4bX.js";import"./config-schema-DSj91SAu.js";import{a as l,i as ue,n as u,t as de}from"./field-controls-BLwJrin4.js";var d=a(),f=e(n(),1),p=t(),m=`content.attachmentFolderPath`,h=`attachments`;function fe(e){let t=c(e);return t===`./`?`same-folder`:t===`/`?`content-root`:t.startsWith(`./`)?`current-folder-subfolder`:`content-root-folder`}function pe(e){let t=c(e);return t===`./`||t===`/`?h:t.startsWith(`./`)?t.slice(2)||h:t}function me(e){return e.trim().replace(/^(?:\.\/)+/,``).replace(/\/{2,}/g,`/`).replace(/\/+$/g,``)}function g(e,t){let n=me(t)||h;return e===`same-folder`?`./`:e===`content-root`?`/`:e===`current-folder-subfolder`?`./${n}`:n}function _(){let e=(0,d.c)(4),{projectBinding:t,projectConfig:n,projectSynced:r}=s();if(!t||!r||!n){let t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,p.jsx)(u,{}),e[0]=t):t=e[0],t}let i=n.content.attachmentFolderPath??`./`,a;return e[1]!==i||e[2]!==t?(a=(0,p.jsx)(v,{binding:t,value:i},i),e[1]=i,e[2]=t,e[3]=a):a=e[3],a}function v(e){let t=(0,d.c)(50),{binding:n,value:a}=e,{_:s}=i(),c;t[0]===a?c=t[1]:(c=()=>fe(a),t[0]=a,t[1]=c);let[u,me]=(0,f.useState)(c),_;t[2]===a?_=t[3]:(_=()=>pe(a),t[2]=a,t[3]=_);let[v,y]=(0,f.useState)(_),[b,x]=(0,f.useState)(null),[S,he]=(0,f.useState)(!1),[ge,_e]=(0,f.useState)(!1),C=(0,f.useRef)(null),w=(0,f.useRef)(null),T,E;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(T=()=>()=>{C.current&&clearTimeout(C.current),w.current&&clearTimeout(w.current)},E=[],t[4]=T,t[5]=E):(T=t[4],E=t[5]),(0,f.useEffect)(T,E);let D,O;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(D=()=>ce(e=>{if(e.docName!==`__config__/project`||ue(e.error)!==m)return;let t=l(e.error,m);ae.error(oe(e.error),{duration:8e3}),x(t),_e(!0),w.current&&clearTimeout(w.current),w.current=setTimeout(()=>{_e(!1),x(null)},600)}),O=[],t[6]=D,t[7]=O):(D=t[6],O=t[7]),(0,f.useEffect)(D,O);let k;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(k=()=>{he(!0),C.current&&clearTimeout(C.current),C.current=setTimeout(()=>he(!1),1200)},t[8]=k):k=t[8];let ve=k,A;t[9]!==s||t[10]!==n?(A=e=>{let t=n.patch({content:{attachmentFolderPath:e}});if(t.ok){x(null),ve();return}let r=l(t.error,m);x(r),ae.error(s({id:`eQxm13`,values:{detail:r}}))},t[9]=s,t[10]=n,t[11]=A):A=t[11];let j=A,M;t[12]!==j||t[13]!==v?(M=e=>{if(e!==`same-folder`&&e!==`content-root`&&e!==`current-folder-subfolder`&&e!==`content-root-folder`)return;let t=e,n=t===`current-folder-subfolder`||t===`content-root-folder`?v||h:v;me(t),y(n),j(g(t,n))},t[12]=j,t[13]=v,t[14]=M):M=t[14];let N=M,P;t[15]!==j||t[16]!==v||t[17]!==u?(P=()=>{let e=g(u,v);y(pe(e)),j(e)},t[15]=j,t[16]=v,t[17]=u,t[18]=P):P=t[18];let F=P,I=u===`current-folder-subfolder`||u===`content-root-folder`,L;t[19]===Symbol.for(`react.memo_cache_sentinel`)?(L=(0,p.jsx)(r,{id:`w_Sphq`}),t[19]=L):L=t[19];let R;t[20]===Symbol.for(`react.memo_cache_sentinel`)?(R=(0,p.jsx)(le,{titleId:`settings-attachments-title`,title:L,scope:`project`,level:`block`,children:(0,p.jsx)(r,{id:`Hnl9nT`})}),t[20]=R):R=t[20];let z=ge&&`animate-settings-flash`,B;t[21]===z?B=t[22]:(B=ee(`rounded-md border p-3`,z),t[21]=z,t[22]=B);let V;t[23]===Symbol.for(`react.memo_cache_sentinel`)?(V=(0,p.jsx)(`div`,{className:`text-sm font-medium`,id:`settings-attachments-location-label`,children:(0,p.jsx)(r,{id:`AsqRE_`})}),t[23]=V):V=t[23];let H;t[24]===Symbol.for(`react.memo_cache_sentinel`)?(H=(0,p.jsxs)(`div`,{className:`space-y-0.5`,children:[V,(0,p.jsx)(`p`,{className:`text-muted-foreground text-1sm`,children:(0,p.jsx)(r,{id:`vppAju`})})]}),t[24]=H):H=t[24];let U;t[25]===Symbol.for(`react.memo_cache_sentinel`)?(U=(0,p.jsx)(ne,{"aria-labelledby":`settings-attachments-location-label`,"data-testid":`settings-attachments-mode`,size:`sm`,children:(0,p.jsx)(re,{})}),t[25]=U):U=t[25];let W;t[26]===Symbol.for(`react.memo_cache_sentinel`)?(W=(0,p.jsx)(o,{value:`same-folder`,children:(0,p.jsx)(r,{id:`Q7W-mC`})}),t[26]=W):W=t[26];let G;t[27]===Symbol.for(`react.memo_cache_sentinel`)?(G=(0,p.jsx)(o,{value:`content-root`,children:(0,p.jsx)(r,{id:`yWSvcf`})}),t[27]=G):G=t[27];let K;t[28]===Symbol.for(`react.memo_cache_sentinel`)?(K=(0,p.jsx)(o,{value:`current-folder-subfolder`,children:(0,p.jsx)(r,{id:`0YUS3Q`})}),t[28]=K):K=t[28];let q;t[29]===Symbol.for(`react.memo_cache_sentinel`)?(q=(0,p.jsxs)(te,{children:[W,G,K,(0,p.jsx)(o,{value:`content-root-folder`,children:(0,p.jsx)(r,{id:`qAx7xG`})})]}),t[29]=q):q=t[29];let J;t[30]!==u||t[31]!==N?(J=(0,p.jsxs)(`div`,{className:`grid gap-3 sm:grid-cols-[minmax(0,1fr)_minmax(16rem,18rem)] sm:items-start`,children:[H,(0,p.jsxs)(ie,{value:u,onValueChange:N,children:[U,q]})]}),t[30]=u,t[31]=N,t[32]=J):J=t[32];let Y;t[33]!==s||t[34]!==F||t[35]!==v||t[36]!==I?(Y=I?(0,p.jsxs)(`div`,{className:`mt-3 max-w-sm space-y-1`,children:[(0,p.jsx)(`label`,{className:`text-sm font-medium`,htmlFor:`settings-attachments-folder-input`,children:(0,p.jsx)(r,{id:`kNqMMd`})}),(0,p.jsx)(se,{id:`settings-attachments-folder-input`,value:v,placeholder:s({id:`OeAl1e`}),onChange:e=>y(e.target.value),onBlur:F,onKeyDown:e=>{e.key===`Enter`&&(e.preventDefault(),F())},className:`h-8 text-sm`,"data-testid":`settings-attachments-folder`})]}):null,t[33]=s,t[34]=F,t[35]=v,t[36]=I,t[37]=Y):Y=t[37];let X;t[38]===b?X=t[39]:(X=b?(0,p.jsx)(`p`,{className:`text-1sm text-destructive`,"data-field-error":m,role:`alert`,children:b}):null,t[38]=b,t[39]=X);let Z;t[40]===S?Z=t[41]:(Z=(0,p.jsx)(de,{visible:S}),t[40]=S,t[41]=Z);let Q;t[42]!==X||t[43]!==Z?(Q=(0,p.jsxs)(`div`,{className:`mt-2 flex min-h-5 items-center gap-2`,children:[X,Z]}),t[42]=X,t[43]=Z,t[44]=Q):Q=t[44];let $;return t[45]!==B||t[46]!==J||t[47]!==Y||t[48]!==Q?($=(0,p.jsxs)(`section`,{"aria-labelledby":`settings-attachments-title`,className:`space-y-3`,"data-testid":`settings-attachments`,children:[R,(0,p.jsxs)(`div`,{className:B,"data-field":m,"data-scope":`project`,children:[J,Y,Q]})]}),t[45]=B,t[46]=J,t[47]=Y,t[48]=Q,t[49]=$):$=t[49],$}export{_ as AttachmentsSection};
@@ -1,5 +1,5 @@
1
1
  const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./dist-D5mDCusD.js","./chunk-CYidjpOJ.js","./dist-D2SphF3p.js","./w3c-keyname-C7Rznu6R.js","./dist-BxTTaZ5o.js","./dist-BkE9d74i.js","./dist-Bbin0hhb.js","./dist-DKYEqMZn.js","./dist-Bh9A4sG9.js","./stex-CUzil_LB.js"])))=>i.map(i=>d[i]);
2
- import{o as e}from"./chunk-CYidjpOJ.js";import{t}from"./preload-helper-Chd9yIcd.js";import{t as n}from"./jsx-runtime-BUgB2tll.js";import{t as r}from"./react-f2sANaYj.js";import{r as i}from"./dist-Nvb76hAm.js";import{n as a}from"./dist-PQ5KMVDh.js";import{t as o}from"./react-dom-DPxgxlDT.js";import{t as s}from"./compiler-runtime-BfE3aGVn.js";import{n as c,t as l}from"./with-selector-zVo3Fruj.js";import{a as u,d,i as f,l as p,r as m,u as h}from"./floating-ui.dom-DkPPH5vF.js";import{a as g,d as _,g as v,i as y,l as b,n as x,o as S,r as C,t as w,u as T}from"./constants-upload-CVKO8P4d.js";import{$ as ee,A as E,B as te,C as ne,F as re,G as ie,K as D,L as O,N as ae,P as oe,Q as se,R as ce,S as le,T as ue,U as de,V as fe,W as pe,X as me,Y as he,_ as ge,a as _e,at as k,b as ve,bt as A,c as ye,ct as j,d as be,et as xe,f as Se,g as Ce,gt as we,h as Te,ht as Ee,it as M,k as N,l as De,mt as Oe,n as P,nt as ke,o as F,ot as Ae,p as je,q as Me,r as Ne,rt as Pe,s as Fe,st as Ie,t as Le,tt as Re,u as ze,ut as Be,v as Ve,vt as I,w as He,x as Ue,y as We,z as L}from"./dist-Dc8tD1th.js";import{t as Ge}from"./dist-C_FzPxEX2.js";import{C as Ke,a as qe,g as Je,w as Ye}from"./schemas-api-BbYGQuTW.js";import{t as Xe}from"./util-doc-name-D-_o-n0R.js";import{n as Ze}from"./_envelope-Dwl6i2K9-DPqJ_Q4W.js";import{t as Qe}from"./note-window-mode-CI3Yju9B.js";import{i as $e}from"./use-apply-config-theme-CYFG76sS.js";import{t as et}from"./createLucideIcon-DdBzwsHe.js";import{t as tt}from"./folder-open-COGOeTzI.js";import{t as nt}from"./trash-2-CchZ0T47.js";import{n as rt,r as it}from"./structural-freshness-CIbkMFA3-CWi_lyiW.js";import{c as at,d as ot,l as st}from"./doc-hash-BJkweiX9.js";import{_ as ct,b as lt,d as ut,f as dt,g as ft,h as pt,j as mt,k as ht,o as gt,p as _t,v as vt,w as yt,x as bt}from"./navigation-targets-DTSxcGor.js";import{t as xt}from"./doc-paths-cEiFVCxr.js";import{$ as St,A as Ct,B as wt,C as Tt,E as Et,G as Dt,I as Ot,J as kt,K as At,M as jt,N as Mt,P as Nt,Q as Pt,R as Ft,S as It,T as Lt,W as Rt,X as zt,_ as Bt,at as Vt,b as Ht,c as Ut,d as Wt,et as Gt,f as Kt,g as qt,h as Jt,it as Yt,j as Xt,l as Zt,m as Qt,nt as $t,ot as en,p as tn,q as nn,s as rn,tt as an,u as on,w as sn,x as cn,y as ln,z as un}from"./config-provider-D7tAjHlA.js";import{At as dn,Ct as fn,E as pn,F as mn,G as hn,I as R,J as gn,K as _n,M as vn,Mt as yn,Nt as bn,P as z,Tt as xn,X as Sn,a as Cn,c as wn,f as Tn,l as En,lt as Dn,o as On,r as kn,t as An,ut as jn}from"./dist-D2SphF3p.js";import{A as Mn,C as Nn,E as Pn,H as Fn,I as In,L as Ln,M as Rn,N as zn,O as Bn,P as Vn,R as B,S as Hn,T as Un,_ as Wn,a as Gn,b as Kn,c as qn,h as Jn,k as Yn,m as Xn,o as Zn,t as Qn,x as $n,y as er,z as tr}from"./lib-QQS1Brzc.js";import{t as nr}from"./ccount-BoHE53_k.js";import{n as rr,r as ir}from"./lib-DlDYgFfS.js";import{c as ar,f as or,n as sr,r as cr,t as lr,u as ur}from"./trim-lines-DfV8CCf7.js";import{u as dr}from"./space-separated-tokens-l9yufOSK.js";import{n as fr,t as pr}from"./syntax-CKL08zSk.js";import{n as mr,r as hr,t as gr}from"./cm-theme-Cvtw80TE.js";import{i as _r,n as vr}from"./page-list-cache-BNFVKu-D.js";import{t as yr}from"./documents-fetch-Y7Dt9_Tn.js";import{i as br,n as xr,r as Sr,t as Cr}from"./dist-DseqKdAU.js";import{n as wr,r as Tr,t as Er}from"./dist-BxTTaZ5o.js";import{t as Dr}from"./dist-CjyZozAk.js";import{n as Or}from"./dist-C2Kstufe.js";import{n as kr}from"./dist-BvhrN0Uj.js";import{n as Ar}from"./dist-D5mDCusD.js";import{i as jr,n as Mr,r as Nr}from"./dist-BpU-J2LR.js";import{n as Pr}from"./dist-BkE9d74i.js";import{t as Fr}from"./stex-CUzil_LB.js";import{n as Ir,r as Lr}from"./external-link-CldCnbtR.js";var Rr=et(`file-plus-corner`,[[`path`,{d:`M11.35 22H6a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.706.706l3.588 3.588A2.4 2.4 0 0 1 20 8v5.35`,key:`17jvcc`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M14 19h6`,key:`bvotb8`}],[`path`,{d:`M17 16v6`,key:`18yu1i`}]]),zr=et(`file-text`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M10 9H8`,key:`b1mrlr`}],[`path`,{d:`M16 13H8`,key:`t4e002`}],[`path`,{d:`M16 17H8`,key:`z1uh3a`}]]),Br=et(`film`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M7 3v18`,key:`bbkbws`}],[`path`,{d:`M3 7.5h4`,key:`zfgn84`}],[`path`,{d:`M3 12h18`,key:`1i2n21`}],[`path`,{d:`M3 16.5h4`,key:`1230mu`}],[`path`,{d:`M17 3v18`,key:`in4fa5`}],[`path`,{d:`M17 7.5h4`,key:`myr1c1`}],[`path`,{d:`M17 16.5h4`,key:`go4c1d`}]]),Vr=et(`image`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,ry:`2`,key:`1m3agn`}],[`circle`,{cx:`9`,cy:`9`,r:`2`,key:`af1f0g`}],[`path`,{d:`m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21`,key:`1xmnt7`}]]),Hr=et(`volume-2`,[[`path`,{d:`M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z`,key:`uqj9uw`}],[`path`,{d:`M16 9a5 5 0 0 1 0 6`,key:`1q6k2b`}],[`path`,{d:`M19.364 18.364a9 9 0 0 0 0-12.728`,key:`ijwkga`}]]),V=n(),H=e(r(),1),Ur=e(o(),1),Wr=s(),Gr=c();function Kr(e){return e.editorView}var qr=new Map([[32,` `],[9,` `],[160,`\xA0`]]);function Jr(e){let t=/^&#(x[0-9A-Fa-f]+|X[0-9A-Fa-f]+|[0-9]+);$/.exec(e);if(!t)return null;let n=t[1],r=n[0]===`x`||n[0]===`X`,i=Number.parseInt(r?n.slice(1):n,r?16:10);return Number.isNaN(i)?null:i}function Yr(e){let t=Jr(e);return t!==null&&qr.has(t)}function Xr(e){let t=Jr(e);return t===null?null:qr.get(t)??null}var Zr=/&#(?:x[0-9A-Fa-f]+|X[0-9A-Fa-f]+|[0-9]+);/g;function Qr(e){Zr.lastIndex=0;let t=e.match(Zr);if(t===null||t.join(``)!==e)return null;let n=``;for(let e of t){let t=Xr(e);if(t===null)return null;n+=t}return n}var $r=()=>{let e=!0;return(t,n)=>{if(e){e=!1;try{t()}finally{e=!0}}else n!==void 0&&n()}},ei=/[\uD800-\uDBFF]/,ti=/[\uDC00-\uDFFF]/,ni=(e,t)=>{let n=0,r=0;for(;n<e.length&&n<t.length&&e[n]===t[n];)n++;for(n>0&&ei.test(e[n-1])&&n--;r+n<e.length&&r+n<t.length&&e[e.length-r-1]===t[t.length-r-1];)r++;return r>0&&ti.test(e[e.length-r])&&r--,{index:n,remove:e.length-n-r,insert:t.slice(n,t.length-r)}},ri=(e,t)=>e>>>t|e<<32-t,ii=e=>ri(e,2)^ri(e,13)^ri(e,22),ai=e=>ri(e,6)^ri(e,11)^ri(e,25),oi=e=>ri(e,7)^ri(e,18)^e>>>3,si=e=>ri(e,17)^ri(e,19)^e>>>10,ci=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),li=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),ui=class{constructor(){let e=new ArrayBuffer(320);this._H=new Uint32Array(e,0,8),this._H.set(li),this._W=new Uint32Array(e,64,64)}_updateHash(){let e=this._H,t=this._W;for(let e=16;e<64;e++)t[e]=si(t[e-2])+t[e-7]+oi(t[e-15])+t[e-16];let n=e[0],r=e[1],i=e[2],a=e[3],o=e[4],s=e[5],c=e[6],l=e[7];for(let e=0,u,d;e<64;e++)u=l+ai(o)+(o&s^~o&c)+ci[e]+t[e]>>>0,d=ii(n)+(n&r^n&i^r&i)>>>0,l=c,c=s,s=o,o=a+u>>>0,a=i,i=r,r=n,n=u+d>>>0;e[0]+=n,e[1]+=r,e[2]+=i,e[3]+=a,e[4]+=o,e[5]+=s,e[6]+=c,e[7]+=l}digest(e){let t=0;for(;t+56<=e.length;){let n=0;for(;n<16&&t+3<e.length;n++)this._W[n]=e[t++]<<24|e[t++]<<16|e[t++]<<8|e[t++];if(t%64!=0){for(this._W.fill(0,n,16);t<e.length;)this._W[n]|=e[t]<<(3-t%4)*8,t++;this._W[n]|=128<<(3-t%4)*8}this._updateHash()}let n=t%64!=0;this._W.fill(0,0,16);let r=0;for(;t<e.length;r++)for(let n=3;n>=0&&t<e.length;n--)this._W[r]|=e[t++]<<n*8;n||(this._W[r-(t%4==0?0:1)]|=128<<(3-t%4)*8),this._W[14]=e.byteLength/Gt,this._W[15]=e.byteLength*8,this._updateHash();let i=new Uint8Array(32);for(let e=0;e<this._H.length;e++)for(let t=0;t<4;t++)i[e*4+t]=this._H[e]>>>(3-t)*8;return i}},di=e=>new ui().digest(e),U=new k(`y-sync`),fi=new k(`y-undo`),pi=new k(`yjs-cursor`),mi=e=>{for(let t=6;t<e.length;t++)e[t%6]=e[t%6]^e[t];return e.slice(0,6)},hi=e=>Dt(mi(di(Rt(e)))),gi=()=>({mapping:new Map,isOMark:new Map}),_i=(e,t)=>t===void 0?!e.deleted:t.sv.has(e.id.client)&&t.sv.get(e.id.client)>e.id.clock&&!jt(t.ds,e.id),vi=[{light:`#ecd44433`,dark:`#ecd444`}],yi=(e,t,n)=>{if(!e.has(n)){if(e.size<t.length){let n=Yt();e.forEach(e=>n.add(e)),t=t.filter(e=>!n.has(e))}e.set(n,zt(t))}return e.get(n)},bi=(e,{colors:t=vi,colorMapping:n=new Map,permanentUserData:r=null,onFirstRender:i=()=>{},mapping:a}={})=>{let o=!1,s=new wi(e,a),c=new M({props:{editable:e=>{let t=U.getState(e);return t.snapshot==null&&t.prevSnapshot==null}},key:U,state:{init:(i,a)=>({type:e,doc:e.doc,binding:s,snapshot:null,prevSnapshot:null,isChangeOrigin:!1,isUndoRedoOperation:!1,addToHistory:!0,colors:t,colorMapping:n,permanentUserData:r}),apply:(e,t)=>{let n=e.getMeta(U);if(n!==void 0){t=Object.assign({},t);for(let e in n)t[e]=n[e]}return t.addToHistory=e.getMeta(`addToHistory`)!==!1,t.isChangeOrigin=n!==void 0&&!!n.isChangeOrigin,t.isUndoRedoOperation=n!==void 0&&!!n.isChangeOrigin&&!!n.isUndoRedoOperation,s.prosemirrorView!==null&&n!==void 0&&(n.snapshot!=null||n.prevSnapshot!=null)&&un(0,()=>{s.prosemirrorView!=null&&(n.restore==null?s._renderSnapshot(n.snapshot,n.prevSnapshot,t):(s._renderSnapshot(n.snapshot,n.snapshot,t),delete t.restore,delete t.snapshot,delete t.prevSnapshot,s.mux(()=>{s._prosemirrorChanged(s.prosemirrorView.state.doc)})))}),t}},view:e=>(s.initView(e),a??s._forceRerender(),i(),{update:()=>{let t=c.getState(e.state);if(t.snapshot==null&&t.prevSnapshot==null&&(o||e.state.doc.content.findDiffStart(e.state.doc.type.createAndFill().content)!==null)){if(o=!0,t.addToHistory===!1&&!t.isChangeOrigin){let t=fi.getState(e.state),n=t&&t.undoManager;n&&n.stopCapturing()}s.mux(()=>{t.doc.transact(n=>{n.meta.set(`addToHistory`,t.addToHistory),s._prosemirrorChanged(e.state.doc)},U)})}},destroy:()=>{s.destroy()}})});return c},xi=(e,t,n)=>{if(t!==null&&t.anchor!==null&&t.head!==null)if(t.type===`all`)e.setSelection(new ke(e.doc));else if(t.type===`node`){let r=na(n.doc,n.type,t.anchor,n.mapping);e.setSelection(Si(e,r))}else{let r=na(n.doc,n.type,t.anchor,n.mapping),i=na(n.doc,n.type,t.head,n.mapping);r!==null&&i!==null&&e.setSelection(j.between(e.doc.resolve(r),e.doc.resolve(i)))}},Si=(e,t)=>{let n=e.doc.resolve(t);return n.nodeAfter?Pe.create(e.doc,t):j.near(n)},Ci=(e,t)=>({type:t.selection.jsonID,anchor:ea(t.selection.anchor,e.type,e.mapping),head:ea(t.selection.head,e.type,e.mapping)}),wi=class{constructor(e,t=new Map){this.type=e,this.prosemirrorView=null,this.mux=$r(),this.mapping=t,this.isOMark=new Map,this._observeFunction=this._typeChanged.bind(this),this.doc=e.doc,this.beforeTransactionSelection=null,this.beforeAllTransactions=()=>{this.beforeTransactionSelection===null&&this.prosemirrorView!=null&&(this.beforeTransactionSelection=Ci(this,this.prosemirrorView.state))},this.afterAllTransactions=()=>{this.beforeTransactionSelection=null},this._domSelectionInView=null}get _tr(){return this.prosemirrorView.state.tr.setMeta(`addToHistory`,!1)}_isLocalCursorInView(){return this.prosemirrorView.hasFocus()?(At&&this._domSelectionInView===null&&(un(0,()=>{this._domSelectionInView=null}),this._domSelectionInView=this._isDomSelectionInView()),this._domSelectionInView):!1}_isDomSelectionInView(){let e=this.prosemirrorView._root.getSelection();if(e==null||e.anchorNode==null)return!1;let t=this.prosemirrorView._root.createRange();t.setStart(e.anchorNode,e.anchorOffset),t.setEnd(e.focusNode,e.focusOffset),t.getClientRects().length===0&&t.startContainer&&t.collapsed&&t.selectNodeContents(t.startContainer);let n=t.getBoundingClientRect(),r=wt.documentElement;return n.bottom>=0&&n.right>=0&&n.left<=(window.innerWidth||r.clientWidth||0)&&n.top<=(window.innerHeight||r.clientHeight||0)}renderSnapshot(e,t){t||=Et(It(),new Map),this.prosemirrorView.dispatch(this._tr.setMeta(U,{snapshot:e,prevSnapshot:t}))}unrenderSnapshot(){this.mapping.clear(),this.mux(()=>{let e=this.type.toArray().map(e=>Ei(e,this.prosemirrorView.state.schema,this)).filter(e=>e!==null),t=this._tr.replace(0,this.prosemirrorView.state.doc.content.size,new A(I.from(e),0,0));t.setMeta(U,{snapshot:null,prevSnapshot:null}),this.prosemirrorView.dispatch(t)})}_forceRerender(){this.mapping.clear(),this.mux(()=>{let e=this.beforeTransactionSelection===null?this.prosemirrorView.state.selection:null,t=this.type.toArray().map(e=>Ei(e,this.prosemirrorView.state.schema,this)).filter(e=>e!==null),n=this._tr.replace(0,this.prosemirrorView.state.doc.content.size,new A(I.from(t),0,0));if(e){let t=$t(an(e.anchor,0),n.doc.content.size),r=$t(an(e.head,0),n.doc.content.size);n.setSelection(j.create(n.doc,t,r))}this.prosemirrorView.dispatch(n.setMeta(U,{isChangeOrigin:!0,binding:this}))})}_renderSnapshot(e,t,n){let r=this.doc,i=this.type;if(e||=Ot(this.doc),e instanceof Uint8Array||t instanceof Uint8Array)if((!(e instanceof Uint8Array)||!(t instanceof Uint8Array))&&St(),r=new on({gc:!1}),ln(r,t),t=Ot(r),ln(r,e),e=Ot(r),i._item===null){let e=Array.from(this.doc.share.keys()).find(e=>this.doc.share.get(e)===this.type);i=r.getXmlFragment(e)}else{let e=r.store.clients.get(i._item.id.client)??[];i=e[Ct(e,i._item.id.clock)].content.type}this.mapping.clear(),this.mux(()=>{r.transact(r=>{let a=n.permanentUserData;a&&a.dss.forEach(e=>{Nt(r,e,e=>{})});let o=(e,t)=>{let r=e===`added`?a.getUserByClientId(t.client):a.getUserByDeletedId(t);return{user:r,type:e,color:yi(n.colorMapping,n.colors,r)}},s=Ft(i,new tn(t.ds,e.sv)).map(n=>!n._item.deleted||_i(n._item,e)||_i(n._item,t)?Ei(n,this.prosemirrorView.state.schema,{mapping:new Map,isOMark:new Map},e,t,o):null).filter(e=>e!==null),c=this._tr.replace(0,this.prosemirrorView.state.doc.content.size,new A(I.from(s),0,0));this.prosemirrorView.dispatch(c.setMeta(U,{isChangeOrigin:!0}))},U)})}_typeChanged(e,t){if(this.prosemirrorView==null)return;let n=U.getState(this.prosemirrorView.state);if(e.length===0||n.snapshot!=null||n.prevSnapshot!=null){this.renderSnapshot(n.snapshot,n.prevSnapshot);return}this.mux(()=>{let e=(e,t)=>this.mapping.delete(t);Nt(t,t.deleteSet,e=>{if(e.constructor===Wt){let t=e.content.type;t&&this.mapping.delete(t)}}),t.changed.forEach(e),t.changedParentTypes.forEach(e);let n=this.type.toArray().map(e=>Ti(e,this.prosemirrorView.state.schema,this)).filter(e=>e!==null),r=this._tr.replace(0,this.prosemirrorView.state.doc.content.size,new A(I.from(n),0,0));xi(r,this.beforeTransactionSelection,this),r=r.setMeta(U,{isChangeOrigin:!0,isUndoRedoOperation:t.origin instanceof Qt}),this.beforeTransactionSelection!==null&&this._isLocalCursorInView()&&r.scrollIntoView(),this.prosemirrorView.dispatch(r)})}_prosemirrorChanged(e){this.doc.transact(()=>{qi(this.doc,this.type,e,this),this.beforeTransactionSelection=Ci(this,this.prosemirrorView.state)},U)}initView(e){this.prosemirrorView!=null&&this.destroy(),this.prosemirrorView=e,this.doc.on(`beforeAllTransactions`,this.beforeAllTransactions),this.doc.on(`afterAllTransactions`,this.afterAllTransactions),this.type.observeDeep(this._observeFunction)}destroy(){this.prosemirrorView!=null&&(this.prosemirrorView=null,this.type.unobserveDeep(this._observeFunction),this.doc.off(`beforeAllTransactions`,this.beforeAllTransactions),this.doc.off(`afterAllTransactions`,this.afterAllTransactions))}},Ti=(e,t,n,r,i,a)=>{let o=n.mapping.get(e);if(o===void 0){if(e instanceof qt)return Ei(e,t,n,r,i,a);throw Pt()}return o},Ei=(e,t,n,r,i,a)=>{let o=[],s=e=>{if(e instanceof qt){let s=Ti(e,t,n,r,i,a);s!==null&&o.push(s)}else{let s=e._item.right?.content?.type;s instanceof Jt&&!s._item.deleted&&s._item.id.client===s.doc.clientID&&(e.applyDelta([{retain:e.length},...s.toDelta()]),s.doc.transact(e=>{s._item.delete(e)}));let c=Di(e,t,n,r,i,a);c!==null&&c.forEach(e=>{e!==null&&o.push(e)})}};r===void 0||i===void 0?e.toArray().forEach(s):Ft(e,new tn(i.ds,r.sv)).forEach(s);try{let s=e.getAttributes(r);r!==void 0&&(_i(e._item,r)?_i(e._item,i)||(s.ychange=a?a(`added`,e._item.id):{type:`added`}):s.ychange=a?a(`removed`,e._item.id):{type:`removed`});let c=Ii(s),l=Gi(c.marks,t),u=t.node(e.nodeName,c.plain,o,l.length?l:void 0);return n.mapping.set(e,u),u}catch(r){console.warn(`[y-prosemirror] schema.node(`+e.nodeName+`) threw:`,String(r&&r.message||r));let i=globalThis.__okYpsCounters=globalThis.__okYpsCounters||{block:0,inline:0};if(t.nodes[e.nodeName]&&t.nodes[e.nodeName].spec&&t.nodes[e.nodeName].spec.inline)i.inline++;else if(i.block++,t.nodes.rawMdxFallback)try{let i=t.node(`rawMdxFallback`,{reason:String(r&&r.message||r)},[t.text(e.nodeName)]);return n.mapping.set(e,i),i}catch(e){console.warn(`[y-prosemirror] rawMdxFallback substitution also failed:`,String(e&&e.message||e))}return n.mapping.delete(e),null}},Di=(e,t,n,r,i,a)=>{let o=[],s=e.toDelta(r,i,a);try{for(let e=0;e<s.length;e++){let n=s[e];o.push(t.text(n.insert,Gi(n.attributes,t)))}}catch(e){console.warn(`[y-prosemirror] schema.text() threw:`,String(e&&e.message||e));let t=globalThis.__okYpsCounters=globalThis.__okYpsCounters||{block:0,inline:0};return t.inline++,null}return o},Oi=(e,t)=>{let n=new Bt,r=e.map(e=>({insert:e.text,attributes:Ki(e.marks,t)}));return n.applyDelta(r),t.mapping.set(n,e),n},ki=(e,t)=>{let n=new qt(e.type.name);for(let t in e.attrs){let r=e.attrs[t];r!==null&&t!==`ychange`&&n.setAttribute(t,r)}let r=Ki(e.marks||[],t);for(let e in r)n.setAttribute(Fi+e,{...r[e]});return n.insert(0,Ni(e).map(e=>Ai(e,t))),t.mapping.set(n,e),n},Ai=(e,t)=>e instanceof Array?Oi(e,t):ki(e,t),ji=e=>typeof e==`object`&&!!e,Mi=(e,t)=>{let n=Object.keys(e).filter(t=>e[t]!==null),r=n.length===Object.keys(t).filter(e=>t[e]!==null).length;for(let i=0;i<n.length&&r;i++){let a=n[i],o=e[a],s=t[a];r=a===`ychange`||o===s||ji(o)&&ji(s)&&Mi(o,s)}return r},Ni=e=>{let t=e.content.content,n=[];for(let e=0;e<t.length;e++){let r=t[e];if(r.isText){let r=[];for(let n=t[e];e<t.length&&n.isText;n=t[++e])r.push(n);e--,n.push(r)}else n.push(r)}return n},Pi=(e,t)=>{let n=e.toDelta();return n.length===t.length&&n.every((e,n)=>e.insert===t[n].text&&kt(e.attributes||{}).length===t[n].marks.length&&nn(e.attributes,(e,r)=>{let i=Wi(r),a=t[n].marks;return a.find(e=>e.type.name===i)?Mi(e,a.find(e=>e.type.name===i)?.attrs):!1}))},Fi=`ymark:`,Ii=e=>{let t={},n={};for(let r in e)r.startsWith(Fi)?n[r.slice(6)]=e[r]:t[r]=e[r];return{plain:t,marks:n}},Li=(e,t)=>{let n=Object.keys(e);return n.length===t.length?n.every(n=>{let r=Wi(n),i=t.find(e=>e.type.name===r);return i?Mi(e[n],i.attrs):!1}):!1},Ri=(e,t)=>{if(e instanceof qt&&!(t instanceof Array)&&Ji(e,t)){let n=Ni(t),r=Ii(e.getAttributes());return e._length===n.length&&Li(r.marks,t.marks)&&Mi(r.plain,t.attrs)&&e.toArray().every((e,t)=>Ri(e,n[t]))}return e instanceof Bt&&t instanceof Array&&Pi(e,t)},zi=(e,t)=>e===t||e instanceof Array&&t instanceof Array&&e.length===t.length&&e.every((e,n)=>t[n]===e),Bi=(e,t,n)=>{let r=e.toArray(),i=Ni(t),a=i.length,o=r.length,s=$t(o,a),c=0,l=0,u=!1;for(;c<s;c++){let e=r[c],t=i[c];if(zi(n.mapping.get(e),t))u=!0;else if(!Ri(e,t))break}for(;c+l<s;l++){let e=r[o-l-1],t=i[a-l-1];if(zi(n.mapping.get(e),t))u=!0;else if(!Ri(e,t))break}return{equalityFactor:c+l,foundMappedChild:u}},Vi=e=>{let t=``,n=e._start,r={};for(;n!==null;)n.deleted||(n.countable&&n.content instanceof Ut?t+=n.content.str:n.content instanceof rn&&(r[n.content.key]=null)),n=n.right;return{str:t,nAttrs:r}},Hi=(e,t,n)=>{n.mapping.set(e,t);let{nAttrs:r,str:i}=Vi(e),a=t.map(e=>({insert:e.text,attributes:Object.assign({},r,Ki(e.marks,n))})),{insert:o,remove:s,index:c}=ni(i,a.map(e=>e.insert).join(``));e.delete(c,s),e.insert(c,o),e.applyDelta(a.map(e=>({retain:e.insert.length,attributes:e.attributes})))},Ui=/(.*)(--[a-zA-Z0-9+/=]{8})$/,Wi=e=>Ui.exec(e)?.[1]??e,Gi=(e,t)=>{let n=[];for(let r in e)n.push(t.mark(Wi(r),e[r]));return n},Ki=(e,t)=>{let n={};return e.forEach(e=>{if(e.type.name!==`ychange`){let r=en(t.isOMark,e.type,()=>!e.type.excludes(e.type));n[r?`${e.type.name}--${hi(e.toJSON())}`:e.type.name]=e.attrs}}),n},qi=(e,t,n,r)=>{if(t instanceof qt&&t.nodeName!==n.type.name)throw Error(`node name mismatch!`);if(r.mapping.set(t,n),t instanceof qt){let e=t.getAttributes(),i=n.attrs;for(let n in i)i[n]===null?t.removeAttribute(n):e[n]!==i[n]&&n!==`ychange`&&t.setAttribute(n,i[n]);for(let n in e)i[n]===void 0&&!n.startsWith(Fi)&&t.removeAttribute(n);let a=Ki(n.marks||[],r);for(let n in a){let r=e[Fi+n];(r===void 0||!Mi(r,a[n]))&&t.setAttribute(Fi+n,{...a[n]})}for(let n in e)n.startsWith(Fi)&&a[n.slice(6)]===void 0&&t.removeAttribute(n)}let i=Ni(n),a=i.length,o=t.toArray(),s=o.length,c=$t(a,s),l=0,u=0;for(;l<c;l++){let e=o[l],t=i[l];if(!zi(r.mapping.get(e),t))if(Ri(e,t))r.mapping.set(e,t);else break}for(;u+l+1<c;u++){let e=o[s-u-1],t=i[a-u-1];if(!zi(r.mapping.get(e),t))if(Ri(e,t))r.mapping.set(e,t);else break}e.transact(()=>{for(;s-l-u>0&&a-l-u>0;){let n=o[l],c=i[l],d=o[s-u-1],f=i[a-u-1];if(n instanceof Bt&&c instanceof Array)Pi(n,c)||Hi(n,c,r),l+=1;else{let i=n instanceof qt&&Ji(n,c),a=d instanceof qt&&Ji(d,f);if(i&&a){let e=Bi(n,c,r),t=Bi(d,f,r);e.foundMappedChild&&!t.foundMappedChild?a=!1:!e.foundMappedChild&&t.foundMappedChild||e.equalityFactor<t.equalityFactor?i=!1:a=!1}i?(qi(e,n,c,r),l+=1):a?(qi(e,d,f,r),u+=1):(r.mapping.delete(t.get(l)),t.delete(l,1),t.insert(l,[Ai(c,r)]),l+=1)}}let n=s-l-u;if(s===1&&a===0&&o[0]instanceof Bt?(r.mapping.delete(o[0]),o[0].delete(0,o[0].length)):n>0&&(t.slice(l,l+n).forEach(e=>r.mapping.delete(e)),t.delete(l,n)),l+u<a){let e=[];for(let t=l;t<a-u;t++)e.push(Ai(i[t],r));t.insert(l,e)}},U)},Ji=(e,t)=>!(t instanceof Array)&&e.nodeName===t.type.name,Yi=null,Xi=class{constructor(e,t,n){this.view=e,this.key=t,this.value=n}apply(){let e=U.getState(this.view.state);if(e&&e.binding&&!e.binding.isDestroyed){let e=this.view.state.tr;e.setMeta(this.key,this.value),this.view.dispatch(e)}}},Zi=class e{constructor(e=[]){this.entries=e}getFirst(){return this.entries[0]}dequeueFirst(){return this.entries.shift()}isEmpty(){return this.entries.length===0}static fromViewsToUpdate(){let t=Yi;Yi=null;let n=[];return t.forEach((e,t)=>{e.forEach((e,r)=>{n.push(new Xi(t,r,e))})}),new e(n)}},Qi=(e=Zi.fromViewsToUpdate(),t=!1)=>{let n=!0;for(;!e.isEmpty();){let r=e.getFirst();try{r.apply()}catch(r){if(r instanceof RangeError){t&&n&&e.dequeueFirst(),e.isEmpty()||un(0,()=>Qi(e,!0));return}throw r}n=!1,e.dequeueFirst()}},$i=(e,t,n)=>{Yi||(Yi=new Map,un(0,Qi)),en(Yi,e,Vt).set(t,n)},ea=(e,t,n)=>{if(e===0)return Lt(t,0,-1);let r=t._first===null?null:t._first.content.type;for(;r!==null&&t!==r;){if(r instanceof Bt){if(r._length>=e)return Lt(r,e,-1);if(e-=r._length,r._item!==null&&r._item.next!==null)r=r._item.next.content.type;else{do r=r._item===null?null:r._item.parent,e--;while(r!==t&&r!==null&&r._item!==null&&r._item.next===null);r!==null&&r!==t&&(r=r._item===null?null:r._item.next.content.type)}}else{let i=(n.get(r)||{nodeSize:0}).nodeSize;if(r._first!==null&&e<i)r=r._first.content.type,e--;else{if(e===1&&r._length===0&&i>1)return new Kt(r._item===null?null:r._item.id,r._item===null?Xt(r):null,null);if(e-=i,r._item!==null&&r._item.next!==null)r=r._item.next.content.type;else{if(e===0)return r=r._item===null?r:r._item.parent,new Kt(r._item===null?null:r._item.id,r._item===null?Xt(r):null,null);do r=r._item.parent,e--;while(r!==t&&r._item.next===null);r!==t&&(r=r._item.next.content.type)}}}if(r===null)throw St();if(e===0&&r.constructor!==Bt&&r!==t)return ta(r._item.parent,r._item)}return Lt(t,t._length,-1)},ta=(e,t)=>{let n=null,r=null;return e._item===null?r=Xt(e):n=Tt(e._item.id.client,e._item.id.clock),new Kt(n,r,t.id)},na=(e,t,n,r)=>{let i=cn(n,e);if(i===null||i.type!==t&&!Mt(t,i.type._item))return null;let a=i.type,o=0;if(a.constructor===Bt)o=i.index;else if(a._item===null||!a._item.deleted){let e=a._first,t=0;for(;t<a._length&&t<i.index&&e!==null;){if(!e.deleted){let n=e.content.type;if(t++,n instanceof Bt)o+=n._length;else{let e=r.get(n);if(e==null)return null;o+=e.nodeSize}}e=e.right}o+=1}for(;a!==t&&a._item!==null;){let e=a._item.parent;if(e._item===null||!e._item.deleted){o+=1;let t=e._first;for(;t!==null;){let e=t.content.type;if(e===a)break;if(!t.deleted)if(e instanceof Bt)o+=e._length;else{let t=r.get(e);if(t==null)return null;o+=t.nodeSize}t=t.right}}a=e}return o-1},ra=(e,t)=>{let n=e.toArray().map(e=>Ei(e,t,gi())).filter(e=>e!==null);return I.fromArray(n)},ia=(e,t)=>t.topNodeType.create(null,ra(e,t)),aa=(e,t)=>{let n=gi(),r=e.toArray().map(e=>Ei(e,t,n)).filter(e=>e!==null);return{doc:t.topNodeType.create(null,I.fromArray(r)),meta:n,mapping:n.mapping}},oa=(e,t,n)=>e!==t,sa=e=>{let t=document.createElement(`span`);t.classList.add(`ProseMirror-yjs-cursor`),t.setAttribute(`style`,`border-color: ${e.color}`);let n=document.createElement(`div`);n.setAttribute(`style`,`background-color: ${e.color}`),n.insertBefore(document.createTextNode(e.name),null);let r=document.createTextNode(`⁠`),i=document.createTextNode(`⁠`);return t.insertBefore(r,null),t.insertBefore(n,null),t.insertBefore(i,null),t},ca=e=>({style:`background-color: ${e.color}70`,class:`ProseMirror-yjs-selection`}),la=/^#[0-9a-fA-F]{6}$/,ua=(e,t,n,r,i)=>{let a=U.getState(e);if(a==null||a.doc==null||a.binding==null)return me.create(e.doc,[]);let o=a.doc,s=[];return a.snapshot!=null||a.prevSnapshot!=null||a.binding.mapping.size===0?me.create(e.doc,[]):(t.getStates().forEach((t,c)=>{if(n(o.clientID,c,t)&&t.cursor!=null){let n=t.user||{};n.color==null?n.color=`#ffa500`:la.test(n.color)||console.warn(`A user uses an unsupported color format`,n),n.name??=`User: ${c}`;let l=na(o,a.type,sn(t.cursor.anchor),a.binding.mapping),u=na(o,a.type,sn(t.cursor.head),a.binding.mapping);if(l!==null&&u!==null){let t=an(e.doc.content.size-1,0);l=$t(l,t),u=$t(u,t),s.push(he.widget(u,()=>r(n,c),{key:c+``,side:10}));let a=$t(l,u),o=an(l,u);s.push(he.inline(a,o,i(n,c),{inclusiveEnd:!0,inclusiveStart:!1}))}}}),me.create(e.doc,s))},da=(e,{awarenessStateFilter:t=oa,cursorBuilder:n=sa,selectionBuilder:r=ca,getSelection:i=e=>e.selection}={},a=`cursor`)=>new M({key:pi,state:{init(i,a){return ua(a,e,t,n,r)},apply(i,a,o,s){let c=U.getState(s),l=i.getMeta(pi);return c&&c.isChangeOrigin||l&&l.awarenessUpdated?ua(s,e,t,n,r):a.map(i.mapping,i.doc)}},props:{decorations:e=>pi.getState(e)},view:t=>{let n=()=>{t.docView&&$i(t,pi,{awarenessUpdated:!0})},r=()=>{let n=U.getState(t.state),r=e.getLocalState()||{};if(t.hasFocus()){let o=i(t.state),s=ea(o.anchor,n.type,n.binding.mapping),c=ea(o.head,n.type,n.binding.mapping);(r.cursor==null||!Ht(sn(r.cursor.anchor),s)||!Ht(sn(r.cursor.head),c))&&e.setLocalStateField(a,{anchor:s,head:c})}else r.cursor!=null&&na(n.doc,n.type,sn(r.cursor.anchor),n.binding.mapping)!==null&&e.setLocalStateField(a,null)};return e.on(`change`,n),t.dom.addEventListener(`focusin`,r),t.dom.addEventListener(`focusout`,r),{update:r,destroy:()=>{t.dom.removeEventListener(`focusin`,r),t.dom.removeEventListener(`focusout`,r),e.off(`change`,n),e.setLocalStateField(a,null)}}}}),fa=e=>{let t=fi.getState(e).undoManager;if(t!=null)return t.undo(),!0},pa=e=>{let t=fi.getState(e).undoManager;if(t!=null)return t.redo(),!0},ma=new Set([`paragraph`]),ha=(e,t)=>!(e instanceof Wt)||!(e.content instanceof Zt)||!(e.content.type instanceof Jt||e.content.type instanceof qt&&t.has(e.content.type.nodeName))||e.content.type._length===0,ga=({protectedNodes:e=ma,trackedOrigins:t=[],undoManager:n=null}={})=>new M({key:fi,state:{init:(r,i)=>{let a=U.getState(i),o=n||new Qt(a.type,{trackedOrigins:new Set([U].concat(t)),deleteFilter:t=>ha(t,e),captureTransaction:e=>e.meta.get(`addToHistory`)!==!1});return{undoManager:o,prevSel:null,hasUndoOps:o.undoStack.length>0,hasRedoOps:o.redoStack.length>0}},apply:(e,t,n,r)=>{let i=U.getState(r).binding,a=t.undoManager,o=a.undoStack.length>0,s=a.redoStack.length>0;return i?{undoManager:a,prevSel:Ci(i,n),hasUndoOps:o,hasRedoOps:s}:o!==t.hasUndoOps||s!==t.hasRedoOps?Object.assign({},t,{hasUndoOps:a.undoStack.length>0,hasRedoOps:a.redoStack.length>0}):t}},view:e=>{let t=U.getState(e.state),n=fi.getState(e.state).undoManager;return n.on(`stack-item-added`,({stackItem:n})=>{let r=t.binding;r&&n.meta.set(r,fi.getState(e.state).prevSel)}),n.on(`stack-item-popped`,({stackItem:e})=>{let n=t.binding;n&&(n.beforeTransactionSelection=e.meta.get(n)||n.beforeTransactionSelection)}),{destroy:()=>{n.destroy()}}}}),_a=new Map,va=new Set;function ya(){for(let e of va)e()}function ba(e,t,n){_a.set(e,{view:t,host:n}),ya()}function xa(e,t){_a.get(e)?.view===t&&(_a.delete(e),ya())}function Sa(e){let t=_a.get(e);return t?.host===`sourceEditor`?t.view:null}function Ca(e){return _a.get(e)??null}function wa(e){return va.add(e),()=>{va.delete(e)}}var Ta=new WeakMap,Ea=new WeakMap;function Da(e,t){Ta.set(e,t)}function Oa(e){return Ta.get(e)??!1}function ka(e,t){Ea.set(e,t)}function Aa(e){return Ea.get(e)??!1}function ja(e){return!Oa(e)}var Ma=`autonomousFragmentEdit/swap`;function Na(e){return e.setMeta(Ma,!0)}function Pa(e,t,n){return n===t.textContent?Na(e):e}function Fa(e){return e.getMeta(Ma)===!0}function Ia(e){return!e.getMeta(U)&&!Fa(e)}var La=/^[A-Za-z0-9]{20,}$/,Ra=/^(?:\d+s?|(?:\d+h)?(?:\d+m)?(?:\d+s)?)$/;function za(e){let t=e.toLowerCase();return t===`loom.com`||t===`www.loom.com`}function Ba(e){let t=e.pathname.match(/^\/(?:share|embed)\/([A-Za-z0-9]+)\/?$/);if(!t)return null;let n=t[1]??``;return La.test(n)?n:null}function Va(e){if(typeof e!=`string`||e.length===0)return null;let t;try{t=new URL(e)}catch{return null}if(t.protocol!==`http:`&&t.protocol!==`https:`||!za(t.hostname))return null;let n=Ba(t);if(!n)return null;let r=t.searchParams.get(`t`);return{id:n,startRaw:r&&r.length>0&&Ra.test(r)?r:null}}function Ha(e){return Va(e)!==null}function Ua(e){let t=e.toLowerCase();return t===`vimeo.com`||t===`www.vimeo.com`||t===`player.vimeo.com`}function Wa(e){if(typeof e!=`string`||e.length===0)return!1;let t;try{t=new URL(e)}catch{return!1}return t.protocol!==`http:`&&t.protocol!==`https:`?!1:Ua(t.hostname)}var Ga=/^[A-Za-z0-9_-]{11}$/;function Ka(e){let t=e.toLowerCase();return t===`youtube.com`||t===`www.youtube.com`||t===`m.youtube.com`||t===`music.youtube.com`||t===`youtu.be`||t===`youtube-nocookie.com`||t===`www.youtube-nocookie.com`}function qa(e){if(e.length===0)return null;if(/^[0-9]+$/.test(e)){let t=Number.parseInt(e,10);return t>0?t:null}let t=e.match(/^(?:([0-9]+)h)?(?:([0-9]+)m)?(?:([0-9]+)s?)?$/);if(!t)return null;let n=t[1]?Number.parseInt(t[1],10):0,r=t[2]?Number.parseInt(t[2],10):0,i=t[3]?Number.parseInt(t[3],10):0,a=n*3600+r*60+i;return a>0?a:null}function Ja(e){if(e.hostname.toLowerCase()===`youtu.be`){let t=e.pathname.replace(/^\//,``).split(`/`)[0]??``;return Ga.test(t)?t:null}if(e.pathname===`/watch`){let t=e.searchParams.get(`v`)??``;return Ga.test(t)?t:null}let t=e.pathname.match(/^\/(?:embed|shorts|v)\/([A-Za-z0-9_-]{11})\/?$/);return t?t[1]??null:null}function Ya(e){if(typeof e!=`string`||e.length===0)return null;let t;try{t=new URL(e)}catch{return null}if(t.protocol!==`http:`&&t.protocol!==`https:`||!Ka(t.hostname))return null;let n=Ja(t);if(!n)return null;let r=t.searchParams.get(`t`)??t.searchParams.get(`start`)??``;return{id:n,startSeconds:r.length>0?qa(r):null,noCookie:t.hostname.toLowerCase().endsWith(`youtube-nocookie.com`)}}function Xa(e,t){let n=Array.isArray(e.attrs.attributes)?e.attrs.attributes.filter(e=>typeof e==`object`&&!!e&&`type`in e):[],r=e.attrs.props??{},i=new Map,a=new Set;if(t)for(let e of t)e.omitOnDefault===!0&&`defaultValue`in e&&e.defaultValue!==void 0&&i.set(e.name,e.defaultValue),e.type===`string`&&e.required===!1&&e.defaultValue===void 0&&a.add(e.name);for(let[e,t]of Object.entries(r)){let r=n.findIndex(t=>t.type===`mdxJsxAttribute`&&t.name===e);if(i.has(e)&&Object.is(i.get(e),t)){r>=0&&n.splice(r,1);continue}if(a.has(e)&&t===``){r>=0&&n.splice(r,1);continue}if(r>=0){let e=n[r];if(e.type===`mdxJsxAttribute`&&e.value!=null&&typeof e.value==`object`&&e.value.type===`mdxJsxAttributeValueExpression`&&Za(e.value.value,t))continue}let o=Qa(e,t);r>=0?n[r]=o:n.push(o)}return n}function Za(e,t){try{return JSON.stringify(JSON.parse(e))===JSON.stringify(t)}catch{return!1}}function Qa(e,t){if(t===!0)return{type:`mdxJsxAttribute`,name:e,value:null};if(t===!1)return{type:`mdxJsxAttribute`,name:e,value:{type:`mdxJsxAttributeValueExpression`,value:`false`}};if(t==null)return{type:`mdxJsxAttribute`,name:e,value:null};if(typeof t==`string`)return{type:`mdxJsxAttribute`,name:e,value:t};if(typeof t==`number`)return{type:`mdxJsxAttribute`,name:e,value:{type:`mdxJsxAttributeValueExpression`,value:JSON.stringify(t)}};if(typeof t==`object`){let n;try{n=JSON.stringify(t)}catch{n=String(t)}return{type:`mdxJsxAttribute`,name:e,value:{type:`mdxJsxAttributeValueExpression`,value:n}}}return{type:`mdxJsxAttribute`,name:e,value:String(t)}}function $a(e,t,n,r){return{type:`mdxJsxFlowElement`,name:e,attributes:Xa(t,r),children:n.all(t),data:{}}}function eo(e,t,n){let r=t.attrs.props?.children;return{type:`mdxJsxTextElement`,name:e,attributes:Xa(t,n),children:typeof r==`string`&&r!==``?[{type:`text`,value:r}]:[],data:{}}}var to=[{name:`type`,type:`enum`,enumValues:[`note`,`tip`,`important`,`warning`,`caution`,`abstract`,`info`,`todo`,`success`,`question`,`failure`,`danger`,`bug`,`example`,`quote`],defaultValue:`note`,required:!1,description:`Callout variant`},{name:`title`,type:`string`,required:!1,description:`Optional heading shown above the body`},{name:`icon`,type:`string`,required:!1,advanced:!0,description:"Custom lucide icon override (e.g. `lucide:Lightbulb`)",iconPicker:!0},{name:`color`,type:`string`,required:!1,advanced:!0,description:"Optional accent color override (hex — e.g. `#F05032`)",colorPicker:!0},{name:`collapsible`,type:`boolean`,required:!1,defaultValue:!1,advanced:!0,description:"Render as a foldable `<details>` (Obsidian `[!TYPE]+/-`)"},{name:`defaultOpen`,type:`boolean`,required:!1,defaultValue:!0,advanced:!0,description:`When collapsible, start in the open state`,hideWhen:e=>e.collapsible!==!0},{name:`children`,type:`reactnode`,required:!0,description:`Callout content`}],no=[{name:`src`,type:`string`,required:!0,defaultValue:``,description:`Image source URL`,accept:x,autoFocus:!0},{name:`alt`,type:`string`,required:!0,description:`Alt text`},{name:`width`,type:`number`,required:!1,advanced:!0,description:`Image width`},{name:`height`,type:`number`,required:!1,advanced:!0,description:`Image height`},{name:`srcset`,type:`string`,required:!1,advanced:!0,description:`Responsive image candidate set (e.g. "x.png 1x, y.png 2x")`},{name:`sizes`,type:`string`,required:!1,advanced:!0,description:`Responsive image sizes hint paired with srcset`},{name:`loading`,type:`enum`,enumValues:[`eager`,`lazy`],defaultValue:`lazy`,required:!1,advanced:!0,omitOnDefault:!0,description:`Native img loading strategy (defaults to lazy)`},{name:`title`,type:`string`,required:!1,advanced:!0,description:`Native HTML title attribute (tooltip)`},{name:`decoding`,type:`enum`,enumValues:[`sync`,`async`,`auto`],defaultValue:`auto`,required:!1,advanced:!0,omitOnDefault:!0,description:`Hint for how the browser should decode the image`},{name:`fetchpriority`,type:`enum`,enumValues:[`high`,`low`,`auto`],defaultValue:`auto`,required:!1,advanced:!0,omitOnDefault:!0,description:`Resource fetch priority hint`},{name:`crossorigin`,type:`enum`,enumValues:[`anonymous`,`use-credentials`],required:!1,advanced:!0,description:`CORS mode for the image fetch`},{name:`referrerpolicy`,type:`string`,required:!1,advanced:!0,description:`Referrer policy for the image fetch (HTML referrerpolicy values)`},{name:`align`,type:`enum`,enumValues:[`center`,`left`,`right`],defaultValue:`center`,required:!1,omitOnDefault:!0,description:`Alignment within the column`,hidden:!0}],ro=[{name:`src`,type:`string`,required:!0,defaultValue:``,description:`Embedded page URL (must start with http:// or https://)`,autoFocus:!0},{name:`title`,type:`string`,required:!1,description:`Iframe title (accessible label for screen readers)`},{name:`width`,type:`string`,required:!1,advanced:!0,description:`Embed width as a CSS length (e.g. "100%", "640px")`,cssLengthInput:!0},{name:`height`,type:`string`,required:!1,advanced:!0,description:`Embed height as a CSS length (e.g. "26rem", "480px")`,cssLengthInput:!0},{name:`align`,type:`enum`,enumValues:[`center`,`left`,`right`],defaultValue:`center`,required:!1,omitOnDefault:!0,description:`Alignment within the column`,hidden:!0}],io=[{name:`src`,type:`string`,required:!0,defaultValue:``,description:`Video source URL`,accept:y,autoFocus:!0},{name:`controls`,type:`boolean`,required:!1,defaultValue:!0,advanced:!0,omitOnDefault:!0,description:`Show native HTML5 video controls (defaults to true)`,hideWhen:e=>typeof e.src==`string`&&(Wa(e.src)||Ha(e.src))},{name:`autoplay`,type:`boolean`,required:!1,advanced:!0,description:`Begin playback as soon as possible (usually requires muted)`},{name:`poster`,type:`string`,required:!1,advanced:!0,description:`Poster image URL shown before playback`,accept:x,hideWhen:e=>typeof e.src==`string`&&(Wa(e.src)||Ha(e.src))},{name:`width`,type:`number`,required:!1,advanced:!0,description:`Video width`},{name:`height`,type:`number`,required:!1,advanced:!0,description:`Video height`},{name:`title`,type:`string`,required:!1,advanced:!0,description:`Native HTML title attribute (tooltip)`},{name:`muted`,type:`boolean`,required:!1,advanced:!0,description:`Mute audio on load`},{name:`loop`,type:`boolean`,required:!1,advanced:!0,description:`Restart from the beginning when playback ends`,hideWhen:e=>typeof e.src==`string`&&Ha(e.src)},{name:`playsinline`,type:`boolean`,required:!1,advanced:!0,description:`Play inline on iOS rather than entering fullscreen`,hideWhen:e=>typeof e.src==`string`&&(Wa(e.src)||Ha(e.src))},{name:`preload`,type:`enum`,enumValues:[`none`,`metadata`,`auto`],required:!1,advanced:!0,description:`Hint for how much of the video to preload`,hideWhen:e=>typeof e.src==`string`&&(Ya(e.src)!==null||Wa(e.src)||Ha(e.src))},{name:`align`,type:`enum`,enumValues:[`center`,`left`,`right`],defaultValue:`center`,required:!1,omitOnDefault:!0,description:`Alignment within the column`,hidden:!0}],ao=[{name:`src`,type:`string`,required:!0,defaultValue:``,description:`Audio source URL`,accept:w,autoFocus:!0},{name:`controls`,type:`boolean`,required:!1,defaultValue:!0,advanced:!0,omitOnDefault:!0,description:`Show native HTML5 audio controls (defaults to true)`},{name:`autoplay`,type:`boolean`,required:!1,advanced:!0,description:`Begin playback as soon as possible (usually requires muted)`},{name:`title`,type:`string`,required:!1,advanced:!0,description:`Native HTML title attribute (tooltip)`},{name:`muted`,type:`boolean`,required:!1,advanced:!0,description:`Mute audio on load`},{name:`loop`,type:`boolean`,required:!1,advanced:!0,description:`Restart from the beginning when playback ends`},{name:`preload`,type:`enum`,enumValues:[`none`,`metadata`,`auto`],required:!1,advanced:!0,description:`Hint for how much of the audio to preload`}],oo=[{name:`title`,type:`string`,required:!0,description:`Heading shown inside the <summary>`},{name:`defaultOpen`,type:`boolean`,required:!1,defaultValue:!1,description:`When true, the block renders expanded on initial load`},{name:`icon`,type:`string`,required:!1,advanced:!0,description:"Custom lucide icon override (e.g. `lucide:Rocket`)",iconPicker:!0},{name:`description`,type:`string`,required:!1,advanced:!0,description:`Optional subtitle rendered below the title inside <summary>`},{name:`id`,type:`string`,required:!1,advanced:!0,description:"HTML id attribute for deep-linking (e.g. `#advanced-options`)"},{name:`name`,type:`string`,required:!1,advanced:!0,description:`HTML5 <details name=> group — siblings with the same name are mutually exclusive`}],so=[to[0],to[1],to[4],to[5],to[6]],co=[no[0],no[1],no[7]],lo=[oo[0],oo[1],oo[4],oo[5]],uo=[{name:`align`,type:`enum`,enumValues:[`center`,`left`,`right`,`justify`],required:!1,defaultValue:`center`,description:"Block alignment from the `<div align>` attribute."},{name:`tag`,type:`string`,required:!1,defaultValue:`div`,hidden:!0,description:`Source wrapper tag (div or center).`},{name:`sourceAttrs`,type:`string`,required:!1,defaultValue:``,hidden:!0,description:`Raw opener-tag attribute bytes preserved for round-trip.`}],fo=[{name:`alias`,type:`string`,required:!1,defaultValue:``,description:"Alt text (Obsidian alias syntax: `![[file.png|alt text]]`)"}],po=[{name:`alias`,type:`string`,required:!1,defaultValue:``,description:"Title text (Obsidian alias syntax: `![[clip.mp4|title]]`)"}],mo=[{name:`alias`,type:`string`,required:!1,defaultValue:``,description:"Title text (Obsidian alias syntax: `![[song.mp3|title]]`)"}],ho=[{name:`id`,type:`string`,required:!1,advanced:!0,description:"HTML id attribute for deep-linking (e.g. `#install-tabs`)"}],go=[{name:`label`,type:`string`,required:!0,autoFocus:!0,defaultValue:`Tab`,description:`Tab strip label — shown in the clickable pill at the top`},{name:`id`,type:`string`,required:!1,advanced:!0,description:"HTML id attribute for deep-linking (e.g. `#tab-npm`)"}],_o=[{name:`formula`,type:`string`,required:!0,autoFocus:!0,language:`latex`,description:`LaTeX math source (rendered with KaTeX in the browser)`},{name:`id`,type:`string`,required:!1,advanced:!0,description:"HTML id attribute for deep-linking (e.g. `#eq-pythagoras`)"},{name:`language`,type:`string`,required:!1,advanced:!0,description:"Forward-compat hint for the math source language (default `latex`). Reserved for future MathJax / Typst / AsciiMath substrates."}],vo=[_o[0]],yo=[_o[0]],bo=[{name:`chart`,type:`string`,required:!0,hidden:!0,description:`Mermaid chart source (graph / flowchart / sequenceDiagram / class / state / etc.)`}],xo=[{name:`alias`,type:`string`,required:!1,defaultValue:``,description:"Display name override (Obsidian alias syntax: `![[file.zip|label]]`)"}],So=[{name:`src`,type:`string`,required:!0,defaultValue:``,description:`File URL`,accept:[`*/*`],autoFocus:!0}],Co=[{name:`src`,type:`string`,required:!0,defaultValue:``,description:`PDF source URL`,accept:C,autoFocus:!0},{name:`title`,type:`string`,required:!1,advanced:!0,description:`Accessible label for the embedded PDF viewer`},{name:`anchor`,type:`string`,required:!1,advanced:!0,description:"PDF viewer parameters as a single URL-fragment string (e.g. `page=3&height=600`)"}],wo=[{name:`src`,type:`string`,required:!0,description:"Path to the `.excalidraw` board this embed renders",autoFocus:!0},{name:`title`,type:`string`,required:!1,advanced:!0,description:`Accessible label for the embedded board`}],To=[{name:`src`,type:`string`,required:!0,description:"Path of the source doc, extension-less (e.g. `api-spec`).",autoFocus:!0},{name:`anchor`,type:`string`,required:!0,description:"Id of the `<MirrorSource>` block within the source doc."}],Eo=[{name:`id`,type:`string`,required:!0,description:"Stable id agents and authors use to reference this block from `<Mirror>` elsewhere.",autoFocus:!0},{name:`children`,type:`reactnode`,required:!0,description:`Block content this MirrorSource owns — paragraphs, callouts, code, nested JSX, anything.`}];function Do(e){return e.replace(/&/g,`&amp;`).replace(/"/g,`&quot;`).replace(/</g,`&lt;`).replace(/>/g,`&gt;`)}function Oo(e){return e.replace(/&/g,`&amp;`).replace(/</g,`&lt;`).replace(/>/g,`&gt;`)}function ko(e){let t=e.attrs.props,n=t?.target??``,r=typeof t?.alias==`string`&&t.alias.length>0?t.alias:null,i=typeof t?.anchor==`string`&&t.anchor.length>0?t.anchor:null,a=typeof t?.sourceTarget==`string`?t.sourceTarget:null,o=typeof t?.sourceAnchor==`string`?t.sourceAnchor:null,s=typeof t?.sourceAlias==`string`?t.sourceAlias:null,c=r??(i?`${n}#${i}`:n);return{type:`wikiLinkEmbed`,value:c,data:{target:n,anchor:i,alias:r,sourceTarget:a,sourceAnchor:o,sourceAlias:s},children:[{type:`text`,value:c}]}}var Ao=[{name:`Callout`,surface:`canonical`,hasChildren:!0,props:to,icon:`MessageSquareWarning`,category:`content`,displayName:`Callout`,description:`Alert / admonition with 15 type variants — 5 GFM (note, tip, important, warning, caution) plus 10 Obsidian-parity (abstract, info, todo, success, question, failure, danger, bug, example, quote)`,searchTerms:[`note`,`tip`,`important`,`warning`,`caution`,`abstract`,`info`,`todo`,`success`,`question`,`failure`,`danger`,`bug`,`example`,`quote`,`alert`,`admonition`,`callout`],serialize:(e,t)=>$a(`Callout`,e,t,to)},{name:`img`,surface:`canonical`,hasChildren:!1,isSelfClosing:!0,props:no,icon:`Image`,category:`media`,displayName:`Image`,description:`Image with click-to-zoom and HTML-native attributes`,searchTerms:[`image`,`zoom`,`picture`,`photo`],placeholder:{label:`Add an image`},serialize:(e,t)=>$a(`img`,e,t,no)},{name:`video`,surface:`canonical`,hasChildren:!1,isSelfClosing:!0,props:io,icon:`SquarePlay`,category:`media`,displayName:`Video`,description:`HTML5 video player with native controls`,searchTerms:[`video`,`media`,`player`,`mp4`,`webm`,`movie`],placeholder:{label:`Add a video`},serialize:(e,t)=>$a(`video`,e,t,io)},{name:`audio`,surface:`canonical`,hasChildren:!1,isSelfClosing:!0,props:ao,icon:`Volume2`,category:`media`,displayName:`Audio`,description:`HTML5 audio player with native controls`,searchTerms:[`audio`,`sound`,`music`,`mp3`,`podcast`,`player`],placeholder:{label:`Add audio`},serialize:(e,t)=>$a(`audio`,e,t,ao)},{name:`Pdf`,surface:`canonical`,hasChildren:!1,isSelfClosing:!0,props:Co,icon:`FileText`,category:`media`,displayName:`PDF`,description:"Embedded PDF viewer (`#page=N` to open at page N, `#height=N` for viewer height)",searchTerms:[`pdf`,`document`,`embed`,`pdfjs`],placeholder:{label:`Add a PDF`},serialize:(e,t)=>$a(`Pdf`,e,t,Co)},{name:`Excalidraw`,surface:`canonical`,hasChildren:!1,isSelfClosing:!0,props:wo,icon:`PenTool`,category:`embed`,displayName:`Excalidraw`,description:"Embedded snapshot of an `.excalidraw` board, linking to its canvas editor",searchTerms:[`excalidraw`,`board`,`whiteboard`,`sketch`,`drawing`,`canvas`],serialize:(e,t)=>$a(`Excalidraw`,e,t,wo)},{name:`File`,surface:`canonical`,hasChildren:!1,isSelfClosing:!0,props:So,icon:`Paperclip`,category:`media`,displayName:`File`,description:`Downloadable file attachment — inline row with name + size + download link`,searchTerms:[`file`,`attachment`,`download`,`document`,`zip`,`docx`,`doc`],placeholder:{label:`Add a file`},serialize:(e,t)=>$a(`File`,e,t,So)},{name:`Embed`,surface:`canonical`,hasChildren:!1,isSelfClosing:!0,props:ro,icon:`AppWindow`,category:`embed`,displayName:`Embed`,description:'Inline web embed (iframe) — drop a URL, get a resizable preview pane. For YouTube / Vimeo / Loom prefer `<video src="…">` (player props, click-facade); `<Embed>` auto-rewrites watch URLs as a fallback.',searchTerms:[`embed`,`iframe`,`website`,`page`,`inline`,`frame`,`preview`],placeholder:{label:`Embed a URL`},serialize:(e,t)=>$a(`Embed`,e,t,ro)},{name:`Accordion`,surface:`canonical`,hasChildren:!0,props:oo,icon:`ChevronRight`,category:`content`,displayName:`Accordion`,description:"Standalone expand/collapse via native HTML5 <details>/<summary>. Group siblings with the `name` prop for exclusive-accordion UX.",searchTerms:[`accordion`,`expandable`,`details`,`disclosure`,`collapse`,`fold`],exampleBody:`Body content revealed when the accordion is expanded.`,serialize:(e,t)=>$a(`Accordion`,e,t,oo)},{name:`Toggle`,surface:`canonical`,hasChildren:!0,props:oo,icon:`ChevronRight`,category:`content`,displayName:`Toggle`,description:"Standalone expand/collapse block (Notion-style). Same render + props as `<Accordion>` — pick whichever vocabulary matches the vault.",searchTerms:[`toggle`,`collapsible`,`expand`,`details`,`disclosure`,`fold`],exampleBody:`Body content revealed when the toggle is expanded.`,serialize:(e,t)=>$a(`Toggle`,e,t,oo)},{name:`Tabs`,surface:`canonical`,hasChildren:!0,emptyChildName:`Tab`,props:ho,icon:`LayoutPanelTop`,category:`content`,displayName:`Tabs`,description:"Horizontal tab strip + active panel below. Each `<Tab>` child is one panel; clickable pills at the top switch the active one. Active selection is ephemeral (resets on reload).",searchTerms:[`tabs`,`tabbed`,`panels`,`tabgroup`,`switcher`],exampleBody:`<Tab label="One">Body of the first tab panel.</Tab>
2
+ import{o as e}from"./chunk-CYidjpOJ.js";import{t}from"./preload-helper-Chd9yIcd.js";import{t as n}from"./jsx-runtime-BUgB2tll.js";import{t as r}from"./react-f2sANaYj.js";import{r as i}from"./dist-Nvb76hAm.js";import{n as a}from"./dist-PQ5KMVDh.js";import{t as o}from"./react-dom-DPxgxlDT.js";import{t as s}from"./compiler-runtime-BfE3aGVn.js";import{n as c,t as l}from"./with-selector-zVo3Fruj.js";import{a as u,d,i as f,l as p,r as m,u as h}from"./floating-ui.dom-DkPPH5vF.js";import{a as g,d as _,g as v,i as y,l as b,n as x,o as S,r as C,t as w,u as T}from"./constants-upload-CVKO8P4d.js";import{$ as ee,A as E,B as te,C as ne,F as re,G as ie,K as D,L as O,N as ae,P as oe,Q as se,R as ce,S as le,T as ue,U as de,V as fe,W as pe,X as me,Y as he,_ as ge,a as _e,at as k,b as ve,bt as A,c as ye,ct as j,d as be,et as xe,f as Se,g as Ce,gt as we,h as Te,ht as Ee,it as M,k as N,l as De,mt as Oe,n as P,nt as ke,o as F,ot as Ae,p as je,q as Me,r as Ne,rt as Pe,s as Fe,st as Ie,t as Le,tt as Re,u as ze,ut as Be,v as Ve,vt as I,w as He,x as Ue,y as We,z as L}from"./dist-Dc8tD1th.js";import{t as Ge}from"./dist-C_FzPxEX2.js";import{C as Ke,a as qe,g as Je,w as Ye}from"./schemas-api-BbYGQuTW.js";import{t as Xe}from"./util-doc-name-D-_o-n0R.js";import{n as Ze}from"./_envelope-Dwl6i2K9-DPqJ_Q4W.js";import{t as Qe}from"./note-window-mode-CI3Yju9B.js";import{i as $e}from"./use-apply-config-theme-CYFG76sS.js";import{t as et}from"./createLucideIcon-DdBzwsHe.js";import{t as tt}from"./folder-open-COGOeTzI.js";import{t as nt}from"./trash-2-CchZ0T47.js";import{n as rt,r as it}from"./structural-freshness-CIbkMFA3-CWi_lyiW.js";import{c as at,d as ot,l as st}from"./doc-hash-BJkweiX9.js";import{_ as ct,b as lt,d as ut,f as dt,g as ft,h as pt,j as mt,k as ht,o as gt,p as _t,v as vt,w as yt,x as bt}from"./navigation-targets-DTSxcGor.js";import{t as xt}from"./doc-paths-cEiFVCxr.js";import{$ as St,A as Ct,B as wt,C as Tt,E as Et,G as Dt,I as Ot,J as kt,K as At,M as jt,N as Mt,P as Nt,Q as Pt,R as Ft,S as It,T as Lt,W as Rt,X as zt,_ as Bt,at as Vt,b as Ht,c as Ut,d as Wt,et as Gt,f as Kt,g as qt,h as Jt,it as Yt,j as Xt,l as Zt,m as Qt,nt as $t,ot as en,p as tn,q as nn,s as rn,tt as an,u as on,w as sn,x as cn,y as ln,z as un}from"./config-provider-2W1hFFiT.js";import{At as dn,Ct as fn,E as pn,F as mn,G as hn,I as R,J as gn,K as _n,M as vn,Mt as yn,Nt as bn,P as z,Tt as xn,X as Sn,a as Cn,c as wn,f as Tn,l as En,lt as Dn,o as On,r as kn,t as An,ut as jn}from"./dist-D2SphF3p.js";import{A as Mn,C as Nn,E as Pn,H as Fn,I as In,L as Ln,M as Rn,N as zn,O as Bn,P as Vn,R as B,S as Hn,T as Un,_ as Wn,a as Gn,b as Kn,c as qn,h as Jn,k as Yn,m as Xn,o as Zn,t as Qn,x as $n,y as er,z as tr}from"./lib-QQS1Brzc.js";import{t as nr}from"./ccount-BoHE53_k.js";import{n as rr,r as ir}from"./lib-DlDYgFfS.js";import{c as ar,f as or,n as sr,r as cr,t as lr,u as ur}from"./trim-lines-DfV8CCf7.js";import{u as dr}from"./space-separated-tokens-l9yufOSK.js";import{n as fr,t as pr}from"./syntax-CKL08zSk.js";import{n as mr,r as hr,t as gr}from"./cm-theme-Cvtw80TE.js";import{i as _r,n as vr}from"./page-list-cache-BNFVKu-D.js";import{t as yr}from"./documents-fetch-Y7Dt9_Tn.js";import{i as br,n as xr,r as Sr,t as Cr}from"./dist-DseqKdAU.js";import{n as wr,r as Tr,t as Er}from"./dist-BxTTaZ5o.js";import{t as Dr}from"./dist-CjyZozAk.js";import{n as Or}from"./dist-C2Kstufe.js";import{n as kr}from"./dist-BvhrN0Uj.js";import{n as Ar}from"./dist-D5mDCusD.js";import{i as jr,n as Mr,r as Nr}from"./dist-BpU-J2LR.js";import{n as Pr}from"./dist-BkE9d74i.js";import{t as Fr}from"./stex-CUzil_LB.js";import{n as Ir,r as Lr}from"./external-link-CldCnbtR.js";var Rr=et(`file-plus-corner`,[[`path`,{d:`M11.35 22H6a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.706.706l3.588 3.588A2.4 2.4 0 0 1 20 8v5.35`,key:`17jvcc`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M14 19h6`,key:`bvotb8`}],[`path`,{d:`M17 16v6`,key:`18yu1i`}]]),zr=et(`file-text`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M10 9H8`,key:`b1mrlr`}],[`path`,{d:`M16 13H8`,key:`t4e002`}],[`path`,{d:`M16 17H8`,key:`z1uh3a`}]]),Br=et(`film`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M7 3v18`,key:`bbkbws`}],[`path`,{d:`M3 7.5h4`,key:`zfgn84`}],[`path`,{d:`M3 12h18`,key:`1i2n21`}],[`path`,{d:`M3 16.5h4`,key:`1230mu`}],[`path`,{d:`M17 3v18`,key:`in4fa5`}],[`path`,{d:`M17 7.5h4`,key:`myr1c1`}],[`path`,{d:`M17 16.5h4`,key:`go4c1d`}]]),Vr=et(`image`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,ry:`2`,key:`1m3agn`}],[`circle`,{cx:`9`,cy:`9`,r:`2`,key:`af1f0g`}],[`path`,{d:`m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21`,key:`1xmnt7`}]]),Hr=et(`volume-2`,[[`path`,{d:`M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z`,key:`uqj9uw`}],[`path`,{d:`M16 9a5 5 0 0 1 0 6`,key:`1q6k2b`}],[`path`,{d:`M19.364 18.364a9 9 0 0 0 0-12.728`,key:`ijwkga`}]]),V=n(),H=e(r(),1),Ur=e(o(),1),Wr=s(),Gr=c();function Kr(e){return e.editorView}var qr=new Map([[32,` `],[9,` `],[160,`\xA0`]]);function Jr(e){let t=/^&#(x[0-9A-Fa-f]+|X[0-9A-Fa-f]+|[0-9]+);$/.exec(e);if(!t)return null;let n=t[1],r=n[0]===`x`||n[0]===`X`,i=Number.parseInt(r?n.slice(1):n,r?16:10);return Number.isNaN(i)?null:i}function Yr(e){let t=Jr(e);return t!==null&&qr.has(t)}function Xr(e){let t=Jr(e);return t===null?null:qr.get(t)??null}var Zr=/&#(?:x[0-9A-Fa-f]+|X[0-9A-Fa-f]+|[0-9]+);/g;function Qr(e){Zr.lastIndex=0;let t=e.match(Zr);if(t===null||t.join(``)!==e)return null;let n=``;for(let e of t){let t=Xr(e);if(t===null)return null;n+=t}return n}var $r=()=>{let e=!0;return(t,n)=>{if(e){e=!1;try{t()}finally{e=!0}}else n!==void 0&&n()}},ei=/[\uD800-\uDBFF]/,ti=/[\uDC00-\uDFFF]/,ni=(e,t)=>{let n=0,r=0;for(;n<e.length&&n<t.length&&e[n]===t[n];)n++;for(n>0&&ei.test(e[n-1])&&n--;r+n<e.length&&r+n<t.length&&e[e.length-r-1]===t[t.length-r-1];)r++;return r>0&&ti.test(e[e.length-r])&&r--,{index:n,remove:e.length-n-r,insert:t.slice(n,t.length-r)}},ri=(e,t)=>e>>>t|e<<32-t,ii=e=>ri(e,2)^ri(e,13)^ri(e,22),ai=e=>ri(e,6)^ri(e,11)^ri(e,25),oi=e=>ri(e,7)^ri(e,18)^e>>>3,si=e=>ri(e,17)^ri(e,19)^e>>>10,ci=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),li=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),ui=class{constructor(){let e=new ArrayBuffer(320);this._H=new Uint32Array(e,0,8),this._H.set(li),this._W=new Uint32Array(e,64,64)}_updateHash(){let e=this._H,t=this._W;for(let e=16;e<64;e++)t[e]=si(t[e-2])+t[e-7]+oi(t[e-15])+t[e-16];let n=e[0],r=e[1],i=e[2],a=e[3],o=e[4],s=e[5],c=e[6],l=e[7];for(let e=0,u,d;e<64;e++)u=l+ai(o)+(o&s^~o&c)+ci[e]+t[e]>>>0,d=ii(n)+(n&r^n&i^r&i)>>>0,l=c,c=s,s=o,o=a+u>>>0,a=i,i=r,r=n,n=u+d>>>0;e[0]+=n,e[1]+=r,e[2]+=i,e[3]+=a,e[4]+=o,e[5]+=s,e[6]+=c,e[7]+=l}digest(e){let t=0;for(;t+56<=e.length;){let n=0;for(;n<16&&t+3<e.length;n++)this._W[n]=e[t++]<<24|e[t++]<<16|e[t++]<<8|e[t++];if(t%64!=0){for(this._W.fill(0,n,16);t<e.length;)this._W[n]|=e[t]<<(3-t%4)*8,t++;this._W[n]|=128<<(3-t%4)*8}this._updateHash()}let n=t%64!=0;this._W.fill(0,0,16);let r=0;for(;t<e.length;r++)for(let n=3;n>=0&&t<e.length;n--)this._W[r]|=e[t++]<<n*8;n||(this._W[r-(t%4==0?0:1)]|=128<<(3-t%4)*8),this._W[14]=e.byteLength/Gt,this._W[15]=e.byteLength*8,this._updateHash();let i=new Uint8Array(32);for(let e=0;e<this._H.length;e++)for(let t=0;t<4;t++)i[e*4+t]=this._H[e]>>>(3-t)*8;return i}},di=e=>new ui().digest(e),U=new k(`y-sync`),fi=new k(`y-undo`),pi=new k(`yjs-cursor`),mi=e=>{for(let t=6;t<e.length;t++)e[t%6]=e[t%6]^e[t];return e.slice(0,6)},hi=e=>Dt(mi(di(Rt(e)))),gi=()=>({mapping:new Map,isOMark:new Map}),_i=(e,t)=>t===void 0?!e.deleted:t.sv.has(e.id.client)&&t.sv.get(e.id.client)>e.id.clock&&!jt(t.ds,e.id),vi=[{light:`#ecd44433`,dark:`#ecd444`}],yi=(e,t,n)=>{if(!e.has(n)){if(e.size<t.length){let n=Yt();e.forEach(e=>n.add(e)),t=t.filter(e=>!n.has(e))}e.set(n,zt(t))}return e.get(n)},bi=(e,{colors:t=vi,colorMapping:n=new Map,permanentUserData:r=null,onFirstRender:i=()=>{},mapping:a}={})=>{let o=!1,s=new wi(e,a),c=new M({props:{editable:e=>{let t=U.getState(e);return t.snapshot==null&&t.prevSnapshot==null}},key:U,state:{init:(i,a)=>({type:e,doc:e.doc,binding:s,snapshot:null,prevSnapshot:null,isChangeOrigin:!1,isUndoRedoOperation:!1,addToHistory:!0,colors:t,colorMapping:n,permanentUserData:r}),apply:(e,t)=>{let n=e.getMeta(U);if(n!==void 0){t=Object.assign({},t);for(let e in n)t[e]=n[e]}return t.addToHistory=e.getMeta(`addToHistory`)!==!1,t.isChangeOrigin=n!==void 0&&!!n.isChangeOrigin,t.isUndoRedoOperation=n!==void 0&&!!n.isChangeOrigin&&!!n.isUndoRedoOperation,s.prosemirrorView!==null&&n!==void 0&&(n.snapshot!=null||n.prevSnapshot!=null)&&un(0,()=>{s.prosemirrorView!=null&&(n.restore==null?s._renderSnapshot(n.snapshot,n.prevSnapshot,t):(s._renderSnapshot(n.snapshot,n.snapshot,t),delete t.restore,delete t.snapshot,delete t.prevSnapshot,s.mux(()=>{s._prosemirrorChanged(s.prosemirrorView.state.doc)})))}),t}},view:e=>(s.initView(e),a??s._forceRerender(),i(),{update:()=>{let t=c.getState(e.state);if(t.snapshot==null&&t.prevSnapshot==null&&(o||e.state.doc.content.findDiffStart(e.state.doc.type.createAndFill().content)!==null)){if(o=!0,t.addToHistory===!1&&!t.isChangeOrigin){let t=fi.getState(e.state),n=t&&t.undoManager;n&&n.stopCapturing()}s.mux(()=>{t.doc.transact(n=>{n.meta.set(`addToHistory`,t.addToHistory),s._prosemirrorChanged(e.state.doc)},U)})}},destroy:()=>{s.destroy()}})});return c},xi=(e,t,n)=>{if(t!==null&&t.anchor!==null&&t.head!==null)if(t.type===`all`)e.setSelection(new ke(e.doc));else if(t.type===`node`){let r=na(n.doc,n.type,t.anchor,n.mapping);e.setSelection(Si(e,r))}else{let r=na(n.doc,n.type,t.anchor,n.mapping),i=na(n.doc,n.type,t.head,n.mapping);r!==null&&i!==null&&e.setSelection(j.between(e.doc.resolve(r),e.doc.resolve(i)))}},Si=(e,t)=>{let n=e.doc.resolve(t);return n.nodeAfter?Pe.create(e.doc,t):j.near(n)},Ci=(e,t)=>({type:t.selection.jsonID,anchor:ea(t.selection.anchor,e.type,e.mapping),head:ea(t.selection.head,e.type,e.mapping)}),wi=class{constructor(e,t=new Map){this.type=e,this.prosemirrorView=null,this.mux=$r(),this.mapping=t,this.isOMark=new Map,this._observeFunction=this._typeChanged.bind(this),this.doc=e.doc,this.beforeTransactionSelection=null,this.beforeAllTransactions=()=>{this.beforeTransactionSelection===null&&this.prosemirrorView!=null&&(this.beforeTransactionSelection=Ci(this,this.prosemirrorView.state))},this.afterAllTransactions=()=>{this.beforeTransactionSelection=null},this._domSelectionInView=null}get _tr(){return this.prosemirrorView.state.tr.setMeta(`addToHistory`,!1)}_isLocalCursorInView(){return this.prosemirrorView.hasFocus()?(At&&this._domSelectionInView===null&&(un(0,()=>{this._domSelectionInView=null}),this._domSelectionInView=this._isDomSelectionInView()),this._domSelectionInView):!1}_isDomSelectionInView(){let e=this.prosemirrorView._root.getSelection();if(e==null||e.anchorNode==null)return!1;let t=this.prosemirrorView._root.createRange();t.setStart(e.anchorNode,e.anchorOffset),t.setEnd(e.focusNode,e.focusOffset),t.getClientRects().length===0&&t.startContainer&&t.collapsed&&t.selectNodeContents(t.startContainer);let n=t.getBoundingClientRect(),r=wt.documentElement;return n.bottom>=0&&n.right>=0&&n.left<=(window.innerWidth||r.clientWidth||0)&&n.top<=(window.innerHeight||r.clientHeight||0)}renderSnapshot(e,t){t||=Et(It(),new Map),this.prosemirrorView.dispatch(this._tr.setMeta(U,{snapshot:e,prevSnapshot:t}))}unrenderSnapshot(){this.mapping.clear(),this.mux(()=>{let e=this.type.toArray().map(e=>Ei(e,this.prosemirrorView.state.schema,this)).filter(e=>e!==null),t=this._tr.replace(0,this.prosemirrorView.state.doc.content.size,new A(I.from(e),0,0));t.setMeta(U,{snapshot:null,prevSnapshot:null}),this.prosemirrorView.dispatch(t)})}_forceRerender(){this.mapping.clear(),this.mux(()=>{let e=this.beforeTransactionSelection===null?this.prosemirrorView.state.selection:null,t=this.type.toArray().map(e=>Ei(e,this.prosemirrorView.state.schema,this)).filter(e=>e!==null),n=this._tr.replace(0,this.prosemirrorView.state.doc.content.size,new A(I.from(t),0,0));if(e){let t=$t(an(e.anchor,0),n.doc.content.size),r=$t(an(e.head,0),n.doc.content.size);n.setSelection(j.create(n.doc,t,r))}this.prosemirrorView.dispatch(n.setMeta(U,{isChangeOrigin:!0,binding:this}))})}_renderSnapshot(e,t,n){let r=this.doc,i=this.type;if(e||=Ot(this.doc),e instanceof Uint8Array||t instanceof Uint8Array)if((!(e instanceof Uint8Array)||!(t instanceof Uint8Array))&&St(),r=new on({gc:!1}),ln(r,t),t=Ot(r),ln(r,e),e=Ot(r),i._item===null){let e=Array.from(this.doc.share.keys()).find(e=>this.doc.share.get(e)===this.type);i=r.getXmlFragment(e)}else{let e=r.store.clients.get(i._item.id.client)??[];i=e[Ct(e,i._item.id.clock)].content.type}this.mapping.clear(),this.mux(()=>{r.transact(r=>{let a=n.permanentUserData;a&&a.dss.forEach(e=>{Nt(r,e,e=>{})});let o=(e,t)=>{let r=e===`added`?a.getUserByClientId(t.client):a.getUserByDeletedId(t);return{user:r,type:e,color:yi(n.colorMapping,n.colors,r)}},s=Ft(i,new tn(t.ds,e.sv)).map(n=>!n._item.deleted||_i(n._item,e)||_i(n._item,t)?Ei(n,this.prosemirrorView.state.schema,{mapping:new Map,isOMark:new Map},e,t,o):null).filter(e=>e!==null),c=this._tr.replace(0,this.prosemirrorView.state.doc.content.size,new A(I.from(s),0,0));this.prosemirrorView.dispatch(c.setMeta(U,{isChangeOrigin:!0}))},U)})}_typeChanged(e,t){if(this.prosemirrorView==null)return;let n=U.getState(this.prosemirrorView.state);if(e.length===0||n.snapshot!=null||n.prevSnapshot!=null){this.renderSnapshot(n.snapshot,n.prevSnapshot);return}this.mux(()=>{let e=(e,t)=>this.mapping.delete(t);Nt(t,t.deleteSet,e=>{if(e.constructor===Wt){let t=e.content.type;t&&this.mapping.delete(t)}}),t.changed.forEach(e),t.changedParentTypes.forEach(e);let n=this.type.toArray().map(e=>Ti(e,this.prosemirrorView.state.schema,this)).filter(e=>e!==null),r=this._tr.replace(0,this.prosemirrorView.state.doc.content.size,new A(I.from(n),0,0));xi(r,this.beforeTransactionSelection,this),r=r.setMeta(U,{isChangeOrigin:!0,isUndoRedoOperation:t.origin instanceof Qt}),this.beforeTransactionSelection!==null&&this._isLocalCursorInView()&&r.scrollIntoView(),this.prosemirrorView.dispatch(r)})}_prosemirrorChanged(e){this.doc.transact(()=>{qi(this.doc,this.type,e,this),this.beforeTransactionSelection=Ci(this,this.prosemirrorView.state)},U)}initView(e){this.prosemirrorView!=null&&this.destroy(),this.prosemirrorView=e,this.doc.on(`beforeAllTransactions`,this.beforeAllTransactions),this.doc.on(`afterAllTransactions`,this.afterAllTransactions),this.type.observeDeep(this._observeFunction)}destroy(){this.prosemirrorView!=null&&(this.prosemirrorView=null,this.type.unobserveDeep(this._observeFunction),this.doc.off(`beforeAllTransactions`,this.beforeAllTransactions),this.doc.off(`afterAllTransactions`,this.afterAllTransactions))}},Ti=(e,t,n,r,i,a)=>{let o=n.mapping.get(e);if(o===void 0){if(e instanceof qt)return Ei(e,t,n,r,i,a);throw Pt()}return o},Ei=(e,t,n,r,i,a)=>{let o=[],s=e=>{if(e instanceof qt){let s=Ti(e,t,n,r,i,a);s!==null&&o.push(s)}else{let s=e._item.right?.content?.type;s instanceof Jt&&!s._item.deleted&&s._item.id.client===s.doc.clientID&&(e.applyDelta([{retain:e.length},...s.toDelta()]),s.doc.transact(e=>{s._item.delete(e)}));let c=Di(e,t,n,r,i,a);c!==null&&c.forEach(e=>{e!==null&&o.push(e)})}};r===void 0||i===void 0?e.toArray().forEach(s):Ft(e,new tn(i.ds,r.sv)).forEach(s);try{let s=e.getAttributes(r);r!==void 0&&(_i(e._item,r)?_i(e._item,i)||(s.ychange=a?a(`added`,e._item.id):{type:`added`}):s.ychange=a?a(`removed`,e._item.id):{type:`removed`});let c=Ii(s),l=Gi(c.marks,t),u=t.node(e.nodeName,c.plain,o,l.length?l:void 0);return n.mapping.set(e,u),u}catch(r){console.warn(`[y-prosemirror] schema.node(`+e.nodeName+`) threw:`,String(r&&r.message||r));let i=globalThis.__okYpsCounters=globalThis.__okYpsCounters||{block:0,inline:0};if(t.nodes[e.nodeName]&&t.nodes[e.nodeName].spec&&t.nodes[e.nodeName].spec.inline)i.inline++;else if(i.block++,t.nodes.rawMdxFallback)try{let i=t.node(`rawMdxFallback`,{reason:String(r&&r.message||r)},[t.text(e.nodeName)]);return n.mapping.set(e,i),i}catch(e){console.warn(`[y-prosemirror] rawMdxFallback substitution also failed:`,String(e&&e.message||e))}return n.mapping.delete(e),null}},Di=(e,t,n,r,i,a)=>{let o=[],s=e.toDelta(r,i,a);try{for(let e=0;e<s.length;e++){let n=s[e];o.push(t.text(n.insert,Gi(n.attributes,t)))}}catch(e){console.warn(`[y-prosemirror] schema.text() threw:`,String(e&&e.message||e));let t=globalThis.__okYpsCounters=globalThis.__okYpsCounters||{block:0,inline:0};return t.inline++,null}return o},Oi=(e,t)=>{let n=new Bt,r=e.map(e=>({insert:e.text,attributes:Ki(e.marks,t)}));return n.applyDelta(r),t.mapping.set(n,e),n},ki=(e,t)=>{let n=new qt(e.type.name);for(let t in e.attrs){let r=e.attrs[t];r!==null&&t!==`ychange`&&n.setAttribute(t,r)}let r=Ki(e.marks||[],t);for(let e in r)n.setAttribute(Fi+e,{...r[e]});return n.insert(0,Ni(e).map(e=>Ai(e,t))),t.mapping.set(n,e),n},Ai=(e,t)=>e instanceof Array?Oi(e,t):ki(e,t),ji=e=>typeof e==`object`&&!!e,Mi=(e,t)=>{let n=Object.keys(e).filter(t=>e[t]!==null),r=n.length===Object.keys(t).filter(e=>t[e]!==null).length;for(let i=0;i<n.length&&r;i++){let a=n[i],o=e[a],s=t[a];r=a===`ychange`||o===s||ji(o)&&ji(s)&&Mi(o,s)}return r},Ni=e=>{let t=e.content.content,n=[];for(let e=0;e<t.length;e++){let r=t[e];if(r.isText){let r=[];for(let n=t[e];e<t.length&&n.isText;n=t[++e])r.push(n);e--,n.push(r)}else n.push(r)}return n},Pi=(e,t)=>{let n=e.toDelta();return n.length===t.length&&n.every((e,n)=>e.insert===t[n].text&&kt(e.attributes||{}).length===t[n].marks.length&&nn(e.attributes,(e,r)=>{let i=Wi(r),a=t[n].marks;return a.find(e=>e.type.name===i)?Mi(e,a.find(e=>e.type.name===i)?.attrs):!1}))},Fi=`ymark:`,Ii=e=>{let t={},n={};for(let r in e)r.startsWith(Fi)?n[r.slice(6)]=e[r]:t[r]=e[r];return{plain:t,marks:n}},Li=(e,t)=>{let n=Object.keys(e);return n.length===t.length?n.every(n=>{let r=Wi(n),i=t.find(e=>e.type.name===r);return i?Mi(e[n],i.attrs):!1}):!1},Ri=(e,t)=>{if(e instanceof qt&&!(t instanceof Array)&&Ji(e,t)){let n=Ni(t),r=Ii(e.getAttributes());return e._length===n.length&&Li(r.marks,t.marks)&&Mi(r.plain,t.attrs)&&e.toArray().every((e,t)=>Ri(e,n[t]))}return e instanceof Bt&&t instanceof Array&&Pi(e,t)},zi=(e,t)=>e===t||e instanceof Array&&t instanceof Array&&e.length===t.length&&e.every((e,n)=>t[n]===e),Bi=(e,t,n)=>{let r=e.toArray(),i=Ni(t),a=i.length,o=r.length,s=$t(o,a),c=0,l=0,u=!1;for(;c<s;c++){let e=r[c],t=i[c];if(zi(n.mapping.get(e),t))u=!0;else if(!Ri(e,t))break}for(;c+l<s;l++){let e=r[o-l-1],t=i[a-l-1];if(zi(n.mapping.get(e),t))u=!0;else if(!Ri(e,t))break}return{equalityFactor:c+l,foundMappedChild:u}},Vi=e=>{let t=``,n=e._start,r={};for(;n!==null;)n.deleted||(n.countable&&n.content instanceof Ut?t+=n.content.str:n.content instanceof rn&&(r[n.content.key]=null)),n=n.right;return{str:t,nAttrs:r}},Hi=(e,t,n)=>{n.mapping.set(e,t);let{nAttrs:r,str:i}=Vi(e),a=t.map(e=>({insert:e.text,attributes:Object.assign({},r,Ki(e.marks,n))})),{insert:o,remove:s,index:c}=ni(i,a.map(e=>e.insert).join(``));e.delete(c,s),e.insert(c,o),e.applyDelta(a.map(e=>({retain:e.insert.length,attributes:e.attributes})))},Ui=/(.*)(--[a-zA-Z0-9+/=]{8})$/,Wi=e=>Ui.exec(e)?.[1]??e,Gi=(e,t)=>{let n=[];for(let r in e)n.push(t.mark(Wi(r),e[r]));return n},Ki=(e,t)=>{let n={};return e.forEach(e=>{if(e.type.name!==`ychange`){let r=en(t.isOMark,e.type,()=>!e.type.excludes(e.type));n[r?`${e.type.name}--${hi(e.toJSON())}`:e.type.name]=e.attrs}}),n},qi=(e,t,n,r)=>{if(t instanceof qt&&t.nodeName!==n.type.name)throw Error(`node name mismatch!`);if(r.mapping.set(t,n),t instanceof qt){let e=t.getAttributes(),i=n.attrs;for(let n in i)i[n]===null?t.removeAttribute(n):e[n]!==i[n]&&n!==`ychange`&&t.setAttribute(n,i[n]);for(let n in e)i[n]===void 0&&!n.startsWith(Fi)&&t.removeAttribute(n);let a=Ki(n.marks||[],r);for(let n in a){let r=e[Fi+n];(r===void 0||!Mi(r,a[n]))&&t.setAttribute(Fi+n,{...a[n]})}for(let n in e)n.startsWith(Fi)&&a[n.slice(6)]===void 0&&t.removeAttribute(n)}let i=Ni(n),a=i.length,o=t.toArray(),s=o.length,c=$t(a,s),l=0,u=0;for(;l<c;l++){let e=o[l],t=i[l];if(!zi(r.mapping.get(e),t))if(Ri(e,t))r.mapping.set(e,t);else break}for(;u+l+1<c;u++){let e=o[s-u-1],t=i[a-u-1];if(!zi(r.mapping.get(e),t))if(Ri(e,t))r.mapping.set(e,t);else break}e.transact(()=>{for(;s-l-u>0&&a-l-u>0;){let n=o[l],c=i[l],d=o[s-u-1],f=i[a-u-1];if(n instanceof Bt&&c instanceof Array)Pi(n,c)||Hi(n,c,r),l+=1;else{let i=n instanceof qt&&Ji(n,c),a=d instanceof qt&&Ji(d,f);if(i&&a){let e=Bi(n,c,r),t=Bi(d,f,r);e.foundMappedChild&&!t.foundMappedChild?a=!1:!e.foundMappedChild&&t.foundMappedChild||e.equalityFactor<t.equalityFactor?i=!1:a=!1}i?(qi(e,n,c,r),l+=1):a?(qi(e,d,f,r),u+=1):(r.mapping.delete(t.get(l)),t.delete(l,1),t.insert(l,[Ai(c,r)]),l+=1)}}let n=s-l-u;if(s===1&&a===0&&o[0]instanceof Bt?(r.mapping.delete(o[0]),o[0].delete(0,o[0].length)):n>0&&(t.slice(l,l+n).forEach(e=>r.mapping.delete(e)),t.delete(l,n)),l+u<a){let e=[];for(let t=l;t<a-u;t++)e.push(Ai(i[t],r));t.insert(l,e)}},U)},Ji=(e,t)=>!(t instanceof Array)&&e.nodeName===t.type.name,Yi=null,Xi=class{constructor(e,t,n){this.view=e,this.key=t,this.value=n}apply(){let e=U.getState(this.view.state);if(e&&e.binding&&!e.binding.isDestroyed){let e=this.view.state.tr;e.setMeta(this.key,this.value),this.view.dispatch(e)}}},Zi=class e{constructor(e=[]){this.entries=e}getFirst(){return this.entries[0]}dequeueFirst(){return this.entries.shift()}isEmpty(){return this.entries.length===0}static fromViewsToUpdate(){let t=Yi;Yi=null;let n=[];return t.forEach((e,t)=>{e.forEach((e,r)=>{n.push(new Xi(t,r,e))})}),new e(n)}},Qi=(e=Zi.fromViewsToUpdate(),t=!1)=>{let n=!0;for(;!e.isEmpty();){let r=e.getFirst();try{r.apply()}catch(r){if(r instanceof RangeError){t&&n&&e.dequeueFirst(),e.isEmpty()||un(0,()=>Qi(e,!0));return}throw r}n=!1,e.dequeueFirst()}},$i=(e,t,n)=>{Yi||(Yi=new Map,un(0,Qi)),en(Yi,e,Vt).set(t,n)},ea=(e,t,n)=>{if(e===0)return Lt(t,0,-1);let r=t._first===null?null:t._first.content.type;for(;r!==null&&t!==r;){if(r instanceof Bt){if(r._length>=e)return Lt(r,e,-1);if(e-=r._length,r._item!==null&&r._item.next!==null)r=r._item.next.content.type;else{do r=r._item===null?null:r._item.parent,e--;while(r!==t&&r!==null&&r._item!==null&&r._item.next===null);r!==null&&r!==t&&(r=r._item===null?null:r._item.next.content.type)}}else{let i=(n.get(r)||{nodeSize:0}).nodeSize;if(r._first!==null&&e<i)r=r._first.content.type,e--;else{if(e===1&&r._length===0&&i>1)return new Kt(r._item===null?null:r._item.id,r._item===null?Xt(r):null,null);if(e-=i,r._item!==null&&r._item.next!==null)r=r._item.next.content.type;else{if(e===0)return r=r._item===null?r:r._item.parent,new Kt(r._item===null?null:r._item.id,r._item===null?Xt(r):null,null);do r=r._item.parent,e--;while(r!==t&&r._item.next===null);r!==t&&(r=r._item.next.content.type)}}}if(r===null)throw St();if(e===0&&r.constructor!==Bt&&r!==t)return ta(r._item.parent,r._item)}return Lt(t,t._length,-1)},ta=(e,t)=>{let n=null,r=null;return e._item===null?r=Xt(e):n=Tt(e._item.id.client,e._item.id.clock),new Kt(n,r,t.id)},na=(e,t,n,r)=>{let i=cn(n,e);if(i===null||i.type!==t&&!Mt(t,i.type._item))return null;let a=i.type,o=0;if(a.constructor===Bt)o=i.index;else if(a._item===null||!a._item.deleted){let e=a._first,t=0;for(;t<a._length&&t<i.index&&e!==null;){if(!e.deleted){let n=e.content.type;if(t++,n instanceof Bt)o+=n._length;else{let e=r.get(n);if(e==null)return null;o+=e.nodeSize}}e=e.right}o+=1}for(;a!==t&&a._item!==null;){let e=a._item.parent;if(e._item===null||!e._item.deleted){o+=1;let t=e._first;for(;t!==null;){let e=t.content.type;if(e===a)break;if(!t.deleted)if(e instanceof Bt)o+=e._length;else{let t=r.get(e);if(t==null)return null;o+=t.nodeSize}t=t.right}}a=e}return o-1},ra=(e,t)=>{let n=e.toArray().map(e=>Ei(e,t,gi())).filter(e=>e!==null);return I.fromArray(n)},ia=(e,t)=>t.topNodeType.create(null,ra(e,t)),aa=(e,t)=>{let n=gi(),r=e.toArray().map(e=>Ei(e,t,n)).filter(e=>e!==null);return{doc:t.topNodeType.create(null,I.fromArray(r)),meta:n,mapping:n.mapping}},oa=(e,t,n)=>e!==t,sa=e=>{let t=document.createElement(`span`);t.classList.add(`ProseMirror-yjs-cursor`),t.setAttribute(`style`,`border-color: ${e.color}`);let n=document.createElement(`div`);n.setAttribute(`style`,`background-color: ${e.color}`),n.insertBefore(document.createTextNode(e.name),null);let r=document.createTextNode(`⁠`),i=document.createTextNode(`⁠`);return t.insertBefore(r,null),t.insertBefore(n,null),t.insertBefore(i,null),t},ca=e=>({style:`background-color: ${e.color}70`,class:`ProseMirror-yjs-selection`}),la=/^#[0-9a-fA-F]{6}$/,ua=(e,t,n,r,i)=>{let a=U.getState(e);if(a==null||a.doc==null||a.binding==null)return me.create(e.doc,[]);let o=a.doc,s=[];return a.snapshot!=null||a.prevSnapshot!=null||a.binding.mapping.size===0?me.create(e.doc,[]):(t.getStates().forEach((t,c)=>{if(n(o.clientID,c,t)&&t.cursor!=null){let n=t.user||{};n.color==null?n.color=`#ffa500`:la.test(n.color)||console.warn(`A user uses an unsupported color format`,n),n.name??=`User: ${c}`;let l=na(o,a.type,sn(t.cursor.anchor),a.binding.mapping),u=na(o,a.type,sn(t.cursor.head),a.binding.mapping);if(l!==null&&u!==null){let t=an(e.doc.content.size-1,0);l=$t(l,t),u=$t(u,t),s.push(he.widget(u,()=>r(n,c),{key:c+``,side:10}));let a=$t(l,u),o=an(l,u);s.push(he.inline(a,o,i(n,c),{inclusiveEnd:!0,inclusiveStart:!1}))}}}),me.create(e.doc,s))},da=(e,{awarenessStateFilter:t=oa,cursorBuilder:n=sa,selectionBuilder:r=ca,getSelection:i=e=>e.selection}={},a=`cursor`)=>new M({key:pi,state:{init(i,a){return ua(a,e,t,n,r)},apply(i,a,o,s){let c=U.getState(s),l=i.getMeta(pi);return c&&c.isChangeOrigin||l&&l.awarenessUpdated?ua(s,e,t,n,r):a.map(i.mapping,i.doc)}},props:{decorations:e=>pi.getState(e)},view:t=>{let n=()=>{t.docView&&$i(t,pi,{awarenessUpdated:!0})},r=()=>{let n=U.getState(t.state),r=e.getLocalState()||{};if(t.hasFocus()){let o=i(t.state),s=ea(o.anchor,n.type,n.binding.mapping),c=ea(o.head,n.type,n.binding.mapping);(r.cursor==null||!Ht(sn(r.cursor.anchor),s)||!Ht(sn(r.cursor.head),c))&&e.setLocalStateField(a,{anchor:s,head:c})}else r.cursor!=null&&na(n.doc,n.type,sn(r.cursor.anchor),n.binding.mapping)!==null&&e.setLocalStateField(a,null)};return e.on(`change`,n),t.dom.addEventListener(`focusin`,r),t.dom.addEventListener(`focusout`,r),{update:r,destroy:()=>{t.dom.removeEventListener(`focusin`,r),t.dom.removeEventListener(`focusout`,r),e.off(`change`,n),e.setLocalStateField(a,null)}}}}),fa=e=>{let t=fi.getState(e).undoManager;if(t!=null)return t.undo(),!0},pa=e=>{let t=fi.getState(e).undoManager;if(t!=null)return t.redo(),!0},ma=new Set([`paragraph`]),ha=(e,t)=>!(e instanceof Wt)||!(e.content instanceof Zt)||!(e.content.type instanceof Jt||e.content.type instanceof qt&&t.has(e.content.type.nodeName))||e.content.type._length===0,ga=({protectedNodes:e=ma,trackedOrigins:t=[],undoManager:n=null}={})=>new M({key:fi,state:{init:(r,i)=>{let a=U.getState(i),o=n||new Qt(a.type,{trackedOrigins:new Set([U].concat(t)),deleteFilter:t=>ha(t,e),captureTransaction:e=>e.meta.get(`addToHistory`)!==!1});return{undoManager:o,prevSel:null,hasUndoOps:o.undoStack.length>0,hasRedoOps:o.redoStack.length>0}},apply:(e,t,n,r)=>{let i=U.getState(r).binding,a=t.undoManager,o=a.undoStack.length>0,s=a.redoStack.length>0;return i?{undoManager:a,prevSel:Ci(i,n),hasUndoOps:o,hasRedoOps:s}:o!==t.hasUndoOps||s!==t.hasRedoOps?Object.assign({},t,{hasUndoOps:a.undoStack.length>0,hasRedoOps:a.redoStack.length>0}):t}},view:e=>{let t=U.getState(e.state),n=fi.getState(e.state).undoManager;return n.on(`stack-item-added`,({stackItem:n})=>{let r=t.binding;r&&n.meta.set(r,fi.getState(e.state).prevSel)}),n.on(`stack-item-popped`,({stackItem:e})=>{let n=t.binding;n&&(n.beforeTransactionSelection=e.meta.get(n)||n.beforeTransactionSelection)}),{destroy:()=>{n.destroy()}}}}),_a=new Map,va=new Set;function ya(){for(let e of va)e()}function ba(e,t,n){_a.set(e,{view:t,host:n}),ya()}function xa(e,t){_a.get(e)?.view===t&&(_a.delete(e),ya())}function Sa(e){let t=_a.get(e);return t?.host===`sourceEditor`?t.view:null}function Ca(e){return _a.get(e)??null}function wa(e){return va.add(e),()=>{va.delete(e)}}var Ta=new WeakMap,Ea=new WeakMap;function Da(e,t){Ta.set(e,t)}function Oa(e){return Ta.get(e)??!1}function ka(e,t){Ea.set(e,t)}function Aa(e){return Ea.get(e)??!1}function ja(e){return!Oa(e)}var Ma=`autonomousFragmentEdit/swap`;function Na(e){return e.setMeta(Ma,!0)}function Pa(e,t,n){return n===t.textContent?Na(e):e}function Fa(e){return e.getMeta(Ma)===!0}function Ia(e){return!e.getMeta(U)&&!Fa(e)}var La=/^[A-Za-z0-9]{20,}$/,Ra=/^(?:\d+s?|(?:\d+h)?(?:\d+m)?(?:\d+s)?)$/;function za(e){let t=e.toLowerCase();return t===`loom.com`||t===`www.loom.com`}function Ba(e){let t=e.pathname.match(/^\/(?:share|embed)\/([A-Za-z0-9]+)\/?$/);if(!t)return null;let n=t[1]??``;return La.test(n)?n:null}function Va(e){if(typeof e!=`string`||e.length===0)return null;let t;try{t=new URL(e)}catch{return null}if(t.protocol!==`http:`&&t.protocol!==`https:`||!za(t.hostname))return null;let n=Ba(t);if(!n)return null;let r=t.searchParams.get(`t`);return{id:n,startRaw:r&&r.length>0&&Ra.test(r)?r:null}}function Ha(e){return Va(e)!==null}function Ua(e){let t=e.toLowerCase();return t===`vimeo.com`||t===`www.vimeo.com`||t===`player.vimeo.com`}function Wa(e){if(typeof e!=`string`||e.length===0)return!1;let t;try{t=new URL(e)}catch{return!1}return t.protocol!==`http:`&&t.protocol!==`https:`?!1:Ua(t.hostname)}var Ga=/^[A-Za-z0-9_-]{11}$/;function Ka(e){let t=e.toLowerCase();return t===`youtube.com`||t===`www.youtube.com`||t===`m.youtube.com`||t===`music.youtube.com`||t===`youtu.be`||t===`youtube-nocookie.com`||t===`www.youtube-nocookie.com`}function qa(e){if(e.length===0)return null;if(/^[0-9]+$/.test(e)){let t=Number.parseInt(e,10);return t>0?t:null}let t=e.match(/^(?:([0-9]+)h)?(?:([0-9]+)m)?(?:([0-9]+)s?)?$/);if(!t)return null;let n=t[1]?Number.parseInt(t[1],10):0,r=t[2]?Number.parseInt(t[2],10):0,i=t[3]?Number.parseInt(t[3],10):0,a=n*3600+r*60+i;return a>0?a:null}function Ja(e){if(e.hostname.toLowerCase()===`youtu.be`){let t=e.pathname.replace(/^\//,``).split(`/`)[0]??``;return Ga.test(t)?t:null}if(e.pathname===`/watch`){let t=e.searchParams.get(`v`)??``;return Ga.test(t)?t:null}let t=e.pathname.match(/^\/(?:embed|shorts|v)\/([A-Za-z0-9_-]{11})\/?$/);return t?t[1]??null:null}function Ya(e){if(typeof e!=`string`||e.length===0)return null;let t;try{t=new URL(e)}catch{return null}if(t.protocol!==`http:`&&t.protocol!==`https:`||!Ka(t.hostname))return null;let n=Ja(t);if(!n)return null;let r=t.searchParams.get(`t`)??t.searchParams.get(`start`)??``;return{id:n,startSeconds:r.length>0?qa(r):null,noCookie:t.hostname.toLowerCase().endsWith(`youtube-nocookie.com`)}}function Xa(e,t){let n=Array.isArray(e.attrs.attributes)?e.attrs.attributes.filter(e=>typeof e==`object`&&!!e&&`type`in e):[],r=e.attrs.props??{},i=new Map,a=new Set;if(t)for(let e of t)e.omitOnDefault===!0&&`defaultValue`in e&&e.defaultValue!==void 0&&i.set(e.name,e.defaultValue),e.type===`string`&&e.required===!1&&e.defaultValue===void 0&&a.add(e.name);for(let[e,t]of Object.entries(r)){let r=n.findIndex(t=>t.type===`mdxJsxAttribute`&&t.name===e);if(i.has(e)&&Object.is(i.get(e),t)){r>=0&&n.splice(r,1);continue}if(a.has(e)&&t===``){r>=0&&n.splice(r,1);continue}if(r>=0){let e=n[r];if(e.type===`mdxJsxAttribute`&&e.value!=null&&typeof e.value==`object`&&e.value.type===`mdxJsxAttributeValueExpression`&&Za(e.value.value,t))continue}let o=Qa(e,t);r>=0?n[r]=o:n.push(o)}return n}function Za(e,t){try{return JSON.stringify(JSON.parse(e))===JSON.stringify(t)}catch{return!1}}function Qa(e,t){if(t===!0)return{type:`mdxJsxAttribute`,name:e,value:null};if(t===!1)return{type:`mdxJsxAttribute`,name:e,value:{type:`mdxJsxAttributeValueExpression`,value:`false`}};if(t==null)return{type:`mdxJsxAttribute`,name:e,value:null};if(typeof t==`string`)return{type:`mdxJsxAttribute`,name:e,value:t};if(typeof t==`number`)return{type:`mdxJsxAttribute`,name:e,value:{type:`mdxJsxAttributeValueExpression`,value:JSON.stringify(t)}};if(typeof t==`object`){let n;try{n=JSON.stringify(t)}catch{n=String(t)}return{type:`mdxJsxAttribute`,name:e,value:{type:`mdxJsxAttributeValueExpression`,value:n}}}return{type:`mdxJsxAttribute`,name:e,value:String(t)}}function $a(e,t,n,r){return{type:`mdxJsxFlowElement`,name:e,attributes:Xa(t,r),children:n.all(t),data:{}}}function eo(e,t,n){let r=t.attrs.props?.children;return{type:`mdxJsxTextElement`,name:e,attributes:Xa(t,n),children:typeof r==`string`&&r!==``?[{type:`text`,value:r}]:[],data:{}}}var to=[{name:`type`,type:`enum`,enumValues:[`note`,`tip`,`important`,`warning`,`caution`,`abstract`,`info`,`todo`,`success`,`question`,`failure`,`danger`,`bug`,`example`,`quote`],defaultValue:`note`,required:!1,description:`Callout variant`},{name:`title`,type:`string`,required:!1,description:`Optional heading shown above the body`},{name:`icon`,type:`string`,required:!1,advanced:!0,description:"Custom lucide icon override (e.g. `lucide:Lightbulb`)",iconPicker:!0},{name:`color`,type:`string`,required:!1,advanced:!0,description:"Optional accent color override (hex — e.g. `#F05032`)",colorPicker:!0},{name:`collapsible`,type:`boolean`,required:!1,defaultValue:!1,advanced:!0,description:"Render as a foldable `<details>` (Obsidian `[!TYPE]+/-`)"},{name:`defaultOpen`,type:`boolean`,required:!1,defaultValue:!0,advanced:!0,description:`When collapsible, start in the open state`,hideWhen:e=>e.collapsible!==!0},{name:`children`,type:`reactnode`,required:!0,description:`Callout content`}],no=[{name:`src`,type:`string`,required:!0,defaultValue:``,description:`Image source URL`,accept:x,autoFocus:!0},{name:`alt`,type:`string`,required:!0,description:`Alt text`},{name:`width`,type:`number`,required:!1,advanced:!0,description:`Image width`},{name:`height`,type:`number`,required:!1,advanced:!0,description:`Image height`},{name:`srcset`,type:`string`,required:!1,advanced:!0,description:`Responsive image candidate set (e.g. "x.png 1x, y.png 2x")`},{name:`sizes`,type:`string`,required:!1,advanced:!0,description:`Responsive image sizes hint paired with srcset`},{name:`loading`,type:`enum`,enumValues:[`eager`,`lazy`],defaultValue:`lazy`,required:!1,advanced:!0,omitOnDefault:!0,description:`Native img loading strategy (defaults to lazy)`},{name:`title`,type:`string`,required:!1,advanced:!0,description:`Native HTML title attribute (tooltip)`},{name:`decoding`,type:`enum`,enumValues:[`sync`,`async`,`auto`],defaultValue:`auto`,required:!1,advanced:!0,omitOnDefault:!0,description:`Hint for how the browser should decode the image`},{name:`fetchpriority`,type:`enum`,enumValues:[`high`,`low`,`auto`],defaultValue:`auto`,required:!1,advanced:!0,omitOnDefault:!0,description:`Resource fetch priority hint`},{name:`crossorigin`,type:`enum`,enumValues:[`anonymous`,`use-credentials`],required:!1,advanced:!0,description:`CORS mode for the image fetch`},{name:`referrerpolicy`,type:`string`,required:!1,advanced:!0,description:`Referrer policy for the image fetch (HTML referrerpolicy values)`},{name:`align`,type:`enum`,enumValues:[`center`,`left`,`right`],defaultValue:`center`,required:!1,omitOnDefault:!0,description:`Alignment within the column`,hidden:!0}],ro=[{name:`src`,type:`string`,required:!0,defaultValue:``,description:`Embedded page URL (must start with http:// or https://)`,autoFocus:!0},{name:`title`,type:`string`,required:!1,description:`Iframe title (accessible label for screen readers)`},{name:`width`,type:`string`,required:!1,advanced:!0,description:`Embed width as a CSS length (e.g. "100%", "640px")`,cssLengthInput:!0},{name:`height`,type:`string`,required:!1,advanced:!0,description:`Embed height as a CSS length (e.g. "26rem", "480px")`,cssLengthInput:!0},{name:`align`,type:`enum`,enumValues:[`center`,`left`,`right`],defaultValue:`center`,required:!1,omitOnDefault:!0,description:`Alignment within the column`,hidden:!0}],io=[{name:`src`,type:`string`,required:!0,defaultValue:``,description:`Video source URL`,accept:y,autoFocus:!0},{name:`controls`,type:`boolean`,required:!1,defaultValue:!0,advanced:!0,omitOnDefault:!0,description:`Show native HTML5 video controls (defaults to true)`,hideWhen:e=>typeof e.src==`string`&&(Wa(e.src)||Ha(e.src))},{name:`autoplay`,type:`boolean`,required:!1,advanced:!0,description:`Begin playback as soon as possible (usually requires muted)`},{name:`poster`,type:`string`,required:!1,advanced:!0,description:`Poster image URL shown before playback`,accept:x,hideWhen:e=>typeof e.src==`string`&&(Wa(e.src)||Ha(e.src))},{name:`width`,type:`number`,required:!1,advanced:!0,description:`Video width`},{name:`height`,type:`number`,required:!1,advanced:!0,description:`Video height`},{name:`title`,type:`string`,required:!1,advanced:!0,description:`Native HTML title attribute (tooltip)`},{name:`muted`,type:`boolean`,required:!1,advanced:!0,description:`Mute audio on load`},{name:`loop`,type:`boolean`,required:!1,advanced:!0,description:`Restart from the beginning when playback ends`,hideWhen:e=>typeof e.src==`string`&&Ha(e.src)},{name:`playsinline`,type:`boolean`,required:!1,advanced:!0,description:`Play inline on iOS rather than entering fullscreen`,hideWhen:e=>typeof e.src==`string`&&(Wa(e.src)||Ha(e.src))},{name:`preload`,type:`enum`,enumValues:[`none`,`metadata`,`auto`],required:!1,advanced:!0,description:`Hint for how much of the video to preload`,hideWhen:e=>typeof e.src==`string`&&(Ya(e.src)!==null||Wa(e.src)||Ha(e.src))},{name:`align`,type:`enum`,enumValues:[`center`,`left`,`right`],defaultValue:`center`,required:!1,omitOnDefault:!0,description:`Alignment within the column`,hidden:!0}],ao=[{name:`src`,type:`string`,required:!0,defaultValue:``,description:`Audio source URL`,accept:w,autoFocus:!0},{name:`controls`,type:`boolean`,required:!1,defaultValue:!0,advanced:!0,omitOnDefault:!0,description:`Show native HTML5 audio controls (defaults to true)`},{name:`autoplay`,type:`boolean`,required:!1,advanced:!0,description:`Begin playback as soon as possible (usually requires muted)`},{name:`title`,type:`string`,required:!1,advanced:!0,description:`Native HTML title attribute (tooltip)`},{name:`muted`,type:`boolean`,required:!1,advanced:!0,description:`Mute audio on load`},{name:`loop`,type:`boolean`,required:!1,advanced:!0,description:`Restart from the beginning when playback ends`},{name:`preload`,type:`enum`,enumValues:[`none`,`metadata`,`auto`],required:!1,advanced:!0,description:`Hint for how much of the audio to preload`}],oo=[{name:`title`,type:`string`,required:!0,description:`Heading shown inside the <summary>`},{name:`defaultOpen`,type:`boolean`,required:!1,defaultValue:!1,description:`When true, the block renders expanded on initial load`},{name:`icon`,type:`string`,required:!1,advanced:!0,description:"Custom lucide icon override (e.g. `lucide:Rocket`)",iconPicker:!0},{name:`description`,type:`string`,required:!1,advanced:!0,description:`Optional subtitle rendered below the title inside <summary>`},{name:`id`,type:`string`,required:!1,advanced:!0,description:"HTML id attribute for deep-linking (e.g. `#advanced-options`)"},{name:`name`,type:`string`,required:!1,advanced:!0,description:`HTML5 <details name=> group — siblings with the same name are mutually exclusive`}],so=[to[0],to[1],to[4],to[5],to[6]],co=[no[0],no[1],no[7]],lo=[oo[0],oo[1],oo[4],oo[5]],uo=[{name:`align`,type:`enum`,enumValues:[`center`,`left`,`right`,`justify`],required:!1,defaultValue:`center`,description:"Block alignment from the `<div align>` attribute."},{name:`tag`,type:`string`,required:!1,defaultValue:`div`,hidden:!0,description:`Source wrapper tag (div or center).`},{name:`sourceAttrs`,type:`string`,required:!1,defaultValue:``,hidden:!0,description:`Raw opener-tag attribute bytes preserved for round-trip.`}],fo=[{name:`alias`,type:`string`,required:!1,defaultValue:``,description:"Alt text (Obsidian alias syntax: `![[file.png|alt text]]`)"}],po=[{name:`alias`,type:`string`,required:!1,defaultValue:``,description:"Title text (Obsidian alias syntax: `![[clip.mp4|title]]`)"}],mo=[{name:`alias`,type:`string`,required:!1,defaultValue:``,description:"Title text (Obsidian alias syntax: `![[song.mp3|title]]`)"}],ho=[{name:`id`,type:`string`,required:!1,advanced:!0,description:"HTML id attribute for deep-linking (e.g. `#install-tabs`)"}],go=[{name:`label`,type:`string`,required:!0,autoFocus:!0,defaultValue:`Tab`,description:`Tab strip label — shown in the clickable pill at the top`},{name:`id`,type:`string`,required:!1,advanced:!0,description:"HTML id attribute for deep-linking (e.g. `#tab-npm`)"}],_o=[{name:`formula`,type:`string`,required:!0,autoFocus:!0,language:`latex`,description:`LaTeX math source (rendered with KaTeX in the browser)`},{name:`id`,type:`string`,required:!1,advanced:!0,description:"HTML id attribute for deep-linking (e.g. `#eq-pythagoras`)"},{name:`language`,type:`string`,required:!1,advanced:!0,description:"Forward-compat hint for the math source language (default `latex`). Reserved for future MathJax / Typst / AsciiMath substrates."}],vo=[_o[0]],yo=[_o[0]],bo=[{name:`chart`,type:`string`,required:!0,hidden:!0,description:`Mermaid chart source (graph / flowchart / sequenceDiagram / class / state / etc.)`}],xo=[{name:`alias`,type:`string`,required:!1,defaultValue:``,description:"Display name override (Obsidian alias syntax: `![[file.zip|label]]`)"}],So=[{name:`src`,type:`string`,required:!0,defaultValue:``,description:`File URL`,accept:[`*/*`],autoFocus:!0}],Co=[{name:`src`,type:`string`,required:!0,defaultValue:``,description:`PDF source URL`,accept:C,autoFocus:!0},{name:`title`,type:`string`,required:!1,advanced:!0,description:`Accessible label for the embedded PDF viewer`},{name:`anchor`,type:`string`,required:!1,advanced:!0,description:"PDF viewer parameters as a single URL-fragment string (e.g. `page=3&height=600`)"}],wo=[{name:`src`,type:`string`,required:!0,description:"Path to the `.excalidraw` board this embed renders",autoFocus:!0},{name:`title`,type:`string`,required:!1,advanced:!0,description:`Accessible label for the embedded board`}],To=[{name:`src`,type:`string`,required:!0,description:"Path of the source doc, extension-less (e.g. `api-spec`).",autoFocus:!0},{name:`anchor`,type:`string`,required:!0,description:"Id of the `<MirrorSource>` block within the source doc."}],Eo=[{name:`id`,type:`string`,required:!0,description:"Stable id agents and authors use to reference this block from `<Mirror>` elsewhere.",autoFocus:!0},{name:`children`,type:`reactnode`,required:!0,description:`Block content this MirrorSource owns — paragraphs, callouts, code, nested JSX, anything.`}];function Do(e){return e.replace(/&/g,`&amp;`).replace(/"/g,`&quot;`).replace(/</g,`&lt;`).replace(/>/g,`&gt;`)}function Oo(e){return e.replace(/&/g,`&amp;`).replace(/</g,`&lt;`).replace(/>/g,`&gt;`)}function ko(e){let t=e.attrs.props,n=t?.target??``,r=typeof t?.alias==`string`&&t.alias.length>0?t.alias:null,i=typeof t?.anchor==`string`&&t.anchor.length>0?t.anchor:null,a=typeof t?.sourceTarget==`string`?t.sourceTarget:null,o=typeof t?.sourceAnchor==`string`?t.sourceAnchor:null,s=typeof t?.sourceAlias==`string`?t.sourceAlias:null,c=r??(i?`${n}#${i}`:n);return{type:`wikiLinkEmbed`,value:c,data:{target:n,anchor:i,alias:r,sourceTarget:a,sourceAnchor:o,sourceAlias:s},children:[{type:`text`,value:c}]}}var Ao=[{name:`Callout`,surface:`canonical`,hasChildren:!0,props:to,icon:`MessageSquareWarning`,category:`content`,displayName:`Callout`,description:`Alert / admonition with 15 type variants — 5 GFM (note, tip, important, warning, caution) plus 10 Obsidian-parity (abstract, info, todo, success, question, failure, danger, bug, example, quote)`,searchTerms:[`note`,`tip`,`important`,`warning`,`caution`,`abstract`,`info`,`todo`,`success`,`question`,`failure`,`danger`,`bug`,`example`,`quote`,`alert`,`admonition`,`callout`],serialize:(e,t)=>$a(`Callout`,e,t,to)},{name:`img`,surface:`canonical`,hasChildren:!1,isSelfClosing:!0,props:no,icon:`Image`,category:`media`,displayName:`Image`,description:`Image with click-to-zoom and HTML-native attributes`,searchTerms:[`image`,`zoom`,`picture`,`photo`],placeholder:{label:`Add an image`},serialize:(e,t)=>$a(`img`,e,t,no)},{name:`video`,surface:`canonical`,hasChildren:!1,isSelfClosing:!0,props:io,icon:`SquarePlay`,category:`media`,displayName:`Video`,description:`HTML5 video player with native controls`,searchTerms:[`video`,`media`,`player`,`mp4`,`webm`,`movie`],placeholder:{label:`Add a video`},serialize:(e,t)=>$a(`video`,e,t,io)},{name:`audio`,surface:`canonical`,hasChildren:!1,isSelfClosing:!0,props:ao,icon:`Volume2`,category:`media`,displayName:`Audio`,description:`HTML5 audio player with native controls`,searchTerms:[`audio`,`sound`,`music`,`mp3`,`podcast`,`player`],placeholder:{label:`Add audio`},serialize:(e,t)=>$a(`audio`,e,t,ao)},{name:`Pdf`,surface:`canonical`,hasChildren:!1,isSelfClosing:!0,props:Co,icon:`FileText`,category:`media`,displayName:`PDF`,description:"Embedded PDF viewer (`#page=N` to open at page N, `#height=N` for viewer height)",searchTerms:[`pdf`,`document`,`embed`,`pdfjs`],placeholder:{label:`Add a PDF`},serialize:(e,t)=>$a(`Pdf`,e,t,Co)},{name:`Excalidraw`,surface:`canonical`,hasChildren:!1,isSelfClosing:!0,props:wo,icon:`PenTool`,category:`embed`,displayName:`Excalidraw`,description:"Embedded snapshot of an `.excalidraw` board, linking to its canvas editor",searchTerms:[`excalidraw`,`board`,`whiteboard`,`sketch`,`drawing`,`canvas`],serialize:(e,t)=>$a(`Excalidraw`,e,t,wo)},{name:`File`,surface:`canonical`,hasChildren:!1,isSelfClosing:!0,props:So,icon:`Paperclip`,category:`media`,displayName:`File`,description:`Downloadable file attachment — inline row with name + size + download link`,searchTerms:[`file`,`attachment`,`download`,`document`,`zip`,`docx`,`doc`],placeholder:{label:`Add a file`},serialize:(e,t)=>$a(`File`,e,t,So)},{name:`Embed`,surface:`canonical`,hasChildren:!1,isSelfClosing:!0,props:ro,icon:`AppWindow`,category:`embed`,displayName:`Embed`,description:'Inline web embed (iframe) — drop a URL, get a resizable preview pane. For YouTube / Vimeo / Loom prefer `<video src="…">` (player props, click-facade); `<Embed>` auto-rewrites watch URLs as a fallback.',searchTerms:[`embed`,`iframe`,`website`,`page`,`inline`,`frame`,`preview`],placeholder:{label:`Embed a URL`},serialize:(e,t)=>$a(`Embed`,e,t,ro)},{name:`Accordion`,surface:`canonical`,hasChildren:!0,props:oo,icon:`ChevronRight`,category:`content`,displayName:`Accordion`,description:"Standalone expand/collapse via native HTML5 <details>/<summary>. Group siblings with the `name` prop for exclusive-accordion UX.",searchTerms:[`accordion`,`expandable`,`details`,`disclosure`,`collapse`,`fold`],exampleBody:`Body content revealed when the accordion is expanded.`,serialize:(e,t)=>$a(`Accordion`,e,t,oo)},{name:`Toggle`,surface:`canonical`,hasChildren:!0,props:oo,icon:`ChevronRight`,category:`content`,displayName:`Toggle`,description:"Standalone expand/collapse block (Notion-style). Same render + props as `<Accordion>` — pick whichever vocabulary matches the vault.",searchTerms:[`toggle`,`collapsible`,`expand`,`details`,`disclosure`,`fold`],exampleBody:`Body content revealed when the toggle is expanded.`,serialize:(e,t)=>$a(`Toggle`,e,t,oo)},{name:`Tabs`,surface:`canonical`,hasChildren:!0,emptyChildName:`Tab`,props:ho,icon:`LayoutPanelTop`,category:`content`,displayName:`Tabs`,description:"Horizontal tab strip + active panel below. Each `<Tab>` child is one panel; clickable pills at the top switch the active one. Active selection is ephemeral (resets on reload).",searchTerms:[`tabs`,`tabbed`,`panels`,`tabgroup`,`switcher`],exampleBody:`<Tab label="One">Body of the first tab panel.</Tab>
3
3
  <Tab label="Two">Body of the second tab panel.</Tab>`,serialize:(e,t)=>$a(`Tabs`,e,t,ho)},{name:`Tab`,surface:`canonical`,hasChildren:!0,props:go,icon:`PanelTop`,category:`content`,displayName:`Tab`,description:"A single tab panel inside a `<Tabs>` container — carries the strip label and the block-content body.",searchTerms:[`tab`,`panel`],exampleBody:"Panel content — must be nested inside a `<Tabs>` parent.",serialize:(e,t)=>$a(`Tab`,e,t,go)},{name:`Math`,surface:`canonical`,hasChildren:!1,isSelfClosing:!0,props:_o,icon:`Sigma`,category:`content`,displayName:`Math`,description:`Block math equation rendered with KaTeX from a LaTeX source string`,searchTerms:[`math`,`latex`,`equation`,`formula`,`katex`,`tex`],serialize:(e,t)=>$a(`Math`,e,t,_o)},{name:`MermaidFence`,surface:`canonical`,hasChildren:!1,isSelfClosing:!0,props:bo,icon:`Workflow`,category:`content`,displayName:`Mermaid`,placeholder:{label:`Add a Mermaid diagram`},description:"Diagram rendered from Mermaid source (flowchart, sequence, class, state, ER, gantt, pie). Authored exclusively as ` ```mermaid ` fenced code.",searchTerms:[`mermaid`,`diagram`,`flowchart`,`graph`,`sequence`,`sequencediagram`,`class`,`state`,`er`,`erdiagram`,`gantt`,`pie`,`chart`],serialize:e=>({type:`code`,lang:`mermaid`,meta:null,value:e.attrs.props?.chart??``})},{name:`Mirror`,surface:`canonical`,hasChildren:!1,isSelfClosing:!0,props:To,icon:`CopyPlus`,category:`content`,displayName:`Mirror`,description:"Render a read-only copy of a `<MirrorSource>` block from another doc. Use to keep the same content in sync across multiple docs without copy-paste — edits land at the source, every Mirror reflects the change.",searchTerms:[`mirror`,`sync`,`synced`,`transclude`,`embed`,`reference`,`shared block`],serialize:(e,t)=>$a(`Mirror`,e,t,To)},{name:`MirrorSource`,surface:`canonical`,hasChildren:!0,props:Eo,icon:`GitBranch`,category:`content`,displayName:`Mirror Source`,description:'Mark a block as the source of truth for content that appears in multiple docs. Wrap any block content; `<Mirror src="…" anchor="<id>">` references render this verbatim read-only at every call-site. Edit here, propagate everywhere.',searchTerms:[`mirror source`,`sync source`,`source block`,`master block`,`shared`],exampleBody:"Authoritative content lives inside this block — edits here propagate to every `<Mirror>` that references this id.",serialize:(e,t)=>$a(`MirrorSource`,e,t,Eo)},{name:`GFMCallout`,surface:`compat`,hasChildren:!0,props:so,icon:`MessageSquareWarning`,category:`content`,displayName:`GFM Callout`,description:"GFM blockquote alert (`> [!NOTE]`) — read-only compat. Preserves `> [!NOTE]` syntax on round-trip; insert a fresh Callout block for the full prop surface.",rendersAs:`Callout`,translateProps:e=>e,serialize:(e,t)=>{let n=e.attrs.props,r=new Set([`note`,`tip`,`important`,`warning`,`caution`,`abstract`,`info`,`todo`,`success`,`question`,`failure`,`danger`,`bug`,`example`,`quote`]),i=n?.type??`note`;return{type:`blockquote`,children:[{type:`html`,value:`[!${(r.has(i.toLowerCase())?i:`note`).toUpperCase()}]${n?.collapsible?n.defaultOpen===!1?`-`:`+`:``}${n?.title?` ${n.title}`:``}`},...t.all(e).filter(e=>{if(e.type!==`paragraph`)return!0;let t=e;return Array.isArray(t.children)&&t.children.length>0})]}}},{name:`CommonMarkImage`,surface:`compat`,hasChildren:!1,isSelfClosing:!0,props:co,icon:`Image`,category:`media`,displayName:`CommonMark Image`,description:'CommonMark image (`![alt](src "title")`) — read-only compat. Preserves `![alt](src)` syntax on round-trip; insert a fresh Image block for the full HTML-native attribute surface (srcset, sizes, decoding, etc.).',rendersAs:`img`,translateProps:e=>e,serialize:e=>{let t=e.attrs.props;return{type:`paragraph`,children:[{type:`image`,url:t?.sourceUrl??t?.src??``,alt:t?.alt??``,title:t?.title??null}]}}},{name:`WikiEmbedImage`,surface:`compat`,hasChildren:!1,isSelfClosing:!0,props:fo,icon:`ZoomIn`,category:`media`,displayName:`Wiki Embed Image`,description:"Obsidian-style `![[file.png]]` wiki-embed — read-only compat. Edit the alt-text via the alias slot; the embed target / anchor stay on the prop bag and round-trip byte-identical.",rendersAs:`img`,translateProps:e=>{let t=typeof e.alias==`string`&&e.alias.length>0?e.alias:null,n=typeof e.target==`string`?e.target:``;return{src:e.src,alt:t??n}},serialize:ko},{name:`WikiEmbedVideo`,surface:`compat`,hasChildren:!1,isSelfClosing:!0,props:po,icon:`Film`,category:`media`,displayName:`Wiki Embed Video`,description:"Obsidian-style `![[clip.mp4]]` wiki-embed — read-only compat. Edit the title via the alias slot; the embed target / anchor stay on the prop bag and round-trip byte-identical.",rendersAs:`video`,translateProps:e=>{let t=typeof e.alias==`string`&&e.alias.length>0?e.alias:null,n=typeof e.target==`string`?e.target:``;return{src:e.src,title:t??n}},serialize:ko},{name:`WikiEmbedAudio`,surface:`compat`,hasChildren:!1,isSelfClosing:!0,props:mo,icon:`Volume2`,category:`media`,displayName:`Wiki Embed Audio`,description:"Obsidian-style `![[song.mp3]]` wiki-embed — read-only compat. Edit the title via the alias slot; the embed target / anchor stay on the prop bag and round-trip byte-identical.",rendersAs:`audio`,translateProps:e=>{let t=typeof e.alias==`string`&&e.alias.length>0?e.alias:null,n=typeof e.target==`string`?e.target:``;return{src:e.src,title:t??n}},serialize:ko},{name:`WikiEmbedFile`,surface:`compat`,hasChildren:!1,isSelfClosing:!0,props:xo,icon:`Paperclip`,category:`media`,displayName:`Wiki Embed File`,description:"Obsidian-style `![[file.zip]]` wiki-embed — read-only compat for arbitrary downloadable attachments. Renders through the `File` canonical (inline row with file-up icon + bold name + optional dim size). Edit the display name via the alias slot.",rendersAs:`File`,translateProps:e=>{let t=typeof e.alias==`string`&&e.alias.length>0?e.alias:null,n=typeof e.size==`string`&&e.size.length>0?e.size:null;return{src:e.src,name:t??void 0,size:n??void 0}},serialize:ko},{name:`HtmlDetailsAccordion`,surface:`compat`,hasChildren:!0,props:lo,icon:`ChevronRight`,category:`content`,displayName:`HTML5 Details`,description:"HTML5 `<details><summary>` collapsible — read-only compat. Preserves `<details>` syntax on round-trip; insert a fresh Accordion block for icon / description / group-name props.",rendersAs:`Accordion`,translateProps:e=>e,serialize:(e,t)=>{let n=e.attrs.props,r=n?.defaultOpen?` open`:``,i=n?.name?` name="${Do(n.name)}"`:``,a=n?.id?` id="${Do(n.id)}"`:``,o=n?.title?.trim(),s=o?`<summary>${Oo(o)}</summary>`:``;return{type:`mdxJsxFlowElement`,name:`HtmlDetailsAccordion`,attributes:[],children:t.all(e),data:{htmlBoundary:{opener:`<details${r}${i}${a}>\n${s}`,closer:`</details>`}}}}},{name:`HtmlAlignBlock`,surface:`canonical`,hasChildren:!0,props:uo,icon:`AlignCenter`,category:`content`,displayName:`Align block`,description:"GitHub-style `<div align>` wrapper. Children render as normal blocks with the alignment applied; the `<div align>` syntax is preserved on round-trip.",searchTerms:[`align`,`center`,`centered`,`div`],serialize:(e,t)=>{let n=e.attrs.props,r=n?.tag===`center`?`center`:`div`,i=typeof n?.align==`string`&&n.align?n.align:null,a=typeof n?.sourceAttrs==`string`?n.sourceAttrs:``,o=/(\balign\s*=\s*)(?:"[^"]*"|'[^']*'|[^\s"'<>]+)/i;return i!==null&&(r===`div`||i!==`center`)?a=o.test(a)?a.replace(o,`$1"${Do(i)}"`):`${a} align="${Do(i)}"`:(i===null||r===`center`&&i===`center`)&&(a=a.replace(RegExp(`\\s*${o.source}`,`i`),``)),{type:`mdxJsxFlowElement`,name:`HtmlAlignBlock`,attributes:[],children:t.all(e),data:{htmlBoundary:{opener:`<${r}${a}>`,closer:`</${r}>`}}}}},{name:`DollarMath`,surface:`compat`,hasChildren:!1,isSelfClosing:!0,props:vo,icon:`Sigma`,category:`content`,displayName:`Dollar Math`,description:"Block math via `$$…$$` syntax — read-only compat. Preserves `$$…$$` form on round-trip; insert a fresh Math block for the full prop surface (id, language).",rendersAs:`Math`,translateProps:e=>e,serialize:e=>({type:`math`,value:e.attrs.props?.formula??``})},{name:`MathFence`,surface:`compat`,hasChildren:!1,isSelfClosing:!0,props:yo,icon:`Sigma`,category:`content`,displayName:`Math Fence`,description:"Block math via ` ```math ` fenced code syntax — read-only compat. Preserves the fence form on round-trip; insert a fresh Math block for the full prop surface (id, language).",rendersAs:`Math`,translateProps:e=>e,serialize:e=>({type:`code`,lang:`math`,meta:null,value:e.attrs.props?.formula??``})}],jo={name:`*`,surface:`canonical`,hasChildren:!0,props:[],description:`Unregistered component — children editable as markdown`,serialize:(e,t)=>$a(e.attrs.componentName||`*`,e,t)};function Mo(){let e=new Map;e.set(`*`,jo);for(let t of Ao)e.set(t.name,t);return{get(t){return e.get(t)},getOrWildcard(t){return e.get(t)??e.get(`*`)},set(t,n){e.set(t,n)},has(t){return e.has(t)},entries(){return e.entries()}}}var No=_e.create({name:`sourceLiteral`,priority:10,excludes:``,inclusive:!1,addAttributes(){return{sourceRaw:{default:``}}},parseHTML(){return[{tag:`span[data-source-literal]`}]},renderHTML({HTMLAttributes:e}){return[`span`,{"data-source-literal":``,...e},0]}});function Po(e,t){if(typeof e!=`string`||typeof t!=`string`||/[\x00-\x1F\x7F]/.test(e))return!1;let n=e.replaceAll(`\xA0`,` `),r=t.replaceAll(`\xA0`,` `);return n===r||Fo(n)===r?!0:Qr(e)===t}function Fo(e){return e.replace(/\\([!-/:-@[-`{-~])/g,`$1`)}function Io(e,t){let{target:n,anchor:r,alias:i}=e;if(!t.separatorCrossed)return e;if(r!==null){let e=Bo(r);return{target:n,anchor:e.length>0?e:null,alias:i===null?null:Vo(i)}}return{target:Bo(n),anchor:null,alias:i===null?null:Vo(i)}}function Lo(e,t,n){let r=e.trim();return r===t?!0:n===`alias`?Vo(r)===t:Bo(r)===t}function Ro(e,t,n){return typeof e==`string`&&Lo(e,t,n)?e:t}function zo(e){return Bo(e.trim())===``}function Bo(e){return e.endsWith(`\\`)?e.slice(0,-1):e}function Vo(e){return e.replace(/\\\|/g,`|`)}function Ho(e){let t=``,n=0;for(let r of e)r===`\\`?n++:(r===`|`&&n%2==0&&(t+=`\\`),n=0),t+=r;return t}function Uo(e){return e.replace(/\|/g,`\\|`)}function Wo(e){let t=e.split(`/`).pop()??e,n=t.lastIndexOf(`.`);return n<=0||n===t.length-1?``:t.slice(n+1).toLowerCase()}function Go(e){return e.includes("`")?`~`:"`"}function Ko(e,t,n=3){let r=RegExp(`^ {0,3}(\\${e}+)[ \\t]*$`),i=Math.max(3,n);for(let e of t.split(`
4
4
  `)){let t=r.exec(e);t&&t[1].length>=i&&(i=t[1].length+1)}return i}var qo=new Set([`break`,`delete`,`emphasis`,`footnoteReference`,`html`,`image`,`imageReference`,`inlineCode`,`link`,`linkReference`,`strong`,`text`]);function Jo(e){let t=e.children;Array.isArray(t)&&t.forEach((e,n)=>{if(e.type===`break`){t[n]={type:`html`,value:`<br />`};return}Jo(e)})}function Yo(e){let t=e.children;if(Array.isArray(t))for(let e of t)(e.type===`inlineCode`||e.type===`html`)&&(e.value.includes(`
5
5
  `)&&(e.value=e.value.replace(/[ \t]*\n[ \t]*/g,` `)),e.type===`html`&&e.value.includes(`|`)&&(e.value=Uo(e.value))),Yo(e)}function Xo(e){B(e,`tableCell`,e=>{e.children.some(e=>!qo.has(e.type))&&(e.children=Zo(e.children)),Jo(e),Yo(e)})}function Zo(e){let t=[],n=0,r=()=>{t.length>0&&(n+=1)},i=e=>{for(;n>0;)t.push({type:`break`}),--n;t.push(e)},a=e=>{e.split(`
@@ -1 +1 @@
1
- import{t as e}from"./jsx-runtime-BUgB2tll.js";import{n as t,r as n}from"./dist-Nvb76hAm.js";import{t as r}from"./compiler-runtime-BfE3aGVn.js";import{t as i}from"./label-CvMpFFbN.js";import{i as a,n as o,o as s,s as c,t as l}from"./select-Bu4Wm3Rf.js";import{t as u}from"./switch-BKZTXkzu.js";import{n as d}from"./dist-BGzUo_18.js";import{n as f}from"./config-errors-tVoeK4OC.js";import{i as p}from"./use-apply-config-theme-CYFG76sS.js";import"./saved-themes-client-CSjCi4YD.js";import"./config-provider-D7tAjHlA.js";import"./markdown-lint-BmjyI9ZU.js";import{t as m}from"./SettingsSectionHeader-D-JSH4bX.js";var h=r(),g=e();function _(){let e=(0,h.c)(40),{_:r}=n(),{projectConfig:_,projectSynced:v,projectBinding:y}=p(),b=v&&y!==null,x=_?.validation?.links??`warning`,S=_?.validation?.fileTreeIndicators!==!1,C=_?.validation?.suppressLogLinkAdvisories??!0,w;e[0]!==r||e[1]!==y?(w=function(e){if(y===null){d.error(r({id:`dVaXnv`}));return}let t=y.patch({validation:e});t.ok||d.error(r({id:`NrFwux`,values:{0:f(t.error)}}))},e[0]=r,e[1]=y,e[2]=w):w=e[2];let T=w,E;e[3]===Symbol.for(`react.memo_cache_sentinel`)?(E=(0,g.jsx)(t,{id:`OPOiKn`}),e[3]=E):E=e[3];let D;e[4]===Symbol.for(`react.memo_cache_sentinel`)?(D=(0,g.jsx)(m,{titleId:`settings-content-rules-title`,title:E,scope:`project`,level:`block`,children:(0,g.jsx)(t,{id:`ge05IJ`})}),e[4]=D):D=e[4];let O;e[5]===Symbol.for(`react.memo_cache_sentinel`)?(O=(0,g.jsx)(i,{htmlFor:`settings-content-rules-links`,className:`text-sm font-medium`,children:(0,g.jsx)(t,{id:`8ruqQi`})}),e[5]=O):O=e[5];let k;e[6]===Symbol.for(`react.memo_cache_sentinel`)?(k=(0,g.jsxs)(`div`,{className:`min-w-0`,children:[O,(0,g.jsx)(`p`,{id:`settings-content-rules-links-description`,className:`text-1sm text-muted-foreground`,children:(0,g.jsx)(t,{id:`iqr14Z`})})]}),e[6]=k):k=e[6];let A;e[7]===T?A=e[8]:(A=e=>T({links:e}),e[7]=T,e[8]=A);let j=!b,M;e[9]===Symbol.for(`react.memo_cache_sentinel`)?(M=(0,g.jsx)(s,{id:`settings-content-rules-links`,"aria-describedby":`settings-content-rules-links-description`,className:`w-36 shrink-0`,"data-testid":`settings-content-rules-links`,children:(0,g.jsx)(c,{})}),e[9]=M):M=e[9];let N;e[10]===Symbol.for(`react.memo_cache_sentinel`)?(N=(0,g.jsx)(a,{value:`off`,children:(0,g.jsx)(t,{id:`Nwbs0q`})}),e[10]=N):N=e[10];let P;e[11]===Symbol.for(`react.memo_cache_sentinel`)?(P=(0,g.jsx)(a,{value:`warning`,children:(0,g.jsx)(t,{id:`r6y-jM`})}),e[11]=P):P=e[11];let F;e[12]===Symbol.for(`react.memo_cache_sentinel`)?(F=(0,g.jsxs)(o,{children:[N,P,(0,g.jsx)(a,{value:`error`,children:(0,g.jsx)(t,{id:`SlfejT`})})]}),e[12]=F):F=e[12];let I;e[13]!==x||e[14]!==A||e[15]!==j?(I=(0,g.jsxs)(`div`,{className:`flex items-center justify-between gap-3 px-3 py-3`,children:[k,(0,g.jsxs)(l,{value:x,onValueChange:A,disabled:j,children:[M,F]})]}),e[13]=x,e[14]=A,e[15]=j,e[16]=I):I=e[16];let L;e[17]===Symbol.for(`react.memo_cache_sentinel`)?(L=(0,g.jsx)(i,{htmlFor:`settings-content-rules-log-links`,className:`text-sm font-medium`,children:(0,g.jsx)(t,{id:`ea7AYn`})}),e[17]=L):L=e[17];let R;e[18]===Symbol.for(`react.memo_cache_sentinel`)?(R=(0,g.jsxs)(`div`,{className:`min-w-0`,children:[L,(0,g.jsx)(`p`,{id:`settings-content-rules-log-links-description`,className:`text-1sm text-muted-foreground`,children:(0,g.jsx)(t,{id:`nnhrHd`})})]}),e[18]=R):R=e[18];let z=!b,B;e[19]===T?B=e[20]:(B=e=>T({suppressLogLinkAdvisories:e}),e[19]=T,e[20]=B);let V;e[21]!==C||e[22]!==z||e[23]!==B?(V=(0,g.jsxs)(`div`,{className:`flex items-center justify-between gap-3 px-3 py-3`,children:[R,(0,g.jsx)(u,{id:`settings-content-rules-log-links`,"aria-describedby":`settings-content-rules-log-links-description`,checked:C,disabled:z,onCheckedChange:B,"data-testid":`settings-content-rules-log-links`})]}),e[21]=C,e[22]=z,e[23]=B,e[24]=V):V=e[24];let H;e[25]===Symbol.for(`react.memo_cache_sentinel`)?(H=(0,g.jsx)(i,{htmlFor:`settings-content-rules-indicators`,className:`text-sm font-medium`,children:(0,g.jsx)(t,{id:`x3kWeu`})}),e[25]=H):H=e[25];let U;e[26]===Symbol.for(`react.memo_cache_sentinel`)?(U=(0,g.jsxs)(`div`,{className:`min-w-0`,children:[H,(0,g.jsx)(`p`,{id:`settings-content-rules-indicators-description`,className:`text-1sm text-muted-foreground`,children:(0,g.jsx)(t,{id:`ktspdq`})})]}),e[26]=U):U=e[26];let W=!b,G;e[27]===T?G=e[28]:(G=e=>T({fileTreeIndicators:e}),e[27]=T,e[28]=G);let K;e[29]!==S||e[30]!==W||e[31]!==G?(K=(0,g.jsxs)(`div`,{className:`flex items-center justify-between gap-3 px-3 py-3`,children:[U,(0,g.jsx)(u,{id:`settings-content-rules-indicators`,"aria-describedby":`settings-content-rules-indicators-description`,checked:S,disabled:W,onCheckedChange:G,"data-testid":`settings-content-rules-indicators`})]}),e[29]=S,e[30]=W,e[31]=G,e[32]=K):K=e[32];let q;e[33]!==I||e[34]!==V||e[35]!==K?(q=(0,g.jsxs)(`div`,{className:`divide-y rounded-md border`,children:[I,V,K]}),e[33]=I,e[34]=V,e[35]=K,e[36]=q):q=e[36];let J;e[37]===Symbol.for(`react.memo_cache_sentinel`)?(J=(0,g.jsx)(`p`,{className:`text-sm text-muted-foreground`,"data-testid":`settings-content-rules-plugins-note`,children:(0,g.jsx)(t,{id:`YDL7N6`})}),e[37]=J):J=e[37];let Y;return e[38]===q?Y=e[39]:(Y=(0,g.jsxs)(`section`,{"aria-labelledby":`settings-content-rules-title`,className:`space-y-4`,"data-testid":`settings-content-rules`,"data-field":`section:content-rules`,children:[D,q,J]}),e[38]=q,e[39]=Y),Y}export{_ as ContentRulesSection};
1
+ import{t as e}from"./jsx-runtime-BUgB2tll.js";import{n as t,r as n}from"./dist-Nvb76hAm.js";import{t as r}from"./compiler-runtime-BfE3aGVn.js";import{t as i}from"./label-CvMpFFbN.js";import{i as a,n as o,o as s,s as c,t as l}from"./select-Bu4Wm3Rf.js";import{t as u}from"./switch-BKZTXkzu.js";import{n as d}from"./dist-BGzUo_18.js";import{n as f}from"./config-errors-tVoeK4OC.js";import{i as p}from"./use-apply-config-theme-CYFG76sS.js";import"./saved-themes-client-CSjCi4YD.js";import"./config-provider-2W1hFFiT.js";import"./markdown-lint-BmjyI9ZU.js";import{t as m}from"./SettingsSectionHeader-D-JSH4bX.js";var h=r(),g=e();function _(){let e=(0,h.c)(40),{_:r}=n(),{projectConfig:_,projectSynced:v,projectBinding:y}=p(),b=v&&y!==null,x=_?.validation?.links??`warning`,S=_?.validation?.fileTreeIndicators!==!1,C=_?.validation?.suppressLogLinkAdvisories??!0,w;e[0]!==r||e[1]!==y?(w=function(e){if(y===null){d.error(r({id:`dVaXnv`}));return}let t=y.patch({validation:e});t.ok||d.error(r({id:`NrFwux`,values:{0:f(t.error)}}))},e[0]=r,e[1]=y,e[2]=w):w=e[2];let T=w,E;e[3]===Symbol.for(`react.memo_cache_sentinel`)?(E=(0,g.jsx)(t,{id:`OPOiKn`}),e[3]=E):E=e[3];let D;e[4]===Symbol.for(`react.memo_cache_sentinel`)?(D=(0,g.jsx)(m,{titleId:`settings-content-rules-title`,title:E,scope:`project`,level:`block`,children:(0,g.jsx)(t,{id:`ge05IJ`})}),e[4]=D):D=e[4];let O;e[5]===Symbol.for(`react.memo_cache_sentinel`)?(O=(0,g.jsx)(i,{htmlFor:`settings-content-rules-links`,className:`text-sm font-medium`,children:(0,g.jsx)(t,{id:`8ruqQi`})}),e[5]=O):O=e[5];let k;e[6]===Symbol.for(`react.memo_cache_sentinel`)?(k=(0,g.jsxs)(`div`,{className:`min-w-0`,children:[O,(0,g.jsx)(`p`,{id:`settings-content-rules-links-description`,className:`text-1sm text-muted-foreground`,children:(0,g.jsx)(t,{id:`iqr14Z`})})]}),e[6]=k):k=e[6];let A;e[7]===T?A=e[8]:(A=e=>T({links:e}),e[7]=T,e[8]=A);let j=!b,M;e[9]===Symbol.for(`react.memo_cache_sentinel`)?(M=(0,g.jsx)(s,{id:`settings-content-rules-links`,"aria-describedby":`settings-content-rules-links-description`,className:`w-36 shrink-0`,"data-testid":`settings-content-rules-links`,children:(0,g.jsx)(c,{})}),e[9]=M):M=e[9];let N;e[10]===Symbol.for(`react.memo_cache_sentinel`)?(N=(0,g.jsx)(a,{value:`off`,children:(0,g.jsx)(t,{id:`Nwbs0q`})}),e[10]=N):N=e[10];let P;e[11]===Symbol.for(`react.memo_cache_sentinel`)?(P=(0,g.jsx)(a,{value:`warning`,children:(0,g.jsx)(t,{id:`r6y-jM`})}),e[11]=P):P=e[11];let F;e[12]===Symbol.for(`react.memo_cache_sentinel`)?(F=(0,g.jsxs)(o,{children:[N,P,(0,g.jsx)(a,{value:`error`,children:(0,g.jsx)(t,{id:`SlfejT`})})]}),e[12]=F):F=e[12];let I;e[13]!==x||e[14]!==A||e[15]!==j?(I=(0,g.jsxs)(`div`,{className:`flex items-center justify-between gap-3 px-3 py-3`,children:[k,(0,g.jsxs)(l,{value:x,onValueChange:A,disabled:j,children:[M,F]})]}),e[13]=x,e[14]=A,e[15]=j,e[16]=I):I=e[16];let L;e[17]===Symbol.for(`react.memo_cache_sentinel`)?(L=(0,g.jsx)(i,{htmlFor:`settings-content-rules-log-links`,className:`text-sm font-medium`,children:(0,g.jsx)(t,{id:`ea7AYn`})}),e[17]=L):L=e[17];let R;e[18]===Symbol.for(`react.memo_cache_sentinel`)?(R=(0,g.jsxs)(`div`,{className:`min-w-0`,children:[L,(0,g.jsx)(`p`,{id:`settings-content-rules-log-links-description`,className:`text-1sm text-muted-foreground`,children:(0,g.jsx)(t,{id:`nnhrHd`})})]}),e[18]=R):R=e[18];let z=!b,B;e[19]===T?B=e[20]:(B=e=>T({suppressLogLinkAdvisories:e}),e[19]=T,e[20]=B);let V;e[21]!==C||e[22]!==z||e[23]!==B?(V=(0,g.jsxs)(`div`,{className:`flex items-center justify-between gap-3 px-3 py-3`,children:[R,(0,g.jsx)(u,{id:`settings-content-rules-log-links`,"aria-describedby":`settings-content-rules-log-links-description`,checked:C,disabled:z,onCheckedChange:B,"data-testid":`settings-content-rules-log-links`})]}),e[21]=C,e[22]=z,e[23]=B,e[24]=V):V=e[24];let H;e[25]===Symbol.for(`react.memo_cache_sentinel`)?(H=(0,g.jsx)(i,{htmlFor:`settings-content-rules-indicators`,className:`text-sm font-medium`,children:(0,g.jsx)(t,{id:`x3kWeu`})}),e[25]=H):H=e[25];let U;e[26]===Symbol.for(`react.memo_cache_sentinel`)?(U=(0,g.jsxs)(`div`,{className:`min-w-0`,children:[H,(0,g.jsx)(`p`,{id:`settings-content-rules-indicators-description`,className:`text-1sm text-muted-foreground`,children:(0,g.jsx)(t,{id:`ktspdq`})})]}),e[26]=U):U=e[26];let W=!b,G;e[27]===T?G=e[28]:(G=e=>T({fileTreeIndicators:e}),e[27]=T,e[28]=G);let K;e[29]!==S||e[30]!==W||e[31]!==G?(K=(0,g.jsxs)(`div`,{className:`flex items-center justify-between gap-3 px-3 py-3`,children:[U,(0,g.jsx)(u,{id:`settings-content-rules-indicators`,"aria-describedby":`settings-content-rules-indicators-description`,checked:S,disabled:W,onCheckedChange:G,"data-testid":`settings-content-rules-indicators`})]}),e[29]=S,e[30]=W,e[31]=G,e[32]=K):K=e[32];let q;e[33]!==I||e[34]!==V||e[35]!==K?(q=(0,g.jsxs)(`div`,{className:`divide-y rounded-md border`,children:[I,V,K]}),e[33]=I,e[34]=V,e[35]=K,e[36]=q):q=e[36];let J;e[37]===Symbol.for(`react.memo_cache_sentinel`)?(J=(0,g.jsx)(`p`,{className:`text-sm text-muted-foreground`,"data-testid":`settings-content-rules-plugins-note`,children:(0,g.jsx)(t,{id:`YDL7N6`})}),e[37]=J):J=e[37];let Y;return e[38]===q?Y=e[39]:(Y=(0,g.jsxs)(`section`,{"aria-labelledby":`settings-content-rules-title`,className:`space-y-4`,"data-testid":`settings-content-rules`,"data-field":`section:content-rules`,children:[D,q,J]}),e[38]=q,e[39]=Y),Y}export{_ as ContentRulesSection};