@zipify/wysiwyg 4.8.0-beta.0 → 4.8.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 (3) hide show
  1. package/dist/cli.js +24 -24
  2. package/dist/node.js +18 -18
  3. package/package.json +2 -2
package/dist/node.js CHANGED
@@ -1,27 +1,27 @@
1
- "use strict";var Dp=require("jsdom");function Rx(n){const e=Object.create(null);for(const t of n.split(","))e[t]=1;return t=>t in e}const Wt=process.env.NODE_ENV!=="production"?Object.freeze({}):{};process.env.NODE_ENV!=="production"&&Object.freeze([]);const Pr=()=>{},Lx=n=>n.charCodeAt(0)===111&&n.charCodeAt(1)===110&&(n.charCodeAt(2)>122||n.charCodeAt(2)<97),Ct=Object.assign,Px=Object.prototype.hasOwnProperty,Re=(n,e)=>Px.call(n,e),Ee=Array.isArray,vi=n=>Vo(n)==="[object Map]",Dx=n=>Vo(n)==="[object Set]",Le=n=>typeof n=="function",on=n=>typeof n=="string",vs=n=>typeof n=="symbol",dt=n=>n!==null&&typeof n=="object",zx=n=>(dt(n)||Le(n))&&Le(n.then)&&Le(n.catch),Bx=Object.prototype.toString,Vo=n=>Bx.call(n),zp=n=>Vo(n).slice(8,-1),Fx=n=>Vo(n)==="[object Object]",Wu=n=>on(n)&&n!=="NaN"&&n[0]!=="-"&&""+parseInt(n,10)===n,$x=n=>{const e=Object.create(null);return t=>e[t]||(e[t]=n(t))},Hx=$x(n=>n.charAt(0).toUpperCase()+n.slice(1)),lr=(n,e)=>!Object.is(n,e),Wx=(n,e,t,r=!1)=>{Object.defineProperty(n,e,{configurable:!0,enumerable:!1,writable:r,value:t})};let Bp;const Ko=()=>Bp||(Bp=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});function Uu(n){if(Ee(n)){const e={};for(let t=0;t<n.length;t++){const r=n[t],i=on(r)?Gx(r):Uu(r);if(i)for(const o in i)e[o]=i[o]}return e}else if(on(n)||dt(n))return n}const Ux=/;(?![^(]*\))/g,Vx=/:([^]+)/,Kx=/\/\*[^]*?\*\//g;function Gx(n){const e={};return n.replace(Kx,"").split(Ux).forEach(t=>{if(t){const r=t.split(Vx);r.length>1&&(e[r[0].trim()]=r[1].trim())}}),e}function Vu(n){let e="";if(on(n))e=n;else if(Ee(n))for(let t=0;t<n.length;t++){const r=Vu(n[t]);r&&(e+=r+" ")}else if(dt(n))for(const t in n)n[t]&&(e+=t+" ");return e.trim()}function Bn(n,...e){console.warn(`[Vue warn] ${n}`,...e)}let be;const Ku=new WeakSet;class qx{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,Ku.has(this)&&(Ku.delete(this),this.trigger()))}notify(){this.flags&2&&!(this.flags&32)||this.flags&8||$p(this)}run(){if(!(this.flags&1))return this.fn();this.flags|=2,Kp(this),Hp(this);const e=be,t=ln;be=this,ln=!0;try{return this.fn()}finally{process.env.NODE_ENV!=="production"&&be!==this&&Bn("Active effect was not restored correctly - this is likely a Vue internal bug."),Wp(this),be=e,ln=t,this.flags&=-3}}stop(){if(this.flags&1){for(let e=this.deps;e;e=e.nextDep)ju(e);this.deps=this.depsTail=void 0,Kp(this),this.onStop&&this.onStop(),this.flags&=-2}}trigger(){this.flags&64?Ku.add(this):this.scheduler?this.scheduler():this.runIfDirty()}runIfDirty(){Ju(this)&&this.run()}get dirty(){return Ju(this)}}let Fp=0,Ss,ws;function $p(n,e=!1){if(n.flags|=8,e){n.next=ws,ws=n;return}n.next=Ss,Ss=n}function Gu(){Fp++}function qu(){if(--Fp>0)return;if(ws){let e=ws;for(ws=void 0;e;){const t=e.next;e.next=void 0,e.flags&=-9,e=t}}let n;for(;Ss;){let e=Ss;for(Ss=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 Hp(n){for(let e=n.deps;e;e=e.nextDep)e.version=-1,e.prevActiveLink=e.dep.activeLink,e.dep.activeLink=e}function Wp(n){let e,t=n.depsTail,r=t;for(;r;){const i=r.prevDep;r.version===-1?(r===t&&(t=i),ju(r),Jx(r)):e=r,r.dep.activeLink=r.prevActiveLink,r.prevActiveLink=void 0,r=i}n.deps=e,n.depsTail=t}function Ju(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===xs))return;n.globalVersion=xs;const e=n.dep;if(n.flags|=2,e.version>0&&!n.isSSR&&n.deps&&!Ju(n)){n.flags&=-3;return}const t=be,r=ln;be=n,ln=!0;try{Hp(n);const i=n.fn(n._value);(e.version===0||lr(i,n._value))&&(n._value=i,e.version++)}catch(i){throw e.version++,i}finally{be=t,ln=r,Wp(n),n.flags&=-3}}function ju(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)ju(o,!0)}!e&&!--t.sc&&t.map&&t.map.delete(t.key)}function Jx(n){const{prevDep:e,nextDep:t}=n;e&&(e.nextDep=t,n.prevDep=void 0),t&&(t.prevDep=e,n.nextDep=void 0)}let ln=!0;const Vp=[];function Go(){Vp.push(ln),ln=!1}function qo(){const n=Vp.pop();ln=n===void 0?!0:n}function Kp(n){const{cleanup:e}=n;if(n.cleanup=void 0,e){const t=be;be=void 0;try{e()}finally{be=t}}}let xs=0,jx=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 Yu{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(!be||!ln||be===this.computed)return;let t=this.activeLink;if(t===void 0||t.sub!==be)t=this.activeLink=new jx(be,this),be.deps?(t.prevDep=be.depsTail,be.depsTail.nextDep=t,be.depsTail=t):be.deps=be.depsTail=t,Gp(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=be.depsTail,t.nextDep=void 0,be.depsTail.nextDep=t,be.depsTail=t,be.deps===t&&(be.deps=r)}return process.env.NODE_ENV!=="production"&&be.onTrack&&be.onTrack(Ct({effect:be},e)),t}trigger(e){this.version++,xs++,this.notify(e)}notify(e){Gu();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(Ct({effect:t.sub},e));for(let t=this.subs;t;t=t.prevSub)t.sub.notify()&&t.sub.dep.notify()}finally{qu()}}}function Gp(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)Gp(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 Jo=new WeakMap,Dr=Symbol(process.env.NODE_ENV!=="production"?"Object iterate":""),Xu=Symbol(process.env.NODE_ENV!=="production"?"Map keys iterate":""),_s=Symbol(process.env.NODE_ENV!=="production"?"Array iterate":"");function Ge(n,e,t){if(ln&&be){let r=Jo.get(n);r||Jo.set(n,r=new Map);let i=r.get(t);i||(r.set(t,i=new Yu),i.map=r,i.key=t),process.env.NODE_ENV!=="production"?i.track({target:n,type:e,key:t}):i.track()}}function ar(n,e,t,r,i,o){const a=Jo.get(n);if(!a){xs++;return}const u=f=>{f&&(process.env.NODE_ENV!=="production"?f.trigger({target:n,type:e,key:t,newValue:r,oldValue:i,oldTarget:o}):f.trigger())};if(Gu(),e==="clear")a.forEach(u);else{const f=Ee(n),d=f&&Wu(t);if(f&&t==="length"){const m=Number(r);a.forEach((p,y)=>{(y==="length"||y===_s||!vs(y)&&y>=m)&&u(p)})}else switch((t!==void 0||a.has(void 0))&&u(a.get(t)),d&&u(a.get(_s)),e){case"add":f?d&&u(a.get("length")):(u(a.get(Dr)),vi(n)&&u(a.get(Xu)));break;case"delete":f||(u(a.get(Dr)),vi(n)&&u(a.get(Xu)));break;case"set":vi(n)&&u(a.get(Dr));break}}qu()}function Yx(n,e){const t=Jo.get(n);return t&&t.get(e)}function Si(n){const e=ce(n);return e===n?e:(Ge(e,"iterate",_s),St(n)?e:e.map(ht))}function Zu(n){return Ge(n=ce(n),"iterate",_s),n}const Xx={__proto__:null,[Symbol.iterator](){return Qu(this,Symbol.iterator,ht)},concat(...n){return Si(this).concat(...n.map(e=>Ee(e)?Si(e):e))},entries(){return Qu(this,"entries",n=>(n[1]=ht(n[1]),n))},every(n,e){return Fn(this,"every",n,e,void 0,arguments)},filter(n,e){return Fn(this,"filter",n,e,t=>t.map(ht),arguments)},find(n,e){return Fn(this,"find",n,e,ht,arguments)},findIndex(n,e){return Fn(this,"findIndex",n,e,void 0,arguments)},findLast(n,e){return Fn(this,"findLast",n,e,ht,arguments)},findLastIndex(n,e){return Fn(this,"findLastIndex",n,e,void 0,arguments)},forEach(n,e){return Fn(this,"forEach",n,e,void 0,arguments)},includes(...n){return ec(this,"includes",n)},indexOf(...n){return ec(this,"indexOf",n)},join(n){return Si(this).join(n)},lastIndexOf(...n){return ec(this,"lastIndexOf",n)},map(n,e){return Fn(this,"map",n,e,void 0,arguments)},pop(){return ks(this,"pop")},push(...n){return ks(this,"push",n)},reduce(n,...e){return qp(this,"reduce",n,e)},reduceRight(n,...e){return qp(this,"reduceRight",n,e)},shift(){return ks(this,"shift")},some(n,e){return Fn(this,"some",n,e,void 0,arguments)},splice(...n){return ks(this,"splice",n)},toReversed(){return Si(this).toReversed()},toSorted(n){return Si(this).toSorted(n)},toSpliced(...n){return Si(this).toSpliced(...n)},unshift(...n){return ks(this,"unshift",n)},values(){return Qu(this,"values",ht)}};function Qu(n,e,t){const r=Zu(n),i=r[e]();return r!==n&&!St(n)&&(i._next=i.next,i.next=()=>{const o=i._next();return o.value&&(o.value=t(o.value)),o}),i}const Zx=Array.prototype;function Fn(n,e,t,r,i,o){const a=Zu(n),u=a!==n&&!St(n),f=a[e];if(f!==Zx[e]){const p=f.apply(n,o);return u?ht(p):p}let d=t;a!==n&&(u?d=function(p,y){return t.call(this,ht(p),y,n)}:t.length>2&&(d=function(p,y){return t.call(this,p,y,n)}));const m=f.call(a,d,r);return u&&i?i(m):m}function qp(n,e,t,r){const i=Zu(n);let o=t;return i!==n&&(St(n)?t.length>3&&(o=function(a,u,f){return t.call(this,a,u,f,n)}):o=function(a,u,f){return t.call(this,a,ht(u),f,n)}),i[e](o,...r)}function ec(n,e,t){const r=ce(n);Ge(r,"iterate",_s);const i=r[e](...t);return(i===-1||i===!1)&&Zo(t[0])?(t[0]=ce(t[0]),r[e](...t)):i}function ks(n,e,t=[]){Go(),Gu();const r=ce(n)[e].apply(n,t);return qu(),qo(),r}const Qx=Rx("__proto__,__v_isRef,__isVue"),Jp=new Set(Object.getOwnPropertyNames(Symbol).filter(n=>n!=="arguments"&&n!=="caller").map(n=>Symbol[n]).filter(vs));function e_(n){vs(n)||(n=String(n));const e=ce(this);return Ge(e,"has",n),e.hasOwnProperty(n)}class jp{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?em:Qp:o?c_:Zp).get(e)||Object.getPrototypeOf(e)===Object.getPrototypeOf(r)?e:void 0;const a=Ee(e);if(!i){let f;if(a&&(f=Xx[t]))return f;if(t==="hasOwnProperty")return e_}const u=Reflect.get(e,t,et(e)?e:r);return(vs(t)?Jp.has(t):Qx(t))||(i||Ge(e,"get",t),o)?u:et(u)?a&&Wu(t)?u:u.value:dt(u)?i?tm(u):rc(u):u}}class t_ extends jp{constructor(e=!1){super(!1,e)}set(e,t,r,i){let o=e[t];if(!this._isShallow){const f=$n(o);if(!St(r)&&!$n(r)&&(o=ce(o),r=ce(r)),!Ee(e)&&et(o)&&!et(r))return f?!1:(o.value=r,!0)}const a=Ee(e)&&Wu(t)?Number(t)<e.length:Re(e,t),u=Reflect.set(e,t,r,et(e)?e:i);return e===ce(i)&&(a?lr(r,o)&&ar(e,"set",t,r,o):ar(e,"add",t,r)),u}deleteProperty(e,t){const r=Re(e,t),i=e[t],o=Reflect.deleteProperty(e,t);return o&&r&&ar(e,"delete",t,void 0,i),o}has(e,t){const r=Reflect.has(e,t);return(!vs(t)||!Jp.has(t))&&Ge(e,"has",t),r}ownKeys(e){return Ge(e,"iterate",Ee(e)?"length":Dr),Reflect.ownKeys(e)}}class Yp extends jp{constructor(e=!1){super(!0,e)}set(e,t){return process.env.NODE_ENV!=="production"&&Bn(`Set operation on key "${String(t)}" failed: target is readonly.`,e),!0}deleteProperty(e,t){return process.env.NODE_ENV!=="production"&&Bn(`Delete operation on key "${String(t)}" failed: target is readonly.`,e),!0}}const n_=new t_,r_=new Yp,i_=new Yp(!0),tc=n=>n,jo=n=>Reflect.getPrototypeOf(n);function s_(n,e,t){return function(...r){const i=this.__v_raw,o=ce(i),a=vi(o),u=n==="entries"||n===Symbol.iterator&&a,f=n==="keys"&&a,d=i[n](...r),m=t?tc:e?sc:ht;return!e&&Ge(o,"iterate",f?Xu:Dr),{next(){const{value:p,done:y}=d.next();return y?{value:p,done:y}:{value:u?[m(p[0]),m(p[1])]:m(p),done:y}},[Symbol.iterator](){return this}}}}function Yo(n){return function(...e){if(process.env.NODE_ENV!=="production"){const t=e[0]?`on key "${e[0]}" `:"";Bn(`${Hx(n)} operation ${t}failed: target is readonly.`,ce(this))}return n==="delete"?!1:n==="clear"?void 0:this}}function o_(n,e){const t={get(i){const o=this.__v_raw,a=ce(o),u=ce(i);n||(lr(i,u)&&Ge(a,"get",i),Ge(a,"get",u));const{has:f}=jo(a),d=e?tc:n?sc:ht;if(f.call(a,i))return d(o.get(i));if(f.call(a,u))return d(o.get(u));o!==a&&o.get(i)},get size(){const i=this.__v_raw;return!n&&Ge(ce(i),"iterate",Dr),Reflect.get(i,"size",i)},has(i){const o=this.__v_raw,a=ce(o),u=ce(i);return n||(lr(i,u)&&Ge(a,"has",i),Ge(a,"has",u)),i===u?o.has(i):o.has(i)||o.has(u)},forEach(i,o){const a=this,u=a.__v_raw,f=ce(u),d=e?tc:n?sc:ht;return!n&&Ge(f,"iterate",Dr),u.forEach((m,p)=>i.call(o,d(m),d(p),a))}};return Ct(t,n?{add:Yo("add"),set:Yo("set"),delete:Yo("delete"),clear:Yo("clear")}:{add(i){!e&&!St(i)&&!$n(i)&&(i=ce(i));const o=ce(this);return jo(o).has.call(o,i)||(o.add(i),ar(o,"add",i,i)),this},set(i,o){!e&&!St(o)&&!$n(o)&&(o=ce(o));const a=ce(this),{has:u,get:f}=jo(a);let d=u.call(a,i);d?process.env.NODE_ENV!=="production"&&Xp(a,u,i):(i=ce(i),d=u.call(a,i));const m=f.call(a,i);return a.set(i,o),d?lr(o,m)&&ar(a,"set",i,o,m):ar(a,"add",i,o),this},delete(i){const o=ce(this),{has:a,get:u}=jo(o);let f=a.call(o,i);f?process.env.NODE_ENV!=="production"&&Xp(o,a,i):(i=ce(i),f=a.call(o,i));const d=u?u.call(o,i):void 0,m=o.delete(i);return f&&ar(o,"delete",i,void 0,d),m},clear(){const i=ce(this),o=i.size!==0,a=process.env.NODE_ENV!=="production"?vi(i)?new Map(i):new Set(i):void 0,u=i.clear();return o&&ar(i,"clear",void 0,void 0,a),u}}),["keys","values","entries",Symbol.iterator].forEach(i=>{t[i]=s_(i,n,e)}),t}function nc(n,e){const t=o_(n,e);return(r,i,o)=>i==="__v_isReactive"?!n:i==="__v_isReadonly"?n:i==="__v_raw"?r:Reflect.get(Re(t,i)&&i in r?t:r,i,o)}const l_={get:nc(!1,!1)},a_={get:nc(!0,!1)},u_={get:nc(!0,!0)};function Xp(n,e,t){const r=ce(t);if(r!==t&&e.call(n,r)){const i=zp(n);Bn(`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 Zp=new WeakMap,c_=new WeakMap,Qp=new WeakMap,em=new WeakMap;function f_(n){switch(n){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function d_(n){return n.__v_skip||!Object.isExtensible(n)?0:f_(zp(n))}function rc(n){return $n(n)?n:ic(n,!1,n_,l_,Zp)}function tm(n){return ic(n,!0,r_,a_,Qp)}function Xo(n){return ic(n,!0,i_,u_,em)}function ic(n,e,t,r,i){if(!dt(n))return process.env.NODE_ENV!=="production"&&Bn(`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=d_(n);if(a===0)return n;const u=new Proxy(n,a===2?r:t);return i.set(n,u),u}function wi(n){return $n(n)?wi(n.__v_raw):!!(n&&n.__v_isReactive)}function $n(n){return!!(n&&n.__v_isReadonly)}function St(n){return!!(n&&n.__v_isShallow)}function Zo(n){return n?!!n.__v_raw:!1}function ce(n){const e=n&&n.__v_raw;return e?ce(e):n}function h_(n){return!Re(n,"__v_skip")&&Object.isExtensible(n)&&Wx(n,"__v_skip",!0),n}const ht=n=>dt(n)?rc(n):n,sc=n=>dt(n)?tm(n):n;function et(n){return n?n.__v_isRef===!0:!1}function Qo(n){return p_(n,!1)}function p_(n,e){return et(n)?n:new m_(n,e)}class m_{constructor(e,t){this.dep=new Yu,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=t?e:ce(e),this._value=t?e:ht(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||St(e)||$n(e);e=r?e:ce(e),lr(e,t)&&(this._rawValue=e,this._value=r?e:ht(e),process.env.NODE_ENV!=="production"?this.dep.trigger({target:this,type:"set",key:"value",newValue:e,oldValue:t}):this.dep.trigger())}}function z(n){return et(n)?n.value:n}const g_={get:(n,e,t)=>e==="__v_raw"?n:z(Reflect.get(n,e,t)),set:(n,e,t,r)=>{const i=n[e];return et(i)&&!et(t)?(i.value=t,!0):Reflect.set(n,e,t,r)}};function y_(n){return wi(n)?n:new Proxy(n,g_)}class b_{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 Yx(ce(this._object),this._key)}}class v_{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 xi(n,e,t){return et(n)?n:Le(n)?new v_(n):dt(n)&&arguments.length>1?S_(n,e,t):Qo(n)}function S_(n,e,t){const r=n[e];return et(r)?r:new b_(n,e,t)}class w_{constructor(e,t,r){this.fn=e,this.setter=t,this._value=void 0,this.dep=new Yu(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=xs-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!t,this.isSSR=r}notify(){if(this.flags|=16,!(this.flags&8)&&be!==this)return $p(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"&&Bn("Write operation failed: computed value is readonly")}}function x_(n,e,t=!1){let r,i;Le(n)?r=n:(r=n.get,i=n.set);const o=new w_(r,i,t);return process.env.NODE_ENV!=="production"&&e&&!t&&(o.onTrack=e.onTrack,o.onTrigger=e.onTrigger),o}const el={},tl=new WeakMap;let zr;function __(n,e=!1,t=zr){if(t){let r=tl.get(t);r||tl.set(t,r=[]),r.push(n)}else process.env.NODE_ENV!=="production"&&!e&&Bn("onWatcherCleanup() was called when there was no active watcher to associate with.")}function k_(n,e,t=Wt){const{immediate:r,deep:i,once:o,scheduler:a,augmentJob:u,call:f}=t,d=H=>{(t.onWarn||Bn)("Invalid watch source: ",H,"A watch source can only be a getter/effect function, a ref, a reactive object, or an array of these types.")},m=H=>i?H:St(H)||i===!1||i===0?ur(H,1):ur(H);let p,y,S,w,M=!1,T=!1;if(et(n)?(y=()=>n.value,M=St(n)):wi(n)?(y=()=>m(n),M=!0):Ee(n)?(T=!0,M=n.some(H=>wi(H)||St(H)),y=()=>n.map(H=>{if(et(H))return H.value;if(wi(H))return m(H);if(Le(H))return f?f(H,2):H();process.env.NODE_ENV!=="production"&&d(H)})):Le(n)?e?y=f?()=>f(n,2):n:y=()=>{if(S){Go();try{S()}finally{qo()}}const H=zr;zr=p;try{return f?f(n,3,[w]):n(w)}finally{zr=H}}:(y=Pr,process.env.NODE_ENV!=="production"&&d(n)),e&&i){const H=y,X=i===!0?1/0:i;y=()=>ur(H(),X)}const O=()=>{p.stop()};if(o&&e){const H=e;e=(...X)=>{H(...X),O()}}let F=T?new Array(n.length).fill(el):el;const B=H=>{if(!(!(p.flags&1)||!p.dirty&&!H))if(e){const X=p.run();if(i||M||(T?X.some((q,ie)=>lr(q,F[ie])):lr(X,F))){S&&S();const q=zr;zr=p;try{const ie=[X,F===el?void 0:T&&F[0]===el?[]:F,w];f?f(e,3,ie):e(...ie),F=X}finally{zr=q}}}else p.run()};return u&&u(B),p=new qx(y),p.scheduler=a?()=>a(B,!1):B,w=H=>__(H,!1,p),S=p.onStop=()=>{const H=tl.get(p);if(H){if(f)f(H,4);else for(const X of H)X();tl.delete(p)}},process.env.NODE_ENV!=="production"&&(p.onTrack=t.onTrack,p.onTrigger=t.onTrigger),e?r?B(!0):F=p.run():a?a(B.bind(null,!0),!0):p.run(),O.pause=p.pause.bind(p),O.resume=p.resume.bind(p),O.stop=O,O}function ur(n,e=1/0,t){if(e<=0||!dt(n)||n.__v_skip||(t=t||new Set,t.has(n)))return n;if(t.add(n),e--,et(n))ur(n.value,e,t);else if(Ee(n))for(let r=0;r<n.length;r++)ur(n[r],e,t);else if(Dx(n)||vi(n))n.forEach(r=>{ur(r,e,t)});else if(Fx(n)){for(const r in n)ur(n[r],e,t);for(const r of Object.getOwnPropertySymbols(n))Object.prototype.propertyIsEnumerable.call(n,r)&&ur(n[r],e,t)}return n}const Br=[];function E_(n){Br.push(n)}function M_(){Br.pop()}let oc=!1;function Ce(n,...e){if(oc)return;oc=!0,Go();const t=Br.length?Br[Br.length-1].component:null,r=t&&t.appContext.config.warnHandler,i=T_();if(r)nl(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 <${km(t,o.type)}>`).join(`
1
+ "use strict";var Dp=require("jsdom");function Rx(n){const e=Object.create(null);for(const t of n.split(","))e[t]=1;return t=>t in e}const Wt=process.env.NODE_ENV!=="production"?Object.freeze({}):{};process.env.NODE_ENV!=="production"&&Object.freeze([]);const Pr=()=>{},Lx=n=>n.charCodeAt(0)===111&&n.charCodeAt(1)===110&&(n.charCodeAt(2)>122||n.charCodeAt(2)<97),Ct=Object.assign,Px=Object.prototype.hasOwnProperty,Re=(n,e)=>Px.call(n,e),ke=Array.isArray,vi=n=>Vo(n)==="[object Map]",Dx=n=>Vo(n)==="[object Set]",Le=n=>typeof n=="function",on=n=>typeof n=="string",vs=n=>typeof n=="symbol",ht=n=>n!==null&&typeof n=="object",zx=n=>(ht(n)||Le(n))&&Le(n.then)&&Le(n.catch),Bx=Object.prototype.toString,Vo=n=>Bx.call(n),zp=n=>Vo(n).slice(8,-1),Fx=n=>Vo(n)==="[object Object]",Wu=n=>on(n)&&n!=="NaN"&&n[0]!=="-"&&""+parseInt(n,10)===n,$x=n=>{const e=Object.create(null);return t=>e[t]||(e[t]=n(t))},Hx=$x(n=>n.charAt(0).toUpperCase()+n.slice(1)),lr=(n,e)=>!Object.is(n,e),Wx=(n,e,t,r=!1)=>{Object.defineProperty(n,e,{configurable:!0,enumerable:!1,writable:r,value:t})};let Bp;const Ko=()=>Bp||(Bp=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});function Uu(n){if(ke(n)){const e={};for(let t=0;t<n.length;t++){const r=n[t],i=on(r)?Gx(r):Uu(r);if(i)for(const o in i)e[o]=i[o]}return e}else if(on(n)||ht(n))return n}const Ux=/;(?![^(]*\))/g,Vx=/:([^]+)/,Kx=/\/\*[^]*?\*\//g;function Gx(n){const e={};return n.replace(Kx,"").split(Ux).forEach(t=>{if(t){const r=t.split(Vx);r.length>1&&(e[r[0].trim()]=r[1].trim())}}),e}function Vu(n){let e="";if(on(n))e=n;else if(ke(n))for(let t=0;t<n.length;t++){const r=Vu(n[t]);r&&(e+=r+" ")}else if(ht(n))for(const t in n)n[t]&&(e+=t+" ");return e.trim()}function Bn(n,...e){console.warn(`[Vue warn] ${n}`,...e)}let be;const Ku=new WeakSet;class qx{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,Ku.has(this)&&(Ku.delete(this),this.trigger()))}notify(){this.flags&2&&!(this.flags&32)||this.flags&8||$p(this)}run(){if(!(this.flags&1))return this.fn();this.flags|=2,Kp(this),Hp(this);const e=be,t=ln;be=this,ln=!0;try{return this.fn()}finally{process.env.NODE_ENV!=="production"&&be!==this&&Bn("Active effect was not restored correctly - this is likely a Vue internal bug."),Wp(this),be=e,ln=t,this.flags&=-3}}stop(){if(this.flags&1){for(let e=this.deps;e;e=e.nextDep)ju(e);this.deps=this.depsTail=void 0,Kp(this),this.onStop&&this.onStop(),this.flags&=-2}}trigger(){this.flags&64?Ku.add(this):this.scheduler?this.scheduler():this.runIfDirty()}runIfDirty(){Ju(this)&&this.run()}get dirty(){return Ju(this)}}let Fp=0,Ss,ws;function $p(n,e=!1){if(n.flags|=8,e){n.next=ws,ws=n;return}n.next=Ss,Ss=n}function Gu(){Fp++}function qu(){if(--Fp>0)return;if(ws){let e=ws;for(ws=void 0;e;){const t=e.next;e.next=void 0,e.flags&=-9,e=t}}let n;for(;Ss;){let e=Ss;for(Ss=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 Hp(n){for(let e=n.deps;e;e=e.nextDep)e.version=-1,e.prevActiveLink=e.dep.activeLink,e.dep.activeLink=e}function Wp(n){let e,t=n.depsTail,r=t;for(;r;){const i=r.prevDep;r.version===-1?(r===t&&(t=i),ju(r),Jx(r)):e=r,r.dep.activeLink=r.prevActiveLink,r.prevActiveLink=void 0,r=i}n.deps=e,n.depsTail=t}function Ju(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===xs))return;n.globalVersion=xs;const e=n.dep;if(n.flags|=2,e.version>0&&!n.isSSR&&n.deps&&!Ju(n)){n.flags&=-3;return}const t=be,r=ln;be=n,ln=!0;try{Hp(n);const i=n.fn(n._value);(e.version===0||lr(i,n._value))&&(n._value=i,e.version++)}catch(i){throw e.version++,i}finally{be=t,ln=r,Wp(n),n.flags&=-3}}function ju(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)ju(o,!0)}!e&&!--t.sc&&t.map&&t.map.delete(t.key)}function Jx(n){const{prevDep:e,nextDep:t}=n;e&&(e.nextDep=t,n.prevDep=void 0),t&&(t.prevDep=e,n.nextDep=void 0)}let ln=!0;const Vp=[];function Go(){Vp.push(ln),ln=!1}function qo(){const n=Vp.pop();ln=n===void 0?!0:n}function Kp(n){const{cleanup:e}=n;if(n.cleanup=void 0,e){const t=be;be=void 0;try{e()}finally{be=t}}}let xs=0,jx=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 Yu{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(!be||!ln||be===this.computed)return;let t=this.activeLink;if(t===void 0||t.sub!==be)t=this.activeLink=new jx(be,this),be.deps?(t.prevDep=be.depsTail,be.depsTail.nextDep=t,be.depsTail=t):be.deps=be.depsTail=t,Gp(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=be.depsTail,t.nextDep=void 0,be.depsTail.nextDep=t,be.depsTail=t,be.deps===t&&(be.deps=r)}return process.env.NODE_ENV!=="production"&&be.onTrack&&be.onTrack(Ct({effect:be},e)),t}trigger(e){this.version++,xs++,this.notify(e)}notify(e){Gu();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(Ct({effect:t.sub},e));for(let t=this.subs;t;t=t.prevSub)t.sub.notify()&&t.sub.dep.notify()}finally{qu()}}}function Gp(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)Gp(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 Jo=new WeakMap,Dr=Symbol(process.env.NODE_ENV!=="production"?"Object iterate":""),Xu=Symbol(process.env.NODE_ENV!=="production"?"Map keys iterate":""),_s=Symbol(process.env.NODE_ENV!=="production"?"Array iterate":"");function Ge(n,e,t){if(ln&&be){let r=Jo.get(n);r||Jo.set(n,r=new Map);let i=r.get(t);i||(r.set(t,i=new Yu),i.map=r,i.key=t),process.env.NODE_ENV!=="production"?i.track({target:n,type:e,key:t}):i.track()}}function ar(n,e,t,r,i,o){const a=Jo.get(n);if(!a){xs++;return}const u=f=>{f&&(process.env.NODE_ENV!=="production"?f.trigger({target:n,type:e,key:t,newValue:r,oldValue:i,oldTarget:o}):f.trigger())};if(Gu(),e==="clear")a.forEach(u);else{const f=ke(n),h=f&&Wu(t);if(f&&t==="length"){const m=Number(r);a.forEach((p,y)=>{(y==="length"||y===_s||!vs(y)&&y>=m)&&u(p)})}else switch((t!==void 0||a.has(void 0))&&u(a.get(t)),h&&u(a.get(_s)),e){case"add":f?h&&u(a.get("length")):(u(a.get(Dr)),vi(n)&&u(a.get(Xu)));break;case"delete":f||(u(a.get(Dr)),vi(n)&&u(a.get(Xu)));break;case"set":vi(n)&&u(a.get(Dr));break}}qu()}function Yx(n,e){const t=Jo.get(n);return t&&t.get(e)}function Si(n){const e=ce(n);return e===n?e:(Ge(e,"iterate",_s),St(n)?e:e.map(dt))}function Zu(n){return Ge(n=ce(n),"iterate",_s),n}const Xx={__proto__:null,[Symbol.iterator](){return Qu(this,Symbol.iterator,dt)},concat(...n){return Si(this).concat(...n.map(e=>ke(e)?Si(e):e))},entries(){return Qu(this,"entries",n=>(n[1]=dt(n[1]),n))},every(n,e){return Fn(this,"every",n,e,void 0,arguments)},filter(n,e){return Fn(this,"filter",n,e,t=>t.map(dt),arguments)},find(n,e){return Fn(this,"find",n,e,dt,arguments)},findIndex(n,e){return Fn(this,"findIndex",n,e,void 0,arguments)},findLast(n,e){return Fn(this,"findLast",n,e,dt,arguments)},findLastIndex(n,e){return Fn(this,"findLastIndex",n,e,void 0,arguments)},forEach(n,e){return Fn(this,"forEach",n,e,void 0,arguments)},includes(...n){return ec(this,"includes",n)},indexOf(...n){return ec(this,"indexOf",n)},join(n){return Si(this).join(n)},lastIndexOf(...n){return ec(this,"lastIndexOf",n)},map(n,e){return Fn(this,"map",n,e,void 0,arguments)},pop(){return Es(this,"pop")},push(...n){return Es(this,"push",n)},reduce(n,...e){return qp(this,"reduce",n,e)},reduceRight(n,...e){return qp(this,"reduceRight",n,e)},shift(){return Es(this,"shift")},some(n,e){return Fn(this,"some",n,e,void 0,arguments)},splice(...n){return Es(this,"splice",n)},toReversed(){return Si(this).toReversed()},toSorted(n){return Si(this).toSorted(n)},toSpliced(...n){return Si(this).toSpliced(...n)},unshift(...n){return Es(this,"unshift",n)},values(){return Qu(this,"values",dt)}};function Qu(n,e,t){const r=Zu(n),i=r[e]();return r!==n&&!St(n)&&(i._next=i.next,i.next=()=>{const o=i._next();return o.value&&(o.value=t(o.value)),o}),i}const Zx=Array.prototype;function Fn(n,e,t,r,i,o){const a=Zu(n),u=a!==n&&!St(n),f=a[e];if(f!==Zx[e]){const p=f.apply(n,o);return u?dt(p):p}let h=t;a!==n&&(u?h=function(p,y){return t.call(this,dt(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 u&&i?i(m):m}function qp(n,e,t,r){const i=Zu(n);let o=t;return i!==n&&(St(n)?t.length>3&&(o=function(a,u,f){return t.call(this,a,u,f,n)}):o=function(a,u,f){return t.call(this,a,dt(u),f,n)}),i[e](o,...r)}function ec(n,e,t){const r=ce(n);Ge(r,"iterate",_s);const i=r[e](...t);return(i===-1||i===!1)&&Zo(t[0])?(t[0]=ce(t[0]),r[e](...t)):i}function Es(n,e,t=[]){Go(),Gu();const r=ce(n)[e].apply(n,t);return qu(),qo(),r}const Qx=Rx("__proto__,__v_isRef,__isVue"),Jp=new Set(Object.getOwnPropertyNames(Symbol).filter(n=>n!=="arguments"&&n!=="caller").map(n=>Symbol[n]).filter(vs));function e_(n){vs(n)||(n=String(n));const e=ce(this);return Ge(e,"has",n),e.hasOwnProperty(n)}class jp{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?em:Qp:o?c_:Zp).get(e)||Object.getPrototypeOf(e)===Object.getPrototypeOf(r)?e:void 0;const a=ke(e);if(!i){let f;if(a&&(f=Xx[t]))return f;if(t==="hasOwnProperty")return e_}const u=Reflect.get(e,t,et(e)?e:r);return(vs(t)?Jp.has(t):Qx(t))||(i||Ge(e,"get",t),o)?u:et(u)?a&&Wu(t)?u:u.value:ht(u)?i?tm(u):rc(u):u}}class t_ extends jp{constructor(e=!1){super(!1,e)}set(e,t,r,i){let o=e[t];if(!this._isShallow){const f=$n(o);if(!St(r)&&!$n(r)&&(o=ce(o),r=ce(r)),!ke(e)&&et(o)&&!et(r))return f?!1:(o.value=r,!0)}const a=ke(e)&&Wu(t)?Number(t)<e.length:Re(e,t),u=Reflect.set(e,t,r,et(e)?e:i);return e===ce(i)&&(a?lr(r,o)&&ar(e,"set",t,r,o):ar(e,"add",t,r)),u}deleteProperty(e,t){const r=Re(e,t),i=e[t],o=Reflect.deleteProperty(e,t);return o&&r&&ar(e,"delete",t,void 0,i),o}has(e,t){const r=Reflect.has(e,t);return(!vs(t)||!Jp.has(t))&&Ge(e,"has",t),r}ownKeys(e){return Ge(e,"iterate",ke(e)?"length":Dr),Reflect.ownKeys(e)}}class Yp extends jp{constructor(e=!1){super(!0,e)}set(e,t){return process.env.NODE_ENV!=="production"&&Bn(`Set operation on key "${String(t)}" failed: target is readonly.`,e),!0}deleteProperty(e,t){return process.env.NODE_ENV!=="production"&&Bn(`Delete operation on key "${String(t)}" failed: target is readonly.`,e),!0}}const n_=new t_,r_=new Yp,i_=new Yp(!0),tc=n=>n,jo=n=>Reflect.getPrototypeOf(n);function s_(n,e,t){return function(...r){const i=this.__v_raw,o=ce(i),a=vi(o),u=n==="entries"||n===Symbol.iterator&&a,f=n==="keys"&&a,h=i[n](...r),m=t?tc:e?sc:dt;return!e&&Ge(o,"iterate",f?Xu:Dr),{next(){const{value:p,done:y}=h.next();return y?{value:p,done:y}:{value:u?[m(p[0]),m(p[1])]:m(p),done:y}},[Symbol.iterator](){return this}}}}function Yo(n){return function(...e){if(process.env.NODE_ENV!=="production"){const t=e[0]?`on key "${e[0]}" `:"";Bn(`${Hx(n)} operation ${t}failed: target is readonly.`,ce(this))}return n==="delete"?!1:n==="clear"?void 0:this}}function o_(n,e){const t={get(i){const o=this.__v_raw,a=ce(o),u=ce(i);n||(lr(i,u)&&Ge(a,"get",i),Ge(a,"get",u));const{has:f}=jo(a),h=e?tc:n?sc:dt;if(f.call(a,i))return h(o.get(i));if(f.call(a,u))return h(o.get(u));o!==a&&o.get(i)},get size(){const i=this.__v_raw;return!n&&Ge(ce(i),"iterate",Dr),Reflect.get(i,"size",i)},has(i){const o=this.__v_raw,a=ce(o),u=ce(i);return n||(lr(i,u)&&Ge(a,"has",i),Ge(a,"has",u)),i===u?o.has(i):o.has(i)||o.has(u)},forEach(i,o){const a=this,u=a.__v_raw,f=ce(u),h=e?tc:n?sc:dt;return!n&&Ge(f,"iterate",Dr),u.forEach((m,p)=>i.call(o,h(m),h(p),a))}};return Ct(t,n?{add:Yo("add"),set:Yo("set"),delete:Yo("delete"),clear:Yo("clear")}:{add(i){!e&&!St(i)&&!$n(i)&&(i=ce(i));const o=ce(this);return jo(o).has.call(o,i)||(o.add(i),ar(o,"add",i,i)),this},set(i,o){!e&&!St(o)&&!$n(o)&&(o=ce(o));const a=ce(this),{has:u,get:f}=jo(a);let h=u.call(a,i);h?process.env.NODE_ENV!=="production"&&Xp(a,u,i):(i=ce(i),h=u.call(a,i));const m=f.call(a,i);return a.set(i,o),h?lr(o,m)&&ar(a,"set",i,o,m):ar(a,"add",i,o),this},delete(i){const o=ce(this),{has:a,get:u}=jo(o);let f=a.call(o,i);f?process.env.NODE_ENV!=="production"&&Xp(o,a,i):(i=ce(i),f=a.call(o,i));const h=u?u.call(o,i):void 0,m=o.delete(i);return f&&ar(o,"delete",i,void 0,h),m},clear(){const i=ce(this),o=i.size!==0,a=process.env.NODE_ENV!=="production"?vi(i)?new Map(i):new Set(i):void 0,u=i.clear();return o&&ar(i,"clear",void 0,void 0,a),u}}),["keys","values","entries",Symbol.iterator].forEach(i=>{t[i]=s_(i,n,e)}),t}function nc(n,e){const t=o_(n,e);return(r,i,o)=>i==="__v_isReactive"?!n:i==="__v_isReadonly"?n:i==="__v_raw"?r:Reflect.get(Re(t,i)&&i in r?t:r,i,o)}const l_={get:nc(!1,!1)},a_={get:nc(!0,!1)},u_={get:nc(!0,!0)};function Xp(n,e,t){const r=ce(t);if(r!==t&&e.call(n,r)){const i=zp(n);Bn(`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 Zp=new WeakMap,c_=new WeakMap,Qp=new WeakMap,em=new WeakMap;function f_(n){switch(n){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function h_(n){return n.__v_skip||!Object.isExtensible(n)?0:f_(zp(n))}function rc(n){return $n(n)?n:ic(n,!1,n_,l_,Zp)}function tm(n){return ic(n,!0,r_,a_,Qp)}function Xo(n){return ic(n,!0,i_,u_,em)}function ic(n,e,t,r,i){if(!ht(n))return process.env.NODE_ENV!=="production"&&Bn(`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=h_(n);if(a===0)return n;const u=new Proxy(n,a===2?r:t);return i.set(n,u),u}function wi(n){return $n(n)?wi(n.__v_raw):!!(n&&n.__v_isReactive)}function $n(n){return!!(n&&n.__v_isReadonly)}function St(n){return!!(n&&n.__v_isShallow)}function Zo(n){return n?!!n.__v_raw:!1}function ce(n){const e=n&&n.__v_raw;return e?ce(e):n}function d_(n){return!Re(n,"__v_skip")&&Object.isExtensible(n)&&Wx(n,"__v_skip",!0),n}const dt=n=>ht(n)?rc(n):n,sc=n=>ht(n)?tm(n):n;function et(n){return n?n.__v_isRef===!0:!1}function Qo(n){return p_(n,!1)}function p_(n,e){return et(n)?n:new m_(n,e)}class m_{constructor(e,t){this.dep=new Yu,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=t?e:ce(e),this._value=t?e:dt(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||St(e)||$n(e);e=r?e:ce(e),lr(e,t)&&(this._rawValue=e,this._value=r?e:dt(e),process.env.NODE_ENV!=="production"?this.dep.trigger({target:this,type:"set",key:"value",newValue:e,oldValue:t}):this.dep.trigger())}}function z(n){return et(n)?n.value:n}const g_={get:(n,e,t)=>e==="__v_raw"?n:z(Reflect.get(n,e,t)),set:(n,e,t,r)=>{const i=n[e];return et(i)&&!et(t)?(i.value=t,!0):Reflect.set(n,e,t,r)}};function y_(n){return wi(n)?n:new Proxy(n,g_)}class b_{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 Yx(ce(this._object),this._key)}}class v_{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 xi(n,e,t){return et(n)?n:Le(n)?new v_(n):ht(n)&&arguments.length>1?S_(n,e,t):Qo(n)}function S_(n,e,t){const r=n[e];return et(r)?r:new b_(n,e,t)}class w_{constructor(e,t,r){this.fn=e,this.setter=t,this._value=void 0,this.dep=new Yu(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=xs-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!t,this.isSSR=r}notify(){if(this.flags|=16,!(this.flags&8)&&be!==this)return $p(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"&&Bn("Write operation failed: computed value is readonly")}}function x_(n,e,t=!1){let r,i;Le(n)?r=n:(r=n.get,i=n.set);const o=new w_(r,i,t);return process.env.NODE_ENV!=="production"&&e&&!t&&(o.onTrack=e.onTrack,o.onTrigger=e.onTrigger),o}const el={},tl=new WeakMap;let zr;function __(n,e=!1,t=zr){if(t){let r=tl.get(t);r||tl.set(t,r=[]),r.push(n)}else process.env.NODE_ENV!=="production"&&!e&&Bn("onWatcherCleanup() was called when there was no active watcher to associate with.")}function E_(n,e,t=Wt){const{immediate:r,deep:i,once:o,scheduler:a,augmentJob:u,call:f}=t,h=H=>{(t.onWarn||Bn)("Invalid watch source: ",H,"A watch source can only be a getter/effect function, a ref, a reactive object, or an array of these types.")},m=H=>i?H:St(H)||i===!1||i===0?ur(H,1):ur(H);let p,y,S,w,M=!1,T=!1;if(et(n)?(y=()=>n.value,M=St(n)):wi(n)?(y=()=>m(n),M=!0):ke(n)?(T=!0,M=n.some(H=>wi(H)||St(H)),y=()=>n.map(H=>{if(et(H))return H.value;if(wi(H))return m(H);if(Le(H))return f?f(H,2):H();process.env.NODE_ENV!=="production"&&h(H)})):Le(n)?e?y=f?()=>f(n,2):n:y=()=>{if(S){Go();try{S()}finally{qo()}}const H=zr;zr=p;try{return f?f(n,3,[w]):n(w)}finally{zr=H}}:(y=Pr,process.env.NODE_ENV!=="production"&&h(n)),e&&i){const H=y,X=i===!0?1/0:i;y=()=>ur(H(),X)}const O=()=>{p.stop()};if(o&&e){const H=e;e=(...X)=>{H(...X),O()}}let F=T?new Array(n.length).fill(el):el;const B=H=>{if(!(!(p.flags&1)||!p.dirty&&!H))if(e){const X=p.run();if(i||M||(T?X.some((q,ie)=>lr(q,F[ie])):lr(X,F))){S&&S();const q=zr;zr=p;try{const ie=[X,F===el?void 0:T&&F[0]===el?[]:F,w];f?f(e,3,ie):e(...ie),F=X}finally{zr=q}}}else p.run()};return u&&u(B),p=new qx(y),p.scheduler=a?()=>a(B,!1):B,w=H=>__(H,!1,p),S=p.onStop=()=>{const H=tl.get(p);if(H){if(f)f(H,4);else for(const X of H)X();tl.delete(p)}},process.env.NODE_ENV!=="production"&&(p.onTrack=t.onTrack,p.onTrigger=t.onTrigger),e?r?B(!0):F=p.run():a?a(B.bind(null,!0),!0):p.run(),O.pause=p.pause.bind(p),O.resume=p.resume.bind(p),O.stop=O,O}function ur(n,e=1/0,t){if(e<=0||!ht(n)||n.__v_skip||(t=t||new Set,t.has(n)))return n;if(t.add(n),e--,et(n))ur(n.value,e,t);else if(ke(n))for(let r=0;r<n.length;r++)ur(n[r],e,t);else if(Dx(n)||vi(n))n.forEach(r=>{ur(r,e,t)});else if(Fx(n)){for(const r in n)ur(n[r],e,t);for(const r of Object.getOwnPropertySymbols(n))Object.prototype.propertyIsEnumerable.call(n,r)&&ur(n[r],e,t)}return n}const Br=[];function k_(n){Br.push(n)}function M_(){Br.pop()}let oc=!1;function Ce(n,...e){if(oc)return;oc=!0,Go();const t=Br.length?Br[Br.length-1].component:null,r=t&&t.appContext.config.warnHandler,i=T_();if(r)nl(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 <${Em(t,o.type)}>`).join(`
2
2
  `),i]);else{const o=[`[Vue warn]: ${n}`,...e];i.length&&o.push(`
3
3
  `,...C_(i)),console.warn(...o)}qo(),oc=!1}function T_(){let n=Br[Br.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 C_(n){const e=[];return n.forEach((t,r)=>{e.push(...r===0?[]:[`
4
- `],...A_(t))}),e}function A_({vnode:n,recurseCount:e}){const t=e>0?`... (${e} recursive calls)`:"",r=n.component?n.component.parent==null:!1,i=` at <${km(n.component,n.type,r)}`,o=">"+t;return n.props?[i,...O_(n.props),o]:[i+o]}function O_(n){const e=[],t=Object.keys(n);return t.slice(0,3).forEach(r=>{e.push(...nm(r,n[r]))}),t.length>3&&e.push(" ..."),e}function nm(n,e,t){return on(e)?(e=JSON.stringify(e),t?e:[`${n}=${e}`]):typeof e=="number"||typeof e=="boolean"||e==null?t?e:[`${n}=${e}`]:et(e)?(e=nm(n,ce(e.value),!0),t?e:[`${n}=Ref<`,e,">"]):Le(e)?[`${n}=fn${e.name?`<${e.name}>`:""}`]:(e=ce(e),t?e:[`${n}=`,e])}const rm={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 nl(n,e,t,r){try{return r?n(...r):n()}catch(i){lc(i,e,t)}}function im(n,e,t,r){if(Le(n)){const i=nl(n,e,t,r);return i&&zx(i)&&i.catch(o=>{lc(o,e,t)}),i}if(Ee(n)){const i=[];for(let o=0;o<n.length;o++)i.push(im(n[o],e,t,r));return i}else process.env.NODE_ENV!=="production"&&Ce(`Invalid value type passed to callWithAsyncErrorHandling(): ${typeof n}`)}function lc(n,e,t,r=!0){const i=e?e.vnode:null,{errorHandler:o,throwUnhandledErrorInProduction:a}=e&&e.appContext.config||Wt;if(e){let u=e.parent;const f=e.proxy,d=process.env.NODE_ENV!=="production"?rm[t]:`https://vuejs.org/error-reference/#runtime-${t}`;for(;u;){const m=u.ec;if(m){for(let p=0;p<m.length;p++)if(m[p](n,f,d)===!1)return}u=u.parent}if(o){Go(),nl(o,null,10,[n,f,d]),qo();return}}I_(n,t,i,r,a)}function I_(n,e,t,r=!0,i=!1){if(process.env.NODE_ENV!=="production"){const o=rm[e];if(t&&E_(t),Ce(`Unhandled error${o?` during execution of ${o}`:""}`),t&&M_(),r)throw n;console.error(n)}else{if(i)throw n;console.error(n)}}const Ut=[];let Hn=-1;const _i=[];let cr=null,ki=0;const sm=Promise.resolve();let rl=null;const N_=100;function R_(n){const e=rl||sm;return n?e.then(this?n.bind(this):n):e}function L_(n){let e=Hn+1,t=Ut.length;for(;e<t;){const r=e+t>>>1,i=Ut[r],o=Es(i);o<n||o===n&&i.flags&2?e=r+1:t=r}return e}function ac(n){if(!(n.flags&1)){const e=Es(n),t=Ut[Ut.length-1];!t||!(n.flags&2)&&e>=Es(t)?Ut.push(n):Ut.splice(L_(e),0,n),n.flags|=1,om()}}function om(){rl||(rl=sm.then(am))}function lm(n){Ee(n)?_i.push(...n):cr&&n.id===-1?cr.splice(ki+1,0,n):n.flags&1||(_i.push(n),n.flags|=1),om()}function P_(n){if(_i.length){const e=[...new Set(_i)].sort((t,r)=>Es(t)-Es(r));if(_i.length=0,cr){cr.push(...e);return}for(cr=e,process.env.NODE_ENV!=="production"&&(n=n||new Map),ki=0;ki<cr.length;ki++){const t=cr[ki];process.env.NODE_ENV!=="production"&&um(n,t)||(t.flags&4&&(t.flags&=-2),t.flags&8||t(),t.flags&=-2)}cr=null,ki=0}}const Es=n=>n.id==null?n.flags&2?-1:1/0:n.id;function am(n){process.env.NODE_ENV!=="production"&&(n=n||new Map);const e=process.env.NODE_ENV!=="production"?t=>um(n,t):Pr;try{for(Hn=0;Hn<Ut.length;Hn++){const t=Ut[Hn];if(t&&!(t.flags&8)){if(process.env.NODE_ENV!=="production"&&e(t))continue;t.flags&4&&(t.flags&=-2),nl(t,t.i,t.i?15:14),t.flags&4||(t.flags&=-2)}}}finally{for(;Hn<Ut.length;Hn++){const t=Ut[Hn];t&&(t.flags&=-2)}Hn=-1,Ut.length=0,P_(n),rl=null,(Ut.length||_i.length)&&am(n)}}function um(n,e){const t=n.get(e)||0;if(t>N_){const r=e.i,i=r&&_m(r.type);return lc(`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 uc=new Map;process.env.NODE_ENV!=="production"&&(Ko().__VUE_HMR_RUNTIME__={createRecord:cc(D_),rerender:cc(z_),reload:cc(B_)});const il=new Map;function D_(n,e){return il.has(n)?!1:(il.set(n,{initialDef:sl(e),instances:new Set}),!0)}function sl(n){return Em(n)?n.__vccOpts:n}function z_(n,e){const t=il.get(n);t&&(t.initialDef.render=e,[...t.instances].forEach(r=>{e&&(r.render=e,sl(r.type).render=e),r.renderCache=[],r.update()}))}function B_(n,e){const t=il.get(n);if(!t)return;e=sl(e),cm(t.initialDef,e);const r=[...t.instances];for(let i=0;i<r.length;i++){const o=r[i],a=sl(o.type);let u=uc.get(a);u||(a!==t.initialDef&&cm(a,e),uc.set(a,u=new Set)),u.add(o),o.appContext.propsCache.delete(o.type),o.appContext.emitsCache.delete(o.type),o.appContext.optionsCache.delete(o.type),o.ceReload?(u.add(o),o.ceReload(e.styles),u.delete(o)):o.parent?ac(()=>{o.parent.update(),u.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)}lm(()=>{uc.clear()})}function cm(n,e){Ct(n,e);for(const t in n)t!=="__file"&&!(t in e)&&delete n[t]}function cc(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 Ei,ol=[];function fm(n,e){var t,r;Ei=n,Ei?(Ei.enabled=!0,ol.forEach(({event:i,args:o})=>Ei.emit(i,...o)),ol=[]):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=>{fm(o,e)}),setTimeout(()=>{Ei||(e.__VUE_DEVTOOLS_HOOK_REPLAY__=null,ol=[])},3e3)):ol=[]}let bn=null,F_=null;const $_=n=>n.__isTeleport;function dm(n,e){n.shapeFlag&6&&n.component?(n.transition=e,dm(n.component.subTree,e)):n.shapeFlag&128?(n.ssContent.transition=e.clone(n.ssContent),n.ssFallback.transition=e.clone(n.ssFallback)):n.transition=e}Ko().requestIdleCallback,Ko().cancelIdleCallback;const H_=Symbol.for("v-ndc"),fc=n=>n?yk(n)?bk(n):fc(n.parent):null,Ms=Ct(Object.create(null),{$:n=>n,$el:n=>n.vnode.el,$data:n=>n.data,$props:n=>process.env.NODE_ENV!=="production"?Xo(n.props):n.props,$attrs:n=>process.env.NODE_ENV!=="production"?Xo(n.attrs):n.attrs,$slots:n=>process.env.NODE_ENV!=="production"?Xo(n.slots):n.slots,$refs:n=>process.env.NODE_ENV!=="production"?Xo(n.refs):n.refs,$parent:n=>fc(n.parent),$root:n=>fc(n.root),$host:n=>n.ce,$emit:n=>n.emit,$options:n=>__VUE_OPTIONS_API__?K_(n):n.type,$forceUpdate:n=>n.f||(n.f=()=>{ac(n.update)}),$nextTick:n=>n.n||(n.n=R_.bind(n.proxy)),$watch:n=>__VUE_OPTIONS_API__?nk.bind(n):Pr}),W_=n=>n==="_"||n==="$",dc=(n,e)=>n!==Wt&&!n.__isScriptSetup&&Re(n,e),U_={get({_:n},e){if(e==="__v_skip")return!0;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 d;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(dc(r,e))return a[e]=1,r[e];if(i!==Wt&&Re(i,e))return a[e]=2,i[e];if((d=n.propsOptions[0])&&Re(d,e))return a[e]=3,o[e];if(t!==Wt&&Re(t,e))return a[e]=4,t[e];(!__VUE_OPTIONS_API__||V_)&&(a[e]=0)}}const m=Ms[e];let p,y;if(m)return e==="$attrs"?(Ge(n.attrs,"get",""),process.env.NODE_ENV!=="production"&&void 0):process.env.NODE_ENV!=="production"&&e==="$slots"&&Ge(n,"get",e),m(n);if((p=u.__cssModules)&&(p=p[e]))return p;if(t!==Wt&&Re(t,e))return a[e]=4,t[e];if(y=f.config.globalProperties,Re(y,e))return y[e];process.env.NODE_ENV!=="production"&&bn&&(!on(e)||e.indexOf("__v")!==0)&&(i!==Wt&&W_(e[0])&&Re(i,e)?Ce(`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===bn&&Ce(`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 dc(i,e)?(i[e]=t,!0):process.env.NODE_ENV!=="production"&&i.__isScriptSetup&&Re(i,e)?(Ce(`Cannot mutate <script setup> binding "${e}" from Options API.`),!1):r!==Wt&&Re(r,e)?(r[e]=t,!0):Re(n.props,e)?(process.env.NODE_ENV!=="production"&&Ce(`Attempting to mutate prop "${e}". Props are readonly.`),!1):e[0]==="$"&&e.slice(1)in n?(process.env.NODE_ENV!=="production"&&Ce(`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!==Wt&&Re(n,a)||dc(e,a)||(u=o[0])&&Re(u,a)||Re(r,a)||Re(Ms,a)||Re(i.config.globalProperties,a)},defineProperty(n,e,t){return t.get!=null?n._.accessCache[e]=0:Re(t,"value")&&this.set(n,e,t.value,null),Reflect.defineProperty(n,e,t)}};process.env.NODE_ENV!=="production"&&(U_.ownKeys=n=>(Ce("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 hm(n){return Ee(n)?n.reduce((e,t)=>(e[t]=null,e),{}):n}let V_=!0;function K_(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(d=>ll(f,d,a,!0)),ll(f,e,a)),dt(e)&&o.set(e,f),f}function ll(n,e,t,r=!1){const{mixins:i,extends:o}=e;o&&ll(n,o,t,!0),i&&i.forEach(a=>ll(n,a,t,!0));for(const a in e)if(r&&a==="expose")process.env.NODE_ENV!=="production"&&Ce('"expose" option is ignored when declared in mixins or extends. It should only be declared in the base component itself.');else{const u=G_[a]||t&&t[a];n[a]=u?u(n[a],e[a]):e[a]}return n}const G_={data:pm,props:gm,emits:gm,methods:Ts,computed:Ts,beforeCreate:pt,created:pt,beforeMount:pt,mounted:pt,beforeUpdate:pt,updated:pt,beforeDestroy:pt,beforeUnmount:pt,destroyed:pt,unmounted:pt,activated:pt,deactivated:pt,errorCaptured:pt,serverPrefetch:pt,components:Ts,directives:Ts,watch:J_,provide:pm,inject:q_};function pm(n,e){return e?n?function(){return Ct(Le(n)?n.call(this,this):n,Le(e)?e.call(this,this):e)}:e:n}function q_(n,e){return Ts(mm(n),mm(e))}function mm(n){if(Ee(n)){const e={};for(let t=0;t<n.length;t++)e[n[t]]=n[t];return e}return n}function pt(n,e){return n?[...new Set([].concat(n,e))]:e}function Ts(n,e){return n?Ct(Object.create(null),n,e):e}function gm(n,e){return n?Ee(n)&&Ee(e)?[...new Set([...n,...e])]:Ct(Object.create(null),hm(n),hm(e??{})):e}function J_(n,e){if(!n)return e;if(!e)return n;const t=Ct(Object.create(null),n);for(const r in e)t[r]=pt(n[r],e[r]);return t}let j_=null;function Y_(n,e,t=!1){const r=Cs||bn;if(r||j_){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&&Le(e)?e.call(r&&r.proxy):e;process.env.NODE_ENV!=="production"&&Ce(`injection "${String(n)}" not found.`)}else process.env.NODE_ENV!=="production"&&Ce("inject() can only be used inside setup() or functional components.")}const X_={},ym=n=>Object.getPrototypeOf(n)===X_,Z_=sk,Q_=Symbol.for("v-scx"),ek=()=>{{const n=Y_(Q_);return n||process.env.NODE_ENV!=="production"&&Ce("Server rendering context not provided. Make sure to only call useSSRContext() conditionally in the server build."),n}};function tk(n,e,t){return process.env.NODE_ENV!=="production"&&!Le(e)&&Ce("`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."),bm(n,e,t)}function bm(n,e,t=Wt){const{immediate:r,deep:i,flush:o,once:a}=t;process.env.NODE_ENV!=="production"&&!e&&(r!==void 0&&Ce('watch() "immediate" option is only respected when using the watch(source, callback, options?) signature.'),i!==void 0&&Ce('watch() "deep" option is only respected when using the watch(source, callback, options?) signature.'),a!==void 0&&Ce('watch() "once" option is only respected when using the watch(source, callback, options?) signature.'));const u=Ct({},t);process.env.NODE_ENV!=="production"&&(u.onWarn=Ce);const f=e&&r||!e&&o!=="post";let d;if(cl){if(o==="sync"){const S=ek();d=S.__watcherHandles||(S.__watcherHandles=[])}else if(!f){const S=()=>{};return S.stop=Pr,S.resume=Pr,S.pause=Pr,S}}const m=Cs;u.call=(S,w,M)=>im(S,m,w,M);let p=!1;o==="post"?u.scheduler=S=>{Z_(S,m&&m.suspense)}:o!=="sync"&&(p=!0,u.scheduler=(S,w)=>{w?S():ac(S)}),u.augmentJob=S=>{e&&(S.flags|=4),p&&(S.flags|=2,m&&(S.id=m.uid,S.i=m))};const y=k_(n,e,u);return cl&&(d?d.push(y):f&&y()),y}function nk(n,e,t){const r=this.proxy,i=on(n)?n.includes(".")?rk(r,n):()=>r[n]:n.bind(r,r);let o;Le(e)?o=e:(o=e.handler,t=e);const a=gk(this),u=bm(i,o.bind(r),t);return a(),u}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 dI(){}const ik=n=>n.__isSuspense;function sk(n,e){e&&e.pendingBranch?Ee(n)?e.effects.push(...n):e.effects.push(n):lm(n)}const vm=Symbol.for("v-fgt"),ok=Symbol.for("v-txt"),lk=Symbol.for("v-cmt");let Mi=null;function ak(n){return n?n.__v_isVNode===!0:!1}const uk=(...n)=>wm(...n),Sm=({key:n})=>n??null,al=({ref:n,ref_key:e,ref_for:t})=>(typeof n=="number"&&(n=""+n),n!=null?on(n)||et(n)||Le(n)?{i:bn,r:n,k:e,f:!!t}:n:null);function ck(n,e=null,t=null,r=0,i=null,o=n===vm?0:1,a=!1,u=!1){const f={__v_isVNode:!0,__v_skip:!0,type:n,props:e,key:e&&Sm(e),ref:e&&al(e),scopeId:F_,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:bn};return u?(hc(f,t),o&128&&n.normalize(f)):t&&(f.shapeFlag|=on(t)?8:16),process.env.NODE_ENV!=="production"&&f.key!==f.key&&Ce("VNode created with invalid key (NaN). VNode type:",f.type),!a&&Mi&&(f.patchFlag>0||o&6)&&f.patchFlag!==32&&Mi.push(f),f}const fk=process.env.NODE_ENV!=="production"?uk:wm;function wm(n,e=null,t=null,r=0,i=null,o=!1){if((!n||n===H_)&&(process.env.NODE_ENV!=="production"&&!n&&Ce(`Invalid vnode type when creating vnode: ${n}.`),n=lk),ak(n)){const u=ul(n,e,!0);return t&&hc(u,t),!o&&Mi&&(u.shapeFlag&6?Mi[Mi.indexOf(n)]=u:Mi.push(u)),u.patchFlag=-2,u}if(Em(n)&&(n=n.__vccOpts),e){e=dk(e);let{class:u,style:f}=e;u&&!on(u)&&(e.class=Vu(u)),dt(f)&&(Zo(f)&&!Ee(f)&&(f=Ct({},f)),e.style=Uu(f))}const a=on(n)?1:ik(n)?128:$_(n)?64:dt(n)?4:Le(n)?2:0;return process.env.NODE_ENV!=="production"&&a&4&&Zo(n)&&(n=ce(n),Ce("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)),ck(n,e,t,r,i,a,o,!0)}function dk(n){return n?Zo(n)||ym(n)?Ct({},n):n:null}function ul(n,e,t=!1,r=!1){const{props:i,ref:o,patchFlag:a,children:u,transition:f}=n,d=e?pk(i||{},e):i,m={__v_isVNode:!0,__v_skip:!0,type:n.type,props:d,key:d&&Sm(d),ref:e&&e.ref?t&&o?Ee(o)?o.concat(al(e)):[o,al(e)]:al(e):o,scopeId:n.scopeId,slotScopeIds:n.slotScopeIds,children:process.env.NODE_ENV!=="production"&&a===-1&&Ee(u)?u.map(xm):u,target:n.target,targetStart:n.targetStart,targetAnchor:n.targetAnchor,staticCount:n.staticCount,shapeFlag:n.shapeFlag,patchFlag:e&&n.type!==vm?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&&ul(n.ssContent),ssFallback:n.ssFallback&&ul(n.ssFallback),el:n.el,anchor:n.anchor,ctx:n.ctx,ce:n.ce};return f&&r&&dm(m,f.clone(m)),m}function xm(n){const e=ul(n);return Ee(n.children)&&(e.children=n.children.map(xm)),e}function hk(n=" ",e=0){return fk(ok,null,n,e)}function hc(n,e){let t=0;const{shapeFlag:r}=n;if(e==null)e=null;else if(Ee(e))t=16;else if(typeof e=="object")if(r&65){const i=e.default;i&&(i._c&&(i._d=!1),hc(n,i()),i._c&&(i._d=!0));return}else{t=32;const i=e._;!i&&!ym(e)?e._ctx=bn:i===3&&bn&&(bn.slots._===1?e._=1:(e._=2,n.patchFlag|=1024))}else Le(e)?(e={default:e,_ctx:bn},t=32):(e=String(e),r&64?(t=16,e=[hk(e)]):t=8);n.children=e,n.shapeFlag|=t}function pk(...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=Vu([e.class,r.class]));else if(i==="style")e.style=Uu([e.style,r.style]);else if(Lx(i)){const o=e[i],a=r[i];a&&o!==a&&!(Ee(o)&&o.includes(a))&&(e[i]=o?[].concat(o,a):a)}else i!==""&&(e[i]=r[i])}return e}let Cs=null;const mk=()=>Cs||bn;let pc;{const n=Ko(),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)}};pc=e("__VUE_INSTANCE_SETTERS__",t=>Cs=t),e("__VUE_SSR_SETTERS__",t=>cl=t)}const gk=n=>{const e=Cs;return pc(n),n.scope.on(),()=>{n.scope.off(),pc(e)}};function yk(n){return n.vnode.shapeFlag&4}let cl=!1;process.env.NODE_ENV;function bk(n){return n.exposed?n.exposeProxy||(n.exposeProxy=new Proxy(y_(h_(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 vk=/(?:^|[-_])(\w)/g,Sk=n=>n.replace(vk,e=>e.toUpperCase()).replace(/[-_]/g,"");function _m(n,e=!0){return Le(n)?n.displayName||n.name:n.name||e&&n.__name}function km(n,e,t=!1){let r=_m(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?Sk(r):t?"App":"Anonymous"}function Em(n){return Le(n)&&"__vccOpts"in n}const he=(n,e)=>{const t=x_(n,e,cl);if(process.env.NODE_ENV!=="production"){const r=mk();r&&r.appContext.config.warnRecursiveComputed&&(t._warnRecursive=!0)}return t};function wk(){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 dt(p)?p.__isVue?["div",n,"VueInstance"]:et(p)?["div",{},["span",n,m(p)],"<",u("_value"in p?p._value:p),">"]:wi(p)?["div",{},["span",n,St(p)?"ShallowReactive":"Reactive"],"<",u(p),`>${$n(p)?" (readonly)":""}`]:$n(p)?["div",{},["span",n,St(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 y=[];p.type.props&&p.props&&y.push(a("props",ce(p.props))),p.setupState!==Wt&&y.push(a("setup",p.setupState)),p.data!==Wt&&y.push(a("data",ce(p.data)));const S=f(p,"computed");S&&y.push(a("computed",S));const w=f(p,"inject");return w&&y.push(a("injected",w)),y.push(["div",{},["span",{style:r.style+";opacity:0.66"},"$ (internal): "],["object",{object:p}]]),y}function a(p,y){return y=Ct({},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+": "],u(y[S],!1)])]]:["span",{}]}function u(p,y=!0){return typeof p=="number"?["span",e,p]:typeof p=="string"?["span",t,JSON.stringify(p)]:typeof p=="boolean"?["span",r,p]:dt(p)?["object",{object:y?ce(p):p}]:["span",t,String(p)]}function f(p,y){const S=p.type;if(Le(S))return;const w={};for(const M in p.ctx)d(S,M,y)&&(w[M]=p.ctx[M]);return w}function d(p,y,S){const w=p[S];if(Ee(w)&&w.includes(y)||dt(w)&&y in w||p.extends&&d(p.extends,y,S)||p.mixins&&p.mixins.some(M=>d(M,y,S)))return!0}function m(p){return St(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 xk(){wk()}process.env.NODE_ENV!=="production"&&xk();function tt(n){this.content=n}tt.prototype={constructor:tt,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 tt(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 tt(t)},addToStart:function(n,e){return new tt([n,e].concat(this.remove(n).content))},addToEnd:function(n,e){var t=this.remove(n).content.slice();return t.push(n,e),new tt(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 tt(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=tt.from(n),n.size?new tt(n.content.concat(this.subtract(n).content)):this},append:function(n){return n=tt.from(n),n.size?new tt(this.subtract(n).content.concat(n.content)):this},subtract:function(n){var e=this;n=tt.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}},tt.from=function(n){if(n instanceof tt)return n;var e=[];if(n)for(var t in n)e.push(t,n[t]);return new tt(e)};function Mm(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=Mm(i.content,o.content,t+1);if(a!=null)return a}t+=i.nodeSize}}function Tm(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 d=0,m=Math.min(a.text.length,u.text.length);for(;d<m&&a.text[a.text.length-d-1]==u.text[u.text.length-d-1];)d++,t--,r--;return{a:t,b:r}}if(a.content.size||u.content.size){let d=Tm(a.content,u.content,t-1,r-1);if(d)return d}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],d=u+f.nodeSize;if(d>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=d}}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 Mm(this,e,t)}findDiffEnd(e,t=this.size,r=e.size){return Tm(this,e,t,r)}findIndex(e,t=-1){if(e==0)return fl(0,e);if(e==this.size)return fl(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?fl(r+1,a):fl(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 mc={index:0,offset:0};function fl(n,e){return mc.index=n,mc.offset=e,mc}function dl(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(!dl(n[r],e[r]))return!1}else{for(let r in n)if(!(r in e)||!dl(n[r],e[r]))return!1;for(let r in e)if(!(r in n))return!1}return!0}let _e=class Yf{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&&dl(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 Yf.none;if(e instanceof Yf)return[e];let t=e.slice();return t.sort((r,i)=>r.type.rank-i.type.rank),t}};_e.none=[];class hl extends Error{}class U{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=Am(this.content,e+this.openStart,t);return r&&new U(r,this.openStart,this.openEnd)}removeBetween(e,t){return new U(Cm(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 U.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 U(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 U(e,r,i)}}U.empty=new U(L.empty,0,0);function Cm(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(Cm(o.content,e-i-1,t-i-1)))}function Am(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=Am(a.content,e-o-1,t);return u&&n.replaceChild(i,a.copy(u))}function _k(n,e,t){if(t.openStart>n.depth)throw new hl("Inserted content deeper than insertion position");if(n.depth-t.openStart!=e.depth-t.openEnd)throw new hl("Inconsistent open depths");return Om(n,e,t,0)}function Om(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=Om(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 $r(a,u.cut(0,n.parentOffset).append(t.content).append(u.cut(e.parentOffset)))}else{let{start:a,end:u}=kk(t,n);return $r(o,Nm(n,a,u,e,r))}else return $r(o,pl(n,e,r))}function Im(n,e){if(!e.type.compatibleContent(n.type))throw new hl("Cannot join "+e.type.name+" onto "+n.type.name)}function gc(n,e,t){let r=n.node(t);return Im(r,e.node(t)),r}function Fr(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 As(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&&(Fr(n.nodeAfter,r),o++));for(let u=o;u<a;u++)Fr(i.child(u),r);e&&e.depth==t&&e.textOffset&&Fr(e.nodeBefore,r)}function $r(n,e){return n.type.checkContent(e),n.copy(e)}function Nm(n,e,t,r,i){let o=n.depth>i&&gc(n,e,i+1),a=r.depth>i&&gc(t,r,i+1),u=[];return As(null,n,i,u),o&&a&&e.index(i)==t.index(i)?(Im(o,a),Fr($r(o,Nm(n,e,t,r,i+1)),u)):(o&&Fr($r(o,pl(n,e,i+1)),u),As(e,t,i,u),a&&Fr($r(a,pl(t,r,i+1)),u)),As(r,null,i,u),new L(u)}function pl(n,e,t){let r=[];if(As(null,n,t,r),n.depth>t){let i=gc(n,e,t+1);Fr($r(i,pl(n,e,t+1)),r)}return As(e,null,t,r),new L(r)}function kk(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 js{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 _e.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 ml(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),d=o-f;if(r.push(a,u,i+f),!d||(a=a.child(u),a.isText))break;o=d-1,i+=f+1}return new js(t,r,o)}static resolveCached(e,t){for(let i=0;i<yc.length;i++){let o=yc[i];if(o.pos==t&&o.doc==e)return o}let r=yc[bc]=js.resolve(e,t);return bc=(bc+1)%Ek,r}}let yc=[],bc=0,Ek=12;class ml{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 Mk=Object.create(null);let Hr=class Xf{constructor(e,t,r,i=_e.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&&dl(this.attrs,t||e.defaultAttrs||Mk)&&_e.sameSet(this.marks,r||_e.none)}copy(e=null){return e==this.content?this:new Xf(this.type,this.attrs,e,this.marks)}mark(e){return e==this.marks?this:new Xf(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 U.empty;let i=this.resolve(e),o=this.resolve(t),a=r?0:i.sharedDepth(t),u=i.start(a),d=i.node(a).content.cut(i.pos-u,o.pos-u);return new U(d,i.depth-a,o.depth-a)}replace(e,t,r){return _k(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 js.resolveCached(this,e)}resolveNoCache(e){return js.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()+")"),Rm(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=_e.none;for(let t=0;t<this.marks.length;t++)e=this.marks[t].addToSet(e);if(!_e.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)}};Hr.prototype.text=void 0;class ga extends Hr{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):Rm(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 ga(this.type,this.attrs,this.text,e)}withText(e){return e==this.text?this:new ga(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 Rm(n,e){for(let t=n.length-1;t>=0;t--)e=n[t].type.name+"("+e+")";return e}class ei{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(e,t){let r=new Tk(e,t);if(r.next==null)return ei.empty;let i=Lm(r);r.next&&r.err("Unexpected trailing text");let o=Lk(Rk(i));return Pk(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(d=>d.createAndFill()));for(let d=0;d<a.next.length;d++){let{type:m,next:p}=a.next[d];if(!(m.isText||m.hasRequiredAttrs())&&i.indexOf(p)==-1){i.push(p);let y=o(p,u.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 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(`
6
- `)}}ei.empty=new ei(!0);class Tk{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 Lm(n){let e=[];do e.push(Ck(n));while(n.eat("|"));return e.length==1?e[0]:{type:"choice",exprs:e}}function Ck(n){let e=[];do e.push(Ak(n));while(n.next&&n.next!=")"&&n.next!="|");return e.length==1?e[0]:{type:"seq",exprs:e}}function Ak(n){let e=Nk(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=Ok(n,e);else break;return e}function Pm(n){/\D/.test(n.next)&&n.err("Expected number, got '"+n.next+"'");let e=Number(n.next);return n.pos++,e}function Ok(n,e){let t=Pm(n),r=t;return n.eat(",")&&(n.next!="}"?r=Pm(n):r=-1),n.eat("}")||n.err("Unclosed braced range"),{type:"range",min:t,max:r,expr:e}}function Ik(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 Nk(n){if(n.eat("(")){let e=Lm(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=Ik(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 Rk(n){let e=[[]];return i(o(n,0),t()),e;function t(){return e.push([])-1}function r(a,u,f){let d={term:f,to:u};return e[a].push(d),d}function i(a,u){a.forEach(f=>f.to=u)}function o(a,u){if(a.type=="choice")return a.exprs.reduce((f,d)=>f.concat(o(d,u)),[]);if(a.type=="seq")for(let f=0;;f++){let d=o(a.exprs[f],u);if(f==a.exprs.length-1)return d;i(d,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 d=0;d<a.min;d++){let m=t();i(o(a.expr,f),m),f=m}if(a.max==-1)i(o(a.expr,f),f);else for(let d=a.min;d<a.max;d++){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 Dm(n,e){return e-n}function zm(n,e){let t=[];return r(e),t.sort(Dm);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 Lk(n){let e=Object.create(null);return t(zm(n,0));function t(r){let i=[];r.forEach(a=>{n[a].forEach(({term:u,to:f})=>{if(!u)return;let d;for(let m=0;m<i.length;m++)i[m][0]==u&&(d=i[m][1]);zm(n,f).forEach(m=>{d||i.push([u,d=[]]),d.indexOf(m)==-1&&d.push(m)})})});let o=e[r.join(",")]=new ei(r.indexOf(n.length-1)>-1);for(let a=0;a<i.length;a++){let u=i[a][1].sort(Dm);o.next.push({type:i[a][0],next:e[u.join(",")]||t(u)})}return o}}function Pk(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:d}=i.next[u];a.push(f.name),o&&!(f.isText||f.hasRequiredAttrs())&&(o=!1),r.indexOf(d)==-1&&r.push(d)}o&&e.err("Only non-generatable nodes ("+a.join(", ")+") in a required position (see https://prosemirror.net/docs/guide/#generatable)")}}function Bm(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 Fm(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 $m(n){let e=Object.create(null);if(n)for(let t in n)e[t]=new Dk(n[t]);return e}let Hm=class q1{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=$m(r.attrs),this.defaultAttrs=Bm(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==ei.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:Fm(this.attrs,e)}create(e=null,t,r){if(this.isText)throw new Error("NodeType.create can't construct text nodes");return new Hr(this,this.computeAttrs(e),L.from(t),_e.setFrom(r))}createChecked(e=null,t,r){return t=L.from(t),this.checkContent(t),new Hr(this,this.computeAttrs(e),t,_e.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 Hr(this,e,t.append(o),_e.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:_e.none:e}static compile(e,t){let r=Object.create(null);e.forEach((o,a)=>r[o]=new q1(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 Dk{constructor(e){this.hasDefault=Object.prototype.hasOwnProperty.call(e,"default"),this.default=e.default}get isRequired(){return!this.hasDefault}}class ya{constructor(e,t,r,i){this.name=e,this.rank=t,this.schema=r,this.spec=i,this.attrs=$m(i.attrs),this.excluded=null;let o=Bm(this.attrs);this.instance=o?new _e(this,o):null}create(e=null){return!e&&this.instance?this.instance:new _e(this,Fm(this.attrs,e))}static compile(e,t){let r=Object.create(null),i=0;return e.forEach((o,a)=>r[o]=new ya(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 zk{constructor(e){this.cached=Object.create(null);let t=this.spec={};for(let i in e)t[i]=e[i];t.nodes=tt.from(e.nodes),t.marks=tt.from(e.marks||{}),this.nodes=Hm.compile(this.spec.nodes,this),this.marks=ya.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]=ei.parse(a,this.nodes)),o.inlineContent=o.contentMatch.inlineContent,o.markSet=u=="_"?null:u?Wm(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==""?[]:Wm(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 Hm){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 ga(r,r.defaultAttrs,e,_e.setFrom(t))}mark(e,t){return typeof e=="string"&&(e=this.marks[e]),e.create(t)}nodeFromJSON(e){return Hr.fromJSON(this,e)}markFromJSON(e){return _e.fromJSON(this,e)}nodeType(e){let t=this.nodes[e];if(!t)throw new RangeError("Unknown node type: "+e);return t}}function Wm(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 vc=class Zf{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 Gm(this,t,!1);return r.addAll(e,t.from,t.to),r.finish()}parseSlice(e,t={}){let r=new Gm(this,t,!0);return r.addAll(e,t.from,t.to),U.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($k(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=qm(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=qm(a)),a.node||a.ignore||a.mark||(a.node=i)})}return t}static fromSchema(e){return e.cached.domParser||(e.cached.domParser=new Zf(e,Zf.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},Bk={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},Vm={ol:!0,ul:!0},gl=1,yl=2,Os=4;function Km(n,e,t){return e!=null?(e?gl:0)|(e==="full"?yl:0):n&&n.whitespace=="pre"?gl|yl:t&~Os}class bl{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=_e.none,this.stashMarks=[],this.match=a||(u&Os?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&gl)){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):Wk(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 Gm{constructor(e,t,r){this.parser=e,this.options=t,this.isOpen=r,this.open=0;let i=t.topNode,o,a=Km(null,t.preserveWhitespace,0)|(r?Os:0);i?o=new bl(i.type,i.attrs,_e.none,_e.none,!0,t.topMatch||i.type.contentMatch,a):r?o=new bl(null,null,_e.none,_e.none,!0,null,a):o=new bl(e.schema.topNodeType,null,_e.none,_e.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(Hk(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&yl||r.inlineContext(e)||/[^ \t\r\n\u000c]/.test(t)){if(r.options&gl)r.options&yl?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;Vm.hasOwnProperty(r)&&this.parser.normalizeLists&&Fk(e);let o=this.options.ruleFromNode&&this.options.ruleFromNode(e)||(i=this.parser.matchTag(e,this,t));if(o?o.ignore:Bk.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(Um.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(`
8
- `))}ignoreFallback(e){e.nodeName=="BR"&&(!this.top.type||!this.top.type.inlineContent)&&this.findPlace(this.parser.schema.text("-"))}readStyles(e){let t=_e.none,r=_e.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=Km(e,i,o.options);o.options&Os&&o.content.length==0&&(a|=Os),this.nodes.push(new bl(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 d=t[u];if(d==""){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!=d&&m.groups.indexOf(d)==-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=Uk(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 Fk(n){for(let e=n.firstChild,t=null;e;e=e.nextSibling){let r=e.nodeType==1?e.nodeName.toLowerCase():null;r&&Vm.hasOwnProperty(r)&&t?(t.appendChild(e),e=t):r=="li"?t=e:r&&(t=null)}}function $k(n,e){return(n.matches||n.msMatchesSelector||n.webkitMatchesSelector||n.mozMatchesSelector).call(n,e)}function Hk(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 qm(n){let e={};for(let t in n)e[t]=n[t];return e}function Wk(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:d,next:m}=u.edge(f);if(d==e||o.indexOf(m)<0&&a(m))return!0}};if(a(i.contentMatch))return!0}}function Uk(n,e){for(let t=0;t<e.length;t++)if(n.eq(e[t]))return e[t]}class ni{constructor(e,t){this.nodes=e,this.marks=t}serializeFragment(e,t={},r){r||(r=Sc(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 d=a.marks[f];if(!this.marks[d.type.name]){f++;continue}if(!d.eq(o[u][0])||d.type.spec.spanning===!1)break;u++,f++}for(;u<o.length;)i=o.pop()[1];for(;f<a.marks.length;){let d=a.marks[f++],m=this.serializeMark(d,a.isInline,t);m&&(o.push([d,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}=ni.renderSpec(Sc(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&&ni.renderSpec(Sc(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],d=1;if(f&&typeof f=="object"&&f.nodeType==null&&!Array.isArray(f)){d=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=d;m<t.length;m++){let p=t[m];if(p===0){if(m<t.length-1||m>d)throw new RangeError("Content hole must be the only child of its parent node");return{dom:u,contentDOM:u}}else{let{dom:y,contentDOM:S}=ni.renderSpec(e,p,r);if(u.appendChild(y),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 ni(this.nodesFromSchema(e),this.marksFromSchema(e)))}static nodesFromSchema(e){let t=Jm(e.nodes);return t.text||(t.text=r=>r.text),t}static marksFromSchema(e){return Jm(e.marks)}}function Jm(n){let e={};for(let t in n){let r=n[t].spec.toDOM;r&&(e[t]=r)}return e}function Sc(n){return n.document||window.document}const jm=65535,Ym=Math.pow(2,16);function Vk(n,e){return n+e*Ym}function Xm(n){return n&jm}function Kk(n){return(n-(n&jm))/Ym}const Zm=1,Qm=2,vl=4,eg=8;class wc{constructor(e,t,r){this.pos=e,this.delInfo=t,this.recover=r}get deleted(){return(this.delInfo&eg)>0}get deletedBefore(){return(this.delInfo&(Zm|vl))>0}get deletedAfter(){return(this.delInfo&(Qm|vl))>0}get deletedAcross(){return(this.delInfo&vl)>0}}class Jt{constructor(e,t=!1){if(this.ranges=e,this.inverted=t,!e.length&&Jt.empty)return Jt.empty}recover(e){let t=0,r=Xm(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+Kk(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 d=this.ranges[u+o],m=this.ranges[u+a],p=f+d;if(e<=p){let y=d?e==f?-1:e==p?1:t:t,S=f+i+(y<0?0:m);if(r)return S;let w=e==(t<0?f:p)?null:Vk(u/3,e-f),M=e==f?Qm:e==p?Zm:vl;return(t<0?e!=f:e!=p)&&(M|=eg),new wc(S,M,w)}i+=m-d}return r?e+i:new wc(e+i,0,null)}touches(e,t){let r=0,i=Xm(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 d=this.ranges[u+o],m=f+d;if(e<=m&&u==i*3)return!0;r+=this.ranges[u+a]-d}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),d=this.ranges[i+t],m=this.ranges[i+r];e(u,u+d,f,f+m),o+=m-d}}invert(){return new Jt(this.ranges,!this.inverted)}toString(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)}static offset(e){return e==0?Jt.empty:new Jt(e<0?[0,-e,0]:[0,0,e])}}Jt.empty=new Jt([]);class qi{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 qi(this.maps,this.mirror,e,t)}copy(){return new qi(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 qi;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 wc(e,i,null)}}const xc=Object.create(null);class lt{getMap(){return Jt.empty}merge(e){return null}static fromJSON(e,t){if(!t||!t.stepType)throw new RangeError("Invalid input for Step.fromJSON");let r=xc[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 xc)throw new RangeError("Duplicate use of step JSON ID "+e);return xc[e]=t,t.prototype.jsonID=e,t}}class De{constructor(e,t){this.doc=e,this.failed=t}static ok(e){return new De(e,null)}static fail(e){return new De(null,e)}static fromReplace(e,t,r,i){try{return De.ok(e.replace(t,r,i))}catch(o){if(o instanceof hl)return De.fail(o.message);throw o}}}function _c(n,e,t){let r=[];for(let i=0;i<n.childCount;i++){let o=n.child(i);o.content.size&&(o=o.copy(_c(o.content,e,o))),o.isInline&&(o=e(o,t,i)),r.push(o)}return L.fromArray(r)}class kr extends lt{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 U(_c(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 De.fromReplace(e,this.from,this.to,o)}invert(){return new En(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 kr(t.pos,r.pos,this.mark)}merge(e){return e instanceof kr&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new kr(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 kr(t.from,t.to,e.markFromJSON(t.mark))}}lt.jsonID("addMark",kr);class En extends lt{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 U(_c(t.content,i=>i.mark(this.mark.removeFromSet(i.marks)),e),t.openStart,t.openEnd);return De.fromReplace(e,this.from,this.to,r)}invert(){return new kr(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 En(t.pos,r.pos,this.mark)}merge(e){return e instanceof En&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new En(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 En(t.from,t.to,e.markFromJSON(t.mark))}}lt.jsonID("removeMark",En);class Er extends lt{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return De.fail("No node at mark step's position");let r=t.type.create(t.attrs,null,this.mark.addToSet(t.marks));return De.fromReplace(e,this.pos,this.pos+1,new U(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 Er(this.pos,t.marks[i]);return new Er(this.pos,this.mark)}}return new Ji(this.pos,this.mark)}map(e){let t=e.mapResult(this.pos,1);return t.deletedAfter?null:new Er(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 Er(t.pos,e.markFromJSON(t.mark))}}lt.jsonID("addNodeMark",Er);class Ji extends lt{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return De.fail("No node at mark step's position");let r=t.type.create(t.attrs,null,this.mark.removeFromSet(t.marks));return De.fromReplace(e,this.pos,this.pos+1,new U(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 Er(this.pos,this.mark)}map(e){let t=e.mapResult(this.pos,1);return t.deletedAfter?null:new Ji(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 Ji(t.pos,e.markFromJSON(t.mark))}}lt.jsonID("removeNodeMark",Ji);class at extends lt{constructor(e,t,r,i=!1){super(),this.from=e,this.to=t,this.slice=r,this.structure=i}apply(e){return this.structure&&kc(e,this.from,this.to)?De.fail("Structure replace would overwrite content"):De.fromReplace(e,this.from,this.to,this.slice)}getMap(){return new Jt([this.from,this.to-this.from,this.slice.size])}invert(e){return new at(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 at(t.pos,Math.max(t.pos,r.pos),this.slice)}merge(e){if(!(e instanceof at)||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?U.empty:new U(this.slice.content.append(e.slice.content),this.slice.openStart,e.slice.openEnd);return new at(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?U.empty:new U(e.slice.content.append(this.slice.content),e.slice.openStart,this.slice.openEnd);return new at(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 at(t.from,t.to,U.fromJSON(e,t.slice),!!t.structure)}}lt.jsonID("replace",at);class Ye extends lt{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&&(kc(e,this.from,this.gapFrom)||kc(e,this.gapTo,this.to)))return De.fail("Structure gap-replace would overwrite content");let t=e.slice(this.gapFrom,this.gapTo);if(t.openStart||t.openEnd)return De.fail("Gap is not a flat range");let r=this.slice.insertAt(this.insert,t.content);return r?De.fromReplace(e,this.from,this.to,r):De.fail("Content does not fit in gap")}getMap(){return new Jt([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 Ye(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 Ye(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 Ye(t.from,t.to,t.gapFrom,t.gapTo,U.fromJSON(e,t.slice),t.insert,!!t.structure)}}lt.jsonID("replaceAround",Ye);function kc(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 Gk(n,e,t,r){let i=[],o=[],a,u;n.doc.nodesBetween(e,t,(f,d,m)=>{if(!f.isInline)return;let p=f.marks;if(!r.isInSet(p)&&m.type.allowsMarkType(r.type)){let y=Math.max(d,e),S=Math.min(d+f.nodeSize,t),w=r.addToSet(p);for(let M=0;M<p.length;M++)p[M].isInSet(w)||(a&&a.to==y&&a.mark.eq(p[M])?a.to=S:i.push(a=new En(y,S,p[M])));u&&u.to==y?u.to=S:o.push(u=new kr(y,S,r))}}),i.forEach(f=>n.step(f)),o.forEach(f=>n.step(f))}function qk(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 ya){let d=a.marks,m;for(;m=r.isInSet(d);)(f||(f=[])).push(m),d=m.removeFromSet(d)}else r?r.isInSet(a.marks)&&(f=[r]):f=a.marks;if(f&&f.length){let d=Math.min(u+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 w=i[S];w.step==o-1&&p.eq(i[S].style)&&(y=w)}y?(y.to=d,y.step=o):i.push({style:p,from:Math.max(u,e),to:d,step:o})}}}),i.forEach(a=>n.step(new En(a.from,a.to,a.style)))}function Jk(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),d=a+f.nodeSize,m=r.matchType(f.type);if(!m)o.push(new at(a,d,U.empty));else{r=m;for(let p=0;p<f.marks.length;p++)t.allowsMarkType(f.marks[p].type)||n.step(new En(a,d,f.marks[p]))}a=d}if(!r.validEnd){let u=r.fillBefore(L.empty,!0);n.replace(a,a,new U(u,0,0))}for(let u=o.length-1;u>=0;u--)n.step(o[u])}function jk(n,e,t){return(e==0||n.canReplace(e,n.childCount))&&(t==n.childCount||n.canReplace(0,t))}function Ti(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||!jk(i,o,a))break}return null}function Yk(n,e,t){let{$from:r,$to:i,depth:o}=e,a=r.before(o+1),u=i.after(o+1),f=a,d=u,m=L.empty,p=0;for(let w=o,M=!1;w>t;w--)M||r.index(w)>0?(M=!0,m=L.from(r.node(w).copy(m)),p++):f--;let y=L.empty,S=0;for(let w=o,M=!1;w>t;w--)M||i.after(w+1)<i.end(w)?(M=!0,y=L.from(i.node(w).copy(y)),S++):d++;n.step(new Ye(f,d,a,u,new U(m.append(y),p,S),m.size-p,!0))}function Ec(n,e,t=null,r=n){let i=Xk(n,e),o=i&&Zk(r,e);return o?i.map(tg).concat({type:e,attrs:t}).concat(o.map(tg)):null}function tg(n){return{type:n,attrs:null}}function Xk(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 Zk(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 d=r;f&&d<i;d++)f=f.matchType(t.child(d).type);return!f||!f.validEnd?null:a}function Qk(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 Ye(i,o,i,o,new U(r,0,0),t.length,!0))}function eE(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)&&tE(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),d=f.map(u,1),m=f.map(u+a.nodeSize,1);return n.step(new Ye(d,m,d+1,m-1,new U(L.from(r.create(i,null,a.marks)),0,0),1,!0)),!1}})}function tE(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 Ye(e,e+o.nodeSize,e+1,e+o.nodeSize-1,new U(L.from(a),0,0),1,!0))}function Ci(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 d=i.depth-1,m=t-2;d>o;d--,m--){let p=i.node(d),y=i.index(d);if(p.type.spec.isolating)return!1;let S=p.content.cutByIndex(y,p.childCount),w=r&&r[m]||p;if(w!=p&&(S=S.replaceChild(0,w.type.create(w.attrs))),!p.canReplace(y+1,p.childCount)||!w.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 rE(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,d=t-1;u>f;u--,d--){o=L.from(i.node(u).copy(o));let m=r&&r[d];a=L.from(m?m.type.create(m.attrs,a):i.node(u).copy(a))}n.step(new at(e,e,new U(o.append(a),t,t),!0))}function fr(n,e){let t=n.resolve(e),r=t.index();return ng(t.nodeBefore,t.nodeAfter)&&t.parent.canReplace(r,r+1)}function ng(n,e){return!!(n&&e&&!n.isLeaf&&n.canAppend(e))}function Sl(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&&ng(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 at(e-t,e+t,U.empty,!0);n.step(r)}function sE(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 oE(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),d=r.node(a),m=!1;if(o==1)m=d.canReplace(f,f,i);else{let p=d.contentMatchAt(f).findWrapping(i.firstChild.type);m=p&&d.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 Mc(n,e,t=e,r=U.empty){if(e==t&&!r.size)return null;let i=n.resolve(e),o=n.resolve(t);return rg(i,o,r)?new at(e,t,r):new lE(i,o,r).fit()}function rg(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 d=this.findFittable();d?this.placeNodes(d):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 U(o,a,u);return e>-1?new Ye(r.pos,e,this.$to.pos,this.$to.end(),f,t):f.size||r.pos!=this.$to.pos?new at(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=Tc(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],d,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&&(d=f.findWrapping(o.type)))return{sliceDepth:t,frontierDepth:a,parent:i,wrap:d};if(i&&f.matchType(i.type))break}}}openMore(){let{content:e,openStart:t,openEnd:r}=this.unplaced,i=Tc(e,t);return!i.childCount||i.firstChild.isLeaf?!1:(this.unplaced=new U(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=Tc(e,t);if(i.childCount<=1&&t>0){let o=e.size-t<=t+i.size;this.unplaced=new U(Is(e,t-1,1),t-1,o?t-1:r)}else this.unplaced=new U(Is(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 M=0;M<o.length;M++)this.openFrontierNode(o[M]);let a=this.unplaced,u=r?r.content:a.content,f=a.openStart-e,d=0,m=[],{match:p,type:y}=this.frontier[t];if(i){for(let M=0;M<i.childCount;M++)m.push(i.child(M));p=p.matchFragment(i)}let S=u.size+e-(a.content.size-a.openEnd);for(;d<u.childCount;){let M=u.child(d),T=p.matchType(M.type);if(!T)break;d++,(d>1||f==0||M.content.size)&&(p=T,m.push(ig(M.mark(y.allowedMarks(M.marks)),d==1?f:0,d==u.childCount?S:-1)))}let w=d==u.childCount;w||(S=-1),this.placed=Ns(this.placed,t,L.from(m)),this.frontier[t].match=p,w&&S<0&&r&&r.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let M=0,T=u;M<S;M++){let O=T.lastChild;this.frontier.push({type:O.type,match:O.contentMatchAt(O.childCount)}),T=O.content}this.unplaced=w?e==0?U.empty:new U(Is(a.content,e-1,1),e-1,S<0?a.openEnd:e-1):new U(Is(a.content,e,d),a.openStart,a.openEnd)}mustMoveInline(){if(!this.$to.parent.isTextblock)return-1;let e=this.frontier[this.depth],t;if(!e.type.isTextblock||!Cc(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=Cc(e,t,i,r,o);if(a){for(let u=t-1;u>=0;u--){let{match:f,type:d}=this.frontier[u],m=Cc(e,u,d,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=Ns(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=Ns(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=Ns(this.placed,this.frontier.length,t))}}function Is(n,e,t){return e==0?n.cutByIndex(t,n.childCount):n.replaceChild(0,n.firstChild.copy(Is(n.firstChild.content,e-1,t)))}function Ns(n,e,t){return e==0?n.append(t):n.replaceChild(n.childCount-1,n.lastChild.copy(Ns(n.lastChild.content,e-1,t)))}function Tc(n,e){for(let t=0;t<e;t++)n=n.firstChild.content;return n}function ig(n,e,t){if(e<=0)return n;let r=n.content;return e>1&&(r=r.replaceChild(0,ig(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 Cc(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&&!aE(t,o.content,a)?u:null}function aE(n,e,t){for(let r=t;r<e.childCount;r++)if(!n.allowsMarks(e.child(r).marks))return!0;return!1}function uE(n){return n.spec.defining||n.spec.definingForContent}function cE(n,e,t,r){if(!r.size)return n.deleteRange(e,t);let i=n.doc.resolve(e),o=n.doc.resolve(t);if(rg(i,o,r))return n.step(new at(e,t,r));let a=og(i,n.doc.resolve(t));a[a.length-1]==0&&a.pop();let u=-(i.depth+1);a.unshift(u);for(let y=i.depth,S=i.pos-1;y>0;y--,S--){let w=i.node(y).type.spec;if(w.defining||w.definingAsContext||w.isolating)break;a.indexOf(y)>-1?u=y:i.before(y)==S&&a.splice(1,0,-y)}let f=a.indexOf(u),d=[],m=r.openStart;for(let y=r.content,S=0;;S++){let w=y.firstChild;if(d.push(w),S==r.openStart)break;y=w.content}for(let y=m-1;y>=0;y--){let S=d[y].type,w=uE(S);if(w&&i.node(f).type!=S)m=y;else if(w||!S.isTextblock)break}for(let y=r.openStart;y>=0;y--){let S=(y+m+1)%(r.openStart+1),w=d[S];if(w)for(let M=0;M<a.length;M++){let T=a[(M+f)%a.length],O=!0;T<0&&(O=!1,T=-T);let F=i.node(T-1),B=i.index(T-1);if(F.canReplaceWith(B,B,w.type,w.marks))return n.replace(i.before(T),O?o.after(T):t,new U(sg(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 sg(n,e,t,r,i){if(e<t){let o=n.firstChild;n=n.replaceChild(0,o.copy(sg(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 fE(n,e,t,r){if(!r.isInline&&e==t&&n.doc.resolve(e).parent.content.size){let i=sE(n.doc,e,r.type);i!=null&&(e=t=i)}n.replaceRange(e,t,new U(L.from(r),0,0))}function dE(n,e,t){let r=n.doc.resolve(e),i=n.doc.resolve(t),o=og(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 og(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 ji extends lt{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 De.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 De.fromReplace(e,this.pos,this.pos+1,new U(L.from(i),0,t.isLeaf?0:1))}getMap(){return Jt.empty}invert(e){return new ji(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 ji(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 ji(t.pos,t.attr,t.value)}}lt.jsonID("attr",ji);let Ai=class extends Error{};Ai=function n(e){let t=Error.call(this,e);return t.__proto__=n.prototype,t},Ai.prototype=Object.create(Error.prototype),Ai.prototype.constructor=Ai,Ai.prototype.name="TransformError";class hE{constructor(e){this.doc=e,this.steps=[],this.docs=[],this.mapping=new qi}get before(){return this.docs.length?this.docs[0]:this.doc}step(e){let t=this.maybeStep(e);if(t.failed)throw new Ai(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=U.empty){let i=Mc(this.doc,e,t,r);return i&&this.step(i),this}replaceWith(e,t,r){return this.replace(e,t,new U(L.from(r),0,0))}delete(e,t){return this.replace(e,t,U.empty)}insert(e,t){return this.replaceWith(e,e,t)}replaceRange(e,t,r){return cE(this,e,t,r),this}replaceRangeWith(e,t,r){return fE(this,e,t,r),this}deleteRange(e,t){return dE(this,e,t),this}lift(e,t){return Yk(this,e,t),this}join(e,t=1){return iE(this,e,t),this}wrap(e,t){return Qk(this,e,t),this}setBlockType(e,t=e,r,i=null){return eE(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 ji(e,t,r)),this}addNodeMark(e,t){return this.step(new Er(e,t)),this}removeNodeMark(e,t){if(!(t instanceof _e)){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 Ji(e,t)),this}split(e,t=1,r){return rE(this,e,t,r),this}addMark(e,t,r){return Gk(this,e,t,r),this}removeMark(e,t,r){return qk(this,e,t,r),this}clearIncompatible(e,t,r){return Jk(this,e,t,r),this}}const Ac=Object.create(null);class pe{constructor(e,t,r){this.$anchor=e,this.$head=t,this.ranges=r||[new pE(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=U.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:d}=a[u],m=e.mapping.slice(o);e.replaceRange(m.map(f.pos),m.map(d.pos),u?U.empty:t),u==0&&ug(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),d=f.map(a.pos),m=f.map(u.pos);o?e.deleteRange(d,m):(e.replaceRangeWith(d,m,t),ug(e,r,t.isInline?-1:1))}}static findFrom(e,t,r=!1){let i=e.parent.inlineContent?new me(e):Oi(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?Oi(e.node(0),e.node(o),e.before(o+1),e.index(o),t,r):Oi(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 dn(e.node(0))}static atStart(e){return Oi(e,e,0,0,1)||new dn(e)}static atEnd(e){return Oi(e,e,e.content.size,e.childCount,-1)||new dn(e)}static fromJSON(e,t){if(!t||!t.type)throw new RangeError("Invalid input for Selection.fromJSON");let r=Ac[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 Ac)throw new RangeError("Duplicate use of selection JSON ID "+e);return Ac[e]=t,t.prototype.jsonID=e,t}getBookmark(){return me.between(this.$anchor,this.$head).getBookmark()}}pe.prototype.visible=!0;class pE{constructor(e,t){this.$from=e,this.$to=t}}let lg=!1;function ag(n){!lg&&!n.parent.inlineContent&&(lg=!0,console.warn("TextSelection endpoint not pointing into a node with inline content ("+n.parent.type.name+")"))}class me extends pe{constructor(e,t=e){ag(e),ag(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 pe.near(r);let i=e.resolve(t.map(this.anchor));return new me(i.parent.inlineContent?i:r,r)}replace(e,t=U.empty){if(super.replace(e,t),t==U.empty){let r=this.$from.marksAcross(this.$to);r&&e.ensureMarks(r)}}eq(e){return e instanceof me&&e.anchor==this.anchor&&e.head==this.head}getBookmark(){return new ba(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 me(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=pe.findFrom(t,r,!0)||pe.findFrom(t,-r,!0);if(o)t=o.$head;else return pe.near(t,r)}return e.parent.inlineContent||(i==0?e=t:(e=(pe.findFrom(e,-r,!0)||pe.findFrom(e,r,!0)).$anchor,e.pos<t.pos!=i<0&&(e=t))),new me(e,t)}}pe.jsonID("text",me);class ba{constructor(e,t){this.anchor=e,this.head=t}map(e){return new ba(e.map(this.anchor),e.map(this.head))}resolve(e){return me.between(e.resolve(this.anchor),e.resolve(this.head))}}class Z extends pe{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?pe.near(o):new Z(o)}content(){return new U(L.from(this.node),0,0)}eq(e){return e instanceof Z&&e.anchor==this.anchor}toJSON(){return{type:"node",anchor:this.anchor}}getBookmark(){return new Qf(this.anchor)}static fromJSON(e,t){if(typeof t.anchor!="number")throw new RangeError("Invalid input for NodeSelection.fromJSON");return new Z(e.resolve(t.anchor))}static create(e,t){return new Z(e.resolve(t))}static isSelectable(e){return!e.isText&&e.type.spec.selectable!==!1}}Z.prototype.visible=!1,pe.jsonID("node",Z);class Qf{constructor(e){this.anchor=e}map(e){let{deleted:t,pos:r}=e.mapResult(this.anchor);return t?new ba(r,r):new Qf(r)}resolve(e){let t=e.resolve(this.anchor),r=t.nodeAfter;return r&&Z.isSelectable(r)?new Z(t):pe.near(t)}}class dn extends pe{constructor(e){super(e.resolve(0),e.resolve(e.content.size))}replace(e,t=U.empty){if(t==U.empty){e.delete(0,e.doc.content.size);let r=pe.atStart(e.doc);r.eq(e.selection)||e.setSelection(r)}else super.replace(e,t)}toJSON(){return{type:"all"}}static fromJSON(e){return new dn(e)}map(e){return new dn(e)}eq(e){return e instanceof dn}getBookmark(){return mE}}pe.jsonID("all",dn);const mE={map(){return this},resolve(n){return new dn(n)}};function Oi(n,e,t,r,i,o=!1){if(e.inlineContent)return me.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&&Z.isSelectable(u))return Z.create(n,t-(i<0?u.nodeSize:0))}else{let f=Oi(n,u,t+i,i<0?u.childCount:0,i,o);if(f)return f}t+=u.nodeSize*i}return null}function ug(n,e,t){let r=n.steps.length-1;if(r<e)return;let i=n.steps[r];if(!(i instanceof at||i instanceof Ye))return;let o=n.mapping.maps[r],a;o.forEach((u,f,d,m)=>{a==null&&(a=m)}),n.setSelection(pe.near(n.doc.resolve(a),t))}function cg(n,e){return!e||!n?n:n.bind(e)}class wl{constructor(e,t,r){this.name=e,this.init=cg(t.init,r),this.apply=cg(t.apply,r)}}new wl("doc",{init(n){return n.doc||n.schema.topNodeType.createAndFill()},apply(n){return n.doc}}),new wl("selection",{init(n,e){return n.selection||pe.atStart(e.doc)},apply(n){return n.selection}}),new wl("storedMarks",{init(n){return n.storedMarks||null},apply(n,e,t,r){return r.selection.$cursor?n.storedMarks:null}}),new wl("scrollToSelection",{init(){return 0},apply(n,e){return n.scrolledIntoView?e+1:e}});function fg(n,e,t){for(let r in n){let i=n[r];i instanceof Function?i=i.bind(e):r=="handleDOMEvents"&&(i=fg(i,e,{})),t[r]=i}return t}class At{constructor(e){this.spec=e,this.props={},e.props&&fg(e.props,this,this.props),this.key=e.key?e.key.key:dg("plugin")}getState(e){return e[this.key]}}const Oc=Object.create(null);function dg(n){return n in Oc?n+"$"+ ++Oc[n]:(Oc[n]=0,n+"$")}class an{constructor(e="key"){this.key=dg(e)}get(e){return e.config.pluginsByKey[this.key]}getState(e){return e[this.key]}}const Rs=function(n){for(var e=0;;e++)if(n=n.previousSibling,!n)return e},hg=function(n,e,t,r){return t&&(pg(n,e,t,r,-1)||pg(n,e,t,r,1))},gE=/^(img|br|input|textarea|hr)$/i;function pg(n,e,t,r,i){for(;;){if(n==t&&e==r)return!0;if(e==(i<0?0:xl(n))){let o=n.parentNode;if(!o||o.nodeType!=1||bE(n)||gE.test(n.nodeName)||n.contentEditable=="false")return!1;e=Rs(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?xl(n):0}else return!1}}function xl(n){return n.nodeType==3?n.nodeValue.length:n.childNodes.length}function yE(n,e,t){for(let r=e==0,i=e==xl(n);r||i;){if(n==t)return!0;let o=Rs(n);if(n=n.parentNode,!n)return!1;r=r&&o==0,i=i&&o==xl(n)}}function bE(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 mg=function(n){return n.focusNode&&hg(n.focusNode,n.focusOffset,n.anchorNode,n.anchorOffset)};function gg(n,e){let t=document.createEvent("Event");return t.initEvent("keydown",!0,!0),t.keyCode=n,t.key=t.code=e,t}const dr=typeof navigator<"u"?navigator:null,yg=typeof document<"u"?document:null,hr=dr&&dr.userAgent||"",Ic=/Edge\/(\d+)/.exec(hr),bg=/MSIE \d/.exec(hr),Nc=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(hr),Ls=!!(bg||Nc||Ic),vg=bg?document.documentMode:Nc?+Nc[1]:Ic?+Ic[1]:0,_l=!Ls&&/gecko\/(\d+)/i.test(hr);_l&&+(/Firefox\/(\d+)/.exec(hr)||[0,0])[1];const Rc=!Ls&&/Chrome\/(\d+)/.exec(hr),Ii=!!Rc,vE=Rc?+Rc[1]:0,Wr=!Ls&&!!dr&&/Apple Computer/.test(dr.vendor),Lc=Wr&&(/Mobile\/\w+/.test(hr)||!!dr&&dr.maxTouchPoints>2),Vt=Lc||(dr?/Mac/.test(dr.platform):!1),Ps=/Android \d/.test(hr),Pc=!!yg&&"webkitFontSmoothing"in yg.documentElement.style,SE=Pc?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function wE(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,d;if(mg(t)){for(f=u;i&&!i.node;)i=i.parent;let m=i.node;if(i&&m.isAtom&&Z.isSelectable(m)&&i.parent&&!(m.isInline&&yE(t.focusNode,t.focusOffset,i.dom))){let p=i.posBefore;d=new Z(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(!d){let m=e=="pointer"||n.state.selection.head<u.pos&&!o?1:-1;d=Eg(n,f,u,m)}return d}function Sg(n){return n.editable?n.hasFocus():EE(n)&&document.activeElement&&document.activeElement.contains(n.dom)}function Dc(n,e=!1){let t=n.state.selection;if(kE(n,t),!!Sg(n)){if(!e&&n.input.mouseDown&&n.input.mouseDown.allowDefault&&Ii){let r=n.domSelectionRange(),i=n.domObserver.currentSelection;if(r.anchorNode&&i.anchorNode&&hg(r.anchorNode,r.anchorOffset,i.anchorNode,i.anchorOffset)){n.input.mouseDown.delayedSelectionSync=!0,n.domObserver.setCurSelection();return}}if(n.domObserver.disconnectSelection(),n.cursorWrapper)_E(n);else{let{anchor:r,head:i}=t,o,a;wg&&!(t instanceof me)&&(t.$from.parent.inlineContent||(o=xg(n,t.from)),!t.empty&&!t.$from.parent.inlineContent&&(a=xg(n,t.to))),n.docView.setSelection(r,i,n.root,e),wg&&(o&&_g(o),a&&_g(a)),t.visible?n.dom.classList.remove("ProseMirror-hideselection"):(n.dom.classList.add("ProseMirror-hideselection"),"onselectionchange"in document&&xE(n))}n.domObserver.setCurSelection(),n.domObserver.connectSelection()}}const wg=Wr||Ii&&vE<63;function xg(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(Wr&&i&&i.contentEditable=="false")return zc(i);if((!i||i.contentEditable=="false")&&(!o||o.contentEditable=="false")){if(i)return zc(i);if(o)return zc(o)}}function zc(n){return n.contentEditable="true",Wr&&n.draggable&&(n.draggable=!1,n.wasDraggable=!0),n}function _g(n){n.contentEditable="false",n.wasDraggable&&(n.draggable=!0,n.wasDraggable=null)}function xE(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(()=>{(!Sg(n)||n.state.selection.visible)&&n.dom.classList.remove("ProseMirror-hideselection")},20))})}function _E(n){let e=n.domSelection(),t=document.createRange(),r=n.cursorWrapper.dom,i=r.nodeName=="IMG";i?t.setEnd(r.parentNode,Rs(r)+1):t.setEnd(r,0),t.collapse(!1),e.removeAllRanges(),e.addRange(t),!i&&!n.state.selection.visible&&Ls&&vg<=11&&(r.disabled=!0,r.disabled=!1)}function kE(n,e){if(e instanceof Z){let t=n.docView.descAt(e.from);t!=n.lastSelectedViewDesc&&(kg(n),t&&t.selectNode(),n.lastSelectedViewDesc=t)}else kg(n)}function kg(n){n.lastSelectedViewDesc&&(n.lastSelectedViewDesc.parent&&n.lastSelectedViewDesc.deselectNode(),n.lastSelectedViewDesc=void 0)}function Eg(n,e,t,r){return n.someProp("createSelectionBetween",i=>i(n,e,t))||me.between(e,t,r)}function EE(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 Bc(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&&pe.findFrom(o,e)}function Ur(n,e){return n.dispatch(n.state.tr.setSelection(e).scrollIntoView()),!0}function Mg(n,e,t){let r=n.state.selection;if(r instanceof me){if(!r.empty||t.indexOf("s")>-1)return!1;if(n.endOfTextblock(e>0?"right":"left")){let i=Bc(n.state,e);return i&&i instanceof Z?Ur(n,i):!1}else if(!(Vt&&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?Z.isSelectable(o)?Ur(n,new Z(e<0?n.state.doc.resolve(i.pos-o.nodeSize):i)):Pc?Ur(n,new me(n.state.doc.resolve(e<0?u:u+o.nodeSize))):!1:!1}}else{if(r instanceof Z&&r.node.isInline)return Ur(n,new me(e>0?r.$to:r.$from));{let i=Bc(n.state,e);return i?Ur(n,i):!1}}}function kl(n){return n.nodeType==3?n.nodeValue.length:n.childNodes.length}function Ds(n){let e=n.pmViewDesc;return e&&e.size==0&&(n.nextSibling||n.nodeName!="BR")}function Fc(n){let e=n.domSelectionRange(),t=e.focusNode,r=e.focusOffset;if(!t)return;let i,o,a=!1;for(_l&&t.nodeType==1&&r<kl(t)&&Ds(t.childNodes[r])&&(a=!0);;)if(r>0){if(t.nodeType!=1)break;{let u=t.childNodes[r-1];if(Ds(u))i=t,o=--r;else if(u.nodeType==3)t=u,r=t.nodeValue.length;else break}}else{if(Tg(t))break;{let u=t.previousSibling;for(;u&&Ds(u);)i=t.parentNode,o=Rs(u),u=u.previousSibling;if(u)t=u,r=kl(t);else{if(t=t.parentNode,t==n.dom)break;r=0}}}a?Hc(n,t,r):i&&Hc(n,i,o)}function $c(n){let e=n.domSelectionRange(),t=e.focusNode,r=e.focusOffset;if(!t)return;let i=kl(t),o,a;for(;;)if(r<i){if(t.nodeType!=1)break;let u=t.childNodes[r];if(Ds(u))o=t,a=++r;else break}else{if(Tg(t))break;{let u=t.nextSibling;for(;u&&Ds(u);)o=u.parentNode,a=Rs(u)+1,u=u.nextSibling;if(u)t=u,r=0,i=kl(t);else{if(t=t.parentNode,t==n.dom)break;r=i=0}}}o&&Hc(n,o,a)}function Tg(n){let e=n.pmViewDesc;return e&&e.node&&e.node.isBlock}function Hc(n,e,t){let r=n.domSelection();if(mg(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&&Dc(n)},50)}function Cg(n,e,t){let r=n.state.selection;if(r instanceof me&&!r.empty||t.indexOf("s")>-1||Vt&&t.indexOf("m")>-1)return!1;let{$from:i,$to:o}=r;if(!i.parent.inlineContent||n.endOfTextblock(e<0?"up":"down")){let a=Bc(n.state,e);if(a&&a instanceof Z)return Ur(n,a)}if(!i.parent.inlineContent){let a=e<0?i:o,u=r instanceof dn?pe.near(a,e):pe.findFrom(a,e);return u?Ur(n,u):!1}return!1}function Ag(n,e){if(!(n.state.selection instanceof me))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 Og(n,e,t){n.domObserver.stop(),e.contentEditable=t,n.domObserver.start()}function ME(n){if(!Wr||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;Og(n,r,"true"),setTimeout(()=>Og(n,r,"false"),20)}return!1}function TE(n){let e="";return n.ctrlKey&&(e+="c"),n.metaKey&&(e+="m"),n.altKey&&(e+="a"),n.shiftKey&&(e+="s"),e}function CE(n,e){let t=e.keyCode,r=TE(e);return t==8||Vt&&t==72&&r=="c"?Ag(n,-1)||Fc(n):t==46||Vt&&t==68&&r=="c"?Ag(n,1)||$c(n):t==13||t==27?!0:t==37||Vt&&t==66&&r=="c"?Mg(n,-1,r)||Fc(n):t==39||Vt&&t==70&&r=="c"?Mg(n,1,r)||$c(n):t==38||Vt&&t==80&&r=="c"?Cg(n,-1,r)||Fc(n):t==40||Vt&&t==78&&r=="c"?ME(n)||Cg(n,1,r)||$c(n):r==(Vt?"m":"c")&&(t==66||t==73||t==89||t==90)}function Ig(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")||ni.fromSchema(n.state.schema),u=Fg(),f=u.createElement("div");f.appendChild(a.serializeFragment(r,{document:u}));let d=f.firstChild,m,p=0;for(;d&&d.nodeType==1&&(m=zg[d.nodeName.toLowerCase()]);){for(let S=m.length-1;S>=0;S--){let w=u.createElement(m[S]);for(;f.firstChild;)w.appendChild(f.firstChild);f.appendChild(w),p++}d=f.firstChild}d&&d.nodeType==1&&d.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,`
4
+ `],...A_(t))}),e}function A_({vnode:n,recurseCount:e}){const t=e>0?`... (${e} recursive calls)`:"",r=n.component?n.component.parent==null:!1,i=` at <${Em(n.component,n.type,r)}`,o=">"+t;return n.props?[i,...O_(n.props),o]:[i+o]}function O_(n){const e=[],t=Object.keys(n);return t.slice(0,3).forEach(r=>{e.push(...nm(r,n[r]))}),t.length>3&&e.push(" ..."),e}function nm(n,e,t){return on(e)?(e=JSON.stringify(e),t?e:[`${n}=${e}`]):typeof e=="number"||typeof e=="boolean"||e==null?t?e:[`${n}=${e}`]:et(e)?(e=nm(n,ce(e.value),!0),t?e:[`${n}=Ref<`,e,">"]):Le(e)?[`${n}=fn${e.name?`<${e.name}>`:""}`]:(e=ce(e),t?e:[`${n}=`,e])}const rm={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 nl(n,e,t,r){try{return r?n(...r):n()}catch(i){lc(i,e,t)}}function im(n,e,t,r){if(Le(n)){const i=nl(n,e,t,r);return i&&zx(i)&&i.catch(o=>{lc(o,e,t)}),i}if(ke(n)){const i=[];for(let o=0;o<n.length;o++)i.push(im(n[o],e,t,r));return i}else process.env.NODE_ENV!=="production"&&Ce(`Invalid value type passed to callWithAsyncErrorHandling(): ${typeof n}`)}function lc(n,e,t,r=!0){const i=e?e.vnode:null,{errorHandler:o,throwUnhandledErrorInProduction:a}=e&&e.appContext.config||Wt;if(e){let u=e.parent;const f=e.proxy,h=process.env.NODE_ENV!=="production"?rm[t]:`https://vuejs.org/error-reference/#runtime-${t}`;for(;u;){const m=u.ec;if(m){for(let p=0;p<m.length;p++)if(m[p](n,f,h)===!1)return}u=u.parent}if(o){Go(),nl(o,null,10,[n,f,h]),qo();return}}I_(n,t,i,r,a)}function I_(n,e,t,r=!0,i=!1){if(process.env.NODE_ENV!=="production"){const o=rm[e];if(t&&k_(t),Ce(`Unhandled error${o?` during execution of ${o}`:""}`),t&&M_(),r)throw n;console.error(n)}else{if(i)throw n;console.error(n)}}const Ut=[];let Hn=-1;const _i=[];let cr=null,Ei=0;const sm=Promise.resolve();let rl=null;const N_=100;function R_(n){const e=rl||sm;return n?e.then(this?n.bind(this):n):e}function L_(n){let e=Hn+1,t=Ut.length;for(;e<t;){const r=e+t>>>1,i=Ut[r],o=ks(i);o<n||o===n&&i.flags&2?e=r+1:t=r}return e}function ac(n){if(!(n.flags&1)){const e=ks(n),t=Ut[Ut.length-1];!t||!(n.flags&2)&&e>=ks(t)?Ut.push(n):Ut.splice(L_(e),0,n),n.flags|=1,om()}}function om(){rl||(rl=sm.then(am))}function lm(n){ke(n)?_i.push(...n):cr&&n.id===-1?cr.splice(Ei+1,0,n):n.flags&1||(_i.push(n),n.flags|=1),om()}function P_(n){if(_i.length){const e=[...new Set(_i)].sort((t,r)=>ks(t)-ks(r));if(_i.length=0,cr){cr.push(...e);return}for(cr=e,process.env.NODE_ENV!=="production"&&(n=n||new Map),Ei=0;Ei<cr.length;Ei++){const t=cr[Ei];process.env.NODE_ENV!=="production"&&um(n,t)||(t.flags&4&&(t.flags&=-2),t.flags&8||t(),t.flags&=-2)}cr=null,Ei=0}}const ks=n=>n.id==null?n.flags&2?-1:1/0:n.id;function am(n){process.env.NODE_ENV!=="production"&&(n=n||new Map);const e=process.env.NODE_ENV!=="production"?t=>um(n,t):Pr;try{for(Hn=0;Hn<Ut.length;Hn++){const t=Ut[Hn];if(t&&!(t.flags&8)){if(process.env.NODE_ENV!=="production"&&e(t))continue;t.flags&4&&(t.flags&=-2),nl(t,t.i,t.i?15:14),t.flags&4||(t.flags&=-2)}}}finally{for(;Hn<Ut.length;Hn++){const t=Ut[Hn];t&&(t.flags&=-2)}Hn=-1,Ut.length=0,P_(n),rl=null,(Ut.length||_i.length)&&am(n)}}function um(n,e){const t=n.get(e)||0;if(t>N_){const r=e.i,i=r&&_m(r.type);return lc(`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 uc=new Map;process.env.NODE_ENV!=="production"&&(Ko().__VUE_HMR_RUNTIME__={createRecord:cc(D_),rerender:cc(z_),reload:cc(B_)});const il=new Map;function D_(n,e){return il.has(n)?!1:(il.set(n,{initialDef:sl(e),instances:new Set}),!0)}function sl(n){return km(n)?n.__vccOpts:n}function z_(n,e){const t=il.get(n);t&&(t.initialDef.render=e,[...t.instances].forEach(r=>{e&&(r.render=e,sl(r.type).render=e),r.renderCache=[],r.update()}))}function B_(n,e){const t=il.get(n);if(!t)return;e=sl(e),cm(t.initialDef,e);const r=[...t.instances];for(let i=0;i<r.length;i++){const o=r[i],a=sl(o.type);let u=uc.get(a);u||(a!==t.initialDef&&cm(a,e),uc.set(a,u=new Set)),u.add(o),o.appContext.propsCache.delete(o.type),o.appContext.emitsCache.delete(o.type),o.appContext.optionsCache.delete(o.type),o.ceReload?(u.add(o),o.ceReload(e.styles),u.delete(o)):o.parent?ac(()=>{o.parent.update(),u.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)}lm(()=>{uc.clear()})}function cm(n,e){Ct(n,e);for(const t in n)t!=="__file"&&!(t in e)&&delete n[t]}function cc(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 ki,ol=[];function fm(n,e){var t,r;ki=n,ki?(ki.enabled=!0,ol.forEach(({event:i,args:o})=>ki.emit(i,...o)),ol=[]):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=>{fm(o,e)}),setTimeout(()=>{ki||(e.__VUE_DEVTOOLS_HOOK_REPLAY__=null,ol=[])},3e3)):ol=[]}let bn=null,F_=null;const $_=n=>n.__isTeleport;function hm(n,e){n.shapeFlag&6&&n.component?(n.transition=e,hm(n.component.subTree,e)):n.shapeFlag&128?(n.ssContent.transition=e.clone(n.ssContent),n.ssFallback.transition=e.clone(n.ssFallback)):n.transition=e}Ko().requestIdleCallback,Ko().cancelIdleCallback;const H_=Symbol.for("v-ndc"),fc=n=>n?yE(n)?bE(n):fc(n.parent):null,Ms=Ct(Object.create(null),{$:n=>n,$el:n=>n.vnode.el,$data:n=>n.data,$props:n=>process.env.NODE_ENV!=="production"?Xo(n.props):n.props,$attrs:n=>process.env.NODE_ENV!=="production"?Xo(n.attrs):n.attrs,$slots:n=>process.env.NODE_ENV!=="production"?Xo(n.slots):n.slots,$refs:n=>process.env.NODE_ENV!=="production"?Xo(n.refs):n.refs,$parent:n=>fc(n.parent),$root:n=>fc(n.root),$host:n=>n.ce,$emit:n=>n.emit,$options:n=>__VUE_OPTIONS_API__?K_(n):n.type,$forceUpdate:n=>n.f||(n.f=()=>{ac(n.update)}),$nextTick:n=>n.n||(n.n=R_.bind(n.proxy)),$watch:n=>__VUE_OPTIONS_API__?nE.bind(n):Pr}),W_=n=>n==="_"||n==="$",hc=(n,e)=>n!==Wt&&!n.__isScriptSetup&&Re(n,e),U_={get({_:n},e){if(e==="__v_skip")return!0;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(hc(r,e))return a[e]=1,r[e];if(i!==Wt&&Re(i,e))return a[e]=2,i[e];if((h=n.propsOptions[0])&&Re(h,e))return a[e]=3,o[e];if(t!==Wt&&Re(t,e))return a[e]=4,t[e];(!__VUE_OPTIONS_API__||V_)&&(a[e]=0)}}const m=Ms[e];let p,y;if(m)return e==="$attrs"?(Ge(n.attrs,"get",""),process.env.NODE_ENV!=="production"&&void 0):process.env.NODE_ENV!=="production"&&e==="$slots"&&Ge(n,"get",e),m(n);if((p=u.__cssModules)&&(p=p[e]))return p;if(t!==Wt&&Re(t,e))return a[e]=4,t[e];if(y=f.config.globalProperties,Re(y,e))return y[e];process.env.NODE_ENV!=="production"&&bn&&(!on(e)||e.indexOf("__v")!==0)&&(i!==Wt&&W_(e[0])&&Re(i,e)?Ce(`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===bn&&Ce(`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 hc(i,e)?(i[e]=t,!0):process.env.NODE_ENV!=="production"&&i.__isScriptSetup&&Re(i,e)?(Ce(`Cannot mutate <script setup> binding "${e}" from Options API.`),!1):r!==Wt&&Re(r,e)?(r[e]=t,!0):Re(n.props,e)?(process.env.NODE_ENV!=="production"&&Ce(`Attempting to mutate prop "${e}". Props are readonly.`),!1):e[0]==="$"&&e.slice(1)in n?(process.env.NODE_ENV!=="production"&&Ce(`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!==Wt&&Re(n,a)||hc(e,a)||(u=o[0])&&Re(u,a)||Re(r,a)||Re(Ms,a)||Re(i.config.globalProperties,a)},defineProperty(n,e,t){return t.get!=null?n._.accessCache[e]=0:Re(t,"value")&&this.set(n,e,t.value,null),Reflect.defineProperty(n,e,t)}};process.env.NODE_ENV!=="production"&&(U_.ownKeys=n=>(Ce("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 dm(n){return ke(n)?n.reduce((e,t)=>(e[t]=null,e),{}):n}let V_=!0;function K_(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=>ll(f,h,a,!0)),ll(f,e,a)),ht(e)&&o.set(e,f),f}function ll(n,e,t,r=!1){const{mixins:i,extends:o}=e;o&&ll(n,o,t,!0),i&&i.forEach(a=>ll(n,a,t,!0));for(const a in e)if(r&&a==="expose")process.env.NODE_ENV!=="production"&&Ce('"expose" option is ignored when declared in mixins or extends. It should only be declared in the base component itself.');else{const u=G_[a]||t&&t[a];n[a]=u?u(n[a],e[a]):e[a]}return n}const G_={data:pm,props:gm,emits:gm,methods:Ts,computed:Ts,beforeCreate:pt,created:pt,beforeMount:pt,mounted:pt,beforeUpdate:pt,updated:pt,beforeDestroy:pt,beforeUnmount:pt,destroyed:pt,unmounted:pt,activated:pt,deactivated:pt,errorCaptured:pt,serverPrefetch:pt,components:Ts,directives:Ts,watch:J_,provide:pm,inject:q_};function pm(n,e){return e?n?function(){return Ct(Le(n)?n.call(this,this):n,Le(e)?e.call(this,this):e)}:e:n}function q_(n,e){return Ts(mm(n),mm(e))}function mm(n){if(ke(n)){const e={};for(let t=0;t<n.length;t++)e[n[t]]=n[t];return e}return n}function pt(n,e){return n?[...new Set([].concat(n,e))]:e}function Ts(n,e){return n?Ct(Object.create(null),n,e):e}function gm(n,e){return n?ke(n)&&ke(e)?[...new Set([...n,...e])]:Ct(Object.create(null),dm(n),dm(e??{})):e}function J_(n,e){if(!n)return e;if(!e)return n;const t=Ct(Object.create(null),n);for(const r in e)t[r]=pt(n[r],e[r]);return t}let j_=null;function Y_(n,e,t=!1){const r=Cs||bn;if(r||j_){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&&Le(e)?e.call(r&&r.proxy):e;process.env.NODE_ENV!=="production"&&Ce(`injection "${String(n)}" not found.`)}else process.env.NODE_ENV!=="production"&&Ce("inject() can only be used inside setup() or functional components.")}const X_={},ym=n=>Object.getPrototypeOf(n)===X_,Z_=sE,Q_=Symbol.for("v-scx"),eE=()=>{{const n=Y_(Q_);return n||process.env.NODE_ENV!=="production"&&Ce("Server rendering context not provided. Make sure to only call useSSRContext() conditionally in the server build."),n}};function tE(n,e,t){return process.env.NODE_ENV!=="production"&&!Le(e)&&Ce("`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."),bm(n,e,t)}function bm(n,e,t=Wt){const{immediate:r,deep:i,flush:o,once:a}=t;process.env.NODE_ENV!=="production"&&!e&&(r!==void 0&&Ce('watch() "immediate" option is only respected when using the watch(source, callback, options?) signature.'),i!==void 0&&Ce('watch() "deep" option is only respected when using the watch(source, callback, options?) signature.'),a!==void 0&&Ce('watch() "once" option is only respected when using the watch(source, callback, options?) signature.'));const u=Ct({},t);process.env.NODE_ENV!=="production"&&(u.onWarn=Ce);const f=e&&r||!e&&o!=="post";let h;if(cl){if(o==="sync"){const S=eE();h=S.__watcherHandles||(S.__watcherHandles=[])}else if(!f){const S=()=>{};return S.stop=Pr,S.resume=Pr,S.pause=Pr,S}}const m=Cs;u.call=(S,w,M)=>im(S,m,w,M);let p=!1;o==="post"?u.scheduler=S=>{Z_(S,m&&m.suspense)}:o!=="sync"&&(p=!0,u.scheduler=(S,w)=>{w?S():ac(S)}),u.augmentJob=S=>{e&&(S.flags|=4),p&&(S.flags|=2,m&&(S.id=m.uid,S.i=m))};const y=E_(n,e,u);return cl&&(h?h.push(y):f&&y()),y}function nE(n,e,t){const r=this.proxy,i=on(n)?n.includes(".")?rE(r,n):()=>r[n]:n.bind(r,r);let o;Le(e)?o=e:(o=e.handler,t=e);const a=gE(this),u=bm(i,o.bind(r),t);return a(),u}function rE(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 hI(){}const iE=n=>n.__isSuspense;function sE(n,e){e&&e.pendingBranch?ke(n)?e.effects.push(...n):e.effects.push(n):lm(n)}const vm=Symbol.for("v-fgt"),oE=Symbol.for("v-txt"),lE=Symbol.for("v-cmt");let Mi=null;function aE(n){return n?n.__v_isVNode===!0:!1}const uE=(...n)=>wm(...n),Sm=({key:n})=>n??null,al=({ref:n,ref_key:e,ref_for:t})=>(typeof n=="number"&&(n=""+n),n!=null?on(n)||et(n)||Le(n)?{i:bn,r:n,k:e,f:!!t}:n:null);function cE(n,e=null,t=null,r=0,i=null,o=n===vm?0:1,a=!1,u=!1){const f={__v_isVNode:!0,__v_skip:!0,type:n,props:e,key:e&&Sm(e),ref:e&&al(e),scopeId:F_,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:bn};return u?(dc(f,t),o&128&&n.normalize(f)):t&&(f.shapeFlag|=on(t)?8:16),process.env.NODE_ENV!=="production"&&f.key!==f.key&&Ce("VNode created with invalid key (NaN). VNode type:",f.type),!a&&Mi&&(f.patchFlag>0||o&6)&&f.patchFlag!==32&&Mi.push(f),f}const fE=process.env.NODE_ENV!=="production"?uE:wm;function wm(n,e=null,t=null,r=0,i=null,o=!1){if((!n||n===H_)&&(process.env.NODE_ENV!=="production"&&!n&&Ce(`Invalid vnode type when creating vnode: ${n}.`),n=lE),aE(n)){const u=ul(n,e,!0);return t&&dc(u,t),!o&&Mi&&(u.shapeFlag&6?Mi[Mi.indexOf(n)]=u:Mi.push(u)),u.patchFlag=-2,u}if(km(n)&&(n=n.__vccOpts),e){e=hE(e);let{class:u,style:f}=e;u&&!on(u)&&(e.class=Vu(u)),ht(f)&&(Zo(f)&&!ke(f)&&(f=Ct({},f)),e.style=Uu(f))}const a=on(n)?1:iE(n)?128:$_(n)?64:ht(n)?4:Le(n)?2:0;return process.env.NODE_ENV!=="production"&&a&4&&Zo(n)&&(n=ce(n),Ce("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)),cE(n,e,t,r,i,a,o,!0)}function hE(n){return n?Zo(n)||ym(n)?Ct({},n):n:null}function ul(n,e,t=!1,r=!1){const{props:i,ref:o,patchFlag:a,children:u,transition:f}=n,h=e?pE(i||{},e):i,m={__v_isVNode:!0,__v_skip:!0,type:n.type,props:h,key:h&&Sm(h),ref:e&&e.ref?t&&o?ke(o)?o.concat(al(e)):[o,al(e)]:al(e):o,scopeId:n.scopeId,slotScopeIds:n.slotScopeIds,children:process.env.NODE_ENV!=="production"&&a===-1&&ke(u)?u.map(xm):u,target:n.target,targetStart:n.targetStart,targetAnchor:n.targetAnchor,staticCount:n.staticCount,shapeFlag:n.shapeFlag,patchFlag:e&&n.type!==vm?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&&ul(n.ssContent),ssFallback:n.ssFallback&&ul(n.ssFallback),el:n.el,anchor:n.anchor,ctx:n.ctx,ce:n.ce};return f&&r&&hm(m,f.clone(m)),m}function xm(n){const e=ul(n);return ke(n.children)&&(e.children=n.children.map(xm)),e}function dE(n=" ",e=0){return fE(oE,null,n,e)}function dc(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),dc(n,i()),i._c&&(i._d=!0));return}else{t=32;const i=e._;!i&&!ym(e)?e._ctx=bn:i===3&&bn&&(bn.slots._===1?e._=1:(e._=2,n.patchFlag|=1024))}else Le(e)?(e={default:e,_ctx:bn},t=32):(e=String(e),r&64?(t=16,e=[dE(e)]):t=8);n.children=e,n.shapeFlag|=t}function pE(...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=Vu([e.class,r.class]));else if(i==="style")e.style=Uu([e.style,r.style]);else if(Lx(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 Cs=null;const mE=()=>Cs||bn;let pc;{const n=Ko(),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)}};pc=e("__VUE_INSTANCE_SETTERS__",t=>Cs=t),e("__VUE_SSR_SETTERS__",t=>cl=t)}const gE=n=>{const e=Cs;return pc(n),n.scope.on(),()=>{n.scope.off(),pc(e)}};function yE(n){return n.vnode.shapeFlag&4}let cl=!1;process.env.NODE_ENV;function bE(n){return n.exposed?n.exposeProxy||(n.exposeProxy=new Proxy(y_(d_(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 vE=/(?:^|[-_])(\w)/g,SE=n=>n.replace(vE,e=>e.toUpperCase()).replace(/[-_]/g,"");function _m(n,e=!0){return Le(n)?n.displayName||n.name:n.name||e&&n.__name}function Em(n,e,t=!1){let r=_m(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?SE(r):t?"App":"Anonymous"}function km(n){return Le(n)&&"__vccOpts"in n}const de=(n,e)=>{const t=x_(n,e,cl);if(process.env.NODE_ENV!=="production"){const r=mE();r&&r.appContext.config.warnRecursiveComputed&&(t._warnRecursive=!0)}return t};function wE(){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 ht(p)?p.__isVue?["div",n,"VueInstance"]:et(p)?["div",{},["span",n,m(p)],"<",u("_value"in p?p._value:p),">"]:wi(p)?["div",{},["span",n,St(p)?"ShallowReactive":"Reactive"],"<",u(p),`>${$n(p)?" (readonly)":""}`]:$n(p)?["div",{},["span",n,St(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 y=[];p.type.props&&p.props&&y.push(a("props",ce(p.props))),p.setupState!==Wt&&y.push(a("setup",p.setupState)),p.data!==Wt&&y.push(a("data",ce(p.data)));const S=f(p,"computed");S&&y.push(a("computed",S));const w=f(p,"inject");return w&&y.push(a("injected",w)),y.push(["div",{},["span",{style:r.style+";opacity:0.66"},"$ (internal): "],["object",{object:p}]]),y}function a(p,y){return y=Ct({},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+": "],u(y[S],!1)])]]:["span",{}]}function u(p,y=!0){return typeof p=="number"?["span",e,p]:typeof p=="string"?["span",t,JSON.stringify(p)]:typeof p=="boolean"?["span",r,p]:ht(p)?["object",{object:y?ce(p):p}]:["span",t,String(p)]}function f(p,y){const S=p.type;if(Le(S))return;const w={};for(const M in p.ctx)h(S,M,y)&&(w[M]=p.ctx[M]);return w}function h(p,y,S){const w=p[S];if(ke(w)&&w.includes(y)||ht(w)&&y in w||p.extends&&h(p.extends,y,S)||p.mixins&&p.mixins.some(M=>h(M,y,S)))return!0}function m(p){return St(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 xE(){wE()}process.env.NODE_ENV!=="production"&&xE();function tt(n){this.content=n}tt.prototype={constructor:tt,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 tt(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 tt(t)},addToStart:function(n,e){return new tt([n,e].concat(this.remove(n).content))},addToEnd:function(n,e){var t=this.remove(n).content.slice();return t.push(n,e),new tt(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 tt(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=tt.from(n),n.size?new tt(n.content.concat(this.subtract(n).content)):this},append:function(n){return n=tt.from(n),n.size?new tt(this.subtract(n).content.concat(n.content)):this},subtract:function(n){var e=this;n=tt.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}},tt.from=function(n){if(n instanceof tt)return n;var e=[];if(n)for(var t in n)e.push(t,n[t]);return new tt(e)};function Mm(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=Mm(i.content,o.content,t+1);if(a!=null)return a}t+=i.nodeSize}}function Tm(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=Tm(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 Mm(this,e,t)}findDiffEnd(e,t=this.size,r=e.size){return Tm(this,e,t,r)}findIndex(e,t=-1){if(e==0)return fl(0,e);if(e==this.size)return fl(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?fl(r+1,a):fl(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 mc={index:0,offset:0};function fl(n,e){return mc.index=n,mc.offset=e,mc}function hl(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(!hl(n[r],e[r]))return!1}else{for(let r in n)if(!(r in e)||!hl(n[r],e[r]))return!1;for(let r in e)if(!(r in n))return!1}return!0}let _e=class Yf{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&&hl(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 Yf.none;if(e instanceof Yf)return[e];let t=e.slice();return t.sort((r,i)=>r.type.rank-i.type.rank),t}};_e.none=[];class dl extends Error{}class U{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=Am(this.content,e+this.openStart,t);return r&&new U(r,this.openStart,this.openEnd)}removeBetween(e,t){return new U(Cm(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 U.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 U(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 U(e,r,i)}}U.empty=new U(L.empty,0,0);function Cm(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(Cm(o.content,e-i-1,t-i-1)))}function Am(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=Am(a.content,e-o-1,t);return u&&n.replaceChild(i,a.copy(u))}function _E(n,e,t){if(t.openStart>n.depth)throw new dl("Inserted content deeper than insertion position");if(n.depth-t.openStart!=e.depth-t.openEnd)throw new dl("Inconsistent open depths");return Om(n,e,t,0)}function Om(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=Om(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 $r(a,u.cut(0,n.parentOffset).append(t.content).append(u.cut(e.parentOffset)))}else{let{start:a,end:u}=EE(t,n);return $r(o,Nm(n,a,u,e,r))}else return $r(o,pl(n,e,r))}function Im(n,e){if(!e.type.compatibleContent(n.type))throw new dl("Cannot join "+e.type.name+" onto "+n.type.name)}function gc(n,e,t){let r=n.node(t);return Im(r,e.node(t)),r}function Fr(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 As(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&&(Fr(n.nodeAfter,r),o++));for(let u=o;u<a;u++)Fr(i.child(u),r);e&&e.depth==t&&e.textOffset&&Fr(e.nodeBefore,r)}function $r(n,e){return n.type.checkContent(e),n.copy(e)}function Nm(n,e,t,r,i){let o=n.depth>i&&gc(n,e,i+1),a=r.depth>i&&gc(t,r,i+1),u=[];return As(null,n,i,u),o&&a&&e.index(i)==t.index(i)?(Im(o,a),Fr($r(o,Nm(n,e,t,r,i+1)),u)):(o&&Fr($r(o,pl(n,e,i+1)),u),As(e,t,i,u),a&&Fr($r(a,pl(t,r,i+1)),u)),As(r,null,i,u),new L(u)}function pl(n,e,t){let r=[];if(As(null,n,t,r),n.depth>t){let i=gc(n,e,t+1);Fr($r(i,pl(n,e,t+1)),r)}return As(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 js{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 _e.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 ml(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 js(t,r,o)}static resolveCached(e,t){for(let i=0;i<yc.length;i++){let o=yc[i];if(o.pos==t&&o.doc==e)return o}let r=yc[bc]=js.resolve(e,t);return bc=(bc+1)%kE,r}}let yc=[],bc=0,kE=12;class ml{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 ME=Object.create(null);let Hr=class Xf{constructor(e,t,r,i=_e.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&&hl(this.attrs,t||e.defaultAttrs||ME)&&_e.sameSet(this.marks,r||_e.none)}copy(e=null){return e==this.content?this:new Xf(this.type,this.attrs,e,this.marks)}mark(e){return e==this.marks?this:new Xf(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 U.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 U(h,i.depth-a,o.depth-a)}replace(e,t,r){return _E(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 js.resolveCached(this,e)}resolveNoCache(e){return js.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()+")"),Rm(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=_e.none;for(let t=0;t<this.marks.length;t++)e=this.marks[t].addToSet(e);if(!_e.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)}};Hr.prototype.text=void 0;class ga extends Hr{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):Rm(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 ga(this.type,this.attrs,this.text,e)}withText(e){return e==this.text?this:new ga(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 Rm(n,e){for(let t=n.length-1;t>=0;t--)e=n[t].type.name+"("+e+")";return e}class ei{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(e,t){let r=new TE(e,t);if(r.next==null)return ei.empty;let i=Lm(r);r.next&&r.err("Unexpected trailing text");let o=LE(RE(i));return PE(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 y=o(p,u.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 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(`
6
+ `)}}ei.empty=new ei(!0);class TE{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 Lm(n){let e=[];do e.push(CE(n));while(n.eat("|"));return e.length==1?e[0]:{type:"choice",exprs:e}}function CE(n){let e=[];do e.push(AE(n));while(n.next&&n.next!=")"&&n.next!="|");return e.length==1?e[0]:{type:"seq",exprs:e}}function AE(n){let e=NE(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 Pm(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=Pm(n),r=t;return n.eat(",")&&(n.next!="}"?r=Pm(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 NE(n){if(n.eat("(")){let e=Lm(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 RE(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 Dm(n,e){return e-n}function zm(n,e){let t=[];return r(e),t.sort(Dm);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(zm(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]);zm(n,f).forEach(m=>{h||i.push([u,h=[]]),h.indexOf(m)==-1&&h.push(m)})})});let o=e[r.join(",")]=new ei(r.indexOf(n.length-1)>-1);for(let a=0;a<i.length;a++){let u=i[a][1].sort(Dm);o.next.push({type:i[a][0],next:e[u.join(",")]||t(u)})}return o}}function PE(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 Bm(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 Fm(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 $m(n){let e=Object.create(null);if(n)for(let t in n)e[t]=new DE(n[t]);return e}let Hm=class q1{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=$m(r.attrs),this.defaultAttrs=Bm(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==ei.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:Fm(this.attrs,e)}create(e=null,t,r){if(this.isText)throw new Error("NodeType.create can't construct text nodes");return new Hr(this,this.computeAttrs(e),L.from(t),_e.setFrom(r))}createChecked(e=null,t,r){return t=L.from(t),this.checkContent(t),new Hr(this,this.computeAttrs(e),t,_e.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 Hr(this,e,t.append(o),_e.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:_e.none:e}static compile(e,t){let r=Object.create(null);e.forEach((o,a)=>r[o]=new q1(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 ya{constructor(e,t,r,i){this.name=e,this.rank=t,this.schema=r,this.spec=i,this.attrs=$m(i.attrs),this.excluded=null;let o=Bm(this.attrs);this.instance=o?new _e(this,o):null}create(e=null){return!e&&this.instance?this.instance:new _e(this,Fm(this.attrs,e))}static compile(e,t){let r=Object.create(null),i=0;return e.forEach((o,a)=>r[o]=new ya(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 zE{constructor(e){this.cached=Object.create(null);let t=this.spec={};for(let i in e)t[i]=e[i];t.nodes=tt.from(e.nodes),t.marks=tt.from(e.marks||{}),this.nodes=Hm.compile(this.spec.nodes,this),this.marks=ya.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]=ei.parse(a,this.nodes)),o.inlineContent=o.contentMatch.inlineContent,o.markSet=u=="_"?null:u?Wm(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==""?[]:Wm(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 Hm){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 ga(r,r.defaultAttrs,e,_e.setFrom(t))}mark(e,t){return typeof e=="string"&&(e=this.marks[e]),e.create(t)}nodeFromJSON(e){return Hr.fromJSON(this,e)}markFromJSON(e){return _e.fromJSON(this,e)}nodeType(e){let t=this.nodes[e];if(!t)throw new RangeError("Unknown node type: "+e);return t}}function Wm(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 vc=class Zf{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 Gm(this,t,!1);return r.addAll(e,t.from,t.to),r.finish()}parseSlice(e,t={}){let r=new Gm(this,t,!0);return r.addAll(e,t.from,t.to),U.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($E(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=qm(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=qm(a)),a.node||a.ignore||a.mark||(a.node=i)})}return t}static fromSchema(e){return e.cached.domParser||(e.cached.domParser=new Zf(e,Zf.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},BE={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},Vm={ol:!0,ul:!0},gl=1,yl=2,Os=4;function Km(n,e,t){return e!=null?(e?gl:0)|(e==="full"?yl:0):n&&n.whitespace=="pre"?gl|yl:t&~Os}class bl{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=_e.none,this.stashMarks=[],this.match=a||(u&Os?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&gl)){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):WE(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 Gm{constructor(e,t,r){this.parser=e,this.options=t,this.isOpen=r,this.open=0;let i=t.topNode,o,a=Km(null,t.preserveWhitespace,0)|(r?Os:0);i?o=new bl(i.type,i.attrs,_e.none,_e.none,!0,t.topMatch||i.type.contentMatch,a):r?o=new bl(null,null,_e.none,_e.none,!0,null,a):o=new bl(e.schema.topNodeType,null,_e.none,_e.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(HE(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&yl||r.inlineContext(e)||/[^ \t\r\n\u000c]/.test(t)){if(r.options&gl)r.options&yl?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;Vm.hasOwnProperty(r)&&this.parser.normalizeLists&&FE(e);let o=this.options.ruleFromNode&&this.options.ruleFromNode(e)||(i=this.parser.matchTag(e,this,t));if(o?o.ignore:BE.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(Um.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(`
8
+ `))}ignoreFallback(e){e.nodeName=="BR"&&(!this.top.type||!this.top.type.inlineContent)&&this.findPlace(this.parser.schema.text("-"))}readStyles(e){let t=_e.none,r=_e.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=Km(e,i,o.options);o.options&Os&&o.content.length==0&&(a|=Os),this.nodes.push(new bl(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=UE(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 FE(n){for(let e=n.firstChild,t=null;e;e=e.nextSibling){let r=e.nodeType==1?e.nodeName.toLowerCase():null;r&&Vm.hasOwnProperty(r)&&t?(t.appendChild(e),e=t):r=="li"?t=e:r&&(t=null)}}function $E(n,e){return(n.matches||n.msMatchesSelector||n.webkitMatchesSelector||n.mozMatchesSelector).call(n,e)}function HE(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 qm(n){let e={};for(let t in n)e[t]=n[t];return e}function WE(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 UE(n,e){for(let t=0;t<e.length;t++)if(n.eq(e[t]))return e[t]}class ni{constructor(e,t){this.nodes=e,this.marks=t}serializeFragment(e,t={},r){r||(r=Sc(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}=ni.renderSpec(Sc(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&&ni.renderSpec(Sc(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:y,contentDOM:S}=ni.renderSpec(e,p,r);if(u.appendChild(y),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 ni(this.nodesFromSchema(e),this.marksFromSchema(e)))}static nodesFromSchema(e){let t=Jm(e.nodes);return t.text||(t.text=r=>r.text),t}static marksFromSchema(e){return Jm(e.marks)}}function Jm(n){let e={};for(let t in n){let r=n[t].spec.toDOM;r&&(e[t]=r)}return e}function Sc(n){return n.document||window.document}const jm=65535,Ym=Math.pow(2,16);function VE(n,e){return n+e*Ym}function Xm(n){return n&jm}function KE(n){return(n-(n&jm))/Ym}const Zm=1,Qm=2,vl=4,eg=8;class wc{constructor(e,t,r){this.pos=e,this.delInfo=t,this.recover=r}get deleted(){return(this.delInfo&eg)>0}get deletedBefore(){return(this.delInfo&(Zm|vl))>0}get deletedAfter(){return(this.delInfo&(Qm|vl))>0}get deletedAcross(){return(this.delInfo&vl)>0}}class Jt{constructor(e,t=!1){if(this.ranges=e,this.inverted=t,!e.length&&Jt.empty)return Jt.empty}recover(e){let t=0,r=Xm(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+KE(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 y=h?e==f?-1:e==p?1:t:t,S=f+i+(y<0?0:m);if(r)return S;let w=e==(t<0?f:p)?null:VE(u/3,e-f),M=e==f?Qm:e==p?Zm:vl;return(t<0?e!=f:e!=p)&&(M|=eg),new wc(S,M,w)}i+=m-h}return r?e+i:new wc(e+i,0,null)}touches(e,t){let r=0,i=Xm(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 Jt(this.ranges,!this.inverted)}toString(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)}static offset(e){return e==0?Jt.empty:new Jt(e<0?[0,-e,0]:[0,0,e])}}Jt.empty=new Jt([]);class qi{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 qi(this.maps,this.mirror,e,t)}copy(){return new qi(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 qi;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 wc(e,i,null)}}const xc=Object.create(null);class lt{getMap(){return Jt.empty}merge(e){return null}static fromJSON(e,t){if(!t||!t.stepType)throw new RangeError("Invalid input for Step.fromJSON");let r=xc[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 xc)throw new RangeError("Duplicate use of step JSON ID "+e);return xc[e]=t,t.prototype.jsonID=e,t}}class De{constructor(e,t){this.doc=e,this.failed=t}static ok(e){return new De(e,null)}static fail(e){return new De(null,e)}static fromReplace(e,t,r,i){try{return De.ok(e.replace(t,r,i))}catch(o){if(o instanceof dl)return De.fail(o.message);throw o}}}function _c(n,e,t){let r=[];for(let i=0;i<n.childCount;i++){let o=n.child(i);o.content.size&&(o=o.copy(_c(o.content,e,o))),o.isInline&&(o=e(o,t,i)),r.push(o)}return L.fromArray(r)}class Er extends lt{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 U(_c(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 De.fromReplace(e,this.from,this.to,o)}invert(){return new kn(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 Er(t.pos,r.pos,this.mark)}merge(e){return e instanceof Er&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new Er(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 Er(t.from,t.to,e.markFromJSON(t.mark))}}lt.jsonID("addMark",Er);class kn extends lt{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 U(_c(t.content,i=>i.mark(this.mark.removeFromSet(i.marks)),e),t.openStart,t.openEnd);return De.fromReplace(e,this.from,this.to,r)}invert(){return new Er(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 kn(t.pos,r.pos,this.mark)}merge(e){return e instanceof kn&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new kn(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 kn(t.from,t.to,e.markFromJSON(t.mark))}}lt.jsonID("removeMark",kn);class kr extends lt{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return De.fail("No node at mark step's position");let r=t.type.create(t.attrs,null,this.mark.addToSet(t.marks));return De.fromReplace(e,this.pos,this.pos+1,new U(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 kr(this.pos,t.marks[i]);return new kr(this.pos,this.mark)}}return new Ji(this.pos,this.mark)}map(e){let t=e.mapResult(this.pos,1);return t.deletedAfter?null:new kr(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 kr(t.pos,e.markFromJSON(t.mark))}}lt.jsonID("addNodeMark",kr);class Ji extends lt{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return De.fail("No node at mark step's position");let r=t.type.create(t.attrs,null,this.mark.removeFromSet(t.marks));return De.fromReplace(e,this.pos,this.pos+1,new U(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 kr(this.pos,this.mark)}map(e){let t=e.mapResult(this.pos,1);return t.deletedAfter?null:new Ji(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 Ji(t.pos,e.markFromJSON(t.mark))}}lt.jsonID("removeNodeMark",Ji);class at extends lt{constructor(e,t,r,i=!1){super(),this.from=e,this.to=t,this.slice=r,this.structure=i}apply(e){return this.structure&&Ec(e,this.from,this.to)?De.fail("Structure replace would overwrite content"):De.fromReplace(e,this.from,this.to,this.slice)}getMap(){return new Jt([this.from,this.to-this.from,this.slice.size])}invert(e){return new at(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 at(t.pos,Math.max(t.pos,r.pos),this.slice)}merge(e){if(!(e instanceof at)||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?U.empty:new U(this.slice.content.append(e.slice.content),this.slice.openStart,e.slice.openEnd);return new at(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?U.empty:new U(e.slice.content.append(this.slice.content),e.slice.openStart,this.slice.openEnd);return new at(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 at(t.from,t.to,U.fromJSON(e,t.slice),!!t.structure)}}lt.jsonID("replace",at);class Ye extends lt{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&&(Ec(e,this.from,this.gapFrom)||Ec(e,this.gapTo,this.to)))return De.fail("Structure gap-replace would overwrite content");let t=e.slice(this.gapFrom,this.gapTo);if(t.openStart||t.openEnd)return De.fail("Gap is not a flat range");let r=this.slice.insertAt(this.insert,t.content);return r?De.fromReplace(e,this.from,this.to,r):De.fail("Content does not fit in gap")}getMap(){return new Jt([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 Ye(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 Ye(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 Ye(t.from,t.to,t.gapFrom,t.gapTo,U.fromJSON(e,t.slice),t.insert,!!t.structure)}}lt.jsonID("replaceAround",Ye);function Ec(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 GE(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 y=Math.max(h,e),S=Math.min(h+f.nodeSize,t),w=r.addToSet(p);for(let M=0;M<p.length;M++)p[M].isInSet(w)||(a&&a.to==y&&a.mark.eq(p[M])?a.to=S:i.push(a=new kn(y,S,p[M])));u&&u.to==y?u.to=S:o.push(u=new Er(y,S,r))}}),i.forEach(f=>n.step(f)),o.forEach(f=>n.step(f))}function qE(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 ya){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],y;for(let S=0;S<i.length;S++){let w=i[S];w.step==o-1&&p.eq(i[S].style)&&(y=w)}y?(y.to=h,y.step=o):i.push({style:p,from:Math.max(u,e),to:h,step:o})}}}),i.forEach(a=>n.step(new kn(a.from,a.to,a.style)))}function JE(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 at(a,h,U.empty));else{r=m;for(let p=0;p<f.marks.length;p++)t.allowsMarkType(f.marks[p].type)||n.step(new kn(a,h,f.marks[p]))}a=h}if(!r.validEnd){let u=r.fillBefore(L.empty,!0);n.replace(a,a,new U(u,0,0))}for(let u=o.length-1;u>=0;u--)n.step(o[u])}function jE(n,e,t){return(e==0||n.canReplace(e,n.childCount))&&(t==n.childCount||n.canReplace(0,t))}function Ti(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||!jE(i,o,a))break}return null}function YE(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 w=o,M=!1;w>t;w--)M||r.index(w)>0?(M=!0,m=L.from(r.node(w).copy(m)),p++):f--;let y=L.empty,S=0;for(let w=o,M=!1;w>t;w--)M||i.after(w+1)<i.end(w)?(M=!0,y=L.from(i.node(w).copy(y)),S++):h++;n.step(new Ye(f,h,a,u,new U(m.append(y),p,S),m.size-p,!0))}function kc(n,e,t=null,r=n){let i=XE(n,e),o=i&&ZE(r,e);return o?i.map(tg).concat({type:e,attrs:t}).concat(o.map(tg)):null}function tg(n){return{type:n,attrs:null}}function XE(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 ZE(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 QE(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 Ye(i,o,i,o,new U(r,0,0),t.length,!0))}function ek(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)&&tk(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 Ye(h,m,h+1,m-1,new U(L.from(r.create(i,null,a.marks)),0,0),1,!0)),!1}})}function tk(n,e,t){let r=n.resolve(e),i=r.index();return r.parent.canReplaceWith(i,i+1,t)}function nk(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 Ye(e,e+o.nodeSize,e+1,e+o.nodeSize-1,new U(L.from(a),0,0),1,!0))}function Ci(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),w=r&&r[m]||p;if(w!=p&&(S=S.replaceChild(0,w.type.create(w.attrs))),!p.canReplace(y+1,p.childCount)||!w.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 rk(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 at(e,e,new U(o.append(a),t,t),!0))}function fr(n,e){let t=n.resolve(e),r=t.index();return ng(t.nodeBefore,t.nodeAfter)&&t.parent.canReplace(r,r+1)}function ng(n,e){return!!(n&&e&&!n.isLeaf&&n.canAppend(e))}function Sl(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&&ng(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 ik(n,e,t){let r=new at(e-t,e+t,U.empty,!0);n.step(r)}function sk(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 ok(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 Mc(n,e,t=e,r=U.empty){if(e==t&&!r.size)return null;let i=n.resolve(e),o=n.resolve(t);return rg(i,o,r)?new at(e,t,r):new lk(i,o,r).fit()}function rg(n,e,t){return!t.openStart&&!t.openEnd&&n.start()==e.start()&&n.parent.canReplace(n.index(),e.index(),t.content)}class lk{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 U(o,a,u);return e>-1?new Ye(r.pos,e,this.$to.pos,this.$to.end(),f,t):f.size||r.pos!=this.$to.pos?new at(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=Tc(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=Tc(e,t);return!i.childCount||i.firstChild.isLeaf?!1:(this.unplaced=new U(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=Tc(e,t);if(i.childCount<=1&&t>0){let o=e.size-t<=t+i.size;this.unplaced=new U(Is(e,t-1,1),t-1,o?t-1:r)}else this.unplaced=new U(Is(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 M=0;M<o.length;M++)this.openFrontierNode(o[M]);let a=this.unplaced,u=r?r.content:a.content,f=a.openStart-e,h=0,m=[],{match:p,type:y}=this.frontier[t];if(i){for(let M=0;M<i.childCount;M++)m.push(i.child(M));p=p.matchFragment(i)}let S=u.size+e-(a.content.size-a.openEnd);for(;h<u.childCount;){let M=u.child(h),T=p.matchType(M.type);if(!T)break;h++,(h>1||f==0||M.content.size)&&(p=T,m.push(ig(M.mark(y.allowedMarks(M.marks)),h==1?f:0,h==u.childCount?S:-1)))}let w=h==u.childCount;w||(S=-1),this.placed=Ns(this.placed,t,L.from(m)),this.frontier[t].match=p,w&&S<0&&r&&r.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let M=0,T=u;M<S;M++){let O=T.lastChild;this.frontier.push({type:O.type,match:O.contentMatchAt(O.childCount)}),T=O.content}this.unplaced=w?e==0?U.empty:new U(Is(a.content,e-1,1),e-1,S<0?a.openEnd:e-1):new U(Is(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||!Cc(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=Cc(e,t,i,r,o);if(a){for(let u=t-1;u>=0;u--){let{match:f,type:h}=this.frontier[u],m=Cc(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=Ns(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=Ns(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=Ns(this.placed,this.frontier.length,t))}}function Is(n,e,t){return e==0?n.cutByIndex(t,n.childCount):n.replaceChild(0,n.firstChild.copy(Is(n.firstChild.content,e-1,t)))}function Ns(n,e,t){return e==0?n.append(t):n.replaceChild(n.childCount-1,n.lastChild.copy(Ns(n.lastChild.content,e-1,t)))}function Tc(n,e){for(let t=0;t<e;t++)n=n.firstChild.content;return n}function ig(n,e,t){if(e<=0)return n;let r=n.content;return e>1&&(r=r.replaceChild(0,ig(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 Cc(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&&!ak(t,o.content,a)?u:null}function ak(n,e,t){for(let r=t;r<e.childCount;r++)if(!n.allowsMarks(e.child(r).marks))return!0;return!1}function uk(n){return n.spec.defining||n.spec.definingForContent}function ck(n,e,t,r){if(!r.size)return n.deleteRange(e,t);let i=n.doc.resolve(e),o=n.doc.resolve(t);if(rg(i,o,r))return n.step(new at(e,t,r));let a=og(i,n.doc.resolve(t));a[a.length-1]==0&&a.pop();let u=-(i.depth+1);a.unshift(u);for(let y=i.depth,S=i.pos-1;y>0;y--,S--){let w=i.node(y).type.spec;if(w.defining||w.definingAsContext||w.isolating)break;a.indexOf(y)>-1?u=y:i.before(y)==S&&a.splice(1,0,-y)}let f=a.indexOf(u),h=[],m=r.openStart;for(let y=r.content,S=0;;S++){let w=y.firstChild;if(h.push(w),S==r.openStart)break;y=w.content}for(let y=m-1;y>=0;y--){let S=h[y].type,w=uk(S);if(w&&i.node(f).type!=S)m=y;else if(w||!S.isTextblock)break}for(let y=r.openStart;y>=0;y--){let S=(y+m+1)%(r.openStart+1),w=h[S];if(w)for(let M=0;M<a.length;M++){let T=a[(M+f)%a.length],O=!0;T<0&&(O=!1,T=-T);let F=i.node(T-1),B=i.index(T-1);if(F.canReplaceWith(B,B,w.type,w.marks))return n.replace(i.before(T),O?o.after(T):t,new U(sg(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 sg(n,e,t,r,i){if(e<t){let o=n.firstChild;n=n.replaceChild(0,o.copy(sg(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 fk(n,e,t,r){if(!r.isInline&&e==t&&n.doc.resolve(e).parent.content.size){let i=sk(n.doc,e,r.type);i!=null&&(e=t=i)}n.replaceRange(e,t,new U(L.from(r),0,0))}function hk(n,e,t){let r=n.doc.resolve(e),i=n.doc.resolve(t),o=og(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 og(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 ji extends lt{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 De.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 De.fromReplace(e,this.pos,this.pos+1,new U(L.from(i),0,t.isLeaf?0:1))}getMap(){return Jt.empty}invert(e){return new ji(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 ji(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 ji(t.pos,t.attr,t.value)}}lt.jsonID("attr",ji);let Ai=class extends Error{};Ai=function n(e){let t=Error.call(this,e);return t.__proto__=n.prototype,t},Ai.prototype=Object.create(Error.prototype),Ai.prototype.constructor=Ai,Ai.prototype.name="TransformError";class dk{constructor(e){this.doc=e,this.steps=[],this.docs=[],this.mapping=new qi}get before(){return this.docs.length?this.docs[0]:this.doc}step(e){let t=this.maybeStep(e);if(t.failed)throw new Ai(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=U.empty){let i=Mc(this.doc,e,t,r);return i&&this.step(i),this}replaceWith(e,t,r){return this.replace(e,t,new U(L.from(r),0,0))}delete(e,t){return this.replace(e,t,U.empty)}insert(e,t){return this.replaceWith(e,e,t)}replaceRange(e,t,r){return ck(this,e,t,r),this}replaceRangeWith(e,t,r){return fk(this,e,t,r),this}deleteRange(e,t){return hk(this,e,t),this}lift(e,t){return YE(this,e,t),this}join(e,t=1){return ik(this,e,t),this}wrap(e,t){return QE(this,e,t),this}setBlockType(e,t=e,r,i=null){return ek(this,e,t,r,i),this}setNodeMarkup(e,t,r=null,i=[]){return nk(this,e,t,r,i),this}setNodeAttribute(e,t,r){return this.step(new ji(e,t,r)),this}addNodeMark(e,t){return this.step(new kr(e,t)),this}removeNodeMark(e,t){if(!(t instanceof _e)){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 Ji(e,t)),this}split(e,t=1,r){return rk(this,e,t,r),this}addMark(e,t,r){return GE(this,e,t,r),this}removeMark(e,t,r){return qE(this,e,t,r),this}clearIncompatible(e,t,r){return JE(this,e,t,r),this}}const Ac=Object.create(null);class pe{constructor(e,t,r){this.$anchor=e,this.$head=t,this.ranges=r||[new pk(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=U.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?U.empty:t),u==0&&ug(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),ug(e,r,t.isInline?-1:1))}}static findFrom(e,t,r=!1){let i=e.parent.inlineContent?new me(e):Oi(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?Oi(e.node(0),e.node(o),e.before(o+1),e.index(o),t,r):Oi(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 hn(e.node(0))}static atStart(e){return Oi(e,e,0,0,1)||new hn(e)}static atEnd(e){return Oi(e,e,e.content.size,e.childCount,-1)||new hn(e)}static fromJSON(e,t){if(!t||!t.type)throw new RangeError("Invalid input for Selection.fromJSON");let r=Ac[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 Ac)throw new RangeError("Duplicate use of selection JSON ID "+e);return Ac[e]=t,t.prototype.jsonID=e,t}getBookmark(){return me.between(this.$anchor,this.$head).getBookmark()}}pe.prototype.visible=!0;class pk{constructor(e,t){this.$from=e,this.$to=t}}let lg=!1;function ag(n){!lg&&!n.parent.inlineContent&&(lg=!0,console.warn("TextSelection endpoint not pointing into a node with inline content ("+n.parent.type.name+")"))}class me extends pe{constructor(e,t=e){ag(e),ag(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 pe.near(r);let i=e.resolve(t.map(this.anchor));return new me(i.parent.inlineContent?i:r,r)}replace(e,t=U.empty){if(super.replace(e,t),t==U.empty){let r=this.$from.marksAcross(this.$to);r&&e.ensureMarks(r)}}eq(e){return e instanceof me&&e.anchor==this.anchor&&e.head==this.head}getBookmark(){return new ba(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 me(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=pe.findFrom(t,r,!0)||pe.findFrom(t,-r,!0);if(o)t=o.$head;else return pe.near(t,r)}return e.parent.inlineContent||(i==0?e=t:(e=(pe.findFrom(e,-r,!0)||pe.findFrom(e,r,!0)).$anchor,e.pos<t.pos!=i<0&&(e=t))),new me(e,t)}}pe.jsonID("text",me);class ba{constructor(e,t){this.anchor=e,this.head=t}map(e){return new ba(e.map(this.anchor),e.map(this.head))}resolve(e){return me.between(e.resolve(this.anchor),e.resolve(this.head))}}class Z extends pe{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?pe.near(o):new Z(o)}content(){return new U(L.from(this.node),0,0)}eq(e){return e instanceof Z&&e.anchor==this.anchor}toJSON(){return{type:"node",anchor:this.anchor}}getBookmark(){return new Qf(this.anchor)}static fromJSON(e,t){if(typeof t.anchor!="number")throw new RangeError("Invalid input for NodeSelection.fromJSON");return new Z(e.resolve(t.anchor))}static create(e,t){return new Z(e.resolve(t))}static isSelectable(e){return!e.isText&&e.type.spec.selectable!==!1}}Z.prototype.visible=!1,pe.jsonID("node",Z);class Qf{constructor(e){this.anchor=e}map(e){let{deleted:t,pos:r}=e.mapResult(this.anchor);return t?new ba(r,r):new Qf(r)}resolve(e){let t=e.resolve(this.anchor),r=t.nodeAfter;return r&&Z.isSelectable(r)?new Z(t):pe.near(t)}}class hn extends pe{constructor(e){super(e.resolve(0),e.resolve(e.content.size))}replace(e,t=U.empty){if(t==U.empty){e.delete(0,e.doc.content.size);let r=pe.atStart(e.doc);r.eq(e.selection)||e.setSelection(r)}else super.replace(e,t)}toJSON(){return{type:"all"}}static fromJSON(e){return new hn(e)}map(e){return new hn(e)}eq(e){return e instanceof hn}getBookmark(){return mk}}pe.jsonID("all",hn);const mk={map(){return this},resolve(n){return new hn(n)}};function Oi(n,e,t,r,i,o=!1){if(e.inlineContent)return me.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&&Z.isSelectable(u))return Z.create(n,t-(i<0?u.nodeSize:0))}else{let f=Oi(n,u,t+i,i<0?u.childCount:0,i,o);if(f)return f}t+=u.nodeSize*i}return null}function ug(n,e,t){let r=n.steps.length-1;if(r<e)return;let i=n.steps[r];if(!(i instanceof at||i instanceof Ye))return;let o=n.mapping.maps[r],a;o.forEach((u,f,h,m)=>{a==null&&(a=m)}),n.setSelection(pe.near(n.doc.resolve(a),t))}function cg(n,e){return!e||!n?n:n.bind(e)}class wl{constructor(e,t,r){this.name=e,this.init=cg(t.init,r),this.apply=cg(t.apply,r)}}new wl("doc",{init(n){return n.doc||n.schema.topNodeType.createAndFill()},apply(n){return n.doc}}),new wl("selection",{init(n,e){return n.selection||pe.atStart(e.doc)},apply(n){return n.selection}}),new wl("storedMarks",{init(n){return n.storedMarks||null},apply(n,e,t,r){return r.selection.$cursor?n.storedMarks:null}}),new wl("scrollToSelection",{init(){return 0},apply(n,e){return n.scrolledIntoView?e+1:e}});function fg(n,e,t){for(let r in n){let i=n[r];i instanceof Function?i=i.bind(e):r=="handleDOMEvents"&&(i=fg(i,e,{})),t[r]=i}return t}class At{constructor(e){this.spec=e,this.props={},e.props&&fg(e.props,this,this.props),this.key=e.key?e.key.key:hg("plugin")}getState(e){return e[this.key]}}const Oc=Object.create(null);function hg(n){return n in Oc?n+"$"+ ++Oc[n]:(Oc[n]=0,n+"$")}class an{constructor(e="key"){this.key=hg(e)}get(e){return e.config.pluginsByKey[this.key]}getState(e){return e[this.key]}}const Rs=function(n){for(var e=0;;e++)if(n=n.previousSibling,!n)return e},dg=function(n,e,t,r){return t&&(pg(n,e,t,r,-1)||pg(n,e,t,r,1))},gk=/^(img|br|input|textarea|hr)$/i;function pg(n,e,t,r,i){for(;;){if(n==t&&e==r)return!0;if(e==(i<0?0:xl(n))){let o=n.parentNode;if(!o||o.nodeType!=1||bk(n)||gk.test(n.nodeName)||n.contentEditable=="false")return!1;e=Rs(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?xl(n):0}else return!1}}function xl(n){return n.nodeType==3?n.nodeValue.length:n.childNodes.length}function yk(n,e,t){for(let r=e==0,i=e==xl(n);r||i;){if(n==t)return!0;let o=Rs(n);if(n=n.parentNode,!n)return!1;r=r&&o==0,i=i&&o==xl(n)}}function bk(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 mg=function(n){return n.focusNode&&dg(n.focusNode,n.focusOffset,n.anchorNode,n.anchorOffset)};function gg(n,e){let t=document.createEvent("Event");return t.initEvent("keydown",!0,!0),t.keyCode=n,t.key=t.code=e,t}const hr=typeof navigator<"u"?navigator:null,yg=typeof document<"u"?document:null,dr=hr&&hr.userAgent||"",Ic=/Edge\/(\d+)/.exec(dr),bg=/MSIE \d/.exec(dr),Nc=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(dr),Ls=!!(bg||Nc||Ic),vg=bg?document.documentMode:Nc?+Nc[1]:Ic?+Ic[1]:0,_l=!Ls&&/gecko\/(\d+)/i.test(dr);_l&&+(/Firefox\/(\d+)/.exec(dr)||[0,0])[1];const Rc=!Ls&&/Chrome\/(\d+)/.exec(dr),Ii=!!Rc,vk=Rc?+Rc[1]:0,Wr=!Ls&&!!hr&&/Apple Computer/.test(hr.vendor),Lc=Wr&&(/Mobile\/\w+/.test(dr)||!!hr&&hr.maxTouchPoints>2),Vt=Lc||(hr?/Mac/.test(hr.platform):!1),Ps=/Android \d/.test(dr),Pc=!!yg&&"webkitFontSmoothing"in yg.documentElement.style,Sk=Pc?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function wk(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(mg(t)){for(f=u;i&&!i.node;)i=i.parent;let m=i.node;if(i&&m.isAtom&&Z.isSelectable(m)&&i.parent&&!(m.isInline&&yk(t.focusNode,t.focusOffset,i.dom))){let p=i.posBefore;h=new Z(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=kg(n,f,u,m)}return h}function Sg(n){return n.editable?n.hasFocus():kk(n)&&document.activeElement&&document.activeElement.contains(n.dom)}function Dc(n,e=!1){let t=n.state.selection;if(Ek(n,t),!!Sg(n)){if(!e&&n.input.mouseDown&&n.input.mouseDown.allowDefault&&Ii){let r=n.domSelectionRange(),i=n.domObserver.currentSelection;if(r.anchorNode&&i.anchorNode&&dg(r.anchorNode,r.anchorOffset,i.anchorNode,i.anchorOffset)){n.input.mouseDown.delayedSelectionSync=!0,n.domObserver.setCurSelection();return}}if(n.domObserver.disconnectSelection(),n.cursorWrapper)_k(n);else{let{anchor:r,head:i}=t,o,a;wg&&!(t instanceof me)&&(t.$from.parent.inlineContent||(o=xg(n,t.from)),!t.empty&&!t.$from.parent.inlineContent&&(a=xg(n,t.to))),n.docView.setSelection(r,i,n.root,e),wg&&(o&&_g(o),a&&_g(a)),t.visible?n.dom.classList.remove("ProseMirror-hideselection"):(n.dom.classList.add("ProseMirror-hideselection"),"onselectionchange"in document&&xk(n))}n.domObserver.setCurSelection(),n.domObserver.connectSelection()}}const wg=Wr||Ii&&vk<63;function xg(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(Wr&&i&&i.contentEditable=="false")return zc(i);if((!i||i.contentEditable=="false")&&(!o||o.contentEditable=="false")){if(i)return zc(i);if(o)return zc(o)}}function zc(n){return n.contentEditable="true",Wr&&n.draggable&&(n.draggable=!1,n.wasDraggable=!0),n}function _g(n){n.contentEditable="false",n.wasDraggable&&(n.draggable=!0,n.wasDraggable=null)}function xk(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(()=>{(!Sg(n)||n.state.selection.visible)&&n.dom.classList.remove("ProseMirror-hideselection")},20))})}function _k(n){let e=n.domSelection(),t=document.createRange(),r=n.cursorWrapper.dom,i=r.nodeName=="IMG";i?t.setEnd(r.parentNode,Rs(r)+1):t.setEnd(r,0),t.collapse(!1),e.removeAllRanges(),e.addRange(t),!i&&!n.state.selection.visible&&Ls&&vg<=11&&(r.disabled=!0,r.disabled=!1)}function Ek(n,e){if(e instanceof Z){let t=n.docView.descAt(e.from);t!=n.lastSelectedViewDesc&&(Eg(n),t&&t.selectNode(),n.lastSelectedViewDesc=t)}else Eg(n)}function Eg(n){n.lastSelectedViewDesc&&(n.lastSelectedViewDesc.parent&&n.lastSelectedViewDesc.deselectNode(),n.lastSelectedViewDesc=void 0)}function kg(n,e,t,r){return n.someProp("createSelectionBetween",i=>i(n,e,t))||me.between(e,t,r)}function kk(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 Bc(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&&pe.findFrom(o,e)}function Ur(n,e){return n.dispatch(n.state.tr.setSelection(e).scrollIntoView()),!0}function Mg(n,e,t){let r=n.state.selection;if(r instanceof me){if(!r.empty||t.indexOf("s")>-1)return!1;if(n.endOfTextblock(e>0?"right":"left")){let i=Bc(n.state,e);return i&&i instanceof Z?Ur(n,i):!1}else if(!(Vt&&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?Z.isSelectable(o)?Ur(n,new Z(e<0?n.state.doc.resolve(i.pos-o.nodeSize):i)):Pc?Ur(n,new me(n.state.doc.resolve(e<0?u:u+o.nodeSize))):!1:!1}}else{if(r instanceof Z&&r.node.isInline)return Ur(n,new me(e>0?r.$to:r.$from));{let i=Bc(n.state,e);return i?Ur(n,i):!1}}}function El(n){return n.nodeType==3?n.nodeValue.length:n.childNodes.length}function Ds(n){let e=n.pmViewDesc;return e&&e.size==0&&(n.nextSibling||n.nodeName!="BR")}function Fc(n){let e=n.domSelectionRange(),t=e.focusNode,r=e.focusOffset;if(!t)return;let i,o,a=!1;for(_l&&t.nodeType==1&&r<El(t)&&Ds(t.childNodes[r])&&(a=!0);;)if(r>0){if(t.nodeType!=1)break;{let u=t.childNodes[r-1];if(Ds(u))i=t,o=--r;else if(u.nodeType==3)t=u,r=t.nodeValue.length;else break}}else{if(Tg(t))break;{let u=t.previousSibling;for(;u&&Ds(u);)i=t.parentNode,o=Rs(u),u=u.previousSibling;if(u)t=u,r=El(t);else{if(t=t.parentNode,t==n.dom)break;r=0}}}a?Hc(n,t,r):i&&Hc(n,i,o)}function $c(n){let e=n.domSelectionRange(),t=e.focusNode,r=e.focusOffset;if(!t)return;let i=El(t),o,a;for(;;)if(r<i){if(t.nodeType!=1)break;let u=t.childNodes[r];if(Ds(u))o=t,a=++r;else break}else{if(Tg(t))break;{let u=t.nextSibling;for(;u&&Ds(u);)o=u.parentNode,a=Rs(u)+1,u=u.nextSibling;if(u)t=u,r=0,i=El(t);else{if(t=t.parentNode,t==n.dom)break;r=i=0}}}o&&Hc(n,o,a)}function Tg(n){let e=n.pmViewDesc;return e&&e.node&&e.node.isBlock}function Hc(n,e,t){let r=n.domSelection();if(mg(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&&Dc(n)},50)}function Cg(n,e,t){let r=n.state.selection;if(r instanceof me&&!r.empty||t.indexOf("s")>-1||Vt&&t.indexOf("m")>-1)return!1;let{$from:i,$to:o}=r;if(!i.parent.inlineContent||n.endOfTextblock(e<0?"up":"down")){let a=Bc(n.state,e);if(a&&a instanceof Z)return Ur(n,a)}if(!i.parent.inlineContent){let a=e<0?i:o,u=r instanceof hn?pe.near(a,e):pe.findFrom(a,e);return u?Ur(n,u):!1}return!1}function Ag(n,e){if(!(n.state.selection instanceof me))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 Og(n,e,t){n.domObserver.stop(),e.contentEditable=t,n.domObserver.start()}function Mk(n){if(!Wr||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;Og(n,r,"true"),setTimeout(()=>Og(n,r,"false"),20)}return!1}function Tk(n){let e="";return n.ctrlKey&&(e+="c"),n.metaKey&&(e+="m"),n.altKey&&(e+="a"),n.shiftKey&&(e+="s"),e}function Ck(n,e){let t=e.keyCode,r=Tk(e);return t==8||Vt&&t==72&&r=="c"?Ag(n,-1)||Fc(n):t==46||Vt&&t==68&&r=="c"?Ag(n,1)||$c(n):t==13||t==27?!0:t==37||Vt&&t==66&&r=="c"?Mg(n,-1,r)||Fc(n):t==39||Vt&&t==70&&r=="c"?Mg(n,1,r)||$c(n):t==38||Vt&&t==80&&r=="c"?Cg(n,-1,r)||Fc(n):t==40||Vt&&t==78&&r=="c"?Mk(n)||Cg(n,1,r)||$c(n):r==(Vt?"m":"c")&&(t==66||t==73||t==89||t==90)}function Ig(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")||ni.fromSchema(n.state.schema),u=Fg(),f=u.createElement("div");f.appendChild(a.serializeFragment(r,{document:u}));let h=f.firstChild,m,p=0;for(;h&&h.nodeType==1&&(m=zg[h.nodeName.toLowerCase()]);){for(let S=m.length-1;S>=0;S--){let w=u.createElement(m[S]);for(;f.firstChild;)w.appendChild(f.firstChild);f.appendChild(w),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,`
9
9
 
10
10
  `);return{dom:f,text:y}}function Ng(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",y=>{e=y(e,o||r,n)}),o)return e?new U(L.from(n.state.schema.text(e.replace(/\r\n?/g,`
11
- `))),0,0):U.empty;let p=n.someProp("clipboardTextParser",y=>y(e,i,r,n));if(p)u=p;else{let y=i.marks(),{schema:S}=n.state,w=ni.fromSchema(S);a=document.createElement("div"),e.split(/(?:\r\n?|\n)+/).forEach(M=>{let T=a.appendChild(document.createElement("p"));M&&T.appendChild(w.serializeNode(S.text(M,y)))})}}else n.someProp("transformPastedHTML",p=>{t=p(t,n)}),a=IE(t),Pc&&NE(a);let d=a&&a.querySelector("[data-pm-slice]"),m=d&&/^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(d.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(u||(u=(n.someProp("clipboardParser")||n.someProp("domParser")||vc.fromSchema(n.state.schema)).parseSlice(a,{preserveWhitespace:!!(f||m),context:i,ruleFromNode(y){return y.nodeName=="BR"&&!y.nextSibling&&y.parentNode&&!AE.test(y.parentNode.nodeName)?{ignore:!0}:null}})),m)u=RE(Dg(u,+m[1],+m[2]),m[4]);else if(u=U.maxOpen(OE(u.content,i),!0),u.openStart||u.openEnd){let p=0,y=0;for(let S=u.content.firstChild;p<u.openStart&&!S.type.spec.isolating;p++,S=S.firstChild);for(let S=u.content.lastChild;y<u.openEnd&&!S.type.spec.isolating;y++,S=S.lastChild);u=Dg(u,p,y)}return n.someProp("transformPasted",p=>{u=p(u,n)}),u}const AE=/^(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 OE(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),d;if(!f)return a=null;if(d=a.length&&o.length&&Lg(f,o,u,a[a.length-1],0))a[a.length-1]=d;else{a.length&&(a[a.length-1]=Pg(a[a.length-1],o.length));let m=Rg(u,f);a.push(m),i=i.matchType(m.type),o=f}}),a)return L.from(a)}return n}function Rg(n,e,t=0){for(let r=e.length-1;r>=t;r--)n=e[r].create(null,L.from(n));return n}function Lg(n,e,t,r,i){if(i<n.length&&i<e.length&&n[i]==e[i]){let o=Lg(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(Rg(t,n,i+1))))}}function Pg(n,e){if(e==0)return n;let t=n.content.replaceChild(n.childCount-1,Pg(n.lastChild,e-1)),r=n.contentMatchAt(n.childCount).fillBefore(L.empty,!0);return n.copy(t.append(r))}function Wc(n,e,t,r,i,o){let a=e<0?n.firstChild:n.lastChild,u=a.content;return i<r-1&&(u=Wc(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 Dg(n,e,t){return e<n.openStart&&(n=new U(Wc(n.content,-1,e,n.openStart,0,n.openEnd),e,n.openEnd)),t<n.openEnd&&(n=new U(Wc(n.content,1,t,n.openEnd,0,0),n.openStart,t)),n}const zg={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 Bg=null;function Fg(){return Bg||(Bg=document.implementation.createHTMLDocument("title"))}function IE(n){let e=/^(\s*<meta [^>]*>)*/.exec(n);e&&(n=n.slice(e[0].length));let t=Fg().createElement("div"),r=/<([a-z][^>\s]+)/i.exec(n),i;if((i=r&&zg[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 NE(n){let e=n.querySelectorAll(Ii?"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 RE(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 U(i,o,a)}const un={},Ot={};function pr(n,e){n.input.lastSelectionOrigin=e,n.input.lastSelectionTime=Date.now()}Ot.keydown=(n,e)=>{let t=e;if(n.input.shiftKey=t.keyCode==16||t.shiftKey,!Hg(n,t)&&(n.input.lastKeyCode=t.keyCode,n.input.lastKeyCodeTime=Date.now(),!(Ps&&Ii&&t.keyCode==13)))if(t.keyCode!=229&&n.domObserver.forceFlush(),Lc&&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,gg(13,"Enter"))),n.input.lastIOSEnter=0)},200)}else n.someProp("handleKeyDown",r=>r(n,t))||CE(n,t)?t.preventDefault():pr(n,"key")},Ot.keyup=(n,e)=>{e.keyCode==16&&(n.input.shiftKey=!1)},Ot.keypress=(n,e)=>{let t=e;if(Hg(n,t)||!t.charCode||t.ctrlKey&&!t.altKey||Vt&&t.metaKey)return;if(n.someProp("handleKeyPress",i=>i(n,t))){t.preventDefault();return}let r=n.state.selection;if(!(r instanceof me)||!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 El(n){return{left:n.clientX,top:n.clientY}}function LE(n,e){let t=e.x-n.clientX,r=e.y-n.clientY;return t*t+r*r<100}function Uc(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 Ni(n,e,t){n.focused||n.focus();let r=n.state.tr.setSelection(e);r.setMeta("pointer",!0),n.dispatch(r)}function PE(n,e){if(e==-1)return!1;let t=n.state.doc.resolve(e),r=t.nodeAfter;return r&&r.isAtom&&Z.isSelectable(r)?(Ni(n,new Z(t)),!0):!1}function DE(n,e){if(e==-1)return!1;let t=n.state.selection,r,i;t instanceof Z&&(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(Z.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?(Ni(n,Z.create(n.state.doc,i)),!0):!1}function zE(n,e,t,r,i){return Uc(n,"handleClickOn",e,t,r)||n.someProp("handleClick",o=>o(n,e,r))||(i?DE(n,t):PE(n,t))}function BE(n,e,t,r){return Uc(n,"handleDoubleClickOn",e,t,r)||n.someProp("handleDoubleClick",i=>i(n,e,r))}function FE(n,e,t,r){return Uc(n,"handleTripleClickOn",e,t,r)||n.someProp("handleTripleClick",i=>i(n,e,r))||$E(n,t,r)}function $E(n,e,t){if(t.button!=0)return!1;let r=n.state.doc;if(e==-1)return r.inlineContent?(Ni(n,me.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)Ni(n,me.create(r,u+1,u+1+a.content.size));else if(Z.isSelectable(a))Ni(n,Z.create(r,u));else continue;return!0}}function Vc(n){return Ml(n)}const $g=Vt?"metaKey":"ctrlKey";un.mousedown=(n,e)=>{let t=e;n.input.shiftKey=t.shiftKey;let r=Vc(n),i=Date.now(),o="singleClick";i-n.input.lastClick.time<500&&LE(t,n.input.lastClick)&&!t[$g]&&(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(El(t));a&&(o=="singleClick"?(n.input.mouseDown&&n.input.mouseDown.done(),n.input.mouseDown=new HE(n,a,t,!!r)):(o=="doubleClick"?BE:FE)(n,a.pos,a.inside,t)?t.preventDefault():pr(n,"pointer"))};class HE{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[$g],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:d}=e.state;(r.button==0&&o.type.spec.draggable&&o.type.spec.selectable!==!1||d instanceof Z&&d.from<=a&&d.to>a)&&(this.mightDrag={node:o,pos:a,addAttr:!!(this.target&&!this.target.draggable),setUneditable:!!(this.target&&_l&&!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)),pr(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(()=>Dc(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(El(e))),this.updateAllowDefault(e),this.allowDefault||!t?pr(this.view,"pointer"):zE(this.view,t.pos,t.inside,e,this.selectNode)?e.preventDefault():e.button==0&&(this.flushed||Wr&&this.mightDrag&&!this.mightDrag.node.isAtom||Ii&&!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)?(Ni(this.view,pe.near(this.view.state.doc.resolve(t.pos))),e.preventDefault()):pr(this.view,"pointer")}move(e){this.updateAllowDefault(e),pr(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)}}un.touchstart=n=>{n.input.lastTouch=Date.now(),Vc(n),pr(n,"pointer")},un.touchmove=n=>{n.input.lastTouch=Date.now(),pr(n,"pointer")},un.contextmenu=n=>Vc(n);function Hg(n,e){return n.composing?!0:Wr&&Math.abs(e.timeStamp-n.input.compositionEndedAt)<500?(n.input.compositionEndedAt=-2e8,!0):!1}const WE=Ps?5e3:-1;Ot.compositionstart=Ot.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(),Ml(n,!0),n.markCursor=null;else if(Ml(n),_l&&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}Wg(n,WE)},Ot.compositionend=(n,e)=>{n.composing&&(n.input.composing=!1,n.input.compositionEndedAt=e.timeStamp,Wg(n,20))};function Wg(n,e){clearTimeout(n.input.composingTimeout),e>-1&&(n.input.composingTimeout=setTimeout(()=>Ml(n),e))}function UE(n){for(n.composing&&(n.input.composing=!1,n.input.compositionEndedAt=VE());n.input.compositionNodes.length>0;)n.input.compositionNodes.pop().markParentsDirty()}function VE(){let n=document.createEvent("Event");return n.initEvent("event",!0,!0),n.timeStamp}function Ml(n,e=!1){if(!(Ps&&n.domObserver.flushingSoon>=0)){if(n.domObserver.forceFlush(),UE(n),e||n.docView&&n.docView.dirty){let t=wE(n);return t&&!t.eq(n.state.selection)?n.dispatch(n.state.tr.setSelection(t)):n.updateState(n.state),!0}return!1}}function KE(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 Ri=Ls&&vg<15||Lc&&SE<604;un.copy=Ot.cut=(n,e)=>{let t=e,r=n.state.selection,i=t.type=="cut";if(r.empty)return;let o=Ri?null:t.clipboardData,a=r.content(),{dom:u,text:f}=Ig(n,a);o?(t.preventDefault(),o.clearData(),o.setData("text/html",u.innerHTML),o.setData("text/plain",f)):KE(n,u),i&&n.dispatch(n.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))};function GE(n){return n.openStart==0&&n.openEnd==0&&n.content.childCount==1?n.content.firstChild:null}function qE(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?Kc(n,r.value,null,e):Kc(n,r.textContent,r.innerHTML,e)},50)}function Kc(n,e,t,r){let i=Ng(n,e,t,n.input.shiftKey,n.state.selection.$from);if(n.someProp("handlePaste",u=>u(n,r,i||U.empty)))return!0;if(!i)return!1;let o=GE(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}Ot.paste=(n,e)=>{let t=e;if(n.composing&&!Ps)return;let r=Ri?null:t.clipboardData;r&&Kc(n,r.getData("text/plain"),r.getData("text/html"),t)?t.preventDefault():qE(n,t)};class JE{constructor(e,t){this.slice=e,this.move=t}}const Ug=Vt?"altKey":"ctrlKey";un.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(El(t));if(!(o&&o.pos>=i.from&&o.pos<=(i instanceof Z?i.to-1:i.to))){if(r&&r.mightDrag)n.dispatch(n.state.tr.setSelection(Z.create(n.state.doc,r.mightDrag.pos)));else if(t.target&&t.target.nodeType==1){let d=n.docView.nearestDesc(t.target,!0);d&&d.node.type.spec.draggable&&d!=n.docView&&n.dispatch(n.state.tr.setSelection(Z.create(n.state.doc,d.posBefore)))}}let a=n.state.selection.content(),{dom:u,text:f}=Ig(n,a);t.dataTransfer.clearData(),t.dataTransfer.setData(Ri?"Text":"text/html",u.innerHTML),t.dataTransfer.effectAllowed="copyMove",Ri||t.dataTransfer.setData("text/plain",f),n.dragging=new JE(a,!t[Ug])},un.dragend=n=>{let e=n.dragging;window.setTimeout(()=>{n.dragging==e&&(n.dragging=null)},50)},Ot.dragover=Ot.dragenter=(n,e)=>e.preventDefault(),Ot.drop=(n,e)=>{let t=e,r=n.dragging;if(n.dragging=null,!t.dataTransfer)return;let i=n.posAtCoords(El(t));if(!i)return;let o=n.state.doc.resolve(i.pos),a=r&&r.slice;a?n.someProp("transformPasted",w=>{a=w(a,n)}):a=Ng(n,t.dataTransfer.getData(Ri?"Text":"text/plain"),Ri?null:t.dataTransfer.getData("text/html"),!1,o);let u=!!(r&&!t[Ug]);if(n.someProp("handleDrop",w=>w(n,t,a||U.empty,u))){t.preventDefault();return}if(!a)return;t.preventDefault();let f=a?oE(n.state.doc,o.pos,a):o.pos;f==null&&(f=o.pos);let d=n.state.tr;u&&d.deleteSelection();let m=d.mapping.map(f),p=a.openStart==0&&a.openEnd==0&&a.content.childCount==1,y=d.doc;if(p?d.replaceRangeWith(m,m,a.content.firstChild):d.replaceRange(m,m,a),d.doc.eq(y))return;let S=d.doc.resolve(m);if(p&&Z.isSelectable(a.content.firstChild)&&S.nodeAfter&&S.nodeAfter.sameMarkup(a.content.firstChild))d.setSelection(new Z(S));else{let w=d.mapping.map(f);d.mapping.maps[d.mapping.maps.length-1].forEach((M,T,O,F)=>w=F),d.setSelection(Eg(n,S,d.doc.resolve(w)))}n.focus(),n.dispatch(d.setMeta("uiEvent","drop"))},un.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())&&Dc(n)},20))},un.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)},un.beforeinput=(n,e)=>{if(Ii&&Ps&&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,gg(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 Ot)un[n]=Ot[n];function zs(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 ed{constructor(e,t){this.toDOM=e,this.spec=t||Vr,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 ed&&(this.spec.key&&this.spec.key==e.spec.key||this.toDOM==e.toDOM&&zs(this.spec,e.spec))}destroy(e){this.spec.destroy&&this.spec.destroy(e)}}class _r{constructor(e,t){this.attrs=e,this.spec=t||Vr}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 _r&&zs(this.attrs,e.attrs)&&zs(this.spec,e.spec)}static is(e){return e.type instanceof _r}destroy(){}}class td{constructor(e,t){this.attrs=e,this.spec=t||Vr}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 td&&zs(this.attrs,e.attrs)&&zs(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 ed(t,r))}static inline(e,t,r,i){return new Mn(e,t,new _r(r,i))}static node(e,t,r,i){return new Mn(e,t,new td(r,i))}get spec(){return this.type.spec}get inline(){return this.type instanceof _r}}const Li=[],Vr={};class Xe{constructor(e,t){this.local=e.length?e:Li,this.children=t.length?t:Li}static create(e,t){return t.length?Tl(t,e,0,Vr):mt}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==mt||e.maps.length==0?this:this.mapInner(e,t,0,0,r||Vr)}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?jE(this.children,a||[],e,t,r,i,o):a?new Xe(a.sort(Kr),Li):mt}add(e,t){return t.length?this==mt?Xe.create(e,t):this.addInner(e,t,0):this}addInner(e,t,r){let i,o=0;e.forEach((u,f)=>{let d=f+r,m;if(m=Kg(t,u,d)){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,d+1):i.splice(o,0,f,f+u.nodeSize,Tl(m,u,d+1,Vr)),o+=3}});let a=Vg(o?Gg(t):t,-r);for(let u=0;u<a.length;u++)a[u].type.valid(e,a[u])||a.splice(u--,1);return new Xe(a.length?this.local.concat(a).sort(Kr):this.local,i||this.children)}remove(e){return e.length==0||this==mt?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 d=r[o+2].removeInner(a,u+1);d!=mt?r[o+2]=d:(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 Xe(i,r):mt}forChild(e,t){if(this==mt)return this;if(t.isLeaf)return Xe.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 _r){let d=Math.max(o,f.from)-o,m=Math.min(a,f.to)-o;d<m&&(i||(i=[])).push(f.copy(d,m))}}if(i){let u=new Xe(i.sort(Kr),Li);return r?new ti([u,r]):u}return r||mt}eq(e){if(this==e)return!0;if(!(e instanceof Xe)||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==mt)return Li;if(e.inlineContent||!this.local.some(_r.is))return this.local;let t=[];for(let r=0;r<this.local.length;r++)this.local[r].type instanceof _r||t.push(this.local[r]);return t}}Xe.empty=new Xe([],[]),Xe.removeOverlap=Gc;const mt=Xe.empty;class ti{constructor(e){this.members=e}map(e,t){const r=this.members.map(i=>i.map(e,t,Vr));return ti.from(r)}forChild(e,t){if(t.isLeaf)return Xe.empty;let r=[];for(let i=0;i<this.members.length;i++){let o=this.members[i].forChild(e,t);o!=mt&&(o instanceof ti?r=r.concat(o.members):r.push(o))}return ti.from(r)}eq(e){if(!(e instanceof ti)||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(Kr)):Li}static from(e){switch(e.length){case 0:return mt;case 1:return e[0];default:return new ti(e.every(t=>t instanceof Xe)?e:e.reduce((t,r)=>t.concat(r instanceof Xe?r:r.members),[]))}}}function jE(n,e,t,r,i,o,a){let u=n.slice();for(let d=0,m=o;d<t.maps.length;d++){let p=0;t.maps[d].forEach((y,S,w,M)=>{let T=M-w-(S-y);for(let O=0;O<u.length;O+=3){let F=u[O+1];if(F<0||y>F+m-p)continue;let B=u[O]+m-p;S>=B?u[O+1]=y<=B?-2:-1:w>=i&&T&&(u[O]+=T,u[O+1]+=T)}p+=T}),m=t.maps[d].map(m,-1)}let f=!1;for(let d=0;d<u.length;d+=3)if(u[d+1]<0){if(u[d+1]==-2){f=!0,u[d+1]=-1;continue}let m=t.map(n[d]+o),p=m-i;if(p<0||p>=r.content.size){f=!0;continue}let y=t.map(n[d+1]+o,-1),S=y-i,{index:w,offset:M}=r.content.findIndex(p),T=r.maybeChild(w);if(T&&M==p&&M+T.nodeSize==S){let O=u[d+2].mapInner(t,T,m+1,n[d]+o+1,a);O!=mt?(u[d]=p,u[d+1]=S,u[d+2]=O):(u[d+1]=-2,f=!0)}else f=!0}if(f){let d=YE(u,n,e,t,i,o,a),m=Tl(d,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,y=0;p<m.children.length;p+=3){let S=m.children[p];for(;y<u.length&&u[y]<S;)y+=3;u.splice(y,0,m.children[p],m.children[p+1],m.children[p+2])}}return new Xe(e.sort(Kr),u)}function Vg(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 YE(n,e,t,r,i,o,a){function u(f,d){for(let m=0;m<f.local.length;m++){let p=f.local[m].map(r,i,d);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]+d+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 Kg(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 Gg(n){let e=[];for(let t=0;t<n.length;t++)n[t]!=null&&e.push(n[t]);return e}function Tl(n,e,t,r){let i=[],o=!1;e.forEach((u,f)=>{let d=Kg(n,u,f+t);if(d){o=!0;let m=Tl(d,u,t+f+1,r);m!=mt&&i.push(f,f+u.nodeSize,m)}});let a=Vg(o?Gg(n):n,-t).sort(Kr);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 Xe(a,i):mt}function Kr(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),qg(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),qg(e,i,r.copy(o.from,r.to)));break}}}return e}function qg(n,e,t){for(;e<n.length&&Kr(t,n[e])>0;)e++;n.splice(e,0,t)}for(var mr={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:"'"},Cl={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},Jg=typeof navigator<"u"&&/Chrome\/(\d+)/.exec(navigator.userAgent),XE=typeof navigator<"u"&&/Mac/.test(navigator.platform),ZE=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),QE=XE||Jg&&+Jg[1]<57,rt=0;rt<10;rt++)mr[48+rt]=mr[96+rt]=String(rt);for(var rt=1;rt<=24;rt++)mr[rt+111]="F"+rt;for(var rt=65;rt<=90;rt++)mr[rt]=String.fromCharCode(rt+32),Cl[rt]=String.fromCharCode(rt);for(var qc in mr)Cl.hasOwnProperty(qc)||(Cl[qc]=mr[qc]);function eM(n){var e=QE&&(n.ctrlKey||n.altKey||n.metaKey)||ZE&&n.shiftKey&&n.key&&n.key.length==1||n.key=="Unidentified",t=!e&&n.key||(n.shiftKey?Cl:mr)[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 tM=typeof navigator<"u"?/Mac|iP(hone|[oa]d)/.test(navigator.platform):!1;function nM(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))tM?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 rM(n){let e=Object.create(null);for(let t in n)e[nM(t)]=n[t];return e}function Jc(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 iM(n){return new At({props:{handleKeyDown:sM(n)}})}function sM(n){let e=rM(n);return function(t,r){let i=eM(r),o=i.length==1&&i!=" ",a,u=e[Jc(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=mr[r.keyCode])&&a!=i){let f=e[Jc(a,r,!0)];if(f&&f(t.state,t.dispatch,t))return!0}else if(o&&r.shiftKey){let f=e[Jc(i,r,!0)];if(f&&f(t.state,t.dispatch,t))return!0}return!1}}const oM=(n,e)=>n.selection.empty?!1:(e&&e(n.tr.deleteSelection().scrollIntoView()),!0);function lM(n,e){let{$cursor:t}=n.selection;return!t||(e?!e.endOfTextblock("backward",n):t.parentOffset>0)?null:t}const aM=(n,e,t)=>{let r=lM(n,t);if(!r)return!1;let i=jg(r);if(!i){let a=r.blockRange(),u=a&&Ti(a);return u==null?!1:(e&&e(n.tr.lift(a,u).scrollIntoView()),!0)}let o=i.nodeBefore;if(!o.type.spec.isolating&&Zg(n,i,e))return!0;if(r.parent.content.size==0&&(Pi(o,"end")||Z.isSelectable(o))){let a=Mc(n.doc,r.before(),r.after(),U.empty);if(a&&a.slice.size<a.to-a.from){if(e){let u=n.tr.step(a);u.setSelection(Pi(o,"end")?pe.findFrom(u.doc.resolve(u.mapping.map(i.pos,-1)),-1):Z.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 Pi(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 uM=(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=jg(r)}let a=o&&o.nodeBefore;return!a||!Z.isSelectable(a)?!1:(e&&e(n.tr.setSelection(Z.create(n.doc,o.pos-a.nodeSize)).scrollIntoView()),!0)};function jg(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 cM(n,e){let{$cursor:t}=n.selection;return!t||(e?!e.endOfTextblock("forward",n):t.parentOffset<t.parent.content.size)?null:t}const fM=(n,e,t)=>{let r=cM(n,t);if(!r)return!1;let i=Yg(r);if(!i)return!1;let o=i.nodeAfter;if(Zg(n,i,e))return!0;if(r.parent.content.size==0&&(Pi(o,"start")||Z.isSelectable(o))){let a=Mc(n.doc,r.before(),r.after(),U.empty);if(a&&a.slice.size<a.to-a.from){if(e){let u=n.tr.step(a);u.setSelection(Pi(o,"start")?pe.findFrom(u.doc.resolve(u.mapping.map(i.pos)),1):Z.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},dM=(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||!Z.isSelectable(a)?!1:(e&&e(n.tr.setSelection(Z.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 hM=(n,e)=>{let t=n.selection,r=t instanceof Z,i;if(r){if(t.node.isTextblock||!fr(n.doc,t.from))return!1;i=t.from}else if(i=Sl(n.doc,t.from,-1),i==null)return!1;if(e){let o=n.tr.join(i);r&&o.setSelection(Z.create(o.doc,i-n.doc.resolve(i).nodeBefore.nodeSize)),e(o.scrollIntoView())}return!0},pM=(n,e)=>{let t=n.selection,r;if(t instanceof Z){if(t.node.isTextblock||!fr(n.doc,t.to))return!1;r=t.to}else if(r=Sl(n.doc,t.to,1),r==null)return!1;return e&&e(n.tr.join(r).scrollIntoView()),!0},mM=(n,e)=>{let{$from:t,$to:r}=n.selection,i=t.blockRange(r),o=i&&Ti(i);return o==null?!1:(e&&e(n.tr.lift(i,o).scrollIntoView()),!0)},gM=(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 Xg(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 yM=(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=Xg(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(pe.near(f.doc.resolve(u),1)),e(f.scrollIntoView())}return!0},bM=(n,e)=>{let t=n.selection,{$from:r,$to:i}=t;if(t instanceof dn||r.parent.inlineContent||i.parent.inlineContent)return!1;let o=Xg(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(me.create(u.doc,a+1)),e(u.scrollIntoView())}return!0},vM=(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(Ci(n.doc,o))return e&&e(n.tr.split(o).scrollIntoView()),!0}let r=t.blockRange(),i=r&&Ti(r);return i==null?!1:(e&&e(n.tr.lift(r,i).scrollIntoView()),!0)},SM=(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(Z.create(n.doc,i))),!0)};function wM(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||fr(n.doc,e.pos))?!1:(t&&t(n.tr.clearIncompatible(e.pos,r.type,r.contentMatchAt(r.childCount)).join(e.pos).scrollIntoView()),!0)}function Zg(n,e,t){let r=e.nodeBefore,i=e.nodeAfter,o,a;if(r.type.spec.isolating||i.type.spec.isolating)return!1;if(wM(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,y=L.empty;for(let M=o.length-1;M>=0;M--)y=L.from(o[M].create(null,y));y=L.from(r.copy(y));let S=n.tr.step(new Ye(e.pos-1,p,e.pos,p,new U(y,1,0),o.length,!0)),w=p+2*o.length;fr(S.doc,w)&&S.join(w),t(S.scrollIntoView())}return!0}let f=pe.findFrom(e,1),d=f&&f.$from.blockRange(f.$to),m=d&&Ti(d);if(m!=null&&m>=e.depth)return t&&t(n.tr.lift(d,m).scrollIntoView()),!0;if(u&&Pi(i,"start",!0)&&Pi(r,"end")){let p=r,y=[];for(;y.push(p),!p.isTextblock;)p=p.lastChild;let S=i,w=1;for(;!S.isTextblock;S=S.firstChild)w++;if(p.canReplace(p.childCount,p.childCount,S.content)){if(t){let M=L.empty;for(let O=y.length-1;O>=0;O--)M=L.from(y[O].copy(M));let T=n.tr.step(new Ye(e.pos-y.length,e.pos+i.nodeSize,e.pos+w,e.pos+i.nodeSize-w,new U(M,y.length,0),0,!0));t(T.scrollIntoView())}return!0}}return!1}function Qg(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(me.create(e.doc,n<0?i.start(o):i.end(o)))),!0):!1}}const xM=Qg(-1),_M=Qg(1);function kM(n,e=null){return function(t,r){let{$from:i,$to:o}=t.selection,a=i.blockRange(o),u=a&&Ec(a,n,e);return u?(r&&r(t.tr.wrap(a,u).scrollIntoView()),!0):!1}}function e0(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,d)=>{if(i)return!1;if(!(!f.isTextblock||f.hasMarkup(n,e)))if(f.type==n)i=!0;else{let m=t.doc.resolve(d),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 EM(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 ml(m,m,a.depth),a.endIndex<a.parent.childCount&&(a=new ml(i,t.doc.resolve(o.end(a.depth)),a.depth)),u=!0}let d=Ec(f,n,e,a);return d?(r&&r(MM(t.tr,a,d,u,n).scrollIntoView()),!0):!1}}function MM(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 Ye(e.start-(r?2:0),e.end,e.start,e.end,new U(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),d=e.parent;for(let m=e.startIndex,p=e.endIndex,y=!0;m<p;m++,y=!1)!y&&Ci(n.doc,f,u)&&(n.split(f,u),f+=2*u),f+=d.child(m).nodeSize;return n}function TM(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?CM(e,t,n,o):AM(e,t,o):!0:!1}}function CM(n,e,t,r){let i=n.tr,o=r.end,a=r.$to.end(r.depth);o<a&&(i.step(new Ye(o-1,a,o,a,new U(L.from(t.create(null,r.parent.copy())),1,0),1,!0)),r=new ml(i.doc.resolve(r.$from.pos),i.doc.resolve(a),r.depth));const u=Ti(r);if(u==null)return!1;i.lift(r,u);let f=i.mapping.map(o,-1)-1;return fr(i.doc,f)&&i.join(f),e(i.scrollIntoView()),!0}function AM(n,e,t){let r=n.tr,i=t.parent;for(let S=t.end,w=t.endIndex-1,M=t.startIndex;w>M;w--)S-=i.child(w).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,d=o.node(-1),m=o.index(-1);if(!d.canReplace(m+(u?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 Ye(p-(u?1:0),y+(f?1:0),p+1,y-1,new U((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 OM(n){return function(e,t){let{$from:r,$to:i}=e.selection,o=r.blockRange(i,d=>d.childCount>0&&d.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 d=f.lastChild&&f.lastChild.type==u.type,m=L.from(d?n.create():null),p=new U(L.from(n.create(null,L.from(u.type.create(null,m)))),d?3:1,0),y=o.start,S=o.end;t(e.tr.step(new Ye(y-(d?3:1),S,y,S,p,1,!0)).scrollIntoView())}return!0}}function Al(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 jc{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,d=e||o.tr,m=()=>(!f&&t&&!d.getMeta("preventDispatch")&&!this.hasCustomState&&a.dispatch(d),u.every(y=>y===!0)),p={...Object.fromEntries(Object.entries(r).map(([y,S])=>[y,(...M)=>{const T=this.buildProps(d,t),O=S(...M)(T);return u.push(O),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,d])=>[f,(...m)=>d(...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:Al({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,d])=>[f,(...m)=>d(...m)(u)]))}};return u}}function V(n,e,t){return n.config[e]===void 0&&n.parent?V(n.parent,e,t):typeof n.config[e]=="function"?n.config[e].bind({...t,parent:n.parent?V(n.parent,e,t):null}):n.config[e]}function Ol(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 t0(n){const e=[],{nodeExtensions:t,markExtensions:r}=Ol(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=V(a,"addGlobalAttributes",u);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 u={name:a.name,options:a.options,storage:a.storage},f=V(a,"addAttributes",u);if(!f)return;const d=f();Object.entries(d).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 qe(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 Di(...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(" "):[],d=u.filter(m=>!f.includes(m));r[i]=[...f,...d].join(" ")}else i==="style"?r[i]=[r[i],o].join("; "):r[i]=o}),r},{})}function Yc(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)=>Di(t,r),{})}function IM(n){return typeof n=="function"}function ae(n,e=void 0,...t){return IM(n)?e?n.bind(e)(...t):n(...t):n}function NM(n={}){return Object.keys(n).length===0&&n.constructor===Object}function RM(n){return typeof n!="string"?n:n.match(/^[+-]?(?:\d*\.)?\d+$/)?Number(n):n==="true"?!0:n==="false"?!1:n}function n0(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):RM(t.getAttribute(a.name));return u==null?o:{...o,[a.name]:u}},{});return{...r,...i}}}}function r0(n){return Object.fromEntries(Object.entries(n).filter(([e,t])=>e==="attrs"&&NM(t)?!1:t!=null))}function i0(n,e){var t;const r=t0(n),{nodeExtensions:i,markExtensions:o}=Ol(n),a=(t=i.find(d=>V(d,"topNode")))===null||t===void 0?void 0:t.name,u=Object.fromEntries(i.map(d=>{const m=r.filter(O=>O.type===d.name),p={name:d.name,options:d.options,storage:d.storage,editor:e},y=n.reduce((O,F)=>{const B=V(F,"extendNodeSchema",p);return{...O,...B?B(d):{}}},{}),S=r0({...y,content:ae(V(d,"content",p)),marks:ae(V(d,"marks",p)),group:ae(V(d,"group",p)),inline:ae(V(d,"inline",p)),atom:ae(V(d,"atom",p)),selectable:ae(V(d,"selectable",p)),draggable:ae(V(d,"draggable",p)),code:ae(V(d,"code",p)),defining:ae(V(d,"defining",p)),isolating:ae(V(d,"isolating",p)),attrs:Object.fromEntries(m.map(O=>{var F;return[O.name,{default:(F=O?.attribute)===null||F===void 0?void 0:F.default}]}))}),w=ae(V(d,"parseHTML",p));w&&(S.parseDOM=w.map(O=>n0(O,m)));const M=V(d,"renderHTML",p);M&&(S.toDOM=O=>M({node:O,HTMLAttributes:Yc(O,m)}));const T=V(d,"renderText",p);return T&&(S.toText=T),[d.name,S]})),f=Object.fromEntries(o.map(d=>{const m=r.filter(T=>T.type===d.name),p={name:d.name,options:d.options,storage:d.storage,editor:e},y=n.reduce((T,O)=>{const F=V(O,"extendMarkSchema",p);return{...T,...F?F(d):{}}},{}),S=r0({...y,inclusive:ae(V(d,"inclusive",p)),excludes:ae(V(d,"excludes",p)),group:ae(V(d,"group",p)),spanning:ae(V(d,"spanning",p)),code:ae(V(d,"code",p)),attrs:Object.fromEntries(m.map(T=>{var O;return[T.name,{default:(O=T?.attribute)===null||O===void 0?void 0:O.default}]}))}),w=ae(V(d,"parseHTML",p));w&&(S.parseDOM=w.map(T=>n0(T,m)));const M=V(d,"renderHTML",p);return M&&(S.toDOM=T=>M({mark:T,HTMLAttributes:Yc(T,m)})),[d.name,S]}));return new zk({topNode:a,nodes:u,marks:f})}function Xc(n,e){return e.nodes[n]||e.marks[n]||null}function s0(n,e){return Array.isArray(e)?e.some(t=>(typeof t=="string"?t:t.name)===n.name):e}const LM=(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,d;const m=((d=(f=i.type.spec).toText)===null||d===void 0?void 0:d.call(f,{node:i,pos:o,parent:a,index:u}))||i.textContent||"%leaf%";t+=m.slice(0,Math.max(0,r-o))}),t};function Zc(n){return Object.prototype.toString.call(n)==="[object RegExp]"}class o0{constructor(e){this.find=e.find,this.handler=e.handler}}const PM=(n,e)=>{if(Zc(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 Qc(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 d=f.state.doc.resolve(r);if(d.parent.type.spec.code||!((e=d.nodeBefore||d.nodeAfter)===null||e===void 0)&&e.marks.find(y=>y.type.spec.code))return!1;let m=!1;const p=LM(d)+o;return a.forEach(y=>{if(m)return;const S=PM(p,y.find);if(!S)return;const w=f.state.tr,M=Al({state:f.state,transaction:w}),T={from:r-(S[0].length-o.length),to:i},{commands:O,chain:F,can:B}=new jc({editor:t,state:M});y.handler({state:M,range:T,match:S,commands:O,chain:F,can:B})===null||!w.steps.length||(w.setMeta(u,{transform:w,from:r,to:i,text:o}),f.dispatch(w),m=!0)}),m}function DM(n){const{editor:e,rules:t}=n,r=new At({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 Qc({editor:e,from:o,to:a,text:u,rules:t,plugin:r})},handleDOMEvents:{compositionend:i=>(setTimeout(()=>{const{$cursor:o}=i.state.selection;o&&Qc({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?Qc({editor:e,from:a.pos,to:a.pos,text:`
13
- `,rules:t,plugin:r}):!1}},isInputRules:!0});return r}function zM(n){return typeof n=="number"}class BM{constructor(e){this.find=e.find,this.handler=e.handler}}const FM=(n,e)=>{if(Zc(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 $M(n){const{editor:e,state:t,from:r,to:i,rule:o,pasteEvent:a,dropEvent:u}=n,{commands:f,chain:d,can:m}=new jc({editor:e,state:t}),p=[];return t.doc.nodesBetween(r,i,(S,w)=>{if(!S.isTextblock||S.type.spec.code)return;const M=Math.max(r,w),T=Math.min(i,w+S.content.size),O=S.textBetween(M-w,T-w,void 0,"\uFFFC");FM(O,o.find).forEach(B=>{if(B.index===void 0)return;const H=M+B.index+1,X=H+B[0].length,q={from:t.tr.mapping.map(H),to:t.tr.mapping.map(X)},ie=o.handler({state:t,range:q,match:B,commands:f,chain:d,can:m,pasteEvent:a,dropEvent:u});p.push(ie)})}),p.every(S=>S!==null)}function HM(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(d=>new At({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,u=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],w=S.getMeta("uiEvent")==="paste"&&!i,M=S.getMeta("uiEvent")==="drop"&&!o;if(!w&&!M)return;const T=p.doc.content.findDiffStart(y.doc.content),O=p.doc.content.findDiffEnd(y.doc.content);if(!zM(T)||!O||T===O.b)return;const F=y.tr,B=Al({state:y,transaction:F});if(!(!$M({editor:e,state:B,from:Math.max(T-1,0),to:O.b-1,rule:d,pasteEvent:a,dropEvent:u})||!F.steps.length))return u=new DragEvent("drop"),a=new ClipboardEvent("paste"),F}}))}function WM(n){const e=n.filter((t,r)=>n.indexOf(t)!==r);return[...new Set(e)]}class Gi{constructor(e,t){this.splittableMarks=[],this.editor=t,this.extensions=Gi.resolve(e),this.schema=i0(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:Xc(r.name,this.schema)};r.type==="mark"&&(!((i=ae(V(r,"keepOnSplit",o)))!==null&&i!==void 0)||i)&&this.splittableMarks.push(r.name);const a=V(r,"onBeforeCreate",o);a&&this.editor.on("beforeCreate",a);const u=V(r,"onCreate",o);u&&this.editor.on("create",u);const f=V(r,"onUpdate",o);f&&this.editor.on("update",f);const d=V(r,"onSelectionUpdate",o);d&&this.editor.on("selectionUpdate",d);const m=V(r,"onTransaction",o);m&&this.editor.on("transaction",m);const p=V(r,"onFocus",o);p&&this.editor.on("focus",p);const y=V(r,"onBlur",o);y&&this.editor.on("blur",y);const S=V(r,"onDestroy",o);S&&this.editor.on("destroy",S)})}static resolve(e){const t=Gi.sort(Gi.flatten(e)),r=WM(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=V(t,"addExtensions",r);return i?[t,...this.flatten(i())]:t}).flat(10)}static sort(e){return e.sort((r,i)=>{const o=V(r,"priority")||100,a=V(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:Xc(t.name,this.schema)},i=V(t,"addCommands",r);return i?{...e,...i()}:e},{})}get plugins(){const{editor:e}=this,t=Gi.sort([...this.extensions].reverse()),r=[],i=[],o=t.map(a=>{const u={name:a.name,options:a.options,storage:a.storage,editor:e,type:Xc(a.name,this.schema)},f=[],d=V(a,"addKeyboardShortcuts",u);let m={};if(a.type==="mark"&&a.config.exitable&&(m.ArrowRight=()=>It.handleExit({editor:e,mark:a})),d){const M=Object.fromEntries(Object.entries(d()).map(([T,O])=>[T,()=>O({editor:e})]));m={...m,...M}}const p=iM(m);f.push(p);const y=V(a,"addInputRules",u);s0(a,e.options.enableInputRules)&&y&&r.push(...y());const S=V(a,"addPasteRules",u);s0(a,e.options.enablePasteRules)&&S&&i.push(...S());const w=V(a,"addProseMirrorPlugins",u);if(w){const M=w();f.push(...M)}return f}).flat();return[DM({editor:e,rules:r}),...HM({editor:e,rules:i}),...o]}get attributes(){return t0(this.extensions)}get nodeViews(){const{editor:e}=this,{nodeExtensions:t}=Ol(this.extensions);return Object.fromEntries(t.filter(r=>!!V(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:qe(r.name,this.schema)},a=V(r,"addNodeView",o);if(!a)return[];const u=(f,d,m,p)=>{const y=Yc(f,i);return a()({editor:e,node:f,getPos:m,decorations:p,HTMLAttributes:y,extension:r})};return[r.name,u]}))}}function UM(n){return Object.prototype.toString.call(n).slice(8,-1)}function ef(n){return UM(n)!=="Object"?!1:n.constructor===Object&&Object.getPrototypeOf(n)===Object.prototype}function Il(n,e){const t={...n};return ef(n)&&ef(e)&&Object.keys(e).forEach(r=>{ef(e[r])?r in n?t[r]=Il(n[r],e[r]):Object.assign(t,{[r]:e[r]}):Object.assign(t,{[r]:e[r]})}),t}class Pe{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=ae(V(this,"addOptions",{name:this.name}))),this.storage=ae(V(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(e={}){return new Pe(e)}configure(e={}){const t=this.extend();return t.options=Il(this.options,e),t.storage=ae(V(t,"addStorage",{name:t.name,options:t.options})),t}extend(e={}){const t=new Pe(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=ae(V(t,"addOptions",{name:t.name})),t.storage=ae(V(t,"addStorage",{name:t.name,options:t.options})),t}}function VM(n,e,t){const{from:r,to:i}=e,{blockSeparator:o=`
11
+ `))),0,0):U.empty;let p=n.someProp("clipboardTextParser",y=>y(e,i,r,n));if(p)u=p;else{let y=i.marks(),{schema:S}=n.state,w=ni.fromSchema(S);a=document.createElement("div"),e.split(/(?:\r\n?|\n)+/).forEach(M=>{let T=a.appendChild(document.createElement("p"));M&&T.appendChild(w.serializeNode(S.text(M,y)))})}}else n.someProp("transformPastedHTML",p=>{t=p(t,n)}),a=Ik(t),Pc&&Nk(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(u||(u=(n.someProp("clipboardParser")||n.someProp("domParser")||vc.fromSchema(n.state.schema)).parseSlice(a,{preserveWhitespace:!!(f||m),context:i,ruleFromNode(y){return y.nodeName=="BR"&&!y.nextSibling&&y.parentNode&&!Ak.test(y.parentNode.nodeName)?{ignore:!0}:null}})),m)u=Rk(Dg(u,+m[1],+m[2]),m[4]);else if(u=U.maxOpen(Ok(u.content,i),!0),u.openStart||u.openEnd){let p=0,y=0;for(let S=u.content.firstChild;p<u.openStart&&!S.type.spec.isolating;p++,S=S.firstChild);for(let S=u.content.lastChild;y<u.openEnd&&!S.type.spec.isolating;y++,S=S.lastChild);u=Dg(u,p,y)}return n.someProp("transformPasted",p=>{u=p(u,n)}),u}const Ak=/^(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 Ok(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&&Lg(f,o,u,a[a.length-1],0))a[a.length-1]=h;else{a.length&&(a[a.length-1]=Pg(a[a.length-1],o.length));let m=Rg(u,f);a.push(m),i=i.matchType(m.type),o=f}}),a)return L.from(a)}return n}function Rg(n,e,t=0){for(let r=e.length-1;r>=t;r--)n=e[r].create(null,L.from(n));return n}function Lg(n,e,t,r,i){if(i<n.length&&i<e.length&&n[i]==e[i]){let o=Lg(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(Rg(t,n,i+1))))}}function Pg(n,e){if(e==0)return n;let t=n.content.replaceChild(n.childCount-1,Pg(n.lastChild,e-1)),r=n.contentMatchAt(n.childCount).fillBefore(L.empty,!0);return n.copy(t.append(r))}function Wc(n,e,t,r,i,o){let a=e<0?n.firstChild:n.lastChild,u=a.content;return i<r-1&&(u=Wc(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 Dg(n,e,t){return e<n.openStart&&(n=new U(Wc(n.content,-1,e,n.openStart,0,n.openEnd),e,n.openEnd)),t<n.openEnd&&(n=new U(Wc(n.content,1,t,n.openEnd,0,0),n.openStart,t)),n}const zg={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 Bg=null;function Fg(){return Bg||(Bg=document.implementation.createHTMLDocument("title"))}function Ik(n){let e=/^(\s*<meta [^>]*>)*/.exec(n);e&&(n=n.slice(e[0].length));let t=Fg().createElement("div"),r=/<([a-z][^>\s]+)/i.exec(n),i;if((i=r&&zg[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 Nk(n){let e=n.querySelectorAll(Ii?"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 Rk(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 U(i,o,a)}const un={},Ot={};function pr(n,e){n.input.lastSelectionOrigin=e,n.input.lastSelectionTime=Date.now()}Ot.keydown=(n,e)=>{let t=e;if(n.input.shiftKey=t.keyCode==16||t.shiftKey,!Hg(n,t)&&(n.input.lastKeyCode=t.keyCode,n.input.lastKeyCodeTime=Date.now(),!(Ps&&Ii&&t.keyCode==13)))if(t.keyCode!=229&&n.domObserver.forceFlush(),Lc&&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,gg(13,"Enter"))),n.input.lastIOSEnter=0)},200)}else n.someProp("handleKeyDown",r=>r(n,t))||Ck(n,t)?t.preventDefault():pr(n,"key")},Ot.keyup=(n,e)=>{e.keyCode==16&&(n.input.shiftKey=!1)},Ot.keypress=(n,e)=>{let t=e;if(Hg(n,t)||!t.charCode||t.ctrlKey&&!t.altKey||Vt&&t.metaKey)return;if(n.someProp("handleKeyPress",i=>i(n,t))){t.preventDefault();return}let r=n.state.selection;if(!(r instanceof me)||!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 kl(n){return{left:n.clientX,top:n.clientY}}function Lk(n,e){let t=e.x-n.clientX,r=e.y-n.clientY;return t*t+r*r<100}function Uc(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 Ni(n,e,t){n.focused||n.focus();let r=n.state.tr.setSelection(e);r.setMeta("pointer",!0),n.dispatch(r)}function Pk(n,e){if(e==-1)return!1;let t=n.state.doc.resolve(e),r=t.nodeAfter;return r&&r.isAtom&&Z.isSelectable(r)?(Ni(n,new Z(t)),!0):!1}function Dk(n,e){if(e==-1)return!1;let t=n.state.selection,r,i;t instanceof Z&&(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(Z.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?(Ni(n,Z.create(n.state.doc,i)),!0):!1}function zk(n,e,t,r,i){return Uc(n,"handleClickOn",e,t,r)||n.someProp("handleClick",o=>o(n,e,r))||(i?Dk(n,t):Pk(n,t))}function Bk(n,e,t,r){return Uc(n,"handleDoubleClickOn",e,t,r)||n.someProp("handleDoubleClick",i=>i(n,e,r))}function Fk(n,e,t,r){return Uc(n,"handleTripleClickOn",e,t,r)||n.someProp("handleTripleClick",i=>i(n,e,r))||$k(n,t,r)}function $k(n,e,t){if(t.button!=0)return!1;let r=n.state.doc;if(e==-1)return r.inlineContent?(Ni(n,me.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)Ni(n,me.create(r,u+1,u+1+a.content.size));else if(Z.isSelectable(a))Ni(n,Z.create(r,u));else continue;return!0}}function Vc(n){return Ml(n)}const $g=Vt?"metaKey":"ctrlKey";un.mousedown=(n,e)=>{let t=e;n.input.shiftKey=t.shiftKey;let r=Vc(n),i=Date.now(),o="singleClick";i-n.input.lastClick.time<500&&Lk(t,n.input.lastClick)&&!t[$g]&&(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(kl(t));a&&(o=="singleClick"?(n.input.mouseDown&&n.input.mouseDown.done(),n.input.mouseDown=new Hk(n,a,t,!!r)):(o=="doubleClick"?Bk:Fk)(n,a.pos,a.inside,t)?t.preventDefault():pr(n,"pointer"))};class Hk{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[$g],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 Z&&h.from<=a&&h.to>a)&&(this.mightDrag={node:o,pos:a,addAttr:!!(this.target&&!this.target.draggable),setUneditable:!!(this.target&&_l&&!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)),pr(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(()=>Dc(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(kl(e))),this.updateAllowDefault(e),this.allowDefault||!t?pr(this.view,"pointer"):zk(this.view,t.pos,t.inside,e,this.selectNode)?e.preventDefault():e.button==0&&(this.flushed||Wr&&this.mightDrag&&!this.mightDrag.node.isAtom||Ii&&!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)?(Ni(this.view,pe.near(this.view.state.doc.resolve(t.pos))),e.preventDefault()):pr(this.view,"pointer")}move(e){this.updateAllowDefault(e),pr(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)}}un.touchstart=n=>{n.input.lastTouch=Date.now(),Vc(n),pr(n,"pointer")},un.touchmove=n=>{n.input.lastTouch=Date.now(),pr(n,"pointer")},un.contextmenu=n=>Vc(n);function Hg(n,e){return n.composing?!0:Wr&&Math.abs(e.timeStamp-n.input.compositionEndedAt)<500?(n.input.compositionEndedAt=-2e8,!0):!1}const Wk=Ps?5e3:-1;Ot.compositionstart=Ot.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(),Ml(n,!0),n.markCursor=null;else if(Ml(n),_l&&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}Wg(n,Wk)},Ot.compositionend=(n,e)=>{n.composing&&(n.input.composing=!1,n.input.compositionEndedAt=e.timeStamp,Wg(n,20))};function Wg(n,e){clearTimeout(n.input.composingTimeout),e>-1&&(n.input.composingTimeout=setTimeout(()=>Ml(n),e))}function Uk(n){for(n.composing&&(n.input.composing=!1,n.input.compositionEndedAt=Vk());n.input.compositionNodes.length>0;)n.input.compositionNodes.pop().markParentsDirty()}function Vk(){let n=document.createEvent("Event");return n.initEvent("event",!0,!0),n.timeStamp}function Ml(n,e=!1){if(!(Ps&&n.domObserver.flushingSoon>=0)){if(n.domObserver.forceFlush(),Uk(n),e||n.docView&&n.docView.dirty){let t=wk(n);return t&&!t.eq(n.state.selection)?n.dispatch(n.state.tr.setSelection(t)):n.updateState(n.state),!0}return!1}}function Kk(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 Ri=Ls&&vg<15||Lc&&Sk<604;un.copy=Ot.cut=(n,e)=>{let t=e,r=n.state.selection,i=t.type=="cut";if(r.empty)return;let o=Ri?null:t.clipboardData,a=r.content(),{dom:u,text:f}=Ig(n,a);o?(t.preventDefault(),o.clearData(),o.setData("text/html",u.innerHTML),o.setData("text/plain",f)):Kk(n,u),i&&n.dispatch(n.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))};function Gk(n){return n.openStart==0&&n.openEnd==0&&n.content.childCount==1?n.content.firstChild:null}function qk(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?Kc(n,r.value,null,e):Kc(n,r.textContent,r.innerHTML,e)},50)}function Kc(n,e,t,r){let i=Ng(n,e,t,n.input.shiftKey,n.state.selection.$from);if(n.someProp("handlePaste",u=>u(n,r,i||U.empty)))return!0;if(!i)return!1;let o=Gk(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}Ot.paste=(n,e)=>{let t=e;if(n.composing&&!Ps)return;let r=Ri?null:t.clipboardData;r&&Kc(n,r.getData("text/plain"),r.getData("text/html"),t)?t.preventDefault():qk(n,t)};class Jk{constructor(e,t){this.slice=e,this.move=t}}const Ug=Vt?"altKey":"ctrlKey";un.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(kl(t));if(!(o&&o.pos>=i.from&&o.pos<=(i instanceof Z?i.to-1:i.to))){if(r&&r.mightDrag)n.dispatch(n.state.tr.setSelection(Z.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(Z.create(n.state.doc,h.posBefore)))}}let a=n.state.selection.content(),{dom:u,text:f}=Ig(n,a);t.dataTransfer.clearData(),t.dataTransfer.setData(Ri?"Text":"text/html",u.innerHTML),t.dataTransfer.effectAllowed="copyMove",Ri||t.dataTransfer.setData("text/plain",f),n.dragging=new Jk(a,!t[Ug])},un.dragend=n=>{let e=n.dragging;window.setTimeout(()=>{n.dragging==e&&(n.dragging=null)},50)},Ot.dragover=Ot.dragenter=(n,e)=>e.preventDefault(),Ot.drop=(n,e)=>{let t=e,r=n.dragging;if(n.dragging=null,!t.dataTransfer)return;let i=n.posAtCoords(kl(t));if(!i)return;let o=n.state.doc.resolve(i.pos),a=r&&r.slice;a?n.someProp("transformPasted",w=>{a=w(a,n)}):a=Ng(n,t.dataTransfer.getData(Ri?"Text":"text/plain"),Ri?null:t.dataTransfer.getData("text/html"),!1,o);let u=!!(r&&!t[Ug]);if(n.someProp("handleDrop",w=>w(n,t,a||U.empty,u))){t.preventDefault();return}if(!a)return;t.preventDefault();let f=a?ok(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,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&&Z.isSelectable(a.content.firstChild)&&S.nodeAfter&&S.nodeAfter.sameMarkup(a.content.firstChild))h.setSelection(new Z(S));else{let w=h.mapping.map(f);h.mapping.maps[h.mapping.maps.length-1].forEach((M,T,O,F)=>w=F),h.setSelection(kg(n,S,h.doc.resolve(w)))}n.focus(),n.dispatch(h.setMeta("uiEvent","drop"))},un.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())&&Dc(n)},20))},un.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)},un.beforeinput=(n,e)=>{if(Ii&&Ps&&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,gg(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 Ot)un[n]=Ot[n];function zs(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 eh{constructor(e,t){this.toDOM=e,this.spec=t||Vr,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 eh&&(this.spec.key&&this.spec.key==e.spec.key||this.toDOM==e.toDOM&&zs(this.spec,e.spec))}destroy(e){this.spec.destroy&&this.spec.destroy(e)}}class _r{constructor(e,t){this.attrs=e,this.spec=t||Vr}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 _r&&zs(this.attrs,e.attrs)&&zs(this.spec,e.spec)}static is(e){return e.type instanceof _r}destroy(){}}class th{constructor(e,t){this.attrs=e,this.spec=t||Vr}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 th&&zs(this.attrs,e.attrs)&&zs(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 eh(t,r))}static inline(e,t,r,i){return new Mn(e,t,new _r(r,i))}static node(e,t,r,i){return new Mn(e,t,new th(r,i))}get spec(){return this.type.spec}get inline(){return this.type instanceof _r}}const Li=[],Vr={};class Xe{constructor(e,t){this.local=e.length?e:Li,this.children=t.length?t:Li}static create(e,t){return t.length?Tl(t,e,0,Vr):mt}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==mt||e.maps.length==0?this:this.mapInner(e,t,0,0,r||Vr)}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?jk(this.children,a||[],e,t,r,i,o):a?new Xe(a.sort(Kr),Li):mt}add(e,t){return t.length?this==mt?Xe.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=Kg(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,Tl(m,u,h+1,Vr)),o+=3}});let a=Vg(o?Gg(t):t,-r);for(let u=0;u<a.length;u++)a[u].type.valid(e,a[u])||a.splice(u--,1);return new Xe(a.length?this.local.concat(a).sort(Kr):this.local,i||this.children)}remove(e){return e.length==0||this==mt?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!=mt?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 Xe(i,r):mt}forChild(e,t){if(this==mt)return this;if(t.isLeaf)return Xe.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 _r){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 Xe(i.sort(Kr),Li);return r?new ti([u,r]):u}return r||mt}eq(e){if(this==e)return!0;if(!(e instanceof Xe)||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==mt)return Li;if(e.inlineContent||!this.local.some(_r.is))return this.local;let t=[];for(let r=0;r<this.local.length;r++)this.local[r].type instanceof _r||t.push(this.local[r]);return t}}Xe.empty=new Xe([],[]),Xe.removeOverlap=Gc;const mt=Xe.empty;class ti{constructor(e){this.members=e}map(e,t){const r=this.members.map(i=>i.map(e,t,Vr));return ti.from(r)}forChild(e,t){if(t.isLeaf)return Xe.empty;let r=[];for(let i=0;i<this.members.length;i++){let o=this.members[i].forChild(e,t);o!=mt&&(o instanceof ti?r=r.concat(o.members):r.push(o))}return ti.from(r)}eq(e){if(!(e instanceof ti)||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(Kr)):Li}static from(e){switch(e.length){case 0:return mt;case 1:return e[0];default:return new ti(e.every(t=>t instanceof Xe)?e:e.reduce((t,r)=>t.concat(r instanceof Xe?r:r.members),[]))}}}function jk(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((y,S,w,M)=>{let T=M-w-(S-y);for(let O=0;O<u.length;O+=3){let F=u[O+1];if(F<0||y>F+m-p)continue;let B=u[O]+m-p;S>=B?u[O+1]=y<=B?-2:-1:w>=i&&T&&(u[O]+=T,u[O+1]+=T)}p+=T}),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 y=t.map(n[h+1]+o,-1),S=y-i,{index:w,offset:M}=r.content.findIndex(p),T=r.maybeChild(w);if(T&&M==p&&M+T.nodeSize==S){let O=u[h+2].mapInner(t,T,m+1,n[h]+o+1,a);O!=mt?(u[h]=p,u[h+1]=S,u[h+2]=O):(u[h+1]=-2,f=!0)}else f=!0}if(f){let h=Yk(u,n,e,t,i,o,a),m=Tl(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,y=0;p<m.children.length;p+=3){let S=m.children[p];for(;y<u.length&&u[y]<S;)y+=3;u.splice(y,0,m.children[p],m.children[p+1],m.children[p+2])}}return new Xe(e.sort(Kr),u)}function Vg(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 Yk(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 Kg(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 Gg(n){let e=[];for(let t=0;t<n.length;t++)n[t]!=null&&e.push(n[t]);return e}function Tl(n,e,t,r){let i=[],o=!1;e.forEach((u,f)=>{let h=Kg(n,u,f+t);if(h){o=!0;let m=Tl(h,u,t+f+1,r);m!=mt&&i.push(f,f+u.nodeSize,m)}});let a=Vg(o?Gg(n):n,-t).sort(Kr);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 Xe(a,i):mt}function Kr(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),qg(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),qg(e,i,r.copy(o.from,r.to)));break}}}return e}function qg(n,e,t){for(;e<n.length&&Kr(t,n[e])>0;)e++;n.splice(e,0,t)}for(var mr={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:"'"},Cl={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},Jg=typeof navigator<"u"&&/Chrome\/(\d+)/.exec(navigator.userAgent),Xk=typeof navigator<"u"&&/Mac/.test(navigator.platform),Zk=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),Qk=Xk||Jg&&+Jg[1]<57,rt=0;rt<10;rt++)mr[48+rt]=mr[96+rt]=String(rt);for(var rt=1;rt<=24;rt++)mr[rt+111]="F"+rt;for(var rt=65;rt<=90;rt++)mr[rt]=String.fromCharCode(rt+32),Cl[rt]=String.fromCharCode(rt);for(var qc in mr)Cl.hasOwnProperty(qc)||(Cl[qc]=mr[qc]);function eM(n){var e=Qk&&(n.ctrlKey||n.altKey||n.metaKey)||Zk&&n.shiftKey&&n.key&&n.key.length==1||n.key=="Unidentified",t=!e&&n.key||(n.shiftKey?Cl:mr)[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 tM=typeof navigator<"u"?/Mac|iP(hone|[oa]d)/.test(navigator.platform):!1;function nM(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))tM?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 rM(n){let e=Object.create(null);for(let t in n)e[nM(t)]=n[t];return e}function Jc(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 iM(n){return new At({props:{handleKeyDown:sM(n)}})}function sM(n){let e=rM(n);return function(t,r){let i=eM(r),o=i.length==1&&i!=" ",a,u=e[Jc(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=mr[r.keyCode])&&a!=i){let f=e[Jc(a,r,!0)];if(f&&f(t.state,t.dispatch,t))return!0}else if(o&&r.shiftKey){let f=e[Jc(i,r,!0)];if(f&&f(t.state,t.dispatch,t))return!0}return!1}}const oM=(n,e)=>n.selection.empty?!1:(e&&e(n.tr.deleteSelection().scrollIntoView()),!0);function lM(n,e){let{$cursor:t}=n.selection;return!t||(e?!e.endOfTextblock("backward",n):t.parentOffset>0)?null:t}const aM=(n,e,t)=>{let r=lM(n,t);if(!r)return!1;let i=jg(r);if(!i){let a=r.blockRange(),u=a&&Ti(a);return u==null?!1:(e&&e(n.tr.lift(a,u).scrollIntoView()),!0)}let o=i.nodeBefore;if(!o.type.spec.isolating&&Zg(n,i,e))return!0;if(r.parent.content.size==0&&(Pi(o,"end")||Z.isSelectable(o))){let a=Mc(n.doc,r.before(),r.after(),U.empty);if(a&&a.slice.size<a.to-a.from){if(e){let u=n.tr.step(a);u.setSelection(Pi(o,"end")?pe.findFrom(u.doc.resolve(u.mapping.map(i.pos,-1)),-1):Z.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 Pi(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 uM=(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=jg(r)}let a=o&&o.nodeBefore;return!a||!Z.isSelectable(a)?!1:(e&&e(n.tr.setSelection(Z.create(n.doc,o.pos-a.nodeSize)).scrollIntoView()),!0)};function jg(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 cM(n,e){let{$cursor:t}=n.selection;return!t||(e?!e.endOfTextblock("forward",n):t.parentOffset<t.parent.content.size)?null:t}const fM=(n,e,t)=>{let r=cM(n,t);if(!r)return!1;let i=Yg(r);if(!i)return!1;let o=i.nodeAfter;if(Zg(n,i,e))return!0;if(r.parent.content.size==0&&(Pi(o,"start")||Z.isSelectable(o))){let a=Mc(n.doc,r.before(),r.after(),U.empty);if(a&&a.slice.size<a.to-a.from){if(e){let u=n.tr.step(a);u.setSelection(Pi(o,"start")?pe.findFrom(u.doc.resolve(u.mapping.map(i.pos)),1):Z.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},hM=(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||!Z.isSelectable(a)?!1:(e&&e(n.tr.setSelection(Z.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 dM=(n,e)=>{let t=n.selection,r=t instanceof Z,i;if(r){if(t.node.isTextblock||!fr(n.doc,t.from))return!1;i=t.from}else if(i=Sl(n.doc,t.from,-1),i==null)return!1;if(e){let o=n.tr.join(i);r&&o.setSelection(Z.create(o.doc,i-n.doc.resolve(i).nodeBefore.nodeSize)),e(o.scrollIntoView())}return!0},pM=(n,e)=>{let t=n.selection,r;if(t instanceof Z){if(t.node.isTextblock||!fr(n.doc,t.to))return!1;r=t.to}else if(r=Sl(n.doc,t.to,1),r==null)return!1;return e&&e(n.tr.join(r).scrollIntoView()),!0},mM=(n,e)=>{let{$from:t,$to:r}=n.selection,i=t.blockRange(r),o=i&&Ti(i);return o==null?!1:(e&&e(n.tr.lift(i,o).scrollIntoView()),!0)},gM=(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 Xg(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 yM=(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=Xg(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(pe.near(f.doc.resolve(u),1)),e(f.scrollIntoView())}return!0},bM=(n,e)=>{let t=n.selection,{$from:r,$to:i}=t;if(t instanceof hn||r.parent.inlineContent||i.parent.inlineContent)return!1;let o=Xg(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(me.create(u.doc,a+1)),e(u.scrollIntoView())}return!0},vM=(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(Ci(n.doc,o))return e&&e(n.tr.split(o).scrollIntoView()),!0}let r=t.blockRange(),i=r&&Ti(r);return i==null?!1:(e&&e(n.tr.lift(r,i).scrollIntoView()),!0)},SM=(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(Z.create(n.doc,i))),!0)};function wM(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||fr(n.doc,e.pos))?!1:(t&&t(n.tr.clearIncompatible(e.pos,r.type,r.contentMatchAt(r.childCount)).join(e.pos).scrollIntoView()),!0)}function Zg(n,e,t){let r=e.nodeBefore,i=e.nodeAfter,o,a;if(r.type.spec.isolating||i.type.spec.isolating)return!1;if(wM(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,y=L.empty;for(let M=o.length-1;M>=0;M--)y=L.from(o[M].create(null,y));y=L.from(r.copy(y));let S=n.tr.step(new Ye(e.pos-1,p,e.pos,p,new U(y,1,0),o.length,!0)),w=p+2*o.length;fr(S.doc,w)&&S.join(w),t(S.scrollIntoView())}return!0}let f=pe.findFrom(e,1),h=f&&f.$from.blockRange(f.$to),m=h&&Ti(h);if(m!=null&&m>=e.depth)return t&&t(n.tr.lift(h,m).scrollIntoView()),!0;if(u&&Pi(i,"start",!0)&&Pi(r,"end")){let p=r,y=[];for(;y.push(p),!p.isTextblock;)p=p.lastChild;let S=i,w=1;for(;!S.isTextblock;S=S.firstChild)w++;if(p.canReplace(p.childCount,p.childCount,S.content)){if(t){let M=L.empty;for(let O=y.length-1;O>=0;O--)M=L.from(y[O].copy(M));let T=n.tr.step(new Ye(e.pos-y.length,e.pos+i.nodeSize,e.pos+w,e.pos+i.nodeSize-w,new U(M,y.length,0),0,!0));t(T.scrollIntoView())}return!0}}return!1}function Qg(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(me.create(e.doc,n<0?i.start(o):i.end(o)))),!0):!1}}const xM=Qg(-1),_M=Qg(1);function EM(n,e=null){return function(t,r){let{$from:i,$to:o}=t.selection,a=i.blockRange(o),u=a&&kc(a,n,e);return u?(r&&r(t.tr.wrap(a,u).scrollIntoView()),!0):!1}}function e0(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 kM(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 ml(m,m,a.depth),a.endIndex<a.parent.childCount&&(a=new ml(i,t.doc.resolve(o.end(a.depth)),a.depth)),u=!0}let h=kc(f,n,e,a);return h?(r&&r(MM(t.tr,a,h,u,n).scrollIntoView()),!0):!1}}function MM(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 Ye(e.start-(r?2:0),e.end,e.start,e.end,new U(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,y=!0;m<p;m++,y=!1)!y&&Ci(n.doc,f,u)&&(n.split(f,u),f+=2*u),f+=h.child(m).nodeSize;return n}function TM(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?CM(e,t,n,o):AM(e,t,o):!0:!1}}function CM(n,e,t,r){let i=n.tr,o=r.end,a=r.$to.end(r.depth);o<a&&(i.step(new Ye(o-1,a,o,a,new U(L.from(t.create(null,r.parent.copy())),1,0),1,!0)),r=new ml(i.doc.resolve(r.$from.pos),i.doc.resolve(a),r.depth));const u=Ti(r);if(u==null)return!1;i.lift(r,u);let f=i.mapping.map(o,-1)-1;return fr(i.doc,f)&&i.join(f),e(i.scrollIntoView()),!0}function AM(n,e,t){let r=n.tr,i=t.parent;for(let S=t.end,w=t.endIndex-1,M=t.startIndex;w>M;w--)S-=i.child(w).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,y=p+a.nodeSize;return r.step(new Ye(p-(u?1:0),y+(f?1:0),p+1,y-1,new U((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 OM(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 U(L.from(n.create(null,L.from(u.type.create(null,m)))),h?3:1,0),y=o.start,S=o.end;t(e.tr.step(new Ye(y-(h?3:1),S,y,S,p,1,!0)).scrollIntoView())}return!0}}function Al(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 jc{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(y=>y===!0)),p={...Object.fromEntries(Object.entries(r).map(([y,S])=>[y,(...M)=>{const T=this.buildProps(h,t),O=S(...M)(T);return u.push(O),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:Al({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 V(n,e,t){return n.config[e]===void 0&&n.parent?V(n.parent,e,t):typeof n.config[e]=="function"?n.config[e].bind({...t,parent:n.parent?V(n.parent,e,t):null}):n.config[e]}function Ol(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 t0(n){const e=[],{nodeExtensions:t,markExtensions:r}=Ol(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=V(a,"addGlobalAttributes",u);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 u={name:a.name,options:a.options,storage:a.storage},f=V(a,"addAttributes",u);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 qe(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 Di(...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 Yc(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)=>Di(t,r),{})}function IM(n){return typeof n=="function"}function ae(n,e=void 0,...t){return IM(n)?e?n.bind(e)(...t):n(...t):n}function NM(n={}){return Object.keys(n).length===0&&n.constructor===Object}function RM(n){return typeof n!="string"?n:n.match(/^[+-]?(?:\d*\.)?\d+$/)?Number(n):n==="true"?!0:n==="false"?!1:n}function n0(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):RM(t.getAttribute(a.name));return u==null?o:{...o,[a.name]:u}},{});return{...r,...i}}}}function r0(n){return Object.fromEntries(Object.entries(n).filter(([e,t])=>e==="attrs"&&NM(t)?!1:t!=null))}function i0(n,e){var t;const r=t0(n),{nodeExtensions:i,markExtensions:o}=Ol(n),a=(t=i.find(h=>V(h,"topNode")))===null||t===void 0?void 0:t.name,u=Object.fromEntries(i.map(h=>{const m=r.filter(O=>O.type===h.name),p={name:h.name,options:h.options,storage:h.storage,editor:e},y=n.reduce((O,F)=>{const B=V(F,"extendNodeSchema",p);return{...O,...B?B(h):{}}},{}),S=r0({...y,content:ae(V(h,"content",p)),marks:ae(V(h,"marks",p)),group:ae(V(h,"group",p)),inline:ae(V(h,"inline",p)),atom:ae(V(h,"atom",p)),selectable:ae(V(h,"selectable",p)),draggable:ae(V(h,"draggable",p)),code:ae(V(h,"code",p)),defining:ae(V(h,"defining",p)),isolating:ae(V(h,"isolating",p)),attrs:Object.fromEntries(m.map(O=>{var F;return[O.name,{default:(F=O?.attribute)===null||F===void 0?void 0:F.default}]}))}),w=ae(V(h,"parseHTML",p));w&&(S.parseDOM=w.map(O=>n0(O,m)));const M=V(h,"renderHTML",p);M&&(S.toDOM=O=>M({node:O,HTMLAttributes:Yc(O,m)}));const T=V(h,"renderText",p);return T&&(S.toText=T),[h.name,S]})),f=Object.fromEntries(o.map(h=>{const m=r.filter(T=>T.type===h.name),p={name:h.name,options:h.options,storage:h.storage,editor:e},y=n.reduce((T,O)=>{const F=V(O,"extendMarkSchema",p);return{...T,...F?F(h):{}}},{}),S=r0({...y,inclusive:ae(V(h,"inclusive",p)),excludes:ae(V(h,"excludes",p)),group:ae(V(h,"group",p)),spanning:ae(V(h,"spanning",p)),code:ae(V(h,"code",p)),attrs:Object.fromEntries(m.map(T=>{var O;return[T.name,{default:(O=T?.attribute)===null||O===void 0?void 0:O.default}]}))}),w=ae(V(h,"parseHTML",p));w&&(S.parseDOM=w.map(T=>n0(T,m)));const M=V(h,"renderHTML",p);return M&&(S.toDOM=T=>M({mark:T,HTMLAttributes:Yc(T,m)})),[h.name,S]}));return new zE({topNode:a,nodes:u,marks:f})}function Xc(n,e){return e.nodes[n]||e.marks[n]||null}function s0(n,e){return Array.isArray(e)?e.some(t=>(typeof t=="string"?t:t.name)===n.name):e}const LM=(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 Zc(n){return Object.prototype.toString.call(n)==="[object RegExp]"}class o0{constructor(e){this.find=e.find,this.handler=e.handler}}const PM=(n,e)=>{if(Zc(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 Qc(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(y=>y.type.spec.code))return!1;let m=!1;const p=LM(h)+o;return a.forEach(y=>{if(m)return;const S=PM(p,y.find);if(!S)return;const w=f.state.tr,M=Al({state:f.state,transaction:w}),T={from:r-(S[0].length-o.length),to:i},{commands:O,chain:F,can:B}=new jc({editor:t,state:M});y.handler({state:M,range:T,match:S,commands:O,chain:F,can:B})===null||!w.steps.length||(w.setMeta(u,{transform:w,from:r,to:i,text:o}),f.dispatch(w),m=!0)}),m}function DM(n){const{editor:e,rules:t}=n,r=new At({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 Qc({editor:e,from:o,to:a,text:u,rules:t,plugin:r})},handleDOMEvents:{compositionend:i=>(setTimeout(()=>{const{$cursor:o}=i.state.selection;o&&Qc({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?Qc({editor:e,from:a.pos,to:a.pos,text:`
13
+ `,rules:t,plugin:r}):!1}},isInputRules:!0});return r}function zM(n){return typeof n=="number"}class BM{constructor(e){this.find=e.find,this.handler=e.handler}}const FM=(n,e)=>{if(Zc(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 $M(n){const{editor:e,state:t,from:r,to:i,rule:o,pasteEvent:a,dropEvent:u}=n,{commands:f,chain:h,can:m}=new jc({editor:e,state:t}),p=[];return t.doc.nodesBetween(r,i,(S,w)=>{if(!S.isTextblock||S.type.spec.code)return;const M=Math.max(r,w),T=Math.min(i,w+S.content.size),O=S.textBetween(M-w,T-w,void 0,"\uFFFC");FM(O,o.find).forEach(B=>{if(B.index===void 0)return;const H=M+B.index+1,X=H+B[0].length,q={from:t.tr.mapping.map(H),to:t.tr.mapping.map(X)},ie=o.handler({state:t,range:q,match:B,commands:f,chain:h,can:m,pasteEvent:a,dropEvent:u});p.push(ie)})}),p.every(S=>S!==null)}function HM(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 At({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,u=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],w=S.getMeta("uiEvent")==="paste"&&!i,M=S.getMeta("uiEvent")==="drop"&&!o;if(!w&&!M)return;const T=p.doc.content.findDiffStart(y.doc.content),O=p.doc.content.findDiffEnd(y.doc.content);if(!zM(T)||!O||T===O.b)return;const F=y.tr,B=Al({state:y,transaction:F});if(!(!$M({editor:e,state:B,from:Math.max(T-1,0),to:O.b-1,rule:h,pasteEvent:a,dropEvent:u})||!F.steps.length))return u=new DragEvent("drop"),a=new ClipboardEvent("paste"),F}}))}function WM(n){const e=n.filter((t,r)=>n.indexOf(t)!==r);return[...new Set(e)]}class Gi{constructor(e,t){this.splittableMarks=[],this.editor=t,this.extensions=Gi.resolve(e),this.schema=i0(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:Xc(r.name,this.schema)};r.type==="mark"&&(!((i=ae(V(r,"keepOnSplit",o)))!==null&&i!==void 0)||i)&&this.splittableMarks.push(r.name);const a=V(r,"onBeforeCreate",o);a&&this.editor.on("beforeCreate",a);const u=V(r,"onCreate",o);u&&this.editor.on("create",u);const f=V(r,"onUpdate",o);f&&this.editor.on("update",f);const h=V(r,"onSelectionUpdate",o);h&&this.editor.on("selectionUpdate",h);const m=V(r,"onTransaction",o);m&&this.editor.on("transaction",m);const p=V(r,"onFocus",o);p&&this.editor.on("focus",p);const y=V(r,"onBlur",o);y&&this.editor.on("blur",y);const S=V(r,"onDestroy",o);S&&this.editor.on("destroy",S)})}static resolve(e){const t=Gi.sort(Gi.flatten(e)),r=WM(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=V(t,"addExtensions",r);return i?[t,...this.flatten(i())]:t}).flat(10)}static sort(e){return e.sort((r,i)=>{const o=V(r,"priority")||100,a=V(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:Xc(t.name,this.schema)},i=V(t,"addCommands",r);return i?{...e,...i()}:e},{})}get plugins(){const{editor:e}=this,t=Gi.sort([...this.extensions].reverse()),r=[],i=[],o=t.map(a=>{const u={name:a.name,options:a.options,storage:a.storage,editor:e,type:Xc(a.name,this.schema)},f=[],h=V(a,"addKeyboardShortcuts",u);let m={};if(a.type==="mark"&&a.config.exitable&&(m.ArrowRight=()=>It.handleExit({editor:e,mark:a})),h){const M=Object.fromEntries(Object.entries(h()).map(([T,O])=>[T,()=>O({editor:e})]));m={...m,...M}}const p=iM(m);f.push(p);const y=V(a,"addInputRules",u);s0(a,e.options.enableInputRules)&&y&&r.push(...y());const S=V(a,"addPasteRules",u);s0(a,e.options.enablePasteRules)&&S&&i.push(...S());const w=V(a,"addProseMirrorPlugins",u);if(w){const M=w();f.push(...M)}return f}).flat();return[DM({editor:e,rules:r}),...HM({editor:e,rules:i}),...o]}get attributes(){return t0(this.extensions)}get nodeViews(){const{editor:e}=this,{nodeExtensions:t}=Ol(this.extensions);return Object.fromEntries(t.filter(r=>!!V(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:qe(r.name,this.schema)},a=V(r,"addNodeView",o);if(!a)return[];const u=(f,h,m,p)=>{const y=Yc(f,i);return a()({editor:e,node:f,getPos:m,decorations:p,HTMLAttributes:y,extension:r})};return[r.name,u]}))}}function UM(n){return Object.prototype.toString.call(n).slice(8,-1)}function ef(n){return UM(n)!=="Object"?!1:n.constructor===Object&&Object.getPrototypeOf(n)===Object.prototype}function Il(n,e){const t={...n};return ef(n)&&ef(e)&&Object.keys(e).forEach(r=>{ef(e[r])?r in n?t[r]=Il(n[r],e[r]):Object.assign(t,{[r]:e[r]}):Object.assign(t,{[r]:e[r]})}),t}class Pe{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=ae(V(this,"addOptions",{name:this.name}))),this.storage=ae(V(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(e={}){return new Pe(e)}configure(e={}){const t=this.extend();return t.options=Il(this.options,e),t.storage=ae(V(t,"addStorage",{name:t.name,options:t.options})),t}extend(e={}){const t=new Pe(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=ae(V(t,"addOptions",{name:t.name})),t.storage=ae(V(t,"addStorage",{name:t.name,options:t.options})),t}}function VM(n,e,t){const{from:r,to:i}=e,{blockSeparator:o=`
14
14
 
15
- `,textSerializers:a={}}=t||{};let u="",f=!0;return n.nodesBetween(r,i,(d,m,p,y)=>{var S;const w=a?.[d.type.name];w?(d.isBlock&&!f&&(u+=o,f=!0),p&&(u+=w({node:d,pos:m,parent:p,index:y,range:e}))):d.isText?(u+=(S=d?.text)===null||S===void 0?void 0:S.slice(Math.max(r,m)-m,i-m),f=!1):d.isBlock&&!f&&(u+=o,f=!0)}),u}function KM(n){return Object.fromEntries(Object.entries(n.nodes).filter(([,e])=>e.spec.toText).map(([e,t])=>[e,t.spec.toText]))}Pe.create({name:"clipboardTextSerializer",addProseMirrorPlugins(){return[new At({key:new an("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=KM(t);return VM(r,{from:a,to:u},{textSerializers:f})}}})]}});const GM=()=>({editor:n,view:e})=>(requestAnimationFrame(()=>{var t;n.isDestroyed||(e.dom.blur(),(t=window?.getSelection())===null||t===void 0||t.removeAllRanges())}),!0),qM=(n=!1)=>({commands:e})=>e.setContent("",n),JM=()=>({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:d,mapping:m}=e,p=d.resolve(m.map(f)),y=d.resolve(m.map(f+u.nodeSize)),S=p.blockRange(y);if(!S)return;const w=Ti(S);if(u.type.isTextblock){const{defaultType:M}=p.parent.contentMatchAt(p.index());e.setNodeMarkup(S.start,M)}(w||w===0)&&e.lift(S,w)})}),!0},jM=n=>e=>n(e),YM=()=>({state:n,dispatch:e})=>bM(n,e),XM=(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 me(r.doc.resolve(a-1))),!0},ZM=()=>({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},QM=n=>({tr:e,state:t,dispatch:r})=>{const i=qe(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),d=o.after(a);e.delete(f,d).scrollIntoView()}return!0}return!1},eT=n=>({tr:e,dispatch:t})=>{const{from:r,to:i}=n;return t&&e.delete(r,i),!0},tT=()=>({state:n,dispatch:e})=>oM(n,e),nT=()=>({commands:n})=>n.keyboardShortcut("Enter"),rT=()=>({state:n,dispatch:e})=>yM(n,e);function Nl(n,e,t={strict:!0}){const r=Object.keys(e);return r.length?r.every(i=>t.strict?e[i]===n[i]:Zc(e[i])?e[i].test(n[i]):e[i]===n[i]):!0}function tf(n,e,t={}){return n.find(r=>r.type===e&&Nl(r.attrs,t))}function iT(n,e,t={}){return!!tf(n,e,t)}function nf(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=tf([...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(tf([...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&&iT([...n.parent.child(u).marks],e,t);)f+=n.parent.child(u).nodeSize,u+=1;return{from:a,to:f}}function vn(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 sT=(n,e={})=>({tr:t,state:r,dispatch:i})=>{const o=vn(n,r.schema),{doc:a,selection:u}=t,{$from:f,from:d,to:m}=u;if(i){const p=nf(f,o,e);if(p&&p.from<=d&&p.to>=m){const y=me.create(a,p.from,p.to);t.setSelection(y)}}return!0},oT=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 l0(n){return n instanceof me}function Gr(n=0,e=0,t=0){return Math.min(Math.max(n,e),t)}function lT(n,e=null){if(!e)return null;const t=pe.atStart(n),r=pe.atEnd(n);if(e==="start"||e===!0)return t;if(e==="end")return r;const i=t.from,o=r.to;return e==="all"?me.create(n,Gr(0,i,o),Gr(n.content.size,i,o)):me.create(n,Gr(e,i,o),Gr(e,i,o))}function rf(){return["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document}const aT=(n=null,e={})=>({editor:t,view:r,tr:i,dispatch:o})=>{e={scrollIntoView:!0,...e};const a=()=>{rf()&&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&&!l0(t.state.selection))return a(),!0;const u=lT(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},uT=(n,e)=>t=>n.every((r,i)=>e(r,{...t,index:i})),cT=(n,e)=>({tr:t,commands:r})=>r.insertContentAt({from:t.selection.from,to:t.selection.to},n,e);function a0(n){const e=`<body>${n}</body>`;return new window.DOMParser().parseFromString(e,"text/html").body}function Rl(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),Rl("",e,t)}if(typeof n=="string"){const r=vc.fromSchema(e);return t.slice?r.parseSlice(a0(n),t.parseOptions).content:r.parse(a0(n),t.parseOptions)}return Rl("",e,t)}function fT(n,e,t){const r=n.steps.length-1;if(r<e)return;const i=n.steps[r];if(!(i instanceof at||i instanceof Ye))return;const o=n.mapping.maps[r];let a=0;o.forEach((u,f,d,m)=>{a===0&&(a=m)}),n.setSelection(pe.near(n.doc.resolve(a),t))}const dT=n=>n.toString().startsWith("<"),hT=(n,e,t)=>({tr:r,dispatch:i,editor:o})=>{if(i){t={parseOptions:{},updateSelection:!0,...t};const a=Rl(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},d=!0,m=!0;if((dT(a)?a:[a]).forEach(y=>{y.check(),d=d?y.isText&&y.marks.length===0:!1,m=m?y.isBlock:!1}),u===f&&m){const{parent:y}=r.doc.resolve(u);y.isTextblock&&!y.type.spec.code&&!y.childCount&&(u-=1,f+=1)}d?Array.isArray(e)?r.insertText(e.map(y=>y.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&&fT(r,r.steps.length-1,-1)}return!0},pT=()=>({state:n,dispatch:e})=>hM(n,e),mT=()=>({state:n,dispatch:e})=>pM(n,e),gT=()=>({state:n,dispatch:e})=>aM(n,e),yT=()=>({state:n,dispatch:e})=>fM(n,e),bT=()=>({tr:n,state:e,dispatch:t})=>{try{const r=Sl(e.doc,e.selection.$from.pos,-1);return r==null?!1:(n.join(r,2),t&&t(n),!0)}catch{return!1}},vT=()=>({state:n,dispatch:e,tr:t})=>{try{const r=Sl(n.doc,n.selection.$from.pos,1);return r==null?!1:(t.join(r,2),e&&e(t),!0)}catch{return!1}};function u0(){return typeof navigator<"u"?/Mac/.test(navigator.platform):!1}function ST(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))rf()||u0()?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 wT=n=>({editor:e,view:t,tr:r,dispatch:i})=>{const o=ST(n).split(/-(?!$)/),a=o.find(d=>!["Alt","Ctrl","Meta","Shift"].includes(d)),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",d=>d(t,u))});return f?.steps.forEach(d=>{const m=d.map(r.mapping);m&&i&&r.maybeStep(m)}),!0};function sf(n,e,t={}){const{from:r,to:i,empty:o}=n.selection,a=e?qe(e,n.schema):null,u=[];n.doc.nodesBetween(r,i,(p,y)=>{if(p.isText)return;const S=Math.max(r,y),w=Math.min(i,y+p.nodeSize);u.push({node:p,from:S,to:w})});const f=i-r,d=u.filter(p=>a?a.name===p.node.type.name:!0).filter(p=>Nl(p.node.attrs,t,{strict:!1}));return o?!!d.length:d.reduce((p,y)=>p+y.to-y.from,0)>=f}const xT=(n,e={})=>({state:t,dispatch:r})=>{const i=qe(n,t.schema);return sf(t,i,e)?mM(t,r):!1},_T=()=>({state:n,dispatch:e})=>vM(n,e),kT=n=>({state:e,dispatch:t})=>{const r=qe(n,e.schema);return TM(r)(e,t)},ET=()=>({state:n,dispatch:e})=>gM(n,e);function of(n,e){return e.nodes[n]?"node":e.marks[n]?"mark":null}function c0(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 MT=(n,e)=>({tr:t,state:r,dispatch:i})=>{let o=null,a=null;const u=of(typeof n=="string"?n:n.name,r.schema);return u?(u==="node"&&(o=qe(n,r.schema)),u==="mark"&&(a=vn(n,r.schema)),i&&t.selection.ranges.forEach(f=>{r.doc.nodesBetween(f.$from.pos,f.$to.pos,(d,m)=>{o&&o===d.type&&t.setNodeMarkup(m,void 0,c0(d.attrs,e)),a&&d.marks.length&&d.marks.forEach(p=>{a===p.type&&t.addMark(m,m+d.nodeSize,a.create(c0(p.attrs,e)))})})}),!0):!1},TT=()=>({tr:n,dispatch:e})=>(e&&n.scrollIntoView(),!0),CT=()=>({tr:n,commands:e})=>e.setTextSelection({from:0,to:n.doc.content.size}),AT=()=>({state:n,dispatch:e})=>uM(n,e),OT=()=>({state:n,dispatch:e})=>dM(n,e),IT=()=>({state:n,dispatch:e})=>SM(n,e),NT=()=>({state:n,dispatch:e})=>_M(n,e),RT=()=>({state:n,dispatch:e})=>xM(n,e);function LT(n,e,t={}){return Rl(n,e,{slice:!1,parseOptions:t})}const PT=(n,e=!1,t={})=>({tr:r,editor:i,dispatch:o})=>{const{doc:a}=r,u=LT(n,i.schema,t);return o&&r.replaceWith(0,a.content.size,u).setMeta("preventUpdate",!e),!0};function f0(n,e){const t=vn(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 DT(n,e){const t=new hE(n);return e.forEach(r=>{r.steps.forEach(i=>{t.step(i)})}),t}function zT(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 BT(n,e,t){const r=[];return n.nodesBetween(e.from,e.to,(i,o)=>{t(i)&&r.push({node:i,pos:o})}),r}function FT(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 lf(n){return e=>FT(e.$from,n)}function $T(n,e){const t=Gi.resolve(n);return i0(t,e)}function HT(n,e){const t=qe(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 WT(n,e){const t=of(typeof e=="string"?e:e.name,n.schema);return t==="node"?HT(n,e):t==="mark"?f0(n,e):{}}function UT(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 VT(n){const e=UT(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 KT(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 d=e.slice(o).map(u,-1),m=e.slice(o).map(f),p=e.invert().map(d,-1),y=e.invert().map(m);r.push({oldRange:{from:p,to:y},newRange:{from:d,to:m}})})}),VT(r)}function d0(n,e,t){const r=[];return n===e?t.resolve(n).marks().forEach(i=>{const o=t.resolve(n-1),a=nf(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 Ll(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 GT(n,e,t={}){const{empty:r,ranges:i}=n.selection,o=e?vn(e,n.schema):null;if(r)return!!(n.storedMarks||n.selection.$from.marks()).filter(p=>o?o.name===p.type.name:!0).find(p=>Nl(p.attrs,t,{strict:!1}));let a=0;const u=[];if(i.forEach(({$from:p,$to:y})=>{const S=p.pos,w=y.pos;n.doc.nodesBetween(S,w,(M,T)=>{if(!M.isText&&!M.marks.length)return;const O=Math.max(S,T),F=Math.min(w,T+M.nodeSize),B=F-O;a+=B,u.push(...M.marks.map(H=>({mark:H,from:O,to:F})))})}),a===0)return!1;const f=u.filter(p=>o?o.name===p.mark.type.name:!0).filter(p=>Nl(p.mark.attrs,t,{strict:!1})).reduce((p,y)=>p+y.to-y.from,0),d=u.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+d:f)>=a}function h0(n,e){const{nodeExtensions:t}=Ol(e),r=t.find(a=>a.name===n);if(!r)return!1;const i={name:r.name,options:r.options,storage:r.storage},o=ae(V(r,"group",i));return typeof o!="string"?!1:o.split(" ").includes("list")}function qT(n,e,t){var r;const{selection:i}=e;let o=null;if(l0(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 d=u.depth===0?n.doc.inlineContent&&n.doc.type.allowsMarkType(t):!1;return n.doc.nodesBetween(u.pos,f.pos,(m,p,y)=>{if(d)return!1;if(m.isInline){const S=!y||y.type.allowsMarkType(t),w=!!t.isInSet(m.marks)||!m.marks.some(M=>M.type.excludes(t));d=S&&w}return!d}),d})}const JT=(n,e={})=>({tr:t,state:r,dispatch:i})=>{const{selection:o}=t,{empty:a,ranges:u}=o,f=vn(n,r.schema);if(i)if(a){const d=f0(r,f);t.addStoredMark(f.create({...d,...e}))}else u.forEach(d=>{const m=d.$from.pos,p=d.$to.pos;r.doc.nodesBetween(m,p,(y,S)=>{const w=Math.max(S,m),M=Math.min(S+y.nodeSize,p);y.marks.find(O=>O.type===f)?y.marks.forEach(O=>{f===O.type&&t.addMark(w,M,f.create({...O.attrs,...e}))}):t.addMark(w,M,f.create(e))})});return qT(r,t,f)},jT=(n,e)=>({tr:t})=>(t.setMeta(n,e),!0),YT=(n,e={})=>({state:t,dispatch:r,chain:i})=>{const o=qe(n,t.schema);return o.isTextblock?i().command(({commands:a})=>e0(o,e)(t)?!0:a.clearNodes()).command(({state:a})=>e0(o,e)(a,r)).run():(console.warn('[tiptap warn]: Currently "setNode()" only supports text block nodes.'),!1)},XT=n=>({tr:e,dispatch:t})=>{if(t){const{doc:r}=e,i=Gr(n,0,r.content.size),o=Z.create(r,i);e.setSelection(o)}return!0},ZT=n=>({tr:e,dispatch:t})=>{if(t){const{doc:r}=e,{from:i,to:o}=typeof n=="number"?{from:n,to:n}:n,a=me.atStart(r).from,u=me.atEnd(r).to,f=Gr(i,a,u),d=Gr(o,a,u),m=me.create(r,f,d);e.setSelection(m)}return!0},QT=n=>({state:e,dispatch:t})=>{const r=qe(n,e.schema);return OM(r)(e,t)};function p0(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 eC=({keepMarks:n=!0}={})=>({tr:e,state:t,dispatch:r,editor:i})=>{const{selection:o,doc:a}=e,{$from:u,$to:f}=o,d=i.extensionManager.attributes,m=Ll(d,u.node().type.name,u.node().attrs);if(o instanceof Z&&o.node.isBlock)return!u.parentOffset||!Ci(a,u.pos)?!1:(r&&(n&&p0(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 me&&e.deleteSelection();const y=u.depth===0?void 0:zT(u.node(-1).contentMatchAt(u.indexAfter(-1)));let S=p&&y?[{type:y,attrs:m}]:void 0,w=Ci(e.doc,e.mapping.map(u.pos),1,S);if(!S&&!w&&Ci(e.doc,e.mapping.map(u.pos),1,y?[{type:y}]:void 0)&&(w=!0,S=y?[{type:y,attrs:m}]:void 0),w&&(e.split(e.mapping.map(u.pos),1,S),y&&!p&&!u.parentOffset&&u.parent.type!==y)){const M=e.mapping.map(u.before()),T=e.doc.resolve(M);u.node(-1).canReplaceWith(T.index(),T.index()+1,y)&&e.setNodeMarkup(e.mapping.map(u.before()),y)}n&&p0(t,i.extensionManager.splittableMarks),e.scrollIntoView()}return!0},tC=n=>({tr:e,state:t,dispatch:r,editor:i})=>{var o;const a=qe(n,t.schema),{$from:u,$to:f}=t.selection,d=t.selection.node;if(d&&d.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 T=L.empty;const O=u.index(-1)?1:u.index(-2)?2:3;for(let ie=u.depth-O;ie>=u.depth-3;ie-=1)T=L.from(u.node(ie).copy(T));const F=u.indexAfter(-1)<u.node(-2).childCount?1:u.indexAfter(-2)<u.node(-3).childCount?2:3,B=Ll(p,u.node().type.name,u.node().attrs),H=((o=a.contentMatch.defaultType)===null||o===void 0?void 0:o.createAndFill(B))||void 0;T=T.append(L.from(a.createAndFill(null,H)||void 0));const X=u.before(u.depth-(O-1));e.replace(X,u.after(-F),new U(T,4-O,0));let q=-1;e.doc.nodesBetween(X,e.doc.content.size,(ie,Me)=>{if(q>-1)return!1;ie.isTextblock&&ie.content.size===0&&(q=Me+1)}),q>-1&&e.setSelection(me.near(e.doc.resolve(q))),e.scrollIntoView()}return!0}const y=f.pos===u.end()?m.contentMatchAt(0).defaultType:null,S=Ll(p,m.type.name,m.attrs),w=Ll(p,u.node().type.name,u.node().attrs);e.delete(u.pos,f.pos);const M=y?[{type:a,attrs:S},{type:y,attrs:w}]:[{type:a,attrs:S}];if(!Ci(e.doc,u.pos,2))return!1;if(r){const{selection:T,storedMarks:O}=t,{splittableMarks:F}=i.extensionManager,B=O||T.$to.parentOffset&&T.$from.marks();if(e.split(u.pos,2,M).scrollIntoView(),!B||!r)return!0;const H=B.filter(X=>F.includes(X.type.name));e.ensureMarks(H)}return!0},af=(n,e)=>{const t=lf(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&&fr(n.doc,t.pos)&&n.join(t.pos),!0},uf=(n,e)=>{const t=lf(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&&fr(n.doc,r)&&n.join(r),!0},nC=(n,e,t,r={})=>({editor:i,tr:o,state:a,dispatch:u,chain:f,commands:d,can:m})=>{const{extensions:p,splittableMarks:y}=i.extensionManager,S=qe(n,a.schema),w=qe(e,a.schema),{selection:M,storedMarks:T}=a,{$from:O,$to:F}=M,B=O.blockRange(F),H=T||M.$to.parentOffset&&M.$from.marks();if(!B)return!1;const X=lf(q=>h0(q.type.name,p))(M);if(B.depth>=1&&X&&B.depth-X.depth<=1){if(X.node.type===S)return d.liftListItem(w);if(h0(X.node.type.name,p)&&S.validContent(X.node.content)&&u)return f().command(()=>(o.setNodeMarkup(X.pos,S),!0)).command(()=>af(o,S)).command(()=>uf(o,S)).run()}return!t||!H||!u?f().command(()=>m().wrapInList(S,r)?!0:d.clearNodes()).wrapInList(S,r).command(()=>af(o,S)).command(()=>uf(o,S)).run():f().command(()=>{const q=m().wrapInList(S,r),ie=H.filter(Me=>y.includes(Me.type.name));return o.ensureMarks(ie),q?!0:d.clearNodes()}).wrapInList(S,r).command(()=>af(o,S)).command(()=>uf(o,S)).run()},rC=(n,e={},t={})=>({state:r,commands:i})=>{const{extendEmptyMarkRange:o=!1}=t,a=vn(n,r.schema);return GT(r,a,e)?i.unsetMark(a,{extendEmptyMarkRange:o}):i.setMark(a,e)},iC=(n,e,t={})=>({state:r,commands:i})=>{const o=qe(n,r.schema),a=qe(e,r.schema);return sf(r,o,t)?i.setNode(a):i.setNode(o,t)},sC=(n,e={})=>({state:t,commands:r})=>{const i=qe(n,t.schema);return sf(t,i,e)?r.lift(i):r.wrapIn(i,e)},oC=()=>({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},lC=()=>({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},aC=(n,e={})=>({tr:t,state:r,dispatch:i})=>{var o;const{extendEmptyMarkRange:a=!1}=e,{selection:u}=t,f=vn(n,r.schema),{$from:d,empty:m,ranges:p}=u;if(!i)return!0;if(m&&a){let{from:y,to:S}=u;const w=(o=d.marks().find(T=>T.type===f))===null||o===void 0?void 0:o.attrs,M=nf(d,f,w);M&&(y=M.from,S=M.to),t.removeMark(y,S,f)}else p.forEach(y=>{t.removeMark(y.$from.pos,y.$to.pos,f)});return t.removeStoredMark(f),!0},uC=(n,e={})=>({tr:t,state:r,dispatch:i})=>{let o=null,a=null;const u=of(typeof n=="string"?n:n.name,r.schema);return u?(u==="node"&&(o=qe(n,r.schema)),u==="mark"&&(a=vn(n,r.schema)),i&&t.selection.ranges.forEach(f=>{const d=f.$from.pos,m=f.$to.pos;r.doc.nodesBetween(d,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 w=Math.max(y,d),M=Math.min(y+p.nodeSize,m);t.addMark(w,M,a.create({...S.attrs,...e}))}})})}),!0):!1},cC=(n,e={})=>({state:t,dispatch:r})=>{const i=qe(n,t.schema);return kM(i,e)(t,r)},fC=(n,e={})=>({state:t,dispatch:r})=>{const i=qe(n,t.schema);return EM(i,e)(t,r)};var dC=Object.freeze({__proto__:null,blur:GM,clearContent:qM,clearNodes:JM,command:jM,createParagraphNear:YM,cut:XM,deleteCurrentNode:ZM,deleteNode:QM,deleteRange:eT,deleteSelection:tT,enter:nT,exitCode:rT,extendMarkRange:sT,first:oT,focus:aT,forEach:uT,insertContent:cT,insertContentAt:hT,joinUp:pT,joinDown:mT,joinBackward:gT,joinForward:yT,joinItemBackward:bT,joinItemForward:vT,keyboardShortcut:wT,lift:xT,liftEmptyBlock:_T,liftListItem:kT,newlineInCode:ET,resetAttributes:MT,scrollIntoView:TT,selectAll:CT,selectNodeBackward:AT,selectNodeForward:OT,selectParentNode:IT,selectTextblockEnd:NT,selectTextblockStart:RT,setContent:PT,setMark:JT,setMeta:jT,setNode:YT,setNodeSelection:XT,setTextSelection:ZT,sinkListItem:QT,splitBlock:eC,splitListItem:tC,toggleList:nC,toggleMark:rC,toggleNode:iC,toggleWrap:sC,undoInputRule:oC,unsetAllMarks:lC,unsetMark:aC,updateAttributes:uC,wrapIn:cC,wrapInList:fC});Pe.create({name:"commands",addCommands(){return{...dC}}}),Pe.create({name:"editable",addProseMirrorPlugins(){return[new At({key:new an("editable"),props:{editable:()=>this.editor.options.editable}})]}}),Pe.create({name:"focusEvents",addProseMirrorPlugins(){const{editor:n}=this;return[new At({key:new an("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}}}})]}}),Pe.create({name:"keymap",addKeyboardShortcuts(){const n=()=>this.editor.commands.first(({commands:a})=>[()=>a.undoInputRule(),()=>a.command(({tr:u})=>{const{selection:f,doc:d}=u,{empty:m,$anchor:p}=f,{pos:y,parent:S}=p,w=p.parent.isTextblock?u.doc.resolve(y-1):p,M=w.parent.type.spec.isolating,T=p.pos-p.parentOffset,O=M&&w.parent.childCount===1?T===p.pos:pe.atStart(d).from===y;return!m||!O||!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 rf()||u0()?o:i},addProseMirrorPlugins(){return[new At({key:new an("clearDocument"),appendTransaction:(n,e,t)=>{if(!(n.some(w=>w.docChanged)&&!e.doc.eq(t.doc)))return;const{empty:i,from:o,to:a}=e.selection,u=pe.atStart(e.doc).from,f=pe.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,y=Al({state:t,transaction:p}),{commands:S}=new jc({editor:this.editor,state:y});if(S.clearNodes(),!!p.steps.length)return p}})]}}),Pe.create({name:"tabindex",addProseMirrorPlugins(){return[new At({key:new an("tabindex"),props:{attributes:this.editor.isEditable?{tabindex:"0"}:{}}})]}});function hC(n){return new o0({find:n.find,handler:({state:e,range:t,match:r})=>{const i=e.doc.resolve(t.from),o=ae(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 pC(n){return new o0({find:n.find,handler:({state:e,range:t,match:r,chain:i})=>{const o=ae(n.getAttributes,void 0,r)||{},a=e.tr.delete(t.from,t.to),f=a.doc.resolve(t.from).blockRange(),d=f&&Ec(f,n.type,o);if(!d)return null;if(a.wrap(f,d),n.keepMarks&&n.editor){const{selection:p,storedMarks:y}=e,{splittableMarks:S}=n.editor.extensionManager,w=y||p.$to.parentOffset&&p.$from.marks();if(w){const M=w.filter(T=>S.includes(T.type.name));a.ensureMarks(M)}}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&&fr(a.doc,t.from-1)&&(!n.joinPredicate||n.joinPredicate(r,m))&&a.join(t.from-1)}})}class It{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=ae(V(this,"addOptions",{name:this.name}))),this.storage=ae(V(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(e={}){return new It(e)}configure(e={}){const t=this.extend();return t.options=Il(this.options,e),t.storage=ae(V(t,"addStorage",{name:t.name,options:t.options})),t}extend(e={}){const t=new It(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=ae(V(t,"addOptions",{name:t.name})),t.storage=ae(V(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(d=>d?.type.name===t.name))return!1;const f=a.find(d=>d?.type.name===t.name);return f&&r.removeStoredMark(f),r.insertText(" ",i.pos),e.view.dispatch(r),!0}return!1}}class Jn{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=ae(V(this,"addOptions",{name:this.name}))),this.storage=ae(V(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(e={}){return new Jn(e)}configure(e={}){const t=this.extend();return t.options=Il(this.options,e),t.storage=ae(V(t,"addStorage",{name:t.name,options:t.options})),t}extend(e={}){const t=new Jn(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=ae(V(t,"addOptions",{name:t.name})),t.storage=ae(V(t,"addStorage",{name:t.name,options:t.options})),t}}function mC(n){return new BM({find:n.find,handler:({state:e,range:t,match:r,pasteEvent:i})=>{const o=ae(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 d=t.to;if(u){const m=f.search(/\S/),p=t.from+f.indexOf(u),y=p+u.length;if(d0(t.from,t.to,e.doc).filter(w=>w.mark.type.excluded.find(T=>T===n.type&&T!==w.mark.type)).filter(w=>w.to>p).length)return null;y<t.to&&a.delete(y,t.to),p>t.from&&a.delete(t.from+m,p),d=t.from+m+u.length,a.addMark(t.from+m,d,n.type.create(o||{})),a.removeStoredMark(n.type)}}})}const gC=Jn.create({name:"text",group:"inline"});var Pl=200,nt=function(){};nt.prototype.append=function(e){return e.length?(e=nt.from(e),!this.length&&e||e.length<Pl&&this.leafAppend(e)||this.length<Pl&&e.leafPrepend(this)||this.appendInner(e)):this},nt.prototype.prepend=function(e){return e.length?nt.from(e).append(this):this},nt.prototype.appendInner=function(e){return new yC(this,e)},nt.prototype.slice=function(e,t){return e===void 0&&(e=0),t===void 0&&(t=this.length),e>=t?nt.empty:this.sliceInner(Math.max(0,e),Math.min(this.length,t))},nt.prototype.get=function(e){if(!(e<0||e>=this.length))return this.getInner(e)},nt.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)},nt.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},nt.from=function(e){return e instanceof nt?e:e&&e.length?new m0(e):nt.empty};var m0=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<=Pl)return new e(this.values.concat(i.flatten()))},e.prototype.leafPrepend=function(i){if(this.length+i.length<=Pl)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}(nt);nt.empty=new m0([]);var yC=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}(nt),g0=nt;const bC=500;class hn{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,d=[],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 _n(p.map));let S=p.step.map(i.slice(o)),w;S&&a.maybeStep(S).doc&&(w=a.mapping.maps[a.mapping.maps.length-1],d.push(new _n(w,void 0,void 0,d.length+m.length))),o--,w&&i.appendMap(w,o)}else a.maybeStep(p.step);if(p.selection)return u=i?p.selection.map(i.slice(o)):p.selection,f=new hn(this.items.slice(0,r).append(m.reverse().concat(d)),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]),y=new _n(e.mapping.maps[m],p,t),S;(S=f&&f.merge(y))&&(y=S,m?o.pop():u=u.slice(0,u.length-1)),o.push(y),t&&(a++,t=void 0),i||(f=y)}let d=a-r.depth;return d>SC&&(u=vC(u,d),a-=d),new hn(u.append(o),a)}remapping(e,t){let r=new qi;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 hn(this.items.append(e.map(t=>new _n(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(y=>{y.selection&&u--},i);let f=t;this.items.forEach(y=>{let S=o.getMirror(--f);if(S==null)return;a=Math.min(a,S);let w=o.maps[S];if(y.step){let M=e.steps[S].invert(e.docs[S]),T=y.selection&&y.selection.map(o.slice(f+1,S));T&&u++,r.push(new _n(w,M,T))}else r.push(new _n(w))},i);let d=[];for(let y=t;y<a;y++)d.push(new _n(o.maps[y]));let m=this.items.slice(0,i).append(d).append(r),p=new hn(m,u);return p.emptyItemCount()>bC&&(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)),d=f&&f.getMap();if(r--,d&&t.appendMap(d,r),f){let m=a.selection&&a.selection.map(t.slice(r));m&&o++;let p=new _n(d.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 hn(g0.from(i.reverse()),o)}}hn.empty=new hn(g0.empty,0);function vC(n,e){let t;return n.forEach((r,i)=>{if(r.selection&&e--==0)return t=i,!1}),n.slice(t)}class _n{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 _n(t.getMap().invert(),t,this.selection)}}}class gr{constructor(e,t,r,i){this.done=e,this.undone=t,this.prevRanges=r,this.prevTime=i}}const SC=20;function wC(n,e,t,r){let i=t.getMeta(yr),o;if(i)return i.historyState;t.getMeta(_C)&&(n=new gr(n.done,n.undone,null,0));let a=t.getMeta("appendedTransaction");if(t.steps.length==0)return n;if(a&&a.getMeta(yr))return a.getMeta(yr).redo?new gr(n.done.addTransform(t,void 0,r,Dl(e)),n.undone,y0(t.mapping.maps[t.steps.length-1]),n.prevTime):new gr(n.done,n.undone.addTransform(t,void 0,r,Dl(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||!xC(t,n.prevRanges)),f=a?cf(n.prevRanges,t.mapping):y0(t.mapping.maps[t.steps.length-1]);return new gr(n.done.addTransform(t,u?e.selection.getBookmark():void 0,r,Dl(e)),hn.empty,f,t.time)}else return(o=t.getMeta("rebased"))?new gr(n.done.rebased(t,o),n.undone.rebased(t,o),cf(n.prevRanges,t.mapping),n.prevTime):new gr(n.done.addMaps(t.mapping.maps),n.undone.addMaps(t.mapping.maps),cf(n.prevRanges,t.mapping),n.prevTime)}function xC(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 y0(n){let e=[];return n.forEach((t,r,i,o)=>e.push(i,o)),e}function cf(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 b0(n,e,t,r){let i=Dl(e),o=yr.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),d=new gr(r?f:a.remaining,r?a.remaining:f,null,0);t(a.transform.setSelection(u).setMeta(yr,{redo:r,historyState:d}).scrollIntoView())}let ff=!1,v0=null;function Dl(n){let e=n.plugins;if(v0!=e){ff=!1,v0=e;for(let t=0;t<e.length;t++)if(e[t].spec.historyPreserveItems){ff=!0;break}}return ff}const yr=new an("history"),_C=new an("closeHistory");function kC(n={}){return n={depth:n.depth||100,newGroupDelay:n.newGroupDelay||500},new At({key:yr,state:{init(){return new gr(hn.empty,hn.empty,null,0)},apply(e,t,r){return wC(t,r,e,n)}},config:n,props:{handleDOMEvents:{beforeinput(e,t){let r=t.inputType,i=r=="historyUndo"?S0:r=="historyRedo"?w0:null;return i?(t.preventDefault(),i(e.state,e.dispatch)):!1}}}})}const S0=(n,e)=>{let t=yr.getState(n);return!t||t.done.eventCount==0?!1:(e&&b0(t,n,e,!1),!0)},w0=(n,e)=>{let t=yr.getState(n);return!t||t.undone.eventCount==0?!1:(e&&b0(t,n,e,!0),!0)},EC=Pe.create({name:"history",addOptions(){return{depth:100,newGroupDelay:500}},addCommands(){return{undo:()=>({state:n,dispatch:e})=>S0(n,e),redo:()=>({state:n,dispatch:e})=>w0(n,e)}},addProseMirrorPlugins(){return[kC(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()}}}),df=Object.freeze({COMMON:"common",DESKTOP:"desktop",TABLET:"tablet",MOBILE:"mobile",get values(){return[this.COMMON,this.MOBILE,this.TABLET,this.DESKTOP]}}),hf=Object.freeze({UPPERCASE:"uppercase",LOWERCASE:"lowercase",CAPITALIZE:"capitalize"}),br=Object.freeze({LEFT:"left",CENTER:"center",RIGHT:"right",JUSTIFY:"justify",get values(){return[this.LEFT,this.CENTER,this.RIGHT,this.JUSTIFY]}}),ne=Object.freeze({DOCUMENT:"doc",PARAGRAPH:"paragraph",HEADING:"heading",LIST:"list",LIST_ITEM:"listItem",TEXT:"text",get blocks(){return[this.PARAGRAPH,this.LIST,this.HEADING]}}),Kt=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]}}),de=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]}}),cn=Object.freeze({SETTINGS:"settings",ALL:"_"}),x0=Object.freeze({BLANK:"_blank",SELF:"_self"}),Bs=Object.freeze({URL:"url",BLOCK:"block"});class pf{static create(e,t){const r=new this(e,t||{});return new At({key:new an(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 MC extends pf{addProps(){return{transformPastedHTML:this._transformPastedHTML,handlePaste:this._handlePaste}}_transformPastedHTML(e){if(e.includes("data-pm-slice")&&e.includes("zw-style"))return e;const t=va.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===ne.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 TC extends pf{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}),Xe.create(e,t)}}const CC="aaa1rp3barth4b0ott3vie4c1le2ogado5udhabi7c0ademy5centure6ountant0s9o1tor4d0s1ult4e0g1ro2tna4f0l1rica5g0akhan5ency5i0g1rbus3force5tel5kdn3l0faromeo7ibaba4pay4lfinanz6state5y2sace3tom5m0azon4ericanexpress7family11x2fam3ica3sterdam8nalytics7droid5quan4z2o0l2partments8p0le4q0uarelle8r0ab1mco4chi3my2pa2t0e3s0da2ia2sociates9t0hleta5torney7u0ction5di0ble3o3spost5thor3o0s4vianca6w0s2x0a2z0ure5ba0by2idu3namex3narepublic11d1k2r0celona5laycard4s5efoot5gains6seball5ketball8uhaus5yern5b0c1t1va3cg1n2d1e0ats2uty4er2ntley5rlin4st0buy5t2f1g1h0arti5i0ble3d1ke2ng0o3o1z2j1lack0friday9ockbuster8g1omberg7ue3m0s1w2n0pparibas9o0ats3ehringer8fa2m1nd2o0k0ing5sch2tik2on4t1utique6x2r0adesco6idgestone9oadway5ker3ther5ussels7s1t1uild0ers6siness6y1zz3v1w1y1z0h3ca0b1fe2l0l1vinklein9m0era3p2non3petown5ital0one8r0avan4ds2e0er0s4s2sa1e1h1ino4t0ering5holic7ba1n1re2s2c1d1enter4o1rn3f0a1d2g1h0anel2nel4rity4se2t2eap3intai5ristmas6ome4urch5i0priani6rcle4sco3tadel4i0c2y0eats7k1l0aims4eaning6ick2nic1que6othing5ud3ub0med6m1n1o0ach3des3ffee4llege4ogne5m0cast4mbank4unity6pany2re3uter5sec4ndos3struction8ulting7tact3ractors9oking0channel11l1p2rsica5untry4pon0s4rses6pa2r0edit0card4union9icket5own3s1uise0s6u0isinella9v1w1x1y0mru3ou3z2dabur3d1nce3ta1e1ing3sun4y2clk3ds2e0al0er2s3gree4livery5l1oitte5ta3mocrat6ntal2ist5si0gn4v2hl2iamonds6et2gital5rect0ory7scount3ver5h2y2j1k1m1np2o0cs1tor4g1mains5t1wnload7rive4tv2ubai3nlop4pont4rban5vag2r2z2earth3t2c0o2deka3u0cation8e1g1mail3erck5nergy4gineer0ing9terprises10pson4quipment8r0icsson6ni3s0q1tate5t0isalat7u0rovision8s2vents5xchange6pert3osed4ress5traspace10fage2il1rwinds6th3mily4n0s2rm0ers5shion4t3edex3edback6rrari3ero6i0at2delity5o2lm2nal1nce1ial7re0stone6mdale6sh0ing5t0ness6j1k1lickr3ghts4r2orist4wers5y2m1o0o0d0network8tball6rd1ex2sale4um3undation8x2r0ee1senius7l1ogans4ntdoor4ier7tr2ujitsu5n0d2rniture7tbol5yi3ga0l0lery3o1up4me0s3p1rden4y2b0iz3d0n2e0a1nt0ing5orge5f1g0ee3h1i0ft0s3ves2ing5l0ass3e1obal2o4m0ail3bh2o1x2n1odaddy5ld0point6f2o0dyear5g0le4p1t1v2p1q1r0ainger5phics5tis4een3ipe3ocery4up4s1t1u0ardian6cci3ge2ide2tars5ru3w1y2hair2mburg5ngout5us3bo2dfc0bank7ealth0care8lp1sinki6re1mes5gtv3iphop4samitsu7tachi5v2k0t2m1n1ockey4ldings5iday5medepot5goods5s0ense7nda3rse3spital5t0ing5t0eles2s3mail5use3w2r1sbc3t1u0ghes5yatt3undai7ibm2cbc2e1u2d1e0ee3fm2kano4l1m0amat4db2mo0bilien9n0c1dustries8finiti5o2g1k1stitute6urance4e4t0ernational10uit4vestments10o1piranga7q1r0ish4s0maili5t0anbul7t0au2v3jaguar4va3cb2e0ep2tzt3welry6io2ll2m0p2nj2o0bs1urg4t1y2p0morgan6rs3uegos4niper7kaufen5ddi3e0rryhotels6logistics9properties14fh2g1h1i0a1ds2m1nder2le4tchen5wi3m1n1oeln3matsu5sher5p0mg2n2r0d1ed3uokgroup8w1y0oto4z2la0caixa5mborghini8er3ncaster5ia3d0rover6xess5salle5t0ino3robe5w0yer5b1c1ds2ease3clerc5frak4gal2o2xus4gbt3i0dl2fe0insurance9style7ghting6ke2lly3mited4o2ncoln4de2k2psy3ve1ing5k1lc1p2oan0s3cker3us3l1ndon4tte1o3ve3pl0financial11r1s1t0d0a3u0ndbeck6xe1ury5v1y2ma0cys3drid4if1son4keup4n0agement7go3p1rket0ing3s4riott5shalls7serati6ttel5ba2c0kinsey7d1e0d0ia3et2lbourne7me1orial6n0u2rckmsd7g1h1iami3crosoft7l1ni1t2t0subishi9k1l0b1s2m0a2n1o0bi0le4da2e1i1m1nash3ey2ster5rmon3tgage6scow4to0rcycles9v0ie4p1q1r1s0d2t0n1r2u0seum3ic3tual5v1w1x1y1z2na0b1goya4me2tura4vy3ba2c1e0c1t0bank4flix4work5ustar5w0s2xt0direct7us4f0l2g0o2hk2i0co2ke1on3nja3ssan1y5l1o0kia3rthwesternmutual14on4w0ruz3tv4p1r0a1w2tt2u1yc2z2obi1server7ffice5kinawa6layan0group9dnavy5lo3m0ega4ne1g1l0ine5oo2pen3racle3nge4g0anic5igins6saka4tsuka4t2vh3pa0ge2nasonic7ris2s1tners4s1y3ssagens7y2ccw3e0t2f0izer5g1h0armacy6d1ilips5one2to0graphy6s4ysio5ics1tet2ures6d1n0g1k2oneer5zza4k1l0ace2y0station9umbing5s3m1n0c2ohl2ker3litie5rn2st3r0america6xi3ess3ime3o0d0uctions8f1gressive8mo2perties3y5tection8u0dential9s1t1ub2w0c2y2qa1pon3uebec3st5racing4dio4e0ad1lestate6tor2y4cipes5d0stone5umbrella9hab3ise0n3t2liance6n0t0als5pair3ort3ublican8st0aurant8view0s5xroth6ich0ardli6oh3l1o1p2o0cher3ks3deo3gers4om3s0vp3u0gby3hr2n2w0e2yukyu6sa0arland6fe0ty4kura4le1on3msclub4ung5ndvik0coromant12ofi4p1rl2s1ve2xo3b0i1s2c0a1b1haeffler7midt4olarships8ol3ule3warz5ience5ot3d1e0arch3t2cure1ity6ek2lect4ner3rvices6ven3w1x0y3fr2g1h0angrila6rp2w2ell3ia1ksha5oes2p0ping5uji3w0time7i0lk2na1gles5te3j1k0i0n2y0pe4l0ing4m0art3ile4n0cf3o0ccer3ial4ftbank4ware6hu2lar2utions7ng1y2y2pa0ce3ort2t3r0l2s1t0ada2ples4r1tebank4farm7c0group6ockholm6rage3e3ream4udio2y3yle4u0cks3pplies3y2ort5rf1gery5zuki5v1watch4iss4x1y0dney4stems6z2tab1ipei4lk2obao4rget4tamotors6r2too4x0i3c0i2d0k2eam2ch0nology8l1masek5nnis4va3f1g1h0d1eater2re6iaa2ckets5enda4ffany5ps2res2ol4j0maxx4x2k0maxx5l1m0all4n1o0day3kyo3ols3p1ray3shiba5tal3urs3wn2yota3s3r0ade1ing4ining5vel0channel7ers0insurance16ust3v2t1ube2i1nes3shu4v0s2w1z2ua1bank3s2g1k1nicom3versity8o2ol2ps2s1y1z2va0cations7na1guard7c1e0gas3ntures6risign5m\xF6gensberater2ung14sicherung10t2g1i0ajes4deo3g1king4llas4n1p1rgin4sa1ion4va1o3laanderen9n1odka3lkswagen7vo3te1ing3o2yage5u0elos6wales2mart4ter4ng0gou5tch0es6eather0channel12bcam3er2site5d0ding5ibo2r3f1hoswho6ien2ki2lliamhill9n0dows4e1ners6me2olterskluwer11odside6rk0s2ld3w2s1tc1f3xbox3erox4finity6ihuan4n2xx2yz3yachts4hoo3maxun5ndex5e1odobashi7ga2kohama6u0tube6t1un3za0ppos4ra3ero3ip2m1one3uerich6w2",AC="\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",zi=(n,e)=>{for(const t in e)n[t]=e[t];return n},mf="numeric",gf="ascii",yf="alpha",zl="asciinumeric",Bl="alphanumeric",bf="domain",_0="emoji",OC="scheme",IC="slashscheme",k0="whitespace";function NC(n,e){return n in e||(e[n]=[]),e[n]}function qr(n,e,t){e[mf]&&(e[zl]=!0,e[Bl]=!0),e[gf]&&(e[zl]=!0,e[yf]=!0),e[zl]&&(e[Bl]=!0),e[yf]&&(e[Bl]=!0),e[Bl]&&(e[bf]=!0),e[_0]&&(e[bf]=!0);for(const r in e){const i=NC(r,t);i.indexOf(n)<0&&i.push(n)}}function RC(n,e){const t={};for(const r in e)e[r].indexOf(n)>=0&&(t[r]=!0);return t}function wt(n){n===void 0&&(n=null),this.j={},this.jr=[],this.jd=null,this.t=n}wt.groups={},wt.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||wt.groups;let i;return e&&e.j?i=e:(i=new wt(e),t&&r&&qr(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||wt.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 wt,zi(a.j,u.j),a.jr.push.apply(a.jr,u.jr),a.jd=u.jd,a.t=u.t):a=new wt,o){if(r)if(a.t&&typeof a.t=="string"){const f=zi(RC(a.t,r),t);qr(o,f,r)}else t&&qr(o,t,r);a.t=o}return i.j[n]=a,a}};const G=(n,e,t,r,i)=>n.ta(e,t,r,i),Gt=(n,e,t,r,i)=>n.tr(e,t,r,i),E0=(n,e,t,r,i)=>n.ts(e,t,r,i),D=(n,e,t,r,i)=>n.tt(e,t,r,i),Wn="WORD",vf="UWORD",Fs="LOCALHOST",Sf="TLD",wf="UTLD",Fl="SCHEME",Bi="SLASH_SCHEME",xf="NUM",M0="WS",_f="NL",Fi="OPENBRACE",$s="OPENBRACKET",Hs="OPENANGLEBRACKET",Ws="OPENPAREN",Jr="CLOSEBRACE",$i="CLOSEBRACKET",Hi="CLOSEANGLEBRACKET",jr="CLOSEPAREN",$l="AMPERSAND",Hl="APOSTROPHE",Wl="ASTERISK",vr="AT",Ul="BACKSLASH",Vl="BACKTICK",Kl="CARET",Sr="COLON",kf="COMMA",Gl="DOLLAR",Sn="DOT",ql="EQUALS",Ef="EXCLAMATION",wn="HYPHEN",Jl="PERCENT",jl="PIPE",Yl="PLUS",Xl="POUND",Zl="QUERY",Mf="QUOTE",Tf="SEMI",xn="SLASH",Us="TILDE",Ql="UNDERSCORE",T0="EMOJI",ea="SYM";var C0=Object.freeze({__proto__:null,WORD:Wn,UWORD:vf,LOCALHOST:Fs,TLD:Sf,UTLD:wf,SCHEME:Fl,SLASH_SCHEME:Bi,NUM:xf,WS:M0,NL:_f,OPENBRACE:Fi,OPENBRACKET:$s,OPENANGLEBRACKET:Hs,OPENPAREN:Ws,CLOSEBRACE:Jr,CLOSEBRACKET:$i,CLOSEANGLEBRACKET:Hi,CLOSEPAREN:jr,AMPERSAND:$l,APOSTROPHE:Hl,ASTERISK:Wl,AT:vr,BACKSLASH:Ul,BACKTICK:Vl,CARET:Kl,COLON:Sr,COMMA:kf,DOLLAR:Gl,DOT:Sn,EQUALS:ql,EXCLAMATION:Ef,HYPHEN:wn,PERCENT:Jl,PIPE:jl,PLUS:Yl,POUND:Xl,QUERY:Zl,QUOTE:Mf,SEMI:Tf,SLASH:xn,TILDE:Us,UNDERSCORE:Ql,EMOJI:T0,SYM:ea});const Wi=/[a-z]/,Cf=/\p{L}/u,Af=/\p{Emoji}/u,Of=/\d/,A0=/\s/,O0=`
16
- `,LC="\uFE0F",PC="\u200D";let ta=null,na=null;function DC(n){n===void 0&&(n=[]);const e={};wt.groups=e;const t=new wt;ta==null&&(ta=I0(CC)),na==null&&(na=I0(AC)),D(t,"'",Hl),D(t,"{",Fi),D(t,"[",$s),D(t,"<",Hs),D(t,"(",Ws),D(t,"}",Jr),D(t,"]",$i),D(t,">",Hi),D(t,")",jr),D(t,"&",$l),D(t,"*",Wl),D(t,"@",vr),D(t,"`",Vl),D(t,"^",Kl),D(t,":",Sr),D(t,",",kf),D(t,"$",Gl),D(t,".",Sn),D(t,"=",ql),D(t,"!",Ef),D(t,"-",wn),D(t,"%",Jl),D(t,"|",jl),D(t,"+",Yl),D(t,"#",Xl),D(t,"?",Zl),D(t,'"',Mf),D(t,"/",xn),D(t,";",Tf),D(t,"~",Us),D(t,"_",Ql),D(t,"\\",Ul);const r=Gt(t,Of,xf,{[mf]:!0});Gt(r,Of,r);const i=Gt(t,Wi,Wn,{[gf]:!0});Gt(i,Wi,i);const o=Gt(t,Cf,vf,{[yf]:!0});Gt(o,Wi),Gt(o,Cf,o);const a=Gt(t,A0,M0,{[k0]:!0});D(t,O0,_f,{[k0]:!0}),D(a,O0),Gt(a,A0,a);const u=Gt(t,Af,T0,{[_0]:!0});Gt(u,Af,u),D(u,LC,u);const f=D(u,PC);Gt(f,Af,u);const d=[[Wi,i]],m=[[Wi,null],[Cf,o]];for(let p=0;p<ta.length;p++)wr(t,ta[p],Sf,Wn,d);for(let p=0;p<na.length;p++)wr(t,na[p],wf,vf,m);qr(Sf,{tld:!0,ascii:!0},e),qr(wf,{utld:!0,alpha:!0},e),wr(t,"file",Fl,Wn,d),wr(t,"mailto",Fl,Wn,d),wr(t,"http",Bi,Wn,d),wr(t,"https",Bi,Wn,d),wr(t,"ftp",Bi,Wn,d),wr(t,"ftps",Bi,Wn,d),qr(Fl,{scheme:!0,ascii:!0},e),qr(Bi,{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],w=n[p][1]?{[OC]:!0}:{[IC]:!0};y.indexOf("-")>=0?w[bf]=!0:Wi.test(y)?Of.test(y)?w[zl]=!0:w[gf]=!0:w[mf]=!0,E0(t,y,y,w)}return E0(t,"localhost",Fs,{ascii:!0}),t.jd=new wt(ea),{start:t,tokens:zi({groups:e},C0)}}function zC(n,e){const t=BC(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,d=0,m=null,p=-1,y=-1;for(;a<r&&(f=u.go(t[a]));)u=f,u.accepts()?(p=0,y=0,m=u):p>=0&&(p+=t[a].length,y++),d+=t[a].length,o+=t[a].length,a++;o-=p,a-=y,d-=p,i.push({t:m.t,v:e.slice(o-d,o),s:o-d,e:o})}return i}function BC(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 wr(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 wt(r),o.jr=i.slice(),n.j[f]=o),n=o}return o=new wt(t),o.jr=i.slice(),n.j[e[a-1]]=o,o}function I0(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 Vs={defaultProtocol:"http",events:null,format:N0,formatHref:N0,nl2br:!1,tagName:"a",target:null,rel:null,validate:!0,truncate:1/0,className:null,attributes:null,ignoreTags:[],render:null};function If(n,e){e===void 0&&(e=null);let t=zi({},Vs);n&&(t=zi(t,n instanceof If?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}If.prototype={o:Vs,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]:Vs[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 N0(n){return n}function R0(n,e){this.t="token",this.v=n,this.tk=e}R0.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=Vs.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),d=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),d&&(a.rel=d),m&&zi(a,m),{tagName:i,attributes:a,content:o,eventListeners:p}}};function ra(n,e){class t extends R0{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 L0=ra("email",{isLink:!0,toHref(){return"mailto:"+this.toString()}}),P0=ra("text"),FC=ra("nl"),Yr=ra("url",{isLink:!0,toHref(n){return n===void 0&&(n=Vs.defaultProtocol),this.hasProtocol()?this.v:`${n}://${this.v}`},hasProtocol(){const n=this.tk;return n.length>=2&&n[0].t!==Fs&&n[1].t===Sr}}),Je=n=>new wt(n);function $C(n){let{groups:e}=n;const t=e.domain.concat([$l,Wl,vr,Ul,Vl,Kl,Gl,ql,wn,xf,Jl,jl,Yl,Xl,xn,ea,Us,Ql]),r=[Hl,Hi,Jr,$i,jr,Sr,kf,Sn,Ef,Hs,Fi,$s,Ws,Zl,Mf,Tf],i=[$l,Hl,Wl,Ul,Vl,Kl,Jr,Gl,ql,wn,Fi,Jl,jl,Yl,Xl,Zl,xn,ea,Us,Ql],o=Je(),a=D(o,Us);G(a,i,a),G(a,e.domain,a);const u=Je(),f=Je(),d=Je();G(o,e.domain,u),G(o,e.scheme,f),G(o,e.slashscheme,d),G(u,i,a),G(u,e.domain,u);const m=D(u,vr);D(a,vr,m),D(f,vr,m),D(d,vr,m);const p=D(a,Sn);G(p,i,a),G(p,e.domain,a);const y=Je();G(m,e.domain,y),G(y,e.domain,y);const S=D(y,Sn);G(S,e.domain,y);const w=Je(L0);G(S,e.tld,w),G(S,e.utld,w),D(m,Fs,w);const M=D(y,wn);G(M,e.domain,y),G(w,e.domain,y),D(w,Sn,S),D(w,wn,M);const T=D(w,Sr);G(T,e.numeric,L0);const O=D(u,wn),F=D(u,Sn);G(O,e.domain,u),G(F,i,a),G(F,e.domain,u);const B=Je(Yr);G(F,e.tld,B),G(F,e.utld,B),G(B,e.domain,u),G(B,i,a),D(B,Sn,F),D(B,wn,O),D(B,vr,m);const H=D(B,Sr),X=Je(Yr);G(H,e.numeric,X);const q=Je(Yr),ie=Je();G(q,t,q),G(q,r,ie),G(ie,t,q),G(ie,r,ie),D(B,xn,q),D(X,xn,q);const Me=D(f,Sr),jt=D(d,Sr),ri=D(jt,xn),Yt=D(ri,xn);G(f,e.domain,u),D(f,Sn,F),D(f,wn,O),G(d,e.domain,u),D(d,Sn,F),D(d,wn,O),G(Me,e.domain,q),D(Me,xn,q),G(Yt,e.domain,q),G(Yt,t,q),D(Yt,xn,q);const pn=D(q,Fi),jn=D(q,$s),Xt=D(q,Hs),Tn=D(q,Ws);D(ie,Fi,pn),D(ie,$s,jn),D(ie,Hs,Xt),D(ie,Ws,Tn),D(pn,Jr,q),D(jn,$i,q),D(Xt,Hi,q),D(Tn,jr,q),D(pn,Jr,q);const He=Je(Yr),We=Je(Yr),Ue=Je(Yr),Rt=Je(Yr);G(pn,t,He),G(jn,t,We),G(Xt,t,Ue),G(Tn,t,Rt);const it=Je(),Ve=Je(),Yn=Je(),Xn=Je();return G(pn,r),G(jn,r),G(Xt,r),G(Tn,r),G(He,t,He),G(We,t,We),G(Ue,t,Ue),G(Rt,t,Rt),G(He,r,He),G(We,r,We),G(Ue,r,Ue),G(Rt,r,Rt),G(it,t,it),G(Ve,t,We),G(Yn,t,Ue),G(Xn,t,Rt),G(it,r,it),G(Ve,r,Ve),G(Yn,r,Yn),G(Xn,r,Xn),D(We,$i,q),D(Ue,Hi,q),D(Rt,jr,q),D(He,Jr,q),D(Ve,$i,q),D(Yn,Hi,q),D(Xn,jr,q),D(it,jr,q),D(o,Fs,B),D(o,_f,FC),{start:o,tokens:C0}}function HC(n,e,t){let r=t.length,i=0,o=[],a=[];for(;i<r;){let u=n,f=null,d=null,m=0,p=null,y=-1;for(;i<r&&!(f=u.go(t[i].t));)a.push(t[i++]);for(;i<r&&(d=f||u.go(t[i].t));)f=null,u=d,u.accepts()?(y=0,p=u):y>=0&&y++,i++,m++;if(y<0)i-=m,i<r&&(a.push(t[i]),i++);else{a.length>0&&(o.push(Nf(P0,e,a)),a=[]),i-=y,m-=y;const S=p.t,w=t.slice(i-m,i);o.push(Nf(S,e,w))}}return a.length>0&&o.push(Nf(P0,e,a)),o}function Nf(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 WC=typeof console<"u"&&console&&console.warn||(()=>{}),UC="until manual call of linkify.init(). Register all schemes and plugins before invoking linkify the first time.",Ae={scanner:null,parser:null,tokenQueue:[],pluginQueue:[],customSchemes:[],initialized:!1};function VC(){wt.groups={},Ae.scanner=null,Ae.parser=null,Ae.tokenQueue=[],Ae.pluginQueue=[],Ae.customSchemes=[],Ae.initialized=!1}function D0(n,e){if(e===void 0&&(e=!1),Ae.initialized&&WC(`linkifyjs: already initialized - will not register custom scheme "${n}" ${UC}`),!/^[0-9a-z]+(-[0-9a-z]+)*$/.test(n))throw new Error(`linkifyjs: incorrect scheme format.
15
+ `,textSerializers:a={}}=t||{};let u="",f=!0;return n.nodesBetween(r,i,(h,m,p,y)=>{var S;const w=a?.[h.type.name];w?(h.isBlock&&!f&&(u+=o,f=!0),p&&(u+=w({node:h,pos:m,parent:p,index:y,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 KM(n){return Object.fromEntries(Object.entries(n.nodes).filter(([,e])=>e.spec.toText).map(([e,t])=>[e,t.spec.toText]))}Pe.create({name:"clipboardTextSerializer",addProseMirrorPlugins(){return[new At({key:new an("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=KM(t);return VM(r,{from:a,to:u},{textSerializers:f})}}})]}});const GM=()=>({editor:n,view:e})=>(requestAnimationFrame(()=>{var t;n.isDestroyed||(e.dom.blur(),(t=window?.getSelection())===null||t===void 0||t.removeAllRanges())}),!0),qM=(n=!1)=>({commands:e})=>e.setContent("",n),JM=()=>({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)),y=h.resolve(m.map(f+u.nodeSize)),S=p.blockRange(y);if(!S)return;const w=Ti(S);if(u.type.isTextblock){const{defaultType:M}=p.parent.contentMatchAt(p.index());e.setNodeMarkup(S.start,M)}(w||w===0)&&e.lift(S,w)})}),!0},jM=n=>e=>n(e),YM=()=>({state:n,dispatch:e})=>bM(n,e),XM=(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 me(r.doc.resolve(a-1))),!0},ZM=()=>({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},QM=n=>({tr:e,state:t,dispatch:r})=>{const i=qe(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},eT=n=>({tr:e,dispatch:t})=>{const{from:r,to:i}=n;return t&&e.delete(r,i),!0},tT=()=>({state:n,dispatch:e})=>oM(n,e),nT=()=>({commands:n})=>n.keyboardShortcut("Enter"),rT=()=>({state:n,dispatch:e})=>yM(n,e);function Nl(n,e,t={strict:!0}){const r=Object.keys(e);return r.length?r.every(i=>t.strict?e[i]===n[i]:Zc(e[i])?e[i].test(n[i]):e[i]===n[i]):!0}function tf(n,e,t={}){return n.find(r=>r.type===e&&Nl(r.attrs,t))}function iT(n,e,t={}){return!!tf(n,e,t)}function nf(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=tf([...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(tf([...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&&iT([...n.parent.child(u).marks],e,t);)f+=n.parent.child(u).nodeSize,u+=1;return{from:a,to:f}}function vn(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 sT=(n,e={})=>({tr:t,state:r,dispatch:i})=>{const o=vn(n,r.schema),{doc:a,selection:u}=t,{$from:f,from:h,to:m}=u;if(i){const p=nf(f,o,e);if(p&&p.from<=h&&p.to>=m){const y=me.create(a,p.from,p.to);t.setSelection(y)}}return!0},oT=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 l0(n){return n instanceof me}function Gr(n=0,e=0,t=0){return Math.min(Math.max(n,e),t)}function lT(n,e=null){if(!e)return null;const t=pe.atStart(n),r=pe.atEnd(n);if(e==="start"||e===!0)return t;if(e==="end")return r;const i=t.from,o=r.to;return e==="all"?me.create(n,Gr(0,i,o),Gr(n.content.size,i,o)):me.create(n,Gr(e,i,o),Gr(e,i,o))}function rf(){return["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document}const aT=(n=null,e={})=>({editor:t,view:r,tr:i,dispatch:o})=>{e={scrollIntoView:!0,...e};const a=()=>{rf()&&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&&!l0(t.state.selection))return a(),!0;const u=lT(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},uT=(n,e)=>t=>n.every((r,i)=>e(r,{...t,index:i})),cT=(n,e)=>({tr:t,commands:r})=>r.insertContentAt({from:t.selection.from,to:t.selection.to},n,e);function a0(n){const e=`<body>${n}</body>`;return new window.DOMParser().parseFromString(e,"text/html").body}function Rl(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),Rl("",e,t)}if(typeof n=="string"){const r=vc.fromSchema(e);return t.slice?r.parseSlice(a0(n),t.parseOptions).content:r.parse(a0(n),t.parseOptions)}return Rl("",e,t)}function fT(n,e,t){const r=n.steps.length-1;if(r<e)return;const i=n.steps[r];if(!(i instanceof at||i instanceof Ye))return;const o=n.mapping.maps[r];let a=0;o.forEach((u,f,h,m)=>{a===0&&(a=m)}),n.setSelection(pe.near(n.doc.resolve(a),t))}const hT=n=>n.toString().startsWith("<"),dT=(n,e,t)=>({tr:r,dispatch:i,editor:o})=>{if(i){t={parseOptions:{},updateSelection:!0,...t};const a=Rl(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((hT(a)?a:[a]).forEach(y=>{y.check(),h=h?y.isText&&y.marks.length===0:!1,m=m?y.isBlock:!1}),u===f&&m){const{parent:y}=r.doc.resolve(u);y.isTextblock&&!y.type.spec.code&&!y.childCount&&(u-=1,f+=1)}h?Array.isArray(e)?r.insertText(e.map(y=>y.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&&fT(r,r.steps.length-1,-1)}return!0},pT=()=>({state:n,dispatch:e})=>dM(n,e),mT=()=>({state:n,dispatch:e})=>pM(n,e),gT=()=>({state:n,dispatch:e})=>aM(n,e),yT=()=>({state:n,dispatch:e})=>fM(n,e),bT=()=>({tr:n,state:e,dispatch:t})=>{try{const r=Sl(e.doc,e.selection.$from.pos,-1);return r==null?!1:(n.join(r,2),t&&t(n),!0)}catch{return!1}},vT=()=>({state:n,dispatch:e,tr:t})=>{try{const r=Sl(n.doc,n.selection.$from.pos,1);return r==null?!1:(t.join(r,2),e&&e(t),!0)}catch{return!1}};function u0(){return typeof navigator<"u"?/Mac/.test(navigator.platform):!1}function ST(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))rf()||u0()?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 wT=n=>({editor:e,view:t,tr:r,dispatch:i})=>{const o=ST(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 sf(n,e,t={}){const{from:r,to:i,empty:o}=n.selection,a=e?qe(e,n.schema):null,u=[];n.doc.nodesBetween(r,i,(p,y)=>{if(p.isText)return;const S=Math.max(r,y),w=Math.min(i,y+p.nodeSize);u.push({node:p,from:S,to:w})});const f=i-r,h=u.filter(p=>a?a.name===p.node.type.name:!0).filter(p=>Nl(p.node.attrs,t,{strict:!1}));return o?!!h.length:h.reduce((p,y)=>p+y.to-y.from,0)>=f}const xT=(n,e={})=>({state:t,dispatch:r})=>{const i=qe(n,t.schema);return sf(t,i,e)?mM(t,r):!1},_T=()=>({state:n,dispatch:e})=>vM(n,e),ET=n=>({state:e,dispatch:t})=>{const r=qe(n,e.schema);return TM(r)(e,t)},kT=()=>({state:n,dispatch:e})=>gM(n,e);function of(n,e){return e.nodes[n]?"node":e.marks[n]?"mark":null}function c0(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 MT=(n,e)=>({tr:t,state:r,dispatch:i})=>{let o=null,a=null;const u=of(typeof n=="string"?n:n.name,r.schema);return u?(u==="node"&&(o=qe(n,r.schema)),u==="mark"&&(a=vn(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,c0(h.attrs,e)),a&&h.marks.length&&h.marks.forEach(p=>{a===p.type&&t.addMark(m,m+h.nodeSize,a.create(c0(p.attrs,e)))})})}),!0):!1},TT=()=>({tr:n,dispatch:e})=>(e&&n.scrollIntoView(),!0),CT=()=>({tr:n,commands:e})=>e.setTextSelection({from:0,to:n.doc.content.size}),AT=()=>({state:n,dispatch:e})=>uM(n,e),OT=()=>({state:n,dispatch:e})=>hM(n,e),IT=()=>({state:n,dispatch:e})=>SM(n,e),NT=()=>({state:n,dispatch:e})=>_M(n,e),RT=()=>({state:n,dispatch:e})=>xM(n,e);function LT(n,e,t={}){return Rl(n,e,{slice:!1,parseOptions:t})}const PT=(n,e=!1,t={})=>({tr:r,editor:i,dispatch:o})=>{const{doc:a}=r,u=LT(n,i.schema,t);return o&&r.replaceWith(0,a.content.size,u).setMeta("preventUpdate",!e),!0};function f0(n,e){const t=vn(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 DT(n,e){const t=new dk(n);return e.forEach(r=>{r.steps.forEach(i=>{t.step(i)})}),t}function zT(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 BT(n,e,t){const r=[];return n.nodesBetween(e.from,e.to,(i,o)=>{t(i)&&r.push({node:i,pos:o})}),r}function FT(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 lf(n){return e=>FT(e.$from,n)}function $T(n,e){const t=Gi.resolve(n);return i0(t,e)}function HT(n,e){const t=qe(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 WT(n,e){const t=of(typeof e=="string"?e:e.name,n.schema);return t==="node"?HT(n,e):t==="mark"?f0(n,e):{}}function UT(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 VT(n){const e=UT(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 KT(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),y=e.invert().map(m);r.push({oldRange:{from:p,to:y},newRange:{from:h,to:m}})})}),VT(r)}function h0(n,e,t){const r=[];return n===e?t.resolve(n).marks().forEach(i=>{const o=t.resolve(n-1),a=nf(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 Ll(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 GT(n,e,t={}){const{empty:r,ranges:i}=n.selection,o=e?vn(e,n.schema):null;if(r)return!!(n.storedMarks||n.selection.$from.marks()).filter(p=>o?o.name===p.type.name:!0).find(p=>Nl(p.attrs,t,{strict:!1}));let a=0;const u=[];if(i.forEach(({$from:p,$to:y})=>{const S=p.pos,w=y.pos;n.doc.nodesBetween(S,w,(M,T)=>{if(!M.isText&&!M.marks.length)return;const O=Math.max(S,T),F=Math.min(w,T+M.nodeSize),B=F-O;a+=B,u.push(...M.marks.map(H=>({mark:H,from:O,to:F})))})}),a===0)return!1;const f=u.filter(p=>o?o.name===p.mark.type.name:!0).filter(p=>Nl(p.mark.attrs,t,{strict:!1})).reduce((p,y)=>p+y.to-y.from,0),h=u.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 d0(n,e){const{nodeExtensions:t}=Ol(e),r=t.find(a=>a.name===n);if(!r)return!1;const i={name:r.name,options:r.options,storage:r.storage},o=ae(V(r,"group",i));return typeof o!="string"?!1:o.split(" ").includes("list")}function qT(n,e,t){var r;const{selection:i}=e;let o=null;if(l0(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,y)=>{if(h)return!1;if(m.isInline){const S=!y||y.type.allowsMarkType(t),w=!!t.isInSet(m.marks)||!m.marks.some(M=>M.type.excludes(t));h=S&&w}return!h}),h})}const JT=(n,e={})=>({tr:t,state:r,dispatch:i})=>{const{selection:o}=t,{empty:a,ranges:u}=o,f=vn(n,r.schema);if(i)if(a){const h=f0(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,(y,S)=>{const w=Math.max(S,m),M=Math.min(S+y.nodeSize,p);y.marks.find(O=>O.type===f)?y.marks.forEach(O=>{f===O.type&&t.addMark(w,M,f.create({...O.attrs,...e}))}):t.addMark(w,M,f.create(e))})});return qT(r,t,f)},jT=(n,e)=>({tr:t})=>(t.setMeta(n,e),!0),YT=(n,e={})=>({state:t,dispatch:r,chain:i})=>{const o=qe(n,t.schema);return o.isTextblock?i().command(({commands:a})=>e0(o,e)(t)?!0:a.clearNodes()).command(({state:a})=>e0(o,e)(a,r)).run():(console.warn('[tiptap warn]: Currently "setNode()" only supports text block nodes.'),!1)},XT=n=>({tr:e,dispatch:t})=>{if(t){const{doc:r}=e,i=Gr(n,0,r.content.size),o=Z.create(r,i);e.setSelection(o)}return!0},ZT=n=>({tr:e,dispatch:t})=>{if(t){const{doc:r}=e,{from:i,to:o}=typeof n=="number"?{from:n,to:n}:n,a=me.atStart(r).from,u=me.atEnd(r).to,f=Gr(i,a,u),h=Gr(o,a,u),m=me.create(r,f,h);e.setSelection(m)}return!0},QT=n=>({state:e,dispatch:t})=>{const r=qe(n,e.schema);return OM(r)(e,t)};function p0(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 eC=({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=Ll(h,u.node().type.name,u.node().attrs);if(o instanceof Z&&o.node.isBlock)return!u.parentOffset||!Ci(a,u.pos)?!1:(r&&(n&&p0(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 me&&e.deleteSelection();const y=u.depth===0?void 0:zT(u.node(-1).contentMatchAt(u.indexAfter(-1)));let S=p&&y?[{type:y,attrs:m}]:void 0,w=Ci(e.doc,e.mapping.map(u.pos),1,S);if(!S&&!w&&Ci(e.doc,e.mapping.map(u.pos),1,y?[{type:y}]:void 0)&&(w=!0,S=y?[{type:y,attrs:m}]:void 0),w&&(e.split(e.mapping.map(u.pos),1,S),y&&!p&&!u.parentOffset&&u.parent.type!==y)){const M=e.mapping.map(u.before()),T=e.doc.resolve(M);u.node(-1).canReplaceWith(T.index(),T.index()+1,y)&&e.setNodeMarkup(e.mapping.map(u.before()),y)}n&&p0(t,i.extensionManager.splittableMarks),e.scrollIntoView()}return!0},tC=n=>({tr:e,state:t,dispatch:r,editor:i})=>{var o;const a=qe(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 T=L.empty;const O=u.index(-1)?1:u.index(-2)?2:3;for(let ie=u.depth-O;ie>=u.depth-3;ie-=1)T=L.from(u.node(ie).copy(T));const F=u.indexAfter(-1)<u.node(-2).childCount?1:u.indexAfter(-2)<u.node(-3).childCount?2:3,B=Ll(p,u.node().type.name,u.node().attrs),H=((o=a.contentMatch.defaultType)===null||o===void 0?void 0:o.createAndFill(B))||void 0;T=T.append(L.from(a.createAndFill(null,H)||void 0));const X=u.before(u.depth-(O-1));e.replace(X,u.after(-F),new U(T,4-O,0));let q=-1;e.doc.nodesBetween(X,e.doc.content.size,(ie,Me)=>{if(q>-1)return!1;ie.isTextblock&&ie.content.size===0&&(q=Me+1)}),q>-1&&e.setSelection(me.near(e.doc.resolve(q))),e.scrollIntoView()}return!0}const y=f.pos===u.end()?m.contentMatchAt(0).defaultType:null,S=Ll(p,m.type.name,m.attrs),w=Ll(p,u.node().type.name,u.node().attrs);e.delete(u.pos,f.pos);const M=y?[{type:a,attrs:S},{type:y,attrs:w}]:[{type:a,attrs:S}];if(!Ci(e.doc,u.pos,2))return!1;if(r){const{selection:T,storedMarks:O}=t,{splittableMarks:F}=i.extensionManager,B=O||T.$to.parentOffset&&T.$from.marks();if(e.split(u.pos,2,M).scrollIntoView(),!B||!r)return!0;const H=B.filter(X=>F.includes(X.type.name));e.ensureMarks(H)}return!0},af=(n,e)=>{const t=lf(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&&fr(n.doc,t.pos)&&n.join(t.pos),!0},uf=(n,e)=>{const t=lf(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&&fr(n.doc,r)&&n.join(r),!0},nC=(n,e,t,r={})=>({editor:i,tr:o,state:a,dispatch:u,chain:f,commands:h,can:m})=>{const{extensions:p,splittableMarks:y}=i.extensionManager,S=qe(n,a.schema),w=qe(e,a.schema),{selection:M,storedMarks:T}=a,{$from:O,$to:F}=M,B=O.blockRange(F),H=T||M.$to.parentOffset&&M.$from.marks();if(!B)return!1;const X=lf(q=>d0(q.type.name,p))(M);if(B.depth>=1&&X&&B.depth-X.depth<=1){if(X.node.type===S)return h.liftListItem(w);if(d0(X.node.type.name,p)&&S.validContent(X.node.content)&&u)return f().command(()=>(o.setNodeMarkup(X.pos,S),!0)).command(()=>af(o,S)).command(()=>uf(o,S)).run()}return!t||!H||!u?f().command(()=>m().wrapInList(S,r)?!0:h.clearNodes()).wrapInList(S,r).command(()=>af(o,S)).command(()=>uf(o,S)).run():f().command(()=>{const q=m().wrapInList(S,r),ie=H.filter(Me=>y.includes(Me.type.name));return o.ensureMarks(ie),q?!0:h.clearNodes()}).wrapInList(S,r).command(()=>af(o,S)).command(()=>uf(o,S)).run()},rC=(n,e={},t={})=>({state:r,commands:i})=>{const{extendEmptyMarkRange:o=!1}=t,a=vn(n,r.schema);return GT(r,a,e)?i.unsetMark(a,{extendEmptyMarkRange:o}):i.setMark(a,e)},iC=(n,e,t={})=>({state:r,commands:i})=>{const o=qe(n,r.schema),a=qe(e,r.schema);return sf(r,o,t)?i.setNode(a):i.setNode(o,t)},sC=(n,e={})=>({state:t,commands:r})=>{const i=qe(n,t.schema);return sf(t,i,e)?r.lift(i):r.wrapIn(i,e)},oC=()=>({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},lC=()=>({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},aC=(n,e={})=>({tr:t,state:r,dispatch:i})=>{var o;const{extendEmptyMarkRange:a=!1}=e,{selection:u}=t,f=vn(n,r.schema),{$from:h,empty:m,ranges:p}=u;if(!i)return!0;if(m&&a){let{from:y,to:S}=u;const w=(o=h.marks().find(T=>T.type===f))===null||o===void 0?void 0:o.attrs,M=nf(h,f,w);M&&(y=M.from,S=M.to),t.removeMark(y,S,f)}else p.forEach(y=>{t.removeMark(y.$from.pos,y.$to.pos,f)});return t.removeStoredMark(f),!0},uC=(n,e={})=>({tr:t,state:r,dispatch:i})=>{let o=null,a=null;const u=of(typeof n=="string"?n:n.name,r.schema);return u?(u==="node"&&(o=qe(n,r.schema)),u==="mark"&&(a=vn(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 w=Math.max(y,h),M=Math.min(y+p.nodeSize,m);t.addMark(w,M,a.create({...S.attrs,...e}))}})})}),!0):!1},cC=(n,e={})=>({state:t,dispatch:r})=>{const i=qe(n,t.schema);return EM(i,e)(t,r)},fC=(n,e={})=>({state:t,dispatch:r})=>{const i=qe(n,t.schema);return kM(i,e)(t,r)};var hC=Object.freeze({__proto__:null,blur:GM,clearContent:qM,clearNodes:JM,command:jM,createParagraphNear:YM,cut:XM,deleteCurrentNode:ZM,deleteNode:QM,deleteRange:eT,deleteSelection:tT,enter:nT,exitCode:rT,extendMarkRange:sT,first:oT,focus:aT,forEach:uT,insertContent:cT,insertContentAt:dT,joinUp:pT,joinDown:mT,joinBackward:gT,joinForward:yT,joinItemBackward:bT,joinItemForward:vT,keyboardShortcut:wT,lift:xT,liftEmptyBlock:_T,liftListItem:ET,newlineInCode:kT,resetAttributes:MT,scrollIntoView:TT,selectAll:CT,selectNodeBackward:AT,selectNodeForward:OT,selectParentNode:IT,selectTextblockEnd:NT,selectTextblockStart:RT,setContent:PT,setMark:JT,setMeta:jT,setNode:YT,setNodeSelection:XT,setTextSelection:ZT,sinkListItem:QT,splitBlock:eC,splitListItem:tC,toggleList:nC,toggleMark:rC,toggleNode:iC,toggleWrap:sC,undoInputRule:oC,unsetAllMarks:lC,unsetMark:aC,updateAttributes:uC,wrapIn:cC,wrapInList:fC});Pe.create({name:"commands",addCommands(){return{...hC}}}),Pe.create({name:"editable",addProseMirrorPlugins(){return[new At({key:new an("editable"),props:{editable:()=>this.editor.options.editable}})]}}),Pe.create({name:"focusEvents",addProseMirrorPlugins(){const{editor:n}=this;return[new At({key:new an("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}}}})]}}),Pe.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:y,parent:S}=p,w=p.parent.isTextblock?u.doc.resolve(y-1):p,M=w.parent.type.spec.isolating,T=p.pos-p.parentOffset,O=M&&w.parent.childCount===1?T===p.pos:pe.atStart(h).from===y;return!m||!O||!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 rf()||u0()?o:i},addProseMirrorPlugins(){return[new At({key:new an("clearDocument"),appendTransaction:(n,e,t)=>{if(!(n.some(w=>w.docChanged)&&!e.doc.eq(t.doc)))return;const{empty:i,from:o,to:a}=e.selection,u=pe.atStart(e.doc).from,f=pe.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,y=Al({state:t,transaction:p}),{commands:S}=new jc({editor:this.editor,state:y});if(S.clearNodes(),!!p.steps.length)return p}})]}}),Pe.create({name:"tabindex",addProseMirrorPlugins(){return[new At({key:new an("tabindex"),props:{attributes:this.editor.isEditable?{tabindex:"0"}:{}}})]}});function dC(n){return new o0({find:n.find,handler:({state:e,range:t,match:r})=>{const i=e.doc.resolve(t.from),o=ae(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 pC(n){return new o0({find:n.find,handler:({state:e,range:t,match:r,chain:i})=>{const o=ae(n.getAttributes,void 0,r)||{},a=e.tr.delete(t.from,t.to),f=a.doc.resolve(t.from).blockRange(),h=f&&kc(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,w=y||p.$to.parentOffset&&p.$from.marks();if(w){const M=w.filter(T=>S.includes(T.type.name));a.ensureMarks(M)}}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&&fr(a.doc,t.from-1)&&(!n.joinPredicate||n.joinPredicate(r,m))&&a.join(t.from-1)}})}class It{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=ae(V(this,"addOptions",{name:this.name}))),this.storage=ae(V(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(e={}){return new It(e)}configure(e={}){const t=this.extend();return t.options=Il(this.options,e),t.storage=ae(V(t,"addStorage",{name:t.name,options:t.options})),t}extend(e={}){const t=new It(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=ae(V(t,"addOptions",{name:t.name})),t.storage=ae(V(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 Jn{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=ae(V(this,"addOptions",{name:this.name}))),this.storage=ae(V(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(e={}){return new Jn(e)}configure(e={}){const t=this.extend();return t.options=Il(this.options,e),t.storage=ae(V(t,"addStorage",{name:t.name,options:t.options})),t}extend(e={}){const t=new Jn(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=ae(V(t,"addOptions",{name:t.name})),t.storage=ae(V(t,"addStorage",{name:t.name,options:t.options})),t}}function mC(n){return new BM({find:n.find,handler:({state:e,range:t,match:r,pasteEvent:i})=>{const o=ae(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),y=p+u.length;if(h0(t.from,t.to,e.doc).filter(w=>w.mark.type.excluded.find(T=>T===n.type&&T!==w.mark.type)).filter(w=>w.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+u.length,a.addMark(t.from+m,h,n.type.create(o||{})),a.removeStoredMark(n.type)}}})}const gC=Jn.create({name:"text",group:"inline"});var Pl=200,nt=function(){};nt.prototype.append=function(e){return e.length?(e=nt.from(e),!this.length&&e||e.length<Pl&&this.leafAppend(e)||this.length<Pl&&e.leafPrepend(this)||this.appendInner(e)):this},nt.prototype.prepend=function(e){return e.length?nt.from(e).append(this):this},nt.prototype.appendInner=function(e){return new yC(this,e)},nt.prototype.slice=function(e,t){return e===void 0&&(e=0),t===void 0&&(t=this.length),e>=t?nt.empty:this.sliceInner(Math.max(0,e),Math.min(this.length,t))},nt.prototype.get=function(e){if(!(e<0||e>=this.length))return this.getInner(e)},nt.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)},nt.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},nt.from=function(e){return e instanceof nt?e:e&&e.length?new m0(e):nt.empty};var m0=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<=Pl)return new e(this.values.concat(i.flatten()))},e.prototype.leafPrepend=function(i){if(this.length+i.length<=Pl)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}(nt);nt.empty=new m0([]);var yC=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}(nt),g0=nt;const bC=500;class dn{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,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 _n(p.map));let S=p.step.map(i.slice(o)),w;S&&a.maybeStep(S).doc&&(w=a.mapping.maps[a.mapping.maps.length-1],h.push(new _n(w,void 0,void 0,h.length+m.length))),o--,w&&i.appendMap(w,o)}else a.maybeStep(p.step);if(p.selection)return u=i?p.selection.map(i.slice(o)):p.selection,f=new dn(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]),y=new _n(e.mapping.maps[m],p,t),S;(S=f&&f.merge(y))&&(y=S,m?o.pop():u=u.slice(0,u.length-1)),o.push(y),t&&(a++,t=void 0),i||(f=y)}let h=a-r.depth;return h>SC&&(u=vC(u,h),a-=h),new dn(u.append(o),a)}remapping(e,t){let r=new qi;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 dn(this.items.append(e.map(t=>new _n(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(y=>{y.selection&&u--},i);let f=t;this.items.forEach(y=>{let S=o.getMirror(--f);if(S==null)return;a=Math.min(a,S);let w=o.maps[S];if(y.step){let M=e.steps[S].invert(e.docs[S]),T=y.selection&&y.selection.map(o.slice(f+1,S));T&&u++,r.push(new _n(w,M,T))}else r.push(new _n(w))},i);let h=[];for(let y=t;y<a;y++)h.push(new _n(o.maps[y]));let m=this.items.slice(0,i).append(h).append(r),p=new dn(m,u);return p.emptyItemCount()>bC&&(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 _n(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 dn(g0.from(i.reverse()),o)}}dn.empty=new dn(g0.empty,0);function vC(n,e){let t;return n.forEach((r,i)=>{if(r.selection&&e--==0)return t=i,!1}),n.slice(t)}class _n{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 _n(t.getMap().invert(),t,this.selection)}}}class gr{constructor(e,t,r,i){this.done=e,this.undone=t,this.prevRanges=r,this.prevTime=i}}const SC=20;function wC(n,e,t,r){let i=t.getMeta(yr),o;if(i)return i.historyState;t.getMeta(_C)&&(n=new gr(n.done,n.undone,null,0));let a=t.getMeta("appendedTransaction");if(t.steps.length==0)return n;if(a&&a.getMeta(yr))return a.getMeta(yr).redo?new gr(n.done.addTransform(t,void 0,r,Dl(e)),n.undone,y0(t.mapping.maps[t.steps.length-1]),n.prevTime):new gr(n.done,n.undone.addTransform(t,void 0,r,Dl(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||!xC(t,n.prevRanges)),f=a?cf(n.prevRanges,t.mapping):y0(t.mapping.maps[t.steps.length-1]);return new gr(n.done.addTransform(t,u?e.selection.getBookmark():void 0,r,Dl(e)),dn.empty,f,t.time)}else return(o=t.getMeta("rebased"))?new gr(n.done.rebased(t,o),n.undone.rebased(t,o),cf(n.prevRanges,t.mapping),n.prevTime):new gr(n.done.addMaps(t.mapping.maps),n.undone.addMaps(t.mapping.maps),cf(n.prevRanges,t.mapping),n.prevTime)}function xC(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 y0(n){let e=[];return n.forEach((t,r,i,o)=>e.push(i,o)),e}function cf(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 b0(n,e,t,r){let i=Dl(e),o=yr.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 gr(r?f:a.remaining,r?a.remaining:f,null,0);t(a.transform.setSelection(u).setMeta(yr,{redo:r,historyState:h}).scrollIntoView())}let ff=!1,v0=null;function Dl(n){let e=n.plugins;if(v0!=e){ff=!1,v0=e;for(let t=0;t<e.length;t++)if(e[t].spec.historyPreserveItems){ff=!0;break}}return ff}const yr=new an("history"),_C=new an("closeHistory");function EC(n={}){return n={depth:n.depth||100,newGroupDelay:n.newGroupDelay||500},new At({key:yr,state:{init(){return new gr(dn.empty,dn.empty,null,0)},apply(e,t,r){return wC(t,r,e,n)}},config:n,props:{handleDOMEvents:{beforeinput(e,t){let r=t.inputType,i=r=="historyUndo"?S0:r=="historyRedo"?w0:null;return i?(t.preventDefault(),i(e.state,e.dispatch)):!1}}}})}const S0=(n,e)=>{let t=yr.getState(n);return!t||t.done.eventCount==0?!1:(e&&b0(t,n,e,!1),!0)},w0=(n,e)=>{let t=yr.getState(n);return!t||t.undone.eventCount==0?!1:(e&&b0(t,n,e,!0),!0)},kC=Pe.create({name:"history",addOptions(){return{depth:100,newGroupDelay:500}},addCommands(){return{undo:()=>({state:n,dispatch:e})=>S0(n,e),redo:()=>({state:n,dispatch:e})=>w0(n,e)}},addProseMirrorPlugins(){return[EC(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()}}}),hf=Object.freeze({COMMON:"common",DESKTOP:"desktop",TABLET:"tablet",MOBILE:"mobile",get values(){return[this.COMMON,this.MOBILE,this.TABLET,this.DESKTOP]}}),df=Object.freeze({UPPERCASE:"uppercase",LOWERCASE:"lowercase",CAPITALIZE:"capitalize"}),br=Object.freeze({LEFT:"left",CENTER:"center",RIGHT:"right",JUSTIFY:"justify",get values(){return[this.LEFT,this.CENTER,this.RIGHT,this.JUSTIFY]}}),ne=Object.freeze({DOCUMENT:"doc",PARAGRAPH:"paragraph",HEADING:"heading",LIST:"list",LIST_ITEM:"listItem",TEXT:"text",get blocks(){return[this.PARAGRAPH,this.LIST,this.HEADING]}}),Kt=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]}}),he=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]}}),cn=Object.freeze({SETTINGS:"settings",ALL:"_"}),x0=Object.freeze({BLANK:"_blank",SELF:"_self"}),Bs=Object.freeze({URL:"url",BLOCK:"block"});class pf{static create(e,t){const r=new this(e,t||{});return new At({key:new an(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 MC extends pf{addProps(){return{transformPastedHTML:this._transformPastedHTML,handlePaste:this._handlePaste}}_transformPastedHTML(e){if(e.includes("data-pm-slice")&&e.includes("zw-style"))return e;const t=va.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===ne.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 TC extends pf{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}),Xe.create(e,t)}}const CC="aaa1rp3barth4b0ott3vie4c1le2ogado5udhabi7c0ademy5centure6ountant0s9o1tor4d0s1ult4e0g1ro2tna4f0l1rica5g0akhan5ency5i0g1rbus3force5tel5kdn3l0faromeo7ibaba4pay4lfinanz6state5y2sace3tom5m0azon4ericanexpress7family11x2fam3ica3sterdam8nalytics7droid5quan4z2o0l2partments8p0le4q0uarelle8r0ab1mco4chi3my2pa2t0e3s0da2ia2sociates9t0hleta5torney7u0ction5di0ble3o3spost5thor3o0s4vianca6w0s2x0a2z0ure5ba0by2idu3namex3narepublic11d1k2r0celona5laycard4s5efoot5gains6seball5ketball8uhaus5yern5b0c1t1va3cg1n2d1e0ats2uty4er2ntley5rlin4st0buy5t2f1g1h0arti5i0ble3d1ke2ng0o3o1z2j1lack0friday9ockbuster8g1omberg7ue3m0s1w2n0pparibas9o0ats3ehringer8fa2m1nd2o0k0ing5sch2tik2on4t1utique6x2r0adesco6idgestone9oadway5ker3ther5ussels7s1t1uild0ers6siness6y1zz3v1w1y1z0h3ca0b1fe2l0l1vinklein9m0era3p2non3petown5ital0one8r0avan4ds2e0er0s4s2sa1e1h1ino4t0ering5holic7ba1n1re2s2c1d1enter4o1rn3f0a1d2g1h0anel2nel4rity4se2t2eap3intai5ristmas6ome4urch5i0priani6rcle4sco3tadel4i0c2y0eats7k1l0aims4eaning6ick2nic1que6othing5ud3ub0med6m1n1o0ach3des3ffee4llege4ogne5m0cast4mbank4unity6pany2re3uter5sec4ndos3struction8ulting7tact3ractors9oking0channel11l1p2rsica5untry4pon0s4rses6pa2r0edit0card4union9icket5own3s1uise0s6u0isinella9v1w1x1y0mru3ou3z2dabur3d1nce3ta1e1ing3sun4y2clk3ds2e0al0er2s3gree4livery5l1oitte5ta3mocrat6ntal2ist5si0gn4v2hl2iamonds6et2gital5rect0ory7scount3ver5h2y2j1k1m1np2o0cs1tor4g1mains5t1wnload7rive4tv2ubai3nlop4pont4rban5vag2r2z2earth3t2c0o2deka3u0cation8e1g1mail3erck5nergy4gineer0ing9terprises10pson4quipment8r0icsson6ni3s0q1tate5t0isalat7u0rovision8s2vents5xchange6pert3osed4ress5traspace10fage2il1rwinds6th3mily4n0s2rm0ers5shion4t3edex3edback6rrari3ero6i0at2delity5o2lm2nal1nce1ial7re0stone6mdale6sh0ing5t0ness6j1k1lickr3ghts4r2orist4wers5y2m1o0o0d0network8tball6rd1ex2sale4um3undation8x2r0ee1senius7l1ogans4ntdoor4ier7tr2ujitsu5n0d2rniture7tbol5yi3ga0l0lery3o1up4me0s3p1rden4y2b0iz3d0n2e0a1nt0ing5orge5f1g0ee3h1i0ft0s3ves2ing5l0ass3e1obal2o4m0ail3bh2o1x2n1odaddy5ld0point6f2o0dyear5g0le4p1t1v2p1q1r0ainger5phics5tis4een3ipe3ocery4up4s1t1u0ardian6cci3ge2ide2tars5ru3w1y2hair2mburg5ngout5us3bo2dfc0bank7ealth0care8lp1sinki6re1mes5gtv3iphop4samitsu7tachi5v2k0t2m1n1ockey4ldings5iday5medepot5goods5s0ense7nda3rse3spital5t0ing5t0eles2s3mail5use3w2r1sbc3t1u0ghes5yatt3undai7ibm2cbc2e1u2d1e0ee3fm2kano4l1m0amat4db2mo0bilien9n0c1dustries8finiti5o2g1k1stitute6urance4e4t0ernational10uit4vestments10o1piranga7q1r0ish4s0maili5t0anbul7t0au2v3jaguar4va3cb2e0ep2tzt3welry6io2ll2m0p2nj2o0bs1urg4t1y2p0morgan6rs3uegos4niper7kaufen5ddi3e0rryhotels6logistics9properties14fh2g1h1i0a1ds2m1nder2le4tchen5wi3m1n1oeln3matsu5sher5p0mg2n2r0d1ed3uokgroup8w1y0oto4z2la0caixa5mborghini8er3ncaster5ia3d0rover6xess5salle5t0ino3robe5w0yer5b1c1ds2ease3clerc5frak4gal2o2xus4gbt3i0dl2fe0insurance9style7ghting6ke2lly3mited4o2ncoln4de2k2psy3ve1ing5k1lc1p2oan0s3cker3us3l1ndon4tte1o3ve3pl0financial11r1s1t0d0a3u0ndbeck6xe1ury5v1y2ma0cys3drid4if1son4keup4n0agement7go3p1rket0ing3s4riott5shalls7serati6ttel5ba2c0kinsey7d1e0d0ia3et2lbourne7me1orial6n0u2rckmsd7g1h1iami3crosoft7l1ni1t2t0subishi9k1l0b1s2m0a2n1o0bi0le4da2e1i1m1nash3ey2ster5rmon3tgage6scow4to0rcycles9v0ie4p1q1r1s0d2t0n1r2u0seum3ic3tual5v1w1x1y1z2na0b1goya4me2tura4vy3ba2c1e0c1t0bank4flix4work5ustar5w0s2xt0direct7us4f0l2g0o2hk2i0co2ke1on3nja3ssan1y5l1o0kia3rthwesternmutual14on4w0ruz3tv4p1r0a1w2tt2u1yc2z2obi1server7ffice5kinawa6layan0group9dnavy5lo3m0ega4ne1g1l0ine5oo2pen3racle3nge4g0anic5igins6saka4tsuka4t2vh3pa0ge2nasonic7ris2s1tners4s1y3ssagens7y2ccw3e0t2f0izer5g1h0armacy6d1ilips5one2to0graphy6s4ysio5ics1tet2ures6d1n0g1k2oneer5zza4k1l0ace2y0station9umbing5s3m1n0c2ohl2ker3litie5rn2st3r0america6xi3ess3ime3o0d0uctions8f1gressive8mo2perties3y5tection8u0dential9s1t1ub2w0c2y2qa1pon3uebec3st5racing4dio4e0ad1lestate6tor2y4cipes5d0stone5umbrella9hab3ise0n3t2liance6n0t0als5pair3ort3ublican8st0aurant8view0s5xroth6ich0ardli6oh3l1o1p2o0cher3ks3deo3gers4om3s0vp3u0gby3hr2n2w0e2yukyu6sa0arland6fe0ty4kura4le1on3msclub4ung5ndvik0coromant12ofi4p1rl2s1ve2xo3b0i1s2c0a1b1haeffler7midt4olarships8ol3ule3warz5ience5ot3d1e0arch3t2cure1ity6ek2lect4ner3rvices6ven3w1x0y3fr2g1h0angrila6rp2w2ell3ia1ksha5oes2p0ping5uji3w0time7i0lk2na1gles5te3j1k0i0n2y0pe4l0ing4m0art3ile4n0cf3o0ccer3ial4ftbank4ware6hu2lar2utions7ng1y2y2pa0ce3ort2t3r0l2s1t0ada2ples4r1tebank4farm7c0group6ockholm6rage3e3ream4udio2y3yle4u0cks3pplies3y2ort5rf1gery5zuki5v1watch4iss4x1y0dney4stems6z2tab1ipei4lk2obao4rget4tamotors6r2too4x0i3c0i2d0k2eam2ch0nology8l1masek5nnis4va3f1g1h0d1eater2re6iaa2ckets5enda4ffany5ps2res2ol4j0maxx4x2k0maxx5l1m0all4n1o0day3kyo3ols3p1ray3shiba5tal3urs3wn2yota3s3r0ade1ing4ining5vel0channel7ers0insurance16ust3v2t1ube2i1nes3shu4v0s2w1z2ua1bank3s2g1k1nicom3versity8o2ol2ps2s1y1z2va0cations7na1guard7c1e0gas3ntures6risign5m\xF6gensberater2ung14sicherung10t2g1i0ajes4deo3g1king4llas4n1p1rgin4sa1ion4va1o3laanderen9n1odka3lkswagen7vo3te1ing3o2yage5u0elos6wales2mart4ter4ng0gou5tch0es6eather0channel12bcam3er2site5d0ding5ibo2r3f1hoswho6ien2ki2lliamhill9n0dows4e1ners6me2olterskluwer11odside6rk0s2ld3w2s1tc1f3xbox3erox4finity6ihuan4n2xx2yz3yachts4hoo3maxun5ndex5e1odobashi7ga2kohama6u0tube6t1un3za0ppos4ra3ero3ip2m1one3uerich6w2",AC="\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",zi=(n,e)=>{for(const t in e)n[t]=e[t];return n},mf="numeric",gf="ascii",yf="alpha",zl="asciinumeric",Bl="alphanumeric",bf="domain",_0="emoji",OC="scheme",IC="slashscheme",E0="whitespace";function NC(n,e){return n in e||(e[n]=[]),e[n]}function qr(n,e,t){e[mf]&&(e[zl]=!0,e[Bl]=!0),e[gf]&&(e[zl]=!0,e[yf]=!0),e[zl]&&(e[Bl]=!0),e[yf]&&(e[Bl]=!0),e[Bl]&&(e[bf]=!0),e[_0]&&(e[bf]=!0);for(const r in e){const i=NC(r,t);i.indexOf(n)<0&&i.push(n)}}function RC(n,e){const t={};for(const r in e)e[r].indexOf(n)>=0&&(t[r]=!0);return t}function wt(n){n===void 0&&(n=null),this.j={},this.jr=[],this.jd=null,this.t=n}wt.groups={},wt.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||wt.groups;let i;return e&&e.j?i=e:(i=new wt(e),t&&r&&qr(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||wt.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 wt,zi(a.j,u.j),a.jr.push.apply(a.jr,u.jr),a.jd=u.jd,a.t=u.t):a=new wt,o){if(r)if(a.t&&typeof a.t=="string"){const f=zi(RC(a.t,r),t);qr(o,f,r)}else t&&qr(o,t,r);a.t=o}return i.j[n]=a,a}};const G=(n,e,t,r,i)=>n.ta(e,t,r,i),Gt=(n,e,t,r,i)=>n.tr(e,t,r,i),k0=(n,e,t,r,i)=>n.ts(e,t,r,i),D=(n,e,t,r,i)=>n.tt(e,t,r,i),Wn="WORD",vf="UWORD",Fs="LOCALHOST",Sf="TLD",wf="UTLD",Fl="SCHEME",Bi="SLASH_SCHEME",xf="NUM",M0="WS",_f="NL",Fi="OPENBRACE",$s="OPENBRACKET",Hs="OPENANGLEBRACKET",Ws="OPENPAREN",Jr="CLOSEBRACE",$i="CLOSEBRACKET",Hi="CLOSEANGLEBRACKET",jr="CLOSEPAREN",$l="AMPERSAND",Hl="APOSTROPHE",Wl="ASTERISK",vr="AT",Ul="BACKSLASH",Vl="BACKTICK",Kl="CARET",Sr="COLON",Ef="COMMA",Gl="DOLLAR",Sn="DOT",ql="EQUALS",kf="EXCLAMATION",wn="HYPHEN",Jl="PERCENT",jl="PIPE",Yl="PLUS",Xl="POUND",Zl="QUERY",Mf="QUOTE",Tf="SEMI",xn="SLASH",Us="TILDE",Ql="UNDERSCORE",T0="EMOJI",ea="SYM";var C0=Object.freeze({__proto__:null,WORD:Wn,UWORD:vf,LOCALHOST:Fs,TLD:Sf,UTLD:wf,SCHEME:Fl,SLASH_SCHEME:Bi,NUM:xf,WS:M0,NL:_f,OPENBRACE:Fi,OPENBRACKET:$s,OPENANGLEBRACKET:Hs,OPENPAREN:Ws,CLOSEBRACE:Jr,CLOSEBRACKET:$i,CLOSEANGLEBRACKET:Hi,CLOSEPAREN:jr,AMPERSAND:$l,APOSTROPHE:Hl,ASTERISK:Wl,AT:vr,BACKSLASH:Ul,BACKTICK:Vl,CARET:Kl,COLON:Sr,COMMA:Ef,DOLLAR:Gl,DOT:Sn,EQUALS:ql,EXCLAMATION:kf,HYPHEN:wn,PERCENT:Jl,PIPE:jl,PLUS:Yl,POUND:Xl,QUERY:Zl,QUOTE:Mf,SEMI:Tf,SLASH:xn,TILDE:Us,UNDERSCORE:Ql,EMOJI:T0,SYM:ea});const Wi=/[a-z]/,Cf=/\p{L}/u,Af=/\p{Emoji}/u,Of=/\d/,A0=/\s/,O0=`
16
+ `,LC="\uFE0F",PC="\u200D";let ta=null,na=null;function DC(n){n===void 0&&(n=[]);const e={};wt.groups=e;const t=new wt;ta==null&&(ta=I0(CC)),na==null&&(na=I0(AC)),D(t,"'",Hl),D(t,"{",Fi),D(t,"[",$s),D(t,"<",Hs),D(t,"(",Ws),D(t,"}",Jr),D(t,"]",$i),D(t,">",Hi),D(t,")",jr),D(t,"&",$l),D(t,"*",Wl),D(t,"@",vr),D(t,"`",Vl),D(t,"^",Kl),D(t,":",Sr),D(t,",",Ef),D(t,"$",Gl),D(t,".",Sn),D(t,"=",ql),D(t,"!",kf),D(t,"-",wn),D(t,"%",Jl),D(t,"|",jl),D(t,"+",Yl),D(t,"#",Xl),D(t,"?",Zl),D(t,'"',Mf),D(t,"/",xn),D(t,";",Tf),D(t,"~",Us),D(t,"_",Ql),D(t,"\\",Ul);const r=Gt(t,Of,xf,{[mf]:!0});Gt(r,Of,r);const i=Gt(t,Wi,Wn,{[gf]:!0});Gt(i,Wi,i);const o=Gt(t,Cf,vf,{[yf]:!0});Gt(o,Wi),Gt(o,Cf,o);const a=Gt(t,A0,M0,{[E0]:!0});D(t,O0,_f,{[E0]:!0}),D(a,O0),Gt(a,A0,a);const u=Gt(t,Af,T0,{[_0]:!0});Gt(u,Af,u),D(u,LC,u);const f=D(u,PC);Gt(f,Af,u);const h=[[Wi,i]],m=[[Wi,null],[Cf,o]];for(let p=0;p<ta.length;p++)wr(t,ta[p],Sf,Wn,h);for(let p=0;p<na.length;p++)wr(t,na[p],wf,vf,m);qr(Sf,{tld:!0,ascii:!0},e),qr(wf,{utld:!0,alpha:!0},e),wr(t,"file",Fl,Wn,h),wr(t,"mailto",Fl,Wn,h),wr(t,"http",Bi,Wn,h),wr(t,"https",Bi,Wn,h),wr(t,"ftp",Bi,Wn,h),wr(t,"ftps",Bi,Wn,h),qr(Fl,{scheme:!0,ascii:!0},e),qr(Bi,{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],w=n[p][1]?{[OC]:!0}:{[IC]:!0};y.indexOf("-")>=0?w[bf]=!0:Wi.test(y)?Of.test(y)?w[zl]=!0:w[gf]=!0:w[mf]=!0,k0(t,y,y,w)}return k0(t,"localhost",Fs,{ascii:!0}),t.jd=new wt(ea),{start:t,tokens:zi({groups:e},C0)}}function zC(n,e){const t=BC(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,y=-1;for(;a<r&&(f=u.go(t[a]));)u=f,u.accepts()?(p=0,y=0,m=u):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 BC(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 wr(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 wt(r),o.jr=i.slice(),n.j[f]=o),n=o}return o=new wt(t),o.jr=i.slice(),n.j[e[a-1]]=o,o}function I0(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 Vs={defaultProtocol:"http",events:null,format:N0,formatHref:N0,nl2br:!1,tagName:"a",target:null,rel:null,validate:!0,truncate:1/0,className:null,attributes:null,ignoreTags:[],render:null};function If(n,e){e===void 0&&(e=null);let t=zi({},Vs);n&&(t=zi(t,n instanceof If?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}If.prototype={o:Vs,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]:Vs[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 N0(n){return n}function R0(n,e){this.t="token",this.v=n,this.tk=e}R0.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=Vs.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&&zi(a,m),{tagName:i,attributes:a,content:o,eventListeners:p}}};function ra(n,e){class t extends R0{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 L0=ra("email",{isLink:!0,toHref(){return"mailto:"+this.toString()}}),P0=ra("text"),FC=ra("nl"),Yr=ra("url",{isLink:!0,toHref(n){return n===void 0&&(n=Vs.defaultProtocol),this.hasProtocol()?this.v:`${n}://${this.v}`},hasProtocol(){const n=this.tk;return n.length>=2&&n[0].t!==Fs&&n[1].t===Sr}}),Je=n=>new wt(n);function $C(n){let{groups:e}=n;const t=e.domain.concat([$l,Wl,vr,Ul,Vl,Kl,Gl,ql,wn,xf,Jl,jl,Yl,Xl,xn,ea,Us,Ql]),r=[Hl,Hi,Jr,$i,jr,Sr,Ef,Sn,kf,Hs,Fi,$s,Ws,Zl,Mf,Tf],i=[$l,Hl,Wl,Ul,Vl,Kl,Jr,Gl,ql,wn,Fi,Jl,jl,Yl,Xl,Zl,xn,ea,Us,Ql],o=Je(),a=D(o,Us);G(a,i,a),G(a,e.domain,a);const u=Je(),f=Je(),h=Je();G(o,e.domain,u),G(o,e.scheme,f),G(o,e.slashscheme,h),G(u,i,a),G(u,e.domain,u);const m=D(u,vr);D(a,vr,m),D(f,vr,m),D(h,vr,m);const p=D(a,Sn);G(p,i,a),G(p,e.domain,a);const y=Je();G(m,e.domain,y),G(y,e.domain,y);const S=D(y,Sn);G(S,e.domain,y);const w=Je(L0);G(S,e.tld,w),G(S,e.utld,w),D(m,Fs,w);const M=D(y,wn);G(M,e.domain,y),G(w,e.domain,y),D(w,Sn,S),D(w,wn,M);const T=D(w,Sr);G(T,e.numeric,L0);const O=D(u,wn),F=D(u,Sn);G(O,e.domain,u),G(F,i,a),G(F,e.domain,u);const B=Je(Yr);G(F,e.tld,B),G(F,e.utld,B),G(B,e.domain,u),G(B,i,a),D(B,Sn,F),D(B,wn,O),D(B,vr,m);const H=D(B,Sr),X=Je(Yr);G(H,e.numeric,X);const q=Je(Yr),ie=Je();G(q,t,q),G(q,r,ie),G(ie,t,q),G(ie,r,ie),D(B,xn,q),D(X,xn,q);const Me=D(f,Sr),jt=D(h,Sr),ri=D(jt,xn),Yt=D(ri,xn);G(f,e.domain,u),D(f,Sn,F),D(f,wn,O),G(h,e.domain,u),D(h,Sn,F),D(h,wn,O),G(Me,e.domain,q),D(Me,xn,q),G(Yt,e.domain,q),G(Yt,t,q),D(Yt,xn,q);const pn=D(q,Fi),jn=D(q,$s),Xt=D(q,Hs),Tn=D(q,Ws);D(ie,Fi,pn),D(ie,$s,jn),D(ie,Hs,Xt),D(ie,Ws,Tn),D(pn,Jr,q),D(jn,$i,q),D(Xt,Hi,q),D(Tn,jr,q),D(pn,Jr,q);const He=Je(Yr),We=Je(Yr),Ue=Je(Yr),Rt=Je(Yr);G(pn,t,He),G(jn,t,We),G(Xt,t,Ue),G(Tn,t,Rt);const it=Je(),Ve=Je(),Yn=Je(),Xn=Je();return G(pn,r),G(jn,r),G(Xt,r),G(Tn,r),G(He,t,He),G(We,t,We),G(Ue,t,Ue),G(Rt,t,Rt),G(He,r,He),G(We,r,We),G(Ue,r,Ue),G(Rt,r,Rt),G(it,t,it),G(Ve,t,We),G(Yn,t,Ue),G(Xn,t,Rt),G(it,r,it),G(Ve,r,Ve),G(Yn,r,Yn),G(Xn,r,Xn),D(We,$i,q),D(Ue,Hi,q),D(Rt,jr,q),D(He,Jr,q),D(Ve,$i,q),D(Yn,Hi,q),D(Xn,jr,q),D(it,jr,q),D(o,Fs,B),D(o,_f,FC),{start:o,tokens:C0}}function HC(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,y=-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()?(y=0,p=u):y>=0&&y++,i++,m++;if(y<0)i-=m,i<r&&(a.push(t[i]),i++);else{a.length>0&&(o.push(Nf(P0,e,a)),a=[]),i-=y,m-=y;const S=p.t,w=t.slice(i-m,i);o.push(Nf(S,e,w))}}return a.length>0&&o.push(Nf(P0,e,a)),o}function Nf(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 WC=typeof console<"u"&&console&&console.warn||(()=>{}),UC="until manual call of linkify.init(). Register all schemes and plugins before invoking linkify the first time.",Ae={scanner:null,parser:null,tokenQueue:[],pluginQueue:[],customSchemes:[],initialized:!1};function VC(){wt.groups={},Ae.scanner=null,Ae.parser=null,Ae.tokenQueue=[],Ae.pluginQueue=[],Ae.customSchemes=[],Ae.initialized=!1}function D0(n,e){if(e===void 0&&(e=!1),Ae.initialized&&WC(`linkifyjs: already initialized - will not register custom scheme "${n}" ${UC}`),!/^[0-9a-z]+(-[0-9a-z]+)*$/.test(n))throw new Error(`linkifyjs: incorrect scheme format.
17
17
  1. Must only contain digits, lowercase ASCII letters or "-"
18
18
  2. Cannot start or end with "-"
19
- 3. "-" cannot repeat`);Ae.customSchemes.push([n,e])}function KC(){Ae.scanner=DC(Ae.customSchemes);for(let n=0;n<Ae.tokenQueue.length;n++)Ae.tokenQueue[n][1]({scanner:Ae.scanner});Ae.parser=$C(Ae.scanner.tokens);for(let n=0;n<Ae.pluginQueue.length;n++)Ae.pluginQueue[n][1]({scanner:Ae.scanner,parser:Ae.parser});Ae.initialized=!0}function z0(n){return Ae.initialized||KC(),HC(Ae.parser.start,n,zC(Ae.scanner.start,n))}function Rf(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 If(t),i=z0(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 GC(n,e){e===void 0&&(e=null);const t=z0(n);return t.length===1&&t[0].isLink&&(!e||t[0].t===e)}class qC extends pf{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=GC(i);if(!i||!o)return!1;const a=this._createLinkAttrs(i,r.content);return this.editor.commands.applyLink(a),!0}_createLinkAttrs(e,t){return id.query(t,{typeName:ne.TEXT,mark:{typeName:de.LINK},getMark:{typeName:de.LINK}})?.attrs||{href:e}}}function P(n){return(...e)=>t=>n(t,...e)}function ia(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 Xr(n){const e=ia(n);return["span",e?{...e,class:"zw-style"}:{},0]}function JC(n){return n.toLowerCase().replace(/(?:^|\s)\S/g,e=>e.toUpperCase())}function qt(n,...e){return({editor:t})=>(t.commands[n](...e),!0)}var jC=Object.defineProperty,YC=(n,e,t)=>e in n?jC(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,xr=(n,e,t)=>YC(n,typeof e!="symbol"?e+"":e,t),B0,F0,$0;let H0=999;function XC(){return H0+=1,H0}function Fe(n,e){let t=n.length;Array.isArray(n[0])||(n=[n]),Array.isArray(e[0])||(e=e.map(a=>[a]));let r=e[0].length,i=e[0].map((a,u)=>e.map(f=>f[u])),o=n.map(a=>i.map(u=>{let f=0;if(!Array.isArray(a)){for(let d of u)f+=a*d;return f}for(let d=0;d<a.length;d++)f+=a[d]*(u[d]||0);return f}));return t===1&&(o=o[0]),r===1?o.map(a=>a[0]):o}function W0(n){return Ks(n)==="string"}function Ks(n){return(Object.prototype.toString.call(n).match(/^\[object\s+(.*?)\]$/)[1]||"").toLowerCase()}function Lf(n,{precision:e,unit:t}){return Pf(n)?"none":ZC(n,e)+(t??"")}function Pf(n){return Number.isNaN(n)||n instanceof Number&&n?.none}function ZC(n,e){if(n===0)return 0;let t=~~n,r=0;t&&e&&(r=~~Math.log10(Math.abs(t))+1);const i=10**(e-r);return Math.floor(n*i+.5)/i}const QC={deg:1,grad:.9,rad:180/Math.PI,turn:360};function eA(n){if(!n)return;n=n.trim();const e=/^([a-z]+)\((.+?)\)$/i,t=/^-?[\d.]+$/,r=/%|deg|g?rad|turn$/,i=/\/?\s*(none|[-\w.]+(?:%|deg|g?rad|turn)?)/g;let o=n.match(e);if(o){let a=[];return o[2].replace(i,(u,f)=>{let d=f.match(r),m=f;if(d){let p=d[0],y=m.slice(0,-p.length);p==="%"?(m=new Number(y/100),m.type="<percentage>"):(m=new Number(y*QC[p]),m.type="<angle>",m.unit=p)}else t.test(m)?(m=new Number(m),m.type="<number>"):m==="none"&&(m=new Number(NaN),m.none=!0);u.startsWith("/")&&(m=m instanceof Number?m:new Number(m),m.alpha=!0),typeof m=="object"&&m instanceof Number&&(m.raw=f),a.push(m)}),{name:o[1].toLowerCase(),rawName:o[1],rawArgs:o[2],args:a}}}function tA(n){return n[n.length-1]}function U0(n,e,t){return isNaN(n)?e:isNaN(e)?n:n+(e-n)*t}function nA(n,e,t){return(t-n)/(e-n)}function V0(n,e,t){return U0(e[0],e[1],nA(n[0],n[1],t))}function rA(n){return n.map(e=>e.split("|").map(t=>{t=t.trim();let r=t.match(/^(<[a-z]+>)\[(-?[.\d]+),\s*(-?[.\d]+)\]?$/);if(r){let i=new String(r[1]);return i.range=[+r[2],+r[3]],i}return t}))}function iA(n,e,t){return Math.max(Math.min(t,e),n)}function Df(n,e){return Math.sign(n)===Math.sign(e)?n:-n}function Un(n,e){return Df(Math.abs(n)**e,n)}function K0(n,e){return e===0?0:n/e}function sA(n,e,t=0,r=n.length){for(;t<r;){const i=t+r>>1;n[i]<e?t=i+1:r=i}return t}class oA{add(e,t,r){if(typeof arguments[0]!="string"){for(var e in arguments[0])this.add(e,arguments[0][e],arguments[1]);return}(Array.isArray(e)?e:[e]).forEach(function(i){this[i]=this[i]||[],t&&this[i][r?"unshift":"push"](t)},this)}run(e,t){this[e]=this[e]||[],this[e].forEach(function(r){r.call(t&&t.context?t.context:t,t)})}}const sa=new oA,Vn={D50:[.3457/.3585,1,(1-.3457-.3585)/.3585],D65:[.3127/.329,1,(1-.3127-.329)/.329]};function zf(n){return Array.isArray(n)?n:Vn[n]}function oa(n,e,t,r={}){if(n=zf(n),e=zf(e),!n||!e)throw new TypeError(`Missing white point to convert ${n?"":"from"}${!n&&!e?"/":""}${e?"":"to"}`);if(n===e)return t;let i={W1:n,W2:e,XYZ:t,options:r};if(sa.run("chromatic-adaptation-start",i),i.M||(i.W1===Vn.D65&&i.W2===Vn.D50?i.M=[[1.0479297925449969,.022946870601609652,-.05019226628920524],[.02962780877005599,.9904344267538799,-.017073799063418826],[-.009243040646204504,.015055191490298152,.7518742814281371]]:i.W1===Vn.D50&&i.W2===Vn.D65&&(i.M=[[.955473421488075,-.02309845494876471,.06325924320057072],[-.0283697093338637,1.0099953980813041,.021041441191917323],[.012314014864481998,-.020507649298898964,1.330365926242124]])),sa.run("chromatic-adaptation-end",i),i.M)return Fe(i.M,i.XYZ);throw new TypeError("Only Bradford CAT with white points D50 and D65 supported for now.")}const Gs={gamut_mapping:"css",precision:5,deltaE:"76",verbose:(($0=(F0=(B0=globalThis?.process)==null?void 0:B0.env)==null?void 0:F0.NODE_ENV)==null?void 0:$0.toLowerCase())!=="test",warn:function(e){var t,r;this.verbose&&((r=(t=globalThis?.console)==null?void 0:t.warn)==null||r.call(t,e))}},lA=new Set(["<number>","<percentage>","<angle>"]);function G0(n,e,t,r){return Object.entries(n.coords).map(([o,a],u)=>{let f=e.coordGrammar[u],d=r[u],m=d?.type,p;if(d.none?p=f.find(w=>lA.has(w)):p=f.find(w=>w==m),!p){let w=a.name||o;throw new TypeError(`${m??d.raw} not allowed for ${w} in ${t}()`)}let y=p.range;m==="<percentage>"&&(y||(y=[0,1]));let S=a.range||a.refRange;return y&&S&&(r[u]=V0(y,S,r[u])),p})}function q0(n,{meta:e}={}){var t,r,i,o;let a={str:(t=String(n))==null?void 0:t.trim()};if(sa.run("parse-start",a),a.color)return a.color;if(a.parsed=eA(a.str),a.parsed){let u=a.parsed.name;if(u==="color"){let f=a.parsed.args.shift(),d=f.startsWith("--")?f.substring(2):`--${f}`,m=[f,d],p=a.parsed.rawArgs.indexOf("/")>0?a.parsed.args.pop():1;for(let w of oe.all){let M=w.getFormat("color");if(M&&(m.includes(M.id)||(r=M.ids)!=null&&r.filter(T=>m.includes(T)).length)){const T=Object.keys(w.coords).map((F,B)=>a.parsed.args[B]||0);let O;return M.coordGrammar&&(O=G0(w,M,"color",T)),e&&Object.assign(e,{formatId:"color",types:O}),M.id.startsWith("--")&&!f.startsWith("--")&&Gs.warn(`${w.name} is a non-standard space and not currently supported in the CSS spec. Use prefixed color(${M.id}) instead of color(${f}).`),f.startsWith("--")&&!M.id.startsWith("--")&&Gs.warn(`${w.name} is a standard space and supported in the CSS spec. Use color(${M.id}) instead of prefixed color(${f}).`),{spaceId:w.id,coords:T,alpha:p}}}let y="",S=f in oe.registry?f:d;if(S in oe.registry){let w=(o=(i=oe.registry[S].formats)==null?void 0:i.color)==null?void 0:o.id;w&&(y=`Did you mean color(${w})?`)}throw new TypeError(`Cannot parse color(${f}). `+(y||"Missing a plugin?"))}else for(let f of oe.all){let d=f.getFormat(u);if(d&&d.type==="function"){let m=1;(d.lastAlpha||tA(a.parsed.args).alpha)&&(m=a.parsed.args.pop());let p=a.parsed.args,y;return d.coordGrammar&&(y=G0(f,d,u,p)),e&&Object.assign(e,{formatId:d.name,types:y}),{spaceId:f.id,coords:p,alpha:m}}}}else for(let u of oe.all)for(let f in u.formats){let d=u.formats[f];if(d.type!=="custom"||d.test&&!d.test(a.str))continue;let m=d.parse(a.str);if(m)return m.alpha??(m.alpha=1),e&&(e.formatId=f),m}throw new TypeError(`Could not parse ${n} as a color. Missing a plugin?`)}function je(n){if(Array.isArray(n))return n.map(je);if(!n)throw new TypeError("Empty color reference");W0(n)&&(n=q0(n));let e=n.space||n.spaceId;return e instanceof oe||(n.space=oe.get(e)),n.alpha===void 0&&(n.alpha=1),n}const aA=75e-6,Bf=class fn{constructor(e){var t;this.id=e.id,this.name=e.name,this.base=e.base?fn.get(e.base):null,this.aliases=e.aliases,this.base&&(this.fromBase=e.fromBase,this.toBase=e.toBase);let r=e.coords??this.base.coords;for(let o in r)"name"in r[o]||(r[o].name=o);this.coords=r;let i=e.white??this.base.white??"D65";this.white=zf(i),this.formats=e.formats??{};for(let o in this.formats){let a=this.formats[o];a.type||(a.type="function"),a.name||(a.name=o)}(t=this.formats.color)!=null&&t.id||(this.formats.color={...this.formats.color??{},id:e.cssId||this.id}),e.gamutSpace?this.gamutSpace=e.gamutSpace==="self"?this:fn.get(e.gamutSpace):this.isPolar?this.gamutSpace=this.base:this.gamutSpace=this,this.gamutSpace.isUnbounded&&(this.inGamut=(o,a)=>!0),this.referred=e.referred,Object.defineProperty(this,"path",{value:uA(this).reverse(),writable:!1,enumerable:!0,configurable:!0}),sa.run("colorspace-init-end",this)}inGamut(e,{epsilon:t=aA}={}){if(!this.equals(this.gamutSpace))return e=this.to(this.gamutSpace,e),this.gamutSpace.inGamut(e,{epsilon:t});let r=Object.values(this.coords);return e.every((i,o)=>{let a=r[o];if(a.type!=="angle"&&a.range){if(Number.isNaN(i))return!0;let[u,f]=a.range;return(u===void 0||i>=u-t)&&(f===void 0||i<=f+t)}return!0})}get isUnbounded(){return Object.values(this.coords).every(e=>!("range"in e))}get cssId(){var e,t;return((t=(e=this.formats)==null?void 0:e.color)==null?void 0:t.id)||this.id}get isPolar(){for(let e in this.coords)if(this.coords[e].type==="angle")return!0;return!1}getFormat(e){if(typeof e=="object")return e=J0(e,this),e;let t;return e==="default"?t=Object.values(this.formats)[0]:t=this.formats[e],t?(t=J0(t,this),t):null}equals(e){return e?this===e||this.id===e||this.id===e.id:!1}to(e,t){if(arguments.length===1){const u=je(e);[e,t]=[u.space,u.coords]}if(e=fn.get(e),this.equals(e))return t;t=t.map(u=>Number.isNaN(u)?0:u);let r=this.path,i=e.path,o,a;for(let u=0;u<r.length&&r[u].equals(i[u]);u++)o=r[u],a=u;if(!o)throw new Error(`Cannot convert between color spaces ${this} and ${e}: no connection space was found`);for(let u=r.length-1;u>a;u--)t=r[u].toBase(t);for(let u=a+1;u<i.length;u++)t=i[u].fromBase(t);return t}from(e,t){if(arguments.length===1){const r=je(e);[e,t]=[r.space,r.coords]}return e=fn.get(e),e.to(this,t)}toString(){return`${this.name} (${this.id})`}getMinCoords(){let e=[];for(let t in this.coords){let r=this.coords[t],i=r.range||r.refRange;e.push(i?.min??0)}return e}static get all(){return[...new Set(Object.values(fn.registry))]}static register(e,t){if(arguments.length===1&&(t=arguments[0],e=t.id),t=this.get(t),this.registry[e]&&this.registry[e]!==t)throw new Error(`Duplicate color space registration: '${e}'`);if(this.registry[e]=t,arguments.length===1&&t.aliases)for(let r of t.aliases)this.register(r,t);return t}static get(e,...t){if(!e||e instanceof fn)return e;if(Ks(e)==="string"){let i=fn.registry[e.toLowerCase()];if(!i)throw new TypeError(`No color space found with id = "${e}"`);return i}if(t.length)return fn.get(...t);throw new TypeError(`${e} is not a valid color space`)}static resolveCoord(e,t){var r;let i=Ks(e),o,a;if(i==="string"?e.includes(".")?[o,a]=e.split("."):[o,a]=[,e]:Array.isArray(e)?[o,a]=e:(o=e.space,a=e.coordId),o=fn.get(o),o||(o=t),!o)throw new TypeError(`Cannot resolve coordinate reference ${e}: No color space specified and relative references are not allowed here`);if(i=Ks(a),i==="number"||i==="string"&&a>=0){let d=Object.entries(o.coords)[a];if(d)return{space:o,id:d[0],index:a,...d[1]}}o=fn.get(o);let u=a.toLowerCase(),f=0;for(let d in o.coords){let m=o.coords[d];if(d.toLowerCase()===u||((r=m.name)==null?void 0:r.toLowerCase())===u)return{space:o,id:d,index:f,...m};f++}throw new TypeError(`No "${a}" coordinate found in ${o.name}. Its coordinates are: ${Object.keys(o.coords).join(", ")}`)}};xr(Bf,"registry",{}),xr(Bf,"DEFAULT_FORMAT",{type:"functions",name:"color"});let oe=Bf;function uA(n){let e=[n];for(let t=n;t=t.base;)e.push(t);return e}function J0(n,{coords:e}={}){if(n.coords&&!n.coordGrammar){n.type||(n.type="function"),n.name||(n.name="color"),n.coordGrammar=rA(n.coords);let t=Object.entries(e).map(([r,i],o)=>{let a=n.coordGrammar[o][0],u=i.range||i.refRange,f=a.range,d="";return a=="<percentage>"?(f=[0,100],d="%"):a=="<angle>"&&(d="deg"),{fromRange:u,toRange:f,suffix:d}});n.serializeCoords=(r,i)=>r.map((o,a)=>{let{fromRange:u,toRange:f,suffix:d}=t[a];return u&&f&&(o=V0(u,f,o)),o=Lf(o,{precision:i,unit:d}),o})}return n}const Kn=new oe({id:"xyz-d65",name:"XYZ D65",coords:{x:{name:"X"},y:{name:"Y"},z:{name:"Z"}},white:"D65",formats:{color:{ids:["xyz-d65","xyz"]}},aliases:["xyz"]});class j0 extends oe{constructor(e){e.coords||(e.coords={r:{range:[0,1],name:"Red"},g:{range:[0,1],name:"Green"},b:{range:[0,1],name:"Blue"}}),e.base||(e.base=Kn),e.toXYZ_M&&e.fromXYZ_M&&(e.toBase??(e.toBase=t=>{let r=Fe(e.toXYZ_M,t);return this.white!==this.base.white&&(r=oa(this.white,this.base.white,r)),r}),e.fromBase??(e.fromBase=t=>(t=oa(this.base.white,this.white,t),Fe(e.fromXYZ_M,t)))),e.referred??(e.referred="display"),super(e)}}function Ff(n,e){return n=je(n),!e||n.space.equals(e)?n.coords.slice():(e=oe.get(e),e.from(n))}function Gn(n,e){n=je(n);let{space:t,index:r}=oe.resolveCoord(e,n.space);return Ff(n,t)[r]}function Y0(n,e,t){return n=je(n),e=oe.get(e),n.coords=e.to(n.space,t),n}Y0.returns="color";function $f(n,e,t){if(n=je(n),arguments.length===2&&Ks(arguments[1])==="object"){let r=arguments[1];for(let i in r)$f(n,i,r[i])}else{typeof t=="function"&&(t=t(Gn(n,e)));let{space:r,index:i}=oe.resolveCoord(e,n.space),o=Ff(n,r);o[i]=t,Y0(n,r,o)}return n}$f.returns="color";const cA=new oe({id:"xyz-d50",name:"XYZ D50",white:"D50",base:Kn,fromBase:n=>oa(Kn.white,"D50",n),toBase:n=>oa("D50",Kn.white,n)}),fA=216/24389,X0=24/116,la=24389/27;let Hf=Vn.D50;const qn=new oe({id:"lab",name:"Lab",coords:{l:{refRange:[0,100],name:"Lightness"},a:{refRange:[-125,125]},b:{refRange:[-125,125]}},white:Hf,base:cA,fromBase(n){let t=n.map((r,i)=>r/Hf[i]).map(r=>r>fA?Math.cbrt(r):(la*r+16)/116);return[116*t[1]-16,500*(t[0]-t[1]),200*(t[1]-t[2])]},toBase(n){let e=[];return e[1]=(n[0]+16)/116,e[0]=n[1]/500+e[1],e[2]=e[1]-n[2]/200,[e[0]>X0?Math.pow(e[0],3):(116*e[0]-16)/la,n[0]>8?Math.pow((n[0]+16)/116,3):n[0]/la,e[2]>X0?Math.pow(e[2],3):(116*e[2]-16)/la].map((r,i)=>r*Hf[i])},formats:{lab:{coords:["<number> | <percentage>","<number> | <percentage>[-1,1]","<number> | <percentage>[-1,1]"]}}});function Zr(n){return(n%360+360)%360}const aa=new oe({id:"lch",name:"LCH",coords:{l:{refRange:[0,100],name:"Lightness"},c:{refRange:[0,150],name:"Chroma"},h:{refRange:[0,360],type:"angle",name:"Hue"}},base:qn,fromBase(n){let[e,t,r]=n,i;const o=.02;return Math.abs(t)<o&&Math.abs(r)<o?i=NaN:i=Math.atan2(r,t)*180/Math.PI,[e,Math.sqrt(t**2+r**2),Zr(i)]},toBase(n){let[e,t,r]=n;return t<0&&(t=0),isNaN(r)&&(r=0),[e,t*Math.cos(r*Math.PI/180),t*Math.sin(r*Math.PI/180)]},formats:{lch:{coords:["<number> | <percentage>","<number> | <percentage>","<number> | <angle>"]}}}),Z0=25**7,ua=Math.PI,Q0=180/ua,Ui=ua/180;function e1(n){const e=n*n;return e*e*e*n}function t1(n,e,{kL:t=1,kC:r=1,kH:i=1}={}){[n,e]=je([n,e]);let[o,a,u]=qn.from(n),f=aa.from(qn,[o,a,u])[1],[d,m,p]=qn.from(e),y=aa.from(qn,[d,m,p])[1];f<0&&(f=0),y<0&&(y=0);let S=(f+y)/2,w=e1(S),M=.5*(1-Math.sqrt(w/(w+Z0))),T=(1+M)*a,O=(1+M)*m,F=Math.sqrt(T**2+u**2),B=Math.sqrt(O**2+p**2),H=T===0&&u===0?0:Math.atan2(u,T),X=O===0&&p===0?0:Math.atan2(p,O);H<0&&(H+=2*ua),X<0&&(X+=2*ua),H*=Q0,X*=Q0;let q=d-o,ie=B-F,Me=X-H,jt=H+X,ri=Math.abs(Me),Yt;F*B===0?Yt=0:ri<=180?Yt=Me:Me>180?Yt=Me-360:Me<-180?Yt=Me+360:Gs.warn("the unthinkable has happened");let pn=2*Math.sqrt(B*F)*Math.sin(Yt*Ui/2),jn=(o+d)/2,Xt=(F+B)/2,Tn=e1(Xt),He;F*B===0?He=jt:ri<=180?He=jt/2:jt<360?He=(jt+360)/2:He=(jt-360)/2;let We=(jn-50)**2,Ue=1+.015*We/Math.sqrt(20+We),Rt=1+.045*Xt,it=1;it-=.17*Math.cos((He-30)*Ui),it+=.24*Math.cos(2*He*Ui),it+=.32*Math.cos((3*He+6)*Ui),it-=.2*Math.cos((4*He-63)*Ui);let Ve=1+.015*Xt*it,Yn=30*Math.exp(-1*((He-275)/25)**2),Xn=2*Math.sqrt(Tn/(Tn+Z0)),Sa=-1*Math.sin(2*Yn*Ui)*Xn,Zt=(q/(t*Ue))**2;return Zt+=(ie/(r*Rt))**2,Zt+=(pn/(i*Ve))**2,Zt+=Sa*(ie/(r*Rt))*(pn/(i*Ve)),Math.sqrt(Zt)}const dA=[[.819022437996703,.3619062600528904,-.1288737815209879],[.0329836539323885,.9292868615863434,.0361446663506424],[.0481771893596242,.2642395317527308,.6335478284694309]],hA=[[1.2268798758459243,-.5578149944602171,.2813910456659647],[-.0405757452148008,1.112286803280317,-.0717110580655164],[-.0763729366746601,-.4214933324022432,1.5869240198367816]],pA=[[.210454268309314,.7936177747023054,-.0040720430116193],[1.9779985324311684,-2.42859224204858,.450593709617411],[.0259040424655478,.7827717124575296,-.8086757549230774]],mA=[[1,.3963377773761749,.2158037573099136],[1,-.1055613458156586,-.0638541728258133],[1,-.0894841775298119,-1.2914855480194092]],ca=new oe({id:"oklab",name:"Oklab",coords:{l:{refRange:[0,1],name:"Lightness"},a:{refRange:[-.4,.4]},b:{refRange:[-.4,.4]}},white:"D65",base:Kn,fromBase(n){let t=Fe(dA,n).map(r=>Math.cbrt(r));return Fe(pA,t)},toBase(n){let t=Fe(mA,n).map(r=>r**3);return Fe(hA,t)},formats:{oklab:{coords:["<percentage> | <number>","<number> | <percentage>[-1,1]","<number> | <percentage>[-1,1]"]}}});function Wf(n,e){[n,e]=je([n,e]);let[t,r,i]=ca.from(n),[o,a,u]=ca.from(e),f=t-o,d=r-a,m=i-u;return Math.sqrt(f**2+d**2+m**2)}const gA=75e-6;function Vi(n,e,{epsilon:t=gA}={}){n=je(n),e||(e=n.space),e=oe.get(e);let r=n.coords;return e!==n.space&&(r=e.from(n)),e.inGamut(r,{epsilon:t})}function Uf(n){return{space:n.space,coords:n.coords.slice(),alpha:n.alpha}}function yA(n,e,t="lab"){t=oe.get(t);let r=t.from(n),i=t.from(e);return Math.sqrt(r.reduce((o,a,u)=>{let f=i[u];return isNaN(a)||isNaN(f)?o:o+(f-a)**2},0))}function bA(n,e){return yA(n,e,"lab")}const vA=Math.PI,n1=vA/180;function SA(n,e,{l:t=2,c:r=1}={}){[n,e]=je([n,e]);let[i,o,a]=qn.from(n),[,u,f]=aa.from(qn,[i,o,a]),[d,m,p]=qn.from(e),y=aa.from(qn,[d,m,p])[1];u<0&&(u=0),y<0&&(y=0);let S=i-d,w=u-y,M=o-m,T=a-p,O=M**2+T**2-w**2,F=.511;i>=16&&(F=.040975*i/(1+.01765*i));let B=.0638*u/(1+.0131*u)+.638,H;Number.isNaN(f)&&(f=0),f>=164&&f<=345?H=.56+Math.abs(.2*Math.cos((f+168)*n1)):H=.36+Math.abs(.4*Math.cos((f+35)*n1));let X=Math.pow(u,4),q=Math.sqrt(X/(X+1900)),ie=B*(q*H+1-q),Me=(S/(t*F))**2;return Me+=(w/(r*B))**2,Me+=O/ie**2,Math.sqrt(Me)}const r1=203,i1=new oe({id:"xyz-abs-d65",cssId:"--xyz-abs-d65",name:"Absolute XYZ D65",coords:{x:{refRange:[0,9504.7],name:"Xa"},y:{refRange:[0,1e4],name:"Ya"},z:{refRange:[0,10888.3],name:"Za"}},base:Kn,fromBase(n){return n.map(e=>Math.max(e*r1,0))},toBase(n){return n.map(e=>Math.max(e/r1,0))}}),fa=1.15,da=.66,s1=2610/2**14,wA=2**14/2610,o1=3424/2**12,l1=2413/2**7,a1=2392/2**7,xA=1.7*2523/2**5,u1=2**5/(1.7*2523),ha=-.56,Vf=16295499532821565e-27,_A=[[.41478972,.579999,.014648],[-.20151,1.120649,.0531008],[-.0166008,.2648,.6684799]],kA=[[1.9242264357876067,-1.0047923125953657,.037651404030618],[.35031676209499907,.7264811939316552,-.06538442294808501],[-.09098281098284752,-.3127282905230739,1.5227665613052603]],EA=[[.5,.5,0],[3.524,-4.066708,.542708],[.199076,1.096799,-1.295875]],MA=[[1,.1386050432715393,.05804731615611886],[.9999999999999999,-.1386050432715393,-.05804731615611886],[.9999999999999998,-.09601924202631895,-.8118918960560388]],TA=new oe({id:"jzazbz",name:"Jzazbz",coords:{jz:{refRange:[0,1],name:"Jz"},az:{refRange:[-.5,.5]},bz:{refRange:[-.5,.5]}},base:i1,fromBase(n){let[e,t,r]=n,i=fa*e-(fa-1)*r,o=da*t-(da-1)*e,u=Fe(_A,[i,o,r]).map(function(y){let S=o1+l1*(y/1e4)**s1,w=1+a1*(y/1e4)**s1;return(S/w)**xA}),[f,d,m]=Fe(EA,u);return[(1+ha)*f/(1+ha*f)-Vf,d,m]},toBase(n){let[e,t,r]=n,i=(e+Vf)/(1+ha-ha*(e+Vf)),a=Fe(MA,[i,t,r]).map(function(y){let S=o1-y**u1,w=a1*y**u1-l1;return 1e4*(S/w)**wA}),[u,f,d]=Fe(kA,a),m=(u+(fa-1)*d)/fa,p=(f+(da-1)*m)/da;return[m,p,d]},formats:{color:{coords:["<number> | <percentage>","<number> | <percentage>[-1,1]","<number> | <percentage>[-1,1]"]}}}),c1=new oe({id:"jzczhz",name:"JzCzHz",coords:{jz:{refRange:[0,1],name:"Jz"},cz:{refRange:[0,1],name:"Chroma"},hz:{refRange:[0,360],type:"angle",name:"Hue"}},base:TA,fromBase(n){let[e,t,r]=n,i;const o=2e-4;return Math.abs(t)<o&&Math.abs(r)<o?i=NaN:i=Math.atan2(r,t)*180/Math.PI,[e,Math.sqrt(t**2+r**2),Zr(i)]},toBase(n){return[n[0],n[1]*Math.cos(n[2]*Math.PI/180),n[1]*Math.sin(n[2]*Math.PI/180)]}});function CA(n,e){[n,e]=je([n,e]);let[t,r,i]=c1.from(n),[o,a,u]=c1.from(e),f=t-o,d=r-a;Number.isNaN(i)&&Number.isNaN(u)?(i=0,u=0):Number.isNaN(i)?i=u:Number.isNaN(u)&&(u=i);let m=i-u,p=2*Math.sqrt(r*a)*Math.sin(m/2*(Math.PI/180));return Math.sqrt(f**2+d**2+p**2)}const f1=3424/4096,d1=2413/128,h1=2392/128,p1=2610/16384,AA=2523/32,OA=16384/2610,m1=32/2523,IA=[[.3592832590121217,.6976051147779502,-.035891593232029],[-.1920808463704993,1.100476797037432,.0753748658519118],[.0070797844607479,.0748396662186362,.8433265453898765]],NA=[[2048/4096,2048/4096,0],[6610/4096,-13613/4096,7003/4096],[17933/4096,-17390/4096,-543/4096]],RA=[[.9999999999999998,.0086090370379328,.111029625003026],[.9999999999999998,-.0086090370379328,-.1110296250030259],[.9999999999999998,.5600313357106791,-.3206271749873188]],LA=[[2.0701522183894223,-1.3263473389671563,.2066510476294053],[.3647385209748072,.6805660249472273,-.0453045459220347],[-.0497472075358123,-.0492609666966131,1.1880659249923042]],g1=new oe({id:"ictcp",name:"ICTCP",coords:{i:{refRange:[0,1],name:"I"},ct:{refRange:[-.5,.5],name:"CT"},cp:{refRange:[-.5,.5],name:"CP"}},base:i1,fromBase(n){let e=Fe(IA,n);return PA(e)},toBase(n){let e=DA(n);return Fe(LA,e)}});function PA(n){let e=n.map(function(t){let r=f1+d1*(t/1e4)**p1,i=1+h1*(t/1e4)**p1;return(r/i)**AA});return Fe(NA,e)}function DA(n){return Fe(RA,n).map(function(r){let i=Math.max(r**m1-f1,0),o=d1-h1*r**m1;return 1e4*(i/o)**OA})}function zA(n,e){[n,e]=je([n,e]);let[t,r,i]=g1.from(n),[o,a,u]=g1.from(e);return 720*Math.sqrt((t-o)**2+.25*(r-a)**2+(i-u)**2)}const BA=Vn.D65,y1=.42,b1=1/y1,Kf=2*Math.PI,v1=[[.401288,.650173,-.051461],[-.250268,1.204414,.045854],[-.002079,.048952,.953127]],FA=[[1.8620678550872327,-1.0112546305316843,.14918677544445175],[.38752654323613717,.6214474419314753,-.008973985167612518],[-.015841498849333856,-.03412293802851557,1.0499644368778496]],$A=[[460,451,288],[460,-891,-261],[460,-220,-6300]],HA={dark:[.8,.525,.8],dim:[.9,.59,.9],average:[1,.69,1]},Qr={h:[20.14,90,164.25,237.53,380.14],e:[.8,.7,1,1.2,.8],H:[0,100,200,300,400]},WA=180/Math.PI,S1=Math.PI/180;function w1(n,e){return n.map(r=>{const i=Un(e*Math.abs(r)*.01,y1);return 400*Df(i,r)/(i+27.13)})}function UA(n,e){const t=100/e*27.13**b1;return n.map(r=>{const i=Math.abs(r);return Df(t*Un(i/(400-i),b1),r)})}function VA(n){let e=Zr(n);e<=Qr.h[0]&&(e+=360);const t=sA(Qr.h,e)-1,[r,i]=Qr.h.slice(t,t+2),[o,a]=Qr.e.slice(t,t+2),u=Qr.H[t],f=(e-r)/o;return u+100*f/(f+(i-e)/a)}function KA(n){let e=(n%400+400)%400;const t=Math.floor(.01*e);e=e%100;const[r,i]=Qr.h.slice(t,t+2),[o,a]=Qr.e.slice(t,t+2);return Zr((e*(a*r-o*i)-100*r*a)/(e*(a-o)-100*a))}function x1(n,e,t,r,i){const o={};o.discounting=i,o.refWhite=n,o.surround=r;const a=n.map(M=>M*100);o.la=e,o.yb=t;const u=a[1],f=Fe(v1,a);r=HA[o.surround];const d=r[0];o.c=r[1],o.nc=r[2];const p=(1/(5*o.la+1))**4;o.fl=p*o.la+.1*(1-p)*(1-p)*Math.cbrt(5*o.la),o.flRoot=o.fl**.25,o.n=o.yb/u,o.z=1.48+Math.sqrt(o.n),o.nbb=.725*o.n**-.2,o.ncb=o.nbb;const y=Math.max(Math.min(d*(1-1/3.6*Math.exp((-o.la-42)/92)),1),0);o.dRgb=f.map(M=>U0(1,u/M,y)),o.dRgbInv=o.dRgb.map(M=>1/M);const S=f.map((M,T)=>M*o.dRgb[T]),w=w1(S,o.fl);return o.aW=o.nbb*(2*w[0]+w[1]+.05*w[2]),o}const _1=x1(BA,64/Math.PI*.2,20,"average",!1);function Gf(n,e){if(!(n.J!==void 0^n.Q!==void 0))throw new Error("Conversion requires one and only one: 'J' or 'Q'");if(!(n.C!==void 0^n.M!==void 0^n.s!==void 0))throw new Error("Conversion requires one and only one: 'C', 'M' or 's'");if(!(n.h!==void 0^n.H!==void 0))throw new Error("Conversion requires one and only one: 'h' or 'H'");if(n.J===0||n.Q===0)return[0,0,0];let t=0;n.h!==void 0?t=Zr(n.h)*S1:t=KA(n.H)*S1;const r=Math.cos(t),i=Math.sin(t);let o=0;n.J!==void 0?o=Un(n.J,1/2)*.1:n.Q!==void 0&&(o=.25*e.c*n.Q/((e.aW+4)*e.flRoot));let a=0;n.C!==void 0?a=n.C/o:n.M!==void 0?a=n.M/e.flRoot/o:n.s!==void 0&&(a=4e-4*n.s**2*(e.aW+4)/e.c);const u=Un(a*Math.pow(1.64-Math.pow(.29,e.n),-.73),10/9),f=.25*(Math.cos(t+2)+3.8),d=e.aW*Un(o,2/e.c/e.z),m=5e4/13*e.nc*e.ncb*f,p=d/e.nbb,y=23*(p+.305)*K0(u,23*m+u*(11*r+108*i)),S=y*r,w=y*i,M=UA(Fe($A,[p,S,w]).map(T=>T*1/1403),e.fl);return Fe(FA,M.map((T,O)=>T*e.dRgbInv[O])).map(T=>T/100)}function k1(n,e){const t=n.map(B=>B*100),r=w1(Fe(v1,t).map((B,H)=>B*e.dRgb[H]),e.fl),i=r[0]+(-12*r[1]+r[2])/11,o=(r[0]+r[1]-2*r[2])/9,a=(Math.atan2(o,i)%Kf+Kf)%Kf,u=.25*(Math.cos(a+2)+3.8),f=5e4/13*e.nc*e.ncb*K0(u*Math.sqrt(i**2+o**2),r[0]+r[1]+1.05*r[2]+.305),d=Un(f,.9)*Math.pow(1.64-Math.pow(.29,e.n),.73),m=e.nbb*(2*r[0]+r[1]+.05*r[2]),p=Un(m/e.aW,.5*e.c*e.z),y=100*Un(p,2),S=4/e.c*p*(e.aW+4)*e.flRoot,w=d*p,M=w*e.flRoot,T=Zr(a*WA),O=VA(T),F=50*Un(e.c*d/(e.aW+4),1/2);return{J:y,C:w,h:T,s:F,Q:S,M,H:O}}new oe({id:"cam16-jmh",cssId:"--cam16-jmh",name:"CAM16-JMh",coords:{j:{refRange:[0,100],name:"J"},m:{refRange:[0,105],name:"Colorfulness"},h:{refRange:[0,360],type:"angle",name:"Hue"}},base:Kn,fromBase(n){const e=k1(n,_1);return[e.J,e.M,e.h]},toBase(n){return Gf({J:n[0],M:n[1],h:n[2]},_1)}});const GA=Vn.D65,qA=216/24389,E1=24389/27;function JA(n){return 116*(n>qA?Math.cbrt(n):(E1*n+16)/116)-16}function qf(n){return n>8?Math.pow((n+16)/116,3):n/E1}function jA(n,e){let[t,r,i]=n,o=[],a=0;if(i===0)return[0,0,0];let u=qf(i);i>0?a=.00379058511492914*i**2+.608983189401032*i+.9155088574762233:a=9514440756550361e-21*i**2+.08693057439788597*i-21.928975842194614;const f=2e-12,d=15;let m=0,p=1/0;for(;m<=d;){o=Gf({J:a,C:r,h:t},e);const y=Math.abs(o[1]-u);if(y<p){if(y<=f)return o;p=y}a=a-(o[1]-u)*a/(2*o[1]),m+=1}return Gf({J:a,C:r,h:t},e)}function YA(n,e){const t=JA(n[1]);if(t===0)return[0,0,0];const r=k1(n,Jf);return[Zr(r.h),r.C,t]}const Jf=x1(GA,200/Math.PI*qf(50),qf(50)*100,"average",!1),pa=new oe({id:"hct",name:"HCT",coords:{h:{refRange:[0,360],type:"angle",name:"Hue"},c:{refRange:[0,145],name:"Colorfulness"},t:{refRange:[0,100],name:"Tone"}},base:Kn,fromBase(n){return YA(n)},toBase(n){return jA(n,Jf)},formats:{color:{id:"--hct",coords:["<number> | <angle>","<percentage> | <number>","<percentage> | <number>"]}}}),XA=Math.PI/180,M1=[1,.007,.0228];function T1(n){n[1]<0&&(n=pa.fromBase(pa.toBase(n)));const e=Math.log(Math.max(1+M1[2]*n[1]*Jf.flRoot,1))/M1[2],t=n[0]*XA,r=e*Math.cos(t),i=e*Math.sin(t);return[n[2],r,i]}function ZA(n,e){[n,e]=je([n,e]);let[t,r,i]=T1(pa.from(n)),[o,a,u]=T1(pa.from(e));return Math.sqrt((t-o)**2+(r-a)**2+(i-u)**2)}const C1={deltaE76:bA,deltaECMC:SA,deltaE2000:t1,deltaEJz:CA,deltaEITP:zA,deltaEOK:Wf,deltaEHCT:ZA};function QA(n){const e=n?Math.floor(Math.log10(Math.abs(n))):0;return Math.max(parseFloat(`1e${e-2}`),1e-6)}const A1={hct:{method:"hct.c",jnd:2,deltaEMethod:"hct",blackWhiteClamp:{}},"hct-tonal":{method:"hct.c",jnd:0,deltaEMethod:"hct",blackWhiteClamp:{channel:"hct.t",min:0,max:100}}};function qs(n,{method:e=Gs.gamut_mapping,space:t=void 0,deltaEMethod:r="",jnd:i=2,blackWhiteClamp:o={}}={}){if(n=je(n),W0(arguments[1])?t=arguments[1]:t||(t=n.space),t=oe.get(t),Vi(n,t,{epsilon:0}))return n;let a;if(e==="css")a=eO(n,{space:t});else{if(e!=="clip"&&!Vi(n,t)){Object.prototype.hasOwnProperty.call(A1,e)&&({method:e,jnd:i,deltaEMethod:r,blackWhiteClamp:o}=A1[e]);let u=t1;if(r!==""){for(let d in C1)if("deltae"+r.toLowerCase()===d.toLowerCase()){u=C1[d];break}}let f=qs($e(n,t),{method:"clip",space:t});if(u(n,f)>i){if(Object.keys(o).length===3){let F=oe.resolveCoord(o.channel),B=Gn($e(n,F.space),F.id);if(Pf(B)&&(B=0),B>=o.max)return $e({space:"xyz-d65",coords:Vn.D65},n.space);if(B<=o.min)return $e({space:"xyz-d65",coords:[0,0,0]},n.space)}let d=oe.resolveCoord(e),m=d.space,p=d.id,y=$e(n,m);y.coords.forEach((F,B)=>{Pf(F)&&(y.coords[B]=0)});let w=(d.range||d.refRange)[0],M=QA(i),T=w,O=Gn(y,p);for(;O-T>M;){let F=Uf(y);F=qs(F,{space:t,method:"clip"}),u(y,F)-i<M?T=Gn(y,p):O=Gn(y,p),$f(y,p,(T+O)/2)}a=$e(y,t)}else a=f}else a=$e(n,t);if(e==="clip"||!Vi(a,t,{epsilon:0})){let u=Object.values(t.coords).map(f=>f.range||[]);a.coords=a.coords.map((f,d)=>{let[m,p]=u[d];return m!==void 0&&(f=Math.max(m,f)),p!==void 0&&(f=Math.min(f,p)),f})}}return t!==n.space&&(a=$e(a,n.space)),n.coords=a.coords,n}qs.returns="color";const O1={WHITE:{space:ca,coords:[1,0,0]},BLACK:{space:ca,coords:[0,0,0]}};function eO(n,{space:e}={}){n=je(n),e||(e=n.space),e=oe.get(e);const i=oe.get("oklch");if(e.isUnbounded)return $e(n,e);const o=$e(n,i);let a=o.coords[0];if(a>=1){const w=$e(O1.WHITE,e);return w.alpha=n.alpha,$e(w,e)}if(a<=0){const w=$e(O1.BLACK,e);return w.alpha=n.alpha,$e(w,e)}if(Vi(o,e,{epsilon:0}))return $e(o,e);function u(w){const M=$e(w,e),T=Object.values(e.coords);return M.coords=M.coords.map((O,F)=>{if("range"in T[F]){const[B,H]=T[F].range;return iA(B,O,H)}return O}),M}let f=0,d=o.coords[1],m=!0,p=Uf(o),y=u(p),S=Wf(y,p);if(S<.02)return y;for(;d-f>1e-4;){const w=(f+d)/2;if(p.coords[1]=w,m&&Vi(p,e,{epsilon:0}))f=w;else if(y=u(p),S=Wf(y,p),S<.02){if(.02-S<1e-4)break;m=!1,f=w}else d=w}return y}function $e(n,e,{inGamut:t}={}){n=je(n),e=oe.get(e);let r=e.from(n),i={space:e,coords:r,alpha:n.alpha};return t&&(i=qs(i,t===!0?void 0:t)),i}$e.returns="color";function tO(n,{precision:e=Gs.precision,format:t="default",inGamut:r=!0,...i}={}){var o;let a;n=je(n);let u=t;t=n.space.getFormat(t)??n.space.getFormat("default")??oe.DEFAULT_FORMAT;let f=n.coords.slice();if(r||(r=t.toGamut),r&&!Vi(n)&&(f=qs(Uf(n),r===!0?void 0:r).coords),t.type==="custom")if(i.precision=e,t.serialize)a=t.serialize(f,n.alpha,i);else throw new TypeError(`format ${u} can only be used to parse colors, not for serialization`);else{let d=t.name||"color";t.serializeCoords?f=t.serializeCoords(f,e):e!==null&&(f=f.map(S=>Lf(S,{precision:e})));let m=[...f];if(d==="color"){let S=t.id||((o=t.ids)==null?void 0:o[0])||n.space.id;m.unshift(S)}let p=n.alpha;e!==null&&(p=Lf(p,{precision:e}));let y=n.alpha>=1||t.noAlpha?"":`${t.commas?",":" /"} ${p}`;a=`${d}(${m.join(t.commas?", ":" ")}${y})`}return a}const nO=[[.41239079926595934,.357584339383878,.1804807884018343],[.21263900587151027,.715168678767756,.07219231536073371],[.01933081871559182,.11919477979462598,.9505321522496607]],rO=[[3.2409699419045226,-1.537383177570094,-.4986107602930034],[-.9692436362808796,1.8759675015077202,.04155505740717559],[.05563007969699366,-.20397695888897652,1.0569715142428786]],iO=new j0({id:"srgb-linear",name:"Linear sRGB",white:"D65",toXYZ_M:nO,fromXYZ_M:rO}),I1={aliceblue:[240/255,248/255,1],antiquewhite:[250/255,235/255,215/255],aqua:[0,1,1],aquamarine:[127/255,1,212/255],azure:[240/255,1,1],beige:[245/255,245/255,220/255],bisque:[1,228/255,196/255],black:[0,0,0],blanchedalmond:[1,235/255,205/255],blue:[0,0,1],blueviolet:[138/255,43/255,226/255],brown:[165/255,42/255,42/255],burlywood:[222/255,184/255,135/255],cadetblue:[95/255,158/255,160/255],chartreuse:[127/255,1,0],chocolate:[210/255,105/255,30/255],coral:[1,127/255,80/255],cornflowerblue:[100/255,149/255,237/255],cornsilk:[1,248/255,220/255],crimson:[220/255,20/255,60/255],cyan:[0,1,1],darkblue:[0,0,139/255],darkcyan:[0,139/255,139/255],darkgoldenrod:[184/255,134/255,11/255],darkgray:[169/255,169/255,169/255],darkgreen:[0,100/255,0],darkgrey:[169/255,169/255,169/255],darkkhaki:[189/255,183/255,107/255],darkmagenta:[139/255,0,139/255],darkolivegreen:[85/255,107/255,47/255],darkorange:[1,140/255,0],darkorchid:[153/255,50/255,204/255],darkred:[139/255,0,0],darksalmon:[233/255,150/255,122/255],darkseagreen:[143/255,188/255,143/255],darkslateblue:[72/255,61/255,139/255],darkslategray:[47/255,79/255,79/255],darkslategrey:[47/255,79/255,79/255],darkturquoise:[0,206/255,209/255],darkviolet:[148/255,0,211/255],deeppink:[1,20/255,147/255],deepskyblue:[0,191/255,1],dimgray:[105/255,105/255,105/255],dimgrey:[105/255,105/255,105/255],dodgerblue:[30/255,144/255,1],firebrick:[178/255,34/255,34/255],floralwhite:[1,250/255,240/255],forestgreen:[34/255,139/255,34/255],fuchsia:[1,0,1],gainsboro:[220/255,220/255,220/255],ghostwhite:[248/255,248/255,1],gold:[1,215/255,0],goldenrod:[218/255,165/255,32/255],gray:[128/255,128/255,128/255],green:[0,128/255,0],greenyellow:[173/255,1,47/255],grey:[128/255,128/255,128/255],honeydew:[240/255,1,240/255],hotpink:[1,105/255,180/255],indianred:[205/255,92/255,92/255],indigo:[75/255,0,130/255],ivory:[1,1,240/255],khaki:[240/255,230/255,140/255],lavender:[230/255,230/255,250/255],lavenderblush:[1,240/255,245/255],lawngreen:[124/255,252/255,0],lemonchiffon:[1,250/255,205/255],lightblue:[173/255,216/255,230/255],lightcoral:[240/255,128/255,128/255],lightcyan:[224/255,1,1],lightgoldenrodyellow:[250/255,250/255,210/255],lightgray:[211/255,211/255,211/255],lightgreen:[144/255,238/255,144/255],lightgrey:[211/255,211/255,211/255],lightpink:[1,182/255,193/255],lightsalmon:[1,160/255,122/255],lightseagreen:[32/255,178/255,170/255],lightskyblue:[135/255,206/255,250/255],lightslategray:[119/255,136/255,153/255],lightslategrey:[119/255,136/255,153/255],lightsteelblue:[176/255,196/255,222/255],lightyellow:[1,1,224/255],lime:[0,1,0],limegreen:[50/255,205/255,50/255],linen:[250/255,240/255,230/255],magenta:[1,0,1],maroon:[128/255,0,0],mediumaquamarine:[102/255,205/255,170/255],mediumblue:[0,0,205/255],mediumorchid:[186/255,85/255,211/255],mediumpurple:[147/255,112/255,219/255],mediumseagreen:[60/255,179/255,113/255],mediumslateblue:[123/255,104/255,238/255],mediumspringgreen:[0,250/255,154/255],mediumturquoise:[72/255,209/255,204/255],mediumvioletred:[199/255,21/255,133/255],midnightblue:[25/255,25/255,112/255],mintcream:[245/255,1,250/255],mistyrose:[1,228/255,225/255],moccasin:[1,228/255,181/255],navajowhite:[1,222/255,173/255],navy:[0,0,128/255],oldlace:[253/255,245/255,230/255],olive:[128/255,128/255,0],olivedrab:[107/255,142/255,35/255],orange:[1,165/255,0],orangered:[1,69/255,0],orchid:[218/255,112/255,214/255],palegoldenrod:[238/255,232/255,170/255],palegreen:[152/255,251/255,152/255],paleturquoise:[175/255,238/255,238/255],palevioletred:[219/255,112/255,147/255],papayawhip:[1,239/255,213/255],peachpuff:[1,218/255,185/255],peru:[205/255,133/255,63/255],pink:[1,192/255,203/255],plum:[221/255,160/255,221/255],powderblue:[176/255,224/255,230/255],purple:[128/255,0,128/255],rebeccapurple:[102/255,51/255,153/255],red:[1,0,0],rosybrown:[188/255,143/255,143/255],royalblue:[65/255,105/255,225/255],saddlebrown:[139/255,69/255,19/255],salmon:[250/255,128/255,114/255],sandybrown:[244/255,164/255,96/255],seagreen:[46/255,139/255,87/255],seashell:[1,245/255,238/255],sienna:[160/255,82/255,45/255],silver:[192/255,192/255,192/255],skyblue:[135/255,206/255,235/255],slateblue:[106/255,90/255,205/255],slategray:[112/255,128/255,144/255],slategrey:[112/255,128/255,144/255],snow:[1,250/255,250/255],springgreen:[0,1,127/255],steelblue:[70/255,130/255,180/255],tan:[210/255,180/255,140/255],teal:[0,128/255,128/255],thistle:[216/255,191/255,216/255],tomato:[1,99/255,71/255],turquoise:[64/255,224/255,208/255],violet:[238/255,130/255,238/255],wheat:[245/255,222/255,179/255],white:[1,1,1],whitesmoke:[245/255,245/255,245/255],yellow:[1,1,0],yellowgreen:[154/255,205/255,50/255]};let N1=Array(3).fill("<percentage> | <number>[0, 255]"),R1=Array(3).fill("<number>[0, 255]");const L1=new j0({id:"srgb",name:"sRGB",base:iO,fromBase:n=>n.map(e=>{let t=e<0?-1:1,r=e*t;return r>.0031308?t*(1.055*r**(1/2.4)-.055):12.92*e}),toBase:n=>n.map(e=>{let t=e<0?-1:1,r=e*t;return r<=.04045?e/12.92:t*((r+.055)/1.055)**2.4}),formats:{rgb:{coords:N1},rgb_number:{name:"rgb",commas:!0,coords:R1,noAlpha:!0},color:{},rgba:{coords:N1,commas:!0,lastAlpha:!0},rgba_number:{name:"rgba",commas:!0,coords:R1},hex:{type:"custom",toGamut:!0,test:n=>/^#([a-f0-9]{3,4}){1,2}$/i.test(n),parse(n){n.length<=5&&(n=n.replace(/[a-f0-9]/gi,"$&$&"));let e=[];return n.replace(/[a-f0-9]{2}/gi,t=>{e.push(parseInt(t,16)/255)}),{spaceId:"srgb",coords:e.slice(0,3),alpha:e.slice(3)[0]}},serialize:(n,e,{collapse:t=!0}={})=>{e<1&&n.push(e),n=n.map(o=>Math.round(o*255));let r=t&&n.every(o=>o%17===0);return"#"+n.map(o=>r?(o/17).toString(16):o.toString(16).padStart(2,"0")).join("")}},keyword:{type:"custom",test:n=>/^[a-z]+$/i.test(n),parse(n){n=n.toLowerCase();let e={spaceId:"srgb",coords:null,alpha:1};if(n==="transparent"?(e.coords=I1.black,e.alpha=0):e.coords=I1[n],e.coords)return e}}}});function sO(n){return Gn(n,[Kn,"y"])}const P1=new oe({id:"hsl",name:"HSL",coords:{h:{refRange:[0,360],type:"angle",name:"Hue"},s:{range:[0,100],name:"Saturation"},l:{range:[0,100],name:"Lightness"}},base:L1,fromBase:n=>{let e=Math.max(...n),t=Math.min(...n),[r,i,o]=n,[a,u,f]=[NaN,0,(t+e)/2],d=e-t;if(d!==0){switch(u=f===0||f===1?0:(e-f)/Math.min(f,1-f),e){case r:a=(i-o)/d+(i<o?6:0);break;case i:a=(o-r)/d+2;break;case o:a=(r-i)/d+4}a=a*60}return u<0&&(a+=180,u=Math.abs(u)),a>=360&&(a-=360),[a,u*100,f*100]},toBase:n=>{let[e,t,r]=n;e=e%360,e<0&&(e+=360),t/=100,r/=100;function i(o){let a=(o+e/30)%12,u=t*Math.min(r,1-r);return r-u*Math.max(-1,Math.min(a-3,9-a,1))}return[i(0),i(8),i(4)]},formats:{hsl:{coords:["<number> | <angle>","<percentage>","<percentage>"]},hsla:{coords:["<number> | <angle>","<percentage>","<percentage>"],commas:!0,lastAlpha:!0}}}),oO=new oe({id:"hsv",name:"HSV",coords:{h:{refRange:[0,360],type:"angle",name:"Hue"},s:{range:[0,100],name:"Saturation"},v:{range:[0,100],name:"Value"}},base:P1,fromBase(n){let[e,t,r]=n;t/=100,r/=100;let i=r+t*Math.min(r,1-r);return[e,i===0?0:200*(1-r/i),100*i]},toBase(n){let[e,t,r]=n;t/=100,r/=100;let i=r*(1-t/2);return[e,i===0||i===1?0:(r-i)/Math.min(i,1-i)*100,i*100]},formats:{color:{id:"--hsv",coords:["<number> | <angle>","<percentage> | <number>","<percentage> | <number>"]}}});class Nt{constructor(e){xr(this,"data"),xr(this,"isEmpty",!1),this.data=$e(e,"srgb")}static fromEmpty(){return Nt.fromWhite().setEmpty(!0)}static fromBlack(){return new Nt({spaceId:"srgb",coords:[0,0,0],alpha:1})}static fromWhite(){return new Nt({spaceId:"srgb",coords:[1,1,1],alpha:1})}get r(){return Math.round(this.data.coords[0]*255)}get g(){return Math.round(this.data.coords[1]*255)}get b(){return Math.round(this.data.coords[2]*255)}get h(){return Gn(this.data,"hsv.h")}get s(){return Gn(this.data,"hsv.s")}get v(){return Gn(this.data,"hsv.v")}get alpha(){return this.data.alpha.valueOf()}get alphaPercent(){return Math.round(this.alpha*100)}get isTransparent(){return this.alpha===0}get isDark(){return sO(this.data)<.5}setEmpty(e){return this.isEmpty=e,this}withAlpha(e){return new Nt({...this.data,alpha:e})}withRgb(e){return new Nt({spaceId:"srgb",coords:[e.r?e.r/255:this.data.coords[0],e.g?e.g/255:this.data.coords[1],e.b?e.b/255:this.data.coords[2]],alpha:e.a??this.alpha})}withHsv(e){const t=Ff(this.data,"hsv");return new Nt({spaceId:"hsv",coords:[e.h??t[0],e.s??t[1],e.v??t[2]],alpha:this.alpha})}toString(){return this.isEmpty?"":this.alpha===1?this.toHexString():this.toRgbaString()}toHexString(){const e=tO(this.data,{format:"hex"}).toUpperCase();return e.length===4?`#${e[1]}${e[1]}${e[2]}${e[2]}${e[3]}${e[3]}`:e.slice(0,7)}toRgbaString(){return`rgba(${this.r}, ${this.g}, ${this.b}, ${this.alphaPercent}%)`}clone(){return new Nt(this.data).setEmpty(this.isEmpty)}}class lO{constructor(e){xr(this,"_color"),this.setColor(e.solidColor)}get color(){return this._color}setColor(e){this._color=e}toString(){return this.color.toString()}isEqual(e){return this.toString()===e}update({solidColor:e}){this.setColor(e)}}class nd{constructor(e,t=0){xr(this,"id"),this.color=e,this.offset=t,this.id=XC()}get isEmpty(){return this.color.isEmpty}setOffset(e){this.offset=e}toString(){return`${this.color.toString()} ${this.offset}%`}clone(e){return new nd(this.color.clone(),e)}}class aO{constructor(e){xr(this,"_angle",0),xr(this,"transitions",[]),this.update(e)}get canAddTransition(){return this.transitions.length<5}get canRemoveTransition(){return this.transitions.length>2}get angle(){return this._angle}setAngle(e){this._angle=e}addTransition(e){this.transitions.push(e),this.sortTransitions()}removeTransition(e){this.transitions=this.transitions.filter(({id:t})=>t!==e.id)}sortTransitions(){this.transitions=this.transitions.sort((e,t)=>e.offset-t.offset)}toString(e){if(this.transitions.some(i=>i.isEmpty))return"";const r=this.transitions.map(i=>i.toString());return`linear-gradient(${e??this.angle}deg, ${r.join(", ")})`}isEqual(e){return this.toString()===e}update(e){this._angle=e.angle,this.transitions=e.transitions.map(({color:t,offset:r})=>new nd(t,r))}}function uO(n){return n?n.startsWith("linear-gradient("):!1}function cO(n){const e=gO(n);return(e.isGradient?new aO(e):new lO(e)).toString()}oe.register(L1),oe.register(oO),oe.register(P1);function D1(n){if(!n)return Nt.fromEmpty();try{return new Nt($e(q0(n),"srgb"))}catch(e){return console.warn(e),Nt.fromBlack()}}function fO(n){const e=D1(n),t=Nt.fromWhite();return{isGradient:!1,solidColor:e,angle:0,transitions:[{color:t,offset:0},{color:e.withAlpha(100),offset:100}]}}function dO(n){const e={"to top":0,"to top right":45,"to right":90,"to bottom right":135,"to bottom":180,"to bottom left":225,"to left":270,"to top left":315};return e[n]?e[n]:n.includes("deg")?Number.parseInt(n.trim().replace("deg","")):0}function hO(n){return n.map(e=>{const[t,r]=e.trim().split(/\s+(?![^(]*\))/);return{color:D1(t),offset:Number.parseFloat(r.replace("%",""))}})}function pO(n){const e=n.indexOf("("),t=n.lastIndexOf(")"),[r,...i]=n.slice(e+1,t).split(/,(?![^(]*\))/),o=hO(i),a=dO(r);return{isGradient:!0,solidColor:o[0].color,angle:a,transitions:o}}function mO(){const n=Nt.fromEmpty();return{isGradient:!1,solidColor:n,angle:0,transitions:[{color:n.clone(),offset:0},{color:n.clone(),offset:100}]}}function gO(n,e=!0){if(!n)return mO();const t=uO(n)?pO(n):fO(n);return t.isGradient&&!e?{...t,isGradient:!1}:t}function z1(n){return cO(n)}function B1(n,e){if(!n.includes("em"))return parseInt(n);const t=Ki.getComputedStyle(e).fontSize,r=parseFloat(n)*parseFloat(t);return Math.round(r)}function yO(n,e){return(n.firstElementChild||n).style.fontSize||Ki.getComputedStyle(e).fontSize}function bO(n,e,t){if(!n.includes("px"))return n;const r=yO(e,t),i=B1(r,t);return i?(parseInt(n)/i).toFixed(2):null}const vO={start:br.LEFT,end:br.RIGHT};function SO(n){const e=vO[n]||n;return br.values.includes(e)?e:null}const F1=(n,e,t,r)=>({from:Math.max(r,n.pos),to:Math.min(r+t.nodeSize,e.pos)});function $1(n,e){return n.resolve(e).depth+1}function wO(n,e,t,r){const i=$1(n,r),o=e.from-i<=r,a=e.to+i>=t.nodeSize+r;return o&&a}const xO=(n,e)=>n.eq(e);function _O(n,e,t,r=xO){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 kO(n,e){const t=typeof e=="string"?e:e.name;return n.find(r=>r.type.name===t)}var ma=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},Js={exports:{}};var EO=Js.exports,H1;function MO(){return H1||(H1=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",u="Invalid `variable` option passed into `_.template`",f="__lodash_hash_undefined__",d=500,m="__lodash_placeholder__",p=1,y=2,S=4,w=1,M=2,T=1,O=2,F=4,B=8,H=16,X=32,q=64,ie=128,Me=256,jt=512,ri=30,Yt="...",pn=800,jn=16,Xt=1,Tn=2,He=3,We=1/0,Ue=9007199254740991,Rt=17976931348623157e292,it=NaN,Ve=4294967295,Yn=Ve-1,Xn=Ve>>>1,Sa=[["ary",ie],["bind",T],["bindKey",O],["curry",B],["curryRight",H],["flip",jt],["partial",X],["partialRight",q],["rearg",Me]],Zt="[object Arguments]",Xs="[object Array]",J1="[object AsyncFunction]",Yi="[object Boolean]",Xi="[object Date]",j1="[object DOMException]",Zs="[object Error]",Qs="[object Function]",sd="[object GeneratorFunction]",Qt="[object Map]",Zi="[object Number]",Y1="[object Null]",Cn="[object Object]",od="[object Promise]",X1="[object Proxy]",Qi="[object RegExp]",en="[object Set]",es="[object String]",eo="[object Symbol]",Z1="[object Undefined]",ts="[object WeakMap]",Q1="[object WeakSet]",ns="[object ArrayBuffer]",ii="[object DataView]",wa="[object Float32Array]",xa="[object Float64Array]",_a="[object Int8Array]",ka="[object Int16Array]",Ea="[object Int32Array]",Ma="[object Uint8Array]",Ta="[object Uint8ClampedArray]",Ca="[object Uint16Array]",Aa="[object Uint32Array]",ey=/\b__p \+= '';/g,ty=/\b(__p \+=) '' \+/g,ny=/(__e\(.*?\)|\b__t\)) \+\n'';/g,ld=/&(?:amp|lt|gt|quot|#39);/g,ad=/[&<>"']/g,ry=RegExp(ld.source),iy=RegExp(ad.source),sy=/<%-([\s\S]+?)%>/g,oy=/<%([\s\S]+?)%>/g,ud=/<%=([\s\S]+?)%>/g,ly=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,ay=/^\w*$/,uy=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Oa=/[\\^$.*+?()[\]{}|]/g,cy=RegExp(Oa.source),Ia=/^\s+/,fy=/\s/,dy=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,hy=/\{\n\/\* \[wrapped with (.+)\] \*/,py=/,? & /,my=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,gy=/[()=,{}\[\]\/\s]/,yy=/\\(\\)?/g,by=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,cd=/\w*$/,vy=/^[-+]0x[0-9a-f]+$/i,Sy=/^0b[01]+$/i,wy=/^\[object .+?Constructor\]$/,xy=/^0o[0-7]+$/i,_y=/^(?:0|[1-9]\d*)$/,ky=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,to=/($^)/,Ey=/['\n\r\u2028\u2029\\]/g,no="\\ud800-\\udfff",My="\\u0300-\\u036f",Ty="\\ufe20-\\ufe2f",Cy="\\u20d0-\\u20ff",fd=My+Ty+Cy,dd="\\u2700-\\u27bf",hd="a-z\\xdf-\\xf6\\xf8-\\xff",Ay="\\xac\\xb1\\xd7\\xf7",Oy="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",Iy="\\u2000-\\u206f",Ny=" \\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",pd="A-Z\\xc0-\\xd6\\xd8-\\xde",md="\\ufe0e\\ufe0f",gd=Ay+Oy+Iy+Ny,Na="['\u2019]",Ry="["+no+"]",yd="["+gd+"]",ro="["+fd+"]",bd="\\d+",Ly="["+dd+"]",vd="["+hd+"]",Sd="[^"+no+gd+bd+dd+hd+pd+"]",Ra="\\ud83c[\\udffb-\\udfff]",Py="(?:"+ro+"|"+Ra+")",wd="[^"+no+"]",La="(?:\\ud83c[\\udde6-\\uddff]){2}",Pa="[\\ud800-\\udbff][\\udc00-\\udfff]",si="["+pd+"]",xd="\\u200d",_d="(?:"+vd+"|"+Sd+")",Dy="(?:"+si+"|"+Sd+")",kd="(?:"+Na+"(?:d|ll|m|re|s|t|ve))?",Ed="(?:"+Na+"(?:D|LL|M|RE|S|T|VE))?",Md=Py+"?",Td="["+md+"]?",zy="(?:"+xd+"(?:"+[wd,La,Pa].join("|")+")"+Td+Md+")*",By="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Fy="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",Cd=Td+Md+zy,$y="(?:"+[Ly,La,Pa].join("|")+")"+Cd,Hy="(?:"+[wd+ro+"?",ro,La,Pa,Ry].join("|")+")",Wy=RegExp(Na,"g"),Uy=RegExp(ro,"g"),Da=RegExp(Ra+"(?="+Ra+")|"+Hy+Cd,"g"),Vy=RegExp([si+"?"+vd+"+"+kd+"(?="+[yd,si,"$"].join("|")+")",Dy+"+"+Ed+"(?="+[yd,si+_d,"$"].join("|")+")",si+"?"+_d+"+"+kd,si+"+"+Ed,Fy,By,bd,$y].join("|"),"g"),Ky=RegExp("["+xd+no+fd+md+"]"),Gy=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,qy=["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"],Jy=-1,xe={};xe[wa]=xe[xa]=xe[_a]=xe[ka]=xe[Ea]=xe[Ma]=xe[Ta]=xe[Ca]=xe[Aa]=!0,xe[Zt]=xe[Xs]=xe[ns]=xe[Yi]=xe[ii]=xe[Xi]=xe[Zs]=xe[Qs]=xe[Qt]=xe[Zi]=xe[Cn]=xe[Qi]=xe[en]=xe[es]=xe[ts]=!1;var we={};we[Zt]=we[Xs]=we[ns]=we[ii]=we[Yi]=we[Xi]=we[wa]=we[xa]=we[_a]=we[ka]=we[Ea]=we[Qt]=we[Zi]=we[Cn]=we[Qi]=we[en]=we[es]=we[eo]=we[Ma]=we[Ta]=we[Ca]=we[Aa]=!0,we[Zs]=we[Qs]=we[ts]=!1;var jy={\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"},Yy={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},Xy={"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#39;":"'"},Zy={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},Qy=parseFloat,e2=parseInt,Ad=typeof ma=="object"&&ma&&ma.Object===Object&&ma,t2=typeof self=="object"&&self&&self.Object===Object&&self,Ze=Ad||t2||Function("return this")(),za=e&&!e.nodeType&&e,Mr=za&&!0&&n&&!n.nodeType&&n,Od=Mr&&Mr.exports===za,Ba=Od&&Ad.process,Lt=function(){try{var k=Mr&&Mr.require&&Mr.require("util").types;return k||Ba&&Ba.binding&&Ba.binding("util")}catch{}}(),Id=Lt&&Lt.isArrayBuffer,Nd=Lt&&Lt.isDate,Rd=Lt&&Lt.isMap,Ld=Lt&&Lt.isRegExp,Pd=Lt&&Lt.isSet,Dd=Lt&&Lt.isTypedArray;function xt(k,A,C){switch(C.length){case 0:return k.call(A);case 1:return k.call(A,C[0]);case 2:return k.call(A,C[0],C[1]);case 3:return k.call(A,C[0],C[1],C[2])}return k.apply(A,C)}function n2(k,A,C,W){for(var Q=-1,ge=k==null?0:k.length;++Q<ge;){var ze=k[Q];A(W,ze,C(ze),k)}return W}function Pt(k,A){for(var C=-1,W=k==null?0:k.length;++C<W&&A(k[C],C,k)!==!1;);return k}function r2(k,A){for(var C=k==null?0:k.length;C--&&A(k[C],C,k)!==!1;);return k}function zd(k,A){for(var C=-1,W=k==null?0:k.length;++C<W;)if(!A(k[C],C,k))return!1;return!0}function Zn(k,A){for(var C=-1,W=k==null?0:k.length,Q=0,ge=[];++C<W;){var ze=k[C];A(ze,C,k)&&(ge[Q++]=ze)}return ge}function io(k,A){var C=k==null?0:k.length;return!!C&&oi(k,A,0)>-1}function Fa(k,A,C){for(var W=-1,Q=k==null?0:k.length;++W<Q;)if(C(A,k[W]))return!0;return!1}function ke(k,A){for(var C=-1,W=k==null?0:k.length,Q=Array(W);++C<W;)Q[C]=A(k[C],C,k);return Q}function Qn(k,A){for(var C=-1,W=A.length,Q=k.length;++C<W;)k[Q+C]=A[C];return k}function $a(k,A,C,W){var Q=-1,ge=k==null?0:k.length;for(W&&ge&&(C=k[++Q]);++Q<ge;)C=A(C,k[Q],Q,k);return C}function i2(k,A,C,W){var Q=k==null?0:k.length;for(W&&Q&&(C=k[--Q]);Q--;)C=A(C,k[Q],Q,k);return C}function Ha(k,A){for(var C=-1,W=k==null?0:k.length;++C<W;)if(A(k[C],C,k))return!0;return!1}var s2=Wa("length");function o2(k){return k.split("")}function l2(k){return k.match(my)||[]}function Bd(k,A,C){var W;return C(k,function(Q,ge,ze){if(A(Q,ge,ze))return W=ge,!1}),W}function so(k,A,C,W){for(var Q=k.length,ge=C+(W?1:-1);W?ge--:++ge<Q;)if(A(k[ge],ge,k))return ge;return-1}function oi(k,A,C){return A===A?v2(k,A,C):so(k,Fd,C)}function a2(k,A,C,W){for(var Q=C-1,ge=k.length;++Q<ge;)if(W(k[Q],A))return Q;return-1}function Fd(k){return k!==k}function $d(k,A){var C=k==null?0:k.length;return C?Va(k,A)/C:it}function Wa(k){return function(A){return A==null?t:A[k]}}function Ua(k){return function(A){return k==null?t:k[A]}}function Hd(k,A,C,W,Q){return Q(k,function(ge,ze,Se){C=W?(W=!1,ge):A(C,ge,ze,Se)}),C}function u2(k,A){var C=k.length;for(k.sort(A);C--;)k[C]=k[C].value;return k}function Va(k,A){for(var C,W=-1,Q=k.length;++W<Q;){var ge=A(k[W]);ge!==t&&(C=C===t?ge:C+ge)}return C}function Ka(k,A){for(var C=-1,W=Array(k);++C<k;)W[C]=A(C);return W}function c2(k,A){return ke(A,function(C){return[C,k[C]]})}function Wd(k){return k&&k.slice(0,Gd(k)+1).replace(Ia,"")}function _t(k){return function(A){return k(A)}}function Ga(k,A){return ke(A,function(C){return k[C]})}function rs(k,A){return k.has(A)}function Ud(k,A){for(var C=-1,W=k.length;++C<W&&oi(A,k[C],0)>-1;);return C}function Vd(k,A){for(var C=k.length;C--&&oi(A,k[C],0)>-1;);return C}function f2(k,A){for(var C=k.length,W=0;C--;)k[C]===A&&++W;return W}var d2=Ua(jy),h2=Ua(Yy);function p2(k){return"\\"+Zy[k]}function m2(k,A){return k==null?t:k[A]}function li(k){return Ky.test(k)}function g2(k){return Gy.test(k)}function y2(k){for(var A,C=[];!(A=k.next()).done;)C.push(A.value);return C}function qa(k){var A=-1,C=Array(k.size);return k.forEach(function(W,Q){C[++A]=[Q,W]}),C}function Kd(k,A){return function(C){return k(A(C))}}function er(k,A){for(var C=-1,W=k.length,Q=0,ge=[];++C<W;){var ze=k[C];(ze===A||ze===m)&&(k[C]=m,ge[Q++]=C)}return ge}function oo(k){var A=-1,C=Array(k.size);return k.forEach(function(W){C[++A]=W}),C}function b2(k){var A=-1,C=Array(k.size);return k.forEach(function(W){C[++A]=[W,W]}),C}function v2(k,A,C){for(var W=C-1,Q=k.length;++W<Q;)if(k[W]===A)return W;return-1}function S2(k,A,C){for(var W=C+1;W--;)if(k[W]===A)return W;return W}function ai(k){return li(k)?x2(k):s2(k)}function tn(k){return li(k)?_2(k):o2(k)}function Gd(k){for(var A=k.length;A--&&fy.test(k.charAt(A)););return A}var w2=Ua(Xy);function x2(k){for(var A=Da.lastIndex=0;Da.test(k);)++A;return A}function _2(k){return k.match(Da)||[]}function k2(k){return k.match(Vy)||[]}var E2=function k(A){A=A==null?Ze:ui.defaults(Ze.Object(),A,ui.pick(Ze,qy));var C=A.Array,W=A.Date,Q=A.Error,ge=A.Function,ze=A.Math,Se=A.Object,Ja=A.RegExp,M2=A.String,Dt=A.TypeError,lo=C.prototype,T2=ge.prototype,ci=Se.prototype,ao=A["__core-js_shared__"],uo=T2.toString,ve=ci.hasOwnProperty,C2=0,qd=function(){var s=/[^.]+$/.exec(ao&&ao.keys&&ao.keys.IE_PROTO||"");return s?"Symbol(src)_1."+s:""}(),co=ci.toString,A2=uo.call(Se),O2=Ze._,I2=Ja("^"+uo.call(ve).replace(Oa,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),fo=Od?A.Buffer:t,tr=A.Symbol,ho=A.Uint8Array,Jd=fo?fo.allocUnsafe:t,po=Kd(Se.getPrototypeOf,Se),jd=Se.create,Yd=ci.propertyIsEnumerable,mo=lo.splice,Xd=tr?tr.isConcatSpreadable:t,is=tr?tr.iterator:t,Tr=tr?tr.toStringTag:t,go=function(){try{var s=Nr(Se,"defineProperty");return s({},"",{}),s}catch{}}(),N2=A.clearTimeout!==Ze.clearTimeout&&A.clearTimeout,R2=W&&W.now!==Ze.Date.now&&W.now,L2=A.setTimeout!==Ze.setTimeout&&A.setTimeout,yo=ze.ceil,bo=ze.floor,ja=Se.getOwnPropertySymbols,P2=fo?fo.isBuffer:t,Zd=A.isFinite,D2=lo.join,z2=Kd(Se.keys,Se),Be=ze.max,st=ze.min,B2=W.now,F2=A.parseInt,Qd=ze.random,$2=lo.reverse,Ya=Nr(A,"DataView"),ss=Nr(A,"Map"),Xa=Nr(A,"Promise"),fi=Nr(A,"Set"),ls=Nr(A,"WeakMap"),as=Nr(Se,"create"),vo=ls&&new ls,di={},H2=Rr(Ya),W2=Rr(ss),U2=Rr(Xa),V2=Rr(fi),K2=Rr(ls),So=tr?tr.prototype:t,us=So?So.valueOf:t,eh=So?So.toString:t;function b(s){if(Oe(s)&&!ee(s)&&!(s instanceof ue)){if(s instanceof zt)return s;if(ve.call(s,"__wrapped__"))return tp(s)}return new zt(s)}var hi=function(){function s(){}return function(l){if(!Te(l))return{};if(jd)return jd(l);s.prototype=l;var c=new s;return s.prototype=t,c}}();function wo(){}function zt(s,l){this.__wrapped__=s,this.__actions__=[],this.__chain__=!!l,this.__index__=0,this.__values__=t}b.templateSettings={escape:sy,evaluate:oy,interpolate:ud,variable:"",imports:{_:b}},b.prototype=wo.prototype,b.prototype.constructor=b,zt.prototype=hi(wo.prototype),zt.prototype.constructor=zt;function ue(s){this.__wrapped__=s,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=Ve,this.__views__=[]}function G2(){var s=new ue(this.__wrapped__);return s.__actions__=gt(this.__actions__),s.__dir__=this.__dir__,s.__filtered__=this.__filtered__,s.__iteratees__=gt(this.__iteratees__),s.__takeCount__=this.__takeCount__,s.__views__=gt(this.__views__),s}function q2(){if(this.__filtered__){var s=new ue(this);s.__dir__=-1,s.__filtered__=!0}else s=this.clone(),s.__dir__*=-1;return s}function J2(){var s=this.__wrapped__.value(),l=this.__dir__,c=ee(s),h=l<0,g=c?s.length:0,v=ov(0,g,this.__views__),x=v.start,_=v.end,E=_-x,I=h?_:x-1,N=this.__iteratees__,R=N.length,$=0,K=st(E,this.__takeCount__);if(!c||!h&&g==E&&K==E)return kh(s,this.__actions__);var j=[];e:for(;E--&&$<K;){I+=l;for(var re=-1,Y=s[I];++re<R;){var le=N[re],fe=le.iteratee,Mt=le.type,ft=fe(Y);if(Mt==Tn)Y=ft;else if(!ft){if(Mt==Xt)continue e;break e}}j[$++]=Y}return j}ue.prototype=hi(wo.prototype),ue.prototype.constructor=ue;function Cr(s){var l=-1,c=s==null?0:s.length;for(this.clear();++l<c;){var h=s[l];this.set(h[0],h[1])}}function j2(){this.__data__=as?as(null):{},this.size=0}function Y2(s){var l=this.has(s)&&delete this.__data__[s];return this.size-=l?1:0,l}function X2(s){var l=this.__data__;if(as){var c=l[s];return c===f?t:c}return ve.call(l,s)?l[s]:t}function Z2(s){var l=this.__data__;return as?l[s]!==t:ve.call(l,s)}function Q2(s,l){var c=this.__data__;return this.size+=this.has(s)?0:1,c[s]=as&&l===t?f:l,this}Cr.prototype.clear=j2,Cr.prototype.delete=Y2,Cr.prototype.get=X2,Cr.prototype.has=Z2,Cr.prototype.set=Q2;function An(s){var l=-1,c=s==null?0:s.length;for(this.clear();++l<c;){var h=s[l];this.set(h[0],h[1])}}function eb(){this.__data__=[],this.size=0}function tb(s){var l=this.__data__,c=xo(l,s);if(c<0)return!1;var h=l.length-1;return c==h?l.pop():mo.call(l,c,1),--this.size,!0}function nb(s){var l=this.__data__,c=xo(l,s);return c<0?t:l[c][1]}function rb(s){return xo(this.__data__,s)>-1}function ib(s,l){var c=this.__data__,h=xo(c,s);return h<0?(++this.size,c.push([s,l])):c[h][1]=l,this}An.prototype.clear=eb,An.prototype.delete=tb,An.prototype.get=nb,An.prototype.has=rb,An.prototype.set=ib;function On(s){var l=-1,c=s==null?0:s.length;for(this.clear();++l<c;){var h=s[l];this.set(h[0],h[1])}}function sb(){this.size=0,this.__data__={hash:new Cr,map:new(ss||An),string:new Cr}}function ob(s){var l=Lo(this,s).delete(s);return this.size-=l?1:0,l}function lb(s){return Lo(this,s).get(s)}function ab(s){return Lo(this,s).has(s)}function ub(s,l){var c=Lo(this,s),h=c.size;return c.set(s,l),this.size+=c.size==h?0:1,this}On.prototype.clear=sb,On.prototype.delete=ob,On.prototype.get=lb,On.prototype.has=ab,On.prototype.set=ub;function Ar(s){var l=-1,c=s==null?0:s.length;for(this.__data__=new On;++l<c;)this.add(s[l])}function cb(s){return this.__data__.set(s,f),this}function fb(s){return this.__data__.has(s)}Ar.prototype.add=Ar.prototype.push=cb,Ar.prototype.has=fb;function nn(s){var l=this.__data__=new An(s);this.size=l.size}function db(){this.__data__=new An,this.size=0}function hb(s){var l=this.__data__,c=l.delete(s);return this.size=l.size,c}function pb(s){return this.__data__.get(s)}function mb(s){return this.__data__.has(s)}function gb(s,l){var c=this.__data__;if(c instanceof An){var h=c.__data__;if(!ss||h.length<i-1)return h.push([s,l]),this.size=++c.size,this;c=this.__data__=new On(h)}return c.set(s,l),this.size=c.size,this}nn.prototype.clear=db,nn.prototype.delete=hb,nn.prototype.get=pb,nn.prototype.has=mb,nn.prototype.set=gb;function th(s,l){var c=ee(s),h=!c&&Lr(s),g=!c&&!h&&or(s),v=!c&&!h&&!g&&yi(s),x=c||h||g||v,_=x?Ka(s.length,M2):[],E=_.length;for(var I in s)(l||ve.call(s,I))&&!(x&&(I=="length"||g&&(I=="offset"||I=="parent")||v&&(I=="buffer"||I=="byteLength"||I=="byteOffset")||Ln(I,E)))&&_.push(I);return _}function nh(s){var l=s.length;return l?s[au(0,l-1)]:t}function yb(s,l){return Po(gt(s),Or(l,0,s.length))}function bb(s){return Po(gt(s))}function Za(s,l,c){(c!==t&&!rn(s[l],c)||c===t&&!(l in s))&&In(s,l,c)}function cs(s,l,c){var h=s[l];(!(ve.call(s,l)&&rn(h,c))||c===t&&!(l in s))&&In(s,l,c)}function xo(s,l){for(var c=s.length;c--;)if(rn(s[c][0],l))return c;return-1}function vb(s,l,c,h){return nr(s,function(g,v,x){l(h,g,c(g),x)}),h}function rh(s,l){return s&&gn(l,Ke(l),s)}function Sb(s,l){return s&&gn(l,bt(l),s)}function In(s,l,c){l=="__proto__"&&go?go(s,l,{configurable:!0,enumerable:!0,value:c,writable:!0}):s[l]=c}function Qa(s,l){for(var c=-1,h=l.length,g=C(h),v=s==null;++c<h;)g[c]=v?t:Ru(s,l[c]);return g}function Or(s,l,c){return s===s&&(c!==t&&(s=s<=c?s:c),l!==t&&(s=s>=l?s:l)),s}function Bt(s,l,c,h,g,v){var x,_=l&p,E=l&y,I=l&S;if(c&&(x=g?c(s,h,g,v):c(s)),x!==t)return x;if(!Te(s))return s;var N=ee(s);if(N){if(x=av(s),!_)return gt(s,x)}else{var R=ot(s),$=R==Qs||R==sd;if(or(s))return Th(s,_);if(R==Cn||R==Zt||$&&!g){if(x=E||$?{}:Gh(s),!_)return E?Xb(s,Sb(x,s)):Yb(s,rh(x,s))}else{if(!we[R])return g?s:{};x=uv(s,R,_)}}v||(v=new nn);var K=v.get(s);if(K)return K;v.set(s,x),wp(s)?s.forEach(function(Y){x.add(Bt(Y,l,c,Y,s,v))}):vp(s)&&s.forEach(function(Y,le){x.set(le,Bt(Y,l,c,le,s,v))});var j=I?E?vu:bu:E?bt:Ke,re=N?t:j(s);return Pt(re||s,function(Y,le){re&&(le=Y,Y=s[le]),cs(x,le,Bt(Y,l,c,le,s,v))}),x}function wb(s){var l=Ke(s);return function(c){return ih(c,s,l)}}function ih(s,l,c){var h=c.length;if(s==null)return!h;for(s=Se(s);h--;){var g=c[h],v=l[g],x=s[g];if(x===t&&!(g in s)||!v(x))return!1}return!0}function sh(s,l,c){if(typeof s!="function")throw new Dt(a);return ys(function(){s.apply(t,c)},l)}function fs(s,l,c,h){var g=-1,v=io,x=!0,_=s.length,E=[],I=l.length;if(!_)return E;c&&(l=ke(l,_t(c))),h?(v=Fa,x=!1):l.length>=i&&(v=rs,x=!1,l=new Ar(l));e:for(;++g<_;){var N=s[g],R=c==null?N:c(N);if(N=h||N!==0?N:0,x&&R===R){for(var $=I;$--;)if(l[$]===R)continue e;E.push(N)}else v(l,R,h)||E.push(N)}return E}var nr=Nh(mn),oh=Nh(tu,!0);function xb(s,l){var c=!0;return nr(s,function(h,g,v){return c=!!l(h,g,v),c}),c}function _o(s,l,c){for(var h=-1,g=s.length;++h<g;){var v=s[h],x=l(v);if(x!=null&&(_===t?x===x&&!Et(x):c(x,_)))var _=x,E=v}return E}function _b(s,l,c,h){var g=s.length;for(c=te(c),c<0&&(c=-c>g?0:g+c),h=h===t||h>g?g:te(h),h<0&&(h+=g),h=c>h?0:_p(h);c<h;)s[c++]=l;return s}function lh(s,l){var c=[];return nr(s,function(h,g,v){l(h,g,v)&&c.push(h)}),c}function Qe(s,l,c,h,g){var v=-1,x=s.length;for(c||(c=fv),g||(g=[]);++v<x;){var _=s[v];l>0&&c(_)?l>1?Qe(_,l-1,c,h,g):Qn(g,_):h||(g[g.length]=_)}return g}var eu=Rh(),ah=Rh(!0);function mn(s,l){return s&&eu(s,l,Ke)}function tu(s,l){return s&&ah(s,l,Ke)}function ko(s,l){return Zn(l,function(c){return Pn(s[c])})}function Ir(s,l){l=ir(l,s);for(var c=0,h=l.length;s!=null&&c<h;)s=s[yn(l[c++])];return c&&c==h?s:t}function uh(s,l,c){var h=l(s);return ee(s)?h:Qn(h,c(s))}function ut(s){return s==null?s===t?Z1:Y1:Tr&&Tr in Se(s)?sv(s):bv(s)}function nu(s,l){return s>l}function kb(s,l){return s!=null&&ve.call(s,l)}function Eb(s,l){return s!=null&&l in Se(s)}function Mb(s,l,c){return s>=st(l,c)&&s<Be(l,c)}function ru(s,l,c){for(var h=c?Fa:io,g=s[0].length,v=s.length,x=v,_=C(v),E=1/0,I=[];x--;){var N=s[x];x&&l&&(N=ke(N,_t(l))),E=st(N.length,E),_[x]=!c&&(l||g>=120&&N.length>=120)?new Ar(x&&N):t}N=s[0];var R=-1,$=_[0];e:for(;++R<g&&I.length<E;){var K=N[R],j=l?l(K):K;if(K=c||K!==0?K:0,!($?rs($,j):h(I,j,c))){for(x=v;--x;){var re=_[x];if(!(re?rs(re,j):h(s[x],j,c)))continue e}$&&$.push(j),I.push(K)}}return I}function Tb(s,l,c,h){return mn(s,function(g,v,x){l(h,c(g),v,x)}),h}function ds(s,l,c){l=ir(l,s),s=Yh(s,l);var h=s==null?s:s[yn($t(l))];return h==null?t:xt(h,s,c)}function ch(s){return Oe(s)&&ut(s)==Zt}function Cb(s){return Oe(s)&&ut(s)==ns}function Ab(s){return Oe(s)&&ut(s)==Xi}function hs(s,l,c,h,g){return s===l?!0:s==null||l==null||!Oe(s)&&!Oe(l)?s!==s&&l!==l:Ob(s,l,c,h,hs,g)}function Ob(s,l,c,h,g,v){var x=ee(s),_=ee(l),E=x?Xs:ot(s),I=_?Xs:ot(l);E=E==Zt?Cn:E,I=I==Zt?Cn:I;var N=E==Cn,R=I==Cn,$=E==I;if($&&or(s)){if(!or(l))return!1;x=!0,N=!1}if($&&!N)return v||(v=new nn),x||yi(s)?Uh(s,l,c,h,g,v):rv(s,l,E,c,h,g,v);if(!(c&w)){var K=N&&ve.call(s,"__wrapped__"),j=R&&ve.call(l,"__wrapped__");if(K||j){var re=K?s.value():s,Y=j?l.value():l;return v||(v=new nn),g(re,Y,c,h,v)}}return $?(v||(v=new nn),iv(s,l,c,h,g,v)):!1}function Ib(s){return Oe(s)&&ot(s)==Qt}function iu(s,l,c,h){var g=c.length,v=g,x=!h;if(s==null)return!v;for(s=Se(s);g--;){var _=c[g];if(x&&_[2]?_[1]!==s[_[0]]:!(_[0]in s))return!1}for(;++g<v;){_=c[g];var E=_[0],I=s[E],N=_[1];if(x&&_[2]){if(I===t&&!(E in s))return!1}else{var R=new nn;if(h)var $=h(I,N,E,s,l,R);if(!($===t?hs(N,I,w|M,h,R):$))return!1}}return!0}function fh(s){if(!Te(s)||hv(s))return!1;var l=Pn(s)?I2:wy;return l.test(Rr(s))}function Nb(s){return Oe(s)&&ut(s)==Qi}function Rb(s){return Oe(s)&&ot(s)==en}function Lb(s){return Oe(s)&&Ho(s.length)&&!!xe[ut(s)]}function dh(s){return typeof s=="function"?s:s==null?vt:typeof s=="object"?ee(s)?mh(s[0],s[1]):ph(s):Lp(s)}function su(s){if(!gs(s))return z2(s);var l=[];for(var c in Se(s))ve.call(s,c)&&c!="constructor"&&l.push(c);return l}function Pb(s){if(!Te(s))return yv(s);var l=gs(s),c=[];for(var h in s)h=="constructor"&&(l||!ve.call(s,h))||c.push(h);return c}function ou(s,l){return s<l}function hh(s,l){var c=-1,h=yt(s)?C(s.length):[];return nr(s,function(g,v,x){h[++c]=l(g,v,x)}),h}function ph(s){var l=wu(s);return l.length==1&&l[0][2]?Jh(l[0][0],l[0][1]):function(c){return c===s||iu(c,s,l)}}function mh(s,l){return _u(s)&&qh(l)?Jh(yn(s),l):function(c){var h=Ru(c,s);return h===t&&h===l?Lu(c,s):hs(l,h,w|M)}}function Eo(s,l,c,h,g){s!==l&&eu(l,function(v,x){if(g||(g=new nn),Te(v))Db(s,l,x,c,Eo,h,g);else{var _=h?h(Eu(s,x),v,x+"",s,l,g):t;_===t&&(_=v),Za(s,x,_)}},bt)}function Db(s,l,c,h,g,v,x){var _=Eu(s,c),E=Eu(l,c),I=x.get(E);if(I){Za(s,c,I);return}var N=v?v(_,E,c+"",s,l,x):t,R=N===t;if(R){var $=ee(E),K=!$&&or(E),j=!$&&!K&&yi(E);N=E,$||K||j?ee(_)?N=_:Ie(_)?N=gt(_):K?(R=!1,N=Th(E,!0)):j?(R=!1,N=Ch(E,!0)):N=[]:bs(E)||Lr(E)?(N=_,Lr(_)?N=kp(_):(!Te(_)||Pn(_))&&(N=Gh(E))):R=!1}R&&(x.set(E,N),g(N,E,h,v,x),x.delete(E)),Za(s,c,N)}function gh(s,l){var c=s.length;if(c)return l+=l<0?c:0,Ln(l,c)?s[l]:t}function yh(s,l,c){l.length?l=ke(l,function(v){return ee(v)?function(x){return Ir(x,v.length===1?v[0]:v)}:v}):l=[vt];var h=-1;l=ke(l,_t(J()));var g=hh(s,function(v,x,_){var E=ke(l,function(I){return I(v)});return{criteria:E,index:++h,value:v}});return u2(g,function(v,x){return jb(v,x,c)})}function zb(s,l){return bh(s,l,function(c,h){return Lu(s,h)})}function bh(s,l,c){for(var h=-1,g=l.length,v={};++h<g;){var x=l[h],_=Ir(s,x);c(_,x)&&ps(v,ir(x,s),_)}return v}function Bb(s){return function(l){return Ir(l,s)}}function lu(s,l,c,h){var g=h?a2:oi,v=-1,x=l.length,_=s;for(s===l&&(l=gt(l)),c&&(_=ke(s,_t(c)));++v<x;)for(var E=0,I=l[v],N=c?c(I):I;(E=g(_,N,E,h))>-1;)_!==s&&mo.call(_,E,1),mo.call(s,E,1);return s}function vh(s,l){for(var c=s?l.length:0,h=c-1;c--;){var g=l[c];if(c==h||g!==v){var v=g;Ln(g)?mo.call(s,g,1):fu(s,g)}}return s}function au(s,l){return s+bo(Qd()*(l-s+1))}function Fb(s,l,c,h){for(var g=-1,v=Be(yo((l-s)/(c||1)),0),x=C(v);v--;)x[h?v:++g]=s,s+=c;return x}function uu(s,l){var c="";if(!s||l<1||l>Ue)return c;do l%2&&(c+=s),l=bo(l/2),l&&(s+=s);while(l);return c}function se(s,l){return Mu(jh(s,l,vt),s+"")}function $b(s){return nh(bi(s))}function Hb(s,l){var c=bi(s);return Po(c,Or(l,0,c.length))}function ps(s,l,c,h){if(!Te(s))return s;l=ir(l,s);for(var g=-1,v=l.length,x=v-1,_=s;_!=null&&++g<v;){var E=yn(l[g]),I=c;if(E==="__proto__"||E==="constructor"||E==="prototype")return s;if(g!=x){var N=_[E];I=h?h(N,E,_):t,I===t&&(I=Te(N)?N:Ln(l[g+1])?[]:{})}cs(_,E,I),_=_[E]}return s}var Sh=vo?function(s,l){return vo.set(s,l),s}:vt,Wb=go?function(s,l){return go(s,"toString",{configurable:!0,enumerable:!1,value:Du(l),writable:!0})}:vt;function Ub(s){return Po(bi(s))}function Ft(s,l,c){var h=-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=C(g);++h<g;)v[h]=s[h+l];return v}function Vb(s,l){var c;return nr(s,function(h,g,v){return c=l(h,g,v),!c}),!!c}function Mo(s,l,c){var h=0,g=s==null?h:s.length;if(typeof l=="number"&&l===l&&g<=Xn){for(;h<g;){var v=h+g>>>1,x=s[v];x!==null&&!Et(x)&&(c?x<=l:x<l)?h=v+1:g=v}return g}return cu(s,l,vt,c)}function cu(s,l,c,h){var g=0,v=s==null?0:s.length;if(v===0)return 0;l=c(l);for(var x=l!==l,_=l===null,E=Et(l),I=l===t;g<v;){var N=bo((g+v)/2),R=c(s[N]),$=R!==t,K=R===null,j=R===R,re=Et(R);if(x)var Y=h||j;else I?Y=j&&(h||$):_?Y=j&&$&&(h||!K):E?Y=j&&$&&!K&&(h||!re):K||re?Y=!1:Y=h?R<=l:R<l;Y?g=N+1:v=N}return st(v,Yn)}function wh(s,l){for(var c=-1,h=s.length,g=0,v=[];++c<h;){var x=s[c],_=l?l(x):x;if(!c||!rn(_,E)){var E=_;v[g++]=x===0?0:x}}return v}function xh(s){return typeof s=="number"?s:Et(s)?it:+s}function kt(s){if(typeof s=="string")return s;if(ee(s))return ke(s,kt)+"";if(Et(s))return eh?eh.call(s):"";var l=s+"";return l=="0"&&1/s==-We?"-0":l}function rr(s,l,c){var h=-1,g=io,v=s.length,x=!0,_=[],E=_;if(c)x=!1,g=Fa;else if(v>=i){var I=l?null:tv(s);if(I)return oo(I);x=!1,g=rs,E=new Ar}else E=l?[]:_;e:for(;++h<v;){var N=s[h],R=l?l(N):N;if(N=c||N!==0?N:0,x&&R===R){for(var $=E.length;$--;)if(E[$]===R)continue e;l&&E.push(R),_.push(N)}else g(E,R,c)||(E!==_&&E.push(R),_.push(N))}return _}function fu(s,l){return l=ir(l,s),s=Yh(s,l),s==null||delete s[yn($t(l))]}function _h(s,l,c,h){return ps(s,l,c(Ir(s,l)),h)}function To(s,l,c,h){for(var g=s.length,v=h?g:-1;(h?v--:++v<g)&&l(s[v],v,s););return c?Ft(s,h?0:v,h?v+1:g):Ft(s,h?v+1:0,h?g:v)}function kh(s,l){var c=s;return c instanceof ue&&(c=c.value()),$a(l,function(h,g){return g.func.apply(g.thisArg,Qn([h],g.args))},c)}function du(s,l,c){var h=s.length;if(h<2)return h?rr(s[0]):[];for(var g=-1,v=C(h);++g<h;)for(var x=s[g],_=-1;++_<h;)_!=g&&(v[g]=fs(v[g]||x,s[_],l,c));return rr(Qe(v,1),l,c)}function Eh(s,l,c){for(var h=-1,g=s.length,v=l.length,x={};++h<g;){var _=h<v?l[h]:t;c(x,s[h],_)}return x}function hu(s){return Ie(s)?s:[]}function pu(s){return typeof s=="function"?s:vt}function ir(s,l){return ee(s)?s:_u(s,l)?[s]:ep(ye(s))}var Kb=se;function sr(s,l,c){var h=s.length;return c=c===t?h:c,!l&&c>=h?s:Ft(s,l,c)}var Mh=N2||function(s){return Ze.clearTimeout(s)};function Th(s,l){if(l)return s.slice();var c=s.length,h=Jd?Jd(c):new s.constructor(c);return s.copy(h),h}function mu(s){var l=new s.constructor(s.byteLength);return new ho(l).set(new ho(s)),l}function Gb(s,l){var c=l?mu(s.buffer):s.buffer;return new s.constructor(c,s.byteOffset,s.byteLength)}function qb(s){var l=new s.constructor(s.source,cd.exec(s));return l.lastIndex=s.lastIndex,l}function Jb(s){return us?Se(us.call(s)):{}}function Ch(s,l){var c=l?mu(s.buffer):s.buffer;return new s.constructor(c,s.byteOffset,s.length)}function Ah(s,l){if(s!==l){var c=s!==t,h=s===null,g=s===s,v=Et(s),x=l!==t,_=l===null,E=l===l,I=Et(l);if(!_&&!I&&!v&&s>l||v&&x&&E&&!_&&!I||h&&x&&E||!c&&E||!g)return 1;if(!h&&!v&&!I&&s<l||I&&c&&g&&!h&&!v||_&&c&&g||!x&&g||!E)return-1}return 0}function jb(s,l,c){for(var h=-1,g=s.criteria,v=l.criteria,x=g.length,_=c.length;++h<x;){var E=Ah(g[h],v[h]);if(E){if(h>=_)return E;var I=c[h];return E*(I=="desc"?-1:1)}}return s.index-l.index}function Oh(s,l,c,h){for(var g=-1,v=s.length,x=c.length,_=-1,E=l.length,I=Be(v-x,0),N=C(E+I),R=!h;++_<E;)N[_]=l[_];for(;++g<x;)(R||g<v)&&(N[c[g]]=s[g]);for(;I--;)N[_++]=s[g++];return N}function Ih(s,l,c,h){for(var g=-1,v=s.length,x=-1,_=c.length,E=-1,I=l.length,N=Be(v-_,0),R=C(N+I),$=!h;++g<N;)R[g]=s[g];for(var K=g;++E<I;)R[K+E]=l[E];for(;++x<_;)($||g<v)&&(R[K+c[x]]=s[g++]);return R}function gt(s,l){var c=-1,h=s.length;for(l||(l=C(h));++c<h;)l[c]=s[c];return l}function gn(s,l,c,h){var g=!c;c||(c={});for(var v=-1,x=l.length;++v<x;){var _=l[v],E=h?h(c[_],s[_],_,c,s):t;E===t&&(E=s[_]),g?In(c,_,E):cs(c,_,E)}return c}function Yb(s,l){return gn(s,xu(s),l)}function Xb(s,l){return gn(s,Vh(s),l)}function Co(s,l){return function(c,h){var g=ee(c)?n2:vb,v=l?l():{};return g(c,s,J(h,2),v)}}function pi(s){return se(function(l,c){var h=-1,g=c.length,v=g>1?c[g-1]:t,x=g>2?c[2]:t;for(v=s.length>3&&typeof v=="function"?(g--,v):t,x&&ct(c[0],c[1],x)&&(v=g<3?t:v,g=1),l=Se(l);++h<g;){var _=c[h];_&&s(l,_,h,v)}return l})}function Nh(s,l){return function(c,h){if(c==null)return c;if(!yt(c))return s(c,h);for(var g=c.length,v=l?g:-1,x=Se(c);(l?v--:++v<g)&&h(x[v],v,x)!==!1;);return c}}function Rh(s){return function(l,c,h){for(var g=-1,v=Se(l),x=h(l),_=x.length;_--;){var E=x[s?_:++g];if(c(v[E],E,v)===!1)break}return l}}function Zb(s,l,c){var h=l&T,g=ms(s);function v(){var x=this&&this!==Ze&&this instanceof v?g:s;return x.apply(h?c:this,arguments)}return v}function Lh(s){return function(l){l=ye(l);var c=li(l)?tn(l):t,h=c?c[0]:l.charAt(0),g=c?sr(c,1).join(""):l.slice(1);return h[s]()+g}}function mi(s){return function(l){return $a(Np(Ip(l).replace(Wy,"")),s,"")}}function ms(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=hi(s.prototype),h=s.apply(c,l);return Te(h)?h:c}}function Qb(s,l,c){var h=ms(s);function g(){for(var v=arguments.length,x=C(v),_=v,E=gi(g);_--;)x[_]=arguments[_];var I=v<3&&x[0]!==E&&x[v-1]!==E?[]:er(x,E);if(v-=I.length,v<c)return Fh(s,l,Ao,g.placeholder,t,x,I,t,t,c-v);var N=this&&this!==Ze&&this instanceof g?h:s;return xt(N,this,x)}return g}function Ph(s){return function(l,c,h){var g=Se(l);if(!yt(l)){var v=J(c,3);l=Ke(l),c=function(_){return v(g[_],_,g)}}var x=s(l,c,h);return x>-1?g[v?l[x]:x]:t}}function Dh(s){return Rn(function(l){var c=l.length,h=c,g=zt.prototype.thru;for(s&&l.reverse();h--;){var v=l[h];if(typeof v!="function")throw new Dt(a);if(g&&!x&&Ro(v)=="wrapper")var x=new zt([],!0)}for(h=x?h:c;++h<c;){v=l[h];var _=Ro(v),E=_=="wrapper"?Su(v):t;E&&ku(E[0])&&E[1]==(ie|B|X|Me)&&!E[4].length&&E[9]==1?x=x[Ro(E[0])].apply(x,E[3]):x=v.length==1&&ku(v)?x[_]():x.thru(v)}return function(){var I=arguments,N=I[0];if(x&&I.length==1&&ee(N))return x.plant(N).value();for(var R=0,$=c?l[R].apply(this,I):N;++R<c;)$=l[R].call(this,$);return $}})}function Ao(s,l,c,h,g,v,x,_,E,I){var N=l&ie,R=l&T,$=l&O,K=l&(B|H),j=l&jt,re=$?t:ms(s);function Y(){for(var le=arguments.length,fe=C(le),Mt=le;Mt--;)fe[Mt]=arguments[Mt];if(K)var ft=gi(Y),Tt=f2(fe,ft);if(h&&(fe=Oh(fe,h,g,K)),v&&(fe=Ih(fe,v,x,K)),le-=Tt,K&&le<I){var Ne=er(fe,ft);return Fh(s,l,Ao,Y.placeholder,c,fe,Ne,_,E,I-le)}var sn=R?c:this,zn=$?sn[s]:s;return le=fe.length,_?fe=vv(fe,_):j&&le>1&&fe.reverse(),N&&E<le&&(fe.length=E),this&&this!==Ze&&this instanceof Y&&(zn=re||ms(zn)),zn.apply(sn,fe)}return Y}function zh(s,l){return function(c,h){return Tb(c,s,l(h),{})}}function Oo(s,l){return function(c,h){var g;if(c===t&&h===t)return l;if(c!==t&&(g=c),h!==t){if(g===t)return h;typeof c=="string"||typeof h=="string"?(c=kt(c),h=kt(h)):(c=xh(c),h=xh(h)),g=s(c,h)}return g}}function gu(s){return Rn(function(l){return l=ke(l,_t(J())),se(function(c){var h=this;return s(l,function(g){return xt(g,h,c)})})})}function Io(s,l){l=l===t?" ":kt(l);var c=l.length;if(c<2)return c?uu(l,s):l;var h=uu(l,yo(s/ai(l)));return li(l)?sr(tn(h),0,s).join(""):h.slice(0,s)}function ev(s,l,c,h){var g=l&T,v=ms(s);function x(){for(var _=-1,E=arguments.length,I=-1,N=h.length,R=C(N+E),$=this&&this!==Ze&&this instanceof x?v:s;++I<N;)R[I]=h[I];for(;E--;)R[I++]=arguments[++_];return xt($,g?c:this,R)}return x}function Bh(s){return function(l,c,h){return h&&typeof h!="number"&&ct(l,c,h)&&(c=h=t),l=Dn(l),c===t?(c=l,l=0):c=Dn(c),h=h===t?l<c?1:-1:Dn(h),Fb(l,c,h,s)}}function No(s){return function(l,c){return typeof l=="string"&&typeof c=="string"||(l=Ht(l),c=Ht(c)),s(l,c)}}function Fh(s,l,c,h,g,v,x,_,E,I){var N=l&B,R=N?x:t,$=N?t:x,K=N?v:t,j=N?t:v;l|=N?X:q,l&=~(N?q:X),l&F||(l&=~(T|O));var re=[s,l,g,K,R,j,$,_,E,I],Y=c.apply(t,re);return ku(s)&&Xh(Y,re),Y.placeholder=h,Zh(Y,s,l)}function yu(s){var l=ze[s];return function(c,h){if(c=Ht(c),h=h==null?0:st(te(h),292),h&&Zd(c)){var g=(ye(c)+"e").split("e"),v=l(g[0]+"e"+(+g[1]+h));return g=(ye(v)+"e").split("e"),+(g[0]+"e"+(+g[1]-h))}return l(c)}}var tv=fi&&1/oo(new fi([,-0]))[1]==We?function(s){return new fi(s)}:Fu;function $h(s){return function(l){var c=ot(l);return c==Qt?qa(l):c==en?b2(l):c2(l,s(l))}}function Nn(s,l,c,h,g,v,x,_){var E=l&O;if(!E&&typeof s!="function")throw new Dt(a);var I=h?h.length:0;if(I||(l&=~(X|q),h=g=t),x=x===t?x:Be(te(x),0),_=_===t?_:te(_),I-=g?g.length:0,l&q){var N=h,R=g;h=g=t}var $=E?t:Su(s),K=[s,l,c,h,g,N,R,v,x,_];if($&&gv(K,$),s=K[0],l=K[1],c=K[2],h=K[3],g=K[4],_=K[9]=K[9]===t?E?0:s.length:Be(K[9]-I,0),!_&&l&(B|H)&&(l&=~(B|H)),!l||l==T)var j=Zb(s,l,c);else l==B||l==H?j=Qb(s,l,_):(l==X||l==(T|X))&&!g.length?j=ev(s,l,c,h):j=Ao.apply(t,K);var re=$?Sh:Xh;return Zh(re(j,K),s,l)}function Hh(s,l,c,h){return s===t||rn(s,ci[c])&&!ve.call(h,c)?l:s}function Wh(s,l,c,h,g,v){return Te(s)&&Te(l)&&(v.set(l,s),Eo(s,l,t,Wh,v),v.delete(l)),s}function nv(s){return bs(s)?t:s}function Uh(s,l,c,h,g,v){var x=c&w,_=s.length,E=l.length;if(_!=E&&!(x&&E>_))return!1;var I=v.get(s),N=v.get(l);if(I&&N)return I==l&&N==s;var R=-1,$=!0,K=c&M?new Ar:t;for(v.set(s,l),v.set(l,s);++R<_;){var j=s[R],re=l[R];if(h)var Y=x?h(re,j,R,l,s,v):h(j,re,R,s,l,v);if(Y!==t){if(Y)continue;$=!1;break}if(K){if(!Ha(l,function(le,fe){if(!rs(K,fe)&&(j===le||g(j,le,c,h,v)))return K.push(fe)})){$=!1;break}}else if(!(j===re||g(j,re,c,h,v))){$=!1;break}}return v.delete(s),v.delete(l),$}function rv(s,l,c,h,g,v,x){switch(c){case ii:if(s.byteLength!=l.byteLength||s.byteOffset!=l.byteOffset)return!1;s=s.buffer,l=l.buffer;case ns:return!(s.byteLength!=l.byteLength||!v(new ho(s),new ho(l)));case Yi:case Xi:case Zi:return rn(+s,+l);case Zs:return s.name==l.name&&s.message==l.message;case Qi:case es:return s==l+"";case Qt:var _=qa;case en:var E=h&w;if(_||(_=oo),s.size!=l.size&&!E)return!1;var I=x.get(s);if(I)return I==l;h|=M,x.set(s,l);var N=Uh(_(s),_(l),h,g,v,x);return x.delete(s),N;case eo:if(us)return us.call(s)==us.call(l)}return!1}function iv(s,l,c,h,g,v){var x=c&w,_=bu(s),E=_.length,I=bu(l),N=I.length;if(E!=N&&!x)return!1;for(var R=E;R--;){var $=_[R];if(!(x?$ in l:ve.call(l,$)))return!1}var K=v.get(s),j=v.get(l);if(K&&j)return K==l&&j==s;var re=!0;v.set(s,l),v.set(l,s);for(var Y=x;++R<E;){$=_[R];var le=s[$],fe=l[$];if(h)var Mt=x?h(fe,le,$,l,s,v):h(le,fe,$,s,l,v);if(!(Mt===t?le===fe||g(le,fe,c,h,v):Mt)){re=!1;break}Y||(Y=$=="constructor")}if(re&&!Y){var ft=s.constructor,Tt=l.constructor;ft!=Tt&&"constructor"in s&&"constructor"in l&&!(typeof ft=="function"&&ft instanceof ft&&typeof Tt=="function"&&Tt instanceof Tt)&&(re=!1)}return v.delete(s),v.delete(l),re}function Rn(s){return Mu(jh(s,t,ip),s+"")}function bu(s){return uh(s,Ke,xu)}function vu(s){return uh(s,bt,Vh)}var Su=vo?function(s){return vo.get(s)}:Fu;function Ro(s){for(var l=s.name+"",c=di[l],h=ve.call(di,l)?c.length:0;h--;){var g=c[h],v=g.func;if(v==null||v==s)return g.name}return l}function gi(s){var l=ve.call(b,"placeholder")?b:s;return l.placeholder}function J(){var s=b.iteratee||zu;return s=s===zu?dh:s,arguments.length?s(arguments[0],arguments[1]):s}function Lo(s,l){var c=s.__data__;return dv(l)?c[typeof l=="string"?"string":"hash"]:c.map}function wu(s){for(var l=Ke(s),c=l.length;c--;){var h=l[c],g=s[h];l[c]=[h,g,qh(g)]}return l}function Nr(s,l){var c=m2(s,l);return fh(c)?c:t}function sv(s){var l=ve.call(s,Tr),c=s[Tr];try{s[Tr]=t;var h=!0}catch{}var g=co.call(s);return h&&(l?s[Tr]=c:delete s[Tr]),g}var xu=ja?function(s){return s==null?[]:(s=Se(s),Zn(ja(s),function(l){return Yd.call(s,l)}))}:$u,Vh=ja?function(s){for(var l=[];s;)Qn(l,xu(s)),s=po(s);return l}:$u,ot=ut;(Ya&&ot(new Ya(new ArrayBuffer(1)))!=ii||ss&&ot(new ss)!=Qt||Xa&&ot(Xa.resolve())!=od||fi&&ot(new fi)!=en||ls&&ot(new ls)!=ts)&&(ot=function(s){var l=ut(s),c=l==Cn?s.constructor:t,h=c?Rr(c):"";if(h)switch(h){case H2:return ii;case W2:return Qt;case U2:return od;case V2:return en;case K2:return ts}return l});function ov(s,l,c){for(var h=-1,g=c.length;++h<g;){var v=c[h],x=v.size;switch(v.type){case"drop":s+=x;break;case"dropRight":l-=x;break;case"take":l=st(l,s+x);break;case"takeRight":s=Be(s,l-x);break}}return{start:s,end:l}}function lv(s){var l=s.match(hy);return l?l[1].split(py):[]}function Kh(s,l,c){l=ir(l,s);for(var h=-1,g=l.length,v=!1;++h<g;){var x=yn(l[h]);if(!(v=s!=null&&c(s,x)))break;s=s[x]}return v||++h!=g?v:(g=s==null?0:s.length,!!g&&Ho(g)&&Ln(x,g)&&(ee(s)||Lr(s)))}function av(s){var l=s.length,c=new s.constructor(l);return l&&typeof s[0]=="string"&&ve.call(s,"index")&&(c.index=s.index,c.input=s.input),c}function Gh(s){return typeof s.constructor=="function"&&!gs(s)?hi(po(s)):{}}function uv(s,l,c){var h=s.constructor;switch(l){case ns:return mu(s);case Yi:case Xi:return new h(+s);case ii:return Gb(s,c);case wa:case xa:case _a:case ka:case Ea:case Ma:case Ta:case Ca:case Aa:return Ch(s,c);case Qt:return new h;case Zi:case es:return new h(s);case Qi:return qb(s);case en:return new h;case eo:return Jb(s)}}function cv(s,l){var c=l.length;if(!c)return s;var h=c-1;return l[h]=(c>1?"& ":"")+l[h],l=l.join(c>2?", ":" "),s.replace(dy,`{
19
+ 3. "-" cannot repeat`);Ae.customSchemes.push([n,e])}function KC(){Ae.scanner=DC(Ae.customSchemes);for(let n=0;n<Ae.tokenQueue.length;n++)Ae.tokenQueue[n][1]({scanner:Ae.scanner});Ae.parser=$C(Ae.scanner.tokens);for(let n=0;n<Ae.pluginQueue.length;n++)Ae.pluginQueue[n][1]({scanner:Ae.scanner,parser:Ae.parser});Ae.initialized=!0}function z0(n){return Ae.initialized||KC(),HC(Ae.parser.start,n,zC(Ae.scanner.start,n))}function Rf(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 If(t),i=z0(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 GC(n,e){e===void 0&&(e=null);const t=z0(n);return t.length===1&&t[0].isLink&&(!e||t[0].t===e)}class qC extends pf{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=GC(i);if(!i||!o)return!1;const a=this._createLinkAttrs(i,r.content);return this.editor.commands.applyLink(a),!0}_createLinkAttrs(e,t){return ih.query(t,{typeName:ne.TEXT,mark:{typeName:he.LINK},getMark:{typeName:he.LINK}})?.attrs||{href:e}}}function P(n){return(...e)=>t=>n(t,...e)}function ia(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 Xr(n){const e=ia(n);return["span",e?{...e,class:"zw-style"}:{},0]}function JC(n){return n.toLowerCase().replace(/(?:^|\s)\S/g,e=>e.toUpperCase())}function qt(n,...e){return({editor:t})=>(t.commands[n](...e),!0)}var jC=Object.defineProperty,YC=(n,e,t)=>e in n?jC(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,xr=(n,e,t)=>YC(n,typeof e!="symbol"?e+"":e,t),B0,F0,$0;function Fe(n,e){let t=n.length;Array.isArray(n[0])||(n=[n]),Array.isArray(e[0])||(e=e.map(a=>[a]));let r=e[0].length,i=e[0].map((a,u)=>e.map(f=>f[u])),o=n.map(a=>i.map(u=>{let f=0;if(!Array.isArray(a)){for(let h of u)f+=a*h;return f}for(let h=0;h<a.length;h++)f+=a[h]*(u[h]||0);return f}));return t===1&&(o=o[0]),r===1?o.map(a=>a[0]):o}function H0(n){return Ks(n)==="string"}function Ks(n){return(Object.prototype.toString.call(n).match(/^\[object\s+(.*?)\]$/)[1]||"").toLowerCase()}function Lf(n,{precision:e,unit:t}){return Pf(n)?"none":XC(n,e)+(t??"")}function Pf(n){return Number.isNaN(n)||n instanceof Number&&n?.none}function XC(n,e){if(n===0)return 0;let t=~~n,r=0;t&&e&&(r=~~Math.log10(Math.abs(t))+1);const i=10**(e-r);return Math.floor(n*i+.5)/i}const ZC={deg:1,grad:.9,rad:180/Math.PI,turn:360};function QC(n){if(!n)return;n=n.trim();const e=/^([a-z]+)\((.+?)\)$/i,t=/^-?[\d.]+$/,r=/%|deg|g?rad|turn$/,i=/\/?\s*(none|[-\w.]+(?:%|deg|g?rad|turn)?)/g;let o=n.match(e);if(o){let a=[];return o[2].replace(i,(u,f)=>{let h=f.match(r),m=f;if(h){let p=h[0],y=m.slice(0,-p.length);p==="%"?(m=new Number(y/100),m.type="<percentage>"):(m=new Number(y*ZC[p]),m.type="<angle>",m.unit=p)}else t.test(m)?(m=new Number(m),m.type="<number>"):m==="none"&&(m=new Number(NaN),m.none=!0);u.startsWith("/")&&(m=m instanceof Number?m:new Number(m),m.alpha=!0),typeof m=="object"&&m instanceof Number&&(m.raw=f),a.push(m)}),{name:o[1].toLowerCase(),rawName:o[1],rawArgs:o[2],args:a}}}function eA(n){return n[n.length-1]}function W0(n,e,t){return isNaN(n)?e:isNaN(e)?n:n+(e-n)*t}function tA(n,e,t){return(t-n)/(e-n)}function U0(n,e,t){return W0(e[0],e[1],tA(n[0],n[1],t))}function nA(n){return n.map(e=>e.split("|").map(t=>{t=t.trim();let r=t.match(/^(<[a-z]+>)\[(-?[.\d]+),\s*(-?[.\d]+)\]?$/);if(r){let i=new String(r[1]);return i.range=[+r[2],+r[3]],i}return t}))}function rA(n,e,t){return Math.max(Math.min(t,e),n)}function Df(n,e){return Math.sign(n)===Math.sign(e)?n:-n}function Un(n,e){return Df(Math.abs(n)**e,n)}function V0(n,e){return e===0?0:n/e}function iA(n,e,t=0,r=n.length){for(;t<r;){const i=t+r>>1;n[i]<e?t=i+1:r=i}return t}class sA{add(e,t,r){if(typeof arguments[0]!="string"){for(var e in arguments[0])this.add(e,arguments[0][e],arguments[1]);return}(Array.isArray(e)?e:[e]).forEach(function(i){this[i]=this[i]||[],t&&this[i][r?"unshift":"push"](t)},this)}run(e,t){this[e]=this[e]||[],this[e].forEach(function(r){r.call(t&&t.context?t.context:t,t)})}}const sa=new sA,Vn={D50:[.3457/.3585,1,(1-.3457-.3585)/.3585],D65:[.3127/.329,1,(1-.3127-.329)/.329]};function zf(n){return Array.isArray(n)?n:Vn[n]}function oa(n,e,t,r={}){if(n=zf(n),e=zf(e),!n||!e)throw new TypeError(`Missing white point to convert ${n?"":"from"}${!n&&!e?"/":""}${e?"":"to"}`);if(n===e)return t;let i={W1:n,W2:e,XYZ:t,options:r};if(sa.run("chromatic-adaptation-start",i),i.M||(i.W1===Vn.D65&&i.W2===Vn.D50?i.M=[[1.0479297925449969,.022946870601609652,-.05019226628920524],[.02962780877005599,.9904344267538799,-.017073799063418826],[-.009243040646204504,.015055191490298152,.7518742814281371]]:i.W1===Vn.D50&&i.W2===Vn.D65&&(i.M=[[.955473421488075,-.02309845494876471,.06325924320057072],[-.0283697093338637,1.0099953980813041,.021041441191917323],[.012314014864481998,-.020507649298898964,1.330365926242124]])),sa.run("chromatic-adaptation-end",i),i.M)return Fe(i.M,i.XYZ);throw new TypeError("Only Bradford CAT with white points D50 and D65 supported for now.")}const Gs={gamut_mapping:"css",precision:5,deltaE:"76",verbose:(($0=(F0=(B0=globalThis?.process)==null?void 0:B0.env)==null?void 0:F0.NODE_ENV)==null?void 0:$0.toLowerCase())!=="test",warn:function(e){var t,r;this.verbose&&((r=(t=globalThis?.console)==null?void 0:t.warn)==null||r.call(t,e))}},oA=new Set(["<number>","<percentage>","<angle>"]);function K0(n,e,t,r){return Object.entries(n.coords).map(([o,a],u)=>{let f=e.coordGrammar[u],h=r[u],m=h?.type,p;if(h.none?p=f.find(w=>oA.has(w)):p=f.find(w=>w==m),!p){let w=a.name||o;throw new TypeError(`${m??h.raw} not allowed for ${w} in ${t}()`)}let y=p.range;m==="<percentage>"&&(y||(y=[0,1]));let S=a.range||a.refRange;return y&&S&&(r[u]=U0(y,S,r[u])),p})}function G0(n,{meta:e}={}){var t,r,i,o;let a={str:(t=String(n))==null?void 0:t.trim()};if(sa.run("parse-start",a),a.color)return a.color;if(a.parsed=QC(a.str),a.parsed){let u=a.parsed.name;if(u==="color"){let f=a.parsed.args.shift(),h=f.startsWith("--")?f.substring(2):`--${f}`,m=[f,h],p=a.parsed.rawArgs.indexOf("/")>0?a.parsed.args.pop():1;for(let w of oe.all){let M=w.getFormat("color");if(M&&(m.includes(M.id)||(r=M.ids)!=null&&r.filter(T=>m.includes(T)).length)){const T=Object.keys(w.coords).map((F,B)=>a.parsed.args[B]||0);let O;return M.coordGrammar&&(O=K0(w,M,"color",T)),e&&Object.assign(e,{formatId:"color",types:O}),M.id.startsWith("--")&&!f.startsWith("--")&&Gs.warn(`${w.name} is a non-standard space and not currently supported in the CSS spec. Use prefixed color(${M.id}) instead of color(${f}).`),f.startsWith("--")&&!M.id.startsWith("--")&&Gs.warn(`${w.name} is a standard space and supported in the CSS spec. Use color(${M.id}) instead of prefixed color(${f}).`),{spaceId:w.id,coords:T,alpha:p}}}let y="",S=f in oe.registry?f:h;if(S in oe.registry){let w=(o=(i=oe.registry[S].formats)==null?void 0:i.color)==null?void 0:o.id;w&&(y=`Did you mean color(${w})?`)}throw new TypeError(`Cannot parse color(${f}). `+(y||"Missing a plugin?"))}else for(let f of oe.all){let h=f.getFormat(u);if(h&&h.type==="function"){let m=1;(h.lastAlpha||eA(a.parsed.args).alpha)&&(m=a.parsed.args.pop());let p=a.parsed.args,y;return h.coordGrammar&&(y=K0(f,h,u,p)),e&&Object.assign(e,{formatId:h.name,types:y}),{spaceId:f.id,coords:p,alpha:m}}}}else for(let u of oe.all)for(let f in u.formats){let h=u.formats[f];if(h.type!=="custom"||h.test&&!h.test(a.str))continue;let m=h.parse(a.str);if(m)return m.alpha??(m.alpha=1),e&&(e.formatId=f),m}throw new TypeError(`Could not parse ${n} as a color. Missing a plugin?`)}function je(n){if(Array.isArray(n))return n.map(je);if(!n)throw new TypeError("Empty color reference");H0(n)&&(n=G0(n));let e=n.space||n.spaceId;return e instanceof oe||(n.space=oe.get(e)),n.alpha===void 0&&(n.alpha=1),n}const lA=75e-6,Bf=class fn{constructor(e){var t;this.id=e.id,this.name=e.name,this.base=e.base?fn.get(e.base):null,this.aliases=e.aliases,this.base&&(this.fromBase=e.fromBase,this.toBase=e.toBase);let r=e.coords??this.base.coords;for(let o in r)"name"in r[o]||(r[o].name=o);this.coords=r;let i=e.white??this.base.white??"D65";this.white=zf(i),this.formats=e.formats??{};for(let o in this.formats){let a=this.formats[o];a.type||(a.type="function"),a.name||(a.name=o)}(t=this.formats.color)!=null&&t.id||(this.formats.color={...this.formats.color??{},id:e.cssId||this.id}),e.gamutSpace?this.gamutSpace=e.gamutSpace==="self"?this:fn.get(e.gamutSpace):this.isPolar?this.gamutSpace=this.base:this.gamutSpace=this,this.gamutSpace.isUnbounded&&(this.inGamut=(o,a)=>!0),this.referred=e.referred,Object.defineProperty(this,"path",{value:aA(this).reverse(),writable:!1,enumerable:!0,configurable:!0}),sa.run("colorspace-init-end",this)}inGamut(e,{epsilon:t=lA}={}){if(!this.equals(this.gamutSpace))return e=this.to(this.gamutSpace,e),this.gamutSpace.inGamut(e,{epsilon:t});let r=Object.values(this.coords);return e.every((i,o)=>{let a=r[o];if(a.type!=="angle"&&a.range){if(Number.isNaN(i))return!0;let[u,f]=a.range;return(u===void 0||i>=u-t)&&(f===void 0||i<=f+t)}return!0})}get isUnbounded(){return Object.values(this.coords).every(e=>!("range"in e))}get cssId(){var e,t;return((t=(e=this.formats)==null?void 0:e.color)==null?void 0:t.id)||this.id}get isPolar(){for(let e in this.coords)if(this.coords[e].type==="angle")return!0;return!1}getFormat(e){if(typeof e=="object")return e=q0(e,this),e;let t;return e==="default"?t=Object.values(this.formats)[0]:t=this.formats[e],t?(t=q0(t,this),t):null}equals(e){return e?this===e||this.id===e||this.id===e.id:!1}to(e,t){if(arguments.length===1){const u=je(e);[e,t]=[u.space,u.coords]}if(e=fn.get(e),this.equals(e))return t;t=t.map(u=>Number.isNaN(u)?0:u);let r=this.path,i=e.path,o,a;for(let u=0;u<r.length&&r[u].equals(i[u]);u++)o=r[u],a=u;if(!o)throw new Error(`Cannot convert between color spaces ${this} and ${e}: no connection space was found`);for(let u=r.length-1;u>a;u--)t=r[u].toBase(t);for(let u=a+1;u<i.length;u++)t=i[u].fromBase(t);return t}from(e,t){if(arguments.length===1){const r=je(e);[e,t]=[r.space,r.coords]}return e=fn.get(e),e.to(this,t)}toString(){return`${this.name} (${this.id})`}getMinCoords(){let e=[];for(let t in this.coords){let r=this.coords[t],i=r.range||r.refRange;e.push(i?.min??0)}return e}static get all(){return[...new Set(Object.values(fn.registry))]}static register(e,t){if(arguments.length===1&&(t=arguments[0],e=t.id),t=this.get(t),this.registry[e]&&this.registry[e]!==t)throw new Error(`Duplicate color space registration: '${e}'`);if(this.registry[e]=t,arguments.length===1&&t.aliases)for(let r of t.aliases)this.register(r,t);return t}static get(e,...t){if(!e||e instanceof fn)return e;if(Ks(e)==="string"){let i=fn.registry[e.toLowerCase()];if(!i)throw new TypeError(`No color space found with id = "${e}"`);return i}if(t.length)return fn.get(...t);throw new TypeError(`${e} is not a valid color space`)}static resolveCoord(e,t){var r;let i=Ks(e),o,a;if(i==="string"?e.includes(".")?[o,a]=e.split("."):[o,a]=[,e]:Array.isArray(e)?[o,a]=e:(o=e.space,a=e.coordId),o=fn.get(o),o||(o=t),!o)throw new TypeError(`Cannot resolve coordinate reference ${e}: No color space specified and relative references are not allowed here`);if(i=Ks(a),i==="number"||i==="string"&&a>=0){let h=Object.entries(o.coords)[a];if(h)return{space:o,id:h[0],index:a,...h[1]}}o=fn.get(o);let u=a.toLowerCase(),f=0;for(let h in o.coords){let m=o.coords[h];if(h.toLowerCase()===u||((r=m.name)==null?void 0:r.toLowerCase())===u)return{space:o,id:h,index:f,...m};f++}throw new TypeError(`No "${a}" coordinate found in ${o.name}. Its coordinates are: ${Object.keys(o.coords).join(", ")}`)}};xr(Bf,"registry",{}),xr(Bf,"DEFAULT_FORMAT",{type:"functions",name:"color"});let oe=Bf;function aA(n){let e=[n];for(let t=n;t=t.base;)e.push(t);return e}function q0(n,{coords:e}={}){if(n.coords&&!n.coordGrammar){n.type||(n.type="function"),n.name||(n.name="color"),n.coordGrammar=nA(n.coords);let t=Object.entries(e).map(([r,i],o)=>{let a=n.coordGrammar[o][0],u=i.range||i.refRange,f=a.range,h="";return a=="<percentage>"?(f=[0,100],h="%"):a=="<angle>"&&(h="deg"),{fromRange:u,toRange:f,suffix:h}});n.serializeCoords=(r,i)=>r.map((o,a)=>{let{fromRange:u,toRange:f,suffix:h}=t[a];return u&&f&&(o=U0(u,f,o)),o=Lf(o,{precision:i,unit:h}),o})}return n}const Kn=new oe({id:"xyz-d65",name:"XYZ D65",coords:{x:{name:"X"},y:{name:"Y"},z:{name:"Z"}},white:"D65",formats:{color:{ids:["xyz-d65","xyz"]}},aliases:["xyz"]});class J0 extends oe{constructor(e){e.coords||(e.coords={r:{range:[0,1],name:"Red"},g:{range:[0,1],name:"Green"},b:{range:[0,1],name:"Blue"}}),e.base||(e.base=Kn),e.toXYZ_M&&e.fromXYZ_M&&(e.toBase??(e.toBase=t=>{let r=Fe(e.toXYZ_M,t);return this.white!==this.base.white&&(r=oa(this.white,this.base.white,r)),r}),e.fromBase??(e.fromBase=t=>(t=oa(this.base.white,this.white,t),Fe(e.fromXYZ_M,t)))),e.referred??(e.referred="display"),super(e)}}function Ff(n,e){return n=je(n),!e||n.space.equals(e)?n.coords.slice():(e=oe.get(e),e.from(n))}function Gn(n,e){n=je(n);let{space:t,index:r}=oe.resolveCoord(e,n.space);return Ff(n,t)[r]}function j0(n,e,t){return n=je(n),e=oe.get(e),n.coords=e.to(n.space,t),n}j0.returns="color";function $f(n,e,t){if(n=je(n),arguments.length===2&&Ks(arguments[1])==="object"){let r=arguments[1];for(let i in r)$f(n,i,r[i])}else{typeof t=="function"&&(t=t(Gn(n,e)));let{space:r,index:i}=oe.resolveCoord(e,n.space),o=Ff(n,r);o[i]=t,j0(n,r,o)}return n}$f.returns="color";const uA=new oe({id:"xyz-d50",name:"XYZ D50",white:"D50",base:Kn,fromBase:n=>oa(Kn.white,"D50",n),toBase:n=>oa("D50",Kn.white,n)}),cA=216/24389,Y0=24/116,la=24389/27;let Hf=Vn.D50;const qn=new oe({id:"lab",name:"Lab",coords:{l:{refRange:[0,100],name:"Lightness"},a:{refRange:[-125,125]},b:{refRange:[-125,125]}},white:Hf,base:uA,fromBase(n){let t=n.map((r,i)=>r/Hf[i]).map(r=>r>cA?Math.cbrt(r):(la*r+16)/116);return[116*t[1]-16,500*(t[0]-t[1]),200*(t[1]-t[2])]},toBase(n){let e=[];return e[1]=(n[0]+16)/116,e[0]=n[1]/500+e[1],e[2]=e[1]-n[2]/200,[e[0]>Y0?Math.pow(e[0],3):(116*e[0]-16)/la,n[0]>8?Math.pow((n[0]+16)/116,3):n[0]/la,e[2]>Y0?Math.pow(e[2],3):(116*e[2]-16)/la].map((r,i)=>r*Hf[i])},formats:{lab:{coords:["<number> | <percentage>","<number> | <percentage>[-1,1]","<number> | <percentage>[-1,1]"]}}});function Zr(n){return(n%360+360)%360}const aa=new oe({id:"lch",name:"LCH",coords:{l:{refRange:[0,100],name:"Lightness"},c:{refRange:[0,150],name:"Chroma"},h:{refRange:[0,360],type:"angle",name:"Hue"}},base:qn,fromBase(n){let[e,t,r]=n,i;const o=.02;return Math.abs(t)<o&&Math.abs(r)<o?i=NaN:i=Math.atan2(r,t)*180/Math.PI,[e,Math.sqrt(t**2+r**2),Zr(i)]},toBase(n){let[e,t,r]=n;return t<0&&(t=0),isNaN(r)&&(r=0),[e,t*Math.cos(r*Math.PI/180),t*Math.sin(r*Math.PI/180)]},formats:{lch:{coords:["<number> | <percentage>","<number> | <percentage>","<number> | <angle>"]}}}),X0=25**7,ua=Math.PI,Z0=180/ua,Ui=ua/180;function Q0(n){const e=n*n;return e*e*e*n}function e1(n,e,{kL:t=1,kC:r=1,kH:i=1}={}){[n,e]=je([n,e]);let[o,a,u]=qn.from(n),f=aa.from(qn,[o,a,u])[1],[h,m,p]=qn.from(e),y=aa.from(qn,[h,m,p])[1];f<0&&(f=0),y<0&&(y=0);let S=(f+y)/2,w=Q0(S),M=.5*(1-Math.sqrt(w/(w+X0))),T=(1+M)*a,O=(1+M)*m,F=Math.sqrt(T**2+u**2),B=Math.sqrt(O**2+p**2),H=T===0&&u===0?0:Math.atan2(u,T),X=O===0&&p===0?0:Math.atan2(p,O);H<0&&(H+=2*ua),X<0&&(X+=2*ua),H*=Z0,X*=Z0;let q=h-o,ie=B-F,Me=X-H,jt=H+X,ri=Math.abs(Me),Yt;F*B===0?Yt=0:ri<=180?Yt=Me:Me>180?Yt=Me-360:Me<-180?Yt=Me+360:Gs.warn("the unthinkable has happened");let pn=2*Math.sqrt(B*F)*Math.sin(Yt*Ui/2),jn=(o+h)/2,Xt=(F+B)/2,Tn=Q0(Xt),He;F*B===0?He=jt:ri<=180?He=jt/2:jt<360?He=(jt+360)/2:He=(jt-360)/2;let We=(jn-50)**2,Ue=1+.015*We/Math.sqrt(20+We),Rt=1+.045*Xt,it=1;it-=.17*Math.cos((He-30)*Ui),it+=.24*Math.cos(2*He*Ui),it+=.32*Math.cos((3*He+6)*Ui),it-=.2*Math.cos((4*He-63)*Ui);let Ve=1+.015*Xt*it,Yn=30*Math.exp(-1*((He-275)/25)**2),Xn=2*Math.sqrt(Tn/(Tn+X0)),Sa=-1*Math.sin(2*Yn*Ui)*Xn,Zt=(q/(t*Ue))**2;return Zt+=(ie/(r*Rt))**2,Zt+=(pn/(i*Ve))**2,Zt+=Sa*(ie/(r*Rt))*(pn/(i*Ve)),Math.sqrt(Zt)}const fA=[[.819022437996703,.3619062600528904,-.1288737815209879],[.0329836539323885,.9292868615863434,.0361446663506424],[.0481771893596242,.2642395317527308,.6335478284694309]],hA=[[1.2268798758459243,-.5578149944602171,.2813910456659647],[-.0405757452148008,1.112286803280317,-.0717110580655164],[-.0763729366746601,-.4214933324022432,1.5869240198367816]],dA=[[.210454268309314,.7936177747023054,-.0040720430116193],[1.9779985324311684,-2.42859224204858,.450593709617411],[.0259040424655478,.7827717124575296,-.8086757549230774]],pA=[[1,.3963377773761749,.2158037573099136],[1,-.1055613458156586,-.0638541728258133],[1,-.0894841775298119,-1.2914855480194092]],ca=new oe({id:"oklab",name:"Oklab",coords:{l:{refRange:[0,1],name:"Lightness"},a:{refRange:[-.4,.4]},b:{refRange:[-.4,.4]}},white:"D65",base:Kn,fromBase(n){let t=Fe(fA,n).map(r=>Math.cbrt(r));return Fe(dA,t)},toBase(n){let t=Fe(pA,n).map(r=>r**3);return Fe(hA,t)},formats:{oklab:{coords:["<percentage> | <number>","<number> | <percentage>[-1,1]","<number> | <percentage>[-1,1]"]}}});function Wf(n,e){[n,e]=je([n,e]);let[t,r,i]=ca.from(n),[o,a,u]=ca.from(e),f=t-o,h=r-a,m=i-u;return Math.sqrt(f**2+h**2+m**2)}const mA=75e-6;function Vi(n,e,{epsilon:t=mA}={}){n=je(n),e||(e=n.space),e=oe.get(e);let r=n.coords;return e!==n.space&&(r=e.from(n)),e.inGamut(r,{epsilon:t})}function Uf(n){return{space:n.space,coords:n.coords.slice(),alpha:n.alpha}}function gA(n,e,t="lab"){t=oe.get(t);let r=t.from(n),i=t.from(e);return Math.sqrt(r.reduce((o,a,u)=>{let f=i[u];return isNaN(a)||isNaN(f)?o:o+(f-a)**2},0))}function yA(n,e){return gA(n,e,"lab")}const bA=Math.PI,t1=bA/180;function vA(n,e,{l:t=2,c:r=1}={}){[n,e]=je([n,e]);let[i,o,a]=qn.from(n),[,u,f]=aa.from(qn,[i,o,a]),[h,m,p]=qn.from(e),y=aa.from(qn,[h,m,p])[1];u<0&&(u=0),y<0&&(y=0);let S=i-h,w=u-y,M=o-m,T=a-p,O=M**2+T**2-w**2,F=.511;i>=16&&(F=.040975*i/(1+.01765*i));let B=.0638*u/(1+.0131*u)+.638,H;Number.isNaN(f)&&(f=0),f>=164&&f<=345?H=.56+Math.abs(.2*Math.cos((f+168)*t1)):H=.36+Math.abs(.4*Math.cos((f+35)*t1));let X=Math.pow(u,4),q=Math.sqrt(X/(X+1900)),ie=B*(q*H+1-q),Me=(S/(t*F))**2;return Me+=(w/(r*B))**2,Me+=O/ie**2,Math.sqrt(Me)}const n1=203,r1=new oe({id:"xyz-abs-d65",cssId:"--xyz-abs-d65",name:"Absolute XYZ D65",coords:{x:{refRange:[0,9504.7],name:"Xa"},y:{refRange:[0,1e4],name:"Ya"},z:{refRange:[0,10888.3],name:"Za"}},base:Kn,fromBase(n){return n.map(e=>Math.max(e*n1,0))},toBase(n){return n.map(e=>Math.max(e/n1,0))}}),fa=1.15,ha=.66,i1=2610/2**14,SA=2**14/2610,s1=3424/2**12,o1=2413/2**7,l1=2392/2**7,wA=1.7*2523/2**5,a1=2**5/(1.7*2523),da=-.56,Vf=16295499532821565e-27,xA=[[.41478972,.579999,.014648],[-.20151,1.120649,.0531008],[-.0166008,.2648,.6684799]],_A=[[1.9242264357876067,-1.0047923125953657,.037651404030618],[.35031676209499907,.7264811939316552,-.06538442294808501],[-.09098281098284752,-.3127282905230739,1.5227665613052603]],EA=[[.5,.5,0],[3.524,-4.066708,.542708],[.199076,1.096799,-1.295875]],kA=[[1,.1386050432715393,.05804731615611886],[.9999999999999999,-.1386050432715393,-.05804731615611886],[.9999999999999998,-.09601924202631895,-.8118918960560388]],MA=new oe({id:"jzazbz",name:"Jzazbz",coords:{jz:{refRange:[0,1],name:"Jz"},az:{refRange:[-.5,.5]},bz:{refRange:[-.5,.5]}},base:r1,fromBase(n){let[e,t,r]=n,i=fa*e-(fa-1)*r,o=ha*t-(ha-1)*e,u=Fe(xA,[i,o,r]).map(function(y){let S=s1+o1*(y/1e4)**i1,w=1+l1*(y/1e4)**i1;return(S/w)**wA}),[f,h,m]=Fe(EA,u);return[(1+da)*f/(1+da*f)-Vf,h,m]},toBase(n){let[e,t,r]=n,i=(e+Vf)/(1+da-da*(e+Vf)),a=Fe(kA,[i,t,r]).map(function(y){let S=s1-y**a1,w=l1*y**a1-o1;return 1e4*(S/w)**SA}),[u,f,h]=Fe(_A,a),m=(u+(fa-1)*h)/fa,p=(f+(ha-1)*m)/ha;return[m,p,h]},formats:{color:{coords:["<number> | <percentage>","<number> | <percentage>[-1,1]","<number> | <percentage>[-1,1]"]}}}),u1=new oe({id:"jzczhz",name:"JzCzHz",coords:{jz:{refRange:[0,1],name:"Jz"},cz:{refRange:[0,1],name:"Chroma"},hz:{refRange:[0,360],type:"angle",name:"Hue"}},base:MA,fromBase(n){let[e,t,r]=n,i;const o=2e-4;return Math.abs(t)<o&&Math.abs(r)<o?i=NaN:i=Math.atan2(r,t)*180/Math.PI,[e,Math.sqrt(t**2+r**2),Zr(i)]},toBase(n){return[n[0],n[1]*Math.cos(n[2]*Math.PI/180),n[1]*Math.sin(n[2]*Math.PI/180)]}});function TA(n,e){[n,e]=je([n,e]);let[t,r,i]=u1.from(n),[o,a,u]=u1.from(e),f=t-o,h=r-a;Number.isNaN(i)&&Number.isNaN(u)?(i=0,u=0):Number.isNaN(i)?i=u:Number.isNaN(u)&&(u=i);let m=i-u,p=2*Math.sqrt(r*a)*Math.sin(m/2*(Math.PI/180));return Math.sqrt(f**2+h**2+p**2)}const c1=3424/4096,f1=2413/128,h1=2392/128,d1=2610/16384,CA=2523/32,AA=16384/2610,p1=32/2523,OA=[[.3592832590121217,.6976051147779502,-.035891593232029],[-.1920808463704993,1.100476797037432,.0753748658519118],[.0070797844607479,.0748396662186362,.8433265453898765]],IA=[[2048/4096,2048/4096,0],[6610/4096,-13613/4096,7003/4096],[17933/4096,-17390/4096,-543/4096]],NA=[[.9999999999999998,.0086090370379328,.111029625003026],[.9999999999999998,-.0086090370379328,-.1110296250030259],[.9999999999999998,.5600313357106791,-.3206271749873188]],RA=[[2.0701522183894223,-1.3263473389671563,.2066510476294053],[.3647385209748072,.6805660249472273,-.0453045459220347],[-.0497472075358123,-.0492609666966131,1.1880659249923042]],m1=new oe({id:"ictcp",name:"ICTCP",coords:{i:{refRange:[0,1],name:"I"},ct:{refRange:[-.5,.5],name:"CT"},cp:{refRange:[-.5,.5],name:"CP"}},base:r1,fromBase(n){let e=Fe(OA,n);return LA(e)},toBase(n){let e=PA(n);return Fe(RA,e)}});function LA(n){let e=n.map(function(t){let r=c1+f1*(t/1e4)**d1,i=1+h1*(t/1e4)**d1;return(r/i)**CA});return Fe(IA,e)}function PA(n){return Fe(NA,n).map(function(r){let i=Math.max(r**p1-c1,0),o=f1-h1*r**p1;return 1e4*(i/o)**AA})}function DA(n,e){[n,e]=je([n,e]);let[t,r,i]=m1.from(n),[o,a,u]=m1.from(e);return 720*Math.sqrt((t-o)**2+.25*(r-a)**2+(i-u)**2)}const zA=Vn.D65,g1=.42,y1=1/g1,Kf=2*Math.PI,b1=[[.401288,.650173,-.051461],[-.250268,1.204414,.045854],[-.002079,.048952,.953127]],BA=[[1.8620678550872327,-1.0112546305316843,.14918677544445175],[.38752654323613717,.6214474419314753,-.008973985167612518],[-.015841498849333856,-.03412293802851557,1.0499644368778496]],FA=[[460,451,288],[460,-891,-261],[460,-220,-6300]],$A={dark:[.8,.525,.8],dim:[.9,.59,.9],average:[1,.69,1]},Qr={h:[20.14,90,164.25,237.53,380.14],e:[.8,.7,1,1.2,.8],H:[0,100,200,300,400]},HA=180/Math.PI,v1=Math.PI/180;function S1(n,e){return n.map(r=>{const i=Un(e*Math.abs(r)*.01,g1);return 400*Df(i,r)/(i+27.13)})}function WA(n,e){const t=100/e*27.13**y1;return n.map(r=>{const i=Math.abs(r);return Df(t*Un(i/(400-i),y1),r)})}function UA(n){let e=Zr(n);e<=Qr.h[0]&&(e+=360);const t=iA(Qr.h,e)-1,[r,i]=Qr.h.slice(t,t+2),[o,a]=Qr.e.slice(t,t+2),u=Qr.H[t],f=(e-r)/o;return u+100*f/(f+(i-e)/a)}function VA(n){let e=(n%400+400)%400;const t=Math.floor(.01*e);e=e%100;const[r,i]=Qr.h.slice(t,t+2),[o,a]=Qr.e.slice(t,t+2);return Zr((e*(a*r-o*i)-100*r*a)/(e*(a-o)-100*a))}function w1(n,e,t,r,i){const o={};o.discounting=i,o.refWhite=n,o.surround=r;const a=n.map(M=>M*100);o.la=e,o.yb=t;const u=a[1],f=Fe(b1,a);r=$A[o.surround];const h=r[0];o.c=r[1],o.nc=r[2];const p=(1/(5*o.la+1))**4;o.fl=p*o.la+.1*(1-p)*(1-p)*Math.cbrt(5*o.la),o.flRoot=o.fl**.25,o.n=o.yb/u,o.z=1.48+Math.sqrt(o.n),o.nbb=.725*o.n**-.2,o.ncb=o.nbb;const y=Math.max(Math.min(h*(1-1/3.6*Math.exp((-o.la-42)/92)),1),0);o.dRgb=f.map(M=>W0(1,u/M,y)),o.dRgbInv=o.dRgb.map(M=>1/M);const S=f.map((M,T)=>M*o.dRgb[T]),w=S1(S,o.fl);return o.aW=o.nbb*(2*w[0]+w[1]+.05*w[2]),o}const x1=w1(zA,64/Math.PI*.2,20,"average",!1);function Gf(n,e){if(!(n.J!==void 0^n.Q!==void 0))throw new Error("Conversion requires one and only one: 'J' or 'Q'");if(!(n.C!==void 0^n.M!==void 0^n.s!==void 0))throw new Error("Conversion requires one and only one: 'C', 'M' or 's'");if(!(n.h!==void 0^n.H!==void 0))throw new Error("Conversion requires one and only one: 'h' or 'H'");if(n.J===0||n.Q===0)return[0,0,0];let t=0;n.h!==void 0?t=Zr(n.h)*v1:t=VA(n.H)*v1;const r=Math.cos(t),i=Math.sin(t);let o=0;n.J!==void 0?o=Un(n.J,1/2)*.1:n.Q!==void 0&&(o=.25*e.c*n.Q/((e.aW+4)*e.flRoot));let a=0;n.C!==void 0?a=n.C/o:n.M!==void 0?a=n.M/e.flRoot/o:n.s!==void 0&&(a=4e-4*n.s**2*(e.aW+4)/e.c);const u=Un(a*Math.pow(1.64-Math.pow(.29,e.n),-.73),10/9),f=.25*(Math.cos(t+2)+3.8),h=e.aW*Un(o,2/e.c/e.z),m=5e4/13*e.nc*e.ncb*f,p=h/e.nbb,y=23*(p+.305)*V0(u,23*m+u*(11*r+108*i)),S=y*r,w=y*i,M=WA(Fe(FA,[p,S,w]).map(T=>T*1/1403),e.fl);return Fe(BA,M.map((T,O)=>T*e.dRgbInv[O])).map(T=>T/100)}function _1(n,e){const t=n.map(B=>B*100),r=S1(Fe(b1,t).map((B,H)=>B*e.dRgb[H]),e.fl),i=r[0]+(-12*r[1]+r[2])/11,o=(r[0]+r[1]-2*r[2])/9,a=(Math.atan2(o,i)%Kf+Kf)%Kf,u=.25*(Math.cos(a+2)+3.8),f=5e4/13*e.nc*e.ncb*V0(u*Math.sqrt(i**2+o**2),r[0]+r[1]+1.05*r[2]+.305),h=Un(f,.9)*Math.pow(1.64-Math.pow(.29,e.n),.73),m=e.nbb*(2*r[0]+r[1]+.05*r[2]),p=Un(m/e.aW,.5*e.c*e.z),y=100*Un(p,2),S=4/e.c*p*(e.aW+4)*e.flRoot,w=h*p,M=w*e.flRoot,T=Zr(a*HA),O=UA(T),F=50*Un(e.c*h/(e.aW+4),1/2);return{J:y,C:w,h:T,s:F,Q:S,M,H:O}}new oe({id:"cam16-jmh",cssId:"--cam16-jmh",name:"CAM16-JMh",coords:{j:{refRange:[0,100],name:"J"},m:{refRange:[0,105],name:"Colorfulness"},h:{refRange:[0,360],type:"angle",name:"Hue"}},base:Kn,fromBase(n){const e=_1(n,x1);return[e.J,e.M,e.h]},toBase(n){return Gf({J:n[0],M:n[1],h:n[2]},x1)}});const KA=Vn.D65,GA=216/24389,E1=24389/27;function qA(n){return 116*(n>GA?Math.cbrt(n):(E1*n+16)/116)-16}function qf(n){return n>8?Math.pow((n+16)/116,3):n/E1}function JA(n,e){let[t,r,i]=n,o=[],a=0;if(i===0)return[0,0,0];let u=qf(i);i>0?a=.00379058511492914*i**2+.608983189401032*i+.9155088574762233:a=9514440756550361e-21*i**2+.08693057439788597*i-21.928975842194614;const f=2e-12,h=15;let m=0,p=1/0;for(;m<=h;){o=Gf({J:a,C:r,h:t},e);const y=Math.abs(o[1]-u);if(y<p){if(y<=f)return o;p=y}a=a-(o[1]-u)*a/(2*o[1]),m+=1}return Gf({J:a,C:r,h:t},e)}function jA(n,e){const t=qA(n[1]);if(t===0)return[0,0,0];const r=_1(n,Jf);return[Zr(r.h),r.C,t]}const Jf=w1(KA,200/Math.PI*qf(50),qf(50)*100,"average",!1),pa=new oe({id:"hct",name:"HCT",coords:{h:{refRange:[0,360],type:"angle",name:"Hue"},c:{refRange:[0,145],name:"Colorfulness"},t:{refRange:[0,100],name:"Tone"}},base:Kn,fromBase(n){return jA(n)},toBase(n){return JA(n,Jf)},formats:{color:{id:"--hct",coords:["<number> | <angle>","<percentage> | <number>","<percentage> | <number>"]}}}),YA=Math.PI/180,k1=[1,.007,.0228];function M1(n){n[1]<0&&(n=pa.fromBase(pa.toBase(n)));const e=Math.log(Math.max(1+k1[2]*n[1]*Jf.flRoot,1))/k1[2],t=n[0]*YA,r=e*Math.cos(t),i=e*Math.sin(t);return[n[2],r,i]}function XA(n,e){[n,e]=je([n,e]);let[t,r,i]=M1(pa.from(n)),[o,a,u]=M1(pa.from(e));return Math.sqrt((t-o)**2+(r-a)**2+(i-u)**2)}const T1={deltaE76:yA,deltaECMC:vA,deltaE2000:e1,deltaEJz:TA,deltaEITP:DA,deltaEOK:Wf,deltaEHCT:XA};function ZA(n){const e=n?Math.floor(Math.log10(Math.abs(n))):0;return Math.max(parseFloat(`1e${e-2}`),1e-6)}const C1={hct:{method:"hct.c",jnd:2,deltaEMethod:"hct",blackWhiteClamp:{}},"hct-tonal":{method:"hct.c",jnd:0,deltaEMethod:"hct",blackWhiteClamp:{channel:"hct.t",min:0,max:100}}};function qs(n,{method:e=Gs.gamut_mapping,space:t=void 0,deltaEMethod:r="",jnd:i=2,blackWhiteClamp:o={}}={}){if(n=je(n),H0(arguments[1])?t=arguments[1]:t||(t=n.space),t=oe.get(t),Vi(n,t,{epsilon:0}))return n;let a;if(e==="css")a=QA(n,{space:t});else{if(e!=="clip"&&!Vi(n,t)){Object.prototype.hasOwnProperty.call(C1,e)&&({method:e,jnd:i,deltaEMethod:r,blackWhiteClamp:o}=C1[e]);let u=e1;if(r!==""){for(let h in T1)if("deltae"+r.toLowerCase()===h.toLowerCase()){u=T1[h];break}}let f=qs($e(n,t),{method:"clip",space:t});if(u(n,f)>i){if(Object.keys(o).length===3){let F=oe.resolveCoord(o.channel),B=Gn($e(n,F.space),F.id);if(Pf(B)&&(B=0),B>=o.max)return $e({space:"xyz-d65",coords:Vn.D65},n.space);if(B<=o.min)return $e({space:"xyz-d65",coords:[0,0,0]},n.space)}let h=oe.resolveCoord(e),m=h.space,p=h.id,y=$e(n,m);y.coords.forEach((F,B)=>{Pf(F)&&(y.coords[B]=0)});let w=(h.range||h.refRange)[0],M=ZA(i),T=w,O=Gn(y,p);for(;O-T>M;){let F=Uf(y);F=qs(F,{space:t,method:"clip"}),u(y,F)-i<M?T=Gn(y,p):O=Gn(y,p),$f(y,p,(T+O)/2)}a=$e(y,t)}else a=f}else a=$e(n,t);if(e==="clip"||!Vi(a,t,{epsilon:0})){let u=Object.values(t.coords).map(f=>f.range||[]);a.coords=a.coords.map((f,h)=>{let[m,p]=u[h];return m!==void 0&&(f=Math.max(m,f)),p!==void 0&&(f=Math.min(f,p)),f})}}return t!==n.space&&(a=$e(a,n.space)),n.coords=a.coords,n}qs.returns="color";const A1={WHITE:{space:ca,coords:[1,0,0]},BLACK:{space:ca,coords:[0,0,0]}};function QA(n,{space:e}={}){n=je(n),e||(e=n.space),e=oe.get(e);const i=oe.get("oklch");if(e.isUnbounded)return $e(n,e);const o=$e(n,i);let a=o.coords[0];if(a>=1){const w=$e(A1.WHITE,e);return w.alpha=n.alpha,$e(w,e)}if(a<=0){const w=$e(A1.BLACK,e);return w.alpha=n.alpha,$e(w,e)}if(Vi(o,e,{epsilon:0}))return $e(o,e);function u(w){const M=$e(w,e),T=Object.values(e.coords);return M.coords=M.coords.map((O,F)=>{if("range"in T[F]){const[B,H]=T[F].range;return rA(B,O,H)}return O}),M}let f=0,h=o.coords[1],m=!0,p=Uf(o),y=u(p),S=Wf(y,p);if(S<.02)return y;for(;h-f>1e-4;){const w=(f+h)/2;if(p.coords[1]=w,m&&Vi(p,e,{epsilon:0}))f=w;else if(y=u(p),S=Wf(y,p),S<.02){if(.02-S<1e-4)break;m=!1,f=w}else h=w}return y}function $e(n,e,{inGamut:t}={}){n=je(n),e=oe.get(e);let r=e.from(n),i={space:e,coords:r,alpha:n.alpha};return t&&(i=qs(i,t===!0?void 0:t)),i}$e.returns="color";function eO(n,{precision:e=Gs.precision,format:t="default",inGamut:r=!0,...i}={}){var o;let a;n=je(n);let u=t;t=n.space.getFormat(t)??n.space.getFormat("default")??oe.DEFAULT_FORMAT;let f=n.coords.slice();if(r||(r=t.toGamut),r&&!Vi(n)&&(f=qs(Uf(n),r===!0?void 0:r).coords),t.type==="custom")if(i.precision=e,t.serialize)a=t.serialize(f,n.alpha,i);else throw new TypeError(`format ${u} can only be used to parse colors, not for serialization`);else{let h=t.name||"color";t.serializeCoords?f=t.serializeCoords(f,e):e!==null&&(f=f.map(S=>Lf(S,{precision:e})));let m=[...f];if(h==="color"){let S=t.id||((o=t.ids)==null?void 0:o[0])||n.space.id;m.unshift(S)}let p=n.alpha;e!==null&&(p=Lf(p,{precision:e}));let y=n.alpha>=1||t.noAlpha?"":`${t.commas?",":" /"} ${p}`;a=`${h}(${m.join(t.commas?", ":" ")}${y})`}return a}const tO=[[.41239079926595934,.357584339383878,.1804807884018343],[.21263900587151027,.715168678767756,.07219231536073371],[.01933081871559182,.11919477979462598,.9505321522496607]],nO=[[3.2409699419045226,-1.537383177570094,-.4986107602930034],[-.9692436362808796,1.8759675015077202,.04155505740717559],[.05563007969699366,-.20397695888897652,1.0569715142428786]],rO=new J0({id:"srgb-linear",name:"Linear sRGB",white:"D65",toXYZ_M:tO,fromXYZ_M:nO}),O1={aliceblue:[240/255,248/255,1],antiquewhite:[250/255,235/255,215/255],aqua:[0,1,1],aquamarine:[127/255,1,212/255],azure:[240/255,1,1],beige:[245/255,245/255,220/255],bisque:[1,228/255,196/255],black:[0,0,0],blanchedalmond:[1,235/255,205/255],blue:[0,0,1],blueviolet:[138/255,43/255,226/255],brown:[165/255,42/255,42/255],burlywood:[222/255,184/255,135/255],cadetblue:[95/255,158/255,160/255],chartreuse:[127/255,1,0],chocolate:[210/255,105/255,30/255],coral:[1,127/255,80/255],cornflowerblue:[100/255,149/255,237/255],cornsilk:[1,248/255,220/255],crimson:[220/255,20/255,60/255],cyan:[0,1,1],darkblue:[0,0,139/255],darkcyan:[0,139/255,139/255],darkgoldenrod:[184/255,134/255,11/255],darkgray:[169/255,169/255,169/255],darkgreen:[0,100/255,0],darkgrey:[169/255,169/255,169/255],darkkhaki:[189/255,183/255,107/255],darkmagenta:[139/255,0,139/255],darkolivegreen:[85/255,107/255,47/255],darkorange:[1,140/255,0],darkorchid:[153/255,50/255,204/255],darkred:[139/255,0,0],darksalmon:[233/255,150/255,122/255],darkseagreen:[143/255,188/255,143/255],darkslateblue:[72/255,61/255,139/255],darkslategray:[47/255,79/255,79/255],darkslategrey:[47/255,79/255,79/255],darkturquoise:[0,206/255,209/255],darkviolet:[148/255,0,211/255],deeppink:[1,20/255,147/255],deepskyblue:[0,191/255,1],dimgray:[105/255,105/255,105/255],dimgrey:[105/255,105/255,105/255],dodgerblue:[30/255,144/255,1],firebrick:[178/255,34/255,34/255],floralwhite:[1,250/255,240/255],forestgreen:[34/255,139/255,34/255],fuchsia:[1,0,1],gainsboro:[220/255,220/255,220/255],ghostwhite:[248/255,248/255,1],gold:[1,215/255,0],goldenrod:[218/255,165/255,32/255],gray:[128/255,128/255,128/255],green:[0,128/255,0],greenyellow:[173/255,1,47/255],grey:[128/255,128/255,128/255],honeydew:[240/255,1,240/255],hotpink:[1,105/255,180/255],indianred:[205/255,92/255,92/255],indigo:[75/255,0,130/255],ivory:[1,1,240/255],khaki:[240/255,230/255,140/255],lavender:[230/255,230/255,250/255],lavenderblush:[1,240/255,245/255],lawngreen:[124/255,252/255,0],lemonchiffon:[1,250/255,205/255],lightblue:[173/255,216/255,230/255],lightcoral:[240/255,128/255,128/255],lightcyan:[224/255,1,1],lightgoldenrodyellow:[250/255,250/255,210/255],lightgray:[211/255,211/255,211/255],lightgreen:[144/255,238/255,144/255],lightgrey:[211/255,211/255,211/255],lightpink:[1,182/255,193/255],lightsalmon:[1,160/255,122/255],lightseagreen:[32/255,178/255,170/255],lightskyblue:[135/255,206/255,250/255],lightslategray:[119/255,136/255,153/255],lightslategrey:[119/255,136/255,153/255],lightsteelblue:[176/255,196/255,222/255],lightyellow:[1,1,224/255],lime:[0,1,0],limegreen:[50/255,205/255,50/255],linen:[250/255,240/255,230/255],magenta:[1,0,1],maroon:[128/255,0,0],mediumaquamarine:[102/255,205/255,170/255],mediumblue:[0,0,205/255],mediumorchid:[186/255,85/255,211/255],mediumpurple:[147/255,112/255,219/255],mediumseagreen:[60/255,179/255,113/255],mediumslateblue:[123/255,104/255,238/255],mediumspringgreen:[0,250/255,154/255],mediumturquoise:[72/255,209/255,204/255],mediumvioletred:[199/255,21/255,133/255],midnightblue:[25/255,25/255,112/255],mintcream:[245/255,1,250/255],mistyrose:[1,228/255,225/255],moccasin:[1,228/255,181/255],navajowhite:[1,222/255,173/255],navy:[0,0,128/255],oldlace:[253/255,245/255,230/255],olive:[128/255,128/255,0],olivedrab:[107/255,142/255,35/255],orange:[1,165/255,0],orangered:[1,69/255,0],orchid:[218/255,112/255,214/255],palegoldenrod:[238/255,232/255,170/255],palegreen:[152/255,251/255,152/255],paleturquoise:[175/255,238/255,238/255],palevioletred:[219/255,112/255,147/255],papayawhip:[1,239/255,213/255],peachpuff:[1,218/255,185/255],peru:[205/255,133/255,63/255],pink:[1,192/255,203/255],plum:[221/255,160/255,221/255],powderblue:[176/255,224/255,230/255],purple:[128/255,0,128/255],rebeccapurple:[102/255,51/255,153/255],red:[1,0,0],rosybrown:[188/255,143/255,143/255],royalblue:[65/255,105/255,225/255],saddlebrown:[139/255,69/255,19/255],salmon:[250/255,128/255,114/255],sandybrown:[244/255,164/255,96/255],seagreen:[46/255,139/255,87/255],seashell:[1,245/255,238/255],sienna:[160/255,82/255,45/255],silver:[192/255,192/255,192/255],skyblue:[135/255,206/255,235/255],slateblue:[106/255,90/255,205/255],slategray:[112/255,128/255,144/255],slategrey:[112/255,128/255,144/255],snow:[1,250/255,250/255],springgreen:[0,1,127/255],steelblue:[70/255,130/255,180/255],tan:[210/255,180/255,140/255],teal:[0,128/255,128/255],thistle:[216/255,191/255,216/255],tomato:[1,99/255,71/255],turquoise:[64/255,224/255,208/255],violet:[238/255,130/255,238/255],wheat:[245/255,222/255,179/255],white:[1,1,1],whitesmoke:[245/255,245/255,245/255],yellow:[1,1,0],yellowgreen:[154/255,205/255,50/255]};let I1=Array(3).fill("<percentage> | <number>[0, 255]"),N1=Array(3).fill("<number>[0, 255]");const R1=new J0({id:"srgb",name:"sRGB",base:rO,fromBase:n=>n.map(e=>{let t=e<0?-1:1,r=e*t;return r>.0031308?t*(1.055*r**(1/2.4)-.055):12.92*e}),toBase:n=>n.map(e=>{let t=e<0?-1:1,r=e*t;return r<=.04045?e/12.92:t*((r+.055)/1.055)**2.4}),formats:{rgb:{coords:I1},rgb_number:{name:"rgb",commas:!0,coords:N1,noAlpha:!0},color:{},rgba:{coords:I1,commas:!0,lastAlpha:!0},rgba_number:{name:"rgba",commas:!0,coords:N1},hex:{type:"custom",toGamut:!0,test:n=>/^#([a-f0-9]{3,4}){1,2}$/i.test(n),parse(n){n.length<=5&&(n=n.replace(/[a-f0-9]/gi,"$&$&"));let e=[];return n.replace(/[a-f0-9]{2}/gi,t=>{e.push(parseInt(t,16)/255)}),{spaceId:"srgb",coords:e.slice(0,3),alpha:e.slice(3)[0]}},serialize:(n,e,{collapse:t=!0}={})=>{e<1&&n.push(e),n=n.map(o=>Math.round(o*255));let r=t&&n.every(o=>o%17===0);return"#"+n.map(o=>r?(o/17).toString(16):o.toString(16).padStart(2,"0")).join("")}},keyword:{type:"custom",test:n=>/^[a-z]+$/i.test(n),parse(n){n=n.toLowerCase();let e={spaceId:"srgb",coords:null,alpha:1};if(n==="transparent"?(e.coords=O1.black,e.alpha=0):e.coords=O1[n],e.coords)return e}}}});function iO(n){return Gn(n,[Kn,"y"])}const L1=new oe({id:"hsl",name:"HSL",coords:{h:{refRange:[0,360],type:"angle",name:"Hue"},s:{range:[0,100],name:"Saturation"},l:{range:[0,100],name:"Lightness"}},base:R1,fromBase:n=>{let e=Math.max(...n),t=Math.min(...n),[r,i,o]=n,[a,u,f]=[NaN,0,(t+e)/2],h=e-t;if(h!==0){switch(u=f===0||f===1?0:(e-f)/Math.min(f,1-f),e){case r:a=(i-o)/h+(i<o?6:0);break;case i:a=(o-r)/h+2;break;case o:a=(r-i)/h+4}a=a*60}return u<0&&(a+=180,u=Math.abs(u)),a>=360&&(a-=360),[a,u*100,f*100]},toBase:n=>{let[e,t,r]=n;e=e%360,e<0&&(e+=360),t/=100,r/=100;function i(o){let a=(o+e/30)%12,u=t*Math.min(r,1-r);return r-u*Math.max(-1,Math.min(a-3,9-a,1))}return[i(0),i(8),i(4)]},formats:{hsl:{coords:["<number> | <angle>","<percentage>","<percentage>"]},hsla:{coords:["<number> | <angle>","<percentage>","<percentage>"],commas:!0,lastAlpha:!0}}}),sO=new oe({id:"hsv",name:"HSV",coords:{h:{refRange:[0,360],type:"angle",name:"Hue"},s:{range:[0,100],name:"Saturation"},v:{range:[0,100],name:"Value"}},base:L1,fromBase(n){let[e,t,r]=n;t/=100,r/=100;let i=r+t*Math.min(r,1-r);return[e,i===0?0:200*(1-r/i),100*i]},toBase(n){let[e,t,r]=n;t/=100,r/=100;let i=r*(1-t/2);return[e,i===0||i===1?0:(r-i)/Math.min(i,1-i)*100,i*100]},formats:{color:{id:"--hsv",coords:["<number> | <angle>","<percentage> | <number>","<percentage> | <number>"]}}});class Nt{constructor(e){xr(this,"data"),xr(this,"isEmpty",!1),this.data=$e(e,"srgb")}static fromEmpty(){return Nt.fromWhite().setEmpty(!0)}static fromBlack(){return new Nt({spaceId:"srgb",coords:[0,0,0],alpha:1})}static fromWhite(){return new Nt({spaceId:"srgb",coords:[1,1,1],alpha:1})}get r(){return Math.round(this.data.coords[0]*255)}get g(){return Math.round(this.data.coords[1]*255)}get b(){return Math.round(this.data.coords[2]*255)}get h(){return Gn(this.data,"hsv.h")}get s(){return Gn(this.data,"hsv.s")}get v(){return Gn(this.data,"hsv.v")}get alpha(){return this.data.alpha.valueOf()}get alphaPercent(){return Math.round(this.alpha*100)}get isTransparent(){return this.alpha===0}get isDark(){return iO(this.data)<.5}setEmpty(e){return this.isEmpty=e,this}withAlpha(e){return new Nt({...this.data,alpha:e})}withRgb(e){return new Nt({spaceId:"srgb",coords:[e.r?e.r/255:this.data.coords[0],e.g?e.g/255:this.data.coords[1],e.b?e.b/255:this.data.coords[2]],alpha:e.a??this.alpha})}withHsv(e){const r=Ff(this.data,"hsv"),i=Math.max(e.s??r[1],1e-5),o=Math.max(e.v??r[2],1e-5);return new Nt({spaceId:"hsv",coords:[e.h??r[0],i,o],alpha:this.alpha})}toString(){return this.isEmpty?"":this.alpha===1?this.toHexString():this.toRgbaString()}toHexString(){const e=eO(this.data,{format:"hex"}).toUpperCase();return e.length===4?`#${e[1]}${e[1]}${e[2]}${e[2]}${e[3]}${e[3]}`:e.slice(0,7)}toRgbaString(){return`rgba(${this.r}, ${this.g}, ${this.b}, ${this.alphaPercent}%)`}clone(){return new Nt(this.data).setEmpty(this.isEmpty)}}class oO{constructor(e){xr(this,"_color"),this.setColor(e.solidColor)}get color(){return this._color}setColor(e){this._color=e}toString(){return this.color.toString()}isEqual(e){return this.toString()===e}update({solidColor:e}){this.setColor(e)}}let P1=999;function lO(){return P1+=1,P1}function aO(n){return n?n.startsWith("linear-gradient("):!1}function uO(){const n=Nt.fromEmpty();return{isGradient:!1,solidColor:n,angle:0,transitions:[{color:n.clone(),offset:0},{color:n.clone(),offset:100}]}}oe.register(R1),oe.register(sO),oe.register(L1);function D1(n){if(!n)return Nt.fromEmpty();try{return new Nt($e(G0(n),"srgb"))}catch(e){return console.warn(e),Nt.fromBlack()}}function cO(n){const e={"to top":0,"to top right":45,"to right":90,"to bottom right":135,"to bottom":180,"to bottom left":225,"to left":270,"to top left":315};return e[n]?e[n]:n.includes("deg")?Number.parseInt(n.trim().replace("deg","")):0}function fO(n){return n.map(e=>{const[t,r]=e.trim().split(/\s+(?![^(]*\))/);return{color:D1(t),offset:Number.parseFloat(r.replace("%",""))}})}function hO(n){const e=n.indexOf("("),t=n.lastIndexOf(")"),[r,...i]=n.slice(e+1,t).split(/,(?![^(]*\))/),o=fO(i),a=cO(r);return{isGradient:!0,solidColor:o[0].color,angle:a,transitions:o}}function dO(n){const e=D1(n),t=Nt.fromWhite();return{isGradient:!1,solidColor:e,angle:0,transitions:[{color:t,offset:0},{color:e.withAlpha(1),offset:100}]}}function pO(n,e=!0){if(!n)return uO();const t=aO(n)?hO(n):dO(n);return t.isGradient&&!e?{...t,isGradient:!1}:t}class nh{constructor(e,t=0){xr(this,"id"),this.color=e,this.offset=t,this.id=lO()}get isEmpty(){return this.color.isEmpty}setOffset(e){this.offset=e}toString(){return`${this.color.toString()} ${this.offset}%`}clone(e){return new nh(this.color.clone(),e)}}class mO{constructor(e){xr(this,"_angle",0),xr(this,"transitions",[]),this.update(e)}get canAddTransition(){return this.transitions.length<5}get canRemoveTransition(){return this.transitions.length>2}get angle(){return this._angle}setAngle(e){this._angle=e}addTransition(e){this.transitions.push(e),this.sortTransitions()}removeTransition(e){this.transitions=this.transitions.filter(({id:t})=>t!==e.id)}sortTransitions(){this.transitions=this.transitions.sort((e,t)=>e.offset-t.offset)}toString(e){if(this.transitions.some(i=>i.isEmpty))return"";const r=this.transitions.map(i=>i.toString());return`linear-gradient(${e??this.angle}deg, ${r.join(", ")})`}isEqual(e){return this.toString()===e}update(e){this._angle=e.angle,this.transitions=e.transitions.map(({color:t,offset:r})=>new nh(t,r))}hasTransition(e){return this.transitions.some(t=>t.id===e.id)}}function gO(n){const e=pO(n);return(e.isGradient?new mO(e):new oO(e)).toString()}function z1(n){return gO(n)}function B1(n,e){if(!n.includes("em"))return parseInt(n);const t=Ki.getComputedStyle(e).fontSize,r=parseFloat(n)*parseFloat(t);return Math.round(r)}function yO(n,e){return(n.firstElementChild||n).style.fontSize||Ki.getComputedStyle(e).fontSize}function bO(n,e,t){if(!n.includes("px"))return n;const r=yO(e,t),i=B1(r,t);return i?(parseInt(n)/i).toFixed(2):null}const vO={start:br.LEFT,end:br.RIGHT};function SO(n){const e=vO[n]||n;return br.values.includes(e)?e:null}const F1=(n,e,t,r)=>({from:Math.max(r,n.pos),to:Math.min(r+t.nodeSize,e.pos)});function $1(n,e){return n.resolve(e).depth+1}function wO(n,e,t,r){const i=$1(n,r),o=e.from-i<=r,a=e.to+i>=t.nodeSize+r;return o&&a}const xO=(n,e)=>n.eq(e);function _O(n,e,t,r=xO){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 EO(n,e){const t=typeof e=="string"?e:e.name;return n.find(r=>r.type.name===t)}var ma=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},Js={exports:{}};var kO=Js.exports,H1;function MO(){return H1||(H1=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",u="Invalid `variable` option passed into `_.template`",f="__lodash_hash_undefined__",h=500,m="__lodash_placeholder__",p=1,y=2,S=4,w=1,M=2,T=1,O=2,F=4,B=8,H=16,X=32,q=64,ie=128,Me=256,jt=512,ri=30,Yt="...",pn=800,jn=16,Xt=1,Tn=2,He=3,We=1/0,Ue=9007199254740991,Rt=17976931348623157e292,it=NaN,Ve=4294967295,Yn=Ve-1,Xn=Ve>>>1,Sa=[["ary",ie],["bind",T],["bindKey",O],["curry",B],["curryRight",H],["flip",jt],["partial",X],["partialRight",q],["rearg",Me]],Zt="[object Arguments]",Xs="[object Array]",J1="[object AsyncFunction]",Yi="[object Boolean]",Xi="[object Date]",j1="[object DOMException]",Zs="[object Error]",Qs="[object Function]",sh="[object GeneratorFunction]",Qt="[object Map]",Zi="[object Number]",Y1="[object Null]",Cn="[object Object]",oh="[object Promise]",X1="[object Proxy]",Qi="[object RegExp]",en="[object Set]",es="[object String]",eo="[object Symbol]",Z1="[object Undefined]",ts="[object WeakMap]",Q1="[object WeakSet]",ns="[object ArrayBuffer]",ii="[object DataView]",wa="[object Float32Array]",xa="[object Float64Array]",_a="[object Int8Array]",Ea="[object Int16Array]",ka="[object Int32Array]",Ma="[object Uint8Array]",Ta="[object Uint8ClampedArray]",Ca="[object Uint16Array]",Aa="[object Uint32Array]",ey=/\b__p \+= '';/g,ty=/\b(__p \+=) '' \+/g,ny=/(__e\(.*?\)|\b__t\)) \+\n'';/g,lh=/&(?:amp|lt|gt|quot|#39);/g,ah=/[&<>"']/g,ry=RegExp(lh.source),iy=RegExp(ah.source),sy=/<%-([\s\S]+?)%>/g,oy=/<%([\s\S]+?)%>/g,uh=/<%=([\s\S]+?)%>/g,ly=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,ay=/^\w*$/,uy=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Oa=/[\\^$.*+?()[\]{}|]/g,cy=RegExp(Oa.source),Ia=/^\s+/,fy=/\s/,hy=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,dy=/\{\n\/\* \[wrapped with (.+)\] \*/,py=/,? & /,my=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,gy=/[()=,{}\[\]\/\s]/,yy=/\\(\\)?/g,by=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,ch=/\w*$/,vy=/^[-+]0x[0-9a-f]+$/i,Sy=/^0b[01]+$/i,wy=/^\[object .+?Constructor\]$/,xy=/^0o[0-7]+$/i,_y=/^(?:0|[1-9]\d*)$/,Ey=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,to=/($^)/,ky=/['\n\r\u2028\u2029\\]/g,no="\\ud800-\\udfff",My="\\u0300-\\u036f",Ty="\\ufe20-\\ufe2f",Cy="\\u20d0-\\u20ff",fh=My+Ty+Cy,hh="\\u2700-\\u27bf",dh="a-z\\xdf-\\xf6\\xf8-\\xff",Ay="\\xac\\xb1\\xd7\\xf7",Oy="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",Iy="\\u2000-\\u206f",Ny=" \\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",ph="A-Z\\xc0-\\xd6\\xd8-\\xde",mh="\\ufe0e\\ufe0f",gh=Ay+Oy+Iy+Ny,Na="['\u2019]",Ry="["+no+"]",yh="["+gh+"]",ro="["+fh+"]",bh="\\d+",Ly="["+hh+"]",vh="["+dh+"]",Sh="[^"+no+gh+bh+hh+dh+ph+"]",Ra="\\ud83c[\\udffb-\\udfff]",Py="(?:"+ro+"|"+Ra+")",wh="[^"+no+"]",La="(?:\\ud83c[\\udde6-\\uddff]){2}",Pa="[\\ud800-\\udbff][\\udc00-\\udfff]",si="["+ph+"]",xh="\\u200d",_h="(?:"+vh+"|"+Sh+")",Dy="(?:"+si+"|"+Sh+")",Eh="(?:"+Na+"(?:d|ll|m|re|s|t|ve))?",kh="(?:"+Na+"(?:D|LL|M|RE|S|T|VE))?",Mh=Py+"?",Th="["+mh+"]?",zy="(?:"+xh+"(?:"+[wh,La,Pa].join("|")+")"+Th+Mh+")*",By="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Fy="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",Ch=Th+Mh+zy,$y="(?:"+[Ly,La,Pa].join("|")+")"+Ch,Hy="(?:"+[wh+ro+"?",ro,La,Pa,Ry].join("|")+")",Wy=RegExp(Na,"g"),Uy=RegExp(ro,"g"),Da=RegExp(Ra+"(?="+Ra+")|"+Hy+Ch,"g"),Vy=RegExp([si+"?"+vh+"+"+Eh+"(?="+[yh,si,"$"].join("|")+")",Dy+"+"+kh+"(?="+[yh,si+_h,"$"].join("|")+")",si+"?"+_h+"+"+Eh,si+"+"+kh,Fy,By,bh,$y].join("|"),"g"),Ky=RegExp("["+xh+no+fh+mh+"]"),Gy=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,qy=["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"],Jy=-1,xe={};xe[wa]=xe[xa]=xe[_a]=xe[Ea]=xe[ka]=xe[Ma]=xe[Ta]=xe[Ca]=xe[Aa]=!0,xe[Zt]=xe[Xs]=xe[ns]=xe[Yi]=xe[ii]=xe[Xi]=xe[Zs]=xe[Qs]=xe[Qt]=xe[Zi]=xe[Cn]=xe[Qi]=xe[en]=xe[es]=xe[ts]=!1;var we={};we[Zt]=we[Xs]=we[ns]=we[ii]=we[Yi]=we[Xi]=we[wa]=we[xa]=we[_a]=we[Ea]=we[ka]=we[Qt]=we[Zi]=we[Cn]=we[Qi]=we[en]=we[es]=we[eo]=we[Ma]=we[Ta]=we[Ca]=we[Aa]=!0,we[Zs]=we[Qs]=we[ts]=!1;var jy={\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"},Yy={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},Xy={"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#39;":"'"},Zy={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},Qy=parseFloat,e2=parseInt,Ah=typeof ma=="object"&&ma&&ma.Object===Object&&ma,t2=typeof self=="object"&&self&&self.Object===Object&&self,Ze=Ah||t2||Function("return this")(),za=e&&!e.nodeType&&e,Mr=za&&!0&&n&&!n.nodeType&&n,Oh=Mr&&Mr.exports===za,Ba=Oh&&Ah.process,Lt=function(){try{var E=Mr&&Mr.require&&Mr.require("util").types;return E||Ba&&Ba.binding&&Ba.binding("util")}catch{}}(),Ih=Lt&&Lt.isArrayBuffer,Nh=Lt&&Lt.isDate,Rh=Lt&&Lt.isMap,Lh=Lt&&Lt.isRegExp,Ph=Lt&&Lt.isSet,Dh=Lt&&Lt.isTypedArray;function xt(E,A,C){switch(C.length){case 0:return E.call(A);case 1:return E.call(A,C[0]);case 2:return E.call(A,C[0],C[1]);case 3:return E.call(A,C[0],C[1],C[2])}return E.apply(A,C)}function n2(E,A,C,W){for(var Q=-1,ge=E==null?0:E.length;++Q<ge;){var ze=E[Q];A(W,ze,C(ze),E)}return W}function Pt(E,A){for(var C=-1,W=E==null?0:E.length;++C<W&&A(E[C],C,E)!==!1;);return E}function r2(E,A){for(var C=E==null?0:E.length;C--&&A(E[C],C,E)!==!1;);return E}function zh(E,A){for(var C=-1,W=E==null?0:E.length;++C<W;)if(!A(E[C],C,E))return!1;return!0}function Zn(E,A){for(var C=-1,W=E==null?0:E.length,Q=0,ge=[];++C<W;){var ze=E[C];A(ze,C,E)&&(ge[Q++]=ze)}return ge}function io(E,A){var C=E==null?0:E.length;return!!C&&oi(E,A,0)>-1}function Fa(E,A,C){for(var W=-1,Q=E==null?0:E.length;++W<Q;)if(C(A,E[W]))return!0;return!1}function Ee(E,A){for(var C=-1,W=E==null?0:E.length,Q=Array(W);++C<W;)Q[C]=A(E[C],C,E);return Q}function Qn(E,A){for(var C=-1,W=A.length,Q=E.length;++C<W;)E[Q+C]=A[C];return E}function $a(E,A,C,W){var Q=-1,ge=E==null?0:E.length;for(W&&ge&&(C=E[++Q]);++Q<ge;)C=A(C,E[Q],Q,E);return C}function i2(E,A,C,W){var Q=E==null?0:E.length;for(W&&Q&&(C=E[--Q]);Q--;)C=A(C,E[Q],Q,E);return C}function Ha(E,A){for(var C=-1,W=E==null?0:E.length;++C<W;)if(A(E[C],C,E))return!0;return!1}var s2=Wa("length");function o2(E){return E.split("")}function l2(E){return E.match(my)||[]}function Bh(E,A,C){var W;return C(E,function(Q,ge,ze){if(A(Q,ge,ze))return W=ge,!1}),W}function so(E,A,C,W){for(var Q=E.length,ge=C+(W?1:-1);W?ge--:++ge<Q;)if(A(E[ge],ge,E))return ge;return-1}function oi(E,A,C){return A===A?v2(E,A,C):so(E,Fh,C)}function a2(E,A,C,W){for(var Q=C-1,ge=E.length;++Q<ge;)if(W(E[Q],A))return Q;return-1}function Fh(E){return E!==E}function $h(E,A){var C=E==null?0:E.length;return C?Va(E,A)/C:it}function Wa(E){return function(A){return A==null?t:A[E]}}function Ua(E){return function(A){return E==null?t:E[A]}}function Hh(E,A,C,W,Q){return Q(E,function(ge,ze,Se){C=W?(W=!1,ge):A(C,ge,ze,Se)}),C}function u2(E,A){var C=E.length;for(E.sort(A);C--;)E[C]=E[C].value;return E}function Va(E,A){for(var C,W=-1,Q=E.length;++W<Q;){var ge=A(E[W]);ge!==t&&(C=C===t?ge:C+ge)}return C}function Ka(E,A){for(var C=-1,W=Array(E);++C<E;)W[C]=A(C);return W}function c2(E,A){return Ee(A,function(C){return[C,E[C]]})}function Wh(E){return E&&E.slice(0,Gh(E)+1).replace(Ia,"")}function _t(E){return function(A){return E(A)}}function Ga(E,A){return Ee(A,function(C){return E[C]})}function rs(E,A){return E.has(A)}function Uh(E,A){for(var C=-1,W=E.length;++C<W&&oi(A,E[C],0)>-1;);return C}function Vh(E,A){for(var C=E.length;C--&&oi(A,E[C],0)>-1;);return C}function f2(E,A){for(var C=E.length,W=0;C--;)E[C]===A&&++W;return W}var h2=Ua(jy),d2=Ua(Yy);function p2(E){return"\\"+Zy[E]}function m2(E,A){return E==null?t:E[A]}function li(E){return Ky.test(E)}function g2(E){return Gy.test(E)}function y2(E){for(var A,C=[];!(A=E.next()).done;)C.push(A.value);return C}function qa(E){var A=-1,C=Array(E.size);return E.forEach(function(W,Q){C[++A]=[Q,W]}),C}function Kh(E,A){return function(C){return E(A(C))}}function er(E,A){for(var C=-1,W=E.length,Q=0,ge=[];++C<W;){var ze=E[C];(ze===A||ze===m)&&(E[C]=m,ge[Q++]=C)}return ge}function oo(E){var A=-1,C=Array(E.size);return E.forEach(function(W){C[++A]=W}),C}function b2(E){var A=-1,C=Array(E.size);return E.forEach(function(W){C[++A]=[W,W]}),C}function v2(E,A,C){for(var W=C-1,Q=E.length;++W<Q;)if(E[W]===A)return W;return-1}function S2(E,A,C){for(var W=C+1;W--;)if(E[W]===A)return W;return W}function ai(E){return li(E)?x2(E):s2(E)}function tn(E){return li(E)?_2(E):o2(E)}function Gh(E){for(var A=E.length;A--&&fy.test(E.charAt(A)););return A}var w2=Ua(Xy);function x2(E){for(var A=Da.lastIndex=0;Da.test(E);)++A;return A}function _2(E){return E.match(Da)||[]}function E2(E){return E.match(Vy)||[]}var k2=function E(A){A=A==null?Ze:ui.defaults(Ze.Object(),A,ui.pick(Ze,qy));var C=A.Array,W=A.Date,Q=A.Error,ge=A.Function,ze=A.Math,Se=A.Object,Ja=A.RegExp,M2=A.String,Dt=A.TypeError,lo=C.prototype,T2=ge.prototype,ci=Se.prototype,ao=A["__core-js_shared__"],uo=T2.toString,ve=ci.hasOwnProperty,C2=0,qh=function(){var s=/[^.]+$/.exec(ao&&ao.keys&&ao.keys.IE_PROTO||"");return s?"Symbol(src)_1."+s:""}(),co=ci.toString,A2=uo.call(Se),O2=Ze._,I2=Ja("^"+uo.call(ve).replace(Oa,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),fo=Oh?A.Buffer:t,tr=A.Symbol,ho=A.Uint8Array,Jh=fo?fo.allocUnsafe:t,po=Kh(Se.getPrototypeOf,Se),jh=Se.create,Yh=ci.propertyIsEnumerable,mo=lo.splice,Xh=tr?tr.isConcatSpreadable:t,is=tr?tr.iterator:t,Tr=tr?tr.toStringTag:t,go=function(){try{var s=Nr(Se,"defineProperty");return s({},"",{}),s}catch{}}(),N2=A.clearTimeout!==Ze.clearTimeout&&A.clearTimeout,R2=W&&W.now!==Ze.Date.now&&W.now,L2=A.setTimeout!==Ze.setTimeout&&A.setTimeout,yo=ze.ceil,bo=ze.floor,ja=Se.getOwnPropertySymbols,P2=fo?fo.isBuffer:t,Zh=A.isFinite,D2=lo.join,z2=Kh(Se.keys,Se),Be=ze.max,st=ze.min,B2=W.now,F2=A.parseInt,Qh=ze.random,$2=lo.reverse,Ya=Nr(A,"DataView"),ss=Nr(A,"Map"),Xa=Nr(A,"Promise"),fi=Nr(A,"Set"),ls=Nr(A,"WeakMap"),as=Nr(Se,"create"),vo=ls&&new ls,hi={},H2=Rr(Ya),W2=Rr(ss),U2=Rr(Xa),V2=Rr(fi),K2=Rr(ls),So=tr?tr.prototype:t,us=So?So.valueOf:t,ed=So?So.toString:t;function b(s){if(Oe(s)&&!ee(s)&&!(s instanceof ue)){if(s instanceof zt)return s;if(ve.call(s,"__wrapped__"))return tp(s)}return new zt(s)}var di=function(){function s(){}return function(l){if(!Te(l))return{};if(jh)return jh(l);s.prototype=l;var c=new s;return s.prototype=t,c}}();function wo(){}function zt(s,l){this.__wrapped__=s,this.__actions__=[],this.__chain__=!!l,this.__index__=0,this.__values__=t}b.templateSettings={escape:sy,evaluate:oy,interpolate:uh,variable:"",imports:{_:b}},b.prototype=wo.prototype,b.prototype.constructor=b,zt.prototype=di(wo.prototype),zt.prototype.constructor=zt;function ue(s){this.__wrapped__=s,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=Ve,this.__views__=[]}function G2(){var s=new ue(this.__wrapped__);return s.__actions__=gt(this.__actions__),s.__dir__=this.__dir__,s.__filtered__=this.__filtered__,s.__iteratees__=gt(this.__iteratees__),s.__takeCount__=this.__takeCount__,s.__views__=gt(this.__views__),s}function q2(){if(this.__filtered__){var s=new ue(this);s.__dir__=-1,s.__filtered__=!0}else s=this.clone(),s.__dir__*=-1;return s}function J2(){var s=this.__wrapped__.value(),l=this.__dir__,c=ee(s),d=l<0,g=c?s.length:0,v=ov(0,g,this.__views__),x=v.start,_=v.end,k=_-x,I=d?_:x-1,N=this.__iteratees__,R=N.length,$=0,K=st(k,this.__takeCount__);if(!c||!d&&g==k&&K==k)return Ed(s,this.__actions__);var j=[];e:for(;k--&&$<K;){I+=l;for(var re=-1,Y=s[I];++re<R;){var le=N[re],fe=le.iteratee,Mt=le.type,ft=fe(Y);if(Mt==Tn)Y=ft;else if(!ft){if(Mt==Xt)continue e;break e}}j[$++]=Y}return j}ue.prototype=di(wo.prototype),ue.prototype.constructor=ue;function Cr(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 j2(){this.__data__=as?as(null):{},this.size=0}function Y2(s){var l=this.has(s)&&delete this.__data__[s];return this.size-=l?1:0,l}function X2(s){var l=this.__data__;if(as){var c=l[s];return c===f?t:c}return ve.call(l,s)?l[s]:t}function Z2(s){var l=this.__data__;return as?l[s]!==t:ve.call(l,s)}function Q2(s,l){var c=this.__data__;return this.size+=this.has(s)?0:1,c[s]=as&&l===t?f:l,this}Cr.prototype.clear=j2,Cr.prototype.delete=Y2,Cr.prototype.get=X2,Cr.prototype.has=Z2,Cr.prototype.set=Q2;function An(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 eb(){this.__data__=[],this.size=0}function tb(s){var l=this.__data__,c=xo(l,s);if(c<0)return!1;var d=l.length-1;return c==d?l.pop():mo.call(l,c,1),--this.size,!0}function nb(s){var l=this.__data__,c=xo(l,s);return c<0?t:l[c][1]}function rb(s){return xo(this.__data__,s)>-1}function ib(s,l){var c=this.__data__,d=xo(c,s);return d<0?(++this.size,c.push([s,l])):c[d][1]=l,this}An.prototype.clear=eb,An.prototype.delete=tb,An.prototype.get=nb,An.prototype.has=rb,An.prototype.set=ib;function On(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 sb(){this.size=0,this.__data__={hash:new Cr,map:new(ss||An),string:new Cr}}function ob(s){var l=Lo(this,s).delete(s);return this.size-=l?1:0,l}function lb(s){return Lo(this,s).get(s)}function ab(s){return Lo(this,s).has(s)}function ub(s,l){var c=Lo(this,s),d=c.size;return c.set(s,l),this.size+=c.size==d?0:1,this}On.prototype.clear=sb,On.prototype.delete=ob,On.prototype.get=lb,On.prototype.has=ab,On.prototype.set=ub;function Ar(s){var l=-1,c=s==null?0:s.length;for(this.__data__=new On;++l<c;)this.add(s[l])}function cb(s){return this.__data__.set(s,f),this}function fb(s){return this.__data__.has(s)}Ar.prototype.add=Ar.prototype.push=cb,Ar.prototype.has=fb;function nn(s){var l=this.__data__=new An(s);this.size=l.size}function hb(){this.__data__=new An,this.size=0}function db(s){var l=this.__data__,c=l.delete(s);return this.size=l.size,c}function pb(s){return this.__data__.get(s)}function mb(s){return this.__data__.has(s)}function gb(s,l){var c=this.__data__;if(c instanceof An){var d=c.__data__;if(!ss||d.length<i-1)return d.push([s,l]),this.size=++c.size,this;c=this.__data__=new On(d)}return c.set(s,l),this.size=c.size,this}nn.prototype.clear=hb,nn.prototype.delete=db,nn.prototype.get=pb,nn.prototype.has=mb,nn.prototype.set=gb;function td(s,l){var c=ee(s),d=!c&&Lr(s),g=!c&&!d&&or(s),v=!c&&!d&&!g&&yi(s),x=c||d||g||v,_=x?Ka(s.length,M2):[],k=_.length;for(var I in s)(l||ve.call(s,I))&&!(x&&(I=="length"||g&&(I=="offset"||I=="parent")||v&&(I=="buffer"||I=="byteLength"||I=="byteOffset")||Ln(I,k)))&&_.push(I);return _}function nd(s){var l=s.length;return l?s[au(0,l-1)]:t}function yb(s,l){return Po(gt(s),Or(l,0,s.length))}function bb(s){return Po(gt(s))}function Za(s,l,c){(c!==t&&!rn(s[l],c)||c===t&&!(l in s))&&In(s,l,c)}function cs(s,l,c){var d=s[l];(!(ve.call(s,l)&&rn(d,c))||c===t&&!(l in s))&&In(s,l,c)}function xo(s,l){for(var c=s.length;c--;)if(rn(s[c][0],l))return c;return-1}function vb(s,l,c,d){return nr(s,function(g,v,x){l(d,g,c(g),x)}),d}function rd(s,l){return s&&gn(l,Ke(l),s)}function Sb(s,l){return s&&gn(l,bt(l),s)}function In(s,l,c){l=="__proto__"&&go?go(s,l,{configurable:!0,enumerable:!0,value:c,writable:!0}):s[l]=c}function Qa(s,l){for(var c=-1,d=l.length,g=C(d),v=s==null;++c<d;)g[c]=v?t:Ru(s,l[c]);return g}function Or(s,l,c){return s===s&&(c!==t&&(s=s<=c?s:c),l!==t&&(s=s>=l?s:l)),s}function Bt(s,l,c,d,g,v){var x,_=l&p,k=l&y,I=l&S;if(c&&(x=g?c(s,d,g,v):c(s)),x!==t)return x;if(!Te(s))return s;var N=ee(s);if(N){if(x=av(s),!_)return gt(s,x)}else{var R=ot(s),$=R==Qs||R==sh;if(or(s))return Td(s,_);if(R==Cn||R==Zt||$&&!g){if(x=k||$?{}:Gd(s),!_)return k?Xb(s,Sb(x,s)):Yb(s,rd(x,s))}else{if(!we[R])return g?s:{};x=uv(s,R,_)}}v||(v=new nn);var K=v.get(s);if(K)return K;v.set(s,x),wp(s)?s.forEach(function(Y){x.add(Bt(Y,l,c,Y,s,v))}):vp(s)&&s.forEach(function(Y,le){x.set(le,Bt(Y,l,c,le,s,v))});var j=I?k?vu:bu:k?bt:Ke,re=N?t:j(s);return Pt(re||s,function(Y,le){re&&(le=Y,Y=s[le]),cs(x,le,Bt(Y,l,c,le,s,v))}),x}function wb(s){var l=Ke(s);return function(c){return id(c,s,l)}}function id(s,l,c){var d=c.length;if(s==null)return!d;for(s=Se(s);d--;){var g=c[d],v=l[g],x=s[g];if(x===t&&!(g in s)||!v(x))return!1}return!0}function sd(s,l,c){if(typeof s!="function")throw new Dt(a);return ys(function(){s.apply(t,c)},l)}function fs(s,l,c,d){var g=-1,v=io,x=!0,_=s.length,k=[],I=l.length;if(!_)return k;c&&(l=Ee(l,_t(c))),d?(v=Fa,x=!1):l.length>=i&&(v=rs,x=!1,l=new Ar(l));e:for(;++g<_;){var N=s[g],R=c==null?N:c(N);if(N=d||N!==0?N:0,x&&R===R){for(var $=I;$--;)if(l[$]===R)continue e;k.push(N)}else v(l,R,d)||k.push(N)}return k}var nr=Nd(mn),od=Nd(tu,!0);function xb(s,l){var c=!0;return nr(s,function(d,g,v){return c=!!l(d,g,v),c}),c}function _o(s,l,c){for(var d=-1,g=s.length;++d<g;){var v=s[d],x=l(v);if(x!=null&&(_===t?x===x&&!kt(x):c(x,_)))var _=x,k=v}return k}function _b(s,l,c,d){var g=s.length;for(c=te(c),c<0&&(c=-c>g?0:g+c),d=d===t||d>g?g:te(d),d<0&&(d+=g),d=c>d?0:_p(d);c<d;)s[c++]=l;return s}function ld(s,l){var c=[];return nr(s,function(d,g,v){l(d,g,v)&&c.push(d)}),c}function Qe(s,l,c,d,g){var v=-1,x=s.length;for(c||(c=fv),g||(g=[]);++v<x;){var _=s[v];l>0&&c(_)?l>1?Qe(_,l-1,c,d,g):Qn(g,_):d||(g[g.length]=_)}return g}var eu=Rd(),ad=Rd(!0);function mn(s,l){return s&&eu(s,l,Ke)}function tu(s,l){return s&&ad(s,l,Ke)}function Eo(s,l){return Zn(l,function(c){return Pn(s[c])})}function Ir(s,l){l=ir(l,s);for(var c=0,d=l.length;s!=null&&c<d;)s=s[yn(l[c++])];return c&&c==d?s:t}function ud(s,l,c){var d=l(s);return ee(s)?d:Qn(d,c(s))}function ut(s){return s==null?s===t?Z1:Y1:Tr&&Tr in Se(s)?sv(s):bv(s)}function nu(s,l){return s>l}function Eb(s,l){return s!=null&&ve.call(s,l)}function kb(s,l){return s!=null&&l in Se(s)}function Mb(s,l,c){return s>=st(l,c)&&s<Be(l,c)}function ru(s,l,c){for(var d=c?Fa:io,g=s[0].length,v=s.length,x=v,_=C(v),k=1/0,I=[];x--;){var N=s[x];x&&l&&(N=Ee(N,_t(l))),k=st(N.length,k),_[x]=!c&&(l||g>=120&&N.length>=120)?new Ar(x&&N):t}N=s[0];var R=-1,$=_[0];e:for(;++R<g&&I.length<k;){var K=N[R],j=l?l(K):K;if(K=c||K!==0?K:0,!($?rs($,j):d(I,j,c))){for(x=v;--x;){var re=_[x];if(!(re?rs(re,j):d(s[x],j,c)))continue e}$&&$.push(j),I.push(K)}}return I}function Tb(s,l,c,d){return mn(s,function(g,v,x){l(d,c(g),v,x)}),d}function hs(s,l,c){l=ir(l,s),s=Yd(s,l);var d=s==null?s:s[yn($t(l))];return d==null?t:xt(d,s,c)}function cd(s){return Oe(s)&&ut(s)==Zt}function Cb(s){return Oe(s)&&ut(s)==ns}function Ab(s){return Oe(s)&&ut(s)==Xi}function ds(s,l,c,d,g){return s===l?!0:s==null||l==null||!Oe(s)&&!Oe(l)?s!==s&&l!==l:Ob(s,l,c,d,ds,g)}function Ob(s,l,c,d,g,v){var x=ee(s),_=ee(l),k=x?Xs:ot(s),I=_?Xs:ot(l);k=k==Zt?Cn:k,I=I==Zt?Cn:I;var N=k==Cn,R=I==Cn,$=k==I;if($&&or(s)){if(!or(l))return!1;x=!0,N=!1}if($&&!N)return v||(v=new nn),x||yi(s)?Ud(s,l,c,d,g,v):rv(s,l,k,c,d,g,v);if(!(c&w)){var K=N&&ve.call(s,"__wrapped__"),j=R&&ve.call(l,"__wrapped__");if(K||j){var re=K?s.value():s,Y=j?l.value():l;return v||(v=new nn),g(re,Y,c,d,v)}}return $?(v||(v=new nn),iv(s,l,c,d,g,v)):!1}function Ib(s){return Oe(s)&&ot(s)==Qt}function iu(s,l,c,d){var g=c.length,v=g,x=!d;if(s==null)return!v;for(s=Se(s);g--;){var _=c[g];if(x&&_[2]?_[1]!==s[_[0]]:!(_[0]in s))return!1}for(;++g<v;){_=c[g];var k=_[0],I=s[k],N=_[1];if(x&&_[2]){if(I===t&&!(k in s))return!1}else{var R=new nn;if(d)var $=d(I,N,k,s,l,R);if(!($===t?ds(N,I,w|M,d,R):$))return!1}}return!0}function fd(s){if(!Te(s)||dv(s))return!1;var l=Pn(s)?I2:wy;return l.test(Rr(s))}function Nb(s){return Oe(s)&&ut(s)==Qi}function Rb(s){return Oe(s)&&ot(s)==en}function Lb(s){return Oe(s)&&Ho(s.length)&&!!xe[ut(s)]}function hd(s){return typeof s=="function"?s:s==null?vt:typeof s=="object"?ee(s)?md(s[0],s[1]):pd(s):Lp(s)}function su(s){if(!gs(s))return z2(s);var l=[];for(var c in Se(s))ve.call(s,c)&&c!="constructor"&&l.push(c);return l}function Pb(s){if(!Te(s))return yv(s);var l=gs(s),c=[];for(var d in s)d=="constructor"&&(l||!ve.call(s,d))||c.push(d);return c}function ou(s,l){return s<l}function dd(s,l){var c=-1,d=yt(s)?C(s.length):[];return nr(s,function(g,v,x){d[++c]=l(g,v,x)}),d}function pd(s){var l=wu(s);return l.length==1&&l[0][2]?Jd(l[0][0],l[0][1]):function(c){return c===s||iu(c,s,l)}}function md(s,l){return _u(s)&&qd(l)?Jd(yn(s),l):function(c){var d=Ru(c,s);return d===t&&d===l?Lu(c,s):ds(l,d,w|M)}}function ko(s,l,c,d,g){s!==l&&eu(l,function(v,x){if(g||(g=new nn),Te(v))Db(s,l,x,c,ko,d,g);else{var _=d?d(ku(s,x),v,x+"",s,l,g):t;_===t&&(_=v),Za(s,x,_)}},bt)}function Db(s,l,c,d,g,v,x){var _=ku(s,c),k=ku(l,c),I=x.get(k);if(I){Za(s,c,I);return}var N=v?v(_,k,c+"",s,l,x):t,R=N===t;if(R){var $=ee(k),K=!$&&or(k),j=!$&&!K&&yi(k);N=k,$||K||j?ee(_)?N=_:Ie(_)?N=gt(_):K?(R=!1,N=Td(k,!0)):j?(R=!1,N=Cd(k,!0)):N=[]:bs(k)||Lr(k)?(N=_,Lr(_)?N=Ep(_):(!Te(_)||Pn(_))&&(N=Gd(k))):R=!1}R&&(x.set(k,N),g(N,k,d,v,x),x.delete(k)),Za(s,c,N)}function gd(s,l){var c=s.length;if(c)return l+=l<0?c:0,Ln(l,c)?s[l]:t}function yd(s,l,c){l.length?l=Ee(l,function(v){return ee(v)?function(x){return Ir(x,v.length===1?v[0]:v)}:v}):l=[vt];var d=-1;l=Ee(l,_t(J()));var g=dd(s,function(v,x,_){var k=Ee(l,function(I){return I(v)});return{criteria:k,index:++d,value:v}});return u2(g,function(v,x){return jb(v,x,c)})}function zb(s,l){return bd(s,l,function(c,d){return Lu(s,d)})}function bd(s,l,c){for(var d=-1,g=l.length,v={};++d<g;){var x=l[d],_=Ir(s,x);c(_,x)&&ps(v,ir(x,s),_)}return v}function Bb(s){return function(l){return Ir(l,s)}}function lu(s,l,c,d){var g=d?a2:oi,v=-1,x=l.length,_=s;for(s===l&&(l=gt(l)),c&&(_=Ee(s,_t(c)));++v<x;)for(var k=0,I=l[v],N=c?c(I):I;(k=g(_,N,k,d))>-1;)_!==s&&mo.call(_,k,1),mo.call(s,k,1);return s}function vd(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;Ln(g)?mo.call(s,g,1):fu(s,g)}}return s}function au(s,l){return s+bo(Qh()*(l-s+1))}function Fb(s,l,c,d){for(var g=-1,v=Be(yo((l-s)/(c||1)),0),x=C(v);v--;)x[d?v:++g]=s,s+=c;return x}function uu(s,l){var c="";if(!s||l<1||l>Ue)return c;do l%2&&(c+=s),l=bo(l/2),l&&(s+=s);while(l);return c}function se(s,l){return Mu(jd(s,l,vt),s+"")}function $b(s){return nd(bi(s))}function Hb(s,l){var c=bi(s);return Po(c,Or(l,0,c.length))}function ps(s,l,c,d){if(!Te(s))return s;l=ir(l,s);for(var g=-1,v=l.length,x=v-1,_=s;_!=null&&++g<v;){var k=yn(l[g]),I=c;if(k==="__proto__"||k==="constructor"||k==="prototype")return s;if(g!=x){var N=_[k];I=d?d(N,k,_):t,I===t&&(I=Te(N)?N:Ln(l[g+1])?[]:{})}cs(_,k,I),_=_[k]}return s}var Sd=vo?function(s,l){return vo.set(s,l),s}:vt,Wb=go?function(s,l){return go(s,"toString",{configurable:!0,enumerable:!1,value:Du(l),writable:!0})}:vt;function Ub(s){return Po(bi(s))}function Ft(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=C(g);++d<g;)v[d]=s[d+l];return v}function Vb(s,l){var c;return nr(s,function(d,g,v){return c=l(d,g,v),!c}),!!c}function Mo(s,l,c){var d=0,g=s==null?d:s.length;if(typeof l=="number"&&l===l&&g<=Xn){for(;d<g;){var v=d+g>>>1,x=s[v];x!==null&&!kt(x)&&(c?x<=l:x<l)?d=v+1:g=v}return g}return cu(s,l,vt,c)}function cu(s,l,c,d){var g=0,v=s==null?0:s.length;if(v===0)return 0;l=c(l);for(var x=l!==l,_=l===null,k=kt(l),I=l===t;g<v;){var N=bo((g+v)/2),R=c(s[N]),$=R!==t,K=R===null,j=R===R,re=kt(R);if(x)var Y=d||j;else I?Y=j&&(d||$):_?Y=j&&$&&(d||!K):k?Y=j&&$&&!K&&(d||!re):K||re?Y=!1:Y=d?R<=l:R<l;Y?g=N+1:v=N}return st(v,Yn)}function wd(s,l){for(var c=-1,d=s.length,g=0,v=[];++c<d;){var x=s[c],_=l?l(x):x;if(!c||!rn(_,k)){var k=_;v[g++]=x===0?0:x}}return v}function xd(s){return typeof s=="number"?s:kt(s)?it:+s}function Et(s){if(typeof s=="string")return s;if(ee(s))return Ee(s,Et)+"";if(kt(s))return ed?ed.call(s):"";var l=s+"";return l=="0"&&1/s==-We?"-0":l}function rr(s,l,c){var d=-1,g=io,v=s.length,x=!0,_=[],k=_;if(c)x=!1,g=Fa;else if(v>=i){var I=l?null:tv(s);if(I)return oo(I);x=!1,g=rs,k=new Ar}else k=l?[]:_;e:for(;++d<v;){var N=s[d],R=l?l(N):N;if(N=c||N!==0?N:0,x&&R===R){for(var $=k.length;$--;)if(k[$]===R)continue e;l&&k.push(R),_.push(N)}else g(k,R,c)||(k!==_&&k.push(R),_.push(N))}return _}function fu(s,l){return l=ir(l,s),s=Yd(s,l),s==null||delete s[yn($t(l))]}function _d(s,l,c,d){return ps(s,l,c(Ir(s,l)),d)}function To(s,l,c,d){for(var g=s.length,v=d?g:-1;(d?v--:++v<g)&&l(s[v],v,s););return c?Ft(s,d?0:v,d?v+1:g):Ft(s,d?v+1:0,d?g:v)}function Ed(s,l){var c=s;return c instanceof ue&&(c=c.value()),$a(l,function(d,g){return g.func.apply(g.thisArg,Qn([d],g.args))},c)}function hu(s,l,c){var d=s.length;if(d<2)return d?rr(s[0]):[];for(var g=-1,v=C(d);++g<d;)for(var x=s[g],_=-1;++_<d;)_!=g&&(v[g]=fs(v[g]||x,s[_],l,c));return rr(Qe(v,1),l,c)}function kd(s,l,c){for(var d=-1,g=s.length,v=l.length,x={};++d<g;){var _=d<v?l[d]:t;c(x,s[d],_)}return x}function du(s){return Ie(s)?s:[]}function pu(s){return typeof s=="function"?s:vt}function ir(s,l){return ee(s)?s:_u(s,l)?[s]:ep(ye(s))}var Kb=se;function sr(s,l,c){var d=s.length;return c=c===t?d:c,!l&&c>=d?s:Ft(s,l,c)}var Md=N2||function(s){return Ze.clearTimeout(s)};function Td(s,l){if(l)return s.slice();var c=s.length,d=Jh?Jh(c):new s.constructor(c);return s.copy(d),d}function mu(s){var l=new s.constructor(s.byteLength);return new ho(l).set(new ho(s)),l}function Gb(s,l){var c=l?mu(s.buffer):s.buffer;return new s.constructor(c,s.byteOffset,s.byteLength)}function qb(s){var l=new s.constructor(s.source,ch.exec(s));return l.lastIndex=s.lastIndex,l}function Jb(s){return us?Se(us.call(s)):{}}function Cd(s,l){var c=l?mu(s.buffer):s.buffer;return new s.constructor(c,s.byteOffset,s.length)}function Ad(s,l){if(s!==l){var c=s!==t,d=s===null,g=s===s,v=kt(s),x=l!==t,_=l===null,k=l===l,I=kt(l);if(!_&&!I&&!v&&s>l||v&&x&&k&&!_&&!I||d&&x&&k||!c&&k||!g)return 1;if(!d&&!v&&!I&&s<l||I&&c&&g&&!d&&!v||_&&c&&g||!x&&g||!k)return-1}return 0}function jb(s,l,c){for(var d=-1,g=s.criteria,v=l.criteria,x=g.length,_=c.length;++d<x;){var k=Ad(g[d],v[d]);if(k){if(d>=_)return k;var I=c[d];return k*(I=="desc"?-1:1)}}return s.index-l.index}function Od(s,l,c,d){for(var g=-1,v=s.length,x=c.length,_=-1,k=l.length,I=Be(v-x,0),N=C(k+I),R=!d;++_<k;)N[_]=l[_];for(;++g<x;)(R||g<v)&&(N[c[g]]=s[g]);for(;I--;)N[_++]=s[g++];return N}function Id(s,l,c,d){for(var g=-1,v=s.length,x=-1,_=c.length,k=-1,I=l.length,N=Be(v-_,0),R=C(N+I),$=!d;++g<N;)R[g]=s[g];for(var K=g;++k<I;)R[K+k]=l[k];for(;++x<_;)($||g<v)&&(R[K+c[x]]=s[g++]);return R}function gt(s,l){var c=-1,d=s.length;for(l||(l=C(d));++c<d;)l[c]=s[c];return l}function gn(s,l,c,d){var g=!c;c||(c={});for(var v=-1,x=l.length;++v<x;){var _=l[v],k=d?d(c[_],s[_],_,c,s):t;k===t&&(k=s[_]),g?In(c,_,k):cs(c,_,k)}return c}function Yb(s,l){return gn(s,xu(s),l)}function Xb(s,l){return gn(s,Vd(s),l)}function Co(s,l){return function(c,d){var g=ee(c)?n2:vb,v=l?l():{};return g(c,s,J(d,2),v)}}function pi(s){return se(function(l,c){var d=-1,g=c.length,v=g>1?c[g-1]:t,x=g>2?c[2]:t;for(v=s.length>3&&typeof v=="function"?(g--,v):t,x&&ct(c[0],c[1],x)&&(v=g<3?t:v,g=1),l=Se(l);++d<g;){var _=c[d];_&&s(l,_,d,v)}return l})}function Nd(s,l){return function(c,d){if(c==null)return c;if(!yt(c))return s(c,d);for(var g=c.length,v=l?g:-1,x=Se(c);(l?v--:++v<g)&&d(x[v],v,x)!==!1;);return c}}function Rd(s){return function(l,c,d){for(var g=-1,v=Se(l),x=d(l),_=x.length;_--;){var k=x[s?_:++g];if(c(v[k],k,v)===!1)break}return l}}function Zb(s,l,c){var d=l&T,g=ms(s);function v(){var x=this&&this!==Ze&&this instanceof v?g:s;return x.apply(d?c:this,arguments)}return v}function Ld(s){return function(l){l=ye(l);var c=li(l)?tn(l):t,d=c?c[0]:l.charAt(0),g=c?sr(c,1).join(""):l.slice(1);return d[s]()+g}}function mi(s){return function(l){return $a(Np(Ip(l).replace(Wy,"")),s,"")}}function ms(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=di(s.prototype),d=s.apply(c,l);return Te(d)?d:c}}function Qb(s,l,c){var d=ms(s);function g(){for(var v=arguments.length,x=C(v),_=v,k=gi(g);_--;)x[_]=arguments[_];var I=v<3&&x[0]!==k&&x[v-1]!==k?[]:er(x,k);if(v-=I.length,v<c)return Fd(s,l,Ao,g.placeholder,t,x,I,t,t,c-v);var N=this&&this!==Ze&&this instanceof g?d:s;return xt(N,this,x)}return g}function Pd(s){return function(l,c,d){var g=Se(l);if(!yt(l)){var v=J(c,3);l=Ke(l),c=function(_){return v(g[_],_,g)}}var x=s(l,c,d);return x>-1?g[v?l[x]:x]:t}}function Dd(s){return Rn(function(l){var c=l.length,d=c,g=zt.prototype.thru;for(s&&l.reverse();d--;){var v=l[d];if(typeof v!="function")throw new Dt(a);if(g&&!x&&Ro(v)=="wrapper")var x=new zt([],!0)}for(d=x?d:c;++d<c;){v=l[d];var _=Ro(v),k=_=="wrapper"?Su(v):t;k&&Eu(k[0])&&k[1]==(ie|B|X|Me)&&!k[4].length&&k[9]==1?x=x[Ro(k[0])].apply(x,k[3]):x=v.length==1&&Eu(v)?x[_]():x.thru(v)}return function(){var I=arguments,N=I[0];if(x&&I.length==1&&ee(N))return x.plant(N).value();for(var R=0,$=c?l[R].apply(this,I):N;++R<c;)$=l[R].call(this,$);return $}})}function Ao(s,l,c,d,g,v,x,_,k,I){var N=l&ie,R=l&T,$=l&O,K=l&(B|H),j=l&jt,re=$?t:ms(s);function Y(){for(var le=arguments.length,fe=C(le),Mt=le;Mt--;)fe[Mt]=arguments[Mt];if(K)var ft=gi(Y),Tt=f2(fe,ft);if(d&&(fe=Od(fe,d,g,K)),v&&(fe=Id(fe,v,x,K)),le-=Tt,K&&le<I){var Ne=er(fe,ft);return Fd(s,l,Ao,Y.placeholder,c,fe,Ne,_,k,I-le)}var sn=R?c:this,zn=$?sn[s]:s;return le=fe.length,_?fe=vv(fe,_):j&&le>1&&fe.reverse(),N&&k<le&&(fe.length=k),this&&this!==Ze&&this instanceof Y&&(zn=re||ms(zn)),zn.apply(sn,fe)}return Y}function zd(s,l){return function(c,d){return Tb(c,s,l(d),{})}}function Oo(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=Et(c),d=Et(d)):(c=xd(c),d=xd(d)),g=s(c,d)}return g}}function gu(s){return Rn(function(l){return l=Ee(l,_t(J())),se(function(c){var d=this;return s(l,function(g){return xt(g,d,c)})})})}function Io(s,l){l=l===t?" ":Et(l);var c=l.length;if(c<2)return c?uu(l,s):l;var d=uu(l,yo(s/ai(l)));return li(l)?sr(tn(d),0,s).join(""):d.slice(0,s)}function ev(s,l,c,d){var g=l&T,v=ms(s);function x(){for(var _=-1,k=arguments.length,I=-1,N=d.length,R=C(N+k),$=this&&this!==Ze&&this instanceof x?v:s;++I<N;)R[I]=d[I];for(;k--;)R[I++]=arguments[++_];return xt($,g?c:this,R)}return x}function Bd(s){return function(l,c,d){return d&&typeof d!="number"&&ct(l,c,d)&&(c=d=t),l=Dn(l),c===t?(c=l,l=0):c=Dn(c),d=d===t?l<c?1:-1:Dn(d),Fb(l,c,d,s)}}function No(s){return function(l,c){return typeof l=="string"&&typeof c=="string"||(l=Ht(l),c=Ht(c)),s(l,c)}}function Fd(s,l,c,d,g,v,x,_,k,I){var N=l&B,R=N?x:t,$=N?t:x,K=N?v:t,j=N?t:v;l|=N?X:q,l&=~(N?q:X),l&F||(l&=~(T|O));var re=[s,l,g,K,R,j,$,_,k,I],Y=c.apply(t,re);return Eu(s)&&Xd(Y,re),Y.placeholder=d,Zd(Y,s,l)}function yu(s){var l=ze[s];return function(c,d){if(c=Ht(c),d=d==null?0:st(te(d),292),d&&Zh(c)){var g=(ye(c)+"e").split("e"),v=l(g[0]+"e"+(+g[1]+d));return g=(ye(v)+"e").split("e"),+(g[0]+"e"+(+g[1]-d))}return l(c)}}var tv=fi&&1/oo(new fi([,-0]))[1]==We?function(s){return new fi(s)}:Fu;function $d(s){return function(l){var c=ot(l);return c==Qt?qa(l):c==en?b2(l):c2(l,s(l))}}function Nn(s,l,c,d,g,v,x,_){var k=l&O;if(!k&&typeof s!="function")throw new Dt(a);var I=d?d.length:0;if(I||(l&=~(X|q),d=g=t),x=x===t?x:Be(te(x),0),_=_===t?_:te(_),I-=g?g.length:0,l&q){var N=d,R=g;d=g=t}var $=k?t:Su(s),K=[s,l,c,d,g,N,R,v,x,_];if($&&gv(K,$),s=K[0],l=K[1],c=K[2],d=K[3],g=K[4],_=K[9]=K[9]===t?k?0:s.length:Be(K[9]-I,0),!_&&l&(B|H)&&(l&=~(B|H)),!l||l==T)var j=Zb(s,l,c);else l==B||l==H?j=Qb(s,l,_):(l==X||l==(T|X))&&!g.length?j=ev(s,l,c,d):j=Ao.apply(t,K);var re=$?Sd:Xd;return Zd(re(j,K),s,l)}function Hd(s,l,c,d){return s===t||rn(s,ci[c])&&!ve.call(d,c)?l:s}function Wd(s,l,c,d,g,v){return Te(s)&&Te(l)&&(v.set(l,s),ko(s,l,t,Wd,v),v.delete(l)),s}function nv(s){return bs(s)?t:s}function Ud(s,l,c,d,g,v){var x=c&w,_=s.length,k=l.length;if(_!=k&&!(x&&k>_))return!1;var I=v.get(s),N=v.get(l);if(I&&N)return I==l&&N==s;var R=-1,$=!0,K=c&M?new Ar:t;for(v.set(s,l),v.set(l,s);++R<_;){var j=s[R],re=l[R];if(d)var Y=x?d(re,j,R,l,s,v):d(j,re,R,s,l,v);if(Y!==t){if(Y)continue;$=!1;break}if(K){if(!Ha(l,function(le,fe){if(!rs(K,fe)&&(j===le||g(j,le,c,d,v)))return K.push(fe)})){$=!1;break}}else if(!(j===re||g(j,re,c,d,v))){$=!1;break}}return v.delete(s),v.delete(l),$}function rv(s,l,c,d,g,v,x){switch(c){case ii:if(s.byteLength!=l.byteLength||s.byteOffset!=l.byteOffset)return!1;s=s.buffer,l=l.buffer;case ns:return!(s.byteLength!=l.byteLength||!v(new ho(s),new ho(l)));case Yi:case Xi:case Zi:return rn(+s,+l);case Zs:return s.name==l.name&&s.message==l.message;case Qi:case es:return s==l+"";case Qt:var _=qa;case en:var k=d&w;if(_||(_=oo),s.size!=l.size&&!k)return!1;var I=x.get(s);if(I)return I==l;d|=M,x.set(s,l);var N=Ud(_(s),_(l),d,g,v,x);return x.delete(s),N;case eo:if(us)return us.call(s)==us.call(l)}return!1}function iv(s,l,c,d,g,v){var x=c&w,_=bu(s),k=_.length,I=bu(l),N=I.length;if(k!=N&&!x)return!1;for(var R=k;R--;){var $=_[R];if(!(x?$ in l:ve.call(l,$)))return!1}var K=v.get(s),j=v.get(l);if(K&&j)return K==l&&j==s;var re=!0;v.set(s,l),v.set(l,s);for(var Y=x;++R<k;){$=_[R];var le=s[$],fe=l[$];if(d)var Mt=x?d(fe,le,$,l,s,v):d(le,fe,$,s,l,v);if(!(Mt===t?le===fe||g(le,fe,c,d,v):Mt)){re=!1;break}Y||(Y=$=="constructor")}if(re&&!Y){var ft=s.constructor,Tt=l.constructor;ft!=Tt&&"constructor"in s&&"constructor"in l&&!(typeof ft=="function"&&ft instanceof ft&&typeof Tt=="function"&&Tt instanceof Tt)&&(re=!1)}return v.delete(s),v.delete(l),re}function Rn(s){return Mu(jd(s,t,ip),s+"")}function bu(s){return ud(s,Ke,xu)}function vu(s){return ud(s,bt,Vd)}var Su=vo?function(s){return vo.get(s)}:Fu;function Ro(s){for(var l=s.name+"",c=hi[l],d=ve.call(hi,l)?c.length:0;d--;){var g=c[d],v=g.func;if(v==null||v==s)return g.name}return l}function gi(s){var l=ve.call(b,"placeholder")?b:s;return l.placeholder}function J(){var s=b.iteratee||zu;return s=s===zu?hd:s,arguments.length?s(arguments[0],arguments[1]):s}function Lo(s,l){var c=s.__data__;return hv(l)?c[typeof l=="string"?"string":"hash"]:c.map}function wu(s){for(var l=Ke(s),c=l.length;c--;){var d=l[c],g=s[d];l[c]=[d,g,qd(g)]}return l}function Nr(s,l){var c=m2(s,l);return fd(c)?c:t}function sv(s){var l=ve.call(s,Tr),c=s[Tr];try{s[Tr]=t;var d=!0}catch{}var g=co.call(s);return d&&(l?s[Tr]=c:delete s[Tr]),g}var xu=ja?function(s){return s==null?[]:(s=Se(s),Zn(ja(s),function(l){return Yh.call(s,l)}))}:$u,Vd=ja?function(s){for(var l=[];s;)Qn(l,xu(s)),s=po(s);return l}:$u,ot=ut;(Ya&&ot(new Ya(new ArrayBuffer(1)))!=ii||ss&&ot(new ss)!=Qt||Xa&&ot(Xa.resolve())!=oh||fi&&ot(new fi)!=en||ls&&ot(new ls)!=ts)&&(ot=function(s){var l=ut(s),c=l==Cn?s.constructor:t,d=c?Rr(c):"";if(d)switch(d){case H2:return ii;case W2:return Qt;case U2:return oh;case V2:return en;case K2:return ts}return l});function ov(s,l,c){for(var d=-1,g=c.length;++d<g;){var v=c[d],x=v.size;switch(v.type){case"drop":s+=x;break;case"dropRight":l-=x;break;case"take":l=st(l,s+x);break;case"takeRight":s=Be(s,l-x);break}}return{start:s,end:l}}function lv(s){var l=s.match(dy);return l?l[1].split(py):[]}function Kd(s,l,c){l=ir(l,s);for(var d=-1,g=l.length,v=!1;++d<g;){var x=yn(l[d]);if(!(v=s!=null&&c(s,x)))break;s=s[x]}return v||++d!=g?v:(g=s==null?0:s.length,!!g&&Ho(g)&&Ln(x,g)&&(ee(s)||Lr(s)))}function av(s){var l=s.length,c=new s.constructor(l);return l&&typeof s[0]=="string"&&ve.call(s,"index")&&(c.index=s.index,c.input=s.input),c}function Gd(s){return typeof s.constructor=="function"&&!gs(s)?di(po(s)):{}}function uv(s,l,c){var d=s.constructor;switch(l){case ns:return mu(s);case Yi:case Xi:return new d(+s);case ii:return Gb(s,c);case wa:case xa:case _a:case Ea:case ka:case Ma:case Ta:case Ca:case Aa:return Cd(s,c);case Qt:return new d;case Zi:case es:return new d(s);case Qi:return qb(s);case en:return new d;case eo:return Jb(s)}}function cv(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(hy,`{
20
20
  /* [wrapped with `+l+`] */
21
- `)}function fv(s){return ee(s)||Lr(s)||!!(Xd&&s&&s[Xd])}function Ln(s,l){var c=typeof s;return l=l??Ue,!!l&&(c=="number"||c!="symbol"&&_y.test(s))&&s>-1&&s%1==0&&s<l}function ct(s,l,c){if(!Te(c))return!1;var h=typeof l;return(h=="number"?yt(c)&&Ln(l,c.length):h=="string"&&l in c)?rn(c[l],s):!1}function _u(s,l){if(ee(s))return!1;var c=typeof s;return c=="number"||c=="symbol"||c=="boolean"||s==null||Et(s)?!0:ay.test(s)||!ly.test(s)||l!=null&&s in Se(l)}function dv(s){var l=typeof s;return l=="string"||l=="number"||l=="symbol"||l=="boolean"?s!=="__proto__":s===null}function ku(s){var l=Ro(s),c=b[l];if(typeof c!="function"||!(l in ue.prototype))return!1;if(s===c)return!0;var h=Su(c);return!!h&&s===h[0]}function hv(s){return!!qd&&qd in s}var pv=ao?Pn:Hu;function gs(s){var l=s&&s.constructor,c=typeof l=="function"&&l.prototype||ci;return s===c}function qh(s){return s===s&&!Te(s)}function Jh(s,l){return function(c){return c==null?!1:c[s]===l&&(l!==t||s in Se(c))}}function mv(s){var l=Fo(s,function(h){return c.size===d&&c.clear(),h}),c=l.cache;return l}function gv(s,l){var c=s[1],h=l[1],g=c|h,v=g<(T|O|ie),x=h==ie&&c==B||h==ie&&c==Me&&s[7].length<=l[8]||h==(ie|Me)&&l[7].length<=l[8]&&c==B;if(!(v||x))return s;h&T&&(s[2]=l[2],g|=c&T?0:F);var _=l[3];if(_){var E=s[3];s[3]=E?Oh(E,_,l[4]):_,s[4]=E?er(s[3],m):l[4]}return _=l[5],_&&(E=s[5],s[5]=E?Ih(E,_,l[6]):_,s[6]=E?er(s[5],m):l[6]),_=l[7],_&&(s[7]=_),h&ie&&(s[8]=s[8]==null?l[8]:st(s[8],l[8])),s[9]==null&&(s[9]=l[9]),s[0]=l[0],s[1]=g,s}function yv(s){var l=[];if(s!=null)for(var c in Se(s))l.push(c);return l}function bv(s){return co.call(s)}function jh(s,l,c){return l=Be(l===t?s.length-1:l,0),function(){for(var h=arguments,g=-1,v=Be(h.length-l,0),x=C(v);++g<v;)x[g]=h[l+g];g=-1;for(var _=C(l+1);++g<l;)_[g]=h[g];return _[l]=c(x),xt(s,this,_)}}function Yh(s,l){return l.length<2?s:Ir(s,Ft(l,0,-1))}function vv(s,l){for(var c=s.length,h=st(l.length,c),g=gt(s);h--;){var v=l[h];s[h]=Ln(v,c)?g[v]:t}return s}function Eu(s,l){if(!(l==="constructor"&&typeof s[l]=="function")&&l!="__proto__")return s[l]}var Xh=Qh(Sh),ys=L2||function(s,l){return Ze.setTimeout(s,l)},Mu=Qh(Wb);function Zh(s,l,c){var h=l+"";return Mu(s,cv(h,Sv(lv(h),c)))}function Qh(s){var l=0,c=0;return function(){var h=B2(),g=jn-(h-c);if(c=h,g>0){if(++l>=pn)return arguments[0]}else l=0;return s.apply(t,arguments)}}function Po(s,l){var c=-1,h=s.length,g=h-1;for(l=l===t?h:l;++c<l;){var v=au(c,g),x=s[v];s[v]=s[c],s[c]=x}return s.length=l,s}var ep=mv(function(s){var l=[];return s.charCodeAt(0)===46&&l.push(""),s.replace(uy,function(c,h,g,v){l.push(g?v.replace(yy,"$1"):h||c)}),l});function yn(s){if(typeof s=="string"||Et(s))return s;var l=s+"";return l=="0"&&1/s==-We?"-0":l}function Rr(s){if(s!=null){try{return uo.call(s)}catch{}try{return s+""}catch{}}return""}function Sv(s,l){return Pt(Sa,function(c){var h="_."+c[0];l&c[1]&&!io(s,h)&&s.push(h)}),s.sort()}function tp(s){if(s instanceof ue)return s.clone();var l=new zt(s.__wrapped__,s.__chain__);return l.__actions__=gt(s.__actions__),l.__index__=s.__index__,l.__values__=s.__values__,l}function wv(s,l,c){(c?ct(s,l,c):l===t)?l=1:l=Be(te(l),0);var h=s==null?0:s.length;if(!h||l<1)return[];for(var g=0,v=0,x=C(yo(h/l));g<h;)x[v++]=Ft(s,g,g+=l);return x}function xv(s){for(var l=-1,c=s==null?0:s.length,h=0,g=[];++l<c;){var v=s[l];v&&(g[h++]=v)}return g}function _v(){var s=arguments.length;if(!s)return[];for(var l=C(s-1),c=arguments[0],h=s;h--;)l[h-1]=arguments[h];return Qn(ee(c)?gt(c):[c],Qe(l,1))}var kv=se(function(s,l){return Ie(s)?fs(s,Qe(l,1,Ie,!0)):[]}),Ev=se(function(s,l){var c=$t(l);return Ie(c)&&(c=t),Ie(s)?fs(s,Qe(l,1,Ie,!0),J(c,2)):[]}),Mv=se(function(s,l){var c=$t(l);return Ie(c)&&(c=t),Ie(s)?fs(s,Qe(l,1,Ie,!0),t,c):[]});function Tv(s,l,c){var h=s==null?0:s.length;return h?(l=c||l===t?1:te(l),Ft(s,l<0?0:l,h)):[]}function Cv(s,l,c){var h=s==null?0:s.length;return h?(l=c||l===t?1:te(l),l=h-l,Ft(s,0,l<0?0:l)):[]}function Av(s,l){return s&&s.length?To(s,J(l,3),!0,!0):[]}function Ov(s,l){return s&&s.length?To(s,J(l,3),!0):[]}function Iv(s,l,c,h){var g=s==null?0:s.length;return g?(c&&typeof c!="number"&&ct(s,l,c)&&(c=0,h=g),_b(s,l,c,h)):[]}function np(s,l,c){var h=s==null?0:s.length;if(!h)return-1;var g=c==null?0:te(c);return g<0&&(g=Be(h+g,0)),so(s,J(l,3),g)}function rp(s,l,c){var h=s==null?0:s.length;if(!h)return-1;var g=h-1;return c!==t&&(g=te(c),g=c<0?Be(h+g,0):st(g,h-1)),so(s,J(l,3),g,!0)}function ip(s){var l=s==null?0:s.length;return l?Qe(s,1):[]}function Nv(s){var l=s==null?0:s.length;return l?Qe(s,We):[]}function Rv(s,l){var c=s==null?0:s.length;return c?(l=l===t?1:te(l),Qe(s,l)):[]}function Lv(s){for(var l=-1,c=s==null?0:s.length,h={};++l<c;){var g=s[l];h[g[0]]=g[1]}return h}function sp(s){return s&&s.length?s[0]:t}function Pv(s,l,c){var h=s==null?0:s.length;if(!h)return-1;var g=c==null?0:te(c);return g<0&&(g=Be(h+g,0)),oi(s,l,g)}function Dv(s){var l=s==null?0:s.length;return l?Ft(s,0,-1):[]}var zv=se(function(s){var l=ke(s,hu);return l.length&&l[0]===s[0]?ru(l):[]}),Bv=se(function(s){var l=$t(s),c=ke(s,hu);return l===$t(c)?l=t:c.pop(),c.length&&c[0]===s[0]?ru(c,J(l,2)):[]}),Fv=se(function(s){var l=$t(s),c=ke(s,hu);return l=typeof l=="function"?l:t,l&&c.pop(),c.length&&c[0]===s[0]?ru(c,t,l):[]});function $v(s,l){return s==null?"":D2.call(s,l)}function $t(s){var l=s==null?0:s.length;return l?s[l-1]:t}function Hv(s,l,c){var h=s==null?0:s.length;if(!h)return-1;var g=h;return c!==t&&(g=te(c),g=g<0?Be(h+g,0):st(g,h-1)),l===l?S2(s,l,g):so(s,Fd,g,!0)}function Wv(s,l){return s&&s.length?gh(s,te(l)):t}var Uv=se(op);function op(s,l){return s&&s.length&&l&&l.length?lu(s,l):s}function Vv(s,l,c){return s&&s.length&&l&&l.length?lu(s,l,J(c,2)):s}function Kv(s,l,c){return s&&s.length&&l&&l.length?lu(s,l,t,c):s}var Gv=Rn(function(s,l){var c=s==null?0:s.length,h=Qa(s,l);return vh(s,ke(l,function(g){return Ln(g,c)?+g:g}).sort(Ah)),h});function qv(s,l){var c=[];if(!(s&&s.length))return c;var h=-1,g=[],v=s.length;for(l=J(l,3);++h<v;){var x=s[h];l(x,h,s)&&(c.push(x),g.push(h))}return vh(s,g),c}function Tu(s){return s==null?s:$2.call(s)}function Jv(s,l,c){var h=s==null?0:s.length;return h?(c&&typeof c!="number"&&ct(s,l,c)?(l=0,c=h):(l=l==null?0:te(l),c=c===t?h:te(c)),Ft(s,l,c)):[]}function jv(s,l){return Mo(s,l)}function Yv(s,l,c){return cu(s,l,J(c,2))}function Xv(s,l){var c=s==null?0:s.length;if(c){var h=Mo(s,l);if(h<c&&rn(s[h],l))return h}return-1}function Zv(s,l){return Mo(s,l,!0)}function Qv(s,l,c){return cu(s,l,J(c,2),!0)}function eS(s,l){var c=s==null?0:s.length;if(c){var h=Mo(s,l,!0)-1;if(rn(s[h],l))return h}return-1}function tS(s){return s&&s.length?wh(s):[]}function nS(s,l){return s&&s.length?wh(s,J(l,2)):[]}function rS(s){var l=s==null?0:s.length;return l?Ft(s,1,l):[]}function iS(s,l,c){return s&&s.length?(l=c||l===t?1:te(l),Ft(s,0,l<0?0:l)):[]}function sS(s,l,c){var h=s==null?0:s.length;return h?(l=c||l===t?1:te(l),l=h-l,Ft(s,l<0?0:l,h)):[]}function oS(s,l){return s&&s.length?To(s,J(l,3),!1,!0):[]}function lS(s,l){return s&&s.length?To(s,J(l,3)):[]}var aS=se(function(s){return rr(Qe(s,1,Ie,!0))}),uS=se(function(s){var l=$t(s);return Ie(l)&&(l=t),rr(Qe(s,1,Ie,!0),J(l,2))}),cS=se(function(s){var l=$t(s);return l=typeof l=="function"?l:t,rr(Qe(s,1,Ie,!0),t,l)});function fS(s){return s&&s.length?rr(s):[]}function dS(s,l){return s&&s.length?rr(s,J(l,2)):[]}function hS(s,l){return l=typeof l=="function"?l:t,s&&s.length?rr(s,t,l):[]}function Cu(s){if(!(s&&s.length))return[];var l=0;return s=Zn(s,function(c){if(Ie(c))return l=Be(c.length,l),!0}),Ka(l,function(c){return ke(s,Wa(c))})}function lp(s,l){if(!(s&&s.length))return[];var c=Cu(s);return l==null?c:ke(c,function(h){return xt(l,t,h)})}var pS=se(function(s,l){return Ie(s)?fs(s,l):[]}),mS=se(function(s){return du(Zn(s,Ie))}),gS=se(function(s){var l=$t(s);return Ie(l)&&(l=t),du(Zn(s,Ie),J(l,2))}),yS=se(function(s){var l=$t(s);return l=typeof l=="function"?l:t,du(Zn(s,Ie),t,l)}),bS=se(Cu);function vS(s,l){return Eh(s||[],l||[],cs)}function SS(s,l){return Eh(s||[],l||[],ps)}var wS=se(function(s){var l=s.length,c=l>1?s[l-1]:t;return c=typeof c=="function"?(s.pop(),c):t,lp(s,c)});function ap(s){var l=b(s);return l.__chain__=!0,l}function xS(s,l){return l(s),s}function Do(s,l){return l(s)}var _S=Rn(function(s){var l=s.length,c=l?s[0]:0,h=this.__wrapped__,g=function(v){return Qa(v,s)};return l>1||this.__actions__.length||!(h instanceof ue)||!Ln(c)?this.thru(g):(h=h.slice(c,+c+(l?1:0)),h.__actions__.push({func:Do,args:[g],thisArg:t}),new zt(h,this.__chain__).thru(function(v){return l&&!v.length&&v.push(t),v}))});function kS(){return ap(this)}function ES(){return new zt(this.value(),this.__chain__)}function MS(){this.__values__===t&&(this.__values__=xp(this.value()));var s=this.__index__>=this.__values__.length,l=s?t:this.__values__[this.__index__++];return{done:s,value:l}}function TS(){return this}function CS(s){for(var l,c=this;c instanceof wo;){var h=tp(c);h.__index__=0,h.__values__=t,l?g.__wrapped__=h:l=h;var g=h;c=c.__wrapped__}return g.__wrapped__=s,l}function AS(){var s=this.__wrapped__;if(s instanceof ue){var l=s;return this.__actions__.length&&(l=new ue(this)),l=l.reverse(),l.__actions__.push({func:Do,args:[Tu],thisArg:t}),new zt(l,this.__chain__)}return this.thru(Tu)}function OS(){return kh(this.__wrapped__,this.__actions__)}var IS=Co(function(s,l,c){ve.call(s,c)?++s[c]:In(s,c,1)});function NS(s,l,c){var h=ee(s)?zd:xb;return c&&ct(s,l,c)&&(l=t),h(s,J(l,3))}function RS(s,l){var c=ee(s)?Zn:lh;return c(s,J(l,3))}var LS=Ph(np),PS=Ph(rp);function DS(s,l){return Qe(zo(s,l),1)}function zS(s,l){return Qe(zo(s,l),We)}function BS(s,l,c){return c=c===t?1:te(c),Qe(zo(s,l),c)}function up(s,l){var c=ee(s)?Pt:nr;return c(s,J(l,3))}function cp(s,l){var c=ee(s)?r2:oh;return c(s,J(l,3))}var FS=Co(function(s,l,c){ve.call(s,c)?s[c].push(l):In(s,c,[l])});function $S(s,l,c,h){s=yt(s)?s:bi(s),c=c&&!h?te(c):0;var g=s.length;return c<0&&(c=Be(g+c,0)),Wo(s)?c<=g&&s.indexOf(l,c)>-1:!!g&&oi(s,l,c)>-1}var HS=se(function(s,l,c){var h=-1,g=typeof l=="function",v=yt(s)?C(s.length):[];return nr(s,function(x){v[++h]=g?xt(l,x,c):ds(x,l,c)}),v}),WS=Co(function(s,l,c){In(s,c,l)});function zo(s,l){var c=ee(s)?ke:hh;return c(s,J(l,3))}function US(s,l,c,h){return s==null?[]:(ee(l)||(l=l==null?[]:[l]),c=h?t:c,ee(c)||(c=c==null?[]:[c]),yh(s,l,c))}var VS=Co(function(s,l,c){s[c?0:1].push(l)},function(){return[[],[]]});function KS(s,l,c){var h=ee(s)?$a:Hd,g=arguments.length<3;return h(s,J(l,4),c,g,nr)}function GS(s,l,c){var h=ee(s)?i2:Hd,g=arguments.length<3;return h(s,J(l,4),c,g,oh)}function qS(s,l){var c=ee(s)?Zn:lh;return c(s,$o(J(l,3)))}function JS(s){var l=ee(s)?nh:$b;return l(s)}function jS(s,l,c){(c?ct(s,l,c):l===t)?l=1:l=te(l);var h=ee(s)?yb:Hb;return h(s,l)}function YS(s){var l=ee(s)?bb:Ub;return l(s)}function XS(s){if(s==null)return 0;if(yt(s))return Wo(s)?ai(s):s.length;var l=ot(s);return l==Qt||l==en?s.size:su(s).length}function ZS(s,l,c){var h=ee(s)?Ha:Vb;return c&&ct(s,l,c)&&(l=t),h(s,J(l,3))}var QS=se(function(s,l){if(s==null)return[];var c=l.length;return c>1&&ct(s,l[0],l[1])?l=[]:c>2&&ct(l[0],l[1],l[2])&&(l=[l[0]]),yh(s,Qe(l,1),[])}),Bo=R2||function(){return Ze.Date.now()};function e5(s,l){if(typeof l!="function")throw new Dt(a);return s=te(s),function(){if(--s<1)return l.apply(this,arguments)}}function fp(s,l,c){return l=c?t:l,l=s&&l==null?s.length:l,Nn(s,ie,t,t,t,t,l)}function dp(s,l){var c;if(typeof l!="function")throw new Dt(a);return s=te(s),function(){return--s>0&&(c=l.apply(this,arguments)),s<=1&&(l=t),c}}var Au=se(function(s,l,c){var h=T;if(c.length){var g=er(c,gi(Au));h|=X}return Nn(s,h,l,c,g)}),hp=se(function(s,l,c){var h=T|O;if(c.length){var g=er(c,gi(hp));h|=X}return Nn(l,h,s,c,g)});function pp(s,l,c){l=c?t:l;var h=Nn(s,B,t,t,t,t,t,l);return h.placeholder=pp.placeholder,h}function mp(s,l,c){l=c?t:l;var h=Nn(s,H,t,t,t,t,t,l);return h.placeholder=mp.placeholder,h}function gp(s,l,c){var h,g,v,x,_,E,I=0,N=!1,R=!1,$=!0;if(typeof s!="function")throw new Dt(a);l=Ht(l)||0,Te(c)&&(N=!!c.leading,R="maxWait"in c,v=R?Be(Ht(c.maxWait)||0,l):v,$="trailing"in c?!!c.trailing:$);function K(Ne){var sn=h,zn=g;return h=g=t,I=Ne,x=s.apply(zn,sn),x}function j(Ne){return I=Ne,_=ys(le,l),N?K(Ne):x}function re(Ne){var sn=Ne-E,zn=Ne-I,Pp=l-sn;return R?st(Pp,v-zn):Pp}function Y(Ne){var sn=Ne-E,zn=Ne-I;return E===t||sn>=l||sn<0||R&&zn>=v}function le(){var Ne=Bo();if(Y(Ne))return fe(Ne);_=ys(le,re(Ne))}function fe(Ne){return _=t,$&&h?K(Ne):(h=g=t,x)}function Mt(){_!==t&&Mh(_),I=0,h=E=g=_=t}function ft(){return _===t?x:fe(Bo())}function Tt(){var Ne=Bo(),sn=Y(Ne);if(h=arguments,g=this,E=Ne,sn){if(_===t)return j(E);if(R)return Mh(_),_=ys(le,l),K(E)}return _===t&&(_=ys(le,l)),x}return Tt.cancel=Mt,Tt.flush=ft,Tt}var t5=se(function(s,l){return sh(s,1,l)}),n5=se(function(s,l,c){return sh(s,Ht(l)||0,c)});function r5(s){return Nn(s,jt)}function Fo(s,l){if(typeof s!="function"||l!=null&&typeof l!="function")throw new Dt(a);var c=function(){var h=arguments,g=l?l.apply(this,h):h[0],v=c.cache;if(v.has(g))return v.get(g);var x=s.apply(this,h);return c.cache=v.set(g,x)||v,x};return c.cache=new(Fo.Cache||On),c}Fo.Cache=On;function $o(s){if(typeof s!="function")throw new Dt(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 i5(s){return dp(2,s)}var s5=Kb(function(s,l){l=l.length==1&&ee(l[0])?ke(l[0],_t(J())):ke(Qe(l,1),_t(J()));var c=l.length;return se(function(h){for(var g=-1,v=st(h.length,c);++g<v;)h[g]=l[g].call(this,h[g]);return xt(s,this,h)})}),Ou=se(function(s,l){var c=er(l,gi(Ou));return Nn(s,X,t,l,c)}),yp=se(function(s,l){var c=er(l,gi(yp));return Nn(s,q,t,l,c)}),o5=Rn(function(s,l){return Nn(s,Me,t,t,t,l)});function l5(s,l){if(typeof s!="function")throw new Dt(a);return l=l===t?l:te(l),se(s,l)}function a5(s,l){if(typeof s!="function")throw new Dt(a);return l=l==null?0:Be(te(l),0),se(function(c){var h=c[l],g=sr(c,0,l);return h&&Qn(g,h),xt(s,this,g)})}function u5(s,l,c){var h=!0,g=!0;if(typeof s!="function")throw new Dt(a);return Te(c)&&(h="leading"in c?!!c.leading:h,g="trailing"in c?!!c.trailing:g),gp(s,l,{leading:h,maxWait:l,trailing:g})}function c5(s){return fp(s,1)}function f5(s,l){return Ou(pu(l),s)}function d5(){if(!arguments.length)return[];var s=arguments[0];return ee(s)?s:[s]}function h5(s){return Bt(s,S)}function p5(s,l){return l=typeof l=="function"?l:t,Bt(s,S,l)}function m5(s){return Bt(s,p|S)}function g5(s,l){return l=typeof l=="function"?l:t,Bt(s,p|S,l)}function y5(s,l){return l==null||ih(s,l,Ke(l))}function rn(s,l){return s===l||s!==s&&l!==l}var b5=No(nu),v5=No(function(s,l){return s>=l}),Lr=ch(function(){return arguments}())?ch:function(s){return Oe(s)&&ve.call(s,"callee")&&!Yd.call(s,"callee")},ee=C.isArray,S5=Id?_t(Id):Cb;function yt(s){return s!=null&&Ho(s.length)&&!Pn(s)}function Ie(s){return Oe(s)&&yt(s)}function w5(s){return s===!0||s===!1||Oe(s)&&ut(s)==Yi}var or=P2||Hu,x5=Nd?_t(Nd):Ab;function _5(s){return Oe(s)&&s.nodeType===1&&!bs(s)}function k5(s){if(s==null)return!0;if(yt(s)&&(ee(s)||typeof s=="string"||typeof s.splice=="function"||or(s)||yi(s)||Lr(s)))return!s.length;var l=ot(s);if(l==Qt||l==en)return!s.size;if(gs(s))return!su(s).length;for(var c in s)if(ve.call(s,c))return!1;return!0}function E5(s,l){return hs(s,l)}function M5(s,l,c){c=typeof c=="function"?c:t;var h=c?c(s,l):t;return h===t?hs(s,l,t,c):!!h}function Iu(s){if(!Oe(s))return!1;var l=ut(s);return l==Zs||l==j1||typeof s.message=="string"&&typeof s.name=="string"&&!bs(s)}function T5(s){return typeof s=="number"&&Zd(s)}function Pn(s){if(!Te(s))return!1;var l=ut(s);return l==Qs||l==sd||l==J1||l==X1}function bp(s){return typeof s=="number"&&s==te(s)}function Ho(s){return typeof s=="number"&&s>-1&&s%1==0&&s<=Ue}function Te(s){var l=typeof s;return s!=null&&(l=="object"||l=="function")}function Oe(s){return s!=null&&typeof s=="object"}var vp=Rd?_t(Rd):Ib;function C5(s,l){return s===l||iu(s,l,wu(l))}function A5(s,l,c){return c=typeof c=="function"?c:t,iu(s,l,wu(l),c)}function O5(s){return Sp(s)&&s!=+s}function I5(s){if(pv(s))throw new Q(o);return fh(s)}function N5(s){return s===null}function R5(s){return s==null}function Sp(s){return typeof s=="number"||Oe(s)&&ut(s)==Zi}function bs(s){if(!Oe(s)||ut(s)!=Cn)return!1;var l=po(s);if(l===null)return!0;var c=ve.call(l,"constructor")&&l.constructor;return typeof c=="function"&&c instanceof c&&uo.call(c)==A2}var Nu=Ld?_t(Ld):Nb;function L5(s){return bp(s)&&s>=-Ue&&s<=Ue}var wp=Pd?_t(Pd):Rb;function Wo(s){return typeof s=="string"||!ee(s)&&Oe(s)&&ut(s)==es}function Et(s){return typeof s=="symbol"||Oe(s)&&ut(s)==eo}var yi=Dd?_t(Dd):Lb;function P5(s){return s===t}function D5(s){return Oe(s)&&ot(s)==ts}function z5(s){return Oe(s)&&ut(s)==Q1}var B5=No(ou),F5=No(function(s,l){return s<=l});function xp(s){if(!s)return[];if(yt(s))return Wo(s)?tn(s):gt(s);if(is&&s[is])return y2(s[is]());var l=ot(s),c=l==Qt?qa:l==en?oo:bi;return c(s)}function Dn(s){if(!s)return s===0?s:0;if(s=Ht(s),s===We||s===-We){var l=s<0?-1:1;return l*Rt}return s===s?s:0}function te(s){var l=Dn(s),c=l%1;return l===l?c?l-c:l:0}function _p(s){return s?Or(te(s),0,Ve):0}function Ht(s){if(typeof s=="number")return s;if(Et(s))return it;if(Te(s)){var l=typeof s.valueOf=="function"?s.valueOf():s;s=Te(l)?l+"":l}if(typeof s!="string")return s===0?s:+s;s=Wd(s);var c=Sy.test(s);return c||xy.test(s)?e2(s.slice(2),c?2:8):vy.test(s)?it:+s}function kp(s){return gn(s,bt(s))}function $5(s){return s?Or(te(s),-Ue,Ue):s===0?s:0}function ye(s){return s==null?"":kt(s)}var H5=pi(function(s,l){if(gs(l)||yt(l)){gn(l,Ke(l),s);return}for(var c in l)ve.call(l,c)&&cs(s,c,l[c])}),Ep=pi(function(s,l){gn(l,bt(l),s)}),Uo=pi(function(s,l,c,h){gn(l,bt(l),s,h)}),W5=pi(function(s,l,c,h){gn(l,Ke(l),s,h)}),U5=Rn(Qa);function V5(s,l){var c=hi(s);return l==null?c:rh(c,l)}var K5=se(function(s,l){s=Se(s);var c=-1,h=l.length,g=h>2?l[2]:t;for(g&&ct(l[0],l[1],g)&&(h=1);++c<h;)for(var v=l[c],x=bt(v),_=-1,E=x.length;++_<E;){var I=x[_],N=s[I];(N===t||rn(N,ci[I])&&!ve.call(s,I))&&(s[I]=v[I])}return s}),G5=se(function(s){return s.push(t,Wh),xt(Mp,t,s)});function q5(s,l){return Bd(s,J(l,3),mn)}function J5(s,l){return Bd(s,J(l,3),tu)}function j5(s,l){return s==null?s:eu(s,J(l,3),bt)}function Y5(s,l){return s==null?s:ah(s,J(l,3),bt)}function X5(s,l){return s&&mn(s,J(l,3))}function Z5(s,l){return s&&tu(s,J(l,3))}function Q5(s){return s==null?[]:ko(s,Ke(s))}function ew(s){return s==null?[]:ko(s,bt(s))}function Ru(s,l,c){var h=s==null?t:Ir(s,l);return h===t?c:h}function tw(s,l){return s!=null&&Kh(s,l,kb)}function Lu(s,l){return s!=null&&Kh(s,l,Eb)}var nw=zh(function(s,l,c){l!=null&&typeof l.toString!="function"&&(l=co.call(l)),s[l]=c},Du(vt)),rw=zh(function(s,l,c){l!=null&&typeof l.toString!="function"&&(l=co.call(l)),ve.call(s,l)?s[l].push(c):s[l]=[c]},J),iw=se(ds);function Ke(s){return yt(s)?th(s):su(s)}function bt(s){return yt(s)?th(s,!0):Pb(s)}function sw(s,l){var c={};return l=J(l,3),mn(s,function(h,g,v){In(c,l(h,g,v),h)}),c}function ow(s,l){var c={};return l=J(l,3),mn(s,function(h,g,v){In(c,g,l(h,g,v))}),c}var lw=pi(function(s,l,c){Eo(s,l,c)}),Mp=pi(function(s,l,c,h){Eo(s,l,c,h)}),aw=Rn(function(s,l){var c={};if(s==null)return c;var h=!1;l=ke(l,function(v){return v=ir(v,s),h||(h=v.length>1),v}),gn(s,vu(s),c),h&&(c=Bt(c,p|y|S,nv));for(var g=l.length;g--;)fu(c,l[g]);return c});function uw(s,l){return Tp(s,$o(J(l)))}var cw=Rn(function(s,l){return s==null?{}:zb(s,l)});function Tp(s,l){if(s==null)return{};var c=ke(vu(s),function(h){return[h]});return l=J(l),bh(s,c,function(h,g){return l(h,g[0])})}function fw(s,l,c){l=ir(l,s);var h=-1,g=l.length;for(g||(g=1,s=t);++h<g;){var v=s==null?t:s[yn(l[h])];v===t&&(h=g,v=c),s=Pn(v)?v.call(s):v}return s}function dw(s,l,c){return s==null?s:ps(s,l,c)}function hw(s,l,c,h){return h=typeof h=="function"?h:t,s==null?s:ps(s,l,c,h)}var Cp=$h(Ke),Ap=$h(bt);function pw(s,l,c){var h=ee(s),g=h||or(s)||yi(s);if(l=J(l,4),c==null){var v=s&&s.constructor;g?c=h?new v:[]:Te(s)?c=Pn(v)?hi(po(s)):{}:c={}}return(g?Pt:mn)(s,function(x,_,E){return l(c,x,_,E)}),c}function mw(s,l){return s==null?!0:fu(s,l)}function gw(s,l,c){return s==null?s:_h(s,l,pu(c))}function yw(s,l,c,h){return h=typeof h=="function"?h:t,s==null?s:_h(s,l,pu(c),h)}function bi(s){return s==null?[]:Ga(s,Ke(s))}function bw(s){return s==null?[]:Ga(s,bt(s))}function vw(s,l,c){return c===t&&(c=l,l=t),c!==t&&(c=Ht(c),c=c===c?c:0),l!==t&&(l=Ht(l),l=l===l?l:0),Or(Ht(s),l,c)}function Sw(s,l,c){return l=Dn(l),c===t?(c=l,l=0):c=Dn(c),s=Ht(s),Mb(s,l,c)}function ww(s,l,c){if(c&&typeof c!="boolean"&&ct(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=Dn(s),l===t?(l=s,s=0):l=Dn(l)),s>l){var h=s;s=l,l=h}if(c||s%1||l%1){var g=Qd();return st(s+g*(l-s+Qy("1e-"+((g+"").length-1))),l)}return au(s,l)}var xw=mi(function(s,l,c){return l=l.toLowerCase(),s+(c?Op(l):l)});function Op(s){return Pu(ye(s).toLowerCase())}function Ip(s){return s=ye(s),s&&s.replace(ky,d2).replace(Uy,"")}function _w(s,l,c){s=ye(s),l=kt(l);var h=s.length;c=c===t?h:Or(te(c),0,h);var g=c;return c-=l.length,c>=0&&s.slice(c,g)==l}function kw(s){return s=ye(s),s&&iy.test(s)?s.replace(ad,h2):s}function Ew(s){return s=ye(s),s&&cy.test(s)?s.replace(Oa,"\\$&"):s}var Mw=mi(function(s,l,c){return s+(c?"-":"")+l.toLowerCase()}),Tw=mi(function(s,l,c){return s+(c?" ":"")+l.toLowerCase()}),Cw=Lh("toLowerCase");function Aw(s,l,c){s=ye(s),l=te(l);var h=l?ai(s):0;if(!l||h>=l)return s;var g=(l-h)/2;return Io(bo(g),c)+s+Io(yo(g),c)}function Ow(s,l,c){s=ye(s),l=te(l);var h=l?ai(s):0;return l&&h<l?s+Io(l-h,c):s}function Iw(s,l,c){s=ye(s),l=te(l);var h=l?ai(s):0;return l&&h<l?Io(l-h,c)+s:s}function Nw(s,l,c){return c||l==null?l=0:l&&(l=+l),F2(ye(s).replace(Ia,""),l||0)}function Rw(s,l,c){return(c?ct(s,l,c):l===t)?l=1:l=te(l),uu(ye(s),l)}function Lw(){var s=arguments,l=ye(s[0]);return s.length<3?l:l.replace(s[1],s[2])}var Pw=mi(function(s,l,c){return s+(c?"_":"")+l.toLowerCase()});function Dw(s,l,c){return c&&typeof c!="number"&&ct(s,l,c)&&(l=c=t),c=c===t?Ve:c>>>0,c?(s=ye(s),s&&(typeof l=="string"||l!=null&&!Nu(l))&&(l=kt(l),!l&&li(s))?sr(tn(s),0,c):s.split(l,c)):[]}var zw=mi(function(s,l,c){return s+(c?" ":"")+Pu(l)});function Bw(s,l,c){return s=ye(s),c=c==null?0:Or(te(c),0,s.length),l=kt(l),s.slice(c,c+l.length)==l}function Fw(s,l,c){var h=b.templateSettings;c&&ct(s,l,c)&&(l=t),s=ye(s),l=Uo({},l,h,Hh);var g=Uo({},l.imports,h.imports,Hh),v=Ke(g),x=Ga(g,v),_,E,I=0,N=l.interpolate||to,R="__p += '",$=Ja((l.escape||to).source+"|"+N.source+"|"+(N===ud?by:to).source+"|"+(l.evaluate||to).source+"|$","g"),K="//# sourceURL="+(ve.call(l,"sourceURL")?(l.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++Jy+"]")+`
22
- `;s.replace($,function(Y,le,fe,Mt,ft,Tt){return fe||(fe=Mt),R+=s.slice(I,Tt).replace(Ey,p2),le&&(_=!0,R+=`' +
21
+ `)}function fv(s){return ee(s)||Lr(s)||!!(Xh&&s&&s[Xh])}function Ln(s,l){var c=typeof s;return l=l??Ue,!!l&&(c=="number"||c!="symbol"&&_y.test(s))&&s>-1&&s%1==0&&s<l}function ct(s,l,c){if(!Te(c))return!1;var d=typeof l;return(d=="number"?yt(c)&&Ln(l,c.length):d=="string"&&l in c)?rn(c[l],s):!1}function _u(s,l){if(ee(s))return!1;var c=typeof s;return c=="number"||c=="symbol"||c=="boolean"||s==null||kt(s)?!0:ay.test(s)||!ly.test(s)||l!=null&&s in Se(l)}function hv(s){var l=typeof s;return l=="string"||l=="number"||l=="symbol"||l=="boolean"?s!=="__proto__":s===null}function Eu(s){var l=Ro(s),c=b[l];if(typeof c!="function"||!(l in ue.prototype))return!1;if(s===c)return!0;var d=Su(c);return!!d&&s===d[0]}function dv(s){return!!qh&&qh in s}var pv=ao?Pn:Hu;function gs(s){var l=s&&s.constructor,c=typeof l=="function"&&l.prototype||ci;return s===c}function qd(s){return s===s&&!Te(s)}function Jd(s,l){return function(c){return c==null?!1:c[s]===l&&(l!==t||s in Se(c))}}function mv(s){var l=Fo(s,function(d){return c.size===h&&c.clear(),d}),c=l.cache;return l}function gv(s,l){var c=s[1],d=l[1],g=c|d,v=g<(T|O|ie),x=d==ie&&c==B||d==ie&&c==Me&&s[7].length<=l[8]||d==(ie|Me)&&l[7].length<=l[8]&&c==B;if(!(v||x))return s;d&T&&(s[2]=l[2],g|=c&T?0:F);var _=l[3];if(_){var k=s[3];s[3]=k?Od(k,_,l[4]):_,s[4]=k?er(s[3],m):l[4]}return _=l[5],_&&(k=s[5],s[5]=k?Id(k,_,l[6]):_,s[6]=k?er(s[5],m):l[6]),_=l[7],_&&(s[7]=_),d&ie&&(s[8]=s[8]==null?l[8]:st(s[8],l[8])),s[9]==null&&(s[9]=l[9]),s[0]=l[0],s[1]=g,s}function yv(s){var l=[];if(s!=null)for(var c in Se(s))l.push(c);return l}function bv(s){return co.call(s)}function jd(s,l,c){return l=Be(l===t?s.length-1:l,0),function(){for(var d=arguments,g=-1,v=Be(d.length-l,0),x=C(v);++g<v;)x[g]=d[l+g];g=-1;for(var _=C(l+1);++g<l;)_[g]=d[g];return _[l]=c(x),xt(s,this,_)}}function Yd(s,l){return l.length<2?s:Ir(s,Ft(l,0,-1))}function vv(s,l){for(var c=s.length,d=st(l.length,c),g=gt(s);d--;){var v=l[d];s[d]=Ln(v,c)?g[v]:t}return s}function ku(s,l){if(!(l==="constructor"&&typeof s[l]=="function")&&l!="__proto__")return s[l]}var Xd=Qd(Sd),ys=L2||function(s,l){return Ze.setTimeout(s,l)},Mu=Qd(Wb);function Zd(s,l,c){var d=l+"";return Mu(s,cv(d,Sv(lv(d),c)))}function Qd(s){var l=0,c=0;return function(){var d=B2(),g=jn-(d-c);if(c=d,g>0){if(++l>=pn)return arguments[0]}else l=0;return s.apply(t,arguments)}}function Po(s,l){var c=-1,d=s.length,g=d-1;for(l=l===t?d:l;++c<l;){var v=au(c,g),x=s[v];s[v]=s[c],s[c]=x}return s.length=l,s}var ep=mv(function(s){var l=[];return s.charCodeAt(0)===46&&l.push(""),s.replace(uy,function(c,d,g,v){l.push(g?v.replace(yy,"$1"):d||c)}),l});function yn(s){if(typeof s=="string"||kt(s))return s;var l=s+"";return l=="0"&&1/s==-We?"-0":l}function Rr(s){if(s!=null){try{return uo.call(s)}catch{}try{return s+""}catch{}}return""}function Sv(s,l){return Pt(Sa,function(c){var d="_."+c[0];l&c[1]&&!io(s,d)&&s.push(d)}),s.sort()}function tp(s){if(s instanceof ue)return s.clone();var l=new zt(s.__wrapped__,s.__chain__);return l.__actions__=gt(s.__actions__),l.__index__=s.__index__,l.__values__=s.__values__,l}function wv(s,l,c){(c?ct(s,l,c):l===t)?l=1:l=Be(te(l),0);var d=s==null?0:s.length;if(!d||l<1)return[];for(var g=0,v=0,x=C(yo(d/l));g<d;)x[v++]=Ft(s,g,g+=l);return x}function xv(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 _v(){var s=arguments.length;if(!s)return[];for(var l=C(s-1),c=arguments[0],d=s;d--;)l[d-1]=arguments[d];return Qn(ee(c)?gt(c):[c],Qe(l,1))}var Ev=se(function(s,l){return Ie(s)?fs(s,Qe(l,1,Ie,!0)):[]}),kv=se(function(s,l){var c=$t(l);return Ie(c)&&(c=t),Ie(s)?fs(s,Qe(l,1,Ie,!0),J(c,2)):[]}),Mv=se(function(s,l){var c=$t(l);return Ie(c)&&(c=t),Ie(s)?fs(s,Qe(l,1,Ie,!0),t,c):[]});function Tv(s,l,c){var d=s==null?0:s.length;return d?(l=c||l===t?1:te(l),Ft(s,l<0?0:l,d)):[]}function Cv(s,l,c){var d=s==null?0:s.length;return d?(l=c||l===t?1:te(l),l=d-l,Ft(s,0,l<0?0:l)):[]}function Av(s,l){return s&&s.length?To(s,J(l,3),!0,!0):[]}function Ov(s,l){return s&&s.length?To(s,J(l,3),!0):[]}function Iv(s,l,c,d){var g=s==null?0:s.length;return g?(c&&typeof c!="number"&&ct(s,l,c)&&(c=0,d=g),_b(s,l,c,d)):[]}function np(s,l,c){var d=s==null?0:s.length;if(!d)return-1;var g=c==null?0:te(c);return g<0&&(g=Be(d+g,0)),so(s,J(l,3),g)}function rp(s,l,c){var d=s==null?0:s.length;if(!d)return-1;var g=d-1;return c!==t&&(g=te(c),g=c<0?Be(d+g,0):st(g,d-1)),so(s,J(l,3),g,!0)}function ip(s){var l=s==null?0:s.length;return l?Qe(s,1):[]}function Nv(s){var l=s==null?0:s.length;return l?Qe(s,We):[]}function Rv(s,l){var c=s==null?0:s.length;return c?(l=l===t?1:te(l),Qe(s,l)):[]}function Lv(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 sp(s){return s&&s.length?s[0]:t}function Pv(s,l,c){var d=s==null?0:s.length;if(!d)return-1;var g=c==null?0:te(c);return g<0&&(g=Be(d+g,0)),oi(s,l,g)}function Dv(s){var l=s==null?0:s.length;return l?Ft(s,0,-1):[]}var zv=se(function(s){var l=Ee(s,du);return l.length&&l[0]===s[0]?ru(l):[]}),Bv=se(function(s){var l=$t(s),c=Ee(s,du);return l===$t(c)?l=t:c.pop(),c.length&&c[0]===s[0]?ru(c,J(l,2)):[]}),Fv=se(function(s){var l=$t(s),c=Ee(s,du);return l=typeof l=="function"?l:t,l&&c.pop(),c.length&&c[0]===s[0]?ru(c,t,l):[]});function $v(s,l){return s==null?"":D2.call(s,l)}function $t(s){var l=s==null?0:s.length;return l?s[l-1]:t}function Hv(s,l,c){var d=s==null?0:s.length;if(!d)return-1;var g=d;return c!==t&&(g=te(c),g=g<0?Be(d+g,0):st(g,d-1)),l===l?S2(s,l,g):so(s,Fh,g,!0)}function Wv(s,l){return s&&s.length?gd(s,te(l)):t}var Uv=se(op);function op(s,l){return s&&s.length&&l&&l.length?lu(s,l):s}function Vv(s,l,c){return s&&s.length&&l&&l.length?lu(s,l,J(c,2)):s}function Kv(s,l,c){return s&&s.length&&l&&l.length?lu(s,l,t,c):s}var Gv=Rn(function(s,l){var c=s==null?0:s.length,d=Qa(s,l);return vd(s,Ee(l,function(g){return Ln(g,c)?+g:g}).sort(Ad)),d});function qv(s,l){var c=[];if(!(s&&s.length))return c;var d=-1,g=[],v=s.length;for(l=J(l,3);++d<v;){var x=s[d];l(x,d,s)&&(c.push(x),g.push(d))}return vd(s,g),c}function Tu(s){return s==null?s:$2.call(s)}function Jv(s,l,c){var d=s==null?0:s.length;return d?(c&&typeof c!="number"&&ct(s,l,c)?(l=0,c=d):(l=l==null?0:te(l),c=c===t?d:te(c)),Ft(s,l,c)):[]}function jv(s,l){return Mo(s,l)}function Yv(s,l,c){return cu(s,l,J(c,2))}function Xv(s,l){var c=s==null?0:s.length;if(c){var d=Mo(s,l);if(d<c&&rn(s[d],l))return d}return-1}function Zv(s,l){return Mo(s,l,!0)}function Qv(s,l,c){return cu(s,l,J(c,2),!0)}function e5(s,l){var c=s==null?0:s.length;if(c){var d=Mo(s,l,!0)-1;if(rn(s[d],l))return d}return-1}function t5(s){return s&&s.length?wd(s):[]}function n5(s,l){return s&&s.length?wd(s,J(l,2)):[]}function r5(s){var l=s==null?0:s.length;return l?Ft(s,1,l):[]}function i5(s,l,c){return s&&s.length?(l=c||l===t?1:te(l),Ft(s,0,l<0?0:l)):[]}function s5(s,l,c){var d=s==null?0:s.length;return d?(l=c||l===t?1:te(l),l=d-l,Ft(s,l<0?0:l,d)):[]}function o5(s,l){return s&&s.length?To(s,J(l,3),!1,!0):[]}function l5(s,l){return s&&s.length?To(s,J(l,3)):[]}var a5=se(function(s){return rr(Qe(s,1,Ie,!0))}),u5=se(function(s){var l=$t(s);return Ie(l)&&(l=t),rr(Qe(s,1,Ie,!0),J(l,2))}),c5=se(function(s){var l=$t(s);return l=typeof l=="function"?l:t,rr(Qe(s,1,Ie,!0),t,l)});function f5(s){return s&&s.length?rr(s):[]}function h5(s,l){return s&&s.length?rr(s,J(l,2)):[]}function d5(s,l){return l=typeof l=="function"?l:t,s&&s.length?rr(s,t,l):[]}function Cu(s){if(!(s&&s.length))return[];var l=0;return s=Zn(s,function(c){if(Ie(c))return l=Be(c.length,l),!0}),Ka(l,function(c){return Ee(s,Wa(c))})}function lp(s,l){if(!(s&&s.length))return[];var c=Cu(s);return l==null?c:Ee(c,function(d){return xt(l,t,d)})}var p5=se(function(s,l){return Ie(s)?fs(s,l):[]}),m5=se(function(s){return hu(Zn(s,Ie))}),g5=se(function(s){var l=$t(s);return Ie(l)&&(l=t),hu(Zn(s,Ie),J(l,2))}),y5=se(function(s){var l=$t(s);return l=typeof l=="function"?l:t,hu(Zn(s,Ie),t,l)}),b5=se(Cu);function v5(s,l){return kd(s||[],l||[],cs)}function S5(s,l){return kd(s||[],l||[],ps)}var w5=se(function(s){var l=s.length,c=l>1?s[l-1]:t;return c=typeof c=="function"?(s.pop(),c):t,lp(s,c)});function ap(s){var l=b(s);return l.__chain__=!0,l}function x5(s,l){return l(s),s}function Do(s,l){return l(s)}var _5=Rn(function(s){var l=s.length,c=l?s[0]:0,d=this.__wrapped__,g=function(v){return Qa(v,s)};return l>1||this.__actions__.length||!(d instanceof ue)||!Ln(c)?this.thru(g):(d=d.slice(c,+c+(l?1:0)),d.__actions__.push({func:Do,args:[g],thisArg:t}),new zt(d,this.__chain__).thru(function(v){return l&&!v.length&&v.push(t),v}))});function E5(){return ap(this)}function k5(){return new zt(this.value(),this.__chain__)}function M5(){this.__values__===t&&(this.__values__=xp(this.value()));var s=this.__index__>=this.__values__.length,l=s?t:this.__values__[this.__index__++];return{done:s,value:l}}function T5(){return this}function C5(s){for(var l,c=this;c instanceof wo;){var d=tp(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 A5(){var s=this.__wrapped__;if(s instanceof ue){var l=s;return this.__actions__.length&&(l=new ue(this)),l=l.reverse(),l.__actions__.push({func:Do,args:[Tu],thisArg:t}),new zt(l,this.__chain__)}return this.thru(Tu)}function O5(){return Ed(this.__wrapped__,this.__actions__)}var I5=Co(function(s,l,c){ve.call(s,c)?++s[c]:In(s,c,1)});function N5(s,l,c){var d=ee(s)?zh:xb;return c&&ct(s,l,c)&&(l=t),d(s,J(l,3))}function R5(s,l){var c=ee(s)?Zn:ld;return c(s,J(l,3))}var L5=Pd(np),P5=Pd(rp);function D5(s,l){return Qe(zo(s,l),1)}function z5(s,l){return Qe(zo(s,l),We)}function B5(s,l,c){return c=c===t?1:te(c),Qe(zo(s,l),c)}function up(s,l){var c=ee(s)?Pt:nr;return c(s,J(l,3))}function cp(s,l){var c=ee(s)?r2:od;return c(s,J(l,3))}var F5=Co(function(s,l,c){ve.call(s,c)?s[c].push(l):In(s,c,[l])});function $5(s,l,c,d){s=yt(s)?s:bi(s),c=c&&!d?te(c):0;var g=s.length;return c<0&&(c=Be(g+c,0)),Wo(s)?c<=g&&s.indexOf(l,c)>-1:!!g&&oi(s,l,c)>-1}var H5=se(function(s,l,c){var d=-1,g=typeof l=="function",v=yt(s)?C(s.length):[];return nr(s,function(x){v[++d]=g?xt(l,x,c):hs(x,l,c)}),v}),W5=Co(function(s,l,c){In(s,c,l)});function zo(s,l){var c=ee(s)?Ee:dd;return c(s,J(l,3))}function U5(s,l,c,d){return s==null?[]:(ee(l)||(l=l==null?[]:[l]),c=d?t:c,ee(c)||(c=c==null?[]:[c]),yd(s,l,c))}var V5=Co(function(s,l,c){s[c?0:1].push(l)},function(){return[[],[]]});function K5(s,l,c){var d=ee(s)?$a:Hh,g=arguments.length<3;return d(s,J(l,4),c,g,nr)}function G5(s,l,c){var d=ee(s)?i2:Hh,g=arguments.length<3;return d(s,J(l,4),c,g,od)}function q5(s,l){var c=ee(s)?Zn:ld;return c(s,$o(J(l,3)))}function J5(s){var l=ee(s)?nd:$b;return l(s)}function j5(s,l,c){(c?ct(s,l,c):l===t)?l=1:l=te(l);var d=ee(s)?yb:Hb;return d(s,l)}function Y5(s){var l=ee(s)?bb:Ub;return l(s)}function X5(s){if(s==null)return 0;if(yt(s))return Wo(s)?ai(s):s.length;var l=ot(s);return l==Qt||l==en?s.size:su(s).length}function Z5(s,l,c){var d=ee(s)?Ha:Vb;return c&&ct(s,l,c)&&(l=t),d(s,J(l,3))}var Q5=se(function(s,l){if(s==null)return[];var c=l.length;return c>1&&ct(s,l[0],l[1])?l=[]:c>2&&ct(l[0],l[1],l[2])&&(l=[l[0]]),yd(s,Qe(l,1),[])}),Bo=R2||function(){return Ze.Date.now()};function eS(s,l){if(typeof l!="function")throw new Dt(a);return s=te(s),function(){if(--s<1)return l.apply(this,arguments)}}function fp(s,l,c){return l=c?t:l,l=s&&l==null?s.length:l,Nn(s,ie,t,t,t,t,l)}function hp(s,l){var c;if(typeof l!="function")throw new Dt(a);return s=te(s),function(){return--s>0&&(c=l.apply(this,arguments)),s<=1&&(l=t),c}}var Au=se(function(s,l,c){var d=T;if(c.length){var g=er(c,gi(Au));d|=X}return Nn(s,d,l,c,g)}),dp=se(function(s,l,c){var d=T|O;if(c.length){var g=er(c,gi(dp));d|=X}return Nn(l,d,s,c,g)});function pp(s,l,c){l=c?t:l;var d=Nn(s,B,t,t,t,t,t,l);return d.placeholder=pp.placeholder,d}function mp(s,l,c){l=c?t:l;var d=Nn(s,H,t,t,t,t,t,l);return d.placeholder=mp.placeholder,d}function gp(s,l,c){var d,g,v,x,_,k,I=0,N=!1,R=!1,$=!0;if(typeof s!="function")throw new Dt(a);l=Ht(l)||0,Te(c)&&(N=!!c.leading,R="maxWait"in c,v=R?Be(Ht(c.maxWait)||0,l):v,$="trailing"in c?!!c.trailing:$);function K(Ne){var sn=d,zn=g;return d=g=t,I=Ne,x=s.apply(zn,sn),x}function j(Ne){return I=Ne,_=ys(le,l),N?K(Ne):x}function re(Ne){var sn=Ne-k,zn=Ne-I,Pp=l-sn;return R?st(Pp,v-zn):Pp}function Y(Ne){var sn=Ne-k,zn=Ne-I;return k===t||sn>=l||sn<0||R&&zn>=v}function le(){var Ne=Bo();if(Y(Ne))return fe(Ne);_=ys(le,re(Ne))}function fe(Ne){return _=t,$&&d?K(Ne):(d=g=t,x)}function Mt(){_!==t&&Md(_),I=0,d=k=g=_=t}function ft(){return _===t?x:fe(Bo())}function Tt(){var Ne=Bo(),sn=Y(Ne);if(d=arguments,g=this,k=Ne,sn){if(_===t)return j(k);if(R)return Md(_),_=ys(le,l),K(k)}return _===t&&(_=ys(le,l)),x}return Tt.cancel=Mt,Tt.flush=ft,Tt}var tS=se(function(s,l){return sd(s,1,l)}),nS=se(function(s,l,c){return sd(s,Ht(l)||0,c)});function rS(s){return Nn(s,jt)}function Fo(s,l){if(typeof s!="function"||l!=null&&typeof l!="function")throw new Dt(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 x=s.apply(this,d);return c.cache=v.set(g,x)||v,x};return c.cache=new(Fo.Cache||On),c}Fo.Cache=On;function $o(s){if(typeof s!="function")throw new Dt(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 iS(s){return hp(2,s)}var sS=Kb(function(s,l){l=l.length==1&&ee(l[0])?Ee(l[0],_t(J())):Ee(Qe(l,1),_t(J()));var c=l.length;return se(function(d){for(var g=-1,v=st(d.length,c);++g<v;)d[g]=l[g].call(this,d[g]);return xt(s,this,d)})}),Ou=se(function(s,l){var c=er(l,gi(Ou));return Nn(s,X,t,l,c)}),yp=se(function(s,l){var c=er(l,gi(yp));return Nn(s,q,t,l,c)}),oS=Rn(function(s,l){return Nn(s,Me,t,t,t,l)});function lS(s,l){if(typeof s!="function")throw new Dt(a);return l=l===t?l:te(l),se(s,l)}function aS(s,l){if(typeof s!="function")throw new Dt(a);return l=l==null?0:Be(te(l),0),se(function(c){var d=c[l],g=sr(c,0,l);return d&&Qn(g,d),xt(s,this,g)})}function uS(s,l,c){var d=!0,g=!0;if(typeof s!="function")throw new Dt(a);return Te(c)&&(d="leading"in c?!!c.leading:d,g="trailing"in c?!!c.trailing:g),gp(s,l,{leading:d,maxWait:l,trailing:g})}function cS(s){return fp(s,1)}function fS(s,l){return Ou(pu(l),s)}function hS(){if(!arguments.length)return[];var s=arguments[0];return ee(s)?s:[s]}function dS(s){return Bt(s,S)}function pS(s,l){return l=typeof l=="function"?l:t,Bt(s,S,l)}function mS(s){return Bt(s,p|S)}function gS(s,l){return l=typeof l=="function"?l:t,Bt(s,p|S,l)}function yS(s,l){return l==null||id(s,l,Ke(l))}function rn(s,l){return s===l||s!==s&&l!==l}var bS=No(nu),vS=No(function(s,l){return s>=l}),Lr=cd(function(){return arguments}())?cd:function(s){return Oe(s)&&ve.call(s,"callee")&&!Yh.call(s,"callee")},ee=C.isArray,SS=Ih?_t(Ih):Cb;function yt(s){return s!=null&&Ho(s.length)&&!Pn(s)}function Ie(s){return Oe(s)&&yt(s)}function wS(s){return s===!0||s===!1||Oe(s)&&ut(s)==Yi}var or=P2||Hu,xS=Nh?_t(Nh):Ab;function _S(s){return Oe(s)&&s.nodeType===1&&!bs(s)}function ES(s){if(s==null)return!0;if(yt(s)&&(ee(s)||typeof s=="string"||typeof s.splice=="function"||or(s)||yi(s)||Lr(s)))return!s.length;var l=ot(s);if(l==Qt||l==en)return!s.size;if(gs(s))return!su(s).length;for(var c in s)if(ve.call(s,c))return!1;return!0}function kS(s,l){return ds(s,l)}function MS(s,l,c){c=typeof c=="function"?c:t;var d=c?c(s,l):t;return d===t?ds(s,l,t,c):!!d}function Iu(s){if(!Oe(s))return!1;var l=ut(s);return l==Zs||l==j1||typeof s.message=="string"&&typeof s.name=="string"&&!bs(s)}function TS(s){return typeof s=="number"&&Zh(s)}function Pn(s){if(!Te(s))return!1;var l=ut(s);return l==Qs||l==sh||l==J1||l==X1}function bp(s){return typeof s=="number"&&s==te(s)}function Ho(s){return typeof s=="number"&&s>-1&&s%1==0&&s<=Ue}function Te(s){var l=typeof s;return s!=null&&(l=="object"||l=="function")}function Oe(s){return s!=null&&typeof s=="object"}var vp=Rh?_t(Rh):Ib;function CS(s,l){return s===l||iu(s,l,wu(l))}function AS(s,l,c){return c=typeof c=="function"?c:t,iu(s,l,wu(l),c)}function OS(s){return Sp(s)&&s!=+s}function IS(s){if(pv(s))throw new Q(o);return fd(s)}function NS(s){return s===null}function RS(s){return s==null}function Sp(s){return typeof s=="number"||Oe(s)&&ut(s)==Zi}function bs(s){if(!Oe(s)||ut(s)!=Cn)return!1;var l=po(s);if(l===null)return!0;var c=ve.call(l,"constructor")&&l.constructor;return typeof c=="function"&&c instanceof c&&uo.call(c)==A2}var Nu=Lh?_t(Lh):Nb;function LS(s){return bp(s)&&s>=-Ue&&s<=Ue}var wp=Ph?_t(Ph):Rb;function Wo(s){return typeof s=="string"||!ee(s)&&Oe(s)&&ut(s)==es}function kt(s){return typeof s=="symbol"||Oe(s)&&ut(s)==eo}var yi=Dh?_t(Dh):Lb;function PS(s){return s===t}function DS(s){return Oe(s)&&ot(s)==ts}function zS(s){return Oe(s)&&ut(s)==Q1}var BS=No(ou),FS=No(function(s,l){return s<=l});function xp(s){if(!s)return[];if(yt(s))return Wo(s)?tn(s):gt(s);if(is&&s[is])return y2(s[is]());var l=ot(s),c=l==Qt?qa:l==en?oo:bi;return c(s)}function Dn(s){if(!s)return s===0?s:0;if(s=Ht(s),s===We||s===-We){var l=s<0?-1:1;return l*Rt}return s===s?s:0}function te(s){var l=Dn(s),c=l%1;return l===l?c?l-c:l:0}function _p(s){return s?Or(te(s),0,Ve):0}function Ht(s){if(typeof s=="number")return s;if(kt(s))return it;if(Te(s)){var l=typeof s.valueOf=="function"?s.valueOf():s;s=Te(l)?l+"":l}if(typeof s!="string")return s===0?s:+s;s=Wh(s);var c=Sy.test(s);return c||xy.test(s)?e2(s.slice(2),c?2:8):vy.test(s)?it:+s}function Ep(s){return gn(s,bt(s))}function $S(s){return s?Or(te(s),-Ue,Ue):s===0?s:0}function ye(s){return s==null?"":Et(s)}var HS=pi(function(s,l){if(gs(l)||yt(l)){gn(l,Ke(l),s);return}for(var c in l)ve.call(l,c)&&cs(s,c,l[c])}),kp=pi(function(s,l){gn(l,bt(l),s)}),Uo=pi(function(s,l,c,d){gn(l,bt(l),s,d)}),WS=pi(function(s,l,c,d){gn(l,Ke(l),s,d)}),US=Rn(Qa);function VS(s,l){var c=di(s);return l==null?c:rd(c,l)}var KS=se(function(s,l){s=Se(s);var c=-1,d=l.length,g=d>2?l[2]:t;for(g&&ct(l[0],l[1],g)&&(d=1);++c<d;)for(var v=l[c],x=bt(v),_=-1,k=x.length;++_<k;){var I=x[_],N=s[I];(N===t||rn(N,ci[I])&&!ve.call(s,I))&&(s[I]=v[I])}return s}),GS=se(function(s){return s.push(t,Wd),xt(Mp,t,s)});function qS(s,l){return Bh(s,J(l,3),mn)}function JS(s,l){return Bh(s,J(l,3),tu)}function jS(s,l){return s==null?s:eu(s,J(l,3),bt)}function YS(s,l){return s==null?s:ad(s,J(l,3),bt)}function XS(s,l){return s&&mn(s,J(l,3))}function ZS(s,l){return s&&tu(s,J(l,3))}function QS(s){return s==null?[]:Eo(s,Ke(s))}function ew(s){return s==null?[]:Eo(s,bt(s))}function Ru(s,l,c){var d=s==null?t:Ir(s,l);return d===t?c:d}function tw(s,l){return s!=null&&Kd(s,l,Eb)}function Lu(s,l){return s!=null&&Kd(s,l,kb)}var nw=zd(function(s,l,c){l!=null&&typeof l.toString!="function"&&(l=co.call(l)),s[l]=c},Du(vt)),rw=zd(function(s,l,c){l!=null&&typeof l.toString!="function"&&(l=co.call(l)),ve.call(s,l)?s[l].push(c):s[l]=[c]},J),iw=se(hs);function Ke(s){return yt(s)?td(s):su(s)}function bt(s){return yt(s)?td(s,!0):Pb(s)}function sw(s,l){var c={};return l=J(l,3),mn(s,function(d,g,v){In(c,l(d,g,v),d)}),c}function ow(s,l){var c={};return l=J(l,3),mn(s,function(d,g,v){In(c,g,l(d,g,v))}),c}var lw=pi(function(s,l,c){ko(s,l,c)}),Mp=pi(function(s,l,c,d){ko(s,l,c,d)}),aw=Rn(function(s,l){var c={};if(s==null)return c;var d=!1;l=Ee(l,function(v){return v=ir(v,s),d||(d=v.length>1),v}),gn(s,vu(s),c),d&&(c=Bt(c,p|y|S,nv));for(var g=l.length;g--;)fu(c,l[g]);return c});function uw(s,l){return Tp(s,$o(J(l)))}var cw=Rn(function(s,l){return s==null?{}:zb(s,l)});function Tp(s,l){if(s==null)return{};var c=Ee(vu(s),function(d){return[d]});return l=J(l),bd(s,c,function(d,g){return l(d,g[0])})}function fw(s,l,c){l=ir(l,s);var d=-1,g=l.length;for(g||(g=1,s=t);++d<g;){var v=s==null?t:s[yn(l[d])];v===t&&(d=g,v=c),s=Pn(v)?v.call(s):v}return s}function hw(s,l,c){return s==null?s:ps(s,l,c)}function dw(s,l,c,d){return d=typeof d=="function"?d:t,s==null?s:ps(s,l,c,d)}var Cp=$d(Ke),Ap=$d(bt);function pw(s,l,c){var d=ee(s),g=d||or(s)||yi(s);if(l=J(l,4),c==null){var v=s&&s.constructor;g?c=d?new v:[]:Te(s)?c=Pn(v)?di(po(s)):{}:c={}}return(g?Pt:mn)(s,function(x,_,k){return l(c,x,_,k)}),c}function mw(s,l){return s==null?!0:fu(s,l)}function gw(s,l,c){return s==null?s:_d(s,l,pu(c))}function yw(s,l,c,d){return d=typeof d=="function"?d:t,s==null?s:_d(s,l,pu(c),d)}function bi(s){return s==null?[]:Ga(s,Ke(s))}function bw(s){return s==null?[]:Ga(s,bt(s))}function vw(s,l,c){return c===t&&(c=l,l=t),c!==t&&(c=Ht(c),c=c===c?c:0),l!==t&&(l=Ht(l),l=l===l?l:0),Or(Ht(s),l,c)}function Sw(s,l,c){return l=Dn(l),c===t?(c=l,l=0):c=Dn(c),s=Ht(s),Mb(s,l,c)}function ww(s,l,c){if(c&&typeof c!="boolean"&&ct(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=Dn(s),l===t?(l=s,s=0):l=Dn(l)),s>l){var d=s;s=l,l=d}if(c||s%1||l%1){var g=Qh();return st(s+g*(l-s+Qy("1e-"+((g+"").length-1))),l)}return au(s,l)}var xw=mi(function(s,l,c){return l=l.toLowerCase(),s+(c?Op(l):l)});function Op(s){return Pu(ye(s).toLowerCase())}function Ip(s){return s=ye(s),s&&s.replace(Ey,h2).replace(Uy,"")}function _w(s,l,c){s=ye(s),l=Et(l);var d=s.length;c=c===t?d:Or(te(c),0,d);var g=c;return c-=l.length,c>=0&&s.slice(c,g)==l}function Ew(s){return s=ye(s),s&&iy.test(s)?s.replace(ah,d2):s}function kw(s){return s=ye(s),s&&cy.test(s)?s.replace(Oa,"\\$&"):s}var Mw=mi(function(s,l,c){return s+(c?"-":"")+l.toLowerCase()}),Tw=mi(function(s,l,c){return s+(c?" ":"")+l.toLowerCase()}),Cw=Ld("toLowerCase");function Aw(s,l,c){s=ye(s),l=te(l);var d=l?ai(s):0;if(!l||d>=l)return s;var g=(l-d)/2;return Io(bo(g),c)+s+Io(yo(g),c)}function Ow(s,l,c){s=ye(s),l=te(l);var d=l?ai(s):0;return l&&d<l?s+Io(l-d,c):s}function Iw(s,l,c){s=ye(s),l=te(l);var d=l?ai(s):0;return l&&d<l?Io(l-d,c)+s:s}function Nw(s,l,c){return c||l==null?l=0:l&&(l=+l),F2(ye(s).replace(Ia,""),l||0)}function Rw(s,l,c){return(c?ct(s,l,c):l===t)?l=1:l=te(l),uu(ye(s),l)}function Lw(){var s=arguments,l=ye(s[0]);return s.length<3?l:l.replace(s[1],s[2])}var Pw=mi(function(s,l,c){return s+(c?"_":"")+l.toLowerCase()});function Dw(s,l,c){return c&&typeof c!="number"&&ct(s,l,c)&&(l=c=t),c=c===t?Ve:c>>>0,c?(s=ye(s),s&&(typeof l=="string"||l!=null&&!Nu(l))&&(l=Et(l),!l&&li(s))?sr(tn(s),0,c):s.split(l,c)):[]}var zw=mi(function(s,l,c){return s+(c?" ":"")+Pu(l)});function Bw(s,l,c){return s=ye(s),c=c==null?0:Or(te(c),0,s.length),l=Et(l),s.slice(c,c+l.length)==l}function Fw(s,l,c){var d=b.templateSettings;c&&ct(s,l,c)&&(l=t),s=ye(s),l=Uo({},l,d,Hd);var g=Uo({},l.imports,d.imports,Hd),v=Ke(g),x=Ga(g,v),_,k,I=0,N=l.interpolate||to,R="__p += '",$=Ja((l.escape||to).source+"|"+N.source+"|"+(N===uh?by:to).source+"|"+(l.evaluate||to).source+"|$","g"),K="//# sourceURL="+(ve.call(l,"sourceURL")?(l.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++Jy+"]")+`
22
+ `;s.replace($,function(Y,le,fe,Mt,ft,Tt){return fe||(fe=Mt),R+=s.slice(I,Tt).replace(ky,p2),le&&(_=!0,R+=`' +
23
23
  __e(`+le+`) +
24
- '`),ft&&(E=!0,R+=`';
24
+ '`),ft&&(k=!0,R+=`';
25
25
  `+ft+`;
26
26
  __p += '`),fe&&(R+=`' +
27
27
  ((__t = (`+fe+`)) == null ? '' : __t) +
@@ -29,10 +29,10 @@ __p += '`),fe&&(R+=`' +
29
29
  `;var j=ve.call(l,"variable")&&l.variable;if(!j)R=`with (obj) {
30
30
  `+R+`
31
31
  }
32
- `;else if(gy.test(j))throw new Q(u);R=(E?R.replace(ey,""):R).replace(ty,"$1").replace(ny,"$1;"),R="function("+(j||"obj")+`) {
32
+ `;else if(gy.test(j))throw new Q(u);R=(k?R.replace(ey,""):R).replace(ty,"$1").replace(ny,"$1;"),R="function("+(j||"obj")+`) {
33
33
  `+(j?"":`obj || (obj = {});
34
- `)+"var __t, __p = ''"+(_?", __e = _.escape":"")+(E?`, __j = Array.prototype.join;
34
+ `)+"var __t, __p = ''"+(_?", __e = _.escape":"")+(k?`, __j = Array.prototype.join;
35
35
  function print() { __p += __j.call(arguments, '') }
36
36
  `:`;
37
37
  `)+R+`return __p
38
- }`;var re=Rp(function(){return ge(v,K+"return "+R).apply(t,x)});if(re.source=R,Iu(re))throw re;return re}function $w(s){return ye(s).toLowerCase()}function Hw(s){return ye(s).toUpperCase()}function Ww(s,l,c){if(s=ye(s),s&&(c||l===t))return Wd(s);if(!s||!(l=kt(l)))return s;var h=tn(s),g=tn(l),v=Ud(h,g),x=Vd(h,g)+1;return sr(h,v,x).join("")}function Uw(s,l,c){if(s=ye(s),s&&(c||l===t))return s.slice(0,Gd(s)+1);if(!s||!(l=kt(l)))return s;var h=tn(s),g=Vd(h,tn(l))+1;return sr(h,0,g).join("")}function Vw(s,l,c){if(s=ye(s),s&&(c||l===t))return s.replace(Ia,"");if(!s||!(l=kt(l)))return s;var h=tn(s),g=Ud(h,tn(l));return sr(h,g).join("")}function Kw(s,l){var c=ri,h=Yt;if(Te(l)){var g="separator"in l?l.separator:g;c="length"in l?te(l.length):c,h="omission"in l?kt(l.omission):h}s=ye(s);var v=s.length;if(li(s)){var x=tn(s);v=x.length}if(c>=v)return s;var _=c-ai(h);if(_<1)return h;var E=x?sr(x,0,_).join(""):s.slice(0,_);if(g===t)return E+h;if(x&&(_+=E.length-_),Nu(g)){if(s.slice(_).search(g)){var I,N=E;for(g.global||(g=Ja(g.source,ye(cd.exec(g))+"g")),g.lastIndex=0;I=g.exec(N);)var R=I.index;E=E.slice(0,R===t?_:R)}}else if(s.indexOf(kt(g),_)!=_){var $=E.lastIndexOf(g);$>-1&&(E=E.slice(0,$))}return E+h}function Gw(s){return s=ye(s),s&&ry.test(s)?s.replace(ld,w2):s}var qw=mi(function(s,l,c){return s+(c?" ":"")+l.toUpperCase()}),Pu=Lh("toUpperCase");function Np(s,l,c){return s=ye(s),l=c?t:l,l===t?g2(s)?k2(s):l2(s):s.match(l)||[]}var Rp=se(function(s,l){try{return xt(s,t,l)}catch(c){return Iu(c)?c:new Q(c)}}),Jw=Rn(function(s,l){return Pt(l,function(c){c=yn(c),In(s,c,Au(s[c],s))}),s});function jw(s){var l=s==null?0:s.length,c=J();return s=l?ke(s,function(h){if(typeof h[1]!="function")throw new Dt(a);return[c(h[0]),h[1]]}):[],se(function(h){for(var g=-1;++g<l;){var v=s[g];if(xt(v[0],this,h))return xt(v[1],this,h)}})}function Yw(s){return wb(Bt(s,p))}function Du(s){return function(){return s}}function Xw(s,l){return s==null||s!==s?l:s}var Zw=Dh(),Qw=Dh(!0);function vt(s){return s}function zu(s){return dh(typeof s=="function"?s:Bt(s,p))}function ex(s){return ph(Bt(s,p))}function tx(s,l){return mh(s,Bt(l,p))}var nx=se(function(s,l){return function(c){return ds(c,s,l)}}),rx=se(function(s,l){return function(c){return ds(s,c,l)}});function Bu(s,l,c){var h=Ke(l),g=ko(l,h);c==null&&!(Te(l)&&(g.length||!h.length))&&(c=l,l=s,s=this,g=ko(l,Ke(l)));var v=!(Te(c)&&"chain"in c)||!!c.chain,x=Pn(s);return Pt(g,function(_){var E=l[_];s[_]=E,x&&(s.prototype[_]=function(){var I=this.__chain__;if(v||I){var N=s(this.__wrapped__),R=N.__actions__=gt(this.__actions__);return R.push({func:E,args:arguments,thisArg:s}),N.__chain__=I,N}return E.apply(s,Qn([this.value()],arguments))})}),s}function ix(){return Ze._===this&&(Ze._=O2),this}function Fu(){}function sx(s){return s=te(s),se(function(l){return gh(l,s)})}var ox=gu(ke),lx=gu(zd),ax=gu(Ha);function Lp(s){return _u(s)?Wa(yn(s)):Bb(s)}function ux(s){return function(l){return s==null?t:Ir(s,l)}}var cx=Bh(),fx=Bh(!0);function $u(){return[]}function Hu(){return!1}function dx(){return{}}function hx(){return""}function px(){return!0}function mx(s,l){if(s=te(s),s<1||s>Ue)return[];var c=Ve,h=st(s,Ve);l=J(l),s-=Ve;for(var g=Ka(h,l);++c<s;)l(c);return g}function gx(s){return ee(s)?ke(s,yn):Et(s)?[s]:gt(ep(ye(s)))}function yx(s){var l=++C2;return ye(s)+l}var bx=Oo(function(s,l){return s+l},0),vx=yu("ceil"),Sx=Oo(function(s,l){return s/l},1),wx=yu("floor");function xx(s){return s&&s.length?_o(s,vt,nu):t}function _x(s,l){return s&&s.length?_o(s,J(l,2),nu):t}function kx(s){return $d(s,vt)}function Ex(s,l){return $d(s,J(l,2))}function Mx(s){return s&&s.length?_o(s,vt,ou):t}function Tx(s,l){return s&&s.length?_o(s,J(l,2),ou):t}var Cx=Oo(function(s,l){return s*l},1),Ax=yu("round"),Ox=Oo(function(s,l){return s-l},0);function Ix(s){return s&&s.length?Va(s,vt):0}function Nx(s,l){return s&&s.length?Va(s,J(l,2)):0}return b.after=e5,b.ary=fp,b.assign=H5,b.assignIn=Ep,b.assignInWith=Uo,b.assignWith=W5,b.at=U5,b.before=dp,b.bind=Au,b.bindAll=Jw,b.bindKey=hp,b.castArray=d5,b.chain=ap,b.chunk=wv,b.compact=xv,b.concat=_v,b.cond=jw,b.conforms=Yw,b.constant=Du,b.countBy=IS,b.create=V5,b.curry=pp,b.curryRight=mp,b.debounce=gp,b.defaults=K5,b.defaultsDeep=G5,b.defer=t5,b.delay=n5,b.difference=kv,b.differenceBy=Ev,b.differenceWith=Mv,b.drop=Tv,b.dropRight=Cv,b.dropRightWhile=Av,b.dropWhile=Ov,b.fill=Iv,b.filter=RS,b.flatMap=DS,b.flatMapDeep=zS,b.flatMapDepth=BS,b.flatten=ip,b.flattenDeep=Nv,b.flattenDepth=Rv,b.flip=r5,b.flow=Zw,b.flowRight=Qw,b.fromPairs=Lv,b.functions=Q5,b.functionsIn=ew,b.groupBy=FS,b.initial=Dv,b.intersection=zv,b.intersectionBy=Bv,b.intersectionWith=Fv,b.invert=nw,b.invertBy=rw,b.invokeMap=HS,b.iteratee=zu,b.keyBy=WS,b.keys=Ke,b.keysIn=bt,b.map=zo,b.mapKeys=sw,b.mapValues=ow,b.matches=ex,b.matchesProperty=tx,b.memoize=Fo,b.merge=lw,b.mergeWith=Mp,b.method=nx,b.methodOf=rx,b.mixin=Bu,b.negate=$o,b.nthArg=sx,b.omit=aw,b.omitBy=uw,b.once=i5,b.orderBy=US,b.over=ox,b.overArgs=s5,b.overEvery=lx,b.overSome=ax,b.partial=Ou,b.partialRight=yp,b.partition=VS,b.pick=cw,b.pickBy=Tp,b.property=Lp,b.propertyOf=ux,b.pull=Uv,b.pullAll=op,b.pullAllBy=Vv,b.pullAllWith=Kv,b.pullAt=Gv,b.range=cx,b.rangeRight=fx,b.rearg=o5,b.reject=qS,b.remove=qv,b.rest=l5,b.reverse=Tu,b.sampleSize=jS,b.set=dw,b.setWith=hw,b.shuffle=YS,b.slice=Jv,b.sortBy=QS,b.sortedUniq=tS,b.sortedUniqBy=nS,b.split=Dw,b.spread=a5,b.tail=rS,b.take=iS,b.takeRight=sS,b.takeRightWhile=oS,b.takeWhile=lS,b.tap=xS,b.throttle=u5,b.thru=Do,b.toArray=xp,b.toPairs=Cp,b.toPairsIn=Ap,b.toPath=gx,b.toPlainObject=kp,b.transform=pw,b.unary=c5,b.union=aS,b.unionBy=uS,b.unionWith=cS,b.uniq=fS,b.uniqBy=dS,b.uniqWith=hS,b.unset=mw,b.unzip=Cu,b.unzipWith=lp,b.update=gw,b.updateWith=yw,b.values=bi,b.valuesIn=bw,b.without=pS,b.words=Np,b.wrap=f5,b.xor=mS,b.xorBy=gS,b.xorWith=yS,b.zip=bS,b.zipObject=vS,b.zipObjectDeep=SS,b.zipWith=wS,b.entries=Cp,b.entriesIn=Ap,b.extend=Ep,b.extendWith=Uo,Bu(b,b),b.add=bx,b.attempt=Rp,b.camelCase=xw,b.capitalize=Op,b.ceil=vx,b.clamp=vw,b.clone=h5,b.cloneDeep=m5,b.cloneDeepWith=g5,b.cloneWith=p5,b.conformsTo=y5,b.deburr=Ip,b.defaultTo=Xw,b.divide=Sx,b.endsWith=_w,b.eq=rn,b.escape=kw,b.escapeRegExp=Ew,b.every=NS,b.find=LS,b.findIndex=np,b.findKey=q5,b.findLast=PS,b.findLastIndex=rp,b.findLastKey=J5,b.floor=wx,b.forEach=up,b.forEachRight=cp,b.forIn=j5,b.forInRight=Y5,b.forOwn=X5,b.forOwnRight=Z5,b.get=Ru,b.gt=b5,b.gte=v5,b.has=tw,b.hasIn=Lu,b.head=sp,b.identity=vt,b.includes=$S,b.indexOf=Pv,b.inRange=Sw,b.invoke=iw,b.isArguments=Lr,b.isArray=ee,b.isArrayBuffer=S5,b.isArrayLike=yt,b.isArrayLikeObject=Ie,b.isBoolean=w5,b.isBuffer=or,b.isDate=x5,b.isElement=_5,b.isEmpty=k5,b.isEqual=E5,b.isEqualWith=M5,b.isError=Iu,b.isFinite=T5,b.isFunction=Pn,b.isInteger=bp,b.isLength=Ho,b.isMap=vp,b.isMatch=C5,b.isMatchWith=A5,b.isNaN=O5,b.isNative=I5,b.isNil=R5,b.isNull=N5,b.isNumber=Sp,b.isObject=Te,b.isObjectLike=Oe,b.isPlainObject=bs,b.isRegExp=Nu,b.isSafeInteger=L5,b.isSet=wp,b.isString=Wo,b.isSymbol=Et,b.isTypedArray=yi,b.isUndefined=P5,b.isWeakMap=D5,b.isWeakSet=z5,b.join=$v,b.kebabCase=Mw,b.last=$t,b.lastIndexOf=Hv,b.lowerCase=Tw,b.lowerFirst=Cw,b.lt=B5,b.lte=F5,b.max=xx,b.maxBy=_x,b.mean=kx,b.meanBy=Ex,b.min=Mx,b.minBy=Tx,b.stubArray=$u,b.stubFalse=Hu,b.stubObject=dx,b.stubString=hx,b.stubTrue=px,b.multiply=Cx,b.nth=Wv,b.noConflict=ix,b.noop=Fu,b.now=Bo,b.pad=Aw,b.padEnd=Ow,b.padStart=Iw,b.parseInt=Nw,b.random=ww,b.reduce=KS,b.reduceRight=GS,b.repeat=Rw,b.replace=Lw,b.result=fw,b.round=Ax,b.runInContext=k,b.sample=JS,b.size=XS,b.snakeCase=Pw,b.some=ZS,b.sortedIndex=jv,b.sortedIndexBy=Yv,b.sortedIndexOf=Xv,b.sortedLastIndex=Zv,b.sortedLastIndexBy=Qv,b.sortedLastIndexOf=eS,b.startCase=zw,b.startsWith=Bw,b.subtract=Ox,b.sum=Ix,b.sumBy=Nx,b.template=Fw,b.times=mx,b.toFinite=Dn,b.toInteger=te,b.toLength=_p,b.toLower=$w,b.toNumber=Ht,b.toSafeInteger=$5,b.toString=ye,b.toUpper=Hw,b.trim=Ww,b.trimEnd=Uw,b.trimStart=Vw,b.truncate=Kw,b.unescape=Gw,b.uniqueId=yx,b.upperCase=qw,b.upperFirst=Pu,b.each=up,b.eachRight=cp,b.first=sp,Bu(b,function(){var s={};return mn(b,function(l,c){ve.call(b.prototype,c)||(s[c]=l)}),s}(),{chain:!1}),b.VERSION=r,Pt(["bind","bindKey","curry","curryRight","partial","partialRight"],function(s){b[s].placeholder=b}),Pt(["drop","take"],function(s,l){ue.prototype[s]=function(c){c=c===t?1:Be(te(c),0);var h=this.__filtered__&&!l?new ue(this):this.clone();return h.__filtered__?h.__takeCount__=st(c,h.__takeCount__):h.__views__.push({size:st(c,Ve),type:s+(h.__dir__<0?"Right":"")}),h},ue.prototype[s+"Right"]=function(c){return this.reverse()[s](c).reverse()}}),Pt(["filter","map","takeWhile"],function(s,l){var c=l+1,h=c==Xt||c==He;ue.prototype[s]=function(g){var v=this.clone();return v.__iteratees__.push({iteratee:J(g,3),type:c}),v.__filtered__=v.__filtered__||h,v}}),Pt(["head","last"],function(s,l){var c="take"+(l?"Right":"");ue.prototype[s]=function(){return this[c](1).value()[0]}}),Pt(["initial","tail"],function(s,l){var c="drop"+(l?"":"Right");ue.prototype[s]=function(){return this.__filtered__?new ue(this):this[c](1)}}),ue.prototype.compact=function(){return this.filter(vt)},ue.prototype.find=function(s){return this.filter(s).head()},ue.prototype.findLast=function(s){return this.reverse().find(s)},ue.prototype.invokeMap=se(function(s,l){return typeof s=="function"?new ue(this):this.map(function(c){return ds(c,s,l)})}),ue.prototype.reject=function(s){return this.filter($o(J(s)))},ue.prototype.slice=function(s,l){s=te(s);var c=this;return c.__filtered__&&(s>0||l<0)?new ue(c):(s<0?c=c.takeRight(-s):s&&(c=c.drop(s)),l!==t&&(l=te(l),c=l<0?c.dropRight(-l):c.take(l-s)),c)},ue.prototype.takeRightWhile=function(s){return this.reverse().takeWhile(s).reverse()},ue.prototype.toArray=function(){return this.take(Ve)},mn(ue.prototype,function(s,l){var c=/^(?:filter|find|map|reject)|While$/.test(l),h=/^(?:head|last)$/.test(l),g=b[h?"take"+(l=="last"?"Right":""):l],v=h||/^find/.test(l);g&&(b.prototype[l]=function(){var x=this.__wrapped__,_=h?[1]:arguments,E=x instanceof ue,I=_[0],N=E||ee(x),R=function(le){var fe=g.apply(b,Qn([le],_));return h&&$?fe[0]:fe};N&&c&&typeof I=="function"&&I.length!=1&&(E=N=!1);var $=this.__chain__,K=!!this.__actions__.length,j=v&&!$,re=E&&!K;if(!v&&N){x=re?x:new ue(this);var Y=s.apply(x,_);return Y.__actions__.push({func:Do,args:[R],thisArg:t}),new zt(Y,$)}return j&&re?s.apply(this,_):(Y=this.thru(R),j?h?Y.value()[0]:Y.value():Y)})}),Pt(["pop","push","shift","sort","splice","unshift"],function(s){var l=lo[s],c=/^(?:push|sort|unshift)$/.test(s)?"tap":"thru",h=/^(?:pop|shift)$/.test(s);b.prototype[s]=function(){var g=arguments;if(h&&!this.__chain__){var v=this.value();return l.apply(ee(v)?v:[],g)}return this[c](function(x){return l.apply(ee(x)?x:[],g)})}}),mn(ue.prototype,function(s,l){var c=b[l];if(c){var h=c.name+"";ve.call(di,h)||(di[h]=[]),di[h].push({name:l,func:c})}}),di[Ao(t,O).name]=[{name:"wrapper",func:t}],ue.prototype.clone=G2,ue.prototype.reverse=q2,ue.prototype.value=J2,b.prototype.at=_S,b.prototype.chain=kS,b.prototype.commit=ES,b.prototype.next=MS,b.prototype.plant=CS,b.prototype.reverse=AS,b.prototype.toJSON=b.prototype.valueOf=b.prototype.value=OS,b.prototype.first=b.prototype.head,is&&(b.prototype[is]=TS),b},ui=E2();Mr?((Mr.exports=ui)._=ui,za._=ui):Ze._=ui}).call(EO)}(Js,Js.exports)),Js.exports}var W1=MO();function jf(n){return n.type.create(W1.cloneDeep(n.attrs))}const TO=Pe.create({name:"node_processor",addCommands(){return{setBlockAttributes:P(({commands:n,state:e},t,r,i={})=>{const o=z(n.getBlockAttributes(t))??{},{doc:a,tr:u}=e,{from:f,to:d}=u.selection;a.nodesBetween(f,d,(m,p)=>{ne.blocks.includes(m.type.name)&&u.setNodeAttribute(p,t,{...i,...o,...r})})}),getBlockAttributes:P(({editor:n},e,t)=>he(()=>{let r=Object.assign({},t||{});for(const i of ne.blocks)Object.assign(r,n.getAttributes(i)?.[e]||{});return Object.keys(r).length?r:null})),removeBlockAttributes:P(({commands:n},e)=>{for(const t of ne.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:d}=o.selection,m=vn(de.LINK,u),p=vn(t,u);if(!(p.spec.group||"").includes(cn.SETTINGS))return e.setMark(t,r);if(f.pos===d.pos)return;const S=w=>{if(!i.onAppliedToParent||i.onAppliedToParent(w)===!1){const{tr:M,node:T,position:O,mark:F}=w;e._removeNodeMark({tr:M,node:T,position:O,mark:F.type})}};a.nodesBetween(f.pos,d.pos,(w,M)=>{if(w.type.name===ne.LIST)return;const T=kO(w.marks,t),O=p.create({...T?.attrs||{},...r}),F=F1(f,d,w,M);if(!m.isInSet(w.marks)&&_O(o.doc,M,O,i.isAppliedToParent))return S({tr:o,node:w,position:M,mark:O});if(w.isText){o.addMark(F.from,F.to,O);return}wO(o.doc,o.selection,w,M)&&o.addNodeMark(M,O)})}),getMarks:P(({editor:n},e)=>{const t=xi(n,"state");return he(()=>{const{selection:r,doc:i}=z(t),{from:o,to:a}=z(r),u=[];return i.nodesBetween(o,a,f=>{for(const d of f.marks)d.type.name===e&&u.unshift(d.attrs)}),u})}),getMark:P(({commands:n},e)=>{const t=n.getMarks(e);return he(()=>z(t)[0]??null)}),hasMark:P(({commands:n},e)=>{const t=n.getMark(e);return he(()=>!!z(t))}),getCommonSettingMark:P(({commands:n},e,t)=>{const r=n.getMark(e);return he(()=>z(r)?.value??z(t))}),getDeviceSettingMark:P(({commands:n},e,t)=>{const r=n.getMarks(e),i=n.getDevice();return he(()=>{for(const o of z(r)){const a=o[z(i)];if(a)return a}return z(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 d=u.marks.filter(m=>t.includes(m.type.name));for(const m of d)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))}}}),CO=Pe.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=F1(t,r,i,o),u=Math.max(0,t.pos-o),f=Math.max(0,r.pos-o),d=e({text:i.textContent.substring(u,f)}),m=n.schema.text(d,i.marks);n.tr.replaceWith(a.from,a.to,m)})})}}}),AO=Pe.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:$1(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===ne.DOCUMENT)})}}}),OO=Jn.create({name:"doc",topNode:!0,content:"block+"});class Ys extends lt{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=Hr.fromJSON(this.schema,e.toJSON());return t.attrs.meta[this.key]=this.value,De.ok(t)}invert(){return new Ys(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 Ys(e.key,e.value,e.stepType)}}lt.jsonID("setDocAttr",Ys);const IO=OO.extend({marks:cn.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 Ys(e,t,n.schema))})}}}),NO=Jn.create({name:"paragraph",priority:1e3,addOptions(){return{HTMLAttributes:{}}},group:"block",content:"inline*",parseHTML(){return[{tag:"p"}]},renderHTML({HTMLAttributes:n}){return["p",Di(this.options.HTMLAttributes,n),0]},addCommands(){return{setParagraph:()=>({commands:n})=>n.setNode(this.name)}},addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}}),RO=NO.extend({marks:cn.ALL,addOptions:()=>({HTMLAttributes:{class:"zw-style"}})}),LO=Jn.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]}`,Di(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=>hC({find:new RegExp(`^(#{1,${n}})\\s$`),type:this.type,getAttributes:{level:n}}))}}),PO=LO.extend({marks:cn.ALL,addOptions:()=>({levels:[1,2,3,4],HTMLAttributes:{class:"zw-style"}})}),DO=Pe.create({name:"prose_mirror_plugins",addProseMirrorPlugins(){return[MC.create(this.editor),TC.create(this.editor)]}}),zO=()=>[IO,RO,PO,gC,EC,TO,CO,AO,DO],BO=It.create({name:de.FONT_FAMILY,group:cn.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=z(n.getFontWeight());t.isWeightSupported(r)||(r=t.findClosestWeight(r),n.applyFontWeight(r));const i=n.isSettingCustomized(de.FONT_STYLE).value;!t.isItalicSupported(r)&&i&&n.removeItalic()}),getFont:P(({commands:n})=>{const e=z(this.options.defaultPreset),t=n.findFontByName(e.common.font_family),r=n.getFontFamily();return he(()=>n.findFontByName(z(r))||t)}),findFontByName:P((n,e)=>z(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 he(()=>z(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 Xr({font_family:e})}}),FO=Pe.create({name:de.STYLE_PRESET,addGlobalAttributes(){return[{types:[ne.PARAGRAPH,ne.HEADING],attributes:{preset:{isRequired:!1,default:{id:z(this.options.defaultId)},parseHTML:n=>{const e=z(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=z(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:z(this.options.defaultId)}:null},renderHTML:n=>n.preset?{class:z(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(()=>he(()=>z(this.options.presets).filter(t=>!t.hidden))),getPreset:P(({commands:t})=>{const r=t.getBlockAttributes("preset",{id:z(this.options.defaultId)}),i=t.getPresetList(),o=t.isLink(),a=t.getLinkPreset();return he(()=>{const u=n(z(i),z(r).id);if(!z(o))return u;const f=z(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=z(t.getPresetList()),a=n(o,i),u=a.node?.type??ne.PARAGRAPH,f={preset:{id:i}};a.node&&(f.level=a.node.level);for(const d of de.attributes)f[d]=z(t.getBlockAttributes(d));r().removeList().setNode(u,f).run()}),applyDefaultPreset:P(({commands:t})=>{t.applyPreset(z(this.options.defaultId))}),removePreset:P(({commands:t})=>{t.setNode(ne.PARAGRAPH,{preset:null})}),getPresetCustomization:P(({editor:t,commands:r})=>{const i=xi(t,"state");return he(()=>{const{selection:o,doc:a}=z(i),{from:u,to:f}=o;return r._getSettingCustomization(a,u,f)})}),isSettingCustomized:P(({commands:t},r)=>{const i=t.getPresetCustomization(),o=de.presetAttributes.includes(r)?"attributes":"marks";return he(()=>z(i)[o]?.includes(r)??!1)}),getContentCustomization:P(({editor:t,commands:r})=>{const i=xi(t,"state");return he(()=>{const{doc:o}=z(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[d,m]of Object.entries(f.attrs))de.presetAttributes.includes(d)&&m&&u.add(d);for(const{type:d}of f.marks)de.marks.includes(d.name)&&a.add(d.name)}),{attributes:Array.from(u),marks:Array.from(a)}}),removePresetCustomization:P(({chain:t})=>{t().storeSelection().expandSelectionToBlock().removeMarks(de.marks).resetAttributes(ne.PARAGRAPH,de.presetAttributes).resetAttributes(ne.HEADING,de.presetAttributes).restoreSelection().run()}),removeFormat:P(({chain:t})=>{t().storeSelection().expandSelectionToBlock().removeAllMarks().applyDefaultPreset().restoreSelection().run()})}},onCreate(){this.options.styleRenderer.inject(Ki.head,z(this.options.presets))}}),$O=It.create({name:de.FONT_WEIGHT,group:cn.SETTINGS,addAttributes:()=>({value:{required:!0}}),addCommands(){return{applyFontWeight:P(({commands:n},e)=>{n.applyMark(this.name,{value:e}),z(n.getFont()).isItalicSupported(e)||n.removeItalic()}),toggleBold:P(({commands:n})=>{const e=z(n.getFontWeight()),t=z(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 he(()=>{const r=z(e),i=z(t);return i.isWeightSupported(r)?r:i.findClosestWeight(r)})}),getDefaultFontWeight:P(({commands:n})=>{const e=n.getPreset();return he(()=>z(e).common.font_weight)})}},addKeyboardShortcuts:()=>({"Mod-b":qt("toggleBold"),"Mod-B":qt("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 Xr({font_weight:n.value})}}),HO=It.create({name:de.FONT_SIZE,group:cn.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 he(()=>z(t)[z(e)].font_size.replace("px",""))}),applyFontSize:P(({commands:n},e)=>{const t=z(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 d=a.type.create(u);if(i.isText){r.addMark(o,o+i.nodeSize,d);return}r.addNodeMark(o,d)}})}),increaseFontSize:P(({commands:n})=>{const e=Number(z(n.getFontSize())),t=Math.min(e+1,z(this.options.maxSize));n.applyFontSize(String(t))}),decreaseFontSize:P(({commands:n})=>{const e=Number(z(n.getFontSize())),t=Math.max(e-1,z(this.options.minSize));n.applyFontSize(String(t))})}},addKeyboardShortcuts:()=>({"Mod-Shift-=":qt("increaseFontSize"),"Mod-Shift--":qt("decreaseFontSize")}),parseHTML(){const n=e=>{if(!e)return null;const t=z(this.options.wrapperRef),r=B1(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 Xr({font_size_mobile:e(n.mobile),font_size_tablet:e(n.tablet),font_size_desktop:e(n.desktop)})}}),WO=It.create({name:de.FONT_COLOR,group:cn.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 he(()=>z(e).common.color)}),applyFontColor:P(({commands:n},e)=>{n.applyMark(this.name,{value:e})})}},parseHTML(){const n=e=>({value:z1(e)});return[{style:"--zw-font-color",getAttrs:n},{style:"color",getAttrs:n}]},renderHTML({HTMLAttributes:n}){return Xr({font_color:n.value})}}),UO=It.create({name:de.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:z1(e)});return[{style:"--zw-background-color",getAttrs:n},{style:"background-color",getAttrs:n}]},renderHTML({HTMLAttributes:n}){return Xr({background_color:n.value})}}),VO=Pe.create({name:"device_manager",addCommands(){return{getDevice:P(()=>xi(this.options,"device"))}}}),KO=It.create({name:de.FONT_STYLE,group:cn.SETTINGS,addAttributes:()=>({italic:{required:!0}}),addCommands(){return{isItalic:P(({commands:n})=>{const e=n.getMark(this.name),t=n.getDefaultFontStyle();return he(()=>z(e)?.italic??z(t).italic)}),isItalicAvailable:P(({commands:n})=>{const e=n.getFont(),t=n.getFontWeight();return he(()=>{const r=z(e),i=z(t);return r.isItalicSupported(i)&&!r.isWeightItalicOnly(i)})}),getDefaultFontStyle:P(({commands:n})=>{const e=n.getPreset();return he(()=>({italic:z(e).common.font_style==="italic"}))}),toggleItalic:P(({commands:n})=>{z(n.isItalicAvailable())&&(z(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":qt("toggleItalic"),"Mod-I":qt("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 Xr({font_style:e})}}),GO=It.create({name:de.TEXT_DECORATION,priority:1e3,addAttributes:()=>({underline:{default:!1},strike_through:{default:!1}}),addCommands(){return{isUnderline:P(({commands:n})=>{const e=n.getTextDecoration();return he(()=>z(e).underline)}),isStrikeThrough:P(({commands:n})=>{const e=n.getTextDecoration();return he(()=>z(e).strike_through)}),getTextDecoration:P(({commands:n})=>{const e=n.getMark(this.name),t=n.getDefaultTextDecoration();return he(()=>{const r=z(e)??{},i=z(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 he(()=>z(e)!==z(t).underline)}),getDefaultTextDecoration:P(({commands:n})=>{const e=n.getPreset();return he(()=>{const{text_decoration:t}=z(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=z(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":qt("toggleUnderline"),"Mod-U":qt("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"),Xr({text_decoration:e.join(" ")})}}),qO=Pe.create({name:"case_style",addCommands(){return{applyCaseStyle:P(({commands:n},e)=>{switch(e){case hf.CAPITALIZE:return n.applyCapitalize();case hf.LOWERCASE:return n.applyLowerCase();case hf.UPPERCASE:return n.applyUpperCase()}}),applyCapitalize:P(({commands:n})=>{n.transformText(({text:e})=>JC(e))}),applyLowerCase:P(({commands:n})=>{n.transformText(({text:e})=>e.toLowerCase())}),applyUpperCase:P(({commands:n})=>{n.transformText(({text:e})=>e.toUpperCase())})}}}),U1={mobile:null,tablet:null,desktop:null},JO=Pe.create({name:de.ALIGNMENT,addGlobalAttributes:()=>[{types:[ne.PARAGRAPH,ne.HEADING],attributes:{[de.ALIGNMENT]:{isRequired:!1,parseHTML({style:n}){const e=SO(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?ia({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=z(n.getDevice());n.setBlockAttributes(this.name,{[t]:e},U1)}),removeAlignment:P(({commands:n})=>n.removeBlockAttributes(this.name)),getAlignment:P(({commands:n})=>{const e=n.getBlockAttributes(this.name,U1),t=n.getDevice(),r=n.getDefaultAlignment();return he(()=>z(e)?.[z(t)]??z(r))}),getDefaultAlignment:P(({commands:n})=>{const e=n.getDevice(),t=n.getPreset();return he(()=>z(t)[z(e)].alignment??br.LEFT)})}},addKeyboardShortcuts:()=>({"Mod-Shift-l":qt("applyAlignment",br.LEFT),"Mod-Shift-e":qt("applyAlignment",br.CENTER),"Mod-Shift-r":qt("applyAlignment",br.RIGHT),"Mod-Shift-j":qt("applyAlignment",br.JUSTIFY)})}),V1={mobile:null,tablet:null,desktop:null},jO=Pe.create({name:de.LINE_HEIGHT,addGlobalAttributes(){return[{types:[ne.PARAGRAPH,ne.HEADING],attributes:{[de.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=z(this.options.wrapperRef),r=bO(e,n,t);return r?{desktop:r,tablet:r,mobile:null}:null},renderHTML(n){return n.line_height?ia({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,V1),t=n.getDevice(),r=n.getDefaultLineHeight();return he(()=>z(e)?.[z(t)]??z(r))}),getDefaultLineHeight:P(({commands:n})=>{const e=n.getDevice(),t=n.getPreset();return he(()=>z(t)[z(e)].line_height)}),applyLineHeight:P(({commands:n},e)=>{const t=z(n.getDevice());n.setBlockAttributes(this.name,{[t]:e},V1)})}}}),YO=Jn.create({name:"listItem",addOptions(){return{HTMLAttributes:{},bulletListTypeName:"bulletList",orderedListTypeName:"orderedList"}},content:"paragraph block*",defining:!0,parseHTML(){return[{tag:"li"}]},renderHTML({HTMLAttributes:n}){return["li",Di(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)}}}),XO=YO.extend({name:ne.LIST_ITEM,marks:cn.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,jf(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===ne.LIST))return t.listItemNewline()}})}),ZO=Jn.create({name:ne.LIST,content:`${ne.LIST_ITEM}+`,group:"block list",marks:cn.SETTINGS,addExtensions:()=>[XO],addOptions:()=>({baseClass:"",presetClass:""}),addAttributes:()=>({bullet:{default:{type:Kt.DISC}}}),parseHTML(){const n={a:Kt.ROMAN,i:Kt.LATIN,1:Kt.DECIMAL},e=t=>{for(const r of Kt.values){const i=`.${z(this.options.baseClass)}${r}`;if(t.matches(i)||n[t.type.toLowerCase()]===r)return r}};return[{tag:"ol",getAttrs:t=>({bullet:{type:e(t)||Kt.DECIMAL}})},{tag:"ul",getAttrs:t=>({bullet:{type:e(t)||Kt.DISC}})}]},renderHTML({HTMLAttributes:n}){const e=[z(this.options.baseClass)+n.bullet.type,z(this.options.presetClass)];return[Kt.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 he(()=>z(e).type??null)}),applyList:P(({commands:n,chain:e},t)=>{if(z(n.getListType())===t){n.removeList();return}return e().applyDefaultPreset().toggleList(ne.LIST,ne.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(de.inlineMarks.includes(f.type)||f.type.isInSet(u.marks))return!1;for(const d of u.content.content)if(d.childCount&&(!d.marks||!f.isInSet(d.marks)))return!1;return!0}t.nodesBetween(i,o,(u,f)=>{if(u.type.name===ne.LIST)return;if(u.type.name!==ne.LIST_ITEM)return!1;const d=[];return u.forEach(m=>{for(const p of m.marks){if(p.isInSet(d)){e.removeNodeMark(f+1,p);continue}a(u,p)&&(e.removeNodeMark(f+1,p),e.addNodeMark(f,jf(p)),d.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,d)=>{if([ne.LIST,ne.LIST_ITEM].includes(u.type.name))return;if(d.type.name!==ne.LIST_ITEM)return!1;const m=d.marks.filter(function(p){return!p.type.isInSet(u.marks)});for(const p of m)t.addNodeMark(f,jf(p));return!1}),n.liftListItem(ne.LIST_ITEM)})}},addInputRules(){const n=(e,t)=>pC({find:t,type:this.type,getAttributes:{bullet:{type:e}},joinPredicate:(r,{attrs:i})=>i.bullet.type===e});return[n(Kt.DISC,/^\s*([-+*])\s$/),n(Kt.DECIMAL,/^(\d+)\.\s$/),n(Kt.LATIN,/^([ivx]{1,3})\.\s$/i),n(Kt.ROMAN,/^([a-z])\.\s$/i)]}});function QO(n){return new At({key:new an("autolink"),appendTransaction:(e,t,r)=>{const i=e.some(d=>d.docChanged)&&!t.doc.eq(r.doc),o=e.some(d=>d.getMeta("preventAutolink"));if(!i||o)return;const{tr:a}=r,u=DT(t.doc,[...e]);if(KT(u).forEach(({newRange:d})=>{const m=BT(r.doc,d,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(d.from,d.to," "," ").endsWith(" ")&&(p=m[0],y=r.doc.textBetween(p.pos,d.to,void 0," ")),p&&y){const S=y.split(" ").filter(T=>T!=="");if(S.length<=0)return!1;const w=S[S.length-1],M=p.pos+y.lastIndexOf(w);if(!w)return!1;Rf(w).filter(T=>T.isLink).map(T=>({...T,from:M+T.start+1,to:M+T.end+1})).filter(T=>r.schema.marks.code?!r.doc.rangeHasMark(T.from,T.to,r.schema.marks.code):!0).filter(T=>n.validate?n.validate(T.value):!0).forEach(T=>{d0(T.from,T.to,r.doc).some(O=>O.mark.type===n.type)||a.addMark(T.from,T.to,n.type.create({href:T.href}))})}}),!!a.steps.length)return a}})}function eI(n){return new At({key:new an("handleClickLink"),props:{handleClick:(e,t,r)=>{var i,o;if(r.button!==0||r.target.nodeName!=="A")return!1;const u=WT(e.state,n.type.name),f=r.target,d=(i=f?.href)!==null&&i!==void 0?i:u.href,m=(o=f?.target)!==null&&o!==void 0?o:u.target;return f&&d?(e.editable&&window.open(d,m),!0):!1}}})}function tI(n){return new At({key:new an("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(w=>{f+=w.textContent});const d=Rf(f).find(w=>w.isLink&&w.value===f);if(!f||!d)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]:d.href;return n.editor.commands.setMark(n.type,{href:S}),!0}}})}const nI=It.create({name:"link",priority:1e3,keepOnSplit:!1,onCreate(){this.options.protocols.forEach(n=>{if(typeof n=="string"){D0(n);return}D0(n.scheme,n.optionalSlashes)})},onDestroy(){VC()},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",Di(this.options.HTMLAttributes,{...n,href:""}),0]:["a",Di(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[mC({find:n=>Rf(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(QO({type:this.type,validate:this.options.validate})),this.options.openOnClick&&n.push(eI({type:this.type})),this.options.linkOnPaste&&n.push(tI({editor:this.editor,type:this.type})),n}}),rI=nI.extend({name:de.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:x0.SELF,parseHTML:n=>n.getAttribute("target")||x0.SELF},destination:{default:Bs.URL,parseHTML:n=>{const e=n.getAttribute("href");if(!e.startsWith("#"))return Bs.URL;const t=e.replace("#","");return z(this.options.pageBlocks).find(o=>o.id===parseInt(t))?Bs.BLOCK:Bs.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(G1.text(r.text,[G1.mark(de.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(()=>he(()=>z(this.options.preset)))}},addProseMirrorPlugins(){return[...this.parent(),qC.create(this.editor)]},renderHTML({HTMLAttributes:n}){const e=n.destination===Bs.BLOCK?`#${n.href}`:n.href,t=z(this.options.basePresetClass)+z(this.options.preset).id;return["a",{href:e,target:n.target,class:`${t} zw-style`},0]}}),iI=It.create({name:de.SUPERSCRIPT,addCommands(){return{applySuperscript:P(({commands:n})=>{n.setMark(this.name)}),removeSuperscript:P(({commands:n})=>{n.unsetMark(this.name)}),toggleSuperscript:P(({commands:n})=>{z(n.isSuperscript())?n.removeSuperscript():n.applySuperscript()}),isSuperscript:P(({commands:n})=>{const e=n.getMark(this.name);return he(()=>!!z(e))})}},parseHTML(){return[{tag:"sup"},{style:"vertical-align",getAttrs:n=>n!=="super"?!1:null}]},renderHTML(){return["sup",{class:"zw-superscript"},0]}}),sI=Pe.create({name:de.MARGIN,addGlobalAttributes:()=>[{types:[ne.PARAGRAPH,ne.HEADING],attributes:{[de.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?ia({margin:n.margin.value}):null}}}}]});function oI(n){const e=r=>n.presetsRef.value.find(i=>i.id===r),t=rc({default:null,link:null});return tk(n.presetsRef,()=>{t.default=e(n.defaultPresetId),t.link=e(n.linkPresetId)},{immediate:!0,deep:!0}),zO().concat([FO.configure({presets:n.presetsRef,defaultId:n.defaultPresetId,styleRenderer:new uI({baseClass:n.basePresetClass,makeVariable:n.makePresetVariable,linkPresetId:n.linkPresetId})}),ZO.configure({baseClass:n.baseListClass,presetClass:n.basePresetClass+n.defaultPresetId}),VO.configure({device:n.deviceRef}),HO.configure({minSize:n.minFontSize,maxSize:n.maxFontSize,wrapperRef:n.wrapperRef}),BO.configure({fonts:n.fonts,defaultPreset:xi(t,"default"),defaultFont:n.defaultFont}),$O,WO,UO,KO,GO,qO,iI,JO,jO.configure({wrapperRef:n.wrapperRef}),rI.configure({preset:xi(t,"link"),basePresetClass:n.basePresetClass,pageBlocks:n.pageBlocksRef}),sI])}class lI{_domParser=new DOMParser;types=window;parse(e){return this._domParser.parseFromString(e,"text/html")}}class K1{content;constructor({content:e}){this.content=e}normalize(){throw new Error("Implement abstract method")}}class kn extends K1{static BLOCK_NODE_NAMES=["P","H1","H2","H3","H4"];static ROOT_NODE_NAMES=kn.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,kn.BLOCK_STYLES),t.append(u)};this._assignElementProperties(e,e.parentElement,kn.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,kn.BLOCK_STYLES),this._removeStyleProperties(e.parentElement,kn.BLOCK_STYLES),this._assignElementProperties(e,e.parentElement),e.parentElement.lastElementChild===e&&this._removeStyleProperties(e.parentElement)}_isBlockNode(e){return kn.BLOCK_NODE_NAMES.includes(e.tagName)}_isRootNode(e){return kn.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,kn.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 aI extends K1{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!==ne.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(de.inlineMarks.includes(t.type)||this._includesMarkType(e,t.type))return!1;for(const r of e.content)if(!(!r.content&&e.type===ne.LIST_ITEM)&&(!r.marks||!this._includesMark(r,t)))return!1;return!0}_includesMark(e,t){return e.marks?.some(r=>W1.isEqual(r,t))??!1}_includesMarkType(e,t){return e.marks?.some(r=>r.type===t)??!1}_isLink(e){return e.type===ne.TEXT&&this._includesMarkType(e,de.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 va{static build(e,t={}){return typeof e=="string"?this._buildHtml(e,t):this._buildJson(e)}static _buildHtml(e,t){return new kn({content:e,parser:t.parser||new lI})}static _buildJson(e){return new aI({content:e})}static normalize(e,t={}){return va.build(e,t).normalize()}}class Ki{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 rd{static build({config:e,nodeDomParser:t}){const r=oI({fonts:e.fonts,minFontSize:0,maxFontSize:0,presetsRef:Qo(e.presets),defaultPresetId:e.defaultPresetId,linkPresetId:e.linkPresetId,makePresetVariable:()=>"",basePresetClass:e.basePresetClass,baseListClass:e.baseListClass,deviceRef:Qo(df.DESKTOP),pageBlocksRef:Qo([]),wrapperRef:Ki.document.createElement("p")}),i=$T(r);return new rd({schema:i,domParser:vc.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=va.build(e,{parser:this._nodeDomParser});return t.normalizeHTML(),this._domParser.parse(t.dom.body).toJSON()}}class G1{static doc(e){return{type:ne.DOCUMENT,content:e}}static list(e,t){return{type:ne.LIST,attrs:{bullet:{type:e}},content:t.map(r=>r.type===ne.LIST_ITEM?r:this.listItem([].concat(r)))}}static listItem(...e){const{attrs:t,content:r,marks:i}=this._normalizeTextBlockArgs(e);return{type:ne.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:ne.HEADING,...r}}static paragraph(...e){return{type:ne.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:ne.TEXT,...t?{marks:t}:{},text:e}}static link(e,t,r=[]){return this.text(e,[this.mark(de.LINK,t),...r])}static mark(e,t){return{type:e,attrs:t}}static populateAllDevices(e){return{mobile:e,tablet:e,desktop:e}}}class uI{_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=Ki.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 df.values)for(const u of Object.keys(r[a])){const f=this._makeVariable({device:a,preset:r,property:u}),d=this._makeInternalVariableName(u,a);if(t+=`${d}: var(${f}, inherit);`,i&&!de.attributes.includes(u)){const m=d.replace("preset-","");t+=`${m}: var(${d});`}}t+="}"}return t}_makeInternalVariableName(e,t){const r=e==="color"?"font-color":e.replace(/_/i,"-"),i=t===df.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 id{static _instance;static get instance(){return this._instance??=new id,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 cI{static createWindow(){return new Dp.JSDOM().window}types;parse(e){const{window:t}=new Dp.JSDOM(e);return this.types=t,t.document}}exports.ContentSerializer=rd,exports.ContextWindow=Ki,exports.NodeDomParser=cI;
38
+ }`;var re=Rp(function(){return ge(v,K+"return "+R).apply(t,x)});if(re.source=R,Iu(re))throw re;return re}function $w(s){return ye(s).toLowerCase()}function Hw(s){return ye(s).toUpperCase()}function Ww(s,l,c){if(s=ye(s),s&&(c||l===t))return Wh(s);if(!s||!(l=Et(l)))return s;var d=tn(s),g=tn(l),v=Uh(d,g),x=Vh(d,g)+1;return sr(d,v,x).join("")}function Uw(s,l,c){if(s=ye(s),s&&(c||l===t))return s.slice(0,Gh(s)+1);if(!s||!(l=Et(l)))return s;var d=tn(s),g=Vh(d,tn(l))+1;return sr(d,0,g).join("")}function Vw(s,l,c){if(s=ye(s),s&&(c||l===t))return s.replace(Ia,"");if(!s||!(l=Et(l)))return s;var d=tn(s),g=Uh(d,tn(l));return sr(d,g).join("")}function Kw(s,l){var c=ri,d=Yt;if(Te(l)){var g="separator"in l?l.separator:g;c="length"in l?te(l.length):c,d="omission"in l?Et(l.omission):d}s=ye(s);var v=s.length;if(li(s)){var x=tn(s);v=x.length}if(c>=v)return s;var _=c-ai(d);if(_<1)return d;var k=x?sr(x,0,_).join(""):s.slice(0,_);if(g===t)return k+d;if(x&&(_+=k.length-_),Nu(g)){if(s.slice(_).search(g)){var I,N=k;for(g.global||(g=Ja(g.source,ye(ch.exec(g))+"g")),g.lastIndex=0;I=g.exec(N);)var R=I.index;k=k.slice(0,R===t?_:R)}}else if(s.indexOf(Et(g),_)!=_){var $=k.lastIndexOf(g);$>-1&&(k=k.slice(0,$))}return k+d}function Gw(s){return s=ye(s),s&&ry.test(s)?s.replace(lh,w2):s}var qw=mi(function(s,l,c){return s+(c?" ":"")+l.toUpperCase()}),Pu=Ld("toUpperCase");function Np(s,l,c){return s=ye(s),l=c?t:l,l===t?g2(s)?E2(s):l2(s):s.match(l)||[]}var Rp=se(function(s,l){try{return xt(s,t,l)}catch(c){return Iu(c)?c:new Q(c)}}),Jw=Rn(function(s,l){return Pt(l,function(c){c=yn(c),In(s,c,Au(s[c],s))}),s});function jw(s){var l=s==null?0:s.length,c=J();return s=l?Ee(s,function(d){if(typeof d[1]!="function")throw new Dt(a);return[c(d[0]),d[1]]}):[],se(function(d){for(var g=-1;++g<l;){var v=s[g];if(xt(v[0],this,d))return xt(v[1],this,d)}})}function Yw(s){return wb(Bt(s,p))}function Du(s){return function(){return s}}function Xw(s,l){return s==null||s!==s?l:s}var Zw=Dd(),Qw=Dd(!0);function vt(s){return s}function zu(s){return hd(typeof s=="function"?s:Bt(s,p))}function ex(s){return pd(Bt(s,p))}function tx(s,l){return md(s,Bt(l,p))}var nx=se(function(s,l){return function(c){return hs(c,s,l)}}),rx=se(function(s,l){return function(c){return hs(s,c,l)}});function Bu(s,l,c){var d=Ke(l),g=Eo(l,d);c==null&&!(Te(l)&&(g.length||!d.length))&&(c=l,l=s,s=this,g=Eo(l,Ke(l)));var v=!(Te(c)&&"chain"in c)||!!c.chain,x=Pn(s);return Pt(g,function(_){var k=l[_];s[_]=k,x&&(s.prototype[_]=function(){var I=this.__chain__;if(v||I){var N=s(this.__wrapped__),R=N.__actions__=gt(this.__actions__);return R.push({func:k,args:arguments,thisArg:s}),N.__chain__=I,N}return k.apply(s,Qn([this.value()],arguments))})}),s}function ix(){return Ze._===this&&(Ze._=O2),this}function Fu(){}function sx(s){return s=te(s),se(function(l){return gd(l,s)})}var ox=gu(Ee),lx=gu(zh),ax=gu(Ha);function Lp(s){return _u(s)?Wa(yn(s)):Bb(s)}function ux(s){return function(l){return s==null?t:Ir(s,l)}}var cx=Bd(),fx=Bd(!0);function $u(){return[]}function Hu(){return!1}function hx(){return{}}function dx(){return""}function px(){return!0}function mx(s,l){if(s=te(s),s<1||s>Ue)return[];var c=Ve,d=st(s,Ve);l=J(l),s-=Ve;for(var g=Ka(d,l);++c<s;)l(c);return g}function gx(s){return ee(s)?Ee(s,yn):kt(s)?[s]:gt(ep(ye(s)))}function yx(s){var l=++C2;return ye(s)+l}var bx=Oo(function(s,l){return s+l},0),vx=yu("ceil"),Sx=Oo(function(s,l){return s/l},1),wx=yu("floor");function xx(s){return s&&s.length?_o(s,vt,nu):t}function _x(s,l){return s&&s.length?_o(s,J(l,2),nu):t}function Ex(s){return $h(s,vt)}function kx(s,l){return $h(s,J(l,2))}function Mx(s){return s&&s.length?_o(s,vt,ou):t}function Tx(s,l){return s&&s.length?_o(s,J(l,2),ou):t}var Cx=Oo(function(s,l){return s*l},1),Ax=yu("round"),Ox=Oo(function(s,l){return s-l},0);function Ix(s){return s&&s.length?Va(s,vt):0}function Nx(s,l){return s&&s.length?Va(s,J(l,2)):0}return b.after=eS,b.ary=fp,b.assign=HS,b.assignIn=kp,b.assignInWith=Uo,b.assignWith=WS,b.at=US,b.before=hp,b.bind=Au,b.bindAll=Jw,b.bindKey=dp,b.castArray=hS,b.chain=ap,b.chunk=wv,b.compact=xv,b.concat=_v,b.cond=jw,b.conforms=Yw,b.constant=Du,b.countBy=I5,b.create=VS,b.curry=pp,b.curryRight=mp,b.debounce=gp,b.defaults=KS,b.defaultsDeep=GS,b.defer=tS,b.delay=nS,b.difference=Ev,b.differenceBy=kv,b.differenceWith=Mv,b.drop=Tv,b.dropRight=Cv,b.dropRightWhile=Av,b.dropWhile=Ov,b.fill=Iv,b.filter=R5,b.flatMap=D5,b.flatMapDeep=z5,b.flatMapDepth=B5,b.flatten=ip,b.flattenDeep=Nv,b.flattenDepth=Rv,b.flip=rS,b.flow=Zw,b.flowRight=Qw,b.fromPairs=Lv,b.functions=QS,b.functionsIn=ew,b.groupBy=F5,b.initial=Dv,b.intersection=zv,b.intersectionBy=Bv,b.intersectionWith=Fv,b.invert=nw,b.invertBy=rw,b.invokeMap=H5,b.iteratee=zu,b.keyBy=W5,b.keys=Ke,b.keysIn=bt,b.map=zo,b.mapKeys=sw,b.mapValues=ow,b.matches=ex,b.matchesProperty=tx,b.memoize=Fo,b.merge=lw,b.mergeWith=Mp,b.method=nx,b.methodOf=rx,b.mixin=Bu,b.negate=$o,b.nthArg=sx,b.omit=aw,b.omitBy=uw,b.once=iS,b.orderBy=U5,b.over=ox,b.overArgs=sS,b.overEvery=lx,b.overSome=ax,b.partial=Ou,b.partialRight=yp,b.partition=V5,b.pick=cw,b.pickBy=Tp,b.property=Lp,b.propertyOf=ux,b.pull=Uv,b.pullAll=op,b.pullAllBy=Vv,b.pullAllWith=Kv,b.pullAt=Gv,b.range=cx,b.rangeRight=fx,b.rearg=oS,b.reject=q5,b.remove=qv,b.rest=lS,b.reverse=Tu,b.sampleSize=j5,b.set=hw,b.setWith=dw,b.shuffle=Y5,b.slice=Jv,b.sortBy=Q5,b.sortedUniq=t5,b.sortedUniqBy=n5,b.split=Dw,b.spread=aS,b.tail=r5,b.take=i5,b.takeRight=s5,b.takeRightWhile=o5,b.takeWhile=l5,b.tap=x5,b.throttle=uS,b.thru=Do,b.toArray=xp,b.toPairs=Cp,b.toPairsIn=Ap,b.toPath=gx,b.toPlainObject=Ep,b.transform=pw,b.unary=cS,b.union=a5,b.unionBy=u5,b.unionWith=c5,b.uniq=f5,b.uniqBy=h5,b.uniqWith=d5,b.unset=mw,b.unzip=Cu,b.unzipWith=lp,b.update=gw,b.updateWith=yw,b.values=bi,b.valuesIn=bw,b.without=p5,b.words=Np,b.wrap=fS,b.xor=m5,b.xorBy=g5,b.xorWith=y5,b.zip=b5,b.zipObject=v5,b.zipObjectDeep=S5,b.zipWith=w5,b.entries=Cp,b.entriesIn=Ap,b.extend=kp,b.extendWith=Uo,Bu(b,b),b.add=bx,b.attempt=Rp,b.camelCase=xw,b.capitalize=Op,b.ceil=vx,b.clamp=vw,b.clone=dS,b.cloneDeep=mS,b.cloneDeepWith=gS,b.cloneWith=pS,b.conformsTo=yS,b.deburr=Ip,b.defaultTo=Xw,b.divide=Sx,b.endsWith=_w,b.eq=rn,b.escape=Ew,b.escapeRegExp=kw,b.every=N5,b.find=L5,b.findIndex=np,b.findKey=qS,b.findLast=P5,b.findLastIndex=rp,b.findLastKey=JS,b.floor=wx,b.forEach=up,b.forEachRight=cp,b.forIn=jS,b.forInRight=YS,b.forOwn=XS,b.forOwnRight=ZS,b.get=Ru,b.gt=bS,b.gte=vS,b.has=tw,b.hasIn=Lu,b.head=sp,b.identity=vt,b.includes=$5,b.indexOf=Pv,b.inRange=Sw,b.invoke=iw,b.isArguments=Lr,b.isArray=ee,b.isArrayBuffer=SS,b.isArrayLike=yt,b.isArrayLikeObject=Ie,b.isBoolean=wS,b.isBuffer=or,b.isDate=xS,b.isElement=_S,b.isEmpty=ES,b.isEqual=kS,b.isEqualWith=MS,b.isError=Iu,b.isFinite=TS,b.isFunction=Pn,b.isInteger=bp,b.isLength=Ho,b.isMap=vp,b.isMatch=CS,b.isMatchWith=AS,b.isNaN=OS,b.isNative=IS,b.isNil=RS,b.isNull=NS,b.isNumber=Sp,b.isObject=Te,b.isObjectLike=Oe,b.isPlainObject=bs,b.isRegExp=Nu,b.isSafeInteger=LS,b.isSet=wp,b.isString=Wo,b.isSymbol=kt,b.isTypedArray=yi,b.isUndefined=PS,b.isWeakMap=DS,b.isWeakSet=zS,b.join=$v,b.kebabCase=Mw,b.last=$t,b.lastIndexOf=Hv,b.lowerCase=Tw,b.lowerFirst=Cw,b.lt=BS,b.lte=FS,b.max=xx,b.maxBy=_x,b.mean=Ex,b.meanBy=kx,b.min=Mx,b.minBy=Tx,b.stubArray=$u,b.stubFalse=Hu,b.stubObject=hx,b.stubString=dx,b.stubTrue=px,b.multiply=Cx,b.nth=Wv,b.noConflict=ix,b.noop=Fu,b.now=Bo,b.pad=Aw,b.padEnd=Ow,b.padStart=Iw,b.parseInt=Nw,b.random=ww,b.reduce=K5,b.reduceRight=G5,b.repeat=Rw,b.replace=Lw,b.result=fw,b.round=Ax,b.runInContext=E,b.sample=J5,b.size=X5,b.snakeCase=Pw,b.some=Z5,b.sortedIndex=jv,b.sortedIndexBy=Yv,b.sortedIndexOf=Xv,b.sortedLastIndex=Zv,b.sortedLastIndexBy=Qv,b.sortedLastIndexOf=e5,b.startCase=zw,b.startsWith=Bw,b.subtract=Ox,b.sum=Ix,b.sumBy=Nx,b.template=Fw,b.times=mx,b.toFinite=Dn,b.toInteger=te,b.toLength=_p,b.toLower=$w,b.toNumber=Ht,b.toSafeInteger=$S,b.toString=ye,b.toUpper=Hw,b.trim=Ww,b.trimEnd=Uw,b.trimStart=Vw,b.truncate=Kw,b.unescape=Gw,b.uniqueId=yx,b.upperCase=qw,b.upperFirst=Pu,b.each=up,b.eachRight=cp,b.first=sp,Bu(b,function(){var s={};return mn(b,function(l,c){ve.call(b.prototype,c)||(s[c]=l)}),s}(),{chain:!1}),b.VERSION=r,Pt(["bind","bindKey","curry","curryRight","partial","partialRight"],function(s){b[s].placeholder=b}),Pt(["drop","take"],function(s,l){ue.prototype[s]=function(c){c=c===t?1:Be(te(c),0);var d=this.__filtered__&&!l?new ue(this):this.clone();return d.__filtered__?d.__takeCount__=st(c,d.__takeCount__):d.__views__.push({size:st(c,Ve),type:s+(d.__dir__<0?"Right":"")}),d},ue.prototype[s+"Right"]=function(c){return this.reverse()[s](c).reverse()}}),Pt(["filter","map","takeWhile"],function(s,l){var c=l+1,d=c==Xt||c==He;ue.prototype[s]=function(g){var v=this.clone();return v.__iteratees__.push({iteratee:J(g,3),type:c}),v.__filtered__=v.__filtered__||d,v}}),Pt(["head","last"],function(s,l){var c="take"+(l?"Right":"");ue.prototype[s]=function(){return this[c](1).value()[0]}}),Pt(["initial","tail"],function(s,l){var c="drop"+(l?"":"Right");ue.prototype[s]=function(){return this.__filtered__?new ue(this):this[c](1)}}),ue.prototype.compact=function(){return this.filter(vt)},ue.prototype.find=function(s){return this.filter(s).head()},ue.prototype.findLast=function(s){return this.reverse().find(s)},ue.prototype.invokeMap=se(function(s,l){return typeof s=="function"?new ue(this):this.map(function(c){return hs(c,s,l)})}),ue.prototype.reject=function(s){return this.filter($o(J(s)))},ue.prototype.slice=function(s,l){s=te(s);var c=this;return c.__filtered__&&(s>0||l<0)?new ue(c):(s<0?c=c.takeRight(-s):s&&(c=c.drop(s)),l!==t&&(l=te(l),c=l<0?c.dropRight(-l):c.take(l-s)),c)},ue.prototype.takeRightWhile=function(s){return this.reverse().takeWhile(s).reverse()},ue.prototype.toArray=function(){return this.take(Ve)},mn(ue.prototype,function(s,l){var c=/^(?: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__,_=d?[1]:arguments,k=x instanceof ue,I=_[0],N=k||ee(x),R=function(le){var fe=g.apply(b,Qn([le],_));return d&&$?fe[0]:fe};N&&c&&typeof I=="function"&&I.length!=1&&(k=N=!1);var $=this.__chain__,K=!!this.__actions__.length,j=v&&!$,re=k&&!K;if(!v&&N){x=re?x:new ue(this);var Y=s.apply(x,_);return Y.__actions__.push({func:Do,args:[R],thisArg:t}),new zt(Y,$)}return j&&re?s.apply(this,_):(Y=this.thru(R),j?d?Y.value()[0]:Y.value():Y)})}),Pt(["pop","push","shift","sort","splice","unshift"],function(s){var l=lo[s],c=/^(?: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(ee(v)?v:[],g)}return this[c](function(x){return l.apply(ee(x)?x:[],g)})}}),mn(ue.prototype,function(s,l){var c=b[l];if(c){var d=c.name+"";ve.call(hi,d)||(hi[d]=[]),hi[d].push({name:l,func:c})}}),hi[Ao(t,O).name]=[{name:"wrapper",func:t}],ue.prototype.clone=G2,ue.prototype.reverse=q2,ue.prototype.value=J2,b.prototype.at=_5,b.prototype.chain=E5,b.prototype.commit=k5,b.prototype.next=M5,b.prototype.plant=C5,b.prototype.reverse=A5,b.prototype.toJSON=b.prototype.valueOf=b.prototype.value=O5,b.prototype.first=b.prototype.head,is&&(b.prototype[is]=T5),b},ui=k2();Mr?((Mr.exports=ui)._=ui,za._=ui):Ze._=ui}).call(kO)}(Js,Js.exports)),Js.exports}var W1=MO();function jf(n){return n.type.create(W1.cloneDeep(n.attrs))}const TO=Pe.create({name:"node_processor",addCommands(){return{setBlockAttributes:P(({commands:n,state:e},t,r,i={})=>{const o=z(n.getBlockAttributes(t))??{},{doc:a,tr:u}=e,{from:f,to:h}=u.selection;a.nodesBetween(f,h,(m,p)=>{ne.blocks.includes(m.type.name)&&u.setNodeAttribute(p,t,{...i,...o,...r})})}),getBlockAttributes:P(({editor:n},e,t)=>de(()=>{let r=Object.assign({},t||{});for(const i of ne.blocks)Object.assign(r,n.getAttributes(i)?.[e]||{});return Object.keys(r).length?r:null})),removeBlockAttributes:P(({commands:n},e)=>{for(const t of ne.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=vn(he.LINK,u),p=vn(t,u);if(!(p.spec.group||"").includes(cn.SETTINGS))return e.setMark(t,r);if(f.pos===h.pos)return;const S=w=>{if(!i.onAppliedToParent||i.onAppliedToParent(w)===!1){const{tr:M,node:T,position:O,mark:F}=w;e._removeNodeMark({tr:M,node:T,position:O,mark:F.type})}};a.nodesBetween(f.pos,h.pos,(w,M)=>{if(w.type.name===ne.LIST)return;const T=EO(w.marks,t),O=p.create({...T?.attrs||{},...r}),F=F1(f,h,w,M);if(!m.isInSet(w.marks)&&_O(o.doc,M,O,i.isAppliedToParent))return S({tr:o,node:w,position:M,mark:O});if(w.isText){o.addMark(F.from,F.to,O);return}wO(o.doc,o.selection,w,M)&&o.addNodeMark(M,O)})}),getMarks:P(({editor:n},e)=>{const t=xi(n,"state");return de(()=>{const{selection:r,doc:i}=z(t),{from:o,to:a}=z(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 de(()=>z(t)[0]??null)}),hasMark:P(({commands:n},e)=>{const t=n.getMark(e);return de(()=>!!z(t))}),getCommonSettingMark:P(({commands:n},e,t)=>{const r=n.getMark(e);return de(()=>z(r)?.value??z(t))}),getDeviceSettingMark:P(({commands:n},e,t)=>{const r=n.getMarks(e),i=n.getDevice();return de(()=>{for(const o of z(r)){const a=o[z(i)];if(a)return a}return z(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))}}}),CO=Pe.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=F1(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)})})}}}),AO=Pe.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:$1(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===ne.DOCUMENT)})}}}),OO=Jn.create({name:"doc",topNode:!0,content:"block+"});class Ys extends lt{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=Hr.fromJSON(this.schema,e.toJSON());return t.attrs.meta[this.key]=this.value,De.ok(t)}invert(){return new Ys(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 Ys(e.key,e.value,e.stepType)}}lt.jsonID("setDocAttr",Ys);const IO=OO.extend({marks:cn.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 Ys(e,t,n.schema))})}}}),NO=Jn.create({name:"paragraph",priority:1e3,addOptions(){return{HTMLAttributes:{}}},group:"block",content:"inline*",parseHTML(){return[{tag:"p"}]},renderHTML({HTMLAttributes:n}){return["p",Di(this.options.HTMLAttributes,n),0]},addCommands(){return{setParagraph:()=>({commands:n})=>n.setNode(this.name)}},addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}}),RO=NO.extend({marks:cn.ALL,addOptions:()=>({HTMLAttributes:{class:"zw-style"}})}),LO=Jn.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]}`,Di(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=>dC({find:new RegExp(`^(#{1,${n}})\\s$`),type:this.type,getAttributes:{level:n}}))}}),PO=LO.extend({marks:cn.ALL,addOptions:()=>({levels:[1,2,3,4],HTMLAttributes:{class:"zw-style"}})}),DO=Pe.create({name:"prose_mirror_plugins",addProseMirrorPlugins(){return[MC.create(this.editor),TC.create(this.editor)]}}),zO=()=>[IO,RO,PO,gC,kC,TO,CO,AO,DO],BO=It.create({name:he.FONT_FAMILY,group:cn.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=z(n.getFontWeight());t.isWeightSupported(r)||(r=t.findClosestWeight(r),n.applyFontWeight(r));const i=n.isSettingCustomized(he.FONT_STYLE).value;!t.isItalicSupported(r)&&i&&n.removeItalic()}),getFont:P(({commands:n})=>{const e=z(this.options.defaultPreset),t=n.findFontByName(e.common.font_family),r=n.getFontFamily();return de(()=>n.findFontByName(z(r))||t)}),findFontByName:P((n,e)=>z(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(()=>z(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 Xr({font_family:e})}}),FO=Pe.create({name:he.STYLE_PRESET,addGlobalAttributes(){return[{types:[ne.PARAGRAPH,ne.HEADING],attributes:{preset:{isRequired:!1,default:{id:z(this.options.defaultId)},parseHTML:n=>{const e=z(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=z(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:z(this.options.defaultId)}:null},renderHTML:n=>n.preset?{class:z(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(()=>de(()=>z(this.options.presets).filter(t=>!t.hidden))),getPreset:P(({commands:t})=>{const r=t.getBlockAttributes("preset",{id:z(this.options.defaultId)}),i=t.getPresetList(),o=t.isLink(),a=t.getLinkPreset();return de(()=>{const u=n(z(i),z(r).id);if(!z(o))return u;const f=z(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=z(t.getPresetList()),a=n(o,i),u=a.node?.type??ne.PARAGRAPH,f={preset:{id:i}};a.node&&(f.level=a.node.level);for(const h of he.attributes)f[h]=z(t.getBlockAttributes(h));r().removeList().setNode(u,f).run()}),applyDefaultPreset:P(({commands:t})=>{t.applyPreset(z(this.options.defaultId))}),removePreset:P(({commands:t})=>{t.setNode(ne.PARAGRAPH,{preset:null})}),getPresetCustomization:P(({editor:t,commands:r})=>{const i=xi(t,"state");return de(()=>{const{selection:o,doc:a}=z(i),{from:u,to:f}=o;return r._getSettingCustomization(a,u,f)})}),isSettingCustomized:P(({commands:t},r)=>{const i=t.getPresetCustomization(),o=he.presetAttributes.includes(r)?"attributes":"marks";return de(()=>z(i)[o]?.includes(r)??!1)}),getContentCustomization:P(({editor:t,commands:r})=>{const i=xi(t,"state");return de(()=>{const{doc:o}=z(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))he.presetAttributes.includes(h)&&m&&u.add(h);for(const{type:h}of f.marks)he.marks.includes(h.name)&&a.add(h.name)}),{attributes:Array.from(u),marks:Array.from(a)}}),removePresetCustomization:P(({chain:t})=>{t().storeSelection().expandSelectionToBlock().removeMarks(he.marks).resetAttributes(ne.PARAGRAPH,he.presetAttributes).resetAttributes(ne.HEADING,he.presetAttributes).restoreSelection().run()}),removeFormat:P(({chain:t})=>{t().storeSelection().expandSelectionToBlock().removeAllMarks().applyDefaultPreset().restoreSelection().run()})}},onCreate(){this.options.styleRenderer.inject(Ki.head,z(this.options.presets))}}),$O=It.create({name:he.FONT_WEIGHT,group:cn.SETTINGS,addAttributes:()=>({value:{required:!0}}),addCommands(){return{applyFontWeight:P(({commands:n},e)=>{n.applyMark(this.name,{value:e}),z(n.getFont()).isItalicSupported(e)||n.removeItalic()}),toggleBold:P(({commands:n})=>{const e=z(n.getFontWeight()),t=z(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=z(e),i=z(t);return i.isWeightSupported(r)?r:i.findClosestWeight(r)})}),getDefaultFontWeight:P(({commands:n})=>{const e=n.getPreset();return de(()=>z(e).common.font_weight)})}},addKeyboardShortcuts:()=>({"Mod-b":qt("toggleBold"),"Mod-B":qt("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 Xr({font_weight:n.value})}}),HO=It.create({name:he.FONT_SIZE,group:cn.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(()=>z(t)[z(e)].font_size.replace("px",""))}),applyFontSize:P(({commands:n},e)=>{const t=z(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(z(n.getFontSize())),t=Math.min(e+1,z(this.options.maxSize));n.applyFontSize(String(t))}),decreaseFontSize:P(({commands:n})=>{const e=Number(z(n.getFontSize())),t=Math.max(e-1,z(this.options.minSize));n.applyFontSize(String(t))})}},addKeyboardShortcuts:()=>({"Mod-Shift-=":qt("increaseFontSize"),"Mod-Shift--":qt("decreaseFontSize")}),parseHTML(){const n=e=>{if(!e)return null;const t=z(this.options.wrapperRef),r=B1(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 Xr({font_size_mobile:e(n.mobile),font_size_tablet:e(n.tablet),font_size_desktop:e(n.desktop)})}}),WO=It.create({name:he.FONT_COLOR,group:cn.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(()=>z(e).common.color)}),applyFontColor:P(({commands:n},e)=>{n.applyMark(this.name,{value:e})})}},parseHTML(){const n=e=>({value:z1(e)});return[{style:"--zw-font-color",getAttrs:n},{style:"color",getAttrs:n}]},renderHTML({HTMLAttributes:n}){return Xr({font_color:n.value})}}),UO=It.create({name:he.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:z1(e)});return[{style:"--zw-background-color",getAttrs:n},{style:"background-color",getAttrs:n}]},renderHTML({HTMLAttributes:n}){return Xr({background_color:n.value})}}),VO=Pe.create({name:"device_manager",addCommands(){return{getDevice:P(()=>xi(this.options,"device"))}}}),KO=It.create({name:he.FONT_STYLE,group:cn.SETTINGS,addAttributes:()=>({italic:{required:!0}}),addCommands(){return{isItalic:P(({commands:n})=>{const e=n.getMark(this.name),t=n.getDefaultFontStyle();return de(()=>z(e)?.italic??z(t).italic)}),isItalicAvailable:P(({commands:n})=>{const e=n.getFont(),t=n.getFontWeight();return de(()=>{const r=z(e),i=z(t);return r.isItalicSupported(i)&&!r.isWeightItalicOnly(i)})}),getDefaultFontStyle:P(({commands:n})=>{const e=n.getPreset();return de(()=>({italic:z(e).common.font_style==="italic"}))}),toggleItalic:P(({commands:n})=>{z(n.isItalicAvailable())&&(z(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":qt("toggleItalic"),"Mod-I":qt("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 Xr({font_style:e})}}),GO=It.create({name:he.TEXT_DECORATION,priority:1e3,addAttributes:()=>({underline:{default:!1},strike_through:{default:!1}}),addCommands(){return{isUnderline:P(({commands:n})=>{const e=n.getTextDecoration();return de(()=>z(e).underline)}),isStrikeThrough:P(({commands:n})=>{const e=n.getTextDecoration();return de(()=>z(e).strike_through)}),getTextDecoration:P(({commands:n})=>{const e=n.getMark(this.name),t=n.getDefaultTextDecoration();return de(()=>{const r=z(e)??{},i=z(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(()=>z(e)!==z(t).underline)}),getDefaultTextDecoration:P(({commands:n})=>{const e=n.getPreset();return de(()=>{const{text_decoration:t}=z(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=z(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":qt("toggleUnderline"),"Mod-U":qt("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"),Xr({text_decoration:e.join(" ")})}}),qO=Pe.create({name:"case_style",addCommands(){return{applyCaseStyle:P(({commands:n},e)=>{switch(e){case df.CAPITALIZE:return n.applyCapitalize();case df.LOWERCASE:return n.applyLowerCase();case df.UPPERCASE:return n.applyUpperCase()}}),applyCapitalize:P(({commands:n})=>{n.transformText(({text:e})=>JC(e))}),applyLowerCase:P(({commands:n})=>{n.transformText(({text:e})=>e.toLowerCase())}),applyUpperCase:P(({commands:n})=>{n.transformText(({text:e})=>e.toUpperCase())})}}}),U1={mobile:null,tablet:null,desktop:null},JO=Pe.create({name:he.ALIGNMENT,addGlobalAttributes:()=>[{types:[ne.PARAGRAPH,ne.HEADING],attributes:{[he.ALIGNMENT]:{isRequired:!1,parseHTML({style:n}){const e=SO(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?ia({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=z(n.getDevice());n.setBlockAttributes(this.name,{[t]:e},U1)}),removeAlignment:P(({commands:n})=>n.removeBlockAttributes(this.name)),getAlignment:P(({commands:n})=>{const e=n.getBlockAttributes(this.name,U1),t=n.getDevice(),r=n.getDefaultAlignment();return de(()=>z(e)?.[z(t)]??z(r))}),getDefaultAlignment:P(({commands:n})=>{const e=n.getDevice(),t=n.getPreset();return de(()=>z(t)[z(e)].alignment??br.LEFT)})}},addKeyboardShortcuts:()=>({"Mod-Shift-l":qt("applyAlignment",br.LEFT),"Mod-Shift-e":qt("applyAlignment",br.CENTER),"Mod-Shift-r":qt("applyAlignment",br.RIGHT),"Mod-Shift-j":qt("applyAlignment",br.JUSTIFY)})}),V1={mobile:null,tablet:null,desktop:null},jO=Pe.create({name:he.LINE_HEIGHT,addGlobalAttributes(){return[{types:[ne.PARAGRAPH,ne.HEADING],attributes:{[he.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=z(this.options.wrapperRef),r=bO(e,n,t);return r?{desktop:r,tablet:r,mobile:null}:null},renderHTML(n){return n.line_height?ia({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,V1),t=n.getDevice(),r=n.getDefaultLineHeight();return de(()=>z(e)?.[z(t)]??z(r))}),getDefaultLineHeight:P(({commands:n})=>{const e=n.getDevice(),t=n.getPreset();return de(()=>z(t)[z(e)].line_height)}),applyLineHeight:P(({commands:n},e)=>{const t=z(n.getDevice());n.setBlockAttributes(this.name,{[t]:e},V1)})}}}),YO=Jn.create({name:"listItem",addOptions(){return{HTMLAttributes:{},bulletListTypeName:"bulletList",orderedListTypeName:"orderedList"}},content:"paragraph block*",defining:!0,parseHTML(){return[{tag:"li"}]},renderHTML({HTMLAttributes:n}){return["li",Di(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)}}}),XO=YO.extend({name:ne.LIST_ITEM,marks:cn.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,jf(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===ne.LIST))return t.listItemNewline()}})}),ZO=Jn.create({name:ne.LIST,content:`${ne.LIST_ITEM}+`,group:"block list",marks:cn.SETTINGS,addExtensions:()=>[XO],addOptions:()=>({baseClass:"",presetClass:""}),addAttributes:()=>({bullet:{default:{type:Kt.DISC}}}),parseHTML(){const n={a:Kt.ROMAN,i:Kt.LATIN,1:Kt.DECIMAL},e=t=>{for(const r of Kt.values){const i=`.${z(this.options.baseClass)}${r}`;if(t.matches(i)||n[t.type.toLowerCase()]===r)return r}};return[{tag:"ol",getAttrs:t=>({bullet:{type:e(t)||Kt.DECIMAL}})},{tag:"ul",getAttrs:t=>({bullet:{type:e(t)||Kt.DISC}})}]},renderHTML({HTMLAttributes:n}){const e=[z(this.options.baseClass)+n.bullet.type,z(this.options.presetClass)];return[Kt.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(()=>z(e).type??null)}),applyList:P(({commands:n,chain:e},t)=>{if(z(n.getListType())===t){n.removeList();return}return e().applyDefaultPreset().toggleList(ne.LIST,ne.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(he.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===ne.LIST)return;if(u.type.name!==ne.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,jf(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([ne.LIST,ne.LIST_ITEM].includes(u.type.name))return;if(h.type.name!==ne.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,jf(p));return!1}),n.liftListItem(ne.LIST_ITEM)})}},addInputRules(){const n=(e,t)=>pC({find:t,type:this.type,getAttributes:{bullet:{type:e}},joinPredicate:(r,{attrs:i})=>i.bullet.type===e});return[n(Kt.DISC,/^\s*([-+*])\s$/),n(Kt.DECIMAL,/^(\d+)\.\s$/),n(Kt.LATIN,/^([ivx]{1,3})\.\s$/i),n(Kt.ROMAN,/^([a-z])\.\s$/i)]}});function QO(n){return new At({key:new an("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=DT(t.doc,[...e]);if(KT(u).forEach(({newRange:h})=>{const m=BT(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(T=>T!=="");if(S.length<=0)return!1;const w=S[S.length-1],M=p.pos+y.lastIndexOf(w);if(!w)return!1;Rf(w).filter(T=>T.isLink).map(T=>({...T,from:M+T.start+1,to:M+T.end+1})).filter(T=>r.schema.marks.code?!r.doc.rangeHasMark(T.from,T.to,r.schema.marks.code):!0).filter(T=>n.validate?n.validate(T.value):!0).forEach(T=>{h0(T.from,T.to,r.doc).some(O=>O.mark.type===n.type)||a.addMark(T.from,T.to,n.type.create({href:T.href}))})}}),!!a.steps.length)return a}})}function eI(n){return new At({key:new an("handleClickLink"),props:{handleClick:(e,t,r)=>{var i,o;if(r.button!==0||r.target.nodeName!=="A")return!1;const u=WT(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 tI(n){return new At({key:new an("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(w=>{f+=w.textContent});const h=Rf(f).find(w=>w.isLink&&w.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 nI=It.create({name:"link",priority:1e3,keepOnSplit:!1,onCreate(){this.options.protocols.forEach(n=>{if(typeof n=="string"){D0(n);return}D0(n.scheme,n.optionalSlashes)})},onDestroy(){VC()},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",Di(this.options.HTMLAttributes,{...n,href:""}),0]:["a",Di(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[mC({find:n=>Rf(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(QO({type:this.type,validate:this.options.validate})),this.options.openOnClick&&n.push(eI({type:this.type})),this.options.linkOnPaste&&n.push(tI({editor:this.editor,type:this.type})),n}}),rI=nI.extend({name:he.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:x0.SELF,parseHTML:n=>n.getAttribute("target")||x0.SELF},destination:{default:Bs.URL,parseHTML:n=>{const e=n.getAttribute("href");if(!e.startsWith("#"))return Bs.URL;const t=e.replace("#","");return z(this.options.pageBlocks).find(o=>o.id===parseInt(t))?Bs.BLOCK:Bs.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(G1.text(r.text,[G1.mark(he.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(()=>z(this.options.preset)))}},addProseMirrorPlugins(){return[...this.parent(),qC.create(this.editor)]},renderHTML({HTMLAttributes:n}){const e=n.destination===Bs.BLOCK?`#${n.href}`:n.href,t=z(this.options.basePresetClass)+z(this.options.preset).id;return["a",{href:e,target:n.target,class:`${t} zw-style`},0]}}),iI=It.create({name:he.SUPERSCRIPT,addCommands(){return{applySuperscript:P(({commands:n})=>{n.setMark(this.name)}),removeSuperscript:P(({commands:n})=>{n.unsetMark(this.name)}),toggleSuperscript:P(({commands:n})=>{z(n.isSuperscript())?n.removeSuperscript():n.applySuperscript()}),isSuperscript:P(({commands:n})=>{const e=n.getMark(this.name);return de(()=>!!z(e))})}},parseHTML(){return[{tag:"sup"},{style:"vertical-align",getAttrs:n=>n!=="super"?!1:null}]},renderHTML(){return["sup",{class:"zw-superscript"},0]}}),sI=Pe.create({name:he.MARGIN,addGlobalAttributes:()=>[{types:[ne.PARAGRAPH,ne.HEADING],attributes:{[he.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?ia({margin:n.margin.value}):null}}}}]});function oI(n){const e=r=>n.presetsRef.value.find(i=>i.id===r),t=rc({default:null,link:null});return tE(n.presetsRef,()=>{t.default=e(n.defaultPresetId),t.link=e(n.linkPresetId)},{immediate:!0,deep:!0}),zO().concat([FO.configure({presets:n.presetsRef,defaultId:n.defaultPresetId,styleRenderer:new uI({baseClass:n.basePresetClass,makeVariable:n.makePresetVariable,linkPresetId:n.linkPresetId})}),ZO.configure({baseClass:n.baseListClass,presetClass:n.basePresetClass+n.defaultPresetId}),VO.configure({device:n.deviceRef}),HO.configure({minSize:n.minFontSize,maxSize:n.maxFontSize,wrapperRef:n.wrapperRef}),BO.configure({fonts:n.fonts,defaultPreset:xi(t,"default"),defaultFont:n.defaultFont}),$O,WO,UO,KO,GO,qO,iI,JO,jO.configure({wrapperRef:n.wrapperRef}),rI.configure({preset:xi(t,"link"),basePresetClass:n.basePresetClass,pageBlocks:n.pageBlocksRef}),sI])}class lI{_domParser=new DOMParser;types=window;parse(e){return this._domParser.parseFromString(e,"text/html")}}class K1{content;constructor({content:e}){this.content=e}normalize(){throw new Error("Implement abstract method")}}class En extends K1{static BLOCK_NODE_NAMES=["P","H1","H2","H3","H4"];static ROOT_NODE_NAMES=En.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,En.BLOCK_STYLES),t.append(u)};this._assignElementProperties(e,e.parentElement,En.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,En.BLOCK_STYLES),this._removeStyleProperties(e.parentElement,En.BLOCK_STYLES),this._assignElementProperties(e,e.parentElement),e.parentElement.lastElementChild===e&&this._removeStyleProperties(e.parentElement)}_isBlockNode(e){return En.BLOCK_NODE_NAMES.includes(e.tagName)}_isRootNode(e){return En.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,En.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 aI extends K1{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!==ne.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(he.inlineMarks.includes(t.type)||this._includesMarkType(e,t.type))return!1;for(const r of e.content)if(!(!r.content&&e.type===ne.LIST_ITEM)&&(!r.marks||!this._includesMark(r,t)))return!1;return!0}_includesMark(e,t){return e.marks?.some(r=>W1.isEqual(r,t))??!1}_includesMarkType(e,t){return e.marks?.some(r=>r.type===t)??!1}_isLink(e){return e.type===ne.TEXT&&this._includesMarkType(e,he.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 va{static build(e,t={}){return typeof e=="string"?this._buildHtml(e,t):this._buildJson(e)}static _buildHtml(e,t){return new En({content:e,parser:t.parser||new lI})}static _buildJson(e){return new aI({content:e})}static normalize(e,t={}){return va.build(e,t).normalize()}}class Ki{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 rh{static build({config:e,nodeDomParser:t}){const r=oI({fonts:e.fonts,minFontSize:0,maxFontSize:0,presetsRef:Qo(e.presets),defaultPresetId:e.defaultPresetId,linkPresetId:e.linkPresetId,makePresetVariable:()=>"",basePresetClass:e.basePresetClass,baseListClass:e.baseListClass,deviceRef:Qo(hf.DESKTOP),pageBlocksRef:Qo([]),wrapperRef:Ki.document.createElement("p")}),i=$T(r);return new rh({schema:i,domParser:vc.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=va.build(e,{parser:this._nodeDomParser});return t.normalizeHTML(),this._domParser.parse(t.dom.body).toJSON()}}class G1{static doc(e){return{type:ne.DOCUMENT,content:e}}static list(e,t){return{type:ne.LIST,attrs:{bullet:{type:e}},content:t.map(r=>r.type===ne.LIST_ITEM?r:this.listItem([].concat(r)))}}static listItem(...e){const{attrs:t,content:r,marks:i}=this._normalizeTextBlockArgs(e);return{type:ne.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:ne.HEADING,...r}}static paragraph(...e){return{type:ne.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:ne.TEXT,...t?{marks:t}:{},text:e}}static link(e,t,r=[]){return this.text(e,[this.mark(he.LINK,t),...r])}static mark(e,t){return{type:e,attrs:t}}static populateAllDevices(e){return{mobile:e,tablet:e,desktop:e}}}class uI{_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=Ki.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 hf.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&&!he.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===hf.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 ih{static _instance;static get instance(){return this._instance??=new ih,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 cI{static createWindow(){return new Dp.JSDOM().window}types;parse(e){const{window:t}=new Dp.JSDOM(e);return this.types=t,t.document}}exports.ContentSerializer=rh,exports.ContextWindow=Ki,exports.NodeDomParser=cI;