@tempots/beatui 0.54.1 → 0.54.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (120) hide show
  1. package/dist/{2019-i1LHsYdK.js → 2019-ByDeUdzE.js} +2 -2
  2. package/dist/{2019-5RIscTOv.cjs → 2019-DzVg1z5j.cjs} +1 -1
  3. package/dist/{2020-DeCezjWf.cjs → 2020-C2cAo3Kx.cjs} +1 -1
  4. package/dist/{2020-S7qY95wq.js → 2020-P72Z0RIB.js} +2 -2
  5. package/dist/{ar-BqnDsD9v.cjs → ar-128v2WAg.cjs} +1 -1
  6. package/dist/{ar-DrBp_VwJ.js → ar-jKiWO1bA.js} +1 -1
  7. package/dist/auth/index.cjs.js +1 -1
  8. package/dist/auth/index.es.js +4 -4
  9. package/dist/beatui.css +0 -5
  10. package/dist/beatui.tailwind.css +0 -5
  11. package/dist/{colors-tmKn7dR5.cjs → colors-B9fcMxa_.cjs} +1 -1
  12. package/dist/{colors-BW19rWA1.js → colors-pQZlNrwM.js} +27 -25
  13. package/dist/{de-B5oZoraI.js → de-CsZH8Z4V.js} +1 -1
  14. package/dist/{de-C_N0wtxQ.cjs → de-Doo_UynL.cjs} +1 -1
  15. package/dist/{es-JnLMDtzg.cjs → es-C6ksQm_M.cjs} +1 -1
  16. package/dist/{es-DRc5dc_G.js → es-DHzABlc2.js} +1 -1
  17. package/dist/{fa-BC16IdRL.cjs → fa-C0ZVnkuX.cjs} +1 -1
  18. package/dist/{fa-B0VDVs5B.js → fa-Rlsar6Fo.js} +1 -1
  19. package/dist/{fr-DXlfWwI6.js → fr-DzrAiW9Q.js} +1 -1
  20. package/dist/{fr-BupZ6YnU.cjs → fr-eyQiRZu8.cjs} +1 -1
  21. package/dist/{he-BX-Az8As.js → he-B3ehch8T.js} +1 -1
  22. package/dist/{he-C-aQ2yoO.cjs → he-fifXa9Ks.cjs} +1 -1
  23. package/dist/{hi-w4uL7LN1.js → hi-B90ZON10.js} +1 -1
  24. package/dist/{hi-L3y3Aedb.cjs → hi-BBbV2iwE.cjs} +1 -1
  25. package/dist/{index-DKwuTFYj.js → index-BQear_Jy.js} +3 -3
  26. package/dist/{index-CyoxPiTg.js → index-BWMybo2K.js} +1 -1
  27. package/dist/{index-CkNcU-jd.cjs → index-Be-6-fQW.cjs} +2 -2
  28. package/dist/{index-C_71zSeN.cjs → index-BwkYjXhr.cjs} +1 -1
  29. package/dist/{index-DNUXf4K4.js → index-CSv_TMiz.js} +1 -1
  30. package/dist/{index-CFOxIBGJ.cjs → index-Cj2zgGLp.cjs} +1 -1
  31. package/dist/{index-C_a29dA7.js → index-CpZh_Snx.js} +1 -1
  32. package/dist/{index-BD2yYgsi.cjs → index-CyyNsVT9.cjs} +1 -1
  33. package/dist/{index-BnQvOXw8.js → index-Kox58YHG.js} +6 -6
  34. package/dist/{index-B7gVxeO9.cjs → index-aFA1CLKZ.cjs} +1 -1
  35. package/dist/index.cjs.js +2 -2
  36. package/dist/index.es.js +23 -21
  37. package/dist/{it-CnHaoq-X.cjs → it-CEM-R_5J.cjs} +1 -1
  38. package/dist/{it-BCKQ5Tu8.js → it-WOitrlIv.js} +1 -1
  39. package/dist/{ja-DpDF4IgX.cjs → ja-CWzwG1fp.cjs} +1 -1
  40. package/dist/{ja-DC47Nkza.js → ja-jVLb-kyU.js} +1 -1
  41. package/dist/json-schema/index.cjs.js +1 -1
  42. package/dist/json-schema/index.es.js +1 -1
  43. package/dist/{ko-ejUHA0Sw.js → ko-CUpM9wfr.js} +1 -1
  44. package/dist/{ko-BMmVJHzm.cjs → ko-DV2NgunR.cjs} +1 -1
  45. package/dist/{modal-CKyUdeEz.js → modal-C4x5C70f.js} +2 -2
  46. package/dist/{modal-rou7pM0r.cjs → modal-C5xWtKaZ.cjs} +1 -1
  47. package/dist/{nl-WjgpPUel.js → nl-BFLwQeEn.js} +1 -1
  48. package/dist/{nl-viDlnQWK.cjs → nl-C_MHm9AB.cjs} +1 -1
  49. package/dist/{notice-MF7whf3_.cjs → notice-BhxWf3Dh.cjs} +1 -1
  50. package/dist/{notice-BS0d903Q.js → notice-DdYpd69I.js} +1 -1
  51. package/dist/{pl-Vrfv_fGt.cjs → pl-Dcgxv0xK.cjs} +1 -1
  52. package/dist/{pl-Cw4CYjK_.js → pl-dlo59Xei.js} +1 -1
  53. package/dist/prosemirror/index.cjs.js +1 -1
  54. package/dist/prosemirror/index.es.js +1 -1
  55. package/dist/{pt-CxQV74vS.cjs → pt-As8BblbM.cjs} +1 -1
  56. package/dist/{pt-B4Rh_ZBF.js → pt-CqkhyKon.js} +1 -1
  57. package/dist/{ru-DFHsLJ9b.js → ru-DOl7nkP-.js} +1 -1
  58. package/dist/{ru-BB3GRr_J.cjs → ru-Du4sI8M1.cjs} +1 -1
  59. package/dist/tailwind/index.cjs.js +1 -1
  60. package/dist/tailwind/index.es.js +1 -1
  61. package/dist/tailwind/preset.cjs.js +1 -1
  62. package/dist/tailwind/preset.es.js +2 -2
  63. package/dist/tailwind/vite-plugin.cjs.js +1 -1
  64. package/dist/tailwind/vite-plugin.es.js +1 -1
  65. package/dist/{toolbar-DRdm9W7H.cjs → toolbar-BnaquvB9.cjs} +1 -1
  66. package/dist/{toolbar-D2J_NkKD.js → toolbar-Czc8cSjl.js} +1 -1
  67. package/dist/{tr-Dbktyawl.js → tr-3O7PDT8q.js} +1 -1
  68. package/dist/{tr-mBiHcEl1.cjs → tr-DTLlM4Pf.cjs} +1 -1
  69. package/dist/{translations-CaTkLRHu.js → translations-B3P1v3E6.js} +2 -2
  70. package/dist/{translations-ggnrzaCG.cjs → translations-BH2Dg5AP.cjs} +1 -1
  71. package/dist/{translations-CpTeFtvW.js → translations-CsO0g7yz.js} +1 -1
  72. package/dist/{translations-h_OJS1Ut.cjs → translations-DZWe3znu.cjs} +1 -1
  73. package/dist/types/components/auth/social-login-button.d.ts +1 -1
  74. package/dist/types/components/auth/types.d.ts +3 -3
  75. package/dist/types/components/button/button.d.ts +3 -3
  76. package/dist/types/components/button/close-button.d.ts +3 -3
  77. package/dist/types/components/data/badge.d.ts +3 -3
  78. package/dist/types/components/data/icon.d.ts +1 -1
  79. package/dist/types/components/form/input/appearance-selector.d.ts +1 -1
  80. package/dist/types/components/form/input/create-temporal-input.d.ts +1 -1
  81. package/dist/types/components/form/input/duration-input.d.ts +1 -1
  82. package/dist/types/components/form/input/input-container.d.ts +1 -1
  83. package/dist/types/components/form/input/instant-input.d.ts +1 -1
  84. package/dist/types/components/form/input/nullable-duration-input.d.ts +1 -1
  85. package/dist/types/components/form/input/nullable-instant-input.d.ts +1 -1
  86. package/dist/types/components/form/input/nullable-plain-month-day-input.d.ts +1 -1
  87. package/dist/types/components/form/input/nullable-rating-input.d.ts +1 -1
  88. package/dist/types/components/form/input/nullable-zoned-date-time-input.d.ts +1 -1
  89. package/dist/types/components/form/input/plain-month-day-input.d.ts +1 -1
  90. package/dist/types/components/form/input/rating-input.d.ts +1 -1
  91. package/dist/types/components/form/input/switch.d.ts +1 -1
  92. package/dist/types/components/form/input/zoned-date-time-input.d.ts +1 -1
  93. package/dist/types/components/json-schema/validation/async-validation.d.ts +1 -1
  94. package/dist/types/components/json-schema/validation/conditional-validation.d.ts +1 -1
  95. package/dist/types/components/json-schema/validation/cross-field-validation.d.ts +1 -1
  96. package/dist/types/components/json-schema/widgets/string-controls.d.ts +1 -1
  97. package/dist/types/components/layout/action-card.d.ts +1 -1
  98. package/dist/types/components/layout/card.d.ts +1 -1
  99. package/dist/types/components/layout/sink.d.ts +1 -1
  100. package/dist/types/components/misc/notification-provider.d.ts +2 -2
  101. package/dist/types/components/misc/notification.d.ts +2 -2
  102. package/dist/types/components/monaco/monaco-editor-input.d.ts +1 -1
  103. package/dist/types/components/navigation/link/button-link.d.ts +3 -3
  104. package/dist/types/components/navigation/link/link.d.ts +1 -1
  105. package/dist/types/components/navigation/tabs/tabs.d.ts +2 -2
  106. package/dist/types/components/navigation/toolbar/toolbar.d.ts +1 -1
  107. package/dist/types/components/overlay/announcement-bar.d.ts +1 -1
  108. package/dist/types/components/overlay/ribbon.d.ts +1 -1
  109. package/dist/types/components/theme/style-utils.d.ts +2 -2
  110. package/dist/types/components/theme/types.d.ts +1 -1
  111. package/dist/types/tokens/colors.d.ts +3 -3
  112. package/dist/{ur-Cqh7AYnd.js → ur-DB8mA3fq.js} +1 -1
  113. package/dist/{ur-CZ5sgUP1.cjs → ur-DRhqXQpq.cjs} +1 -1
  114. package/dist/{utils-w_vUChhV.js → utils-CPZHwfiH.js} +15 -5
  115. package/dist/{utils-U1aNOU3o.cjs → utils-DCa_lhhW.cjs} +1 -1
  116. package/dist/{vi-Ki_Urj_E.cjs → vi-D_MzLijT.cjs} +1 -1
  117. package/dist/{vi-CLBp2oaY.js → vi-vGJhQVsV.js} +1 -1
  118. package/dist/{zh-C78OkbS0.cjs → zh-CFMBeH1A.cjs} +1 -1
  119. package/dist/{zh-CT4aGkgD.js → zh-C_OkXlxM.js} +1 -1
  120. package/package.json +1 -1
@@ -1 +1 @@
1
- "use strict";const m=require("./index-CkNcU-jd.cjs");var R={},_={},O;function H(){if(O)return _;O=1,Object.defineProperty(_,"__esModule",{value:!0}),_.dynamicAnchor=void 0;const e=m.requireCodegen(),r=m.requireNames(),n=m.requireCompile(),l=m.requireRef(),o={keyword:"$dynamicAnchor",schemaType:"string",code:i=>t(i,i.schema)};function t(i,v){const{gen:s,it:d}=i;d.schemaEnv.root.dynamicAnchors[v]=!0;const y=(0,e._)`${r.default.dynamicAnchors}${(0,e.getProperty)(v)}`,a=d.errSchemaPath==="#"?d.validateName:u(i);s.if((0,e._)`!${y}`,()=>s.assign(y,a))}_.dynamicAnchor=t;function u(i){const{schemaEnv:v,schema:s,self:d}=i.it,{root:y,baseId:a,localRefs:f,meta:p}=v.root,{schemaId:S}=d.opts,c=new n.SchemaEnv({schema:s,schemaId:S,root:y,baseId:a,localRefs:f,meta:p});return n.compileSchema.call(d,c),(0,l.getValidate)(i,c)}return _.default=o,_}var q={},C;function J(){if(C)return q;C=1,Object.defineProperty(q,"__esModule",{value:!0}),q.dynamicRef=void 0;const e=m.requireCodegen(),r=m.requireNames(),n=m.requireRef(),l={keyword:"$dynamicRef",schemaType:"string",code:t=>o(t,t.schema)};function o(t,u){const{gen:i,keyword:v,it:s}=t;if(u[0]!=="#")throw new Error(`"${v}" only supports hash fragment reference`);const d=u.slice(1);if(s.allErrors)y();else{const f=i.let("valid",!1);y(f),t.ok(f)}function y(f){if(s.schemaEnv.root.dynamicAnchors[d]){const p=i.let("_v",(0,e._)`${r.default.dynamicAnchors}${(0,e.getProperty)(d)}`);i.if(p,a(p,f),a(s.validateName,f))}else a(s.validateName,f)()}function a(f,p){return p?()=>i.block(()=>{(0,n.callRef)(t,f),i.let(p,!0)}):()=>(0,n.callRef)(t,f)}}return q.dynamicRef=o,q.default=l,q}var $={},N;function K(){if(N)return $;N=1,Object.defineProperty($,"__esModule",{value:!0});const e=H(),r=m.requireUtil(),n={keyword:"$recursiveAnchor",schemaType:"boolean",code(l){l.schema?(0,e.dynamicAnchor)(l,""):(0,r.checkStrictMode)(l.it,"$recursiveAnchor: false is ignored")}};return $.default=n,$}var b={},I;function Q(){if(I)return b;I=1,Object.defineProperty(b,"__esModule",{value:!0});const e=J(),r={keyword:"$recursiveRef",schemaType:"string",code:n=>(0,e.dynamicRef)(n,n.schema)};return b.default=r,b}var U;function W(){if(U)return R;U=1,Object.defineProperty(R,"__esModule",{value:!0});const e=H(),r=J(),n=K(),l=Q(),o=[e.default,r.default,n.default,l.default];return R.default=o,R}var P={},g={},E;function X(){if(E)return g;E=1,Object.defineProperty(g,"__esModule",{value:!0});const e=m.requireDependencies(),r={keyword:"dependentRequired",type:"object",schemaType:"object",error:e.error,code:n=>(0,e.validatePropertyDeps)(n)};return g.default=r,g}var j={},V;function Y(){if(V)return j;V=1,Object.defineProperty(j,"__esModule",{value:!0});const e=m.requireDependencies(),r={keyword:"dependentSchemas",type:"object",schemaType:"object",code:n=>(0,e.validateSchemaDeps)(n)};return j.default=r,j}var k={},L;function Z(){if(L)return k;L=1,Object.defineProperty(k,"__esModule",{value:!0});const e=m.requireUtil(),r={keyword:["maxContains","minContains"],type:"array",schemaType:"number",code({keyword:n,parentSchema:l,it:o}){l.contains===void 0&&(0,e.checkStrictMode)(o,`"${n}" without "contains" is ignored`)}};return k.default=r,k}var z;function x(){if(z)return P;z=1,Object.defineProperty(P,"__esModule",{value:!0});const e=X(),r=Y(),n=Z(),l=[e.default,r.default,n.default];return P.default=l,P}var w={},A={},B;function ee(){if(B)return A;B=1,Object.defineProperty(A,"__esModule",{value:!0});const e=m.requireCodegen(),r=m.requireUtil(),n=m.requireNames(),o={keyword:"unevaluatedProperties",type:"object",schemaType:["boolean","object"],trackErrors:!0,error:{message:"must NOT have unevaluated properties",params:({params:t})=>(0,e._)`{unevaluatedProperty: ${t.unevaluatedProperty}}`},code(t){const{gen:u,schema:i,data:v,errsCount:s,it:d}=t;if(!s)throw new Error("ajv implementation error");const{allErrors:y,props:a}=d;a instanceof e.Name?u.if((0,e._)`${a} !== true`,()=>u.forIn("key",v,c=>u.if(p(a,c),()=>f(c)))):a!==!0&&u.forIn("key",v,c=>a===void 0?f(c):u.if(S(a,c),()=>f(c))),d.props=!0,t.ok((0,e._)`${s} === ${n.default.errors}`);function f(c){if(i===!1){t.setParams({unevaluatedProperty:c}),t.error(),y||u.break();return}if(!(0,r.alwaysValidSchema)(d,i)){const h=u.name("valid");t.subschema({keyword:"unevaluatedProperties",dataProp:c,dataPropType:r.Type.Str},h),y||u.if((0,e.not)(h),()=>u.break())}}function p(c,h){return(0,e._)`!${c} || !${c}[${h}]`}function S(c,h){const T=[];for(const M in c)c[M]===!0&&T.push((0,e._)`${h} !== ${M}`);return(0,e.and)(...T)}}};return A.default=o,A}var D={},F;function re(){if(F)return D;F=1,Object.defineProperty(D,"__esModule",{value:!0});const e=m.requireCodegen(),r=m.requireUtil(),l={keyword:"unevaluatedItems",type:"array",schemaType:["boolean","object"],error:{message:({params:{len:o}})=>(0,e.str)`must NOT have more than ${o} items`,params:({params:{len:o}})=>(0,e._)`{limit: ${o}}`},code(o){const{gen:t,schema:u,data:i,it:v}=o,s=v.items||0;if(s===!0)return;const d=t.const("len",(0,e._)`${i}.length`);if(u===!1)o.setParams({len:s}),o.fail((0,e._)`${d} > ${s}`);else if(typeof u=="object"&&!(0,r.alwaysValidSchema)(v,u)){const a=t.var("valid",(0,e._)`${d} <= ${s}`);t.if((0,e.not)(a),()=>y(a,s)),o.ok(a)}v.items=!0;function y(a,f){t.forRange("i",f,d,p=>{o.subschema({keyword:"unevaluatedItems",dataProp:p,dataPropType:r.Type.Num},a),v.allErrors||t.if((0,e.not)(a),()=>t.break())})}}};return D.default=l,D}var G;function ne(){if(G)return w;G=1,Object.defineProperty(w,"__esModule",{value:!0});const e=ee(),r=re(),n=[e.default,r.default];return w.default=n,w}exports.requireDynamic=W;exports.requireNext=x;exports.requireUnevaluated=ne;
1
+ "use strict";const m=require("./index-Be-6-fQW.cjs");var R={},_={},O;function H(){if(O)return _;O=1,Object.defineProperty(_,"__esModule",{value:!0}),_.dynamicAnchor=void 0;const e=m.requireCodegen(),r=m.requireNames(),n=m.requireCompile(),l=m.requireRef(),o={keyword:"$dynamicAnchor",schemaType:"string",code:i=>t(i,i.schema)};function t(i,v){const{gen:s,it:d}=i;d.schemaEnv.root.dynamicAnchors[v]=!0;const y=(0,e._)`${r.default.dynamicAnchors}${(0,e.getProperty)(v)}`,a=d.errSchemaPath==="#"?d.validateName:u(i);s.if((0,e._)`!${y}`,()=>s.assign(y,a))}_.dynamicAnchor=t;function u(i){const{schemaEnv:v,schema:s,self:d}=i.it,{root:y,baseId:a,localRefs:f,meta:p}=v.root,{schemaId:S}=d.opts,c=new n.SchemaEnv({schema:s,schemaId:S,root:y,baseId:a,localRefs:f,meta:p});return n.compileSchema.call(d,c),(0,l.getValidate)(i,c)}return _.default=o,_}var q={},C;function J(){if(C)return q;C=1,Object.defineProperty(q,"__esModule",{value:!0}),q.dynamicRef=void 0;const e=m.requireCodegen(),r=m.requireNames(),n=m.requireRef(),l={keyword:"$dynamicRef",schemaType:"string",code:t=>o(t,t.schema)};function o(t,u){const{gen:i,keyword:v,it:s}=t;if(u[0]!=="#")throw new Error(`"${v}" only supports hash fragment reference`);const d=u.slice(1);if(s.allErrors)y();else{const f=i.let("valid",!1);y(f),t.ok(f)}function y(f){if(s.schemaEnv.root.dynamicAnchors[d]){const p=i.let("_v",(0,e._)`${r.default.dynamicAnchors}${(0,e.getProperty)(d)}`);i.if(p,a(p,f),a(s.validateName,f))}else a(s.validateName,f)()}function a(f,p){return p?()=>i.block(()=>{(0,n.callRef)(t,f),i.let(p,!0)}):()=>(0,n.callRef)(t,f)}}return q.dynamicRef=o,q.default=l,q}var $={},N;function K(){if(N)return $;N=1,Object.defineProperty($,"__esModule",{value:!0});const e=H(),r=m.requireUtil(),n={keyword:"$recursiveAnchor",schemaType:"boolean",code(l){l.schema?(0,e.dynamicAnchor)(l,""):(0,r.checkStrictMode)(l.it,"$recursiveAnchor: false is ignored")}};return $.default=n,$}var b={},I;function Q(){if(I)return b;I=1,Object.defineProperty(b,"__esModule",{value:!0});const e=J(),r={keyword:"$recursiveRef",schemaType:"string",code:n=>(0,e.dynamicRef)(n,n.schema)};return b.default=r,b}var U;function W(){if(U)return R;U=1,Object.defineProperty(R,"__esModule",{value:!0});const e=H(),r=J(),n=K(),l=Q(),o=[e.default,r.default,n.default,l.default];return R.default=o,R}var P={},g={},E;function X(){if(E)return g;E=1,Object.defineProperty(g,"__esModule",{value:!0});const e=m.requireDependencies(),r={keyword:"dependentRequired",type:"object",schemaType:"object",error:e.error,code:n=>(0,e.validatePropertyDeps)(n)};return g.default=r,g}var j={},V;function Y(){if(V)return j;V=1,Object.defineProperty(j,"__esModule",{value:!0});const e=m.requireDependencies(),r={keyword:"dependentSchemas",type:"object",schemaType:"object",code:n=>(0,e.validateSchemaDeps)(n)};return j.default=r,j}var k={},L;function Z(){if(L)return k;L=1,Object.defineProperty(k,"__esModule",{value:!0});const e=m.requireUtil(),r={keyword:["maxContains","minContains"],type:"array",schemaType:"number",code({keyword:n,parentSchema:l,it:o}){l.contains===void 0&&(0,e.checkStrictMode)(o,`"${n}" without "contains" is ignored`)}};return k.default=r,k}var z;function x(){if(z)return P;z=1,Object.defineProperty(P,"__esModule",{value:!0});const e=X(),r=Y(),n=Z(),l=[e.default,r.default,n.default];return P.default=l,P}var w={},A={},B;function ee(){if(B)return A;B=1,Object.defineProperty(A,"__esModule",{value:!0});const e=m.requireCodegen(),r=m.requireUtil(),n=m.requireNames(),o={keyword:"unevaluatedProperties",type:"object",schemaType:["boolean","object"],trackErrors:!0,error:{message:"must NOT have unevaluated properties",params:({params:t})=>(0,e._)`{unevaluatedProperty: ${t.unevaluatedProperty}}`},code(t){const{gen:u,schema:i,data:v,errsCount:s,it:d}=t;if(!s)throw new Error("ajv implementation error");const{allErrors:y,props:a}=d;a instanceof e.Name?u.if((0,e._)`${a} !== true`,()=>u.forIn("key",v,c=>u.if(p(a,c),()=>f(c)))):a!==!0&&u.forIn("key",v,c=>a===void 0?f(c):u.if(S(a,c),()=>f(c))),d.props=!0,t.ok((0,e._)`${s} === ${n.default.errors}`);function f(c){if(i===!1){t.setParams({unevaluatedProperty:c}),t.error(),y||u.break();return}if(!(0,r.alwaysValidSchema)(d,i)){const h=u.name("valid");t.subschema({keyword:"unevaluatedProperties",dataProp:c,dataPropType:r.Type.Str},h),y||u.if((0,e.not)(h),()=>u.break())}}function p(c,h){return(0,e._)`!${c} || !${c}[${h}]`}function S(c,h){const T=[];for(const M in c)c[M]===!0&&T.push((0,e._)`${h} !== ${M}`);return(0,e.and)(...T)}}};return A.default=o,A}var D={},F;function re(){if(F)return D;F=1,Object.defineProperty(D,"__esModule",{value:!0});const e=m.requireCodegen(),r=m.requireUtil(),l={keyword:"unevaluatedItems",type:"array",schemaType:["boolean","object"],error:{message:({params:{len:o}})=>(0,e.str)`must NOT have more than ${o} items`,params:({params:{len:o}})=>(0,e._)`{limit: ${o}}`},code(o){const{gen:t,schema:u,data:i,it:v}=o,s=v.items||0;if(s===!0)return;const d=t.const("len",(0,e._)`${i}.length`);if(u===!1)o.setParams({len:s}),o.fail((0,e._)`${d} > ${s}`);else if(typeof u=="object"&&!(0,r.alwaysValidSchema)(v,u)){const a=t.var("valid",(0,e._)`${d} <= ${s}`);t.if((0,e.not)(a),()=>y(a,s)),o.ok(a)}v.items=!0;function y(a,f){t.forRange("i",f,d,p=>{o.subschema({keyword:"unevaluatedItems",dataProp:p,dataPropType:r.Type.Num},a),v.allErrors||t.if((0,e.not)(a),()=>t.break())})}}};return D.default=l,D}var G;function ne(){if(G)return w;G=1,Object.defineProperty(w,"__esModule",{value:!0});const e=ee(),r=re(),n=[e.default,r.default];return w.default=n,w}exports.requireDynamic=W;exports.requireNext=x;exports.requireUnevaluated=ne;
@@ -1,4 +1,4 @@
1
- import { d as S, m as M, n as Y, o as K, p as T, q as Q } from "./index-BnQvOXw8.js";
1
+ import { d as S, m as M, n as Y, o as K, p as T, q as Q } from "./index-Kox58YHG.js";
2
2
  var R = {}, h = {}, C;
