@zipify/wysiwyg 4.6.0-0 → 4.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (64) hide show
  1. package/.husky/pre-commit +0 -3
  2. package/dist/cli.js +47 -49
  3. package/dist/node.js +29 -31
  4. package/dist/types/Wysiwyg.vue.d.ts +14 -16
  5. package/dist/types/components/base/Button.vue.d.ts +15 -8
  6. package/dist/types/components/base/ButtonToggle.vue.d.ts +19 -12
  7. package/dist/types/components/base/Checkbox.vue.d.ts +1 -1
  8. package/dist/types/components/base/FieldLabel.vue.d.ts +15 -8
  9. package/dist/types/components/base/Icon.vue.d.ts +1 -1
  10. package/dist/types/components/base/Modal.vue.d.ts +17 -8
  11. package/dist/types/components/base/ModalFloating.vue.d.ts +17 -8
  12. package/dist/types/components/base/NumberField.vue.d.ts +1 -1
  13. package/dist/types/components/base/Range.vue.d.ts +1 -1
  14. package/dist/types/components/base/ScrollView.vue.d.ts +12 -3
  15. package/dist/types/components/base/TextField.vue.d.ts +1 -1
  16. package/dist/types/components/base/colorPicker/ColorPicker.vue.d.ts +22 -13
  17. package/dist/types/components/base/composables/useModalToggler.d.ts +1 -4
  18. package/dist/types/components/base/composables/useNumberValue.d.ts +1 -1
  19. package/dist/types/components/base/composables/useScrollView.d.ts +1 -3
  20. package/dist/types/components/base/composables/useTempValue.d.ts +1 -1
  21. package/dist/types/components/base/composables/useValidator.d.ts +1 -1
  22. package/dist/types/components/base/dropdown/Dropdown.vue.d.ts +18 -9
  23. package/dist/types/components/base/dropdown/DropdownActivator.vue.d.ts +18 -11
  24. package/dist/types/components/base/dropdown/DropdownDivider.vue.d.ts +1 -1
  25. package/dist/types/components/base/dropdown/DropdownGroup.vue.d.ts +17 -10
  26. package/dist/types/components/base/dropdown/DropdownMenu.vue.d.ts +18 -10
  27. package/dist/types/components/base/dropdown/DropdownOption.vue.d.ts +17 -8
  28. package/dist/types/components/base/dropdown/composables/useActiveOptionManager.d.ts +2 -4
  29. package/dist/types/components/toolbar/Toolbar.vue.d.ts +1 -1
  30. package/dist/types/components/toolbar/ToolbarFloating.vue.d.ts +19 -20
  31. package/dist/types/components/toolbar/base/ToolbarDivider.vue.d.ts +5 -5
  32. package/dist/types/components/toolbar/base/ToolbarGroup.vue.d.ts +1 -1
  33. package/dist/types/components/toolbar/base/ToolbarRow.vue.d.ts +1 -1
  34. package/dist/types/components/toolbar/controls/AlignmentControl.vue.d.ts +1 -1
  35. package/dist/types/components/toolbar/controls/BackgroundColorControl.vue.d.ts +1 -1
  36. package/dist/types/components/toolbar/controls/CaseStyleControl.vue.d.ts +1 -1
  37. package/dist/types/components/toolbar/controls/FontColorControl.vue.d.ts +1 -1
  38. package/dist/types/components/toolbar/controls/FontFamilyControl.vue.d.ts +1 -1
  39. package/dist/types/components/toolbar/controls/FontSizeControl.vue.d.ts +1 -1
  40. package/dist/types/components/toolbar/controls/FontWeightControl.vue.d.ts +1 -1
  41. package/dist/types/components/toolbar/controls/ItalicControl.vue.d.ts +1 -1
  42. package/dist/types/components/toolbar/controls/LineHeightControl.vue.d.ts +1 -1
  43. package/dist/types/components/toolbar/controls/ListControl.vue.d.ts +1 -1
  44. package/dist/types/components/toolbar/controls/RemoveFormatControl.vue.d.ts +1 -1
  45. package/dist/types/components/toolbar/controls/StrikeThroughControl.vue.d.ts +1 -1
  46. package/dist/types/components/toolbar/controls/SuperscriptControl.vue.d.ts +1 -1
  47. package/dist/types/components/toolbar/controls/UnderlineControl.vue.d.ts +1 -1
  48. package/dist/types/components/toolbar/controls/composables/useRecentFonts.d.ts +1 -1
  49. package/dist/types/components/toolbar/controls/link/LinkControl.vue.d.ts +1 -1
  50. package/dist/types/components/toolbar/controls/link/LinkControlHeader.vue.d.ts +1 -1
  51. package/dist/types/components/toolbar/controls/link/composables/useLink.d.ts +18 -0
  52. package/dist/types/components/toolbar/controls/link/destination/LinkControlDestination.vue.d.ts +1 -1
  53. package/dist/types/components/toolbar/controls/link/destination/LinkControlPageBlock.vue.d.ts +1 -1
  54. package/dist/types/components/toolbar/controls/link/destination/LinkControlUrl.vue.d.ts +1 -1
  55. package/dist/types/components/toolbar/controls/stylePreset/StylePresetControl.vue.d.ts +1 -1
  56. package/dist/types/components/toolbar/controls/stylePreset/StylePresetOption.vue.d.ts +6 -4
  57. package/dist/types/components/toolbar/layouts/ToolbarDesktop.vue.d.ts +1 -1
  58. package/dist/types/components/toolbar/layouts/ToolbarMobile.vue.d.ts +1 -1
  59. package/dist/types/components/toolbar/layouts/ToolbarPopup.vue.d.ts +1 -1
  60. package/dist/types/extensions/core/index.d.ts +1 -1
  61. package/dist/types/services/NodeFactory.d.ts +3 -3
  62. package/dist/wysiwyg.mjs +117 -87
  63. package/lib/components/toolbar/ToolbarFloating.vue +16 -21
  64. package/package.json +36 -36
package/dist/node.js CHANGED
@@ -1,40 +1,38 @@
1
- "use strict";var Yh=require("jsdom");function ax(n,e){const t=new Set(n.split(","));return r=>t.has(r)}const en=process.env.NODE_ENV!=="production"?Object.freeze({}):{};process.env.NODE_ENV!=="production"&&Object.freeze([]);const Dn=()=>{},ux=n=>n.charCodeAt(0)===111&&n.charCodeAt(1)===110&&(n.charCodeAt(2)>122||n.charCodeAt(2)<97),Wt=Object.assign,cx=Object.prototype.hasOwnProperty,Oe=(n,e)=>cx.call(n,e),xe=Array.isArray,li=n=>Co(n)==="[object Map]",fx=n=>Co(n)==="[object Set]",Ie=n=>typeof n=="function",Ut=n=>typeof n=="string",To=n=>typeof n=="symbol",rt=n=>n!==null&&typeof n=="object",dx=n=>(rt(n)||Ie(n))&&Ie(n.then)&&Ie(n.catch),hx=Object.prototype.toString,Co=n=>hx.call(n),Xh=n=>Co(n).slice(8,-1),px=n=>Co(n)==="[object Object]",hu=n=>Ut(n)&&n!=="NaN"&&n[0]!=="-"&&""+parseInt(n,10)===n,mx=n=>{const e=Object.create(null);return t=>e[t]||(e[t]=n(t))},gx=mx(n=>n.charAt(0).toUpperCase()+n.slice(1)),Fn=(n,e)=>!Object.is(n,e),yx=(n,e,t)=>{Object.defineProperty(n,e,{configurable:!0,enumerable:!1,value:t})};let Zh;const Qh=()=>Zh||(Zh=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});function pu(n){if(xe(n)){const e={};for(let t=0;t<n.length;t++){const r=n[t],i=Ut(r)?wx(r):pu(r);if(i)for(const o in i)e[o]=i[o]}return e}else if(Ut(n)||rt(n))return n}const bx=/;(?![^(]*\))/g,vx=/:([^]+)/,Sx=/\/\*[^]*?\*\//g;function wx(n){const e={};return n.replace(Sx,"").split(bx).forEach(t=>{if(t){const r=t.split(vx);r.length>1&&(e[r[0].trim()]=r[1].trim())}}),e}function mu(n){let e="";if(Ut(n))e=n;else if(xe(n))for(let t=0;t<n.length;t++){const r=mu(n[t]);r&&(e+=r+" ")}else if(rt(n))for(const t in n)n[t]&&(e+=t+" ");return e.trim()}function gr(n,...e){console.warn(`[Vue warn] ${n}`,...e)}let _x;function xx(n,e=_x){e&&e.active&&e.effects.push(n)}let yr;class ep{constructor(e,t,r,i){this.fn=e,this.trigger=t,this.scheduler=r,this.active=!0,this.deps=[],this._dirtyLevel=4,this._trackId=0,this._runnings=0,this._shouldSchedule=!1,this._depsLength=0,xx(this,i)}get dirty(){if(this._dirtyLevel===2||this._dirtyLevel===3){this._dirtyLevel=1,yu();for(let e=0;e<this._depsLength;e++){const t=this.deps[e];if(t.computed&&(kx(t.computed),this._dirtyLevel>=4))break}this._dirtyLevel===1&&(this._dirtyLevel=0),bu()}return this._dirtyLevel>=4}set dirty(e){this._dirtyLevel=e?4:0}run(){if(this._dirtyLevel=0,!this.active)return this.fn();let e=Bn,t=yr;try{return Bn=!0,yr=this,this._runnings++,tp(this),this.fn()}finally{np(this),this._runnings--,yr=t,Bn=e}}stop(){var e;this.active&&(tp(this),np(this),(e=this.onStop)==null||e.call(this),this.active=!1)}}function kx(n){return n.value}function tp(n){n._trackId++,n._depsLength=0}function np(n){if(n.deps.length>n._depsLength){for(let e=n._depsLength;e<n.deps.length;e++)rp(n.deps[e],n);n.deps.length=n._depsLength}}function rp(n,e){const t=n.get(e);t!==void 0&&e._trackId!==t&&(n.delete(e),n.size===0&&n.cleanup())}let Bn=!0,gu=0;const ip=[];function yu(){ip.push(Bn),Bn=!1}function bu(){const n=ip.pop();Bn=n===void 0?!0:n}function vu(){gu++}function Su(){for(gu--;!gu&&wu.length;)wu.shift()()}function sp(n,e,t){var r;if(e.get(n)!==n._trackId){e.set(n,n._trackId);const i=n.deps[n._depsLength];i!==e?(i&&rp(i,n),n.deps[n._depsLength++]=e):n._depsLength++,process.env.NODE_ENV!=="production"&&((r=n.onTrack)==null||r.call(n,Wt({effect:n},t)))}}const wu=[];function op(n,e,t){var r;vu();for(const i of n.keys()){let o;i._dirtyLevel<e&&(o??(o=n.get(i)===i._trackId))&&(i._shouldSchedule||(i._shouldSchedule=i._dirtyLevel===0),i._dirtyLevel=e),i._shouldSchedule&&(o??(o=n.get(i)===i._trackId))&&(process.env.NODE_ENV!=="production"&&((r=i.onTrigger)==null||r.call(i,Wt({effect:i},t))),i.trigger(),(!i._runnings||i.allowRecurse)&&i._dirtyLevel!==2&&(i._shouldSchedule=!1,i.scheduler&&wu.push(i.scheduler)))}Su()}const lp=(n,e)=>{const t=new Map;return t.cleanup=n,t.computed=e,t},Ao=new WeakMap,br=Symbol(process.env.NODE_ENV!=="production"?"iterate":""),_u=Symbol(process.env.NODE_ENV!=="production"?"Map key iterate":"");function dt(n,e,t){if(Bn&&yr){let r=Ao.get(n);r||Ao.set(n,r=new Map);let i=r.get(t);i||r.set(t,i=lp(()=>r.delete(t))),sp(yr,i,process.env.NODE_ENV!=="production"?{target:n,type:e,key:t}:void 0)}}function zn(n,e,t,r,i,o){const a=Ao.get(n);if(!a)return;let u=[];if(e==="clear")u=[...a.values()];else if(t==="length"&&xe(n)){const f=Number(r);a.forEach((h,m)=>{(m==="length"||!To(m)&&m>=f)&&u.push(h)})}else switch(t!==void 0&&u.push(a.get(t)),e){case"add":xe(n)?hu(t)&&u.push(a.get("length")):(u.push(a.get(br)),li(n)&&u.push(a.get(_u)));break;case"delete":xe(n)||(u.push(a.get(br)),li(n)&&u.push(a.get(_u)));break;case"set":li(n)&&u.push(a.get(br));break}vu();for(const f of u)f&&op(f,4,process.env.NODE_ENV!=="production"?{target:n,type:e,key:t,newValue:r,oldValue:i,oldTarget:o}:void 0);Su()}function Ex(n,e){var t;return(t=Ao.get(n))==null?void 0:t.get(e)}const Tx=ax("__proto__,__v_isRef,__isVue"),ap=new Set(Object.getOwnPropertyNames(Symbol).filter(n=>n!=="arguments"&&n!=="caller").map(n=>Symbol[n]).filter(To)),up=Cx();function Cx(){const n={};return["includes","indexOf","lastIndexOf"].forEach(e=>{n[e]=function(...t){const r=ie(this);for(let o=0,a=this.length;o<a;o++)dt(r,"get",o+"");const i=r[e](...t);return i===-1||i===!1?r[e](...t.map(ie)):i}}),["push","pop","shift","unshift","splice"].forEach(e=>{n[e]=function(...t){yu(),vu();const r=ie(this)[e].apply(this,t);return Su(),bu(),r}}),n}function Ax(n){const e=ie(this);return dt(e,"has",n),e.hasOwnProperty(n)}class cp{constructor(e=!1,t=!1){this._isReadonly=e,this._isShallow=t}get(e,t,r){const i=this._isReadonly,o=this._isShallow;if(t==="__v_isReactive")return!i;if(t==="__v_isReadonly")return i;if(t==="__v_isShallow")return o;if(t==="__v_raw")return r===(i?o?vp:bp:o?$x:yp).get(e)||Object.getPrototypeOf(e)===Object.getPrototypeOf(r)?e:void 0;const a=xe(e);if(!i){if(a&&Oe(up,t))return Reflect.get(up,t,r);if(t==="hasOwnProperty")return Ax}const u=Reflect.get(e,t,r);return(To(t)?ap.has(t):Tx(t))||(i||dt(e,"get",t),o)?u:it(u)?a&&hu(t)?u:u.value:rt(u)?i?Sp(u):Eu(u):u}}class Mx extends cp{constructor(e=!1){super(!1,e)}set(e,t,r,i){let o=e[t];if(!this._isShallow){const f=$n(o);if(!Sr(r)&&!$n(r)&&(o=ie(o),r=ie(r)),!xe(e)&&it(o)&&!it(r))return f?!1:(o.value=r,!0)}const a=xe(e)&&hu(t)?Number(t)<e.length:Oe(e,t),u=Reflect.set(e,t,r,i);return e===ie(i)&&(a?Fn(r,o)&&zn(e,"set",t,r,o):zn(e,"add",t,r)),u}deleteProperty(e,t){const r=Oe(e,t),i=e[t],o=Reflect.deleteProperty(e,t);return o&&r&&zn(e,"delete",t,void 0,i),o}has(e,t){const r=Reflect.has(e,t);return(!To(t)||!ap.has(t))&&dt(e,"has",t),r}ownKeys(e){return dt(e,"iterate",xe(e)?"length":br),Reflect.ownKeys(e)}}class fp extends cp{constructor(e=!1){super(!0,e)}set(e,t){return process.env.NODE_ENV!=="production"&&gr(`Set operation on key "${String(t)}" failed: target is readonly.`,e),!0}deleteProperty(e,t){return process.env.NODE_ENV!=="production"&&gr(`Delete operation on key "${String(t)}" failed: target is readonly.`,e),!0}}const Ox=new Mx,Ix=new fp,Nx=new fp(!0),xu=n=>n,Mo=n=>Reflect.getPrototypeOf(n);function Oo(n,e,t=!1,r=!1){n=n.__v_raw;const i=ie(n),o=ie(e);t||(Fn(e,o)&&dt(i,"get",e),dt(i,"get",o));const{has:a}=Mo(i),u=r?xu:t?Au:ss;if(a.call(i,e))return u(n.get(e));if(a.call(i,o))return u(n.get(o));n!==i&&n.get(e)}function Io(n,e=!1){const t=this.__v_raw,r=ie(t),i=ie(n);return e||(Fn(n,i)&&dt(r,"has",n),dt(r,"has",i)),n===i?t.has(n):t.has(n)||t.has(i)}function No(n,e=!1){return n=n.__v_raw,!e&&dt(ie(n),"iterate",br),Reflect.get(n,"size",n)}function dp(n){n=ie(n);const e=ie(this);return Mo(e).has.call(e,n)||(e.add(n),zn(e,"add",n,n)),this}function hp(n,e){e=ie(e);const t=ie(this),{has:r,get:i}=Mo(t);let o=r.call(t,n);o?process.env.NODE_ENV!=="production"&&gp(t,r,n):(n=ie(n),o=r.call(t,n));const a=i.call(t,n);return t.set(n,e),o?Fn(e,a)&&zn(t,"set",n,e,a):zn(t,"add",n,e),this}function pp(n){const e=ie(this),{has:t,get:r}=Mo(e);let i=t.call(e,n);i?process.env.NODE_ENV!=="production"&&gp(e,t,n):(n=ie(n),i=t.call(e,n));const o=r?r.call(e,n):void 0,a=e.delete(n);return i&&zn(e,"delete",n,void 0,o),a}function mp(){const n=ie(this),e=n.size!==0,t=process.env.NODE_ENV!=="production"?li(n)?new Map(n):new Set(n):void 0,r=n.clear();return e&&zn(n,"clear",void 0,void 0,t),r}function Ro(n,e){return function(r,i){const o=this,a=o.__v_raw,u=ie(a),f=e?xu:n?Au:ss;return!n&&dt(u,"iterate",br),a.forEach((h,m)=>r.call(i,f(h),f(m),o))}}function Lo(n,e,t){return function(...r){const i=this.__v_raw,o=ie(i),a=li(o),u=n==="entries"||n===Symbol.iterator&&a,f=n==="keys"&&a,h=i[n](...r),m=t?xu:e?Au:ss;return!e&&dt(o,"iterate",f?_u:br),{next(){const{value:p,done:b}=h.next();return b?{value:p,done:b}:{value:u?[m(p[0]),m(p[1])]:m(p),done:b}},[Symbol.iterator](){return this}}}}function Hn(n){return function(...e){if(process.env.NODE_ENV!=="production"){const t=e[0]?`on key "${e[0]}" `:"";gr(`${gx(n)} operation ${t}failed: target is readonly.`,ie(this))}return n==="delete"?!1:n==="clear"?void 0:this}}function Rx(){const n={get(o){return Oo(this,o)},get size(){return No(this)},has:Io,add:dp,set:hp,delete:pp,clear:mp,forEach:Ro(!1,!1)},e={get(o){return Oo(this,o,!1,!0)},get size(){return No(this)},has:Io,add:dp,set:hp,delete:pp,clear:mp,forEach:Ro(!1,!0)},t={get(o){return Oo(this,o,!0)},get size(){return No(this,!0)},has(o){return Io.call(this,o,!0)},add:Hn("add"),set:Hn("set"),delete:Hn("delete"),clear:Hn("clear"),forEach:Ro(!0,!1)},r={get(o){return Oo(this,o,!0,!0)},get size(){return No(this,!0)},has(o){return Io.call(this,o,!0)},add:Hn("add"),set:Hn("set"),delete:Hn("delete"),clear:Hn("clear"),forEach:Ro(!0,!0)};return["keys","values","entries",Symbol.iterator].forEach(o=>{n[o]=Lo(o,!1,!1),t[o]=Lo(o,!0,!1),e[o]=Lo(o,!1,!0),r[o]=Lo(o,!0,!0)}),[n,t,e,r]}const[Lx,Px,Dx,Fx]=Rx();function ku(n,e){const t=e?n?Fx:Dx:n?Px:Lx;return(r,i,o)=>i==="__v_isReactive"?!n:i==="__v_isReadonly"?n:i==="__v_raw"?r:Reflect.get(Oe(t,i)&&i in r?t:r,i,o)}const Bx={get:ku(!1,!1)},zx={get:ku(!0,!1)},Hx={get:ku(!0,!0)};function gp(n,e,t){const r=ie(t);if(r!==t&&e.call(n,r)){const i=Xh(n);gr(`Reactive ${i} contains both the raw and reactive versions of the same object${i==="Map"?" as keys":""}, which can lead to inconsistencies. Avoid differentiating between the raw and reactive versions of an object and only use the reactive version if possible.`)}}const yp=new WeakMap,$x=new WeakMap,bp=new WeakMap,vp=new WeakMap;function Wx(n){switch(n){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function Ux(n){return n.__v_skip||!Object.isExtensible(n)?0:Wx(Xh(n))}function Eu(n){return $n(n)?n:Tu(n,!1,Ox,Bx,yp)}function Sp(n){return Tu(n,!0,Ix,zx,bp)}function Po(n){return Tu(n,!0,Nx,Hx,vp)}function Tu(n,e,t,r,i){if(!rt(n))return process.env.NODE_ENV!=="production"&&gr(`value cannot be made reactive: ${String(n)}`),n;if(n.__v_raw&&!(e&&n.__v_isReactive))return n;const o=i.get(n);if(o)return o;const a=Ux(n);if(a===0)return n;const u=new Proxy(n,a===2?r:t);return i.set(n,u),u}function vr(n){return $n(n)?vr(n.__v_raw):!!(n&&n.__v_isReactive)}function $n(n){return!!(n&&n.__v_isReadonly)}function Sr(n){return!!(n&&n.__v_isShallow)}function Cu(n){return vr(n)||$n(n)}function ie(n){const e=n&&n.__v_raw;return e?ie(e):n}function Vx(n){return Object.isExtensible(n)&&yx(n,"__v_skip",!0),n}const ss=n=>rt(n)?Eu(n):n,Au=n=>rt(n)?Sp(n):n,Kx="Computed is still dirty after getter evaluation, likely because a computed is mutating its own dependency in its getter. State mutations in computed getters should be avoided. Check the docs for more details: https://vuejs.org/guide/essentials/computed.html#getters-should-be-side-effect-free";class wp{constructor(e,t,r,i){this.getter=e,this._setter=t,this.dep=void 0,this.__v_isRef=!0,this.__v_isReadonly=!1,this.effect=new ep(()=>e(this._value),()=>Do(this,this.effect._dirtyLevel===2?2:3)),this.effect.computed=this,this.effect.active=this._cacheable=!i,this.__v_isReadonly=r}get value(){const e=ie(this);return(!e._cacheable||e.effect.dirty)&&Fn(e._value,e._value=e.effect.run())&&Do(e,4),_p(e),e.effect._dirtyLevel>=2&&(process.env.NODE_ENV!=="production"&&this._warnRecursive&&gr(Kx,`
2
-
3
- getter: `,this.getter),Do(e,2)),e._value}set value(e){this._setter(e)}get _dirty(){return this.effect.dirty}set _dirty(e){this.effect.dirty=e}}function Gx(n,e,t=!1){let r,i;const o=Ie(n);o?(r=n,i=process.env.NODE_ENV!=="production"?()=>{gr("Write operation failed: computed value is readonly")}:Dn):(r=n.get,i=n.set);const a=new wp(r,i,o||!i,t);return process.env.NODE_ENV!=="production"&&e&&!t&&(a.effect.onTrack=e.onTrack,a.effect.onTrigger=e.onTrigger),a}function _p(n){var e;Bn&&yr&&(n=ie(n),sp(yr,(e=n.dep)!=null?e:n.dep=lp(()=>n.dep=void 0,n instanceof wp?n:void 0),process.env.NODE_ENV!=="production"?{target:n,type:"get",key:"value"}:void 0))}function Do(n,e=4,t){n=ie(n);const r=n.dep;r&&op(r,e,process.env.NODE_ENV!=="production"?{target:n,type:"set",key:"value",newValue:t}:void 0)}function it(n){return!!(n&&n.__v_isRef===!0)}function Fo(n){return qx(n,!1)}function qx(n,e){return it(n)?n:new Jx(n,e)}class Jx{constructor(e,t){this.__v_isShallow=t,this.dep=void 0,this.__v_isRef=!0,this._rawValue=t?e:ie(e),this._value=t?e:ss(e)}get value(){return _p(this),this._value}set value(e){const t=this.__v_isShallow||Sr(e)||$n(e);e=t?e:ie(e),Fn(e,this._rawValue)&&(this._rawValue=e,this._value=t?e:ss(e),Do(this,4,e))}}function F(n){return it(n)?n.value:n}const jx={get:(n,e,t)=>F(Reflect.get(n,e,t)),set:(n,e,t,r)=>{const i=n[e];return it(i)&&!it(t)?(i.value=t,!0):Reflect.set(n,e,t,r)}};function Yx(n){return vr(n)?n:new Proxy(n,jx)}class Xx{constructor(e,t,r){this._object=e,this._key=t,this._defaultValue=r,this.__v_isRef=!0}get value(){const e=this._object[this._key];return e===void 0?this._defaultValue:e}set value(e){this._object[this._key]=e}get dep(){return Ex(ie(this._object),this._key)}}class Zx{constructor(e){this._getter=e,this.__v_isRef=!0,this.__v_isReadonly=!0}get value(){return this._getter()}}function ai(n,e,t){return it(n)?n:Ie(n)?new Zx(n):rt(n)&&arguments.length>1?Qx(n,e,t):Fo(n)}function Qx(n,e,t){const r=n[e];return it(r)?r:new Xx(n,e,t)}const wr=[];function ek(n){wr.push(n)}function tk(){wr.pop()}function Me(n,...e){yu();const t=wr.length?wr[wr.length-1].component:null,r=t&&t.appContext.config.warnHandler,i=nk();if(r)_r(r,t,11,[n+e.map(o=>{var a,u;return(u=(a=o.toString)==null?void 0:a.call(o))!=null?u:JSON.stringify(o)}).join(""),t&&t.proxy,i.map(({vnode:o})=>`at <${Kp(t,o.type)}>`).join(`
1
+ "use strict";var rp=require("jsdom");function c_(n){const e=Object.create(null);for(const t of n.split(","))e[t]=1;return t=>t in e}const Pt=process.env.NODE_ENV!=="production"?Object.freeze({}):{};process.env.NODE_ENV!=="production"&&Object.freeze([]);const vr=()=>{},u_=n=>n.charCodeAt(0)===111&&n.charCodeAt(1)===110&&(n.charCodeAt(2)>122||n.charCodeAt(2)<97),wt=Object.assign,f_=Object.prototype.hasOwnProperty,Ie=(n,e)=>f_.call(n,e),ke=Array.isArray,li=n=>Io(n)==="[object Map]",d_=n=>Io(n)==="[object Set]",Ne=n=>typeof n=="function",Jt=n=>typeof n=="string",as=n=>typeof n=="symbol",ot=n=>n!==null&&typeof n=="object",h_=n=>(ot(n)||Ne(n))&&Ne(n.then)&&Ne(n.catch),p_=Object.prototype.toString,Io=n=>p_.call(n),ip=n=>Io(n).slice(8,-1),m_=n=>Io(n)==="[object Object]",vc=n=>Jt(n)&&n!=="NaN"&&n[0]!=="-"&&""+parseInt(n,10)===n,g_=n=>{const e=Object.create(null);return t=>e[t]||(e[t]=n(t))},y_=g_(n=>n.charAt(0).toUpperCase()+n.slice(1)),Un=(n,e)=>!Object.is(n,e),b_=(n,e,t,r=!1)=>{Object.defineProperty(n,e,{configurable:!0,enumerable:!1,writable:r,value:t})};let sp;const No=()=>sp||(sp=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});function Sc(n){if(ke(n)){const e={};for(let t=0;t<n.length;t++){const r=n[t],i=Jt(r)?w_(r):Sc(r);if(i)for(const o in i)e[o]=i[o]}return e}else if(Jt(n)||ot(n))return n}const v_=/;(?![^(]*\))/g,S_=/:([^]+)/,x_=/\/\*[^]*?\*\//g;function w_(n){const e={};return n.replace(x_,"").split(v_).forEach(t=>{if(t){const r=t.split(S_);r.length>1&&(e[r[0].trim()]=r[1].trim())}}),e}function xc(n){let e="";if(Jt(n))e=n;else if(ke(n))for(let t=0;t<n.length;t++){const r=xc(n[t]);r&&(e+=r+" ")}else if(ot(n))for(const t in n)n[t]&&(e+=t+" ");return e.trim()}function Cn(n,...e){console.warn(`[Vue warn] ${n}`,...e)}let ye;const wc=new WeakSet;class __{constructor(e){this.fn=e,this.deps=void 0,this.depsTail=void 0,this.flags=5,this.next=void 0,this.cleanup=void 0,this.scheduler=void 0}pause(){this.flags|=64}resume(){this.flags&64&&(this.flags&=-65,wc.has(this)&&(wc.delete(this),this.trigger()))}notify(){this.flags&2&&!(this.flags&32)||this.flags&8||lp(this)}run(){if(!(this.flags&1))return this.fn();this.flags|=2,dp(this),ap(this);const e=ye,t=jt;ye=this,jt=!0;try{return this.fn()}finally{process.env.NODE_ENV!=="production"&&ye!==this&&Cn("Active effect was not restored correctly - this is likely a Vue internal bug."),cp(this),ye=e,jt=t,this.flags&=-3}}stop(){if(this.flags&1){for(let e=this.deps;e;e=e.nextDep)Tc(e);this.deps=this.depsTail=void 0,dp(this),this.onStop&&this.onStop(),this.flags&=-2}}trigger(){this.flags&64?wc.add(this):this.scheduler?this.scheduler():this.runIfDirty()}runIfDirty(){Ec(this)&&this.run()}get dirty(){return Ec(this)}}let op=0,cs,us;function lp(n,e=!1){if(n.flags|=8,e){n.next=us,us=n;return}n.next=cs,cs=n}function _c(){op++}function kc(){if(--op>0)return;if(us){let e=us;for(us=void 0;e;){const t=e.next;e.next=void 0,e.flags&=-9,e=t}}let n;for(;cs;){let e=cs;for(cs=void 0;e;){const t=e.next;if(e.next=void 0,e.flags&=-9,e.flags&1)try{e.trigger()}catch(r){n||(n=r)}e=t}}if(n)throw n}function ap(n){for(let e=n.deps;e;e=e.nextDep)e.version=-1,e.prevActiveLink=e.dep.activeLink,e.dep.activeLink=e}function cp(n){let e,t=n.depsTail,r=t;for(;r;){const i=r.prevDep;r.version===-1?(r===t&&(t=i),Tc(r),k_(r)):e=r,r.dep.activeLink=r.prevActiveLink,r.prevActiveLink=void 0,r=i}n.deps=e,n.depsTail=t}function Ec(n){for(let e=n.deps;e;e=e.nextDep)if(e.dep.version!==e.version||e.dep.computed&&(up(e.dep.computed)||e.dep.version!==e.version))return!0;return!!n._dirty}function up(n){if(n.flags&4&&!(n.flags&16)||(n.flags&=-17,n.globalVersion===fs))return;n.globalVersion=fs;const e=n.dep;if(n.flags|=2,e.version>0&&!n.isSSR&&n.deps&&!Ec(n)){n.flags&=-3;return}const t=ye,r=jt;ye=n,jt=!0;try{ap(n);const i=n.fn(n._value);(e.version===0||Un(i,n._value))&&(n._value=i,e.version++)}catch(i){throw e.version++,i}finally{ye=t,jt=r,cp(n),n.flags&=-3}}function Tc(n,e=!1){const{dep:t,prevSub:r,nextSub:i}=n;if(r&&(r.nextSub=i,n.prevSub=void 0),i&&(i.prevSub=r,n.nextSub=void 0),process.env.NODE_ENV!=="production"&&t.subsHead===n&&(t.subsHead=i),t.subs===n&&(t.subs=r,!r&&t.computed)){t.computed.flags&=-5;for(let o=t.computed.deps;o;o=o.nextDep)Tc(o,!0)}!e&&!--t.sc&&t.map&&t.map.delete(t.key)}function k_(n){const{prevDep:e,nextDep:t}=n;e&&(e.nextDep=t,n.prevDep=void 0),t&&(t.prevDep=e,n.nextDep=void 0)}let jt=!0;const fp=[];function Ro(){fp.push(jt),jt=!1}function Lo(){const n=fp.pop();jt=n===void 0?!0:n}function dp(n){const{cleanup:e}=n;if(n.cleanup=void 0,e){const t=ye;ye=void 0;try{e()}finally{ye=t}}}let fs=0,E_=class{constructor(e,t){this.sub=e,this.dep=t,this.version=t.version,this.nextDep=this.prevDep=this.nextSub=this.prevSub=this.prevActiveLink=void 0}};class Cc{constructor(e){this.computed=e,this.version=0,this.activeLink=void 0,this.subs=void 0,this.map=void 0,this.key=void 0,this.sc=0,process.env.NODE_ENV!=="production"&&(this.subsHead=void 0)}track(e){if(!ye||!jt||ye===this.computed)return;let t=this.activeLink;if(t===void 0||t.sub!==ye)t=this.activeLink=new E_(ye,this),ye.deps?(t.prevDep=ye.depsTail,ye.depsTail.nextDep=t,ye.depsTail=t):ye.deps=ye.depsTail=t,hp(t);else if(t.version===-1&&(t.version=this.version,t.nextDep)){const r=t.nextDep;r.prevDep=t.prevDep,t.prevDep&&(t.prevDep.nextDep=r),t.prevDep=ye.depsTail,t.nextDep=void 0,ye.depsTail.nextDep=t,ye.depsTail=t,ye.deps===t&&(ye.deps=r)}return process.env.NODE_ENV!=="production"&&ye.onTrack&&ye.onTrack(wt({effect:ye},e)),t}trigger(e){this.version++,fs++,this.notify(e)}notify(e){_c();try{if(process.env.NODE_ENV!=="production")for(let t=this.subsHead;t;t=t.nextSub)t.sub.onTrigger&&!(t.sub.flags&8)&&t.sub.onTrigger(wt({effect:t.sub},e));for(let t=this.subs;t;t=t.prevSub)t.sub.notify()&&t.sub.dep.notify()}finally{kc()}}}function hp(n){if(n.dep.sc++,n.sub.flags&4){const e=n.dep.computed;if(e&&!n.dep.subs){e.flags|=20;for(let r=e.deps;r;r=r.nextDep)hp(r)}const t=n.dep.subs;t!==n&&(n.prevSub=t,t&&(t.nextSub=n)),process.env.NODE_ENV!=="production"&&n.dep.subsHead===void 0&&(n.dep.subsHead=n),n.dep.subs=n}}const Po=new WeakMap,Sr=Symbol(process.env.NODE_ENV!=="production"?"Object iterate":""),Ac=Symbol(process.env.NODE_ENV!=="production"?"Map keys iterate":""),ds=Symbol(process.env.NODE_ENV!=="production"?"Array iterate":"");function Be(n,e,t){if(jt&&ye){let r=Po.get(n);r||Po.set(n,r=new Map);let i=r.get(t);i||(r.set(t,i=new Cc),i.map=r,i.key=t),process.env.NODE_ENV!=="production"?i.track({target:n,type:e,key:t}):i.track()}}function Vn(n,e,t,r,i,o){const a=Po.get(n);if(!a){fs++;return}const c=f=>{f&&(process.env.NODE_ENV!=="production"?f.trigger({target:n,type:e,key:t,newValue:r,oldValue:i,oldTarget:o}):f.trigger())};if(_c(),e==="clear")a.forEach(c);else{const f=ke(n),h=f&&vc(t);if(f&&t==="length"){const m=Number(r);a.forEach((p,y)=>{(y==="length"||y===ds||!as(y)&&y>=m)&&c(p)})}else switch((t!==void 0||a.has(void 0))&&c(a.get(t)),h&&c(a.get(ds)),e){case"add":f?h&&c(a.get("length")):(c(a.get(Sr)),li(n)&&c(a.get(Ac)));break;case"delete":f||(c(a.get(Sr)),li(n)&&c(a.get(Ac)));break;case"set":li(n)&&c(a.get(Sr));break}}kc()}function T_(n,e){const t=Po.get(n);return t&&t.get(e)}function ai(n){const e=ae(n);return e===n?e:(Be(e,"iterate",ds),pt(n)?e:e.map(lt))}function Mc(n){return Be(n=ae(n),"iterate",ds),n}const C_={__proto__:null,[Symbol.iterator](){return Oc(this,Symbol.iterator,lt)},concat(...n){return ai(this).concat(...n.map(e=>ke(e)?ai(e):e))},entries(){return Oc(this,"entries",n=>(n[1]=lt(n[1]),n))},every(n,e){return An(this,"every",n,e,void 0,arguments)},filter(n,e){return An(this,"filter",n,e,t=>t.map(lt),arguments)},find(n,e){return An(this,"find",n,e,lt,arguments)},findIndex(n,e){return An(this,"findIndex",n,e,void 0,arguments)},findLast(n,e){return An(this,"findLast",n,e,lt,arguments)},findLastIndex(n,e){return An(this,"findLastIndex",n,e,void 0,arguments)},forEach(n,e){return An(this,"forEach",n,e,void 0,arguments)},includes(...n){return Ic(this,"includes",n)},indexOf(...n){return Ic(this,"indexOf",n)},join(n){return ai(this).join(n)},lastIndexOf(...n){return Ic(this,"lastIndexOf",n)},map(n,e){return An(this,"map",n,e,void 0,arguments)},pop(){return hs(this,"pop")},push(...n){return hs(this,"push",n)},reduce(n,...e){return pp(this,"reduce",n,e)},reduceRight(n,...e){return pp(this,"reduceRight",n,e)},shift(){return hs(this,"shift")},some(n,e){return An(this,"some",n,e,void 0,arguments)},splice(...n){return hs(this,"splice",n)},toReversed(){return ai(this).toReversed()},toSorted(n){return ai(this).toSorted(n)},toSpliced(...n){return ai(this).toSpliced(...n)},unshift(...n){return hs(this,"unshift",n)},values(){return Oc(this,"values",lt)}};function Oc(n,e,t){const r=Mc(n),i=r[e]();return r!==n&&!pt(n)&&(i._next=i.next,i.next=()=>{const o=i._next();return o.value&&(o.value=t(o.value)),o}),i}const A_=Array.prototype;function An(n,e,t,r,i,o){const a=Mc(n),c=a!==n&&!pt(n),f=a[e];if(f!==A_[e]){const p=f.apply(n,o);return c?lt(p):p}let h=t;a!==n&&(c?h=function(p,y){return t.call(this,lt(p),y,n)}:t.length>2&&(h=function(p,y){return t.call(this,p,y,n)}));const m=f.call(a,h,r);return c&&i?i(m):m}function pp(n,e,t,r){const i=Mc(n);let o=t;return i!==n&&(pt(n)?t.length>3&&(o=function(a,c,f){return t.call(this,a,c,f,n)}):o=function(a,c,f){return t.call(this,a,lt(c),f,n)}),i[e](o,...r)}function Ic(n,e,t){const r=ae(n);Be(r,"iterate",ds);const i=r[e](...t);return(i===-1||i===!1)&&zo(t[0])?(t[0]=ae(t[0]),r[e](...t)):i}function hs(n,e,t=[]){Ro(),_c();const r=ae(n)[e].apply(n,t);return kc(),Lo(),r}const M_=c_("__proto__,__v_isRef,__isVue"),mp=new Set(Object.getOwnPropertyNames(Symbol).filter(n=>n!=="arguments"&&n!=="caller").map(n=>Symbol[n]).filter(as));function O_(n){as(n)||(n=String(n));const e=ae(this);return Be(e,"has",n),e.hasOwnProperty(n)}class gp{constructor(e=!1,t=!1){this._isReadonly=e,this._isShallow=t}get(e,t,r){const i=this._isReadonly,o=this._isShallow;if(t==="__v_isReactive")return!i;if(t==="__v_isReadonly")return i;if(t==="__v_isShallow")return o;if(t==="__v_raw")return r===(i?o?xp:Sp:o?H_:vp).get(e)||Object.getPrototypeOf(e)===Object.getPrototypeOf(r)?e:void 0;const a=ke(e);if(!i){let f;if(a&&(f=C_[t]))return f;if(t==="hasOwnProperty")return O_}const c=Reflect.get(e,t,Ke(e)?e:r);return(as(t)?mp.has(t):M_(t))||(i||Be(e,"get",t),o)?c:Ke(c)?a&&vc(t)?c:c.value:ot(c)?i?wp(c):Lc(c):c}}class I_ extends gp{constructor(e=!1){super(!1,e)}set(e,t,r,i){let o=e[t];if(!this._isShallow){const f=Mn(o);if(!pt(r)&&!Mn(r)&&(o=ae(o),r=ae(r)),!ke(e)&&Ke(o)&&!Ke(r))return f?!1:(o.value=r,!0)}const a=ke(e)&&vc(t)?Number(t)<e.length:Ie(e,t),c=Reflect.set(e,t,r,Ke(e)?e:i);return e===ae(i)&&(a?Un(r,o)&&Vn(e,"set",t,r,o):Vn(e,"add",t,r)),c}deleteProperty(e,t){const r=Ie(e,t),i=e[t],o=Reflect.deleteProperty(e,t);return o&&r&&Vn(e,"delete",t,void 0,i),o}has(e,t){const r=Reflect.has(e,t);return(!as(t)||!mp.has(t))&&Be(e,"has",t),r}ownKeys(e){return Be(e,"iterate",ke(e)?"length":Sr),Reflect.ownKeys(e)}}class yp extends gp{constructor(e=!1){super(!0,e)}set(e,t){return process.env.NODE_ENV!=="production"&&Cn(`Set operation on key "${String(t)}" failed: target is readonly.`,e),!0}deleteProperty(e,t){return process.env.NODE_ENV!=="production"&&Cn(`Delete operation on key "${String(t)}" failed: target is readonly.`,e),!0}}const N_=new I_,R_=new yp,L_=new yp(!0),Nc=n=>n,Do=n=>Reflect.getPrototypeOf(n);function P_(n,e,t){return function(...r){const i=this.__v_raw,o=ae(i),a=li(o),c=n==="entries"||n===Symbol.iterator&&a,f=n==="keys"&&a,h=i[n](...r),m=t?Nc:e?Dc:lt;return!e&&Be(o,"iterate",f?Ac:Sr),{next(){const{value:p,done:y}=h.next();return y?{value:p,done:y}:{value:c?[m(p[0]),m(p[1])]:m(p),done:y}},[Symbol.iterator](){return this}}}}function Fo(n){return function(...e){if(process.env.NODE_ENV!=="production"){const t=e[0]?`on key "${e[0]}" `:"";Cn(`${y_(n)} operation ${t}failed: target is readonly.`,ae(this))}return n==="delete"?!1:n==="clear"?void 0:this}}function D_(n,e){const t={get(i){const o=this.__v_raw,a=ae(o),c=ae(i);n||(Un(i,c)&&Be(a,"get",i),Be(a,"get",c));const{has:f}=Do(a),h=e?Nc:n?Dc:lt;if(f.call(a,i))return h(o.get(i));if(f.call(a,c))return h(o.get(c));o!==a&&o.get(i)},get size(){const i=this.__v_raw;return!n&&Be(ae(i),"iterate",Sr),Reflect.get(i,"size",i)},has(i){const o=this.__v_raw,a=ae(o),c=ae(i);return n||(Un(i,c)&&Be(a,"has",i),Be(a,"has",c)),i===c?o.has(i):o.has(i)||o.has(c)},forEach(i,o){const a=this,c=a.__v_raw,f=ae(c),h=e?Nc:n?Dc:lt;return!n&&Be(f,"iterate",Sr),c.forEach((m,p)=>i.call(o,h(m),h(p),a))}};return wt(t,n?{add:Fo("add"),set:Fo("set"),delete:Fo("delete"),clear:Fo("clear")}:{add(i){!e&&!pt(i)&&!Mn(i)&&(i=ae(i));const o=ae(this);return Do(o).has.call(o,i)||(o.add(i),Vn(o,"add",i,i)),this},set(i,o){!e&&!pt(o)&&!Mn(o)&&(o=ae(o));const a=ae(this),{has:c,get:f}=Do(a);let h=c.call(a,i);h?process.env.NODE_ENV!=="production"&&bp(a,c,i):(i=ae(i),h=c.call(a,i));const m=f.call(a,i);return a.set(i,o),h?Un(o,m)&&Vn(a,"set",i,o,m):Vn(a,"add",i,o),this},delete(i){const o=ae(this),{has:a,get:c}=Do(o);let f=a.call(o,i);f?process.env.NODE_ENV!=="production"&&bp(o,a,i):(i=ae(i),f=a.call(o,i));const h=c?c.call(o,i):void 0,m=o.delete(i);return f&&Vn(o,"delete",i,void 0,h),m},clear(){const i=ae(this),o=i.size!==0,a=process.env.NODE_ENV!=="production"?li(i)?new Map(i):new Set(i):void 0,c=i.clear();return o&&Vn(i,"clear",void 0,void 0,a),c}}),["keys","values","entries",Symbol.iterator].forEach(i=>{t[i]=P_(i,n,e)}),t}function Rc(n,e){const t=D_(n,e);return(r,i,o)=>i==="__v_isReactive"?!n:i==="__v_isReadonly"?n:i==="__v_raw"?r:Reflect.get(Ie(t,i)&&i in r?t:r,i,o)}const F_={get:Rc(!1,!1)},B_={get:Rc(!0,!1)},z_={get:Rc(!0,!0)};function bp(n,e,t){const r=ae(t);if(r!==t&&e.call(n,r)){const i=ip(n);Cn(`Reactive ${i} contains both the raw and reactive versions of the same object${i==="Map"?" as keys":""}, which can lead to inconsistencies. Avoid differentiating between the raw and reactive versions of an object and only use the reactive version if possible.`)}}const vp=new WeakMap,H_=new WeakMap,Sp=new WeakMap,xp=new WeakMap;function $_(n){switch(n){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function W_(n){return n.__v_skip||!Object.isExtensible(n)?0:$_(ip(n))}function Lc(n){return Mn(n)?n:Pc(n,!1,N_,F_,vp)}function wp(n){return Pc(n,!0,R_,B_,Sp)}function Bo(n){return Pc(n,!0,L_,z_,xp)}function Pc(n,e,t,r,i){if(!ot(n))return process.env.NODE_ENV!=="production"&&Cn(`value cannot be made ${e?"readonly":"reactive"}: ${String(n)}`),n;if(n.__v_raw&&!(e&&n.__v_isReactive))return n;const o=i.get(n);if(o)return o;const a=W_(n);if(a===0)return n;const c=new Proxy(n,a===2?r:t);return i.set(n,c),c}function ci(n){return Mn(n)?ci(n.__v_raw):!!(n&&n.__v_isReactive)}function Mn(n){return!!(n&&n.__v_isReadonly)}function pt(n){return!!(n&&n.__v_isShallow)}function zo(n){return n?!!n.__v_raw:!1}function ae(n){const e=n&&n.__v_raw;return e?ae(e):n}function U_(n){return!Ie(n,"__v_skip")&&Object.isExtensible(n)&&b_(n,"__v_skip",!0),n}const lt=n=>ot(n)?Lc(n):n,Dc=n=>ot(n)?wp(n):n;function Ke(n){return n?n.__v_isRef===!0:!1}function Ho(n){return V_(n,!1)}function V_(n,e){return Ke(n)?n:new K_(n,e)}class K_{constructor(e,t){this.dep=new Cc,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=t?e:ae(e),this._value=t?e:lt(e),this.__v_isShallow=t}get value(){return process.env.NODE_ENV!=="production"?this.dep.track({target:this,type:"get",key:"value"}):this.dep.track(),this._value}set value(e){const t=this._rawValue,r=this.__v_isShallow||pt(e)||Mn(e);e=r?e:ae(e),Un(e,t)&&(this._rawValue=e,this._value=r?e:lt(e),process.env.NODE_ENV!=="production"?this.dep.trigger({target:this,type:"set",key:"value",newValue:e,oldValue:t}):this.dep.trigger())}}function F(n){return Ke(n)?n.value:n}const G_={get:(n,e,t)=>e==="__v_raw"?n:F(Reflect.get(n,e,t)),set:(n,e,t,r)=>{const i=n[e];return Ke(i)&&!Ke(t)?(i.value=t,!0):Reflect.set(n,e,t,r)}};function q_(n){return ci(n)?n:new Proxy(n,G_)}class J_{constructor(e,t,r){this._object=e,this._key=t,this._defaultValue=r,this.__v_isRef=!0,this._value=void 0}get value(){const e=this._object[this._key];return this._value=e===void 0?this._defaultValue:e}set value(e){this._object[this._key]=e}get dep(){return T_(ae(this._object),this._key)}}class j_{constructor(e){this._getter=e,this.__v_isRef=!0,this.__v_isReadonly=!0,this._value=void 0}get value(){return this._value=this._getter()}}function ui(n,e,t){return Ke(n)?n:Ne(n)?new j_(n):ot(n)&&arguments.length>1?Y_(n,e,t):Ho(n)}function Y_(n,e,t){const r=n[e];return Ke(r)?r:new J_(n,e,t)}class X_{constructor(e,t,r){this.fn=e,this.setter=t,this._value=void 0,this.dep=new Cc(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=fs-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!t,this.isSSR=r}notify(){if(this.flags|=16,!(this.flags&8)&&ye!==this)return lp(this,!0),!0;process.env.NODE_ENV}get value(){const e=process.env.NODE_ENV!=="production"?this.dep.track({target:this,type:"get",key:"value"}):this.dep.track();return up(this),e&&(e.version=this.dep.version),this._value}set value(e){this.setter?this.setter(e):process.env.NODE_ENV!=="production"&&Cn("Write operation failed: computed value is readonly")}}function Z_(n,e,t=!1){let r,i;Ne(n)?r=n:(r=n.get,i=n.set);const o=new X_(r,i,t);return process.env.NODE_ENV!=="production"&&e&&!t&&(o.onTrack=e.onTrack,o.onTrigger=e.onTrigger),o}const $o={},Wo=new WeakMap;let xr;function Q_(n,e=!1,t=xr){if(t){let r=Wo.get(t);r||Wo.set(t,r=[]),r.push(n)}else process.env.NODE_ENV!=="production"&&!e&&Cn("onWatcherCleanup() was called when there was no active watcher to associate with.")}function ek(n,e,t=Pt){const{immediate:r,deep:i,once:o,scheduler:a,augmentJob:c,call:f}=t,h=G=>{(t.onWarn||Cn)("Invalid watch source: ",G,"A watch source can only be a getter/effect function, a ref, a reactive object, or an array of these types.")},m=G=>i?G:pt(G)||i===!1||i===0?Kn(G,1):Kn(G);let p,y,S,_,C=!1,A=!1;if(Ke(n)?(y=()=>n.value,C=pt(n)):ci(n)?(y=()=>m(n),C=!0):ke(n)?(A=!0,C=n.some(G=>ci(G)||pt(G)),y=()=>n.map(G=>{if(Ke(G))return G.value;if(ci(G))return m(G);if(Ne(G))return f?f(G,2):G();process.env.NODE_ENV!=="production"&&h(G)})):Ne(n)?e?y=f?()=>f(n,2):n:y=()=>{if(S){Ro();try{S()}finally{Lo()}}const G=xr;xr=p;try{return f?f(n,3,[_]):n(_)}finally{xr=G}}:(y=vr,process.env.NODE_ENV!=="production"&&h(n)),e&&i){const G=y,ie=i===!0?1/0:i;y=()=>Kn(G(),ie)}const R=()=>{p.stop()};if(o&&e){const G=e;e=(...ie)=>{G(...ie),R()}}let K=A?new Array(n.length).fill($o):$o;const V=G=>{if(!(!(p.flags&1)||!p.dirty&&!G))if(e){const ie=p.run();if(i||C||(A?ie.some((q,ue)=>Un(q,K[ue])):Un(ie,K))){S&&S();const q=xr;xr=p;try{const ue=[ie,K===$o?void 0:A&&K[0]===$o?[]:K,_];f?f(e,3,ue):e(...ue),K=ie}finally{xr=q}}}else p.run()};return c&&c(V),p=new __(y),p.scheduler=a?()=>a(V,!1):V,_=G=>Q_(G,!1,p),S=p.onStop=()=>{const G=Wo.get(p);if(G){if(f)f(G,4);else for(const ie of G)ie();Wo.delete(p)}},process.env.NODE_ENV!=="production"&&(p.onTrack=t.onTrack,p.onTrigger=t.onTrigger),e?r?V(!0):K=p.run():a?a(V.bind(null,!0),!0):p.run(),R.pause=p.pause.bind(p),R.resume=p.resume.bind(p),R.stop=R,R}function Kn(n,e=1/0,t){if(e<=0||!ot(n)||n.__v_skip||(t=t||new Set,t.has(n)))return n;if(t.add(n),e--,Ke(n))Kn(n.value,e,t);else if(ke(n))for(let r=0;r<n.length;r++)Kn(n[r],e,t);else if(d_(n)||li(n))n.forEach(r=>{Kn(r,e,t)});else if(m_(n)){for(const r in n)Kn(n[r],e,t);for(const r of Object.getOwnPropertySymbols(n))Object.prototype.propertyIsEnumerable.call(n,r)&&Kn(n[r],e,t)}return n}const wr=[];function tk(n){wr.push(n)}function nk(){wr.pop()}let Fc=!1;function Te(n,...e){if(Fc)return;Fc=!0,Ro();const t=wr.length?wr[wr.length-1].component:null,r=t&&t.appContext.config.warnHandler,i=rk();if(r)Uo(r,t,11,[n+e.map(o=>{var a,c;return(c=(a=o.toString)==null?void 0:a.call(o))!=null?c:JSON.stringify(o)}).join(""),t&&t.proxy,i.map(({vnode:o})=>`at <${Kp(t,o.type)}>`).join(`
4
2
  `),i]);else{const o=[`[Vue warn]: ${n}`,...e];i.length&&o.push(`
5
- `,...rk(i)),console.warn(...o)}bu()}function nk(){let n=wr[wr.length-1];if(!n)return[];const e=[];for(;n;){const t=e[0];t&&t.vnode===n?t.recurseCount++:e.push({vnode:n,recurseCount:0});const r=n.component&&n.component.parent;n=r&&r.vnode}return e}function rk(n){const e=[];return n.forEach((t,r)=>{e.push(...r===0?[]:[`
6
- `],...ik(t))}),e}function ik({vnode:n,recurseCount:e}){const t=e>0?`... (${e} recursive calls)`:"",r=n.component?n.component.parent==null:!1,i=` at <${Kp(n.component,n.type,r)}`,o=">"+t;return n.props?[i,...sk(n.props),o]:[i+o]}function sk(n){const e=[],t=Object.keys(n);return t.slice(0,3).forEach(r=>{e.push(...xp(r,n[r]))}),t.length>3&&e.push(" ..."),e}function xp(n,e,t){return Ut(e)?(e=JSON.stringify(e),t?e:[`${n}=${e}`]):typeof e=="number"||typeof e=="boolean"||e==null?t?e:[`${n}=${e}`]:it(e)?(e=xp(n,ie(e.value),!0),t?e:[`${n}=Ref<`,e,">"]):Ie(e)?[`${n}=fn${e.name?`<${e.name}>`:""}`]:(e=ie(e),t?e:[`${n}=`,e])}const kp={sp:"serverPrefetch hook",bc:"beforeCreate hook",c:"created hook",bm:"beforeMount hook",m:"mounted hook",bu:"beforeUpdate hook",u:"updated",bum:"beforeUnmount hook",um:"unmounted hook",a:"activated hook",da:"deactivated hook",ec:"errorCaptured hook",rtc:"renderTracked hook",rtg:"renderTriggered hook",0:"setup function",1:"render function",2:"watcher getter",3:"watcher callback",4:"watcher cleanup function",5:"native event handler",6:"component event handler",7:"vnode hook",8:"directive hook",9:"transition hook",10:"app errorHandler",11:"app warnHandler",12:"ref function",13:"async component loader",14:"scheduler flush. This is likely a Vue internals bug. Please open an issue at https://github.com/vuejs/core ."};function _r(n,e,t,r){try{return r?n(...r):n()}catch(i){Mu(i,e,t)}}function Bo(n,e,t,r){if(Ie(n)){const o=_r(n,e,t,r);return o&&dx(o)&&o.catch(a=>{Mu(a,e,t)}),o}const i=[];for(let o=0;o<n.length;o++)i.push(Bo(n[o],e,t,r));return i}function Mu(n,e,t,r=!0){const i=e?e.vnode:null;if(e){let o=e.parent;const a=e.proxy,u=process.env.NODE_ENV!=="production"?kp[t]:`https://vuejs.org/error-reference/#runtime-${t}`;for(;o;){const h=o.ec;if(h){for(let m=0;m<h.length;m++)if(h[m](n,a,u)===!1)return}o=o.parent}const f=e.appContext.config.errorHandler;if(f){_r(f,null,10,[n,a,u]);return}}ok(n,t,i,r)}function ok(n,e,t,r=!0){if(process.env.NODE_ENV!=="production"){const i=kp[e];if(t&&ek(t),Me(`Unhandled error${i?` during execution of ${i}`:""}`),t&&tk(),r)throw n;console.error(n)}else console.error(n)}let zo=!1,Ou=!1;const Vt=[];let Wn=0;const ui=[];let xn=null,Un=0;const Ep=Promise.resolve();let Iu=null;const lk=100;function ak(n){const e=Iu||Ep;return n?e.then(this?n.bind(this):n):e}function uk(n){let e=Wn+1,t=Vt.length;for(;e<t;){const r=e+t>>>1,i=Vt[r],o=ls(i);o<n||o===n&&i.pre?e=r+1:t=r}return e}function Nu(n){(!Vt.length||!Vt.includes(n,zo&&n.allowRecurse?Wn+1:Wn))&&(n.id==null?Vt.push(n):Vt.splice(uk(n.id),0,n),Tp())}function Tp(){!zo&&!Ou&&(Ou=!0,Iu=Ep.then(Ap))}function Cp(n){xe(n)?ui.push(...n):(!xn||!xn.includes(n,n.allowRecurse?Un+1:Un))&&ui.push(n),Tp()}function ck(n){if(ui.length){const e=[...new Set(ui)].sort((t,r)=>ls(t)-ls(r));if(ui.length=0,xn){xn.push(...e);return}for(xn=e,process.env.NODE_ENV!=="production"&&(n=n||new Map),Un=0;Un<xn.length;Un++)process.env.NODE_ENV!=="production"&&Mp(n,xn[Un])||xn[Un]();xn=null,Un=0}}const ls=n=>n.id==null?1/0:n.id,fk=(n,e)=>{const t=ls(n)-ls(e);if(t===0){if(n.pre&&!e.pre)return-1;if(e.pre&&!n.pre)return 1}return t};function Ap(n){Ou=!1,zo=!0,process.env.NODE_ENV!=="production"&&(n=n||new Map),Vt.sort(fk);const e=process.env.NODE_ENV!=="production"?t=>Mp(n,t):Dn;try{for(Wn=0;Wn<Vt.length;Wn++){const t=Vt[Wn];if(t&&t.active!==!1){if(process.env.NODE_ENV!=="production"&&e(t))continue;_r(t,null,14)}}}finally{Wn=0,Vt.length=0,ck(n),zo=!1,Iu=null,(Vt.length||ui.length)&&Ap(n)}}function Mp(n,e){if(!n.has(e))n.set(e,1);else{const t=n.get(e);if(t>lk){const r=e.ownerInstance,i=r&&Vp(r.type);return Mu(`Maximum recursive updates exceeded${i?` in component <${i}>`:""}. This means you have a reactive effect that is mutating its own dependencies and thus recursively triggering itself. Possible sources include component template, render function, updated hook or watcher source function.`,null,10),!0}else n.set(e,t+1)}}const as=new Set;process.env.NODE_ENV!=="production"&&(Qh().__VUE_HMR_RUNTIME__={createRecord:Ru(dk),rerender:Ru(hk),reload:Ru(pk)});const Ho=new Map;function dk(n,e){return Ho.has(n)?!1:(Ho.set(n,{initialDef:us(e),instances:new Set}),!0)}function us(n){return Gp(n)?n.__vccOpts:n}function hk(n,e){const t=Ho.get(n);t&&(t.initialDef.render=e,[...t.instances].forEach(r=>{e&&(r.render=e,us(r.type).render=e),r.renderCache=[],r.effect.dirty=!0,r.update()}))}function pk(n,e){const t=Ho.get(n);if(!t)return;e=us(e),Op(t.initialDef,e);const r=[...t.instances];for(const i of r){const o=us(i.type);as.has(o)||(o!==t.initialDef&&Op(o,e),as.add(o)),i.appContext.propsCache.delete(i.type),i.appContext.emitsCache.delete(i.type),i.appContext.optionsCache.delete(i.type),i.ceReload?(as.add(o),i.ceReload(e.styles),as.delete(o)):i.parent?(i.parent.effect.dirty=!0,Nu(i.parent.update)):i.appContext.reload?i.appContext.reload():typeof window<"u"?window.location.reload():console.warn("[HMR] Root or manually mounted instance modified. Full reload required.")}Cp(()=>{for(const i of r)as.delete(us(i.type))})}function Op(n,e){Wt(n,e);for(const t in n)t!=="__file"&&!(t in e)&&delete n[t]}function Ru(n){return(e,t)=>{try{return n(e,t)}catch(r){console.error(r),console.warn("[HMR] Something went wrong during Vue component hot-reload. Full reload required.")}}}let ci,$o=[];function Ip(n,e){var t,r;ci=n,ci?(ci.enabled=!0,$o.forEach(({event:i,args:o})=>ci.emit(i,...o)),$o=[]):typeof window<"u"&&window.HTMLElement&&!((r=(t=window.navigator)==null?void 0:t.userAgent)!=null&&r.includes("jsdom"))?((e.__VUE_DEVTOOLS_HOOK_REPLAY__=e.__VUE_DEVTOOLS_HOOK_REPLAY__||[]).push(o=>{Ip(o,e)}),setTimeout(()=>{ci||(e.__VUE_DEVTOOLS_HOOK_REPLAY__=null,$o=[])},3e3)):$o=[]}let tn=null,mk=null;function NO(){}const gk=Symbol.for("v-ndc"),yk=n=>n.__isSuspense;function bk(n,e){e&&e.pendingBranch?xe(n)?e.effects.push(...n):e.effects.push(n):Cp(n)}const vk=Symbol.for("v-scx"),Sk=()=>{{const n=Ik(vk);return n||process.env.NODE_ENV!=="production"&&Me("Server rendering context not provided. Make sure to only call useSSRContext() conditionally in the server build."),n}},Wo={};function wk(n,e,t){return process.env.NODE_ENV!=="production"&&!Ie(e)&&Me("`watch(fn, options?)` signature has been moved to a separate API. Use `watchEffect(fn, options?)` instead. `watch` now only supports `watch(source, cb, options?) signature."),Np(n,e,t)}function Np(n,e,{immediate:t,deep:r,flush:i,once:o,onTrack:a,onTrigger:u}=en){if(e&&o){const B=e;e=(...ue)=>{B(...ue),pe()}}process.env.NODE_ENV!=="production"&&r!==void 0&&typeof r=="number"&&Me('watch() "deep" option with number value will be used as watch depth in future versions. Please use a boolean instead to avoid potential breakage.'),process.env.NODE_ENV!=="production"&&!e&&(t!==void 0&&Me('watch() "immediate" option is only respected when using the watch(source, callback, options?) signature.'),r!==void 0&&Me('watch() "deep" option is only respected when using the watch(source, callback, options?) signature.'),o!==void 0&&Me('watch() "once" option is only respected when using the watch(source, callback, options?) signature.'));const f=B=>{Me("Invalid watch source: ",B,"A watch source can only be a getter/effect function, a ref, a reactive object, or an array of these types.")},h=ds,m=B=>r===!0?B:fi(B,r===!1?1:void 0);let p,b=!1,S=!1;if(it(n)?(p=()=>n.value,b=Sr(n)):vr(n)?(p=()=>m(n),b=!0):xe(n)?(S=!0,b=n.some(B=>vr(B)||Sr(B)),p=()=>n.map(B=>{if(it(B))return B.value;if(vr(B))return m(B);if(Ie(B))return _r(B,h,2);process.env.NODE_ENV!=="production"&&f(B)})):Ie(n)?e?p=()=>_r(n,h,2):p=()=>(x&&x(),Bo(n,h,3,[C])):(p=Dn,process.env.NODE_ENV!=="production"&&f(n)),e&&r){const B=p;p=()=>fi(B())}let x,C=B=>{x=oe.onStop=()=>{_r(B,h,4),x=oe.onStop=void 0}},A;if(Bu)if(C=Dn,e?t&&Bo(e,h,3,[p(),S?[]:void 0,C]):p(),i==="sync"){const B=Sk();A=B.__watcherHandles||(B.__watcherHandles=[])}else return Dn;let N=S?new Array(n.length).fill(Wo):Wo;const G=()=>{if(!(!oe.active||!oe.dirty))if(e){const B=oe.run();(r||b||(S?B.some((ue,lt)=>Fn(ue,N[lt])):Fn(B,N)))&&(x&&x(),Bo(e,h,3,[B,N===Wo?void 0:S&&N[0]===Wo?[]:N,C]),N=B)}else oe.run()};G.allowRecurse=!!e;let K;i==="sync"?K=G:i==="post"?K=()=>Bp(G,h&&h.suspense):(G.pre=!0,h&&(G.id=h.uid),K=()=>Nu(G));const oe=new ep(p,Dn,K),pe=()=>{oe.stop()};return process.env.NODE_ENV!=="production"&&(oe.onTrack=a,oe.onTrigger=u),e?t?G():N=oe.run():i==="post"?Bp(oe.run.bind(oe),h&&h.suspense):oe.run(),A&&A.push(pe),pe}function _k(n,e,t){const r=this.proxy,i=Ut(n)?n.includes(".")?xk(r,n):()=>r[n]:n.bind(r,r);let o;Ie(e)?o=e:(o=e.handler,t=e);const a=Uk(this),u=Np(i,o.bind(r),t);return a(),u}function xk(n,e){const t=e.split(".");return()=>{let r=n;for(let i=0;i<t.length&&r;i++)r=r[t[i]];return r}}function fi(n,e,t=0,r){if(!rt(n)||n.__v_skip)return n;if(e&&e>0){if(t>=e)return n;t++}if(r=r||new Set,r.has(n))return n;if(r.add(n),it(n))fi(n.value,e,t,r);else if(xe(n))for(let i=0;i<n.length;i++)fi(n[i],e,t,r);else if(fx(n)||li(n))n.forEach(i=>{fi(i,e,t,r)});else if(px(n))for(const i in n)fi(n[i],e,t,r);return n}const Lu=n=>n?Vk(n)?Kk(n)||n.proxy:Lu(n.parent):null,cs=Wt(Object.create(null),{$:n=>n,$el:n=>n.vnode.el,$data:n=>n.data,$props:n=>process.env.NODE_ENV!=="production"?Po(n.props):n.props,$attrs:n=>process.env.NODE_ENV!=="production"?Po(n.attrs):n.attrs,$slots:n=>process.env.NODE_ENV!=="production"?Po(n.slots):n.slots,$refs:n=>process.env.NODE_ENV!=="production"?Po(n.refs):n.refs,$parent:n=>Lu(n.parent),$root:n=>Lu(n.root),$emit:n=>n.emit,$options:n=>__VUE_OPTIONS_API__?Ck(n):n.type,$forceUpdate:n=>n.f||(n.f=()=>{n.effect.dirty=!0,Nu(n.update)}),$nextTick:n=>n.n||(n.n=ak.bind(n.proxy)),$watch:n=>__VUE_OPTIONS_API__?_k.bind(n):Dn}),kk=n=>n==="_"||n==="$",Pu=(n,e)=>n!==en&&!n.__isScriptSetup&&Oe(n,e),Ek={get({_:n},e){const{ctx:t,setupState:r,data:i,props:o,accessCache:a,type:u,appContext:f}=n;if(process.env.NODE_ENV!=="production"&&e==="__isVue")return!0;let h;if(e[0]!=="$"){const S=a[e];if(S!==void 0)switch(S){case 1:return r[e];case 2:return i[e];case 4:return t[e];case 3:return o[e]}else{if(Pu(r,e))return a[e]=1,r[e];if(i!==en&&Oe(i,e))return a[e]=2,i[e];if((h=n.propsOptions[0])&&Oe(h,e))return a[e]=3,o[e];if(t!==en&&Oe(t,e))return a[e]=4,t[e];(!__VUE_OPTIONS_API__||Tk)&&(a[e]=0)}}const m=cs[e];let p,b;if(m)return e==="$attrs"?(dt(n,"get",e),process.env.NODE_ENV!=="production"&&void 0):process.env.NODE_ENV!=="production"&&e==="$slots"&&dt(n,"get",e),m(n);if((p=u.__cssModules)&&(p=p[e]))return p;if(t!==en&&Oe(t,e))return a[e]=4,t[e];if(b=f.config.globalProperties,Oe(b,e))return b[e];process.env.NODE_ENV!=="production"&&tn&&(!Ut(e)||e.indexOf("__v")!==0)&&(i!==en&&kk(e[0])&&Oe(i,e)?Me(`Property ${JSON.stringify(e)} must be accessed via $data because it starts with a reserved character ("$" or "_") and is not proxied on the render context.`):n===tn&&Me(`Property ${JSON.stringify(e)} was accessed during render but is not defined on instance.`))},set({_:n},e,t){const{data:r,setupState:i,ctx:o}=n;return Pu(i,e)?(i[e]=t,!0):process.env.NODE_ENV!=="production"&&i.__isScriptSetup&&Oe(i,e)?(Me(`Cannot mutate <script setup> binding "${e}" from Options API.`),!1):r!==en&&Oe(r,e)?(r[e]=t,!0):Oe(n.props,e)?(process.env.NODE_ENV!=="production"&&Me(`Attempting to mutate prop "${e}". Props are readonly.`),!1):e[0]==="$"&&e.slice(1)in n?(process.env.NODE_ENV!=="production"&&Me(`Attempting to mutate public property "${e}". Properties starting with $ are reserved and readonly.`),!1):(process.env.NODE_ENV!=="production"&&e in n.appContext.config.globalProperties?Object.defineProperty(o,e,{enumerable:!0,configurable:!0,value:t}):o[e]=t,!0)},has({_:{data:n,setupState:e,accessCache:t,ctx:r,appContext:i,propsOptions:o}},a){let u;return!!t[a]||n!==en&&Oe(n,a)||Pu(e,a)||(u=o[0])&&Oe(u,a)||Oe(r,a)||Oe(cs,a)||Oe(i.config.globalProperties,a)},defineProperty(n,e,t){return t.get!=null?n._.accessCache[e]=0:Oe(t,"value")&&this.set(n,e,t.value,null),Reflect.defineProperty(n,e,t)}};process.env.NODE_ENV!=="production"&&(Ek.ownKeys=n=>(Me("Avoid app logic that relies on enumerating keys on a component instance. The keys will be empty in production mode to avoid performance overhead."),Reflect.ownKeys(n)));function Rp(n){return xe(n)?n.reduce((e,t)=>(e[t]=null,e),{}):n}let Tk=!0;function Ck(n){const e=n.type,{mixins:t,extends:r}=e,{mixins:i,optionsCache:o,config:{optionMergeStrategies:a}}=n.appContext,u=o.get(e);let f;return u?f=u:!i.length&&!t&&!r?f=e:(f={},i.length&&i.forEach(h=>Uo(f,h,a,!0)),Uo(f,e,a)),rt(e)&&o.set(e,f),f}function Uo(n,e,t,r=!1){const{mixins:i,extends:o}=e;o&&Uo(n,o,t,!0),i&&i.forEach(a=>Uo(n,a,t,!0));for(const a in e)if(r&&a==="expose")process.env.NODE_ENV!=="production"&&Me('"expose" option is ignored when declared in mixins or extends. It should only be declared in the base component itself.');else{const u=Ak[a]||t&&t[a];n[a]=u?u(n[a],e[a]):e[a]}return n}const Ak={data:Lp,props:Dp,emits:Dp,methods:fs,computed:fs,beforeCreate:st,created:st,beforeMount:st,mounted:st,beforeUpdate:st,updated:st,beforeDestroy:st,beforeUnmount:st,destroyed:st,unmounted:st,activated:st,deactivated:st,errorCaptured:st,serverPrefetch:st,components:fs,directives:fs,watch:Ok,provide:Lp,inject:Mk};function Lp(n,e){return e?n?function(){return Wt(Ie(n)?n.call(this,this):n,Ie(e)?e.call(this,this):e)}:e:n}function Mk(n,e){return fs(Pp(n),Pp(e))}function Pp(n){if(xe(n)){const e={};for(let t=0;t<n.length;t++)e[n[t]]=n[t];return e}return n}function st(n,e){return n?[...new Set([].concat(n,e))]:e}function fs(n,e){return n?Wt(Object.create(null),n,e):e}function Dp(n,e){return n?xe(n)&&xe(e)?[...new Set([...n,...e])]:Wt(Object.create(null),Rp(n),Rp(e??{})):e}function Ok(n,e){if(!n)return e;if(!e)return n;const t=Wt(Object.create(null),n);for(const r in e)t[r]=st(n[r],e[r]);return t}let Fp=null;function Ik(n,e,t=!1){const r=ds||tn;if(r||Fp){const i=r?r.parent==null?r.vnode.appContext&&r.vnode.appContext.provides:r.parent.provides:Fp._context.provides;if(i&&n in i)return i[n];if(arguments.length>1)return t&&Ie(e)?e.call(r&&r.proxy):e;process.env.NODE_ENV!=="production"&&Me(`injection "${String(n)}" not found.`)}else process.env.NODE_ENV!=="production"&&Me("inject() can only be used inside setup() or functional components.")}const Bp=bk,Nk=n=>n.__isTeleport,zp=Symbol.for("v-fgt"),Rk=Symbol.for("v-txt"),Lk=Symbol.for("v-cmt");let di=null;function Pk(n){return n?n.__v_isVNode===!0:!1}const Dk=(...n)=>Wp(...n),Hp="__vInternal",$p=({key:n})=>n??null,Vo=({ref:n,ref_key:e,ref_for:t})=>(typeof n=="number"&&(n=""+n),n!=null?Ut(n)||it(n)||Ie(n)?{i:tn,r:n,k:e,f:!!t}:n:null);function Fk(n,e=null,t=null,r=0,i=null,o=n===zp?0:1,a=!1,u=!1){const f={__v_isVNode:!0,__v_skip:!0,type:n,props:e,key:e&&$p(e),ref:e&&Vo(e),scopeId:mk,slotScopeIds:null,children:t,component:null,suspense:null,ssContent:null,ssFallback:null,dirs:null,transition:null,el:null,anchor:null,target:null,targetAnchor:null,staticCount:0,shapeFlag:o,patchFlag:r,dynamicProps:i,dynamicChildren:null,appContext:null,ctx:tn};return u?(Du(f,t),o&128&&n.normalize(f)):t&&(f.shapeFlag|=Ut(t)?8:16),process.env.NODE_ENV!=="production"&&f.key!==f.key&&Me("VNode created with invalid key (NaN). VNode type:",f.type),!a&&di&&(f.patchFlag>0||o&6)&&f.patchFlag!==32&&di.push(f),f}const Bk=process.env.NODE_ENV!=="production"?Dk:Wp;function Wp(n,e=null,t=null,r=0,i=null,o=!1){if((!n||n===gk)&&(process.env.NODE_ENV!=="production"&&!n&&Me(`Invalid vnode type when creating vnode: ${n}.`),n=Lk),Pk(n)){const u=Ko(n,e,!0);return t&&Du(u,t),!o&&di&&(u.shapeFlag&6?di[di.indexOf(n)]=u:di.push(u)),u.patchFlag|=-2,u}if(Gp(n)&&(n=n.__vccOpts),e){e=zk(e);let{class:u,style:f}=e;u&&!Ut(u)&&(e.class=mu(u)),rt(f)&&(Cu(f)&&!xe(f)&&(f=Wt({},f)),e.style=pu(f))}const a=Ut(n)?1:yk(n)?128:Nk(n)?64:rt(n)?4:Ie(n)?2:0;return process.env.NODE_ENV!=="production"&&a&4&&Cu(n)&&(n=ie(n),Me("Vue received a Component that was made a reactive object. This can lead to unnecessary performance overhead and should be avoided by marking the component with `markRaw` or using `shallowRef` instead of `ref`.",`
7
- Component that was made reactive: `,n)),Fk(n,e,t,r,i,a,o,!0)}function zk(n){return n?Cu(n)||Hp in n?Wt({},n):n:null}function Ko(n,e,t=!1){const{props:r,ref:i,patchFlag:o,children:a}=n,u=e?$k(r||{},e):r;return{__v_isVNode:!0,__v_skip:!0,type:n.type,props:u,key:u&&$p(u),ref:e&&e.ref?t&&i?xe(i)?i.concat(Vo(e)):[i,Vo(e)]:Vo(e):i,scopeId:n.scopeId,slotScopeIds:n.slotScopeIds,children:process.env.NODE_ENV!=="production"&&o===-1&&xe(a)?a.map(Up):a,target:n.target,targetAnchor:n.targetAnchor,staticCount:n.staticCount,shapeFlag:n.shapeFlag,patchFlag:e&&n.type!==zp?o===-1?16:o|16:o,dynamicProps:n.dynamicProps,dynamicChildren:n.dynamicChildren,appContext:n.appContext,dirs:n.dirs,transition:n.transition,component:n.component,suspense:n.suspense,ssContent:n.ssContent&&Ko(n.ssContent),ssFallback:n.ssFallback&&Ko(n.ssFallback),el:n.el,anchor:n.anchor,ctx:n.ctx,ce:n.ce}}function Up(n){const e=Ko(n);return xe(n.children)&&(e.children=n.children.map(Up)),e}function Hk(n=" ",e=0){return Bk(Rk,null,n,e)}function Du(n,e){let t=0;const{shapeFlag:r}=n;if(e==null)e=null;else if(xe(e))t=16;else if(typeof e=="object")if(r&65){const i=e.default;i&&(i._c&&(i._d=!1),Du(n,i()),i._c&&(i._d=!0));return}else{t=32;const i=e._;!i&&!(Hp in e)?e._ctx=tn:i===3&&tn&&(tn.slots._===1?e._=1:(e._=2,n.patchFlag|=1024))}else Ie(e)?(e={default:e,_ctx:tn},t=32):(e=String(e),r&64?(t=16,e=[Hk(e)]):t=8);n.children=e,n.shapeFlag|=t}function $k(...n){const e={};for(let t=0;t<n.length;t++){const r=n[t];for(const i in r)if(i==="class")e.class!==r.class&&(e.class=mu([e.class,r.class]));else if(i==="style")e.style=pu([e.style,r.style]);else if(ux(i)){const o=e[i],a=r[i];a&&o!==a&&!(xe(o)&&o.includes(a))&&(e[i]=o?[].concat(o,a):a)}else i!==""&&(e[i]=r[i])}return e}let ds=null;const Wk=()=>ds||tn;let Fu;{const n=Qh(),e=(t,r)=>{let i;return(i=n[t])||(i=n[t]=[]),i.push(r),o=>{i.length>1?i.forEach(a=>a(o)):i[0](o)}};Fu=e("__VUE_INSTANCE_SETTERS__",t=>ds=t),e("__VUE_SSR_SETTERS__",t=>Bu=t)}const Uk=n=>{const e=ds;return Fu(n),n.scope.on(),()=>{n.scope.off(),Fu(e)}};function Vk(n){return n.vnode.shapeFlag&4}let Bu=!1;function Kk(n){if(n.exposed)return n.exposeProxy||(n.exposeProxy=new Proxy(Yx(Vx(n.exposed)),{get(e,t){if(t in e)return e[t];if(t in cs)return cs[t](n)},has(e,t){return t in e||t in cs}}))}const Gk=/(?:^|[-_])(\w)/g,qk=n=>n.replace(Gk,e=>e.toUpperCase()).replace(/[-_]/g,"");function Vp(n,e=!0){return Ie(n)?n.displayName||n.name:n.name||e&&n.__name}function Kp(n,e,t=!1){let r=Vp(e);if(!r&&e.__file){const i=e.__file.match(/([^/\\]+)\.\w+$/);i&&(r=i[1])}if(!r&&n&&n.parent){const i=o=>{for(const a in o)if(o[a]===e)return a};r=i(n.components||n.parent.type.components)||i(n.appContext.components)}return r?qk(r):t?"App":"Anonymous"}function Gp(n){return Ie(n)&&"__vccOpts"in n}const fe=(n,e)=>{const t=Gx(n,e,Bu);if(process.env.NODE_ENV!=="production"){const r=Wk();r&&r.appContext.config.warnRecursiveComputed&&(t._warnRecursive=!0)}return t};function Jk(){if(process.env.NODE_ENV==="production"||typeof window>"u")return;const n={style:"color:#3ba776"},e={style:"color:#1677ff"},t={style:"color:#f5222d"},r={style:"color:#eb2f96"},i={header(p){return rt(p)?p.__isVue?["div",n,"VueInstance"]:it(p)?["div",{},["span",n,m(p)],"<",u(p.value),">"]:vr(p)?["div",{},["span",n,Sr(p)?"ShallowReactive":"Reactive"],"<",u(p),`>${$n(p)?" (readonly)":""}`]:$n(p)?["div",{},["span",n,Sr(p)?"ShallowReadonly":"Readonly"],"<",u(p),">"]:null:null},hasBody(p){return p&&p.__isVue},body(p){if(p&&p.__isVue)return["div",{},...o(p.$)]}};function o(p){const b=[];p.type.props&&p.props&&b.push(a("props",ie(p.props))),p.setupState!==en&&b.push(a("setup",p.setupState)),p.data!==en&&b.push(a("data",ie(p.data)));const S=f(p,"computed");S&&b.push(a("computed",S));const x=f(p,"inject");return x&&b.push(a("injected",x)),b.push(["div",{},["span",{style:r.style+";opacity:0.66"},"$ (internal): "],["object",{object:p}]]),b}function a(p,b){return b=Wt({},b),Object.keys(b).length?["div",{style:"line-height:1.25em;margin-bottom:0.6em"},["div",{style:"color:#476582"},p],["div",{style:"padding-left:1.25em"},...Object.keys(b).map(S=>["div",{},["span",r,S+": "],u(b[S],!1)])]]:["span",{}]}function u(p,b=!0){return typeof p=="number"?["span",e,p]:typeof p=="string"?["span",t,JSON.stringify(p)]:typeof p=="boolean"?["span",r,p]:rt(p)?["object",{object:b?ie(p):p}]:["span",t,String(p)]}function f(p,b){const S=p.type;if(Ie(S))return;const x={};for(const C in p.ctx)h(S,C,b)&&(x[C]=p.ctx[C]);return x}function h(p,b,S){const x=p[S];if(xe(x)&&x.includes(b)||rt(x)&&b in x||p.extends&&h(p.extends,b,S)||p.mixins&&p.mixins.some(C=>h(C,b,S)))return!0}function m(p){return Sr(p)?"ShallowRef":p.effect?"ComputedRef":"Ref"}window.devtoolsFormatters?window.devtoolsFormatters.push(i):window.devtoolsFormatters=[i]}process.env.NODE_ENV,process.env.NODE_ENV,process.env.NODE_ENV;function jk(){Jk()}process.env.NODE_ENV!=="production"&&jk();function Ue(n){this.content=n}Ue.prototype={constructor:Ue,find:function(n){for(var e=0;e<this.content.length;e+=2)if(this.content[e]===n)return e;return-1},get:function(n){var e=this.find(n);return e==-1?void 0:this.content[e+1]},update:function(n,e,t){var r=t&&t!=n?this.remove(t):this,i=r.find(n),o=r.content.slice();return i==-1?o.push(t||n,e):(o[i+1]=e,t&&(o[i]=t)),new Ue(o)},remove:function(n){var e=this.find(n);if(e==-1)return this;var t=this.content.slice();return t.splice(e,2),new Ue(t)},addToStart:function(n,e){return new Ue([n,e].concat(this.remove(n).content))},addToEnd:function(n,e){var t=this.remove(n).content.slice();return t.push(n,e),new Ue(t)},addBefore:function(n,e,t){var r=this.remove(e),i=r.content.slice(),o=r.find(n);return i.splice(o==-1?i.length:o,0,e,t),new Ue(i)},forEach:function(n){for(var e=0;e<this.content.length;e+=2)n(this.content[e],this.content[e+1])},prepend:function(n){return n=Ue.from(n),n.size?new Ue(n.content.concat(this.subtract(n).content)):this},append:function(n){return n=Ue.from(n),n.size?new Ue(this.subtract(n).content.concat(n.content)):this},subtract:function(n){var e=this;n=Ue.from(n);for(var t=0;t<n.content.length;t+=2)e=e.remove(n.content[t]);return e},get size(){return this.content.length>>1}},Ue.from=function(n){if(n instanceof Ue)return n;var e=[];if(n)for(var t in n)e.push(t,n[t]);return new Ue(e)};function qp(n,e,t){for(let r=0;;r++){if(r==n.childCount||r==e.childCount)return n.childCount==e.childCount?null:t;let i=n.child(r),o=e.child(r);if(i==o){t+=i.nodeSize;continue}if(!i.sameMarkup(o))return t;if(i.isText&&i.text!=o.text){for(let a=0;i.text[a]==o.text[a];a++)t++;return t}if(i.content.size||o.content.size){let a=qp(i.content,o.content,t+1);if(a!=null)return a}t+=i.nodeSize}}function Jp(n,e,t,r){for(let i=n.childCount,o=e.childCount;;){if(i==0||o==0)return i==o?null:{a:t,b:r};let a=n.child(--i),u=e.child(--o),f=a.nodeSize;if(a==u){t-=f,r-=f;continue}if(!a.sameMarkup(u))return{a:t,b:r};if(a.isText&&a.text!=u.text){let h=0,m=Math.min(a.text.length,u.text.length);for(;h<m&&a.text[a.text.length-h-1]==u.text[u.text.length-h-1];)h++,t--,r--;return{a:t,b:r}}if(a.content.size||u.content.size){let h=Jp(a.content,u.content,t-1,r-1);if(h)return h}t-=f,r-=f}}class L{constructor(e,t){if(this.content=e,this.size=t||0,t==null)for(let r=0;r<e.length;r++)this.size+=e[r].nodeSize}nodesBetween(e,t,r,i=0,o){for(let a=0,u=0;u<t;a++){let f=this.content[a],h=u+f.nodeSize;if(h>e&&r(f,i+u,o||null,a)!==!1&&f.content.size){let m=u+1;f.nodesBetween(Math.max(0,e-m),Math.min(f.content.size,t-m),r,i+m)}u=h}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,t,r,i){let o="",a=!0;return this.nodesBetween(e,t,(u,f)=>{u.isText?(o+=u.text.slice(Math.max(e,f)-f,t-f),a=!r):u.isLeaf?(i?o+=typeof i=="function"?i(u):i:u.type.spec.leafText&&(o+=u.type.spec.leafText(u)),a=!r):!a&&u.isBlock&&(o+=r,a=!0)},0),o}append(e){if(!e.size)return this;if(!this.size)return e;let t=this.lastChild,r=e.firstChild,i=this.content.slice(),o=0;for(t.isText&&t.sameMarkup(r)&&(i[i.length-1]=t.withText(t.text+r.text),o=1);o<e.content.length;o++)i.push(e.content[o]);return new L(i,this.size+e.size)}cut(e,t=this.size){if(e==0&&t==this.size)return this;let r=[],i=0;if(t>e)for(let o=0,a=0;a<t;o++){let u=this.content[o],f=a+u.nodeSize;f>e&&((a<e||f>t)&&(u.isText?u=u.cut(Math.max(0,e-a),Math.min(u.text.length,t-a)):u=u.cut(Math.max(0,e-a-1),Math.min(u.content.size,t-a-1))),r.push(u),i+=u.nodeSize),a=f}return new L(r,i)}cutByIndex(e,t){return e==t?L.empty:e==0&&t==this.content.length?this:new L(this.content.slice(e,t))}replaceChild(e,t){let r=this.content[e];if(r==t)return this;let i=this.content.slice(),o=this.size+t.nodeSize-r.nodeSize;return i[e]=t,new L(i,o)}addToStart(e){return new L([e].concat(this.content),this.size+e.nodeSize)}addToEnd(e){return new L(this.content.concat(e),this.size+e.nodeSize)}eq(e){if(this.content.length!=e.content.length)return!1;for(let t=0;t<this.content.length;t++)if(!this.content[t].eq(e.content[t]))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 t=this.content[e];if(!t)throw new RangeError("Index "+e+" out of range for "+this);return t}maybeChild(e){return this.content[e]||null}forEach(e){for(let t=0,r=0;t<this.content.length;t++){let i=this.content[t];e(i,r,t),r+=i.nodeSize}}findDiffStart(e,t=0){return qp(this,e,t)}findDiffEnd(e,t=this.size,r=e.size){return Jp(this,e,t,r)}findIndex(e,t=-1){if(e==0)return Go(0,e);if(e==this.size)return Go(this.content.length,e);if(e>this.size||e<0)throw new RangeError(`Position ${e} outside of fragment (${this})`);for(let r=0,i=0;;r++){let o=this.child(r),a=i+o.nodeSize;if(a>=e)return a==e||t>0?Go(r+1,a):Go(r,i);i=a}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map(e=>e.toJSON()):null}static fromJSON(e,t){if(!t)return L.empty;if(!Array.isArray(t))throw new RangeError("Invalid input for Fragment.fromJSON");return new L(t.map(e.nodeFromJSON))}static fromArray(e){if(!e.length)return L.empty;let t,r=0;for(let i=0;i<e.length;i++){let o=e[i];r+=o.nodeSize,i&&o.isText&&e[i-1].sameMarkup(o)?(t||(t=e.slice(0,i)),t[t.length-1]=o.withText(t[t.length-1].text+o.text)):t&&t.push(o)}return new L(t||e,r)}static from(e){if(!e)return L.empty;if(e instanceof L)return e;if(Array.isArray(e))return this.fromArray(e);if(e.attrs)return new L([e],e.nodeSize);throw new RangeError("Can not convert "+e+" to a Fragment"+(e.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}}L.empty=new L([],0);const zu={index:0,offset:0};function Go(n,e){return zu.index=n,zu.offset=e,zu}function qo(n,e){if(n===e)return!0;if(!(n&&typeof n=="object")||!(e&&typeof e=="object"))return!1;let t=Array.isArray(n);if(Array.isArray(e)!=t)return!1;if(t){if(n.length!=e.length)return!1;for(let r=0;r<n.length;r++)if(!qo(n[r],e[r]))return!1}else{for(let r in n)if(!(r in e)||!qo(n[r],e[r]))return!1;for(let r in e)if(!(r in n))return!1}return!0}let we=class ff{constructor(e,t){this.type=e,this.attrs=t}addToSet(e){let t,r=!1;for(let i=0;i<e.length;i++){let o=e[i];if(this.eq(o))return e;if(this.type.excludes(o.type))t||(t=e.slice(0,i));else{if(o.type.excludes(this.type))return e;!r&&o.type.rank>this.type.rank&&(t||(t=e.slice(0,i)),t.push(this),r=!0),t&&t.push(o)}}return t||(t=e.slice()),r||t.push(this),t}removeFromSet(e){for(let t=0;t<e.length;t++)if(this.eq(e[t]))return e.slice(0,t).concat(e.slice(t+1));return e}isInSet(e){for(let t=0;t<e.length;t++)if(this.eq(e[t]))return!0;return!1}eq(e){return this==e||this.type==e.type&&qo(this.attrs,e.attrs)}toJSON(){let e={type:this.type.name};for(let t in this.attrs){e.attrs=this.attrs;break}return e}static fromJSON(e,t){if(!t)throw new RangeError("Invalid input for Mark.fromJSON");let r=e.marks[t.type];if(!r)throw new RangeError(`There is no mark type ${t.type} in this schema`);return r.create(t.attrs)}static sameSet(e,t){if(e==t)return!0;if(e.length!=t.length)return!1;for(let r=0;r<e.length;r++)if(!e[r].eq(t[r]))return!1;return!0}static setFrom(e){if(!e||Array.isArray(e)&&e.length==0)return ff.none;if(e instanceof ff)return[e];let t=e.slice();return t.sort((r,i)=>r.type.rank-i.type.rank),t}};we.none=[];class Jo extends Error{}class ${constructor(e,t,r){this.content=e,this.openStart=t,this.openEnd=r}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(e,t){let r=Yp(this.content,e+this.openStart,t);return r&&new $(r,this.openStart,this.openEnd)}removeBetween(e,t){return new $(jp(this.content,e+this.openStart,t+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,t){if(!t)return $.empty;let r=t.openStart||0,i=t.openEnd||0;if(typeof r!="number"||typeof i!="number")throw new RangeError("Invalid input for Slice.fromJSON");return new $(L.fromJSON(e,t.content),r,i)}static maxOpen(e,t=!0){let r=0,i=0;for(let o=e.firstChild;o&&!o.isLeaf&&(t||!o.type.spec.isolating);o=o.firstChild)r++;for(let o=e.lastChild;o&&!o.isLeaf&&(t||!o.type.spec.isolating);o=o.lastChild)i++;return new $(e,r,i)}}$.empty=new $(L.empty,0,0);function jp(n,e,t){let{index:r,offset:i}=n.findIndex(e),o=n.maybeChild(r),{index:a,offset:u}=n.findIndex(t);if(i==e||o.isText){if(u!=t&&!n.child(a).isText)throw new RangeError("Removing non-flat range");return n.cut(0,e).append(n.cut(t))}if(r!=a)throw new RangeError("Removing non-flat range");return n.replaceChild(r,o.copy(jp(o.content,e-i-1,t-i-1)))}function Yp(n,e,t,r){let{index:i,offset:o}=n.findIndex(e),a=n.maybeChild(i);if(o==e||a.isText)return n.cut(0,e).append(t).append(n.cut(e));let u=Yp(a.content,e-o-1,t);return u&&n.replaceChild(i,a.copy(u))}function Yk(n,e,t){if(t.openStart>n.depth)throw new Jo("Inserted content deeper than insertion position");if(n.depth-t.openStart!=e.depth-t.openEnd)throw new Jo("Inconsistent open depths");return Xp(n,e,t,0)}function Xp(n,e,t,r){let i=n.index(r),o=n.node(r);if(i==e.index(r)&&r<n.depth-t.openStart){let a=Xp(n,e,t,r+1);return o.copy(o.content.replaceChild(i,a))}else if(t.content.size)if(!t.openStart&&!t.openEnd&&n.depth==r&&e.depth==r){let a=n.parent,u=a.content;return kr(a,u.cut(0,n.parentOffset).append(t.content).append(u.cut(e.parentOffset)))}else{let{start:a,end:u}=Xk(t,n);return kr(o,Qp(n,a,u,e,r))}else return kr(o,jo(n,e,r))}function Zp(n,e){if(!e.type.compatibleContent(n.type))throw new Jo("Cannot join "+e.type.name+" onto "+n.type.name)}function Hu(n,e,t){let r=n.node(t);return Zp(r,e.node(t)),r}function xr(n,e){let t=e.length-1;t>=0&&n.isText&&n.sameMarkup(e[t])?e[t]=n.withText(e[t].text+n.text):e.push(n)}function hs(n,e,t,r){let i=(e||n).node(t),o=0,a=e?e.index(t):i.childCount;n&&(o=n.index(t),n.depth>t?o++:n.textOffset&&(xr(n.nodeAfter,r),o++));for(let u=o;u<a;u++)xr(i.child(u),r);e&&e.depth==t&&e.textOffset&&xr(e.nodeBefore,r)}function kr(n,e){return n.type.checkContent(e),n.copy(e)}function Qp(n,e,t,r,i){let o=n.depth>i&&Hu(n,e,i+1),a=r.depth>i&&Hu(t,r,i+1),u=[];return hs(null,n,i,u),o&&a&&e.index(i)==t.index(i)?(Zp(o,a),xr(kr(o,Qp(n,e,t,r,i+1)),u)):(o&&xr(kr(o,jo(n,e,i+1)),u),hs(e,t,i,u),a&&xr(kr(a,jo(t,r,i+1)),u)),hs(r,null,i,u),new L(u)}function jo(n,e,t){let r=[];if(hs(null,n,t,r),n.depth>t){let i=Hu(n,e,t+1);xr(kr(i,jo(n,e,t+1)),r)}return hs(e,null,t,r),new L(r)}function Xk(n,e){let t=e.depth-n.openStart,i=e.node(t).copy(n.content);for(let o=t-1;o>=0;o--)i=e.node(o).copy(L.from(i));return{start:i.resolveNoCache(n.openStart+t),end:i.resolveNoCache(i.content.size-n.openEnd-t)}}class Is{constructor(e,t,r){this.pos=e,this.path=t,this.parentOffset=r,this.depth=t.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,t=this.index(this.depth);if(t==e.childCount)return null;let r=this.pos-this.path[this.path.length-1],i=e.child(t);return r?e.child(t).cut(r):i}get nodeBefore(){let e=this.index(this.depth),t=this.pos-this.path[this.path.length-1];return t?this.parent.child(e).cut(0,t):e==0?null:this.parent.child(e-1)}posAtIndex(e,t){t=this.resolveDepth(t);let r=this.path[t*3],i=t==0?0:this.path[t*3-1]+1;for(let o=0;o<e;o++)i+=r.child(o).nodeSize;return i}marks(){let e=this.parent,t=this.index();if(e.content.size==0)return we.none;if(this.textOffset)return e.child(t).marks;let r=e.maybeChild(t-1),i=e.maybeChild(t);if(!r){let u=r;r=i,i=u}let o=r.marks;for(var a=0;a<o.length;a++)o[a].type.spec.inclusive===!1&&(!i||!o[a].isInSet(i.marks))&&(o=o[a--].removeFromSet(o));return o}marksAcross(e){let t=this.parent.maybeChild(this.index());if(!t||!t.isInline)return null;let r=t.marks,i=e.parent.maybeChild(e.index());for(var o=0;o<r.length;o++)r[o].type.spec.inclusive===!1&&(!i||!r[o].isInSet(i.marks))&&(r=r[o--].removeFromSet(r));return r}sharedDepth(e){for(let t=this.depth;t>0;t--)if(this.start(t)<=e&&this.end(t)>=e)return t;return 0}blockRange(e=this,t){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)&&(!t||t(this.node(r))))return new Yo(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 t=1;t<=this.depth;t++)e+=(e?"/":"")+this.node(t).type.name+"_"+this.index(t-1);return e+":"+this.parentOffset}static resolve(e,t){if(!(t>=0&&t<=e.content.size))throw new RangeError("Position "+t+" out of range");let r=[],i=0,o=t;for(let a=e;;){let{index:u,offset:f}=a.content.findIndex(o),h=o-f;if(r.push(a,u,i+f),!h||(a=a.child(u),a.isText))break;o=h-1,i+=f+1}return new Is(t,r,o)}static resolveCached(e,t){for(let i=0;i<$u.length;i++){let o=$u[i];if(o.pos==t&&o.doc==e)return o}let r=$u[Wu]=Is.resolve(e,t);return Wu=(Wu+1)%Zk,r}}let $u=[],Wu=0,Zk=12;class Yo{constructor(e,t,r){this.$from=e,this.$to=t,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 Qk=Object.create(null);let Er=class df{constructor(e,t,r,i=we.none){this.type=e,this.attrs=t,this.marks=i,this.content=r||L.empty}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,t,r,i=0){this.content.nodesBetween(e,t,r,i,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,t,r,i){return this.content.textBetween(e,t,r,i)}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,t,r){return this.type==e&&qo(this.attrs,t||e.defaultAttrs||Qk)&&we.sameSet(this.marks,r||we.none)}copy(e=null){return e==this.content?this:new df(this.type,this.attrs,e,this.marks)}mark(e){return e==this.marks?this:new df(this.type,this.attrs,this.content,e)}cut(e,t=this.content.size){return e==0&&t==this.content.size?this:this.copy(this.content.cut(e,t))}slice(e,t=this.content.size,r=!1){if(e==t)return $.empty;let i=this.resolve(e),o=this.resolve(t),a=r?0:i.sharedDepth(t),u=i.start(a),h=i.node(a).content.cut(i.pos-u,o.pos-u);return new $(h,i.depth-a,o.depth-a)}replace(e,t,r){return Yk(this.resolve(e),this.resolve(t),r)}nodeAt(e){for(let t=this;;){let{index:r,offset:i}=t.content.findIndex(e);if(t=t.maybeChild(r),!t)return null;if(i==e||t.isText)return t;e-=i+1}}childAfter(e){let{index:t,offset:r}=this.content.findIndex(e);return{node:this.content.maybeChild(t),index:t,offset:r}}childBefore(e){if(e==0)return{node:null,index:0,offset:0};let{index:t,offset:r}=this.content.findIndex(e);if(r<e)return{node:this.content.child(t),index:t,offset:r};let i=this.content.child(t-1);return{node:i,index:t-1,offset:r-i.nodeSize}}resolve(e){return Is.resolveCached(this,e)}resolveNoCache(e){return Is.resolve(this,e)}rangeHasMark(e,t,r){let i=!1;return t>e&&this.nodesBetween(e,t,o=>(r.isInSet(o.marks)&&(i=!0),!i)),i}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()+")"),em(this.marks,e)}contentMatchAt(e){let t=this.type.contentMatch.matchFragment(this.content,0,e);if(!t)throw new Error("Called contentMatchAt on a node with invalid content");return t}canReplace(e,t,r=L.empty,i=0,o=r.childCount){let a=this.contentMatchAt(e).matchFragment(r,i,o),u=a&&a.matchFragment(this.content,t);if(!u||!u.validEnd)return!1;for(let f=i;f<o;f++)if(!this.type.allowsMarks(r.child(f).marks))return!1;return!0}canReplaceWith(e,t,r,i){if(i&&!this.type.allowsMarks(i))return!1;let o=this.contentMatchAt(e).matchType(r),a=o&&o.matchFragment(this.content,t);return a?a.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);let e=we.none;for(let t=0;t<this.marks.length;t++)e=this.marks[t].addToSet(e);if(!we.sameSet(e,this.marks))throw new RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map(t=>t.type.name)}`);this.content.forEach(t=>t.check())}toJSON(){let e={type:this.type.name};for(let t 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(t=>t.toJSON())),e}static fromJSON(e,t){if(!t)throw new RangeError("Invalid input for Node.fromJSON");let r=null;if(t.marks){if(!Array.isArray(t.marks))throw new RangeError("Invalid mark data for Node.fromJSON");r=t.marks.map(e.markFromJSON)}if(t.type=="text"){if(typeof t.text!="string")throw new RangeError("Invalid text node in JSON");return e.text(t.text,r)}let i=L.fromJSON(e,t.content);return e.nodeType(t.type).create(t.attrs,i,r)}};Er.prototype.text=void 0;class $l extends Er{constructor(e,t,r,i){if(super(e,t,null,i),!r)throw new RangeError("Empty text nodes are not allowed");this.text=r}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):em(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(e,t){return this.text.slice(e,t)}get nodeSize(){return this.text.length}mark(e){return e==this.marks?this:new $l(this.type,this.attrs,this.text,e)}withText(e){return e==this.text?this:new $l(this.type,this.attrs,e,this.marks)}cut(e=0,t=this.text.length){return e==0&&t==this.text.length?this:this.withText(this.text.slice(e,t))}eq(e){return this.sameMarkup(e)&&this.text==e.text}toJSON(){let e=super.toJSON();return e.text=this.text,e}}function em(n,e){for(let t=n.length-1;t>=0;t--)e=n[t].type.name+"("+e+")";return e}class Br{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(e,t){let r=new eE(e,t);if(r.next==null)return Br.empty;let i=tm(r);r.next&&r.err("Unexpected trailing text");let o=lE(oE(i));return aE(o,r),o}matchType(e){for(let t=0;t<this.next.length;t++)if(this.next[t].type==e)return this.next[t].next;return null}matchFragment(e,t=0,r=e.childCount){let i=this;for(let o=t;i&&o<r;o++)i=i.matchType(e.child(o).type);return i}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:t}=this.next[e];if(!(t.isText||t.hasRequiredAttrs()))return t}return null}compatible(e){for(let t=0;t<this.next.length;t++)for(let r=0;r<e.next.length;r++)if(this.next[t].type==e.next[r].type)return!0;return!1}fillBefore(e,t=!1,r=0){let i=[this];function o(a,u){let f=a.matchFragment(e,r);if(f&&(!t||f.validEnd))return L.from(u.map(h=>h.createAndFill()));for(let h=0;h<a.next.length;h++){let{type:m,next:p}=a.next[h];if(!(m.isText||m.hasRequiredAttrs())&&i.indexOf(p)==-1){i.push(p);let b=o(p,u.concat(m));if(b)return b}}return null}return o(this,[])}findWrapping(e){for(let r=0;r<this.wrapCache.length;r+=2)if(this.wrapCache[r]==e)return this.wrapCache[r+1];let t=this.computeWrapping(e);return this.wrapCache.push(e,t),t}computeWrapping(e){let t=Object.create(null),r=[{match:this,type:null,via:null}];for(;r.length;){let i=r.shift(),o=i.match;if(o.matchType(e)){let a=[];for(let u=i;u.type;u=u.via)a.push(u.type);return a.reverse()}for(let a=0;a<o.next.length;a++){let{type:u,next:f}=o.next[a];!u.isLeaf&&!u.hasRequiredAttrs()&&!(u.name in t)&&(!i.type||f.validEnd)&&(r.push({match:u.contentMatch,type:u,via:i}),t[u.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 t(r){e.push(r);for(let i=0;i<r.next.length;i++)e.indexOf(r.next[i].next)==-1&&t(r.next[i].next)}return t(this),e.map((r,i)=>{let o=i+(r.validEnd?"*":" ")+" ";for(let a=0;a<r.next.length;a++)o+=(a?", ":"")+r.next[a].type.name+"->"+e.indexOf(r.next[a].next);return o}).join(`
8
- `)}}Br.empty=new Br(!0);class eE{constructor(e,t){this.string=e,this.nodeTypes=t,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 tm(n){let e=[];do e.push(tE(n));while(n.eat("|"));return e.length==1?e[0]:{type:"choice",exprs:e}}function tE(n){let e=[];do e.push(nE(n));while(n.next&&n.next!=")"&&n.next!="|");return e.length==1?e[0]:{type:"seq",exprs:e}}function nE(n){let e=sE(n);for(;;)if(n.eat("+"))e={type:"plus",expr:e};else if(n.eat("*"))e={type:"star",expr:e};else if(n.eat("?"))e={type:"opt",expr:e};else if(n.eat("{"))e=rE(n,e);else break;return e}function nm(n){/\D/.test(n.next)&&n.err("Expected number, got '"+n.next+"'");let e=Number(n.next);return n.pos++,e}function rE(n,e){let t=nm(n),r=t;return n.eat(",")&&(n.next!="}"?r=nm(n):r=-1),n.eat("}")||n.err("Unclosed braced range"),{type:"range",min:t,max:r,expr:e}}function iE(n,e){let t=n.nodeTypes,r=t[e];if(r)return[r];let i=[];for(let o in t){let a=t[o];a.groups.indexOf(e)>-1&&i.push(a)}return i.length==0&&n.err("No node type or group '"+e+"' found"),i}function sE(n){if(n.eat("(")){let e=tm(n);return n.eat(")")||n.err("Missing closing paren"),e}else if(/\W/.test(n.next))n.err("Unexpected token '"+n.next+"'");else{let e=iE(n,n.next).map(t=>(n.inline==null?n.inline=t.isInline:n.inline!=t.isInline&&n.err("Mixing inline and block content"),{type:"name",value:t}));return n.pos++,e.length==1?e[0]:{type:"choice",exprs:e}}}function oE(n){let e=[[]];return i(o(n,0),t()),e;function t(){return e.push([])-1}function r(a,u,f){let h={term:f,to:u};return e[a].push(h),h}function i(a,u){a.forEach(f=>f.to=u)}function o(a,u){if(a.type=="choice")return a.exprs.reduce((f,h)=>f.concat(o(h,u)),[]);if(a.type=="seq")for(let f=0;;f++){let h=o(a.exprs[f],u);if(f==a.exprs.length-1)return h;i(h,u=t())}else if(a.type=="star"){let f=t();return r(u,f),i(o(a.expr,f),f),[r(f)]}else if(a.type=="plus"){let f=t();return i(o(a.expr,u),f),i(o(a.expr,f),f),[r(f)]}else{if(a.type=="opt")return[r(u)].concat(o(a.expr,u));if(a.type=="range"){let f=u;for(let h=0;h<a.min;h++){let m=t();i(o(a.expr,f),m),f=m}if(a.max==-1)i(o(a.expr,f),f);else for(let h=a.min;h<a.max;h++){let m=t();r(f,m),i(o(a.expr,f),m),f=m}return[r(f)]}else{if(a.type=="name")return[r(u,void 0,a.value)];throw new Error("Unknown expr type")}}}}function rm(n,e){return e-n}function im(n,e){let t=[];return r(e),t.sort(rm);function r(i){let o=n[i];if(o.length==1&&!o[0].term)return r(o[0].to);t.push(i);for(let a=0;a<o.length;a++){let{term:u,to:f}=o[a];!u&&t.indexOf(f)==-1&&r(f)}}}function lE(n){let e=Object.create(null);return t(im(n,0));function t(r){let i=[];r.forEach(a=>{n[a].forEach(({term:u,to:f})=>{if(!u)return;let h;for(let m=0;m<i.length;m++)i[m][0]==u&&(h=i[m][1]);im(n,f).forEach(m=>{h||i.push([u,h=[]]),h.indexOf(m)==-1&&h.push(m)})})});let o=e[r.join(",")]=new Br(r.indexOf(n.length-1)>-1);for(let a=0;a<i.length;a++){let u=i[a][1].sort(rm);o.next.push({type:i[a][0],next:e[u.join(",")]||t(u)})}return o}}function aE(n,e){for(let t=0,r=[n];t<r.length;t++){let i=r[t],o=!i.validEnd,a=[];for(let u=0;u<i.next.length;u++){let{type:f,next:h}=i.next[u];a.push(f.name),o&&!(f.isText||f.hasRequiredAttrs())&&(o=!1),r.indexOf(h)==-1&&r.push(h)}o&&e.err("Only non-generatable nodes ("+a.join(", ")+") in a required position (see https://prosemirror.net/docs/guide/#generatable)")}}function sm(n){let e=Object.create(null);for(let t in n){let r=n[t];if(!r.hasDefault)return null;e[t]=r.default}return e}function om(n,e){let t=Object.create(null);for(let r in n){let i=e&&e[r];if(i===void 0){let o=n[r];if(o.hasDefault)i=o.default;else throw new RangeError("No value supplied for attribute "+r)}t[r]=i}return t}function lm(n){let e=Object.create(null);if(n)for(let t in n)e[t]=new uE(n[t]);return e}let am=class w0{constructor(e,t,r){this.name=e,this.schema=t,this.spec=r,this.markSet=null,this.groups=r.group?r.group.split(" "):[],this.attrs=lm(r.attrs),this.defaultAttrs=sm(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==Br.empty}get isAtom(){return this.isLeaf||!!this.spec.atom}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:om(this.attrs,e)}create(e=null,t,r){if(this.isText)throw new Error("NodeType.create can't construct text nodes");return new Er(this,this.computeAttrs(e),L.from(t),we.setFrom(r))}createChecked(e=null,t,r){return t=L.from(t),this.checkContent(t),new Er(this,this.computeAttrs(e),t,we.setFrom(r))}createAndFill(e=null,t,r){if(e=this.computeAttrs(e),t=L.from(t),t.size){let a=this.contentMatch.fillBefore(t);if(!a)return null;t=a.append(t)}let i=this.contentMatch.matchFragment(t),o=i&&i.fillBefore(L.empty,!0);return o?new Er(this,e,t.append(o),we.setFrom(r)):null}validContent(e){let t=this.contentMatch.matchFragment(e);if(!t||!t.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)}`)}allowsMarkType(e){return this.markSet==null||this.markSet.indexOf(e)>-1}allowsMarks(e){if(this.markSet==null)return!0;for(let t=0;t<e.length;t++)if(!this.allowsMarkType(e[t].type))return!1;return!0}allowedMarks(e){if(this.markSet==null)return e;let t;for(let r=0;r<e.length;r++)this.allowsMarkType(e[r].type)?t&&t.push(e[r]):t||(t=e.slice(0,r));return t?t.length?t:we.none:e}static compile(e,t){let r=Object.create(null);e.forEach((o,a)=>r[o]=new w0(o,t,a));let i=t.spec.topNode||"doc";if(!r[i])throw new RangeError("Schema is missing its top node type ('"+i+"')");if(!r.text)throw new RangeError("Every schema needs a 'text' type");for(let o in r.text.attrs)throw new RangeError("The text node type should not have attributes");return r}};class uE{constructor(e){this.hasDefault=Object.prototype.hasOwnProperty.call(e,"default"),this.default=e.default}get isRequired(){return!this.hasDefault}}class Wl{constructor(e,t,r,i){this.name=e,this.rank=t,this.schema=r,this.spec=i,this.attrs=lm(i.attrs),this.excluded=null;let o=sm(this.attrs);this.instance=o?new we(this,o):null}create(e=null){return!e&&this.instance?this.instance:new we(this,om(this.attrs,e))}static compile(e,t){let r=Object.create(null),i=0;return e.forEach((o,a)=>r[o]=new Wl(o,i++,t,a)),r}removeFromSet(e){for(var t=0;t<e.length;t++)e[t].type==this&&(e=e.slice(0,t).concat(e.slice(t+1)),t--);return e}isInSet(e){for(let t=0;t<e.length;t++)if(e[t].type==this)return e[t]}excludes(e){return this.excluded.indexOf(e)>-1}}class cE{constructor(e){this.cached=Object.create(null);let t=this.spec={};for(let i in e)t[i]=e[i];t.nodes=Ue.from(e.nodes),t.marks=Ue.from(e.marks||{}),this.nodes=am.compile(this.spec.nodes,this),this.marks=Wl.compile(this.spec.marks,this);let r=Object.create(null);for(let i in this.nodes){if(i in this.marks)throw new RangeError(i+" can not be both a node and a mark");let o=this.nodes[i],a=o.spec.content||"",u=o.spec.marks;o.contentMatch=r[a]||(r[a]=Br.parse(a,this.nodes)),o.inlineContent=o.contentMatch.inlineContent,o.markSet=u=="_"?null:u?um(this,u.split(" ")):u==""||!o.inlineContent?[]:null}for(let i in this.marks){let o=this.marks[i],a=o.spec.excludes;o.excluded=a==null?[o]:a==""?[]:um(this,a.split(" "))}this.nodeFromJSON=this.nodeFromJSON.bind(this),this.markFromJSON=this.markFromJSON.bind(this),this.topNodeType=this.nodes[this.spec.topNode||"doc"],this.cached.wrappings=Object.create(null)}node(e,t=null,r,i){if(typeof e=="string")e=this.nodeType(e);else if(e instanceof am){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(t,r,i)}text(e,t){let r=this.nodes.text;return new $l(r,r.defaultAttrs,e,we.setFrom(t))}mark(e,t){return typeof e=="string"&&(e=this.marks[e]),e.create(t)}nodeFromJSON(e){return Er.fromJSON(this,e)}markFromJSON(e){return we.fromJSON(this,e)}nodeType(e){let t=this.nodes[e];if(!t)throw new RangeError("Unknown node type: "+e);return t}}function um(n,e){let t=[];for(let r=0;r<e.length;r++){let i=e[r],o=n.marks[i],a=o;if(o)t.push(o);else for(let u in n.marks){let f=n.marks[u];(i=="_"||f.spec.group&&f.spec.group.split(" ").indexOf(i)>-1)&&t.push(a=f)}if(!a)throw new SyntaxError("Unknown mark type: '"+e[r]+"'")}return t}let Uu=class hf{constructor(e,t){this.schema=e,this.rules=t,this.tags=[],this.styles=[],t.forEach(r=>{r.tag?this.tags.push(r):r.style&&this.styles.push(r)}),this.normalizeLists=!this.tags.some(r=>{if(!/^(ul|ol)\b/.test(r.tag)||!r.node)return!1;let i=e.nodes[r.node];return i.contentMatch.matchType(i)})}parse(e,t={}){let r=new hm(this,t,!1);return r.addAll(e,t.from,t.to),r.finish()}parseSlice(e,t={}){let r=new hm(this,t,!0);return r.addAll(e,t.from,t.to),$.maxOpen(r.finish())}matchTag(e,t,r){for(let i=r?this.tags.indexOf(r)+1:0;i<this.tags.length;i++){let o=this.tags[i];if(hE(e,o.tag)&&(o.namespace===void 0||e.namespaceURI==o.namespace)&&(!o.context||t.matchesContext(o.context))){if(o.getAttrs){let a=o.getAttrs(e);if(a===!1)continue;o.attrs=a||void 0}return o}}}matchStyle(e,t,r,i){for(let o=i?this.styles.indexOf(i)+1:0;o<this.styles.length;o++){let a=this.styles[o],u=a.style;if(!(u.indexOf(e)!=0||a.context&&!r.matchesContext(a.context)||u.length>e.length&&(u.charCodeAt(e.length)!=61||u.slice(e.length+1)!=t))){if(a.getAttrs){let f=a.getAttrs(t);if(f===!1)continue;a.attrs=f||void 0}return a}}}static schemaRules(e){let t=[];function r(i){let o=i.priority==null?50:i.priority,a=0;for(;a<t.length;a++){let u=t[a];if((u.priority==null?50:u.priority)<o)break}t.splice(a,0,i)}for(let i in e.marks){let o=e.marks[i].spec.parseDOM;o&&o.forEach(a=>{r(a=pm(a)),a.mark||a.ignore||a.clearMark||(a.mark=i)})}for(let i in e.nodes){let o=e.nodes[i].spec.parseDOM;o&&o.forEach(a=>{r(a=pm(a)),a.node||a.ignore||a.mark||(a.node=i)})}return t}static fromSchema(e){return e.cached.domParser||(e.cached.domParser=new hf(e,hf.schemaRules(e)))}};const cm={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},fE={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},fm={ol:!0,ul:!0},Xo=1,Zo=2,ps=4;function dm(n,e,t){return e!=null?(e?Xo:0)|(e==="full"?Zo:0):n&&n.whitespace=="pre"?Xo|Zo:t&~ps}class Qo{constructor(e,t,r,i,o,a,u){this.type=e,this.attrs=t,this.marks=r,this.pendingMarks=i,this.solid=o,this.options=u,this.content=[],this.activeMarks=we.none,this.stashMarks=[],this.match=a||(u&ps?null:e.contentMatch)}findWrapping(e){if(!this.match){if(!this.type)return[];let t=this.type.contentMatch.fillBefore(L.from(e));if(t)this.match=this.type.contentMatch.matchFragment(t);else{let r=this.type.contentMatch,i;return(i=r.findWrapping(e.type))?(this.match=r,i):null}}return this.match.findWrapping(e.type)}finish(e){if(!(this.options&Xo)){let r=this.content[this.content.length-1],i;if(r&&r.isText&&(i=/[ \t\r\n\u000c]+$/.exec(r.text))){let o=r;r.text.length==i[0].length?this.content.pop():this.content[this.content.length-1]=o.withText(o.text.slice(0,o.text.length-i[0].length))}}let t=L.from(this.content);return!e&&this.match&&(t=t.append(this.match.fillBefore(L.empty,!0))),this.type?this.type.create(this.attrs,t,this.marks):t}popFromStashMark(e){for(let t=this.stashMarks.length-1;t>=0;t--)if(e.eq(this.stashMarks[t]))return this.stashMarks.splice(t,1)[0]}applyPending(e){for(let t=0,r=this.pendingMarks;t<r.length;t++){let i=r[t];(this.type?this.type.allowsMarkType(i.type):mE(i.type,e))&&!i.isInSet(this.activeMarks)&&(this.activeMarks=i.addToSet(this.activeMarks),this.pendingMarks=i.removeFromSet(this.pendingMarks))}}inlineContext(e){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:e.parentNode&&!cm.hasOwnProperty(e.parentNode.nodeName.toLowerCase())}}class hm{constructor(e,t,r){this.parser=e,this.options=t,this.isOpen=r,this.open=0;let i=t.topNode,o,a=dm(null,t.preserveWhitespace,0)|(r?ps:0);i?o=new Qo(i.type,i.attrs,we.none,we.none,!0,t.topMatch||i.type.contentMatch,a):r?o=new Qo(null,null,we.none,we.none,!0,null,a):o=new Qo(e.schema.topNodeType,null,we.none,we.none,!0,null,a),this.nodes=[o],this.find=t.findPositions,this.needsBlock=!1}get top(){return this.nodes[this.open]}addDOM(e){if(e.nodeType==3)this.addTextNode(e);else if(e.nodeType==1){let t=e.getAttribute("style");if(!t)this.addElement(e);else{let r=this.readStyles(pE(t));if(!r)return;let[i,o]=r,a=this.top;for(let u=0;u<o.length;u++)this.removePendingMark(o[u],a);for(let u=0;u<i.length;u++)this.addPendingMark(i[u]);this.addElement(e);for(let u=0;u<i.length;u++)this.removePendingMark(i[u],a);for(let u=0;u<o.length;u++)this.addPendingMark(o[u])}}}addTextNode(e){let t=e.nodeValue,r=this.top;if(r.options&Zo||r.inlineContext(e)||/[^ \t\r\n\u000c]/.test(t)){if(r.options&Xo)r.options&Zo?t=t.replace(/\r\n?/g,`
9
- `):t=t.replace(/\r?\n|\r/g," ");else if(t=t.replace(/[ \t\r\n\u000c]+/g," "),/^[ \t\r\n\u000c]/.test(t)&&this.open==this.nodes.length-1){let i=r.content[r.content.length-1],o=e.previousSibling;(!i||o&&o.nodeName=="BR"||i.isText&&/[ \t\r\n\u000c]$/.test(i.text))&&(t=t.slice(1))}t&&this.insertNode(this.parser.schema.text(t)),this.findInText(e)}else this.findInside(e)}addElement(e,t){let r=e.nodeName.toLowerCase(),i;fm.hasOwnProperty(r)&&this.parser.normalizeLists&&dE(e);let o=this.options.ruleFromNode&&this.options.ruleFromNode(e)||(i=this.parser.matchTag(e,this,t));if(o?o.ignore:fE.hasOwnProperty(r))this.findInside(e),this.ignoreFallback(e);else if(!o||o.skip||o.closeParent){o&&o.closeParent?this.open=Math.max(0,this.open-1):o&&o.skip.nodeType&&(e=o.skip);let a,u=this.top,f=this.needsBlock;if(cm.hasOwnProperty(r))u.content.length&&u.content[0].isInline&&this.open&&(this.open--,u=this.top),a=!0,u.type||(this.needsBlock=!0);else if(!e.firstChild){this.leafFallback(e);return}this.addAll(e),a&&this.sync(u),this.needsBlock=f}else this.addElementByRule(e,o,o.consuming===!1?i:void 0)}leafFallback(e){e.nodeName=="BR"&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(e.ownerDocument.createTextNode(`
10
- `))}ignoreFallback(e){e.nodeName=="BR"&&(!this.top.type||!this.top.type.inlineContent)&&this.findPlace(this.parser.schema.text("-"))}readStyles(e){let t=we.none,r=we.none;e:for(let i=0;i<e.length;i+=2)for(let o=void 0;;){let a=this.parser.matchStyle(e[i],e[i+1],this,o);if(!a)continue e;if(a.ignore)return null;if(a.clearMark?this.top.pendingMarks.forEach(u=>{a.clearMark(u)&&(r=u.addToSet(r))}):t=this.parser.schema.marks[a.mark].create(a.attrs).addToSet(t),a.consuming===!1)o=a;else break}return[t,r]}addElementByRule(e,t,r){let i,o,a;t.node?(o=this.parser.schema.nodes[t.node],o.isLeaf?this.insertNode(o.create(t.attrs))||this.leafFallback(e):i=this.enter(o,t.attrs||null,t.preserveWhitespace)):(a=this.parser.schema.marks[t.mark].create(t.attrs),this.addPendingMark(a));let u=this.top;if(o&&o.isLeaf)this.findInside(e);else if(r)this.addElement(e,r);else if(t.getContent)this.findInside(e),t.getContent(e,this.parser.schema).forEach(f=>this.insertNode(f));else{let f=e;typeof t.contentElement=="string"?f=e.querySelector(t.contentElement):typeof t.contentElement=="function"?f=t.contentElement(e):t.contentElement&&(f=t.contentElement),this.findAround(e,f,!0),this.addAll(f)}i&&this.sync(u)&&this.open--,a&&this.removePendingMark(a,u)}addAll(e,t,r){let i=t||0;for(let o=t?e.childNodes[t]:e.firstChild,a=r==null?null:e.childNodes[r];o!=a;o=o.nextSibling,++i)this.findAtPoint(e,i),this.addDOM(o);this.findAtPoint(e,i)}findPlace(e){let t,r;for(let i=this.open;i>=0;i--){let o=this.nodes[i],a=o.findWrapping(e);if(a&&(!t||t.length>a.length)&&(t=a,r=o,!a.length)||o.solid)break}if(!t)return!1;this.sync(r);for(let i=0;i<t.length;i++)this.enterInner(t[i],null,!1);return!0}insertNode(e){if(e.isInline&&this.needsBlock&&!this.top.type){let t=this.textblockFromContext();t&&this.enterInner(t)}if(this.findPlace(e)){this.closeExtra();let t=this.top;t.applyPending(e.type),t.match&&(t.match=t.match.matchType(e.type));let r=t.activeMarks;for(let i=0;i<e.marks.length;i++)(!t.type||t.type.allowsMarkType(e.marks[i].type))&&(r=e.marks[i].addToSet(r));return t.content.push(e.mark(r)),!0}return!1}enter(e,t,r){let i=this.findPlace(e.create(t));return i&&this.enterInner(e,t,!0,r),i}enterInner(e,t=null,r=!1,i){this.closeExtra();let o=this.top;o.applyPending(e),o.match=o.match&&o.match.matchType(e);let a=dm(e,i,o.options);o.options&ps&&o.content.length==0&&(a|=ps),this.nodes.push(new Qo(e,t,o.activeMarks,o.pendingMarks,r,null,a)),this.open++}closeExtra(e=!1){let t=this.nodes.length-1;if(t>this.open){for(;t>this.open;t--)this.nodes[t-1].content.push(this.nodes[t].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 t=this.open;t>=0;t--)if(this.nodes[t]==e)return this.open=t,!0;return!1}get currentPos(){this.closeExtra();let e=0;for(let t=this.open;t>=0;t--){let r=this.nodes[t].content;for(let i=r.length-1;i>=0;i--)e+=r[i].nodeSize;t&&e++}return e}findAtPoint(e,t){if(this.find)for(let r=0;r<this.find.length;r++)this.find[r].node==e&&this.find[r].offset==t&&(this.find[r].pos=this.currentPos)}findInside(e){if(this.find)for(let t=0;t<this.find.length;t++)this.find[t].pos==null&&e.nodeType==1&&e.contains(this.find[t].node)&&(this.find[t].pos=this.currentPos)}findAround(e,t,r){if(e!=t&&this.find)for(let i=0;i<this.find.length;i++)this.find[i].pos==null&&e.nodeType==1&&e.contains(this.find[i].node)&&t.compareDocumentPosition(this.find[i].node)&(r?2:4)&&(this.find[i].pos=this.currentPos)}findInText(e){if(this.find)for(let t=0;t<this.find.length;t++)this.find[t].node==e&&(this.find[t].pos=this.currentPos-(e.nodeValue.length-this.find[t].offset))}matchesContext(e){if(e.indexOf("|")>-1)return e.split(/\s*\|\s*/).some(this.matchesContext,this);let t=e.split("/"),r=this.options.context,i=!this.isOpen&&(!r||r.parent.type==this.nodes[0].type),o=-(r?r.depth+1:0)+(i?0:1),a=(u,f)=>{for(;u>=0;u--){let h=t[u];if(h==""){if(u==t.length-1||u==0)continue;for(;f>=o;f--)if(a(u-1,f))return!0;return!1}else{let m=f>0||f==0&&i?this.nodes[f].type:r&&f>=o?r.node(f-o).type:null;if(!m||m.name!=h&&m.groups.indexOf(h)==-1)return!1;f--}}return!0};return a(t.length-1,this.open)}textblockFromContext(){let e=this.options.context;if(e)for(let t=e.depth;t>=0;t--){let r=e.node(t).contentMatchAt(e.indexAfter(t)).defaultType;if(r&&r.isTextblock&&r.defaultAttrs)return r}for(let t in this.parser.schema.nodes){let r=this.parser.schema.nodes[t];if(r.isTextblock&&r.defaultAttrs)return r}}addPendingMark(e){let t=gE(e,this.top.pendingMarks);t&&this.top.stashMarks.push(t),this.top.pendingMarks=e.addToSet(this.top.pendingMarks)}removePendingMark(e,t){for(let r=this.open;r>=0;r--){let i=this.nodes[r];if(i.pendingMarks.lastIndexOf(e)>-1)i.pendingMarks=e.removeFromSet(i.pendingMarks);else{i.activeMarks=e.removeFromSet(i.activeMarks);let a=i.popFromStashMark(e);a&&i.type&&i.type.allowsMarkType(a.type)&&(i.activeMarks=a.addToSet(i.activeMarks))}if(i==t)break}}}function dE(n){for(let e=n.firstChild,t=null;e;e=e.nextSibling){let r=e.nodeType==1?e.nodeName.toLowerCase():null;r&&fm.hasOwnProperty(r)&&t?(t.appendChild(e),e=t):r=="li"?t=e:r&&(t=null)}}function hE(n,e){return(n.matches||n.msMatchesSelector||n.webkitMatchesSelector||n.mozMatchesSelector).call(n,e)}function pE(n){let e=/\s*([\w-]+)\s*:\s*([^;]+)/g,t,r=[];for(;t=e.exec(n);)r.push(t[1],t[2].trim());return r}function pm(n){let e={};for(let t in n)e[t]=n[t];return e}function mE(n,e){let t=e.schema.nodes;for(let r in t){let i=t[r];if(!i.allowsMarkType(n))continue;let o=[],a=u=>{o.push(u);for(let f=0;f<u.edgeCount;f++){let{type:h,next:m}=u.edge(f);if(h==e||o.indexOf(m)<0&&a(m))return!0}};if(a(i.contentMatch))return!0}}function gE(n,e){for(let t=0;t<e.length;t++)if(n.eq(e[t]))return e[t]}class Hr{constructor(e,t){this.nodes=e,this.marks=t}serializeFragment(e,t={},r){r||(r=Vu(t).createDocumentFragment());let i=r,o=[];return e.forEach(a=>{if(o.length||a.marks.length){let u=0,f=0;for(;u<o.length&&f<a.marks.length;){let h=a.marks[f];if(!this.marks[h.type.name]){f++;continue}if(!h.eq(o[u][0])||h.type.spec.spanning===!1)break;u++,f++}for(;u<o.length;)i=o.pop()[1];for(;f<a.marks.length;){let h=a.marks[f++],m=this.serializeMark(h,a.isInline,t);m&&(o.push([h,i]),i.appendChild(m.dom),i=m.contentDOM||m.dom)}}i.appendChild(this.serializeNodeInner(a,t))}),r}serializeNodeInner(e,t){let{dom:r,contentDOM:i}=Hr.renderSpec(Vu(t),this.nodes[e.type.name](e));if(i){if(e.isLeaf)throw new RangeError("Content hole not allowed in a leaf node spec");this.serializeFragment(e.content,t,i)}return r}serializeNode(e,t={}){let r=this.serializeNodeInner(e,t);for(let i=e.marks.length-1;i>=0;i--){let o=this.serializeMark(e.marks[i],e.isInline,t);o&&((o.contentDOM||o.dom).appendChild(r),r=o.dom)}return r}serializeMark(e,t,r={}){let i=this.marks[e.type.name];return i&&Hr.renderSpec(Vu(r),i(e,t))}static renderSpec(e,t,r=null){if(typeof t=="string")return{dom:e.createTextNode(t)};if(t.nodeType!=null)return{dom:t};if(t.dom&&t.dom.nodeType!=null)return t;let i=t[0],o=i.indexOf(" ");o>0&&(r=i.slice(0,o),i=i.slice(o+1));let a,u=r?e.createElementNS(r,i):e.createElement(i),f=t[1],h=1;if(f&&typeof f=="object"&&f.nodeType==null&&!Array.isArray(f)){h=2;for(let m in f)if(f[m]!=null){let p=m.indexOf(" ");p>0?u.setAttributeNS(m.slice(0,p),m.slice(p+1),f[m]):u.setAttribute(m,f[m])}}for(let m=h;m<t.length;m++){let p=t[m];if(p===0){if(m<t.length-1||m>h)throw new RangeError("Content hole must be the only child of its parent node");return{dom:u,contentDOM:u}}else{let{dom:b,contentDOM:S}=Hr.renderSpec(e,p,r);if(u.appendChild(b),S){if(a)throw new RangeError("Multiple content holes");a=S}}}return{dom:u,contentDOM:a}}static fromSchema(e){return e.cached.domSerializer||(e.cached.domSerializer=new Hr(this.nodesFromSchema(e),this.marksFromSchema(e)))}static nodesFromSchema(e){let t=mm(e.nodes);return t.text||(t.text=r=>r.text),t}static marksFromSchema(e){return mm(e.marks)}}function mm(n){let e={};for(let t in n){let r=n[t].spec.toDOM;r&&(e[t]=r)}return e}function Vu(n){return n.document||window.document}const gm=65535,ym=Math.pow(2,16);function yE(n,e){return n+e*ym}function bm(n){return n&gm}function bE(n){return(n-(n&gm))/ym}const vm=1,Sm=2,el=4,wm=8;class Ku{constructor(e,t,r){this.pos=e,this.delInfo=t,this.recover=r}get deleted(){return(this.delInfo&wm)>0}get deletedBefore(){return(this.delInfo&(vm|el))>0}get deletedAfter(){return(this.delInfo&(Sm|el))>0}get deletedAcross(){return(this.delInfo&el)>0}}class Pt{constructor(e,t=!1){if(this.ranges=e,this.inverted=t,!e.length&&Pt.empty)return Pt.empty}recover(e){let t=0,r=bm(e);if(!this.inverted)for(let i=0;i<r;i++)t+=this.ranges[i*3+2]-this.ranges[i*3+1];return this.ranges[r*3]+t+bE(e)}mapResult(e,t=1){return this._map(e,t,!1)}map(e,t=1){return this._map(e,t,!0)}_map(e,t,r){let i=0,o=this.inverted?2:1,a=this.inverted?1:2;for(let u=0;u<this.ranges.length;u+=3){let f=this.ranges[u]-(this.inverted?i:0);if(f>e)break;let h=this.ranges[u+o],m=this.ranges[u+a],p=f+h;if(e<=p){let b=h?e==f?-1:e==p?1:t:t,S=f+i+(b<0?0:m);if(r)return S;let x=e==(t<0?f:p)?null:yE(u/3,e-f),C=e==f?Sm:e==p?vm:el;return(t<0?e!=f:e!=p)&&(C|=wm),new Ku(S,C,x)}i+=m-h}return r?e+i:new Ku(e+i,0,null)}touches(e,t){let r=0,i=bm(t),o=this.inverted?2:1,a=this.inverted?1:2;for(let u=0;u<this.ranges.length;u+=3){let f=this.ranges[u]-(this.inverted?r:0);if(f>e)break;let h=this.ranges[u+o],m=f+h;if(e<=m&&u==i*3)return!0;r+=this.ranges[u+a]-h}return!1}forEach(e){let t=this.inverted?2:1,r=this.inverted?1:2;for(let i=0,o=0;i<this.ranges.length;i+=3){let a=this.ranges[i],u=a-(this.inverted?o:0),f=a+(this.inverted?0:o),h=this.ranges[i+t],m=this.ranges[i+r];e(u,u+h,f,f+m),o+=m-h}}invert(){return new Pt(this.ranges,!this.inverted)}toString(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)}static offset(e){return e==0?Pt.empty:new Pt(e<0?[0,-e,0]:[0,0,e])}}Pt.empty=new Pt([]);class Ni{constructor(e=[],t,r=0,i=e.length){this.maps=e,this.mirror=t,this.from=r,this.to=i}slice(e=0,t=this.maps.length){return new Ni(this.maps,this.mirror,e,t)}copy(){return new Ni(this.maps.slice(),this.mirror&&this.mirror.slice(),this.from,this.to)}appendMap(e,t){this.to=this.maps.push(e),t!=null&&this.setMirror(this.maps.length-1,t)}appendMapping(e){for(let t=0,r=this.maps.length;t<e.maps.length;t++){let i=e.getMirror(t);this.appendMap(e.maps[t],i!=null&&i<t?r+i:void 0)}}getMirror(e){if(this.mirror){for(let t=0;t<this.mirror.length;t++)if(this.mirror[t]==e)return this.mirror[t+(t%2?-1:1)]}}setMirror(e,t){this.mirror||(this.mirror=[]),this.mirror.push(e,t)}appendMappingInverted(e){for(let t=e.maps.length-1,r=this.maps.length+e.maps.length;t>=0;t--){let i=e.getMirror(t);this.appendMap(e.maps[t].invert(),i!=null&&i>t?r-i-1:void 0)}}invert(){let e=new Ni;return e.appendMappingInverted(this),e}map(e,t=1){if(this.mirror)return this._map(e,t,!0);for(let r=this.from;r<this.to;r++)e=this.maps[r].map(e,t);return e}mapResult(e,t=1){return this._map(e,t,!1)}_map(e,t,r){let i=0;for(let o=this.from;o<this.to;o++){let a=this.maps[o],u=a.mapResult(e,t);if(u.recover!=null){let f=this.getMirror(o);if(f!=null&&f>o&&f<this.to){o=f,e=this.maps[f].recover(u.recover);continue}}i|=u.delInfo,e=u.pos}return r?e:new Ku(e,i,null)}}const Gu=Object.create(null);class Ye{getMap(){return Pt.empty}merge(e){return null}static fromJSON(e,t){if(!t||!t.stepType)throw new RangeError("Invalid input for Step.fromJSON");let r=Gu[t.stepType];if(!r)throw new RangeError(`No step type ${t.stepType} defined`);return r.fromJSON(e,t)}static jsonID(e,t){if(e in Gu)throw new RangeError("Duplicate use of step JSON ID "+e);return Gu[e]=t,t.prototype.jsonID=e,t}}class Re{constructor(e,t){this.doc=e,this.failed=t}static ok(e){return new Re(e,null)}static fail(e){return new Re(null,e)}static fromReplace(e,t,r,i){try{return Re.ok(e.replace(t,r,i))}catch(o){if(o instanceof Jo)return Re.fail(o.message);throw o}}}function qu(n,e,t){let r=[];for(let i=0;i<n.childCount;i++){let o=n.child(i);o.content.size&&(o=o.copy(qu(o.content,e,o))),o.isInline&&(o=e(o,t,i)),r.push(o)}return L.fromArray(r)}class rr extends Ye{constructor(e,t,r){super(),this.from=e,this.to=t,this.mark=r}apply(e){let t=e.slice(this.from,this.to),r=e.resolve(this.from),i=r.node(r.sharedDepth(this.to)),o=new $(qu(t.content,(a,u)=>!a.isAtom||!u.type.allowsMarkType(this.mark.type)?a:a.mark(this.mark.addToSet(a.marks)),i),t.openStart,t.openEnd);return Re.fromReplace(e,this.from,this.to,o)}invert(){return new cn(this.from,this.to,this.mark)}map(e){let t=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return t.deleted&&r.deleted||t.pos>=r.pos?null:new rr(t.pos,r.pos,this.mark)}merge(e){return e instanceof rr&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new rr(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,t){if(typeof t.from!="number"||typeof t.to!="number")throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new rr(t.from,t.to,e.markFromJSON(t.mark))}}Ye.jsonID("addMark",rr);class cn extends Ye{constructor(e,t,r){super(),this.from=e,this.to=t,this.mark=r}apply(e){let t=e.slice(this.from,this.to),r=new $(qu(t.content,i=>i.mark(this.mark.removeFromSet(i.marks)),e),t.openStart,t.openEnd);return Re.fromReplace(e,this.from,this.to,r)}invert(){return new rr(this.from,this.to,this.mark)}map(e){let t=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return t.deleted&&r.deleted||t.pos>=r.pos?null:new cn(t.pos,r.pos,this.mark)}merge(e){return e instanceof cn&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new cn(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,t){if(typeof t.from!="number"||typeof t.to!="number")throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new cn(t.from,t.to,e.markFromJSON(t.mark))}}Ye.jsonID("removeMark",cn);class ir extends Ye{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return Re.fail("No node at mark step's position");let r=t.type.create(t.attrs,null,this.mark.addToSet(t.marks));return Re.fromReplace(e,this.pos,this.pos+1,new $(L.from(r),0,t.isLeaf?0:1))}invert(e){let t=e.nodeAt(this.pos);if(t){let r=this.mark.addToSet(t.marks);if(r.length==t.marks.length){for(let i=0;i<t.marks.length;i++)if(!t.marks[i].isInSet(r))return new ir(this.pos,t.marks[i]);return new ir(this.pos,this.mark)}}return new Ri(this.pos,this.mark)}map(e){let t=e.mapResult(this.pos,1);return t.deletedAfter?null:new ir(t.pos,this.mark)}toJSON(){return{stepType:"addNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,t){if(typeof t.pos!="number")throw new RangeError("Invalid input for AddNodeMarkStep.fromJSON");return new ir(t.pos,e.markFromJSON(t.mark))}}Ye.jsonID("addNodeMark",ir);class Ri extends Ye{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return Re.fail("No node at mark step's position");let r=t.type.create(t.attrs,null,this.mark.removeFromSet(t.marks));return Re.fromReplace(e,this.pos,this.pos+1,new $(L.from(r),0,t.isLeaf?0:1))}invert(e){let t=e.nodeAt(this.pos);return!t||!this.mark.isInSet(t.marks)?this:new ir(this.pos,this.mark)}map(e){let t=e.mapResult(this.pos,1);return t.deletedAfter?null:new Ri(t.pos,this.mark)}toJSON(){return{stepType:"removeNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,t){if(typeof t.pos!="number")throw new RangeError("Invalid input for RemoveNodeMarkStep.fromJSON");return new Ri(t.pos,e.markFromJSON(t.mark))}}Ye.jsonID("removeNodeMark",Ri);class Xe extends Ye{constructor(e,t,r,i=!1){super(),this.from=e,this.to=t,this.slice=r,this.structure=i}apply(e){return this.structure&&Ju(e,this.from,this.to)?Re.fail("Structure replace would overwrite content"):Re.fromReplace(e,this.from,this.to,this.slice)}getMap(){return new Pt([this.from,this.to-this.from,this.slice.size])}invert(e){return new Xe(this.from,this.from+this.slice.size,e.slice(this.from,this.to))}map(e){let t=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return t.deletedAcross&&r.deletedAcross?null:new Xe(t.pos,Math.max(t.pos,r.pos),this.slice)}merge(e){if(!(e instanceof Xe)||e.structure||this.structure)return null;if(this.from+this.slice.size==e.from&&!this.slice.openEnd&&!e.slice.openStart){let t=this.slice.size+e.slice.size==0?$.empty:new $(this.slice.content.append(e.slice.content),this.slice.openStart,e.slice.openEnd);return new Xe(this.from,this.to+(e.to-e.from),t,this.structure)}else if(e.to==this.from&&!this.slice.openStart&&!e.slice.openEnd){let t=this.slice.size+e.slice.size==0?$.empty:new $(e.slice.content.append(this.slice.content),e.slice.openStart,this.slice.openEnd);return new Xe(e.from,this.to,t,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,t){if(typeof t.from!="number"||typeof t.to!="number")throw new RangeError("Invalid input for ReplaceStep.fromJSON");return new Xe(t.from,t.to,$.fromJSON(e,t.slice),!!t.structure)}}Ye.jsonID("replace",Xe);class ze extends Ye{constructor(e,t,r,i,o,a,u=!1){super(),this.from=e,this.to=t,this.gapFrom=r,this.gapTo=i,this.slice=o,this.insert=a,this.structure=u}apply(e){if(this.structure&&(Ju(e,this.from,this.gapFrom)||Ju(e,this.gapTo,this.to)))return Re.fail("Structure gap-replace would overwrite content");let t=e.slice(this.gapFrom,this.gapTo);if(t.openStart||t.openEnd)return Re.fail("Gap is not a flat range");let r=this.slice.insertAt(this.insert,t.content);return r?Re.fromReplace(e,this.from,this.to,r):Re.fail("Content does not fit in gap")}getMap(){return new Pt([this.from,this.gapFrom-this.from,this.insert,this.gapTo,this.to-this.gapTo,this.slice.size-this.insert])}invert(e){let t=this.gapTo-this.gapFrom;return new ze(this.from,this.from+this.slice.size+t,this.from+this.insert,this.from+this.insert+t,e.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure)}map(e){let t=e.mapResult(this.from,1),r=e.mapResult(this.to,-1),i=e.map(this.gapFrom,-1),o=e.map(this.gapTo,1);return t.deletedAcross&&r.deletedAcross||i<t.pos||o>r.pos?null:new ze(t.pos,r.pos,i,o,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,t){if(typeof t.from!="number"||typeof t.to!="number"||typeof t.gapFrom!="number"||typeof t.gapTo!="number"||typeof t.insert!="number")throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new ze(t.from,t.to,t.gapFrom,t.gapTo,$.fromJSON(e,t.slice),t.insert,!!t.structure)}}Ye.jsonID("replaceAround",ze);function Ju(n,e,t){let r=n.resolve(e),i=t-e,o=r.depth;for(;i>0&&o>0&&r.indexAfter(o)==r.node(o).childCount;)o--,i--;if(i>0){let a=r.node(o).maybeChild(r.indexAfter(o));for(;i>0;){if(!a||a.isLeaf)return!0;a=a.firstChild,i--}}return!1}function vE(n,e,t,r){let i=[],o=[],a,u;n.doc.nodesBetween(e,t,(f,h,m)=>{if(!f.isInline)return;let p=f.marks;if(!r.isInSet(p)&&m.type.allowsMarkType(r.type)){let b=Math.max(h,e),S=Math.min(h+f.nodeSize,t),x=r.addToSet(p);for(let C=0;C<p.length;C++)p[C].isInSet(x)||(a&&a.to==b&&a.mark.eq(p[C])?a.to=S:i.push(a=new cn(b,S,p[C])));u&&u.to==b?u.to=S:o.push(u=new rr(b,S,r))}}),i.forEach(f=>n.step(f)),o.forEach(f=>n.step(f))}function SE(n,e,t,r){let i=[],o=0;n.doc.nodesBetween(e,t,(a,u)=>{if(!a.isInline)return;o++;let f=null;if(r instanceof Wl){let h=a.marks,m;for(;m=r.isInSet(h);)(f||(f=[])).push(m),h=m.removeFromSet(h)}else r?r.isInSet(a.marks)&&(f=[r]):f=a.marks;if(f&&f.length){let h=Math.min(u+a.nodeSize,t);for(let m=0;m<f.length;m++){let p=f[m],b;for(let S=0;S<i.length;S++){let x=i[S];x.step==o-1&&p.eq(i[S].style)&&(b=x)}b?(b.to=h,b.step=o):i.push({style:p,from:Math.max(u,e),to:h,step:o})}}}),i.forEach(a=>n.step(new cn(a.from,a.to,a.style)))}function wE(n,e,t,r=t.contentMatch){let i=n.doc.nodeAt(e),o=[],a=e+1;for(let u=0;u<i.childCount;u++){let f=i.child(u),h=a+f.nodeSize,m=r.matchType(f.type);if(!m)o.push(new Xe(a,h,$.empty));else{r=m;for(let p=0;p<f.marks.length;p++)t.allowsMarkType(f.marks[p].type)||n.step(new cn(a,h,f.marks[p]))}a=h}if(!r.validEnd){let u=r.fillBefore(L.empty,!0);n.replace(a,a,new $(u,0,0))}for(let u=o.length-1;u>=0;u--)n.step(o[u])}function _E(n,e,t){return(e==0||n.canReplace(e,n.childCount))&&(t==n.childCount||n.canReplace(0,t))}function hi(n){let t=n.parent.content.cutByIndex(n.startIndex,n.endIndex);for(let r=n.depth;;--r){let i=n.$from.node(r),o=n.$from.index(r),a=n.$to.indexAfter(r);if(r<n.depth&&i.canReplace(o,a,t))return r;if(r==0||i.type.spec.isolating||!_E(i,o,a))break}return null}function xE(n,e,t){let{$from:r,$to:i,depth:o}=e,a=r.before(o+1),u=i.after(o+1),f=a,h=u,m=L.empty,p=0;for(let x=o,C=!1;x>t;x--)C||r.index(x)>0?(C=!0,m=L.from(r.node(x).copy(m)),p++):f--;let b=L.empty,S=0;for(let x=o,C=!1;x>t;x--)C||i.after(x+1)<i.end(x)?(C=!0,b=L.from(i.node(x).copy(b)),S++):h++;n.step(new ze(f,h,a,u,new $(m.append(b),p,S),m.size-p,!0))}function ju(n,e,t=null,r=n){let i=kE(n,e),o=i&&EE(r,e);return o?i.map(_m).concat({type:e,attrs:t}).concat(o.map(_m)):null}function _m(n){return{type:n,attrs:null}}function kE(n,e){let{parent:t,startIndex:r,endIndex:i}=n,o=t.contentMatchAt(r).findWrapping(e);if(!o)return null;let a=o.length?o[0]:e;return t.canReplaceWith(r,i,a)?o:null}function EE(n,e){let{parent:t,startIndex:r,endIndex:i}=n,o=t.child(r),a=e.contentMatch.findWrapping(o.type);if(!a)return null;let f=(a.length?a[a.length-1]:e).contentMatch;for(let h=r;f&&h<i;h++)f=f.matchType(t.child(h).type);return!f||!f.validEnd?null:a}function TE(n,e,t){let r=L.empty;for(let a=t.length-1;a>=0;a--){if(r.size){let u=t[a].type.contentMatch.matchFragment(r);if(!u||!u.validEnd)throw new RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}r=L.from(t[a].type.create(t[a].attrs,r))}let i=e.start,o=e.end;n.step(new ze(i,o,i,o,new $(r,0,0),t.length,!0))}function CE(n,e,t,r,i){if(!r.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");let o=n.steps.length;n.doc.nodesBetween(e,t,(a,u)=>{if(a.isTextblock&&!a.hasMarkup(r,i)&&AE(n.doc,n.mapping.slice(o).map(u),r)){n.clearIncompatible(n.mapping.slice(o).map(u,1),r);let f=n.mapping.slice(o),h=f.map(u,1),m=f.map(u+a.nodeSize,1);return n.step(new ze(h,m,h+1,m-1,new $(L.from(r.create(i,null,a.marks)),0,0),1,!0)),!1}})}function AE(n,e,t){let r=n.resolve(e),i=r.index();return r.parent.canReplaceWith(i,i+1,t)}function ME(n,e,t,r,i){let o=n.doc.nodeAt(e);if(!o)throw new RangeError("No node at given position");t||(t=o.type);let a=t.create(r,null,i||o.marks);if(o.isLeaf)return n.replaceWith(e,e+o.nodeSize,a);if(!t.validContent(o.content))throw new RangeError("Invalid content for node type "+t.name);n.step(new ze(e,e+o.nodeSize,e+1,e+o.nodeSize-1,new $(L.from(a),0,0),1,!0))}function pi(n,e,t=1,r){let i=n.resolve(e),o=i.depth-t,a=r&&r[r.length-1]||i.parent;if(o<0||i.parent.type.spec.isolating||!i.parent.canReplace(i.index(),i.parent.childCount)||!a.type.validContent(i.parent.content.cutByIndex(i.index(),i.parent.childCount)))return!1;for(let h=i.depth-1,m=t-2;h>o;h--,m--){let p=i.node(h),b=i.index(h);if(p.type.spec.isolating)return!1;let S=p.content.cutByIndex(b,p.childCount),x=r&&r[m]||p;if(x!=p&&(S=S.replaceChild(0,x.type.create(x.attrs))),!p.canReplace(b+1,p.childCount)||!x.type.validContent(S))return!1}let u=i.indexAfter(o),f=r&&r[0];return i.node(o).canReplaceWith(u,u,f?f.type:i.node(o+1).type)}function OE(n,e,t=1,r){let i=n.doc.resolve(e),o=L.empty,a=L.empty;for(let u=i.depth,f=i.depth-t,h=t-1;u>f;u--,h--){o=L.from(i.node(u).copy(o));let m=r&&r[h];a=L.from(m?m.type.create(m.attrs,a):i.node(u).copy(a))}n.step(new Xe(e,e,new $(o.append(a),t,t),!0))}function Vn(n,e){let t=n.resolve(e),r=t.index();return xm(t.nodeBefore,t.nodeAfter)&&t.parent.canReplace(r,r+1)}function xm(n,e){return!!(n&&e&&!n.isLeaf&&n.canAppend(e))}function tl(n,e,t=-1){let r=n.resolve(e);for(let i=r.depth;;i--){let o,a,u=r.index(i);if(i==r.depth?(o=r.nodeBefore,a=r.nodeAfter):t>0?(o=r.node(i+1),u++,a=r.node(i).maybeChild(u)):(o=r.node(i).maybeChild(u-1),a=r.node(i+1)),o&&!o.isTextblock&&xm(o,a)&&r.node(i).canReplace(u,u+1))return e;if(i==0)break;e=t<0?r.before(i):r.after(i)}}function IE(n,e,t){let r=new Xe(e-t,e+t,$.empty,!0);n.step(r)}function NE(n,e,t){let r=n.resolve(e);if(r.parent.canReplaceWith(r.index(),r.index(),t))return e;if(r.parentOffset==0)for(let i=r.depth-1;i>=0;i--){let o=r.index(i);if(r.node(i).canReplaceWith(o,o,t))return r.before(i+1);if(o>0)return null}if(r.parentOffset==r.parent.content.size)for(let i=r.depth-1;i>=0;i--){let o=r.indexAfter(i);if(r.node(i).canReplaceWith(o,o,t))return r.after(i+1);if(o<r.node(i).childCount)return null}return null}function RE(n,e,t){let r=n.resolve(e);if(!t.content.size)return e;let i=t.content;for(let o=0;o<t.openStart;o++)i=i.firstChild.content;for(let o=1;o<=(t.openStart==0&&t.size?2:1);o++)for(let a=r.depth;a>=0;a--){let u=a==r.depth?0:r.pos<=(r.start(a+1)+r.end(a+1))/2?-1:1,f=r.index(a)+(u>0?1:0),h=r.node(a),m=!1;if(o==1)m=h.canReplace(f,f,i);else{let p=h.contentMatchAt(f).findWrapping(i.firstChild.type);m=p&&h.canReplaceWith(f,f,p[0])}if(m)return u==0?r.pos:u<0?r.before(a+1):r.after(a+1)}return null}function Yu(n,e,t=e,r=$.empty){if(e==t&&!r.size)return null;let i=n.resolve(e),o=n.resolve(t);return km(i,o,r)?new Xe(e,t,r):new LE(i,o,r).fit()}function km(n,e,t){return!t.openStart&&!t.openEnd&&n.start()==e.start()&&n.parent.canReplace(n.index(),e.index(),t.content)}class LE{constructor(e,t,r){this.$from=e,this.$to=t,this.unplaced=r,this.frontier=[],this.placed=L.empty;for(let i=0;i<=e.depth;i++){let o=e.node(i);this.frontier.push({type:o.type,match:o.contentMatchAt(e.indexAfter(i))})}for(let i=e.depth;i>0;i--)this.placed=L.from(e.node(i).copy(this.placed))}get depth(){return this.frontier.length-1}fit(){for(;this.unplaced.size;){let h=this.findFittable();h?this.placeNodes(h):this.openMore()||this.dropNode()}let e=this.mustMoveInline(),t=this.placed.size-this.depth-this.$from.depth,r=this.$from,i=this.close(e<0?this.$to:r.doc.resolve(e));if(!i)return null;let o=this.placed,a=r.depth,u=i.depth;for(;a&&u&&o.childCount==1;)o=o.firstChild.content,a--,u--;let f=new $(o,a,u);return e>-1?new ze(r.pos,e,this.$to.pos,this.$to.end(),f,t):f.size||r.pos!=this.$to.pos?new Xe(r.pos,i.pos,f):null}findFittable(){for(let e=1;e<=2;e++)for(let t=this.unplaced.openStart;t>=0;t--){let r,i=null;t?(i=Xu(this.unplaced.content,t-1).firstChild,r=i.content):r=this.unplaced.content;let o=r.firstChild;for(let a=this.depth;a>=0;a--){let{type:u,match:f}=this.frontier[a],h,m=null;if(e==1&&(o?f.matchType(o.type)||(m=f.fillBefore(L.from(o),!1)):i&&u.compatibleContent(i.type)))return{sliceDepth:t,frontierDepth:a,parent:i,inject:m};if(e==2&&o&&(h=f.findWrapping(o.type)))return{sliceDepth:t,frontierDepth:a,parent:i,wrap:h};if(i&&f.matchType(i.type))break}}}openMore(){let{content:e,openStart:t,openEnd:r}=this.unplaced,i=Xu(e,t);return!i.childCount||i.firstChild.isLeaf?!1:(this.unplaced=new $(e,t+1,Math.max(r,i.size+t>=e.size-r?t+1:0)),!0)}dropNode(){let{content:e,openStart:t,openEnd:r}=this.unplaced,i=Xu(e,t);if(i.childCount<=1&&t>0){let o=e.size-t<=t+i.size;this.unplaced=new $(ms(e,t-1,1),t-1,o?t-1:r)}else this.unplaced=new $(ms(e,t,1),t,r)}placeNodes({sliceDepth:e,frontierDepth:t,parent:r,inject:i,wrap:o}){for(;this.depth>t;)this.closeFrontierNode();if(o)for(let C=0;C<o.length;C++)this.openFrontierNode(o[C]);let a=this.unplaced,u=r?r.content:a.content,f=a.openStart-e,h=0,m=[],{match:p,type:b}=this.frontier[t];if(i){for(let C=0;C<i.childCount;C++)m.push(i.child(C));p=p.matchFragment(i)}let S=u.size+e-(a.content.size-a.openEnd);for(;h<u.childCount;){let C=u.child(h),A=p.matchType(C.type);if(!A)break;h++,(h>1||f==0||C.content.size)&&(p=A,m.push(Em(C.mark(b.allowedMarks(C.marks)),h==1?f:0,h==u.childCount?S:-1)))}let x=h==u.childCount;x||(S=-1),this.placed=gs(this.placed,t,L.from(m)),this.frontier[t].match=p,x&&S<0&&r&&r.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let C=0,A=u;C<S;C++){let N=A.lastChild;this.frontier.push({type:N.type,match:N.contentMatchAt(N.childCount)}),A=N.content}this.unplaced=x?e==0?$.empty:new $(ms(a.content,e-1,1),e-1,S<0?a.openEnd:e-1):new $(ms(a.content,e,h),a.openStart,a.openEnd)}mustMoveInline(){if(!this.$to.parent.isTextblock)return-1;let e=this.frontier[this.depth],t;if(!e.type.isTextblock||!Zu(this.$to,this.$to.depth,e.type,e.match,!1)||this.$to.depth==this.depth&&(t=this.findCloseLevel(this.$to))&&t.depth==this.depth)return-1;let{depth:r}=this.$to,i=this.$to.after(r);for(;r>1&&i==this.$to.end(--r);)++i;return i}findCloseLevel(e){e:for(let t=Math.min(this.depth,e.depth);t>=0;t--){let{match:r,type:i}=this.frontier[t],o=t<e.depth&&e.end(t+1)==e.pos+(e.depth-(t+1)),a=Zu(e,t,i,r,o);if(a){for(let u=t-1;u>=0;u--){let{match:f,type:h}=this.frontier[u],m=Zu(e,u,h,f,!0);if(!m||m.childCount)continue e}return{depth:t,fit:a,move:o?e.doc.resolve(e.after(t+1)):e}}}}close(e){let t=this.findCloseLevel(e);if(!t)return null;for(;this.depth>t.depth;)this.closeFrontierNode();t.fit.childCount&&(this.placed=gs(this.placed,t.depth,t.fit)),e=t.move;for(let r=t.depth+1;r<=e.depth;r++){let i=e.node(r),o=i.type.contentMatch.fillBefore(i.content,!0,e.index(r));this.openFrontierNode(i.type,i.attrs,o)}return e}openFrontierNode(e,t=null,r){let i=this.frontier[this.depth];i.match=i.match.matchType(e),this.placed=gs(this.placed,this.depth,L.from(e.create(t,r))),this.frontier.push({type:e,match:e.contentMatch})}closeFrontierNode(){let t=this.frontier.pop().match.fillBefore(L.empty,!0);t.childCount&&(this.placed=gs(this.placed,this.frontier.length,t))}}function ms(n,e,t){return e==0?n.cutByIndex(t,n.childCount):n.replaceChild(0,n.firstChild.copy(ms(n.firstChild.content,e-1,t)))}function gs(n,e,t){return e==0?n.append(t):n.replaceChild(n.childCount-1,n.lastChild.copy(gs(n.lastChild.content,e-1,t)))}function Xu(n,e){for(let t=0;t<e;t++)n=n.firstChild.content;return n}function Em(n,e,t){if(e<=0)return n;let r=n.content;return e>1&&(r=r.replaceChild(0,Em(r.firstChild,e-1,r.childCount==1?t-1:0))),e>0&&(r=n.type.contentMatch.fillBefore(r).append(r),t<=0&&(r=r.append(n.type.contentMatch.matchFragment(r).fillBefore(L.empty,!0)))),n.copy(r)}function Zu(n,e,t,r,i){let o=n.node(e),a=i?n.indexAfter(e):n.index(e);if(a==o.childCount&&!t.compatibleContent(o.type))return null;let u=r.fillBefore(o.content,!0,a);return u&&!PE(t,o.content,a)?u:null}function PE(n,e,t){for(let r=t;r<e.childCount;r++)if(!n.allowsMarks(e.child(r).marks))return!0;return!1}function DE(n){return n.spec.defining||n.spec.definingForContent}function FE(n,e,t,r){if(!r.size)return n.deleteRange(e,t);let i=n.doc.resolve(e),o=n.doc.resolve(t);if(km(i,o,r))return n.step(new Xe(e,t,r));let a=Cm(i,n.doc.resolve(t));a[a.length-1]==0&&a.pop();let u=-(i.depth+1);a.unshift(u);for(let b=i.depth,S=i.pos-1;b>0;b--,S--){let x=i.node(b).type.spec;if(x.defining||x.definingAsContext||x.isolating)break;a.indexOf(b)>-1?u=b:i.before(b)==S&&a.splice(1,0,-b)}let f=a.indexOf(u),h=[],m=r.openStart;for(let b=r.content,S=0;;S++){let x=b.firstChild;if(h.push(x),S==r.openStart)break;b=x.content}for(let b=m-1;b>=0;b--){let S=h[b].type,x=DE(S);if(x&&i.node(f).type!=S)m=b;else if(x||!S.isTextblock)break}for(let b=r.openStart;b>=0;b--){let S=(b+m+1)%(r.openStart+1),x=h[S];if(x)for(let C=0;C<a.length;C++){let A=a[(C+f)%a.length],N=!0;A<0&&(N=!1,A=-A);let G=i.node(A-1),K=i.index(A-1);if(G.canReplaceWith(K,K,x.type,x.marks))return n.replace(i.before(A),N?o.after(A):t,new $(Tm(r.content,0,r.openStart,S),S,r.openEnd))}}let p=n.steps.length;for(let b=a.length-1;b>=0&&(n.replace(e,t,r),!(n.steps.length>p));b--){let S=a[b];S<0||(e=i.before(S),t=o.after(S))}}function Tm(n,e,t,r,i){if(e<t){let o=n.firstChild;n=n.replaceChild(0,o.copy(Tm(o.content,e+1,t,r,o)))}if(e>r){let o=i.contentMatchAt(0),a=o.fillBefore(n).append(n);n=a.append(o.matchFragment(a).fillBefore(L.empty,!0))}return n}function BE(n,e,t,r){if(!r.isInline&&e==t&&n.doc.resolve(e).parent.content.size){let i=NE(n.doc,e,r.type);i!=null&&(e=t=i)}n.replaceRange(e,t,new $(L.from(r),0,0))}function zE(n,e,t){let r=n.doc.resolve(e),i=n.doc.resolve(t),o=Cm(r,i);for(let a=0;a<o.length;a++){let u=o[a],f=a==o.length-1;if(f&&u==0||r.node(u).type.contentMatch.validEnd)return n.delete(r.start(u),i.end(u));if(u>0&&(f||r.node(u-1).canReplace(r.index(u-1),i.indexAfter(u-1))))return n.delete(r.before(u),i.after(u))}for(let a=1;a<=r.depth&&a<=i.depth;a++)if(e-r.start(a)==r.depth-a&&t>r.end(a)&&i.end(a)-t!=i.depth-a)return n.delete(r.before(a),t);n.delete(e,t)}function Cm(n,e){let t=[],r=Math.min(n.depth,e.depth);for(let i=r;i>=0;i--){let o=n.start(i);if(o<n.pos-(n.depth-i)||e.end(i)>e.pos+(e.depth-i)||n.node(i).type.spec.isolating||e.node(i).type.spec.isolating)break;(o==e.start(i)||i==n.depth&&i==e.depth&&n.parent.inlineContent&&e.parent.inlineContent&&i&&e.start(i-1)==o-1)&&t.push(i)}return t}class Li extends Ye{constructor(e,t,r){super(),this.pos=e,this.attr=t,this.value=r}apply(e){let t=e.nodeAt(this.pos);if(!t)return Re.fail("No node at attribute step's position");let r=Object.create(null);for(let o in t.attrs)r[o]=t.attrs[o];r[this.attr]=this.value;let i=t.type.create(r,null,t.marks);return Re.fromReplace(e,this.pos,this.pos+1,new $(L.from(i),0,t.isLeaf?0:1))}getMap(){return Pt.empty}invert(e){return new Li(this.pos,this.attr,e.nodeAt(this.pos).attrs[this.attr])}map(e){let t=e.mapResult(this.pos,1);return t.deletedAfter?null:new Li(t.pos,this.attr,this.value)}toJSON(){return{stepType:"attr",pos:this.pos,attr:this.attr,value:this.value}}static fromJSON(e,t){if(typeof t.pos!="number"||typeof t.attr!="string")throw new RangeError("Invalid input for AttrStep.fromJSON");return new Li(t.pos,t.attr,t.value)}}Ye.jsonID("attr",Li);let mi=class extends Error{};mi=function n(e){let t=Error.call(this,e);return t.__proto__=n.prototype,t},mi.prototype=Object.create(Error.prototype),mi.prototype.constructor=mi,mi.prototype.name="TransformError";class HE{constructor(e){this.doc=e,this.steps=[],this.docs=[],this.mapping=new Ni}get before(){return this.docs.length?this.docs[0]:this.doc}step(e){let t=this.maybeStep(e);if(t.failed)throw new mi(t.failed);return this}maybeStep(e){let t=e.apply(this.doc);return t.failed||this.addStep(e,t.doc),t}get docChanged(){return this.steps.length>0}addStep(e,t){this.docs.push(this.doc),this.steps.push(e),this.mapping.appendMap(e.getMap()),this.doc=t}replace(e,t=e,r=$.empty){let i=Yu(this.doc,e,t,r);return i&&this.step(i),this}replaceWith(e,t,r){return this.replace(e,t,new $(L.from(r),0,0))}delete(e,t){return this.replace(e,t,$.empty)}insert(e,t){return this.replaceWith(e,e,t)}replaceRange(e,t,r){return FE(this,e,t,r),this}replaceRangeWith(e,t,r){return BE(this,e,t,r),this}deleteRange(e,t){return zE(this,e,t),this}lift(e,t){return xE(this,e,t),this}join(e,t=1){return IE(this,e,t),this}wrap(e,t){return TE(this,e,t),this}setBlockType(e,t=e,r,i=null){return CE(this,e,t,r,i),this}setNodeMarkup(e,t,r=null,i=[]){return ME(this,e,t,r,i),this}setNodeAttribute(e,t,r){return this.step(new Li(e,t,r)),this}addNodeMark(e,t){return this.step(new ir(e,t)),this}removeNodeMark(e,t){if(!(t instanceof we)){let r=this.doc.nodeAt(e);if(!r)throw new RangeError("No node at position "+e);if(t=t.isInSet(r.marks),!t)return this}return this.step(new Ri(e,t)),this}split(e,t=1,r){return OE(this,e,t,r),this}addMark(e,t,r){return vE(this,e,t,r),this}removeMark(e,t,r){return SE(this,e,t,r),this}clearIncompatible(e,t,r){return wE(this,e,t,r),this}}const Qu=Object.create(null);class de{constructor(e,t,r){this.$anchor=e,this.$head=t,this.ranges=r||[new $E(e.min(t),e.max(t))]}get anchor(){return this.$anchor.pos}get head(){return this.$head.pos}get from(){return this.$from.pos}get to(){return this.$to.pos}get $from(){return this.ranges[0].$from}get $to(){return this.ranges[0].$to}get empty(){let e=this.ranges;for(let t=0;t<e.length;t++)if(e[t].$from.pos!=e[t].$to.pos)return!1;return!0}content(){return this.$from.doc.slice(this.from,this.to,!0)}replace(e,t=$.empty){let r=t.content.lastChild,i=null;for(let u=0;u<t.openEnd;u++)i=r,r=r.lastChild;let o=e.steps.length,a=this.ranges;for(let u=0;u<a.length;u++){let{$from:f,$to:h}=a[u],m=e.mapping.slice(o);e.replaceRange(m.map(f.pos),m.map(h.pos),u?$.empty:t),u==0&&Om(e,o,(r?r.isInline:i&&i.isTextblock)?-1:1)}}replaceWith(e,t){let r=e.steps.length,i=this.ranges;for(let o=0;o<i.length;o++){let{$from:a,$to:u}=i[o],f=e.mapping.slice(r),h=f.map(a.pos),m=f.map(u.pos);o?e.deleteRange(h,m):(e.replaceRangeWith(h,m,t),Om(e,r,t.isInline?-1:1))}}static findFrom(e,t,r=!1){let i=e.parent.inlineContent?new he(e):gi(e.node(0),e.parent,e.pos,e.index(),t,r);if(i)return i;for(let o=e.depth-1;o>=0;o--){let a=t<0?gi(e.node(0),e.node(o),e.before(o+1),e.index(o),t,r):gi(e.node(0),e.node(o),e.after(o+1),e.index(o)+1,t,r);if(a)return a}return null}static near(e,t=1){return this.findFrom(e,t)||this.findFrom(e,-t)||new Jt(e.node(0))}static atStart(e){return gi(e,e,0,0,1)||new Jt(e)}static atEnd(e){return gi(e,e,e.content.size,e.childCount,-1)||new Jt(e)}static fromJSON(e,t){if(!t||!t.type)throw new RangeError("Invalid input for Selection.fromJSON");let r=Qu[t.type];if(!r)throw new RangeError(`No selection type ${t.type} defined`);return r.fromJSON(e,t)}static jsonID(e,t){if(e in Qu)throw new RangeError("Duplicate use of selection JSON ID "+e);return Qu[e]=t,t.prototype.jsonID=e,t}getBookmark(){return he.between(this.$anchor,this.$head).getBookmark()}}de.prototype.visible=!0;class $E{constructor(e,t){this.$from=e,this.$to=t}}let Am=!1;function Mm(n){!Am&&!n.parent.inlineContent&&(Am=!0,console.warn("TextSelection endpoint not pointing into a node with inline content ("+n.parent.type.name+")"))}class he extends de{constructor(e,t=e){Mm(e),Mm(t),super(e,t)}get $cursor(){return this.$anchor.pos==this.$head.pos?this.$head:null}map(e,t){let r=e.resolve(t.map(this.head));if(!r.parent.inlineContent)return de.near(r);let i=e.resolve(t.map(this.anchor));return new he(i.parent.inlineContent?i:r,r)}replace(e,t=$.empty){if(super.replace(e,t),t==$.empty){let r=this.$from.marksAcross(this.$to);r&&e.ensureMarks(r)}}eq(e){return e instanceof he&&e.anchor==this.anchor&&e.head==this.head}getBookmark(){return new Ul(this.anchor,this.head)}toJSON(){return{type:"text",anchor:this.anchor,head:this.head}}static fromJSON(e,t){if(typeof t.anchor!="number"||typeof t.head!="number")throw new RangeError("Invalid input for TextSelection.fromJSON");return new he(e.resolve(t.anchor),e.resolve(t.head))}static create(e,t,r=t){let i=e.resolve(t);return new this(i,r==t?i:e.resolve(r))}static between(e,t,r){let i=e.pos-t.pos;if((!r||i)&&(r=i>=0?1:-1),!t.parent.inlineContent){let o=de.findFrom(t,r,!0)||de.findFrom(t,-r,!0);if(o)t=o.$head;else return de.near(t,r)}return e.parent.inlineContent||(i==0?e=t:(e=(de.findFrom(e,-r,!0)||de.findFrom(e,r,!0)).$anchor,e.pos<t.pos!=i<0&&(e=t))),new he(e,t)}}de.jsonID("text",he);class Ul{constructor(e,t){this.anchor=e,this.head=t}map(e){return new Ul(e.map(this.anchor),e.map(this.head))}resolve(e){return he.between(e.resolve(this.anchor),e.resolve(this.head))}}class Y extends de{constructor(e){let t=e.nodeAfter,r=e.node(0).resolve(e.pos+t.nodeSize);super(e,r),this.node=t}map(e,t){let{deleted:r,pos:i}=t.mapResult(this.anchor),o=e.resolve(i);return r?de.near(o):new Y(o)}content(){return new $(L.from(this.node),0,0)}eq(e){return e instanceof Y&&e.anchor==this.anchor}toJSON(){return{type:"node",anchor:this.anchor}}getBookmark(){return new pf(this.anchor)}static fromJSON(e,t){if(typeof t.anchor!="number")throw new RangeError("Invalid input for NodeSelection.fromJSON");return new Y(e.resolve(t.anchor))}static create(e,t){return new Y(e.resolve(t))}static isSelectable(e){return!e.isText&&e.type.spec.selectable!==!1}}Y.prototype.visible=!1,de.jsonID("node",Y);class pf{constructor(e){this.anchor=e}map(e){let{deleted:t,pos:r}=e.mapResult(this.anchor);return t?new Ul(r,r):new pf(r)}resolve(e){let t=e.resolve(this.anchor),r=t.nodeAfter;return r&&Y.isSelectable(r)?new Y(t):de.near(t)}}class Jt extends de{constructor(e){super(e.resolve(0),e.resolve(e.content.size))}replace(e,t=$.empty){if(t==$.empty){e.delete(0,e.doc.content.size);let r=de.atStart(e.doc);r.eq(e.selection)||e.setSelection(r)}else super.replace(e,t)}toJSON(){return{type:"all"}}static fromJSON(e){return new Jt(e)}map(e){return new Jt(e)}eq(e){return e instanceof Jt}getBookmark(){return WE}}de.jsonID("all",Jt);const WE={map(){return this},resolve(n){return new Jt(n)}};function gi(n,e,t,r,i,o=!1){if(e.inlineContent)return he.create(n,t);for(let a=r-(i>0?0:1);i>0?a<e.childCount:a>=0;a+=i){let u=e.child(a);if(u.isAtom){if(!o&&Y.isSelectable(u))return Y.create(n,t-(i<0?u.nodeSize:0))}else{let f=gi(n,u,t+i,i<0?u.childCount:0,i,o);if(f)return f}t+=u.nodeSize*i}return null}function Om(n,e,t){let r=n.steps.length-1;if(r<e)return;let i=n.steps[r];if(!(i instanceof Xe||i instanceof ze))return;let o=n.mapping.maps[r],a;o.forEach((u,f,h,m)=>{a==null&&(a=m)}),n.setSelection(de.near(n.doc.resolve(a),t))}function Im(n,e){return!e||!n?n:n.bind(e)}class nl{constructor(e,t,r){this.name=e,this.init=Im(t.init,r),this.apply=Im(t.apply,r)}}new nl("doc",{init(n){return n.doc||n.schema.topNodeType.createAndFill()},apply(n){return n.doc}}),new nl("selection",{init(n,e){return n.selection||de.atStart(e.doc)},apply(n){return n.selection}}),new nl("storedMarks",{init(n){return n.storedMarks||null},apply(n,e,t,r){return r.selection.$cursor?n.storedMarks:null}}),new nl("scrollToSelection",{init(){return 0},apply(n,e){return n.scrolledIntoView?e+1:e}});function Nm(n,e,t){for(let r in n){let i=n[r];i instanceof Function?i=i.bind(e):r=="handleDOMEvents"&&(i=Nm(i,e,{})),t[r]=i}return t}class St{constructor(e){this.spec=e,this.props={},e.props&&Nm(e.props,this,this.props),this.key=e.key?e.key.key:Rm("plugin")}getState(e){return e[this.key]}}const ec=Object.create(null);function Rm(n){return n in ec?n+"$"+ ++ec[n]:(ec[n]=0,n+"$")}class Kt{constructor(e="key"){this.key=Rm(e)}get(e){return e.config.pluginsByKey[this.key]}getState(e){return e[this.key]}}const ys=function(n){for(var e=0;;e++)if(n=n.previousSibling,!n)return e},Lm=function(n,e,t,r){return t&&(Pm(n,e,t,r,-1)||Pm(n,e,t,r,1))},UE=/^(img|br|input|textarea|hr)$/i;function Pm(n,e,t,r,i){for(;;){if(n==t&&e==r)return!0;if(e==(i<0?0:rl(n))){let o=n.parentNode;if(!o||o.nodeType!=1||KE(n)||UE.test(n.nodeName)||n.contentEditable=="false")return!1;e=ys(n)+(i<0?0:1),n=o}else if(n.nodeType==1){if(n=n.childNodes[e+(i<0?-1:0)],n.contentEditable=="false")return!1;e=i<0?rl(n):0}else return!1}}function rl(n){return n.nodeType==3?n.nodeValue.length:n.childNodes.length}function VE(n,e,t){for(let r=e==0,i=e==rl(n);r||i;){if(n==t)return!0;let o=ys(n);if(n=n.parentNode,!n)return!1;r=r&&o==0,i=i&&o==rl(n)}}function KE(n){let e;for(let t=n;t&&!(e=t.pmViewDesc);t=t.parentNode);return e&&e.node&&e.node.isBlock&&(e.dom==n||e.contentDOM==n)}const Dm=function(n){return n.focusNode&&Lm(n.focusNode,n.focusOffset,n.anchorNode,n.anchorOffset)};function Fm(n,e){let t=document.createEvent("Event");return t.initEvent("keydown",!0,!0),t.keyCode=n,t.key=t.code=e,t}const Kn=typeof navigator<"u"?navigator:null,Bm=typeof document<"u"?document:null,Gn=Kn&&Kn.userAgent||"",tc=/Edge\/(\d+)/.exec(Gn),zm=/MSIE \d/.exec(Gn),nc=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(Gn),bs=!!(zm||nc||tc),Hm=zm?document.documentMode:nc?+nc[1]:tc?+tc[1]:0,il=!bs&&/gecko\/(\d+)/i.test(Gn);il&&+(/Firefox\/(\d+)/.exec(Gn)||[0,0])[1];const rc=!bs&&/Chrome\/(\d+)/.exec(Gn),yi=!!rc,GE=rc?+rc[1]:0,Tr=!bs&&!!Kn&&/Apple Computer/.test(Kn.vendor),ic=Tr&&(/Mobile\/\w+/.test(Gn)||!!Kn&&Kn.maxTouchPoints>2),It=ic||(Kn?/Mac/.test(Kn.platform):!1),vs=/Android \d/.test(Gn),sc=!!Bm&&"webkitFontSmoothing"in Bm.documentElement.style,qE=sc?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function JE(n,e=null){let t=n.domSelectionRange(),r=n.state.doc;if(!t.focusNode)return null;let i=n.docView.nearestDesc(t.focusNode),o=i&&i.size==0,a=n.docView.posFromDOM(t.focusNode,t.focusOffset,1);if(a<0)return null;let u=r.resolve(a),f,h;if(Dm(t)){for(f=u;i&&!i.node;)i=i.parent;let m=i.node;if(i&&m.isAtom&&Y.isSelectable(m)&&i.parent&&!(m.isInline&&VE(t.focusNode,t.focusOffset,i.dom))){let p=i.posBefore;h=new Y(a==p?u:r.resolve(p))}}else{let m=n.docView.posFromDOM(t.anchorNode,t.anchorOffset,1);if(m<0)return null;f=r.resolve(m)}if(!h){let m=e=="pointer"||n.state.selection.head<u.pos&&!o?1:-1;h=Gm(n,f,u,m)}return h}function $m(n){return n.editable?n.hasFocus():ZE(n)&&document.activeElement&&document.activeElement.contains(n.dom)}function oc(n,e=!1){let t=n.state.selection;if(XE(n,t),!!$m(n)){if(!e&&n.input.mouseDown&&n.input.mouseDown.allowDefault&&yi){let r=n.domSelectionRange(),i=n.domObserver.currentSelection;if(r.anchorNode&&i.anchorNode&&Lm(r.anchorNode,r.anchorOffset,i.anchorNode,i.anchorOffset)){n.input.mouseDown.delayedSelectionSync=!0,n.domObserver.setCurSelection();return}}if(n.domObserver.disconnectSelection(),n.cursorWrapper)YE(n);else{let{anchor:r,head:i}=t,o,a;Wm&&!(t instanceof he)&&(t.$from.parent.inlineContent||(o=Um(n,t.from)),!t.empty&&!t.$from.parent.inlineContent&&(a=Um(n,t.to))),n.docView.setSelection(r,i,n.root,e),Wm&&(o&&Vm(o),a&&Vm(a)),t.visible?n.dom.classList.remove("ProseMirror-hideselection"):(n.dom.classList.add("ProseMirror-hideselection"),"onselectionchange"in document&&jE(n))}n.domObserver.setCurSelection(),n.domObserver.connectSelection()}}const Wm=Tr||yi&&GE<63;function Um(n,e){let{node:t,offset:r}=n.docView.domFromPos(e,0),i=r<t.childNodes.length?t.childNodes[r]:null,o=r?t.childNodes[r-1]:null;if(Tr&&i&&i.contentEditable=="false")return lc(i);if((!i||i.contentEditable=="false")&&(!o||o.contentEditable=="false")){if(i)return lc(i);if(o)return lc(o)}}function lc(n){return n.contentEditable="true",Tr&&n.draggable&&(n.draggable=!1,n.wasDraggable=!0),n}function Vm(n){n.contentEditable="false",n.wasDraggable&&(n.draggable=!0,n.wasDraggable=null)}function jE(n){let e=n.dom.ownerDocument;e.removeEventListener("selectionchange",n.input.hideSelectionGuard);let t=n.domSelectionRange(),r=t.anchorNode,i=t.anchorOffset;e.addEventListener("selectionchange",n.input.hideSelectionGuard=()=>{(t.anchorNode!=r||t.anchorOffset!=i)&&(e.removeEventListener("selectionchange",n.input.hideSelectionGuard),setTimeout(()=>{(!$m(n)||n.state.selection.visible)&&n.dom.classList.remove("ProseMirror-hideselection")},20))})}function YE(n){let e=n.domSelection(),t=document.createRange(),r=n.cursorWrapper.dom,i=r.nodeName=="IMG";i?t.setEnd(r.parentNode,ys(r)+1):t.setEnd(r,0),t.collapse(!1),e.removeAllRanges(),e.addRange(t),!i&&!n.state.selection.visible&&bs&&Hm<=11&&(r.disabled=!0,r.disabled=!1)}function XE(n,e){if(e instanceof Y){let t=n.docView.descAt(e.from);t!=n.lastSelectedViewDesc&&(Km(n),t&&t.selectNode(),n.lastSelectedViewDesc=t)}else Km(n)}function Km(n){n.lastSelectedViewDesc&&(n.lastSelectedViewDesc.parent&&n.lastSelectedViewDesc.deselectNode(),n.lastSelectedViewDesc=void 0)}function Gm(n,e,t,r){return n.someProp("createSelectionBetween",i=>i(n,e,t))||he.between(e,t,r)}function ZE(n){let e=n.domSelectionRange();if(!e.anchorNode)return!1;try{return n.dom.contains(e.anchorNode.nodeType==3?e.anchorNode.parentNode:e.anchorNode)&&(n.editable||n.dom.contains(e.focusNode.nodeType==3?e.focusNode.parentNode:e.focusNode))}catch{return!1}}function ac(n,e){let{$anchor:t,$head:r}=n.selection,i=e>0?t.max(r):t.min(r),o=i.parent.inlineContent?i.depth?n.doc.resolve(e>0?i.after():i.before()):null:i;return o&&de.findFrom(o,e)}function Cr(n,e){return n.dispatch(n.state.tr.setSelection(e).scrollIntoView()),!0}function qm(n,e,t){let r=n.state.selection;if(r instanceof he){if(!r.empty||t.indexOf("s")>-1)return!1;if(n.endOfTextblock(e>0?"right":"left")){let i=ac(n.state,e);return i&&i instanceof Y?Cr(n,i):!1}else if(!(It&&t.indexOf("m")>-1)){let i=r.$head,o=i.textOffset?null:e<0?i.nodeBefore:i.nodeAfter,a;if(!o||o.isText)return!1;let u=e<0?i.pos-o.nodeSize:i.pos;return o.isAtom||(a=n.docView.descAt(u))&&!a.contentDOM?Y.isSelectable(o)?Cr(n,new Y(e<0?n.state.doc.resolve(i.pos-o.nodeSize):i)):sc?Cr(n,new he(n.state.doc.resolve(e<0?u:u+o.nodeSize))):!1:!1}}else{if(r instanceof Y&&r.node.isInline)return Cr(n,new he(e>0?r.$to:r.$from));{let i=ac(n.state,e);return i?Cr(n,i):!1}}}function sl(n){return n.nodeType==3?n.nodeValue.length:n.childNodes.length}function Ss(n){let e=n.pmViewDesc;return e&&e.size==0&&(n.nextSibling||n.nodeName!="BR")}function uc(n){let e=n.domSelectionRange(),t=e.focusNode,r=e.focusOffset;if(!t)return;let i,o,a=!1;for(il&&t.nodeType==1&&r<sl(t)&&Ss(t.childNodes[r])&&(a=!0);;)if(r>0){if(t.nodeType!=1)break;{let u=t.childNodes[r-1];if(Ss(u))i=t,o=--r;else if(u.nodeType==3)t=u,r=t.nodeValue.length;else break}}else{if(Jm(t))break;{let u=t.previousSibling;for(;u&&Ss(u);)i=t.parentNode,o=ys(u),u=u.previousSibling;if(u)t=u,r=sl(t);else{if(t=t.parentNode,t==n.dom)break;r=0}}}a?fc(n,t,r):i&&fc(n,i,o)}function cc(n){let e=n.domSelectionRange(),t=e.focusNode,r=e.focusOffset;if(!t)return;let i=sl(t),o,a;for(;;)if(r<i){if(t.nodeType!=1)break;let u=t.childNodes[r];if(Ss(u))o=t,a=++r;else break}else{if(Jm(t))break;{let u=t.nextSibling;for(;u&&Ss(u);)o=u.parentNode,a=ys(u)+1,u=u.nextSibling;if(u)t=u,r=0,i=sl(t);else{if(t=t.parentNode,t==n.dom)break;r=i=0}}}o&&fc(n,o,a)}function Jm(n){let e=n.pmViewDesc;return e&&e.node&&e.node.isBlock}function fc(n,e,t){let r=n.domSelection();if(Dm(r)){let o=document.createRange();o.setEnd(e,t),o.setStart(e,t),r.removeAllRanges(),r.addRange(o)}else r.extend&&r.extend(e,t);n.domObserver.setCurSelection();let{state:i}=n;setTimeout(()=>{n.state==i&&oc(n)},50)}function jm(n,e,t){let r=n.state.selection;if(r instanceof he&&!r.empty||t.indexOf("s")>-1||It&&t.indexOf("m")>-1)return!1;let{$from:i,$to:o}=r;if(!i.parent.inlineContent||n.endOfTextblock(e<0?"up":"down")){let a=ac(n.state,e);if(a&&a instanceof Y)return Cr(n,a)}if(!i.parent.inlineContent){let a=e<0?i:o,u=r instanceof Jt?de.near(a,e):de.findFrom(a,e);return u?Cr(n,u):!1}return!1}function Ym(n,e){if(!(n.state.selection instanceof he))return!0;let{$head:t,$anchor:r,empty:i}=n.state.selection;if(!t.sameParent(r))return!0;if(!i)return!1;if(n.endOfTextblock(e>0?"forward":"backward"))return!0;let o=!t.textOffset&&(e<0?t.nodeBefore:t.nodeAfter);if(o&&!o.isText){let a=n.state.tr;return e<0?a.delete(t.pos-o.nodeSize,t.pos):a.delete(t.pos,t.pos+o.nodeSize),n.dispatch(a),!0}return!1}function Xm(n,e,t){n.domObserver.stop(),e.contentEditable=t,n.domObserver.start()}function QE(n){if(!Tr||n.state.selection.$head.parentOffset>0)return!1;let{focusNode:e,focusOffset:t}=n.domSelectionRange();if(e&&e.nodeType==1&&t==0&&e.firstChild&&e.firstChild.contentEditable=="false"){let r=e.firstChild;Xm(n,r,"true"),setTimeout(()=>Xm(n,r,"false"),20)}return!1}function eT(n){let e="";return n.ctrlKey&&(e+="c"),n.metaKey&&(e+="m"),n.altKey&&(e+="a"),n.shiftKey&&(e+="s"),e}function tT(n,e){let t=e.keyCode,r=eT(e);return t==8||It&&t==72&&r=="c"?Ym(n,-1)||uc(n):t==46||It&&t==68&&r=="c"?Ym(n,1)||cc(n):t==13||t==27?!0:t==37||It&&t==66&&r=="c"?qm(n,-1,r)||uc(n):t==39||It&&t==70&&r=="c"?qm(n,1,r)||cc(n):t==38||It&&t==80&&r=="c"?jm(n,-1,r)||uc(n):t==40||It&&t==78&&r=="c"?QE(n)||jm(n,1,r)||cc(n):r==(It?"m":"c")&&(t==66||t==73||t==89||t==90)}function Zm(n,e){n.someProp("transformCopied",S=>{e=S(e,n)});let t=[],{content:r,openStart:i,openEnd:o}=e;for(;i>1&&o>1&&r.childCount==1&&r.firstChild.childCount==1;){i--,o--;let S=r.firstChild;t.push(S.type.name,S.attrs!=S.type.defaultAttrs?S.attrs:null),r=S.content}let a=n.someProp("clipboardSerializer")||Hr.fromSchema(n.state.schema),u=og(),f=u.createElement("div");f.appendChild(a.serializeFragment(r,{document:u}));let h=f.firstChild,m,p=0;for(;h&&h.nodeType==1&&(m=ig[h.nodeName.toLowerCase()]);){for(let S=m.length-1;S>=0;S--){let x=u.createElement(m[S]);for(;f.firstChild;)x.appendChild(f.firstChild);f.appendChild(x),p++}h=f.firstChild}h&&h.nodeType==1&&h.setAttribute("data-pm-slice",`${i} ${o}${p?` -${p}`:""} ${JSON.stringify(t)}`);let b=n.someProp("clipboardTextSerializer",S=>S(e,n))||e.content.textBetween(0,e.content.size,`
3
+ `,...ik(i)),console.warn(...o)}Lo(),Fc=!1}function rk(){let n=wr[wr.length-1];if(!n)return[];const e=[];for(;n;){const t=e[0];t&&t.vnode===n?t.recurseCount++:e.push({vnode:n,recurseCount:0});const r=n.component&&n.component.parent;n=r&&r.vnode}return e}function ik(n){const e=[];return n.forEach((t,r)=>{e.push(...r===0?[]:[`
4
+ `],...sk(t))}),e}function sk({vnode:n,recurseCount:e}){const t=e>0?`... (${e} recursive calls)`:"",r=n.component?n.component.parent==null:!1,i=` at <${Kp(n.component,n.type,r)}`,o=">"+t;return n.props?[i,...ok(n.props),o]:[i+o]}function ok(n){const e=[],t=Object.keys(n);return t.slice(0,3).forEach(r=>{e.push(..._p(r,n[r]))}),t.length>3&&e.push(" ..."),e}function _p(n,e,t){return Jt(e)?(e=JSON.stringify(e),t?e:[`${n}=${e}`]):typeof e=="number"||typeof e=="boolean"||e==null?t?e:[`${n}=${e}`]:Ke(e)?(e=_p(n,ae(e.value),!0),t?e:[`${n}=Ref<`,e,">"]):Ne(e)?[`${n}=fn${e.name?`<${e.name}>`:""}`]:(e=ae(e),t?e:[`${n}=`,e])}const kp={sp:"serverPrefetch hook",bc:"beforeCreate hook",c:"created hook",bm:"beforeMount hook",m:"mounted hook",bu:"beforeUpdate hook",u:"updated",bum:"beforeUnmount hook",um:"unmounted hook",a:"activated hook",da:"deactivated hook",ec:"errorCaptured hook",rtc:"renderTracked hook",rtg:"renderTriggered hook",0:"setup function",1:"render function",2:"watcher getter",3:"watcher callback",4:"watcher cleanup function",5:"native event handler",6:"component event handler",7:"vnode hook",8:"directive hook",9:"transition hook",10:"app errorHandler",11:"app warnHandler",12:"ref function",13:"async component loader",14:"scheduler flush",15:"component update",16:"app unmount cleanup function"};function Uo(n,e,t,r){try{return r?n(...r):n()}catch(i){Bc(i,e,t)}}function Ep(n,e,t,r){if(Ne(n)){const i=Uo(n,e,t,r);return i&&h_(i)&&i.catch(o=>{Bc(o,e,t)}),i}if(ke(n)){const i=[];for(let o=0;o<n.length;o++)i.push(Ep(n[o],e,t,r));return i}else process.env.NODE_ENV!=="production"&&Te(`Invalid value type passed to callWithAsyncErrorHandling(): ${typeof n}`)}function Bc(n,e,t,r=!0){const i=e?e.vnode:null,{errorHandler:o,throwUnhandledErrorInProduction:a}=e&&e.appContext.config||Pt;if(e){let c=e.parent;const f=e.proxy,h=process.env.NODE_ENV!=="production"?kp[t]:`https://vuejs.org/error-reference/#runtime-${t}`;for(;c;){const m=c.ec;if(m){for(let p=0;p<m.length;p++)if(m[p](n,f,h)===!1)return}c=c.parent}if(o){Ro(),Uo(o,null,10,[n,f,h]),Lo();return}}lk(n,t,i,r,a)}function lk(n,e,t,r=!0,i=!1){if(process.env.NODE_ENV!=="production"){const o=kp[e];if(t&&tk(t),Te(`Unhandled error${o?` during execution of ${o}`:""}`),t&&nk(),r)throw n;console.error(n)}else{if(i)throw n;console.error(n)}}const Dt=[];let On=-1;const fi=[];let Gn=null,di=0;const Tp=Promise.resolve();let Vo=null;const ak=100;function ck(n){const e=Vo||Tp;return n?e.then(this?n.bind(this):n):e}function uk(n){let e=On+1,t=Dt.length;for(;e<t;){const r=e+t>>>1,i=Dt[r],o=ps(i);o<n||o===n&&i.flags&2?e=r+1:t=r}return e}function zc(n){if(!(n.flags&1)){const e=ps(n),t=Dt[Dt.length-1];!t||!(n.flags&2)&&e>=ps(t)?Dt.push(n):Dt.splice(uk(e),0,n),n.flags|=1,Cp()}}function Cp(){Vo||(Vo=Tp.then(Mp))}function Ap(n){ke(n)?fi.push(...n):Gn&&n.id===-1?Gn.splice(di+1,0,n):n.flags&1||(fi.push(n),n.flags|=1),Cp()}function fk(n){if(fi.length){const e=[...new Set(fi)].sort((t,r)=>ps(t)-ps(r));if(fi.length=0,Gn){Gn.push(...e);return}for(Gn=e,process.env.NODE_ENV!=="production"&&(n=n||new Map),di=0;di<Gn.length;di++){const t=Gn[di];process.env.NODE_ENV!=="production"&&Op(n,t)||(t.flags&4&&(t.flags&=-2),t.flags&8||t(),t.flags&=-2)}Gn=null,di=0}}const ps=n=>n.id==null?n.flags&2?-1:1/0:n.id;function Mp(n){process.env.NODE_ENV!=="production"&&(n=n||new Map);const e=process.env.NODE_ENV!=="production"?t=>Op(n,t):vr;try{for(On=0;On<Dt.length;On++){const t=Dt[On];if(t&&!(t.flags&8)){if(process.env.NODE_ENV!=="production"&&e(t))continue;t.flags&4&&(t.flags&=-2),Uo(t,t.i,t.i?15:14),t.flags&4||(t.flags&=-2)}}}finally{for(;On<Dt.length;On++){const t=Dt[On];t&&(t.flags&=-2)}On=-1,Dt.length=0,fk(n),Vo=null,(Dt.length||fi.length)&&Mp(n)}}function Op(n,e){const t=n.get(e)||0;if(t>ak){const r=e.i,i=r&&Vp(r.type);return Bc(`Maximum recursive updates exceeded${i?` in component <${i}>`:""}. This means you have a reactive effect that is mutating its own dependencies and thus recursively triggering itself. Possible sources include component template, render function, updated hook or watcher source function.`,null,10),!0}return n.set(e,t+1),!1}const Hc=new Map;process.env.NODE_ENV!=="production"&&(No().__VUE_HMR_RUNTIME__={createRecord:$c(dk),rerender:$c(hk),reload:$c(pk)});const Ko=new Map;function dk(n,e){return Ko.has(n)?!1:(Ko.set(n,{initialDef:Go(e),instances:new Set}),!0)}function Go(n){return Gp(n)?n.__vccOpts:n}function hk(n,e){const t=Ko.get(n);t&&(t.initialDef.render=e,[...t.instances].forEach(r=>{e&&(r.render=e,Go(r.type).render=e),r.renderCache=[],r.update()}))}function pk(n,e){const t=Ko.get(n);if(!t)return;e=Go(e),Ip(t.initialDef,e);const r=[...t.instances];for(let i=0;i<r.length;i++){const o=r[i],a=Go(o.type);let c=Hc.get(a);c||(a!==t.initialDef&&Ip(a,e),Hc.set(a,c=new Set)),c.add(o),o.appContext.propsCache.delete(o.type),o.appContext.emitsCache.delete(o.type),o.appContext.optionsCache.delete(o.type),o.ceReload?(c.add(o),o.ceReload(e.styles),c.delete(o)):o.parent?zc(()=>{o.parent.update(),c.delete(o)}):o.appContext.reload?o.appContext.reload():typeof window<"u"?window.location.reload():console.warn("[HMR] Root or manually mounted instance modified. Full reload required."),o.root.ce&&o!==o.root&&o.root.ce._removeChildStyle(a)}Ap(()=>{Hc.clear()})}function Ip(n,e){wt(n,e);for(const t in n)t!=="__file"&&!(t in e)&&delete n[t]}function $c(n){return(e,t)=>{try{return n(e,t)}catch(r){console.error(r),console.warn("[HMR] Something went wrong during Vue component hot-reload. Full reload required.")}}}let hi,qo=[];function Np(n,e){var t,r;hi=n,hi?(hi.enabled=!0,qo.forEach(({event:i,args:o})=>hi.emit(i,...o)),qo=[]):typeof window<"u"&&window.HTMLElement&&!((r=(t=window.navigator)==null?void 0:t.userAgent)!=null&&r.includes("jsdom"))?((e.__VUE_DEVTOOLS_HOOK_REPLAY__=e.__VUE_DEVTOOLS_HOOK_REPLAY__||[]).push(o=>{Np(o,e)}),setTimeout(()=>{hi||(e.__VUE_DEVTOOLS_HOOK_REPLAY__=null,qo=[])},3e3)):qo=[]}let on=null,mk=null;const gk=n=>n.__isTeleport;function Rp(n,e){n.shapeFlag&6&&n.component?(n.transition=e,Rp(n.component.subTree,e)):n.shapeFlag&128?(n.ssContent.transition=e.clone(n.ssContent),n.ssFallback.transition=e.clone(n.ssFallback)):n.transition=e}No().requestIdleCallback,No().cancelIdleCallback;const yk=Symbol.for("v-ndc"),Wc=n=>n?qk(n)?Jk(n):Wc(n.parent):null,ms=wt(Object.create(null),{$:n=>n,$el:n=>n.vnode.el,$data:n=>n.data,$props:n=>process.env.NODE_ENV!=="production"?Bo(n.props):n.props,$attrs:n=>process.env.NODE_ENV!=="production"?Bo(n.attrs):n.attrs,$slots:n=>process.env.NODE_ENV!=="production"?Bo(n.slots):n.slots,$refs:n=>process.env.NODE_ENV!=="production"?Bo(n.refs):n.refs,$parent:n=>Wc(n.parent),$root:n=>Wc(n.root),$host:n=>n.ce,$emit:n=>n.emit,$options:n=>__VUE_OPTIONS_API__?xk(n):n.type,$forceUpdate:n=>n.f||(n.f=()=>{zc(n.update)}),$nextTick:n=>n.n||(n.n=ck.bind(n.proxy)),$watch:n=>__VUE_OPTIONS_API__?Nk.bind(n):vr}),bk=n=>n==="_"||n==="$",Uc=(n,e)=>n!==Pt&&!n.__isScriptSetup&&Ie(n,e),vk={get({_:n},e){if(e==="__v_skip")return!0;const{ctx:t,setupState:r,data:i,props:o,accessCache:a,type:c,appContext:f}=n;if(process.env.NODE_ENV!=="production"&&e==="__isVue")return!0;let h;if(e[0]!=="$"){const S=a[e];if(S!==void 0)switch(S){case 1:return r[e];case 2:return i[e];case 4:return t[e];case 3:return o[e]}else{if(Uc(r,e))return a[e]=1,r[e];if(i!==Pt&&Ie(i,e))return a[e]=2,i[e];if((h=n.propsOptions[0])&&Ie(h,e))return a[e]=3,o[e];if(t!==Pt&&Ie(t,e))return a[e]=4,t[e];(!__VUE_OPTIONS_API__||Sk)&&(a[e]=0)}}const m=ms[e];let p,y;if(m)return e==="$attrs"?(Be(n.attrs,"get",""),process.env.NODE_ENV!=="production"&&void 0):process.env.NODE_ENV!=="production"&&e==="$slots"&&Be(n,"get",e),m(n);if((p=c.__cssModules)&&(p=p[e]))return p;if(t!==Pt&&Ie(t,e))return a[e]=4,t[e];if(y=f.config.globalProperties,Ie(y,e))return y[e];process.env.NODE_ENV!=="production"&&on&&(!Jt(e)||e.indexOf("__v")!==0)&&(i!==Pt&&bk(e[0])&&Ie(i,e)?Te(`Property ${JSON.stringify(e)} must be accessed via $data because it starts with a reserved character ("$" or "_") and is not proxied on the render context.`):n===on&&Te(`Property ${JSON.stringify(e)} was accessed during render but is not defined on instance.`))},set({_:n},e,t){const{data:r,setupState:i,ctx:o}=n;return Uc(i,e)?(i[e]=t,!0):process.env.NODE_ENV!=="production"&&i.__isScriptSetup&&Ie(i,e)?(Te(`Cannot mutate <script setup> binding "${e}" from Options API.`),!1):r!==Pt&&Ie(r,e)?(r[e]=t,!0):Ie(n.props,e)?(process.env.NODE_ENV!=="production"&&Te(`Attempting to mutate prop "${e}". Props are readonly.`),!1):e[0]==="$"&&e.slice(1)in n?(process.env.NODE_ENV!=="production"&&Te(`Attempting to mutate public property "${e}". Properties starting with $ are reserved and readonly.`),!1):(process.env.NODE_ENV!=="production"&&e in n.appContext.config.globalProperties?Object.defineProperty(o,e,{enumerable:!0,configurable:!0,value:t}):o[e]=t,!0)},has({_:{data:n,setupState:e,accessCache:t,ctx:r,appContext:i,propsOptions:o}},a){let c;return!!t[a]||n!==Pt&&Ie(n,a)||Uc(e,a)||(c=o[0])&&Ie(c,a)||Ie(r,a)||Ie(ms,a)||Ie(i.config.globalProperties,a)},defineProperty(n,e,t){return t.get!=null?n._.accessCache[e]=0:Ie(t,"value")&&this.set(n,e,t.value,null),Reflect.defineProperty(n,e,t)}};process.env.NODE_ENV!=="production"&&(vk.ownKeys=n=>(Te("Avoid app logic that relies on enumerating keys on a component instance. The keys will be empty in production mode to avoid performance overhead."),Reflect.ownKeys(n)));function Lp(n){return ke(n)?n.reduce((e,t)=>(e[t]=null,e),{}):n}let Sk=!0;function xk(n){const e=n.type,{mixins:t,extends:r}=e,{mixins:i,optionsCache:o,config:{optionMergeStrategies:a}}=n.appContext,c=o.get(e);let f;return c?f=c:!i.length&&!t&&!r?f=e:(f={},i.length&&i.forEach(h=>Jo(f,h,a,!0)),Jo(f,e,a)),ot(e)&&o.set(e,f),f}function Jo(n,e,t,r=!1){const{mixins:i,extends:o}=e;o&&Jo(n,o,t,!0),i&&i.forEach(a=>Jo(n,a,t,!0));for(const a in e)if(r&&a==="expose")process.env.NODE_ENV!=="production"&&Te('"expose" option is ignored when declared in mixins or extends. It should only be declared in the base component itself.');else{const c=wk[a]||t&&t[a];n[a]=c?c(n[a],e[a]):e[a]}return n}const wk={data:Pp,props:Fp,emits:Fp,methods:gs,computed:gs,beforeCreate:at,created:at,beforeMount:at,mounted:at,beforeUpdate:at,updated:at,beforeDestroy:at,beforeUnmount:at,destroyed:at,unmounted:at,activated:at,deactivated:at,errorCaptured:at,serverPrefetch:at,components:gs,directives:gs,watch:kk,provide:Pp,inject:_k};function Pp(n,e){return e?n?function(){return wt(Ne(n)?n.call(this,this):n,Ne(e)?e.call(this,this):e)}:e:n}function _k(n,e){return gs(Dp(n),Dp(e))}function Dp(n){if(ke(n)){const e={};for(let t=0;t<n.length;t++)e[n[t]]=n[t];return e}return n}function at(n,e){return n?[...new Set([].concat(n,e))]:e}function gs(n,e){return n?wt(Object.create(null),n,e):e}function Fp(n,e){return n?ke(n)&&ke(e)?[...new Set([...n,...e])]:wt(Object.create(null),Lp(n),Lp(e??{})):e}function kk(n,e){if(!n)return e;if(!e)return n;const t=wt(Object.create(null),n);for(const r in e)t[r]=at(n[r],e[r]);return t}let Ek=null;function Tk(n,e,t=!1){const r=ys||on;if(r||Ek){const i=r?r.parent==null?r.vnode.appContext&&r.vnode.appContext.provides:r.parent.provides:void 0;if(i&&n in i)return i[n];if(arguments.length>1)return t&&Ne(e)?e.call(r&&r.proxy):e;process.env.NODE_ENV!=="production"&&Te(`injection "${String(n)}" not found.`)}else process.env.NODE_ENV!=="production"&&Te("inject() can only be used inside setup() or functional components.")}const Ck={},Bp=n=>Object.getPrototypeOf(n)===Ck,Ak=Pk,Mk=Symbol.for("v-scx"),Ok=()=>{{const n=Tk(Mk);return n||process.env.NODE_ENV!=="production"&&Te("Server rendering context not provided. Make sure to only call useSSRContext() conditionally in the server build."),n}};function Ik(n,e,t){return process.env.NODE_ENV!=="production"&&!Ne(e)&&Te("`watch(fn, options?)` signature has been moved to a separate API. Use `watchEffect(fn, options?)` instead. `watch` now only supports `watch(source, cb, options?) signature."),zp(n,e,t)}function zp(n,e,t=Pt){const{immediate:r,deep:i,flush:o,once:a}=t;process.env.NODE_ENV!=="production"&&!e&&(r!==void 0&&Te('watch() "immediate" option is only respected when using the watch(source, callback, options?) signature.'),i!==void 0&&Te('watch() "deep" option is only respected when using the watch(source, callback, options?) signature.'),a!==void 0&&Te('watch() "once" option is only respected when using the watch(source, callback, options?) signature.'));const c=wt({},t);process.env.NODE_ENV!=="production"&&(c.onWarn=Te);const f=e&&r||!e&&o!=="post";let h;if(Xo){if(o==="sync"){const S=Ok();h=S.__watcherHandles||(S.__watcherHandles=[])}else if(!f){const S=()=>{};return S.stop=vr,S.resume=vr,S.pause=vr,S}}const m=ys;c.call=(S,_,C)=>Ep(S,m,_,C);let p=!1;o==="post"?c.scheduler=S=>{Ak(S,m&&m.suspense)}:o!=="sync"&&(p=!0,c.scheduler=(S,_)=>{_?S():zc(S)}),c.augmentJob=S=>{e&&(S.flags|=4),p&&(S.flags|=2,m&&(S.id=m.uid,S.i=m))};const y=ek(n,e,c);return Xo&&(h?h.push(y):f&&y()),y}function Nk(n,e,t){const r=this.proxy,i=Jt(n)?n.includes(".")?Rk(r,n):()=>r[n]:n.bind(r,r);let o;Ne(e)?o=e:(o=e.handler,t=e);const a=Gk(this),c=zp(i,o.bind(r),t);return a(),c}function Rk(n,e){const t=e.split(".");return()=>{let r=n;for(let i=0;i<t.length&&r;i++)r=r[t[i]];return r}}function BO(){}const Lk=n=>n.__isSuspense;function Pk(n,e){e&&e.pendingBranch?ke(n)?e.effects.push(...n):e.effects.push(n):Ap(n)}const Hp=Symbol.for("v-fgt"),Dk=Symbol.for("v-txt"),Fk=Symbol.for("v-cmt");let pi=null;function Bk(n){return n?n.__v_isVNode===!0:!1}const zk=(...n)=>Wp(...n),$p=({key:n})=>n??null,jo=({ref:n,ref_key:e,ref_for:t})=>(typeof n=="number"&&(n=""+n),n!=null?Jt(n)||Ke(n)||Ne(n)?{i:on,r:n,k:e,f:!!t}:n:null);function Hk(n,e=null,t=null,r=0,i=null,o=n===Hp?0:1,a=!1,c=!1){const f={__v_isVNode:!0,__v_skip:!0,type:n,props:e,key:e&&$p(e),ref:e&&jo(e),scopeId:mk,slotScopeIds:null,children:t,component:null,suspense:null,ssContent:null,ssFallback:null,dirs:null,transition:null,el:null,anchor:null,target:null,targetStart:null,targetAnchor:null,staticCount:0,shapeFlag:o,patchFlag:r,dynamicProps:i,dynamicChildren:null,appContext:null,ctx:on};return c?(Vc(f,t),o&128&&n.normalize(f)):t&&(f.shapeFlag|=Jt(t)?8:16),process.env.NODE_ENV!=="production"&&f.key!==f.key&&Te("VNode created with invalid key (NaN). VNode type:",f.type),!a&&pi&&(f.patchFlag>0||o&6)&&f.patchFlag!==32&&pi.push(f),f}const $k=process.env.NODE_ENV!=="production"?zk:Wp;function Wp(n,e=null,t=null,r=0,i=null,o=!1){if((!n||n===yk)&&(process.env.NODE_ENV!=="production"&&!n&&Te(`Invalid vnode type when creating vnode: ${n}.`),n=Fk),Bk(n)){const c=Yo(n,e,!0);return t&&Vc(c,t),!o&&pi&&(c.shapeFlag&6?pi[pi.indexOf(n)]=c:pi.push(c)),c.patchFlag=-2,c}if(Gp(n)&&(n=n.__vccOpts),e){e=Wk(e);let{class:c,style:f}=e;c&&!Jt(c)&&(e.class=xc(c)),ot(f)&&(zo(f)&&!ke(f)&&(f=wt({},f)),e.style=Sc(f))}const a=Jt(n)?1:Lk(n)?128:gk(n)?64:ot(n)?4:Ne(n)?2:0;return process.env.NODE_ENV!=="production"&&a&4&&zo(n)&&(n=ae(n),Te("Vue received a Component that was made a reactive object. This can lead to unnecessary performance overhead and should be avoided by marking the component with `markRaw` or using `shallowRef` instead of `ref`.",`
5
+ Component that was made reactive: `,n)),Hk(n,e,t,r,i,a,o,!0)}function Wk(n){return n?zo(n)||Bp(n)?wt({},n):n:null}function Yo(n,e,t=!1,r=!1){const{props:i,ref:o,patchFlag:a,children:c,transition:f}=n,h=e?Vk(i||{},e):i,m={__v_isVNode:!0,__v_skip:!0,type:n.type,props:h,key:h&&$p(h),ref:e&&e.ref?t&&o?ke(o)?o.concat(jo(e)):[o,jo(e)]:jo(e):o,scopeId:n.scopeId,slotScopeIds:n.slotScopeIds,children:process.env.NODE_ENV!=="production"&&a===-1&&ke(c)?c.map(Up):c,target:n.target,targetStart:n.targetStart,targetAnchor:n.targetAnchor,staticCount:n.staticCount,shapeFlag:n.shapeFlag,patchFlag:e&&n.type!==Hp?a===-1?16:a|16:a,dynamicProps:n.dynamicProps,dynamicChildren:n.dynamicChildren,appContext:n.appContext,dirs:n.dirs,transition:f,component:n.component,suspense:n.suspense,ssContent:n.ssContent&&Yo(n.ssContent),ssFallback:n.ssFallback&&Yo(n.ssFallback),el:n.el,anchor:n.anchor,ctx:n.ctx,ce:n.ce};return f&&r&&Rp(m,f.clone(m)),m}function Up(n){const e=Yo(n);return ke(n.children)&&(e.children=n.children.map(Up)),e}function Uk(n=" ",e=0){return $k(Dk,null,n,e)}function Vc(n,e){let t=0;const{shapeFlag:r}=n;if(e==null)e=null;else if(ke(e))t=16;else if(typeof e=="object")if(r&65){const i=e.default;i&&(i._c&&(i._d=!1),Vc(n,i()),i._c&&(i._d=!0));return}else{t=32;const i=e._;!i&&!Bp(e)?e._ctx=on:i===3&&on&&(on.slots._===1?e._=1:(e._=2,n.patchFlag|=1024))}else Ne(e)?(e={default:e,_ctx:on},t=32):(e=String(e),r&64?(t=16,e=[Uk(e)]):t=8);n.children=e,n.shapeFlag|=t}function Vk(...n){const e={};for(let t=0;t<n.length;t++){const r=n[t];for(const i in r)if(i==="class")e.class!==r.class&&(e.class=xc([e.class,r.class]));else if(i==="style")e.style=Sc([e.style,r.style]);else if(u_(i)){const o=e[i],a=r[i];a&&o!==a&&!(ke(o)&&o.includes(a))&&(e[i]=o?[].concat(o,a):a)}else i!==""&&(e[i]=r[i])}return e}let ys=null;const Kk=()=>ys||on;let Kc;{const n=No(),e=(t,r)=>{let i;return(i=n[t])||(i=n[t]=[]),i.push(r),o=>{i.length>1?i.forEach(a=>a(o)):i[0](o)}};Kc=e("__VUE_INSTANCE_SETTERS__",t=>ys=t),e("__VUE_SSR_SETTERS__",t=>Xo=t)}const Gk=n=>{const e=ys;return Kc(n),n.scope.on(),()=>{n.scope.off(),Kc(e)}};function qk(n){return n.vnode.shapeFlag&4}let Xo=!1;process.env.NODE_ENV;function Jk(n){return n.exposed?n.exposeProxy||(n.exposeProxy=new Proxy(q_(U_(n.exposed)),{get(e,t){if(t in e)return e[t];if(t in ms)return ms[t](n)},has(e,t){return t in e||t in ms}})):n.proxy}const jk=/(?:^|[-_])(\w)/g,Yk=n=>n.replace(jk,e=>e.toUpperCase()).replace(/[-_]/g,"");function Vp(n,e=!0){return Ne(n)?n.displayName||n.name:n.name||e&&n.__name}function Kp(n,e,t=!1){let r=Vp(e);if(!r&&e.__file){const i=e.__file.match(/([^/\\]+)\.\w+$/);i&&(r=i[1])}if(!r&&n&&n.parent){const i=o=>{for(const a in o)if(o[a]===e)return a};r=i(n.components||n.parent.type.components)||i(n.appContext.components)}return r?Yk(r):t?"App":"Anonymous"}function Gp(n){return Ne(n)&&"__vccOpts"in n}const de=(n,e)=>{const t=Z_(n,e,Xo);if(process.env.NODE_ENV!=="production"){const r=Kk();r&&r.appContext.config.warnRecursiveComputed&&(t._warnRecursive=!0)}return t};function Xk(){if(process.env.NODE_ENV==="production"||typeof window>"u")return;const n={style:"color:#3ba776"},e={style:"color:#1677ff"},t={style:"color:#f5222d"},r={style:"color:#eb2f96"},i={__vue_custom_formatter:!0,header(p){return ot(p)?p.__isVue?["div",n,"VueInstance"]:Ke(p)?["div",{},["span",n,m(p)],"<",c("_value"in p?p._value:p),">"]:ci(p)?["div",{},["span",n,pt(p)?"ShallowReactive":"Reactive"],"<",c(p),`>${Mn(p)?" (readonly)":""}`]:Mn(p)?["div",{},["span",n,pt(p)?"ShallowReadonly":"Readonly"],"<",c(p),">"]:null:null},hasBody(p){return p&&p.__isVue},body(p){if(p&&p.__isVue)return["div",{},...o(p.$)]}};function o(p){const y=[];p.type.props&&p.props&&y.push(a("props",ae(p.props))),p.setupState!==Pt&&y.push(a("setup",p.setupState)),p.data!==Pt&&y.push(a("data",ae(p.data)));const S=f(p,"computed");S&&y.push(a("computed",S));const _=f(p,"inject");return _&&y.push(a("injected",_)),y.push(["div",{},["span",{style:r.style+";opacity:0.66"},"$ (internal): "],["object",{object:p}]]),y}function a(p,y){return y=wt({},y),Object.keys(y).length?["div",{style:"line-height:1.25em;margin-bottom:0.6em"},["div",{style:"color:#476582"},p],["div",{style:"padding-left:1.25em"},...Object.keys(y).map(S=>["div",{},["span",r,S+": "],c(y[S],!1)])]]:["span",{}]}function c(p,y=!0){return typeof p=="number"?["span",e,p]:typeof p=="string"?["span",t,JSON.stringify(p)]:typeof p=="boolean"?["span",r,p]:ot(p)?["object",{object:y?ae(p):p}]:["span",t,String(p)]}function f(p,y){const S=p.type;if(Ne(S))return;const _={};for(const C in p.ctx)h(S,C,y)&&(_[C]=p.ctx[C]);return _}function h(p,y,S){const _=p[S];if(ke(_)&&_.includes(y)||ot(_)&&y in _||p.extends&&h(p.extends,y,S)||p.mixins&&p.mixins.some(C=>h(C,y,S)))return!0}function m(p){return pt(p)?"ShallowRef":p.effect?"ComputedRef":"Ref"}window.devtoolsFormatters?window.devtoolsFormatters.push(i):window.devtoolsFormatters=[i]}process.env.NODE_ENV,process.env.NODE_ENV,process.env.NODE_ENV;function Zk(){Xk()}process.env.NODE_ENV!=="production"&&Zk();function Ge(n){this.content=n}Ge.prototype={constructor:Ge,find:function(n){for(var e=0;e<this.content.length;e+=2)if(this.content[e]===n)return e;return-1},get:function(n){var e=this.find(n);return e==-1?void 0:this.content[e+1]},update:function(n,e,t){var r=t&&t!=n?this.remove(t):this,i=r.find(n),o=r.content.slice();return i==-1?o.push(t||n,e):(o[i+1]=e,t&&(o[i]=t)),new Ge(o)},remove:function(n){var e=this.find(n);if(e==-1)return this;var t=this.content.slice();return t.splice(e,2),new Ge(t)},addToStart:function(n,e){return new Ge([n,e].concat(this.remove(n).content))},addToEnd:function(n,e){var t=this.remove(n).content.slice();return t.push(n,e),new Ge(t)},addBefore:function(n,e,t){var r=this.remove(e),i=r.content.slice(),o=r.find(n);return i.splice(o==-1?i.length:o,0,e,t),new Ge(i)},forEach:function(n){for(var e=0;e<this.content.length;e+=2)n(this.content[e],this.content[e+1])},prepend:function(n){return n=Ge.from(n),n.size?new Ge(n.content.concat(this.subtract(n).content)):this},append:function(n){return n=Ge.from(n),n.size?new Ge(this.subtract(n).content.concat(n.content)):this},subtract:function(n){var e=this;n=Ge.from(n);for(var t=0;t<n.content.length;t+=2)e=e.remove(n.content[t]);return e},get size(){return this.content.length>>1}},Ge.from=function(n){if(n instanceof Ge)return n;var e=[];if(n)for(var t in n)e.push(t,n[t]);return new Ge(e)};function qp(n,e,t){for(let r=0;;r++){if(r==n.childCount||r==e.childCount)return n.childCount==e.childCount?null:t;let i=n.child(r),o=e.child(r);if(i==o){t+=i.nodeSize;continue}if(!i.sameMarkup(o))return t;if(i.isText&&i.text!=o.text){for(let a=0;i.text[a]==o.text[a];a++)t++;return t}if(i.content.size||o.content.size){let a=qp(i.content,o.content,t+1);if(a!=null)return a}t+=i.nodeSize}}function Jp(n,e,t,r){for(let i=n.childCount,o=e.childCount;;){if(i==0||o==0)return i==o?null:{a:t,b:r};let a=n.child(--i),c=e.child(--o),f=a.nodeSize;if(a==c){t-=f,r-=f;continue}if(!a.sameMarkup(c))return{a:t,b:r};if(a.isText&&a.text!=c.text){let h=0,m=Math.min(a.text.length,c.text.length);for(;h<m&&a.text[a.text.length-h-1]==c.text[c.text.length-h-1];)h++,t--,r--;return{a:t,b:r}}if(a.content.size||c.content.size){let h=Jp(a.content,c.content,t-1,r-1);if(h)return h}t-=f,r-=f}}class L{constructor(e,t){if(this.content=e,this.size=t||0,t==null)for(let r=0;r<e.length;r++)this.size+=e[r].nodeSize}nodesBetween(e,t,r,i=0,o){for(let a=0,c=0;c<t;a++){let f=this.content[a],h=c+f.nodeSize;if(h>e&&r(f,i+c,o||null,a)!==!1&&f.content.size){let m=c+1;f.nodesBetween(Math.max(0,e-m),Math.min(f.content.size,t-m),r,i+m)}c=h}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,t,r,i){let o="",a=!0;return this.nodesBetween(e,t,(c,f)=>{c.isText?(o+=c.text.slice(Math.max(e,f)-f,t-f),a=!r):c.isLeaf?(i?o+=typeof i=="function"?i(c):i:c.type.spec.leafText&&(o+=c.type.spec.leafText(c)),a=!r):!a&&c.isBlock&&(o+=r,a=!0)},0),o}append(e){if(!e.size)return this;if(!this.size)return e;let t=this.lastChild,r=e.firstChild,i=this.content.slice(),o=0;for(t.isText&&t.sameMarkup(r)&&(i[i.length-1]=t.withText(t.text+r.text),o=1);o<e.content.length;o++)i.push(e.content[o]);return new L(i,this.size+e.size)}cut(e,t=this.size){if(e==0&&t==this.size)return this;let r=[],i=0;if(t>e)for(let o=0,a=0;a<t;o++){let c=this.content[o],f=a+c.nodeSize;f>e&&((a<e||f>t)&&(c.isText?c=c.cut(Math.max(0,e-a),Math.min(c.text.length,t-a)):c=c.cut(Math.max(0,e-a-1),Math.min(c.content.size,t-a-1))),r.push(c),i+=c.nodeSize),a=f}return new L(r,i)}cutByIndex(e,t){return e==t?L.empty:e==0&&t==this.content.length?this:new L(this.content.slice(e,t))}replaceChild(e,t){let r=this.content[e];if(r==t)return this;let i=this.content.slice(),o=this.size+t.nodeSize-r.nodeSize;return i[e]=t,new L(i,o)}addToStart(e){return new L([e].concat(this.content),this.size+e.nodeSize)}addToEnd(e){return new L(this.content.concat(e),this.size+e.nodeSize)}eq(e){if(this.content.length!=e.content.length)return!1;for(let t=0;t<this.content.length;t++)if(!this.content[t].eq(e.content[t]))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 t=this.content[e];if(!t)throw new RangeError("Index "+e+" out of range for "+this);return t}maybeChild(e){return this.content[e]||null}forEach(e){for(let t=0,r=0;t<this.content.length;t++){let i=this.content[t];e(i,r,t),r+=i.nodeSize}}findDiffStart(e,t=0){return qp(this,e,t)}findDiffEnd(e,t=this.size,r=e.size){return Jp(this,e,t,r)}findIndex(e,t=-1){if(e==0)return Zo(0,e);if(e==this.size)return Zo(this.content.length,e);if(e>this.size||e<0)throw new RangeError(`Position ${e} outside of fragment (${this})`);for(let r=0,i=0;;r++){let o=this.child(r),a=i+o.nodeSize;if(a>=e)return a==e||t>0?Zo(r+1,a):Zo(r,i);i=a}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map(e=>e.toJSON()):null}static fromJSON(e,t){if(!t)return L.empty;if(!Array.isArray(t))throw new RangeError("Invalid input for Fragment.fromJSON");return new L(t.map(e.nodeFromJSON))}static fromArray(e){if(!e.length)return L.empty;let t,r=0;for(let i=0;i<e.length;i++){let o=e[i];r+=o.nodeSize,i&&o.isText&&e[i-1].sameMarkup(o)?(t||(t=e.slice(0,i)),t[t.length-1]=o.withText(t[t.length-1].text+o.text)):t&&t.push(o)}return new L(t||e,r)}static from(e){if(!e)return L.empty;if(e instanceof L)return e;if(Array.isArray(e))return this.fromArray(e);if(e.attrs)return new L([e],e.nodeSize);throw new RangeError("Can not convert "+e+" to a Fragment"+(e.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}}L.empty=new L([],0);const Gc={index:0,offset:0};function Zo(n,e){return Gc.index=n,Gc.offset=e,Gc}function Qo(n,e){if(n===e)return!0;if(!(n&&typeof n=="object")||!(e&&typeof e=="object"))return!1;let t=Array.isArray(n);if(Array.isArray(e)!=t)return!1;if(t){if(n.length!=e.length)return!1;for(let r=0;r<n.length;r++)if(!Qo(n[r],e[r]))return!1}else{for(let r in n)if(!(r in e)||!Qo(n[r],e[r]))return!1;for(let r in e)if(!(r in n))return!1}return!0}let we=class bf{constructor(e,t){this.type=e,this.attrs=t}addToSet(e){let t,r=!1;for(let i=0;i<e.length;i++){let o=e[i];if(this.eq(o))return e;if(this.type.excludes(o.type))t||(t=e.slice(0,i));else{if(o.type.excludes(this.type))return e;!r&&o.type.rank>this.type.rank&&(t||(t=e.slice(0,i)),t.push(this),r=!0),t&&t.push(o)}}return t||(t=e.slice()),r||t.push(this),t}removeFromSet(e){for(let t=0;t<e.length;t++)if(this.eq(e[t]))return e.slice(0,t).concat(e.slice(t+1));return e}isInSet(e){for(let t=0;t<e.length;t++)if(this.eq(e[t]))return!0;return!1}eq(e){return this==e||this.type==e.type&&Qo(this.attrs,e.attrs)}toJSON(){let e={type:this.type.name};for(let t in this.attrs){e.attrs=this.attrs;break}return e}static fromJSON(e,t){if(!t)throw new RangeError("Invalid input for Mark.fromJSON");let r=e.marks[t.type];if(!r)throw new RangeError(`There is no mark type ${t.type} in this schema`);return r.create(t.attrs)}static sameSet(e,t){if(e==t)return!0;if(e.length!=t.length)return!1;for(let r=0;r<e.length;r++)if(!e[r].eq(t[r]))return!1;return!0}static setFrom(e){if(!e||Array.isArray(e)&&e.length==0)return bf.none;if(e instanceof bf)return[e];let t=e.slice();return t.sort((r,i)=>r.type.rank-i.type.rank),t}};we.none=[];class el extends Error{}class H{constructor(e,t,r){this.content=e,this.openStart=t,this.openEnd=r}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(e,t){let r=Yp(this.content,e+this.openStart,t);return r&&new H(r,this.openStart,this.openEnd)}removeBetween(e,t){return new H(jp(this.content,e+this.openStart,t+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,t){if(!t)return H.empty;let r=t.openStart||0,i=t.openEnd||0;if(typeof r!="number"||typeof i!="number")throw new RangeError("Invalid input for Slice.fromJSON");return new H(L.fromJSON(e,t.content),r,i)}static maxOpen(e,t=!0){let r=0,i=0;for(let o=e.firstChild;o&&!o.isLeaf&&(t||!o.type.spec.isolating);o=o.firstChild)r++;for(let o=e.lastChild;o&&!o.isLeaf&&(t||!o.type.spec.isolating);o=o.lastChild)i++;return new H(e,r,i)}}H.empty=new H(L.empty,0,0);function jp(n,e,t){let{index:r,offset:i}=n.findIndex(e),o=n.maybeChild(r),{index:a,offset:c}=n.findIndex(t);if(i==e||o.isText){if(c!=t&&!n.child(a).isText)throw new RangeError("Removing non-flat range");return n.cut(0,e).append(n.cut(t))}if(r!=a)throw new RangeError("Removing non-flat range");return n.replaceChild(r,o.copy(jp(o.content,e-i-1,t-i-1)))}function Yp(n,e,t,r){let{index:i,offset:o}=n.findIndex(e),a=n.maybeChild(i);if(o==e||a.isText)return n.cut(0,e).append(t).append(n.cut(e));let c=Yp(a.content,e-o-1,t);return c&&n.replaceChild(i,a.copy(c))}function Qk(n,e,t){if(t.openStart>n.depth)throw new el("Inserted content deeper than insertion position");if(n.depth-t.openStart!=e.depth-t.openEnd)throw new el("Inconsistent open depths");return Xp(n,e,t,0)}function Xp(n,e,t,r){let i=n.index(r),o=n.node(r);if(i==e.index(r)&&r<n.depth-t.openStart){let a=Xp(n,e,t,r+1);return o.copy(o.content.replaceChild(i,a))}else if(t.content.size)if(!t.openStart&&!t.openEnd&&n.depth==r&&e.depth==r){let a=n.parent,c=a.content;return kr(a,c.cut(0,n.parentOffset).append(t.content).append(c.cut(e.parentOffset)))}else{let{start:a,end:c}=eE(t,n);return kr(o,Qp(n,a,c,e,r))}else return kr(o,tl(n,e,r))}function Zp(n,e){if(!e.type.compatibleContent(n.type))throw new el("Cannot join "+e.type.name+" onto "+n.type.name)}function qc(n,e,t){let r=n.node(t);return Zp(r,e.node(t)),r}function _r(n,e){let t=e.length-1;t>=0&&n.isText&&n.sameMarkup(e[t])?e[t]=n.withText(e[t].text+n.text):e.push(n)}function bs(n,e,t,r){let i=(e||n).node(t),o=0,a=e?e.index(t):i.childCount;n&&(o=n.index(t),n.depth>t?o++:n.textOffset&&(_r(n.nodeAfter,r),o++));for(let c=o;c<a;c++)_r(i.child(c),r);e&&e.depth==t&&e.textOffset&&_r(e.nodeBefore,r)}function kr(n,e){return n.type.checkContent(e),n.copy(e)}function Qp(n,e,t,r,i){let o=n.depth>i&&qc(n,e,i+1),a=r.depth>i&&qc(t,r,i+1),c=[];return bs(null,n,i,c),o&&a&&e.index(i)==t.index(i)?(Zp(o,a),_r(kr(o,Qp(n,e,t,r,i+1)),c)):(o&&_r(kr(o,tl(n,e,i+1)),c),bs(e,t,i,c),a&&_r(kr(a,tl(t,r,i+1)),c)),bs(r,null,i,c),new L(c)}function tl(n,e,t){let r=[];if(bs(null,n,t,r),n.depth>t){let i=qc(n,e,t+1);_r(kr(i,tl(n,e,t+1)),r)}return bs(e,null,t,r),new L(r)}function eE(n,e){let t=e.depth-n.openStart,i=e.node(t).copy(n.content);for(let o=t-1;o>=0;o--)i=e.node(o).copy(L.from(i));return{start:i.resolveNoCache(n.openStart+t),end:i.resolveNoCache(i.content.size-n.openEnd-t)}}class Ds{constructor(e,t,r){this.pos=e,this.path=t,this.parentOffset=r,this.depth=t.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,t=this.index(this.depth);if(t==e.childCount)return null;let r=this.pos-this.path[this.path.length-1],i=e.child(t);return r?e.child(t).cut(r):i}get nodeBefore(){let e=this.index(this.depth),t=this.pos-this.path[this.path.length-1];return t?this.parent.child(e).cut(0,t):e==0?null:this.parent.child(e-1)}posAtIndex(e,t){t=this.resolveDepth(t);let r=this.path[t*3],i=t==0?0:this.path[t*3-1]+1;for(let o=0;o<e;o++)i+=r.child(o).nodeSize;return i}marks(){let e=this.parent,t=this.index();if(e.content.size==0)return we.none;if(this.textOffset)return e.child(t).marks;let r=e.maybeChild(t-1),i=e.maybeChild(t);if(!r){let c=r;r=i,i=c}let o=r.marks;for(var a=0;a<o.length;a++)o[a].type.spec.inclusive===!1&&(!i||!o[a].isInSet(i.marks))&&(o=o[a--].removeFromSet(o));return o}marksAcross(e){let t=this.parent.maybeChild(this.index());if(!t||!t.isInline)return null;let r=t.marks,i=e.parent.maybeChild(e.index());for(var o=0;o<r.length;o++)r[o].type.spec.inclusive===!1&&(!i||!r[o].isInSet(i.marks))&&(r=r[o--].removeFromSet(r));return r}sharedDepth(e){for(let t=this.depth;t>0;t--)if(this.start(t)<=e&&this.end(t)>=e)return t;return 0}blockRange(e=this,t){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)&&(!t||t(this.node(r))))return new nl(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 t=1;t<=this.depth;t++)e+=(e?"/":"")+this.node(t).type.name+"_"+this.index(t-1);return e+":"+this.parentOffset}static resolve(e,t){if(!(t>=0&&t<=e.content.size))throw new RangeError("Position "+t+" out of range");let r=[],i=0,o=t;for(let a=e;;){let{index:c,offset:f}=a.content.findIndex(o),h=o-f;if(r.push(a,c,i+f),!h||(a=a.child(c),a.isText))break;o=h-1,i+=f+1}return new Ds(t,r,o)}static resolveCached(e,t){for(let i=0;i<Jc.length;i++){let o=Jc[i];if(o.pos==t&&o.doc==e)return o}let r=Jc[jc]=Ds.resolve(e,t);return jc=(jc+1)%tE,r}}let Jc=[],jc=0,tE=12;class nl{constructor(e,t,r){this.$from=e,this.$to=t,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 nE=Object.create(null);let Er=class vf{constructor(e,t,r,i=we.none){this.type=e,this.attrs=t,this.marks=i,this.content=r||L.empty}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,t,r,i=0){this.content.nodesBetween(e,t,r,i,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,t,r,i){return this.content.textBetween(e,t,r,i)}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,t,r){return this.type==e&&Qo(this.attrs,t||e.defaultAttrs||nE)&&we.sameSet(this.marks,r||we.none)}copy(e=null){return e==this.content?this:new vf(this.type,this.attrs,e,this.marks)}mark(e){return e==this.marks?this:new vf(this.type,this.attrs,this.content,e)}cut(e,t=this.content.size){return e==0&&t==this.content.size?this:this.copy(this.content.cut(e,t))}slice(e,t=this.content.size,r=!1){if(e==t)return H.empty;let i=this.resolve(e),o=this.resolve(t),a=r?0:i.sharedDepth(t),c=i.start(a),h=i.node(a).content.cut(i.pos-c,o.pos-c);return new H(h,i.depth-a,o.depth-a)}replace(e,t,r){return Qk(this.resolve(e),this.resolve(t),r)}nodeAt(e){for(let t=this;;){let{index:r,offset:i}=t.content.findIndex(e);if(t=t.maybeChild(r),!t)return null;if(i==e||t.isText)return t;e-=i+1}}childAfter(e){let{index:t,offset:r}=this.content.findIndex(e);return{node:this.content.maybeChild(t),index:t,offset:r}}childBefore(e){if(e==0)return{node:null,index:0,offset:0};let{index:t,offset:r}=this.content.findIndex(e);if(r<e)return{node:this.content.child(t),index:t,offset:r};let i=this.content.child(t-1);return{node:i,index:t-1,offset:r-i.nodeSize}}resolve(e){return Ds.resolveCached(this,e)}resolveNoCache(e){return Ds.resolve(this,e)}rangeHasMark(e,t,r){let i=!1;return t>e&&this.nodesBetween(e,t,o=>(r.isInSet(o.marks)&&(i=!0),!i)),i}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()+")"),em(this.marks,e)}contentMatchAt(e){let t=this.type.contentMatch.matchFragment(this.content,0,e);if(!t)throw new Error("Called contentMatchAt on a node with invalid content");return t}canReplace(e,t,r=L.empty,i=0,o=r.childCount){let a=this.contentMatchAt(e).matchFragment(r,i,o),c=a&&a.matchFragment(this.content,t);if(!c||!c.validEnd)return!1;for(let f=i;f<o;f++)if(!this.type.allowsMarks(r.child(f).marks))return!1;return!0}canReplaceWith(e,t,r,i){if(i&&!this.type.allowsMarks(i))return!1;let o=this.contentMatchAt(e).matchType(r),a=o&&o.matchFragment(this.content,t);return a?a.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);let e=we.none;for(let t=0;t<this.marks.length;t++)e=this.marks[t].addToSet(e);if(!we.sameSet(e,this.marks))throw new RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map(t=>t.type.name)}`);this.content.forEach(t=>t.check())}toJSON(){let e={type:this.type.name};for(let t 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(t=>t.toJSON())),e}static fromJSON(e,t){if(!t)throw new RangeError("Invalid input for Node.fromJSON");let r=null;if(t.marks){if(!Array.isArray(t.marks))throw new RangeError("Invalid mark data for Node.fromJSON");r=t.marks.map(e.markFromJSON)}if(t.type=="text"){if(typeof t.text!="string")throw new RangeError("Invalid text node in JSON");return e.text(t.text,r)}let i=L.fromJSON(e,t.content);return e.nodeType(t.type).create(t.attrs,i,r)}};Er.prototype.text=void 0;class ql extends Er{constructor(e,t,r,i){if(super(e,t,null,i),!r)throw new RangeError("Empty text nodes are not allowed");this.text=r}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):em(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(e,t){return this.text.slice(e,t)}get nodeSize(){return this.text.length}mark(e){return e==this.marks?this:new ql(this.type,this.attrs,this.text,e)}withText(e){return e==this.text?this:new ql(this.type,this.attrs,e,this.marks)}cut(e=0,t=this.text.length){return e==0&&t==this.text.length?this:this.withText(this.text.slice(e,t))}eq(e){return this.sameMarkup(e)&&this.text==e.text}toJSON(){let e=super.toJSON();return e.text=this.text,e}}function em(n,e){for(let t=n.length-1;t>=0;t--)e=n[t].type.name+"("+e+")";return e}class Br{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(e,t){let r=new rE(e,t);if(r.next==null)return Br.empty;let i=tm(r);r.next&&r.err("Unexpected trailing text");let o=uE(cE(i));return fE(o,r),o}matchType(e){for(let t=0;t<this.next.length;t++)if(this.next[t].type==e)return this.next[t].next;return null}matchFragment(e,t=0,r=e.childCount){let i=this;for(let o=t;i&&o<r;o++)i=i.matchType(e.child(o).type);return i}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:t}=this.next[e];if(!(t.isText||t.hasRequiredAttrs()))return t}return null}compatible(e){for(let t=0;t<this.next.length;t++)for(let r=0;r<e.next.length;r++)if(this.next[t].type==e.next[r].type)return!0;return!1}fillBefore(e,t=!1,r=0){let i=[this];function o(a,c){let f=a.matchFragment(e,r);if(f&&(!t||f.validEnd))return L.from(c.map(h=>h.createAndFill()));for(let h=0;h<a.next.length;h++){let{type:m,next:p}=a.next[h];if(!(m.isText||m.hasRequiredAttrs())&&i.indexOf(p)==-1){i.push(p);let y=o(p,c.concat(m));if(y)return y}}return null}return o(this,[])}findWrapping(e){for(let r=0;r<this.wrapCache.length;r+=2)if(this.wrapCache[r]==e)return this.wrapCache[r+1];let t=this.computeWrapping(e);return this.wrapCache.push(e,t),t}computeWrapping(e){let t=Object.create(null),r=[{match:this,type:null,via:null}];for(;r.length;){let i=r.shift(),o=i.match;if(o.matchType(e)){let a=[];for(let c=i;c.type;c=c.via)a.push(c.type);return a.reverse()}for(let a=0;a<o.next.length;a++){let{type:c,next:f}=o.next[a];!c.isLeaf&&!c.hasRequiredAttrs()&&!(c.name in t)&&(!i.type||f.validEnd)&&(r.push({match:c.contentMatch,type:c,via:i}),t[c.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 t(r){e.push(r);for(let i=0;i<r.next.length;i++)e.indexOf(r.next[i].next)==-1&&t(r.next[i].next)}return t(this),e.map((r,i)=>{let o=i+(r.validEnd?"*":" ")+" ";for(let a=0;a<r.next.length;a++)o+=(a?", ":"")+r.next[a].type.name+"->"+e.indexOf(r.next[a].next);return o}).join(`
6
+ `)}}Br.empty=new Br(!0);class rE{constructor(e,t){this.string=e,this.nodeTypes=t,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 tm(n){let e=[];do e.push(iE(n));while(n.eat("|"));return e.length==1?e[0]:{type:"choice",exprs:e}}function iE(n){let e=[];do e.push(sE(n));while(n.next&&n.next!=")"&&n.next!="|");return e.length==1?e[0]:{type:"seq",exprs:e}}function sE(n){let e=aE(n);for(;;)if(n.eat("+"))e={type:"plus",expr:e};else if(n.eat("*"))e={type:"star",expr:e};else if(n.eat("?"))e={type:"opt",expr:e};else if(n.eat("{"))e=oE(n,e);else break;return e}function nm(n){/\D/.test(n.next)&&n.err("Expected number, got '"+n.next+"'");let e=Number(n.next);return n.pos++,e}function oE(n,e){let t=nm(n),r=t;return n.eat(",")&&(n.next!="}"?r=nm(n):r=-1),n.eat("}")||n.err("Unclosed braced range"),{type:"range",min:t,max:r,expr:e}}function lE(n,e){let t=n.nodeTypes,r=t[e];if(r)return[r];let i=[];for(let o in t){let a=t[o];a.groups.indexOf(e)>-1&&i.push(a)}return i.length==0&&n.err("No node type or group '"+e+"' found"),i}function aE(n){if(n.eat("(")){let e=tm(n);return n.eat(")")||n.err("Missing closing paren"),e}else if(/\W/.test(n.next))n.err("Unexpected token '"+n.next+"'");else{let e=lE(n,n.next).map(t=>(n.inline==null?n.inline=t.isInline:n.inline!=t.isInline&&n.err("Mixing inline and block content"),{type:"name",value:t}));return n.pos++,e.length==1?e[0]:{type:"choice",exprs:e}}}function cE(n){let e=[[]];return i(o(n,0),t()),e;function t(){return e.push([])-1}function r(a,c,f){let h={term:f,to:c};return e[a].push(h),h}function i(a,c){a.forEach(f=>f.to=c)}function o(a,c){if(a.type=="choice")return a.exprs.reduce((f,h)=>f.concat(o(h,c)),[]);if(a.type=="seq")for(let f=0;;f++){let h=o(a.exprs[f],c);if(f==a.exprs.length-1)return h;i(h,c=t())}else if(a.type=="star"){let f=t();return r(c,f),i(o(a.expr,f),f),[r(f)]}else if(a.type=="plus"){let f=t();return i(o(a.expr,c),f),i(o(a.expr,f),f),[r(f)]}else{if(a.type=="opt")return[r(c)].concat(o(a.expr,c));if(a.type=="range"){let f=c;for(let h=0;h<a.min;h++){let m=t();i(o(a.expr,f),m),f=m}if(a.max==-1)i(o(a.expr,f),f);else for(let h=a.min;h<a.max;h++){let m=t();r(f,m),i(o(a.expr,f),m),f=m}return[r(f)]}else{if(a.type=="name")return[r(c,void 0,a.value)];throw new Error("Unknown expr type")}}}}function rm(n,e){return e-n}function im(n,e){let t=[];return r(e),t.sort(rm);function r(i){let o=n[i];if(o.length==1&&!o[0].term)return r(o[0].to);t.push(i);for(let a=0;a<o.length;a++){let{term:c,to:f}=o[a];!c&&t.indexOf(f)==-1&&r(f)}}}function uE(n){let e=Object.create(null);return t(im(n,0));function t(r){let i=[];r.forEach(a=>{n[a].forEach(({term:c,to:f})=>{if(!c)return;let h;for(let m=0;m<i.length;m++)i[m][0]==c&&(h=i[m][1]);im(n,f).forEach(m=>{h||i.push([c,h=[]]),h.indexOf(m)==-1&&h.push(m)})})});let o=e[r.join(",")]=new Br(r.indexOf(n.length-1)>-1);for(let a=0;a<i.length;a++){let c=i[a][1].sort(rm);o.next.push({type:i[a][0],next:e[c.join(",")]||t(c)})}return o}}function fE(n,e){for(let t=0,r=[n];t<r.length;t++){let i=r[t],o=!i.validEnd,a=[];for(let c=0;c<i.next.length;c++){let{type:f,next:h}=i.next[c];a.push(f.name),o&&!(f.isText||f.hasRequiredAttrs())&&(o=!1),r.indexOf(h)==-1&&r.push(h)}o&&e.err("Only non-generatable nodes ("+a.join(", ")+") in a required position (see https://prosemirror.net/docs/guide/#generatable)")}}function sm(n){let e=Object.create(null);for(let t in n){let r=n[t];if(!r.hasDefault)return null;e[t]=r.default}return e}function om(n,e){let t=Object.create(null);for(let r in n){let i=e&&e[r];if(i===void 0){let o=n[r];if(o.hasDefault)i=o.default;else throw new RangeError("No value supplied for attribute "+r)}t[r]=i}return t}function lm(n){let e=Object.create(null);if(n)for(let t in n)e[t]=new dE(n[t]);return e}let am=class w0{constructor(e,t,r){this.name=e,this.schema=t,this.spec=r,this.markSet=null,this.groups=r.group?r.group.split(" "):[],this.attrs=lm(r.attrs),this.defaultAttrs=sm(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==Br.empty}get isAtom(){return this.isLeaf||!!this.spec.atom}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:om(this.attrs,e)}create(e=null,t,r){if(this.isText)throw new Error("NodeType.create can't construct text nodes");return new Er(this,this.computeAttrs(e),L.from(t),we.setFrom(r))}createChecked(e=null,t,r){return t=L.from(t),this.checkContent(t),new Er(this,this.computeAttrs(e),t,we.setFrom(r))}createAndFill(e=null,t,r){if(e=this.computeAttrs(e),t=L.from(t),t.size){let a=this.contentMatch.fillBefore(t);if(!a)return null;t=a.append(t)}let i=this.contentMatch.matchFragment(t),o=i&&i.fillBefore(L.empty,!0);return o?new Er(this,e,t.append(o),we.setFrom(r)):null}validContent(e){let t=this.contentMatch.matchFragment(e);if(!t||!t.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)}`)}allowsMarkType(e){return this.markSet==null||this.markSet.indexOf(e)>-1}allowsMarks(e){if(this.markSet==null)return!0;for(let t=0;t<e.length;t++)if(!this.allowsMarkType(e[t].type))return!1;return!0}allowedMarks(e){if(this.markSet==null)return e;let t;for(let r=0;r<e.length;r++)this.allowsMarkType(e[r].type)?t&&t.push(e[r]):t||(t=e.slice(0,r));return t?t.length?t:we.none:e}static compile(e,t){let r=Object.create(null);e.forEach((o,a)=>r[o]=new w0(o,t,a));let i=t.spec.topNode||"doc";if(!r[i])throw new RangeError("Schema is missing its top node type ('"+i+"')");if(!r.text)throw new RangeError("Every schema needs a 'text' type");for(let o in r.text.attrs)throw new RangeError("The text node type should not have attributes");return r}};class dE{constructor(e){this.hasDefault=Object.prototype.hasOwnProperty.call(e,"default"),this.default=e.default}get isRequired(){return!this.hasDefault}}class Jl{constructor(e,t,r,i){this.name=e,this.rank=t,this.schema=r,this.spec=i,this.attrs=lm(i.attrs),this.excluded=null;let o=sm(this.attrs);this.instance=o?new we(this,o):null}create(e=null){return!e&&this.instance?this.instance:new we(this,om(this.attrs,e))}static compile(e,t){let r=Object.create(null),i=0;return e.forEach((o,a)=>r[o]=new Jl(o,i++,t,a)),r}removeFromSet(e){for(var t=0;t<e.length;t++)e[t].type==this&&(e=e.slice(0,t).concat(e.slice(t+1)),t--);return e}isInSet(e){for(let t=0;t<e.length;t++)if(e[t].type==this)return e[t]}excludes(e){return this.excluded.indexOf(e)>-1}}class hE{constructor(e){this.cached=Object.create(null);let t=this.spec={};for(let i in e)t[i]=e[i];t.nodes=Ge.from(e.nodes),t.marks=Ge.from(e.marks||{}),this.nodes=am.compile(this.spec.nodes,this),this.marks=Jl.compile(this.spec.marks,this);let r=Object.create(null);for(let i in this.nodes){if(i in this.marks)throw new RangeError(i+" can not be both a node and a mark");let o=this.nodes[i],a=o.spec.content||"",c=o.spec.marks;o.contentMatch=r[a]||(r[a]=Br.parse(a,this.nodes)),o.inlineContent=o.contentMatch.inlineContent,o.markSet=c=="_"?null:c?cm(this,c.split(" ")):c==""||!o.inlineContent?[]:null}for(let i in this.marks){let o=this.marks[i],a=o.spec.excludes;o.excluded=a==null?[o]:a==""?[]:cm(this,a.split(" "))}this.nodeFromJSON=this.nodeFromJSON.bind(this),this.markFromJSON=this.markFromJSON.bind(this),this.topNodeType=this.nodes[this.spec.topNode||"doc"],this.cached.wrappings=Object.create(null)}node(e,t=null,r,i){if(typeof e=="string")e=this.nodeType(e);else if(e instanceof am){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(t,r,i)}text(e,t){let r=this.nodes.text;return new ql(r,r.defaultAttrs,e,we.setFrom(t))}mark(e,t){return typeof e=="string"&&(e=this.marks[e]),e.create(t)}nodeFromJSON(e){return Er.fromJSON(this,e)}markFromJSON(e){return we.fromJSON(this,e)}nodeType(e){let t=this.nodes[e];if(!t)throw new RangeError("Unknown node type: "+e);return t}}function cm(n,e){let t=[];for(let r=0;r<e.length;r++){let i=e[r],o=n.marks[i],a=o;if(o)t.push(o);else for(let c in n.marks){let f=n.marks[c];(i=="_"||f.spec.group&&f.spec.group.split(" ").indexOf(i)>-1)&&t.push(a=f)}if(!a)throw new SyntaxError("Unknown mark type: '"+e[r]+"'")}return t}let Yc=class Sf{constructor(e,t){this.schema=e,this.rules=t,this.tags=[],this.styles=[],t.forEach(r=>{r.tag?this.tags.push(r):r.style&&this.styles.push(r)}),this.normalizeLists=!this.tags.some(r=>{if(!/^(ul|ol)\b/.test(r.tag)||!r.node)return!1;let i=e.nodes[r.node];return i.contentMatch.matchType(i)})}parse(e,t={}){let r=new hm(this,t,!1);return r.addAll(e,t.from,t.to),r.finish()}parseSlice(e,t={}){let r=new hm(this,t,!0);return r.addAll(e,t.from,t.to),H.maxOpen(r.finish())}matchTag(e,t,r){for(let i=r?this.tags.indexOf(r)+1:0;i<this.tags.length;i++){let o=this.tags[i];if(gE(e,o.tag)&&(o.namespace===void 0||e.namespaceURI==o.namespace)&&(!o.context||t.matchesContext(o.context))){if(o.getAttrs){let a=o.getAttrs(e);if(a===!1)continue;o.attrs=a||void 0}return o}}}matchStyle(e,t,r,i){for(let o=i?this.styles.indexOf(i)+1:0;o<this.styles.length;o++){let a=this.styles[o],c=a.style;if(!(c.indexOf(e)!=0||a.context&&!r.matchesContext(a.context)||c.length>e.length&&(c.charCodeAt(e.length)!=61||c.slice(e.length+1)!=t))){if(a.getAttrs){let f=a.getAttrs(t);if(f===!1)continue;a.attrs=f||void 0}return a}}}static schemaRules(e){let t=[];function r(i){let o=i.priority==null?50:i.priority,a=0;for(;a<t.length;a++){let c=t[a];if((c.priority==null?50:c.priority)<o)break}t.splice(a,0,i)}for(let i in e.marks){let o=e.marks[i].spec.parseDOM;o&&o.forEach(a=>{r(a=pm(a)),a.mark||a.ignore||a.clearMark||(a.mark=i)})}for(let i in e.nodes){let o=e.nodes[i].spec.parseDOM;o&&o.forEach(a=>{r(a=pm(a)),a.node||a.ignore||a.mark||(a.node=i)})}return t}static fromSchema(e){return e.cached.domParser||(e.cached.domParser=new Sf(e,Sf.schemaRules(e)))}};const um={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},pE={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},fm={ol:!0,ul:!0},rl=1,il=2,vs=4;function dm(n,e,t){return e!=null?(e?rl:0)|(e==="full"?il:0):n&&n.whitespace=="pre"?rl|il:t&~vs}class sl{constructor(e,t,r,i,o,a,c){this.type=e,this.attrs=t,this.marks=r,this.pendingMarks=i,this.solid=o,this.options=c,this.content=[],this.activeMarks=we.none,this.stashMarks=[],this.match=a||(c&vs?null:e.contentMatch)}findWrapping(e){if(!this.match){if(!this.type)return[];let t=this.type.contentMatch.fillBefore(L.from(e));if(t)this.match=this.type.contentMatch.matchFragment(t);else{let r=this.type.contentMatch,i;return(i=r.findWrapping(e.type))?(this.match=r,i):null}}return this.match.findWrapping(e.type)}finish(e){if(!(this.options&rl)){let r=this.content[this.content.length-1],i;if(r&&r.isText&&(i=/[ \t\r\n\u000c]+$/.exec(r.text))){let o=r;r.text.length==i[0].length?this.content.pop():this.content[this.content.length-1]=o.withText(o.text.slice(0,o.text.length-i[0].length))}}let t=L.from(this.content);return!e&&this.match&&(t=t.append(this.match.fillBefore(L.empty,!0))),this.type?this.type.create(this.attrs,t,this.marks):t}popFromStashMark(e){for(let t=this.stashMarks.length-1;t>=0;t--)if(e.eq(this.stashMarks[t]))return this.stashMarks.splice(t,1)[0]}applyPending(e){for(let t=0,r=this.pendingMarks;t<r.length;t++){let i=r[t];(this.type?this.type.allowsMarkType(i.type):bE(i.type,e))&&!i.isInSet(this.activeMarks)&&(this.activeMarks=i.addToSet(this.activeMarks),this.pendingMarks=i.removeFromSet(this.pendingMarks))}}inlineContext(e){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:e.parentNode&&!um.hasOwnProperty(e.parentNode.nodeName.toLowerCase())}}class hm{constructor(e,t,r){this.parser=e,this.options=t,this.isOpen=r,this.open=0;let i=t.topNode,o,a=dm(null,t.preserveWhitespace,0)|(r?vs:0);i?o=new sl(i.type,i.attrs,we.none,we.none,!0,t.topMatch||i.type.contentMatch,a):r?o=new sl(null,null,we.none,we.none,!0,null,a):o=new sl(e.schema.topNodeType,null,we.none,we.none,!0,null,a),this.nodes=[o],this.find=t.findPositions,this.needsBlock=!1}get top(){return this.nodes[this.open]}addDOM(e){if(e.nodeType==3)this.addTextNode(e);else if(e.nodeType==1){let t=e.getAttribute("style");if(!t)this.addElement(e);else{let r=this.readStyles(yE(t));if(!r)return;let[i,o]=r,a=this.top;for(let c=0;c<o.length;c++)this.removePendingMark(o[c],a);for(let c=0;c<i.length;c++)this.addPendingMark(i[c]);this.addElement(e);for(let c=0;c<i.length;c++)this.removePendingMark(i[c],a);for(let c=0;c<o.length;c++)this.addPendingMark(o[c])}}}addTextNode(e){let t=e.nodeValue,r=this.top;if(r.options&il||r.inlineContext(e)||/[^ \t\r\n\u000c]/.test(t)){if(r.options&rl)r.options&il?t=t.replace(/\r\n?/g,`
7
+ `):t=t.replace(/\r?\n|\r/g," ");else if(t=t.replace(/[ \t\r\n\u000c]+/g," "),/^[ \t\r\n\u000c]/.test(t)&&this.open==this.nodes.length-1){let i=r.content[r.content.length-1],o=e.previousSibling;(!i||o&&o.nodeName=="BR"||i.isText&&/[ \t\r\n\u000c]$/.test(i.text))&&(t=t.slice(1))}t&&this.insertNode(this.parser.schema.text(t)),this.findInText(e)}else this.findInside(e)}addElement(e,t){let r=e.nodeName.toLowerCase(),i;fm.hasOwnProperty(r)&&this.parser.normalizeLists&&mE(e);let o=this.options.ruleFromNode&&this.options.ruleFromNode(e)||(i=this.parser.matchTag(e,this,t));if(o?o.ignore:pE.hasOwnProperty(r))this.findInside(e),this.ignoreFallback(e);else if(!o||o.skip||o.closeParent){o&&o.closeParent?this.open=Math.max(0,this.open-1):o&&o.skip.nodeType&&(e=o.skip);let a,c=this.top,f=this.needsBlock;if(um.hasOwnProperty(r))c.content.length&&c.content[0].isInline&&this.open&&(this.open--,c=this.top),a=!0,c.type||(this.needsBlock=!0);else if(!e.firstChild){this.leafFallback(e);return}this.addAll(e),a&&this.sync(c),this.needsBlock=f}else this.addElementByRule(e,o,o.consuming===!1?i:void 0)}leafFallback(e){e.nodeName=="BR"&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(e.ownerDocument.createTextNode(`
8
+ `))}ignoreFallback(e){e.nodeName=="BR"&&(!this.top.type||!this.top.type.inlineContent)&&this.findPlace(this.parser.schema.text("-"))}readStyles(e){let t=we.none,r=we.none;e:for(let i=0;i<e.length;i+=2)for(let o=void 0;;){let a=this.parser.matchStyle(e[i],e[i+1],this,o);if(!a)continue e;if(a.ignore)return null;if(a.clearMark?this.top.pendingMarks.forEach(c=>{a.clearMark(c)&&(r=c.addToSet(r))}):t=this.parser.schema.marks[a.mark].create(a.attrs).addToSet(t),a.consuming===!1)o=a;else break}return[t,r]}addElementByRule(e,t,r){let i,o,a;t.node?(o=this.parser.schema.nodes[t.node],o.isLeaf?this.insertNode(o.create(t.attrs))||this.leafFallback(e):i=this.enter(o,t.attrs||null,t.preserveWhitespace)):(a=this.parser.schema.marks[t.mark].create(t.attrs),this.addPendingMark(a));let c=this.top;if(o&&o.isLeaf)this.findInside(e);else if(r)this.addElement(e,r);else if(t.getContent)this.findInside(e),t.getContent(e,this.parser.schema).forEach(f=>this.insertNode(f));else{let f=e;typeof t.contentElement=="string"?f=e.querySelector(t.contentElement):typeof t.contentElement=="function"?f=t.contentElement(e):t.contentElement&&(f=t.contentElement),this.findAround(e,f,!0),this.addAll(f)}i&&this.sync(c)&&this.open--,a&&this.removePendingMark(a,c)}addAll(e,t,r){let i=t||0;for(let o=t?e.childNodes[t]:e.firstChild,a=r==null?null:e.childNodes[r];o!=a;o=o.nextSibling,++i)this.findAtPoint(e,i),this.addDOM(o);this.findAtPoint(e,i)}findPlace(e){let t,r;for(let i=this.open;i>=0;i--){let o=this.nodes[i],a=o.findWrapping(e);if(a&&(!t||t.length>a.length)&&(t=a,r=o,!a.length)||o.solid)break}if(!t)return!1;this.sync(r);for(let i=0;i<t.length;i++)this.enterInner(t[i],null,!1);return!0}insertNode(e){if(e.isInline&&this.needsBlock&&!this.top.type){let t=this.textblockFromContext();t&&this.enterInner(t)}if(this.findPlace(e)){this.closeExtra();let t=this.top;t.applyPending(e.type),t.match&&(t.match=t.match.matchType(e.type));let r=t.activeMarks;for(let i=0;i<e.marks.length;i++)(!t.type||t.type.allowsMarkType(e.marks[i].type))&&(r=e.marks[i].addToSet(r));return t.content.push(e.mark(r)),!0}return!1}enter(e,t,r){let i=this.findPlace(e.create(t));return i&&this.enterInner(e,t,!0,r),i}enterInner(e,t=null,r=!1,i){this.closeExtra();let o=this.top;o.applyPending(e),o.match=o.match&&o.match.matchType(e);let a=dm(e,i,o.options);o.options&vs&&o.content.length==0&&(a|=vs),this.nodes.push(new sl(e,t,o.activeMarks,o.pendingMarks,r,null,a)),this.open++}closeExtra(e=!1){let t=this.nodes.length-1;if(t>this.open){for(;t>this.open;t--)this.nodes[t-1].content.push(this.nodes[t].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 t=this.open;t>=0;t--)if(this.nodes[t]==e)return this.open=t,!0;return!1}get currentPos(){this.closeExtra();let e=0;for(let t=this.open;t>=0;t--){let r=this.nodes[t].content;for(let i=r.length-1;i>=0;i--)e+=r[i].nodeSize;t&&e++}return e}findAtPoint(e,t){if(this.find)for(let r=0;r<this.find.length;r++)this.find[r].node==e&&this.find[r].offset==t&&(this.find[r].pos=this.currentPos)}findInside(e){if(this.find)for(let t=0;t<this.find.length;t++)this.find[t].pos==null&&e.nodeType==1&&e.contains(this.find[t].node)&&(this.find[t].pos=this.currentPos)}findAround(e,t,r){if(e!=t&&this.find)for(let i=0;i<this.find.length;i++)this.find[i].pos==null&&e.nodeType==1&&e.contains(this.find[i].node)&&t.compareDocumentPosition(this.find[i].node)&(r?2:4)&&(this.find[i].pos=this.currentPos)}findInText(e){if(this.find)for(let t=0;t<this.find.length;t++)this.find[t].node==e&&(this.find[t].pos=this.currentPos-(e.nodeValue.length-this.find[t].offset))}matchesContext(e){if(e.indexOf("|")>-1)return e.split(/\s*\|\s*/).some(this.matchesContext,this);let t=e.split("/"),r=this.options.context,i=!this.isOpen&&(!r||r.parent.type==this.nodes[0].type),o=-(r?r.depth+1:0)+(i?0:1),a=(c,f)=>{for(;c>=0;c--){let h=t[c];if(h==""){if(c==t.length-1||c==0)continue;for(;f>=o;f--)if(a(c-1,f))return!0;return!1}else{let m=f>0||f==0&&i?this.nodes[f].type:r&&f>=o?r.node(f-o).type:null;if(!m||m.name!=h&&m.groups.indexOf(h)==-1)return!1;f--}}return!0};return a(t.length-1,this.open)}textblockFromContext(){let e=this.options.context;if(e)for(let t=e.depth;t>=0;t--){let r=e.node(t).contentMatchAt(e.indexAfter(t)).defaultType;if(r&&r.isTextblock&&r.defaultAttrs)return r}for(let t in this.parser.schema.nodes){let r=this.parser.schema.nodes[t];if(r.isTextblock&&r.defaultAttrs)return r}}addPendingMark(e){let t=vE(e,this.top.pendingMarks);t&&this.top.stashMarks.push(t),this.top.pendingMarks=e.addToSet(this.top.pendingMarks)}removePendingMark(e,t){for(let r=this.open;r>=0;r--){let i=this.nodes[r];if(i.pendingMarks.lastIndexOf(e)>-1)i.pendingMarks=e.removeFromSet(i.pendingMarks);else{i.activeMarks=e.removeFromSet(i.activeMarks);let a=i.popFromStashMark(e);a&&i.type&&i.type.allowsMarkType(a.type)&&(i.activeMarks=a.addToSet(i.activeMarks))}if(i==t)break}}}function mE(n){for(let e=n.firstChild,t=null;e;e=e.nextSibling){let r=e.nodeType==1?e.nodeName.toLowerCase():null;r&&fm.hasOwnProperty(r)&&t?(t.appendChild(e),e=t):r=="li"?t=e:r&&(t=null)}}function gE(n,e){return(n.matches||n.msMatchesSelector||n.webkitMatchesSelector||n.mozMatchesSelector).call(n,e)}function yE(n){let e=/\s*([\w-]+)\s*:\s*([^;]+)/g,t,r=[];for(;t=e.exec(n);)r.push(t[1],t[2].trim());return r}function pm(n){let e={};for(let t in n)e[t]=n[t];return e}function bE(n,e){let t=e.schema.nodes;for(let r in t){let i=t[r];if(!i.allowsMarkType(n))continue;let o=[],a=c=>{o.push(c);for(let f=0;f<c.edgeCount;f++){let{type:h,next:m}=c.edge(f);if(h==e||o.indexOf(m)<0&&a(m))return!0}};if(a(i.contentMatch))return!0}}function vE(n,e){for(let t=0;t<e.length;t++)if(n.eq(e[t]))return e[t]}class Hr{constructor(e,t){this.nodes=e,this.marks=t}serializeFragment(e,t={},r){r||(r=Xc(t).createDocumentFragment());let i=r,o=[];return e.forEach(a=>{if(o.length||a.marks.length){let c=0,f=0;for(;c<o.length&&f<a.marks.length;){let h=a.marks[f];if(!this.marks[h.type.name]){f++;continue}if(!h.eq(o[c][0])||h.type.spec.spanning===!1)break;c++,f++}for(;c<o.length;)i=o.pop()[1];for(;f<a.marks.length;){let h=a.marks[f++],m=this.serializeMark(h,a.isInline,t);m&&(o.push([h,i]),i.appendChild(m.dom),i=m.contentDOM||m.dom)}}i.appendChild(this.serializeNodeInner(a,t))}),r}serializeNodeInner(e,t){let{dom:r,contentDOM:i}=Hr.renderSpec(Xc(t),this.nodes[e.type.name](e));if(i){if(e.isLeaf)throw new RangeError("Content hole not allowed in a leaf node spec");this.serializeFragment(e.content,t,i)}return r}serializeNode(e,t={}){let r=this.serializeNodeInner(e,t);for(let i=e.marks.length-1;i>=0;i--){let o=this.serializeMark(e.marks[i],e.isInline,t);o&&((o.contentDOM||o.dom).appendChild(r),r=o.dom)}return r}serializeMark(e,t,r={}){let i=this.marks[e.type.name];return i&&Hr.renderSpec(Xc(r),i(e,t))}static renderSpec(e,t,r=null){if(typeof t=="string")return{dom:e.createTextNode(t)};if(t.nodeType!=null)return{dom:t};if(t.dom&&t.dom.nodeType!=null)return t;let i=t[0],o=i.indexOf(" ");o>0&&(r=i.slice(0,o),i=i.slice(o+1));let a,c=r?e.createElementNS(r,i):e.createElement(i),f=t[1],h=1;if(f&&typeof f=="object"&&f.nodeType==null&&!Array.isArray(f)){h=2;for(let m in f)if(f[m]!=null){let p=m.indexOf(" ");p>0?c.setAttributeNS(m.slice(0,p),m.slice(p+1),f[m]):c.setAttribute(m,f[m])}}for(let m=h;m<t.length;m++){let p=t[m];if(p===0){if(m<t.length-1||m>h)throw new RangeError("Content hole must be the only child of its parent node");return{dom:c,contentDOM:c}}else{let{dom:y,contentDOM:S}=Hr.renderSpec(e,p,r);if(c.appendChild(y),S){if(a)throw new RangeError("Multiple content holes");a=S}}}return{dom:c,contentDOM:a}}static fromSchema(e){return e.cached.domSerializer||(e.cached.domSerializer=new Hr(this.nodesFromSchema(e),this.marksFromSchema(e)))}static nodesFromSchema(e){let t=mm(e.nodes);return t.text||(t.text=r=>r.text),t}static marksFromSchema(e){return mm(e.marks)}}function mm(n){let e={};for(let t in n){let r=n[t].spec.toDOM;r&&(e[t]=r)}return e}function Xc(n){return n.document||window.document}const gm=65535,ym=Math.pow(2,16);function SE(n,e){return n+e*ym}function bm(n){return n&gm}function xE(n){return(n-(n&gm))/ym}const vm=1,Sm=2,ol=4,xm=8;class Zc{constructor(e,t,r){this.pos=e,this.delInfo=t,this.recover=r}get deleted(){return(this.delInfo&xm)>0}get deletedBefore(){return(this.delInfo&(vm|ol))>0}get deletedAfter(){return(this.delInfo&(Sm|ol))>0}get deletedAcross(){return(this.delInfo&ol)>0}}class $t{constructor(e,t=!1){if(this.ranges=e,this.inverted=t,!e.length&&$t.empty)return $t.empty}recover(e){let t=0,r=bm(e);if(!this.inverted)for(let i=0;i<r;i++)t+=this.ranges[i*3+2]-this.ranges[i*3+1];return this.ranges[r*3]+t+xE(e)}mapResult(e,t=1){return this._map(e,t,!1)}map(e,t=1){return this._map(e,t,!0)}_map(e,t,r){let i=0,o=this.inverted?2:1,a=this.inverted?1:2;for(let c=0;c<this.ranges.length;c+=3){let f=this.ranges[c]-(this.inverted?i:0);if(f>e)break;let h=this.ranges[c+o],m=this.ranges[c+a],p=f+h;if(e<=p){let y=h?e==f?-1:e==p?1:t:t,S=f+i+(y<0?0:m);if(r)return S;let _=e==(t<0?f:p)?null:SE(c/3,e-f),C=e==f?Sm:e==p?vm:ol;return(t<0?e!=f:e!=p)&&(C|=xm),new Zc(S,C,_)}i+=m-h}return r?e+i:new Zc(e+i,0,null)}touches(e,t){let r=0,i=bm(t),o=this.inverted?2:1,a=this.inverted?1:2;for(let c=0;c<this.ranges.length;c+=3){let f=this.ranges[c]-(this.inverted?r:0);if(f>e)break;let h=this.ranges[c+o],m=f+h;if(e<=m&&c==i*3)return!0;r+=this.ranges[c+a]-h}return!1}forEach(e){let t=this.inverted?2:1,r=this.inverted?1:2;for(let i=0,o=0;i<this.ranges.length;i+=3){let a=this.ranges[i],c=a-(this.inverted?o:0),f=a+(this.inverted?0:o),h=this.ranges[i+t],m=this.ranges[i+r];e(c,c+h,f,f+m),o+=m-h}}invert(){return new $t(this.ranges,!this.inverted)}toString(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)}static offset(e){return e==0?$t.empty:new $t(e<0?[0,-e,0]:[0,0,e])}}$t.empty=new $t([]);class Li{constructor(e=[],t,r=0,i=e.length){this.maps=e,this.mirror=t,this.from=r,this.to=i}slice(e=0,t=this.maps.length){return new Li(this.maps,this.mirror,e,t)}copy(){return new Li(this.maps.slice(),this.mirror&&this.mirror.slice(),this.from,this.to)}appendMap(e,t){this.to=this.maps.push(e),t!=null&&this.setMirror(this.maps.length-1,t)}appendMapping(e){for(let t=0,r=this.maps.length;t<e.maps.length;t++){let i=e.getMirror(t);this.appendMap(e.maps[t],i!=null&&i<t?r+i:void 0)}}getMirror(e){if(this.mirror){for(let t=0;t<this.mirror.length;t++)if(this.mirror[t]==e)return this.mirror[t+(t%2?-1:1)]}}setMirror(e,t){this.mirror||(this.mirror=[]),this.mirror.push(e,t)}appendMappingInverted(e){for(let t=e.maps.length-1,r=this.maps.length+e.maps.length;t>=0;t--){let i=e.getMirror(t);this.appendMap(e.maps[t].invert(),i!=null&&i>t?r-i-1:void 0)}}invert(){let e=new Li;return e.appendMappingInverted(this),e}map(e,t=1){if(this.mirror)return this._map(e,t,!0);for(let r=this.from;r<this.to;r++)e=this.maps[r].map(e,t);return e}mapResult(e,t=1){return this._map(e,t,!1)}_map(e,t,r){let i=0;for(let o=this.from;o<this.to;o++){let a=this.maps[o],c=a.mapResult(e,t);if(c.recover!=null){let f=this.getMirror(o);if(f!=null&&f>o&&f<this.to){o=f,e=this.maps[f].recover(c.recover);continue}}i|=c.delInfo,e=c.pos}return r?e:new Zc(e,i,null)}}const Qc=Object.create(null);class Qe{getMap(){return $t.empty}merge(e){return null}static fromJSON(e,t){if(!t||!t.stepType)throw new RangeError("Invalid input for Step.fromJSON");let r=Qc[t.stepType];if(!r)throw new RangeError(`No step type ${t.stepType} defined`);return r.fromJSON(e,t)}static jsonID(e,t){if(e in Qc)throw new RangeError("Duplicate use of step JSON ID "+e);return Qc[e]=t,t.prototype.jsonID=e,t}}class Le{constructor(e,t){this.doc=e,this.failed=t}static ok(e){return new Le(e,null)}static fail(e){return new Le(null,e)}static fromReplace(e,t,r,i){try{return Le.ok(e.replace(t,r,i))}catch(o){if(o instanceof el)return Le.fail(o.message);throw o}}}function eu(n,e,t){let r=[];for(let i=0;i<n.childCount;i++){let o=n.child(i);o.content.size&&(o=o.copy(eu(o.content,e,o))),o.isInline&&(o=e(o,t,i)),r.push(o)}return L.fromArray(r)}class or extends Qe{constructor(e,t,r){super(),this.from=e,this.to=t,this.mark=r}apply(e){let t=e.slice(this.from,this.to),r=e.resolve(this.from),i=r.node(r.sharedDepth(this.to)),o=new H(eu(t.content,(a,c)=>!a.isAtom||!c.type.allowsMarkType(this.mark.type)?a:a.mark(this.mark.addToSet(a.marks)),i),t.openStart,t.openEnd);return Le.fromReplace(e,this.from,this.to,o)}invert(){return new pn(this.from,this.to,this.mark)}map(e){let t=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return t.deleted&&r.deleted||t.pos>=r.pos?null:new or(t.pos,r.pos,this.mark)}merge(e){return e instanceof or&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new or(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,t){if(typeof t.from!="number"||typeof t.to!="number")throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new or(t.from,t.to,e.markFromJSON(t.mark))}}Qe.jsonID("addMark",or);class pn extends Qe{constructor(e,t,r){super(),this.from=e,this.to=t,this.mark=r}apply(e){let t=e.slice(this.from,this.to),r=new H(eu(t.content,i=>i.mark(this.mark.removeFromSet(i.marks)),e),t.openStart,t.openEnd);return Le.fromReplace(e,this.from,this.to,r)}invert(){return new or(this.from,this.to,this.mark)}map(e){let t=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return t.deleted&&r.deleted||t.pos>=r.pos?null:new pn(t.pos,r.pos,this.mark)}merge(e){return e instanceof pn&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new pn(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,t){if(typeof t.from!="number"||typeof t.to!="number")throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new pn(t.from,t.to,e.markFromJSON(t.mark))}}Qe.jsonID("removeMark",pn);class lr extends Qe{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return Le.fail("No node at mark step's position");let r=t.type.create(t.attrs,null,this.mark.addToSet(t.marks));return Le.fromReplace(e,this.pos,this.pos+1,new H(L.from(r),0,t.isLeaf?0:1))}invert(e){let t=e.nodeAt(this.pos);if(t){let r=this.mark.addToSet(t.marks);if(r.length==t.marks.length){for(let i=0;i<t.marks.length;i++)if(!t.marks[i].isInSet(r))return new lr(this.pos,t.marks[i]);return new lr(this.pos,this.mark)}}return new Pi(this.pos,this.mark)}map(e){let t=e.mapResult(this.pos,1);return t.deletedAfter?null:new lr(t.pos,this.mark)}toJSON(){return{stepType:"addNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,t){if(typeof t.pos!="number")throw new RangeError("Invalid input for AddNodeMarkStep.fromJSON");return new lr(t.pos,e.markFromJSON(t.mark))}}Qe.jsonID("addNodeMark",lr);class Pi extends Qe{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return Le.fail("No node at mark step's position");let r=t.type.create(t.attrs,null,this.mark.removeFromSet(t.marks));return Le.fromReplace(e,this.pos,this.pos+1,new H(L.from(r),0,t.isLeaf?0:1))}invert(e){let t=e.nodeAt(this.pos);return!t||!this.mark.isInSet(t.marks)?this:new lr(this.pos,this.mark)}map(e){let t=e.mapResult(this.pos,1);return t.deletedAfter?null:new Pi(t.pos,this.mark)}toJSON(){return{stepType:"removeNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,t){if(typeof t.pos!="number")throw new RangeError("Invalid input for RemoveNodeMarkStep.fromJSON");return new Pi(t.pos,e.markFromJSON(t.mark))}}Qe.jsonID("removeNodeMark",Pi);class et extends Qe{constructor(e,t,r,i=!1){super(),this.from=e,this.to=t,this.slice=r,this.structure=i}apply(e){return this.structure&&tu(e,this.from,this.to)?Le.fail("Structure replace would overwrite content"):Le.fromReplace(e,this.from,this.to,this.slice)}getMap(){return new $t([this.from,this.to-this.from,this.slice.size])}invert(e){return new et(this.from,this.from+this.slice.size,e.slice(this.from,this.to))}map(e){let t=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return t.deletedAcross&&r.deletedAcross?null:new et(t.pos,Math.max(t.pos,r.pos),this.slice)}merge(e){if(!(e instanceof et)||e.structure||this.structure)return null;if(this.from+this.slice.size==e.from&&!this.slice.openEnd&&!e.slice.openStart){let t=this.slice.size+e.slice.size==0?H.empty:new H(this.slice.content.append(e.slice.content),this.slice.openStart,e.slice.openEnd);return new et(this.from,this.to+(e.to-e.from),t,this.structure)}else if(e.to==this.from&&!this.slice.openStart&&!e.slice.openEnd){let t=this.slice.size+e.slice.size==0?H.empty:new H(e.slice.content.append(this.slice.content),e.slice.openStart,this.slice.openEnd);return new et(e.from,this.to,t,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,t){if(typeof t.from!="number"||typeof t.to!="number")throw new RangeError("Invalid input for ReplaceStep.fromJSON");return new et(t.from,t.to,H.fromJSON(e,t.slice),!!t.structure)}}Qe.jsonID("replace",et);class $e extends Qe{constructor(e,t,r,i,o,a,c=!1){super(),this.from=e,this.to=t,this.gapFrom=r,this.gapTo=i,this.slice=o,this.insert=a,this.structure=c}apply(e){if(this.structure&&(tu(e,this.from,this.gapFrom)||tu(e,this.gapTo,this.to)))return Le.fail("Structure gap-replace would overwrite content");let t=e.slice(this.gapFrom,this.gapTo);if(t.openStart||t.openEnd)return Le.fail("Gap is not a flat range");let r=this.slice.insertAt(this.insert,t.content);return r?Le.fromReplace(e,this.from,this.to,r):Le.fail("Content does not fit in gap")}getMap(){return new $t([this.from,this.gapFrom-this.from,this.insert,this.gapTo,this.to-this.gapTo,this.slice.size-this.insert])}invert(e){let t=this.gapTo-this.gapFrom;return new $e(this.from,this.from+this.slice.size+t,this.from+this.insert,this.from+this.insert+t,e.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure)}map(e){let t=e.mapResult(this.from,1),r=e.mapResult(this.to,-1),i=e.map(this.gapFrom,-1),o=e.map(this.gapTo,1);return t.deletedAcross&&r.deletedAcross||i<t.pos||o>r.pos?null:new $e(t.pos,r.pos,i,o,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,t){if(typeof t.from!="number"||typeof t.to!="number"||typeof t.gapFrom!="number"||typeof t.gapTo!="number"||typeof t.insert!="number")throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new $e(t.from,t.to,t.gapFrom,t.gapTo,H.fromJSON(e,t.slice),t.insert,!!t.structure)}}Qe.jsonID("replaceAround",$e);function tu(n,e,t){let r=n.resolve(e),i=t-e,o=r.depth;for(;i>0&&o>0&&r.indexAfter(o)==r.node(o).childCount;)o--,i--;if(i>0){let a=r.node(o).maybeChild(r.indexAfter(o));for(;i>0;){if(!a||a.isLeaf)return!0;a=a.firstChild,i--}}return!1}function wE(n,e,t,r){let i=[],o=[],a,c;n.doc.nodesBetween(e,t,(f,h,m)=>{if(!f.isInline)return;let p=f.marks;if(!r.isInSet(p)&&m.type.allowsMarkType(r.type)){let y=Math.max(h,e),S=Math.min(h+f.nodeSize,t),_=r.addToSet(p);for(let C=0;C<p.length;C++)p[C].isInSet(_)||(a&&a.to==y&&a.mark.eq(p[C])?a.to=S:i.push(a=new pn(y,S,p[C])));c&&c.to==y?c.to=S:o.push(c=new or(y,S,r))}}),i.forEach(f=>n.step(f)),o.forEach(f=>n.step(f))}function _E(n,e,t,r){let i=[],o=0;n.doc.nodesBetween(e,t,(a,c)=>{if(!a.isInline)return;o++;let f=null;if(r instanceof Jl){let h=a.marks,m;for(;m=r.isInSet(h);)(f||(f=[])).push(m),h=m.removeFromSet(h)}else r?r.isInSet(a.marks)&&(f=[r]):f=a.marks;if(f&&f.length){let h=Math.min(c+a.nodeSize,t);for(let m=0;m<f.length;m++){let p=f[m],y;for(let S=0;S<i.length;S++){let _=i[S];_.step==o-1&&p.eq(i[S].style)&&(y=_)}y?(y.to=h,y.step=o):i.push({style:p,from:Math.max(c,e),to:h,step:o})}}}),i.forEach(a=>n.step(new pn(a.from,a.to,a.style)))}function kE(n,e,t,r=t.contentMatch){let i=n.doc.nodeAt(e),o=[],a=e+1;for(let c=0;c<i.childCount;c++){let f=i.child(c),h=a+f.nodeSize,m=r.matchType(f.type);if(!m)o.push(new et(a,h,H.empty));else{r=m;for(let p=0;p<f.marks.length;p++)t.allowsMarkType(f.marks[p].type)||n.step(new pn(a,h,f.marks[p]))}a=h}if(!r.validEnd){let c=r.fillBefore(L.empty,!0);n.replace(a,a,new H(c,0,0))}for(let c=o.length-1;c>=0;c--)n.step(o[c])}function EE(n,e,t){return(e==0||n.canReplace(e,n.childCount))&&(t==n.childCount||n.canReplace(0,t))}function mi(n){let t=n.parent.content.cutByIndex(n.startIndex,n.endIndex);for(let r=n.depth;;--r){let i=n.$from.node(r),o=n.$from.index(r),a=n.$to.indexAfter(r);if(r<n.depth&&i.canReplace(o,a,t))return r;if(r==0||i.type.spec.isolating||!EE(i,o,a))break}return null}function TE(n,e,t){let{$from:r,$to:i,depth:o}=e,a=r.before(o+1),c=i.after(o+1),f=a,h=c,m=L.empty,p=0;for(let _=o,C=!1;_>t;_--)C||r.index(_)>0?(C=!0,m=L.from(r.node(_).copy(m)),p++):f--;let y=L.empty,S=0;for(let _=o,C=!1;_>t;_--)C||i.after(_+1)<i.end(_)?(C=!0,y=L.from(i.node(_).copy(y)),S++):h++;n.step(new $e(f,h,a,c,new H(m.append(y),p,S),m.size-p,!0))}function nu(n,e,t=null,r=n){let i=CE(n,e),o=i&&AE(r,e);return o?i.map(wm).concat({type:e,attrs:t}).concat(o.map(wm)):null}function wm(n){return{type:n,attrs:null}}function CE(n,e){let{parent:t,startIndex:r,endIndex:i}=n,o=t.contentMatchAt(r).findWrapping(e);if(!o)return null;let a=o.length?o[0]:e;return t.canReplaceWith(r,i,a)?o:null}function AE(n,e){let{parent:t,startIndex:r,endIndex:i}=n,o=t.child(r),a=e.contentMatch.findWrapping(o.type);if(!a)return null;let f=(a.length?a[a.length-1]:e).contentMatch;for(let h=r;f&&h<i;h++)f=f.matchType(t.child(h).type);return!f||!f.validEnd?null:a}function ME(n,e,t){let r=L.empty;for(let a=t.length-1;a>=0;a--){if(r.size){let c=t[a].type.contentMatch.matchFragment(r);if(!c||!c.validEnd)throw new RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}r=L.from(t[a].type.create(t[a].attrs,r))}let i=e.start,o=e.end;n.step(new $e(i,o,i,o,new H(r,0,0),t.length,!0))}function OE(n,e,t,r,i){if(!r.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");let o=n.steps.length;n.doc.nodesBetween(e,t,(a,c)=>{if(a.isTextblock&&!a.hasMarkup(r,i)&&IE(n.doc,n.mapping.slice(o).map(c),r)){n.clearIncompatible(n.mapping.slice(o).map(c,1),r);let f=n.mapping.slice(o),h=f.map(c,1),m=f.map(c+a.nodeSize,1);return n.step(new $e(h,m,h+1,m-1,new H(L.from(r.create(i,null,a.marks)),0,0),1,!0)),!1}})}function IE(n,e,t){let r=n.resolve(e),i=r.index();return r.parent.canReplaceWith(i,i+1,t)}function NE(n,e,t,r,i){let o=n.doc.nodeAt(e);if(!o)throw new RangeError("No node at given position");t||(t=o.type);let a=t.create(r,null,i||o.marks);if(o.isLeaf)return n.replaceWith(e,e+o.nodeSize,a);if(!t.validContent(o.content))throw new RangeError("Invalid content for node type "+t.name);n.step(new $e(e,e+o.nodeSize,e+1,e+o.nodeSize-1,new H(L.from(a),0,0),1,!0))}function gi(n,e,t=1,r){let i=n.resolve(e),o=i.depth-t,a=r&&r[r.length-1]||i.parent;if(o<0||i.parent.type.spec.isolating||!i.parent.canReplace(i.index(),i.parent.childCount)||!a.type.validContent(i.parent.content.cutByIndex(i.index(),i.parent.childCount)))return!1;for(let h=i.depth-1,m=t-2;h>o;h--,m--){let p=i.node(h),y=i.index(h);if(p.type.spec.isolating)return!1;let S=p.content.cutByIndex(y,p.childCount),_=r&&r[m]||p;if(_!=p&&(S=S.replaceChild(0,_.type.create(_.attrs))),!p.canReplace(y+1,p.childCount)||!_.type.validContent(S))return!1}let c=i.indexAfter(o),f=r&&r[0];return i.node(o).canReplaceWith(c,c,f?f.type:i.node(o+1).type)}function RE(n,e,t=1,r){let i=n.doc.resolve(e),o=L.empty,a=L.empty;for(let c=i.depth,f=i.depth-t,h=t-1;c>f;c--,h--){o=L.from(i.node(c).copy(o));let m=r&&r[h];a=L.from(m?m.type.create(m.attrs,a):i.node(c).copy(a))}n.step(new et(e,e,new H(o.append(a),t,t),!0))}function qn(n,e){let t=n.resolve(e),r=t.index();return _m(t.nodeBefore,t.nodeAfter)&&t.parent.canReplace(r,r+1)}function _m(n,e){return!!(n&&e&&!n.isLeaf&&n.canAppend(e))}function ll(n,e,t=-1){let r=n.resolve(e);for(let i=r.depth;;i--){let o,a,c=r.index(i);if(i==r.depth?(o=r.nodeBefore,a=r.nodeAfter):t>0?(o=r.node(i+1),c++,a=r.node(i).maybeChild(c)):(o=r.node(i).maybeChild(c-1),a=r.node(i+1)),o&&!o.isTextblock&&_m(o,a)&&r.node(i).canReplace(c,c+1))return e;if(i==0)break;e=t<0?r.before(i):r.after(i)}}function LE(n,e,t){let r=new et(e-t,e+t,H.empty,!0);n.step(r)}function PE(n,e,t){let r=n.resolve(e);if(r.parent.canReplaceWith(r.index(),r.index(),t))return e;if(r.parentOffset==0)for(let i=r.depth-1;i>=0;i--){let o=r.index(i);if(r.node(i).canReplaceWith(o,o,t))return r.before(i+1);if(o>0)return null}if(r.parentOffset==r.parent.content.size)for(let i=r.depth-1;i>=0;i--){let o=r.indexAfter(i);if(r.node(i).canReplaceWith(o,o,t))return r.after(i+1);if(o<r.node(i).childCount)return null}return null}function DE(n,e,t){let r=n.resolve(e);if(!t.content.size)return e;let i=t.content;for(let o=0;o<t.openStart;o++)i=i.firstChild.content;for(let o=1;o<=(t.openStart==0&&t.size?2:1);o++)for(let a=r.depth;a>=0;a--){let c=a==r.depth?0:r.pos<=(r.start(a+1)+r.end(a+1))/2?-1:1,f=r.index(a)+(c>0?1:0),h=r.node(a),m=!1;if(o==1)m=h.canReplace(f,f,i);else{let p=h.contentMatchAt(f).findWrapping(i.firstChild.type);m=p&&h.canReplaceWith(f,f,p[0])}if(m)return c==0?r.pos:c<0?r.before(a+1):r.after(a+1)}return null}function ru(n,e,t=e,r=H.empty){if(e==t&&!r.size)return null;let i=n.resolve(e),o=n.resolve(t);return km(i,o,r)?new et(e,t,r):new FE(i,o,r).fit()}function km(n,e,t){return!t.openStart&&!t.openEnd&&n.start()==e.start()&&n.parent.canReplace(n.index(),e.index(),t.content)}class FE{constructor(e,t,r){this.$from=e,this.$to=t,this.unplaced=r,this.frontier=[],this.placed=L.empty;for(let i=0;i<=e.depth;i++){let o=e.node(i);this.frontier.push({type:o.type,match:o.contentMatchAt(e.indexAfter(i))})}for(let i=e.depth;i>0;i--)this.placed=L.from(e.node(i).copy(this.placed))}get depth(){return this.frontier.length-1}fit(){for(;this.unplaced.size;){let h=this.findFittable();h?this.placeNodes(h):this.openMore()||this.dropNode()}let e=this.mustMoveInline(),t=this.placed.size-this.depth-this.$from.depth,r=this.$from,i=this.close(e<0?this.$to:r.doc.resolve(e));if(!i)return null;let o=this.placed,a=r.depth,c=i.depth;for(;a&&c&&o.childCount==1;)o=o.firstChild.content,a--,c--;let f=new H(o,a,c);return e>-1?new $e(r.pos,e,this.$to.pos,this.$to.end(),f,t):f.size||r.pos!=this.$to.pos?new et(r.pos,i.pos,f):null}findFittable(){for(let e=1;e<=2;e++)for(let t=this.unplaced.openStart;t>=0;t--){let r,i=null;t?(i=iu(this.unplaced.content,t-1).firstChild,r=i.content):r=this.unplaced.content;let o=r.firstChild;for(let a=this.depth;a>=0;a--){let{type:c,match:f}=this.frontier[a],h,m=null;if(e==1&&(o?f.matchType(o.type)||(m=f.fillBefore(L.from(o),!1)):i&&c.compatibleContent(i.type)))return{sliceDepth:t,frontierDepth:a,parent:i,inject:m};if(e==2&&o&&(h=f.findWrapping(o.type)))return{sliceDepth:t,frontierDepth:a,parent:i,wrap:h};if(i&&f.matchType(i.type))break}}}openMore(){let{content:e,openStart:t,openEnd:r}=this.unplaced,i=iu(e,t);return!i.childCount||i.firstChild.isLeaf?!1:(this.unplaced=new H(e,t+1,Math.max(r,i.size+t>=e.size-r?t+1:0)),!0)}dropNode(){let{content:e,openStart:t,openEnd:r}=this.unplaced,i=iu(e,t);if(i.childCount<=1&&t>0){let o=e.size-t<=t+i.size;this.unplaced=new H(Ss(e,t-1,1),t-1,o?t-1:r)}else this.unplaced=new H(Ss(e,t,1),t,r)}placeNodes({sliceDepth:e,frontierDepth:t,parent:r,inject:i,wrap:o}){for(;this.depth>t;)this.closeFrontierNode();if(o)for(let C=0;C<o.length;C++)this.openFrontierNode(o[C]);let a=this.unplaced,c=r?r.content:a.content,f=a.openStart-e,h=0,m=[],{match:p,type:y}=this.frontier[t];if(i){for(let C=0;C<i.childCount;C++)m.push(i.child(C));p=p.matchFragment(i)}let S=c.size+e-(a.content.size-a.openEnd);for(;h<c.childCount;){let C=c.child(h),A=p.matchType(C.type);if(!A)break;h++,(h>1||f==0||C.content.size)&&(p=A,m.push(Em(C.mark(y.allowedMarks(C.marks)),h==1?f:0,h==c.childCount?S:-1)))}let _=h==c.childCount;_||(S=-1),this.placed=xs(this.placed,t,L.from(m)),this.frontier[t].match=p,_&&S<0&&r&&r.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let C=0,A=c;C<S;C++){let R=A.lastChild;this.frontier.push({type:R.type,match:R.contentMatchAt(R.childCount)}),A=R.content}this.unplaced=_?e==0?H.empty:new H(Ss(a.content,e-1,1),e-1,S<0?a.openEnd:e-1):new H(Ss(a.content,e,h),a.openStart,a.openEnd)}mustMoveInline(){if(!this.$to.parent.isTextblock)return-1;let e=this.frontier[this.depth],t;if(!e.type.isTextblock||!su(this.$to,this.$to.depth,e.type,e.match,!1)||this.$to.depth==this.depth&&(t=this.findCloseLevel(this.$to))&&t.depth==this.depth)return-1;let{depth:r}=this.$to,i=this.$to.after(r);for(;r>1&&i==this.$to.end(--r);)++i;return i}findCloseLevel(e){e:for(let t=Math.min(this.depth,e.depth);t>=0;t--){let{match:r,type:i}=this.frontier[t],o=t<e.depth&&e.end(t+1)==e.pos+(e.depth-(t+1)),a=su(e,t,i,r,o);if(a){for(let c=t-1;c>=0;c--){let{match:f,type:h}=this.frontier[c],m=su(e,c,h,f,!0);if(!m||m.childCount)continue e}return{depth:t,fit:a,move:o?e.doc.resolve(e.after(t+1)):e}}}}close(e){let t=this.findCloseLevel(e);if(!t)return null;for(;this.depth>t.depth;)this.closeFrontierNode();t.fit.childCount&&(this.placed=xs(this.placed,t.depth,t.fit)),e=t.move;for(let r=t.depth+1;r<=e.depth;r++){let i=e.node(r),o=i.type.contentMatch.fillBefore(i.content,!0,e.index(r));this.openFrontierNode(i.type,i.attrs,o)}return e}openFrontierNode(e,t=null,r){let i=this.frontier[this.depth];i.match=i.match.matchType(e),this.placed=xs(this.placed,this.depth,L.from(e.create(t,r))),this.frontier.push({type:e,match:e.contentMatch})}closeFrontierNode(){let t=this.frontier.pop().match.fillBefore(L.empty,!0);t.childCount&&(this.placed=xs(this.placed,this.frontier.length,t))}}function Ss(n,e,t){return e==0?n.cutByIndex(t,n.childCount):n.replaceChild(0,n.firstChild.copy(Ss(n.firstChild.content,e-1,t)))}function xs(n,e,t){return e==0?n.append(t):n.replaceChild(n.childCount-1,n.lastChild.copy(xs(n.lastChild.content,e-1,t)))}function iu(n,e){for(let t=0;t<e;t++)n=n.firstChild.content;return n}function Em(n,e,t){if(e<=0)return n;let r=n.content;return e>1&&(r=r.replaceChild(0,Em(r.firstChild,e-1,r.childCount==1?t-1:0))),e>0&&(r=n.type.contentMatch.fillBefore(r).append(r),t<=0&&(r=r.append(n.type.contentMatch.matchFragment(r).fillBefore(L.empty,!0)))),n.copy(r)}function su(n,e,t,r,i){let o=n.node(e),a=i?n.indexAfter(e):n.index(e);if(a==o.childCount&&!t.compatibleContent(o.type))return null;let c=r.fillBefore(o.content,!0,a);return c&&!BE(t,o.content,a)?c:null}function BE(n,e,t){for(let r=t;r<e.childCount;r++)if(!n.allowsMarks(e.child(r).marks))return!0;return!1}function zE(n){return n.spec.defining||n.spec.definingForContent}function HE(n,e,t,r){if(!r.size)return n.deleteRange(e,t);let i=n.doc.resolve(e),o=n.doc.resolve(t);if(km(i,o,r))return n.step(new et(e,t,r));let a=Cm(i,n.doc.resolve(t));a[a.length-1]==0&&a.pop();let c=-(i.depth+1);a.unshift(c);for(let y=i.depth,S=i.pos-1;y>0;y--,S--){let _=i.node(y).type.spec;if(_.defining||_.definingAsContext||_.isolating)break;a.indexOf(y)>-1?c=y:i.before(y)==S&&a.splice(1,0,-y)}let f=a.indexOf(c),h=[],m=r.openStart;for(let y=r.content,S=0;;S++){let _=y.firstChild;if(h.push(_),S==r.openStart)break;y=_.content}for(let y=m-1;y>=0;y--){let S=h[y].type,_=zE(S);if(_&&i.node(f).type!=S)m=y;else if(_||!S.isTextblock)break}for(let y=r.openStart;y>=0;y--){let S=(y+m+1)%(r.openStart+1),_=h[S];if(_)for(let C=0;C<a.length;C++){let A=a[(C+f)%a.length],R=!0;A<0&&(R=!1,A=-A);let K=i.node(A-1),V=i.index(A-1);if(K.canReplaceWith(V,V,_.type,_.marks))return n.replace(i.before(A),R?o.after(A):t,new H(Tm(r.content,0,r.openStart,S),S,r.openEnd))}}let p=n.steps.length;for(let y=a.length-1;y>=0&&(n.replace(e,t,r),!(n.steps.length>p));y--){let S=a[y];S<0||(e=i.before(S),t=o.after(S))}}function Tm(n,e,t,r,i){if(e<t){let o=n.firstChild;n=n.replaceChild(0,o.copy(Tm(o.content,e+1,t,r,o)))}if(e>r){let o=i.contentMatchAt(0),a=o.fillBefore(n).append(n);n=a.append(o.matchFragment(a).fillBefore(L.empty,!0))}return n}function $E(n,e,t,r){if(!r.isInline&&e==t&&n.doc.resolve(e).parent.content.size){let i=PE(n.doc,e,r.type);i!=null&&(e=t=i)}n.replaceRange(e,t,new H(L.from(r),0,0))}function WE(n,e,t){let r=n.doc.resolve(e),i=n.doc.resolve(t),o=Cm(r,i);for(let a=0;a<o.length;a++){let c=o[a],f=a==o.length-1;if(f&&c==0||r.node(c).type.contentMatch.validEnd)return n.delete(r.start(c),i.end(c));if(c>0&&(f||r.node(c-1).canReplace(r.index(c-1),i.indexAfter(c-1))))return n.delete(r.before(c),i.after(c))}for(let a=1;a<=r.depth&&a<=i.depth;a++)if(e-r.start(a)==r.depth-a&&t>r.end(a)&&i.end(a)-t!=i.depth-a)return n.delete(r.before(a),t);n.delete(e,t)}function Cm(n,e){let t=[],r=Math.min(n.depth,e.depth);for(let i=r;i>=0;i--){let o=n.start(i);if(o<n.pos-(n.depth-i)||e.end(i)>e.pos+(e.depth-i)||n.node(i).type.spec.isolating||e.node(i).type.spec.isolating)break;(o==e.start(i)||i==n.depth&&i==e.depth&&n.parent.inlineContent&&e.parent.inlineContent&&i&&e.start(i-1)==o-1)&&t.push(i)}return t}class Di extends Qe{constructor(e,t,r){super(),this.pos=e,this.attr=t,this.value=r}apply(e){let t=e.nodeAt(this.pos);if(!t)return Le.fail("No node at attribute step's position");let r=Object.create(null);for(let o in t.attrs)r[o]=t.attrs[o];r[this.attr]=this.value;let i=t.type.create(r,null,t.marks);return Le.fromReplace(e,this.pos,this.pos+1,new H(L.from(i),0,t.isLeaf?0:1))}getMap(){return $t.empty}invert(e){return new Di(this.pos,this.attr,e.nodeAt(this.pos).attrs[this.attr])}map(e){let t=e.mapResult(this.pos,1);return t.deletedAfter?null:new Di(t.pos,this.attr,this.value)}toJSON(){return{stepType:"attr",pos:this.pos,attr:this.attr,value:this.value}}static fromJSON(e,t){if(typeof t.pos!="number"||typeof t.attr!="string")throw new RangeError("Invalid input for AttrStep.fromJSON");return new Di(t.pos,t.attr,t.value)}}Qe.jsonID("attr",Di);let yi=class extends Error{};yi=function n(e){let t=Error.call(this,e);return t.__proto__=n.prototype,t},yi.prototype=Object.create(Error.prototype),yi.prototype.constructor=yi,yi.prototype.name="TransformError";class UE{constructor(e){this.doc=e,this.steps=[],this.docs=[],this.mapping=new Li}get before(){return this.docs.length?this.docs[0]:this.doc}step(e){let t=this.maybeStep(e);if(t.failed)throw new yi(t.failed);return this}maybeStep(e){let t=e.apply(this.doc);return t.failed||this.addStep(e,t.doc),t}get docChanged(){return this.steps.length>0}addStep(e,t){this.docs.push(this.doc),this.steps.push(e),this.mapping.appendMap(e.getMap()),this.doc=t}replace(e,t=e,r=H.empty){let i=ru(this.doc,e,t,r);return i&&this.step(i),this}replaceWith(e,t,r){return this.replace(e,t,new H(L.from(r),0,0))}delete(e,t){return this.replace(e,t,H.empty)}insert(e,t){return this.replaceWith(e,e,t)}replaceRange(e,t,r){return HE(this,e,t,r),this}replaceRangeWith(e,t,r){return $E(this,e,t,r),this}deleteRange(e,t){return WE(this,e,t),this}lift(e,t){return TE(this,e,t),this}join(e,t=1){return LE(this,e,t),this}wrap(e,t){return ME(this,e,t),this}setBlockType(e,t=e,r,i=null){return OE(this,e,t,r,i),this}setNodeMarkup(e,t,r=null,i=[]){return NE(this,e,t,r,i),this}setNodeAttribute(e,t,r){return this.step(new Di(e,t,r)),this}addNodeMark(e,t){return this.step(new lr(e,t)),this}removeNodeMark(e,t){if(!(t instanceof we)){let r=this.doc.nodeAt(e);if(!r)throw new RangeError("No node at position "+e);if(t=t.isInSet(r.marks),!t)return this}return this.step(new Pi(e,t)),this}split(e,t=1,r){return RE(this,e,t,r),this}addMark(e,t,r){return wE(this,e,t,r),this}removeMark(e,t,r){return _E(this,e,t,r),this}clearIncompatible(e,t,r){return kE(this,e,t,r),this}}const ou=Object.create(null);class he{constructor(e,t,r){this.$anchor=e,this.$head=t,this.ranges=r||[new VE(e.min(t),e.max(t))]}get anchor(){return this.$anchor.pos}get head(){return this.$head.pos}get from(){return this.$from.pos}get to(){return this.$to.pos}get $from(){return this.ranges[0].$from}get $to(){return this.ranges[0].$to}get empty(){let e=this.ranges;for(let t=0;t<e.length;t++)if(e[t].$from.pos!=e[t].$to.pos)return!1;return!0}content(){return this.$from.doc.slice(this.from,this.to,!0)}replace(e,t=H.empty){let r=t.content.lastChild,i=null;for(let c=0;c<t.openEnd;c++)i=r,r=r.lastChild;let o=e.steps.length,a=this.ranges;for(let c=0;c<a.length;c++){let{$from:f,$to:h}=a[c],m=e.mapping.slice(o);e.replaceRange(m.map(f.pos),m.map(h.pos),c?H.empty:t),c==0&&Om(e,o,(r?r.isInline:i&&i.isTextblock)?-1:1)}}replaceWith(e,t){let r=e.steps.length,i=this.ranges;for(let o=0;o<i.length;o++){let{$from:a,$to:c}=i[o],f=e.mapping.slice(r),h=f.map(a.pos),m=f.map(c.pos);o?e.deleteRange(h,m):(e.replaceRangeWith(h,m,t),Om(e,r,t.isInline?-1:1))}}static findFrom(e,t,r=!1){let i=e.parent.inlineContent?new pe(e):bi(e.node(0),e.parent,e.pos,e.index(),t,r);if(i)return i;for(let o=e.depth-1;o>=0;o--){let a=t<0?bi(e.node(0),e.node(o),e.before(o+1),e.index(o),t,r):bi(e.node(0),e.node(o),e.after(o+1),e.index(o)+1,t,r);if(a)return a}return null}static near(e,t=1){return this.findFrom(e,t)||this.findFrom(e,-t)||new Qt(e.node(0))}static atStart(e){return bi(e,e,0,0,1)||new Qt(e)}static atEnd(e){return bi(e,e,e.content.size,e.childCount,-1)||new Qt(e)}static fromJSON(e,t){if(!t||!t.type)throw new RangeError("Invalid input for Selection.fromJSON");let r=ou[t.type];if(!r)throw new RangeError(`No selection type ${t.type} defined`);return r.fromJSON(e,t)}static jsonID(e,t){if(e in ou)throw new RangeError("Duplicate use of selection JSON ID "+e);return ou[e]=t,t.prototype.jsonID=e,t}getBookmark(){return pe.between(this.$anchor,this.$head).getBookmark()}}he.prototype.visible=!0;class VE{constructor(e,t){this.$from=e,this.$to=t}}let Am=!1;function Mm(n){!Am&&!n.parent.inlineContent&&(Am=!0,console.warn("TextSelection endpoint not pointing into a node with inline content ("+n.parent.type.name+")"))}class pe extends he{constructor(e,t=e){Mm(e),Mm(t),super(e,t)}get $cursor(){return this.$anchor.pos==this.$head.pos?this.$head:null}map(e,t){let r=e.resolve(t.map(this.head));if(!r.parent.inlineContent)return he.near(r);let i=e.resolve(t.map(this.anchor));return new pe(i.parent.inlineContent?i:r,r)}replace(e,t=H.empty){if(super.replace(e,t),t==H.empty){let r=this.$from.marksAcross(this.$to);r&&e.ensureMarks(r)}}eq(e){return e instanceof pe&&e.anchor==this.anchor&&e.head==this.head}getBookmark(){return new jl(this.anchor,this.head)}toJSON(){return{type:"text",anchor:this.anchor,head:this.head}}static fromJSON(e,t){if(typeof t.anchor!="number"||typeof t.head!="number")throw new RangeError("Invalid input for TextSelection.fromJSON");return new pe(e.resolve(t.anchor),e.resolve(t.head))}static create(e,t,r=t){let i=e.resolve(t);return new this(i,r==t?i:e.resolve(r))}static between(e,t,r){let i=e.pos-t.pos;if((!r||i)&&(r=i>=0?1:-1),!t.parent.inlineContent){let o=he.findFrom(t,r,!0)||he.findFrom(t,-r,!0);if(o)t=o.$head;else return he.near(t,r)}return e.parent.inlineContent||(i==0?e=t:(e=(he.findFrom(e,-r,!0)||he.findFrom(e,r,!0)).$anchor,e.pos<t.pos!=i<0&&(e=t))),new pe(e,t)}}he.jsonID("text",pe);class jl{constructor(e,t){this.anchor=e,this.head=t}map(e){return new jl(e.map(this.anchor),e.map(this.head))}resolve(e){return pe.between(e.resolve(this.anchor),e.resolve(this.head))}}class X extends he{constructor(e){let t=e.nodeAfter,r=e.node(0).resolve(e.pos+t.nodeSize);super(e,r),this.node=t}map(e,t){let{deleted:r,pos:i}=t.mapResult(this.anchor),o=e.resolve(i);return r?he.near(o):new X(o)}content(){return new H(L.from(this.node),0,0)}eq(e){return e instanceof X&&e.anchor==this.anchor}toJSON(){return{type:"node",anchor:this.anchor}}getBookmark(){return new xf(this.anchor)}static fromJSON(e,t){if(typeof t.anchor!="number")throw new RangeError("Invalid input for NodeSelection.fromJSON");return new X(e.resolve(t.anchor))}static create(e,t){return new X(e.resolve(t))}static isSelectable(e){return!e.isText&&e.type.spec.selectable!==!1}}X.prototype.visible=!1,he.jsonID("node",X);class xf{constructor(e){this.anchor=e}map(e){let{deleted:t,pos:r}=e.mapResult(this.anchor);return t?new jl(r,r):new xf(r)}resolve(e){let t=e.resolve(this.anchor),r=t.nodeAfter;return r&&X.isSelectable(r)?new X(t):he.near(t)}}class Qt extends he{constructor(e){super(e.resolve(0),e.resolve(e.content.size))}replace(e,t=H.empty){if(t==H.empty){e.delete(0,e.doc.content.size);let r=he.atStart(e.doc);r.eq(e.selection)||e.setSelection(r)}else super.replace(e,t)}toJSON(){return{type:"all"}}static fromJSON(e){return new Qt(e)}map(e){return new Qt(e)}eq(e){return e instanceof Qt}getBookmark(){return KE}}he.jsonID("all",Qt);const KE={map(){return this},resolve(n){return new Qt(n)}};function bi(n,e,t,r,i,o=!1){if(e.inlineContent)return pe.create(n,t);for(let a=r-(i>0?0:1);i>0?a<e.childCount:a>=0;a+=i){let c=e.child(a);if(c.isAtom){if(!o&&X.isSelectable(c))return X.create(n,t-(i<0?c.nodeSize:0))}else{let f=bi(n,c,t+i,i<0?c.childCount:0,i,o);if(f)return f}t+=c.nodeSize*i}return null}function Om(n,e,t){let r=n.steps.length-1;if(r<e)return;let i=n.steps[r];if(!(i instanceof et||i instanceof $e))return;let o=n.mapping.maps[r],a;o.forEach((c,f,h,m)=>{a==null&&(a=m)}),n.setSelection(he.near(n.doc.resolve(a),t))}function Im(n,e){return!e||!n?n:n.bind(e)}class al{constructor(e,t,r){this.name=e,this.init=Im(t.init,r),this.apply=Im(t.apply,r)}}new al("doc",{init(n){return n.doc||n.schema.topNodeType.createAndFill()},apply(n){return n.doc}}),new al("selection",{init(n,e){return n.selection||he.atStart(e.doc)},apply(n){return n.selection}}),new al("storedMarks",{init(n){return n.storedMarks||null},apply(n,e,t,r){return r.selection.$cursor?n.storedMarks:null}}),new al("scrollToSelection",{init(){return 0},apply(n,e){return n.scrolledIntoView?e+1:e}});function Nm(n,e,t){for(let r in n){let i=n[r];i instanceof Function?i=i.bind(e):r=="handleDOMEvents"&&(i=Nm(i,e,{})),t[r]=i}return t}class _t{constructor(e){this.spec=e,this.props={},e.props&&Nm(e.props,this,this.props),this.key=e.key?e.key.key:Rm("plugin")}getState(e){return e[this.key]}}const lu=Object.create(null);function Rm(n){return n in lu?n+"$"+ ++lu[n]:(lu[n]=0,n+"$")}class Yt{constructor(e="key"){this.key=Rm(e)}get(e){return e.config.pluginsByKey[this.key]}getState(e){return e[this.key]}}const ws=function(n){for(var e=0;;e++)if(n=n.previousSibling,!n)return e},Lm=function(n,e,t,r){return t&&(Pm(n,e,t,r,-1)||Pm(n,e,t,r,1))},GE=/^(img|br|input|textarea|hr)$/i;function Pm(n,e,t,r,i){for(;;){if(n==t&&e==r)return!0;if(e==(i<0?0:cl(n))){let o=n.parentNode;if(!o||o.nodeType!=1||JE(n)||GE.test(n.nodeName)||n.contentEditable=="false")return!1;e=ws(n)+(i<0?0:1),n=o}else if(n.nodeType==1){if(n=n.childNodes[e+(i<0?-1:0)],n.contentEditable=="false")return!1;e=i<0?cl(n):0}else return!1}}function cl(n){return n.nodeType==3?n.nodeValue.length:n.childNodes.length}function qE(n,e,t){for(let r=e==0,i=e==cl(n);r||i;){if(n==t)return!0;let o=ws(n);if(n=n.parentNode,!n)return!1;r=r&&o==0,i=i&&o==cl(n)}}function JE(n){let e;for(let t=n;t&&!(e=t.pmViewDesc);t=t.parentNode);return e&&e.node&&e.node.isBlock&&(e.dom==n||e.contentDOM==n)}const Dm=function(n){return n.focusNode&&Lm(n.focusNode,n.focusOffset,n.anchorNode,n.anchorOffset)};function Fm(n,e){let t=document.createEvent("Event");return t.initEvent("keydown",!0,!0),t.keyCode=n,t.key=t.code=e,t}const Jn=typeof navigator<"u"?navigator:null,Bm=typeof document<"u"?document:null,jn=Jn&&Jn.userAgent||"",au=/Edge\/(\d+)/.exec(jn),zm=/MSIE \d/.exec(jn),cu=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(jn),_s=!!(zm||cu||au),Hm=zm?document.documentMode:cu?+cu[1]:au?+au[1]:0,ul=!_s&&/gecko\/(\d+)/i.test(jn);ul&&+(/Firefox\/(\d+)/.exec(jn)||[0,0])[1];const uu=!_s&&/Chrome\/(\d+)/.exec(jn),vi=!!uu,jE=uu?+uu[1]:0,Tr=!_s&&!!Jn&&/Apple Computer/.test(Jn.vendor),fu=Tr&&(/Mobile\/\w+/.test(jn)||!!Jn&&Jn.maxTouchPoints>2),Ft=fu||(Jn?/Mac/.test(Jn.platform):!1),ks=/Android \d/.test(jn),du=!!Bm&&"webkitFontSmoothing"in Bm.documentElement.style,YE=du?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function XE(n,e=null){let t=n.domSelectionRange(),r=n.state.doc;if(!t.focusNode)return null;let i=n.docView.nearestDesc(t.focusNode),o=i&&i.size==0,a=n.docView.posFromDOM(t.focusNode,t.focusOffset,1);if(a<0)return null;let c=r.resolve(a),f,h;if(Dm(t)){for(f=c;i&&!i.node;)i=i.parent;let m=i.node;if(i&&m.isAtom&&X.isSelectable(m)&&i.parent&&!(m.isInline&&qE(t.focusNode,t.focusOffset,i.dom))){let p=i.posBefore;h=new X(a==p?c:r.resolve(p))}}else{let m=n.docView.posFromDOM(t.anchorNode,t.anchorOffset,1);if(m<0)return null;f=r.resolve(m)}if(!h){let m=e=="pointer"||n.state.selection.head<c.pos&&!o?1:-1;h=Gm(n,f,c,m)}return h}function $m(n){return n.editable?n.hasFocus():tT(n)&&document.activeElement&&document.activeElement.contains(n.dom)}function hu(n,e=!1){let t=n.state.selection;if(eT(n,t),!!$m(n)){if(!e&&n.input.mouseDown&&n.input.mouseDown.allowDefault&&vi){let r=n.domSelectionRange(),i=n.domObserver.currentSelection;if(r.anchorNode&&i.anchorNode&&Lm(r.anchorNode,r.anchorOffset,i.anchorNode,i.anchorOffset)){n.input.mouseDown.delayedSelectionSync=!0,n.domObserver.setCurSelection();return}}if(n.domObserver.disconnectSelection(),n.cursorWrapper)QE(n);else{let{anchor:r,head:i}=t,o,a;Wm&&!(t instanceof pe)&&(t.$from.parent.inlineContent||(o=Um(n,t.from)),!t.empty&&!t.$from.parent.inlineContent&&(a=Um(n,t.to))),n.docView.setSelection(r,i,n.root,e),Wm&&(o&&Vm(o),a&&Vm(a)),t.visible?n.dom.classList.remove("ProseMirror-hideselection"):(n.dom.classList.add("ProseMirror-hideselection"),"onselectionchange"in document&&ZE(n))}n.domObserver.setCurSelection(),n.domObserver.connectSelection()}}const Wm=Tr||vi&&jE<63;function Um(n,e){let{node:t,offset:r}=n.docView.domFromPos(e,0),i=r<t.childNodes.length?t.childNodes[r]:null,o=r?t.childNodes[r-1]:null;if(Tr&&i&&i.contentEditable=="false")return pu(i);if((!i||i.contentEditable=="false")&&(!o||o.contentEditable=="false")){if(i)return pu(i);if(o)return pu(o)}}function pu(n){return n.contentEditable="true",Tr&&n.draggable&&(n.draggable=!1,n.wasDraggable=!0),n}function Vm(n){n.contentEditable="false",n.wasDraggable&&(n.draggable=!0,n.wasDraggable=null)}function ZE(n){let e=n.dom.ownerDocument;e.removeEventListener("selectionchange",n.input.hideSelectionGuard);let t=n.domSelectionRange(),r=t.anchorNode,i=t.anchorOffset;e.addEventListener("selectionchange",n.input.hideSelectionGuard=()=>{(t.anchorNode!=r||t.anchorOffset!=i)&&(e.removeEventListener("selectionchange",n.input.hideSelectionGuard),setTimeout(()=>{(!$m(n)||n.state.selection.visible)&&n.dom.classList.remove("ProseMirror-hideselection")},20))})}function QE(n){let e=n.domSelection(),t=document.createRange(),r=n.cursorWrapper.dom,i=r.nodeName=="IMG";i?t.setEnd(r.parentNode,ws(r)+1):t.setEnd(r,0),t.collapse(!1),e.removeAllRanges(),e.addRange(t),!i&&!n.state.selection.visible&&_s&&Hm<=11&&(r.disabled=!0,r.disabled=!1)}function eT(n,e){if(e instanceof X){let t=n.docView.descAt(e.from);t!=n.lastSelectedViewDesc&&(Km(n),t&&t.selectNode(),n.lastSelectedViewDesc=t)}else Km(n)}function Km(n){n.lastSelectedViewDesc&&(n.lastSelectedViewDesc.parent&&n.lastSelectedViewDesc.deselectNode(),n.lastSelectedViewDesc=void 0)}function Gm(n,e,t,r){return n.someProp("createSelectionBetween",i=>i(n,e,t))||pe.between(e,t,r)}function tT(n){let e=n.domSelectionRange();if(!e.anchorNode)return!1;try{return n.dom.contains(e.anchorNode.nodeType==3?e.anchorNode.parentNode:e.anchorNode)&&(n.editable||n.dom.contains(e.focusNode.nodeType==3?e.focusNode.parentNode:e.focusNode))}catch{return!1}}function mu(n,e){let{$anchor:t,$head:r}=n.selection,i=e>0?t.max(r):t.min(r),o=i.parent.inlineContent?i.depth?n.doc.resolve(e>0?i.after():i.before()):null:i;return o&&he.findFrom(o,e)}function Cr(n,e){return n.dispatch(n.state.tr.setSelection(e).scrollIntoView()),!0}function qm(n,e,t){let r=n.state.selection;if(r instanceof pe){if(!r.empty||t.indexOf("s")>-1)return!1;if(n.endOfTextblock(e>0?"right":"left")){let i=mu(n.state,e);return i&&i instanceof X?Cr(n,i):!1}else if(!(Ft&&t.indexOf("m")>-1)){let i=r.$head,o=i.textOffset?null:e<0?i.nodeBefore:i.nodeAfter,a;if(!o||o.isText)return!1;let c=e<0?i.pos-o.nodeSize:i.pos;return o.isAtom||(a=n.docView.descAt(c))&&!a.contentDOM?X.isSelectable(o)?Cr(n,new X(e<0?n.state.doc.resolve(i.pos-o.nodeSize):i)):du?Cr(n,new pe(n.state.doc.resolve(e<0?c:c+o.nodeSize))):!1:!1}}else{if(r instanceof X&&r.node.isInline)return Cr(n,new pe(e>0?r.$to:r.$from));{let i=mu(n.state,e);return i?Cr(n,i):!1}}}function fl(n){return n.nodeType==3?n.nodeValue.length:n.childNodes.length}function Es(n){let e=n.pmViewDesc;return e&&e.size==0&&(n.nextSibling||n.nodeName!="BR")}function gu(n){let e=n.domSelectionRange(),t=e.focusNode,r=e.focusOffset;if(!t)return;let i,o,a=!1;for(ul&&t.nodeType==1&&r<fl(t)&&Es(t.childNodes[r])&&(a=!0);;)if(r>0){if(t.nodeType!=1)break;{let c=t.childNodes[r-1];if(Es(c))i=t,o=--r;else if(c.nodeType==3)t=c,r=t.nodeValue.length;else break}}else{if(Jm(t))break;{let c=t.previousSibling;for(;c&&Es(c);)i=t.parentNode,o=ws(c),c=c.previousSibling;if(c)t=c,r=fl(t);else{if(t=t.parentNode,t==n.dom)break;r=0}}}a?bu(n,t,r):i&&bu(n,i,o)}function yu(n){let e=n.domSelectionRange(),t=e.focusNode,r=e.focusOffset;if(!t)return;let i=fl(t),o,a;for(;;)if(r<i){if(t.nodeType!=1)break;let c=t.childNodes[r];if(Es(c))o=t,a=++r;else break}else{if(Jm(t))break;{let c=t.nextSibling;for(;c&&Es(c);)o=c.parentNode,a=ws(c)+1,c=c.nextSibling;if(c)t=c,r=0,i=fl(t);else{if(t=t.parentNode,t==n.dom)break;r=i=0}}}o&&bu(n,o,a)}function Jm(n){let e=n.pmViewDesc;return e&&e.node&&e.node.isBlock}function bu(n,e,t){let r=n.domSelection();if(Dm(r)){let o=document.createRange();o.setEnd(e,t),o.setStart(e,t),r.removeAllRanges(),r.addRange(o)}else r.extend&&r.extend(e,t);n.domObserver.setCurSelection();let{state:i}=n;setTimeout(()=>{n.state==i&&hu(n)},50)}function jm(n,e,t){let r=n.state.selection;if(r instanceof pe&&!r.empty||t.indexOf("s")>-1||Ft&&t.indexOf("m")>-1)return!1;let{$from:i,$to:o}=r;if(!i.parent.inlineContent||n.endOfTextblock(e<0?"up":"down")){let a=mu(n.state,e);if(a&&a instanceof X)return Cr(n,a)}if(!i.parent.inlineContent){let a=e<0?i:o,c=r instanceof Qt?he.near(a,e):he.findFrom(a,e);return c?Cr(n,c):!1}return!1}function Ym(n,e){if(!(n.state.selection instanceof pe))return!0;let{$head:t,$anchor:r,empty:i}=n.state.selection;if(!t.sameParent(r))return!0;if(!i)return!1;if(n.endOfTextblock(e>0?"forward":"backward"))return!0;let o=!t.textOffset&&(e<0?t.nodeBefore:t.nodeAfter);if(o&&!o.isText){let a=n.state.tr;return e<0?a.delete(t.pos-o.nodeSize,t.pos):a.delete(t.pos,t.pos+o.nodeSize),n.dispatch(a),!0}return!1}function Xm(n,e,t){n.domObserver.stop(),e.contentEditable=t,n.domObserver.start()}function nT(n){if(!Tr||n.state.selection.$head.parentOffset>0)return!1;let{focusNode:e,focusOffset:t}=n.domSelectionRange();if(e&&e.nodeType==1&&t==0&&e.firstChild&&e.firstChild.contentEditable=="false"){let r=e.firstChild;Xm(n,r,"true"),setTimeout(()=>Xm(n,r,"false"),20)}return!1}function rT(n){let e="";return n.ctrlKey&&(e+="c"),n.metaKey&&(e+="m"),n.altKey&&(e+="a"),n.shiftKey&&(e+="s"),e}function iT(n,e){let t=e.keyCode,r=rT(e);return t==8||Ft&&t==72&&r=="c"?Ym(n,-1)||gu(n):t==46||Ft&&t==68&&r=="c"?Ym(n,1)||yu(n):t==13||t==27?!0:t==37||Ft&&t==66&&r=="c"?qm(n,-1,r)||gu(n):t==39||Ft&&t==70&&r=="c"?qm(n,1,r)||yu(n):t==38||Ft&&t==80&&r=="c"?jm(n,-1,r)||gu(n):t==40||Ft&&t==78&&r=="c"?nT(n)||jm(n,1,r)||yu(n):r==(Ft?"m":"c")&&(t==66||t==73||t==89||t==90)}function Zm(n,e){n.someProp("transformCopied",S=>{e=S(e,n)});let t=[],{content:r,openStart:i,openEnd:o}=e;for(;i>1&&o>1&&r.childCount==1&&r.firstChild.childCount==1;){i--,o--;let S=r.firstChild;t.push(S.type.name,S.attrs!=S.type.defaultAttrs?S.attrs:null),r=S.content}let a=n.someProp("clipboardSerializer")||Hr.fromSchema(n.state.schema),c=og(),f=c.createElement("div");f.appendChild(a.serializeFragment(r,{document:c}));let h=f.firstChild,m,p=0;for(;h&&h.nodeType==1&&(m=ig[h.nodeName.toLowerCase()]);){for(let S=m.length-1;S>=0;S--){let _=c.createElement(m[S]);for(;f.firstChild;)_.appendChild(f.firstChild);f.appendChild(_),p++}h=f.firstChild}h&&h.nodeType==1&&h.setAttribute("data-pm-slice",`${i} ${o}${p?` -${p}`:""} ${JSON.stringify(t)}`);let y=n.someProp("clipboardTextSerializer",S=>S(e,n))||e.content.textBetween(0,e.content.size,`
11
9
 
12
- `);return{dom:f,text:b}}function Qm(n,e,t,r,i){let o=i.parent.type.spec.code,a,u;if(!t&&!e)return null;let f=e&&(r||o||!t);if(f){if(n.someProp("transformPastedText",b=>{e=b(e,o||r,n)}),o)return e?new $(L.from(n.state.schema.text(e.replace(/\r\n?/g,`
13
- `))),0,0):$.empty;let p=n.someProp("clipboardTextParser",b=>b(e,i,r,n));if(p)u=p;else{let b=i.marks(),{schema:S}=n.state,x=Hr.fromSchema(S);a=document.createElement("div"),e.split(/(?:\r\n?|\n)+/).forEach(C=>{let A=a.appendChild(document.createElement("p"));C&&A.appendChild(x.serializeNode(S.text(C,b)))})}}else n.someProp("transformPastedHTML",p=>{t=p(t,n)}),a=iT(t),sc&&sT(a);let h=a&&a.querySelector("[data-pm-slice]"),m=h&&/^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(h.getAttribute("data-pm-slice")||"");if(m&&m[3])for(let p=+m[3];p>0;p--){let b=a.firstChild;for(;b&&b.nodeType!=1;)b=b.nextSibling;if(!b)break;a=b}if(u||(u=(n.someProp("clipboardParser")||n.someProp("domParser")||Uu.fromSchema(n.state.schema)).parseSlice(a,{preserveWhitespace:!!(f||m),context:i,ruleFromNode(b){return b.nodeName=="BR"&&!b.nextSibling&&b.parentNode&&!nT.test(b.parentNode.nodeName)?{ignore:!0}:null}})),m)u=oT(rg(u,+m[1],+m[2]),m[4]);else if(u=$.maxOpen(rT(u.content,i),!0),u.openStart||u.openEnd){let p=0,b=0;for(let S=u.content.firstChild;p<u.openStart&&!S.type.spec.isolating;p++,S=S.firstChild);for(let S=u.content.lastChild;b<u.openEnd&&!S.type.spec.isolating;b++,S=S.lastChild);u=rg(u,p,b)}return n.someProp("transformPasted",p=>{u=p(u,n)}),u}const nT=/^(a|abbr|acronym|b|cite|code|del|em|i|ins|kbd|label|output|q|ruby|s|samp|span|strong|sub|sup|time|u|tt|var)$/i;function rT(n,e){if(n.childCount<2)return n;for(let t=e.depth;t>=0;t--){let i=e.node(t).contentMatchAt(e.index(t)),o,a=[];if(n.forEach(u=>{if(!a)return;let f=i.findWrapping(u.type),h;if(!f)return a=null;if(h=a.length&&o.length&&tg(f,o,u,a[a.length-1],0))a[a.length-1]=h;else{a.length&&(a[a.length-1]=ng(a[a.length-1],o.length));let m=eg(u,f);a.push(m),i=i.matchType(m.type),o=f}}),a)return L.from(a)}return n}function eg(n,e,t=0){for(let r=e.length-1;r>=t;r--)n=e[r].create(null,L.from(n));return n}function tg(n,e,t,r,i){if(i<n.length&&i<e.length&&n[i]==e[i]){let o=tg(n,e,t,r.lastChild,i+1);if(o)return r.copy(r.content.replaceChild(r.childCount-1,o));if(r.contentMatchAt(r.childCount).matchType(i==n.length-1?t.type:n[i+1]))return r.copy(r.content.append(L.from(eg(t,n,i+1))))}}function ng(n,e){if(e==0)return n;let t=n.content.replaceChild(n.childCount-1,ng(n.lastChild,e-1)),r=n.contentMatchAt(n.childCount).fillBefore(L.empty,!0);return n.copy(t.append(r))}function dc(n,e,t,r,i,o){let a=e<0?n.firstChild:n.lastChild,u=a.content;return i<r-1&&(u=dc(u,e,t,r,i+1,o)),i>=t&&(u=e<0?a.contentMatchAt(0).fillBefore(u,n.childCount>1||o<=i).append(u):u.append(a.contentMatchAt(a.childCount).fillBefore(L.empty,!0))),n.replaceChild(e<0?0:n.childCount-1,a.copy(u))}function rg(n,e,t){return e<n.openStart&&(n=new $(dc(n.content,-1,e,n.openStart,0,n.openEnd),e,n.openEnd)),t<n.openEnd&&(n=new $(dc(n.content,1,t,n.openEnd,0,0),n.openStart,t)),n}const ig={thead:["table"],tbody:["table"],tfoot:["table"],caption:["table"],colgroup:["table"],col:["table","colgroup"],tr:["table","tbody"],td:["table","tbody","tr"],th:["table","tbody","tr"]};let sg=null;function og(){return sg||(sg=document.implementation.createHTMLDocument("title"))}function iT(n){let e=/^(\s*<meta [^>]*>)*/.exec(n);e&&(n=n.slice(e[0].length));let t=og().createElement("div"),r=/<([a-z][^>\s]+)/i.exec(n),i;if((i=r&&ig[r[1].toLowerCase()])&&(n=i.map(o=>"<"+o+">").join("")+n+i.map(o=>"</"+o+">").reverse().join("")),t.innerHTML=n,i)for(let o=0;o<i.length;o++)t=t.querySelector(i[o])||t;return t}function sT(n){let e=n.querySelectorAll(yi?"span:not([class]):not([style])":"span.Apple-converted-space");for(let t=0;t<e.length;t++){let r=e[t];r.childNodes.length==1&&r.textContent=="\xA0"&&r.parentNode&&r.parentNode.replaceChild(n.ownerDocument.createTextNode(" "),r)}}function oT(n,e){if(!n.size)return n;let t=n.content.firstChild.type.schema,r;try{r=JSON.parse(e)}catch{return n}let{content:i,openStart:o,openEnd:a}=n;for(let u=r.length-2;u>=0;u-=2){let f=t.nodes[r[u]];if(!f||f.hasRequiredAttrs())break;i=L.from(f.create(r[u+1],i)),o++,a++}return new $(i,o,a)}const Gt={},wt={};function qn(n,e){n.input.lastSelectionOrigin=e,n.input.lastSelectionTime=Date.now()}wt.keydown=(n,e)=>{let t=e;if(n.input.shiftKey=t.keyCode==16||t.shiftKey,!ag(n,t)&&(n.input.lastKeyCode=t.keyCode,n.input.lastKeyCodeTime=Date.now(),!(vs&&yi&&t.keyCode==13)))if(t.keyCode!=229&&n.domObserver.forceFlush(),ic&&t.keyCode==13&&!t.ctrlKey&&!t.altKey&&!t.metaKey){let r=Date.now();n.input.lastIOSEnter=r,n.input.lastIOSEnterFallbackTimeout=setTimeout(()=>{n.input.lastIOSEnter==r&&(n.someProp("handleKeyDown",i=>i(n,Fm(13,"Enter"))),n.input.lastIOSEnter=0)},200)}else n.someProp("handleKeyDown",r=>r(n,t))||tT(n,t)?t.preventDefault():qn(n,"key")},wt.keyup=(n,e)=>{e.keyCode==16&&(n.input.shiftKey=!1)},wt.keypress=(n,e)=>{let t=e;if(ag(n,t)||!t.charCode||t.ctrlKey&&!t.altKey||It&&t.metaKey)return;if(n.someProp("handleKeyPress",i=>i(n,t))){t.preventDefault();return}let r=n.state.selection;if(!(r instanceof he)||!r.$from.sameParent(r.$to)){let i=String.fromCharCode(t.charCode);n.someProp("handleTextInput",o=>o(n,r.$from.pos,r.$to.pos,i))||n.dispatch(n.state.tr.insertText(i).scrollIntoView()),t.preventDefault()}};function ol(n){return{left:n.clientX,top:n.clientY}}function lT(n,e){let t=e.x-n.clientX,r=e.y-n.clientY;return t*t+r*r<100}function hc(n,e,t,r,i){if(r==-1)return!1;let o=n.state.doc.resolve(r);for(let a=o.depth+1;a>0;a--)if(n.someProp(e,u=>a>o.depth?u(n,t,o.nodeAfter,o.before(a),i,!0):u(n,t,o.node(a),o.before(a),i,!1)))return!0;return!1}function bi(n,e,t){n.focused||n.focus();let r=n.state.tr.setSelection(e);r.setMeta("pointer",!0),n.dispatch(r)}function aT(n,e){if(e==-1)return!1;let t=n.state.doc.resolve(e),r=t.nodeAfter;return r&&r.isAtom&&Y.isSelectable(r)?(bi(n,new Y(t)),!0):!1}function uT(n,e){if(e==-1)return!1;let t=n.state.selection,r,i;t instanceof Y&&(r=t.node);let o=n.state.doc.resolve(e);for(let a=o.depth+1;a>0;a--){let u=a>o.depth?o.nodeAfter:o.node(a);if(Y.isSelectable(u)){r&&t.$from.depth>0&&a>=t.$from.depth&&o.before(t.$from.depth+1)==t.$from.pos?i=o.before(t.$from.depth):i=o.before(a);break}}return i!=null?(bi(n,Y.create(n.state.doc,i)),!0):!1}function cT(n,e,t,r,i){return hc(n,"handleClickOn",e,t,r)||n.someProp("handleClick",o=>o(n,e,r))||(i?uT(n,t):aT(n,t))}function fT(n,e,t,r){return hc(n,"handleDoubleClickOn",e,t,r)||n.someProp("handleDoubleClick",i=>i(n,e,r))}function dT(n,e,t,r){return hc(n,"handleTripleClickOn",e,t,r)||n.someProp("handleTripleClick",i=>i(n,e,r))||hT(n,t,r)}function hT(n,e,t){if(t.button!=0)return!1;let r=n.state.doc;if(e==-1)return r.inlineContent?(bi(n,he.create(r,0,r.content.size)),!0):!1;let i=r.resolve(e);for(let o=i.depth+1;o>0;o--){let a=o>i.depth?i.nodeAfter:i.node(o),u=i.before(o);if(a.inlineContent)bi(n,he.create(r,u+1,u+1+a.content.size));else if(Y.isSelectable(a))bi(n,Y.create(r,u));else continue;return!0}}function pc(n){return ll(n)}const lg=It?"metaKey":"ctrlKey";Gt.mousedown=(n,e)=>{let t=e;n.input.shiftKey=t.shiftKey;let r=pc(n),i=Date.now(),o="singleClick";i-n.input.lastClick.time<500&&lT(t,n.input.lastClick)&&!t[lg]&&(n.input.lastClick.type=="singleClick"?o="doubleClick":n.input.lastClick.type=="doubleClick"&&(o="tripleClick")),n.input.lastClick={time:i,x:t.clientX,y:t.clientY,type:o};let a=n.posAtCoords(ol(t));a&&(o=="singleClick"?(n.input.mouseDown&&n.input.mouseDown.done(),n.input.mouseDown=new pT(n,a,t,!!r)):(o=="doubleClick"?fT:dT)(n,a.pos,a.inside,t)?t.preventDefault():qn(n,"pointer"))};class pT{constructor(e,t,r,i){this.view=e,this.pos=t,this.event=r,this.flushed=i,this.delayedSelectionSync=!1,this.mightDrag=null,this.startDoc=e.state.doc,this.selectNode=!!r[lg],this.allowDefault=r.shiftKey;let o,a;if(t.inside>-1)o=e.state.doc.nodeAt(t.inside),a=t.inside;else{let m=e.state.doc.resolve(t.pos);o=m.parent,a=m.depth?m.before():0}const u=i?null:r.target,f=u?e.docView.nearestDesc(u,!0):null;this.target=f?f.dom:null;let{selection:h}=e.state;(r.button==0&&o.type.spec.draggable&&o.type.spec.selectable!==!1||h instanceof Y&&h.from<=a&&h.to>a)&&(this.mightDrag={node:o,pos:a,addAttr:!!(this.target&&!this.target.draggable),setUneditable:!!(this.target&&il&&!this.target.hasAttribute("contentEditable"))}),this.target&&this.mightDrag&&(this.mightDrag.addAttr||this.mightDrag.setUneditable)&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&(this.target.draggable=!0),this.mightDrag.setUneditable&&setTimeout(()=>{this.view.input.mouseDown==this&&this.target.setAttribute("contentEditable","false")},20),this.view.domObserver.start()),e.root.addEventListener("mouseup",this.up=this.up.bind(this)),e.root.addEventListener("mousemove",this.move=this.move.bind(this)),qn(e,"pointer")}done(){this.view.root.removeEventListener("mouseup",this.up),this.view.root.removeEventListener("mousemove",this.move),this.mightDrag&&this.target&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&this.target.removeAttribute("draggable"),this.mightDrag.setUneditable&&this.target.removeAttribute("contentEditable"),this.view.domObserver.start()),this.delayedSelectionSync&&setTimeout(()=>oc(this.view)),this.view.input.mouseDown=null}up(e){if(this.done(),!this.view.dom.contains(e.target))return;let t=this.pos;this.view.state.doc!=this.startDoc&&(t=this.view.posAtCoords(ol(e))),this.updateAllowDefault(e),this.allowDefault||!t?qn(this.view,"pointer"):cT(this.view,t.pos,t.inside,e,this.selectNode)?e.preventDefault():e.button==0&&(this.flushed||Tr&&this.mightDrag&&!this.mightDrag.node.isAtom||yi&&!this.view.state.selection.visible&&Math.min(Math.abs(t.pos-this.view.state.selection.from),Math.abs(t.pos-this.view.state.selection.to))<=2)?(bi(this.view,de.near(this.view.state.doc.resolve(t.pos))),e.preventDefault()):qn(this.view,"pointer")}move(e){this.updateAllowDefault(e),qn(this.view,"pointer"),e.buttons==0&&this.done()}updateAllowDefault(e){!this.allowDefault&&(Math.abs(this.event.x-e.clientX)>4||Math.abs(this.event.y-e.clientY)>4)&&(this.allowDefault=!0)}}Gt.touchstart=n=>{n.input.lastTouch=Date.now(),pc(n),qn(n,"pointer")},Gt.touchmove=n=>{n.input.lastTouch=Date.now(),qn(n,"pointer")},Gt.contextmenu=n=>pc(n);function ag(n,e){return n.composing?!0:Tr&&Math.abs(e.timeStamp-n.input.compositionEndedAt)<500?(n.input.compositionEndedAt=-2e8,!0):!1}const mT=vs?5e3:-1;wt.compositionstart=wt.compositionupdate=n=>{if(!n.composing){n.domObserver.flush();let{state:e}=n,t=e.selection.$from;if(e.selection.empty&&(e.storedMarks||!t.textOffset&&t.parentOffset&&t.nodeBefore.marks.some(r=>r.type.spec.inclusive===!1)))n.markCursor=n.state.storedMarks||t.marks(),ll(n,!0),n.markCursor=null;else if(ll(n),il&&e.selection.empty&&t.parentOffset&&!t.textOffset&&t.nodeBefore.marks.length){let r=n.domSelectionRange();for(let i=r.focusNode,o=r.focusOffset;i&&i.nodeType==1&&o!=0;){let a=o<0?i.lastChild:i.childNodes[o-1];if(!a)break;if(a.nodeType==3){n.domSelection().collapse(a,a.nodeValue.length);break}else i=a,o=-1}}n.input.composing=!0}ug(n,mT)},wt.compositionend=(n,e)=>{n.composing&&(n.input.composing=!1,n.input.compositionEndedAt=e.timeStamp,ug(n,20))};function ug(n,e){clearTimeout(n.input.composingTimeout),e>-1&&(n.input.composingTimeout=setTimeout(()=>ll(n),e))}function gT(n){for(n.composing&&(n.input.composing=!1,n.input.compositionEndedAt=yT());n.input.compositionNodes.length>0;)n.input.compositionNodes.pop().markParentsDirty()}function yT(){let n=document.createEvent("Event");return n.initEvent("event",!0,!0),n.timeStamp}function ll(n,e=!1){if(!(vs&&n.domObserver.flushingSoon>=0)){if(n.domObserver.forceFlush(),gT(n),e||n.docView&&n.docView.dirty){let t=JE(n);return t&&!t.eq(n.state.selection)?n.dispatch(n.state.tr.setSelection(t)):n.updateState(n.state),!0}return!1}}function bT(n,e){if(!n.dom.parentNode)return;let t=n.dom.parentNode.appendChild(document.createElement("div"));t.appendChild(e),t.style.cssText="position: fixed; left: -10000px; top: 10px";let r=getSelection(),i=document.createRange();i.selectNodeContents(e),n.dom.blur(),r.removeAllRanges(),r.addRange(i),setTimeout(()=>{t.parentNode&&t.parentNode.removeChild(t),n.focus()},50)}const vi=bs&&Hm<15||ic&&qE<604;Gt.copy=wt.cut=(n,e)=>{let t=e,r=n.state.selection,i=t.type=="cut";if(r.empty)return;let o=vi?null:t.clipboardData,a=r.content(),{dom:u,text:f}=Zm(n,a);o?(t.preventDefault(),o.clearData(),o.setData("text/html",u.innerHTML),o.setData("text/plain",f)):bT(n,u),i&&n.dispatch(n.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))};function vT(n){return n.openStart==0&&n.openEnd==0&&n.content.childCount==1?n.content.firstChild:null}function ST(n,e){if(!n.dom.parentNode)return;let t=n.input.shiftKey||n.state.selection.$from.parent.type.spec.code,r=n.dom.parentNode.appendChild(document.createElement(t?"textarea":"div"));t||(r.contentEditable="true"),r.style.cssText="position: fixed; left: -10000px; top: 10px",r.focus(),setTimeout(()=>{n.focus(),r.parentNode&&r.parentNode.removeChild(r),t?mc(n,r.value,null,e):mc(n,r.textContent,r.innerHTML,e)},50)}function mc(n,e,t,r){let i=Qm(n,e,t,n.input.shiftKey,n.state.selection.$from);if(n.someProp("handlePaste",u=>u(n,r,i||$.empty)))return!0;if(!i)return!1;let o=vT(i),a=o?n.state.tr.replaceSelectionWith(o,n.input.shiftKey):n.state.tr.replaceSelection(i);return n.dispatch(a.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste")),!0}wt.paste=(n,e)=>{let t=e;if(n.composing&&!vs)return;let r=vi?null:t.clipboardData;r&&mc(n,r.getData("text/plain"),r.getData("text/html"),t)?t.preventDefault():ST(n,t)};class wT{constructor(e,t){this.slice=e,this.move=t}}const cg=It?"altKey":"ctrlKey";Gt.dragstart=(n,e)=>{let t=e,r=n.input.mouseDown;if(r&&r.done(),!t.dataTransfer)return;let i=n.state.selection,o=i.empty?null:n.posAtCoords(ol(t));if(!(o&&o.pos>=i.from&&o.pos<=(i instanceof Y?i.to-1:i.to))){if(r&&r.mightDrag)n.dispatch(n.state.tr.setSelection(Y.create(n.state.doc,r.mightDrag.pos)));else if(t.target&&t.target.nodeType==1){let h=n.docView.nearestDesc(t.target,!0);h&&h.node.type.spec.draggable&&h!=n.docView&&n.dispatch(n.state.tr.setSelection(Y.create(n.state.doc,h.posBefore)))}}let a=n.state.selection.content(),{dom:u,text:f}=Zm(n,a);t.dataTransfer.clearData(),t.dataTransfer.setData(vi?"Text":"text/html",u.innerHTML),t.dataTransfer.effectAllowed="copyMove",vi||t.dataTransfer.setData("text/plain",f),n.dragging=new wT(a,!t[cg])},Gt.dragend=n=>{let e=n.dragging;window.setTimeout(()=>{n.dragging==e&&(n.dragging=null)},50)},wt.dragover=wt.dragenter=(n,e)=>e.preventDefault(),wt.drop=(n,e)=>{let t=e,r=n.dragging;if(n.dragging=null,!t.dataTransfer)return;let i=n.posAtCoords(ol(t));if(!i)return;let o=n.state.doc.resolve(i.pos),a=r&&r.slice;a?n.someProp("transformPasted",x=>{a=x(a,n)}):a=Qm(n,t.dataTransfer.getData(vi?"Text":"text/plain"),vi?null:t.dataTransfer.getData("text/html"),!1,o);let u=!!(r&&!t[cg]);if(n.someProp("handleDrop",x=>x(n,t,a||$.empty,u))){t.preventDefault();return}if(!a)return;t.preventDefault();let f=a?RE(n.state.doc,o.pos,a):o.pos;f==null&&(f=o.pos);let h=n.state.tr;u&&h.deleteSelection();let m=h.mapping.map(f),p=a.openStart==0&&a.openEnd==0&&a.content.childCount==1,b=h.doc;if(p?h.replaceRangeWith(m,m,a.content.firstChild):h.replaceRange(m,m,a),h.doc.eq(b))return;let S=h.doc.resolve(m);if(p&&Y.isSelectable(a.content.firstChild)&&S.nodeAfter&&S.nodeAfter.sameMarkup(a.content.firstChild))h.setSelection(new Y(S));else{let x=h.mapping.map(f);h.mapping.maps[h.mapping.maps.length-1].forEach((C,A,N,G)=>x=G),h.setSelection(Gm(n,S,h.doc.resolve(x)))}n.focus(),n.dispatch(h.setMeta("uiEvent","drop"))},Gt.focus=n=>{n.input.lastFocus=Date.now(),n.focused||(n.domObserver.stop(),n.dom.classList.add("ProseMirror-focused"),n.domObserver.start(),n.focused=!0,setTimeout(()=>{n.docView&&n.hasFocus()&&!n.domObserver.currentSelection.eq(n.domSelectionRange())&&oc(n)},20))},Gt.blur=(n,e)=>{let t=e;n.focused&&(n.domObserver.stop(),n.dom.classList.remove("ProseMirror-focused"),n.domObserver.start(),t.relatedTarget&&n.dom.contains(t.relatedTarget)&&n.domObserver.currentSelection.clear(),n.focused=!1)},Gt.beforeinput=(n,e)=>{if(yi&&vs&&e.inputType=="deleteContentBackward"){n.domObserver.flushSoon();let{domChangeCount:r}=n.input;setTimeout(()=>{if(n.input.domChangeCount!=r||(n.dom.blur(),n.focus(),n.someProp("handleKeyDown",o=>o(n,Fm(8,"Backspace")))))return;let{$cursor:i}=n.state.selection;i&&i.pos>0&&n.dispatch(n.state.tr.delete(i.pos-1,i.pos).scrollIntoView())},50)}};for(let n in wt)Gt[n]=wt[n];function ws(n,e){if(n==e)return!0;for(let t in n)if(n[t]!==e[t])return!1;for(let t in e)if(!(t in n))return!1;return!0}class mf{constructor(e,t){this.toDOM=e,this.spec=t||Ar,this.side=this.spec.side||0}map(e,t,r,i){let{pos:o,deleted:a}=e.mapResult(t.from+i,this.side<0?-1:1);return a?null:new fn(o-r,o-r,this)}valid(){return!0}eq(e){return this==e||e instanceof mf&&(this.spec.key&&this.spec.key==e.spec.key||this.toDOM==e.toDOM&&ws(this.spec,e.spec))}destroy(e){this.spec.destroy&&this.spec.destroy(e)}}class nr{constructor(e,t){this.attrs=e,this.spec=t||Ar}map(e,t,r,i){let o=e.map(t.from+i,this.spec.inclusiveStart?-1:1)-r,a=e.map(t.to+i,this.spec.inclusiveEnd?1:-1)-r;return o>=a?null:new fn(o,a,this)}valid(e,t){return t.from<t.to}eq(e){return this==e||e instanceof nr&&ws(this.attrs,e.attrs)&&ws(this.spec,e.spec)}static is(e){return e.type instanceof nr}destroy(){}}class gf{constructor(e,t){this.attrs=e,this.spec=t||Ar}map(e,t,r,i){let o=e.mapResult(t.from+i,1);if(o.deleted)return null;let a=e.mapResult(t.to+i,-1);return a.deleted||a.pos<=o.pos?null:new fn(o.pos-r,a.pos-r,this)}valid(e,t){let{index:r,offset:i}=e.content.findIndex(t.from),o;return i==t.from&&!(o=e.child(r)).isText&&i+o.nodeSize==t.to}eq(e){return this==e||e instanceof gf&&ws(this.attrs,e.attrs)&&ws(this.spec,e.spec)}destroy(){}}class fn{constructor(e,t,r){this.from=e,this.to=t,this.type=r}copy(e,t){return new fn(e,t,this.type)}eq(e,t=0){return this.type.eq(e.type)&&this.from+t==e.from&&this.to+t==e.to}map(e,t,r){return this.type.map(e,this,t,r)}static widget(e,t,r){return new fn(e,e,new mf(t,r))}static inline(e,t,r,i){return new fn(e,t,new nr(r,i))}static node(e,t,r,i){return new fn(e,t,new gf(r,i))}get spec(){return this.type.spec}get inline(){return this.type instanceof nr}}const Si=[],Ar={};class He{constructor(e,t){this.local=e.length?e:Si,this.children=t.length?t:Si}static create(e,t){return t.length?al(t,e,0,Ar):ot}find(e,t,r){let i=[];return this.findInner(e??0,t??1e9,i,0,r),i}findInner(e,t,r,i,o){for(let a=0;a<this.local.length;a++){let u=this.local[a];u.from<=t&&u.to>=e&&(!o||o(u.spec))&&r.push(u.copy(u.from+i,u.to+i))}for(let a=0;a<this.children.length;a+=3)if(this.children[a]<t&&this.children[a+1]>e){let u=this.children[a]+1;this.children[a+2].findInner(e-u,t-u,r,i+u,o)}}map(e,t,r){return this==ot||e.maps.length==0?this:this.mapInner(e,t,0,0,r||Ar)}mapInner(e,t,r,i,o){let a;for(let u=0;u<this.local.length;u++){let f=this.local[u].map(e,r,i);f&&f.type.valid(t,f)?(a||(a=[])).push(f):o.onRemove&&o.onRemove(this.local[u].spec)}return this.children.length?_T(this.children,a||[],e,t,r,i,o):a?new He(a.sort(Mr),Si):ot}add(e,t){return t.length?this==ot?He.create(e,t):this.addInner(e,t,0):this}addInner(e,t,r){let i,o=0;e.forEach((u,f)=>{let h=f+r,m;if(m=dg(t,u,h)){for(i||(i=this.children.slice());o<i.length&&i[o]<f;)o+=3;i[o]==f?i[o+2]=i[o+2].addInner(u,m,h+1):i.splice(o,0,f,f+u.nodeSize,al(m,u,h+1,Ar)),o+=3}});let a=fg(o?hg(t):t,-r);for(let u=0;u<a.length;u++)a[u].type.valid(e,a[u])||a.splice(u--,1);return new He(a.length?this.local.concat(a).sort(Mr):this.local,i||this.children)}remove(e){return e.length==0||this==ot?this:this.removeInner(e,0)}removeInner(e,t){let r=this.children,i=this.local;for(let o=0;o<r.length;o+=3){let a,u=r[o]+t,f=r[o+1]+t;for(let m=0,p;m<e.length;m++)(p=e[m])&&p.from>u&&p.to<f&&(e[m]=null,(a||(a=[])).push(p));if(!a)continue;r==this.children&&(r=this.children.slice());let h=r[o+2].removeInner(a,u+1);h!=ot?r[o+2]=h:(r.splice(o,3),o-=3)}if(i.length){for(let o=0,a;o<e.length;o++)if(a=e[o])for(let u=0;u<i.length;u++)i[u].eq(a,t)&&(i==this.local&&(i=this.local.slice()),i.splice(u--,1))}return r==this.children&&i==this.local?this:i.length||r.length?new He(i,r):ot}forChild(e,t){if(this==ot)return this;if(t.isLeaf)return He.empty;let r,i;for(let u=0;u<this.children.length;u+=3)if(this.children[u]>=e){this.children[u]==e&&(r=this.children[u+2]);break}let o=e+1,a=o+t.content.size;for(let u=0;u<this.local.length;u++){let f=this.local[u];if(f.from<a&&f.to>o&&f.type instanceof nr){let h=Math.max(o,f.from)-o,m=Math.min(a,f.to)-o;h<m&&(i||(i=[])).push(f.copy(h,m))}}if(i){let u=new He(i.sort(Mr),Si);return r?new zr([u,r]):u}return r||ot}eq(e){if(this==e)return!0;if(!(e instanceof He)||this.local.length!=e.local.length||this.children.length!=e.children.length)return!1;for(let t=0;t<this.local.length;t++)if(!this.local[t].eq(e.local[t]))return!1;for(let t=0;t<this.children.length;t+=3)if(this.children[t]!=e.children[t]||this.children[t+1]!=e.children[t+1]||!this.children[t+2].eq(e.children[t+2]))return!1;return!0}locals(e){return gc(this.localsInner(e))}localsInner(e){if(this==ot)return Si;if(e.inlineContent||!this.local.some(nr.is))return this.local;let t=[];for(let r=0;r<this.local.length;r++)this.local[r].type instanceof nr||t.push(this.local[r]);return t}}He.empty=new He([],[]),He.removeOverlap=gc;const ot=He.empty;class zr{constructor(e){this.members=e}map(e,t){const r=this.members.map(i=>i.map(e,t,Ar));return zr.from(r)}forChild(e,t){if(t.isLeaf)return He.empty;let r=[];for(let i=0;i<this.members.length;i++){let o=this.members[i].forChild(e,t);o!=ot&&(o instanceof zr?r=r.concat(o.members):r.push(o))}return zr.from(r)}eq(e){if(!(e instanceof zr)||e.members.length!=this.members.length)return!1;for(let t=0;t<this.members.length;t++)if(!this.members[t].eq(e.members[t]))return!1;return!0}locals(e){let t,r=!0;for(let i=0;i<this.members.length;i++){let o=this.members[i].localsInner(e);if(o.length)if(!t)t=o;else{r&&(t=t.slice(),r=!1);for(let a=0;a<o.length;a++)t.push(o[a])}}return t?gc(r?t:t.sort(Mr)):Si}static from(e){switch(e.length){case 0:return ot;case 1:return e[0];default:return new zr(e.every(t=>t instanceof He)?e:e.reduce((t,r)=>t.concat(r instanceof He?r:r.members),[]))}}}function _T(n,e,t,r,i,o,a){let u=n.slice();for(let h=0,m=o;h<t.maps.length;h++){let p=0;t.maps[h].forEach((b,S,x,C)=>{let A=C-x-(S-b);for(let N=0;N<u.length;N+=3){let G=u[N+1];if(G<0||b>G+m-p)continue;let K=u[N]+m-p;S>=K?u[N+1]=b<=K?-2:-1:x>=i&&A&&(u[N]+=A,u[N+1]+=A)}p+=A}),m=t.maps[h].map(m,-1)}let f=!1;for(let h=0;h<u.length;h+=3)if(u[h+1]<0){if(u[h+1]==-2){f=!0,u[h+1]=-1;continue}let m=t.map(n[h]+o),p=m-i;if(p<0||p>=r.content.size){f=!0;continue}let b=t.map(n[h+1]+o,-1),S=b-i,{index:x,offset:C}=r.content.findIndex(p),A=r.maybeChild(x);if(A&&C==p&&C+A.nodeSize==S){let N=u[h+2].mapInner(t,A,m+1,n[h]+o+1,a);N!=ot?(u[h]=p,u[h+1]=S,u[h+2]=N):(u[h+1]=-2,f=!0)}else f=!0}if(f){let h=xT(u,n,e,t,i,o,a),m=al(h,r,0,a);e=m.local;for(let p=0;p<u.length;p+=3)u[p+1]<0&&(u.splice(p,3),p-=3);for(let p=0,b=0;p<m.children.length;p+=3){let S=m.children[p];for(;b<u.length&&u[b]<S;)b+=3;u.splice(b,0,m.children[p],m.children[p+1],m.children[p+2])}}return new He(e.sort(Mr),u)}function fg(n,e){if(!e||!n.length)return n;let t=[];for(let r=0;r<n.length;r++){let i=n[r];t.push(new fn(i.from+e,i.to+e,i.type))}return t}function xT(n,e,t,r,i,o,a){function u(f,h){for(let m=0;m<f.local.length;m++){let p=f.local[m].map(r,i,h);p?t.push(p):a.onRemove&&a.onRemove(f.local[m].spec)}for(let m=0;m<f.children.length;m+=3)u(f.children[m+2],f.children[m]+h+1)}for(let f=0;f<n.length;f+=3)n[f+1]==-1&&u(n[f+2],e[f]+o+1);return t}function dg(n,e,t){if(e.isLeaf)return null;let r=t+e.nodeSize,i=null;for(let o=0,a;o<n.length;o++)(a=n[o])&&a.from>t&&a.to<r&&((i||(i=[])).push(a),n[o]=null);return i}function hg(n){let e=[];for(let t=0;t<n.length;t++)n[t]!=null&&e.push(n[t]);return e}function al(n,e,t,r){let i=[],o=!1;e.forEach((u,f)=>{let h=dg(n,u,f+t);if(h){o=!0;let m=al(h,u,t+f+1,r);m!=ot&&i.push(f,f+u.nodeSize,m)}});let a=fg(o?hg(n):n,-t).sort(Mr);for(let u=0;u<a.length;u++)a[u].type.valid(e,a[u])||(r.onRemove&&r.onRemove(a[u].spec),a.splice(u--,1));return a.length||i.length?new He(a,i):ot}function Mr(n,e){return n.from-e.from||n.to-e.to}function gc(n){let e=n;for(let t=0;t<e.length-1;t++){let r=e[t];if(r.from!=r.to)for(let i=t+1;i<e.length;i++){let o=e[i];if(o.from==r.from){o.to!=r.to&&(e==n&&(e=n.slice()),e[i]=o.copy(o.from,r.to),pg(e,i+1,o.copy(r.to,o.to)));continue}else{o.from<r.to&&(e==n&&(e=n.slice()),e[t]=r.copy(r.from,o.from),pg(e,i,r.copy(o.from,r.to)));break}}}return e}function pg(n,e,t){for(;e<n.length&&Mr(t,n[e])>0;)e++;n.splice(e,0,t)}for(var Jn={8:"Backspace",9:"Tab",10:"Enter",12:"NumLock",13:"Enter",16:"Shift",17:"Control",18:"Alt",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",44:"PrintScreen",45:"Insert",46:"Delete",59:";",61:"=",91:"Meta",92:"Meta",106:"*",107:"+",108:",",109:"-",110:".",111:"/",144:"NumLock",145:"ScrollLock",160:"Shift",161:"Shift",162:"Control",163:"Control",164:"Alt",165:"Alt",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},ul={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},mg=typeof navigator<"u"&&/Chrome\/(\d+)/.exec(navigator.userAgent),kT=typeof navigator<"u"&&/Mac/.test(navigator.platform),ET=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),TT=kT||mg&&+mg[1]<57,Ge=0;Ge<10;Ge++)Jn[48+Ge]=Jn[96+Ge]=String(Ge);for(var Ge=1;Ge<=24;Ge++)Jn[Ge+111]="F"+Ge;for(var Ge=65;Ge<=90;Ge++)Jn[Ge]=String.fromCharCode(Ge+32),ul[Ge]=String.fromCharCode(Ge);for(var yc in Jn)ul.hasOwnProperty(yc)||(ul[yc]=Jn[yc]);function CT(n){var e=TT&&(n.ctrlKey||n.altKey||n.metaKey)||ET&&n.shiftKey&&n.key&&n.key.length==1||n.key=="Unidentified",t=!e&&n.key||(n.shiftKey?ul:Jn)[n.keyCode]||n.key||"Unidentified";return t=="Esc"&&(t="Escape"),t=="Del"&&(t="Delete"),t=="Left"&&(t="ArrowLeft"),t=="Up"&&(t="ArrowUp"),t=="Right"&&(t="ArrowRight"),t=="Down"&&(t="ArrowDown"),t}const AT=typeof navigator<"u"?/Mac|iP(hone|[oa]d)/.test(navigator.platform):!1;function MT(n){let e=n.split(/-(?!$)/),t=e[e.length-1];t=="Space"&&(t=" ");let r,i,o,a;for(let u=0;u<e.length-1;u++){let f=e[u];if(/^(cmd|meta|m)$/i.test(f))a=!0;else if(/^a(lt)?$/i.test(f))r=!0;else if(/^(c|ctrl|control)$/i.test(f))i=!0;else if(/^s(hift)?$/i.test(f))o=!0;else if(/^mod$/i.test(f))AT?a=!0:i=!0;else throw new Error("Unrecognized modifier name: "+f)}return r&&(t="Alt-"+t),i&&(t="Ctrl-"+t),a&&(t="Meta-"+t),o&&(t="Shift-"+t),t}function OT(n){let e=Object.create(null);for(let t in n)e[MT(t)]=n[t];return e}function bc(n,e,t){return e.altKey&&(n="Alt-"+n),e.ctrlKey&&(n="Ctrl-"+n),e.metaKey&&(n="Meta-"+n),t!==!1&&e.shiftKey&&(n="Shift-"+n),n}function IT(n){return new St({props:{handleKeyDown:NT(n)}})}function NT(n){let e=OT(n);return function(t,r){let i=CT(r),o=i.length==1&&i!=" ",a,u=e[bc(i,r,!o)];if(u&&u(t.state,t.dispatch,t))return!0;if(o&&(r.shiftKey||r.altKey||r.metaKey||i.charCodeAt(0)>127)&&(a=Jn[r.keyCode])&&a!=i){let f=e[bc(a,r,!0)];if(f&&f(t.state,t.dispatch,t))return!0}else if(o&&r.shiftKey){let f=e[bc(i,r,!0)];if(f&&f(t.state,t.dispatch,t))return!0}return!1}}const RT=(n,e)=>n.selection.empty?!1:(e&&e(n.tr.deleteSelection().scrollIntoView()),!0);function LT(n,e){let{$cursor:t}=n.selection;return!t||(e?!e.endOfTextblock("backward",n):t.parentOffset>0)?null:t}const PT=(n,e,t)=>{let r=LT(n,t);if(!r)return!1;let i=gg(r);if(!i){let a=r.blockRange(),u=a&&hi(a);return u==null?!1:(e&&e(n.tr.lift(a,u).scrollIntoView()),!0)}let o=i.nodeBefore;if(!o.type.spec.isolating&&vg(n,i,e))return!0;if(r.parent.content.size==0&&(wi(o,"end")||Y.isSelectable(o))){let a=Yu(n.doc,r.before(),r.after(),$.empty);if(a&&a.slice.size<a.to-a.from){if(e){let u=n.tr.step(a);u.setSelection(wi(o,"end")?de.findFrom(u.doc.resolve(u.mapping.map(i.pos,-1)),-1):Y.create(u.doc,i.pos-o.nodeSize)),e(u.scrollIntoView())}return!0}}return o.isAtom&&i.depth==r.depth-1?(e&&e(n.tr.delete(i.pos-o.nodeSize,i.pos).scrollIntoView()),!0):!1};function wi(n,e,t=!1){for(let r=n;r;r=e=="start"?r.firstChild:r.lastChild){if(r.isTextblock)return!0;if(t&&r.childCount!=1)return!1}return!1}const DT=(n,e,t)=>{let{$head:r,empty:i}=n.selection,o=r;if(!i)return!1;if(r.parent.isTextblock){if(t?!t.endOfTextblock("backward",n):r.parentOffset>0)return!1;o=gg(r)}let a=o&&o.nodeBefore;return!a||!Y.isSelectable(a)?!1:(e&&e(n.tr.setSelection(Y.create(n.doc,o.pos-a.nodeSize)).scrollIntoView()),!0)};function gg(n){if(!n.parent.type.spec.isolating)for(let e=n.depth-1;e>=0;e--){if(n.index(e)>0)return n.doc.resolve(n.before(e+1));if(n.node(e).type.spec.isolating)break}return null}function FT(n,e){let{$cursor:t}=n.selection;return!t||(e?!e.endOfTextblock("forward",n):t.parentOffset<t.parent.content.size)?null:t}const BT=(n,e,t)=>{let r=FT(n,t);if(!r)return!1;let i=yg(r);if(!i)return!1;let o=i.nodeAfter;if(vg(n,i,e))return!0;if(r.parent.content.size==0&&(wi(o,"start")||Y.isSelectable(o))){let a=Yu(n.doc,r.before(),r.after(),$.empty);if(a&&a.slice.size<a.to-a.from){if(e){let u=n.tr.step(a);u.setSelection(wi(o,"start")?de.findFrom(u.doc.resolve(u.mapping.map(i.pos)),1):Y.create(u.doc,u.mapping.map(i.pos))),e(u.scrollIntoView())}return!0}}return o.isAtom&&i.depth==r.depth-1?(e&&e(n.tr.delete(i.pos,i.pos+o.nodeSize).scrollIntoView()),!0):!1},zT=(n,e,t)=>{let{$head:r,empty:i}=n.selection,o=r;if(!i)return!1;if(r.parent.isTextblock){if(t?!t.endOfTextblock("forward",n):r.parentOffset<r.parent.content.size)return!1;o=yg(r)}let a=o&&o.nodeAfter;return!a||!Y.isSelectable(a)?!1:(e&&e(n.tr.setSelection(Y.create(n.doc,o.pos)).scrollIntoView()),!0)};function yg(n){if(!n.parent.type.spec.isolating)for(let e=n.depth-1;e>=0;e--){let t=n.node(e);if(n.index(e)+1<t.childCount)return n.doc.resolve(n.after(e+1));if(t.type.spec.isolating)break}return null}const HT=(n,e)=>{let t=n.selection,r=t instanceof Y,i;if(r){if(t.node.isTextblock||!Vn(n.doc,t.from))return!1;i=t.from}else if(i=tl(n.doc,t.from,-1),i==null)return!1;if(e){let o=n.tr.join(i);r&&o.setSelection(Y.create(o.doc,i-n.doc.resolve(i).nodeBefore.nodeSize)),e(o.scrollIntoView())}return!0},$T=(n,e)=>{let t=n.selection,r;if(t instanceof Y){if(t.node.isTextblock||!Vn(n.doc,t.to))return!1;r=t.to}else if(r=tl(n.doc,t.to,1),r==null)return!1;return e&&e(n.tr.join(r).scrollIntoView()),!0},WT=(n,e)=>{let{$from:t,$to:r}=n.selection,i=t.blockRange(r),o=i&&hi(i);return o==null?!1:(e&&e(n.tr.lift(i,o).scrollIntoView()),!0)},UT=(n,e)=>{let{$head:t,$anchor:r}=n.selection;return!t.parent.type.spec.code||!t.sameParent(r)?!1:(e&&e(n.tr.insertText(`
14
- `).scrollIntoView()),!0)};function bg(n){for(let e=0;e<n.edgeCount;e++){let{type:t}=n.edge(e);if(t.isTextblock&&!t.hasRequiredAttrs())return t}return null}const VT=(n,e)=>{let{$head:t,$anchor:r}=n.selection;if(!t.parent.type.spec.code||!t.sameParent(r))return!1;let i=t.node(-1),o=t.indexAfter(-1),a=bg(i.contentMatchAt(o));if(!a||!i.canReplaceWith(o,o,a))return!1;if(e){let u=t.after(),f=n.tr.replaceWith(u,u,a.createAndFill());f.setSelection(de.near(f.doc.resolve(u),1)),e(f.scrollIntoView())}return!0},KT=(n,e)=>{let t=n.selection,{$from:r,$to:i}=t;if(t instanceof Jt||r.parent.inlineContent||i.parent.inlineContent)return!1;let o=bg(i.parent.contentMatchAt(i.indexAfter()));if(!o||!o.isTextblock)return!1;if(e){let a=(!r.parentOffset&&i.index()<i.parent.childCount?r:i).pos,u=n.tr.insert(a,o.createAndFill());u.setSelection(he.create(u.doc,a+1)),e(u.scrollIntoView())}return!0},GT=(n,e)=>{let{$cursor:t}=n.selection;if(!t||t.parent.content.size)return!1;if(t.depth>1&&t.after()!=t.end(-1)){let o=t.before();if(pi(n.doc,o))return e&&e(n.tr.split(o).scrollIntoView()),!0}let r=t.blockRange(),i=r&&hi(r);return i==null?!1:(e&&e(n.tr.lift(r,i).scrollIntoView()),!0)},qT=(n,e)=>{let{$from:t,to:r}=n.selection,i,o=t.sharedDepth(r);return o==0?!1:(i=t.before(o),e&&e(n.tr.setSelection(Y.create(n.doc,i))),!0)};function JT(n,e,t){let r=e.nodeBefore,i=e.nodeAfter,o=e.index();return!r||!i||!r.type.compatibleContent(i.type)?!1:!r.content.size&&e.parent.canReplace(o-1,o)?(t&&t(n.tr.delete(e.pos-r.nodeSize,e.pos).scrollIntoView()),!0):!e.parent.canReplace(o,o+1)||!(i.isTextblock||Vn(n.doc,e.pos))?!1:(t&&t(n.tr.clearIncompatible(e.pos,r.type,r.contentMatchAt(r.childCount)).join(e.pos).scrollIntoView()),!0)}function vg(n,e,t){let r=e.nodeBefore,i=e.nodeAfter,o,a;if(r.type.spec.isolating||i.type.spec.isolating)return!1;if(JT(n,e,t))return!0;let u=e.parent.canReplace(e.index(),e.index()+1);if(u&&(o=(a=r.contentMatchAt(r.childCount)).findWrapping(i.type))&&a.matchType(o[0]||i.type).validEnd){if(t){let p=e.pos+i.nodeSize,b=L.empty;for(let C=o.length-1;C>=0;C--)b=L.from(o[C].create(null,b));b=L.from(r.copy(b));let S=n.tr.step(new ze(e.pos-1,p,e.pos,p,new $(b,1,0),o.length,!0)),x=p+2*o.length;Vn(S.doc,x)&&S.join(x),t(S.scrollIntoView())}return!0}let f=de.findFrom(e,1),h=f&&f.$from.blockRange(f.$to),m=h&&hi(h);if(m!=null&&m>=e.depth)return t&&t(n.tr.lift(h,m).scrollIntoView()),!0;if(u&&wi(i,"start",!0)&&wi(r,"end")){let p=r,b=[];for(;b.push(p),!p.isTextblock;)p=p.lastChild;let S=i,x=1;for(;!S.isTextblock;S=S.firstChild)x++;if(p.canReplace(p.childCount,p.childCount,S.content)){if(t){let C=L.empty;for(let N=b.length-1;N>=0;N--)C=L.from(b[N].copy(C));let A=n.tr.step(new ze(e.pos-b.length,e.pos+i.nodeSize,e.pos+x,e.pos+i.nodeSize-x,new $(C,b.length,0),0,!0));t(A.scrollIntoView())}return!0}}return!1}function Sg(n){return function(e,t){let r=e.selection,i=n<0?r.$from:r.$to,o=i.depth;for(;i.node(o).isInline;){if(!o)return!1;o--}return i.node(o).isTextblock?(t&&t(e.tr.setSelection(he.create(e.doc,n<0?i.start(o):i.end(o)))),!0):!1}}const jT=Sg(-1),YT=Sg(1);function XT(n,e=null){return function(t,r){let{$from:i,$to:o}=t.selection,a=i.blockRange(o),u=a&&ju(a,n,e);return u?(r&&r(t.tr.wrap(a,u).scrollIntoView()),!0):!1}}function wg(n,e=null){return function(t,r){let i=!1;for(let o=0;o<t.selection.ranges.length&&!i;o++){let{$from:{pos:a},$to:{pos:u}}=t.selection.ranges[o];t.doc.nodesBetween(a,u,(f,h)=>{if(i)return!1;if(!(!f.isTextblock||f.hasMarkup(n,e)))if(f.type==n)i=!0;else{let m=t.doc.resolve(h),p=m.index();i=m.parent.canReplaceWith(p,p+1,n)}})}if(!i)return!1;if(r){let o=t.tr;for(let a=0;a<t.selection.ranges.length;a++){let{$from:{pos:u},$to:{pos:f}}=t.selection.ranges[a];o.setBlockType(u,f,n,e)}r(o.scrollIntoView())}return!0}}typeof navigator<"u"?/Mac|iP(hone|[oa]d)/.test(navigator.platform):typeof os<"u"&&os.platform&&os.platform()=="darwin";function ZT(n,e=null){return function(t,r){let{$from:i,$to:o}=t.selection,a=i.blockRange(o),u=!1,f=a;if(!a)return!1;if(a.depth>=2&&i.node(a.depth-1).type.compatibleContent(n)&&a.startIndex==0){if(i.index(a.depth-1)==0)return!1;let m=t.doc.resolve(a.start-2);f=new Yo(m,m,a.depth),a.endIndex<a.parent.childCount&&(a=new Yo(i,t.doc.resolve(o.end(a.depth)),a.depth)),u=!0}let h=ju(f,n,e,a);return h?(r&&r(QT(t.tr,a,h,u,n).scrollIntoView()),!0):!1}}function QT(n,e,t,r,i){let o=L.empty;for(let m=t.length-1;m>=0;m--)o=L.from(t[m].type.create(t[m].attrs,o));n.step(new ze(e.start-(r?2:0),e.end,e.start,e.end,new $(o,0,0),t.length,!0));let a=0;for(let m=0;m<t.length;m++)t[m].type==i&&(a=m+1);let u=t.length-a,f=e.start+t.length-(r?2:0),h=e.parent;for(let m=e.startIndex,p=e.endIndex,b=!0;m<p;m++,b=!1)!b&&pi(n.doc,f,u)&&(n.split(f,u),f+=2*u),f+=h.child(m).nodeSize;return n}function eC(n){return function(e,t){let{$from:r,$to:i}=e.selection,o=r.blockRange(i,a=>a.childCount>0&&a.firstChild.type==n);return o?t?r.node(o.depth-1).type==n?tC(e,t,n,o):nC(e,t,o):!0:!1}}function tC(n,e,t,r){let i=n.tr,o=r.end,a=r.$to.end(r.depth);o<a&&(i.step(new ze(o-1,a,o,a,new $(L.from(t.create(null,r.parent.copy())),1,0),1,!0)),r=new Yo(i.doc.resolve(r.$from.pos),i.doc.resolve(a),r.depth));const u=hi(r);if(u==null)return!1;i.lift(r,u);let f=i.mapping.map(o,-1)-1;return Vn(i.doc,f)&&i.join(f),e(i.scrollIntoView()),!0}function nC(n,e,t){let r=n.tr,i=t.parent;for(let S=t.end,x=t.endIndex-1,C=t.startIndex;x>C;x--)S-=i.child(x).nodeSize,r.delete(S-1,S+1);let o=r.doc.resolve(t.start),a=o.nodeAfter;if(r.mapping.map(t.end)!=t.start+o.nodeAfter.nodeSize)return!1;let u=t.startIndex==0,f=t.endIndex==i.childCount,h=o.node(-1),m=o.index(-1);if(!h.canReplace(m+(u?0:1),m+1,a.content.append(f?L.empty:L.from(i))))return!1;let p=o.pos,b=p+a.nodeSize;return r.step(new ze(p-(u?1:0),b+(f?1:0),p+1,b-1,new $((u?L.empty:L.from(i.copy(L.empty))).append(f?L.empty:L.from(i.copy(L.empty))),u?0:1,f?0:1),u?0:1)),e(r.scrollIntoView()),!0}function rC(n){return function(e,t){let{$from:r,$to:i}=e.selection,o=r.blockRange(i,h=>h.childCount>0&&h.firstChild.type==n);if(!o)return!1;let a=o.startIndex;if(a==0)return!1;let u=o.parent,f=u.child(a-1);if(f.type!=n)return!1;if(t){let h=f.lastChild&&f.lastChild.type==u.type,m=L.from(h?n.create():null),p=new $(L.from(n.create(null,L.from(u.type.create(null,m)))),h?3:1,0),b=o.start,S=o.end;t(e.tr.step(new ze(b-(h?3:1),S,b,S,p,1,!0)).scrollIntoView())}return!0}}function cl(n){const{state:e,transaction:t}=n;let{selection:r}=t,{doc:i}=t,{storedMarks:o}=t;return{...e,apply:e.apply.bind(e),applyTransaction:e.applyTransaction.bind(e),filterTransaction:e.filterTransaction,plugins:e.plugins,schema:e.schema,reconfigure:e.reconfigure.bind(e),toJSON:e.toJSON.bind(e),get storedMarks(){return o},get selection(){return r},get doc(){return i},get tr(){return r=t.selection,i=t.doc,o=t.storedMarks,t}}}class vc{constructor(e){this.editor=e.editor,this.rawCommands=this.editor.extensionManager.commands,this.customState=e.state}get hasCustomState(){return!!this.customState}get state(){return this.customState||this.editor.state}get commands(){const{rawCommands:e,editor:t,state:r}=this,{view:i}=t,{tr:o}=r,a=this.buildProps(o);return Object.fromEntries(Object.entries(e).map(([u,f])=>[u,(...m)=>{const p=f(...m)(a);return!o.getMeta("preventDispatch")&&!this.hasCustomState&&i.dispatch(o),p}]))}get chain(){return()=>this.createChain()}get can(){return()=>this.createCan()}createChain(e,t=!0){const{rawCommands:r,editor:i,state:o}=this,{view:a}=i,u=[],f=!!e,h=e||o.tr,m=()=>(!f&&t&&!h.getMeta("preventDispatch")&&!this.hasCustomState&&a.dispatch(h),u.every(b=>b===!0)),p={...Object.fromEntries(Object.entries(r).map(([b,S])=>[b,(...C)=>{const A=this.buildProps(h,t),N=S(...C)(A);return u.push(N),p}])),run:m};return p}createCan(e){const{rawCommands:t,state:r}=this,i=!1,o=e||r.tr,a=this.buildProps(o,i);return{...Object.fromEntries(Object.entries(t).map(([f,h])=>[f,(...m)=>h(...m)({...a,dispatch:void 0})])),chain:()=>this.createChain(o,i)}}buildProps(e,t=!0){const{rawCommands:r,editor:i,state:o}=this,{view:a}=i,u={tr:e,editor:i,view:a,state:cl({state:o,transaction:e}),dispatch:t?()=>{}:void 0,chain:()=>this.createChain(e,t),can:()=>this.createCan(e),get commands(){return Object.fromEntries(Object.entries(r).map(([f,h])=>[f,(...m)=>h(...m)(u)]))}};return u}}function W(n,e,t){return n.config[e]===void 0&&n.parent?W(n.parent,e,t):typeof n.config[e]=="function"?n.config[e].bind({...t,parent:n.parent?W(n.parent,e,t):null}):n.config[e]}function fl(n){const e=n.filter(i=>i.type==="extension"),t=n.filter(i=>i.type==="node"),r=n.filter(i=>i.type==="mark");return{baseExtensions:e,nodeExtensions:t,markExtensions:r}}function _g(n){const e=[],{nodeExtensions:t,markExtensions:r}=fl(n),i=[...t,...r],o={default:null,rendered:!0,renderHTML:null,parseHTML:null,keepOnSplit:!0,isRequired:!1};return n.forEach(a=>{const u={name:a.name,options:a.options,storage:a.storage},f=W(a,"addGlobalAttributes",u);if(!f)return;f().forEach(m=>{m.types.forEach(p=>{Object.entries(m.attributes).forEach(([b,S])=>{e.push({type:p,name:b,attribute:{...o,...S}})})})})}),i.forEach(a=>{const u={name:a.name,options:a.options,storage:a.storage},f=W(a,"addAttributes",u);if(!f)return;const h=f();Object.entries(h).forEach(([m,p])=>{const b={...o,...p};typeof b?.default=="function"&&(b.default=b.default()),b?.isRequired&&b?.default===void 0&&delete b.default,e.push({type:a.name,name:m,attribute:b})})}),e}function Fe(n,e){if(typeof n=="string"){if(!e.nodes[n])throw Error(`There is no node type named '${n}'. Maybe you forgot to add the extension?`);return e.nodes[n]}return n}function _i(...n){return n.filter(e=>!!e).reduce((e,t)=>{const r={...e};return Object.entries(t).forEach(([i,o])=>{if(!r[i]){r[i]=o;return}if(i==="class"){const u=o?o.split(" "):[],f=r[i]?r[i].split(" "):[],h=u.filter(m=>!f.includes(m));r[i]=[...f,...h].join(" ")}else i==="style"?r[i]=[r[i],o].join("; "):r[i]=o}),r},{})}function Sc(n,e){return e.filter(t=>t.attribute.rendered).map(t=>t.attribute.renderHTML?t.attribute.renderHTML(n.attrs)||{}:{[t.name]:n.attrs[t.name]}).reduce((t,r)=>_i(t,r),{})}function iC(n){return typeof n=="function"}function se(n,e=void 0,...t){return iC(n)?e?n.bind(e)(...t):n(...t):n}function sC(n={}){return Object.keys(n).length===0&&n.constructor===Object}function oC(n){return typeof n!="string"?n:n.match(/^[+-]?(?:\d*\.)?\d+$/)?Number(n):n==="true"?!0:n==="false"?!1:n}function xg(n,e){return n.style?n:{...n,getAttrs:t=>{const r=n.getAttrs?n.getAttrs(t):n.attrs;if(r===!1)return!1;const i=e.reduce((o,a)=>{const u=a.attribute.parseHTML?a.attribute.parseHTML(t):oC(t.getAttribute(a.name));return u==null?o:{...o,[a.name]:u}},{});return{...r,...i}}}}function kg(n){return Object.fromEntries(Object.entries(n).filter(([e,t])=>e==="attrs"&&sC(t)?!1:t!=null))}function Eg(n,e){var t;const r=_g(n),{nodeExtensions:i,markExtensions:o}=fl(n),a=(t=i.find(h=>W(h,"topNode")))===null||t===void 0?void 0:t.name,u=Object.fromEntries(i.map(h=>{const m=r.filter(N=>N.type===h.name),p={name:h.name,options:h.options,storage:h.storage,editor:e},b=n.reduce((N,G)=>{const K=W(G,"extendNodeSchema",p);return{...N,...K?K(h):{}}},{}),S=kg({...b,content:se(W(h,"content",p)),marks:se(W(h,"marks",p)),group:se(W(h,"group",p)),inline:se(W(h,"inline",p)),atom:se(W(h,"atom",p)),selectable:se(W(h,"selectable",p)),draggable:se(W(h,"draggable",p)),code:se(W(h,"code",p)),defining:se(W(h,"defining",p)),isolating:se(W(h,"isolating",p)),attrs:Object.fromEntries(m.map(N=>{var G;return[N.name,{default:(G=N?.attribute)===null||G===void 0?void 0:G.default}]}))}),x=se(W(h,"parseHTML",p));x&&(S.parseDOM=x.map(N=>xg(N,m)));const C=W(h,"renderHTML",p);C&&(S.toDOM=N=>C({node:N,HTMLAttributes:Sc(N,m)}));const A=W(h,"renderText",p);return A&&(S.toText=A),[h.name,S]})),f=Object.fromEntries(o.map(h=>{const m=r.filter(A=>A.type===h.name),p={name:h.name,options:h.options,storage:h.storage,editor:e},b=n.reduce((A,N)=>{const G=W(N,"extendMarkSchema",p);return{...A,...G?G(h):{}}},{}),S=kg({...b,inclusive:se(W(h,"inclusive",p)),excludes:se(W(h,"excludes",p)),group:se(W(h,"group",p)),spanning:se(W(h,"spanning",p)),code:se(W(h,"code",p)),attrs:Object.fromEntries(m.map(A=>{var N;return[A.name,{default:(N=A?.attribute)===null||N===void 0?void 0:N.default}]}))}),x=se(W(h,"parseHTML",p));x&&(S.parseDOM=x.map(A=>xg(A,m)));const C=W(h,"renderHTML",p);return C&&(S.toDOM=A=>C({mark:A,HTMLAttributes:Sc(A,m)})),[h.name,S]}));return new cE({topNode:a,nodes:u,marks:f})}function wc(n,e){return e.nodes[n]||e.marks[n]||null}function Tg(n,e){return Array.isArray(e)?e.some(t=>(typeof t=="string"?t:t.name)===n.name):e}const lC=(n,e=500)=>{let t="";const r=n.parentOffset;return n.parent.nodesBetween(Math.max(0,r-e),r,(i,o,a,u)=>{var f,h;const m=((h=(f=i.type.spec).toText)===null||h===void 0?void 0:h.call(f,{node:i,pos:o,parent:a,index:u}))||i.textContent||"%leaf%";t+=m.slice(0,Math.max(0,r-o))}),t};function _c(n){return Object.prototype.toString.call(n)==="[object RegExp]"}class Cg{constructor(e){this.find=e.find,this.handler=e.handler}}const aC=(n,e)=>{if(_c(e))return e.exec(n);const t=e(n);if(!t)return null;const r=[t.text];return r.index=t.index,r.input=n,r.data=t.data,t.replaceWith&&(t.text.includes(t.replaceWith)||console.warn('[tiptap warn]: "inputRuleMatch.replaceWith" must be part of "inputRuleMatch.text".'),r.push(t.replaceWith)),r};function xc(n){var e;const{editor:t,from:r,to:i,text:o,rules:a,plugin:u}=n,{view:f}=t;if(f.composing)return!1;const h=f.state.doc.resolve(r);if(h.parent.type.spec.code||!((e=h.nodeBefore||h.nodeAfter)===null||e===void 0)&&e.marks.find(b=>b.type.spec.code))return!1;let m=!1;const p=lC(h)+o;return a.forEach(b=>{if(m)return;const S=aC(p,b.find);if(!S)return;const x=f.state.tr,C=cl({state:f.state,transaction:x}),A={from:r-(S[0].length-o.length),to:i},{commands:N,chain:G,can:K}=new vc({editor:t,state:C});b.handler({state:C,range:A,match:S,commands:N,chain:G,can:K})===null||!x.steps.length||(x.setMeta(u,{transform:x,from:r,to:i,text:o}),f.dispatch(x),m=!0)}),m}function uC(n){const{editor:e,rules:t}=n,r=new St({state:{init(){return null},apply(i,o){const a=i.getMeta(r);return a||(i.selectionSet||i.docChanged?null:o)}},props:{handleTextInput(i,o,a,u){return xc({editor:e,from:o,to:a,text:u,rules:t,plugin:r})},handleDOMEvents:{compositionend:i=>(setTimeout(()=>{const{$cursor:o}=i.state.selection;o&&xc({editor:e,from:o.pos,to:o.pos,text:"",rules:t,plugin:r})}),!1)},handleKeyDown(i,o){if(o.key!=="Enter")return!1;const{$cursor:a}=i.state.selection;return a?xc({editor:e,from:a.pos,to:a.pos,text:`
15
- `,rules:t,plugin:r}):!1}},isInputRules:!0});return r}function cC(n){return typeof n=="number"}class fC{constructor(e){this.find=e.find,this.handler=e.handler}}const dC=(n,e)=>{if(_c(e))return[...n.matchAll(e)];const t=e(n);return t?t.map(r=>{const i=[r.text];return i.index=r.index,i.input=n,i.data=r.data,r.replaceWith&&(r.text.includes(r.replaceWith)||console.warn('[tiptap warn]: "pasteRuleMatch.replaceWith" must be part of "pasteRuleMatch.text".'),i.push(r.replaceWith)),i}):[]};function hC(n){const{editor:e,state:t,from:r,to:i,rule:o,pasteEvent:a,dropEvent:u}=n,{commands:f,chain:h,can:m}=new vc({editor:e,state:t}),p=[];return t.doc.nodesBetween(r,i,(S,x)=>{if(!S.isTextblock||S.type.spec.code)return;const C=Math.max(r,x),A=Math.min(i,x+S.content.size),N=S.textBetween(C-x,A-x,void 0,"\uFFFC");dC(N,o.find).forEach(K=>{if(K.index===void 0)return;const oe=C+K.index+1,pe=oe+K[0].length,B={from:t.tr.mapping.map(oe),to:t.tr.mapping.map(pe)},ue=o.handler({state:t,range:B,match:K,commands:f,chain:h,can:m,pasteEvent:a,dropEvent:u});p.push(ue)})}),p.every(S=>S!==null)}function pC(n){const{editor:e,rules:t}=n;let r=null,i=!1,o=!1,a=new ClipboardEvent("paste"),u=new DragEvent("drop");return t.map(h=>new St({view(m){const p=b=>{var S;r=!((S=m.dom.parentElement)===null||S===void 0)&&S.contains(b.target)?m.dom.parentElement:null};return window.addEventListener("dragstart",p),{destroy(){window.removeEventListener("dragstart",p)}}},props:{handleDOMEvents:{drop:(m,p)=>(o=r===m.dom.parentElement,u=p,!1),paste:(m,p)=>{var b;const S=(b=p.clipboardData)===null||b===void 0?void 0:b.getData("text/html");return a=p,i=!!S?.includes("data-pm-slice"),!1}}},appendTransaction:(m,p,b)=>{const S=m[0],x=S.getMeta("uiEvent")==="paste"&&!i,C=S.getMeta("uiEvent")==="drop"&&!o;if(!x&&!C)return;const A=p.doc.content.findDiffStart(b.doc.content),N=p.doc.content.findDiffEnd(b.doc.content);if(!cC(A)||!N||A===N.b)return;const G=b.tr,K=cl({state:b,transaction:G});if(!(!hC({editor:e,state:K,from:Math.max(A-1,0),to:N.b-1,rule:h,pasteEvent:a,dropEvent:u})||!G.steps.length))return u=new DragEvent("drop"),a=new ClipboardEvent("paste"),G}}))}function mC(n){const e=n.filter((t,r)=>n.indexOf(t)!==r);return[...new Set(e)]}class Ii{constructor(e,t){this.splittableMarks=[],this.editor=t,this.extensions=Ii.resolve(e),this.schema=Eg(this.extensions,t),this.extensions.forEach(r=>{var i;this.editor.extensionStorage[r.name]=r.storage;const o={name:r.name,options:r.options,storage:r.storage,editor:this.editor,type:wc(r.name,this.schema)};r.type==="mark"&&(!((i=se(W(r,"keepOnSplit",o)))!==null&&i!==void 0)||i)&&this.splittableMarks.push(r.name);const a=W(r,"onBeforeCreate",o);a&&this.editor.on("beforeCreate",a);const u=W(r,"onCreate",o);u&&this.editor.on("create",u);const f=W(r,"onUpdate",o);f&&this.editor.on("update",f);const h=W(r,"onSelectionUpdate",o);h&&this.editor.on("selectionUpdate",h);const m=W(r,"onTransaction",o);m&&this.editor.on("transaction",m);const p=W(r,"onFocus",o);p&&this.editor.on("focus",p);const b=W(r,"onBlur",o);b&&this.editor.on("blur",b);const S=W(r,"onDestroy",o);S&&this.editor.on("destroy",S)})}static resolve(e){const t=Ii.sort(Ii.flatten(e)),r=mC(t.map(i=>i.name));return r.length&&console.warn(`[tiptap warn]: Duplicate extension names found: [${r.map(i=>`'${i}'`).join(", ")}]. This can lead to issues.`),t}static flatten(e){return e.map(t=>{const r={name:t.name,options:t.options,storage:t.storage},i=W(t,"addExtensions",r);return i?[t,...this.flatten(i())]:t}).flat(10)}static sort(e){return e.sort((r,i)=>{const o=W(r,"priority")||100,a=W(i,"priority")||100;return o>a?-1:o<a?1:0})}get commands(){return this.extensions.reduce((e,t)=>{const r={name:t.name,options:t.options,storage:t.storage,editor:this.editor,type:wc(t.name,this.schema)},i=W(t,"addCommands",r);return i?{...e,...i()}:e},{})}get plugins(){const{editor:e}=this,t=Ii.sort([...this.extensions].reverse()),r=[],i=[],o=t.map(a=>{const u={name:a.name,options:a.options,storage:a.storage,editor:e,type:wc(a.name,this.schema)},f=[],h=W(a,"addKeyboardShortcuts",u);let m={};if(a.type==="mark"&&a.config.exitable&&(m.ArrowRight=()=>_t.handleExit({editor:e,mark:a})),h){const C=Object.fromEntries(Object.entries(h()).map(([A,N])=>[A,()=>N({editor:e})]));m={...m,...C}}const p=IT(m);f.push(p);const b=W(a,"addInputRules",u);Tg(a,e.options.enableInputRules)&&b&&r.push(...b());const S=W(a,"addPasteRules",u);Tg(a,e.options.enablePasteRules)&&S&&i.push(...S());const x=W(a,"addProseMirrorPlugins",u);if(x){const C=x();f.push(...C)}return f}).flat();return[uC({editor:e,rules:r}),...pC({editor:e,rules:i}),...o]}get attributes(){return _g(this.extensions)}get nodeViews(){const{editor:e}=this,{nodeExtensions:t}=fl(this.extensions);return Object.fromEntries(t.filter(r=>!!W(r,"addNodeView")).map(r=>{const i=this.attributes.filter(f=>f.type===r.name),o={name:r.name,options:r.options,storage:r.storage,editor:e,type:Fe(r.name,this.schema)},a=W(r,"addNodeView",o);if(!a)return[];const u=(f,h,m,p)=>{const b=Sc(f,i);return a()({editor:e,node:f,getPos:m,decorations:p,HTMLAttributes:b,extension:r})};return[r.name,u]}))}}function gC(n){return Object.prototype.toString.call(n).slice(8,-1)}function kc(n){return gC(n)!=="Object"?!1:n.constructor===Object&&Object.getPrototypeOf(n)===Object.prototype}function dl(n,e){const t={...n};return kc(n)&&kc(e)&&Object.keys(e).forEach(r=>{kc(e[r])?r in n?t[r]=dl(n[r],e[r]):Object.assign(t,{[r]:e[r]}):Object.assign(t,{[r]:e[r]})}),t}class Ne{constructor(e={}){this.type="extension",this.name="extension",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...e},this.name=this.config.name,e.defaultOptions&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=se(W(this,"addOptions",{name:this.name}))),this.storage=se(W(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(e={}){return new Ne(e)}configure(e={}){const t=this.extend();return t.options=dl(this.options,e),t.storage=se(W(t,"addStorage",{name:t.name,options:t.options})),t}extend(e={}){const t=new Ne(e);return t.parent=this,this.child=t,t.name=e.name?e.name:t.parent.name,e.defaultOptions&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${t.name}".`),t.options=se(W(t,"addOptions",{name:t.name})),t.storage=se(W(t,"addStorage",{name:t.name,options:t.options})),t}}function yC(n,e,t){const{from:r,to:i}=e,{blockSeparator:o=`
10
+ `);return{dom:f,text:y}}function Qm(n,e,t,r,i){let o=i.parent.type.spec.code,a,c;if(!t&&!e)return null;let f=e&&(r||o||!t);if(f){if(n.someProp("transformPastedText",y=>{e=y(e,o||r,n)}),o)return e?new H(L.from(n.state.schema.text(e.replace(/\r\n?/g,`
11
+ `))),0,0):H.empty;let p=n.someProp("clipboardTextParser",y=>y(e,i,r,n));if(p)c=p;else{let y=i.marks(),{schema:S}=n.state,_=Hr.fromSchema(S);a=document.createElement("div"),e.split(/(?:\r\n?|\n)+/).forEach(C=>{let A=a.appendChild(document.createElement("p"));C&&A.appendChild(_.serializeNode(S.text(C,y)))})}}else n.someProp("transformPastedHTML",p=>{t=p(t,n)}),a=lT(t),du&&aT(a);let h=a&&a.querySelector("[data-pm-slice]"),m=h&&/^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(h.getAttribute("data-pm-slice")||"");if(m&&m[3])for(let p=+m[3];p>0;p--){let y=a.firstChild;for(;y&&y.nodeType!=1;)y=y.nextSibling;if(!y)break;a=y}if(c||(c=(n.someProp("clipboardParser")||n.someProp("domParser")||Yc.fromSchema(n.state.schema)).parseSlice(a,{preserveWhitespace:!!(f||m),context:i,ruleFromNode(y){return y.nodeName=="BR"&&!y.nextSibling&&y.parentNode&&!sT.test(y.parentNode.nodeName)?{ignore:!0}:null}})),m)c=cT(rg(c,+m[1],+m[2]),m[4]);else if(c=H.maxOpen(oT(c.content,i),!0),c.openStart||c.openEnd){let p=0,y=0;for(let S=c.content.firstChild;p<c.openStart&&!S.type.spec.isolating;p++,S=S.firstChild);for(let S=c.content.lastChild;y<c.openEnd&&!S.type.spec.isolating;y++,S=S.lastChild);c=rg(c,p,y)}return n.someProp("transformPasted",p=>{c=p(c,n)}),c}const sT=/^(a|abbr|acronym|b|cite|code|del|em|i|ins|kbd|label|output|q|ruby|s|samp|span|strong|sub|sup|time|u|tt|var)$/i;function oT(n,e){if(n.childCount<2)return n;for(let t=e.depth;t>=0;t--){let i=e.node(t).contentMatchAt(e.index(t)),o,a=[];if(n.forEach(c=>{if(!a)return;let f=i.findWrapping(c.type),h;if(!f)return a=null;if(h=a.length&&o.length&&tg(f,o,c,a[a.length-1],0))a[a.length-1]=h;else{a.length&&(a[a.length-1]=ng(a[a.length-1],o.length));let m=eg(c,f);a.push(m),i=i.matchType(m.type),o=f}}),a)return L.from(a)}return n}function eg(n,e,t=0){for(let r=e.length-1;r>=t;r--)n=e[r].create(null,L.from(n));return n}function tg(n,e,t,r,i){if(i<n.length&&i<e.length&&n[i]==e[i]){let o=tg(n,e,t,r.lastChild,i+1);if(o)return r.copy(r.content.replaceChild(r.childCount-1,o));if(r.contentMatchAt(r.childCount).matchType(i==n.length-1?t.type:n[i+1]))return r.copy(r.content.append(L.from(eg(t,n,i+1))))}}function ng(n,e){if(e==0)return n;let t=n.content.replaceChild(n.childCount-1,ng(n.lastChild,e-1)),r=n.contentMatchAt(n.childCount).fillBefore(L.empty,!0);return n.copy(t.append(r))}function vu(n,e,t,r,i,o){let a=e<0?n.firstChild:n.lastChild,c=a.content;return i<r-1&&(c=vu(c,e,t,r,i+1,o)),i>=t&&(c=e<0?a.contentMatchAt(0).fillBefore(c,n.childCount>1||o<=i).append(c):c.append(a.contentMatchAt(a.childCount).fillBefore(L.empty,!0))),n.replaceChild(e<0?0:n.childCount-1,a.copy(c))}function rg(n,e,t){return e<n.openStart&&(n=new H(vu(n.content,-1,e,n.openStart,0,n.openEnd),e,n.openEnd)),t<n.openEnd&&(n=new H(vu(n.content,1,t,n.openEnd,0,0),n.openStart,t)),n}const ig={thead:["table"],tbody:["table"],tfoot:["table"],caption:["table"],colgroup:["table"],col:["table","colgroup"],tr:["table","tbody"],td:["table","tbody","tr"],th:["table","tbody","tr"]};let sg=null;function og(){return sg||(sg=document.implementation.createHTMLDocument("title"))}function lT(n){let e=/^(\s*<meta [^>]*>)*/.exec(n);e&&(n=n.slice(e[0].length));let t=og().createElement("div"),r=/<([a-z][^>\s]+)/i.exec(n),i;if((i=r&&ig[r[1].toLowerCase()])&&(n=i.map(o=>"<"+o+">").join("")+n+i.map(o=>"</"+o+">").reverse().join("")),t.innerHTML=n,i)for(let o=0;o<i.length;o++)t=t.querySelector(i[o])||t;return t}function aT(n){let e=n.querySelectorAll(vi?"span:not([class]):not([style])":"span.Apple-converted-space");for(let t=0;t<e.length;t++){let r=e[t];r.childNodes.length==1&&r.textContent=="\xA0"&&r.parentNode&&r.parentNode.replaceChild(n.ownerDocument.createTextNode(" "),r)}}function cT(n,e){if(!n.size)return n;let t=n.content.firstChild.type.schema,r;try{r=JSON.parse(e)}catch{return n}let{content:i,openStart:o,openEnd:a}=n;for(let c=r.length-2;c>=0;c-=2){let f=t.nodes[r[c]];if(!f||f.hasRequiredAttrs())break;i=L.from(f.create(r[c+1],i)),o++,a++}return new H(i,o,a)}const Xt={},kt={};function Yn(n,e){n.input.lastSelectionOrigin=e,n.input.lastSelectionTime=Date.now()}kt.keydown=(n,e)=>{let t=e;if(n.input.shiftKey=t.keyCode==16||t.shiftKey,!ag(n,t)&&(n.input.lastKeyCode=t.keyCode,n.input.lastKeyCodeTime=Date.now(),!(ks&&vi&&t.keyCode==13)))if(t.keyCode!=229&&n.domObserver.forceFlush(),fu&&t.keyCode==13&&!t.ctrlKey&&!t.altKey&&!t.metaKey){let r=Date.now();n.input.lastIOSEnter=r,n.input.lastIOSEnterFallbackTimeout=setTimeout(()=>{n.input.lastIOSEnter==r&&(n.someProp("handleKeyDown",i=>i(n,Fm(13,"Enter"))),n.input.lastIOSEnter=0)},200)}else n.someProp("handleKeyDown",r=>r(n,t))||iT(n,t)?t.preventDefault():Yn(n,"key")},kt.keyup=(n,e)=>{e.keyCode==16&&(n.input.shiftKey=!1)},kt.keypress=(n,e)=>{let t=e;if(ag(n,t)||!t.charCode||t.ctrlKey&&!t.altKey||Ft&&t.metaKey)return;if(n.someProp("handleKeyPress",i=>i(n,t))){t.preventDefault();return}let r=n.state.selection;if(!(r instanceof pe)||!r.$from.sameParent(r.$to)){let i=String.fromCharCode(t.charCode);n.someProp("handleTextInput",o=>o(n,r.$from.pos,r.$to.pos,i))||n.dispatch(n.state.tr.insertText(i).scrollIntoView()),t.preventDefault()}};function dl(n){return{left:n.clientX,top:n.clientY}}function uT(n,e){let t=e.x-n.clientX,r=e.y-n.clientY;return t*t+r*r<100}function Su(n,e,t,r,i){if(r==-1)return!1;let o=n.state.doc.resolve(r);for(let a=o.depth+1;a>0;a--)if(n.someProp(e,c=>a>o.depth?c(n,t,o.nodeAfter,o.before(a),i,!0):c(n,t,o.node(a),o.before(a),i,!1)))return!0;return!1}function Si(n,e,t){n.focused||n.focus();let r=n.state.tr.setSelection(e);r.setMeta("pointer",!0),n.dispatch(r)}function fT(n,e){if(e==-1)return!1;let t=n.state.doc.resolve(e),r=t.nodeAfter;return r&&r.isAtom&&X.isSelectable(r)?(Si(n,new X(t)),!0):!1}function dT(n,e){if(e==-1)return!1;let t=n.state.selection,r,i;t instanceof X&&(r=t.node);let o=n.state.doc.resolve(e);for(let a=o.depth+1;a>0;a--){let c=a>o.depth?o.nodeAfter:o.node(a);if(X.isSelectable(c)){r&&t.$from.depth>0&&a>=t.$from.depth&&o.before(t.$from.depth+1)==t.$from.pos?i=o.before(t.$from.depth):i=o.before(a);break}}return i!=null?(Si(n,X.create(n.state.doc,i)),!0):!1}function hT(n,e,t,r,i){return Su(n,"handleClickOn",e,t,r)||n.someProp("handleClick",o=>o(n,e,r))||(i?dT(n,t):fT(n,t))}function pT(n,e,t,r){return Su(n,"handleDoubleClickOn",e,t,r)||n.someProp("handleDoubleClick",i=>i(n,e,r))}function mT(n,e,t,r){return Su(n,"handleTripleClickOn",e,t,r)||n.someProp("handleTripleClick",i=>i(n,e,r))||gT(n,t,r)}function gT(n,e,t){if(t.button!=0)return!1;let r=n.state.doc;if(e==-1)return r.inlineContent?(Si(n,pe.create(r,0,r.content.size)),!0):!1;let i=r.resolve(e);for(let o=i.depth+1;o>0;o--){let a=o>i.depth?i.nodeAfter:i.node(o),c=i.before(o);if(a.inlineContent)Si(n,pe.create(r,c+1,c+1+a.content.size));else if(X.isSelectable(a))Si(n,X.create(r,c));else continue;return!0}}function xu(n){return hl(n)}const lg=Ft?"metaKey":"ctrlKey";Xt.mousedown=(n,e)=>{let t=e;n.input.shiftKey=t.shiftKey;let r=xu(n),i=Date.now(),o="singleClick";i-n.input.lastClick.time<500&&uT(t,n.input.lastClick)&&!t[lg]&&(n.input.lastClick.type=="singleClick"?o="doubleClick":n.input.lastClick.type=="doubleClick"&&(o="tripleClick")),n.input.lastClick={time:i,x:t.clientX,y:t.clientY,type:o};let a=n.posAtCoords(dl(t));a&&(o=="singleClick"?(n.input.mouseDown&&n.input.mouseDown.done(),n.input.mouseDown=new yT(n,a,t,!!r)):(o=="doubleClick"?pT:mT)(n,a.pos,a.inside,t)?t.preventDefault():Yn(n,"pointer"))};class yT{constructor(e,t,r,i){this.view=e,this.pos=t,this.event=r,this.flushed=i,this.delayedSelectionSync=!1,this.mightDrag=null,this.startDoc=e.state.doc,this.selectNode=!!r[lg],this.allowDefault=r.shiftKey;let o,a;if(t.inside>-1)o=e.state.doc.nodeAt(t.inside),a=t.inside;else{let m=e.state.doc.resolve(t.pos);o=m.parent,a=m.depth?m.before():0}const c=i?null:r.target,f=c?e.docView.nearestDesc(c,!0):null;this.target=f?f.dom:null;let{selection:h}=e.state;(r.button==0&&o.type.spec.draggable&&o.type.spec.selectable!==!1||h instanceof X&&h.from<=a&&h.to>a)&&(this.mightDrag={node:o,pos:a,addAttr:!!(this.target&&!this.target.draggable),setUneditable:!!(this.target&&ul&&!this.target.hasAttribute("contentEditable"))}),this.target&&this.mightDrag&&(this.mightDrag.addAttr||this.mightDrag.setUneditable)&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&(this.target.draggable=!0),this.mightDrag.setUneditable&&setTimeout(()=>{this.view.input.mouseDown==this&&this.target.setAttribute("contentEditable","false")},20),this.view.domObserver.start()),e.root.addEventListener("mouseup",this.up=this.up.bind(this)),e.root.addEventListener("mousemove",this.move=this.move.bind(this)),Yn(e,"pointer")}done(){this.view.root.removeEventListener("mouseup",this.up),this.view.root.removeEventListener("mousemove",this.move),this.mightDrag&&this.target&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&this.target.removeAttribute("draggable"),this.mightDrag.setUneditable&&this.target.removeAttribute("contentEditable"),this.view.domObserver.start()),this.delayedSelectionSync&&setTimeout(()=>hu(this.view)),this.view.input.mouseDown=null}up(e){if(this.done(),!this.view.dom.contains(e.target))return;let t=this.pos;this.view.state.doc!=this.startDoc&&(t=this.view.posAtCoords(dl(e))),this.updateAllowDefault(e),this.allowDefault||!t?Yn(this.view,"pointer"):hT(this.view,t.pos,t.inside,e,this.selectNode)?e.preventDefault():e.button==0&&(this.flushed||Tr&&this.mightDrag&&!this.mightDrag.node.isAtom||vi&&!this.view.state.selection.visible&&Math.min(Math.abs(t.pos-this.view.state.selection.from),Math.abs(t.pos-this.view.state.selection.to))<=2)?(Si(this.view,he.near(this.view.state.doc.resolve(t.pos))),e.preventDefault()):Yn(this.view,"pointer")}move(e){this.updateAllowDefault(e),Yn(this.view,"pointer"),e.buttons==0&&this.done()}updateAllowDefault(e){!this.allowDefault&&(Math.abs(this.event.x-e.clientX)>4||Math.abs(this.event.y-e.clientY)>4)&&(this.allowDefault=!0)}}Xt.touchstart=n=>{n.input.lastTouch=Date.now(),xu(n),Yn(n,"pointer")},Xt.touchmove=n=>{n.input.lastTouch=Date.now(),Yn(n,"pointer")},Xt.contextmenu=n=>xu(n);function ag(n,e){return n.composing?!0:Tr&&Math.abs(e.timeStamp-n.input.compositionEndedAt)<500?(n.input.compositionEndedAt=-2e8,!0):!1}const bT=ks?5e3:-1;kt.compositionstart=kt.compositionupdate=n=>{if(!n.composing){n.domObserver.flush();let{state:e}=n,t=e.selection.$from;if(e.selection.empty&&(e.storedMarks||!t.textOffset&&t.parentOffset&&t.nodeBefore.marks.some(r=>r.type.spec.inclusive===!1)))n.markCursor=n.state.storedMarks||t.marks(),hl(n,!0),n.markCursor=null;else if(hl(n),ul&&e.selection.empty&&t.parentOffset&&!t.textOffset&&t.nodeBefore.marks.length){let r=n.domSelectionRange();for(let i=r.focusNode,o=r.focusOffset;i&&i.nodeType==1&&o!=0;){let a=o<0?i.lastChild:i.childNodes[o-1];if(!a)break;if(a.nodeType==3){n.domSelection().collapse(a,a.nodeValue.length);break}else i=a,o=-1}}n.input.composing=!0}cg(n,bT)},kt.compositionend=(n,e)=>{n.composing&&(n.input.composing=!1,n.input.compositionEndedAt=e.timeStamp,cg(n,20))};function cg(n,e){clearTimeout(n.input.composingTimeout),e>-1&&(n.input.composingTimeout=setTimeout(()=>hl(n),e))}function vT(n){for(n.composing&&(n.input.composing=!1,n.input.compositionEndedAt=ST());n.input.compositionNodes.length>0;)n.input.compositionNodes.pop().markParentsDirty()}function ST(){let n=document.createEvent("Event");return n.initEvent("event",!0,!0),n.timeStamp}function hl(n,e=!1){if(!(ks&&n.domObserver.flushingSoon>=0)){if(n.domObserver.forceFlush(),vT(n),e||n.docView&&n.docView.dirty){let t=XE(n);return t&&!t.eq(n.state.selection)?n.dispatch(n.state.tr.setSelection(t)):n.updateState(n.state),!0}return!1}}function xT(n,e){if(!n.dom.parentNode)return;let t=n.dom.parentNode.appendChild(document.createElement("div"));t.appendChild(e),t.style.cssText="position: fixed; left: -10000px; top: 10px";let r=getSelection(),i=document.createRange();i.selectNodeContents(e),n.dom.blur(),r.removeAllRanges(),r.addRange(i),setTimeout(()=>{t.parentNode&&t.parentNode.removeChild(t),n.focus()},50)}const xi=_s&&Hm<15||fu&&YE<604;Xt.copy=kt.cut=(n,e)=>{let t=e,r=n.state.selection,i=t.type=="cut";if(r.empty)return;let o=xi?null:t.clipboardData,a=r.content(),{dom:c,text:f}=Zm(n,a);o?(t.preventDefault(),o.clearData(),o.setData("text/html",c.innerHTML),o.setData("text/plain",f)):xT(n,c),i&&n.dispatch(n.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))};function wT(n){return n.openStart==0&&n.openEnd==0&&n.content.childCount==1?n.content.firstChild:null}function _T(n,e){if(!n.dom.parentNode)return;let t=n.input.shiftKey||n.state.selection.$from.parent.type.spec.code,r=n.dom.parentNode.appendChild(document.createElement(t?"textarea":"div"));t||(r.contentEditable="true"),r.style.cssText="position: fixed; left: -10000px; top: 10px",r.focus(),setTimeout(()=>{n.focus(),r.parentNode&&r.parentNode.removeChild(r),t?wu(n,r.value,null,e):wu(n,r.textContent,r.innerHTML,e)},50)}function wu(n,e,t,r){let i=Qm(n,e,t,n.input.shiftKey,n.state.selection.$from);if(n.someProp("handlePaste",c=>c(n,r,i||H.empty)))return!0;if(!i)return!1;let o=wT(i),a=o?n.state.tr.replaceSelectionWith(o,n.input.shiftKey):n.state.tr.replaceSelection(i);return n.dispatch(a.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste")),!0}kt.paste=(n,e)=>{let t=e;if(n.composing&&!ks)return;let r=xi?null:t.clipboardData;r&&wu(n,r.getData("text/plain"),r.getData("text/html"),t)?t.preventDefault():_T(n,t)};class kT{constructor(e,t){this.slice=e,this.move=t}}const ug=Ft?"altKey":"ctrlKey";Xt.dragstart=(n,e)=>{let t=e,r=n.input.mouseDown;if(r&&r.done(),!t.dataTransfer)return;let i=n.state.selection,o=i.empty?null:n.posAtCoords(dl(t));if(!(o&&o.pos>=i.from&&o.pos<=(i instanceof X?i.to-1:i.to))){if(r&&r.mightDrag)n.dispatch(n.state.tr.setSelection(X.create(n.state.doc,r.mightDrag.pos)));else if(t.target&&t.target.nodeType==1){let h=n.docView.nearestDesc(t.target,!0);h&&h.node.type.spec.draggable&&h!=n.docView&&n.dispatch(n.state.tr.setSelection(X.create(n.state.doc,h.posBefore)))}}let a=n.state.selection.content(),{dom:c,text:f}=Zm(n,a);t.dataTransfer.clearData(),t.dataTransfer.setData(xi?"Text":"text/html",c.innerHTML),t.dataTransfer.effectAllowed="copyMove",xi||t.dataTransfer.setData("text/plain",f),n.dragging=new kT(a,!t[ug])},Xt.dragend=n=>{let e=n.dragging;window.setTimeout(()=>{n.dragging==e&&(n.dragging=null)},50)},kt.dragover=kt.dragenter=(n,e)=>e.preventDefault(),kt.drop=(n,e)=>{let t=e,r=n.dragging;if(n.dragging=null,!t.dataTransfer)return;let i=n.posAtCoords(dl(t));if(!i)return;let o=n.state.doc.resolve(i.pos),a=r&&r.slice;a?n.someProp("transformPasted",_=>{a=_(a,n)}):a=Qm(n,t.dataTransfer.getData(xi?"Text":"text/plain"),xi?null:t.dataTransfer.getData("text/html"),!1,o);let c=!!(r&&!t[ug]);if(n.someProp("handleDrop",_=>_(n,t,a||H.empty,c))){t.preventDefault();return}if(!a)return;t.preventDefault();let f=a?DE(n.state.doc,o.pos,a):o.pos;f==null&&(f=o.pos);let h=n.state.tr;c&&h.deleteSelection();let m=h.mapping.map(f),p=a.openStart==0&&a.openEnd==0&&a.content.childCount==1,y=h.doc;if(p?h.replaceRangeWith(m,m,a.content.firstChild):h.replaceRange(m,m,a),h.doc.eq(y))return;let S=h.doc.resolve(m);if(p&&X.isSelectable(a.content.firstChild)&&S.nodeAfter&&S.nodeAfter.sameMarkup(a.content.firstChild))h.setSelection(new X(S));else{let _=h.mapping.map(f);h.mapping.maps[h.mapping.maps.length-1].forEach((C,A,R,K)=>_=K),h.setSelection(Gm(n,S,h.doc.resolve(_)))}n.focus(),n.dispatch(h.setMeta("uiEvent","drop"))},Xt.focus=n=>{n.input.lastFocus=Date.now(),n.focused||(n.domObserver.stop(),n.dom.classList.add("ProseMirror-focused"),n.domObserver.start(),n.focused=!0,setTimeout(()=>{n.docView&&n.hasFocus()&&!n.domObserver.currentSelection.eq(n.domSelectionRange())&&hu(n)},20))},Xt.blur=(n,e)=>{let t=e;n.focused&&(n.domObserver.stop(),n.dom.classList.remove("ProseMirror-focused"),n.domObserver.start(),t.relatedTarget&&n.dom.contains(t.relatedTarget)&&n.domObserver.currentSelection.clear(),n.focused=!1)},Xt.beforeinput=(n,e)=>{if(vi&&ks&&e.inputType=="deleteContentBackward"){n.domObserver.flushSoon();let{domChangeCount:r}=n.input;setTimeout(()=>{if(n.input.domChangeCount!=r||(n.dom.blur(),n.focus(),n.someProp("handleKeyDown",o=>o(n,Fm(8,"Backspace")))))return;let{$cursor:i}=n.state.selection;i&&i.pos>0&&n.dispatch(n.state.tr.delete(i.pos-1,i.pos).scrollIntoView())},50)}};for(let n in kt)Xt[n]=kt[n];function Ts(n,e){if(n==e)return!0;for(let t in n)if(n[t]!==e[t])return!1;for(let t in e)if(!(t in n))return!1;return!0}class wf{constructor(e,t){this.toDOM=e,this.spec=t||Ar,this.side=this.spec.side||0}map(e,t,r,i){let{pos:o,deleted:a}=e.mapResult(t.from+i,this.side<0?-1:1);return a?null:new mn(o-r,o-r,this)}valid(){return!0}eq(e){return this==e||e instanceof wf&&(this.spec.key&&this.spec.key==e.spec.key||this.toDOM==e.toDOM&&Ts(this.spec,e.spec))}destroy(e){this.spec.destroy&&this.spec.destroy(e)}}class sr{constructor(e,t){this.attrs=e,this.spec=t||Ar}map(e,t,r,i){let o=e.map(t.from+i,this.spec.inclusiveStart?-1:1)-r,a=e.map(t.to+i,this.spec.inclusiveEnd?1:-1)-r;return o>=a?null:new mn(o,a,this)}valid(e,t){return t.from<t.to}eq(e){return this==e||e instanceof sr&&Ts(this.attrs,e.attrs)&&Ts(this.spec,e.spec)}static is(e){return e.type instanceof sr}destroy(){}}class _f{constructor(e,t){this.attrs=e,this.spec=t||Ar}map(e,t,r,i){let o=e.mapResult(t.from+i,1);if(o.deleted)return null;let a=e.mapResult(t.to+i,-1);return a.deleted||a.pos<=o.pos?null:new mn(o.pos-r,a.pos-r,this)}valid(e,t){let{index:r,offset:i}=e.content.findIndex(t.from),o;return i==t.from&&!(o=e.child(r)).isText&&i+o.nodeSize==t.to}eq(e){return this==e||e instanceof _f&&Ts(this.attrs,e.attrs)&&Ts(this.spec,e.spec)}destroy(){}}class mn{constructor(e,t,r){this.from=e,this.to=t,this.type=r}copy(e,t){return new mn(e,t,this.type)}eq(e,t=0){return this.type.eq(e.type)&&this.from+t==e.from&&this.to+t==e.to}map(e,t,r){return this.type.map(e,this,t,r)}static widget(e,t,r){return new mn(e,e,new wf(t,r))}static inline(e,t,r,i){return new mn(e,t,new sr(r,i))}static node(e,t,r,i){return new mn(e,t,new _f(r,i))}get spec(){return this.type.spec}get inline(){return this.type instanceof sr}}const wi=[],Ar={};class We{constructor(e,t){this.local=e.length?e:wi,this.children=t.length?t:wi}static create(e,t){return t.length?pl(t,e,0,Ar):ct}find(e,t,r){let i=[];return this.findInner(e??0,t??1e9,i,0,r),i}findInner(e,t,r,i,o){for(let a=0;a<this.local.length;a++){let c=this.local[a];c.from<=t&&c.to>=e&&(!o||o(c.spec))&&r.push(c.copy(c.from+i,c.to+i))}for(let a=0;a<this.children.length;a+=3)if(this.children[a]<t&&this.children[a+1]>e){let c=this.children[a]+1;this.children[a+2].findInner(e-c,t-c,r,i+c,o)}}map(e,t,r){return this==ct||e.maps.length==0?this:this.mapInner(e,t,0,0,r||Ar)}mapInner(e,t,r,i,o){let a;for(let c=0;c<this.local.length;c++){let f=this.local[c].map(e,r,i);f&&f.type.valid(t,f)?(a||(a=[])).push(f):o.onRemove&&o.onRemove(this.local[c].spec)}return this.children.length?ET(this.children,a||[],e,t,r,i,o):a?new We(a.sort(Mr),wi):ct}add(e,t){return t.length?this==ct?We.create(e,t):this.addInner(e,t,0):this}addInner(e,t,r){let i,o=0;e.forEach((c,f)=>{let h=f+r,m;if(m=dg(t,c,h)){for(i||(i=this.children.slice());o<i.length&&i[o]<f;)o+=3;i[o]==f?i[o+2]=i[o+2].addInner(c,m,h+1):i.splice(o,0,f,f+c.nodeSize,pl(m,c,h+1,Ar)),o+=3}});let a=fg(o?hg(t):t,-r);for(let c=0;c<a.length;c++)a[c].type.valid(e,a[c])||a.splice(c--,1);return new We(a.length?this.local.concat(a).sort(Mr):this.local,i||this.children)}remove(e){return e.length==0||this==ct?this:this.removeInner(e,0)}removeInner(e,t){let r=this.children,i=this.local;for(let o=0;o<r.length;o+=3){let a,c=r[o]+t,f=r[o+1]+t;for(let m=0,p;m<e.length;m++)(p=e[m])&&p.from>c&&p.to<f&&(e[m]=null,(a||(a=[])).push(p));if(!a)continue;r==this.children&&(r=this.children.slice());let h=r[o+2].removeInner(a,c+1);h!=ct?r[o+2]=h:(r.splice(o,3),o-=3)}if(i.length){for(let o=0,a;o<e.length;o++)if(a=e[o])for(let c=0;c<i.length;c++)i[c].eq(a,t)&&(i==this.local&&(i=this.local.slice()),i.splice(c--,1))}return r==this.children&&i==this.local?this:i.length||r.length?new We(i,r):ct}forChild(e,t){if(this==ct)return this;if(t.isLeaf)return We.empty;let r,i;for(let c=0;c<this.children.length;c+=3)if(this.children[c]>=e){this.children[c]==e&&(r=this.children[c+2]);break}let o=e+1,a=o+t.content.size;for(let c=0;c<this.local.length;c++){let f=this.local[c];if(f.from<a&&f.to>o&&f.type instanceof sr){let h=Math.max(o,f.from)-o,m=Math.min(a,f.to)-o;h<m&&(i||(i=[])).push(f.copy(h,m))}}if(i){let c=new We(i.sort(Mr),wi);return r?new zr([c,r]):c}return r||ct}eq(e){if(this==e)return!0;if(!(e instanceof We)||this.local.length!=e.local.length||this.children.length!=e.children.length)return!1;for(let t=0;t<this.local.length;t++)if(!this.local[t].eq(e.local[t]))return!1;for(let t=0;t<this.children.length;t+=3)if(this.children[t]!=e.children[t]||this.children[t+1]!=e.children[t+1]||!this.children[t+2].eq(e.children[t+2]))return!1;return!0}locals(e){return _u(this.localsInner(e))}localsInner(e){if(this==ct)return wi;if(e.inlineContent||!this.local.some(sr.is))return this.local;let t=[];for(let r=0;r<this.local.length;r++)this.local[r].type instanceof sr||t.push(this.local[r]);return t}}We.empty=new We([],[]),We.removeOverlap=_u;const ct=We.empty;class zr{constructor(e){this.members=e}map(e,t){const r=this.members.map(i=>i.map(e,t,Ar));return zr.from(r)}forChild(e,t){if(t.isLeaf)return We.empty;let r=[];for(let i=0;i<this.members.length;i++){let o=this.members[i].forChild(e,t);o!=ct&&(o instanceof zr?r=r.concat(o.members):r.push(o))}return zr.from(r)}eq(e){if(!(e instanceof zr)||e.members.length!=this.members.length)return!1;for(let t=0;t<this.members.length;t++)if(!this.members[t].eq(e.members[t]))return!1;return!0}locals(e){let t,r=!0;for(let i=0;i<this.members.length;i++){let o=this.members[i].localsInner(e);if(o.length)if(!t)t=o;else{r&&(t=t.slice(),r=!1);for(let a=0;a<o.length;a++)t.push(o[a])}}return t?_u(r?t:t.sort(Mr)):wi}static from(e){switch(e.length){case 0:return ct;case 1:return e[0];default:return new zr(e.every(t=>t instanceof We)?e:e.reduce((t,r)=>t.concat(r instanceof We?r:r.members),[]))}}}function ET(n,e,t,r,i,o,a){let c=n.slice();for(let h=0,m=o;h<t.maps.length;h++){let p=0;t.maps[h].forEach((y,S,_,C)=>{let A=C-_-(S-y);for(let R=0;R<c.length;R+=3){let K=c[R+1];if(K<0||y>K+m-p)continue;let V=c[R]+m-p;S>=V?c[R+1]=y<=V?-2:-1:_>=i&&A&&(c[R]+=A,c[R+1]+=A)}p+=A}),m=t.maps[h].map(m,-1)}let f=!1;for(let h=0;h<c.length;h+=3)if(c[h+1]<0){if(c[h+1]==-2){f=!0,c[h+1]=-1;continue}let m=t.map(n[h]+o),p=m-i;if(p<0||p>=r.content.size){f=!0;continue}let y=t.map(n[h+1]+o,-1),S=y-i,{index:_,offset:C}=r.content.findIndex(p),A=r.maybeChild(_);if(A&&C==p&&C+A.nodeSize==S){let R=c[h+2].mapInner(t,A,m+1,n[h]+o+1,a);R!=ct?(c[h]=p,c[h+1]=S,c[h+2]=R):(c[h+1]=-2,f=!0)}else f=!0}if(f){let h=TT(c,n,e,t,i,o,a),m=pl(h,r,0,a);e=m.local;for(let p=0;p<c.length;p+=3)c[p+1]<0&&(c.splice(p,3),p-=3);for(let p=0,y=0;p<m.children.length;p+=3){let S=m.children[p];for(;y<c.length&&c[y]<S;)y+=3;c.splice(y,0,m.children[p],m.children[p+1],m.children[p+2])}}return new We(e.sort(Mr),c)}function fg(n,e){if(!e||!n.length)return n;let t=[];for(let r=0;r<n.length;r++){let i=n[r];t.push(new mn(i.from+e,i.to+e,i.type))}return t}function TT(n,e,t,r,i,o,a){function c(f,h){for(let m=0;m<f.local.length;m++){let p=f.local[m].map(r,i,h);p?t.push(p):a.onRemove&&a.onRemove(f.local[m].spec)}for(let m=0;m<f.children.length;m+=3)c(f.children[m+2],f.children[m]+h+1)}for(let f=0;f<n.length;f+=3)n[f+1]==-1&&c(n[f+2],e[f]+o+1);return t}function dg(n,e,t){if(e.isLeaf)return null;let r=t+e.nodeSize,i=null;for(let o=0,a;o<n.length;o++)(a=n[o])&&a.from>t&&a.to<r&&((i||(i=[])).push(a),n[o]=null);return i}function hg(n){let e=[];for(let t=0;t<n.length;t++)n[t]!=null&&e.push(n[t]);return e}function pl(n,e,t,r){let i=[],o=!1;e.forEach((c,f)=>{let h=dg(n,c,f+t);if(h){o=!0;let m=pl(h,c,t+f+1,r);m!=ct&&i.push(f,f+c.nodeSize,m)}});let a=fg(o?hg(n):n,-t).sort(Mr);for(let c=0;c<a.length;c++)a[c].type.valid(e,a[c])||(r.onRemove&&r.onRemove(a[c].spec),a.splice(c--,1));return a.length||i.length?new We(a,i):ct}function Mr(n,e){return n.from-e.from||n.to-e.to}function _u(n){let e=n;for(let t=0;t<e.length-1;t++){let r=e[t];if(r.from!=r.to)for(let i=t+1;i<e.length;i++){let o=e[i];if(o.from==r.from){o.to!=r.to&&(e==n&&(e=n.slice()),e[i]=o.copy(o.from,r.to),pg(e,i+1,o.copy(r.to,o.to)));continue}else{o.from<r.to&&(e==n&&(e=n.slice()),e[t]=r.copy(r.from,o.from),pg(e,i,r.copy(o.from,r.to)));break}}}return e}function pg(n,e,t){for(;e<n.length&&Mr(t,n[e])>0;)e++;n.splice(e,0,t)}for(var Xn={8:"Backspace",9:"Tab",10:"Enter",12:"NumLock",13:"Enter",16:"Shift",17:"Control",18:"Alt",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",44:"PrintScreen",45:"Insert",46:"Delete",59:";",61:"=",91:"Meta",92:"Meta",106:"*",107:"+",108:",",109:"-",110:".",111:"/",144:"NumLock",145:"ScrollLock",160:"Shift",161:"Shift",162:"Control",163:"Control",164:"Alt",165:"Alt",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},ml={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},mg=typeof navigator<"u"&&/Chrome\/(\d+)/.exec(navigator.userAgent),CT=typeof navigator<"u"&&/Mac/.test(navigator.platform),AT=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),MT=CT||mg&&+mg[1]<57,je=0;je<10;je++)Xn[48+je]=Xn[96+je]=String(je);for(var je=1;je<=24;je++)Xn[je+111]="F"+je;for(var je=65;je<=90;je++)Xn[je]=String.fromCharCode(je+32),ml[je]=String.fromCharCode(je);for(var ku in Xn)ml.hasOwnProperty(ku)||(ml[ku]=Xn[ku]);function OT(n){var e=MT&&(n.ctrlKey||n.altKey||n.metaKey)||AT&&n.shiftKey&&n.key&&n.key.length==1||n.key=="Unidentified",t=!e&&n.key||(n.shiftKey?ml:Xn)[n.keyCode]||n.key||"Unidentified";return t=="Esc"&&(t="Escape"),t=="Del"&&(t="Delete"),t=="Left"&&(t="ArrowLeft"),t=="Up"&&(t="ArrowUp"),t=="Right"&&(t="ArrowRight"),t=="Down"&&(t="ArrowDown"),t}const IT=typeof navigator<"u"?/Mac|iP(hone|[oa]d)/.test(navigator.platform):!1;function NT(n){let e=n.split(/-(?!$)/),t=e[e.length-1];t=="Space"&&(t=" ");let r,i,o,a;for(let c=0;c<e.length-1;c++){let f=e[c];if(/^(cmd|meta|m)$/i.test(f))a=!0;else if(/^a(lt)?$/i.test(f))r=!0;else if(/^(c|ctrl|control)$/i.test(f))i=!0;else if(/^s(hift)?$/i.test(f))o=!0;else if(/^mod$/i.test(f))IT?a=!0:i=!0;else throw new Error("Unrecognized modifier name: "+f)}return r&&(t="Alt-"+t),i&&(t="Ctrl-"+t),a&&(t="Meta-"+t),o&&(t="Shift-"+t),t}function RT(n){let e=Object.create(null);for(let t in n)e[NT(t)]=n[t];return e}function Eu(n,e,t){return e.altKey&&(n="Alt-"+n),e.ctrlKey&&(n="Ctrl-"+n),e.metaKey&&(n="Meta-"+n),t!==!1&&e.shiftKey&&(n="Shift-"+n),n}function LT(n){return new _t({props:{handleKeyDown:PT(n)}})}function PT(n){let e=RT(n);return function(t,r){let i=OT(r),o=i.length==1&&i!=" ",a,c=e[Eu(i,r,!o)];if(c&&c(t.state,t.dispatch,t))return!0;if(o&&(r.shiftKey||r.altKey||r.metaKey||i.charCodeAt(0)>127)&&(a=Xn[r.keyCode])&&a!=i){let f=e[Eu(a,r,!0)];if(f&&f(t.state,t.dispatch,t))return!0}else if(o&&r.shiftKey){let f=e[Eu(i,r,!0)];if(f&&f(t.state,t.dispatch,t))return!0}return!1}}const DT=(n,e)=>n.selection.empty?!1:(e&&e(n.tr.deleteSelection().scrollIntoView()),!0);function FT(n,e){let{$cursor:t}=n.selection;return!t||(e?!e.endOfTextblock("backward",n):t.parentOffset>0)?null:t}const BT=(n,e,t)=>{let r=FT(n,t);if(!r)return!1;let i=gg(r);if(!i){let a=r.blockRange(),c=a&&mi(a);return c==null?!1:(e&&e(n.tr.lift(a,c).scrollIntoView()),!0)}let o=i.nodeBefore;if(!o.type.spec.isolating&&vg(n,i,e))return!0;if(r.parent.content.size==0&&(_i(o,"end")||X.isSelectable(o))){let a=ru(n.doc,r.before(),r.after(),H.empty);if(a&&a.slice.size<a.to-a.from){if(e){let c=n.tr.step(a);c.setSelection(_i(o,"end")?he.findFrom(c.doc.resolve(c.mapping.map(i.pos,-1)),-1):X.create(c.doc,i.pos-o.nodeSize)),e(c.scrollIntoView())}return!0}}return o.isAtom&&i.depth==r.depth-1?(e&&e(n.tr.delete(i.pos-o.nodeSize,i.pos).scrollIntoView()),!0):!1};function _i(n,e,t=!1){for(let r=n;r;r=e=="start"?r.firstChild:r.lastChild){if(r.isTextblock)return!0;if(t&&r.childCount!=1)return!1}return!1}const zT=(n,e,t)=>{let{$head:r,empty:i}=n.selection,o=r;if(!i)return!1;if(r.parent.isTextblock){if(t?!t.endOfTextblock("backward",n):r.parentOffset>0)return!1;o=gg(r)}let a=o&&o.nodeBefore;return!a||!X.isSelectable(a)?!1:(e&&e(n.tr.setSelection(X.create(n.doc,o.pos-a.nodeSize)).scrollIntoView()),!0)};function gg(n){if(!n.parent.type.spec.isolating)for(let e=n.depth-1;e>=0;e--){if(n.index(e)>0)return n.doc.resolve(n.before(e+1));if(n.node(e).type.spec.isolating)break}return null}function HT(n,e){let{$cursor:t}=n.selection;return!t||(e?!e.endOfTextblock("forward",n):t.parentOffset<t.parent.content.size)?null:t}const $T=(n,e,t)=>{let r=HT(n,t);if(!r)return!1;let i=yg(r);if(!i)return!1;let o=i.nodeAfter;if(vg(n,i,e))return!0;if(r.parent.content.size==0&&(_i(o,"start")||X.isSelectable(o))){let a=ru(n.doc,r.before(),r.after(),H.empty);if(a&&a.slice.size<a.to-a.from){if(e){let c=n.tr.step(a);c.setSelection(_i(o,"start")?he.findFrom(c.doc.resolve(c.mapping.map(i.pos)),1):X.create(c.doc,c.mapping.map(i.pos))),e(c.scrollIntoView())}return!0}}return o.isAtom&&i.depth==r.depth-1?(e&&e(n.tr.delete(i.pos,i.pos+o.nodeSize).scrollIntoView()),!0):!1},WT=(n,e,t)=>{let{$head:r,empty:i}=n.selection,o=r;if(!i)return!1;if(r.parent.isTextblock){if(t?!t.endOfTextblock("forward",n):r.parentOffset<r.parent.content.size)return!1;o=yg(r)}let a=o&&o.nodeAfter;return!a||!X.isSelectable(a)?!1:(e&&e(n.tr.setSelection(X.create(n.doc,o.pos)).scrollIntoView()),!0)};function yg(n){if(!n.parent.type.spec.isolating)for(let e=n.depth-1;e>=0;e--){let t=n.node(e);if(n.index(e)+1<t.childCount)return n.doc.resolve(n.after(e+1));if(t.type.spec.isolating)break}return null}const UT=(n,e)=>{let t=n.selection,r=t instanceof X,i;if(r){if(t.node.isTextblock||!qn(n.doc,t.from))return!1;i=t.from}else if(i=ll(n.doc,t.from,-1),i==null)return!1;if(e){let o=n.tr.join(i);r&&o.setSelection(X.create(o.doc,i-n.doc.resolve(i).nodeBefore.nodeSize)),e(o.scrollIntoView())}return!0},VT=(n,e)=>{let t=n.selection,r;if(t instanceof X){if(t.node.isTextblock||!qn(n.doc,t.to))return!1;r=t.to}else if(r=ll(n.doc,t.to,1),r==null)return!1;return e&&e(n.tr.join(r).scrollIntoView()),!0},KT=(n,e)=>{let{$from:t,$to:r}=n.selection,i=t.blockRange(r),o=i&&mi(i);return o==null?!1:(e&&e(n.tr.lift(i,o).scrollIntoView()),!0)},GT=(n,e)=>{let{$head:t,$anchor:r}=n.selection;return!t.parent.type.spec.code||!t.sameParent(r)?!1:(e&&e(n.tr.insertText(`
12
+ `).scrollIntoView()),!0)};function bg(n){for(let e=0;e<n.edgeCount;e++){let{type:t}=n.edge(e);if(t.isTextblock&&!t.hasRequiredAttrs())return t}return null}const qT=(n,e)=>{let{$head:t,$anchor:r}=n.selection;if(!t.parent.type.spec.code||!t.sameParent(r))return!1;let i=t.node(-1),o=t.indexAfter(-1),a=bg(i.contentMatchAt(o));if(!a||!i.canReplaceWith(o,o,a))return!1;if(e){let c=t.after(),f=n.tr.replaceWith(c,c,a.createAndFill());f.setSelection(he.near(f.doc.resolve(c),1)),e(f.scrollIntoView())}return!0},JT=(n,e)=>{let t=n.selection,{$from:r,$to:i}=t;if(t instanceof Qt||r.parent.inlineContent||i.parent.inlineContent)return!1;let o=bg(i.parent.contentMatchAt(i.indexAfter()));if(!o||!o.isTextblock)return!1;if(e){let a=(!r.parentOffset&&i.index()<i.parent.childCount?r:i).pos,c=n.tr.insert(a,o.createAndFill());c.setSelection(pe.create(c.doc,a+1)),e(c.scrollIntoView())}return!0},jT=(n,e)=>{let{$cursor:t}=n.selection;if(!t||t.parent.content.size)return!1;if(t.depth>1&&t.after()!=t.end(-1)){let o=t.before();if(gi(n.doc,o))return e&&e(n.tr.split(o).scrollIntoView()),!0}let r=t.blockRange(),i=r&&mi(r);return i==null?!1:(e&&e(n.tr.lift(r,i).scrollIntoView()),!0)},YT=(n,e)=>{let{$from:t,to:r}=n.selection,i,o=t.sharedDepth(r);return o==0?!1:(i=t.before(o),e&&e(n.tr.setSelection(X.create(n.doc,i))),!0)};function XT(n,e,t){let r=e.nodeBefore,i=e.nodeAfter,o=e.index();return!r||!i||!r.type.compatibleContent(i.type)?!1:!r.content.size&&e.parent.canReplace(o-1,o)?(t&&t(n.tr.delete(e.pos-r.nodeSize,e.pos).scrollIntoView()),!0):!e.parent.canReplace(o,o+1)||!(i.isTextblock||qn(n.doc,e.pos))?!1:(t&&t(n.tr.clearIncompatible(e.pos,r.type,r.contentMatchAt(r.childCount)).join(e.pos).scrollIntoView()),!0)}function vg(n,e,t){let r=e.nodeBefore,i=e.nodeAfter,o,a;if(r.type.spec.isolating||i.type.spec.isolating)return!1;if(XT(n,e,t))return!0;let c=e.parent.canReplace(e.index(),e.index()+1);if(c&&(o=(a=r.contentMatchAt(r.childCount)).findWrapping(i.type))&&a.matchType(o[0]||i.type).validEnd){if(t){let p=e.pos+i.nodeSize,y=L.empty;for(let C=o.length-1;C>=0;C--)y=L.from(o[C].create(null,y));y=L.from(r.copy(y));let S=n.tr.step(new $e(e.pos-1,p,e.pos,p,new H(y,1,0),o.length,!0)),_=p+2*o.length;qn(S.doc,_)&&S.join(_),t(S.scrollIntoView())}return!0}let f=he.findFrom(e,1),h=f&&f.$from.blockRange(f.$to),m=h&&mi(h);if(m!=null&&m>=e.depth)return t&&t(n.tr.lift(h,m).scrollIntoView()),!0;if(c&&_i(i,"start",!0)&&_i(r,"end")){let p=r,y=[];for(;y.push(p),!p.isTextblock;)p=p.lastChild;let S=i,_=1;for(;!S.isTextblock;S=S.firstChild)_++;if(p.canReplace(p.childCount,p.childCount,S.content)){if(t){let C=L.empty;for(let R=y.length-1;R>=0;R--)C=L.from(y[R].copy(C));let A=n.tr.step(new $e(e.pos-y.length,e.pos+i.nodeSize,e.pos+_,e.pos+i.nodeSize-_,new H(C,y.length,0),0,!0));t(A.scrollIntoView())}return!0}}return!1}function Sg(n){return function(e,t){let r=e.selection,i=n<0?r.$from:r.$to,o=i.depth;for(;i.node(o).isInline;){if(!o)return!1;o--}return i.node(o).isTextblock?(t&&t(e.tr.setSelection(pe.create(e.doc,n<0?i.start(o):i.end(o)))),!0):!1}}const ZT=Sg(-1),QT=Sg(1);function eC(n,e=null){return function(t,r){let{$from:i,$to:o}=t.selection,a=i.blockRange(o),c=a&&nu(a,n,e);return c?(r&&r(t.tr.wrap(a,c).scrollIntoView()),!0):!1}}function xg(n,e=null){return function(t,r){let i=!1;for(let o=0;o<t.selection.ranges.length&&!i;o++){let{$from:{pos:a},$to:{pos:c}}=t.selection.ranges[o];t.doc.nodesBetween(a,c,(f,h)=>{if(i)return!1;if(!(!f.isTextblock||f.hasMarkup(n,e)))if(f.type==n)i=!0;else{let m=t.doc.resolve(h),p=m.index();i=m.parent.canReplaceWith(p,p+1,n)}})}if(!i)return!1;if(r){let o=t.tr;for(let a=0;a<t.selection.ranges.length;a++){let{$from:{pos:c},$to:{pos:f}}=t.selection.ranges[a];o.setBlockType(c,f,n,e)}r(o.scrollIntoView())}return!0}}typeof navigator<"u"?/Mac|iP(hone|[oa]d)/.test(navigator.platform):typeof os<"u"&&os.platform&&os.platform()=="darwin";function tC(n,e=null){return function(t,r){let{$from:i,$to:o}=t.selection,a=i.blockRange(o),c=!1,f=a;if(!a)return!1;if(a.depth>=2&&i.node(a.depth-1).type.compatibleContent(n)&&a.startIndex==0){if(i.index(a.depth-1)==0)return!1;let m=t.doc.resolve(a.start-2);f=new nl(m,m,a.depth),a.endIndex<a.parent.childCount&&(a=new nl(i,t.doc.resolve(o.end(a.depth)),a.depth)),c=!0}let h=nu(f,n,e,a);return h?(r&&r(nC(t.tr,a,h,c,n).scrollIntoView()),!0):!1}}function nC(n,e,t,r,i){let o=L.empty;for(let m=t.length-1;m>=0;m--)o=L.from(t[m].type.create(t[m].attrs,o));n.step(new $e(e.start-(r?2:0),e.end,e.start,e.end,new H(o,0,0),t.length,!0));let a=0;for(let m=0;m<t.length;m++)t[m].type==i&&(a=m+1);let c=t.length-a,f=e.start+t.length-(r?2:0),h=e.parent;for(let m=e.startIndex,p=e.endIndex,y=!0;m<p;m++,y=!1)!y&&gi(n.doc,f,c)&&(n.split(f,c),f+=2*c),f+=h.child(m).nodeSize;return n}function rC(n){return function(e,t){let{$from:r,$to:i}=e.selection,o=r.blockRange(i,a=>a.childCount>0&&a.firstChild.type==n);return o?t?r.node(o.depth-1).type==n?iC(e,t,n,o):sC(e,t,o):!0:!1}}function iC(n,e,t,r){let i=n.tr,o=r.end,a=r.$to.end(r.depth);o<a&&(i.step(new $e(o-1,a,o,a,new H(L.from(t.create(null,r.parent.copy())),1,0),1,!0)),r=new nl(i.doc.resolve(r.$from.pos),i.doc.resolve(a),r.depth));const c=mi(r);if(c==null)return!1;i.lift(r,c);let f=i.mapping.map(o,-1)-1;return qn(i.doc,f)&&i.join(f),e(i.scrollIntoView()),!0}function sC(n,e,t){let r=n.tr,i=t.parent;for(let S=t.end,_=t.endIndex-1,C=t.startIndex;_>C;_--)S-=i.child(_).nodeSize,r.delete(S-1,S+1);let o=r.doc.resolve(t.start),a=o.nodeAfter;if(r.mapping.map(t.end)!=t.start+o.nodeAfter.nodeSize)return!1;let c=t.startIndex==0,f=t.endIndex==i.childCount,h=o.node(-1),m=o.index(-1);if(!h.canReplace(m+(c?0:1),m+1,a.content.append(f?L.empty:L.from(i))))return!1;let p=o.pos,y=p+a.nodeSize;return r.step(new $e(p-(c?1:0),y+(f?1:0),p+1,y-1,new H((c?L.empty:L.from(i.copy(L.empty))).append(f?L.empty:L.from(i.copy(L.empty))),c?0:1,f?0:1),c?0:1)),e(r.scrollIntoView()),!0}function oC(n){return function(e,t){let{$from:r,$to:i}=e.selection,o=r.blockRange(i,h=>h.childCount>0&&h.firstChild.type==n);if(!o)return!1;let a=o.startIndex;if(a==0)return!1;let c=o.parent,f=c.child(a-1);if(f.type!=n)return!1;if(t){let h=f.lastChild&&f.lastChild.type==c.type,m=L.from(h?n.create():null),p=new H(L.from(n.create(null,L.from(c.type.create(null,m)))),h?3:1,0),y=o.start,S=o.end;t(e.tr.step(new $e(y-(h?3:1),S,y,S,p,1,!0)).scrollIntoView())}return!0}}function gl(n){const{state:e,transaction:t}=n;let{selection:r}=t,{doc:i}=t,{storedMarks:o}=t;return{...e,apply:e.apply.bind(e),applyTransaction:e.applyTransaction.bind(e),filterTransaction:e.filterTransaction,plugins:e.plugins,schema:e.schema,reconfigure:e.reconfigure.bind(e),toJSON:e.toJSON.bind(e),get storedMarks(){return o},get selection(){return r},get doc(){return i},get tr(){return r=t.selection,i=t.doc,o=t.storedMarks,t}}}class Tu{constructor(e){this.editor=e.editor,this.rawCommands=this.editor.extensionManager.commands,this.customState=e.state}get hasCustomState(){return!!this.customState}get state(){return this.customState||this.editor.state}get commands(){const{rawCommands:e,editor:t,state:r}=this,{view:i}=t,{tr:o}=r,a=this.buildProps(o);return Object.fromEntries(Object.entries(e).map(([c,f])=>[c,(...m)=>{const p=f(...m)(a);return!o.getMeta("preventDispatch")&&!this.hasCustomState&&i.dispatch(o),p}]))}get chain(){return()=>this.createChain()}get can(){return()=>this.createCan()}createChain(e,t=!0){const{rawCommands:r,editor:i,state:o}=this,{view:a}=i,c=[],f=!!e,h=e||o.tr,m=()=>(!f&&t&&!h.getMeta("preventDispatch")&&!this.hasCustomState&&a.dispatch(h),c.every(y=>y===!0)),p={...Object.fromEntries(Object.entries(r).map(([y,S])=>[y,(...C)=>{const A=this.buildProps(h,t),R=S(...C)(A);return c.push(R),p}])),run:m};return p}createCan(e){const{rawCommands:t,state:r}=this,i=!1,o=e||r.tr,a=this.buildProps(o,i);return{...Object.fromEntries(Object.entries(t).map(([f,h])=>[f,(...m)=>h(...m)({...a,dispatch:void 0})])),chain:()=>this.createChain(o,i)}}buildProps(e,t=!0){const{rawCommands:r,editor:i,state:o}=this,{view:a}=i,c={tr:e,editor:i,view:a,state:gl({state:o,transaction:e}),dispatch:t?()=>{}:void 0,chain:()=>this.createChain(e,t),can:()=>this.createCan(e),get commands(){return Object.fromEntries(Object.entries(r).map(([f,h])=>[f,(...m)=>h(...m)(c)]))}};return c}}function $(n,e,t){return n.config[e]===void 0&&n.parent?$(n.parent,e,t):typeof n.config[e]=="function"?n.config[e].bind({...t,parent:n.parent?$(n.parent,e,t):null}):n.config[e]}function yl(n){const e=n.filter(i=>i.type==="extension"),t=n.filter(i=>i.type==="node"),r=n.filter(i=>i.type==="mark");return{baseExtensions:e,nodeExtensions:t,markExtensions:r}}function wg(n){const e=[],{nodeExtensions:t,markExtensions:r}=yl(n),i=[...t,...r],o={default:null,rendered:!0,renderHTML:null,parseHTML:null,keepOnSplit:!0,isRequired:!1};return n.forEach(a=>{const c={name:a.name,options:a.options,storage:a.storage},f=$(a,"addGlobalAttributes",c);if(!f)return;f().forEach(m=>{m.types.forEach(p=>{Object.entries(m.attributes).forEach(([y,S])=>{e.push({type:p,name:y,attribute:{...o,...S}})})})})}),i.forEach(a=>{const c={name:a.name,options:a.options,storage:a.storage},f=$(a,"addAttributes",c);if(!f)return;const h=f();Object.entries(h).forEach(([m,p])=>{const y={...o,...p};typeof y?.default=="function"&&(y.default=y.default()),y?.isRequired&&y?.default===void 0&&delete y.default,e.push({type:a.name,name:m,attribute:y})})}),e}function ze(n,e){if(typeof n=="string"){if(!e.nodes[n])throw Error(`There is no node type named '${n}'. Maybe you forgot to add the extension?`);return e.nodes[n]}return n}function ki(...n){return n.filter(e=>!!e).reduce((e,t)=>{const r={...e};return Object.entries(t).forEach(([i,o])=>{if(!r[i]){r[i]=o;return}if(i==="class"){const c=o?o.split(" "):[],f=r[i]?r[i].split(" "):[],h=c.filter(m=>!f.includes(m));r[i]=[...f,...h].join(" ")}else i==="style"?r[i]=[r[i],o].join("; "):r[i]=o}),r},{})}function Cu(n,e){return e.filter(t=>t.attribute.rendered).map(t=>t.attribute.renderHTML?t.attribute.renderHTML(n.attrs)||{}:{[t.name]:n.attrs[t.name]}).reduce((t,r)=>ki(t,r),{})}function lC(n){return typeof n=="function"}function oe(n,e=void 0,...t){return lC(n)?e?n.bind(e)(...t):n(...t):n}function aC(n={}){return Object.keys(n).length===0&&n.constructor===Object}function cC(n){return typeof n!="string"?n:n.match(/^[+-]?(?:\d*\.)?\d+$/)?Number(n):n==="true"?!0:n==="false"?!1:n}function _g(n,e){return n.style?n:{...n,getAttrs:t=>{const r=n.getAttrs?n.getAttrs(t):n.attrs;if(r===!1)return!1;const i=e.reduce((o,a)=>{const c=a.attribute.parseHTML?a.attribute.parseHTML(t):cC(t.getAttribute(a.name));return c==null?o:{...o,[a.name]:c}},{});return{...r,...i}}}}function kg(n){return Object.fromEntries(Object.entries(n).filter(([e,t])=>e==="attrs"&&aC(t)?!1:t!=null))}function Eg(n,e){var t;const r=wg(n),{nodeExtensions:i,markExtensions:o}=yl(n),a=(t=i.find(h=>$(h,"topNode")))===null||t===void 0?void 0:t.name,c=Object.fromEntries(i.map(h=>{const m=r.filter(R=>R.type===h.name),p={name:h.name,options:h.options,storage:h.storage,editor:e},y=n.reduce((R,K)=>{const V=$(K,"extendNodeSchema",p);return{...R,...V?V(h):{}}},{}),S=kg({...y,content:oe($(h,"content",p)),marks:oe($(h,"marks",p)),group:oe($(h,"group",p)),inline:oe($(h,"inline",p)),atom:oe($(h,"atom",p)),selectable:oe($(h,"selectable",p)),draggable:oe($(h,"draggable",p)),code:oe($(h,"code",p)),defining:oe($(h,"defining",p)),isolating:oe($(h,"isolating",p)),attrs:Object.fromEntries(m.map(R=>{var K;return[R.name,{default:(K=R?.attribute)===null||K===void 0?void 0:K.default}]}))}),_=oe($(h,"parseHTML",p));_&&(S.parseDOM=_.map(R=>_g(R,m)));const C=$(h,"renderHTML",p);C&&(S.toDOM=R=>C({node:R,HTMLAttributes:Cu(R,m)}));const A=$(h,"renderText",p);return A&&(S.toText=A),[h.name,S]})),f=Object.fromEntries(o.map(h=>{const m=r.filter(A=>A.type===h.name),p={name:h.name,options:h.options,storage:h.storage,editor:e},y=n.reduce((A,R)=>{const K=$(R,"extendMarkSchema",p);return{...A,...K?K(h):{}}},{}),S=kg({...y,inclusive:oe($(h,"inclusive",p)),excludes:oe($(h,"excludes",p)),group:oe($(h,"group",p)),spanning:oe($(h,"spanning",p)),code:oe($(h,"code",p)),attrs:Object.fromEntries(m.map(A=>{var R;return[A.name,{default:(R=A?.attribute)===null||R===void 0?void 0:R.default}]}))}),_=oe($(h,"parseHTML",p));_&&(S.parseDOM=_.map(A=>_g(A,m)));const C=$(h,"renderHTML",p);return C&&(S.toDOM=A=>C({mark:A,HTMLAttributes:Cu(A,m)})),[h.name,S]}));return new hE({topNode:a,nodes:c,marks:f})}function Au(n,e){return e.nodes[n]||e.marks[n]||null}function Tg(n,e){return Array.isArray(e)?e.some(t=>(typeof t=="string"?t:t.name)===n.name):e}const uC=(n,e=500)=>{let t="";const r=n.parentOffset;return n.parent.nodesBetween(Math.max(0,r-e),r,(i,o,a,c)=>{var f,h;const m=((h=(f=i.type.spec).toText)===null||h===void 0?void 0:h.call(f,{node:i,pos:o,parent:a,index:c}))||i.textContent||"%leaf%";t+=m.slice(0,Math.max(0,r-o))}),t};function Mu(n){return Object.prototype.toString.call(n)==="[object RegExp]"}class Cg{constructor(e){this.find=e.find,this.handler=e.handler}}const fC=(n,e)=>{if(Mu(e))return e.exec(n);const t=e(n);if(!t)return null;const r=[t.text];return r.index=t.index,r.input=n,r.data=t.data,t.replaceWith&&(t.text.includes(t.replaceWith)||console.warn('[tiptap warn]: "inputRuleMatch.replaceWith" must be part of "inputRuleMatch.text".'),r.push(t.replaceWith)),r};function Ou(n){var e;const{editor:t,from:r,to:i,text:o,rules:a,plugin:c}=n,{view:f}=t;if(f.composing)return!1;const h=f.state.doc.resolve(r);if(h.parent.type.spec.code||!((e=h.nodeBefore||h.nodeAfter)===null||e===void 0)&&e.marks.find(y=>y.type.spec.code))return!1;let m=!1;const p=uC(h)+o;return a.forEach(y=>{if(m)return;const S=fC(p,y.find);if(!S)return;const _=f.state.tr,C=gl({state:f.state,transaction:_}),A={from:r-(S[0].length-o.length),to:i},{commands:R,chain:K,can:V}=new Tu({editor:t,state:C});y.handler({state:C,range:A,match:S,commands:R,chain:K,can:V})===null||!_.steps.length||(_.setMeta(c,{transform:_,from:r,to:i,text:o}),f.dispatch(_),m=!0)}),m}function dC(n){const{editor:e,rules:t}=n,r=new _t({state:{init(){return null},apply(i,o){const a=i.getMeta(r);return a||(i.selectionSet||i.docChanged?null:o)}},props:{handleTextInput(i,o,a,c){return Ou({editor:e,from:o,to:a,text:c,rules:t,plugin:r})},handleDOMEvents:{compositionend:i=>(setTimeout(()=>{const{$cursor:o}=i.state.selection;o&&Ou({editor:e,from:o.pos,to:o.pos,text:"",rules:t,plugin:r})}),!1)},handleKeyDown(i,o){if(o.key!=="Enter")return!1;const{$cursor:a}=i.state.selection;return a?Ou({editor:e,from:a.pos,to:a.pos,text:`
13
+ `,rules:t,plugin:r}):!1}},isInputRules:!0});return r}function hC(n){return typeof n=="number"}class pC{constructor(e){this.find=e.find,this.handler=e.handler}}const mC=(n,e)=>{if(Mu(e))return[...n.matchAll(e)];const t=e(n);return t?t.map(r=>{const i=[r.text];return i.index=r.index,i.input=n,i.data=r.data,r.replaceWith&&(r.text.includes(r.replaceWith)||console.warn('[tiptap warn]: "pasteRuleMatch.replaceWith" must be part of "pasteRuleMatch.text".'),i.push(r.replaceWith)),i}):[]};function gC(n){const{editor:e,state:t,from:r,to:i,rule:o,pasteEvent:a,dropEvent:c}=n,{commands:f,chain:h,can:m}=new Tu({editor:e,state:t}),p=[];return t.doc.nodesBetween(r,i,(S,_)=>{if(!S.isTextblock||S.type.spec.code)return;const C=Math.max(r,_),A=Math.min(i,_+S.content.size),R=S.textBetween(C-_,A-_,void 0,"\uFFFC");mC(R,o.find).forEach(V=>{if(V.index===void 0)return;const G=C+V.index+1,ie=G+V[0].length,q={from:t.tr.mapping.map(G),to:t.tr.mapping.map(ie)},ue=o.handler({state:t,range:q,match:V,commands:f,chain:h,can:m,pasteEvent:a,dropEvent:c});p.push(ue)})}),p.every(S=>S!==null)}function yC(n){const{editor:e,rules:t}=n;let r=null,i=!1,o=!1,a=new ClipboardEvent("paste"),c=new DragEvent("drop");return t.map(h=>new _t({view(m){const p=y=>{var S;r=!((S=m.dom.parentElement)===null||S===void 0)&&S.contains(y.target)?m.dom.parentElement:null};return window.addEventListener("dragstart",p),{destroy(){window.removeEventListener("dragstart",p)}}},props:{handleDOMEvents:{drop:(m,p)=>(o=r===m.dom.parentElement,c=p,!1),paste:(m,p)=>{var y;const S=(y=p.clipboardData)===null||y===void 0?void 0:y.getData("text/html");return a=p,i=!!S?.includes("data-pm-slice"),!1}}},appendTransaction:(m,p,y)=>{const S=m[0],_=S.getMeta("uiEvent")==="paste"&&!i,C=S.getMeta("uiEvent")==="drop"&&!o;if(!_&&!C)return;const A=p.doc.content.findDiffStart(y.doc.content),R=p.doc.content.findDiffEnd(y.doc.content);if(!hC(A)||!R||A===R.b)return;const K=y.tr,V=gl({state:y,transaction:K});if(!(!gC({editor:e,state:V,from:Math.max(A-1,0),to:R.b-1,rule:h,pasteEvent:a,dropEvent:c})||!K.steps.length))return c=new DragEvent("drop"),a=new ClipboardEvent("paste"),K}}))}function bC(n){const e=n.filter((t,r)=>n.indexOf(t)!==r);return[...new Set(e)]}class Ri{constructor(e,t){this.splittableMarks=[],this.editor=t,this.extensions=Ri.resolve(e),this.schema=Eg(this.extensions,t),this.extensions.forEach(r=>{var i;this.editor.extensionStorage[r.name]=r.storage;const o={name:r.name,options:r.options,storage:r.storage,editor:this.editor,type:Au(r.name,this.schema)};r.type==="mark"&&(!((i=oe($(r,"keepOnSplit",o)))!==null&&i!==void 0)||i)&&this.splittableMarks.push(r.name);const a=$(r,"onBeforeCreate",o);a&&this.editor.on("beforeCreate",a);const c=$(r,"onCreate",o);c&&this.editor.on("create",c);const f=$(r,"onUpdate",o);f&&this.editor.on("update",f);const h=$(r,"onSelectionUpdate",o);h&&this.editor.on("selectionUpdate",h);const m=$(r,"onTransaction",o);m&&this.editor.on("transaction",m);const p=$(r,"onFocus",o);p&&this.editor.on("focus",p);const y=$(r,"onBlur",o);y&&this.editor.on("blur",y);const S=$(r,"onDestroy",o);S&&this.editor.on("destroy",S)})}static resolve(e){const t=Ri.sort(Ri.flatten(e)),r=bC(t.map(i=>i.name));return r.length&&console.warn(`[tiptap warn]: Duplicate extension names found: [${r.map(i=>`'${i}'`).join(", ")}]. This can lead to issues.`),t}static flatten(e){return e.map(t=>{const r={name:t.name,options:t.options,storage:t.storage},i=$(t,"addExtensions",r);return i?[t,...this.flatten(i())]:t}).flat(10)}static sort(e){return e.sort((r,i)=>{const o=$(r,"priority")||100,a=$(i,"priority")||100;return o>a?-1:o<a?1:0})}get commands(){return this.extensions.reduce((e,t)=>{const r={name:t.name,options:t.options,storage:t.storage,editor:this.editor,type:Au(t.name,this.schema)},i=$(t,"addCommands",r);return i?{...e,...i()}:e},{})}get plugins(){const{editor:e}=this,t=Ri.sort([...this.extensions].reverse()),r=[],i=[],o=t.map(a=>{const c={name:a.name,options:a.options,storage:a.storage,editor:e,type:Au(a.name,this.schema)},f=[],h=$(a,"addKeyboardShortcuts",c);let m={};if(a.type==="mark"&&a.config.exitable&&(m.ArrowRight=()=>Et.handleExit({editor:e,mark:a})),h){const C=Object.fromEntries(Object.entries(h()).map(([A,R])=>[A,()=>R({editor:e})]));m={...m,...C}}const p=LT(m);f.push(p);const y=$(a,"addInputRules",c);Tg(a,e.options.enableInputRules)&&y&&r.push(...y());const S=$(a,"addPasteRules",c);Tg(a,e.options.enablePasteRules)&&S&&i.push(...S());const _=$(a,"addProseMirrorPlugins",c);if(_){const C=_();f.push(...C)}return f}).flat();return[dC({editor:e,rules:r}),...yC({editor:e,rules:i}),...o]}get attributes(){return wg(this.extensions)}get nodeViews(){const{editor:e}=this,{nodeExtensions:t}=yl(this.extensions);return Object.fromEntries(t.filter(r=>!!$(r,"addNodeView")).map(r=>{const i=this.attributes.filter(f=>f.type===r.name),o={name:r.name,options:r.options,storage:r.storage,editor:e,type:ze(r.name,this.schema)},a=$(r,"addNodeView",o);if(!a)return[];const c=(f,h,m,p)=>{const y=Cu(f,i);return a()({editor:e,node:f,getPos:m,decorations:p,HTMLAttributes:y,extension:r})};return[r.name,c]}))}}function vC(n){return Object.prototype.toString.call(n).slice(8,-1)}function Iu(n){return vC(n)!=="Object"?!1:n.constructor===Object&&Object.getPrototypeOf(n)===Object.prototype}function bl(n,e){const t={...n};return Iu(n)&&Iu(e)&&Object.keys(e).forEach(r=>{Iu(e[r])?r in n?t[r]=bl(n[r],e[r]):Object.assign(t,{[r]:e[r]}):Object.assign(t,{[r]:e[r]})}),t}class Re{constructor(e={}){this.type="extension",this.name="extension",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...e},this.name=this.config.name,e.defaultOptions&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=oe($(this,"addOptions",{name:this.name}))),this.storage=oe($(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(e={}){return new Re(e)}configure(e={}){const t=this.extend();return t.options=bl(this.options,e),t.storage=oe($(t,"addStorage",{name:t.name,options:t.options})),t}extend(e={}){const t=new Re(e);return t.parent=this,this.child=t,t.name=e.name?e.name:t.parent.name,e.defaultOptions&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${t.name}".`),t.options=oe($(t,"addOptions",{name:t.name})),t.storage=oe($(t,"addStorage",{name:t.name,options:t.options})),t}}function SC(n,e,t){const{from:r,to:i}=e,{blockSeparator:o=`
16
14
 
17
- `,textSerializers:a={}}=t||{};let u="",f=!0;return n.nodesBetween(r,i,(h,m,p,b)=>{var S;const x=a?.[h.type.name];x?(h.isBlock&&!f&&(u+=o,f=!0),p&&(u+=x({node:h,pos:m,parent:p,index:b,range:e}))):h.isText?(u+=(S=h?.text)===null||S===void 0?void 0:S.slice(Math.max(r,m)-m,i-m),f=!1):h.isBlock&&!f&&(u+=o,f=!0)}),u}function bC(n){return Object.fromEntries(Object.entries(n.nodes).filter(([,e])=>e.spec.toText).map(([e,t])=>[e,t.spec.toText]))}Ne.create({name:"clipboardTextSerializer",addProseMirrorPlugins(){return[new St({key:new Kt("clipboardTextSerializer"),props:{clipboardTextSerializer:()=>{const{editor:n}=this,{state:e,schema:t}=n,{doc:r,selection:i}=e,{ranges:o}=i,a=Math.min(...o.map(m=>m.$from.pos)),u=Math.max(...o.map(m=>m.$to.pos)),f=bC(t);return yC(r,{from:a,to:u},{textSerializers:f})}}})]}});const vC=()=>({editor:n,view:e})=>(requestAnimationFrame(()=>{var t;n.isDestroyed||(e.dom.blur(),(t=window?.getSelection())===null||t===void 0||t.removeAllRanges())}),!0),SC=(n=!1)=>({commands:e})=>e.setContent("",n),wC=()=>({state:n,tr:e,dispatch:t})=>{const{selection:r}=e,{ranges:i}=r;return t&&i.forEach(({$from:o,$to:a})=>{n.doc.nodesBetween(o.pos,a.pos,(u,f)=>{if(u.type.isText)return;const{doc:h,mapping:m}=e,p=h.resolve(m.map(f)),b=h.resolve(m.map(f+u.nodeSize)),S=p.blockRange(b);if(!S)return;const x=hi(S);if(u.type.isTextblock){const{defaultType:C}=p.parent.contentMatchAt(p.index());e.setNodeMarkup(S.start,C)}(x||x===0)&&e.lift(S,x)})}),!0},_C=n=>e=>n(e),xC=()=>({state:n,dispatch:e})=>KT(n,e),kC=(n,e)=>({editor:t,tr:r})=>{const{state:i}=t,o=i.doc.slice(n.from,n.to);r.deleteRange(n.from,n.to);const a=r.mapping.map(e);return r.insert(a,o.content),r.setSelection(new he(r.doc.resolve(a-1))),!0},EC=()=>({tr:n,dispatch:e})=>{const{selection:t}=n,r=t.$anchor.node();if(r.content.size>0)return!1;const i=n.selection.$anchor;for(let o=i.depth;o>0;o-=1)if(i.node(o).type===r.type){if(e){const u=i.before(o),f=i.after(o);n.delete(u,f).scrollIntoView()}return!0}return!1},TC=n=>({tr:e,state:t,dispatch:r})=>{const i=Fe(n,t.schema),o=e.selection.$anchor;for(let a=o.depth;a>0;a-=1)if(o.node(a).type===i){if(r){const f=o.before(a),h=o.after(a);e.delete(f,h).scrollIntoView()}return!0}return!1},CC=n=>({tr:e,dispatch:t})=>{const{from:r,to:i}=n;return t&&e.delete(r,i),!0},AC=()=>({state:n,dispatch:e})=>RT(n,e),MC=()=>({commands:n})=>n.keyboardShortcut("Enter"),OC=()=>({state:n,dispatch:e})=>VT(n,e);function hl(n,e,t={strict:!0}){const r=Object.keys(e);return r.length?r.every(i=>t.strict?e[i]===n[i]:_c(e[i])?e[i].test(n[i]):e[i]===n[i]):!0}function Ec(n,e,t={}){return n.find(r=>r.type===e&&hl(r.attrs,t))}function IC(n,e,t={}){return!!Ec(n,e,t)}function Tc(n,e,t={}){if(!n||!e)return;let r=n.parent.childAfter(n.parentOffset);if(n.parentOffset===r.offset&&r.offset!==0&&(r=n.parent.childBefore(n.parentOffset)),!r.node)return;const i=Ec([...r.node.marks],e,t);if(!i)return;let o=r.index,a=n.start()+r.offset,u=o+1,f=a+r.node.nodeSize;for(Ec([...r.node.marks],e,t);o>0&&i.isInSet(n.parent.child(o-1).marks);)o-=1,a-=n.parent.child(o).nodeSize;for(;u<n.parent.childCount&&IC([...n.parent.child(u).marks],e,t);)f+=n.parent.child(u).nodeSize,u+=1;return{from:a,to:f}}function nn(n,e){if(typeof n=="string"){if(!e.marks[n])throw Error(`There is no mark type named '${n}'. Maybe you forgot to add the extension?`);return e.marks[n]}return n}const NC=(n,e={})=>({tr:t,state:r,dispatch:i})=>{const o=nn(n,r.schema),{doc:a,selection:u}=t,{$from:f,from:h,to:m}=u;if(i){const p=Tc(f,o,e);if(p&&p.from<=h&&p.to>=m){const b=he.create(a,p.from,p.to);t.setSelection(b)}}return!0},RC=n=>e=>{const t=typeof n=="function"?n(e):n;for(let r=0;r<t.length;r+=1)if(t[r](e))return!0;return!1};function Ag(n){return n instanceof he}function Or(n=0,e=0,t=0){return Math.min(Math.max(n,e),t)}function LC(n,e=null){if(!e)return null;const t=de.atStart(n),r=de.atEnd(n);if(e==="start"||e===!0)return t;if(e==="end")return r;const i=t.from,o=r.to;return e==="all"?he.create(n,Or(0,i,o),Or(n.content.size,i,o)):he.create(n,Or(e,i,o),Or(e,i,o))}function Cc(){return["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document}const PC=(n=null,e={})=>({editor:t,view:r,tr:i,dispatch:o})=>{e={scrollIntoView:!0,...e};const a=()=>{Cc()&&r.dom.focus(),requestAnimationFrame(()=>{t.isDestroyed||(r.focus(),e?.scrollIntoView&&t.commands.scrollIntoView())})};if(r.hasFocus()&&n===null||n===!1)return!0;if(o&&n===null&&!Ag(t.state.selection))return a(),!0;const u=LC(i.doc,n)||t.state.selection,f=t.state.selection.eq(u);return o&&(f||i.setSelection(u),f&&i.storedMarks&&i.setStoredMarks(i.storedMarks),a()),!0},DC=(n,e)=>t=>n.every((r,i)=>e(r,{...t,index:i})),FC=(n,e)=>({tr:t,commands:r})=>r.insertContentAt({from:t.selection.from,to:t.selection.to},n,e);function Mg(n){const e=`<body>${n}</body>`;return new window.DOMParser().parseFromString(e,"text/html").body}function pl(n,e,t){if(t={slice:!0,parseOptions:{},...t},typeof n=="object"&&n!==null)try{return Array.isArray(n)&&n.length>0?L.fromArray(n.map(r=>e.nodeFromJSON(r))):e.nodeFromJSON(n)}catch(r){return console.warn("[tiptap warn]: Invalid content.","Passed value:",n,"Error:",r),pl("",e,t)}if(typeof n=="string"){const r=Uu.fromSchema(e);return t.slice?r.parseSlice(Mg(n),t.parseOptions).content:r.parse(Mg(n),t.parseOptions)}return pl("",e,t)}function BC(n,e,t){const r=n.steps.length-1;if(r<e)return;const i=n.steps[r];if(!(i instanceof Xe||i instanceof ze))return;const o=n.mapping.maps[r];let a=0;o.forEach((u,f,h,m)=>{a===0&&(a=m)}),n.setSelection(de.near(n.doc.resolve(a),t))}const zC=n=>n.toString().startsWith("<"),HC=(n,e,t)=>({tr:r,dispatch:i,editor:o})=>{if(i){t={parseOptions:{},updateSelection:!0,...t};const a=pl(e,o.schema,{parseOptions:{preserveWhitespace:"full",...t.parseOptions}});if(a.toString()==="<>")return!0;let{from:u,to:f}=typeof n=="number"?{from:n,to:n}:{from:n.from,to:n.to},h=!0,m=!0;if((zC(a)?a:[a]).forEach(b=>{b.check(),h=h?b.isText&&b.marks.length===0:!1,m=m?b.isBlock:!1}),u===f&&m){const{parent:b}=r.doc.resolve(u);b.isTextblock&&!b.type.spec.code&&!b.childCount&&(u-=1,f+=1)}h?Array.isArray(e)?r.insertText(e.map(b=>b.text||"").join(""),u,f):typeof e=="object"&&e&&e.text?r.insertText(e.text,u,f):r.insertText(e,u,f):r.replaceWith(u,f,a),t.updateSelection&&BC(r,r.steps.length-1,-1)}return!0},$C=()=>({state:n,dispatch:e})=>HT(n,e),WC=()=>({state:n,dispatch:e})=>$T(n,e),UC=()=>({state:n,dispatch:e})=>PT(n,e),VC=()=>({state:n,dispatch:e})=>BT(n,e),KC=()=>({tr:n,state:e,dispatch:t})=>{try{const r=tl(e.doc,e.selection.$from.pos,-1);return r==null?!1:(n.join(r,2),t&&t(n),!0)}catch{return!1}},GC=()=>({state:n,dispatch:e,tr:t})=>{try{const r=tl(n.doc,n.selection.$from.pos,1);return r==null?!1:(t.join(r,2),e&&e(t),!0)}catch{return!1}};function Og(){return typeof navigator<"u"?/Mac/.test(navigator.platform):!1}function qC(n){const e=n.split(/-(?!$)/);let t=e[e.length-1];t==="Space"&&(t=" ");let r,i,o,a;for(let u=0;u<e.length-1;u+=1){const f=e[u];if(/^(cmd|meta|m)$/i.test(f))a=!0;else if(/^a(lt)?$/i.test(f))r=!0;else if(/^(c|ctrl|control)$/i.test(f))i=!0;else if(/^s(hift)?$/i.test(f))o=!0;else if(/^mod$/i.test(f))Cc()||Og()?a=!0:i=!0;else throw new Error(`Unrecognized modifier name: ${f}`)}return r&&(t=`Alt-${t}`),i&&(t=`Ctrl-${t}`),a&&(t=`Meta-${t}`),o&&(t=`Shift-${t}`),t}const JC=n=>({editor:e,view:t,tr:r,dispatch:i})=>{const o=qC(n).split(/-(?!$)/),a=o.find(h=>!["Alt","Ctrl","Meta","Shift"].includes(h)),u=new KeyboardEvent("keydown",{key:a==="Space"?" ":a,altKey:o.includes("Alt"),ctrlKey:o.includes("Ctrl"),metaKey:o.includes("Meta"),shiftKey:o.includes("Shift"),bubbles:!0,cancelable:!0}),f=e.captureTransaction(()=>{t.someProp("handleKeyDown",h=>h(t,u))});return f?.steps.forEach(h=>{const m=h.map(r.mapping);m&&i&&r.maybeStep(m)}),!0};function Ac(n,e,t={}){const{from:r,to:i,empty:o}=n.selection,a=e?Fe(e,n.schema):null,u=[];n.doc.nodesBetween(r,i,(p,b)=>{if(p.isText)return;const S=Math.max(r,b),x=Math.min(i,b+p.nodeSize);u.push({node:p,from:S,to:x})});const f=i-r,h=u.filter(p=>a?a.name===p.node.type.name:!0).filter(p=>hl(p.node.attrs,t,{strict:!1}));return o?!!h.length:h.reduce((p,b)=>p+b.to-b.from,0)>=f}const jC=(n,e={})=>({state:t,dispatch:r})=>{const i=Fe(n,t.schema);return Ac(t,i,e)?WT(t,r):!1},YC=()=>({state:n,dispatch:e})=>GT(n,e),XC=n=>({state:e,dispatch:t})=>{const r=Fe(n,e.schema);return eC(r)(e,t)},ZC=()=>({state:n,dispatch:e})=>UT(n,e);function Mc(n,e){return e.nodes[n]?"node":e.marks[n]?"mark":null}function Ig(n,e){const t=typeof e=="string"?[e]:e;return Object.keys(n).reduce((r,i)=>(t.includes(i)||(r[i]=n[i]),r),{})}const QC=(n,e)=>({tr:t,state:r,dispatch:i})=>{let o=null,a=null;const u=Mc(typeof n=="string"?n:n.name,r.schema);return u?(u==="node"&&(o=Fe(n,r.schema)),u==="mark"&&(a=nn(n,r.schema)),i&&t.selection.ranges.forEach(f=>{r.doc.nodesBetween(f.$from.pos,f.$to.pos,(h,m)=>{o&&o===h.type&&t.setNodeMarkup(m,void 0,Ig(h.attrs,e)),a&&h.marks.length&&h.marks.forEach(p=>{a===p.type&&t.addMark(m,m+h.nodeSize,a.create(Ig(p.attrs,e)))})})}),!0):!1},eA=()=>({tr:n,dispatch:e})=>(e&&n.scrollIntoView(),!0),tA=()=>({tr:n,commands:e})=>e.setTextSelection({from:0,to:n.doc.content.size}),nA=()=>({state:n,dispatch:e})=>DT(n,e),rA=()=>({state:n,dispatch:e})=>zT(n,e),iA=()=>({state:n,dispatch:e})=>qT(n,e),sA=()=>({state:n,dispatch:e})=>YT(n,e),oA=()=>({state:n,dispatch:e})=>jT(n,e);function lA(n,e,t={}){return pl(n,e,{slice:!1,parseOptions:t})}const aA=(n,e=!1,t={})=>({tr:r,editor:i,dispatch:o})=>{const{doc:a}=r,u=lA(n,i.schema,t);return o&&r.replaceWith(0,a.content.size,u).setMeta("preventUpdate",!e),!0};function Ng(n,e){const t=nn(e,n.schema),{from:r,to:i,empty:o}=n.selection,a=[];o?(n.storedMarks&&a.push(...n.storedMarks),a.push(...n.selection.$head.marks())):n.doc.nodesBetween(r,i,f=>{a.push(...f.marks)});const u=a.find(f=>f.type.name===t.name);return u?{...u.attrs}:{}}function uA(n,e){const t=new HE(n);return e.forEach(r=>{r.steps.forEach(i=>{t.step(i)})}),t}function cA(n){for(let e=0;e<n.edgeCount;e+=1){const{type:t}=n.edge(e);if(t.isTextblock&&!t.hasRequiredAttrs())return t}return null}function fA(n,e,t){const r=[];return n.nodesBetween(e.from,e.to,(i,o)=>{t(i)&&r.push({node:i,pos:o})}),r}function dA(n,e){for(let t=n.depth;t>0;t-=1){const r=n.node(t);if(e(r))return{pos:t>0?n.before(t):0,start:n.start(t),depth:t,node:r}}}function Oc(n){return e=>dA(e.$from,n)}function hA(n,e){const t=Ii.resolve(n);return Eg(t,e)}function pA(n,e){const t=Fe(e,n.schema),{from:r,to:i}=n.selection,o=[];n.doc.nodesBetween(r,i,u=>{o.push(u)});const a=o.reverse().find(u=>u.type.name===t.name);return a?{...a.attrs}:{}}function mA(n,e){const t=Mc(typeof e=="string"?e:e.name,n.schema);return t==="node"?pA(n,e):t==="mark"?Ng(n,e):{}}function gA(n,e=JSON.stringify){const t={};return n.filter(r=>{const i=e(r);return Object.prototype.hasOwnProperty.call(t,i)?!1:t[i]=!0})}function yA(n){const e=gA(n);return e.length===1?e:e.filter((t,r)=>!e.filter((o,a)=>a!==r).some(o=>t.oldRange.from>=o.oldRange.from&&t.oldRange.to<=o.oldRange.to&&t.newRange.from>=o.newRange.from&&t.newRange.to<=o.newRange.to))}function bA(n){const{mapping:e,steps:t}=n,r=[];return e.maps.forEach((i,o)=>{const a=[];if(i.ranges.length)i.forEach((u,f)=>{a.push({from:u,to:f})});else{const{from:u,to:f}=t[o];if(u===void 0||f===void 0)return;a.push({from:u,to:f})}a.forEach(({from:u,to:f})=>{const h=e.slice(o).map(u,-1),m=e.slice(o).map(f),p=e.invert().map(h,-1),b=e.invert().map(m);r.push({oldRange:{from:p,to:b},newRange:{from:h,to:m}})})}),yA(r)}function Rg(n,e,t){const r=[];return n===e?t.resolve(n).marks().forEach(i=>{const o=t.resolve(n-1),a=Tc(o,i.type);a&&r.push({mark:i,...a})}):t.nodesBetween(n,e,(i,o)=>{r.push(...i.marks.map(a=>({from:o,to:o+i.nodeSize,mark:a})))}),r}function ml(n,e,t){return Object.fromEntries(Object.entries(t).filter(([r])=>{const i=n.find(o=>o.type===e&&o.name===r);return i?i.attribute.keepOnSplit:!1}))}function vA(n,e,t={}){const{empty:r,ranges:i}=n.selection,o=e?nn(e,n.schema):null;if(r)return!!(n.storedMarks||n.selection.$from.marks()).filter(p=>o?o.name===p.type.name:!0).find(p=>hl(p.attrs,t,{strict:!1}));let a=0;const u=[];if(i.forEach(({$from:p,$to:b})=>{const S=p.pos,x=b.pos;n.doc.nodesBetween(S,x,(C,A)=>{if(!C.isText&&!C.marks.length)return;const N=Math.max(S,A),G=Math.min(x,A+C.nodeSize),K=G-N;a+=K,u.push(...C.marks.map(oe=>({mark:oe,from:N,to:G})))})}),a===0)return!1;const f=u.filter(p=>o?o.name===p.mark.type.name:!0).filter(p=>hl(p.mark.attrs,t,{strict:!1})).reduce((p,b)=>p+b.to-b.from,0),h=u.filter(p=>o?p.mark.type!==o&&p.mark.type.excludes(o):!0).reduce((p,b)=>p+b.to-b.from,0);return(f>0?f+h:f)>=a}function Lg(n,e){const{nodeExtensions:t}=fl(e),r=t.find(a=>a.name===n);if(!r)return!1;const i={name:r.name,options:r.options,storage:r.storage},o=se(W(r,"group",i));return typeof o!="string"?!1:o.split(" ").includes("list")}function SA(n,e,t){var r;const{selection:i}=e;let o=null;if(Ag(i)&&(o=i.$cursor),o){const u=(r=n.storedMarks)!==null&&r!==void 0?r:o.marks();return!!t.isInSet(u)||!u.some(f=>f.type.excludes(t))}const{ranges:a}=i;return a.some(({$from:u,$to:f})=>{let h=u.depth===0?n.doc.inlineContent&&n.doc.type.allowsMarkType(t):!1;return n.doc.nodesBetween(u.pos,f.pos,(m,p,b)=>{if(h)return!1;if(m.isInline){const S=!b||b.type.allowsMarkType(t),x=!!t.isInSet(m.marks)||!m.marks.some(C=>C.type.excludes(t));h=S&&x}return!h}),h})}const wA=(n,e={})=>({tr:t,state:r,dispatch:i})=>{const{selection:o}=t,{empty:a,ranges:u}=o,f=nn(n,r.schema);if(i)if(a){const h=Ng(r,f);t.addStoredMark(f.create({...h,...e}))}else u.forEach(h=>{const m=h.$from.pos,p=h.$to.pos;r.doc.nodesBetween(m,p,(b,S)=>{const x=Math.max(S,m),C=Math.min(S+b.nodeSize,p);b.marks.find(N=>N.type===f)?b.marks.forEach(N=>{f===N.type&&t.addMark(x,C,f.create({...N.attrs,...e}))}):t.addMark(x,C,f.create(e))})});return SA(r,t,f)},_A=(n,e)=>({tr:t})=>(t.setMeta(n,e),!0),xA=(n,e={})=>({state:t,dispatch:r,chain:i})=>{const o=Fe(n,t.schema);return o.isTextblock?i().command(({commands:a})=>wg(o,e)(t)?!0:a.clearNodes()).command(({state:a})=>wg(o,e)(a,r)).run():(console.warn('[tiptap warn]: Currently "setNode()" only supports text block nodes.'),!1)},kA=n=>({tr:e,dispatch:t})=>{if(t){const{doc:r}=e,i=Or(n,0,r.content.size),o=Y.create(r,i);e.setSelection(o)}return!0},EA=n=>({tr:e,dispatch:t})=>{if(t){const{doc:r}=e,{from:i,to:o}=typeof n=="number"?{from:n,to:n}:n,a=he.atStart(r).from,u=he.atEnd(r).to,f=Or(i,a,u),h=Or(o,a,u),m=he.create(r,f,h);e.setSelection(m)}return!0},TA=n=>({state:e,dispatch:t})=>{const r=Fe(n,e.schema);return rC(r)(e,t)};function Pg(n,e){const t=n.storedMarks||n.selection.$to.parentOffset&&n.selection.$from.marks();if(t){const r=t.filter(i=>e?.includes(i.type.name));n.tr.ensureMarks(r)}}const CA=({keepMarks:n=!0}={})=>({tr:e,state:t,dispatch:r,editor:i})=>{const{selection:o,doc:a}=e,{$from:u,$to:f}=o,h=i.extensionManager.attributes,m=ml(h,u.node().type.name,u.node().attrs);if(o instanceof Y&&o.node.isBlock)return!u.parentOffset||!pi(a,u.pos)?!1:(r&&(n&&Pg(t,i.extensionManager.splittableMarks),e.split(u.pos).scrollIntoView()),!0);if(!u.parent.isBlock)return!1;if(r){const p=f.parentOffset===f.parent.content.size;o instanceof he&&e.deleteSelection();const b=u.depth===0?void 0:cA(u.node(-1).contentMatchAt(u.indexAfter(-1)));let S=p&&b?[{type:b,attrs:m}]:void 0,x=pi(e.doc,e.mapping.map(u.pos),1,S);if(!S&&!x&&pi(e.doc,e.mapping.map(u.pos),1,b?[{type:b}]:void 0)&&(x=!0,S=b?[{type:b,attrs:m}]:void 0),x&&(e.split(e.mapping.map(u.pos),1,S),b&&!p&&!u.parentOffset&&u.parent.type!==b)){const C=e.mapping.map(u.before()),A=e.doc.resolve(C);u.node(-1).canReplaceWith(A.index(),A.index()+1,b)&&e.setNodeMarkup(e.mapping.map(u.before()),b)}n&&Pg(t,i.extensionManager.splittableMarks),e.scrollIntoView()}return!0},AA=n=>({tr:e,state:t,dispatch:r,editor:i})=>{var o;const a=Fe(n,t.schema),{$from:u,$to:f}=t.selection,h=t.selection.node;if(h&&h.isBlock||u.depth<2||!u.sameParent(f))return!1;const m=u.node(-1);if(m.type!==a)return!1;const p=i.extensionManager.attributes;if(u.parent.content.size===0&&u.node(-1).childCount===u.indexAfter(-1)){if(u.depth===2||u.node(-3).type!==a||u.index(-2)!==u.node(-2).childCount-1)return!1;if(r){let A=L.empty;const N=u.index(-1)?1:u.index(-2)?2:3;for(let ue=u.depth-N;ue>=u.depth-3;ue-=1)A=L.from(u.node(ue).copy(A));const G=u.indexAfter(-1)<u.node(-2).childCount?1:u.indexAfter(-2)<u.node(-3).childCount?2:3,K=ml(p,u.node().type.name,u.node().attrs),oe=((o=a.contentMatch.defaultType)===null||o===void 0?void 0:o.createAndFill(K))||void 0;A=A.append(L.from(a.createAndFill(null,oe)||void 0));const pe=u.before(u.depth-(N-1));e.replace(pe,u.after(-G),new $(A,4-N,0));let B=-1;e.doc.nodesBetween(pe,e.doc.content.size,(ue,lt)=>{if(B>-1)return!1;ue.isTextblock&&ue.content.size===0&&(B=lt+1)}),B>-1&&e.setSelection(he.near(e.doc.resolve(B))),e.scrollIntoView()}return!0}const b=f.pos===u.end()?m.contentMatchAt(0).defaultType:null,S=ml(p,m.type.name,m.attrs),x=ml(p,u.node().type.name,u.node().attrs);e.delete(u.pos,f.pos);const C=b?[{type:a,attrs:S},{type:b,attrs:x}]:[{type:a,attrs:S}];if(!pi(e.doc,u.pos,2))return!1;if(r){const{selection:A,storedMarks:N}=t,{splittableMarks:G}=i.extensionManager,K=N||A.$to.parentOffset&&A.$from.marks();if(e.split(u.pos,2,C).scrollIntoView(),!K||!r)return!0;const oe=K.filter(pe=>G.includes(pe.type.name));e.ensureMarks(oe)}return!0},Ic=(n,e)=>{const t=Oc(a=>a.type===e)(n.selection);if(!t)return!0;const r=n.doc.resolve(Math.max(0,t.pos-1)).before(t.depth);if(r===void 0)return!0;const i=n.doc.nodeAt(r);return t.node.type===i?.type&&Vn(n.doc,t.pos)&&n.join(t.pos),!0},Nc=(n,e)=>{const t=Oc(a=>a.type===e)(n.selection);if(!t)return!0;const r=n.doc.resolve(t.start).after(t.depth);if(r===void 0)return!0;const i=n.doc.nodeAt(r);return t.node.type===i?.type&&Vn(n.doc,r)&&n.join(r),!0},MA=(n,e,t,r={})=>({editor:i,tr:o,state:a,dispatch:u,chain:f,commands:h,can:m})=>{const{extensions:p,splittableMarks:b}=i.extensionManager,S=Fe(n,a.schema),x=Fe(e,a.schema),{selection:C,storedMarks:A}=a,{$from:N,$to:G}=C,K=N.blockRange(G),oe=A||C.$to.parentOffset&&C.$from.marks();if(!K)return!1;const pe=Oc(B=>Lg(B.type.name,p))(C);if(K.depth>=1&&pe&&K.depth-pe.depth<=1){if(pe.node.type===S)return h.liftListItem(x);if(Lg(pe.node.type.name,p)&&S.validContent(pe.node.content)&&u)return f().command(()=>(o.setNodeMarkup(pe.pos,S),!0)).command(()=>Ic(o,S)).command(()=>Nc(o,S)).run()}return!t||!oe||!u?f().command(()=>m().wrapInList(S,r)?!0:h.clearNodes()).wrapInList(S,r).command(()=>Ic(o,S)).command(()=>Nc(o,S)).run():f().command(()=>{const B=m().wrapInList(S,r),ue=oe.filter(lt=>b.includes(lt.type.name));return o.ensureMarks(ue),B?!0:h.clearNodes()}).wrapInList(S,r).command(()=>Ic(o,S)).command(()=>Nc(o,S)).run()},OA=(n,e={},t={})=>({state:r,commands:i})=>{const{extendEmptyMarkRange:o=!1}=t,a=nn(n,r.schema);return vA(r,a,e)?i.unsetMark(a,{extendEmptyMarkRange:o}):i.setMark(a,e)},IA=(n,e,t={})=>({state:r,commands:i})=>{const o=Fe(n,r.schema),a=Fe(e,r.schema);return Ac(r,o,t)?i.setNode(a):i.setNode(o,t)},NA=(n,e={})=>({state:t,commands:r})=>{const i=Fe(n,t.schema);return Ac(t,i,e)?r.lift(i):r.wrapIn(i,e)},RA=()=>({state:n,dispatch:e})=>{const t=n.plugins;for(let r=0;r<t.length;r+=1){const i=t[r];let o;if(i.spec.isInputRules&&(o=i.getState(n))){if(e){const a=n.tr,u=o.transform;for(let f=u.steps.length-1;f>=0;f-=1)a.step(u.steps[f].invert(u.docs[f]));if(o.text){const f=a.doc.resolve(o.from).marks();a.replaceWith(o.from,o.to,n.schema.text(o.text,f))}else a.delete(o.from,o.to)}return!0}}return!1},LA=()=>({tr:n,dispatch:e})=>{const{selection:t}=n,{empty:r,ranges:i}=t;return r||e&&i.forEach(o=>{n.removeMark(o.$from.pos,o.$to.pos)}),!0},PA=(n,e={})=>({tr:t,state:r,dispatch:i})=>{var o;const{extendEmptyMarkRange:a=!1}=e,{selection:u}=t,f=nn(n,r.schema),{$from:h,empty:m,ranges:p}=u;if(!i)return!0;if(m&&a){let{from:b,to:S}=u;const x=(o=h.marks().find(A=>A.type===f))===null||o===void 0?void 0:o.attrs,C=Tc(h,f,x);C&&(b=C.from,S=C.to),t.removeMark(b,S,f)}else p.forEach(b=>{t.removeMark(b.$from.pos,b.$to.pos,f)});return t.removeStoredMark(f),!0},DA=(n,e={})=>({tr:t,state:r,dispatch:i})=>{let o=null,a=null;const u=Mc(typeof n=="string"?n:n.name,r.schema);return u?(u==="node"&&(o=Fe(n,r.schema)),u==="mark"&&(a=nn(n,r.schema)),i&&t.selection.ranges.forEach(f=>{const h=f.$from.pos,m=f.$to.pos;r.doc.nodesBetween(h,m,(p,b)=>{o&&o===p.type&&t.setNodeMarkup(b,void 0,{...p.attrs,...e}),a&&p.marks.length&&p.marks.forEach(S=>{if(a===S.type){const x=Math.max(b,h),C=Math.min(b+p.nodeSize,m);t.addMark(x,C,a.create({...S.attrs,...e}))}})})}),!0):!1},FA=(n,e={})=>({state:t,dispatch:r})=>{const i=Fe(n,t.schema);return XT(i,e)(t,r)},BA=(n,e={})=>({state:t,dispatch:r})=>{const i=Fe(n,t.schema);return ZT(i,e)(t,r)};var zA=Object.freeze({__proto__:null,blur:vC,clearContent:SC,clearNodes:wC,command:_C,createParagraphNear:xC,cut:kC,deleteCurrentNode:EC,deleteNode:TC,deleteRange:CC,deleteSelection:AC,enter:MC,exitCode:OC,extendMarkRange:NC,first:RC,focus:PC,forEach:DC,insertContent:FC,insertContentAt:HC,joinUp:$C,joinDown:WC,joinBackward:UC,joinForward:VC,joinItemBackward:KC,joinItemForward:GC,keyboardShortcut:JC,lift:jC,liftEmptyBlock:YC,liftListItem:XC,newlineInCode:ZC,resetAttributes:QC,scrollIntoView:eA,selectAll:tA,selectNodeBackward:nA,selectNodeForward:rA,selectParentNode:iA,selectTextblockEnd:sA,selectTextblockStart:oA,setContent:aA,setMark:wA,setMeta:_A,setNode:xA,setNodeSelection:kA,setTextSelection:EA,sinkListItem:TA,splitBlock:CA,splitListItem:AA,toggleList:MA,toggleMark:OA,toggleNode:IA,toggleWrap:NA,undoInputRule:RA,unsetAllMarks:LA,unsetMark:PA,updateAttributes:DA,wrapIn:FA,wrapInList:BA});Ne.create({name:"commands",addCommands(){return{...zA}}}),Ne.create({name:"editable",addProseMirrorPlugins(){return[new St({key:new Kt("editable"),props:{editable:()=>this.editor.options.editable}})]}}),Ne.create({name:"focusEvents",addProseMirrorPlugins(){const{editor:n}=this;return[new St({key:new Kt("focusEvents"),props:{handleDOMEvents:{focus:(e,t)=>{n.isFocused=!0;const r=n.state.tr.setMeta("focus",{event:t}).setMeta("addToHistory",!1);return e.dispatch(r),!1},blur:(e,t)=>{n.isFocused=!1;const r=n.state.tr.setMeta("blur",{event:t}).setMeta("addToHistory",!1);return e.dispatch(r),!1}}}})]}}),Ne.create({name:"keymap",addKeyboardShortcuts(){const n=()=>this.editor.commands.first(({commands:a})=>[()=>a.undoInputRule(),()=>a.command(({tr:u})=>{const{selection:f,doc:h}=u,{empty:m,$anchor:p}=f,{pos:b,parent:S}=p,x=p.parent.isTextblock?u.doc.resolve(b-1):p,C=x.parent.type.spec.isolating,A=p.pos-p.parentOffset,N=C&&x.parent.childCount===1?A===p.pos:de.atStart(h).from===b;return!m||!N||!S.type.isTextblock||S.textContent.length?!1:a.clearNodes()}),()=>a.deleteSelection(),()=>a.joinBackward(),()=>a.selectNodeBackward()]),e=()=>this.editor.commands.first(({commands:a})=>[()=>a.deleteSelection(),()=>a.deleteCurrentNode(),()=>a.joinForward(),()=>a.selectNodeForward()]),r={Enter:()=>this.editor.commands.first(({commands:a})=>[()=>a.newlineInCode(),()=>a.createParagraphNear(),()=>a.liftEmptyBlock(),()=>a.splitBlock()]),"Mod-Enter":()=>this.editor.commands.exitCode(),Backspace:n,"Mod-Backspace":n,"Shift-Backspace":n,Delete:e,"Mod-Delete":e,"Mod-a":()=>this.editor.commands.selectAll()},i={...r},o={...r,"Ctrl-h":n,"Alt-Backspace":n,"Ctrl-d":e,"Ctrl-Alt-Backspace":e,"Alt-Delete":e,"Alt-d":e,"Ctrl-a":()=>this.editor.commands.selectTextblockStart(),"Ctrl-e":()=>this.editor.commands.selectTextblockEnd()};return Cc()||Og()?o:i},addProseMirrorPlugins(){return[new St({key:new Kt("clearDocument"),appendTransaction:(n,e,t)=>{if(!(n.some(x=>x.docChanged)&&!e.doc.eq(t.doc)))return;const{empty:i,from:o,to:a}=e.selection,u=de.atStart(e.doc).from,f=de.atEnd(e.doc).to;if(i||!(o===u&&a===f)||!(t.doc.textBetween(0,t.doc.content.size," "," ").length===0))return;const p=t.tr,b=cl({state:t,transaction:p}),{commands:S}=new vc({editor:this.editor,state:b});if(S.clearNodes(),!!p.steps.length)return p}})]}}),Ne.create({name:"tabindex",addProseMirrorPlugins(){return[new St({key:new Kt("tabindex"),props:{attributes:this.editor.isEditable?{tabindex:"0"}:{}}})]}});function HA(n){return new Cg({find:n.find,handler:({state:e,range:t,match:r})=>{const i=e.doc.resolve(t.from),o=se(n.getAttributes,void 0,r)||{};if(!i.node(-1).canReplaceWith(i.index(-1),i.indexAfter(-1),n.type))return null;e.tr.delete(t.from,t.to).setBlockType(t.from,t.from,n.type,o)}})}function $A(n){return new Cg({find:n.find,handler:({state:e,range:t,match:r,chain:i})=>{const o=se(n.getAttributes,void 0,r)||{},a=e.tr.delete(t.from,t.to),f=a.doc.resolve(t.from).blockRange(),h=f&&ju(f,n.type,o);if(!h)return null;if(a.wrap(f,h),n.keepMarks&&n.editor){const{selection:p,storedMarks:b}=e,{splittableMarks:S}=n.editor.extensionManager,x=b||p.$to.parentOffset&&p.$from.marks();if(x){const C=x.filter(A=>S.includes(A.type.name));a.ensureMarks(C)}}if(n.keepAttributes){const p=n.type.name==="bulletList"||n.type.name==="orderedList"?"listItem":"taskList";i().updateAttributes(p,o).run()}const m=a.doc.resolve(t.from-1).nodeBefore;m&&m.type===n.type&&Vn(a.doc,t.from-1)&&(!n.joinPredicate||n.joinPredicate(r,m))&&a.join(t.from-1)}})}class _t{constructor(e={}){this.type="mark",this.name="mark",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...e},this.name=this.config.name,e.defaultOptions&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=se(W(this,"addOptions",{name:this.name}))),this.storage=se(W(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(e={}){return new _t(e)}configure(e={}){const t=this.extend();return t.options=dl(this.options,e),t.storage=se(W(t,"addStorage",{name:t.name,options:t.options})),t}extend(e={}){const t=new _t(e);return t.parent=this,this.child=t,t.name=e.name?e.name:t.parent.name,e.defaultOptions&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${t.name}".`),t.options=se(W(t,"addOptions",{name:t.name})),t.storage=se(W(t,"addStorage",{name:t.name,options:t.options})),t}static handleExit({editor:e,mark:t}){const{tr:r}=e.state,i=e.state.selection.$from;if(i.pos===i.end()){const a=i.marks();if(!!!a.find(h=>h?.type.name===t.name))return!1;const f=a.find(h=>h?.type.name===t.name);return f&&r.removeStoredMark(f),r.insertText(" ",i.pos),e.view.dispatch(r),!0}return!1}}class En{constructor(e={}){this.type="node",this.name="node",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...e},this.name=this.config.name,e.defaultOptions&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=se(W(this,"addOptions",{name:this.name}))),this.storage=se(W(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(e={}){return new En(e)}configure(e={}){const t=this.extend();return t.options=dl(this.options,e),t.storage=se(W(t,"addStorage",{name:t.name,options:t.options})),t}extend(e={}){const t=new En(e);return t.parent=this,this.child=t,t.name=e.name?e.name:t.parent.name,e.defaultOptions&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${t.name}".`),t.options=se(W(t,"addOptions",{name:t.name})),t.storage=se(W(t,"addStorage",{name:t.name,options:t.options})),t}}function WA(n){return new fC({find:n.find,handler:({state:e,range:t,match:r,pasteEvent:i})=>{const o=se(n.getAttributes,void 0,r,i);if(o===!1||o===null)return null;const{tr:a}=e,u=r[r.length-1],f=r[0];let h=t.to;if(u){const m=f.search(/\S/),p=t.from+f.indexOf(u),b=p+u.length;if(Rg(t.from,t.to,e.doc).filter(x=>x.mark.type.excluded.find(A=>A===n.type&&A!==x.mark.type)).filter(x=>x.to>p).length)return null;b<t.to&&a.delete(b,t.to),p>t.from&&a.delete(t.from+m,p),h=t.from+m+u.length,a.addMark(t.from+m,h,n.type.create(o||{})),a.removeStoredMark(n.type)}}})}const UA=En.create({name:"text",group:"inline"});var gl=200,Ve=function(){};Ve.prototype.append=function(e){return e.length?(e=Ve.from(e),!this.length&&e||e.length<gl&&this.leafAppend(e)||this.length<gl&&e.leafPrepend(this)||this.appendInner(e)):this},Ve.prototype.prepend=function(e){return e.length?Ve.from(e).append(this):this},Ve.prototype.appendInner=function(e){return new VA(this,e)},Ve.prototype.slice=function(e,t){return e===void 0&&(e=0),t===void 0&&(t=this.length),e>=t?Ve.empty:this.sliceInner(Math.max(0,e),Math.min(this.length,t))},Ve.prototype.get=function(e){if(!(e<0||e>=this.length))return this.getInner(e)},Ve.prototype.forEach=function(e,t,r){t===void 0&&(t=0),r===void 0&&(r=this.length),t<=r?this.forEachInner(e,t,r,0):this.forEachInvertedInner(e,t,r,0)},Ve.prototype.map=function(e,t,r){t===void 0&&(t=0),r===void 0&&(r=this.length);var i=[];return this.forEach(function(o,a){return i.push(e(o,a))},t,r),i},Ve.from=function(e){return e instanceof Ve?e:e&&e.length?new Dg(e):Ve.empty};var Dg=function(n){function e(r){n.call(this),this.values=r}n&&(e.__proto__=n),e.prototype=Object.create(n&&n.prototype),e.prototype.constructor=e;var t={length:{configurable:!0},depth:{configurable:!0}};return e.prototype.flatten=function(){return this.values},e.prototype.sliceInner=function(i,o){return i==0&&o==this.length?this:new e(this.values.slice(i,o))},e.prototype.getInner=function(i){return this.values[i]},e.prototype.forEachInner=function(i,o,a,u){for(var f=o;f<a;f++)if(i(this.values[f],u+f)===!1)return!1},e.prototype.forEachInvertedInner=function(i,o,a,u){for(var f=o-1;f>=a;f--)if(i(this.values[f],u+f)===!1)return!1},e.prototype.leafAppend=function(i){if(this.length+i.length<=gl)return new e(this.values.concat(i.flatten()))},e.prototype.leafPrepend=function(i){if(this.length+i.length<=gl)return new e(i.flatten().concat(this.values))},t.length.get=function(){return this.values.length},t.depth.get=function(){return 0},Object.defineProperties(e.prototype,t),e}(Ve);Ve.empty=new Dg([]);var VA=function(n){function e(t,r){n.call(this),this.left=t,this.right=r,this.length=t.length+r.length,this.depth=Math.max(t.depth,r.depth)+1}return n&&(e.__proto__=n),e.prototype=Object.create(n&&n.prototype),e.prototype.constructor=e,e.prototype.flatten=function(){return this.left.flatten().concat(this.right.flatten())},e.prototype.getInner=function(r){return r<this.left.length?this.left.get(r):this.right.get(r-this.left.length)},e.prototype.forEachInner=function(r,i,o,a){var u=this.left.length;if(i<u&&this.left.forEachInner(r,i,Math.min(o,u),a)===!1||o>u&&this.right.forEachInner(r,Math.max(i-u,0),Math.min(this.length,o)-u,a+u)===!1)return!1},e.prototype.forEachInvertedInner=function(r,i,o,a){var u=this.left.length;if(i>u&&this.right.forEachInvertedInner(r,i-u,Math.max(o,u)-u,a+u)===!1||o<u&&this.left.forEachInvertedInner(r,Math.min(i,u),o,a)===!1)return!1},e.prototype.sliceInner=function(r,i){if(r==0&&i==this.length)return this;var o=this.left.length;return i<=o?this.left.slice(r,i):r>=o?this.right.slice(r-o,i-o):this.left.slice(r,o).append(this.right.slice(0,i-o))},e.prototype.leafAppend=function(r){var i=this.right.leafAppend(r);if(i)return new e(this.left,i)},e.prototype.leafPrepend=function(r){var i=this.left.leafPrepend(r);if(i)return new e(i,this.right)},e.prototype.appendInner=function(r){return this.left.depth>=Math.max(this.right.depth,r.depth)+1?new e(this.left,new e(this.right,r)):new e(this,r)},e}(Ve),Fg=Ve;const KA=500;class jt{constructor(e,t){this.items=e,this.eventCount=t}popEvent(e,t){if(this.eventCount==0)return null;let r=this.items.length;for(;;r--)if(this.items.get(r-1).selection){--r;break}let i,o;t&&(i=this.remapping(r,this.items.length),o=i.maps.length);let a=e.tr,u,f,h=[],m=[];return this.items.forEach((p,b)=>{if(!p.step){i||(i=this.remapping(r,b+1),o=i.maps.length),o--,m.push(p);return}if(i){m.push(new an(p.map));let S=p.step.map(i.slice(o)),x;S&&a.maybeStep(S).doc&&(x=a.mapping.maps[a.mapping.maps.length-1],h.push(new an(x,void 0,void 0,h.length+m.length))),o--,x&&i.appendMap(x,o)}else a.maybeStep(p.step);if(p.selection)return u=i?p.selection.map(i.slice(o)):p.selection,f=new jt(this.items.slice(0,r).append(m.reverse().concat(h)),this.eventCount-1),!1},this.items.length,0),{remaining:f,transform:a,selection:u}}addTransform(e,t,r,i){let o=[],a=this.eventCount,u=this.items,f=!i&&u.length?u.get(u.length-1):null;for(let m=0;m<e.steps.length;m++){let p=e.steps[m].invert(e.docs[m]),b=new an(e.mapping.maps[m],p,t),S;(S=f&&f.merge(b))&&(b=S,m?o.pop():u=u.slice(0,u.length-1)),o.push(b),t&&(a++,t=void 0),i||(f=b)}let h=a-r.depth;return h>qA&&(u=GA(u,h),a-=h),new jt(u.append(o),a)}remapping(e,t){let r=new Ni;return this.items.forEach((i,o)=>{let a=i.mirrorOffset!=null&&o-i.mirrorOffset>=e?r.maps.length-i.mirrorOffset:void 0;r.appendMap(i.map,a)},e,t),r}addMaps(e){return this.eventCount==0?this:new jt(this.items.append(e.map(t=>new an(t))),this.eventCount)}rebased(e,t){if(!this.eventCount)return this;let r=[],i=Math.max(0,this.items.length-t),o=e.mapping,a=e.steps.length,u=this.eventCount;this.items.forEach(b=>{b.selection&&u--},i);let f=t;this.items.forEach(b=>{let S=o.getMirror(--f);if(S==null)return;a=Math.min(a,S);let x=o.maps[S];if(b.step){let C=e.steps[S].invert(e.docs[S]),A=b.selection&&b.selection.map(o.slice(f+1,S));A&&u++,r.push(new an(x,C,A))}else r.push(new an(x))},i);let h=[];for(let b=t;b<a;b++)h.push(new an(o.maps[b]));let m=this.items.slice(0,i).append(h).append(r),p=new jt(m,u);return p.emptyItemCount()>KA&&(p=p.compress(this.items.length-r.length)),p}emptyItemCount(){let e=0;return this.items.forEach(t=>{t.step||e++}),e}compress(e=this.items.length){let t=this.remapping(0,e),r=t.maps.length,i=[],o=0;return this.items.forEach((a,u)=>{if(u>=e)i.push(a),a.selection&&o++;else if(a.step){let f=a.step.map(t.slice(r)),h=f&&f.getMap();if(r--,h&&t.appendMap(h,r),f){let m=a.selection&&a.selection.map(t.slice(r));m&&o++;let p=new an(h.invert(),f,m),b,S=i.length-1;(b=i.length&&i[S].merge(p))?i[S]=b:i.push(p)}}else a.map&&r--},this.items.length,0),new jt(Fg.from(i.reverse()),o)}}jt.empty=new jt(Fg.empty,0);function GA(n,e){let t;return n.forEach((r,i)=>{if(r.selection&&e--==0)return t=i,!1}),n.slice(t)}class an{constructor(e,t,r,i){this.map=e,this.step=t,this.selection=r,this.mirrorOffset=i}merge(e){if(this.step&&e.step&&!e.selection){let t=e.step.merge(this.step);if(t)return new an(t.getMap().invert(),t,this.selection)}}}class jn{constructor(e,t,r,i){this.done=e,this.undone=t,this.prevRanges=r,this.prevTime=i}}const qA=20;function JA(n,e,t,r){let i=t.getMeta(Yn),o;if(i)return i.historyState;t.getMeta(YA)&&(n=new jn(n.done,n.undone,null,0));let a=t.getMeta("appendedTransaction");if(t.steps.length==0)return n;if(a&&a.getMeta(Yn))return a.getMeta(Yn).redo?new jn(n.done.addTransform(t,void 0,r,yl(e)),n.undone,Bg(t.mapping.maps[t.steps.length-1]),n.prevTime):new jn(n.done,n.undone.addTransform(t,void 0,r,yl(e)),null,n.prevTime);if(t.getMeta("addToHistory")!==!1&&!(a&&a.getMeta("addToHistory")===!1)){let u=n.prevTime==0||!a&&(n.prevTime<(t.time||0)-r.newGroupDelay||!jA(t,n.prevRanges)),f=a?Rc(n.prevRanges,t.mapping):Bg(t.mapping.maps[t.steps.length-1]);return new jn(n.done.addTransform(t,u?e.selection.getBookmark():void 0,r,yl(e)),jt.empty,f,t.time)}else return(o=t.getMeta("rebased"))?new jn(n.done.rebased(t,o),n.undone.rebased(t,o),Rc(n.prevRanges,t.mapping),n.prevTime):new jn(n.done.addMaps(t.mapping.maps),n.undone.addMaps(t.mapping.maps),Rc(n.prevRanges,t.mapping),n.prevTime)}function jA(n,e){if(!e)return!1;if(!n.docChanged)return!0;let t=!1;return n.mapping.maps[0].forEach((r,i)=>{for(let o=0;o<e.length;o+=2)r<=e[o+1]&&i>=e[o]&&(t=!0)}),t}function Bg(n){let e=[];return n.forEach((t,r,i,o)=>e.push(i,o)),e}function Rc(n,e){if(!n)return null;let t=[];for(let r=0;r<n.length;r+=2){let i=e.map(n[r],1),o=e.map(n[r+1],-1);i<=o&&t.push(i,o)}return t}function zg(n,e,t,r){let i=yl(e),o=Yn.get(e).spec.config,a=(r?n.undone:n.done).popEvent(e,i);if(!a)return;let u=a.selection.resolve(a.transform.doc),f=(r?n.done:n.undone).addTransform(a.transform,e.selection.getBookmark(),o,i),h=new jn(r?f:a.remaining,r?a.remaining:f,null,0);t(a.transform.setSelection(u).setMeta(Yn,{redo:r,historyState:h}).scrollIntoView())}let Lc=!1,Hg=null;function yl(n){let e=n.plugins;if(Hg!=e){Lc=!1,Hg=e;for(let t=0;t<e.length;t++)if(e[t].spec.historyPreserveItems){Lc=!0;break}}return Lc}const Yn=new Kt("history"),YA=new Kt("closeHistory");function XA(n={}){return n={depth:n.depth||100,newGroupDelay:n.newGroupDelay||500},new St({key:Yn,state:{init(){return new jn(jt.empty,jt.empty,null,0)},apply(e,t,r){return JA(t,r,e,n)}},config:n,props:{handleDOMEvents:{beforeinput(e,t){let r=t.inputType,i=r=="historyUndo"?$g:r=="historyRedo"?Wg:null;return i?(t.preventDefault(),i(e.state,e.dispatch)):!1}}}})}const $g=(n,e)=>{let t=Yn.getState(n);return!t||t.done.eventCount==0?!1:(e&&zg(t,n,e,!1),!0)},Wg=(n,e)=>{let t=Yn.getState(n);return!t||t.undone.eventCount==0?!1:(e&&zg(t,n,e,!0),!0)},ZA=Ne.create({name:"history",addOptions(){return{depth:100,newGroupDelay:500}},addCommands(){return{undo:()=>({state:n,dispatch:e})=>$g(n,e),redo:()=>({state:n,dispatch:e})=>Wg(n,e)}},addProseMirrorPlugins(){return[XA(this.options)]},addKeyboardShortcuts(){return{"Mod-z":()=>this.editor.commands.undo(),"Mod-Z":()=>this.editor.commands.undo(),"Mod-y":()=>this.editor.commands.redo(),"Mod-Y":()=>this.editor.commands.redo(),"Shift-Mod-z":()=>this.editor.commands.redo(),"Shift-Mod-Z":()=>this.editor.commands.redo(),"Mod-\u044F":()=>this.editor.commands.undo(),"Shift-Mod-\u044F":()=>this.editor.commands.redo()}}}),Pc=Object.freeze({COMMON:"common",DESKTOP:"desktop",TABLET:"tablet",MOBILE:"mobile",get values(){return[this.COMMON,this.MOBILE,this.TABLET,this.DESKTOP]}}),Dc=Object.freeze({UPPERCASE:"uppercase",LOWERCASE:"lowercase",CAPITALIZE:"capitalize"}),Xn=Object.freeze({LEFT:"left",CENTER:"center",RIGHT:"right",JUSTIFY:"justify",get values(){return[this.LEFT,this.CENTER,this.RIGHT,this.JUSTIFY]}}),ee=Object.freeze({DOCUMENT:"doc",PARAGRAPH:"paragraph",HEADING:"heading",LIST:"list",LIST_ITEM:"listItem",TEXT:"text",get blocks(){return[this.PARAGRAPH,this.LIST,this.HEADING]}}),Nt=Object.freeze({DISC:"disc",CIRCLE:"circle",SQUARE:"square",DECIMAL:"decimal",ROMAN:"roman",LATIN:"latin",get values(){return[this.DISC,this.CIRCLE,this.SQUARE,this.DECIMAL,this.ROMAN,this.LATIN]},get ordered(){return[this.DECIMAL,this.ROMAN,this.LATIN]}}),ce=Object.freeze({ALIGNMENT:"alignment",BACKGROUND_COLOR:"background_color",FONT_COLOR:"font_color",FONT_FAMILY:"font_family",FONT_SIZE:"font_size",FONT_STYLE:"font_style",FONT_WEIGHT:"font_weight",LINE_HEIGHT:"line_height",TEXT_DECORATION:"text_decoration",SUPERSCRIPT:"superscript",MARGIN:"margin",LINK:"link",STYLE_PRESET:"style_preset",get attributes(){return[this.ALIGNMENT,this.LINE_HEIGHT,this.MARGIN]},get presetAttributes(){return[this.LINE_HEIGHT]},get inlineMarks(){return[this.TEXT_DECORATION,this.LINK,this.SUPERSCRIPT,this.BACKGROUND_COLOR]},get marks(){return[this.BACKGROUND_COLOR,this.FONT_COLOR,this.FONT_FAMILY,this.FONT_SIZE,this.FONT_STYLE,this.FONT_WEIGHT,this.TEXT_DECORATION,this.SUPERSCRIPT]}}),qt=Object.freeze({SETTINGS:"settings",ALL:"_"}),Ug=Object.freeze({BLANK:"_blank",SELF:"_self"}),_s=Object.freeze({URL:"url",BLOCK:"block"});class Fc{static create(e,t){const r=new this(e,t||{});return new St({key:new Kt(this.name),props:r._buildProps()})}constructor(e,t){this.options=t,this.editor=e}_buildProps(){const t=Object.entries(this.addProps()).map(([r,i])=>[r,i.bind(this)]);return Object.fromEntries(t)}addProps(){return{}}}class QA extends Fc{addProps(){return{transformPastedHTML:this._transformPastedHTML,handlePaste:this._handlePaste}}_transformPastedHTML(e){if(e.includes("data-pm-slice")&&e.includes("zw-style"))return e;const t=Vl.build(e);return t.normalizeHTML(),this._removeDeprecatedStyles(t),t.normalizedHTML}_removeDeprecatedStyles(e){const t=e.dom.querySelectorAll('[style*="margin"]');for(const r of Array.from(t))r.style.removeProperty("margin"),r.style.removeProperty("margin-top"),r.style.removeProperty("margin-right"),r.style.removeProperty("margin-bottom"),r.style.removeProperty("margin-left")}_handlePaste(e,t,r){const i=this._insertPastedContent(e,r).scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste");return e.dispatch(i),!0}_insertPastedContent({state:e},t){return this._isFullBlockSelected(e)?e.tr.replaceSelectionWith(t.content,!1):e.tr.replaceSelection(t)}_isFullBlockSelected(e){const t=this._expandSelectionToBlocks(e),r=this._isMatchPosition(t.from,e.selection.from),i=this._isMatchPosition(t.to,e.selection.to);return r&&i}_expandSelectionToBlocks({selection:e,doc:t}){let r=e.from,i=e.to;return t.nodesBetween(r,i,(o,a,u)=>{u.type.name===ee.DOCUMENT&&(r=Math.min(r,a+1),i=Math.max(i,a+o.nodeSize-1))}),{from:r,to:i}}_isMatchPosition(e,t){return Math.abs(e-t)<5}}class eM extends Fc{addProps(){return{decorations:this._buildDecorations}}_buildDecorations({doc:e}){const t=[];if(!this.editor.isEditable)return null;if(!(e.childCount>1))return e.descendants((r,i)=>{if(!r.childCount){const o=fn.node(i,i+r.nodeSize,{class:"zw-wysiwyg__placeholder","data-placeholder":"Type your text here..."});t.push(o)}return!1}),He.create(e,t)}}const tM="aaa1rp3barth4b0ott3vie4c1le2ogado5udhabi7c0ademy5centure6ountant0s9o1tor4d0s1ult4e0g1ro2tna4f0l1rica5g0akhan5ency5i0g1rbus3force5tel5kdn3l0faromeo7ibaba4pay4lfinanz6state5y2sace3tom5m0azon4ericanexpress7family11x2fam3ica3sterdam8nalytics7droid5quan4z2o0l2partments8p0le4q0uarelle8r0ab1mco4chi3my2pa2t0e3s0da2ia2sociates9t0hleta5torney7u0ction5di0ble3o3spost5thor3o0s4vianca6w0s2x0a2z0ure5ba0by2idu3namex3narepublic11d1k2r0celona5laycard4s5efoot5gains6seball5ketball8uhaus5yern5b0c1t1va3cg1n2d1e0ats2uty4er2ntley5rlin4st0buy5t2f1g1h0arti5i0ble3d1ke2ng0o3o1z2j1lack0friday9ockbuster8g1omberg7ue3m0s1w2n0pparibas9o0ats3ehringer8fa2m1nd2o0k0ing5sch2tik2on4t1utique6x2r0adesco6idgestone9oadway5ker3ther5ussels7s1t1uild0ers6siness6y1zz3v1w1y1z0h3ca0b1fe2l0l1vinklein9m0era3p2non3petown5ital0one8r0avan4ds2e0er0s4s2sa1e1h1ino4t0ering5holic7ba1n1re2s2c1d1enter4o1rn3f0a1d2g1h0anel2nel4rity4se2t2eap3intai5ristmas6ome4urch5i0priani6rcle4sco3tadel4i0c2y0eats7k1l0aims4eaning6ick2nic1que6othing5ud3ub0med6m1n1o0ach3des3ffee4llege4ogne5m0cast4mbank4unity6pany2re3uter5sec4ndos3struction8ulting7tact3ractors9oking0channel11l1p2rsica5untry4pon0s4rses6pa2r0edit0card4union9icket5own3s1uise0s6u0isinella9v1w1x1y0mru3ou3z2dabur3d1nce3ta1e1ing3sun4y2clk3ds2e0al0er2s3gree4livery5l1oitte5ta3mocrat6ntal2ist5si0gn4v2hl2iamonds6et2gital5rect0ory7scount3ver5h2y2j1k1m1np2o0cs1tor4g1mains5t1wnload7rive4tv2ubai3nlop4pont4rban5vag2r2z2earth3t2c0o2deka3u0cation8e1g1mail3erck5nergy4gineer0ing9terprises10pson4quipment8r0icsson6ni3s0q1tate5t0isalat7u0rovision8s2vents5xchange6pert3osed4ress5traspace10fage2il1rwinds6th3mily4n0s2rm0ers5shion4t3edex3edback6rrari3ero6i0at2delity5o2lm2nal1nce1ial7re0stone6mdale6sh0ing5t0ness6j1k1lickr3ghts4r2orist4wers5y2m1o0o0d0network8tball6rd1ex2sale4um3undation8x2r0ee1senius7l1ogans4ntdoor4ier7tr2ujitsu5n0d2rniture7tbol5yi3ga0l0lery3o1up4me0s3p1rden4y2b0iz3d0n2e0a1nt0ing5orge5f1g0ee3h1i0ft0s3ves2ing5l0ass3e1obal2o4m0ail3bh2o1x2n1odaddy5ld0point6f2o0dyear5g0le4p1t1v2p1q1r0ainger5phics5tis4een3ipe3ocery4up4s1t1u0ardian6cci3ge2ide2tars5ru3w1y2hair2mburg5ngout5us3bo2dfc0bank7ealth0care8lp1sinki6re1mes5gtv3iphop4samitsu7tachi5v2k0t2m1n1ockey4ldings5iday5medepot5goods5s0ense7nda3rse3spital5t0ing5t0eles2s3mail5use3w2r1sbc3t1u0ghes5yatt3undai7ibm2cbc2e1u2d1e0ee3fm2kano4l1m0amat4db2mo0bilien9n0c1dustries8finiti5o2g1k1stitute6urance4e4t0ernational10uit4vestments10o1piranga7q1r0ish4s0maili5t0anbul7t0au2v3jaguar4va3cb2e0ep2tzt3welry6io2ll2m0p2nj2o0bs1urg4t1y2p0morgan6rs3uegos4niper7kaufen5ddi3e0rryhotels6logistics9properties14fh2g1h1i0a1ds2m1nder2le4tchen5wi3m1n1oeln3matsu5sher5p0mg2n2r0d1ed3uokgroup8w1y0oto4z2la0caixa5mborghini8er3ncaster5ia3d0rover6xess5salle5t0ino3robe5w0yer5b1c1ds2ease3clerc5frak4gal2o2xus4gbt3i0dl2fe0insurance9style7ghting6ke2lly3mited4o2ncoln4de2k2psy3ve1ing5k1lc1p2oan0s3cker3us3l1ndon4tte1o3ve3pl0financial11r1s1t0d0a3u0ndbeck6xe1ury5v1y2ma0cys3drid4if1son4keup4n0agement7go3p1rket0ing3s4riott5shalls7serati6ttel5ba2c0kinsey7d1e0d0ia3et2lbourne7me1orial6n0u2rckmsd7g1h1iami3crosoft7l1ni1t2t0subishi9k1l0b1s2m0a2n1o0bi0le4da2e1i1m1nash3ey2ster5rmon3tgage6scow4to0rcycles9v0ie4p1q1r1s0d2t0n1r2u0seum3ic3tual5v1w1x1y1z2na0b1goya4me2tura4vy3ba2c1e0c1t0bank4flix4work5ustar5w0s2xt0direct7us4f0l2g0o2hk2i0co2ke1on3nja3ssan1y5l1o0kia3rthwesternmutual14on4w0ruz3tv4p1r0a1w2tt2u1yc2z2obi1server7ffice5kinawa6layan0group9dnavy5lo3m0ega4ne1g1l0ine5oo2pen3racle3nge4g0anic5igins6saka4tsuka4t2vh3pa0ge2nasonic7ris2s1tners4s1y3ssagens7y2ccw3e0t2f0izer5g1h0armacy6d1ilips5one2to0graphy6s4ysio5ics1tet2ures6d1n0g1k2oneer5zza4k1l0ace2y0station9umbing5s3m1n0c2ohl2ker3litie5rn2st3r0america6xi3ess3ime3o0d0uctions8f1gressive8mo2perties3y5tection8u0dential9s1t1ub2w0c2y2qa1pon3uebec3st5racing4dio4e0ad1lestate6tor2y4cipes5d0stone5umbrella9hab3ise0n3t2liance6n0t0als5pair3ort3ublican8st0aurant8view0s5xroth6ich0ardli6oh3l1o1p2o0cher3ks3deo3gers4om3s0vp3u0gby3hr2n2w0e2yukyu6sa0arland6fe0ty4kura4le1on3msclub4ung5ndvik0coromant12ofi4p1rl2s1ve2xo3b0i1s2c0a1b1haeffler7midt4olarships8ol3ule3warz5ience5ot3d1e0arch3t2cure1ity6ek2lect4ner3rvices6ven3w1x0y3fr2g1h0angrila6rp2w2ell3ia1ksha5oes2p0ping5uji3w0time7i0lk2na1gles5te3j1k0i0n2y0pe4l0ing4m0art3ile4n0cf3o0ccer3ial4ftbank4ware6hu2lar2utions7ng1y2y2pa0ce3ort2t3r0l2s1t0ada2ples4r1tebank4farm7c0group6ockholm6rage3e3ream4udio2y3yle4u0cks3pplies3y2ort5rf1gery5zuki5v1watch4iss4x1y0dney4stems6z2tab1ipei4lk2obao4rget4tamotors6r2too4x0i3c0i2d0k2eam2ch0nology8l1masek5nnis4va3f1g1h0d1eater2re6iaa2ckets5enda4ffany5ps2res2ol4j0maxx4x2k0maxx5l1m0all4n1o0day3kyo3ols3p1ray3shiba5tal3urs3wn2yota3s3r0ade1ing4ining5vel0channel7ers0insurance16ust3v2t1ube2i1nes3shu4v0s2w1z2ua1bank3s2g1k1nicom3versity8o2ol2ps2s1y1z2va0cations7na1guard7c1e0gas3ntures6risign5m\xF6gensberater2ung14sicherung10t2g1i0ajes4deo3g1king4llas4n1p1rgin4sa1ion4va1o3laanderen9n1odka3lkswagen7vo3te1ing3o2yage5u0elos6wales2mart4ter4ng0gou5tch0es6eather0channel12bcam3er2site5d0ding5ibo2r3f1hoswho6ien2ki2lliamhill9n0dows4e1ners6me2olterskluwer11odside6rk0s2ld3w2s1tc1f3xbox3erox4finity6ihuan4n2xx2yz3yachts4hoo3maxun5ndex5e1odobashi7ga2kohama6u0tube6t1un3za0ppos4ra3ero3ip2m1one3uerich6w2",nM="\u03B5\u03BB1\u03C52\u0431\u04331\u0435\u043B3\u0434\u0435\u0442\u04384\u0435\u044E2\u043A\u0430\u0442\u043E\u043B\u0438\u043A6\u043E\u043C3\u043C\u043A\u04342\u043E\u043D1\u0441\u043A\u0432\u04306\u043E\u043D\u043B\u0430\u0439\u043D5\u0440\u04333\u0440\u0443\u04412\u04442\u0441\u0430\u0439\u04423\u0440\u04313\u0443\u043A\u04403\u049B\u0430\u04373\u0570\u0561\u05753\u05D9\u05E9\u05E8\u05D0\u05DC5\u05E7\u05D5\u05DD3\u0627\u0628\u0648\u0638\u0628\u064A5\u062A\u0635\u0627\u0644\u0627\u062A6\u0631\u0627\u0645\u0643\u06485\u0644\u0627\u0631\u062F\u06464\u0628\u062D\u0631\u064A\u06465\u062C\u0632\u0627\u0626\u06315\u0633\u0639\u0648\u062F\u064A\u06296\u0639\u0644\u064A\u0627\u06465\u0645\u063A\u0631\u06285\u0645\u0627\u0631\u0627\u062A5\u06CC\u0631\u0627\u06465\u0628\u0627\u0631\u062A2\u0632\u0627\u06314\u064A\u062A\u06433\u06BE\u0627\u0631\u062A5\u062A\u0648\u0646\u06334\u0633\u0648\u062F\u0627\u06463\u0631\u064A\u06295\u0634\u0628\u0643\u06294\u0639\u0631\u0627\u06422\u06282\u0645\u0627\u06464\u0641\u0644\u0633\u0637\u064A\u06466\u0642\u0637\u06313\u0643\u0627\u062B\u0648\u0644\u064A\u06436\u0648\u06453\u0645\u0635\u06312\u0644\u064A\u0633\u064A\u06275\u0648\u0631\u064A\u062A\u0627\u0646\u064A\u06277\u0642\u06394\u0647\u0645\u0631\u0627\u06475\u067E\u0627\u06A9\u0633\u062A\u0627\u06467\u0680\u0627\u0631\u062A4\u0915\u0949\u092E3\u0928\u0947\u091F3\u092D\u093E\u0930\u09240\u092E\u094D3\u094B\u09245\u0938\u0902\u0917\u0920\u09285\u09AC\u09BE\u0982\u09B2\u09BE5\u09AD\u09BE\u09B0\u09A42\u09F0\u09A44\u0A2D\u0A3E\u0A30\u0A244\u0AAD\u0ABE\u0AB0\u0AA44\u0B2D\u0B3E\u0B30\u0B244\u0B87\u0BA8\u0BCD\u0BA4\u0BBF\u0BAF\u0BBE6\u0BB2\u0B99\u0BCD\u0B95\u0BC86\u0B9A\u0BBF\u0B99\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0BC2\u0BB0\u0BCD11\u0C2D\u0C3E\u0C30\u0C24\u0C4D5\u0CAD\u0CBE\u0CB0\u0CA44\u0D2D\u0D3E\u0D30\u0D24\u0D025\u0DBD\u0D82\u0D9A\u0DCF4\u0E04\u0E2D\u0E213\u0E44\u0E17\u0E223\u0EA5\u0EB2\u0EA73\u10D2\u10D42\u307F\u3093\u306A3\u30A2\u30DE\u30BE\u30F34\u30AF\u30E9\u30A6\u30C94\u30B0\u30FC\u30B0\u30EB4\u30B3\u30E02\u30B9\u30C8\u30A23\u30BB\u30FC\u30EB3\u30D5\u30A1\u30C3\u30B7\u30E7\u30F36\u30DD\u30A4\u30F3\u30C84\u4E16\u754C2\u4E2D\u4FE11\u56FD1\u570B1\u6587\u7F513\u4E9A\u9A6C\u900A3\u4F01\u4E1A2\u4F5B\u5C712\u4FE1\u606F2\u5065\u5EB72\u516B\u53662\u516C\u53F81\u76CA2\u53F0\u6E7E1\u70632\u5546\u57CE1\u5E971\u68072\u5609\u91CC0\u5927\u9152\u5E975\u5728\u7EBF2\u5927\u62FF2\u5929\u4E3B\u65593\u5A31\u4E502\u5BB6\u96FB2\u5E7F\u4E1C2\u5FAE\u535A2\u6148\u55842\u6211\u7231\u4F603\u624B\u673A2\u62DB\u80582\u653F\u52A11\u5E9C2\u65B0\u52A0\u57612\u95FB2\u65F6\u5C1A2\u66F8\u7C4D2\u673A\u67842\u6DE1\u9A6C\u95213\u6E38\u620F2\u6FB3\u95802\u70B9\u770B2\u79FB\u52A82\u7EC4\u7EC7\u673A\u67844\u7F51\u57401\u5E971\u7AD91\u7EDC2\u8054\u901A2\u8C37\u6B4C2\u8D2D\u72692\u901A\u8CA92\u96C6\u56E22\u96FB\u8A0A\u76C8\u79D14\u98DE\u5229\u6D663\u98DF\u54C12\u9910\u53852\u9999\u683C\u91CC\u62C93\u6E2F2\uB2F7\uB1371\uCEF42\uC0BC\uC1312\uD55C\uAD6D2",xi=(n,e)=>{for(const t in e)n[t]=e[t];return n},Bc="numeric",zc="ascii",Hc="alpha",bl="asciinumeric",vl="alphanumeric",$c="domain",Vg="emoji",rM="scheme",iM="slashscheme",Kg="whitespace";function sM(n,e){return n in e||(e[n]=[]),e[n]}function Ir(n,e,t){e[Bc]&&(e[bl]=!0,e[vl]=!0),e[zc]&&(e[bl]=!0,e[Hc]=!0),e[bl]&&(e[vl]=!0),e[Hc]&&(e[vl]=!0),e[vl]&&(e[$c]=!0),e[Vg]&&(e[$c]=!0);for(const r in e){const i=sM(r,t);i.indexOf(n)<0&&i.push(n)}}function oM(n,e){const t={};for(const r in e)e[r].indexOf(n)>=0&&(t[r]=!0);return t}function ht(n){n===void 0&&(n=null),this.j={},this.jr=[],this.jd=null,this.t=n}ht.groups={},ht.prototype={accepts(){return!!this.t},go(n){const e=this,t=e.j[n];if(t)return t;for(let r=0;r<e.jr.length;r++){const i=e.jr[r][0],o=e.jr[r][1];if(o&&i.test(n))return o}return e.jd},has(n,e){return e===void 0&&(e=!1),e?n in this.j:!!this.go(n)},ta(n,e,t,r){for(let i=0;i<n.length;i++)this.tt(n[i],e,t,r)},tr(n,e,t,r){r=r||ht.groups;let i;return e&&e.j?i=e:(i=new ht(e),t&&r&&Ir(e,t,r)),this.jr.push([n,i]),i},ts(n,e,t,r){let i=this;const o=n.length;if(!o)return i;for(let a=0;a<o-1;a++)i=i.tt(n[a]);return i.tt(n[o-1],e,t,r)},tt(n,e,t,r){r=r||ht.groups;const i=this;if(e&&e.j)return i.j[n]=e,e;const o=e;let a,u=i.go(n);if(u?(a=new ht,xi(a.j,u.j),a.jr.push.apply(a.jr,u.jr),a.jd=u.jd,a.t=u.t):a=new ht,o){if(r)if(a.t&&typeof a.t=="string"){const f=xi(oM(a.t,r),t);Ir(o,f,r)}else t&&Ir(o,t,r);a.t=o}return i.j[n]=a,a}};const V=(n,e,t,r,i)=>n.ta(e,t,r,i),Rt=(n,e,t,r,i)=>n.tr(e,t,r,i),Gg=(n,e,t,r,i)=>n.ts(e,t,r,i),D=(n,e,t,r,i)=>n.tt(e,t,r,i),kn="WORD",Wc="UWORD",xs="LOCALHOST",Uc="TLD",Vc="UTLD",Sl="SCHEME",ki="SLASH_SCHEME",Kc="NUM",qg="WS",Gc="NL",Ei="OPENBRACE",ks="OPENBRACKET",Es="OPENANGLEBRACKET",Ts="OPENPAREN",Nr="CLOSEBRACE",Ti="CLOSEBRACKET",Ci="CLOSEANGLEBRACKET",Rr="CLOSEPAREN",wl="AMPERSAND",_l="APOSTROPHE",xl="ASTERISK",Zn="AT",kl="BACKSLASH",El="BACKTICK",Tl="CARET",Qn="COLON",qc="COMMA",Cl="DOLLAR",rn="DOT",Al="EQUALS",Jc="EXCLAMATION",sn="HYPHEN",Ml="PERCENT",Ol="PIPE",Il="PLUS",Nl="POUND",Rl="QUERY",jc="QUOTE",Yc="SEMI",on="SLASH",Cs="TILDE",Ll="UNDERSCORE",Jg="EMOJI",Pl="SYM";var jg=Object.freeze({__proto__:null,WORD:kn,UWORD:Wc,LOCALHOST:xs,TLD:Uc,UTLD:Vc,SCHEME:Sl,SLASH_SCHEME:ki,NUM:Kc,WS:qg,NL:Gc,OPENBRACE:Ei,OPENBRACKET:ks,OPENANGLEBRACKET:Es,OPENPAREN:Ts,CLOSEBRACE:Nr,CLOSEBRACKET:Ti,CLOSEANGLEBRACKET:Ci,CLOSEPAREN:Rr,AMPERSAND:wl,APOSTROPHE:_l,ASTERISK:xl,AT:Zn,BACKSLASH:kl,BACKTICK:El,CARET:Tl,COLON:Qn,COMMA:qc,DOLLAR:Cl,DOT:rn,EQUALS:Al,EXCLAMATION:Jc,HYPHEN:sn,PERCENT:Ml,PIPE:Ol,PLUS:Il,POUND:Nl,QUERY:Rl,QUOTE:jc,SEMI:Yc,SLASH:on,TILDE:Cs,UNDERSCORE:Ll,EMOJI:Jg,SYM:Pl});const Ai=/[a-z]/,Xc=/\p{L}/u,Zc=/\p{Emoji}/u,Qc=/\d/,Yg=/\s/,Xg=`
18
- `,lM="\uFE0F",aM="\u200D";let Dl=null,Fl=null;function uM(n){n===void 0&&(n=[]);const e={};ht.groups=e;const t=new ht;Dl==null&&(Dl=Zg(tM)),Fl==null&&(Fl=Zg(nM)),D(t,"'",_l),D(t,"{",Ei),D(t,"[",ks),D(t,"<",Es),D(t,"(",Ts),D(t,"}",Nr),D(t,"]",Ti),D(t,">",Ci),D(t,")",Rr),D(t,"&",wl),D(t,"*",xl),D(t,"@",Zn),D(t,"`",El),D(t,"^",Tl),D(t,":",Qn),D(t,",",qc),D(t,"$",Cl),D(t,".",rn),D(t,"=",Al),D(t,"!",Jc),D(t,"-",sn),D(t,"%",Ml),D(t,"|",Ol),D(t,"+",Il),D(t,"#",Nl),D(t,"?",Rl),D(t,'"',jc),D(t,"/",on),D(t,";",Yc),D(t,"~",Cs),D(t,"_",Ll),D(t,"\\",kl);const r=Rt(t,Qc,Kc,{[Bc]:!0});Rt(r,Qc,r);const i=Rt(t,Ai,kn,{[zc]:!0});Rt(i,Ai,i);const o=Rt(t,Xc,Wc,{[Hc]:!0});Rt(o,Ai),Rt(o,Xc,o);const a=Rt(t,Yg,qg,{[Kg]:!0});D(t,Xg,Gc,{[Kg]:!0}),D(a,Xg),Rt(a,Yg,a);const u=Rt(t,Zc,Jg,{[Vg]:!0});Rt(u,Zc,u),D(u,lM,u);const f=D(u,aM);Rt(f,Zc,u);const h=[[Ai,i]],m=[[Ai,null],[Xc,o]];for(let p=0;p<Dl.length;p++)er(t,Dl[p],Uc,kn,h);for(let p=0;p<Fl.length;p++)er(t,Fl[p],Vc,Wc,m);Ir(Uc,{tld:!0,ascii:!0},e),Ir(Vc,{utld:!0,alpha:!0},e),er(t,"file",Sl,kn,h),er(t,"mailto",Sl,kn,h),er(t,"http",ki,kn,h),er(t,"https",ki,kn,h),er(t,"ftp",ki,kn,h),er(t,"ftps",ki,kn,h),Ir(Sl,{scheme:!0,ascii:!0},e),Ir(ki,{slashscheme:!0,ascii:!0},e),n=n.sort((p,b)=>p[0]>b[0]?1:-1);for(let p=0;p<n.length;p++){const b=n[p][0],x=n[p][1]?{[rM]:!0}:{[iM]:!0};b.indexOf("-")>=0?x[$c]=!0:Ai.test(b)?Qc.test(b)?x[bl]=!0:x[zc]=!0:x[Bc]=!0,Gg(t,b,b,x)}return Gg(t,"localhost",xs,{ascii:!0}),t.jd=new ht(Pl),{start:t,tokens:xi({groups:e},jg)}}function cM(n,e){const t=fM(e.replace(/[A-Z]/g,u=>u.toLowerCase())),r=t.length,i=[];let o=0,a=0;for(;a<r;){let u=n,f=null,h=0,m=null,p=-1,b=-1;for(;a<r&&(f=u.go(t[a]));)u=f,u.accepts()?(p=0,b=0,m=u):p>=0&&(p+=t[a].length,b++),h+=t[a].length,o+=t[a].length,a++;o-=p,a-=b,h-=p,i.push({t:m.t,v:e.slice(o-h,o),s:o-h,e:o})}return i}function fM(n){const e=[],t=n.length;let r=0;for(;r<t;){let i=n.charCodeAt(r),o,a=i<55296||i>56319||r+1===t||(o=n.charCodeAt(r+1))<56320||o>57343?n[r]:n.slice(r,r+2);e.push(a),r+=a.length}return e}function er(n,e,t,r,i){let o;const a=e.length;for(let u=0;u<a-1;u++){const f=e[u];n.j[f]?o=n.j[f]:(o=new ht(r),o.jr=i.slice(),n.j[f]=o),n=o}return o=new ht(t),o.jr=i.slice(),n.j[e[a-1]]=o,o}function Zg(n){const e=[],t=[];let r=0,i="0123456789";for(;r<n.length;){let o=0;for(;i.indexOf(n[r+o])>=0;)o++;if(o>0){e.push(t.join(""));for(let a=parseInt(n.substring(r,r+o),10);a>0;a--)t.pop();r+=o}else t.push(n[r]),r++}return e}const As={defaultProtocol:"http",events:null,format:Qg,formatHref:Qg,nl2br:!1,tagName:"a",target:null,rel:null,validate:!0,truncate:1/0,className:null,attributes:null,ignoreTags:[],render:null};function ef(n,e){e===void 0&&(e=null);let t=xi({},As);n&&(t=xi(t,n instanceof ef?n.o:n));const r=t.ignoreTags,i=[];for(let o=0;o<r.length;o++)i.push(r[o].toUpperCase());this.o=t,e&&(this.defaultRender=e),this.ignoreTags=i}ef.prototype={o:As,ignoreTags:[],defaultRender(n){return n},check(n){return this.get("validate",n.toString(),n)},get(n,e,t){const r=e!=null;let i=this.o[n];return i&&(typeof i=="object"?(i=t.t in i?i[t.t]:As[n],typeof i=="function"&&r&&(i=i(e,t))):typeof i=="function"&&r&&(i=i(e,t.t,t)),i)},getObj(n,e,t){let r=this.o[n];return typeof r=="function"&&e!=null&&(r=r(e,t.t,t)),r},render(n){const e=n.render(this);return(this.get("render",null,n)||this.defaultRender)(e,n.t,n)}};function Qg(n){return n}function e0(n,e){this.t="token",this.v=n,this.tk=e}e0.prototype={isLink:!1,toString(){return this.v},toHref(n){return this.toString()},toFormattedString(n){const e=this.toString(),t=n.get("truncate",e,this),r=n.get("format",e,this);return t&&r.length>t?r.substring(0,t)+"\u2026":r},toFormattedHref(n){return n.get("formatHref",this.toHref(n.get("defaultProtocol")),this)},startIndex(){return this.tk[0].s},endIndex(){return this.tk[this.tk.length-1].e},toObject(n){return n===void 0&&(n=As.defaultProtocol),{type:this.t,value:this.toString(),isLink:this.isLink,href:this.toHref(n),start:this.startIndex(),end:this.endIndex()}},toFormattedObject(n){return{type:this.t,value:this.toFormattedString(n),isLink:this.isLink,href:this.toFormattedHref(n),start:this.startIndex(),end:this.endIndex()}},validate(n){return n.get("validate",this.toString(),this)},render(n){const e=this,t=this.toHref(n.get("defaultProtocol")),r=n.get("formatHref",t,this),i=n.get("tagName",t,e),o=this.toFormattedString(n),a={},u=n.get("className",t,e),f=n.get("target",t,e),h=n.get("rel",t,e),m=n.getObj("attributes",t,e),p=n.getObj("events",t,e);return a.href=r,u&&(a.class=u),f&&(a.target=f),h&&(a.rel=h),m&&xi(a,m),{tagName:i,attributes:a,content:o,eventListeners:p}}};function Bl(n,e){class t extends e0{constructor(i,o){super(i,o),this.t=n}}for(const r in e)t.prototype[r]=e[r];return t.t=n,t}const t0=Bl("email",{isLink:!0,toHref(){return"mailto:"+this.toString()}}),n0=Bl("text"),dM=Bl("nl"),Lr=Bl("url",{isLink:!0,toHref(n){return n===void 0&&(n=As.defaultProtocol),this.hasProtocol()?this.v:`${n}://${this.v}`},hasProtocol(){const n=this.tk;return n.length>=2&&n[0].t!==xs&&n[1].t===Qn}}),Be=n=>new ht(n);function hM(n){let{groups:e}=n;const t=e.domain.concat([wl,xl,Zn,kl,El,Tl,Cl,Al,sn,Kc,Ml,Ol,Il,Nl,on,Pl,Cs,Ll]),r=[_l,Ci,Nr,Ti,Rr,Qn,qc,rn,Jc,Es,Ei,ks,Ts,Rl,jc,Yc],i=[wl,_l,xl,kl,El,Tl,Nr,Cl,Al,sn,Ei,Ml,Ol,Il,Nl,Rl,on,Pl,Cs,Ll],o=Be(),a=D(o,Cs);V(a,i,a),V(a,e.domain,a);const u=Be(),f=Be(),h=Be();V(o,e.domain,u),V(o,e.scheme,f),V(o,e.slashscheme,h),V(u,i,a),V(u,e.domain,u);const m=D(u,Zn);D(a,Zn,m),D(f,Zn,m),D(h,Zn,m);const p=D(a,rn);V(p,i,a),V(p,e.domain,a);const b=Be();V(m,e.domain,b),V(b,e.domain,b);const S=D(b,rn);V(S,e.domain,b);const x=Be(t0);V(S,e.tld,x),V(S,e.utld,x),D(m,xs,x);const C=D(b,sn);V(C,e.domain,b),V(x,e.domain,b),D(x,rn,S),D(x,sn,C);const A=D(x,Qn);V(A,e.numeric,t0);const N=D(u,sn),G=D(u,rn);V(N,e.domain,u),V(G,i,a),V(G,e.domain,u);const K=Be(Lr);V(G,e.tld,K),V(G,e.utld,K),V(K,e.domain,u),V(K,i,a),D(K,rn,G),D(K,sn,N),D(K,Zn,m);const oe=D(K,Qn),pe=Be(Lr);V(oe,e.numeric,pe);const B=Be(Lr),ue=Be();V(B,t,B),V(B,r,ue),V(ue,t,B),V(ue,r,ue),D(K,on,B),D(pe,on,B);const lt=D(f,Qn),Pi=D(h,Qn),Kl=D(Pi,on),Di=D(Kl,on);V(f,e.domain,u),D(f,rn,G),D(f,sn,N),V(h,e.domain,u),D(h,rn,G),D(h,sn,N),V(lt,e.domain,B),D(lt,on,B),V(Di,e.domain,B),V(Di,t,B),D(Di,on,B);const sr=D(B,Ei),$r=D(B,ks),or=D(B,Es),Wr=D(B,Ts);D(ue,Ei,sr),D(ue,ks,$r),D(ue,Es,or),D(ue,Ts,Wr),D(sr,Nr,B),D($r,Ti,B),D(or,Ci,B),D(Wr,Rr,B),D(sr,Nr,B);const Tn=Be(Lr),Ze=Be(Lr),qe=Be(Lr),dn=Be(Lr);V(sr,t,Tn),V($r,t,Ze),V(or,t,qe),V(Wr,t,dn);const Yt=Be(),Qe=Be(),Ur=Be(),Vr=Be();return V(sr,r),V($r,r),V(or,r),V(Wr,r),V(Tn,t,Tn),V(Ze,t,Ze),V(qe,t,qe),V(dn,t,dn),V(Tn,r,Tn),V(Ze,r,Ze),V(qe,r,qe),V(dn,r,dn),V(Yt,t,Yt),V(Qe,t,Ze),V(Ur,t,qe),V(Vr,t,dn),V(Yt,r,Yt),V(Qe,r,Qe),V(Ur,r,Ur),V(Vr,r,Vr),D(Ze,Ti,B),D(qe,Ci,B),D(dn,Rr,B),D(Tn,Nr,B),D(Qe,Ti,B),D(Ur,Ci,B),D(Vr,Rr,B),D(Yt,Rr,B),D(o,xs,K),D(o,Gc,dM),{start:o,tokens:jg}}function pM(n,e,t){let r=t.length,i=0,o=[],a=[];for(;i<r;){let u=n,f=null,h=null,m=0,p=null,b=-1;for(;i<r&&!(f=u.go(t[i].t));)a.push(t[i++]);for(;i<r&&(h=f||u.go(t[i].t));)f=null,u=h,u.accepts()?(b=0,p=u):b>=0&&b++,i++,m++;if(b<0)i-=m,i<r&&(a.push(t[i]),i++);else{a.length>0&&(o.push(tf(n0,e,a)),a=[]),i-=b,m-=b;const S=p.t,x=t.slice(i-m,i);o.push(tf(S,e,x))}}return a.length>0&&o.push(tf(n0,e,a)),o}function tf(n,e,t){const r=t[0].s,i=t[t.length-1].e,o=e.slice(r,i);return new n(o,t)}const mM=typeof console<"u"&&console&&console.warn||(()=>{}),gM="until manual call of linkify.init(). Register all schemes and plugins before invoking linkify the first time.",Ee={scanner:null,parser:null,tokenQueue:[],pluginQueue:[],customSchemes:[],initialized:!1};function yM(){ht.groups={},Ee.scanner=null,Ee.parser=null,Ee.tokenQueue=[],Ee.pluginQueue=[],Ee.customSchemes=[],Ee.initialized=!1}function r0(n,e){if(e===void 0&&(e=!1),Ee.initialized&&mM(`linkifyjs: already initialized - will not register custom scheme "${n}" ${gM}`),!/^[0-9a-z]+(-[0-9a-z]+)*$/.test(n))throw new Error(`linkifyjs: incorrect scheme format.
15
+ `,textSerializers:a={}}=t||{};let c="",f=!0;return n.nodesBetween(r,i,(h,m,p,y)=>{var S;const _=a?.[h.type.name];_?(h.isBlock&&!f&&(c+=o,f=!0),p&&(c+=_({node:h,pos:m,parent:p,index:y,range:e}))):h.isText?(c+=(S=h?.text)===null||S===void 0?void 0:S.slice(Math.max(r,m)-m,i-m),f=!1):h.isBlock&&!f&&(c+=o,f=!0)}),c}function xC(n){return Object.fromEntries(Object.entries(n.nodes).filter(([,e])=>e.spec.toText).map(([e,t])=>[e,t.spec.toText]))}Re.create({name:"clipboardTextSerializer",addProseMirrorPlugins(){return[new _t({key:new Yt("clipboardTextSerializer"),props:{clipboardTextSerializer:()=>{const{editor:n}=this,{state:e,schema:t}=n,{doc:r,selection:i}=e,{ranges:o}=i,a=Math.min(...o.map(m=>m.$from.pos)),c=Math.max(...o.map(m=>m.$to.pos)),f=xC(t);return SC(r,{from:a,to:c},{textSerializers:f})}}})]}});const wC=()=>({editor:n,view:e})=>(requestAnimationFrame(()=>{var t;n.isDestroyed||(e.dom.blur(),(t=window?.getSelection())===null||t===void 0||t.removeAllRanges())}),!0),_C=(n=!1)=>({commands:e})=>e.setContent("",n),kC=()=>({state:n,tr:e,dispatch:t})=>{const{selection:r}=e,{ranges:i}=r;return t&&i.forEach(({$from:o,$to:a})=>{n.doc.nodesBetween(o.pos,a.pos,(c,f)=>{if(c.type.isText)return;const{doc:h,mapping:m}=e,p=h.resolve(m.map(f)),y=h.resolve(m.map(f+c.nodeSize)),S=p.blockRange(y);if(!S)return;const _=mi(S);if(c.type.isTextblock){const{defaultType:C}=p.parent.contentMatchAt(p.index());e.setNodeMarkup(S.start,C)}(_||_===0)&&e.lift(S,_)})}),!0},EC=n=>e=>n(e),TC=()=>({state:n,dispatch:e})=>JT(n,e),CC=(n,e)=>({editor:t,tr:r})=>{const{state:i}=t,o=i.doc.slice(n.from,n.to);r.deleteRange(n.from,n.to);const a=r.mapping.map(e);return r.insert(a,o.content),r.setSelection(new pe(r.doc.resolve(a-1))),!0},AC=()=>({tr:n,dispatch:e})=>{const{selection:t}=n,r=t.$anchor.node();if(r.content.size>0)return!1;const i=n.selection.$anchor;for(let o=i.depth;o>0;o-=1)if(i.node(o).type===r.type){if(e){const c=i.before(o),f=i.after(o);n.delete(c,f).scrollIntoView()}return!0}return!1},MC=n=>({tr:e,state:t,dispatch:r})=>{const i=ze(n,t.schema),o=e.selection.$anchor;for(let a=o.depth;a>0;a-=1)if(o.node(a).type===i){if(r){const f=o.before(a),h=o.after(a);e.delete(f,h).scrollIntoView()}return!0}return!1},OC=n=>({tr:e,dispatch:t})=>{const{from:r,to:i}=n;return t&&e.delete(r,i),!0},IC=()=>({state:n,dispatch:e})=>DT(n,e),NC=()=>({commands:n})=>n.keyboardShortcut("Enter"),RC=()=>({state:n,dispatch:e})=>qT(n,e);function vl(n,e,t={strict:!0}){const r=Object.keys(e);return r.length?r.every(i=>t.strict?e[i]===n[i]:Mu(e[i])?e[i].test(n[i]):e[i]===n[i]):!0}function Nu(n,e,t={}){return n.find(r=>r.type===e&&vl(r.attrs,t))}function LC(n,e,t={}){return!!Nu(n,e,t)}function Ru(n,e,t={}){if(!n||!e)return;let r=n.parent.childAfter(n.parentOffset);if(n.parentOffset===r.offset&&r.offset!==0&&(r=n.parent.childBefore(n.parentOffset)),!r.node)return;const i=Nu([...r.node.marks],e,t);if(!i)return;let o=r.index,a=n.start()+r.offset,c=o+1,f=a+r.node.nodeSize;for(Nu([...r.node.marks],e,t);o>0&&i.isInSet(n.parent.child(o-1).marks);)o-=1,a-=n.parent.child(o).nodeSize;for(;c<n.parent.childCount&&LC([...n.parent.child(c).marks],e,t);)f+=n.parent.child(c).nodeSize,c+=1;return{from:a,to:f}}function ln(n,e){if(typeof n=="string"){if(!e.marks[n])throw Error(`There is no mark type named '${n}'. Maybe you forgot to add the extension?`);return e.marks[n]}return n}const PC=(n,e={})=>({tr:t,state:r,dispatch:i})=>{const o=ln(n,r.schema),{doc:a,selection:c}=t,{$from:f,from:h,to:m}=c;if(i){const p=Ru(f,o,e);if(p&&p.from<=h&&p.to>=m){const y=pe.create(a,p.from,p.to);t.setSelection(y)}}return!0},DC=n=>e=>{const t=typeof n=="function"?n(e):n;for(let r=0;r<t.length;r+=1)if(t[r](e))return!0;return!1};function Ag(n){return n instanceof pe}function Or(n=0,e=0,t=0){return Math.min(Math.max(n,e),t)}function FC(n,e=null){if(!e)return null;const t=he.atStart(n),r=he.atEnd(n);if(e==="start"||e===!0)return t;if(e==="end")return r;const i=t.from,o=r.to;return e==="all"?pe.create(n,Or(0,i,o),Or(n.content.size,i,o)):pe.create(n,Or(e,i,o),Or(e,i,o))}function Lu(){return["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document}const BC=(n=null,e={})=>({editor:t,view:r,tr:i,dispatch:o})=>{e={scrollIntoView:!0,...e};const a=()=>{Lu()&&r.dom.focus(),requestAnimationFrame(()=>{t.isDestroyed||(r.focus(),e?.scrollIntoView&&t.commands.scrollIntoView())})};if(r.hasFocus()&&n===null||n===!1)return!0;if(o&&n===null&&!Ag(t.state.selection))return a(),!0;const c=FC(i.doc,n)||t.state.selection,f=t.state.selection.eq(c);return o&&(f||i.setSelection(c),f&&i.storedMarks&&i.setStoredMarks(i.storedMarks),a()),!0},zC=(n,e)=>t=>n.every((r,i)=>e(r,{...t,index:i})),HC=(n,e)=>({tr:t,commands:r})=>r.insertContentAt({from:t.selection.from,to:t.selection.to},n,e);function Mg(n){const e=`<body>${n}</body>`;return new window.DOMParser().parseFromString(e,"text/html").body}function Sl(n,e,t){if(t={slice:!0,parseOptions:{},...t},typeof n=="object"&&n!==null)try{return Array.isArray(n)&&n.length>0?L.fromArray(n.map(r=>e.nodeFromJSON(r))):e.nodeFromJSON(n)}catch(r){return console.warn("[tiptap warn]: Invalid content.","Passed value:",n,"Error:",r),Sl("",e,t)}if(typeof n=="string"){const r=Yc.fromSchema(e);return t.slice?r.parseSlice(Mg(n),t.parseOptions).content:r.parse(Mg(n),t.parseOptions)}return Sl("",e,t)}function $C(n,e,t){const r=n.steps.length-1;if(r<e)return;const i=n.steps[r];if(!(i instanceof et||i instanceof $e))return;const o=n.mapping.maps[r];let a=0;o.forEach((c,f,h,m)=>{a===0&&(a=m)}),n.setSelection(he.near(n.doc.resolve(a),t))}const WC=n=>n.toString().startsWith("<"),UC=(n,e,t)=>({tr:r,dispatch:i,editor:o})=>{if(i){t={parseOptions:{},updateSelection:!0,...t};const a=Sl(e,o.schema,{parseOptions:{preserveWhitespace:"full",...t.parseOptions}});if(a.toString()==="<>")return!0;let{from:c,to:f}=typeof n=="number"?{from:n,to:n}:{from:n.from,to:n.to},h=!0,m=!0;if((WC(a)?a:[a]).forEach(y=>{y.check(),h=h?y.isText&&y.marks.length===0:!1,m=m?y.isBlock:!1}),c===f&&m){const{parent:y}=r.doc.resolve(c);y.isTextblock&&!y.type.spec.code&&!y.childCount&&(c-=1,f+=1)}h?Array.isArray(e)?r.insertText(e.map(y=>y.text||"").join(""),c,f):typeof e=="object"&&e&&e.text?r.insertText(e.text,c,f):r.insertText(e,c,f):r.replaceWith(c,f,a),t.updateSelection&&$C(r,r.steps.length-1,-1)}return!0},VC=()=>({state:n,dispatch:e})=>UT(n,e),KC=()=>({state:n,dispatch:e})=>VT(n,e),GC=()=>({state:n,dispatch:e})=>BT(n,e),qC=()=>({state:n,dispatch:e})=>$T(n,e),JC=()=>({tr:n,state:e,dispatch:t})=>{try{const r=ll(e.doc,e.selection.$from.pos,-1);return r==null?!1:(n.join(r,2),t&&t(n),!0)}catch{return!1}},jC=()=>({state:n,dispatch:e,tr:t})=>{try{const r=ll(n.doc,n.selection.$from.pos,1);return r==null?!1:(t.join(r,2),e&&e(t),!0)}catch{return!1}};function Og(){return typeof navigator<"u"?/Mac/.test(navigator.platform):!1}function YC(n){const e=n.split(/-(?!$)/);let t=e[e.length-1];t==="Space"&&(t=" ");let r,i,o,a;for(let c=0;c<e.length-1;c+=1){const f=e[c];if(/^(cmd|meta|m)$/i.test(f))a=!0;else if(/^a(lt)?$/i.test(f))r=!0;else if(/^(c|ctrl|control)$/i.test(f))i=!0;else if(/^s(hift)?$/i.test(f))o=!0;else if(/^mod$/i.test(f))Lu()||Og()?a=!0:i=!0;else throw new Error(`Unrecognized modifier name: ${f}`)}return r&&(t=`Alt-${t}`),i&&(t=`Ctrl-${t}`),a&&(t=`Meta-${t}`),o&&(t=`Shift-${t}`),t}const XC=n=>({editor:e,view:t,tr:r,dispatch:i})=>{const o=YC(n).split(/-(?!$)/),a=o.find(h=>!["Alt","Ctrl","Meta","Shift"].includes(h)),c=new KeyboardEvent("keydown",{key:a==="Space"?" ":a,altKey:o.includes("Alt"),ctrlKey:o.includes("Ctrl"),metaKey:o.includes("Meta"),shiftKey:o.includes("Shift"),bubbles:!0,cancelable:!0}),f=e.captureTransaction(()=>{t.someProp("handleKeyDown",h=>h(t,c))});return f?.steps.forEach(h=>{const m=h.map(r.mapping);m&&i&&r.maybeStep(m)}),!0};function Pu(n,e,t={}){const{from:r,to:i,empty:o}=n.selection,a=e?ze(e,n.schema):null,c=[];n.doc.nodesBetween(r,i,(p,y)=>{if(p.isText)return;const S=Math.max(r,y),_=Math.min(i,y+p.nodeSize);c.push({node:p,from:S,to:_})});const f=i-r,h=c.filter(p=>a?a.name===p.node.type.name:!0).filter(p=>vl(p.node.attrs,t,{strict:!1}));return o?!!h.length:h.reduce((p,y)=>p+y.to-y.from,0)>=f}const ZC=(n,e={})=>({state:t,dispatch:r})=>{const i=ze(n,t.schema);return Pu(t,i,e)?KT(t,r):!1},QC=()=>({state:n,dispatch:e})=>jT(n,e),eA=n=>({state:e,dispatch:t})=>{const r=ze(n,e.schema);return rC(r)(e,t)},tA=()=>({state:n,dispatch:e})=>GT(n,e);function Du(n,e){return e.nodes[n]?"node":e.marks[n]?"mark":null}function Ig(n,e){const t=typeof e=="string"?[e]:e;return Object.keys(n).reduce((r,i)=>(t.includes(i)||(r[i]=n[i]),r),{})}const nA=(n,e)=>({tr:t,state:r,dispatch:i})=>{let o=null,a=null;const c=Du(typeof n=="string"?n:n.name,r.schema);return c?(c==="node"&&(o=ze(n,r.schema)),c==="mark"&&(a=ln(n,r.schema)),i&&t.selection.ranges.forEach(f=>{r.doc.nodesBetween(f.$from.pos,f.$to.pos,(h,m)=>{o&&o===h.type&&t.setNodeMarkup(m,void 0,Ig(h.attrs,e)),a&&h.marks.length&&h.marks.forEach(p=>{a===p.type&&t.addMark(m,m+h.nodeSize,a.create(Ig(p.attrs,e)))})})}),!0):!1},rA=()=>({tr:n,dispatch:e})=>(e&&n.scrollIntoView(),!0),iA=()=>({tr:n,commands:e})=>e.setTextSelection({from:0,to:n.doc.content.size}),sA=()=>({state:n,dispatch:e})=>zT(n,e),oA=()=>({state:n,dispatch:e})=>WT(n,e),lA=()=>({state:n,dispatch:e})=>YT(n,e),aA=()=>({state:n,dispatch:e})=>QT(n,e),cA=()=>({state:n,dispatch:e})=>ZT(n,e);function uA(n,e,t={}){return Sl(n,e,{slice:!1,parseOptions:t})}const fA=(n,e=!1,t={})=>({tr:r,editor:i,dispatch:o})=>{const{doc:a}=r,c=uA(n,i.schema,t);return o&&r.replaceWith(0,a.content.size,c).setMeta("preventUpdate",!e),!0};function Ng(n,e){const t=ln(e,n.schema),{from:r,to:i,empty:o}=n.selection,a=[];o?(n.storedMarks&&a.push(...n.storedMarks),a.push(...n.selection.$head.marks())):n.doc.nodesBetween(r,i,f=>{a.push(...f.marks)});const c=a.find(f=>f.type.name===t.name);return c?{...c.attrs}:{}}function dA(n,e){const t=new UE(n);return e.forEach(r=>{r.steps.forEach(i=>{t.step(i)})}),t}function hA(n){for(let e=0;e<n.edgeCount;e+=1){const{type:t}=n.edge(e);if(t.isTextblock&&!t.hasRequiredAttrs())return t}return null}function pA(n,e,t){const r=[];return n.nodesBetween(e.from,e.to,(i,o)=>{t(i)&&r.push({node:i,pos:o})}),r}function mA(n,e){for(let t=n.depth;t>0;t-=1){const r=n.node(t);if(e(r))return{pos:t>0?n.before(t):0,start:n.start(t),depth:t,node:r}}}function Fu(n){return e=>mA(e.$from,n)}function gA(n,e){const t=Ri.resolve(n);return Eg(t,e)}function yA(n,e){const t=ze(e,n.schema),{from:r,to:i}=n.selection,o=[];n.doc.nodesBetween(r,i,c=>{o.push(c)});const a=o.reverse().find(c=>c.type.name===t.name);return a?{...a.attrs}:{}}function bA(n,e){const t=Du(typeof e=="string"?e:e.name,n.schema);return t==="node"?yA(n,e):t==="mark"?Ng(n,e):{}}function vA(n,e=JSON.stringify){const t={};return n.filter(r=>{const i=e(r);return Object.prototype.hasOwnProperty.call(t,i)?!1:t[i]=!0})}function SA(n){const e=vA(n);return e.length===1?e:e.filter((t,r)=>!e.filter((o,a)=>a!==r).some(o=>t.oldRange.from>=o.oldRange.from&&t.oldRange.to<=o.oldRange.to&&t.newRange.from>=o.newRange.from&&t.newRange.to<=o.newRange.to))}function xA(n){const{mapping:e,steps:t}=n,r=[];return e.maps.forEach((i,o)=>{const a=[];if(i.ranges.length)i.forEach((c,f)=>{a.push({from:c,to:f})});else{const{from:c,to:f}=t[o];if(c===void 0||f===void 0)return;a.push({from:c,to:f})}a.forEach(({from:c,to:f})=>{const h=e.slice(o).map(c,-1),m=e.slice(o).map(f),p=e.invert().map(h,-1),y=e.invert().map(m);r.push({oldRange:{from:p,to:y},newRange:{from:h,to:m}})})}),SA(r)}function Rg(n,e,t){const r=[];return n===e?t.resolve(n).marks().forEach(i=>{const o=t.resolve(n-1),a=Ru(o,i.type);a&&r.push({mark:i,...a})}):t.nodesBetween(n,e,(i,o)=>{r.push(...i.marks.map(a=>({from:o,to:o+i.nodeSize,mark:a})))}),r}function xl(n,e,t){return Object.fromEntries(Object.entries(t).filter(([r])=>{const i=n.find(o=>o.type===e&&o.name===r);return i?i.attribute.keepOnSplit:!1}))}function wA(n,e,t={}){const{empty:r,ranges:i}=n.selection,o=e?ln(e,n.schema):null;if(r)return!!(n.storedMarks||n.selection.$from.marks()).filter(p=>o?o.name===p.type.name:!0).find(p=>vl(p.attrs,t,{strict:!1}));let a=0;const c=[];if(i.forEach(({$from:p,$to:y})=>{const S=p.pos,_=y.pos;n.doc.nodesBetween(S,_,(C,A)=>{if(!C.isText&&!C.marks.length)return;const R=Math.max(S,A),K=Math.min(_,A+C.nodeSize),V=K-R;a+=V,c.push(...C.marks.map(G=>({mark:G,from:R,to:K})))})}),a===0)return!1;const f=c.filter(p=>o?o.name===p.mark.type.name:!0).filter(p=>vl(p.mark.attrs,t,{strict:!1})).reduce((p,y)=>p+y.to-y.from,0),h=c.filter(p=>o?p.mark.type!==o&&p.mark.type.excludes(o):!0).reduce((p,y)=>p+y.to-y.from,0);return(f>0?f+h:f)>=a}function Lg(n,e){const{nodeExtensions:t}=yl(e),r=t.find(a=>a.name===n);if(!r)return!1;const i={name:r.name,options:r.options,storage:r.storage},o=oe($(r,"group",i));return typeof o!="string"?!1:o.split(" ").includes("list")}function _A(n,e,t){var r;const{selection:i}=e;let o=null;if(Ag(i)&&(o=i.$cursor),o){const c=(r=n.storedMarks)!==null&&r!==void 0?r:o.marks();return!!t.isInSet(c)||!c.some(f=>f.type.excludes(t))}const{ranges:a}=i;return a.some(({$from:c,$to:f})=>{let h=c.depth===0?n.doc.inlineContent&&n.doc.type.allowsMarkType(t):!1;return n.doc.nodesBetween(c.pos,f.pos,(m,p,y)=>{if(h)return!1;if(m.isInline){const S=!y||y.type.allowsMarkType(t),_=!!t.isInSet(m.marks)||!m.marks.some(C=>C.type.excludes(t));h=S&&_}return!h}),h})}const kA=(n,e={})=>({tr:t,state:r,dispatch:i})=>{const{selection:o}=t,{empty:a,ranges:c}=o,f=ln(n,r.schema);if(i)if(a){const h=Ng(r,f);t.addStoredMark(f.create({...h,...e}))}else c.forEach(h=>{const m=h.$from.pos,p=h.$to.pos;r.doc.nodesBetween(m,p,(y,S)=>{const _=Math.max(S,m),C=Math.min(S+y.nodeSize,p);y.marks.find(R=>R.type===f)?y.marks.forEach(R=>{f===R.type&&t.addMark(_,C,f.create({...R.attrs,...e}))}):t.addMark(_,C,f.create(e))})});return _A(r,t,f)},EA=(n,e)=>({tr:t})=>(t.setMeta(n,e),!0),TA=(n,e={})=>({state:t,dispatch:r,chain:i})=>{const o=ze(n,t.schema);return o.isTextblock?i().command(({commands:a})=>xg(o,e)(t)?!0:a.clearNodes()).command(({state:a})=>xg(o,e)(a,r)).run():(console.warn('[tiptap warn]: Currently "setNode()" only supports text block nodes.'),!1)},CA=n=>({tr:e,dispatch:t})=>{if(t){const{doc:r}=e,i=Or(n,0,r.content.size),o=X.create(r,i);e.setSelection(o)}return!0},AA=n=>({tr:e,dispatch:t})=>{if(t){const{doc:r}=e,{from:i,to:o}=typeof n=="number"?{from:n,to:n}:n,a=pe.atStart(r).from,c=pe.atEnd(r).to,f=Or(i,a,c),h=Or(o,a,c),m=pe.create(r,f,h);e.setSelection(m)}return!0},MA=n=>({state:e,dispatch:t})=>{const r=ze(n,e.schema);return oC(r)(e,t)};function Pg(n,e){const t=n.storedMarks||n.selection.$to.parentOffset&&n.selection.$from.marks();if(t){const r=t.filter(i=>e?.includes(i.type.name));n.tr.ensureMarks(r)}}const OA=({keepMarks:n=!0}={})=>({tr:e,state:t,dispatch:r,editor:i})=>{const{selection:o,doc:a}=e,{$from:c,$to:f}=o,h=i.extensionManager.attributes,m=xl(h,c.node().type.name,c.node().attrs);if(o instanceof X&&o.node.isBlock)return!c.parentOffset||!gi(a,c.pos)?!1:(r&&(n&&Pg(t,i.extensionManager.splittableMarks),e.split(c.pos).scrollIntoView()),!0);if(!c.parent.isBlock)return!1;if(r){const p=f.parentOffset===f.parent.content.size;o instanceof pe&&e.deleteSelection();const y=c.depth===0?void 0:hA(c.node(-1).contentMatchAt(c.indexAfter(-1)));let S=p&&y?[{type:y,attrs:m}]:void 0,_=gi(e.doc,e.mapping.map(c.pos),1,S);if(!S&&!_&&gi(e.doc,e.mapping.map(c.pos),1,y?[{type:y}]:void 0)&&(_=!0,S=y?[{type:y,attrs:m}]:void 0),_&&(e.split(e.mapping.map(c.pos),1,S),y&&!p&&!c.parentOffset&&c.parent.type!==y)){const C=e.mapping.map(c.before()),A=e.doc.resolve(C);c.node(-1).canReplaceWith(A.index(),A.index()+1,y)&&e.setNodeMarkup(e.mapping.map(c.before()),y)}n&&Pg(t,i.extensionManager.splittableMarks),e.scrollIntoView()}return!0},IA=n=>({tr:e,state:t,dispatch:r,editor:i})=>{var o;const a=ze(n,t.schema),{$from:c,$to:f}=t.selection,h=t.selection.node;if(h&&h.isBlock||c.depth<2||!c.sameParent(f))return!1;const m=c.node(-1);if(m.type!==a)return!1;const p=i.extensionManager.attributes;if(c.parent.content.size===0&&c.node(-1).childCount===c.indexAfter(-1)){if(c.depth===2||c.node(-3).type!==a||c.index(-2)!==c.node(-2).childCount-1)return!1;if(r){let A=L.empty;const R=c.index(-1)?1:c.index(-2)?2:3;for(let ue=c.depth-R;ue>=c.depth-3;ue-=1)A=L.from(c.node(ue).copy(A));const K=c.indexAfter(-1)<c.node(-2).childCount?1:c.indexAfter(-2)<c.node(-3).childCount?2:3,V=xl(p,c.node().type.name,c.node().attrs),G=((o=a.contentMatch.defaultType)===null||o===void 0?void 0:o.createAndFill(V))||void 0;A=A.append(L.from(a.createAndFill(null,G)||void 0));const ie=c.before(c.depth-(R-1));e.replace(ie,c.after(-K),new H(A,4-R,0));let q=-1;e.doc.nodesBetween(ie,e.doc.content.size,(ue,Tt)=>{if(q>-1)return!1;ue.isTextblock&&ue.content.size===0&&(q=Tt+1)}),q>-1&&e.setSelection(pe.near(e.doc.resolve(q))),e.scrollIntoView()}return!0}const y=f.pos===c.end()?m.contentMatchAt(0).defaultType:null,S=xl(p,m.type.name,m.attrs),_=xl(p,c.node().type.name,c.node().attrs);e.delete(c.pos,f.pos);const C=y?[{type:a,attrs:S},{type:y,attrs:_}]:[{type:a,attrs:S}];if(!gi(e.doc,c.pos,2))return!1;if(r){const{selection:A,storedMarks:R}=t,{splittableMarks:K}=i.extensionManager,V=R||A.$to.parentOffset&&A.$from.marks();if(e.split(c.pos,2,C).scrollIntoView(),!V||!r)return!0;const G=V.filter(ie=>K.includes(ie.type.name));e.ensureMarks(G)}return!0},Bu=(n,e)=>{const t=Fu(a=>a.type===e)(n.selection);if(!t)return!0;const r=n.doc.resolve(Math.max(0,t.pos-1)).before(t.depth);if(r===void 0)return!0;const i=n.doc.nodeAt(r);return t.node.type===i?.type&&qn(n.doc,t.pos)&&n.join(t.pos),!0},zu=(n,e)=>{const t=Fu(a=>a.type===e)(n.selection);if(!t)return!0;const r=n.doc.resolve(t.start).after(t.depth);if(r===void 0)return!0;const i=n.doc.nodeAt(r);return t.node.type===i?.type&&qn(n.doc,r)&&n.join(r),!0},NA=(n,e,t,r={})=>({editor:i,tr:o,state:a,dispatch:c,chain:f,commands:h,can:m})=>{const{extensions:p,splittableMarks:y}=i.extensionManager,S=ze(n,a.schema),_=ze(e,a.schema),{selection:C,storedMarks:A}=a,{$from:R,$to:K}=C,V=R.blockRange(K),G=A||C.$to.parentOffset&&C.$from.marks();if(!V)return!1;const ie=Fu(q=>Lg(q.type.name,p))(C);if(V.depth>=1&&ie&&V.depth-ie.depth<=1){if(ie.node.type===S)return h.liftListItem(_);if(Lg(ie.node.type.name,p)&&S.validContent(ie.node.content)&&c)return f().command(()=>(o.setNodeMarkup(ie.pos,S),!0)).command(()=>Bu(o,S)).command(()=>zu(o,S)).run()}return!t||!G||!c?f().command(()=>m().wrapInList(S,r)?!0:h.clearNodes()).wrapInList(S,r).command(()=>Bu(o,S)).command(()=>zu(o,S)).run():f().command(()=>{const q=m().wrapInList(S,r),ue=G.filter(Tt=>y.includes(Tt.type.name));return o.ensureMarks(ue),q?!0:h.clearNodes()}).wrapInList(S,r).command(()=>Bu(o,S)).command(()=>zu(o,S)).run()},RA=(n,e={},t={})=>({state:r,commands:i})=>{const{extendEmptyMarkRange:o=!1}=t,a=ln(n,r.schema);return wA(r,a,e)?i.unsetMark(a,{extendEmptyMarkRange:o}):i.setMark(a,e)},LA=(n,e,t={})=>({state:r,commands:i})=>{const o=ze(n,r.schema),a=ze(e,r.schema);return Pu(r,o,t)?i.setNode(a):i.setNode(o,t)},PA=(n,e={})=>({state:t,commands:r})=>{const i=ze(n,t.schema);return Pu(t,i,e)?r.lift(i):r.wrapIn(i,e)},DA=()=>({state:n,dispatch:e})=>{const t=n.plugins;for(let r=0;r<t.length;r+=1){const i=t[r];let o;if(i.spec.isInputRules&&(o=i.getState(n))){if(e){const a=n.tr,c=o.transform;for(let f=c.steps.length-1;f>=0;f-=1)a.step(c.steps[f].invert(c.docs[f]));if(o.text){const f=a.doc.resolve(o.from).marks();a.replaceWith(o.from,o.to,n.schema.text(o.text,f))}else a.delete(o.from,o.to)}return!0}}return!1},FA=()=>({tr:n,dispatch:e})=>{const{selection:t}=n,{empty:r,ranges:i}=t;return r||e&&i.forEach(o=>{n.removeMark(o.$from.pos,o.$to.pos)}),!0},BA=(n,e={})=>({tr:t,state:r,dispatch:i})=>{var o;const{extendEmptyMarkRange:a=!1}=e,{selection:c}=t,f=ln(n,r.schema),{$from:h,empty:m,ranges:p}=c;if(!i)return!0;if(m&&a){let{from:y,to:S}=c;const _=(o=h.marks().find(A=>A.type===f))===null||o===void 0?void 0:o.attrs,C=Ru(h,f,_);C&&(y=C.from,S=C.to),t.removeMark(y,S,f)}else p.forEach(y=>{t.removeMark(y.$from.pos,y.$to.pos,f)});return t.removeStoredMark(f),!0},zA=(n,e={})=>({tr:t,state:r,dispatch:i})=>{let o=null,a=null;const c=Du(typeof n=="string"?n:n.name,r.schema);return c?(c==="node"&&(o=ze(n,r.schema)),c==="mark"&&(a=ln(n,r.schema)),i&&t.selection.ranges.forEach(f=>{const h=f.$from.pos,m=f.$to.pos;r.doc.nodesBetween(h,m,(p,y)=>{o&&o===p.type&&t.setNodeMarkup(y,void 0,{...p.attrs,...e}),a&&p.marks.length&&p.marks.forEach(S=>{if(a===S.type){const _=Math.max(y,h),C=Math.min(y+p.nodeSize,m);t.addMark(_,C,a.create({...S.attrs,...e}))}})})}),!0):!1},HA=(n,e={})=>({state:t,dispatch:r})=>{const i=ze(n,t.schema);return eC(i,e)(t,r)},$A=(n,e={})=>({state:t,dispatch:r})=>{const i=ze(n,t.schema);return tC(i,e)(t,r)};var WA=Object.freeze({__proto__:null,blur:wC,clearContent:_C,clearNodes:kC,command:EC,createParagraphNear:TC,cut:CC,deleteCurrentNode:AC,deleteNode:MC,deleteRange:OC,deleteSelection:IC,enter:NC,exitCode:RC,extendMarkRange:PC,first:DC,focus:BC,forEach:zC,insertContent:HC,insertContentAt:UC,joinUp:VC,joinDown:KC,joinBackward:GC,joinForward:qC,joinItemBackward:JC,joinItemForward:jC,keyboardShortcut:XC,lift:ZC,liftEmptyBlock:QC,liftListItem:eA,newlineInCode:tA,resetAttributes:nA,scrollIntoView:rA,selectAll:iA,selectNodeBackward:sA,selectNodeForward:oA,selectParentNode:lA,selectTextblockEnd:aA,selectTextblockStart:cA,setContent:fA,setMark:kA,setMeta:EA,setNode:TA,setNodeSelection:CA,setTextSelection:AA,sinkListItem:MA,splitBlock:OA,splitListItem:IA,toggleList:NA,toggleMark:RA,toggleNode:LA,toggleWrap:PA,undoInputRule:DA,unsetAllMarks:FA,unsetMark:BA,updateAttributes:zA,wrapIn:HA,wrapInList:$A});Re.create({name:"commands",addCommands(){return{...WA}}}),Re.create({name:"editable",addProseMirrorPlugins(){return[new _t({key:new Yt("editable"),props:{editable:()=>this.editor.options.editable}})]}}),Re.create({name:"focusEvents",addProseMirrorPlugins(){const{editor:n}=this;return[new _t({key:new Yt("focusEvents"),props:{handleDOMEvents:{focus:(e,t)=>{n.isFocused=!0;const r=n.state.tr.setMeta("focus",{event:t}).setMeta("addToHistory",!1);return e.dispatch(r),!1},blur:(e,t)=>{n.isFocused=!1;const r=n.state.tr.setMeta("blur",{event:t}).setMeta("addToHistory",!1);return e.dispatch(r),!1}}}})]}}),Re.create({name:"keymap",addKeyboardShortcuts(){const n=()=>this.editor.commands.first(({commands:a})=>[()=>a.undoInputRule(),()=>a.command(({tr:c})=>{const{selection:f,doc:h}=c,{empty:m,$anchor:p}=f,{pos:y,parent:S}=p,_=p.parent.isTextblock?c.doc.resolve(y-1):p,C=_.parent.type.spec.isolating,A=p.pos-p.parentOffset,R=C&&_.parent.childCount===1?A===p.pos:he.atStart(h).from===y;return!m||!R||!S.type.isTextblock||S.textContent.length?!1:a.clearNodes()}),()=>a.deleteSelection(),()=>a.joinBackward(),()=>a.selectNodeBackward()]),e=()=>this.editor.commands.first(({commands:a})=>[()=>a.deleteSelection(),()=>a.deleteCurrentNode(),()=>a.joinForward(),()=>a.selectNodeForward()]),r={Enter:()=>this.editor.commands.first(({commands:a})=>[()=>a.newlineInCode(),()=>a.createParagraphNear(),()=>a.liftEmptyBlock(),()=>a.splitBlock()]),"Mod-Enter":()=>this.editor.commands.exitCode(),Backspace:n,"Mod-Backspace":n,"Shift-Backspace":n,Delete:e,"Mod-Delete":e,"Mod-a":()=>this.editor.commands.selectAll()},i={...r},o={...r,"Ctrl-h":n,"Alt-Backspace":n,"Ctrl-d":e,"Ctrl-Alt-Backspace":e,"Alt-Delete":e,"Alt-d":e,"Ctrl-a":()=>this.editor.commands.selectTextblockStart(),"Ctrl-e":()=>this.editor.commands.selectTextblockEnd()};return Lu()||Og()?o:i},addProseMirrorPlugins(){return[new _t({key:new Yt("clearDocument"),appendTransaction:(n,e,t)=>{if(!(n.some(_=>_.docChanged)&&!e.doc.eq(t.doc)))return;const{empty:i,from:o,to:a}=e.selection,c=he.atStart(e.doc).from,f=he.atEnd(e.doc).to;if(i||!(o===c&&a===f)||!(t.doc.textBetween(0,t.doc.content.size," "," ").length===0))return;const p=t.tr,y=gl({state:t,transaction:p}),{commands:S}=new Tu({editor:this.editor,state:y});if(S.clearNodes(),!!p.steps.length)return p}})]}}),Re.create({name:"tabindex",addProseMirrorPlugins(){return[new _t({key:new Yt("tabindex"),props:{attributes:this.editor.isEditable?{tabindex:"0"}:{}}})]}});function UA(n){return new Cg({find:n.find,handler:({state:e,range:t,match:r})=>{const i=e.doc.resolve(t.from),o=oe(n.getAttributes,void 0,r)||{};if(!i.node(-1).canReplaceWith(i.index(-1),i.indexAfter(-1),n.type))return null;e.tr.delete(t.from,t.to).setBlockType(t.from,t.from,n.type,o)}})}function VA(n){return new Cg({find:n.find,handler:({state:e,range:t,match:r,chain:i})=>{const o=oe(n.getAttributes,void 0,r)||{},a=e.tr.delete(t.from,t.to),f=a.doc.resolve(t.from).blockRange(),h=f&&nu(f,n.type,o);if(!h)return null;if(a.wrap(f,h),n.keepMarks&&n.editor){const{selection:p,storedMarks:y}=e,{splittableMarks:S}=n.editor.extensionManager,_=y||p.$to.parentOffset&&p.$from.marks();if(_){const C=_.filter(A=>S.includes(A.type.name));a.ensureMarks(C)}}if(n.keepAttributes){const p=n.type.name==="bulletList"||n.type.name==="orderedList"?"listItem":"taskList";i().updateAttributes(p,o).run()}const m=a.doc.resolve(t.from-1).nodeBefore;m&&m.type===n.type&&qn(a.doc,t.from-1)&&(!n.joinPredicate||n.joinPredicate(r,m))&&a.join(t.from-1)}})}class Et{constructor(e={}){this.type="mark",this.name="mark",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...e},this.name=this.config.name,e.defaultOptions&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=oe($(this,"addOptions",{name:this.name}))),this.storage=oe($(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(e={}){return new Et(e)}configure(e={}){const t=this.extend();return t.options=bl(this.options,e),t.storage=oe($(t,"addStorage",{name:t.name,options:t.options})),t}extend(e={}){const t=new Et(e);return t.parent=this,this.child=t,t.name=e.name?e.name:t.parent.name,e.defaultOptions&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${t.name}".`),t.options=oe($(t,"addOptions",{name:t.name})),t.storage=oe($(t,"addStorage",{name:t.name,options:t.options})),t}static handleExit({editor:e,mark:t}){const{tr:r}=e.state,i=e.state.selection.$from;if(i.pos===i.end()){const a=i.marks();if(!!!a.find(h=>h?.type.name===t.name))return!1;const f=a.find(h=>h?.type.name===t.name);return f&&r.removeStoredMark(f),r.insertText(" ",i.pos),e.view.dispatch(r),!0}return!1}}class Nn{constructor(e={}){this.type="node",this.name="node",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...e},this.name=this.config.name,e.defaultOptions&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=oe($(this,"addOptions",{name:this.name}))),this.storage=oe($(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(e={}){return new Nn(e)}configure(e={}){const t=this.extend();return t.options=bl(this.options,e),t.storage=oe($(t,"addStorage",{name:t.name,options:t.options})),t}extend(e={}){const t=new Nn(e);return t.parent=this,this.child=t,t.name=e.name?e.name:t.parent.name,e.defaultOptions&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${t.name}".`),t.options=oe($(t,"addOptions",{name:t.name})),t.storage=oe($(t,"addStorage",{name:t.name,options:t.options})),t}}function KA(n){return new pC({find:n.find,handler:({state:e,range:t,match:r,pasteEvent:i})=>{const o=oe(n.getAttributes,void 0,r,i);if(o===!1||o===null)return null;const{tr:a}=e,c=r[r.length-1],f=r[0];let h=t.to;if(c){const m=f.search(/\S/),p=t.from+f.indexOf(c),y=p+c.length;if(Rg(t.from,t.to,e.doc).filter(_=>_.mark.type.excluded.find(A=>A===n.type&&A!==_.mark.type)).filter(_=>_.to>p).length)return null;y<t.to&&a.delete(y,t.to),p>t.from&&a.delete(t.from+m,p),h=t.from+m+c.length,a.addMark(t.from+m,h,n.type.create(o||{})),a.removeStoredMark(n.type)}}})}const GA=Nn.create({name:"text",group:"inline"});var wl=200,qe=function(){};qe.prototype.append=function(e){return e.length?(e=qe.from(e),!this.length&&e||e.length<wl&&this.leafAppend(e)||this.length<wl&&e.leafPrepend(this)||this.appendInner(e)):this},qe.prototype.prepend=function(e){return e.length?qe.from(e).append(this):this},qe.prototype.appendInner=function(e){return new qA(this,e)},qe.prototype.slice=function(e,t){return e===void 0&&(e=0),t===void 0&&(t=this.length),e>=t?qe.empty:this.sliceInner(Math.max(0,e),Math.min(this.length,t))},qe.prototype.get=function(e){if(!(e<0||e>=this.length))return this.getInner(e)},qe.prototype.forEach=function(e,t,r){t===void 0&&(t=0),r===void 0&&(r=this.length),t<=r?this.forEachInner(e,t,r,0):this.forEachInvertedInner(e,t,r,0)},qe.prototype.map=function(e,t,r){t===void 0&&(t=0),r===void 0&&(r=this.length);var i=[];return this.forEach(function(o,a){return i.push(e(o,a))},t,r),i},qe.from=function(e){return e instanceof qe?e:e&&e.length?new Dg(e):qe.empty};var Dg=function(n){function e(r){n.call(this),this.values=r}n&&(e.__proto__=n),e.prototype=Object.create(n&&n.prototype),e.prototype.constructor=e;var t={length:{configurable:!0},depth:{configurable:!0}};return e.prototype.flatten=function(){return this.values},e.prototype.sliceInner=function(i,o){return i==0&&o==this.length?this:new e(this.values.slice(i,o))},e.prototype.getInner=function(i){return this.values[i]},e.prototype.forEachInner=function(i,o,a,c){for(var f=o;f<a;f++)if(i(this.values[f],c+f)===!1)return!1},e.prototype.forEachInvertedInner=function(i,o,a,c){for(var f=o-1;f>=a;f--)if(i(this.values[f],c+f)===!1)return!1},e.prototype.leafAppend=function(i){if(this.length+i.length<=wl)return new e(this.values.concat(i.flatten()))},e.prototype.leafPrepend=function(i){if(this.length+i.length<=wl)return new e(i.flatten().concat(this.values))},t.length.get=function(){return this.values.length},t.depth.get=function(){return 0},Object.defineProperties(e.prototype,t),e}(qe);qe.empty=new Dg([]);var qA=function(n){function e(t,r){n.call(this),this.left=t,this.right=r,this.length=t.length+r.length,this.depth=Math.max(t.depth,r.depth)+1}return n&&(e.__proto__=n),e.prototype=Object.create(n&&n.prototype),e.prototype.constructor=e,e.prototype.flatten=function(){return this.left.flatten().concat(this.right.flatten())},e.prototype.getInner=function(r){return r<this.left.length?this.left.get(r):this.right.get(r-this.left.length)},e.prototype.forEachInner=function(r,i,o,a){var c=this.left.length;if(i<c&&this.left.forEachInner(r,i,Math.min(o,c),a)===!1||o>c&&this.right.forEachInner(r,Math.max(i-c,0),Math.min(this.length,o)-c,a+c)===!1)return!1},e.prototype.forEachInvertedInner=function(r,i,o,a){var c=this.left.length;if(i>c&&this.right.forEachInvertedInner(r,i-c,Math.max(o,c)-c,a+c)===!1||o<c&&this.left.forEachInvertedInner(r,Math.min(i,c),o,a)===!1)return!1},e.prototype.sliceInner=function(r,i){if(r==0&&i==this.length)return this;var o=this.left.length;return i<=o?this.left.slice(r,i):r>=o?this.right.slice(r-o,i-o):this.left.slice(r,o).append(this.right.slice(0,i-o))},e.prototype.leafAppend=function(r){var i=this.right.leafAppend(r);if(i)return new e(this.left,i)},e.prototype.leafPrepend=function(r){var i=this.left.leafPrepend(r);if(i)return new e(i,this.right)},e.prototype.appendInner=function(r){return this.left.depth>=Math.max(this.right.depth,r.depth)+1?new e(this.left,new e(this.right,r)):new e(this,r)},e}(qe),Fg=qe;const JA=500;class en{constructor(e,t){this.items=e,this.eventCount=t}popEvent(e,t){if(this.eventCount==0)return null;let r=this.items.length;for(;;r--)if(this.items.get(r-1).selection){--r;break}let i,o;t&&(i=this.remapping(r,this.items.length),o=i.maps.length);let a=e.tr,c,f,h=[],m=[];return this.items.forEach((p,y)=>{if(!p.step){i||(i=this.remapping(r,y+1),o=i.maps.length),o--,m.push(p);return}if(i){m.push(new dn(p.map));let S=p.step.map(i.slice(o)),_;S&&a.maybeStep(S).doc&&(_=a.mapping.maps[a.mapping.maps.length-1],h.push(new dn(_,void 0,void 0,h.length+m.length))),o--,_&&i.appendMap(_,o)}else a.maybeStep(p.step);if(p.selection)return c=i?p.selection.map(i.slice(o)):p.selection,f=new en(this.items.slice(0,r).append(m.reverse().concat(h)),this.eventCount-1),!1},this.items.length,0),{remaining:f,transform:a,selection:c}}addTransform(e,t,r,i){let o=[],a=this.eventCount,c=this.items,f=!i&&c.length?c.get(c.length-1):null;for(let m=0;m<e.steps.length;m++){let p=e.steps[m].invert(e.docs[m]),y=new dn(e.mapping.maps[m],p,t),S;(S=f&&f.merge(y))&&(y=S,m?o.pop():c=c.slice(0,c.length-1)),o.push(y),t&&(a++,t=void 0),i||(f=y)}let h=a-r.depth;return h>YA&&(c=jA(c,h),a-=h),new en(c.append(o),a)}remapping(e,t){let r=new Li;return this.items.forEach((i,o)=>{let a=i.mirrorOffset!=null&&o-i.mirrorOffset>=e?r.maps.length-i.mirrorOffset:void 0;r.appendMap(i.map,a)},e,t),r}addMaps(e){return this.eventCount==0?this:new en(this.items.append(e.map(t=>new dn(t))),this.eventCount)}rebased(e,t){if(!this.eventCount)return this;let r=[],i=Math.max(0,this.items.length-t),o=e.mapping,a=e.steps.length,c=this.eventCount;this.items.forEach(y=>{y.selection&&c--},i);let f=t;this.items.forEach(y=>{let S=o.getMirror(--f);if(S==null)return;a=Math.min(a,S);let _=o.maps[S];if(y.step){let C=e.steps[S].invert(e.docs[S]),A=y.selection&&y.selection.map(o.slice(f+1,S));A&&c++,r.push(new dn(_,C,A))}else r.push(new dn(_))},i);let h=[];for(let y=t;y<a;y++)h.push(new dn(o.maps[y]));let m=this.items.slice(0,i).append(h).append(r),p=new en(m,c);return p.emptyItemCount()>JA&&(p=p.compress(this.items.length-r.length)),p}emptyItemCount(){let e=0;return this.items.forEach(t=>{t.step||e++}),e}compress(e=this.items.length){let t=this.remapping(0,e),r=t.maps.length,i=[],o=0;return this.items.forEach((a,c)=>{if(c>=e)i.push(a),a.selection&&o++;else if(a.step){let f=a.step.map(t.slice(r)),h=f&&f.getMap();if(r--,h&&t.appendMap(h,r),f){let m=a.selection&&a.selection.map(t.slice(r));m&&o++;let p=new dn(h.invert(),f,m),y,S=i.length-1;(y=i.length&&i[S].merge(p))?i[S]=y:i.push(p)}}else a.map&&r--},this.items.length,0),new en(Fg.from(i.reverse()),o)}}en.empty=new en(Fg.empty,0);function jA(n,e){let t;return n.forEach((r,i)=>{if(r.selection&&e--==0)return t=i,!1}),n.slice(t)}class dn{constructor(e,t,r,i){this.map=e,this.step=t,this.selection=r,this.mirrorOffset=i}merge(e){if(this.step&&e.step&&!e.selection){let t=e.step.merge(this.step);if(t)return new dn(t.getMap().invert(),t,this.selection)}}}class Zn{constructor(e,t,r,i){this.done=e,this.undone=t,this.prevRanges=r,this.prevTime=i}}const YA=20;function XA(n,e,t,r){let i=t.getMeta(Qn),o;if(i)return i.historyState;t.getMeta(QA)&&(n=new Zn(n.done,n.undone,null,0));let a=t.getMeta("appendedTransaction");if(t.steps.length==0)return n;if(a&&a.getMeta(Qn))return a.getMeta(Qn).redo?new Zn(n.done.addTransform(t,void 0,r,_l(e)),n.undone,Bg(t.mapping.maps[t.steps.length-1]),n.prevTime):new Zn(n.done,n.undone.addTransform(t,void 0,r,_l(e)),null,n.prevTime);if(t.getMeta("addToHistory")!==!1&&!(a&&a.getMeta("addToHistory")===!1)){let c=n.prevTime==0||!a&&(n.prevTime<(t.time||0)-r.newGroupDelay||!ZA(t,n.prevRanges)),f=a?Hu(n.prevRanges,t.mapping):Bg(t.mapping.maps[t.steps.length-1]);return new Zn(n.done.addTransform(t,c?e.selection.getBookmark():void 0,r,_l(e)),en.empty,f,t.time)}else return(o=t.getMeta("rebased"))?new Zn(n.done.rebased(t,o),n.undone.rebased(t,o),Hu(n.prevRanges,t.mapping),n.prevTime):new Zn(n.done.addMaps(t.mapping.maps),n.undone.addMaps(t.mapping.maps),Hu(n.prevRanges,t.mapping),n.prevTime)}function ZA(n,e){if(!e)return!1;if(!n.docChanged)return!0;let t=!1;return n.mapping.maps[0].forEach((r,i)=>{for(let o=0;o<e.length;o+=2)r<=e[o+1]&&i>=e[o]&&(t=!0)}),t}function Bg(n){let e=[];return n.forEach((t,r,i,o)=>e.push(i,o)),e}function Hu(n,e){if(!n)return null;let t=[];for(let r=0;r<n.length;r+=2){let i=e.map(n[r],1),o=e.map(n[r+1],-1);i<=o&&t.push(i,o)}return t}function zg(n,e,t,r){let i=_l(e),o=Qn.get(e).spec.config,a=(r?n.undone:n.done).popEvent(e,i);if(!a)return;let c=a.selection.resolve(a.transform.doc),f=(r?n.done:n.undone).addTransform(a.transform,e.selection.getBookmark(),o,i),h=new Zn(r?f:a.remaining,r?a.remaining:f,null,0);t(a.transform.setSelection(c).setMeta(Qn,{redo:r,historyState:h}).scrollIntoView())}let $u=!1,Hg=null;function _l(n){let e=n.plugins;if(Hg!=e){$u=!1,Hg=e;for(let t=0;t<e.length;t++)if(e[t].spec.historyPreserveItems){$u=!0;break}}return $u}const Qn=new Yt("history"),QA=new Yt("closeHistory");function eM(n={}){return n={depth:n.depth||100,newGroupDelay:n.newGroupDelay||500},new _t({key:Qn,state:{init(){return new Zn(en.empty,en.empty,null,0)},apply(e,t,r){return XA(t,r,e,n)}},config:n,props:{handleDOMEvents:{beforeinput(e,t){let r=t.inputType,i=r=="historyUndo"?$g:r=="historyRedo"?Wg:null;return i?(t.preventDefault(),i(e.state,e.dispatch)):!1}}}})}const $g=(n,e)=>{let t=Qn.getState(n);return!t||t.done.eventCount==0?!1:(e&&zg(t,n,e,!1),!0)},Wg=(n,e)=>{let t=Qn.getState(n);return!t||t.undone.eventCount==0?!1:(e&&zg(t,n,e,!0),!0)},tM=Re.create({name:"history",addOptions(){return{depth:100,newGroupDelay:500}},addCommands(){return{undo:()=>({state:n,dispatch:e})=>$g(n,e),redo:()=>({state:n,dispatch:e})=>Wg(n,e)}},addProseMirrorPlugins(){return[eM(this.options)]},addKeyboardShortcuts(){return{"Mod-z":()=>this.editor.commands.undo(),"Mod-Z":()=>this.editor.commands.undo(),"Mod-y":()=>this.editor.commands.redo(),"Mod-Y":()=>this.editor.commands.redo(),"Shift-Mod-z":()=>this.editor.commands.redo(),"Shift-Mod-Z":()=>this.editor.commands.redo(),"Mod-\u044F":()=>this.editor.commands.undo(),"Shift-Mod-\u044F":()=>this.editor.commands.redo()}}}),Wu=Object.freeze({COMMON:"common",DESKTOP:"desktop",TABLET:"tablet",MOBILE:"mobile",get values(){return[this.COMMON,this.MOBILE,this.TABLET,this.DESKTOP]}}),Uu=Object.freeze({UPPERCASE:"uppercase",LOWERCASE:"lowercase",CAPITALIZE:"capitalize"}),er=Object.freeze({LEFT:"left",CENTER:"center",RIGHT:"right",JUSTIFY:"justify",get values(){return[this.LEFT,this.CENTER,this.RIGHT,this.JUSTIFY]}}),te=Object.freeze({DOCUMENT:"doc",PARAGRAPH:"paragraph",HEADING:"heading",LIST:"list",LIST_ITEM:"listItem",TEXT:"text",get blocks(){return[this.PARAGRAPH,this.LIST,this.HEADING]}}),Bt=Object.freeze({DISC:"disc",CIRCLE:"circle",SQUARE:"square",DECIMAL:"decimal",ROMAN:"roman",LATIN:"latin",get values(){return[this.DISC,this.CIRCLE,this.SQUARE,this.DECIMAL,this.ROMAN,this.LATIN]},get ordered(){return[this.DECIMAL,this.ROMAN,this.LATIN]}}),fe=Object.freeze({ALIGNMENT:"alignment",BACKGROUND_COLOR:"background_color",FONT_COLOR:"font_color",FONT_FAMILY:"font_family",FONT_SIZE:"font_size",FONT_STYLE:"font_style",FONT_WEIGHT:"font_weight",LINE_HEIGHT:"line_height",TEXT_DECORATION:"text_decoration",SUPERSCRIPT:"superscript",MARGIN:"margin",LINK:"link",STYLE_PRESET:"style_preset",get attributes(){return[this.ALIGNMENT,this.LINE_HEIGHT,this.MARGIN]},get presetAttributes(){return[this.LINE_HEIGHT]},get inlineMarks(){return[this.TEXT_DECORATION,this.LINK,this.SUPERSCRIPT,this.BACKGROUND_COLOR]},get marks(){return[this.BACKGROUND_COLOR,this.FONT_COLOR,this.FONT_FAMILY,this.FONT_SIZE,this.FONT_STYLE,this.FONT_WEIGHT,this.TEXT_DECORATION,this.SUPERSCRIPT]}}),Zt=Object.freeze({SETTINGS:"settings",ALL:"_"}),Ug=Object.freeze({BLANK:"_blank",SELF:"_self"}),Cs=Object.freeze({URL:"url",BLOCK:"block"});class Vu{static create(e,t){const r=new this(e,t||{});return new _t({key:new Yt(this.name),props:r._buildProps()})}constructor(e,t){this.options=t,this.editor=e}_buildProps(){const t=Object.entries(this.addProps()).map(([r,i])=>[r,i.bind(this)]);return Object.fromEntries(t)}addProps(){return{}}}class nM extends Vu{addProps(){return{transformPastedHTML:this._transformPastedHTML,handlePaste:this._handlePaste}}_transformPastedHTML(e){if(e.includes("data-pm-slice")&&e.includes("zw-style"))return e;const t=Yl.build(e);return t.normalizeHTML(),this._removeDeprecatedStyles(t),t.normalizedHTML}_removeDeprecatedStyles(e){const t=e.dom.querySelectorAll('[style*="margin"]');for(const r of Array.from(t))r.style.removeProperty("margin"),r.style.removeProperty("margin-top"),r.style.removeProperty("margin-right"),r.style.removeProperty("margin-bottom"),r.style.removeProperty("margin-left")}_handlePaste(e,t,r){const i=this._insertPastedContent(e,r).scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste");return e.dispatch(i),!0}_insertPastedContent({state:e},t){return this._isFullBlockSelected(e)?e.tr.replaceSelectionWith(t.content,!1):e.tr.replaceSelection(t)}_isFullBlockSelected(e){const t=this._expandSelectionToBlocks(e),r=this._isMatchPosition(t.from,e.selection.from),i=this._isMatchPosition(t.to,e.selection.to);return r&&i}_expandSelectionToBlocks({selection:e,doc:t}){let r=e.from,i=e.to;return t.nodesBetween(r,i,(o,a,c)=>{c.type.name===te.DOCUMENT&&(r=Math.min(r,a+1),i=Math.max(i,a+o.nodeSize-1))}),{from:r,to:i}}_isMatchPosition(e,t){return Math.abs(e-t)<5}}class rM extends Vu{addProps(){return{decorations:this._buildDecorations}}_buildDecorations({doc:e}){const t=[];if(!this.editor.isEditable)return null;if(!(e.childCount>1))return e.descendants((r,i)=>{if(!r.childCount){const o=mn.node(i,i+r.nodeSize,{class:"zw-wysiwyg__placeholder","data-placeholder":"Type your text here..."});t.push(o)}return!1}),We.create(e,t)}}const iM="aaa1rp3barth4b0ott3vie4c1le2ogado5udhabi7c0ademy5centure6ountant0s9o1tor4d0s1ult4e0g1ro2tna4f0l1rica5g0akhan5ency5i0g1rbus3force5tel5kdn3l0faromeo7ibaba4pay4lfinanz6state5y2sace3tom5m0azon4ericanexpress7family11x2fam3ica3sterdam8nalytics7droid5quan4z2o0l2partments8p0le4q0uarelle8r0ab1mco4chi3my2pa2t0e3s0da2ia2sociates9t0hleta5torney7u0ction5di0ble3o3spost5thor3o0s4vianca6w0s2x0a2z0ure5ba0by2idu3namex3narepublic11d1k2r0celona5laycard4s5efoot5gains6seball5ketball8uhaus5yern5b0c1t1va3cg1n2d1e0ats2uty4er2ntley5rlin4st0buy5t2f1g1h0arti5i0ble3d1ke2ng0o3o1z2j1lack0friday9ockbuster8g1omberg7ue3m0s1w2n0pparibas9o0ats3ehringer8fa2m1nd2o0k0ing5sch2tik2on4t1utique6x2r0adesco6idgestone9oadway5ker3ther5ussels7s1t1uild0ers6siness6y1zz3v1w1y1z0h3ca0b1fe2l0l1vinklein9m0era3p2non3petown5ital0one8r0avan4ds2e0er0s4s2sa1e1h1ino4t0ering5holic7ba1n1re2s2c1d1enter4o1rn3f0a1d2g1h0anel2nel4rity4se2t2eap3intai5ristmas6ome4urch5i0priani6rcle4sco3tadel4i0c2y0eats7k1l0aims4eaning6ick2nic1que6othing5ud3ub0med6m1n1o0ach3des3ffee4llege4ogne5m0cast4mbank4unity6pany2re3uter5sec4ndos3struction8ulting7tact3ractors9oking0channel11l1p2rsica5untry4pon0s4rses6pa2r0edit0card4union9icket5own3s1uise0s6u0isinella9v1w1x1y0mru3ou3z2dabur3d1nce3ta1e1ing3sun4y2clk3ds2e0al0er2s3gree4livery5l1oitte5ta3mocrat6ntal2ist5si0gn4v2hl2iamonds6et2gital5rect0ory7scount3ver5h2y2j1k1m1np2o0cs1tor4g1mains5t1wnload7rive4tv2ubai3nlop4pont4rban5vag2r2z2earth3t2c0o2deka3u0cation8e1g1mail3erck5nergy4gineer0ing9terprises10pson4quipment8r0icsson6ni3s0q1tate5t0isalat7u0rovision8s2vents5xchange6pert3osed4ress5traspace10fage2il1rwinds6th3mily4n0s2rm0ers5shion4t3edex3edback6rrari3ero6i0at2delity5o2lm2nal1nce1ial7re0stone6mdale6sh0ing5t0ness6j1k1lickr3ghts4r2orist4wers5y2m1o0o0d0network8tball6rd1ex2sale4um3undation8x2r0ee1senius7l1ogans4ntdoor4ier7tr2ujitsu5n0d2rniture7tbol5yi3ga0l0lery3o1up4me0s3p1rden4y2b0iz3d0n2e0a1nt0ing5orge5f1g0ee3h1i0ft0s3ves2ing5l0ass3e1obal2o4m0ail3bh2o1x2n1odaddy5ld0point6f2o0dyear5g0le4p1t1v2p1q1r0ainger5phics5tis4een3ipe3ocery4up4s1t1u0ardian6cci3ge2ide2tars5ru3w1y2hair2mburg5ngout5us3bo2dfc0bank7ealth0care8lp1sinki6re1mes5gtv3iphop4samitsu7tachi5v2k0t2m1n1ockey4ldings5iday5medepot5goods5s0ense7nda3rse3spital5t0ing5t0eles2s3mail5use3w2r1sbc3t1u0ghes5yatt3undai7ibm2cbc2e1u2d1e0ee3fm2kano4l1m0amat4db2mo0bilien9n0c1dustries8finiti5o2g1k1stitute6urance4e4t0ernational10uit4vestments10o1piranga7q1r0ish4s0maili5t0anbul7t0au2v3jaguar4va3cb2e0ep2tzt3welry6io2ll2m0p2nj2o0bs1urg4t1y2p0morgan6rs3uegos4niper7kaufen5ddi3e0rryhotels6logistics9properties14fh2g1h1i0a1ds2m1nder2le4tchen5wi3m1n1oeln3matsu5sher5p0mg2n2r0d1ed3uokgroup8w1y0oto4z2la0caixa5mborghini8er3ncaster5ia3d0rover6xess5salle5t0ino3robe5w0yer5b1c1ds2ease3clerc5frak4gal2o2xus4gbt3i0dl2fe0insurance9style7ghting6ke2lly3mited4o2ncoln4de2k2psy3ve1ing5k1lc1p2oan0s3cker3us3l1ndon4tte1o3ve3pl0financial11r1s1t0d0a3u0ndbeck6xe1ury5v1y2ma0cys3drid4if1son4keup4n0agement7go3p1rket0ing3s4riott5shalls7serati6ttel5ba2c0kinsey7d1e0d0ia3et2lbourne7me1orial6n0u2rckmsd7g1h1iami3crosoft7l1ni1t2t0subishi9k1l0b1s2m0a2n1o0bi0le4da2e1i1m1nash3ey2ster5rmon3tgage6scow4to0rcycles9v0ie4p1q1r1s0d2t0n1r2u0seum3ic3tual5v1w1x1y1z2na0b1goya4me2tura4vy3ba2c1e0c1t0bank4flix4work5ustar5w0s2xt0direct7us4f0l2g0o2hk2i0co2ke1on3nja3ssan1y5l1o0kia3rthwesternmutual14on4w0ruz3tv4p1r0a1w2tt2u1yc2z2obi1server7ffice5kinawa6layan0group9dnavy5lo3m0ega4ne1g1l0ine5oo2pen3racle3nge4g0anic5igins6saka4tsuka4t2vh3pa0ge2nasonic7ris2s1tners4s1y3ssagens7y2ccw3e0t2f0izer5g1h0armacy6d1ilips5one2to0graphy6s4ysio5ics1tet2ures6d1n0g1k2oneer5zza4k1l0ace2y0station9umbing5s3m1n0c2ohl2ker3litie5rn2st3r0america6xi3ess3ime3o0d0uctions8f1gressive8mo2perties3y5tection8u0dential9s1t1ub2w0c2y2qa1pon3uebec3st5racing4dio4e0ad1lestate6tor2y4cipes5d0stone5umbrella9hab3ise0n3t2liance6n0t0als5pair3ort3ublican8st0aurant8view0s5xroth6ich0ardli6oh3l1o1p2o0cher3ks3deo3gers4om3s0vp3u0gby3hr2n2w0e2yukyu6sa0arland6fe0ty4kura4le1on3msclub4ung5ndvik0coromant12ofi4p1rl2s1ve2xo3b0i1s2c0a1b1haeffler7midt4olarships8ol3ule3warz5ience5ot3d1e0arch3t2cure1ity6ek2lect4ner3rvices6ven3w1x0y3fr2g1h0angrila6rp2w2ell3ia1ksha5oes2p0ping5uji3w0time7i0lk2na1gles5te3j1k0i0n2y0pe4l0ing4m0art3ile4n0cf3o0ccer3ial4ftbank4ware6hu2lar2utions7ng1y2y2pa0ce3ort2t3r0l2s1t0ada2ples4r1tebank4farm7c0group6ockholm6rage3e3ream4udio2y3yle4u0cks3pplies3y2ort5rf1gery5zuki5v1watch4iss4x1y0dney4stems6z2tab1ipei4lk2obao4rget4tamotors6r2too4x0i3c0i2d0k2eam2ch0nology8l1masek5nnis4va3f1g1h0d1eater2re6iaa2ckets5enda4ffany5ps2res2ol4j0maxx4x2k0maxx5l1m0all4n1o0day3kyo3ols3p1ray3shiba5tal3urs3wn2yota3s3r0ade1ing4ining5vel0channel7ers0insurance16ust3v2t1ube2i1nes3shu4v0s2w1z2ua1bank3s2g1k1nicom3versity8o2ol2ps2s1y1z2va0cations7na1guard7c1e0gas3ntures6risign5m\xF6gensberater2ung14sicherung10t2g1i0ajes4deo3g1king4llas4n1p1rgin4sa1ion4va1o3laanderen9n1odka3lkswagen7vo3te1ing3o2yage5u0elos6wales2mart4ter4ng0gou5tch0es6eather0channel12bcam3er2site5d0ding5ibo2r3f1hoswho6ien2ki2lliamhill9n0dows4e1ners6me2olterskluwer11odside6rk0s2ld3w2s1tc1f3xbox3erox4finity6ihuan4n2xx2yz3yachts4hoo3maxun5ndex5e1odobashi7ga2kohama6u0tube6t1un3za0ppos4ra3ero3ip2m1one3uerich6w2",sM="\u03B5\u03BB1\u03C52\u0431\u04331\u0435\u043B3\u0434\u0435\u0442\u04384\u0435\u044E2\u043A\u0430\u0442\u043E\u043B\u0438\u043A6\u043E\u043C3\u043C\u043A\u04342\u043E\u043D1\u0441\u043A\u0432\u04306\u043E\u043D\u043B\u0430\u0439\u043D5\u0440\u04333\u0440\u0443\u04412\u04442\u0441\u0430\u0439\u04423\u0440\u04313\u0443\u043A\u04403\u049B\u0430\u04373\u0570\u0561\u05753\u05D9\u05E9\u05E8\u05D0\u05DC5\u05E7\u05D5\u05DD3\u0627\u0628\u0648\u0638\u0628\u064A5\u062A\u0635\u0627\u0644\u0627\u062A6\u0631\u0627\u0645\u0643\u06485\u0644\u0627\u0631\u062F\u06464\u0628\u062D\u0631\u064A\u06465\u062C\u0632\u0627\u0626\u06315\u0633\u0639\u0648\u062F\u064A\u06296\u0639\u0644\u064A\u0627\u06465\u0645\u063A\u0631\u06285\u0645\u0627\u0631\u0627\u062A5\u06CC\u0631\u0627\u06465\u0628\u0627\u0631\u062A2\u0632\u0627\u06314\u064A\u062A\u06433\u06BE\u0627\u0631\u062A5\u062A\u0648\u0646\u06334\u0633\u0648\u062F\u0627\u06463\u0631\u064A\u06295\u0634\u0628\u0643\u06294\u0639\u0631\u0627\u06422\u06282\u0645\u0627\u06464\u0641\u0644\u0633\u0637\u064A\u06466\u0642\u0637\u06313\u0643\u0627\u062B\u0648\u0644\u064A\u06436\u0648\u06453\u0645\u0635\u06312\u0644\u064A\u0633\u064A\u06275\u0648\u0631\u064A\u062A\u0627\u0646\u064A\u06277\u0642\u06394\u0647\u0645\u0631\u0627\u06475\u067E\u0627\u06A9\u0633\u062A\u0627\u06467\u0680\u0627\u0631\u062A4\u0915\u0949\u092E3\u0928\u0947\u091F3\u092D\u093E\u0930\u09240\u092E\u094D3\u094B\u09245\u0938\u0902\u0917\u0920\u09285\u09AC\u09BE\u0982\u09B2\u09BE5\u09AD\u09BE\u09B0\u09A42\u09F0\u09A44\u0A2D\u0A3E\u0A30\u0A244\u0AAD\u0ABE\u0AB0\u0AA44\u0B2D\u0B3E\u0B30\u0B244\u0B87\u0BA8\u0BCD\u0BA4\u0BBF\u0BAF\u0BBE6\u0BB2\u0B99\u0BCD\u0B95\u0BC86\u0B9A\u0BBF\u0B99\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0BC2\u0BB0\u0BCD11\u0C2D\u0C3E\u0C30\u0C24\u0C4D5\u0CAD\u0CBE\u0CB0\u0CA44\u0D2D\u0D3E\u0D30\u0D24\u0D025\u0DBD\u0D82\u0D9A\u0DCF4\u0E04\u0E2D\u0E213\u0E44\u0E17\u0E223\u0EA5\u0EB2\u0EA73\u10D2\u10D42\u307F\u3093\u306A3\u30A2\u30DE\u30BE\u30F34\u30AF\u30E9\u30A6\u30C94\u30B0\u30FC\u30B0\u30EB4\u30B3\u30E02\u30B9\u30C8\u30A23\u30BB\u30FC\u30EB3\u30D5\u30A1\u30C3\u30B7\u30E7\u30F36\u30DD\u30A4\u30F3\u30C84\u4E16\u754C2\u4E2D\u4FE11\u56FD1\u570B1\u6587\u7F513\u4E9A\u9A6C\u900A3\u4F01\u4E1A2\u4F5B\u5C712\u4FE1\u606F2\u5065\u5EB72\u516B\u53662\u516C\u53F81\u76CA2\u53F0\u6E7E1\u70632\u5546\u57CE1\u5E971\u68072\u5609\u91CC0\u5927\u9152\u5E975\u5728\u7EBF2\u5927\u62FF2\u5929\u4E3B\u65593\u5A31\u4E502\u5BB6\u96FB2\u5E7F\u4E1C2\u5FAE\u535A2\u6148\u55842\u6211\u7231\u4F603\u624B\u673A2\u62DB\u80582\u653F\u52A11\u5E9C2\u65B0\u52A0\u57612\u95FB2\u65F6\u5C1A2\u66F8\u7C4D2\u673A\u67842\u6DE1\u9A6C\u95213\u6E38\u620F2\u6FB3\u95802\u70B9\u770B2\u79FB\u52A82\u7EC4\u7EC7\u673A\u67844\u7F51\u57401\u5E971\u7AD91\u7EDC2\u8054\u901A2\u8C37\u6B4C2\u8D2D\u72692\u901A\u8CA92\u96C6\u56E22\u96FB\u8A0A\u76C8\u79D14\u98DE\u5229\u6D663\u98DF\u54C12\u9910\u53852\u9999\u683C\u91CC\u62C93\u6E2F2\uB2F7\uB1371\uCEF42\uC0BC\uC1312\uD55C\uAD6D2",Ei=(n,e)=>{for(const t in e)n[t]=e[t];return n},Ku="numeric",Gu="ascii",qu="alpha",kl="asciinumeric",El="alphanumeric",Ju="domain",Vg="emoji",oM="scheme",lM="slashscheme",Kg="whitespace";function aM(n,e){return n in e||(e[n]=[]),e[n]}function Ir(n,e,t){e[Ku]&&(e[kl]=!0,e[El]=!0),e[Gu]&&(e[kl]=!0,e[qu]=!0),e[kl]&&(e[El]=!0),e[qu]&&(e[El]=!0),e[El]&&(e[Ju]=!0),e[Vg]&&(e[Ju]=!0);for(const r in e){const i=aM(r,t);i.indexOf(n)<0&&i.push(n)}}function cM(n,e){const t={};for(const r in e)e[r].indexOf(n)>=0&&(t[r]=!0);return t}function mt(n){n===void 0&&(n=null),this.j={},this.jr=[],this.jd=null,this.t=n}mt.groups={},mt.prototype={accepts(){return!!this.t},go(n){const e=this,t=e.j[n];if(t)return t;for(let r=0;r<e.jr.length;r++){const i=e.jr[r][0],o=e.jr[r][1];if(o&&i.test(n))return o}return e.jd},has(n,e){return e===void 0&&(e=!1),e?n in this.j:!!this.go(n)},ta(n,e,t,r){for(let i=0;i<n.length;i++)this.tt(n[i],e,t,r)},tr(n,e,t,r){r=r||mt.groups;let i;return e&&e.j?i=e:(i=new mt(e),t&&r&&Ir(e,t,r)),this.jr.push([n,i]),i},ts(n,e,t,r){let i=this;const o=n.length;if(!o)return i;for(let a=0;a<o-1;a++)i=i.tt(n[a]);return i.tt(n[o-1],e,t,r)},tt(n,e,t,r){r=r||mt.groups;const i=this;if(e&&e.j)return i.j[n]=e,e;const o=e;let a,c=i.go(n);if(c?(a=new mt,Ei(a.j,c.j),a.jr.push.apply(a.jr,c.jr),a.jd=c.jd,a.t=c.t):a=new mt,o){if(r)if(a.t&&typeof a.t=="string"){const f=Ei(cM(a.t,r),t);Ir(o,f,r)}else t&&Ir(o,t,r);a.t=o}return i.j[n]=a,a}};const U=(n,e,t,r,i)=>n.ta(e,t,r,i),zt=(n,e,t,r,i)=>n.tr(e,t,r,i),Gg=(n,e,t,r,i)=>n.ts(e,t,r,i),D=(n,e,t,r,i)=>n.tt(e,t,r,i),In="WORD",ju="UWORD",As="LOCALHOST",Yu="TLD",Xu="UTLD",Tl="SCHEME",Ti="SLASH_SCHEME",Zu="NUM",qg="WS",Qu="NL",Ci="OPENBRACE",Ms="OPENBRACKET",Os="OPENANGLEBRACKET",Is="OPENPAREN",Nr="CLOSEBRACE",Ai="CLOSEBRACKET",Mi="CLOSEANGLEBRACKET",Rr="CLOSEPAREN",Cl="AMPERSAND",Al="APOSTROPHE",Ml="ASTERISK",tr="AT",Ol="BACKSLASH",Il="BACKTICK",Nl="CARET",nr="COLON",ef="COMMA",Rl="DOLLAR",an="DOT",Ll="EQUALS",tf="EXCLAMATION",cn="HYPHEN",Pl="PERCENT",Dl="PIPE",Fl="PLUS",Bl="POUND",zl="QUERY",nf="QUOTE",rf="SEMI",un="SLASH",Ns="TILDE",Hl="UNDERSCORE",Jg="EMOJI",$l="SYM";var jg=Object.freeze({__proto__:null,WORD:In,UWORD:ju,LOCALHOST:As,TLD:Yu,UTLD:Xu,SCHEME:Tl,SLASH_SCHEME:Ti,NUM:Zu,WS:qg,NL:Qu,OPENBRACE:Ci,OPENBRACKET:Ms,OPENANGLEBRACKET:Os,OPENPAREN:Is,CLOSEBRACE:Nr,CLOSEBRACKET:Ai,CLOSEANGLEBRACKET:Mi,CLOSEPAREN:Rr,AMPERSAND:Cl,APOSTROPHE:Al,ASTERISK:Ml,AT:tr,BACKSLASH:Ol,BACKTICK:Il,CARET:Nl,COLON:nr,COMMA:ef,DOLLAR:Rl,DOT:an,EQUALS:Ll,EXCLAMATION:tf,HYPHEN:cn,PERCENT:Pl,PIPE:Dl,PLUS:Fl,POUND:Bl,QUERY:zl,QUOTE:nf,SEMI:rf,SLASH:un,TILDE:Ns,UNDERSCORE:Hl,EMOJI:Jg,SYM:$l});const Oi=/[a-z]/,sf=/\p{L}/u,of=/\p{Emoji}/u,lf=/\d/,Yg=/\s/,Xg=`
16
+ `,uM="\uFE0F",fM="\u200D";let Wl=null,Ul=null;function dM(n){n===void 0&&(n=[]);const e={};mt.groups=e;const t=new mt;Wl==null&&(Wl=Zg(iM)),Ul==null&&(Ul=Zg(sM)),D(t,"'",Al),D(t,"{",Ci),D(t,"[",Ms),D(t,"<",Os),D(t,"(",Is),D(t,"}",Nr),D(t,"]",Ai),D(t,">",Mi),D(t,")",Rr),D(t,"&",Cl),D(t,"*",Ml),D(t,"@",tr),D(t,"`",Il),D(t,"^",Nl),D(t,":",nr),D(t,",",ef),D(t,"$",Rl),D(t,".",an),D(t,"=",Ll),D(t,"!",tf),D(t,"-",cn),D(t,"%",Pl),D(t,"|",Dl),D(t,"+",Fl),D(t,"#",Bl),D(t,"?",zl),D(t,'"',nf),D(t,"/",un),D(t,";",rf),D(t,"~",Ns),D(t,"_",Hl),D(t,"\\",Ol);const r=zt(t,lf,Zu,{[Ku]:!0});zt(r,lf,r);const i=zt(t,Oi,In,{[Gu]:!0});zt(i,Oi,i);const o=zt(t,sf,ju,{[qu]:!0});zt(o,Oi),zt(o,sf,o);const a=zt(t,Yg,qg,{[Kg]:!0});D(t,Xg,Qu,{[Kg]:!0}),D(a,Xg),zt(a,Yg,a);const c=zt(t,of,Jg,{[Vg]:!0});zt(c,of,c),D(c,uM,c);const f=D(c,fM);zt(f,of,c);const h=[[Oi,i]],m=[[Oi,null],[sf,o]];for(let p=0;p<Wl.length;p++)rr(t,Wl[p],Yu,In,h);for(let p=0;p<Ul.length;p++)rr(t,Ul[p],Xu,ju,m);Ir(Yu,{tld:!0,ascii:!0},e),Ir(Xu,{utld:!0,alpha:!0},e),rr(t,"file",Tl,In,h),rr(t,"mailto",Tl,In,h),rr(t,"http",Ti,In,h),rr(t,"https",Ti,In,h),rr(t,"ftp",Ti,In,h),rr(t,"ftps",Ti,In,h),Ir(Tl,{scheme:!0,ascii:!0},e),Ir(Ti,{slashscheme:!0,ascii:!0},e),n=n.sort((p,y)=>p[0]>y[0]?1:-1);for(let p=0;p<n.length;p++){const y=n[p][0],_=n[p][1]?{[oM]:!0}:{[lM]:!0};y.indexOf("-")>=0?_[Ju]=!0:Oi.test(y)?lf.test(y)?_[kl]=!0:_[Gu]=!0:_[Ku]=!0,Gg(t,y,y,_)}return Gg(t,"localhost",As,{ascii:!0}),t.jd=new mt($l),{start:t,tokens:Ei({groups:e},jg)}}function hM(n,e){const t=pM(e.replace(/[A-Z]/g,c=>c.toLowerCase())),r=t.length,i=[];let o=0,a=0;for(;a<r;){let c=n,f=null,h=0,m=null,p=-1,y=-1;for(;a<r&&(f=c.go(t[a]));)c=f,c.accepts()?(p=0,y=0,m=c):p>=0&&(p+=t[a].length,y++),h+=t[a].length,o+=t[a].length,a++;o-=p,a-=y,h-=p,i.push({t:m.t,v:e.slice(o-h,o),s:o-h,e:o})}return i}function pM(n){const e=[],t=n.length;let r=0;for(;r<t;){let i=n.charCodeAt(r),o,a=i<55296||i>56319||r+1===t||(o=n.charCodeAt(r+1))<56320||o>57343?n[r]:n.slice(r,r+2);e.push(a),r+=a.length}return e}function rr(n,e,t,r,i){let o;const a=e.length;for(let c=0;c<a-1;c++){const f=e[c];n.j[f]?o=n.j[f]:(o=new mt(r),o.jr=i.slice(),n.j[f]=o),n=o}return o=new mt(t),o.jr=i.slice(),n.j[e[a-1]]=o,o}function Zg(n){const e=[],t=[];let r=0,i="0123456789";for(;r<n.length;){let o=0;for(;i.indexOf(n[r+o])>=0;)o++;if(o>0){e.push(t.join(""));for(let a=parseInt(n.substring(r,r+o),10);a>0;a--)t.pop();r+=o}else t.push(n[r]),r++}return e}const Rs={defaultProtocol:"http",events:null,format:Qg,formatHref:Qg,nl2br:!1,tagName:"a",target:null,rel:null,validate:!0,truncate:1/0,className:null,attributes:null,ignoreTags:[],render:null};function af(n,e){e===void 0&&(e=null);let t=Ei({},Rs);n&&(t=Ei(t,n instanceof af?n.o:n));const r=t.ignoreTags,i=[];for(let o=0;o<r.length;o++)i.push(r[o].toUpperCase());this.o=t,e&&(this.defaultRender=e),this.ignoreTags=i}af.prototype={o:Rs,ignoreTags:[],defaultRender(n){return n},check(n){return this.get("validate",n.toString(),n)},get(n,e,t){const r=e!=null;let i=this.o[n];return i&&(typeof i=="object"?(i=t.t in i?i[t.t]:Rs[n],typeof i=="function"&&r&&(i=i(e,t))):typeof i=="function"&&r&&(i=i(e,t.t,t)),i)},getObj(n,e,t){let r=this.o[n];return typeof r=="function"&&e!=null&&(r=r(e,t.t,t)),r},render(n){const e=n.render(this);return(this.get("render",null,n)||this.defaultRender)(e,n.t,n)}};function Qg(n){return n}function e0(n,e){this.t="token",this.v=n,this.tk=e}e0.prototype={isLink:!1,toString(){return this.v},toHref(n){return this.toString()},toFormattedString(n){const e=this.toString(),t=n.get("truncate",e,this),r=n.get("format",e,this);return t&&r.length>t?r.substring(0,t)+"\u2026":r},toFormattedHref(n){return n.get("formatHref",this.toHref(n.get("defaultProtocol")),this)},startIndex(){return this.tk[0].s},endIndex(){return this.tk[this.tk.length-1].e},toObject(n){return n===void 0&&(n=Rs.defaultProtocol),{type:this.t,value:this.toString(),isLink:this.isLink,href:this.toHref(n),start:this.startIndex(),end:this.endIndex()}},toFormattedObject(n){return{type:this.t,value:this.toFormattedString(n),isLink:this.isLink,href:this.toFormattedHref(n),start:this.startIndex(),end:this.endIndex()}},validate(n){return n.get("validate",this.toString(),this)},render(n){const e=this,t=this.toHref(n.get("defaultProtocol")),r=n.get("formatHref",t,this),i=n.get("tagName",t,e),o=this.toFormattedString(n),a={},c=n.get("className",t,e),f=n.get("target",t,e),h=n.get("rel",t,e),m=n.getObj("attributes",t,e),p=n.getObj("events",t,e);return a.href=r,c&&(a.class=c),f&&(a.target=f),h&&(a.rel=h),m&&Ei(a,m),{tagName:i,attributes:a,content:o,eventListeners:p}}};function Vl(n,e){class t extends e0{constructor(i,o){super(i,o),this.t=n}}for(const r in e)t.prototype[r]=e[r];return t.t=n,t}const t0=Vl("email",{isLink:!0,toHref(){return"mailto:"+this.toString()}}),n0=Vl("text"),mM=Vl("nl"),Lr=Vl("url",{isLink:!0,toHref(n){return n===void 0&&(n=Rs.defaultProtocol),this.hasProtocol()?this.v:`${n}://${this.v}`},hasProtocol(){const n=this.tk;return n.length>=2&&n[0].t!==As&&n[1].t===nr}}),He=n=>new mt(n);function gM(n){let{groups:e}=n;const t=e.domain.concat([Cl,Ml,tr,Ol,Il,Nl,Rl,Ll,cn,Zu,Pl,Dl,Fl,Bl,un,$l,Ns,Hl]),r=[Al,Mi,Nr,Ai,Rr,nr,ef,an,tf,Os,Ci,Ms,Is,zl,nf,rf],i=[Cl,Al,Ml,Ol,Il,Nl,Nr,Rl,Ll,cn,Ci,Pl,Dl,Fl,Bl,zl,un,$l,Ns,Hl],o=He(),a=D(o,Ns);U(a,i,a),U(a,e.domain,a);const c=He(),f=He(),h=He();U(o,e.domain,c),U(o,e.scheme,f),U(o,e.slashscheme,h),U(c,i,a),U(c,e.domain,c);const m=D(c,tr);D(a,tr,m),D(f,tr,m),D(h,tr,m);const p=D(a,an);U(p,i,a),U(p,e.domain,a);const y=He();U(m,e.domain,y),U(y,e.domain,y);const S=D(y,an);U(S,e.domain,y);const _=He(t0);U(S,e.tld,_),U(S,e.utld,_),D(m,As,_);const C=D(y,cn);U(C,e.domain,y),U(_,e.domain,y),D(_,an,S),D(_,cn,C);const A=D(_,nr);U(A,e.numeric,t0);const R=D(c,cn),K=D(c,an);U(R,e.domain,c),U(K,i,a),U(K,e.domain,c);const V=He(Lr);U(K,e.tld,V),U(K,e.utld,V),U(V,e.domain,c),U(V,i,a),D(V,an,K),D(V,cn,R),D(V,tr,m);const G=D(V,nr),ie=He(Lr);U(G,e.numeric,ie);const q=He(Lr),ue=He();U(q,t,q),U(q,r,ue),U(ue,t,q),U(ue,r,ue),D(V,un,q),D(ie,un,q);const Tt=D(f,nr),Fi=D(h,nr),Xl=D(Fi,un),Bi=D(Xl,un);U(f,e.domain,c),D(f,an,K),D(f,cn,R),U(h,e.domain,c),D(h,an,K),D(h,cn,R),U(Tt,e.domain,q),D(Tt,un,q),U(Bi,e.domain,q),U(Bi,t,q),D(Bi,un,q);const ar=D(q,Ci),$r=D(q,Ms),cr=D(q,Os),Wr=D(q,Is);D(ue,Ci,ar),D(ue,Ms,$r),D(ue,Os,cr),D(ue,Is,Wr),D(ar,Nr,q),D($r,Ai,q),D(cr,Mi,q),D(Wr,Rr,q),D(ar,Nr,q);const Rn=He(Lr),tt=He(Lr),Ye=He(Lr),gn=He(Lr);U(ar,t,Rn),U($r,t,tt),U(cr,t,Ye),U(Wr,t,gn);const tn=He(),nt=He(),Ur=He(),Vr=He();return U(ar,r),U($r,r),U(cr,r),U(Wr,r),U(Rn,t,Rn),U(tt,t,tt),U(Ye,t,Ye),U(gn,t,gn),U(Rn,r,Rn),U(tt,r,tt),U(Ye,r,Ye),U(gn,r,gn),U(tn,t,tn),U(nt,t,tt),U(Ur,t,Ye),U(Vr,t,gn),U(tn,r,tn),U(nt,r,nt),U(Ur,r,Ur),U(Vr,r,Vr),D(tt,Ai,q),D(Ye,Mi,q),D(gn,Rr,q),D(Rn,Nr,q),D(nt,Ai,q),D(Ur,Mi,q),D(Vr,Rr,q),D(tn,Rr,q),D(o,As,V),D(o,Qu,mM),{start:o,tokens:jg}}function yM(n,e,t){let r=t.length,i=0,o=[],a=[];for(;i<r;){let c=n,f=null,h=null,m=0,p=null,y=-1;for(;i<r&&!(f=c.go(t[i].t));)a.push(t[i++]);for(;i<r&&(h=f||c.go(t[i].t));)f=null,c=h,c.accepts()?(y=0,p=c):y>=0&&y++,i++,m++;if(y<0)i-=m,i<r&&(a.push(t[i]),i++);else{a.length>0&&(o.push(cf(n0,e,a)),a=[]),i-=y,m-=y;const S=p.t,_=t.slice(i-m,i);o.push(cf(S,e,_))}}return a.length>0&&o.push(cf(n0,e,a)),o}function cf(n,e,t){const r=t[0].s,i=t[t.length-1].e,o=e.slice(r,i);return new n(o,t)}const bM=typeof console<"u"&&console&&console.warn||(()=>{}),vM="until manual call of linkify.init(). Register all schemes and plugins before invoking linkify the first time.",Ce={scanner:null,parser:null,tokenQueue:[],pluginQueue:[],customSchemes:[],initialized:!1};function SM(){mt.groups={},Ce.scanner=null,Ce.parser=null,Ce.tokenQueue=[],Ce.pluginQueue=[],Ce.customSchemes=[],Ce.initialized=!1}function r0(n,e){if(e===void 0&&(e=!1),Ce.initialized&&bM(`linkifyjs: already initialized - will not register custom scheme "${n}" ${vM}`),!/^[0-9a-z]+(-[0-9a-z]+)*$/.test(n))throw new Error(`linkifyjs: incorrect scheme format.
19
17
  1. Must only contain digits, lowercase ASCII letters or "-"
20
18
  2. Cannot start or end with "-"
21
- 3. "-" cannot repeat`);Ee.customSchemes.push([n,e])}function bM(){Ee.scanner=uM(Ee.customSchemes);for(let n=0;n<Ee.tokenQueue.length;n++)Ee.tokenQueue[n][1]({scanner:Ee.scanner});Ee.parser=hM(Ee.scanner.tokens);for(let n=0;n<Ee.pluginQueue.length;n++)Ee.pluginQueue[n][1]({scanner:Ee.scanner,parser:Ee.parser});Ee.initialized=!0}function i0(n){return Ee.initialized||bM(),pM(Ee.parser.start,n,cM(Ee.scanner.start,n))}function nf(n,e,t){if(e===void 0&&(e=null),t===void 0&&(t=null),e&&typeof e=="object"){if(t)throw Error(`linkifyjs: Invalid link type ${e}; must be a string`);t=e,e=null}const r=new ef(t),i=i0(n),o=[];for(let a=0;a<i.length;a++){const u=i[a];u.isLink&&(!e||u.t===e)&&o.push(u.toFormattedObject(r))}return o}function vM(n,e){e===void 0&&(e=null);const t=i0(n);return t.length===1&&t[0].isLink&&(!e||t[0].t===e)}class SM extends Fc{addProps(){return{handlePaste:this._handlePaste}}_handlePaste(e,t,r){if(e.state.selection.empty)return!1;const i=r.content.textBetween(0,r.content.size).trim(),o=vM(i);if(!i||!o)return!1;const a=this._createLinkAttrs(i,r.content);return this.editor.commands.applyLink(a),!0}_createLinkAttrs(e,t){return bf.query(t,{typeName:ee.TEXT,mark:{typeName:ce.LINK},getMark:{typeName:ce.LINK}})?.attrs||{href:e}}}function P(n){return(...e)=>t=>n(t,...e)}function zl(n){const e=Object.entries(n).reduce((t,[r,i])=>{if(!i)return t;const o=r.replace(/_/g,"-");return`${t}--zw-${o}:${i};`},"");return e?{style:e}:null}function Pr(n){const e=zl(n);return["span",e?{...e,class:"zw-style"}:{},0]}function wM(n){return n.toLowerCase().replace(/(?:^|\s)\S/g,e=>e.toUpperCase())}function Lt(n,...e){return({editor:t})=>(t.commands[n](...e),!0)}var _M=Object.defineProperty,xM=(n,e,t)=>e in n?_M(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,Ms=(n,e,t)=>(xM(n,typeof e!="symbol"?e+"":e,t),t);const s0=Object.freeze({aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"0ff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"00f",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",burntsienna:"ea7e5d",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"0ff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"f0f",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"663399",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"}),kM=n=>n in s0,EM="[-\\+]?\\d+%?",TM="[-\\+]?\\d*\\.\\d+%?",tr=`(?:${TM})|(?:${EM})`,rf=`[\\s|\\(]+(${tr})[,|\\s]+(${tr})[,|\\s]+(${tr})\\s*\\)?`,sf=`[\\s|\\(]+(${tr})[,|\\s]+(${tr})[,|\\s]+(${tr})[,|\\s]+(${tr})\\s*\\)?`,ln=Object.freeze({CSS_UNIT:new RegExp(tr),RGB:new RegExp(`rgb${rf}`),RGBA:new RegExp(`rgba${sf}`),HSL:new RegExp(`hsl${rf}`),HSLA:new RegExp(`hsla${sf}`),HSV:new RegExp(`hsv${rf}`),HSVA:new RegExp(`hsva${sf}`),HEX3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,HEX6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,HEX4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,HEX8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/}),of=Object.freeze({WINDOW:Symbol("window")});function lf(n,e=0,t=1){return Math.max(e,Math.min(t,n))}function o0(n,e){let t=!1;return function(){t||(n.apply(this,arguments),t=!0,setTimeout(function(){t=!1},e))}}function Dr(n){return n>1||n<-1?n/100:n}const Fr=8,CM="#fff",AM="#e6e6e6";function MM(){const n=document.createElement("canvas");n.width=n.height=Fr*2;const e=n.getContext("2d");return e?(e.fillStyle=CM,e.fillRect(0,0,n.width,n.height),e.fillStyle=AM,e.fillRect(0,0,Fr,Fr),e.translate(Fr,Fr),e.fillRect(0,0,Fr,Fr),n.toDataURL()):null}const l0=3;function Mi(n){return Number.parseFloat(n.toFixed(l0+2).substr(0,l0+2))}function OM(n,e=1){const t=[];let r=0;for(;r<n.length;)t.push(n.substr(r,e)),r+=e;return t}function a0(n){const e=OM(n.slice(1),2).map(r=>parseInt(r,16)),t=e[3]!==void 0?Math.round(e[3]/255*100)/100:1;return{r:e[0],g:e[1],b:e[2],a:t}}function u0({h:n,s:e,v:t,a:r}){const i=a=>{const u=(a+n/60)%6;return t-t*e*Math.max(Math.min(u,4-u,1),0)},o=[i(5),i(3),i(1)].map(a=>Math.round(a*255));return{r:o[0],g:o[1],b:o[2],a:r}}function IM({h:n,s:e,l:t,a:r}){const i=t+e*Math.min(t,1-t),o=i===0?0:2-2*t/i,a=Mi(o),u=Mi(i);return{h:n,s:a,v:u,a:r}}function NM(n){const e=r=>{const i=Math.round(r).toString(16);return("00".substr(0,2-i.length)+i).toUpperCase()};return`#${[e(n.r),e(n.g),e(n.b)].join("")}`}function c0(n){if(!n)return{h:0,s:1,v:1,a:1};const e=n.r/255,t=n.g/255,r=n.b/255,i=Math.max(e,t,r),o=Math.min(e,t,r);let a=0;i!==o&&(i===e?a=60*(0+(t-r)/(i-o)):i===t?a=60*(2+(r-e)/(i-o)):i===r&&(a=60*(4+(e-t)/(i-o)))),a<0&&(a=a+360);const u=i===0?0:(i-o)/i,f=[a,u,i],h=Mi(f[1]),m=Mi(f[2]);return{h:Math.floor(f[0]),s:h,v:m,a:n.a}}function RM(n){return c0(a0(n))}function LM({h:n,s:e,v:t,a:r}){const i=t-t*e/2,o=i===1||i===0?0:(t-i)/Math.min(i,1-i),a=Mi(o),u=Mi(i);return{h:n,s:a,l:u,a:r}}function PM(n){const e=RM(n),t=LM(e),r=a0(n);return{alpha:e.a,hex:n.substr(0,7),hexa:n,hsla:t,hsva:e,hue:e.h,rgba:r}}function af(n,e,t="0"){return n+t.repeat(Math.max(0,e-n.length))}function DM(n){let e=n;return e.startsWith("#")&&(e=e.slice(1)),e=e.replace(/([^0-9a-f])/gi,"F"),(e.length===3||e.length===4)&&(e=e.split("").map(t=>t+t).join("")),e.length===6?e=af(e,8,"F"):e=af(af(e,6),8,"F"),`#${e}`.toUpperCase().substr(0,9)}function FM(n){return PM(DM(n))}const uf=class Ke{constructor(e){Ms(this,"rgba"),Ms(this,"hsva"),Ms(this,"alpha"),this.rgba=e,this.hsva=this.calcHsva(),this.alpha=e.a}static create(e){if(!e)return Ke.fromBlack();let t=e.replace(/^\s+/,"").replace(/\s+$/,"").toLowerCase();if(kM(t))t=s0[t];else if(t===this.TRANSPARENT)return Ke.fromTransparent();const r=ln.RGB.exec(t)||ln.RGBA.exec(t);if(r){const u=r[4]===void 0?1:r[4];return Ke.fromRgba({r:Number.parseInt(r[1]),g:Number.parseInt(r[2]),b:Number.parseInt(r[3]),a:Number.parseFloat(u.toString())})}const i=ln.HSL.exec(t)||ln.HSLA.exec(t);if(i){const u=i[4]===void 0?1:i[4];return Ke.fromHsla({h:Number.parseInt(i[1]),s:Number.parseFloat(i[2]),l:Number.parseFloat(i[3]),a:Number.parseFloat(u.toString())})}const o=ln.HSV.exec(t)||ln.HSVA.exec(t);if(o){const u=o[4]===void 0?1:o[4];return Ke.fromHsva({h:Number.parseInt(o[1]),s:Number.parseFloat(o[2]),v:Number.parseFloat(o[3]),a:Number.parseFloat(u.toString())})}return ln.HEX8.exec(t)||ln.HEX6.exec(t)||ln.HEX4.exec(t)||ln.HEX3.exec(t)?Ke.fromHex(t):Ke.fromBlack()}static fromHex(e){const{rgba:t}=FM(e);return new Ke(t)}static fromRgba({r:e,g:t,b:r,a:i}){const o=Dr(i);return new Ke({r:e,g:t,b:r,a:o})}static fromHsla({h:e,s:t,l:r,a:i}){const o=Dr(t),a=Dr(r),u=Dr(i);return Ke.fromHsva(IM({h:e,s:o,l:a,a:u}))}static fromHsva({h:e,s:t,v:r,a:i}){const o=Dr(t),a=Dr(r),u=Dr(i),f=u0({h:e,s:o,v:a,a:u});return new Ke(f)}static fromTransparent(){return new Ke({r:0,g:0,b:0,a:0})}static fromWhite(){return new Ke({r:255,g:255,b:255,a:1})}static fromBlack(){return new Ke({r:0,g:0,b:0,a:1})}static isTransparent(e){return Ke.create(e).isTransparent()}static isDark(e){return Ke.create(e).isDark()}get hex(){return this.toHexString()}get r(){return this.rgba.r}get b(){return this.rgba.b}get g(){return this.rgba.g}get h(){return this.hsva.h}get s(){return this.hsva.s}get v(){return this.hsva.v}setAlpha(e){return this.alpha=e,this}toHexString(){return NM({r:this.r,g:this.g,b:this.b})}toRgbaString(){const e=`${Math.floor(this.alpha*100)}%`;return`rgba(${[this.r,this.g,this.b,e].join(", ")})`}updateRgb(e){this.rgba={...this.rgba,...e},this.hsva=this.calcHsva()}updateHsv(e){this.hsva={...this.hsva,...e},this.rgba=this.calcRgba()}isTransparent(){return this.alpha===0}isDark(){return this.getBrightness()<128}getBrightness(){return(this.rgba.r*299+this.rgba.g*587+this.rgba.b*114)/1e3}calcHsva(){return c0(this.rgba)}calcRgba(){return u0(this.hsva)}};Ms(uf,"TRANSPARENT","transparent"),Ms(uf,"NONE","none");let BM=uf;of.WINDOW;const f0=3,zM=n=>Number.parseFloat(n.toFixed(f0+2).substr(0,f0+2));of.WINDOW,of.WINDOW,o0((n,e)=>{n(e)},20);function d0(n){const e=BM.create(n);return e.alpha===1?e.toHexString():e.toRgbaString()}function h0(n,e){if(!n.includes("em"))return parseInt(n);const t=Oi.getComputedStyle(e).fontSize,r=parseFloat(n)*parseFloat(t);return Math.round(r)}function HM(n,e){return(n.firstElementChild||n).style.fontSize||Oi.getComputedStyle(e).fontSize}function $M(n,e,t){if(!n.includes("px"))return n;const r=HM(e,t),i=h0(r,t);return i?(parseInt(n)/i).toFixed(2):null}const WM={start:Xn.LEFT,end:Xn.RIGHT};function UM(n){const e=WM[n]||n;return Xn.values.includes(e)?e:null}const p0=(n,e,t,r)=>({from:Math.max(r,n.pos),to:Math.min(r+t.nodeSize,e.pos)});function m0(n,e){return n.resolve(e).depth+1}function VM(n,e,t,r){const i=m0(n,r),o=e.from-i<=r,a=e.to+i>=t.nodeSize+r;return o&&a}const KM=(n,e)=>n.eq(e);function GM(n,e,t,r=KM){const i=n.resolve(e).path.reverse();for(const o of i)if(typeof o!="number"){for(const a of o.marks)if(r(a,t))return!0}return!1}function qM(n,e){const t=typeof e=="string"?e:e.name;return n.find(r=>r.type.name===t)}var Os=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},Hl={exports:{}};Hl.exports,function(n,e){(function(){var t,r="4.17.21",i=200,o="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",a="Expected a function",u="Invalid `variable` option passed into `_.template`",f="__lodash_hash_undefined__",h=500,m="__lodash_placeholder__",p=1,b=2,S=4,x=1,C=2,A=1,N=2,G=4,K=8,oe=16,pe=32,B=64,ue=128,lt=256,Pi=512,Kl=30,Di="...",sr=800,$r=16,or=1,Wr=2,Tn=3,Ze=1/0,qe=9007199254740991,dn=17976931348623157e292,Yt=NaN,Qe=4294967295,Ur=Qe-1,Vr=Qe>>>1,_0=[["ary",ue],["bind",A],["bindKey",N],["curry",K],["curryRight",oe],["flip",Pi],["partial",pe],["partialRight",B],["rearg",lt]],Kr="[object Arguments]",Rs="[object Array]",x0="[object AsyncFunction]",Fi="[object Boolean]",Bi="[object Date]",k0="[object DOMException]",Ls="[object Error]",Ps="[object Function]",vf="[object GeneratorFunction]",Dt="[object Map]",zi="[object Number]",E0="[object Null]",hn="[object Object]",Sf="[object Promise]",T0="[object Proxy]",Hi="[object RegExp]",Ft="[object Set]",$i="[object String]",Ds="[object Symbol]",C0="[object Undefined]",Wi="[object WeakMap]",A0="[object WeakSet]",Ui="[object ArrayBuffer]",Gr="[object DataView]",Gl="[object Float32Array]",ql="[object Float64Array]",Jl="[object Int8Array]",jl="[object Int16Array]",Yl="[object Int32Array]",Xl="[object Uint8Array]",Zl="[object Uint8ClampedArray]",Ql="[object Uint16Array]",ea="[object Uint32Array]",M0=/\b__p \+= '';/g,O0=/\b(__p \+=) '' \+/g,I0=/(__e\(.*?\)|\b__t\)) \+\n'';/g,wf=/&(?:amp|lt|gt|quot|#39);/g,_f=/[&<>"']/g,N0=RegExp(wf.source),R0=RegExp(_f.source),L0=/<%-([\s\S]+?)%>/g,P0=/<%([\s\S]+?)%>/g,xf=/<%=([\s\S]+?)%>/g,D0=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,F0=/^\w*$/,B0=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,ta=/[\\^$.*+?()[\]{}|]/g,z0=RegExp(ta.source),na=/^\s+/,H0=/\s/,$0=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,W0=/\{\n\/\* \[wrapped with (.+)\] \*/,U0=/,? & /,V0=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,K0=/[()=,{}\[\]\/\s]/,G0=/\\(\\)?/g,q0=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,kf=/\w*$/,J0=/^[-+]0x[0-9a-f]+$/i,j0=/^0b[01]+$/i,Y0=/^\[object .+?Constructor\]$/,X0=/^0o[0-7]+$/i,Z0=/^(?:0|[1-9]\d*)$/,Q0=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Fs=/($^)/,ey=/['\n\r\u2028\u2029\\]/g,Bs="\\ud800-\\udfff",ty="\\u0300-\\u036f",ny="\\ufe20-\\ufe2f",ry="\\u20d0-\\u20ff",Ef=ty+ny+ry,Tf="\\u2700-\\u27bf",Cf="a-z\\xdf-\\xf6\\xf8-\\xff",iy="\\xac\\xb1\\xd7\\xf7",sy="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",oy="\\u2000-\\u206f",ly=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",Af="A-Z\\xc0-\\xd6\\xd8-\\xde",Mf="\\ufe0e\\ufe0f",Of=iy+sy+oy+ly,ra="['\u2019]",ay="["+Bs+"]",If="["+Of+"]",zs="["+Ef+"]",Nf="\\d+",uy="["+Tf+"]",Rf="["+Cf+"]",Lf="[^"+Bs+Of+Nf+Tf+Cf+Af+"]",ia="\\ud83c[\\udffb-\\udfff]",cy="(?:"+zs+"|"+ia+")",Pf="[^"+Bs+"]",sa="(?:\\ud83c[\\udde6-\\uddff]){2}",oa="[\\ud800-\\udbff][\\udc00-\\udfff]",qr="["+Af+"]",Df="\\u200d",Ff="(?:"+Rf+"|"+Lf+")",fy="(?:"+qr+"|"+Lf+")",Bf="(?:"+ra+"(?:d|ll|m|re|s|t|ve))?",zf="(?:"+ra+"(?:D|LL|M|RE|S|T|VE))?",Hf=cy+"?",$f="["+Mf+"]?",dy="(?:"+Df+"(?:"+[Pf,sa,oa].join("|")+")"+$f+Hf+")*",hy="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",py="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",Wf=$f+Hf+dy,my="(?:"+[uy,sa,oa].join("|")+")"+Wf,gy="(?:"+[Pf+zs+"?",zs,sa,oa,ay].join("|")+")",yy=RegExp(ra,"g"),by=RegExp(zs,"g"),la=RegExp(ia+"(?="+ia+")|"+gy+Wf,"g"),vy=RegExp([qr+"?"+Rf+"+"+Bf+"(?="+[If,qr,"$"].join("|")+")",fy+"+"+zf+"(?="+[If,qr+Ff,"$"].join("|")+")",qr+"?"+Ff+"+"+Bf,qr+"+"+zf,py,hy,Nf,my].join("|"),"g"),Sy=RegExp("["+Df+Bs+Ef+Mf+"]"),wy=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,_y=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],xy=-1,Se={};Se[Gl]=Se[ql]=Se[Jl]=Se[jl]=Se[Yl]=Se[Xl]=Se[Zl]=Se[Ql]=Se[ea]=!0,Se[Kr]=Se[Rs]=Se[Ui]=Se[Fi]=Se[Gr]=Se[Bi]=Se[Ls]=Se[Ps]=Se[Dt]=Se[zi]=Se[hn]=Se[Hi]=Se[Ft]=Se[$i]=Se[Wi]=!1;var ve={};ve[Kr]=ve[Rs]=ve[Ui]=ve[Gr]=ve[Fi]=ve[Bi]=ve[Gl]=ve[ql]=ve[Jl]=ve[jl]=ve[Yl]=ve[Dt]=ve[zi]=ve[hn]=ve[Hi]=ve[Ft]=ve[$i]=ve[Ds]=ve[Xl]=ve[Zl]=ve[Ql]=ve[ea]=!0,ve[Ls]=ve[Ps]=ve[Wi]=!1;var ky={\u00C0:"A",\u00C1:"A",\u00C2:"A",\u00C3:"A",\u00C4:"A",\u00C5:"A",\u00E0:"a",\u00E1:"a",\u00E2:"a",\u00E3:"a",\u00E4:"a",\u00E5:"a",\u00C7:"C",\u00E7:"c",\u00D0:"D",\u00F0:"d",\u00C8:"E",\u00C9:"E",\u00CA:"E",\u00CB:"E",\u00E8:"e",\u00E9:"e",\u00EA:"e",\u00EB:"e",\u00CC:"I",\u00CD:"I",\u00CE:"I",\u00CF:"I",\u00EC:"i",\u00ED:"i",\u00EE:"i",\u00EF:"i",\u00D1:"N",\u00F1:"n",\u00D2:"O",\u00D3:"O",\u00D4:"O",\u00D5:"O",\u00D6:"O",\u00D8:"O",\u00F2:"o",\u00F3:"o",\u00F4:"o",\u00F5:"o",\u00F6:"o",\u00F8:"o",\u00D9:"U",\u00DA:"U",\u00DB:"U",\u00DC:"U",\u00F9:"u",\u00FA:"u",\u00FB:"u",\u00FC:"u",\u00DD:"Y",\u00FD:"y",\u00FF:"y",\u00C6:"Ae",\u00E6:"ae",\u00DE:"Th",\u00FE:"th",\u00DF:"ss",\u0100:"A",\u0102:"A",\u0104:"A",\u0101:"a",\u0103:"a",\u0105:"a",\u0106:"C",\u0108:"C",\u010A:"C",\u010C:"C",\u0107:"c",\u0109:"c",\u010B:"c",\u010D:"c",\u010E:"D",\u0110:"D",\u010F:"d",\u0111:"d",\u0112:"E",\u0114:"E",\u0116:"E",\u0118:"E",\u011A:"E",\u0113:"e",\u0115:"e",\u0117:"e",\u0119:"e",\u011B:"e",\u011C:"G",\u011E:"G",\u0120:"G",\u0122:"G",\u011D:"g",\u011F:"g",\u0121:"g",\u0123:"g",\u0124:"H",\u0126:"H",\u0125:"h",\u0127:"h",\u0128:"I",\u012A:"I",\u012C:"I",\u012E:"I",\u0130:"I",\u0129:"i",\u012B:"i",\u012D:"i",\u012F:"i",\u0131:"i",\u0134:"J",\u0135:"j",\u0136:"K",\u0137:"k",\u0138:"k",\u0139:"L",\u013B:"L",\u013D:"L",\u013F:"L",\u0141:"L",\u013A:"l",\u013C:"l",\u013E:"l",\u0140:"l",\u0142:"l",\u0143:"N",\u0145:"N",\u0147:"N",\u014A:"N",\u0144:"n",\u0146:"n",\u0148:"n",\u014B:"n",\u014C:"O",\u014E:"O",\u0150:"O",\u014D:"o",\u014F:"o",\u0151:"o",\u0154:"R",\u0156:"R",\u0158:"R",\u0155:"r",\u0157:"r",\u0159:"r",\u015A:"S",\u015C:"S",\u015E:"S",\u0160:"S",\u015B:"s",\u015D:"s",\u015F:"s",\u0161:"s",\u0162:"T",\u0164:"T",\u0166:"T",\u0163:"t",\u0165:"t",\u0167:"t",\u0168:"U",\u016A:"U",\u016C:"U",\u016E:"U",\u0170:"U",\u0172:"U",\u0169:"u",\u016B:"u",\u016D:"u",\u016F:"u",\u0171:"u",\u0173:"u",\u0174:"W",\u0175:"w",\u0176:"Y",\u0177:"y",\u0178:"Y",\u0179:"Z",\u017B:"Z",\u017D:"Z",\u017A:"z",\u017C:"z",\u017E:"z",\u0132:"IJ",\u0133:"ij",\u0152:"Oe",\u0153:"oe",\u0149:"'n",\u017F:"s"},Ey={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},Ty={"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#39;":"'"},Cy={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},Ay=parseFloat,My=parseInt,Uf=typeof Os=="object"&&Os&&Os.Object===Object&&Os,Oy=typeof self=="object"&&self&&self.Object===Object&&self,$e=Uf||Oy||Function("return this")(),aa=e&&!e.nodeType&&e,lr=aa&&!0&&n&&!n.nodeType&&n,Vf=lr&&lr.exports===aa,ua=Vf&&Uf.process,xt=function(){try{var k=lr&&lr.require&&lr.require("util").types;return k||ua&&ua.binding&&ua.binding("util")}catch{}}(),Kf=xt&&xt.isArrayBuffer,Gf=xt&&xt.isDate,qf=xt&&xt.isMap,Jf=xt&&xt.isRegExp,jf=xt&&xt.isSet,Yf=xt&&xt.isTypedArray;function pt(k,M,T){switch(T.length){case 0:return k.call(M);case 1:return k.call(M,T[0]);case 2:return k.call(M,T[0],T[1]);case 3:return k.call(M,T[0],T[1],T[2])}return k.apply(M,T)}function Iy(k,M,T,H){for(var X=-1,me=k==null?0:k.length;++X<me;){var Le=k[X];M(H,Le,T(Le),k)}return H}function kt(k,M){for(var T=-1,H=k==null?0:k.length;++T<H&&M(k[T],T,k)!==!1;);return k}function Ny(k,M){for(var T=k==null?0:k.length;T--&&M(k[T],T,k)!==!1;);return k}function Xf(k,M){for(var T=-1,H=k==null?0:k.length;++T<H;)if(!M(k[T],T,k))return!1;return!0}function Cn(k,M){for(var T=-1,H=k==null?0:k.length,X=0,me=[];++T<H;){var Le=k[T];M(Le,T,k)&&(me[X++]=Le)}return me}function Hs(k,M){var T=k==null?0:k.length;return!!T&&Jr(k,M,0)>-1}function ca(k,M,T){for(var H=-1,X=k==null?0:k.length;++H<X;)if(T(M,k[H]))return!0;return!1}function _e(k,M){for(var T=-1,H=k==null?0:k.length,X=Array(H);++T<H;)X[T]=M(k[T],T,k);return X}function An(k,M){for(var T=-1,H=M.length,X=k.length;++T<H;)k[X+T]=M[T];return k}function fa(k,M,T,H){var X=-1,me=k==null?0:k.length;for(H&&me&&(T=k[++X]);++X<me;)T=M(T,k[X],X,k);return T}function Ry(k,M,T,H){var X=k==null?0:k.length;for(H&&X&&(T=k[--X]);X--;)T=M(T,k[X],X,k);return T}function da(k,M){for(var T=-1,H=k==null?0:k.length;++T<H;)if(M(k[T],T,k))return!0;return!1}var Ly=ha("length");function Py(k){return k.split("")}function Dy(k){return k.match(V0)||[]}function Zf(k,M,T){var H;return T(k,function(X,me,Le){if(M(X,me,Le))return H=me,!1}),H}function $s(k,M,T,H){for(var X=k.length,me=T+(H?1:-1);H?me--:++me<X;)if(M(k[me],me,k))return me;return-1}function Jr(k,M,T){return M===M?Jy(k,M,T):$s(k,Qf,T)}function Fy(k,M,T,H){for(var X=T-1,me=k.length;++X<me;)if(H(k[X],M))return X;return-1}function Qf(k){return k!==k}function ed(k,M){var T=k==null?0:k.length;return T?ma(k,M)/T:Yt}function ha(k){return function(M){return M==null?t:M[k]}}function pa(k){return function(M){return k==null?t:k[M]}}function td(k,M,T,H,X){return X(k,function(me,Le,be){T=H?(H=!1,me):M(T,me,Le,be)}),T}function By(k,M){var T=k.length;for(k.sort(M);T--;)k[T]=k[T].value;return k}function ma(k,M){for(var T,H=-1,X=k.length;++H<X;){var me=M(k[H]);me!==t&&(T=T===t?me:T+me)}return T}function ga(k,M){for(var T=-1,H=Array(k);++T<k;)H[T]=M(T);return H}function zy(k,M){return _e(M,function(T){return[T,k[T]]})}function nd(k){return k&&k.slice(0,od(k)+1).replace(na,"")}function mt(k){return function(M){return k(M)}}function ya(k,M){return _e(M,function(T){return k[T]})}function Vi(k,M){return k.has(M)}function rd(k,M){for(var T=-1,H=k.length;++T<H&&Jr(M,k[T],0)>-1;);return T}function id(k,M){for(var T=k.length;T--&&Jr(M,k[T],0)>-1;);return T}function Hy(k,M){for(var T=k.length,H=0;T--;)k[T]===M&&++H;return H}var $y=pa(ky),Wy=pa(Ey);function Uy(k){return"\\"+Cy[k]}function Vy(k,M){return k==null?t:k[M]}function jr(k){return Sy.test(k)}function Ky(k){return wy.test(k)}function Gy(k){for(var M,T=[];!(M=k.next()).done;)T.push(M.value);return T}function ba(k){var M=-1,T=Array(k.size);return k.forEach(function(H,X){T[++M]=[X,H]}),T}function sd(k,M){return function(T){return k(M(T))}}function Mn(k,M){for(var T=-1,H=k.length,X=0,me=[];++T<H;){var Le=k[T];(Le===M||Le===m)&&(k[T]=m,me[X++]=T)}return me}function Ws(k){var M=-1,T=Array(k.size);return k.forEach(function(H){T[++M]=H}),T}function qy(k){var M=-1,T=Array(k.size);return k.forEach(function(H){T[++M]=[H,H]}),T}function Jy(k,M,T){for(var H=T-1,X=k.length;++H<X;)if(k[H]===M)return H;return-1}function jy(k,M,T){for(var H=T+1;H--;)if(k[H]===M)return H;return H}function Yr(k){return jr(k)?Xy(k):Ly(k)}function Bt(k){return jr(k)?Zy(k):Py(k)}function od(k){for(var M=k.length;M--&&H0.test(k.charAt(M)););return M}var Yy=pa(Ty);function Xy(k){for(var M=la.lastIndex=0;la.test(k);)++M;return M}function Zy(k){return k.match(la)||[]}function Qy(k){return k.match(vy)||[]}var e1=function k(M){M=M==null?$e:Xr.defaults($e.Object(),M,Xr.pick($e,_y));var T=M.Array,H=M.Date,X=M.Error,me=M.Function,Le=M.Math,be=M.Object,va=M.RegExp,t1=M.String,Et=M.TypeError,Us=T.prototype,n1=me.prototype,Zr=be.prototype,Vs=M["__core-js_shared__"],Ks=n1.toString,ye=Zr.hasOwnProperty,r1=0,ld=function(){var s=/[^.]+$/.exec(Vs&&Vs.keys&&Vs.keys.IE_PROTO||"");return s?"Symbol(src)_1."+s:""}(),Gs=Zr.toString,i1=Ks.call(be),s1=$e._,o1=va("^"+Ks.call(ye).replace(ta,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),qs=Vf?M.Buffer:t,On=M.Symbol,Js=M.Uint8Array,ad=qs?qs.allocUnsafe:t,js=sd(be.getPrototypeOf,be),ud=be.create,cd=Zr.propertyIsEnumerable,Ys=Us.splice,fd=On?On.isConcatSpreadable:t,Ki=On?On.iterator:t,ar=On?On.toStringTag:t,Xs=function(){try{var s=hr(be,"defineProperty");return s({},"",{}),s}catch{}}(),l1=M.clearTimeout!==$e.clearTimeout&&M.clearTimeout,a1=H&&H.now!==$e.Date.now&&H.now,u1=M.setTimeout!==$e.setTimeout&&M.setTimeout,Zs=Le.ceil,Qs=Le.floor,Sa=be.getOwnPropertySymbols,c1=qs?qs.isBuffer:t,dd=M.isFinite,f1=Us.join,d1=sd(be.keys,be),Pe=Le.max,Je=Le.min,h1=H.now,p1=M.parseInt,hd=Le.random,m1=Us.reverse,wa=hr(M,"DataView"),Gi=hr(M,"Map"),_a=hr(M,"Promise"),Qr=hr(M,"Set"),qi=hr(M,"WeakMap"),Ji=hr(be,"create"),eo=qi&&new qi,ei={},g1=pr(wa),y1=pr(Gi),b1=pr(_a),v1=pr(Qr),S1=pr(qi),to=On?On.prototype:t,ji=to?to.valueOf:t,pd=to?to.toString:t;function y(s){if(Te(s)&&!Z(s)&&!(s instanceof le)){if(s instanceof Tt)return s;if(ye.call(s,"__wrapped__"))return mh(s)}return new Tt(s)}var ti=function(){function s(){}return function(l){if(!ke(l))return{};if(ud)return ud(l);s.prototype=l;var c=new s;return s.prototype=t,c}}();function no(){}function Tt(s,l){this.__wrapped__=s,this.__actions__=[],this.__chain__=!!l,this.__index__=0,this.__values__=t}y.templateSettings={escape:L0,evaluate:P0,interpolate:xf,variable:"",imports:{_:y}},y.prototype=no.prototype,y.prototype.constructor=y,Tt.prototype=ti(no.prototype),Tt.prototype.constructor=Tt;function le(s){this.__wrapped__=s,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=Qe,this.__views__=[]}function w1(){var s=new le(this.__wrapped__);return s.__actions__=at(this.__actions__),s.__dir__=this.__dir__,s.__filtered__=this.__filtered__,s.__iteratees__=at(this.__iteratees__),s.__takeCount__=this.__takeCount__,s.__views__=at(this.__views__),s}function _1(){if(this.__filtered__){var s=new le(this);s.__dir__=-1,s.__filtered__=!0}else s=this.clone(),s.__dir__*=-1;return s}function x1(){var s=this.__wrapped__.value(),l=this.__dir__,c=Z(s),d=l<0,g=c?s.length:0,v=Pb(0,g,this.__views__),w=v.start,_=v.end,E=_-w,O=d?_:w-1,I=this.__iteratees__,R=I.length,z=0,U=Je(E,this.__takeCount__);if(!c||!d&&g==E&&U==E)return Bd(s,this.__actions__);var J=[];e:for(;E--&&z<U;){O+=l;for(var te=-1,j=s[O];++te<R;){var re=I[te],ae=re.iteratee,bt=re.type,nt=ae(j);if(bt==Wr)j=nt;else if(!nt){if(bt==or)continue e;break e}}J[z++]=j}return J}le.prototype=ti(no.prototype),le.prototype.constructor=le;function ur(s){var l=-1,c=s==null?0:s.length;for(this.clear();++l<c;){var d=s[l];this.set(d[0],d[1])}}function k1(){this.__data__=Ji?Ji(null):{},this.size=0}function E1(s){var l=this.has(s)&&delete this.__data__[s];return this.size-=l?1:0,l}function T1(s){var l=this.__data__;if(Ji){var c=l[s];return c===f?t:c}return ye.call(l,s)?l[s]:t}function C1(s){var l=this.__data__;return Ji?l[s]!==t:ye.call(l,s)}function A1(s,l){var c=this.__data__;return this.size+=this.has(s)?0:1,c[s]=Ji&&l===t?f:l,this}ur.prototype.clear=k1,ur.prototype.delete=E1,ur.prototype.get=T1,ur.prototype.has=C1,ur.prototype.set=A1;function pn(s){var l=-1,c=s==null?0:s.length;for(this.clear();++l<c;){var d=s[l];this.set(d[0],d[1])}}function M1(){this.__data__=[],this.size=0}function O1(s){var l=this.__data__,c=ro(l,s);if(c<0)return!1;var d=l.length-1;return c==d?l.pop():Ys.call(l,c,1),--this.size,!0}function I1(s){var l=this.__data__,c=ro(l,s);return c<0?t:l[c][1]}function N1(s){return ro(this.__data__,s)>-1}function R1(s,l){var c=this.__data__,d=ro(c,s);return d<0?(++this.size,c.push([s,l])):c[d][1]=l,this}pn.prototype.clear=M1,pn.prototype.delete=O1,pn.prototype.get=I1,pn.prototype.has=N1,pn.prototype.set=R1;function mn(s){var l=-1,c=s==null?0:s.length;for(this.clear();++l<c;){var d=s[l];this.set(d[0],d[1])}}function L1(){this.size=0,this.__data__={hash:new ur,map:new(Gi||pn),string:new ur}}function P1(s){var l=go(this,s).delete(s);return this.size-=l?1:0,l}function D1(s){return go(this,s).get(s)}function F1(s){return go(this,s).has(s)}function B1(s,l){var c=go(this,s),d=c.size;return c.set(s,l),this.size+=c.size==d?0:1,this}mn.prototype.clear=L1,mn.prototype.delete=P1,mn.prototype.get=D1,mn.prototype.has=F1,mn.prototype.set=B1;function cr(s){var l=-1,c=s==null?0:s.length;for(this.__data__=new mn;++l<c;)this.add(s[l])}function z1(s){return this.__data__.set(s,f),this}function H1(s){return this.__data__.has(s)}cr.prototype.add=cr.prototype.push=z1,cr.prototype.has=H1;function zt(s){var l=this.__data__=new pn(s);this.size=l.size}function $1(){this.__data__=new pn,this.size=0}function W1(s){var l=this.__data__,c=l.delete(s);return this.size=l.size,c}function U1(s){return this.__data__.get(s)}function V1(s){return this.__data__.has(s)}function K1(s,l){var c=this.__data__;if(c instanceof pn){var d=c.__data__;if(!Gi||d.length<i-1)return d.push([s,l]),this.size=++c.size,this;c=this.__data__=new mn(d)}return c.set(s,l),this.size=c.size,this}zt.prototype.clear=$1,zt.prototype.delete=W1,zt.prototype.get=U1,zt.prototype.has=V1,zt.prototype.set=K1;function md(s,l){var c=Z(s),d=!c&&mr(s),g=!c&&!d&&Pn(s),v=!c&&!d&&!g&&si(s),w=c||d||g||v,_=w?ga(s.length,t1):[],E=_.length;for(var O in s)(l||ye.call(s,O))&&!(w&&(O=="length"||g&&(O=="offset"||O=="parent")||v&&(O=="buffer"||O=="byteLength"||O=="byteOffset")||vn(O,E)))&&_.push(O);return _}function gd(s){var l=s.length;return l?s[Ra(0,l-1)]:t}function G1(s,l){return yo(at(s),fr(l,0,s.length))}function q1(s){return yo(at(s))}function xa(s,l,c){(c!==t&&!Ht(s[l],c)||c===t&&!(l in s))&&gn(s,l,c)}function Yi(s,l,c){var d=s[l];(!(ye.call(s,l)&&Ht(d,c))||c===t&&!(l in s))&&gn(s,l,c)}function ro(s,l){for(var c=s.length;c--;)if(Ht(s[c][0],l))return c;return-1}function J1(s,l,c,d){return In(s,function(g,v,w){l(d,g,c(g),w)}),d}function yd(s,l){return s&&Zt(l,De(l),s)}function j1(s,l){return s&&Zt(l,ct(l),s)}function gn(s,l,c){l=="__proto__"&&Xs?Xs(s,l,{configurable:!0,enumerable:!0,value:c,writable:!0}):s[l]=c}function ka(s,l){for(var c=-1,d=l.length,g=T(d),v=s==null;++c<d;)g[c]=v?t:iu(s,l[c]);return g}function fr(s,l,c){return s===s&&(c!==t&&(s=s<=c?s:c),l!==t&&(s=s>=l?s:l)),s}function Ct(s,l,c,d,g,v){var w,_=l&p,E=l&b,O=l&S;if(c&&(w=g?c(s,d,g,v):c(s)),w!==t)return w;if(!ke(s))return s;var I=Z(s);if(I){if(w=Fb(s),!_)return at(s,w)}else{var R=je(s),z=R==Ps||R==vf;if(Pn(s))return $d(s,_);if(R==hn||R==Kr||z&&!g){if(w=E||z?{}:oh(s),!_)return E?Tb(s,j1(w,s)):Eb(s,yd(w,s))}else{if(!ve[R])return g?s:{};w=Bb(s,R,_)}}v||(v=new zt);var U=v.get(s);if(U)return U;v.set(s,w),Ph(s)?s.forEach(function(j){w.add(Ct(j,l,c,j,s,v))}):Rh(s)&&s.forEach(function(j,re){w.set(re,Ct(j,l,c,re,s,v))});var J=O?E?Va:Ua:E?ct:De,te=I?t:J(s);return kt(te||s,function(j,re){te&&(re=j,j=s[re]),Yi(w,re,Ct(j,l,c,re,s,v))}),w}function Y1(s){var l=De(s);return function(c){return bd(c,s,l)}}function bd(s,l,c){var d=c.length;if(s==null)return!d;for(s=be(s);d--;){var g=c[d],v=l[g],w=s[g];if(w===t&&!(g in s)||!v(w))return!1}return!0}function vd(s,l,c){if(typeof s!="function")throw new Et(a);return rs(function(){s.apply(t,c)},l)}function Xi(s,l,c,d){var g=-1,v=Hs,w=!0,_=s.length,E=[],O=l.length;if(!_)return E;c&&(l=_e(l,mt(c))),d?(v=ca,w=!1):l.length>=i&&(v=Vi,w=!1,l=new cr(l));e:for(;++g<_;){var I=s[g],R=c==null?I:c(I);if(I=d||I!==0?I:0,w&&R===R){for(var z=O;z--;)if(l[z]===R)continue e;E.push(I)}else v(l,R,d)||E.push(I)}return E}var In=Gd(Xt),Sd=Gd(Ta,!0);function X1(s,l){var c=!0;return In(s,function(d,g,v){return c=!!l(d,g,v),c}),c}function io(s,l,c){for(var d=-1,g=s.length;++d<g;){var v=s[d],w=l(v);if(w!=null&&(_===t?w===w&&!yt(w):c(w,_)))var _=w,E=v}return E}function Z1(s,l,c,d){var g=s.length;for(c=Q(c),c<0&&(c=-c>g?0:g+c),d=d===t||d>g?g:Q(d),d<0&&(d+=g),d=c>d?0:Fh(d);c<d;)s[c++]=l;return s}function wd(s,l){var c=[];return In(s,function(d,g,v){l(d,g,v)&&c.push(d)}),c}function We(s,l,c,d,g){var v=-1,w=s.length;for(c||(c=Hb),g||(g=[]);++v<w;){var _=s[v];l>0&&c(_)?l>1?We(_,l-1,c,d,g):An(g,_):d||(g[g.length]=_)}return g}var Ea=qd(),_d=qd(!0);function Xt(s,l){return s&&Ea(s,l,De)}function Ta(s,l){return s&&_d(s,l,De)}function so(s,l){return Cn(l,function(c){return Sn(s[c])})}function dr(s,l){l=Rn(l,s);for(var c=0,d=l.length;s!=null&&c<d;)s=s[Qt(l[c++])];return c&&c==d?s:t}function xd(s,l,c){var d=l(s);return Z(s)?d:An(d,c(s))}function et(s){return s==null?s===t?C0:E0:ar&&ar in be(s)?Lb(s):qb(s)}function Ca(s,l){return s>l}function Q1(s,l){return s!=null&&ye.call(s,l)}function eb(s,l){return s!=null&&l in be(s)}function tb(s,l,c){return s>=Je(l,c)&&s<Pe(l,c)}function Aa(s,l,c){for(var d=c?ca:Hs,g=s[0].length,v=s.length,w=v,_=T(v),E=1/0,O=[];w--;){var I=s[w];w&&l&&(I=_e(I,mt(l))),E=Je(I.length,E),_[w]=!c&&(l||g>=120&&I.length>=120)?new cr(w&&I):t}I=s[0];var R=-1,z=_[0];e:for(;++R<g&&O.length<E;){var U=I[R],J=l?l(U):U;if(U=c||U!==0?U:0,!(z?Vi(z,J):d(O,J,c))){for(w=v;--w;){var te=_[w];if(!(te?Vi(te,J):d(s[w],J,c)))continue e}z&&z.push(J),O.push(U)}}return O}function nb(s,l,c,d){return Xt(s,function(g,v,w){l(d,c(g),v,w)}),d}function Zi(s,l,c){l=Rn(l,s),s=ch(s,l);var d=s==null?s:s[Qt(Mt(l))];return d==null?t:pt(d,s,c)}function kd(s){return Te(s)&&et(s)==Kr}function rb(s){return Te(s)&&et(s)==Ui}function ib(s){return Te(s)&&et(s)==Bi}function Qi(s,l,c,d,g){return s===l?!0:s==null||l==null||!Te(s)&&!Te(l)?s!==s&&l!==l:sb(s,l,c,d,Qi,g)}function sb(s,l,c,d,g,v){var w=Z(s),_=Z(l),E=w?Rs:je(s),O=_?Rs:je(l);E=E==Kr?hn:E,O=O==Kr?hn:O;var I=E==hn,R=O==hn,z=E==O;if(z&&Pn(s)){if(!Pn(l))return!1;w=!0,I=!1}if(z&&!I)return v||(v=new zt),w||si(s)?rh(s,l,c,d,g,v):Nb(s,l,E,c,d,g,v);if(!(c&x)){var U=I&&ye.call(s,"__wrapped__"),J=R&&ye.call(l,"__wrapped__");if(U||J){var te=U?s.value():s,j=J?l.value():l;return v||(v=new zt),g(te,j,c,d,v)}}return z?(v||(v=new zt),Rb(s,l,c,d,g,v)):!1}function ob(s){return Te(s)&&je(s)==Dt}function Ma(s,l,c,d){var g=c.length,v=g,w=!d;if(s==null)return!v;for(s=be(s);g--;){var _=c[g];if(w&&_[2]?_[1]!==s[_[0]]:!(_[0]in s))return!1}for(;++g<v;){_=c[g];var E=_[0],O=s[E],I=_[1];if(w&&_[2]){if(O===t&&!(E in s))return!1}else{var R=new zt;if(d)var z=d(O,I,E,s,l,R);if(!(z===t?Qi(I,O,x|C,d,R):z))return!1}}return!0}function Ed(s){if(!ke(s)||Wb(s))return!1;var l=Sn(s)?o1:Y0;return l.test(pr(s))}function lb(s){return Te(s)&&et(s)==Hi}function ab(s){return Te(s)&&je(s)==Ft}function ub(s){return Te(s)&&xo(s.length)&&!!Se[et(s)]}function Td(s){return typeof s=="function"?s:s==null?ft:typeof s=="object"?Z(s)?Md(s[0],s[1]):Ad(s):Jh(s)}function Oa(s){if(!ns(s))return d1(s);var l=[];for(var c in be(s))ye.call(s,c)&&c!="constructor"&&l.push(c);return l}function cb(s){if(!ke(s))return Gb(s);var l=ns(s),c=[];for(var d in s)d=="constructor"&&(l||!ye.call(s,d))||c.push(d);return c}function Ia(s,l){return s<l}function Cd(s,l){var c=-1,d=ut(s)?T(s.length):[];return In(s,function(g,v,w){d[++c]=l(g,v,w)}),d}function Ad(s){var l=Ga(s);return l.length==1&&l[0][2]?ah(l[0][0],l[0][1]):function(c){return c===s||Ma(c,s,l)}}function Md(s,l){return Ja(s)&&lh(l)?ah(Qt(s),l):function(c){var d=iu(c,s);return d===t&&d===l?su(c,s):Qi(l,d,x|C)}}function oo(s,l,c,d,g){s!==l&&Ea(l,function(v,w){if(g||(g=new zt),ke(v))fb(s,l,w,c,oo,d,g);else{var _=d?d(Ya(s,w),v,w+"",s,l,g):t;_===t&&(_=v),xa(s,w,_)}},ct)}function fb(s,l,c,d,g,v,w){var _=Ya(s,c),E=Ya(l,c),O=w.get(E);if(O){xa(s,c,O);return}var I=v?v(_,E,c+"",s,l,w):t,R=I===t;if(R){var z=Z(E),U=!z&&Pn(E),J=!z&&!U&&si(E);I=E,z||U||J?Z(_)?I=_:Ce(_)?I=at(_):U?(R=!1,I=$d(E,!0)):J?(R=!1,I=Wd(E,!0)):I=[]:is(E)||mr(E)?(I=_,mr(_)?I=Bh(_):(!ke(_)||Sn(_))&&(I=oh(E))):R=!1}R&&(w.set(E,I),g(I,E,d,v,w),w.delete(E)),xa(s,c,I)}function Od(s,l){var c=s.length;if(c)return l+=l<0?c:0,vn(l,c)?s[l]:t}function Id(s,l,c){l.length?l=_e(l,function(v){return Z(v)?function(w){return dr(w,v.length===1?v[0]:v)}:v}):l=[ft];var d=-1;l=_e(l,mt(q()));var g=Cd(s,function(v,w,_){var E=_e(l,function(O){return O(v)});return{criteria:E,index:++d,value:v}});return By(g,function(v,w){return kb(v,w,c)})}function db(s,l){return Nd(s,l,function(c,d){return su(s,d)})}function Nd(s,l,c){for(var d=-1,g=l.length,v={};++d<g;){var w=l[d],_=dr(s,w);c(_,w)&&es(v,Rn(w,s),_)}return v}function hb(s){return function(l){return dr(l,s)}}function Na(s,l,c,d){var g=d?Fy:Jr,v=-1,w=l.length,_=s;for(s===l&&(l=at(l)),c&&(_=_e(s,mt(c)));++v<w;)for(var E=0,O=l[v],I=c?c(O):O;(E=g(_,I,E,d))>-1;)_!==s&&Ys.call(_,E,1),Ys.call(s,E,1);return s}function Rd(s,l){for(var c=s?l.length:0,d=c-1;c--;){var g=l[c];if(c==d||g!==v){var v=g;vn(g)?Ys.call(s,g,1):Da(s,g)}}return s}function Ra(s,l){return s+Qs(hd()*(l-s+1))}function pb(s,l,c,d){for(var g=-1,v=Pe(Zs((l-s)/(c||1)),0),w=T(v);v--;)w[d?v:++g]=s,s+=c;return w}function La(s,l){var c="";if(!s||l<1||l>qe)return c;do l%2&&(c+=s),l=Qs(l/2),l&&(s+=s);while(l);return c}function ne(s,l){return Xa(uh(s,l,ft),s+"")}function mb(s){return gd(oi(s))}function gb(s,l){var c=oi(s);return yo(c,fr(l,0,c.length))}function es(s,l,c,d){if(!ke(s))return s;l=Rn(l,s);for(var g=-1,v=l.length,w=v-1,_=s;_!=null&&++g<v;){var E=Qt(l[g]),O=c;if(E==="__proto__"||E==="constructor"||E==="prototype")return s;if(g!=w){var I=_[E];O=d?d(I,E,_):t,O===t&&(O=ke(I)?I:vn(l[g+1])?[]:{})}Yi(_,E,O),_=_[E]}return s}var Ld=eo?function(s,l){return eo.set(s,l),s}:ft,yb=Xs?function(s,l){return Xs(s,"toString",{configurable:!0,enumerable:!1,value:lu(l),writable:!0})}:ft;function bb(s){return yo(oi(s))}function At(s,l,c){var d=-1,g=s.length;l<0&&(l=-l>g?0:g+l),c=c>g?g:c,c<0&&(c+=g),g=l>c?0:c-l>>>0,l>>>=0;for(var v=T(g);++d<g;)v[d]=s[d+l];return v}function vb(s,l){var c;return In(s,function(d,g,v){return c=l(d,g,v),!c}),!!c}function lo(s,l,c){var d=0,g=s==null?d:s.length;if(typeof l=="number"&&l===l&&g<=Vr){for(;d<g;){var v=d+g>>>1,w=s[v];w!==null&&!yt(w)&&(c?w<=l:w<l)?d=v+1:g=v}return g}return Pa(s,l,ft,c)}function Pa(s,l,c,d){var g=0,v=s==null?0:s.length;if(v===0)return 0;l=c(l);for(var w=l!==l,_=l===null,E=yt(l),O=l===t;g<v;){var I=Qs((g+v)/2),R=c(s[I]),z=R!==t,U=R===null,J=R===R,te=yt(R);if(w)var j=d||J;else O?j=J&&(d||z):_?j=J&&z&&(d||!U):E?j=J&&z&&!U&&(d||!te):U||te?j=!1:j=d?R<=l:R<l;j?g=I+1:v=I}return Je(v,Ur)}function Pd(s,l){for(var c=-1,d=s.length,g=0,v=[];++c<d;){var w=s[c],_=l?l(w):w;if(!c||!Ht(_,E)){var E=_;v[g++]=w===0?0:w}}return v}function Dd(s){return typeof s=="number"?s:yt(s)?Yt:+s}function gt(s){if(typeof s=="string")return s;if(Z(s))return _e(s,gt)+"";if(yt(s))return pd?pd.call(s):"";var l=s+"";return l=="0"&&1/s==-Ze?"-0":l}function Nn(s,l,c){var d=-1,g=Hs,v=s.length,w=!0,_=[],E=_;if(c)w=!1,g=ca;else if(v>=i){var O=l?null:Ob(s);if(O)return Ws(O);w=!1,g=Vi,E=new cr}else E=l?[]:_;e:for(;++d<v;){var I=s[d],R=l?l(I):I;if(I=c||I!==0?I:0,w&&R===R){for(var z=E.length;z--;)if(E[z]===R)continue e;l&&E.push(R),_.push(I)}else g(E,R,c)||(E!==_&&E.push(R),_.push(I))}return _}function Da(s,l){return l=Rn(l,s),s=ch(s,l),s==null||delete s[Qt(Mt(l))]}function Fd(s,l,c,d){return es(s,l,c(dr(s,l)),d)}function ao(s,l,c,d){for(var g=s.length,v=d?g:-1;(d?v--:++v<g)&&l(s[v],v,s););return c?At(s,d?0:v,d?v+1:g):At(s,d?v+1:0,d?g:v)}function Bd(s,l){var c=s;return c instanceof le&&(c=c.value()),fa(l,function(d,g){return g.func.apply(g.thisArg,An([d],g.args))},c)}function Fa(s,l,c){var d=s.length;if(d<2)return d?Nn(s[0]):[];for(var g=-1,v=T(d);++g<d;)for(var w=s[g],_=-1;++_<d;)_!=g&&(v[g]=Xi(v[g]||w,s[_],l,c));return Nn(We(v,1),l,c)}function zd(s,l,c){for(var d=-1,g=s.length,v=l.length,w={};++d<g;){var _=d<v?l[d]:t;c(w,s[d],_)}return w}function Ba(s){return Ce(s)?s:[]}function za(s){return typeof s=="function"?s:ft}function Rn(s,l){return Z(s)?s:Ja(s,l)?[s]:ph(ge(s))}var Sb=ne;function Ln(s,l,c){var d=s.length;return c=c===t?d:c,!l&&c>=d?s:At(s,l,c)}var Hd=l1||function(s){return $e.clearTimeout(s)};function $d(s,l){if(l)return s.slice();var c=s.length,d=ad?ad(c):new s.constructor(c);return s.copy(d),d}function Ha(s){var l=new s.constructor(s.byteLength);return new Js(l).set(new Js(s)),l}function wb(s,l){var c=l?Ha(s.buffer):s.buffer;return new s.constructor(c,s.byteOffset,s.byteLength)}function _b(s){var l=new s.constructor(s.source,kf.exec(s));return l.lastIndex=s.lastIndex,l}function xb(s){return ji?be(ji.call(s)):{}}function Wd(s,l){var c=l?Ha(s.buffer):s.buffer;return new s.constructor(c,s.byteOffset,s.length)}function Ud(s,l){if(s!==l){var c=s!==t,d=s===null,g=s===s,v=yt(s),w=l!==t,_=l===null,E=l===l,O=yt(l);if(!_&&!O&&!v&&s>l||v&&w&&E&&!_&&!O||d&&w&&E||!c&&E||!g)return 1;if(!d&&!v&&!O&&s<l||O&&c&&g&&!d&&!v||_&&c&&g||!w&&g||!E)return-1}return 0}function kb(s,l,c){for(var d=-1,g=s.criteria,v=l.criteria,w=g.length,_=c.length;++d<w;){var E=Ud(g[d],v[d]);if(E){if(d>=_)return E;var O=c[d];return E*(O=="desc"?-1:1)}}return s.index-l.index}function Vd(s,l,c,d){for(var g=-1,v=s.length,w=c.length,_=-1,E=l.length,O=Pe(v-w,0),I=T(E+O),R=!d;++_<E;)I[_]=l[_];for(;++g<w;)(R||g<v)&&(I[c[g]]=s[g]);for(;O--;)I[_++]=s[g++];return I}function Kd(s,l,c,d){for(var g=-1,v=s.length,w=-1,_=c.length,E=-1,O=l.length,I=Pe(v-_,0),R=T(I+O),z=!d;++g<I;)R[g]=s[g];for(var U=g;++E<O;)R[U+E]=l[E];for(;++w<_;)(z||g<v)&&(R[U+c[w]]=s[g++]);return R}function at(s,l){var c=-1,d=s.length;for(l||(l=T(d));++c<d;)l[c]=s[c];return l}function Zt(s,l,c,d){var g=!c;c||(c={});for(var v=-1,w=l.length;++v<w;){var _=l[v],E=d?d(c[_],s[_],_,c,s):t;E===t&&(E=s[_]),g?gn(c,_,E):Yi(c,_,E)}return c}function Eb(s,l){return Zt(s,qa(s),l)}function Tb(s,l){return Zt(s,ih(s),l)}function uo(s,l){return function(c,d){var g=Z(c)?Iy:J1,v=l?l():{};return g(c,s,q(d,2),v)}}function ni(s){return ne(function(l,c){var d=-1,g=c.length,v=g>1?c[g-1]:t,w=g>2?c[2]:t;for(v=s.length>3&&typeof v=="function"?(g--,v):t,w&&tt(c[0],c[1],w)&&(v=g<3?t:v,g=1),l=be(l);++d<g;){var _=c[d];_&&s(l,_,d,v)}return l})}function Gd(s,l){return function(c,d){if(c==null)return c;if(!ut(c))return s(c,d);for(var g=c.length,v=l?g:-1,w=be(c);(l?v--:++v<g)&&d(w[v],v,w)!==!1;);return c}}function qd(s){return function(l,c,d){for(var g=-1,v=be(l),w=d(l),_=w.length;_--;){var E=w[s?_:++g];if(c(v[E],E,v)===!1)break}return l}}function Cb(s,l,c){var d=l&A,g=ts(s);function v(){var w=this&&this!==$e&&this instanceof v?g:s;return w.apply(d?c:this,arguments)}return v}function Jd(s){return function(l){l=ge(l);var c=jr(l)?Bt(l):t,d=c?c[0]:l.charAt(0),g=c?Ln(c,1).join(""):l.slice(1);return d[s]()+g}}function ri(s){return function(l){return fa(Gh(Kh(l).replace(yy,"")),s,"")}}function ts(s){return function(){var l=arguments;switch(l.length){case 0:return new s;case 1:return new s(l[0]);case 2:return new s(l[0],l[1]);case 3:return new s(l[0],l[1],l[2]);case 4:return new s(l[0],l[1],l[2],l[3]);case 5:return new s(l[0],l[1],l[2],l[3],l[4]);case 6:return new s(l[0],l[1],l[2],l[3],l[4],l[5]);case 7:return new s(l[0],l[1],l[2],l[3],l[4],l[5],l[6])}var c=ti(s.prototype),d=s.apply(c,l);return ke(d)?d:c}}function Ab(s,l,c){var d=ts(s);function g(){for(var v=arguments.length,w=T(v),_=v,E=ii(g);_--;)w[_]=arguments[_];var O=v<3&&w[0]!==E&&w[v-1]!==E?[]:Mn(w,E);if(v-=O.length,v<c)return Qd(s,l,co,g.placeholder,t,w,O,t,t,c-v);var I=this&&this!==$e&&this instanceof g?d:s;return pt(I,this,w)}return g}function jd(s){return function(l,c,d){var g=be(l);if(!ut(l)){var v=q(c,3);l=De(l),c=function(_){return v(g[_],_,g)}}var w=s(l,c,d);return w>-1?g[v?l[w]:w]:t}}function Yd(s){return bn(function(l){var c=l.length,d=c,g=Tt.prototype.thru;for(s&&l.reverse();d--;){var v=l[d];if(typeof v!="function")throw new Et(a);if(g&&!w&&mo(v)=="wrapper")var w=new Tt([],!0)}for(d=w?d:c;++d<c;){v=l[d];var _=mo(v),E=_=="wrapper"?Ka(v):t;E&&ja(E[0])&&E[1]==(ue|K|pe|lt)&&!E[4].length&&E[9]==1?w=w[mo(E[0])].apply(w,E[3]):w=v.length==1&&ja(v)?w[_]():w.thru(v)}return function(){var O=arguments,I=O[0];if(w&&O.length==1&&Z(I))return w.plant(I).value();for(var R=0,z=c?l[R].apply(this,O):I;++R<c;)z=l[R].call(this,z);return z}})}function co(s,l,c,d,g,v,w,_,E,O){var I=l&ue,R=l&A,z=l&N,U=l&(K|oe),J=l&Pi,te=z?t:ts(s);function j(){for(var re=arguments.length,ae=T(re),bt=re;bt--;)ae[bt]=arguments[bt];if(U)var nt=ii(j),vt=Hy(ae,nt);if(d&&(ae=Vd(ae,d,g,U)),v&&(ae=Kd(ae,v,w,U)),re-=vt,U&&re<O){var Ae=Mn(ae,nt);return Qd(s,l,co,j.placeholder,c,ae,Ae,_,E,O-re)}var $t=R?c:this,_n=z?$t[s]:s;return re=ae.length,_?ae=Jb(ae,_):J&&re>1&&ae.reverse(),I&&E<re&&(ae.length=E),this&&this!==$e&&this instanceof j&&(_n=te||ts(_n)),_n.apply($t,ae)}return j}function Xd(s,l){return function(c,d){return nb(c,s,l(d),{})}}function fo(s,l){return function(c,d){var g;if(c===t&&d===t)return l;if(c!==t&&(g=c),d!==t){if(g===t)return d;typeof c=="string"||typeof d=="string"?(c=gt(c),d=gt(d)):(c=Dd(c),d=Dd(d)),g=s(c,d)}return g}}function $a(s){return bn(function(l){return l=_e(l,mt(q())),ne(function(c){var d=this;return s(l,function(g){return pt(g,d,c)})})})}function ho(s,l){l=l===t?" ":gt(l);var c=l.length;if(c<2)return c?La(l,s):l;var d=La(l,Zs(s/Yr(l)));return jr(l)?Ln(Bt(d),0,s).join(""):d.slice(0,s)}function Mb(s,l,c,d){var g=l&A,v=ts(s);function w(){for(var _=-1,E=arguments.length,O=-1,I=d.length,R=T(I+E),z=this&&this!==$e&&this instanceof w?v:s;++O<I;)R[O]=d[O];for(;E--;)R[O++]=arguments[++_];return pt(z,g?c:this,R)}return w}function Zd(s){return function(l,c,d){return d&&typeof d!="number"&&tt(l,c,d)&&(c=d=t),l=wn(l),c===t?(c=l,l=0):c=wn(c),d=d===t?l<c?1:-1:wn(d),pb(l,c,d,s)}}function po(s){return function(l,c){return typeof l=="string"&&typeof c=="string"||(l=Ot(l),c=Ot(c)),s(l,c)}}function Qd(s,l,c,d,g,v,w,_,E,O){var I=l&K,R=I?w:t,z=I?t:w,U=I?v:t,J=I?t:v;l|=I?pe:B,l&=~(I?B:pe),l&G||(l&=~(A|N));var te=[s,l,g,U,R,J,z,_,E,O],j=c.apply(t,te);return ja(s)&&fh(j,te),j.placeholder=d,dh(j,s,l)}function Wa(s){var l=Le[s];return function(c,d){if(c=Ot(c),d=d==null?0:Je(Q(d),292),d&&dd(c)){var g=(ge(c)+"e").split("e"),v=l(g[0]+"e"+(+g[1]+d));return g=(ge(v)+"e").split("e"),+(g[0]+"e"+(+g[1]-d))}return l(c)}}var Ob=Qr&&1/Ws(new Qr([,-0]))[1]==Ze?function(s){return new Qr(s)}:cu;function eh(s){return function(l){var c=je(l);return c==Dt?ba(l):c==Ft?qy(l):zy(l,s(l))}}function yn(s,l,c,d,g,v,w,_){var E=l&N;if(!E&&typeof s!="function")throw new Et(a);var O=d?d.length:0;if(O||(l&=~(pe|B),d=g=t),w=w===t?w:Pe(Q(w),0),_=_===t?_:Q(_),O-=g?g.length:0,l&B){var I=d,R=g;d=g=t}var z=E?t:Ka(s),U=[s,l,c,d,g,I,R,v,w,_];if(z&&Kb(U,z),s=U[0],l=U[1],c=U[2],d=U[3],g=U[4],_=U[9]=U[9]===t?E?0:s.length:Pe(U[9]-O,0),!_&&l&(K|oe)&&(l&=~(K|oe)),!l||l==A)var J=Cb(s,l,c);else l==K||l==oe?J=Ab(s,l,_):(l==pe||l==(A|pe))&&!g.length?J=Mb(s,l,c,d):J=co.apply(t,U);var te=z?Ld:fh;return dh(te(J,U),s,l)}function th(s,l,c,d){return s===t||Ht(s,Zr[c])&&!ye.call(d,c)?l:s}function nh(s,l,c,d,g,v){return ke(s)&&ke(l)&&(v.set(l,s),oo(s,l,t,nh,v),v.delete(l)),s}function Ib(s){return is(s)?t:s}function rh(s,l,c,d,g,v){var w=c&x,_=s.length,E=l.length;if(_!=E&&!(w&&E>_))return!1;var O=v.get(s),I=v.get(l);if(O&&I)return O==l&&I==s;var R=-1,z=!0,U=c&C?new cr:t;for(v.set(s,l),v.set(l,s);++R<_;){var J=s[R],te=l[R];if(d)var j=w?d(te,J,R,l,s,v):d(J,te,R,s,l,v);if(j!==t){if(j)continue;z=!1;break}if(U){if(!da(l,function(re,ae){if(!Vi(U,ae)&&(J===re||g(J,re,c,d,v)))return U.push(ae)})){z=!1;break}}else if(!(J===te||g(J,te,c,d,v))){z=!1;break}}return v.delete(s),v.delete(l),z}function Nb(s,l,c,d,g,v,w){switch(c){case Gr:if(s.byteLength!=l.byteLength||s.byteOffset!=l.byteOffset)return!1;s=s.buffer,l=l.buffer;case Ui:return!(s.byteLength!=l.byteLength||!v(new Js(s),new Js(l)));case Fi:case Bi:case zi:return Ht(+s,+l);case Ls:return s.name==l.name&&s.message==l.message;case Hi:case $i:return s==l+"";case Dt:var _=ba;case Ft:var E=d&x;if(_||(_=Ws),s.size!=l.size&&!E)return!1;var O=w.get(s);if(O)return O==l;d|=C,w.set(s,l);var I=rh(_(s),_(l),d,g,v,w);return w.delete(s),I;case Ds:if(ji)return ji.call(s)==ji.call(l)}return!1}function Rb(s,l,c,d,g,v){var w=c&x,_=Ua(s),E=_.length,O=Ua(l),I=O.length;if(E!=I&&!w)return!1;for(var R=E;R--;){var z=_[R];if(!(w?z in l:ye.call(l,z)))return!1}var U=v.get(s),J=v.get(l);if(U&&J)return U==l&&J==s;var te=!0;v.set(s,l),v.set(l,s);for(var j=w;++R<E;){z=_[R];var re=s[z],ae=l[z];if(d)var bt=w?d(ae,re,z,l,s,v):d(re,ae,z,s,l,v);if(!(bt===t?re===ae||g(re,ae,c,d,v):bt)){te=!1;break}j||(j=z=="constructor")}if(te&&!j){var nt=s.constructor,vt=l.constructor;nt!=vt&&"constructor"in s&&"constructor"in l&&!(typeof nt=="function"&&nt instanceof nt&&typeof vt=="function"&&vt instanceof vt)&&(te=!1)}return v.delete(s),v.delete(l),te}function bn(s){return Xa(uh(s,t,bh),s+"")}function Ua(s){return xd(s,De,qa)}function Va(s){return xd(s,ct,ih)}var Ka=eo?function(s){return eo.get(s)}:cu;function mo(s){for(var l=s.name+"",c=ei[l],d=ye.call(ei,l)?c.length:0;d--;){var g=c[d],v=g.func;if(v==null||v==s)return g.name}return l}function ii(s){var l=ye.call(y,"placeholder")?y:s;return l.placeholder}function q(){var s=y.iteratee||au;return s=s===au?Td:s,arguments.length?s(arguments[0],arguments[1]):s}function go(s,l){var c=s.__data__;return $b(l)?c[typeof l=="string"?"string":"hash"]:c.map}function Ga(s){for(var l=De(s),c=l.length;c--;){var d=l[c],g=s[d];l[c]=[d,g,lh(g)]}return l}function hr(s,l){var c=Vy(s,l);return Ed(c)?c:t}function Lb(s){var l=ye.call(s,ar),c=s[ar];try{s[ar]=t;var d=!0}catch{}var g=Gs.call(s);return d&&(l?s[ar]=c:delete s[ar]),g}var qa=Sa?function(s){return s==null?[]:(s=be(s),Cn(Sa(s),function(l){return cd.call(s,l)}))}:fu,ih=Sa?function(s){for(var l=[];s;)An(l,qa(s)),s=js(s);return l}:fu,je=et;(wa&&je(new wa(new ArrayBuffer(1)))!=Gr||Gi&&je(new Gi)!=Dt||_a&&je(_a.resolve())!=Sf||Qr&&je(new Qr)!=Ft||qi&&je(new qi)!=Wi)&&(je=function(s){var l=et(s),c=l==hn?s.constructor:t,d=c?pr(c):"";if(d)switch(d){case g1:return Gr;case y1:return Dt;case b1:return Sf;case v1:return Ft;case S1:return Wi}return l});function Pb(s,l,c){for(var d=-1,g=c.length;++d<g;){var v=c[d],w=v.size;switch(v.type){case"drop":s+=w;break;case"dropRight":l-=w;break;case"take":l=Je(l,s+w);break;case"takeRight":s=Pe(s,l-w);break}}return{start:s,end:l}}function Db(s){var l=s.match(W0);return l?l[1].split(U0):[]}function sh(s,l,c){l=Rn(l,s);for(var d=-1,g=l.length,v=!1;++d<g;){var w=Qt(l[d]);if(!(v=s!=null&&c(s,w)))break;s=s[w]}return v||++d!=g?v:(g=s==null?0:s.length,!!g&&xo(g)&&vn(w,g)&&(Z(s)||mr(s)))}function Fb(s){var l=s.length,c=new s.constructor(l);return l&&typeof s[0]=="string"&&ye.call(s,"index")&&(c.index=s.index,c.input=s.input),c}function oh(s){return typeof s.constructor=="function"&&!ns(s)?ti(js(s)):{}}function Bb(s,l,c){var d=s.constructor;switch(l){case Ui:return Ha(s);case Fi:case Bi:return new d(+s);case Gr:return wb(s,c);case Gl:case ql:case Jl:case jl:case Yl:case Xl:case Zl:case Ql:case ea:return Wd(s,c);case Dt:return new d;case zi:case $i:return new d(s);case Hi:return _b(s);case Ft:return new d;case Ds:return xb(s)}}function zb(s,l){var c=l.length;if(!c)return s;var d=c-1;return l[d]=(c>1?"& ":"")+l[d],l=l.join(c>2?", ":" "),s.replace($0,`{
19
+ 3. "-" cannot repeat`);Ce.customSchemes.push([n,e])}function xM(){Ce.scanner=dM(Ce.customSchemes);for(let n=0;n<Ce.tokenQueue.length;n++)Ce.tokenQueue[n][1]({scanner:Ce.scanner});Ce.parser=gM(Ce.scanner.tokens);for(let n=0;n<Ce.pluginQueue.length;n++)Ce.pluginQueue[n][1]({scanner:Ce.scanner,parser:Ce.parser});Ce.initialized=!0}function i0(n){return Ce.initialized||xM(),yM(Ce.parser.start,n,hM(Ce.scanner.start,n))}function uf(n,e,t){if(e===void 0&&(e=null),t===void 0&&(t=null),e&&typeof e=="object"){if(t)throw Error(`linkifyjs: Invalid link type ${e}; must be a string`);t=e,e=null}const r=new af(t),i=i0(n),o=[];for(let a=0;a<i.length;a++){const c=i[a];c.isLink&&(!e||c.t===e)&&o.push(c.toFormattedObject(r))}return o}function wM(n,e){e===void 0&&(e=null);const t=i0(n);return t.length===1&&t[0].isLink&&(!e||t[0].t===e)}class _M extends Vu{addProps(){return{handlePaste:this._handlePaste}}_handlePaste(e,t,r){if(e.state.selection.empty)return!1;const i=r.content.textBetween(0,r.content.size).trim(),o=wM(i);if(!i||!o)return!1;const a=this._createLinkAttrs(i,r.content);return this.editor.commands.applyLink(a),!0}_createLinkAttrs(e,t){return Ef.query(t,{typeName:te.TEXT,mark:{typeName:fe.LINK},getMark:{typeName:fe.LINK}})?.attrs||{href:e}}}function P(n){return(...e)=>t=>n(t,...e)}function Kl(n){const e=Object.entries(n).reduce((t,[r,i])=>{if(!i)return t;const o=r.replace(/_/g,"-");return`${t}--zw-${o}:${i};`},"");return e?{style:e}:null}function Pr(n){const e=Kl(n);return["span",e?{...e,class:"zw-style"}:{},0]}function kM(n){return n.toLowerCase().replace(/(?:^|\s)\S/g,e=>e.toUpperCase())}function Ht(n,...e){return({editor:t})=>(t.commands[n](...e),!0)}var EM=Object.defineProperty,TM=(n,e,t)=>e in n?EM(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,Ls=(n,e,t)=>TM(n,typeof e!="symbol"?e+"":e,t);const s0=Object.freeze({aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"0ff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"00f",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",burntsienna:"ea7e5d",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"0ff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"f0f",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"663399",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"}),CM=n=>n in s0,AM="[-\\+]?\\d+%?",MM="[-\\+]?\\d*\\.\\d+%?",ir=`(?:${MM})|(?:${AM})`,ff=`[\\s|\\(]+(${ir})[,|\\s]+(${ir})[,|\\s]+(${ir})\\s*\\)?`,df=`[\\s|\\(]+(${ir})[,|\\s]+(${ir})[,|\\s]+(${ir})[,|\\s]+(${ir})\\s*\\)?`,fn=Object.freeze({CSS_UNIT:new RegExp(ir),RGB:new RegExp(`rgb${ff}`),RGBA:new RegExp(`rgba${df}`),HSL:new RegExp(`hsl${ff}`),HSLA:new RegExp(`hsla${df}`),HSV:new RegExp(`hsv${ff}`),HSVA:new RegExp(`hsva${df}`),HEX3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,HEX6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,HEX4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,HEX8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/}),hf=Object.freeze({WINDOW:Symbol("window")});function pf(n,e=0,t=1){return Math.max(e,Math.min(t,n))}function o0(n,e){let t=!1;return function(){t||(n.apply(this,arguments),t=!0,setTimeout(function(){t=!1},e))}}function Dr(n){return n>1||n<-1?n/100:n}const Fr=8,OM="#fff",IM="#e6e6e6";function NM(){const n=document.createElement("canvas");n.width=n.height=Fr*2;const e=n.getContext("2d");return e?(e.fillStyle=OM,e.fillRect(0,0,n.width,n.height),e.fillStyle=IM,e.fillRect(0,0,Fr,Fr),e.translate(Fr,Fr),e.fillRect(0,0,Fr,Fr),n.toDataURL()):null}const l0=3;function Ii(n){return Number.parseFloat(n.toFixed(l0+2).substr(0,l0+2))}function RM(n,e=1){const t=[];let r=0;for(;r<n.length;)t.push(n.substr(r,e)),r+=e;return t}function a0(n){const e=RM(n.slice(1),2).map(r=>parseInt(r,16)),t=e[3]!==void 0?Math.round(e[3]/255*100)/100:1;return{r:e[0],g:e[1],b:e[2],a:t}}function c0({h:n,s:e,v:t,a:r}){const i=a=>{const c=(a+n/60)%6;return t-t*e*Math.max(Math.min(c,4-c,1),0)},o=[i(5),i(3),i(1)].map(a=>Math.round(a*255));return{r:o[0],g:o[1],b:o[2],a:r}}function LM({h:n,s:e,l:t,a:r}){const i=t+e*Math.min(t,1-t),o=i===0?0:2-2*t/i,a=Ii(o),c=Ii(i);return{h:n,s:a,v:c,a:r}}function PM(n){const e=r=>{const i=Math.round(r).toString(16);return("00".substr(0,2-i.length)+i).toUpperCase()};return`#${[e(n.r),e(n.g),e(n.b)].join("")}`}function u0(n){if(!n)return{h:0,s:1,v:1,a:1};const e=n.r/255,t=n.g/255,r=n.b/255,i=Math.max(e,t,r),o=Math.min(e,t,r);let a=0;i!==o&&(i===e?a=60*(0+(t-r)/(i-o)):i===t?a=60*(2+(r-e)/(i-o)):i===r&&(a=60*(4+(e-t)/(i-o)))),a<0&&(a=a+360);const c=i===0?0:(i-o)/i,f=[a,c,i],h=Ii(f[1]),m=Ii(f[2]);return{h:Math.floor(f[0]),s:h,v:m,a:n.a}}function DM(n){return u0(a0(n))}function FM({h:n,s:e,v:t,a:r}){const i=t-t*e/2,o=i===1||i===0?0:(t-i)/Math.min(i,1-i),a=Ii(o),c=Ii(i);return{h:n,s:a,l:c,a:r}}function BM(n){const e=DM(n),t=FM(e),r=a0(n);return{alpha:e.a,hex:n.substr(0,7),hexa:n,hsla:t,hsva:e,hue:e.h,rgba:r}}function mf(n,e,t="0"){return n+t.repeat(Math.max(0,e-n.length))}function zM(n){let e=n;return e.startsWith("#")&&(e=e.slice(1)),e=e.replace(/([^0-9a-f])/gi,"F"),(e.length===3||e.length===4)&&(e=e.split("").map(t=>t+t).join("")),e.length===6?e=mf(e,8,"F"):e=mf(mf(e,6),8,"F"),`#${e}`.toUpperCase().substr(0,9)}function HM(n){return BM(zM(n))}const gf=class Je{constructor(e){Ls(this,"rgba"),Ls(this,"hsva"),Ls(this,"alpha"),this.rgba=e,this.hsva=this.calcHsva(),this.alpha=e.a}static create(e){if(!e)return Je.fromBlack();let t=e.replace(/^\s+/,"").replace(/\s+$/,"").toLowerCase();if(CM(t))t=s0[t];else if(t===this.TRANSPARENT)return Je.fromTransparent();const r=fn.RGB.exec(t)||fn.RGBA.exec(t);if(r){const c=r[4]===void 0?1:r[4];return Je.fromRgba({r:Number.parseInt(r[1]),g:Number.parseInt(r[2]),b:Number.parseInt(r[3]),a:Number.parseFloat(c.toString())})}const i=fn.HSL.exec(t)||fn.HSLA.exec(t);if(i){const c=i[4]===void 0?1:i[4];return Je.fromHsla({h:Number.parseInt(i[1]),s:Number.parseFloat(i[2]),l:Number.parseFloat(i[3]),a:Number.parseFloat(c.toString())})}const o=fn.HSV.exec(t)||fn.HSVA.exec(t);if(o){const c=o[4]===void 0?1:o[4];return Je.fromHsva({h:Number.parseInt(o[1]),s:Number.parseFloat(o[2]),v:Number.parseFloat(o[3]),a:Number.parseFloat(c.toString())})}return fn.HEX8.exec(t)||fn.HEX6.exec(t)||fn.HEX4.exec(t)||fn.HEX3.exec(t)?Je.fromHex(t):Je.fromBlack()}static fromHex(e){const{rgba:t}=HM(e);return new Je(t)}static fromRgba({r:e,g:t,b:r,a:i}){const o=Dr(i);return new Je({r:e,g:t,b:r,a:o})}static fromHsla({h:e,s:t,l:r,a:i}){const o=Dr(t),a=Dr(r),c=Dr(i);return Je.fromHsva(LM({h:e,s:o,l:a,a:c}))}static fromHsva({h:e,s:t,v:r,a:i}){const o=Dr(t),a=Dr(r),c=Dr(i),f=c0({h:e,s:o,v:a,a:c});return new Je(f)}static fromTransparent(){return new Je({r:0,g:0,b:0,a:0})}static fromWhite(){return new Je({r:255,g:255,b:255,a:1})}static fromBlack(){return new Je({r:0,g:0,b:0,a:1})}static isTransparent(e){return Je.create(e).isTransparent()}static isDark(e){return Je.create(e).isDark()}get hex(){return this.toHexString()}get r(){return this.rgba.r}get b(){return this.rgba.b}get g(){return this.rgba.g}get h(){return this.hsva.h}get s(){return this.hsva.s}get v(){return this.hsva.v}setAlpha(e){return this.alpha=e,this}toHexString(){return PM({r:this.r,g:this.g,b:this.b})}toRgbaString(){const e=`${Math.floor(this.alpha*100)}%`;return`rgba(${[this.r,this.g,this.b,e].join(", ")})`}updateRgb(e){this.rgba={...this.rgba,...e},this.hsva=this.calcHsva()}updateHsv(e){this.hsva={...this.hsva,...e},this.rgba=this.calcRgba()}isTransparent(){return this.alpha===0}isDark(){return this.getBrightness()<128}getBrightness(){return(this.rgba.r*299+this.rgba.g*587+this.rgba.b*114)/1e3}calcHsva(){return u0(this.rgba)}calcRgba(){return c0(this.hsva)}};Ls(gf,"TRANSPARENT","transparent"),Ls(gf,"NONE","none");let $M=gf;hf.WINDOW;const f0=3,WM=n=>Number.parseFloat(n.toFixed(f0+2).substr(0,f0+2));hf.WINDOW,hf.WINDOW,o0((n,e)=>{n(e)},20);function d0(n){const e=$M.create(n);return e.alpha===1?e.toHexString():e.toRgbaString()}function h0(n,e){if(!n.includes("em"))return parseInt(n);const t=Ni.getComputedStyle(e).fontSize,r=parseFloat(n)*parseFloat(t);return Math.round(r)}function UM(n,e){return(n.firstElementChild||n).style.fontSize||Ni.getComputedStyle(e).fontSize}function VM(n,e,t){if(!n.includes("px"))return n;const r=UM(e,t),i=h0(r,t);return i?(parseInt(n)/i).toFixed(2):null}const KM={start:er.LEFT,end:er.RIGHT};function GM(n){const e=KM[n]||n;return er.values.includes(e)?e:null}const p0=(n,e,t,r)=>({from:Math.max(r,n.pos),to:Math.min(r+t.nodeSize,e.pos)});function m0(n,e){return n.resolve(e).depth+1}function qM(n,e,t,r){const i=m0(n,r),o=e.from-i<=r,a=e.to+i>=t.nodeSize+r;return o&&a}const JM=(n,e)=>n.eq(e);function jM(n,e,t,r=JM){const i=n.resolve(e).path.reverse();for(const o of i)if(typeof o!="number"){for(const a of o.marks)if(r(a,t))return!0}return!1}function YM(n,e){const t=typeof e=="string"?e:e.name;return n.find(r=>r.type.name===t)}var Gl=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},Ps={exports:{}};var XM=Ps.exports,g0;function ZM(){return g0||(g0=1,function(n,e){(function(){var t,r="4.17.21",i=200,o="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",a="Expected a function",c="Invalid `variable` option passed into `_.template`",f="__lodash_hash_undefined__",h=500,m="__lodash_placeholder__",p=1,y=2,S=4,_=1,C=2,A=1,R=2,K=4,V=8,G=16,ie=32,q=64,ue=128,Tt=256,Fi=512,Xl=30,Bi="...",ar=800,$r=16,cr=1,Wr=2,Rn=3,tt=1/0,Ye=9007199254740991,gn=17976931348623157e292,tn=NaN,nt=4294967295,Ur=nt-1,Vr=nt>>>1,_0=[["ary",ue],["bind",A],["bindKey",R],["curry",V],["curryRight",G],["flip",Fi],["partial",ie],["partialRight",q],["rearg",Tt]],Kr="[object Arguments]",Bs="[object Array]",k0="[object AsyncFunction]",zi="[object Boolean]",Hi="[object Date]",E0="[object DOMException]",zs="[object Error]",Hs="[object Function]",Tf="[object GeneratorFunction]",Wt="[object Map]",$i="[object Number]",T0="[object Null]",yn="[object Object]",Cf="[object Promise]",C0="[object Proxy]",Wi="[object RegExp]",Ut="[object Set]",Ui="[object String]",$s="[object Symbol]",A0="[object Undefined]",Vi="[object WeakMap]",M0="[object WeakSet]",Ki="[object ArrayBuffer]",Gr="[object DataView]",Zl="[object Float32Array]",Ql="[object Float64Array]",ea="[object Int8Array]",ta="[object Int16Array]",na="[object Int32Array]",ra="[object Uint8Array]",ia="[object Uint8ClampedArray]",sa="[object Uint16Array]",oa="[object Uint32Array]",O0=/\b__p \+= '';/g,I0=/\b(__p \+=) '' \+/g,N0=/(__e\(.*?\)|\b__t\)) \+\n'';/g,Af=/&(?:amp|lt|gt|quot|#39);/g,Mf=/[&<>"']/g,R0=RegExp(Af.source),L0=RegExp(Mf.source),P0=/<%-([\s\S]+?)%>/g,D0=/<%([\s\S]+?)%>/g,Of=/<%=([\s\S]+?)%>/g,F0=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,B0=/^\w*$/,z0=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,la=/[\\^$.*+?()[\]{}|]/g,H0=RegExp(la.source),aa=/^\s+/,$0=/\s/,W0=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,U0=/\{\n\/\* \[wrapped with (.+)\] \*/,V0=/,? & /,K0=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,G0=/[()=,{}\[\]\/\s]/,q0=/\\(\\)?/g,J0=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,If=/\w*$/,j0=/^[-+]0x[0-9a-f]+$/i,Y0=/^0b[01]+$/i,X0=/^\[object .+?Constructor\]$/,Z0=/^0o[0-7]+$/i,Q0=/^(?:0|[1-9]\d*)$/,ey=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Ws=/($^)/,ty=/['\n\r\u2028\u2029\\]/g,Us="\\ud800-\\udfff",ny="\\u0300-\\u036f",ry="\\ufe20-\\ufe2f",iy="\\u20d0-\\u20ff",Nf=ny+ry+iy,Rf="\\u2700-\\u27bf",Lf="a-z\\xdf-\\xf6\\xf8-\\xff",sy="\\xac\\xb1\\xd7\\xf7",oy="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",ly="\\u2000-\\u206f",ay=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",Pf="A-Z\\xc0-\\xd6\\xd8-\\xde",Df="\\ufe0e\\ufe0f",Ff=sy+oy+ly+ay,ca="['\u2019]",cy="["+Us+"]",Bf="["+Ff+"]",Vs="["+Nf+"]",zf="\\d+",uy="["+Rf+"]",Hf="["+Lf+"]",$f="[^"+Us+Ff+zf+Rf+Lf+Pf+"]",ua="\\ud83c[\\udffb-\\udfff]",fy="(?:"+Vs+"|"+ua+")",Wf="[^"+Us+"]",fa="(?:\\ud83c[\\udde6-\\uddff]){2}",da="[\\ud800-\\udbff][\\udc00-\\udfff]",qr="["+Pf+"]",Uf="\\u200d",Vf="(?:"+Hf+"|"+$f+")",dy="(?:"+qr+"|"+$f+")",Kf="(?:"+ca+"(?:d|ll|m|re|s|t|ve))?",Gf="(?:"+ca+"(?:D|LL|M|RE|S|T|VE))?",qf=fy+"?",Jf="["+Df+"]?",hy="(?:"+Uf+"(?:"+[Wf,fa,da].join("|")+")"+Jf+qf+")*",py="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",my="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",jf=Jf+qf+hy,gy="(?:"+[uy,fa,da].join("|")+")"+jf,yy="(?:"+[Wf+Vs+"?",Vs,fa,da,cy].join("|")+")",by=RegExp(ca,"g"),vy=RegExp(Vs,"g"),ha=RegExp(ua+"(?="+ua+")|"+yy+jf,"g"),Sy=RegExp([qr+"?"+Hf+"+"+Kf+"(?="+[Bf,qr,"$"].join("|")+")",dy+"+"+Gf+"(?="+[Bf,qr+Vf,"$"].join("|")+")",qr+"?"+Vf+"+"+Kf,qr+"+"+Gf,my,py,zf,gy].join("|"),"g"),xy=RegExp("["+Uf+Us+Nf+Df+"]"),wy=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,_y=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],ky=-1,xe={};xe[Zl]=xe[Ql]=xe[ea]=xe[ta]=xe[na]=xe[ra]=xe[ia]=xe[sa]=xe[oa]=!0,xe[Kr]=xe[Bs]=xe[Ki]=xe[zi]=xe[Gr]=xe[Hi]=xe[zs]=xe[Hs]=xe[Wt]=xe[$i]=xe[yn]=xe[Wi]=xe[Ut]=xe[Ui]=xe[Vi]=!1;var Se={};Se[Kr]=Se[Bs]=Se[Ki]=Se[Gr]=Se[zi]=Se[Hi]=Se[Zl]=Se[Ql]=Se[ea]=Se[ta]=Se[na]=Se[Wt]=Se[$i]=Se[yn]=Se[Wi]=Se[Ut]=Se[Ui]=Se[$s]=Se[ra]=Se[ia]=Se[sa]=Se[oa]=!0,Se[zs]=Se[Hs]=Se[Vi]=!1;var Ey={\u00C0:"A",\u00C1:"A",\u00C2:"A",\u00C3:"A",\u00C4:"A",\u00C5:"A",\u00E0:"a",\u00E1:"a",\u00E2:"a",\u00E3:"a",\u00E4:"a",\u00E5:"a",\u00C7:"C",\u00E7:"c",\u00D0:"D",\u00F0:"d",\u00C8:"E",\u00C9:"E",\u00CA:"E",\u00CB:"E",\u00E8:"e",\u00E9:"e",\u00EA:"e",\u00EB:"e",\u00CC:"I",\u00CD:"I",\u00CE:"I",\u00CF:"I",\u00EC:"i",\u00ED:"i",\u00EE:"i",\u00EF:"i",\u00D1:"N",\u00F1:"n",\u00D2:"O",\u00D3:"O",\u00D4:"O",\u00D5:"O",\u00D6:"O",\u00D8:"O",\u00F2:"o",\u00F3:"o",\u00F4:"o",\u00F5:"o",\u00F6:"o",\u00F8:"o",\u00D9:"U",\u00DA:"U",\u00DB:"U",\u00DC:"U",\u00F9:"u",\u00FA:"u",\u00FB:"u",\u00FC:"u",\u00DD:"Y",\u00FD:"y",\u00FF:"y",\u00C6:"Ae",\u00E6:"ae",\u00DE:"Th",\u00FE:"th",\u00DF:"ss",\u0100:"A",\u0102:"A",\u0104:"A",\u0101:"a",\u0103:"a",\u0105:"a",\u0106:"C",\u0108:"C",\u010A:"C",\u010C:"C",\u0107:"c",\u0109:"c",\u010B:"c",\u010D:"c",\u010E:"D",\u0110:"D",\u010F:"d",\u0111:"d",\u0112:"E",\u0114:"E",\u0116:"E",\u0118:"E",\u011A:"E",\u0113:"e",\u0115:"e",\u0117:"e",\u0119:"e",\u011B:"e",\u011C:"G",\u011E:"G",\u0120:"G",\u0122:"G",\u011D:"g",\u011F:"g",\u0121:"g",\u0123:"g",\u0124:"H",\u0126:"H",\u0125:"h",\u0127:"h",\u0128:"I",\u012A:"I",\u012C:"I",\u012E:"I",\u0130:"I",\u0129:"i",\u012B:"i",\u012D:"i",\u012F:"i",\u0131:"i",\u0134:"J",\u0135:"j",\u0136:"K",\u0137:"k",\u0138:"k",\u0139:"L",\u013B:"L",\u013D:"L",\u013F:"L",\u0141:"L",\u013A:"l",\u013C:"l",\u013E:"l",\u0140:"l",\u0142:"l",\u0143:"N",\u0145:"N",\u0147:"N",\u014A:"N",\u0144:"n",\u0146:"n",\u0148:"n",\u014B:"n",\u014C:"O",\u014E:"O",\u0150:"O",\u014D:"o",\u014F:"o",\u0151:"o",\u0154:"R",\u0156:"R",\u0158:"R",\u0155:"r",\u0157:"r",\u0159:"r",\u015A:"S",\u015C:"S",\u015E:"S",\u0160:"S",\u015B:"s",\u015D:"s",\u015F:"s",\u0161:"s",\u0162:"T",\u0164:"T",\u0166:"T",\u0163:"t",\u0165:"t",\u0167:"t",\u0168:"U",\u016A:"U",\u016C:"U",\u016E:"U",\u0170:"U",\u0172:"U",\u0169:"u",\u016B:"u",\u016D:"u",\u016F:"u",\u0171:"u",\u0173:"u",\u0174:"W",\u0175:"w",\u0176:"Y",\u0177:"y",\u0178:"Y",\u0179:"Z",\u017B:"Z",\u017D:"Z",\u017A:"z",\u017C:"z",\u017E:"z",\u0132:"IJ",\u0133:"ij",\u0152:"Oe",\u0153:"oe",\u0149:"'n",\u017F:"s"},Ty={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},Cy={"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#39;":"'"},Ay={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},My=parseFloat,Oy=parseInt,Yf=typeof Gl=="object"&&Gl&&Gl.Object===Object&&Gl,Iy=typeof self=="object"&&self&&self.Object===Object&&self,Ue=Yf||Iy||Function("return this")(),pa=e&&!e.nodeType&&e,ur=pa&&!0&&n&&!n.nodeType&&n,Xf=ur&&ur.exports===pa,ma=Xf&&Yf.process,Ct=function(){try{var k=ur&&ur.require&&ur.require("util").types;return k||ma&&ma.binding&&ma.binding("util")}catch{}}(),Zf=Ct&&Ct.isArrayBuffer,Qf=Ct&&Ct.isDate,ed=Ct&&Ct.isMap,td=Ct&&Ct.isRegExp,nd=Ct&&Ct.isSet,rd=Ct&&Ct.isTypedArray;function gt(k,M,T){switch(T.length){case 0:return k.call(M);case 1:return k.call(M,T[0]);case 2:return k.call(M,T[0],T[1]);case 3:return k.call(M,T[0],T[1],T[2])}return k.apply(M,T)}function Ny(k,M,T,z){for(var Z=-1,me=k==null?0:k.length;++Z<me;){var Pe=k[Z];M(z,Pe,T(Pe),k)}return z}function At(k,M){for(var T=-1,z=k==null?0:k.length;++T<z&&M(k[T],T,k)!==!1;);return k}function Ry(k,M){for(var T=k==null?0:k.length;T--&&M(k[T],T,k)!==!1;);return k}function id(k,M){for(var T=-1,z=k==null?0:k.length;++T<z;)if(!M(k[T],T,k))return!1;return!0}function Ln(k,M){for(var T=-1,z=k==null?0:k.length,Z=0,me=[];++T<z;){var Pe=k[T];M(Pe,T,k)&&(me[Z++]=Pe)}return me}function Ks(k,M){var T=k==null?0:k.length;return!!T&&Jr(k,M,0)>-1}function ga(k,M,T){for(var z=-1,Z=k==null?0:k.length;++z<Z;)if(T(M,k[z]))return!0;return!1}function _e(k,M){for(var T=-1,z=k==null?0:k.length,Z=Array(z);++T<z;)Z[T]=M(k[T],T,k);return Z}function Pn(k,M){for(var T=-1,z=M.length,Z=k.length;++T<z;)k[Z+T]=M[T];return k}function ya(k,M,T,z){var Z=-1,me=k==null?0:k.length;for(z&&me&&(T=k[++Z]);++Z<me;)T=M(T,k[Z],Z,k);return T}function Ly(k,M,T,z){var Z=k==null?0:k.length;for(z&&Z&&(T=k[--Z]);Z--;)T=M(T,k[Z],Z,k);return T}function ba(k,M){for(var T=-1,z=k==null?0:k.length;++T<z;)if(M(k[T],T,k))return!0;return!1}var Py=va("length");function Dy(k){return k.split("")}function Fy(k){return k.match(K0)||[]}function sd(k,M,T){var z;return T(k,function(Z,me,Pe){if(M(Z,me,Pe))return z=me,!1}),z}function Gs(k,M,T,z){for(var Z=k.length,me=T+(z?1:-1);z?me--:++me<Z;)if(M(k[me],me,k))return me;return-1}function Jr(k,M,T){return M===M?jy(k,M,T):Gs(k,od,T)}function By(k,M,T,z){for(var Z=T-1,me=k.length;++Z<me;)if(z(k[Z],M))return Z;return-1}function od(k){return k!==k}function ld(k,M){var T=k==null?0:k.length;return T?xa(k,M)/T:tn}function va(k){return function(M){return M==null?t:M[k]}}function Sa(k){return function(M){return k==null?t:k[M]}}function ad(k,M,T,z,Z){return Z(k,function(me,Pe,ve){T=z?(z=!1,me):M(T,me,Pe,ve)}),T}function zy(k,M){var T=k.length;for(k.sort(M);T--;)k[T]=k[T].value;return k}function xa(k,M){for(var T,z=-1,Z=k.length;++z<Z;){var me=M(k[z]);me!==t&&(T=T===t?me:T+me)}return T}function wa(k,M){for(var T=-1,z=Array(k);++T<k;)z[T]=M(T);return z}function Hy(k,M){return _e(M,function(T){return[T,k[T]]})}function cd(k){return k&&k.slice(0,hd(k)+1).replace(aa,"")}function yt(k){return function(M){return k(M)}}function _a(k,M){return _e(M,function(T){return k[T]})}function Gi(k,M){return k.has(M)}function ud(k,M){for(var T=-1,z=k.length;++T<z&&Jr(M,k[T],0)>-1;);return T}function fd(k,M){for(var T=k.length;T--&&Jr(M,k[T],0)>-1;);return T}function $y(k,M){for(var T=k.length,z=0;T--;)k[T]===M&&++z;return z}var Wy=Sa(Ey),Uy=Sa(Ty);function Vy(k){return"\\"+Ay[k]}function Ky(k,M){return k==null?t:k[M]}function jr(k){return xy.test(k)}function Gy(k){return wy.test(k)}function qy(k){for(var M,T=[];!(M=k.next()).done;)T.push(M.value);return T}function ka(k){var M=-1,T=Array(k.size);return k.forEach(function(z,Z){T[++M]=[Z,z]}),T}function dd(k,M){return function(T){return k(M(T))}}function Dn(k,M){for(var T=-1,z=k.length,Z=0,me=[];++T<z;){var Pe=k[T];(Pe===M||Pe===m)&&(k[T]=m,me[Z++]=T)}return me}function qs(k){var M=-1,T=Array(k.size);return k.forEach(function(z){T[++M]=z}),T}function Jy(k){var M=-1,T=Array(k.size);return k.forEach(function(z){T[++M]=[z,z]}),T}function jy(k,M,T){for(var z=T-1,Z=k.length;++z<Z;)if(k[z]===M)return z;return-1}function Yy(k,M,T){for(var z=T+1;z--;)if(k[z]===M)return z;return z}function Yr(k){return jr(k)?Zy(k):Py(k)}function Vt(k){return jr(k)?Qy(k):Dy(k)}function hd(k){for(var M=k.length;M--&&$0.test(k.charAt(M)););return M}var Xy=Sa(Cy);function Zy(k){for(var M=ha.lastIndex=0;ha.test(k);)++M;return M}function Qy(k){return k.match(ha)||[]}function e1(k){return k.match(Sy)||[]}var t1=function k(M){M=M==null?Ue:Xr.defaults(Ue.Object(),M,Xr.pick(Ue,_y));var T=M.Array,z=M.Date,Z=M.Error,me=M.Function,Pe=M.Math,ve=M.Object,Ea=M.RegExp,n1=M.String,Mt=M.TypeError,Js=T.prototype,r1=me.prototype,Zr=ve.prototype,js=M["__core-js_shared__"],Ys=r1.toString,be=Zr.hasOwnProperty,i1=0,pd=function(){var s=/[^.]+$/.exec(js&&js.keys&&js.keys.IE_PROTO||"");return s?"Symbol(src)_1."+s:""}(),Xs=Zr.toString,s1=Ys.call(ve),o1=Ue._,l1=Ea("^"+Ys.call(be).replace(la,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Zs=Xf?M.Buffer:t,Fn=M.Symbol,Qs=M.Uint8Array,md=Zs?Zs.allocUnsafe:t,eo=dd(ve.getPrototypeOf,ve),gd=ve.create,yd=Zr.propertyIsEnumerable,to=Js.splice,bd=Fn?Fn.isConcatSpreadable:t,qi=Fn?Fn.iterator:t,fr=Fn?Fn.toStringTag:t,no=function(){try{var s=gr(ve,"defineProperty");return s({},"",{}),s}catch{}}(),a1=M.clearTimeout!==Ue.clearTimeout&&M.clearTimeout,c1=z&&z.now!==Ue.Date.now&&z.now,u1=M.setTimeout!==Ue.setTimeout&&M.setTimeout,ro=Pe.ceil,io=Pe.floor,Ta=ve.getOwnPropertySymbols,f1=Zs?Zs.isBuffer:t,vd=M.isFinite,d1=Js.join,h1=dd(ve.keys,ve),De=Pe.max,Xe=Pe.min,p1=z.now,m1=M.parseInt,Sd=Pe.random,g1=Js.reverse,Ca=gr(M,"DataView"),Ji=gr(M,"Map"),Aa=gr(M,"Promise"),Qr=gr(M,"Set"),ji=gr(M,"WeakMap"),Yi=gr(ve,"create"),so=ji&&new ji,ei={},y1=yr(Ca),b1=yr(Ji),v1=yr(Aa),S1=yr(Qr),x1=yr(ji),oo=Fn?Fn.prototype:t,Xi=oo?oo.valueOf:t,xd=oo?oo.toString:t;function b(s){if(Ae(s)&&!Q(s)&&!(s instanceof le)){if(s instanceof Ot)return s;if(be.call(s,"__wrapped__"))return wh(s)}return new Ot(s)}var ti=function(){function s(){}return function(l){if(!Ee(l))return{};if(gd)return gd(l);s.prototype=l;var u=new s;return s.prototype=t,u}}();function lo(){}function Ot(s,l){this.__wrapped__=s,this.__actions__=[],this.__chain__=!!l,this.__index__=0,this.__values__=t}b.templateSettings={escape:P0,evaluate:D0,interpolate:Of,variable:"",imports:{_:b}},b.prototype=lo.prototype,b.prototype.constructor=b,Ot.prototype=ti(lo.prototype),Ot.prototype.constructor=Ot;function le(s){this.__wrapped__=s,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=nt,this.__views__=[]}function w1(){var s=new le(this.__wrapped__);return s.__actions__=ut(this.__actions__),s.__dir__=this.__dir__,s.__filtered__=this.__filtered__,s.__iteratees__=ut(this.__iteratees__),s.__takeCount__=this.__takeCount__,s.__views__=ut(this.__views__),s}function _1(){if(this.__filtered__){var s=new le(this);s.__dir__=-1,s.__filtered__=!0}else s=this.clone(),s.__dir__*=-1;return s}function k1(){var s=this.__wrapped__.value(),l=this.__dir__,u=Q(s),d=l<0,g=u?s.length:0,v=Db(0,g,this.__views__),x=v.start,w=v.end,E=w-x,O=d?w:x-1,I=this.__iteratees__,N=I.length,B=0,W=Xe(E,this.__takeCount__);if(!u||!d&&g==E&&W==E)return Kd(s,this.__actions__);var j=[];e:for(;E--&&B<W;){O+=l;for(var ne=-1,Y=s[O];++ne<N;){var se=I[ne],ce=se.iteratee,St=se.type,st=ce(Y);if(St==Wr)Y=st;else if(!st){if(St==cr)continue e;break e}}j[B++]=Y}return j}le.prototype=ti(lo.prototype),le.prototype.constructor=le;function dr(s){var l=-1,u=s==null?0:s.length;for(this.clear();++l<u;){var d=s[l];this.set(d[0],d[1])}}function E1(){this.__data__=Yi?Yi(null):{},this.size=0}function T1(s){var l=this.has(s)&&delete this.__data__[s];return this.size-=l?1:0,l}function C1(s){var l=this.__data__;if(Yi){var u=l[s];return u===f?t:u}return be.call(l,s)?l[s]:t}function A1(s){var l=this.__data__;return Yi?l[s]!==t:be.call(l,s)}function M1(s,l){var u=this.__data__;return this.size+=this.has(s)?0:1,u[s]=Yi&&l===t?f:l,this}dr.prototype.clear=E1,dr.prototype.delete=T1,dr.prototype.get=C1,dr.prototype.has=A1,dr.prototype.set=M1;function bn(s){var l=-1,u=s==null?0:s.length;for(this.clear();++l<u;){var d=s[l];this.set(d[0],d[1])}}function O1(){this.__data__=[],this.size=0}function I1(s){var l=this.__data__,u=ao(l,s);if(u<0)return!1;var d=l.length-1;return u==d?l.pop():to.call(l,u,1),--this.size,!0}function N1(s){var l=this.__data__,u=ao(l,s);return u<0?t:l[u][1]}function R1(s){return ao(this.__data__,s)>-1}function L1(s,l){var u=this.__data__,d=ao(u,s);return d<0?(++this.size,u.push([s,l])):u[d][1]=l,this}bn.prototype.clear=O1,bn.prototype.delete=I1,bn.prototype.get=N1,bn.prototype.has=R1,bn.prototype.set=L1;function vn(s){var l=-1,u=s==null?0:s.length;for(this.clear();++l<u;){var d=s[l];this.set(d[0],d[1])}}function P1(){this.size=0,this.__data__={hash:new dr,map:new(Ji||bn),string:new dr}}function D1(s){var l=xo(this,s).delete(s);return this.size-=l?1:0,l}function F1(s){return xo(this,s).get(s)}function B1(s){return xo(this,s).has(s)}function z1(s,l){var u=xo(this,s),d=u.size;return u.set(s,l),this.size+=u.size==d?0:1,this}vn.prototype.clear=P1,vn.prototype.delete=D1,vn.prototype.get=F1,vn.prototype.has=B1,vn.prototype.set=z1;function hr(s){var l=-1,u=s==null?0:s.length;for(this.__data__=new vn;++l<u;)this.add(s[l])}function H1(s){return this.__data__.set(s,f),this}function $1(s){return this.__data__.has(s)}hr.prototype.add=hr.prototype.push=H1,hr.prototype.has=$1;function Kt(s){var l=this.__data__=new bn(s);this.size=l.size}function W1(){this.__data__=new bn,this.size=0}function U1(s){var l=this.__data__,u=l.delete(s);return this.size=l.size,u}function V1(s){return this.__data__.get(s)}function K1(s){return this.__data__.has(s)}function G1(s,l){var u=this.__data__;if(u instanceof bn){var d=u.__data__;if(!Ji||d.length<i-1)return d.push([s,l]),this.size=++u.size,this;u=this.__data__=new vn(d)}return u.set(s,l),this.size=u.size,this}Kt.prototype.clear=W1,Kt.prototype.delete=U1,Kt.prototype.get=V1,Kt.prototype.has=K1,Kt.prototype.set=G1;function wd(s,l){var u=Q(s),d=!u&&br(s),g=!u&&!d&&Wn(s),v=!u&&!d&&!g&&si(s),x=u||d||g||v,w=x?wa(s.length,n1):[],E=w.length;for(var O in s)(l||be.call(s,O))&&!(x&&(O=="length"||g&&(O=="offset"||O=="parent")||v&&(O=="buffer"||O=="byteLength"||O=="byteOffset")||_n(O,E)))&&w.push(O);return w}function _d(s){var l=s.length;return l?s[za(0,l-1)]:t}function q1(s,l){return wo(ut(s),pr(l,0,s.length))}function J1(s){return wo(ut(s))}function Ma(s,l,u){(u!==t&&!Gt(s[l],u)||u===t&&!(l in s))&&Sn(s,l,u)}function Zi(s,l,u){var d=s[l];(!(be.call(s,l)&&Gt(d,u))||u===t&&!(l in s))&&Sn(s,l,u)}function ao(s,l){for(var u=s.length;u--;)if(Gt(s[u][0],l))return u;return-1}function j1(s,l,u,d){return Bn(s,function(g,v,x){l(d,g,u(g),x)}),d}function kd(s,l){return s&&rn(l,Fe(l),s)}function Y1(s,l){return s&&rn(l,dt(l),s)}function Sn(s,l,u){l=="__proto__"&&no?no(s,l,{configurable:!0,enumerable:!0,value:u,writable:!0}):s[l]=u}function Oa(s,l){for(var u=-1,d=l.length,g=T(d),v=s==null;++u<d;)g[u]=v?t:uc(s,l[u]);return g}function pr(s,l,u){return s===s&&(u!==t&&(s=s<=u?s:u),l!==t&&(s=s>=l?s:l)),s}function It(s,l,u,d,g,v){var x,w=l&p,E=l&y,O=l&S;if(u&&(x=g?u(s,d,g,v):u(s)),x!==t)return x;if(!Ee(s))return s;var I=Q(s);if(I){if(x=Bb(s),!w)return ut(s,x)}else{var N=Ze(s),B=N==Hs||N==Tf;if(Wn(s))return Jd(s,w);if(N==yn||N==Kr||B&&!g){if(x=E||B?{}:hh(s),!w)return E?Cb(s,Y1(x,s)):Tb(s,kd(x,s))}else{if(!Se[N])return g?s:{};x=zb(s,N,w)}}v||(v=new Kt);var W=v.get(s);if(W)return W;v.set(s,x),Wh(s)?s.forEach(function(Y){x.add(It(Y,l,u,Y,s,v))}):Hh(s)&&s.forEach(function(Y,se){x.set(se,It(Y,l,u,se,s,v))});var j=O?E?Ya:ja:E?dt:Fe,ne=I?t:j(s);return At(ne||s,function(Y,se){ne&&(se=Y,Y=s[se]),Zi(x,se,It(Y,l,u,se,s,v))}),x}function X1(s){var l=Fe(s);return function(u){return Ed(u,s,l)}}function Ed(s,l,u){var d=u.length;if(s==null)return!d;for(s=ve(s);d--;){var g=u[d],v=l[g],x=s[g];if(x===t&&!(g in s)||!v(x))return!1}return!0}function Td(s,l,u){if(typeof s!="function")throw new Mt(a);return ss(function(){s.apply(t,u)},l)}function Qi(s,l,u,d){var g=-1,v=Ks,x=!0,w=s.length,E=[],O=l.length;if(!w)return E;u&&(l=_e(l,yt(u))),d?(v=ga,x=!1):l.length>=i&&(v=Gi,x=!1,l=new hr(l));e:for(;++g<w;){var I=s[g],N=u==null?I:u(I);if(I=d||I!==0?I:0,x&&N===N){for(var B=O;B--;)if(l[B]===N)continue e;E.push(I)}else v(l,N,d)||E.push(I)}return E}var Bn=Qd(nn),Cd=Qd(Na,!0);function Z1(s,l){var u=!0;return Bn(s,function(d,g,v){return u=!!l(d,g,v),u}),u}function co(s,l,u){for(var d=-1,g=s.length;++d<g;){var v=s[d],x=l(v);if(x!=null&&(w===t?x===x&&!vt(x):u(x,w)))var w=x,E=v}return E}function Q1(s,l,u,d){var g=s.length;for(u=ee(u),u<0&&(u=-u>g?0:g+u),d=d===t||d>g?g:ee(d),d<0&&(d+=g),d=u>d?0:Vh(d);u<d;)s[u++]=l;return s}function Ad(s,l){var u=[];return Bn(s,function(d,g,v){l(d,g,v)&&u.push(d)}),u}function Ve(s,l,u,d,g){var v=-1,x=s.length;for(u||(u=$b),g||(g=[]);++v<x;){var w=s[v];l>0&&u(w)?l>1?Ve(w,l-1,u,d,g):Pn(g,w):d||(g[g.length]=w)}return g}var Ia=eh(),Md=eh(!0);function nn(s,l){return s&&Ia(s,l,Fe)}function Na(s,l){return s&&Md(s,l,Fe)}function uo(s,l){return Ln(l,function(u){return kn(s[u])})}function mr(s,l){l=Hn(l,s);for(var u=0,d=l.length;s!=null&&u<d;)s=s[sn(l[u++])];return u&&u==d?s:t}function Od(s,l,u){var d=l(s);return Q(s)?d:Pn(d,u(s))}function rt(s){return s==null?s===t?A0:T0:fr&&fr in ve(s)?Pb(s):Jb(s)}function Ra(s,l){return s>l}function eb(s,l){return s!=null&&be.call(s,l)}function tb(s,l){return s!=null&&l in ve(s)}function nb(s,l,u){return s>=Xe(l,u)&&s<De(l,u)}function La(s,l,u){for(var d=u?ga:Ks,g=s[0].length,v=s.length,x=v,w=T(v),E=1/0,O=[];x--;){var I=s[x];x&&l&&(I=_e(I,yt(l))),E=Xe(I.length,E),w[x]=!u&&(l||g>=120&&I.length>=120)?new hr(x&&I):t}I=s[0];var N=-1,B=w[0];e:for(;++N<g&&O.length<E;){var W=I[N],j=l?l(W):W;if(W=u||W!==0?W:0,!(B?Gi(B,j):d(O,j,u))){for(x=v;--x;){var ne=w[x];if(!(ne?Gi(ne,j):d(s[x],j,u)))continue e}B&&B.push(j),O.push(W)}}return O}function rb(s,l,u,d){return nn(s,function(g,v,x){l(d,u(g),v,x)}),d}function es(s,l,u){l=Hn(l,s),s=yh(s,l);var d=s==null?s:s[sn(Rt(l))];return d==null?t:gt(d,s,u)}function Id(s){return Ae(s)&&rt(s)==Kr}function ib(s){return Ae(s)&&rt(s)==Ki}function sb(s){return Ae(s)&&rt(s)==Hi}function ts(s,l,u,d,g){return s===l?!0:s==null||l==null||!Ae(s)&&!Ae(l)?s!==s&&l!==l:ob(s,l,u,d,ts,g)}function ob(s,l,u,d,g,v){var x=Q(s),w=Q(l),E=x?Bs:Ze(s),O=w?Bs:Ze(l);E=E==Kr?yn:E,O=O==Kr?yn:O;var I=E==yn,N=O==yn,B=E==O;if(B&&Wn(s)){if(!Wn(l))return!1;x=!0,I=!1}if(B&&!I)return v||(v=new Kt),x||si(s)?uh(s,l,u,d,g,v):Rb(s,l,E,u,d,g,v);if(!(u&_)){var W=I&&be.call(s,"__wrapped__"),j=N&&be.call(l,"__wrapped__");if(W||j){var ne=W?s.value():s,Y=j?l.value():l;return v||(v=new Kt),g(ne,Y,u,d,v)}}return B?(v||(v=new Kt),Lb(s,l,u,d,g,v)):!1}function lb(s){return Ae(s)&&Ze(s)==Wt}function Pa(s,l,u,d){var g=u.length,v=g,x=!d;if(s==null)return!v;for(s=ve(s);g--;){var w=u[g];if(x&&w[2]?w[1]!==s[w[0]]:!(w[0]in s))return!1}for(;++g<v;){w=u[g];var E=w[0],O=s[E],I=w[1];if(x&&w[2]){if(O===t&&!(E in s))return!1}else{var N=new Kt;if(d)var B=d(O,I,E,s,l,N);if(!(B===t?ts(I,O,_|C,d,N):B))return!1}}return!0}function Nd(s){if(!Ee(s)||Ub(s))return!1;var l=kn(s)?l1:X0;return l.test(yr(s))}function ab(s){return Ae(s)&&rt(s)==Wi}function cb(s){return Ae(s)&&Ze(s)==Ut}function ub(s){return Ae(s)&&Ao(s.length)&&!!xe[rt(s)]}function Rd(s){return typeof s=="function"?s:s==null?ht:typeof s=="object"?Q(s)?Dd(s[0],s[1]):Pd(s):tp(s)}function Da(s){if(!is(s))return h1(s);var l=[];for(var u in ve(s))be.call(s,u)&&u!="constructor"&&l.push(u);return l}function fb(s){if(!Ee(s))return qb(s);var l=is(s),u=[];for(var d in s)d=="constructor"&&(l||!be.call(s,d))||u.push(d);return u}function Fa(s,l){return s<l}function Ld(s,l){var u=-1,d=ft(s)?T(s.length):[];return Bn(s,function(g,v,x){d[++u]=l(g,v,x)}),d}function Pd(s){var l=Za(s);return l.length==1&&l[0][2]?mh(l[0][0],l[0][1]):function(u){return u===s||Pa(u,s,l)}}function Dd(s,l){return ec(s)&&ph(l)?mh(sn(s),l):function(u){var d=uc(u,s);return d===t&&d===l?fc(u,s):ts(l,d,_|C)}}function fo(s,l,u,d,g){s!==l&&Ia(l,function(v,x){if(g||(g=new Kt),Ee(v))db(s,l,x,u,fo,d,g);else{var w=d?d(nc(s,x),v,x+"",s,l,g):t;w===t&&(w=v),Ma(s,x,w)}},dt)}function db(s,l,u,d,g,v,x){var w=nc(s,u),E=nc(l,u),O=x.get(E);if(O){Ma(s,u,O);return}var I=v?v(w,E,u+"",s,l,x):t,N=I===t;if(N){var B=Q(E),W=!B&&Wn(E),j=!B&&!W&&si(E);I=E,B||W||j?Q(w)?I=w:Me(w)?I=ut(w):W?(N=!1,I=Jd(E,!0)):j?(N=!1,I=jd(E,!0)):I=[]:ls(E)||br(E)?(I=w,br(w)?I=Kh(w):(!Ee(w)||kn(w))&&(I=hh(E))):N=!1}N&&(x.set(E,I),g(I,E,d,v,x),x.delete(E)),Ma(s,u,I)}function Fd(s,l){var u=s.length;if(u)return l+=l<0?u:0,_n(l,u)?s[l]:t}function Bd(s,l,u){l.length?l=_e(l,function(v){return Q(v)?function(x){return mr(x,v.length===1?v[0]:v)}:v}):l=[ht];var d=-1;l=_e(l,yt(J()));var g=Ld(s,function(v,x,w){var E=_e(l,function(O){return O(v)});return{criteria:E,index:++d,value:v}});return zy(g,function(v,x){return Eb(v,x,u)})}function hb(s,l){return zd(s,l,function(u,d){return fc(s,d)})}function zd(s,l,u){for(var d=-1,g=l.length,v={};++d<g;){var x=l[d],w=mr(s,x);u(w,x)&&ns(v,Hn(x,s),w)}return v}function pb(s){return function(l){return mr(l,s)}}function Ba(s,l,u,d){var g=d?By:Jr,v=-1,x=l.length,w=s;for(s===l&&(l=ut(l)),u&&(w=_e(s,yt(u)));++v<x;)for(var E=0,O=l[v],I=u?u(O):O;(E=g(w,I,E,d))>-1;)w!==s&&to.call(w,E,1),to.call(s,E,1);return s}function Hd(s,l){for(var u=s?l.length:0,d=u-1;u--;){var g=l[u];if(u==d||g!==v){var v=g;_n(g)?to.call(s,g,1):Wa(s,g)}}return s}function za(s,l){return s+io(Sd()*(l-s+1))}function mb(s,l,u,d){for(var g=-1,v=De(ro((l-s)/(u||1)),0),x=T(v);v--;)x[d?v:++g]=s,s+=u;return x}function Ha(s,l){var u="";if(!s||l<1||l>Ye)return u;do l%2&&(u+=s),l=io(l/2),l&&(s+=s);while(l);return u}function re(s,l){return rc(gh(s,l,ht),s+"")}function gb(s){return _d(oi(s))}function yb(s,l){var u=oi(s);return wo(u,pr(l,0,u.length))}function ns(s,l,u,d){if(!Ee(s))return s;l=Hn(l,s);for(var g=-1,v=l.length,x=v-1,w=s;w!=null&&++g<v;){var E=sn(l[g]),O=u;if(E==="__proto__"||E==="constructor"||E==="prototype")return s;if(g!=x){var I=w[E];O=d?d(I,E,w):t,O===t&&(O=Ee(I)?I:_n(l[g+1])?[]:{})}Zi(w,E,O),w=w[E]}return s}var $d=so?function(s,l){return so.set(s,l),s}:ht,bb=no?function(s,l){return no(s,"toString",{configurable:!0,enumerable:!1,value:hc(l),writable:!0})}:ht;function vb(s){return wo(oi(s))}function Nt(s,l,u){var d=-1,g=s.length;l<0&&(l=-l>g?0:g+l),u=u>g?g:u,u<0&&(u+=g),g=l>u?0:u-l>>>0,l>>>=0;for(var v=T(g);++d<g;)v[d]=s[d+l];return v}function Sb(s,l){var u;return Bn(s,function(d,g,v){return u=l(d,g,v),!u}),!!u}function ho(s,l,u){var d=0,g=s==null?d:s.length;if(typeof l=="number"&&l===l&&g<=Vr){for(;d<g;){var v=d+g>>>1,x=s[v];x!==null&&!vt(x)&&(u?x<=l:x<l)?d=v+1:g=v}return g}return $a(s,l,ht,u)}function $a(s,l,u,d){var g=0,v=s==null?0:s.length;if(v===0)return 0;l=u(l);for(var x=l!==l,w=l===null,E=vt(l),O=l===t;g<v;){var I=io((g+v)/2),N=u(s[I]),B=N!==t,W=N===null,j=N===N,ne=vt(N);if(x)var Y=d||j;else O?Y=j&&(d||B):w?Y=j&&B&&(d||!W):E?Y=j&&B&&!W&&(d||!ne):W||ne?Y=!1:Y=d?N<=l:N<l;Y?g=I+1:v=I}return Xe(v,Ur)}function Wd(s,l){for(var u=-1,d=s.length,g=0,v=[];++u<d;){var x=s[u],w=l?l(x):x;if(!u||!Gt(w,E)){var E=w;v[g++]=x===0?0:x}}return v}function Ud(s){return typeof s=="number"?s:vt(s)?tn:+s}function bt(s){if(typeof s=="string")return s;if(Q(s))return _e(s,bt)+"";if(vt(s))return xd?xd.call(s):"";var l=s+"";return l=="0"&&1/s==-tt?"-0":l}function zn(s,l,u){var d=-1,g=Ks,v=s.length,x=!0,w=[],E=w;if(u)x=!1,g=ga;else if(v>=i){var O=l?null:Ib(s);if(O)return qs(O);x=!1,g=Gi,E=new hr}else E=l?[]:w;e:for(;++d<v;){var I=s[d],N=l?l(I):I;if(I=u||I!==0?I:0,x&&N===N){for(var B=E.length;B--;)if(E[B]===N)continue e;l&&E.push(N),w.push(I)}else g(E,N,u)||(E!==w&&E.push(N),w.push(I))}return w}function Wa(s,l){return l=Hn(l,s),s=yh(s,l),s==null||delete s[sn(Rt(l))]}function Vd(s,l,u,d){return ns(s,l,u(mr(s,l)),d)}function po(s,l,u,d){for(var g=s.length,v=d?g:-1;(d?v--:++v<g)&&l(s[v],v,s););return u?Nt(s,d?0:v,d?v+1:g):Nt(s,d?v+1:0,d?g:v)}function Kd(s,l){var u=s;return u instanceof le&&(u=u.value()),ya(l,function(d,g){return g.func.apply(g.thisArg,Pn([d],g.args))},u)}function Ua(s,l,u){var d=s.length;if(d<2)return d?zn(s[0]):[];for(var g=-1,v=T(d);++g<d;)for(var x=s[g],w=-1;++w<d;)w!=g&&(v[g]=Qi(v[g]||x,s[w],l,u));return zn(Ve(v,1),l,u)}function Gd(s,l,u){for(var d=-1,g=s.length,v=l.length,x={};++d<g;){var w=d<v?l[d]:t;u(x,s[d],w)}return x}function Va(s){return Me(s)?s:[]}function Ka(s){return typeof s=="function"?s:ht}function Hn(s,l){return Q(s)?s:ec(s,l)?[s]:xh(ge(s))}var xb=re;function $n(s,l,u){var d=s.length;return u=u===t?d:u,!l&&u>=d?s:Nt(s,l,u)}var qd=a1||function(s){return Ue.clearTimeout(s)};function Jd(s,l){if(l)return s.slice();var u=s.length,d=md?md(u):new s.constructor(u);return s.copy(d),d}function Ga(s){var l=new s.constructor(s.byteLength);return new Qs(l).set(new Qs(s)),l}function wb(s,l){var u=l?Ga(s.buffer):s.buffer;return new s.constructor(u,s.byteOffset,s.byteLength)}function _b(s){var l=new s.constructor(s.source,If.exec(s));return l.lastIndex=s.lastIndex,l}function kb(s){return Xi?ve(Xi.call(s)):{}}function jd(s,l){var u=l?Ga(s.buffer):s.buffer;return new s.constructor(u,s.byteOffset,s.length)}function Yd(s,l){if(s!==l){var u=s!==t,d=s===null,g=s===s,v=vt(s),x=l!==t,w=l===null,E=l===l,O=vt(l);if(!w&&!O&&!v&&s>l||v&&x&&E&&!w&&!O||d&&x&&E||!u&&E||!g)return 1;if(!d&&!v&&!O&&s<l||O&&u&&g&&!d&&!v||w&&u&&g||!x&&g||!E)return-1}return 0}function Eb(s,l,u){for(var d=-1,g=s.criteria,v=l.criteria,x=g.length,w=u.length;++d<x;){var E=Yd(g[d],v[d]);if(E){if(d>=w)return E;var O=u[d];return E*(O=="desc"?-1:1)}}return s.index-l.index}function Xd(s,l,u,d){for(var g=-1,v=s.length,x=u.length,w=-1,E=l.length,O=De(v-x,0),I=T(E+O),N=!d;++w<E;)I[w]=l[w];for(;++g<x;)(N||g<v)&&(I[u[g]]=s[g]);for(;O--;)I[w++]=s[g++];return I}function Zd(s,l,u,d){for(var g=-1,v=s.length,x=-1,w=u.length,E=-1,O=l.length,I=De(v-w,0),N=T(I+O),B=!d;++g<I;)N[g]=s[g];for(var W=g;++E<O;)N[W+E]=l[E];for(;++x<w;)(B||g<v)&&(N[W+u[x]]=s[g++]);return N}function ut(s,l){var u=-1,d=s.length;for(l||(l=T(d));++u<d;)l[u]=s[u];return l}function rn(s,l,u,d){var g=!u;u||(u={});for(var v=-1,x=l.length;++v<x;){var w=l[v],E=d?d(u[w],s[w],w,u,s):t;E===t&&(E=s[w]),g?Sn(u,w,E):Zi(u,w,E)}return u}function Tb(s,l){return rn(s,Qa(s),l)}function Cb(s,l){return rn(s,fh(s),l)}function mo(s,l){return function(u,d){var g=Q(u)?Ny:j1,v=l?l():{};return g(u,s,J(d,2),v)}}function ni(s){return re(function(l,u){var d=-1,g=u.length,v=g>1?u[g-1]:t,x=g>2?u[2]:t;for(v=s.length>3&&typeof v=="function"?(g--,v):t,x&&it(u[0],u[1],x)&&(v=g<3?t:v,g=1),l=ve(l);++d<g;){var w=u[d];w&&s(l,w,d,v)}return l})}function Qd(s,l){return function(u,d){if(u==null)return u;if(!ft(u))return s(u,d);for(var g=u.length,v=l?g:-1,x=ve(u);(l?v--:++v<g)&&d(x[v],v,x)!==!1;);return u}}function eh(s){return function(l,u,d){for(var g=-1,v=ve(l),x=d(l),w=x.length;w--;){var E=x[s?w:++g];if(u(v[E],E,v)===!1)break}return l}}function Ab(s,l,u){var d=l&A,g=rs(s);function v(){var x=this&&this!==Ue&&this instanceof v?g:s;return x.apply(d?u:this,arguments)}return v}function th(s){return function(l){l=ge(l);var u=jr(l)?Vt(l):t,d=u?u[0]:l.charAt(0),g=u?$n(u,1).join(""):l.slice(1);return d[s]()+g}}function ri(s){return function(l){return ya(Qh(Zh(l).replace(by,"")),s,"")}}function rs(s){return function(){var l=arguments;switch(l.length){case 0:return new s;case 1:return new s(l[0]);case 2:return new s(l[0],l[1]);case 3:return new s(l[0],l[1],l[2]);case 4:return new s(l[0],l[1],l[2],l[3]);case 5:return new s(l[0],l[1],l[2],l[3],l[4]);case 6:return new s(l[0],l[1],l[2],l[3],l[4],l[5]);case 7:return new s(l[0],l[1],l[2],l[3],l[4],l[5],l[6])}var u=ti(s.prototype),d=s.apply(u,l);return Ee(d)?d:u}}function Mb(s,l,u){var d=rs(s);function g(){for(var v=arguments.length,x=T(v),w=v,E=ii(g);w--;)x[w]=arguments[w];var O=v<3&&x[0]!==E&&x[v-1]!==E?[]:Dn(x,E);if(v-=O.length,v<u)return oh(s,l,go,g.placeholder,t,x,O,t,t,u-v);var I=this&&this!==Ue&&this instanceof g?d:s;return gt(I,this,x)}return g}function nh(s){return function(l,u,d){var g=ve(l);if(!ft(l)){var v=J(u,3);l=Fe(l),u=function(w){return v(g[w],w,g)}}var x=s(l,u,d);return x>-1?g[v?l[x]:x]:t}}function rh(s){return wn(function(l){var u=l.length,d=u,g=Ot.prototype.thru;for(s&&l.reverse();d--;){var v=l[d];if(typeof v!="function")throw new Mt(a);if(g&&!x&&So(v)=="wrapper")var x=new Ot([],!0)}for(d=x?d:u;++d<u;){v=l[d];var w=So(v),E=w=="wrapper"?Xa(v):t;E&&tc(E[0])&&E[1]==(ue|V|ie|Tt)&&!E[4].length&&E[9]==1?x=x[So(E[0])].apply(x,E[3]):x=v.length==1&&tc(v)?x[w]():x.thru(v)}return function(){var O=arguments,I=O[0];if(x&&O.length==1&&Q(I))return x.plant(I).value();for(var N=0,B=u?l[N].apply(this,O):I;++N<u;)B=l[N].call(this,B);return B}})}function go(s,l,u,d,g,v,x,w,E,O){var I=l&ue,N=l&A,B=l&R,W=l&(V|G),j=l&Fi,ne=B?t:rs(s);function Y(){for(var se=arguments.length,ce=T(se),St=se;St--;)ce[St]=arguments[St];if(W)var st=ii(Y),xt=$y(ce,st);if(d&&(ce=Xd(ce,d,g,W)),v&&(ce=Zd(ce,v,x,W)),se-=xt,W&&se<O){var Oe=Dn(ce,st);return oh(s,l,go,Y.placeholder,u,ce,Oe,w,E,O-se)}var qt=N?u:this,Tn=B?qt[s]:s;return se=ce.length,w?ce=jb(ce,w):j&&se>1&&ce.reverse(),I&&E<se&&(ce.length=E),this&&this!==Ue&&this instanceof Y&&(Tn=ne||rs(Tn)),Tn.apply(qt,ce)}return Y}function ih(s,l){return function(u,d){return rb(u,s,l(d),{})}}function yo(s,l){return function(u,d){var g;if(u===t&&d===t)return l;if(u!==t&&(g=u),d!==t){if(g===t)return d;typeof u=="string"||typeof d=="string"?(u=bt(u),d=bt(d)):(u=Ud(u),d=Ud(d)),g=s(u,d)}return g}}function qa(s){return wn(function(l){return l=_e(l,yt(J())),re(function(u){var d=this;return s(l,function(g){return gt(g,d,u)})})})}function bo(s,l){l=l===t?" ":bt(l);var u=l.length;if(u<2)return u?Ha(l,s):l;var d=Ha(l,ro(s/Yr(l)));return jr(l)?$n(Vt(d),0,s).join(""):d.slice(0,s)}function Ob(s,l,u,d){var g=l&A,v=rs(s);function x(){for(var w=-1,E=arguments.length,O=-1,I=d.length,N=T(I+E),B=this&&this!==Ue&&this instanceof x?v:s;++O<I;)N[O]=d[O];for(;E--;)N[O++]=arguments[++w];return gt(B,g?u:this,N)}return x}function sh(s){return function(l,u,d){return d&&typeof d!="number"&&it(l,u,d)&&(u=d=t),l=En(l),u===t?(u=l,l=0):u=En(u),d=d===t?l<u?1:-1:En(d),mb(l,u,d,s)}}function vo(s){return function(l,u){return typeof l=="string"&&typeof u=="string"||(l=Lt(l),u=Lt(u)),s(l,u)}}function oh(s,l,u,d,g,v,x,w,E,O){var I=l&V,N=I?x:t,B=I?t:x,W=I?v:t,j=I?t:v;l|=I?ie:q,l&=~(I?q:ie),l&K||(l&=~(A|R));var ne=[s,l,g,W,N,j,B,w,E,O],Y=u.apply(t,ne);return tc(s)&&bh(Y,ne),Y.placeholder=d,vh(Y,s,l)}function Ja(s){var l=Pe[s];return function(u,d){if(u=Lt(u),d=d==null?0:Xe(ee(d),292),d&&vd(u)){var g=(ge(u)+"e").split("e"),v=l(g[0]+"e"+(+g[1]+d));return g=(ge(v)+"e").split("e"),+(g[0]+"e"+(+g[1]-d))}return l(u)}}var Ib=Qr&&1/qs(new Qr([,-0]))[1]==tt?function(s){return new Qr(s)}:gc;function lh(s){return function(l){var u=Ze(l);return u==Wt?ka(l):u==Ut?Jy(l):Hy(l,s(l))}}function xn(s,l,u,d,g,v,x,w){var E=l&R;if(!E&&typeof s!="function")throw new Mt(a);var O=d?d.length:0;if(O||(l&=~(ie|q),d=g=t),x=x===t?x:De(ee(x),0),w=w===t?w:ee(w),O-=g?g.length:0,l&q){var I=d,N=g;d=g=t}var B=E?t:Xa(s),W=[s,l,u,d,g,I,N,v,x,w];if(B&&Gb(W,B),s=W[0],l=W[1],u=W[2],d=W[3],g=W[4],w=W[9]=W[9]===t?E?0:s.length:De(W[9]-O,0),!w&&l&(V|G)&&(l&=~(V|G)),!l||l==A)var j=Ab(s,l,u);else l==V||l==G?j=Mb(s,l,w):(l==ie||l==(A|ie))&&!g.length?j=Ob(s,l,u,d):j=go.apply(t,W);var ne=B?$d:bh;return vh(ne(j,W),s,l)}function ah(s,l,u,d){return s===t||Gt(s,Zr[u])&&!be.call(d,u)?l:s}function ch(s,l,u,d,g,v){return Ee(s)&&Ee(l)&&(v.set(l,s),fo(s,l,t,ch,v),v.delete(l)),s}function Nb(s){return ls(s)?t:s}function uh(s,l,u,d,g,v){var x=u&_,w=s.length,E=l.length;if(w!=E&&!(x&&E>w))return!1;var O=v.get(s),I=v.get(l);if(O&&I)return O==l&&I==s;var N=-1,B=!0,W=u&C?new hr:t;for(v.set(s,l),v.set(l,s);++N<w;){var j=s[N],ne=l[N];if(d)var Y=x?d(ne,j,N,l,s,v):d(j,ne,N,s,l,v);if(Y!==t){if(Y)continue;B=!1;break}if(W){if(!ba(l,function(se,ce){if(!Gi(W,ce)&&(j===se||g(j,se,u,d,v)))return W.push(ce)})){B=!1;break}}else if(!(j===ne||g(j,ne,u,d,v))){B=!1;break}}return v.delete(s),v.delete(l),B}function Rb(s,l,u,d,g,v,x){switch(u){case Gr:if(s.byteLength!=l.byteLength||s.byteOffset!=l.byteOffset)return!1;s=s.buffer,l=l.buffer;case Ki:return!(s.byteLength!=l.byteLength||!v(new Qs(s),new Qs(l)));case zi:case Hi:case $i:return Gt(+s,+l);case zs:return s.name==l.name&&s.message==l.message;case Wi:case Ui:return s==l+"";case Wt:var w=ka;case Ut:var E=d&_;if(w||(w=qs),s.size!=l.size&&!E)return!1;var O=x.get(s);if(O)return O==l;d|=C,x.set(s,l);var I=uh(w(s),w(l),d,g,v,x);return x.delete(s),I;case $s:if(Xi)return Xi.call(s)==Xi.call(l)}return!1}function Lb(s,l,u,d,g,v){var x=u&_,w=ja(s),E=w.length,O=ja(l),I=O.length;if(E!=I&&!x)return!1;for(var N=E;N--;){var B=w[N];if(!(x?B in l:be.call(l,B)))return!1}var W=v.get(s),j=v.get(l);if(W&&j)return W==l&&j==s;var ne=!0;v.set(s,l),v.set(l,s);for(var Y=x;++N<E;){B=w[N];var se=s[B],ce=l[B];if(d)var St=x?d(ce,se,B,l,s,v):d(se,ce,B,s,l,v);if(!(St===t?se===ce||g(se,ce,u,d,v):St)){ne=!1;break}Y||(Y=B=="constructor")}if(ne&&!Y){var st=s.constructor,xt=l.constructor;st!=xt&&"constructor"in s&&"constructor"in l&&!(typeof st=="function"&&st instanceof st&&typeof xt=="function"&&xt instanceof xt)&&(ne=!1)}return v.delete(s),v.delete(l),ne}function wn(s){return rc(gh(s,t,Eh),s+"")}function ja(s){return Od(s,Fe,Qa)}function Ya(s){return Od(s,dt,fh)}var Xa=so?function(s){return so.get(s)}:gc;function So(s){for(var l=s.name+"",u=ei[l],d=be.call(ei,l)?u.length:0;d--;){var g=u[d],v=g.func;if(v==null||v==s)return g.name}return l}function ii(s){var l=be.call(b,"placeholder")?b:s;return l.placeholder}function J(){var s=b.iteratee||pc;return s=s===pc?Rd:s,arguments.length?s(arguments[0],arguments[1]):s}function xo(s,l){var u=s.__data__;return Wb(l)?u[typeof l=="string"?"string":"hash"]:u.map}function Za(s){for(var l=Fe(s),u=l.length;u--;){var d=l[u],g=s[d];l[u]=[d,g,ph(g)]}return l}function gr(s,l){var u=Ky(s,l);return Nd(u)?u:t}function Pb(s){var l=be.call(s,fr),u=s[fr];try{s[fr]=t;var d=!0}catch{}var g=Xs.call(s);return d&&(l?s[fr]=u:delete s[fr]),g}var Qa=Ta?function(s){return s==null?[]:(s=ve(s),Ln(Ta(s),function(l){return yd.call(s,l)}))}:yc,fh=Ta?function(s){for(var l=[];s;)Pn(l,Qa(s)),s=eo(s);return l}:yc,Ze=rt;(Ca&&Ze(new Ca(new ArrayBuffer(1)))!=Gr||Ji&&Ze(new Ji)!=Wt||Aa&&Ze(Aa.resolve())!=Cf||Qr&&Ze(new Qr)!=Ut||ji&&Ze(new ji)!=Vi)&&(Ze=function(s){var l=rt(s),u=l==yn?s.constructor:t,d=u?yr(u):"";if(d)switch(d){case y1:return Gr;case b1:return Wt;case v1:return Cf;case S1:return Ut;case x1:return Vi}return l});function Db(s,l,u){for(var d=-1,g=u.length;++d<g;){var v=u[d],x=v.size;switch(v.type){case"drop":s+=x;break;case"dropRight":l-=x;break;case"take":l=Xe(l,s+x);break;case"takeRight":s=De(s,l-x);break}}return{start:s,end:l}}function Fb(s){var l=s.match(U0);return l?l[1].split(V0):[]}function dh(s,l,u){l=Hn(l,s);for(var d=-1,g=l.length,v=!1;++d<g;){var x=sn(l[d]);if(!(v=s!=null&&u(s,x)))break;s=s[x]}return v||++d!=g?v:(g=s==null?0:s.length,!!g&&Ao(g)&&_n(x,g)&&(Q(s)||br(s)))}function Bb(s){var l=s.length,u=new s.constructor(l);return l&&typeof s[0]=="string"&&be.call(s,"index")&&(u.index=s.index,u.input=s.input),u}function hh(s){return typeof s.constructor=="function"&&!is(s)?ti(eo(s)):{}}function zb(s,l,u){var d=s.constructor;switch(l){case Ki:return Ga(s);case zi:case Hi:return new d(+s);case Gr:return wb(s,u);case Zl:case Ql:case ea:case ta:case na:case ra:case ia:case sa:case oa:return jd(s,u);case Wt:return new d;case $i:case Ui:return new d(s);case Wi:return _b(s);case Ut:return new d;case $s:return kb(s)}}function Hb(s,l){var u=l.length;if(!u)return s;var d=u-1;return l[d]=(u>1?"& ":"")+l[d],l=l.join(u>2?", ":" "),s.replace(W0,`{
22
20
  /* [wrapped with `+l+`] */
23
- `)}function Hb(s){return Z(s)||mr(s)||!!(fd&&s&&s[fd])}function vn(s,l){var c=typeof s;return l=l??qe,!!l&&(c=="number"||c!="symbol"&&Z0.test(s))&&s>-1&&s%1==0&&s<l}function tt(s,l,c){if(!ke(c))return!1;var d=typeof l;return(d=="number"?ut(c)&&vn(l,c.length):d=="string"&&l in c)?Ht(c[l],s):!1}function Ja(s,l){if(Z(s))return!1;var c=typeof s;return c=="number"||c=="symbol"||c=="boolean"||s==null||yt(s)?!0:F0.test(s)||!D0.test(s)||l!=null&&s in be(l)}function $b(s){var l=typeof s;return l=="string"||l=="number"||l=="symbol"||l=="boolean"?s!=="__proto__":s===null}function ja(s){var l=mo(s),c=y[l];if(typeof c!="function"||!(l in le.prototype))return!1;if(s===c)return!0;var d=Ka(c);return!!d&&s===d[0]}function Wb(s){return!!ld&&ld in s}var Ub=Vs?Sn:du;function ns(s){var l=s&&s.constructor,c=typeof l=="function"&&l.prototype||Zr;return s===c}function lh(s){return s===s&&!ke(s)}function ah(s,l){return function(c){return c==null?!1:c[s]===l&&(l!==t||s in be(c))}}function Vb(s){var l=wo(s,function(d){return c.size===h&&c.clear(),d}),c=l.cache;return l}function Kb(s,l){var c=s[1],d=l[1],g=c|d,v=g<(A|N|ue),w=d==ue&&c==K||d==ue&&c==lt&&s[7].length<=l[8]||d==(ue|lt)&&l[7].length<=l[8]&&c==K;if(!(v||w))return s;d&A&&(s[2]=l[2],g|=c&A?0:G);var _=l[3];if(_){var E=s[3];s[3]=E?Vd(E,_,l[4]):_,s[4]=E?Mn(s[3],m):l[4]}return _=l[5],_&&(E=s[5],s[5]=E?Kd(E,_,l[6]):_,s[6]=E?Mn(s[5],m):l[6]),_=l[7],_&&(s[7]=_),d&ue&&(s[8]=s[8]==null?l[8]:Je(s[8],l[8])),s[9]==null&&(s[9]=l[9]),s[0]=l[0],s[1]=g,s}function Gb(s){var l=[];if(s!=null)for(var c in be(s))l.push(c);return l}function qb(s){return Gs.call(s)}function uh(s,l,c){return l=Pe(l===t?s.length-1:l,0),function(){for(var d=arguments,g=-1,v=Pe(d.length-l,0),w=T(v);++g<v;)w[g]=d[l+g];g=-1;for(var _=T(l+1);++g<l;)_[g]=d[g];return _[l]=c(w),pt(s,this,_)}}function ch(s,l){return l.length<2?s:dr(s,At(l,0,-1))}function Jb(s,l){for(var c=s.length,d=Je(l.length,c),g=at(s);d--;){var v=l[d];s[d]=vn(v,c)?g[v]:t}return s}function Ya(s,l){if(!(l==="constructor"&&typeof s[l]=="function")&&l!="__proto__")return s[l]}var fh=hh(Ld),rs=u1||function(s,l){return $e.setTimeout(s,l)},Xa=hh(yb);function dh(s,l,c){var d=l+"";return Xa(s,zb(d,jb(Db(d),c)))}function hh(s){var l=0,c=0;return function(){var d=h1(),g=$r-(d-c);if(c=d,g>0){if(++l>=sr)return arguments[0]}else l=0;return s.apply(t,arguments)}}function yo(s,l){var c=-1,d=s.length,g=d-1;for(l=l===t?d:l;++c<l;){var v=Ra(c,g),w=s[v];s[v]=s[c],s[c]=w}return s.length=l,s}var ph=Vb(function(s){var l=[];return s.charCodeAt(0)===46&&l.push(""),s.replace(B0,function(c,d,g,v){l.push(g?v.replace(G0,"$1"):d||c)}),l});function Qt(s){if(typeof s=="string"||yt(s))return s;var l=s+"";return l=="0"&&1/s==-Ze?"-0":l}function pr(s){if(s!=null){try{return Ks.call(s)}catch{}try{return s+""}catch{}}return""}function jb(s,l){return kt(_0,function(c){var d="_."+c[0];l&c[1]&&!Hs(s,d)&&s.push(d)}),s.sort()}function mh(s){if(s instanceof le)return s.clone();var l=new Tt(s.__wrapped__,s.__chain__);return l.__actions__=at(s.__actions__),l.__index__=s.__index__,l.__values__=s.__values__,l}function Yb(s,l,c){(c?tt(s,l,c):l===t)?l=1:l=Pe(Q(l),0);var d=s==null?0:s.length;if(!d||l<1)return[];for(var g=0,v=0,w=T(Zs(d/l));g<d;)w[v++]=At(s,g,g+=l);return w}function Xb(s){for(var l=-1,c=s==null?0:s.length,d=0,g=[];++l<c;){var v=s[l];v&&(g[d++]=v)}return g}function Zb(){var s=arguments.length;if(!s)return[];for(var l=T(s-1),c=arguments[0],d=s;d--;)l[d-1]=arguments[d];return An(Z(c)?at(c):[c],We(l,1))}var Qb=ne(function(s,l){return Ce(s)?Xi(s,We(l,1,Ce,!0)):[]}),ev=ne(function(s,l){var c=Mt(l);return Ce(c)&&(c=t),Ce(s)?Xi(s,We(l,1,Ce,!0),q(c,2)):[]}),tv=ne(function(s,l){var c=Mt(l);return Ce(c)&&(c=t),Ce(s)?Xi(s,We(l,1,Ce,!0),t,c):[]});function nv(s,l,c){var d=s==null?0:s.length;return d?(l=c||l===t?1:Q(l),At(s,l<0?0:l,d)):[]}function rv(s,l,c){var d=s==null?0:s.length;return d?(l=c||l===t?1:Q(l),l=d-l,At(s,0,l<0?0:l)):[]}function iv(s,l){return s&&s.length?ao(s,q(l,3),!0,!0):[]}function sv(s,l){return s&&s.length?ao(s,q(l,3),!0):[]}function ov(s,l,c,d){var g=s==null?0:s.length;return g?(c&&typeof c!="number"&&tt(s,l,c)&&(c=0,d=g),Z1(s,l,c,d)):[]}function gh(s,l,c){var d=s==null?0:s.length;if(!d)return-1;var g=c==null?0:Q(c);return g<0&&(g=Pe(d+g,0)),$s(s,q(l,3),g)}function yh(s,l,c){var d=s==null?0:s.length;if(!d)return-1;var g=d-1;return c!==t&&(g=Q(c),g=c<0?Pe(d+g,0):Je(g,d-1)),$s(s,q(l,3),g,!0)}function bh(s){var l=s==null?0:s.length;return l?We(s,1):[]}function lv(s){var l=s==null?0:s.length;return l?We(s,Ze):[]}function av(s,l){var c=s==null?0:s.length;return c?(l=l===t?1:Q(l),We(s,l)):[]}function uv(s){for(var l=-1,c=s==null?0:s.length,d={};++l<c;){var g=s[l];d[g[0]]=g[1]}return d}function vh(s){return s&&s.length?s[0]:t}function cv(s,l,c){var d=s==null?0:s.length;if(!d)return-1;var g=c==null?0:Q(c);return g<0&&(g=Pe(d+g,0)),Jr(s,l,g)}function fv(s){var l=s==null?0:s.length;return l?At(s,0,-1):[]}var dv=ne(function(s){var l=_e(s,Ba);return l.length&&l[0]===s[0]?Aa(l):[]}),hv=ne(function(s){var l=Mt(s),c=_e(s,Ba);return l===Mt(c)?l=t:c.pop(),c.length&&c[0]===s[0]?Aa(c,q(l,2)):[]}),pv=ne(function(s){var l=Mt(s),c=_e(s,Ba);return l=typeof l=="function"?l:t,l&&c.pop(),c.length&&c[0]===s[0]?Aa(c,t,l):[]});function mv(s,l){return s==null?"":f1.call(s,l)}function Mt(s){var l=s==null?0:s.length;return l?s[l-1]:t}function gv(s,l,c){var d=s==null?0:s.length;if(!d)return-1;var g=d;return c!==t&&(g=Q(c),g=g<0?Pe(d+g,0):Je(g,d-1)),l===l?jy(s,l,g):$s(s,Qf,g,!0)}function yv(s,l){return s&&s.length?Od(s,Q(l)):t}var bv=ne(Sh);function Sh(s,l){return s&&s.length&&l&&l.length?Na(s,l):s}function vv(s,l,c){return s&&s.length&&l&&l.length?Na(s,l,q(c,2)):s}function Sv(s,l,c){return s&&s.length&&l&&l.length?Na(s,l,t,c):s}var wv=bn(function(s,l){var c=s==null?0:s.length,d=ka(s,l);return Rd(s,_e(l,function(g){return vn(g,c)?+g:g}).sort(Ud)),d});function _v(s,l){var c=[];if(!(s&&s.length))return c;var d=-1,g=[],v=s.length;for(l=q(l,3);++d<v;){var w=s[d];l(w,d,s)&&(c.push(w),g.push(d))}return Rd(s,g),c}function Za(s){return s==null?s:m1.call(s)}function xv(s,l,c){var d=s==null?0:s.length;return d?(c&&typeof c!="number"&&tt(s,l,c)?(l=0,c=d):(l=l==null?0:Q(l),c=c===t?d:Q(c)),At(s,l,c)):[]}function kv(s,l){return lo(s,l)}function Ev(s,l,c){return Pa(s,l,q(c,2))}function Tv(s,l){var c=s==null?0:s.length;if(c){var d=lo(s,l);if(d<c&&Ht(s[d],l))return d}return-1}function Cv(s,l){return lo(s,l,!0)}function Av(s,l,c){return Pa(s,l,q(c,2),!0)}function Mv(s,l){var c=s==null?0:s.length;if(c){var d=lo(s,l,!0)-1;if(Ht(s[d],l))return d}return-1}function Ov(s){return s&&s.length?Pd(s):[]}function Iv(s,l){return s&&s.length?Pd(s,q(l,2)):[]}function Nv(s){var l=s==null?0:s.length;return l?At(s,1,l):[]}function Rv(s,l,c){return s&&s.length?(l=c||l===t?1:Q(l),At(s,0,l<0?0:l)):[]}function Lv(s,l,c){var d=s==null?0:s.length;return d?(l=c||l===t?1:Q(l),l=d-l,At(s,l<0?0:l,d)):[]}function Pv(s,l){return s&&s.length?ao(s,q(l,3),!1,!0):[]}function Dv(s,l){return s&&s.length?ao(s,q(l,3)):[]}var Fv=ne(function(s){return Nn(We(s,1,Ce,!0))}),Bv=ne(function(s){var l=Mt(s);return Ce(l)&&(l=t),Nn(We(s,1,Ce,!0),q(l,2))}),zv=ne(function(s){var l=Mt(s);return l=typeof l=="function"?l:t,Nn(We(s,1,Ce,!0),t,l)});function Hv(s){return s&&s.length?Nn(s):[]}function $v(s,l){return s&&s.length?Nn(s,q(l,2)):[]}function Wv(s,l){return l=typeof l=="function"?l:t,s&&s.length?Nn(s,t,l):[]}function Qa(s){if(!(s&&s.length))return[];var l=0;return s=Cn(s,function(c){if(Ce(c))return l=Pe(c.length,l),!0}),ga(l,function(c){return _e(s,ha(c))})}function wh(s,l){if(!(s&&s.length))return[];var c=Qa(s);return l==null?c:_e(c,function(d){return pt(l,t,d)})}var Uv=ne(function(s,l){return Ce(s)?Xi(s,l):[]}),Vv=ne(function(s){return Fa(Cn(s,Ce))}),Kv=ne(function(s){var l=Mt(s);return Ce(l)&&(l=t),Fa(Cn(s,Ce),q(l,2))}),Gv=ne(function(s){var l=Mt(s);return l=typeof l=="function"?l:t,Fa(Cn(s,Ce),t,l)}),qv=ne(Qa);function Jv(s,l){return zd(s||[],l||[],Yi)}function jv(s,l){return zd(s||[],l||[],es)}var Yv=ne(function(s){var l=s.length,c=l>1?s[l-1]:t;return c=typeof c=="function"?(s.pop(),c):t,wh(s,c)});function _h(s){var l=y(s);return l.__chain__=!0,l}function Xv(s,l){return l(s),s}function bo(s,l){return l(s)}var Zv=bn(function(s){var l=s.length,c=l?s[0]:0,d=this.__wrapped__,g=function(v){return ka(v,s)};return l>1||this.__actions__.length||!(d instanceof le)||!vn(c)?this.thru(g):(d=d.slice(c,+c+(l?1:0)),d.__actions__.push({func:bo,args:[g],thisArg:t}),new Tt(d,this.__chain__).thru(function(v){return l&&!v.length&&v.push(t),v}))});function Qv(){return _h(this)}function eS(){return new Tt(this.value(),this.__chain__)}function tS(){this.__values__===t&&(this.__values__=Dh(this.value()));var s=this.__index__>=this.__values__.length,l=s?t:this.__values__[this.__index__++];return{done:s,value:l}}function nS(){return this}function rS(s){for(var l,c=this;c instanceof no;){var d=mh(c);d.__index__=0,d.__values__=t,l?g.__wrapped__=d:l=d;var g=d;c=c.__wrapped__}return g.__wrapped__=s,l}function iS(){var s=this.__wrapped__;if(s instanceof le){var l=s;return this.__actions__.length&&(l=new le(this)),l=l.reverse(),l.__actions__.push({func:bo,args:[Za],thisArg:t}),new Tt(l,this.__chain__)}return this.thru(Za)}function sS(){return Bd(this.__wrapped__,this.__actions__)}var oS=uo(function(s,l,c){ye.call(s,c)?++s[c]:gn(s,c,1)});function lS(s,l,c){var d=Z(s)?Xf:X1;return c&&tt(s,l,c)&&(l=t),d(s,q(l,3))}function aS(s,l){var c=Z(s)?Cn:wd;return c(s,q(l,3))}var uS=jd(gh),cS=jd(yh);function fS(s,l){return We(vo(s,l),1)}function dS(s,l){return We(vo(s,l),Ze)}function hS(s,l,c){return c=c===t?1:Q(c),We(vo(s,l),c)}function xh(s,l){var c=Z(s)?kt:In;return c(s,q(l,3))}function kh(s,l){var c=Z(s)?Ny:Sd;return c(s,q(l,3))}var pS=uo(function(s,l,c){ye.call(s,c)?s[c].push(l):gn(s,c,[l])});function mS(s,l,c,d){s=ut(s)?s:oi(s),c=c&&!d?Q(c):0;var g=s.length;return c<0&&(c=Pe(g+c,0)),ko(s)?c<=g&&s.indexOf(l,c)>-1:!!g&&Jr(s,l,c)>-1}var gS=ne(function(s,l,c){var d=-1,g=typeof l=="function",v=ut(s)?T(s.length):[];return In(s,function(w){v[++d]=g?pt(l,w,c):Zi(w,l,c)}),v}),yS=uo(function(s,l,c){gn(s,c,l)});function vo(s,l){var c=Z(s)?_e:Cd;return c(s,q(l,3))}function bS(s,l,c,d){return s==null?[]:(Z(l)||(l=l==null?[]:[l]),c=d?t:c,Z(c)||(c=c==null?[]:[c]),Id(s,l,c))}var vS=uo(function(s,l,c){s[c?0:1].push(l)},function(){return[[],[]]});function SS(s,l,c){var d=Z(s)?fa:td,g=arguments.length<3;return d(s,q(l,4),c,g,In)}function wS(s,l,c){var d=Z(s)?Ry:td,g=arguments.length<3;return d(s,q(l,4),c,g,Sd)}function _S(s,l){var c=Z(s)?Cn:wd;return c(s,_o(q(l,3)))}function xS(s){var l=Z(s)?gd:mb;return l(s)}function kS(s,l,c){(c?tt(s,l,c):l===t)?l=1:l=Q(l);var d=Z(s)?G1:gb;return d(s,l)}function ES(s){var l=Z(s)?q1:bb;return l(s)}function TS(s){if(s==null)return 0;if(ut(s))return ko(s)?Yr(s):s.length;var l=je(s);return l==Dt||l==Ft?s.size:Oa(s).length}function CS(s,l,c){var d=Z(s)?da:vb;return c&&tt(s,l,c)&&(l=t),d(s,q(l,3))}var AS=ne(function(s,l){if(s==null)return[];var c=l.length;return c>1&&tt(s,l[0],l[1])?l=[]:c>2&&tt(l[0],l[1],l[2])&&(l=[l[0]]),Id(s,We(l,1),[])}),So=a1||function(){return $e.Date.now()};function MS(s,l){if(typeof l!="function")throw new Et(a);return s=Q(s),function(){if(--s<1)return l.apply(this,arguments)}}function Eh(s,l,c){return l=c?t:l,l=s&&l==null?s.length:l,yn(s,ue,t,t,t,t,l)}function Th(s,l){var c;if(typeof l!="function")throw new Et(a);return s=Q(s),function(){return--s>0&&(c=l.apply(this,arguments)),s<=1&&(l=t),c}}var eu=ne(function(s,l,c){var d=A;if(c.length){var g=Mn(c,ii(eu));d|=pe}return yn(s,d,l,c,g)}),Ch=ne(function(s,l,c){var d=A|N;if(c.length){var g=Mn(c,ii(Ch));d|=pe}return yn(l,d,s,c,g)});function Ah(s,l,c){l=c?t:l;var d=yn(s,K,t,t,t,t,t,l);return d.placeholder=Ah.placeholder,d}function Mh(s,l,c){l=c?t:l;var d=yn(s,oe,t,t,t,t,t,l);return d.placeholder=Mh.placeholder,d}function Oh(s,l,c){var d,g,v,w,_,E,O=0,I=!1,R=!1,z=!0;if(typeof s!="function")throw new Et(a);l=Ot(l)||0,ke(c)&&(I=!!c.leading,R="maxWait"in c,v=R?Pe(Ot(c.maxWait)||0,l):v,z="trailing"in c?!!c.trailing:z);function U(Ae){var $t=d,_n=g;return d=g=t,O=Ae,w=s.apply(_n,$t),w}function J(Ae){return O=Ae,_=rs(re,l),I?U(Ae):w}function te(Ae){var $t=Ae-E,_n=Ae-O,jh=l-$t;return R?Je(jh,v-_n):jh}function j(Ae){var $t=Ae-E,_n=Ae-O;return E===t||$t>=l||$t<0||R&&_n>=v}function re(){var Ae=So();if(j(Ae))return ae(Ae);_=rs(re,te(Ae))}function ae(Ae){return _=t,z&&d?U(Ae):(d=g=t,w)}function bt(){_!==t&&Hd(_),O=0,d=E=g=_=t}function nt(){return _===t?w:ae(So())}function vt(){var Ae=So(),$t=j(Ae);if(d=arguments,g=this,E=Ae,$t){if(_===t)return J(E);if(R)return Hd(_),_=rs(re,l),U(E)}return _===t&&(_=rs(re,l)),w}return vt.cancel=bt,vt.flush=nt,vt}var OS=ne(function(s,l){return vd(s,1,l)}),IS=ne(function(s,l,c){return vd(s,Ot(l)||0,c)});function NS(s){return yn(s,Pi)}function wo(s,l){if(typeof s!="function"||l!=null&&typeof l!="function")throw new Et(a);var c=function(){var d=arguments,g=l?l.apply(this,d):d[0],v=c.cache;if(v.has(g))return v.get(g);var w=s.apply(this,d);return c.cache=v.set(g,w)||v,w};return c.cache=new(wo.Cache||mn),c}wo.Cache=mn;function _o(s){if(typeof s!="function")throw new Et(a);return function(){var l=arguments;switch(l.length){case 0:return!s.call(this);case 1:return!s.call(this,l[0]);case 2:return!s.call(this,l[0],l[1]);case 3:return!s.call(this,l[0],l[1],l[2])}return!s.apply(this,l)}}function RS(s){return Th(2,s)}var LS=Sb(function(s,l){l=l.length==1&&Z(l[0])?_e(l[0],mt(q())):_e(We(l,1),mt(q()));var c=l.length;return ne(function(d){for(var g=-1,v=Je(d.length,c);++g<v;)d[g]=l[g].call(this,d[g]);return pt(s,this,d)})}),tu=ne(function(s,l){var c=Mn(l,ii(tu));return yn(s,pe,t,l,c)}),Ih=ne(function(s,l){var c=Mn(l,ii(Ih));return yn(s,B,t,l,c)}),PS=bn(function(s,l){return yn(s,lt,t,t,t,l)});function DS(s,l){if(typeof s!="function")throw new Et(a);return l=l===t?l:Q(l),ne(s,l)}function FS(s,l){if(typeof s!="function")throw new Et(a);return l=l==null?0:Pe(Q(l),0),ne(function(c){var d=c[l],g=Ln(c,0,l);return d&&An(g,d),pt(s,this,g)})}function BS(s,l,c){var d=!0,g=!0;if(typeof s!="function")throw new Et(a);return ke(c)&&(d="leading"in c?!!c.leading:d,g="trailing"in c?!!c.trailing:g),Oh(s,l,{leading:d,maxWait:l,trailing:g})}function zS(s){return Eh(s,1)}function HS(s,l){return tu(za(l),s)}function $S(){if(!arguments.length)return[];var s=arguments[0];return Z(s)?s:[s]}function WS(s){return Ct(s,S)}function US(s,l){return l=typeof l=="function"?l:t,Ct(s,S,l)}function VS(s){return Ct(s,p|S)}function KS(s,l){return l=typeof l=="function"?l:t,Ct(s,p|S,l)}function GS(s,l){return l==null||bd(s,l,De(l))}function Ht(s,l){return s===l||s!==s&&l!==l}var qS=po(Ca),JS=po(function(s,l){return s>=l}),mr=kd(function(){return arguments}())?kd:function(s){return Te(s)&&ye.call(s,"callee")&&!cd.call(s,"callee")},Z=T.isArray,jS=Kf?mt(Kf):rb;function ut(s){return s!=null&&xo(s.length)&&!Sn(s)}function Ce(s){return Te(s)&&ut(s)}function YS(s){return s===!0||s===!1||Te(s)&&et(s)==Fi}var Pn=c1||du,XS=Gf?mt(Gf):ib;function ZS(s){return Te(s)&&s.nodeType===1&&!is(s)}function QS(s){if(s==null)return!0;if(ut(s)&&(Z(s)||typeof s=="string"||typeof s.splice=="function"||Pn(s)||si(s)||mr(s)))return!s.length;var l=je(s);if(l==Dt||l==Ft)return!s.size;if(ns(s))return!Oa(s).length;for(var c in s)if(ye.call(s,c))return!1;return!0}function ew(s,l){return Qi(s,l)}function tw(s,l,c){c=typeof c=="function"?c:t;var d=c?c(s,l):t;return d===t?Qi(s,l,t,c):!!d}function nu(s){if(!Te(s))return!1;var l=et(s);return l==Ls||l==k0||typeof s.message=="string"&&typeof s.name=="string"&&!is(s)}function nw(s){return typeof s=="number"&&dd(s)}function Sn(s){if(!ke(s))return!1;var l=et(s);return l==Ps||l==vf||l==x0||l==T0}function Nh(s){return typeof s=="number"&&s==Q(s)}function xo(s){return typeof s=="number"&&s>-1&&s%1==0&&s<=qe}function ke(s){var l=typeof s;return s!=null&&(l=="object"||l=="function")}function Te(s){return s!=null&&typeof s=="object"}var Rh=qf?mt(qf):ob;function rw(s,l){return s===l||Ma(s,l,Ga(l))}function iw(s,l,c){return c=typeof c=="function"?c:t,Ma(s,l,Ga(l),c)}function sw(s){return Lh(s)&&s!=+s}function ow(s){if(Ub(s))throw new X(o);return Ed(s)}function lw(s){return s===null}function aw(s){return s==null}function Lh(s){return typeof s=="number"||Te(s)&&et(s)==zi}function is(s){if(!Te(s)||et(s)!=hn)return!1;var l=js(s);if(l===null)return!0;var c=ye.call(l,"constructor")&&l.constructor;return typeof c=="function"&&c instanceof c&&Ks.call(c)==i1}var ru=Jf?mt(Jf):lb;function uw(s){return Nh(s)&&s>=-qe&&s<=qe}var Ph=jf?mt(jf):ab;function ko(s){return typeof s=="string"||!Z(s)&&Te(s)&&et(s)==$i}function yt(s){return typeof s=="symbol"||Te(s)&&et(s)==Ds}var si=Yf?mt(Yf):ub;function cw(s){return s===t}function fw(s){return Te(s)&&je(s)==Wi}function dw(s){return Te(s)&&et(s)==A0}var hw=po(Ia),pw=po(function(s,l){return s<=l});function Dh(s){if(!s)return[];if(ut(s))return ko(s)?Bt(s):at(s);if(Ki&&s[Ki])return Gy(s[Ki]());var l=je(s),c=l==Dt?ba:l==Ft?Ws:oi;return c(s)}function wn(s){if(!s)return s===0?s:0;if(s=Ot(s),s===Ze||s===-Ze){var l=s<0?-1:1;return l*dn}return s===s?s:0}function Q(s){var l=wn(s),c=l%1;return l===l?c?l-c:l:0}function Fh(s){return s?fr(Q(s),0,Qe):0}function Ot(s){if(typeof s=="number")return s;if(yt(s))return Yt;if(ke(s)){var l=typeof s.valueOf=="function"?s.valueOf():s;s=ke(l)?l+"":l}if(typeof s!="string")return s===0?s:+s;s=nd(s);var c=j0.test(s);return c||X0.test(s)?My(s.slice(2),c?2:8):J0.test(s)?Yt:+s}function Bh(s){return Zt(s,ct(s))}function mw(s){return s?fr(Q(s),-qe,qe):s===0?s:0}function ge(s){return s==null?"":gt(s)}var gw=ni(function(s,l){if(ns(l)||ut(l)){Zt(l,De(l),s);return}for(var c in l)ye.call(l,c)&&Yi(s,c,l[c])}),zh=ni(function(s,l){Zt(l,ct(l),s)}),Eo=ni(function(s,l,c,d){Zt(l,ct(l),s,d)}),yw=ni(function(s,l,c,d){Zt(l,De(l),s,d)}),bw=bn(ka);function vw(s,l){var c=ti(s);return l==null?c:yd(c,l)}var Sw=ne(function(s,l){s=be(s);var c=-1,d=l.length,g=d>2?l[2]:t;for(g&&tt(l[0],l[1],g)&&(d=1);++c<d;)for(var v=l[c],w=ct(v),_=-1,E=w.length;++_<E;){var O=w[_],I=s[O];(I===t||Ht(I,Zr[O])&&!ye.call(s,O))&&(s[O]=v[O])}return s}),ww=ne(function(s){return s.push(t,nh),pt(Hh,t,s)});function _w(s,l){return Zf(s,q(l,3),Xt)}function xw(s,l){return Zf(s,q(l,3),Ta)}function kw(s,l){return s==null?s:Ea(s,q(l,3),ct)}function Ew(s,l){return s==null?s:_d(s,q(l,3),ct)}function Tw(s,l){return s&&Xt(s,q(l,3))}function Cw(s,l){return s&&Ta(s,q(l,3))}function Aw(s){return s==null?[]:so(s,De(s))}function Mw(s){return s==null?[]:so(s,ct(s))}function iu(s,l,c){var d=s==null?t:dr(s,l);return d===t?c:d}function Ow(s,l){return s!=null&&sh(s,l,Q1)}function su(s,l){return s!=null&&sh(s,l,eb)}var Iw=Xd(function(s,l,c){l!=null&&typeof l.toString!="function"&&(l=Gs.call(l)),s[l]=c},lu(ft)),Nw=Xd(function(s,l,c){l!=null&&typeof l.toString!="function"&&(l=Gs.call(l)),ye.call(s,l)?s[l].push(c):s[l]=[c]},q),Rw=ne(Zi);function De(s){return ut(s)?md(s):Oa(s)}function ct(s){return ut(s)?md(s,!0):cb(s)}function Lw(s,l){var c={};return l=q(l,3),Xt(s,function(d,g,v){gn(c,l(d,g,v),d)}),c}function Pw(s,l){var c={};return l=q(l,3),Xt(s,function(d,g,v){gn(c,g,l(d,g,v))}),c}var Dw=ni(function(s,l,c){oo(s,l,c)}),Hh=ni(function(s,l,c,d){oo(s,l,c,d)}),Fw=bn(function(s,l){var c={};if(s==null)return c;var d=!1;l=_e(l,function(v){return v=Rn(v,s),d||(d=v.length>1),v}),Zt(s,Va(s),c),d&&(c=Ct(c,p|b|S,Ib));for(var g=l.length;g--;)Da(c,l[g]);return c});function Bw(s,l){return $h(s,_o(q(l)))}var zw=bn(function(s,l){return s==null?{}:db(s,l)});function $h(s,l){if(s==null)return{};var c=_e(Va(s),function(d){return[d]});return l=q(l),Nd(s,c,function(d,g){return l(d,g[0])})}function Hw(s,l,c){l=Rn(l,s);var d=-1,g=l.length;for(g||(g=1,s=t);++d<g;){var v=s==null?t:s[Qt(l[d])];v===t&&(d=g,v=c),s=Sn(v)?v.call(s):v}return s}function $w(s,l,c){return s==null?s:es(s,l,c)}function Ww(s,l,c,d){return d=typeof d=="function"?d:t,s==null?s:es(s,l,c,d)}var Wh=eh(De),Uh=eh(ct);function Uw(s,l,c){var d=Z(s),g=d||Pn(s)||si(s);if(l=q(l,4),c==null){var v=s&&s.constructor;g?c=d?new v:[]:ke(s)?c=Sn(v)?ti(js(s)):{}:c={}}return(g?kt:Xt)(s,function(w,_,E){return l(c,w,_,E)}),c}function Vw(s,l){return s==null?!0:Da(s,l)}function Kw(s,l,c){return s==null?s:Fd(s,l,za(c))}function Gw(s,l,c,d){return d=typeof d=="function"?d:t,s==null?s:Fd(s,l,za(c),d)}function oi(s){return s==null?[]:ya(s,De(s))}function qw(s){return s==null?[]:ya(s,ct(s))}function Jw(s,l,c){return c===t&&(c=l,l=t),c!==t&&(c=Ot(c),c=c===c?c:0),l!==t&&(l=Ot(l),l=l===l?l:0),fr(Ot(s),l,c)}function jw(s,l,c){return l=wn(l),c===t?(c=l,l=0):c=wn(c),s=Ot(s),tb(s,l,c)}function Yw(s,l,c){if(c&&typeof c!="boolean"&&tt(s,l,c)&&(l=c=t),c===t&&(typeof l=="boolean"?(c=l,l=t):typeof s=="boolean"&&(c=s,s=t)),s===t&&l===t?(s=0,l=1):(s=wn(s),l===t?(l=s,s=0):l=wn(l)),s>l){var d=s;s=l,l=d}if(c||s%1||l%1){var g=hd();return Je(s+g*(l-s+Ay("1e-"+((g+"").length-1))),l)}return Ra(s,l)}var Xw=ri(function(s,l,c){return l=l.toLowerCase(),s+(c?Vh(l):l)});function Vh(s){return ou(ge(s).toLowerCase())}function Kh(s){return s=ge(s),s&&s.replace(Q0,$y).replace(by,"")}function Zw(s,l,c){s=ge(s),l=gt(l);var d=s.length;c=c===t?d:fr(Q(c),0,d);var g=c;return c-=l.length,c>=0&&s.slice(c,g)==l}function Qw(s){return s=ge(s),s&&R0.test(s)?s.replace(_f,Wy):s}function e_(s){return s=ge(s),s&&z0.test(s)?s.replace(ta,"\\$&"):s}var t_=ri(function(s,l,c){return s+(c?"-":"")+l.toLowerCase()}),n_=ri(function(s,l,c){return s+(c?" ":"")+l.toLowerCase()}),r_=Jd("toLowerCase");function i_(s,l,c){s=ge(s),l=Q(l);var d=l?Yr(s):0;if(!l||d>=l)return s;var g=(l-d)/2;return ho(Qs(g),c)+s+ho(Zs(g),c)}function s_(s,l,c){s=ge(s),l=Q(l);var d=l?Yr(s):0;return l&&d<l?s+ho(l-d,c):s}function o_(s,l,c){s=ge(s),l=Q(l);var d=l?Yr(s):0;return l&&d<l?ho(l-d,c)+s:s}function l_(s,l,c){return c||l==null?l=0:l&&(l=+l),p1(ge(s).replace(na,""),l||0)}function a_(s,l,c){return(c?tt(s,l,c):l===t)?l=1:l=Q(l),La(ge(s),l)}function u_(){var s=arguments,l=ge(s[0]);return s.length<3?l:l.replace(s[1],s[2])}var c_=ri(function(s,l,c){return s+(c?"_":"")+l.toLowerCase()});function f_(s,l,c){return c&&typeof c!="number"&&tt(s,l,c)&&(l=c=t),c=c===t?Qe:c>>>0,c?(s=ge(s),s&&(typeof l=="string"||l!=null&&!ru(l))&&(l=gt(l),!l&&jr(s))?Ln(Bt(s),0,c):s.split(l,c)):[]}var d_=ri(function(s,l,c){return s+(c?" ":"")+ou(l)});function h_(s,l,c){return s=ge(s),c=c==null?0:fr(Q(c),0,s.length),l=gt(l),s.slice(c,c+l.length)==l}function p_(s,l,c){var d=y.templateSettings;c&&tt(s,l,c)&&(l=t),s=ge(s),l=Eo({},l,d,th);var g=Eo({},l.imports,d.imports,th),v=De(g),w=ya(g,v),_,E,O=0,I=l.interpolate||Fs,R="__p += '",z=va((l.escape||Fs).source+"|"+I.source+"|"+(I===xf?q0:Fs).source+"|"+(l.evaluate||Fs).source+"|$","g"),U="//# sourceURL="+(ye.call(l,"sourceURL")?(l.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++xy+"]")+`
24
- `;s.replace(z,function(j,re,ae,bt,nt,vt){return ae||(ae=bt),R+=s.slice(O,vt).replace(ey,Uy),re&&(_=!0,R+=`' +
25
- __e(`+re+`) +
26
- '`),nt&&(E=!0,R+=`';
27
- `+nt+`;
28
- __p += '`),ae&&(R+=`' +
29
- ((__t = (`+ae+`)) == null ? '' : __t) +
30
- '`),O=vt+j.length,j}),R+=`';
31
- `;var J=ye.call(l,"variable")&&l.variable;if(!J)R=`with (obj) {
32
- `+R+`
21
+ `)}function $b(s){return Q(s)||br(s)||!!(bd&&s&&s[bd])}function _n(s,l){var u=typeof s;return l=l??Ye,!!l&&(u=="number"||u!="symbol"&&Q0.test(s))&&s>-1&&s%1==0&&s<l}function it(s,l,u){if(!Ee(u))return!1;var d=typeof l;return(d=="number"?ft(u)&&_n(l,u.length):d=="string"&&l in u)?Gt(u[l],s):!1}function ec(s,l){if(Q(s))return!1;var u=typeof s;return u=="number"||u=="symbol"||u=="boolean"||s==null||vt(s)?!0:B0.test(s)||!F0.test(s)||l!=null&&s in ve(l)}function Wb(s){var l=typeof s;return l=="string"||l=="number"||l=="symbol"||l=="boolean"?s!=="__proto__":s===null}function tc(s){var l=So(s),u=b[l];if(typeof u!="function"||!(l in le.prototype))return!1;if(s===u)return!0;var d=Xa(u);return!!d&&s===d[0]}function Ub(s){return!!pd&&pd in s}var Vb=js?kn:bc;function is(s){var l=s&&s.constructor,u=typeof l=="function"&&l.prototype||Zr;return s===u}function ph(s){return s===s&&!Ee(s)}function mh(s,l){return function(u){return u==null?!1:u[s]===l&&(l!==t||s in ve(u))}}function Kb(s){var l=To(s,function(d){return u.size===h&&u.clear(),d}),u=l.cache;return l}function Gb(s,l){var u=s[1],d=l[1],g=u|d,v=g<(A|R|ue),x=d==ue&&u==V||d==ue&&u==Tt&&s[7].length<=l[8]||d==(ue|Tt)&&l[7].length<=l[8]&&u==V;if(!(v||x))return s;d&A&&(s[2]=l[2],g|=u&A?0:K);var w=l[3];if(w){var E=s[3];s[3]=E?Xd(E,w,l[4]):w,s[4]=E?Dn(s[3],m):l[4]}return w=l[5],w&&(E=s[5],s[5]=E?Zd(E,w,l[6]):w,s[6]=E?Dn(s[5],m):l[6]),w=l[7],w&&(s[7]=w),d&ue&&(s[8]=s[8]==null?l[8]:Xe(s[8],l[8])),s[9]==null&&(s[9]=l[9]),s[0]=l[0],s[1]=g,s}function qb(s){var l=[];if(s!=null)for(var u in ve(s))l.push(u);return l}function Jb(s){return Xs.call(s)}function gh(s,l,u){return l=De(l===t?s.length-1:l,0),function(){for(var d=arguments,g=-1,v=De(d.length-l,0),x=T(v);++g<v;)x[g]=d[l+g];g=-1;for(var w=T(l+1);++g<l;)w[g]=d[g];return w[l]=u(x),gt(s,this,w)}}function yh(s,l){return l.length<2?s:mr(s,Nt(l,0,-1))}function jb(s,l){for(var u=s.length,d=Xe(l.length,u),g=ut(s);d--;){var v=l[d];s[d]=_n(v,u)?g[v]:t}return s}function nc(s,l){if(!(l==="constructor"&&typeof s[l]=="function")&&l!="__proto__")return s[l]}var bh=Sh($d),ss=u1||function(s,l){return Ue.setTimeout(s,l)},rc=Sh(bb);function vh(s,l,u){var d=l+"";return rc(s,Hb(d,Yb(Fb(d),u)))}function Sh(s){var l=0,u=0;return function(){var d=p1(),g=$r-(d-u);if(u=d,g>0){if(++l>=ar)return arguments[0]}else l=0;return s.apply(t,arguments)}}function wo(s,l){var u=-1,d=s.length,g=d-1;for(l=l===t?d:l;++u<l;){var v=za(u,g),x=s[v];s[v]=s[u],s[u]=x}return s.length=l,s}var xh=Kb(function(s){var l=[];return s.charCodeAt(0)===46&&l.push(""),s.replace(z0,function(u,d,g,v){l.push(g?v.replace(q0,"$1"):d||u)}),l});function sn(s){if(typeof s=="string"||vt(s))return s;var l=s+"";return l=="0"&&1/s==-tt?"-0":l}function yr(s){if(s!=null){try{return Ys.call(s)}catch{}try{return s+""}catch{}}return""}function Yb(s,l){return At(_0,function(u){var d="_."+u[0];l&u[1]&&!Ks(s,d)&&s.push(d)}),s.sort()}function wh(s){if(s instanceof le)return s.clone();var l=new Ot(s.__wrapped__,s.__chain__);return l.__actions__=ut(s.__actions__),l.__index__=s.__index__,l.__values__=s.__values__,l}function Xb(s,l,u){(u?it(s,l,u):l===t)?l=1:l=De(ee(l),0);var d=s==null?0:s.length;if(!d||l<1)return[];for(var g=0,v=0,x=T(ro(d/l));g<d;)x[v++]=Nt(s,g,g+=l);return x}function Zb(s){for(var l=-1,u=s==null?0:s.length,d=0,g=[];++l<u;){var v=s[l];v&&(g[d++]=v)}return g}function Qb(){var s=arguments.length;if(!s)return[];for(var l=T(s-1),u=arguments[0],d=s;d--;)l[d-1]=arguments[d];return Pn(Q(u)?ut(u):[u],Ve(l,1))}var ev=re(function(s,l){return Me(s)?Qi(s,Ve(l,1,Me,!0)):[]}),tv=re(function(s,l){var u=Rt(l);return Me(u)&&(u=t),Me(s)?Qi(s,Ve(l,1,Me,!0),J(u,2)):[]}),nv=re(function(s,l){var u=Rt(l);return Me(u)&&(u=t),Me(s)?Qi(s,Ve(l,1,Me,!0),t,u):[]});function rv(s,l,u){var d=s==null?0:s.length;return d?(l=u||l===t?1:ee(l),Nt(s,l<0?0:l,d)):[]}function iv(s,l,u){var d=s==null?0:s.length;return d?(l=u||l===t?1:ee(l),l=d-l,Nt(s,0,l<0?0:l)):[]}function sv(s,l){return s&&s.length?po(s,J(l,3),!0,!0):[]}function ov(s,l){return s&&s.length?po(s,J(l,3),!0):[]}function lv(s,l,u,d){var g=s==null?0:s.length;return g?(u&&typeof u!="number"&&it(s,l,u)&&(u=0,d=g),Q1(s,l,u,d)):[]}function _h(s,l,u){var d=s==null?0:s.length;if(!d)return-1;var g=u==null?0:ee(u);return g<0&&(g=De(d+g,0)),Gs(s,J(l,3),g)}function kh(s,l,u){var d=s==null?0:s.length;if(!d)return-1;var g=d-1;return u!==t&&(g=ee(u),g=u<0?De(d+g,0):Xe(g,d-1)),Gs(s,J(l,3),g,!0)}function Eh(s){var l=s==null?0:s.length;return l?Ve(s,1):[]}function av(s){var l=s==null?0:s.length;return l?Ve(s,tt):[]}function cv(s,l){var u=s==null?0:s.length;return u?(l=l===t?1:ee(l),Ve(s,l)):[]}function uv(s){for(var l=-1,u=s==null?0:s.length,d={};++l<u;){var g=s[l];d[g[0]]=g[1]}return d}function Th(s){return s&&s.length?s[0]:t}function fv(s,l,u){var d=s==null?0:s.length;if(!d)return-1;var g=u==null?0:ee(u);return g<0&&(g=De(d+g,0)),Jr(s,l,g)}function dv(s){var l=s==null?0:s.length;return l?Nt(s,0,-1):[]}var hv=re(function(s){var l=_e(s,Va);return l.length&&l[0]===s[0]?La(l):[]}),pv=re(function(s){var l=Rt(s),u=_e(s,Va);return l===Rt(u)?l=t:u.pop(),u.length&&u[0]===s[0]?La(u,J(l,2)):[]}),mv=re(function(s){var l=Rt(s),u=_e(s,Va);return l=typeof l=="function"?l:t,l&&u.pop(),u.length&&u[0]===s[0]?La(u,t,l):[]});function gv(s,l){return s==null?"":d1.call(s,l)}function Rt(s){var l=s==null?0:s.length;return l?s[l-1]:t}function yv(s,l,u){var d=s==null?0:s.length;if(!d)return-1;var g=d;return u!==t&&(g=ee(u),g=g<0?De(d+g,0):Xe(g,d-1)),l===l?Yy(s,l,g):Gs(s,od,g,!0)}function bv(s,l){return s&&s.length?Fd(s,ee(l)):t}var vv=re(Ch);function Ch(s,l){return s&&s.length&&l&&l.length?Ba(s,l):s}function Sv(s,l,u){return s&&s.length&&l&&l.length?Ba(s,l,J(u,2)):s}function xv(s,l,u){return s&&s.length&&l&&l.length?Ba(s,l,t,u):s}var wv=wn(function(s,l){var u=s==null?0:s.length,d=Oa(s,l);return Hd(s,_e(l,function(g){return _n(g,u)?+g:g}).sort(Yd)),d});function _v(s,l){var u=[];if(!(s&&s.length))return u;var d=-1,g=[],v=s.length;for(l=J(l,3);++d<v;){var x=s[d];l(x,d,s)&&(u.push(x),g.push(d))}return Hd(s,g),u}function ic(s){return s==null?s:g1.call(s)}function kv(s,l,u){var d=s==null?0:s.length;return d?(u&&typeof u!="number"&&it(s,l,u)?(l=0,u=d):(l=l==null?0:ee(l),u=u===t?d:ee(u)),Nt(s,l,u)):[]}function Ev(s,l){return ho(s,l)}function Tv(s,l,u){return $a(s,l,J(u,2))}function Cv(s,l){var u=s==null?0:s.length;if(u){var d=ho(s,l);if(d<u&&Gt(s[d],l))return d}return-1}function Av(s,l){return ho(s,l,!0)}function Mv(s,l,u){return $a(s,l,J(u,2),!0)}function Ov(s,l){var u=s==null?0:s.length;if(u){var d=ho(s,l,!0)-1;if(Gt(s[d],l))return d}return-1}function Iv(s){return s&&s.length?Wd(s):[]}function Nv(s,l){return s&&s.length?Wd(s,J(l,2)):[]}function Rv(s){var l=s==null?0:s.length;return l?Nt(s,1,l):[]}function Lv(s,l,u){return s&&s.length?(l=u||l===t?1:ee(l),Nt(s,0,l<0?0:l)):[]}function Pv(s,l,u){var d=s==null?0:s.length;return d?(l=u||l===t?1:ee(l),l=d-l,Nt(s,l<0?0:l,d)):[]}function Dv(s,l){return s&&s.length?po(s,J(l,3),!1,!0):[]}function Fv(s,l){return s&&s.length?po(s,J(l,3)):[]}var Bv=re(function(s){return zn(Ve(s,1,Me,!0))}),zv=re(function(s){var l=Rt(s);return Me(l)&&(l=t),zn(Ve(s,1,Me,!0),J(l,2))}),Hv=re(function(s){var l=Rt(s);return l=typeof l=="function"?l:t,zn(Ve(s,1,Me,!0),t,l)});function $v(s){return s&&s.length?zn(s):[]}function Wv(s,l){return s&&s.length?zn(s,J(l,2)):[]}function Uv(s,l){return l=typeof l=="function"?l:t,s&&s.length?zn(s,t,l):[]}function sc(s){if(!(s&&s.length))return[];var l=0;return s=Ln(s,function(u){if(Me(u))return l=De(u.length,l),!0}),wa(l,function(u){return _e(s,va(u))})}function Ah(s,l){if(!(s&&s.length))return[];var u=sc(s);return l==null?u:_e(u,function(d){return gt(l,t,d)})}var Vv=re(function(s,l){return Me(s)?Qi(s,l):[]}),Kv=re(function(s){return Ua(Ln(s,Me))}),Gv=re(function(s){var l=Rt(s);return Me(l)&&(l=t),Ua(Ln(s,Me),J(l,2))}),qv=re(function(s){var l=Rt(s);return l=typeof l=="function"?l:t,Ua(Ln(s,Me),t,l)}),Jv=re(sc);function jv(s,l){return Gd(s||[],l||[],Zi)}function Yv(s,l){return Gd(s||[],l||[],ns)}var Xv=re(function(s){var l=s.length,u=l>1?s[l-1]:t;return u=typeof u=="function"?(s.pop(),u):t,Ah(s,u)});function Mh(s){var l=b(s);return l.__chain__=!0,l}function Zv(s,l){return l(s),s}function _o(s,l){return l(s)}var Qv=wn(function(s){var l=s.length,u=l?s[0]:0,d=this.__wrapped__,g=function(v){return Oa(v,s)};return l>1||this.__actions__.length||!(d instanceof le)||!_n(u)?this.thru(g):(d=d.slice(u,+u+(l?1:0)),d.__actions__.push({func:_o,args:[g],thisArg:t}),new Ot(d,this.__chain__).thru(function(v){return l&&!v.length&&v.push(t),v}))});function eS(){return Mh(this)}function tS(){return new Ot(this.value(),this.__chain__)}function nS(){this.__values__===t&&(this.__values__=Uh(this.value()));var s=this.__index__>=this.__values__.length,l=s?t:this.__values__[this.__index__++];return{done:s,value:l}}function rS(){return this}function iS(s){for(var l,u=this;u instanceof lo;){var d=wh(u);d.__index__=0,d.__values__=t,l?g.__wrapped__=d:l=d;var g=d;u=u.__wrapped__}return g.__wrapped__=s,l}function sS(){var s=this.__wrapped__;if(s instanceof le){var l=s;return this.__actions__.length&&(l=new le(this)),l=l.reverse(),l.__actions__.push({func:_o,args:[ic],thisArg:t}),new Ot(l,this.__chain__)}return this.thru(ic)}function oS(){return Kd(this.__wrapped__,this.__actions__)}var lS=mo(function(s,l,u){be.call(s,u)?++s[u]:Sn(s,u,1)});function aS(s,l,u){var d=Q(s)?id:Z1;return u&&it(s,l,u)&&(l=t),d(s,J(l,3))}function cS(s,l){var u=Q(s)?Ln:Ad;return u(s,J(l,3))}var uS=nh(_h),fS=nh(kh);function dS(s,l){return Ve(ko(s,l),1)}function hS(s,l){return Ve(ko(s,l),tt)}function pS(s,l,u){return u=u===t?1:ee(u),Ve(ko(s,l),u)}function Oh(s,l){var u=Q(s)?At:Bn;return u(s,J(l,3))}function Ih(s,l){var u=Q(s)?Ry:Cd;return u(s,J(l,3))}var mS=mo(function(s,l,u){be.call(s,u)?s[u].push(l):Sn(s,u,[l])});function gS(s,l,u,d){s=ft(s)?s:oi(s),u=u&&!d?ee(u):0;var g=s.length;return u<0&&(u=De(g+u,0)),Mo(s)?u<=g&&s.indexOf(l,u)>-1:!!g&&Jr(s,l,u)>-1}var yS=re(function(s,l,u){var d=-1,g=typeof l=="function",v=ft(s)?T(s.length):[];return Bn(s,function(x){v[++d]=g?gt(l,x,u):es(x,l,u)}),v}),bS=mo(function(s,l,u){Sn(s,u,l)});function ko(s,l){var u=Q(s)?_e:Ld;return u(s,J(l,3))}function vS(s,l,u,d){return s==null?[]:(Q(l)||(l=l==null?[]:[l]),u=d?t:u,Q(u)||(u=u==null?[]:[u]),Bd(s,l,u))}var SS=mo(function(s,l,u){s[u?0:1].push(l)},function(){return[[],[]]});function xS(s,l,u){var d=Q(s)?ya:ad,g=arguments.length<3;return d(s,J(l,4),u,g,Bn)}function wS(s,l,u){var d=Q(s)?Ly:ad,g=arguments.length<3;return d(s,J(l,4),u,g,Cd)}function _S(s,l){var u=Q(s)?Ln:Ad;return u(s,Co(J(l,3)))}function kS(s){var l=Q(s)?_d:gb;return l(s)}function ES(s,l,u){(u?it(s,l,u):l===t)?l=1:l=ee(l);var d=Q(s)?q1:yb;return d(s,l)}function TS(s){var l=Q(s)?J1:vb;return l(s)}function CS(s){if(s==null)return 0;if(ft(s))return Mo(s)?Yr(s):s.length;var l=Ze(s);return l==Wt||l==Ut?s.size:Da(s).length}function AS(s,l,u){var d=Q(s)?ba:Sb;return u&&it(s,l,u)&&(l=t),d(s,J(l,3))}var MS=re(function(s,l){if(s==null)return[];var u=l.length;return u>1&&it(s,l[0],l[1])?l=[]:u>2&&it(l[0],l[1],l[2])&&(l=[l[0]]),Bd(s,Ve(l,1),[])}),Eo=c1||function(){return Ue.Date.now()};function OS(s,l){if(typeof l!="function")throw new Mt(a);return s=ee(s),function(){if(--s<1)return l.apply(this,arguments)}}function Nh(s,l,u){return l=u?t:l,l=s&&l==null?s.length:l,xn(s,ue,t,t,t,t,l)}function Rh(s,l){var u;if(typeof l!="function")throw new Mt(a);return s=ee(s),function(){return--s>0&&(u=l.apply(this,arguments)),s<=1&&(l=t),u}}var oc=re(function(s,l,u){var d=A;if(u.length){var g=Dn(u,ii(oc));d|=ie}return xn(s,d,l,u,g)}),Lh=re(function(s,l,u){var d=A|R;if(u.length){var g=Dn(u,ii(Lh));d|=ie}return xn(l,d,s,u,g)});function Ph(s,l,u){l=u?t:l;var d=xn(s,V,t,t,t,t,t,l);return d.placeholder=Ph.placeholder,d}function Dh(s,l,u){l=u?t:l;var d=xn(s,G,t,t,t,t,t,l);return d.placeholder=Dh.placeholder,d}function Fh(s,l,u){var d,g,v,x,w,E,O=0,I=!1,N=!1,B=!0;if(typeof s!="function")throw new Mt(a);l=Lt(l)||0,Ee(u)&&(I=!!u.leading,N="maxWait"in u,v=N?De(Lt(u.maxWait)||0,l):v,B="trailing"in u?!!u.trailing:B);function W(Oe){var qt=d,Tn=g;return d=g=t,O=Oe,x=s.apply(Tn,qt),x}function j(Oe){return O=Oe,w=ss(se,l),I?W(Oe):x}function ne(Oe){var qt=Oe-E,Tn=Oe-O,np=l-qt;return N?Xe(np,v-Tn):np}function Y(Oe){var qt=Oe-E,Tn=Oe-O;return E===t||qt>=l||qt<0||N&&Tn>=v}function se(){var Oe=Eo();if(Y(Oe))return ce(Oe);w=ss(se,ne(Oe))}function ce(Oe){return w=t,B&&d?W(Oe):(d=g=t,x)}function St(){w!==t&&qd(w),O=0,d=E=g=w=t}function st(){return w===t?x:ce(Eo())}function xt(){var Oe=Eo(),qt=Y(Oe);if(d=arguments,g=this,E=Oe,qt){if(w===t)return j(E);if(N)return qd(w),w=ss(se,l),W(E)}return w===t&&(w=ss(se,l)),x}return xt.cancel=St,xt.flush=st,xt}var IS=re(function(s,l){return Td(s,1,l)}),NS=re(function(s,l,u){return Td(s,Lt(l)||0,u)});function RS(s){return xn(s,Fi)}function To(s,l){if(typeof s!="function"||l!=null&&typeof l!="function")throw new Mt(a);var u=function(){var d=arguments,g=l?l.apply(this,d):d[0],v=u.cache;if(v.has(g))return v.get(g);var x=s.apply(this,d);return u.cache=v.set(g,x)||v,x};return u.cache=new(To.Cache||vn),u}To.Cache=vn;function Co(s){if(typeof s!="function")throw new Mt(a);return function(){var l=arguments;switch(l.length){case 0:return!s.call(this);case 1:return!s.call(this,l[0]);case 2:return!s.call(this,l[0],l[1]);case 3:return!s.call(this,l[0],l[1],l[2])}return!s.apply(this,l)}}function LS(s){return Rh(2,s)}var PS=xb(function(s,l){l=l.length==1&&Q(l[0])?_e(l[0],yt(J())):_e(Ve(l,1),yt(J()));var u=l.length;return re(function(d){for(var g=-1,v=Xe(d.length,u);++g<v;)d[g]=l[g].call(this,d[g]);return gt(s,this,d)})}),lc=re(function(s,l){var u=Dn(l,ii(lc));return xn(s,ie,t,l,u)}),Bh=re(function(s,l){var u=Dn(l,ii(Bh));return xn(s,q,t,l,u)}),DS=wn(function(s,l){return xn(s,Tt,t,t,t,l)});function FS(s,l){if(typeof s!="function")throw new Mt(a);return l=l===t?l:ee(l),re(s,l)}function BS(s,l){if(typeof s!="function")throw new Mt(a);return l=l==null?0:De(ee(l),0),re(function(u){var d=u[l],g=$n(u,0,l);return d&&Pn(g,d),gt(s,this,g)})}function zS(s,l,u){var d=!0,g=!0;if(typeof s!="function")throw new Mt(a);return Ee(u)&&(d="leading"in u?!!u.leading:d,g="trailing"in u?!!u.trailing:g),Fh(s,l,{leading:d,maxWait:l,trailing:g})}function HS(s){return Nh(s,1)}function $S(s,l){return lc(Ka(l),s)}function WS(){if(!arguments.length)return[];var s=arguments[0];return Q(s)?s:[s]}function US(s){return It(s,S)}function VS(s,l){return l=typeof l=="function"?l:t,It(s,S,l)}function KS(s){return It(s,p|S)}function GS(s,l){return l=typeof l=="function"?l:t,It(s,p|S,l)}function qS(s,l){return l==null||Ed(s,l,Fe(l))}function Gt(s,l){return s===l||s!==s&&l!==l}var JS=vo(Ra),jS=vo(function(s,l){return s>=l}),br=Id(function(){return arguments}())?Id:function(s){return Ae(s)&&be.call(s,"callee")&&!yd.call(s,"callee")},Q=T.isArray,YS=Zf?yt(Zf):ib;function ft(s){return s!=null&&Ao(s.length)&&!kn(s)}function Me(s){return Ae(s)&&ft(s)}function XS(s){return s===!0||s===!1||Ae(s)&&rt(s)==zi}var Wn=f1||bc,ZS=Qf?yt(Qf):sb;function QS(s){return Ae(s)&&s.nodeType===1&&!ls(s)}function ex(s){if(s==null)return!0;if(ft(s)&&(Q(s)||typeof s=="string"||typeof s.splice=="function"||Wn(s)||si(s)||br(s)))return!s.length;var l=Ze(s);if(l==Wt||l==Ut)return!s.size;if(is(s))return!Da(s).length;for(var u in s)if(be.call(s,u))return!1;return!0}function tx(s,l){return ts(s,l)}function nx(s,l,u){u=typeof u=="function"?u:t;var d=u?u(s,l):t;return d===t?ts(s,l,t,u):!!d}function ac(s){if(!Ae(s))return!1;var l=rt(s);return l==zs||l==E0||typeof s.message=="string"&&typeof s.name=="string"&&!ls(s)}function rx(s){return typeof s=="number"&&vd(s)}function kn(s){if(!Ee(s))return!1;var l=rt(s);return l==Hs||l==Tf||l==k0||l==C0}function zh(s){return typeof s=="number"&&s==ee(s)}function Ao(s){return typeof s=="number"&&s>-1&&s%1==0&&s<=Ye}function Ee(s){var l=typeof s;return s!=null&&(l=="object"||l=="function")}function Ae(s){return s!=null&&typeof s=="object"}var Hh=ed?yt(ed):lb;function ix(s,l){return s===l||Pa(s,l,Za(l))}function sx(s,l,u){return u=typeof u=="function"?u:t,Pa(s,l,Za(l),u)}function ox(s){return $h(s)&&s!=+s}function lx(s){if(Vb(s))throw new Z(o);return Nd(s)}function ax(s){return s===null}function cx(s){return s==null}function $h(s){return typeof s=="number"||Ae(s)&&rt(s)==$i}function ls(s){if(!Ae(s)||rt(s)!=yn)return!1;var l=eo(s);if(l===null)return!0;var u=be.call(l,"constructor")&&l.constructor;return typeof u=="function"&&u instanceof u&&Ys.call(u)==s1}var cc=td?yt(td):ab;function ux(s){return zh(s)&&s>=-Ye&&s<=Ye}var Wh=nd?yt(nd):cb;function Mo(s){return typeof s=="string"||!Q(s)&&Ae(s)&&rt(s)==Ui}function vt(s){return typeof s=="symbol"||Ae(s)&&rt(s)==$s}var si=rd?yt(rd):ub;function fx(s){return s===t}function dx(s){return Ae(s)&&Ze(s)==Vi}function hx(s){return Ae(s)&&rt(s)==M0}var px=vo(Fa),mx=vo(function(s,l){return s<=l});function Uh(s){if(!s)return[];if(ft(s))return Mo(s)?Vt(s):ut(s);if(qi&&s[qi])return qy(s[qi]());var l=Ze(s),u=l==Wt?ka:l==Ut?qs:oi;return u(s)}function En(s){if(!s)return s===0?s:0;if(s=Lt(s),s===tt||s===-tt){var l=s<0?-1:1;return l*gn}return s===s?s:0}function ee(s){var l=En(s),u=l%1;return l===l?u?l-u:l:0}function Vh(s){return s?pr(ee(s),0,nt):0}function Lt(s){if(typeof s=="number")return s;if(vt(s))return tn;if(Ee(s)){var l=typeof s.valueOf=="function"?s.valueOf():s;s=Ee(l)?l+"":l}if(typeof s!="string")return s===0?s:+s;s=cd(s);var u=Y0.test(s);return u||Z0.test(s)?Oy(s.slice(2),u?2:8):j0.test(s)?tn:+s}function Kh(s){return rn(s,dt(s))}function gx(s){return s?pr(ee(s),-Ye,Ye):s===0?s:0}function ge(s){return s==null?"":bt(s)}var yx=ni(function(s,l){if(is(l)||ft(l)){rn(l,Fe(l),s);return}for(var u in l)be.call(l,u)&&Zi(s,u,l[u])}),Gh=ni(function(s,l){rn(l,dt(l),s)}),Oo=ni(function(s,l,u,d){rn(l,dt(l),s,d)}),bx=ni(function(s,l,u,d){rn(l,Fe(l),s,d)}),vx=wn(Oa);function Sx(s,l){var u=ti(s);return l==null?u:kd(u,l)}var xx=re(function(s,l){s=ve(s);var u=-1,d=l.length,g=d>2?l[2]:t;for(g&&it(l[0],l[1],g)&&(d=1);++u<d;)for(var v=l[u],x=dt(v),w=-1,E=x.length;++w<E;){var O=x[w],I=s[O];(I===t||Gt(I,Zr[O])&&!be.call(s,O))&&(s[O]=v[O])}return s}),wx=re(function(s){return s.push(t,ch),gt(qh,t,s)});function _x(s,l){return sd(s,J(l,3),nn)}function kx(s,l){return sd(s,J(l,3),Na)}function Ex(s,l){return s==null?s:Ia(s,J(l,3),dt)}function Tx(s,l){return s==null?s:Md(s,J(l,3),dt)}function Cx(s,l){return s&&nn(s,J(l,3))}function Ax(s,l){return s&&Na(s,J(l,3))}function Mx(s){return s==null?[]:uo(s,Fe(s))}function Ox(s){return s==null?[]:uo(s,dt(s))}function uc(s,l,u){var d=s==null?t:mr(s,l);return d===t?u:d}function Ix(s,l){return s!=null&&dh(s,l,eb)}function fc(s,l){return s!=null&&dh(s,l,tb)}var Nx=ih(function(s,l,u){l!=null&&typeof l.toString!="function"&&(l=Xs.call(l)),s[l]=u},hc(ht)),Rx=ih(function(s,l,u){l!=null&&typeof l.toString!="function"&&(l=Xs.call(l)),be.call(s,l)?s[l].push(u):s[l]=[u]},J),Lx=re(es);function Fe(s){return ft(s)?wd(s):Da(s)}function dt(s){return ft(s)?wd(s,!0):fb(s)}function Px(s,l){var u={};return l=J(l,3),nn(s,function(d,g,v){Sn(u,l(d,g,v),d)}),u}function Dx(s,l){var u={};return l=J(l,3),nn(s,function(d,g,v){Sn(u,g,l(d,g,v))}),u}var Fx=ni(function(s,l,u){fo(s,l,u)}),qh=ni(function(s,l,u,d){fo(s,l,u,d)}),Bx=wn(function(s,l){var u={};if(s==null)return u;var d=!1;l=_e(l,function(v){return v=Hn(v,s),d||(d=v.length>1),v}),rn(s,Ya(s),u),d&&(u=It(u,p|y|S,Nb));for(var g=l.length;g--;)Wa(u,l[g]);return u});function zx(s,l){return Jh(s,Co(J(l)))}var Hx=wn(function(s,l){return s==null?{}:hb(s,l)});function Jh(s,l){if(s==null)return{};var u=_e(Ya(s),function(d){return[d]});return l=J(l),zd(s,u,function(d,g){return l(d,g[0])})}function $x(s,l,u){l=Hn(l,s);var d=-1,g=l.length;for(g||(g=1,s=t);++d<g;){var v=s==null?t:s[sn(l[d])];v===t&&(d=g,v=u),s=kn(v)?v.call(s):v}return s}function Wx(s,l,u){return s==null?s:ns(s,l,u)}function Ux(s,l,u,d){return d=typeof d=="function"?d:t,s==null?s:ns(s,l,u,d)}var jh=lh(Fe),Yh=lh(dt);function Vx(s,l,u){var d=Q(s),g=d||Wn(s)||si(s);if(l=J(l,4),u==null){var v=s&&s.constructor;g?u=d?new v:[]:Ee(s)?u=kn(v)?ti(eo(s)):{}:u={}}return(g?At:nn)(s,function(x,w,E){return l(u,x,w,E)}),u}function Kx(s,l){return s==null?!0:Wa(s,l)}function Gx(s,l,u){return s==null?s:Vd(s,l,Ka(u))}function qx(s,l,u,d){return d=typeof d=="function"?d:t,s==null?s:Vd(s,l,Ka(u),d)}function oi(s){return s==null?[]:_a(s,Fe(s))}function Jx(s){return s==null?[]:_a(s,dt(s))}function jx(s,l,u){return u===t&&(u=l,l=t),u!==t&&(u=Lt(u),u=u===u?u:0),l!==t&&(l=Lt(l),l=l===l?l:0),pr(Lt(s),l,u)}function Yx(s,l,u){return l=En(l),u===t?(u=l,l=0):u=En(u),s=Lt(s),nb(s,l,u)}function Xx(s,l,u){if(u&&typeof u!="boolean"&&it(s,l,u)&&(l=u=t),u===t&&(typeof l=="boolean"?(u=l,l=t):typeof s=="boolean"&&(u=s,s=t)),s===t&&l===t?(s=0,l=1):(s=En(s),l===t?(l=s,s=0):l=En(l)),s>l){var d=s;s=l,l=d}if(u||s%1||l%1){var g=Sd();return Xe(s+g*(l-s+My("1e-"+((g+"").length-1))),l)}return za(s,l)}var Zx=ri(function(s,l,u){return l=l.toLowerCase(),s+(u?Xh(l):l)});function Xh(s){return dc(ge(s).toLowerCase())}function Zh(s){return s=ge(s),s&&s.replace(ey,Wy).replace(vy,"")}function Qx(s,l,u){s=ge(s),l=bt(l);var d=s.length;u=u===t?d:pr(ee(u),0,d);var g=u;return u-=l.length,u>=0&&s.slice(u,g)==l}function ew(s){return s=ge(s),s&&L0.test(s)?s.replace(Mf,Uy):s}function tw(s){return s=ge(s),s&&H0.test(s)?s.replace(la,"\\$&"):s}var nw=ri(function(s,l,u){return s+(u?"-":"")+l.toLowerCase()}),rw=ri(function(s,l,u){return s+(u?" ":"")+l.toLowerCase()}),iw=th("toLowerCase");function sw(s,l,u){s=ge(s),l=ee(l);var d=l?Yr(s):0;if(!l||d>=l)return s;var g=(l-d)/2;return bo(io(g),u)+s+bo(ro(g),u)}function ow(s,l,u){s=ge(s),l=ee(l);var d=l?Yr(s):0;return l&&d<l?s+bo(l-d,u):s}function lw(s,l,u){s=ge(s),l=ee(l);var d=l?Yr(s):0;return l&&d<l?bo(l-d,u)+s:s}function aw(s,l,u){return u||l==null?l=0:l&&(l=+l),m1(ge(s).replace(aa,""),l||0)}function cw(s,l,u){return(u?it(s,l,u):l===t)?l=1:l=ee(l),Ha(ge(s),l)}function uw(){var s=arguments,l=ge(s[0]);return s.length<3?l:l.replace(s[1],s[2])}var fw=ri(function(s,l,u){return s+(u?"_":"")+l.toLowerCase()});function dw(s,l,u){return u&&typeof u!="number"&&it(s,l,u)&&(l=u=t),u=u===t?nt:u>>>0,u?(s=ge(s),s&&(typeof l=="string"||l!=null&&!cc(l))&&(l=bt(l),!l&&jr(s))?$n(Vt(s),0,u):s.split(l,u)):[]}var hw=ri(function(s,l,u){return s+(u?" ":"")+dc(l)});function pw(s,l,u){return s=ge(s),u=u==null?0:pr(ee(u),0,s.length),l=bt(l),s.slice(u,u+l.length)==l}function mw(s,l,u){var d=b.templateSettings;u&&it(s,l,u)&&(l=t),s=ge(s),l=Oo({},l,d,ah);var g=Oo({},l.imports,d.imports,ah),v=Fe(g),x=_a(g,v),w,E,O=0,I=l.interpolate||Ws,N="__p += '",B=Ea((l.escape||Ws).source+"|"+I.source+"|"+(I===Of?J0:Ws).source+"|"+(l.evaluate||Ws).source+"|$","g"),W="//# sourceURL="+(be.call(l,"sourceURL")?(l.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++ky+"]")+`
22
+ `;s.replace(B,function(Y,se,ce,St,st,xt){return ce||(ce=St),N+=s.slice(O,xt).replace(ty,Vy),se&&(w=!0,N+=`' +
23
+ __e(`+se+`) +
24
+ '`),st&&(E=!0,N+=`';
25
+ `+st+`;
26
+ __p += '`),ce&&(N+=`' +
27
+ ((__t = (`+ce+`)) == null ? '' : __t) +
28
+ '`),O=xt+Y.length,Y}),N+=`';
29
+ `;var j=be.call(l,"variable")&&l.variable;if(!j)N=`with (obj) {
30
+ `+N+`
33
31
  }
34
- `;else if(K0.test(J))throw new X(u);R=(E?R.replace(M0,""):R).replace(O0,"$1").replace(I0,"$1;"),R="function("+(J||"obj")+`) {
35
- `+(J?"":`obj || (obj = {});
36
- `)+"var __t, __p = ''"+(_?", __e = _.escape":"")+(E?`, __j = Array.prototype.join;
32
+ `;else if(G0.test(j))throw new Z(c);N=(E?N.replace(O0,""):N).replace(I0,"$1").replace(N0,"$1;"),N="function("+(j||"obj")+`) {
33
+ `+(j?"":`obj || (obj = {});
34
+ `)+"var __t, __p = ''"+(w?", __e = _.escape":"")+(E?`, __j = Array.prototype.join;
37
35
  function print() { __p += __j.call(arguments, '') }
38
36
  `:`;
39
- `)+R+`return __p
40
- }`;var te=qh(function(){return me(v,U+"return "+R).apply(t,w)});if(te.source=R,nu(te))throw te;return te}function m_(s){return ge(s).toLowerCase()}function g_(s){return ge(s).toUpperCase()}function y_(s,l,c){if(s=ge(s),s&&(c||l===t))return nd(s);if(!s||!(l=gt(l)))return s;var d=Bt(s),g=Bt(l),v=rd(d,g),w=id(d,g)+1;return Ln(d,v,w).join("")}function b_(s,l,c){if(s=ge(s),s&&(c||l===t))return s.slice(0,od(s)+1);if(!s||!(l=gt(l)))return s;var d=Bt(s),g=id(d,Bt(l))+1;return Ln(d,0,g).join("")}function v_(s,l,c){if(s=ge(s),s&&(c||l===t))return s.replace(na,"");if(!s||!(l=gt(l)))return s;var d=Bt(s),g=rd(d,Bt(l));return Ln(d,g).join("")}function S_(s,l){var c=Kl,d=Di;if(ke(l)){var g="separator"in l?l.separator:g;c="length"in l?Q(l.length):c,d="omission"in l?gt(l.omission):d}s=ge(s);var v=s.length;if(jr(s)){var w=Bt(s);v=w.length}if(c>=v)return s;var _=c-Yr(d);if(_<1)return d;var E=w?Ln(w,0,_).join(""):s.slice(0,_);if(g===t)return E+d;if(w&&(_+=E.length-_),ru(g)){if(s.slice(_).search(g)){var O,I=E;for(g.global||(g=va(g.source,ge(kf.exec(g))+"g")),g.lastIndex=0;O=g.exec(I);)var R=O.index;E=E.slice(0,R===t?_:R)}}else if(s.indexOf(gt(g),_)!=_){var z=E.lastIndexOf(g);z>-1&&(E=E.slice(0,z))}return E+d}function w_(s){return s=ge(s),s&&N0.test(s)?s.replace(wf,Yy):s}var __=ri(function(s,l,c){return s+(c?" ":"")+l.toUpperCase()}),ou=Jd("toUpperCase");function Gh(s,l,c){return s=ge(s),l=c?t:l,l===t?Ky(s)?Qy(s):Dy(s):s.match(l)||[]}var qh=ne(function(s,l){try{return pt(s,t,l)}catch(c){return nu(c)?c:new X(c)}}),x_=bn(function(s,l){return kt(l,function(c){c=Qt(c),gn(s,c,eu(s[c],s))}),s});function k_(s){var l=s==null?0:s.length,c=q();return s=l?_e(s,function(d){if(typeof d[1]!="function")throw new Et(a);return[c(d[0]),d[1]]}):[],ne(function(d){for(var g=-1;++g<l;){var v=s[g];if(pt(v[0],this,d))return pt(v[1],this,d)}})}function E_(s){return Y1(Ct(s,p))}function lu(s){return function(){return s}}function T_(s,l){return s==null||s!==s?l:s}var C_=Yd(),A_=Yd(!0);function ft(s){return s}function au(s){return Td(typeof s=="function"?s:Ct(s,p))}function M_(s){return Ad(Ct(s,p))}function O_(s,l){return Md(s,Ct(l,p))}var I_=ne(function(s,l){return function(c){return Zi(c,s,l)}}),N_=ne(function(s,l){return function(c){return Zi(s,c,l)}});function uu(s,l,c){var d=De(l),g=so(l,d);c==null&&!(ke(l)&&(g.length||!d.length))&&(c=l,l=s,s=this,g=so(l,De(l)));var v=!(ke(c)&&"chain"in c)||!!c.chain,w=Sn(s);return kt(g,function(_){var E=l[_];s[_]=E,w&&(s.prototype[_]=function(){var O=this.__chain__;if(v||O){var I=s(this.__wrapped__),R=I.__actions__=at(this.__actions__);return R.push({func:E,args:arguments,thisArg:s}),I.__chain__=O,I}return E.apply(s,An([this.value()],arguments))})}),s}function R_(){return $e._===this&&($e._=s1),this}function cu(){}function L_(s){return s=Q(s),ne(function(l){return Od(l,s)})}var P_=$a(_e),D_=$a(Xf),F_=$a(da);function Jh(s){return Ja(s)?ha(Qt(s)):hb(s)}function B_(s){return function(l){return s==null?t:dr(s,l)}}var z_=Zd(),H_=Zd(!0);function fu(){return[]}function du(){return!1}function $_(){return{}}function W_(){return""}function U_(){return!0}function V_(s,l){if(s=Q(s),s<1||s>qe)return[];var c=Qe,d=Je(s,Qe);l=q(l),s-=Qe;for(var g=ga(d,l);++c<s;)l(c);return g}function K_(s){return Z(s)?_e(s,Qt):yt(s)?[s]:at(ph(ge(s)))}function G_(s){var l=++r1;return ge(s)+l}var q_=fo(function(s,l){return s+l},0),J_=Wa("ceil"),j_=fo(function(s,l){return s/l},1),Y_=Wa("floor");function X_(s){return s&&s.length?io(s,ft,Ca):t}function Z_(s,l){return s&&s.length?io(s,q(l,2),Ca):t}function Q_(s){return ed(s,ft)}function ex(s,l){return ed(s,q(l,2))}function tx(s){return s&&s.length?io(s,ft,Ia):t}function nx(s,l){return s&&s.length?io(s,q(l,2),Ia):t}var rx=fo(function(s,l){return s*l},1),ix=Wa("round"),sx=fo(function(s,l){return s-l},0);function ox(s){return s&&s.length?ma(s,ft):0}function lx(s,l){return s&&s.length?ma(s,q(l,2)):0}return y.after=MS,y.ary=Eh,y.assign=gw,y.assignIn=zh,y.assignInWith=Eo,y.assignWith=yw,y.at=bw,y.before=Th,y.bind=eu,y.bindAll=x_,y.bindKey=Ch,y.castArray=$S,y.chain=_h,y.chunk=Yb,y.compact=Xb,y.concat=Zb,y.cond=k_,y.conforms=E_,y.constant=lu,y.countBy=oS,y.create=vw,y.curry=Ah,y.curryRight=Mh,y.debounce=Oh,y.defaults=Sw,y.defaultsDeep=ww,y.defer=OS,y.delay=IS,y.difference=Qb,y.differenceBy=ev,y.differenceWith=tv,y.drop=nv,y.dropRight=rv,y.dropRightWhile=iv,y.dropWhile=sv,y.fill=ov,y.filter=aS,y.flatMap=fS,y.flatMapDeep=dS,y.flatMapDepth=hS,y.flatten=bh,y.flattenDeep=lv,y.flattenDepth=av,y.flip=NS,y.flow=C_,y.flowRight=A_,y.fromPairs=uv,y.functions=Aw,y.functionsIn=Mw,y.groupBy=pS,y.initial=fv,y.intersection=dv,y.intersectionBy=hv,y.intersectionWith=pv,y.invert=Iw,y.invertBy=Nw,y.invokeMap=gS,y.iteratee=au,y.keyBy=yS,y.keys=De,y.keysIn=ct,y.map=vo,y.mapKeys=Lw,y.mapValues=Pw,y.matches=M_,y.matchesProperty=O_,y.memoize=wo,y.merge=Dw,y.mergeWith=Hh,y.method=I_,y.methodOf=N_,y.mixin=uu,y.negate=_o,y.nthArg=L_,y.omit=Fw,y.omitBy=Bw,y.once=RS,y.orderBy=bS,y.over=P_,y.overArgs=LS,y.overEvery=D_,y.overSome=F_,y.partial=tu,y.partialRight=Ih,y.partition=vS,y.pick=zw,y.pickBy=$h,y.property=Jh,y.propertyOf=B_,y.pull=bv,y.pullAll=Sh,y.pullAllBy=vv,y.pullAllWith=Sv,y.pullAt=wv,y.range=z_,y.rangeRight=H_,y.rearg=PS,y.reject=_S,y.remove=_v,y.rest=DS,y.reverse=Za,y.sampleSize=kS,y.set=$w,y.setWith=Ww,y.shuffle=ES,y.slice=xv,y.sortBy=AS,y.sortedUniq=Ov,y.sortedUniqBy=Iv,y.split=f_,y.spread=FS,y.tail=Nv,y.take=Rv,y.takeRight=Lv,y.takeRightWhile=Pv,y.takeWhile=Dv,y.tap=Xv,y.throttle=BS,y.thru=bo,y.toArray=Dh,y.toPairs=Wh,y.toPairsIn=Uh,y.toPath=K_,y.toPlainObject=Bh,y.transform=Uw,y.unary=zS,y.union=Fv,y.unionBy=Bv,y.unionWith=zv,y.uniq=Hv,y.uniqBy=$v,y.uniqWith=Wv,y.unset=Vw,y.unzip=Qa,y.unzipWith=wh,y.update=Kw,y.updateWith=Gw,y.values=oi,y.valuesIn=qw,y.without=Uv,y.words=Gh,y.wrap=HS,y.xor=Vv,y.xorBy=Kv,y.xorWith=Gv,y.zip=qv,y.zipObject=Jv,y.zipObjectDeep=jv,y.zipWith=Yv,y.entries=Wh,y.entriesIn=Uh,y.extend=zh,y.extendWith=Eo,uu(y,y),y.add=q_,y.attempt=qh,y.camelCase=Xw,y.capitalize=Vh,y.ceil=J_,y.clamp=Jw,y.clone=WS,y.cloneDeep=VS,y.cloneDeepWith=KS,y.cloneWith=US,y.conformsTo=GS,y.deburr=Kh,y.defaultTo=T_,y.divide=j_,y.endsWith=Zw,y.eq=Ht,y.escape=Qw,y.escapeRegExp=e_,y.every=lS,y.find=uS,y.findIndex=gh,y.findKey=_w,y.findLast=cS,y.findLastIndex=yh,y.findLastKey=xw,y.floor=Y_,y.forEach=xh,y.forEachRight=kh,y.forIn=kw,y.forInRight=Ew,y.forOwn=Tw,y.forOwnRight=Cw,y.get=iu,y.gt=qS,y.gte=JS,y.has=Ow,y.hasIn=su,y.head=vh,y.identity=ft,y.includes=mS,y.indexOf=cv,y.inRange=jw,y.invoke=Rw,y.isArguments=mr,y.isArray=Z,y.isArrayBuffer=jS,y.isArrayLike=ut,y.isArrayLikeObject=Ce,y.isBoolean=YS,y.isBuffer=Pn,y.isDate=XS,y.isElement=ZS,y.isEmpty=QS,y.isEqual=ew,y.isEqualWith=tw,y.isError=nu,y.isFinite=nw,y.isFunction=Sn,y.isInteger=Nh,y.isLength=xo,y.isMap=Rh,y.isMatch=rw,y.isMatchWith=iw,y.isNaN=sw,y.isNative=ow,y.isNil=aw,y.isNull=lw,y.isNumber=Lh,y.isObject=ke,y.isObjectLike=Te,y.isPlainObject=is,y.isRegExp=ru,y.isSafeInteger=uw,y.isSet=Ph,y.isString=ko,y.isSymbol=yt,y.isTypedArray=si,y.isUndefined=cw,y.isWeakMap=fw,y.isWeakSet=dw,y.join=mv,y.kebabCase=t_,y.last=Mt,y.lastIndexOf=gv,y.lowerCase=n_,y.lowerFirst=r_,y.lt=hw,y.lte=pw,y.max=X_,y.maxBy=Z_,y.mean=Q_,y.meanBy=ex,y.min=tx,y.minBy=nx,y.stubArray=fu,y.stubFalse=du,y.stubObject=$_,y.stubString=W_,y.stubTrue=U_,y.multiply=rx,y.nth=yv,y.noConflict=R_,y.noop=cu,y.now=So,y.pad=i_,y.padEnd=s_,y.padStart=o_,y.parseInt=l_,y.random=Yw,y.reduce=SS,y.reduceRight=wS,y.repeat=a_,y.replace=u_,y.result=Hw,y.round=ix,y.runInContext=k,y.sample=xS,y.size=TS,y.snakeCase=c_,y.some=CS,y.sortedIndex=kv,y.sortedIndexBy=Ev,y.sortedIndexOf=Tv,y.sortedLastIndex=Cv,y.sortedLastIndexBy=Av,y.sortedLastIndexOf=Mv,y.startCase=d_,y.startsWith=h_,y.subtract=sx,y.sum=ox,y.sumBy=lx,y.template=p_,y.times=V_,y.toFinite=wn,y.toInteger=Q,y.toLength=Fh,y.toLower=m_,y.toNumber=Ot,y.toSafeInteger=mw,y.toString=ge,y.toUpper=g_,y.trim=y_,y.trimEnd=b_,y.trimStart=v_,y.truncate=S_,y.unescape=w_,y.uniqueId=G_,y.upperCase=__,y.upperFirst=ou,y.each=xh,y.eachRight=kh,y.first=vh,uu(y,function(){var s={};return Xt(y,function(l,c){ye.call(y.prototype,c)||(s[c]=l)}),s}(),{chain:!1}),y.VERSION=r,kt(["bind","bindKey","curry","curryRight","partial","partialRight"],function(s){y[s].placeholder=y}),kt(["drop","take"],function(s,l){le.prototype[s]=function(c){c=c===t?1:Pe(Q(c),0);var d=this.__filtered__&&!l?new le(this):this.clone();return d.__filtered__?d.__takeCount__=Je(c,d.__takeCount__):d.__views__.push({size:Je(c,Qe),type:s+(d.__dir__<0?"Right":"")}),d},le.prototype[s+"Right"]=function(c){return this.reverse()[s](c).reverse()}}),kt(["filter","map","takeWhile"],function(s,l){var c=l+1,d=c==or||c==Tn;le.prototype[s]=function(g){var v=this.clone();return v.__iteratees__.push({iteratee:q(g,3),type:c}),v.__filtered__=v.__filtered__||d,v}}),kt(["head","last"],function(s,l){var c="take"+(l?"Right":"");le.prototype[s]=function(){return this[c](1).value()[0]}}),kt(["initial","tail"],function(s,l){var c="drop"+(l?"":"Right");le.prototype[s]=function(){return this.__filtered__?new le(this):this[c](1)}}),le.prototype.compact=function(){return this.filter(ft)},le.prototype.find=function(s){return this.filter(s).head()},le.prototype.findLast=function(s){return this.reverse().find(s)},le.prototype.invokeMap=ne(function(s,l){return typeof s=="function"?new le(this):this.map(function(c){return Zi(c,s,l)})}),le.prototype.reject=function(s){return this.filter(_o(q(s)))},le.prototype.slice=function(s,l){s=Q(s);var c=this;return c.__filtered__&&(s>0||l<0)?new le(c):(s<0?c=c.takeRight(-s):s&&(c=c.drop(s)),l!==t&&(l=Q(l),c=l<0?c.dropRight(-l):c.take(l-s)),c)},le.prototype.takeRightWhile=function(s){return this.reverse().takeWhile(s).reverse()},le.prototype.toArray=function(){return this.take(Qe)},Xt(le.prototype,function(s,l){var c=/^(?:filter|find|map|reject)|While$/.test(l),d=/^(?:head|last)$/.test(l),g=y[d?"take"+(l=="last"?"Right":""):l],v=d||/^find/.test(l);g&&(y.prototype[l]=function(){var w=this.__wrapped__,_=d?[1]:arguments,E=w instanceof le,O=_[0],I=E||Z(w),R=function(re){var ae=g.apply(y,An([re],_));return d&&z?ae[0]:ae};I&&c&&typeof O=="function"&&O.length!=1&&(E=I=!1);var z=this.__chain__,U=!!this.__actions__.length,J=v&&!z,te=E&&!U;if(!v&&I){w=te?w:new le(this);var j=s.apply(w,_);return j.__actions__.push({func:bo,args:[R],thisArg:t}),new Tt(j,z)}return J&&te?s.apply(this,_):(j=this.thru(R),J?d?j.value()[0]:j.value():j)})}),kt(["pop","push","shift","sort","splice","unshift"],function(s){var l=Us[s],c=/^(?:push|sort|unshift)$/.test(s)?"tap":"thru",d=/^(?:pop|shift)$/.test(s);y.prototype[s]=function(){var g=arguments;if(d&&!this.__chain__){var v=this.value();return l.apply(Z(v)?v:[],g)}return this[c](function(w){return l.apply(Z(w)?w:[],g)})}}),Xt(le.prototype,function(s,l){var c=y[l];if(c){var d=c.name+"";ye.call(ei,d)||(ei[d]=[]),ei[d].push({name:l,func:c})}}),ei[co(t,N).name]=[{name:"wrapper",func:t}],le.prototype.clone=w1,le.prototype.reverse=_1,le.prototype.value=x1,y.prototype.at=Zv,y.prototype.chain=Qv,y.prototype.commit=eS,y.prototype.next=tS,y.prototype.plant=rS,y.prototype.reverse=iS,y.prototype.toJSON=y.prototype.valueOf=y.prototype.value=sS,y.prototype.first=y.prototype.head,Ki&&(y.prototype[Ki]=nS),y},Xr=e1();lr?((lr.exports=Xr)._=Xr,aa._=Xr):$e._=Xr}).call(Os)}(Hl,Hl.exports);var g0=Hl.exports;function cf(n){return n.type.create(g0.cloneDeep(n.attrs))}const JM=Ne.create({name:"node_processor",addCommands(){return{setBlockAttributes:P(({commands:n,state:e},t,r,i={})=>{const o=F(n.getBlockAttributes(t))??{},{doc:a,tr:u}=e,{from:f,to:h}=u.selection;a.nodesBetween(f,h,(m,p)=>{ee.blocks.includes(m.type.name)&&u.setNodeAttribute(p,t,{...i,...o,...r})})}),getBlockAttributes:P(({editor:n},e,t)=>fe(()=>{let r=Object.assign({},t||{});for(const i of ee.blocks)Object.assign(r,n.getAttributes(i)?.[e]||{});return Object.keys(r).length?r:null})),removeBlockAttributes:P(({commands:n},e)=>{for(const t of ee.blocks)n.resetAttributes(t,e)}),applyMark:P(({state:n,commands:e},t,r,i={})=>{const{tr:o,doc:a,schema:u}=n,{$from:f,$to:h}=o.selection,m=nn(ce.LINK,u),p=nn(t,u);if(!(p.spec.group||"").includes(qt.SETTINGS))return e.setMark(t,r);if(f.pos===h.pos)return;const S=x=>{if(!i.onAppliedToParent||i.onAppliedToParent(x)===!1){const{tr:C,node:A,position:N,mark:G}=x;e._removeNodeMark({tr:C,node:A,position:N,mark:G.type})}};a.nodesBetween(f.pos,h.pos,(x,C)=>{if(x.type.name===ee.LIST)return;const A=qM(x.marks,t),N=p.create({...A?.attrs||{},...r}),G=p0(f,h,x,C);if(!m.isInSet(x.marks)&&GM(o.doc,C,N,i.isAppliedToParent))return S({tr:o,node:x,position:C,mark:N});if(x.isText){o.addMark(G.from,G.to,N);return}VM(o.doc,o.selection,x,C)&&o.addNodeMark(C,N)})}),getMarks:P(({editor:n},e)=>{const t=ai(n,"state");return fe(()=>{const{selection:r,doc:i}=F(t),{from:o,to:a}=F(r),u=[];return i.nodesBetween(o,a,f=>{for(const h of f.marks)h.type.name===e&&u.unshift(h.attrs)}),u})}),getMark:P(({commands:n},e)=>{const t=n.getMarks(e);return fe(()=>F(t)[0]??null)}),hasMark:P(({commands:n},e)=>{const t=n.getMark(e);return fe(()=>!!F(t))}),getCommonSettingMark:P(({commands:n},e,t)=>{const r=n.getMark(e);return fe(()=>F(r)?.value??F(t))}),getDeviceSettingMark:P(({commands:n},e,t)=>{const r=n.getMarks(e),i=n.getDevice();return fe(()=>{for(const o of F(r)){const a=o[F(i)];if(a)return a}return F(t)})}),removeAllMarks:P(({state:n,commands:e})=>{const{tr:t,doc:r}=n,{from:i,to:o}=t.selection;r.nodesBetween(i,o,(a,u)=>{for(const f of a.marks)e._removeNodeMark({tr:t,node:a,position:u,mark:f})})}),removeMarks:P(({state:n,commands:e},t)=>{const{tr:r,doc:i}=n,{from:o,to:a}=r.selection;i.nodesBetween(o,a,(u,f)=>{const h=u.marks.filter(m=>t.includes(m.type.name));for(const m of h)e._removeNodeMark({tr:r,node:u,position:f,mark:m})})}),_removeNodeMark:P((n,{tr:e,node:t,position:r,mark:i})=>t.isText?e.removeMark(r,r+t.nodeSize,i):e.removeNodeMark(r,i))}}}),jM=Ne.create({name:"text_processor",addCommands(){return{getSelectedText:P(({state:n})=>{const{from:e,to:t}=n.selection;return n.doc.textBetween(e,t," ")}),transformText:P(({state:n},e)=>{const{$from:t,$to:r}=n.tr.selection;t.pos!==r.pos&&n.doc.nodesBetween(t.pos,r.pos,(i,o)=>{if(!i.isText)return;const a=p0(t,r,i,o),u=Math.max(0,t.pos-o),f=Math.max(0,r.pos-o),h=e({text:i.textContent.substring(u,f)}),m=n.schema.text(h,i.marks);n.tr.replaceWith(a.from,a.to,m)})})}}}),YM=Ne.create({name:"selection_processor",addStorage:()=>({selection:null}),addCommands(){return{storeSelection:P(({state:n})=>{this.storage.selection=n.selection}),restoreSelection:P(({commands:n})=>{this.storage.selection&&n.setTextSelection(this.storage.selection)}),expandSelection:P(({tr:n,commands:e},t)=>{let r=n.selection.from,i=n.selection.to;n.doc.nodesBetween(r,i,(o,a,u)=>{if(t({node:o,parent:u})){const f=o.isText?0:m0(n.doc,a);r=Math.min(r,a+f),i=Math.max(i,a+o.nodeSize-f)}}),e.setTextSelection({from:r,to:i})}),expandSelectionToBlock:P(({commands:n})=>{n.expandSelection(({parent:e})=>e.type.name===ee.DOCUMENT)})}}}),XM=En.create({name:"doc",topNode:!0,content:"block+"});class Ns extends Ye{constructor(e,t,r,i="SetDocAttr"){super(),this.key=e,this.value=t,this.schema=r,this.stepType=i}apply(e){this.prevValue=e.attrs.meta[this.key];const t=Er.fromJSON(this.schema,e.toJSON());return t.attrs.meta[this.key]=this.value,Re.ok(t)}invert(){return new Ns(this.key,this.prevValue,this.schema,"revertSetDocAttr")}map(){return null}toJSON(){return{stepType:this.stepType,key:this.key,value:this.value}}static fromJSON(e){return new Ns(e.key,e.value,e.stepType)}}Ye.jsonID("setDocAttr",Ns);const ZM=XM.extend({marks:qt.SETTINGS,addAttributes:()=>({meta:{default:{}}}),onCreate(){this.editor.view.dom.addEventListener("click",n=>{n.target.closest("a")&&n.preventDefault()})},addCommands(){return{setDocMetaAttributes:P(({state:n},e,t)=>{n.tr.step(new Ns(e,t,n.schema))})}}}),QM=En.create({name:"paragraph",priority:1e3,addOptions(){return{HTMLAttributes:{}}},group:"block",content:"inline*",parseHTML(){return[{tag:"p"}]},renderHTML({HTMLAttributes:n}){return["p",_i(this.options.HTMLAttributes,n),0]},addCommands(){return{setParagraph:()=>({commands:n})=>n.setNode(this.name)}},addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}}),eO=QM.extend({marks:qt.ALL,addOptions:()=>({HTMLAttributes:{class:"zw-style"}})}),tO=En.create({name:"heading",addOptions(){return{levels:[1,2,3,4,5,6],HTMLAttributes:{}}},content:"inline*",group:"block",defining:!0,addAttributes(){return{level:{default:1,rendered:!1}}},parseHTML(){return this.options.levels.map(n=>({tag:`h${n}`,attrs:{level:n}}))},renderHTML({node:n,HTMLAttributes:e}){return[`h${this.options.levels.includes(n.attrs.level)?n.attrs.level:this.options.levels[0]}`,_i(this.options.HTMLAttributes,e),0]},addCommands(){return{setHeading:n=>({commands:e})=>this.options.levels.includes(n.level)?e.setNode(this.name,n):!1,toggleHeading:n=>({commands:e})=>this.options.levels.includes(n.level)?e.toggleNode(this.name,"paragraph",n):!1}},addKeyboardShortcuts(){return this.options.levels.reduce((n,e)=>({...n,[`Mod-Alt-${e}`]:()=>this.editor.commands.toggleHeading({level:e})}),{})},addInputRules(){return this.options.levels.map(n=>HA({find:new RegExp(`^(#{1,${n}})\\s$`),type:this.type,getAttributes:{level:n}}))}}),nO=tO.extend({marks:qt.ALL,addOptions:()=>({levels:[1,2,3,4],HTMLAttributes:{class:"zw-style"}})}),rO=Ne.create({name:"prose_mirror_plugins",addProseMirrorPlugins(){return[QA.create(this.editor),eM.create(this.editor)]}}),iO=()=>[ZM,eO,nO,UA,ZA,JM,jM,YM,rO],sO=_t.create({name:ce.FONT_FAMILY,group:qt.SETTINGS,addOptions:()=>({fonts:[]}),addAttributes:()=>({value:{required:!0}}),addCommands(){return{applyFontFamily:P(({commands:n},e)=>{n.applyMark(this.name,{value:e});const t=n.findFontByName(e);let r=F(n.getFontWeight());t.isWeightSupported(r)||(r=t.findClosestWeight(r),n.applyFontWeight(r));const i=n.isSettingCustomized(ce.FONT_STYLE).value;!t.isItalicSupported(r)&&i&&n.removeItalic()}),getFont:P(({commands:n})=>{const e=F(this.options.defaultPreset),t=n.findFontByName(e.common.font_family),r=n.getFontFamily();return fe(()=>n.findFontByName(F(r))||t)}),findFontByName:P((n,e)=>F(this.options.fonts).find(t=>t.name===e)??this.options.defaultFont),getFontFamily:P(({commands:n})=>n.getCommonSettingMark(this.name,n.getDefaultFontFamily())),getDefaultFontFamily:P(({commands:n})=>{const e=n.getPreset();return fe(()=>F(e).common.font_family)})}},parseHTML(){const n=e=>({value:e.replace(/["']/g,"")});return[{style:"--zw-font-family",getAttrs:n},{style:"font-family",getAttrs:n}]},renderHTML({HTMLAttributes:n}){const e=n.value?`"${n.value}"`:null;return Pr({font_family:e})}}),oO=Ne.create({name:ce.STYLE_PRESET,addGlobalAttributes(){return[{types:[ee.PARAGRAPH,ee.HEADING],attributes:{preset:{isRequired:!1,default:{id:F(this.options.defaultId)},parseHTML:n=>{const e=F(this.options.presets);if(n.parentElement.tagName==="LI")return null;for(const{id:t,node:r,fallbackClass:i}of e){if(i&&n.classList.contains(i))return{id:t};const o=F(this.options.styleRenderer).makePresetCssClass({id:t});if(n.matches(o))return{id:t};if(n.tagName===`H${r?.level}`)return{id:t}}return n.tagName==="P"?{id:F(this.options.defaultId)}:null},renderHTML:n=>n.preset?{class:F(this.options.styleRenderer).makePresetHtmlClass(n.preset)}:null}}}]},addCommands(){function n(t,r){return t.find(i=>r===i.id)}function e(t,r){const i={};for(const o of Object.keys(t)){const a=t[o],u=r[o],f=!u||u.toLowerCase()==="inherit";i[o]=f?a:u}return i}return{getPresetList:P(()=>fe(()=>F(this.options.presets).filter(t=>!t.hidden))),getPreset:P(({commands:t})=>{const r=t.getBlockAttributes("preset",{id:F(this.options.defaultId)}),i=t.getPresetList(),o=t.isLink(),a=t.getLinkPreset();return fe(()=>{const u=n(F(i),F(r).id);if(!F(o))return u;const f=F(a);return{id:u.id,common:e(u.common,f.common),mobile:e(u.mobile,f.mobile),tablet:e(u.tablet,f.tablet),desktop:e(u.desktop,f.desktop)}})}),applyPreset:P(({commands:t,chain:r},i)=>{const o=F(t.getPresetList()),a=n(o,i),u=a.node?.type??ee.PARAGRAPH,f={preset:{id:i}};a.node&&(f.level=a.node.level);for(const h of ce.attributes)f[h]=F(t.getBlockAttributes(h));r().removeList().setNode(u,f).run()}),applyDefaultPreset:P(({commands:t})=>{t.applyPreset(F(this.options.defaultId))}),removePreset:P(({commands:t})=>{t.setNode(ee.PARAGRAPH,{preset:null})}),getPresetCustomization:P(({editor:t,commands:r})=>{const i=ai(t,"state");return fe(()=>{const{selection:o,doc:a}=F(i),{from:u,to:f}=o;return r._getSettingCustomization(a,u,f)})}),isSettingCustomized:P(({commands:t},r)=>{const i=t.getPresetCustomization(),o=ce.presetAttributes.includes(r)?"attributes":"marks";return fe(()=>F(i)[o]?.includes(r)??!1)}),getContentCustomization:P(({editor:t,commands:r})=>{const i=ai(t,"state");return fe(()=>{const{doc:o}=F(i);return r._getSettingCustomization(o,0,o.content.size)})}),_getSettingCustomization:P((t,r,i,o)=>{const a=new Set,u=new Set;return r.nodesBetween(i,o,f=>{for(const[h,m]of Object.entries(f.attrs))ce.presetAttributes.includes(h)&&m&&u.add(h);for(const{type:h}of f.marks)ce.marks.includes(h.name)&&a.add(h.name)}),{attributes:Array.from(u),marks:Array.from(a)}}),removePresetCustomization:P(({chain:t})=>{t().storeSelection().expandSelectionToBlock().removeMarks(ce.marks).resetAttributes(ee.PARAGRAPH,ce.presetAttributes).resetAttributes(ee.HEADING,ce.presetAttributes).restoreSelection().run()}),removeFormat:P(({chain:t})=>{t().storeSelection().expandSelectionToBlock().removeAllMarks().applyDefaultPreset().restoreSelection().run()})}},onCreate(){this.options.styleRenderer.inject(Oi.head,F(this.options.presets))}}),lO=_t.create({name:ce.FONT_WEIGHT,group:qt.SETTINGS,addAttributes:()=>({value:{required:!0}}),addCommands(){return{applyFontWeight:P(({commands:n},e)=>{n.applyMark(this.name,{value:e}),F(n.getFont()).isItalicSupported(e)||n.removeItalic()}),toggleBold:P(({commands:n})=>{const e=F(n.getFontWeight()),t=F(n.getFont()),i=Number(e)>=600?"400":"700",o=t.findClosestWeight(i);n.applyFontWeight(o)}),getFontWeight:P(({commands:n})=>{const e=n.getCommonSettingMark(this.name,n.getDefaultFontWeight()),t=n.getFont();return fe(()=>{const r=F(e),i=F(t);return i.isWeightSupported(r)?r:i.findClosestWeight(r)})}),getDefaultFontWeight:P(({commands:n})=>{const e=n.getPreset();return fe(()=>F(e).common.font_weight)})}},addKeyboardShortcuts:()=>({"Mod-b":Lt("toggleBold"),"Mod-B":Lt("toggleBold")}),parseHTML(){const n=e=>e==="bold"?{value:"700"}:Number(e)?{value:e}:!1;return[{style:"--zw-font-weight",getAttrs:n},{style:"font-weight",getAttrs:n},{tag:"b",attrs:{value:"700"}},{tag:"strong",attrs:{value:"700"}}]},renderHTML({HTMLAttributes:n}){return Pr({font_weight:n.value})}}),aO=_t.create({name:ce.FONT_SIZE,group:qt.SETTINGS,addOptions:()=>({minSize:1,maxSize:100}),addAttributes(){return{mobile:{default:null},tablet:{default:null},desktop:{default:null}}},addCommands(){return{getFontSize:P(({commands:n})=>n.getDeviceSettingMark(this.name,n.getDefaultFontSize())),getDefaultFontSize:P(({commands:n})=>{const e=n.getDevice(),t=n.getPreset();return fe(()=>F(t)[F(e)].font_size.replace("px",""))}),applyFontSize:P(({commands:n},e)=>{const t=F(n.getDevice());n.applyMark(this.name,{[t]:e},{isAppliedToParent:(r,i)=>r.type.name!==i.type.name?!1:r.attrs[t]===i.attrs[t],onAppliedToParent:({tr:r,node:i,position:o,mark:a})=>{const u={...a.attrs,[t]:null};if(!Object.values(u).some(m=>!!m))return!1;const h=a.type.create(u);if(i.isText){r.addMark(o,o+i.nodeSize,h);return}r.addNodeMark(o,h)}})}),increaseFontSize:P(({commands:n})=>{const e=Number(F(n.getFontSize())),t=Math.min(e+1,F(this.options.maxSize));n.applyFontSize(String(t))}),decreaseFontSize:P(({commands:n})=>{const e=Number(F(n.getFontSize())),t=Math.max(e-1,F(this.options.minSize));n.applyFontSize(String(t))})}},addKeyboardShortcuts:()=>({"Mod-Shift-=":Lt("increaseFontSize"),"Mod-Shift--":Lt("decreaseFontSize")}),parseHTML(){const n=e=>{if(!e)return null;const t=F(this.options.wrapperRef),r=h0(e,t);return String(r)};return[{tag:'[style*="--zw-font-size"]',getAttrs:({style:e})=>({mobile:n(e.getPropertyValue("--zw-font-size-mobile")),tablet:n(e.getPropertyValue("--zw-font-size-tablet")),desktop:n(e.getPropertyValue("--zw-font-size-desktop"))})},{style:"font-size",getAttrs:e=>{const t=n(e);return{desktop:t,tablet:t,mobile:null}}}]},renderHTML({HTMLAttributes:n}){const e=t=>t?`${t}px`:null;return Pr({font_size_mobile:e(n.mobile),font_size_tablet:e(n.tablet),font_size_desktop:e(n.desktop)})}}),uO=_t.create({name:ce.FONT_COLOR,group:qt.SETTINGS,addAttributes:()=>({value:{required:!0}}),addCommands(){return{getFontColor:P(({commands:n})=>n.getCommonSettingMark(this.name,n.getDefaultFontColor())),getDefaultFontColor:P(({commands:n})=>{const e=n.getPreset();return fe(()=>F(e).common.color)}),applyFontColor:P(({commands:n},e)=>{n.applyMark(this.name,{value:e})})}},parseHTML(){const n=e=>({value:d0(e)});return[{style:"--zw-font-color",getAttrs:n},{style:"color",getAttrs:n}]},renderHTML({HTMLAttributes:n}){return Pr({font_color:n.value})}}),cO=_t.create({name:ce.BACKGROUND_COLOR,addAttributes:()=>({value:{required:!0}}),addCommands(){return{getBackgroundColor:P(({commands:n})=>n.getCommonSettingMark(this.name,"rgba(255, 255, 255, 0%)")),applyBackgroundColor:P(({commands:n},e)=>{n.applyMark(this.name,{value:e})})}},parseHTML(){const n=e=>({value:d0(e)});return[{style:"--zw-background-color",getAttrs:n},{style:"background-color",getAttrs:n}]},renderHTML({HTMLAttributes:n}){return Pr({background_color:n.value})}}),fO=Ne.create({name:"device_manager",addCommands(){return{getDevice:P(()=>ai(this.options,"device"))}}}),dO=_t.create({name:ce.FONT_STYLE,group:qt.SETTINGS,addAttributes:()=>({italic:{required:!0}}),addCommands(){return{isItalic:P(({commands:n})=>{const e=n.getMark(this.name),t=n.getDefaultFontStyle();return fe(()=>F(e)?.italic??F(t).italic)}),isItalicAvailable:P(({commands:n})=>{const e=n.getFont(),t=n.getFontWeight();return fe(()=>{const r=F(e),i=F(t);return r.isItalicSupported(i)&&!r.isWeightItalicOnly(i)})}),getDefaultFontStyle:P(({commands:n})=>{const e=n.getPreset();return fe(()=>({italic:F(e).common.font_style==="italic"}))}),toggleItalic:P(({commands:n})=>{F(n.isItalicAvailable())&&(F(n.isItalic())?n.removeItalic():n.applyItalic())}),applyItalic:P(({commands:n})=>{n.applyMark(this.name,{italic:!0})}),removeItalic:P(({commands:n})=>{n.applyMark(this.name,{italic:!1})})}},addKeyboardShortcuts:()=>({"Mod-i":Lt("toggleItalic"),"Mod-I":Lt("toggleItalic")}),parseHTML(){const n=e=>({italic:e.includes("italic")});return[{tag:"i",attrs:{italic:!0}},{style:"--zw-font-style",getAttrs:n},{style:"font-style",getAttrs:n}]},renderHTML({HTMLAttributes:n}){const e=n.italic?"italic":"normal";return Pr({font_style:e})}}),hO=_t.create({name:ce.TEXT_DECORATION,priority:1e3,addAttributes:()=>({underline:{default:!1},strike_through:{default:!1}}),addCommands(){return{isUnderline:P(({commands:n})=>{const e=n.getTextDecoration();return fe(()=>F(e).underline)}),isStrikeThrough:P(({commands:n})=>{const e=n.getTextDecoration();return fe(()=>F(e).strike_through)}),getTextDecoration:P(({commands:n})=>{const e=n.getMark(this.name),t=n.getDefaultTextDecoration();return fe(()=>{const r=F(e)??{},i=F(t);return{underline:r.underline||i.underline,strike_through:r.strike_through||i.strike_through}})}),isUnderlineCustomized:P(({commands:n})=>{const e=n.isUnderline(),t=n.getDefaultTextDecoration();return fe(()=>F(e)!==F(t).underline)}),getDefaultTextDecoration:P(({commands:n})=>{const e=n.getPreset();return fe(()=>{const{text_decoration:t}=F(e).common;return{underline:t.includes("underline"),strike_through:t.includes("line-through")}})}),toggleUnderline:P(({commands:n})=>{n.toggleTextDecoration("underline")}),toggleStrikeThrough:P(({commands:n})=>{n.toggleTextDecoration("strike_through")}),toggleTextDecoration:P(({commands:n},e,t=null)=>{const r=F(n.getTextDecoration()),i=t??!r[e];n.applyMark(this.name,{[e]:i})}),applyTextDecoration:P(({commands:n},e)=>{n.toggleTextDecoration(e,!0)}),removeTextDecoration:P(({commands:n},e)=>{n.toggleTextDecoration(e,!1)})}},addKeyboardShortcuts:()=>({"Mod-u":Lt("toggleUnderline"),"Mod-U":Lt("toggleUnderline")}),parseHTML(){const n=e=>{const t=e.includes("underline"),r=e.includes("line-through");return!t&&!r?!1:{underline:t,strike_through:r}};return[{style:"--zw-text-decoration",getAttrs:n},{style:"text-decoration-line",getAttrs:n},{style:"text-decoration",getAttrs:n},{tag:"s",attrs:{underline:!1,strike_through:!0}},{tag:"u",attrs:{underline:!0,strike_through:!1}}]},renderHTML({HTMLAttributes:n}){const e=[];return n.underline&&e.push("underline"),n.strike_through&&e.push("line-through"),e.length||e.push("none"),Pr({text_decoration:e.join(" ")})}}),pO=Ne.create({name:"case_style",addCommands(){return{applyCaseStyle:P(({commands:n},e)=>{switch(e){case Dc.CAPITALIZE:return n.applyCapitalize();case Dc.LOWERCASE:return n.applyLowerCase();case Dc.UPPERCASE:return n.applyUpperCase()}}),applyCapitalize:P(({commands:n})=>{n.transformText(({text:e})=>wM(e))}),applyLowerCase:P(({commands:n})=>{n.transformText(({text:e})=>e.toLowerCase())}),applyUpperCase:P(({commands:n})=>{n.transformText(({text:e})=>e.toUpperCase())})}}}),y0={mobile:null,tablet:null,desktop:null},mO=Ne.create({name:ce.ALIGNMENT,addGlobalAttributes:()=>[{types:[ee.PARAGRAPH,ee.HEADING],attributes:{[ce.ALIGNMENT]:{isRequired:!1,parseHTML({style:n}){const e=UM(n.textAlign);if(e)return{desktop:e,tablet:e,mobile:e};const t=n.getPropertyValue("--zw-alignment-mobile")||null,r=n.getPropertyValue("--zw-alignment-tablet")||null,i=n.getPropertyValue("--zw-alignment-desktop")||null;return!t&&!r&&!i?null:{desktop:i,tablet:r,mobile:t}},renderHTML(n){return n.alignment?zl({alignment_mobile:n.alignment.mobile,alignment_tablet:n.alignment.tablet,alignment_desktop:n.alignment.desktop}):null}}}}],addCommands(){return{applyAlignment:P(({commands:n},e)=>{const t=F(n.getDevice());n.setBlockAttributes(this.name,{[t]:e},y0)}),removeAlignment:P(({commands:n})=>n.removeBlockAttributes(this.name)),getAlignment:P(({commands:n})=>{const e=n.getBlockAttributes(this.name,y0),t=n.getDevice(),r=n.getDefaultAlignment();return fe(()=>F(e)?.[F(t)]??F(r))}),getDefaultAlignment:P(({commands:n})=>{const e=n.getDevice(),t=n.getPreset();return fe(()=>F(t)[F(e)].alignment??Xn.LEFT)})}},addKeyboardShortcuts:()=>({"Mod-Shift-l":Lt("applyAlignment",Xn.LEFT),"Mod-Shift-e":Lt("applyAlignment",Xn.CENTER),"Mod-Shift-r":Lt("applyAlignment",Xn.RIGHT),"Mod-Shift-j":Lt("applyAlignment",Xn.JUSTIFY)})}),b0={mobile:null,tablet:null,desktop:null},gO=Ne.create({name:ce.LINE_HEIGHT,addGlobalAttributes(){return[{types:[ee.PARAGRAPH,ee.HEADING],attributes:{[ce.LINE_HEIGHT]:{isRequired:!1,parseHTML:n=>{if(n.matches('[style*="--zw-line-height"]')){const o=n.style.getPropertyValue("--zw-line-height-tablet")||null,a=n.style.getPropertyValue("--zw-line-height-desktop")||null;return{mobile:null,tablet:o,desktop:a}}const e=n.style.lineHeight;if(!e)return null;const t=F(this.options.wrapperRef),r=$M(e,n,t);return r?{desktop:r,tablet:r,mobile:null}:null},renderHTML(n){return n.line_height?zl({line_height_mobile:n.line_height.mobile,line_height_tablet:n.line_height.tablet,line_height_desktop:n.line_height.desktop}):null}}}}]},addCommands(){return{getLineHeight:P(({commands:n})=>{const e=n.getBlockAttributes(this.name,b0),t=n.getDevice(),r=n.getDefaultLineHeight();return fe(()=>F(e)?.[F(t)]??F(r))}),getDefaultLineHeight:P(({commands:n})=>{const e=n.getDevice(),t=n.getPreset();return fe(()=>F(t)[F(e)].line_height)}),applyLineHeight:P(({commands:n},e)=>{const t=F(n.getDevice());n.setBlockAttributes(this.name,{[t]:e},b0)})}}}),yO=En.create({name:"listItem",addOptions(){return{HTMLAttributes:{},bulletListTypeName:"bulletList",orderedListTypeName:"orderedList"}},content:"paragraph block*",defining:!0,parseHTML(){return[{tag:"li"}]},renderHTML({HTMLAttributes:n}){return["li",_i(this.options.HTMLAttributes,n),0]},addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem(this.name),Tab:()=>this.editor.commands.sinkListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)}}}),bO=yO.extend({name:ee.LIST_ITEM,marks:qt.SETTINGS,addCommands(){const n=({selection:e})=>e.$cursor.before(e.$cursor.depth-1);return{listItemNewline:P(({commands:e,tr:t})=>{const r=t.doc.nodeAt(n(t));if(!t.selection.$cursor.node().textContent)return!1;e.splitListItem(this.name);const o=n(t);for(const a of r.marks)t.addNodeMark(o,cf(a));return!0})}},addOptions:()=>({HTMLAttributes:{class:"zw-style"}}),addKeyboardShortcuts:()=>({Enter:n=>{const{state:e,commands:t}=n.editor;if(e.selection.$cursor?.path.some(i=>i.type?.name===ee.LIST))return t.listItemNewline()}})}),vO=En.create({name:ee.LIST,content:`${ee.LIST_ITEM}+`,group:"block list",marks:qt.SETTINGS,addExtensions:()=>[bO],addOptions:()=>({baseClass:"",presetClass:""}),addAttributes:()=>({bullet:{default:{type:Nt.DISC}}}),parseHTML(){const n={a:Nt.ROMAN,i:Nt.LATIN,1:Nt.DECIMAL},e=t=>{for(const r of Nt.values){const i=`.${F(this.options.baseClass)}${r}`;if(t.matches(i)||n[t.type.toLowerCase()]===r)return r}};return[{tag:"ol",getAttrs:t=>({bullet:{type:e(t)||Nt.DECIMAL}})},{tag:"ul",getAttrs:t=>({bullet:{type:e(t)||Nt.DISC}})}]},renderHTML({HTMLAttributes:n}){const e=[F(this.options.baseClass)+n.bullet.type,F(this.options.presetClass)];return[Nt.ordered.includes(n.bullet.type)?"ol":"ul",{class:e.join(" ")},0]},addCommands(){return{getListType:P(({commands:n})=>{const e=n.getBlockAttributes("bullet",{type:null});return fe(()=>F(e).type??null)}),applyList:P(({commands:n,chain:e},t)=>{if(F(n.getListType())===t){n.removeList();return}return e().applyDefaultPreset().toggleList(ee.LIST,ee.LIST_ITEM).setBlockAttributes("bullet",{type:t}).command(({commands:i,tr:o})=>i._bubbleListItemMarks(o)).run()}),_bubbleListItemMarks:P((n,e)=>{const{doc:t,selection:r}=e,i=r.$from.start(),o=r.$to.end();function a(u,f){if(ce.inlineMarks.includes(f.type)||f.type.isInSet(u.marks))return!1;for(const h of u.content.content)if(h.childCount&&(!h.marks||!f.isInSet(h.marks)))return!1;return!0}t.nodesBetween(i,o,(u,f)=>{if(u.type.name===ee.LIST)return;if(u.type.name!==ee.LIST_ITEM)return!1;const h=[];return u.forEach(m=>{for(const p of m.marks){if(p.isInSet(h)){e.removeNodeMark(f+1,p);continue}a(u,p)&&(e.removeNodeMark(f+1,p),e.addNodeMark(f,cf(p)),h.push(p))}}),!1})}),removeList:P(({commands:n,state:e})=>{const{tr:t,doc:r,selection:i}=e,o=i.$from.start(),a=i.$to.end();r.nodesBetween(o,a,(u,f,h)=>{if([ee.LIST,ee.LIST_ITEM].includes(u.type.name))return;if(h.type.name!==ee.LIST_ITEM)return!1;const m=h.marks.filter(function(p){return!p.type.isInSet(u.marks)});for(const p of m)t.addNodeMark(f,cf(p));return!1}),n.liftListItem(ee.LIST_ITEM)})}},addInputRules(){const n=(e,t)=>$A({find:t,type:this.type,getAttributes:{bullet:{type:e}},joinPredicate:(r,{attrs:i})=>i.bullet.type===e});return[n(Nt.DISC,/^\s*([-+*])\s$/),n(Nt.DECIMAL,/^(\d+)\.\s$/),n(Nt.LATIN,/^([ivx]{1,3})\.\s$/i),n(Nt.ROMAN,/^([a-z])\.\s$/i)]}});function SO(n){return new St({key:new Kt("autolink"),appendTransaction:(e,t,r)=>{const i=e.some(h=>h.docChanged)&&!t.doc.eq(r.doc),o=e.some(h=>h.getMeta("preventAutolink"));if(!i||o)return;const{tr:a}=r,u=uA(t.doc,[...e]);if(bA(u).forEach(({newRange:h})=>{const m=fA(r.doc,h,S=>S.isTextblock);let p,b;if(m.length>1?(p=m[0],b=r.doc.textBetween(p.pos,p.pos+p.node.nodeSize,void 0," ")):m.length&&r.doc.textBetween(h.from,h.to," "," ").endsWith(" ")&&(p=m[0],b=r.doc.textBetween(p.pos,h.to,void 0," ")),p&&b){const S=b.split(" ").filter(A=>A!=="");if(S.length<=0)return!1;const x=S[S.length-1],C=p.pos+b.lastIndexOf(x);if(!x)return!1;nf(x).filter(A=>A.isLink).map(A=>({...A,from:C+A.start+1,to:C+A.end+1})).filter(A=>r.schema.marks.code?!r.doc.rangeHasMark(A.from,A.to,r.schema.marks.code):!0).filter(A=>n.validate?n.validate(A.value):!0).forEach(A=>{Rg(A.from,A.to,r.doc).some(N=>N.mark.type===n.type)||a.addMark(A.from,A.to,n.type.create({href:A.href}))})}}),!!a.steps.length)return a}})}function wO(n){return new St({key:new Kt("handleClickLink"),props:{handleClick:(e,t,r)=>{var i,o;if(r.button!==0||r.target.nodeName!=="A")return!1;const u=mA(e.state,n.type.name),f=r.target,h=(i=f?.href)!==null&&i!==void 0?i:u.href,m=(o=f?.target)!==null&&o!==void 0?o:u.target;return f&&h?(e.editable&&window.open(h,m),!0):!1}}})}function _O(n){return new St({key:new Kt("handlePasteLink"),props:{handlePaste:(e,t,r)=>{var i;const{state:o}=e,{selection:a}=o,{empty:u}=a;if(u)return!1;let f="";r.content.forEach(x=>{f+=x.textContent});const h=nf(f).find(x=>x.isLink&&x.value===f);if(!f||!h)return!1;const m=(i=t.clipboardData)===null||i===void 0?void 0:i.getData("text/html"),p=/href="([^"]*)"/,b=m?.match(p),S=b?b[1]:h.href;return n.editor.commands.setMark(n.type,{href:S}),!0}}})}const xO=_t.create({name:"link",priority:1e3,keepOnSplit:!1,onCreate(){this.options.protocols.forEach(n=>{if(typeof n=="string"){r0(n);return}r0(n.scheme,n.optionalSlashes)})},onDestroy(){yM()},inclusive(){return this.options.autolink},addOptions(){return{openOnClick:!0,linkOnPaste:!0,autolink:!0,protocols:[],HTMLAttributes:{target:"_blank",rel:"noopener noreferrer nofollow",class:null},validate:void 0}},addAttributes(){return{href:{default:null},target:{default:this.options.HTMLAttributes.target},rel:{default:this.options.HTMLAttributes.rel},class:{default:this.options.HTMLAttributes.class}}},parseHTML(){return[{tag:'a[href]:not([href *= "javascript:" i])'}]},renderHTML({HTMLAttributes:n}){var e;return!((e=n.href)===null||e===void 0)&&e.startsWith("javascript:")?["a",_i(this.options.HTMLAttributes,{...n,href:""}),0]:["a",_i(this.options.HTMLAttributes,n),0]},addCommands(){return{setLink:n=>({chain:e})=>e().setMark(this.name,n).setMeta("preventAutolink",!0).run(),toggleLink:n=>({chain:e})=>e().toggleMark(this.name,n,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run(),unsetLink:()=>({chain:n})=>n().unsetMark(this.name,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run()}},addPasteRules(){return[WA({find:n=>nf(n).filter(e=>this.options.validate?this.options.validate(e.value):!0).filter(e=>e.isLink).map(e=>({text:e.value,index:e.start,data:e})),type:this.type,getAttributes:(n,e)=>{var t,r;const i=(t=e?.clipboardData)===null||t===void 0?void 0:t.getData("text/html"),o=/href="([^"]*)"/,a=i?.match(o);return a?{href:a[1]}:{href:(r=n.data)===null||r===void 0?void 0:r.href}}})]},addProseMirrorPlugins(){const n=[];return this.options.autolink&&n.push(SO({type:this.type,validate:this.options.validate})),this.options.openOnClick&&n.push(wO({type:this.type})),this.options.linkOnPaste&&n.push(_O({editor:this.editor,type:this.type})),n}}),kO=xO.extend({name:ce.LINK,addOptions(){return{...this.parent?.(),openOnClick:!1,linkOnPaste:!1}},addAttributes(){return{href:{default:null,parseHTML:n=>{const e=n.getAttribute("href");return e.startsWith("#")?parseFloat(n.getAttribute("href").replace("#","")):e}},target:{default:Ug.SELF,parseHTML:n=>n.getAttribute("target")||Ug.SELF},destination:{default:_s.URL,parseHTML:n=>{const e=n.getAttribute("href");if(!e.startsWith("#"))return _s.URL;const t=e.replace("#","");return F(this.options.pageBlocks).find(o=>o.id===parseInt(t))?_s.BLOCK:_s.URL}}}},addCommands(){const{unsetLink:n}=this.parent();return{removeLink:n,applyLink:P(({commands:e,chain:t},r)=>(e.setMeta("preventAutolink",!0),e.getSelectedText()?t().applyMark(this.name,r).expandSelectionToLink().command(({tr:i})=>(r.text&&i.insertText(r.text,i.selection.from,i.selection.to),!0)).run():e.insertContent(S0.text(r.text,[S0.mark(ce.LINK,r)])))),expandSelectionToLink:P(({commands:e})=>{e.expandSelection(({node:t})=>this.type.isInSet(t.marks))}),isLink:P(({commands:e})=>e.hasMark(this.name)),getLinkPreset:P(()=>fe(()=>F(this.options.preset)))}},addProseMirrorPlugins(){return[...this.parent(),SM.create(this.editor)]},renderHTML({HTMLAttributes:n}){const e=n.destination===_s.BLOCK?`#${n.href}`:n.href,t=F(this.options.basePresetClass)+F(this.options.preset).id;return["a",{href:e,target:n.target,class:`${t} zw-style`},0]}}),EO=_t.create({name:ce.SUPERSCRIPT,addCommands(){return{applySuperscript:P(({commands:n})=>{n.setMark(this.name)}),removeSuperscript:P(({commands:n})=>{n.unsetMark(this.name)}),toggleSuperscript:P(({commands:n})=>{F(n.isSuperscript())?n.removeSuperscript():n.applySuperscript()}),isSuperscript:P(({commands:n})=>{const e=n.getMark(this.name);return fe(()=>!!F(e))})}},parseHTML(){return[{tag:"sup"},{style:"vertical-align",getAttrs:n=>n!=="super"?!1:null}]},renderHTML(){return["sup",{class:"zw-superscript"},0]}}),TO=Ne.create({name:ce.MARGIN,addGlobalAttributes:()=>[{types:[ee.PARAGRAPH,ee.HEADING],attributes:{[ce.MARGIN]:{isRequired:!1,parseHTML(n){const{margin:e,marginTop:t,marginRight:r,marginBottom:i,marginLeft:o}=n.style;return[e,t,r,i,o].some(f=>!!f)?e?{value:e}:{value:[t||0,r||0,i||0,o||0].join(" ")}:null},renderHTML(n){return n.margin?zl({margin:n.margin.value}):null}}}}]});function CO(n){const e=r=>n.presetsRef.value.find(i=>i.id===r),t=Eu({default:null,link:null});return wk(n.presetsRef,()=>{t.default=e(n.defaultPresetId),t.link=e(n.linkPresetId)},{immediate:!0,deep:!0}),iO().concat([oO.configure({presets:n.presetsRef,defaultId:n.defaultPresetId,styleRenderer:new OO({baseClass:n.basePresetClass,makeVariable:n.makePresetVariable,linkPresetId:n.linkPresetId})}),vO.configure({baseClass:n.baseListClass,presetClass:n.basePresetClass+n.defaultPresetId}),fO.configure({device:n.deviceRef}),aO.configure({minSize:n.minFontSize,maxSize:n.maxFontSize,wrapperRef:n.wrapperRef}),sO.configure({fonts:n.fonts,defaultPreset:ai(t,"default"),defaultFont:n.defaultFont}),lO,uO,cO,dO,hO,pO,EO,mO,gO.configure({wrapperRef:n.wrapperRef}),kO.configure({preset:ai(t,"link"),basePresetClass:n.basePresetClass,pageBlocks:n.pageBlocksRef}),TO])}class AO{_domParser=new DOMParser;types=window;parse(e){return this._domParser.parseFromString(e,"text/html")}}class v0{content;constructor({content:e}){this.content=e}normalize(){throw new Error("Implement abstract method")}}class un extends v0{static BLOCK_NODE_NAMES=["P","H1","H2","H3","H4"];static ROOT_NODE_NAMES=un.BLOCK_NODE_NAMES.concat("UL","OL");static BLOCK_STYLES=["text-align","line-height","margin","margin-top","margin-bottom","margin-left","margin-right"];_parser;constructor({content:e,parser:t}){super({content:e}),this._parser=t,this.dom=null}normalize(){return this.normalizeHTML(),this.normalizedHTML}normalizeHTML(){this.dom=this._parser.parse(this.content.replace(/(\r)?\n/g,"")),this._removeComments(),this._normalizeRootTags(),this._iterateNodes(this._normalizeBreakLines,e=>e.tagName==="BR"),this._iterateNodes(this._removeEmptyNodes,this._isBlockNode),this._iterateNodes(this._normalizeListItems,e=>e.tagName==="LI"),this._normalizeBlockTextDecoration(),this._normalizeBlockBackgroundColor()}get normalizedHTML(){return this.dom.body.innerHTML}get _NodeFilter(){return this._parser.types.NodeFilter}get _Node(){return this._parser.types.Node}_removeComments(){const e=this._createNodeIterator(this._NodeFilter.SHOW_COMMENT);this._runIterator(e,t=>t.remove())}_normalizeRootTags(){const e=Array.from(this.dom.body.childNodes),t=this.dom.createDocumentFragment();let r;for(const i of e){if(this._isRootNode(i)){t.append(i),r=null;continue}r||(r=this.dom.createElement("p"),t.append(r)),r.append(i)}this.dom.body.innerHTML="",this.dom.body.append(t)}_createNodeIterator(e,t){return this.dom.createNodeIterator(this.dom.body,e,t)}_iterateNodes(e,t=()=>!0){const r=o=>o.tagName!=="BODY"&&t.call(this,o),i=this._createNodeIterator(this._NodeFilter.SHOW_ELEMENT,{acceptNode:o=>r(o)?this._NodeFilter.FILTER_ACCEPT:this._NodeFilter.FILTER_REJECT});this._runIterator(i,e)}_runIterator(e,t){let r=e.nextNode();for(;r;)t.call(this,r),r=e.nextNode()}_removeEmptyNodes(e){e.innerHTML.trim()||e.remove()}_normalizeListItems(e){const t=this.dom.createDocumentFragment(),r=Array.from(e.childNodes);let i,o;const a=u=>{this._assignElementProperties(u,e,un.BLOCK_STYLES),t.append(u)};this._assignElementProperties(e,e.parentElement,un.BLOCK_STYLES);for(const u of r){if(this._isBlockNode(u)){a(u),i=null,o=u;continue}if(u.tagName==="BR"&&o&&o?.tagName!=="BR"){u.remove(),o=u;continue}if(u.tagName==="BR"){const f=this.dom.createElement("p");f.append(u),a(f),i=null,o=u;continue}i||(i=this.dom.createElement("p"),a(i)),i.append(u),o=u}e.append(t),this._removeStyleProperties(e,un.BLOCK_STYLES),this._removeStyleProperties(e.parentElement,un.BLOCK_STYLES),this._assignElementProperties(e,e.parentElement),e.parentElement.lastElementChild===e&&this._removeStyleProperties(e.parentElement)}_isBlockNode(e){return un.BLOCK_NODE_NAMES.includes(e.tagName)}_isRootNode(e){return un.ROOT_NODE_NAMES.includes(e.tagName)}_assignElementProperties(e,t,r=Array.from(t.style)){for(const i of r){const o=t.style.getPropertyValue(i);o&&!e.style.getPropertyValue(i)&&e.style.setProperty(i,o)}}_removeStyleProperties(e,t=Array.from(e.style)){for(const r of t)e.style.removeProperty(r);e.style.length===0&&e.removeAttribute("style")}_normalizeBreakLines({parentElement:e}){if(!this._isBlockNode(e)||!e.textContent)return;const t=this.dom.createDocumentFragment(),r=Array.from(e.childNodes),i=e.cloneNode(!0);i.innerHTML="";let o=i.cloneNode();const a=u=>{this._assignElementProperties(u,e,un.BLOCK_STYLES),t.append(u)};for(const u of r){if(u.tagName==="BR"){a(o),o=i.cloneNode();continue}o.append(u)}t.append(o),e.replaceWith(t)}_normalizeBlockTextDecoration(){const e=this.dom.querySelectorAll('[style*="text-decoration"]:where(p, h1, h2, h3, h4, li)');for(const t of e)this._moveTextDecorationToChildren(t)}_moveTextDecorationToChildren(e){const t=this._parseTextDecoration(e);if(e.style.removeProperty("text-decoration-line"),e.style.removeProperty("text-decoration"),e.style.cssText||e.removeAttribute("style"),!t.none)for(const r of e.childNodes){const i=this._wrapTextNode(e,r),o=this._parseTextDecoration(i),a={underline:o.underline||t.underline,line_through:o.line_through||t.line_through};i.style.removeProperty("text-decoration-line"),i.style.removeProperty("text-decoration"),i.style.textDecoration=Object.entries(a).filter(([,u])=>u).map(([u])=>u.replace("_","-")).join(" ")}}_parseTextDecoration(e){const{textDecoration:t,textDecorationLine:r}=e.style,i=t||r||"";return{none:i.includes("none"),underline:i.includes("underline"),line_through:i.includes("line-through")}}_normalizeBlockBackgroundColor(){const e=this.dom.querySelectorAll('[style*="background-color"]:where(p, h1, h2, h3, h4, li)');for(const t of e)this._moveBackgroundColorToChildren(t)}_moveBackgroundColorToChildren(e){const t=e.style.backgroundColor;e.style.removeProperty("background-color"),e.style.cssText||e.removeAttribute("style");for(const r of e.childNodes){const i=this._wrapTextNode(e,r),o=i.style.backgroundColor||t;i.style.backgroundColor=o}}_wrapTextNode(e,t){if(t.nodeType!==this._Node.TEXT_NODE)return t;const r=this.dom.createElement("span");return r.append(t.cloneNode()),e.replaceChild(r,t),r}}class MO extends v0{normalize(){return this._iterateNodes(this._bubbleMarks),this.content}_iterateNodes(e){this._iterateChildNodes(this.content,e)}_iterateChildNodes(e,t){for(const r of e.content)r.content&&this._iterateChildNodes(r,t),t.call(this,r)}_bubbleMarks(e){if(e.content&&e.type!==ee.LIST){for(const t of e.content)if(!this._isLink(t)&&t.marks)for(const r of t.marks.slice()){if(this._includesMark(e,r)){this._removeMark(t,r);continue}this._canBubbleMark(e,r)&&(this._removeMark(t,r),this._addMark(e,r))}}}_canBubbleMark(e,t){if(ce.inlineMarks.includes(t.type)||this._includesMarkType(e,t.type))return!1;for(const r of e.content)if(!(!r.content&&e.type===ee.LIST_ITEM)&&(!r.marks||!this._includesMark(r,t)))return!1;return!0}_includesMark(e,t){return e.marks?.some(r=>g0.isEqual(r,t))??!1}_includesMarkType(e,t){return e.marks?.some(r=>r.type===t)??!1}_isLink(e){return e.type===ee.TEXT&&this._includesMarkType(e,ce.LINK)}_removeMark(e,t){if(!e.marks)return;const r=this._findMarkIndexByType(e,t.type);r>=0&&e.marks.splice(r,1),e.marks.length||delete e.marks}_addMark(e,t){this._removeMark(e,t),e.marks??=[],e.marks.push(t)}_findMarkIndexByType(e,t){return e.marks?.findIndex(r=>r.type===t)??null}}class Vl{static build(e,t={}){return typeof e=="string"?this._buildHtml(e,t):this._buildJson(e)}static _buildHtml(e,t){return new un({content:e,parser:t.parser||new AO})}static _buildJson(e){return new MO({content:e})}static normalize(e,t={}){return Vl.build(e,t).normalize()}}class Oi{static window=globalThis.window;static use(e){this.window=e}static get document(){return this.window.document}static get body(){return this.document.body}static get head(){return this.document.head}static getComputedStyle(e){return this.window.getComputedStyle(e)}}class yf{static build({config:e,nodeDomParser:t}){const r=CO({fonts:e.fonts,minFontSize:0,maxFontSize:0,presetsRef:Fo(e.presets),defaultPresetId:e.defaultPresetId,linkPresetId:e.linkPresetId,makePresetVariable:()=>"",basePresetClass:e.basePresetClass,baseListClass:e.baseListClass,deviceRef:Fo(Pc.DESKTOP),pageBlocksRef:Fo([]),wrapperRef:Oi.document.createElement("p")}),i=hA(r);return new yf({schema:i,domParser:Uu.fromSchema(i),nodeDomParser:t})}_schema;_domParser;_nodeDomParser;constructor({schema:e,domParser:t,nodeDomParser:r}){this._schema=e,this._domParser=t,this._nodeDomParser=r}toJSON(e){const t=Vl.build(e,{parser:this._nodeDomParser});return t.normalizeHTML(),this._domParser.parse(t.dom.body).toJSON()}}class S0{static doc(e){return{type:ee.DOCUMENT,content:e}}static list(e,t){return{type:ee.LIST,attrs:{bullet:{type:e}},content:t.map(r=>r.type===ee.LIST_ITEM?r:this.listItem([].concat(r)))}}static listItem(...e){const{attrs:t,content:r,marks:i}=this._normalizeTextBlockArgs(e);return{type:ee.LIST_ITEM,...t?{attrs:t}:{},...i?{marks:i}:{},content:[].concat(r).map(o=>typeof o=="string"?this.paragraph(o):o)}}static heading(e,...t){const r=this._textBlock(t,this.text);return r.attrs??={},r.attrs.level=e,{type:ee.HEADING,...r}}static paragraph(...e){return{type:ee.PARAGRAPH,...this._textBlock(e,this.text)}}static _textBlock(e){const{attrs:t,content:r,marks:i}=this._normalizeTextBlockArgs(e);return{content:typeof r=="string"?[this.text(r)]:r,...t?{attrs:t}:{},...i?{marks:i}:{}}}static _normalizeTextBlockArgs(e){return e.length===1?{attrs:null,marks:null,content:e[0]}:e.length===2?{attrs:e[0],marks:null,content:e[1]}:{attrs:e[0],marks:e[1],content:e[2]}}static text(e,t){return{type:ee.TEXT,...t?{marks:t}:{},text:e}}static link(e,t,r=[]){return this.text(e,[this.mark(ce.LINK,t),...r])}static mark(e,t){return{type:e,attrs:t}}static populateAllDevices(e){return{mobile:e,tablet:e,desktop:e}}}class OO{_baseClass;_makeVariable;_linkPresetId;constructor({baseClass:e,makeVariable:t,linkPresetId:r}){this._baseClass=e,this._makeVariable=t,this._linkPresetId=r}inject(e,t){let r=e.querySelector("[data-zw-styles]");r||(r=Oi.document.createElement("style"),r.dataset.zwStyles="",r.innerHTML=this.render(t),e.append(r))}render(e){let t="";for(const r of e){const i=r.id===this._linkPresetId,o=this.makePresetCssClass(r);t+=` ${o} {`;for(const a of Pc.values)for(const u of Object.keys(r[a])){const f=this._makeVariable({device:a,preset:r,property:u}),h=this._makeInternalVariableName(u,a);if(t+=`${h}: var(${f}, inherit);`,i&&!ce.attributes.includes(u)){const m=h.replace("preset-","");t+=`${m}: var(${h});`}}t+="}"}return t}_makeInternalVariableName(e,t){const r=e==="color"?"font-color":e.replace(/_/i,"-"),i=t===Pc.COMMON?"":`-${t}`;return`--zw-preset-${r}${i}`}makePresetHtmlClass(e){return this._baseClass+e.id}makePresetCssClass(e){return this.makePresetHtmlClass(e).split(" ").map(t=>`.${t}`).join("")}}class bf{static _instance;static get instance(){return this._instance??=new bf,this._instance}static query(e,t){return this.instance.query(e,t)}query(e,t){let r=null;return e.descendants(i=>{if(r)return!1;if(this.matchNode(i,t))return r=i,!1}),r?t.getMark?this.getMark(r,t.getMark):r:null}matchNode(e,t){return!(t.typeName&&t.typeName!==e.type.name||t.mark&&!this.getMark(e,t.mark))}getMark(e,t){return e.marks.find(r=>this.matchMark(r,t))||null}matchMark(e,t){return e.type.name===t.typeName}}class IO{static createWindow(){return new Yh.JSDOM().window}types;parse(e){const{window:t}=new Yh.JSDOM(e);return this.types=t,t.document}}exports.ContentSerializer=yf,exports.ContextWindow=Oi,exports.NodeDomParser=IO;
37
+ `)+N+`return __p
38
+ }`;var ne=ep(function(){return me(v,W+"return "+N).apply(t,x)});if(ne.source=N,ac(ne))throw ne;return ne}function gw(s){return ge(s).toLowerCase()}function yw(s){return ge(s).toUpperCase()}function bw(s,l,u){if(s=ge(s),s&&(u||l===t))return cd(s);if(!s||!(l=bt(l)))return s;var d=Vt(s),g=Vt(l),v=ud(d,g),x=fd(d,g)+1;return $n(d,v,x).join("")}function vw(s,l,u){if(s=ge(s),s&&(u||l===t))return s.slice(0,hd(s)+1);if(!s||!(l=bt(l)))return s;var d=Vt(s),g=fd(d,Vt(l))+1;return $n(d,0,g).join("")}function Sw(s,l,u){if(s=ge(s),s&&(u||l===t))return s.replace(aa,"");if(!s||!(l=bt(l)))return s;var d=Vt(s),g=ud(d,Vt(l));return $n(d,g).join("")}function xw(s,l){var u=Xl,d=Bi;if(Ee(l)){var g="separator"in l?l.separator:g;u="length"in l?ee(l.length):u,d="omission"in l?bt(l.omission):d}s=ge(s);var v=s.length;if(jr(s)){var x=Vt(s);v=x.length}if(u>=v)return s;var w=u-Yr(d);if(w<1)return d;var E=x?$n(x,0,w).join(""):s.slice(0,w);if(g===t)return E+d;if(x&&(w+=E.length-w),cc(g)){if(s.slice(w).search(g)){var O,I=E;for(g.global||(g=Ea(g.source,ge(If.exec(g))+"g")),g.lastIndex=0;O=g.exec(I);)var N=O.index;E=E.slice(0,N===t?w:N)}}else if(s.indexOf(bt(g),w)!=w){var B=E.lastIndexOf(g);B>-1&&(E=E.slice(0,B))}return E+d}function ww(s){return s=ge(s),s&&R0.test(s)?s.replace(Af,Xy):s}var _w=ri(function(s,l,u){return s+(u?" ":"")+l.toUpperCase()}),dc=th("toUpperCase");function Qh(s,l,u){return s=ge(s),l=u?t:l,l===t?Gy(s)?e1(s):Fy(s):s.match(l)||[]}var ep=re(function(s,l){try{return gt(s,t,l)}catch(u){return ac(u)?u:new Z(u)}}),kw=wn(function(s,l){return At(l,function(u){u=sn(u),Sn(s,u,oc(s[u],s))}),s});function Ew(s){var l=s==null?0:s.length,u=J();return s=l?_e(s,function(d){if(typeof d[1]!="function")throw new Mt(a);return[u(d[0]),d[1]]}):[],re(function(d){for(var g=-1;++g<l;){var v=s[g];if(gt(v[0],this,d))return gt(v[1],this,d)}})}function Tw(s){return X1(It(s,p))}function hc(s){return function(){return s}}function Cw(s,l){return s==null||s!==s?l:s}var Aw=rh(),Mw=rh(!0);function ht(s){return s}function pc(s){return Rd(typeof s=="function"?s:It(s,p))}function Ow(s){return Pd(It(s,p))}function Iw(s,l){return Dd(s,It(l,p))}var Nw=re(function(s,l){return function(u){return es(u,s,l)}}),Rw=re(function(s,l){return function(u){return es(s,u,l)}});function mc(s,l,u){var d=Fe(l),g=uo(l,d);u==null&&!(Ee(l)&&(g.length||!d.length))&&(u=l,l=s,s=this,g=uo(l,Fe(l)));var v=!(Ee(u)&&"chain"in u)||!!u.chain,x=kn(s);return At(g,function(w){var E=l[w];s[w]=E,x&&(s.prototype[w]=function(){var O=this.__chain__;if(v||O){var I=s(this.__wrapped__),N=I.__actions__=ut(this.__actions__);return N.push({func:E,args:arguments,thisArg:s}),I.__chain__=O,I}return E.apply(s,Pn([this.value()],arguments))})}),s}function Lw(){return Ue._===this&&(Ue._=o1),this}function gc(){}function Pw(s){return s=ee(s),re(function(l){return Fd(l,s)})}var Dw=qa(_e),Fw=qa(id),Bw=qa(ba);function tp(s){return ec(s)?va(sn(s)):pb(s)}function zw(s){return function(l){return s==null?t:mr(s,l)}}var Hw=sh(),$w=sh(!0);function yc(){return[]}function bc(){return!1}function Ww(){return{}}function Uw(){return""}function Vw(){return!0}function Kw(s,l){if(s=ee(s),s<1||s>Ye)return[];var u=nt,d=Xe(s,nt);l=J(l),s-=nt;for(var g=wa(d,l);++u<s;)l(u);return g}function Gw(s){return Q(s)?_e(s,sn):vt(s)?[s]:ut(xh(ge(s)))}function qw(s){var l=++i1;return ge(s)+l}var Jw=yo(function(s,l){return s+l},0),jw=Ja("ceil"),Yw=yo(function(s,l){return s/l},1),Xw=Ja("floor");function Zw(s){return s&&s.length?co(s,ht,Ra):t}function Qw(s,l){return s&&s.length?co(s,J(l,2),Ra):t}function e_(s){return ld(s,ht)}function t_(s,l){return ld(s,J(l,2))}function n_(s){return s&&s.length?co(s,ht,Fa):t}function r_(s,l){return s&&s.length?co(s,J(l,2),Fa):t}var i_=yo(function(s,l){return s*l},1),s_=Ja("round"),o_=yo(function(s,l){return s-l},0);function l_(s){return s&&s.length?xa(s,ht):0}function a_(s,l){return s&&s.length?xa(s,J(l,2)):0}return b.after=OS,b.ary=Nh,b.assign=yx,b.assignIn=Gh,b.assignInWith=Oo,b.assignWith=bx,b.at=vx,b.before=Rh,b.bind=oc,b.bindAll=kw,b.bindKey=Lh,b.castArray=WS,b.chain=Mh,b.chunk=Xb,b.compact=Zb,b.concat=Qb,b.cond=Ew,b.conforms=Tw,b.constant=hc,b.countBy=lS,b.create=Sx,b.curry=Ph,b.curryRight=Dh,b.debounce=Fh,b.defaults=xx,b.defaultsDeep=wx,b.defer=IS,b.delay=NS,b.difference=ev,b.differenceBy=tv,b.differenceWith=nv,b.drop=rv,b.dropRight=iv,b.dropRightWhile=sv,b.dropWhile=ov,b.fill=lv,b.filter=cS,b.flatMap=dS,b.flatMapDeep=hS,b.flatMapDepth=pS,b.flatten=Eh,b.flattenDeep=av,b.flattenDepth=cv,b.flip=RS,b.flow=Aw,b.flowRight=Mw,b.fromPairs=uv,b.functions=Mx,b.functionsIn=Ox,b.groupBy=mS,b.initial=dv,b.intersection=hv,b.intersectionBy=pv,b.intersectionWith=mv,b.invert=Nx,b.invertBy=Rx,b.invokeMap=yS,b.iteratee=pc,b.keyBy=bS,b.keys=Fe,b.keysIn=dt,b.map=ko,b.mapKeys=Px,b.mapValues=Dx,b.matches=Ow,b.matchesProperty=Iw,b.memoize=To,b.merge=Fx,b.mergeWith=qh,b.method=Nw,b.methodOf=Rw,b.mixin=mc,b.negate=Co,b.nthArg=Pw,b.omit=Bx,b.omitBy=zx,b.once=LS,b.orderBy=vS,b.over=Dw,b.overArgs=PS,b.overEvery=Fw,b.overSome=Bw,b.partial=lc,b.partialRight=Bh,b.partition=SS,b.pick=Hx,b.pickBy=Jh,b.property=tp,b.propertyOf=zw,b.pull=vv,b.pullAll=Ch,b.pullAllBy=Sv,b.pullAllWith=xv,b.pullAt=wv,b.range=Hw,b.rangeRight=$w,b.rearg=DS,b.reject=_S,b.remove=_v,b.rest=FS,b.reverse=ic,b.sampleSize=ES,b.set=Wx,b.setWith=Ux,b.shuffle=TS,b.slice=kv,b.sortBy=MS,b.sortedUniq=Iv,b.sortedUniqBy=Nv,b.split=dw,b.spread=BS,b.tail=Rv,b.take=Lv,b.takeRight=Pv,b.takeRightWhile=Dv,b.takeWhile=Fv,b.tap=Zv,b.throttle=zS,b.thru=_o,b.toArray=Uh,b.toPairs=jh,b.toPairsIn=Yh,b.toPath=Gw,b.toPlainObject=Kh,b.transform=Vx,b.unary=HS,b.union=Bv,b.unionBy=zv,b.unionWith=Hv,b.uniq=$v,b.uniqBy=Wv,b.uniqWith=Uv,b.unset=Kx,b.unzip=sc,b.unzipWith=Ah,b.update=Gx,b.updateWith=qx,b.values=oi,b.valuesIn=Jx,b.without=Vv,b.words=Qh,b.wrap=$S,b.xor=Kv,b.xorBy=Gv,b.xorWith=qv,b.zip=Jv,b.zipObject=jv,b.zipObjectDeep=Yv,b.zipWith=Xv,b.entries=jh,b.entriesIn=Yh,b.extend=Gh,b.extendWith=Oo,mc(b,b),b.add=Jw,b.attempt=ep,b.camelCase=Zx,b.capitalize=Xh,b.ceil=jw,b.clamp=jx,b.clone=US,b.cloneDeep=KS,b.cloneDeepWith=GS,b.cloneWith=VS,b.conformsTo=qS,b.deburr=Zh,b.defaultTo=Cw,b.divide=Yw,b.endsWith=Qx,b.eq=Gt,b.escape=ew,b.escapeRegExp=tw,b.every=aS,b.find=uS,b.findIndex=_h,b.findKey=_x,b.findLast=fS,b.findLastIndex=kh,b.findLastKey=kx,b.floor=Xw,b.forEach=Oh,b.forEachRight=Ih,b.forIn=Ex,b.forInRight=Tx,b.forOwn=Cx,b.forOwnRight=Ax,b.get=uc,b.gt=JS,b.gte=jS,b.has=Ix,b.hasIn=fc,b.head=Th,b.identity=ht,b.includes=gS,b.indexOf=fv,b.inRange=Yx,b.invoke=Lx,b.isArguments=br,b.isArray=Q,b.isArrayBuffer=YS,b.isArrayLike=ft,b.isArrayLikeObject=Me,b.isBoolean=XS,b.isBuffer=Wn,b.isDate=ZS,b.isElement=QS,b.isEmpty=ex,b.isEqual=tx,b.isEqualWith=nx,b.isError=ac,b.isFinite=rx,b.isFunction=kn,b.isInteger=zh,b.isLength=Ao,b.isMap=Hh,b.isMatch=ix,b.isMatchWith=sx,b.isNaN=ox,b.isNative=lx,b.isNil=cx,b.isNull=ax,b.isNumber=$h,b.isObject=Ee,b.isObjectLike=Ae,b.isPlainObject=ls,b.isRegExp=cc,b.isSafeInteger=ux,b.isSet=Wh,b.isString=Mo,b.isSymbol=vt,b.isTypedArray=si,b.isUndefined=fx,b.isWeakMap=dx,b.isWeakSet=hx,b.join=gv,b.kebabCase=nw,b.last=Rt,b.lastIndexOf=yv,b.lowerCase=rw,b.lowerFirst=iw,b.lt=px,b.lte=mx,b.max=Zw,b.maxBy=Qw,b.mean=e_,b.meanBy=t_,b.min=n_,b.minBy=r_,b.stubArray=yc,b.stubFalse=bc,b.stubObject=Ww,b.stubString=Uw,b.stubTrue=Vw,b.multiply=i_,b.nth=bv,b.noConflict=Lw,b.noop=gc,b.now=Eo,b.pad=sw,b.padEnd=ow,b.padStart=lw,b.parseInt=aw,b.random=Xx,b.reduce=xS,b.reduceRight=wS,b.repeat=cw,b.replace=uw,b.result=$x,b.round=s_,b.runInContext=k,b.sample=kS,b.size=CS,b.snakeCase=fw,b.some=AS,b.sortedIndex=Ev,b.sortedIndexBy=Tv,b.sortedIndexOf=Cv,b.sortedLastIndex=Av,b.sortedLastIndexBy=Mv,b.sortedLastIndexOf=Ov,b.startCase=hw,b.startsWith=pw,b.subtract=o_,b.sum=l_,b.sumBy=a_,b.template=mw,b.times=Kw,b.toFinite=En,b.toInteger=ee,b.toLength=Vh,b.toLower=gw,b.toNumber=Lt,b.toSafeInteger=gx,b.toString=ge,b.toUpper=yw,b.trim=bw,b.trimEnd=vw,b.trimStart=Sw,b.truncate=xw,b.unescape=ww,b.uniqueId=qw,b.upperCase=_w,b.upperFirst=dc,b.each=Oh,b.eachRight=Ih,b.first=Th,mc(b,function(){var s={};return nn(b,function(l,u){be.call(b.prototype,u)||(s[u]=l)}),s}(),{chain:!1}),b.VERSION=r,At(["bind","bindKey","curry","curryRight","partial","partialRight"],function(s){b[s].placeholder=b}),At(["drop","take"],function(s,l){le.prototype[s]=function(u){u=u===t?1:De(ee(u),0);var d=this.__filtered__&&!l?new le(this):this.clone();return d.__filtered__?d.__takeCount__=Xe(u,d.__takeCount__):d.__views__.push({size:Xe(u,nt),type:s+(d.__dir__<0?"Right":"")}),d},le.prototype[s+"Right"]=function(u){return this.reverse()[s](u).reverse()}}),At(["filter","map","takeWhile"],function(s,l){var u=l+1,d=u==cr||u==Rn;le.prototype[s]=function(g){var v=this.clone();return v.__iteratees__.push({iteratee:J(g,3),type:u}),v.__filtered__=v.__filtered__||d,v}}),At(["head","last"],function(s,l){var u="take"+(l?"Right":"");le.prototype[s]=function(){return this[u](1).value()[0]}}),At(["initial","tail"],function(s,l){var u="drop"+(l?"":"Right");le.prototype[s]=function(){return this.__filtered__?new le(this):this[u](1)}}),le.prototype.compact=function(){return this.filter(ht)},le.prototype.find=function(s){return this.filter(s).head()},le.prototype.findLast=function(s){return this.reverse().find(s)},le.prototype.invokeMap=re(function(s,l){return typeof s=="function"?new le(this):this.map(function(u){return es(u,s,l)})}),le.prototype.reject=function(s){return this.filter(Co(J(s)))},le.prototype.slice=function(s,l){s=ee(s);var u=this;return u.__filtered__&&(s>0||l<0)?new le(u):(s<0?u=u.takeRight(-s):s&&(u=u.drop(s)),l!==t&&(l=ee(l),u=l<0?u.dropRight(-l):u.take(l-s)),u)},le.prototype.takeRightWhile=function(s){return this.reverse().takeWhile(s).reverse()},le.prototype.toArray=function(){return this.take(nt)},nn(le.prototype,function(s,l){var u=/^(?:filter|find|map|reject)|While$/.test(l),d=/^(?:head|last)$/.test(l),g=b[d?"take"+(l=="last"?"Right":""):l],v=d||/^find/.test(l);g&&(b.prototype[l]=function(){var x=this.__wrapped__,w=d?[1]:arguments,E=x instanceof le,O=w[0],I=E||Q(x),N=function(se){var ce=g.apply(b,Pn([se],w));return d&&B?ce[0]:ce};I&&u&&typeof O=="function"&&O.length!=1&&(E=I=!1);var B=this.__chain__,W=!!this.__actions__.length,j=v&&!B,ne=E&&!W;if(!v&&I){x=ne?x:new le(this);var Y=s.apply(x,w);return Y.__actions__.push({func:_o,args:[N],thisArg:t}),new Ot(Y,B)}return j&&ne?s.apply(this,w):(Y=this.thru(N),j?d?Y.value()[0]:Y.value():Y)})}),At(["pop","push","shift","sort","splice","unshift"],function(s){var l=Js[s],u=/^(?:push|sort|unshift)$/.test(s)?"tap":"thru",d=/^(?:pop|shift)$/.test(s);b.prototype[s]=function(){var g=arguments;if(d&&!this.__chain__){var v=this.value();return l.apply(Q(v)?v:[],g)}return this[u](function(x){return l.apply(Q(x)?x:[],g)})}}),nn(le.prototype,function(s,l){var u=b[l];if(u){var d=u.name+"";be.call(ei,d)||(ei[d]=[]),ei[d].push({name:l,func:u})}}),ei[go(t,R).name]=[{name:"wrapper",func:t}],le.prototype.clone=w1,le.prototype.reverse=_1,le.prototype.value=k1,b.prototype.at=Qv,b.prototype.chain=eS,b.prototype.commit=tS,b.prototype.next=nS,b.prototype.plant=iS,b.prototype.reverse=sS,b.prototype.toJSON=b.prototype.valueOf=b.prototype.value=oS,b.prototype.first=b.prototype.head,qi&&(b.prototype[qi]=rS),b},Xr=t1();ur?((ur.exports=Xr)._=Xr,pa._=Xr):Ue._=Xr}).call(XM)}(Ps,Ps.exports)),Ps.exports}var y0=ZM();function yf(n){return n.type.create(y0.cloneDeep(n.attrs))}const QM=Re.create({name:"node_processor",addCommands(){return{setBlockAttributes:P(({commands:n,state:e},t,r,i={})=>{const o=F(n.getBlockAttributes(t))??{},{doc:a,tr:c}=e,{from:f,to:h}=c.selection;a.nodesBetween(f,h,(m,p)=>{te.blocks.includes(m.type.name)&&c.setNodeAttribute(p,t,{...i,...o,...r})})}),getBlockAttributes:P(({editor:n},e,t)=>de(()=>{let r=Object.assign({},t||{});for(const i of te.blocks)Object.assign(r,n.getAttributes(i)?.[e]||{});return Object.keys(r).length?r:null})),removeBlockAttributes:P(({commands:n},e)=>{for(const t of te.blocks)n.resetAttributes(t,e)}),applyMark:P(({state:n,commands:e},t,r,i={})=>{const{tr:o,doc:a,schema:c}=n,{$from:f,$to:h}=o.selection,m=ln(fe.LINK,c),p=ln(t,c);if(!(p.spec.group||"").includes(Zt.SETTINGS))return e.setMark(t,r);if(f.pos===h.pos)return;const S=_=>{if(!i.onAppliedToParent||i.onAppliedToParent(_)===!1){const{tr:C,node:A,position:R,mark:K}=_;e._removeNodeMark({tr:C,node:A,position:R,mark:K.type})}};a.nodesBetween(f.pos,h.pos,(_,C)=>{if(_.type.name===te.LIST)return;const A=YM(_.marks,t),R=p.create({...A?.attrs||{},...r}),K=p0(f,h,_,C);if(!m.isInSet(_.marks)&&jM(o.doc,C,R,i.isAppliedToParent))return S({tr:o,node:_,position:C,mark:R});if(_.isText){o.addMark(K.from,K.to,R);return}qM(o.doc,o.selection,_,C)&&o.addNodeMark(C,R)})}),getMarks:P(({editor:n},e)=>{const t=ui(n,"state");return de(()=>{const{selection:r,doc:i}=F(t),{from:o,to:a}=F(r),c=[];return i.nodesBetween(o,a,f=>{for(const h of f.marks)h.type.name===e&&c.unshift(h.attrs)}),c})}),getMark:P(({commands:n},e)=>{const t=n.getMarks(e);return de(()=>F(t)[0]??null)}),hasMark:P(({commands:n},e)=>{const t=n.getMark(e);return de(()=>!!F(t))}),getCommonSettingMark:P(({commands:n},e,t)=>{const r=n.getMark(e);return de(()=>F(r)?.value??F(t))}),getDeviceSettingMark:P(({commands:n},e,t)=>{const r=n.getMarks(e),i=n.getDevice();return de(()=>{for(const o of F(r)){const a=o[F(i)];if(a)return a}return F(t)})}),removeAllMarks:P(({state:n,commands:e})=>{const{tr:t,doc:r}=n,{from:i,to:o}=t.selection;r.nodesBetween(i,o,(a,c)=>{for(const f of a.marks)e._removeNodeMark({tr:t,node:a,position:c,mark:f})})}),removeMarks:P(({state:n,commands:e},t)=>{const{tr:r,doc:i}=n,{from:o,to:a}=r.selection;i.nodesBetween(o,a,(c,f)=>{const h=c.marks.filter(m=>t.includes(m.type.name));for(const m of h)e._removeNodeMark({tr:r,node:c,position:f,mark:m})})}),_removeNodeMark:P((n,{tr:e,node:t,position:r,mark:i})=>t.isText?e.removeMark(r,r+t.nodeSize,i):e.removeNodeMark(r,i))}}}),eO=Re.create({name:"text_processor",addCommands(){return{getSelectedText:P(({state:n})=>{const{from:e,to:t}=n.selection;return n.doc.textBetween(e,t," ")}),transformText:P(({state:n},e)=>{const{$from:t,$to:r}=n.tr.selection;t.pos!==r.pos&&n.doc.nodesBetween(t.pos,r.pos,(i,o)=>{if(!i.isText)return;const a=p0(t,r,i,o),c=Math.max(0,t.pos-o),f=Math.max(0,r.pos-o),h=e({text:i.textContent.substring(c,f)}),m=n.schema.text(h,i.marks);n.tr.replaceWith(a.from,a.to,m)})})}}}),tO=Re.create({name:"selection_processor",addStorage:()=>({selection:null}),addCommands(){return{storeSelection:P(({state:n})=>{this.storage.selection=n.selection}),restoreSelection:P(({commands:n})=>{this.storage.selection&&n.setTextSelection(this.storage.selection)}),expandSelection:P(({tr:n,commands:e},t)=>{let r=n.selection.from,i=n.selection.to;n.doc.nodesBetween(r,i,(o,a,c)=>{if(t({node:o,parent:c})){const f=o.isText?0:m0(n.doc,a);r=Math.min(r,a+f),i=Math.max(i,a+o.nodeSize-f)}}),e.setTextSelection({from:r,to:i})}),expandSelectionToBlock:P(({commands:n})=>{n.expandSelection(({parent:e})=>e.type.name===te.DOCUMENT)})}}}),nO=Nn.create({name:"doc",topNode:!0,content:"block+"});class Fs extends Qe{constructor(e,t,r,i="SetDocAttr"){super(),this.key=e,this.value=t,this.schema=r,this.stepType=i}apply(e){this.prevValue=e.attrs.meta[this.key];const t=Er.fromJSON(this.schema,e.toJSON());return t.attrs.meta[this.key]=this.value,Le.ok(t)}invert(){return new Fs(this.key,this.prevValue,this.schema,"revertSetDocAttr")}map(){return null}toJSON(){return{stepType:this.stepType,key:this.key,value:this.value}}static fromJSON(e){return new Fs(e.key,e.value,e.stepType)}}Qe.jsonID("setDocAttr",Fs);const rO=nO.extend({marks:Zt.SETTINGS,addAttributes:()=>({meta:{default:{}}}),onCreate(){this.editor.view.dom.addEventListener("click",n=>{n.target.closest("a")&&n.preventDefault()})},addCommands(){return{setDocMetaAttributes:P(({state:n},e,t)=>{n.tr.step(new Fs(e,t,n.schema))})}}}),iO=Nn.create({name:"paragraph",priority:1e3,addOptions(){return{HTMLAttributes:{}}},group:"block",content:"inline*",parseHTML(){return[{tag:"p"}]},renderHTML({HTMLAttributes:n}){return["p",ki(this.options.HTMLAttributes,n),0]},addCommands(){return{setParagraph:()=>({commands:n})=>n.setNode(this.name)}},addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}}),sO=iO.extend({marks:Zt.ALL,addOptions:()=>({HTMLAttributes:{class:"zw-style"}})}),oO=Nn.create({name:"heading",addOptions(){return{levels:[1,2,3,4,5,6],HTMLAttributes:{}}},content:"inline*",group:"block",defining:!0,addAttributes(){return{level:{default:1,rendered:!1}}},parseHTML(){return this.options.levels.map(n=>({tag:`h${n}`,attrs:{level:n}}))},renderHTML({node:n,HTMLAttributes:e}){return[`h${this.options.levels.includes(n.attrs.level)?n.attrs.level:this.options.levels[0]}`,ki(this.options.HTMLAttributes,e),0]},addCommands(){return{setHeading:n=>({commands:e})=>this.options.levels.includes(n.level)?e.setNode(this.name,n):!1,toggleHeading:n=>({commands:e})=>this.options.levels.includes(n.level)?e.toggleNode(this.name,"paragraph",n):!1}},addKeyboardShortcuts(){return this.options.levels.reduce((n,e)=>({...n,[`Mod-Alt-${e}`]:()=>this.editor.commands.toggleHeading({level:e})}),{})},addInputRules(){return this.options.levels.map(n=>UA({find:new RegExp(`^(#{1,${n}})\\s$`),type:this.type,getAttributes:{level:n}}))}}),lO=oO.extend({marks:Zt.ALL,addOptions:()=>({levels:[1,2,3,4],HTMLAttributes:{class:"zw-style"}})}),aO=Re.create({name:"prose_mirror_plugins",addProseMirrorPlugins(){return[nM.create(this.editor),rM.create(this.editor)]}}),cO=()=>[rO,sO,lO,GA,tM,QM,eO,tO,aO],uO=Et.create({name:fe.FONT_FAMILY,group:Zt.SETTINGS,addOptions:()=>({fonts:[]}),addAttributes:()=>({value:{required:!0}}),addCommands(){return{applyFontFamily:P(({commands:n},e)=>{n.applyMark(this.name,{value:e});const t=n.findFontByName(e);let r=F(n.getFontWeight());t.isWeightSupported(r)||(r=t.findClosestWeight(r),n.applyFontWeight(r));const i=n.isSettingCustomized(fe.FONT_STYLE).value;!t.isItalicSupported(r)&&i&&n.removeItalic()}),getFont:P(({commands:n})=>{const e=F(this.options.defaultPreset),t=n.findFontByName(e.common.font_family),r=n.getFontFamily();return de(()=>n.findFontByName(F(r))||t)}),findFontByName:P((n,e)=>F(this.options.fonts).find(t=>t.name===e)??this.options.defaultFont),getFontFamily:P(({commands:n})=>n.getCommonSettingMark(this.name,n.getDefaultFontFamily())),getDefaultFontFamily:P(({commands:n})=>{const e=n.getPreset();return de(()=>F(e).common.font_family)})}},parseHTML(){const n=e=>({value:e.replace(/["']/g,"")});return[{style:"--zw-font-family",getAttrs:n},{style:"font-family",getAttrs:n}]},renderHTML({HTMLAttributes:n}){const e=n.value?`"${n.value}"`:null;return Pr({font_family:e})}}),fO=Re.create({name:fe.STYLE_PRESET,addGlobalAttributes(){return[{types:[te.PARAGRAPH,te.HEADING],attributes:{preset:{isRequired:!1,default:{id:F(this.options.defaultId)},parseHTML:n=>{const e=F(this.options.presets);if(n.parentElement.tagName==="LI")return null;for(const{id:t,node:r,fallbackClass:i}of e){if(i&&n.classList.contains(i))return{id:t};const o=F(this.options.styleRenderer).makePresetCssClass({id:t});if(n.matches(o))return{id:t};if(n.tagName===`H${r?.level}`)return{id:t}}return n.tagName==="P"?{id:F(this.options.defaultId)}:null},renderHTML:n=>n.preset?{class:F(this.options.styleRenderer).makePresetHtmlClass(n.preset)}:null}}}]},addCommands(){function n(t,r){return t.find(i=>r===i.id)}function e(t,r){const i={};for(const o of Object.keys(t)){const a=t[o],c=r[o],f=!c||c.toLowerCase()==="inherit";i[o]=f?a:c}return i}return{getPresetList:P(()=>de(()=>F(this.options.presets).filter(t=>!t.hidden))),getPreset:P(({commands:t})=>{const r=t.getBlockAttributes("preset",{id:F(this.options.defaultId)}),i=t.getPresetList(),o=t.isLink(),a=t.getLinkPreset();return de(()=>{const c=n(F(i),F(r).id);if(!F(o))return c;const f=F(a);return{id:c.id,common:e(c.common,f.common),mobile:e(c.mobile,f.mobile),tablet:e(c.tablet,f.tablet),desktop:e(c.desktop,f.desktop)}})}),applyPreset:P(({commands:t,chain:r},i)=>{const o=F(t.getPresetList()),a=n(o,i),c=a.node?.type??te.PARAGRAPH,f={preset:{id:i}};a.node&&(f.level=a.node.level);for(const h of fe.attributes)f[h]=F(t.getBlockAttributes(h));r().removeList().setNode(c,f).run()}),applyDefaultPreset:P(({commands:t})=>{t.applyPreset(F(this.options.defaultId))}),removePreset:P(({commands:t})=>{t.setNode(te.PARAGRAPH,{preset:null})}),getPresetCustomization:P(({editor:t,commands:r})=>{const i=ui(t,"state");return de(()=>{const{selection:o,doc:a}=F(i),{from:c,to:f}=o;return r._getSettingCustomization(a,c,f)})}),isSettingCustomized:P(({commands:t},r)=>{const i=t.getPresetCustomization(),o=fe.presetAttributes.includes(r)?"attributes":"marks";return de(()=>F(i)[o]?.includes(r)??!1)}),getContentCustomization:P(({editor:t,commands:r})=>{const i=ui(t,"state");return de(()=>{const{doc:o}=F(i);return r._getSettingCustomization(o,0,o.content.size)})}),_getSettingCustomization:P((t,r,i,o)=>{const a=new Set,c=new Set;return r.nodesBetween(i,o,f=>{for(const[h,m]of Object.entries(f.attrs))fe.presetAttributes.includes(h)&&m&&c.add(h);for(const{type:h}of f.marks)fe.marks.includes(h.name)&&a.add(h.name)}),{attributes:Array.from(c),marks:Array.from(a)}}),removePresetCustomization:P(({chain:t})=>{t().storeSelection().expandSelectionToBlock().removeMarks(fe.marks).resetAttributes(te.PARAGRAPH,fe.presetAttributes).resetAttributes(te.HEADING,fe.presetAttributes).restoreSelection().run()}),removeFormat:P(({chain:t})=>{t().storeSelection().expandSelectionToBlock().removeAllMarks().applyDefaultPreset().restoreSelection().run()})}},onCreate(){this.options.styleRenderer.inject(Ni.head,F(this.options.presets))}}),dO=Et.create({name:fe.FONT_WEIGHT,group:Zt.SETTINGS,addAttributes:()=>({value:{required:!0}}),addCommands(){return{applyFontWeight:P(({commands:n},e)=>{n.applyMark(this.name,{value:e}),F(n.getFont()).isItalicSupported(e)||n.removeItalic()}),toggleBold:P(({commands:n})=>{const e=F(n.getFontWeight()),t=F(n.getFont()),i=Number(e)>=600?"400":"700",o=t.findClosestWeight(i);n.applyFontWeight(o)}),getFontWeight:P(({commands:n})=>{const e=n.getCommonSettingMark(this.name,n.getDefaultFontWeight()),t=n.getFont();return de(()=>{const r=F(e),i=F(t);return i.isWeightSupported(r)?r:i.findClosestWeight(r)})}),getDefaultFontWeight:P(({commands:n})=>{const e=n.getPreset();return de(()=>F(e).common.font_weight)})}},addKeyboardShortcuts:()=>({"Mod-b":Ht("toggleBold"),"Mod-B":Ht("toggleBold")}),parseHTML(){const n=e=>e==="bold"?{value:"700"}:Number(e)?{value:e}:!1;return[{style:"--zw-font-weight",getAttrs:n},{style:"font-weight",getAttrs:n},{tag:"b",attrs:{value:"700"}},{tag:"strong",attrs:{value:"700"}}]},renderHTML({HTMLAttributes:n}){return Pr({font_weight:n.value})}}),hO=Et.create({name:fe.FONT_SIZE,group:Zt.SETTINGS,addOptions:()=>({minSize:1,maxSize:100}),addAttributes(){return{mobile:{default:null},tablet:{default:null},desktop:{default:null}}},addCommands(){return{getFontSize:P(({commands:n})=>n.getDeviceSettingMark(this.name,n.getDefaultFontSize())),getDefaultFontSize:P(({commands:n})=>{const e=n.getDevice(),t=n.getPreset();return de(()=>F(t)[F(e)].font_size.replace("px",""))}),applyFontSize:P(({commands:n},e)=>{const t=F(n.getDevice());n.applyMark(this.name,{[t]:e},{isAppliedToParent:(r,i)=>r.type.name!==i.type.name?!1:r.attrs[t]===i.attrs[t],onAppliedToParent:({tr:r,node:i,position:o,mark:a})=>{const c={...a.attrs,[t]:null};if(!Object.values(c).some(m=>!!m))return!1;const h=a.type.create(c);if(i.isText){r.addMark(o,o+i.nodeSize,h);return}r.addNodeMark(o,h)}})}),increaseFontSize:P(({commands:n})=>{const e=Number(F(n.getFontSize())),t=Math.min(e+1,F(this.options.maxSize));n.applyFontSize(String(t))}),decreaseFontSize:P(({commands:n})=>{const e=Number(F(n.getFontSize())),t=Math.max(e-1,F(this.options.minSize));n.applyFontSize(String(t))})}},addKeyboardShortcuts:()=>({"Mod-Shift-=":Ht("increaseFontSize"),"Mod-Shift--":Ht("decreaseFontSize")}),parseHTML(){const n=e=>{if(!e)return null;const t=F(this.options.wrapperRef),r=h0(e,t);return String(r)};return[{tag:'[style*="--zw-font-size"]',getAttrs:({style:e})=>({mobile:n(e.getPropertyValue("--zw-font-size-mobile")),tablet:n(e.getPropertyValue("--zw-font-size-tablet")),desktop:n(e.getPropertyValue("--zw-font-size-desktop"))})},{style:"font-size",getAttrs:e=>{const t=n(e);return{desktop:t,tablet:t,mobile:null}}}]},renderHTML({HTMLAttributes:n}){const e=t=>t?`${t}px`:null;return Pr({font_size_mobile:e(n.mobile),font_size_tablet:e(n.tablet),font_size_desktop:e(n.desktop)})}}),pO=Et.create({name:fe.FONT_COLOR,group:Zt.SETTINGS,addAttributes:()=>({value:{required:!0}}),addCommands(){return{getFontColor:P(({commands:n})=>n.getCommonSettingMark(this.name,n.getDefaultFontColor())),getDefaultFontColor:P(({commands:n})=>{const e=n.getPreset();return de(()=>F(e).common.color)}),applyFontColor:P(({commands:n},e)=>{n.applyMark(this.name,{value:e})})}},parseHTML(){const n=e=>({value:d0(e)});return[{style:"--zw-font-color",getAttrs:n},{style:"color",getAttrs:n}]},renderHTML({HTMLAttributes:n}){return Pr({font_color:n.value})}}),mO=Et.create({name:fe.BACKGROUND_COLOR,addAttributes:()=>({value:{required:!0}}),addCommands(){return{getBackgroundColor:P(({commands:n})=>n.getCommonSettingMark(this.name,"rgba(255, 255, 255, 0%)")),applyBackgroundColor:P(({commands:n},e)=>{n.applyMark(this.name,{value:e})})}},parseHTML(){const n=e=>({value:d0(e)});return[{style:"--zw-background-color",getAttrs:n},{style:"background-color",getAttrs:n}]},renderHTML({HTMLAttributes:n}){return Pr({background_color:n.value})}}),gO=Re.create({name:"device_manager",addCommands(){return{getDevice:P(()=>ui(this.options,"device"))}}}),yO=Et.create({name:fe.FONT_STYLE,group:Zt.SETTINGS,addAttributes:()=>({italic:{required:!0}}),addCommands(){return{isItalic:P(({commands:n})=>{const e=n.getMark(this.name),t=n.getDefaultFontStyle();return de(()=>F(e)?.italic??F(t).italic)}),isItalicAvailable:P(({commands:n})=>{const e=n.getFont(),t=n.getFontWeight();return de(()=>{const r=F(e),i=F(t);return r.isItalicSupported(i)&&!r.isWeightItalicOnly(i)})}),getDefaultFontStyle:P(({commands:n})=>{const e=n.getPreset();return de(()=>({italic:F(e).common.font_style==="italic"}))}),toggleItalic:P(({commands:n})=>{F(n.isItalicAvailable())&&(F(n.isItalic())?n.removeItalic():n.applyItalic())}),applyItalic:P(({commands:n})=>{n.applyMark(this.name,{italic:!0})}),removeItalic:P(({commands:n})=>{n.applyMark(this.name,{italic:!1})})}},addKeyboardShortcuts:()=>({"Mod-i":Ht("toggleItalic"),"Mod-I":Ht("toggleItalic")}),parseHTML(){const n=e=>({italic:e.includes("italic")});return[{tag:"i",attrs:{italic:!0}},{style:"--zw-font-style",getAttrs:n},{style:"font-style",getAttrs:n}]},renderHTML({HTMLAttributes:n}){const e=n.italic?"italic":"normal";return Pr({font_style:e})}}),bO=Et.create({name:fe.TEXT_DECORATION,priority:1e3,addAttributes:()=>({underline:{default:!1},strike_through:{default:!1}}),addCommands(){return{isUnderline:P(({commands:n})=>{const e=n.getTextDecoration();return de(()=>F(e).underline)}),isStrikeThrough:P(({commands:n})=>{const e=n.getTextDecoration();return de(()=>F(e).strike_through)}),getTextDecoration:P(({commands:n})=>{const e=n.getMark(this.name),t=n.getDefaultTextDecoration();return de(()=>{const r=F(e)??{},i=F(t);return{underline:r.underline||i.underline,strike_through:r.strike_through||i.strike_through}})}),isUnderlineCustomized:P(({commands:n})=>{const e=n.isUnderline(),t=n.getDefaultTextDecoration();return de(()=>F(e)!==F(t).underline)}),getDefaultTextDecoration:P(({commands:n})=>{const e=n.getPreset();return de(()=>{const{text_decoration:t}=F(e).common;return{underline:t.includes("underline"),strike_through:t.includes("line-through")}})}),toggleUnderline:P(({commands:n})=>{n.toggleTextDecoration("underline")}),toggleStrikeThrough:P(({commands:n})=>{n.toggleTextDecoration("strike_through")}),toggleTextDecoration:P(({commands:n},e,t=null)=>{const r=F(n.getTextDecoration()),i=t??!r[e];n.applyMark(this.name,{[e]:i})}),applyTextDecoration:P(({commands:n},e)=>{n.toggleTextDecoration(e,!0)}),removeTextDecoration:P(({commands:n},e)=>{n.toggleTextDecoration(e,!1)})}},addKeyboardShortcuts:()=>({"Mod-u":Ht("toggleUnderline"),"Mod-U":Ht("toggleUnderline")}),parseHTML(){const n=e=>{const t=e.includes("underline"),r=e.includes("line-through");return!t&&!r?!1:{underline:t,strike_through:r}};return[{style:"--zw-text-decoration",getAttrs:n},{style:"text-decoration-line",getAttrs:n},{style:"text-decoration",getAttrs:n},{tag:"s",attrs:{underline:!1,strike_through:!0}},{tag:"u",attrs:{underline:!0,strike_through:!1}}]},renderHTML({HTMLAttributes:n}){const e=[];return n.underline&&e.push("underline"),n.strike_through&&e.push("line-through"),e.length||e.push("none"),Pr({text_decoration:e.join(" ")})}}),vO=Re.create({name:"case_style",addCommands(){return{applyCaseStyle:P(({commands:n},e)=>{switch(e){case Uu.CAPITALIZE:return n.applyCapitalize();case Uu.LOWERCASE:return n.applyLowerCase();case Uu.UPPERCASE:return n.applyUpperCase()}}),applyCapitalize:P(({commands:n})=>{n.transformText(({text:e})=>kM(e))}),applyLowerCase:P(({commands:n})=>{n.transformText(({text:e})=>e.toLowerCase())}),applyUpperCase:P(({commands:n})=>{n.transformText(({text:e})=>e.toUpperCase())})}}}),b0={mobile:null,tablet:null,desktop:null},SO=Re.create({name:fe.ALIGNMENT,addGlobalAttributes:()=>[{types:[te.PARAGRAPH,te.HEADING],attributes:{[fe.ALIGNMENT]:{isRequired:!1,parseHTML({style:n}){const e=GM(n.textAlign);if(e)return{desktop:e,tablet:e,mobile:e};const t=n.getPropertyValue("--zw-alignment-mobile")||null,r=n.getPropertyValue("--zw-alignment-tablet")||null,i=n.getPropertyValue("--zw-alignment-desktop")||null;return!t&&!r&&!i?null:{desktop:i,tablet:r,mobile:t}},renderHTML(n){return n.alignment?Kl({alignment_mobile:n.alignment.mobile,alignment_tablet:n.alignment.tablet,alignment_desktop:n.alignment.desktop}):null}}}}],addCommands(){return{applyAlignment:P(({commands:n},e)=>{const t=F(n.getDevice());n.setBlockAttributes(this.name,{[t]:e},b0)}),removeAlignment:P(({commands:n})=>n.removeBlockAttributes(this.name)),getAlignment:P(({commands:n})=>{const e=n.getBlockAttributes(this.name,b0),t=n.getDevice(),r=n.getDefaultAlignment();return de(()=>F(e)?.[F(t)]??F(r))}),getDefaultAlignment:P(({commands:n})=>{const e=n.getDevice(),t=n.getPreset();return de(()=>F(t)[F(e)].alignment??er.LEFT)})}},addKeyboardShortcuts:()=>({"Mod-Shift-l":Ht("applyAlignment",er.LEFT),"Mod-Shift-e":Ht("applyAlignment",er.CENTER),"Mod-Shift-r":Ht("applyAlignment",er.RIGHT),"Mod-Shift-j":Ht("applyAlignment",er.JUSTIFY)})}),v0={mobile:null,tablet:null,desktop:null},xO=Re.create({name:fe.LINE_HEIGHT,addGlobalAttributes(){return[{types:[te.PARAGRAPH,te.HEADING],attributes:{[fe.LINE_HEIGHT]:{isRequired:!1,parseHTML:n=>{if(n.matches('[style*="--zw-line-height"]')){const o=n.style.getPropertyValue("--zw-line-height-tablet")||null,a=n.style.getPropertyValue("--zw-line-height-desktop")||null;return{mobile:null,tablet:o,desktop:a}}const e=n.style.lineHeight;if(!e)return null;const t=F(this.options.wrapperRef),r=VM(e,n,t);return r?{desktop:r,tablet:r,mobile:null}:null},renderHTML(n){return n.line_height?Kl({line_height_mobile:n.line_height.mobile,line_height_tablet:n.line_height.tablet,line_height_desktop:n.line_height.desktop}):null}}}}]},addCommands(){return{getLineHeight:P(({commands:n})=>{const e=n.getBlockAttributes(this.name,v0),t=n.getDevice(),r=n.getDefaultLineHeight();return de(()=>F(e)?.[F(t)]??F(r))}),getDefaultLineHeight:P(({commands:n})=>{const e=n.getDevice(),t=n.getPreset();return de(()=>F(t)[F(e)].line_height)}),applyLineHeight:P(({commands:n},e)=>{const t=F(n.getDevice());n.setBlockAttributes(this.name,{[t]:e},v0)})}}}),wO=Nn.create({name:"listItem",addOptions(){return{HTMLAttributes:{},bulletListTypeName:"bulletList",orderedListTypeName:"orderedList"}},content:"paragraph block*",defining:!0,parseHTML(){return[{tag:"li"}]},renderHTML({HTMLAttributes:n}){return["li",ki(this.options.HTMLAttributes,n),0]},addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem(this.name),Tab:()=>this.editor.commands.sinkListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)}}}),_O=wO.extend({name:te.LIST_ITEM,marks:Zt.SETTINGS,addCommands(){const n=({selection:e})=>e.$cursor.before(e.$cursor.depth-1);return{listItemNewline:P(({commands:e,tr:t})=>{const r=t.doc.nodeAt(n(t));if(!t.selection.$cursor.node().textContent)return!1;e.splitListItem(this.name);const o=n(t);for(const a of r.marks)t.addNodeMark(o,yf(a));return!0})}},addOptions:()=>({HTMLAttributes:{class:"zw-style"}}),addKeyboardShortcuts:()=>({Enter:n=>{const{state:e,commands:t}=n.editor;if(e.selection.$cursor?.path.some(i=>i.type?.name===te.LIST))return t.listItemNewline()}})}),kO=Nn.create({name:te.LIST,content:`${te.LIST_ITEM}+`,group:"block list",marks:Zt.SETTINGS,addExtensions:()=>[_O],addOptions:()=>({baseClass:"",presetClass:""}),addAttributes:()=>({bullet:{default:{type:Bt.DISC}}}),parseHTML(){const n={a:Bt.ROMAN,i:Bt.LATIN,1:Bt.DECIMAL},e=t=>{for(const r of Bt.values){const i=`.${F(this.options.baseClass)}${r}`;if(t.matches(i)||n[t.type.toLowerCase()]===r)return r}};return[{tag:"ol",getAttrs:t=>({bullet:{type:e(t)||Bt.DECIMAL}})},{tag:"ul",getAttrs:t=>({bullet:{type:e(t)||Bt.DISC}})}]},renderHTML({HTMLAttributes:n}){const e=[F(this.options.baseClass)+n.bullet.type,F(this.options.presetClass)];return[Bt.ordered.includes(n.bullet.type)?"ol":"ul",{class:e.join(" ")},0]},addCommands(){return{getListType:P(({commands:n})=>{const e=n.getBlockAttributes("bullet",{type:null});return de(()=>F(e).type??null)}),applyList:P(({commands:n,chain:e},t)=>{if(F(n.getListType())===t){n.removeList();return}return e().applyDefaultPreset().toggleList(te.LIST,te.LIST_ITEM).setBlockAttributes("bullet",{type:t}).command(({commands:i,tr:o})=>i._bubbleListItemMarks(o)).run()}),_bubbleListItemMarks:P((n,e)=>{const{doc:t,selection:r}=e,i=r.$from.start(),o=r.$to.end();function a(c,f){if(fe.inlineMarks.includes(f.type)||f.type.isInSet(c.marks))return!1;for(const h of c.content.content)if(h.childCount&&(!h.marks||!f.isInSet(h.marks)))return!1;return!0}t.nodesBetween(i,o,(c,f)=>{if(c.type.name===te.LIST)return;if(c.type.name!==te.LIST_ITEM)return!1;const h=[];return c.forEach(m=>{for(const p of m.marks){if(p.isInSet(h)){e.removeNodeMark(f+1,p);continue}a(c,p)&&(e.removeNodeMark(f+1,p),e.addNodeMark(f,yf(p)),h.push(p))}}),!1})}),removeList:P(({commands:n,state:e})=>{const{tr:t,doc:r,selection:i}=e,o=i.$from.start(),a=i.$to.end();r.nodesBetween(o,a,(c,f,h)=>{if([te.LIST,te.LIST_ITEM].includes(c.type.name))return;if(h.type.name!==te.LIST_ITEM)return!1;const m=h.marks.filter(function(p){return!p.type.isInSet(c.marks)});for(const p of m)t.addNodeMark(f,yf(p));return!1}),n.liftListItem(te.LIST_ITEM)})}},addInputRules(){const n=(e,t)=>VA({find:t,type:this.type,getAttributes:{bullet:{type:e}},joinPredicate:(r,{attrs:i})=>i.bullet.type===e});return[n(Bt.DISC,/^\s*([-+*])\s$/),n(Bt.DECIMAL,/^(\d+)\.\s$/),n(Bt.LATIN,/^([ivx]{1,3})\.\s$/i),n(Bt.ROMAN,/^([a-z])\.\s$/i)]}});function EO(n){return new _t({key:new Yt("autolink"),appendTransaction:(e,t,r)=>{const i=e.some(h=>h.docChanged)&&!t.doc.eq(r.doc),o=e.some(h=>h.getMeta("preventAutolink"));if(!i||o)return;const{tr:a}=r,c=dA(t.doc,[...e]);if(xA(c).forEach(({newRange:h})=>{const m=pA(r.doc,h,S=>S.isTextblock);let p,y;if(m.length>1?(p=m[0],y=r.doc.textBetween(p.pos,p.pos+p.node.nodeSize,void 0," ")):m.length&&r.doc.textBetween(h.from,h.to," "," ").endsWith(" ")&&(p=m[0],y=r.doc.textBetween(p.pos,h.to,void 0," ")),p&&y){const S=y.split(" ").filter(A=>A!=="");if(S.length<=0)return!1;const _=S[S.length-1],C=p.pos+y.lastIndexOf(_);if(!_)return!1;uf(_).filter(A=>A.isLink).map(A=>({...A,from:C+A.start+1,to:C+A.end+1})).filter(A=>r.schema.marks.code?!r.doc.rangeHasMark(A.from,A.to,r.schema.marks.code):!0).filter(A=>n.validate?n.validate(A.value):!0).forEach(A=>{Rg(A.from,A.to,r.doc).some(R=>R.mark.type===n.type)||a.addMark(A.from,A.to,n.type.create({href:A.href}))})}}),!!a.steps.length)return a}})}function TO(n){return new _t({key:new Yt("handleClickLink"),props:{handleClick:(e,t,r)=>{var i,o;if(r.button!==0||r.target.nodeName!=="A")return!1;const c=bA(e.state,n.type.name),f=r.target,h=(i=f?.href)!==null&&i!==void 0?i:c.href,m=(o=f?.target)!==null&&o!==void 0?o:c.target;return f&&h?(e.editable&&window.open(h,m),!0):!1}}})}function CO(n){return new _t({key:new Yt("handlePasteLink"),props:{handlePaste:(e,t,r)=>{var i;const{state:o}=e,{selection:a}=o,{empty:c}=a;if(c)return!1;let f="";r.content.forEach(_=>{f+=_.textContent});const h=uf(f).find(_=>_.isLink&&_.value===f);if(!f||!h)return!1;const m=(i=t.clipboardData)===null||i===void 0?void 0:i.getData("text/html"),p=/href="([^"]*)"/,y=m?.match(p),S=y?y[1]:h.href;return n.editor.commands.setMark(n.type,{href:S}),!0}}})}const AO=Et.create({name:"link",priority:1e3,keepOnSplit:!1,onCreate(){this.options.protocols.forEach(n=>{if(typeof n=="string"){r0(n);return}r0(n.scheme,n.optionalSlashes)})},onDestroy(){SM()},inclusive(){return this.options.autolink},addOptions(){return{openOnClick:!0,linkOnPaste:!0,autolink:!0,protocols:[],HTMLAttributes:{target:"_blank",rel:"noopener noreferrer nofollow",class:null},validate:void 0}},addAttributes(){return{href:{default:null},target:{default:this.options.HTMLAttributes.target},rel:{default:this.options.HTMLAttributes.rel},class:{default:this.options.HTMLAttributes.class}}},parseHTML(){return[{tag:'a[href]:not([href *= "javascript:" i])'}]},renderHTML({HTMLAttributes:n}){var e;return!((e=n.href)===null||e===void 0)&&e.startsWith("javascript:")?["a",ki(this.options.HTMLAttributes,{...n,href:""}),0]:["a",ki(this.options.HTMLAttributes,n),0]},addCommands(){return{setLink:n=>({chain:e})=>e().setMark(this.name,n).setMeta("preventAutolink",!0).run(),toggleLink:n=>({chain:e})=>e().toggleMark(this.name,n,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run(),unsetLink:()=>({chain:n})=>n().unsetMark(this.name,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run()}},addPasteRules(){return[KA({find:n=>uf(n).filter(e=>this.options.validate?this.options.validate(e.value):!0).filter(e=>e.isLink).map(e=>({text:e.value,index:e.start,data:e})),type:this.type,getAttributes:(n,e)=>{var t,r;const i=(t=e?.clipboardData)===null||t===void 0?void 0:t.getData("text/html"),o=/href="([^"]*)"/,a=i?.match(o);return a?{href:a[1]}:{href:(r=n.data)===null||r===void 0?void 0:r.href}}})]},addProseMirrorPlugins(){const n=[];return this.options.autolink&&n.push(EO({type:this.type,validate:this.options.validate})),this.options.openOnClick&&n.push(TO({type:this.type})),this.options.linkOnPaste&&n.push(CO({editor:this.editor,type:this.type})),n}}),MO=AO.extend({name:fe.LINK,addOptions(){return{...this.parent?.(),openOnClick:!1,linkOnPaste:!1}},addAttributes(){return{href:{default:null,parseHTML:n=>{const e=n.getAttribute("href");return e.startsWith("#")?parseFloat(n.getAttribute("href").replace("#","")):e}},target:{default:Ug.SELF,parseHTML:n=>n.getAttribute("target")||Ug.SELF},destination:{default:Cs.URL,parseHTML:n=>{const e=n.getAttribute("href");if(!e.startsWith("#"))return Cs.URL;const t=e.replace("#","");return F(this.options.pageBlocks).find(o=>o.id===parseInt(t))?Cs.BLOCK:Cs.URL}}}},addCommands(){const{unsetLink:n}=this.parent();return{removeLink:n,applyLink:P(({commands:e,chain:t},r)=>(e.setMeta("preventAutolink",!0),e.getSelectedText()?t().applyMark(this.name,r).expandSelectionToLink().command(({tr:i})=>(r.text&&i.insertText(r.text,i.selection.from,i.selection.to),!0)).run():e.insertContent(x0.text(r.text,[x0.mark(fe.LINK,r)])))),expandSelectionToLink:P(({commands:e})=>{e.expandSelection(({node:t})=>this.type.isInSet(t.marks))}),isLink:P(({commands:e})=>e.hasMark(this.name)),getLinkPreset:P(()=>de(()=>F(this.options.preset)))}},addProseMirrorPlugins(){return[...this.parent(),_M.create(this.editor)]},renderHTML({HTMLAttributes:n}){const e=n.destination===Cs.BLOCK?`#${n.href}`:n.href,t=F(this.options.basePresetClass)+F(this.options.preset).id;return["a",{href:e,target:n.target,class:`${t} zw-style`},0]}}),OO=Et.create({name:fe.SUPERSCRIPT,addCommands(){return{applySuperscript:P(({commands:n})=>{n.setMark(this.name)}),removeSuperscript:P(({commands:n})=>{n.unsetMark(this.name)}),toggleSuperscript:P(({commands:n})=>{F(n.isSuperscript())?n.removeSuperscript():n.applySuperscript()}),isSuperscript:P(({commands:n})=>{const e=n.getMark(this.name);return de(()=>!!F(e))})}},parseHTML(){return[{tag:"sup"},{style:"vertical-align",getAttrs:n=>n!=="super"?!1:null}]},renderHTML(){return["sup",{class:"zw-superscript"},0]}}),IO=Re.create({name:fe.MARGIN,addGlobalAttributes:()=>[{types:[te.PARAGRAPH,te.HEADING],attributes:{[fe.MARGIN]:{isRequired:!1,parseHTML(n){const{margin:e,marginTop:t,marginRight:r,marginBottom:i,marginLeft:o}=n.style;return[e,t,r,i,o].some(f=>!!f)?e?{value:e}:{value:[t||0,r||0,i||0,o||0].join(" ")}:null},renderHTML(n){return n.margin?Kl({margin:n.margin.value}):null}}}}]});function NO(n){const e=r=>n.presetsRef.value.find(i=>i.id===r),t=Lc({default:null,link:null});return Ik(n.presetsRef,()=>{t.default=e(n.defaultPresetId),t.link=e(n.linkPresetId)},{immediate:!0,deep:!0}),cO().concat([fO.configure({presets:n.presetsRef,defaultId:n.defaultPresetId,styleRenderer:new PO({baseClass:n.basePresetClass,makeVariable:n.makePresetVariable,linkPresetId:n.linkPresetId})}),kO.configure({baseClass:n.baseListClass,presetClass:n.basePresetClass+n.defaultPresetId}),gO.configure({device:n.deviceRef}),hO.configure({minSize:n.minFontSize,maxSize:n.maxFontSize,wrapperRef:n.wrapperRef}),uO.configure({fonts:n.fonts,defaultPreset:ui(t,"default"),defaultFont:n.defaultFont}),dO,pO,mO,yO,bO,vO,OO,SO,xO.configure({wrapperRef:n.wrapperRef}),MO.configure({preset:ui(t,"link"),basePresetClass:n.basePresetClass,pageBlocks:n.pageBlocksRef}),IO])}class RO{_domParser=new DOMParser;types=window;parse(e){return this._domParser.parseFromString(e,"text/html")}}class S0{content;constructor({content:e}){this.content=e}normalize(){throw new Error("Implement abstract method")}}class hn extends S0{static BLOCK_NODE_NAMES=["P","H1","H2","H3","H4"];static ROOT_NODE_NAMES=hn.BLOCK_NODE_NAMES.concat("UL","OL");static BLOCK_STYLES=["text-align","line-height","margin","margin-top","margin-bottom","margin-left","margin-right"];_parser;constructor({content:e,parser:t}){super({content:e}),this._parser=t,this.dom=null}normalize(){return this.normalizeHTML(),this.normalizedHTML}normalizeHTML(){this.dom=this._parser.parse(this.content.replace(/(\r)?\n/g,"")),this._removeComments(),this._normalizeRootTags(),this._iterateNodes(this._normalizeBreakLines,e=>e.tagName==="BR"),this._iterateNodes(this._removeEmptyNodes,this._isBlockNode),this._iterateNodes(this._normalizeListItems,e=>e.tagName==="LI"),this._normalizeBlockTextDecoration(),this._normalizeBlockBackgroundColor()}get normalizedHTML(){return this.dom.body.innerHTML}get _NodeFilter(){return this._parser.types.NodeFilter}get _Node(){return this._parser.types.Node}_removeComments(){const e=this._createNodeIterator(this._NodeFilter.SHOW_COMMENT);this._runIterator(e,t=>t.remove())}_normalizeRootTags(){const e=Array.from(this.dom.body.childNodes),t=this.dom.createDocumentFragment();let r;for(const i of e){if(this._isRootNode(i)){t.append(i),r=null;continue}r||(r=this.dom.createElement("p"),t.append(r)),r.append(i)}this.dom.body.innerHTML="",this.dom.body.append(t)}_createNodeIterator(e,t){return this.dom.createNodeIterator(this.dom.body,e,t)}_iterateNodes(e,t=()=>!0){const r=o=>o.tagName!=="BODY"&&t.call(this,o),i=this._createNodeIterator(this._NodeFilter.SHOW_ELEMENT,{acceptNode:o=>r(o)?this._NodeFilter.FILTER_ACCEPT:this._NodeFilter.FILTER_REJECT});this._runIterator(i,e)}_runIterator(e,t){let r=e.nextNode();for(;r;)t.call(this,r),r=e.nextNode()}_removeEmptyNodes(e){e.innerHTML.trim()||e.remove()}_normalizeListItems(e){const t=this.dom.createDocumentFragment(),r=Array.from(e.childNodes);let i,o;const a=c=>{this._assignElementProperties(c,e,hn.BLOCK_STYLES),t.append(c)};this._assignElementProperties(e,e.parentElement,hn.BLOCK_STYLES);for(const c of r){if(this._isBlockNode(c)){a(c),i=null,o=c;continue}if(c.tagName==="BR"&&o&&o?.tagName!=="BR"){c.remove(),o=c;continue}if(c.tagName==="BR"){const f=this.dom.createElement("p");f.append(c),a(f),i=null,o=c;continue}i||(i=this.dom.createElement("p"),a(i)),i.append(c),o=c}e.append(t),this._removeStyleProperties(e,hn.BLOCK_STYLES),this._removeStyleProperties(e.parentElement,hn.BLOCK_STYLES),this._assignElementProperties(e,e.parentElement),e.parentElement.lastElementChild===e&&this._removeStyleProperties(e.parentElement)}_isBlockNode(e){return hn.BLOCK_NODE_NAMES.includes(e.tagName)}_isRootNode(e){return hn.ROOT_NODE_NAMES.includes(e.tagName)}_assignElementProperties(e,t,r=Array.from(t.style)){for(const i of r){const o=t.style.getPropertyValue(i);o&&!e.style.getPropertyValue(i)&&e.style.setProperty(i,o)}}_removeStyleProperties(e,t=Array.from(e.style)){for(const r of t)e.style.removeProperty(r);e.style.length===0&&e.removeAttribute("style")}_normalizeBreakLines({parentElement:e}){if(!this._isBlockNode(e)||!e.textContent)return;const t=this.dom.createDocumentFragment(),r=Array.from(e.childNodes),i=e.cloneNode(!0);i.innerHTML="";let o=i.cloneNode();const a=c=>{this._assignElementProperties(c,e,hn.BLOCK_STYLES),t.append(c)};for(const c of r){if(c.tagName==="BR"){a(o),o=i.cloneNode();continue}o.append(c)}t.append(o),e.replaceWith(t)}_normalizeBlockTextDecoration(){const e=this.dom.querySelectorAll('[style*="text-decoration"]:where(p, h1, h2, h3, h4, li)');for(const t of e)this._moveTextDecorationToChildren(t)}_moveTextDecorationToChildren(e){const t=this._parseTextDecoration(e);if(e.style.removeProperty("text-decoration-line"),e.style.removeProperty("text-decoration"),e.style.cssText||e.removeAttribute("style"),!t.none)for(const r of e.childNodes){const i=this._wrapTextNode(e,r),o=this._parseTextDecoration(i),a={underline:o.underline||t.underline,line_through:o.line_through||t.line_through};i.style.removeProperty("text-decoration-line"),i.style.removeProperty("text-decoration"),i.style.textDecoration=Object.entries(a).filter(([,c])=>c).map(([c])=>c.replace("_","-")).join(" ")}}_parseTextDecoration(e){const{textDecoration:t,textDecorationLine:r}=e.style,i=t||r||"";return{none:i.includes("none"),underline:i.includes("underline"),line_through:i.includes("line-through")}}_normalizeBlockBackgroundColor(){const e=this.dom.querySelectorAll('[style*="background-color"]:where(p, h1, h2, h3, h4, li)');for(const t of e)this._moveBackgroundColorToChildren(t)}_moveBackgroundColorToChildren(e){const t=e.style.backgroundColor;e.style.removeProperty("background-color"),e.style.cssText||e.removeAttribute("style");for(const r of e.childNodes){const i=this._wrapTextNode(e,r),o=i.style.backgroundColor||t;i.style.backgroundColor=o}}_wrapTextNode(e,t){if(t.nodeType!==this._Node.TEXT_NODE)return t;const r=this.dom.createElement("span");return r.append(t.cloneNode()),e.replaceChild(r,t),r}}class LO extends S0{normalize(){return this._iterateNodes(this._bubbleMarks),this.content}_iterateNodes(e){this._iterateChildNodes(this.content,e)}_iterateChildNodes(e,t){for(const r of e.content)r.content&&this._iterateChildNodes(r,t),t.call(this,r)}_bubbleMarks(e){if(e.content&&e.type!==te.LIST){for(const t of e.content)if(!this._isLink(t)&&t.marks)for(const r of t.marks.slice()){if(this._includesMark(e,r)){this._removeMark(t,r);continue}this._canBubbleMark(e,r)&&(this._removeMark(t,r),this._addMark(e,r))}}}_canBubbleMark(e,t){if(fe.inlineMarks.includes(t.type)||this._includesMarkType(e,t.type))return!1;for(const r of e.content)if(!(!r.content&&e.type===te.LIST_ITEM)&&(!r.marks||!this._includesMark(r,t)))return!1;return!0}_includesMark(e,t){return e.marks?.some(r=>y0.isEqual(r,t))??!1}_includesMarkType(e,t){return e.marks?.some(r=>r.type===t)??!1}_isLink(e){return e.type===te.TEXT&&this._includesMarkType(e,fe.LINK)}_removeMark(e,t){if(!e.marks)return;const r=this._findMarkIndexByType(e,t.type);r>=0&&e.marks.splice(r,1),e.marks.length||delete e.marks}_addMark(e,t){this._removeMark(e,t),e.marks??=[],e.marks.push(t)}_findMarkIndexByType(e,t){return e.marks?.findIndex(r=>r.type===t)??null}}class Yl{static build(e,t={}){return typeof e=="string"?this._buildHtml(e,t):this._buildJson(e)}static _buildHtml(e,t){return new hn({content:e,parser:t.parser||new RO})}static _buildJson(e){return new LO({content:e})}static normalize(e,t={}){return Yl.build(e,t).normalize()}}class Ni{static window=globalThis.window;static use(e){this.window=e}static get document(){return this.window.document}static get body(){return this.document.body}static get head(){return this.document.head}static getComputedStyle(e){return this.window.getComputedStyle(e)}}class kf{static build({config:e,nodeDomParser:t}){const r=NO({fonts:e.fonts,minFontSize:0,maxFontSize:0,presetsRef:Ho(e.presets),defaultPresetId:e.defaultPresetId,linkPresetId:e.linkPresetId,makePresetVariable:()=>"",basePresetClass:e.basePresetClass,baseListClass:e.baseListClass,deviceRef:Ho(Wu.DESKTOP),pageBlocksRef:Ho([]),wrapperRef:Ni.document.createElement("p")}),i=gA(r);return new kf({schema:i,domParser:Yc.fromSchema(i),nodeDomParser:t})}_schema;_domParser;_nodeDomParser;constructor({schema:e,domParser:t,nodeDomParser:r}){this._schema=e,this._domParser=t,this._nodeDomParser=r}toJSON(e){const t=Yl.build(e,{parser:this._nodeDomParser});return t.normalizeHTML(),this._domParser.parse(t.dom.body).toJSON()}}class x0{static doc(e){return{type:te.DOCUMENT,content:e}}static list(e,t){return{type:te.LIST,attrs:{bullet:{type:e}},content:t.map(r=>r.type===te.LIST_ITEM?r:this.listItem([].concat(r)))}}static listItem(...e){const{attrs:t,content:r,marks:i}=this._normalizeTextBlockArgs(e);return{type:te.LIST_ITEM,...t?{attrs:t}:{},...i?{marks:i}:{},content:[].concat(r).map(o=>typeof o=="string"?this.paragraph(o):o)}}static heading(e,...t){const r=this._textBlock(t,this.text);return r.attrs??={},r.attrs.level=e,{type:te.HEADING,...r}}static paragraph(...e){return{type:te.PARAGRAPH,...this._textBlock(e,this.text)}}static _textBlock(e){const{attrs:t,content:r,marks:i}=this._normalizeTextBlockArgs(e);return{content:typeof r=="string"?[this.text(r)]:r,...t?{attrs:t}:{},...i?{marks:i}:{}}}static _normalizeTextBlockArgs(e){return e.length===1?{attrs:null,marks:null,content:e[0]}:e.length===2?{attrs:e[0],marks:null,content:e[1]}:{attrs:e[0],marks:e[1],content:e[2]}}static text(e,t){return{type:te.TEXT,...t?{marks:t}:{},text:e}}static link(e,t,r=[]){return this.text(e,[this.mark(fe.LINK,t),...r])}static mark(e,t){return{type:e,attrs:t}}static populateAllDevices(e){return{mobile:e,tablet:e,desktop:e}}}class PO{_baseClass;_makeVariable;_linkPresetId;constructor({baseClass:e,makeVariable:t,linkPresetId:r}){this._baseClass=e,this._makeVariable=t,this._linkPresetId=r}inject(e,t){let r=e.querySelector("[data-zw-styles]");r||(r=Ni.document.createElement("style"),r.dataset.zwStyles="",r.innerHTML=this.render(t),e.append(r))}render(e){let t="";for(const r of e){const i=r.id===this._linkPresetId,o=this.makePresetCssClass(r);t+=` ${o} {`;for(const a of Wu.values)for(const c of Object.keys(r[a])){const f=this._makeVariable({device:a,preset:r,property:c}),h=this._makeInternalVariableName(c,a);if(t+=`${h}: var(${f}, inherit);`,i&&!fe.attributes.includes(c)){const m=h.replace("preset-","");t+=`${m}: var(${h});`}}t+="}"}return t}_makeInternalVariableName(e,t){const r=e==="color"?"font-color":e.replace(/_/i,"-"),i=t===Wu.COMMON?"":`-${t}`;return`--zw-preset-${r}${i}`}makePresetHtmlClass(e){return this._baseClass+e.id}makePresetCssClass(e){return this.makePresetHtmlClass(e).split(" ").map(t=>`.${t}`).join("")}}class Ef{static _instance;static get instance(){return this._instance??=new Ef,this._instance}static query(e,t){return this.instance.query(e,t)}query(e,t){let r=null;return e.descendants(i=>{if(r)return!1;if(this.matchNode(i,t))return r=i,!1}),r?t.getMark?this.getMark(r,t.getMark):r:null}matchNode(e,t){return!(t.typeName&&t.typeName!==e.type.name||t.mark&&!this.getMark(e,t.mark))}getMark(e,t){return e.marks.find(r=>this.matchMark(r,t))||null}matchMark(e,t){return e.type.name===t.typeName}}class DO{static createWindow(){return new rp.JSDOM().window}types;parse(e){const{window:t}=new rp.JSDOM(e);return this.types=t,t.document}}exports.ContentSerializer=kf,exports.ContextWindow=Ni,exports.NodeDomParser=DO;