@inkeep/open-knowledge 0.41.2 → 0.41.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{acp-harness-probe-Ba7DTFOh.mjs → acp-harness-probe-BOwFyTWe.mjs} +2 -2
- package/dist/assets/skills/discovery/SKILL.md +1 -1
- package/dist/assets/skills/project/SKILL.md +1 -1
- package/dist/cli.mjs +45 -45
- package/dist/constants-BVSTPfUv.mjs +2 -0
- package/dist/{git-handle-ZhJgz79A.mjs → git-handle-C0Vkx9lA.mjs} +2 -2
- package/dist/git-handle-z2kbZHY3.mjs +1 -0
- package/dist/index.mjs +1 -1
- package/dist/{init-CBWhyX1U.mjs → init-D6sC54Pr.mjs} +4 -4
- package/dist/init-DBeufZJj.mjs +1 -0
- package/dist/{launch-json-removal-0rPdkMtH.mjs → launch-json-removal-IpmYWqR_.mjs} +2 -2
- package/dist/{loader-C0DzGeNZ.mjs → loader-5nE64IiE.mjs} +2 -2
- package/dist/loader-rVkazX7x.mjs +1 -0
- package/dist/md-manager-B4y6B-tT.mjs +2 -0
- package/dist/{open-browser-BvP05JKj.mjs → open-browser-B4QMCuDE.mjs} +2 -2
- package/dist/parse-worker.mjs +1 -1
- package/dist/{preview-Dn1YxNMX.mjs → preview-cTIYUtdg.mjs} +2 -2
- package/dist/preview-lbNLNqVo.mjs +1 -0
- package/dist/public/assets/{ActivityModeContent-BPE8dCmt.js → ActivityModeContent-V56HhfHm.js} +1 -1
- package/dist/public/assets/{AgentDiffPane-DBIJrjq2.js → AgentDiffPane-DnNDgiq4.js} +1 -1
- package/dist/public/assets/{AgentThreadClientBinder-DIlw7iBC.js → AgentThreadClientBinder-Dg8x_dvd.js} +1 -1
- package/dist/public/assets/{CodeMirrorPropInput-RC4sdh9E.js → CodeMirrorPropInput-CiPNj8ti.js} +1 -1
- package/dist/public/assets/{DocumentContext-DhKWMrL2.js → DocumentContext-BKR16aYr.js} +2 -2
- package/dist/public/assets/{EditorModeToggle-EBc2Cv8z.js → EditorModeToggle-D8dxPhYZ.js} +1 -1
- package/dist/public/assets/{EnableSyncConfirmDialog-Dv9jJ1OH.js → EnableSyncConfirmDialog-BzDGK1B9.js} +1 -1
- package/dist/public/assets/FeedbackForm-B-fO65RC.js +1 -0
- package/dist/public/assets/{GraphPanel-DBxTtvfS.js → GraphPanel-BB3PZd_i.js} +1 -1
- package/dist/public/assets/{LintConfigEditor-COmMwK8k.js → LintConfigEditor-DtvxnniJ.js} +1 -1
- package/dist/public/assets/{ManagedArtifactProperties-urT0cuW8.js → ManagedArtifactProperties-DYQ1JUmF.js} +1 -1
- package/dist/public/assets/{McpConsentDialogBody-QnsIyr5m.js → McpConsentDialogBody-DscJLJPg.js} +1 -1
- package/dist/public/assets/{MermaidDocEditor-CNmMqMG0.js → MermaidDocEditor-wUCR0srX.js} +1 -1
- package/dist/public/assets/{PropertyPanel-mY4SzTn-.js → PropertyPanel-CckAc_Sq.js} +1 -1
- package/dist/public/assets/{ReportBugDialogBody-D6DyX_AO.js → ReportBugDialogBody-BMejD0M2.js} +1 -1
- package/dist/public/assets/{SchemaConfigEditor-DOlc8PRA.js → SchemaConfigEditor-nuU-YHpP.js} +1 -1
- package/dist/public/assets/{SettingsDialogBody-DT5rxl3R.js → SettingsDialogBody-DNdlho-U.js} +1 -1
- package/dist/public/assets/{ShareBranchSwitchDialog-DOd9FqHR.js → ShareBranchSwitchDialog-BzvjNuw_.js} +1 -1
- package/dist/public/assets/{ShareReceiveDialog-WarQNnjb.js → ShareReceiveDialog-CznGTWez.js} +1 -1
- package/dist/public/assets/{ShareReceiveMissDialog-B4qzjtcO.js → ShareReceiveMissDialog-BKcrHSOs.js} +1 -1
- package/dist/public/assets/{SkillEditorActions-BgCcV1OO.js → SkillEditorActions-C7jWaMNZ.js} +1 -1
- package/dist/public/assets/{SourceEditor-iS9U8XVV.js → SourceEditor-DVqYQflP.js} +1 -1
- package/dist/public/assets/{TerminalPanel-DCL0YXc0.js → TerminalPanel-CDDchf68.js} +1 -1
- package/dist/public/assets/{TerminalSessionsHost-CjgiUwL3.js → TerminalSessionsHost-DEXiA3WZ.js} +2 -2
- package/dist/public/assets/{TerminalWindowApp-BZhG11Jf.js → TerminalWindowApp-CSzPSa7h.js} +1 -1
- package/dist/public/assets/{ThreadView-BExAZkQQ.js → ThreadView-CoHq4aL7.js} +1 -1
- package/dist/public/assets/{TimelineDiffPane-BBVTd7ZF.js → TimelineDiffPane-BTaUZ3Kb.js} +1 -1
- package/dist/public/assets/{agent-diff-store-C_yI-auj.js → agent-diff-store-CE54PhoR.js} +1 -1
- package/dist/public/assets/{agent-visibility-BKKH1E-K.js → agent-visibility-BsnQwNdc.js} +1 -1
- package/dist/public/assets/{auth-state-cache-BYWBVAT1.js → auth-state-cache-nPfU5e_O.js} +7 -7
- package/dist/public/assets/{client-version-D0idjqLu.js → client-version-C9dKI6XY.js} +1 -1
- package/dist/public/assets/{config-provider-DDGPIoo7.js → config-provider-DNKyP_6q.js} +1 -1
- package/dist/public/assets/{dist-DgX6o3Xd.js → dist-BGfU2QP2.js} +1 -1
- package/dist/public/assets/{doc-hash-CzmSG2uM.js → doc-hash-BSk1YYn9.js} +1 -1
- package/dist/public/assets/{documents-events-0MJ8ER3I.js → documents-events-BtgGTIqA.js} +1 -1
- package/dist/public/assets/{file-tree-adapter-DGXFJhkO.js → file-tree-adapter-C0J3tc2q.js} +1 -1
- package/dist/public/assets/{file-tree-utils-BvgxJuFW.js → file-tree-utils-DAVYMBYf.js} +1 -1
- package/dist/public/assets/{globals-CpkAXqfZ.js → globals-CnEbugkx.js} +1 -1
- package/dist/public/assets/{index-DDSda67s.js → index-CQ4DveM_.js} +7 -7
- package/dist/public/assets/{lint-config-client-DXbikwgI.js → lint-config-client-CNmTHHQl.js} +1 -1
- package/dist/public/assets/{markdownlint-rule-browser-DHpnQBnJ.js → markdownlint-rule-browser-IrQQnbe7.js} +1 -1
- package/dist/public/assets/{navigation-targets-Bo1TKplU.js → navigation-targets-CGUSVL6j.js} +1 -1
- package/dist/public/assets/{open-managed-artifact-tab-Dvme3cv4.js → open-managed-artifact-tab-CxOXkAIY.js} +1 -1
- package/dist/public/assets/{pending-receive-nav-store-CVH9OLs-.js → pending-receive-nav-store-D4kTIsaK.js} +1 -1
- package/dist/public/assets/{prop-types-BjU4ptk9.js → prop-types-Benz74B2.js} +1 -1
- package/dist/public/assets/{receive-store-DHX5arqk.js → receive-store-DbySZt8N.js} +1 -1
- package/dist/public/assets/{selection-context-Cp7p3Q_N.js → selection-context-DCJMxWzU.js} +1 -1
- package/dist/public/assets/{skill-actions-bZFiRAYm.js → skill-actions-S0UIcdB8.js} +1 -1
- package/dist/public/assets/{skills-api-DstI-vVv.js → skills-api-D8XA69bH.js} +1 -1
- package/dist/public/assets/{src-CAZXe_Ov.js → src-DrSxCOVW.js} +1 -1
- package/dist/public/assets/{tag-pill-input-C7Caa2Cw.js → tag-pill-input-CScqBN3p.js} +1 -1
- package/dist/public/assets/{target-navigation-intent-B54BgTCv.js → target-navigation-intent-mVGCycSm.js} +1 -1
- package/dist/public/assets/{terminal-launch-events-DG8hI3w-.js → terminal-launch-events-BMUxfSI9.js} +1 -1
- package/dist/public/assets/{terminal-telemetry-DSZCcYb_.js → terminal-telemetry-BbC-kUyB.js} +1 -1
- package/dist/public/assets/{typing-burst-detector-DfFn9ASH.js → typing-burst-detector-w83TGJFT.js} +1 -1
- package/dist/public/assets/{uninstall-C2rwdK6e.js → uninstall-B8_uL8NV.js} +1 -1
- package/dist/public/assets/{use-activity-panel-CHsvsZ8L.js → use-activity-panel-YhP8vGtR.js} +1 -1
- package/dist/public/assets/{use-apply-config-color-theme-Gy3JNvol.js → use-apply-config-color-theme-u-JcfGJu.js} +1 -1
- package/dist/public/assets/{use-collab-url-9qlw7MfN.js → use-collab-url-DRZdoC-F.js} +1 -1
- package/dist/public/assets/{use-live-xterm-theme-7CBgYc0a.js → use-live-xterm-theme-DcxHtUZd.js} +1 -1
- package/dist/public/assets/{use-settings-route-DEm8dDzV.js → use-settings-route-CcWyPW0f.js} +1 -1
- package/dist/public/assets/{use-terminal-enabled-Bx_nsTHh.js → use-terminal-enabled-DznqTIoa.js} +1 -1
- package/dist/public/assets/{use-timeline-entry-diff-Y2CdT0M4.js → use-timeline-entry-diff-CYoaYTqW.js} +1 -1
- package/dist/public/assets/{use-workspace-DnIHeQAh.js → use-workspace-RSGV5qeq.js} +1 -1
- package/dist/public/assets/{workspace-paths-CGx2PUFr.js → workspace-paths-CTLwXmK5.js} +1 -1
- package/dist/public/index.html +36 -36
- package/dist/public/uninstall.html +3 -3
- package/dist/{repair-launch-json-BVxKvPAo.mjs → repair-launch-json-DcHGX6hC.mjs} +2 -2
- package/dist/{repair-mcp-configs-CL00iu8h.mjs → repair-mcp-configs-CPUx3Y1R.mjs} +2 -2
- package/dist/repair-skills-BNFFh5kk.mjs +1 -0
- package/dist/{repair-skills-xgU4BBSK.mjs → repair-skills-XXmzc0-v.mjs} +2 -2
- package/dist/{server-lock-D7lpEbZj.mjs → server-lock-NDXM24F6.mjs} +2 -2
- package/dist/server-lock-l_qcQskg.mjs +1 -0
- package/dist/{src-3SN72BHH.mjs → src-BTs5LPkM.mjs} +20 -20
- package/dist/src-BbntdRLo.mjs +3265 -0
- package/dist/src-CdRO3m1f.mjs +1 -0
- package/dist/{src-CxD3JHmH.mjs → src-CriPjh3C.mjs} +6 -6
- package/dist/{start-5e_XN39i.mjs → start-Bo1-QvAn.mjs} +2 -2
- package/dist/start-C0xMv3I3.mjs +1 -0
- package/dist/{write-project-skill-4OvW1cn1.mjs → write-project-skill-C-xPIQus.mjs} +3 -3
- package/package.json +4 -4
- package/dist/constants-Ej-ZzjYT.mjs +0 -2
- package/dist/git-handle-Cg7vsIVu.mjs +0 -1
- package/dist/init-BHsIRFIC.mjs +0 -1
- package/dist/loader-CjpqkbhW.mjs +0 -1
- package/dist/md-manager-BOzKVLRL.mjs +0 -2
- package/dist/preview-DSJriqm9.mjs +0 -1
- package/dist/public/assets/FeedbackForm-Bb9Yf3Zz.js +0 -1
- package/dist/repair-skills-DnayrFzZ.mjs +0 -1
- package/dist/server-lock-CIl-U-as.mjs +0 -1
- package/dist/src-Cf8OhPA7.mjs +0 -1
- package/dist/src-DAzaO37g.mjs +0 -3265
- package/dist/start-DULQ0fI2.mjs +0 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./pdf-BuVCb1O9.js","./preload-helper-Chd9yIcd.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{o as e,t}from"./chunk-CYidjpOJ.js";import{t as n}from"./preload-helper-Chd9yIcd.js";import{t as r}from"./jsx-runtime-BUgB2tll.js";import{t as i}from"./react-f2sANaYj.js";import{n as a,r as o}from"./dist-Nvb76hAm.js";import{n as s}from"./dist-PQ5KMVDh.js";import{t as c}from"./react-dom-DPxgxlDT.js";import{t as l}from"./compiler-runtime-BfE3aGVn.js";import{a as u,c as d,i as f,l as p,o as m,s as h,t as g,u as _}from"./terminal-input-events-C5UuEsAB.js";import{a as v,s as y,t as b}from"./createLucideIcon-DAkhoPjT.js";import{t as x}from"./button-Gol9BgNB.js";import{l as S,n as C}from"./dist-D6h-uzOv.js";import{i as w,n as T,t as E}from"./tooltip-B4J7VHmA.js";import{n as D,r as O,t as k}from"./collapsible-B1mS1n9y.js";import{a as A,c as j,d as M,f as N,i as P,l as F,n as I,o as L,r as ee,s as R,t as te,u as z}from"./dialog-D1Bdnm4T.js";import{A as ne,C as re,D as ie,E as ae,F as B,H as oe,I as se,J as ce,K as V,L as le,M as H,N as ue,O as U,P as de,Q as W,R as G,S as fe,U as pe,V as me,W as he,Y as ge,Z as K,_ as q,at as J,c as _e,d as ve,ft as ye,g as be,h as xe,it as Se,j as Ce,k as we,lt as Te,m as Ee,n as De,nt as Oe,ot as ke,p as Ae,r as je,rt as Me,s as Ne,st as Pe,t as Fe,v as Ie,w as Le,x as Re,y as ze,z as Be}from"./CodeMirrorPropInput-RC4sdh9E.js";import{a as Ve,d as He,i as Ue,l as We,r as Ge,u as Ke}from"./floating-ui.dom-DxCSXcm6.js";import{a as qe,i as Je,n as Ye,o as Xe,r as Ze,s as Qe,t as $e}from"./switch-DYic2V-1.js";import{$a as et,$i as tt,$n as nt,Ai as rt,An as it,Bi as at,Bn as ot,Bt as st,C as ct,Ca as lt,Da as ut,Dn as dt,Dr as ft,Ea as pt,Ei as mt,Et as ht,Fi as gt,G as _t,Gi as vt,Gt as yt,Hn as bt,Hr as xt,In as St,Ir as Ct,J as wt,Jn as Tt,Jt as Et,K as Dt,Kn as Ot,Kr as kt,Li as At,Ln as jt,M as Mt,Mi as Nt,Mr as Pt,Ni as Ft,Nr as It,On as Lt,Or as Rt,Ot as zt,Pi as Bt,Pr as Vt,Qa as Ht,Qi as Ut,Qn as Wt,Qr as Gt,Rn as Kt,Rr as qt,S as Jt,Si as Yt,Sn as Xt,Sr as Zt,St as Qt,T as $t,Ti as en,Tt as tn,U as nn,Va as rn,Vi as an,Vr as on,Wi as sn,Xi as cn,Xn as ln,Y as un,Yi as dn,Yr as fn,Z as pn,Zr as mn,Zt as hn,_r as gn,_t as _n,ai as vn,ar as yn,at as bn,bi as xn,ca as Sn,cn as Cn,cr as wn,da as Tn,di as En,dn as Dn,dt as On,ea as kn,eo as An,er as jn,fa as Mn,fr as Nn,ft as Pn,ga as Fn,gr as In,gt as Ln,ia as Rn,ir as zn,it as Bn,jr as Vn,kn as Hn,kr as Un,kt as Wn,la as Gn,li as Kn,ma as qn,mn as Jn,na as Yn,ni as Xn,nr as Zn,nt as Qn,oa as $n,or as er,pa as tr,q as nr,qi as rr,qr as ir,qt as ar,ra as or,rr as sr,s as cr,si as lr,sr as ur,ta as dr,tr as fr,tt as pr,ui as mr,un as hr,ur as gr,vi as _r,wa as vr,wi as yr,wr as br,wt as xr,xi as Sr,xr as Cr,yi as wr}from"./dist-DgX6o3Xd.js";import{t as Tr}from"./trace-api-DHyWZzIa.js";import{n as Er,t as Dr}from"./propagation-api-OHat7V1z.js";import"./lib-Iu39CNZE.js";import{n as Or,t as kr}from"./git-branch-CMJAiYLz.js";import{t as Ar}from"./check-GqWaoTdV.js";import{t as jr}from"./chevron-down-Bx9f3tW-.js";import{t as Mr}from"./chevron-right-C8oTR6gu.js";import{n as Nr,t as Pr}from"./CopyButton-1Q6Wnnjb.js";import{i as Fr,o as Ir,r as Lr,s as Rr}from"./prop-types-BjU4ptk9.js";import{a as zr,d as Br,l as Vr,r as Hr,t as Ur,u as Wr}from"./workspace-paths-CGx2PUFr.js";import{t as Gr}from"./copy-9EDFYcyR.js";import{t as Kr}from"./eye-CASw1HTi.js";import{t as qr}from"./folder-open-wLd69QUc.js";import{t as Jr}from"./hash-DNKDqZ18.js";import{t as Yr}from"./info-yKMseklR.js";import{t as Xr}from"./loader-circle-Cg5SU7AZ.js";import{t as Zr}from"./minus-SecfYzeQ.js";import{t as Qr}from"./paperclip-CX7J_G-w.js";import{t as $r}from"./sliders-horizontal-DhMBnUFY.js";import{t as ei}from"./trash-2-DDVTy8gQ.js";import{t as ti}from"./triangle-alert-B0VxKCJQ.js";import{t as ni}from"./x-Cw3EsDCQ.js";import{n as ri}from"./dist-BTjBKsmV.js";import{t as ii}from"./input-7sjA3n4i.js";import{t as Y}from"./dist-0uiGbm0b.js";import{t as ai}from"./parse-api-error-mt0p1S6a.js";import{t as oi}from"./file-tree-rename-validation-BUgsIr8g.js";import{d as si,n as ci,p as li}from"./navigation-targets-Bo1TKplU.js";import{r as ui,t as di}from"./documents-events-0MJ8ER3I.js";import{a as X,o as fi,t as pi}from"./startup-marks-DzPXEHWK.js";import{c as mi,f as hi,h as gi,l as _i,n as vi,o as yi,r as bi,s as xi}from"./doc-hash-CzmSG2uM.js";import{t as Si}from"./badge-DBfQWFob.js";import{$ as Ci,A as wi,C as Ti,D as Ei,E as Di,F as Oi,G as ki,H as Ai,I as ji,J as Mi,K as Ni,L as Pi,M as Fi,O as Ii,P as Li,Q as Ri,R as zi,S as Bi,T as Vi,U as Hi,W as Ui,X as Wi,Y as Gi,Z as Ki,_ as qi,a as Ji,at as Yi,b as Xi,c as Zi,d as Qi,et as $i,f as ea,g as ta,h as na,i as ra,it as ia,j as aa,k as oa,l as sa,m as ca,nt as la,o as ua,p as da,q as fa,r as pa,rt as ma,s as ha,tt as ga,u as _a,v as va,w as ya,x as ba,y as xa}from"./config-provider-DDGPIoo7.js";import{n as Sa}from"./use-collab-url-9qlw7MfN.js";import{E as Ca,N as wa,Ot as Ta,X as Ea,c as Da,dt as Oa,f as ka,ft as Aa,l as ja}from"./dist-BoIv4SAA.js";import{a as Ma,i as Na,o as Pa,r as Fa}from"./esm-CYdiz24Y.js";import{t as Ia}from"./dist-Ci4TMg-i.js";import{n as La}from"./dist-BDUhB1eX.js";import{n as Ra}from"./dist-C-31u2Hx.js";import{n as za}from"./dist-CpB1fiWh2.js";import{n as Ba}from"./dist-DU-4Kwni.js";import{n as Va}from"./dist-CHDGRvTt.js";import{t as Ha}from"./stex-ChFXL4wJ.js";import{n as Ua}from"./config-context-BD8I9DHH.js";import{n as Wa,r as Ga}from"./external-link-CkJSCVND.js";(function(){var e=[`user-blocking`,`user-visible`,`background`];class t{constructor(){this.t=new MessageChannel,this.i=this.t.port2,this.l={},this.o=1,this.t.port1.onmessage=e=>this.h(e)}u(e){var t=this.o++;return this.l[t]=e,this.i.postMessage(t),t}p(e){delete this.l[e]}h(e){var t=e.data;if(t in this.l){var n=this.l[t];delete this.l[t],n()}}}function n(){return n.v||=new t,n.v}class r{constructor(e,t,n){n===void 0&&(n=0),this.k=e,this.T=null,this.C=null,this.m=!1,this._(t,n)}isIdleCallback(){return this.T===0}I(){return this.T===2}cancel(){if(!this.m)switch(this.m=!0,this.T){case 0:cancelIdleCallback(this.C);break;case 1:clearTimeout(this.C);break;case 2:n().p(this.C);break;default:throw TypeError(`Unknown CallbackType`)}}_(t,r){if(r&&r>0)return this.T=1,void(this.C=setTimeout(()=>{this.P()},r));if(!e.includes(t))throw TypeError(`Invalid task priority : `+t);t===`background`&&typeof requestIdleCallback==`function`?(this.T=0,this.C=requestIdleCallback(()=>{this.P()})):typeof MessageChannel==`function`?(this.T=2,this.C=n().u(()=>{this.P()})):(this.T=1,this.C=setTimeout(()=>{this.P()}))}P(){this.m||this.k()}}var i=0;class a{constructor(){this.j=null,this.M=null}isEmpty(){return this.j==null}push(e){if(typeof e!=`object`)throw TypeError(`Task must be an Object`);e.A=i++,this.isEmpty()?(e.N=null,this.j=e):(e.N=this.M,this.M.O=e),e.O=null,this.M=e}takeNextTask(){if(this.isEmpty())return null;var e=this.j;return this.q(e),e}merge(e,t){if(typeof t!=`function`)throw TypeError(`Must provide a selector function.`);if(e==null)throw Error(`sourceQueue cannot be null`);for(var n=this.j,r=null,i=e.j;i;){var a=i;if(i=i.O,t(a)){for(e.q(a);n&&n.A<a.A;)r=n,n=n.O;this.D(a,r),r=a}}}D(e,t){if(t!=this.M){var n=t?t.O:this.j;e.O=n,n.N=e,e.N=t,t==null?this.j=e:t.O=e}else this.push(e)}q(e){if(e==null)throw Error(`Expected task to be non-null`);e===this.j&&(this.j=e.O),e===this.M&&(this.M=this.M.N),e.O&&(e.O.N=e.N),e.N&&(e.N.O=e.O)}}class o extends Event{constructor(t,n){if(!n||!e.includes(n.previousPriority))throw TypeError(`Invalid task priority: '`+n.previousPriority+`'`);super(t),this.previousPriority=n.previousPriority}}class s extends AbortController{constructor(t){if(t===void 0&&(t={}),super(),t??={},typeof t!=`object`)throw TypeError(`'init' is not an object`);var n,r,i=t.priority===void 0?`user-visible`:t.priority;if(!e.includes(i))throw TypeError(`Invalid task priority: '`+i+`'`);this.H=i,this.R=!1,r=(n=this).signal,Object.defineProperties(r,{priority:{get:function(){return n.H},enumerable:!0},onprioritychange:{value:null,writable:!0,enumerable:!0}}),r.addEventListener(`prioritychange`,e=>{r.onprioritychange&&r.onprioritychange(e)})}setPriority(t){if(!e.includes(t))throw TypeError(`Invalid task priority: `+t);if(this.R)throw new DOMException(``,`NotAllowedError`);if(this.signal.priority!==t){this.R=!0;var n=this.H;this.H=t;var r=new o(`prioritychange`,{previousPriority:n});this.signal.dispatchEvent(r),this.R=!1}}}self.scheduler===void 0?(self.scheduler=new class{constructor(){this.S={},e.forEach(e=>{this.S[e]=[new a,new a]}),this.U=null,this.W=new WeakMap}yield(){return this.B(()=>{},{priority:`user-visible`},!0)}postTask(e,t){return this.B(e,t,!1)}B(t,n,r){if((n=Object.assign({},n)).signal!==void 0){if(n.signal===null||!(`aborted`in n.signal)||typeof n.signal.addEventListener!=`function`)return Promise.reject(TypeError(`'signal' is not a valid 'AbortSignal'`));if(n.signal&&n.signal.priority&&!e.includes(n.signal.priority))return Promise.reject(TypeError(`Invalid task priority: '`+n.signal.priority+`'`))}if(n.priority!==void 0&&(n.priority===null||!e.includes(n.priority)))return Promise.reject(TypeError(`Invalid task priority: '`+n.priority+`'`));if(n.delay===void 0&&(n.delay=0),n.delay=Number(n.delay),n.delay<0)return Promise.reject(TypeError(`'delay' must be a positive number.`));var i={callback:t,options:n,resolve:null,reject:null,hostCallback:null,abortCallback:null,onTaskCompleted:function(){this.options.signal&&this.abortCallback&&(this.options.signal.removeEventListener(`abort`,this.abortCallback),this.abortCallback=null)},onTaskAborted:function(){this.hostCallback&&=(this.hostCallback.cancel(),null),this.options.signal.removeEventListener(`abort`,this.abortCallback),this.abortCallback=null,this.reject(this.options.signal.reason)},isAborted:function(){return this.options.signal&&this.options.signal.aborted},isContinuation:r},a=new Promise((e,t)=>{i.resolve=e,i.reject=t});return this._(i),a}_(e){var t=e.options.signal;if(t){if(t.aborted)return void e.reject(t.reason);e.abortCallback=()=>{e.onTaskAborted()},t.addEventListener(`abort`,e.abortCallback)}e.options.delay>0?e.hostCallback=new r(()=>{e.hostCallback=null,this.F(e)},null,e.options.delay):(this.G(e),this.J())}F(e){this.G(e),this.U&&=(this.U.cancel(),null),this.K()}L(e){var t=this.W.get(e);if(t===void 0)throw Error(`Attempting to change priority on an unregistered signal`);if(t!==e.priority){for(var n=0;n<2;n++)this.S[e.priority][n].merge(this.S[t][n],t=>t.options.signal===e);this.W.set(e,e.priority)}}K(){this.U=null,this.V(),this.J()}J(){var{priority:e}=this.X();e!=null&&(e!==`background`&&this.U&&this.U.isIdleCallback()&&(this.U.cancel(),this.U=null),this.U||=new r(()=>{this.K()},e,0))}G(t){var n;if(!e.includes(n=t.options.priority?t.options.priority:t.options.signal&&t.options.signal.priority?t.options.signal.priority:`user-visible`))throw TypeError(`Invalid task priority: `+n);if(t.options.signal&&t.options.signal.priority){var r=t.options.signal;this.W.has(r)||(r.addEventListener(`prioritychange`,()=>{this.L(r)}),this.W.set(r,r.priority))}this.S[n][+!t.isContinuation].push(t)}V(){var e=null;do{var{priority:t,type:n}=this.X();if(t==null)return;e=this.S[t][n].takeNextTask()}while(e.isAborted());try{var r=e.callback();e.resolve(r)}catch(t){e.reject(t)}finally{e.onTaskCompleted()}}X(){for(var t=0;t<e.length;t++)for(var n=e[t],r=0;r<2;r++)if(!this.S[n][r].isEmpty())return{priority:n,type:r};return{priority:null,type:0}}},self.TaskController=s,self.TaskPriorityChangeEvent=o):self.scheduler.yield||(self.scheduler.yield=function(){return self.scheduler.postTask(()=>{},{priority:`user-blocking`})})})();var Ka=b(`book-open`,[[`path`,{d:`M12 7v14`,key:`1akyts`}],[`path`,{d:`M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z`,key:`ruj8y`}]]),qa=b(`box`,[[`path`,{d:`M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z`,key:`hh9hay`}],[`path`,{d:`m3.3 7 8.7 5 8.7-5`,key:`g66t2b`}],[`path`,{d:`M12 22V12`,key:`d0xqtd`}]]),Ja=b(`bug`,[[`path`,{d:`M12 20v-9`,key:`1qisl0`}],[`path`,{d:`M14 7a4 4 0 0 1 4 4v3a6 6 0 0 1-12 0v-3a4 4 0 0 1 4-4z`,key:`uouzyp`}],[`path`,{d:`M14.12 3.88 16 2`,key:`qol33r`}],[`path`,{d:`M21 21a4 4 0 0 0-3.81-4`,key:`1b0z45`}],[`path`,{d:`M21 5a4 4 0 0 1-3.55 3.97`,key:`5cxbf6`}],[`path`,{d:`M22 13h-4`,key:`1jl80f`}],[`path`,{d:`M3 21a4 4 0 0 1 3.81-4`,key:`1fjd4g`}],[`path`,{d:`M3 5a4 4 0 0 0 3.55 3.97`,key:`1d7oge`}],[`path`,{d:`M6 13H2`,key:`82j7cp`}],[`path`,{d:`m8 2 1.88 1.88`,key:`fmnt4t`}],[`path`,{d:`M9 7.13V6a3 3 0 1 1 6 0v1.13`,key:`1vgav8`}]]),Ya=b(`chart-column`,[[`path`,{d:`M3 3v16a2 2 0 0 0 2 2h16`,key:`c24i48`}],[`path`,{d:`M18 17V9`,key:`2bz60n`}],[`path`,{d:`M13 17V5`,key:`1frdt8`}],[`path`,{d:`M8 17v-3`,key:`17ska0`}]]),Xa=b(`circle-question-mark`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3`,key:`1u773s`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}]]),Za=b(`circle-x`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m15 9-6 6`,key:`1uzhvr`}],[`path`,{d:`m9 9 6 6`,key:`z0biqf`}]]),Qa=b(`clipboard-list`,[[`rect`,{width:`8`,height:`4`,x:`8`,y:`2`,rx:`1`,ry:`1`,key:`tgr4d6`}],[`path`,{d:`M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2`,key:`116196`}],[`path`,{d:`M12 11h4`,key:`1jrz19`}],[`path`,{d:`M12 16h4`,key:`n85exb`}],[`path`,{d:`M8 11h.01`,key:`1dfujw`}],[`path`,{d:`M8 16h.01`,key:`18s6g9`}]]),$a=b(`clock-3`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 6v6h4`,key:`135r8i`}]]),eo=b(`code-xml`,[[`path`,{d:`m18 16 4-4-4-4`,key:`1inbqp`}],[`path`,{d:`m6 8-4 4 4 4`,key:`15zrgr`}],[`path`,{d:`m14.5 4-5 16`,key:`e7oirm`}]]),to=b(`code`,[[`path`,{d:`m16 18 6-6-6-6`,key:`eg8j8`}],[`path`,{d:`m8 6-6 6 6 6`,key:`ppft3o`}]]),no=b(`eraser`,[[`path`,{d:`M21 21H8a2 2 0 0 1-1.42-.587l-3.994-3.999a2 2 0 0 1 0-2.828l10-10a2 2 0 0 1 2.829 0l5.999 6a2 2 0 0 1 0 2.828L12.834 21`,key:`g5wo59`}],[`path`,{d:`m5.082 11.09 8.828 8.828`,key:`1wx5vj`}]]),ro=b(`external-link`,[[`path`,{d:`M15 3h6v6`,key:`1q9fwt`}],[`path`,{d:`M10 14 21 3`,key:`gplh6r`}],[`path`,{d:`M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6`,key:`a6xqqp`}]]),io=b(`file-image`,[[`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`}],[`circle`,{cx:`10`,cy:`12`,r:`2`,key:`737tya`}],[`path`,{d:`m20 17-1.296-1.296a2.41 2.41 0 0 0-3.408 0L9 22`,key:`wt3hpn`}]]),ao=b(`file-up`,[[`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:`M12 12v6`,key:`3ahymv`}],[`path`,{d:`m15 15-3-3-3 3`,key:`15xj92`}]]),oo=b(`file`,[[`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`}]]),so=b(`flask-conical`,[[`path`,{d:`M14 2v6a2 2 0 0 0 .245.96l5.51 10.08A2 2 0 0 1 18 22H6a2 2 0 0 1-1.755-2.96l5.51-10.08A2 2 0 0 0 10 8V2`,key:`18mbvz`}],[`path`,{d:`M6.453 15h11.094`,key:`3shlmq`}],[`path`,{d:`M8.5 2h7`,key:`csnxdl`}]]),co=b(`heading-1`,[[`path`,{d:`M4 12h8`,key:`17cfdx`}],[`path`,{d:`M4 18V6`,key:`1rz3zl`}],[`path`,{d:`M12 18V6`,key:`zqpxq5`}],[`path`,{d:`m17 12 3-2v8`,key:`1hhhft`}]]),lo=b(`heading-2`,[[`path`,{d:`M4 12h8`,key:`17cfdx`}],[`path`,{d:`M4 18V6`,key:`1rz3zl`}],[`path`,{d:`M12 18V6`,key:`zqpxq5`}],[`path`,{d:`M21 18h-4c0-4 4-3 4-6 0-1.5-2-2.5-4-1`,key:`9jr5yi`}]]),uo=b(`heading-3`,[[`path`,{d:`M4 12h8`,key:`17cfdx`}],[`path`,{d:`M4 18V6`,key:`1rz3zl`}],[`path`,{d:`M12 18V6`,key:`zqpxq5`}],[`path`,{d:`M17.5 10.5c1.7-1 3.5 0 3.5 1.5a2 2 0 0 1-2 2`,key:`68ncm8`}],[`path`,{d:`M17 17.5c2 1.5 4 .3 4-1.5a2 2 0 0 0-2-2`,key:`1ejuhz`}]]),fo=b(`layout-grid`,[[`rect`,{width:`7`,height:`7`,x:`3`,y:`3`,rx:`1`,key:`1g98yp`}],[`rect`,{width:`7`,height:`7`,x:`14`,y:`3`,rx:`1`,key:`6d4xhi`}],[`rect`,{width:`7`,height:`7`,x:`14`,y:`14`,rx:`1`,key:`nxv5o0`}],[`rect`,{width:`7`,height:`7`,x:`3`,y:`14`,rx:`1`,key:`1bb6yr`}]]),po=b(`layout-panel-top`,[[`rect`,{width:`18`,height:`7`,x:`3`,y:`3`,rx:`1`,key:`f1a2em`}],[`rect`,{width:`7`,height:`7`,x:`3`,y:`14`,rx:`1`,key:`1bb6yr`}],[`rect`,{width:`7`,height:`7`,x:`14`,y:`14`,rx:`1`,key:`nxv5o0`}]]),mo=b(`lightbulb`,[[`path`,{d:`M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5`,key:`1gvzjb`}],[`path`,{d:`M9 18h6`,key:`x1upvd`}],[`path`,{d:`M10 22h4`,key:`ceow96`}]]),ho=b(`link-2-off`,[[`path`,{d:`M9 17H7A5 5 0 0 1 7 7`,key:`10o201`}],[`path`,{d:`M15 7h2a5 5 0 0 1 4 8`,key:`1d3206`}],[`line`,{x1:`8`,x2:`12`,y1:`12`,y2:`12`,key:`rvw6j4`}],[`line`,{x1:`2`,x2:`22`,y1:`2`,y2:`22`,key:`a6p6uj`}]]),go=[[`path`,{d:`M9 17H7A5 5 0 0 1 7 7h2`,key:`8i5ue5`}],[`path`,{d:`M15 7h2a5 5 0 1 1 0 10h-2`,key:`1b9ql8`}],[`line`,{x1:`8`,x2:`16`,y1:`12`,y2:`12`,key:`1jonct`}]],_o=b(`link-2`,go),vo=b(`list-ordered`,[[`path`,{d:`M11 5h10`,key:`1cz7ny`}],[`path`,{d:`M11 12h10`,key:`1438ji`}],[`path`,{d:`M11 19h10`,key:`11t30w`}],[`path`,{d:`M4 4h1v5`,key:`10yrso`}],[`path`,{d:`M4 9h2`,key:`r1h2o0`}],[`path`,{d:`M6.5 20H3.4c0-1 2.6-1.925 2.6-3.5a1.5 1.5 0 0 0-2.6-1.02`,key:`xtkcd5`}]]),yo=b(`list-todo`,[[`path`,{d:`M13 5h8`,key:`a7qcls`}],[`path`,{d:`M13 12h8`,key:`h98zly`}],[`path`,{d:`M13 19h8`,key:`c3s6r1`}],[`path`,{d:`m3 17 2 2 4-4`,key:`1jhpwq`}],[`rect`,{x:`3`,y:`4`,width:`6`,height:`6`,rx:`1`,key:`cif1o7`}]]),bo=b(`list`,[[`path`,{d:`M3 5h.01`,key:`18ugdj`}],[`path`,{d:`M3 12h.01`,key:`nlz23k`}],[`path`,{d:`M3 19h.01`,key:`noohij`}],[`path`,{d:`M8 5h13`,key:`1pao27`}],[`path`,{d:`M8 12h13`,key:`1za7za`}],[`path`,{d:`M8 19h13`,key:`m83p4d`}]]),xo=b(`message-square-warning`,[[`path`,{d:`M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z`,key:`18887p`}],[`path`,{d:`M12 15h.01`,key:`q59x07`}],[`path`,{d:`M12 7v4`,key:`xawao1`}]]),So=b(`octagon-alert`,[[`path`,{d:`M12 16h.01`,key:`1drbdi`}],[`path`,{d:`M12 8v4`,key:`1got3b`}],[`path`,{d:`M15.312 2a2 2 0 0 1 1.414.586l4.688 4.688A2 2 0 0 1 22 8.688v6.624a2 2 0 0 1-.586 1.414l-4.688 4.688a2 2 0 0 1-1.414.586H8.688a2 2 0 0 1-1.414-.586l-4.688-4.688A2 2 0 0 1 2 15.312V8.688a2 2 0 0 1 .586-1.414l4.688-4.688A2 2 0 0 1 8.688 2z`,key:`1fd625`}]]),Co=b(`panel-left`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M9 3v18`,key:`fh3hqa`}]]),wo=b(`panel-top`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M3 9h18`,key:`1pudct`}]]),To=b(`quote`,[[`path`,{d:`M16 3a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2 1 1 0 0 1 1 1v1a2 2 0 0 1-2 2 1 1 0 0 0-1 1v2a1 1 0 0 0 1 1 6 6 0 0 0 6-6V5a2 2 0 0 0-2-2z`,key:`rib7q0`}],[`path`,{d:`M5 3a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2 1 1 0 0 1 1 1v1a2 2 0 0 1-2 2 1 1 0 0 0-1 1v2a1 1 0 0 0 1 1 6 6 0 0 0 6-6V5a2 2 0 0 0-2-2z`,key:`1ymkrd`}]]),Eo=b(`search`,[[`path`,{d:`m21 21-4.34-4.34`,key:`14j7rj`}],[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}]]),Do=b(`settings-2`,[[`path`,{d:`M14 17H5`,key:`gfn3mx`}],[`path`,{d:`M19 7h-9`,key:`6i9tg`}],[`circle`,{cx:`17`,cy:`17`,r:`3`,key:`18b49y`}],[`circle`,{cx:`7`,cy:`7`,r:`3`,key:`dfmy0x`}]]),Oo=b(`shapes`,[[`path`,{d:`M8.3 10a.7.7 0 0 1-.626-1.079L11.4 3a.7.7 0 0 1 1.198-.043L16.3 8.9a.7.7 0 0 1-.572 1.1Z`,key:`1bo67w`}],[`rect`,{x:`3`,y:`14`,width:`7`,height:`7`,rx:`1`,key:`1bkyp8`}],[`circle`,{cx:`17.5`,cy:`17.5`,r:`3.5`,key:`w3z12y`}]]),ko=b(`shield-alert`,[[`path`,{d:`M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z`,key:`oel41y`}],[`path`,{d:`M12 8v4`,key:`1got3b`}],[`path`,{d:`M12 16h.01`,key:`1drbdi`}]]),Ao=b(`sigma`,[[`path`,{d:`M18 7V5a1 1 0 0 0-1-1H6.5a.5.5 0 0 0-.4.8l4.5 6a2 2 0 0 1 0 2.4l-4.5 6a.5.5 0 0 0 .4.8H17a1 1 0 0 0 1-1v-2`,key:`wuwx1p`}]]),jo=b(`square-play`,[[`rect`,{x:`3`,y:`3`,width:`18`,height:`18`,rx:`2`,key:`h1oib`}],[`path`,{d:`M9 9.003a1 1 0 0 1 1.517-.859l4.997 2.997a1 1 0 0 1 0 1.718l-4.997 2.997A1 1 0 0 1 9 14.996z`,key:`kmsa83`}]]),Mo=b(`superscript`,[[`path`,{d:`m4 19 8-8`,key:`hr47gm`}],[`path`,{d:`m12 19-8-8`,key:`1dhhmo`}],[`path`,{d:`M20 12h-4c0-1.5.442-2 1.5-2.5S20 8.334 20 7.002c0-.472-.17-.93-.484-1.29a2.105 2.105 0 0 0-2.617-.436c-.42.239-.738.614-.899 1.06`,key:`1dfcux`}]]),No=b(`table-2`,[[`path`,{d:`M9 3H5a2 2 0 0 0-2 2v4m6-6h10a2 2 0 0 1 2 2v4M9 3v18m0 0h10a2 2 0 0 0 2-2V9M9 21H5a2 2 0 0 1-2-2V9m0 0h18`,key:`gugj83`}]]),Po=b(`upload`,[[`path`,{d:`M12 3v12`,key:`1x0j5s`}],[`path`,{d:`m17 8-5-5-5 5`,key:`7q97r8`}],[`path`,{d:`M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4`,key:`ih7n3h`}]]),Fo=b(`workflow`,[[`rect`,{width:`8`,height:`8`,x:`3`,y:`3`,rx:`2`,key:`by2w9f`}],[`path`,{d:`M7 11v4a2 2 0 0 0 2 2h4`,key:`xkn7yn`}],[`rect`,{width:`8`,height:`8`,x:`13`,y:`13`,rx:`2`,key:`1cgmvn`}]]),Io=b(`zap`,[[`path`,{d:`M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z`,key:`1xq2db`}]]),Lo=e(c(),1),Z=l(),Q=e(i(),1),$=r();function Ro(e){return e.kind===`create`?`create:${e.value}`:`tag:${e.value}`}function zo(e){if(e.kind===`create`){let t=e.value;return Y._({id:`XPqe3B`,values:{tagValue:t}})}let t=Y._({id:`pckX1A`,values:{0:e.count}}),n=e.value;return Y._({id:`m2T1Xj`,values:{tagValue:n,uses:t}})}function Bo(e){let t=(0,Z.c)(38),{items:n,query:r,selectedIndex:i,onSelect:s,onHover:c,loading:l,error:u}=e,d=l===void 0?!1:l,f=u===void 0?null:u,{_:p}=o(),m=(0,Q.useRef)(null),h=(0,Q.useId)(),g=i>=0&&i<n.length?`${h}-option-${i}`:void 0,_,v;t[0]===i?(_=t[1],v=t[2]):(_=()=>{let e=m.current;if(!e)return;let t=e.querySelectorAll(`[role="option"]`).item(i);t&&t.scrollIntoView({block:`nearest`})},v=[i],t[0]=i,t[1]=_,t[2]=v),(0,Q.useEffect)(_,v);let y=Vo;if(d){let e;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(e={maxHeight:`var(--suggestion-menu-max-height, 40vh)`},t[3]=e):e=t[3];let n;return t[4]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,$.jsx)(`div`,{ref:m,role:`status`,"aria-live":`polite`,className:`w-64 rounded-lg border bg-popover p-2 shadow-md text-sm text-muted-foreground`,style:e,onMouseDown:y,children:(0,$.jsx)(a,{id:`a_u4ck`})}),t[4]=n):n=t[4],n}if(n.length===0){let e;if(t[5]!==p||t[6]!==f||t[7]!==r){let n=r.trim();e=f??p(n?{id:`9R7pRC`,values:{trimmed:n}}:{id:`KRJ6xh`}),t[5]=p,t[6]=f,t[7]=r,t[8]=e}else e=t[8];let n=e,i;t[9]===Symbol.for(`react.memo_cache_sentinel`)?(i={maxHeight:`var(--suggestion-menu-max-height, 40vh)`},t[9]=i):i=t[9];let a;return t[10]===n?a=t[11]:(a=(0,$.jsx)(`div`,{ref:m,role:`status`,"aria-live":`polite`,className:`w-64 rounded-lg border bg-popover p-2 shadow-md text-sm text-muted-foreground`,style:i,onMouseDown:y,children:n}),t[10]=n,t[11]=a),a}let b=i>=0&&i<n.length?n[i]:null,x;t[12]===p?x=t[13]:(x=p({id:`SCoBBH`}),t[12]=p,t[13]=x);let S;t[14]===Symbol.for(`react.memo_cache_sentinel`)?(S={maxHeight:`var(--suggestion-menu-max-height, 40vh)`},t[14]=S):S=t[14];let C;t[15]===b?C=t[16]:(C=b?zo(b):``,t[15]=b,t[16]=C);let w;t[17]===C?w=t[18]:(w=(0,$.jsx)(`span`,{className:`sr-only`,"aria-live":`polite`,"aria-atomic":`true`,children:C}),t[17]=C,t[18]=w);let T;t[19]===f?T=t[20]:(T=f&&(0,$.jsx)(`div`,{className:`rounded-md px-2 py-1.5 text-xs text-amber-700 dark:text-amber-300`,children:f}),t[19]=f,t[20]=T);let E;if(t[21]!==n||t[22]!==h||t[23]!==c||t[24]!==s||t[25]!==i){let e;t[27]!==h||t[28]!==c||t[29]!==s||t[30]!==i?(e=(e,t)=>{let n=t===i,r=Ro(e),o=e.kind===`create`;return(0,$.jsxs)(`button`,{id:`${h}-option-${t}`,type:`button`,role:`option`,"aria-selected":n,"data-selected":n,"data-testid":o?`tag-suggestion-create`:`tag-suggestion-tag-${e.value}`,className:`flex w-full items-center gap-2 rounded-md px-2 py-1.5 text-sm text-left ${n?`bg-accent text-accent-foreground`:``}`,onMouseDown:t=>{t.preventDefault(),s(e)},onPointerMove:c?()=>c(t):void 0,children:[(0,$.jsx)(`span`,{"aria-hidden":`true`,className:`font-mono text-xs text-muted-foreground`,children:`#`}),(0,$.jsx)(`span`,{className:`truncate font-medium flex-1`,children:e.value}),o?(0,$.jsx)(`span`,{className:`shrink-0 rounded-sm bg-primary/10 px-1.5 py-0.5 text-[10px] font-medium uppercase tracking-wide text-primary`,children:(0,$.jsx)(a,{id:`isRobC`})}):(0,$.jsx)(`span`,{className:`shrink-0 text-[11px] text-muted-foreground tabular-nums`,children:e.count})]},r)},t[27]=h,t[28]=c,t[29]=s,t[30]=i,t[31]=e):e=t[31],E=n.map(e),t[21]=n,t[22]=h,t[23]=c,t[24]=s,t[25]=i,t[26]=E}else E=t[26];let D;return t[32]!==g||t[33]!==E||t[34]!==x||t[35]!==w||t[36]!==T?(D=(0,$.jsxs)(`div`,{ref:m,role:`listbox`,"aria-label":x,"aria-activedescendant":g,tabIndex:-1,onMouseDown:y,className:`w-64 overflow-y-auto subtle-scrollbar rounded-lg border bg-popover p-1 shadow-md`,style:S,children:[w,T,E]}),t[32]=g,t[33]=E,t[34]=x,t[35]=w,t[36]=T,t[37]=D):D=t[37],D}function Vo(e){return e.preventDefault()}var Ho=new dr(`tagSuggestion`),Uo=8,Wo=/^[a-zA-Z][\w/-]*$/;async function Go(){let e=await fetch(`/api/tags`);if(!e.ok)throw Error(`/api/tags responded with ${e.status}`);let t=await e.json();return Array.isArray(t.tags)?t.tags:[]}function Ko(e,t){let n=t.trim(),r=n.toLowerCase(),i=n===``?e.slice():e.filter(e=>e.name.toLowerCase().includes(r));return i.sort((e,t)=>{let n=+!e.name.toLowerCase().startsWith(r),i=+!t.name.toLowerCase().startsWith(r);return n===i?t.count===e.count?e.name.localeCompare(t.name):t.count-e.count:n-i}),i}function qo(e,t){let n=Ko(e,t).slice(0,Uo).map(e=>({kind:`tag`,value:e.name,count:e.count,isLeaf:e.isLeaf})),r=t.trim();return r&&Wo.test(r)&&!e.some(e=>e.name===r)&&n.push({kind:`create`,value:r}),n}function Jo(e){let{$position:t}=e,n=t.parent.textBetween(0,t.parentOffset,void 0,``).match(/(^|[\s])#([a-zA-Z][\w/-]*)?$/);if(!n)return null;let r=n[2]??``,i=t.start(),a=n[1].length;return{range:{from:i+((n.index??0)+a),to:t.pos},query:r,text:`#${r}`}}function Yo(e){let t=[],n=!1,r=null,i=null;return V({editor:e,pluginKey:Ho,char:`#`,allowedPrefixes:null,findSuggestionMatch:Jo,allow:({editor:e})=>!he(e),items:async({query:e})=>{if(!n){r||=Go();try{t=await r,i=null}catch(e){console.error(`[tag-suggestion] Failed to fetch tags:`,e),i=`Failed to load tags. Press Escape and type # again to retry, or continue typing to create a new tag.`,t=[]}finally{n=!0,r=null}}return qo(t,e)},command:({editor:e,range:t,props:n})=>{try{let r=n.value;if(!r||!Wo.test(r))return;e.chain().focus().deleteRange(t).insertContent({type:`tag`,attrs:{value:r}}).insertContent(` `).run()}catch(e){console.error(`[tag-suggestion] command failed`,{item:n,range:t},e)}},render:()=>{let e=null,a=null,o=0,s={popup:null,stopAutoUpdate:null},c=null,l=null,u=e=>{a?.command(e)},d=e=>{o!==e&&(o=e,p(null))};function f(e,t,r){let a=t===null?!n:t;return{items:e.items,query:e.query??``,selectedIndex:o,onSelect:r,onHover:d,loading:a,error:i}}let p=t=>{!e||!a||e.updateProps(f(a,t,u))};return{onBeforeStart(t){a=t,o=0;let n=oe(()=>a,`tag-suggestion`);s.popup=n.popup,c=n.doPosition,l=n.reveal,e=new W(Bo,{props:f(t,!0,u),editor:t.editor}),n.popup.appendChild(e.element),s.stopAutoUpdate=n.startAutoUpdate()},onStart(e){a=e,o=0,p(null),l?.()},onUpdate(e){a=e,o=Math.min(o,Math.max(0,e.items.length-1)),p(null),c?.()},onKeyDown({event:e}){if(!a)return!1;let t=a.items;if(e.key===`ArrowDown`)return t.length===0?!1:(o=(o+1)%t.length,p(null),!0);if(e.key===`ArrowUp`)return t.length===0?!1:(o=(o-1+t.length)%t.length,p(null),!0);if(e.key===`Enter`||e.key===`Tab`){let e=t[o];if(e)return a.command(e),!0;let n=(a.query??``).trim();return n&&Wo.test(n)?(a.command({kind:`create`,value:n}),!0):!1}return e.key,!1},onExit(){pe(s),c=null,l=null,e?.destroy(),e=null,a=null,o=0,t=[],i=null,n=!1,r=null}}}})}var Xo=new Map([[qr,`<path d="m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2"/>`],[Pe,`<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"/><path d="M14 2v5a1 1 0 0 0 1 1h5"/><path d="M10 9H8"/><path d="M16 13H8"/><path d="M16 17H8"/>`],[J,`<rect width="18" height="18" x="3" y="3" rx="2" ry="2"/><circle cx="9" cy="9" r="2"/><path d="m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21"/>`],[J,`<rect width="18" height="18" x="3" y="3" rx="2" ry="2"/><circle cx="9" cy="9" r="2"/><path d="m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21"/>`],[oo,`<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"/><path d="M14 2v5a1 1 0 0 0 1 1h5"/>`],[ke,`<rect width="18" height="18" x="3" y="3" rx="2"/><path d="M7 3v18"/><path d="M3 7.5h4"/><path d="M3 12h18"/><path d="M3 16.5h4"/><path d="M17 3v18"/><path d="M17 7.5h4"/><path d="M17 16.5h4"/>`],[Se,`<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"/><path d="M16 9a5 5 0 0 1 0 6"/><path d="M19.364 18.364a9 9 0 0 0 0-12.728"/>`],[ni,`<path d="M18 6 6 18"/><path d="m6 6 12 12"/>`]]),Zo=new Map;function Qo(e){let t=Zo.get(e);if(t!==void 0)return t;let n=`<svg xmlns="http://www.w3.org/2000/svg" width="0.75rem" height="0.75rem" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">${Xo.get(e)??Xo.get(Pe)}</svg>`;return Zo.set(e,n),n}var $o=`0 0 32 32`,es=`M26.7075 10.2925L19.7075 3.2925C19.6146 3.19967 19.5042 3.12605 19.3829 3.07586C19.2615 3.02568 19.1314 2.9999 19 3H7C6.46957 3 5.96086 3.21071 5.58579 3.58579C5.21071 3.96086 5 4.46957 5 5V14C5 14.2652 5.10536 14.5196 5.29289 14.7071C5.48043 14.8946 5.73478 15 6 15C6.26522 15 6.51957 14.8946 6.70711 14.7071C6.89464 14.5196 7 14.2652 7 14V5H18V11C18 11.2652 18.1054 11.5196 18.2929 11.7071C18.4804 11.8946 18.7348 12 19 12H25V28C25 28.2652 25.1054 28.5196 25.2929 28.7071C25.4804 28.8946 25.7348 29 26 29C26.2652 29 26.5196 28.8946 26.7071 28.7071C26.8946 28.5196 27 28.2652 27 28V11C27.0001 10.8686 26.9743 10.7385 26.9241 10.6172C26.8739 10.4958 26.8003 10.3854 26.7075 10.2925ZM20 6.41375L23.5863 10H20V6.41375ZM18 18H16C15.7348 18 15.4804 18.1054 15.2929 18.2929C15.1054 18.4804 15 18.7348 15 19V26C15 26.2652 15.1054 26.5196 15.2929 26.7071C15.4804 26.8946 15.7348 27 16 27H18C19.1935 27 20.3381 26.5259 21.182 25.682C22.0259 24.8381 22.5 23.6935 22.5 22.5C22.5 21.3065 22.0259 20.1619 21.182 19.318C20.3381 18.4741 19.1935 18 18 18ZM18 25H17V20H18C18.663 20 19.2989 20.2634 19.7678 20.7322C20.2366 21.2011 20.5 21.837 20.5 22.5C20.5 23.163 20.2366 23.7989 19.7678 24.2678C19.2989 24.7366 18.663 25 18 25ZM13 19V26C13 26.2652 12.8946 26.5196 12.7071 26.7071C12.5196 26.8946 12.2652 27 12 27C11.7348 27 11.4804 26.8946 11.2929 26.7071C11.1054 26.5196 11 26.2652 11 26V22.1725L9.31875 24.5737C9.22652 24.7053 9.10396 24.8126 8.96144 24.8868C8.81892 24.9609 8.66064 24.9996 8.5 24.9996C8.33936 24.9996 8.18108 24.9609 8.03856 24.8868C7.89604 24.8126 7.77348 24.7053 7.68125 24.5737L6 22.1725V26C6 26.2652 5.89464 26.5196 5.70711 26.7071C5.51957 26.8946 5.26522 27 5 27C4.73478 27 4.48043 26.8946 4.29289 26.7071C4.10536 26.5196 4 26.2652 4 26V19C4.00009 18.7874 4.06791 18.5804 4.19363 18.409C4.31935 18.2376 4.49642 18.1107 4.69915 18.0467C4.90188 17.9828 5.11971 17.9851 5.32104 18.0533C5.52236 18.1216 5.6967 18.2522 5.81875 18.4263L8.5 22.2563L11.1812 18.4263C11.3033 18.2522 11.4776 18.1216 11.679 18.0533C11.8803 17.9851 12.0981 17.9828 12.3008 18.0467C12.5036 18.1107 12.6807 18.2376 12.8064 18.409C12.9321 18.5804 12.9999 18.7874 13 19Z`;function ts(e){return e===`.md`||e===`.mdx`}function ns(e){switch(rn(e)){case`image`:return Qo(J);case`video`:return Qo(ke);case`audio`:return Qo(Se);default:return Qo(oo)}}function rs(e){let t=(0,Z.c)(7),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,$.jsx)(`path`,{d:es}),t[3]=i):i=t[3];let a;return t[4]!==n||t[5]!==r?(a=(0,$.jsx)(`svg`,{"aria-hidden":`true`,className:n,fill:`currentColor`,viewBox:$o,...r,children:i}),t[4]=n,t[5]=r,t[6]=a):a=t[6],a}function is(e){let t=oi(e).toLowerCase();return t?ts(t)?{kind:`file`,path:e}:{kind:`file`,path:e,bodyIndexed:!1}:{kind:`folder`,path:e}}function as(e){let t=(0,Z.c)(6),{path:n,className:r,showExtensionBadge:i}=e,a;t[0]===n?a=t[1]:(a=is(n),t[0]=n,t[1]=a);let o;return t[2]!==r||t[3]!==i||t[4]!==a?(o=(0,$.jsx)(ss,{...a,className:r,showExtensionBadge:i}),t[2]=r,t[3]=i,t[4]=a,t[5]=o):o=t[5],o}function os(e){let{kind:t,bodyIndexed:n}=is(e);if(t===`folder`)return Qo(qr);let r=(n===!1?oi(e):oi(e)||`.md`).toLowerCase();return ts(r)?`<svg xmlns="http://www.w3.org/2000/svg" width="0.75rem" height="0.75rem" viewBox="${$o}" fill="currentColor" aria-hidden="true"><path d="${es}"/></svg>`:ns(r)}function ss(e){let t=(0,Z.c)(25),{kind:n,path:r,docExt:i,bodyIndexed:a,className:o,showExtensionBadge:s}=e,c=s===void 0?!0:s;if(n===`folder`){let e;t[0]===o?e=t[1]:(e=y(`shrink-0`,o),t[0]=o,t[1]=e);let n;return t[2]===e?n=t[3]:(n=(0,$.jsx)(qr,{"aria-hidden":`true`,className:e,"data-file-entry-icon":`folder`}),t[2]=e,t[3]=n),n}let l;t[4]!==a||t[5]!==i||t[6]!==r?(l=a===!1?oi(r):i??(oi(r)||`.md`),t[4]=a,t[5]=i,t[6]=r,t[7]=l):l=t[7];let u=l,d,f,p,m;if(t[8]!==o||t[9]!==u||t[10]!==c){let e=u.toLowerCase(),n=rn(e);d=c&&u&&e!==`.md`?u.slice(1).toUpperCase():null;let r=n===`image`&&`text-rose-500`,i;t[15]!==o||t[16]!==r?(i=y(o,r),t[15]=o,t[16]=r,t[17]=i):i=t[17];let a=i;f=`relative inline-flex shrink-0`,p=e||`file`,m=ts(e)?(0,$.jsx)(rs,{className:a,"data-testid":`file-entry-icon-markdown`}):n===`image`?(0,$.jsx)(J,{"aria-hidden":`true`,className:a,"data-testid":`file-entry-icon-image`}):n===`video`?(0,$.jsx)(ke,{"aria-hidden":`true`,className:a,"data-testid":`file-entry-icon-video`}):n===`audio`?(0,$.jsx)(Se,{"aria-hidden":`true`,className:a,"data-testid":`file-entry-icon-audio`}):(0,$.jsx)(oo,{"aria-hidden":`true`,className:a,"data-testid":`file-entry-icon-file`}),t[8]=o,t[9]=u,t[10]=c,t[11]=d,t[12]=f,t[13]=p,t[14]=m}else d=t[11],f=t[12],p=t[13],m=t[14];let h;t[18]===d?h=t[19]:(h=d?(0,$.jsx)(`span`,{"aria-hidden":`true`,className:`-right-1 -bottom-1 absolute rounded-sm bg-background px-0.5 font-medium text-[0.5rem] text-muted-foreground leading-none`,"data-testid":`file-entry-extension-badge`,children:d}):null,t[18]=d,t[19]=h);let g;return t[20]!==f||t[21]!==p||t[22]!==m||t[23]!==h?(g=(0,$.jsxs)(`span`,{className:f,"data-file-entry-icon":p,children:[m,h]}),t[20]=f,t[21]=p,t[22]=m,t[23]=h,t[24]=g):g=t[24],g}var cs=1,ls=.9,us=.8,ds=.17,fs=.1,ps=.999,ms=.9999,hs=.99,gs=/[\\\/_+.#"@\[\(\{&]/,_s=/[\\\/_+.#"@\[\(\{&]/g,vs=/[\s-]/,ys=/[\s-]/g;function bs(e,t,n,r,i,a,o){if(a===t.length)return i===e.length?cs:hs;var s=`${i},${a}`;if(o[s]!==void 0)return o[s];for(var c=r.charAt(a),l=n.indexOf(c,i),u=0,d,f,p,m;l>=0;)d=bs(e,t,n,r,l+1,a+1,o),d>u&&(l===i?d*=cs:gs.test(e.charAt(l-1))?(d*=us,p=e.slice(i,l-1).match(_s),p&&i>0&&(d*=ps**+p.length)):vs.test(e.charAt(l-1))?(d*=ls,m=e.slice(i,l-1).match(ys),m&&i>0&&(d*=ps**+m.length)):(d*=ds,i>0&&(d*=ps**+(l-i))),e.charAt(l)!==t.charAt(a)&&(d*=ms)),(d<fs&&n.charAt(l-1)===r.charAt(a+1)||r.charAt(a+1)===r.charAt(a)&&n.charAt(l-1)!==r.charAt(a))&&(f=bs(e,t,n,r,l+1,a+2,o),f*fs>d&&(d=f*fs)),d>u&&(u=d),l=n.indexOf(c,l+1);return o[s]=u,u}function xs(e){return e.toLowerCase().replace(ys,` `)}function Ss(e,t,n){return e=n&&n.length>0?`${e+` `+n.join(` `)}`:e,bs(e,t,xs(e),xs(t),0,0,{})}var Cs=`[cmdk-group=""]`,ws=`[cmdk-group-items=""]`,Ts=`[cmdk-group-heading=""]`,Es=`[cmdk-item=""]`,Ds=`${Es}:not([aria-disabled="true"])`,Os=`cmdk-item-select`,ks=`data-value`,As=(e,t,n)=>Ss(e,t,n),js=Q.createContext(void 0),Ms=()=>Q.useContext(js),Ns=Q.createContext(void 0),Ps=()=>Q.useContext(Ns),Fs=Q.createContext(void 0),Is=Q.forwardRef((e,t)=>{let n=Xs(()=>({search:``,value:e.value??e.defaultValue??``,selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}})),r=Xs(()=>new Set),i=Xs(()=>new Map),a=Xs(()=>new Map),o=Xs(()=>new Set),s=Js(e),{label:c,children:l,value:u,onValueChange:d,filter:f,shouldFilter:p,loop:m,disablePointerSelection:h=!1,vimBindings:g=!0,..._}=e,v=C(),y=C(),b=C(),x=Q.useRef(null),w=$s();Ys(()=>{if(u!==void 0){let e=u.trim();n.current.value=e,T.emit()}},[u]),Ys(()=>{w(6,j)},[]);let T=Q.useMemo(()=>({subscribe:e=>(o.current.add(e),()=>o.current.delete(e)),snapshot:()=>n.current,setState:(e,t,r)=>{var i,a,o;if(!Object.is(n.current[e],t)){if(n.current[e]=t,e===`search`)A(),O(),w(1,k);else if(e===`value`){if(document.activeElement.hasAttribute(`cmdk-input`)||document.activeElement.hasAttribute(`cmdk-root`)){let e=document.getElementById(b);e?e.focus():(i=document.getElementById(v))==null||i.focus()}if(w(7,()=>{n.current.selectedItemId=M()?.id,T.emit()}),r||w(5,j),s.current?.value!==void 0){let e=t??``;(o=(a=s.current).onValueChange)==null||o.call(a,e);return}}T.emit()}},emit:()=>{o.current.forEach(e=>e())}}),[]),E=Q.useMemo(()=>({value:(e,t,r)=>{t!==a.current.get(e)?.value&&(a.current.set(e,{value:t,keywords:r}),n.current.filtered.items.set(e,D(t,r)),w(2,()=>{O(),T.emit()}))},item:(e,t)=>(r.current.add(e),t&&(i.current.has(t)?i.current.get(t).add(e):i.current.set(t,new Set([e]))),w(3,()=>{A(),O(),n.current.value||k(),T.emit()}),()=>{a.current.delete(e),r.current.delete(e),n.current.filtered.items.delete(e);let t=M();w(4,()=>{A(),t?.getAttribute(`id`)===e&&k(),T.emit()})}),group:e=>(i.current.has(e)||i.current.set(e,new Set),()=>{a.current.delete(e),i.current.delete(e)}),filter:()=>s.current.shouldFilter,label:c||e[`aria-label`],getDisablePointerSelection:()=>s.current.disablePointerSelection,listId:v,inputId:b,labelId:y,listInnerRef:x}),[]);function D(e,t){let r=s.current?.filter??As;return e?r(e,n.current.search,t):0}function O(){if(!n.current.search||s.current.shouldFilter===!1)return;let e=n.current.filtered.items,t=[];n.current.filtered.groups.forEach(n=>{let r=i.current.get(n),a=0;r.forEach(t=>{let n=e.get(t);a=Math.max(n,a)}),t.push([n,a])});let r=x.current;N().sort((t,n)=>{let r=t.getAttribute(`id`),i=n.getAttribute(`id`);return(e.get(i)??0)-(e.get(r)??0)}).forEach(e=>{let t=e.closest(ws);t?t.appendChild(e.parentElement===t?e:e.closest(`${ws} > *`)):r.appendChild(e.parentElement===r?e:e.closest(`${ws} > *`))}),t.sort((e,t)=>t[1]-e[1]).forEach(e=>{let t=x.current?.querySelector(`${Cs}[${ks}="${encodeURIComponent(e[0])}"]`);t?.parentElement.appendChild(t)})}function k(){let e=N().find(e=>e.getAttribute(`aria-disabled`)!==`true`)?.getAttribute(ks);T.setState(`value`,e||void 0)}function A(){if(!n.current.search||s.current.shouldFilter===!1){n.current.filtered.count=r.current.size;return}n.current.filtered.groups=new Set;let e=0;for(let t of r.current){let r=D(a.current.get(t)?.value??``,a.current.get(t)?.keywords??[]);n.current.filtered.items.set(t,r),r>0&&e++}for(let[e,t]of i.current)for(let r of t)if(n.current.filtered.items.get(r)>0){n.current.filtered.groups.add(e);break}n.current.filtered.count=e}function j(){var e;let t=M();t&&(t.parentElement?.firstChild===t&&((e=t.closest(Cs)?.querySelector(Ts))==null||e.scrollIntoView({block:`nearest`})),t.scrollIntoView({block:`nearest`}))}function M(){return x.current?.querySelector(`${Es}[aria-selected="true"]`)}function N(){return Array.from(x.current?.querySelectorAll(Ds)||[])}function P(e){let t=N()[e];t&&T.setState(`value`,t.getAttribute(ks))}function F(e){var t;let n=M(),r=N(),i=r.findIndex(e=>e===n),a=r[i+e];(t=s.current)!=null&&t.loop&&(a=i+e<0?r[r.length-1]:i+e===r.length?r[0]:r[i+e]),a&&T.setState(`value`,a.getAttribute(ks))}function I(e){let t=M()?.closest(Cs),n;for(;t&&!n;)t=e>0?Ks(t,Cs):qs(t,Cs),n=t?.querySelector(Ds);n?T.setState(`value`,n.getAttribute(ks)):F(e)}let L=()=>P(N().length-1),ee=e=>{e.preventDefault(),e.metaKey?L():e.altKey?I(1):F(1)},R=e=>{e.preventDefault(),e.metaKey?P(0):e.altKey?I(-1):F(-1)};return Q.createElement(S.div,{ref:t,tabIndex:-1,..._,"cmdk-root":``,onKeyDown:e=>{var t;(t=_.onKeyDown)==null||t.call(_,e);let n=e.nativeEvent.isComposing||e.keyCode===229;if(!(e.defaultPrevented||n))switch(e.key){case`n`:case`j`:g&&e.ctrlKey&&ee(e);break;case`ArrowDown`:ee(e);break;case`p`:case`k`:g&&e.ctrlKey&&R(e);break;case`ArrowUp`:R(e);break;case`Home`:e.preventDefault(),P(0);break;case`End`:e.preventDefault(),L();break;case`Enter`:{e.preventDefault();let t=M();if(t){let e=new Event(Os);t.dispatchEvent(e)}}}}},Q.createElement(`label`,{"cmdk-label":``,htmlFor:E.inputId,id:E.labelId,style:nc},c),tc(e,e=>Q.createElement(Ns.Provider,{value:T},Q.createElement(js.Provider,{value:E},e))))}),Ls=Q.forwardRef((e,t)=>{let n=C(),r=Q.useRef(null),i=Q.useContext(Fs),a=Ms(),o=Js(e),s=o.current?.forceMount??i?.forceMount;Ys(()=>{if(!s)return a.item(n,i?.id)},[s]);let c=Qs(n,r,[e.value,e.children,r],e.keywords),l=Ps(),u=Zs(e=>e.value&&e.value===c.current),d=Zs(e=>s||a.filter()===!1?!0:e.search?e.filtered.items.get(n)>0:!0);Q.useEffect(()=>{let t=r.current;if(!(!t||e.disabled))return t.addEventListener(Os,f),()=>t.removeEventListener(Os,f)},[d,e.onSelect,e.disabled]);function f(){var e,t;p(),(t=(e=o.current).onSelect)==null||t.call(e,c.current)}function p(){l.setState(`value`,c.current,!0)}if(!d)return null;let{disabled:m,value:h,onSelect:g,forceMount:_,keywords:y,...b}=e;return Q.createElement(S.div,{ref:v(r,t),...b,id:n,"cmdk-item":``,role:`option`,"aria-disabled":!!m,"aria-selected":!!u,"data-disabled":!!m,"data-selected":!!u,onPointerMove:m||a.getDisablePointerSelection()?void 0:p,onClick:m?void 0:f},e.children)}),Rs=Q.forwardRef((e,t)=>{let{heading:n,children:r,forceMount:i,...a}=e,o=C(),s=Q.useRef(null),c=Q.useRef(null),l=C(),u=Ms(),d=Zs(e=>i||u.filter()===!1?!0:e.search?e.filtered.groups.has(o):!0);Ys(()=>u.group(o),[]),Qs(o,s,[e.value,e.heading,c]);let f=Q.useMemo(()=>({id:o,forceMount:i}),[i]);return Q.createElement(S.div,{ref:v(s,t),...a,"cmdk-group":``,role:`presentation`,hidden:d?void 0:!0},n&&Q.createElement(`div`,{ref:c,"cmdk-group-heading":``,"aria-hidden":!0,id:l},n),tc(e,e=>Q.createElement(`div`,{"cmdk-group-items":``,role:`group`,"aria-labelledby":n?l:void 0},Q.createElement(Fs.Provider,{value:f},e))))}),zs=Q.forwardRef((e,t)=>{let{alwaysRender:n,...r}=e,i=Q.useRef(null),a=Zs(e=>!e.search);return!n&&!a?null:Q.createElement(S.div,{ref:v(i,t),...r,"cmdk-separator":``,role:`separator`})}),Bs=Q.forwardRef((e,t)=>{let{onValueChange:n,...r}=e,i=e.value!=null,a=Ps(),o=Zs(e=>e.search),s=Zs(e=>e.selectedItemId),c=Ms();return Q.useEffect(()=>{e.value!=null&&a.setState(`search`,e.value)},[e.value]),Q.createElement(S.input,{ref:t,...r,"cmdk-input":``,autoComplete:`off`,autoCorrect:`off`,spellCheck:!1,"aria-autocomplete":`list`,role:`combobox`,"aria-expanded":!0,"aria-controls":c.listId,"aria-labelledby":c.labelId,"aria-activedescendant":s,id:c.inputId,type:`text`,value:i?e.value:o,onChange:e=>{i||a.setState(`search`,e.target.value),n?.(e.target.value)}})}),Vs=Q.forwardRef((e,t)=>{let{children:n,label:r=`Suggestions`,...i}=e,a=Q.useRef(null),o=Q.useRef(null),s=Zs(e=>e.selectedItemId),c=Ms();return Q.useEffect(()=>{if(o.current&&a.current){let e=o.current,t=a.current,n,r=new ResizeObserver(()=>{n=requestAnimationFrame(()=>{let n=e.offsetHeight;t.style.setProperty(`--cmdk-list-height`,n.toFixed(1)+`px`)})});return r.observe(e),()=>{cancelAnimationFrame(n),r.unobserve(e)}}},[]),Q.createElement(S.div,{ref:v(a,t),...i,"cmdk-list":``,role:`listbox`,tabIndex:-1,"aria-activedescendant":s,"aria-label":r,id:c.listId},tc(e,e=>Q.createElement(`div`,{ref:v(o,c.listInnerRef),"cmdk-list-sizer":``},e)))}),Hs=Q.forwardRef((e,t)=>{let{open:n,onOpenChange:r,overlayClassName:i,contentClassName:a,container:o,...s}=e;return Q.createElement(N,{open:n,onOpenChange:r},Q.createElement(M,{container:o},Q.createElement(z,{"cmdk-overlay":``,className:i}),Q.createElement(F,{"aria-label":e.label,"cmdk-dialog":``,className:a},Q.createElement(Is,{ref:t,...s}))))}),Us=Q.forwardRef((e,t)=>Zs(e=>e.filtered.count===0)?Q.createElement(S.div,{ref:t,...e,"cmdk-empty":``,role:`presentation`}):null),Ws=Q.forwardRef((e,t)=>{let{progress:n,children:r,label:i=`Loading...`,...a}=e;return Q.createElement(S.div,{ref:t,...a,"cmdk-loading":``,role:`progressbar`,"aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,"aria-label":i},tc(e,e=>Q.createElement(`div`,{"aria-hidden":!0},e)))}),Gs=Object.assign(Is,{List:Vs,Item:Ls,Input:Bs,Group:Rs,Separator:zs,Dialog:Hs,Empty:Us,Loading:Ws});function Ks(e,t){let n=e.nextElementSibling;for(;n;){if(n.matches(t))return n;n=n.nextElementSibling}}function qs(e,t){let n=e.previousElementSibling;for(;n;){if(n.matches(t))return n;n=n.previousElementSibling}}function Js(e){let t=Q.useRef(e);return Ys(()=>{t.current=e}),t}var Ys=typeof window>`u`?Q.useEffect:Q.useLayoutEffect;function Xs(e){let t=Q.useRef();return t.current===void 0&&(t.current=e()),t}function Zs(e){let t=Ps(),n=()=>e(t.snapshot());return Q.useSyncExternalStore(t.subscribe,n,n)}function Qs(e,t,n,r=[]){let i=Q.useRef(),a=Ms();return Ys(()=>{var o;let s=(()=>{for(let e of n){if(typeof e==`string`)return e.trim();if(typeof e==`object`&&`current`in e)return e.current?e.current.textContent?.trim():i.current}})(),c=r.map(e=>e.trim());a.value(e,s,c),(o=t.current)==null||o.setAttribute(ks,s),i.current=s}),i}var $s=()=>{let[e,t]=Q.useState(),n=Xs(()=>new Map);return Ys(()=>{n.current.forEach(e=>e()),n.current=new Map},[e]),(e,r)=>{n.current.set(e,r),t({})}};function ec(e){let t=e.type;return typeof t==`function`?t(e.props):`render`in t?t.render(e.props):e}function tc({asChild:e,children:t},n){return e&&Q.isValidElement(t)?Q.cloneElement(ec(t),{ref:t.ref},n(t.props.children)):n(t)}var nc={position:`absolute`,width:`1px`,height:`1px`,padding:`0`,margin:`-1px`,overflow:`hidden`,clip:`rect(0, 0, 0, 0)`,whiteSpace:`nowrap`,borderWidth:`0`};function rc(e){let t=(0,Z.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=y(`flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,$.jsx)(Gs,{"data-slot":`command`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function ic(e){let t=(0,Z.c)(36),n,r,i,a,o,s,c,l;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4],o=t[5],s=t[6],c=t[7],l=t[8]):({title:s,description:c,children:n,className:r,showCloseButton:l,commandProps:i,onEscapeKeyDown:a,...o}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a,t[5]=o,t[6]=s,t[7]=c,t[8]=l);let u=s===void 0?`Command Palette`:s,d=c===void 0?`Search for a command to run`:c,f=l===void 0?!0:l,p;t[9]===i?p=t[10]:(p=i??{},t[9]=i,t[10]=p);let m,h;t[11]===p?(m=t[12],h=t[13]):({className:m,...h}=p,t[11]=p,t[12]=m,t[13]=h);let g;t[14]===r?g=t[15]:(g=y(`top-[12vh] translate-y-0 overflow-hidden p-0`,r),t[14]=r,t[15]=g);let _;t[16]===u?_=t[17]:(_=(0,$.jsx)(j,{className:`sr-only`,children:u}),t[16]=u,t[17]=_);let v;t[18]===d?v=t[19]:(v=(0,$.jsx)(A,{className:`sr-only`,children:d}),t[18]=d,t[19]=v);let b;t[20]===m?b=t[21]:(b=y(`[&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground [&_[cmdk-group]]:px-2 [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-input-wrapper]_svg]:h-5 [&_[cmdk-input-wrapper]_svg]:w-5 [&_[cmdk-input]]:h-12 [&_[cmdk-item]]:px-2 [&_[cmdk-item]]:py-3 [&_[cmdk-item]_svg]:h-5 [&_[cmdk-item]_svg]:w-5`,m),t[20]=m,t[21]=b);let x;t[22]!==n||t[23]!==h||t[24]!==b?(x=(0,$.jsx)(rc,{className:b,...h,children:n}),t[22]=n,t[23]=h,t[24]=b,t[25]=x):x=t[25];let S;t[26]!==a||t[27]!==f||t[28]!==g||t[29]!==_||t[30]!==v||t[31]!==x?(S=(0,$.jsxs)(P,{className:g,showCloseButton:f,onEscapeKeyDown:a,children:[_,v,x]}),t[26]=a,t[27]=f,t[28]=g,t[29]=_,t[30]=v,t[31]=x,t[32]=S):S=t[32];let C;return t[33]!==o||t[34]!==S?(C=(0,$.jsx)(te,{...o,children:S}),t[33]=o,t[34]=S,t[35]=C):C=t[35],C}function ac(e){let t=(0,Z.c)(9),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,$.jsx)(Eo,{className:`size-4 shrink-0 opacity-50`}),t[3]=i):i=t[3];let a;t[4]===n?a=t[5]:(a=y(`flex w-full rounded-md bg-transparent py-3 text-sm outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50`,n),t[4]=n,t[5]=a);let o;return t[6]!==r||t[7]!==a?(o=(0,$.jsxs)(`div`,{"data-slot":`command-input-wrapper`,className:`flex items-center gap-2 border-b px-3`,children:[i,(0,$.jsx)(Gs.Input,{"data-slot":`command-input`,className:a,...r})]}),t[6]=r,t[7]=a,t[8]=o):o=t[8],o}function oc(e){let t=(0,Z.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=y(`max-h-[300px] scroll-py-1 overflow-y-auto overflow-x-hidden`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,$.jsx)(Gs.List,{"data-slot":`command-list`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function sc(e){let t=(0,Z.c)(2),n;return t[0]===e?n=t[1]:(n=(0,$.jsx)(Gs.Empty,{"data-slot":`command-empty`,className:`py-6 text-center text-sm`,...e}),t[0]=e,t[1]=n),n}function cc(e){let t=(0,Z.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=y(`overflow-hidden p-1 text-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-mono [&_[cmdk-group-heading]]:uppercase **:[[cmdk-group-heading]]:tracking-wider`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,$.jsx)(Gs.Group,{"data-slot":`command-group`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function lc(e){let t=(0,Z.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=y(`relative flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none data-disabled:pointer-events-none data-disabled:opacity-50 data-[selected=true]:bg-accent data-[selected=true]:text-accent-foreground [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0 [&_svg:not([class*='text-'])]:text-muted-foreground`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,$.jsx)(Gs.Item,{"data-slot":`command-item`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function uc(e){let t=(0,Z.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=y(`ml-auto text-muted-foreground text-xs tracking-widest`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,$.jsx)(`span`,{"data-slot":`command-shortcut`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}async function dc(e,t){let n=null,r;try{n=await e.json()}catch(e){r=e}if(r instanceof Error&&r.name===`AbortError`)throw r;if(e.ok)return r!==void 0&&console.warn(`[parse-server-response] 2xx response with non-JSON body:`,r instanceof Error?r.message:String(r)),{ok:!0,body:r===void 0?n:null};if(r!==void 0){let t=r instanceof Error?r.message:String(r);return{ok:!1,title:`Server error (HTTP ${e.status}): ${t}`}}return{ok:!1,title:ai(n)??t}}function fc(e,t,n,r){let i=e.safeParse(t);return i.success?i.data:(console.warn(`[parse-server-response] schema drift:`,n,`bodyShape=`,typeof t==`object`&&t?Object.keys(t):typeof t,`issues=`,i.error.issues),r)}var pc=new Map,mc=null;function hc(){return fi(`PREWARM_CORRELATION_WINDOW_MS`,5e3)}function gc(){if(mc!==null)return;let e=Math.max(50,Math.floor(hc()/2));mc=setTimeout(()=>{mc=null,_c(Date.now()),pc.size>0&&gc()},e)}function _c(e){let t=hc();for(let[n,r]of pc)e-r.emittedAt>=t&&(pc.delete(n),X.count(`ok/sidebar/prewarm`,{hit:!1}))}function vc(e,t,n=Date.now()){pc.has(e)&&X.count(`ok/sidebar/prewarm`,{hit:!1}),pc.set(e,{poolEventId:t,emittedAt:n}),gc()}function yc(e,t,n=Date.now()){let r=pc.get(e);return!r||r.poolEventId!==t||n-r.emittedAt>=hc()?!1:(pc.delete(e),X(`ok/sidebar/prewarm-clicked`,{docName:e,t:n,poolEventId:t}),X.count(`ok/sidebar/prewarm`,{hit:!0}),!0)}et({event:Ht(`ok-branch-switched-clear-failed`),branch:An(),docName:An(),reason:An()});async function bc(e,t){let n=[];for(let[r,i]of e.entries)i.kind===`active`&&i.persistence!==null&&n.push(i.persistence.clearData().catch(e=>{let n={event:`ok-branch-switched-clear-failed`,docName:r,branch:t,reason:e instanceof Error?e.message:String(e)};console.warn(JSON.stringify(n))}));await Promise.all(n),e.clearBufferedUpdates(),e.recycleAllEntries()}function xc(e){let t=!1;return()=>{t?e():t=!0}}function Sc(e){let t=atob(e),n=new Uint8Array(t.length);for(let e=0;e<t.length;e++)n[e]=t.charCodeAt(e);return n}async function Cc(e,t=``){let n;try{n=await fetch(`${t}/api/server-info`,{signal:AbortSignal.timeout(5e3)})}catch{return}if(!n.ok)return;let r;try{r=await n.json()}catch{return}let i=Wn.safeParse(r);if(!i.success){console.warn(JSON.stringify({event:`ok-server-info-schema-mismatch`,issues:i.error.issues}));return}if(e.setExpectedServerInstanceId(i.data.serverInstanceId),Yi(i.data.serverInstanceId),i.data.currentBranch!==void 0&&e.compareAndUpdateObservedBranch(i.data.currentBranch)&&(bc(e,i.data.currentBranch),di(i.data.currentBranch)),i.data.currentDiskAckSVs!==void 0){let t={};for(let[e,n]of Object.entries(i.data.currentDiskAckSVs))try{t[e]=Sc(n)}catch{}e.observeDiskAckBatch(t)}}var wc=new Map,Tc=new Set;function Ec(){for(let e of Tc)e()}function Dc(e,t){wc.set(e,t),Ec()}function Oc(e,t){wc.get(e)===t&&(wc.delete(e),Ec())}function kc(e){return wc.get(e)??null}function Ac(e){return Tc.add(e),()=>Tc.delete(e)}function jc(e){return[...new Set(e)]}function Mc(e){return{async reconcileLocalRename({renamed:t,renamedFolders:n=[],renamedAssets:r=[],additionalRemovedDocNames:i=[]}){e.captureRenameSnapshots(t);let a=e.getActivePoolDocName(),o=[];for(let{fromDocName:n,toDocName:r}of t)o.push(n),a!==r&&e.hasPooledDocument(r)&&o.push(r);o.push(...i),await Promise.all(jc(o).map(t=>e.closeAndClear(t))),e.remapTabs({renamed:t,renamedFolders:n,renamedAssets:r})},async reconcileLocalRemoval({tabIdsToClose:t,docNamesToClear:n}){e.closeTabs(t),await Promise.all(jc(n).map(t=>e.closeAndClear(t)))},async reconcileAuthRename({fromDocName:t,toDocName:n}){let r=e.getActivePoolDocName()===t,i=[{fromDocName:t,toDocName:n}];e.captureRenameSnapshots(i),await Promise.all([e.closeAndClear(t),e.closeAndClear(n)]),r&&e.openAndActivate(n),e.remapTabs({renamed:i,renamedFolders:[],renamedAssets:[]});let a=e.remapActiveTargetForRename(t,n);(r||a)&&e.navigateToDocument(n)},async reconcileAuthRemoval({docName:t}){let n=e.getActivePoolDocName()===t;await e.closeAndClear(t),e.removeDocumentTab(t),e.clearActiveTargetForRemoval(t),n&&e.navigateHome()}}}var Nc=/[\uD800-\uDBFF]/,Pc=/[\uDC00-\uDFFF]/,Fc=(e,t)=>{let n=0,r=0;for(;n<e.length&&n<t.length&&e[n]===t[n];)n++;for(n>0&&Nc.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&&Pc.test(e[e.length-r])&&r--,{index:n,remove:e.length-n-r,insert:t.slice(n,t.length-r)}},Ic=(e,t)=>e>>>t|e<<32-t,Lc=e=>Ic(e,2)^Ic(e,13)^Ic(e,22),Rc=e=>Ic(e,6)^Ic(e,11)^Ic(e,25),zc=e=>Ic(e,7)^Ic(e,18)^e>>>3,Bc=e=>Ic(e,17)^Ic(e,19)^e>>>10,Vc=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]),Hc=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),Uc=class{constructor(){let e=new ArrayBuffer(320);this._H=new Uint32Array(e,0,8),this._H.set(Hc),this._W=new Uint32Array(e,64,64)}_updateHash(){let e=this._H,t=this._W;for(let e=16;e<64;e++)t[e]=Bc(t[e-2])+t[e-7]+zc(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+Rc(o)+(o&s^~o&c)+Vc[e]+t[e]>>>0,d=Lc(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/Ri,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}},Wc=e=>new Uc().digest(e),Gc=new dr(`y-sync`),Kc=new dr(`y-undo`),qc=new dr(`yjs-cursor`),Jc=e=>{for(let t=6;t<e.length;t++)e[t%6]=e[t%6]^e[t];return e.slice(0,6)},Yc=e=>Hi(Jc(Wc(Ai(e)))),Xc=()=>({mapping:new Map,isOMark:new Map}),Zc=(e,t)=>t===void 0?!e.deleted:t.sv.has(e.id.client)&&t.sv.get(e.id.client)>e.id.clock&&!wi(t.ds,e.id),Qc=[{light:`#ecd44433`,dark:`#ecd444`}],$c=(e,t,n)=>{if(!e.has(n)){if(e.size<t.length){let n=la();e.forEach(e=>n.add(e)),t=t.filter(e=>!n.has(e))}e.set(n,Mi(t))}return e.get(n)},el=(e,{colors:t=Qc,colorMapping:n=new Map,permanentUserData:r=null,onFirstRender:i=()=>{},mapping:a}={})=>{let o=!1,s=new il(e,a),c=new kn({props:{editable:e=>{let t=Gc.getState(e);return t.snapshot==null&&t.prevSnapshot==null}},key:Gc,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(Gc);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)&&Pi(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=Kc.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)},Gc)})}},destroy:()=>{s.destroy()}})});return c},tl=(e,t,n)=>{if(t!==null&&t.anchor!==null&&t.head!==null)if(t.type===`all`)e.setSelection(new Ut(e.doc));else if(t.type===`node`){let r=Nl(n.doc,n.type,t.anchor,n.mapping);e.setSelection(nl(e,r))}else{let r=Nl(n.doc,n.type,t.anchor,n.mapping),i=Nl(n.doc,n.type,t.head,n.mapping);r!==null&&i!==null&&e.setSelection(Rn.between(e.doc.resolve(r),e.doc.resolve(i)))}},nl=(e,t)=>{let n=e.doc.resolve(t);return n.nodeAfter?tt.create(e.doc,t):Rn.near(n)},rl=(e,t)=>({type:t.selection.jsonID,anchor:jl(t.selection.anchor,e.type,e.mapping),head:jl(t.selection.head,e.type,e.mapping)}),il=class{constructor(e,t=new Map){this.type=e,this.prosemirrorView=null,this.mux=me(),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=rl(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()?(Ui&&this._domSelectionInView===null&&(Pi(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=zi.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||=ya(Xi(),new Map),this.prosemirrorView.dispatch(this._tr.setMeta(Gc,{snapshot:e,prevSnapshot:t}))}unrenderSnapshot(){this.mapping.clear(),this.mux(()=>{let e=this.type.toArray().map(e=>ol(e,this.prosemirrorView.state.schema,this)).filter(e=>e!==null),t=this._tr.replace(0,this.prosemirrorView.state.doc.content.size,new qn(Mn.from(e),0,0));t.setMeta(Gc,{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=>ol(e,this.prosemirrorView.state.schema,this)).filter(e=>e!==null),n=this._tr.replace(0,this.prosemirrorView.state.doc.content.size,new qn(Mn.from(t),0,0));if(e){let t=$i(Ci(e.anchor,0),n.doc.content.size),r=$i(Ci(e.head,0),n.doc.content.size);n.setSelection(Rn.create(n.doc,t,r))}this.prosemirrorView.dispatch(n.setMeta(Gc,{isChangeOrigin:!0,binding:this}))})}_renderSnapshot(e,t,n){let r=this.doc,i=this.type;if(e||=Li(this.doc),e instanceof Uint8Array||t instanceof Uint8Array)if((!(e instanceof Uint8Array)||!(t instanceof Uint8Array))&&Ki(),r=new Zi({gc:!1}),qi(r,t),t=Li(r),qi(r,e),e=Li(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[Ii(e,i._item.id.clock)].content.type}this.mapping.clear(),this.mux(()=>{r.transact(r=>{let a=n.permanentUserData;a&&a.dss.forEach(e=>{Fi(r,e,e=>{})});let o=(e,t)=>{let r=e===`added`?a.getUserByClientId(t.client):a.getUserByDeletedId(t);return{user:r,type:e,color:$c(n.colorMapping,n.colors,r)}},s=ji(i,new Qi(t.ds,e.sv)).map(n=>!n._item.deleted||Zc(n._item,e)||Zc(n._item,t)?ol(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 qn(Mn.from(s),0,0));this.prosemirrorView.dispatch(c.setMeta(Gc,{isChangeOrigin:!0}))},Gc)})}_typeChanged(e,t){if(this.prosemirrorView==null)return;let n=Gc.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);Fi(t,t.deleteSet,e=>{if(e.constructor===sa){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=>al(e,this.prosemirrorView.state.schema,this)).filter(e=>e!==null),r=this._tr.replace(0,this.prosemirrorView.state.doc.content.size,new qn(Mn.from(n),0,0));tl(r,this.beforeTransactionSelection,this),r=r.setMeta(Gc,{isChangeOrigin:!0,isUndoRedoOperation:t.origin instanceof ea}),this.beforeTransactionSelection!==null&&this._isLocalCursorInView()&&r.scrollIntoView(),this.prosemirrorView.dispatch(r)})}_prosemirrorChanged(e){this.doc.transact(()=>{wl(this.doc,this.type,e,this),this.beforeTransactionSelection=rl(this,this.prosemirrorView.state)},Gc)}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))}},al=(e,t,n,r,i,a)=>{let o=n.mapping.get(e);if(o===void 0){if(e instanceof ca)return ol(e,t,n,r,i,a);throw Wi()}return o},ol=(e,t,n,r,i,a)=>{let o=[],s=e=>{if(e instanceof ca){let s=al(e,t,n,r,i,a);s!==null&&o.push(s)}else{let s=e._item.right?.content?.type;s instanceof da&&!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=sl(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):ji(e,new Qi(i.ds,r.sv)).forEach(s);try{let s=e.getAttributes(r);r!==void 0&&(Zc(e._item,r)?Zc(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=t.node(e.nodeName,s,o);return n.mapping.set(e,c),c}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}},sl=(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,Sl(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},cl=(e,t)=>{let n=new na,r=e.map(e=>({insert:e.text,attributes:Cl(e.marks,t)}));return n.applyDelta(r),t.mapping.set(n,e),n},ll=(e,t)=>{let n=new ca(e.type.name);for(let t in e.attrs){let r=e.attrs[t];r!==null&&t!==`ychange`&&n.setAttribute(t,r)}return n.insert(0,pl(e).map(e=>ul(e,t))),t.mapping.set(n,e),n},ul=(e,t)=>e instanceof Array?cl(e,t):ll(e,t),dl=e=>typeof e==`object`&&!!e,fl=(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||dl(o)&&dl(s)&&fl(o,s)}return r},pl=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},ml=(e,t)=>{let n=e.toDelta();return n.length===t.length&&n.every((e,n)=>e.insert===t[n].text&&Ni(e.attributes||{}).length===t[n].marks.length&&ki(e.attributes,(e,r)=>{let i=xl(r),a=t[n].marks;return a.find(e=>e.type.name===i)?fl(e,a.find(e=>e.type.name===i)?.attrs):!1}))},hl=(e,t)=>{if(e instanceof ca&&!(t instanceof Array)&&Tl(e,t)){let n=pl(t);return e._length===n.length&&fl(e.getAttributes(),t.attrs)&&e.toArray().every((e,t)=>hl(e,n[t]))}return e instanceof na&&t instanceof Array&&ml(e,t)},gl=(e,t)=>e===t||e instanceof Array&&t instanceof Array&&e.length===t.length&&e.every((e,n)=>t[n]===e),_l=(e,t,n)=>{let r=e.toArray(),i=pl(t),a=i.length,o=r.length,s=$i(o,a),c=0,l=0,u=!1;for(;c<s;c++){let e=r[c],t=i[c];if(gl(n.mapping.get(e),t))u=!0;else if(!hl(e,t))break}for(;c+l<s;l++){let e=r[o-l-1],t=i[a-l-1];if(gl(n.mapping.get(e),t))u=!0;else if(!hl(e,t))break}return{equalityFactor:c+l,foundMappedChild:u}},vl=e=>{let t=``,n=e._start,r={};for(;n!==null;)n.deleted||(n.countable&&n.content instanceof ua?t+=n.content.str:n.content instanceof Ji&&(r[n.content.key]=null)),n=n.right;return{str:t,nAttrs:r}},yl=(e,t,n)=>{n.mapping.set(e,t);let{nAttrs:r,str:i}=vl(e),a=t.map(e=>({insert:e.text,attributes:Object.assign({},r,Cl(e.marks,n))})),{insert:o,remove:s,index:c}=Fc(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})))},bl=/(.*)(--[a-zA-Z0-9+/=]{8})$/,xl=e=>bl.exec(e)?.[1]??e,Sl=(e,t)=>{let n=[];for(let r in e)n.push(t.mark(xl(r),e[r]));return n},Cl=(e,t)=>{let n={};return e.forEach(e=>{if(e.type.name!==`ychange`){let r=ia(t.isOMark,e.type,()=>!e.type.excludes(e.type));n[r?`${e.type.name}--${Yc(e.toJSON())}`:e.type.name]=e.attrs}}),n},wl=(e,t,n,r)=>{if(t instanceof ca&&t.nodeName!==n.type.name)throw Error(`node name mismatch!`);if(r.mapping.set(t,n),t instanceof ca){let e=t.getAttributes(),r=n.attrs;for(let n in r)r[n]===null?t.removeAttribute(n):e[n]!==r[n]&&n!==`ychange`&&t.setAttribute(n,r[n]);for(let n in e)r[n]===void 0&&t.removeAttribute(n)}let i=pl(n),a=i.length,o=t.toArray(),s=o.length,c=$i(a,s),l=0,u=0;for(;l<c;l++){let e=o[l],t=i[l];if(!gl(r.mapping.get(e),t))if(hl(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(!gl(r.mapping.get(e),t))if(hl(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 na&&c instanceof Array)ml(n,c)||yl(n,c,r),l+=1;else{let i=n instanceof ca&&Tl(n,c),a=d instanceof ca&&Tl(d,f);if(i&&a){let e=_l(n,c,r),t=_l(d,f,r);e.foundMappedChild&&!t.foundMappedChild?a=!1:!e.foundMappedChild&&t.foundMappedChild||e.equalityFactor<t.equalityFactor?i=!1:a=!1}i?(wl(e,n,c,r),l+=1):a?(wl(e,d,f,r),u+=1):(r.mapping.delete(t.get(l)),t.delete(l,1),t.insert(l,[ul(c,r)]),l+=1)}}let n=s-l-u;if(s===1&&a===0&&o[0]instanceof na?(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(ul(i[t],r));t.insert(l,e)}},Gc)},Tl=(e,t)=>!(t instanceof Array)&&e.nodeName===t.type.name,El=null,Dl=class{constructor(e,t,n){this.view=e,this.key=t,this.value=n}apply(){let e=Gc.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)}}},Ol=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=El;El=null;let n=[];return t.forEach((e,t)=>{e.forEach((e,r)=>{n.push(new Dl(t,r,e))})}),new e(n)}},kl=(e=Ol.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()||Pi(0,()=>kl(e,!0));return}throw r}n=!1,e.dequeueFirst()}},Al=(e,t,n)=>{El||(El=new Map,Pi(0,kl)),ia(El,e,ma).set(t,n)},jl=(e,t,n)=>{if(e===0)return Ti(t,0,-1);let r=t._first===null?null:t._first.content.type;for(;r!==null&&t!==r;){if(r instanceof na){if(r._length>=e)return Ti(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 _a(r._item===null?null:r._item.id,r._item===null?oa(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 _a(r._item===null?null:r._item.id,r._item===null?oa(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 Ki();if(e===0&&r.constructor!==na&&r!==t)return Ml(r._item.parent,r._item)}return Ti(t,t._length,-1)},Ml=(e,t)=>{let n=null,r=null;return e._item===null?r=oa(e):n=ba(e._item.id.client,e._item.id.clock),new _a(n,r,t.id)},Nl=(e,t,n,r)=>{let i=xa(n,e);if(i===null||i.type!==t&&!aa(t,i.type._item))return null;let a=i.type,o=0;if(a.constructor===na)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;t++,n instanceof na?o+=n._length:o+=r.get(n).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;t.deleted||(e instanceof na?o+=e._length:o+=r.get(e).nodeSize),t=t.right}}a=e}return o-1},Pl=(e,t)=>{let n=e.toArray().map(e=>ol(e,t,Xc())).filter(e=>e!==null);return Mn.fromArray(n)},Fl=(e,t)=>t.topNodeType.create(null,Pl(e,t)),Il=(e,t)=>{let n=Xc(),r=e.toArray().map(e=>ol(e,t,n)).filter(e=>e!==null);return{doc:t.topNodeType.create(null,Mn.fromArray(r)),meta:n,mapping:n.mapping}},Ll=(e,t,n)=>e!==t,Rl=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},zl=e=>({style:`background-color: ${e.color}70`,class:`ProseMirror-yjs-selection`}),Bl=/^#[0-9a-fA-F]{6}$/,Vl=(e,t,n,r,i)=>{let a=Gc.getState(e);if(a==null||a.doc==null||a.binding==null)return cn.create(e.doc,[]);let o=a.doc,s=[];return a.snapshot!=null||a.prevSnapshot!=null||a.binding.mapping.size===0?cn.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`:Bl.test(n.color)||console.warn(`A user uses an unsupported color format`,n),n.name??=`User: ${c}`;let l=Nl(o,a.type,Bi(t.cursor.anchor),a.binding.mapping),u=Nl(o,a.type,Bi(t.cursor.head),a.binding.mapping);if(l!==null&&u!==null){let t=Ci(e.doc.content.size-1,0);l=$i(l,t),u=$i(u,t),s.push(dn.widget(u,()=>r(n,c),{key:c+``,side:10}));let a=$i(l,u),o=Ci(l,u);s.push(dn.inline(a,o,i(n,c),{inclusiveEnd:!0,inclusiveStart:!1}))}}}),cn.create(e.doc,s))},Hl=(e,{awarenessStateFilter:t=Ll,cursorBuilder:n=Rl,selectionBuilder:r=zl,getSelection:i=e=>e.selection}={},a=`cursor`)=>new kn({key:qc,state:{init(i,a){return Vl(a,e,t,n,r)},apply(i,a,o,s){let c=Gc.getState(s),l=i.getMeta(qc);return c&&c.isChangeOrigin||l&&l.awarenessUpdated?Vl(s,e,t,n,r):a.map(i.mapping,i.doc)}},props:{decorations:e=>qc.getState(e)},view:t=>{let n=()=>{t.docView&&Al(t,qc,{awarenessUpdated:!0})},r=()=>{let n=Gc.getState(t.state),r=e.getLocalState()||{};if(t.hasFocus()){let o=i(t.state),s=jl(o.anchor,n.type,n.binding.mapping),c=jl(o.head,n.type,n.binding.mapping);(r.cursor==null||!va(Bi(r.cursor.anchor),s)||!va(Bi(r.cursor.head),c))&&e.setLocalStateField(a,{anchor:s,head:c})}else r.cursor!=null&&Nl(n.doc,n.type,Bi(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)}}}}),Ul=e=>{let t=Kc.getState(e).undoManager;if(t!=null)return t.undo(),!0},Wl=e=>{let t=Kc.getState(e).undoManager;if(t!=null)return t.redo(),!0},Gl=new Set([`paragraph`]),Kl=(e,t)=>!(e instanceof sa)||!(e.content instanceof ha)||!(e.content.type instanceof da||e.content.type instanceof ca&&t.has(e.content.type.nodeName))||e.content.type._length===0,ql=({protectedNodes:e=Gl,trackedOrigins:t=[],undoManager:n=null}={})=>new kn({key:Kc,state:{init:(r,i)=>{let a=Gc.getState(i),o=n||new ea(a.type,{trackedOrigins:new Set([Gc].concat(t)),deleteFilter:t=>Kl(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=Gc.getState(r).binding,a=t.undoManager,o=a.undoStack.length>0,s=a.redoStack.length>0;return i?{undoManager:a,prevSel:rl(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=Gc.getState(e.state),n=Kc.getState(e.state).undoManager;return n.on(`stack-item-added`,({stackItem:n})=>{let r=t.binding;r&&n.meta.set(r,Kc.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()}}}}),Jl=new Map;function Yl(e){return Jl.get(e)}function Xl(e,t){Jl.set(e,t)}function Zl(e){Jl.delete(e)}var Ql=`open-knowledge-app`,$l=new Map,eu=new Set,tu=1024,nu=1024;function ru(){return Tr.getTracer(Ql)}function iu(e,t,n){if(eu.has(e))return null;let r=$l.get(e);if(r)return r;if($l.size>=nu){let e=$l.keys().next().value;if(e!==void 0){let t=$l.get(e);$l.delete(e);try{t?.span.end()}catch(e){console.warn(`[otel-spans] eviction span.end failed:`,e instanceof Error?e:String(e))}}}let i={span:ru().startSpan(`ok.cold-mount`,{attributes:{"mount.id":e,...t},startTime:n}),startTimeMs:n};return $l.set(e,i),i}function au(e,t,n,r,i){try{let a=iu(e,n,r),o=a?Tr.setSpan(Er.active(),a.span):Er.active();ru().startSpan(t,{attributes:{"mount.id":e,...n},startTime:r},o).end(i??Date.now())}catch(e){console.warn(`[otel-spans] emitColdMountChild failed:`,e instanceof Error?e:String(e))}}function ou(e,t){try{let n=$l.get(e);if(n&&($l.delete(e),n.span.end(t??Date.now())),!eu.has(e)){if(eu.size>=tu){let e=eu.values().next().value;e!==void 0&&eu.delete(e)}eu.add(e)}}catch(e){console.warn(`[otel-spans] finalizeColdMountSpan failed:`,e instanceof Error?e:String(e))}}var su=class extends Error{docName;constructor(e){super(`Mount aborted for "${e}"`),this.name=`MountAbortError`,this.docName=e}};function cu(){return fi(`MOUNT_STALLED_THRESHOLD_MS`,1e4)}function lu(e){e.stalledHandle!==null&&(clearTimeout(e.stalledHandle),e.stalledHandle=null)}function uu(e,t,n){if(e.stalledMarkEmitted)return;e.stalledMarkEmitted=!0;let r=n-e.createdAt;X(`ok/mount/stalled`,{docName:t,mountId:e.mountId,elapsedMs:r})}var du=new Map,fu=new Set;function pu(e){fu.add(e);for(let[t,n]of du)if(n.stalledMarkEmitted&&!n.settled)try{e(t,n.mountId)}catch{}return()=>{fu.delete(e)}}function mu(e,t){for(let n of fu)try{n(e,t.mountId)}catch{}}var hu=!1;function gu(){typeof document>`u`||document.visibilityState===`visible`&&yu(Date.now())}function _u(){hu||typeof document>`u`||typeof document.addEventListener==`function`&&(document.addEventListener(`visibilitychange`,gu),hu=!0)}function vu(){hu&&(typeof document>`u`||typeof document.removeEventListener==`function`&&(document.removeEventListener(`visibilitychange`,gu),hu=!1))}function yu(e){let t=cu();for(let[n,r]of du)r.settled||r.stalledMarkEmitted||e-r.createdAt<t||(uu(r,n,e),mu(n,r))}function bu(e){let{docName:t,mountId:n,construct:r,sizeStats:i}=e,a=du.get(t);if(a)return a.promise;let o=new AbortController,s=Date.now(),c=()=>{},l=()=>{},u=new Promise((e,t)=>{c=e,l=t}),d={promise:u,rejectFn:l,controller:o,mountId:n,createdAt:s,settled:!1,resolved:!1,preMountEditor:null,stalledHandle:null,stalledMarkEmitted:!1};return d.stalledHandle=setTimeout(()=>{d.settled||(uu(d,t,Date.now()),mu(t,d))},cu()),o.signal.addEventListener(`abort`,()=>{d.settled||(d.settled=!0,lu(d),d.preMountEditor&&=(wu(t,d.preMountEditor,`aborted`),null),du.delete(t),du.size===0&&vu(),X(`ok/mount/reject`,{docName:t,mountId:d.mountId,reason:`aborted`}),l(new su(t)),ou(d.mountId))}),du.set(t,d),_u(),X(`ok/mount/create`,{docName:t,mountId:d.mountId}),Tu({docName:t,construct:r,sizeStats:i,entry:d,resolveFn:c,rejectFn:l}).catch(e=>{if(d.preMountEditor&&=(wu(t,d.preMountEditor,`backstop`),null),d.settled){X(`ok/mount/post-settle-throw`,{docName:t,mountId:d.mountId,message:e instanceof Error?e.message:String(e)});return}d.settled=!0,lu(d);let n=e instanceof Error?e:Error(String(e));X(`ok/mount/reject`,{docName:t,mountId:d.mountId,reason:`unhandled-body-throw`,message:n.message}),l(n),ou(d.mountId)}),u}function xu(e){return du.get(e)?.resolved===!0}function Su(e){return du.get(e)?.controller??null}function Cu(e){let t=du.get(e);t&&(t.settled=!0,lu(t),t.preMountEditor&&=(wu(e,t.preMountEditor,`aborted`),null),du.delete(e),du.size===0&&vu(),X(`ok/mount/invalidate`,{docName:e,mountId:t.mountId}),ou(t.mountId),t.controller.abort())}function wu(e,t,n){let r=Eu(t);try{t.destroy()}catch(t){X(`ok/mount/destroy-failed`,{docName:e,stage:n,message:t instanceof Error?t.message:String(t)})}r&&(r.restore=void 0)}async function Tu(e){let{docName:t,construct:n,sizeStats:r,entry:i,resolveFn:a,rejectFn:o}=e,s=document.createElement(`div`);if(od(t)!==void 0){let e=Wu({docName:t,container:s,factory:()=>{throw Error(`mount-promise: V2 cache contract violation — factory invoked on HIT for "${t}"`)}});i.settled=!0,i.resolved=!0,lu(i),a(e);return}if(await scheduler.yield(),i.controller.signal.aborted)return;let c=null;try{c=n()}catch(e){i.settled=!0,lu(i);let n=e instanceof Error?e:Error(String(e));X(`ok/mount/reject`,{docName:t,mountId:i.mountId,reason:`construct-failed`,message:n.message}),o(n),ou(i.mountId);return}if(i.preMountEditor=c.editor,await scheduler.yield(),i.controller.signal.aborted){i.preMountEditor=null;return}try{c.editor.mount(s)}catch(e){wu(t,c.editor,`mount-failed`),i.preMountEditor=null,i.settled=!0,lu(i);let n=e instanceof Error?e:Error(String(e));X(`ok/mount/reject`,{docName:t,mountId:i.mountId,reason:`mount-failed`,message:n.message}),o(n),ou(i.mountId);return}let l;try{l=Wu({docName:t,container:s,sizeStats:r,factory:()=>c})}catch(e){wu(t,c.editor,`v2-register-failed`),i.preMountEditor=null,i.settled=!0,lu(i);let n=e instanceof Error?e:Error(String(e));X(`ok/mount/reject`,{docName:t,mountId:i.mountId,reason:`v2-register-failed`,message:n.message}),o(n),ou(i.mountId);return}i.preMountEditor=null,i.settled=!0,i.resolved=!0,lu(i);let u=Date.now()-i.createdAt;X(`ok/mount/resolve`,{docName:t,mountId:i.mountId,elapsedMs:u}),X.histogram(`ok/mount/resolve-elapsed-ms`,{docName:t,mountId:i.mountId},u),a(l);let d=Date.now();au(i.mountId,`ok.mount-promise`,{"doc.name":t,elapsed_ms:u},i.createdAt,d),ou(i.mountId,d)}function Eu(e){try{let t=e.state;return Kc.getState(t)?.undoManager??null}catch(e){return X(`ok/cache/undo-manager-read-failed`,{message:e instanceof Error?e.message:String(e)}),null}}var Du=fi(`MAX_CACHE`,10),Ou=fi(`VIEW_COUNT_CACHE_THRESHOLD`,50),ku=fi(`BYTES_CACHE_THRESHOLD`,8e6);function Au(e){return!(e.viewCount>0&&e.viewCount>=Ou||e.bytes>ku)}var ju=new Map,Mu=new Map,Nu=new Map;function Pu(e,t){if(Nu.size>=Du){let e=Nu.keys().next().value;e!==void 0&&Nu.delete(e)}Nu.set(e,t),X(`ok/cache/snapshot-stored`,{toDocName:e,htmlBytes:t.html.length,hasScroll:t.scrollTop>0,hasSelection:t.selection!==null})}function Fu(e){return Nu.get(e)??null}function Iu(e){if(!Nu.has(e))return;let t=Nu.get(e)??null;Nu.delete(e),X(`ok/cache/snapshot-consumed`,{docName:e,hit:t!==null,hasScroll:t!==null&&t.scrollTop>0,hasSelection:t!==null&&t.selection!==null})}function Lu(){try{return typeof document>`u`?0:document.querySelector(`[data-testid="editor-scroll-container"]`)?.scrollTop??0}catch(e){return X(`ok/cache/snapshot-scroll-read-failed`,{message:e instanceof Error?e.message:String(e)}),0}}function Ru(e){try{let t=e.state.selection;return t instanceof Rn?{type:`text`,anchor:t.anchor,head:t.head}:t instanceof tt?{type:`node`,from:t.from}:null}catch(e){return X(`ok/cache/snapshot-selection-read-failed`,{message:e instanceof Error?e.message:String(e)}),null}}function zu(e){for(let t of e)try{let e=od(t.fromDocName);if(e&&!e.editor.isDestroyed){if(e.ytext.length===0){X(`ok/cache/snapshot-skipped-empty`,{fromDocName:t.fromDocName});continue}Pu(t.toDocName,{html:e.editor.getHTML(),scrollTop:Lu(),selection:Ru(e.editor)})}else X(`ok/cache/snapshot-skipped`,{fromDocName:t.fromDocName})}catch(e){X(`ok/cache/snapshot-capture-failed`,{fromDocName:t.fromDocName,message:e instanceof Error?e.message:String(e)})}}var Bu=[],Vu=[],Hu=new Set;function Uu(){if(typeof document>`u`)return null;let e=document.createElement(`div`);return e.setAttribute(`data-ok-editor-parking`,``),e.style.display=`none`,e.style.position=`absolute`,e.style.left=`-99999px`,e}function Wu(e){let{docName:t,container:n,factory:r,sizeStats:i}=e;if(i&&!Au(i)){let e=r(n);return X(`ok/cache/miss`,{docName:t,mountId:Yl(t),viewCount:i?.viewCount??-1,bytes:i?.bytes??-1,reason:`size-gate`}),{editor:e.editor,ydoc:e.ydoc,ytext:e.ytext,provider:e.provider,scrollTop:0,hadFocus:!1,activeMountKey:t,parkingNode:null,__uncached:!0}}let a=ju.get(t);if(a){if(X(`ok/cache/reparent-start`,{docName:t,mountId:Yl(t),kind:`tiptap`,viewCount:i?.viewCount??-1,bytes:i?.bytes??-1}),Qu(a,n),a.activeMountKey=t,ed(Bu,t),n.scrollTop=a.scrollTop,a.hadFocus)try{a.editor.commands.focus()}catch{}return X(`ok/cache/reparent-end`,{docName:t,mountId:Yl(t),kind:`tiptap`,viewCount:i?.viewCount??-1,bytes:i?.bytes??-1}),X(`ok/cache/hit`,{docName:t,mountId:Yl(t),kind:`tiptap`}),i&&X(`ok/cold/editor-mount-stats`,{docName:t,mountId:Yl(t),viewCount:i.viewCount,bytes:i.bytes,cacheHit:!0,kind:`tiptap`}),a}for(;ju.size>=Du;){let e=td(Bu,t);if(!e)break;Ku(e)}let o=r(n),s={editor:o.editor,ydoc:o.ydoc,ytext:o.ytext,provider:o.provider,scrollTop:0,hadFocus:!1,activeMountKey:t,parkingNode:null};return ju.set(t,s),ed(Bu,t),X(`ok/cache/miss`,{docName:t,mountId:Yl(t),viewCount:i?.viewCount??-1,bytes:i?.bytes??-1,reason:`cold`,kind:`tiptap`}),i&&X(`ok/cold/editor-mount-stats`,{docName:t,mountId:Yl(t),viewCount:i.viewCount,bytes:i.bytes,cacheHit:!1,kind:`tiptap`}),s}function Gu(e){let t=e.activeMountKey;if(e.__uncached){t&&Cu(t);let n=Eu(e.editor);try{e.editor.destroy()}catch(e){X(`ok/cache/park-destroy-failed`,{docName:t??``,kind:`tiptap`,message:e instanceof Error?e.message:String(e)})}n&&(n.restore=void 0),e.activeMountKey=null;return}let n=Xu(e.editor);if(n){e.hadFocus=Zu(n.dom),e.scrollTop=(n.scrollDOM??n.dom.parentElement??n.dom).scrollTop??0;let t=n.dom.parentElement;t&&t.removeChild(n.dom),e.parkingNode||=Uu(),e.parkingNode&&e.parkingNode.appendChild(n.dom)}e.activeMountKey=null}function Ku(e){Cu(e);let t=ju.get(e);if(!t)return!1;let n=Eu(t.editor);try{t.editor.destroy()}catch(t){X(`ok/cache/evict-failed`,{docName:e,kind:`tiptap`,stage:`editor`,message:t instanceof Error?t.message:String(t)})}n&&(n.restore=void 0);try{t.provider.destroy()}catch(t){X(`ok/cache/evict-failed`,{docName:e,kind:`tiptap`,stage:`provider`,message:t instanceof Error?t.message:String(t)})}try{t.ydoc.destroy()}catch(t){X(`ok/cache/evict-failed`,{docName:e,kind:`tiptap`,stage:`ydoc`,message:t instanceof Error?t.message:String(t)})}ju.delete(e);let r=Bu.indexOf(e);return r!==-1&&Bu.splice(r,1),X(`ok/cache/evict`,{docName:e,kind:`tiptap`}),!0}function qu(e){let{docName:t,container:n,factory:r,sizeStats:i}=e;if(i&&!Au(i)){let e=r(n);return X(`ok/cache/miss`,{docName:t,mountId:Yl(t),viewCount:i?.viewCount??-1,bytes:i?.bytes??-1,reason:`size-gate`,kind:`cm`}),{view:e.view,ydoc:e.ydoc,ytext:e.ytext,provider:e.provider,themeCompartment:e.themeCompartment,wordWrapCompartment:e.wordWrapCompartment,placeholderCompartment:e.placeholderCompartment,lintCompartment:e.lintCompartment,scrollTop:0,hadFocus:!1,activeMountKey:t,parkingNode:null,__uncached:!0}}let a=Mu.get(t);if(a){if(X(`ok/cache/reparent-start`,{docName:t,mountId:Yl(t),kind:`cm`,viewCount:i?.viewCount??-1,bytes:i?.bytes??-1}),$u(a,n),a.activeMountKey=t,ed(Vu,t),n.scrollTop=a.scrollTop,a.hadFocus)try{a.view.focus()}catch{}return X(`ok/cache/reparent-end`,{docName:t,mountId:Yl(t),kind:`cm`,viewCount:i?.viewCount??-1,bytes:i?.bytes??-1}),X(`ok/cache/hit`,{docName:t,mountId:Yl(t),kind:`cm`}),i&&X(`ok/cold/editor-mount-stats`,{docName:t,mountId:Yl(t),viewCount:i.viewCount,bytes:i.bytes,cacheHit:!0,kind:`cm`}),a}for(;Mu.size>=Du;){let e=td(Vu,t);if(!e)break;Yu(e)}let o=r(n),s={view:o.view,ydoc:o.ydoc,ytext:o.ytext,provider:o.provider,themeCompartment:o.themeCompartment,wordWrapCompartment:o.wordWrapCompartment,placeholderCompartment:o.placeholderCompartment,lintCompartment:o.lintCompartment,scrollTop:0,hadFocus:!1,activeMountKey:t,parkingNode:null};return Mu.set(t,s),ed(Vu,t),X(`ok/cache/miss`,{docName:t,mountId:Yl(t),viewCount:i?.viewCount??-1,bytes:i?.bytes??-1,reason:`cold`,kind:`cm`}),i&&X(`ok/cold/editor-mount-stats`,{docName:t,mountId:Yl(t),viewCount:i.viewCount,bytes:i.bytes,cacheHit:!1,kind:`cm`}),s}function Ju(e){if(e.__uncached){try{e.view.destroy()}catch(t){X(`ok/cache/park-destroy-failed`,{docName:e.activeMountKey??``,kind:`cm`,message:t instanceof Error?t.message:String(t)})}e.activeMountKey=null;return}let t=e.view.dom;e.hadFocus=Zu(t),e.scrollTop=(e.view.scrollDOM??t).scrollTop??0;let n=t.parentElement;n&&n.removeChild(t),e.parkingNode||=Uu(),e.parkingNode&&e.parkingNode.appendChild(t),e.activeMountKey=null}function Yu(e){let t=Mu.get(e);if(!t)return!1;try{t.view.destroy()}catch(t){X(`ok/cache/evict-failed`,{docName:e,kind:`cm`,stage:`view`,message:t instanceof Error?t.message:String(t)})}try{t.provider.destroy()}catch(t){X(`ok/cache/evict-failed`,{docName:e,kind:`cm`,stage:`provider`,message:t instanceof Error?t.message:String(t)})}try{t.ydoc.destroy()}catch(t){X(`ok/cache/evict-failed`,{docName:e,kind:`cm`,stage:`ydoc`,message:t instanceof Error?t.message:String(t)})}Mu.delete(e);let n=Vu.indexOf(e);return n!==-1&&Vu.splice(n,1),X(`ok/cache/evict`,{docName:e,kind:`cm`}),!0}function Xu(e){return e.editorView??null}function Zu(e){if(typeof document>`u`)return!1;let t=document.activeElement;return t?t===e?!0:e.contains(t):!1}function Qu(e,t){let n=Xu(e.editor);if(!n)return;let r=n.dom,i=r.parentElement;i&&i!==t&&i.removeChild(r),r.parentElement!==t&&t.appendChild(r)}function $u(e,t){let n=e.view.dom,r=n.parentElement;r&&r!==t&&r.removeChild(n),n.parentElement!==t&&t.appendChild(n)}function ed(e,t){let n=e.indexOf(t);n!==-1&&e.splice(n,1),e.push(t)}function td(e,t){for(let n of e)if(n!==t&&!Hu.has(n))return n;X(`ok/cache/evict-fallback-activity-saturated`,{mountingDocName:t,lruLength:e.length,activityMountCount:Hu.size});for(let n of e)if(n!==t)return n;return null}function nd(e){let t=Hu,n=new Set(e);for(let e of t){if(n.has(e))continue;let t=id(e);if(t)try{t.disconnect(),X(`ok/cache/disconnect`,{docName:e})}catch(t){X(`ok/cache/disconnect-failed`,{docName:e,message:t instanceof Error?t.message:String(t)})}}for(let e of n){if(t.has(e))continue;let n=id(e);if(!n)continue;let r=t=>{X(`ok/cache/connect-failed`,{docName:e,message:t instanceof Error?t.message:String(t)})};try{let t=n.connect();t&&typeof t.then==`function`?t.then(()=>X(`ok/cache/connect`,{docName:e}),e=>r(e)):X(`ok/cache/connect`,{docName:e})}catch(e){r(e)}}Hu=n}var rd=null;function id(e){let t=ju.get(e);if(t)return t.provider;let n=Mu.get(e);if(n)return n.provider;if(rd){let t=rd.entries.get(e);if(t)return t.provider}return null}function ad(e){rd=e;let t=e.onEvict(e=>{Ku(e),Yu(e)});return()=>{t(),rd===e&&(rd=null)}}function od(e){return ju.get(e)}function sd(e,t){let n=e.replace(/^\/+|\/+$/g,``);return`${pr}${n?`${n}/`:``}${t}`}function cd(e,t){return`${ht}/${e}/${t}`}function ld(e){let t=`${ht}/`;if(!e.startsWith(t)||!e.endsWith(`/SKILL`))return null;let n=e.slice(t.length,e.length-6);return n&&!n.includes(`/`)?n:null}function ud(e){return Qn.includes(e)}var dd=`ok-editor-tabs-v1:`,fd=`\0folder:`,pd=`\0asset:`,md=`\0skill-file:`,hd=`\0doc-tab:`,gd=/\.(md|mdx)$/i;function _d(e){let t=e.lastIndexOf(hd);return t<0?{baseTabId:e,instanceSuffix:``}:{baseTabId:e.slice(0,t),instanceSuffix:e.slice(t)}}function vd(e){return _d(e).baseTabId}function yd(e){return gd.test(e)?e.replace(gd,``):null}function bd(e){if(typeof e!=`string`||e.length===0)return!1;let t=vd(e);return t.startsWith(fd)?t.length>8:t.startsWith(pd)?t.length>7:t.startsWith(md)?Sd(t)!==null:!0}function xd(e){return`${md}${e.scope}/${e.name}/${e.path}`}function Sd(e){if(!e.startsWith(md))return null;let t=e.slice(12).split(`/`);if(t.length<3)return null;let[n,r,...i]=t,a=i.join(`/`);return!n||!r||!a||!ud(n)?null:{scope:n,name:r,path:a}}function Cd(e){return e}function wd(e){return`${fd}${e}`}function Td(e){return`${pd}${e}`}function Ed(e,t){let n=ld(e);if(n){let e=zr(n);return{baseName:e,extension:``,label:e,prefix:``}}let r=e.lastIndexOf(`/`),i=r<0?e:e.slice(r+1),a=gd.test(t)&&gd.test(i)?``:t,o=`${i}${a}`;return r<0?{baseName:i,extension:a,label:o,prefix:``}:{baseName:i,extension:a,label:o,prefix:`${e.slice(0,r)}/`}}function Dd(e){switch(e.kind){case`doc`:case`folder-index`:case`large-file`:return Cd(e.docName);case`folder`:return wd(e.folderPath);case`missing`:return Cd(e.target);case`asset`:return Td(e.assetPath);case`skill-file`:return xd(e)}}function Od(e){let t=vd(e);if(t.startsWith(fd))return{kind:`folder`,folderPath:t.slice(8)};if(t.startsWith(pd))return{kind:`asset`,assetPath:t.slice(7)};let n=Sd(t);return n?{kind:`skill-file`,...n}:{kind:`doc`,docName:t}}function kd(e){let t=Od(e);return t.kind===`doc`?t.docName:null}function Ad(e,t){if(!Array.isArray(e)||t<=0)return[];let n=[],r=new Set;for(let i of e)if(bd(i)&&!r.has(i)&&(r.add(i),n.push(i),n.length>=t))break;return n}function jd(e,t){let n=new Set(Ad(t,2**53-1));return Ad(e,2**53-1).filter(e=>n.has(e))}function Md(e,t,n){if(t<=0)return[];let r=new Set(Ad(n,2**53-1)),i=Ad(e,2**53-1);if(r.size===0&&i.length<=t)return i;let a=[],o=0;for(let e=i.length-1;e>=0;e--){let n=i[e];if(r.has(n)){a.push(n);continue}o>=t||(o++,a.push(n))}return a.reverse()}function Nd(e,t,n){let r=jd(e,n);return!Ad(n,2**53-1).includes(t)||r.includes(t)?r:[...r,t]}function Pd(e,t){return Ad(e,2**53-1).filter(e=>e!==t)}function Fd(e,t){let n=new Set(Ad(t,2**53-1));return Ad(e,2**53-1).filter(e=>!n.has(e))}function Id(e,t,n){let r=Ad(e,2**53-1),i=jd(t,r),a=r.indexOf(n);if(a<0)return i;let o=i.includes(n),s=a<i.length;return o===s?i:s?Nd(i,n,r):Pd(i,n)}function Ld(e,t,n,r=[]){let i=Md(e,n,r);return!bd(t)||i.includes(t)?i:Md([...i,t],n,r)}function Rd(e,t,n,r,i=[]){let a=Md(e,r,i);if(!bd(n))return a;if(!t||t===n)return Ld(a,n,r,i);let o=a.filter(e=>e!==n),s=o.indexOf(t);if(s<0)return Ld(o,n,r,i);let c=[...o];return c[s]=n,Md(c,r,i)}function zd(e,t,n){return Bd(e,Cd(t),n)}function Bd(e,t,{behavior:n,currentTabId:r,limit:i,pinnedTabIds:a=[]}){let o=Md(e,i,a),s=vd(t);if(r&&o.includes(r)&&vd(r)===s)return{tabs:o,activeTabId:r};let c=o.find(e=>vd(e)===s);return c?{tabs:o,activeTabId:c}:n===`replace-active`?{tabs:Rd(o,r,s,i,a),activeTabId:s}:{tabs:Ld(o,s,i,a),activeTabId:s}}function Vd(e,t){return e.filter(e=>e!==t)}function Hd(e,t,n){let r=Ad(t,2**53-1),i=new Set(r),a=new Set(n),o=new Set,s=[];for(let t of e)o.has(t)||!i.has(t)&&!a.has(t)||(o.add(t),s.push(t));for(let e of[...r,...n])o.has(e)||(o.add(e),s.push(e));return s}function Ud(e,{pages:t,folderPaths:n,assetPaths:r,filePaths:i,keepMissingDocName:a=null,keepHashDocName:o=null}){return Ad(e,2**53-1).filter(e=>{let s=Od(e);if(s.kind===`folder`)return n.has(s.folderPath);if(s.kind===`asset`)return r.has(s.assetPath)||i?.has(s.assetPath)===!0;if(s.kind===`skill-file`)return!0;let c=yd(s.docName);return t.has(s.docName)||c!==null&&t.has(c)||gn(s.docName)||s.docName===a||s.docName===o})}function Wd(e,t,n,r=[],i=[],a=[]){if(t.length===0&&r.length===0&&a.length===0)return Ad(e,n);let o=new Map(t.map(e=>[e.fromDocName,e.toDocName])),s=new Map(a.flatMap(e=>{let t=yd(e.fromPath);return t?[[t,e.toPath]]:[]})),c=new Map(a.flatMap(e=>{let t=yd(e.toPath);return t?[[e.fromPath,t]]:[]})),l=e=>qd(Kd(e,r),a),u=(e,t)=>{let n=o.get(e);if(n)return n;let r=s.get(e);return r?Td(r):t},d=e=>{let t=c.get(e);return t?Cd(t):Td(l(e))},f=[],p=new Set;for(let t of e){let{instanceSuffix:e}=_d(t),a=Od(t),o=`${a.kind===`doc`?u(a.docName,vd(t)):a.kind===`folder`?wd(Kd(a.folderPath,r)):a.kind===`asset`?d(a.assetPath):vd(t)}${e}`;if(!p.has(o)&&(p.add(o),f.push(o),i.length===0&&f.length>=n))break}return i.length===0?f:Md(f,n,i.map(e=>{let t=Od(e);return t.kind===`doc`?u(t.docName,e):t.kind===`folder`?wd(Kd(t.folderPath,r)):t.kind===`asset`?d(t.assetPath):vd(e)}))}function Gd(e,t,n=[],r=[]){return Wd(e,t,2**53-1,n,[],r)}function Kd(e,t){for(let{fromPath:n,toPath:r}of t){if(e===n)return r;if(e.startsWith(`${n}/`))return`${r}${e.slice(n.length)}`}return e}function qd(e,t){for(let{fromPath:n,toPath:r}of t)if(e===n)return r;return e}function Jd(e,t,n){if(t!==n)return t;let r=e.indexOf(n);return r<0?e[0]??null:e[r+1]??e[r-1]??null}function Yd(e,t,n){if(!t)return null;let r=new Set(n);if(!r.has(t))return t;let i=e.indexOf(t);if(i<0)return e.find(e=>!r.has(e))??null;for(let t=i+1;t<e.length;t++)if(!r.has(e[t]))return e[t];for(let t=i-1;t>=0;t--)if(!r.has(e[t]))return e[t];return null}function Xd(e,t){if(typeof e!=`object`||!e)return{openTabs:[],pinnedTabIds:[],activeDocName:null,activeTabId:null,updatedAt:null};let n=e,r=Ad(n.openTabs,2**53-1),i=jd(n.pinnedTabIds,r),a=i.length===0?Ad(n.openTabs,t):Md(r,t,i),o=jd(n.pinnedTabIds,a),s=typeof n.activeTabId==`string`&&a.includes(n.activeTabId)?n.activeTabId:typeof n.activeDocName==`string`&&a.includes(n.activeDocName)?n.activeDocName:null,c=s?Od(s):null;return{openTabs:a,pinnedTabIds:o,activeDocName:c?.kind===`doc`?c.docName:null,activeTabId:s,updatedAt:typeof n.updatedAt==`string`?n.updatedAt:null}}function Zd(e,t,n=[],r=()=>new Date){let i=Ad(e,2**53-1),a=t&&i.includes(t)?t:null,o=a?Od(a):null;return{openTabs:i,pinnedTabIds:jd(n,i),activeDocName:o?.kind===`doc`?o.docName:null,activeTabId:a,updatedAt:r().toISOString()}}function Qd(e){return`${dd}${e}`}function $d(e,t,n){if(!e)return{openTabs:[],pinnedTabIds:[],activeDocName:null,activeTabId:null,updatedAt:null};try{let r=e.getItem(t);return r?Xd(JSON.parse(r),n):{openTabs:[],pinnedTabIds:[],activeDocName:null,activeTabId:null,updatedAt:null}}catch(e){return console.warn(`[editor-tabs] failed to read local tab session:`,e),{openTabs:[],pinnedTabIds:[],activeDocName:null,activeTabId:null,updatedAt:null}}}function ef(e,t,n){if(e)try{e.setItem(t,JSON.stringify(n))}catch(e){console.warn(`[editor-tabs] failed to write local tab session:`,e)}}var tf=e=>fa((t,n)=>{e.onerror=e=>n(Error(e.target.error)),e.onsuccess=e=>t(e.target.result)}),nf=(e,t)=>fa((n,r)=>{let i=indexedDB.open(e);i.onupgradeneeded=e=>t(e.target.result),i.onerror=e=>r(Gi(e.target.error)),i.onsuccess=e=>{let t=e.target.result;t.onversionchange=()=>{t.close()},n(t)}}),rf=e=>tf(indexedDB.deleteDatabase(e)),af=(e,t)=>t.forEach(t=>e.createObjectStore.apply(e,t)),of=(e,t,n=`readwrite`)=>{let r=e.transaction(t,n);return t.map(e=>_f(r,e))},sf=(e,t)=>tf(e.count(t)),cf=(e,t)=>tf(e.get(t)),lf=(e,t)=>tf(e.delete(t)),uf=(e,t,n)=>tf(e.put(t,n)),df=(e,t)=>tf(e.add(t)),ff=(e,t,n)=>tf(e.getAll(t,n)),pf=(e,t,n)=>{let r=null;return gf(e,t,e=>(r=e,!1),n).then(()=>r)},mf=(e,t=null)=>pf(e,t,`prev`),hf=(e,t)=>fa((n,r)=>{e.onerror=r,e.onsuccess=async e=>{let r=e.target.result;if(r===null||await t(r)===!1)return n();r.continue()}}),gf=(e,t,n,r=`next`)=>hf(e.openKeyCursor(t,r),e=>n(e.key)),_f=(e,t)=>e.objectStore(t),vf=(e,t)=>IDBKeyRange.upperBound(e,t),yf=(e,t)=>IDBKeyRange.lowerBound(e,t),bf=`custom`,xf=`updates`,Sf=(e,t=()=>{},n=()=>{})=>{let[r]=of(e.db,[xf]);return ff(r,yf(e._dbref,!1)).then(i=>{e._destroyed||(t(r),Oi(e.doc,()=>{i.forEach(t=>ta(e.doc,t))},e,!1),n(r))}).then(()=>mf(r).then(t=>{e._dbref=t+1})).then(()=>sf(r).then(t=>{e._dbsize=t})).then(()=>r)},Cf=(e,t=!0)=>Sf(e).then(n=>{(t||e._dbsize>=500)&&df(n,Di(e.doc)).then(()=>lf(n,vf(e._dbref,!0))).then(()=>sf(n).then(t=>{e._dbsize=t}))}),wf=class extends ga{constructor(e,t){super(),this.doc=t,this.name=e,this._dbref=0,this._dbsize=0,this._destroyed=!1,this.db=null,this.synced=!1,this._db=nf(e,e=>af(e,[[`updates`,{autoIncrement:!0}],[`custom`]])),this.whenSynced=fa(e=>this.on(`synced`,()=>e(this))),this._db.then(e=>{this.db=e,Sf(this,async e=>{await sf(e)>0&&df(e,Di(t))},()=>{if(this._destroyed)return this;this.synced=!0,this.emit(`synced`,[this])})}),this._storeTimeout=1e3,this._storeTimeoutId=null,this._storeUpdate=(e,t)=>{if(this.db&&t!==this){let[t]=of(this.db,[xf]);df(t,e).catch(e=>{globalThis.__okYdbWriteWarned||(globalThis.__okYdbWriteWarned=!0,console.warn(JSON.stringify({event:`ok-ydb-write-failed`,cause:e?.name??`unknown`,message:e?.message??String(e)})))}),++this._dbsize>=500&&(this._storeTimeoutId!==null&&clearTimeout(this._storeTimeoutId),this._storeTimeoutId=setTimeout(()=>{Cf(this,!1),this._storeTimeoutId=null},this._storeTimeout))}},t.on(`update`,this._storeUpdate),this.destroy=this.destroy.bind(this),t.on(`destroy`,this.destroy)}destroy(){return this._storeTimeoutId&&clearTimeout(this._storeTimeoutId),this.doc.off(`update`,this._storeUpdate),this.doc.off(`destroy`,this.destroy),this._destroyed=!0,this._db.then(e=>{e.close()})}clearData(){return this.destroy().then(()=>{rf(this.name)})}get(e){return this._db.then(t=>{let[n]=of(t,[bf],`readonly`);return cf(n,e)})}set(e,t){return this._db.then(n=>{let[r]=of(n,[bf]);return uf(r,t,e)})}del(e){return this._db.then(t=>{let[n]=of(t,[bf]);return lf(n,e)})}},Tf=`updates`,Ef=`custom`;function Df(){return!0}var Of=class{_idb;_dbName;whenSynced;constructor({branch:e,serverInstanceId:t,docName:n,doc:r}){if(typeof t!=`string`||t.length===0)throw Error(`createClientPersistence: serverInstanceId is required and must be non-empty`);this._dbName=`ok-ydoc:${e}:${t}:${n}`;let i=Df()?0:performance.now();this._idb=new wf(this._dbName,r),this.whenSynced=this._idb.whenSynced.then(()=>{if(!Df()){let e=performance.now();X(`ok/pool/idb-whensynced`,{docName:n,durationMs:Math.round((e-i)*1e3)/1e3},{startTime:i,duration:e-i})}return this})}get synced(){return this._idb.synced}async destroy(){let e=Df()?0:performance.now();try{await this._idb.destroy()}finally{if(!Df()){let t=performance.now();X(`ok/pool/idb-destroy`,{dbName:this._dbName,durationMs:Math.round((t-e)*1e3)/1e3},{startTime:e,duration:t-e})}}}async flushFullState(){this._idb.db===null&&await this.whenSynced;let e=this._idb.db;if(e===null)return;let t=this._idb;await new Promise((n,r)=>{let i=e.transaction(Tf,`readwrite`),a=i.objectStore(Tf),o=a.getAll();o.onerror=()=>r(o.error??Error(`flushFullState getAll failed`)),o.onsuccess=()=>{try{Oi(t.doc,()=>{for(let e of o.result)ta(t.doc,e)},t,!1);let e=a.add(Di(t.doc));e.onerror=()=>r(e.error??Error(`flushFullState add failed`)),e.onsuccess=()=>{a.delete(IDBKeyRange.upperBound(e.result,!0))}}catch(e){r(e instanceof Error?e:Error(String(e)));try{i.abort()}catch{}}},i.oncomplete=()=>n(),i.onabort=()=>r(i.error??Error(`flushFullState transaction aborted`))})}async clearData(){let e=Df()?0:performance.now();try{await this._idb.destroy();let e=this._dbName;await new Promise((t,n)=>{let r=indexedDB.deleteDatabase(e);r.onsuccess=()=>t(),r.onerror=()=>n(r.error),r.onblocked=()=>{console.warn(JSON.stringify({event:`ok-client-persistence-clear-blocked`,dbName:e}))}})}finally{if(!Df()){let t=performance.now();X(`ok/pool/idb-cleardata`,{dbName:this._dbName,durationMs:Math.round((t-e)*1e3)/1e3},{startTime:e,duration:t-e})}}}};function kf(e){return new Of(e)}async function Af(e){if(typeof indexedDB>`u`)return null;let t=`ok-ydoc:${e.branch}:${e.serverInstanceId}:${e.docName}`;if(typeof indexedDB.databases==`function`&&!(await indexedDB.databases()).some(e=>e.name===t))return null;let n=await new Promise((e,n)=>{let r=indexedDB.open(t);r.onupgradeneeded=()=>{let e=r.result;e.objectStoreNames.contains(Tf)||e.createObjectStore(Tf,{autoIncrement:!0}),e.objectStoreNames.contains(Ef)||e.createObjectStore(Ef)},r.onsuccess=()=>e(r.result),r.onerror=()=>n(r.error)});try{if(!n.objectStoreNames.contains(Tf))return null;let e=await new Promise((e,t)=>{let r=n.transaction(Tf,`readonly`).objectStore(Tf).getAll();r.onsuccess=()=>e(r.result),r.onerror=()=>t(r.error)});if(e.length===0)return null;let t=new Zi;try{Oi(t,()=>{for(let n of e)ta(t,n)});let n=t.getMap(`lifecycle`).get(wt);return typeof n==`string`&&n.length>0?n:null}finally{t.destroy()}}finally{n.close()}}function jf(e){return Ei(e)}function Mf(e,t){return t===null?Di(e):Di(e,t)}function Nf(e,t){if(e===null)return t;if(t===null)return e;let n=Vi(e),r=Vi(t),i=new Map;for(let[e,t]of n)i.set(e,t);for(let[e,t]of r){let n=i.get(e);(n===void 0||t>n)&&i.set(e,t)}return Ei(i)}function Pf(e){let t={};if(Dr.inject(Er.active(),t),!t.traceparent)return e;let n=e.includes(`?`)?`&`:`?`,r=[`traceparent=${encodeURIComponent(t.traceparent)}`];return t.tracestate&&r.push(`tracestate=${encodeURIComponent(t.tracestate)}`),`${e}${n}${r.join(`&`)}`}var Ff=({key:e,editor:t,onPaste:n,onDrop:r,allowedMimeTypes:i})=>new kn({key:e||new dr(`fileHandler`),props:{handleDrop(e,n){if(!r||!n.dataTransfer?.files.length)return!1;let a=e.posAtCoords({left:n.clientX,top:n.clientY}),o=Array.from(n.dataTransfer.files);return i&&(o=o.filter(e=>i.includes(e.type))),o.length===0?!1:(n.preventDefault(),n.stopPropagation(),r(t,o,a?.pos||0),!0)},handlePaste(e,r){if(!n||!r.clipboardData?.files.length)return!1;let a=Array.from(r.clipboardData.files),o=r.clipboardData.getData(`text/html`);return i&&(a=a.filter(e=>i.includes(e.type))),!(a.length===0||(r.preventDefault(),r.stopPropagation(),n(t,a,o),o.length>0))}}}),If=yr.create({name:`fileHandler`,addOptions(){return{onPaste:void 0,onDrop:void 0,allowedMimeTypes:void 0}},addProseMirrorPlugins(){return[Ff({key:new dr(this.name),editor:this.editor,allowedMimeTypes:this.options.allowedMimeTypes,onDrop:this.options.onDrop,onPaste:this.options.onPaste})]}});function Lf(e,t){let{state:n,view:r}=e;if(!n.selection.empty||!r.endOfTextblock(t))return!1;let i=n.selection.$head,a=t===`down`||t===`right`,o=null,s=-1;if(a){let e=i.after();if(e>=n.doc.content.size)return!1;o=n.doc.nodeAt(e),s=e}else{let e=i.before();if(e<=0||(o=n.doc.resolve(e).nodeBefore,!o))return!1;s=e-o.nodeSize}if(!o||o.type.name!==`jsxComponent`||o.childCount!==0||!tt.isSelectable(o))return!1;try{let t=tt.create(n.doc,s);return e.view.dispatch(n.tr.setSelection(t).scrollIntoView()),!0}catch(e){if(!(e instanceof RangeError))throw e;return nt(t),console.warn(JSON.stringify({event:`jsx-component-arrow-node-select-failed`,direction:t,tier:`L0`,reason:e.message.slice(0,500)})),!0}}function Rf(e){let{state:t,view:n}=e;if(!(t.selection instanceof Rn)||!t.selection.empty||!n.endOfTextblock(`up`))return!1;let r=t.selection.$head,i=-1;for(let e=r.depth-1;e>=1;e--)if(r.node(e).type.name===`jsxComponent`){i=e;break}if(i<0)return!1;for(let e=r.depth;e>i;e--)if(r.index(e-1)!==0)return!1;let a=r.before(i);try{let n=t.doc.resolve(a),r=Yn.findFrom(n,-1,!0);return!r||!(r instanceof Rn)?!1:(e.view.dispatch(t.tr.setSelection(r).scrollIntoView()),!0)}catch(e){if(!(e instanceof RangeError))throw e;return nt(`up`),console.warn(JSON.stringify({event:`jsx-component-arrow-node-select-failed`,direction:`up`,tier:`L2c`,reason:e.message.slice(0,500)})),!0}}function zf(e,t){let{state:n,view:r}=e;if(!(n.selection instanceof Rn)||!n.selection.empty||!r.endOfTextblock(t))return!1;let i=n.selection.$head,a=t===`down`||t===`right`,o=null,s=-1;if(a){let e=i.after();if(e>=n.doc.content.size)return!1;o=n.doc.nodeAt(e),s=e}else{let e=i.before();if(e<=0||(o=n.doc.resolve(e).nodeBefore,!o))return!1;s=e-o.nodeSize}if(!o||o.type.name!==`jsxComponent`||o.childCount===0)return!1;let c=s+o.nodeSize;try{let t=a?s+1:c-1,r=Yn.findFrom(n.doc.resolve(t),a?1:-1,!0);return!r||!(r instanceof Rn)||r.$head.pos<=s||r.$head.pos>=c?!1:(e.view.dispatch(n.tr.setSelection(r).scrollIntoView()),!0)}catch(e){if(!(e instanceof RangeError))throw e;return nt(t),console.warn(JSON.stringify({event:`jsx-component-arrow-node-select-failed`,direction:t,tier:`L2d`,reason:e.message.slice(0,500)})),!0}}var Bf=yr.create({name:`keyboardNav`,priority:50,addKeyboardShortcuts(){return{Escape:({editor:e})=>{let{state:t}=e;if(t.selection instanceof tt){if(t.selection.$from.depth===0)return e.commands.blur(),!0;let n=t.selection.from+t.selection.node.nodeSize,r=t.doc.resolve(Math.min(n,t.doc.content.size)),i=Rn.near(r);return e.view.dispatch(t.tr.setSelection(i)),!0}return t.selection instanceof Rn?e.commands.selectParentNode():!1},ArrowUp:({editor:e})=>{if(Lf(e,`up`)||Rf(e)||zf(e,`up`))return!0;let{state:t}=e;if(!(t.selection instanceof tt))return!1;let n=t.selection.from,r=t.doc.resolve(n);if(r.index(r.depth)===0)return!1;let i=r.before(r.depth);if(i<=0)return!1;let a=t.doc.resolve(i-1).nodeBefore;if(!a||i-1-a.nodeSize+1<0)return!1;try{let n=tt.create(t.doc,i-a.nodeSize);return e.view.dispatch(t.tr.setSelection(n).scrollIntoView()),!0}catch(e){if(!(e instanceof RangeError))throw e;return nt(`up`),console.warn(JSON.stringify({event:`jsx-component-arrow-node-select-failed`,direction:`up`,tier:`L2`,reason:e.message.slice(0,500)})),!1}},ArrowDown:({editor:e})=>{if(Lf(e,`down`)||zf(e,`down`))return!0;let{state:t}=e;if(!(t.selection instanceof tt))return!1;let n=t.selection.from+t.selection.node.nodeSize;if(n>=t.doc.content.size)return!1;try{if(!t.doc.nodeAt(n))return!1;let r=tt.create(t.doc,n);return e.view.dispatch(t.tr.setSelection(r).scrollIntoView()),!0}catch(e){if(!(e instanceof RangeError))throw e;return nt(`down`),console.warn(JSON.stringify({event:`jsx-component-arrow-node-select-failed`,direction:`down`,tier:`L2`,reason:e.message.slice(0,500)})),!1}},ArrowLeft:({editor:e})=>Lf(e,`left`)||zf(e,`left`),ArrowRight:({editor:e})=>Lf(e,`right`)||zf(e,`right`),Enter:({editor:e})=>{let{state:t}=e;if(!(t.selection instanceof Rn)||!t.selection.empty)return!1;let n=t.selection.$from,r=n.parent;if(r.type.name!==`paragraph`||r.textContent!==``||n.depth<2)return!1;let i=-1;for(let e=n.depth-1;e>=1;e--)if(n.node(e).type.name===`jsxComponent`){i=e;break}if(i<0)return!1;let a=n.node(i);if(n.index(i)!==a.childCount-1)return!1;let o=n.after(i);if(o>t.doc.content.size)return!1;let s=t.tr,c=n.before(n.depth),l=n.after(n.depth);s.delete(c,l);let u=o-(l-c),d=t.schema.nodes.paragraph.create();s.insert(u,d);let f=u+1;return s.setSelection(Rn.create(s.doc,f)),e.view.dispatch(s.scrollIntoView()),!0}}}}),Vf={query:``,options:{caseSensitive:!1,wholeWord:!1},activeIndex:0,matches:[]},Hf=/[A-Za-z0-9_]/;function Uf(e){return e!==void 0&&Hf.test(e)}function Wf(e,t,n){return!Uf(e[t-1])&&!Uf(e[n])}function Gf(e,t,n){if(t.length===0)return[];let r=n.caseSensitive?e:e.toLocaleLowerCase(),i=n.caseSensitive?t:t.toLocaleLowerCase(),a=[],o=0;for(;o<=r.length-i.length;){let t=r.indexOf(i,o);if(t===-1)break;let s=t+i.length;(!n.wholeWord||Wf(e,t,s))&&a.push({start:t,end:s,text:e.slice(t,s)}),o=s}return a}function Kf(e,t,n){if(t.length===0)return[];let r=[];return e.descendants((e,i)=>{if(!(!e.isText||typeof e.text!=`string`))for(let a of Gf(e.text,t,n))r.push({from:i+a.start,to:i+a.end,text:a.text})}),r}var qf=new dr(`findReplace`);function Jf(e,t){return t<=0||!Number.isFinite(e)?0:Math.min(Math.max(Math.trunc(e),0),t-1)}function Yf(e,t,n,r){let i=Kf(e.doc,t,n);return{query:t,options:n,activeIndex:Jf(r,i.length),matches:i}}function Xf(e,t,n){return t<=0?0:(Jf(e,t)+n+t)%t}function Zf(e,t,n){if(e.length===0)return 0;let r=t+n,i=e.findIndex(e=>e.from>=r);return i===-1?0:i}function Qf(e,t,n){if(t.matches.length===0)return null;let r=e.tr;for(let e of[...t.matches].reverse())r.insertText(n,e.from,e.to);let i=Kf(r.doc,t.query,t.options),a=Jf(0,i.length),o=i[a];return r.setMeta(qf,{type:`setActiveIndex`,activeIndex:a}),o&&r.setSelection(Rn.create(r.doc,o.from,o.to)),r.scrollIntoView()}function $f(e,t){let n=qf.getState(e)?.matches[t];return n?e.tr.setMeta(qf,{type:`setActiveIndex`,activeIndex:t}).setSelection(Rn.create(e.doc,n.from,n.to)).scrollIntoView():null}function ep(e){return qf.getState(e)??Vf}function tp(){return new kn({key:qf,state:{init:()=>Vf,apply(e,t,n,r){let i=e.getMeta(qf);if(i?.type===`clear`)return Vf;let a=t.query,o=t.options,s=t.activeIndex;if(i?.type===`setQuery`)a=i.query,o={...o,...i.options},s=i.activeIndex??0;else if(i?.type===`setOptions`)o={...o,...i.options},s=i.activeIndex??s;else if(i?.type===`setActiveIndex`)s=i.activeIndex;else if(!e.docChanged)return t;return a.length===0?{query:a,options:o,activeIndex:0,matches:[]}:Yf(r,a,o,s)}},props:{decorations(e){let t=qf.getState(e);return!t||t.matches.length===0?null:cn.create(e.doc,t.matches.map((e,n)=>dn.inline(e.from,e.to,{class:n===t.activeIndex?`ok-find-match ok-find-match-active`:`ok-find-match`})))}}})}var np=yr.create({name:`findReplace`,addCommands(){return{setFindQuery:(e,t)=>({state:n,dispatch:r})=>(r&&r(n.tr.setMeta(qf,{type:`setQuery`,query:e,options:t?.options,activeIndex:t?.activeIndex})),!0),setFindOptions:(e,t)=>({state:n,dispatch:r})=>(r&&r(n.tr.setMeta(qf,{type:`setOptions`,options:e,activeIndex:t})),!0),setActiveFindIndex:e=>({state:t,dispatch:n})=>(n&&n(t.tr.setMeta(qf,{type:`setActiveIndex`,activeIndex:e})),!0),selectNextFindMatch:()=>({state:e,dispatch:t})=>{let n=ep(e),r=$f(e,Xf(n.activeIndex,n.matches.length,1));return r?(t?.(r),!0):!1},selectPreviousFindMatch:()=>({state:e,dispatch:t})=>{let n=ep(e),r=$f(e,Xf(n.activeIndex,n.matches.length,-1));return r?(t?.(r),!0):!1},replaceCurrentFindMatch:e=>({state:t,dispatch:n})=>{let r=ep(t),i=r.matches[r.activeIndex];if(!i||!n)return!1;let a=t.tr.insertText(e,i.from,i.to),o=Kf(a.doc,r.query,r.options),s=Zf(o,i.from,e.length),c=o[s];return a.setMeta(qf,{type:`setActiveIndex`,activeIndex:s}),c&&a.setSelection(Rn.create(a.doc,c.from,c.to)),a.scrollIntoView(),n(a),!0},replaceAllFindMatches:e=>({state:t,dispatch:n})=>{let r=ep(t);if(!n)return!1;let i=Qf(t,r,e);return i?(n(i),!0):!1},clearFindMatches:()=>({state:e,dispatch:t})=>(t&&t(e.tr.setMeta(qf,{type:`clear`})),!0)}},addProseMirrorPlugins(){return[tp()]}}),rp=/^(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/i,ip=/^([-.\w+]+)@([-\w]+(?:\.[-\w]+)+)/,ap=/[-\d_]$/,op=xr.map(e=>`${e}:`);function sp(e){let t=e.toLowerCase();return op.some(e=>t.startsWith(e))}function cp(e,t){let n=0;for(let r of e)r===t&&n++;return n}function lp(e){let t=e.split(`.`),n=t[t.length-1],r=t[t.length-2];return!(n&&(/_/.test(n)||!/[a-zA-Z\d]/.test(n))||r&&(/_/.test(r)||!/[a-zA-Z\d]/.test(r)))}function up(e){return e.split(`.`).length>=2&&lp(e)}function dp(e){let t=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!t)return[e,``];let n=e.slice(0,t.index),r=t[0],i=r.indexOf(`)`),a=cp(n,`(`),o=cp(n,`)`);for(;i!==-1&&a>o;)n+=r.slice(0,i+1),r=r.slice(i+1),i=r.indexOf(`)`),o++;return[n,r]}function fp(e){let t=rp.exec(e);if(!t)return null;let n=t[1],r=t[2],i=t[3],a=``,o=/^w/i.test(n);if(o&&(r=n+r,n=``,a=`http://`),o?!up(r):!lp(r))return null;let[s]=dp(r+i);if(!s)return null;let c=n+s,l=a+n+s;return sp(l)?{href:l,text:c}:null}function pp(e){let t=ip.exec(e);if(!t)return null;let n=t[1],r=t[2];if(ap.test(r))return null;let i=`${n}@${r}`,a=`mailto:${i}`;return sp(a)?{href:a,text:i}:null}function mp(e){return e?fp(e)??pp(e):null}function hp(e,t){let n=Kc.getState(e.state)?.undoManager;n?.stopCapturing();try{e.dispatch(t)}finally{n?.stopCapturing()}}var gp=`\\u0000-\\u0020\\u00A0\\u1680\\u180E\\u2000-\\u2029\\u205F\\u3000`,_p=RegExp(`[${gp}]`),vp=RegExp(`[${gp}]$`),yp=`link`,bp=`gfm-autolink`,xp=`preventAutolink`,Sp=new dr(`gfmAutolink`);function Cp(e,t,n){let r=e.state.schema.marks.code;return r?e.state.doc.rangeHasMark(t,n,r):!1}function wp(e,t,n){let r=[],i=Bt(rt(e.doc,[...n]));for(let{newRange:e}of i){let n=Ft(t.doc,e,e=>e.isTextblock),i,a;if(n.length>1)i=n[0],a=t.doc.textBetween(i.pos,i.pos+i.node.nodeSize,void 0,` `);else if(n.length===1){let r=t.doc.textBetween(e.from,e.to,` `,` `);if(!vp.test(r))continue;i=n[0],a=t.doc.textBetween(i.pos,e.to,void 0,` `)}if(!i||!a||i.node.type.spec.code)continue;let o=a.split(_p).filter(Boolean),s=o[o.length-1];if(!s)continue;let c=mp(s);if(!c)continue;let l=i.pos+a.lastIndexOf(s)+1,u=l+c.text.length;r.push({from:l,to:u,href:c.href,text:c.text})}return r}function Tp(e={}){let t=e.isActiveEditor??(e=>e.hasFocus()),n=null,r=!1,i=[],a=()=>{r=!1;let e=n,a=i.splice(0,i.length);if(!e||e.isDestroyed||e.composing||!t(e))return;let o=e.state.schema.marks[yp];if(!o)return;let s=e.state.tr,c=!1,l=e.state.doc.content.size;for(let t of a){let{from:n,to:r,href:i,text:a}=t;n<0||r>l||n>=r||e.state.doc.textBetween(n,r)===a&&(gt(n,r,e.state.doc).some(e=>e.mark.type===o)||Cp(e,n,r)||(s=s.addMark(n,r,o.create({href:i,linkStyle:bp})),c=!0))}if(c){s=s.setMeta(xp,!0);try{hp(e,s)}catch(e){console.warn(`[gfm-autolink] linkify dispatch failed`,{candidates:a.map(e=>({from:e.from,to:e.to,href:e.href}))},e)}}};return new kn({key:Sp,view(e){return n=e,{destroy(){n=null,i.length=0,r=!1}}},appendTransaction(e,o,s){if(e.some(e=>e.getMeta(Gc))||e.some(e=>e.getMeta(`preventAutolink`))||!(e.some(e=>e.docChanged)&&!o.doc.eq(s.doc))||!n||!t(n))return null;let c=wp(o,s,e);return c.length===0?null:(i.push(...c),r||(r=!0,queueMicrotask(a)),null)}})}var Ep=yr.create({name:`gfmAutolink`,addOptions(){return{isActiveEditor:void 0}},addProseMirrorPlugins(){return[Tp({isActiveEditor:this.options.isActiveEditor})]}}),Dp=new dr(`imageUpload`);function Op(e){let t=document.createElement(`div`);t.className=`image-upload-skeleton w-full h-40 rounded-md bg-muted animate-pulse motion-reduce:animate-none my-2`,t.setAttribute(`data-upload-widget`,`loading`),t.setAttribute(`role`,`status`);let n=e?.name;return t.setAttribute(`aria-label`,n?Y._({id:`KDuPiY`,values:{fileName:n}}):Y._({id:`bGa3Fk`})),t}var kp=new kn({key:Dp,state:{init(){return{decorations:cn.empty,uploads:new Map}},apply(e,t){let n=t.decorations.map(e.mapping,e.doc),r=new Map;for(let[n,i]of t.uploads)r.set(n,e.mapping.map(i));let i=e.getMeta(Dp);if(!i)return{decorations:n,uploads:r};if(i.type===`add`){let t=dn.widget(i.pos,i.widget,{id:i.id,stopEvent:()=>!0}),a=n.add(e.doc,[t]),o=new Map(r);return o.set(i.id,e.mapping.map(i.pos)),{decorations:a,uploads:o}}if(i.type===`remove`){let e=n.find(void 0,void 0,e=>e.id===i.id),t=n.remove(e),a=new Map(r);return a.delete(i.id),{decorations:t,uploads:a}}return{decorations:n,uploads:r}}},props:{decorations(e){return Dp.getState(e)?.decorations??cn.empty}}});function Ap(e){let t=e.lastIndexOf(`/`);return t===-1?``:e.slice(0,t)}function jp(e){let t=e.lastIndexOf(`/`);return t===-1?e:e.slice(t+1)}function Mp(e){return e.split(`/`).filter(e=>e!==``)}function Np(e,t){let n=Ap(e),r=Ap(t),i=jp(e);if(n===r)return i;let a=Mp(r),o=Mp(n),s=0;for(;s<a.length&&s<o.length&&a[s]===o[s];)s++;let c=a.length-s,l=o.slice(s);return c===0?`./${[...l,i].join(`/`)}`:[...Array(c).fill(`..`),...l,i].join(`/`)}function Pp(e){return Be(e)}function Fp(e,t){return{type:`jsxComponent`,attrs:{componentName:e===`jsx-img`?`img`:e===`jsx-video`?`video`:`audio`,kind:`element`,attributes:[],sourceRaw:``,sourceDirty:!0,props:e===`jsx-img`?{src:t}:{src:t,controls:!0}}}}function Ip(e){let t=St(e);return t===`md`||t===`mdx`?{kind:`wiki-link`,ext:t}:vr.has(t)?{kind:`jsx-img`,ext:t}:pt.has(t)?{kind:`jsx-video`,ext:t}:Fn.has(t)?{kind:`jsx-audio`,ext:t}:lt.has(t)?{kind:`jsx-file`,ext:t}:ut.has(t)?{kind:`wikiembed`,ext:t}:{kind:`markdown-link`,ext:t}}async function Lp(e,t,n){let r=Pp(t),i=r?`${r}.md`:``;if(!i){ri.error(Y._({id:`z5pqI8`}));return}let a=crypto.randomUUID(),o=Op(e);t.view.dispatch(t.state.tr.setMeta(Dp,{type:`add`,id:a,pos:n,widget:o}));let s=new FormData;s.append(`file`,e),s.append(`parentDocName`,i);let c;try{c=await fetch(`/api/upload`,{method:`POST`,body:s})}catch(e){console.error(`[uploadAndInsert] Network error:`,e),Rp(t,a);return}let l;try{l=await c.json()}catch(e){console.error(`[uploadAndInsert] Response is not JSON:`,e),Rp(t,a);return}if(!c.ok){let e=_n.safeParse(l);if(!e.success){let n=new ue(`Upload response did not match ProblemDetails.`,{cause:e.error,status:c.status});console.error(`[uploadAndInsert] Server error (unparseable):`,n),Rp(t,a);return}console.error(`[uploadAndInsert] Server error:`,e.data),Rp(t,a,e.data.title);return}let u=yt.safeParse(l);if(!u.success){let e=new ue(`Upload success response did not match UploadAssetSuccess.`,{cause:u.error,status:c.status});console.error(`[uploadAndInsert] Response missing src:`,e),Rp(t,a);return}let d=u.data,f=d.src,p=d.deduped===!0,m=Ap(i),h=typeof d.path==`string`&&d.path.length>0?d.path:m?`${m}/${f}`:f;p&&ri.info(Y._({id:`VbqhBI`,values:{assetContentPath:h}}));let g=Ip(e.name),{state:_}=t,v=Dp.getState(_)?.uploads.get(a)??n,y=_.tr.setMeta(Dp,{type:`remove`,id:a}),b=Np(h,i),x=`/${h}`;if(g.kind===`jsx-file`){if(!_.schema.nodes.jsxComponent){console.error(`[uploadAndInsert] jsxComponent node missing from schema`),Rp(t,a);return}let n={type:`jsxComponent`,attrs:{componentName:`WikiEmbedFile`,kind:`element`,attributes:[],sourceRaw:``,sourceDirty:!0,props:{src:x,target:f,alias:null,anchor:null,size:bt(e.size)}}};t.chain().command(({tr:e})=>(e.setMeta(Dp,{type:`remove`,id:a}),!0)).focus().insertContentAt(v,n).command(({tr:e,dispatch:t})=>{if(!t)return!0;let n=e.mapping.map(v);return e.doc.nodeAt(n)?.type.name===`jsxComponent`&&e.setSelection(tt.create(e.doc,n)),!0}).run();return}if(g.kind===`jsx-img`||g.kind===`jsx-video`||g.kind===`jsx-audio`){if(!_.schema.nodes.jsxComponent){console.error(`[uploadAndInsert] jsxComponent node missing from schema`),Rp(t,a);return}let e=Fp(g.kind,x);t.chain().command(({tr:e})=>(e.setMeta(Dp,{type:`remove`,id:a}),!0)).focus().insertContentAt(v,e).command(({tr:e,dispatch:t})=>{if(!t)return!0;let n=e.mapping.map(v);return e.doc.nodeAt(n)?.type.name===`jsxComponent`&&e.setSelection(tt.create(e.doc,n)),!0}).run();return}if(g.kind===`wikiembed`){let e=_.schema.nodes.wikiLinkEmbed;if(!e){console.error(`[uploadAndInsert] wikiLinkEmbed node missing from schema`),Rp(t,a);return}y.insert(v,e.create({target:f,alias:null,anchor:null,resolvedSrc:x}))}else if(g.kind===`wiki-link`){let n=_.schema.nodes.wikiLink;if(!n){console.error(`[uploadAndInsert] wikiLink node missing from schema`),Rp(t,a);return}let r=de(e.name.replace(/\.(md|mdx)$/i,``));r?y.insert(v,n.create(r)):y.insert(v,_.schema.text(e.name))}else{let t=_.schema.marks.link;if(t){let n=_.schema.text(e.name,[t.create({href:b})]);y.insert(v,n)}else y.insert(v,_.schema.text(e.name))}t.view.dispatch(y)}function Rp(e,t,n){e.view.dispatch(e.state.tr.setMeta(Dp,{type:`remove`,id:t})),ri.error(n??Y._({id:`b3Thhd`}))}var zp=/\[([^\]]+)\]\(([^)\s]+)\)$/,Bp=`link`;function Vp(e,t,n,r,i){if(e.isDestroyed||e.composing)return;let{state:a}=e,o=a.schema.marks[Bp];if(!o)return;let s=t+n.length;if(t<0||s>a.doc.content.size||a.doc.textBetween(t,s)!==n||a.doc.rangeHasMark(t,s,o))return;let c=a.schema.text(r,[o.create({href:i})]);try{hp(e,a.tr.replaceRangeWith(t,s,c))}catch(e){console.warn(`[inline-link-rule] collapse dispatch failed`,{from:t,text:r,href:i},e)}}var Hp=yr.create({name:`inlineLinkInputRule`,addInputRules(){let e=this.editor;return[new en({find:zp,handler:({state:t,range:n,match:r})=>{let i=r[1],a=r[2];if(!i||!a||!gr(a))return null;let o=t.schema.marks[Bp];if(!o||t.doc.rangeHasMark(n.from,n.to,o))return null;let s=n.from,c=r[0],l=e.view;return queueMicrotask(()=>Vp(l,s,c,i,a)),null}})]}}),Up=`mathInline`,Wp=/\$\$([^$\n]+)\$\$$/,Gp=/(?<![\w$])\$([^\s$\n](?:[^$\n]*[^\s$\n])?)\$$/;function Kp(e,t,n){let r=t.exec(e);if(!r)return null;let i=r[1];return i?{formula:i,delimiter:n,literalLength:r[0].length}:null}function qp(e,t,n){if(e.isDestroyed||e.composing)return;let{state:r}=e,i=r.schema.nodes[Up];if(!i)return;let a=t+n.literalLength;if(t<0||a>r.doc.content.size)return;let o=`${n.delimiter}${n.formula}${n.delimiter}`;if(r.doc.textBetween(t,a)!==o)return;let s=!1;if(r.doc.nodesBetween(t,a,e=>(e.isInline&&!e.isText&&(s=!0),!s)),s)return;let c=i.create({formula:n.formula,sourceDelimiter:n.delimiter});try{hp(e,r.tr.replaceRangeWith(t,a,c))}catch(e){console.warn(`[math-input-rule] collapse dispatch failed`,{from:t,formula:n.formula,delimiter:n.delimiter},e)}}function Jp(e,t,n){return new en({find:t,handler:({state:r,range:i,match:a})=>{let o=Kp(a[0],t,n);if(!o||!r.schema.nodes[Up])return null;let s=i.from,c=e.view;return queueMicrotask(()=>qp(c,s,o)),null}})}var Yp=yr.create({name:`mathInputRule`,addInputRules(){return[Jp(this.editor,Wp,`$$`),Jp(this.editor,Gp,`$`)]}}),Xp=new Set;function Zp(e){Xp.add(e)}function Qp(e){return Xp.delete(e)}var $p=new dr(`markIdentity`);function em(){return{byId:new Map,counter:0}}function tm(e,t,n,r,i){let a=[];for(let e of t.byId.values()){let t=i?i.map(e.from,-1):e.from,n=i?i.map(e.to,1):e.to;n<=t||a.push({id:e.id,markType:e.markType,attrs:e.attrs,from:t,to:n})}let o=new Map,s=new Set,c=t.counter;return e.descendants((e,t)=>{if(!(!e.isInline||e.marks.length===0))for(let i of e.marks){if(!n.has(i.type.name)||r&&!r(i))continue;let l=null;for(let e of a)if(!s.has(e.id)&&e.markType===i.type.name&&nm(e.attrs,i.attrs)&&!(t<e.from||t>=e.to)){l=e.id;break}let u=l??`m${++c}`;s.add(u);let d=t,f=t+e.nodeSize,p=o.get(u);p?p.to=Math.max(p.to,f):o.set(u,{id:u,markType:i.type.name,attrs:i.attrs,from:d,to:f})}}),{byId:o,counter:c}}function nm(e,t){let n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(let r of n){let n=e[r],i=t[r];if(n!==i&&(typeof n!=`object`||!n||typeof i!=`object`||!i||!((Array.isArray(n)&&Array.isArray(i)||!Array.isArray(n)&&!Array.isArray(i)&&Object.getPrototypeOf(n)===Object.prototype&&Object.getPrototypeOf(i)===Object.prototype)&&nm(n,i))))return!1}return!0}function rm(e,t,n,r){let i=new Set(t.byId.keys());for(let[r,i]of t.byId)e.has(r)||n?.(i);for(let t of e)i.has(t)||r?.(t);return i}function im(e,t,n){let r=$p.getState(e);if(!r)return null;for(let e of r.byId.values())if(e.markType===n&&e.from<=t&&t<e.to)return e.id;return null}function am(e){let{markTypes:t,predicate:n,onRegister:r,onDeregister:i}=e,a=new Set(t);return new kn({key:$p,state:{init(e,t){return tm(t.doc,em(),a,n)},apply(e,t,r,i){return e.docChanged?tm(i.doc,t,a,n,e.mapping):t}},view(){let e=new Set;return{update(t){let n=$p.getState(t.state);n&&(e=rm(e,n,r,i))},destroy(){for(let t of e)i?.(t);e=new Set}}}})}var om=300,sm=150,cm=500,lm=class{registry=new Map;_activeNodeId=null;listeners=new Set;_snapshot={activeNodeId:null,active:null};register(e){this.registry.set(e.nodeId,e),this._activeNodeId===e.nodeId&&this.refreshSnapshot()}deregister(e){this.registry.delete(e)&&this._activeNodeId===e&&(this._activeNodeId=null,this.refreshSnapshot())}setActiveNode(e){this._activeNodeId!==e&&(e!==null&&!this.registry.has(e)||(this._activeNodeId=e,this.refreshSnapshot()))}getActiveNode(){return this._activeNodeId}getRegistration(e){return this.registry.get(e)}hasRegistration(e){return this.registry.has(e)}clear(){this.registry.clear(),this._activeNodeId=null,this.refreshSnapshot()}getSnapshot=()=>this._snapshot;subscribe=e=>(this.listeners.add(e),()=>{this.listeners.delete(e)});refreshSnapshot(){let e=this._activeNodeId==null?null:this.registry.get(this._activeNodeId)??null;this._snapshot={activeNodeId:this._activeNodeId,active:e};for(let e of this.listeners)e()}};function um(e,t){let n=e??null;for(;n&&typeof n==`object`;){let e=n.getAttribute;if(typeof e==`function`){let r=e.call(n,`data-mark-id`);if(r&&t.hasRegistration(r))return r;let i=e.call(n,`data-node-id`);if(i&&t.hasRegistration(i))return i}n=n.parentElement??null}return null}function dm(e){return e?e.closest(`[data-ok-prop-panel]`)!==null:!1}function fm(){return typeof document>`u`?!1:document.querySelector(`[data-ok-layer-spawned]`)!==null}var pm=e=>{let t=(0,Z.c)(18),{store:n}=e,r;t[0]===n?r=t[1]:(r=()=>n.getSnapshot(),t[0]=n,t[1]=r);let[i,a]=(0,Q.useState)(r),o,s;t[2]===n?(o=t[3],s=t[4]):(o=()=>(a(n.getSnapshot()),n.subscribe(()=>{a(n.getSnapshot())})),s=[n],t[2]=n,t[3]=o,t[4]=s),(0,Q.useEffect)(o,s);let{active:c}=i;if(!c)return null;let l;t[5]===n?l=t[6]:(l=()=>n.setActiveNode(null),t[5]=n,t[6]=l);let u,d,f;if(t[7]!==c.controls||t[8]!==c.nodeId||t[9]!==c.type||t[10]!==l){let e={nodeId:c.nodeId,type:c.type,deactivate:l};u=c.controls.propPanel?.(e),d=c.controls.toolbar?.(e),f=c.controls.breadcrumb?.(e),t[7]=c.controls,t[8]=c.nodeId,t[9]=c.type,t[10]=l,t[11]=u,t[12]=d,t[13]=f}else u=t[11],d=t[12],f=t[13];let p;return t[14]!==u||t[15]!==d||t[16]!==f?(p=(0,$.jsxs)($.Fragment,{children:[u,d,f]}),t[14]=u,t[15]=d,t[16]=f,t[17]=p):p=t[17],p};function mm(e){return e.editorView?.dom??null}function hm(e,t){let n=e;for(;n;){if(n.getAttribute?.(`data-mark-id`)===t||n.getAttribute?.(`data-node-id`)===t)return!0;n=n.parentElement}return!1}function gm(e){let{editor:t}=e,n=new lm,r=mm(t),i=!1,a=null,o=null,s=null,c=null,l=null,u=()=>{a!==null&&(clearTimeout(a),a=null),s=null},d=()=>{o!==null&&(clearTimeout(o),o=null)},f=()=>{c!==null&&(clearTimeout(c),c=null)},p=e=>{if(n.getActiveNode()===e){d();return}s===e&&a!==null||(u(),d(),s=e,a=setTimeout(()=>{a=null,s=null,n.setActiveNode(e)},om))},m=()=>{n.getActiveNode()!==null&&o===null&&(o=setTimeout(()=>{o=null,!fm()&&n.setActiveNode(null)},sm))},h=null,g=!1,_=e=>{try{g=!0,e.focus({preventScroll:!0})}catch{}finally{g=!1}},v=n.subscribe(()=>{let e=n.getActiveNode();if(e!==null){if(typeof document<`u`){let t=document.activeElement;h=t&&hm(t,e)?t:null}return}if(typeof document>`u`)return;let i=h;if(h=null,i&&document.contains(i)&&typeof i.focus==`function`){_(i);return}let a=r??mm(t);a&&typeof a.focus==`function`&&_(a)}),y=e=>{let t=e;if(t.button!==2){if(t.metaKey||t.ctrlKey||t.button===1){u(),t.button===1&&t.preventDefault?.();return}if(t.pointerType===`touch`){let t=um(e.target,n);if(t===null)return;f(),c=setTimeout(()=>{c=null,l=t,n.setActiveNode(t)},cm);return}u()}},b=()=>{f()},x=e=>{e.pointerType===`touch`&&c!==null&&f()},S=e=>{let t=e;if(t.button===2||t.type===`click`&&t.button===1)return;let r=um(e.target,n);if(r===null)return;if(l!==null){let e=l===r;if(l=null,e){t.preventDefault?.();return}}let i=t.metaKey||t.ctrlKey||t.button===1,a=n.getRegistration(r);if(a?.handlePrimary&&a.handlePrimary({nodeId:r,type:a.type,newTab:i})){t.preventDefault?.(),i||(u(),d(),n.getActiveNode()===r&&n.setActiveNode(null));return}i||(u(),d(),n.setActiveNode(r))},C=e=>{let t=e;if(t.key===`Escape`){n.getActiveNode()!==null&&(u(),d(),n.setActiveNode(null),t.preventDefault?.());return}if(t.key===`Tab`&&!t.shiftKey&&!t.altKey&&!t.metaKey&&!t.ctrlKey){let r=um(e.target,n);if(r!==null&&n.getActiveNode()===r){let e=document.querySelector(`[data-ok-prop-panel]`);if(e){let n=e.querySelector(`button:not([disabled]), [href], input:not([disabled]), [tabindex]:not([tabindex="-1"])`);if(n){t.preventDefault?.(),n.focus();return}}}return}let r=t.key===`Enter`,i=t.key===` `||t.key===`Spacebar`;if(!r&&!i)return;let a=um(e.target,n);if(a===null||i&&((e.target instanceof Element?e.target:null)?.closest(`[data-mark-id], [data-node-id]`)??null)?.getAttribute(`role`)===`link`)return;let o=n.getRegistration(a);if(t.preventDefault?.(),o?.handlePrimary&&o.handlePrimary({nodeId:a,type:o.type,newTab:!1})){u(),d(),n.getActiveNode()===a&&n.setActiveNode(null);return}n.setActiveNode(a)},w=e=>{let t=e;if(t.pointerType!==`mouse`)return;let r=t.target;if(!(r instanceof Element))return;if(dm(r)){d();return}let i=um(r,n);i!==null&&p(i)},T=e=>{let t=e;if(t.pointerType!==`mouse`)return;let r=t.target,i=t.relatedTarget;if(!(r instanceof Element))return;let a=i instanceof Element?i:null,o=um(r,n);if(o!==null){if(a&&dm(a)){d();return}if(a&&um(a,n)===o)return;s===o&&u(),m();return}if(dm(r)){if(a&&dm(a))return;let e=n.getActiveNode();if(e!==null&&a&&um(a,n)===e)return;m()}},E=e=>{if(g)return;let t=e.target;if(!(t instanceof Element))return;let r=um(t,n);r!==null&&(u(),d(),n.setActiveNode(r))},D=e=>{let t=e;if(n.getActiveNode()===null)return;let r=t.relatedTarget,i=r instanceof Element?r:null;i&&dm(i)||i&&um(i,n)!==null||m()},O=e=>{if(n.getActiveNode()===null)return;let t=e.target;t&&(r?.contains(t)||t instanceof Element&&(t.closest(`[data-ok-interaction-layer]`)||t.closest(`[data-ok-prop-panel]`)||t.closest(`[data-ok-layer-spawned]`))||(u(),d(),n.setActiveNode(null)))},k=()=>{i||(r=mm(t),r&&(r.addEventListener(`pointerdown`,y,!0),r.addEventListener(`pointerup`,b,!0),r.addEventListener(`pointercancel`,b,!0),r.addEventListener(`pointermove`,x,!0),r.addEventListener(`click`,S,!0),r.addEventListener(`auxclick`,S,!0),r.addEventListener(`keydown`,C,!0),typeof document<`u`&&(document.addEventListener(`pointerover`,w,!0),document.addEventListener(`pointerout`,T,!0),document.addEventListener(`focusin`,E,!0),document.addEventListener(`focusout`,D,!0),document.addEventListener(`pointerdown`,O,!0)),i=!0))},A=()=>{i&&=(r?.removeEventListener(`pointerdown`,y,!0),r?.removeEventListener(`pointerup`,b,!0),r?.removeEventListener(`pointercancel`,b,!0),r?.removeEventListener(`pointermove`,x,!0),r?.removeEventListener(`click`,S,!0),r?.removeEventListener(`auxclick`,S,!0),r?.removeEventListener(`keydown`,C,!0),typeof document<`u`&&(document.removeEventListener(`pointerover`,w,!0),document.removeEventListener(`pointerout`,T,!0),document.removeEventListener(`focusin`,E,!0),document.removeEventListener(`focusout`,D,!0),document.removeEventListener(`pointerdown`,O,!0)),!1)};return k(),{register(e){n.register(e),i||k()},deregister(e){n.deregister(e)},setActiveNode(e){n.setActiveNode(e)},getActiveNode(){return n.getActiveNode()},getRegistration(e){return n.getRegistration(e)},destroy(){A(),u(),d(),f(),v(),n.clear()},store:n}}var _m=e=>{let t=(0,Z.c)(2),{store:n}=e,r;return t[0]===n?r=t[1]:(r=(0,$.jsx)(`div`,{"data-ok-interaction-layer":``,className:`contents`,children:(0,$.jsx)(pm,{store:n})}),t[0]=n,t[1]=r),r},vm=new WeakMap;function ym(e){let t=vm.get(e);if(t)return t;let n=gm({editor:e});return vm.set(e,n),e.on(`destroy`,()=>{n.destroy(),vm.delete(e)}),n}var bm={AppWindow:Or,ChevronRight:Mr,CopyPlus:Br,FileText:Pe,Film:ke,GitBranch:kr,Image:J,LayoutPanelTop:po,MessageSquareWarning:xo,PanelTop:wo,Paperclip:Qr,Sigma:Ao,SquarePlay:jo,Volume2:Se,Workflow:Fo,ZoomIn:Me};function xm(e){return e&&Object.hasOwn(bm,e)?bm[e]:qa}var Sm={Info:Yr,Lightbulb:mo,MessageSquareWarning:xo,AlertTriangle:ti,AlertOctagon:So,ClipboardList:Qa,BookOpen:Ka,ListTodo:yo,CircleCheck:Rr,CircleHelp:Xa,CircleX:Za,Zap:Io,Bug:Ja,FlaskConical:so,Quote:To,ChevronRight:Mr},Cm=Object.entries(Sm).sort(([e],[t])=>e.localeCompare(t));function wm(e){if(!e||!e.startsWith(`lucide:`))return null;let t=e.slice(7);return Object.hasOwn(Sm,t)?Sm[t]??null:null}function Tm(e){let t=(0,Z.c)(24),n;t[0]===e.icon?n=t[1]:(n=wm(e.icon),t[0]=e.icon,t[1]=n);let r=n,i=r?`custom`:void 0,a;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,$.jsx)(Mr,{size:14,className:`accordion-chevron`,"aria-hidden":`true`}),t[2]=a):a=t[2];let o;t[3]===r?o=t[4]:(o=r?(0,$.jsx)(r,{size:16,className:`accordion-icon`,"aria-hidden":`true`}):null,t[3]=r,t[4]=o);let s=e.title??`Accordion`,c;t[5]===s?c=t[6]:(c=(0,$.jsx)(`span`,{className:`accordion-title`,children:s}),t[5]=s,t[6]=c);let l;t[7]===e.description?l=t[8]:(l=e.description?(0,$.jsx)(`span`,{className:`accordion-description`,children:e.description}):null,t[7]=e.description,t[8]=l);let u;t[9]!==c||t[10]!==l?(u=(0,$.jsxs)(`span`,{className:`accordion-title-group`,children:[c,l]}),t[9]=c,t[10]=l,t[11]=u):u=t[11];let d;t[12]!==o||t[13]!==u?(d=(0,$.jsxs)(`summary`,{className:`accordion-summary`,contentEditable:!1,children:[a,o,u]}),t[12]=o,t[13]=u,t[14]=d):d=t[14];let f;t[15]===e.children?f=t[16]:(f=(0,$.jsx)(`div`,{className:`accordion-body`,children:e.children}),t[15]=e.children,t[16]=f);let p;return t[17]!==e.defaultOpen||t[18]!==e.id||t[19]!==e.name||t[20]!==i||t[21]!==d||t[22]!==f?(p=(0,$.jsxs)(`details`,{className:`accordion`,"data-accordion-icon":i,open:e.defaultOpen,id:e.id,name:e.name,children:[d,f]}),t[17]=e.defaultOpen,t[18]=e.id,t[19]=e.name,t[20]=i,t[21]=d,t[22]=f,t[23]=p):p=t[23],p}function Em(e){return e!==!1}function Dm(e){let t=(0,Z.c)(12),n;t[0]===e.src?n=t[1]:(n=e.src===void 0?void 0:vn(e.src),t[0]=e.src,t[1]=n);let r=e.title,i;t[2]===e.controls?i=t[3]:(i=Em(e.controls),t[2]=e.controls,t[3]=i);let a;return t[4]!==e.autoplay||t[5]!==e.loop||t[6]!==e.muted||t[7]!==e.preload||t[8]!==e.title||t[9]!==n||t[10]!==i?(a=(0,$.jsx)(`audio`,{className:`ok-audio`,src:n,title:r,controls:i,autoPlay:e.autoplay,loop:e.loop,muted:e.muted,preload:e.preload}),t[4]=e.autoplay,t[5]=e.loop,t[6]=e.muted,t[7]=e.preload,t[8]=e.title,t[9]=n,t[10]=i,t[11]=a):a=t[11],a}var Om={note:Yr,tip:mo,important:xo,warning:ti,caution:So,abstract:Qa,info:Ka,todo:yo,success:Rr,question:Xa,failure:Za,danger:Io,bug:Ja,example:so,quote:To};function km(e,t){return wm(e)??Om[t]}var Am=new Set([`note`,`tip`,`important`,`warning`,`caution`,`abstract`,`info`,`todo`,`success`,`question`,`failure`,`danger`,`bug`,`example`,`quote`]);function jm(e){return typeof e==`string`&&Am.has(e)?e:`note`}function Mm(e){let t=(0,Z.c)(29),n,r;t[0]!==e.icon||t[1]!==e.type?(r=jm(e.type),n=km(e.icon,r),t[0]=e.icon,t[1]=e.type,t[2]=n,t[3]=r):(n=t[2],r=t[3]);let i=n,o;t[4]===e.color?o=t[5]:(o=e.color?{"--callout-type-color":e.color}:{},t[4]=e.color,t[5]=o);let s=o,c;t[6]!==i||t[7]!==e.title?(c=e.title||i?(0,$.jsxs)(`span`,{className:`callout-header`,contentEditable:!1,children:[(0,$.jsx)(i,{size:16,className:`callout-icon`,"aria-hidden":`true`}),e.title?(0,$.jsx)(`span`,{className:`callout-title`,children:e.title}):null]}):null,t[6]=i,t[7]=e.title,t[8]=c):c=t[8];let l=c;if(e.collapsible){let n=e.defaultOpen??!0,i;t[9]===l?i=t[10]:(i=l??(0,$.jsx)(`span`,{className:`callout-title`,children:(0,$.jsx)(a,{id:`URmyfc`})}),t[9]=l,t[10]=i);let o;t[11]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,$.jsx)(jr,{size:16,className:`callout-chevron`,"aria-hidden":`true`}),t[11]=o):o=t[11];let c;t[12]===i?c=t[13]:(c=(0,$.jsxs)(`summary`,{className:`callout-summary`,contentEditable:!1,children:[i,o]}),t[12]=i,t[13]=c);let u;t[14]===e.children?u=t[15]:(u=(0,$.jsx)(`div`,{className:`callout-body`,children:e.children}),t[14]=e.children,t[15]=u);let d;return t[16]!==n||t[17]!==s||t[18]!==c||t[19]!==u||t[20]!==r?(d=(0,$.jsxs)(`details`,{className:`callout callout-collapsible`,"data-callout-type":r,open:n,style:s,children:[c,u]}),t[16]=n,t[17]=s,t[18]=c,t[19]=u,t[20]=r,t[21]=d):d=t[21],d}let u;t[22]===e.children?u=t[23]:(u=(0,$.jsx)(`div`,{className:`callout-body`,children:e.children}),t[22]=e.children,t[23]=u);let d;return t[24]!==l||t[25]!==s||t[26]!==u||t[27]!==r?(d=(0,$.jsxs)(`div`,{className:`callout callout-static`,"data-callout-type":r,style:s,children:[l,u]}),t[24]=l,t[25]=s,t[26]=u,t[27]=r,t[28]=d):d=t[28],d}var Nm=[{key:`tl`,dx:-1,dy:-1,cursor:`nwse-resize`,className:`ok-resize-handle ok-resize-handle--tl`},{key:`t`,dx:0,dy:-1,cursor:`ns-resize`,className:`ok-resize-handle ok-resize-handle--t`},{key:`tr`,dx:1,dy:-1,cursor:`nesw-resize`,className:`ok-resize-handle ok-resize-handle--tr`},{key:`r`,dx:1,dy:0,cursor:`ew-resize`,className:`ok-resize-handle ok-resize-handle--r`},{key:`br`,dx:1,dy:1,cursor:`nwse-resize`,className:`ok-resize-handle ok-resize-handle--br`},{key:`b`,dx:0,dy:1,cursor:`ns-resize`,className:`ok-resize-handle ok-resize-handle--b`},{key:`bl`,dx:-1,dy:1,cursor:`nesw-resize`,className:`ok-resize-handle ok-resize-handle--bl`},{key:`l`,dx:-1,dy:0,cursor:`ew-resize`,className:`ok-resize-handle ok-resize-handle--l`}];function Pm(e){let t=(0,Z.c)(7),{targetRef:n,onResize:r,onResizeEnd:i,bounds:a}=e,{_:s}=o(),c=(0,Q.useRef)(null),l;t[0]!==a?.maxHeight||t[1]!==a?.maxWidth||t[2]!==a?.minHeight||t[3]!==a?.minWidth?(l=function(e,t){let n=t===`w`?a?.minWidth??64:a?.minHeight??64,r=t===`w`?a?.maxWidth??1/0:a?.maxHeight??1/0;return Math.max(n,Math.min(r,e))},t[0]=a?.maxHeight,t[1]=a?.maxWidth,t[2]=a?.minHeight,t[3]=a?.minWidth,t[4]=l):l=t[4];let u=l,d=function(e,t){let a=n.current;if(!a)return;e.preventDefault(),e.stopPropagation();let o=a.getBoundingClientRect();c.current={handle:t,startX:e.clientX,startY:e.clientY,startWidth:o.width,startHeight:o.height,latestWidth:o.width,latestHeight:o.height,hasMoved:!1};let s=e.currentTarget;try{s.setPointerCapture(e.pointerId)}catch{}document.body.style.setProperty(`cursor`,t.cursor),document.body.style.setProperty(`user-select`,`none`);let l=function(e){let t=c.current;if(!t)return;let n=(e.clientX-t.startX)*t.handle.dx,i=(e.clientY-t.startY)*t.handle.dy,a=t.handle.dx===0?t.startWidth:u(t.startWidth+n,`w`),o=t.handle.dy===0?t.startHeight:u(t.startHeight+i,`h`);t.latestWidth=a,t.latestHeight=o,t.hasMoved=!0,r({width:a,height:o})};function d(){let e=c.current;if(!e)return;let t={width:e.latestWidth,height:e.latestHeight},n=e.hasMoved;c.current=null,document.body.style.removeProperty(`cursor`),document.body.style.removeProperty(`user-select`),window.removeEventListener(`pointermove`,l),window.removeEventListener(`pointerup`,d),window.removeEventListener(`pointercancel`,d),n&&i?.(t)}window.addEventListener(`pointermove`,l),window.addEventListener(`pointerup`,d),window.addEventListener(`pointercancel`,d)},f=Nm.map(e=>{let t=e.key;return(0,$.jsx)(`button`,{type:`button`,className:y(e.className),"aria-label":s({id:`NxW-md`,values:{handleKey:t}}),tabIndex:-1,style:{cursor:e.cursor},onPointerDown:t=>d(t,e)},t)}),p;return t[5]===f?p=t[6]:(p=(0,$.jsx)(`div`,{className:`ok-resize-overlay`,contentEditable:!1,"aria-hidden":`true`,children:f}),t[5]=f,t[6]=p),p}var Fm=`26rem`,Im=`Embedded content`,Lm=/^https?:\/\//i;function Rm(e){try{return new URL(e).origin!==window.location.origin}catch{return!1}}function zm(e){return!(typeof e!=`string`||!Lm.test(e)||!Rm(e))}function Bm(e){let t=(0,Z.c)(24),{src:n,title:r,width:i,height:a}=e,o=(0,Q.useRef)(null),s=H(),c=i||void 0,l=a||Fm,u;t[0]!==c||t[1]!==l?(u={width:c,height:l},t[0]=c,t[1]=l,t[2]=u):u=t[2];let d=u,f,p;if(t[3]!==a||t[4]!==i?(f=()=>{let e=o.current;e&&(e.style.width=i||``,e.style.height=a||Fm)},p=[i,a],t[3]=a,t[4]=i,t[5]=f,t[6]=p):(f=t[5],p=t[6]),(0,Q.useEffect)(f,p),!zm(n)){let e=`Embed a URL`;typeof n==`string`&&n.length>0&&(e=Lm.test(n)?`Embed only supports cross-origin URLs`:`URL must start with http:// or https://`);let r;return t[7]===e?r=t[8]:(r=(0,$.jsx)(`div`,{className:`ok-embed ok-embed--placeholder`,contentEditable:!1,children:(0,$.jsx)(`span`,{children:e})}),t[7]=e,t[8]=r),r}let m;t[9]===s?m=t[10]:(m=e=>{if(!s)return;let{editor:t,getPos:n}=s,r=n();if(typeof r==`number`)try{let n=t.state.doc.nodeAt(r);if(!n||n.type.name!==`jsxComponent`)return;let i={...n.attrs.props??{},width:`${Math.round(e.width)}px`,height:`${Math.round(e.height)}px`};t.view.dispatch(t.state.tr.setNodeMarkup(r,null,{...n.attrs,props:i,sourceDirty:!0}))}catch(e){let t=e;if(t instanceof RangeError)return;throw t}},t[9]=s,t[10]=m);let h=m,g;t[11]===n?g=t[12]:(g=ir(n),t[11]=n,t[12]=g);let _=g,v=_===n?`no-referrer`:`strict-origin-when-cross-origin`,y=r||Im,b;t[13]!==_||t[14]!==v||t[15]!==y?(b=(0,$.jsx)(`iframe`,{title:y,src:_,sandbox:`allow-scripts allow-same-origin allow-forms allow-popups allow-popups-to-escape-sandbox allow-presentation`,referrerPolicy:v,loading:`lazy`,className:`ok-embed-frame`}),t[13]=_,t[14]=v,t[15]=y,t[16]=b):b=t[16];let x;t[17]!==s||t[18]!==h?(x=s?(0,$.jsx)(Pm,{targetRef:o,bounds:{minWidth:192,maxWidth:2e3,minHeight:128,maxHeight:Math.round(window.innerHeight*.9)},onResize:e=>{let t=o.current;t&&(t.style.width=`${e.width}px`,t.style.height=`${e.height}px`)},onResizeEnd:h}):null,t[17]=s,t[18]=h,t[19]=x):x=t[19];let S;return t[20]!==d||t[21]!==x||t[22]!==b?(S=(0,$.jsxs)(`div`,{className:`ok-embed`,style:d,ref:o,contentEditable:!1,children:[b,x]}),t[20]=d,t[21]=x,t[22]=b,t[23]=S):S=t[23],S}function Vm(e){if(!e)return``;let t,n=null;try{let r=new URL(e,`https://placeholder.local`);n=r.protocol,t=r.pathname}catch{t=e.split(`?`)[0]??e}if(n===`data:`||n===`blob:`)return``;let r=t.split(`/`),i=r[r.length-1]??``;try{return decodeURIComponent(i)}catch{return i}}function Hm(e){let t=(0,Z.c)(18),n;t[0]!==e.name||t[1]!==e.src?(n=e.name?.trim()||Vm(e.src)||`Untitled file`,t[0]=e.name,t[1]=e.src,t[2]=n):n=t[2];let r=n,i=e.size?.trim()?e.size:null,a;t[3]===e.src?a=t[4]:(a=e.src?vn(e.src):void 0,t[3]=e.src,t[4]=a);let o=a,s;t[5]===o?s=t[6]:(s=e=>{e.stopPropagation(),e.preventDefault(),o&&window.open(o,`_blank`,`noopener,noreferrer`)},t[5]=o,t[6]=s);let c=s,l;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,$.jsx)(ao,{className:`ok-file-icon`,"aria-hidden":`true`}),t[7]=l):l=t[7];let u;t[8]===r?u=t[9]:(u=(0,$.jsx)(`span`,{className:`ok-file-name`,children:r}),t[8]=r,t[9]=u);let d;t[10]===i?d=t[11]:(d=i?(0,$.jsx)(`span`,{className:`ok-file-size`,children:i}):null,t[10]=i,t[11]=d);let f;return t[12]!==c||t[13]!==o||t[14]!==e.title||t[15]!==u||t[16]!==d?(f=(0,$.jsxs)(`a`,{href:o,title:e.title,className:`ok-file-attachment`,target:`_blank`,rel:`noopener noreferrer`,onMouseDown:Um,onClick:c,children:[l,u,d]}),t[12]=c,t[13]=o,t[14]=e.title,t[15]=u,t[16]=d,t[17]=f):f=t[17],f}function Um(e){return e.stopPropagation()}function Wm(){return Q.createElement(`svg`,{"aria-hidden":`true`,"data-rmiz-btn-unzoom-icon":!0,fill:`currentColor`,focusable:`false`,viewBox:`0 0 16 16`,xmlns:`http://www.w3.org/2000/svg`},Q.createElement(`path`,{d:`M 14.144531 1.148438 L 9 6.292969 L 9 3 L 8 3 L 8 8 L 13 8 L 13 7 L 9.707031 7 L 14.855469 1.851563 Z M 8 8 L 3 8 L 3 9 L 6.292969 9 L 1.148438 14.144531 L 1.851563 14.855469 L 7 9.707031 L 7 13 L 8 13 Z`}))}function Gm(){return Q.createElement(`svg`,{"aria-hidden":`true`,"data-rmiz-btn-zoom-icon":!0,fill:`currentColor`,focusable:`false`,viewBox:`0 0 16 16`,xmlns:`http://www.w3.org/2000/svg`},Q.createElement(`path`,{d:`M 9 1 L 9 2 L 12.292969 2 L 2 12.292969 L 2 9 L 1 9 L 1 14 L 6 14 L 6 13 L 2.707031 13 L 13 2.707031 L 13 6 L 14 6 L 14 1 Z`}))}function Km(e){return typeof Element>`u`?!1:e instanceof Element}var qm=(e,t)=>Km(t)&&t.tagName.toUpperCase()===e,Jm=e=>qm(`DIV`,e)||qm(`SPAN`,e),Ym=e=>qm(`IMG`,e),Xm=e=>e.complete&&e.naturalHeight!==0,Zm=e=>qm(`SVG`,e),Qm=({height:e,offset:t,width:n})=>Math.min((window.innerWidth-t*2)/n,(window.innerHeight-t*2)/e),$m=({containerHeight:e,containerWidth:t,offset:n,targetHeight:r,targetWidth:i})=>{let a=Qm({height:r,offset:n,width:i}),o=i>r?i/t:r/e;return a>1?o:a*o},eh=({containerHeight:e,containerWidth:t,hasScalableSrc:n,offset:r,targetHeight:i,targetWidth:a})=>e===0||t===0?1:!n&&i!==0&&a!==0?$m({containerHeight:e,containerWidth:t,offset:r,targetHeight:i,targetWidth:a}):Qm({height:e,offset:r,width:t}),th=/url(?:\(['"]?)(?<url>.*?)(?:['"]?\))/,nh=e=>{if(e!==null){if(Ym(e))return e.currentSrc===``?void 0:e.currentSrc;if(Jm(e)){let{backgroundImage:t}=window.getComputedStyle(e);if(t!==``)return th.exec(t)?.[1]}}},rh=e=>{if(e!==null)return Ym(e)?e.alt:e.getAttribute(`aria-label`)??void 0},ih=({containerHeight:e,containerLeft:t,containerTop:n,containerWidth:r,hasScalableSrc:i,offset:a,targetHeight:o,targetWidth:s})=>{let c=eh({containerHeight:e,containerWidth:r,hasScalableSrc:i,offset:a,targetHeight:o,targetWidth:s});return{top:n,left:t,width:r*c,height:e*c,transform:`translate(0,0) scale(${1/c})`}},ah=({position:e,relativeNum:t})=>{let n=parseFloat(e);return e.endsWith(`%`)?t*n/100:n},oh=({containerHeight:e,containerLeft:t,containerTop:n,containerWidth:r,hasScalableSrc:i,objectFit:a,objectPosition:o,offset:s,targetHeight:c,targetWidth:l})=>{let u=a;if(u===`scale-down`&&(u=l<=r&&c<=e?`none`:`contain`),u===`cover`||u===`contain`){let a=r/l,d=e/c,f=u===`cover`?Math.max(a,d):Math.min(a,d),[p=`50%`,m=`50%`]=o.split(` `),h=ah({position:p,relativeNum:r-l*f}),g=ah({position:m,relativeNum:e-c*f}),_=eh({containerHeight:c*f,containerWidth:l*f,hasScalableSrc:i,offset:s,targetHeight:c,targetWidth:l});return{top:n+g,left:t+h,width:l*f*_,height:c*f*_,transform:`translate(0,0) scale(${1/_})`}}else if(u===`none`){let[a=`50%`,u=`50%`]=o.split(` `),d=ah({position:a,relativeNum:r-l}),f=ah({position:u,relativeNum:e-c}),p=eh({containerHeight:c,containerWidth:l,hasScalableSrc:i,offset:s,targetHeight:c,targetWidth:l});return{top:n+f,left:t+d,width:l*p,height:c*p,transform:`translate(0,0) scale(${1/p})`}}else if(u===`fill`){let t=r/l,n=e/c,a=Math.max(t,n),o=eh({containerHeight:c*a,containerWidth:l*a,hasScalableSrc:i,offset:s,targetHeight:c,targetWidth:l});return{width:r*o,height:e*o,transform:`translate(0,0) scale(${1/o})`}}else return{}},sh=({backgroundPosition:e,backgroundSize:t,containerHeight:n,containerLeft:r,containerTop:i,containerWidth:a,hasScalableSrc:o,offset:s,targetHeight:c,targetWidth:l})=>{if(t===`cover`||t===`contain`){let u=a/l,d=n/c,f=t===`cover`?Math.max(u,d):Math.min(u,d),[p=`50%`,m=`50%`]=e.split(` `),h=ah({position:p,relativeNum:a-l*f}),g=ah({position:m,relativeNum:n-c*f}),_=eh({containerHeight:c*f,containerWidth:l*f,hasScalableSrc:o,offset:s,targetHeight:c,targetWidth:l});return{top:i+g,left:r+h,width:l*f*_,height:c*f*_,transform:`translate(0,0) scale(${1/_})`}}else if(t===`auto`){let[t=`50%`,u=`50%`]=e.split(` `),d=ah({position:t,relativeNum:a-l}),f=ah({position:u,relativeNum:n-c}),p=eh({containerHeight:c,containerWidth:l,hasScalableSrc:o,offset:s,targetHeight:c,targetWidth:l});return{top:i+f,left:r+d,width:l*p,height:c*p,transform:`translate(0,0) scale(${1/p})`}}else{let[u=`50%`,d=`50%`]=t.split(` `),f=ah({position:u,relativeNum:a}),p=ah({position:d,relativeNum:n}),m=f/l,h=p/c,g=Math.min(m,h),[_=`50%`,v=`50%`]=e.split(` `),y=ah({position:_,relativeNum:a-l*g}),b=ah({position:v,relativeNum:n-c*g}),x=eh({containerHeight:c*g,containerWidth:l*g,hasScalableSrc:o,offset:s,targetHeight:c,targetWidth:l});return{top:i+b,left:r+y,width:l*g*x,height:c*g*x,transform:`translate(0,0) scale(${1/x})`}}},ch=/\.svg$/i,lh=({hasZoomImg:e,imgSrc:t,isSvg:n,isZoomed:r,loadedImgEl:i,offset:a,shouldRefresh:o,targetEl:s})=>{let c=n||t?.slice(0,18)===`data:image/svg+xml`||e||t!==void 0&&ch.test(t),l=s.getBoundingClientRect(),u=window.getComputedStyle(s),d=i!=null&&Jm(s),f=i!=null&&!d,p=i!=null&&i.naturalHeight!==0?i.naturalHeight:l.height,m=i!=null&&i.naturalWidth!==0?i.naturalWidth:l.width,h=ih({containerHeight:l.height,containerLeft:l.left,containerTop:l.top,containerWidth:l.width,hasScalableSrc:c,offset:a,targetHeight:p,targetWidth:m}),g=f?oh({containerHeight:l.height,containerLeft:l.left,containerTop:l.top,containerWidth:l.width,hasScalableSrc:c,objectFit:u.objectFit,objectPosition:u.objectPosition,offset:a,targetHeight:p,targetWidth:m}):void 0,_=d?sh({backgroundPosition:u.backgroundPosition,backgroundSize:u.backgroundSize,containerHeight:l.height,containerLeft:l.left,containerTop:l.top,containerWidth:l.width,hasScalableSrc:c,offset:a,targetHeight:p,targetWidth:m}):void 0,v={...h,...g,..._};if(r){let e=window.innerWidth/2,t=window.innerHeight/2,n=parseFloat(String(v.left??0))+parseFloat(String(v.width??0))/2,r=parseFloat(String(v.top??0))+parseFloat(String(v.height??0))/2,i=e-n,a=t-r;o&&(v.transitionDuration=`0.01ms`),v.transform=`translate(${i}px,${a}px) scale(1)`}return v},uh=e=>{if(e==null)return{};if(Zm(e)){let{parentElement:t}=e,n=e.getBoundingClientRect();if(t==null)return{height:n.height,left:n.left,width:n.width,top:n.top};{let e=t.getBoundingClientRect();return{height:n.height,left:e.left-n.left,top:e.top-n.top,width:n.width}}}else return{height:e.offsetHeight,left:e.offsetLeft,width:e.offsetWidth,top:e.offsetTop}},dh=e=>{let t=`-zoom`,n=[`clip-path`,`fill`,`mask`,`marker-start`,`marker-mid`,`marker-end`],r=new Map;if(e.hasAttribute(`id`)){let{id:n}=e,i=n+t;r.set(n,i);let a=e;a.id=i}e.querySelectorAll(`[id]`).forEach(e=>{let{id:n}=e,i=n+t;r.set(n,i);let a=e;a.id=i}),r.forEach((t,r)=>{let i=`url(#${r})`,a=`url(#${t})`,o=n.map(e=>`[${e}="${i}"]`).join(`, `);e.querySelectorAll(o).forEach(e=>{n.forEach(t=>{e.getAttribute(t)===i&&e.setAttribute(t,a)})})}),e.querySelectorAll(`style`).forEach(e=>{r.forEach((t,n)=>{let{textContent:r}=e;if(r!==``){let i=e;i.textContent=r.replaceAll(`#${n}`,`#${t}`)}})})},fh=[`img`,`svg`,`[role="img"]`,`[data-zoom]`].map(e=>`${e}:not([aria-hidden="true"])`).join(`,`),ph={overflow:``,width:``};function mh(){let e=document.querySelector(`[data-rmiz-portal]`);if(e!=null)return e;let t=document.createElement(`div`);return t.setAttribute(`data-rmiz-portal`,``),document.body.appendChild(t),t}function hh(e){e.preventDefault()}function gh(e){return Q.createElement(_h,{...e})}var _h=class extends Q.Component{constructor(){super(...arguments),this.state={id:``,isZoomImgLoaded:!1,loadedImgEl:void 0,modalState:`UNLOADED`,shouldRefresh:!1,styleGhost:{}},this.refContent=Q.createRef(),this.refDialog=Q.createRef(),this.refModalContent=Q.createRef(),this.refModalImg=Q.createRef(),this.refWrap=Q.createRef(),this.imgEl=null,this.isScaling=!1,this.prevBodyAttrs=ph,this.styleModalImg={},this.handleModalStateChange=e=>{let{state:{modalState:t}}=this;e!==`LOADING`&&t===`LOADING`?(this.loadZoomImg(),window.addEventListener(`resize`,this.handleResize,{passive:!0}),window.addEventListener(`touchstart`,this.handleTouchStart,{passive:!0}),window.addEventListener(`touchmove`,this.handleTouchMove,{passive:!0}),window.addEventListener(`touchend`,this.handleTouchEnd,{passive:!0}),window.addEventListener(`touchcancel`,this.handleTouchCancel,{passive:!0}),document.addEventListener(`keydown`,this.handleKeyDown,!0)):e!==`LOADED`&&t===`LOADED`?window.addEventListener(`wheel`,this.handleWheel,{passive:!0}):e!==`UNLOADING`&&t===`UNLOADING`?(this.ensureImgTransitionEnd(),window.removeEventListener(`wheel`,this.handleWheel),window.removeEventListener(`touchstart`,this.handleTouchStart),window.removeEventListener(`touchmove`,this.handleTouchMove),window.removeEventListener(`touchend`,this.handleTouchEnd),window.removeEventListener(`touchcancel`,this.handleTouchCancel),document.removeEventListener(`keydown`,this.handleKeyDown,!0)):e!==`UNLOADED`&&t===`UNLOADED`&&(this.bodyScrollEnable(),window.removeEventListener(`resize`,this.handleResize),this.refModalImg.current?.removeEventListener(`transitionend`,this.handleImgTransitionEnd),this.refDialog.current?.close())},this.setId=()=>{let e=()=>Math.random().toString(16).slice(-4);this.setState({id:e()+e()+e()})},this.setAndTrackImg=()=>{let{refContent:{current:e}}=this;e!=null&&(this.imgEl=e.querySelector(fh),this.imgEl===null?this.contentNotFoundChangeObserver??(this.contentNotFoundChangeObserver=new MutationObserver(this.setAndTrackImg),this.contentNotFoundChangeObserver.observe(e,{childList:!0,subtree:!0})):(this.contentNotFoundChangeObserver?.disconnect(),this.imgEl.addEventListener(`load`,this.handleImgLoad),this.imgEl.addEventListener(`click`,this.handleZoom),this.state.loadedImgEl??this.handleImgLoad(),this.imgElResizeObserver=new ResizeObserver(e=>{let[t]=e;t?.target!==void 0&&(this.imgEl=t.target,this.setState({styleGhost:uh(this.imgEl)}))}),this.imgElResizeObserver.observe(this.imgEl),this.contentChangeObserver??(this.contentChangeObserver=new MutationObserver(()=>{this.setState({styleGhost:uh(this.imgEl)})}),this.contentChangeObserver.observe(e,{attributes:!0,childList:!0,subtree:!0}))))},this.handleIfZoomChanged=e=>{let{props:{isZoomed:t}}=this;!e&&t?this.zoom():e&&!t&&this.unzoom()},this.handleImgLoad=()=>{let e=nh(this.imgEl);if(e==null||e===``)return;let t=new Image,{imgEl:n}=this;if(Ym(n)){let{sizes:e,srcset:r,crossOrigin:i}=n;t.sizes=e,t.srcset=r,t.crossOrigin=i}t.src=e;let r=()=>{this.setState({loadedImgEl:t,styleGhost:uh(this.imgEl)})};t.decode().then(r).catch(()=>{if(Xm(t)){r();return}t.onload=r})},this.handleZoom=e=>{this.props.isDisabled!==!0&&this.hasImage()&&this.props.onZoomChange?.(!0,{event:e})},this.handleUnzoom=e=>{this.props.isDisabled!==!0&&this.props.onZoomChange?.(!1,{event:e})},this.handleBtnUnzoomClick=e=>{e.preventDefault(),e.stopPropagation(),this.handleUnzoom(e)},this.handleDialogClick=e=>{(e.target===this.refModalContent.current||e.target===this.refModalImg.current)&&(e.stopPropagation(),this.handleUnzoom(e))},this.handleDialogClose=e=>{e.stopPropagation(),this.handleUnzoom(e)},this.handleKeyDown=e=>{e.key===`Escape`&&(e.preventDefault(),e.stopPropagation(),this.handleUnzoom(e))},this.handleWheel=e=>{e.ctrlKey||(e.stopPropagation(),queueMicrotask(()=>{this.handleUnzoom(e)}))},this.handleTouchStart=e=>{if(e.touches.length>1){this.isScaling=!0;return}let{changedTouches:t}=e,[n]=t;if(t.length===1&&n!==void 0){let{screenY:e}=n;this.touchYStart=e}},this.handleTouchMove=e=>{let t=window.visualViewport?.scale??1,{changedTouches:n}=e,[r]=n;if(this.props.canSwipeToUnzoom&&!this.isScaling&&t<=1&&this.touchYStart!=null&&r!==void 0){let{screenY:t}=r;this.touchYEnd=t;let n=Math.max(this.touchYStart,this.touchYEnd),i=Math.min(this.touchYStart,this.touchYEnd);Math.abs(n-i)>this.props.swipeToUnzoomThreshold&&(this.touchYStart=void 0,this.touchYEnd=void 0,this.handleUnzoom(e))}},this.handleTouchEnd=()=>{this.isScaling=!1,this.touchYStart=void 0,this.touchYEnd=void 0},this.handleTouchCancel=()=>{this.isScaling=!1,this.touchYStart=void 0,this.touchYEnd=void 0},this.handleResize=()=>{this.setState({shouldRefresh:!0})},this.hasImage=()=>this.imgEl!==null&&(this.state.loadedImgEl!==void 0||Zm(this.imgEl))&&window.getComputedStyle(this.imgEl).display!==`none`,this.zoom=()=>{this.bodyScrollDisable(),this.refDialog.current?.showModal(),this.refModalImg.current?.addEventListener(`transitionend`,this.handleImgTransitionEnd),this.setState({modalState:`LOADING`})},this.unzoom=()=>{this.setState({modalState:`UNLOADING`})},this.handleImgTransitionEnd=()=>{clearTimeout(this.timeoutTransitionEnd),this.state.modalState===`LOADING`?this.setState({modalState:`LOADED`}):this.state.modalState===`UNLOADING`&&this.setState({shouldRefresh:!1,modalState:`UNLOADED`})},this.ensureImgTransitionEnd=()=>{if(this.refModalImg.current!==null){let{transitionDuration:e}=window.getComputedStyle(this.refModalImg.current),t=parseFloat(e);if(t!==0&&!Number.isNaN(t)){let n=t*(e.endsWith(`ms`)?1:1e3)+50;this.timeoutTransitionEnd=setTimeout(this.handleImgTransitionEnd,n)}}},this.bodyScrollDisable=()=>{this.prevBodyAttrs={overflow:document.body.style.overflow,width:document.body.style.width};let{body:{clientWidth:e}}=document;document.body.style.overflow=`hidden`,document.body.style.width=`${e}px`},this.bodyScrollEnable=()=>{let{prevBodyAttrs:{overflow:e,width:t}}=this;document.body.style.width=t,document.body.style.overflow=e,this.prevBodyAttrs=ph},this.loadZoomImg=()=>{let{props:{zoomImg:e}}=this;if(e==null)return;let{src:t}=e;if(t!==void 0&&t!==``){let n=new Image;n.sizes=e.sizes??``,n.srcset=e.srcSet??``,n.crossOrigin=e.crossOrigin??void 0,n.src=t;let r=()=>{this.setState({isZoomImgLoaded:!0})};n.decode().then(r).catch(()=>{if(Xm(n)){r();return}n.onload=r})}},this.UNSAFE_handleSvg=()=>{let{imgEl:e,refModalImg:t,styleModalImg:n}=this;if(Zm(e)){let r=e.cloneNode(!0);dh(r),r.style.width=`${n.width??0}px`,r.style.height=`${n.height??0}px`,r.addEventListener(`click`,this.handleUnzoom),t.current?.firstChild?.remove(),t.current?.appendChild(r)}}}render(){let{handleBtnUnzoomClick:e,handleDialogClick:t,handleDialogClose:n,handleUnzoom:r,handleZoom:i,imgEl:a,props:{a11yNameButtonUnzoom:o,a11yNameButtonZoom:s,children:c,classDialog:l,IconUnzoom:u,IconZoom:d,isZoomed:f,wrapElement:p,ZoomContent:m,zoomImg:h,zoomMargin:g},refContent:_,refDialog:v,refModalContent:y,refModalImg:b,refWrap:x,state:{id:S,isZoomImgLoaded:C,loadedImgEl:w,modalState:T,shouldRefresh:E,styleGhost:D}}=this,O=`rmiz-modal-${S}`,k=`rmiz-modal-img-${S}`,A=Jm(a),j=Ym(a),M=Zm(a),N=rh(a),P=nh(a),F=j?a.sizes:void 0,I=j?a.srcset:void 0,L=j?a.crossOrigin:void 0,ee=h?.src!==void 0&&h.src!==``,R=this.hasImage(),te=N!==void 0&&N!==``?`${s}: ${N}`:s,z=T===`LOADING`||T===`LOADED`,ne=R?`found`:`not-found`,re=T===`UNLOADED`||T===`UNLOADING`?`hidden`:`visible`,ie={visibility:T===`UNLOADED`?`visible`:`hidden`};this.styleModalImg=R&&a!==null?lh({hasZoomImg:ee,imgSrc:P,isSvg:M,isZoomed:f&&z,loadedImgEl:w,offset:g,shouldRefresh:E,targetEl:a}):{};let ae=null;if(R){let t=j||A?Q.createElement(`img`,{alt:N,crossOrigin:L,sizes:F,src:P,srcSet:I,...C&&T===`LOADED`?h:{},"data-rmiz-modal-img":``,height:this.styleModalImg.height??void 0,id:k,ref:b,style:this.styleModalImg,width:this.styleModalImg.width??void 0}):M?Q.createElement(`div`,{"data-rmiz-modal-img":!0,ref:b,style:this.styleModalImg}):null,n=Q.createElement(`button`,{"aria-label":o,"data-rmiz-btn-unzoom":``,onClick:e,type:`button`},Q.createElement(u,null));ae=m==null?Q.createElement(Q.Fragment,null,t,n):Q.createElement(m,{buttonUnzoom:n,modalState:T,img:t,isZoomImgLoaded:C,onUnzoom:r})}return Q.createElement(p,{"aria-owns":R?O:void 0,"data-rmiz":``,ref:x},Q.createElement(p,{"data-rmiz-content":ne,ref:_,style:ie},c),R&&Q.createElement(p,{"data-rmiz-ghost":``,style:D},Q.createElement(`button`,{"aria-label":te,"data-rmiz-btn-zoom":``,onClick:i,type:`button`},Q.createElement(d,null))),R&&Lo.createPortal(Q.createElement(`dialog`,{"aria-labelledby":k,"aria-modal":`true`,className:l,"data-rmiz-modal":``,id:O,onClick:t,onClose:n,onCancel:hh,ref:v,role:`dialog`},Q.createElement(`div`,{"data-rmiz-modal-overlay":re}),Q.createElement(`div`,{"data-rmiz-modal-content":``,ref:y},ae)),mh()))}componentDidMount(){this.setId(),this.setAndTrackImg(),this.handleImgLoad(),this.UNSAFE_handleSvg()}componentWillUnmount(){this.state.modalState!==`UNLOADED`&&this.bodyScrollEnable(),this.contentChangeObserver?.disconnect(),this.contentNotFoundChangeObserver?.disconnect(),this.imgElResizeObserver?.disconnect(),this.imgEl?.removeEventListener(`load`,this.handleImgLoad),this.imgEl?.removeEventListener(`click`,this.handleZoom),this.refModalImg.current?.removeEventListener(`transitionend`,this.handleImgTransitionEnd),window.removeEventListener(`wheel`,this.handleWheel),window.removeEventListener(`touchstart`,this.handleTouchStart),window.removeEventListener(`touchmove`,this.handleTouchMove),window.removeEventListener(`touchend`,this.handleTouchEnd),window.removeEventListener(`touchcancel`,this.handleTouchCancel),window.removeEventListener(`resize`,this.handleResize),document.removeEventListener(`keydown`,this.handleKeyDown,!0)}componentDidUpdate(e,t){this.handleModalStateChange(t.modalState),this.UNSAFE_handleSvg(),this.handleIfZoomChanged(e.isZoomed)}};_h.defaultProps={a11yNameButtonUnzoom:`Minimize image`,a11yNameButtonZoom:`Expand image`,canSwipeToUnzoom:!0,IconUnzoom:Wm,IconZoom:Gm,isDisabled:!1,swipeToUnzoomThreshold:10,wrapElement:`div`,zoomMargin:0};function vh({onZoomChange:e,...t}){let[n,r]=Q.useState(!1),i=Q.useCallback((t,{event:n})=>{r(t),e?.(t,{event:n})},[e]);return Q.createElement(gh,{...t,isZoomed:n,onZoomChange:i})}function yh(e,t){return typeof e==`number`&&typeof t==`number`&&e>0&&t>0}function bh(e,t,n){return yh(e,t)?{...n,width:`${e}px`,aspectRatio:`${e} / ${t}`}:n}function xh(e){let t=(0,Z.c)(52),n,r,i,a,s,c,l,u,d,f,p,m;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4],s=t[5],c=t[6],l=t[7],u=t[8],d=t[9],f=t[10],p=t[11],m=t[12]):({width:m,height:r,loadingTestId:d,slotTestId:f,slotClassName:c,className:n,onLoad:s,onError:a,src:l,style:u,alt:p,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a,t[5]=s,t[6]=c,t[7]=l,t[8]=u,t[9]=d,t[10]=f,t[11]=p,t[12]=m);let h=d===void 0?`image-loading-skeleton`:d,g=f===void 0?`image-slot`:f,_=p===void 0?``:p,{_:v}=o(),b=(0,Q.useRef)(null),[x,S]=(0,Q.useState)(!1),C;t[13]!==r||t[14]!==m?(C=yh(m,r),t[13]=r,t[14]=m,t[15]=C):C=t[15];let w=C,T;t[16]!==r||t[17]!==u||t[18]!==m?(T=bh(m,r,u),t[16]=r,t[17]=u,t[18]=m,t[19]=T):T=t[19];let E=T,D;t[20]===Symbol.for(`react.memo_cache_sentinel`)?(D=()=>{b.current?.complete?S(!0):S(!1)},t[20]=D):D=t[20];let O;t[21]===l?O=t[22]:(O=[l],t[21]=l,t[22]=O),(0,Q.useLayoutEffect)(D,O);let k=!w&&!x&&`aspect-[16/9] w-full max-w-full`,A;t[23]!==c||t[24]!==k?(A=y(`relative inline-block overflow-hidden`,k,c),t[23]=c,t[24]=k,t[25]=A):A=t[25];let j;t[26]!==v||t[27]!==x||t[28]!==h?(j=!x&&(0,$.jsx)(`span`,{"data-testid":h,role:`status`,"aria-busy":`true`,"aria-label":v({id:`N1YYa7`}),className:`absolute inset-0 animate-pulse rounded-md bg-muted motion-reduce:animate-none`}),t[26]=v,t[27]=x,t[28]=h,t[29]=j):j=t[29];let M=x?`opacity-100`:`opacity-0`,N;t[30]!==n||t[31]!==M?(N=y(`block max-w-full transition-opacity motion-reduce:transition-none`,M,n),t[30]=n,t[31]=M,t[32]=N):N=t[32];let P;t[33]===s?P=t[34]:(P=e=>{S(!0),s?.(e)},t[33]=s,t[34]=P);let F;t[35]===a?F=t[36]:(F=e=>{S(!0),a?.(e)},t[35]=a,t[36]=F);let I;t[37]!==_||t[38]!==r||t[39]!==i||t[40]!==l||t[41]!==N||t[42]!==P||t[43]!==F||t[44]!==m?(I=(0,$.jsx)(`img`,{...i,ref:b,src:l,alt:_,width:m,height:r,className:N,onLoad:P,onError:F}),t[37]=_,t[38]=r,t[39]=i,t[40]=l,t[41]=N,t[42]=P,t[43]=F,t[44]=m,t[45]=I):I=t[45];let L;return t[46]!==E||t[47]!==g||t[48]!==j||t[49]!==I||t[50]!==A?(L=(0,$.jsxs)(`span`,{"data-testid":g,className:A,style:E,children:[j,I]}),t[46]=E,t[47]=g,t[48]=j,t[49]=I,t[50]=A,t[51]=L):L=t[51],L}function Sh(e){return e??`lazy`}function Ch(e){if(typeof e!=`string`)return e;let t=Number(e);return Number.isFinite(t)&&t>0?t:e}function wh(e){let t=(0,Z.c)(21),n;t[0]===e.src?n=t[1]:(n=e.src===void 0?void 0:vn(e.src),t[0]=e.src,t[1]=n);let r=e.alt??``,i;t[2]===e.width?i=t[3]:(i=Ch(e.width),t[2]=e.width,t[3]=i);let a;t[4]===e.height?a=t[5]:(a=Ch(e.height),t[4]=e.height,t[5]=a);let o=e.title,s;t[6]===e.loading?s=t[7]:(s=Sh(e.loading),t[6]=e.loading,t[7]=s);let c;return t[8]!==e.crossorigin||t[9]!==e.decoding||t[10]!==e.fetchpriority||t[11]!==e.referrerpolicy||t[12]!==e.sizes||t[13]!==e.srcset||t[14]!==e.title||t[15]!==n||t[16]!==r||t[17]!==i||t[18]!==a||t[19]!==s?(c=(0,$.jsx)(xh,{src:n,alt:r,width:i,height:a,title:o,loading:s,srcSet:e.srcset,sizes:e.sizes,decoding:e.decoding,fetchPriority:e.fetchpriority,crossOrigin:e.crossorigin,referrerPolicy:e.referrerpolicy}),t[8]=e.crossorigin,t[9]=e.decoding,t[10]=e.fetchpriority,t[11]=e.referrerpolicy,t[12]=e.sizes,t[13]=e.srcset,t[14]=e.title,t[15]=n,t[16]=r,t[17]=i,t[18]=a,t[19]=s,t[20]=c):c=t[20],c}function Th(e){let t=(0,Z.c)(3),n;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(n={sizes:void 0},t[0]=n):n=t[0];let r;return t[1]===e?r=t[2]:(r=(0,$.jsx)(vh,{wrapElement:`span`,zoomMargin:20,zoomImg:n,children:(0,$.jsx)(wh,{...e})}),t[1]=e,t[2]=r),r}var Eh=(0,Q.lazy)(async()=>{let{default:e}=await n(async()=>{let{default:e}=await import(`./katex-BlgnTlTx.js`);return{default:e}},[],import.meta.url);function t(t){let n=(0,Z.c)(7),r;n[0]===t.formula?r=n[1]:(r=e.renderToString(t.formula,{displayMode:!0,throwOnError:!1,strict:`ignore`,trust:!1}),n[0]=t.formula,n[1]=r);let i=r,a;n[2]===i?a=n[3]:(a={__html:i},n[2]=i,n[3]=a);let o;return n[4]!==t.id||n[5]!==a?(o=(0,$.jsx)(`div`,{className:`math math-display`,"data-component-type":`math`,id:t.id,dangerouslySetInnerHTML:a}),n[4]=t.id,n[5]=a,n[6]=o):o=n[6],o}return{default:t}});function Dh(e){let t=(0,Z.c)(3),n=e.formula||`\xA0`,r;return t[0]!==e.id||t[1]!==n?(r=(0,$.jsx)(`div`,{className:`math math-placeholder`,"data-component-type":`math`,id:e.id,children:n}),t[0]=e.id,t[1]=n,t[2]=r):r=t[2],r}function Oh(e){let t=(0,Z.c)(6),n=e.formula??``;if(!n){let r;return t[0]!==n||t[1]!==e.id?(r=(0,$.jsx)(Dh,{formula:n,id:e.id}),t[0]=n,t[1]=e.id,t[2]=r):r=t[2],r}let r;return t[3]!==n||t[4]!==e.id?(r=(0,$.jsx)(Q.Suspense,{fallback:(0,$.jsx)(Dh,{formula:n,id:e.id}),children:(0,$.jsx)(Eh,{formula:n,id:e.id})}),t[3]=n,t[4]=e.id,t[5]=r):r=t[5],r}function kh(e,t){if(e.type===`mdxJsxFlowElement`){let n=e;if(n.name===`MirrorSource`){for(let e of n.attributes??[])if(e.type===`mdxJsxAttribute`&&e.name===`id`&&typeof e.value==`string`&&e.value===t)return n}}let n=e.children;if(Array.isArray(n))for(let e of n){let n=kh(e,t);if(n)return n}return null}function Ah(e){return Rt({type:`root`,children:e.children??[]})}var jh=new Map,Mh=30,Nh=150,Ph=1e4;function Fh(e,t){let n=`${e}|${t}`,r=jh.get(n);if(r)return r.refcount+=1,r;let i=new Zi,a=new ra({url:e,name:t,document:i}),o=new Set,s={provider:a,ySource:i.getText(`source`),refcount:1,synced:!1,subscribers:o};return a.on(`synced`,()=>{s.synced=!0;for(let e of o)e.onSynced()}),s.ySource.observe(()=>{for(let e of o)e.onUpdate()}),jh.set(n,s),jh.size>Mh&&console.warn(`[Mirror] provider pool exceeded ${Mh} entries (current=${jh.size}). Many Mirrors pointing at distinct source docs — investigate if this is a runaway pattern.`),s}function Ih(e,t){let n=`${e}|${t}`,r=jh.get(n);if(r&&(--r.refcount,r.refcount<=0)){try{r.provider.destroy()}catch(e){console.warn(`[Mirror] provider.destroy() failed during release`,{src:t,err:e})}jh.delete(n)}}function Lh(e,t){let n=(0,Z.c)(8),{collabUrl:r}=Sa(),i;n[0]===Symbol.for(`react.memo_cache_sentinel`)?(i={kind:`loading`},n[0]=i):i=n[0];let[a,o]=(0,Q.useState)(i),s=(0,Q.useRef)(t),c=(0,Q.useRef)(null),l,u;n[1]!==r||n[2]!==e?(l=()=>{if(!e){o({kind:`empty-props`});return}if(!r){o({kind:`loading`});return}let t=Fh(r,e),n=()=>{let n=s.current;if(!n){o({kind:`empty-props`});return}let r=t.ySource.toString();if(!r){o(t.synced?{kind:`source-removed`}:{kind:`loading`});return}let i;try{i=we().parseToMdast(r)}catch(t){console.warn(`[Mirror] parseToMdast failed`,{src:e,anchor:n,err:t}),o({kind:`source-removed`});return}let a=kh(i,n);if(!a){o({kind:`anchor-not-found`});return}let c;try{c=Ah(a)}catch(t){console.warn(`[Mirror] renderMirrorSubtree failed`,{src:e,anchor:n,err:t}),o({kind:`anchor-not-found`});return}o({kind:`ready`,html:c})},i=null,a={onUpdate:()=>{i&&clearTimeout(i),i=setTimeout(()=>{i=null,n()},Nh)},onSynced:()=>{i&&=(clearTimeout(i),null),n()}};t.subscribers.add(a),c.current=n;let l=setTimeout(()=>{t.synced||o({kind:`source-removed`})},Ph);return n(),()=>{clearTimeout(l),i&&clearTimeout(i),t.subscribers.delete(a),c.current=null,Ih(r,e)}},u=[r,e],n[1]=r,n[2]=e,n[3]=l,n[4]=u):(l=n[3],u=n[4]),(0,Q.useEffect)(l,u);let d,f;return n[5]===t?(d=n[6],f=n[7]):(d=()=>{s.current=t,c.current?.()},f=[t],n[5]=t,n[6]=d,n[7]=f),(0,Q.useEffect)(d,f),a}function Rh(e){let t=(0,Z.c)(8),n=`ok-mirror-state flex items-start gap-2 rounded-md border border-dashed px-3 py-2 text-sm ${e.tone===`error`?`border-destructive/40 text-destructive`:`border-border text-muted-foreground`}`,r;t[0]===e.tone?r=t[1]:(r=e.tone===`error`?(0,$.jsx)(ho,{className:`mt-0.5 size-4 shrink-0`,"aria-hidden":`true`}):(0,$.jsx)(_o,{className:`mt-0.5 size-4 shrink-0`,"aria-hidden":`true`}),t[0]=e.tone,t[1]=r);let i;t[2]===e.children?i=t[3]:(i=(0,$.jsx)(`div`,{className:`min-w-0 flex-1`,children:e.children}),t[2]=e.children,t[3]=i);let a;return t[4]!==n||t[5]!==r||t[6]!==i?(a=(0,$.jsxs)(`div`,{className:n,children:[r,i]}),t[4]=n,t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function zh(e){let t=(0,Z.c)(30),n=e.src??``,r=e.anchor??``,i=Lh(n,r);if(i.kind===`empty-props`){let e;return t[0]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,$.jsx)(Rh,{tone:`placeholder`,children:(0,$.jsx)(a,{id:`3SDfZl`,components:{0:(0,$.jsx)(`span`,{className:`font-medium`}),1:(0,$.jsx)(`code`,{}),2:(0,$.jsx)(`code`,{}),3:(0,$.jsx)(`code`,{})}})}),t[0]=e):e=t[0],e}if(i.kind===`loading`){let e=n&&r?`${n}#${r}`:``,i;t[1]===e?i=t[2]:(i={mirrorRef:e},t[1]=e,t[2]=i);let o;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(o={0:(0,$.jsx)(`code`,{})},t[3]=o):o=t[3];let s;return t[4]===i?s=t[5]:(s=(0,$.jsx)(Rh,{tone:`placeholder`,children:(0,$.jsx)(a,{id:`92rbk2`,values:i,components:o})}),t[4]=i,t[5]=s),s}if(i.kind===`source-removed`){let e;t[6]===n?e=t[7]:(e={src:n},t[6]=n,t[7]=e);let r;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(r={0:(0,$.jsx)(`span`,{className:`font-medium`}),1:(0,$.jsx)(`code`,{})},t[8]=r):r=t[8];let i;return t[9]===e?i=t[10]:(i=(0,$.jsx)(Rh,{tone:`error`,children:(0,$.jsx)(a,{id:`Ud0Pj9`,values:e,components:r})}),t[9]=e,t[10]=i),i}if(i.kind===`anchor-not-found`){let e=`<MirrorSource id="${r}">`,i;t[11]!==e||t[12]!==n?(i={mirrorSourceTag:e,src:n},t[11]=e,t[12]=n,t[13]=i):i=t[13];let o;t[14]===Symbol.for(`react.memo_cache_sentinel`)?(o={0:(0,$.jsx)(`span`,{className:`font-medium`}),1:(0,$.jsx)(`code`,{}),2:(0,$.jsx)(`code`,{})},t[14]=o):o=t[14];let s;return t[15]===i?s=t[16]:(s=(0,$.jsx)(Rh,{tone:`error`,children:(0,$.jsx)(a,{id:`mqSwZH`,values:i,components:o})}),t[15]=i,t[16]=s),s}let o;t[17]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,$.jsx)(Gr,{className:`size-3`,"aria-hidden":`true`}),t[17]=o):o=t[17];let s;t[18]===n?s=t[19]:(s={src:n},t[18]=n,t[19]=s);let c;t[20]===Symbol.for(`react.memo_cache_sentinel`)?(c={0:(0,$.jsx)(`code`,{className:`font-mono`})},t[20]=c):c=t[20];let l;t[21]===s?l=t[22]:(l=(0,$.jsxs)(`div`,{className:`ok-mirror-badge pointer-events-none absolute -top-2.5 left-2 flex items-center gap-1 rounded-md bg-background px-1.5 text-xs text-muted-foreground opacity-0 transition-opacity [.jsx-component-wrapper:hover_&]:opacity-100 [.jsx-component-wrapper[data-selected="true"]_&]:opacity-100`,"aria-hidden":`true`,children:[o,(0,$.jsx)(`span`,{children:(0,$.jsx)(a,{id:`wQp1V3`,values:s,components:c})})]}),t[21]=s,t[22]=l);let u;t[23]===i.html?u=t[24]:(u=(0,$.jsx)(`div`,{dangerouslySetInnerHTML:{__html:i.html}}),t[23]=i.html,t[24]=u);let d;return t[25]!==r||t[26]!==n||t[27]!==l||t[28]!==u?(d=(0,$.jsxs)(`div`,{className:`ok-mirror-resolved relative -mx-3 prose-no-margin rounded-md border border-dashed border-transparent px-3 py-2 transition-colors [.jsx-component-wrapper:hover_&]:border-border/40 [.jsx-component-wrapper[data-selected="true"]_&]:border-border/40`,"data-mirror-src":n,"data-mirror-anchor":r,children:[l,u]}),t[25]=r,t[26]=n,t[27]=l,t[28]=u,t[29]=d):d=t[29],d}function Bh(e){let t=(0,Z.c)(15),{_:n}=o(),r=e.id??``,i;t[0]!==n||t[1]!==r?(i=r||n({id:`12F9WL`}),t[0]=n,t[1]=r,t[2]=i):i=t[2];let s=i,c;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,$.jsx)(Br,{className:`size-3`,"aria-hidden":`true`}),t[3]=c):c=t[3];let l;t[4]===s?l=t[5]:(l={label:s},t[4]=s,t[5]=l);let u;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(u={0:(0,$.jsx)(`code`,{className:`font-mono`})},t[6]=u):u=t[6];let d;t[7]===l?d=t[8]:(d=(0,$.jsxs)(`div`,{className:`ok-mirror-source-badge pointer-events-none absolute -top-2.5 left-2 flex items-center gap-1 rounded-md bg-background px-1.5 text-xs text-muted-foreground opacity-0 transition-opacity [.jsx-component-wrapper:hover_&]:opacity-100 [.jsx-component-wrapper[data-selected="true"]_&]:opacity-100`,children:[c,(0,$.jsx)(`span`,{children:(0,$.jsx)(a,{id:`Zon_qG`,values:l,components:u})})]}),t[7]=l,t[8]=d);let f;t[9]===e.children?f=t[10]:(f=(0,$.jsx)(`div`,{children:e.children}),t[9]=e.children,t[10]=f);let p;return t[11]!==r||t[12]!==d||t[13]!==f?(p=(0,$.jsxs)(`div`,{className:`ok-mirror-source relative -mx-3 rounded-md border border-dashed border-transparent px-3 py-1 transition-colors [.jsx-component-wrapper:hover_&]:border-border/50 [.jsx-component-wrapper[data-selected="true"]_&]:border-border/50`,"data-mirror-source-id":r,children:[d,f]}),t[11]=r,t[12]=d,t[13]=f,t[14]=p):p=t[14],p}var Vh=24,Hh=24,Uh=12,Wh=.1;function Gh(e,t,n,r){if(n<=0&&(e===`fit-width`||e===`two-odd`||e===`two-even`)||r<=0&&e===`fit-height`)return 1;switch(e){case`fit-width`:return Math.max(Wh,(n-Vh)/t.naturalWidth);case`fit-height`:return Math.max(Wh,(r-Hh)/t.naturalHeight);case`single`:return 1;case`two-odd`:case`two-even`:return Math.max(Wh,((n-Vh)/2-Uh)/t.naturalWidth)}}var Kh=600,qh=.5,Jh=3,Yh=.25,Xh=null;function Zh(){return Xh||(Xh=(async()=>{let e=await n(()=>import(`./pdf-BuVCb1O9.js`),__vite__mapDeps([0,1]),import.meta.url);if(!e.GlobalWorkerOptions.workerSrc){let t=(await n(async()=>{let{default:e}=await import(`./pdf.worker-qDy_6rvM.js`);return{default:e}},[],import.meta.url)).default;e.GlobalWorkerOptions.workerSrc=t}return e})(),Xh.catch(()=>{Xh=null})),Xh}function Qh(e){return e instanceof Error&&e.name===`RenderingCancelledException`}function $h(e){let t=(0,Z.c)(96),n,r;if(t[0]!==e.anchor||t[1]!==e.fillContainer){let{height:i,viewerFragment:a}=qt(e.anchor);n=i===null?e.fillContainer?`100%`:`${Kh}px`:`${i}px`,r=ag(a),t[0]=e.anchor,t[1]=e.fillContainer,t[2]=n,t[3]=r}else n=t[2],r=t[3];let i=r,s=(0,Q.useRef)(null),c;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(c=[],t[4]=c):c=t[4];let l=(0,Q.useRef)(c),u;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(u=[],t[5]=u):u=t[5];let d=(0,Q.useRef)(u),f=(0,Q.useRef)(null),p;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(p=[],t[6]=p):p=t[6];let[m,h]=(0,Q.useState)(p),[g,_]=(0,Q.useState)(!0),[v,y]=(0,Q.useState)(null),[b,x]=(0,Q.useState)(i??1),[S,C]=(0,Q.useState)(String(i??1)),[w,T]=(0,Q.useState)(1),[E,D]=(0,Q.useState)(`fit-width`),[O,k]=(0,Q.useState)(!1),[A,j]=(0,Q.useState)(!1),[M,N]=(0,Q.useState)(0),[P,F]=(0,Q.useState)(0),{_:I}=o(),L=m.length,ee,R;t[7]!==I||t[8]!==e.src?(ee=()=>{if(!e.src){_(!1);return}let t=vn(e.src),n=!1,r=null;return _(!0),y(null),(async()=>{try{let e=await(await Zh()).getDocument({url:t,isEvalSupported:!1}).promise;if(n){await e.destroy();return}r=e,f.current=e;let i=[];for(let t=1;t<=e.numPages;t++){if(n)return;let r=(await e.getPage(t)).getViewport({scale:1});i.push({pageNumber:t,naturalWidth:r.width,naturalHeight:r.height})}if(n)return;h(i)}catch(e){let t=e;if(n)return;y(t instanceof Error?t.message:I({id:`jRHdCz`})),_(!1)}})(),()=>{n=!0,r&&=(r.destroy(),null),f.current=null}},R=[e.src,I],t[7]=I,t[8]=e.src,t[9]=ee,t[10]=R):(ee=t[9],R=t[10]),(0,Q.useEffect)(ee,R);let te,z;t[11]===Symbol.for(`react.memo_cache_sentinel`)?(te=()=>{let e=s.current;if(!e)return;let t=()=>{N(e.clientWidth),F(e.clientHeight)};t();let n=new ResizeObserver(t);return n.observe(e),()=>n.disconnect()},z=[],t[11]=te,t[12]=z):(te=t[11],z=t[12]),(0,Q.useEffect)(te,z);let ne,re;t[13]!==I||t[14]!==P||t[15]!==M||t[16]!==E||t[17]!==m||t[18]!==w?(ne=()=>{let e=f.current;if(!e||m.length===0||M===0)return;let t=!1,n=null;return(async()=>{try{let r=window.devicePixelRatio||1;for(let i of m){if(t)return;let a=l.current[i.pageNumber-1];if(!a)continue;let o=Gh(E,i,M,P)*w,s=await e.getPage(i.pageNumber);if(t)return;let c=s.getViewport({scale:o});a.width=Math.floor(c.width*r),a.height=Math.floor(c.height*r),a.style.width=`${c.width}px`,a.style.height=`${c.height}px`;let u=a.getContext(`2d`);u&&(u.setTransform(r,0,0,r,0,0),n=s.render({canvas:a,canvasContext:u,viewport:c}),await n.promise,n=null)}t||_(!1)}catch(e){let n=e;if(t||Qh(n))return;console.warn(`[Pdf] page render failed:`,n),y(n instanceof Error?n.message:I({id:`_TF8ep`})),_(!1)}})(),()=>{if(t=!0,n){try{n.cancel()}catch{}n=null}}},re=[m,E,w,M,P,I],t[13]=I,t[14]=P,t[15]=M,t[16]=E,t[17]=m,t[18]=w,t[19]=ne,t[20]=re):(ne=t[19],re=t[20]),(0,Q.useEffect)(ne,re);let ie,ae;t[21]!==m||t[22]!==O?(ie=()=>{if(!O)return;let e=f.current;if(!e||m.length===0)return;let t=!1,n=null;return(async()=>{try{let r=window.devicePixelRatio||1;for(let i of m){if(t)return;let a=d.current[i.pageNumber-1];if(!a)continue;let o=120/i.naturalWidth,s=await e.getPage(i.pageNumber);if(t)return;let c=s.getViewport({scale:o});a.width=Math.floor(c.width*r),a.height=Math.floor(c.height*r),a.style.width=`${c.width}px`,a.style.height=`${c.height}px`;let l=a.getContext(`2d`);l&&(l.setTransform(r,0,0,r,0,0),n=s.render({canvas:a,canvasContext:l,viewport:c}),await n.promise,n=null)}}catch(e){let t=e;Qh(t)||console.warn(`[Pdf] thumbnail render failed:`,t)}})(),()=>{if(t=!0,n){try{n.cancel()}catch{}n=null}}},ae=[O,m],t[21]=m,t[22]=O,t[23]=ie,t[24]=ae):(ie=t[23],ae=t[24]),(0,Q.useEffect)(ie,ae);let B,oe;t[25]!==g||t[26]!==i?(B=()=>{if(g||!i)return;let e=s.current,t=l.current[i-1];e&&t&&(e.scrollTop=t.offsetTop-e.offsetTop)},oe=[g,i],t[25]=g,t[26]=i,t[27]=B,t[28]=oe):(B=t[27],oe=t[28]),(0,Q.useEffect)(B,oe);let se,ce;t[29]===m?(se=t[30],ce=t[31]):(se=()=>{let e=s.current;if(!e||m.length===0)return;let t=!1,n=()=>{t||(t=!0,requestAnimationFrame(()=>{t=!1;let n=e.scrollTop,r=1;for(let t of m){let i=l.current[t.pageNumber-1];i&&i.offsetTop-e.offsetTop<=n+40&&(r=t.pageNumber)}x(r),C(String(r))}))};return e.addEventListener(`scroll`,n,{passive:!0}),()=>e.removeEventListener(`scroll`,n)},ce=[m],t[29]=m,t[30]=se,t[31]=ce),(0,Q.useEffect)(se,ce);let V,le;t[32]===A?(V=t[33],le=t[34]):(V=()=>{if(!A)return;let e=e=>{let t=e.target,n=s.current?.closest(`.ok-pdf`);if(!n||!t||!n.contains(t)){j(!1);return}let r=n.querySelector(`.ok-pdf-layout-menu`);r&&!r.contains(t)&&j(!1)};return document.addEventListener(`mousedown`,e),()=>document.removeEventListener(`mousedown`,e)},le=[A],t[32]=A,t[33]=V,t[34]=le),(0,Q.useEffect)(V,le);let H;t[35]===L?H=t[36]:(H=e=>{let t=Math.max(1,Math.min(L||1,e));x(t),C(String(t));let n=s.current,r=l.current[t-1];n&&r&&n.scrollTo({top:r.offsetTop-n.offsetTop,behavior:`smooth`})},t[35]=L,t[36]=H);let ue=H,U;t[37]!==b||t[38]!==ue||t[39]!==S?(U=()=>{let e=Number.parseInt(S,10);if(Number.isNaN(e)){C(String(b));return}ue(e)},t[37]=b,t[38]=ue,t[39]=S,t[40]=U):U=t[40];let de=U,W;t[41]===Symbol.for(`react.memo_cache_sentinel`)?(W=()=>T(rg),t[41]=W):W=t[41];let G=W,fe;t[42]===Symbol.for(`react.memo_cache_sentinel`)?(fe=()=>T(ng),t[42]=fe):fe=t[42];let pe=fe,me;t[43]===Symbol.for(`react.memo_cache_sentinel`)?(me=e=>{D(e),j(!1),T(1)},t[43]=me):me=t[43];let he=me,ge;t[44]===n?ge=t[45]:(ge={height:n},t[44]=n,t[45]=ge);let K;t[46]===Symbol.for(`react.memo_cache_sentinel`)?(K=()=>k(tg),t[46]=K):K=t[46];let q;t[47]!==I||t[48]!==O?(q=I(O?{id:`JK-Ave`}:{id:`iEYxO4`}),t[47]=I,t[48]=O,t[49]=q):q=t[49];let J;t[50]===I?J=t[51]:(J=I({id:`zo3Dl7`}),t[50]=I,t[51]=J);let _e;t[52]===Symbol.for(`react.memo_cache_sentinel`)?(_e=(0,$.jsx)(Co,{size:14,"aria-hidden":`true`}),t[52]=_e):_e=t[52];let ve;t[53]!==O||t[54]!==q||t[55]!==J?(ve=(0,$.jsx)(`button`,{type:`button`,onClick:K,"aria-label":q,"aria-pressed":O,className:`ok-pdf-btn`,title:J,children:_e}),t[53]=O,t[54]=q,t[55]=J,t[56]=ve):ve=t[56];let ye=e.title??`PDF`,be;t[57]===ye?be=t[58]:(be=(0,$.jsx)(`span`,{className:`ok-pdf-title`,children:ye}),t[57]=ye,t[58]=be);let xe;t[59]!==I||t[60]!==A||t[61]!==E||t[62]!==S||t[63]!==de||t[64]!==L||t[65]!==w?(xe=L>0&&(0,$.jsxs)(`div`,{className:`ok-pdf-controls`,children:[(0,$.jsx)(`form`,{className:`ok-pdf-page-form`,onSubmit:e=>{e.preventDefault(),de()},children:(0,$.jsx)(`input`,{type:`text`,inputMode:`numeric`,pattern:`[0-9]*`,className:`ok-pdf-page-input`,value:S,onChange:e=>C(e.target.value.replace(/[^0-9]/g,``)),onBlur:de,"aria-label":I({id:`xsZhu-`})})}),(0,$.jsx)(`span`,{className:`ok-pdf-page-of`,children:(0,$.jsx)(a,{id:`1GhYxC`,values:{totalPages:L}})}),(0,$.jsx)(`span`,{className:`ok-pdf-divider`,"aria-hidden":`true`}),(0,$.jsx)(`button`,{type:`button`,onClick:pe,disabled:w<=qh,"aria-label":I({id:`FjkaiT`}),className:`ok-pdf-btn`,title:I({id:`FjkaiT`}),children:(0,$.jsx)(Oe,{size:14,"aria-hidden":`true`})}),(0,$.jsxs)(`span`,{className:`ok-pdf-zoom-display`,"aria-live":`polite`,children:[Math.round(w*100),`%`]}),(0,$.jsx)(`button`,{type:`button`,onClick:G,disabled:w>=Jh,"aria-label":I({id:`AWOSPo`}),className:`ok-pdf-btn`,title:I({id:`AWOSPo`}),children:(0,$.jsx)(Me,{size:14,"aria-hidden":`true`})}),(0,$.jsx)(`span`,{className:`ok-pdf-divider`,"aria-hidden":`true`}),(0,$.jsxs)(`div`,{className:`ok-pdf-layout-menu`,children:[(0,$.jsx)(`button`,{type:`button`,onClick:()=>j(eg),"aria-label":I({id:`GQDSBN`}),"aria-haspopup":`menu`,"aria-expanded":A,className:`ok-pdf-btn`,title:I({id:`rdU729`}),children:(0,$.jsx)(jr,{size:14,"aria-hidden":`true`})}),A&&(0,$.jsxs)(`div`,{role:`menu`,className:`ok-pdf-menu`,children:[(0,$.jsx)(ig,{label:I({id:`vIxrEk`}),active:E===`fit-width`,onSelect:()=>he(`fit-width`)}),(0,$.jsx)(ig,{label:I({id:`YlDuro`}),active:E===`fit-height`,onSelect:()=>he(`fit-height`)}),(0,$.jsx)(`hr`,{className:`ok-pdf-menu-divider`}),(0,$.jsx)(ig,{label:I({id:`BGHHtQ`}),active:E===`single`,onSelect:()=>he(`single`)}),(0,$.jsx)(ig,{label:I({id:`xK291b`}),active:E===`two-odd`,onSelect:()=>he(`two-odd`)}),(0,$.jsx)(ig,{label:I({id:`NSnIUP`}),active:E===`two-even`,onSelect:()=>he(`two-even`)})]})]})]}),t[59]=I,t[60]=A,t[61]=E,t[62]=S,t[63]=de,t[64]=L,t[65]=w,t[66]=xe):xe=t[66];let Se;t[67]!==ve||t[68]!==be||t[69]!==xe?(Se=(0,$.jsxs)(`div`,{className:`ok-pdf-toolbar`,contentEditable:!1,children:[ve,be,xe]}),t[67]=ve,t[68]=be,t[69]=xe,t[70]=Se):Se=t[70];let Ce;t[71]!==I||t[72]!==b||t[73]!==ue||t[74]!==m||t[75]!==O?(Ce=O&&(0,$.jsx)(`aside`,{className:`ok-pdf-sidebar`,"aria-label":I({id:`nzaV6Q`}),children:m.map((e,t)=>{let{pageNumber:n}=e;return(0,$.jsxs)(`button`,{type:`button`,className:`ok-pdf-thumb`,"data-active":b===n||void 0,onClick:()=>ue(n),"aria-label":I({id:`qioCwA`,values:{pageNumber:n}}),children:[(0,$.jsx)(`canvas`,{ref:e=>{d.current[t]=e},className:`ok-pdf-thumb-canvas`}),(0,$.jsx)(`span`,{className:`ok-pdf-thumb-num`,children:n})]},n)})}),t[71]=I,t[72]=b,t[73]=ue,t[74]=m,t[75]=O,t[76]=Ce):Ce=t[76];let we;t[77]===g?we=t[78]:(we=g&&(0,$.jsx)(`div`,{className:`ok-pdf-loading`,children:(0,$.jsx)(a,{id:`T-654M`})}),t[77]=g,t[78]=we);let Te;t[79]===v?Te=t[80]:(Te=v&&(0,$.jsx)(`div`,{className:`ok-pdf-error`,children:(0,$.jsx)(a,{id:`WamGNs`,values:{error:v}})}),t[79]=v,t[80]=Te);let Ee;t[81]!==I||t[82]!==L?(Ee=Array.from({length:L},(e,t)=>{let n=t+1;return(0,$.jsx)(`canvas`,{ref:e=>{l.current[t]=e},className:`ok-pdf-page`,"aria-label":I({id:`XtRoxT`,values:{pageNumber:n}})},n)}),t[81]=I,t[82]=L,t[83]=Ee):Ee=t[83];let De;t[84]!==E||t[85]!==we||t[86]!==Te||t[87]!==Ee?(De=(0,$.jsxs)(`div`,{className:`ok-pdf-pages`,ref:s,"data-layout":E,children:[we,Te,Ee]}),t[84]=E,t[85]=we,t[86]=Te,t[87]=Ee,t[88]=De):De=t[88];let ke;t[89]!==Ce||t[90]!==De?(ke=(0,$.jsxs)(`div`,{className:`ok-pdf-body`,children:[Ce,De]}),t[89]=Ce,t[90]=De,t[91]=ke):ke=t[91];let Ae;return t[92]!==ge||t[93]!==Se||t[94]!==ke?(Ae=(0,$.jsxs)(`div`,{className:`ok-pdf`,style:ge,children:[Se,ke]}),t[92]=ge,t[93]=Se,t[94]=ke,t[95]=Ae):Ae=t[95],Ae}function eg(e){return!e}function tg(e){return!e}function ng(e){return Math.max(qh,+(e-Yh).toFixed(2))}function rg(e){return Math.min(Jh,+(e+Yh).toFixed(2))}function ig(e){let t=(0,Z.c)(10),n=e.active||void 0,r;t[0]===e.active?r=t[1]:(r=e.active&&(0,$.jsx)(Ar,{size:14}),t[0]=e.active,t[1]=r);let i;t[2]===r?i=t[3]:(i=(0,$.jsx)(`span`,{className:`ok-pdf-menu-check`,"aria-hidden":`true`,children:r}),t[2]=r,t[3]=i);let a;return t[4]!==e.active||t[5]!==e.label||t[6]!==e.onSelect||t[7]!==n||t[8]!==i?(a=(0,$.jsxs)(`button`,{type:`button`,role:`menuitemradio`,"aria-checked":e.active,className:`ok-pdf-menu-item`,"data-active":n,onClick:e.onSelect,children:[i,e.label]}),t[4]=e.active,t[5]=e.label,t[6]=e.onSelect,t[7]=n,t[8]=i,t[9]=a):a=t[9],a}function ag(e){if(!e)return null;for(let t of e.split(`&`)){let e=t.indexOf(`=`);if(!(e<0)&&t.slice(0,e)===`page`){let n=Number.parseInt(t.slice(e+1),10);if(!Number.isNaN(n)&&n>=1)return n}}return null}function og(e){let t=(0,Z.c)(10),{label:n,id:r,children:i}=e,a=(0,Q.useId)(),o;t[0]!==r||t[1]!==a?(o=r||`tab-panel-${a.replace(/:/g,``)}`,t[0]=r,t[1]=a,t[2]=o):o=t[2];let s=o,c=`${s}-tab`,l;t[3]===n?l=t[4]:(l=n?.trim()||`Tab`,t[3]=n,t[4]=l);let u=l,d;return t[5]!==i||t[6]!==s||t[7]!==u||t[8]!==c?(d=(0,$.jsx)(`section`,{className:`tab-panel`,id:s,role:`tabpanel`,"aria-labelledby":c,"data-tab-label":u,"data-tab-id":s,children:i}),t[5]=i,t[6]=s,t[7]=u,t[8]=c,t[9]=d):d=t[9],d}var sg=`:scope > .component-children > [data-node-view-content-react] > .react-renderer`;function cg(e){return Array.from(e.querySelectorAll(sg)).map((e,t)=>{let n=e.querySelector(`[data-tab-label]`);return{index:t,label:(n?.getAttribute(`data-tab-label`))?.trim()||`Tab ${t+1}`,panelId:n?.getAttribute(`data-tab-id`)??null}})}function lg(e,t){let n=Array.from(e.querySelectorAll(sg))[t];return n?n.querySelector(`[data-jsx-gear]`):null}function ug(e){let t=(0,Z.c)(31),{id:n,children:r}=e,[i,a]=(0,Q.useState)(0),s;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(s=[],t[0]=s):s=t[0];let[c,l]=(0,Q.useState)(s),u=(0,Q.useRef)(null),d=(0,Q.useRef)(null),f=(0,Q.useRef)(0),p=H(),m=p?.addChild!=null,{_:h}=o(),g;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(g=()=>{let e=u.current;if(!e)return;let t=cg(e);l(e=>{if(e.length!==t.length)return t;for(let n=0;n<e.length;n++)if(e[n].label!==t[n].label||e[n].panelId!==t[n].panelId)return t;return e})},t[1]=g):g=t[1],(0,Q.useLayoutEffect)(g);let _,v;t[2]===c.length?(_=t[3],v=t[4]):(_=()=>{c.length>f.current&&c.length>0&&a(c.length-1),f.current=c.length},v=[c.length],t[2]=c.length,t[3]=_,t[4]=v),(0,Q.useLayoutEffect)(_,v);let y;t[5]===n?y=t[6]:(y=()=>{let e=()=>{let e=window.location.hash.slice(1);if(!e)return;if(n&&e===n){a(0);return}let t=u.current;if(!t)return;let r=cg(t).findIndex(t=>t.panelId===e);r<0||(a(r),queueMicrotask(()=>{t.ownerDocument.getElementById(e)?.scrollIntoView({block:`start`,behavior:`auto`})}))};return e(),window.addEventListener(`hashchange`,e),()=>window.removeEventListener(`hashchange`,e)},t[5]=n,t[6]=y),(0,Q.useLayoutEffect)(y);let b=c.length===0?0:Math.min(Math.max(i,0),c.length-1),x;t[7]!==c.length||t[8]!==b?(x=e=>{if(c.length===0)return;let t=null;e.key===`ArrowRight`?t=(b+1)%c.length:e.key===`ArrowLeft`?t=(b-1+c.length)%c.length:e.key===`Home`?t=0:e.key===`End`&&(t=c.length-1),t!==null&&(e.preventDefault(),a(t),(d.current?.querySelectorAll(`[role="tab"]`))?.[t]?.focus())},t[7]=c.length,t[8]=b,t[9]=x):x=t[9];let S=x,C=n?`Tabs: ${n}`:`Tabs`,w;t[10]!==c||t[11]!==b?(w=c.map(e=>(0,$.jsx)(`button`,{id:e.panelId?`${e.panelId}-tab`:void 0,type:`button`,role:`tab`,className:`tabs-strip-pill`,"data-active":e.index===b,"aria-selected":e.index===b,"aria-controls":e.panelId??void 0,tabIndex:e.index===b?0:-1,onMouseDown:fg,onClick:()=>{if(e.index!==b){a(e.index);return}let t=u.current;t&&lg(t,e.index)?.click()},children:e.label},e.index)),t[10]=c,t[11]=b,t[12]=w):w=t[12];let T;t[13]!==S||t[14]!==C||t[15]!==w?(T=(0,$.jsx)(`div`,{ref:d,role:`tablist`,"aria-label":C,className:`tabs-tablist`,onKeyDown:S,children:w}),t[13]=S,t[14]=C,t[15]=w,t[16]=T):T=t[16];let E;t[17]!==h||t[18]!==m||t[19]!==p?(E=m&&(0,$.jsx)(`button`,{type:`button`,className:`tabs-strip-add`,"aria-label":h({id:`hjO0Mq`}),title:h({id:`hjO0Mq`}),onMouseDown:dg,onClick:()=>p?.addChild?.(),"data-tabs-strip-add":``,children:`+`}),t[17]=h,t[18]=m,t[19]=p,t[20]=E):E=t[20];let D;t[21]!==E||t[22]!==T?(D=(0,$.jsxs)(`div`,{className:`tabs-strip`,contentEditable:!1,children:[T,E]}),t[21]=E,t[22]=T,t[23]=D):D=t[23];let O;t[24]!==r||t[25]!==b?(O=(0,$.jsx)(`div`,{ref:u,className:`tabs-content`,"data-active-index":b,children:r}),t[24]=r,t[25]=b,t[26]=O):O=t[26];let k;return t[27]!==n||t[28]!==D||t[29]!==O?(k=(0,$.jsxs)(`div`,{className:`tabs`,id:n,children:[D,O]}),t[27]=n,t[28]=D,t[29]=O,t[30]=k):k=t[30],k}function dg(e){return e.preventDefault()}function fg(e){return e.preventDefault()}var pg=typeof global<`u`&&{}.toString.call(global)===`[object global]`,mg=typeof Bun<`u`,hg=typeof Deno<`u`,gg=typeof WebSocketPair==`function`&&caches?.default!==void 0,_g=pg||mg||hg||gg;function vg(e,t){return e.indexOf(t.toLowerCase())===0?e:`${t.toLowerCase()}${e.substr(0,1).toUpperCase()}${e.substr(1)}`}function yg(e){return!!(e&&e.nodeType===1&&`nodeName`in e&&e.ownerDocument&&e.ownerDocument.defaultView)}function bg(e){return!isNaN(parseFloat(e))&&isFinite(e)&&Math.floor(e)==e}function xg(e){return/^(https?:)?\/\/((((player|www)\.)?vimeo\.com)|((player\.)?[a-zA-Z0-9-]+\.(videoji\.(hk|cn)|vimeo\.work)))(?=$|\/)/.test(e)}function Sg(e){return/^https:\/\/player\.((vimeo\.com)|([a-zA-Z0-9-]+\.(videoji\.(hk|cn)|vimeo\.work)))\/video\/\d+/.test(e)}function Cg(e){let t=(e||``).match(/^(?:https?:)?(?:\/\/)?([^/?]+)/),n=(t&&t[1]||``).replace(`player.`,``);for(let e of[`.videoji.hk`,`.vimeo.work`,`.videoji.cn`])if(n.endsWith(e))return n;return`vimeo.com`}function wg(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=e.id,n=e.url,r=t||n;if(!r)throw Error(`An id or url must be passed, either in an options object or as a data-vimeo-id or data-vimeo-url attribute.`);if(bg(r))return`https://vimeo.com/${r}`;if(xg(r))return r.replace(`http:`,`https:`);throw TypeError(t?`“${t}” is not a valid video id.`:`“${r}” is not a vimeo.com url.`)}var Tg=function(e,t,n){let r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:`addEventListener`,i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:`removeEventListener`,a=typeof t==`string`?[t]:t;return a.forEach(t=>{e[r](t,n)}),{cancel:()=>a.forEach(t=>e[i](t,n))}};function Eg(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:document;if(!e||!t||typeof t.querySelectorAll!=`function`)return null;let n=t.querySelectorAll(`iframe`);for(let t=0;t<n.length;t++)if(n[t]&&n[t].contentWindow===e)return n[t];return null}var Dg=Array.prototype.indexOf!==void 0,Og=typeof window<`u`&&window.postMessage!==void 0;if(!_g&&(!Dg||!Og))throw Error(`Sorry, the Vimeo Player API is not available in this browser.`);var kg=typeof globalThis<`u`?globalThis:typeof window<`u`?window:typeof global<`u`?global:typeof self<`u`?self:{};function Ag(e,t){return t={exports:{}},e(t,t.exports),t.exports}(function(e){if(e.WeakMap)return;var t=Object.prototype.hasOwnProperty,n=Object.defineProperty&&function(){try{return Object.defineProperty({},`x`,{value:1}).x===1}catch{}}(),r=function(e,t,r){n?Object.defineProperty(e,t,{configurable:!0,writable:!0,value:r}):e[t]=r};e.WeakMap=function(){function e(){if(this===void 0)throw TypeError(`Constructor WeakMap requires 'new'`);if(r(this,`_id`,a(`_WeakMap`)),arguments.length>0)throw TypeError(`WeakMap iterable is not supported`)}r(e.prototype,`delete`,function(e){if(n(this,`delete`),!i(e))return!1;var t=e[this._id];return t&&t[0]===e?(delete e[this._id],!0):!1}),r(e.prototype,`get`,function(e){if(n(this,`get`),i(e)){var t=e[this._id];if(t&&t[0]===e)return t[1]}}),r(e.prototype,`has`,function(e){if(n(this,`has`),!i(e))return!1;var t=e[this._id];return!!(t&&t[0]===e)}),r(e.prototype,`set`,function(e,t){if(n(this,`set`),!i(e))throw TypeError(`Invalid value used as weak map key`);var a=e[this._id];return a&&a[0]===e?(a[1]=t,this):(r(e,this._id,[e,t]),this)});function n(e,n){if(!i(e)||!t.call(e,`_id`))throw TypeError(n+` method called on incompatible receiver `+typeof e)}function a(e){return e+`_`+o()+`.`+o()}function o(){return Math.random().toString().substring(2)}return r(e,`_polyfill`,!0),e}();function i(e){return Object(e)===e}})(typeof globalThis<`u`?globalThis:typeof self<`u`?self:typeof window<`u`?window:kg);var jg=Ag(function(e){(function(t,n,r){n[t]=n[t]||r(),e.exports&&=n[t]})(`Promise`,kg,function(){var e,t,n,r=Object.prototype.toString,i=typeof setImmediate<`u`?function(e){return setImmediate(e)}:setTimeout;try{Object.defineProperty({},`x`,{}),e=function(e,t,n,r){return Object.defineProperty(e,t,{value:n,writable:!0,configurable:r!==!1})}}catch{e=function(e,t,n){return e[t]=n,e}}n=function(){var e,n,r;function i(e,t){this.fn=e,this.self=t,this.next=void 0}return{add:function(t,a){r=new i(t,a),n?n.next=r:e=r,n=r,r=void 0},drain:function(){var r=e;for(e=n=t=void 0;r;)r.fn.call(r.self),r=r.next}}}();function a(e,r){n.add(e,r),t||=i(n.drain)}function o(e){var t,n=typeof e;return e!=null&&(n==`object`||n==`function`)&&(t=e.then),typeof t==`function`?t:!1}function s(){for(var e=0;e<this.chain.length;e++)c(this,this.state===1?this.chain[e].success:this.chain[e].failure,this.chain[e]);this.chain.length=0}function c(e,t,n){var r,i;try{t===!1?n.reject(e.msg):(r=t===!0?e.msg:t.call(void 0,e.msg),r===n.promise?n.reject(TypeError(`Promise-chain cycle`)):(i=o(r))?i.call(r,n.resolve,n.reject):n.resolve(r))}catch(e){n.reject(e)}}function l(e){var t,n=this;if(!n.triggered){n.triggered=!0,n.def&&(n=n.def);try{(t=o(e))?a(function(){var r=new f(n);try{t.call(e,function(){l.apply(r,arguments)},function(){u.apply(r,arguments)})}catch(e){u.call(r,e)}}):(n.msg=e,n.state=1,n.chain.length>0&&a(s,n))}catch(e){u.call(new f(n),e)}}}function u(e){var t=this;t.triggered||(t.triggered=!0,t.def&&(t=t.def),t.msg=e,t.state=2,t.chain.length>0&&a(s,t))}function d(e,t,n,r){for(var i=0;i<t.length;i++)(function(i){e.resolve(t[i]).then(function(e){n(i,e)},r)})(i)}function f(e){this.def=e,this.triggered=!1}function p(e){this.promise=e,this.state=0,this.triggered=!1,this.chain=[],this.msg=void 0}function m(e){if(typeof e!=`function`)throw TypeError(`Not a function`);if(this.__NPO__!==0)throw TypeError(`Not a promise`);this.__NPO__=1;var t=new p(this);this.then=function(e,n){var r={success:typeof e==`function`?e:!0,failure:typeof n==`function`?n:!1};return r.promise=new this.constructor(function(e,t){if(typeof e!=`function`||typeof t!=`function`)throw TypeError(`Not a function`);r.resolve=e,r.reject=t}),t.chain.push(r),t.state!==0&&a(s,t),r.promise},this.catch=function(e){return this.then(void 0,e)};try{e.call(void 0,function(e){l.call(t,e)},function(e){u.call(t,e)})}catch(e){u.call(t,e)}}var h=e({},`constructor`,m,!1);return m.prototype=h,e(h,`__NPO__`,0,!1),e(m,`resolve`,function(e){var t=this;return e&&typeof e==`object`&&e.__NPO__===1?e:new t(function(t,n){if(typeof t!=`function`||typeof n!=`function`)throw TypeError(`Not a function`);t(e)})}),e(m,`reject`,function(e){return new this(function(t,n){if(typeof t!=`function`||typeof n!=`function`)throw TypeError(`Not a function`);n(e)})}),e(m,`all`,function(e){var t=this;return r.call(e)==`[object Array]`?e.length===0?t.resolve([]):new t(function(n,r){if(typeof n!=`function`||typeof r!=`function`)throw TypeError(`Not a function`);var i=e.length,a=Array(i),o=0;d(t,e,function(e,t){a[e]=t,++o===i&&n(a)},r)}):t.reject(TypeError(`Not an array`))}),e(m,`race`,function(e){var t=this;return r.call(e)==`[object Array]`?new t(function(n,r){if(typeof n!=`function`||typeof r!=`function`)throw TypeError(`Not a function`);d(t,e,function(e,t){n(t)},r)}):t.reject(TypeError(`Not an array`))}),m})}),Mg=new WeakMap;function Ng(e,t,n){let r=Mg.get(e.element)||{};t in r||(r[t]=[]),r[t].push(n),Mg.set(e.element,r)}function Pg(e,t){return(Mg.get(e.element)||{})[t]||[]}function Fg(e,t,n){let r=Mg.get(e.element)||{};if(!r[t])return!0;if(!n)return r[t]=[],Mg.set(e.element,r),!0;let i=r[t].indexOf(n);return i!==-1&&r[t].splice(i,1),Mg.set(e.element,r),r[t]&&r[t].length===0}function Ig(e,t){let n=Pg(e,t);if(n.length<1)return!1;let r=n.shift();return Fg(e,t,r),r}function Lg(e,t){let n=Mg.get(e);Mg.set(t,n),Mg.delete(e)}function Rg(e){if(typeof e==`string`)try{e=JSON.parse(e)}catch(e){return console.warn(e),{}}return e}function zg(e,t,n){if(!e.element.contentWindow||!e.element.contentWindow.postMessage)return;let r={method:t};n!==void 0&&(r.value=n);let i=parseFloat(navigator.userAgent.toLowerCase().replace(/^.*msie (\d+).*$/,`$1`));i>=8&&i<10&&(r=JSON.stringify(r)),e.element.contentWindow.postMessage(r,e.origin)}function Bg(e,t){t=Rg(t);let n=[],r;if(t.event)t.event===`error`&&Pg(e,t.data.method).forEach(n=>{let r=Error(t.data.message);r.name=t.data.name,n.reject(r),Fg(e,t.data.method,n)}),n=Pg(e,`event:${t.event}`),r=t.data;else if(t.method){let i=Ig(e,t.method);i&&(n.push(i),r=t.value)}n.forEach(t=>{try{if(typeof t==`function`){t.call(e,r);return}t.resolve(r)}catch{}})}var Vg=`airplay.audio_tracks.audiotrack.autopause.autoplay.background.byline.cc.chapter_id.chapters.chromecast.color.colors.controls.disable_context_menu.dnt.end_time.fullscreen.height.id.initial_quality.interactive_params.keyboard.loop.maxheight.max_quality.maxwidth.min_quality.muted.play_button_position.playsinline.portrait.preload.progress_bar.quality.quality_selector.responsive.skipping_forward.speed.start_time.texttrack.thumbnail_id.title.transcript.transparent.unmute_button.url.vimeo_logo.volume.watch_full_video.width`.split(`.`);function Hg(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return Vg.reduce((t,n)=>{let r=e.getAttribute(`data-vimeo-${n}`);return(r||r===``)&&(t[n]=r===``?1:r),t},t)}function Ug(e,t){let{html:n}=e;if(!t)throw TypeError(`An element must be provided`);if(t.getAttribute(`data-vimeo-initialized`)!==null)return t.querySelector(`iframe`);let r=document.createElement(`div`);return r.innerHTML=n,t.appendChild(r.firstChild),t.setAttribute(`data-vimeo-initialized`,`true`),t.querySelector(`iframe`)}function Wg(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=arguments.length>2?arguments[2]:void 0;return new Promise((r,i)=>{if(!xg(e))throw TypeError(`“${e}” is not a vimeo.com url.`);let a=`https://${Cg(e)}/api/oembed.json?url=${encodeURIComponent(e)}`;for(let e in t)t.hasOwnProperty(e)&&(a+=`&${e}=${encodeURIComponent(t[e])}`);let o=`XDomainRequest`in window?new XDomainRequest:new XMLHttpRequest;o.open(`GET`,a,!0),o.onload=function(){if(o.status===404){i(Error(`“${e}” was not found.`));return}if(o.status===403){i(Error(`“${e}” is not embeddable.`));return}try{let t=JSON.parse(o.responseText);if(t.domain_status_code===403){Ug(t,n),i(Error(`“${e}” is not embeddable.`));return}r(t)}catch(e){i(e)}},o.onerror=function(){let e=o.status?` (${o.status})`:``;i(Error(`There was an error fetching the embed code from Vimeo${e}.`))},o.send()})}function Gg(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:document,t=[].slice.call(e.querySelectorAll(`[data-vimeo-id], [data-vimeo-url]`)),n=e=>{`console`in window&&console.error&&console.error(`There was an error creating an embed: ${e}`)};t.forEach(e=>{try{if(e.getAttribute(`data-vimeo-defer`)!==null)return;let t=Hg(e);Wg(wg(t),t,e).then(t=>Ug(t,e)).catch(n)}catch(e){n(e)}})}function Kg(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:document;window.VimeoPlayerResizeEmbeds_||(window.VimeoPlayerResizeEmbeds_=!0,window.addEventListener(`message`,t=>{if(!xg(t.origin)||!t.data||t.data.event!==`spacechange`)return;let n=t.source?Eg(t.source,e):null;if(n){let e=n.parentElement;e.style.paddingBottom=`${t.data.data[0].bottom}px`}}))}function qg(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:document;window.VimeoSeoMetadataAppended||(window.VimeoSeoMetadataAppended=!0,window.addEventListener(`message`,t=>{if(!xg(t.origin))return;let n=Rg(t.data);if(!n||n.event!==`ready`)return;let r=t.source?Eg(t.source,e):null;r&&Sg(r.src)&&new n_(r).callMethod(`appendVideoMetadata`,window.location.href)}))}function Jg(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:document;if(window.VimeoCheckedUrlTimeParam)return;window.VimeoCheckedUrlTimeParam=!0;let t=e=>{`console`in window&&console.error&&console.error(`There was an error getting video Id: ${e}`)};window.addEventListener(`message`,n=>{if(!xg(n.origin))return;let r=Rg(n.data);if(!r||r.event!==`ready`)return;let i=n.source?Eg(n.source,e):null;if(i&&Sg(i.src)){let e=new n_(i);e.getVideoId().then(t=>{let n=RegExp(`[?&]vimeo_t_${t}=([^&#]*)`).exec(window.location.href);if(n&&n[1]){let t=decodeURI(n[1]);e.setCurrentTime(t)}}).catch(t)}})}function Yg(){window.VimeoDRMEmbedsUpdated||(window.VimeoDRMEmbedsUpdated=!0,window.addEventListener(`message`,e=>{if(!xg(e.origin))return;let t=Rg(e.data);if(!t||t.event!==`drminitfailed`)return;let n=e.source?Eg(e.source):null;if(!n)return;let r=n.getAttribute(`allow`)||``;if(!r.includes(`encrypted-media`)){n.setAttribute(`allow`,`${r}; encrypted-media`);let e=new URL(n.getAttribute(`src`));e.searchParams.set(`forcereload`,`drm`),n.setAttribute(`src`,e.toString());return}}))}function Xg(){let e=function(){let e,t=[[`requestFullscreen`,`exitFullscreen`,`fullscreenElement`,`fullscreenEnabled`,`fullscreenchange`,`fullscreenerror`],[`webkitRequestFullscreen`,`webkitExitFullscreen`,`webkitFullscreenElement`,`webkitFullscreenEnabled`,`webkitfullscreenchange`,`webkitfullscreenerror`],[`webkitRequestFullScreen`,`webkitCancelFullScreen`,`webkitCurrentFullScreenElement`,`webkitCancelFullScreen`,`webkitfullscreenchange`,`webkitfullscreenerror`],[`mozRequestFullScreen`,`mozCancelFullScreen`,`mozFullScreenElement`,`mozFullScreenEnabled`,`mozfullscreenchange`,`mozfullscreenerror`],[`msRequestFullscreen`,`msExitFullscreen`,`msFullscreenElement`,`msFullscreenEnabled`,`MSFullscreenChange`,`MSFullscreenError`]],n=0,r=t.length,i={};for(;n<r;n++)if(e=t[n],e&&e[1]in document){for(n=0;n<e.length;n++)i[t[0][n]]=e[n];return i}return!1}(),t={fullscreenchange:e.fullscreenchange,fullscreenerror:e.fullscreenerror},n={request(t){return new Promise((r,i)=>{let a=function(){n.off(`fullscreenchange`,a),r()};n.on(`fullscreenchange`,a),t||=document.documentElement;let o=t[e.requestFullscreen]();o instanceof Promise&&o.then(a).catch(i)})},exit(){return new Promise((t,r)=>{if(!n.isFullscreen){t();return}let i=function(){n.off(`fullscreenchange`,i),t()};n.on(`fullscreenchange`,i);let a=document[e.exitFullscreen]();a instanceof Promise&&a.then(i).catch(r)})},on(e,n){let r=t[e];r&&document.addEventListener(r,n)},off(e,n){let r=t[e];r&&document.removeEventListener(r,n)}};return Object.defineProperties(n,{isFullscreen:{get(){return!!document[e.fullscreenElement]}},element:{enumerable:!0,get(){return document[e.fullscreenElement]}},isEnabled:{enumerable:!0,get(){return!!document[e.fullscreenEnabled]}}}),n}var Zg={role:`viewer`,autoPlayMuted:!0,allowedDrift:.3,maxAllowedDrift:1,minCheckInterval:.1,maxRateAdjustment:.2,maxTimeToCatchUp:1},Qg=class extends EventTarget{logger;constructor(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},r=arguments.length>3?arguments[3]:void 0;super(),this.logger=r,this.init(t,e,{...Zg,...n})}disconnect(){this.dispatchEvent(new Event(`disconnect`))}async init(e,t,n){if(await this.waitForTOReadyState(e,`open`),n.role===`viewer`){await this.updatePlayer(e,t,n);let r=Tg(e,`change`,()=>this.updatePlayer(e,t,n)),i=this.maintainPlaybackPosition(e,t,n);this.addEventListener(`disconnect`,()=>{i.cancel(),r.cancel()})}else{await this.updateTimingObject(e,t);let n=Tg(t,[`seeked`,`play`,`pause`,`ratechange`],()=>this.updateTimingObject(e,t),`on`,`off`);this.addEventListener(`disconnect`,()=>n.cancel())}}async updateTimingObject(e,t){let[n,r,i]=await Promise.all([t.getCurrentTime(),t.getPaused(),t.getPlaybackRate()]);e.update({position:n,velocity:r?0:i})}async updatePlayer(e,t,n){let{position:r,velocity:i}=e.query();typeof r==`number`&&t.setCurrentTime(r),typeof i==`number`&&(i===0?await t.getPaused()===!1&&t.pause():i>0&&(await t.getPaused()===!0&&(await t.play().catch(async e=>{e.name===`NotAllowedError`&&n.autoPlayMuted&&(await t.setMuted(!0),await t.play().catch(e=>console.error(`Couldn't play the video from TimingSrcConnector. Error:`,e)))}),this.updatePlayer(e,t,n)),await t.getPlaybackRate()!==i&&t.setPlaybackRate(i)))}maintainPlaybackPosition(e,t,n){let{allowedDrift:r,maxAllowedDrift:i,minCheckInterval:a,maxRateAdjustment:o,maxTimeToCatchUp:s}=n,c=Math.min(s,Math.max(a,i))*1e3,l=async()=>{if(e.query().velocity===0||await t.getPaused()===!0)return;let n=e.query().position-await t.getCurrentTime(),a=Math.abs(n);if(this.log(`Drift: ${n}`),a>i)await this.adjustSpeed(t,0),t.setCurrentTime(e.query().position),this.log(`Resync by currentTime`);else if(a>r){let e=a/s,r=o,i=e<r?(r-e)/2:r;await this.adjustSpeed(t,i*Math.sign(n)),this.log(`Resync by playbackRate`)}},u=setInterval(()=>l(),c);return{cancel:()=>clearInterval(u)}}log(e){this.logger?.(`TimingSrcConnector: ${e}`)}speedAdjustment=0;adjustSpeed=async(e,t)=>{if(this.speedAdjustment===t)return;let n=await e.getPlaybackRate()-this.speedAdjustment+t;this.log(`New playbackRate: ${n}`),await e.setPlaybackRate(n),this.speedAdjustment=t};waitForTOReadyState(e,t){return new Promise(n=>{let r=()=>{e.readyState===t?n():e.addEventListener(`readystatechange`,r,{once:!0})};r()})}},$g=new WeakMap,e_=new WeakMap,t_={},n_=class{constructor(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(window.jQuery&&e instanceof jQuery&&(e.length>1&&window.console&&console.warn&&console.warn(`A jQuery object with multiple elements was passed, using the first element.`),e=e[0]),typeof document<`u`&&typeof e==`string`&&(e=document.getElementById(e)),!yg(e))throw TypeError(`You must pass either a valid element or a valid id.`);if(e.nodeName!==`IFRAME`){let t=e.querySelector(`iframe`);t&&(e=t)}if(e.nodeName===`IFRAME`&&!xg(e.getAttribute(`src`)||``))throw Error(`The player element passed isn’t a Vimeo embed.`);if($g.has(e))return $g.get(e);this._window=e.ownerDocument.defaultView,this.element=e,this.origin=`*`;let n=new jg((n,r)=>{if(this._onMessage=e=>{if(!xg(e.origin)||this.element.contentWindow!==e.source)return;this.origin===`*`&&(this.origin=e.origin);let t=Rg(e.data);if(t&&t.event===`error`&&t.data&&t.data.method===`ready`){let e=Error(t.data.message);e.name=t.data.name,r(e);return}let i=t&&t.event===`ready`,a=t&&t.method===`ping`;if(i||a){this.element.setAttribute(`data-ready`,`true`),n();return}Bg(this,t)},this._window.addEventListener(`message`,this._onMessage),this.element.nodeName!==`IFRAME`){let n=Hg(e,t);Wg(wg(n),n,e).then(t=>{let n=Ug(t,e);return this.element=n,this._originalElement=e,Lg(e,n),$g.set(this.element,this),t}).catch(r)}});if(e_.set(this,n),$g.set(this.element,this),this.element.nodeName===`IFRAME`&&zg(this,`ping`),t_.isEnabled){let e=()=>t_.exit();this.fullscreenchangeHandler=()=>{t_.isFullscreen?Ng(this,`event:exitFullscreen`,e):Fg(this,`event:exitFullscreen`,e),this.ready().then(()=>{zg(this,`fullscreenchange`,t_.isFullscreen)})},t_.on(`fullscreenchange`,this.fullscreenchangeHandler)}return this}static isVimeoUrl(e){return xg(e)}callMethod(e){var t=[...arguments].slice(1);if(e==null)throw TypeError(`You must pass a method name.`);return new jg((n,r)=>this.ready().then(()=>{Ng(this,e,{resolve:n,reject:r}),t.length===0?t={}:t.length===1&&(t=t[0]),zg(this,e,t)}).catch(r))}get(e){return new jg((t,n)=>(e=vg(e,`get`),this.ready().then(()=>{Ng(this,e,{resolve:t,reject:n}),zg(this,e)}).catch(n)))}set(e,t){return new jg((n,r)=>{if(e=vg(e,`set`),t==null)throw TypeError(`There must be a value to set.`);return this.ready().then(()=>{Ng(this,e,{resolve:n,reject:r}),zg(this,e,t)}).catch(r)})}on(e,t){if(!e)throw TypeError(`You must pass an event name.`);if(!t)throw TypeError(`You must pass a callback function.`);if(typeof t!=`function`)throw TypeError(`The callback must be a function.`);Pg(this,`event:${e}`).length===0&&this.callMethod(`addEventListener`,e).catch(()=>{}),Ng(this,`event:${e}`,t)}off(e,t){if(!e)throw TypeError(`You must pass an event name.`);if(t&&typeof t!=`function`)throw TypeError(`The callback must be a function.`);Fg(this,`event:${e}`,t)&&this.callMethod(`removeEventListener`,e).catch(e=>{})}loadVideo(e){return this.callMethod(`loadVideo`,e)}ready(){let e=e_.get(this)||new jg((e,t)=>{t(Error(`Unknown player. Probably unloaded.`))});return jg.resolve(e)}addCuePoint(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return this.callMethod(`addCuePoint`,{time:e,data:t})}removeCuePoint(e){return this.callMethod(`removeCuePoint`,e)}enableTextTrack(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(!e)throw TypeError(`You must pass a language.`);return this.callMethod(`enableTextTrack`,{language:e,kind:t,showing:n})}disableTextTrack(){return this.callMethod(`disableTextTrack`)}selectAudioTrack(e,t){if(!e)throw TypeError(`You must pass a language.`);return this.callMethod(`selectAudioTrack`,{language:e,kind:t})}selectDefaultAudioTrack(){return this.callMethod(`selectDefaultAudioTrack`)}pause(){return this.callMethod(`pause`)}play(){return this.callMethod(`play`)}requestFullscreen(){return t_.isEnabled?t_.request(this.element):this.callMethod(`requestFullscreen`)}exitFullscreen(){return t_.isEnabled?t_.exit():this.callMethod(`exitFullscreen`)}getFullscreen(){return t_.isEnabled?jg.resolve(t_.isFullscreen):this.get(`fullscreen`)}requestPictureInPicture(){return this.callMethod(`requestPictureInPicture`)}exitPictureInPicture(){return this.callMethod(`exitPictureInPicture`)}getPictureInPicture(){return this.get(`pictureInPicture`)}remotePlaybackPrompt(){return this.callMethod(`remotePlaybackPrompt`)}unload(){return this.callMethod(`unload`)}destroy(){return new jg(e=>{if(e_.delete(this),$g.delete(this.element),this._originalElement&&($g.delete(this._originalElement),this._originalElement.removeAttribute(`data-vimeo-initialized`)),this.element&&this.element.nodeName===`IFRAME`&&this.element.parentNode&&(this.element.parentNode.parentNode&&this._originalElement&&this._originalElement!==this.element.parentNode?this.element.parentNode.parentNode.removeChild(this.element.parentNode):this.element.parentNode.removeChild(this.element)),this.element&&this.element.nodeName===`DIV`&&this.element.parentNode){this.element.removeAttribute(`data-vimeo-initialized`);let e=this.element.querySelector(`iframe`);e&&e.parentNode&&(e.parentNode.parentNode&&this._originalElement&&this._originalElement!==e.parentNode?e.parentNode.parentNode.removeChild(e.parentNode):e.parentNode.removeChild(e))}this._window.removeEventListener(`message`,this._onMessage),t_.isEnabled&&t_.off(`fullscreenchange`,this.fullscreenchangeHandler),e()})}getAutopause(){return this.get(`autopause`)}setAutopause(e){return this.set(`autopause`,e)}getBuffered(){return this.get(`buffered`)}getCameraProps(){return this.get(`cameraProps`)}setCameraProps(e){return this.set(`cameraProps`,e)}getChapters(){return this.get(`chapters`)}getCurrentChapter(){return this.get(`currentChapter`)}getColor(){return this.get(`color`)}getColors(){return jg.all([this.get(`colorOne`),this.get(`colorTwo`),this.get(`colorThree`),this.get(`colorFour`)])}setColor(e){return this.set(`color`,e)}setColors(e){if(!Array.isArray(e))return new jg((e,t)=>t(TypeError(`Argument must be an array.`)));let t=new jg(e=>e(null)),n=[e[0]?this.set(`colorOne`,e[0]):t,e[1]?this.set(`colorTwo`,e[1]):t,e[2]?this.set(`colorThree`,e[2]):t,e[3]?this.set(`colorFour`,e[3]):t];return jg.all(n)}getCuePoints(){return this.get(`cuePoints`)}getCurrentTime(){return this.get(`currentTime`)}setCurrentTime(e){return this.set(`currentTime`,e)}getDuration(){return this.get(`duration`)}getEnded(){return this.get(`ended`)}getLoop(){return this.get(`loop`)}setLoop(e){return this.set(`loop`,e)}setMuted(e){return this.set(`muted`,e)}getMuted(){return this.get(`muted`)}getPaused(){return this.get(`paused`)}getPlaybackRate(){return this.get(`playbackRate`)}setPlaybackRate(e){return this.set(`playbackRate`,e)}getPlayed(){return this.get(`played`)}getQualities(){return this.get(`qualities`)}getQuality(){return this.get(`quality`)}setQuality(e){return this.set(`quality`,e)}getRemotePlaybackAvailability(){return this.get(`remotePlaybackAvailability`)}getRemotePlaybackState(){return this.get(`remotePlaybackState`)}getSeekable(){return this.get(`seekable`)}getSeeking(){return this.get(`seeking`)}getTextTracks(){return this.get(`textTracks`)}getAudioTracks(){return this.get(`audioTracks`)}getEnabledAudioTrack(){return this.get(`enabledAudioTrack`)}getDefaultAudioTrack(){return this.get(`defaultAudioTrack`)}getVideoEmbedCode(){return this.get(`videoEmbedCode`)}getVideoId(){return this.get(`videoId`)}getVideoTitle(){return this.get(`videoTitle`)}getVideoWidth(){return this.get(`videoWidth`)}getVideoHeight(){return this.get(`videoHeight`)}getVideoUrl(){return this.get(`videoUrl`)}getVolume(){return this.get(`volume`)}setVolume(e){return this.set(`volume`,e)}async setTimingSrc(e,t){if(!e)throw TypeError(`A Timing Object must be provided.`);await this.ready();let n=new Qg(this,e,t);return zg(this,`notifyTimingObjectConnect`),n.addEventListener(`disconnect`,()=>zg(this,`notifyTimingObjectDisconnect`)),n}};_g||(t_=Xg(),Gg(),Kg(),qg(),Jg(),Yg());function r_(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,i_(e,t)}function i_(e,t){return i_=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},i_(e,t)}var a_={play:`onPlay`,playing:`onPlaying`,pause:`onPause`,ended:`onEnd`,timeupdate:`onTimeUpdate`,progress:`onProgress`,seeked:`onSeeked`,texttrackchange:`onTextTrackChange`,cuechange:`onCueChange`,cuepoint:`onCuePoint`,volumechange:`onVolumeChange`,playbackratechange:`onPlaybackRateChange`,error:`onError`,loaded:`onLoaded`},o_=function(e){function t(t){var n=e.call(this,t)||this;return n.refContainer=n.refContainer.bind(n),n}r_(t,e);var n=t.prototype;return n.componentDidMount=function(){this.createPlayer()},n.componentDidUpdate=function(e){var t=this,n=Object.keys(this.props).filter(function(n){return t.props[n]!==e[n]});this.updateProps(n)},n.componentWillUnmount=function(){this.player.destroy()},n.getInitialOptions=function(){var e,t=this.props.video,n=/^https?:/i.test(t)?`url`:`id`;return e={},e[n]=t,e.width=this.props.width,e.height=this.props.height,e.autopause=this.props.autopause,e.autoplay=this.props.autoplay,e.byline=this.props.showByline,e.color=this.props.color,e.controls=this.props.controls,e.loop=this.props.loop,e.portrait=this.props.showPortrait,e.title=this.props.showTitle,e.muted=this.props.muted,e.background=this.props.background,e.responsive=this.props.responsive,e.dnt=this.props.dnt,e.speed=this.props.speed,e.keyboard=this.props.keyboard,e.pip=this.props.pip,e.playsinline=this.props.playsInline,e.quality=this.props.quality,e.texttrack=this.props.textTrack,e.transparent=this.props.transparent,e},n.updateProps=function(e){var t=this,n=this.player;e.forEach(function(e){var r=t.props[e];switch(e){case`autopause`:n.setAutopause(r);break;case`color`:n.setColor(r);break;case`loop`:n.setLoop(r);break;case`volume`:n.setVolume(r);break;case`paused`:n.getPaused().then(function(e){return r&&!e?n.pause():!r&&e?n.play():null});break;case`width`:case`height`:n.element[e]=r;break;case`video`:if(r){var i=t.props.start,a=n.loadVideo(r);typeof i==`number`&&a.then(function(){n.setCurrentTime(i)})}else n.unload();break;case`playbackRate`:n.setPlaybackRate(r);break;case`quality`:n.setQuality(r);break}})},n.createPlayer=function(){var e=this,t=this.props,n=t.start,r=t.volume,i=t.playbackRate;this.player=new n_(this.container,this.getInitialOptions()),Object.keys(a_).forEach(function(t){var n=a_[t];e.player.on(t,function(t){var r=e.props[n];r&&r(t)})});var a=this.props,o=a.onError,s=a.onReady;this.player.ready().then(function(){s&&s(e.player)},function(e){if(o)o(e);else throw e}),typeof n==`number`&&this.player.setCurrentTime(n),typeof r==`number`&&this.updateProps([`volume`]),typeof i==`number`&&this.updateProps([`playbackRate`])},n.refContainer=function(e){this.container=e},n.render=function(){var e=this.props,t=e.id,n=e.className,r=e.style;return Q.createElement(`div`,{id:t,className:n,style:r,ref:this.refContainer})},t}(Q.Component);o_.defaultProps={autopause:!0,autoplay:!1,showByline:!0,controls:!0,loop:!1,showPortrait:!0,showTitle:!0,muted:!1,background:!1,responsive:!1,dnt:!1,speed:!1,keyboard:!0,pip:!1,playsInline:!0,transparent:!0};var s_={default:120,mqdefault:320,hqdefault:480,sddefault:640,maxresdefault:1280},c_=(e,t,n,r=`maxresdefault`)=>{let[i,a]=(0,Q.useState)(``);return(0,Q.useEffect)(()=>{let i=`https://img.youtube.com/${t}/${e}/${r}.${n}`,o=`https://img.youtube.com/${t}/${e}/hqdefault.${n}`,s=s_[r],c=new Image;c.onload=()=>{c.width<s?a(o):a(i)},c.onerror=()=>a(o),c.src=i},[e,t,n,r]),i};function l_(e,t,n,r,i){let a={"@context":`https://schema.org`,"@type":`VideoObject`,name:i?.name||t,thumbnailUrl:[i?.thumbnailUrl||n],embedUrl:i?.embedUrl||`${r}/embed/${e}`,contentUrl:i?.contentUrl||`https://www.youtube.com/watch?v=${e}`,...i?.description&&{description:i.description},...i?.uploadDate&&{uploadDate:i.uploadDate},...i?.duration&&{duration:i.duration}};return JSON.stringify(a)}function u_(e,t){let[n,r]=Q.useState(!1),[i,a]=Q.useState(e.alwaysLoadIframe||!1),o=encodeURIComponent(e.id),s=typeof e.playlistCoverId==`string`?encodeURIComponent(e.playlistCoverId):null,c=e.title,l=e.poster||`hqdefault`,u=e.announce||`Watch`,d=e.alwaysLoadIframe?e.autoplay&&e.muted:!0,f=Q.useMemo(()=>{let t=new URLSearchParams({...e.muted?{mute:`1`}:{},...d?{autoplay:`1`}:{},...e.enableJsApi?{enablejsapi:`1`}:{},...e.enableJsApi&&typeof window<`u`?{origin:window.location.origin}:{},...e.playlist?{list:o}:{}});return e.params&&new URLSearchParams(e.params.startsWith(`&`)?e.params.slice(1):e.params).forEach((e,n)=>{t.append(n,e)}),t},[e.muted,d,e.enableJsApi,e.playlist,o,e.params]),p=Q.useMemo(()=>e.cookie?`https://www.youtube.com`:`https://www.youtube-nocookie.com`,[e.cookie]),m=Q.useMemo(()=>e.playlist?`${p}/embed/videoseries?${f.toString()}`:`${p}/embed/${o}?${f.toString()}`,[e.playlist,p,o,f]),h=!e.thumbnail&&!e.playlist&&l===`maxresdefault`,g=e.webp?`webp`:`jpg`,_=e.webp?`vi_webp`:`vi`,v=h?c_(e.id,_,g,l):null,y=Q.useMemo(()=>e.thumbnail||v||`https://i.ytimg.com/${_}/${e.playlist?s:o}/${l}.${g}`,[e.thumbnail,v,_,e.playlist,s,o,l,g]),b=e.activatedClass||`lyt-activated`,x=e.adNetwork||!1,S=e.aspectHeight||9,C=e.aspectWidth||16,w=e.iframeClass||``,T=e.playerClass||`lty-playbtn`,E=e.wrapperClass||`yt-lite`,D=Q.useCallback(e.onIframeAdded||function(){},[e.onIframeAdded]),O=e.rel?`prefetch`:`preload`,k=e.containerElement||`article`,A=e.noscriptFallback!==!1,j=()=>{n||r(!0)},M=()=>{i||a(!0)};return Q.useEffect(()=>{i&&(D(),e.focusOnLoad&&typeof t==`object`&&t?.current&&t.current.focus())},[i,D,e.focusOnLoad,t]),Q.useEffect(()=>{if(!i||!e.enableJsApi||!(e.onReady||e.onStateChange||e.onError||e.onPlay||e.onPause||e.onEnd||e.onBuffering||e.onPlaybackRateChange||e.onPlaybackQualityChange))return;let n=!1,r=!1,a=r=>{if(r.origin!==`https://www.youtube.com`&&r.origin!==`https://www.youtube-nocookie.com`)return;let i;try{i=typeof r.data==`string`?JSON.parse(r.data):r.data}catch{return}switch(i.event){case`onReady`:n||(n=!0,e.onReady&&e.onReady({videoId:e.id,title:c}));break;case`infoDelivery`:if(i.info?.playerState!==void 0){let n=i.info.playerState;switch(e.onStateChange&&e.onStateChange({state:n,currentTime:i.info.currentTime,duration:i.info.duration}),n){case 1:e.onPlay?.();break;case 2:e.onPause?.();break;case 0:e.onEnd?.(),e.stopOnEnd&&typeof t==`object`&&t?.current?.contentWindow&&t.current.contentWindow.postMessage(`{"event":"command","func":"stopVideo","args":""}`,`*`);break;case 3:e.onBuffering?.();break}}i.info?.playbackRate!==void 0&&e.onPlaybackRateChange?.(i.info.playbackRate),i.info?.playbackQuality!==void 0&&e.onPlaybackQualityChange?.(i.info.playbackQuality);break;case`onStateChange`:if(i.info?.playerState!==void 0){let n=i.info.playerState;switch(e.onStateChange&&e.onStateChange({state:n,currentTime:i.info.currentTime,duration:i.info.duration}),n){case 1:e.onPlay?.();break;case 2:e.onPause?.();break;case 0:e.onEnd?.(),e.stopOnEnd&&typeof t==`object`&&t?.current?.contentWindow&&t.current.contentWindow.postMessage(`{"event":"command","func":"stopVideo","args":""}`,`*`);break;case 3:e.onBuffering?.();break}}break;case`onError`:if(i.info&&`errorCode`in i.info){let t=i.info.errorCode;e.onError&&e.onError(t)}break;case`onPlaybackRateChange`:i.info?.playbackRate!==void 0&&e.onPlaybackRateChange?.(i.info.playbackRate);break;case`onPlaybackQualityChange`:i.info?.playbackQuality!==void 0&&e.onPlaybackQualityChange?.(i.info.playbackQuality);break}};window.addEventListener(`message`,a);let s=[],l=()=>{typeof t==`object`&&t?.current?.contentWindow&&t.current.contentWindow.postMessage(`{"event":"listening","id":"`+o+`"}`,`*`)},u=()=>{r||(r=!0,l(),[100,300,600,1200,2400].forEach(e=>{s.push(setTimeout(l,e))}))};return typeof t==`object`&&t?.current?(t.current.addEventListener(`load`,u),t.current.contentDocument?.readyState===`complete`&&u()):[200,500,1e3,2e3,3e3].forEach(e=>{s.push(setTimeout(l,e))}),()=>{window.removeEventListener(`message`,a),s.forEach(clearTimeout),typeof t==`object`&&t?.current&&t.current.removeEventListener(`load`,u)}},[i,e.enableJsApi,e.onReady,e.onStateChange,e.onError,e.onPlay,e.onPause,e.onEnd,e.onBuffering,e.onPlaybackRateChange,e.onPlaybackQualityChange,e.stopOnEnd,e.id,o,c,t]),(0,$.jsxs)($.Fragment,{children:[!e.lazyLoad&&(0,$.jsx)(`link`,{rel:O,href:y,as:`image`}),(0,$.jsx)($.Fragment,{children:n&&(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(`link`,{rel:`preconnect`,href:p}),(0,$.jsx)(`link`,{rel:`preconnect`,href:`https://www.google.com`}),x&&(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(`link`,{rel:`preconnect`,href:`https://static.doubleclick.net`}),(0,$.jsx)(`link`,{rel:`preconnect`,href:`https://googleads.g.doubleclick.net`})]})]})}),e.seo&&!e.playlist&&(0,$.jsx)(`script`,{type:`application/ld+json`,dangerouslySetInnerHTML:{__html:l_(e.id,c,y,p,e.seo)}}),A&&!e.playlist&&(0,$.jsx)(`noscript`,{children:(0,$.jsxs)(`a`,{href:`https://www.youtube.com/watch?v=${e.id}`,"aria-label":`Watch ${c} on YouTube`,children:[`Watch "`,c,`" on YouTube`]})}),(0,$.jsxs)(k,{onPointerOver:j,onClick:M,className:`${E} ${i?b:``}`,"data-title":c,role:!i&&!e.lazyLoad?`img`:void 0,"aria-label":i?void 0:`${c} - YouTube video preview`,style:{...!e.lazyLoad&&{backgroundImage:`url(${y})`},"--aspect-ratio":`${S/C*100}%`,...e.style||{}},children:[e.lazyLoad&&!i&&(0,$.jsx)(`img`,{src:y,alt:`${c} - YouTube thumbnail`,className:`lty-thumbnail`,loading:`lazy`}),e.playlist&&!i&&(0,$.jsx)(`div`,{className:`lty-playlist-icon`,"aria-hidden":`true`}),!(e.hideButtonOnActivate&&i)&&(0,$.jsx)(`button`,{type:`button`,className:T,"aria-label":`${u} ${c}`,"aria-hidden":i||void 0,tabIndex:i?-1:0,onClick:M,children:(0,$.jsx)(`span`,{className:`lty-visually-hidden`,children:u})}),i&&(0,$.jsx)(`iframe`,{ref:t,className:w,title:c,width:`560`,height:`315`,allow:`accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture`,allowFullScreen:!0,src:m,referrerPolicy:e.referrerPolicy||`strict-origin-when-cross-origin`})]})]})}var d_=Q.forwardRef(u_);function f_(e){return e!==!1}function p_(e,t){let n=[];return t.startSeconds!==null&&n.push(`start=${t.startSeconds}`),e.controls===!1&&n.push(`controls=0`),e.loop===!0&&n.push(`loop=1`,`playlist=${t.id}`),e.playsinline===!0&&n.push(`playsinline=1`),n.length>0?n.join(`&`):void 0}function m_(e){if(e.width!==void 0)return{width:e.width}}function h_(e){if(!(e.width===void 0||e.height===void 0))return{aspectRatio:`${e.width} / ${e.height}`}}function g_(e){let t=(0,Z.c)(23),n=(0,Q.useRef)(null),r=e.title??`Vimeo video player`,i;t[0]===r?i=t[1]:(i=e=>{let t=e;n.current=t,t.element&&(t.element.title=r)},t[0]=r,t[1]=i);let a=i,o,s;t[2]===r?(o=t[3],s=t[4]):(o=()=>{let e=n.current;e?.element&&(e.element.title=r)},s=[r],t[2]=r,t[3]=o,t[4]=s),(0,Q.useEffect)(o,s);let c;t[5]===e?c=t[6]:(c=m_(e),t[5]=e,t[6]=c);let l=e.width===void 0,u=e.autoplay===!0,d=e.muted===!0,f=e.muted===!0?0:1,p=e.loop===!0,m=e.controls!==!1,h=e.playsinline!==!1,g;t[7]!==a||t[8]!==e.height||t[9]!==e.src||t[10]!==e.width||t[11]!==h||t[12]!==l||t[13]!==u||t[14]!==d||t[15]!==f||t[16]!==p||t[17]!==m?(g=(0,$.jsx)(o_,{video:e.src,responsive:l,width:e.width,height:e.height,autoplay:u,muted:d,volume:f,loop:p,controls:m,playsInline:h,onReady:a}),t[7]=a,t[8]=e.height,t[9]=e.src,t[10]=e.width,t[11]=h,t[12]=l,t[13]=u,t[14]=d,t[15]=f,t[16]=p,t[17]=m,t[18]=g):g=t[18];let _;return t[19]!==e.title||t[20]!==g||t[21]!==c?(_=(0,$.jsx)(`div`,{className:`ok-video ok-video-vimeo`,style:c,title:e.title,children:g}),t[19]=e.title,t[20]=g,t[21]=c,t[22]=_):_=t[22],_}function __(e){let t=(0,Z.c)(17),n;t[0]===e.src?n=t[1]:(n=Ct(e.src),t[0]=e.src,t[1]=n);let r=n;if(!r)return null;let i;t[2]!==r.startRaw||t[3]!==e.autoplay||t[4]!==e.muted?(i=[],r.startRaw!==null&&i.push(`t=${r.startRaw}`),e.autoplay===!0&&i.push(`autoplay=true`),e.muted===!0&&i.push(`muted=true`),t[2]=r.startRaw,t[3]=e.autoplay,t[4]=e.muted,t[5]=i):i=t[5];let a=i.length>0?`https://www.loom.com/embed/${r.id}?${i.join(`&`)}`:`https://www.loom.com/embed/${r.id}`,o;t[6]===e?o=t[7]:(o=m_(e),t[6]=e,t[7]=o);let s=e.title??`Loom video player`,c;t[8]!==a||t[9]!==e.height||t[10]!==e.width||t[11]!==s?(c=(0,$.jsx)(`iframe`,{className:`ok-video-loom-iframe`,src:a,title:s,width:e.width,height:e.height,allow:`autoplay; fullscreen`,referrerPolicy:`strict-origin-when-cross-origin`,allowFullScreen:!0}),t[8]=a,t[9]=e.height,t[10]=e.width,t[11]=s,t[12]=c):c=t[12];let l;return t[13]!==e.title||t[14]!==o||t[15]!==c?(l=(0,$.jsx)(`div`,{className:`ok-video ok-video-loom`,style:o,title:e.title,children:c}),t[13]=e.title,t[14]=o,t[15]=c,t[16]=l):l=t[16],l}function v_(e){let t=(0,Z.c)(29);if(e.src!==void 0&&In(e.src)){let n;return t[0]===e?n=t[1]:(n=(0,$.jsx)(__,{...e,src:e.src}),t[0]=e,t[1]=n),n}if(e.src!==void 0&&br(e.src)){let n;return t[2]===e?n=t[3]:(n=(0,$.jsx)(g_,{...e,src:e.src}),t[2]=e,t[3]=n),n}let n;if(t[4]!==e){n=Symbol.for(`react.early_return_sentinel`);bb0:{let r=e.src===void 0?null:on(e.src);if(r!==null){let i=e.autoplay===!0&&e.muted===!0,a=e.width!==void 0&&e.height!==void 0,o=m_(e),s;t[6]===e.poster?s=t[7]:(s=e.poster===void 0?void 0:vn(e.poster),t[6]=e.poster,t[7]=s);let c=(0,$.jsx)(d_,{id:r.id,title:e.title??`YouTube video player`,cookie:!r.noCookie,params:p_(e,r),muted:e.muted===!0,autoplay:e.autoplay===!0,alwaysLoadIframe:i,thumbnail:s,aspectWidth:a?Number(e.width):void 0,aspectHeight:a?Number(e.height):void 0,style:h_(e)}),l;t[8]!==o||t[9]!==c?(l=(0,$.jsx)(`div`,{className:`ok-video ok-video-youtube`,style:o,children:c}),t[8]=o,t[9]=c,t[10]=l):l=t[10],n=l;break bb0}}t[4]=e,t[5]=n}else n=t[5];if(n!==Symbol.for(`react.early_return_sentinel`))return n;let r;t[11]===e.src?r=t[12]:(r=e.src===void 0?void 0:vn(e.src),t[11]=e.src,t[12]=r);let i=e.title,a;t[13]===e.controls?a=t[14]:(a=f_(e.controls),t[13]=e.controls,t[14]=a);let o;t[15]===e.poster?o=t[16]:(o=e.poster===void 0?void 0:vn(e.poster),t[15]=e.poster,t[16]=o);let s;return t[17]!==e.autoplay||t[18]!==e.height||t[19]!==e.loop||t[20]!==e.muted||t[21]!==e.playsinline||t[22]!==e.preload||t[23]!==e.title||t[24]!==e.width||t[25]!==r||t[26]!==a||t[27]!==o?(s=(0,$.jsx)(`video`,{className:`ok-video`,src:r,title:i,controls:a,autoPlay:e.autoplay,muted:e.muted,loop:e.loop,playsInline:e.playsinline,poster:o,preload:e.preload,width:e.width,height:e.height}),t[17]=e.autoplay,t[18]=e.height,t[19]=e.loop,t[20]=e.muted,t[21]=e.playsinline,t[22]=e.preload,t[23]=e.title,t[24]=e.width,t[25]=r,t[26]=a,t[27]=o,t[28]=s):s=t[28],s}function y_(e){let t=(0,Z.c)(2),n;return t[0]===e.children?n=t[1]:(n=(0,$.jsx)(`div`,{className:`prose-no-margin`,children:e.children}),t[0]=e.children,t[1]=n),n}var b_={Callout:Mm,img:Th,video:v_,audio:Dm,Pdf:$h,File:Hm,Embed:Bm,Accordion:Tm,Tabs:ug,Tab:og,Math:Oh,MermaidFence:ne,Mirror:zh,MirrorSource:Bh,"*":y_};function x_(e){let t=new Set;for(let n of e)n.type===`reactnode`&&t.add(n.name);return t}var S_=Lt(),C_=new Map;function w_(e){if(e.surface===`compat`){let t=b_[e.rendersAs];if(!t)throw Error(`Compat descriptor '${e.name}' declares rendersAs: '${e.rendersAs}', but no React component is registered under that name in componentMap. Add the canonical component before registering the compat descriptor.`);return{Component:t,reactNodePropNames:x_(e.props)}}let t=b_[e.name];return t?{Component:t,reactNodePropNames:x_(e.props)}:null}for(let[e,t]of S_.entries()){let n=w_(t);n&&C_.set(e,n)}function T_(e,t){return{...e,Component:t.Component,reactNodePropNames:t.reactNodePropNames}}function E_(e){let t=S_.getOrWildcard(e),n=C_.get(t.name)??C_.get(`*`);if(!n)throw Error(`No React component registered for ${t.name} (and no '*' wildcard)`);return T_(t,n)}function D_(){let e=[];for(let[t,n]of S_.entries()){if(t===`*`)continue;let r=C_.get(t);r&&e.push(T_(n,r))}return e}var O_=``+new URL(`image-preview-BJSGEOo4.png`,import.meta.url).href,k_=``+new URL(`video-preview-vLovc_Vy.png`,import.meta.url).href,A_={Callout:{description:{id:`322lyb`},props:{type:`note`,title:`Heads up`},children:`Callouts draw attention to key information.`},Accordion:{description:{id:`mWVJRX`},props:{title:`Click to expand`,defaultOpen:!0},children:`Hidden content goes here.`},img:{description:{id:`VUijjF`},props:{src:O_,alt:`Sample image`}},video:{description:{id:`e1hptq`},props:{controls:!0,poster:k_}},audio:{description:{id:`9jnjV0`},props:{controls:!0}},Math:{description:{id:`Y-Urt2`},props:{formula:`c = \\pm\\sqrt{a^2 + b^2}`}},Embed:{description:{id:`jTLWxh`},render:()=>(0,$.jsxs)(`div`,{className:`flex h-full w-full flex-col overflow-hidden rounded-md border border-border bg-background`,children:[(0,$.jsxs)(`div`,{className:`flex items-center gap-1.5 border-b border-border bg-muted/40 px-2 py-1.5`,children:[(0,$.jsx)(`span`,{className:`size-1.5 rounded-full bg-muted-foreground/40`}),(0,$.jsx)(`span`,{className:`size-1.5 rounded-full bg-muted-foreground/40`}),(0,$.jsx)(`span`,{className:`size-1.5 rounded-full bg-muted-foreground/40`}),(0,$.jsx)(`span`,{className:`ml-1.5 flex-1 truncate rounded-sm bg-background px-1.5 py-0.5 font-mono text-[10px] text-muted-foreground`,children:`https://example.com/embed`})]}),(0,$.jsxs)(`div`,{className:`flex flex-1 flex-col justify-center gap-1.5 px-3 py-2`,children:[(0,$.jsx)(`span`,{className:`h-1.5 w-3/4 rounded-sm bg-muted-foreground/30`}),(0,$.jsx)(`span`,{className:`h-1.5 w-full rounded-sm bg-muted-foreground/20`}),(0,$.jsx)(`span`,{className:`h-1.5 w-5/6 rounded-sm bg-muted-foreground/20`}),(0,$.jsx)(`span`,{className:`h-1.5 w-2/3 rounded-sm bg-muted-foreground/20`})]})]})},Pdf:{description:{id:`Fqr8BP`},render:()=>(0,$.jsxs)(`div`,{className:`flex h-full w-full flex-col overflow-hidden rounded-md border border-border bg-background`,children:[(0,$.jsxs)(`div`,{className:`flex items-center gap-1 border-b border-border bg-muted/40 px-1.5 py-1`,children:[(0,$.jsxs)(`svg`,{viewBox:`0 0 12 12`,className:`size-3 text-muted-foreground`,"aria-hidden":`true`,children:[(0,$.jsx)(`title`,{children:`Thumbnails`}),(0,$.jsx)(`rect`,{x:`1`,y:`1`,width:`4`,height:`4`,fill:`currentColor`,rx:`0.5`}),(0,$.jsx)(`rect`,{x:`7`,y:`1`,width:`4`,height:`4`,fill:`currentColor`,rx:`0.5`}),(0,$.jsx)(`rect`,{x:`1`,y:`7`,width:`4`,height:`4`,fill:`currentColor`,rx:`0.5`}),(0,$.jsx)(`rect`,{x:`7`,y:`7`,width:`4`,height:`4`,fill:`currentColor`,rx:`0.5`})]}),(0,$.jsxs)(`span`,{className:`ml-1 flex items-center gap-1 text-[10px] text-muted-foreground`,children:[(0,$.jsx)(`span`,{className:`rounded-sm bg-background px-1 py-0.5 font-mono`,children:`2`}),(0,$.jsx)(`span`,{children:`/ 12`})]}),(0,$.jsxs)(`span`,{className:`ml-auto flex items-center gap-1 text-[10px] font-mono text-muted-foreground`,children:[(0,$.jsx)(`span`,{className:`rounded-sm bg-background px-1 py-0.5`,children:`−`}),(0,$.jsx)(`span`,{children:`100%`}),(0,$.jsx)(`span`,{className:`rounded-sm bg-background px-1 py-0.5`,children:`+`})]})]}),(0,$.jsxs)(`div`,{className:`flex flex-1 gap-1 p-1.5`,children:[(0,$.jsxs)(`div`,{className:`flex w-6 flex-col gap-0.5`,children:[(0,$.jsx)(`span`,{className:`h-3 rounded-sm bg-muted-foreground/20`}),(0,$.jsx)(`span`,{className:`h-3 rounded-sm border border-foreground/60 bg-background`}),(0,$.jsx)(`span`,{className:`h-3 rounded-sm bg-muted-foreground/20`})]}),(0,$.jsxs)(`div`,{className:`flex flex-1 flex-col gap-1 rounded-sm bg-background p-1.5`,children:[(0,$.jsx)(`span`,{className:`h-1.5 w-1/2 rounded-sm bg-foreground/50`}),(0,$.jsx)(`span`,{className:`h-1 w-full rounded-sm bg-muted-foreground/30`}),(0,$.jsx)(`span`,{className:`h-1 w-5/6 rounded-sm bg-muted-foreground/30`}),(0,$.jsx)(`span`,{className:`h-1 w-full rounded-sm bg-muted-foreground/30`}),(0,$.jsx)(`span`,{className:`h-1 w-2/3 rounded-sm bg-muted-foreground/30`})]})]})]})},MermaidFence:{description:{id:`z0a2EA`},render:()=>(0,$.jsxs)(`svg`,{viewBox:`0 0 200 120`,className:`h-full w-full text-foreground`,"aria-hidden":`true`,preserveAspectRatio:`xMidYMid meet`,children:[(0,$.jsx)(`title`,{children:`Mermaid flowchart preview`}),(0,$.jsx)(`defs`,{children:(0,$.jsx)(`marker`,{id:`mermaid-preview-arrow`,viewBox:`0 0 10 10`,refX:`9`,refY:`5`,markerWidth:`6`,markerHeight:`6`,orient:`auto-start-reverse`,children:(0,$.jsx)(`path`,{d:`M 0 0 L 10 5 L 0 10 z`,fill:`currentColor`})})}),(0,$.jsx)(`rect`,{x:`14`,y:`20`,width:`56`,height:`28`,rx:`14`,fill:`currentColor`,fillOpacity:`0.1`,stroke:`currentColor`,strokeOpacity:`0.7`}),(0,$.jsx)(`text`,{x:`42`,y:`38`,textAnchor:`middle`,fontSize:`10`,fill:`currentColor`,children:`Start`}),(0,$.jsx)(`polygon`,{points:`100,18 140,50 100,82 60,50`,fill:`currentColor`,fillOpacity:`0.1`,stroke:`currentColor`,strokeOpacity:`0.7`}),(0,$.jsx)(`text`,{x:`100`,y:`54`,textAnchor:`middle`,fontSize:`10`,fill:`currentColor`,children:`Ready?`}),(0,$.jsx)(`rect`,{x:`130`,y:`84`,width:`56`,height:`28`,rx:`14`,fill:`currentColor`,fillOpacity:`0.1`,stroke:`currentColor`,strokeOpacity:`0.7`}),(0,$.jsx)(`text`,{x:`158`,y:`102`,textAnchor:`middle`,fontSize:`10`,fill:`currentColor`,children:`End`}),(0,$.jsx)(`line`,{x1:`70`,y1:`34`,x2:`80`,y2:`40`,stroke:`currentColor`,strokeOpacity:`0.7`,strokeWidth:`1.2`,markerEnd:`url(#mermaid-preview-arrow)`}),(0,$.jsx)(`line`,{x1:`124`,y1:`62`,x2:`138`,y2:`82`,stroke:`currentColor`,strokeOpacity:`0.7`,strokeWidth:`1.2`,markerEnd:`url(#mermaid-preview-arrow)`}),(0,$.jsx)(`text`,{x:`138`,y:`74`,fontSize:`8`,fill:`currentColor`,opacity:`0.6`,children:`yes`})]})},Tabs:{description:{id:`75Y1dk`},render:()=>(0,$.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,$.jsxs)(`div`,{className:`flex gap-1 border-b border-border pb-1`,children:[(0,$.jsx)(`span`,{className:`rounded-md bg-foreground/10 px-2 py-0.5 text-xs font-medium text-foreground`,children:`Tab 1`}),(0,$.jsx)(`span`,{className:`rounded-md px-2 py-0.5 text-xs text-muted-foreground`,children:`Tab 2`})]}),(0,$.jsx)(`p`,{className:`px-1 text-xs text-muted-foreground`,children:(0,$.jsx)(a,{id:`m6YGpY`})})]})},Mirror:{description:{id:`_WPP7e`},render:()=>(0,$.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,$.jsxs)(`div`,{className:`relative rounded-md border border-dashed border-border/40 px-2 py-1.5`,children:[(0,$.jsxs)(`span`,{className:`absolute -top-2 right-1.5 flex items-center gap-1 rounded-md bg-background px-1 text-[10px] text-muted-foreground`,children:[(0,$.jsx)(ro,{className:`size-2.5`,"aria-hidden":`true`}),(0,$.jsx)(`span`,{children:(0,$.jsx)(a,{id:`EL_YRd`,components:{0:(0,$.jsx)(`code`,{className:`font-mono`})}})})]}),(0,$.jsx)(`span`,{className:`block h-1.5 w-3/4 rounded-sm bg-muted-foreground/30`}),(0,$.jsx)(`span`,{className:`mt-1 block h-1.5 w-2/3 rounded-sm bg-muted-foreground/20`})]}),(0,$.jsx)(`p`,{className:`px-1 text-[10px] text-muted-foreground`,children:(0,$.jsx)(a,{id:`qNOgUu`})})]})},MirrorSource:{description:{id:`epuNYK`},render:()=>(0,$.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,$.jsxs)(`div`,{className:`relative rounded-md border border-dashed border-border/50 px-2 py-1.5`,children:[(0,$.jsxs)(`span`,{className:`absolute -top-2 left-1.5 flex items-center gap-1 rounded-md bg-background px-1 text-[10px] text-muted-foreground`,children:[(0,$.jsx)(Br,{className:`size-2.5`,"aria-hidden":`true`}),(0,$.jsx)(`span`,{children:(0,$.jsx)(a,{id:`maDWIB`,components:{0:(0,$.jsx)(`code`,{className:`font-mono`})}})})]}),(0,$.jsx)(`span`,{className:`block h-1.5 w-4/5 rounded-sm bg-muted-foreground/30`}),(0,$.jsx)(`span`,{className:`mt-1 block h-1.5 w-3/5 rounded-sm bg-muted-foreground/20`})]}),(0,$.jsx)(`p`,{className:`px-1 text-[10px] text-muted-foreground`,children:(0,$.jsx)(a,{id:`emgiet`})})]})}};function j_(e){let t={};for(let n of e.props)n.type!==`reactnode`&&`defaultValue`in n&&n.defaultValue!==void 0&&(t[n.name]=n.defaultValue);return t}function M_(e){let t=E_(e),n=j_(t);return{type:`jsxComponent`,attrs:{componentName:t.name,kind:`element`,attributes:[],sourceRaw:``,sourceDirty:!0,props:n},content:t.hasChildren?[{type:`paragraph`}]:void 0}}var N_=new Set;function P_(e){N_.add(e)}function F_(e){if(typeof e==`number`)return N_.delete(e);let t=N_.values().next();return t.done?!1:(N_.delete(t.value),!0)}function I_(e,t,n){n.props.some(e=>!(`hidden`in e&&e.hidden)&&e.type!==`reactnode`)?(P_(t),requestAnimationFrame(()=>{e.commands.setNodeSelection(t)})):n.hasChildren?e.commands.setTextSelection(t+2):(P_(t),requestAnimationFrame(()=>{e.commands.setNodeSelection(t)}))}function L_(e){return t=>{let n=new WeakSet;t.state.doc.descendants(t=>{t.type.name===`jsxComponent`&&t.attrs.componentName===e.name&&n.add(t)});let r=M_(e.name);if(e.name===`Tabs`){let e=M_(`Tab`),t=M_(`Tab`),n=e.attrs,i=t.attrs;n.props={...n.props,label:`Tab 1`},i.props={...i.props,label:`Tab 2`},r.content=[e,t]}t.chain().focus().insertContent(r).run();let i=-1;t.state.doc.descendants((t,r)=>{if(i>=0)return!1;t.type.name===`jsxComponent`&&t.attrs.componentName===e.name&&!n.has(t)&&(i=r)}),!(i<0)&&I_(t,i,e)}}var R_=new Set([`File`,`Tab`]);function z_(){return[{name:`component-File`,label:Y._({id:`J2eKUI`}),icon:ao,category:`media`,aliases:[`file`,`attachment`,`download`,`upload`,`document`,`doc`,`docx`,`zip`],description:"Attach a downloadable file (`.pdf` / `.docx` / `.zip` / …)",insertsBlockComponent:!0,command:V_,preview:{description:Y._({id:`t-JXbf`}),render:()=>(0,$.jsxs)(`div`,{className:`flex w-full items-baseline gap-2 rounded-md px-2 py-1.5`,children:[(0,$.jsx)(ao,{className:`size-4 shrink-0 text-muted-foreground`,"aria-hidden":`true`}),(0,$.jsx)(`span`,{className:`truncate font-medium text-foreground`,children:`quarterly-report.pdf`}),(0,$.jsx)(`span`,{className:`shrink-0 text-xs text-muted-foreground`,children:`1.4 MB`})]})}}]}function B_(){return[...D_().filter(e=>e.surface===`canonical`&&!R_.has(e.name)).map(e=>{let t=A_[e.name],n=e.Component,r=t?{description:Y._(t.description),render:t.render??(()=>(0,$.jsx)(n,{...t.props,children:t.children}))}:void 0;return{name:`component-${e.name}`,label:e.displayName??e.name,icon:xm(e.icon),category:e.category??`content`,command:L_(e),aliases:e.searchTerms,description:e.description,insertsBlockComponent:!0,preview:r}}),...z_()]}function V_(e){let t=document.createElement(`input`);t.type=`file`,t.accept=`*/*`,t.style.display=`none`,t.addEventListener(`change`,()=>{let n=t.files?.[0];if(n){let t=e.state.selection.from;Lp(n,e,t)}t.remove()},{once:!0}),t.addEventListener(`cancel`,()=>t.remove(),{once:!0}),document.body.appendChild(t),t.click()}function H_(){return[{name:`link`,label:Y._({id:`yzF66j`}),icon:_o,category:`insert`,aliases:[`url`,`href`,`external`,`web`,`hyperlink`,`wiki`,`wikilink`,`[[`,`internal`,`page`,`backlink`,`cross-link`],description:`Link to a page or external URL`,preview:{description:Y._({id:`5WDhAk`}),render:()=>(0,$.jsx)(`p`,{className:`leading-7 text-sm`,children:(0,$.jsx)(a,{id:`u-9fWA`,components:{0:(0,$.jsx)(`span`,{className:`font-medium text-azure-blue underline underline-offset-2 dark:text-sky-blue`})}})})},command:e=>{let t=e.state.selection.from;e.chain().focus().insertContent({type:`text`,text:`link`,marks:[{type:`link`,attrs:{href:``}}]}).run();let n=im(e.state,t,`link`);n&&(Zp(n),requestAnimationFrame(()=>{ym(e).setActiveNode(n)}))}},{name:`component-Tag`,label:Y._({id:`UL8A9w`}),icon:Jr,category:`content`,aliases:[`#`,`hashtag`,`label`],description:"Inline tag (`#tagname`) for cross-doc linking",preview:{description:Y._({id:`5ClEAu`}),render:()=>(0,$.jsx)(`p`,{className:`text-sm leading-7`,children:(0,$.jsx)(a,{id:`KZLdgR`,components:{0:(0,$.jsx)(`a`,{className:`tag pointer-events-none`})}})})},command:e=>{e.chain().insertTag(``).run()}}]}function U_(e,t){e.chain().focus().insertContent({type:`codeBlock`,attrs:{language:`html`,meta:`preview`},content:[{type:`text`,text:t}]}).run()}var W_=`<div style="padding:20px;font-family:system-ui,sans-serif;color:var(--foreground)">
|
|
2
|
+
import{o as e,t}from"./chunk-CYidjpOJ.js";import{t as n}from"./preload-helper-Chd9yIcd.js";import{t as r}from"./jsx-runtime-BUgB2tll.js";import{t as i}from"./react-f2sANaYj.js";import{n as a,r as o}from"./dist-Nvb76hAm.js";import{n as s}from"./dist-PQ5KMVDh.js";import{t as c}from"./react-dom-DPxgxlDT.js";import{t as l}from"./compiler-runtime-BfE3aGVn.js";import{a as u,c as d,i as f,l as p,o as m,s as h,t as g,u as _}from"./terminal-input-events-C5UuEsAB.js";import{a as v,s as y,t as b}from"./createLucideIcon-DAkhoPjT.js";import{t as x}from"./button-Gol9BgNB.js";import{l as S,n as C}from"./dist-D6h-uzOv.js";import{i as w,n as T,t as E}from"./tooltip-B4J7VHmA.js";import{n as D,r as O,t as k}from"./collapsible-B1mS1n9y.js";import{a as A,c as j,d as M,f as N,i as P,l as F,n as I,o as L,r as ee,s as R,t as te,u as z}from"./dialog-D1Bdnm4T.js";import{A as ne,C as re,D as ie,E as ae,F as B,H as oe,I as se,J as ce,K as V,L as le,M as H,N as ue,O as U,P as de,Q as W,R as G,S as fe,U as pe,V as me,W as he,Y as ge,Z as K,_ as q,at as J,c as _e,d as ve,ft as ye,g as be,h as xe,it as Se,j as Ce,k as we,lt as Te,m as Ee,n as De,nt as Oe,ot as ke,p as Ae,r as je,rt as Me,s as Ne,st as Pe,t as Fe,v as Ie,w as Le,x as Re,y as ze,z as Be}from"./CodeMirrorPropInput-CiPNj8ti.js";import{a as Ve,d as He,i as Ue,l as We,r as Ge,u as Ke}from"./floating-ui.dom-DxCSXcm6.js";import{a as qe,i as Je,n as Ye,o as Xe,r as Ze,s as Qe,t as $e}from"./switch-DYic2V-1.js";import{$a as et,$i as tt,$n as nt,Ai as rt,An as it,Bi as at,Bn as ot,Bt as st,C as ct,Ca as lt,Da as ut,Dn as dt,Dr as ft,Ea as pt,Ei as mt,Et as ht,Fi as gt,G as _t,Gi as vt,Gt as yt,Hn as bt,Hr as xt,In as St,Ir as Ct,J as wt,Jn as Tt,Jt as Et,K as Dt,Kn as Ot,Kr as kt,Li as At,Ln as jt,M as Mt,Mi as Nt,Mr as Pt,Ni as Ft,Nr as It,On as Lt,Or as Rt,Ot as zt,Pi as Bt,Pr as Vt,Qa as Ht,Qi as Ut,Qn as Wt,Qr as Gt,Rn as Kt,Rr as qt,S as Jt,Si as Yt,Sn as Xt,Sr as Zt,St as Qt,T as $t,Ti as en,Tt as tn,U as nn,Va as rn,Vi as an,Vr as on,Wi as sn,Xi as cn,Xn as ln,Y as un,Yi as dn,Yr as fn,Z as pn,Zr as mn,Zt as hn,_r as gn,_t as _n,ai as vn,ar as yn,at as bn,bi as xn,ca as Sn,cn as Cn,cr as wn,da as Tn,di as En,dn as Dn,dt as On,ea as kn,eo as An,er as jn,fa as Mn,fr as Nn,ft as Pn,ga as Fn,gr as In,gt as Ln,ia as Rn,ir as zn,it as Bn,jr as Vn,kn as Hn,kr as Un,kt as Wn,la as Gn,li as Kn,ma as qn,mn as Jn,na as Yn,ni as Xn,nr as Zn,nt as Qn,oa as $n,or as er,pa as tr,q as nr,qi as rr,qr as ir,qt as ar,ra as or,rr as sr,s as cr,si as lr,sr as ur,ta as dr,tr as fr,tt as pr,ui as mr,un as hr,ur as gr,vi as _r,wa as vr,wi as yr,wr as br,wt as xr,xi as Sr,xr as Cr,yi as wr}from"./dist-BGfU2QP2.js";import{t as Tr}from"./trace-api-DHyWZzIa.js";import{n as Er,t as Dr}from"./propagation-api-OHat7V1z.js";import"./lib-Iu39CNZE.js";import{n as Or,t as kr}from"./git-branch-CMJAiYLz.js";import{t as Ar}from"./check-GqWaoTdV.js";import{t as jr}from"./chevron-down-Bx9f3tW-.js";import{t as Mr}from"./chevron-right-C8oTR6gu.js";import{n as Nr,t as Pr}from"./CopyButton-1Q6Wnnjb.js";import{i as Fr,o as Ir,r as Lr,s as Rr}from"./prop-types-Benz74B2.js";import{a as zr,d as Br,l as Vr,r as Hr,t as Ur,u as Wr}from"./workspace-paths-CTLwXmK5.js";import{t as Gr}from"./copy-9EDFYcyR.js";import{t as Kr}from"./eye-CASw1HTi.js";import{t as qr}from"./folder-open-wLd69QUc.js";import{t as Jr}from"./hash-DNKDqZ18.js";import{t as Yr}from"./info-yKMseklR.js";import{t as Xr}from"./loader-circle-Cg5SU7AZ.js";import{t as Zr}from"./minus-SecfYzeQ.js";import{t as Qr}from"./paperclip-CX7J_G-w.js";import{t as $r}from"./sliders-horizontal-DhMBnUFY.js";import{t as ei}from"./trash-2-DDVTy8gQ.js";import{t as ti}from"./triangle-alert-B0VxKCJQ.js";import{t as ni}from"./x-Cw3EsDCQ.js";import{n as ri}from"./dist-BTjBKsmV.js";import{t as ii}from"./input-7sjA3n4i.js";import{t as Y}from"./dist-0uiGbm0b.js";import{t as ai}from"./parse-api-error-mt0p1S6a.js";import{t as oi}from"./file-tree-rename-validation-BUgsIr8g.js";import{d as si,n as ci,p as li}from"./navigation-targets-CGUSVL6j.js";import{r as ui,t as di}from"./documents-events-BtgGTIqA.js";import{a as X,o as fi,t as pi}from"./startup-marks-DzPXEHWK.js";import{c as mi,f as hi,h as gi,l as _i,n as vi,o as yi,r as bi,s as xi}from"./doc-hash-BSk1YYn9.js";import{t as Si}from"./badge-DBfQWFob.js";import{$ as Ci,A as wi,C as Ti,D as Ei,E as Di,F as Oi,G as ki,H as Ai,I as ji,J as Mi,K as Ni,L as Pi,M as Fi,O as Ii,P as Li,Q as Ri,R as zi,S as Bi,T as Vi,U as Hi,W as Ui,X as Wi,Y as Gi,Z as Ki,_ as qi,a as Ji,at as Yi,b as Xi,c as Zi,d as Qi,et as $i,f as ea,g as ta,h as na,i as ra,it as ia,j as aa,k as oa,l as sa,m as ca,nt as la,o as ua,p as da,q as fa,r as pa,rt as ma,s as ha,tt as ga,u as _a,v as va,w as ya,x as ba,y as xa}from"./config-provider-DNKyP_6q.js";import{n as Sa}from"./use-collab-url-DRZdoC-F.js";import{E as Ca,N as wa,Ot as Ta,X as Ea,c as Da,dt as Oa,f as ka,ft as Aa,l as ja}from"./dist-BoIv4SAA.js";import{a as Ma,i as Na,o as Pa,r as Fa}from"./esm-CYdiz24Y.js";import{t as Ia}from"./dist-Ci4TMg-i.js";import{n as La}from"./dist-BDUhB1eX.js";import{n as Ra}from"./dist-C-31u2Hx.js";import{n as za}from"./dist-CpB1fiWh2.js";import{n as Ba}from"./dist-DU-4Kwni.js";import{n as Va}from"./dist-CHDGRvTt.js";import{t as Ha}from"./stex-ChFXL4wJ.js";import{n as Ua}from"./config-context-BD8I9DHH.js";import{n as Wa,r as Ga}from"./external-link-CkJSCVND.js";(function(){var e=[`user-blocking`,`user-visible`,`background`];class t{constructor(){this.t=new MessageChannel,this.i=this.t.port2,this.l={},this.o=1,this.t.port1.onmessage=e=>this.h(e)}u(e){var t=this.o++;return this.l[t]=e,this.i.postMessage(t),t}p(e){delete this.l[e]}h(e){var t=e.data;if(t in this.l){var n=this.l[t];delete this.l[t],n()}}}function n(){return n.v||=new t,n.v}class r{constructor(e,t,n){n===void 0&&(n=0),this.k=e,this.T=null,this.C=null,this.m=!1,this._(t,n)}isIdleCallback(){return this.T===0}I(){return this.T===2}cancel(){if(!this.m)switch(this.m=!0,this.T){case 0:cancelIdleCallback(this.C);break;case 1:clearTimeout(this.C);break;case 2:n().p(this.C);break;default:throw TypeError(`Unknown CallbackType`)}}_(t,r){if(r&&r>0)return this.T=1,void(this.C=setTimeout(()=>{this.P()},r));if(!e.includes(t))throw TypeError(`Invalid task priority : `+t);t===`background`&&typeof requestIdleCallback==`function`?(this.T=0,this.C=requestIdleCallback(()=>{this.P()})):typeof MessageChannel==`function`?(this.T=2,this.C=n().u(()=>{this.P()})):(this.T=1,this.C=setTimeout(()=>{this.P()}))}P(){this.m||this.k()}}var i=0;class a{constructor(){this.j=null,this.M=null}isEmpty(){return this.j==null}push(e){if(typeof e!=`object`)throw TypeError(`Task must be an Object`);e.A=i++,this.isEmpty()?(e.N=null,this.j=e):(e.N=this.M,this.M.O=e),e.O=null,this.M=e}takeNextTask(){if(this.isEmpty())return null;var e=this.j;return this.q(e),e}merge(e,t){if(typeof t!=`function`)throw TypeError(`Must provide a selector function.`);if(e==null)throw Error(`sourceQueue cannot be null`);for(var n=this.j,r=null,i=e.j;i;){var a=i;if(i=i.O,t(a)){for(e.q(a);n&&n.A<a.A;)r=n,n=n.O;this.D(a,r),r=a}}}D(e,t){if(t!=this.M){var n=t?t.O:this.j;e.O=n,n.N=e,e.N=t,t==null?this.j=e:t.O=e}else this.push(e)}q(e){if(e==null)throw Error(`Expected task to be non-null`);e===this.j&&(this.j=e.O),e===this.M&&(this.M=this.M.N),e.O&&(e.O.N=e.N),e.N&&(e.N.O=e.O)}}class o extends Event{constructor(t,n){if(!n||!e.includes(n.previousPriority))throw TypeError(`Invalid task priority: '`+n.previousPriority+`'`);super(t),this.previousPriority=n.previousPriority}}class s extends AbortController{constructor(t){if(t===void 0&&(t={}),super(),t??={},typeof t!=`object`)throw TypeError(`'init' is not an object`);var n,r,i=t.priority===void 0?`user-visible`:t.priority;if(!e.includes(i))throw TypeError(`Invalid task priority: '`+i+`'`);this.H=i,this.R=!1,r=(n=this).signal,Object.defineProperties(r,{priority:{get:function(){return n.H},enumerable:!0},onprioritychange:{value:null,writable:!0,enumerable:!0}}),r.addEventListener(`prioritychange`,e=>{r.onprioritychange&&r.onprioritychange(e)})}setPriority(t){if(!e.includes(t))throw TypeError(`Invalid task priority: `+t);if(this.R)throw new DOMException(``,`NotAllowedError`);if(this.signal.priority!==t){this.R=!0;var n=this.H;this.H=t;var r=new o(`prioritychange`,{previousPriority:n});this.signal.dispatchEvent(r),this.R=!1}}}self.scheduler===void 0?(self.scheduler=new class{constructor(){this.S={},e.forEach(e=>{this.S[e]=[new a,new a]}),this.U=null,this.W=new WeakMap}yield(){return this.B(()=>{},{priority:`user-visible`},!0)}postTask(e,t){return this.B(e,t,!1)}B(t,n,r){if((n=Object.assign({},n)).signal!==void 0){if(n.signal===null||!(`aborted`in n.signal)||typeof n.signal.addEventListener!=`function`)return Promise.reject(TypeError(`'signal' is not a valid 'AbortSignal'`));if(n.signal&&n.signal.priority&&!e.includes(n.signal.priority))return Promise.reject(TypeError(`Invalid task priority: '`+n.signal.priority+`'`))}if(n.priority!==void 0&&(n.priority===null||!e.includes(n.priority)))return Promise.reject(TypeError(`Invalid task priority: '`+n.priority+`'`));if(n.delay===void 0&&(n.delay=0),n.delay=Number(n.delay),n.delay<0)return Promise.reject(TypeError(`'delay' must be a positive number.`));var i={callback:t,options:n,resolve:null,reject:null,hostCallback:null,abortCallback:null,onTaskCompleted:function(){this.options.signal&&this.abortCallback&&(this.options.signal.removeEventListener(`abort`,this.abortCallback),this.abortCallback=null)},onTaskAborted:function(){this.hostCallback&&=(this.hostCallback.cancel(),null),this.options.signal.removeEventListener(`abort`,this.abortCallback),this.abortCallback=null,this.reject(this.options.signal.reason)},isAborted:function(){return this.options.signal&&this.options.signal.aborted},isContinuation:r},a=new Promise((e,t)=>{i.resolve=e,i.reject=t});return this._(i),a}_(e){var t=e.options.signal;if(t){if(t.aborted)return void e.reject(t.reason);e.abortCallback=()=>{e.onTaskAborted()},t.addEventListener(`abort`,e.abortCallback)}e.options.delay>0?e.hostCallback=new r(()=>{e.hostCallback=null,this.F(e)},null,e.options.delay):(this.G(e),this.J())}F(e){this.G(e),this.U&&=(this.U.cancel(),null),this.K()}L(e){var t=this.W.get(e);if(t===void 0)throw Error(`Attempting to change priority on an unregistered signal`);if(t!==e.priority){for(var n=0;n<2;n++)this.S[e.priority][n].merge(this.S[t][n],t=>t.options.signal===e);this.W.set(e,e.priority)}}K(){this.U=null,this.V(),this.J()}J(){var{priority:e}=this.X();e!=null&&(e!==`background`&&this.U&&this.U.isIdleCallback()&&(this.U.cancel(),this.U=null),this.U||=new r(()=>{this.K()},e,0))}G(t){var n;if(!e.includes(n=t.options.priority?t.options.priority:t.options.signal&&t.options.signal.priority?t.options.signal.priority:`user-visible`))throw TypeError(`Invalid task priority: `+n);if(t.options.signal&&t.options.signal.priority){var r=t.options.signal;this.W.has(r)||(r.addEventListener(`prioritychange`,()=>{this.L(r)}),this.W.set(r,r.priority))}this.S[n][+!t.isContinuation].push(t)}V(){var e=null;do{var{priority:t,type:n}=this.X();if(t==null)return;e=this.S[t][n].takeNextTask()}while(e.isAborted());try{var r=e.callback();e.resolve(r)}catch(t){e.reject(t)}finally{e.onTaskCompleted()}}X(){for(var t=0;t<e.length;t++)for(var n=e[t],r=0;r<2;r++)if(!this.S[n][r].isEmpty())return{priority:n,type:r};return{priority:null,type:0}}},self.TaskController=s,self.TaskPriorityChangeEvent=o):self.scheduler.yield||(self.scheduler.yield=function(){return self.scheduler.postTask(()=>{},{priority:`user-blocking`})})})();var Ka=b(`book-open`,[[`path`,{d:`M12 7v14`,key:`1akyts`}],[`path`,{d:`M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z`,key:`ruj8y`}]]),qa=b(`box`,[[`path`,{d:`M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z`,key:`hh9hay`}],[`path`,{d:`m3.3 7 8.7 5 8.7-5`,key:`g66t2b`}],[`path`,{d:`M12 22V12`,key:`d0xqtd`}]]),Ja=b(`bug`,[[`path`,{d:`M12 20v-9`,key:`1qisl0`}],[`path`,{d:`M14 7a4 4 0 0 1 4 4v3a6 6 0 0 1-12 0v-3a4 4 0 0 1 4-4z`,key:`uouzyp`}],[`path`,{d:`M14.12 3.88 16 2`,key:`qol33r`}],[`path`,{d:`M21 21a4 4 0 0 0-3.81-4`,key:`1b0z45`}],[`path`,{d:`M21 5a4 4 0 0 1-3.55 3.97`,key:`5cxbf6`}],[`path`,{d:`M22 13h-4`,key:`1jl80f`}],[`path`,{d:`M3 21a4 4 0 0 1 3.81-4`,key:`1fjd4g`}],[`path`,{d:`M3 5a4 4 0 0 0 3.55 3.97`,key:`1d7oge`}],[`path`,{d:`M6 13H2`,key:`82j7cp`}],[`path`,{d:`m8 2 1.88 1.88`,key:`fmnt4t`}],[`path`,{d:`M9 7.13V6a3 3 0 1 1 6 0v1.13`,key:`1vgav8`}]]),Ya=b(`chart-column`,[[`path`,{d:`M3 3v16a2 2 0 0 0 2 2h16`,key:`c24i48`}],[`path`,{d:`M18 17V9`,key:`2bz60n`}],[`path`,{d:`M13 17V5`,key:`1frdt8`}],[`path`,{d:`M8 17v-3`,key:`17ska0`}]]),Xa=b(`circle-question-mark`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3`,key:`1u773s`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}]]),Za=b(`circle-x`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m15 9-6 6`,key:`1uzhvr`}],[`path`,{d:`m9 9 6 6`,key:`z0biqf`}]]),Qa=b(`clipboard-list`,[[`rect`,{width:`8`,height:`4`,x:`8`,y:`2`,rx:`1`,ry:`1`,key:`tgr4d6`}],[`path`,{d:`M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2`,key:`116196`}],[`path`,{d:`M12 11h4`,key:`1jrz19`}],[`path`,{d:`M12 16h4`,key:`n85exb`}],[`path`,{d:`M8 11h.01`,key:`1dfujw`}],[`path`,{d:`M8 16h.01`,key:`18s6g9`}]]),$a=b(`clock-3`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 6v6h4`,key:`135r8i`}]]),eo=b(`code-xml`,[[`path`,{d:`m18 16 4-4-4-4`,key:`1inbqp`}],[`path`,{d:`m6 8-4 4 4 4`,key:`15zrgr`}],[`path`,{d:`m14.5 4-5 16`,key:`e7oirm`}]]),to=b(`code`,[[`path`,{d:`m16 18 6-6-6-6`,key:`eg8j8`}],[`path`,{d:`m8 6-6 6 6 6`,key:`ppft3o`}]]),no=b(`eraser`,[[`path`,{d:`M21 21H8a2 2 0 0 1-1.42-.587l-3.994-3.999a2 2 0 0 1 0-2.828l10-10a2 2 0 0 1 2.829 0l5.999 6a2 2 0 0 1 0 2.828L12.834 21`,key:`g5wo59`}],[`path`,{d:`m5.082 11.09 8.828 8.828`,key:`1wx5vj`}]]),ro=b(`external-link`,[[`path`,{d:`M15 3h6v6`,key:`1q9fwt`}],[`path`,{d:`M10 14 21 3`,key:`gplh6r`}],[`path`,{d:`M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6`,key:`a6xqqp`}]]),io=b(`file-image`,[[`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`}],[`circle`,{cx:`10`,cy:`12`,r:`2`,key:`737tya`}],[`path`,{d:`m20 17-1.296-1.296a2.41 2.41 0 0 0-3.408 0L9 22`,key:`wt3hpn`}]]),ao=b(`file-up`,[[`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:`M12 12v6`,key:`3ahymv`}],[`path`,{d:`m15 15-3-3-3 3`,key:`15xj92`}]]),oo=b(`file`,[[`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`}]]),so=b(`flask-conical`,[[`path`,{d:`M14 2v6a2 2 0 0 0 .245.96l5.51 10.08A2 2 0 0 1 18 22H6a2 2 0 0 1-1.755-2.96l5.51-10.08A2 2 0 0 0 10 8V2`,key:`18mbvz`}],[`path`,{d:`M6.453 15h11.094`,key:`3shlmq`}],[`path`,{d:`M8.5 2h7`,key:`csnxdl`}]]),co=b(`heading-1`,[[`path`,{d:`M4 12h8`,key:`17cfdx`}],[`path`,{d:`M4 18V6`,key:`1rz3zl`}],[`path`,{d:`M12 18V6`,key:`zqpxq5`}],[`path`,{d:`m17 12 3-2v8`,key:`1hhhft`}]]),lo=b(`heading-2`,[[`path`,{d:`M4 12h8`,key:`17cfdx`}],[`path`,{d:`M4 18V6`,key:`1rz3zl`}],[`path`,{d:`M12 18V6`,key:`zqpxq5`}],[`path`,{d:`M21 18h-4c0-4 4-3 4-6 0-1.5-2-2.5-4-1`,key:`9jr5yi`}]]),uo=b(`heading-3`,[[`path`,{d:`M4 12h8`,key:`17cfdx`}],[`path`,{d:`M4 18V6`,key:`1rz3zl`}],[`path`,{d:`M12 18V6`,key:`zqpxq5`}],[`path`,{d:`M17.5 10.5c1.7-1 3.5 0 3.5 1.5a2 2 0 0 1-2 2`,key:`68ncm8`}],[`path`,{d:`M17 17.5c2 1.5 4 .3 4-1.5a2 2 0 0 0-2-2`,key:`1ejuhz`}]]),fo=b(`layout-grid`,[[`rect`,{width:`7`,height:`7`,x:`3`,y:`3`,rx:`1`,key:`1g98yp`}],[`rect`,{width:`7`,height:`7`,x:`14`,y:`3`,rx:`1`,key:`6d4xhi`}],[`rect`,{width:`7`,height:`7`,x:`14`,y:`14`,rx:`1`,key:`nxv5o0`}],[`rect`,{width:`7`,height:`7`,x:`3`,y:`14`,rx:`1`,key:`1bb6yr`}]]),po=b(`layout-panel-top`,[[`rect`,{width:`18`,height:`7`,x:`3`,y:`3`,rx:`1`,key:`f1a2em`}],[`rect`,{width:`7`,height:`7`,x:`3`,y:`14`,rx:`1`,key:`1bb6yr`}],[`rect`,{width:`7`,height:`7`,x:`14`,y:`14`,rx:`1`,key:`nxv5o0`}]]),mo=b(`lightbulb`,[[`path`,{d:`M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5`,key:`1gvzjb`}],[`path`,{d:`M9 18h6`,key:`x1upvd`}],[`path`,{d:`M10 22h4`,key:`ceow96`}]]),ho=b(`link-2-off`,[[`path`,{d:`M9 17H7A5 5 0 0 1 7 7`,key:`10o201`}],[`path`,{d:`M15 7h2a5 5 0 0 1 4 8`,key:`1d3206`}],[`line`,{x1:`8`,x2:`12`,y1:`12`,y2:`12`,key:`rvw6j4`}],[`line`,{x1:`2`,x2:`22`,y1:`2`,y2:`22`,key:`a6p6uj`}]]),go=[[`path`,{d:`M9 17H7A5 5 0 0 1 7 7h2`,key:`8i5ue5`}],[`path`,{d:`M15 7h2a5 5 0 1 1 0 10h-2`,key:`1b9ql8`}],[`line`,{x1:`8`,x2:`16`,y1:`12`,y2:`12`,key:`1jonct`}]],_o=b(`link-2`,go),vo=b(`list-ordered`,[[`path`,{d:`M11 5h10`,key:`1cz7ny`}],[`path`,{d:`M11 12h10`,key:`1438ji`}],[`path`,{d:`M11 19h10`,key:`11t30w`}],[`path`,{d:`M4 4h1v5`,key:`10yrso`}],[`path`,{d:`M4 9h2`,key:`r1h2o0`}],[`path`,{d:`M6.5 20H3.4c0-1 2.6-1.925 2.6-3.5a1.5 1.5 0 0 0-2.6-1.02`,key:`xtkcd5`}]]),yo=b(`list-todo`,[[`path`,{d:`M13 5h8`,key:`a7qcls`}],[`path`,{d:`M13 12h8`,key:`h98zly`}],[`path`,{d:`M13 19h8`,key:`c3s6r1`}],[`path`,{d:`m3 17 2 2 4-4`,key:`1jhpwq`}],[`rect`,{x:`3`,y:`4`,width:`6`,height:`6`,rx:`1`,key:`cif1o7`}]]),bo=b(`list`,[[`path`,{d:`M3 5h.01`,key:`18ugdj`}],[`path`,{d:`M3 12h.01`,key:`nlz23k`}],[`path`,{d:`M3 19h.01`,key:`noohij`}],[`path`,{d:`M8 5h13`,key:`1pao27`}],[`path`,{d:`M8 12h13`,key:`1za7za`}],[`path`,{d:`M8 19h13`,key:`m83p4d`}]]),xo=b(`message-square-warning`,[[`path`,{d:`M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z`,key:`18887p`}],[`path`,{d:`M12 15h.01`,key:`q59x07`}],[`path`,{d:`M12 7v4`,key:`xawao1`}]]),So=b(`octagon-alert`,[[`path`,{d:`M12 16h.01`,key:`1drbdi`}],[`path`,{d:`M12 8v4`,key:`1got3b`}],[`path`,{d:`M15.312 2a2 2 0 0 1 1.414.586l4.688 4.688A2 2 0 0 1 22 8.688v6.624a2 2 0 0 1-.586 1.414l-4.688 4.688a2 2 0 0 1-1.414.586H8.688a2 2 0 0 1-1.414-.586l-4.688-4.688A2 2 0 0 1 2 15.312V8.688a2 2 0 0 1 .586-1.414l4.688-4.688A2 2 0 0 1 8.688 2z`,key:`1fd625`}]]),Co=b(`panel-left`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M9 3v18`,key:`fh3hqa`}]]),wo=b(`panel-top`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M3 9h18`,key:`1pudct`}]]),To=b(`quote`,[[`path`,{d:`M16 3a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2 1 1 0 0 1 1 1v1a2 2 0 0 1-2 2 1 1 0 0 0-1 1v2a1 1 0 0 0 1 1 6 6 0 0 0 6-6V5a2 2 0 0 0-2-2z`,key:`rib7q0`}],[`path`,{d:`M5 3a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2 1 1 0 0 1 1 1v1a2 2 0 0 1-2 2 1 1 0 0 0-1 1v2a1 1 0 0 0 1 1 6 6 0 0 0 6-6V5a2 2 0 0 0-2-2z`,key:`1ymkrd`}]]),Eo=b(`search`,[[`path`,{d:`m21 21-4.34-4.34`,key:`14j7rj`}],[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}]]),Do=b(`settings-2`,[[`path`,{d:`M14 17H5`,key:`gfn3mx`}],[`path`,{d:`M19 7h-9`,key:`6i9tg`}],[`circle`,{cx:`17`,cy:`17`,r:`3`,key:`18b49y`}],[`circle`,{cx:`7`,cy:`7`,r:`3`,key:`dfmy0x`}]]),Oo=b(`shapes`,[[`path`,{d:`M8.3 10a.7.7 0 0 1-.626-1.079L11.4 3a.7.7 0 0 1 1.198-.043L16.3 8.9a.7.7 0 0 1-.572 1.1Z`,key:`1bo67w`}],[`rect`,{x:`3`,y:`14`,width:`7`,height:`7`,rx:`1`,key:`1bkyp8`}],[`circle`,{cx:`17.5`,cy:`17.5`,r:`3.5`,key:`w3z12y`}]]),ko=b(`shield-alert`,[[`path`,{d:`M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z`,key:`oel41y`}],[`path`,{d:`M12 8v4`,key:`1got3b`}],[`path`,{d:`M12 16h.01`,key:`1drbdi`}]]),Ao=b(`sigma`,[[`path`,{d:`M18 7V5a1 1 0 0 0-1-1H6.5a.5.5 0 0 0-.4.8l4.5 6a2 2 0 0 1 0 2.4l-4.5 6a.5.5 0 0 0 .4.8H17a1 1 0 0 0 1-1v-2`,key:`wuwx1p`}]]),jo=b(`square-play`,[[`rect`,{x:`3`,y:`3`,width:`18`,height:`18`,rx:`2`,key:`h1oib`}],[`path`,{d:`M9 9.003a1 1 0 0 1 1.517-.859l4.997 2.997a1 1 0 0 1 0 1.718l-4.997 2.997A1 1 0 0 1 9 14.996z`,key:`kmsa83`}]]),Mo=b(`superscript`,[[`path`,{d:`m4 19 8-8`,key:`hr47gm`}],[`path`,{d:`m12 19-8-8`,key:`1dhhmo`}],[`path`,{d:`M20 12h-4c0-1.5.442-2 1.5-2.5S20 8.334 20 7.002c0-.472-.17-.93-.484-1.29a2.105 2.105 0 0 0-2.617-.436c-.42.239-.738.614-.899 1.06`,key:`1dfcux`}]]),No=b(`table-2`,[[`path`,{d:`M9 3H5a2 2 0 0 0-2 2v4m6-6h10a2 2 0 0 1 2 2v4M9 3v18m0 0h10a2 2 0 0 0 2-2V9M9 21H5a2 2 0 0 1-2-2V9m0 0h18`,key:`gugj83`}]]),Po=b(`upload`,[[`path`,{d:`M12 3v12`,key:`1x0j5s`}],[`path`,{d:`m17 8-5-5-5 5`,key:`7q97r8`}],[`path`,{d:`M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4`,key:`ih7n3h`}]]),Fo=b(`workflow`,[[`rect`,{width:`8`,height:`8`,x:`3`,y:`3`,rx:`2`,key:`by2w9f`}],[`path`,{d:`M7 11v4a2 2 0 0 0 2 2h4`,key:`xkn7yn`}],[`rect`,{width:`8`,height:`8`,x:`13`,y:`13`,rx:`2`,key:`1cgmvn`}]]),Io=b(`zap`,[[`path`,{d:`M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z`,key:`1xq2db`}]]),Lo=e(c(),1),Z=l(),Q=e(i(),1),$=r();function Ro(e){return e.kind===`create`?`create:${e.value}`:`tag:${e.value}`}function zo(e){if(e.kind===`create`){let t=e.value;return Y._({id:`XPqe3B`,values:{tagValue:t}})}let t=Y._({id:`pckX1A`,values:{0:e.count}}),n=e.value;return Y._({id:`m2T1Xj`,values:{tagValue:n,uses:t}})}function Bo(e){let t=(0,Z.c)(38),{items:n,query:r,selectedIndex:i,onSelect:s,onHover:c,loading:l,error:u}=e,d=l===void 0?!1:l,f=u===void 0?null:u,{_:p}=o(),m=(0,Q.useRef)(null),h=(0,Q.useId)(),g=i>=0&&i<n.length?`${h}-option-${i}`:void 0,_,v;t[0]===i?(_=t[1],v=t[2]):(_=()=>{let e=m.current;if(!e)return;let t=e.querySelectorAll(`[role="option"]`).item(i);t&&t.scrollIntoView({block:`nearest`})},v=[i],t[0]=i,t[1]=_,t[2]=v),(0,Q.useEffect)(_,v);let y=Vo;if(d){let e;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(e={maxHeight:`var(--suggestion-menu-max-height, 40vh)`},t[3]=e):e=t[3];let n;return t[4]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,$.jsx)(`div`,{ref:m,role:`status`,"aria-live":`polite`,className:`w-64 rounded-lg border bg-popover p-2 shadow-md text-sm text-muted-foreground`,style:e,onMouseDown:y,children:(0,$.jsx)(a,{id:`a_u4ck`})}),t[4]=n):n=t[4],n}if(n.length===0){let e;if(t[5]!==p||t[6]!==f||t[7]!==r){let n=r.trim();e=f??p(n?{id:`9R7pRC`,values:{trimmed:n}}:{id:`KRJ6xh`}),t[5]=p,t[6]=f,t[7]=r,t[8]=e}else e=t[8];let n=e,i;t[9]===Symbol.for(`react.memo_cache_sentinel`)?(i={maxHeight:`var(--suggestion-menu-max-height, 40vh)`},t[9]=i):i=t[9];let a;return t[10]===n?a=t[11]:(a=(0,$.jsx)(`div`,{ref:m,role:`status`,"aria-live":`polite`,className:`w-64 rounded-lg border bg-popover p-2 shadow-md text-sm text-muted-foreground`,style:i,onMouseDown:y,children:n}),t[10]=n,t[11]=a),a}let b=i>=0&&i<n.length?n[i]:null,x;t[12]===p?x=t[13]:(x=p({id:`SCoBBH`}),t[12]=p,t[13]=x);let S;t[14]===Symbol.for(`react.memo_cache_sentinel`)?(S={maxHeight:`var(--suggestion-menu-max-height, 40vh)`},t[14]=S):S=t[14];let C;t[15]===b?C=t[16]:(C=b?zo(b):``,t[15]=b,t[16]=C);let w;t[17]===C?w=t[18]:(w=(0,$.jsx)(`span`,{className:`sr-only`,"aria-live":`polite`,"aria-atomic":`true`,children:C}),t[17]=C,t[18]=w);let T;t[19]===f?T=t[20]:(T=f&&(0,$.jsx)(`div`,{className:`rounded-md px-2 py-1.5 text-xs text-amber-700 dark:text-amber-300`,children:f}),t[19]=f,t[20]=T);let E;if(t[21]!==n||t[22]!==h||t[23]!==c||t[24]!==s||t[25]!==i){let e;t[27]!==h||t[28]!==c||t[29]!==s||t[30]!==i?(e=(e,t)=>{let n=t===i,r=Ro(e),o=e.kind===`create`;return(0,$.jsxs)(`button`,{id:`${h}-option-${t}`,type:`button`,role:`option`,"aria-selected":n,"data-selected":n,"data-testid":o?`tag-suggestion-create`:`tag-suggestion-tag-${e.value}`,className:`flex w-full items-center gap-2 rounded-md px-2 py-1.5 text-sm text-left ${n?`bg-accent text-accent-foreground`:``}`,onMouseDown:t=>{t.preventDefault(),s(e)},onPointerMove:c?()=>c(t):void 0,children:[(0,$.jsx)(`span`,{"aria-hidden":`true`,className:`font-mono text-xs text-muted-foreground`,children:`#`}),(0,$.jsx)(`span`,{className:`truncate font-medium flex-1`,children:e.value}),o?(0,$.jsx)(`span`,{className:`shrink-0 rounded-sm bg-primary/10 px-1.5 py-0.5 text-[10px] font-medium uppercase tracking-wide text-primary`,children:(0,$.jsx)(a,{id:`isRobC`})}):(0,$.jsx)(`span`,{className:`shrink-0 text-[11px] text-muted-foreground tabular-nums`,children:e.count})]},r)},t[27]=h,t[28]=c,t[29]=s,t[30]=i,t[31]=e):e=t[31],E=n.map(e),t[21]=n,t[22]=h,t[23]=c,t[24]=s,t[25]=i,t[26]=E}else E=t[26];let D;return t[32]!==g||t[33]!==E||t[34]!==x||t[35]!==w||t[36]!==T?(D=(0,$.jsxs)(`div`,{ref:m,role:`listbox`,"aria-label":x,"aria-activedescendant":g,tabIndex:-1,onMouseDown:y,className:`w-64 overflow-y-auto subtle-scrollbar rounded-lg border bg-popover p-1 shadow-md`,style:S,children:[w,T,E]}),t[32]=g,t[33]=E,t[34]=x,t[35]=w,t[36]=T,t[37]=D):D=t[37],D}function Vo(e){return e.preventDefault()}var Ho=new dr(`tagSuggestion`),Uo=8,Wo=/^[a-zA-Z][\w/-]*$/;async function Go(){let e=await fetch(`/api/tags`);if(!e.ok)throw Error(`/api/tags responded with ${e.status}`);let t=await e.json();return Array.isArray(t.tags)?t.tags:[]}function Ko(e,t){let n=t.trim(),r=n.toLowerCase(),i=n===``?e.slice():e.filter(e=>e.name.toLowerCase().includes(r));return i.sort((e,t)=>{let n=+!e.name.toLowerCase().startsWith(r),i=+!t.name.toLowerCase().startsWith(r);return n===i?t.count===e.count?e.name.localeCompare(t.name):t.count-e.count:n-i}),i}function qo(e,t){let n=Ko(e,t).slice(0,Uo).map(e=>({kind:`tag`,value:e.name,count:e.count,isLeaf:e.isLeaf})),r=t.trim();return r&&Wo.test(r)&&!e.some(e=>e.name===r)&&n.push({kind:`create`,value:r}),n}function Jo(e){let{$position:t}=e,n=t.parent.textBetween(0,t.parentOffset,void 0,``).match(/(^|[\s])#([a-zA-Z][\w/-]*)?$/);if(!n)return null;let r=n[2]??``,i=t.start(),a=n[1].length;return{range:{from:i+((n.index??0)+a),to:t.pos},query:r,text:`#${r}`}}function Yo(e){let t=[],n=!1,r=null,i=null;return V({editor:e,pluginKey:Ho,char:`#`,allowedPrefixes:null,findSuggestionMatch:Jo,allow:({editor:e})=>!he(e),items:async({query:e})=>{if(!n){r||=Go();try{t=await r,i=null}catch(e){console.error(`[tag-suggestion] Failed to fetch tags:`,e),i=`Failed to load tags. Press Escape and type # again to retry, or continue typing to create a new tag.`,t=[]}finally{n=!0,r=null}}return qo(t,e)},command:({editor:e,range:t,props:n})=>{try{let r=n.value;if(!r||!Wo.test(r))return;e.chain().focus().deleteRange(t).insertContent({type:`tag`,attrs:{value:r}}).insertContent(` `).run()}catch(e){console.error(`[tag-suggestion] command failed`,{item:n,range:t},e)}},render:()=>{let e=null,a=null,o=0,s={popup:null,stopAutoUpdate:null},c=null,l=null,u=e=>{a?.command(e)},d=e=>{o!==e&&(o=e,p(null))};function f(e,t,r){let a=t===null?!n:t;return{items:e.items,query:e.query??``,selectedIndex:o,onSelect:r,onHover:d,loading:a,error:i}}let p=t=>{!e||!a||e.updateProps(f(a,t,u))};return{onBeforeStart(t){a=t,o=0;let n=oe(()=>a,`tag-suggestion`);s.popup=n.popup,c=n.doPosition,l=n.reveal,e=new W(Bo,{props:f(t,!0,u),editor:t.editor}),n.popup.appendChild(e.element),s.stopAutoUpdate=n.startAutoUpdate()},onStart(e){a=e,o=0,p(null),l?.()},onUpdate(e){a=e,o=Math.min(o,Math.max(0,e.items.length-1)),p(null),c?.()},onKeyDown({event:e}){if(!a)return!1;let t=a.items;if(e.key===`ArrowDown`)return t.length===0?!1:(o=(o+1)%t.length,p(null),!0);if(e.key===`ArrowUp`)return t.length===0?!1:(o=(o-1+t.length)%t.length,p(null),!0);if(e.key===`Enter`||e.key===`Tab`){let e=t[o];if(e)return a.command(e),!0;let n=(a.query??``).trim();return n&&Wo.test(n)?(a.command({kind:`create`,value:n}),!0):!1}return e.key,!1},onExit(){pe(s),c=null,l=null,e?.destroy(),e=null,a=null,o=0,t=[],i=null,n=!1,r=null}}}})}var Xo=new Map([[qr,`<path d="m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2"/>`],[Pe,`<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"/><path d="M14 2v5a1 1 0 0 0 1 1h5"/><path d="M10 9H8"/><path d="M16 13H8"/><path d="M16 17H8"/>`],[J,`<rect width="18" height="18" x="3" y="3" rx="2" ry="2"/><circle cx="9" cy="9" r="2"/><path d="m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21"/>`],[J,`<rect width="18" height="18" x="3" y="3" rx="2" ry="2"/><circle cx="9" cy="9" r="2"/><path d="m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21"/>`],[oo,`<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"/><path d="M14 2v5a1 1 0 0 0 1 1h5"/>`],[ke,`<rect width="18" height="18" x="3" y="3" rx="2"/><path d="M7 3v18"/><path d="M3 7.5h4"/><path d="M3 12h18"/><path d="M3 16.5h4"/><path d="M17 3v18"/><path d="M17 7.5h4"/><path d="M17 16.5h4"/>`],[Se,`<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"/><path d="M16 9a5 5 0 0 1 0 6"/><path d="M19.364 18.364a9 9 0 0 0 0-12.728"/>`],[ni,`<path d="M18 6 6 18"/><path d="m6 6 12 12"/>`]]),Zo=new Map;function Qo(e){let t=Zo.get(e);if(t!==void 0)return t;let n=`<svg xmlns="http://www.w3.org/2000/svg" width="0.75rem" height="0.75rem" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">${Xo.get(e)??Xo.get(Pe)}</svg>`;return Zo.set(e,n),n}var $o=`0 0 32 32`,es=`M26.7075 10.2925L19.7075 3.2925C19.6146 3.19967 19.5042 3.12605 19.3829 3.07586C19.2615 3.02568 19.1314 2.9999 19 3H7C6.46957 3 5.96086 3.21071 5.58579 3.58579C5.21071 3.96086 5 4.46957 5 5V14C5 14.2652 5.10536 14.5196 5.29289 14.7071C5.48043 14.8946 5.73478 15 6 15C6.26522 15 6.51957 14.8946 6.70711 14.7071C6.89464 14.5196 7 14.2652 7 14V5H18V11C18 11.2652 18.1054 11.5196 18.2929 11.7071C18.4804 11.8946 18.7348 12 19 12H25V28C25 28.2652 25.1054 28.5196 25.2929 28.7071C25.4804 28.8946 25.7348 29 26 29C26.2652 29 26.5196 28.8946 26.7071 28.7071C26.8946 28.5196 27 28.2652 27 28V11C27.0001 10.8686 26.9743 10.7385 26.9241 10.6172C26.8739 10.4958 26.8003 10.3854 26.7075 10.2925ZM20 6.41375L23.5863 10H20V6.41375ZM18 18H16C15.7348 18 15.4804 18.1054 15.2929 18.2929C15.1054 18.4804 15 18.7348 15 19V26C15 26.2652 15.1054 26.5196 15.2929 26.7071C15.4804 26.8946 15.7348 27 16 27H18C19.1935 27 20.3381 26.5259 21.182 25.682C22.0259 24.8381 22.5 23.6935 22.5 22.5C22.5 21.3065 22.0259 20.1619 21.182 19.318C20.3381 18.4741 19.1935 18 18 18ZM18 25H17V20H18C18.663 20 19.2989 20.2634 19.7678 20.7322C20.2366 21.2011 20.5 21.837 20.5 22.5C20.5 23.163 20.2366 23.7989 19.7678 24.2678C19.2989 24.7366 18.663 25 18 25ZM13 19V26C13 26.2652 12.8946 26.5196 12.7071 26.7071C12.5196 26.8946 12.2652 27 12 27C11.7348 27 11.4804 26.8946 11.2929 26.7071C11.1054 26.5196 11 26.2652 11 26V22.1725L9.31875 24.5737C9.22652 24.7053 9.10396 24.8126 8.96144 24.8868C8.81892 24.9609 8.66064 24.9996 8.5 24.9996C8.33936 24.9996 8.18108 24.9609 8.03856 24.8868C7.89604 24.8126 7.77348 24.7053 7.68125 24.5737L6 22.1725V26C6 26.2652 5.89464 26.5196 5.70711 26.7071C5.51957 26.8946 5.26522 27 5 27C4.73478 27 4.48043 26.8946 4.29289 26.7071C4.10536 26.5196 4 26.2652 4 26V19C4.00009 18.7874 4.06791 18.5804 4.19363 18.409C4.31935 18.2376 4.49642 18.1107 4.69915 18.0467C4.90188 17.9828 5.11971 17.9851 5.32104 18.0533C5.52236 18.1216 5.6967 18.2522 5.81875 18.4263L8.5 22.2563L11.1812 18.4263C11.3033 18.2522 11.4776 18.1216 11.679 18.0533C11.8803 17.9851 12.0981 17.9828 12.3008 18.0467C12.5036 18.1107 12.6807 18.2376 12.8064 18.409C12.9321 18.5804 12.9999 18.7874 13 19Z`;function ts(e){return e===`.md`||e===`.mdx`}function ns(e){switch(rn(e)){case`image`:return Qo(J);case`video`:return Qo(ke);case`audio`:return Qo(Se);default:return Qo(oo)}}function rs(e){let t=(0,Z.c)(7),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,$.jsx)(`path`,{d:es}),t[3]=i):i=t[3];let a;return t[4]!==n||t[5]!==r?(a=(0,$.jsx)(`svg`,{"aria-hidden":`true`,className:n,fill:`currentColor`,viewBox:$o,...r,children:i}),t[4]=n,t[5]=r,t[6]=a):a=t[6],a}function is(e){let t=oi(e).toLowerCase();return t?ts(t)?{kind:`file`,path:e}:{kind:`file`,path:e,bodyIndexed:!1}:{kind:`folder`,path:e}}function as(e){let t=(0,Z.c)(6),{path:n,className:r,showExtensionBadge:i}=e,a;t[0]===n?a=t[1]:(a=is(n),t[0]=n,t[1]=a);let o;return t[2]!==r||t[3]!==i||t[4]!==a?(o=(0,$.jsx)(ss,{...a,className:r,showExtensionBadge:i}),t[2]=r,t[3]=i,t[4]=a,t[5]=o):o=t[5],o}function os(e){let{kind:t,bodyIndexed:n}=is(e);if(t===`folder`)return Qo(qr);let r=(n===!1?oi(e):oi(e)||`.md`).toLowerCase();return ts(r)?`<svg xmlns="http://www.w3.org/2000/svg" width="0.75rem" height="0.75rem" viewBox="${$o}" fill="currentColor" aria-hidden="true"><path d="${es}"/></svg>`:ns(r)}function ss(e){let t=(0,Z.c)(25),{kind:n,path:r,docExt:i,bodyIndexed:a,className:o,showExtensionBadge:s}=e,c=s===void 0?!0:s;if(n===`folder`){let e;t[0]===o?e=t[1]:(e=y(`shrink-0`,o),t[0]=o,t[1]=e);let n;return t[2]===e?n=t[3]:(n=(0,$.jsx)(qr,{"aria-hidden":`true`,className:e,"data-file-entry-icon":`folder`}),t[2]=e,t[3]=n),n}let l;t[4]!==a||t[5]!==i||t[6]!==r?(l=a===!1?oi(r):i??(oi(r)||`.md`),t[4]=a,t[5]=i,t[6]=r,t[7]=l):l=t[7];let u=l,d,f,p,m;if(t[8]!==o||t[9]!==u||t[10]!==c){let e=u.toLowerCase(),n=rn(e);d=c&&u&&e!==`.md`?u.slice(1).toUpperCase():null;let r=n===`image`&&`text-rose-500`,i;t[15]!==o||t[16]!==r?(i=y(o,r),t[15]=o,t[16]=r,t[17]=i):i=t[17];let a=i;f=`relative inline-flex shrink-0`,p=e||`file`,m=ts(e)?(0,$.jsx)(rs,{className:a,"data-testid":`file-entry-icon-markdown`}):n===`image`?(0,$.jsx)(J,{"aria-hidden":`true`,className:a,"data-testid":`file-entry-icon-image`}):n===`video`?(0,$.jsx)(ke,{"aria-hidden":`true`,className:a,"data-testid":`file-entry-icon-video`}):n===`audio`?(0,$.jsx)(Se,{"aria-hidden":`true`,className:a,"data-testid":`file-entry-icon-audio`}):(0,$.jsx)(oo,{"aria-hidden":`true`,className:a,"data-testid":`file-entry-icon-file`}),t[8]=o,t[9]=u,t[10]=c,t[11]=d,t[12]=f,t[13]=p,t[14]=m}else d=t[11],f=t[12],p=t[13],m=t[14];let h;t[18]===d?h=t[19]:(h=d?(0,$.jsx)(`span`,{"aria-hidden":`true`,className:`-right-1 -bottom-1 absolute rounded-sm bg-background px-0.5 font-medium text-[0.5rem] text-muted-foreground leading-none`,"data-testid":`file-entry-extension-badge`,children:d}):null,t[18]=d,t[19]=h);let g;return t[20]!==f||t[21]!==p||t[22]!==m||t[23]!==h?(g=(0,$.jsxs)(`span`,{className:f,"data-file-entry-icon":p,children:[m,h]}),t[20]=f,t[21]=p,t[22]=m,t[23]=h,t[24]=g):g=t[24],g}var cs=1,ls=.9,us=.8,ds=.17,fs=.1,ps=.999,ms=.9999,hs=.99,gs=/[\\\/_+.#"@\[\(\{&]/,_s=/[\\\/_+.#"@\[\(\{&]/g,vs=/[\s-]/,ys=/[\s-]/g;function bs(e,t,n,r,i,a,o){if(a===t.length)return i===e.length?cs:hs;var s=`${i},${a}`;if(o[s]!==void 0)return o[s];for(var c=r.charAt(a),l=n.indexOf(c,i),u=0,d,f,p,m;l>=0;)d=bs(e,t,n,r,l+1,a+1,o),d>u&&(l===i?d*=cs:gs.test(e.charAt(l-1))?(d*=us,p=e.slice(i,l-1).match(_s),p&&i>0&&(d*=ps**+p.length)):vs.test(e.charAt(l-1))?(d*=ls,m=e.slice(i,l-1).match(ys),m&&i>0&&(d*=ps**+m.length)):(d*=ds,i>0&&(d*=ps**+(l-i))),e.charAt(l)!==t.charAt(a)&&(d*=ms)),(d<fs&&n.charAt(l-1)===r.charAt(a+1)||r.charAt(a+1)===r.charAt(a)&&n.charAt(l-1)!==r.charAt(a))&&(f=bs(e,t,n,r,l+1,a+2,o),f*fs>d&&(d=f*fs)),d>u&&(u=d),l=n.indexOf(c,l+1);return o[s]=u,u}function xs(e){return e.toLowerCase().replace(ys,` `)}function Ss(e,t,n){return e=n&&n.length>0?`${e+` `+n.join(` `)}`:e,bs(e,t,xs(e),xs(t),0,0,{})}var Cs=`[cmdk-group=""]`,ws=`[cmdk-group-items=""]`,Ts=`[cmdk-group-heading=""]`,Es=`[cmdk-item=""]`,Ds=`${Es}:not([aria-disabled="true"])`,Os=`cmdk-item-select`,ks=`data-value`,As=(e,t,n)=>Ss(e,t,n),js=Q.createContext(void 0),Ms=()=>Q.useContext(js),Ns=Q.createContext(void 0),Ps=()=>Q.useContext(Ns),Fs=Q.createContext(void 0),Is=Q.forwardRef((e,t)=>{let n=Xs(()=>({search:``,value:e.value??e.defaultValue??``,selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}})),r=Xs(()=>new Set),i=Xs(()=>new Map),a=Xs(()=>new Map),o=Xs(()=>new Set),s=Js(e),{label:c,children:l,value:u,onValueChange:d,filter:f,shouldFilter:p,loop:m,disablePointerSelection:h=!1,vimBindings:g=!0,..._}=e,v=C(),y=C(),b=C(),x=Q.useRef(null),w=$s();Ys(()=>{if(u!==void 0){let e=u.trim();n.current.value=e,T.emit()}},[u]),Ys(()=>{w(6,j)},[]);let T=Q.useMemo(()=>({subscribe:e=>(o.current.add(e),()=>o.current.delete(e)),snapshot:()=>n.current,setState:(e,t,r)=>{var i,a,o;if(!Object.is(n.current[e],t)){if(n.current[e]=t,e===`search`)A(),O(),w(1,k);else if(e===`value`){if(document.activeElement.hasAttribute(`cmdk-input`)||document.activeElement.hasAttribute(`cmdk-root`)){let e=document.getElementById(b);e?e.focus():(i=document.getElementById(v))==null||i.focus()}if(w(7,()=>{n.current.selectedItemId=M()?.id,T.emit()}),r||w(5,j),s.current?.value!==void 0){let e=t??``;(o=(a=s.current).onValueChange)==null||o.call(a,e);return}}T.emit()}},emit:()=>{o.current.forEach(e=>e())}}),[]),E=Q.useMemo(()=>({value:(e,t,r)=>{t!==a.current.get(e)?.value&&(a.current.set(e,{value:t,keywords:r}),n.current.filtered.items.set(e,D(t,r)),w(2,()=>{O(),T.emit()}))},item:(e,t)=>(r.current.add(e),t&&(i.current.has(t)?i.current.get(t).add(e):i.current.set(t,new Set([e]))),w(3,()=>{A(),O(),n.current.value||k(),T.emit()}),()=>{a.current.delete(e),r.current.delete(e),n.current.filtered.items.delete(e);let t=M();w(4,()=>{A(),t?.getAttribute(`id`)===e&&k(),T.emit()})}),group:e=>(i.current.has(e)||i.current.set(e,new Set),()=>{a.current.delete(e),i.current.delete(e)}),filter:()=>s.current.shouldFilter,label:c||e[`aria-label`],getDisablePointerSelection:()=>s.current.disablePointerSelection,listId:v,inputId:b,labelId:y,listInnerRef:x}),[]);function D(e,t){let r=s.current?.filter??As;return e?r(e,n.current.search,t):0}function O(){if(!n.current.search||s.current.shouldFilter===!1)return;let e=n.current.filtered.items,t=[];n.current.filtered.groups.forEach(n=>{let r=i.current.get(n),a=0;r.forEach(t=>{let n=e.get(t);a=Math.max(n,a)}),t.push([n,a])});let r=x.current;N().sort((t,n)=>{let r=t.getAttribute(`id`),i=n.getAttribute(`id`);return(e.get(i)??0)-(e.get(r)??0)}).forEach(e=>{let t=e.closest(ws);t?t.appendChild(e.parentElement===t?e:e.closest(`${ws} > *`)):r.appendChild(e.parentElement===r?e:e.closest(`${ws} > *`))}),t.sort((e,t)=>t[1]-e[1]).forEach(e=>{let t=x.current?.querySelector(`${Cs}[${ks}="${encodeURIComponent(e[0])}"]`);t?.parentElement.appendChild(t)})}function k(){let e=N().find(e=>e.getAttribute(`aria-disabled`)!==`true`)?.getAttribute(ks);T.setState(`value`,e||void 0)}function A(){if(!n.current.search||s.current.shouldFilter===!1){n.current.filtered.count=r.current.size;return}n.current.filtered.groups=new Set;let e=0;for(let t of r.current){let r=D(a.current.get(t)?.value??``,a.current.get(t)?.keywords??[]);n.current.filtered.items.set(t,r),r>0&&e++}for(let[e,t]of i.current)for(let r of t)if(n.current.filtered.items.get(r)>0){n.current.filtered.groups.add(e);break}n.current.filtered.count=e}function j(){var e;let t=M();t&&(t.parentElement?.firstChild===t&&((e=t.closest(Cs)?.querySelector(Ts))==null||e.scrollIntoView({block:`nearest`})),t.scrollIntoView({block:`nearest`}))}function M(){return x.current?.querySelector(`${Es}[aria-selected="true"]`)}function N(){return Array.from(x.current?.querySelectorAll(Ds)||[])}function P(e){let t=N()[e];t&&T.setState(`value`,t.getAttribute(ks))}function F(e){var t;let n=M(),r=N(),i=r.findIndex(e=>e===n),a=r[i+e];(t=s.current)!=null&&t.loop&&(a=i+e<0?r[r.length-1]:i+e===r.length?r[0]:r[i+e]),a&&T.setState(`value`,a.getAttribute(ks))}function I(e){let t=M()?.closest(Cs),n;for(;t&&!n;)t=e>0?Ks(t,Cs):qs(t,Cs),n=t?.querySelector(Ds);n?T.setState(`value`,n.getAttribute(ks)):F(e)}let L=()=>P(N().length-1),ee=e=>{e.preventDefault(),e.metaKey?L():e.altKey?I(1):F(1)},R=e=>{e.preventDefault(),e.metaKey?P(0):e.altKey?I(-1):F(-1)};return Q.createElement(S.div,{ref:t,tabIndex:-1,..._,"cmdk-root":``,onKeyDown:e=>{var t;(t=_.onKeyDown)==null||t.call(_,e);let n=e.nativeEvent.isComposing||e.keyCode===229;if(!(e.defaultPrevented||n))switch(e.key){case`n`:case`j`:g&&e.ctrlKey&&ee(e);break;case`ArrowDown`:ee(e);break;case`p`:case`k`:g&&e.ctrlKey&&R(e);break;case`ArrowUp`:R(e);break;case`Home`:e.preventDefault(),P(0);break;case`End`:e.preventDefault(),L();break;case`Enter`:{e.preventDefault();let t=M();if(t){let e=new Event(Os);t.dispatchEvent(e)}}}}},Q.createElement(`label`,{"cmdk-label":``,htmlFor:E.inputId,id:E.labelId,style:nc},c),tc(e,e=>Q.createElement(Ns.Provider,{value:T},Q.createElement(js.Provider,{value:E},e))))}),Ls=Q.forwardRef((e,t)=>{let n=C(),r=Q.useRef(null),i=Q.useContext(Fs),a=Ms(),o=Js(e),s=o.current?.forceMount??i?.forceMount;Ys(()=>{if(!s)return a.item(n,i?.id)},[s]);let c=Qs(n,r,[e.value,e.children,r],e.keywords),l=Ps(),u=Zs(e=>e.value&&e.value===c.current),d=Zs(e=>s||a.filter()===!1?!0:e.search?e.filtered.items.get(n)>0:!0);Q.useEffect(()=>{let t=r.current;if(!(!t||e.disabled))return t.addEventListener(Os,f),()=>t.removeEventListener(Os,f)},[d,e.onSelect,e.disabled]);function f(){var e,t;p(),(t=(e=o.current).onSelect)==null||t.call(e,c.current)}function p(){l.setState(`value`,c.current,!0)}if(!d)return null;let{disabled:m,value:h,onSelect:g,forceMount:_,keywords:y,...b}=e;return Q.createElement(S.div,{ref:v(r,t),...b,id:n,"cmdk-item":``,role:`option`,"aria-disabled":!!m,"aria-selected":!!u,"data-disabled":!!m,"data-selected":!!u,onPointerMove:m||a.getDisablePointerSelection()?void 0:p,onClick:m?void 0:f},e.children)}),Rs=Q.forwardRef((e,t)=>{let{heading:n,children:r,forceMount:i,...a}=e,o=C(),s=Q.useRef(null),c=Q.useRef(null),l=C(),u=Ms(),d=Zs(e=>i||u.filter()===!1?!0:e.search?e.filtered.groups.has(o):!0);Ys(()=>u.group(o),[]),Qs(o,s,[e.value,e.heading,c]);let f=Q.useMemo(()=>({id:o,forceMount:i}),[i]);return Q.createElement(S.div,{ref:v(s,t),...a,"cmdk-group":``,role:`presentation`,hidden:d?void 0:!0},n&&Q.createElement(`div`,{ref:c,"cmdk-group-heading":``,"aria-hidden":!0,id:l},n),tc(e,e=>Q.createElement(`div`,{"cmdk-group-items":``,role:`group`,"aria-labelledby":n?l:void 0},Q.createElement(Fs.Provider,{value:f},e))))}),zs=Q.forwardRef((e,t)=>{let{alwaysRender:n,...r}=e,i=Q.useRef(null),a=Zs(e=>!e.search);return!n&&!a?null:Q.createElement(S.div,{ref:v(i,t),...r,"cmdk-separator":``,role:`separator`})}),Bs=Q.forwardRef((e,t)=>{let{onValueChange:n,...r}=e,i=e.value!=null,a=Ps(),o=Zs(e=>e.search),s=Zs(e=>e.selectedItemId),c=Ms();return Q.useEffect(()=>{e.value!=null&&a.setState(`search`,e.value)},[e.value]),Q.createElement(S.input,{ref:t,...r,"cmdk-input":``,autoComplete:`off`,autoCorrect:`off`,spellCheck:!1,"aria-autocomplete":`list`,role:`combobox`,"aria-expanded":!0,"aria-controls":c.listId,"aria-labelledby":c.labelId,"aria-activedescendant":s,id:c.inputId,type:`text`,value:i?e.value:o,onChange:e=>{i||a.setState(`search`,e.target.value),n?.(e.target.value)}})}),Vs=Q.forwardRef((e,t)=>{let{children:n,label:r=`Suggestions`,...i}=e,a=Q.useRef(null),o=Q.useRef(null),s=Zs(e=>e.selectedItemId),c=Ms();return Q.useEffect(()=>{if(o.current&&a.current){let e=o.current,t=a.current,n,r=new ResizeObserver(()=>{n=requestAnimationFrame(()=>{let n=e.offsetHeight;t.style.setProperty(`--cmdk-list-height`,n.toFixed(1)+`px`)})});return r.observe(e),()=>{cancelAnimationFrame(n),r.unobserve(e)}}},[]),Q.createElement(S.div,{ref:v(a,t),...i,"cmdk-list":``,role:`listbox`,tabIndex:-1,"aria-activedescendant":s,"aria-label":r,id:c.listId},tc(e,e=>Q.createElement(`div`,{ref:v(o,c.listInnerRef),"cmdk-list-sizer":``},e)))}),Hs=Q.forwardRef((e,t)=>{let{open:n,onOpenChange:r,overlayClassName:i,contentClassName:a,container:o,...s}=e;return Q.createElement(N,{open:n,onOpenChange:r},Q.createElement(M,{container:o},Q.createElement(z,{"cmdk-overlay":``,className:i}),Q.createElement(F,{"aria-label":e.label,"cmdk-dialog":``,className:a},Q.createElement(Is,{ref:t,...s}))))}),Us=Q.forwardRef((e,t)=>Zs(e=>e.filtered.count===0)?Q.createElement(S.div,{ref:t,...e,"cmdk-empty":``,role:`presentation`}):null),Ws=Q.forwardRef((e,t)=>{let{progress:n,children:r,label:i=`Loading...`,...a}=e;return Q.createElement(S.div,{ref:t,...a,"cmdk-loading":``,role:`progressbar`,"aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,"aria-label":i},tc(e,e=>Q.createElement(`div`,{"aria-hidden":!0},e)))}),Gs=Object.assign(Is,{List:Vs,Item:Ls,Input:Bs,Group:Rs,Separator:zs,Dialog:Hs,Empty:Us,Loading:Ws});function Ks(e,t){let n=e.nextElementSibling;for(;n;){if(n.matches(t))return n;n=n.nextElementSibling}}function qs(e,t){let n=e.previousElementSibling;for(;n;){if(n.matches(t))return n;n=n.previousElementSibling}}function Js(e){let t=Q.useRef(e);return Ys(()=>{t.current=e}),t}var Ys=typeof window>`u`?Q.useEffect:Q.useLayoutEffect;function Xs(e){let t=Q.useRef();return t.current===void 0&&(t.current=e()),t}function Zs(e){let t=Ps(),n=()=>e(t.snapshot());return Q.useSyncExternalStore(t.subscribe,n,n)}function Qs(e,t,n,r=[]){let i=Q.useRef(),a=Ms();return Ys(()=>{var o;let s=(()=>{for(let e of n){if(typeof e==`string`)return e.trim();if(typeof e==`object`&&`current`in e)return e.current?e.current.textContent?.trim():i.current}})(),c=r.map(e=>e.trim());a.value(e,s,c),(o=t.current)==null||o.setAttribute(ks,s),i.current=s}),i}var $s=()=>{let[e,t]=Q.useState(),n=Xs(()=>new Map);return Ys(()=>{n.current.forEach(e=>e()),n.current=new Map},[e]),(e,r)=>{n.current.set(e,r),t({})}};function ec(e){let t=e.type;return typeof t==`function`?t(e.props):`render`in t?t.render(e.props):e}function tc({asChild:e,children:t},n){return e&&Q.isValidElement(t)?Q.cloneElement(ec(t),{ref:t.ref},n(t.props.children)):n(t)}var nc={position:`absolute`,width:`1px`,height:`1px`,padding:`0`,margin:`-1px`,overflow:`hidden`,clip:`rect(0, 0, 0, 0)`,whiteSpace:`nowrap`,borderWidth:`0`};function rc(e){let t=(0,Z.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=y(`flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,$.jsx)(Gs,{"data-slot":`command`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function ic(e){let t=(0,Z.c)(36),n,r,i,a,o,s,c,l;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4],o=t[5],s=t[6],c=t[7],l=t[8]):({title:s,description:c,children:n,className:r,showCloseButton:l,commandProps:i,onEscapeKeyDown:a,...o}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a,t[5]=o,t[6]=s,t[7]=c,t[8]=l);let u=s===void 0?`Command Palette`:s,d=c===void 0?`Search for a command to run`:c,f=l===void 0?!0:l,p;t[9]===i?p=t[10]:(p=i??{},t[9]=i,t[10]=p);let m,h;t[11]===p?(m=t[12],h=t[13]):({className:m,...h}=p,t[11]=p,t[12]=m,t[13]=h);let g;t[14]===r?g=t[15]:(g=y(`top-[12vh] translate-y-0 overflow-hidden p-0`,r),t[14]=r,t[15]=g);let _;t[16]===u?_=t[17]:(_=(0,$.jsx)(j,{className:`sr-only`,children:u}),t[16]=u,t[17]=_);let v;t[18]===d?v=t[19]:(v=(0,$.jsx)(A,{className:`sr-only`,children:d}),t[18]=d,t[19]=v);let b;t[20]===m?b=t[21]:(b=y(`[&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground [&_[cmdk-group]]:px-2 [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-input-wrapper]_svg]:h-5 [&_[cmdk-input-wrapper]_svg]:w-5 [&_[cmdk-input]]:h-12 [&_[cmdk-item]]:px-2 [&_[cmdk-item]]:py-3 [&_[cmdk-item]_svg]:h-5 [&_[cmdk-item]_svg]:w-5`,m),t[20]=m,t[21]=b);let x;t[22]!==n||t[23]!==h||t[24]!==b?(x=(0,$.jsx)(rc,{className:b,...h,children:n}),t[22]=n,t[23]=h,t[24]=b,t[25]=x):x=t[25];let S;t[26]!==a||t[27]!==f||t[28]!==g||t[29]!==_||t[30]!==v||t[31]!==x?(S=(0,$.jsxs)(P,{className:g,showCloseButton:f,onEscapeKeyDown:a,children:[_,v,x]}),t[26]=a,t[27]=f,t[28]=g,t[29]=_,t[30]=v,t[31]=x,t[32]=S):S=t[32];let C;return t[33]!==o||t[34]!==S?(C=(0,$.jsx)(te,{...o,children:S}),t[33]=o,t[34]=S,t[35]=C):C=t[35],C}function ac(e){let t=(0,Z.c)(9),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,$.jsx)(Eo,{className:`size-4 shrink-0 opacity-50`}),t[3]=i):i=t[3];let a;t[4]===n?a=t[5]:(a=y(`flex w-full rounded-md bg-transparent py-3 text-sm outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50`,n),t[4]=n,t[5]=a);let o;return t[6]!==r||t[7]!==a?(o=(0,$.jsxs)(`div`,{"data-slot":`command-input-wrapper`,className:`flex items-center gap-2 border-b px-3`,children:[i,(0,$.jsx)(Gs.Input,{"data-slot":`command-input`,className:a,...r})]}),t[6]=r,t[7]=a,t[8]=o):o=t[8],o}function oc(e){let t=(0,Z.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=y(`max-h-[300px] scroll-py-1 overflow-y-auto overflow-x-hidden`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,$.jsx)(Gs.List,{"data-slot":`command-list`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function sc(e){let t=(0,Z.c)(2),n;return t[0]===e?n=t[1]:(n=(0,$.jsx)(Gs.Empty,{"data-slot":`command-empty`,className:`py-6 text-center text-sm`,...e}),t[0]=e,t[1]=n),n}function cc(e){let t=(0,Z.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=y(`overflow-hidden p-1 text-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-mono [&_[cmdk-group-heading]]:uppercase **:[[cmdk-group-heading]]:tracking-wider`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,$.jsx)(Gs.Group,{"data-slot":`command-group`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function lc(e){let t=(0,Z.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=y(`relative flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none data-disabled:pointer-events-none data-disabled:opacity-50 data-[selected=true]:bg-accent data-[selected=true]:text-accent-foreground [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0 [&_svg:not([class*='text-'])]:text-muted-foreground`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,$.jsx)(Gs.Item,{"data-slot":`command-item`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function uc(e){let t=(0,Z.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=y(`ml-auto text-muted-foreground text-xs tracking-widest`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,$.jsx)(`span`,{"data-slot":`command-shortcut`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}async function dc(e,t){let n=null,r;try{n=await e.json()}catch(e){r=e}if(r instanceof Error&&r.name===`AbortError`)throw r;if(e.ok)return r!==void 0&&console.warn(`[parse-server-response] 2xx response with non-JSON body:`,r instanceof Error?r.message:String(r)),{ok:!0,body:r===void 0?n:null};if(r!==void 0){let t=r instanceof Error?r.message:String(r);return{ok:!1,title:`Server error (HTTP ${e.status}): ${t}`}}return{ok:!1,title:ai(n)??t}}function fc(e,t,n,r){let i=e.safeParse(t);return i.success?i.data:(console.warn(`[parse-server-response] schema drift:`,n,`bodyShape=`,typeof t==`object`&&t?Object.keys(t):typeof t,`issues=`,i.error.issues),r)}var pc=new Map,mc=null;function hc(){return fi(`PREWARM_CORRELATION_WINDOW_MS`,5e3)}function gc(){if(mc!==null)return;let e=Math.max(50,Math.floor(hc()/2));mc=setTimeout(()=>{mc=null,_c(Date.now()),pc.size>0&&gc()},e)}function _c(e){let t=hc();for(let[n,r]of pc)e-r.emittedAt>=t&&(pc.delete(n),X.count(`ok/sidebar/prewarm`,{hit:!1}))}function vc(e,t,n=Date.now()){pc.has(e)&&X.count(`ok/sidebar/prewarm`,{hit:!1}),pc.set(e,{poolEventId:t,emittedAt:n}),gc()}function yc(e,t,n=Date.now()){let r=pc.get(e);return!r||r.poolEventId!==t||n-r.emittedAt>=hc()?!1:(pc.delete(e),X(`ok/sidebar/prewarm-clicked`,{docName:e,t:n,poolEventId:t}),X.count(`ok/sidebar/prewarm`,{hit:!0}),!0)}et({event:Ht(`ok-branch-switched-clear-failed`),branch:An(),docName:An(),reason:An()});async function bc(e,t){let n=[];for(let[r,i]of e.entries)i.kind===`active`&&i.persistence!==null&&n.push(i.persistence.clearData().catch(e=>{let n={event:`ok-branch-switched-clear-failed`,docName:r,branch:t,reason:e instanceof Error?e.message:String(e)};console.warn(JSON.stringify(n))}));await Promise.all(n),e.clearBufferedUpdates(),e.recycleAllEntries()}function xc(e){let t=!1;return()=>{t?e():t=!0}}function Sc(e){let t=atob(e),n=new Uint8Array(t.length);for(let e=0;e<t.length;e++)n[e]=t.charCodeAt(e);return n}async function Cc(e,t=``){let n;try{n=await fetch(`${t}/api/server-info`,{signal:AbortSignal.timeout(5e3)})}catch{return}if(!n.ok)return;let r;try{r=await n.json()}catch{return}let i=Wn.safeParse(r);if(!i.success){console.warn(JSON.stringify({event:`ok-server-info-schema-mismatch`,issues:i.error.issues}));return}if(e.setExpectedServerInstanceId(i.data.serverInstanceId),Yi(i.data.serverInstanceId),i.data.currentBranch!==void 0&&e.compareAndUpdateObservedBranch(i.data.currentBranch)&&(bc(e,i.data.currentBranch),di(i.data.currentBranch)),i.data.currentDiskAckSVs!==void 0){let t={};for(let[e,n]of Object.entries(i.data.currentDiskAckSVs))try{t[e]=Sc(n)}catch{}e.observeDiskAckBatch(t)}}var wc=new Map,Tc=new Set;function Ec(){for(let e of Tc)e()}function Dc(e,t){wc.set(e,t),Ec()}function Oc(e,t){wc.get(e)===t&&(wc.delete(e),Ec())}function kc(e){return wc.get(e)??null}function Ac(e){return Tc.add(e),()=>Tc.delete(e)}function jc(e){return[...new Set(e)]}function Mc(e){return{async reconcileLocalRename({renamed:t,renamedFolders:n=[],renamedAssets:r=[],additionalRemovedDocNames:i=[]}){e.captureRenameSnapshots(t);let a=e.getActivePoolDocName(),o=[];for(let{fromDocName:n,toDocName:r}of t)o.push(n),a!==r&&e.hasPooledDocument(r)&&o.push(r);o.push(...i),await Promise.all(jc(o).map(t=>e.closeAndClear(t))),e.remapTabs({renamed:t,renamedFolders:n,renamedAssets:r})},async reconcileLocalRemoval({tabIdsToClose:t,docNamesToClear:n}){e.closeTabs(t),await Promise.all(jc(n).map(t=>e.closeAndClear(t)))},async reconcileAuthRename({fromDocName:t,toDocName:n}){let r=e.getActivePoolDocName()===t,i=[{fromDocName:t,toDocName:n}];e.captureRenameSnapshots(i),await Promise.all([e.closeAndClear(t),e.closeAndClear(n)]),r&&e.openAndActivate(n),e.remapTabs({renamed:i,renamedFolders:[],renamedAssets:[]});let a=e.remapActiveTargetForRename(t,n);(r||a)&&e.navigateToDocument(n)},async reconcileAuthRemoval({docName:t}){let n=e.getActivePoolDocName()===t;await e.closeAndClear(t),e.removeDocumentTab(t),e.clearActiveTargetForRemoval(t),n&&e.navigateHome()}}}var Nc=/[\uD800-\uDBFF]/,Pc=/[\uDC00-\uDFFF]/,Fc=(e,t)=>{let n=0,r=0;for(;n<e.length&&n<t.length&&e[n]===t[n];)n++;for(n>0&&Nc.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&&Pc.test(e[e.length-r])&&r--,{index:n,remove:e.length-n-r,insert:t.slice(n,t.length-r)}},Ic=(e,t)=>e>>>t|e<<32-t,Lc=e=>Ic(e,2)^Ic(e,13)^Ic(e,22),Rc=e=>Ic(e,6)^Ic(e,11)^Ic(e,25),zc=e=>Ic(e,7)^Ic(e,18)^e>>>3,Bc=e=>Ic(e,17)^Ic(e,19)^e>>>10,Vc=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]),Hc=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),Uc=class{constructor(){let e=new ArrayBuffer(320);this._H=new Uint32Array(e,0,8),this._H.set(Hc),this._W=new Uint32Array(e,64,64)}_updateHash(){let e=this._H,t=this._W;for(let e=16;e<64;e++)t[e]=Bc(t[e-2])+t[e-7]+zc(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+Rc(o)+(o&s^~o&c)+Vc[e]+t[e]>>>0,d=Lc(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/Ri,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}},Wc=e=>new Uc().digest(e),Gc=new dr(`y-sync`),Kc=new dr(`y-undo`),qc=new dr(`yjs-cursor`),Jc=e=>{for(let t=6;t<e.length;t++)e[t%6]=e[t%6]^e[t];return e.slice(0,6)},Yc=e=>Hi(Jc(Wc(Ai(e)))),Xc=()=>({mapping:new Map,isOMark:new Map}),Zc=(e,t)=>t===void 0?!e.deleted:t.sv.has(e.id.client)&&t.sv.get(e.id.client)>e.id.clock&&!wi(t.ds,e.id),Qc=[{light:`#ecd44433`,dark:`#ecd444`}],$c=(e,t,n)=>{if(!e.has(n)){if(e.size<t.length){let n=la();e.forEach(e=>n.add(e)),t=t.filter(e=>!n.has(e))}e.set(n,Mi(t))}return e.get(n)},el=(e,{colors:t=Qc,colorMapping:n=new Map,permanentUserData:r=null,onFirstRender:i=()=>{},mapping:a}={})=>{let o=!1,s=new il(e,a),c=new kn({props:{editable:e=>{let t=Gc.getState(e);return t.snapshot==null&&t.prevSnapshot==null}},key:Gc,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(Gc);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)&&Pi(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=Kc.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)},Gc)})}},destroy:()=>{s.destroy()}})});return c},tl=(e,t,n)=>{if(t!==null&&t.anchor!==null&&t.head!==null)if(t.type===`all`)e.setSelection(new Ut(e.doc));else if(t.type===`node`){let r=Nl(n.doc,n.type,t.anchor,n.mapping);e.setSelection(nl(e,r))}else{let r=Nl(n.doc,n.type,t.anchor,n.mapping),i=Nl(n.doc,n.type,t.head,n.mapping);r!==null&&i!==null&&e.setSelection(Rn.between(e.doc.resolve(r),e.doc.resolve(i)))}},nl=(e,t)=>{let n=e.doc.resolve(t);return n.nodeAfter?tt.create(e.doc,t):Rn.near(n)},rl=(e,t)=>({type:t.selection.jsonID,anchor:jl(t.selection.anchor,e.type,e.mapping),head:jl(t.selection.head,e.type,e.mapping)}),il=class{constructor(e,t=new Map){this.type=e,this.prosemirrorView=null,this.mux=me(),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=rl(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()?(Ui&&this._domSelectionInView===null&&(Pi(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=zi.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||=ya(Xi(),new Map),this.prosemirrorView.dispatch(this._tr.setMeta(Gc,{snapshot:e,prevSnapshot:t}))}unrenderSnapshot(){this.mapping.clear(),this.mux(()=>{let e=this.type.toArray().map(e=>ol(e,this.prosemirrorView.state.schema,this)).filter(e=>e!==null),t=this._tr.replace(0,this.prosemirrorView.state.doc.content.size,new qn(Mn.from(e),0,0));t.setMeta(Gc,{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=>ol(e,this.prosemirrorView.state.schema,this)).filter(e=>e!==null),n=this._tr.replace(0,this.prosemirrorView.state.doc.content.size,new qn(Mn.from(t),0,0));if(e){let t=$i(Ci(e.anchor,0),n.doc.content.size),r=$i(Ci(e.head,0),n.doc.content.size);n.setSelection(Rn.create(n.doc,t,r))}this.prosemirrorView.dispatch(n.setMeta(Gc,{isChangeOrigin:!0,binding:this}))})}_renderSnapshot(e,t,n){let r=this.doc,i=this.type;if(e||=Li(this.doc),e instanceof Uint8Array||t instanceof Uint8Array)if((!(e instanceof Uint8Array)||!(t instanceof Uint8Array))&&Ki(),r=new Zi({gc:!1}),qi(r,t),t=Li(r),qi(r,e),e=Li(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[Ii(e,i._item.id.clock)].content.type}this.mapping.clear(),this.mux(()=>{r.transact(r=>{let a=n.permanentUserData;a&&a.dss.forEach(e=>{Fi(r,e,e=>{})});let o=(e,t)=>{let r=e===`added`?a.getUserByClientId(t.client):a.getUserByDeletedId(t);return{user:r,type:e,color:$c(n.colorMapping,n.colors,r)}},s=ji(i,new Qi(t.ds,e.sv)).map(n=>!n._item.deleted||Zc(n._item,e)||Zc(n._item,t)?ol(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 qn(Mn.from(s),0,0));this.prosemirrorView.dispatch(c.setMeta(Gc,{isChangeOrigin:!0}))},Gc)})}_typeChanged(e,t){if(this.prosemirrorView==null)return;let n=Gc.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);Fi(t,t.deleteSet,e=>{if(e.constructor===sa){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=>al(e,this.prosemirrorView.state.schema,this)).filter(e=>e!==null),r=this._tr.replace(0,this.prosemirrorView.state.doc.content.size,new qn(Mn.from(n),0,0));tl(r,this.beforeTransactionSelection,this),r=r.setMeta(Gc,{isChangeOrigin:!0,isUndoRedoOperation:t.origin instanceof ea}),this.beforeTransactionSelection!==null&&this._isLocalCursorInView()&&r.scrollIntoView(),this.prosemirrorView.dispatch(r)})}_prosemirrorChanged(e){this.doc.transact(()=>{wl(this.doc,this.type,e,this),this.beforeTransactionSelection=rl(this,this.prosemirrorView.state)},Gc)}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))}},al=(e,t,n,r,i,a)=>{let o=n.mapping.get(e);if(o===void 0){if(e instanceof ca)return ol(e,t,n,r,i,a);throw Wi()}return o},ol=(e,t,n,r,i,a)=>{let o=[],s=e=>{if(e instanceof ca){let s=al(e,t,n,r,i,a);s!==null&&o.push(s)}else{let s=e._item.right?.content?.type;s instanceof da&&!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=sl(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):ji(e,new Qi(i.ds,r.sv)).forEach(s);try{let s=e.getAttributes(r);r!==void 0&&(Zc(e._item,r)?Zc(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=t.node(e.nodeName,s,o);return n.mapping.set(e,c),c}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}},sl=(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,Sl(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},cl=(e,t)=>{let n=new na,r=e.map(e=>({insert:e.text,attributes:Cl(e.marks,t)}));return n.applyDelta(r),t.mapping.set(n,e),n},ll=(e,t)=>{let n=new ca(e.type.name);for(let t in e.attrs){let r=e.attrs[t];r!==null&&t!==`ychange`&&n.setAttribute(t,r)}return n.insert(0,pl(e).map(e=>ul(e,t))),t.mapping.set(n,e),n},ul=(e,t)=>e instanceof Array?cl(e,t):ll(e,t),dl=e=>typeof e==`object`&&!!e,fl=(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||dl(o)&&dl(s)&&fl(o,s)}return r},pl=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},ml=(e,t)=>{let n=e.toDelta();return n.length===t.length&&n.every((e,n)=>e.insert===t[n].text&&Ni(e.attributes||{}).length===t[n].marks.length&&ki(e.attributes,(e,r)=>{let i=xl(r),a=t[n].marks;return a.find(e=>e.type.name===i)?fl(e,a.find(e=>e.type.name===i)?.attrs):!1}))},hl=(e,t)=>{if(e instanceof ca&&!(t instanceof Array)&&Tl(e,t)){let n=pl(t);return e._length===n.length&&fl(e.getAttributes(),t.attrs)&&e.toArray().every((e,t)=>hl(e,n[t]))}return e instanceof na&&t instanceof Array&&ml(e,t)},gl=(e,t)=>e===t||e instanceof Array&&t instanceof Array&&e.length===t.length&&e.every((e,n)=>t[n]===e),_l=(e,t,n)=>{let r=e.toArray(),i=pl(t),a=i.length,o=r.length,s=$i(o,a),c=0,l=0,u=!1;for(;c<s;c++){let e=r[c],t=i[c];if(gl(n.mapping.get(e),t))u=!0;else if(!hl(e,t))break}for(;c+l<s;l++){let e=r[o-l-1],t=i[a-l-1];if(gl(n.mapping.get(e),t))u=!0;else if(!hl(e,t))break}return{equalityFactor:c+l,foundMappedChild:u}},vl=e=>{let t=``,n=e._start,r={};for(;n!==null;)n.deleted||(n.countable&&n.content instanceof ua?t+=n.content.str:n.content instanceof Ji&&(r[n.content.key]=null)),n=n.right;return{str:t,nAttrs:r}},yl=(e,t,n)=>{n.mapping.set(e,t);let{nAttrs:r,str:i}=vl(e),a=t.map(e=>({insert:e.text,attributes:Object.assign({},r,Cl(e.marks,n))})),{insert:o,remove:s,index:c}=Fc(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})))},bl=/(.*)(--[a-zA-Z0-9+/=]{8})$/,xl=e=>bl.exec(e)?.[1]??e,Sl=(e,t)=>{let n=[];for(let r in e)n.push(t.mark(xl(r),e[r]));return n},Cl=(e,t)=>{let n={};return e.forEach(e=>{if(e.type.name!==`ychange`){let r=ia(t.isOMark,e.type,()=>!e.type.excludes(e.type));n[r?`${e.type.name}--${Yc(e.toJSON())}`:e.type.name]=e.attrs}}),n},wl=(e,t,n,r)=>{if(t instanceof ca&&t.nodeName!==n.type.name)throw Error(`node name mismatch!`);if(r.mapping.set(t,n),t instanceof ca){let e=t.getAttributes(),r=n.attrs;for(let n in r)r[n]===null?t.removeAttribute(n):e[n]!==r[n]&&n!==`ychange`&&t.setAttribute(n,r[n]);for(let n in e)r[n]===void 0&&t.removeAttribute(n)}let i=pl(n),a=i.length,o=t.toArray(),s=o.length,c=$i(a,s),l=0,u=0;for(;l<c;l++){let e=o[l],t=i[l];if(!gl(r.mapping.get(e),t))if(hl(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(!gl(r.mapping.get(e),t))if(hl(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 na&&c instanceof Array)ml(n,c)||yl(n,c,r),l+=1;else{let i=n instanceof ca&&Tl(n,c),a=d instanceof ca&&Tl(d,f);if(i&&a){let e=_l(n,c,r),t=_l(d,f,r);e.foundMappedChild&&!t.foundMappedChild?a=!1:!e.foundMappedChild&&t.foundMappedChild||e.equalityFactor<t.equalityFactor?i=!1:a=!1}i?(wl(e,n,c,r),l+=1):a?(wl(e,d,f,r),u+=1):(r.mapping.delete(t.get(l)),t.delete(l,1),t.insert(l,[ul(c,r)]),l+=1)}}let n=s-l-u;if(s===1&&a===0&&o[0]instanceof na?(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(ul(i[t],r));t.insert(l,e)}},Gc)},Tl=(e,t)=>!(t instanceof Array)&&e.nodeName===t.type.name,El=null,Dl=class{constructor(e,t,n){this.view=e,this.key=t,this.value=n}apply(){let e=Gc.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)}}},Ol=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=El;El=null;let n=[];return t.forEach((e,t)=>{e.forEach((e,r)=>{n.push(new Dl(t,r,e))})}),new e(n)}},kl=(e=Ol.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()||Pi(0,()=>kl(e,!0));return}throw r}n=!1,e.dequeueFirst()}},Al=(e,t,n)=>{El||(El=new Map,Pi(0,kl)),ia(El,e,ma).set(t,n)},jl=(e,t,n)=>{if(e===0)return Ti(t,0,-1);let r=t._first===null?null:t._first.content.type;for(;r!==null&&t!==r;){if(r instanceof na){if(r._length>=e)return Ti(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 _a(r._item===null?null:r._item.id,r._item===null?oa(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 _a(r._item===null?null:r._item.id,r._item===null?oa(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 Ki();if(e===0&&r.constructor!==na&&r!==t)return Ml(r._item.parent,r._item)}return Ti(t,t._length,-1)},Ml=(e,t)=>{let n=null,r=null;return e._item===null?r=oa(e):n=ba(e._item.id.client,e._item.id.clock),new _a(n,r,t.id)},Nl=(e,t,n,r)=>{let i=xa(n,e);if(i===null||i.type!==t&&!aa(t,i.type._item))return null;let a=i.type,o=0;if(a.constructor===na)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;t++,n instanceof na?o+=n._length:o+=r.get(n).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;t.deleted||(e instanceof na?o+=e._length:o+=r.get(e).nodeSize),t=t.right}}a=e}return o-1},Pl=(e,t)=>{let n=e.toArray().map(e=>ol(e,t,Xc())).filter(e=>e!==null);return Mn.fromArray(n)},Fl=(e,t)=>t.topNodeType.create(null,Pl(e,t)),Il=(e,t)=>{let n=Xc(),r=e.toArray().map(e=>ol(e,t,n)).filter(e=>e!==null);return{doc:t.topNodeType.create(null,Mn.fromArray(r)),meta:n,mapping:n.mapping}},Ll=(e,t,n)=>e!==t,Rl=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},zl=e=>({style:`background-color: ${e.color}70`,class:`ProseMirror-yjs-selection`}),Bl=/^#[0-9a-fA-F]{6}$/,Vl=(e,t,n,r,i)=>{let a=Gc.getState(e);if(a==null||a.doc==null||a.binding==null)return cn.create(e.doc,[]);let o=a.doc,s=[];return a.snapshot!=null||a.prevSnapshot!=null||a.binding.mapping.size===0?cn.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`:Bl.test(n.color)||console.warn(`A user uses an unsupported color format`,n),n.name??=`User: ${c}`;let l=Nl(o,a.type,Bi(t.cursor.anchor),a.binding.mapping),u=Nl(o,a.type,Bi(t.cursor.head),a.binding.mapping);if(l!==null&&u!==null){let t=Ci(e.doc.content.size-1,0);l=$i(l,t),u=$i(u,t),s.push(dn.widget(u,()=>r(n,c),{key:c+``,side:10}));let a=$i(l,u),o=Ci(l,u);s.push(dn.inline(a,o,i(n,c),{inclusiveEnd:!0,inclusiveStart:!1}))}}}),cn.create(e.doc,s))},Hl=(e,{awarenessStateFilter:t=Ll,cursorBuilder:n=Rl,selectionBuilder:r=zl,getSelection:i=e=>e.selection}={},a=`cursor`)=>new kn({key:qc,state:{init(i,a){return Vl(a,e,t,n,r)},apply(i,a,o,s){let c=Gc.getState(s),l=i.getMeta(qc);return c&&c.isChangeOrigin||l&&l.awarenessUpdated?Vl(s,e,t,n,r):a.map(i.mapping,i.doc)}},props:{decorations:e=>qc.getState(e)},view:t=>{let n=()=>{t.docView&&Al(t,qc,{awarenessUpdated:!0})},r=()=>{let n=Gc.getState(t.state),r=e.getLocalState()||{};if(t.hasFocus()){let o=i(t.state),s=jl(o.anchor,n.type,n.binding.mapping),c=jl(o.head,n.type,n.binding.mapping);(r.cursor==null||!va(Bi(r.cursor.anchor),s)||!va(Bi(r.cursor.head),c))&&e.setLocalStateField(a,{anchor:s,head:c})}else r.cursor!=null&&Nl(n.doc,n.type,Bi(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)}}}}),Ul=e=>{let t=Kc.getState(e).undoManager;if(t!=null)return t.undo(),!0},Wl=e=>{let t=Kc.getState(e).undoManager;if(t!=null)return t.redo(),!0},Gl=new Set([`paragraph`]),Kl=(e,t)=>!(e instanceof sa)||!(e.content instanceof ha)||!(e.content.type instanceof da||e.content.type instanceof ca&&t.has(e.content.type.nodeName))||e.content.type._length===0,ql=({protectedNodes:e=Gl,trackedOrigins:t=[],undoManager:n=null}={})=>new kn({key:Kc,state:{init:(r,i)=>{let a=Gc.getState(i),o=n||new ea(a.type,{trackedOrigins:new Set([Gc].concat(t)),deleteFilter:t=>Kl(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=Gc.getState(r).binding,a=t.undoManager,o=a.undoStack.length>0,s=a.redoStack.length>0;return i?{undoManager:a,prevSel:rl(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=Gc.getState(e.state),n=Kc.getState(e.state).undoManager;return n.on(`stack-item-added`,({stackItem:n})=>{let r=t.binding;r&&n.meta.set(r,Kc.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()}}}}),Jl=new Map;function Yl(e){return Jl.get(e)}function Xl(e,t){Jl.set(e,t)}function Zl(e){Jl.delete(e)}var Ql=`open-knowledge-app`,$l=new Map,eu=new Set,tu=1024,nu=1024;function ru(){return Tr.getTracer(Ql)}function iu(e,t,n){if(eu.has(e))return null;let r=$l.get(e);if(r)return r;if($l.size>=nu){let e=$l.keys().next().value;if(e!==void 0){let t=$l.get(e);$l.delete(e);try{t?.span.end()}catch(e){console.warn(`[otel-spans] eviction span.end failed:`,e instanceof Error?e:String(e))}}}let i={span:ru().startSpan(`ok.cold-mount`,{attributes:{"mount.id":e,...t},startTime:n}),startTimeMs:n};return $l.set(e,i),i}function au(e,t,n,r,i){try{let a=iu(e,n,r),o=a?Tr.setSpan(Er.active(),a.span):Er.active();ru().startSpan(t,{attributes:{"mount.id":e,...n},startTime:r},o).end(i??Date.now())}catch(e){console.warn(`[otel-spans] emitColdMountChild failed:`,e instanceof Error?e:String(e))}}function ou(e,t){try{let n=$l.get(e);if(n&&($l.delete(e),n.span.end(t??Date.now())),!eu.has(e)){if(eu.size>=tu){let e=eu.values().next().value;e!==void 0&&eu.delete(e)}eu.add(e)}}catch(e){console.warn(`[otel-spans] finalizeColdMountSpan failed:`,e instanceof Error?e:String(e))}}var su=class extends Error{docName;constructor(e){super(`Mount aborted for "${e}"`),this.name=`MountAbortError`,this.docName=e}};function cu(){return fi(`MOUNT_STALLED_THRESHOLD_MS`,1e4)}function lu(e){e.stalledHandle!==null&&(clearTimeout(e.stalledHandle),e.stalledHandle=null)}function uu(e,t,n){if(e.stalledMarkEmitted)return;e.stalledMarkEmitted=!0;let r=n-e.createdAt;X(`ok/mount/stalled`,{docName:t,mountId:e.mountId,elapsedMs:r})}var du=new Map,fu=new Set;function pu(e){fu.add(e);for(let[t,n]of du)if(n.stalledMarkEmitted&&!n.settled)try{e(t,n.mountId)}catch{}return()=>{fu.delete(e)}}function mu(e,t){for(let n of fu)try{n(e,t.mountId)}catch{}}var hu=!1;function gu(){typeof document>`u`||document.visibilityState===`visible`&&yu(Date.now())}function _u(){hu||typeof document>`u`||typeof document.addEventListener==`function`&&(document.addEventListener(`visibilitychange`,gu),hu=!0)}function vu(){hu&&(typeof document>`u`||typeof document.removeEventListener==`function`&&(document.removeEventListener(`visibilitychange`,gu),hu=!1))}function yu(e){let t=cu();for(let[n,r]of du)r.settled||r.stalledMarkEmitted||e-r.createdAt<t||(uu(r,n,e),mu(n,r))}function bu(e){let{docName:t,mountId:n,construct:r,sizeStats:i}=e,a=du.get(t);if(a)return a.promise;let o=new AbortController,s=Date.now(),c=()=>{},l=()=>{},u=new Promise((e,t)=>{c=e,l=t}),d={promise:u,rejectFn:l,controller:o,mountId:n,createdAt:s,settled:!1,resolved:!1,preMountEditor:null,stalledHandle:null,stalledMarkEmitted:!1};return d.stalledHandle=setTimeout(()=>{d.settled||(uu(d,t,Date.now()),mu(t,d))},cu()),o.signal.addEventListener(`abort`,()=>{d.settled||(d.settled=!0,lu(d),d.preMountEditor&&=(wu(t,d.preMountEditor,`aborted`),null),du.delete(t),du.size===0&&vu(),X(`ok/mount/reject`,{docName:t,mountId:d.mountId,reason:`aborted`}),l(new su(t)),ou(d.mountId))}),du.set(t,d),_u(),X(`ok/mount/create`,{docName:t,mountId:d.mountId}),Tu({docName:t,construct:r,sizeStats:i,entry:d,resolveFn:c,rejectFn:l}).catch(e=>{if(d.preMountEditor&&=(wu(t,d.preMountEditor,`backstop`),null),d.settled){X(`ok/mount/post-settle-throw`,{docName:t,mountId:d.mountId,message:e instanceof Error?e.message:String(e)});return}d.settled=!0,lu(d);let n=e instanceof Error?e:Error(String(e));X(`ok/mount/reject`,{docName:t,mountId:d.mountId,reason:`unhandled-body-throw`,message:n.message}),l(n),ou(d.mountId)}),u}function xu(e){return du.get(e)?.resolved===!0}function Su(e){return du.get(e)?.controller??null}function Cu(e){let t=du.get(e);t&&(t.settled=!0,lu(t),t.preMountEditor&&=(wu(e,t.preMountEditor,`aborted`),null),du.delete(e),du.size===0&&vu(),X(`ok/mount/invalidate`,{docName:e,mountId:t.mountId}),ou(t.mountId),t.controller.abort())}function wu(e,t,n){let r=Eu(t);try{t.destroy()}catch(t){X(`ok/mount/destroy-failed`,{docName:e,stage:n,message:t instanceof Error?t.message:String(t)})}r&&(r.restore=void 0)}async function Tu(e){let{docName:t,construct:n,sizeStats:r,entry:i,resolveFn:a,rejectFn:o}=e,s=document.createElement(`div`);if(od(t)!==void 0){let e=Wu({docName:t,container:s,factory:()=>{throw Error(`mount-promise: V2 cache contract violation — factory invoked on HIT for "${t}"`)}});i.settled=!0,i.resolved=!0,lu(i),a(e);return}if(await scheduler.yield(),i.controller.signal.aborted)return;let c=null;try{c=n()}catch(e){i.settled=!0,lu(i);let n=e instanceof Error?e:Error(String(e));X(`ok/mount/reject`,{docName:t,mountId:i.mountId,reason:`construct-failed`,message:n.message}),o(n),ou(i.mountId);return}if(i.preMountEditor=c.editor,await scheduler.yield(),i.controller.signal.aborted){i.preMountEditor=null;return}try{c.editor.mount(s)}catch(e){wu(t,c.editor,`mount-failed`),i.preMountEditor=null,i.settled=!0,lu(i);let n=e instanceof Error?e:Error(String(e));X(`ok/mount/reject`,{docName:t,mountId:i.mountId,reason:`mount-failed`,message:n.message}),o(n),ou(i.mountId);return}let l;try{l=Wu({docName:t,container:s,sizeStats:r,factory:()=>c})}catch(e){wu(t,c.editor,`v2-register-failed`),i.preMountEditor=null,i.settled=!0,lu(i);let n=e instanceof Error?e:Error(String(e));X(`ok/mount/reject`,{docName:t,mountId:i.mountId,reason:`v2-register-failed`,message:n.message}),o(n),ou(i.mountId);return}i.preMountEditor=null,i.settled=!0,i.resolved=!0,lu(i);let u=Date.now()-i.createdAt;X(`ok/mount/resolve`,{docName:t,mountId:i.mountId,elapsedMs:u}),X.histogram(`ok/mount/resolve-elapsed-ms`,{docName:t,mountId:i.mountId},u),a(l);let d=Date.now();au(i.mountId,`ok.mount-promise`,{"doc.name":t,elapsed_ms:u},i.createdAt,d),ou(i.mountId,d)}function Eu(e){try{let t=e.state;return Kc.getState(t)?.undoManager??null}catch(e){return X(`ok/cache/undo-manager-read-failed`,{message:e instanceof Error?e.message:String(e)}),null}}var Du=fi(`MAX_CACHE`,10),Ou=fi(`VIEW_COUNT_CACHE_THRESHOLD`,50),ku=fi(`BYTES_CACHE_THRESHOLD`,8e6);function Au(e){return!(e.viewCount>0&&e.viewCount>=Ou||e.bytes>ku)}var ju=new Map,Mu=new Map,Nu=new Map;function Pu(e,t){if(Nu.size>=Du){let e=Nu.keys().next().value;e!==void 0&&Nu.delete(e)}Nu.set(e,t),X(`ok/cache/snapshot-stored`,{toDocName:e,htmlBytes:t.html.length,hasScroll:t.scrollTop>0,hasSelection:t.selection!==null})}function Fu(e){return Nu.get(e)??null}function Iu(e){if(!Nu.has(e))return;let t=Nu.get(e)??null;Nu.delete(e),X(`ok/cache/snapshot-consumed`,{docName:e,hit:t!==null,hasScroll:t!==null&&t.scrollTop>0,hasSelection:t!==null&&t.selection!==null})}function Lu(){try{return typeof document>`u`?0:document.querySelector(`[data-testid="editor-scroll-container"]`)?.scrollTop??0}catch(e){return X(`ok/cache/snapshot-scroll-read-failed`,{message:e instanceof Error?e.message:String(e)}),0}}function Ru(e){try{let t=e.state.selection;return t instanceof Rn?{type:`text`,anchor:t.anchor,head:t.head}:t instanceof tt?{type:`node`,from:t.from}:null}catch(e){return X(`ok/cache/snapshot-selection-read-failed`,{message:e instanceof Error?e.message:String(e)}),null}}function zu(e){for(let t of e)try{let e=od(t.fromDocName);if(e&&!e.editor.isDestroyed){if(e.ytext.length===0){X(`ok/cache/snapshot-skipped-empty`,{fromDocName:t.fromDocName});continue}Pu(t.toDocName,{html:e.editor.getHTML(),scrollTop:Lu(),selection:Ru(e.editor)})}else X(`ok/cache/snapshot-skipped`,{fromDocName:t.fromDocName})}catch(e){X(`ok/cache/snapshot-capture-failed`,{fromDocName:t.fromDocName,message:e instanceof Error?e.message:String(e)})}}var Bu=[],Vu=[],Hu=new Set;function Uu(){if(typeof document>`u`)return null;let e=document.createElement(`div`);return e.setAttribute(`data-ok-editor-parking`,``),e.style.display=`none`,e.style.position=`absolute`,e.style.left=`-99999px`,e}function Wu(e){let{docName:t,container:n,factory:r,sizeStats:i}=e;if(i&&!Au(i)){let e=r(n);return X(`ok/cache/miss`,{docName:t,mountId:Yl(t),viewCount:i?.viewCount??-1,bytes:i?.bytes??-1,reason:`size-gate`}),{editor:e.editor,ydoc:e.ydoc,ytext:e.ytext,provider:e.provider,scrollTop:0,hadFocus:!1,activeMountKey:t,parkingNode:null,__uncached:!0}}let a=ju.get(t);if(a){if(X(`ok/cache/reparent-start`,{docName:t,mountId:Yl(t),kind:`tiptap`,viewCount:i?.viewCount??-1,bytes:i?.bytes??-1}),Qu(a,n),a.activeMountKey=t,ed(Bu,t),n.scrollTop=a.scrollTop,a.hadFocus)try{a.editor.commands.focus()}catch{}return X(`ok/cache/reparent-end`,{docName:t,mountId:Yl(t),kind:`tiptap`,viewCount:i?.viewCount??-1,bytes:i?.bytes??-1}),X(`ok/cache/hit`,{docName:t,mountId:Yl(t),kind:`tiptap`}),i&&X(`ok/cold/editor-mount-stats`,{docName:t,mountId:Yl(t),viewCount:i.viewCount,bytes:i.bytes,cacheHit:!0,kind:`tiptap`}),a}for(;ju.size>=Du;){let e=td(Bu,t);if(!e)break;Ku(e)}let o=r(n),s={editor:o.editor,ydoc:o.ydoc,ytext:o.ytext,provider:o.provider,scrollTop:0,hadFocus:!1,activeMountKey:t,parkingNode:null};return ju.set(t,s),ed(Bu,t),X(`ok/cache/miss`,{docName:t,mountId:Yl(t),viewCount:i?.viewCount??-1,bytes:i?.bytes??-1,reason:`cold`,kind:`tiptap`}),i&&X(`ok/cold/editor-mount-stats`,{docName:t,mountId:Yl(t),viewCount:i.viewCount,bytes:i.bytes,cacheHit:!1,kind:`tiptap`}),s}function Gu(e){let t=e.activeMountKey;if(e.__uncached){t&&Cu(t);let n=Eu(e.editor);try{e.editor.destroy()}catch(e){X(`ok/cache/park-destroy-failed`,{docName:t??``,kind:`tiptap`,message:e instanceof Error?e.message:String(e)})}n&&(n.restore=void 0),e.activeMountKey=null;return}let n=Xu(e.editor);if(n){e.hadFocus=Zu(n.dom),e.scrollTop=(n.scrollDOM??n.dom.parentElement??n.dom).scrollTop??0;let t=n.dom.parentElement;t&&t.removeChild(n.dom),e.parkingNode||=Uu(),e.parkingNode&&e.parkingNode.appendChild(n.dom)}e.activeMountKey=null}function Ku(e){Cu(e);let t=ju.get(e);if(!t)return!1;let n=Eu(t.editor);try{t.editor.destroy()}catch(t){X(`ok/cache/evict-failed`,{docName:e,kind:`tiptap`,stage:`editor`,message:t instanceof Error?t.message:String(t)})}n&&(n.restore=void 0);try{t.provider.destroy()}catch(t){X(`ok/cache/evict-failed`,{docName:e,kind:`tiptap`,stage:`provider`,message:t instanceof Error?t.message:String(t)})}try{t.ydoc.destroy()}catch(t){X(`ok/cache/evict-failed`,{docName:e,kind:`tiptap`,stage:`ydoc`,message:t instanceof Error?t.message:String(t)})}ju.delete(e);let r=Bu.indexOf(e);return r!==-1&&Bu.splice(r,1),X(`ok/cache/evict`,{docName:e,kind:`tiptap`}),!0}function qu(e){let{docName:t,container:n,factory:r,sizeStats:i}=e;if(i&&!Au(i)){let e=r(n);return X(`ok/cache/miss`,{docName:t,mountId:Yl(t),viewCount:i?.viewCount??-1,bytes:i?.bytes??-1,reason:`size-gate`,kind:`cm`}),{view:e.view,ydoc:e.ydoc,ytext:e.ytext,provider:e.provider,themeCompartment:e.themeCompartment,wordWrapCompartment:e.wordWrapCompartment,placeholderCompartment:e.placeholderCompartment,lintCompartment:e.lintCompartment,scrollTop:0,hadFocus:!1,activeMountKey:t,parkingNode:null,__uncached:!0}}let a=Mu.get(t);if(a){if(X(`ok/cache/reparent-start`,{docName:t,mountId:Yl(t),kind:`cm`,viewCount:i?.viewCount??-1,bytes:i?.bytes??-1}),$u(a,n),a.activeMountKey=t,ed(Vu,t),n.scrollTop=a.scrollTop,a.hadFocus)try{a.view.focus()}catch{}return X(`ok/cache/reparent-end`,{docName:t,mountId:Yl(t),kind:`cm`,viewCount:i?.viewCount??-1,bytes:i?.bytes??-1}),X(`ok/cache/hit`,{docName:t,mountId:Yl(t),kind:`cm`}),i&&X(`ok/cold/editor-mount-stats`,{docName:t,mountId:Yl(t),viewCount:i.viewCount,bytes:i.bytes,cacheHit:!0,kind:`cm`}),a}for(;Mu.size>=Du;){let e=td(Vu,t);if(!e)break;Yu(e)}let o=r(n),s={view:o.view,ydoc:o.ydoc,ytext:o.ytext,provider:o.provider,themeCompartment:o.themeCompartment,wordWrapCompartment:o.wordWrapCompartment,placeholderCompartment:o.placeholderCompartment,lintCompartment:o.lintCompartment,scrollTop:0,hadFocus:!1,activeMountKey:t,parkingNode:null};return Mu.set(t,s),ed(Vu,t),X(`ok/cache/miss`,{docName:t,mountId:Yl(t),viewCount:i?.viewCount??-1,bytes:i?.bytes??-1,reason:`cold`,kind:`cm`}),i&&X(`ok/cold/editor-mount-stats`,{docName:t,mountId:Yl(t),viewCount:i.viewCount,bytes:i.bytes,cacheHit:!1,kind:`cm`}),s}function Ju(e){if(e.__uncached){try{e.view.destroy()}catch(t){X(`ok/cache/park-destroy-failed`,{docName:e.activeMountKey??``,kind:`cm`,message:t instanceof Error?t.message:String(t)})}e.activeMountKey=null;return}let t=e.view.dom;e.hadFocus=Zu(t),e.scrollTop=(e.view.scrollDOM??t).scrollTop??0;let n=t.parentElement;n&&n.removeChild(t),e.parkingNode||=Uu(),e.parkingNode&&e.parkingNode.appendChild(t),e.activeMountKey=null}function Yu(e){let t=Mu.get(e);if(!t)return!1;try{t.view.destroy()}catch(t){X(`ok/cache/evict-failed`,{docName:e,kind:`cm`,stage:`view`,message:t instanceof Error?t.message:String(t)})}try{t.provider.destroy()}catch(t){X(`ok/cache/evict-failed`,{docName:e,kind:`cm`,stage:`provider`,message:t instanceof Error?t.message:String(t)})}try{t.ydoc.destroy()}catch(t){X(`ok/cache/evict-failed`,{docName:e,kind:`cm`,stage:`ydoc`,message:t instanceof Error?t.message:String(t)})}Mu.delete(e);let n=Vu.indexOf(e);return n!==-1&&Vu.splice(n,1),X(`ok/cache/evict`,{docName:e,kind:`cm`}),!0}function Xu(e){return e.editorView??null}function Zu(e){if(typeof document>`u`)return!1;let t=document.activeElement;return t?t===e?!0:e.contains(t):!1}function Qu(e,t){let n=Xu(e.editor);if(!n)return;let r=n.dom,i=r.parentElement;i&&i!==t&&i.removeChild(r),r.parentElement!==t&&t.appendChild(r)}function $u(e,t){let n=e.view.dom,r=n.parentElement;r&&r!==t&&r.removeChild(n),n.parentElement!==t&&t.appendChild(n)}function ed(e,t){let n=e.indexOf(t);n!==-1&&e.splice(n,1),e.push(t)}function td(e,t){for(let n of e)if(n!==t&&!Hu.has(n))return n;X(`ok/cache/evict-fallback-activity-saturated`,{mountingDocName:t,lruLength:e.length,activityMountCount:Hu.size});for(let n of e)if(n!==t)return n;return null}function nd(e){let t=Hu,n=new Set(e);for(let e of t){if(n.has(e))continue;let t=id(e);if(t)try{t.disconnect(),X(`ok/cache/disconnect`,{docName:e})}catch(t){X(`ok/cache/disconnect-failed`,{docName:e,message:t instanceof Error?t.message:String(t)})}}for(let e of n){if(t.has(e))continue;let n=id(e);if(!n)continue;let r=t=>{X(`ok/cache/connect-failed`,{docName:e,message:t instanceof Error?t.message:String(t)})};try{let t=n.connect();t&&typeof t.then==`function`?t.then(()=>X(`ok/cache/connect`,{docName:e}),e=>r(e)):X(`ok/cache/connect`,{docName:e})}catch(e){r(e)}}Hu=n}var rd=null;function id(e){let t=ju.get(e);if(t)return t.provider;let n=Mu.get(e);if(n)return n.provider;if(rd){let t=rd.entries.get(e);if(t)return t.provider}return null}function ad(e){rd=e;let t=e.onEvict(e=>{Ku(e),Yu(e)});return()=>{t(),rd===e&&(rd=null)}}function od(e){return ju.get(e)}function sd(e,t){let n=e.replace(/^\/+|\/+$/g,``);return`${pr}${n?`${n}/`:``}${t}`}function cd(e,t){return`${ht}/${e}/${t}`}function ld(e){let t=`${ht}/`;if(!e.startsWith(t)||!e.endsWith(`/SKILL`))return null;let n=e.slice(t.length,e.length-6);return n&&!n.includes(`/`)?n:null}function ud(e){return Qn.includes(e)}var dd=`ok-editor-tabs-v1:`,fd=`\0folder:`,pd=`\0asset:`,md=`\0skill-file:`,hd=`\0doc-tab:`,gd=/\.(md|mdx)$/i;function _d(e){let t=e.lastIndexOf(hd);return t<0?{baseTabId:e,instanceSuffix:``}:{baseTabId:e.slice(0,t),instanceSuffix:e.slice(t)}}function vd(e){return _d(e).baseTabId}function yd(e){return gd.test(e)?e.replace(gd,``):null}function bd(e){if(typeof e!=`string`||e.length===0)return!1;let t=vd(e);return t.startsWith(fd)?t.length>8:t.startsWith(pd)?t.length>7:t.startsWith(md)?Sd(t)!==null:!0}function xd(e){return`${md}${e.scope}/${e.name}/${e.path}`}function Sd(e){if(!e.startsWith(md))return null;let t=e.slice(12).split(`/`);if(t.length<3)return null;let[n,r,...i]=t,a=i.join(`/`);return!n||!r||!a||!ud(n)?null:{scope:n,name:r,path:a}}function Cd(e){return e}function wd(e){return`${fd}${e}`}function Td(e){return`${pd}${e}`}function Ed(e,t){let n=ld(e);if(n){let e=zr(n);return{baseName:e,extension:``,label:e,prefix:``}}let r=e.lastIndexOf(`/`),i=r<0?e:e.slice(r+1),a=gd.test(t)&&gd.test(i)?``:t,o=`${i}${a}`;return r<0?{baseName:i,extension:a,label:o,prefix:``}:{baseName:i,extension:a,label:o,prefix:`${e.slice(0,r)}/`}}function Dd(e){switch(e.kind){case`doc`:case`folder-index`:case`large-file`:return Cd(e.docName);case`folder`:return wd(e.folderPath);case`missing`:return Cd(e.target);case`asset`:return Td(e.assetPath);case`skill-file`:return xd(e)}}function Od(e){let t=vd(e);if(t.startsWith(fd))return{kind:`folder`,folderPath:t.slice(8)};if(t.startsWith(pd))return{kind:`asset`,assetPath:t.slice(7)};let n=Sd(t);return n?{kind:`skill-file`,...n}:{kind:`doc`,docName:t}}function kd(e){let t=Od(e);return t.kind===`doc`?t.docName:null}function Ad(e,t){if(!Array.isArray(e)||t<=0)return[];let n=[],r=new Set;for(let i of e)if(bd(i)&&!r.has(i)&&(r.add(i),n.push(i),n.length>=t))break;return n}function jd(e,t){let n=new Set(Ad(t,2**53-1));return Ad(e,2**53-1).filter(e=>n.has(e))}function Md(e,t,n){if(t<=0)return[];let r=new Set(Ad(n,2**53-1)),i=Ad(e,2**53-1);if(r.size===0&&i.length<=t)return i;let a=[],o=0;for(let e=i.length-1;e>=0;e--){let n=i[e];if(r.has(n)){a.push(n);continue}o>=t||(o++,a.push(n))}return a.reverse()}function Nd(e,t,n){let r=jd(e,n);return!Ad(n,2**53-1).includes(t)||r.includes(t)?r:[...r,t]}function Pd(e,t){return Ad(e,2**53-1).filter(e=>e!==t)}function Fd(e,t){let n=new Set(Ad(t,2**53-1));return Ad(e,2**53-1).filter(e=>!n.has(e))}function Id(e,t,n){let r=Ad(e,2**53-1),i=jd(t,r),a=r.indexOf(n);if(a<0)return i;let o=i.includes(n),s=a<i.length;return o===s?i:s?Nd(i,n,r):Pd(i,n)}function Ld(e,t,n,r=[]){let i=Md(e,n,r);return!bd(t)||i.includes(t)?i:Md([...i,t],n,r)}function Rd(e,t,n,r,i=[]){let a=Md(e,r,i);if(!bd(n))return a;if(!t||t===n)return Ld(a,n,r,i);let o=a.filter(e=>e!==n),s=o.indexOf(t);if(s<0)return Ld(o,n,r,i);let c=[...o];return c[s]=n,Md(c,r,i)}function zd(e,t,n){return Bd(e,Cd(t),n)}function Bd(e,t,{behavior:n,currentTabId:r,limit:i,pinnedTabIds:a=[]}){let o=Md(e,i,a),s=vd(t);if(r&&o.includes(r)&&vd(r)===s)return{tabs:o,activeTabId:r};let c=o.find(e=>vd(e)===s);return c?{tabs:o,activeTabId:c}:n===`replace-active`?{tabs:Rd(o,r,s,i,a),activeTabId:s}:{tabs:Ld(o,s,i,a),activeTabId:s}}function Vd(e,t){return e.filter(e=>e!==t)}function Hd(e,t,n){let r=Ad(t,2**53-1),i=new Set(r),a=new Set(n),o=new Set,s=[];for(let t of e)o.has(t)||!i.has(t)&&!a.has(t)||(o.add(t),s.push(t));for(let e of[...r,...n])o.has(e)||(o.add(e),s.push(e));return s}function Ud(e,{pages:t,folderPaths:n,assetPaths:r,filePaths:i,keepMissingDocName:a=null,keepHashDocName:o=null}){return Ad(e,2**53-1).filter(e=>{let s=Od(e);if(s.kind===`folder`)return n.has(s.folderPath);if(s.kind===`asset`)return r.has(s.assetPath)||i?.has(s.assetPath)===!0;if(s.kind===`skill-file`)return!0;let c=yd(s.docName);return t.has(s.docName)||c!==null&&t.has(c)||gn(s.docName)||s.docName===a||s.docName===o})}function Wd(e,t,n,r=[],i=[],a=[]){if(t.length===0&&r.length===0&&a.length===0)return Ad(e,n);let o=new Map(t.map(e=>[e.fromDocName,e.toDocName])),s=new Map(a.flatMap(e=>{let t=yd(e.fromPath);return t?[[t,e.toPath]]:[]})),c=new Map(a.flatMap(e=>{let t=yd(e.toPath);return t?[[e.fromPath,t]]:[]})),l=e=>qd(Kd(e,r),a),u=(e,t)=>{let n=o.get(e);if(n)return n;let r=s.get(e);return r?Td(r):t},d=e=>{let t=c.get(e);return t?Cd(t):Td(l(e))},f=[],p=new Set;for(let t of e){let{instanceSuffix:e}=_d(t),a=Od(t),o=`${a.kind===`doc`?u(a.docName,vd(t)):a.kind===`folder`?wd(Kd(a.folderPath,r)):a.kind===`asset`?d(a.assetPath):vd(t)}${e}`;if(!p.has(o)&&(p.add(o),f.push(o),i.length===0&&f.length>=n))break}return i.length===0?f:Md(f,n,i.map(e=>{let t=Od(e);return t.kind===`doc`?u(t.docName,e):t.kind===`folder`?wd(Kd(t.folderPath,r)):t.kind===`asset`?d(t.assetPath):vd(e)}))}function Gd(e,t,n=[],r=[]){return Wd(e,t,2**53-1,n,[],r)}function Kd(e,t){for(let{fromPath:n,toPath:r}of t){if(e===n)return r;if(e.startsWith(`${n}/`))return`${r}${e.slice(n.length)}`}return e}function qd(e,t){for(let{fromPath:n,toPath:r}of t)if(e===n)return r;return e}function Jd(e,t,n){if(t!==n)return t;let r=e.indexOf(n);return r<0?e[0]??null:e[r+1]??e[r-1]??null}function Yd(e,t,n){if(!t)return null;let r=new Set(n);if(!r.has(t))return t;let i=e.indexOf(t);if(i<0)return e.find(e=>!r.has(e))??null;for(let t=i+1;t<e.length;t++)if(!r.has(e[t]))return e[t];for(let t=i-1;t>=0;t--)if(!r.has(e[t]))return e[t];return null}function Xd(e,t){if(typeof e!=`object`||!e)return{openTabs:[],pinnedTabIds:[],activeDocName:null,activeTabId:null,updatedAt:null};let n=e,r=Ad(n.openTabs,2**53-1),i=jd(n.pinnedTabIds,r),a=i.length===0?Ad(n.openTabs,t):Md(r,t,i),o=jd(n.pinnedTabIds,a),s=typeof n.activeTabId==`string`&&a.includes(n.activeTabId)?n.activeTabId:typeof n.activeDocName==`string`&&a.includes(n.activeDocName)?n.activeDocName:null,c=s?Od(s):null;return{openTabs:a,pinnedTabIds:o,activeDocName:c?.kind===`doc`?c.docName:null,activeTabId:s,updatedAt:typeof n.updatedAt==`string`?n.updatedAt:null}}function Zd(e,t,n=[],r=()=>new Date){let i=Ad(e,2**53-1),a=t&&i.includes(t)?t:null,o=a?Od(a):null;return{openTabs:i,pinnedTabIds:jd(n,i),activeDocName:o?.kind===`doc`?o.docName:null,activeTabId:a,updatedAt:r().toISOString()}}function Qd(e){return`${dd}${e}`}function $d(e,t,n){if(!e)return{openTabs:[],pinnedTabIds:[],activeDocName:null,activeTabId:null,updatedAt:null};try{let r=e.getItem(t);return r?Xd(JSON.parse(r),n):{openTabs:[],pinnedTabIds:[],activeDocName:null,activeTabId:null,updatedAt:null}}catch(e){return console.warn(`[editor-tabs] failed to read local tab session:`,e),{openTabs:[],pinnedTabIds:[],activeDocName:null,activeTabId:null,updatedAt:null}}}function ef(e,t,n){if(e)try{e.setItem(t,JSON.stringify(n))}catch(e){console.warn(`[editor-tabs] failed to write local tab session:`,e)}}var tf=e=>fa((t,n)=>{e.onerror=e=>n(Error(e.target.error)),e.onsuccess=e=>t(e.target.result)}),nf=(e,t)=>fa((n,r)=>{let i=indexedDB.open(e);i.onupgradeneeded=e=>t(e.target.result),i.onerror=e=>r(Gi(e.target.error)),i.onsuccess=e=>{let t=e.target.result;t.onversionchange=()=>{t.close()},n(t)}}),rf=e=>tf(indexedDB.deleteDatabase(e)),af=(e,t)=>t.forEach(t=>e.createObjectStore.apply(e,t)),of=(e,t,n=`readwrite`)=>{let r=e.transaction(t,n);return t.map(e=>_f(r,e))},sf=(e,t)=>tf(e.count(t)),cf=(e,t)=>tf(e.get(t)),lf=(e,t)=>tf(e.delete(t)),uf=(e,t,n)=>tf(e.put(t,n)),df=(e,t)=>tf(e.add(t)),ff=(e,t,n)=>tf(e.getAll(t,n)),pf=(e,t,n)=>{let r=null;return gf(e,t,e=>(r=e,!1),n).then(()=>r)},mf=(e,t=null)=>pf(e,t,`prev`),hf=(e,t)=>fa((n,r)=>{e.onerror=r,e.onsuccess=async e=>{let r=e.target.result;if(r===null||await t(r)===!1)return n();r.continue()}}),gf=(e,t,n,r=`next`)=>hf(e.openKeyCursor(t,r),e=>n(e.key)),_f=(e,t)=>e.objectStore(t),vf=(e,t)=>IDBKeyRange.upperBound(e,t),yf=(e,t)=>IDBKeyRange.lowerBound(e,t),bf=`custom`,xf=`updates`,Sf=(e,t=()=>{},n=()=>{})=>{let[r]=of(e.db,[xf]);return ff(r,yf(e._dbref,!1)).then(i=>{e._destroyed||(t(r),Oi(e.doc,()=>{i.forEach(t=>ta(e.doc,t))},e,!1),n(r))}).then(()=>mf(r).then(t=>{e._dbref=t+1})).then(()=>sf(r).then(t=>{e._dbsize=t})).then(()=>r)},Cf=(e,t=!0)=>Sf(e).then(n=>{(t||e._dbsize>=500)&&df(n,Di(e.doc)).then(()=>lf(n,vf(e._dbref,!0))).then(()=>sf(n).then(t=>{e._dbsize=t}))}),wf=class extends ga{constructor(e,t){super(),this.doc=t,this.name=e,this._dbref=0,this._dbsize=0,this._destroyed=!1,this.db=null,this.synced=!1,this._db=nf(e,e=>af(e,[[`updates`,{autoIncrement:!0}],[`custom`]])),this.whenSynced=fa(e=>this.on(`synced`,()=>e(this))),this._db.then(e=>{this.db=e,Sf(this,async e=>{await sf(e)>0&&df(e,Di(t))},()=>{if(this._destroyed)return this;this.synced=!0,this.emit(`synced`,[this])})}),this._storeTimeout=1e3,this._storeTimeoutId=null,this._storeUpdate=(e,t)=>{if(this.db&&t!==this){let[t]=of(this.db,[xf]);df(t,e).catch(e=>{globalThis.__okYdbWriteWarned||(globalThis.__okYdbWriteWarned=!0,console.warn(JSON.stringify({event:`ok-ydb-write-failed`,cause:e?.name??`unknown`,message:e?.message??String(e)})))}),++this._dbsize>=500&&(this._storeTimeoutId!==null&&clearTimeout(this._storeTimeoutId),this._storeTimeoutId=setTimeout(()=>{Cf(this,!1),this._storeTimeoutId=null},this._storeTimeout))}},t.on(`update`,this._storeUpdate),this.destroy=this.destroy.bind(this),t.on(`destroy`,this.destroy)}destroy(){return this._storeTimeoutId&&clearTimeout(this._storeTimeoutId),this.doc.off(`update`,this._storeUpdate),this.doc.off(`destroy`,this.destroy),this._destroyed=!0,this._db.then(e=>{e.close()})}clearData(){return this.destroy().then(()=>{rf(this.name)})}get(e){return this._db.then(t=>{let[n]=of(t,[bf],`readonly`);return cf(n,e)})}set(e,t){return this._db.then(n=>{let[r]=of(n,[bf]);return uf(r,t,e)})}del(e){return this._db.then(t=>{let[n]=of(t,[bf]);return lf(n,e)})}},Tf=`updates`,Ef=`custom`;function Df(){return!0}var Of=class{_idb;_dbName;whenSynced;constructor({branch:e,serverInstanceId:t,docName:n,doc:r}){if(typeof t!=`string`||t.length===0)throw Error(`createClientPersistence: serverInstanceId is required and must be non-empty`);this._dbName=`ok-ydoc:${e}:${t}:${n}`;let i=Df()?0:performance.now();this._idb=new wf(this._dbName,r),this.whenSynced=this._idb.whenSynced.then(()=>{if(!Df()){let e=performance.now();X(`ok/pool/idb-whensynced`,{docName:n,durationMs:Math.round((e-i)*1e3)/1e3},{startTime:i,duration:e-i})}return this})}get synced(){return this._idb.synced}async destroy(){let e=Df()?0:performance.now();try{await this._idb.destroy()}finally{if(!Df()){let t=performance.now();X(`ok/pool/idb-destroy`,{dbName:this._dbName,durationMs:Math.round((t-e)*1e3)/1e3},{startTime:e,duration:t-e})}}}async flushFullState(){this._idb.db===null&&await this.whenSynced;let e=this._idb.db;if(e===null)return;let t=this._idb;await new Promise((n,r)=>{let i=e.transaction(Tf,`readwrite`),a=i.objectStore(Tf),o=a.getAll();o.onerror=()=>r(o.error??Error(`flushFullState getAll failed`)),o.onsuccess=()=>{try{Oi(t.doc,()=>{for(let e of o.result)ta(t.doc,e)},t,!1);let e=a.add(Di(t.doc));e.onerror=()=>r(e.error??Error(`flushFullState add failed`)),e.onsuccess=()=>{a.delete(IDBKeyRange.upperBound(e.result,!0))}}catch(e){r(e instanceof Error?e:Error(String(e)));try{i.abort()}catch{}}},i.oncomplete=()=>n(),i.onabort=()=>r(i.error??Error(`flushFullState transaction aborted`))})}async clearData(){let e=Df()?0:performance.now();try{await this._idb.destroy();let e=this._dbName;await new Promise((t,n)=>{let r=indexedDB.deleteDatabase(e);r.onsuccess=()=>t(),r.onerror=()=>n(r.error),r.onblocked=()=>{console.warn(JSON.stringify({event:`ok-client-persistence-clear-blocked`,dbName:e}))}})}finally{if(!Df()){let t=performance.now();X(`ok/pool/idb-cleardata`,{dbName:this._dbName,durationMs:Math.round((t-e)*1e3)/1e3},{startTime:e,duration:t-e})}}}};function kf(e){return new Of(e)}async function Af(e){if(typeof indexedDB>`u`)return null;let t=`ok-ydoc:${e.branch}:${e.serverInstanceId}:${e.docName}`;if(typeof indexedDB.databases==`function`&&!(await indexedDB.databases()).some(e=>e.name===t))return null;let n=await new Promise((e,n)=>{let r=indexedDB.open(t);r.onupgradeneeded=()=>{let e=r.result;e.objectStoreNames.contains(Tf)||e.createObjectStore(Tf,{autoIncrement:!0}),e.objectStoreNames.contains(Ef)||e.createObjectStore(Ef)},r.onsuccess=()=>e(r.result),r.onerror=()=>n(r.error)});try{if(!n.objectStoreNames.contains(Tf))return null;let e=await new Promise((e,t)=>{let r=n.transaction(Tf,`readonly`).objectStore(Tf).getAll();r.onsuccess=()=>e(r.result),r.onerror=()=>t(r.error)});if(e.length===0)return null;let t=new Zi;try{Oi(t,()=>{for(let n of e)ta(t,n)});let n=t.getMap(`lifecycle`).get(wt);return typeof n==`string`&&n.length>0?n:null}finally{t.destroy()}}finally{n.close()}}function jf(e){return Ei(e)}function Mf(e,t){return t===null?Di(e):Di(e,t)}function Nf(e,t){if(e===null)return t;if(t===null)return e;let n=Vi(e),r=Vi(t),i=new Map;for(let[e,t]of n)i.set(e,t);for(let[e,t]of r){let n=i.get(e);(n===void 0||t>n)&&i.set(e,t)}return Ei(i)}function Pf(e){let t={};if(Dr.inject(Er.active(),t),!t.traceparent)return e;let n=e.includes(`?`)?`&`:`?`,r=[`traceparent=${encodeURIComponent(t.traceparent)}`];return t.tracestate&&r.push(`tracestate=${encodeURIComponent(t.tracestate)}`),`${e}${n}${r.join(`&`)}`}var Ff=({key:e,editor:t,onPaste:n,onDrop:r,allowedMimeTypes:i})=>new kn({key:e||new dr(`fileHandler`),props:{handleDrop(e,n){if(!r||!n.dataTransfer?.files.length)return!1;let a=e.posAtCoords({left:n.clientX,top:n.clientY}),o=Array.from(n.dataTransfer.files);return i&&(o=o.filter(e=>i.includes(e.type))),o.length===0?!1:(n.preventDefault(),n.stopPropagation(),r(t,o,a?.pos||0),!0)},handlePaste(e,r){if(!n||!r.clipboardData?.files.length)return!1;let a=Array.from(r.clipboardData.files),o=r.clipboardData.getData(`text/html`);return i&&(a=a.filter(e=>i.includes(e.type))),!(a.length===0||(r.preventDefault(),r.stopPropagation(),n(t,a,o),o.length>0))}}}),If=yr.create({name:`fileHandler`,addOptions(){return{onPaste:void 0,onDrop:void 0,allowedMimeTypes:void 0}},addProseMirrorPlugins(){return[Ff({key:new dr(this.name),editor:this.editor,allowedMimeTypes:this.options.allowedMimeTypes,onDrop:this.options.onDrop,onPaste:this.options.onPaste})]}});function Lf(e,t){let{state:n,view:r}=e;if(!n.selection.empty||!r.endOfTextblock(t))return!1;let i=n.selection.$head,a=t===`down`||t===`right`,o=null,s=-1;if(a){let e=i.after();if(e>=n.doc.content.size)return!1;o=n.doc.nodeAt(e),s=e}else{let e=i.before();if(e<=0||(o=n.doc.resolve(e).nodeBefore,!o))return!1;s=e-o.nodeSize}if(!o||o.type.name!==`jsxComponent`||o.childCount!==0||!tt.isSelectable(o))return!1;try{let t=tt.create(n.doc,s);return e.view.dispatch(n.tr.setSelection(t).scrollIntoView()),!0}catch(e){if(!(e instanceof RangeError))throw e;return nt(t),console.warn(JSON.stringify({event:`jsx-component-arrow-node-select-failed`,direction:t,tier:`L0`,reason:e.message.slice(0,500)})),!0}}function Rf(e){let{state:t,view:n}=e;if(!(t.selection instanceof Rn)||!t.selection.empty||!n.endOfTextblock(`up`))return!1;let r=t.selection.$head,i=-1;for(let e=r.depth-1;e>=1;e--)if(r.node(e).type.name===`jsxComponent`){i=e;break}if(i<0)return!1;for(let e=r.depth;e>i;e--)if(r.index(e-1)!==0)return!1;let a=r.before(i);try{let n=t.doc.resolve(a),r=Yn.findFrom(n,-1,!0);return!r||!(r instanceof Rn)?!1:(e.view.dispatch(t.tr.setSelection(r).scrollIntoView()),!0)}catch(e){if(!(e instanceof RangeError))throw e;return nt(`up`),console.warn(JSON.stringify({event:`jsx-component-arrow-node-select-failed`,direction:`up`,tier:`L2c`,reason:e.message.slice(0,500)})),!0}}function zf(e,t){let{state:n,view:r}=e;if(!(n.selection instanceof Rn)||!n.selection.empty||!r.endOfTextblock(t))return!1;let i=n.selection.$head,a=t===`down`||t===`right`,o=null,s=-1;if(a){let e=i.after();if(e>=n.doc.content.size)return!1;o=n.doc.nodeAt(e),s=e}else{let e=i.before();if(e<=0||(o=n.doc.resolve(e).nodeBefore,!o))return!1;s=e-o.nodeSize}if(!o||o.type.name!==`jsxComponent`||o.childCount===0)return!1;let c=s+o.nodeSize;try{let t=a?s+1:c-1,r=Yn.findFrom(n.doc.resolve(t),a?1:-1,!0);return!r||!(r instanceof Rn)||r.$head.pos<=s||r.$head.pos>=c?!1:(e.view.dispatch(n.tr.setSelection(r).scrollIntoView()),!0)}catch(e){if(!(e instanceof RangeError))throw e;return nt(t),console.warn(JSON.stringify({event:`jsx-component-arrow-node-select-failed`,direction:t,tier:`L2d`,reason:e.message.slice(0,500)})),!0}}var Bf=yr.create({name:`keyboardNav`,priority:50,addKeyboardShortcuts(){return{Escape:({editor:e})=>{let{state:t}=e;if(t.selection instanceof tt){if(t.selection.$from.depth===0)return e.commands.blur(),!0;let n=t.selection.from+t.selection.node.nodeSize,r=t.doc.resolve(Math.min(n,t.doc.content.size)),i=Rn.near(r);return e.view.dispatch(t.tr.setSelection(i)),!0}return t.selection instanceof Rn?e.commands.selectParentNode():!1},ArrowUp:({editor:e})=>{if(Lf(e,`up`)||Rf(e)||zf(e,`up`))return!0;let{state:t}=e;if(!(t.selection instanceof tt))return!1;let n=t.selection.from,r=t.doc.resolve(n);if(r.index(r.depth)===0)return!1;let i=r.before(r.depth);if(i<=0)return!1;let a=t.doc.resolve(i-1).nodeBefore;if(!a||i-1-a.nodeSize+1<0)return!1;try{let n=tt.create(t.doc,i-a.nodeSize);return e.view.dispatch(t.tr.setSelection(n).scrollIntoView()),!0}catch(e){if(!(e instanceof RangeError))throw e;return nt(`up`),console.warn(JSON.stringify({event:`jsx-component-arrow-node-select-failed`,direction:`up`,tier:`L2`,reason:e.message.slice(0,500)})),!1}},ArrowDown:({editor:e})=>{if(Lf(e,`down`)||zf(e,`down`))return!0;let{state:t}=e;if(!(t.selection instanceof tt))return!1;let n=t.selection.from+t.selection.node.nodeSize;if(n>=t.doc.content.size)return!1;try{if(!t.doc.nodeAt(n))return!1;let r=tt.create(t.doc,n);return e.view.dispatch(t.tr.setSelection(r).scrollIntoView()),!0}catch(e){if(!(e instanceof RangeError))throw e;return nt(`down`),console.warn(JSON.stringify({event:`jsx-component-arrow-node-select-failed`,direction:`down`,tier:`L2`,reason:e.message.slice(0,500)})),!1}},ArrowLeft:({editor:e})=>Lf(e,`left`)||zf(e,`left`),ArrowRight:({editor:e})=>Lf(e,`right`)||zf(e,`right`),Enter:({editor:e})=>{let{state:t}=e;if(!(t.selection instanceof Rn)||!t.selection.empty)return!1;let n=t.selection.$from,r=n.parent;if(r.type.name!==`paragraph`||r.textContent!==``||n.depth<2)return!1;let i=-1;for(let e=n.depth-1;e>=1;e--)if(n.node(e).type.name===`jsxComponent`){i=e;break}if(i<0)return!1;let a=n.node(i);if(n.index(i)!==a.childCount-1)return!1;let o=n.after(i);if(o>t.doc.content.size)return!1;let s=t.tr,c=n.before(n.depth),l=n.after(n.depth);s.delete(c,l);let u=o-(l-c),d=t.schema.nodes.paragraph.create();s.insert(u,d);let f=u+1;return s.setSelection(Rn.create(s.doc,f)),e.view.dispatch(s.scrollIntoView()),!0}}}}),Vf={query:``,options:{caseSensitive:!1,wholeWord:!1},activeIndex:0,matches:[]},Hf=/[A-Za-z0-9_]/;function Uf(e){return e!==void 0&&Hf.test(e)}function Wf(e,t,n){return!Uf(e[t-1])&&!Uf(e[n])}function Gf(e,t,n){if(t.length===0)return[];let r=n.caseSensitive?e:e.toLocaleLowerCase(),i=n.caseSensitive?t:t.toLocaleLowerCase(),a=[],o=0;for(;o<=r.length-i.length;){let t=r.indexOf(i,o);if(t===-1)break;let s=t+i.length;(!n.wholeWord||Wf(e,t,s))&&a.push({start:t,end:s,text:e.slice(t,s)}),o=s}return a}function Kf(e,t,n){if(t.length===0)return[];let r=[];return e.descendants((e,i)=>{if(!(!e.isText||typeof e.text!=`string`))for(let a of Gf(e.text,t,n))r.push({from:i+a.start,to:i+a.end,text:a.text})}),r}var qf=new dr(`findReplace`);function Jf(e,t){return t<=0||!Number.isFinite(e)?0:Math.min(Math.max(Math.trunc(e),0),t-1)}function Yf(e,t,n,r){let i=Kf(e.doc,t,n);return{query:t,options:n,activeIndex:Jf(r,i.length),matches:i}}function Xf(e,t,n){return t<=0?0:(Jf(e,t)+n+t)%t}function Zf(e,t,n){if(e.length===0)return 0;let r=t+n,i=e.findIndex(e=>e.from>=r);return i===-1?0:i}function Qf(e,t,n){if(t.matches.length===0)return null;let r=e.tr;for(let e of[...t.matches].reverse())r.insertText(n,e.from,e.to);let i=Kf(r.doc,t.query,t.options),a=Jf(0,i.length),o=i[a];return r.setMeta(qf,{type:`setActiveIndex`,activeIndex:a}),o&&r.setSelection(Rn.create(r.doc,o.from,o.to)),r.scrollIntoView()}function $f(e,t){let n=qf.getState(e)?.matches[t];return n?e.tr.setMeta(qf,{type:`setActiveIndex`,activeIndex:t}).setSelection(Rn.create(e.doc,n.from,n.to)).scrollIntoView():null}function ep(e){return qf.getState(e)??Vf}function tp(){return new kn({key:qf,state:{init:()=>Vf,apply(e,t,n,r){let i=e.getMeta(qf);if(i?.type===`clear`)return Vf;let a=t.query,o=t.options,s=t.activeIndex;if(i?.type===`setQuery`)a=i.query,o={...o,...i.options},s=i.activeIndex??0;else if(i?.type===`setOptions`)o={...o,...i.options},s=i.activeIndex??s;else if(i?.type===`setActiveIndex`)s=i.activeIndex;else if(!e.docChanged)return t;return a.length===0?{query:a,options:o,activeIndex:0,matches:[]}:Yf(r,a,o,s)}},props:{decorations(e){let t=qf.getState(e);return!t||t.matches.length===0?null:cn.create(e.doc,t.matches.map((e,n)=>dn.inline(e.from,e.to,{class:n===t.activeIndex?`ok-find-match ok-find-match-active`:`ok-find-match`})))}}})}var np=yr.create({name:`findReplace`,addCommands(){return{setFindQuery:(e,t)=>({state:n,dispatch:r})=>(r&&r(n.tr.setMeta(qf,{type:`setQuery`,query:e,options:t?.options,activeIndex:t?.activeIndex})),!0),setFindOptions:(e,t)=>({state:n,dispatch:r})=>(r&&r(n.tr.setMeta(qf,{type:`setOptions`,options:e,activeIndex:t})),!0),setActiveFindIndex:e=>({state:t,dispatch:n})=>(n&&n(t.tr.setMeta(qf,{type:`setActiveIndex`,activeIndex:e})),!0),selectNextFindMatch:()=>({state:e,dispatch:t})=>{let n=ep(e),r=$f(e,Xf(n.activeIndex,n.matches.length,1));return r?(t?.(r),!0):!1},selectPreviousFindMatch:()=>({state:e,dispatch:t})=>{let n=ep(e),r=$f(e,Xf(n.activeIndex,n.matches.length,-1));return r?(t?.(r),!0):!1},replaceCurrentFindMatch:e=>({state:t,dispatch:n})=>{let r=ep(t),i=r.matches[r.activeIndex];if(!i||!n)return!1;let a=t.tr.insertText(e,i.from,i.to),o=Kf(a.doc,r.query,r.options),s=Zf(o,i.from,e.length),c=o[s];return a.setMeta(qf,{type:`setActiveIndex`,activeIndex:s}),c&&a.setSelection(Rn.create(a.doc,c.from,c.to)),a.scrollIntoView(),n(a),!0},replaceAllFindMatches:e=>({state:t,dispatch:n})=>{let r=ep(t);if(!n)return!1;let i=Qf(t,r,e);return i?(n(i),!0):!1},clearFindMatches:()=>({state:e,dispatch:t})=>(t&&t(e.tr.setMeta(qf,{type:`clear`})),!0)}},addProseMirrorPlugins(){return[tp()]}}),rp=/^(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/i,ip=/^([-.\w+]+)@([-\w]+(?:\.[-\w]+)+)/,ap=/[-\d_]$/,op=xr.map(e=>`${e}:`);function sp(e){let t=e.toLowerCase();return op.some(e=>t.startsWith(e))}function cp(e,t){let n=0;for(let r of e)r===t&&n++;return n}function lp(e){let t=e.split(`.`),n=t[t.length-1],r=t[t.length-2];return!(n&&(/_/.test(n)||!/[a-zA-Z\d]/.test(n))||r&&(/_/.test(r)||!/[a-zA-Z\d]/.test(r)))}function up(e){return e.split(`.`).length>=2&&lp(e)}function dp(e){let t=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!t)return[e,``];let n=e.slice(0,t.index),r=t[0],i=r.indexOf(`)`),a=cp(n,`(`),o=cp(n,`)`);for(;i!==-1&&a>o;)n+=r.slice(0,i+1),r=r.slice(i+1),i=r.indexOf(`)`),o++;return[n,r]}function fp(e){let t=rp.exec(e);if(!t)return null;let n=t[1],r=t[2],i=t[3],a=``,o=/^w/i.test(n);if(o&&(r=n+r,n=``,a=`http://`),o?!up(r):!lp(r))return null;let[s]=dp(r+i);if(!s)return null;let c=n+s,l=a+n+s;return sp(l)?{href:l,text:c}:null}function pp(e){let t=ip.exec(e);if(!t)return null;let n=t[1],r=t[2];if(ap.test(r))return null;let i=`${n}@${r}`,a=`mailto:${i}`;return sp(a)?{href:a,text:i}:null}function mp(e){return e?fp(e)??pp(e):null}function hp(e,t){let n=Kc.getState(e.state)?.undoManager;n?.stopCapturing();try{e.dispatch(t)}finally{n?.stopCapturing()}}var gp=`\\u0000-\\u0020\\u00A0\\u1680\\u180E\\u2000-\\u2029\\u205F\\u3000`,_p=RegExp(`[${gp}]`),vp=RegExp(`[${gp}]$`),yp=`link`,bp=`gfm-autolink`,xp=`preventAutolink`,Sp=new dr(`gfmAutolink`);function Cp(e,t,n){let r=e.state.schema.marks.code;return r?e.state.doc.rangeHasMark(t,n,r):!1}function wp(e,t,n){let r=[],i=Bt(rt(e.doc,[...n]));for(let{newRange:e}of i){let n=Ft(t.doc,e,e=>e.isTextblock),i,a;if(n.length>1)i=n[0],a=t.doc.textBetween(i.pos,i.pos+i.node.nodeSize,void 0,` `);else if(n.length===1){let r=t.doc.textBetween(e.from,e.to,` `,` `);if(!vp.test(r))continue;i=n[0],a=t.doc.textBetween(i.pos,e.to,void 0,` `)}if(!i||!a||i.node.type.spec.code)continue;let o=a.split(_p).filter(Boolean),s=o[o.length-1];if(!s)continue;let c=mp(s);if(!c)continue;let l=i.pos+a.lastIndexOf(s)+1,u=l+c.text.length;r.push({from:l,to:u,href:c.href,text:c.text})}return r}function Tp(e={}){let t=e.isActiveEditor??(e=>e.hasFocus()),n=null,r=!1,i=[],a=()=>{r=!1;let e=n,a=i.splice(0,i.length);if(!e||e.isDestroyed||e.composing||!t(e))return;let o=e.state.schema.marks[yp];if(!o)return;let s=e.state.tr,c=!1,l=e.state.doc.content.size;for(let t of a){let{from:n,to:r,href:i,text:a}=t;n<0||r>l||n>=r||e.state.doc.textBetween(n,r)===a&&(gt(n,r,e.state.doc).some(e=>e.mark.type===o)||Cp(e,n,r)||(s=s.addMark(n,r,o.create({href:i,linkStyle:bp})),c=!0))}if(c){s=s.setMeta(xp,!0);try{hp(e,s)}catch(e){console.warn(`[gfm-autolink] linkify dispatch failed`,{candidates:a.map(e=>({from:e.from,to:e.to,href:e.href}))},e)}}};return new kn({key:Sp,view(e){return n=e,{destroy(){n=null,i.length=0,r=!1}}},appendTransaction(e,o,s){if(e.some(e=>e.getMeta(Gc))||e.some(e=>e.getMeta(`preventAutolink`))||!(e.some(e=>e.docChanged)&&!o.doc.eq(s.doc))||!n||!t(n))return null;let c=wp(o,s,e);return c.length===0?null:(i.push(...c),r||(r=!0,queueMicrotask(a)),null)}})}var Ep=yr.create({name:`gfmAutolink`,addOptions(){return{isActiveEditor:void 0}},addProseMirrorPlugins(){return[Tp({isActiveEditor:this.options.isActiveEditor})]}}),Dp=new dr(`imageUpload`);function Op(e){let t=document.createElement(`div`);t.className=`image-upload-skeleton w-full h-40 rounded-md bg-muted animate-pulse motion-reduce:animate-none my-2`,t.setAttribute(`data-upload-widget`,`loading`),t.setAttribute(`role`,`status`);let n=e?.name;return t.setAttribute(`aria-label`,n?Y._({id:`KDuPiY`,values:{fileName:n}}):Y._({id:`bGa3Fk`})),t}var kp=new kn({key:Dp,state:{init(){return{decorations:cn.empty,uploads:new Map}},apply(e,t){let n=t.decorations.map(e.mapping,e.doc),r=new Map;for(let[n,i]of t.uploads)r.set(n,e.mapping.map(i));let i=e.getMeta(Dp);if(!i)return{decorations:n,uploads:r};if(i.type===`add`){let t=dn.widget(i.pos,i.widget,{id:i.id,stopEvent:()=>!0}),a=n.add(e.doc,[t]),o=new Map(r);return o.set(i.id,e.mapping.map(i.pos)),{decorations:a,uploads:o}}if(i.type===`remove`){let e=n.find(void 0,void 0,e=>e.id===i.id),t=n.remove(e),a=new Map(r);return a.delete(i.id),{decorations:t,uploads:a}}return{decorations:n,uploads:r}}},props:{decorations(e){return Dp.getState(e)?.decorations??cn.empty}}});function Ap(e){let t=e.lastIndexOf(`/`);return t===-1?``:e.slice(0,t)}function jp(e){let t=e.lastIndexOf(`/`);return t===-1?e:e.slice(t+1)}function Mp(e){return e.split(`/`).filter(e=>e!==``)}function Np(e,t){let n=Ap(e),r=Ap(t),i=jp(e);if(n===r)return i;let a=Mp(r),o=Mp(n),s=0;for(;s<a.length&&s<o.length&&a[s]===o[s];)s++;let c=a.length-s,l=o.slice(s);return c===0?`./${[...l,i].join(`/`)}`:[...Array(c).fill(`..`),...l,i].join(`/`)}function Pp(e){return Be(e)}function Fp(e,t){return{type:`jsxComponent`,attrs:{componentName:e===`jsx-img`?`img`:e===`jsx-video`?`video`:`audio`,kind:`element`,attributes:[],sourceRaw:``,sourceDirty:!0,props:e===`jsx-img`?{src:t}:{src:t,controls:!0}}}}function Ip(e){let t=St(e);return t===`md`||t===`mdx`?{kind:`wiki-link`,ext:t}:vr.has(t)?{kind:`jsx-img`,ext:t}:pt.has(t)?{kind:`jsx-video`,ext:t}:Fn.has(t)?{kind:`jsx-audio`,ext:t}:lt.has(t)?{kind:`jsx-file`,ext:t}:ut.has(t)?{kind:`wikiembed`,ext:t}:{kind:`markdown-link`,ext:t}}async function Lp(e,t,n){let r=Pp(t),i=r?`${r}.md`:``;if(!i){ri.error(Y._({id:`z5pqI8`}));return}let a=crypto.randomUUID(),o=Op(e);t.view.dispatch(t.state.tr.setMeta(Dp,{type:`add`,id:a,pos:n,widget:o}));let s=new FormData;s.append(`file`,e),s.append(`parentDocName`,i);let c;try{c=await fetch(`/api/upload`,{method:`POST`,body:s})}catch(e){console.error(`[uploadAndInsert] Network error:`,e),Rp(t,a);return}let l;try{l=await c.json()}catch(e){console.error(`[uploadAndInsert] Response is not JSON:`,e),Rp(t,a);return}if(!c.ok){let e=_n.safeParse(l);if(!e.success){let n=new ue(`Upload response did not match ProblemDetails.`,{cause:e.error,status:c.status});console.error(`[uploadAndInsert] Server error (unparseable):`,n),Rp(t,a);return}console.error(`[uploadAndInsert] Server error:`,e.data),Rp(t,a,e.data.title);return}let u=yt.safeParse(l);if(!u.success){let e=new ue(`Upload success response did not match UploadAssetSuccess.`,{cause:u.error,status:c.status});console.error(`[uploadAndInsert] Response missing src:`,e),Rp(t,a);return}let d=u.data,f=d.src,p=d.deduped===!0,m=Ap(i),h=typeof d.path==`string`&&d.path.length>0?d.path:m?`${m}/${f}`:f;p&&ri.info(Y._({id:`VbqhBI`,values:{assetContentPath:h}}));let g=Ip(e.name),{state:_}=t,v=Dp.getState(_)?.uploads.get(a)??n,y=_.tr.setMeta(Dp,{type:`remove`,id:a}),b=Np(h,i),x=`/${h}`;if(g.kind===`jsx-file`){if(!_.schema.nodes.jsxComponent){console.error(`[uploadAndInsert] jsxComponent node missing from schema`),Rp(t,a);return}let n={type:`jsxComponent`,attrs:{componentName:`WikiEmbedFile`,kind:`element`,attributes:[],sourceRaw:``,sourceDirty:!0,props:{src:x,target:f,alias:null,anchor:null,size:bt(e.size)}}};t.chain().command(({tr:e})=>(e.setMeta(Dp,{type:`remove`,id:a}),!0)).focus().insertContentAt(v,n).command(({tr:e,dispatch:t})=>{if(!t)return!0;let n=e.mapping.map(v);return e.doc.nodeAt(n)?.type.name===`jsxComponent`&&e.setSelection(tt.create(e.doc,n)),!0}).run();return}if(g.kind===`jsx-img`||g.kind===`jsx-video`||g.kind===`jsx-audio`){if(!_.schema.nodes.jsxComponent){console.error(`[uploadAndInsert] jsxComponent node missing from schema`),Rp(t,a);return}let e=Fp(g.kind,x);t.chain().command(({tr:e})=>(e.setMeta(Dp,{type:`remove`,id:a}),!0)).focus().insertContentAt(v,e).command(({tr:e,dispatch:t})=>{if(!t)return!0;let n=e.mapping.map(v);return e.doc.nodeAt(n)?.type.name===`jsxComponent`&&e.setSelection(tt.create(e.doc,n)),!0}).run();return}if(g.kind===`wikiembed`){let e=_.schema.nodes.wikiLinkEmbed;if(!e){console.error(`[uploadAndInsert] wikiLinkEmbed node missing from schema`),Rp(t,a);return}y.insert(v,e.create({target:f,alias:null,anchor:null,resolvedSrc:x}))}else if(g.kind===`wiki-link`){let n=_.schema.nodes.wikiLink;if(!n){console.error(`[uploadAndInsert] wikiLink node missing from schema`),Rp(t,a);return}let r=de(e.name.replace(/\.(md|mdx)$/i,``));r?y.insert(v,n.create(r)):y.insert(v,_.schema.text(e.name))}else{let t=_.schema.marks.link;if(t){let n=_.schema.text(e.name,[t.create({href:b})]);y.insert(v,n)}else y.insert(v,_.schema.text(e.name))}t.view.dispatch(y)}function Rp(e,t,n){e.view.dispatch(e.state.tr.setMeta(Dp,{type:`remove`,id:t})),ri.error(n??Y._({id:`b3Thhd`}))}var zp=/\[([^\]]+)\]\(([^)\s]+)\)$/,Bp=`link`;function Vp(e,t,n,r,i){if(e.isDestroyed||e.composing)return;let{state:a}=e,o=a.schema.marks[Bp];if(!o)return;let s=t+n.length;if(t<0||s>a.doc.content.size||a.doc.textBetween(t,s)!==n||a.doc.rangeHasMark(t,s,o))return;let c=a.schema.text(r,[o.create({href:i})]);try{hp(e,a.tr.replaceRangeWith(t,s,c))}catch(e){console.warn(`[inline-link-rule] collapse dispatch failed`,{from:t,text:r,href:i},e)}}var Hp=yr.create({name:`inlineLinkInputRule`,addInputRules(){let e=this.editor;return[new en({find:zp,handler:({state:t,range:n,match:r})=>{let i=r[1],a=r[2];if(!i||!a||!gr(a))return null;let o=t.schema.marks[Bp];if(!o||t.doc.rangeHasMark(n.from,n.to,o))return null;let s=n.from,c=r[0],l=e.view;return queueMicrotask(()=>Vp(l,s,c,i,a)),null}})]}}),Up=`mathInline`,Wp=/\$\$([^$\n]+)\$\$$/,Gp=/(?<![\w$])\$([^\s$\n](?:[^$\n]*[^\s$\n])?)\$$/;function Kp(e,t,n){let r=t.exec(e);if(!r)return null;let i=r[1];return i?{formula:i,delimiter:n,literalLength:r[0].length}:null}function qp(e,t,n){if(e.isDestroyed||e.composing)return;let{state:r}=e,i=r.schema.nodes[Up];if(!i)return;let a=t+n.literalLength;if(t<0||a>r.doc.content.size)return;let o=`${n.delimiter}${n.formula}${n.delimiter}`;if(r.doc.textBetween(t,a)!==o)return;let s=!1;if(r.doc.nodesBetween(t,a,e=>(e.isInline&&!e.isText&&(s=!0),!s)),s)return;let c=i.create({formula:n.formula,sourceDelimiter:n.delimiter});try{hp(e,r.tr.replaceRangeWith(t,a,c))}catch(e){console.warn(`[math-input-rule] collapse dispatch failed`,{from:t,formula:n.formula,delimiter:n.delimiter},e)}}function Jp(e,t,n){return new en({find:t,handler:({state:r,range:i,match:a})=>{let o=Kp(a[0],t,n);if(!o||!r.schema.nodes[Up])return null;let s=i.from,c=e.view;return queueMicrotask(()=>qp(c,s,o)),null}})}var Yp=yr.create({name:`mathInputRule`,addInputRules(){return[Jp(this.editor,Wp,`$$`),Jp(this.editor,Gp,`$`)]}}),Xp=new Set;function Zp(e){Xp.add(e)}function Qp(e){return Xp.delete(e)}var $p=new dr(`markIdentity`);function em(){return{byId:new Map,counter:0}}function tm(e,t,n,r,i){let a=[];for(let e of t.byId.values()){let t=i?i.map(e.from,-1):e.from,n=i?i.map(e.to,1):e.to;n<=t||a.push({id:e.id,markType:e.markType,attrs:e.attrs,from:t,to:n})}let o=new Map,s=new Set,c=t.counter;return e.descendants((e,t)=>{if(!(!e.isInline||e.marks.length===0))for(let i of e.marks){if(!n.has(i.type.name)||r&&!r(i))continue;let l=null;for(let e of a)if(!s.has(e.id)&&e.markType===i.type.name&&nm(e.attrs,i.attrs)&&!(t<e.from||t>=e.to)){l=e.id;break}let u=l??`m${++c}`;s.add(u);let d=t,f=t+e.nodeSize,p=o.get(u);p?p.to=Math.max(p.to,f):o.set(u,{id:u,markType:i.type.name,attrs:i.attrs,from:d,to:f})}}),{byId:o,counter:c}}function nm(e,t){let n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(let r of n){let n=e[r],i=t[r];if(n!==i&&(typeof n!=`object`||!n||typeof i!=`object`||!i||!((Array.isArray(n)&&Array.isArray(i)||!Array.isArray(n)&&!Array.isArray(i)&&Object.getPrototypeOf(n)===Object.prototype&&Object.getPrototypeOf(i)===Object.prototype)&&nm(n,i))))return!1}return!0}function rm(e,t,n,r){let i=new Set(t.byId.keys());for(let[r,i]of t.byId)e.has(r)||n?.(i);for(let t of e)i.has(t)||r?.(t);return i}function im(e,t,n){let r=$p.getState(e);if(!r)return null;for(let e of r.byId.values())if(e.markType===n&&e.from<=t&&t<e.to)return e.id;return null}function am(e){let{markTypes:t,predicate:n,onRegister:r,onDeregister:i}=e,a=new Set(t);return new kn({key:$p,state:{init(e,t){return tm(t.doc,em(),a,n)},apply(e,t,r,i){return e.docChanged?tm(i.doc,t,a,n,e.mapping):t}},view(){let e=new Set;return{update(t){let n=$p.getState(t.state);n&&(e=rm(e,n,r,i))},destroy(){for(let t of e)i?.(t);e=new Set}}}})}var om=300,sm=150,cm=500,lm=class{registry=new Map;_activeNodeId=null;listeners=new Set;_snapshot={activeNodeId:null,active:null};register(e){this.registry.set(e.nodeId,e),this._activeNodeId===e.nodeId&&this.refreshSnapshot()}deregister(e){this.registry.delete(e)&&this._activeNodeId===e&&(this._activeNodeId=null,this.refreshSnapshot())}setActiveNode(e){this._activeNodeId!==e&&(e!==null&&!this.registry.has(e)||(this._activeNodeId=e,this.refreshSnapshot()))}getActiveNode(){return this._activeNodeId}getRegistration(e){return this.registry.get(e)}hasRegistration(e){return this.registry.has(e)}clear(){this.registry.clear(),this._activeNodeId=null,this.refreshSnapshot()}getSnapshot=()=>this._snapshot;subscribe=e=>(this.listeners.add(e),()=>{this.listeners.delete(e)});refreshSnapshot(){let e=this._activeNodeId==null?null:this.registry.get(this._activeNodeId)??null;this._snapshot={activeNodeId:this._activeNodeId,active:e};for(let e of this.listeners)e()}};function um(e,t){let n=e??null;for(;n&&typeof n==`object`;){let e=n.getAttribute;if(typeof e==`function`){let r=e.call(n,`data-mark-id`);if(r&&t.hasRegistration(r))return r;let i=e.call(n,`data-node-id`);if(i&&t.hasRegistration(i))return i}n=n.parentElement??null}return null}function dm(e){return e?e.closest(`[data-ok-prop-panel]`)!==null:!1}function fm(){return typeof document>`u`?!1:document.querySelector(`[data-ok-layer-spawned]`)!==null}var pm=e=>{let t=(0,Z.c)(18),{store:n}=e,r;t[0]===n?r=t[1]:(r=()=>n.getSnapshot(),t[0]=n,t[1]=r);let[i,a]=(0,Q.useState)(r),o,s;t[2]===n?(o=t[3],s=t[4]):(o=()=>(a(n.getSnapshot()),n.subscribe(()=>{a(n.getSnapshot())})),s=[n],t[2]=n,t[3]=o,t[4]=s),(0,Q.useEffect)(o,s);let{active:c}=i;if(!c)return null;let l;t[5]===n?l=t[6]:(l=()=>n.setActiveNode(null),t[5]=n,t[6]=l);let u,d,f;if(t[7]!==c.controls||t[8]!==c.nodeId||t[9]!==c.type||t[10]!==l){let e={nodeId:c.nodeId,type:c.type,deactivate:l};u=c.controls.propPanel?.(e),d=c.controls.toolbar?.(e),f=c.controls.breadcrumb?.(e),t[7]=c.controls,t[8]=c.nodeId,t[9]=c.type,t[10]=l,t[11]=u,t[12]=d,t[13]=f}else u=t[11],d=t[12],f=t[13];let p;return t[14]!==u||t[15]!==d||t[16]!==f?(p=(0,$.jsxs)($.Fragment,{children:[u,d,f]}),t[14]=u,t[15]=d,t[16]=f,t[17]=p):p=t[17],p};function mm(e){return e.editorView?.dom??null}function hm(e,t){let n=e;for(;n;){if(n.getAttribute?.(`data-mark-id`)===t||n.getAttribute?.(`data-node-id`)===t)return!0;n=n.parentElement}return!1}function gm(e){let{editor:t}=e,n=new lm,r=mm(t),i=!1,a=null,o=null,s=null,c=null,l=null,u=()=>{a!==null&&(clearTimeout(a),a=null),s=null},d=()=>{o!==null&&(clearTimeout(o),o=null)},f=()=>{c!==null&&(clearTimeout(c),c=null)},p=e=>{if(n.getActiveNode()===e){d();return}s===e&&a!==null||(u(),d(),s=e,a=setTimeout(()=>{a=null,s=null,n.setActiveNode(e)},om))},m=()=>{n.getActiveNode()!==null&&o===null&&(o=setTimeout(()=>{o=null,!fm()&&n.setActiveNode(null)},sm))},h=null,g=!1,_=e=>{try{g=!0,e.focus({preventScroll:!0})}catch{}finally{g=!1}},v=n.subscribe(()=>{let e=n.getActiveNode();if(e!==null){if(typeof document<`u`){let t=document.activeElement;h=t&&hm(t,e)?t:null}return}if(typeof document>`u`)return;let i=h;if(h=null,i&&document.contains(i)&&typeof i.focus==`function`){_(i);return}let a=r??mm(t);a&&typeof a.focus==`function`&&_(a)}),y=e=>{let t=e;if(t.button!==2){if(t.metaKey||t.ctrlKey||t.button===1){u(),t.button===1&&t.preventDefault?.();return}if(t.pointerType===`touch`){let t=um(e.target,n);if(t===null)return;f(),c=setTimeout(()=>{c=null,l=t,n.setActiveNode(t)},cm);return}u()}},b=()=>{f()},x=e=>{e.pointerType===`touch`&&c!==null&&f()},S=e=>{let t=e;if(t.button===2||t.type===`click`&&t.button===1)return;let r=um(e.target,n);if(r===null)return;if(l!==null){let e=l===r;if(l=null,e){t.preventDefault?.();return}}let i=t.metaKey||t.ctrlKey||t.button===1,a=n.getRegistration(r);if(a?.handlePrimary&&a.handlePrimary({nodeId:r,type:a.type,newTab:i})){t.preventDefault?.(),i||(u(),d(),n.getActiveNode()===r&&n.setActiveNode(null));return}i||(u(),d(),n.setActiveNode(r))},C=e=>{let t=e;if(t.key===`Escape`){n.getActiveNode()!==null&&(u(),d(),n.setActiveNode(null),t.preventDefault?.());return}if(t.key===`Tab`&&!t.shiftKey&&!t.altKey&&!t.metaKey&&!t.ctrlKey){let r=um(e.target,n);if(r!==null&&n.getActiveNode()===r){let e=document.querySelector(`[data-ok-prop-panel]`);if(e){let n=e.querySelector(`button:not([disabled]), [href], input:not([disabled]), [tabindex]:not([tabindex="-1"])`);if(n){t.preventDefault?.(),n.focus();return}}}return}let r=t.key===`Enter`,i=t.key===` `||t.key===`Spacebar`;if(!r&&!i)return;let a=um(e.target,n);if(a===null||i&&((e.target instanceof Element?e.target:null)?.closest(`[data-mark-id], [data-node-id]`)??null)?.getAttribute(`role`)===`link`)return;let o=n.getRegistration(a);if(t.preventDefault?.(),o?.handlePrimary&&o.handlePrimary({nodeId:a,type:o.type,newTab:!1})){u(),d(),n.getActiveNode()===a&&n.setActiveNode(null);return}n.setActiveNode(a)},w=e=>{let t=e;if(t.pointerType!==`mouse`)return;let r=t.target;if(!(r instanceof Element))return;if(dm(r)){d();return}let i=um(r,n);i!==null&&p(i)},T=e=>{let t=e;if(t.pointerType!==`mouse`)return;let r=t.target,i=t.relatedTarget;if(!(r instanceof Element))return;let a=i instanceof Element?i:null,o=um(r,n);if(o!==null){if(a&&dm(a)){d();return}if(a&&um(a,n)===o)return;s===o&&u(),m();return}if(dm(r)){if(a&&dm(a))return;let e=n.getActiveNode();if(e!==null&&a&&um(a,n)===e)return;m()}},E=e=>{if(g)return;let t=e.target;if(!(t instanceof Element))return;let r=um(t,n);r!==null&&(u(),d(),n.setActiveNode(r))},D=e=>{let t=e;if(n.getActiveNode()===null)return;let r=t.relatedTarget,i=r instanceof Element?r:null;i&&dm(i)||i&&um(i,n)!==null||m()},O=e=>{if(n.getActiveNode()===null)return;let t=e.target;t&&(r?.contains(t)||t instanceof Element&&(t.closest(`[data-ok-interaction-layer]`)||t.closest(`[data-ok-prop-panel]`)||t.closest(`[data-ok-layer-spawned]`))||(u(),d(),n.setActiveNode(null)))},k=()=>{i||(r=mm(t),r&&(r.addEventListener(`pointerdown`,y,!0),r.addEventListener(`pointerup`,b,!0),r.addEventListener(`pointercancel`,b,!0),r.addEventListener(`pointermove`,x,!0),r.addEventListener(`click`,S,!0),r.addEventListener(`auxclick`,S,!0),r.addEventListener(`keydown`,C,!0),typeof document<`u`&&(document.addEventListener(`pointerover`,w,!0),document.addEventListener(`pointerout`,T,!0),document.addEventListener(`focusin`,E,!0),document.addEventListener(`focusout`,D,!0),document.addEventListener(`pointerdown`,O,!0)),i=!0))},A=()=>{i&&=(r?.removeEventListener(`pointerdown`,y,!0),r?.removeEventListener(`pointerup`,b,!0),r?.removeEventListener(`pointercancel`,b,!0),r?.removeEventListener(`pointermove`,x,!0),r?.removeEventListener(`click`,S,!0),r?.removeEventListener(`auxclick`,S,!0),r?.removeEventListener(`keydown`,C,!0),typeof document<`u`&&(document.removeEventListener(`pointerover`,w,!0),document.removeEventListener(`pointerout`,T,!0),document.removeEventListener(`focusin`,E,!0),document.removeEventListener(`focusout`,D,!0),document.removeEventListener(`pointerdown`,O,!0)),!1)};return k(),{register(e){n.register(e),i||k()},deregister(e){n.deregister(e)},setActiveNode(e){n.setActiveNode(e)},getActiveNode(){return n.getActiveNode()},getRegistration(e){return n.getRegistration(e)},destroy(){A(),u(),d(),f(),v(),n.clear()},store:n}}var _m=e=>{let t=(0,Z.c)(2),{store:n}=e,r;return t[0]===n?r=t[1]:(r=(0,$.jsx)(`div`,{"data-ok-interaction-layer":``,className:`contents`,children:(0,$.jsx)(pm,{store:n})}),t[0]=n,t[1]=r),r},vm=new WeakMap;function ym(e){let t=vm.get(e);if(t)return t;let n=gm({editor:e});return vm.set(e,n),e.on(`destroy`,()=>{n.destroy(),vm.delete(e)}),n}var bm={AppWindow:Or,ChevronRight:Mr,CopyPlus:Br,FileText:Pe,Film:ke,GitBranch:kr,Image:J,LayoutPanelTop:po,MessageSquareWarning:xo,PanelTop:wo,Paperclip:Qr,Sigma:Ao,SquarePlay:jo,Volume2:Se,Workflow:Fo,ZoomIn:Me};function xm(e){return e&&Object.hasOwn(bm,e)?bm[e]:qa}var Sm={Info:Yr,Lightbulb:mo,MessageSquareWarning:xo,AlertTriangle:ti,AlertOctagon:So,ClipboardList:Qa,BookOpen:Ka,ListTodo:yo,CircleCheck:Rr,CircleHelp:Xa,CircleX:Za,Zap:Io,Bug:Ja,FlaskConical:so,Quote:To,ChevronRight:Mr},Cm=Object.entries(Sm).sort(([e],[t])=>e.localeCompare(t));function wm(e){if(!e||!e.startsWith(`lucide:`))return null;let t=e.slice(7);return Object.hasOwn(Sm,t)?Sm[t]??null:null}function Tm(e){let t=(0,Z.c)(24),n;t[0]===e.icon?n=t[1]:(n=wm(e.icon),t[0]=e.icon,t[1]=n);let r=n,i=r?`custom`:void 0,a;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,$.jsx)(Mr,{size:14,className:`accordion-chevron`,"aria-hidden":`true`}),t[2]=a):a=t[2];let o;t[3]===r?o=t[4]:(o=r?(0,$.jsx)(r,{size:16,className:`accordion-icon`,"aria-hidden":`true`}):null,t[3]=r,t[4]=o);let s=e.title??`Accordion`,c;t[5]===s?c=t[6]:(c=(0,$.jsx)(`span`,{className:`accordion-title`,children:s}),t[5]=s,t[6]=c);let l;t[7]===e.description?l=t[8]:(l=e.description?(0,$.jsx)(`span`,{className:`accordion-description`,children:e.description}):null,t[7]=e.description,t[8]=l);let u;t[9]!==c||t[10]!==l?(u=(0,$.jsxs)(`span`,{className:`accordion-title-group`,children:[c,l]}),t[9]=c,t[10]=l,t[11]=u):u=t[11];let d;t[12]!==o||t[13]!==u?(d=(0,$.jsxs)(`summary`,{className:`accordion-summary`,contentEditable:!1,children:[a,o,u]}),t[12]=o,t[13]=u,t[14]=d):d=t[14];let f;t[15]===e.children?f=t[16]:(f=(0,$.jsx)(`div`,{className:`accordion-body`,children:e.children}),t[15]=e.children,t[16]=f);let p;return t[17]!==e.defaultOpen||t[18]!==e.id||t[19]!==e.name||t[20]!==i||t[21]!==d||t[22]!==f?(p=(0,$.jsxs)(`details`,{className:`accordion`,"data-accordion-icon":i,open:e.defaultOpen,id:e.id,name:e.name,children:[d,f]}),t[17]=e.defaultOpen,t[18]=e.id,t[19]=e.name,t[20]=i,t[21]=d,t[22]=f,t[23]=p):p=t[23],p}function Em(e){return e!==!1}function Dm(e){let t=(0,Z.c)(12),n;t[0]===e.src?n=t[1]:(n=e.src===void 0?void 0:vn(e.src),t[0]=e.src,t[1]=n);let r=e.title,i;t[2]===e.controls?i=t[3]:(i=Em(e.controls),t[2]=e.controls,t[3]=i);let a;return t[4]!==e.autoplay||t[5]!==e.loop||t[6]!==e.muted||t[7]!==e.preload||t[8]!==e.title||t[9]!==n||t[10]!==i?(a=(0,$.jsx)(`audio`,{className:`ok-audio`,src:n,title:r,controls:i,autoPlay:e.autoplay,loop:e.loop,muted:e.muted,preload:e.preload}),t[4]=e.autoplay,t[5]=e.loop,t[6]=e.muted,t[7]=e.preload,t[8]=e.title,t[9]=n,t[10]=i,t[11]=a):a=t[11],a}var Om={note:Yr,tip:mo,important:xo,warning:ti,caution:So,abstract:Qa,info:Ka,todo:yo,success:Rr,question:Xa,failure:Za,danger:Io,bug:Ja,example:so,quote:To};function km(e,t){return wm(e)??Om[t]}var Am=new Set([`note`,`tip`,`important`,`warning`,`caution`,`abstract`,`info`,`todo`,`success`,`question`,`failure`,`danger`,`bug`,`example`,`quote`]);function jm(e){return typeof e==`string`&&Am.has(e)?e:`note`}function Mm(e){let t=(0,Z.c)(29),n,r;t[0]!==e.icon||t[1]!==e.type?(r=jm(e.type),n=km(e.icon,r),t[0]=e.icon,t[1]=e.type,t[2]=n,t[3]=r):(n=t[2],r=t[3]);let i=n,o;t[4]===e.color?o=t[5]:(o=e.color?{"--callout-type-color":e.color}:{},t[4]=e.color,t[5]=o);let s=o,c;t[6]!==i||t[7]!==e.title?(c=e.title||i?(0,$.jsxs)(`span`,{className:`callout-header`,contentEditable:!1,children:[(0,$.jsx)(i,{size:16,className:`callout-icon`,"aria-hidden":`true`}),e.title?(0,$.jsx)(`span`,{className:`callout-title`,children:e.title}):null]}):null,t[6]=i,t[7]=e.title,t[8]=c):c=t[8];let l=c;if(e.collapsible){let n=e.defaultOpen??!0,i;t[9]===l?i=t[10]:(i=l??(0,$.jsx)(`span`,{className:`callout-title`,children:(0,$.jsx)(a,{id:`URmyfc`})}),t[9]=l,t[10]=i);let o;t[11]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,$.jsx)(jr,{size:16,className:`callout-chevron`,"aria-hidden":`true`}),t[11]=o):o=t[11];let c;t[12]===i?c=t[13]:(c=(0,$.jsxs)(`summary`,{className:`callout-summary`,contentEditable:!1,children:[i,o]}),t[12]=i,t[13]=c);let u;t[14]===e.children?u=t[15]:(u=(0,$.jsx)(`div`,{className:`callout-body`,children:e.children}),t[14]=e.children,t[15]=u);let d;return t[16]!==n||t[17]!==s||t[18]!==c||t[19]!==u||t[20]!==r?(d=(0,$.jsxs)(`details`,{className:`callout callout-collapsible`,"data-callout-type":r,open:n,style:s,children:[c,u]}),t[16]=n,t[17]=s,t[18]=c,t[19]=u,t[20]=r,t[21]=d):d=t[21],d}let u;t[22]===e.children?u=t[23]:(u=(0,$.jsx)(`div`,{className:`callout-body`,children:e.children}),t[22]=e.children,t[23]=u);let d;return t[24]!==l||t[25]!==s||t[26]!==u||t[27]!==r?(d=(0,$.jsxs)(`div`,{className:`callout callout-static`,"data-callout-type":r,style:s,children:[l,u]}),t[24]=l,t[25]=s,t[26]=u,t[27]=r,t[28]=d):d=t[28],d}var Nm=[{key:`tl`,dx:-1,dy:-1,cursor:`nwse-resize`,className:`ok-resize-handle ok-resize-handle--tl`},{key:`t`,dx:0,dy:-1,cursor:`ns-resize`,className:`ok-resize-handle ok-resize-handle--t`},{key:`tr`,dx:1,dy:-1,cursor:`nesw-resize`,className:`ok-resize-handle ok-resize-handle--tr`},{key:`r`,dx:1,dy:0,cursor:`ew-resize`,className:`ok-resize-handle ok-resize-handle--r`},{key:`br`,dx:1,dy:1,cursor:`nwse-resize`,className:`ok-resize-handle ok-resize-handle--br`},{key:`b`,dx:0,dy:1,cursor:`ns-resize`,className:`ok-resize-handle ok-resize-handle--b`},{key:`bl`,dx:-1,dy:1,cursor:`nesw-resize`,className:`ok-resize-handle ok-resize-handle--bl`},{key:`l`,dx:-1,dy:0,cursor:`ew-resize`,className:`ok-resize-handle ok-resize-handle--l`}];function Pm(e){let t=(0,Z.c)(7),{targetRef:n,onResize:r,onResizeEnd:i,bounds:a}=e,{_:s}=o(),c=(0,Q.useRef)(null),l;t[0]!==a?.maxHeight||t[1]!==a?.maxWidth||t[2]!==a?.minHeight||t[3]!==a?.minWidth?(l=function(e,t){let n=t===`w`?a?.minWidth??64:a?.minHeight??64,r=t===`w`?a?.maxWidth??1/0:a?.maxHeight??1/0;return Math.max(n,Math.min(r,e))},t[0]=a?.maxHeight,t[1]=a?.maxWidth,t[2]=a?.minHeight,t[3]=a?.minWidth,t[4]=l):l=t[4];let u=l,d=function(e,t){let a=n.current;if(!a)return;e.preventDefault(),e.stopPropagation();let o=a.getBoundingClientRect();c.current={handle:t,startX:e.clientX,startY:e.clientY,startWidth:o.width,startHeight:o.height,latestWidth:o.width,latestHeight:o.height,hasMoved:!1};let s=e.currentTarget;try{s.setPointerCapture(e.pointerId)}catch{}document.body.style.setProperty(`cursor`,t.cursor),document.body.style.setProperty(`user-select`,`none`);let l=function(e){let t=c.current;if(!t)return;let n=(e.clientX-t.startX)*t.handle.dx,i=(e.clientY-t.startY)*t.handle.dy,a=t.handle.dx===0?t.startWidth:u(t.startWidth+n,`w`),o=t.handle.dy===0?t.startHeight:u(t.startHeight+i,`h`);t.latestWidth=a,t.latestHeight=o,t.hasMoved=!0,r({width:a,height:o})};function d(){let e=c.current;if(!e)return;let t={width:e.latestWidth,height:e.latestHeight},n=e.hasMoved;c.current=null,document.body.style.removeProperty(`cursor`),document.body.style.removeProperty(`user-select`),window.removeEventListener(`pointermove`,l),window.removeEventListener(`pointerup`,d),window.removeEventListener(`pointercancel`,d),n&&i?.(t)}window.addEventListener(`pointermove`,l),window.addEventListener(`pointerup`,d),window.addEventListener(`pointercancel`,d)},f=Nm.map(e=>{let t=e.key;return(0,$.jsx)(`button`,{type:`button`,className:y(e.className),"aria-label":s({id:`NxW-md`,values:{handleKey:t}}),tabIndex:-1,style:{cursor:e.cursor},onPointerDown:t=>d(t,e)},t)}),p;return t[5]===f?p=t[6]:(p=(0,$.jsx)(`div`,{className:`ok-resize-overlay`,contentEditable:!1,"aria-hidden":`true`,children:f}),t[5]=f,t[6]=p),p}var Fm=`26rem`,Im=`Embedded content`,Lm=/^https?:\/\//i;function Rm(e){try{return new URL(e).origin!==window.location.origin}catch{return!1}}function zm(e){return!(typeof e!=`string`||!Lm.test(e)||!Rm(e))}function Bm(e){let t=(0,Z.c)(24),{src:n,title:r,width:i,height:a}=e,o=(0,Q.useRef)(null),s=H(),c=i||void 0,l=a||Fm,u;t[0]!==c||t[1]!==l?(u={width:c,height:l},t[0]=c,t[1]=l,t[2]=u):u=t[2];let d=u,f,p;if(t[3]!==a||t[4]!==i?(f=()=>{let e=o.current;e&&(e.style.width=i||``,e.style.height=a||Fm)},p=[i,a],t[3]=a,t[4]=i,t[5]=f,t[6]=p):(f=t[5],p=t[6]),(0,Q.useEffect)(f,p),!zm(n)){let e=`Embed a URL`;typeof n==`string`&&n.length>0&&(e=Lm.test(n)?`Embed only supports cross-origin URLs`:`URL must start with http:// or https://`);let r;return t[7]===e?r=t[8]:(r=(0,$.jsx)(`div`,{className:`ok-embed ok-embed--placeholder`,contentEditable:!1,children:(0,$.jsx)(`span`,{children:e})}),t[7]=e,t[8]=r),r}let m;t[9]===s?m=t[10]:(m=e=>{if(!s)return;let{editor:t,getPos:n}=s,r=n();if(typeof r==`number`)try{let n=t.state.doc.nodeAt(r);if(!n||n.type.name!==`jsxComponent`)return;let i={...n.attrs.props??{},width:`${Math.round(e.width)}px`,height:`${Math.round(e.height)}px`};t.view.dispatch(t.state.tr.setNodeMarkup(r,null,{...n.attrs,props:i,sourceDirty:!0}))}catch(e){let t=e;if(t instanceof RangeError)return;throw t}},t[9]=s,t[10]=m);let h=m,g;t[11]===n?g=t[12]:(g=ir(n),t[11]=n,t[12]=g);let _=g,v=_===n?`no-referrer`:`strict-origin-when-cross-origin`,y=r||Im,b;t[13]!==_||t[14]!==v||t[15]!==y?(b=(0,$.jsx)(`iframe`,{title:y,src:_,sandbox:`allow-scripts allow-same-origin allow-forms allow-popups allow-popups-to-escape-sandbox allow-presentation`,referrerPolicy:v,loading:`lazy`,className:`ok-embed-frame`}),t[13]=_,t[14]=v,t[15]=y,t[16]=b):b=t[16];let x;t[17]!==s||t[18]!==h?(x=s?(0,$.jsx)(Pm,{targetRef:o,bounds:{minWidth:192,maxWidth:2e3,minHeight:128,maxHeight:Math.round(window.innerHeight*.9)},onResize:e=>{let t=o.current;t&&(t.style.width=`${e.width}px`,t.style.height=`${e.height}px`)},onResizeEnd:h}):null,t[17]=s,t[18]=h,t[19]=x):x=t[19];let S;return t[20]!==d||t[21]!==x||t[22]!==b?(S=(0,$.jsxs)(`div`,{className:`ok-embed`,style:d,ref:o,contentEditable:!1,children:[b,x]}),t[20]=d,t[21]=x,t[22]=b,t[23]=S):S=t[23],S}function Vm(e){if(!e)return``;let t,n=null;try{let r=new URL(e,`https://placeholder.local`);n=r.protocol,t=r.pathname}catch{t=e.split(`?`)[0]??e}if(n===`data:`||n===`blob:`)return``;let r=t.split(`/`),i=r[r.length-1]??``;try{return decodeURIComponent(i)}catch{return i}}function Hm(e){let t=(0,Z.c)(18),n;t[0]!==e.name||t[1]!==e.src?(n=e.name?.trim()||Vm(e.src)||`Untitled file`,t[0]=e.name,t[1]=e.src,t[2]=n):n=t[2];let r=n,i=e.size?.trim()?e.size:null,a;t[3]===e.src?a=t[4]:(a=e.src?vn(e.src):void 0,t[3]=e.src,t[4]=a);let o=a,s;t[5]===o?s=t[6]:(s=e=>{e.stopPropagation(),e.preventDefault(),o&&window.open(o,`_blank`,`noopener,noreferrer`)},t[5]=o,t[6]=s);let c=s,l;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,$.jsx)(ao,{className:`ok-file-icon`,"aria-hidden":`true`}),t[7]=l):l=t[7];let u;t[8]===r?u=t[9]:(u=(0,$.jsx)(`span`,{className:`ok-file-name`,children:r}),t[8]=r,t[9]=u);let d;t[10]===i?d=t[11]:(d=i?(0,$.jsx)(`span`,{className:`ok-file-size`,children:i}):null,t[10]=i,t[11]=d);let f;return t[12]!==c||t[13]!==o||t[14]!==e.title||t[15]!==u||t[16]!==d?(f=(0,$.jsxs)(`a`,{href:o,title:e.title,className:`ok-file-attachment`,target:`_blank`,rel:`noopener noreferrer`,onMouseDown:Um,onClick:c,children:[l,u,d]}),t[12]=c,t[13]=o,t[14]=e.title,t[15]=u,t[16]=d,t[17]=f):f=t[17],f}function Um(e){return e.stopPropagation()}function Wm(){return Q.createElement(`svg`,{"aria-hidden":`true`,"data-rmiz-btn-unzoom-icon":!0,fill:`currentColor`,focusable:`false`,viewBox:`0 0 16 16`,xmlns:`http://www.w3.org/2000/svg`},Q.createElement(`path`,{d:`M 14.144531 1.148438 L 9 6.292969 L 9 3 L 8 3 L 8 8 L 13 8 L 13 7 L 9.707031 7 L 14.855469 1.851563 Z M 8 8 L 3 8 L 3 9 L 6.292969 9 L 1.148438 14.144531 L 1.851563 14.855469 L 7 9.707031 L 7 13 L 8 13 Z`}))}function Gm(){return Q.createElement(`svg`,{"aria-hidden":`true`,"data-rmiz-btn-zoom-icon":!0,fill:`currentColor`,focusable:`false`,viewBox:`0 0 16 16`,xmlns:`http://www.w3.org/2000/svg`},Q.createElement(`path`,{d:`M 9 1 L 9 2 L 12.292969 2 L 2 12.292969 L 2 9 L 1 9 L 1 14 L 6 14 L 6 13 L 2.707031 13 L 13 2.707031 L 13 6 L 14 6 L 14 1 Z`}))}function Km(e){return typeof Element>`u`?!1:e instanceof Element}var qm=(e,t)=>Km(t)&&t.tagName.toUpperCase()===e,Jm=e=>qm(`DIV`,e)||qm(`SPAN`,e),Ym=e=>qm(`IMG`,e),Xm=e=>e.complete&&e.naturalHeight!==0,Zm=e=>qm(`SVG`,e),Qm=({height:e,offset:t,width:n})=>Math.min((window.innerWidth-t*2)/n,(window.innerHeight-t*2)/e),$m=({containerHeight:e,containerWidth:t,offset:n,targetHeight:r,targetWidth:i})=>{let a=Qm({height:r,offset:n,width:i}),o=i>r?i/t:r/e;return a>1?o:a*o},eh=({containerHeight:e,containerWidth:t,hasScalableSrc:n,offset:r,targetHeight:i,targetWidth:a})=>e===0||t===0?1:!n&&i!==0&&a!==0?$m({containerHeight:e,containerWidth:t,offset:r,targetHeight:i,targetWidth:a}):Qm({height:e,offset:r,width:t}),th=/url(?:\(['"]?)(?<url>.*?)(?:['"]?\))/,nh=e=>{if(e!==null){if(Ym(e))return e.currentSrc===``?void 0:e.currentSrc;if(Jm(e)){let{backgroundImage:t}=window.getComputedStyle(e);if(t!==``)return th.exec(t)?.[1]}}},rh=e=>{if(e!==null)return Ym(e)?e.alt:e.getAttribute(`aria-label`)??void 0},ih=({containerHeight:e,containerLeft:t,containerTop:n,containerWidth:r,hasScalableSrc:i,offset:a,targetHeight:o,targetWidth:s})=>{let c=eh({containerHeight:e,containerWidth:r,hasScalableSrc:i,offset:a,targetHeight:o,targetWidth:s});return{top:n,left:t,width:r*c,height:e*c,transform:`translate(0,0) scale(${1/c})`}},ah=({position:e,relativeNum:t})=>{let n=parseFloat(e);return e.endsWith(`%`)?t*n/100:n},oh=({containerHeight:e,containerLeft:t,containerTop:n,containerWidth:r,hasScalableSrc:i,objectFit:a,objectPosition:o,offset:s,targetHeight:c,targetWidth:l})=>{let u=a;if(u===`scale-down`&&(u=l<=r&&c<=e?`none`:`contain`),u===`cover`||u===`contain`){let a=r/l,d=e/c,f=u===`cover`?Math.max(a,d):Math.min(a,d),[p=`50%`,m=`50%`]=o.split(` `),h=ah({position:p,relativeNum:r-l*f}),g=ah({position:m,relativeNum:e-c*f}),_=eh({containerHeight:c*f,containerWidth:l*f,hasScalableSrc:i,offset:s,targetHeight:c,targetWidth:l});return{top:n+g,left:t+h,width:l*f*_,height:c*f*_,transform:`translate(0,0) scale(${1/_})`}}else if(u===`none`){let[a=`50%`,u=`50%`]=o.split(` `),d=ah({position:a,relativeNum:r-l}),f=ah({position:u,relativeNum:e-c}),p=eh({containerHeight:c,containerWidth:l,hasScalableSrc:i,offset:s,targetHeight:c,targetWidth:l});return{top:n+f,left:t+d,width:l*p,height:c*p,transform:`translate(0,0) scale(${1/p})`}}else if(u===`fill`){let t=r/l,n=e/c,a=Math.max(t,n),o=eh({containerHeight:c*a,containerWidth:l*a,hasScalableSrc:i,offset:s,targetHeight:c,targetWidth:l});return{width:r*o,height:e*o,transform:`translate(0,0) scale(${1/o})`}}else return{}},sh=({backgroundPosition:e,backgroundSize:t,containerHeight:n,containerLeft:r,containerTop:i,containerWidth:a,hasScalableSrc:o,offset:s,targetHeight:c,targetWidth:l})=>{if(t===`cover`||t===`contain`){let u=a/l,d=n/c,f=t===`cover`?Math.max(u,d):Math.min(u,d),[p=`50%`,m=`50%`]=e.split(` `),h=ah({position:p,relativeNum:a-l*f}),g=ah({position:m,relativeNum:n-c*f}),_=eh({containerHeight:c*f,containerWidth:l*f,hasScalableSrc:o,offset:s,targetHeight:c,targetWidth:l});return{top:i+g,left:r+h,width:l*f*_,height:c*f*_,transform:`translate(0,0) scale(${1/_})`}}else if(t===`auto`){let[t=`50%`,u=`50%`]=e.split(` `),d=ah({position:t,relativeNum:a-l}),f=ah({position:u,relativeNum:n-c}),p=eh({containerHeight:c,containerWidth:l,hasScalableSrc:o,offset:s,targetHeight:c,targetWidth:l});return{top:i+f,left:r+d,width:l*p,height:c*p,transform:`translate(0,0) scale(${1/p})`}}else{let[u=`50%`,d=`50%`]=t.split(` `),f=ah({position:u,relativeNum:a}),p=ah({position:d,relativeNum:n}),m=f/l,h=p/c,g=Math.min(m,h),[_=`50%`,v=`50%`]=e.split(` `),y=ah({position:_,relativeNum:a-l*g}),b=ah({position:v,relativeNum:n-c*g}),x=eh({containerHeight:c*g,containerWidth:l*g,hasScalableSrc:o,offset:s,targetHeight:c,targetWidth:l});return{top:i+b,left:r+y,width:l*g*x,height:c*g*x,transform:`translate(0,0) scale(${1/x})`}}},ch=/\.svg$/i,lh=({hasZoomImg:e,imgSrc:t,isSvg:n,isZoomed:r,loadedImgEl:i,offset:a,shouldRefresh:o,targetEl:s})=>{let c=n||t?.slice(0,18)===`data:image/svg+xml`||e||t!==void 0&&ch.test(t),l=s.getBoundingClientRect(),u=window.getComputedStyle(s),d=i!=null&&Jm(s),f=i!=null&&!d,p=i!=null&&i.naturalHeight!==0?i.naturalHeight:l.height,m=i!=null&&i.naturalWidth!==0?i.naturalWidth:l.width,h=ih({containerHeight:l.height,containerLeft:l.left,containerTop:l.top,containerWidth:l.width,hasScalableSrc:c,offset:a,targetHeight:p,targetWidth:m}),g=f?oh({containerHeight:l.height,containerLeft:l.left,containerTop:l.top,containerWidth:l.width,hasScalableSrc:c,objectFit:u.objectFit,objectPosition:u.objectPosition,offset:a,targetHeight:p,targetWidth:m}):void 0,_=d?sh({backgroundPosition:u.backgroundPosition,backgroundSize:u.backgroundSize,containerHeight:l.height,containerLeft:l.left,containerTop:l.top,containerWidth:l.width,hasScalableSrc:c,offset:a,targetHeight:p,targetWidth:m}):void 0,v={...h,...g,..._};if(r){let e=window.innerWidth/2,t=window.innerHeight/2,n=parseFloat(String(v.left??0))+parseFloat(String(v.width??0))/2,r=parseFloat(String(v.top??0))+parseFloat(String(v.height??0))/2,i=e-n,a=t-r;o&&(v.transitionDuration=`0.01ms`),v.transform=`translate(${i}px,${a}px) scale(1)`}return v},uh=e=>{if(e==null)return{};if(Zm(e)){let{parentElement:t}=e,n=e.getBoundingClientRect();if(t==null)return{height:n.height,left:n.left,width:n.width,top:n.top};{let e=t.getBoundingClientRect();return{height:n.height,left:e.left-n.left,top:e.top-n.top,width:n.width}}}else return{height:e.offsetHeight,left:e.offsetLeft,width:e.offsetWidth,top:e.offsetTop}},dh=e=>{let t=`-zoom`,n=[`clip-path`,`fill`,`mask`,`marker-start`,`marker-mid`,`marker-end`],r=new Map;if(e.hasAttribute(`id`)){let{id:n}=e,i=n+t;r.set(n,i);let a=e;a.id=i}e.querySelectorAll(`[id]`).forEach(e=>{let{id:n}=e,i=n+t;r.set(n,i);let a=e;a.id=i}),r.forEach((t,r)=>{let i=`url(#${r})`,a=`url(#${t})`,o=n.map(e=>`[${e}="${i}"]`).join(`, `);e.querySelectorAll(o).forEach(e=>{n.forEach(t=>{e.getAttribute(t)===i&&e.setAttribute(t,a)})})}),e.querySelectorAll(`style`).forEach(e=>{r.forEach((t,n)=>{let{textContent:r}=e;if(r!==``){let i=e;i.textContent=r.replaceAll(`#${n}`,`#${t}`)}})})},fh=[`img`,`svg`,`[role="img"]`,`[data-zoom]`].map(e=>`${e}:not([aria-hidden="true"])`).join(`,`),ph={overflow:``,width:``};function mh(){let e=document.querySelector(`[data-rmiz-portal]`);if(e!=null)return e;let t=document.createElement(`div`);return t.setAttribute(`data-rmiz-portal`,``),document.body.appendChild(t),t}function hh(e){e.preventDefault()}function gh(e){return Q.createElement(_h,{...e})}var _h=class extends Q.Component{constructor(){super(...arguments),this.state={id:``,isZoomImgLoaded:!1,loadedImgEl:void 0,modalState:`UNLOADED`,shouldRefresh:!1,styleGhost:{}},this.refContent=Q.createRef(),this.refDialog=Q.createRef(),this.refModalContent=Q.createRef(),this.refModalImg=Q.createRef(),this.refWrap=Q.createRef(),this.imgEl=null,this.isScaling=!1,this.prevBodyAttrs=ph,this.styleModalImg={},this.handleModalStateChange=e=>{let{state:{modalState:t}}=this;e!==`LOADING`&&t===`LOADING`?(this.loadZoomImg(),window.addEventListener(`resize`,this.handleResize,{passive:!0}),window.addEventListener(`touchstart`,this.handleTouchStart,{passive:!0}),window.addEventListener(`touchmove`,this.handleTouchMove,{passive:!0}),window.addEventListener(`touchend`,this.handleTouchEnd,{passive:!0}),window.addEventListener(`touchcancel`,this.handleTouchCancel,{passive:!0}),document.addEventListener(`keydown`,this.handleKeyDown,!0)):e!==`LOADED`&&t===`LOADED`?window.addEventListener(`wheel`,this.handleWheel,{passive:!0}):e!==`UNLOADING`&&t===`UNLOADING`?(this.ensureImgTransitionEnd(),window.removeEventListener(`wheel`,this.handleWheel),window.removeEventListener(`touchstart`,this.handleTouchStart),window.removeEventListener(`touchmove`,this.handleTouchMove),window.removeEventListener(`touchend`,this.handleTouchEnd),window.removeEventListener(`touchcancel`,this.handleTouchCancel),document.removeEventListener(`keydown`,this.handleKeyDown,!0)):e!==`UNLOADED`&&t===`UNLOADED`&&(this.bodyScrollEnable(),window.removeEventListener(`resize`,this.handleResize),this.refModalImg.current?.removeEventListener(`transitionend`,this.handleImgTransitionEnd),this.refDialog.current?.close())},this.setId=()=>{let e=()=>Math.random().toString(16).slice(-4);this.setState({id:e()+e()+e()})},this.setAndTrackImg=()=>{let{refContent:{current:e}}=this;e!=null&&(this.imgEl=e.querySelector(fh),this.imgEl===null?this.contentNotFoundChangeObserver??(this.contentNotFoundChangeObserver=new MutationObserver(this.setAndTrackImg),this.contentNotFoundChangeObserver.observe(e,{childList:!0,subtree:!0})):(this.contentNotFoundChangeObserver?.disconnect(),this.imgEl.addEventListener(`load`,this.handleImgLoad),this.imgEl.addEventListener(`click`,this.handleZoom),this.state.loadedImgEl??this.handleImgLoad(),this.imgElResizeObserver=new ResizeObserver(e=>{let[t]=e;t?.target!==void 0&&(this.imgEl=t.target,this.setState({styleGhost:uh(this.imgEl)}))}),this.imgElResizeObserver.observe(this.imgEl),this.contentChangeObserver??(this.contentChangeObserver=new MutationObserver(()=>{this.setState({styleGhost:uh(this.imgEl)})}),this.contentChangeObserver.observe(e,{attributes:!0,childList:!0,subtree:!0}))))},this.handleIfZoomChanged=e=>{let{props:{isZoomed:t}}=this;!e&&t?this.zoom():e&&!t&&this.unzoom()},this.handleImgLoad=()=>{let e=nh(this.imgEl);if(e==null||e===``)return;let t=new Image,{imgEl:n}=this;if(Ym(n)){let{sizes:e,srcset:r,crossOrigin:i}=n;t.sizes=e,t.srcset=r,t.crossOrigin=i}t.src=e;let r=()=>{this.setState({loadedImgEl:t,styleGhost:uh(this.imgEl)})};t.decode().then(r).catch(()=>{if(Xm(t)){r();return}t.onload=r})},this.handleZoom=e=>{this.props.isDisabled!==!0&&this.hasImage()&&this.props.onZoomChange?.(!0,{event:e})},this.handleUnzoom=e=>{this.props.isDisabled!==!0&&this.props.onZoomChange?.(!1,{event:e})},this.handleBtnUnzoomClick=e=>{e.preventDefault(),e.stopPropagation(),this.handleUnzoom(e)},this.handleDialogClick=e=>{(e.target===this.refModalContent.current||e.target===this.refModalImg.current)&&(e.stopPropagation(),this.handleUnzoom(e))},this.handleDialogClose=e=>{e.stopPropagation(),this.handleUnzoom(e)},this.handleKeyDown=e=>{e.key===`Escape`&&(e.preventDefault(),e.stopPropagation(),this.handleUnzoom(e))},this.handleWheel=e=>{e.ctrlKey||(e.stopPropagation(),queueMicrotask(()=>{this.handleUnzoom(e)}))},this.handleTouchStart=e=>{if(e.touches.length>1){this.isScaling=!0;return}let{changedTouches:t}=e,[n]=t;if(t.length===1&&n!==void 0){let{screenY:e}=n;this.touchYStart=e}},this.handleTouchMove=e=>{let t=window.visualViewport?.scale??1,{changedTouches:n}=e,[r]=n;if(this.props.canSwipeToUnzoom&&!this.isScaling&&t<=1&&this.touchYStart!=null&&r!==void 0){let{screenY:t}=r;this.touchYEnd=t;let n=Math.max(this.touchYStart,this.touchYEnd),i=Math.min(this.touchYStart,this.touchYEnd);Math.abs(n-i)>this.props.swipeToUnzoomThreshold&&(this.touchYStart=void 0,this.touchYEnd=void 0,this.handleUnzoom(e))}},this.handleTouchEnd=()=>{this.isScaling=!1,this.touchYStart=void 0,this.touchYEnd=void 0},this.handleTouchCancel=()=>{this.isScaling=!1,this.touchYStart=void 0,this.touchYEnd=void 0},this.handleResize=()=>{this.setState({shouldRefresh:!0})},this.hasImage=()=>this.imgEl!==null&&(this.state.loadedImgEl!==void 0||Zm(this.imgEl))&&window.getComputedStyle(this.imgEl).display!==`none`,this.zoom=()=>{this.bodyScrollDisable(),this.refDialog.current?.showModal(),this.refModalImg.current?.addEventListener(`transitionend`,this.handleImgTransitionEnd),this.setState({modalState:`LOADING`})},this.unzoom=()=>{this.setState({modalState:`UNLOADING`})},this.handleImgTransitionEnd=()=>{clearTimeout(this.timeoutTransitionEnd),this.state.modalState===`LOADING`?this.setState({modalState:`LOADED`}):this.state.modalState===`UNLOADING`&&this.setState({shouldRefresh:!1,modalState:`UNLOADED`})},this.ensureImgTransitionEnd=()=>{if(this.refModalImg.current!==null){let{transitionDuration:e}=window.getComputedStyle(this.refModalImg.current),t=parseFloat(e);if(t!==0&&!Number.isNaN(t)){let n=t*(e.endsWith(`ms`)?1:1e3)+50;this.timeoutTransitionEnd=setTimeout(this.handleImgTransitionEnd,n)}}},this.bodyScrollDisable=()=>{this.prevBodyAttrs={overflow:document.body.style.overflow,width:document.body.style.width};let{body:{clientWidth:e}}=document;document.body.style.overflow=`hidden`,document.body.style.width=`${e}px`},this.bodyScrollEnable=()=>{let{prevBodyAttrs:{overflow:e,width:t}}=this;document.body.style.width=t,document.body.style.overflow=e,this.prevBodyAttrs=ph},this.loadZoomImg=()=>{let{props:{zoomImg:e}}=this;if(e==null)return;let{src:t}=e;if(t!==void 0&&t!==``){let n=new Image;n.sizes=e.sizes??``,n.srcset=e.srcSet??``,n.crossOrigin=e.crossOrigin??void 0,n.src=t;let r=()=>{this.setState({isZoomImgLoaded:!0})};n.decode().then(r).catch(()=>{if(Xm(n)){r();return}n.onload=r})}},this.UNSAFE_handleSvg=()=>{let{imgEl:e,refModalImg:t,styleModalImg:n}=this;if(Zm(e)){let r=e.cloneNode(!0);dh(r),r.style.width=`${n.width??0}px`,r.style.height=`${n.height??0}px`,r.addEventListener(`click`,this.handleUnzoom),t.current?.firstChild?.remove(),t.current?.appendChild(r)}}}render(){let{handleBtnUnzoomClick:e,handleDialogClick:t,handleDialogClose:n,handleUnzoom:r,handleZoom:i,imgEl:a,props:{a11yNameButtonUnzoom:o,a11yNameButtonZoom:s,children:c,classDialog:l,IconUnzoom:u,IconZoom:d,isZoomed:f,wrapElement:p,ZoomContent:m,zoomImg:h,zoomMargin:g},refContent:_,refDialog:v,refModalContent:y,refModalImg:b,refWrap:x,state:{id:S,isZoomImgLoaded:C,loadedImgEl:w,modalState:T,shouldRefresh:E,styleGhost:D}}=this,O=`rmiz-modal-${S}`,k=`rmiz-modal-img-${S}`,A=Jm(a),j=Ym(a),M=Zm(a),N=rh(a),P=nh(a),F=j?a.sizes:void 0,I=j?a.srcset:void 0,L=j?a.crossOrigin:void 0,ee=h?.src!==void 0&&h.src!==``,R=this.hasImage(),te=N!==void 0&&N!==``?`${s}: ${N}`:s,z=T===`LOADING`||T===`LOADED`,ne=R?`found`:`not-found`,re=T===`UNLOADED`||T===`UNLOADING`?`hidden`:`visible`,ie={visibility:T===`UNLOADED`?`visible`:`hidden`};this.styleModalImg=R&&a!==null?lh({hasZoomImg:ee,imgSrc:P,isSvg:M,isZoomed:f&&z,loadedImgEl:w,offset:g,shouldRefresh:E,targetEl:a}):{};let ae=null;if(R){let t=j||A?Q.createElement(`img`,{alt:N,crossOrigin:L,sizes:F,src:P,srcSet:I,...C&&T===`LOADED`?h:{},"data-rmiz-modal-img":``,height:this.styleModalImg.height??void 0,id:k,ref:b,style:this.styleModalImg,width:this.styleModalImg.width??void 0}):M?Q.createElement(`div`,{"data-rmiz-modal-img":!0,ref:b,style:this.styleModalImg}):null,n=Q.createElement(`button`,{"aria-label":o,"data-rmiz-btn-unzoom":``,onClick:e,type:`button`},Q.createElement(u,null));ae=m==null?Q.createElement(Q.Fragment,null,t,n):Q.createElement(m,{buttonUnzoom:n,modalState:T,img:t,isZoomImgLoaded:C,onUnzoom:r})}return Q.createElement(p,{"aria-owns":R?O:void 0,"data-rmiz":``,ref:x},Q.createElement(p,{"data-rmiz-content":ne,ref:_,style:ie},c),R&&Q.createElement(p,{"data-rmiz-ghost":``,style:D},Q.createElement(`button`,{"aria-label":te,"data-rmiz-btn-zoom":``,onClick:i,type:`button`},Q.createElement(d,null))),R&&Lo.createPortal(Q.createElement(`dialog`,{"aria-labelledby":k,"aria-modal":`true`,className:l,"data-rmiz-modal":``,id:O,onClick:t,onClose:n,onCancel:hh,ref:v,role:`dialog`},Q.createElement(`div`,{"data-rmiz-modal-overlay":re}),Q.createElement(`div`,{"data-rmiz-modal-content":``,ref:y},ae)),mh()))}componentDidMount(){this.setId(),this.setAndTrackImg(),this.handleImgLoad(),this.UNSAFE_handleSvg()}componentWillUnmount(){this.state.modalState!==`UNLOADED`&&this.bodyScrollEnable(),this.contentChangeObserver?.disconnect(),this.contentNotFoundChangeObserver?.disconnect(),this.imgElResizeObserver?.disconnect(),this.imgEl?.removeEventListener(`load`,this.handleImgLoad),this.imgEl?.removeEventListener(`click`,this.handleZoom),this.refModalImg.current?.removeEventListener(`transitionend`,this.handleImgTransitionEnd),window.removeEventListener(`wheel`,this.handleWheel),window.removeEventListener(`touchstart`,this.handleTouchStart),window.removeEventListener(`touchmove`,this.handleTouchMove),window.removeEventListener(`touchend`,this.handleTouchEnd),window.removeEventListener(`touchcancel`,this.handleTouchCancel),window.removeEventListener(`resize`,this.handleResize),document.removeEventListener(`keydown`,this.handleKeyDown,!0)}componentDidUpdate(e,t){this.handleModalStateChange(t.modalState),this.UNSAFE_handleSvg(),this.handleIfZoomChanged(e.isZoomed)}};_h.defaultProps={a11yNameButtonUnzoom:`Minimize image`,a11yNameButtonZoom:`Expand image`,canSwipeToUnzoom:!0,IconUnzoom:Wm,IconZoom:Gm,isDisabled:!1,swipeToUnzoomThreshold:10,wrapElement:`div`,zoomMargin:0};function vh({onZoomChange:e,...t}){let[n,r]=Q.useState(!1),i=Q.useCallback((t,{event:n})=>{r(t),e?.(t,{event:n})},[e]);return Q.createElement(gh,{...t,isZoomed:n,onZoomChange:i})}function yh(e,t){return typeof e==`number`&&typeof t==`number`&&e>0&&t>0}function bh(e,t,n){return yh(e,t)?{...n,width:`${e}px`,aspectRatio:`${e} / ${t}`}:n}function xh(e){let t=(0,Z.c)(52),n,r,i,a,s,c,l,u,d,f,p,m;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4],s=t[5],c=t[6],l=t[7],u=t[8],d=t[9],f=t[10],p=t[11],m=t[12]):({width:m,height:r,loadingTestId:d,slotTestId:f,slotClassName:c,className:n,onLoad:s,onError:a,src:l,style:u,alt:p,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a,t[5]=s,t[6]=c,t[7]=l,t[8]=u,t[9]=d,t[10]=f,t[11]=p,t[12]=m);let h=d===void 0?`image-loading-skeleton`:d,g=f===void 0?`image-slot`:f,_=p===void 0?``:p,{_:v}=o(),b=(0,Q.useRef)(null),[x,S]=(0,Q.useState)(!1),C;t[13]!==r||t[14]!==m?(C=yh(m,r),t[13]=r,t[14]=m,t[15]=C):C=t[15];let w=C,T;t[16]!==r||t[17]!==u||t[18]!==m?(T=bh(m,r,u),t[16]=r,t[17]=u,t[18]=m,t[19]=T):T=t[19];let E=T,D;t[20]===Symbol.for(`react.memo_cache_sentinel`)?(D=()=>{b.current?.complete?S(!0):S(!1)},t[20]=D):D=t[20];let O;t[21]===l?O=t[22]:(O=[l],t[21]=l,t[22]=O),(0,Q.useLayoutEffect)(D,O);let k=!w&&!x&&`aspect-[16/9] w-full max-w-full`,A;t[23]!==c||t[24]!==k?(A=y(`relative inline-block overflow-hidden`,k,c),t[23]=c,t[24]=k,t[25]=A):A=t[25];let j;t[26]!==v||t[27]!==x||t[28]!==h?(j=!x&&(0,$.jsx)(`span`,{"data-testid":h,role:`status`,"aria-busy":`true`,"aria-label":v({id:`N1YYa7`}),className:`absolute inset-0 animate-pulse rounded-md bg-muted motion-reduce:animate-none`}),t[26]=v,t[27]=x,t[28]=h,t[29]=j):j=t[29];let M=x?`opacity-100`:`opacity-0`,N;t[30]!==n||t[31]!==M?(N=y(`block max-w-full transition-opacity motion-reduce:transition-none`,M,n),t[30]=n,t[31]=M,t[32]=N):N=t[32];let P;t[33]===s?P=t[34]:(P=e=>{S(!0),s?.(e)},t[33]=s,t[34]=P);let F;t[35]===a?F=t[36]:(F=e=>{S(!0),a?.(e)},t[35]=a,t[36]=F);let I;t[37]!==_||t[38]!==r||t[39]!==i||t[40]!==l||t[41]!==N||t[42]!==P||t[43]!==F||t[44]!==m?(I=(0,$.jsx)(`img`,{...i,ref:b,src:l,alt:_,width:m,height:r,className:N,onLoad:P,onError:F}),t[37]=_,t[38]=r,t[39]=i,t[40]=l,t[41]=N,t[42]=P,t[43]=F,t[44]=m,t[45]=I):I=t[45];let L;return t[46]!==E||t[47]!==g||t[48]!==j||t[49]!==I||t[50]!==A?(L=(0,$.jsxs)(`span`,{"data-testid":g,className:A,style:E,children:[j,I]}),t[46]=E,t[47]=g,t[48]=j,t[49]=I,t[50]=A,t[51]=L):L=t[51],L}function Sh(e){return e??`lazy`}function Ch(e){if(typeof e!=`string`)return e;let t=Number(e);return Number.isFinite(t)&&t>0?t:e}function wh(e){let t=(0,Z.c)(21),n;t[0]===e.src?n=t[1]:(n=e.src===void 0?void 0:vn(e.src),t[0]=e.src,t[1]=n);let r=e.alt??``,i;t[2]===e.width?i=t[3]:(i=Ch(e.width),t[2]=e.width,t[3]=i);let a;t[4]===e.height?a=t[5]:(a=Ch(e.height),t[4]=e.height,t[5]=a);let o=e.title,s;t[6]===e.loading?s=t[7]:(s=Sh(e.loading),t[6]=e.loading,t[7]=s);let c;return t[8]!==e.crossorigin||t[9]!==e.decoding||t[10]!==e.fetchpriority||t[11]!==e.referrerpolicy||t[12]!==e.sizes||t[13]!==e.srcset||t[14]!==e.title||t[15]!==n||t[16]!==r||t[17]!==i||t[18]!==a||t[19]!==s?(c=(0,$.jsx)(xh,{src:n,alt:r,width:i,height:a,title:o,loading:s,srcSet:e.srcset,sizes:e.sizes,decoding:e.decoding,fetchPriority:e.fetchpriority,crossOrigin:e.crossorigin,referrerPolicy:e.referrerpolicy}),t[8]=e.crossorigin,t[9]=e.decoding,t[10]=e.fetchpriority,t[11]=e.referrerpolicy,t[12]=e.sizes,t[13]=e.srcset,t[14]=e.title,t[15]=n,t[16]=r,t[17]=i,t[18]=a,t[19]=s,t[20]=c):c=t[20],c}function Th(e){let t=(0,Z.c)(3),n;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(n={sizes:void 0},t[0]=n):n=t[0];let r;return t[1]===e?r=t[2]:(r=(0,$.jsx)(vh,{wrapElement:`span`,zoomMargin:20,zoomImg:n,children:(0,$.jsx)(wh,{...e})}),t[1]=e,t[2]=r),r}var Eh=(0,Q.lazy)(async()=>{let{default:e}=await n(async()=>{let{default:e}=await import(`./katex-BlgnTlTx.js`);return{default:e}},[],import.meta.url);function t(t){let n=(0,Z.c)(7),r;n[0]===t.formula?r=n[1]:(r=e.renderToString(t.formula,{displayMode:!0,throwOnError:!1,strict:`ignore`,trust:!1}),n[0]=t.formula,n[1]=r);let i=r,a;n[2]===i?a=n[3]:(a={__html:i},n[2]=i,n[3]=a);let o;return n[4]!==t.id||n[5]!==a?(o=(0,$.jsx)(`div`,{className:`math math-display`,"data-component-type":`math`,id:t.id,dangerouslySetInnerHTML:a}),n[4]=t.id,n[5]=a,n[6]=o):o=n[6],o}return{default:t}});function Dh(e){let t=(0,Z.c)(3),n=e.formula||`\xA0`,r;return t[0]!==e.id||t[1]!==n?(r=(0,$.jsx)(`div`,{className:`math math-placeholder`,"data-component-type":`math`,id:e.id,children:n}),t[0]=e.id,t[1]=n,t[2]=r):r=t[2],r}function Oh(e){let t=(0,Z.c)(6),n=e.formula??``;if(!n){let r;return t[0]!==n||t[1]!==e.id?(r=(0,$.jsx)(Dh,{formula:n,id:e.id}),t[0]=n,t[1]=e.id,t[2]=r):r=t[2],r}let r;return t[3]!==n||t[4]!==e.id?(r=(0,$.jsx)(Q.Suspense,{fallback:(0,$.jsx)(Dh,{formula:n,id:e.id}),children:(0,$.jsx)(Eh,{formula:n,id:e.id})}),t[3]=n,t[4]=e.id,t[5]=r):r=t[5],r}function kh(e,t){if(e.type===`mdxJsxFlowElement`){let n=e;if(n.name===`MirrorSource`){for(let e of n.attributes??[])if(e.type===`mdxJsxAttribute`&&e.name===`id`&&typeof e.value==`string`&&e.value===t)return n}}let n=e.children;if(Array.isArray(n))for(let e of n){let n=kh(e,t);if(n)return n}return null}function Ah(e){return Rt({type:`root`,children:e.children??[]})}var jh=new Map,Mh=30,Nh=150,Ph=1e4;function Fh(e,t){let n=`${e}|${t}`,r=jh.get(n);if(r)return r.refcount+=1,r;let i=new Zi,a=new ra({url:e,name:t,document:i}),o=new Set,s={provider:a,ySource:i.getText(`source`),refcount:1,synced:!1,subscribers:o};return a.on(`synced`,()=>{s.synced=!0;for(let e of o)e.onSynced()}),s.ySource.observe(()=>{for(let e of o)e.onUpdate()}),jh.set(n,s),jh.size>Mh&&console.warn(`[Mirror] provider pool exceeded ${Mh} entries (current=${jh.size}). Many Mirrors pointing at distinct source docs — investigate if this is a runaway pattern.`),s}function Ih(e,t){let n=`${e}|${t}`,r=jh.get(n);if(r&&(--r.refcount,r.refcount<=0)){try{r.provider.destroy()}catch(e){console.warn(`[Mirror] provider.destroy() failed during release`,{src:t,err:e})}jh.delete(n)}}function Lh(e,t){let n=(0,Z.c)(8),{collabUrl:r}=Sa(),i;n[0]===Symbol.for(`react.memo_cache_sentinel`)?(i={kind:`loading`},n[0]=i):i=n[0];let[a,o]=(0,Q.useState)(i),s=(0,Q.useRef)(t),c=(0,Q.useRef)(null),l,u;n[1]!==r||n[2]!==e?(l=()=>{if(!e){o({kind:`empty-props`});return}if(!r){o({kind:`loading`});return}let t=Fh(r,e),n=()=>{let n=s.current;if(!n){o({kind:`empty-props`});return}let r=t.ySource.toString();if(!r){o(t.synced?{kind:`source-removed`}:{kind:`loading`});return}let i;try{i=we().parseToMdast(r)}catch(t){console.warn(`[Mirror] parseToMdast failed`,{src:e,anchor:n,err:t}),o({kind:`source-removed`});return}let a=kh(i,n);if(!a){o({kind:`anchor-not-found`});return}let c;try{c=Ah(a)}catch(t){console.warn(`[Mirror] renderMirrorSubtree failed`,{src:e,anchor:n,err:t}),o({kind:`anchor-not-found`});return}o({kind:`ready`,html:c})},i=null,a={onUpdate:()=>{i&&clearTimeout(i),i=setTimeout(()=>{i=null,n()},Nh)},onSynced:()=>{i&&=(clearTimeout(i),null),n()}};t.subscribers.add(a),c.current=n;let l=setTimeout(()=>{t.synced||o({kind:`source-removed`})},Ph);return n(),()=>{clearTimeout(l),i&&clearTimeout(i),t.subscribers.delete(a),c.current=null,Ih(r,e)}},u=[r,e],n[1]=r,n[2]=e,n[3]=l,n[4]=u):(l=n[3],u=n[4]),(0,Q.useEffect)(l,u);let d,f;return n[5]===t?(d=n[6],f=n[7]):(d=()=>{s.current=t,c.current?.()},f=[t],n[5]=t,n[6]=d,n[7]=f),(0,Q.useEffect)(d,f),a}function Rh(e){let t=(0,Z.c)(8),n=`ok-mirror-state flex items-start gap-2 rounded-md border border-dashed px-3 py-2 text-sm ${e.tone===`error`?`border-destructive/40 text-destructive`:`border-border text-muted-foreground`}`,r;t[0]===e.tone?r=t[1]:(r=e.tone===`error`?(0,$.jsx)(ho,{className:`mt-0.5 size-4 shrink-0`,"aria-hidden":`true`}):(0,$.jsx)(_o,{className:`mt-0.5 size-4 shrink-0`,"aria-hidden":`true`}),t[0]=e.tone,t[1]=r);let i;t[2]===e.children?i=t[3]:(i=(0,$.jsx)(`div`,{className:`min-w-0 flex-1`,children:e.children}),t[2]=e.children,t[3]=i);let a;return t[4]!==n||t[5]!==r||t[6]!==i?(a=(0,$.jsxs)(`div`,{className:n,children:[r,i]}),t[4]=n,t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function zh(e){let t=(0,Z.c)(30),n=e.src??``,r=e.anchor??``,i=Lh(n,r);if(i.kind===`empty-props`){let e;return t[0]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,$.jsx)(Rh,{tone:`placeholder`,children:(0,$.jsx)(a,{id:`3SDfZl`,components:{0:(0,$.jsx)(`span`,{className:`font-medium`}),1:(0,$.jsx)(`code`,{}),2:(0,$.jsx)(`code`,{}),3:(0,$.jsx)(`code`,{})}})}),t[0]=e):e=t[0],e}if(i.kind===`loading`){let e=n&&r?`${n}#${r}`:``,i;t[1]===e?i=t[2]:(i={mirrorRef:e},t[1]=e,t[2]=i);let o;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(o={0:(0,$.jsx)(`code`,{})},t[3]=o):o=t[3];let s;return t[4]===i?s=t[5]:(s=(0,$.jsx)(Rh,{tone:`placeholder`,children:(0,$.jsx)(a,{id:`92rbk2`,values:i,components:o})}),t[4]=i,t[5]=s),s}if(i.kind===`source-removed`){let e;t[6]===n?e=t[7]:(e={src:n},t[6]=n,t[7]=e);let r;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(r={0:(0,$.jsx)(`span`,{className:`font-medium`}),1:(0,$.jsx)(`code`,{})},t[8]=r):r=t[8];let i;return t[9]===e?i=t[10]:(i=(0,$.jsx)(Rh,{tone:`error`,children:(0,$.jsx)(a,{id:`Ud0Pj9`,values:e,components:r})}),t[9]=e,t[10]=i),i}if(i.kind===`anchor-not-found`){let e=`<MirrorSource id="${r}">`,i;t[11]!==e||t[12]!==n?(i={mirrorSourceTag:e,src:n},t[11]=e,t[12]=n,t[13]=i):i=t[13];let o;t[14]===Symbol.for(`react.memo_cache_sentinel`)?(o={0:(0,$.jsx)(`span`,{className:`font-medium`}),1:(0,$.jsx)(`code`,{}),2:(0,$.jsx)(`code`,{})},t[14]=o):o=t[14];let s;return t[15]===i?s=t[16]:(s=(0,$.jsx)(Rh,{tone:`error`,children:(0,$.jsx)(a,{id:`mqSwZH`,values:i,components:o})}),t[15]=i,t[16]=s),s}let o;t[17]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,$.jsx)(Gr,{className:`size-3`,"aria-hidden":`true`}),t[17]=o):o=t[17];let s;t[18]===n?s=t[19]:(s={src:n},t[18]=n,t[19]=s);let c;t[20]===Symbol.for(`react.memo_cache_sentinel`)?(c={0:(0,$.jsx)(`code`,{className:`font-mono`})},t[20]=c):c=t[20];let l;t[21]===s?l=t[22]:(l=(0,$.jsxs)(`div`,{className:`ok-mirror-badge pointer-events-none absolute -top-2.5 left-2 flex items-center gap-1 rounded-md bg-background px-1.5 text-xs text-muted-foreground opacity-0 transition-opacity [.jsx-component-wrapper:hover_&]:opacity-100 [.jsx-component-wrapper[data-selected="true"]_&]:opacity-100`,"aria-hidden":`true`,children:[o,(0,$.jsx)(`span`,{children:(0,$.jsx)(a,{id:`wQp1V3`,values:s,components:c})})]}),t[21]=s,t[22]=l);let u;t[23]===i.html?u=t[24]:(u=(0,$.jsx)(`div`,{dangerouslySetInnerHTML:{__html:i.html}}),t[23]=i.html,t[24]=u);let d;return t[25]!==r||t[26]!==n||t[27]!==l||t[28]!==u?(d=(0,$.jsxs)(`div`,{className:`ok-mirror-resolved relative -mx-3 prose-no-margin rounded-md border border-dashed border-transparent px-3 py-2 transition-colors [.jsx-component-wrapper:hover_&]:border-border/40 [.jsx-component-wrapper[data-selected="true"]_&]:border-border/40`,"data-mirror-src":n,"data-mirror-anchor":r,children:[l,u]}),t[25]=r,t[26]=n,t[27]=l,t[28]=u,t[29]=d):d=t[29],d}function Bh(e){let t=(0,Z.c)(15),{_:n}=o(),r=e.id??``,i;t[0]!==n||t[1]!==r?(i=r||n({id:`12F9WL`}),t[0]=n,t[1]=r,t[2]=i):i=t[2];let s=i,c;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,$.jsx)(Br,{className:`size-3`,"aria-hidden":`true`}),t[3]=c):c=t[3];let l;t[4]===s?l=t[5]:(l={label:s},t[4]=s,t[5]=l);let u;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(u={0:(0,$.jsx)(`code`,{className:`font-mono`})},t[6]=u):u=t[6];let d;t[7]===l?d=t[8]:(d=(0,$.jsxs)(`div`,{className:`ok-mirror-source-badge pointer-events-none absolute -top-2.5 left-2 flex items-center gap-1 rounded-md bg-background px-1.5 text-xs text-muted-foreground opacity-0 transition-opacity [.jsx-component-wrapper:hover_&]:opacity-100 [.jsx-component-wrapper[data-selected="true"]_&]:opacity-100`,children:[c,(0,$.jsx)(`span`,{children:(0,$.jsx)(a,{id:`Zon_qG`,values:l,components:u})})]}),t[7]=l,t[8]=d);let f;t[9]===e.children?f=t[10]:(f=(0,$.jsx)(`div`,{children:e.children}),t[9]=e.children,t[10]=f);let p;return t[11]!==r||t[12]!==d||t[13]!==f?(p=(0,$.jsxs)(`div`,{className:`ok-mirror-source relative -mx-3 rounded-md border border-dashed border-transparent px-3 py-1 transition-colors [.jsx-component-wrapper:hover_&]:border-border/50 [.jsx-component-wrapper[data-selected="true"]_&]:border-border/50`,"data-mirror-source-id":r,children:[d,f]}),t[11]=r,t[12]=d,t[13]=f,t[14]=p):p=t[14],p}var Vh=24,Hh=24,Uh=12,Wh=.1;function Gh(e,t,n,r){if(n<=0&&(e===`fit-width`||e===`two-odd`||e===`two-even`)||r<=0&&e===`fit-height`)return 1;switch(e){case`fit-width`:return Math.max(Wh,(n-Vh)/t.naturalWidth);case`fit-height`:return Math.max(Wh,(r-Hh)/t.naturalHeight);case`single`:return 1;case`two-odd`:case`two-even`:return Math.max(Wh,((n-Vh)/2-Uh)/t.naturalWidth)}}var Kh=600,qh=.5,Jh=3,Yh=.25,Xh=null;function Zh(){return Xh||(Xh=(async()=>{let e=await n(()=>import(`./pdf-BuVCb1O9.js`),__vite__mapDeps([0,1]),import.meta.url);if(!e.GlobalWorkerOptions.workerSrc){let t=(await n(async()=>{let{default:e}=await import(`./pdf.worker-qDy_6rvM.js`);return{default:e}},[],import.meta.url)).default;e.GlobalWorkerOptions.workerSrc=t}return e})(),Xh.catch(()=>{Xh=null})),Xh}function Qh(e){return e instanceof Error&&e.name===`RenderingCancelledException`}function $h(e){let t=(0,Z.c)(96),n,r;if(t[0]!==e.anchor||t[1]!==e.fillContainer){let{height:i,viewerFragment:a}=qt(e.anchor);n=i===null?e.fillContainer?`100%`:`${Kh}px`:`${i}px`,r=ag(a),t[0]=e.anchor,t[1]=e.fillContainer,t[2]=n,t[3]=r}else n=t[2],r=t[3];let i=r,s=(0,Q.useRef)(null),c;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(c=[],t[4]=c):c=t[4];let l=(0,Q.useRef)(c),u;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(u=[],t[5]=u):u=t[5];let d=(0,Q.useRef)(u),f=(0,Q.useRef)(null),p;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(p=[],t[6]=p):p=t[6];let[m,h]=(0,Q.useState)(p),[g,_]=(0,Q.useState)(!0),[v,y]=(0,Q.useState)(null),[b,x]=(0,Q.useState)(i??1),[S,C]=(0,Q.useState)(String(i??1)),[w,T]=(0,Q.useState)(1),[E,D]=(0,Q.useState)(`fit-width`),[O,k]=(0,Q.useState)(!1),[A,j]=(0,Q.useState)(!1),[M,N]=(0,Q.useState)(0),[P,F]=(0,Q.useState)(0),{_:I}=o(),L=m.length,ee,R;t[7]!==I||t[8]!==e.src?(ee=()=>{if(!e.src){_(!1);return}let t=vn(e.src),n=!1,r=null;return _(!0),y(null),(async()=>{try{let e=await(await Zh()).getDocument({url:t,isEvalSupported:!1}).promise;if(n){await e.destroy();return}r=e,f.current=e;let i=[];for(let t=1;t<=e.numPages;t++){if(n)return;let r=(await e.getPage(t)).getViewport({scale:1});i.push({pageNumber:t,naturalWidth:r.width,naturalHeight:r.height})}if(n)return;h(i)}catch(e){let t=e;if(n)return;y(t instanceof Error?t.message:I({id:`jRHdCz`})),_(!1)}})(),()=>{n=!0,r&&=(r.destroy(),null),f.current=null}},R=[e.src,I],t[7]=I,t[8]=e.src,t[9]=ee,t[10]=R):(ee=t[9],R=t[10]),(0,Q.useEffect)(ee,R);let te,z;t[11]===Symbol.for(`react.memo_cache_sentinel`)?(te=()=>{let e=s.current;if(!e)return;let t=()=>{N(e.clientWidth),F(e.clientHeight)};t();let n=new ResizeObserver(t);return n.observe(e),()=>n.disconnect()},z=[],t[11]=te,t[12]=z):(te=t[11],z=t[12]),(0,Q.useEffect)(te,z);let ne,re;t[13]!==I||t[14]!==P||t[15]!==M||t[16]!==E||t[17]!==m||t[18]!==w?(ne=()=>{let e=f.current;if(!e||m.length===0||M===0)return;let t=!1,n=null;return(async()=>{try{let r=window.devicePixelRatio||1;for(let i of m){if(t)return;let a=l.current[i.pageNumber-1];if(!a)continue;let o=Gh(E,i,M,P)*w,s=await e.getPage(i.pageNumber);if(t)return;let c=s.getViewport({scale:o});a.width=Math.floor(c.width*r),a.height=Math.floor(c.height*r),a.style.width=`${c.width}px`,a.style.height=`${c.height}px`;let u=a.getContext(`2d`);u&&(u.setTransform(r,0,0,r,0,0),n=s.render({canvas:a,canvasContext:u,viewport:c}),await n.promise,n=null)}t||_(!1)}catch(e){let n=e;if(t||Qh(n))return;console.warn(`[Pdf] page render failed:`,n),y(n instanceof Error?n.message:I({id:`_TF8ep`})),_(!1)}})(),()=>{if(t=!0,n){try{n.cancel()}catch{}n=null}}},re=[m,E,w,M,P,I],t[13]=I,t[14]=P,t[15]=M,t[16]=E,t[17]=m,t[18]=w,t[19]=ne,t[20]=re):(ne=t[19],re=t[20]),(0,Q.useEffect)(ne,re);let ie,ae;t[21]!==m||t[22]!==O?(ie=()=>{if(!O)return;let e=f.current;if(!e||m.length===0)return;let t=!1,n=null;return(async()=>{try{let r=window.devicePixelRatio||1;for(let i of m){if(t)return;let a=d.current[i.pageNumber-1];if(!a)continue;let o=120/i.naturalWidth,s=await e.getPage(i.pageNumber);if(t)return;let c=s.getViewport({scale:o});a.width=Math.floor(c.width*r),a.height=Math.floor(c.height*r),a.style.width=`${c.width}px`,a.style.height=`${c.height}px`;let l=a.getContext(`2d`);l&&(l.setTransform(r,0,0,r,0,0),n=s.render({canvas:a,canvasContext:l,viewport:c}),await n.promise,n=null)}}catch(e){let t=e;Qh(t)||console.warn(`[Pdf] thumbnail render failed:`,t)}})(),()=>{if(t=!0,n){try{n.cancel()}catch{}n=null}}},ae=[O,m],t[21]=m,t[22]=O,t[23]=ie,t[24]=ae):(ie=t[23],ae=t[24]),(0,Q.useEffect)(ie,ae);let B,oe;t[25]!==g||t[26]!==i?(B=()=>{if(g||!i)return;let e=s.current,t=l.current[i-1];e&&t&&(e.scrollTop=t.offsetTop-e.offsetTop)},oe=[g,i],t[25]=g,t[26]=i,t[27]=B,t[28]=oe):(B=t[27],oe=t[28]),(0,Q.useEffect)(B,oe);let se,ce;t[29]===m?(se=t[30],ce=t[31]):(se=()=>{let e=s.current;if(!e||m.length===0)return;let t=!1,n=()=>{t||(t=!0,requestAnimationFrame(()=>{t=!1;let n=e.scrollTop,r=1;for(let t of m){let i=l.current[t.pageNumber-1];i&&i.offsetTop-e.offsetTop<=n+40&&(r=t.pageNumber)}x(r),C(String(r))}))};return e.addEventListener(`scroll`,n,{passive:!0}),()=>e.removeEventListener(`scroll`,n)},ce=[m],t[29]=m,t[30]=se,t[31]=ce),(0,Q.useEffect)(se,ce);let V,le;t[32]===A?(V=t[33],le=t[34]):(V=()=>{if(!A)return;let e=e=>{let t=e.target,n=s.current?.closest(`.ok-pdf`);if(!n||!t||!n.contains(t)){j(!1);return}let r=n.querySelector(`.ok-pdf-layout-menu`);r&&!r.contains(t)&&j(!1)};return document.addEventListener(`mousedown`,e),()=>document.removeEventListener(`mousedown`,e)},le=[A],t[32]=A,t[33]=V,t[34]=le),(0,Q.useEffect)(V,le);let H;t[35]===L?H=t[36]:(H=e=>{let t=Math.max(1,Math.min(L||1,e));x(t),C(String(t));let n=s.current,r=l.current[t-1];n&&r&&n.scrollTo({top:r.offsetTop-n.offsetTop,behavior:`smooth`})},t[35]=L,t[36]=H);let ue=H,U;t[37]!==b||t[38]!==ue||t[39]!==S?(U=()=>{let e=Number.parseInt(S,10);if(Number.isNaN(e)){C(String(b));return}ue(e)},t[37]=b,t[38]=ue,t[39]=S,t[40]=U):U=t[40];let de=U,W;t[41]===Symbol.for(`react.memo_cache_sentinel`)?(W=()=>T(rg),t[41]=W):W=t[41];let G=W,fe;t[42]===Symbol.for(`react.memo_cache_sentinel`)?(fe=()=>T(ng),t[42]=fe):fe=t[42];let pe=fe,me;t[43]===Symbol.for(`react.memo_cache_sentinel`)?(me=e=>{D(e),j(!1),T(1)},t[43]=me):me=t[43];let he=me,ge;t[44]===n?ge=t[45]:(ge={height:n},t[44]=n,t[45]=ge);let K;t[46]===Symbol.for(`react.memo_cache_sentinel`)?(K=()=>k(tg),t[46]=K):K=t[46];let q;t[47]!==I||t[48]!==O?(q=I(O?{id:`JK-Ave`}:{id:`iEYxO4`}),t[47]=I,t[48]=O,t[49]=q):q=t[49];let J;t[50]===I?J=t[51]:(J=I({id:`zo3Dl7`}),t[50]=I,t[51]=J);let _e;t[52]===Symbol.for(`react.memo_cache_sentinel`)?(_e=(0,$.jsx)(Co,{size:14,"aria-hidden":`true`}),t[52]=_e):_e=t[52];let ve;t[53]!==O||t[54]!==q||t[55]!==J?(ve=(0,$.jsx)(`button`,{type:`button`,onClick:K,"aria-label":q,"aria-pressed":O,className:`ok-pdf-btn`,title:J,children:_e}),t[53]=O,t[54]=q,t[55]=J,t[56]=ve):ve=t[56];let ye=e.title??`PDF`,be;t[57]===ye?be=t[58]:(be=(0,$.jsx)(`span`,{className:`ok-pdf-title`,children:ye}),t[57]=ye,t[58]=be);let xe;t[59]!==I||t[60]!==A||t[61]!==E||t[62]!==S||t[63]!==de||t[64]!==L||t[65]!==w?(xe=L>0&&(0,$.jsxs)(`div`,{className:`ok-pdf-controls`,children:[(0,$.jsx)(`form`,{className:`ok-pdf-page-form`,onSubmit:e=>{e.preventDefault(),de()},children:(0,$.jsx)(`input`,{type:`text`,inputMode:`numeric`,pattern:`[0-9]*`,className:`ok-pdf-page-input`,value:S,onChange:e=>C(e.target.value.replace(/[^0-9]/g,``)),onBlur:de,"aria-label":I({id:`xsZhu-`})})}),(0,$.jsx)(`span`,{className:`ok-pdf-page-of`,children:(0,$.jsx)(a,{id:`1GhYxC`,values:{totalPages:L}})}),(0,$.jsx)(`span`,{className:`ok-pdf-divider`,"aria-hidden":`true`}),(0,$.jsx)(`button`,{type:`button`,onClick:pe,disabled:w<=qh,"aria-label":I({id:`FjkaiT`}),className:`ok-pdf-btn`,title:I({id:`FjkaiT`}),children:(0,$.jsx)(Oe,{size:14,"aria-hidden":`true`})}),(0,$.jsxs)(`span`,{className:`ok-pdf-zoom-display`,"aria-live":`polite`,children:[Math.round(w*100),`%`]}),(0,$.jsx)(`button`,{type:`button`,onClick:G,disabled:w>=Jh,"aria-label":I({id:`AWOSPo`}),className:`ok-pdf-btn`,title:I({id:`AWOSPo`}),children:(0,$.jsx)(Me,{size:14,"aria-hidden":`true`})}),(0,$.jsx)(`span`,{className:`ok-pdf-divider`,"aria-hidden":`true`}),(0,$.jsxs)(`div`,{className:`ok-pdf-layout-menu`,children:[(0,$.jsx)(`button`,{type:`button`,onClick:()=>j(eg),"aria-label":I({id:`GQDSBN`}),"aria-haspopup":`menu`,"aria-expanded":A,className:`ok-pdf-btn`,title:I({id:`rdU729`}),children:(0,$.jsx)(jr,{size:14,"aria-hidden":`true`})}),A&&(0,$.jsxs)(`div`,{role:`menu`,className:`ok-pdf-menu`,children:[(0,$.jsx)(ig,{label:I({id:`vIxrEk`}),active:E===`fit-width`,onSelect:()=>he(`fit-width`)}),(0,$.jsx)(ig,{label:I({id:`YlDuro`}),active:E===`fit-height`,onSelect:()=>he(`fit-height`)}),(0,$.jsx)(`hr`,{className:`ok-pdf-menu-divider`}),(0,$.jsx)(ig,{label:I({id:`BGHHtQ`}),active:E===`single`,onSelect:()=>he(`single`)}),(0,$.jsx)(ig,{label:I({id:`xK291b`}),active:E===`two-odd`,onSelect:()=>he(`two-odd`)}),(0,$.jsx)(ig,{label:I({id:`NSnIUP`}),active:E===`two-even`,onSelect:()=>he(`two-even`)})]})]})]}),t[59]=I,t[60]=A,t[61]=E,t[62]=S,t[63]=de,t[64]=L,t[65]=w,t[66]=xe):xe=t[66];let Se;t[67]!==ve||t[68]!==be||t[69]!==xe?(Se=(0,$.jsxs)(`div`,{className:`ok-pdf-toolbar`,contentEditable:!1,children:[ve,be,xe]}),t[67]=ve,t[68]=be,t[69]=xe,t[70]=Se):Se=t[70];let Ce;t[71]!==I||t[72]!==b||t[73]!==ue||t[74]!==m||t[75]!==O?(Ce=O&&(0,$.jsx)(`aside`,{className:`ok-pdf-sidebar`,"aria-label":I({id:`nzaV6Q`}),children:m.map((e,t)=>{let{pageNumber:n}=e;return(0,$.jsxs)(`button`,{type:`button`,className:`ok-pdf-thumb`,"data-active":b===n||void 0,onClick:()=>ue(n),"aria-label":I({id:`qioCwA`,values:{pageNumber:n}}),children:[(0,$.jsx)(`canvas`,{ref:e=>{d.current[t]=e},className:`ok-pdf-thumb-canvas`}),(0,$.jsx)(`span`,{className:`ok-pdf-thumb-num`,children:n})]},n)})}),t[71]=I,t[72]=b,t[73]=ue,t[74]=m,t[75]=O,t[76]=Ce):Ce=t[76];let we;t[77]===g?we=t[78]:(we=g&&(0,$.jsx)(`div`,{className:`ok-pdf-loading`,children:(0,$.jsx)(a,{id:`T-654M`})}),t[77]=g,t[78]=we);let Te;t[79]===v?Te=t[80]:(Te=v&&(0,$.jsx)(`div`,{className:`ok-pdf-error`,children:(0,$.jsx)(a,{id:`WamGNs`,values:{error:v}})}),t[79]=v,t[80]=Te);let Ee;t[81]!==I||t[82]!==L?(Ee=Array.from({length:L},(e,t)=>{let n=t+1;return(0,$.jsx)(`canvas`,{ref:e=>{l.current[t]=e},className:`ok-pdf-page`,"aria-label":I({id:`XtRoxT`,values:{pageNumber:n}})},n)}),t[81]=I,t[82]=L,t[83]=Ee):Ee=t[83];let De;t[84]!==E||t[85]!==we||t[86]!==Te||t[87]!==Ee?(De=(0,$.jsxs)(`div`,{className:`ok-pdf-pages`,ref:s,"data-layout":E,children:[we,Te,Ee]}),t[84]=E,t[85]=we,t[86]=Te,t[87]=Ee,t[88]=De):De=t[88];let ke;t[89]!==Ce||t[90]!==De?(ke=(0,$.jsxs)(`div`,{className:`ok-pdf-body`,children:[Ce,De]}),t[89]=Ce,t[90]=De,t[91]=ke):ke=t[91];let Ae;return t[92]!==ge||t[93]!==Se||t[94]!==ke?(Ae=(0,$.jsxs)(`div`,{className:`ok-pdf`,style:ge,children:[Se,ke]}),t[92]=ge,t[93]=Se,t[94]=ke,t[95]=Ae):Ae=t[95],Ae}function eg(e){return!e}function tg(e){return!e}function ng(e){return Math.max(qh,+(e-Yh).toFixed(2))}function rg(e){return Math.min(Jh,+(e+Yh).toFixed(2))}function ig(e){let t=(0,Z.c)(10),n=e.active||void 0,r;t[0]===e.active?r=t[1]:(r=e.active&&(0,$.jsx)(Ar,{size:14}),t[0]=e.active,t[1]=r);let i;t[2]===r?i=t[3]:(i=(0,$.jsx)(`span`,{className:`ok-pdf-menu-check`,"aria-hidden":`true`,children:r}),t[2]=r,t[3]=i);let a;return t[4]!==e.active||t[5]!==e.label||t[6]!==e.onSelect||t[7]!==n||t[8]!==i?(a=(0,$.jsxs)(`button`,{type:`button`,role:`menuitemradio`,"aria-checked":e.active,className:`ok-pdf-menu-item`,"data-active":n,onClick:e.onSelect,children:[i,e.label]}),t[4]=e.active,t[5]=e.label,t[6]=e.onSelect,t[7]=n,t[8]=i,t[9]=a):a=t[9],a}function ag(e){if(!e)return null;for(let t of e.split(`&`)){let e=t.indexOf(`=`);if(!(e<0)&&t.slice(0,e)===`page`){let n=Number.parseInt(t.slice(e+1),10);if(!Number.isNaN(n)&&n>=1)return n}}return null}function og(e){let t=(0,Z.c)(10),{label:n,id:r,children:i}=e,a=(0,Q.useId)(),o;t[0]!==r||t[1]!==a?(o=r||`tab-panel-${a.replace(/:/g,``)}`,t[0]=r,t[1]=a,t[2]=o):o=t[2];let s=o,c=`${s}-tab`,l;t[3]===n?l=t[4]:(l=n?.trim()||`Tab`,t[3]=n,t[4]=l);let u=l,d;return t[5]!==i||t[6]!==s||t[7]!==u||t[8]!==c?(d=(0,$.jsx)(`section`,{className:`tab-panel`,id:s,role:`tabpanel`,"aria-labelledby":c,"data-tab-label":u,"data-tab-id":s,children:i}),t[5]=i,t[6]=s,t[7]=u,t[8]=c,t[9]=d):d=t[9],d}var sg=`:scope > .component-children > [data-node-view-content-react] > .react-renderer`;function cg(e){return Array.from(e.querySelectorAll(sg)).map((e,t)=>{let n=e.querySelector(`[data-tab-label]`);return{index:t,label:(n?.getAttribute(`data-tab-label`))?.trim()||`Tab ${t+1}`,panelId:n?.getAttribute(`data-tab-id`)??null}})}function lg(e,t){let n=Array.from(e.querySelectorAll(sg))[t];return n?n.querySelector(`[data-jsx-gear]`):null}function ug(e){let t=(0,Z.c)(31),{id:n,children:r}=e,[i,a]=(0,Q.useState)(0),s;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(s=[],t[0]=s):s=t[0];let[c,l]=(0,Q.useState)(s),u=(0,Q.useRef)(null),d=(0,Q.useRef)(null),f=(0,Q.useRef)(0),p=H(),m=p?.addChild!=null,{_:h}=o(),g;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(g=()=>{let e=u.current;if(!e)return;let t=cg(e);l(e=>{if(e.length!==t.length)return t;for(let n=0;n<e.length;n++)if(e[n].label!==t[n].label||e[n].panelId!==t[n].panelId)return t;return e})},t[1]=g):g=t[1],(0,Q.useLayoutEffect)(g);let _,v;t[2]===c.length?(_=t[3],v=t[4]):(_=()=>{c.length>f.current&&c.length>0&&a(c.length-1),f.current=c.length},v=[c.length],t[2]=c.length,t[3]=_,t[4]=v),(0,Q.useLayoutEffect)(_,v);let y;t[5]===n?y=t[6]:(y=()=>{let e=()=>{let e=window.location.hash.slice(1);if(!e)return;if(n&&e===n){a(0);return}let t=u.current;if(!t)return;let r=cg(t).findIndex(t=>t.panelId===e);r<0||(a(r),queueMicrotask(()=>{t.ownerDocument.getElementById(e)?.scrollIntoView({block:`start`,behavior:`auto`})}))};return e(),window.addEventListener(`hashchange`,e),()=>window.removeEventListener(`hashchange`,e)},t[5]=n,t[6]=y),(0,Q.useLayoutEffect)(y);let b=c.length===0?0:Math.min(Math.max(i,0),c.length-1),x;t[7]!==c.length||t[8]!==b?(x=e=>{if(c.length===0)return;let t=null;e.key===`ArrowRight`?t=(b+1)%c.length:e.key===`ArrowLeft`?t=(b-1+c.length)%c.length:e.key===`Home`?t=0:e.key===`End`&&(t=c.length-1),t!==null&&(e.preventDefault(),a(t),(d.current?.querySelectorAll(`[role="tab"]`))?.[t]?.focus())},t[7]=c.length,t[8]=b,t[9]=x):x=t[9];let S=x,C=n?`Tabs: ${n}`:`Tabs`,w;t[10]!==c||t[11]!==b?(w=c.map(e=>(0,$.jsx)(`button`,{id:e.panelId?`${e.panelId}-tab`:void 0,type:`button`,role:`tab`,className:`tabs-strip-pill`,"data-active":e.index===b,"aria-selected":e.index===b,"aria-controls":e.panelId??void 0,tabIndex:e.index===b?0:-1,onMouseDown:fg,onClick:()=>{if(e.index!==b){a(e.index);return}let t=u.current;t&&lg(t,e.index)?.click()},children:e.label},e.index)),t[10]=c,t[11]=b,t[12]=w):w=t[12];let T;t[13]!==S||t[14]!==C||t[15]!==w?(T=(0,$.jsx)(`div`,{ref:d,role:`tablist`,"aria-label":C,className:`tabs-tablist`,onKeyDown:S,children:w}),t[13]=S,t[14]=C,t[15]=w,t[16]=T):T=t[16];let E;t[17]!==h||t[18]!==m||t[19]!==p?(E=m&&(0,$.jsx)(`button`,{type:`button`,className:`tabs-strip-add`,"aria-label":h({id:`hjO0Mq`}),title:h({id:`hjO0Mq`}),onMouseDown:dg,onClick:()=>p?.addChild?.(),"data-tabs-strip-add":``,children:`+`}),t[17]=h,t[18]=m,t[19]=p,t[20]=E):E=t[20];let D;t[21]!==E||t[22]!==T?(D=(0,$.jsxs)(`div`,{className:`tabs-strip`,contentEditable:!1,children:[T,E]}),t[21]=E,t[22]=T,t[23]=D):D=t[23];let O;t[24]!==r||t[25]!==b?(O=(0,$.jsx)(`div`,{ref:u,className:`tabs-content`,"data-active-index":b,children:r}),t[24]=r,t[25]=b,t[26]=O):O=t[26];let k;return t[27]!==n||t[28]!==D||t[29]!==O?(k=(0,$.jsxs)(`div`,{className:`tabs`,id:n,children:[D,O]}),t[27]=n,t[28]=D,t[29]=O,t[30]=k):k=t[30],k}function dg(e){return e.preventDefault()}function fg(e){return e.preventDefault()}var pg=typeof global<`u`&&{}.toString.call(global)===`[object global]`,mg=typeof Bun<`u`,hg=typeof Deno<`u`,gg=typeof WebSocketPair==`function`&&caches?.default!==void 0,_g=pg||mg||hg||gg;function vg(e,t){return e.indexOf(t.toLowerCase())===0?e:`${t.toLowerCase()}${e.substr(0,1).toUpperCase()}${e.substr(1)}`}function yg(e){return!!(e&&e.nodeType===1&&`nodeName`in e&&e.ownerDocument&&e.ownerDocument.defaultView)}function bg(e){return!isNaN(parseFloat(e))&&isFinite(e)&&Math.floor(e)==e}function xg(e){return/^(https?:)?\/\/((((player|www)\.)?vimeo\.com)|((player\.)?[a-zA-Z0-9-]+\.(videoji\.(hk|cn)|vimeo\.work)))(?=$|\/)/.test(e)}function Sg(e){return/^https:\/\/player\.((vimeo\.com)|([a-zA-Z0-9-]+\.(videoji\.(hk|cn)|vimeo\.work)))\/video\/\d+/.test(e)}function Cg(e){let t=(e||``).match(/^(?:https?:)?(?:\/\/)?([^/?]+)/),n=(t&&t[1]||``).replace(`player.`,``);for(let e of[`.videoji.hk`,`.vimeo.work`,`.videoji.cn`])if(n.endsWith(e))return n;return`vimeo.com`}function wg(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=e.id,n=e.url,r=t||n;if(!r)throw Error(`An id or url must be passed, either in an options object or as a data-vimeo-id or data-vimeo-url attribute.`);if(bg(r))return`https://vimeo.com/${r}`;if(xg(r))return r.replace(`http:`,`https:`);throw TypeError(t?`“${t}” is not a valid video id.`:`“${r}” is not a vimeo.com url.`)}var Tg=function(e,t,n){let r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:`addEventListener`,i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:`removeEventListener`,a=typeof t==`string`?[t]:t;return a.forEach(t=>{e[r](t,n)}),{cancel:()=>a.forEach(t=>e[i](t,n))}};function Eg(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:document;if(!e||!t||typeof t.querySelectorAll!=`function`)return null;let n=t.querySelectorAll(`iframe`);for(let t=0;t<n.length;t++)if(n[t]&&n[t].contentWindow===e)return n[t];return null}var Dg=Array.prototype.indexOf!==void 0,Og=typeof window<`u`&&window.postMessage!==void 0;if(!_g&&(!Dg||!Og))throw Error(`Sorry, the Vimeo Player API is not available in this browser.`);var kg=typeof globalThis<`u`?globalThis:typeof window<`u`?window:typeof global<`u`?global:typeof self<`u`?self:{};function Ag(e,t){return t={exports:{}},e(t,t.exports),t.exports}(function(e){if(e.WeakMap)return;var t=Object.prototype.hasOwnProperty,n=Object.defineProperty&&function(){try{return Object.defineProperty({},`x`,{value:1}).x===1}catch{}}(),r=function(e,t,r){n?Object.defineProperty(e,t,{configurable:!0,writable:!0,value:r}):e[t]=r};e.WeakMap=function(){function e(){if(this===void 0)throw TypeError(`Constructor WeakMap requires 'new'`);if(r(this,`_id`,a(`_WeakMap`)),arguments.length>0)throw TypeError(`WeakMap iterable is not supported`)}r(e.prototype,`delete`,function(e){if(n(this,`delete`),!i(e))return!1;var t=e[this._id];return t&&t[0]===e?(delete e[this._id],!0):!1}),r(e.prototype,`get`,function(e){if(n(this,`get`),i(e)){var t=e[this._id];if(t&&t[0]===e)return t[1]}}),r(e.prototype,`has`,function(e){if(n(this,`has`),!i(e))return!1;var t=e[this._id];return!!(t&&t[0]===e)}),r(e.prototype,`set`,function(e,t){if(n(this,`set`),!i(e))throw TypeError(`Invalid value used as weak map key`);var a=e[this._id];return a&&a[0]===e?(a[1]=t,this):(r(e,this._id,[e,t]),this)});function n(e,n){if(!i(e)||!t.call(e,`_id`))throw TypeError(n+` method called on incompatible receiver `+typeof e)}function a(e){return e+`_`+o()+`.`+o()}function o(){return Math.random().toString().substring(2)}return r(e,`_polyfill`,!0),e}();function i(e){return Object(e)===e}})(typeof globalThis<`u`?globalThis:typeof self<`u`?self:typeof window<`u`?window:kg);var jg=Ag(function(e){(function(t,n,r){n[t]=n[t]||r(),e.exports&&=n[t]})(`Promise`,kg,function(){var e,t,n,r=Object.prototype.toString,i=typeof setImmediate<`u`?function(e){return setImmediate(e)}:setTimeout;try{Object.defineProperty({},`x`,{}),e=function(e,t,n,r){return Object.defineProperty(e,t,{value:n,writable:!0,configurable:r!==!1})}}catch{e=function(e,t,n){return e[t]=n,e}}n=function(){var e,n,r;function i(e,t){this.fn=e,this.self=t,this.next=void 0}return{add:function(t,a){r=new i(t,a),n?n.next=r:e=r,n=r,r=void 0},drain:function(){var r=e;for(e=n=t=void 0;r;)r.fn.call(r.self),r=r.next}}}();function a(e,r){n.add(e,r),t||=i(n.drain)}function o(e){var t,n=typeof e;return e!=null&&(n==`object`||n==`function`)&&(t=e.then),typeof t==`function`?t:!1}function s(){for(var e=0;e<this.chain.length;e++)c(this,this.state===1?this.chain[e].success:this.chain[e].failure,this.chain[e]);this.chain.length=0}function c(e,t,n){var r,i;try{t===!1?n.reject(e.msg):(r=t===!0?e.msg:t.call(void 0,e.msg),r===n.promise?n.reject(TypeError(`Promise-chain cycle`)):(i=o(r))?i.call(r,n.resolve,n.reject):n.resolve(r))}catch(e){n.reject(e)}}function l(e){var t,n=this;if(!n.triggered){n.triggered=!0,n.def&&(n=n.def);try{(t=o(e))?a(function(){var r=new f(n);try{t.call(e,function(){l.apply(r,arguments)},function(){u.apply(r,arguments)})}catch(e){u.call(r,e)}}):(n.msg=e,n.state=1,n.chain.length>0&&a(s,n))}catch(e){u.call(new f(n),e)}}}function u(e){var t=this;t.triggered||(t.triggered=!0,t.def&&(t=t.def),t.msg=e,t.state=2,t.chain.length>0&&a(s,t))}function d(e,t,n,r){for(var i=0;i<t.length;i++)(function(i){e.resolve(t[i]).then(function(e){n(i,e)},r)})(i)}function f(e){this.def=e,this.triggered=!1}function p(e){this.promise=e,this.state=0,this.triggered=!1,this.chain=[],this.msg=void 0}function m(e){if(typeof e!=`function`)throw TypeError(`Not a function`);if(this.__NPO__!==0)throw TypeError(`Not a promise`);this.__NPO__=1;var t=new p(this);this.then=function(e,n){var r={success:typeof e==`function`?e:!0,failure:typeof n==`function`?n:!1};return r.promise=new this.constructor(function(e,t){if(typeof e!=`function`||typeof t!=`function`)throw TypeError(`Not a function`);r.resolve=e,r.reject=t}),t.chain.push(r),t.state!==0&&a(s,t),r.promise},this.catch=function(e){return this.then(void 0,e)};try{e.call(void 0,function(e){l.call(t,e)},function(e){u.call(t,e)})}catch(e){u.call(t,e)}}var h=e({},`constructor`,m,!1);return m.prototype=h,e(h,`__NPO__`,0,!1),e(m,`resolve`,function(e){var t=this;return e&&typeof e==`object`&&e.__NPO__===1?e:new t(function(t,n){if(typeof t!=`function`||typeof n!=`function`)throw TypeError(`Not a function`);t(e)})}),e(m,`reject`,function(e){return new this(function(t,n){if(typeof t!=`function`||typeof n!=`function`)throw TypeError(`Not a function`);n(e)})}),e(m,`all`,function(e){var t=this;return r.call(e)==`[object Array]`?e.length===0?t.resolve([]):new t(function(n,r){if(typeof n!=`function`||typeof r!=`function`)throw TypeError(`Not a function`);var i=e.length,a=Array(i),o=0;d(t,e,function(e,t){a[e]=t,++o===i&&n(a)},r)}):t.reject(TypeError(`Not an array`))}),e(m,`race`,function(e){var t=this;return r.call(e)==`[object Array]`?new t(function(n,r){if(typeof n!=`function`||typeof r!=`function`)throw TypeError(`Not a function`);d(t,e,function(e,t){n(t)},r)}):t.reject(TypeError(`Not an array`))}),m})}),Mg=new WeakMap;function Ng(e,t,n){let r=Mg.get(e.element)||{};t in r||(r[t]=[]),r[t].push(n),Mg.set(e.element,r)}function Pg(e,t){return(Mg.get(e.element)||{})[t]||[]}function Fg(e,t,n){let r=Mg.get(e.element)||{};if(!r[t])return!0;if(!n)return r[t]=[],Mg.set(e.element,r),!0;let i=r[t].indexOf(n);return i!==-1&&r[t].splice(i,1),Mg.set(e.element,r),r[t]&&r[t].length===0}function Ig(e,t){let n=Pg(e,t);if(n.length<1)return!1;let r=n.shift();return Fg(e,t,r),r}function Lg(e,t){let n=Mg.get(e);Mg.set(t,n),Mg.delete(e)}function Rg(e){if(typeof e==`string`)try{e=JSON.parse(e)}catch(e){return console.warn(e),{}}return e}function zg(e,t,n){if(!e.element.contentWindow||!e.element.contentWindow.postMessage)return;let r={method:t};n!==void 0&&(r.value=n);let i=parseFloat(navigator.userAgent.toLowerCase().replace(/^.*msie (\d+).*$/,`$1`));i>=8&&i<10&&(r=JSON.stringify(r)),e.element.contentWindow.postMessage(r,e.origin)}function Bg(e,t){t=Rg(t);let n=[],r;if(t.event)t.event===`error`&&Pg(e,t.data.method).forEach(n=>{let r=Error(t.data.message);r.name=t.data.name,n.reject(r),Fg(e,t.data.method,n)}),n=Pg(e,`event:${t.event}`),r=t.data;else if(t.method){let i=Ig(e,t.method);i&&(n.push(i),r=t.value)}n.forEach(t=>{try{if(typeof t==`function`){t.call(e,r);return}t.resolve(r)}catch{}})}var Vg=`airplay.audio_tracks.audiotrack.autopause.autoplay.background.byline.cc.chapter_id.chapters.chromecast.color.colors.controls.disable_context_menu.dnt.end_time.fullscreen.height.id.initial_quality.interactive_params.keyboard.loop.maxheight.max_quality.maxwidth.min_quality.muted.play_button_position.playsinline.portrait.preload.progress_bar.quality.quality_selector.responsive.skipping_forward.speed.start_time.texttrack.thumbnail_id.title.transcript.transparent.unmute_button.url.vimeo_logo.volume.watch_full_video.width`.split(`.`);function Hg(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return Vg.reduce((t,n)=>{let r=e.getAttribute(`data-vimeo-${n}`);return(r||r===``)&&(t[n]=r===``?1:r),t},t)}function Ug(e,t){let{html:n}=e;if(!t)throw TypeError(`An element must be provided`);if(t.getAttribute(`data-vimeo-initialized`)!==null)return t.querySelector(`iframe`);let r=document.createElement(`div`);return r.innerHTML=n,t.appendChild(r.firstChild),t.setAttribute(`data-vimeo-initialized`,`true`),t.querySelector(`iframe`)}function Wg(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=arguments.length>2?arguments[2]:void 0;return new Promise((r,i)=>{if(!xg(e))throw TypeError(`“${e}” is not a vimeo.com url.`);let a=`https://${Cg(e)}/api/oembed.json?url=${encodeURIComponent(e)}`;for(let e in t)t.hasOwnProperty(e)&&(a+=`&${e}=${encodeURIComponent(t[e])}`);let o=`XDomainRequest`in window?new XDomainRequest:new XMLHttpRequest;o.open(`GET`,a,!0),o.onload=function(){if(o.status===404){i(Error(`“${e}” was not found.`));return}if(o.status===403){i(Error(`“${e}” is not embeddable.`));return}try{let t=JSON.parse(o.responseText);if(t.domain_status_code===403){Ug(t,n),i(Error(`“${e}” is not embeddable.`));return}r(t)}catch(e){i(e)}},o.onerror=function(){let e=o.status?` (${o.status})`:``;i(Error(`There was an error fetching the embed code from Vimeo${e}.`))},o.send()})}function Gg(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:document,t=[].slice.call(e.querySelectorAll(`[data-vimeo-id], [data-vimeo-url]`)),n=e=>{`console`in window&&console.error&&console.error(`There was an error creating an embed: ${e}`)};t.forEach(e=>{try{if(e.getAttribute(`data-vimeo-defer`)!==null)return;let t=Hg(e);Wg(wg(t),t,e).then(t=>Ug(t,e)).catch(n)}catch(e){n(e)}})}function Kg(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:document;window.VimeoPlayerResizeEmbeds_||(window.VimeoPlayerResizeEmbeds_=!0,window.addEventListener(`message`,t=>{if(!xg(t.origin)||!t.data||t.data.event!==`spacechange`)return;let n=t.source?Eg(t.source,e):null;if(n){let e=n.parentElement;e.style.paddingBottom=`${t.data.data[0].bottom}px`}}))}function qg(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:document;window.VimeoSeoMetadataAppended||(window.VimeoSeoMetadataAppended=!0,window.addEventListener(`message`,t=>{if(!xg(t.origin))return;let n=Rg(t.data);if(!n||n.event!==`ready`)return;let r=t.source?Eg(t.source,e):null;r&&Sg(r.src)&&new n_(r).callMethod(`appendVideoMetadata`,window.location.href)}))}function Jg(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:document;if(window.VimeoCheckedUrlTimeParam)return;window.VimeoCheckedUrlTimeParam=!0;let t=e=>{`console`in window&&console.error&&console.error(`There was an error getting video Id: ${e}`)};window.addEventListener(`message`,n=>{if(!xg(n.origin))return;let r=Rg(n.data);if(!r||r.event!==`ready`)return;let i=n.source?Eg(n.source,e):null;if(i&&Sg(i.src)){let e=new n_(i);e.getVideoId().then(t=>{let n=RegExp(`[?&]vimeo_t_${t}=([^&#]*)`).exec(window.location.href);if(n&&n[1]){let t=decodeURI(n[1]);e.setCurrentTime(t)}}).catch(t)}})}function Yg(){window.VimeoDRMEmbedsUpdated||(window.VimeoDRMEmbedsUpdated=!0,window.addEventListener(`message`,e=>{if(!xg(e.origin))return;let t=Rg(e.data);if(!t||t.event!==`drminitfailed`)return;let n=e.source?Eg(e.source):null;if(!n)return;let r=n.getAttribute(`allow`)||``;if(!r.includes(`encrypted-media`)){n.setAttribute(`allow`,`${r}; encrypted-media`);let e=new URL(n.getAttribute(`src`));e.searchParams.set(`forcereload`,`drm`),n.setAttribute(`src`,e.toString());return}}))}function Xg(){let e=function(){let e,t=[[`requestFullscreen`,`exitFullscreen`,`fullscreenElement`,`fullscreenEnabled`,`fullscreenchange`,`fullscreenerror`],[`webkitRequestFullscreen`,`webkitExitFullscreen`,`webkitFullscreenElement`,`webkitFullscreenEnabled`,`webkitfullscreenchange`,`webkitfullscreenerror`],[`webkitRequestFullScreen`,`webkitCancelFullScreen`,`webkitCurrentFullScreenElement`,`webkitCancelFullScreen`,`webkitfullscreenchange`,`webkitfullscreenerror`],[`mozRequestFullScreen`,`mozCancelFullScreen`,`mozFullScreenElement`,`mozFullScreenEnabled`,`mozfullscreenchange`,`mozfullscreenerror`],[`msRequestFullscreen`,`msExitFullscreen`,`msFullscreenElement`,`msFullscreenEnabled`,`MSFullscreenChange`,`MSFullscreenError`]],n=0,r=t.length,i={};for(;n<r;n++)if(e=t[n],e&&e[1]in document){for(n=0;n<e.length;n++)i[t[0][n]]=e[n];return i}return!1}(),t={fullscreenchange:e.fullscreenchange,fullscreenerror:e.fullscreenerror},n={request(t){return new Promise((r,i)=>{let a=function(){n.off(`fullscreenchange`,a),r()};n.on(`fullscreenchange`,a),t||=document.documentElement;let o=t[e.requestFullscreen]();o instanceof Promise&&o.then(a).catch(i)})},exit(){return new Promise((t,r)=>{if(!n.isFullscreen){t();return}let i=function(){n.off(`fullscreenchange`,i),t()};n.on(`fullscreenchange`,i);let a=document[e.exitFullscreen]();a instanceof Promise&&a.then(i).catch(r)})},on(e,n){let r=t[e];r&&document.addEventListener(r,n)},off(e,n){let r=t[e];r&&document.removeEventListener(r,n)}};return Object.defineProperties(n,{isFullscreen:{get(){return!!document[e.fullscreenElement]}},element:{enumerable:!0,get(){return document[e.fullscreenElement]}},isEnabled:{enumerable:!0,get(){return!!document[e.fullscreenEnabled]}}}),n}var Zg={role:`viewer`,autoPlayMuted:!0,allowedDrift:.3,maxAllowedDrift:1,minCheckInterval:.1,maxRateAdjustment:.2,maxTimeToCatchUp:1},Qg=class extends EventTarget{logger;constructor(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},r=arguments.length>3?arguments[3]:void 0;super(),this.logger=r,this.init(t,e,{...Zg,...n})}disconnect(){this.dispatchEvent(new Event(`disconnect`))}async init(e,t,n){if(await this.waitForTOReadyState(e,`open`),n.role===`viewer`){await this.updatePlayer(e,t,n);let r=Tg(e,`change`,()=>this.updatePlayer(e,t,n)),i=this.maintainPlaybackPosition(e,t,n);this.addEventListener(`disconnect`,()=>{i.cancel(),r.cancel()})}else{await this.updateTimingObject(e,t);let n=Tg(t,[`seeked`,`play`,`pause`,`ratechange`],()=>this.updateTimingObject(e,t),`on`,`off`);this.addEventListener(`disconnect`,()=>n.cancel())}}async updateTimingObject(e,t){let[n,r,i]=await Promise.all([t.getCurrentTime(),t.getPaused(),t.getPlaybackRate()]);e.update({position:n,velocity:r?0:i})}async updatePlayer(e,t,n){let{position:r,velocity:i}=e.query();typeof r==`number`&&t.setCurrentTime(r),typeof i==`number`&&(i===0?await t.getPaused()===!1&&t.pause():i>0&&(await t.getPaused()===!0&&(await t.play().catch(async e=>{e.name===`NotAllowedError`&&n.autoPlayMuted&&(await t.setMuted(!0),await t.play().catch(e=>console.error(`Couldn't play the video from TimingSrcConnector. Error:`,e)))}),this.updatePlayer(e,t,n)),await t.getPlaybackRate()!==i&&t.setPlaybackRate(i)))}maintainPlaybackPosition(e,t,n){let{allowedDrift:r,maxAllowedDrift:i,minCheckInterval:a,maxRateAdjustment:o,maxTimeToCatchUp:s}=n,c=Math.min(s,Math.max(a,i))*1e3,l=async()=>{if(e.query().velocity===0||await t.getPaused()===!0)return;let n=e.query().position-await t.getCurrentTime(),a=Math.abs(n);if(this.log(`Drift: ${n}`),a>i)await this.adjustSpeed(t,0),t.setCurrentTime(e.query().position),this.log(`Resync by currentTime`);else if(a>r){let e=a/s,r=o,i=e<r?(r-e)/2:r;await this.adjustSpeed(t,i*Math.sign(n)),this.log(`Resync by playbackRate`)}},u=setInterval(()=>l(),c);return{cancel:()=>clearInterval(u)}}log(e){this.logger?.(`TimingSrcConnector: ${e}`)}speedAdjustment=0;adjustSpeed=async(e,t)=>{if(this.speedAdjustment===t)return;let n=await e.getPlaybackRate()-this.speedAdjustment+t;this.log(`New playbackRate: ${n}`),await e.setPlaybackRate(n),this.speedAdjustment=t};waitForTOReadyState(e,t){return new Promise(n=>{let r=()=>{e.readyState===t?n():e.addEventListener(`readystatechange`,r,{once:!0})};r()})}},$g=new WeakMap,e_=new WeakMap,t_={},n_=class{constructor(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(window.jQuery&&e instanceof jQuery&&(e.length>1&&window.console&&console.warn&&console.warn(`A jQuery object with multiple elements was passed, using the first element.`),e=e[0]),typeof document<`u`&&typeof e==`string`&&(e=document.getElementById(e)),!yg(e))throw TypeError(`You must pass either a valid element or a valid id.`);if(e.nodeName!==`IFRAME`){let t=e.querySelector(`iframe`);t&&(e=t)}if(e.nodeName===`IFRAME`&&!xg(e.getAttribute(`src`)||``))throw Error(`The player element passed isn’t a Vimeo embed.`);if($g.has(e))return $g.get(e);this._window=e.ownerDocument.defaultView,this.element=e,this.origin=`*`;let n=new jg((n,r)=>{if(this._onMessage=e=>{if(!xg(e.origin)||this.element.contentWindow!==e.source)return;this.origin===`*`&&(this.origin=e.origin);let t=Rg(e.data);if(t&&t.event===`error`&&t.data&&t.data.method===`ready`){let e=Error(t.data.message);e.name=t.data.name,r(e);return}let i=t&&t.event===`ready`,a=t&&t.method===`ping`;if(i||a){this.element.setAttribute(`data-ready`,`true`),n();return}Bg(this,t)},this._window.addEventListener(`message`,this._onMessage),this.element.nodeName!==`IFRAME`){let n=Hg(e,t);Wg(wg(n),n,e).then(t=>{let n=Ug(t,e);return this.element=n,this._originalElement=e,Lg(e,n),$g.set(this.element,this),t}).catch(r)}});if(e_.set(this,n),$g.set(this.element,this),this.element.nodeName===`IFRAME`&&zg(this,`ping`),t_.isEnabled){let e=()=>t_.exit();this.fullscreenchangeHandler=()=>{t_.isFullscreen?Ng(this,`event:exitFullscreen`,e):Fg(this,`event:exitFullscreen`,e),this.ready().then(()=>{zg(this,`fullscreenchange`,t_.isFullscreen)})},t_.on(`fullscreenchange`,this.fullscreenchangeHandler)}return this}static isVimeoUrl(e){return xg(e)}callMethod(e){var t=[...arguments].slice(1);if(e==null)throw TypeError(`You must pass a method name.`);return new jg((n,r)=>this.ready().then(()=>{Ng(this,e,{resolve:n,reject:r}),t.length===0?t={}:t.length===1&&(t=t[0]),zg(this,e,t)}).catch(r))}get(e){return new jg((t,n)=>(e=vg(e,`get`),this.ready().then(()=>{Ng(this,e,{resolve:t,reject:n}),zg(this,e)}).catch(n)))}set(e,t){return new jg((n,r)=>{if(e=vg(e,`set`),t==null)throw TypeError(`There must be a value to set.`);return this.ready().then(()=>{Ng(this,e,{resolve:n,reject:r}),zg(this,e,t)}).catch(r)})}on(e,t){if(!e)throw TypeError(`You must pass an event name.`);if(!t)throw TypeError(`You must pass a callback function.`);if(typeof t!=`function`)throw TypeError(`The callback must be a function.`);Pg(this,`event:${e}`).length===0&&this.callMethod(`addEventListener`,e).catch(()=>{}),Ng(this,`event:${e}`,t)}off(e,t){if(!e)throw TypeError(`You must pass an event name.`);if(t&&typeof t!=`function`)throw TypeError(`The callback must be a function.`);Fg(this,`event:${e}`,t)&&this.callMethod(`removeEventListener`,e).catch(e=>{})}loadVideo(e){return this.callMethod(`loadVideo`,e)}ready(){let e=e_.get(this)||new jg((e,t)=>{t(Error(`Unknown player. Probably unloaded.`))});return jg.resolve(e)}addCuePoint(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return this.callMethod(`addCuePoint`,{time:e,data:t})}removeCuePoint(e){return this.callMethod(`removeCuePoint`,e)}enableTextTrack(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(!e)throw TypeError(`You must pass a language.`);return this.callMethod(`enableTextTrack`,{language:e,kind:t,showing:n})}disableTextTrack(){return this.callMethod(`disableTextTrack`)}selectAudioTrack(e,t){if(!e)throw TypeError(`You must pass a language.`);return this.callMethod(`selectAudioTrack`,{language:e,kind:t})}selectDefaultAudioTrack(){return this.callMethod(`selectDefaultAudioTrack`)}pause(){return this.callMethod(`pause`)}play(){return this.callMethod(`play`)}requestFullscreen(){return t_.isEnabled?t_.request(this.element):this.callMethod(`requestFullscreen`)}exitFullscreen(){return t_.isEnabled?t_.exit():this.callMethod(`exitFullscreen`)}getFullscreen(){return t_.isEnabled?jg.resolve(t_.isFullscreen):this.get(`fullscreen`)}requestPictureInPicture(){return this.callMethod(`requestPictureInPicture`)}exitPictureInPicture(){return this.callMethod(`exitPictureInPicture`)}getPictureInPicture(){return this.get(`pictureInPicture`)}remotePlaybackPrompt(){return this.callMethod(`remotePlaybackPrompt`)}unload(){return this.callMethod(`unload`)}destroy(){return new jg(e=>{if(e_.delete(this),$g.delete(this.element),this._originalElement&&($g.delete(this._originalElement),this._originalElement.removeAttribute(`data-vimeo-initialized`)),this.element&&this.element.nodeName===`IFRAME`&&this.element.parentNode&&(this.element.parentNode.parentNode&&this._originalElement&&this._originalElement!==this.element.parentNode?this.element.parentNode.parentNode.removeChild(this.element.parentNode):this.element.parentNode.removeChild(this.element)),this.element&&this.element.nodeName===`DIV`&&this.element.parentNode){this.element.removeAttribute(`data-vimeo-initialized`);let e=this.element.querySelector(`iframe`);e&&e.parentNode&&(e.parentNode.parentNode&&this._originalElement&&this._originalElement!==e.parentNode?e.parentNode.parentNode.removeChild(e.parentNode):e.parentNode.removeChild(e))}this._window.removeEventListener(`message`,this._onMessage),t_.isEnabled&&t_.off(`fullscreenchange`,this.fullscreenchangeHandler),e()})}getAutopause(){return this.get(`autopause`)}setAutopause(e){return this.set(`autopause`,e)}getBuffered(){return this.get(`buffered`)}getCameraProps(){return this.get(`cameraProps`)}setCameraProps(e){return this.set(`cameraProps`,e)}getChapters(){return this.get(`chapters`)}getCurrentChapter(){return this.get(`currentChapter`)}getColor(){return this.get(`color`)}getColors(){return jg.all([this.get(`colorOne`),this.get(`colorTwo`),this.get(`colorThree`),this.get(`colorFour`)])}setColor(e){return this.set(`color`,e)}setColors(e){if(!Array.isArray(e))return new jg((e,t)=>t(TypeError(`Argument must be an array.`)));let t=new jg(e=>e(null)),n=[e[0]?this.set(`colorOne`,e[0]):t,e[1]?this.set(`colorTwo`,e[1]):t,e[2]?this.set(`colorThree`,e[2]):t,e[3]?this.set(`colorFour`,e[3]):t];return jg.all(n)}getCuePoints(){return this.get(`cuePoints`)}getCurrentTime(){return this.get(`currentTime`)}setCurrentTime(e){return this.set(`currentTime`,e)}getDuration(){return this.get(`duration`)}getEnded(){return this.get(`ended`)}getLoop(){return this.get(`loop`)}setLoop(e){return this.set(`loop`,e)}setMuted(e){return this.set(`muted`,e)}getMuted(){return this.get(`muted`)}getPaused(){return this.get(`paused`)}getPlaybackRate(){return this.get(`playbackRate`)}setPlaybackRate(e){return this.set(`playbackRate`,e)}getPlayed(){return this.get(`played`)}getQualities(){return this.get(`qualities`)}getQuality(){return this.get(`quality`)}setQuality(e){return this.set(`quality`,e)}getRemotePlaybackAvailability(){return this.get(`remotePlaybackAvailability`)}getRemotePlaybackState(){return this.get(`remotePlaybackState`)}getSeekable(){return this.get(`seekable`)}getSeeking(){return this.get(`seeking`)}getTextTracks(){return this.get(`textTracks`)}getAudioTracks(){return this.get(`audioTracks`)}getEnabledAudioTrack(){return this.get(`enabledAudioTrack`)}getDefaultAudioTrack(){return this.get(`defaultAudioTrack`)}getVideoEmbedCode(){return this.get(`videoEmbedCode`)}getVideoId(){return this.get(`videoId`)}getVideoTitle(){return this.get(`videoTitle`)}getVideoWidth(){return this.get(`videoWidth`)}getVideoHeight(){return this.get(`videoHeight`)}getVideoUrl(){return this.get(`videoUrl`)}getVolume(){return this.get(`volume`)}setVolume(e){return this.set(`volume`,e)}async setTimingSrc(e,t){if(!e)throw TypeError(`A Timing Object must be provided.`);await this.ready();let n=new Qg(this,e,t);return zg(this,`notifyTimingObjectConnect`),n.addEventListener(`disconnect`,()=>zg(this,`notifyTimingObjectDisconnect`)),n}};_g||(t_=Xg(),Gg(),Kg(),qg(),Jg(),Yg());function r_(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,i_(e,t)}function i_(e,t){return i_=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},i_(e,t)}var a_={play:`onPlay`,playing:`onPlaying`,pause:`onPause`,ended:`onEnd`,timeupdate:`onTimeUpdate`,progress:`onProgress`,seeked:`onSeeked`,texttrackchange:`onTextTrackChange`,cuechange:`onCueChange`,cuepoint:`onCuePoint`,volumechange:`onVolumeChange`,playbackratechange:`onPlaybackRateChange`,error:`onError`,loaded:`onLoaded`},o_=function(e){function t(t){var n=e.call(this,t)||this;return n.refContainer=n.refContainer.bind(n),n}r_(t,e);var n=t.prototype;return n.componentDidMount=function(){this.createPlayer()},n.componentDidUpdate=function(e){var t=this,n=Object.keys(this.props).filter(function(n){return t.props[n]!==e[n]});this.updateProps(n)},n.componentWillUnmount=function(){this.player.destroy()},n.getInitialOptions=function(){var e,t=this.props.video,n=/^https?:/i.test(t)?`url`:`id`;return e={},e[n]=t,e.width=this.props.width,e.height=this.props.height,e.autopause=this.props.autopause,e.autoplay=this.props.autoplay,e.byline=this.props.showByline,e.color=this.props.color,e.controls=this.props.controls,e.loop=this.props.loop,e.portrait=this.props.showPortrait,e.title=this.props.showTitle,e.muted=this.props.muted,e.background=this.props.background,e.responsive=this.props.responsive,e.dnt=this.props.dnt,e.speed=this.props.speed,e.keyboard=this.props.keyboard,e.pip=this.props.pip,e.playsinline=this.props.playsInline,e.quality=this.props.quality,e.texttrack=this.props.textTrack,e.transparent=this.props.transparent,e},n.updateProps=function(e){var t=this,n=this.player;e.forEach(function(e){var r=t.props[e];switch(e){case`autopause`:n.setAutopause(r);break;case`color`:n.setColor(r);break;case`loop`:n.setLoop(r);break;case`volume`:n.setVolume(r);break;case`paused`:n.getPaused().then(function(e){return r&&!e?n.pause():!r&&e?n.play():null});break;case`width`:case`height`:n.element[e]=r;break;case`video`:if(r){var i=t.props.start,a=n.loadVideo(r);typeof i==`number`&&a.then(function(){n.setCurrentTime(i)})}else n.unload();break;case`playbackRate`:n.setPlaybackRate(r);break;case`quality`:n.setQuality(r);break}})},n.createPlayer=function(){var e=this,t=this.props,n=t.start,r=t.volume,i=t.playbackRate;this.player=new n_(this.container,this.getInitialOptions()),Object.keys(a_).forEach(function(t){var n=a_[t];e.player.on(t,function(t){var r=e.props[n];r&&r(t)})});var a=this.props,o=a.onError,s=a.onReady;this.player.ready().then(function(){s&&s(e.player)},function(e){if(o)o(e);else throw e}),typeof n==`number`&&this.player.setCurrentTime(n),typeof r==`number`&&this.updateProps([`volume`]),typeof i==`number`&&this.updateProps([`playbackRate`])},n.refContainer=function(e){this.container=e},n.render=function(){var e=this.props,t=e.id,n=e.className,r=e.style;return Q.createElement(`div`,{id:t,className:n,style:r,ref:this.refContainer})},t}(Q.Component);o_.defaultProps={autopause:!0,autoplay:!1,showByline:!0,controls:!0,loop:!1,showPortrait:!0,showTitle:!0,muted:!1,background:!1,responsive:!1,dnt:!1,speed:!1,keyboard:!0,pip:!1,playsInline:!0,transparent:!0};var s_={default:120,mqdefault:320,hqdefault:480,sddefault:640,maxresdefault:1280},c_=(e,t,n,r=`maxresdefault`)=>{let[i,a]=(0,Q.useState)(``);return(0,Q.useEffect)(()=>{let i=`https://img.youtube.com/${t}/${e}/${r}.${n}`,o=`https://img.youtube.com/${t}/${e}/hqdefault.${n}`,s=s_[r],c=new Image;c.onload=()=>{c.width<s?a(o):a(i)},c.onerror=()=>a(o),c.src=i},[e,t,n,r]),i};function l_(e,t,n,r,i){let a={"@context":`https://schema.org`,"@type":`VideoObject`,name:i?.name||t,thumbnailUrl:[i?.thumbnailUrl||n],embedUrl:i?.embedUrl||`${r}/embed/${e}`,contentUrl:i?.contentUrl||`https://www.youtube.com/watch?v=${e}`,...i?.description&&{description:i.description},...i?.uploadDate&&{uploadDate:i.uploadDate},...i?.duration&&{duration:i.duration}};return JSON.stringify(a)}function u_(e,t){let[n,r]=Q.useState(!1),[i,a]=Q.useState(e.alwaysLoadIframe||!1),o=encodeURIComponent(e.id),s=typeof e.playlistCoverId==`string`?encodeURIComponent(e.playlistCoverId):null,c=e.title,l=e.poster||`hqdefault`,u=e.announce||`Watch`,d=e.alwaysLoadIframe?e.autoplay&&e.muted:!0,f=Q.useMemo(()=>{let t=new URLSearchParams({...e.muted?{mute:`1`}:{},...d?{autoplay:`1`}:{},...e.enableJsApi?{enablejsapi:`1`}:{},...e.enableJsApi&&typeof window<`u`?{origin:window.location.origin}:{},...e.playlist?{list:o}:{}});return e.params&&new URLSearchParams(e.params.startsWith(`&`)?e.params.slice(1):e.params).forEach((e,n)=>{t.append(n,e)}),t},[e.muted,d,e.enableJsApi,e.playlist,o,e.params]),p=Q.useMemo(()=>e.cookie?`https://www.youtube.com`:`https://www.youtube-nocookie.com`,[e.cookie]),m=Q.useMemo(()=>e.playlist?`${p}/embed/videoseries?${f.toString()}`:`${p}/embed/${o}?${f.toString()}`,[e.playlist,p,o,f]),h=!e.thumbnail&&!e.playlist&&l===`maxresdefault`,g=e.webp?`webp`:`jpg`,_=e.webp?`vi_webp`:`vi`,v=h?c_(e.id,_,g,l):null,y=Q.useMemo(()=>e.thumbnail||v||`https://i.ytimg.com/${_}/${e.playlist?s:o}/${l}.${g}`,[e.thumbnail,v,_,e.playlist,s,o,l,g]),b=e.activatedClass||`lyt-activated`,x=e.adNetwork||!1,S=e.aspectHeight||9,C=e.aspectWidth||16,w=e.iframeClass||``,T=e.playerClass||`lty-playbtn`,E=e.wrapperClass||`yt-lite`,D=Q.useCallback(e.onIframeAdded||function(){},[e.onIframeAdded]),O=e.rel?`prefetch`:`preload`,k=e.containerElement||`article`,A=e.noscriptFallback!==!1,j=()=>{n||r(!0)},M=()=>{i||a(!0)};return Q.useEffect(()=>{i&&(D(),e.focusOnLoad&&typeof t==`object`&&t?.current&&t.current.focus())},[i,D,e.focusOnLoad,t]),Q.useEffect(()=>{if(!i||!e.enableJsApi||!(e.onReady||e.onStateChange||e.onError||e.onPlay||e.onPause||e.onEnd||e.onBuffering||e.onPlaybackRateChange||e.onPlaybackQualityChange))return;let n=!1,r=!1,a=r=>{if(r.origin!==`https://www.youtube.com`&&r.origin!==`https://www.youtube-nocookie.com`)return;let i;try{i=typeof r.data==`string`?JSON.parse(r.data):r.data}catch{return}switch(i.event){case`onReady`:n||(n=!0,e.onReady&&e.onReady({videoId:e.id,title:c}));break;case`infoDelivery`:if(i.info?.playerState!==void 0){let n=i.info.playerState;switch(e.onStateChange&&e.onStateChange({state:n,currentTime:i.info.currentTime,duration:i.info.duration}),n){case 1:e.onPlay?.();break;case 2:e.onPause?.();break;case 0:e.onEnd?.(),e.stopOnEnd&&typeof t==`object`&&t?.current?.contentWindow&&t.current.contentWindow.postMessage(`{"event":"command","func":"stopVideo","args":""}`,`*`);break;case 3:e.onBuffering?.();break}}i.info?.playbackRate!==void 0&&e.onPlaybackRateChange?.(i.info.playbackRate),i.info?.playbackQuality!==void 0&&e.onPlaybackQualityChange?.(i.info.playbackQuality);break;case`onStateChange`:if(i.info?.playerState!==void 0){let n=i.info.playerState;switch(e.onStateChange&&e.onStateChange({state:n,currentTime:i.info.currentTime,duration:i.info.duration}),n){case 1:e.onPlay?.();break;case 2:e.onPause?.();break;case 0:e.onEnd?.(),e.stopOnEnd&&typeof t==`object`&&t?.current?.contentWindow&&t.current.contentWindow.postMessage(`{"event":"command","func":"stopVideo","args":""}`,`*`);break;case 3:e.onBuffering?.();break}}break;case`onError`:if(i.info&&`errorCode`in i.info){let t=i.info.errorCode;e.onError&&e.onError(t)}break;case`onPlaybackRateChange`:i.info?.playbackRate!==void 0&&e.onPlaybackRateChange?.(i.info.playbackRate);break;case`onPlaybackQualityChange`:i.info?.playbackQuality!==void 0&&e.onPlaybackQualityChange?.(i.info.playbackQuality);break}};window.addEventListener(`message`,a);let s=[],l=()=>{typeof t==`object`&&t?.current?.contentWindow&&t.current.contentWindow.postMessage(`{"event":"listening","id":"`+o+`"}`,`*`)},u=()=>{r||(r=!0,l(),[100,300,600,1200,2400].forEach(e=>{s.push(setTimeout(l,e))}))};return typeof t==`object`&&t?.current?(t.current.addEventListener(`load`,u),t.current.contentDocument?.readyState===`complete`&&u()):[200,500,1e3,2e3,3e3].forEach(e=>{s.push(setTimeout(l,e))}),()=>{window.removeEventListener(`message`,a),s.forEach(clearTimeout),typeof t==`object`&&t?.current&&t.current.removeEventListener(`load`,u)}},[i,e.enableJsApi,e.onReady,e.onStateChange,e.onError,e.onPlay,e.onPause,e.onEnd,e.onBuffering,e.onPlaybackRateChange,e.onPlaybackQualityChange,e.stopOnEnd,e.id,o,c,t]),(0,$.jsxs)($.Fragment,{children:[!e.lazyLoad&&(0,$.jsx)(`link`,{rel:O,href:y,as:`image`}),(0,$.jsx)($.Fragment,{children:n&&(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(`link`,{rel:`preconnect`,href:p}),(0,$.jsx)(`link`,{rel:`preconnect`,href:`https://www.google.com`}),x&&(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(`link`,{rel:`preconnect`,href:`https://static.doubleclick.net`}),(0,$.jsx)(`link`,{rel:`preconnect`,href:`https://googleads.g.doubleclick.net`})]})]})}),e.seo&&!e.playlist&&(0,$.jsx)(`script`,{type:`application/ld+json`,dangerouslySetInnerHTML:{__html:l_(e.id,c,y,p,e.seo)}}),A&&!e.playlist&&(0,$.jsx)(`noscript`,{children:(0,$.jsxs)(`a`,{href:`https://www.youtube.com/watch?v=${e.id}`,"aria-label":`Watch ${c} on YouTube`,children:[`Watch "`,c,`" on YouTube`]})}),(0,$.jsxs)(k,{onPointerOver:j,onClick:M,className:`${E} ${i?b:``}`,"data-title":c,role:!i&&!e.lazyLoad?`img`:void 0,"aria-label":i?void 0:`${c} - YouTube video preview`,style:{...!e.lazyLoad&&{backgroundImage:`url(${y})`},"--aspect-ratio":`${S/C*100}%`,...e.style||{}},children:[e.lazyLoad&&!i&&(0,$.jsx)(`img`,{src:y,alt:`${c} - YouTube thumbnail`,className:`lty-thumbnail`,loading:`lazy`}),e.playlist&&!i&&(0,$.jsx)(`div`,{className:`lty-playlist-icon`,"aria-hidden":`true`}),!(e.hideButtonOnActivate&&i)&&(0,$.jsx)(`button`,{type:`button`,className:T,"aria-label":`${u} ${c}`,"aria-hidden":i||void 0,tabIndex:i?-1:0,onClick:M,children:(0,$.jsx)(`span`,{className:`lty-visually-hidden`,children:u})}),i&&(0,$.jsx)(`iframe`,{ref:t,className:w,title:c,width:`560`,height:`315`,allow:`accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture`,allowFullScreen:!0,src:m,referrerPolicy:e.referrerPolicy||`strict-origin-when-cross-origin`})]})]})}var d_=Q.forwardRef(u_);function f_(e){return e!==!1}function p_(e,t){let n=[];return t.startSeconds!==null&&n.push(`start=${t.startSeconds}`),e.controls===!1&&n.push(`controls=0`),e.loop===!0&&n.push(`loop=1`,`playlist=${t.id}`),e.playsinline===!0&&n.push(`playsinline=1`),n.length>0?n.join(`&`):void 0}function m_(e){if(e.width!==void 0)return{width:e.width}}function h_(e){if(!(e.width===void 0||e.height===void 0))return{aspectRatio:`${e.width} / ${e.height}`}}function g_(e){let t=(0,Z.c)(23),n=(0,Q.useRef)(null),r=e.title??`Vimeo video player`,i;t[0]===r?i=t[1]:(i=e=>{let t=e;n.current=t,t.element&&(t.element.title=r)},t[0]=r,t[1]=i);let a=i,o,s;t[2]===r?(o=t[3],s=t[4]):(o=()=>{let e=n.current;e?.element&&(e.element.title=r)},s=[r],t[2]=r,t[3]=o,t[4]=s),(0,Q.useEffect)(o,s);let c;t[5]===e?c=t[6]:(c=m_(e),t[5]=e,t[6]=c);let l=e.width===void 0,u=e.autoplay===!0,d=e.muted===!0,f=e.muted===!0?0:1,p=e.loop===!0,m=e.controls!==!1,h=e.playsinline!==!1,g;t[7]!==a||t[8]!==e.height||t[9]!==e.src||t[10]!==e.width||t[11]!==h||t[12]!==l||t[13]!==u||t[14]!==d||t[15]!==f||t[16]!==p||t[17]!==m?(g=(0,$.jsx)(o_,{video:e.src,responsive:l,width:e.width,height:e.height,autoplay:u,muted:d,volume:f,loop:p,controls:m,playsInline:h,onReady:a}),t[7]=a,t[8]=e.height,t[9]=e.src,t[10]=e.width,t[11]=h,t[12]=l,t[13]=u,t[14]=d,t[15]=f,t[16]=p,t[17]=m,t[18]=g):g=t[18];let _;return t[19]!==e.title||t[20]!==g||t[21]!==c?(_=(0,$.jsx)(`div`,{className:`ok-video ok-video-vimeo`,style:c,title:e.title,children:g}),t[19]=e.title,t[20]=g,t[21]=c,t[22]=_):_=t[22],_}function __(e){let t=(0,Z.c)(17),n;t[0]===e.src?n=t[1]:(n=Ct(e.src),t[0]=e.src,t[1]=n);let r=n;if(!r)return null;let i;t[2]!==r.startRaw||t[3]!==e.autoplay||t[4]!==e.muted?(i=[],r.startRaw!==null&&i.push(`t=${r.startRaw}`),e.autoplay===!0&&i.push(`autoplay=true`),e.muted===!0&&i.push(`muted=true`),t[2]=r.startRaw,t[3]=e.autoplay,t[4]=e.muted,t[5]=i):i=t[5];let a=i.length>0?`https://www.loom.com/embed/${r.id}?${i.join(`&`)}`:`https://www.loom.com/embed/${r.id}`,o;t[6]===e?o=t[7]:(o=m_(e),t[6]=e,t[7]=o);let s=e.title??`Loom video player`,c;t[8]!==a||t[9]!==e.height||t[10]!==e.width||t[11]!==s?(c=(0,$.jsx)(`iframe`,{className:`ok-video-loom-iframe`,src:a,title:s,width:e.width,height:e.height,allow:`autoplay; fullscreen`,referrerPolicy:`strict-origin-when-cross-origin`,allowFullScreen:!0}),t[8]=a,t[9]=e.height,t[10]=e.width,t[11]=s,t[12]=c):c=t[12];let l;return t[13]!==e.title||t[14]!==o||t[15]!==c?(l=(0,$.jsx)(`div`,{className:`ok-video ok-video-loom`,style:o,title:e.title,children:c}),t[13]=e.title,t[14]=o,t[15]=c,t[16]=l):l=t[16],l}function v_(e){let t=(0,Z.c)(29);if(e.src!==void 0&&In(e.src)){let n;return t[0]===e?n=t[1]:(n=(0,$.jsx)(__,{...e,src:e.src}),t[0]=e,t[1]=n),n}if(e.src!==void 0&&br(e.src)){let n;return t[2]===e?n=t[3]:(n=(0,$.jsx)(g_,{...e,src:e.src}),t[2]=e,t[3]=n),n}let n;if(t[4]!==e){n=Symbol.for(`react.early_return_sentinel`);bb0:{let r=e.src===void 0?null:on(e.src);if(r!==null){let i=e.autoplay===!0&&e.muted===!0,a=e.width!==void 0&&e.height!==void 0,o=m_(e),s;t[6]===e.poster?s=t[7]:(s=e.poster===void 0?void 0:vn(e.poster),t[6]=e.poster,t[7]=s);let c=(0,$.jsx)(d_,{id:r.id,title:e.title??`YouTube video player`,cookie:!r.noCookie,params:p_(e,r),muted:e.muted===!0,autoplay:e.autoplay===!0,alwaysLoadIframe:i,thumbnail:s,aspectWidth:a?Number(e.width):void 0,aspectHeight:a?Number(e.height):void 0,style:h_(e)}),l;t[8]!==o||t[9]!==c?(l=(0,$.jsx)(`div`,{className:`ok-video ok-video-youtube`,style:o,children:c}),t[8]=o,t[9]=c,t[10]=l):l=t[10],n=l;break bb0}}t[4]=e,t[5]=n}else n=t[5];if(n!==Symbol.for(`react.early_return_sentinel`))return n;let r;t[11]===e.src?r=t[12]:(r=e.src===void 0?void 0:vn(e.src),t[11]=e.src,t[12]=r);let i=e.title,a;t[13]===e.controls?a=t[14]:(a=f_(e.controls),t[13]=e.controls,t[14]=a);let o;t[15]===e.poster?o=t[16]:(o=e.poster===void 0?void 0:vn(e.poster),t[15]=e.poster,t[16]=o);let s;return t[17]!==e.autoplay||t[18]!==e.height||t[19]!==e.loop||t[20]!==e.muted||t[21]!==e.playsinline||t[22]!==e.preload||t[23]!==e.title||t[24]!==e.width||t[25]!==r||t[26]!==a||t[27]!==o?(s=(0,$.jsx)(`video`,{className:`ok-video`,src:r,title:i,controls:a,autoPlay:e.autoplay,muted:e.muted,loop:e.loop,playsInline:e.playsinline,poster:o,preload:e.preload,width:e.width,height:e.height}),t[17]=e.autoplay,t[18]=e.height,t[19]=e.loop,t[20]=e.muted,t[21]=e.playsinline,t[22]=e.preload,t[23]=e.title,t[24]=e.width,t[25]=r,t[26]=a,t[27]=o,t[28]=s):s=t[28],s}function y_(e){let t=(0,Z.c)(2),n;return t[0]===e.children?n=t[1]:(n=(0,$.jsx)(`div`,{className:`prose-no-margin`,children:e.children}),t[0]=e.children,t[1]=n),n}var b_={Callout:Mm,img:Th,video:v_,audio:Dm,Pdf:$h,File:Hm,Embed:Bm,Accordion:Tm,Tabs:ug,Tab:og,Math:Oh,MermaidFence:ne,Mirror:zh,MirrorSource:Bh,"*":y_};function x_(e){let t=new Set;for(let n of e)n.type===`reactnode`&&t.add(n.name);return t}var S_=Lt(),C_=new Map;function w_(e){if(e.surface===`compat`){let t=b_[e.rendersAs];if(!t)throw Error(`Compat descriptor '${e.name}' declares rendersAs: '${e.rendersAs}', but no React component is registered under that name in componentMap. Add the canonical component before registering the compat descriptor.`);return{Component:t,reactNodePropNames:x_(e.props)}}let t=b_[e.name];return t?{Component:t,reactNodePropNames:x_(e.props)}:null}for(let[e,t]of S_.entries()){let n=w_(t);n&&C_.set(e,n)}function T_(e,t){return{...e,Component:t.Component,reactNodePropNames:t.reactNodePropNames}}function E_(e){let t=S_.getOrWildcard(e),n=C_.get(t.name)??C_.get(`*`);if(!n)throw Error(`No React component registered for ${t.name} (and no '*' wildcard)`);return T_(t,n)}function D_(){let e=[];for(let[t,n]of S_.entries()){if(t===`*`)continue;let r=C_.get(t);r&&e.push(T_(n,r))}return e}var O_=``+new URL(`image-preview-BJSGEOo4.png`,import.meta.url).href,k_=``+new URL(`video-preview-vLovc_Vy.png`,import.meta.url).href,A_={Callout:{description:{id:`322lyb`},props:{type:`note`,title:`Heads up`},children:`Callouts draw attention to key information.`},Accordion:{description:{id:`mWVJRX`},props:{title:`Click to expand`,defaultOpen:!0},children:`Hidden content goes here.`},img:{description:{id:`VUijjF`},props:{src:O_,alt:`Sample image`}},video:{description:{id:`e1hptq`},props:{controls:!0,poster:k_}},audio:{description:{id:`9jnjV0`},props:{controls:!0}},Math:{description:{id:`Y-Urt2`},props:{formula:`c = \\pm\\sqrt{a^2 + b^2}`}},Embed:{description:{id:`jTLWxh`},render:()=>(0,$.jsxs)(`div`,{className:`flex h-full w-full flex-col overflow-hidden rounded-md border border-border bg-background`,children:[(0,$.jsxs)(`div`,{className:`flex items-center gap-1.5 border-b border-border bg-muted/40 px-2 py-1.5`,children:[(0,$.jsx)(`span`,{className:`size-1.5 rounded-full bg-muted-foreground/40`}),(0,$.jsx)(`span`,{className:`size-1.5 rounded-full bg-muted-foreground/40`}),(0,$.jsx)(`span`,{className:`size-1.5 rounded-full bg-muted-foreground/40`}),(0,$.jsx)(`span`,{className:`ml-1.5 flex-1 truncate rounded-sm bg-background px-1.5 py-0.5 font-mono text-[10px] text-muted-foreground`,children:`https://example.com/embed`})]}),(0,$.jsxs)(`div`,{className:`flex flex-1 flex-col justify-center gap-1.5 px-3 py-2`,children:[(0,$.jsx)(`span`,{className:`h-1.5 w-3/4 rounded-sm bg-muted-foreground/30`}),(0,$.jsx)(`span`,{className:`h-1.5 w-full rounded-sm bg-muted-foreground/20`}),(0,$.jsx)(`span`,{className:`h-1.5 w-5/6 rounded-sm bg-muted-foreground/20`}),(0,$.jsx)(`span`,{className:`h-1.5 w-2/3 rounded-sm bg-muted-foreground/20`})]})]})},Pdf:{description:{id:`Fqr8BP`},render:()=>(0,$.jsxs)(`div`,{className:`flex h-full w-full flex-col overflow-hidden rounded-md border border-border bg-background`,children:[(0,$.jsxs)(`div`,{className:`flex items-center gap-1 border-b border-border bg-muted/40 px-1.5 py-1`,children:[(0,$.jsxs)(`svg`,{viewBox:`0 0 12 12`,className:`size-3 text-muted-foreground`,"aria-hidden":`true`,children:[(0,$.jsx)(`title`,{children:`Thumbnails`}),(0,$.jsx)(`rect`,{x:`1`,y:`1`,width:`4`,height:`4`,fill:`currentColor`,rx:`0.5`}),(0,$.jsx)(`rect`,{x:`7`,y:`1`,width:`4`,height:`4`,fill:`currentColor`,rx:`0.5`}),(0,$.jsx)(`rect`,{x:`1`,y:`7`,width:`4`,height:`4`,fill:`currentColor`,rx:`0.5`}),(0,$.jsx)(`rect`,{x:`7`,y:`7`,width:`4`,height:`4`,fill:`currentColor`,rx:`0.5`})]}),(0,$.jsxs)(`span`,{className:`ml-1 flex items-center gap-1 text-[10px] text-muted-foreground`,children:[(0,$.jsx)(`span`,{className:`rounded-sm bg-background px-1 py-0.5 font-mono`,children:`2`}),(0,$.jsx)(`span`,{children:`/ 12`})]}),(0,$.jsxs)(`span`,{className:`ml-auto flex items-center gap-1 text-[10px] font-mono text-muted-foreground`,children:[(0,$.jsx)(`span`,{className:`rounded-sm bg-background px-1 py-0.5`,children:`−`}),(0,$.jsx)(`span`,{children:`100%`}),(0,$.jsx)(`span`,{className:`rounded-sm bg-background px-1 py-0.5`,children:`+`})]})]}),(0,$.jsxs)(`div`,{className:`flex flex-1 gap-1 p-1.5`,children:[(0,$.jsxs)(`div`,{className:`flex w-6 flex-col gap-0.5`,children:[(0,$.jsx)(`span`,{className:`h-3 rounded-sm bg-muted-foreground/20`}),(0,$.jsx)(`span`,{className:`h-3 rounded-sm border border-foreground/60 bg-background`}),(0,$.jsx)(`span`,{className:`h-3 rounded-sm bg-muted-foreground/20`})]}),(0,$.jsxs)(`div`,{className:`flex flex-1 flex-col gap-1 rounded-sm bg-background p-1.5`,children:[(0,$.jsx)(`span`,{className:`h-1.5 w-1/2 rounded-sm bg-foreground/50`}),(0,$.jsx)(`span`,{className:`h-1 w-full rounded-sm bg-muted-foreground/30`}),(0,$.jsx)(`span`,{className:`h-1 w-5/6 rounded-sm bg-muted-foreground/30`}),(0,$.jsx)(`span`,{className:`h-1 w-full rounded-sm bg-muted-foreground/30`}),(0,$.jsx)(`span`,{className:`h-1 w-2/3 rounded-sm bg-muted-foreground/30`})]})]})]})},MermaidFence:{description:{id:`z0a2EA`},render:()=>(0,$.jsxs)(`svg`,{viewBox:`0 0 200 120`,className:`h-full w-full text-foreground`,"aria-hidden":`true`,preserveAspectRatio:`xMidYMid meet`,children:[(0,$.jsx)(`title`,{children:`Mermaid flowchart preview`}),(0,$.jsx)(`defs`,{children:(0,$.jsx)(`marker`,{id:`mermaid-preview-arrow`,viewBox:`0 0 10 10`,refX:`9`,refY:`5`,markerWidth:`6`,markerHeight:`6`,orient:`auto-start-reverse`,children:(0,$.jsx)(`path`,{d:`M 0 0 L 10 5 L 0 10 z`,fill:`currentColor`})})}),(0,$.jsx)(`rect`,{x:`14`,y:`20`,width:`56`,height:`28`,rx:`14`,fill:`currentColor`,fillOpacity:`0.1`,stroke:`currentColor`,strokeOpacity:`0.7`}),(0,$.jsx)(`text`,{x:`42`,y:`38`,textAnchor:`middle`,fontSize:`10`,fill:`currentColor`,children:`Start`}),(0,$.jsx)(`polygon`,{points:`100,18 140,50 100,82 60,50`,fill:`currentColor`,fillOpacity:`0.1`,stroke:`currentColor`,strokeOpacity:`0.7`}),(0,$.jsx)(`text`,{x:`100`,y:`54`,textAnchor:`middle`,fontSize:`10`,fill:`currentColor`,children:`Ready?`}),(0,$.jsx)(`rect`,{x:`130`,y:`84`,width:`56`,height:`28`,rx:`14`,fill:`currentColor`,fillOpacity:`0.1`,stroke:`currentColor`,strokeOpacity:`0.7`}),(0,$.jsx)(`text`,{x:`158`,y:`102`,textAnchor:`middle`,fontSize:`10`,fill:`currentColor`,children:`End`}),(0,$.jsx)(`line`,{x1:`70`,y1:`34`,x2:`80`,y2:`40`,stroke:`currentColor`,strokeOpacity:`0.7`,strokeWidth:`1.2`,markerEnd:`url(#mermaid-preview-arrow)`}),(0,$.jsx)(`line`,{x1:`124`,y1:`62`,x2:`138`,y2:`82`,stroke:`currentColor`,strokeOpacity:`0.7`,strokeWidth:`1.2`,markerEnd:`url(#mermaid-preview-arrow)`}),(0,$.jsx)(`text`,{x:`138`,y:`74`,fontSize:`8`,fill:`currentColor`,opacity:`0.6`,children:`yes`})]})},Tabs:{description:{id:`75Y1dk`},render:()=>(0,$.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,$.jsxs)(`div`,{className:`flex gap-1 border-b border-border pb-1`,children:[(0,$.jsx)(`span`,{className:`rounded-md bg-foreground/10 px-2 py-0.5 text-xs font-medium text-foreground`,children:`Tab 1`}),(0,$.jsx)(`span`,{className:`rounded-md px-2 py-0.5 text-xs text-muted-foreground`,children:`Tab 2`})]}),(0,$.jsx)(`p`,{className:`px-1 text-xs text-muted-foreground`,children:(0,$.jsx)(a,{id:`m6YGpY`})})]})},Mirror:{description:{id:`_WPP7e`},render:()=>(0,$.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,$.jsxs)(`div`,{className:`relative rounded-md border border-dashed border-border/40 px-2 py-1.5`,children:[(0,$.jsxs)(`span`,{className:`absolute -top-2 right-1.5 flex items-center gap-1 rounded-md bg-background px-1 text-[10px] text-muted-foreground`,children:[(0,$.jsx)(ro,{className:`size-2.5`,"aria-hidden":`true`}),(0,$.jsx)(`span`,{children:(0,$.jsx)(a,{id:`EL_YRd`,components:{0:(0,$.jsx)(`code`,{className:`font-mono`})}})})]}),(0,$.jsx)(`span`,{className:`block h-1.5 w-3/4 rounded-sm bg-muted-foreground/30`}),(0,$.jsx)(`span`,{className:`mt-1 block h-1.5 w-2/3 rounded-sm bg-muted-foreground/20`})]}),(0,$.jsx)(`p`,{className:`px-1 text-[10px] text-muted-foreground`,children:(0,$.jsx)(a,{id:`qNOgUu`})})]})},MirrorSource:{description:{id:`epuNYK`},render:()=>(0,$.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,$.jsxs)(`div`,{className:`relative rounded-md border border-dashed border-border/50 px-2 py-1.5`,children:[(0,$.jsxs)(`span`,{className:`absolute -top-2 left-1.5 flex items-center gap-1 rounded-md bg-background px-1 text-[10px] text-muted-foreground`,children:[(0,$.jsx)(Br,{className:`size-2.5`,"aria-hidden":`true`}),(0,$.jsx)(`span`,{children:(0,$.jsx)(a,{id:`maDWIB`,components:{0:(0,$.jsx)(`code`,{className:`font-mono`})}})})]}),(0,$.jsx)(`span`,{className:`block h-1.5 w-4/5 rounded-sm bg-muted-foreground/30`}),(0,$.jsx)(`span`,{className:`mt-1 block h-1.5 w-3/5 rounded-sm bg-muted-foreground/20`})]}),(0,$.jsx)(`p`,{className:`px-1 text-[10px] text-muted-foreground`,children:(0,$.jsx)(a,{id:`emgiet`})})]})}};function j_(e){let t={};for(let n of e.props)n.type!==`reactnode`&&`defaultValue`in n&&n.defaultValue!==void 0&&(t[n.name]=n.defaultValue);return t}function M_(e){let t=E_(e),n=j_(t);return{type:`jsxComponent`,attrs:{componentName:t.name,kind:`element`,attributes:[],sourceRaw:``,sourceDirty:!0,props:n},content:t.hasChildren?[{type:`paragraph`}]:void 0}}var N_=new Set;function P_(e){N_.add(e)}function F_(e){if(typeof e==`number`)return N_.delete(e);let t=N_.values().next();return t.done?!1:(N_.delete(t.value),!0)}function I_(e,t,n){n.props.some(e=>!(`hidden`in e&&e.hidden)&&e.type!==`reactnode`)?(P_(t),requestAnimationFrame(()=>{e.commands.setNodeSelection(t)})):n.hasChildren?e.commands.setTextSelection(t+2):(P_(t),requestAnimationFrame(()=>{e.commands.setNodeSelection(t)}))}function L_(e){return t=>{let n=new WeakSet;t.state.doc.descendants(t=>{t.type.name===`jsxComponent`&&t.attrs.componentName===e.name&&n.add(t)});let r=M_(e.name);if(e.name===`Tabs`){let e=M_(`Tab`),t=M_(`Tab`),n=e.attrs,i=t.attrs;n.props={...n.props,label:`Tab 1`},i.props={...i.props,label:`Tab 2`},r.content=[e,t]}t.chain().focus().insertContent(r).run();let i=-1;t.state.doc.descendants((t,r)=>{if(i>=0)return!1;t.type.name===`jsxComponent`&&t.attrs.componentName===e.name&&!n.has(t)&&(i=r)}),!(i<0)&&I_(t,i,e)}}var R_=new Set([`File`,`Tab`]);function z_(){return[{name:`component-File`,label:Y._({id:`J2eKUI`}),icon:ao,category:`media`,aliases:[`file`,`attachment`,`download`,`upload`,`document`,`doc`,`docx`,`zip`],description:"Attach a downloadable file (`.pdf` / `.docx` / `.zip` / …)",insertsBlockComponent:!0,command:V_,preview:{description:Y._({id:`t-JXbf`}),render:()=>(0,$.jsxs)(`div`,{className:`flex w-full items-baseline gap-2 rounded-md px-2 py-1.5`,children:[(0,$.jsx)(ao,{className:`size-4 shrink-0 text-muted-foreground`,"aria-hidden":`true`}),(0,$.jsx)(`span`,{className:`truncate font-medium text-foreground`,children:`quarterly-report.pdf`}),(0,$.jsx)(`span`,{className:`shrink-0 text-xs text-muted-foreground`,children:`1.4 MB`})]})}}]}function B_(){return[...D_().filter(e=>e.surface===`canonical`&&!R_.has(e.name)).map(e=>{let t=A_[e.name],n=e.Component,r=t?{description:Y._(t.description),render:t.render??(()=>(0,$.jsx)(n,{...t.props,children:t.children}))}:void 0;return{name:`component-${e.name}`,label:e.displayName??e.name,icon:xm(e.icon),category:e.category??`content`,command:L_(e),aliases:e.searchTerms,description:e.description,insertsBlockComponent:!0,preview:r}}),...z_()]}function V_(e){let t=document.createElement(`input`);t.type=`file`,t.accept=`*/*`,t.style.display=`none`,t.addEventListener(`change`,()=>{let n=t.files?.[0];if(n){let t=e.state.selection.from;Lp(n,e,t)}t.remove()},{once:!0}),t.addEventListener(`cancel`,()=>t.remove(),{once:!0}),document.body.appendChild(t),t.click()}function H_(){return[{name:`link`,label:Y._({id:`yzF66j`}),icon:_o,category:`insert`,aliases:[`url`,`href`,`external`,`web`,`hyperlink`,`wiki`,`wikilink`,`[[`,`internal`,`page`,`backlink`,`cross-link`],description:`Link to a page or external URL`,preview:{description:Y._({id:`5WDhAk`}),render:()=>(0,$.jsx)(`p`,{className:`leading-7 text-sm`,children:(0,$.jsx)(a,{id:`u-9fWA`,components:{0:(0,$.jsx)(`span`,{className:`font-medium text-azure-blue underline underline-offset-2 dark:text-sky-blue`})}})})},command:e=>{let t=e.state.selection.from;e.chain().focus().insertContent({type:`text`,text:`link`,marks:[{type:`link`,attrs:{href:``}}]}).run();let n=im(e.state,t,`link`);n&&(Zp(n),requestAnimationFrame(()=>{ym(e).setActiveNode(n)}))}},{name:`component-Tag`,label:Y._({id:`UL8A9w`}),icon:Jr,category:`content`,aliases:[`#`,`hashtag`,`label`],description:"Inline tag (`#tagname`) for cross-doc linking",preview:{description:Y._({id:`5ClEAu`}),render:()=>(0,$.jsx)(`p`,{className:`text-sm leading-7`,children:(0,$.jsx)(a,{id:`KZLdgR`,components:{0:(0,$.jsx)(`a`,{className:`tag pointer-events-none`})}})})},command:e=>{e.chain().insertTag(``).run()}}]}function U_(e,t){e.chain().focus().insertContent({type:`codeBlock`,attrs:{language:`html`,meta:`preview`},content:[{type:`text`,text:t}]}).run()}var W_=`<div style="padding:20px;font-family:system-ui,sans-serif;color:var(--foreground)">
|
|
3
3
|
<h1 style="margin:0 0 8px;font-size:20px;font-weight:600">Hello, world!</h1>
|
|
4
4
|
<p style="margin:0;color:var(--muted-foreground)">Edit this HTML — the preview updates live.</p>
|
|
5
5
|
</div>`,G_={chart:{icon:Ya,aliases:[`chart`,`bar`,`graph`,`plot`,`viz`,`data`,`embed`,`preview`],render:()=>(0,$.jsxs)(`div`,{className:`flex h-20 w-full items-end gap-1.5`,children:[(0,$.jsx)(`div`,{className:`h-[45%] flex-1 rounded-t-sm bg-chart-1`}),(0,$.jsx)(`div`,{className:`h-[70%] flex-1 rounded-t-sm bg-chart-2`}),(0,$.jsx)(`div`,{className:`h-[90%] flex-1 rounded-t-sm bg-chart-3`}),(0,$.jsx)(`div`,{className:`h-[60%] flex-1 rounded-t-sm bg-chart-4`}),(0,$.jsx)(`div`,{className:`h-[80%] flex-1 rounded-t-sm bg-chart-5`})]})},"stat-cards":{icon:fo,aliases:[`stat`,`stats`,`metric`,`metrics`,`cards`,`kpi`,`embed`,`preview`],render:()=>(0,$.jsxs)(`div`,{className:`flex gap-2`,children:[(0,$.jsxs)(`div`,{className:`flex-1 rounded-md border border-border bg-card p-2`,children:[(0,$.jsx)(`div`,{className:`text-[10px] text-muted-foreground`,children:`Users`}),(0,$.jsx)(`div`,{className:`text-sm font-bold text-card-foreground`,children:`12.4k`}),(0,$.jsx)(`div`,{className:`text-[10px] font-semibold text-chart-2`,children:`+8.2%`})]}),(0,$.jsxs)(`div`,{className:`flex-1 rounded-md border border-border bg-card p-2`,children:[(0,$.jsx)(`div`,{className:`text-[10px] text-muted-foreground`,children:`Revenue`}),(0,$.jsx)(`div`,{className:`text-sm font-bold text-card-foreground`,children:`$48k`}),(0,$.jsx)(`div`,{className:`text-[10px] font-semibold text-chart-1`,children:`+3.1%`})]})]})},"custom-svg":{icon:Oo,aliases:[`svg`,`vector`,`graphic`,`illustration`,`ring`,`embed`,`preview`],render:()=>(0,$.jsx)(`div`,{className:`flex items-center justify-center text-chart-1`,children:(0,$.jsxs)(`svg`,{width:`72`,height:`72`,viewBox:`0 0 72 72`,"aria-hidden":`true`,children:[(0,$.jsx)(`circle`,{cx:`36`,cy:`36`,r:`28`,fill:`none`,stroke:`currentColor`,strokeOpacity:`0.15`,strokeWidth:`9`}),(0,$.jsx)(`circle`,{cx:`36`,cy:`36`,r:`28`,fill:`none`,stroke:`currentColor`,strokeWidth:`9`,strokeLinecap:`round`,strokeDasharray:`176`,strokeDashoffset:`53`,transform:`rotate(-90 36 36)`})]})})},"interactive-control":{icon:$r,aliases:[`interactive`,`slider`,`control`,`widget`,`input`,`embed`,`preview`],render:()=>(0,$.jsxs)(`div`,{className:`space-y-2`,children:[(0,$.jsx)(`div`,{className:`text-lg font-bold text-chart-1`,children:`$2,500`}),(0,$.jsxs)(`div`,{className:`relative h-1.5 rounded-full bg-muted`,children:[(0,$.jsx)(`div`,{className:`absolute inset-y-0 left-0 w-1/3 rounded-full bg-primary`}),(0,$.jsx)(`div`,{className:`-translate-x-1/2 -translate-y-1/2 absolute top-1/2 left-1/3 size-3 rounded-full bg-primary`})]}),(0,$.jsx)(`div`,{className:`text-[10px] text-muted-foreground`,children:`Drag to adjust`})]})}};function K_(){return{name:`embed-starter-html`,label:Y._({id:`FBknns`}),icon:to,category:`embed`,aliases:[`html`,`embed`,`preview`,`iframe`,`sandbox`,`web`,`snippet`],description:Y._({id:`4niEzY`}),command:e=>U_(e,W_),preview:{description:Y._({id:`rageVb`}),render:()=>(0,$.jsxs)(`div`,{className:`flex h-full w-full flex-col overflow-hidden rounded-md border border-border bg-background`,children:[(0,$.jsxs)(`div`,{className:`flex items-center gap-1.5 border-b border-border bg-muted/40 px-2 py-1.5`,children:[(0,$.jsx)(`span`,{className:`size-1.5 rounded-full bg-muted-foreground/40`}),(0,$.jsx)(`span`,{className:`size-1.5 rounded-full bg-muted-foreground/40`}),(0,$.jsx)(`span`,{className:`size-1.5 rounded-full bg-muted-foreground/40`}),(0,$.jsx)(`span`,{className:`ml-1.5 flex-1 truncate rounded-sm bg-background px-1.5 py-0.5 font-mono text-[10px] text-muted-foreground`,children:`sandbox`})]}),(0,$.jsxs)(`div`,{className:`flex flex-1 flex-col justify-center gap-1.5 px-3 py-3`,children:[(0,$.jsx)(`span`,{className:`font-semibold text-foreground text-sm`,children:(0,$.jsx)(a,{id:`3HNlwb`})}),(0,$.jsx)(`span`,{className:`text-[10px] text-muted-foreground`,children:(0,$.jsx)(a,{id:`bH382I`})})]})]})}}}function q_(){let e=On.map(e=>{let t=G_[e.id];return{name:`embed-starter-${e.id}`,label:e.title,icon:t.icon,category:`embed`,command:t=>U_(t,e.html),aliases:t.aliases,description:e.description,preview:{description:e.description,render:t.render}}});return[K_(),...e]}function J_(){return[{name:`heading1`,label:Y._({id:`lXKZGw`}),icon:co,category:`basic`,command:e=>e.chain().focus().toggleHeading({level:1}).run(),aliases:[`h1`],preview:{description:Y._({id:`3J7d2N`}),render:()=>(0,$.jsx)(`h1`,{className:`text-2xl font-semibold tracking-tight`,children:(0,$.jsx)(a,{id:`lXKZGw`})})}},{name:`heading2`,label:Y._({id:`El7NbA`}),icon:lo,category:`basic`,command:e=>e.chain().focus().toggleHeading({level:2}).run(),aliases:[`h2`],preview:{description:Y._({id:`LXdWeS`}),render:()=>(0,$.jsx)(`h2`,{className:`text-xl font-semibold tracking-tight`,children:(0,$.jsx)(a,{id:`El7NbA`})})}},{name:`heading3`,label:Y._({id:`SFN6dN`}),icon:uo,category:`basic`,command:e=>e.chain().focus().toggleHeading({level:3}).run(),aliases:[`h3`],preview:{description:Y._({id:`g4XBm0`}),render:()=>(0,$.jsx)(`h3`,{className:`text-base font-semibold tracking-tight`,children:(0,$.jsx)(a,{id:`SFN6dN`})})}},{name:`bulletList`,label:Y._({id:`s1c0ja`}),icon:bo,category:`basic`,command:e=>e.chain().focus().toggleBulletList().run(),aliases:[`ul`,`unordered`],preview:{description:Y._({id:`fYjgXu`}),render:()=>(0,$.jsxs)(`ul`,{className:`list-disc pl-5 text-sm leading-7`,children:[(0,$.jsx)(`li`,{children:(0,$.jsx)(a,{id:`FCxvG5`})}),(0,$.jsx)(`li`,{children:(0,$.jsx)(a,{id:`saIASg`})})]})}},{name:`orderedList`,label:Y._({id:`Uci-Ph`}),icon:vo,category:`basic`,command:e=>e.chain().focus().toggleOrderedList().run(),aliases:[`ol`,`numbered`],preview:{description:Y._({id:`rXz97P`}),render:()=>(0,$.jsxs)(`ol`,{className:`list-decimal pl-5 text-sm leading-7`,children:[(0,$.jsx)(`li`,{children:(0,$.jsx)(a,{id:`FCxvG5`})}),(0,$.jsx)(`li`,{children:(0,$.jsx)(a,{id:`saIASg`})})]})}},{name:`taskList`,label:Y._({id:`G_686w`}),icon:yo,category:`basic`,command:e=>e.chain().focus().toggleTaskList().run(),aliases:[`todo`,`checklist`,`checkbox`],preview:{description:Y._({id:`yutJKi`}),render:()=>(0,$.jsxs)(`ul`,{className:`space-y-1.5 text-sm`,children:[(0,$.jsxs)(`li`,{className:`flex items-center gap-2`,children:[(0,$.jsx)(`input`,{type:`checkbox`,checked:!0,readOnly:!0,className:`size-3.5`}),(0,$.jsx)(`span`,{className:`text-muted-foreground line-through`,children:(0,$.jsx)(a,{id:`DPfwMq`})})]}),(0,$.jsxs)(`li`,{className:`flex items-center gap-2`,children:[(0,$.jsx)(`input`,{type:`checkbox`,readOnly:!0,className:`size-3.5`}),(0,$.jsx)(`span`,{children:(0,$.jsx)(a,{id:`rZ9HZq`})})]})]})}},{name:`blockquote`,label:Y._({id:`ZhhOwV`}),icon:To,category:`basic`,command:e=>e.chain().focus().toggleBlockquote().run(),aliases:[`quote`],preview:{description:Y._({id:`w7nm4K`}),render:()=>(0,$.jsx)(`blockquote`,{className:`border-l-2 border-muted-foreground/40 pl-3 text-sm italic text-muted-foreground`,children:(0,$.jsx)(a,{id:`74-bX-`})})}},{name:`codeBlock`,label:Y._({id:`N2eHWq`}),icon:eo,category:`basic`,command:e=>e.chain().focus().toggleCodeBlock({language:`js`}).run(),aliases:[`code`,`fence`],preview:{description:Y._({id:`XpIZmv`}),render:()=>(0,$.jsx)(`pre`,{className:`rounded-md bg-muted px-2.5 py-2 font-mono text-xs leading-5`,children:(0,$.jsx)(`code`,{children:`const greeting = "Hello";
|
|
@@ -7,7 +7,7 @@ console.log(greeting);`})})}},{name:`table`,label:Y._({id:`4hJhzz`}),icon:No,cat
|
|
|
7
7
|
`},l]}}var ay=e=>({IMPORTANT:{scope:`meta`,begin:`!important`},BLOCK_COMMENT:e.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:`number`,begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:`built_in`,begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:`selector-attr`,begin:/\[/,end:/\]/,illegal:`$`,contains:[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:`number`,begin:e.NUMBER_RE+`(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?`,relevance:0},CSS_VARIABLE:{className:`attr`,begin:/--[A-Za-z_][A-Za-z0-9_-]*/}}),oy=`a.abbr.address.article.aside.audio.b.blockquote.body.button.canvas.caption.cite.code.dd.del.details.dfn.div.dl.dt.em.fieldset.figcaption.figure.footer.form.h1.h2.h3.h4.h5.h6.header.hgroup.html.i.iframe.img.input.ins.kbd.label.legend.li.main.mark.menu.nav.object.ol.optgroup.option.p.picture.q.quote.samp.section.select.source.span.strong.summary.sup.table.tbody.td.textarea.tfoot.th.thead.time.tr.ul.var.video`.split(`.`),sy=`defs.g.marker.mask.pattern.svg.switch.symbol.feBlend.feColorMatrix.feComponentTransfer.feComposite.feConvolveMatrix.feDiffuseLighting.feDisplacementMap.feFlood.feGaussianBlur.feImage.feMerge.feMorphology.feOffset.feSpecularLighting.feTile.feTurbulence.linearGradient.radialGradient.stop.circle.ellipse.image.line.path.polygon.polyline.rect.text.use.textPath.tspan.foreignObject.clipPath`.split(`.`),cy=[...oy,...sy],ly=`any-hover.any-pointer.aspect-ratio.color.color-gamut.color-index.device-aspect-ratio.device-height.device-width.display-mode.forced-colors.grid.height.hover.inverted-colors.monochrome.orientation.overflow-block.overflow-inline.pointer.prefers-color-scheme.prefers-contrast.prefers-reduced-motion.prefers-reduced-transparency.resolution.scan.scripting.update.width.min-width.max-width.min-height.max-height`.split(`.`).sort().reverse(),uy=`active.any-link.blank.checked.current.default.defined.dir.disabled.drop.empty.enabled.first.first-child.first-of-type.fullscreen.future.focus.focus-visible.focus-within.has.host.host-context.hover.indeterminate.in-range.invalid.is.lang.last-child.last-of-type.left.link.local-link.not.nth-child.nth-col.nth-last-child.nth-last-col.nth-last-of-type.nth-of-type.only-child.only-of-type.optional.out-of-range.past.placeholder-shown.read-only.read-write.required.right.root.scope.target.target-within.user-invalid.valid.visited.where`.split(`.`).sort().reverse(),dy=[`after`,`backdrop`,`before`,`cue`,`cue-region`,`first-letter`,`first-line`,`grammar-error`,`marker`,`part`,`placeholder`,`selection`,`slotted`,`spelling-error`].sort().reverse(),fy=`accent-color.align-content.align-items.align-self.alignment-baseline.all.anchor-name.animation.animation-composition.animation-delay.animation-direction.animation-duration.animation-fill-mode.animation-iteration-count.animation-name.animation-play-state.animation-range.animation-range-end.animation-range-start.animation-timeline.animation-timing-function.appearance.aspect-ratio.backdrop-filter.backface-visibility.background.background-attachment.background-blend-mode.background-clip.background-color.background-image.background-origin.background-position.background-position-x.background-position-y.background-repeat.background-size.baseline-shift.block-size.border.border-block.border-block-color.border-block-end.border-block-end-color.border-block-end-style.border-block-end-width.border-block-start.border-block-start-color.border-block-start-style.border-block-start-width.border-block-style.border-block-width.border-bottom.border-bottom-color.border-bottom-left-radius.border-bottom-right-radius.border-bottom-style.border-bottom-width.border-collapse.border-color.border-end-end-radius.border-end-start-radius.border-image.border-image-outset.border-image-repeat.border-image-slice.border-image-source.border-image-width.border-inline.border-inline-color.border-inline-end.border-inline-end-color.border-inline-end-style.border-inline-end-width.border-inline-start.border-inline-start-color.border-inline-start-style.border-inline-start-width.border-inline-style.border-inline-width.border-left.border-left-color.border-left-style.border-left-width.border-radius.border-right.border-right-color.border-right-style.border-right-width.border-spacing.border-start-end-radius.border-start-start-radius.border-style.border-top.border-top-color.border-top-left-radius.border-top-right-radius.border-top-style.border-top-width.border-width.bottom.box-align.box-decoration-break.box-direction.box-flex.box-flex-group.box-lines.box-ordinal-group.box-orient.box-pack.box-shadow.box-sizing.break-after.break-before.break-inside.caption-side.caret-color.clear.clip.clip-path.clip-rule.color.color-interpolation.color-interpolation-filters.color-profile.color-rendering.color-scheme.column-count.column-fill.column-gap.column-rule.column-rule-color.column-rule-style.column-rule-width.column-span.column-width.columns.contain.contain-intrinsic-block-size.contain-intrinsic-height.contain-intrinsic-inline-size.contain-intrinsic-size.contain-intrinsic-width.container.container-name.container-type.content.content-visibility.counter-increment.counter-reset.counter-set.cue.cue-after.cue-before.cursor.cx.cy.direction.display.dominant-baseline.empty-cells.enable-background.field-sizing.fill.fill-opacity.fill-rule.filter.flex.flex-basis.flex-direction.flex-flow.flex-grow.flex-shrink.flex-wrap.float.flood-color.flood-opacity.flow.font.font-display.font-family.font-feature-settings.font-kerning.font-language-override.font-optical-sizing.font-palette.font-size.font-size-adjust.font-smooth.font-smoothing.font-stretch.font-style.font-synthesis.font-synthesis-position.font-synthesis-small-caps.font-synthesis-style.font-synthesis-weight.font-variant.font-variant-alternates.font-variant-caps.font-variant-east-asian.font-variant-emoji.font-variant-ligatures.font-variant-numeric.font-variant-position.font-variation-settings.font-weight.forced-color-adjust.gap.glyph-orientation-horizontal.glyph-orientation-vertical.grid.grid-area.grid-auto-columns.grid-auto-flow.grid-auto-rows.grid-column.grid-column-end.grid-column-start.grid-gap.grid-row.grid-row-end.grid-row-start.grid-template.grid-template-areas.grid-template-columns.grid-template-rows.hanging-punctuation.height.hyphenate-character.hyphenate-limit-chars.hyphens.icon.image-orientation.image-rendering.image-resolution.ime-mode.initial-letter.initial-letter-align.inline-size.inset.inset-area.inset-block.inset-block-end.inset-block-start.inset-inline.inset-inline-end.inset-inline-start.isolation.justify-content.justify-items.justify-self.kerning.left.letter-spacing.lighting-color.line-break.line-height.line-height-step.list-style.list-style-image.list-style-position.list-style-type.margin.margin-block.margin-block-end.margin-block-start.margin-bottom.margin-inline.margin-inline-end.margin-inline-start.margin-left.margin-right.margin-top.margin-trim.marker.marker-end.marker-mid.marker-start.marks.mask.mask-border.mask-border-mode.mask-border-outset.mask-border-repeat.mask-border-slice.mask-border-source.mask-border-width.mask-clip.mask-composite.mask-image.mask-mode.mask-origin.mask-position.mask-repeat.mask-size.mask-type.masonry-auto-flow.math-depth.math-shift.math-style.max-block-size.max-height.max-inline-size.max-width.min-block-size.min-height.min-inline-size.min-width.mix-blend-mode.nav-down.nav-index.nav-left.nav-right.nav-up.none.normal.object-fit.object-position.offset.offset-anchor.offset-distance.offset-path.offset-position.offset-rotate.opacity.order.orphans.outline.outline-color.outline-offset.outline-style.outline-width.overflow.overflow-anchor.overflow-block.overflow-clip-margin.overflow-inline.overflow-wrap.overflow-x.overflow-y.overlay.overscroll-behavior.overscroll-behavior-block.overscroll-behavior-inline.overscroll-behavior-x.overscroll-behavior-y.padding.padding-block.padding-block-end.padding-block-start.padding-bottom.padding-inline.padding-inline-end.padding-inline-start.padding-left.padding-right.padding-top.page.page-break-after.page-break-before.page-break-inside.paint-order.pause.pause-after.pause-before.perspective.perspective-origin.place-content.place-items.place-self.pointer-events.position.position-anchor.position-visibility.print-color-adjust.quotes.r.resize.rest.rest-after.rest-before.right.rotate.row-gap.ruby-align.ruby-position.scale.scroll-behavior.scroll-margin.scroll-margin-block.scroll-margin-block-end.scroll-margin-block-start.scroll-margin-bottom.scroll-margin-inline.scroll-margin-inline-end.scroll-margin-inline-start.scroll-margin-left.scroll-margin-right.scroll-margin-top.scroll-padding.scroll-padding-block.scroll-padding-block-end.scroll-padding-block-start.scroll-padding-bottom.scroll-padding-inline.scroll-padding-inline-end.scroll-padding-inline-start.scroll-padding-left.scroll-padding-right.scroll-padding-top.scroll-snap-align.scroll-snap-stop.scroll-snap-type.scroll-timeline.scroll-timeline-axis.scroll-timeline-name.scrollbar-color.scrollbar-gutter.scrollbar-width.shape-image-threshold.shape-margin.shape-outside.shape-rendering.speak.speak-as.src.stop-color.stop-opacity.stroke.stroke-dasharray.stroke-dashoffset.stroke-linecap.stroke-linejoin.stroke-miterlimit.stroke-opacity.stroke-width.tab-size.table-layout.text-align.text-align-all.text-align-last.text-anchor.text-combine-upright.text-decoration.text-decoration-color.text-decoration-line.text-decoration-skip.text-decoration-skip-ink.text-decoration-style.text-decoration-thickness.text-emphasis.text-emphasis-color.text-emphasis-position.text-emphasis-style.text-indent.text-justify.text-orientation.text-overflow.text-rendering.text-shadow.text-size-adjust.text-transform.text-underline-offset.text-underline-position.text-wrap.text-wrap-mode.text-wrap-style.timeline-scope.top.touch-action.transform.transform-box.transform-origin.transform-style.transition.transition-behavior.transition-delay.transition-duration.transition-property.transition-timing-function.translate.unicode-bidi.user-modify.user-select.vector-effect.vertical-align.view-timeline.view-timeline-axis.view-timeline-inset.view-timeline-name.view-transition-name.visibility.voice-balance.voice-duration.voice-family.voice-pitch.voice-range.voice-rate.voice-stress.voice-volume.white-space.white-space-collapse.widows.width.will-change.word-break.word-spacing.word-wrap.writing-mode.x.y.z-index.zoom`.split(`.`).sort().reverse(),py=uy.concat(dy).sort().reverse();function my(e){let t=ay(e),n=py,r=`[\\w-]+`,i=`(`+r+`|@\\{[\\w-]+\\})`,a=[],o=[],s=function(e){return{className:`string`,begin:`~?`+e+`.*?`+e}},c=function(e,t,n){return{className:e,begin:t,relevance:n}},l={$pattern:/[a-z-]+/,keyword:`and or not only`,attribute:ly.join(` `)},u={begin:`\\(`,end:`\\)`,contains:o,keywords:l,relevance:0};o.push(e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,s(`'`),s(`"`),t.CSS_NUMBER_MODE,{begin:`(url|data-uri)\\(`,starts:{className:`string`,end:`[\\)\\n]`,excludeEnd:!0}},t.HEXCOLOR,u,c(`variable`,`@@?`+r,10),c(`variable`,`@\\{`+r+`\\}`),c(`built_in`,"~?`[^`]*?`"),{className:`attribute`,begin:r+`\\s*:`,end:`:`,returnBegin:!0,excludeEnd:!0},t.IMPORTANT,{beginKeywords:`and not`},t.FUNCTION_DISPATCH);let d=o.concat({begin:/\{/,end:/\}/,contains:a}),f={beginKeywords:`when`,endsWithParent:!0,contains:[{beginKeywords:`and not`}].concat(o)},p={begin:i+`\\s*:`,returnBegin:!0,end:/[;}]/,relevance:0,contains:[{begin:/-(webkit|moz|ms|o)-/},t.CSS_VARIABLE,{className:`attribute`,begin:`\\b(`+fy.join(`|`)+`)\\b`,end:/(?=:)/,starts:{endsWithParent:!0,illegal:`[<=$]`,relevance:0,contains:o}}]},m={className:`keyword`,begin:`@(import|media|charset|font-face|(-[a-z]+-)?keyframes|supports|document|namespace|page|viewport|host)\\b`,starts:{end:`[;{}]`,keywords:l,returnEnd:!0,contains:o,relevance:0}},h={className:`variable`,variants:[{begin:`@`+r+`\\s*:`,relevance:15},{begin:`@`+r}],starts:{end:`[;}]`,returnEnd:!0,contains:d}},g={variants:[{begin:`[\\.#:&\\[>]`,end:`[;{}]`},{begin:i,end:/\{/}],returnBegin:!0,returnEnd:!0,illegal:`[<='$"]`,relevance:0,contains:[e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,f,c(`keyword`,`all\\b`),c(`variable`,`@\\{`+r+`\\}`),{begin:`\\b(`+cy.join(`|`)+`)\\b`,className:`selector-tag`},t.CSS_NUMBER_MODE,c(`selector-tag`,i,0),c(`selector-id`,`#`+i),c(`selector-class`,`\\.`+i,0),c(`selector-tag`,`&`,0),t.ATTRIBUTE_SELECTOR_MODE,{className:`selector-pseudo`,begin:`:(`+uy.join(`|`)+`)`},{className:`selector-pseudo`,begin:`:(:)?(`+dy.join(`|`)+`)`},{begin:/\(/,end:/\)/,relevance:0,contains:d},{begin:`!important`},t.FUNCTION_DISPATCH]},_={begin:`[\\w-]+:(:)?(${n.join(`|`)})`,returnBegin:!0,contains:[g]};return a.push(e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,m,h,_,p,g,f,t.FUNCTION_DISPATCH),{name:`Less`,case_insensitive:!0,illegal:`[=>'/<($"]`,contains:a}}function hy(e){let t=`\\[=*\\[`,n=`\\]=*\\]`,r={begin:t,end:n,contains:[`self`]},i=[e.COMMENT(`--(?!`+t+`)`,`$`),e.COMMENT(`--`+t,n,{contains:[r],relevance:10})];return{name:`Lua`,aliases:[`pluto`],keywords:{$pattern:e.UNDERSCORE_IDENT_RE,literal:`true false nil`,keyword:`and break do else elseif end for goto if in local not or repeat return then until while`,built_in:`_G _ENV _VERSION __index __newindex __mode __call __metatable __tostring __len __gc __add __sub __mul __div __mod __pow __concat __unm __eq __lt __le assert collectgarbage dofile error getfenv getmetatable ipairs load loadfile loadstring module next pairs pcall print rawequal rawget rawset require select setfenv setmetatable tonumber tostring type unpack xpcall arg self coroutine resume yield status wrap create running debug getupvalue debug sethook getmetatable gethook setmetatable setlocal traceback setfenv getinfo setupvalue getlocal getregistry getfenv io lines write close flush open output type read stderr stdin input stdout popen tmpfile math log max acos huge ldexp pi cos tanh pow deg tan cosh sinh random randomseed frexp ceil floor rad abs sqrt modf asin min mod fmod log10 atan2 exp sin atan os exit setlocale date getenv difftime remove time clock tmpname rename execute package preload loadlib loaded loaders cpath config path seeall string sub upper len gfind rep find match char dump gmatch reverse byte format gsub lower table setn insert getn foreachi maxn foreach concat sort remove`},contains:i.concat([{className:`function`,beginKeywords:`function`,end:`\\)`,contains:[e.inherit(e.TITLE_MODE,{begin:`([_a-zA-Z]\\w*\\.)*([_a-zA-Z]\\w*:)?[_a-zA-Z]\\w*`}),{className:`params`,begin:`\\(`,endsWithParent:!0,contains:i}].concat(i)},e.C_NUMBER_MODE,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,{className:`string`,begin:t,end:n,contains:[r],relevance:5}])}}function gy(e){let t={className:`variable`,variants:[{begin:`\\$\\(`+e.UNDERSCORE_IDENT_RE+`\\)`,contains:[e.BACKSLASH_ESCAPE]},{begin:/\$[@%<?\^\+\*]/}]},n={className:`string`,begin:/"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,t]},r={className:`variable`,begin:/\$\([\w-]+\s/,end:/\)/,keywords:{built_in:`subst patsubst strip findstring filter filter-out sort word wordlist firstword lastword dir notdir suffix basename addsuffix addprefix join wildcard realpath abspath error warning shell origin flavor foreach if or and call eval file value`},contains:[t,n]},i={begin:`^`+e.UNDERSCORE_IDENT_RE+`\\s*(?=[:+?]?=)`},a={className:`meta`,begin:/^\.PHONY:/,end:/$/,keywords:{$pattern:/[\.\w]+/,keyword:`.PHONY`}},o={className:`section`,begin:/^[^\s]+:/,end:/$/,contains:[t]};return{name:`Makefile`,aliases:[`mk`,`mak`,`make`],keywords:{$pattern:/[\w-]+/,keyword:`define endef undefine ifdef ifndef ifeq ifneq else endif include -include sinclude override export unexport private vpath`},contains:[e.HASH_COMMENT_MODE,t,n,r,i,a,o]}}function _y(e){let t=e.regex,n={begin:/<\/?[A-Za-z_]/,end:`>`,subLanguage:`xml`,relevance:0},r={begin:`^[-\\*]{3,}`,end:`$`},i={className:`code`,variants:[{begin:"(`{3,})[^`](.|\\n)*?\\1`*[ ]*"},{begin:`(~{3,})[^~](.|\\n)*?\\1~*[ ]*`},{begin:"```",end:"```+[ ]*$"},{begin:`~~~`,end:`~~~+[ ]*$`},{begin:"`.+?`"},{begin:`(?=^( {4}|\\t))`,contains:[{begin:`^( {4}|\\t)`,end:`(\\n)$`}],relevance:0}]},a={className:`bullet`,begin:`^[ ]*([*+-]|(\\d+\\.))(?=\\s+)`,end:`\\s+`,excludeEnd:!0},o={begin:/^\[[^\n]+\]:/,returnBegin:!0,contains:[{className:`symbol`,begin:/\[/,end:/\]/,excludeBegin:!0,excludeEnd:!0},{className:`link`,begin:/:\s*/,end:/$/,excludeBegin:!0}]},s={variants:[{begin:/\[.+?\]\[.*?\]/,relevance:0},{begin:/\[.+?\]\(((data|javascript|mailto):|(?:http|ftp)s?:\/\/).*?\)/,relevance:2},{begin:t.concat(/\[.+?\]\(/,/[A-Za-z][A-Za-z0-9+.-]*/,/:\/\/.*?\)/),relevance:2},{begin:/\[.+?\]\([./?&#].*?\)/,relevance:1},{begin:/\[.*?\]\(.*?\)/,relevance:0}],returnBegin:!0,contains:[{match:/\[(?=\])/},{className:`string`,relevance:0,begin:`\\[`,end:`\\]`,excludeBegin:!0,returnEnd:!0},{className:`link`,relevance:0,begin:`\\]\\(`,end:`\\)`,excludeBegin:!0,excludeEnd:!0},{className:`symbol`,relevance:0,begin:`\\]\\[`,end:`\\]`,excludeBegin:!0,excludeEnd:!0}]},c={className:`strong`,contains:[],variants:[{begin:/_{2}(?!\s)/,end:/_{2}/},{begin:/\*{2}(?!\s)/,end:/\*{2}/}]},l={className:`emphasis`,contains:[],variants:[{begin:/\*(?![*\s])/,end:/\*/},{begin:/_(?![_\s])/,end:/_/,relevance:0}]},u=e.inherit(c,{contains:[]}),d=e.inherit(l,{contains:[]});c.contains.push(d),l.contains.push(u);let f=[n,s];return[c,l,u,d].forEach(e=>{e.contains=e.contains.concat(f)}),f=f.concat(c,l),{name:`Markdown`,aliases:[`md`,`mkdown`,`mkd`],contains:[{className:`section`,variants:[{begin:`^#{1,6}`,end:`$`,contains:f},{begin:`(?=^.+?\\n[=-]{2,}$)`,contains:[{begin:`^[=-]*$`},{begin:`^`,end:`\\n`,contains:f}]}]},n,a,c,l,{className:`quote`,begin:`^>\\s+`,contains:f,end:`$`},i,r,s,o,{scope:`literal`,match:/&([a-zA-Z0-9]+|#[0-9]{1,7}|#[Xx][0-9a-fA-F]{1,6});/}]}}function vy(e){let t={className:`built_in`,begin:`\\b(AV|CA|CF|CG|CI|CL|CM|CN|CT|MK|MP|MTK|MTL|NS|SCN|SK|UI|WK|XC)\\w+`},n=/[a-zA-Z@][a-zA-Z0-9_]*/,r={"variable.language":[`this`,`super`],$pattern:n,keyword:`while.export.sizeof.typedef.const.struct.for.union.volatile.static.mutable.if.do.return.goto.enum.else.break.extern.asm.case.default.register.explicit.typename.switch.continue.inline.readonly.assign.readwrite.self.@synchronized.id.typeof.nonatomic.IBOutlet.IBAction.strong.weak.copy.in.out.inout.bycopy.byref.oneway.__strong.__weak.__block.__autoreleasing.@private.@protected.@public.@try.@property.@end.@throw.@catch.@finally.@autoreleasepool.@synthesize.@dynamic.@selector.@optional.@required.@encode.@package.@import.@defs.@compatibility_alias.__bridge.__bridge_transfer.__bridge_retained.__bridge_retain.__covariant.__contravariant.__kindof._Nonnull._Nullable._Null_unspecified.__FUNCTION__.__PRETTY_FUNCTION__.__attribute__.getter.setter.retain.unsafe_unretained.nonnull.nullable.null_unspecified.null_resettable.class.instancetype.NS_DESIGNATED_INITIALIZER.NS_UNAVAILABLE.NS_REQUIRES_SUPER.NS_RETURNS_INNER_POINTER.NS_INLINE.NS_AVAILABLE.NS_DEPRECATED.NS_ENUM.NS_OPTIONS.NS_SWIFT_UNAVAILABLE.NS_ASSUME_NONNULL_BEGIN.NS_ASSUME_NONNULL_END.NS_REFINED_FOR_SWIFT.NS_SWIFT_NAME.NS_SWIFT_NOTHROW.NS_DURING.NS_HANDLER.NS_ENDHANDLER.NS_VALUERETURN.NS_VOIDRETURN`.split(`.`),literal:[`false`,`true`,`FALSE`,`TRUE`,`nil`,`YES`,`NO`,`NULL`],built_in:[`dispatch_once_t`,`dispatch_queue_t`,`dispatch_sync`,`dispatch_async`,`dispatch_once`],type:[`int`,`float`,`char`,`unsigned`,`signed`,`short`,`long`,`double`,`wchar_t`,`unichar`,`void`,`bool`,`BOOL`,`id|0`,`_Bool`]},i={$pattern:n,keyword:[`@interface`,`@class`,`@protocol`,`@implementation`]};return{name:`Objective-C`,aliases:[`mm`,`objc`,`obj-c`,`obj-c++`,`objective-c++`],keywords:r,illegal:`</`,contains:[t,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,e.C_NUMBER_MODE,e.QUOTE_STRING_MODE,e.APOS_STRING_MODE,{className:`string`,variants:[{begin:`@"`,end:`"`,illegal:`\\n`,contains:[e.BACKSLASH_ESCAPE]}]},{className:`meta`,begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:`if else elif endif define undef warning error line pragma ifdef ifndef include`},contains:[{begin:/\\\n/,relevance:0},e.inherit(e.QUOTE_STRING_MODE,{className:`string`}),{className:`string`,begin:/<.*?>/,end:/$/,illegal:`\\n`},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{className:`class`,begin:`(`+i.keyword.join(`|`)+`)\\b`,end:/(\{|$)/,excludeEnd:!0,keywords:i,contains:[e.UNDERSCORE_TITLE_MODE]},{begin:`\\.`+e.UNDERSCORE_IDENT_RE,relevance:0}]}}function yy(e){let t=e.regex,n=`abs.accept.alarm.and.atan2.bind.binmode.bless.break.caller.chdir.chmod.chomp.chop.chown.chr.chroot.class.close.closedir.connect.continue.cos.crypt.dbmclose.dbmopen.defined.delete.die.do.dump.each.else.elsif.endgrent.endhostent.endnetent.endprotoent.endpwent.endservent.eof.eval.exec.exists.exit.exp.fcntl.field.fileno.flock.for.foreach.fork.format.formline.getc.getgrent.getgrgid.getgrnam.gethostbyaddr.gethostbyname.gethostent.getlogin.getnetbyaddr.getnetbyname.getnetent.getpeername.getpgrp.getpriority.getprotobyname.getprotobynumber.getprotoent.getpwent.getpwnam.getpwuid.getservbyname.getservbyport.getservent.getsockname.getsockopt.given.glob.gmtime.goto.grep.gt.hex.if.index.int.ioctl.join.keys.kill.last.lc.lcfirst.length.link.listen.local.localtime.log.lstat.lt.ma.map.method.mkdir.msgctl.msgget.msgrcv.msgsnd.my.ne.next.no.not.oct.open.opendir.or.ord.our.pack.package.pipe.pop.pos.print.printf.prototype.push.q|0.qq.quotemeta.qw.qx.rand.read.readdir.readline.readlink.readpipe.recv.redo.ref.rename.require.reset.return.reverse.rewinddir.rindex.rmdir.say.scalar.seek.seekdir.select.semctl.semget.semop.send.setgrent.sethostent.setnetent.setpgrp.setpriority.setprotoent.setpwent.setservent.setsockopt.shift.shmctl.shmget.shmread.shmwrite.shutdown.sin.sleep.socket.socketpair.sort.splice.split.sprintf.sqrt.srand.stat.state.study.sub.substr.symlink.syscall.sysopen.sysread.sysseek.system.syswrite.tell.telldir.tie.tied.time.times.tr.truncate.uc.ucfirst.umask.undef.unless.unlink.unpack.unshift.untie.until.use.utime.values.vec.wait.waitpid.wantarray.warn.when.while.write.x|0.xor.y|0`.split(`.`),r=/[dualxmsipngr]{0,12}/,i={$pattern:/[\w.]+/,keyword:n.join(` `)},a={className:`subst`,begin:`[$@]\\{`,end:`\\}`,keywords:i},o={begin:/->\{/,end:/\}/},s={scope:`attr`,match:/\s+:\s*\w+(\s*\(.*?\))?/},c={scope:`variable`,variants:[{begin:/\$\d/},{begin:t.concat(/[$%@](?!")(\^\w\b|#\w+(::\w+)*|\{\w+\}|\w+(::\w*)*)/,`(?![A-Za-z])(?![@$%])`)},{begin:/[$%@](?!")[^\s\w{=]|\$=/,relevance:0}],contains:[s]},l={className:`number`,variants:[{match:/0?\.[0-9][0-9_]+\b/},{match:/\bv?(0|[1-9][0-9_]*(\.[0-9_]+)?|[1-9][0-9_]*)\b/},{match:/\b0[0-7][0-7_]*\b/},{match:/\b0x[0-9a-fA-F][0-9a-fA-F_]*\b/},{match:/\b0b[0-1][0-1_]*\b/}],relevance:0},u=[e.BACKSLASH_ESCAPE,a,c],d=[/!/,/\//,/\|/,/\?/,/'/,/"/,/#/],f=(e,n,i=`\\1`)=>{let a=i===`\\1`?i:t.concat(i,n);return t.concat(t.concat(`(?:`,e,`)`),n,/(?:\\.|[^\\\/])*?/,a,/(?:\\.|[^\\\/])*?/,i,r)},p=(e,n,i)=>t.concat(t.concat(`(?:`,e,`)`),n,/(?:\\.|[^\\\/])*?/,i,r),m=[c,e.HASH_COMMENT_MODE,e.COMMENT(/^=\w/,/=cut/,{endsWithParent:!0}),o,{className:`string`,contains:u,variants:[{begin:`q[qwxr]?\\s*\\(`,end:`\\)`,relevance:5},{begin:`q[qwxr]?\\s*\\[`,end:`\\]`,relevance:5},{begin:`q[qwxr]?\\s*\\{`,end:`\\}`,relevance:5},{begin:`q[qwxr]?\\s*\\|`,end:`\\|`,relevance:5},{begin:`q[qwxr]?\\s*<`,end:`>`,relevance:5},{begin:`qw\\s+q`,end:`q`,relevance:5},{begin:`'`,end:`'`,contains:[e.BACKSLASH_ESCAPE]},{begin:`"`,end:`"`},{begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE]},{begin:/\{\w+\}/,relevance:0},{begin:`-?\\w+\\s*=>`,relevance:0}]},l,{begin:`(\\/\\/|`+e.RE_STARTERS_RE+`|\\b(split|return|print|reverse|grep)\\b)\\s*`,keywords:`split return print reverse grep`,relevance:0,contains:[e.HASH_COMMENT_MODE,{className:`regexp`,variants:[{begin:f(`s|tr|y`,t.either(...d,{capture:!0}))},{begin:f(`s|tr|y`,`\\(`,`\\)`)},{begin:f(`s|tr|y`,`\\[`,`\\]`)},{begin:f(`s|tr|y`,`\\{`,`\\}`)}],relevance:2},{className:`regexp`,variants:[{begin:/(m|qr)\/\//,relevance:0},{begin:p(`(?:m|qr)?`,/\//,/\//)},{begin:p(`m|qr`,t.either(...d,{capture:!0}),/\1/)},{begin:p(`m|qr`,/\(/,/\)/)},{begin:p(`m|qr`,/\[/,/\]/)},{begin:p(`m|qr`,/\{/,/\}/)}]}]},{className:`function`,beginKeywords:`sub method`,end:`(\\s*\\(.*?\\))?[;{]`,excludeEnd:!0,relevance:5,contains:[e.TITLE_MODE,s]},{className:`class`,beginKeywords:`class`,end:`[;{]`,excludeEnd:!0,relevance:5,contains:[e.TITLE_MODE,s,l]},{begin:`-\\w\\b`,relevance:0},{begin:`^__DATA__$`,end:`^__END__$`,subLanguage:`mojolicious`,contains:[{begin:`^@@.*`,end:`$`,className:`comment`}]}];return a.contains=m,o.contains=m,{name:`Perl`,aliases:[`pl`,`pm`],keywords:i,contains:m}}function by(e){let t=e.regex,n=/(?![A-Za-z0-9])(?![$])/,r=t.concat(/[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*/,n),i=t.concat(/(\\?[A-Z][a-z0-9_\x7f-\xff]+|\\?[A-Z]+(?=[A-Z][a-z0-9_\x7f-\xff])){1,}/,n),a=t.concat(/[A-Z]+/,n),o={scope:`variable`,match:`\\$+`+r},s={scope:`meta`,variants:[{begin:/<\?php/,relevance:10},{begin:/<\?=/},{begin:/<\?/,relevance:.1},{begin:/\?>/}]},c={scope:`subst`,variants:[{begin:/\$\w+/},{begin:/\{\$/,end:/\}/}]},l=e.inherit(e.APOS_STRING_MODE,{illegal:null}),u=e.inherit(e.QUOTE_STRING_MODE,{illegal:null,contains:e.QUOTE_STRING_MODE.contains.concat(c)}),d={begin:/<<<[ \t]*(?:(\w+)|"(\w+)")\n/,end:/[ \t]*(\w+)\b/,contains:e.QUOTE_STRING_MODE.contains.concat(c),"on:begin":(e,t)=>{t.data._beginMatch=e[1]||e[2]},"on:end":(e,t)=>{t.data._beginMatch!==e[1]&&t.ignoreMatch()}},f=e.END_SAME_AS_BEGIN({begin:/<<<[ \t]*'(\w+)'\n/,end:/[ \t]*(\w+)\b/}),p=`[
|
|
8
8
|
]`,m={scope:`string`,variants:[u,l,d,f]},h={scope:`number`,variants:[{begin:`\\b0[bB][01]+(?:_[01]+)*\\b`},{begin:`\\b0[oO][0-7]+(?:_[0-7]+)*\\b`},{begin:`\\b0[xX][\\da-fA-F]+(?:_[\\da-fA-F]+)*\\b`},{begin:`(?:\\b\\d+(?:_\\d+)*(\\.(?:\\d+(?:_\\d+)*))?|\\B\\.\\d+)(?:[eE][+-]?\\d+)?`}],relevance:0},g=[`false`,`null`,`true`],_=`__CLASS__.__DIR__.__FILE__.__FUNCTION__.__COMPILER_HALT_OFFSET__.__LINE__.__METHOD__.__NAMESPACE__.__TRAIT__.die.echo.exit.include.include_once.print.require.require_once.array.abstract.and.as.binary.bool.boolean.break.callable.case.catch.class.clone.const.continue.declare.default.do.double.else.elseif.empty.enddeclare.endfor.endforeach.endif.endswitch.endwhile.enum.eval.extends.final.finally.float.for.foreach.from.global.goto.if.implements.instanceof.insteadof.int.integer.interface.isset.iterable.list.match|0.mixed.new.never.object.or.private.protected.public.readonly.real.return.string.switch.throw.trait.try.unset.use.var.void.while.xor.yield`.split(`.`),v=`Error|0.AppendIterator.ArgumentCountError.ArithmeticError.ArrayIterator.ArrayObject.AssertionError.BadFunctionCallException.BadMethodCallException.CachingIterator.CallbackFilterIterator.CompileError.Countable.DirectoryIterator.DivisionByZeroError.DomainException.EmptyIterator.ErrorException.Exception.FilesystemIterator.FilterIterator.GlobIterator.InfiniteIterator.InvalidArgumentException.IteratorIterator.LengthException.LimitIterator.LogicException.MultipleIterator.NoRewindIterator.OutOfBoundsException.OutOfRangeException.OuterIterator.OverflowException.ParentIterator.ParseError.RangeException.RecursiveArrayIterator.RecursiveCachingIterator.RecursiveCallbackFilterIterator.RecursiveDirectoryIterator.RecursiveFilterIterator.RecursiveIterator.RecursiveIteratorIterator.RecursiveRegexIterator.RecursiveTreeIterator.RegexIterator.RuntimeException.SeekableIterator.SplDoublyLinkedList.SplFileInfo.SplFileObject.SplFixedArray.SplHeap.SplMaxHeap.SplMinHeap.SplObjectStorage.SplObserver.SplPriorityQueue.SplQueue.SplStack.SplSubject.SplTempFileObject.TypeError.UnderflowException.UnexpectedValueException.UnhandledMatchError.ArrayAccess.BackedEnum.Closure.Fiber.Generator.Iterator.IteratorAggregate.Serializable.Stringable.Throwable.Traversable.UnitEnum.WeakReference.WeakMap.Directory.__PHP_Incomplete_Class.parent.php_user_filter.self.static.stdClass`.split(`.`),y={keyword:_,literal:(e=>{let t=[];return e.forEach(e=>{t.push(e),e.toLowerCase()===e?t.push(e.toUpperCase()):t.push(e.toLowerCase())}),t})(g),built_in:v},b=e=>e.map(e=>e.replace(/\|\d+$/,``)),x={variants:[{match:[/new/,t.concat(p,`+`),t.concat(`(?!`,b(v).join(`\\b|`),`\\b)`),i],scope:{1:`keyword`,4:`title.class`}}]},S=t.concat(r,`\\b(?!\\()`),C={variants:[{match:[t.concat(/::/,t.lookahead(/(?!class\b)/)),S],scope:{2:`variable.constant`}},{match:[/::/,/class/],scope:{2:`variable.language`}},{match:[i,t.concat(/::/,t.lookahead(/(?!class\b)/)),S],scope:{1:`title.class`,3:`variable.constant`}},{match:[i,t.concat(`::`,t.lookahead(/(?!class\b)/))],scope:{1:`title.class`}},{match:[i,/::/,/class/],scope:{1:`title.class`,3:`variable.language`}}]},w={scope:`attr`,match:t.concat(r,t.lookahead(`:`),t.lookahead(/(?!::)/))},T={relevance:0,begin:/\(/,end:/\)/,keywords:y,contains:[w,o,C,e.C_BLOCK_COMMENT_MODE,m,h,x]},E={relevance:0,match:[/\b/,t.concat(`(?!fn\\b|function\\b|`,b(_).join(`\\b|`),`|`,b(v).join(`\\b|`),`\\b)`),r,t.concat(p,`*`),t.lookahead(/(?=\()/)],scope:{3:`title.function.invoke`},contains:[T]};T.contains.push(E);let D=[w,C,e.C_BLOCK_COMMENT_MODE,m,h,x],O={begin:t.concat(/#\[\s*\\?/,t.either(i,a)),beginScope:`meta`,end:/]/,endScope:`meta`,keywords:{literal:g,keyword:[`new`,`array`]},contains:[{begin:/\[/,end:/]/,keywords:{literal:g,keyword:[`new`,`array`]},contains:[`self`,...D]},...D,{scope:`meta`,variants:[{match:i},{match:a}]}]};return{case_insensitive:!1,keywords:y,contains:[O,e.HASH_COMMENT_MODE,e.COMMENT(`//`,`$`),e.COMMENT(`/\\*`,`\\*/`,{contains:[{scope:`doctag`,match:`@[A-Za-z]+`}]}),{match:/__halt_compiler\(\);/,keywords:`__halt_compiler`,starts:{scope:`comment`,end:e.MATCH_NOTHING_RE,contains:[{match:/\?>/,scope:`meta`,endsParent:!0}]}},s,{scope:`variable.language`,match:/\$this\b/},o,E,C,{match:[/const/,/\s/,r],scope:{1:`keyword`,3:`variable.constant`}},x,{scope:`function`,relevance:0,beginKeywords:`fn function`,end:/[;{]/,excludeEnd:!0,illegal:`[$%\\[]`,contains:[{beginKeywords:`use`},e.UNDERSCORE_TITLE_MODE,{begin:`=>`,endsParent:!0},{scope:`params`,begin:`\\(`,end:`\\)`,excludeBegin:!0,excludeEnd:!0,keywords:y,contains:[`self`,O,o,C,e.C_BLOCK_COMMENT_MODE,m,h]}]},{scope:`class`,variants:[{beginKeywords:`enum`,illegal:/[($"]/},{beginKeywords:`class interface trait`,illegal:/[:($"]/}],relevance:0,end:/\{/,excludeEnd:!0,contains:[{beginKeywords:`extends implements`},e.UNDERSCORE_TITLE_MODE]},{beginKeywords:`namespace`,relevance:0,end:`;`,illegal:/[.']/,contains:[e.inherit(e.UNDERSCORE_TITLE_MODE,{scope:`title.class`})]},{beginKeywords:`use`,relevance:0,end:`;`,contains:[{match:/\b(as|const|function)\b/,scope:`keyword`},e.UNDERSCORE_TITLE_MODE]},m,h]}}function xy(e){return{name:`PHP template`,subLanguage:`xml`,contains:[{begin:/<\?(php|=)?/,end:/\?>/,subLanguage:`php`,contains:[{begin:`/\\*`,end:`\\*/`,skip:!0},{begin:`b"`,end:`"`,skip:!0},{begin:`b'`,end:`'`,skip:!0},e.inherit(e.APOS_STRING_MODE,{illegal:null,className:null,contains:null,skip:!0}),e.inherit(e.QUOTE_STRING_MODE,{illegal:null,className:null,contains:null,skip:!0})]}]}}function Sy(e){return{name:`Plain text`,aliases:[`text`,`txt`],disableAutodetect:!0}}function Cy(e){let t=e.regex,n=/[\p{XID_Start}_]\p{XID_Continue}*/u,r=`and.as.assert.async.await.break.case.class.continue.def.del.elif.else.except.finally.for.from.global.if.import.in.is.lambda.match.nonlocal|10.not.or.pass.raise.return.try.while.with.yield`.split(`.`),i={$pattern:/[A-Za-z]\w+|__\w+__/,keyword:r,built_in:`__import__.abs.all.any.ascii.bin.bool.breakpoint.bytearray.bytes.callable.chr.classmethod.compile.complex.delattr.dict.dir.divmod.enumerate.eval.exec.filter.float.format.frozenset.getattr.globals.hasattr.hash.help.hex.id.input.int.isinstance.issubclass.iter.len.list.locals.map.max.memoryview.min.next.object.oct.open.ord.pow.print.property.range.repr.reversed.round.set.setattr.slice.sorted.staticmethod.str.sum.super.tuple.type.vars.zip`.split(`.`),literal:[`__debug__`,`Ellipsis`,`False`,`None`,`NotImplemented`,`True`],type:[`Any`,`Callable`,`Coroutine`,`Dict`,`List`,`Literal`,`Generic`,`Optional`,`Sequence`,`Set`,`Tuple`,`Type`,`Union`]},a={className:`meta`,begin:/^(>>>|\.\.\.) /},o={className:`subst`,begin:/\{/,end:/\}/,keywords:i,illegal:/#/},s={begin:/\{\{/,relevance:0},c={className:`string`,contains:[e.BACKSLASH_ESCAPE],variants:[{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?'''/,end:/'''/,contains:[e.BACKSLASH_ESCAPE,a],relevance:10},{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?"""/,end:/"""/,contains:[e.BACKSLASH_ESCAPE,a],relevance:10},{begin:/([fF][rR]|[rR][fF]|[fF])'''/,end:/'''/,contains:[e.BACKSLASH_ESCAPE,a,s,o]},{begin:/([fF][rR]|[rR][fF]|[fF])"""/,end:/"""/,contains:[e.BACKSLASH_ESCAPE,a,s,o]},{begin:/([uU]|[rR])'/,end:/'/,relevance:10},{begin:/([uU]|[rR])"/,end:/"/,relevance:10},{begin:/([bB]|[bB][rR]|[rR][bB])'/,end:/'/},{begin:/([bB]|[bB][rR]|[rR][bB])"/,end:/"/},{begin:/([fF][rR]|[rR][fF]|[fF])'/,end:/'/,contains:[e.BACKSLASH_ESCAPE,s,o]},{begin:/([fF][rR]|[rR][fF]|[fF])"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,s,o]},e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},l=`[0-9](_?[0-9])*`,u=`(\\b(${l}))?\\.(${l})|\\b(${l})\\.`,d=`\\b|${r.join(`|`)}`,f={className:`number`,relevance:0,variants:[{begin:`(\\b(${l})|(${u}))[eE][+-]?(${l})[jJ]?(?=${d})`},{begin:`(${u})[jJ]?`},{begin:`\\b([1-9](_?[0-9])*|0+(_?0)*)[lLjJ]?(?=${d})`},{begin:`\\b0[bB](_?[01])+[lL]?(?=${d})`},{begin:`\\b0[oO](_?[0-7])+[lL]?(?=${d})`},{begin:`\\b0[xX](_?[0-9a-fA-F])+[lL]?(?=${d})`},{begin:`\\b(${l})[jJ](?=${d})`}]},p={className:`comment`,begin:t.lookahead(/# type:/),end:/$/,keywords:i,contains:[{begin:/# type:/},{begin:/#/,end:/\b\B/,endsWithParent:!0}]},m={className:`params`,variants:[{className:``,begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:i,contains:[`self`,a,f,c,e.HASH_COMMENT_MODE]}]};return o.contains=[c,f,a],{name:`Python`,aliases:[`py`,`gyp`,`ipython`],unicodeRegex:!0,keywords:i,illegal:/(<\/|\?)|=>/,contains:[a,f,{scope:`variable.language`,match:/\bself\b/},{beginKeywords:`if`,relevance:0},{match:/\bor\b/,scope:`keyword`},c,p,e.HASH_COMMENT_MODE,{match:[/\bdef/,/\s+/,n],scope:{1:`keyword`,3:`title.function`},contains:[m]},{variants:[{match:[/\bclass/,/\s+/,n,/\s*/,/\(\s*/,n,/\s*\)/]},{match:[/\bclass/,/\s+/,n]}],scope:{1:`keyword`,3:`title.class`,6:`title.class.inherited`}},{className:`meta`,begin:/^[\t ]*@/,end:/(?=#)|$/,contains:[f,m,c]}]}}function wy(e){return{aliases:[`pycon`],contains:[{className:`meta.prompt`,starts:{end:/ |$/,starts:{end:`$`,subLanguage:`python`}},variants:[{begin:/^>>>(?=[ ]|$)/},{begin:/^\.\.\.(?=[ ]|$)/}]}]}}function Ty(e){let t=e.regex,n=/(?:(?:[a-zA-Z]|\.[._a-zA-Z])[._a-zA-Z0-9]*)|\.(?!\d)/,r=t.either(/0[xX][0-9a-fA-F]+\.[0-9a-fA-F]*[pP][+-]?\d+i?/,/0[xX][0-9a-fA-F]+(?:[pP][+-]?\d+)?[Li]?/,/(?:\d+(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+)?[Li]?/),i=/[=!<>:]=|\|\||&&|:::?|<-|<<-|->>|->|\|>|[-+*\/?!$&|:<=>@^~]|\*\*/,a=t.either(/[()]/,/[{}]/,/\[\[/,/[[\]]/,/\\/,/,/);return{name:`R`,keywords:{$pattern:n,keyword:`function if in break next repeat else for while`,literal:`NULL NA TRUE FALSE Inf NaN NA_integer_|10 NA_real_|10 NA_character_|10 NA_complex_|10`,built_in:`LETTERS letters month.abb month.name pi T F abs acos acosh all any anyNA Arg as.call as.character as.complex as.double as.environment as.integer as.logical as.null.default as.numeric as.raw asin asinh atan atanh attr attributes baseenv browser c call ceiling class Conj cos cosh cospi cummax cummin cumprod cumsum digamma dim dimnames emptyenv exp expression floor forceAndCall gamma gc.time globalenv Im interactive invisible is.array is.atomic is.call is.character is.complex is.double is.environment is.expression is.finite is.function is.infinite is.integer is.language is.list is.logical is.matrix is.na is.name is.nan is.null is.numeric is.object is.pairlist is.raw is.recursive is.single is.symbol lazyLoadDBfetch length lgamma list log max min missing Mod names nargs nzchar oldClass on.exit pos.to.env proc.time prod quote range Re rep retracemem return round seq_along seq_len seq.int sign signif sin sinh sinpi sqrt standardGeneric substitute sum switch tan tanh tanpi tracemem trigamma trunc unclass untracemem UseMethod xtfrm`},contains:[e.COMMENT(/#'/,/$/,{contains:[{scope:`doctag`,match:/@examples/,starts:{end:t.lookahead(t.either(/\n^#'\s*(?=@[a-zA-Z]+)/,/\n^(?!#')/)),endsParent:!0}},{scope:`doctag`,begin:`@param`,end:/$/,contains:[{scope:`variable`,variants:[{match:n},{match:/`(?:\\.|[^`\\])+`/}],endsParent:!0}]},{scope:`doctag`,match:/@[a-zA-Z]+/},{scope:`keyword`,match:/\\[a-zA-Z]+/}]}),e.HASH_COMMENT_MODE,{scope:`string`,contains:[e.BACKSLASH_ESCAPE],variants:[e.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\(/,end:/\)(-*)"/}),e.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\{/,end:/\}(-*)"/}),e.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\[/,end:/\](-*)"/}),e.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\(/,end:/\)(-*)'/}),e.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\{/,end:/\}(-*)'/}),e.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\[/,end:/\](-*)'/}),{begin:`"`,end:`"`,relevance:0},{begin:`'`,end:`'`,relevance:0}]},{relevance:0,variants:[{scope:{1:`operator`,2:`number`},match:[i,r]},{scope:{1:`operator`,2:`number`},match:[/%[^%]*%/,r]},{scope:{1:`punctuation`,2:`number`},match:[a,r]},{scope:{2:`number`},match:[/[^a-zA-Z0-9._]|^/,r]}]},{scope:{3:`operator`},match:[n,/\s+/,/<-/,/\s+/]},{scope:`operator`,relevance:0,variants:[{match:i},{match:/%[^%]*%/}]},{scope:`punctuation`,relevance:0,match:a},{begin:"`",end:"`",contains:[{begin:/\\./}]}]}}function Ey(e){let t=e.regex,n="([a-zA-Z_]\\w*[!?=]?|[-+~]@|<<|>>|=~|===?|<=>|[<>]=?|\\*\\*|[-/+%^&*~`|]|\\[\\]=?)",r=t.either(/\b([A-Z]+[a-z0-9]+)+/,/\b([A-Z]+[a-z0-9]+)+[A-Z]+/),i=t.concat(r,/(::\w+)*/),a={"variable.constant":[`__FILE__`,`__LINE__`,`__ENCODING__`],"variable.language":[`self`,`super`],keyword:[`alias`,`and`,`begin`,`BEGIN`,`break`,`case`,`class`,`defined`,`do`,`else`,`elsif`,`end`,`END`,`ensure`,`for`,`if`,`in`,`module`,`next`,`not`,`or`,`redo`,`require`,`rescue`,`retry`,`return`,`then`,`undef`,`unless`,`until`,`when`,`while`,`yield`,...[`include`,`extend`,`prepend`,`public`,`private`,`protected`,`raise`,`throw`]],built_in:[`proc`,`lambda`,`attr_accessor`,`attr_reader`,`attr_writer`,`define_method`,`private_constant`,`module_function`],literal:[`true`,`false`,`nil`]},o={className:`doctag`,begin:`@[A-Za-z]+`},s={begin:`#<`,end:`>`},c=[e.COMMENT(`#`,`$`,{contains:[o]}),e.COMMENT(`^=begin`,`^=end`,{contains:[o],relevance:10}),e.COMMENT(`^__END__`,e.MATCH_NOTHING_RE)],l={className:`subst`,begin:/#\{/,end:/\}/,keywords:a},u={className:`string`,contains:[e.BACKSLASH_ESCAPE,l],variants:[{begin:/'/,end:/'/},{begin:/"/,end:/"/},{begin:/`/,end:/`/},{begin:/%[qQwWx]?\(/,end:/\)/},{begin:/%[qQwWx]?\[/,end:/\]/},{begin:/%[qQwWx]?\{/,end:/\}/},{begin:/%[qQwWx]?</,end:/>/},{begin:/%[qQwWx]?\//,end:/\//},{begin:/%[qQwWx]?%/,end:/%/},{begin:/%[qQwWx]?-/,end:/-/},{begin:/%[qQwWx]?\|/,end:/\|/},{begin:/\B\?(\\\d{1,3})/},{begin:/\B\?(\\x[A-Fa-f0-9]{1,2})/},{begin:/\B\?(\\u\{?[A-Fa-f0-9]{1,6}\}?)/},{begin:/\B\?(\\M-\\C-|\\M-\\c|\\c\\M-|\\M-|\\C-\\M-)[\x20-\x7e]/},{begin:/\B\?\\(c|C-)[\x20-\x7e]/},{begin:/\B\?\\?\S/},{begin:t.concat(/<<[-~]?'?/,t.lookahead(/(\w+)(?=\W)[^\n]*\n(?:[^\n]*\n)*?\s*\1\b/)),contains:[e.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,contains:[e.BACKSLASH_ESCAPE,l]})]}]},d=`[0-9](_?[0-9])*`,f={className:`number`,relevance:0,variants:[{begin:`\\b([1-9](_?[0-9])*|0)(\\.(${d}))?([eE][+-]?(${d})|r)?i?\\b`},{begin:`\\b0[dD][0-9](_?[0-9])*r?i?\\b`},{begin:`\\b0[bB][0-1](_?[0-1])*r?i?\\b`},{begin:`\\b0[oO][0-7](_?[0-7])*r?i?\\b`},{begin:`\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*r?i?\\b`},{begin:`\\b0(_?[0-7])+r?i?\\b`}]},p={variants:[{match:/\(\)/},{className:`params`,begin:/\(/,end:/(?=\))/,excludeBegin:!0,endsParent:!0,keywords:a}]},m=[u,{variants:[{match:[/class\s+/,i,/\s+<\s+/,i]},{match:[/\b(class|module)\s+/,i]}],scope:{2:`title.class`,4:`title.class.inherited`},keywords:a},{match:[/(include|extend)\s+/,i],scope:{2:`title.class`},keywords:a},{relevance:0,match:[i,/\.new[. (]/],scope:{1:`title.class`}},{relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:`variable.constant`},{relevance:0,match:r,scope:`title.class`},{match:[/def/,/\s+/,n],scope:{1:`keyword`,3:`title.function`},contains:[p]},{begin:e.IDENT_RE+`::`},{className:`symbol`,begin:e.UNDERSCORE_IDENT_RE+`(!|\\?)?:`,relevance:0},{className:`symbol`,begin:`:(?!\\s)`,contains:[u,{begin:n}],relevance:0},f,{className:`variable`,begin:`(\\$\\W)|((\\$|@@?)(\\w+))(?=[^@$?])(?![A-Za-z])(?![@$?'])`},{className:`params`,begin:/\|(?!=)/,end:/\|/,excludeBegin:!0,excludeEnd:!0,relevance:0,keywords:a},{begin:`(`+e.RE_STARTERS_RE+`|unless)\\s*`,keywords:`unless`,contains:[{className:`regexp`,contains:[e.BACKSLASH_ESCAPE,l],illegal:/\n/,variants:[{begin:`/`,end:`/[a-z]*`},{begin:/%r\{/,end:/\}[a-z]*/},{begin:`%r\\(`,end:`\\)[a-z]*`},{begin:`%r!`,end:`![a-z]*`},{begin:`%r\\[`,end:`\\][a-z]*`}]}].concat(s,c),relevance:0}].concat(s,c);l.contains=m,p.contains=m;let h=[{begin:/^\s*=>/,starts:{end:`$`,contains:m}},{className:`meta.prompt`,begin:`^([>?]>|[\\w#]+\\(\\w+\\):\\d+:\\d+[>*]|(\\w+-)?\\d+\\.\\d+\\.\\d+(p\\d+)?[^\\d][^>]+>)(?=[ ])`,starts:{end:`$`,keywords:a,contains:m}}];return c.unshift(s),{name:`Ruby`,aliases:[`rb`,`gemspec`,`podspec`,`thor`,`irb`],keywords:a,illegal:/\/\*/,contains:[e.SHEBANG({binary:`ruby`})].concat(h,c,m)}}function Dy(e){let t=e.regex,n=/(r#)?/,r=t.concat(n,e.UNDERSCORE_IDENT_RE),i=t.concat(n,e.IDENT_RE),a={className:`title.function.invoke`,relevance:0,begin:t.concat(/\b/,/(?!let|for|while|if|else|match\b)/,i,t.lookahead(/\s*\(/))},o=`([ui](8|16|32|64|128|size)|f(32|64))?`,s=`abstract.as.async.await.become.box.break.const.continue.crate.do.dyn.else.enum.extern.false.final.fn.for.if.impl.in.let.loop.macro.match.mod.move.mut.override.priv.pub.ref.return.self.Self.static.struct.super.trait.true.try.type.typeof.union.unsafe.unsized.use.virtual.where.while.yield`.split(`.`),c=[`true`,`false`,`Some`,`None`,`Ok`,`Err`],l=`drop .Copy.Send.Sized.Sync.Drop.Fn.FnMut.FnOnce.ToOwned.Clone.Debug.PartialEq.PartialOrd.Eq.Ord.AsRef.AsMut.Into.From.Default.Iterator.Extend.IntoIterator.DoubleEndedIterator.ExactSizeIterator.SliceConcatExt.ToString.assert!.assert_eq!.bitflags!.bytes!.cfg!.col!.concat!.concat_idents!.debug_assert!.debug_assert_eq!.env!.eprintln!.panic!.file!.format!.format_args!.include_bytes!.include_str!.line!.local_data_key!.module_path!.option_env!.print!.println!.select!.stringify!.try!.unimplemented!.unreachable!.vec!.write!.writeln!.macro_rules!.assert_ne!.debug_assert_ne!`.split(`.`),u=[`i8`,`i16`,`i32`,`i64`,`i128`,`isize`,`u8`,`u16`,`u32`,`u64`,`u128`,`usize`,`f32`,`f64`,`str`,`char`,`bool`,`Box`,`Option`,`Result`,`String`,`Vec`];return{name:`Rust`,aliases:[`rs`],keywords:{$pattern:e.IDENT_RE+`!?`,type:u,keyword:s,literal:c,built_in:l},illegal:`</`,contains:[e.C_LINE_COMMENT_MODE,e.COMMENT(`/\\*`,`\\*/`,{contains:[`self`]}),e.inherit(e.QUOTE_STRING_MODE,{begin:/b?"/,illegal:null}),{className:`symbol`,begin:/'[a-zA-Z_][a-zA-Z0-9_]*(?!')/},{scope:`string`,variants:[{begin:/b?r(#*)"(.|\n)*?"\1(?!#)/},{begin:/b?'/,end:/'/,contains:[{scope:`char.escape`,match:/\\('|\w|x\w{2}|u\w{4}|U\w{8})/}]}]},{className:`number`,variants:[{begin:`\\b0b([01_]+)`+o},{begin:`\\b0o([0-7_]+)`+o},{begin:`\\b0x([A-Fa-f0-9_]+)`+o},{begin:`\\b(\\d[\\d_]*(\\.[0-9_]+)?([eE][+-]?[0-9_]+)?)`+o}],relevance:0},{begin:[/fn/,/\s+/,r],className:{1:`keyword`,3:`title.function`}},{className:`meta`,begin:`#!?\\[`,end:`\\]`,contains:[{className:`string`,begin:/"/,end:/"/,contains:[e.BACKSLASH_ESCAPE]}]},{begin:[/let/,/\s+/,/(?:mut\s+)?/,r],className:{1:`keyword`,3:`keyword`,4:`variable`}},{begin:[/for/,/\s+/,r,/\s+/,/in/],className:{1:`keyword`,3:`variable`,5:`keyword`}},{begin:[/type/,/\s+/,r],className:{1:`keyword`,3:`title.class`}},{begin:[/(?:trait|enum|struct|union|impl|for)/,/\s+/,r],className:{1:`keyword`,3:`title.class`}},{begin:e.IDENT_RE+`::`,keywords:{keyword:`Self`,built_in:l,type:u}},{className:`punctuation`,begin:`->`},a]}}var Oy=e=>({IMPORTANT:{scope:`meta`,begin:`!important`},BLOCK_COMMENT:e.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:`number`,begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:`built_in`,begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:`selector-attr`,begin:/\[/,end:/\]/,illegal:`$`,contains:[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:`number`,begin:e.NUMBER_RE+`(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?`,relevance:0},CSS_VARIABLE:{className:`attr`,begin:/--[A-Za-z_][A-Za-z0-9_-]*/}}),ky=`a.abbr.address.article.aside.audio.b.blockquote.body.button.canvas.caption.cite.code.dd.del.details.dfn.div.dl.dt.em.fieldset.figcaption.figure.footer.form.h1.h2.h3.h4.h5.h6.header.hgroup.html.i.iframe.img.input.ins.kbd.label.legend.li.main.mark.menu.nav.object.ol.optgroup.option.p.picture.q.quote.samp.section.select.source.span.strong.summary.sup.table.tbody.td.textarea.tfoot.th.thead.time.tr.ul.var.video`.split(`.`),Ay=`defs.g.marker.mask.pattern.svg.switch.symbol.feBlend.feColorMatrix.feComponentTransfer.feComposite.feConvolveMatrix.feDiffuseLighting.feDisplacementMap.feFlood.feGaussianBlur.feImage.feMerge.feMorphology.feOffset.feSpecularLighting.feTile.feTurbulence.linearGradient.radialGradient.stop.circle.ellipse.image.line.path.polygon.polyline.rect.text.use.textPath.tspan.foreignObject.clipPath`.split(`.`),jy=[...ky,...Ay],My=`any-hover.any-pointer.aspect-ratio.color.color-gamut.color-index.device-aspect-ratio.device-height.device-width.display-mode.forced-colors.grid.height.hover.inverted-colors.monochrome.orientation.overflow-block.overflow-inline.pointer.prefers-color-scheme.prefers-contrast.prefers-reduced-motion.prefers-reduced-transparency.resolution.scan.scripting.update.width.min-width.max-width.min-height.max-height`.split(`.`).sort().reverse(),Ny=`active.any-link.blank.checked.current.default.defined.dir.disabled.drop.empty.enabled.first.first-child.first-of-type.fullscreen.future.focus.focus-visible.focus-within.has.host.host-context.hover.indeterminate.in-range.invalid.is.lang.last-child.last-of-type.left.link.local-link.not.nth-child.nth-col.nth-last-child.nth-last-col.nth-last-of-type.nth-of-type.only-child.only-of-type.optional.out-of-range.past.placeholder-shown.read-only.read-write.required.right.root.scope.target.target-within.user-invalid.valid.visited.where`.split(`.`).sort().reverse(),Py=[`after`,`backdrop`,`before`,`cue`,`cue-region`,`first-letter`,`first-line`,`grammar-error`,`marker`,`part`,`placeholder`,`selection`,`slotted`,`spelling-error`].sort().reverse(),Fy=`accent-color.align-content.align-items.align-self.alignment-baseline.all.anchor-name.animation.animation-composition.animation-delay.animation-direction.animation-duration.animation-fill-mode.animation-iteration-count.animation-name.animation-play-state.animation-range.animation-range-end.animation-range-start.animation-timeline.animation-timing-function.appearance.aspect-ratio.backdrop-filter.backface-visibility.background.background-attachment.background-blend-mode.background-clip.background-color.background-image.background-origin.background-position.background-position-x.background-position-y.background-repeat.background-size.baseline-shift.block-size.border.border-block.border-block-color.border-block-end.border-block-end-color.border-block-end-style.border-block-end-width.border-block-start.border-block-start-color.border-block-start-style.border-block-start-width.border-block-style.border-block-width.border-bottom.border-bottom-color.border-bottom-left-radius.border-bottom-right-radius.border-bottom-style.border-bottom-width.border-collapse.border-color.border-end-end-radius.border-end-start-radius.border-image.border-image-outset.border-image-repeat.border-image-slice.border-image-source.border-image-width.border-inline.border-inline-color.border-inline-end.border-inline-end-color.border-inline-end-style.border-inline-end-width.border-inline-start.border-inline-start-color.border-inline-start-style.border-inline-start-width.border-inline-style.border-inline-width.border-left.border-left-color.border-left-style.border-left-width.border-radius.border-right.border-right-color.border-right-style.border-right-width.border-spacing.border-start-end-radius.border-start-start-radius.border-style.border-top.border-top-color.border-top-left-radius.border-top-right-radius.border-top-style.border-top-width.border-width.bottom.box-align.box-decoration-break.box-direction.box-flex.box-flex-group.box-lines.box-ordinal-group.box-orient.box-pack.box-shadow.box-sizing.break-after.break-before.break-inside.caption-side.caret-color.clear.clip.clip-path.clip-rule.color.color-interpolation.color-interpolation-filters.color-profile.color-rendering.color-scheme.column-count.column-fill.column-gap.column-rule.column-rule-color.column-rule-style.column-rule-width.column-span.column-width.columns.contain.contain-intrinsic-block-size.contain-intrinsic-height.contain-intrinsic-inline-size.contain-intrinsic-size.contain-intrinsic-width.container.container-name.container-type.content.content-visibility.counter-increment.counter-reset.counter-set.cue.cue-after.cue-before.cursor.cx.cy.direction.display.dominant-baseline.empty-cells.enable-background.field-sizing.fill.fill-opacity.fill-rule.filter.flex.flex-basis.flex-direction.flex-flow.flex-grow.flex-shrink.flex-wrap.float.flood-color.flood-opacity.flow.font.font-display.font-family.font-feature-settings.font-kerning.font-language-override.font-optical-sizing.font-palette.font-size.font-size-adjust.font-smooth.font-smoothing.font-stretch.font-style.font-synthesis.font-synthesis-position.font-synthesis-small-caps.font-synthesis-style.font-synthesis-weight.font-variant.font-variant-alternates.font-variant-caps.font-variant-east-asian.font-variant-emoji.font-variant-ligatures.font-variant-numeric.font-variant-position.font-variation-settings.font-weight.forced-color-adjust.gap.glyph-orientation-horizontal.glyph-orientation-vertical.grid.grid-area.grid-auto-columns.grid-auto-flow.grid-auto-rows.grid-column.grid-column-end.grid-column-start.grid-gap.grid-row.grid-row-end.grid-row-start.grid-template.grid-template-areas.grid-template-columns.grid-template-rows.hanging-punctuation.height.hyphenate-character.hyphenate-limit-chars.hyphens.icon.image-orientation.image-rendering.image-resolution.ime-mode.initial-letter.initial-letter-align.inline-size.inset.inset-area.inset-block.inset-block-end.inset-block-start.inset-inline.inset-inline-end.inset-inline-start.isolation.justify-content.justify-items.justify-self.kerning.left.letter-spacing.lighting-color.line-break.line-height.line-height-step.list-style.list-style-image.list-style-position.list-style-type.margin.margin-block.margin-block-end.margin-block-start.margin-bottom.margin-inline.margin-inline-end.margin-inline-start.margin-left.margin-right.margin-top.margin-trim.marker.marker-end.marker-mid.marker-start.marks.mask.mask-border.mask-border-mode.mask-border-outset.mask-border-repeat.mask-border-slice.mask-border-source.mask-border-width.mask-clip.mask-composite.mask-image.mask-mode.mask-origin.mask-position.mask-repeat.mask-size.mask-type.masonry-auto-flow.math-depth.math-shift.math-style.max-block-size.max-height.max-inline-size.max-width.min-block-size.min-height.min-inline-size.min-width.mix-blend-mode.nav-down.nav-index.nav-left.nav-right.nav-up.none.normal.object-fit.object-position.offset.offset-anchor.offset-distance.offset-path.offset-position.offset-rotate.opacity.order.orphans.outline.outline-color.outline-offset.outline-style.outline-width.overflow.overflow-anchor.overflow-block.overflow-clip-margin.overflow-inline.overflow-wrap.overflow-x.overflow-y.overlay.overscroll-behavior.overscroll-behavior-block.overscroll-behavior-inline.overscroll-behavior-x.overscroll-behavior-y.padding.padding-block.padding-block-end.padding-block-start.padding-bottom.padding-inline.padding-inline-end.padding-inline-start.padding-left.padding-right.padding-top.page.page-break-after.page-break-before.page-break-inside.paint-order.pause.pause-after.pause-before.perspective.perspective-origin.place-content.place-items.place-self.pointer-events.position.position-anchor.position-visibility.print-color-adjust.quotes.r.resize.rest.rest-after.rest-before.right.rotate.row-gap.ruby-align.ruby-position.scale.scroll-behavior.scroll-margin.scroll-margin-block.scroll-margin-block-end.scroll-margin-block-start.scroll-margin-bottom.scroll-margin-inline.scroll-margin-inline-end.scroll-margin-inline-start.scroll-margin-left.scroll-margin-right.scroll-margin-top.scroll-padding.scroll-padding-block.scroll-padding-block-end.scroll-padding-block-start.scroll-padding-bottom.scroll-padding-inline.scroll-padding-inline-end.scroll-padding-inline-start.scroll-padding-left.scroll-padding-right.scroll-padding-top.scroll-snap-align.scroll-snap-stop.scroll-snap-type.scroll-timeline.scroll-timeline-axis.scroll-timeline-name.scrollbar-color.scrollbar-gutter.scrollbar-width.shape-image-threshold.shape-margin.shape-outside.shape-rendering.speak.speak-as.src.stop-color.stop-opacity.stroke.stroke-dasharray.stroke-dashoffset.stroke-linecap.stroke-linejoin.stroke-miterlimit.stroke-opacity.stroke-width.tab-size.table-layout.text-align.text-align-all.text-align-last.text-anchor.text-combine-upright.text-decoration.text-decoration-color.text-decoration-line.text-decoration-skip.text-decoration-skip-ink.text-decoration-style.text-decoration-thickness.text-emphasis.text-emphasis-color.text-emphasis-position.text-emphasis-style.text-indent.text-justify.text-orientation.text-overflow.text-rendering.text-shadow.text-size-adjust.text-transform.text-underline-offset.text-underline-position.text-wrap.text-wrap-mode.text-wrap-style.timeline-scope.top.touch-action.transform.transform-box.transform-origin.transform-style.transition.transition-behavior.transition-delay.transition-duration.transition-property.transition-timing-function.translate.unicode-bidi.user-modify.user-select.vector-effect.vertical-align.view-timeline.view-timeline-axis.view-timeline-inset.view-timeline-name.view-transition-name.visibility.voice-balance.voice-duration.voice-family.voice-pitch.voice-range.voice-rate.voice-stress.voice-volume.white-space.white-space-collapse.widows.width.will-change.word-break.word-spacing.word-wrap.writing-mode.x.y.z-index.zoom`.split(`.`).sort().reverse();function Iy(e){let t=Oy(e),n=Py,r=Ny,i=`@[a-z-]+`,a={className:`variable`,begin:`(\\$[a-zA-Z-][a-zA-Z0-9_-]*)\\b`,relevance:0};return{name:`SCSS`,case_insensitive:!0,illegal:`[=/|']`,contains:[e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,t.CSS_NUMBER_MODE,{className:`selector-id`,begin:`#[A-Za-z0-9_-]+`,relevance:0},{className:`selector-class`,begin:`\\.[A-Za-z0-9_-]+`,relevance:0},t.ATTRIBUTE_SELECTOR_MODE,{className:`selector-tag`,begin:`\\b(`+jy.join(`|`)+`)\\b`,relevance:0},{className:`selector-pseudo`,begin:`:(`+r.join(`|`)+`)`},{className:`selector-pseudo`,begin:`:(:)?(`+n.join(`|`)+`)`},a,{begin:/\(/,end:/\)/,contains:[t.CSS_NUMBER_MODE]},t.CSS_VARIABLE,{className:`attribute`,begin:`\\b(`+Fy.join(`|`)+`)\\b`},{begin:`\\b(whitespace|wait|w-resize|visible|vertical-text|vertical-ideographic|uppercase|upper-roman|upper-alpha|underline|transparent|top|thin|thick|text|text-top|text-bottom|tb-rl|table-header-group|table-footer-group|sw-resize|super|strict|static|square|solid|small-caps|separate|se-resize|scroll|s-resize|rtl|row-resize|ridge|right|repeat|repeat-y|repeat-x|relative|progress|pointer|overline|outside|outset|oblique|nowrap|not-allowed|normal|none|nw-resize|no-repeat|no-drop|newspaper|ne-resize|n-resize|move|middle|medium|ltr|lr-tb|lowercase|lower-roman|lower-alpha|loose|list-item|line|line-through|line-edge|lighter|left|keep-all|justify|italic|inter-word|inter-ideograph|inside|inset|inline|inline-block|inherit|inactive|ideograph-space|ideograph-parenthesis|ideograph-numeric|ideograph-alpha|horizontal|hidden|help|hand|groove|fixed|ellipsis|e-resize|double|dotted|distribute|distribute-space|distribute-letter|distribute-all-lines|disc|disabled|default|decimal|dashed|crosshair|collapse|col-resize|circle|char|center|capitalize|break-word|break-all|bottom|both|bolder|bold|block|bidi-override|below|baseline|auto|always|all-scroll|absolute|table|table-cell)\\b`},{begin:/:/,end:/[;}{]/,relevance:0,contains:[t.BLOCK_COMMENT,a,t.HEXCOLOR,t.CSS_NUMBER_MODE,e.QUOTE_STRING_MODE,e.APOS_STRING_MODE,t.IMPORTANT,t.FUNCTION_DISPATCH]},{begin:`@(page|font-face)`,keywords:{$pattern:i,keyword:`@page @font-face`}},{begin:`@`,end:`[{;]`,returnBegin:!0,keywords:{$pattern:/[a-z-]+/,keyword:`and or not only`,attribute:My.join(` `)},contains:[{begin:i,className:`keyword`},{begin:/[a-z-]+(?=:)/,className:`attribute`},a,e.QUOTE_STRING_MODE,e.APOS_STRING_MODE,t.HEXCOLOR,t.CSS_NUMBER_MODE]},t.FUNCTION_DISPATCH]}}function Ly(e){return{name:`Shell Session`,aliases:[`console`,`shellsession`],contains:[{className:`meta.prompt`,begin:/^\s{0,3}[/~\w\d[\]()@-]*[>%$#][ ]?/,starts:{end:/[^\\](?=\s*$)/,subLanguage:`bash`}}]}}function Ry(e){let t=e.regex,n=e.COMMENT(`--`,`$`),r={scope:`string`,variants:[{begin:/'/,end:/'/,contains:[{match:/''/}]}]},i={begin:/"/,end:/"/,contains:[{match:/""/}]},a=[`true`,`false`,`unknown`],o=[`double precision`,`large object`,`with timezone`,`without timezone`],s=`bigint.binary.blob.boolean.char.character.clob.date.dec.decfloat.decimal.float.int.integer.interval.nchar.nclob.national.numeric.real.row.smallint.time.timestamp.varchar.varying.varbinary`.split(`.`),c=[`add`,`asc`,`collation`,`desc`,`final`,`first`,`last`,`view`],l=`abs.acos.all.allocate.alter.and.any.are.array.array_agg.array_max_cardinality.as.asensitive.asin.asymmetric.at.atan.atomic.authorization.avg.begin.begin_frame.begin_partition.between.bigint.binary.blob.boolean.both.by.call.called.cardinality.cascaded.case.cast.ceil.ceiling.char.char_length.character.character_length.check.classifier.clob.close.coalesce.collate.collect.column.commit.condition.connect.constraint.contains.convert.copy.corr.corresponding.cos.cosh.count.covar_pop.covar_samp.create.cross.cube.cume_dist.current.current_catalog.current_date.current_default_transform_group.current_path.current_role.current_row.current_schema.current_time.current_timestamp.current_path.current_role.current_transform_group_for_type.current_user.cursor.cycle.date.day.deallocate.dec.decimal.decfloat.declare.default.define.delete.dense_rank.deref.describe.deterministic.disconnect.distinct.double.drop.dynamic.each.element.else.empty.end.end_frame.end_partition.end-exec.equals.escape.every.except.exec.execute.exists.exp.external.extract.false.fetch.filter.first_value.float.floor.for.foreign.frame_row.free.from.full.function.fusion.get.global.grant.group.grouping.groups.having.hold.hour.identity.in.indicator.initial.inner.inout.insensitive.insert.int.integer.intersect.intersection.interval.into.is.join.json_array.json_arrayagg.json_exists.json_object.json_objectagg.json_query.json_table.json_table_primitive.json_value.lag.language.large.last_value.lateral.lead.leading.left.like.like_regex.listagg.ln.local.localtime.localtimestamp.log.log10.lower.match.match_number.match_recognize.matches.max.member.merge.method.min.minute.mod.modifies.module.month.multiset.national.natural.nchar.nclob.new.no.none.normalize.not.nth_value.ntile.null.nullif.numeric.octet_length.occurrences_regex.of.offset.old.omit.on.one.only.open.or.order.out.outer.over.overlaps.overlay.parameter.partition.pattern.per.percent.percent_rank.percentile_cont.percentile_disc.period.portion.position.position_regex.power.precedes.precision.prepare.primary.procedure.ptf.range.rank.reads.real.recursive.ref.references.referencing.regr_avgx.regr_avgy.regr_count.regr_intercept.regr_r2.regr_slope.regr_sxx.regr_sxy.regr_syy.release.result.return.returns.revoke.right.rollback.rollup.row.row_number.rows.running.savepoint.scope.scroll.search.second.seek.select.sensitive.session_user.set.show.similar.sin.sinh.skip.smallint.some.specific.specifictype.sql.sqlexception.sqlstate.sqlwarning.sqrt.start.static.stddev_pop.stddev_samp.submultiset.subset.substring.substring_regex.succeeds.sum.symmetric.system.system_time.system_user.table.tablesample.tan.tanh.then.time.timestamp.timezone_hour.timezone_minute.to.trailing.translate.translate_regex.translation.treat.trigger.trim.trim_array.true.truncate.uescape.union.unique.unknown.unnest.update.upper.user.using.value.values.value_of.var_pop.var_samp.varbinary.varchar.varying.versioning.when.whenever.where.width_bucket.window.with.within.without.year`.split(`.`),u=`abs.acos.array_agg.asin.atan.avg.cast.ceil.ceiling.coalesce.corr.cos.cosh.count.covar_pop.covar_samp.cume_dist.dense_rank.deref.element.exp.extract.first_value.floor.json_array.json_arrayagg.json_exists.json_object.json_objectagg.json_query.json_table.json_table_primitive.json_value.lag.last_value.lead.listagg.ln.log.log10.lower.max.min.mod.nth_value.ntile.nullif.percent_rank.percentile_cont.percentile_disc.position.position_regex.power.rank.regr_avgx.regr_avgy.regr_count.regr_intercept.regr_r2.regr_slope.regr_sxx.regr_sxy.regr_syy.row_number.sin.sinh.sqrt.stddev_pop.stddev_samp.substring.substring_regex.sum.tan.tanh.translate.translate_regex.treat.trim.trim_array.unnest.upper.value_of.var_pop.var_samp.width_bucket`.split(`.`),d=[`current_catalog`,`current_date`,`current_default_transform_group`,`current_path`,`current_role`,`current_schema`,`current_transform_group_for_type`,`current_user`,`session_user`,`system_time`,`system_user`,`current_time`,`localtime`,`current_timestamp`,`localtimestamp`],f=[`create table`,`insert into`,`primary key`,`foreign key`,`not null`,`alter table`,`add constraint`,`grouping sets`,`on overflow`,`character set`,`respect nulls`,`ignore nulls`,`nulls first`,`nulls last`,`depth first`,`breadth first`],p=u,m=[...l,...c].filter(e=>!u.includes(e)),h={scope:`variable`,match:/@[a-z0-9][a-z0-9_]*/},g={scope:`operator`,match:/[-+*/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?/,relevance:0},_={match:t.concat(/\b/,t.either(...p),/\s*\(/),relevance:0,keywords:{built_in:p}};function v(e){return t.concat(/\b/,t.either(...e.map(e=>e.replace(/\s+/,`\\s+`))),/\b/)}let y={scope:`keyword`,match:v(f),relevance:0};function b(e,{exceptions:t,when:n}={}){let r=n;return t||=[],e.map(e=>e.match(/\|\d+$/)||t.includes(e)?e:r(e)?`${e}|0`:e)}return{name:`SQL`,case_insensitive:!0,illegal:/[{}]|<\//,keywords:{$pattern:/\b[\w\.]+/,keyword:b(m,{when:e=>e.length<3}),literal:a,type:s,built_in:d},contains:[{scope:`type`,match:v(o)},y,_,h,r,i,e.C_NUMBER_MODE,e.C_BLOCK_COMMENT_MODE,n,g]}}function zy(e){return e?typeof e==`string`?e:e.source:null}function By(e){return Vy(`(?=`,e,`)`)}function Vy(...e){return e.map(e=>zy(e)).join(``)}function Hy(e){let t=e[e.length-1];return typeof t==`object`&&t.constructor===Object?(e.splice(e.length-1,1),t):{}}function Uy(...e){return`(`+(Hy(e).capture?``:`?:`)+e.map(e=>zy(e)).join(`|`)+`)`}var Wy=e=>Vy(/\b/,e,/\w$/.test(e)?/\b/:/\B/),Gy=[`Protocol`,`Type`].map(Wy),Ky=[`init`,`self`].map(Wy),qy=[`Any`,`Self`],Jy=[`actor`,`any`,`associatedtype`,`async`,`await`,/as\?/,/as!/,`as`,`borrowing`,`break`,`case`,`catch`,`class`,`consume`,`consuming`,`continue`,`convenience`,`copy`,`default`,`defer`,`deinit`,`didSet`,`distributed`,`do`,`dynamic`,`each`,`else`,`enum`,`extension`,`fallthrough`,/fileprivate\(set\)/,`fileprivate`,`final`,`for`,`func`,`get`,`guard`,`if`,`import`,`indirect`,`infix`,/init\?/,/init!/,`inout`,/internal\(set\)/,`internal`,`in`,`is`,`isolated`,`nonisolated`,`lazy`,`let`,`macro`,`mutating`,`nonmutating`,/open\(set\)/,`open`,`operator`,`optional`,`override`,`package`,`postfix`,`precedencegroup`,`prefix`,/private\(set\)/,`private`,`protocol`,/public\(set\)/,`public`,`repeat`,`required`,`rethrows`,`return`,`set`,`some`,`static`,`struct`,`subscript`,`super`,`switch`,`throws`,`throw`,/try\?/,/try!/,`try`,`typealias`,/unowned\(safe\)/,/unowned\(unsafe\)/,`unowned`,`var`,`weak`,`where`,`while`,`willSet`],Yy=[`false`,`nil`,`true`],Xy=[`assignment`,`associativity`,`higherThan`,`left`,`lowerThan`,`none`,`right`],Zy=[`#colorLiteral`,`#column`,`#dsohandle`,`#else`,`#elseif`,`#endif`,`#error`,`#file`,`#fileID`,`#fileLiteral`,`#filePath`,`#function`,`#if`,`#imageLiteral`,`#keyPath`,`#line`,`#selector`,`#sourceLocation`,`#warning`],Qy=`abs.all.any.assert.assertionFailure.debugPrint.dump.fatalError.getVaList.isKnownUniquelyReferenced.max.min.numericCast.pointwiseMax.pointwiseMin.precondition.preconditionFailure.print.readLine.repeatElement.sequence.stride.swap.swift_unboxFromSwiftValueWithType.transcode.type.unsafeBitCast.unsafeDowncast.withExtendedLifetime.withUnsafeMutablePointer.withUnsafePointer.withVaList.withoutActuallyEscaping.zip`.split(`.`),$y=Uy(/[/=\-+!*%<>&|^~?]/,/[\u00A1-\u00A7]/,/[\u00A9\u00AB]/,/[\u00AC\u00AE]/,/[\u00B0\u00B1]/,/[\u00B6\u00BB\u00BF\u00D7\u00F7]/,/[\u2016-\u2017]/,/[\u2020-\u2027]/,/[\u2030-\u203E]/,/[\u2041-\u2053]/,/[\u2055-\u205E]/,/[\u2190-\u23FF]/,/[\u2500-\u2775]/,/[\u2794-\u2BFF]/,/[\u2E00-\u2E7F]/,/[\u3001-\u3003]/,/[\u3008-\u3020]/,/[\u3030]/),eb=Uy($y,/[\u0300-\u036F]/,/[\u1DC0-\u1DFF]/,/[\u20D0-\u20FF]/,/[\uFE00-\uFE0F]/,/[\uFE20-\uFE2F]/),tb=Vy($y,eb,`*`),nb=Uy(/[a-zA-Z_]/,/[\u00A8\u00AA\u00AD\u00AF\u00B2-\u00B5\u00B7-\u00BA]/,/[\u00BC-\u00BE\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u00FF]/,/[\u0100-\u02FF\u0370-\u167F\u1681-\u180D\u180F-\u1DBF]/,/[\u1E00-\u1FFF]/,/[\u200B-\u200D\u202A-\u202E\u203F-\u2040\u2054\u2060-\u206F]/,/[\u2070-\u20CF\u2100-\u218F\u2460-\u24FF\u2776-\u2793]/,/[\u2C00-\u2DFF\u2E80-\u2FFF]/,/[\u3004-\u3007\u3021-\u302F\u3031-\u303F\u3040-\uD7FF]/,/[\uF900-\uFD3D\uFD40-\uFDCF\uFDF0-\uFE1F\uFE30-\uFE44]/,/[\uFE47-\uFEFE\uFF00-\uFFFD]/),rb=Uy(nb,/\d/,/[\u0300-\u036F\u1DC0-\u1DFF\u20D0-\u20FF\uFE20-\uFE2F]/),ib=Vy(nb,rb,`*`),ab=Vy(/[A-Z]/,rb,`*`),ob=[`attached`,`autoclosure`,Vy(/convention\(/,Uy(`swift`,`block`,`c`),/\)/),`discardableResult`,`dynamicCallable`,`dynamicMemberLookup`,`escaping`,`freestanding`,`frozen`,`GKInspectable`,`IBAction`,`IBDesignable`,`IBInspectable`,`IBOutlet`,`IBSegueAction`,`inlinable`,`main`,`nonobjc`,`NSApplicationMain`,`NSCopying`,`NSManaged`,Vy(/objc\(/,ib,/\)/),`objc`,`objcMembers`,`propertyWrapper`,`requires_stored_property_inits`,`resultBuilder`,`Sendable`,`testable`,`UIApplicationMain`,`unchecked`,`unknown`,`usableFromInline`,`warn_unqualified_access`],sb=[`iOS`,`iOSApplicationExtension`,`macOS`,`macOSApplicationExtension`,`macCatalyst`,`macCatalystApplicationExtension`,`watchOS`,`watchOSApplicationExtension`,`tvOS`,`tvOSApplicationExtension`,`swift`];function cb(e){let t={match:/\s+/,relevance:0},n=e.COMMENT(`/\\*`,`\\*/`,{contains:[`self`]}),r=[e.C_LINE_COMMENT_MODE,n],i={match:[/\./,Uy(...Gy,...Ky)],className:{2:`keyword`}},a={match:Vy(/\./,Uy(...Jy)),relevance:0},o=Jy.filter(e=>typeof e==`string`).concat([`_|0`]),s={variants:[{className:`keyword`,match:Uy(...Jy.filter(e=>typeof e!=`string`).concat(qy).map(Wy),...Ky)}]},c={$pattern:Uy(/\b\w+/,/#\w+/),keyword:o.concat(Zy),literal:Yy},l=[i,a,s],u=[{match:Vy(/\./,Uy(...Qy)),relevance:0},{className:`built_in`,match:Vy(/\b/,Uy(...Qy),/(?=\()/)}],d={match:/->/,relevance:0},f=[d,{className:`operator`,relevance:0,variants:[{match:tb},{match:`\\.(\\.|${eb})+`}]}],p=`([0-9]_*)+`,m=`([0-9a-fA-F]_*)+`,h={className:`number`,relevance:0,variants:[{match:`\\b(${p})(\\.(${p}))?([eE][+-]?(${p}))?\\b`},{match:`\\b0x(${m})(\\.(${m}))?([pP][+-]?(${p}))?\\b`},{match:/\b0o([0-7]_*)+\b/},{match:/\b0b([01]_*)+\b/}]},g=(e=``)=>({className:`subst`,variants:[{match:Vy(/\\/,e,/[0\\tnr"']/)},{match:Vy(/\\/,e,/u\{[0-9a-fA-F]{1,8}\}/)}]}),_=(e=``)=>({className:`subst`,match:Vy(/\\/,e,/[\t ]*(?:[\r\n]|\r\n)/)}),v=(e=``)=>({className:`subst`,label:`interpol`,begin:Vy(/\\/,e,/\(/),end:/\)/}),y=(e=``)=>({begin:Vy(e,/"""/),end:Vy(/"""/,e),contains:[g(e),_(e),v(e)]}),b=(e=``)=>({begin:Vy(e,/"/),end:Vy(/"/,e),contains:[g(e),v(e)]}),x={className:`string`,variants:[y(),y(`#`),y(`##`),y(`###`),b(),b(`#`),b(`##`),b(`###`)]},S=[e.BACKSLASH_ESCAPE,{begin:/\[/,end:/\]/,relevance:0,contains:[e.BACKSLASH_ESCAPE]}],C={begin:/\/[^\s](?=[^/\n]*\/)/,end:/\//,contains:S},w=e=>{let t=Vy(e,/\//),n=Vy(/\//,e);return{begin:t,end:n,contains:[...S,{scope:`comment`,begin:`#(?!.*${n})`,end:/$/}]}},T={scope:`regexp`,variants:[w(`###`),w(`##`),w(`#`),C]},E={match:Vy(/`/,ib,/`/)},D=[E,{className:`variable`,match:/\$\d+/},{className:`variable`,match:`\\$${rb}+`}],O=[{match:/(@|#(un)?)available/,scope:`keyword`,starts:{contains:[{begin:/\(/,end:/\)/,keywords:sb,contains:[...f,h,x]}]}},{scope:`keyword`,match:Vy(/@/,Uy(...ob),By(Uy(/\(/,/\s+/)))},{scope:`meta`,match:Vy(/@/,ib)}],k={match:By(/\b[A-Z]/),relevance:0,contains:[{className:`type`,match:Vy(/(AV|CA|CF|CG|CI|CL|CM|CN|CT|MK|MP|MTK|MTL|NS|SCN|SK|UI|WK|XC)/,rb,`+`)},{className:`type`,match:ab,relevance:0},{match:/[?!]+/,relevance:0},{match:/\.\.\./,relevance:0},{match:Vy(/\s+&\s+/,By(ab)),relevance:0}]},A={begin:/</,end:/>/,keywords:c,contains:[...r,...l,...O,d,k]};k.contains.push(A);let j={begin:/\(/,end:/\)/,relevance:0,keywords:c,contains:[`self`,{match:Vy(ib,/\s*:/),keywords:`_|0`,relevance:0},...r,T,...l,...u,...f,h,x,...D,...O,k]},M={begin:/</,end:/>/,keywords:`repeat each`,contains:[...r,k]},N={begin:/\(/,end:/\)/,keywords:c,contains:[{begin:Uy(By(Vy(ib,/\s*:/)),By(Vy(ib,/\s+/,ib,/\s*:/))),end:/:/,relevance:0,contains:[{className:`keyword`,match:/\b_\b/},{className:`params`,match:ib}]},...r,...l,...f,h,x,...O,k,j],endsParent:!0,illegal:/["']/},P={match:[/(func|macro)/,/\s+/,Uy(E.match,ib,tb)],className:{1:`keyword`,3:`title.function`},contains:[M,N,t],illegal:[/\[/,/%/]},F={match:[/\b(?:subscript|init[?!]?)/,/\s*(?=[<(])/],className:{1:`keyword`},contains:[M,N,t],illegal:/\[|%/},I={match:[/operator/,/\s+/,tb],className:{1:`keyword`,3:`title`}},L={begin:[/precedencegroup/,/\s+/,ab],className:{1:`keyword`,3:`title`},contains:[k],keywords:[...Xy,...Yy],end:/}/},ee={match:[/class\b/,/\s+/,/func\b/,/\s+/,/\b[A-Za-z_][A-Za-z0-9_]*\b/],scope:{1:`keyword`,3:`keyword`,5:`title.function`}},R={match:[/class\b/,/\s+/,/var\b/],scope:{1:`keyword`,3:`keyword`}},te={begin:[/(struct|protocol|class|extension|enum|actor)/,/\s+/,ib,/\s*/],beginScope:{1:`keyword`,3:`title.class`},keywords:c,contains:[M,...l,{begin:/:/,end:/\{/,keywords:c,contains:[{scope:`title.class.inherited`,match:ab},...l],relevance:0}]};for(let e of x.variants){let t=e.contains.find(e=>e.label===`interpol`);t.keywords=c;let n=[...l,...u,...f,h,x,...D];t.contains=[...n,{begin:/\(/,end:/\)/,contains:[`self`,...n]}]}return{name:`Swift`,keywords:c,contains:[...r,P,F,ee,R,te,I,L,{beginKeywords:`import`,end:/$/,contains:[...r],relevance:0},T,...l,...u,...f,h,x,...D,...O,k,j]}}var lb=`[A-Za-z$_][0-9A-Za-z$_]*`,ub=`as.in.of.if.for.while.finally.var.new.function.do.return.void.else.break.catch.instanceof.with.throw.case.default.try.switch.continue.typeof.delete.let.yield.const.class.debugger.async.await.static.import.from.export.extends.using`.split(`.`),db=[`true`,`false`,`null`,`undefined`,`NaN`,`Infinity`],fb=`Object.Function.Boolean.Symbol.Math.Date.Number.BigInt.String.RegExp.Array.Float32Array.Float64Array.Int8Array.Uint8Array.Uint8ClampedArray.Int16Array.Int32Array.Uint16Array.Uint32Array.BigInt64Array.BigUint64Array.Set.Map.WeakSet.WeakMap.ArrayBuffer.SharedArrayBuffer.Atomics.DataView.JSON.Promise.Generator.GeneratorFunction.AsyncFunction.Reflect.Proxy.Intl.WebAssembly`.split(`.`),pb=[`Error`,`EvalError`,`InternalError`,`RangeError`,`ReferenceError`,`SyntaxError`,`TypeError`,`URIError`],mb=[`setInterval`,`setTimeout`,`clearInterval`,`clearTimeout`,`require`,`exports`,`eval`,`isFinite`,`isNaN`,`parseFloat`,`parseInt`,`decodeURI`,`decodeURIComponent`,`encodeURI`,`encodeURIComponent`,`escape`,`unescape`],hb=[`arguments`,`this`,`super`,`console`,`window`,`document`,`localStorage`,`sessionStorage`,`module`,`global`],gb=[].concat(mb,fb,pb);function _b(e){let t=e.regex,n=(e,{after:t})=>{let n=`</`+e[0].slice(1);return e.input.indexOf(n,t)!==-1},r=lb,i={begin:`<>`,end:`</>`},a=/<[A-Za-z0-9\\._:-]+\s*\/>/,o={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(e,t)=>{let r=e[0].length+e.index,i=e.input[r];if(i===`<`||i===`,`){t.ignoreMatch();return}i===`>`&&(n(e,{after:r})||t.ignoreMatch());let a,o=e.input.substring(r);if(a=o.match(/^\s*=/)){t.ignoreMatch();return}if((a=o.match(/^\s+extends\s+/))&&a.index===0){t.ignoreMatch();return}}},s={$pattern:lb,keyword:ub,literal:db,built_in:gb,"variable.language":hb},c=`[0-9](_?[0-9])*`,l=`\\.(${c})`,u=`0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*`,d={className:`number`,variants:[{begin:`(\\b(${u})((${l})|\\.)?|(${l}))[eE][+-]?(${c})\\b`},{begin:`\\b(${u})\\b((${l})\\b|\\.)?|(${l})\\b`},{begin:`\\b(0|[1-9](_?[0-9])*)n\\b`},{begin:`\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b`},{begin:`\\b0[bB][0-1](_?[0-1])*n?\\b`},{begin:`\\b0[oO][0-7](_?[0-7])*n?\\b`},{begin:`\\b0[0-7]+n?\\b`}],relevance:0},f={className:`subst`,begin:`\\$\\{`,end:`\\}`,keywords:s,contains:[]},p={begin:".?html`",end:``,starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,f],subLanguage:`xml`}},m={begin:".?css`",end:``,starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,f],subLanguage:`css`}},h={begin:".?gql`",end:``,starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,f],subLanguage:`graphql`}},g={className:`string`,begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE,f]},_={className:`comment`,variants:[e.COMMENT(/\/\*\*(?!\/)/,`\\*/`,{relevance:0,contains:[{begin:`(?=@[A-Za-z]+)`,relevance:0,contains:[{className:`doctag`,begin:`@[A-Za-z]+`},{className:`type`,begin:`\\{`,end:`\\}`,excludeEnd:!0,excludeBegin:!0,relevance:0},{className:`variable`,begin:r+`(?=\\s*(-)|$)`,endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),e.C_BLOCK_COMMENT_MODE,e.C_LINE_COMMENT_MODE]},v=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,p,m,h,g,{match:/\$\d+/},d];f.contains=v.concat({begin:/\{/,end:/\}/,keywords:s,contains:[`self`].concat(v)});let y=[].concat(_,f.contains),b=y.concat([{begin:/(\s*)\(/,end:/\)/,keywords:s,contains:[`self`].concat(y)}]),x={className:`params`,begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:s,contains:b},S={variants:[{match:[/class/,/\s+/,r,/\s+/,/extends/,/\s+/,t.concat(r,`(`,t.concat(/\./,r),`)*`)],scope:{1:`keyword`,3:`title.class`,5:`keyword`,7:`title.class.inherited`}},{match:[/class/,/\s+/,r],scope:{1:`keyword`,3:`title.class`}}]},C={relevance:0,match:t.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:`title.class`,keywords:{_:[...fb,...pb]}},w={label:`use_strict`,className:`meta`,relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},T={variants:[{match:[/function/,/\s+/,r,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:`keyword`,3:`title.function`},label:`func.def`,contains:[x],illegal:/%/},E={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:`variable.constant`};function D(e){return t.concat(`(?!`,e.join(`|`),`)`)}let O={match:t.concat(/\b/,D([...mb,`super`,`import`].map(e=>`${e}\\s*\\(`)),r,t.lookahead(/\s*\(/)),className:`title.function`,relevance:0},k={begin:t.concat(/\./,t.lookahead(t.concat(r,/(?![0-9A-Za-z$_(])/))),end:r,excludeBegin:!0,keywords:`prototype`,className:`property`,relevance:0},A={match:[/get|set/,/\s+/,r,/(?=\()/],className:{1:`keyword`,3:`title.function`},contains:[{begin:/\(\)/},x]},j=`(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|`+e.UNDERSCORE_IDENT_RE+`)\\s*=>`,M={match:[/const|var|let/,/\s+/,r,/\s*/,/=\s*/,/(async\s*)?/,t.lookahead(j)],keywords:`async`,className:{1:`keyword`,3:`title.function`},contains:[x]};return{name:`JavaScript`,aliases:[`js`,`jsx`,`mjs`,`cjs`],keywords:s,exports:{PARAMS_CONTAINS:b,CLASS_REFERENCE:C},illegal:/#(?![$_A-z])/,contains:[e.SHEBANG({label:`shebang`,binary:`node`,relevance:5}),w,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,p,m,h,g,_,{match:/\$\d+/},d,C,{scope:`attr`,match:r+t.lookahead(`:`),relevance:0},M,{begin:`(`+e.RE_STARTERS_RE+`|\\b(case|return|throw)\\b)\\s*`,keywords:`return throw case`,relevance:0,contains:[_,e.REGEXP_MODE,{className:`function`,begin:j,returnBegin:!0,end:`\\s*=>`,contains:[{className:`params`,variants:[{begin:e.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:s,contains:b}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:i.begin,end:i.end},{match:a},{begin:o.begin,"on:begin":o.isTrulyOpeningTag,end:o.end}],subLanguage:`xml`,contains:[{begin:o.begin,end:o.end,skip:!0,contains:[`self`]}]}]},T,{beginKeywords:`while if switch catch for`},{begin:`\\b(?!function)`+e.UNDERSCORE_IDENT_RE+`\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{`,returnBegin:!0,label:`func.def`,contains:[x,e.inherit(e.TITLE_MODE,{begin:r,className:`title.function`})]},{match:/\.\.\./,relevance:0},k,{match:`\\$`+r,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:`title.function`},contains:[x]},O,E,S,A,{match:/\$[(.]/}]}}function vb(e){let t=e.regex,n=_b(e),r=lb,i=[`any`,`void`,`number`,`boolean`,`string`,`object`,`never`,`symbol`,`bigint`,`unknown`],a={begin:[/namespace/,/\s+/,e.IDENT_RE],beginScope:{1:`keyword`,3:`title.class`}},o={beginKeywords:`interface`,end:/\{/,excludeEnd:!0,keywords:{keyword:`interface extends`,built_in:i},contains:[n.exports.CLASS_REFERENCE]},s={className:`meta`,relevance:10,begin:/^\s*['"]use strict['"]/},c={$pattern:lb,keyword:ub.concat([`type`,`interface`,`public`,`private`,`protected`,`implements`,`declare`,`abstract`,`readonly`,`enum`,`override`,`satisfies`]),literal:db,built_in:gb.concat(i),"variable.language":hb},l={className:`meta`,begin:`@`+r},u=(e,t,n)=>{let r=e.contains.findIndex(e=>e.label===t);if(r===-1)throw Error(`can not find mode to replace`);e.contains.splice(r,1,n)};Object.assign(n.keywords,c),n.exports.PARAMS_CONTAINS.push(l);let d=n.contains.find(e=>e.scope===`attr`),f=Object.assign({},d,{match:t.concat(r,t.lookahead(/\s*\?:/))});n.exports.PARAMS_CONTAINS.push([n.exports.CLASS_REFERENCE,d,f]),n.contains=n.contains.concat([l,a,o,f]),u(n,`shebang`,e.SHEBANG()),u(n,`use_strict`,s);let p=n.contains.find(e=>e.label===`func.def`);return p.relevance=0,Object.assign(n,{name:`TypeScript`,aliases:[`ts`,`tsx`,`mts`,`cts`]}),n}function yb(e){let t=e.regex,n={className:`string`,begin:/"(""|[^/n])"C\b/},r={className:`string`,begin:/"/,end:/"/,illegal:/\n/,contains:[{begin:/""/}]},i=/\d{1,2}\/\d{1,2}\/\d{4}/,a=/\d{4}-\d{1,2}-\d{1,2}/,o=/(\d|1[012])(:\d+){0,2} *(AM|PM)/,s=/\d{1,2}(:\d{1,2}){1,2}/,c={className:`literal`,variants:[{begin:t.concat(/# */,t.either(a,i),/ *#/)},{begin:t.concat(/# */,s,/ *#/)},{begin:t.concat(/# */,o,/ *#/)},{begin:t.concat(/# */,t.either(a,i),/ +/,t.either(o,s),/ *#/)}]},l={className:`number`,relevance:0,variants:[{begin:/\b\d[\d_]*((\.[\d_]+(E[+-]?[\d_]+)?)|(E[+-]?[\d_]+))[RFD@!#]?/},{begin:/\b\d[\d_]*((U?[SIL])|[%&])?/},{begin:/&H[\dA-F_]+((U?[SIL])|[%&])?/},{begin:/&O[0-7_]+((U?[SIL])|[%&])?/},{begin:/&B[01_]+((U?[SIL])|[%&])?/}]},u={className:`label`,begin:/^\w+:/},d=e.COMMENT(/'''/,/$/,{contains:[{className:`doctag`,begin:/<\/?/,end:/>/}]}),f=e.COMMENT(null,/$/,{variants:[{begin:/'/},{begin:/([\t ]|^)REM(?=\s)/}]});return{name:`Visual Basic .NET`,aliases:[`vb`],case_insensitive:!0,classNameAliases:{label:`symbol`},keywords:{keyword:`addhandler alias aggregate ansi as async assembly auto binary by byref byval call case catch class compare const continue custom declare default delegate dim distinct do each equals else elseif end enum erase error event exit explicit finally for friend from function get global goto group handles if implements imports in inherits interface into iterator join key let lib loop me mid module mustinherit mustoverride mybase myclass namespace narrowing new next notinheritable notoverridable of off on operator option optional order overloads overridable overrides paramarray partial preserve private property protected public raiseevent readonly redim removehandler resume return select set shadows shared skip static step stop structure strict sub synclock take text then throw to try unicode until using when where while widening with withevents writeonly yield`,built_in:`addressof and andalso await directcast gettype getxmlnamespace is isfalse isnot istrue like mod nameof new not or orelse trycast typeof xor cbool cbyte cchar cdate cdbl cdec cint clng cobj csbyte cshort csng cstr cuint culng cushort`,type:`boolean byte char date decimal double integer long object sbyte short single string uinteger ulong ushort`,literal:`true false nothing`},illegal:`//|\\{|\\}|endif|gosub|variant|wend|^\\$ `,contains:[n,r,c,l,u,d,f,{className:`meta`,begin:/[\t ]*#(const|disable|else|elseif|enable|end|externalsource|if|region)\b/,end:/$/,keywords:{keyword:`const disable else elseif enable end externalsource if region then`},contains:[f]}]}}function bb(e){e.regex;let t=e.COMMENT(/\(;/,/;\)/);return t.contains.push(`self`),{name:`WebAssembly`,keywords:{$pattern:/[\w.]+/,keyword:`anyfunc,block,br,br_if,br_table,call,call_indirect,data,drop,elem,else,end,export,func,global.get,global.set,local.get,local.set,local.tee,get_global,get_local,global,if,import,local,loop,memory,memory.grow,memory.size,module,mut,nop,offset,param,result,return,select,set_global,set_local,start,table,tee_local,then,type,unreachable`.split(`,`)},contains:[e.COMMENT(/;;/,/$/),t,{match:[/(?:offset|align)/,/\s*/,/=/],className:{1:`keyword`,3:`operator`}},{className:`variable`,begin:/\$[\w_]+/},{match:/(\((?!;)|\))+/,className:`punctuation`,relevance:0},{begin:[/(?:func|call|call_indirect)/,/\s+/,/\$[^\s)]+/],className:{1:`keyword`,3:`title.function`}},e.QUOTE_STRING_MODE,{match:/(i32|i64|f32|f64)(?!\.)/,className:`type`},{className:`keyword`,match:/\b(f32|f64|i32|i64)(?:\.(?:abs|add|and|ceil|clz|const|convert_[su]\/i(?:32|64)|copysign|ctz|demote\/f64|div(?:_[su])?|eqz?|extend_[su]\/i32|floor|ge(?:_[su])?|gt(?:_[su])?|le(?:_[su])?|load(?:(?:8|16|32)_[su])?|lt(?:_[su])?|max|min|mul|nearest|neg?|or|popcnt|promote\/f32|reinterpret\/[fi](?:32|64)|rem_[su]|rot[lr]|shl|shr_[su]|store(?:8|16|32)?|sqrt|sub|trunc(?:_[su]\/f(?:32|64))?|wrap\/i64|xor))\b/},{className:`number`,relevance:0,match:/[+-]?\b(?:\d(?:_?\d)*(?:\.\d(?:_?\d)*)?(?:[eE][+-]?\d(?:_?\d)*)?|0x[\da-fA-F](?:_?[\da-fA-F])*(?:\.[\da-fA-F](?:_?[\da-fA-D])*)?(?:[pP][+-]?\d(?:_?\d)*)?)\b|\binf\b|\bnan(?::0x[\da-fA-F](?:_?[\da-fA-D])*)?\b/}]}}function xb(e){let t=e.regex,n=t.concat(/[\p{L}_]/u,t.optional(/[\p{L}0-9_.-]*:/u),/[\p{L}0-9_.-]*/u),r=/[\p{L}0-9._:-]+/u,i={className:`symbol`,begin:/&[a-z]+;|&#[0-9]+;|&#x[a-f0-9]+;/},a={begin:/\s/,contains:[{className:`keyword`,begin:/#?[a-z_][a-z1-9_-]+/,illegal:/\n/}]},o=e.inherit(a,{begin:/\(/,end:/\)/}),s=e.inherit(e.APOS_STRING_MODE,{className:`string`}),c=e.inherit(e.QUOTE_STRING_MODE,{className:`string`}),l={endsWithParent:!0,illegal:/</,relevance:0,contains:[{className:`attr`,begin:r,relevance:0},{begin:/=\s*/,relevance:0,contains:[{className:`string`,endsParent:!0,variants:[{begin:/"/,end:/"/,contains:[i]},{begin:/'/,end:/'/,contains:[i]},{begin:/[^\s"'=<>`]+/}]}]}]};return{name:`HTML, XML`,aliases:[`html`,`xhtml`,`rss`,`atom`,`xjb`,`xsd`,`xsl`,`plist`,`wsf`,`svg`],case_insensitive:!0,unicodeRegex:!0,contains:[{className:`meta`,begin:/<![a-z]/,end:/>/,relevance:10,contains:[a,c,s,o,{begin:/\[/,end:/\]/,contains:[{className:`meta`,begin:/<![a-z]/,end:/>/,contains:[a,o,c,s]}]}]},e.COMMENT(/<!--/,/-->/,{relevance:10}),{begin:/<!\[CDATA\[/,end:/\]\]>/,relevance:10},i,{className:`meta`,end:/\?>/,variants:[{begin:/<\?xml/,relevance:10,contains:[c]},{begin:/<\?[a-z][a-z0-9]+/}]},{className:`tag`,begin:/<style(?=\s|>)/,end:/>/,keywords:{name:`style`},contains:[l],starts:{end:/<\/style>/,returnEnd:!0,subLanguage:[`css`,`xml`]}},{className:`tag`,begin:/<script(?=\s|>)/,end:/>/,keywords:{name:`script`},contains:[l],starts:{end:/<\/script>/,returnEnd:!0,subLanguage:[`javascript`,`handlebars`,`xml`]}},{className:`tag`,begin:/<>|<\/>/},{className:`tag`,begin:t.concat(/</,t.lookahead(t.concat(n,t.either(/\/>/,/>/,/\s/)))),end:/\/?>/,contains:[{className:`name`,begin:n,relevance:0,starts:l}]},{className:`tag`,begin:t.concat(/<\//,t.lookahead(t.concat(n,/>/))),contains:[{className:`name`,begin:n,relevance:0},{begin:/>/,relevance:0,endsParent:!0}]}]}}function Sb(e){let t=`true false yes no null`,n=`[\\w#;/?:@&=+$,.~*'()[\\]]+`,r={className:`attr`,variants:[{begin:/[\w*@][\w*@ :()\./-]*:(?=[ \t]|$)/},{begin:/"[\w*@][\w*@ :()\./-]*":(?=[ \t]|$)/},{begin:/'[\w*@][\w*@ :()\./-]*':(?=[ \t]|$)/}]},i={className:`template-variable`,variants:[{begin:/\{\{/,end:/\}\}/},{begin:/%\{/,end:/\}/}]},a={className:`string`,relevance:0,begin:/'/,end:/'/,contains:[{match:/''/,scope:`char.escape`,relevance:0}]},o={className:`string`,relevance:0,variants:[{begin:/"/,end:/"/},{begin:/\S+/}],contains:[e.BACKSLASH_ESCAPE,i]},s=e.inherit(o,{variants:[{begin:/'/,end:/'/,contains:[{begin:/''/,relevance:0}]},{begin:/"/,end:/"/},{begin:/[^\s,{}[\]]+/}]}),c={className:`number`,begin:`\\b[0-9]{4}(-[0-9][0-9]){0,2}([Tt \\t][0-9][0-9]?(:[0-9][0-9]){2})?(\\.[0-9]*)?([ \\t])*(Z|[-+][0-9][0-9]?(:[0-9][0-9])?)?\\b`},l={end:`,`,endsWithParent:!0,excludeEnd:!0,keywords:t,relevance:0},u={begin:/\{/,end:/\}/,contains:[l],illegal:`\\n`,relevance:0},d={begin:`\\[`,end:`\\]`,contains:[l],illegal:`\\n`,relevance:0},f=[r,{className:`meta`,begin:`^---\\s*$`,relevance:10},{className:`string`,begin:`[\\|>]([1-9]?[+-])?[ ]*\\n( +)[^ ][^\\n]*\\n(\\2[^\\n]+\\n?)*`},{begin:`<%[%=-]?`,end:`[%-]?%>`,subLanguage:`ruby`,excludeBegin:!0,excludeEnd:!0,relevance:0},{className:`type`,begin:`!\\w+!`+n},{className:`type`,begin:`!<`+n+`>`},{className:`type`,begin:`!`+n},{className:`type`,begin:`!!`+n},{className:`meta`,begin:`&`+e.UNDERSCORE_IDENT_RE+`$`},{className:`meta`,begin:`\\*`+e.UNDERSCORE_IDENT_RE+`$`},{className:`bullet`,begin:`-(?=[ ]|$)`,relevance:0},e.HASH_COMMENT_MODE,{beginKeywords:t,keywords:{literal:t}},c,{className:`number`,begin:e.C_NUMBER_RE+`\\b`,relevance:0},u,d,a,o],p=[...f];return p.pop(),p.push(s),l.contains=p,{name:`YAML`,case_insensitive:!0,aliases:[`yml`],contains:f}}var Cb={arduino:bv,bash:xv,c:Sv,cpp:Cv,csharp:wv,css:Nv,diff:Pv,go:Fv,graphql:Iv,ini:Lv,java:Uv,javascript:Qv,json:$v,kotlin:iy,less:my,lua:hy,makefile:gy,markdown:_y,objectivec:vy,perl:yy,php:by,"php-template":xy,plaintext:Sy,python:Cy,"python-repl":wy,r:Ty,ruby:Ey,rust:Dy,scss:Iy,shell:Ly,sql:Ry,swift:cb,typescript:vb,vbnet:yb,wasm:bb,xml:xb,yaml:Sb},wb=e(t(((e,t)=>{function n(e){return e instanceof Map?e.clear=e.delete=e.set=function(){throw Error(`map is read-only`)}:e instanceof Set&&(e.add=e.clear=e.delete=function(){throw Error(`set is read-only`)}),Object.freeze(e),Object.getOwnPropertyNames(e).forEach(t=>{let r=e[t],i=typeof r;(i===`object`||i===`function`)&&!Object.isFrozen(r)&&n(r)}),e}var r=class{constructor(e){e.data===void 0&&(e.data={}),this.data=e.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}};function i(e){return e.replace(/&/g,`&`).replace(/</g,`<`).replace(/>/g,`>`).replace(/"/g,`"`).replace(/'/g,`'`)}function a(e,...t){let n=Object.create(null);for(let t in e)n[t]=e[t];return t.forEach(function(e){for(let t in e)n[t]=e[t]}),n}var o=`</span>`,s=e=>!!e.scope,c=(e,{prefix:t})=>{if(e.startsWith(`language:`))return e.replace(`language:`,`language-`);if(e.includes(`.`)){let n=e.split(`.`);return[`${t}${n.shift()}`,...n.map((e,t)=>`${e}${`_`.repeat(t+1)}`)].join(` `)}return`${t}${e}`},l=class{constructor(e,t){this.buffer=``,this.classPrefix=t.classPrefix,e.walk(this)}addText(e){this.buffer+=i(e)}openNode(e){if(!s(e))return;let t=c(e.scope,{prefix:this.classPrefix});this.span(t)}closeNode(e){s(e)&&(this.buffer+=o)}value(){return this.buffer}span(e){this.buffer+=`<span class="${e}">`}},u=(e={})=>{let t={children:[]};return Object.assign(t,e),t},d=class e{constructor(){this.rootNode=u(),this.stack=[this.rootNode]}get top(){return this.stack[this.stack.length-1]}get root(){return this.rootNode}add(e){this.top.children.push(e)}openNode(e){let t=u({scope:e});this.add(t),this.stack.push(t)}closeNode(){if(this.stack.length>1)return this.stack.pop()}closeAllNodes(){for(;this.closeNode(););}toJSON(){return JSON.stringify(this.rootNode,null,4)}walk(e){return this.constructor._walk(e,this.rootNode)}static _walk(e,t){return typeof t==`string`?e.addText(t):t.children&&(e.openNode(t),t.children.forEach(t=>this._walk(e,t)),e.closeNode(t)),e}static _collapse(t){typeof t!=`string`&&t.children&&(t.children.every(e=>typeof e==`string`)?t.children=[t.children.join(``)]:t.children.forEach(t=>{e._collapse(t)}))}},f=class extends d{constructor(e){super(),this.options=e}addText(e){e!==``&&this.add(e)}startScope(e){this.openNode(e)}endScope(){this.closeNode()}__addSublanguage(e,t){let n=e.root;t&&(n.scope=`language:${t}`),this.add(n)}toHTML(){return new l(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}};function p(e){return e?typeof e==`string`?e:e.source:null}function m(e){return _(`(?=`,e,`)`)}function h(e){return _(`(?:`,e,`)*`)}function g(e){return _(`(?:`,e,`)?`)}function _(...e){return e.map(e=>p(e)).join(``)}function v(e){let t=e[e.length-1];return typeof t==`object`&&t.constructor===Object?(e.splice(e.length-1,1),t):{}}function y(...e){return`(`+(v(e).capture?``:`?:`)+e.map(e=>p(e)).join(`|`)+`)`}function b(e){return RegExp(e.toString()+`|`).exec(``).length-1}function x(e,t){let n=e&&e.exec(t);return n&&n.index===0}var S=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function C(e,{joinWith:t}){let n=0;return e.map(e=>{n+=1;let t=n,r=p(e),i=``;for(;r.length>0;){let e=S.exec(r);if(!e){i+=r;break}i+=r.substring(0,e.index),r=r.substring(e.index+e[0].length),e[0][0]===`\\`&&e[1]?i+=`\\`+String(Number(e[1])+t):(i+=e[0],e[0]===`(`&&n++)}return i}).map(e=>`(${e})`).join(t)}var w=/\b\B/,T=`[a-zA-Z]\\w*`,E=`[a-zA-Z_]\\w*`,D=`\\b\\d+(\\.\\d+)?`,O=`(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)`,k=`\\b(0b[01]+)`,A=`!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~`,j=(e={})=>{let t=/^#![ ]*\//;return e.binary&&(e.begin=_(t,/.*\b/,e.binary,/\b.*/)),a({scope:`meta`,begin:t,end:/$/,relevance:0,"on:begin":(e,t)=>{e.index!==0&&t.ignoreMatch()}},e)},M={begin:`\\\\[\\s\\S]`,relevance:0},N={scope:`string`,begin:`'`,end:`'`,illegal:`\\n`,contains:[M]},P={scope:`string`,begin:`"`,end:`"`,illegal:`\\n`,contains:[M]},F={begin:/\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/},I=function(e,t,n={}){let r=a({scope:`comment`,begin:e,end:t,contains:[]},n);r.contains.push({scope:`doctag`,begin:`[ ]*(?=(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):)`,end:/(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):/,excludeBegin:!0,relevance:0});let i=y(`I`,`a`,`is`,`so`,`us`,`to`,`at`,`if`,`in`,`it`,`on`,/[A-Za-z]+['](d|ve|re|ll|t|s|n)/,/[A-Za-z]+[-][a-z]+/,/[A-Za-z][a-z]{2,}/);return r.contains.push({begin:_(/[ ]+/,`(`,i,/[.]?[:]?([.][ ]|[ ])/,`){3}`)}),r},L=I(`//`,`$`),ee=I(`/\\*`,`\\*/`),R=I(`#`,`$`),te={scope:`number`,begin:D,relevance:0},z={scope:`number`,begin:O,relevance:0},ne={scope:`number`,begin:k,relevance:0},re={scope:`regexp`,begin:/\/(?=[^/\n]*\/)/,end:/\/[gimuy]*/,contains:[M,{begin:/\[/,end:/\]/,relevance:0,contains:[M]}]},ie={scope:`title`,begin:T,relevance:0},ae={scope:`title`,begin:E,relevance:0},B={begin:`\\.\\s*`+E,relevance:0},oe=Object.freeze({__proto__:null,APOS_STRING_MODE:N,BACKSLASH_ESCAPE:M,BINARY_NUMBER_MODE:ne,BINARY_NUMBER_RE:k,COMMENT:I,C_BLOCK_COMMENT_MODE:ee,C_LINE_COMMENT_MODE:L,C_NUMBER_MODE:z,C_NUMBER_RE:O,END_SAME_AS_BEGIN:function(e){return Object.assign(e,{"on:begin":(e,t)=>{t.data._beginMatch=e[1]},"on:end":(e,t)=>{t.data._beginMatch!==e[1]&&t.ignoreMatch()}})},HASH_COMMENT_MODE:R,IDENT_RE:T,MATCH_NOTHING_RE:w,METHOD_GUARD:B,NUMBER_MODE:te,NUMBER_RE:D,PHRASAL_WORDS_MODE:F,QUOTE_STRING_MODE:P,REGEXP_MODE:re,RE_STARTERS_RE:A,SHEBANG:j,TITLE_MODE:ie,UNDERSCORE_IDENT_RE:E,UNDERSCORE_TITLE_MODE:ae});function se(e,t){e.input[e.index-1]===`.`&&t.ignoreMatch()}function ce(e,t){e.className!==void 0&&(e.scope=e.className,delete e.className)}function V(e,t){t&&e.beginKeywords&&(e.begin=`\\b(`+e.beginKeywords.split(` `).join(`|`)+`)(?!\\.)(?=\\b|\\s)`,e.__beforeBegin=se,e.keywords=e.keywords||e.beginKeywords,delete e.beginKeywords,e.relevance===void 0&&(e.relevance=0))}function le(e,t){Array.isArray(e.illegal)&&(e.illegal=y(...e.illegal))}function H(e,t){if(e.match){if(e.begin||e.end)throw Error(`begin & end are not supported with match`);e.begin=e.match,delete e.match}}function ue(e,t){e.relevance===void 0&&(e.relevance=1)}var U=(e,t)=>{if(!e.beforeMatch)return;if(e.starts)throw Error(`beforeMatch cannot be used with starts`);let n=Object.assign({},e);Object.keys(e).forEach(t=>{delete e[t]}),e.keywords=n.keywords,e.begin=_(n.beforeMatch,m(n.begin)),e.starts={relevance:0,contains:[Object.assign(n,{endsParent:!0})]},e.relevance=0,delete n.beforeMatch},de=[`of`,`and`,`for`,`in`,`not`,`or`,`if`,`then`,`parent`,`list`,`value`],W=`keyword`;function G(e,t,n=W){let r=Object.create(null);return typeof e==`string`?i(n,e.split(` `)):Array.isArray(e)?i(n,e):Object.keys(e).forEach(function(n){Object.assign(r,G(e[n],t,n))}),r;function i(e,n){t&&(n=n.map(e=>e.toLowerCase())),n.forEach(function(t){let n=t.split(`|`);r[n[0]]=[e,fe(n[0],n[1])]})}}function fe(e,t){return t?Number(t):+!pe(e)}function pe(e){return de.includes(e.toLowerCase())}var me={},he=e=>{console.error(e)},ge=(e,...t)=>{console.log(`WARN: ${e}`,...t)},K=(e,t)=>{me[`${e}/${t}`]||(console.log(`Deprecated as of ${e}. ${t}`),me[`${e}/${t}`]=!0)},q=Error();function J(e,t,{key:n}){let r=0,i=e[n],a={},o={};for(let e=1;e<=t.length;e++)o[e+r]=i[e],a[e+r]=!0,r+=b(t[e-1]);e[n]=o,e[n]._emit=a,e[n]._multi=!0}function _e(e){if(Array.isArray(e.begin)){if(e.skip||e.excludeBegin||e.returnBegin)throw he(`skip, excludeBegin, returnBegin not compatible with beginScope: {}`),q;if(typeof e.beginScope!=`object`||e.beginScope===null)throw he(`beginScope must be object`),q;J(e,e.begin,{key:`beginScope`}),e.begin=C(e.begin,{joinWith:``})}}function ve(e){if(Array.isArray(e.end)){if(e.skip||e.excludeEnd||e.returnEnd)throw he(`skip, excludeEnd, returnEnd not compatible with endScope: {}`),q;if(typeof e.endScope!=`object`||e.endScope===null)throw he(`endScope must be object`),q;J(e,e.end,{key:`endScope`}),e.end=C(e.end,{joinWith:``})}}function ye(e){e.scope&&typeof e.scope==`object`&&e.scope!==null&&(e.beginScope=e.scope,delete e.scope)}function be(e){ye(e),typeof e.beginScope==`string`&&(e.beginScope={_wrap:e.beginScope}),typeof e.endScope==`string`&&(e.endScope={_wrap:e.endScope}),_e(e),ve(e)}function xe(e){function t(t,n){return new RegExp(p(t),`m`+(e.case_insensitive?`i`:``)+(e.unicodeRegex?`u`:``)+(n?`g`:``))}class n{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(e,t){t.position=this.position++,this.matchIndexes[this.matchAt]=t,this.regexes.push([t,e]),this.matchAt+=b(e)+1}compile(){this.regexes.length===0&&(this.exec=()=>null),this.matcherRe=t(C(this.regexes.map(e=>e[1]),{joinWith:`|`}),!0),this.lastIndex=0}exec(e){this.matcherRe.lastIndex=this.lastIndex;let t=this.matcherRe.exec(e);if(!t)return null;let n=t.findIndex((e,t)=>t>0&&e!==void 0),r=this.matchIndexes[n];return t.splice(0,n),Object.assign(t,r)}}class r{constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(e){if(this.multiRegexes[e])return this.multiRegexes[e];let t=new n;return this.rules.slice(e).forEach(([e,n])=>t.addRule(e,n)),t.compile(),this.multiRegexes[e]=t,t}resumingScanAtSamePosition(){return this.regexIndex!==0}considerAll(){this.regexIndex=0}addRule(e,t){this.rules.push([e,t]),t.type===`begin`&&this.count++}exec(e){let t=this.getMatcher(this.regexIndex);t.lastIndex=this.lastIndex;let n=t.exec(e);if(this.resumingScanAtSamePosition()&&!(n&&n.index===this.lastIndex)){let t=this.getMatcher(0);t.lastIndex=this.lastIndex+1,n=t.exec(e)}return n&&(this.regexIndex+=n.position+1,this.regexIndex===this.count&&this.considerAll()),n}}function i(e){let t=new r;return e.contains.forEach(e=>t.addRule(e.begin,{rule:e,type:`begin`})),e.terminatorEnd&&t.addRule(e.terminatorEnd,{type:`end`}),e.illegal&&t.addRule(e.illegal,{type:`illegal`}),t}function o(n,r){let a=n;if(n.isCompiled)return a;[ce,H,be,U].forEach(e=>e(n,r)),e.compilerExtensions.forEach(e=>e(n,r)),n.__beforeBegin=null,[V,le,ue].forEach(e=>e(n,r)),n.isCompiled=!0;let s=null;return typeof n.keywords==`object`&&n.keywords.$pattern&&(n.keywords=Object.assign({},n.keywords),s=n.keywords.$pattern,delete n.keywords.$pattern),s||=/\w+/,n.keywords&&=G(n.keywords,e.case_insensitive),a.keywordPatternRe=t(s,!0),r&&(n.begin||=/\B|\b/,a.beginRe=t(a.begin),!n.end&&!n.endsWithParent&&(n.end=/\B|\b/),n.end&&(a.endRe=t(a.end)),a.terminatorEnd=p(a.end)||``,n.endsWithParent&&r.terminatorEnd&&(a.terminatorEnd+=(n.end?`|`:``)+r.terminatorEnd)),n.illegal&&(a.illegalRe=t(n.illegal)),n.contains||=[],n.contains=[].concat(...n.contains.map(function(e){return Ce(e===`self`?n:e)})),n.contains.forEach(function(e){o(e,a)}),n.starts&&o(n.starts,r),a.matcher=i(a),a}if(e.compilerExtensions||=[],e.contains&&e.contains.includes(`self`))throw Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.");return e.classNameAliases=a(e.classNameAliases||{}),o(e)}function Se(e){return e?e.endsWithParent||Se(e.starts):!1}function Ce(e){return e.variants&&!e.cachedVariants&&(e.cachedVariants=e.variants.map(function(t){return a(e,{variants:null},t)})),e.cachedVariants?e.cachedVariants:Se(e)?a(e,{starts:e.starts?a(e.starts):null}):Object.isFrozen(e)?a(e):e}var we=`11.11.1`,Te=class extends Error{constructor(e,t){super(e),this.name=`HTMLInjectionError`,this.html=t}},Ee=i,De=a,Oe=Symbol(`nomatch`),ke=7,Ae=function(e){let t=Object.create(null),i=Object.create(null),a=[],o=!0,s=`Could not find the language '{}', did you forget to load/include a language module?`,c={disableAutodetect:!0,name:`Plain text`,contains:[]},l={ignoreUnescapedHTML:!1,throwUnescapedHTML:!1,noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:`hljs-`,cssSelector:`pre code`,languages:null,__emitter:f};function u(e){return l.noHighlightRe.test(e)}function d(e){let t=e.className+` `;t+=e.parentNode?e.parentNode.className:``;let n=l.languageDetectRe.exec(t);if(n){let t=N(n[1]);return t||(ge(s.replace(`{}`,n[1])),ge(`Falling back to no-highlight mode for this block.`,e)),t?n[1]:`no-highlight`}return t.split(/\s+/).find(e=>u(e)||N(e))}function p(e,t,n){let r=``,i=``;typeof t==`object`?(r=e,n=t.ignoreIllegals,i=t.language):(K(`10.7.0`,`highlight(lang, code, ...args) has been deprecated.`),K(`10.7.0`,`Please use highlight(code, options) instead.
|
|
9
9
|
https://github.com/highlightjs/highlight.js/issues/2277`),i=e,r=t),n===void 0&&(n=!0);let a={code:r,language:i};R(`before:highlight`,a);let o=a.result?a.result:v(a.language,a.code,n);return o.code=a.code,R(`after:highlight`,o),o}function v(e,n,i,a){let c=Object.create(null);function u(e,t){return e.keywords[t]}function d(){if(!A.keywords){M.addText(P);return}let e=0;A.keywordPatternRe.lastIndex=0;let t=A.keywordPatternRe.exec(P),n=``;for(;t;){n+=P.substring(e,t.index);let r=D.case_insensitive?t[0].toLowerCase():t[0],i=u(A,r);if(i){let[e,a]=i;if(M.addText(n),n=``,c[r]=(c[r]||0)+1,c[r]<=ke&&(F+=a),e.startsWith(`_`))n+=t[0];else{let n=D.classNameAliases[e]||e;m(t[0],n)}}else n+=t[0];e=A.keywordPatternRe.lastIndex,t=A.keywordPatternRe.exec(P)}n+=P.substring(e),M.addText(n)}function f(){if(P===``)return;let e=null;if(typeof A.subLanguage==`string`){if(!t[A.subLanguage]){M.addText(P);return}e=v(A.subLanguage,P,!0,j[A.subLanguage]),j[A.subLanguage]=e._top}else e=S(P,A.subLanguage.length?A.subLanguage:null);A.relevance>0&&(F+=e.relevance),M.__addSublanguage(e._emitter,e.language)}function p(){A.subLanguage==null?d():f(),P=``}function m(e,t){e!==``&&(M.startScope(t),M.addText(e),M.endScope())}function h(e,t){let n=1,r=t.length-1;for(;n<=r;){if(!e._emit[n]){n++;continue}let r=D.classNameAliases[e[n]]||e[n],i=t[n];r?m(i,r):(P=i,d(),P=``),n++}}function g(e,t){return e.scope&&typeof e.scope==`string`&&M.openNode(D.classNameAliases[e.scope]||e.scope),e.beginScope&&(e.beginScope._wrap?(m(P,D.classNameAliases[e.beginScope._wrap]||e.beginScope._wrap),P=``):e.beginScope._multi&&(h(e.beginScope,t),P=``)),A=Object.create(e,{parent:{value:A}}),A}function _(e,t,n){let i=x(e.endRe,n);if(i){if(e[`on:end`]){let n=new r(e);e[`on:end`](t,n),n.isMatchIgnored&&(i=!1)}if(i){for(;e.endsParent&&e.parent;)e=e.parent;return e}}if(e.endsWithParent)return _(e.parent,t,n)}function y(e){return A.matcher.regexIndex===0?(P+=e[0],1):(ee=!0,0)}function b(e){let t=e[0],n=e.rule,i=new r(n),a=[n.__beforeBegin,n[`on:begin`]];for(let n of a)if(n&&(n(e,i),i.isMatchIgnored))return y(t);return n.skip?P+=t:(n.excludeBegin&&(P+=t),p(),!n.returnBegin&&!n.excludeBegin&&(P=t)),g(n,e),n.returnBegin?0:t.length}function C(e){let t=e[0],r=n.substring(e.index),i=_(A,e,r);if(!i)return Oe;let a=A;A.endScope&&A.endScope._wrap?(p(),m(t,A.endScope._wrap)):A.endScope&&A.endScope._multi?(p(),h(A.endScope,e)):a.skip?P+=t:(a.returnEnd||a.excludeEnd||(P+=t),p(),a.excludeEnd&&(P=t));do A.scope&&M.closeNode(),!A.skip&&!A.subLanguage&&(F+=A.relevance),A=A.parent;while(A!==i.parent);return i.starts&&g(i.starts,e),a.returnEnd?0:t.length}function w(){let e=[];for(let t=A;t!==D;t=t.parent)t.scope&&e.unshift(t.scope);e.forEach(e=>M.openNode(e))}let T={};function E(t,r){let a=r&&r[0];if(P+=t,a==null)return p(),0;if(T.type===`begin`&&r.type===`end`&&T.index===r.index&&a===``){if(P+=n.slice(r.index,r.index+1),!o){let t=Error(`0 width match regex (${e})`);throw t.languageName=e,t.badRule=T.rule,t}return 1}if(T=r,r.type===`begin`)return b(r);if(r.type===`illegal`&&!i){let e=Error(`Illegal lexeme "`+a+`" for mode "`+(A.scope||`<unnamed>`)+`"`);throw e.mode=A,e}else if(r.type===`end`){let e=C(r);if(e!==Oe)return e}if(r.type===`illegal`&&a===``)return P+=`
|
|
10
|
-
`,1;if(L>1e5&&L>r.index*3)throw Error(`potential infinite loop, way more iterations than matches`);return P+=a,a.length}let D=N(e);if(!D)throw he(s.replace(`{}`,e)),Error(`Unknown language: "`+e+`"`);let O=xe(D),k=``,A=a||O,j={},M=new l.__emitter(l);w();let P=``,F=0,I=0,L=0,ee=!1;try{if(D.__emitTokens)D.__emitTokens(n,M);else{for(A.matcher.considerAll();;){L++,ee?ee=!1:A.matcher.considerAll(),A.matcher.lastIndex=I;let e=A.matcher.exec(n);if(!e)break;let t=E(n.substring(I,e.index),e);I=e.index+t}E(n.substring(I))}return M.finalize(),k=M.toHTML(),{language:e,value:k,relevance:F,illegal:!1,_emitter:M,_top:A}}catch(t){if(t.message&&t.message.includes(`Illegal`))return{language:e,value:Ee(n),illegal:!0,relevance:0,_illegalBy:{message:t.message,index:I,context:n.slice(I-100,I+100),mode:t.mode,resultSoFar:k},_emitter:M};if(o)return{language:e,value:Ee(n),illegal:!1,relevance:0,errorRaised:t,_emitter:M,_top:A};throw t}}function b(e){let t={value:Ee(e),illegal:!1,relevance:0,_top:c,_emitter:new l.__emitter(l)};return t._emitter.addText(e),t}function S(e,n){n=n||l.languages||Object.keys(t);let r=b(e),i=n.filter(N).filter(F).map(t=>v(t,e,!1));i.unshift(r);let[a,o]=i.sort((e,t)=>{if(e.relevance!==t.relevance)return t.relevance-e.relevance;if(e.language&&t.language){if(N(e.language).supersetOf===t.language)return 1;if(N(t.language).supersetOf===e.language)return-1}return 0}),s=a;return s.secondBest=o,s}function C(e,t,n){let r=t&&i[t]||n;e.classList.add(`hljs`),e.classList.add(`language-${r}`)}function w(e){let t=null,n=d(e);if(u(n))return;if(R(`before:highlightElement`,{el:e,language:n}),e.dataset.highlighted){console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.",e);return}if(e.children.length>0&&(l.ignoreUnescapedHTML||(console.warn(`One of your code blocks includes unescaped HTML. This is a potentially serious security risk.`),console.warn(`https://github.com/highlightjs/highlight.js/wiki/security`),console.warn(`The element with unescaped HTML:`),console.warn(e)),l.throwUnescapedHTML))throw new Te(`One of your code blocks includes unescaped HTML.`,e.innerHTML);t=e;let r=t.textContent,i=n?p(r,{language:n,ignoreIllegals:!0}):S(r);e.innerHTML=i.value,e.dataset.highlighted=`yes`,C(e,n,i.language),e.result={language:i.language,re:i.relevance,relevance:i.relevance},i.secondBest&&(e.secondBest={language:i.secondBest.language,relevance:i.secondBest.relevance}),R(`after:highlightElement`,{el:e,result:i,text:r})}function T(e){l=De(l,e)}let E=()=>{k(),K(`10.6.0`,`initHighlighting() deprecated. Use highlightAll() now.`)};function D(){k(),K(`10.6.0`,`initHighlightingOnLoad() deprecated. Use highlightAll() now.`)}let O=!1;function k(){function e(){k()}if(document.readyState===`loading`){O||window.addEventListener(`DOMContentLoaded`,e,!1),O=!0;return}document.querySelectorAll(l.cssSelector).forEach(w)}function A(n,r){let i=null;try{i=r(e)}catch(e){if(he(`Language definition for '{}' could not be registered.`.replace(`{}`,n)),o)he(e);else throw e;i=c}i.name||=n,t[n]=i,i.rawDefinition=r.bind(null,e),i.aliases&&P(i.aliases,{languageName:n})}function j(e){delete t[e];for(let t of Object.keys(i))i[t]===e&&delete i[t]}function M(){return Object.keys(t)}function N(e){return e=(e||``).toLowerCase(),t[e]||t[i[e]]}function P(e,{languageName:t}){typeof e==`string`&&(e=[e]),e.forEach(e=>{i[e.toLowerCase()]=t})}function F(e){let t=N(e);return t&&!t.disableAutodetect}function I(e){e[`before:highlightBlock`]&&!e[`before:highlightElement`]&&(e[`before:highlightElement`]=t=>{e[`before:highlightBlock`](Object.assign({block:t.el},t))}),e[`after:highlightBlock`]&&!e[`after:highlightElement`]&&(e[`after:highlightElement`]=t=>{e[`after:highlightBlock`](Object.assign({block:t.el},t))})}function L(e){I(e),a.push(e)}function ee(e){let t=a.indexOf(e);t!==-1&&a.splice(t,1)}function R(e,t){let n=e;a.forEach(function(e){e[n]&&e[n](t)})}function te(e){return K(`10.7.0`,`highlightBlock will be removed entirely in v12.0`),K(`10.7.0`,`Please use highlightElement now.`),w(e)}Object.assign(e,{highlight:p,highlightAuto:S,highlightAll:k,highlightElement:w,highlightBlock:te,configure:T,initHighlighting:E,initHighlightingOnLoad:D,registerLanguage:A,unregisterLanguage:j,listLanguages:M,getLanguage:N,registerAliases:P,autoDetection:F,inherit:De,addPlugin:L,removePlugin:ee}),e.debugMode=function(){o=!1},e.safeMode=function(){o=!0},e.versionString=we,e.regex={concat:_,lookahead:m,either:y,optional:g,anyNumberOfTimes:h};for(let e in oe)typeof oe[e]==`object`&&n(oe[e]);return Object.assign(e,oe),e},je=Ae({});je.newInstance=()=>Ae({}),t.exports=je,je.HighlightJS=je,je.default=je}))()).default,Tb={},Eb=`hljs-`;function Db(e){let t=wb.newInstance();return e&&a(e),{highlight:n,highlightAuto:r,listLanguages:i,register:a,registerAlias:o,registered:s};function n(e,n,r){let i=r||Tb,a=typeof i.prefix==`string`?i.prefix:Eb;if(!t.getLanguage(e))throw Error("Unknown language: `"+e+"` is not registered");t.configure({__emitter:Ob,classPrefix:a});let o=t.highlight(n,{ignoreIllegals:!0,language:e});if(o.errorRaised)throw Error("Could not highlight with `Highlight.js`",{cause:o.errorRaised});let s=o._emitter.root,c=s.data;return c.language=o.language,c.relevance=o.relevance,s}function r(e,r){let a=(r||Tb).subset||i(),o=-1,s=0,c;for(;++o<a.length;){let i=a[o];if(!t.getLanguage(i))continue;let l=n(i,e,r);l.data&&l.data.relevance!==void 0&&l.data.relevance>s&&(s=l.data.relevance,c=l)}return c||{type:`root`,children:[],data:{language:void 0,relevance:s}}}function i(){return t.listLanguages()}function a(e,n){if(typeof e==`string`)t.registerLanguage(e,n);else{let n;for(n in e)Object.hasOwn(e,n)&&t.registerLanguage(n,e[n])}}function o(e,n){if(typeof e==`string`)t.registerAliases(typeof n==`string`?n:[...n],{languageName:e});else{let n;for(n in e)if(Object.hasOwn(e,n)){let r=e[n];t.registerAliases(typeof r==`string`?r:[...r],{languageName:n})}}}function s(e){return!!t.getLanguage(e)}}var Ob=class{constructor(e){this.options=e,this.root={type:`root`,children:[],data:{language:void 0,relevance:0}},this.stack=[this.root]}addText(e){if(e===``)return;let t=this.stack[this.stack.length-1],n=t.children[t.children.length-1];n&&n.type===`text`?n.value+=e:t.children.push({type:`text`,value:e})}startScope(e){this.openNode(String(e))}endScope(){this.closeNode()}__addSublanguage(e,t){let n=this.stack[this.stack.length-1],r=e.root.children;t?n.children.push({type:`element`,tagName:`span`,properties:{className:[t]},children:r}):n.children.push(...r)}openNode(e){let t=this,n=e.split(`.`).map(function(e,n){return n?e+`_`.repeat(n):t.options.classPrefix+e}),r=this.stack[this.stack.length-1],i={type:`element`,tagName:`span`,properties:{className:n},children:[]};r.children.push(i),this.stack.push(i)}closeNode(){this.stack.pop()}finalize(){}toHTML(){return``}},kb=`open-knowledge:open-ask-ai-composer`;function Ab(e=typeof window>`u`?new EventTarget:window){e.dispatchEvent(new CustomEvent(kb))}function jb(e,t=typeof window>`u`?new EventTarget:window){let n=()=>e();return t.addEventListener(kb,n),()=>t.removeEventListener(kb,n)}var Mb=e(t(((e,t)=>{(function(e){let n=`(0?\\d+|0x[a-f0-9]+)`,r={fourOctet:RegExp(`^${n}\\.${n}\\.${n}\\.${n}$`,`i`),threeOctet:RegExp(`^${n}\\.${n}\\.${n}$`,`i`),twoOctet:RegExp(`^${n}\\.${n}$`,`i`),longValue:RegExp(`^${n}$`,`i`)},i=RegExp(`^0[0-7]+$`,`i`),a=RegExp(`^0x[a-f0-9]+$`,`i`),o=`%[0-9a-z]{1,}`,s=`(?:[0-9a-f]+::?)+`,c={zoneIndex:new RegExp(o,`i`),native:RegExp(`^(::)?(${s})?([0-9a-f]+)?(::)?(${o})?$`,`i`),deprecatedTransitional:RegExp(`^(?:::)(${n}\\.${n}\\.${n}\\.${n}(${o})?)$`,`i`),transitional:RegExp(`^((?:${s})|(?:::)(?:${s})?)${n}\\.${n}\\.${n}\\.${n}(${o})?$`,`i`)};function l(e,t){if(e.indexOf(`::`)!==e.lastIndexOf(`::`))return null;let n=0,r=-1,i=(e.match(c.zoneIndex)||[])[0],a,o;for(i&&(i=i.substring(1),e=e.replace(/%.+$/,``));(r=e.indexOf(`:`,r+1))>=0;)n++;if(e.substr(0,2)===`::`&&n--,e.substr(-2,2)===`::`&&n--,n>t)return null;for(o=t-n,a=`:`;o--;)a+=`0:`;return e=e.replace(`::`,a),e[0]===`:`&&(e=e.slice(1)),e[e.length-1]===`:`&&(e=e.slice(0,-1)),t=(function(){let t=e.split(`:`),n=[];for(let e=0;e<t.length;e++)n.push(parseInt(t[e],16));return n})(),{parts:t,zoneId:i}}function u(e,t,n,r){if(e.length!==t.length)throw Error(`ipaddr: cannot match CIDR for objects with different lengths`);let i=0,a;for(;r>0;){if(a=n-r,a<0&&(a=0),e[i]>>a!==t[i]>>a)return!1;r-=n,i+=1}return!0}function d(e){if(a.test(e))return parseInt(e,16);if(e[0]===`0`&&!isNaN(parseInt(e[1],10))){if(i.test(e))return parseInt(e,8);throw Error(`ipaddr: cannot parse ${e} as octal`)}return parseInt(e,10)}function f(e,t){for(;e.length<t;)e=`0${e}`;return e}let p={};p.IPv4=(function(){function e(e){if(e.length!==4)throw Error(`ipaddr: ipv4 octet count should be 4`);let t,n;for(t=0;t<e.length;t++)if(n=e[t],!(0<=n&&n<=255))throw Error(`ipaddr: ipv4 octet should fit in 8 bits`);this.octets=e}return e.prototype.SpecialRanges={unspecified:[[new e([0,0,0,0]),8]],broadcast:[[new e([255,255,255,255]),32]],multicast:[[new e([224,0,0,0]),4]],linkLocal:[[new e([169,254,0,0]),16]],loopback:[[new e([127,0,0,0]),8]],carrierGradeNat:[[new e([100,64,0,0]),10]],private:[[new e([10,0,0,0]),8],[new e([172,16,0,0]),12],[new e([192,168,0,0]),16]],reserved:[[new e([192,0,0,0]),24],[new e([192,0,2,0]),24],[new e([192,88,99,0]),24],[new e([198,18,0,0]),15],[new e([198,51,100,0]),24],[new e([203,0,113,0]),24],[new e([240,0,0,0]),4]],as112:[[new e([192,175,48,0]),24],[new e([192,31,196,0]),24]],amt:[[new e([192,52,193,0]),24]]},e.prototype.kind=function(){return`ipv4`},e.prototype.match=function(e,t){let n;if(t===void 0&&(n=e,e=n[0],t=n[1]),e.kind()!==`ipv4`)throw Error(`ipaddr: cannot match ipv4 address with non-ipv4 one`);return u(this.octets,e.octets,8,t)},e.prototype.prefixLengthFromSubnetMask=function(){let e=0,t=!1,n={0:8,128:7,192:6,224:5,240:4,248:3,252:2,254:1,255:0},r,i,a;for(r=3;r>=0;--r)if(i=this.octets[r],i in n){if(a=n[i],t&&a!==0)return null;a!==8&&(t=!0),e+=a}else return null;return 32-e},e.prototype.range=function(){return p.subnetMatch(this,this.SpecialRanges)},e.prototype.toByteArray=function(){return this.octets.slice(0)},e.prototype.toIPv4MappedAddress=function(){return p.IPv6.parse(`::ffff:${this.toString()}`)},e.prototype.toNormalizedString=function(){return this.toString()},e.prototype.toString=function(){return this.octets.join(`.`)},e})(),p.IPv4.broadcastAddressFromCIDR=function(e){try{let t=this.parseCIDR(e),n=t[0].toByteArray(),r=this.subnetMaskFromPrefixLength(t[1]).toByteArray(),i=[],a=0;for(;a<4;)i.push(parseInt(n[a],10)|parseInt(r[a],10)^255),a++;return new this(i)}catch{throw Error(`ipaddr: the address does not have IPv4 CIDR format`)}},p.IPv4.isIPv4=function(e){return this.parser(e)!==null},p.IPv4.isValid=function(e){try{return new this(this.parser(e)),!0}catch{return!1}},p.IPv4.isValidCIDR=function(e){try{return this.parseCIDR(e),!0}catch{return!1}},p.IPv4.isValidFourPartDecimal=function(e){return!!(p.IPv4.isValid(e)&&e.match(/^(0|[1-9]\d*)(\.(0|[1-9]\d*)){3}$/))},p.IPv4.isValidCIDRFourPartDecimal=function(e){let t=e.match(/^(.+)\/(\d+)$/);return!p.IPv4.isValidCIDR(e)||!t?!1:p.IPv4.isValidFourPartDecimal(t[1])},p.IPv4.networkAddressFromCIDR=function(e){let t,n,r,i,a;try{for(t=this.parseCIDR(e),r=t[0].toByteArray(),a=this.subnetMaskFromPrefixLength(t[1]).toByteArray(),i=[],n=0;n<4;)i.push(parseInt(r[n],10)&parseInt(a[n],10)),n++;return new this(i)}catch{throw Error(`ipaddr: the address does not have IPv4 CIDR format`)}},p.IPv4.parse=function(e){let t=this.parser(e);if(t===null)throw Error(`ipaddr: string is not formatted like an IPv4 Address`);return new this(t)},p.IPv4.parseCIDR=function(e){let t;if(t=e.match(/^(.+)\/(\d+)$/)){let e=parseInt(t[2]);if(e>=0&&e<=32){let n=[this.parse(t[1]),e];return Object.defineProperty(n,`toString`,{value:function(){return this.join(`/`)}}),n}}throw Error(`ipaddr: string is not formatted like an IPv4 CIDR range`)},p.IPv4.parser=function(e){let t,n,i;if(t=e.match(r.fourOctet))return(function(){let e=t.slice(1,6),r=[];for(let t=0;t<e.length;t++)n=e[t],r.push(d(n));return r})();if(t=e.match(r.longValue)){if(i=d(t[1]),i>4294967295||i<0)throw Error(`ipaddr: address outside defined range`);return(function(){let e=[],t;for(t=0;t<=24;t+=8)e.push(i>>t&255);return e})().reverse()}else if(t=e.match(r.twoOctet))return(function(){let e=t.slice(1,4),n=[];if(i=d(e[1]),i>16777215||i<0)throw Error(`ipaddr: address outside defined range`);return n.push(d(e[0])),n.push(i>>16&255),n.push(i>>8&255),n.push(i&255),n})();else if(t=e.match(r.threeOctet))return(function(){let e=t.slice(1,5),n=[];if(i=d(e[2]),i>65535||i<0)throw Error(`ipaddr: address outside defined range`);return n.push(d(e[0])),n.push(d(e[1])),n.push(i>>8&255),n.push(i&255),n})();else return null},p.IPv4.subnetMaskFromPrefixLength=function(e){if(e=parseInt(e),e<0||e>32)throw Error(`ipaddr: invalid IPv4 prefix length`);let t=[0,0,0,0],n=0,r=Math.floor(e/8);for(;n<r;)t[n]=255,n++;return r<4&&(t[r]=2**(e%8)-1<<8-e%8),new this(t)},p.IPv6=(function(){function e(e,t){let n,r;if(e.length===16)for(this.parts=[],n=0;n<=14;n+=2)this.parts.push(e[n]<<8|e[n+1]);else if(e.length===8)this.parts=e;else throw Error(`ipaddr: ipv6 part count should be 8 or 16`);for(n=0;n<this.parts.length;n++)if(r=this.parts[n],!(0<=r&&r<=65535))throw Error(`ipaddr: ipv6 part should fit in 16 bits`);t&&(this.zoneId=t)}return e.prototype.SpecialRanges={unspecified:[new e([0,0,0,0,0,0,0,0]),128],linkLocal:[new e([65152,0,0,0,0,0,0,0]),10],multicast:[new e([65280,0,0,0,0,0,0,0]),8],loopback:[new e([0,0,0,0,0,0,0,1]),128],uniqueLocal:[new e([64512,0,0,0,0,0,0,0]),7],ipv4Mapped:[new e([0,0,0,0,0,65535,0,0]),96],deprecatedSiteLocal:[new e([65216,0,0,0,0,0,0,0]),10],discard:[new e([256,0,0,0,0,0,0,0]),64],rfc6145:[new e([0,0,0,0,65535,0,0,0]),96],rfc6052:[[new e([100,65435,0,0,0,0,0,0]),96],[new e([100,65435,1,0,0,0,0,0]),48]],"6to4":[new e([8194,0,0,0,0,0,0,0]),16],teredo:[new e([8193,0,0,0,0,0,0,0]),32],benchmarking:[new e([8193,2,0,0,0,0,0,0]),48],amt:[new e([8193,3,0,0,0,0,0,0]),32],as112v6:[[new e([8193,4,274,0,0,0,0,0]),48],[new e([9760,79,32768,0,0,0,0,0]),48]],deprecatedOrchid:[new e([8193,16,0,0,0,0,0,0]),28],orchid2:[new e([8193,32,0,0,0,0,0,0]),28],droneRemoteIdProtocolEntityTags:[new e([8193,48,0,0,0,0,0,0]),28],segmentRouting:[new e([24320,0,0,0,0,0,0,0]),16],reserved:[[new e([8193,0,0,0,0,0,0,0]),23],[new e([8193,3512,0,0,0,0,0,0]),32],[new e([16383,0,0,0,0,0,0,0]),20]]},e.prototype.isIPv4MappedAddress=function(){return this.range()===`ipv4Mapped`},e.prototype.kind=function(){return`ipv6`},e.prototype.match=function(e,t){let n;if(t===void 0&&(n=e,e=n[0],t=n[1]),e.kind()!==`ipv6`)throw Error(`ipaddr: cannot match ipv6 address with non-ipv6 one`);return u(this.parts,e.parts,16,t)},e.prototype.prefixLengthFromSubnetMask=function(){let e=0,t=!1,n={0:16,32768:15,49152:14,57344:13,61440:12,63488:11,64512:10,65024:9,65280:8,65408:7,65472:6,65504:5,65520:4,65528:3,65532:2,65534:1,65535:0},r,i;for(let a=7;a>=0;--a)if(r=this.parts[a],r in n){if(i=n[r],t&&i!==0)return null;i!==16&&(t=!0),e+=i}else return null;return 128-e},e.prototype.range=function(){return p.subnetMatch(this,this.SpecialRanges)},e.prototype.toByteArray=function(){let e,t=[],n=this.parts;for(let r=0;r<n.length;r++)e=n[r],t.push(e>>8),t.push(e&255);return t},e.prototype.toFixedLengthString=function(){let e=(function(){let e=[];for(let t=0;t<this.parts.length;t++)e.push(f(this.parts[t].toString(16),4));return e}).call(this).join(`:`),t=``;return this.zoneId&&(t=`%${this.zoneId}`),e+t},e.prototype.toIPv4Address=function(){if(!this.isIPv4MappedAddress())throw Error(`ipaddr: trying to convert a generic ipv6 address to ipv4`);let e=this.parts.slice(-2),t=e[0],n=e[1];return new p.IPv4([t>>8,t&255,n>>8,n&255])},e.prototype.toNormalizedString=function(){let e=(function(){let e=[];for(let t=0;t<this.parts.length;t++)e.push(this.parts[t].toString(16));return e}).call(this).join(`:`),t=``;return this.zoneId&&(t=`%${this.zoneId}`),e+t},e.prototype.toRFC5952String=function(){let e=/((^|:)(0(:|$)){2,})/g,t=this.toNormalizedString(),n=0,r=-1,i;for(;i=e.exec(t);)i[0].length>r&&(n=i.index,r=i[0].length);return r<0?t:`${t.substring(0,n)}::${t.substring(n+r)}`},e.prototype.toString=function(){return this.toRFC5952String()},e})(),p.IPv6.broadcastAddressFromCIDR=function(e){try{let t=this.parseCIDR(e),n=t[0].toByteArray(),r=this.subnetMaskFromPrefixLength(t[1]).toByteArray(),i=[],a=0;for(;a<16;)i.push(parseInt(n[a],10)|parseInt(r[a],10)^255),a++;return new this(i)}catch(e){throw Error(`ipaddr: the address does not have IPv6 CIDR format (${e})`)}},p.IPv6.isIPv6=function(e){return this.parser(e)!==null},p.IPv6.isValid=function(e){if(typeof e==`string`&&e.indexOf(`:`)===-1)return!1;try{let t=this.parser(e);return new this(t.parts,t.zoneId),!0}catch{return!1}},p.IPv6.isValidCIDR=function(e){if(typeof e==`string`&&e.indexOf(`:`)===-1)return!1;try{return this.parseCIDR(e),!0}catch{return!1}},p.IPv6.networkAddressFromCIDR=function(e){let t,n,r,i,a;try{for(t=this.parseCIDR(e),r=t[0].toByteArray(),a=this.subnetMaskFromPrefixLength(t[1]).toByteArray(),i=[],n=0;n<16;)i.push(parseInt(r[n],10)&parseInt(a[n],10)),n++;return new this(i)}catch(e){throw Error(`ipaddr: the address does not have IPv6 CIDR format (${e})`)}},p.IPv6.parse=function(e){let t=this.parser(e);if(t.parts===null)throw Error(`ipaddr: string is not formatted like an IPv6 Address`);return new this(t.parts,t.zoneId)},p.IPv6.parseCIDR=function(e){let t,n,r;if((n=e.match(/^(.+)\/(\d+)$/))&&(t=parseInt(n[2]),t>=0&&t<=128))return r=[this.parse(n[1]),t],Object.defineProperty(r,`toString`,{value:function(){return this.join(`/`)}}),r;throw Error(`ipaddr: string is not formatted like an IPv6 CIDR range`)},p.IPv6.parser=function(e){let t,n,r,i,a,o;if(r=e.match(c.deprecatedTransitional))return this.parser(`::ffff:${r[1]}`);if(c.native.test(e))return l(e,8);if((r=e.match(c.transitional))&&(o=r[6]||``,t=r[1],r[1].endsWith(`::`)||(t=t.slice(0,-1)),t=l(t+o,6),t.parts)){for(a=[parseInt(r[2]),parseInt(r[3]),parseInt(r[4]),parseInt(r[5])],n=0;n<a.length;n++)if(i=a[n],!(0<=i&&i<=255))return null;return t.parts.push(a[0]<<8|a[1]),t.parts.push(a[2]<<8|a[3]),{parts:t.parts,zoneId:t.zoneId}}return null},p.IPv6.subnetMaskFromPrefixLength=function(e){if(e=parseInt(e),e<0||e>128)throw Error(`ipaddr: invalid IPv6 prefix length`);let t=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],n=0,r=Math.floor(e/8);for(;n<r;)t[n]=255,n++;return r<16&&(t[r]=2**(e%8)-1<<8-e%8),new this(t)},p.fromByteArray=function(e){let t=e.length;if(t===4)return new p.IPv4(e);if(t===16)return new p.IPv6(e);throw Error(`ipaddr: the binary input is neither an IPv6 nor IPv4 address`)},p.isValid=function(e){return p.IPv6.isValid(e)||p.IPv4.isValid(e)},p.isValidCIDR=function(e){return p.IPv6.isValidCIDR(e)||p.IPv4.isValidCIDR(e)},p.parse=function(e){if(p.IPv6.isValid(e))return p.IPv6.parse(e);if(p.IPv4.isValid(e))return p.IPv4.parse(e);throw Error(`ipaddr: the address has neither IPv6 nor IPv4 format`)},p.parseCIDR=function(e){try{return p.IPv6.parseCIDR(e)}catch{try{return p.IPv4.parseCIDR(e)}catch{throw Error(`ipaddr: the address has neither IPv6 nor IPv4 CIDR format`)}}},p.process=function(e){let t=this.parse(e);return t.kind()===`ipv6`&&t.isIPv4MappedAddress()?t.toIPv4Address():t},p.subnetMatch=function(e,t,n){let r,i,a,o;for(i in n??=`unicast`,t)if(Object.prototype.hasOwnProperty.call(t,i)){for(a=t[i],a[0]&&!(a[0]instanceof Array)&&(a=[a]),r=0;r<a.length;r++)if(o=a[r],e.kind()===o[0].kind()&&e.match.apply(e,o))return i}return n},t!==void 0&&t.exports?t.exports=p:e.ipaddr=p})(e)}))(),1),Nb=new Set([`href`,`src`,`srcset`,`poster`,`formaction`,`xlink:href`]),Pb=new Set([`aria-label`,`aria-description`,`title`]),Fb=/(?:[a-zA-Z][a-zA-Z0-9+.-]*:\/\/[^\s"'<>]+|(?:javascript|vbscript|data|file|chrome-extension|moz-extension):[^\s"'<>]*)/gi,Ib=/url\s*\(\s*['"]?\s*(?:javascript|vbscript|data)\s*:/i,Lb=/\bexpression\s*\(/i,Rb=/(oklch|oklab|lab|lch)\(\s*([^)]+)\s*\)/gi,zb=`data-clipboard-omit`;function Bb(e){let t=e.trim();return t===``||tn.test(t)?!0:Cr(t)}function Vb(e){let t=e.split(`,`);for(let e of t){let t=e.trim();if(t!==``&&!Bb(t.split(/\s+/)[0]??``))return!1}return!0}function Hb(e,t){let n=!1,r=e.replace(Fb,e=>Bb(e)?e:(n=!0,`[blocked]`));return t?.reportNoChange&&!n?null:r}function Ub(e){let t=e.toLowerCase();return t.length>=3&&t.startsWith(`on`)}function Wb(e){return e.length>1e4||Ib.test(e)||Lb.test(e)?``:e}function Gb(e){let t=e.indexOf(`/`),n=(t===-1?e:e.slice(0,t)).trim(),r=t===-1?null:e.slice(t+1).trim(),i=n.split(/[\s,]+/).filter(e=>e.length>0);if(i.length!==3)return null;let a=Kb(i[0],1),o=Kb(i[1],1),s=Kb(i[2],1);if(Number.isNaN(a)||Number.isNaN(o)||Number.isNaN(s))return null;let c=null;if(r!==null){if(c=Kb(r,1),Number.isNaN(c))return null;c=Math.max(0,Math.min(1,c))}return[a,o,s,c]}function Kb(e,t){return e===`none`?0:e.endsWith(`%`)?Number.parseFloat(e.slice(0,-1))/100*t:Number.parseFloat(e)}function qb(e,t,n){let r=n*Math.PI/180;return[e,t*Math.cos(r),t*Math.sin(r)]}function Jb(e,t,n){let r=e+.3963377774*t+.2158037573*n,i=e-.1055613458*t-.0638541728*n,a=e-.0894841775*t-1.291485548*n,o=r**3,s=i**3,c=a**3;return[4.0767416621*o-3.3077115913*s+.2309699292*c,-1.2684380046*o+2.6097574011*s-.3413193965*c,-.0041960863*o-.7034186147*s+1.707614701*c]}function Yb(e){return e<=.0031308?12.92*e:1.055*e**(1/2.4)-.055}function Xb(e){return Number.isFinite(e)?Math.max(0,Math.min(255,Math.round(e*255))):0}function Zb(e,t,n,r){let i=e.toLowerCase(),a,o,s;i===`oklch`?[a,o,s]=qb(t,n,r):i===`oklab`?[a,o,s]=[t,n,r]:i===`lch`?[a,o,s]=qb(t/100,n/100,r):[a,o,s]=[t/100,n/100,r/100];let[c,l,u]=Jb(a,o,s);return[Xb(Yb(c)),Xb(Yb(l)),Xb(Yb(u))]}function Qb(e){if(e.length>1e4)return e;let t=e.toLowerCase();return!t.includes(`oklch`)&&!t.includes(`oklab`)&&!t.includes(`lab`)&&!t.includes(`lch`)?e:e.replace(Rb,(e,t,n)=>{let r=Gb(n);if(r===null)return e;let[i,a,o,s]=r,[c,l,u]=Zb(t,i,a,o);return s===null?`rgb(${c}, ${l}, ${u})`:`rgba(${c}, ${l}, ${u}, ${s})`})}var $b=new Set([`mailto`,`tel`,`sms`,`ftp`,`ftps`]);function ex(e){let t=e.trim();if(t.startsWith(`#`))return{portable:!0};if(Cr(t))return t.startsWith(`/`)?{portable:!1,reason:`server-absolute`}:{portable:!1,reason:`relative`};let n=new URL(t),r=n.protocol.slice(0,-1).toLowerCase();if($b.has(r))return{portable:!0};if(r!==`http`&&r!==`https`)return{portable:!1,reason:`other`};let i=n.hostname.toLowerCase();if(i===``)return{portable:!1,reason:`other`};let a=i.endsWith(`.`)?i.slice(0,-1):i;if(a===`localhost`||a.endsWith(`.localhost`))return{portable:!1,reason:`localhost`};let o=i.startsWith(`[`)&&i.endsWith(`]`)?i.slice(1,-1):i;return Mb.IPv4.isValid(o)?Mb.IPv4.parse(o).range()===`unicast`?{portable:!0}:{portable:!1,reason:`private-ip`}:Mb.IPv6.isValid(o)?Mb.IPv6.parse(o).range()===`unicast`?{portable:!0}:{portable:!1,reason:`private-ip`}:{portable:!0}}var tx=`application/x-openknowledge-markdown`,nx=`data-clipboard-omit`,rx=new WeakMap;function ix(e){if(!Array.isArray(e))return!1;let t=e[1];return typeof t==`object`&&!!t&&!Array.isArray(t)&&t[nx]===`true`}function ax(e){let t=rx.get(e);if(t)return t;let n={marks:new Set,nodes:new Set};for(let t of Object.values(e.marks))try{let e=t.create();ix(t.spec.toDOM?.(e,!0))&&n.marks.add(t)}catch{}for(let t of Object.values(e.nodes))try{let e=t.createAndFill();e&&ix(t.spec.toDOM?.(e))&&n.nodes.add(t)}catch{}return rx.set(e,n),n}function ox(e,t){return t.nodes.has(e.type)?!0:e.marks.some(e=>t.marks.has(e.type))}function sx(e,t){let n=[],r=!1;return e.forEach(e=>{if(ox(e,t)){r=!0;return}let i=sx(e.content,t);i===e.content?n.push(e):(r=!0,n.push(e.copy(i)))}),r?Mn.fromArray(n):e}function cx(e,t){let n=!1;return e.forEach(e=>{n||(ox(e,t)||cx(e.content,t))&&(n=!0)}),n}function lx(e,t){let n=ax(t);return n.marks.size===0&&n.nodes.size===0?!1:cx(e.content,n)}function ux(e,t){let n=0,r=t===`first`?e.firstChild:e.lastChild;for(;r&&!r.isLeaf;)n+=1,r=t===`first`?r.firstChild:r.lastChild;return n}function dx(e,t){let n=ax(t);if(n.marks.size===0&&n.nodes.size===0)return e;let r=sx(e.content,n);return r===e.content?e:new qn(r,Math.min(e.openStart,ux(r,`first`)),Math.min(e.openEnd,ux(r,`last`)))}function fx(e,t){let n=ax(t);if(n.marks.size===0&&n.nodes.size===0)return e;let r=sx(e.content,n);return r===e.content?e:e.copy(r)}function px(e,t){let n=ax(t);return n.marks.size===0&&n.nodes.size===0?e:sx(e,n)}var mx=250,hx=100;function gx(e,t){let n=performance.now()-e;n<(t.op===`paste`||t.op===`drop`?mx:hx)||console.warn(JSON.stringify({event:`clipboard-slow-op`,op:t.op,view:t.view,elapsedMs:Math.round(n),branch:t.branch,source:t.source,...t.htmlBytes==null?{}:{htmlBytes:t.htmlBytes}}))}function _x(e){console.warn(JSON.stringify({event:`clipboard-source-detected`,view:e.view,source:e.source,branch:e.branch}))}function vx(e){console.warn(JSON.stringify({event:`clipboard-html-conversion-failed`,view:e.view,stage:e.stage,source:e.source,...e.branch==null?{}:{branch:e.branch},reason:e.reason,...e.errorClass==null?{}:{errorClass:e.errorClass},...e.htmlBytes==null?{}:{htmlBytes:e.htmlBytes}}))}function yx(e){console.warn(JSON.stringify({event:`clipboard-serialize-failed`,view:e.view,kind:e.kind,reason:e.reason}))}function bx(e){console.warn(JSON.stringify({event:`clipboard-walker-fallback-fired`,descriptor:e.descriptor,view:e.view}))}function xx(e){console.warn(JSON.stringify({event:`clipboard-walker-non-portable-render-source-emitted`,descriptor:e.descriptor,view:e.view}))}function Sx(e){console.warn(JSON.stringify({event:`clipboard-walker-url-blocked`,view:e.view,attr:e.attr,reason:e.reason}))}function Cx(e){console.warn(JSON.stringify({event:`clipboard-walker-url-source-emitted`,view:e.view,tag:e.tag,class:e.class,reason:e.reason}))}function wx(e){console.warn(JSON.stringify({event:`clipboard-walker-url-classifier-failed`,view:e.view,tag:e.tag,phase:e.phase,...e.errorClass==null?{}:{errorClass:e.errorClass}}))}var Tx=new Set;function Ex(e){Tx.has(e.lucideClass)||(Tx.add(e.lucideClass),console.warn(JSON.stringify({event:`clipboard-walker-unmapped-lucide-detected`,view:e.view,lucideClass:e.lucideClass})))}function Dx(e){console.warn(JSON.stringify({event:`clipboard-chunked-insert-failed`,view:e.view,chunksCompleted:e.chunksCompleted,totalChunks:e.totalChunks,bytesWritten:e.bytesWritten,bytesRemaining:e.bytesRemaining,reason:e.reason}))}function Ox(e){if(e instanceof nn)return`HtmlPayloadTooLargeError`;if(e instanceof Jt)return`ChunkedInsertError`;if(e instanceof Error&&e.name&&e.name!==`Error`)return e.name}var kx=[{value:`plaintext`,label:`Plain text`,aliases:[`text`,`txt`,`none`]},{value:`bash`,label:`Bash`,aliases:[`sh`,`zsh`]},{value:`c`,label:`C`},{value:`cpp`,label:`C++`,aliases:[`c++`]},{value:`csharp`,label:`C#`,aliases:[`cs`]},{value:`css`,label:`CSS`},{value:`diff`,label:`Diff`,aliases:[`patch`]},{value:`go`,label:`Go`,aliases:[`golang`]},{value:`graphql`,label:`GraphQL`,aliases:[`gql`]},{value:`ini`,label:`INI`,aliases:[`toml`]},{value:`java`,label:`Java`},{value:`javascript`,label:`JavaScript`,aliases:[`js`,`jsx`,`mjs`,`cjs`]},{value:`json`,label:`JSON`,aliases:[`jsonc`]},{value:`kotlin`,label:`Kotlin`,aliases:[`kt`]},{value:`less`,label:`Less`},{value:`lua`,label:`Lua`},{value:`makefile`,label:`Makefile`,aliases:[`make`]},{value:`markdown`,label:`Markdown`,aliases:[`md`,`mdx`]},{value:`objectivec`,label:`Objective-C`,aliases:[`objc`,`obj-c`]},{value:`perl`,label:`Perl`,aliases:[`pl`]},{value:`php`,label:`PHP`},{value:`python`,label:`Python`,aliases:[`py`]},{value:`r`,label:`R`},{value:`ruby`,label:`Ruby`,aliases:[`rb`]},{value:`rust`,label:`Rust`,aliases:[`rs`]},{value:`scss`,label:`SCSS`,aliases:[`sass`]},{value:`shell`,label:`Shell session`,aliases:[`console`,`shellsession`]},{value:`sql`,label:`SQL`},{value:`swift`,label:`Swift`},{value:`typescript`,label:`TypeScript`,aliases:[`ts`,`tsx`]},{value:`xml`,label:`XML / HTML`,aliases:[`html`,`htm`,`svg`]},{value:`yaml`,label:`YAML`,aliases:[`yml`]}],Ax=(()=>{let e=new Map;for(let t of kx){e.set(t.value,t.value);for(let n of t.aliases??[])e.set(n,t.value)}return e})();function jx(e){return e?Ax.get(e.toLowerCase())??e.toLowerCase():null}var Mx=/(?:"[^"]*"|'[^']*'|[^\s"'])+/g;function Nx(e){return e?e.match(Mx)??[]:[]}function Px(e){let t=e.filter(e=>e.length>0);return t.length===0?null:t.join(` `)}function Fx(e,t){return Nx(e).includes(t)}function Ix(e,t){let n=Nx(e);return n.includes(t)||n.push(t),Px(n)}function Lx(e,t){return Px(Nx(e).filter(e=>e!==t))}var Rx=new Set([`html`,`htm`,`xml`]);function zx(e,t){return!e||!Rx.has(e.toLowerCase())?!1:Fx(t,`preview`)}var Bx=/^([a-zA-Z][a-zA-Z0-9_-]*)=(.+)$/,Vx=/^(\d+(?:\.\d+)?)(px|rem|em|vh|vw|%)?$/i;function Hx(e,t){for(let n of Nx(e)){let e=n.match(Bx);if(e&&e[1]===t)return e[2]??null}return null}function Ux(e,t,n){let r=Nx(e),i=!1,a=[];for(let e of r){let r=e.match(Bx);if(r&&r[1]===t){if(i)continue;i=!0,n!==null&&a.push(`${t}=${n}`);continue}a.push(e)}return!i&&n!==null&&a.push(`${t}=${n}`),Px(a)}function Wx(e){return Xx(e,`h`)}function Gx(e){return Xx(e,`w`)}var Kx=/\btitle=(?:"([^"]*)"|'([^']*)'|(\S+))/,qx=/\btitle=(?:"[^"]*"|'[^']*'|\S*)/g;function Jx(e){if(!e)return null;let t=e.match(Kx);return t?t[1]??t[2]??t[3]??null:null}function Yx(e,t){let n=e?e.replace(qx,``).trim():``,r=n.length>0?n.replace(/\s+/g,` `):``;if(t===null)return r.length>0?r:null;let i=`title="${t.replace(/["\r\n]/g,``)}"`;return r.length>0?`${i} ${r}`:i}function Xx(e,t){let n=Hx(e,t);if(!n)return null;let r=n.match(Vx);if(!r)return null;let i=r[1];return!i||Number.parseFloat(i)<=0?null:`${i}${r[2]?.toLowerCase()??`px`}`}function Zx(e){if(e.type.name===`codeBlock`){let t=typeof e.attrs.language==`string`?e.attrs.language:``,n=typeof e.attrs.meta==`string`?e.attrs.meta:``;if(!zx(jx(t),n))return null;let r=e.textContent,i=n?`${t} ${n}`:t,a=mn(i),o=a.repeat(mr(a,r));return{source:`${o}${i}\n${r}\n${o}`}}if(e.type.name!==`jsxComponent`)return null;let t=e.attrs.componentName,n=e.attrs.props??{};switch(t){case`Math`:return{source:`$$\n${typeof n.formula==`string`?n.formula:``}\n$$`};case`MermaidFence`:return{source:`\`\`\`mermaid\n${typeof n.chart==`string`?n.chart:``}\n\`\`\``};default:return null}}function Qx(e,t){let n=Zx(e);if(!n)return null;let r=t.createElement(`pre`);r.className=`mdx-component`;let i=t.createElement(`code`);return i.textContent=n.source,r.appendChild(i),r}var $x={note:{color:`#0969da`,bg:`#dbeafe`},tip:{color:`#1f883d`,bg:`#dcfce7`},important:{color:`#8250df`,bg:`#f3e8ff`},warning:{color:`#9a6700`,bg:`#fef3c7`},caution:{color:`#cf222e`,bg:`#fee2e2`}};function eS(e){return Object.hasOwn($x,e)?$x[e]:$x.note}function tS(e){let t=typeof e.type==`string`?e.type:`note`,n=eS(t),r=document.createElement(`aside`);if(r.setAttribute(`class`,`callout callout-${t}`),r.setAttribute(`data-callout-type`,t),r.setAttribute(`style`,`border-left: 3px solid ${n.color}; background-color: ${n.bg}; padding: 0.5rem 0.75rem; border-radius: 0.25rem;`),typeof e.title==`string`&&e.title){let t=document.createElement(`strong`);t.textContent=e.title,r.appendChild(t)}return r}function nS(e){let t=document.createElement(`details`);e.defaultOpen===!0&&t.setAttribute(`open`,``),t.setAttribute(`class`,`accordion`);let n=document.createElement(`summary`);return n.textContent=typeof e.title==`string`?e.title:`Accordion`,t.appendChild(n),t}function rS(e){let t=ex(e);return t.portable?null:t.reason}function iS(e){let t=document.createElement(`pre`);t.className=`mdx-component`;let n=document.createElement(`code`);return n.textContent=e,t.appendChild(n),t}function aS(e,t,n){if(e===``)return null;let r;try{r=rS(e)}catch(e){let n=Ox(e);return wx({view:`wysiwyg`,tag:t,phase:`classifier-throw`,...n===void 0?{}:{errorClass:n}}),null}return r===null?null:(Cx({view:`wysiwyg`,tag:t,class:`mdx-component`,reason:r}),iS(n))}function oS(e){let t=typeof e.alt==`string`?e.alt:``,n=typeof e.src==`string`?e.src:``,r=aS(n,`img`,``);if(r!==null)return r;let i=document.createElement(`img`);return n&&Bb(n)&&i.setAttribute(`src`,n),typeof e.alt==`string`&&i.setAttribute(`alt`,e.alt),i}function sS(e,t){let n=document.createElement(e);return n.setAttribute(`src`,t),n.outerHTML}function cS(e){let t=typeof e.src==`string`?e.src:``,n=aS(t,`video`,sS(`video`,t));if(n!==null)return n;let r=document.createElement(`video`);return t&&Bb(t)&&r.setAttribute(`src`,t),e.controls!==!1&&r.setAttribute(`controls`,``),r}function lS(e){let t=typeof e.src==`string`?e.src:``,n=aS(t,`audio`,sS(`audio`,t));if(n!==null)return n;let r=document.createElement(`audio`);return t&&Bb(t)&&r.setAttribute(`src`,t),e.controls!==!1&&r.setAttribute(`controls`,``),r}function uS(e){if(e.type.name===`codeBlock`)return Qx(e,document);if(e.type.name!==`jsxComponent`)return null;let t=e.attrs.componentName,n=e.attrs.props??{};switch(t){case`Callout`:case`GFMCallout`:return tS(n);case`Accordion`:case`HtmlDetailsAccordion`:return nS(n);case`img`:case`CommonMarkImage`:return oS(n);case`video`:return cS(n);case`audio`:return lS(n);case`Math`:case`MermaidFence`:return Qx(e,document);default:return null}}var dS=`color.background-color.background-image.border.border-top.border-right.border-bottom.border-left.border-color.border-width.border-style.border-radius.padding.padding-top.padding-right.padding-bottom.padding-left.margin.margin-top.margin-right.margin-bottom.margin-left.font-family.font-size.font-weight.font-style.text-decoration.text-align.line-height.list-style.list-style-type.list-style-position.vertical-align.white-space`.split(`.`),fS=new Set([`jsx-component-wrapper`,`selectedCell`,`is-empty`,`ProseMirror-selectednode`,`ProseMirror-trailingBreak`]),pS=new Set([`data-selected`,`data-has-child-selected`,`data-dragging`,`data-range-selected`,`contenteditable`,`data-pm-slice`]),mS={getComputedStyle:e=>window.getComputedStyle(e)};function hS(e,t=dS){let n=``;for(let r of t){let t=e.getPropertyValue(r);t&&(t===`initial`||t===`normal`||(n+=`${r}: ${Qb(t)}; `))}return n.trim()}function gS(e,t=fS){return e.split(/\s+/).filter(e=>e.length>0&&!t.has(e)).join(` `)||null}function _S(e,t,n){let r=!1;return e.nodesBetween(t,n,(i,a,o)=>(o===e&&(t>a||n<a+i.nodeSize)&&(r=!0),!1)),r}function vS(e,t,n=mS){let r=document.createDocumentFragment(),{from:i,to:a}=t.state.selection;return i===a||_S(t.state.doc,i,a)||t.state.doc.nodesBetween(i,a,(e,i,a)=>{if(a!==t.state.doc)return!1;let o=t.nodeDOM(i);if(o==null){bx({descriptor:e.type.name,view:`wysiwyg`});let t=uS(e);return t&&r.appendChild(t),!1}if(!(o instanceof Element)||o.getAttribute(`data-clipboard-omit`)===`true`)return!1;let s=Qx(e,document);return s===null?(r.appendChild(yS(o,n)),!1):(r.appendChild(s),xx({view:`wysiwyg`,descriptor:e.attrs.componentName??e.type.name}),!1)}),r}function yS(e,t){let n=e.cloneNode(!0);return DS(e,n,t),OS(n),xS(n),BS(e,n,t),TS(n),bS(n),n}function bS(e){let t=e.ownerDocument,n=e=>{let r=e.tagName.toUpperCase();if(!(r===`PRE`||r===`CODE`))for(let r of Array.from(e.childNodes))if(r.nodeType===Node.TEXT_NODE){let e=r.nodeValue??``;if(!e.includes(`
|
|
10
|
+
`,1;if(L>1e5&&L>r.index*3)throw Error(`potential infinite loop, way more iterations than matches`);return P+=a,a.length}let D=N(e);if(!D)throw he(s.replace(`{}`,e)),Error(`Unknown language: "`+e+`"`);let O=xe(D),k=``,A=a||O,j={},M=new l.__emitter(l);w();let P=``,F=0,I=0,L=0,ee=!1;try{if(D.__emitTokens)D.__emitTokens(n,M);else{for(A.matcher.considerAll();;){L++,ee?ee=!1:A.matcher.considerAll(),A.matcher.lastIndex=I;let e=A.matcher.exec(n);if(!e)break;let t=E(n.substring(I,e.index),e);I=e.index+t}E(n.substring(I))}return M.finalize(),k=M.toHTML(),{language:e,value:k,relevance:F,illegal:!1,_emitter:M,_top:A}}catch(t){if(t.message&&t.message.includes(`Illegal`))return{language:e,value:Ee(n),illegal:!0,relevance:0,_illegalBy:{message:t.message,index:I,context:n.slice(I-100,I+100),mode:t.mode,resultSoFar:k},_emitter:M};if(o)return{language:e,value:Ee(n),illegal:!1,relevance:0,errorRaised:t,_emitter:M,_top:A};throw t}}function b(e){let t={value:Ee(e),illegal:!1,relevance:0,_top:c,_emitter:new l.__emitter(l)};return t._emitter.addText(e),t}function S(e,n){n=n||l.languages||Object.keys(t);let r=b(e),i=n.filter(N).filter(F).map(t=>v(t,e,!1));i.unshift(r);let[a,o]=i.sort((e,t)=>{if(e.relevance!==t.relevance)return t.relevance-e.relevance;if(e.language&&t.language){if(N(e.language).supersetOf===t.language)return 1;if(N(t.language).supersetOf===e.language)return-1}return 0}),s=a;return s.secondBest=o,s}function C(e,t,n){let r=t&&i[t]||n;e.classList.add(`hljs`),e.classList.add(`language-${r}`)}function w(e){let t=null,n=d(e);if(u(n))return;if(R(`before:highlightElement`,{el:e,language:n}),e.dataset.highlighted){console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.",e);return}if(e.children.length>0&&(l.ignoreUnescapedHTML||(console.warn(`One of your code blocks includes unescaped HTML. This is a potentially serious security risk.`),console.warn(`https://github.com/highlightjs/highlight.js/wiki/security`),console.warn(`The element with unescaped HTML:`),console.warn(e)),l.throwUnescapedHTML))throw new Te(`One of your code blocks includes unescaped HTML.`,e.innerHTML);t=e;let r=t.textContent,i=n?p(r,{language:n,ignoreIllegals:!0}):S(r);e.innerHTML=i.value,e.dataset.highlighted=`yes`,C(e,n,i.language),e.result={language:i.language,re:i.relevance,relevance:i.relevance},i.secondBest&&(e.secondBest={language:i.secondBest.language,relevance:i.secondBest.relevance}),R(`after:highlightElement`,{el:e,result:i,text:r})}function T(e){l=De(l,e)}let E=()=>{k(),K(`10.6.0`,`initHighlighting() deprecated. Use highlightAll() now.`)};function D(){k(),K(`10.6.0`,`initHighlightingOnLoad() deprecated. Use highlightAll() now.`)}let O=!1;function k(){function e(){k()}if(document.readyState===`loading`){O||window.addEventListener(`DOMContentLoaded`,e,!1),O=!0;return}document.querySelectorAll(l.cssSelector).forEach(w)}function A(n,r){let i=null;try{i=r(e)}catch(e){if(he(`Language definition for '{}' could not be registered.`.replace(`{}`,n)),o)he(e);else throw e;i=c}i.name||=n,t[n]=i,i.rawDefinition=r.bind(null,e),i.aliases&&P(i.aliases,{languageName:n})}function j(e){delete t[e];for(let t of Object.keys(i))i[t]===e&&delete i[t]}function M(){return Object.keys(t)}function N(e){return e=(e||``).toLowerCase(),t[e]||t[i[e]]}function P(e,{languageName:t}){typeof e==`string`&&(e=[e]),e.forEach(e=>{i[e.toLowerCase()]=t})}function F(e){let t=N(e);return t&&!t.disableAutodetect}function I(e){e[`before:highlightBlock`]&&!e[`before:highlightElement`]&&(e[`before:highlightElement`]=t=>{e[`before:highlightBlock`](Object.assign({block:t.el},t))}),e[`after:highlightBlock`]&&!e[`after:highlightElement`]&&(e[`after:highlightElement`]=t=>{e[`after:highlightBlock`](Object.assign({block:t.el},t))})}function L(e){I(e),a.push(e)}function ee(e){let t=a.indexOf(e);t!==-1&&a.splice(t,1)}function R(e,t){let n=e;a.forEach(function(e){e[n]&&e[n](t)})}function te(e){return K(`10.7.0`,`highlightBlock will be removed entirely in v12.0`),K(`10.7.0`,`Please use highlightElement now.`),w(e)}Object.assign(e,{highlight:p,highlightAuto:S,highlightAll:k,highlightElement:w,highlightBlock:te,configure:T,initHighlighting:E,initHighlightingOnLoad:D,registerLanguage:A,unregisterLanguage:j,listLanguages:M,getLanguage:N,registerAliases:P,autoDetection:F,inherit:De,addPlugin:L,removePlugin:ee}),e.debugMode=function(){o=!1},e.safeMode=function(){o=!0},e.versionString=we,e.regex={concat:_,lookahead:m,either:y,optional:g,anyNumberOfTimes:h};for(let e in oe)typeof oe[e]==`object`&&n(oe[e]);return Object.assign(e,oe),e},je=Ae({});je.newInstance=()=>Ae({}),t.exports=je,je.HighlightJS=je,je.default=je}))()).default,Tb={},Eb=`hljs-`;function Db(e){let t=wb.newInstance();return e&&a(e),{highlight:n,highlightAuto:r,listLanguages:i,register:a,registerAlias:o,registered:s};function n(e,n,r){let i=r||Tb,a=typeof i.prefix==`string`?i.prefix:Eb;if(!t.getLanguage(e))throw Error("Unknown language: `"+e+"` is not registered");t.configure({__emitter:Ob,classPrefix:a});let o=t.highlight(n,{ignoreIllegals:!0,language:e});if(o.errorRaised)throw Error("Could not highlight with `Highlight.js`",{cause:o.errorRaised});let s=o._emitter.root,c=s.data;return c.language=o.language,c.relevance=o.relevance,s}function r(e,r){let a=(r||Tb).subset||i(),o=-1,s=0,c;for(;++o<a.length;){let i=a[o];if(!t.getLanguage(i))continue;let l=n(i,e,r);l.data&&l.data.relevance!==void 0&&l.data.relevance>s&&(s=l.data.relevance,c=l)}return c||{type:`root`,children:[],data:{language:void 0,relevance:s}}}function i(){return t.listLanguages()}function a(e,n){if(typeof e==`string`)t.registerLanguage(e,n);else{let n;for(n in e)Object.hasOwn(e,n)&&t.registerLanguage(n,e[n])}}function o(e,n){if(typeof e==`string`)t.registerAliases(typeof n==`string`?n:[...n],{languageName:e});else{let n;for(n in e)if(Object.hasOwn(e,n)){let r=e[n];t.registerAliases(typeof r==`string`?r:[...r],{languageName:n})}}}function s(e){return!!t.getLanguage(e)}}var Ob=class{constructor(e){this.options=e,this.root={type:`root`,children:[],data:{language:void 0,relevance:0}},this.stack=[this.root]}addText(e){if(e===``)return;let t=this.stack[this.stack.length-1],n=t.children[t.children.length-1];n&&n.type===`text`?n.value+=e:t.children.push({type:`text`,value:e})}startScope(e){this.openNode(String(e))}endScope(){this.closeNode()}__addSublanguage(e,t){let n=this.stack[this.stack.length-1],r=e.root.children;t?n.children.push({type:`element`,tagName:`span`,properties:{className:[t]},children:r}):n.children.push(...r)}openNode(e){let t=this,n=e.split(`.`).map(function(e,n){return n?e+`_`.repeat(n):t.options.classPrefix+e}),r=this.stack[this.stack.length-1],i={type:`element`,tagName:`span`,properties:{className:n},children:[]};r.children.push(i),this.stack.push(i)}closeNode(){this.stack.pop()}finalize(){}toHTML(){return``}},kb=`open-knowledge:open-ask-ai-composer`;function Ab(e=typeof window>`u`?new EventTarget:window){e.dispatchEvent(new CustomEvent(kb))}function jb(e,t=typeof window>`u`?new EventTarget:window){let n=()=>e();return t.addEventListener(kb,n),()=>t.removeEventListener(kb,n)}var Mb=e(t(((e,t)=>{(function(e){let n=`(0?\\d+|0x[a-f0-9]+)`,r={fourOctet:RegExp(`^${n}\\.${n}\\.${n}\\.${n}$`,`i`),threeOctet:RegExp(`^${n}\\.${n}\\.${n}$`,`i`),twoOctet:RegExp(`^${n}\\.${n}$`,`i`),longValue:RegExp(`^${n}$`,`i`)},i=RegExp(`^0[0-7]+$`,`i`),a=RegExp(`^0x[a-f0-9]+$`,`i`),o=`%[0-9a-z]{1,}`,s=`(?:[0-9a-f]+::?)+`,c={zoneIndex:new RegExp(o,`i`),native:RegExp(`^(::)?(${s})?([0-9a-f]+)?(::)?(${o})?$`,`i`),deprecatedTransitional:RegExp(`^(?:::)(${n}\\.${n}\\.${n}\\.${n}(${o})?)$`,`i`),transitional:RegExp(`^((?:${s})|(?:::)(?:${s})?)${n}\\.${n}\\.${n}\\.${n}(${o})?$`,`i`)};function l(e,t){if(e.indexOf(`::`)!==e.lastIndexOf(`::`))return null;let n=0,r=-1,i=(e.match(c.zoneIndex)||[])[0],a,o;for(i&&(i=i.substring(1),e=e.replace(/%.+$/,``));(r=e.indexOf(`:`,r+1))>=0;)n++;if(e.substr(0,2)===`::`&&n--,e.substr(-2,2)===`::`&&n--,n>t)return null;for(o=t-n,a=`:`;o--;)a+=`0:`;return e=e.replace(`::`,a),e[0]===`:`&&(e=e.slice(1)),e[e.length-1]===`:`&&(e=e.slice(0,-1)),t=(function(){let t=e.split(`:`),n=[];for(let e=0;e<t.length;e++)n.push(parseInt(t[e],16));return n})(),{parts:t,zoneId:i}}function u(e,t,n,r){if(e.length!==t.length)throw Error(`ipaddr: cannot match CIDR for objects with different lengths`);let i=0,a;for(;r>0;){if(a=n-r,a<0&&(a=0),e[i]>>a!==t[i]>>a)return!1;r-=n,i+=1}return!0}function d(e){if(a.test(e))return parseInt(e,16);if(e[0]===`0`&&!isNaN(parseInt(e[1],10))){if(i.test(e))return parseInt(e,8);throw Error(`ipaddr: cannot parse ${e} as octal`)}return parseInt(e,10)}function f(e,t){for(;e.length<t;)e=`0${e}`;return e}let p={};p.IPv4=(function(){function e(e){if(e.length!==4)throw Error(`ipaddr: ipv4 octet count should be 4`);let t,n;for(t=0;t<e.length;t++)if(n=e[t],!(0<=n&&n<=255))throw Error(`ipaddr: ipv4 octet should fit in 8 bits`);this.octets=e}return e.prototype.SpecialRanges={unspecified:[[new e([0,0,0,0]),8]],broadcast:[[new e([255,255,255,255]),32]],multicast:[[new e([224,0,0,0]),4]],linkLocal:[[new e([169,254,0,0]),16]],loopback:[[new e([127,0,0,0]),8]],carrierGradeNat:[[new e([100,64,0,0]),10]],private:[[new e([10,0,0,0]),8],[new e([172,16,0,0]),12],[new e([192,168,0,0]),16]],reserved:[[new e([192,0,0,0]),24],[new e([192,0,2,0]),24],[new e([192,88,99,0]),24],[new e([198,18,0,0]),15],[new e([198,51,100,0]),24],[new e([203,0,113,0]),24],[new e([240,0,0,0]),4]],as112:[[new e([192,175,48,0]),24],[new e([192,31,196,0]),24]],amt:[[new e([192,52,193,0]),24]]},e.prototype.kind=function(){return`ipv4`},e.prototype.match=function(e,t){let n;if(t===void 0&&(n=e,e=n[0],t=n[1]),e.kind()!==`ipv4`)throw Error(`ipaddr: cannot match ipv4 address with non-ipv4 one`);return u(this.octets,e.octets,8,t)},e.prototype.prefixLengthFromSubnetMask=function(){let e=0,t=!1,n={0:8,128:7,192:6,224:5,240:4,248:3,252:2,254:1,255:0},r,i,a;for(r=3;r>=0;--r)if(i=this.octets[r],i in n){if(a=n[i],t&&a!==0)return null;a!==8&&(t=!0),e+=a}else return null;return 32-e},e.prototype.range=function(){return p.subnetMatch(this,this.SpecialRanges)},e.prototype.toByteArray=function(){return this.octets.slice(0)},e.prototype.toIPv4MappedAddress=function(){return p.IPv6.parse(`::ffff:${this.toString()}`)},e.prototype.toNormalizedString=function(){return this.toString()},e.prototype.toString=function(){return this.octets.join(`.`)},e})(),p.IPv4.broadcastAddressFromCIDR=function(e){try{let t=this.parseCIDR(e),n=t[0].toByteArray(),r=this.subnetMaskFromPrefixLength(t[1]).toByteArray(),i=[],a=0;for(;a<4;)i.push(parseInt(n[a],10)|parseInt(r[a],10)^255),a++;return new this(i)}catch{throw Error(`ipaddr: the address does not have IPv4 CIDR format`)}},p.IPv4.isIPv4=function(e){return this.parser(e)!==null},p.IPv4.isValid=function(e){try{return new this(this.parser(e)),!0}catch{return!1}},p.IPv4.isValidCIDR=function(e){try{return this.parseCIDR(e),!0}catch{return!1}},p.IPv4.isValidFourPartDecimal=function(e){return!!(p.IPv4.isValid(e)&&e.match(/^(0|[1-9]\d*)(\.(0|[1-9]\d*)){3}$/))},p.IPv4.isValidCIDRFourPartDecimal=function(e){let t=e.match(/^(.+)\/(\d+)$/);return!p.IPv4.isValidCIDR(e)||!t?!1:p.IPv4.isValidFourPartDecimal(t[1])},p.IPv4.networkAddressFromCIDR=function(e){let t,n,r,i,a;try{for(t=this.parseCIDR(e),r=t[0].toByteArray(),a=this.subnetMaskFromPrefixLength(t[1]).toByteArray(),i=[],n=0;n<4;)i.push(parseInt(r[n],10)&parseInt(a[n],10)),n++;return new this(i)}catch{throw Error(`ipaddr: the address does not have IPv4 CIDR format`)}},p.IPv4.parse=function(e){let t=this.parser(e);if(t===null)throw Error(`ipaddr: string is not formatted like an IPv4 Address`);return new this(t)},p.IPv4.parseCIDR=function(e){let t;if(t=e.match(/^(.+)\/(\d+)$/)){let e=parseInt(t[2]);if(e>=0&&e<=32){let n=[this.parse(t[1]),e];return Object.defineProperty(n,`toString`,{value:function(){return this.join(`/`)}}),n}}throw Error(`ipaddr: string is not formatted like an IPv4 CIDR range`)},p.IPv4.parser=function(e){let t,n,i;if(t=e.match(r.fourOctet))return(function(){let e=t.slice(1,6),r=[];for(let t=0;t<e.length;t++)n=e[t],r.push(d(n));return r})();if(t=e.match(r.longValue)){if(i=d(t[1]),i>4294967295||i<0)throw Error(`ipaddr: address outside defined range`);return(function(){let e=[],t;for(t=0;t<=24;t+=8)e.push(i>>t&255);return e})().reverse()}else if(t=e.match(r.twoOctet))return(function(){let e=t.slice(1,4),n=[];if(i=d(e[1]),i>16777215||i<0)throw Error(`ipaddr: address outside defined range`);return n.push(d(e[0])),n.push(i>>16&255),n.push(i>>8&255),n.push(i&255),n})();else if(t=e.match(r.threeOctet))return(function(){let e=t.slice(1,5),n=[];if(i=d(e[2]),i>65535||i<0)throw Error(`ipaddr: address outside defined range`);return n.push(d(e[0])),n.push(d(e[1])),n.push(i>>8&255),n.push(i&255),n})();else return null},p.IPv4.subnetMaskFromPrefixLength=function(e){if(e=parseInt(e),e<0||e>32)throw Error(`ipaddr: invalid IPv4 prefix length`);let t=[0,0,0,0],n=0,r=Math.floor(e/8);for(;n<r;)t[n]=255,n++;return r<4&&(t[r]=2**(e%8)-1<<8-e%8),new this(t)},p.IPv6=(function(){function e(e,t){let n,r;if(e.length===16)for(this.parts=[],n=0;n<=14;n+=2)this.parts.push(e[n]<<8|e[n+1]);else if(e.length===8)this.parts=e;else throw Error(`ipaddr: ipv6 part count should be 8 or 16`);for(n=0;n<this.parts.length;n++)if(r=this.parts[n],!(0<=r&&r<=65535))throw Error(`ipaddr: ipv6 part should fit in 16 bits`);t&&(this.zoneId=t)}return e.prototype.SpecialRanges={unspecified:[new e([0,0,0,0,0,0,0,0]),128],linkLocal:[new e([65152,0,0,0,0,0,0,0]),10],multicast:[new e([65280,0,0,0,0,0,0,0]),8],loopback:[new e([0,0,0,0,0,0,0,1]),128],uniqueLocal:[new e([64512,0,0,0,0,0,0,0]),7],ipv4Mapped:[new e([0,0,0,0,0,65535,0,0]),96],deprecatedSiteLocal:[new e([65216,0,0,0,0,0,0,0]),10],discard:[new e([256,0,0,0,0,0,0,0]),64],rfc6145:[new e([0,0,0,0,65535,0,0,0]),96],rfc6052:[[new e([100,65435,0,0,0,0,0,0]),96],[new e([100,65435,1,0,0,0,0,0]),48]],"6to4":[new e([8194,0,0,0,0,0,0,0]),16],teredo:[new e([8193,0,0,0,0,0,0,0]),32],benchmarking:[new e([8193,2,0,0,0,0,0,0]),48],amt:[new e([8193,3,0,0,0,0,0,0]),32],as112v6:[[new e([8193,4,274,0,0,0,0,0]),48],[new e([9760,79,32768,0,0,0,0,0]),48]],deprecatedOrchid:[new e([8193,16,0,0,0,0,0,0]),28],orchid2:[new e([8193,32,0,0,0,0,0,0]),28],droneRemoteIdProtocolEntityTags:[new e([8193,48,0,0,0,0,0,0]),28],segmentRouting:[new e([24320,0,0,0,0,0,0,0]),16],reserved:[[new e([8193,0,0,0,0,0,0,0]),23],[new e([8193,3512,0,0,0,0,0,0]),32],[new e([16383,0,0,0,0,0,0,0]),20]]},e.prototype.isIPv4MappedAddress=function(){return this.range()===`ipv4Mapped`},e.prototype.kind=function(){return`ipv6`},e.prototype.match=function(e,t){let n;if(t===void 0&&(n=e,e=n[0],t=n[1]),e.kind()!==`ipv6`)throw Error(`ipaddr: cannot match ipv6 address with non-ipv6 one`);return u(this.parts,e.parts,16,t)},e.prototype.prefixLengthFromSubnetMask=function(){let e=0,t=!1,n={0:16,32768:15,49152:14,57344:13,61440:12,63488:11,64512:10,65024:9,65280:8,65408:7,65472:6,65504:5,65520:4,65528:3,65532:2,65534:1,65535:0},r,i;for(let a=7;a>=0;--a)if(r=this.parts[a],r in n){if(i=n[r],t&&i!==0)return null;i!==16&&(t=!0),e+=i}else return null;return 128-e},e.prototype.range=function(){return p.subnetMatch(this,this.SpecialRanges)},e.prototype.toByteArray=function(){let e,t=[],n=this.parts;for(let r=0;r<n.length;r++)e=n[r],t.push(e>>8),t.push(e&255);return t},e.prototype.toFixedLengthString=function(){let e=(function(){let e=[];for(let t=0;t<this.parts.length;t++)e.push(f(this.parts[t].toString(16),4));return e}).call(this).join(`:`),t=``;return this.zoneId&&(t=`%${this.zoneId}`),e+t},e.prototype.toIPv4Address=function(){if(!this.isIPv4MappedAddress())throw Error(`ipaddr: trying to convert a generic ipv6 address to ipv4`);let e=this.parts.slice(-2),t=e[0],n=e[1];return new p.IPv4([t>>8,t&255,n>>8,n&255])},e.prototype.toNormalizedString=function(){let e=(function(){let e=[];for(let t=0;t<this.parts.length;t++)e.push(this.parts[t].toString(16));return e}).call(this).join(`:`),t=``;return this.zoneId&&(t=`%${this.zoneId}`),e+t},e.prototype.toRFC5952String=function(){let e=/((^|:)(0(:|$)){2,})/g,t=this.toNormalizedString(),n=0,r=-1,i;for(;i=e.exec(t);)i[0].length>r&&(n=i.index,r=i[0].length);return r<0?t:`${t.substring(0,n)}::${t.substring(n+r)}`},e.prototype.toString=function(){return this.toRFC5952String()},e})(),p.IPv6.broadcastAddressFromCIDR=function(e){try{let t=this.parseCIDR(e),n=t[0].toByteArray(),r=this.subnetMaskFromPrefixLength(t[1]).toByteArray(),i=[],a=0;for(;a<16;)i.push(parseInt(n[a],10)|parseInt(r[a],10)^255),a++;return new this(i)}catch(e){throw Error(`ipaddr: the address does not have IPv6 CIDR format (${e})`)}},p.IPv6.isIPv6=function(e){return this.parser(e)!==null},p.IPv6.isValid=function(e){if(typeof e==`string`&&e.indexOf(`:`)===-1)return!1;try{let t=this.parser(e);return new this(t.parts,t.zoneId),!0}catch{return!1}},p.IPv6.isValidCIDR=function(e){if(typeof e==`string`&&e.indexOf(`:`)===-1)return!1;try{return this.parseCIDR(e),!0}catch{return!1}},p.IPv6.networkAddressFromCIDR=function(e){let t,n,r,i,a;try{for(t=this.parseCIDR(e),r=t[0].toByteArray(),a=this.subnetMaskFromPrefixLength(t[1]).toByteArray(),i=[],n=0;n<16;)i.push(parseInt(r[n],10)&parseInt(a[n],10)),n++;return new this(i)}catch(e){throw Error(`ipaddr: the address does not have IPv6 CIDR format (${e})`)}},p.IPv6.parse=function(e){let t=this.parser(e);if(t.parts===null)throw Error(`ipaddr: string is not formatted like an IPv6 Address`);return new this(t.parts,t.zoneId)},p.IPv6.parseCIDR=function(e){let t,n,r;if((n=e.match(/^(.+)\/(\d+)$/))&&(t=parseInt(n[2]),t>=0&&t<=128))return r=[this.parse(n[1]),t],Object.defineProperty(r,`toString`,{value:function(){return this.join(`/`)}}),r;throw Error(`ipaddr: string is not formatted like an IPv6 CIDR range`)},p.IPv6.parser=function(e){let t,n,r,i,a,o;if(r=e.match(c.deprecatedTransitional))return this.parser(`::ffff:${r[1]}`);if(c.native.test(e))return l(e,8);if((r=e.match(c.transitional))&&(o=r[6]||``,t=r[1],r[1].endsWith(`::`)||(t=t.slice(0,-1)),t=l(t+o,6),t.parts)){for(a=[parseInt(r[2]),parseInt(r[3]),parseInt(r[4]),parseInt(r[5])],n=0;n<a.length;n++)if(i=a[n],!(0<=i&&i<=255))return null;return t.parts.push(a[0]<<8|a[1]),t.parts.push(a[2]<<8|a[3]),{parts:t.parts,zoneId:t.zoneId}}return null},p.IPv6.subnetMaskFromPrefixLength=function(e){if(e=parseInt(e),e<0||e>128)throw Error(`ipaddr: invalid IPv6 prefix length`);let t=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],n=0,r=Math.floor(e/8);for(;n<r;)t[n]=255,n++;return r<16&&(t[r]=2**(e%8)-1<<8-e%8),new this(t)},p.fromByteArray=function(e){let t=e.length;if(t===4)return new p.IPv4(e);if(t===16)return new p.IPv6(e);throw Error(`ipaddr: the binary input is neither an IPv6 nor IPv4 address`)},p.isValid=function(e){return p.IPv6.isValid(e)||p.IPv4.isValid(e)},p.isValidCIDR=function(e){return p.IPv6.isValidCIDR(e)||p.IPv4.isValidCIDR(e)},p.parse=function(e){if(p.IPv6.isValid(e))return p.IPv6.parse(e);if(p.IPv4.isValid(e))return p.IPv4.parse(e);throw Error(`ipaddr: the address has neither IPv6 nor IPv4 format`)},p.parseCIDR=function(e){try{return p.IPv6.parseCIDR(e)}catch{try{return p.IPv4.parseCIDR(e)}catch{throw Error(`ipaddr: the address has neither IPv6 nor IPv4 CIDR format`)}}},p.process=function(e){let t=this.parse(e);return t.kind()===`ipv6`&&t.isIPv4MappedAddress()?t.toIPv4Address():t},p.subnetMatch=function(e,t,n){let r,i,a,o;for(i in n??=`unicast`,t)if(Object.prototype.hasOwnProperty.call(t,i)){for(a=t[i],a[0]&&!(a[0]instanceof Array)&&(a=[a]),r=0;r<a.length;r++)if(o=a[r],e.kind()===o[0].kind()&&e.match.apply(e,o))return i}return n},t!==void 0&&t.exports?t.exports=p:e.ipaddr=p})(e)}))(),1),Nb=new Set([`href`,`src`,`srcset`,`poster`,`formaction`,`xlink:href`]),Pb=new Set([`aria-label`,`aria-description`,`title`]),Fb=/(?:[a-zA-Z][a-zA-Z0-9+.-]*:\/\/[^\s"'<>]+|(?:javascript|vbscript|data|file|chrome-extension|moz-extension):[^\s"'<>]*)/gi,Ib=/url\s*\(\s*['"]?\s*(?:javascript|vbscript|data)\s*:/i,Lb=/\bexpression\s*\(/i,Rb=/(oklch|oklab|lab|lch)\(\s*([^)]+)\s*\)/gi,zb=`data-clipboard-omit`;function Bb(e){let t=e.trim();return t===``||tn.test(t)?!0:Cr(t)}function Vb(e){let t=e.split(`,`);for(let e of t){let t=e.trim();if(t!==``&&!Bb(t.split(/\s+/)[0]??``))return!1}return!0}function Hb(e,t){let n=!1,r=e.replace(Fb,e=>Bb(e)?e:(n=!0,`[blocked]`));return t?.reportNoChange&&!n?null:r}function Ub(e){let t=e.toLowerCase();return t.length>=3&&t.startsWith(`on`)}function Wb(e){return e.length>1e4||Ib.test(e)||Lb.test(e)?``:e}function Gb(e){let t=e.indexOf(`/`),n=(t===-1?e:e.slice(0,t)).trim(),r=t===-1?null:e.slice(t+1).trim(),i=n.split(/[\s,]+/).filter(e=>e.length>0);if(i.length!==3)return null;let a=Kb(i[0],1),o=Kb(i[1],1),s=Kb(i[2],1);if(Number.isNaN(a)||Number.isNaN(o)||Number.isNaN(s))return null;let c=null;if(r!==null){if(c=Kb(r,1),Number.isNaN(c))return null;c=Math.max(0,Math.min(1,c))}return[a,o,s,c]}function Kb(e,t){return e===`none`?0:e.endsWith(`%`)?Number.parseFloat(e.slice(0,-1))/100*t:Number.parseFloat(e)}function qb(e,t,n){let r=n*Math.PI/180;return[e,t*Math.cos(r),t*Math.sin(r)]}function Jb(e,t,n){let r=e+.3963377774*t+.2158037573*n,i=e-.1055613458*t-.0638541728*n,a=e-.0894841775*t-1.291485548*n,o=r**3,s=i**3,c=a**3;return[4.0767416621*o-3.3077115913*s+.2309699292*c,-1.2684380046*o+2.6097574011*s-.3413193965*c,-.0041960863*o-.7034186147*s+1.707614701*c]}function Yb(e){return e<=.0031308?12.92*e:1.055*e**(1/2.4)-.055}function Xb(e){return Number.isFinite(e)?Math.max(0,Math.min(255,Math.round(e*255))):0}function Zb(e,t,n,r){let i=e.toLowerCase(),a,o,s;i===`oklch`?[a,o,s]=qb(t,n,r):i===`oklab`?[a,o,s]=[t,n,r]:i===`lch`?[a,o,s]=qb(t/100,n/100,r):[a,o,s]=[t/100,n/100,r/100];let[c,l,u]=Jb(a,o,s);return[Xb(Yb(c)),Xb(Yb(l)),Xb(Yb(u))]}function Qb(e){if(e.length>1e4)return e;let t=e.toLowerCase();return!t.includes(`oklch`)&&!t.includes(`oklab`)&&!t.includes(`lab`)&&!t.includes(`lch`)?e:e.replace(Rb,(e,t,n)=>{let r=Gb(n);if(r===null)return e;let[i,a,o,s]=r,[c,l,u]=Zb(t,i,a,o);return s===null?`rgb(${c}, ${l}, ${u})`:`rgba(${c}, ${l}, ${u}, ${s})`})}var $b=new Set([`mailto`,`tel`,`sms`,`ftp`,`ftps`]);function ex(e){let t=e.trim();if(t.startsWith(`#`))return{portable:!0};if(Cr(t))return t.startsWith(`/`)?{portable:!1,reason:`server-absolute`}:{portable:!1,reason:`relative`};let n=new URL(t),r=n.protocol.slice(0,-1).toLowerCase();if($b.has(r))return{portable:!0};if(r!==`http`&&r!==`https`)return{portable:!1,reason:`other`};let i=n.hostname.toLowerCase();if(i===``)return{portable:!1,reason:`other`};let a=i.endsWith(`.`)?i.slice(0,-1):i;if(a===`localhost`||a.endsWith(`.localhost`))return{portable:!1,reason:`localhost`};let o=i.startsWith(`[`)&&i.endsWith(`]`)?i.slice(1,-1):i;return Mb.IPv4.isValid(o)?Mb.IPv4.parse(o).range()===`unicast`?{portable:!0}:{portable:!1,reason:`private-ip`}:Mb.IPv6.isValid(o)?Mb.IPv6.parse(o).range()===`unicast`?{portable:!0}:{portable:!1,reason:`private-ip`}:{portable:!0}}var tx=`application/x-openknowledge-markdown`,nx=`data-clipboard-omit`,rx=new WeakMap;function ix(e){if(!Array.isArray(e))return!1;let t=e[1];return typeof t==`object`&&!!t&&!Array.isArray(t)&&t[nx]===`true`}function ax(e){let t=rx.get(e);if(t)return t;let n={marks:new Set,nodes:new Set};for(let t of Object.values(e.marks))try{let e=t.create();ix(t.spec.toDOM?.(e,!0))&&n.marks.add(t)}catch{}for(let t of Object.values(e.nodes))try{let e=t.createAndFill();e&&ix(t.spec.toDOM?.(e))&&n.nodes.add(t)}catch{}return rx.set(e,n),n}function ox(e,t){return t.nodes.has(e.type)?!0:e.marks.some(e=>t.marks.has(e.type))}function sx(e,t){let n=[],r=!1;return e.forEach(e=>{if(ox(e,t)){r=!0;return}let i=sx(e.content,t);i===e.content?n.push(e):(r=!0,n.push(e.copy(i)))}),r?Mn.fromArray(n):e}function cx(e,t){let n=!1;return e.forEach(e=>{n||(ox(e,t)||cx(e.content,t))&&(n=!0)}),n}function lx(e,t){let n=ax(t);return n.marks.size===0&&n.nodes.size===0?!1:cx(e.content,n)}function ux(e,t){let n=0,r=t===`first`?e.firstChild:e.lastChild;for(;r&&!r.isLeaf;)n+=1,r=t===`first`?r.firstChild:r.lastChild;return n}function dx(e,t){let n=ax(t);if(n.marks.size===0&&n.nodes.size===0)return e;let r=sx(e.content,n);return r===e.content?e:new qn(r,Math.min(e.openStart,ux(r,`first`)),Math.min(e.openEnd,ux(r,`last`)))}function fx(e,t){let n=ax(t);if(n.marks.size===0&&n.nodes.size===0)return e;let r=sx(e.content,n);return r===e.content?e:e.copy(r)}function px(e,t){let n=ax(t);return n.marks.size===0&&n.nodes.size===0?e:sx(e,n)}var mx=250,hx=100;function gx(e,t){let n=performance.now()-e;n<(t.op===`paste`||t.op===`drop`?mx:hx)||console.warn(JSON.stringify({event:`clipboard-slow-op`,op:t.op,view:t.view,elapsedMs:Math.round(n),branch:t.branch,source:t.source,...t.htmlBytes==null?{}:{htmlBytes:t.htmlBytes}}))}function _x(e){console.warn(JSON.stringify({event:`clipboard-source-detected`,view:e.view,source:e.source,branch:e.branch}))}function vx(e){console.warn(JSON.stringify({event:`clipboard-html-conversion-failed`,view:e.view,stage:e.stage,source:e.source,...e.branch==null?{}:{branch:e.branch},reason:e.reason,...e.errorClass==null?{}:{errorClass:e.errorClass},...e.htmlBytes==null?{}:{htmlBytes:e.htmlBytes}}))}function yx(e){console.warn(JSON.stringify({event:`clipboard-serialize-failed`,view:e.view,kind:e.kind,reason:e.reason}))}function bx(e){console.warn(JSON.stringify({event:`clipboard-walker-fallback-fired`,descriptor:e.descriptor,view:e.view}))}function xx(e){console.warn(JSON.stringify({event:`clipboard-walker-non-portable-render-source-emitted`,descriptor:e.descriptor,view:e.view}))}function Sx(e){console.warn(JSON.stringify({event:`clipboard-walker-url-blocked`,view:e.view,attr:e.attr,reason:e.reason}))}function Cx(e){console.warn(JSON.stringify({event:`clipboard-walker-url-source-emitted`,view:e.view,tag:e.tag,class:e.class,reason:e.reason}))}function wx(e){console.warn(JSON.stringify({event:`clipboard-walker-url-classifier-failed`,view:e.view,tag:e.tag,phase:e.phase,...e.errorClass==null?{}:{errorClass:e.errorClass}}))}var Tx=new Set;function Ex(e){Tx.has(e.lucideClass)||(Tx.add(e.lucideClass),console.warn(JSON.stringify({event:`clipboard-walker-unmapped-lucide-detected`,view:e.view,lucideClass:e.lucideClass})))}function Dx(e){console.warn(JSON.stringify({event:`clipboard-chunked-insert-failed`,view:e.view,chunksCompleted:e.chunksCompleted,totalChunks:e.totalChunks,bytesWritten:e.bytesWritten,bytesRemaining:e.bytesRemaining,reason:e.reason}))}function Ox(e){if(e instanceof nn)return`HtmlPayloadTooLargeError`;if(e instanceof Jt)return`ChunkedInsertError`;if(e instanceof Error&&e.name&&e.name!==`Error`)return e.name}var kx=[{value:`plaintext`,label:`Plain text`,aliases:[`text`,`txt`,`none`]},{value:`bash`,label:`Bash`,aliases:[`sh`,`zsh`]},{value:`c`,label:`C`},{value:`cpp`,label:`C++`,aliases:[`c++`]},{value:`csharp`,label:`C#`,aliases:[`cs`]},{value:`css`,label:`CSS`},{value:`diff`,label:`Diff`,aliases:[`patch`]},{value:`go`,label:`Go`,aliases:[`golang`]},{value:`graphql`,label:`GraphQL`,aliases:[`gql`]},{value:`ini`,label:`INI`,aliases:[`toml`]},{value:`java`,label:`Java`},{value:`javascript`,label:`JavaScript`,aliases:[`js`,`jsx`,`mjs`,`cjs`]},{value:`json`,label:`JSON`,aliases:[`jsonc`]},{value:`kotlin`,label:`Kotlin`,aliases:[`kt`]},{value:`less`,label:`Less`},{value:`lua`,label:`Lua`},{value:`makefile`,label:`Makefile`,aliases:[`make`]},{value:`markdown`,label:`Markdown`,aliases:[`md`,`mdx`]},{value:`objectivec`,label:`Objective-C`,aliases:[`objc`,`obj-c`]},{value:`perl`,label:`Perl`,aliases:[`pl`]},{value:`php`,label:`PHP`},{value:`python`,label:`Python`,aliases:[`py`]},{value:`r`,label:`R`},{value:`ruby`,label:`Ruby`,aliases:[`rb`]},{value:`rust`,label:`Rust`,aliases:[`rs`]},{value:`scss`,label:`SCSS`,aliases:[`sass`]},{value:`shell`,label:`Shell session`,aliases:[`console`,`shellsession`]},{value:`sql`,label:`SQL`},{value:`swift`,label:`Swift`},{value:`typescript`,label:`TypeScript`,aliases:[`ts`,`tsx`]},{value:`xml`,label:`XML / HTML`,aliases:[`html`,`htm`,`svg`]},{value:`yaml`,label:`YAML`,aliases:[`yml`]}],Ax=(()=>{let e=new Map;for(let t of kx){e.set(t.value,t.value);for(let n of t.aliases??[])e.set(n,t.value)}return e})();function jx(e){return e?Ax.get(e.toLowerCase())??e.toLowerCase():null}var Mx=/(?:"[^"]*"|'[^']*'|[^\s"'])+/g;function Nx(e){return e?e.match(Mx)??[]:[]}function Px(e){let t=e.filter(e=>e.length>0);return t.length===0?null:t.join(` `)}function Fx(e,t){return Nx(e).includes(t)}function Ix(e,t){let n=Nx(e);return n.includes(t)||n.push(t),Px(n)}function Lx(e,t){return Px(Nx(e).filter(e=>e!==t))}var Rx=new Set([`html`,`htm`,`xml`]);function zx(e,t){return!e||!Rx.has(e.toLowerCase())?!1:Fx(t,`preview`)}var Bx=/^([a-zA-Z][a-zA-Z0-9_-]*)=(.+)$/,Vx=/^(\d+(?:\.\d+)?)(px|rem|em|vh|vw|%)?$/i;function Hx(e,t){for(let n of Nx(e)){let e=n.match(Bx);if(e&&e[1]===t)return e[2]??null}return null}function Ux(e,t,n){let r=Nx(e),i=!1,a=[];for(let e of r){let r=e.match(Bx);if(r&&r[1]===t){if(i)continue;i=!0,n!==null&&a.push(`${t}=${n}`);continue}a.push(e)}return!i&&n!==null&&a.push(`${t}=${n}`),Px(a)}function Wx(e){return Xx(e,`h`)}function Gx(e){return Xx(e,`w`)}var Kx=/\btitle=(?:"([^"]*)"|'([^']*)'|(\S+))/,qx=/\btitle=(?:"[^"]*"|'[^']*'|\S*)/g;function Jx(e){if(!e)return null;let t=e.match(Kx);return t?t[1]??t[2]??t[3]??null:null}function Yx(e,t){let n=e?e.replace(qx,``).trim():``,r=n.length>0?n.replace(/\s+/g,` `):``;if(t===null)return r.length>0?r:null;let i=`title="${t.replace(/["\r\n]/g,``)}"`;return r.length>0?`${i} ${r}`:i}function Xx(e,t){let n=Hx(e,t);if(!n)return null;let r=n.match(Vx);if(!r)return null;let i=r[1];return!i||Number.parseFloat(i)<=0?null:`${i}${r[2]?.toLowerCase()??`px`}`}function Zx(e){if(e.type.name===`codeBlock`){let t=typeof e.attrs.language==`string`?e.attrs.language:``,n=typeof e.attrs.meta==`string`?e.attrs.meta:``;if(!zx(jx(t),n))return null;let r=e.textContent,i=n?`${t} ${n}`:t,a=mn(i),o=a.repeat(mr(a,r));return{source:`${o}${i}\n${r}\n${o}`}}if(e.type.name!==`jsxComponent`)return null;let t=e.attrs.componentName,n=e.attrs.props??{};switch(t){case`Math`:case`DollarMath`:case`MathFence`:return{source:`$$\n${typeof n.formula==`string`?n.formula:``}\n$$`};case`MermaidFence`:return{source:`\`\`\`mermaid\n${typeof n.chart==`string`?n.chart:``}\n\`\`\``};default:return null}}function Qx(e,t){let n=Zx(e);if(!n)return null;let r=t.createElement(`pre`);r.className=`mdx-component`;let i=t.createElement(`code`);return i.textContent=n.source,r.appendChild(i),r}var $x={note:{color:`#0969da`,bg:`#dbeafe`},tip:{color:`#1f883d`,bg:`#dcfce7`},important:{color:`#8250df`,bg:`#f3e8ff`},warning:{color:`#9a6700`,bg:`#fef3c7`},caution:{color:`#cf222e`,bg:`#fee2e2`}};function eS(e){return Object.hasOwn($x,e)?$x[e]:$x.note}function tS(e){let t=typeof e.type==`string`?e.type:`note`,n=eS(t),r=document.createElement(`aside`);if(r.setAttribute(`class`,`callout callout-${t}`),r.setAttribute(`data-callout-type`,t),r.setAttribute(`style`,`border-left: 3px solid ${n.color}; background-color: ${n.bg}; padding: 0.5rem 0.75rem; border-radius: 0.25rem;`),typeof e.title==`string`&&e.title){let t=document.createElement(`strong`);t.textContent=e.title,r.appendChild(t)}return r}function nS(e){let t=document.createElement(`details`);e.defaultOpen===!0&&t.setAttribute(`open`,``),t.setAttribute(`class`,`accordion`);let n=document.createElement(`summary`);return n.textContent=typeof e.title==`string`?e.title:`Accordion`,t.appendChild(n),t}function rS(e){let t=ex(e);return t.portable?null:t.reason}function iS(e){let t=document.createElement(`pre`);t.className=`mdx-component`;let n=document.createElement(`code`);return n.textContent=e,t.appendChild(n),t}function aS(e,t,n){if(e===``)return null;let r;try{r=rS(e)}catch(e){let n=Ox(e);return wx({view:`wysiwyg`,tag:t,phase:`classifier-throw`,...n===void 0?{}:{errorClass:n}}),null}return r===null?null:(Cx({view:`wysiwyg`,tag:t,class:`mdx-component`,reason:r}),iS(n))}function oS(e){let t=typeof e.alt==`string`?e.alt:``,n=typeof e.src==`string`?e.src:``,r=aS(n,`img`,``);if(r!==null)return r;let i=document.createElement(`img`);return n&&Bb(n)&&i.setAttribute(`src`,n),typeof e.alt==`string`&&i.setAttribute(`alt`,e.alt),i}function sS(e,t){let n=document.createElement(e);return n.setAttribute(`src`,t),n.outerHTML}function cS(e){let t=typeof e.src==`string`?e.src:``,n=aS(t,`video`,sS(`video`,t));if(n!==null)return n;let r=document.createElement(`video`);return t&&Bb(t)&&r.setAttribute(`src`,t),e.controls!==!1&&r.setAttribute(`controls`,``),r}function lS(e){let t=typeof e.src==`string`?e.src:``,n=aS(t,`audio`,sS(`audio`,t));if(n!==null)return n;let r=document.createElement(`audio`);return t&&Bb(t)&&r.setAttribute(`src`,t),e.controls!==!1&&r.setAttribute(`controls`,``),r}function uS(e){if(e.type.name===`codeBlock`)return Qx(e,document);if(e.type.name!==`jsxComponent`)return null;let t=e.attrs.componentName,n=e.attrs.props??{};switch(t){case`Callout`:case`GFMCallout`:return tS(n);case`Accordion`:case`HtmlDetailsAccordion`:return nS(n);case`img`:case`CommonMarkImage`:return oS(n);case`video`:return cS(n);case`audio`:return lS(n);case`Math`:case`DollarMath`:case`MathFence`:case`MermaidFence`:return Qx(e,document);default:return null}}var dS=`color.background-color.background-image.border.border-top.border-right.border-bottom.border-left.border-color.border-width.border-style.border-radius.padding.padding-top.padding-right.padding-bottom.padding-left.margin.margin-top.margin-right.margin-bottom.margin-left.font-family.font-size.font-weight.font-style.text-decoration.text-align.line-height.list-style.list-style-type.list-style-position.vertical-align.white-space`.split(`.`),fS=new Set([`jsx-component-wrapper`,`selectedCell`,`is-empty`,`ProseMirror-selectednode`,`ProseMirror-trailingBreak`]),pS=new Set([`data-selected`,`data-has-child-selected`,`data-dragging`,`data-range-selected`,`contenteditable`,`data-pm-slice`]),mS={getComputedStyle:e=>window.getComputedStyle(e)};function hS(e,t=dS){let n=``;for(let r of t){let t=e.getPropertyValue(r);t&&(t===`initial`||t===`normal`||(n+=`${r}: ${Qb(t)}; `))}return n.trim()}function gS(e,t=fS){return e.split(/\s+/).filter(e=>e.length>0&&!t.has(e)).join(` `)||null}function _S(e,t,n){let r=!1;return e.nodesBetween(t,n,(i,a,o)=>(o===e&&(t>a||n<a+i.nodeSize)&&(r=!0),!1)),r}function vS(e,t,n=mS){let r=document.createDocumentFragment(),{from:i,to:a}=t.state.selection;return i===a||_S(t.state.doc,i,a)||t.state.doc.nodesBetween(i,a,(e,i,a)=>{if(a!==t.state.doc)return!1;let o=t.nodeDOM(i);if(o==null){bx({descriptor:e.type.name,view:`wysiwyg`});let t=uS(e);return t&&r.appendChild(t),!1}if(!(o instanceof Element)||o.getAttribute(`data-clipboard-omit`)===`true`)return!1;let s=Qx(e,document);return s===null?(r.appendChild(yS(o,n)),!1):(r.appendChild(s),xx({view:`wysiwyg`,descriptor:e.attrs.componentName??e.type.name}),!1)}),r}function yS(e,t){let n=e.cloneNode(!0);return DS(e,n,t),OS(n),xS(n),BS(e,n,t),TS(n),bS(n),n}function bS(e){let t=e.ownerDocument,n=e=>{let r=e.tagName.toUpperCase();if(!(r===`PRE`||r===`CODE`))for(let r of Array.from(e.childNodes))if(r.nodeType===Node.TEXT_NODE){let e=r.nodeValue??``;if(!e.includes(`
|
|
11
11
|
`))continue;let n=e.split(`
|
|
12
12
|
`),i=t.createDocumentFragment();for(let e=0;e<n.length;e++)e>0&&i.appendChild(t.createElement(`br`)),n[e].length>0&&i.appendChild(t.createTextNode(n[e]));r.replaceWith(i)}else r.nodeType===Node.ELEMENT_NODE&&n(r)};n(e)}function xS(e){let t=Array.from(e.querySelectorAll(`[data-component-type="math-inline"]`));for(let n of t){if(!n.parentNode)continue;let t=n.getAttribute(`data-formula`)??``,r=e.ownerDocument.createElement(`span`);r.className=`mdx-inline`,r.textContent=`$$${t}$$`,n.replaceWith(r),xx({view:`wysiwyg`,descriptor:`mathInline`})}let n=Array.from(e.querySelectorAll(`a[data-wiki-embed]`));for(let t of n){if(!t.parentNode)continue;let n=t.getAttribute(`data-target`)??``;if(!n)continue;let r=t.getAttribute(`data-alias`)||null,i=t.getAttribute(`data-anchor`)||null,a=e.ownerDocument.createElement(`span`);a.className=`mdx-inline`,a.textContent=SS(n,i,r),t.replaceWith(a),xx({view:`wysiwyg`,descriptor:`wikiLinkEmbed`})}}function SS(e,t,n){let r=e;return t&&(r+=`#${t}`),n&&(r+=`|${n}`),`![[${r}]]`}var CS={"lucide-chevron-right":`›`,"lucide-chevron-down":`⌄`,"lucide-info":`ℹ`,"lucide-lightbulb":`💡`,"lucide-message-square-warning":`❗`,"lucide-alert-triangle":`⚠`,"lucide-alert-octagon":`⛔`},wS=/(?:^|\s)(lucide-[a-z0-9-]+)(?:\s|$)/;function TS(e){let t=e.querySelectorAll(`svg`);for(let e of Array.from(t)){let t=(e.getAttribute(`class`)??``).match(wS);if(!t)continue;let n=t[1],r=CS[n];if(!r){Ex({lucideClass:n,view:`wysiwyg`});continue}let i=e.ownerDocument.createElement(`span`);i.setAttribute(`aria-hidden`,`true`),i.textContent=r,e.replaceWith(i)}}function ES(e,t){if(e.tagName.toUpperCase()!==`INPUT`)return;let n=e;n.type===`checkbox`&&(n.checked?t.setAttribute(`checked`,``):t.removeAttribute(`checked`))}function DS(e,t,n){let r=hS(n.getComputedStyle(e));if(r){let e=t.getAttribute(`style`);t.setAttribute(`style`,e?`${e}; ${r}`:r)}let i=t.getAttribute(`class`);if(i!==null){let e=gS(i);e?t.setAttribute(`class`,e):t.removeAttribute(`class`)}for(let e of Array.from(t.attributes)){if(pS.has(e.name)){t.removeAttribute(e.name);continue}if(Ub(e.name)){t.removeAttribute(e.name),Sx({attr:`on*`,reason:`event-handler`,view:`wysiwyg`});continue}if(e.name===`style`){let n=Wb(e.value);n===``?(t.removeAttribute(`style`),Sx({attr:`style`,reason:`unsafe-url-or-expression`,view:`wysiwyg`})):n!==e.value&&t.setAttribute(`style`,n);continue}if(Nb.has(e.name)){(e.name===`srcset`?Vb(e.value):Bb(e.value))||(t.removeAttribute(e.name),Sx({attr:e.name,reason:e.name===`srcset`?`srcset-candidate`:`scheme`,view:`wysiwyg`}));continue}if(Pb.has(e.name)){let n=Hb(e.value,{reportNoChange:!0});n!==null&&(t.setAttribute(e.name,n),Sx({attr:e.name,reason:`embedded-url`,view:`wysiwyg`}))}}ES(e,t);let a=Array.from(e.children),o=Array.from(t.children),s=Math.min(a.length,o.length);for(let e=0;e<s;e++){let t=a[e],r=o[e];if(t.getAttribute(`data-clipboard-omit`)===`true`){r.remove();continue}DS(t,r,n)}}function OS(e){let t=e.querySelectorAll(`span[data-wiki-link]`);for(let e of Array.from(t)){let t=e.getAttribute(`data-target`)??``;if(!t)continue;let n=Vt(e.getAttribute(`data-anchor`)),r=Vt(e.getAttribute(`data-alias`)),i=En(t,n),a=e.ownerDocument.createElement(`a`);a.setAttribute(`class`,`wiki-link`),a.setAttribute(`href`,i),a.setAttribute(`data-target`,t),a.setAttribute(`data-anchor`,n??``),a.setAttribute(`data-alias`,r??``),a.textContent=e.textContent??``,e.replaceWith(a)}}var kS=new Set([`img`,`video`,`audio`,`source`,`a`]);function AS(e){return kS.has(e)}function jS(e){return e.closest(`p`)===null?`mdx-component`:`mdx-inline`}function MS(e,t,n){if(t===`mdx-component`){let t=e.createElement(`pre`);t.className=`mdx-component`;let r=e.createElement(`code`);return r.textContent=n,t.appendChild(r),t}let r=e.createElement(`span`);return r.className=`mdx-inline`,r.textContent=n,r}function NS(e){let t=ex(e);return t.portable?null:t.reason}function PS(e){for(let t of e.split(`,`)){let e=t.trim();if(e===``)continue;let n=NS(e.split(/\s+/)[0]??``);if(n!==null)return n}return null}function FS(e,t){switch(t){case`img`:case`source`:{let t=e.getAttribute(`src`);if(t!==null){let e=NS(t);if(e!==null)return e}let n=e.getAttribute(`srcset`);if(n!==null){let e=PS(n);if(e!==null)return e}return null}case`video`:case`audio`:{let t=e.getAttribute(`src`);return t===null?null:NS(t)}case`a`:{let t=e.getAttribute(`href`);return t===null?null:NS(t)}default:return null}}function IS(e){let t=e.querySelectorAll(`source, img`);for(let e of Array.from(t)){let t=e.tagName.toLowerCase();if(!AS(t))continue;let n=FS(e,t);if(n!==null)return n}return null}function LS(e,t,n,r){let i;try{i=FS(n,r)}catch(e){let t=Ox(e);return wx({view:`wysiwyg`,tag:r,phase:`classifier-throw`,...t===void 0?{}:{errorClass:t}}),!1}return i===null?!1:zS(e,t,n,r,i)}function RS(e,t,n){let r;try{r=IS(n)}catch(e){let t=Ox(e);return wx({view:`wysiwyg`,tag:`picture`,phase:`classifier-throw`,...t===void 0?{}:{errorClass:t}}),!1}return r===null?!1:zS(e,t,n,`picture`,r)}function zS(e,t,n,r,i){let a=e.serializeElementMarkdown?e.serializeElementMarkdown(t):{kind:`no-correspondence`};switch(a.kind){case`no-correspondence`:return wx({view:`wysiwyg`,tag:r,phase:`serializer-null`}),!1;case`failed`:{let e=a.errorClass;return wx({view:`wysiwyg`,tag:r,phase:`serializer-throw`,...e===void 0?{}:{errorClass:e}}),!1}case`ok`:{let e=jS(n),t=MS(n.ownerDocument,e,a.markdown);return n.replaceWith(t),Cx({view:`wysiwyg`,tag:r,class:e,reason:i}),!0}default:return!1}}function BS(e,t,n){if(!n.serializeElementMarkdown)return;let r=t.tagName.toLowerCase();if(r===`picture`&&RS(n,e,t)||AS(r)&&LS(n,e,t,r))return;let i=Array.from(e.children),a=Array.from(t.children),o=[];for(let e of i)e.getAttribute(`data-clipboard-omit`)!==`true`&&o.push(e);let s=Math.min(o.length,a.length);for(let e=0;e<s;e++)BS(o[e],a[e],n)}function VS(e){return(t,n)=>{let r=dx(t,n.state.schema);if(n.state.selection instanceof _r)try{return HS(n.state.selection)}catch(e){yx({view:`wysiwyg`,kind:`text`,reason:`cellselection:${e?.message??`unknown`}`})}if(n.state.selection instanceof Rn&&!n.state.selection.empty)try{let t=qS(r,n.state);if(t!==r)return ZS(t,n.state.schema,e.mdManager)}catch(e){yx({view:`wysiwyg`,kind:`text`,reason:`interior:${e?.message??`unknown`}`})}try{return ZS(r,n.state.schema,e.mdManager)}catch(e){return yx({view:`wysiwyg`,kind:`text`,reason:e?.message??`unknown`}),r.content.textBetween(0,r.content.size,`
|
|
13
13
|
|