3
3
  function W() {
4
4
  if (C) return h;
@@ -1,4 +1,4 @@
1
- "use strict";const A=require("@tempots/dom"),It=require("./toolbar-DRdm9W7H.cjs"),vr=require("./translations-h_OJS1Ut.cjs"),Uo=require("./link-portal-_tiDFZqh.cjs"),Ko=require("@tempots/ui"),Zo=require("./theme-Dt6lCAvY.cjs");function Ri(t,e){return Bi(t,e)!=null}function Bi(t,e){const{from:n,$from:r,to:u,empty:i}=t.selection;if(!e)return null;if(i){if(t.storedMarks){const c=t.storedMarks.find(f=>f.type.name===e.name);if(c!=null)return c}const l=r.marks().find(c=>c.type.name===e.name);if(l!=null)return l;const a=r.nodeAfter;if(a&&a.marks){const c=a.marks.find(f=>f.type.name===e.name);if(c!=null)return c}return null}let s=null;return t.doc.nodesBetween(n,u,o=>{if(s!=null)return!1;if(o.marks){const l=o.marks.find(a=>a.type.name===e.name);if(l!=null)return s=l,!1}}),s}function ln(t,e,n){return t.map(()=>{const r=e.value,u=r.state.schema.marks[n];return Ri(r.state,u)})}function Go(t,e,n){const{$from:r}=t.selection;for(let i=r.depth;i>0;i--){const s=r.node(i);if(s.type.name===e.name)return n!=null?Object.keys(n).every(o=>s.attrs[o]===n[o]):!0}const u=t.doc.nodeAt(r.pos);return u&&u.type.name===e.name?n!=null?Object.keys(n).every(i=>u.attrs[i]===n[i]):!0:!1}function Dt(t,e,n,r){return t.map(()=>{const u=e.value,i=u.state.schema.nodes[n];return i?Go(u.state,i,r):!1})}function he({active:t,display:e,onClick:n,disabled:r,label:u,icon:i,size:s}){return A.When(e,()=>It.ToolbarButton({onClick:n,disabled:r,variant:t.map(o=>o?"filled":"light"),size:s},A.attr.title(u),vr.Icon({icon:i,size:s})))}function Yo(t,e){const n=t.state.schema.marks.link;if(n==null)return;const{from:r,to:u}=t.state.selection,i=t.state.tr.addMark(r,u,n.create({href:e,title:null}));t.dispatch(i),t.focus()}function vi(t){const{state:e}=t,{$from:n,$to:r}=e.selection;if(!zi(e))return null;let u=n.pos,i=r.pos;const s=e.doc;for(;u>0&&s.resolve(u-1).nodeAfter?.marks?.some(a=>a.type.name==="link");)u--;for(;i<s.content.size&&s.resolve(i).nodeAfter?.marks?.some(a=>a.type.name==="link");)i++;return{start:u,end:i}}function Xo(t,e){const n=t.state.schema.marks.link;if(n==null)return;const r=vi(t);if(r==null)return;const{start:u,end:i}=r,s=t.state.tr.removeMark(u,i,n).addMark(u,i,n.create({href:e,title:null}));t.dispatch(s)}function Qo(t){const e=t.state.schema.marks.link;if(e==null)return;const n=vi(t);if(n==null)return;const{start:r,end:u}=n,i=t.state.tr.removeMark(r,u,e);t.dispatch(i),t.focus()}function zi(t){return Ri(t,t.schema.marks.link)}function el({stateUpdate:t,view:e,isReadOnly:n,label:r,linkUrlPlaceholder:u,size:i}){const s=A.prop(null);s.on(l=>{l!=null&&Xo(e.value,l)});const o=t.on(()=>{const l=Bi(e.value.state,e.value.state.schema.marks.link);l!=null?s.set(l.attrs.href??""):s.set(null)});return A.Fragment(A.OnDispose(o),It.ToolbarGroup(he({display:A.signal(!0),active:ln(t,e,"link"),disabled:n,label:r,icon:"mdi:link-variant",size:i,onClick:()=>{const l=e.value.state;if(zi(l))Qo(e.value),s.set(null);else{const a="";Yo(e.value,a),s.set(a)}}}),A.Ensure(s,l=>vr.TextInput({value:l,autofocus:!0,onInput:s.set,placeholder:u,size:i}))),A.Ensure(s,l=>It.ToolbarButton({disabled:l.map(a=>a.trim()===""),variant:"text",onClick:()=>{const a=s.value;a&&window.open(a,"_blank")},size:i},"go")))}function tn({display:t},...e){return A.When(A.computedOf(...t)((...n)=>n.some(Boolean)),()=>It.ToolbarGroup(...e))}function Pi({view:t,stateUpdate:e,features:n,readOnly:r=A.signal(!1),size:u="sm"}){return A.Ensure(t,i=>A.Use(vr.BeatUII18n,s=>{const o=s.$.prosemirror,l=i;return It.Toolbar(tn({display:[n.$.bold,n.$.italic,n.$.code]},he({active:ln(e,l,"strong"),display:n.$.bold,onClick:()=>qn(l.value,"strong"),disabled:r,label:o.$.bold,icon:"mdi:format-bold",size:u}),he({active:ln(e,l,"em"),display:n.$.italic,onClick:()=>qn(l.value,"em"),disabled:r,label:o.$.italic,icon:"mdi:format-italic",size:u}),he({active:ln(e,l,"code"),display:n.$.code,onClick:()=>qn(l.value,"code"),disabled:r,label:o.$.code,icon:"mdi:code-tags",size:u})),tn({display:[n.$.headings]},A.Repeat(n.$.headerLevels.map(a=>Math.min(Math.max(a,1),6)),({counter:a})=>he({active:Dt(e,l,"heading",{level:a}),display:n.$.headings,onClick:()=>tl(l.value,a),disabled:r,label:o.map(c=>c.heading(a)),icon:`mdi:format-header-${a}`,size:u}))),tn({display:[n.$.bulletList,n.$.orderedList]},he({active:Dt(e,l,"bullet_list"),display:n.$.bulletList,onClick:()=>cu(l.value,"bullet_list"),disabled:r,label:o.$.bulletList,icon:"mdi:format-list-bulleted",size:u}),he({active:Dt(e,l,"ordered_list"),display:n.$.orderedList,onClick:()=>cu(l.value,"ordered_list"),disabled:r,label:o.$.orderedList,icon:"mdi:format-list-numbered",size:u})),tn({display:[n.$.blockquote,n.$.codeBlock,n.$.horizontalRule]},he({active:Dt(e,l,"blockquote"),display:n.$.blockquote,onClick:()=>nl(l.value),disabled:r,label:o.$.blockquote,icon:"mdi:format-quote-close",size:u}),he({active:Dt(e,l,"code_block"),display:n.$.codeBlock,onClick:()=>rl(l.value),disabled:r,label:o.$.codeBlock,icon:"mdi:code-braces",size:u}),he({active:A.signal(!1),display:n.$.horizontalRule,onClick:()=>ul(l.value),disabled:r,label:o.$.horizontalRule,icon:"mdi:minus",size:u})),A.When(n.$.links,()=>el({stateUpdate:e,view:l,isReadOnly:r,label:o.$.link,linkUrlPlaceholder:o.$.linkUrlPlaceholder,size:u})))}))}async function qn(t,e){const{toggleMark:n}=await Promise.resolve().then(()=>zn),r=t.state.schema.marks[e];r!=null&&(n(r)(t.state,t.dispatch),t.focus())}async function tl(t,e){const{setBlockType:n}=await Promise.resolve().then(()=>zn),r=t.state.schema.nodes.heading;r!=null&&(n(r,{level:e})(t.state,t.dispatch),t.focus())}async function cu(t,e){const{wrapInList:n,liftListItem:r}=await Promise.resolve().then(()=>require("./index-B7gVxeO9.cjs")),u=t.state.schema.nodes[e],i=t.state.schema.nodes.list_item;if(u==null||i==null)return;const{state:s}=t,{$from:o}=s.selection;let l=null;for(let a=o.depth;a>0;a--){const c=o.node(a);if(c.type.name==="bullet_list"||c.type.name==="ordered_list"){l=c.type.name;break}}l===e?r(i)(s,t.dispatch):l!=null?r(i)(t.state,t.dispatch)&&n(u)(t.state,t.dispatch):n(u)(s,t.dispatch),t.focus()}async function nl(t){const{wrapIn:e,lift:n}=await Promise.resolve().then(()=>zn),r=t.state.schema.nodes.blockquote;if(r==null)return;const{state:u}=t,{$from:i}=u.selection;let s=!1;for(let o=i.depth;o>0;o--)if(i.node(o).type.name==="blockquote"){s=!0;break}s?n(u,t.dispatch):e(r)(u,t.dispatch),t.focus()}async function rl(t){const{setBlockType:e}=await Promise.resolve().then(()=>zn),n=t.state.schema.nodes.code_block,r=t.state.schema.nodes.paragraph;if(n==null||r==null)return;const{state:u}=t,{$from:i}=u.selection;let s=!1;for(let o=i.depth;o>0;o--)if(i.node(o).type.name==="code_block"){s=!0;break}s?e(r)(u,t.dispatch):e(n)(u,t.dispatch),t.focus()}function ul(t){const e=t.state.schema.nodes.horizontal_rule;if(e!=null){const n=t.state.tr.replaceSelectionWith(e.create());t.dispatch(n),t.focus()}}function q(t){this.content=t}q.prototype={constructor:q,find:function(t){for(var e=0;e<this.content.length;e+=2)if(this.content[e]===t)return e;return-1},get:function(t){var e=this.find(t);return e==-1?void 0:this.content[e+1]},update:function(t,e,n){var r=n&&n!=t?this.remove(n):this,u=r.find(t),i=r.content.slice();return u==-1?i.push(n||t,e):(i[u+1]=e,n&&(i[u]=n)),new q(i)},remove:function(t){var e=this.find(t);if(e==-1)return this;var n=this.content.slice();return n.splice(e,2),new q(n)},addToStart:function(t,e){return new q([t,e].concat(this.remove(t).content))},addToEnd:function(t,e){var n=this.remove(t).content.slice();return n.push(t,e),new q(n)},addBefore:function(t,e,n){var r=this.remove(e),u=r.content.slice(),i=r.find(t);return u.splice(i==-1?u.length:i,0,e,n),new q(u)},forEach:function(t){for(var e=0;e<this.content.length;e+=2)t(this.content[e],this.content[e+1])},prepend:function(t){return t=q.from(t),t.size?new q(t.content.concat(this.subtract(t).content)):this},append:function(t){return t=q.from(t),t.size?new q(this.subtract(t).content.concat(t.content)):this},subtract:function(t){var e=this;t=q.from(t);for(var n=0;n<t.content.length;n+=2)e=e.remove(t.content[n]);return e},toObject:function(){var t={};return this.forEach(function(e,n){t[e]=n}),t},get size(){return this.content.length>>1}};q.from=function(t){if(t instanceof q)return t;var e=[];if(t)for(var n in t)e.push(n,t[n]);return new q(e)};function Li(t,e,n){for(let r=0;;r++){if(r==t.childCount||r==e.childCount)return t.childCount==e.childCount?null:n;let u=t.child(r),i=e.child(r);if(u==i){n+=u.nodeSize;continue}if(!u.sameMarkup(i))return n;if(u.isText&&u.text!=i.text){for(let s=0;u.text[s]==i.text[s];s++)n++;return n}if(u.content.size||i.content.size){let s=Li(u.content,i.content,n+1);if(s!=null)return s}n+=u.nodeSize}}function qi(t,e,n,r){for(let u=t.childCount,i=e.childCount;;){if(u==0||i==0)return u==i?null:{a:n,b:r};let s=t.child(--u),o=e.child(--i),l=s.nodeSize;if(s==o){n-=l,r-=l;continue}if(!s.sameMarkup(o))return{a:n,b:r};if(s.isText&&s.text!=o.text){let a=0,c=Math.min(s.text.length,o.text.length);for(;a<c&&s.text[s.text.length-a-1]==o.text[o.text.length-a-1];)a++,n--,r--;return{a:n,b:r}}if(s.content.size||o.content.size){let a=qi(s.content,o.content,n-1,r-1);if(a)return a}n-=l,r-=l}}class x{constructor(e,n){if(this.content=e,this.size=n||0,n==null)for(let r=0;r<e.length;r++)this.size+=e[r].nodeSize}nodesBetween(e,n,r,u=0,i){for(let s=0,o=0;o<n;s++){let l=this.content[s],a=o+l.nodeSize;if(a>e&&r(l,u+o,i||null,s)!==!1&&l.content.size){let c=o+1;l.nodesBetween(Math.max(0,e-c),Math.min(l.content.size,n-c),r,u+c)}o=a}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,n,r,u){let i="",s=!0;return this.nodesBetween(e,n,(o,l)=>{let a=o.isText?o.text.slice(Math.max(e,l)-l,n-l):o.isLeaf?u?typeof u=="function"?u(o):u:o.type.spec.leafText?o.type.spec.leafText(o):"":"";o.isBlock&&(o.isLeaf&&a||o.isTextblock)&&r&&(s?s=!1:i+=r),i+=a},0),i}append(e){if(!e.size)return this;if(!this.size)return e;let n=this.lastChild,r=e.firstChild,u=this.content.slice(),i=0;for(n.isText&&n.sameMarkup(r)&&(u[u.length-1]=n.withText(n.text+r.text),i=1);i<e.content.length;i++)u.push(e.content[i]);return new x(u,this.size+e.size)}cut(e,n=this.size){if(e==0&&n==this.size)return this;let r=[],u=0;if(n>e)for(let i=0,s=0;s<n;i++){let o=this.content[i],l=s+o.nodeSize;l>e&&((s<e||l>n)&&(o.isText?o=o.cut(Math.max(0,e-s),Math.min(o.text.length,n-s)):o=o.cut(Math.max(0,e-s-1),Math.min(o.content.size,n-s-1))),r.push(o),u+=o.nodeSize),s=l}return new x(r,u)}cutByIndex(e,n){return e==n?x.empty:e==0&&n==this.content.length?this:new x(this.content.slice(e,n))}replaceChild(e,n){let r=this.content[e];if(r==n)return this;let u=this.content.slice(),i=this.size+n.nodeSize-r.nodeSize;return u[e]=n,new x(u,i)}addToStart(e){return new x([e].concat(this.content),this.size+e.nodeSize)}addToEnd(e){return new x(this.content.concat(e),this.size+e.nodeSize)}eq(e){if(this.content.length!=e.content.length)return!1;for(let n=0;n<this.content.length;n++)if(!this.content[n].eq(e.content[n]))return!1;return!0}get firstChild(){return this.content.length?this.content[0]:null}get lastChild(){return this.content.length?this.content[this.content.length-1]:null}get childCount(){return this.content.length}child(e){let n=this.content[e];if(!n)throw new RangeError("Index "+e+" out of range for "+this);return n}maybeChild(e){return this.content[e]||null}forEach(e){for(let n=0,r=0;n<this.content.length;n++){let u=this.content[n];e(u,r,n),r+=u.nodeSize}}findDiffStart(e,n=0){return Li(this,e,n)}findDiffEnd(e,n=this.size,r=e.size){return qi(this,e,n,r)}findIndex(e){if(e==0)return nn(0,e);if(e==this.size)return nn(this.content.length,e);if(e>this.size||e<0)throw new RangeError(`Position ${e} outside of fragment (${this})`);for(let n=0,r=0;;n++){let u=this.child(n),i=r+u.nodeSize;if(i>=e)return i==e?nn(n+1,i):nn(n,r);r=i}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map(e=>e.toJSON()):null}static fromJSON(e,n){if(!n)return x.empty;if(!Array.isArray(n))throw new RangeError("Invalid input for Fragment.fromJSON");return new x(n.map(e.nodeFromJSON))}static fromArray(e){if(!e.length)return x.empty;let n,r=0;for(let u=0;u<e.length;u++){let i=e[u];r+=i.nodeSize,u&&i.isText&&e[u-1].sameMarkup(i)?(n||(n=e.slice(0,u)),n[n.length-1]=i.withText(n[n.length-1].text+i.text)):n&&n.push(i)}return new x(n||e,r)}static from(e){if(!e)return x.empty;if(e instanceof x)return e;if(Array.isArray(e))return this.fromArray(e);if(e.attrs)return new x([e],e.nodeSize);throw new RangeError("Can not convert "+e+" to a Fragment"+(e.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}}x.empty=new x([],0);const Vn={index:0,offset:0};function nn(t,e){return Vn.index=t,Vn.offset=e,Vn}function hn(t,e){if(t===e)return!0;if(!(t&&typeof t=="object")||!(e&&typeof e=="object"))return!1;let n=Array.isArray(t);if(Array.isArray(e)!=n)return!1;if(n){if(t.length!=e.length)return!1;for(let r=0;r<t.length;r++)if(!hn(t[r],e[r]))return!1}else{for(let r in t)if(!(r in e)||!hn(t[r],e[r]))return!1;for(let r in e)if(!(r in t))return!1}return!0}class w{constructor(e,n){this.type=e,this.attrs=n}addToSet(e){let n,r=!1;for(let u=0;u<e.length;u++){let i=e[u];if(this.eq(i))return e;if(this.type.excludes(i.type))n||(n=e.slice(0,u));else{if(i.type.excludes(this.type))return e;!r&&i.type.rank>this.type.rank&&(n||(n=e.slice(0,u)),n.push(this),r=!0),n&&n.push(i)}}return n||(n=e.slice()),r||n.push(this),n}removeFromSet(e){for(let n=0;n<e.length;n++)if(this.eq(e[n]))return e.slice(0,n).concat(e.slice(n+1));return e}isInSet(e){for(let n=0;n<e.length;n++)if(this.eq(e[n]))return!0;return!1}eq(e){return this==e||this.type==e.type&&hn(this.attrs,e.attrs)}toJSON(){let e={type:this.type.name};for(let n in this.attrs){e.attrs=this.attrs;break}return e}static fromJSON(e,n){if(!n)throw new RangeError("Invalid input for Mark.fromJSON");let r=e.marks[n.type];if(!r)throw new RangeError(`There is no mark type ${n.type} in this schema`);let u=r.create(n.attrs);return r.checkAttrs(u.attrs),u}static sameSet(e,n){if(e==n)return!0;if(e.length!=n.length)return!1;for(let r=0;r<e.length;r++)if(!e[r].eq(n[r]))return!1;return!0}static setFrom(e){if(!e||Array.isArray(e)&&e.length==0)return w.none;if(e instanceof w)return[e];let n=e.slice();return n.sort((r,u)=>r.type.rank-u.type.rank),n}}w.none=[];class pn extends Error{}class C{constructor(e,n,r){this.content=e,this.openStart=n,this.openEnd=r}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(e,n){let r=$i(this.content,e+this.openStart,n);return r&&new C(r,this.openStart,this.openEnd)}removeBetween(e,n){return new C(Vi(this.content,e+this.openStart,n+this.openStart),this.openStart,this.openEnd)}eq(e){return this.content.eq(e.content)&&this.openStart==e.openStart&&this.openEnd==e.openEnd}toString(){return this.content+"("+this.openStart+","+this.openEnd+")"}toJSON(){if(!this.content.size)return null;let e={content:this.content.toJSON()};return this.openStart>0&&(e.openStart=this.openStart),this.openEnd>0&&(e.openEnd=this.openEnd),e}static fromJSON(e,n){if(!n)return C.empty;let r=n.openStart||0,u=n.openEnd||0;if(typeof r!="number"||typeof u!="number")throw new RangeError("Invalid input for Slice.fromJSON");return new C(x.fromJSON(e,n.content),r,u)}static maxOpen(e,n=!0){let r=0,u=0;for(let i=e.firstChild;i&&!i.isLeaf&&(n||!i.type.spec.isolating);i=i.firstChild)r++;for(let i=e.lastChild;i&&!i.isLeaf&&(n||!i.type.spec.isolating);i=i.lastChild)u++;return new C(e,r,u)}}C.empty=new C(x.empty,0,0);function Vi(t,e,n){let{index:r,offset:u}=t.findIndex(e),i=t.maybeChild(r),{index:s,offset:o}=t.findIndex(n);if(u==e||i.isText){if(o!=n&&!t.child(s).isText)throw new RangeError("Removing non-flat range");return t.cut(0,e).append(t.cut(n))}if(r!=s)throw new RangeError("Removing non-flat range");return t.replaceChild(r,i.copy(Vi(i.content,e-u-1,n-u-1)))}function $i(t,e,n,r){let{index:u,offset:i}=t.findIndex(e),s=t.maybeChild(u);if(i==e||s.isText)return r&&!r.canReplace(u,u,n)?null:t.cut(0,e).append(n).append(t.cut(e));let o=$i(s.content,e-i-1,n,s);return o&&t.replaceChild(u,s.copy(o))}function il(t,e,n){if(n.openStart>t.depth)throw new pn("Inserted content deeper than insertion position");if(t.depth-n.openStart!=e.depth-n.openEnd)throw new pn("Inconsistent open depths");return Wi(t,e,n,0)}function Wi(t,e,n,r){let u=t.index(r),i=t.node(r);if(u==e.index(r)&&r<t.depth-n.openStart){let s=Wi(t,e,n,r+1);return i.copy(i.content.replaceChild(u,s))}else if(n.content.size)if(!n.openStart&&!n.openEnd&&t.depth==r&&e.depth==r){let s=t.parent,o=s.content;return Ge(s,o.cut(0,t.parentOffset).append(n.content).append(o.cut(e.parentOffset)))}else{let{start:s,end:o}=sl(n,t);return Ge(i,Ji(t,s,o,e,r))}else return Ge(i,mn(t,e,r))}function Hi(t,e){if(!e.type.compatibleContent(t.type))throw new pn("Cannot join "+e.type.name+" onto "+t.type.name)}function gr(t,e,n){let r=t.node(n);return Hi(r,e.node(n)),r}function Ze(t,e){let n=e.length-1;n>=0&&t.isText&&t.sameMarkup(e[n])?e[n]=t.withText(e[n].text+t.text):e.push(t)}function wt(t,e,n,r){let u=(e||t).node(n),i=0,s=e?e.index(n):u.childCount;t&&(i=t.index(n),t.depth>n?i++:t.textOffset&&(Ze(t.nodeAfter,r),i++));for(let o=i;o<s;o++)Ze(u.child(o),r);e&&e.depth==n&&e.textOffset&&Ze(e.nodeBefore,r)}function Ge(t,e){return t.type.checkContent(e),t.copy(e)}function Ji(t,e,n,r,u){let i=t.depth>u&&gr(t,e,u+1),s=r.depth>u&&gr(n,r,u+1),o=[];return wt(null,t,u,o),i&&s&&e.index(u)==n.index(u)?(Hi(i,s),Ze(Ge(i,Ji(t,e,n,r,u+1)),o)):(i&&Ze(Ge(i,mn(t,e,u+1)),o),wt(e,n,u,o),s&&Ze(Ge(s,mn(n,r,u+1)),o)),wt(r,null,u,o),new x(o)}function mn(t,e,n){let r=[];if(wt(null,t,n,r),t.depth>n){let u=gr(t,e,n+1);Ze(Ge(u,mn(t,e,n+1)),r)}return wt(e,null,n,r),new x(r)}function sl(t,e){let n=e.depth-t.openStart,u=e.node(n).copy(t.content);for(let i=n-1;i>=0;i--)u=e.node(i).copy(x.from(u));return{start:u.resolveNoCache(t.openStart+n),end:u.resolveNoCache(u.content.size-t.openEnd-n)}}class Rt{constructor(e,n,r){this.pos=e,this.path=n,this.parentOffset=r,this.depth=n.length/3-1}resolveDepth(e){return e==null?this.depth:e<0?this.depth+e:e}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(e){return this.path[this.resolveDepth(e)*3]}index(e){return this.path[this.resolveDepth(e)*3+1]}indexAfter(e){return e=this.resolveDepth(e),this.index(e)+(e==this.depth&&!this.textOffset?0:1)}start(e){return e=this.resolveDepth(e),e==0?0:this.path[e*3-1]+1}end(e){return e=this.resolveDepth(e),this.start(e)+this.node(e).content.size}before(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position before the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]}after(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position after the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]+this.path[e*3].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let e=this.parent,n=this.index(this.depth);if(n==e.childCount)return null;let r=this.pos-this.path[this.path.length-1],u=e.child(n);return r?e.child(n).cut(r):u}get nodeBefore(){let e=this.index(this.depth),n=this.pos-this.path[this.path.length-1];return n?this.parent.child(e).cut(0,n):e==0?null:this.parent.child(e-1)}posAtIndex(e,n){n=this.resolveDepth(n);let r=this.path[n*3],u=n==0?0:this.path[n*3-1]+1;for(let i=0;i<e;i++)u+=r.child(i).nodeSize;return u}marks(){let e=this.parent,n=this.index();if(e.content.size==0)return w.none;if(this.textOffset)return e.child(n).marks;let r=e.maybeChild(n-1),u=e.maybeChild(n);if(!r){let o=r;r=u,u=o}let i=r.marks;for(var s=0;s<i.length;s++)i[s].type.spec.inclusive===!1&&(!u||!i[s].isInSet(u.marks))&&(i=i[s--].removeFromSet(i));return i}marksAcross(e){let n=this.parent.maybeChild(this.index());if(!n||!n.isInline)return null;let r=n.marks,u=e.parent.maybeChild(e.index());for(var i=0;i<r.length;i++)r[i].type.spec.inclusive===!1&&(!u||!r[i].isInSet(u.marks))&&(r=r[i--].removeFromSet(r));return r}sharedDepth(e){for(let n=this.depth;n>0;n--)if(this.start(n)<=e&&this.end(n)>=e)return n;return 0}blockRange(e=this,n){if(e.pos<this.pos)return e.blockRange(this);for(let r=this.depth-(this.parent.inlineContent||this.pos==e.pos?1:0);r>=0;r--)if(e.pos<=this.end(r)&&(!n||n(this.node(r))))return new ji(this,e,r);return null}sameParent(e){return this.pos-this.parentOffset==e.pos-e.parentOffset}max(e){return e.pos>this.pos?e:this}min(e){return e.pos<this.pos?e:this}toString(){let e="";for(let n=1;n<=this.depth;n++)e+=(e?"/":"")+this.node(n).type.name+"_"+this.index(n-1);return e+":"+this.parentOffset}static resolve(e,n){if(!(n>=0&&n<=e.content.size))throw new RangeError("Position "+n+" out of range");let r=[],u=0,i=n;for(let s=e;;){let{index:o,offset:l}=s.content.findIndex(i),a=i-l;if(r.push(s,o,u+l),!a||(s=s.child(o),s.isText))break;i=a-1,u+=l+1}return new Rt(n,r,i)}static resolveCached(e,n){let r=fu.get(e);if(r)for(let i=0;i<r.elts.length;i++){let s=r.elts[i];if(s.pos==n)return s}else fu.set(e,r=new ol);let u=r.elts[r.i]=Rt.resolve(e,n);return r.i=(r.i+1)%ll,u}}class ol{constructor(){this.elts=[],this.i=0}}const ll=12,fu=new WeakMap;class ji{constructor(e,n,r){this.$from=e,this.$to=n,this.depth=r}get start(){return this.$from.before(this.depth+1)}get end(){return this.$to.after(this.depth+1)}get parent(){return this.$from.node(this.depth)}get startIndex(){return this.$from.index(this.depth)}get endIndex(){return this.$to.indexAfter(this.depth)}}const al=Object.create(null);class ke{constructor(e,n,r,u=w.none){this.type=e,this.attrs=n,this.marks=u,this.content=r||x.empty}get children(){return this.content.content}get nodeSize(){return this.isLeaf?1:2+this.content.size}get childCount(){return this.content.childCount}child(e){return this.content.child(e)}maybeChild(e){return this.content.maybeChild(e)}forEach(e){this.content.forEach(e)}nodesBetween(e,n,r,u=0){this.content.nodesBetween(e,n,r,u,this)}descendants(e){this.nodesBetween(0,this.content.size,e)}get textContent(){return this.isLeaf&&this.type.spec.leafText?this.type.spec.leafText(this):this.textBetween(0,this.content.size,"")}textBetween(e,n,r,u){return this.content.textBetween(e,n,r,u)}get firstChild(){return this.content.firstChild}get lastChild(){return this.content.lastChild}eq(e){return this==e||this.sameMarkup(e)&&this.content.eq(e.content)}sameMarkup(e){return this.hasMarkup(e.type,e.attrs,e.marks)}hasMarkup(e,n,r){return this.type==e&&hn(this.attrs,n||e.defaultAttrs||al)&&w.sameSet(this.marks,r||w.none)}copy(e=null){return e==this.content?this:new ke(this.type,this.attrs,e,this.marks)}mark(e){return e==this.marks?this:new ke(this.type,this.attrs,this.content,e)}cut(e,n=this.content.size){return e==0&&n==this.content.size?this:this.copy(this.content.cut(e,n))}slice(e,n=this.content.size,r=!1){if(e==n)return C.empty;let u=this.resolve(e),i=this.resolve(n),s=r?0:u.sharedDepth(n),o=u.start(s),a=u.node(s).content.cut(u.pos-o,i.pos-o);return new C(a,u.depth-s,i.depth-s)}replace(e,n,r){return il(this.resolve(e),this.resolve(n),r)}nodeAt(e){for(let n=this;;){let{index:r,offset:u}=n.content.findIndex(e);if(n=n.maybeChild(r),!n)return null;if(u==e||n.isText)return n;e-=u+1}}childAfter(e){let{index:n,offset:r}=this.content.findIndex(e);return{node:this.content.maybeChild(n),index:n,offset:r}}childBefore(e){if(e==0)return{node:null,index:0,offset:0};let{index:n,offset:r}=this.content.findIndex(e);if(r<e)return{node:this.content.child(n),index:n,offset:r};let u=this.content.child(n-1);return{node:u,index:n-1,offset:r-u.nodeSize}}resolve(e){return Rt.resolveCached(this,e)}resolveNoCache(e){return Rt.resolve(this,e)}rangeHasMark(e,n,r){let u=!1;return n>e&&this.nodesBetween(e,n,i=>(r.isInSet(i.marks)&&(u=!0),!u)),u}get isBlock(){return this.type.isBlock}get isTextblock(){return this.type.isTextblock}get inlineContent(){return this.type.inlineContent}get isInline(){return this.type.isInline}get isText(){return this.type.isText}get isLeaf(){return this.type.isLeaf}get isAtom(){return this.type.isAtom}toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);let e=this.type.name;return this.content.size&&(e+="("+this.content.toStringInner()+")"),Ui(this.marks,e)}contentMatchAt(e){let n=this.type.contentMatch.matchFragment(this.content,0,e);if(!n)throw new Error("Called contentMatchAt on a node with invalid content");return n}canReplace(e,n,r=x.empty,u=0,i=r.childCount){let s=this.contentMatchAt(e).matchFragment(r,u,i),o=s&&s.matchFragment(this.content,n);if(!o||!o.validEnd)return!1;for(let l=u;l<i;l++)if(!this.type.allowsMarks(r.child(l).marks))return!1;return!0}canReplaceWith(e,n,r,u){if(u&&!this.type.allowsMarks(u))return!1;let i=this.contentMatchAt(e).matchType(r),s=i&&i.matchFragment(this.content,n);return s?s.validEnd:!1}canAppend(e){return e.content.size?this.canReplace(this.childCount,this.childCount,e.content):this.type.compatibleContent(e.type)}check(){this.type.checkContent(this.content),this.type.checkAttrs(this.attrs);let e=w.none;for(let n=0;n<this.marks.length;n++){let r=this.marks[n];r.type.checkAttrs(r.attrs),e=r.addToSet(e)}if(!w.sameSet(e,this.marks))throw new RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map(n=>n.type.name)}`);this.content.forEach(n=>n.check())}toJSON(){let e={type:this.type.name};for(let n in this.attrs){e.attrs=this.attrs;break}return this.content.size&&(e.content=this.content.toJSON()),this.marks.length&&(e.marks=this.marks.map(n=>n.toJSON())),e}static fromJSON(e,n){if(!n)throw new RangeError("Invalid input for Node.fromJSON");let r;if(n.marks){if(!Array.isArray(n.marks))throw new RangeError("Invalid mark data for Node.fromJSON");r=n.marks.map(e.markFromJSON)}if(n.type=="text"){if(typeof n.text!="string")throw new RangeError("Invalid text node in JSON");return e.text(n.text,r)}let u=x.fromJSON(e,n.content),i=e.nodeType(n.type).create(n.attrs,u,r);return i.type.checkAttrs(i.attrs),i}}ke.prototype.text=void 0;class gn extends ke{constructor(e,n,r,u){if(super(e,n,null,u),!r)throw new RangeError("Empty text nodes are not allowed");this.text=r}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):Ui(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(e,n){return this.text.slice(e,n)}get nodeSize(){return this.text.length}mark(e){return e==this.marks?this:new gn(this.type,this.attrs,this.text,e)}withText(e){return e==this.text?this:new gn(this.type,this.attrs,e,this.marks)}cut(e=0,n=this.text.length){return e==0&&n==this.text.length?this:this.withText(this.text.slice(e,n))}eq(e){return this.sameMarkup(e)&&this.text==e.text}toJSON(){let e=super.toJSON();return e.text=this.text,e}}function Ui(t,e){for(let n=t.length-1;n>=0;n--)e=t[n].type.name+"("+e+")";return e}class et{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(e,n){let r=new cl(e,n);if(r.next==null)return et.empty;let u=Ki(r);r.next&&r.err("Unexpected trailing text");let i=bl(gl(u));return xl(i,r),i}matchType(e){for(let n=0;n<this.next.length;n++)if(this.next[n].type==e)return this.next[n].next;return null}matchFragment(e,n=0,r=e.childCount){let u=this;for(let i=n;u&&i<r;i++)u=u.matchType(e.child(i).type);return u}get inlineContent(){return this.next.length!=0&&this.next[0].type.isInline}get defaultType(){for(let e=0;e<this.next.length;e++){let{type:n}=this.next[e];if(!(n.isText||n.hasRequiredAttrs()))return n}return null}compatible(e){for(let n=0;n<this.next.length;n++)for(let r=0;r<e.next.length;r++)if(this.next[n].type==e.next[r].type)return!0;return!1}fillBefore(e,n=!1,r=0){let u=[this];function i(s,o){let l=s.matchFragment(e,r);if(l&&(!n||l.validEnd))return x.from(o.map(a=>a.createAndFill()));for(let a=0;a<s.next.length;a++){let{type:c,next:f}=s.next[a];if(!(c.isText||c.hasRequiredAttrs())&&u.indexOf(f)==-1){u.push(f);let p=i(f,o.concat(c));if(p)return p}}return null}return i(this,[])}findWrapping(e){for(let r=0;r<this.wrapCache.length;r+=2)if(this.wrapCache[r]==e)return this.wrapCache[r+1];let n=this.computeWrapping(e);return this.wrapCache.push(e,n),n}computeWrapping(e){let n=Object.create(null),r=[{match:this,type:null,via:null}];for(;r.length;){let u=r.shift(),i=u.match;if(i.matchType(e)){let s=[];for(let o=u;o.type;o=o.via)s.push(o.type);return s.reverse()}for(let s=0;s<i.next.length;s++){let{type:o,next:l}=i.next[s];!o.isLeaf&&!o.hasRequiredAttrs()&&!(o.name in n)&&(!u.type||l.validEnd)&&(r.push({match:o.contentMatch,type:o,via:u}),n[o.name]=!0)}}return null}get edgeCount(){return this.next.length}edge(e){if(e>=this.next.length)throw new RangeError(`There's no ${e}th edge in this content match`);return this.next[e]}toString(){let e=[];function n(r){e.push(r);for(let u=0;u<r.next.length;u++)e.indexOf(r.next[u].next)==-1&&n(r.next[u].next)}return n(this),e.map((r,u)=>{let i=u+(r.validEnd?"*":" ")+" ";for(let s=0;s<r.next.length;s++)i+=(s?", ":"")+r.next[s].type.name+"->"+e.indexOf(r.next[s].next);return i}).join(`
1
+ "use strict";const A=require("@tempots/dom"),It=require("./toolbar-BnaquvB9.cjs"),vr=require("./translations-DZWe3znu.cjs"),Uo=require("./link-portal-_tiDFZqh.cjs"),Ko=require("@tempots/ui"),Zo=require("./theme-Dt6lCAvY.cjs");function Ri(t,e){return Bi(t,e)!=null}function Bi(t,e){const{from:n,$from:r,to:u,empty:i}=t.selection;if(!e)return null;if(i){if(t.storedMarks){const c=t.storedMarks.find(f=>f.type.name===e.name);if(c!=null)return c}const l=r.marks().find(c=>c.type.name===e.name);if(l!=null)return l;const a=r.nodeAfter;if(a&&a.marks){const c=a.marks.find(f=>f.type.name===e.name);if(c!=null)return c}return null}let s=null;return t.doc.nodesBetween(n,u,o=>{if(s!=null)return!1;if(o.marks){const l=o.marks.find(a=>a.type.name===e.name);if(l!=null)return s=l,!1}}),s}function ln(t,e,n){return t.map(()=>{const r=e.value,u=r.state.schema.marks[n];return Ri(r.state,u)})}function Go(t,e,n){const{$from:r}=t.selection;for(let i=r.depth;i>0;i--){const s=r.node(i);if(s.type.name===e.name)return n!=null?Object.keys(n).every(o=>s.attrs[o]===n[o]):!0}const u=t.doc.nodeAt(r.pos);return u&&u.type.name===e.name?n!=null?Object.keys(n).every(i=>u.attrs[i]===n[i]):!0:!1}function Dt(t,e,n,r){return t.map(()=>{const u=e.value,i=u.state.schema.nodes[n];return i?Go(u.state,i,r):!1})}function he({active:t,display:e,onClick:n,disabled:r,label:u,icon:i,size:s}){return A.When(e,()=>It.ToolbarButton({onClick:n,disabled:r,variant:t.map(o=>o?"filled":"light"),size:s},A.attr.title(u),vr.Icon({icon:i,size:s})))}function Yo(t,e){const n=t.state.schema.marks.link;if(n==null)return;const{from:r,to:u}=t.state.selection,i=t.state.tr.addMark(r,u,n.create({href:e,title:null}));t.dispatch(i),t.focus()}function vi(t){const{state:e}=t,{$from:n,$to:r}=e.selection;if(!zi(e))return null;let u=n.pos,i=r.pos;const s=e.doc;for(;u>0&&s.resolve(u-1).nodeAfter?.marks?.some(a=>a.type.name==="link");)u--;for(;i<s.content.size&&s.resolve(i).nodeAfter?.marks?.some(a=>a.type.name==="link");)i++;return{start:u,end:i}}function Xo(t,e){const n=t.state.schema.marks.link;if(n==null)return;const r=vi(t);if(r==null)return;const{start:u,end:i}=r,s=t.state.tr.removeMark(u,i,n).addMark(u,i,n.create({href:e,title:null}));t.dispatch(s)}function Qo(t){const e=t.state.schema.marks.link;if(e==null)return;const n=vi(t);if(n==null)return;const{start:r,end:u}=n,i=t.state.tr.removeMark(r,u,e);t.dispatch(i),t.focus()}function zi(t){return Ri(t,t.schema.marks.link)}function el({stateUpdate:t,view:e,isReadOnly:n,label:r,linkUrlPlaceholder:u,size:i}){const s=A.prop(null);s.on(l=>{l!=null&&Xo(e.value,l)});const o=t.on(()=>{const l=Bi(e.value.state,e.value.state.schema.marks.link);l!=null?s.set(l.attrs.href??""):s.set(null)});return A.Fragment(A.OnDispose(o),It.ToolbarGroup(he({display:A.signal(!0),active:ln(t,e,"link"),disabled:n,label:r,icon:"mdi:link-variant",size:i,onClick:()=>{const l=e.value.state;if(zi(l))Qo(e.value),s.set(null);else{const a="";Yo(e.value,a),s.set(a)}}}),A.Ensure(s,l=>vr.TextInput({value:l,autofocus:!0,onInput:s.set,placeholder:u,size:i}))),A.Ensure(s,l=>It.ToolbarButton({disabled:l.map(a=>a.trim()===""),variant:"text",onClick:()=>{const a=s.value;a&&window.open(a,"_blank")},size:i},"go")))}function tn({display:t},...e){return A.When(A.computedOf(...t)((...n)=>n.some(Boolean)),()=>It.ToolbarGroup(...e))}function Pi({view:t,stateUpdate:e,features:n,readOnly:r=A.signal(!1),size:u="sm"}){return A.Ensure(t,i=>A.Use(vr.BeatUII18n,s=>{const o=s.$.prosemirror,l=i;return It.Toolbar(tn({display:[n.$.bold,n.$.italic,n.$.code]},he({active:ln(e,l,"strong"),display:n.$.bold,onClick:()=>qn(l.value,"strong"),disabled:r,label:o.$.bold,icon:"mdi:format-bold",size:u}),he({active:ln(e,l,"em"),display:n.$.italic,onClick:()=>qn(l.value,"em"),disabled:r,label:o.$.italic,icon:"mdi:format-italic",size:u}),he({active:ln(e,l,"code"),display:n.$.code,onClick:()=>qn(l.value,"code"),disabled:r,label:o.$.code,icon:"mdi:code-tags",size:u})),tn({display:[n.$.headings]},A.Repeat(n.$.headerLevels.map(a=>Math.min(Math.max(a,1),6)),({counter:a})=>he({active:Dt(e,l,"heading",{level:a}),display:n.$.headings,onClick:()=>tl(l.value,a),disabled:r,label:o.map(c=>c.heading(a)),icon:`mdi:format-header-${a}`,size:u}))),tn({display:[n.$.bulletList,n.$.orderedList]},he({active:Dt(e,l,"bullet_list"),display:n.$.bulletList,onClick:()=>cu(l.value,"bullet_list"),disabled:r,label:o.$.bulletList,icon:"mdi:format-list-bulleted",size:u}),he({active:Dt(e,l,"ordered_list"),display:n.$.orderedList,onClick:()=>cu(l.value,"ordered_list"),disabled:r,label:o.$.orderedList,icon:"mdi:format-list-numbered",size:u})),tn({display:[n.$.blockquote,n.$.codeBlock,n.$.horizontalRule]},he({active:Dt(e,l,"blockquote"),display:n.$.blockquote,onClick:()=>nl(l.value),disabled:r,label:o.$.blockquote,icon:"mdi:format-quote-close",size:u}),he({active:Dt(e,l,"code_block"),display:n.$.codeBlock,onClick:()=>rl(l.value),disabled:r,label:o.$.codeBlock,icon:"mdi:code-braces",size:u}),he({active:A.signal(!1),display:n.$.horizontalRule,onClick:()=>ul(l.value),disabled:r,label:o.$.horizontalRule,icon:"mdi:minus",size:u})),A.When(n.$.links,()=>el({stateUpdate:e,view:l,isReadOnly:r,label:o.$.link,linkUrlPlaceholder:o.$.linkUrlPlaceholder,size:u})))}))}async function qn(t,e){const{toggleMark:n}=await Promise.resolve().then(()=>zn),r=t.state.schema.marks[e];r!=null&&(n(r)(t.state,t.dispatch),t.focus())}async function tl(t,e){const{setBlockType:n}=await Promise.resolve().then(()=>zn),r=t.state.schema.nodes.heading;r!=null&&(n(r,{level:e})(t.state,t.dispatch),t.focus())}async function cu(t,e){const{wrapInList:n,liftListItem:r}=await Promise.resolve().then(()=>require("./index-aFA1CLKZ.cjs")),u=t.state.schema.nodes[e],i=t.state.schema.nodes.list_item;if(u==null||i==null)return;const{state:s}=t,{$from:o}=s.selection;let l=null;for(let a=o.depth;a>0;a--){const c=o.node(a);if(c.type.name==="bullet_list"||c.type.name==="ordered_list"){l=c.type.name;break}}l===e?r(i)(s,t.dispatch):l!=null?r(i)(t.state,t.dispatch)&&n(u)(t.state,t.dispatch):n(u)(s,t.dispatch),t.focus()}async function nl(t){const{wrapIn:e,lift:n}=await Promise.resolve().then(()=>zn),r=t.state.schema.nodes.blockquote;if(r==null)return;const{state:u}=t,{$from:i}=u.selection;let s=!1;for(let o=i.depth;o>0;o--)if(i.node(o).type.name==="blockquote"){s=!0;break}s?n(u,t.dispatch):e(r)(u,t.dispatch),t.focus()}async function rl(t){const{setBlockType:e}=await Promise.resolve().then(()=>zn),n=t.state.schema.nodes.code_block,r=t.state.schema.nodes.paragraph;if(n==null||r==null)return;const{state:u}=t,{$from:i}=u.selection;let s=!1;for(let o=i.depth;o>0;o--)if(i.node(o).type.name==="code_block"){s=!0;break}s?e(r)(u,t.dispatch):e(n)(u,t.dispatch),t.focus()}function ul(t){const e=t.state.schema.nodes.horizontal_rule;if(e!=null){const n=t.state.tr.replaceSelectionWith(e.create());t.dispatch(n),t.focus()}}function q(t){this.content=t}q.prototype={constructor:q,find:function(t){for(var e=0;e<this.content.length;e+=2)if(this.content[e]===t)return e;return-1},get:function(t){var e=this.find(t);return e==-1?void 0:this.content[e+1]},update:function(t,e,n){var r=n&&n!=t?this.remove(n):this,u=r.find(t),i=r.content.slice();return u==-1?i.push(n||t,e):(i[u+1]=e,n&&(i[u]=n)),new q(i)},remove:function(t){var e=this.find(t);if(e==-1)return this;var n=this.content.slice();return n.splice(e,2),new q(n)},addToStart:function(t,e){return new q([t,e].concat(this.remove(t).content))},addToEnd:function(t,e){var n=this.remove(t).content.slice();return n.push(t,e),new q(n)},addBefore:function(t,e,n){var r=this.remove(e),u=r.content.slice(),i=r.find(t);return u.splice(i==-1?u.length:i,0,e,n),new q(u)},forEach:function(t){for(var e=0;e<this.content.length;e+=2)t(this.content[e],this.content[e+1])},prepend:function(t){return t=q.from(t),t.size?new q(t.content.concat(this.subtract(t).content)):this},append:function(t){return t=q.from(t),t.size?new q(this.subtract(t).content.concat(t.content)):this},subtract:function(t){var e=this;t=q.from(t);for(var n=0;n<t.content.length;n+=2)e=e.remove(t.content[n]);return e},toObject:function(){var t={};return this.forEach(function(e,n){t[e]=n}),t},get size(){return this.content.length>>1}};q.from=function(t){if(t instanceof q)return t;var e=[];if(t)for(var n in t)e.push(n,t[n]);return new q(e)};function Li(t,e,n){for(let r=0;;r++){if(r==t.childCount||r==e.childCount)return t.childCount==e.childCount?null:n;let u=t.child(r),i=e.child(r);if(u==i){n+=u.nodeSize;continue}if(!u.sameMarkup(i))return n;if(u.isText&&u.text!=i.text){for(let s=0;u.text[s]==i.text[s];s++)n++;return n}if(u.content.size||i.content.size){let s=Li(u.content,i.content,n+1);if(s!=null)return s}n+=u.nodeSize}}function qi(t,e,n,r){for(let u=t.childCount,i=e.childCount;;){if(u==0||i==0)return u==i?null:{a:n,b:r};let s=t.child(--u),o=e.child(--i),l=s.nodeSize;if(s==o){n-=l,r-=l;continue}if(!s.sameMarkup(o))return{a:n,b:r};if(s.isText&&s.text!=o.text){let a=0,c=Math.min(s.text.length,o.text.length);for(;a<c&&s.text[s.text.length-a-1]==o.text[o.text.length-a-1];)a++,n--,r--;return{a:n,b:r}}if(s.content.size||o.content.size){let a=qi(s.content,o.content,n-1,r-1);if(a)return a}n-=l,r-=l}}class x{constructor(e,n){if(this.content=e,this.size=n||0,n==null)for(let r=0;r<e.length;r++)this.size+=e[r].nodeSize}nodesBetween(e,n,r,u=0,i){for(let s=0,o=0;o<n;s++){let l=this.content[s],a=o+l.nodeSize;if(a>e&&r(l,u+o,i||null,s)!==!1&&l.content.size){let c=o+1;l.nodesBetween(Math.max(0,e-c),Math.min(l.content.size,n-c),r,u+c)}o=a}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,n,r,u){let i="",s=!0;return this.nodesBetween(e,n,(o,l)=>{let a=o.isText?o.text.slice(Math.max(e,l)-l,n-l):o.isLeaf?u?typeof u=="function"?u(o):u:o.type.spec.leafText?o.type.spec.leafText(o):"":"";o.isBlock&&(o.isLeaf&&a||o.isTextblock)&&r&&(s?s=!1:i+=r),i+=a},0),i}append(e){if(!e.size)return this;if(!this.size)return e;let n=this.lastChild,r=e.firstChild,u=this.content.slice(),i=0;for(n.isText&&n.sameMarkup(r)&&(u[u.length-1]=n.withText(n.text+r.text),i=1);i<e.content.length;i++)u.push(e.content[i]);return new x(u,this.size+e.size)}cut(e,n=this.size){if(e==0&&n==this.size)return this;let r=[],u=0;if(n>e)for(let i=0,s=0;s<n;i++){let o=this.content[i],l=s+o.nodeSize;l>e&&((s<e||l>n)&&(o.isText?o=o.cut(Math.max(0,e-s),Math.min(o.text.length,n-s)):o=o.cut(Math.max(0,e-s-1),Math.min(o.content.size,n-s-1))),r.push(o),u+=o.nodeSize),s=l}return new x(r,u)}cutByIndex(e,n){return e==n?x.empty:e==0&&n==this.content.length?this:new x(this.content.slice(e,n))}replaceChild(e,n){let r=this.content[e];if(r==n)return this;let u=this.content.slice(),i=this.size+n.nodeSize-r.nodeSize;return u[e]=n,new x(u,i)}addToStart(e){return new x([e].concat(this.content),this.size+e.nodeSize)}addToEnd(e){return new x(this.content.concat(e),this.size+e.nodeSize)}eq(e){if(this.content.length!=e.content.length)return!1;for(let n=0;n<this.content.length;n++)if(!this.content[n].eq(e.content[n]))return!1;return!0}get firstChild(){return this.content.length?this.content[0]:null}get lastChild(){return this.content.length?this.content[this.content.length-1]:null}get childCount(){return this.content.length}child(e){let n=this.content[e];if(!n)throw new RangeError("Index "+e+" out of range for "+this);return n}maybeChild(e){return this.content[e]||null}forEach(e){for(let n=0,r=0;n<this.content.length;n++){let u=this.content[n];e(u,r,n),r+=u.nodeSize}}findDiffStart(e,n=0){return Li(this,e,n)}findDiffEnd(e,n=this.size,r=e.size){return qi(this,e,n,r)}findIndex(e){if(e==0)return nn(0,e);if(e==this.size)return nn(this.content.length,e);if(e>this.size||e<0)throw new RangeError(`Position ${e} outside of fragment (${this})`);for(let n=0,r=0;;n++){let u=this.child(n),i=r+u.nodeSize;if(i>=e)return i==e?nn(n+1,i):nn(n,r);r=i}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map(e=>e.toJSON()):null}static fromJSON(e,n){if(!n)return x.empty;if(!Array.isArray(n))throw new RangeError("Invalid input for Fragment.fromJSON");return new x(n.map(e.nodeFromJSON))}static fromArray(e){if(!e.length)return x.empty;let n,r=0;for(let u=0;u<e.length;u++){let i=e[u];r+=i.nodeSize,u&&i.isText&&e[u-1].sameMarkup(i)?(n||(n=e.slice(0,u)),n[n.length-1]=i.withText(n[n.length-1].text+i.text)):n&&n.push(i)}return new x(n||e,r)}static from(e){if(!e)return x.empty;if(e instanceof x)return e;if(Array.isArray(e))return this.fromArray(e);if(e.attrs)return new x([e],e.nodeSize);throw new RangeError("Can not convert "+e+" to a Fragment"+(e.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}}x.empty=new x([],0);const Vn={index:0,offset:0};function nn(t,e){return Vn.index=t,Vn.offset=e,Vn}function hn(t,e){if(t===e)return!0;if(!(t&&typeof t=="object")||!(e&&typeof e=="object"))return!1;let n=Array.isArray(t);if(Array.isArray(e)!=n)return!1;if(n){if(t.length!=e.length)return!1;for(let r=0;r<t.length;r++)if(!hn(t[r],e[r]))return!1}else{for(let r in t)if(!(r in e)||!hn(t[r],e[r]))return!1;for(let r in e)if(!(r in t))return!1}return!0}class w{constructor(e,n){this.type=e,this.attrs=n}addToSet(e){let n,r=!1;for(let u=0;u<e.length;u++){let i=e[u];if(this.eq(i))return e;if(this.type.excludes(i.type))n||(n=e.slice(0,u));else{if(i.type.excludes(this.type))return e;!r&&i.type.rank>this.type.rank&&(n||(n=e.slice(0,u)),n.push(this),r=!0),n&&n.push(i)}}return n||(n=e.slice()),r||n.push(this),n}removeFromSet(e){for(let n=0;n<e.length;n++)if(this.eq(e[n]))return e.slice(0,n).concat(e.slice(n+1));return e}isInSet(e){for(let n=0;n<e.length;n++)if(this.eq(e[n]))return!0;return!1}eq(e){return this==e||this.type==e.type&&hn(this.attrs,e.attrs)}toJSON(){let e={type:this.type.name};for(let n in this.attrs){e.attrs=this.attrs;break}return e}static fromJSON(e,n){if(!n)throw new RangeError("Invalid input for Mark.fromJSON");let r=e.marks[n.type];if(!r)throw new RangeError(`There is no mark type ${n.type} in this schema`);let u=r.create(n.attrs);return r.checkAttrs(u.attrs),u}static sameSet(e,n){if(e==n)return!0;if(e.length!=n.length)return!1;for(let r=0;r<e.length;r++)if(!e[r].eq(n[r]))return!1;return!0}static setFrom(e){if(!e||Array.isArray(e)&&e.length==0)return w.none;if(e instanceof w)return[e];let n=e.slice();return n.sort((r,u)=>r.type.rank-u.type.rank),n}}w.none=[];class pn extends Error{}class C{constructor(e,n,r){this.content=e,this.openStart=n,this.openEnd=r}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(e,n){let r=$i(this.content,e+this.openStart,n);return r&&new C(r,this.openStart,this.openEnd)}removeBetween(e,n){return new C(Vi(this.content,e+this.openStart,n+this.openStart),this.openStart,this.openEnd)}eq(e){return this.content.eq(e.content)&&this.openStart==e.openStart&&this.openEnd==e.openEnd}toString(){return this.content+"("+this.openStart+","+this.openEnd+")"}toJSON(){if(!this.content.size)return null;let e={content:this.content.toJSON()};return this.openStart>0&&(e.openStart=this.openStart),this.openEnd>0&&(e.openEnd=this.openEnd),e}static fromJSON(e,n){if(!n)return C.empty;let r=n.openStart||0,u=n.openEnd||0;if(typeof r!="number"||typeof u!="number")throw new RangeError("Invalid input for Slice.fromJSON");return new C(x.fromJSON(e,n.content),r,u)}static maxOpen(e,n=!0){let r=0,u=0;for(let i=e.firstChild;i&&!i.isLeaf&&(n||!i.type.spec.isolating);i=i.firstChild)r++;for(let i=e.lastChild;i&&!i.isLeaf&&(n||!i.type.spec.isolating);i=i.lastChild)u++;return new C(e,r,u)}}C.empty=new C(x.empty,0,0);function Vi(t,e,n){let{index:r,offset:u}=t.findIndex(e),i=t.maybeChild(r),{index:s,offset:o}=t.findIndex(n);if(u==e||i.isText){if(o!=n&&!t.child(s).isText)throw new RangeError("Removing non-flat range");return t.cut(0,e).append(t.cut(n))}if(r!=s)throw new RangeError("Removing non-flat range");return t.replaceChild(r,i.copy(Vi(i.content,e-u-1,n-u-1)))}function $i(t,e,n,r){let{index:u,offset:i}=t.findIndex(e),s=t.maybeChild(u);if(i==e||s.isText)return r&&!r.canReplace(u,u,n)?null:t.cut(0,e).append(n).append(t.cut(e));let o=$i(s.content,e-i-1,n,s);return o&&t.replaceChild(u,s.copy(o))}function il(t,e,n){if(n.openStart>t.depth)throw new pn("Inserted content deeper than insertion position");if(t.depth-n.openStart!=e.depth-n.openEnd)throw new pn("Inconsistent open depths");return Wi(t,e,n,0)}function Wi(t,e,n,r){let u=t.index(r),i=t.node(r);if(u==e.index(r)&&r<t.depth-n.openStart){let s=Wi(t,e,n,r+1);return i.copy(i.content.replaceChild(u,s))}else if(n.content.size)if(!n.openStart&&!n.openEnd&&t.depth==r&&e.depth==r){let s=t.parent,o=s.content;return Ge(s,o.cut(0,t.parentOffset).append(n.content).append(o.cut(e.parentOffset)))}else{let{start:s,end:o}=sl(n,t);return Ge(i,Ji(t,s,o,e,r))}else return Ge(i,mn(t,e,r))}function Hi(t,e){if(!e.type.compatibleContent(t.type))throw new pn("Cannot join "+e.type.name+" onto "+t.type.name)}function gr(t,e,n){let r=t.node(n);return Hi(r,e.node(n)),r}function Ze(t,e){let n=e.length-1;n>=0&&t.isText&&t.sameMarkup(e[n])?e[n]=t.withText(e[n].text+t.text):e.push(t)}function wt(t,e,n,r){let u=(e||t).node(n),i=0,s=e?e.index(n):u.childCount;t&&(i=t.index(n),t.depth>n?i++:t.textOffset&&(Ze(t.nodeAfter,r),i++));for(let o=i;o<s;o++)Ze(u.child(o),r);e&&e.depth==n&&e.textOffset&&Ze(e.nodeBefore,r)}function Ge(t,e){return t.type.checkContent(e),t.copy(e)}function Ji(t,e,n,r,u){let i=t.depth>u&&gr(t,e,u+1),s=r.depth>u&&gr(n,r,u+1),o=[];return wt(null,t,u,o),i&&s&&e.index(u)==n.index(u)?(Hi(i,s),Ze(Ge(i,Ji(t,e,n,r,u+1)),o)):(i&&Ze(Ge(i,mn(t,e,u+1)),o),wt(e,n,u,o),s&&Ze(Ge(s,mn(n,r,u+1)),o)),wt(r,null,u,o),new x(o)}function mn(t,e,n){let r=[];if(wt(null,t,n,r),t.depth>n){let u=gr(t,e,n+1);Ze(Ge(u,mn(t,e,n+1)),r)}return wt(e,null,n,r),new x(r)}function sl(t,e){let n=e.depth-t.openStart,u=e.node(n).copy(t.content);for(let i=n-1;i>=0;i--)u=e.node(i).copy(x.from(u));return{start:u.resolveNoCache(t.openStart+n),end:u.resolveNoCache(u.content.size-t.openEnd-n)}}class Rt{constructor(e,n,r){this.pos=e,this.path=n,this.parentOffset=r,this.depth=n.length/3-1}resolveDepth(e){return e==null?this.depth:e<0?this.depth+e:e}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(e){return this.path[this.resolveDepth(e)*3]}index(e){return this.path[this.resolveDepth(e)*3+1]}indexAfter(e){return e=this.resolveDepth(e),this.index(e)+(e==this.depth&&!this.textOffset?0:1)}start(e){return e=this.resolveDepth(e),e==0?0:this.path[e*3-1]+1}end(e){return e=this.resolveDepth(e),this.start(e)+this.node(e).content.size}before(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position before the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]}after(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position after the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]+this.path[e*3].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let e=this.parent,n=this.index(this.depth);if(n==e.childCount)return null;let r=this.pos-this.path[this.path.length-1],u=e.child(n);return r?e.child(n).cut(r):u}get nodeBefore(){let e=this.index(this.depth),n=this.pos-this.path[this.path.length-1];return n?this.parent.child(e).cut(0,n):e==0?null:this.parent.child(e-1)}posAtIndex(e,n){n=this.resolveDepth(n);let r=this.path[n*3],u=n==0?0:this.path[n*3-1]+1;for(let i=0;i<e;i++)u+=r.child(i).nodeSize;return u}marks(){let e=this.parent,n=this.index();if(e.content.size==0)return w.none;if(this.textOffset)return e.child(n).marks;let r=e.maybeChild(n-1),u=e.maybeChild(n);if(!r){let o=r;r=u,u=o}let i=r.marks;for(var s=0;s<i.length;s++)i[s].type.spec.inclusive===!1&&(!u||!i[s].isInSet(u.marks))&&(i=i[s--].removeFromSet(i));return i}marksAcross(e){let n=this.parent.maybeChild(this.index());if(!n||!n.isInline)return null;let r=n.marks,u=e.parent.maybeChild(e.index());for(var i=0;i<r.length;i++)r[i].type.spec.inclusive===!1&&(!u||!r[i].isInSet(u.marks))&&(r=r[i--].removeFromSet(r));return r}sharedDepth(e){for(let n=this.depth;n>0;n--)if(this.start(n)<=e&&this.end(n)>=e)return n;return 0}blockRange(e=this,n){if(e.pos<this.pos)return e.blockRange(this);for(let r=this.depth-(this.parent.inlineContent||this.pos==e.pos?1:0);r>=0;r--)if(e.pos<=this.end(r)&&(!n||n(this.node(r))))return new ji(this,e,r);return null}sameParent(e){return this.pos-this.parentOffset==e.pos-e.parentOffset}max(e){return e.pos>this.pos?e:this}min(e){return e.pos<this.pos?e:this}toString(){let e="";for(let n=1;n<=this.depth;n++)e+=(e?"/":"")+this.node(n).type.name+"_"+this.index(n-1);return e+":"+this.parentOffset}static resolve(e,n){if(!(n>=0&&n<=e.content.size))throw new RangeError("Position "+n+" out of range");let r=[],u=0,i=n;for(let s=e;;){let{index:o,offset:l}=s.content.findIndex(i),a=i-l;if(r.push(s,o,u+l),!a||(s=s.child(o),s.isText))break;i=a-1,u+=l+1}return new Rt(n,r,i)}static resolveCached(e,n){let r=fu.get(e);if(r)for(let i=0;i<r.elts.length;i++){let s=r.elts[i];if(s.pos==n)return s}else fu.set(e,r=new ol);let u=r.elts[r.i]=Rt.resolve(e,n);return r.i=(r.i+1)%ll,u}}class ol{constructor(){this.elts=[],this.i=0}}const ll=12,fu=new WeakMap;class ji{constructor(e,n,r){this.$from=e,this.$to=n,this.depth=r}get start(){return this.$from.before(this.depth+1)}get end(){return this.$to.after(this.depth+1)}get parent(){return this.$from.node(this.depth)}get startIndex(){return this.$from.index(this.depth)}get endIndex(){return this.$to.indexAfter(this.depth)}}const al=Object.create(null);class ke{constructor(e,n,r,u=w.none){this.type=e,this.attrs=n,this.marks=u,this.content=r||x.empty}get children(){return this.content.content}get nodeSize(){return this.isLeaf?1:2+this.content.size}get childCount(){return this.content.childCount}child(e){return this.content.child(e)}maybeChild(e){return this.content.maybeChild(e)}forEach(e){this.content.forEach(e)}nodesBetween(e,n,r,u=0){this.content.nodesBetween(e,n,r,u,this)}descendants(e){this.nodesBetween(0,this.content.size,e)}get textContent(){return this.isLeaf&&this.type.spec.leafText?this.type.spec.leafText(this):this.textBetween(0,this.content.size,"")}textBetween(e,n,r,u){return this.content.textBetween(e,n,r,u)}get firstChild(){return this.content.firstChild}get lastChild(){return this.content.lastChild}eq(e){return this==e||this.sameMarkup(e)&&this.content.eq(e.content)}sameMarkup(e){return this.hasMarkup(e.type,e.attrs,e.marks)}hasMarkup(e,n,r){return this.type==e&&hn(this.attrs,n||e.defaultAttrs||al)&&w.sameSet(this.marks,r||w.none)}copy(e=null){return e==this.content?this:new ke(this.type,this.attrs,e,this.marks)}mark(e){return e==this.marks?this:new ke(this.type,this.attrs,this.content,e)}cut(e,n=this.content.size){return e==0&&n==this.content.size?this:this.copy(this.content.cut(e,n))}slice(e,n=this.content.size,r=!1){if(e==n)return C.empty;let u=this.resolve(e),i=this.resolve(n),s=r?0:u.sharedDepth(n),o=u.start(s),a=u.node(s).content.cut(u.pos-o,i.pos-o);return new C(a,u.depth-s,i.depth-s)}replace(e,n,r){return il(this.resolve(e),this.resolve(n),r)}nodeAt(e){for(let n=this;;){let{index:r,offset:u}=n.content.findIndex(e);if(n=n.maybeChild(r),!n)return null;if(u==e||n.isText)return n;e-=u+1}}childAfter(e){let{index:n,offset:r}=this.content.findIndex(e);return{node:this.content.maybeChild(n),index:n,offset:r}}childBefore(e){if(e==0)return{node:null,index:0,offset:0};let{index:n,offset:r}=this.content.findIndex(e);if(r<e)return{node:this.content.child(n),index:n,offset:r};let u=this.content.child(n-1);return{node:u,index:n-1,offset:r-u.nodeSize}}resolve(e){return Rt.resolveCached(this,e)}resolveNoCache(e){return Rt.resolve(this,e)}rangeHasMark(e,n,r){let u=!1;return n>e&&this.nodesBetween(e,n,i=>(r.isInSet(i.marks)&&(u=!0),!u)),u}get isBlock(){return this.type.isBlock}get isTextblock(){return this.type.isTextblock}get inlineContent(){return this.type.inlineContent}get isInline(){return this.type.isInline}get isText(){return this.type.isText}get isLeaf(){return this.type.isLeaf}get isAtom(){return this.type.isAtom}toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);let e=this.type.name;return this.content.size&&(e+="("+this.content.toStringInner()+")"),Ui(this.marks,e)}contentMatchAt(e){let n=this.type.contentMatch.matchFragment(this.content,0,e);if(!n)throw new Error("Called contentMatchAt on a node with invalid content");return n}canReplace(e,n,r=x.empty,u=0,i=r.childCount){let s=this.contentMatchAt(e).matchFragment(r,u,i),o=s&&s.matchFragment(this.content,n);if(!o||!o.validEnd)return!1;for(let l=u;l<i;l++)if(!this.type.allowsMarks(r.child(l).marks))return!1;return!0}canReplaceWith(e,n,r,u){if(u&&!this.type.allowsMarks(u))return!1;let i=this.contentMatchAt(e).matchType(r),s=i&&i.matchFragment(this.content,n);return s?s.validEnd:!1}canAppend(e){return e.content.size?this.canReplace(this.childCount,this.childCount,e.content):this.type.compatibleContent(e.type)}check(){this.type.checkContent(this.content),this.type.checkAttrs(this.attrs);let e=w.none;for(let n=0;n<this.marks.length;n++){let r=this.marks[n];r.type.checkAttrs(r.attrs),e=r.addToSet(e)}if(!w.sameSet(e,this.marks))throw new RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map(n=>n.type.name)}`);this.content.forEach(n=>n.check())}toJSON(){let e={type:this.type.name};for(let n in this.attrs){e.attrs=this.attrs;break}return this.content.size&&(e.content=this.content.toJSON()),this.marks.length&&(e.marks=this.marks.map(n=>n.toJSON())),e}static fromJSON(e,n){if(!n)throw new RangeError("Invalid input for Node.fromJSON");let r;if(n.marks){if(!Array.isArray(n.marks))throw new RangeError("Invalid mark data for Node.fromJSON");r=n.marks.map(e.markFromJSON)}if(n.type=="text"){if(typeof n.text!="string")throw new RangeError("Invalid text node in JSON");return e.text(n.text,r)}let u=x.fromJSON(e,n.content),i=e.nodeType(n.type).create(n.attrs,u,r);return i.type.checkAttrs(i.attrs),i}}ke.prototype.text=void 0;class gn extends ke{constructor(e,n,r,u){if(super(e,n,null,u),!r)throw new RangeError("Empty text nodes are not allowed");this.text=r}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):Ui(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(e,n){return this.text.slice(e,n)}get nodeSize(){return this.text.length}mark(e){return e==this.marks?this:new gn(this.type,this.attrs,this.text,e)}withText(e){return e==this.text?this:new gn(this.type,this.attrs,e,this.marks)}cut(e=0,n=this.text.length){return e==0&&n==this.text.length?this:this.withText(this.text.slice(e,n))}eq(e){return this.sameMarkup(e)&&this.text==e.text}toJSON(){let e=super.toJSON();return e.text=this.text,e}}function Ui(t,e){for(let n=t.length-1;n>=0;n--)e=t[n].type.name+"("+e+")";return e}class et{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(e,n){let r=new cl(e,n);if(r.next==null)return et.empty;let u=Ki(r);r.next&&r.err("Unexpected trailing text");let i=bl(gl(u));return xl(i,r),i}matchType(e){for(let n=0;n<this.next.length;n++)if(this.next[n].type==e)return this.next[n].next;return null}matchFragment(e,n=0,r=e.childCount){let u=this;for(let i=n;u&&i<r;i++)u=u.matchType(e.child(i).type);return u}get inlineContent(){return this.next.length!=0&&this.next[0].type.isInline}get defaultType(){for(let e=0;e<this.next.length;e++){let{type:n}=this.next[e];if(!(n.isText||n.hasRequiredAttrs()))return n}return null}compatible(e){for(let n=0;n<this.next.length;n++)for(let r=0;r<e.next.length;r++)if(this.next[n].type==e.next[r].type)return!0;return!1}fillBefore(e,n=!1,r=0){let u=[this];function i(s,o){let l=s.matchFragment(e,r);if(l&&(!n||l.validEnd))return x.from(o.map(a=>a.createAndFill()));for(let a=0;a<s.next.length;a++){let{type:c,next:f}=s.next[a];if(!(c.isText||c.hasRequiredAttrs())&&u.indexOf(f)==-1){u.push(f);let p=i(f,o.concat(c));if(p)return p}}return null}return i(this,[])}findWrapping(e){for(let r=0;r<this.wrapCache.length;r+=2)if(this.wrapCache[r]==e)return this.wrapCache[r+1];let n=this.computeWrapping(e);return this.wrapCache.push(e,n),n}computeWrapping(e){let n=Object.create(null),r=[{match:this,type:null,via:null}];for(;r.length;){let u=r.shift(),i=u.match;if(i.matchType(e)){let s=[];for(let o=u;o.type;o=o.via)s.push(o.type);return s.reverse()}for(let s=0;s<i.next.length;s++){let{type:o,next:l}=i.next[s];!o.isLeaf&&!o.hasRequiredAttrs()&&!(o.name in n)&&(!u.type||l.validEnd)&&(r.push({match:o.contentMatch,type:o,via:u}),n[o.name]=!0)}}return null}get edgeCount(){return this.next.length}edge(e){if(e>=this.next.length)throw new RangeError(`There's no ${e}th edge in this content match`);return this.next[e]}toString(){let e=[];function n(r){e.push(r);for(let u=0;u<r.next.length;u++)e.indexOf(r.next[u].next)==-1&&n(r.next[u].next)}return n(this),e.map((r,u)=>{let i=u+(r.validEnd?"*":" ")+" ";for(let s=0;s<r.next.length;s++)i+=(s?", ":"")+r.next[s].type.name+"->"+e.indexOf(r.next[s].next);return i}).join(`
2
2
  `)}}et.empty=new et(!0);class cl{constructor(e,n){this.string=e,this.nodeTypes=n,this.inline=null,this.pos=0,this.tokens=e.split(/\s*(?=\b|\W|$)/),this.tokens[this.tokens.length-1]==""&&this.tokens.pop(),this.tokens[0]==""&&this.tokens.shift()}get next(){return this.tokens[this.pos]}eat(e){return this.next==e&&(this.pos++||!0)}err(e){throw new SyntaxError(e+" (in content expression '"+this.string+"')")}}function Ki(t){let e=[];do e.push(fl(t));while(t.eat("|"));return e.length==1?e[0]:{type:"choice",exprs:e}}function fl(t){let e=[];do e.push(dl(t));while(t.next&&t.next!=")"&&t.next!="|");return e.length==1?e[0]:{type:"seq",exprs:e}}function dl(t){let e=ml(t);for(;;)if(t.eat("+"))e={type:"plus",expr:e};else if(t.eat("*"))e={type:"star",expr:e};else if(t.eat("?"))e={type:"opt",expr:e};else if(t.eat("{"))e=hl(t,e);else break;return e}function du(t){/\D/.test(t.next)&&t.err("Expected number, got '"+t.next+"'");let e=Number(t.next);return t.pos++,e}function hl(t,e){let n=du(t),r=n;return t.eat(",")&&(t.next!="}"?r=du(t):r=-1),t.eat("}")||t.err("Unclosed braced range"),{type:"range",min:n,max:r,expr:e}}function pl(t,e){let n=t.nodeTypes,r=n[e];if(r)return[r];let u=[];for(let i in n){let s=n[i];s.isInGroup(e)&&u.push(s)}return u.length==0&&t.err("No node type or group '"+e+"' found"),u}function ml(t){if(t.eat("(")){let e=Ki(t);return t.eat(")")||t.err("Missing closing paren"),e}else if(/\W/.test(t.next))t.err("Unexpected token '"+t.next+"'");else{let e=pl(t,t.next).map(n=>(t.inline==null?t.inline=n.isInline:t.inline!=n.isInline&&t.err("Mixing inline and block content"),{type:"name",value:n}));return t.pos++,e.length==1?e[0]:{type:"choice",exprs:e}}}function gl(t){let e=[[]];return u(i(t,0),n()),e;function n(){return e.push([])-1}function r(s,o,l){let a={term:l,to:o};return e[s].push(a),a}function u(s,o){s.forEach(l=>l.to=o)}function i(s,o){if(s.type=="choice")return s.exprs.reduce((l,a)=>l.concat(i(a,o)),[]);if(s.type=="seq")for(let l=0;;l++){let a=i(s.exprs[l],o);if(l==s.exprs.length-1)return a;u(a,o=n())}else if(s.type=="star"){let l=n();return r(o,l),u(i(s.expr,l),l),[r(l)]}else if(s.type=="plus"){let l=n();return u(i(s.expr,o),l),u(i(s.expr,l),l),[r(l)]}else{if(s.type=="opt")return[r(o)].concat(i(s.expr,o));if(s.type=="range"){let l=o;for(let a=0;a<s.min;a++){let c=n();u(i(s.expr,l),c),l=c}if(s.max==-1)u(i(s.expr,l),l);else for(let a=s.min;a<s.max;a++){let c=n();r(l,c),u(i(s.expr,l),c),l=c}return[r(l)]}else{if(s.type=="name")return[r(o,void 0,s.value)];throw new Error("Unknown expr type")}}}}function Zi(t,e){return e-t}function hu(t,e){let n=[];return r(e),n.sort(Zi);function r(u){let i=t[u];if(i.length==1&&!i[0].term)return r(i[0].to);n.push(u);for(let s=0;s<i.length;s++){let{term:o,to:l}=i[s];!o&&n.indexOf(l)==-1&&r(l)}}}function bl(t){let e=Object.create(null);return n(hu(t,0));function n(r){let u=[];r.forEach(s=>{t[s].forEach(({term:o,to:l})=>{if(!o)return;let a;for(let c=0;c<u.length;c++)u[c][0]==o&&(a=u[c][1]);hu(t,l).forEach(c=>{a||u.push([o,a=[]]),a.indexOf(c)==-1&&a.push(c)})})});let i=e[r.join(",")]=new et(r.indexOf(t.length-1)>-1);for(let s=0;s<u.length;s++){let o=u[s][1].sort(Zi);i.next.push({type:u[s][0],next:e[o.join(",")]||n(o)})}return i}}function xl(t,e){for(let n=0,r=[t];n<r.length;n++){let u=r[n],i=!u.validEnd,s=[];for(let o=0;o<u.next.length;o++){let{type:l,next:a}=u.next[o];s.push(l.name),i&&!(l.isText||l.hasRequiredAttrs())&&(i=!1),r.indexOf(a)==-1&&r.push(a)}i&&e.err("Only non-generatable nodes ("+s.join(", ")+") in a required position (see https://prosemirror.net/docs/guide/#generatable)")}}function Gi(t){let e=Object.create(null);for(let n in t){let r=t[n];if(!r.hasDefault)return null;e[n]=r.default}return e}function Yi(t,e){let n=Object.create(null);for(let r in t){let u=e&&e[r];if(u===void 0){let i=t[r];if(i.hasDefault)u=i.default;else throw new RangeError("No value supplied for attribute "+r)}n[r]=u}return n}function Xi(t,e,n,r){for(let u in e)if(!(u in t))throw new RangeError(`Unsupported attribute ${u} for ${n} of type ${u}`);for(let u in t){let i=t[u];i.validate&&i.validate(e[u])}}function Qi(t,e){let n=Object.create(null);if(e)for(let r in e)n[r]=new yl(t,r,e[r]);return n}let pu=class es{constructor(e,n,r){this.name=e,this.schema=n,this.spec=r,this.markSet=null,this.groups=r.group?r.group.split(" "):[],this.attrs=Qi(e,r.attrs),this.defaultAttrs=Gi(this.attrs),this.contentMatch=null,this.inlineContent=null,this.isBlock=!(r.inline||e=="text"),this.isText=e=="text"}get isInline(){return!this.isBlock}get isTextblock(){return this.isBlock&&this.inlineContent}get isLeaf(){return this.contentMatch==et.empty}get isAtom(){return this.isLeaf||!!this.spec.atom}isInGroup(e){return this.groups.indexOf(e)>-1}get whitespace(){return this.spec.whitespace||(this.spec.code?"pre":"normal")}hasRequiredAttrs(){for(let e in this.attrs)if(this.attrs[e].isRequired)return!0;return!1}compatibleContent(e){return this==e||this.contentMatch.compatible(e.contentMatch)}computeAttrs(e){return!e&&this.defaultAttrs?this.defaultAttrs:Yi(this.attrs,e)}create(e=null,n,r){if(this.isText)throw new Error("NodeType.create can't construct text nodes");return new ke(this,this.computeAttrs(e),x.from(n),w.setFrom(r))}createChecked(e=null,n,r){return n=x.from(n),this.checkContent(n),new ke(this,this.computeAttrs(e),n,w.setFrom(r))}createAndFill(e=null,n,r){if(e=this.computeAttrs(e),n=x.from(n),n.size){let s=this.contentMatch.fillBefore(n);if(!s)return null;n=s.append(n)}let u=this.contentMatch.matchFragment(n),i=u&&u.fillBefore(x.empty,!0);return i?new ke(this,e,n.append(i),w.setFrom(r)):null}validContent(e){let n=this.contentMatch.matchFragment(e);if(!n||!n.validEnd)return!1;for(let r=0;r<e.childCount;r++)if(!this.allowsMarks(e.child(r).marks))return!1;return!0}checkContent(e){if(!this.validContent(e))throw new RangeError(`Invalid content for node ${this.name}: ${e.toString().slice(0,50)}`)}checkAttrs(e){Xi(this.attrs,e,"node",this.name)}allowsMarkType(e){return this.markSet==null||this.markSet.indexOf(e)>-1}allowsMarks(e){if(this.markSet==null)return!0;for(let n=0;n<e.length;n++)if(!this.allowsMarkType(e[n].type))return!1;return!0}allowedMarks(e){if(this.markSet==null)return e;let n;for(let r=0;r<e.length;r++)this.allowsMarkType(e[r].type)?n&&n.push(e[r]):n||(n=e.slice(0,r));return n?n.length?n:w.none:e}static compile(e,n){let r=Object.create(null);e.forEach((i,s)=>r[i]=new es(i,n,s));let u=n.spec.topNode||"doc";if(!r[u])throw new RangeError("Schema is missing its top node type ('"+u+"')");if(!r.text)throw new RangeError("Every schema needs a 'text' type");for(let i in r.text.attrs)throw new RangeError("The text node type should not have attributes");return r}};function kl(t,e,n){let r=n.split("|");return u=>{let i=u===null?"null":typeof u;if(r.indexOf(i)<0)throw new RangeError(`Expected value of type ${r} for attribute ${e} on type ${t}, got ${i}`)}}class yl{constructor(e,n,r){this.hasDefault=Object.prototype.hasOwnProperty.call(r,"default"),this.default=r.default,this.validate=typeof r.validate=="string"?kl(e,n,r.validate):r.validate}get isRequired(){return!this.hasDefault}}class Mn{constructor(e,n,r,u){this.name=e,this.rank=n,this.schema=r,this.spec=u,this.attrs=Qi(e,u.attrs),this.excluded=null;let i=Gi(this.attrs);this.instance=i?new w(this,i):null}create(e=null){return!e&&this.instance?this.instance:new w(this,Yi(this.attrs,e))}static compile(e,n){let r=Object.create(null),u=0;return e.forEach((i,s)=>r[i]=new Mn(i,u++,n,s)),r}removeFromSet(e){for(var n=0;n<e.length;n++)e[n].type==this&&(e=e.slice(0,n).concat(e.slice(n+1)),n--);return e}isInSet(e){for(let n=0;n<e.length;n++)if(e[n].type==this)return e[n]}checkAttrs(e){Xi(this.attrs,e,"mark",this.name)}excludes(e){return this.excluded.indexOf(e)>-1}}class zr{constructor(e){this.linebreakReplacement=null,this.cached=Object.create(null);let n=this.spec={};for(let u in e)n[u]=e[u];n.nodes=q.from(e.nodes),n.marks=q.from(e.marks||{}),this.nodes=pu.compile(this.spec.nodes,this),this.marks=Mn.compile(this.spec.marks,this);let r=Object.create(null);for(let u in this.nodes){if(u in this.marks)throw new RangeError(u+" can not be both a node and a mark");let i=this.nodes[u],s=i.spec.content||"",o=i.spec.marks;if(i.contentMatch=r[s]||(r[s]=et.parse(s,this.nodes)),i.inlineContent=i.contentMatch.inlineContent,i.spec.linebreakReplacement){if(this.linebreakReplacement)throw new RangeError("Multiple linebreak nodes defined");if(!i.isInline||!i.isLeaf)throw new RangeError("Linebreak replacement nodes must be inline leaf nodes");this.linebreakReplacement=i}i.markSet=o=="_"?null:o?mu(this,o.split(" ")):o==""||!i.inlineContent?[]:null}for(let u in this.marks){let i=this.marks[u],s=i.spec.excludes;i.excluded=s==null?[i]:s==""?[]:mu(this,s.split(" "))}this.nodeFromJSON=u=>ke.fromJSON(this,u),this.markFromJSON=u=>w.fromJSON(this,u),this.topNodeType=this.nodes[this.spec.topNode||"doc"],this.cached.wrappings=Object.create(null)}node(e,n=null,r,u){if(typeof e=="string")e=this.nodeType(e);else if(e instanceof pu){if(e.schema!=this)throw new RangeError("Node type from different schema used ("+e.name+")")}else throw new RangeError("Invalid node type: "+e);return e.createChecked(n,r,u)}text(e,n){let r=this.nodes.text;return new gn(r,r.defaultAttrs,e,w.setFrom(n))}mark(e,n){return typeof e=="string"&&(e=this.marks[e]),e.create(n)}nodeType(e){let n=this.nodes[e];if(!n)throw new RangeError("Unknown node type: "+e);return n}}function mu(t,e){let n=[];for(let r=0;r<e.length;r++){let u=e[r],i=t.marks[u],s=i;if(i)n.push(i);else for(let o in t.marks){let l=t.marks[o];(u=="_"||l.spec.group&&l.spec.group.split(" ").indexOf(u)>-1)&&n.push(s=l)}if(!s)throw new SyntaxError("Unknown mark type: '"+e[r]+"'")}return n}function Cl(t){return t.tag!=null}function Dl(t){return t.style!=null}class Bt{constructor(e,n){this.schema=e,this.rules=n,this.tags=[],this.styles=[];let r=this.matchedStyles=[];n.forEach(u=>{if(Cl(u))this.tags.push(u);else if(Dl(u)){let i=/[^=]*/.exec(u.style)[0];r.indexOf(i)<0&&r.push(i),this.styles.push(u)}}),this.normalizeLists=!this.tags.some(u=>{if(!/^(ul|ol)\b/.test(u.tag)||!u.node)return!1;let i=e.nodes[u.node];return i.contentMatch.matchType(i)})}parse(e,n={}){let r=new bu(this,n,!1);return r.addAll(e,w.none,n.from,n.to),r.finish()}parseSlice(e,n={}){let r=new bu(this,n,!0);return r.addAll(e,w.none,n.from,n.to),C.maxOpen(r.finish())}matchTag(e,n,r){for(let u=r?this.tags.indexOf(r)+1:0;u<this.tags.length;u++){let i=this.tags[u];if(Sl(e,i.tag)&&(i.namespace===void 0||e.namespaceURI==i.namespace)&&(!i.context||n.matchesContext(i.context))){if(i.getAttrs){let s=i.getAttrs(e);if(s===!1)continue;i.attrs=s||void 0}return i}}}matchStyle(e,n,r,u){for(let i=u?this.styles.indexOf(u)+1:0;i<this.styles.length;i++){let s=this.styles[i],o=s.style;if(!(o.indexOf(e)!=0||s.context&&!r.matchesContext(s.context)||o.length>e.length&&(o.charCodeAt(e.length)!=61||o.slice(e.length+1)!=n))){if(s.getAttrs){let l=s.getAttrs(n);if(l===!1)continue;s.attrs=l||void 0}return s}}}static schemaRules(e){let n=[];function r(u){let i=u.priority==null?50:u.priority,s=0;for(;s<n.length;s++){let o=n[s];if((o.priority==null?50:o.priority)<i)break}n.splice(s,0,u)}for(let u in e.marks){let i=e.marks[u].spec.parseDOM;i&&i.forEach(s=>{r(s=xu(s)),s.mark||s.ignore||s.clearMark||(s.mark=u)})}for(let u in e.nodes){let i=e.nodes[u].spec.parseDOM;i&&i.forEach(s=>{r(s=xu(s)),s.node||s.ignore||s.mark||(s.node=u)})}return n}static fromSchema(e){return e.cached.domParser||(e.cached.domParser=new Bt(e,Bt.schemaRules(e)))}}const ts={address:!0,article:!0,aside:!0,blockquote:!0,canvas:!0,dd:!0,div:!0,dl:!0,fieldset:!0,figcaption:!0,figure:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,li:!0,noscript:!0,ol:!0,output:!0,p:!0,pre:!0,section:!0,table:!0,tfoot:!0,ul:!0},_l={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},ns={ol:!0,ul:!0},vt=1,br=2,Tt=4;function gu(t,e,n){return e!=null?(e?vt:0)|(e==="full"?br:0):t&&t.whitespace=="pre"?vt|br:n&~Tt}class rn{constructor(e,n,r,u,i,s){this.type=e,this.attrs=n,this.marks=r,this.solid=u,this.options=s,this.content=[],this.activeMarks=w.none,this.match=i||(s&Tt?null:e.contentMatch)}findWrapping(e){if(!this.match){if(!this.type)return[];let n=this.type.contentMatch.fillBefore(x.from(e));if(n)this.match=this.type.contentMatch.matchFragment(n);else{let r=this.type.contentMatch,u;return(u=r.findWrapping(e.type))?(this.match=r,u):null}}return this.match.findWrapping(e.type)}finish(e){if(!(this.options&vt)){let r=this.content[this.content.length-1],u;if(r&&r.isText&&(u=/[ \t\r\n\u000c]+$/.exec(r.text))){let i=r;r.text.length==u[0].length?this.content.pop():this.content[this.content.length-1]=i.withText(i.text.slice(0,i.text.length-u[0].length))}}let n=x.from(this.content);return!e&&this.match&&(n=n.append(this.match.fillBefore(x.empty,!0))),this.type?this.type.create(this.attrs,n,this.marks):n}inlineContext(e){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:e.parentNode&&!ts.hasOwnProperty(e.parentNode.nodeName.toLowerCase())}}class bu{constructor(e,n,r){this.parser=e,this.options=n,this.isOpen=r,this.open=0,this.localPreserveWS=!1;let u=n.topNode,i,s=gu(null,n.preserveWhitespace,0)|(r?Tt:0);u?i=new rn(u.type,u.attrs,w.none,!0,n.topMatch||u.type.contentMatch,s):r?i=new rn(null,null,w.none,!0,null,s):i=new rn(e.schema.topNodeType,null,w.none,!0,null,s),this.nodes=[i],this.find=n.findPositions,this.needsBlock=!1}get top(){return this.nodes[this.open]}addDOM(e,n){e.nodeType==3?this.addTextNode(e,n):e.nodeType==1&&this.addElement(e,n)}addTextNode(e,n){let r=e.nodeValue,u=this.top,i=u.options&br?"full":this.localPreserveWS||(u.options&vt)>0;if(i==="full"||u.inlineContext(e)||/[^ \t\r\n\u000c]/.test(r)){if(i)i!=="full"?r=r.replace(/\r?\n|\r/g," "):r=r.replace(/\r\n?/g,`
3
3
  `);else if(r=r.replace(/[ \t\r\n\u000c]+/g," "),/^[ \t\r\n\u000c]/.test(r)&&this.open==this.nodes.length-1){let s=u.content[u.content.length-1],o=e.previousSibling;(!s||o&&o.nodeName=="BR"||s.isText&&/[ \t\r\n\u000c]$/.test(s.text))&&(r=r.slice(1))}r&&this.insertNode(this.parser.schema.text(r),n,!/\S/.test(r)),this.findInText(e)}else this.findInside(e)}addElement(e,n,r){let u=this.localPreserveWS,i=this.top;(e.tagName=="PRE"||/pre/.test(e.style&&e.style.whiteSpace))&&(this.localPreserveWS=!0);let s=e.nodeName.toLowerCase(),o;ns.hasOwnProperty(s)&&this.parser.normalizeLists&&El(e);let l=this.options.ruleFromNode&&this.options.ruleFromNode(e)||(o=this.parser.matchTag(e,this,r));e:if(l?l.ignore:_l.hasOwnProperty(s))this.findInside(e),this.ignoreFallback(e,n);else if(!l||l.skip||l.closeParent){l&&l.closeParent?this.open=Math.max(0,this.open-1):l&&l.skip.nodeType&&(e=l.skip);let a,c=this.needsBlock;if(ts.hasOwnProperty(s))i.content.length&&i.content[0].isInline&&this.open&&(this.open--,i=this.top),a=!0,i.type||(this.needsBlock=!0);else if(!e.firstChild){this.leafFallback(e,n);break e}let f=l&&l.skip?n:this.readStyles(e,n);f&&this.addAll(e,f),a&&this.sync(i),this.needsBlock=c}else{let a=this.readStyles(e,n);a&&this.addElementByRule(e,l,a,l.consuming===!1?o:void 0)}this.localPreserveWS=u}leafFallback(e,n){e.nodeName=="BR"&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(e.ownerDocument.createTextNode(`
4
4
  `),n)}ignoreFallback(e,n){e.nodeName=="BR"&&(!this.top.type||!this.top.type.inlineContent)&&this.findPlace(this.parser.schema.text("-"),n,!0)}readStyles(e,n){let r=e.style;if(r&&r.length)for(let u=0;u<this.parser.matchedStyles.length;u++){let i=this.parser.matchedStyles[u],s=r.getPropertyValue(i);if(s)for(let o=void 0;;){let l=this.parser.matchStyle(i,s,this,o);if(!l)break;if(l.ignore)return null;if(l.clearMark?n=n.filter(a=>!l.clearMark(a)):n=n.concat(this.parser.schema.marks[l.mark].create(l.attrs)),l.consuming===!1)o=l;else break}}return n}addElementByRule(e,n,r,u){let i,s;if(n.node)if(s=this.parser.schema.nodes[n.node],s.isLeaf)this.insertNode(s.create(n.attrs),r,e.nodeName=="BR")||this.leafFallback(e,r);else{let l=this.enter(s,n.attrs||null,r,n.preserveWhitespace);l&&(i=!0,r=l)}else{let l=this.parser.schema.marks[n.mark];r=r.concat(l.create(n.attrs))}let o=this.top;if(s&&s.isLeaf)this.findInside(e);else if(u)this.addElement(e,r,u);else if(n.getContent)this.findInside(e),n.getContent(e,this.parser.schema).forEach(l=>this.insertNode(l,r,!1));else{let l=e;typeof n.contentElement=="string"?l=e.querySelector(n.contentElement):typeof n.contentElement=="function"?l=n.contentElement(e):n.contentElement&&(l=n.contentElement),this.findAround(e,l,!0),this.addAll(l,r),this.findAround(e,l,!1)}i&&this.sync(o)&&this.open--}addAll(e,n,r,u){let i=r||0;for(let s=r?e.childNodes[r]:e.firstChild,o=u==null?null:e.childNodes[u];s!=o;s=s.nextSibling,++i)this.findAtPoint(e,i),this.addDOM(s,n);this.findAtPoint(e,i)}findPlace(e,n,r){let u,i;for(let s=this.open,o=0;s>=0;s--){let l=this.nodes[s],a=l.findWrapping(e);if(a&&(!u||u.length>a.length+o)&&(u=a,i=l,!a.length))break;if(l.solid){if(r)break;o+=2}}if(!u)return null;this.sync(i);for(let s=0;s<u.length;s++)n=this.enterInner(u[s],null,n,!1);return n}insertNode(e,n,r){if(e.isInline&&this.needsBlock&&!this.top.type){let i=this.textblockFromContext();i&&(n=this.enterInner(i,null,n))}let u=this.findPlace(e,n,r);if(u){this.closeExtra();let i=this.top;i.match&&(i.match=i.match.matchType(e.type));let s=w.none;for(let o of u.concat(e.marks))(i.type?i.type.allowsMarkType(o.type):ku(o.type,e.type))&&(s=o.addToSet(s));return i.content.push(e.mark(s)),!0}return!1}enter(e,n,r,u){let i=this.findPlace(e.create(n),r,!1);return i&&(i=this.enterInner(e,n,r,!0,u)),i}enterInner(e,n,r,u=!1,i){this.closeExtra();let s=this.top;s.match=s.match&&s.match.matchType(e);let o=gu(e,i,s.options);s.options&Tt&&s.content.length==0&&(o|=Tt);let l=w.none;return r=r.filter(a=>(s.type?s.type.allowsMarkType(a.type):ku(a.type,e))?(l=a.addToSet(l),!1):!0),this.nodes.push(new rn(e,n,l,u,null,o)),this.open++,r}closeExtra(e=!1){let n=this.nodes.length-1;if(n>this.open){for(;n>this.open;n--)this.nodes[n-1].content.push(this.nodes[n].finish(e));this.nodes.length=this.open+1}}finish(){return this.open=0,this.closeExtra(this.isOpen),this.nodes[0].finish(!!(this.isOpen||this.options.topOpen))}sync(e){for(let n=this.open;n>=0;n--){if(this.nodes[n]==e)return this.open=n,!0;this.localPreserveWS&&(this.nodes[n].options|=vt)}return!1}get currentPos(){this.closeExtra();let e=0;for(let n=this.open;n>=0;n--){let r=this.nodes[n].content;for(let u=r.length-1;u>=0;u--)e+=r[u].nodeSize;n&&e++}return e}findAtPoint(e,n){if(this.find)for(let r=0;r<this.find.length;r++)this.find[r].node==e&&this.find[r].offset==n&&(this.find[r].pos=this.currentPos)}findInside(e){if(this.find)for(let n=0;n<this.find.length;n++)this.find[n].pos==null&&e.nodeType==1&&e.contains(this.find[n].node)&&(this.find[n].pos=this.currentPos)}findAround(e,n,r){if(e!=n&&this.find)for(let u=0;u<this.find.length;u++)this.find[u].pos==null&&e.nodeType==1&&e.contains(this.find[u].node)&&n.compareDocumentPosition(this.find[u].node)&(r?2:4)&&(this.find[u].pos=this.currentPos)}findInText(e){if(this.find)for(let n=0;n<this.find.length;n++)this.find[n].node==e&&(this.find[n].pos=this.currentPos-(e.nodeValue.length-this.find[n].offset))}matchesContext(e){if(e.indexOf("|")>-1)return e.split(/\s*\|\s*/).some(this.matchesContext,this);let n=e.split("/"),r=this.options.context,u=!this.isOpen&&(!r||r.parent.type==this.nodes[0].type),i=-(r?r.depth+1:0)+(u?0:1),s=(o,l)=>{for(;o>=0;o--){let a=n[o];if(a==""){if(o==n.length-1||o==0)continue;for(;l>=i;l--)if(s(o-1,l))return!0;return!1}else{let c=l>0||l==0&&u?this.nodes[l].type:r&&l>=i?r.node(l-i).type:null;if(!c||c.name!=a&&!c.isInGroup(a))return!1;l--}}return!0};return s(n.length-1,this.open)}textblockFromContext(){let e=this.options.context;if(e)for(let n=e.depth;n>=0;n--){let r=e.node(n).contentMatchAt(e.indexAfter(n)).defaultType;if(r&&r.isTextblock&&r.defaultAttrs)return r}for(let n in this.parser.schema.nodes){let r=this.parser.schema.nodes[n];if(r.isTextblock&&r.defaultAttrs)return r}}}function El(t){for(let e=t.firstChild,n=null;e;e=e.nextSibling){let r=e.nodeType==1?e.nodeName.toLowerCase():null;r&&ns.hasOwnProperty(r)&&n?(n.appendChild(e),e=n):r=="li"?n=e:r&&(n=null)}}function Sl(t,e){return(t.matches||t.msMatchesSelector||t.webkitMatchesSelector||t.mozMatchesSelector).call(t,e)}function xu(t){let e={};for(let n in t)e[n]=t[n];return e}function ku(t,e){let n=e.schema.nodes;for(let r in n){let u=n[r];if(!u.allowsMarkType(t))continue;let i=[],s=o=>{i.push(o);for(let l=0;l<o.edgeCount;l++){let{type:a,next:c}=o.edge(l);if(a==e||i.indexOf(c)<0&&s(c))return!0}};if(s(u.contentMatch))return!0}}class xt{constructor(e,n){this.nodes=e,this.marks=n}serializeFragment(e,n={},r){r||(r=$n(n).createDocumentFragment());let u=r,i=[];return e.forEach(s=>{if(i.length||s.marks.length){let o=0,l=0;for(;o<i.length&&l<s.marks.length;){let a=s.marks[l];if(!this.marks[a.type.name]){l++;continue}if(!a.eq(i[o][0])||a.type.spec.spanning===!1)break;o++,l++}for(;o<i.length;)u=i.pop()[1];for(;l<s.marks.length;){let a=s.marks[l++],c=this.serializeMark(a,s.isInline,n);c&&(i.push([a,u]),u.appendChild(c.dom),u=c.contentDOM||c.dom)}}u.appendChild(this.serializeNodeInner(s,n))}),r}serializeNodeInner(e,n){let{dom:r,contentDOM:u}=an($n(n),this.nodes[e.type.name](e),null,e.attrs);if(u){if(e.isLeaf)throw new RangeError("Content hole not allowed in a leaf node spec");this.serializeFragment(e.content,n,u)}return r}serializeNode(e,n={}){let r=this.serializeNodeInner(e,n);for(let u=e.marks.length-1;u>=0;u--){let i=this.serializeMark(e.marks[u],e.isInline,n);i&&((i.contentDOM||i.dom).appendChild(r),r=i.dom)}return r}serializeMark(e,n,r={}){let u=this.marks[e.type.name];return u&&an($n(r),u(e,n),null,e.attrs)}static renderSpec(e,n,r=null,u){return an(e,n,r,u)}static fromSchema(e){return e.cached.domSerializer||(e.cached.domSerializer=new xt(this.nodesFromSchema(e),this.marksFromSchema(e)))}static nodesFromSchema(e){let n=yu(e.nodes);return n.text||(n.text=r=>r.text),n}static marksFromSchema(e){return yu(e.marks)}}function yu(t){let e={};for(let n in t){let r=t[n].spec.toDOM;r&&(e[n]=r)}return e}function $n(t){return t.document||window.document}const Cu=new WeakMap;function Al(t){let e=Cu.get(t);return e===void 0&&Cu.set(t,e=Ml(t)),e}function Ml(t){let e=null;function n(r){if(r&&typeof r=="object")if(Array.isArray(r))if(typeof r[0]=="string")e||(e=[]),e.push(r);else for(let u=0;u<r.length;u++)n(r[u]);else for(let u in r)n(r[u])}return n(t),e}function an(t,e,n,r){if(typeof e=="string")return{dom:t.createTextNode(e)};if(e.nodeType!=null)return{dom:e};if(e.dom&&e.dom.nodeType!=null)return e;let u=e[0],i;if(typeof u!="string")throw new RangeError("Invalid array passed to renderSpec");if(r&&(i=Al(r))&&i.indexOf(e)>-1)throw new RangeError("Using an array from an attribute object as a DOM spec. This may be an attempted cross site scripting attack.");let s=u.indexOf(" ");s>0&&(n=u.slice(0,s),u=u.slice(s+1));let o,l=n?t.createElementNS(n,u):t.createElement(u),a=e[1],c=1;if(a&&typeof a=="object"&&a.nodeType==null&&!Array.isArray(a)){c=2;for(let f in a)if(a[f]!=null){let p=f.indexOf(" ");p>0?l.setAttributeNS(f.slice(0,p),f.slice(p+1),a[f]):f=="style"&&l.style?l.style.cssText=a[f]:l.setAttribute(f,a[f])}}for(let f=c;f<e.length;f++){let p=e[f];if(p===0){if(f<e.length-1||f>c)throw new RangeError("Content hole must be the only child of its parent node");return{dom:l,contentDOM:l}}else{let{dom:h,contentDOM:d}=an(t,p,n,r);if(l.appendChild(h),d){if(o)throw new RangeError("Multiple content holes");o=d}}}return{dom:l,contentDOM:o}}const rs=65535,us=Math.pow(2,16);function wl(t,e){return t+e*us}function Du(t){return t&rs}function Tl(t){return(t-(t&rs))/us}const is=1,ss=2,cn=4,ls=8;class xr{constructor(e,n,r){this.pos=e,this.delInfo=n,this.recover=r}get deleted(){return(this.delInfo&ls)>0}get deletedBefore(){return(this.delInfo&(is|cn))>0}get deletedAfter(){return(this.delInfo&(ss|cn))>0}get deletedAcross(){return(this.delInfo&cn)>0}}class Q{constructor(e,n=!1){if(this.ranges=e,this.inverted=n,!e.length&&Q.empty)return Q.empty}recover(e){let n=0,r=Du(e);if(!this.inverted)for(let u=0;u<r;u++)n+=this.ranges[u*3+2]-this.ranges[u*3+1];return this.ranges[r*3]+n+Tl(e)}mapResult(e,n=1){return this._map(e,n,!1)}map(e,n=1){return this._map(e,n,!0)}_map(e,n,r){let u=0,i=this.inverted?2:1,s=this.inverted?1:2;for(let o=0;o<this.ranges.length;o+=3){let l=this.ranges[o]-(this.inverted?u:0);if(l>e)break;let a=this.ranges[o+i],c=this.ranges[o+s],f=l+a;if(e<=f){let p=a?e==l?-1:e==f?1:n:n,h=l+u+(p<0?0:c);if(r)return h;let d=e==(n<0?l:f)?null:wl(o/3,e-l),m=e==l?ss:e==f?is:cn;return(n<0?e!=l:e!=f)&&(m|=ls),new xr(h,m,d)}u+=c-a}return r?e+u:new xr(e+u,0,null)}touches(e,n){let r=0,u=Du(n),i=this.inverted?2:1,s=this.inverted?1:2;for(let o=0;o<this.ranges.length;o+=3){let l=this.ranges[o]-(this.inverted?r:0);if(l>e)break;let a=this.ranges[o+i],c=l+a;if(e<=c&&o==u*3)return!0;r+=this.ranges[o+s]-a}return!1}forEach(e){let n=this.inverted?2:1,r=this.inverted?1:2;for(let u=0,i=0;u<this.ranges.length;u+=3){let s=this.ranges[u],o=s-(this.inverted?i:0),l=s+(this.inverted?0:i),a=this.ranges[u+n],c=this.ranges[u+r];e(o,o+a,l,l+c),i+=c-a}}invert(){return new Q(this.ranges,!this.inverted)}toString(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)}static offset(e){return e==0?Q.empty:new Q(e<0?[0,-e,0]:[0,0,e])}}Q.empty=new Q([]);class zt{constructor(e,n,r=0,u=e?e.length:0){this.mirror=n,this.from=r,this.to=u,this._maps=e||[],this.ownData=!(e||n)}get maps(){return this._maps}slice(e=0,n=this.maps.length){return new zt(this._maps,this.mirror,e,n)}appendMap(e,n){this.ownData||(this._maps=this._maps.slice(),this.mirror=this.mirror&&this.mirror.slice(),this.ownData=!0),this.to=this._maps.push(e),n!=null&&this.setMirror(this._maps.length-1,n)}appendMapping(e){for(let n=0,r=this._maps.length;n<e._maps.length;n++){let u=e.getMirror(n);this.appendMap(e._maps[n],u!=null&&u<n?r+u:void 0)}}getMirror(e){if(this.mirror){for(let n=0;n<this.mirror.length;n++)if(this.mirror[n]==e)return this.mirror[n+(n%2?-1:1)]}}setMirror(e,n){this.mirror||(this.mirror=[]),this.mirror.push(e,n)}appendMappingInverted(e){for(let n=e.maps.length-1,r=this._maps.length+e._maps.length;n>=0;n--){let u=e.getMirror(n);this.appendMap(e._maps[n].invert(),u!=null&&u>n?r-u-1:void 0)}}invert(){let e=new zt;return e.appendMappingInverted(this),e}map(e,n=1){if(this.mirror)return this._map(e,n,!0);for(let r=this.from;r<this.to;r++)e=this._maps[r].map(e,n);return e}mapResult(e,n=1){return this._map(e,n,!1)}_map(e,n,r){let u=0;for(let i=this.from;i<this.to;i++){let s=this._maps[i],o=s.mapResult(e,n);if(o.recover!=null){let l=this.getMirror(i);if(l!=null&&l>i&&l<this.to){i=l,e=this._maps[l].recover(o.recover);continue}}u|=o.delInfo,e=o.pos}return r?e:new xr(e,u,null)}}const Wn=Object.create(null);class j{getMap(){return Q.empty}merge(e){return null}static fromJSON(e,n){if(!n||!n.stepType)throw new RangeError("Invalid input for Step.fromJSON");let r=Wn[n.stepType];if(!r)throw new RangeError(`No step type ${n.stepType} defined`);return r.fromJSON(e,n)}static jsonID(e,n){if(e in Wn)throw new RangeError("Duplicate use of step JSON ID "+e);return Wn[e]=n,n.prototype.jsonID=e,n}}class B{constructor(e,n){this.doc=e,this.failed=n}static ok(e){return new B(e,null)}static fail(e){return new B(null,e)}static fromReplace(e,n,r,u){try{return B.ok(e.replace(n,r,u))}catch(i){if(i instanceof pn)return B.fail(i.message);throw i}}}function Pr(t,e,n){let r=[];for(let u=0;u<t.childCount;u++){let i=t.child(u);i.content.size&&(i=i.copy(Pr(i.content,e,i))),i.isInline&&(i=e(i,n,u)),r.push(i)}return x.fromArray(r)}class Be extends j{constructor(e,n,r){super(),this.from=e,this.to=n,this.mark=r}apply(e){let n=e.slice(this.from,this.to),r=e.resolve(this.from),u=r.node(r.sharedDepth(this.to)),i=new C(Pr(n.content,(s,o)=>!s.isAtom||!o.type.allowsMarkType(this.mark.type)?s:s.mark(this.mark.addToSet(s.marks)),u),n.openStart,n.openEnd);return B.fromReplace(e,this.from,this.to,i)}invert(){return new ge(this.from,this.to,this.mark)}map(e){let n=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new Be(n.pos,r.pos,this.mark)}merge(e){return e instanceof Be&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new Be(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new Be(n.from,n.to,e.markFromJSON(n.mark))}}j.jsonID("addMark",Be);class ge extends j{constructor(e,n,r){super(),this.from=e,this.to=n,this.mark=r}apply(e){let n=e.slice(this.from,this.to),r=new C(Pr(n.content,u=>u.mark(this.mark.removeFromSet(u.marks)),e),n.openStart,n.openEnd);return B.fromReplace(e,this.from,this.to,r)}invert(){return new Be(this.from,this.to,this.mark)}map(e){let n=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new ge(n.pos,r.pos,this.mark)}merge(e){return e instanceof ge&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new ge(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new ge(n.from,n.to,e.markFromJSON(n.mark))}}j.jsonID("removeMark",ge);class ve extends j{constructor(e,n){super(),this.pos=e,this.mark=n}apply(e){let n=e.nodeAt(this.pos);if(!n)return B.fail("No node at mark step's position");let r=n.type.create(n.attrs,null,this.mark.addToSet(n.marks));return B.fromReplace(e,this.pos,this.pos+1,new C(x.from(r),0,n.isLeaf?0:1))}invert(e){let n=e.nodeAt(this.pos);if(n){let r=this.mark.addToSet(n.marks);if(r.length==n.marks.length){for(let u=0;u<n.marks.length;u++)if(!n.marks[u].isInSet(r))return new ve(this.pos,n.marks[u]);return new ve(this.pos,this.mark)}}return new tt(this.pos,this.mark)}map(e){let n=e.mapResult(this.pos,1);return n.deletedAfter?null:new ve(n.pos,this.mark)}toJSON(){return{stepType:"addNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,n){if(typeof n.pos!="number")throw new RangeError("Invalid input for AddNodeMarkStep.fromJSON");return new ve(n.pos,e.markFromJSON(n.mark))}}j.jsonID("addNodeMark",ve);class tt extends j{constructor(e,n){super(),this.pos=e,this.mark=n}apply(e){let n=e.nodeAt(this.pos);if(!n)return B.fail("No node at mark step's position");let r=n.type.create(n.attrs,null,this.mark.removeFromSet(n.marks));return B.fromReplace(e,this.pos,this.pos+1,new C(x.from(r),0,n.isLeaf?0:1))}invert(e){let n=e.nodeAt(this.pos);return!n||!this.mark.isInSet(n.marks)?this:new ve(this.pos,this.mark)}map(e){let n=e.mapResult(this.pos,1);return n.deletedAfter?null:new tt(n.pos,this.mark)}toJSON(){return{stepType:"removeNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,n){if(typeof n.pos!="number")throw new RangeError("Invalid input for RemoveNodeMarkStep.fromJSON");return new tt(n.pos,e.markFromJSON(n.mark))}}j.jsonID("removeNodeMark",tt);class H extends j{constructor(e,n,r,u=!1){super(),this.from=e,this.to=n,this.slice=r,this.structure=u}apply(e){return this.structure&&kr(e,this.from,this.to)?B.fail("Structure replace would overwrite content"):B.fromReplace(e,this.from,this.to,this.slice)}getMap(){return new Q([this.from,this.to-this.from,this.slice.size])}invert(e){return new H(this.from,this.from+this.slice.size,e.slice(this.from,this.to))}map(e){let n=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return n.deletedAcross&&r.deletedAcross?null:new H(n.pos,Math.max(n.pos,r.pos),this.slice,this.structure)}merge(e){if(!(e instanceof H)||e.structure||this.structure)return null;if(this.from+this.slice.size==e.from&&!this.slice.openEnd&&!e.slice.openStart){let n=this.slice.size+e.slice.size==0?C.empty:new C(this.slice.content.append(e.slice.content),this.slice.openStart,e.slice.openEnd);return new H(this.from,this.to+(e.to-e.from),n,this.structure)}else if(e.to==this.from&&!this.slice.openStart&&!e.slice.openEnd){let n=this.slice.size+e.slice.size==0?C.empty:new C(e.slice.content.append(this.slice.content),e.slice.openStart,this.slice.openEnd);return new H(e.from,this.to,n,this.structure)}else return null}toJSON(){let e={stepType:"replace",from:this.from,to:this.to};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(e,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for ReplaceStep.fromJSON");return new H(n.from,n.to,C.fromJSON(e,n.slice),!!n.structure)}}j.jsonID("replace",H);class G extends j{constructor(e,n,r,u,i,s,o=!1){super(),this.from=e,this.to=n,this.gapFrom=r,this.gapTo=u,this.slice=i,this.insert=s,this.structure=o}apply(e){if(this.structure&&(kr(e,this.from,this.gapFrom)||kr(e,this.gapTo,this.to)))return B.fail("Structure gap-replace would overwrite content");let n=e.slice(this.gapFrom,this.gapTo);if(n.openStart||n.openEnd)return B.fail("Gap is not a flat range");let r=this.slice.insertAt(this.insert,n.content);return r?B.fromReplace(e,this.from,this.to,r):B.fail("Content does not fit in gap")}getMap(){return new Q([this.from,this.gapFrom-this.from,this.insert,this.gapTo,this.to-this.gapTo,this.slice.size-this.insert])}invert(e){let n=this.gapTo-this.gapFrom;return new G(this.from,this.from+this.slice.size+n,this.from+this.insert,this.from+this.insert+n,e.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure)}map(e){let n=e.mapResult(this.from,1),r=e.mapResult(this.to,-1),u=this.from==this.gapFrom?n.pos:e.map(this.gapFrom,-1),i=this.to==this.gapTo?r.pos:e.map(this.gapTo,1);return n.deletedAcross&&r.deletedAcross||u<n.pos||i>r.pos?null:new G(n.pos,r.pos,u,i,this.slice,this.insert,this.structure)}toJSON(){let e={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(e,n){if(typeof n.from!="number"||typeof n.to!="number"||typeof n.gapFrom!="number"||typeof n.gapTo!="number"||typeof n.insert!="number")throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new G(n.from,n.to,n.gapFrom,n.gapTo,C.fromJSON(e,n.slice),n.insert,!!n.structure)}}j.jsonID("replaceAround",G);function kr(t,e,n){let r=t.resolve(e),u=n-e,i=r.depth;for(;u>0&&i>0&&r.indexAfter(i)==r.node(i).childCount;)i--,u--;if(u>0){let s=r.node(i).maybeChild(r.indexAfter(i));for(;u>0;){if(!s||s.isLeaf)return!0;s=s.firstChild,u--}}return!1}function Ol(t,e,n,r){let u=[],i=[],s,o;t.doc.nodesBetween(e,n,(l,a,c)=>{if(!l.isInline)return;let f=l.marks;if(!r.isInSet(f)&&c.type.allowsMarkType(r.type)){let p=Math.max(a,e),h=Math.min(a+l.nodeSize,n),d=r.addToSet(f);for(let m=0;m<f.length;m++)f[m].isInSet(d)||(s&&s.to==p&&s.mark.eq(f[m])?s.to=h:u.push(s=new ge(p,h,f[m])));o&&o.to==p?o.to=h:i.push(o=new Be(p,h,r))}}),u.forEach(l=>t.step(l)),i.forEach(l=>t.step(l))}function Fl(t,e,n,r){let u=[],i=0;t.doc.nodesBetween(e,n,(s,o)=>{if(!s.isInline)return;i++;let l=null;if(r instanceof Mn){let a=s.marks,c;for(;c=r.isInSet(a);)(l||(l=[])).push(c),a=c.removeFromSet(a)}else r?r.isInSet(s.marks)&&(l=[r]):l=s.marks;if(l&&l.length){let a=Math.min(o+s.nodeSize,n);for(let c=0;c<l.length;c++){let f=l[c],p;for(let h=0;h<u.length;h++){let d=u[h];d.step==i-1&&f.eq(u[h].style)&&(p=d)}p?(p.to=a,p.step=i):u.push({style:f,from:Math.max(o,e),to:a,step:i})}}}),u.forEach(s=>t.step(new ge(s.from,s.to,s.style)))}function Lr(t,e,n,r=n.contentMatch,u=!0){let i=t.doc.nodeAt(e),s=[],o=e+1;for(let l=0;l<i.childCount;l++){let a=i.child(l),c=o+a.nodeSize,f=r.matchType(a.type);if(!f)s.push(new H(o,c,C.empty));else{r=f;for(let p=0;p<a.marks.length;p++)n.allowsMarkType(a.marks[p].type)||t.step(new ge(o,c,a.marks[p]));if(u&&a.isText&&n.whitespace!="pre"){let p,h=/\r?\n|\r/g,d;for(;p=h.exec(a.text);)d||(d=new C(x.from(n.schema.text(" ",n.allowedMarks(a.marks))),0,0)),s.push(new H(o+p.index,o+p.index+p[0].length,d))}}o=c}if(!r.validEnd){let l=r.fillBefore(x.empty,!0);t.replace(o,o,new C(l,0,0))}for(let l=s.length-1;l>=0;l--)t.step(s[l])}function Nl(t,e,n){return(e==0||t.canReplace(e,t.childCount))&&(n==t.childCount||t.canReplace(0,n))}function jt(t){let n=t.parent.content.cutByIndex(t.startIndex,t.endIndex);for(let r=t.depth;;--r){let u=t.$from.node(r),i=t.$from.index(r),s=t.$to.indexAfter(r);if(r<t.depth&&u.canReplace(i,s,n))return r;if(r==0||u.type.spec.isolating||!Nl(u,i,s))break}return null}function Il(t,e,n){let{$from:r,$to:u,depth:i}=e,s=r.before(i+1),o=u.after(i+1),l=s,a=o,c=x.empty,f=0;for(let d=i,m=!1;d>n;d--)m||r.index(d)>0?(m=!0,c=x.from(r.node(d).copy(c)),f++):l--;let p=x.empty,h=0;for(let d=i,m=!1;d>n;d--)m||u.after(d+1)<u.end(d)?(m=!0,p=x.from(u.node(d).copy(p)),h++):a++;t.step(new G(l,a,s,o,new C(c.append(p),f,h),c.size-f,!0))}function as(t,e,n=null,r=t){let u=Rl(t,e),i=u&&Bl(r,e);return i?u.map(_u).concat({type:e,attrs:n}).concat(i.map(_u)):null}function _u(t){return{type:t,attrs:null}}function Rl(t,e){let{parent:n,startIndex:r,endIndex:u}=t,i=n.contentMatchAt(r).findWrapping(e);if(!i)return null;let s=i.length?i[0]:e;return n.canReplaceWith(r,u,s)?i:null}function Bl(t,e){let{parent:n,startIndex:r,endIndex:u}=t,i=n.child(r),s=e.contentMatch.findWrapping(i.type);if(!s)return null;let l=(s.length?s[s.length-1]:e).contentMatch;for(let a=r;l&&a<u;a++)l=l.matchType(n.child(a).type);return!l||!l.validEnd?null:s}function vl(t,e,n){let r=x.empty;for(let s=n.length-1;s>=0;s--){if(r.size){let o=n[s].type.contentMatch.matchFragment(r);if(!o||!o.validEnd)throw new RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}r=x.from(n[s].type.create(n[s].attrs,r))}let u=e.start,i=e.end;t.step(new G(u,i,u,i,new C(r,0,0),n.length,!0))}function zl(t,e,n,r,u){if(!r.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");let i=t.steps.length;t.doc.nodesBetween(e,n,(s,o)=>{let l=typeof u=="function"?u(s):u;if(s.isTextblock&&!s.hasMarkup(r,l)&&Pl(t.doc,t.mapping.slice(i).map(o),r)){let a=null;if(r.schema.linebreakReplacement){let h=r.whitespace=="pre",d=!!r.contentMatch.matchType(r.schema.linebreakReplacement);h&&!d?a=!1:!h&&d&&(a=!0)}a===!1&&fs(t,s,o,i),Lr(t,t.mapping.slice(i).map(o,1),r,void 0,a===null);let c=t.mapping.slice(i),f=c.map(o,1),p=c.map(o+s.nodeSize,1);return t.step(new G(f,p,f+1,p-1,new C(x.from(r.create(l,null,s.marks)),0,0),1,!0)),a===!0&&cs(t,s,o,i),!1}})}function cs(t,e,n,r){e.forEach((u,i)=>{if(u.isText){let s,o=/\r?\n|\r/g;for(;s=o.exec(u.text);){let l=t.mapping.slice(r).map(n+1+i+s.index);t.replaceWith(l,l+1,e.type.schema.linebreakReplacement.create())}}})}function fs(t,e,n,r){e.forEach((u,i)=>{if(u.type==u.type.schema.linebreakReplacement){let s=t.mapping.slice(r).map(n+1+i);t.replaceWith(s,s+1,e.type.schema.text(`
@@ -1,4 +1,4 @@
1
- import { f as s, l as I, m as A, s as B, a as D } from "./colors-BW19rWA1.js";
1
+ import { f as s, l as I, m as A, s as B, a as D } from "./colors-pQZlNrwM.js";
2
2
  const h = {
3
3
  none: "0",
4
4
  xs: "calc(var(--spacing-base) / 2)",
@@ -1 +1 @@
1
- "use strict";const i=require("./colors-tmKn7dR5.cjs"),x={none:"0",xs:"calc(var(--spacing-base) / 2)",sm:"var(--spacing-base)",md:"calc(var(--spacing-base) * 1.5)",lg:"calc(var(--spacing-base) * 2)",xl:"calc(var(--spacing-base) * 3)",full:"9999px"};function f(e){return`--radius-${e}`}function o(e){return`var(${f(e)})`}function fe(e){return`@media (width >= ${x[e]})`}function C(){const e={};return i.f(x).forEach(([a,t])=>{e[f(a)]=t}),e}const be=["control","control-sm","control-xs","button","surface","overlay","popover","pill","focus"],de={control:o("md"),"control-sm":o("sm"),"control-xs":o("xs"),button:o("md"),surface:o("lg"),overlay:o("lg"),popover:o("md"),pill:o("full"),focus:o("sm")};function I(e){return`--radius-${e}`}function B(e){const a={},t={...de,...e};return i.f(t).forEach(([n,r])=>{a[I(n)]=r}),a}const b={sm:"40rem",md:"48rem",lg:"64rem",xl:"80rem","2xl":"96rem"};function d(e){return`--breakpoint-${e}`}function he(e){return`var(${d(e)})`}function Se(e){return`@media (width >= ${b[e]})`}function L(){const e={};return i.f(b).forEach(([a,t])=>{e[d(a)]=t}),e}const A="0.25rem",D={none:"0",px:"1px",base:A,xs:"calc(var(--spacing-base) / 2)",sm:"var(--spacing-base)",md:"calc(var(--spacing-base) * 2)",lg:"calc(var(--spacing-base) * 4)",xl:"calc(var(--spacing-base) * 6)","2xl":"calc(var(--spacing-base) * 8)","3xl":"calc(var(--spacing-base) * 12)","4xl":"calc(var(--spacing-base) * 16)",full:"2000px"};function h(e){return`--spacing-${e}`}function Ve(e){return`var(${h(e)})`}function W(){const e={};return i.f(D).forEach(([a,t])=>{e[h(a)]=t}),e}const we=["stack-2xs","stack-xs","stack-sm","stack-md","stack-lg","stack-xl"],ve={"stack-2xs":"calc(var(--spacing-base) / 2)","stack-xs":"calc(var(--spacing-base) * 1)","stack-sm":"calc(var(--spacing-base) * 2)","stack-md":"calc(var(--spacing-base) * 3)","stack-lg":"calc(var(--spacing-base) * 4)","stack-xl":"calc(var(--spacing-base) * 6)"};function P(e){return`--spacing-${e}`}function Z(e){const a={},t={...ve,...e};return i.f(t).forEach(([n,r])=>{a[P(n)]=r}),a}const Q={none:"none","2xs":"0 1px rgb(0 0 0 / 0.05)",xs:"0 1px 2px 0 rgb(0 0 0 / 0.05)",sm:"0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1)",md:"0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1)",lg:"0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1)",xl:"0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1)","2xl":"0 25px 50px -12px rgb(0 0 0 / 0.25)","top-2xs":"0 -1px rgb(0 0 0 / 0.05)","top-xs":"0 -1px 2px 0 rgb(0 0 0 / 0.05)","top-sm":"0 -1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1)","top-md":"0 -4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1)","top-lg":"0 -10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1)","top-xl":"0 -20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1)","top-2xl":"0 -25px 50px -12px rgb(0 0 0 / 0.25)"};function S(e){return`--shadow-${e}`}function g(e){return`var(${S(e)})`}function U(){const e={};return i.f(Q).forEach(([a,t])=>{e[S(a)]=t}),e}const Ne=["surface","surface-elevated","popover","overlay","button"],ye={surface:g("sm"),"surface-elevated":g("md"),popover:g("lg"),overlay:g("xl"),button:g("xs")};function _(e){return`--shadow-${e}`}function q(e){const a={},t={...ye,...e};return i.f(t).forEach(([n,r])=>{a[_(n)]=r}),a}const V={"3xs":["0.5rem",{lineHeight:"0.75rem"}],"2xs":["0.625rem",{lineHeight:"0.75rem"}],xs:["0.75rem",{lineHeight:"1rem"}],sm:["0.875rem",{lineHeight:"1.25rem"}],md:["1rem",{lineHeight:"1.5rem"}],lg:["1.125rem",{lineHeight:"1.75rem"}],xl:["1.25rem",{lineHeight:"1.75rem"}],"2xl":["1.5rem",{lineHeight:"2rem"}],"3xl":["1.875rem",{lineHeight:"2.25rem"}],"4xl":["2.25rem",{lineHeight:"2.5rem"}],"5xl":["3rem",{lineHeight:"1"}],"6xl":["3.75rem",{lineHeight:"1"}],"7xl":["4.5rem",{lineHeight:"1"}],"8xl":["6rem",{lineHeight:"1"}],"9xl":["8rem",{lineHeight:"1"}]};function Fe(e,a){const t=Object.keys(V),n=t.indexOf(e);if(n===-1)throw new Error(`Invalid font size: ${e}`);const r=Math.min(Math.max(n+a,0),t.length-1);return t[r]}const G={thin:"100",extralight:"200",light:"300",normal:"400",medium:"500",semibold:"600",bold:"700",extrabold:"800",black:"900"},J={none:"1",tight:"1.25",snug:"1.375",normal:"1.5",relaxed:"1.625",loose:"2"},K={tighter:"-0.05em",tight:"-0.025em",normal:"0em",wide:"0.025em",wider:"0.05em",widest:"0.1em"},X={sans:["system-ui","-apple-system","BlinkMacSystemFont",'"Segoe UI"',"Roboto",'"Helvetica Neue"',"Arial",'"Noto Sans"',"sans-serif",'"Apple Color Emoji"','"Segoe UI Emoji"','"Segoe UI Symbol"','"Noto Color Emoji"'],serif:["ui-serif","Georgia","Cambria",'"Times New Roman"',"Times","serif"],mono:["ui-monospace","SFMono-Regular",'"SF Mono"',"Consolas",'"Liberation Mono"',"Menlo","monospace"]};function Y(e){return Array.isArray(e)?e.join(", "):e}const $e=["body","heading","display","mono","ui","prose"],ke={body:s("sans"),heading:s("sans"),display:s("sans"),mono:s("mono"),ui:s("sans"),prose:s("serif")};function w(e){return`--font-size-${e}`}function Ee(e){return`var(${w(e)})`}function v(e){return`--font-weight-${e}`}function Te(e){return`var(${v(e)})`}function N(e){return`--line-height-${e}`}function Me(e){return`var(${N(e)})`}function y(e){return`--letter-spacing-${e}`}function Oe(e){return`var(${y(e)})`}function p(e){return`--font-family-${e}`}function s(e){return`var(${p(e)})`}function F(e){return`--font-${e}`}function c(e){return`var(${F(e)})`}function ee(){const e={};return Object.entries(V).forEach(([a,t])=>{const[n]=Array.isArray(t)?t:[t];e[w(a)]=n}),Object.entries(G).forEach(([a,t])=>{e[v(a)]=t}),Object.entries(J).forEach(([a,t])=>{e[N(a)]=t}),Object.entries(K).forEach(([a,t])=>{e[y(a)]=t}),Object.entries(X).forEach(([a,t])=>{const n=Y(t);e[p(a)]=n,e[`--font-${a}`]=n}),e}function ae(e){if(!e)return{};const a={};return Object.entries(e).forEach(([t,n])=>{if(n==null)return;const r=Y(n);a[p(t)]=r,a[`--font-${t}`]=r}),a}function te(e){const a={},t={...ke,...e};return Object.entries(t).forEach(([n,r])=>{a[F(n)]=r}),a["--default-font-family"]=c("body"),a["--default-heading-font-family"]=c("heading"),a["--default-display-font-family"]=c("display"),a["--default-ui-font-family"]=c("ui"),a["--default-prose-font-family"]=c("prose"),a["--default-mono-font-family"]=c("mono"),a}const ne={base:0,raised:10,navigation:20,sidebar:20,overlay:50,modal:60,tooltip:70,popover:80,notification:90,maximum:100};function $(e){return`--z-index-${e}`}function ze(e){return`var(${$(e)})`}function re(){const e={};return i.f(ne).forEach(([a,t])=>{e[$(a)]=t.toString()}),e}const ie={instant:"0s",fast:"120ms",base:"200ms",slow:"320ms",relaxed:"480ms"},oe={standard:"cubic-bezier(0.2, 0, 0, 1)",emphasized:"cubic-bezier(0.33, 1, 0.68, 1)",entrance:"cubic-bezier(0, 0, 0.2, 1)",exit:"cubic-bezier(0.8, 0, 0.6, 1)"};function k(e){return`--motion-duration-${e}`}function l(e){return`var(${k(e)})`}function E(e){return`--motion-easing-${e}`}function m(e){return`var(${E(e)})`}function se(){const e={};return i.f(ie).forEach(([a,t])=>{e[k(a)]=t}),i.f(oe).forEach(([a,t])=>{e[E(a)]=t}),e}const He=["transition-fast","transition-medium","transition-slow","transition-overlay","transition-emphasis","easing-standard","easing-emphasis","easing-entrance","easing-exit"],Re={"transition-fast":l("fast"),"transition-medium":l("base"),"transition-slow":l("slow"),"transition-overlay":l("relaxed"),"transition-emphasis":l("fast"),"easing-standard":m("standard"),"easing-emphasis":m("emphasized"),"easing-entrance":m("entrance"),"easing-exit":m("exit")};function ce(e){return`--motion-${e}`}function ge(e){const a={},t={...Re,...e};return i.f(t).forEach(([n,r])=>{a[ce(n)]=r}),a}const le={none:"none","2xs":"0px 1px 0px rgb(0 0 0 / 0.15)",xs:"0px 1px 1px rgb(0 0 0 / 0.2)",sm:"0px 1px 0px rgb(0 0 0 / 0.075), 0px 1px 1px rgb(0 0 0 / 0.075), 0px 2px 2px rgb(0 0 0 / 0.075)",md:"0px 1px 1px rgb(0 0 0 / 0.1), 0px 1px 2px rgb(0 0 0 / 0.1), 0px 2px 4px rgb(0 0 0 / 0.1)",lg:"0px 1px 2px rgb(0 0 0 / 0.1), 0px 3px 2px rgb(0 0 0 / 0.1), 0px 4px 8px rgb(0 0 0 / 0.1)"},je=["button-filled","button-light","button-default"],Ce={"button-filled":u("sm"),"button-light":u("xs"),"button-default":u("2xs")};function T(e){return`--text-shadow-${e}`}function u(e){return`var(${T(e)})`}function me(){const e={};return i.f(le).forEach(([a,t])=>{e[T(a)]=t}),e}function ue(e){return`--text-shadow-${e}`}function pe(e){const a={},t={...Ce,...e};return i.f(t).forEach(([n,r])=>{a[ue(n)]=r}),a}function M(){return{...i.generateCoreColorVariables(),...W(),...ee(),...L(),...C(),...U(),...se(),...me(),...re()}}function Ie(e){return typeof e=="object"&&e!==null&&("colors"in e||"fonts"in e||"radii"in e||"shadows"in e||"motion"in e||"spacing"in e||"textShadows"in e)}function O(e){let a,t,n,r,z,H,R;return Ie(e)?(a=e.colors,t=e.fonts,n=e.radii,r=e.shadows,z=e.motion,H=e.spacing,R=e.textShadows):a=e,{...i.generateSemanticColorVariables(a),...te(t),...B(n),...q(r),...ge(z),...Z(H),...pe(R)}}function Be(){return{...M(),...O()}}function Le(e,a){return a==null&&typeof window>"u"?"":getComputedStyle(a??document.documentElement).getPropertyValue(e).trim()}function Ae(){return Object.fromEntries(i.semanticColorNames.map(e=>[e,Object.fromEntries(i.colorShades.map(a=>[a,`var(--color-${e}-${a})`]))]))}function De(e){const{includeCoreTokens:a=!0,includeSemanticTokens:t=!0}=e,n={};return a&&(n[":root"]={...M()}),t&&(n[":root"]={...n[":root"]??{},...O({colors:e.semanticColors,fonts:e.semanticFonts,radii:e.semanticRadii,shadows:e.semanticShadows,motion:e.semanticMotion,spacing:e.semanticSpacing,textShadows:e.semanticTextShadows})}),e.fontFamilies&&(n[":root"]={...n[":root"]??{},...ae(e.fontFamilies)}),n}const j=Object.assign((e,a)=>({handler:e,config:a}),{withOptions(e,a=()=>({})){const t=n=>({handler:e(n),config:a(n)});return t.__isOptionsFunction=!0,t}});function xe(e={}){const a=De(e);return{darkMode:"class",theme:{extend:e.extendTheme??!0?{colors:Ae()}:{}},plugins:[j(({addBase:r})=>{Object.keys(a).length>0&&r(a)}),j(({addVariant:r})=>{r("beatui-dark",".b-dark &"),r("beatui-light",".b-light &"),r("beatui-rtl",".b-rtl &"),r("beatui-ltr",".b-ltr &")})]}}const We=xe();exports.baseSpacing=A;exports.beatuiPreset=We;exports.breakpoints=b;exports.changeFontSize=Fe;exports.createBeatuiPreset=xe;exports.fontFamily=X;exports.fontSize=V;exports.fontWeight=G;exports.generateAllTokenVariables=Be;exports.generateBreakpointVariables=L;exports.generateCoreTokenVariables=M;exports.generateFontFamilyOverrideVariables=ae;exports.generateMotionVariables=se;exports.generateRadiusVariables=C;exports.generateSemanticFontVariables=te;exports.generateSemanticMotionVariables=ge;exports.generateSemanticRadiusVariables=B;exports.generateSemanticShadowVariables=q;exports.generateSemanticSpacingVariables=Z;exports.generateSemanticTextShadowVariables=pe;exports.generateSemanticTokenVariables=O;exports.generateShadowVariables=U;exports.generateSpacingVariables=W;exports.generateTextShadowVariables=me;exports.generateTypographyVariables=ee;exports.generateZIndexVariables=re;exports.getBreakpointMediaQuery=Se;exports.getBreakpointVar=he;exports.getBreakpointVarName=d;exports.getFontFamilyVar=s;exports.getFontFamilyVarName=p;exports.getFontSizeVar=Ee;exports.getFontSizeVarName=w;exports.getFontWeightVar=Te;exports.getFontWeightVarName=v;exports.getLetterSpacingVar=Oe;exports.getLetterSpacingVarName=y;exports.getLineHeightVar=Me;exports.getLineHeightVarName=N;exports.getMotionDurationVar=l;exports.getMotionDurationVarName=k;exports.getMotionEasingVar=m;exports.getMotionEasingVarName=E;exports.getRadiusMediaQuery=fe;exports.getRadiusVar=o;exports.getRadiusVarName=f;exports.getSemanticFontVar=c;exports.getSemanticFontVarName=F;exports.getSemanticMotionVarName=ce;exports.getSemanticRadiusVarName=I;exports.getSemanticShadowVarName=_;exports.getSemanticSpacingVarName=P;exports.getSemanticTextShadowVarName=ue;exports.getShadowVar=g;exports.getShadowVarName=S;exports.getSpacingVar=Ve;exports.getSpacingVarName=h;exports.getTextShadowVar=u;exports.getTextShadowVarName=T;exports.getTokenValue=Le;exports.getZIndexVar=ze;exports.getZIndexVarName=$;exports.letterSpacing=K;exports.lineHeight=J;exports.motionDurations=ie;exports.motionEasings=oe;exports.radius=x;exports.semanticFontNames=$e;exports.semanticMotionNames=He;exports.semanticRadiusNames=be;exports.semanticShadowNames=Ne;exports.semanticSpacingNames=we;exports.semanticTextShadowNames=je;exports.shadows=Q;exports.spacing=D;exports.textShadows=le;exports.zIndex=ne;
1
+ "use strict";const i=require("./colors-B9fcMxa_.cjs"),x={none:"0",xs:"calc(var(--spacing-base) / 2)",sm:"var(--spacing-base)",md:"calc(var(--spacing-base) * 1.5)",lg:"calc(var(--spacing-base) * 2)",xl:"calc(var(--spacing-base) * 3)",full:"9999px"};function f(e){return`--radius-${e}`}function o(e){return`var(${f(e)})`}function fe(e){return`@media (width >= ${x[e]})`}function C(){const e={};return i.f(x).forEach(([a,t])=>{e[f(a)]=t}),e}const be=["control","control-sm","control-xs","button","surface","overlay","popover","pill","focus"],de={control:o("md"),"control-sm":o("sm"),"control-xs":o("xs"),button:o("md"),surface:o("lg"),overlay:o("lg"),popover:o("md"),pill:o("full"),focus:o("sm")};function I(e){return`--radius-${e}`}function B(e){const a={},t={...de,...e};return i.f(t).forEach(([n,r])=>{a[I(n)]=r}),a}const b={sm:"40rem",md:"48rem",lg:"64rem",xl:"80rem","2xl":"96rem"};function d(e){return`--breakpoint-${e}`}function he(e){return`var(${d(e)})`}function Se(e){return`@media (width >= ${b[e]})`}function L(){const e={};return i.f(b).forEach(([a,t])=>{e[d(a)]=t}),e}const A="0.25rem",D={none:"0",px:"1px",base:A,xs:"calc(var(--spacing-base) / 2)",sm:"var(--spacing-base)",md:"calc(var(--spacing-base) * 2)",lg:"calc(var(--spacing-base) * 4)",xl:"calc(var(--spacing-base) * 6)","2xl":"calc(var(--spacing-base) * 8)","3xl":"calc(var(--spacing-base) * 12)","4xl":"calc(var(--spacing-base) * 16)",full:"2000px"};function h(e){return`--spacing-${e}`}function Ve(e){return`var(${h(e)})`}function W(){const e={};return i.f(D).forEach(([a,t])=>{e[h(a)]=t}),e}const we=["stack-2xs","stack-xs","stack-sm","stack-md","stack-lg","stack-xl"],ve={"stack-2xs":"calc(var(--spacing-base) / 2)","stack-xs":"calc(var(--spacing-base) * 1)","stack-sm":"calc(var(--spacing-base) * 2)","stack-md":"calc(var(--spacing-base) * 3)","stack-lg":"calc(var(--spacing-base) * 4)","stack-xl":"calc(var(--spacing-base) * 6)"};function P(e){return`--spacing-${e}`}function Z(e){const a={},t={...ve,...e};return i.f(t).forEach(([n,r])=>{a[P(n)]=r}),a}const Q={none:"none","2xs":"0 1px rgb(0 0 0 / 0.05)",xs:"0 1px 2px 0 rgb(0 0 0 / 0.05)",sm:"0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1)",md:"0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1)",lg:"0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1)",xl:"0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1)","2xl":"0 25px 50px -12px rgb(0 0 0 / 0.25)","top-2xs":"0 -1px rgb(0 0 0 / 0.05)","top-xs":"0 -1px 2px 0 rgb(0 0 0 / 0.05)","top-sm":"0 -1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1)","top-md":"0 -4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1)","top-lg":"0 -10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1)","top-xl":"0 -20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1)","top-2xl":"0 -25px 50px -12px rgb(0 0 0 / 0.25)"};function S(e){return`--shadow-${e}`}function g(e){return`var(${S(e)})`}function U(){const e={};return i.f(Q).forEach(([a,t])=>{e[S(a)]=t}),e}const Ne=["surface","surface-elevated","popover","overlay","button"],ye={surface:g("sm"),"surface-elevated":g("md"),popover:g("lg"),overlay:g("xl"),button:g("xs")};function _(e){return`--shadow-${e}`}function q(e){const a={},t={...ye,...e};return i.f(t).forEach(([n,r])=>{a[_(n)]=r}),a}const V={"3xs":["0.5rem",{lineHeight:"0.75rem"}],"2xs":["0.625rem",{lineHeight:"0.75rem"}],xs:["0.75rem",{lineHeight:"1rem"}],sm:["0.875rem",{lineHeight:"1.25rem"}],md:["1rem",{lineHeight:"1.5rem"}],lg:["1.125rem",{lineHeight:"1.75rem"}],xl:["1.25rem",{lineHeight:"1.75rem"}],"2xl":["1.5rem",{lineHeight:"2rem"}],"3xl":["1.875rem",{lineHeight:"2.25rem"}],"4xl":["2.25rem",{lineHeight:"2.5rem"}],"5xl":["3rem",{lineHeight:"1"}],"6xl":["3.75rem",{lineHeight:"1"}],"7xl":["4.5rem",{lineHeight:"1"}],"8xl":["6rem",{lineHeight:"1"}],"9xl":["8rem",{lineHeight:"1"}]};function Fe(e,a){const t=Object.keys(V),n=t.indexOf(e);if(n===-1)throw new Error(`Invalid font size: ${e}`);const r=Math.min(Math.max(n+a,0),t.length-1);return t[r]}const G={thin:"100",extralight:"200",light:"300",normal:"400",medium:"500",semibold:"600",bold:"700",extrabold:"800",black:"900"},J={none:"1",tight:"1.25",snug:"1.375",normal:"1.5",relaxed:"1.625",loose:"2"},K={tighter:"-0.05em",tight:"-0.025em",normal:"0em",wide:"0.025em",wider:"0.05em",widest:"0.1em"},X={sans:["system-ui","-apple-system","BlinkMacSystemFont",'"Segoe UI"',"Roboto",'"Helvetica Neue"',"Arial",'"Noto Sans"',"sans-serif",'"Apple Color Emoji"','"Segoe UI Emoji"','"Segoe UI Symbol"','"Noto Color Emoji"'],serif:["ui-serif","Georgia","Cambria",'"Times New Roman"',"Times","serif"],mono:["ui-monospace","SFMono-Regular",'"SF Mono"',"Consolas",'"Liberation Mono"',"Menlo","monospace"]};function Y(e){return Array.isArray(e)?e.join(", "):e}const $e=["body","heading","display","mono","ui","prose"],ke={body:s("sans"),heading:s("sans"),display:s("sans"),mono:s("mono"),ui:s("sans"),prose:s("serif")};function w(e){return`--font-size-${e}`}function Ee(e){return`var(${w(e)})`}function v(e){return`--font-weight-${e}`}function Te(e){return`var(${v(e)})`}function N(e){return`--line-height-${e}`}function Me(e){return`var(${N(e)})`}function y(e){return`--letter-spacing-${e}`}function Oe(e){return`var(${y(e)})`}function p(e){return`--font-family-${e}`}function s(e){return`var(${p(e)})`}function F(e){return`--font-${e}`}function c(e){return`var(${F(e)})`}function ee(){const e={};return Object.entries(V).forEach(([a,t])=>{const[n]=Array.isArray(t)?t:[t];e[w(a)]=n}),Object.entries(G).forEach(([a,t])=>{e[v(a)]=t}),Object.entries(J).forEach(([a,t])=>{e[N(a)]=t}),Object.entries(K).forEach(([a,t])=>{e[y(a)]=t}),Object.entries(X).forEach(([a,t])=>{const n=Y(t);e[p(a)]=n,e[`--font-${a}`]=n}),e}function ae(e){if(!e)return{};const a={};return Object.entries(e).forEach(([t,n])=>{if(n==null)return;const r=Y(n);a[p(t)]=r,a[`--font-${t}`]=r}),a}function te(e){const a={},t={...ke,...e};return Object.entries(t).forEach(([n,r])=>{a[F(n)]=r}),a["--default-font-family"]=c("body"),a["--default-heading-font-family"]=c("heading"),a["--default-display-font-family"]=c("display"),a["--default-ui-font-family"]=c("ui"),a["--default-prose-font-family"]=c("prose"),a["--default-mono-font-family"]=c("mono"),a}const ne={base:0,raised:10,navigation:20,sidebar:20,overlay:50,modal:60,tooltip:70,popover:80,notification:90,maximum:100};function $(e){return`--z-index-${e}`}function ze(e){return`var(${$(e)})`}function re(){const e={};return i.f(ne).forEach(([a,t])=>{e[$(a)]=t.toString()}),e}const ie={instant:"0s",fast:"120ms",base:"200ms",slow:"320ms",relaxed:"480ms"},oe={standard:"cubic-bezier(0.2, 0, 0, 1)",emphasized:"cubic-bezier(0.33, 1, 0.68, 1)",entrance:"cubic-bezier(0, 0, 0.2, 1)",exit:"cubic-bezier(0.8, 0, 0.6, 1)"};function k(e){return`--motion-duration-${e}`}function l(e){return`var(${k(e)})`}function E(e){return`--motion-easing-${e}`}function m(e){return`var(${E(e)})`}function se(){const e={};return i.f(ie).forEach(([a,t])=>{e[k(a)]=t}),i.f(oe).forEach(([a,t])=>{e[E(a)]=t}),e}const He=["transition-fast","transition-medium","transition-slow","transition-overlay","transition-emphasis","easing-standard","easing-emphasis","easing-entrance","easing-exit"],Re={"transition-fast":l("fast"),"transition-medium":l("base"),"transition-slow":l("slow"),"transition-overlay":l("relaxed"),"transition-emphasis":l("fast"),"easing-standard":m("standard"),"easing-emphasis":m("emphasized"),"easing-entrance":m("entrance"),"easing-exit":m("exit")};function ce(e){return`--motion-${e}`}function ge(e){const a={},t={...Re,...e};return i.f(t).forEach(([n,r])=>{a[ce(n)]=r}),a}const le={none:"none","2xs":"0px 1px 0px rgb(0 0 0 / 0.15)",xs:"0px 1px 1px rgb(0 0 0 / 0.2)",sm:"0px 1px 0px rgb(0 0 0 / 0.075), 0px 1px 1px rgb(0 0 0 / 0.075), 0px 2px 2px rgb(0 0 0 / 0.075)",md:"0px 1px 1px rgb(0 0 0 / 0.1), 0px 1px 2px rgb(0 0 0 / 0.1), 0px 2px 4px rgb(0 0 0 / 0.1)",lg:"0px 1px 2px rgb(0 0 0 / 0.1), 0px 3px 2px rgb(0 0 0 / 0.1), 0px 4px 8px rgb(0 0 0 / 0.1)"},je=["button-filled","button-light","button-default"],Ce={"button-filled":u("sm"),"button-light":u("xs"),"button-default":u("2xs")};function T(e){return`--text-shadow-${e}`}function u(e){return`var(${T(e)})`}function me(){const e={};return i.f(le).forEach(([a,t])=>{e[T(a)]=t}),e}function ue(e){return`--text-shadow-${e}`}function pe(e){const a={},t={...Ce,...e};return i.f(t).forEach(([n,r])=>{a[ue(n)]=r}),a}function M(){return{...i.generateCoreColorVariables(),...W(),...ee(),...L(),...C(),...U(),...se(),...me(),...re()}}function Ie(e){return typeof e=="object"&&e!==null&&("colors"in e||"fonts"in e||"radii"in e||"shadows"in e||"motion"in e||"spacing"in e||"textShadows"in e)}function O(e){let a,t,n,r,z,H,R;return Ie(e)?(a=e.colors,t=e.fonts,n=e.radii,r=e.shadows,z=e.motion,H=e.spacing,R=e.textShadows):a=e,{...i.generateSemanticColorVariables(a),...te(t),...B(n),...q(r),...ge(z),...Z(H),...pe(R)}}function Be(){return{...M(),...O()}}function Le(e,a){return a==null&&typeof window>"u"?"":getComputedStyle(a??document.documentElement).getPropertyValue(e).trim()}function Ae(){return Object.fromEntries(i.semanticColorNames.map(e=>[e,Object.fromEntries(i.colorShades.map(a=>[a,`var(--color-${e}-${a})`]))]))}function De(e){const{includeCoreTokens:a=!0,includeSemanticTokens:t=!0}=e,n={};return a&&(n[":root"]={...M()}),t&&(n[":root"]={...n[":root"]??{},...O({colors:e.semanticColors,fonts:e.semanticFonts,radii:e.semanticRadii,shadows:e.semanticShadows,motion:e.semanticMotion,spacing:e.semanticSpacing,textShadows:e.semanticTextShadows})}),e.fontFamilies&&(n[":root"]={...n[":root"]??{},...ae(e.fontFamilies)}),n}const j=Object.assign((e,a)=>({handler:e,config:a}),{withOptions(e,a=()=>({})){const t=n=>({handler:e(n),config:a(n)});return t.__isOptionsFunction=!0,t}});function xe(e={}){const a=De(e);return{darkMode:"class",theme:{extend:e.extendTheme??!0?{colors:Ae()}:{}},plugins:[j(({addBase:r})=>{Object.keys(a).length>0&&r(a)}),j(({addVariant:r})=>{r("beatui-dark",".b-dark &"),r("beatui-light",".b-light &"),r("beatui-rtl",".b-rtl &"),r("beatui-ltr",".b-ltr &")})]}}const We=xe();exports.baseSpacing=A;exports.beatuiPreset=We;exports.breakpoints=b;exports.changeFontSize=Fe;exports.createBeatuiPreset=xe;exports.fontFamily=X;exports.fontSize=V;exports.fontWeight=G;exports.generateAllTokenVariables=Be;exports.generateBreakpointVariables=L;exports.generateCoreTokenVariables=M;exports.generateFontFamilyOverrideVariables=ae;exports.generateMotionVariables=se;exports.generateRadiusVariables=C;exports.generateSemanticFontVariables=te;exports.generateSemanticMotionVariables=ge;exports.generateSemanticRadiusVariables=B;exports.generateSemanticShadowVariables=q;exports.generateSemanticSpacingVariables=Z;exports.generateSemanticTextShadowVariables=pe;exports.generateSemanticTokenVariables=O;exports.generateShadowVariables=U;exports.generateSpacingVariables=W;exports.generateTextShadowVariables=me;exports.generateTypographyVariables=ee;exports.generateZIndexVariables=re;exports.getBreakpointMediaQuery=Se;exports.getBreakpointVar=he;exports.getBreakpointVarName=d;exports.getFontFamilyVar=s;exports.getFontFamilyVarName=p;exports.getFontSizeVar=Ee;exports.getFontSizeVarName=w;exports.getFontWeightVar=Te;exports.getFontWeightVarName=v;exports.getLetterSpacingVar=Oe;exports.getLetterSpacingVarName=y;exports.getLineHeightVar=Me;exports.getLineHeightVarName=N;exports.getMotionDurationVar=l;exports.getMotionDurationVarName=k;exports.getMotionEasingVar=m;exports.getMotionEasingVarName=E;exports.getRadiusMediaQuery=fe;exports.getRadiusVar=o;exports.getRadiusVarName=f;exports.getSemanticFontVar=c;exports.getSemanticFontVarName=F;exports.getSemanticMotionVarName=ce;exports.getSemanticRadiusVarName=I;exports.getSemanticShadowVarName=_;exports.getSemanticSpacingVarName=P;exports.getSemanticTextShadowVarName=ue;exports.getShadowVar=g;exports.getShadowVarName=S;exports.getSpacingVar=Ve;exports.getSpacingVarName=h;exports.getTextShadowVar=u;exports.getTextShadowVarName=T;exports.getTokenValue=Le;exports.getZIndexVar=ze;exports.getZIndexVarName=$;exports.letterSpacing=K;exports.lineHeight=J;exports.motionDurations=ie;exports.motionEasings=oe;exports.radius=x;exports.semanticFontNames=$e;exports.semanticMotionNames=He;exports.semanticRadiusNames=be;exports.semanticShadowNames=Ne;exports.semanticSpacingNames=we;exports.semanticTextShadowNames=je;exports.shadows=Q;exports.spacing=D;exports.textShadows=le;exports.zIndex=ne;
@@ -1,8 +1,8 @@
1
- import { a as Se, S as de, I as Xe, c as Z, M as Yt, P as Zs, E as Qs, b as Mr, N as ps, L as Le, x as ea, C as ms, i as ta, A as ra, l as na } from "./notice-BS0d903Q.js";
2
- import { ah as $r, ai as sa, S as aa, N as ia, a as ys, j as oa, t as le, x as Ve, w as Zt, H as ua, C as ca, W as la, O as fa, Q as da, v as ha, s as pa, r as ma, u as ya, g as Ue, T as ga, D as va, z as pr, y as _a, M as Ye, K as ba, J as $a, I as wa, R as Sa, A as Ea, q as Pa, G as Oa, m as gs, V as ja, L as ka, f as Ra } from "./utils-w_vUChhV.js";
1
+ import { a as Se, S as de, I as Xe, c as Z, M as Yt, P as Zs, E as Qs, b as Mr, N as ps, L as Le, x as ea, C as ms, i as ta, A as ra, l as na } from "./notice-DdYpd69I.js";
2
+ import { ah as $r, ai as sa, S as aa, N as ia, a as ys, j as oa, t as le, x as Ve, w as Zt, H as ua, C as ca, W as la, O as fa, Q as da, v as ha, s as pa, r as ma, u as ya, g as Ue, T as ga, D as va, z as pr, y as _a, M as Ye, K as ba, J as $a, I as wa, R as Sa, A as Ea, q as Pa, G as Oa, m as gs, V as ja, L as ka, f as Ra } from "./utils-CPZHwfiH.js";
3
3
  import { attr as F, Value as ne, Fragment as je, WithElement as vs, Empty as _s, html as J, When as We, computedOf as ie, prop as ke, Use as wr, style as bs, Ensure as $s, aria as Na, on as xe, MapSignal as Ut, Async as Aa, OnDispose as Ia } from "@tempots/dom";
4
- import { T as Ca, a as Sr, I as ws, B as Ta } from "./translations-CaTkLRHu.js";
5
- import { f as qa } from "./colors-BW19rWA1.js";
4
+ import { T as Ca, a as Sr, I as ws, B as Ta } from "./translations-B3P1v3E6.js";
5
+ import { f as qa } from "./colors-pQZlNrwM.js";
6
6
  function Ma(e, t) {
7
7
  for (var r = 0; r < t.length; r++) {
8
8
  const n = t[r];
@@ -4730,9 +4730,9 @@ async function ts(e, t, r) {
4730
4730
  const n = (await (() => {
4731
4731
  switch (e) {
4732
4732
  case "2020-12":
4733
- return import("./2020-S7qY95wq.js").then((a) => a._);
4733
+ return import("./2020-P72Z0RIB.js").then((a) => a._);
4734
4734
  case "2019-09":
4735
- return import("./2019-i1LHsYdK.js").then((a) => a._);
4735
+ return import("./2019-ByDeUdzE.js").then((a) => a._);
4736
4736
  case "draft-07":
4737
4737
  return Promise.resolve().then(() => hu);
4738
4738
  }
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("./index-CFOxIBGJ.cjs");function S(f,t=null){return function(e,n){let{$from:o,$to:l}=e.selection,i=o.blockRange(l);if(!i)return!1;let d=n?e.tr:null;return h(d,i,f,t)?(n&&n(d.scrollIntoView()),!0):!1}}function h(f,t,e,n=null){let o=!1,l=t,i=t.$from.doc;if(t.depth>=2&&t.$from.node(t.depth-1).type.compatibleContent(e)&&t.startIndex==0){if(t.$from.index(t.depth-1)==0)return!1;let u=i.resolve(t.start-2);l=new r.NodeRange(u,u,t.depth),t.endIndex<t.parent.childCount&&(t=new r.NodeRange(t.$from,i.resolve(t.$to.end(t.depth)),t.depth)),o=!0}let d=r.findWrapping(l,e,n,t);return d?(f&&$(f,t,d,o,e),!0):!1}function $(f,t,e,n,o){let l=r.Fragment.empty;for(let p=e.length-1;p>=0;p--)l=r.Fragment.from(e[p].type.create(e[p].attrs,l));f.step(new r.ReplaceAroundStep(t.start-(n?2:0),t.end,t.start,t.end,new r.Slice(l,0,0),e.length,!0));let i=0;for(let p=0;p<e.length;p++)e[p].type==o&&(i=p+1);let d=e.length-i,u=t.start+e.length-(n?2:0),m=t.parent;for(let p=t.startIndex,s=t.endIndex,c=!0;p<s;p++,c=!1)!c&&r.canSplit(f.doc,u,d)&&(f.split(u,d),u+=2*d),u+=m.child(p).nodeSize;return f}function R(f){return function(t,e){let{$from:n,$to:o}=t.selection,l=n.blockRange(o,i=>i.childCount>0&&i.firstChild.type==f);return l?e?n.node(l.depth-1).type==f?x(t,e,f,l):F(t,e,l):!0:!1}}function x(f,t,e,n){let o=f.tr,l=n.end,i=n.$to.end(n.depth);l<i&&(o.step(new r.ReplaceAroundStep(l-1,i,l,i,new r.Slice(r.Fragment.from(e.create(null,n.parent.copy())),1,0),1,!0)),n=new r.NodeRange(o.doc.resolve(n.$from.pos),o.doc.resolve(i),n.depth));const d=r.liftTarget(n);if(d==null)return!1;o.lift(n,d);let u=o.doc.resolve(o.mapping.map(l,-1)-1);return r.canJoin(o.doc,u.pos)&&u.nodeBefore.type==u.nodeAfter.type&&o.join(u.pos),t(o.scrollIntoView()),!0}function F(f,t,e){let n=f.tr,o=e.parent;for(let a=e.end,I=e.endIndex-1,y=e.startIndex;I>y;I--)a-=o.child(I).nodeSize,n.delete(a-1,a+1);let l=n.doc.resolve(e.start),i=l.nodeAfter;if(n.mapping.map(e.end)!=e.start+l.nodeAfter.nodeSize)return!1;let d=e.startIndex==0,u=e.endIndex==o.childCount,m=l.node(-1),p=l.index(-1);if(!m.canReplace(p+(d?0:1),p+1,i.content.append(u?r.Fragment.empty:r.Fragment.from(o))))return!1;let s=l.pos,c=s+i.nodeSize;return n.step(new r.ReplaceAroundStep(s-(d?1:0),c+(u?1:0),s+1,c-1,new r.Slice((d?r.Fragment.empty:r.Fragment.from(o.copy(r.Fragment.empty))).append(u?r.Fragment.empty:r.Fragment.from(o.copy(r.Fragment.empty))),d?0:1,u?0:1),d?0:1)),t(n.scrollIntoView()),!0}exports.liftListItem=R;exports.wrapInList=S;exports.wrapRangeInList=h;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("./index-Cj2zgGLp.cjs");function S(f,t=null){return function(e,n){let{$from:o,$to:l}=e.selection,i=o.blockRange(l);if(!i)return!1;let d=n?e.tr:null;return h(d,i,f,t)?(n&&n(d.scrollIntoView()),!0):!1}}function h(f,t,e,n=null){let o=!1,l=t,i=t.$from.doc;if(t.depth>=2&&t.$from.node(t.depth-1).type.compatibleContent(e)&&t.startIndex==0){if(t.$from.index(t.depth-1)==0)return!1;let u=i.resolve(t.start-2);l=new r.NodeRange(u,u,t.depth),t.endIndex<t.parent.childCount&&(t=new r.NodeRange(t.$from,i.resolve(t.$to.end(t.depth)),t.depth)),o=!0}let d=r.findWrapping(l,e,n,t);return d?(f&&$(f,t,d,o,e),!0):!1}function $(f,t,e,n,o){let l=r.Fragment.empty;for(let p=e.length-1;p>=0;p--)l=r.Fragment.from(e[p].type.create(e[p].attrs,l));f.step(new r.ReplaceAroundStep(t.start-(n?2:0),t.end,t.start,t.end,new r.Slice(l,0,0),e.length,!0));let i=0;for(let p=0;p<e.length;p++)e[p].type==o&&(i=p+1);let d=e.length-i,u=t.start+e.length-(n?2:0),m=t.parent;for(let p=t.startIndex,s=t.endIndex,c=!0;p<s;p++,c=!1)!c&&r.canSplit(f.doc,u,d)&&(f.split(u,d),u+=2*d),u+=m.child(p).nodeSize;return f}function R(f){return function(t,e){let{$from:n,$to:o}=t.selection,l=n.blockRange(o,i=>i.childCount>0&&i.firstChild.type==f);return l?e?n.node(l.depth-1).type==f?x(t,e,f,l):F(t,e,l):!0:!1}}function x(f,t,e,n){let o=f.tr,l=n.end,i=n.$to.end(n.depth);l<i&&(o.step(new r.ReplaceAroundStep(l-1,i,l,i,new r.Slice(r.Fragment.from(e.create(null,n.parent.copy())),1,0),1,!0)),n=new r.NodeRange(o.doc.resolve(n.$from.pos),o.doc.resolve(i),n.depth));const d=r.liftTarget(n);if(d==null)return!1;o.lift(n,d);let u=o.doc.resolve(o.mapping.map(l,-1)-1);return r.canJoin(o.doc,u.pos)&&u.nodeBefore.type==u.nodeAfter.type&&o.join(u.pos),t(o.scrollIntoView()),!0}function F(f,t,e){let n=f.tr,o=e.parent;for(let a=e.end,I=e.endIndex-1,y=e.startIndex;I>y;I--)a-=o.child(I).nodeSize,n.delete(a-1,a+1);let l=n.doc.resolve(e.start),i=l.nodeAfter;if(n.mapping.map(e.end)!=e.start+l.nodeAfter.nodeSize)return!1;let d=e.startIndex==0,u=e.endIndex==o.childCount,m=l.node(-1),p=l.index(-1);if(!m.canReplace(p+(d?0:1),p+1,i.content.append(u?r.Fragment.empty:r.Fragment.from(o))))return!1;let s=l.pos,c=s+i.nodeSize;return n.step(new r.ReplaceAroundStep(s-(d?1:0),c+(u?1:0),s+1,c-1,new r.Slice((d?r.Fragment.empty:r.Fragment.from(o.copy(r.Fragment.empty))).append(u?r.Fragment.empty:r.Fragment.from(o.copy(r.Fragment.empty))),d?0:1,u?0:1),d?0:1)),t(n.scrollIntoView()),!0}exports.liftListItem=R;exports.wrapInList=S;exports.wrapRangeInList=h;