@zipify/wysiwyg 4.9.0 → 4.10.0-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.
- package/.github/actions/lint-css/action.yaml +1 -1
- package/.github/actions/lint-js/action.yaml +8 -3
- package/.lintstagedrc.mjs +32 -0
- package/.oxlintrc.json +185 -0
- package/dist/cli.js +21 -21
- package/dist/node.js +18 -18
- package/dist/types/Wysiwyg.vue.d.ts +38 -176
- package/dist/types/components/base/Button.vue.d.ts +2 -2
- package/dist/types/components/base/Modal.vue.d.ts +2 -2
- package/dist/types/components/base/ModalFloating.vue.d.ts +2 -2
- package/dist/types/components/base/NumberField.vue.d.ts +2 -2
- package/dist/types/entryLib.d.ts +2 -0
- package/dist/types/enums/Devices.d.ts +15 -6
- package/dist/types/enums/index.d.ts +9 -9
- package/dist/types/models/PageBlock.d.ts +4 -0
- package/dist/types/models/StylePreset.d.ts +27 -0
- package/dist/types/models/index.d.ts +3 -2
- package/dist/types/types/StylePresetVariableFactory.d.ts +8 -0
- package/dist/types/types/index.d.ts +1 -0
- package/dist/wysiwyg.css +44 -76
- package/dist/wysiwyg.mjs +64 -113
- package/eslint.config.mjs +6 -0
- package/example/ExampleApp.vue +1 -1
- package/example/presets.ts +250 -0
- package/lib/Wysiwyg.vue +63 -118
- package/lib/cli/commands/Command.js +1 -2
- package/lib/components/base/Checkbox.vue +3 -0
- package/lib/components/base/Modal.vue +1 -1
- package/lib/components/toolbar/Toolbar.vue +4 -4
- package/lib/components/toolbar/controls/__tests__/FontColorControl.test.js +2 -2
- package/lib/components/toolbar/controls/link/LinkControlHeader.vue +7 -2
- package/lib/components/toolbar/controls/link/__tests__/LinkControl.test.js +5 -5
- package/lib/components/toolbar/controls/link/__tests__/LinkControlHeader.test.js +4 -4
- package/lib/entryLib.ts +2 -0
- package/lib/enums/Devices.ts +17 -0
- package/lib/enums/index.ts +9 -0
- package/lib/extensions/FontStyle.js +3 -3
- package/lib/extensions/__tests__/StylePreset.test.js +5 -5
- package/lib/extensions/list/List.js +3 -3
- package/lib/extensions/list/__tests__/List.test.js +4 -4
- package/lib/models/PageBlock.ts +4 -0
- package/lib/models/StylePreset.ts +30 -0
- package/lib/models/index.ts +3 -2
- package/lib/services/JsonSerializer.js +0 -1
- package/lib/services/Storage.js +0 -1
- package/lib/services/__tests__/Storage.test.js +9 -4
- package/lib/services/normalizer/__tests__/HtmlNormalizer.test.js +25 -25
- package/lib/styles/variables.css +2 -33
- package/lib/types/StylePresetVariableFactory.ts +10 -0
- package/lib/types/index.ts +1 -0
- package/package.json +6 -15
- package/stylelint.config.mjs +116 -0
- package/tsconfig.lint.json +7 -0
- package/.eslintignore +0 -2
- package/.eslintrc.js +0 -95
- package/.lintstagedrc +0 -12
- package/.stylelintrc +0 -106
- package/example/presets.js +0 -247
- package/lib/enums/Devices.js +0 -15
- package/lib/enums/index.js +0 -9
package/dist/node.js
CHANGED
|
@@ -1,25 +1,25 @@
|
|
|
1
|
-
"use strict";var Cp=require("jsdom");function Mx(n){const e=Object.create(null);for(const t of n.split(","))e[t]=1;return t=>t in e}const ms=process.env.NODE_ENV!=="production"?Object.freeze({}):{};process.env.NODE_ENV!=="production"&&Object.freeze([]);const gi=()=>{},Tx=n=>n.charCodeAt(0)===111&&n.charCodeAt(1)===110&&(n.charCodeAt(2)>122||n.charCodeAt(2)<97),rr=Object.assign,Cx=Object.prototype.hasOwnProperty,Pu=(n,e)=>Cx.call(n,e),Oe=Array.isArray,yi=n=>Fo(n)==="[object Map]",Ax=n=>Fo(n)==="[object Set]",Ye=n=>typeof n=="function",Nn=n=>typeof n=="string",gs=n=>typeof n=="symbol",gt=n=>n!==null&&typeof n=="object",Ix=n=>(gt(n)||Ye(n))&&Ye(n.then)&&Ye(n.catch),Ox=Object.prototype.toString,Fo=n=>Ox.call(n),Ap=n=>Fo(n).slice(8,-1),Nx=n=>Fo(n)==="[object Object]",Du=n=>Nn(n)&&n!=="NaN"&&n[0]!=="-"&&""+parseInt(n,10)===n,Rx=n=>{const e=Object.create(null);return t=>e[t]||(e[t]=n(t))},Lx=Rx(n=>n.charAt(0).toUpperCase()+n.slice(1)),ir=(n,e)=>!Object.is(n,e);let Ip;const Ho=()=>Ip||(Ip=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});function zu(n){if(Oe(n)){const e={};for(let t=0;t<n.length;t++){const r=n[t],i=Nn(r)?Bx(r):zu(r);if(i)for(const o in i)e[o]=i[o]}return e}else if(Nn(n)||gt(n))return n}const Px=/;(?![^(]*\))/g,Dx=/:([^]+)/,zx=/\/\*[^]*?\*\//g;function Bx(n){const e={};return n.replace(zx,"").split(Px).forEach(t=>{if(t){const r=t.split(Dx);r.length>1&&(e[r[0].trim()]=r[1].trim())}}),e}function Bu(n){let e="";if(Nn(n))e=n;else if(Oe(n))for(let t=0;t<n.length;t++){const r=Bu(n[t]);r&&(e+=r+" ")}else if(gt(n))for(const t in n)n[t]&&(e+=t+" ");return e.trim()}function Rn(n,...e){console.warn(`[Vue warn] ${n}`,...e)}let be;const Fu=new WeakSet;class Fx{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,Fu.has(this)&&(Fu.delete(this),this.trigger()))}notify(){this.flags&2&&!(this.flags&32)||this.flags&8||Np(this)}run(){if(!(this.flags&1))return this.fn();this.flags|=2,zp(this),Rp(this);const e=be,t=nn;be=this,nn=!0;try{return this.fn()}finally{process.env.NODE_ENV!=="production"&&be!==this&&Rn("Active effect was not restored correctly - this is likely a Vue internal bug."),Lp(this),be=e,nn=t,this.flags&=-3}}stop(){if(this.flags&1){for(let e=this.deps;e;e=e.nextDep)Uu(e);this.deps=this.depsTail=void 0,zp(this),this.onStop&&this.onStop(),this.flags&=-2}}trigger(){this.flags&64?Fu.add(this):this.scheduler?this.scheduler():this.runIfDirty()}runIfDirty(){Wu(this)&&this.run()}get dirty(){return Wu(this)}}let Op=0,ys,bs;function Np(n,e=!1){if(n.flags|=8,e){n.next=bs,bs=n;return}n.next=ys,ys=n}function Hu(){Op++}function $u(){if(--Op>0)return;if(bs){let e=bs;for(bs=void 0;e;){const t=e.next;e.next=void 0,e.flags&=-9,e=t}}let n;for(;ys;){let e=ys;for(ys=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 Rp(n){for(let e=n.deps;e;e=e.nextDep)e.version=-1,e.prevActiveLink=e.dep.activeLink,e.dep.activeLink=e}function Lp(n){let e,t=n.depsTail,r=t;for(;r;){const i=r.prevDep;r.version===-1?(r===t&&(t=i),Uu(r),Hx(r)):e=r,r.dep.activeLink=r.prevActiveLink,r.prevActiveLink=void 0,r=i}n.deps=e,n.depsTail=t}function Wu(n){for(let e=n.deps;e;e=e.nextDep)if(e.dep.version!==e.version||e.dep.computed&&(Pp(e.dep.computed)||e.dep.version!==e.version))return!0;return!!n._dirty}function Pp(n){if(n.flags&4&&!(n.flags&16)||(n.flags&=-17,n.globalVersion===vs))return;n.globalVersion=vs;const e=n.dep;if(n.flags|=2,e.version>0&&!n.isSSR&&n.deps&&!Wu(n)){n.flags&=-3;return}const t=be,r=nn;be=n,nn=!0;try{Rp(n);const i=n.fn(n._value);(e.version===0||ir(i,n._value))&&(n._value=i,e.version++)}catch(i){throw e.version++,i}finally{be=t,nn=r,Lp(n),n.flags&=-3}}function Uu(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)Uu(o,!0)}!e&&!--t.sc&&t.map&&t.map.delete(t.key)}function Hx(n){const{prevDep:e,nextDep:t}=n;e&&(e.nextDep=t,n.prevDep=void 0),t&&(t.prevDep=e,n.nextDep=void 0)}let nn=!0;const Dp=[];function $o(){Dp.push(nn),nn=!1}function Wo(){const n=Dp.pop();nn=n===void 0?!0:n}function zp(n){const{cleanup:e}=n;if(n.cleanup=void 0,e){const t=be;be=void 0;try{e()}finally{be=t}}}let vs=0,$x=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 Vu{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||!nn||be===this.computed)return;let t=this.activeLink;if(t===void 0||t.sub!==be)t=this.activeLink=new $x(be,this),be.deps?(t.prevDep=be.depsTail,be.depsTail.nextDep=t,be.depsTail=t):be.deps=be.depsTail=t,Bp(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(rr({effect:be},e)),t}trigger(e){this.version++,vs++,this.notify(e)}notify(e){Hu();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(rr({effect:t.sub},e));for(let t=this.subs;t;t=t.prevSub)t.sub.notify()&&t.sub.dep.notify()}finally{$u()}}}function Bp(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)Bp(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 Uo=new WeakMap,Rr=Symbol(process.env.NODE_ENV!=="production"?"Object iterate":""),Ku=Symbol(process.env.NODE_ENV!=="production"?"Map keys iterate":""),Ss=Symbol(process.env.NODE_ENV!=="production"?"Array iterate":"");function yt(n,e,t){if(nn&&be){let r=Uo.get(n);r||Uo.set(n,r=new Map);let i=r.get(t);i||(r.set(t,i=new Vu),i.map=r,i.key=t),process.env.NODE_ENV!=="production"?i.track({target:n,type:e,key:t}):i.track()}}function sr(n,e,t,r,i,o){const l=Uo.get(n);if(!l){vs++;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(Hu(),e==="clear")l.forEach(u);else{const f=Oe(n),h=f&&Du(t);if(f&&t==="length"){const m=Number(r);l.forEach((p,y)=>{(y==="length"||y===Ss||!gs(y)&&y>=m)&&u(p)})}else switch((t!==void 0||l.has(void 0))&&u(l.get(t)),h&&u(l.get(Ss)),e){case"add":f?h&&u(l.get("length")):(u(l.get(Rr)),yi(n)&&u(l.get(Ku)));break;case"delete":f||(u(l.get(Rr)),yi(n)&&u(l.get(Ku)));break;case"set":yi(n)&&u(l.get(Rr));break}}$u()}function Wx(n,e){const t=Uo.get(n);return t&&t.get(e)}function bi(n){const e=ce(n);return e===n?e:(yt(e,"iterate",Ss),bt(n)?e:e.map(lt))}function Gu(n){return yt(n=ce(n),"iterate",Ss),n}const Ux={__proto__:null,[Symbol.iterator](){return qu(this,Symbol.iterator,lt)},concat(...n){return bi(this).concat(...n.map(e=>Oe(e)?bi(e):e))},entries(){return qu(this,"entries",n=>(n[1]=lt(n[1]),n))},every(n,e){return Ln(this,"every",n,e,void 0,arguments)},filter(n,e){return Ln(this,"filter",n,e,t=>t.map(lt),arguments)},find(n,e){return Ln(this,"find",n,e,lt,arguments)},findIndex(n,e){return Ln(this,"findIndex",n,e,void 0,arguments)},findLast(n,e){return Ln(this,"findLast",n,e,lt,arguments)},findLastIndex(n,e){return Ln(this,"findLastIndex",n,e,void 0,arguments)},forEach(n,e){return Ln(this,"forEach",n,e,void 0,arguments)},includes(...n){return Ju(this,"includes",n)},indexOf(...n){return Ju(this,"indexOf",n)},join(n){return bi(this).join(n)},lastIndexOf(...n){return Ju(this,"lastIndexOf",n)},map(n,e){return Ln(this,"map",n,e,void 0,arguments)},pop(){return ws(this,"pop")},push(...n){return ws(this,"push",n)},reduce(n,...e){return Fp(this,"reduce",n,e)},reduceRight(n,...e){return Fp(this,"reduceRight",n,e)},shift(){return ws(this,"shift")},some(n,e){return Ln(this,"some",n,e,void 0,arguments)},splice(...n){return ws(this,"splice",n)},toReversed(){return bi(this).toReversed()},toSorted(n){return bi(this).toSorted(n)},toSpliced(...n){return bi(this).toSpliced(...n)},unshift(...n){return ws(this,"unshift",n)},values(){return qu(this,"values",lt)}};function qu(n,e,t){const r=Gu(n),i=r[e]();return r!==n&&!bt(n)&&(i._next=i.next,i.next=()=>{const o=i._next();return o.value&&(o.value=t(o.value)),o}),i}const Vx=Array.prototype;function Ln(n,e,t,r,i,o){const l=Gu(n),u=l!==n&&!bt(n),f=l[e];if(f!==Vx[e]){const p=f.apply(n,o);return u?lt(p):p}let h=t;l!==n&&(u?h=function(p,y){return t.call(this,lt(p),y,n)}:t.length>2&&(h=function(p,y){return t.call(this,p,y,n)}));const m=f.call(l,h,r);return u&&i?i(m):m}function Fp(n,e,t,r){const i=Gu(n);let o=t;return i!==n&&(bt(n)?t.length>3&&(o=function(l,u,f){return t.call(this,l,u,f,n)}):o=function(l,u,f){return t.call(this,l,lt(u),f,n)}),i[e](o,...r)}function Ju(n,e,t){const r=ce(n);yt(r,"iterate",Ss);const i=r[e](...t);return(i===-1||i===!1)&&Go(t[0])?(t[0]=ce(t[0]),r[e](...t)):i}function ws(n,e,t=[]){$o(),Hu();const r=ce(n)[e].apply(n,t);return $u(),Wo(),r}const Kx=Mx("__proto__,__v_isRef,__isVue"),Hp=new Set(Object.getOwnPropertyNames(Symbol).filter(n=>n!=="arguments"&&n!=="caller").map(n=>Symbol[n]).filter(gs));function Gx(n){gs(n)||(n=String(n));const e=ce(this);return yt(e,"has",n),e.hasOwnProperty(n)}class $p{constructor(e=!1,t=!1){this._isReadonly=e,this._isShallow=t}get(e,t,r){if(t==="__v_skip")return e.__v_skip;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?nk:Kp:o?tk:Vp).get(e)||Object.getPrototypeOf(e)===Object.getPrototypeOf(r)?e:void 0;const l=Oe(e);if(!i){let f;if(l&&(f=Ux[t]))return f;if(t==="hasOwnProperty")return Gx}const u=Reflect.get(e,t,ut(e)?e:r);return(gs(t)?Hp.has(t):Kx(t))||(i||yt(e,"get",t),o)?u:ut(u)?l&&Du(t)?u:u.value:gt(u)?i?Gp(u):Yu(u):u}}class qx extends $p{constructor(e=!1){super(!1,e)}set(e,t,r,i){let o=e[t];if(!this._isShallow){const f=Pn(o);if(!bt(r)&&!Pn(r)&&(o=ce(o),r=ce(r)),!Oe(e)&&ut(o)&&!ut(r))return f?!1:(o.value=r,!0)}const l=Oe(e)&&Du(t)?Number(t)<e.length:Pu(e,t),u=Reflect.set(e,t,r,ut(e)?e:i);return e===ce(i)&&(l?ir(r,o)&&sr(e,"set",t,r,o):sr(e,"add",t,r)),u}deleteProperty(e,t){const r=Pu(e,t),i=e[t],o=Reflect.deleteProperty(e,t);return o&&r&&sr(e,"delete",t,void 0,i),o}has(e,t){const r=Reflect.has(e,t);return(!gs(t)||!Hp.has(t))&&yt(e,"has",t),r}ownKeys(e){return yt(e,"iterate",Oe(e)?"length":Rr),Reflect.ownKeys(e)}}class Jx extends $p{constructor(e=!1){super(!0,e)}set(e,t){return process.env.NODE_ENV!=="production"&&Rn(`Set operation on key "${String(t)}" failed: target is readonly.`,e),!0}deleteProperty(e,t){return process.env.NODE_ENV!=="production"&&Rn(`Delete operation on key "${String(t)}" failed: target is readonly.`,e),!0}}const jx=new qx,Yx=new Jx,ju=n=>n,Vo=n=>Reflect.getPrototypeOf(n);function Xx(n,e,t){return function(...r){const i=this.__v_raw,o=ce(i),l=yi(o),u=n==="entries"||n===Symbol.iterator&&l,f=n==="keys"&&l,h=i[n](...r),m=t?ju:e?Xu:lt;return!e&&yt(o,"iterate",f?Ku:Rr),{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 Ko(n){return function(...e){if(process.env.NODE_ENV!=="production"){const t=e[0]?`on key "${e[0]}" `:"";Rn(`${Lx(n)} operation ${t}failed: target is readonly.`,ce(this))}return n==="delete"?!1:n==="clear"?void 0:this}}function Zx(n,e){const t={get(i){const o=this.__v_raw,l=ce(o),u=ce(i);n||(ir(i,u)&&yt(l,"get",i),yt(l,"get",u));const{has:f}=Vo(l),h=e?ju:n?Xu:lt;if(f.call(l,i))return h(o.get(i));if(f.call(l,u))return h(o.get(u));o!==l&&o.get(i)},get size(){const i=this.__v_raw;return!n&&yt(ce(i),"iterate",Rr),Reflect.get(i,"size",i)},has(i){const o=this.__v_raw,l=ce(o),u=ce(i);return n||(ir(i,u)&&yt(l,"has",i),yt(l,"has",u)),i===u?o.has(i):o.has(i)||o.has(u)},forEach(i,o){const l=this,u=l.__v_raw,f=ce(u),h=e?ju:n?Xu:lt;return!n&&yt(f,"iterate",Rr),u.forEach((m,p)=>i.call(o,h(m),h(p),l))}};return rr(t,n?{add:Ko("add"),set:Ko("set"),delete:Ko("delete"),clear:Ko("clear")}:{add(i){!e&&!bt(i)&&!Pn(i)&&(i=ce(i));const o=ce(this);return Vo(o).has.call(o,i)||(o.add(i),sr(o,"add",i,i)),this},set(i,o){!e&&!bt(o)&&!Pn(o)&&(o=ce(o));const l=ce(this),{has:u,get:f}=Vo(l);let h=u.call(l,i);h?process.env.NODE_ENV!=="production"&&Up(l,u,i):(i=ce(i),h=u.call(l,i));const m=f.call(l,i);return l.set(i,o),h?ir(o,m)&&sr(l,"set",i,o,m):sr(l,"add",i,o),this},delete(i){const o=ce(this),{has:l,get:u}=Vo(o);let f=l.call(o,i);f?process.env.NODE_ENV!=="production"&&Up(o,l,i):(i=ce(i),f=l.call(o,i));const h=u?u.call(o,i):void 0,m=o.delete(i);return f&&sr(o,"delete",i,void 0,h),m},clear(){const i=ce(this),o=i.size!==0,l=process.env.NODE_ENV!=="production"?yi(i)?new Map(i):new Set(i):void 0,u=i.clear();return o&&sr(i,"clear",void 0,void 0,l),u}}),["keys","values","entries",Symbol.iterator].forEach(i=>{t[i]=Xx(i,n,e)}),t}function Wp(n,e){const t=Zx(n,e);return(r,i,o)=>i==="__v_isReactive"?!n:i==="__v_isReadonly"?n:i==="__v_raw"?r:Reflect.get(Pu(t,i)&&i in r?t:r,i,o)}const Qx={get:Wp(!1,!1)},ek={get:Wp(!0,!1)};function Up(n,e,t){const r=ce(t);if(r!==t&&e.call(n,r)){const i=Ap(n);Rn(`Reactive ${i} contains both the raw and reactive versions of the same object${i==="Map"?" as keys":""}, which can lead to inconsistencies. Avoid differentiating between the raw and reactive versions of an object and only use the reactive version if possible.`)}}const Vp=new WeakMap,tk=new WeakMap,Kp=new WeakMap,nk=new WeakMap;function rk(n){switch(n){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function ik(n){return n.__v_skip||!Object.isExtensible(n)?0:rk(Ap(n))}function Yu(n){return Pn(n)?n:qp(n,!1,jx,Qx,Vp)}function Gp(n){return qp(n,!0,Yx,ek,Kp)}function qp(n,e,t,r,i){if(!gt(n))return process.env.NODE_ENV!=="production"&&Rn(`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 l=ik(n);if(l===0)return n;const u=new Proxy(n,l===2?r:t);return i.set(n,u),u}function xs(n){return Pn(n)?xs(n.__v_raw):!!(n&&n.__v_isReactive)}function Pn(n){return!!(n&&n.__v_isReadonly)}function bt(n){return!!(n&&n.__v_isShallow)}function Go(n){return n?!!n.__v_raw:!1}function ce(n){const e=n&&n.__v_raw;return e?ce(e):n}const lt=n=>gt(n)?Yu(n):n,Xu=n=>gt(n)?Gp(n):n;function ut(n){return n?n.__v_isRef===!0:!1}function qo(n){return sk(n,!1)}function sk(n,e){return ut(n)?n:new ok(n,e)}class ok{constructor(e,t){this.dep=new Vu,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=t?e:ce(e),this._value=t?e:lt(e),this.__v_isShallow=t}get value(){return process.env.NODE_ENV!=="production"?this.dep.track({target:this,type:"get",key:"value"}):this.dep.track(),this._value}set value(e){const t=this._rawValue,r=this.__v_isShallow||bt(e)||Pn(e);e=r?e:ce(e),ir(e,t)&&(this._rawValue=e,this._value=r?e:lt(e),process.env.NODE_ENV!=="production"?this.dep.trigger({target:this,type:"set",key:"value",newValue:e,oldValue:t}):this.dep.trigger())}}function z(n){return ut(n)?n.value:n}class ak{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 Wx(ce(this._object),this._key)}}class lk{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 vi(n,e,t){return ut(n)?n:Ye(n)?new lk(n):gt(n)&&arguments.length>1?uk(n,e,t):qo(n)}function uk(n,e,t){const r=n[e];return ut(r)?r:new ak(n,e,t)}class ck{constructor(e,t,r){this.fn=e,this.setter=t,this._value=void 0,this.dep=new Vu(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=vs-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 Np(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 Pp(this),e&&(e.version=this.dep.version),this._value}set value(e){this.setter?this.setter(e):process.env.NODE_ENV!=="production"&&Rn("Write operation failed: computed value is readonly")}}function fk(n,e,t=!1){let r,i;Ye(n)?r=n:(r=n.get,i=n.set);const o=new ck(r,i,t);return process.env.NODE_ENV!=="production"&&e&&!t&&(o.onTrack=e.onTrack,o.onTrigger=e.onTrigger),o}const Jo={},jo=new WeakMap;let Lr;function hk(n,e=!1,t=Lr){if(t){let r=jo.get(t);r||jo.set(t,r=[]),r.push(n)}else process.env.NODE_ENV!=="production"&&!e&&Rn("onWatcherCleanup() was called when there was no active watcher to associate with.")}function dk(n,e,t=ms){const{immediate:r,deep:i,once:o,scheduler:l,augmentJob:u,call:f}=t,h=$=>{(t.onWarn||Rn)("Invalid watch source: ",$,"A watch source can only be a getter/effect function, a ref, a reactive object, or an array of these types.")},m=$=>i?$:bt($)||i===!1||i===0?or($,1):or($);let p,y,S,w,M=!1,T=!1;if(ut(n)?(y=()=>n.value,M=bt(n)):xs(n)?(y=()=>m(n),M=!0):Oe(n)?(T=!0,M=n.some($=>xs($)||bt($)),y=()=>n.map($=>{if(ut($))return $.value;if(xs($))return m($);if(Ye($))return f?f($,2):$();process.env.NODE_ENV!=="production"&&h($)})):Ye(n)?e?y=f?()=>f(n,2):n:y=()=>{if(S){$o();try{S()}finally{Wo()}}const $=Lr;Lr=p;try{return f?f(n,3,[w]):n(w)}finally{Lr=$}}:(y=gi,process.env.NODE_ENV!=="production"&&h(n)),e&&i){const $=y,X=i===!0?1/0:i;y=()=>or($(),X)}const I=()=>{p.stop()};if(o&&e){const $=e;e=(...X)=>{$(...X),I()}}let F=T?new Array(n.length).fill(Jo):Jo;const B=$=>{if(!(!(p.flags&1)||!p.dirty&&!$))if(e){const X=p.run();if(i||M||(T?X.some((q,ie)=>ir(q,F[ie])):ir(X,F))){S&&S();const q=Lr;Lr=p;try{const ie=[X,F===Jo?void 0:T&&F[0]===Jo?[]:F,w];f?f(e,3,ie):e(...ie),F=X}finally{Lr=q}}}else p.run()};return u&&u(B),p=new Fx(y),p.scheduler=l?()=>l(B,!1):B,w=$=>hk($,!1,p),S=p.onStop=()=>{const $=jo.get(p);if($){if(f)f($,4);else for(const X of $)X();jo.delete(p)}},process.env.NODE_ENV!=="production"&&(p.onTrack=t.onTrack,p.onTrigger=t.onTrigger),e?r?B(!0):F=p.run():l?l(B.bind(null,!0),!0):p.run(),I.pause=p.pause.bind(p),I.resume=p.resume.bind(p),I.stop=I,I}function or(n,e=1/0,t){if(e<=0||!gt(n)||n.__v_skip||(t=t||new Set,t.has(n)))return n;if(t.add(n),e--,ut(n))or(n.value,e,t);else if(Oe(n))for(let r=0;r<n.length;r++)or(n[r],e,t);else if(Ax(n)||yi(n))n.forEach(r=>{or(r,e,t)});else if(Nx(n)){for(const r in n)or(n[r],e,t);for(const r of Object.getOwnPropertySymbols(n))Object.prototype.propertyIsEnumerable.call(n,r)&&or(n[r],e,t)}return n}const Pr=[];function pk(n){Pr.push(n)}function mk(){Pr.pop()}let Zu=!1;function ct(n,...e){if(Zu)return;Zu=!0,$o();const t=Pr.length?Pr[Pr.length-1].component:null,r=t&&t.appContext.config.warnHandler,i=gk();if(r)Yo(r,t,11,[n+e.map(o=>{var l,u;return(u=(l=o.toString)==null?void 0:l.call(o))!=null?u:JSON.stringify(o)}).join(""),t&&t.proxy,i.map(({vnode:o})=>`at <${fm(t,o.type)}>`).join(`
|
|
1
|
+
"use strict";var Ap=require("jsdom");function Tx(n){const e=Object.create(null);for(const t of n.split(","))e[t]=1;return t=>t in e}const ms=process.env.NODE_ENV!=="production"?Object.freeze({}):{};process.env.NODE_ENV!=="production"&&Object.freeze([]);const gi=()=>{},Cx=n=>n.charCodeAt(0)===111&&n.charCodeAt(1)===110&&(n.charCodeAt(2)>122||n.charCodeAt(2)<97),ir=Object.assign,Ax=Object.prototype.hasOwnProperty,Pu=(n,e)=>Ax.call(n,e),Oe=Array.isArray,yi=n=>Fo(n)==="[object Map]",Ix=n=>Fo(n)==="[object Set]",Ye=n=>typeof n=="function",Nn=n=>typeof n=="string",gs=n=>typeof n=="symbol",gt=n=>n!==null&&typeof n=="object",Ox=n=>(gt(n)||Ye(n))&&Ye(n.then)&&Ye(n.catch),Nx=Object.prototype.toString,Fo=n=>Nx.call(n),Ip=n=>Fo(n).slice(8,-1),Rx=n=>Fo(n)==="[object Object]",Du=n=>Nn(n)&&n!=="NaN"&&n[0]!=="-"&&""+parseInt(n,10)===n,Lx=n=>{const e=Object.create(null);return t=>e[t]||(e[t]=n(t))},Px=Lx(n=>n.charAt(0).toUpperCase()+n.slice(1)),sr=(n,e)=>!Object.is(n,e);let Op;const Ho=()=>Op||(Op=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});function zu(n){if(Oe(n)){const e={};for(let t=0;t<n.length;t++){const r=n[t],i=Nn(r)?Fx(r):zu(r);if(i)for(const o in i)e[o]=i[o]}return e}else if(Nn(n)||gt(n))return n}const Dx=/;(?![^(]*\))/g,zx=/:([^]+)/,Bx=/\/\*[^]*?\*\//g;function Fx(n){const e={};return n.replace(Bx,"").split(Dx).forEach(t=>{if(t){const r=t.split(zx);r.length>1&&(e[r[0].trim()]=r[1].trim())}}),e}function Bu(n){let e="";if(Nn(n))e=n;else if(Oe(n))for(let t=0;t<n.length;t++){const r=Bu(n[t]);r&&(e+=r+" ")}else if(gt(n))for(const t in n)n[t]&&(e+=t+" ");return e.trim()}function Rn(n,...e){console.warn(`[Vue warn] ${n}`,...e)}let be;const Fu=new WeakSet;class Hx{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,Fu.has(this)&&(Fu.delete(this),this.trigger()))}notify(){this.flags&2&&!(this.flags&32)||this.flags&8||Rp(this)}run(){if(!(this.flags&1))return this.fn();this.flags|=2,Bp(this),Lp(this);const e=be,t=nn;be=this,nn=!0;try{return this.fn()}finally{process.env.NODE_ENV!=="production"&&be!==this&&Rn("Active effect was not restored correctly - this is likely a Vue internal bug."),Pp(this),be=e,nn=t,this.flags&=-3}}stop(){if(this.flags&1){for(let e=this.deps;e;e=e.nextDep)Uu(e);this.deps=this.depsTail=void 0,Bp(this),this.onStop&&this.onStop(),this.flags&=-2}}trigger(){this.flags&64?Fu.add(this):this.scheduler?this.scheduler():this.runIfDirty()}runIfDirty(){Wu(this)&&this.run()}get dirty(){return Wu(this)}}let Np=0,ys,bs;function Rp(n,e=!1){if(n.flags|=8,e){n.next=bs,bs=n;return}n.next=ys,ys=n}function Hu(){Np++}function $u(){if(--Np>0)return;if(bs){let e=bs;for(bs=void 0;e;){const t=e.next;e.next=void 0,e.flags&=-9,e=t}}let n;for(;ys;){let e=ys;for(ys=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 Lp(n){for(let e=n.deps;e;e=e.nextDep)e.version=-1,e.prevActiveLink=e.dep.activeLink,e.dep.activeLink=e}function Pp(n){let e,t=n.depsTail,r=t;for(;r;){const i=r.prevDep;r.version===-1?(r===t&&(t=i),Uu(r),$x(r)):e=r,r.dep.activeLink=r.prevActiveLink,r.prevActiveLink=void 0,r=i}n.deps=e,n.depsTail=t}function Wu(n){for(let e=n.deps;e;e=e.nextDep)if(e.dep.version!==e.version||e.dep.computed&&(Dp(e.dep.computed)||e.dep.version!==e.version))return!0;return!!n._dirty}function Dp(n){if(n.flags&4&&!(n.flags&16)||(n.flags&=-17,n.globalVersion===vs))return;n.globalVersion=vs;const e=n.dep;if(n.flags|=2,e.version>0&&!n.isSSR&&n.deps&&!Wu(n)){n.flags&=-3;return}const t=be,r=nn;be=n,nn=!0;try{Lp(n);const i=n.fn(n._value);(e.version===0||sr(i,n._value))&&(n._value=i,e.version++)}catch(i){throw e.version++,i}finally{be=t,nn=r,Pp(n),n.flags&=-3}}function Uu(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)Uu(o,!0)}!e&&!--t.sc&&t.map&&t.map.delete(t.key)}function $x(n){const{prevDep:e,nextDep:t}=n;e&&(e.nextDep=t,n.prevDep=void 0),t&&(t.prevDep=e,n.nextDep=void 0)}let nn=!0;const zp=[];function $o(){zp.push(nn),nn=!1}function Wo(){const n=zp.pop();nn=n===void 0?!0:n}function Bp(n){const{cleanup:e}=n;if(n.cleanup=void 0,e){const t=be;be=void 0;try{e()}finally{be=t}}}let vs=0,Wx=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 Vu{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||!nn||be===this.computed)return;let t=this.activeLink;if(t===void 0||t.sub!==be)t=this.activeLink=new Wx(be,this),be.deps?(t.prevDep=be.depsTail,be.depsTail.nextDep=t,be.depsTail=t):be.deps=be.depsTail=t,Fp(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(ir({effect:be},e)),t}trigger(e){this.version++,vs++,this.notify(e)}notify(e){Hu();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(ir({effect:t.sub},e));for(let t=this.subs;t;t=t.prevSub)t.sub.notify()&&t.sub.dep.notify()}finally{$u()}}}function Fp(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)Fp(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 Uo=new WeakMap,Rr=Symbol(process.env.NODE_ENV!=="production"?"Object iterate":""),Ku=Symbol(process.env.NODE_ENV!=="production"?"Map keys iterate":""),ws=Symbol(process.env.NODE_ENV!=="production"?"Array iterate":"");function yt(n,e,t){if(nn&&be){let r=Uo.get(n);r||Uo.set(n,r=new Map);let i=r.get(t);i||(r.set(t,i=new Vu),i.map=r,i.key=t),process.env.NODE_ENV!=="production"?i.track({target:n,type:e,key:t}):i.track()}}function or(n,e,t,r,i,o){const l=Uo.get(n);if(!l){vs++;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(Hu(),e==="clear")l.forEach(u);else{const f=Oe(n),h=f&&Du(t);if(f&&t==="length"){const m=Number(r);l.forEach((p,y)=>{(y==="length"||y===ws||!gs(y)&&y>=m)&&u(p)})}else switch((t!==void 0||l.has(void 0))&&u(l.get(t)),h&&u(l.get(ws)),e){case"add":f?h&&u(l.get("length")):(u(l.get(Rr)),yi(n)&&u(l.get(Ku)));break;case"delete":f||(u(l.get(Rr)),yi(n)&&u(l.get(Ku)));break;case"set":yi(n)&&u(l.get(Rr));break}}$u()}function Ux(n,e){const t=Uo.get(n);return t&&t.get(e)}function bi(n){const e=ce(n);return e===n?e:(yt(e,"iterate",ws),bt(n)?e:e.map(lt))}function Gu(n){return yt(n=ce(n),"iterate",ws),n}const Vx={__proto__:null,[Symbol.iterator](){return qu(this,Symbol.iterator,lt)},concat(...n){return bi(this).concat(...n.map(e=>Oe(e)?bi(e):e))},entries(){return qu(this,"entries",n=>(n[1]=lt(n[1]),n))},every(n,e){return Ln(this,"every",n,e,void 0,arguments)},filter(n,e){return Ln(this,"filter",n,e,t=>t.map(lt),arguments)},find(n,e){return Ln(this,"find",n,e,lt,arguments)},findIndex(n,e){return Ln(this,"findIndex",n,e,void 0,arguments)},findLast(n,e){return Ln(this,"findLast",n,e,lt,arguments)},findLastIndex(n,e){return Ln(this,"findLastIndex",n,e,void 0,arguments)},forEach(n,e){return Ln(this,"forEach",n,e,void 0,arguments)},includes(...n){return Ju(this,"includes",n)},indexOf(...n){return Ju(this,"indexOf",n)},join(n){return bi(this).join(n)},lastIndexOf(...n){return Ju(this,"lastIndexOf",n)},map(n,e){return Ln(this,"map",n,e,void 0,arguments)},pop(){return Ss(this,"pop")},push(...n){return Ss(this,"push",n)},reduce(n,...e){return Hp(this,"reduce",n,e)},reduceRight(n,...e){return Hp(this,"reduceRight",n,e)},shift(){return Ss(this,"shift")},some(n,e){return Ln(this,"some",n,e,void 0,arguments)},splice(...n){return Ss(this,"splice",n)},toReversed(){return bi(this).toReversed()},toSorted(n){return bi(this).toSorted(n)},toSpliced(...n){return bi(this).toSpliced(...n)},unshift(...n){return Ss(this,"unshift",n)},values(){return qu(this,"values",lt)}};function qu(n,e,t){const r=Gu(n),i=r[e]();return r!==n&&!bt(n)&&(i._next=i.next,i.next=()=>{const o=i._next();return o.value&&(o.value=t(o.value)),o}),i}const Kx=Array.prototype;function Ln(n,e,t,r,i,o){const l=Gu(n),u=l!==n&&!bt(n),f=l[e];if(f!==Kx[e]){const p=f.apply(n,o);return u?lt(p):p}let h=t;l!==n&&(u?h=function(p,y){return t.call(this,lt(p),y,n)}:t.length>2&&(h=function(p,y){return t.call(this,p,y,n)}));const m=f.call(l,h,r);return u&&i?i(m):m}function Hp(n,e,t,r){const i=Gu(n);let o=t;return i!==n&&(bt(n)?t.length>3&&(o=function(l,u,f){return t.call(this,l,u,f,n)}):o=function(l,u,f){return t.call(this,l,lt(u),f,n)}),i[e](o,...r)}function Ju(n,e,t){const r=ce(n);yt(r,"iterate",ws);const i=r[e](...t);return(i===-1||i===!1)&&Go(t[0])?(t[0]=ce(t[0]),r[e](...t)):i}function Ss(n,e,t=[]){$o(),Hu();const r=ce(n)[e].apply(n,t);return $u(),Wo(),r}const Gx=Tx("__proto__,__v_isRef,__isVue"),$p=new Set(Object.getOwnPropertyNames(Symbol).filter(n=>n!=="arguments"&&n!=="caller").map(n=>Symbol[n]).filter(gs));function qx(n){gs(n)||(n=String(n));const e=ce(this);return yt(e,"has",n),e.hasOwnProperty(n)}class Wp{constructor(e=!1,t=!1){this._isReadonly=e,this._isShallow=t}get(e,t,r){if(t==="__v_skip")return e.__v_skip;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?rk:Gp:o?nk:Kp).get(e)||Object.getPrototypeOf(e)===Object.getPrototypeOf(r)?e:void 0;const l=Oe(e);if(!i){let f;if(l&&(f=Vx[t]))return f;if(t==="hasOwnProperty")return qx}const u=Reflect.get(e,t,ut(e)?e:r);return(gs(t)?$p.has(t):Gx(t))||(i||yt(e,"get",t),o)?u:ut(u)?l&&Du(t)?u:u.value:gt(u)?i?qp(u):Yu(u):u}}class Jx extends Wp{constructor(e=!1){super(!1,e)}set(e,t,r,i){let o=e[t];if(!this._isShallow){const f=Pn(o);if(!bt(r)&&!Pn(r)&&(o=ce(o),r=ce(r)),!Oe(e)&&ut(o)&&!ut(r))return f?!1:(o.value=r,!0)}const l=Oe(e)&&Du(t)?Number(t)<e.length:Pu(e,t),u=Reflect.set(e,t,r,ut(e)?e:i);return e===ce(i)&&(l?sr(r,o)&&or(e,"set",t,r,o):or(e,"add",t,r)),u}deleteProperty(e,t){const r=Pu(e,t),i=e[t],o=Reflect.deleteProperty(e,t);return o&&r&&or(e,"delete",t,void 0,i),o}has(e,t){const r=Reflect.has(e,t);return(!gs(t)||!$p.has(t))&&yt(e,"has",t),r}ownKeys(e){return yt(e,"iterate",Oe(e)?"length":Rr),Reflect.ownKeys(e)}}class jx extends Wp{constructor(e=!1){super(!0,e)}set(e,t){return process.env.NODE_ENV!=="production"&&Rn(`Set operation on key "${String(t)}" failed: target is readonly.`,e),!0}deleteProperty(e,t){return process.env.NODE_ENV!=="production"&&Rn(`Delete operation on key "${String(t)}" failed: target is readonly.`,e),!0}}const Yx=new Jx,Xx=new jx,ju=n=>n,Vo=n=>Reflect.getPrototypeOf(n);function Zx(n,e,t){return function(...r){const i=this.__v_raw,o=ce(i),l=yi(o),u=n==="entries"||n===Symbol.iterator&&l,f=n==="keys"&&l,h=i[n](...r),m=t?ju:e?Xu:lt;return!e&&yt(o,"iterate",f?Ku:Rr),{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 Ko(n){return function(...e){if(process.env.NODE_ENV!=="production"){const t=e[0]?`on key "${e[0]}" `:"";Rn(`${Px(n)} operation ${t}failed: target is readonly.`,ce(this))}return n==="delete"?!1:n==="clear"?void 0:this}}function Qx(n,e){const t={get(i){const o=this.__v_raw,l=ce(o),u=ce(i);n||(sr(i,u)&&yt(l,"get",i),yt(l,"get",u));const{has:f}=Vo(l),h=e?ju:n?Xu:lt;if(f.call(l,i))return h(o.get(i));if(f.call(l,u))return h(o.get(u));o!==l&&o.get(i)},get size(){const i=this.__v_raw;return!n&&yt(ce(i),"iterate",Rr),Reflect.get(i,"size",i)},has(i){const o=this.__v_raw,l=ce(o),u=ce(i);return n||(sr(i,u)&&yt(l,"has",i),yt(l,"has",u)),i===u?o.has(i):o.has(i)||o.has(u)},forEach(i,o){const l=this,u=l.__v_raw,f=ce(u),h=e?ju:n?Xu:lt;return!n&&yt(f,"iterate",Rr),u.forEach((m,p)=>i.call(o,h(m),h(p),l))}};return ir(t,n?{add:Ko("add"),set:Ko("set"),delete:Ko("delete"),clear:Ko("clear")}:{add(i){!e&&!bt(i)&&!Pn(i)&&(i=ce(i));const o=ce(this);return Vo(o).has.call(o,i)||(o.add(i),or(o,"add",i,i)),this},set(i,o){!e&&!bt(o)&&!Pn(o)&&(o=ce(o));const l=ce(this),{has:u,get:f}=Vo(l);let h=u.call(l,i);h?process.env.NODE_ENV!=="production"&&Vp(l,u,i):(i=ce(i),h=u.call(l,i));const m=f.call(l,i);return l.set(i,o),h?sr(o,m)&&or(l,"set",i,o,m):or(l,"add",i,o),this},delete(i){const o=ce(this),{has:l,get:u}=Vo(o);let f=l.call(o,i);f?process.env.NODE_ENV!=="production"&&Vp(o,l,i):(i=ce(i),f=l.call(o,i));const h=u?u.call(o,i):void 0,m=o.delete(i);return f&&or(o,"delete",i,void 0,h),m},clear(){const i=ce(this),o=i.size!==0,l=process.env.NODE_ENV!=="production"?yi(i)?new Map(i):new Set(i):void 0,u=i.clear();return o&&or(i,"clear",void 0,void 0,l),u}}),["keys","values","entries",Symbol.iterator].forEach(i=>{t[i]=Zx(i,n,e)}),t}function Up(n,e){const t=Qx(n,e);return(r,i,o)=>i==="__v_isReactive"?!n:i==="__v_isReadonly"?n:i==="__v_raw"?r:Reflect.get(Pu(t,i)&&i in r?t:r,i,o)}const ek={get:Up(!1,!1)},tk={get:Up(!0,!1)};function Vp(n,e,t){const r=ce(t);if(r!==t&&e.call(n,r)){const i=Ip(n);Rn(`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 Kp=new WeakMap,nk=new WeakMap,Gp=new WeakMap,rk=new WeakMap;function ik(n){switch(n){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function sk(n){return n.__v_skip||!Object.isExtensible(n)?0:ik(Ip(n))}function Yu(n){return Pn(n)?n:Jp(n,!1,Yx,ek,Kp)}function qp(n){return Jp(n,!0,Xx,tk,Gp)}function Jp(n,e,t,r,i){if(!gt(n))return process.env.NODE_ENV!=="production"&&Rn(`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 l=sk(n);if(l===0)return n;const u=new Proxy(n,l===2?r:t);return i.set(n,u),u}function xs(n){return Pn(n)?xs(n.__v_raw):!!(n&&n.__v_isReactive)}function Pn(n){return!!(n&&n.__v_isReadonly)}function bt(n){return!!(n&&n.__v_isShallow)}function Go(n){return n?!!n.__v_raw:!1}function ce(n){const e=n&&n.__v_raw;return e?ce(e):n}const lt=n=>gt(n)?Yu(n):n,Xu=n=>gt(n)?qp(n):n;function ut(n){return n?n.__v_isRef===!0:!1}function qo(n){return ok(n,!1)}function ok(n,e){return ut(n)?n:new ak(n,e)}class ak{constructor(e,t){this.dep=new Vu,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=t?e:ce(e),this._value=t?e:lt(e),this.__v_isShallow=t}get value(){return process.env.NODE_ENV!=="production"?this.dep.track({target:this,type:"get",key:"value"}):this.dep.track(),this._value}set value(e){const t=this._rawValue,r=this.__v_isShallow||bt(e)||Pn(e);e=r?e:ce(e),sr(e,t)&&(this._rawValue=e,this._value=r?e:lt(e),process.env.NODE_ENV!=="production"?this.dep.trigger({target:this,type:"set",key:"value",newValue:e,oldValue:t}):this.dep.trigger())}}function z(n){return ut(n)?n.value:n}class lk{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 Ux(ce(this._object),this._key)}}class uk{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 vi(n,e,t){return ut(n)?n:Ye(n)?new uk(n):gt(n)&&arguments.length>1?ck(n,e,t):qo(n)}function ck(n,e,t){const r=n[e];return ut(r)?r:new lk(n,e,t)}class fk{constructor(e,t,r){this.fn=e,this.setter=t,this._value=void 0,this.dep=new Vu(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=vs-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 Rp(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 Dp(this),e&&(e.version=this.dep.version),this._value}set value(e){this.setter?this.setter(e):process.env.NODE_ENV!=="production"&&Rn("Write operation failed: computed value is readonly")}}function hk(n,e,t=!1){let r,i;Ye(n)?r=n:(r=n.get,i=n.set);const o=new fk(r,i,t);return process.env.NODE_ENV!=="production"&&e&&!t&&(o.onTrack=e.onTrack,o.onTrigger=e.onTrigger),o}const Jo={},jo=new WeakMap;let Lr;function dk(n,e=!1,t=Lr){if(t){let r=jo.get(t);r||jo.set(t,r=[]),r.push(n)}else process.env.NODE_ENV!=="production"&&!e&&Rn("onWatcherCleanup() was called when there was no active watcher to associate with.")}function pk(n,e,t=ms){const{immediate:r,deep:i,once:o,scheduler:l,augmentJob:u,call:f}=t,h=$=>{(t.onWarn||Rn)("Invalid watch source: ",$,"A watch source can only be a getter/effect function, a ref, a reactive object, or an array of these types.")},m=$=>i?$:bt($)||i===!1||i===0?ar($,1):ar($);let p,y,w,S,M=!1,T=!1;if(ut(n)?(y=()=>n.value,M=bt(n)):xs(n)?(y=()=>m(n),M=!0):Oe(n)?(T=!0,M=n.some($=>xs($)||bt($)),y=()=>n.map($=>{if(ut($))return $.value;if(xs($))return m($);if(Ye($))return f?f($,2):$();process.env.NODE_ENV!=="production"&&h($)})):Ye(n)?e?y=f?()=>f(n,2):n:y=()=>{if(w){$o();try{w()}finally{Wo()}}const $=Lr;Lr=p;try{return f?f(n,3,[S]):n(S)}finally{Lr=$}}:(y=gi,process.env.NODE_ENV!=="production"&&h(n)),e&&i){const $=y,X=i===!0?1/0:i;y=()=>ar($(),X)}const I=()=>{p.stop()};if(o&&e){const $=e;e=(...X)=>{$(...X),I()}}let F=T?new Array(n.length).fill(Jo):Jo;const B=$=>{if(!(!(p.flags&1)||!p.dirty&&!$))if(e){const X=p.run();if(i||M||(T?X.some((q,ie)=>sr(q,F[ie])):sr(X,F))){w&&w();const q=Lr;Lr=p;try{const ie=[X,F===Jo?void 0:T&&F[0]===Jo?[]:F,S];f?f(e,3,ie):e(...ie),F=X}finally{Lr=q}}}else p.run()};return u&&u(B),p=new Hx(y),p.scheduler=l?()=>l(B,!1):B,S=$=>dk($,!1,p),w=p.onStop=()=>{const $=jo.get(p);if($){if(f)f($,4);else for(const X of $)X();jo.delete(p)}},process.env.NODE_ENV!=="production"&&(p.onTrack=t.onTrack,p.onTrigger=t.onTrigger),e?r?B(!0):F=p.run():l?l(B.bind(null,!0),!0):p.run(),I.pause=p.pause.bind(p),I.resume=p.resume.bind(p),I.stop=I,I}function ar(n,e=1/0,t){if(e<=0||!gt(n)||n.__v_skip||(t=t||new Set,t.has(n)))return n;if(t.add(n),e--,ut(n))ar(n.value,e,t);else if(Oe(n))for(let r=0;r<n.length;r++)ar(n[r],e,t);else if(Ix(n)||yi(n))n.forEach(r=>{ar(r,e,t)});else if(Rx(n)){for(const r in n)ar(n[r],e,t);for(const r of Object.getOwnPropertySymbols(n))Object.prototype.propertyIsEnumerable.call(n,r)&&ar(n[r],e,t)}return n}const Pr=[];function mk(n){Pr.push(n)}function gk(){Pr.pop()}let Zu=!1;function ct(n,...e){if(Zu)return;Zu=!0,$o();const t=Pr.length?Pr[Pr.length-1].component:null,r=t&&t.appContext.config.warnHandler,i=yk();if(r)Yo(r,t,11,[n+e.map(o=>{var l,u;return(u=(l=o.toString)==null?void 0:l.call(o))!=null?u:JSON.stringify(o)}).join(""),t&&t.proxy,i.map(({vnode:o})=>`at <${hm(t,o.type)}>`).join(`
|
|
2
2
|
`),i]);else{const o=[`[Vue warn]: ${n}`,...e];i.length&&o.push(`
|
|
3
|
-
`,...
|
|
4
|
-
`],...bk(t))}),e}function bk({vnode:n,recurseCount:e}){const t=e>0?`... (${e} recursive calls)`:"",r=n.component?n.component.parent==null:!1,i=` at <${fm(n.component,n.type,r)}`,o=">"+t;return n.props?[i,...vk(n.props),o]:[i+o]}function vk(n){const e=[],t=Object.keys(n);return t.slice(0,3).forEach(r=>{e.push(...Jp(r,n[r]))}),t.length>3&&e.push(" ..."),e}function Jp(n,e,t){return Nn(e)?(e=JSON.stringify(e),t?e:[`${n}=${e}`]):typeof e=="number"||typeof e=="boolean"||e==null?t?e:[`${n}=${e}`]:ut(e)?(e=Jp(n,ce(e.value),!0),t?e:[`${n}=Ref<`,e,">"]):Ye(e)?[`${n}=fn${e.name?`<${e.name}>`:""}`]:(e=ce(e),t?e:[`${n}=`,e])}const jp={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 Yo(n,e,t,r){try{return r?n(...r):n()}catch(i){Qu(i,e,t)}}function Yp(n,e,t,r){if(Ye(n)){const i=Yo(n,e,t,r);return i&&Ix(i)&&i.catch(o=>{Qu(o,e,t)}),i}if(Oe(n)){const i=[];for(let o=0;o<n.length;o++)i.push(Yp(n[o],e,t,r));return i}else process.env.NODE_ENV!=="production"&&ct(`Invalid value type passed to callWithAsyncErrorHandling(): ${typeof n}`)}function Qu(n,e,t,r=!0){const i=e?e.vnode:null,{errorHandler:o,throwUnhandledErrorInProduction:l}=e&&e.appContext.config||ms;if(e){let u=e.parent;const f=e.proxy,h=process.env.NODE_ENV!=="production"?jp[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){$o(),Yo(o,null,10,[n,f,h]),Wo();return}}Sk(n,t,i,r,l)}function Sk(n,e,t,r=!0,i=!1){if(process.env.NODE_ENV!=="production"){const o=jp[e];if(t&&pk(t),ct(`Unhandled error${o?` during execution of ${o}`:""}`),t&&mk(),r)throw n;console.error(n)}else{if(i)throw n;console.error(n)}}const Ft=[];let Dn=-1;const Si=[];let ar=null,wi=0;const wk=Promise.resolve();let ec=null;const xk=100;function kk(n){let e=Dn+1,t=Ft.length;for(;e<t;){const r=e+t>>>1,i=Ft[r],o=ks(i);o<n||o===n&&i.flags&2?e=r+1:t=r}return e}function Xp(n){if(!(n.flags&1)){const e=ks(n),t=Ft[Ft.length-1];!t||!(n.flags&2)&&e>=ks(t)?Ft.push(n):Ft.splice(kk(e),0,n),n.flags|=1,Zp()}}function Zp(){ec||(ec=wk.then(em))}function Qp(n){Oe(n)?Si.push(...n):ar&&n.id===-1?ar.splice(wi+1,0,n):n.flags&1||(Si.push(n),n.flags|=1),Zp()}function _k(n){if(Si.length){const e=[...new Set(Si)].sort((t,r)=>ks(t)-ks(r));if(Si.length=0,ar){ar.push(...e);return}for(ar=e,process.env.NODE_ENV!=="production"&&(n=n||new Map),wi=0;wi<ar.length;wi++){const t=ar[wi];process.env.NODE_ENV!=="production"&&tm(n,t)||(t.flags&4&&(t.flags&=-2),t.flags&8||t(),t.flags&=-2)}ar=null,wi=0}}const ks=n=>n.id==null?n.flags&2?-1:1/0:n.id;function em(n){process.env.NODE_ENV!=="production"&&(n=n||new Map);const e=process.env.NODE_ENV!=="production"?t=>tm(n,t):gi;try{for(Dn=0;Dn<Ft.length;Dn++){const t=Ft[Dn];if(t&&!(t.flags&8)){if(process.env.NODE_ENV!=="production"&&e(t))continue;t.flags&4&&(t.flags&=-2),Yo(t,t.i,t.i?15:14),t.flags&4||(t.flags&=-2)}}}finally{for(;Dn<Ft.length;Dn++){const t=Ft[Dn];t&&(t.flags&=-2)}Dn=-1,Ft.length=0,_k(n),ec=null,(Ft.length||Si.length)&&em(n)}}function tm(n,e){const t=n.get(e)||0;if(t>xk){const r=e.i,i=r&&cm(r.type);return Qu(`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 tc=new Map;process.env.NODE_ENV!=="production"&&(Ho().__VUE_HMR_RUNTIME__={createRecord:nc(Ek),rerender:nc(Mk),reload:nc(Tk)});const Xo=new Map;function Ek(n,e){return Xo.has(n)?!1:(Xo.set(n,{initialDef:Zo(e),instances:new Set}),!0)}function Zo(n){return hm(n)?n.__vccOpts:n}function Mk(n,e){const t=Xo.get(n);t&&(t.initialDef.render=e,[...t.instances].forEach(r=>{e&&(r.render=e,Zo(r.type).render=e),r.renderCache=[],r.update()}))}function Tk(n,e){const t=Xo.get(n);if(!t)return;e=Zo(e),nm(t.initialDef,e);const r=[...t.instances];for(let i=0;i<r.length;i++){const o=r[i],l=Zo(o.type);let u=tc.get(l);u||(l!==t.initialDef&&nm(l,e),tc.set(l,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?Xp(()=>{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(l)}Qp(()=>{tc.clear()})}function nm(n,e){rr(n,e);for(const t in n)t!=="__file"&&!(t in e)&&delete n[t]}function nc(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 xi,Qo=[];function rm(n,e){var t,r;xi=n,xi?(xi.enabled=!0,Qo.forEach(({event:i,args:o})=>xi.emit(i,...o)),Qo=[]):typeof window<"u"&&window.HTMLElement&&!((r=(t=window.navigator)==null?void 0:t.userAgent)!=null&&r.includes("jsdom"))?((e.__VUE_DEVTOOLS_HOOK_REPLAY__=e.__VUE_DEVTOOLS_HOOK_REPLAY__||[]).push(o=>{rm(o,e)}),setTimeout(()=>{xi||(e.__VUE_DEVTOOLS_HOOK_REPLAY__=null,Qo=[])},3e3)):Qo=[]}let lr=null,Ck=null;const Ak=n=>n.__isTeleport;function im(n,e){n.shapeFlag&6&&n.component?(n.transition=e,im(n.component.subTree,e)):n.shapeFlag&128?(n.ssContent.transition=e.clone(n.ssContent),n.ssFallback.transition=e.clone(n.ssFallback)):n.transition=e}Ho().requestIdleCallback,Ho().cancelIdleCallback;const Ik=Symbol.for("v-ndc"),Ok={};process.env.NODE_ENV!=="production"&&(Ok.ownKeys=n=>(ct("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)));let Nk=null;function Rk(n,e,t=!1){const r=na||lr;if(r||Nk){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&&Ye(e)?e.call(r&&r.proxy):e;process.env.NODE_ENV!=="production"&&ct(`injection "${String(n)}" not found.`)}else process.env.NODE_ENV!=="production"&&ct("inject() can only be used inside setup() or functional components.")}const Lk={},sm=n=>Object.getPrototypeOf(n)===Lk,Pk=$k,Dk=Symbol.for("v-scx"),zk=()=>{{const n=Rk(Dk);return n||process.env.NODE_ENV!=="production"&&ct("Server rendering context not provided. Make sure to only call useSSRContext() conditionally in the server build."),n}};function Bk(n,e,t){return process.env.NODE_ENV!=="production"&&!Ye(e)&&ct("`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."),Fk(n,e,t)}function Fk(n,e,t=ms){const{immediate:r,deep:i,flush:o,once:l}=t;process.env.NODE_ENV!=="production"&&!e&&(r!==void 0&&ct('watch() "immediate" option is only respected when using the watch(source, callback, options?) signature.'),i!==void 0&&ct('watch() "deep" option is only respected when using the watch(source, callback, options?) signature.'),l!==void 0&&ct('watch() "once" option is only respected when using the watch(source, callback, options?) signature.'));const u=rr({},t);process.env.NODE_ENV!=="production"&&(u.onWarn=ct);const f=e&&r||!e&&o!=="post";let h;if(ra){if(o==="sync"){const S=zk();h=S.__watcherHandles||(S.__watcherHandles=[])}else if(!f){const S=()=>{};return S.stop=gi,S.resume=gi,S.pause=gi,S}}const m=na;u.call=(S,w,M)=>Yp(S,m,w,M);let p=!1;o==="post"?u.scheduler=S=>{Pk(S,m&&m.suspense)}:o!=="sync"&&(p=!0,u.scheduler=(S,w)=>{w?S():Xp(S)}),u.augmentJob=S=>{e&&(S.flags|=4),p&&(S.flags|=2,m&&(S.id=m.uid,S.i=m))};const y=dk(n,e,u);return ra&&(h?h.push(y):f&&y()),y}const Hk=n=>n.__isSuspense;function $k(n,e){e&&e.pendingBranch?Oe(n)?e.effects.push(...n):e.effects.push(n):Qp(n)}const om=Symbol.for("v-fgt"),Wk=Symbol.for("v-txt"),Uk=Symbol.for("v-cmt");let ki=null;function Vk(n){return n?n.__v_isVNode===!0:!1}const Kk=(...n)=>lm(...n),am=({key:n})=>n??null,ea=({ref:n,ref_key:e,ref_for:t})=>(typeof n=="number"&&(n=""+n),n!=null?Nn(n)||ut(n)||Ye(n)?{i:lr,r:n,k:e,f:!!t}:n:null);function Gk(n,e=null,t=null,r=0,i=null,o=n===om?0:1,l=!1,u=!1){const f={__v_isVNode:!0,__v_skip:!0,type:n,props:e,key:e&&am(e),ref:e&&ea(e),scopeId:Ck,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:lr};return u?(rc(f,t),o&128&&n.normalize(f)):t&&(f.shapeFlag|=Nn(t)?8:16),process.env.NODE_ENV!=="production"&&f.key!==f.key&&ct("VNode created with invalid key (NaN). VNode type:",f.type),!l&&ki&&(f.patchFlag>0||o&6)&&f.patchFlag!==32&&ki.push(f),f}const qk=process.env.NODE_ENV!=="production"?Kk:lm;function lm(n,e=null,t=null,r=0,i=null,o=!1){if((!n||n===Ik)&&(process.env.NODE_ENV!=="production"&&!n&&ct(`Invalid vnode type when creating vnode: ${n}.`),n=Uk),Vk(n)){const u=ta(n,e,!0);return t&&rc(u,t),!o&&ki&&(u.shapeFlag&6?ki[ki.indexOf(n)]=u:ki.push(u)),u.patchFlag=-2,u}if(hm(n)&&(n=n.__vccOpts),e){e=Jk(e);let{class:u,style:f}=e;u&&!Nn(u)&&(e.class=Bu(u)),gt(f)&&(Go(f)&&!Oe(f)&&(f=rr({},f)),e.style=zu(f))}const l=Nn(n)?1:Hk(n)?128:Ak(n)?64:gt(n)?4:Ye(n)?2:0;return process.env.NODE_ENV!=="production"&&l&4&&Go(n)&&(n=ce(n),ct("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)),Gk(n,e,t,r,i,l,o,!0)}function Jk(n){return n?Go(n)||sm(n)?rr({},n):n:null}function ta(n,e,t=!1,r=!1){const{props:i,ref:o,patchFlag:l,children:u,transition:f}=n,h=e?Yk(i||{},e):i,m={__v_isVNode:!0,__v_skip:!0,type:n.type,props:h,key:h&&am(h),ref:e&&e.ref?t&&o?Oe(o)?o.concat(ea(e)):[o,ea(e)]:ea(e):o,scopeId:n.scopeId,slotScopeIds:n.slotScopeIds,children:process.env.NODE_ENV!=="production"&&l===-1&&Oe(u)?u.map(um):u,target:n.target,targetStart:n.targetStart,targetAnchor:n.targetAnchor,staticCount:n.staticCount,shapeFlag:n.shapeFlag,patchFlag:e&&n.type!==om?l===-1?16:l|16:l,dynamicProps:n.dynamicProps,dynamicChildren:n.dynamicChildren,appContext:n.appContext,dirs:n.dirs,transition:f,component:n.component,suspense:n.suspense,ssContent:n.ssContent&&ta(n.ssContent),ssFallback:n.ssFallback&&ta(n.ssFallback),el:n.el,anchor:n.anchor,ctx:n.ctx,ce:n.ce};return f&&r&&im(m,f.clone(m)),m}function um(n){const e=ta(n);return Oe(n.children)&&(e.children=n.children.map(um)),e}function jk(n=" ",e=0){return qk(Wk,null,n,e)}function rc(n,e){let t=0;const{shapeFlag:r}=n;if(e==null)e=null;else if(Oe(e))t=16;else if(typeof e=="object")if(r&65){const i=e.default;i&&(i._c&&(i._d=!1),rc(n,i()),i._c&&(i._d=!0));return}else{t=32;const i=e._;!i&&!sm(e)?e._ctx=lr:i===3&&lr&&(lr.slots._===1?e._=1:(e._=2,n.patchFlag|=1024))}else Ye(e)?(e={default:e,_ctx:lr},t=32):(e=String(e),r&64?(t=16,e=[jk(e)]):t=8);n.children=e,n.shapeFlag|=t}function Yk(...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=Bu([e.class,r.class]));else if(i==="style")e.style=zu([e.style,r.style]);else if(Tx(i)){const o=e[i],l=r[i];l&&o!==l&&!(Oe(o)&&o.includes(l))&&(e[i]=o?[].concat(o,l):l)}else i!==""&&(e[i]=r[i])}return e}let na=null;const Xk=()=>na||lr;{const n=Ho(),e=(t,r)=>{let i;return(i=n[t])||(i=n[t]=[]),i.push(r),o=>{i.length>1?i.forEach(l=>l(o)):i[0](o)}};e("__VUE_INSTANCE_SETTERS__",t=>na=t),e("__VUE_SSR_SETTERS__",t=>ra=t)}let ra=!1;process.env.NODE_ENV;const Zk=/(?:^|[-_])(\w)/g,Qk=n=>n.replace(Zk,e=>e.toUpperCase()).replace(/[-_]/g,"");function cm(n,e=!0){return Ye(n)?n.displayName||n.name:n.name||e&&n.__name}function fm(n,e,t=!1){let r=cm(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 l in o)if(o[l]===e)return l};r=i(n.components||n.parent.type.components)||i(n.appContext.components)}return r?Qk(r):t?"App":"Anonymous"}function hm(n){return Ye(n)&&"__vccOpts"in n}const pe=(n,e)=>{const t=fk(n,e,ra);if(process.env.NODE_ENV!=="production"){const r=Xk();r&&r.appContext.config.warnRecursiveComputed&&(t._warnRecursive=!0)}return t};function e_(){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 gt(p)?p.__isVue?["div",n,"VueInstance"]:ut(p)?["div",{},["span",n,m(p)],"<",u("_value"in p?p._value:p),">"]:xs(p)?["div",{},["span",n,bt(p)?"ShallowReactive":"Reactive"],"<",u(p),`>${Pn(p)?" (readonly)":""}`]:Pn(p)?["div",{},["span",n,bt(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(l("props",ce(p.props))),p.setupState!==ms&&y.push(l("setup",p.setupState)),p.data!==ms&&y.push(l("data",ce(p.data)));const S=f(p,"computed");S&&y.push(l("computed",S));const w=f(p,"inject");return w&&y.push(l("injected",w)),y.push(["div",{},["span",{style:r.style+";opacity:0.66"},"$ (internal): "],["object",{object:p}]]),y}function l(p,y){return y=rr({},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]:gt(p)?["object",{object:y?ce(p):p}]:["span",t,String(p)]}function f(p,y){const S=p.type;if(Ye(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(Oe(w)&&w.includes(y)||gt(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 bt(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 t_(){e_()}process.env.NODE_ENV!=="production"&&t_();function Xe(n){this.content=n}Xe.prototype={constructor:Xe,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 Xe(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 Xe(t)},addToStart:function(n,e){return new Xe([n,e].concat(this.remove(n).content))},addToEnd:function(n,e){var t=this.remove(n).content.slice();return t.push(n,e),new Xe(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 Xe(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=Xe.from(n),n.size?new Xe(n.content.concat(this.subtract(n).content)):this},append:function(n){return n=Xe.from(n),n.size?new Xe(this.subtract(n).content.concat(n.content)):this},subtract:function(n){var e=this;n=Xe.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}},Xe.from=function(n){if(n instanceof Xe)return n;var e=[];if(n)for(var t in n)e.push(t,n[t]);return new Xe(e)};function dm(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 l=0;i.text[l]==o.text[l];l++)t++;return t}if(i.content.size||o.content.size){let l=dm(i.content,o.content,t+1);if(l!=null)return l}t+=i.nodeSize}}function pm(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 l=n.child(--i),u=e.child(--o),f=l.nodeSize;if(l==u){t-=f,r-=f;continue}if(!l.sameMarkup(u))return{a:t,b:r};if(l.isText&&l.text!=u.text){let h=0,m=Math.min(l.text.length,u.text.length);for(;h<m&&l.text[l.text.length-h-1]==u.text[u.text.length-h-1];)h++,t--,r--;return{a:t,b:r}}if(l.content.size||u.content.size){let h=pm(l.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 l=0,u=0;u<t;l++){let f=this.content[l],h=u+f.nodeSize;if(h>e&&r(f,i+u,o||null,l)!==!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="",l=!0;return this.nodesBetween(e,t,(u,f)=>{u.isText?(o+=u.text.slice(Math.max(e,f)-f,t-f),l=!r):u.isLeaf?(i?o+=typeof i=="function"?i(u):i:u.type.spec.leafText&&(o+=u.type.spec.leafText(u)),l=!r):!l&&u.isBlock&&(o+=r,l=!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,l=0;l<t;o++){let u=this.content[o],f=l+u.nodeSize;f>e&&((l<e||f>t)&&(u.isText?u=u.cut(Math.max(0,e-l),Math.min(u.text.length,t-l)):u=u.cut(Math.max(0,e-l-1),Math.min(u.content.size,t-l-1))),r.push(u),i+=u.nodeSize),l=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 dm(this,e,t)}findDiffEnd(e,t=this.size,r=e.size){return pm(this,e,t,r)}findIndex(e,t=-1){if(e==0)return ia(0,e);if(e==this.size)return ia(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),l=i+o.nodeSize;if(l>=e)return l==e||t>0?ia(r+1,l):ia(r,i);i=l}}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 ic={index:0,offset:0};function ia(n,e){return ic.index=n,ic.offset=e,ic}function sa(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(!sa(n[r],e[r]))return!1}else{for(let r in n)if(!(r in e)||!sa(n[r],e[r]))return!1;for(let r in e)if(!(r in n))return!1}return!0}let ke=class Wf{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&&sa(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 Wf.none;if(e instanceof Wf)return[e];let t=e.slice();return t.sort((r,i)=>r.type.rank-i.type.rank),t}};ke.none=[];class oa 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=gm(this.content,e+this.openStart,t);return r&&new U(r,this.openStart,this.openEnd)}removeBetween(e,t){return new U(mm(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 mm(n,e,t){let{index:r,offset:i}=n.findIndex(e),o=n.maybeChild(r),{index:l,offset:u}=n.findIndex(t);if(i==e||o.isText){if(u!=t&&!n.child(l).isText)throw new RangeError("Removing non-flat range");return n.cut(0,e).append(n.cut(t))}if(r!=l)throw new RangeError("Removing non-flat range");return n.replaceChild(r,o.copy(mm(o.content,e-i-1,t-i-1)))}function gm(n,e,t,r){let{index:i,offset:o}=n.findIndex(e),l=n.maybeChild(i);if(o==e||l.isText)return n.cut(0,e).append(t).append(n.cut(e));let u=gm(l.content,e-o-1,t);return u&&n.replaceChild(i,l.copy(u))}function n_(n,e,t){if(t.openStart>n.depth)throw new oa("Inserted content deeper than insertion position");if(n.depth-t.openStart!=e.depth-t.openEnd)throw new oa("Inconsistent open depths");return ym(n,e,t,0)}function ym(n,e,t,r){let i=n.index(r),o=n.node(r);if(i==e.index(r)&&r<n.depth-t.openStart){let l=ym(n,e,t,r+1);return o.copy(o.content.replaceChild(i,l))}else if(t.content.size)if(!t.openStart&&!t.openEnd&&n.depth==r&&e.depth==r){let l=n.parent,u=l.content;return zr(l,u.cut(0,n.parentOffset).append(t.content).append(u.cut(e.parentOffset)))}else{let{start:l,end:u}=r_(t,n);return zr(o,vm(n,l,u,e,r))}else return zr(o,aa(n,e,r))}function bm(n,e){if(!e.type.compatibleContent(n.type))throw new oa("Cannot join "+e.type.name+" onto "+n.type.name)}function sc(n,e,t){let r=n.node(t);return bm(r,e.node(t)),r}function Dr(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 _s(n,e,t,r){let i=(e||n).node(t),o=0,l=e?e.index(t):i.childCount;n&&(o=n.index(t),n.depth>t?o++:n.textOffset&&(Dr(n.nodeAfter,r),o++));for(let u=o;u<l;u++)Dr(i.child(u),r);e&&e.depth==t&&e.textOffset&&Dr(e.nodeBefore,r)}function zr(n,e){return n.type.checkContent(e),n.copy(e)}function vm(n,e,t,r,i){let o=n.depth>i&&sc(n,e,i+1),l=r.depth>i&&sc(t,r,i+1),u=[];return _s(null,n,i,u),o&&l&&e.index(i)==t.index(i)?(bm(o,l),Dr(zr(o,vm(n,e,t,r,i+1)),u)):(o&&Dr(zr(o,aa(n,e,i+1)),u),_s(e,t,i,u),l&&Dr(zr(l,aa(t,r,i+1)),u)),_s(r,null,i,u),new L(u)}function aa(n,e,t){let r=[];if(_s(null,n,t,r),n.depth>t){let i=sc(n,e,t+1);Dr(zr(i,aa(n,e,t+1)),r)}return _s(e,null,t,r),new L(r)}function r_(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 Vs{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 ke.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 l=0;l<o.length;l++)o[l].type.spec.inclusive===!1&&(!i||!o[l].isInSet(i.marks))&&(o=o[l--].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 la(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 l=e;;){let{index:u,offset:f}=l.content.findIndex(o),h=o-f;if(r.push(l,u,i+f),!h||(l=l.child(u),l.isText))break;o=h-1,i+=f+1}return new Vs(t,r,o)}static resolveCached(e,t){for(let i=0;i<oc.length;i++){let o=oc[i];if(o.pos==t&&o.doc==e)return o}let r=oc[ac]=Vs.resolve(e,t);return ac=(ac+1)%i_,r}}let oc=[],ac=0,i_=12;class la{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 s_=Object.create(null);let Br=class Uf{constructor(e,t,r,i=ke.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&&sa(this.attrs,t||e.defaultAttrs||s_)&&ke.sameSet(this.marks,r||ke.none)}copy(e=null){return e==this.content?this:new Uf(this.type,this.attrs,e,this.marks)}mark(e){return e==this.marks?this:new Uf(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),l=r?0:i.sharedDepth(t),u=i.start(l),h=i.node(l).content.cut(i.pos-u,o.pos-u);return new U(h,i.depth-l,o.depth-l)}replace(e,t,r){return n_(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 Vs.resolveCached(this,e)}resolveNoCache(e){return Vs.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()+")"),Sm(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 l=this.contentMatchAt(e).matchFragment(r,i,o),u=l&&l.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),l=o&&o.matchFragment(this.content,t);return l?l.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=ke.none;for(let t=0;t<this.marks.length;t++)e=this.marks[t].addToSet(e);if(!ke.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)}};Br.prototype.text=void 0;class ul extends Br{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):Sm(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 ul(this.type,this.attrs,this.text,e)}withText(e){return e==this.text?this:new ul(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 Sm(n,e){for(let t=n.length-1;t>=0;t--)e=n[t].type.name+"("+e+")";return e}class Xr{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(e,t){let r=new o_(e,t);if(r.next==null)return Xr.empty;let i=wm(r);r.next&&r.err("Unexpected trailing text");let o=d_(h_(i));return p_(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(l,u){let f=l.matchFragment(e,r);if(f&&(!t||f.validEnd))return L.from(u.map(h=>h.createAndFill()));for(let h=0;h<l.next.length;h++){let{type:m,next:p}=l.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 l=[];for(let u=i;u.type;u=u.via)l.push(u.type);return l.reverse()}for(let l=0;l<o.next.length;l++){let{type:u,next:f}=o.next[l];!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 l=0;l<r.next.length;l++)o+=(l?", ":"")+r.next[l].type.name+"->"+e.indexOf(r.next[l].next);return o}).join(`
|
|
6
|
-
`)}}Xr.empty=new Xr(!0);class o_{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 wm(n){let e=[];do e.push(a_(n));while(n.eat("|"));return e.length==1?e[0]:{type:"choice",exprs:e}}function a_(n){let e=[];do e.push(l_(n));while(n.next&&n.next!=")"&&n.next!="|");return e.length==1?e[0]:{type:"seq",exprs:e}}function l_(n){let e=f_(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=u_(n,e);else break;return e}function xm(n){/\D/.test(n.next)&&n.err("Expected number, got '"+n.next+"'");let e=Number(n.next);return n.pos++,e}function u_(n,e){let t=xm(n),r=t;return n.eat(",")&&(n.next!="}"?r=xm(n):r=-1),n.eat("}")||n.err("Unclosed braced range"),{type:"range",min:t,max:r,expr:e}}function c_(n,e){let t=n.nodeTypes,r=t[e];if(r)return[r];let i=[];for(let o in t){let l=t[o];l.groups.indexOf(e)>-1&&i.push(l)}return i.length==0&&n.err("No node type or group '"+e+"' found"),i}function f_(n){if(n.eat("(")){let e=wm(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=c_(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 h_(n){let e=[[]];return i(o(n,0),t()),e;function t(){return e.push([])-1}function r(l,u,f){let h={term:f,to:u};return e[l].push(h),h}function i(l,u){l.forEach(f=>f.to=u)}function o(l,u){if(l.type=="choice")return l.exprs.reduce((f,h)=>f.concat(o(h,u)),[]);if(l.type=="seq")for(let f=0;;f++){let h=o(l.exprs[f],u);if(f==l.exprs.length-1)return h;i(h,u=t())}else if(l.type=="star"){let f=t();return r(u,f),i(o(l.expr,f),f),[r(f)]}else if(l.type=="plus"){let f=t();return i(o(l.expr,u),f),i(o(l.expr,f),f),[r(f)]}else{if(l.type=="opt")return[r(u)].concat(o(l.expr,u));if(l.type=="range"){let f=u;for(let h=0;h<l.min;h++){let m=t();i(o(l.expr,f),m),f=m}if(l.max==-1)i(o(l.expr,f),f);else for(let h=l.min;h<l.max;h++){let m=t();r(f,m),i(o(l.expr,f),m),f=m}return[r(f)]}else{if(l.type=="name")return[r(u,void 0,l.value)];throw new Error("Unknown expr type")}}}}function km(n,e){return e-n}function _m(n,e){let t=[];return r(e),t.sort(km);function r(i){let o=n[i];if(o.length==1&&!o[0].term)return r(o[0].to);t.push(i);for(let l=0;l<o.length;l++){let{term:u,to:f}=o[l];!u&&t.indexOf(f)==-1&&r(f)}}}function d_(n){let e=Object.create(null);return t(_m(n,0));function t(r){let i=[];r.forEach(l=>{n[l].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]);_m(n,f).forEach(m=>{h||i.push([u,h=[]]),h.indexOf(m)==-1&&h.push(m)})})});let o=e[r.join(",")]=new Xr(r.indexOf(n.length-1)>-1);for(let l=0;l<i.length;l++){let u=i[l][1].sort(km);o.next.push({type:i[l][0],next:e[u.join(",")]||t(u)})}return o}}function p_(n,e){for(let t=0,r=[n];t<r.length;t++){let i=r[t],o=!i.validEnd,l=[];for(let u=0;u<i.next.length;u++){let{type:f,next:h}=i.next[u];l.push(f.name),o&&!(f.isText||f.hasRequiredAttrs())&&(o=!1),r.indexOf(h)==-1&&r.push(h)}o&&e.err("Only non-generatable nodes ("+l.join(", ")+") in a required position (see https://prosemirror.net/docs/guide/#generatable)")}}function Em(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 Mm(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 Tm(n){let e=Object.create(null);if(n)for(let t in n)e[t]=new m_(n[t]);return e}let Cm=class H1{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=Tm(r.attrs),this.defaultAttrs=Em(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==Xr.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:Mm(this.attrs,e)}create(e=null,t,r){if(this.isText)throw new Error("NodeType.create can't construct text nodes");return new Br(this,this.computeAttrs(e),L.from(t),ke.setFrom(r))}createChecked(e=null,t,r){return t=L.from(t),this.checkContent(t),new Br(this,this.computeAttrs(e),t,ke.setFrom(r))}createAndFill(e=null,t,r){if(e=this.computeAttrs(e),t=L.from(t),t.size){let l=this.contentMatch.fillBefore(t);if(!l)return null;t=l.append(t)}let i=this.contentMatch.matchFragment(t),o=i&&i.fillBefore(L.empty,!0);return o?new Br(this,e,t.append(o),ke.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:ke.none:e}static compile(e,t){let r=Object.create(null);e.forEach((o,l)=>r[o]=new H1(o,t,l));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 m_{constructor(e){this.hasDefault=Object.prototype.hasOwnProperty.call(e,"default"),this.default=e.default}get isRequired(){return!this.hasDefault}}class cl{constructor(e,t,r,i){this.name=e,this.rank=t,this.schema=r,this.spec=i,this.attrs=Tm(i.attrs),this.excluded=null;let o=Em(this.attrs);this.instance=o?new ke(this,o):null}create(e=null){return!e&&this.instance?this.instance:new ke(this,Mm(this.attrs,e))}static compile(e,t){let r=Object.create(null),i=0;return e.forEach((o,l)=>r[o]=new cl(o,i++,t,l)),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 g_{constructor(e){this.cached=Object.create(null);let t=this.spec={};for(let i in e)t[i]=e[i];t.nodes=Xe.from(e.nodes),t.marks=Xe.from(e.marks||{}),this.nodes=Cm.compile(this.spec.nodes,this),this.marks=cl.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],l=o.spec.content||"",u=o.spec.marks;o.contentMatch=r[l]||(r[l]=Xr.parse(l,this.nodes)),o.inlineContent=o.contentMatch.inlineContent,o.markSet=u=="_"?null:u?Am(this,u.split(" ")):u==""||!o.inlineContent?[]:null}for(let i in this.marks){let o=this.marks[i],l=o.spec.excludes;o.excluded=l==null?[o]:l==""?[]:Am(this,l.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 Cm){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 ul(r,r.defaultAttrs,e,ke.setFrom(t))}mark(e,t){return typeof e=="string"&&(e=this.marks[e]),e.create(t)}nodeFromJSON(e){return Br.fromJSON(this,e)}markFromJSON(e){return ke.fromJSON(this,e)}nodeType(e){let t=this.nodes[e];if(!t)throw new RangeError("Unknown node type: "+e);return t}}function Am(n,e){let t=[];for(let r=0;r<e.length;r++){let i=e[r],o=n.marks[i],l=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(l=f)}if(!l)throw new SyntaxError("Unknown mark type: '"+e[r]+"'")}return t}let lc=class Vf{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 Rm(this,t,!1);return r.addAll(e,t.from,t.to),r.finish()}parseSlice(e,t={}){let r=new Rm(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(v_(e,o.tag)&&(o.namespace===void 0||e.namespaceURI==o.namespace)&&(!o.context||t.matchesContext(o.context))){if(o.getAttrs){let l=o.getAttrs(e);if(l===!1)continue;o.attrs=l||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 l=this.styles[o],u=l.style;if(!(u.indexOf(e)!=0||l.context&&!r.matchesContext(l.context)||u.length>e.length&&(u.charCodeAt(e.length)!=61||u.slice(e.length+1)!=t))){if(l.getAttrs){let f=l.getAttrs(t);if(f===!1)continue;l.attrs=f||void 0}return l}}}static schemaRules(e){let t=[];function r(i){let o=i.priority==null?50:i.priority,l=0;for(;l<t.length;l++){let u=t[l];if((u.priority==null?50:u.priority)<o)break}t.splice(l,0,i)}for(let i in e.marks){let o=e.marks[i].spec.parseDOM;o&&o.forEach(l=>{r(l=Lm(l)),l.mark||l.ignore||l.clearMark||(l.mark=i)})}for(let i in e.nodes){let o=e.nodes[i].spec.parseDOM;o&&o.forEach(l=>{r(l=Lm(l)),l.node||l.ignore||l.mark||(l.node=i)})}return t}static fromSchema(e){return e.cached.domParser||(e.cached.domParser=new Vf(e,Vf.schemaRules(e)))}};const Im={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},y_={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},Om={ol:!0,ul:!0},ua=1,ca=2,Es=4;function Nm(n,e,t){return e!=null?(e?ua:0)|(e==="full"?ca:0):n&&n.whitespace=="pre"?ua|ca:t&~Es}class fa{constructor(e,t,r,i,o,l,u){this.type=e,this.attrs=t,this.marks=r,this.pendingMarks=i,this.solid=o,this.options=u,this.content=[],this.activeMarks=ke.none,this.stashMarks=[],this.match=l||(u&Es?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&ua)){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):w_(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&&!Im.hasOwnProperty(e.parentNode.nodeName.toLowerCase())}}class Rm{constructor(e,t,r){this.parser=e,this.options=t,this.isOpen=r,this.open=0;let i=t.topNode,o,l=Nm(null,t.preserveWhitespace,0)|(r?Es:0);i?o=new fa(i.type,i.attrs,ke.none,ke.none,!0,t.topMatch||i.type.contentMatch,l):r?o=new fa(null,null,ke.none,ke.none,!0,null,l):o=new fa(e.schema.topNodeType,null,ke.none,ke.none,!0,null,l),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(S_(t));if(!r)return;let[i,o]=r,l=this.top;for(let u=0;u<o.length;u++)this.removePendingMark(o[u],l);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],l);for(let u=0;u<o.length;u++)this.addPendingMark(o[u])}}}addTextNode(e){let t=e.nodeValue,r=this.top;if(r.options&ca||r.inlineContext(e)||/[^ \t\r\n\u000c]/.test(t)){if(r.options&ua)r.options&ca?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;
|
|
8
|
-
`))}ignoreFallback(e){e.nodeName=="BR"&&(!this.top.type||!this.top.type.inlineContent)&&this.findPlace(this.parser.schema.text("-"))}readStyles(e){let t=ke.none,r=ke.none;e:for(let i=0;i<e.length;i+=2)for(let o=void 0;;){let l=this.parser.matchStyle(e[i],e[i+1],this,o);if(!l)continue e;if(l.ignore)return null;if(l.clearMark?this.top.pendingMarks.forEach(u=>{l.clearMark(u)&&(r=u.addToSet(r))}):t=this.parser.schema.marks[l.mark].create(l.attrs).addToSet(t),l.consuming===!1)o=l;else break}return[t,r]}addElementByRule(e,t,r){let i,o,l;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)):(l=this.parser.schema.marks[t.mark].create(t.attrs),this.addPendingMark(l));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--,l&&this.removePendingMark(l,u)}addAll(e,t,r){let i=t||0;for(let o=t?e.childNodes[t]:e.firstChild,l=r==null?null:e.childNodes[r];o!=l;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],l=o.findWrapping(e);if(l&&(!t||t.length>l.length)&&(t=l,r=o,!l.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 l=Nm(e,i,o.options);o.options&Es&&o.content.length==0&&(l|=Es),this.nodes.push(new fa(e,t,o.activeMarks,o.pendingMarks,r,null,l)),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),l=(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(l(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 l(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=x_(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 l=i.popFromStashMark(e);l&&i.type&&i.type.allowsMarkType(l.type)&&(i.activeMarks=l.addToSet(i.activeMarks))}if(i==t)break}}}function b_(n){for(let e=n.firstChild,t=null;e;e=e.nextSibling){let r=e.nodeType==1?e.nodeName.toLowerCase():null;r&&Om.hasOwnProperty(r)&&t?(t.appendChild(e),e=t):r=="li"?t=e:r&&(t=null)}}function v_(n,e){return(n.matches||n.msMatchesSelector||n.webkitMatchesSelector||n.mozMatchesSelector).call(n,e)}function S_(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 Lm(n){let e={};for(let t in n)e[t]=n[t];return e}function w_(n,e){let t=e.schema.nodes;for(let r in t){let i=t[r];if(!i.allowsMarkType(n))continue;let o=[],l=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&&l(m))return!0}};if(l(i.contentMatch))return!0}}function x_(n,e){for(let t=0;t<e.length;t++)if(n.eq(e[t]))return e[t]}class Qr{constructor(e,t){this.nodes=e,this.marks=t}serializeFragment(e,t={},r){r||(r=uc(t).createDocumentFragment());let i=r,o=[];return e.forEach(l=>{if(o.length||l.marks.length){let u=0,f=0;for(;u<o.length&&f<l.marks.length;){let h=l.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<l.marks.length;){let h=l.marks[f++],m=this.serializeMark(h,l.isInline,t);m&&(o.push([h,i]),i.appendChild(m.dom),i=m.contentDOM||m.dom)}}i.appendChild(this.serializeNodeInner(l,t))}),r}serializeNodeInner(e,t){let{dom:r,contentDOM:i}=Qr.renderSpec(uc(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&&Qr.renderSpec(uc(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 l,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}=Qr.renderSpec(e,p,r);if(u.appendChild(y),S){if(l)throw new RangeError("Multiple content holes");l=S}}}return{dom:u,contentDOM:l}}static fromSchema(e){return e.cached.domSerializer||(e.cached.domSerializer=new Qr(this.nodesFromSchema(e),this.marksFromSchema(e)))}static nodesFromSchema(e){let t=Pm(e.nodes);return t.text||(t.text=r=>r.text),t}static marksFromSchema(e){return Pm(e.marks)}}function Pm(n){let e={};for(let t in n){let r=n[t].spec.toDOM;r&&(e[t]=r)}return e}function uc(n){return n.document||window.document}const Dm=65535,zm=Math.pow(2,16);function k_(n,e){return n+e*zm}function Bm(n){return n&Dm}function __(n){return(n-(n&Dm))/zm}const Fm=1,Hm=2,ha=4,$m=8;class cc{constructor(e,t,r){this.pos=e,this.delInfo=t,this.recover=r}get deleted(){return(this.delInfo&$m)>0}get deletedBefore(){return(this.delInfo&(Fm|ha))>0}get deletedAfter(){return(this.delInfo&(Hm|ha))>0}get deletedAcross(){return(this.delInfo&ha)>0}}class Kt{constructor(e,t=!1){if(this.ranges=e,this.inverted=t,!e.length&&Kt.empty)return Kt.empty}recover(e){let t=0,r=Bm(e);if(!this.inverted)for(let i=0;i<r;i++)t+=this.ranges[i*3+2]-this.ranges[i*3+1];return this.ranges[r*3]+t+__(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,l=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+l],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:k_(u/3,e-f),M=e==f?Hm:e==p?Fm:ha;return(t<0?e!=f:e!=p)&&(M|=$m),new cc(S,M,w)}i+=m-h}return r?e+i:new cc(e+i,0,null)}touches(e,t){let r=0,i=Bm(t),o=this.inverted?2:1,l=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+l]-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 l=this.ranges[i],u=l-(this.inverted?o:0),f=l+(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 Kt(this.ranges,!this.inverted)}toString(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)}static offset(e){return e==0?Kt.empty:new Kt(e<0?[0,-e,0]:[0,0,e])}}Kt.empty=new Kt([]);class Ui{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 Ui(this.maps,this.mirror,e,t)}copy(){return new Ui(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 Ui;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 l=this.maps[o],u=l.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 cc(e,i,null)}}const fc=Object.create(null);class rt{getMap(){return Kt.empty}merge(e){return null}static fromJSON(e,t){if(!t||!t.stepType)throw new RangeError("Invalid input for Step.fromJSON");let r=fc[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 fc)throw new RangeError("Duplicate use of step JSON ID "+e);return fc[e]=t,t.prototype.jsonID=e,t}}class Re{constructor(e,t){this.doc=e,this.failed=t}static ok(e){return new Re(e,null)}static fail(e){return new Re(null,e)}static fromReplace(e,t,r,i){try{return Re.ok(e.replace(t,r,i))}catch(o){if(o instanceof oa)return Re.fail(o.message);throw o}}}function hc(n,e,t){let r=[];for(let i=0;i<n.childCount;i++){let o=n.child(i);o.content.size&&(o=o.copy(hc(o.content,e,o))),o.isInline&&(o=e(o,t,i)),r.push(o)}return L.fromArray(r)}class xr extends rt{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(hc(t.content,(l,u)=>!l.isAtom||!u.type.allowsMarkType(this.mark.type)?l:l.mark(this.mark.addToSet(l.marks)),i),t.openStart,t.openEnd);return Re.fromReplace(e,this.from,this.to,o)}invert(){return new vn(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 xr(t.pos,r.pos,this.mark)}merge(e){return e instanceof xr&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new xr(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 xr(t.from,t.to,e.markFromJSON(t.mark))}}rt.jsonID("addMark",xr);class vn extends rt{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(hc(t.content,i=>i.mark(this.mark.removeFromSet(i.marks)),e),t.openStart,t.openEnd);return Re.fromReplace(e,this.from,this.to,r)}invert(){return new xr(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 vn(t.pos,r.pos,this.mark)}merge(e){return e instanceof vn&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new vn(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 vn(t.from,t.to,e.markFromJSON(t.mark))}}rt.jsonID("removeMark",vn);class kr extends rt{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return Re.fail("No node at mark step's position");let r=t.type.create(t.attrs,null,this.mark.addToSet(t.marks));return Re.fromReplace(e,this.pos,this.pos+1,new 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 Vi(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))}}rt.jsonID("addNodeMark",kr);class Vi extends rt{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return Re.fail("No node at mark step's position");let r=t.type.create(t.attrs,null,this.mark.removeFromSet(t.marks));return Re.fromReplace(e,this.pos,this.pos+1,new 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 Vi(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 Vi(t.pos,e.markFromJSON(t.mark))}}rt.jsonID("removeNodeMark",Vi);class it extends rt{constructor(e,t,r,i=!1){super(),this.from=e,this.to=t,this.slice=r,this.structure=i}apply(e){return this.structure&&dc(e,this.from,this.to)?Re.fail("Structure replace would overwrite content"):Re.fromReplace(e,this.from,this.to,this.slice)}getMap(){return new Kt([this.from,this.to-this.from,this.slice.size])}invert(e){return new it(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 it(t.pos,Math.max(t.pos,r.pos),this.slice)}merge(e){if(!(e instanceof it)||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 it(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 it(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 it(t.from,t.to,U.fromJSON(e,t.slice),!!t.structure)}}rt.jsonID("replace",it);class Ge extends rt{constructor(e,t,r,i,o,l,u=!1){super(),this.from=e,this.to=t,this.gapFrom=r,this.gapTo=i,this.slice=o,this.insert=l,this.structure=u}apply(e){if(this.structure&&(dc(e,this.from,this.gapFrom)||dc(e,this.gapTo,this.to)))return Re.fail("Structure gap-replace would overwrite content");let t=e.slice(this.gapFrom,this.gapTo);if(t.openStart||t.openEnd)return Re.fail("Gap is not a flat range");let r=this.slice.insertAt(this.insert,t.content);return r?Re.fromReplace(e,this.from,this.to,r):Re.fail("Content does not fit in gap")}getMap(){return new Kt([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 Ge(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 Ge(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 Ge(t.from,t.to,t.gapFrom,t.gapTo,U.fromJSON(e,t.slice),t.insert,!!t.structure)}}rt.jsonID("replaceAround",Ge);function dc(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 l=r.node(o).maybeChild(r.indexAfter(o));for(;i>0;){if(!l||l.isLeaf)return!0;l=l.firstChild,i--}}return!1}function E_(n,e,t,r){let i=[],o=[],l,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)||(l&&l.to==y&&l.mark.eq(p[M])?l.to=S:i.push(l=new vn(y,S,p[M])));u&&u.to==y?u.to=S:o.push(u=new xr(y,S,r))}}),i.forEach(f=>n.step(f)),o.forEach(f=>n.step(f))}function M_(n,e,t,r){let i=[],o=0;n.doc.nodesBetween(e,t,(l,u)=>{if(!l.isInline)return;o++;let f=null;if(r instanceof cl){let h=l.marks,m;for(;m=r.isInSet(h);)(f||(f=[])).push(m),h=m.removeFromSet(h)}else r?r.isInSet(l.marks)&&(f=[r]):f=l.marks;if(f&&f.length){let h=Math.min(u+l.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(l=>n.step(new vn(l.from,l.to,l.style)))}function T_(n,e,t,r=t.contentMatch){let i=n.doc.nodeAt(e),o=[],l=e+1;for(let u=0;u<i.childCount;u++){let f=i.child(u),h=l+f.nodeSize,m=r.matchType(f.type);if(!m)o.push(new it(l,h,U.empty));else{r=m;for(let p=0;p<f.marks.length;p++)t.allowsMarkType(f.marks[p].type)||n.step(new vn(l,h,f.marks[p]))}l=h}if(!r.validEnd){let u=r.fillBefore(L.empty,!0);n.replace(l,l,new U(u,0,0))}for(let u=o.length-1;u>=0;u--)n.step(o[u])}function C_(n,e,t){return(e==0||n.canReplace(e,n.childCount))&&(t==n.childCount||n.canReplace(0,t))}function _i(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),l=n.$to.indexAfter(r);if(r<n.depth&&i.canReplace(o,l,t))return r;if(r==0||i.type.spec.isolating||!C_(i,o,l))break}return null}function A_(n,e,t){let{$from:r,$to:i,depth:o}=e,l=r.before(o+1),u=i.after(o+1),f=l,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 Ge(f,h,l,u,new U(m.append(y),p,S),m.size-p,!0))}function pc(n,e,t=null,r=n){let i=I_(n,e),o=i&&O_(r,e);return o?i.map(Wm).concat({type:e,attrs:t}).concat(o.map(Wm)):null}function Wm(n){return{type:n,attrs:null}}function I_(n,e){let{parent:t,startIndex:r,endIndex:i}=n,o=t.contentMatchAt(r).findWrapping(e);if(!o)return null;let l=o.length?o[0]:e;return t.canReplaceWith(r,i,l)?o:null}function O_(n,e){let{parent:t,startIndex:r,endIndex:i}=n,o=t.child(r),l=e.contentMatch.findWrapping(o.type);if(!l)return null;let f=(l.length?l[l.length-1]:e).contentMatch;for(let h=r;f&&h<i;h++)f=f.matchType(t.child(h).type);return!f||!f.validEnd?null:l}function N_(n,e,t){let r=L.empty;for(let l=t.length-1;l>=0;l--){if(r.size){let u=t[l].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[l].type.create(t[l].attrs,r))}let i=e.start,o=e.end;n.step(new Ge(i,o,i,o,new U(r,0,0),t.length,!0))}function R_(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,(l,u)=>{if(l.isTextblock&&!l.hasMarkup(r,i)&&L_(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+l.nodeSize,1);return n.step(new Ge(h,m,h+1,m-1,new U(L.from(r.create(i,null,l.marks)),0,0),1,!0)),!1}})}function L_(n,e,t){let r=n.resolve(e),i=r.index();return r.parent.canReplaceWith(i,i+1,t)}function P_(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 l=t.create(r,null,i||o.marks);if(o.isLeaf)return n.replaceWith(e,e+o.nodeSize,l);if(!t.validContent(o.content))throw new RangeError("Invalid content for node type "+t.name);n.step(new Ge(e,e+o.nodeSize,e+1,e+o.nodeSize-1,new U(L.from(l),0,0),1,!0))}function zn(n,e,t=1,r){let i=n.resolve(e),o=i.depth-t,l=r&&r[r.length-1]||i.parent;if(o<0||i.parent.type.spec.isolating||!i.parent.canReplace(i.index(),i.parent.childCount)||!l.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 D_(n,e,t=1,r){let i=n.doc.resolve(e),o=L.empty,l=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];l=L.from(m?m.type.create(m.attrs,l):i.node(u).copy(l))}n.step(new it(e,e,new U(o.append(l),t,t),!0))}function ur(n,e){let t=n.resolve(e),r=t.index();return Um(t.nodeBefore,t.nodeAfter)&&t.parent.canReplace(r,r+1)}function Um(n,e){return!!(n&&e&&!n.isLeaf&&n.canAppend(e))}function da(n,e,t=-1){let r=n.resolve(e);for(let i=r.depth;;i--){let o,l,u=r.index(i);if(i==r.depth?(o=r.nodeBefore,l=r.nodeAfter):t>0?(o=r.node(i+1),u++,l=r.node(i).maybeChild(u)):(o=r.node(i).maybeChild(u-1),l=r.node(i+1)),o&&!o.isTextblock&&Um(o,l)&&r.node(i).canReplace(u,u+1))return e;if(i==0)break;e=t<0?r.before(i):r.after(i)}}function z_(n,e,t){let r=new it(e-t,e+t,U.empty,!0);n.step(r)}function B_(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 F_(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 l=r.depth;l>=0;l--){let u=l==r.depth?0:r.pos<=(r.start(l+1)+r.end(l+1))/2?-1:1,f=r.index(l)+(u>0?1:0),h=r.node(l),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(l+1):r.after(l+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 Vm(i,o,r)?new it(e,t,r):new H_(i,o,r).fit()}function Vm(n,e,t){return!t.openStart&&!t.openEnd&&n.start()==e.start()&&n.parent.canReplace(n.index(),e.index(),t.content)}class H_{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,l=r.depth,u=i.depth;for(;l&&u&&o.childCount==1;)o=o.firstChild.content,l--,u--;let f=new U(o,l,u);return e>-1?new Ge(r.pos,e,this.$to.pos,this.$to.end(),f,t):f.size||r.pos!=this.$to.pos?new it(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=gc(this.unplaced.content,t-1).firstChild,r=i.content):r=this.unplaced.content;let o=r.firstChild;for(let l=this.depth;l>=0;l--){let{type:u,match:f}=this.frontier[l],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:l,parent:i,inject:m};if(e==2&&o&&(h=f.findWrapping(o.type)))return{sliceDepth:t,frontierDepth:l,parent:i,wrap:h};if(i&&f.matchType(i.type))break}}}openMore(){let{content:e,openStart:t,openEnd:r}=this.unplaced,i=gc(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=gc(e,t);if(i.childCount<=1&&t>0){let o=e.size-t<=t+i.size;this.unplaced=new U(Ms(e,t-1,1),t-1,o?t-1:r)}else this.unplaced=new U(Ms(e,t,1),t,r)}placeNodes({sliceDepth:e,frontierDepth:t,parent:r,inject:i,wrap:o}){for(;this.depth>t;)this.closeFrontierNode();if(o)for(let M=0;M<o.length;M++)this.openFrontierNode(o[M]);let l=this.unplaced,u=r?r.content:l.content,f=l.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-(l.content.size-l.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(Km(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=Ts(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 I=T.lastChild;this.frontier.push({type:I.type,match:I.contentMatchAt(I.childCount)}),T=I.content}this.unplaced=w?e==0?U.empty:new U(Ms(l.content,e-1,1),e-1,S<0?l.openEnd:e-1):new U(Ms(l.content,e,h),l.openStart,l.openEnd)}mustMoveInline(){if(!this.$to.parent.isTextblock)return-1;let e=this.frontier[this.depth],t;if(!e.type.isTextblock||!yc(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)),l=yc(e,t,i,r,o);if(l){for(let u=t-1;u>=0;u--){let{match:f,type:h}=this.frontier[u],m=yc(e,u,h,f,!0);if(!m||m.childCount)continue e}return{depth:t,fit:l,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=Ts(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=Ts(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=Ts(this.placed,this.frontier.length,t))}}function Ms(n,e,t){return e==0?n.cutByIndex(t,n.childCount):n.replaceChild(0,n.firstChild.copy(Ms(n.firstChild.content,e-1,t)))}function Ts(n,e,t){return e==0?n.append(t):n.replaceChild(n.childCount-1,n.lastChild.copy(Ts(n.lastChild.content,e-1,t)))}function gc(n,e){for(let t=0;t<e;t++)n=n.firstChild.content;return n}function Km(n,e,t){if(e<=0)return n;let r=n.content;return e>1&&(r=r.replaceChild(0,Km(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 yc(n,e,t,r,i){let o=n.node(e),l=i?n.indexAfter(e):n.index(e);if(l==o.childCount&&!t.compatibleContent(o.type))return null;let u=r.fillBefore(o.content,!0,l);return u&&!$_(t,o.content,l)?u:null}function $_(n,e,t){for(let r=t;r<e.childCount;r++)if(!n.allowsMarks(e.child(r).marks))return!0;return!1}function W_(n){return n.spec.defining||n.spec.definingForContent}function U_(n,e,t,r){if(!r.size)return n.deleteRange(e,t);let i=n.doc.resolve(e),o=n.doc.resolve(t);if(Vm(i,o,r))return n.step(new it(e,t,r));let l=qm(i,n.doc.resolve(t));l[l.length-1]==0&&l.pop();let u=-(i.depth+1);l.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;l.indexOf(y)>-1?u=y:i.before(y)==S&&l.splice(1,0,-y)}let f=l.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=W_(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<l.length;M++){let T=l[(M+f)%l.length],I=!0;T<0&&(I=!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),I?o.after(T):t,new U(Gm(r.content,0,r.openStart,S),S,r.openEnd))}}let p=n.steps.length;for(let y=l.length-1;y>=0&&(n.replace(e,t,r),!(n.steps.length>p));y--){let S=l[y];S<0||(e=i.before(S),t=o.after(S))}}function Gm(n,e,t,r,i){if(e<t){let o=n.firstChild;n=n.replaceChild(0,o.copy(Gm(o.content,e+1,t,r,o)))}if(e>r){let o=i.contentMatchAt(0),l=o.fillBefore(n).append(n);n=l.append(o.matchFragment(l).fillBefore(L.empty,!0))}return n}function V_(n,e,t,r){if(!r.isInline&&e==t&&n.doc.resolve(e).parent.content.size){let i=B_(n.doc,e,r.type);i!=null&&(e=t=i)}n.replaceRange(e,t,new U(L.from(r),0,0))}function K_(n,e,t){let r=n.doc.resolve(e),i=n.doc.resolve(t),o=qm(r,i);for(let l=0;l<o.length;l++){let u=o[l],f=l==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 l=1;l<=r.depth&&l<=i.depth;l++)if(e-r.start(l)==r.depth-l&&t>r.end(l)&&i.end(l)-t!=i.depth-l)return n.delete(r.before(l),t);n.delete(e,t)}function qm(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 Ki extends rt{constructor(e,t,r){super(),this.pos=e,this.attr=t,this.value=r}apply(e){let t=e.nodeAt(this.pos);if(!t)return Re.fail("No node at attribute step's position");let r=Object.create(null);for(let o in t.attrs)r[o]=t.attrs[o];r[this.attr]=this.value;let i=t.type.create(r,null,t.marks);return Re.fromReplace(e,this.pos,this.pos+1,new U(L.from(i),0,t.isLeaf?0:1))}getMap(){return Kt.empty}invert(e){return new Ki(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 Ki(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 Ki(t.pos,t.attr,t.value)}}rt.jsonID("attr",Ki);let Ei=class extends Error{};Ei=function n(e){let t=Error.call(this,e);return t.__proto__=n.prototype,t},Ei.prototype=Object.create(Error.prototype),Ei.prototype.constructor=Ei,Ei.prototype.name="TransformError";class G_{constructor(e){this.doc=e,this.steps=[],this.docs=[],this.mapping=new Ui}get before(){return this.docs.length?this.docs[0]:this.doc}step(e){let t=this.maybeStep(e);if(t.failed)throw new Ei(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 U_(this,e,t,r),this}replaceRangeWith(e,t,r){return V_(this,e,t,r),this}deleteRange(e,t){return K_(this,e,t),this}lift(e,t){return A_(this,e,t),this}join(e,t=1){return z_(this,e,t),this}wrap(e,t){return N_(this,e,t),this}setBlockType(e,t=e,r,i=null){return R_(this,e,t,r,i),this}setNodeMarkup(e,t,r=null,i=[]){return P_(this,e,t,r,i),this}setNodeAttribute(e,t,r){return this.step(new Ki(e,t,r)),this}addNodeMark(e,t){return this.step(new kr(e,t)),this}removeNodeMark(e,t){if(!(t instanceof ke)){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 Vi(e,t)),this}split(e,t=1,r){return D_(this,e,t,r),this}addMark(e,t,r){return E_(this,e,t,r),this}removeMark(e,t,r){return M_(this,e,t,r),this}clearIncompatible(e,t,r){return T_(this,e,t,r),this}}const bc=Object.create(null);class me{constructor(e,t,r){this.$anchor=e,this.$head=t,this.ranges=r||[new q_(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,l=this.ranges;for(let u=0;u<l.length;u++){let{$from:f,$to:h}=l[u],m=e.mapping.slice(o);e.replaceRange(m.map(f.pos),m.map(h.pos),u?U.empty:t),u==0&&Ym(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:l,$to:u}=i[o],f=e.mapping.slice(r),h=f.map(l.pos),m=f.map(u.pos);o?e.deleteRange(h,m):(e.replaceRangeWith(h,m,t),Ym(e,r,t.isInline?-1:1))}}static findFrom(e,t,r=!1){let i=e.parent.inlineContent?new de(e):Mi(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 l=t<0?Mi(e.node(0),e.node(o),e.before(o+1),e.index(o),t,r):Mi(e.node(0),e.node(o),e.after(o+1),e.index(o)+1,t,r);if(l)return l}return null}static near(e,t=1){return this.findFrom(e,t)||this.findFrom(e,-t)||new Vt(e.node(0))}static atStart(e){return Mi(e,e,0,0,1)||new Vt(e)}static atEnd(e){return Mi(e,e,e.content.size,e.childCount,-1)||new Vt(e)}static fromJSON(e,t){if(!t||!t.type)throw new RangeError("Invalid input for Selection.fromJSON");let r=bc[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 bc)throw new RangeError("Duplicate use of selection JSON ID "+e);return bc[e]=t,t.prototype.jsonID=e,t}getBookmark(){return de.between(this.$anchor,this.$head).getBookmark()}}me.prototype.visible=!0;class q_{constructor(e,t){this.$from=e,this.$to=t}}let Jm=!1;function jm(n){!Jm&&!n.parent.inlineContent&&(Jm=!0,console.warn("TextSelection endpoint not pointing into a node with inline content ("+n.parent.type.name+")"))}class de extends me{constructor(e,t=e){jm(e),jm(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 me.near(r);let i=e.resolve(t.map(this.anchor));return new de(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 de&&e.anchor==this.anchor&&e.head==this.head}getBookmark(){return new fl(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 de(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=me.findFrom(t,r,!0)||me.findFrom(t,-r,!0);if(o)t=o.$head;else return me.near(t,r)}return e.parent.inlineContent||(i==0?e=t:(e=(me.findFrom(e,-r,!0)||me.findFrom(e,r,!0)).$anchor,e.pos<t.pos!=i<0&&(e=t))),new de(e,t)}}me.jsonID("text",de);class fl{constructor(e,t){this.anchor=e,this.head=t}map(e){return new fl(e.map(this.anchor),e.map(this.head))}resolve(e){return de.between(e.resolve(this.anchor),e.resolve(this.head))}}class Z extends me{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?me.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 Kf(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,me.jsonID("node",Z);class Kf{constructor(e){this.anchor=e}map(e){let{deleted:t,pos:r}=e.mapResult(this.anchor);return t?new fl(r,r):new Kf(r)}resolve(e){let t=e.resolve(this.anchor),r=t.nodeAfter;return r&&Z.isSelectable(r)?new Z(t):me.near(t)}}class Vt extends me{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=me.atStart(e.doc);r.eq(e.selection)||e.setSelection(r)}else super.replace(e,t)}toJSON(){return{type:"all"}}static fromJSON(e){return new Vt(e)}map(e){return new Vt(e)}eq(e){return e instanceof Vt}getBookmark(){return J_}}me.jsonID("all",Vt);const J_={map(){return this},resolve(n){return new Vt(n)}};function Mi(n,e,t,r,i,o=!1){if(e.inlineContent)return de.create(n,t);for(let l=r-(i>0?0:1);i>0?l<e.childCount:l>=0;l+=i){let u=e.child(l);if(u.isAtom){if(!o&&Z.isSelectable(u))return Z.create(n,t-(i<0?u.nodeSize:0))}else{let f=Mi(n,u,t+i,i<0?u.childCount:0,i,o);if(f)return f}t+=u.nodeSize*i}return null}function Ym(n,e,t){let r=n.steps.length-1;if(r<e)return;let i=n.steps[r];if(!(i instanceof it||i instanceof Ge))return;let o=n.mapping.maps[r],l;o.forEach((u,f,h,m)=>{l==null&&(l=m)}),n.setSelection(me.near(n.doc.resolve(l),t))}function Xm(n,e){return!e||!n?n:n.bind(e)}class pa{constructor(e,t,r){this.name=e,this.init=Xm(t.init,r),this.apply=Xm(t.apply,r)}}new pa("doc",{init(n){return n.doc||n.schema.topNodeType.createAndFill()},apply(n){return n.doc}}),new pa("selection",{init(n,e){return n.selection||me.atStart(e.doc)},apply(n){return n.selection}}),new pa("storedMarks",{init(n){return n.storedMarks||null},apply(n,e,t,r){return r.selection.$cursor?n.storedMarks:null}}),new pa("scrollToSelection",{init(){return 0},apply(n,e){return n.scrolledIntoView?e+1:e}});function Zm(n,e,t){for(let r in n){let i=n[r];i instanceof Function?i=i.bind(e):r=="handleDOMEvents"&&(i=Zm(i,e,{})),t[r]=i}return t}class Mt{constructor(e){this.spec=e,this.props={},e.props&&Zm(e.props,this,this.props),this.key=e.key?e.key.key:Qm("plugin")}getState(e){return e[this.key]}}const vc=Object.create(null);function Qm(n){return n in vc?n+"$"+ ++vc[n]:(vc[n]=0,n+"$")}class rn{constructor(e="key"){this.key=Qm(e)}get(e){return e.config.pluginsByKey[this.key]}getState(e){return e[this.key]}}const Cs=function(n){for(var e=0;;e++)if(n=n.previousSibling,!n)return e},eg=function(n,e,t,r){return t&&(tg(n,e,t,r,-1)||tg(n,e,t,r,1))},j_=/^(img|br|input|textarea|hr)$/i;function tg(n,e,t,r,i){for(;;){if(n==t&&e==r)return!0;if(e==(i<0?0:ma(n))){let o=n.parentNode;if(!o||o.nodeType!=1||X_(n)||j_.test(n.nodeName)||n.contentEditable=="false")return!1;e=Cs(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?ma(n):0}else return!1}}function ma(n){return n.nodeType==3?n.nodeValue.length:n.childNodes.length}function Y_(n,e,t){for(let r=e==0,i=e==ma(n);r||i;){if(n==t)return!0;let o=Cs(n);if(n=n.parentNode,!n)return!1;r=r&&o==0,i=i&&o==ma(n)}}function X_(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 ng=function(n){return n.focusNode&&eg(n.focusNode,n.focusOffset,n.anchorNode,n.anchorOffset)};function rg(n,e){let t=document.createEvent("Event");return t.initEvent("keydown",!0,!0),t.keyCode=n,t.key=t.code=e,t}const cr=typeof navigator<"u"?navigator:null,ig=typeof document<"u"?document:null,fr=cr&&cr.userAgent||"",Sc=/Edge\/(\d+)/.exec(fr),sg=/MSIE \d/.exec(fr),wc=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(fr),As=!!(sg||wc||Sc),og=sg?document.documentMode:wc?+wc[1]:Sc?+Sc[1]:0,ga=!As&&/gecko\/(\d+)/i.test(fr);ga&&+(/Firefox\/(\d+)/.exec(fr)||[0,0])[1];const xc=!As&&/Chrome\/(\d+)/.exec(fr),Ti=!!xc,Z_=xc?+xc[1]:0,Fr=!As&&!!cr&&/Apple Computer/.test(cr.vendor),kc=Fr&&(/Mobile\/\w+/.test(fr)||!!cr&&cr.maxTouchPoints>2),Ht=kc||(cr?/Mac/.test(cr.platform):!1),Is=/Android \d/.test(fr),_c=!!ig&&"webkitFontSmoothing"in ig.documentElement.style,Q_=_c?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function eE(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,l=n.docView.posFromDOM(t.focusNode,t.focusOffset,1);if(l<0)return null;let u=r.resolve(l),f,h;if(ng(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&&Y_(t.focusNode,t.focusOffset,i.dom))){let p=i.posBefore;h=new Z(l==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=hg(n,f,u,m)}return h}function ag(n){return n.editable?n.hasFocus():iE(n)&&document.activeElement&&document.activeElement.contains(n.dom)}function Ec(n,e=!1){let t=n.state.selection;if(rE(n,t),!!ag(n)){if(!e&&n.input.mouseDown&&n.input.mouseDown.allowDefault&&Ti){let r=n.domSelectionRange(),i=n.domObserver.currentSelection;if(r.anchorNode&&i.anchorNode&&eg(r.anchorNode,r.anchorOffset,i.anchorNode,i.anchorOffset)){n.input.mouseDown.delayedSelectionSync=!0,n.domObserver.setCurSelection();return}}if(n.domObserver.disconnectSelection(),n.cursorWrapper)nE(n);else{let{anchor:r,head:i}=t,o,l;lg&&!(t instanceof de)&&(t.$from.parent.inlineContent||(o=ug(n,t.from)),!t.empty&&!t.$from.parent.inlineContent&&(l=ug(n,t.to))),n.docView.setSelection(r,i,n.root,e),lg&&(o&&cg(o),l&&cg(l)),t.visible?n.dom.classList.remove("ProseMirror-hideselection"):(n.dom.classList.add("ProseMirror-hideselection"),"onselectionchange"in document&&tE(n))}n.domObserver.setCurSelection(),n.domObserver.connectSelection()}}const lg=Fr||Ti&&Z_<63;function ug(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(Fr&&i&&i.contentEditable=="false")return Mc(i);if((!i||i.contentEditable=="false")&&(!o||o.contentEditable=="false")){if(i)return Mc(i);if(o)return Mc(o)}}function Mc(n){return n.contentEditable="true",Fr&&n.draggable&&(n.draggable=!1,n.wasDraggable=!0),n}function cg(n){n.contentEditable="false",n.wasDraggable&&(n.draggable=!0,n.wasDraggable=null)}function tE(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(()=>{(!ag(n)||n.state.selection.visible)&&n.dom.classList.remove("ProseMirror-hideselection")},20))})}function nE(n){let e=n.domSelection(),t=document.createRange(),r=n.cursorWrapper.dom,i=r.nodeName=="IMG";i?t.setEnd(r.parentNode,Cs(r)+1):t.setEnd(r,0),t.collapse(!1),e.removeAllRanges(),e.addRange(t),!i&&!n.state.selection.visible&&As&&og<=11&&(r.disabled=!0,r.disabled=!1)}function rE(n,e){if(e instanceof Z){let t=n.docView.descAt(e.from);t!=n.lastSelectedViewDesc&&(fg(n),t&&t.selectNode(),n.lastSelectedViewDesc=t)}else fg(n)}function fg(n){n.lastSelectedViewDesc&&(n.lastSelectedViewDesc.parent&&n.lastSelectedViewDesc.deselectNode(),n.lastSelectedViewDesc=void 0)}function hg(n,e,t,r){return n.someProp("createSelectionBetween",i=>i(n,e,t))||de.between(e,t,r)}function iE(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 Tc(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&&me.findFrom(o,e)}function Hr(n,e){return n.dispatch(n.state.tr.setSelection(e).scrollIntoView()),!0}function dg(n,e,t){let r=n.state.selection;if(r instanceof de){if(!r.empty||t.indexOf("s")>-1)return!1;if(n.endOfTextblock(e>0?"right":"left")){let i=Tc(n.state,e);return i&&i instanceof Z?Hr(n,i):!1}else if(!(Ht&&t.indexOf("m")>-1)){let i=r.$head,o=i.textOffset?null:e<0?i.nodeBefore:i.nodeAfter,l;if(!o||o.isText)return!1;let u=e<0?i.pos-o.nodeSize:i.pos;return o.isAtom||(l=n.docView.descAt(u))&&!l.contentDOM?Z.isSelectable(o)?Hr(n,new Z(e<0?n.state.doc.resolve(i.pos-o.nodeSize):i)):_c?Hr(n,new de(n.state.doc.resolve(e<0?u:u+o.nodeSize))):!1:!1}}else{if(r instanceof Z&&r.node.isInline)return Hr(n,new de(e>0?r.$to:r.$from));{let i=Tc(n.state,e);return i?Hr(n,i):!1}}}function ya(n){return n.nodeType==3?n.nodeValue.length:n.childNodes.length}function Os(n){let e=n.pmViewDesc;return e&&e.size==0&&(n.nextSibling||n.nodeName!="BR")}function Cc(n){let e=n.domSelectionRange(),t=e.focusNode,r=e.focusOffset;if(!t)return;let i,o,l=!1;for(ga&&t.nodeType==1&&r<ya(t)&&Os(t.childNodes[r])&&(l=!0);;)if(r>0){if(t.nodeType!=1)break;{let u=t.childNodes[r-1];if(Os(u))i=t,o=--r;else if(u.nodeType==3)t=u,r=t.nodeValue.length;else break}}else{if(pg(t))break;{let u=t.previousSibling;for(;u&&Os(u);)i=t.parentNode,o=Cs(u),u=u.previousSibling;if(u)t=u,r=ya(t);else{if(t=t.parentNode,t==n.dom)break;r=0}}}l?Ic(n,t,r):i&&Ic(n,i,o)}function Ac(n){let e=n.domSelectionRange(),t=e.focusNode,r=e.focusOffset;if(!t)return;let i=ya(t),o,l;for(;;)if(r<i){if(t.nodeType!=1)break;let u=t.childNodes[r];if(Os(u))o=t,l=++r;else break}else{if(pg(t))break;{let u=t.nextSibling;for(;u&&Os(u);)o=u.parentNode,l=Cs(u)+1,u=u.nextSibling;if(u)t=u,r=0,i=ya(t);else{if(t=t.parentNode,t==n.dom)break;r=i=0}}}o&&Ic(n,o,l)}function pg(n){let e=n.pmViewDesc;return e&&e.node&&e.node.isBlock}function Ic(n,e,t){let r=n.domSelection();if(ng(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&&Ec(n)},50)}function mg(n,e,t){let r=n.state.selection;if(r instanceof de&&!r.empty||t.indexOf("s")>-1||Ht&&t.indexOf("m")>-1)return!1;let{$from:i,$to:o}=r;if(!i.parent.inlineContent||n.endOfTextblock(e<0?"up":"down")){let l=Tc(n.state,e);if(l&&l instanceof Z)return Hr(n,l)}if(!i.parent.inlineContent){let l=e<0?i:o,u=r instanceof Vt?me.near(l,e):me.findFrom(l,e);return u?Hr(n,u):!1}return!1}function gg(n,e){if(!(n.state.selection instanceof de))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 l=n.state.tr;return e<0?l.delete(t.pos-o.nodeSize,t.pos):l.delete(t.pos,t.pos+o.nodeSize),n.dispatch(l),!0}return!1}function yg(n,e,t){n.domObserver.stop(),e.contentEditable=t,n.domObserver.start()}function sE(n){if(!Fr||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;yg(n,r,"true"),setTimeout(()=>yg(n,r,"false"),20)}return!1}function oE(n){let e="";return n.ctrlKey&&(e+="c"),n.metaKey&&(e+="m"),n.altKey&&(e+="a"),n.shiftKey&&(e+="s"),e}function aE(n,e){let t=e.keyCode,r=oE(e);return t==8||Ht&&t==72&&r=="c"?gg(n,-1)||Cc(n):t==46||Ht&&t==68&&r=="c"?gg(n,1)||Ac(n):t==13||t==27?!0:t==37||Ht&&t==66&&r=="c"?dg(n,-1,r)||Cc(n):t==39||Ht&&t==70&&r=="c"?dg(n,1,r)||Ac(n):t==38||Ht&&t==80&&r=="c"?mg(n,-1,r)||Cc(n):t==40||Ht&&t==78&&r=="c"?sE(n)||mg(n,1,r)||Ac(n):r==(Ht?"m":"c")&&(t==66||t==73||t==89||t==90)}function bg(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 l=n.someProp("clipboardSerializer")||Qr.fromSchema(n.state.schema),u=Mg(),f=u.createElement("div");f.appendChild(l.serializeFragment(r,{document:u}));let h=f.firstChild,m,p=0;for(;h&&h.nodeType==1&&(m=_g[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,`
|
|
3
|
+
`,...bk(i)),console.warn(...o)}Wo(),Zu=!1}function yk(){let n=Pr[Pr.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 bk(n){const e=[];return n.forEach((t,r)=>{e.push(...r===0?[]:[`
|
|
4
|
+
`],...vk(t))}),e}function vk({vnode:n,recurseCount:e}){const t=e>0?`... (${e} recursive calls)`:"",r=n.component?n.component.parent==null:!1,i=` at <${hm(n.component,n.type,r)}`,o=">"+t;return n.props?[i,...wk(n.props),o]:[i+o]}function wk(n){const e=[],t=Object.keys(n);return t.slice(0,3).forEach(r=>{e.push(...jp(r,n[r]))}),t.length>3&&e.push(" ..."),e}function jp(n,e,t){return Nn(e)?(e=JSON.stringify(e),t?e:[`${n}=${e}`]):typeof e=="number"||typeof e=="boolean"||e==null?t?e:[`${n}=${e}`]:ut(e)?(e=jp(n,ce(e.value),!0),t?e:[`${n}=Ref<`,e,">"]):Ye(e)?[`${n}=fn${e.name?`<${e.name}>`:""}`]:(e=ce(e),t?e:[`${n}=`,e])}const Yp={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 Yo(n,e,t,r){try{return r?n(...r):n()}catch(i){Qu(i,e,t)}}function Xp(n,e,t,r){if(Ye(n)){const i=Yo(n,e,t,r);return i&&Ox(i)&&i.catch(o=>{Qu(o,e,t)}),i}if(Oe(n)){const i=[];for(let o=0;o<n.length;o++)i.push(Xp(n[o],e,t,r));return i}else process.env.NODE_ENV!=="production"&&ct(`Invalid value type passed to callWithAsyncErrorHandling(): ${typeof n}`)}function Qu(n,e,t,r=!0){const i=e?e.vnode:null,{errorHandler:o,throwUnhandledErrorInProduction:l}=e&&e.appContext.config||ms;if(e){let u=e.parent;const f=e.proxy,h=process.env.NODE_ENV!=="production"?Yp[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){$o(),Yo(o,null,10,[n,f,h]),Wo();return}}Sk(n,t,i,r,l)}function Sk(n,e,t,r=!0,i=!1){if(process.env.NODE_ENV!=="production"){const o=Yp[e];if(t&&mk(t),ct(`Unhandled error${o?` during execution of ${o}`:""}`),t&&gk(),r)throw n;console.error(n)}else{if(i)throw n;console.error(n)}}const Ft=[];let Dn=-1;const wi=[];let lr=null,Si=0;const xk=Promise.resolve();let ec=null;const kk=100;function _k(n){let e=Dn+1,t=Ft.length;for(;e<t;){const r=e+t>>>1,i=Ft[r],o=ks(i);o<n||o===n&&i.flags&2?e=r+1:t=r}return e}function Zp(n){if(!(n.flags&1)){const e=ks(n),t=Ft[Ft.length-1];!t||!(n.flags&2)&&e>=ks(t)?Ft.push(n):Ft.splice(_k(e),0,n),n.flags|=1,Qp()}}function Qp(){ec||(ec=xk.then(tm))}function em(n){Oe(n)?wi.push(...n):lr&&n.id===-1?lr.splice(Si+1,0,n):n.flags&1||(wi.push(n),n.flags|=1),Qp()}function Ek(n){if(wi.length){const e=[...new Set(wi)].sort((t,r)=>ks(t)-ks(r));if(wi.length=0,lr){lr.push(...e);return}for(lr=e,process.env.NODE_ENV!=="production"&&(n=n||new Map),Si=0;Si<lr.length;Si++){const t=lr[Si];process.env.NODE_ENV!=="production"&&nm(n,t)||(t.flags&4&&(t.flags&=-2),t.flags&8||t(),t.flags&=-2)}lr=null,Si=0}}const ks=n=>n.id==null?n.flags&2?-1:1/0:n.id;function tm(n){process.env.NODE_ENV!=="production"&&(n=n||new Map);const e=process.env.NODE_ENV!=="production"?t=>nm(n,t):gi;try{for(Dn=0;Dn<Ft.length;Dn++){const t=Ft[Dn];if(t&&!(t.flags&8)){if(process.env.NODE_ENV!=="production"&&e(t))continue;t.flags&4&&(t.flags&=-2),Yo(t,t.i,t.i?15:14),t.flags&4||(t.flags&=-2)}}}finally{for(;Dn<Ft.length;Dn++){const t=Ft[Dn];t&&(t.flags&=-2)}Dn=-1,Ft.length=0,Ek(n),ec=null,(Ft.length||wi.length)&&tm(n)}}function nm(n,e){const t=n.get(e)||0;if(t>kk){const r=e.i,i=r&&fm(r.type);return Qu(`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 tc=new Map;process.env.NODE_ENV!=="production"&&(Ho().__VUE_HMR_RUNTIME__={createRecord:nc(Mk),rerender:nc(Tk),reload:nc(Ck)});const Xo=new Map;function Mk(n,e){return Xo.has(n)?!1:(Xo.set(n,{initialDef:Zo(e),instances:new Set}),!0)}function Zo(n){return dm(n)?n.__vccOpts:n}function Tk(n,e){const t=Xo.get(n);t&&(t.initialDef.render=e,[...t.instances].forEach(r=>{e&&(r.render=e,Zo(r.type).render=e),r.renderCache=[],r.update()}))}function Ck(n,e){const t=Xo.get(n);if(!t)return;e=Zo(e),rm(t.initialDef,e);const r=[...t.instances];for(let i=0;i<r.length;i++){const o=r[i],l=Zo(o.type);let u=tc.get(l);u||(l!==t.initialDef&&rm(l,e),tc.set(l,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?Zp(()=>{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(l)}em(()=>{tc.clear()})}function rm(n,e){ir(n,e);for(const t in n)t!=="__file"&&!(t in e)&&delete n[t]}function nc(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 xi,Qo=[];function im(n,e){var t,r;xi=n,xi?(xi.enabled=!0,Qo.forEach(({event:i,args:o})=>xi.emit(i,...o)),Qo=[]):typeof window<"u"&&window.HTMLElement&&!((r=(t=window.navigator)==null?void 0:t.userAgent)!=null&&r.includes("jsdom"))?((e.__VUE_DEVTOOLS_HOOK_REPLAY__=e.__VUE_DEVTOOLS_HOOK_REPLAY__||[]).push(o=>{im(o,e)}),setTimeout(()=>{xi||(e.__VUE_DEVTOOLS_HOOK_REPLAY__=null,Qo=[])},3e3)):Qo=[]}let ur=null,Ak=null;const Ik=n=>n.__isTeleport;function sm(n,e){n.shapeFlag&6&&n.component?(n.transition=e,sm(n.component.subTree,e)):n.shapeFlag&128?(n.ssContent.transition=e.clone(n.ssContent),n.ssFallback.transition=e.clone(n.ssFallback)):n.transition=e}Ho().requestIdleCallback,Ho().cancelIdleCallback;const Ok=Symbol.for("v-ndc"),Nk={};process.env.NODE_ENV!=="production"&&(Nk.ownKeys=n=>(ct("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)));let Rk=null;function Lk(n,e,t=!1){const r=na||ur;if(r||Rk){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&&Ye(e)?e.call(r&&r.proxy):e;process.env.NODE_ENV!=="production"&&ct(`injection "${String(n)}" not found.`)}else process.env.NODE_ENV!=="production"&&ct("inject() can only be used inside setup() or functional components.")}const Pk={},om=n=>Object.getPrototypeOf(n)===Pk,Dk=Wk,zk=Symbol.for("v-scx"),Bk=()=>{{const n=Lk(zk);return n||process.env.NODE_ENV!=="production"&&ct("Server rendering context not provided. Make sure to only call useSSRContext() conditionally in the server build."),n}};function Fk(n,e,t){return process.env.NODE_ENV!=="production"&&!Ye(e)&&ct("`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."),Hk(n,e,t)}function Hk(n,e,t=ms){const{immediate:r,deep:i,flush:o,once:l}=t;process.env.NODE_ENV!=="production"&&!e&&(r!==void 0&&ct('watch() "immediate" option is only respected when using the watch(source, callback, options?) signature.'),i!==void 0&&ct('watch() "deep" option is only respected when using the watch(source, callback, options?) signature.'),l!==void 0&&ct('watch() "once" option is only respected when using the watch(source, callback, options?) signature.'));const u=ir({},t);process.env.NODE_ENV!=="production"&&(u.onWarn=ct);const f=e&&r||!e&&o!=="post";let h;if(ra){if(o==="sync"){const w=Bk();h=w.__watcherHandles||(w.__watcherHandles=[])}else if(!f){const w=()=>{};return w.stop=gi,w.resume=gi,w.pause=gi,w}}const m=na;u.call=(w,S,M)=>Xp(w,m,S,M);let p=!1;o==="post"?u.scheduler=w=>{Dk(w,m&&m.suspense)}:o!=="sync"&&(p=!0,u.scheduler=(w,S)=>{S?w():Zp(w)}),u.augmentJob=w=>{e&&(w.flags|=4),p&&(w.flags|=2,m&&(w.id=m.uid,w.i=m))};const y=pk(n,e,u);return ra&&(h?h.push(y):f&&y()),y}const $k=n=>n.__isSuspense;function Wk(n,e){e&&e.pendingBranch?Oe(n)?e.effects.push(...n):e.effects.push(n):em(n)}const am=Symbol.for("v-fgt"),Uk=Symbol.for("v-txt"),Vk=Symbol.for("v-cmt");let ki=null;function Kk(n){return n?n.__v_isVNode===!0:!1}const Gk=(...n)=>um(...n),lm=({key:n})=>n??null,ea=({ref:n,ref_key:e,ref_for:t})=>(typeof n=="number"&&(n=""+n),n!=null?Nn(n)||ut(n)||Ye(n)?{i:ur,r:n,k:e,f:!!t}:n:null);function qk(n,e=null,t=null,r=0,i=null,o=n===am?0:1,l=!1,u=!1){const f={__v_isVNode:!0,__v_skip:!0,type:n,props:e,key:e&&lm(e),ref:e&&ea(e),scopeId:Ak,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:ur};return u?(rc(f,t),o&128&&n.normalize(f)):t&&(f.shapeFlag|=Nn(t)?8:16),process.env.NODE_ENV!=="production"&&f.key!==f.key&&ct("VNode created with invalid key (NaN). VNode type:",f.type),!l&&ki&&(f.patchFlag>0||o&6)&&f.patchFlag!==32&&ki.push(f),f}const Jk=process.env.NODE_ENV!=="production"?Gk:um;function um(n,e=null,t=null,r=0,i=null,o=!1){if((!n||n===Ok)&&(process.env.NODE_ENV!=="production"&&!n&&ct(`Invalid vnode type when creating vnode: ${n}.`),n=Vk),Kk(n)){const u=ta(n,e,!0);return t&&rc(u,t),!o&&ki&&(u.shapeFlag&6?ki[ki.indexOf(n)]=u:ki.push(u)),u.patchFlag=-2,u}if(dm(n)&&(n=n.__vccOpts),e){e=jk(e);let{class:u,style:f}=e;u&&!Nn(u)&&(e.class=Bu(u)),gt(f)&&(Go(f)&&!Oe(f)&&(f=ir({},f)),e.style=zu(f))}const l=Nn(n)?1:$k(n)?128:Ik(n)?64:gt(n)?4:Ye(n)?2:0;return process.env.NODE_ENV!=="production"&&l&4&&Go(n)&&(n=ce(n),ct("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)),qk(n,e,t,r,i,l,o,!0)}function jk(n){return n?Go(n)||om(n)?ir({},n):n:null}function ta(n,e,t=!1,r=!1){const{props:i,ref:o,patchFlag:l,children:u,transition:f}=n,h=e?Xk(i||{},e):i,m={__v_isVNode:!0,__v_skip:!0,type:n.type,props:h,key:h&&lm(h),ref:e&&e.ref?t&&o?Oe(o)?o.concat(ea(e)):[o,ea(e)]:ea(e):o,scopeId:n.scopeId,slotScopeIds:n.slotScopeIds,children:process.env.NODE_ENV!=="production"&&l===-1&&Oe(u)?u.map(cm):u,target:n.target,targetStart:n.targetStart,targetAnchor:n.targetAnchor,staticCount:n.staticCount,shapeFlag:n.shapeFlag,patchFlag:e&&n.type!==am?l===-1?16:l|16:l,dynamicProps:n.dynamicProps,dynamicChildren:n.dynamicChildren,appContext:n.appContext,dirs:n.dirs,transition:f,component:n.component,suspense:n.suspense,ssContent:n.ssContent&&ta(n.ssContent),ssFallback:n.ssFallback&&ta(n.ssFallback),el:n.el,anchor:n.anchor,ctx:n.ctx,ce:n.ce};return f&&r&&sm(m,f.clone(m)),m}function cm(n){const e=ta(n);return Oe(n.children)&&(e.children=n.children.map(cm)),e}function Yk(n=" ",e=0){return Jk(Uk,null,n,e)}function rc(n,e){let t=0;const{shapeFlag:r}=n;if(e==null)e=null;else if(Oe(e))t=16;else if(typeof e=="object")if(r&65){const i=e.default;i&&(i._c&&(i._d=!1),rc(n,i()),i._c&&(i._d=!0));return}else{t=32;const i=e._;!i&&!om(e)?e._ctx=ur:i===3&&ur&&(ur.slots._===1?e._=1:(e._=2,n.patchFlag|=1024))}else Ye(e)?(e={default:e,_ctx:ur},t=32):(e=String(e),r&64?(t=16,e=[Yk(e)]):t=8);n.children=e,n.shapeFlag|=t}function Xk(...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=Bu([e.class,r.class]));else if(i==="style")e.style=zu([e.style,r.style]);else if(Cx(i)){const o=e[i],l=r[i];l&&o!==l&&!(Oe(o)&&o.includes(l))&&(e[i]=o?[].concat(o,l):l)}else i!==""&&(e[i]=r[i])}return e}let na=null;const Zk=()=>na||ur;{const n=Ho(),e=(t,r)=>{let i;return(i=n[t])||(i=n[t]=[]),i.push(r),o=>{i.length>1?i.forEach(l=>l(o)):i[0](o)}};e("__VUE_INSTANCE_SETTERS__",t=>na=t),e("__VUE_SSR_SETTERS__",t=>ra=t)}let ra=!1;process.env.NODE_ENV;const Qk=/(?:^|[-_])(\w)/g,e_=n=>n.replace(Qk,e=>e.toUpperCase()).replace(/[-_]/g,"");function fm(n,e=!0){return Ye(n)?n.displayName||n.name:n.name||e&&n.__name}function hm(n,e,t=!1){let r=fm(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 l in o)if(o[l]===e)return l};r=i(n.components||n.parent.type.components)||i(n.appContext.components)}return r?e_(r):t?"App":"Anonymous"}function dm(n){return Ye(n)&&"__vccOpts"in n}const pe=(n,e)=>{const t=hk(n,e,ra);if(process.env.NODE_ENV!=="production"){const r=Zk();r&&r.appContext.config.warnRecursiveComputed&&(t._warnRecursive=!0)}return t};function t_(){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 gt(p)?p.__isVue?["div",n,"VueInstance"]:ut(p)?["div",{},["span",n,m(p)],"<",u("_value"in p?p._value:p),">"]:xs(p)?["div",{},["span",n,bt(p)?"ShallowReactive":"Reactive"],"<",u(p),`>${Pn(p)?" (readonly)":""}`]:Pn(p)?["div",{},["span",n,bt(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(l("props",ce(p.props))),p.setupState!==ms&&y.push(l("setup",p.setupState)),p.data!==ms&&y.push(l("data",ce(p.data)));const w=f(p,"computed");w&&y.push(l("computed",w));const S=f(p,"inject");return S&&y.push(l("injected",S)),y.push(["div",{},["span",{style:r.style+";opacity:0.66"},"$ (internal): "],["object",{object:p}]]),y}function l(p,y){return y=ir({},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(w=>["div",{},["span",r,w+": "],u(y[w],!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]:gt(p)?["object",{object:y?ce(p):p}]:["span",t,String(p)]}function f(p,y){const w=p.type;if(Ye(w))return;const S={};for(const M in p.ctx)h(w,M,y)&&(S[M]=p.ctx[M]);return S}function h(p,y,w){const S=p[w];if(Oe(S)&&S.includes(y)||gt(S)&&y in S||p.extends&&h(p.extends,y,w)||p.mixins&&p.mixins.some(M=>h(M,y,w)))return!0}function m(p){return bt(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 n_(){t_()}process.env.NODE_ENV!=="production"&&n_();function Xe(n){this.content=n}Xe.prototype={constructor:Xe,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 Xe(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 Xe(t)},addToStart:function(n,e){return new Xe([n,e].concat(this.remove(n).content))},addToEnd:function(n,e){var t=this.remove(n).content.slice();return t.push(n,e),new Xe(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 Xe(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=Xe.from(n),n.size?new Xe(n.content.concat(this.subtract(n).content)):this},append:function(n){return n=Xe.from(n),n.size?new Xe(this.subtract(n).content.concat(n.content)):this},subtract:function(n){var e=this;n=Xe.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}},Xe.from=function(n){if(n instanceof Xe)return n;var e=[];if(n)for(var t in n)e.push(t,n[t]);return new Xe(e)};function pm(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 l=0;i.text[l]==o.text[l];l++)t++;return t}if(i.content.size||o.content.size){let l=pm(i.content,o.content,t+1);if(l!=null)return l}t+=i.nodeSize}}function mm(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 l=n.child(--i),u=e.child(--o),f=l.nodeSize;if(l==u){t-=f,r-=f;continue}if(!l.sameMarkup(u))return{a:t,b:r};if(l.isText&&l.text!=u.text){let h=0,m=Math.min(l.text.length,u.text.length);for(;h<m&&l.text[l.text.length-h-1]==u.text[u.text.length-h-1];)h++,t--,r--;return{a:t,b:r}}if(l.content.size||u.content.size){let h=mm(l.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 l=0,u=0;u<t;l++){let f=this.content[l],h=u+f.nodeSize;if(h>e&&r(f,i+u,o||null,l)!==!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="",l=!0;return this.nodesBetween(e,t,(u,f)=>{u.isText?(o+=u.text.slice(Math.max(e,f)-f,t-f),l=!r):u.isLeaf?(i?o+=typeof i=="function"?i(u):i:u.type.spec.leafText&&(o+=u.type.spec.leafText(u)),l=!r):!l&&u.isBlock&&(o+=r,l=!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,l=0;l<t;o++){let u=this.content[o],f=l+u.nodeSize;f>e&&((l<e||f>t)&&(u.isText?u=u.cut(Math.max(0,e-l),Math.min(u.text.length,t-l)):u=u.cut(Math.max(0,e-l-1),Math.min(u.content.size,t-l-1))),r.push(u),i+=u.nodeSize),l=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 pm(this,e,t)}findDiffEnd(e,t=this.size,r=e.size){return mm(this,e,t,r)}findIndex(e,t=-1){if(e==0)return ia(0,e);if(e==this.size)return ia(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),l=i+o.nodeSize;if(l>=e)return l==e||t>0?ia(r+1,l):ia(r,i);i=l}}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 ic={index:0,offset:0};function ia(n,e){return ic.index=n,ic.offset=e,ic}function sa(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(!sa(n[r],e[r]))return!1}else{for(let r in n)if(!(r in e)||!sa(n[r],e[r]))return!1;for(let r in e)if(!(r in n))return!1}return!0}let ke=class Uf{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&&sa(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 Uf.none;if(e instanceof Uf)return[e];let t=e.slice();return t.sort((r,i)=>r.type.rank-i.type.rank),t}};ke.none=[];class oa 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=ym(this.content,e+this.openStart,t);return r&&new U(r,this.openStart,this.openEnd)}removeBetween(e,t){return new U(gm(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 gm(n,e,t){let{index:r,offset:i}=n.findIndex(e),o=n.maybeChild(r),{index:l,offset:u}=n.findIndex(t);if(i==e||o.isText){if(u!=t&&!n.child(l).isText)throw new RangeError("Removing non-flat range");return n.cut(0,e).append(n.cut(t))}if(r!=l)throw new RangeError("Removing non-flat range");return n.replaceChild(r,o.copy(gm(o.content,e-i-1,t-i-1)))}function ym(n,e,t,r){let{index:i,offset:o}=n.findIndex(e),l=n.maybeChild(i);if(o==e||l.isText)return n.cut(0,e).append(t).append(n.cut(e));let u=ym(l.content,e-o-1,t);return u&&n.replaceChild(i,l.copy(u))}function r_(n,e,t){if(t.openStart>n.depth)throw new oa("Inserted content deeper than insertion position");if(n.depth-t.openStart!=e.depth-t.openEnd)throw new oa("Inconsistent open depths");return bm(n,e,t,0)}function bm(n,e,t,r){let i=n.index(r),o=n.node(r);if(i==e.index(r)&&r<n.depth-t.openStart){let l=bm(n,e,t,r+1);return o.copy(o.content.replaceChild(i,l))}else if(t.content.size)if(!t.openStart&&!t.openEnd&&n.depth==r&&e.depth==r){let l=n.parent,u=l.content;return zr(l,u.cut(0,n.parentOffset).append(t.content).append(u.cut(e.parentOffset)))}else{let{start:l,end:u}=i_(t,n);return zr(o,wm(n,l,u,e,r))}else return zr(o,aa(n,e,r))}function vm(n,e){if(!e.type.compatibleContent(n.type))throw new oa("Cannot join "+e.type.name+" onto "+n.type.name)}function sc(n,e,t){let r=n.node(t);return vm(r,e.node(t)),r}function Dr(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 _s(n,e,t,r){let i=(e||n).node(t),o=0,l=e?e.index(t):i.childCount;n&&(o=n.index(t),n.depth>t?o++:n.textOffset&&(Dr(n.nodeAfter,r),o++));for(let u=o;u<l;u++)Dr(i.child(u),r);e&&e.depth==t&&e.textOffset&&Dr(e.nodeBefore,r)}function zr(n,e){return n.type.checkContent(e),n.copy(e)}function wm(n,e,t,r,i){let o=n.depth>i&&sc(n,e,i+1),l=r.depth>i&&sc(t,r,i+1),u=[];return _s(null,n,i,u),o&&l&&e.index(i)==t.index(i)?(vm(o,l),Dr(zr(o,wm(n,e,t,r,i+1)),u)):(o&&Dr(zr(o,aa(n,e,i+1)),u),_s(e,t,i,u),l&&Dr(zr(l,aa(t,r,i+1)),u)),_s(r,null,i,u),new L(u)}function aa(n,e,t){let r=[];if(_s(null,n,t,r),n.depth>t){let i=sc(n,e,t+1);Dr(zr(i,aa(n,e,t+1)),r)}return _s(e,null,t,r),new L(r)}function i_(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 Vs{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 ke.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 l=0;l<o.length;l++)o[l].type.spec.inclusive===!1&&(!i||!o[l].isInSet(i.marks))&&(o=o[l--].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 la(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 l=e;;){let{index:u,offset:f}=l.content.findIndex(o),h=o-f;if(r.push(l,u,i+f),!h||(l=l.child(u),l.isText))break;o=h-1,i+=f+1}return new Vs(t,r,o)}static resolveCached(e,t){for(let i=0;i<oc.length;i++){let o=oc[i];if(o.pos==t&&o.doc==e)return o}let r=oc[ac]=Vs.resolve(e,t);return ac=(ac+1)%s_,r}}let oc=[],ac=0,s_=12;class la{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 o_=Object.create(null);let Br=class Vf{constructor(e,t,r,i=ke.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&&sa(this.attrs,t||e.defaultAttrs||o_)&&ke.sameSet(this.marks,r||ke.none)}copy(e=null){return e==this.content?this:new Vf(this.type,this.attrs,e,this.marks)}mark(e){return e==this.marks?this:new Vf(this.type,this.attrs,this.content,e)}cut(e,t=this.content.size){return e==0&&t==this.content.size?this:this.copy(this.content.cut(e,t))}slice(e,t=this.content.size,r=!1){if(e==t)return U.empty;let i=this.resolve(e),o=this.resolve(t),l=r?0:i.sharedDepth(t),u=i.start(l),h=i.node(l).content.cut(i.pos-u,o.pos-u);return new U(h,i.depth-l,o.depth-l)}replace(e,t,r){return r_(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 Vs.resolveCached(this,e)}resolveNoCache(e){return Vs.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()+")"),Sm(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 l=this.contentMatchAt(e).matchFragment(r,i,o),u=l&&l.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),l=o&&o.matchFragment(this.content,t);return l?l.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=ke.none;for(let t=0;t<this.marks.length;t++)e=this.marks[t].addToSet(e);if(!ke.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)}};Br.prototype.text=void 0;class ul extends Br{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):Sm(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 ul(this.type,this.attrs,this.text,e)}withText(e){return e==this.text?this:new ul(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 Sm(n,e){for(let t=n.length-1;t>=0;t--)e=n[t].type.name+"("+e+")";return e}class Xr{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(e,t){let r=new a_(e,t);if(r.next==null)return Xr.empty;let i=xm(r);r.next&&r.err("Unexpected trailing text");let o=p_(d_(i));return m_(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(l,u){let f=l.matchFragment(e,r);if(f&&(!t||f.validEnd))return L.from(u.map(h=>h.createAndFill()));for(let h=0;h<l.next.length;h++){let{type:m,next:p}=l.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 l=[];for(let u=i;u.type;u=u.via)l.push(u.type);return l.reverse()}for(let l=0;l<o.next.length;l++){let{type:u,next:f}=o.next[l];!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 l=0;l<r.next.length;l++)o+=(l?", ":"")+r.next[l].type.name+"->"+e.indexOf(r.next[l].next);return o}).join(`
|
|
6
|
+
`)}}Xr.empty=new Xr(!0);class a_{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 xm(n){let e=[];do e.push(l_(n));while(n.eat("|"));return e.length==1?e[0]:{type:"choice",exprs:e}}function l_(n){let e=[];do e.push(u_(n));while(n.next&&n.next!=")"&&n.next!="|");return e.length==1?e[0]:{type:"seq",exprs:e}}function u_(n){let e=h_(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=c_(n,e);else break;return e}function km(n){/\D/.test(n.next)&&n.err("Expected number, got '"+n.next+"'");let e=Number(n.next);return n.pos++,e}function c_(n,e){let t=km(n),r=t;return n.eat(",")&&(n.next!="}"?r=km(n):r=-1),n.eat("}")||n.err("Unclosed braced range"),{type:"range",min:t,max:r,expr:e}}function f_(n,e){let t=n.nodeTypes,r=t[e];if(r)return[r];let i=[];for(let o in t){let l=t[o];l.groups.indexOf(e)>-1&&i.push(l)}return i.length==0&&n.err("No node type or group '"+e+"' found"),i}function h_(n){if(n.eat("(")){let e=xm(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=f_(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 d_(n){let e=[[]];return i(o(n,0),t()),e;function t(){return e.push([])-1}function r(l,u,f){let h={term:f,to:u};return e[l].push(h),h}function i(l,u){l.forEach(f=>f.to=u)}function o(l,u){if(l.type=="choice")return l.exprs.reduce((f,h)=>f.concat(o(h,u)),[]);if(l.type=="seq")for(let f=0;;f++){let h=o(l.exprs[f],u);if(f==l.exprs.length-1)return h;i(h,u=t())}else if(l.type=="star"){let f=t();return r(u,f),i(o(l.expr,f),f),[r(f)]}else if(l.type=="plus"){let f=t();return i(o(l.expr,u),f),i(o(l.expr,f),f),[r(f)]}else{if(l.type=="opt")return[r(u)].concat(o(l.expr,u));if(l.type=="range"){let f=u;for(let h=0;h<l.min;h++){let m=t();i(o(l.expr,f),m),f=m}if(l.max==-1)i(o(l.expr,f),f);else for(let h=l.min;h<l.max;h++){let m=t();r(f,m),i(o(l.expr,f),m),f=m}return[r(f)]}else{if(l.type=="name")return[r(u,void 0,l.value)];throw new Error("Unknown expr type")}}}}function _m(n,e){return e-n}function Em(n,e){let t=[];return r(e),t.sort(_m);function r(i){let o=n[i];if(o.length==1&&!o[0].term)return r(o[0].to);t.push(i);for(let l=0;l<o.length;l++){let{term:u,to:f}=o[l];!u&&t.indexOf(f)==-1&&r(f)}}}function p_(n){let e=Object.create(null);return t(Em(n,0));function t(r){let i=[];r.forEach(l=>{n[l].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]);Em(n,f).forEach(m=>{h||i.push([u,h=[]]),h.indexOf(m)==-1&&h.push(m)})})});let o=e[r.join(",")]=new Xr(r.indexOf(n.length-1)>-1);for(let l=0;l<i.length;l++){let u=i[l][1].sort(_m);o.next.push({type:i[l][0],next:e[u.join(",")]||t(u)})}return o}}function m_(n,e){for(let t=0,r=[n];t<r.length;t++){let i=r[t],o=!i.validEnd,l=[];for(let u=0;u<i.next.length;u++){let{type:f,next:h}=i.next[u];l.push(f.name),o&&!(f.isText||f.hasRequiredAttrs())&&(o=!1),r.indexOf(h)==-1&&r.push(h)}o&&e.err("Only non-generatable nodes ("+l.join(", ")+") in a required position (see https://prosemirror.net/docs/guide/#generatable)")}}function Mm(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 Tm(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 Cm(n){let e=Object.create(null);if(n)for(let t in n)e[t]=new g_(n[t]);return e}let Am=class $1{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=Cm(r.attrs),this.defaultAttrs=Mm(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==Xr.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:Tm(this.attrs,e)}create(e=null,t,r){if(this.isText)throw new Error("NodeType.create can't construct text nodes");return new Br(this,this.computeAttrs(e),L.from(t),ke.setFrom(r))}createChecked(e=null,t,r){return t=L.from(t),this.checkContent(t),new Br(this,this.computeAttrs(e),t,ke.setFrom(r))}createAndFill(e=null,t,r){if(e=this.computeAttrs(e),t=L.from(t),t.size){let l=this.contentMatch.fillBefore(t);if(!l)return null;t=l.append(t)}let i=this.contentMatch.matchFragment(t),o=i&&i.fillBefore(L.empty,!0);return o?new Br(this,e,t.append(o),ke.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:ke.none:e}static compile(e,t){let r=Object.create(null);e.forEach((o,l)=>r[o]=new $1(o,t,l));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 g_{constructor(e){this.hasDefault=Object.prototype.hasOwnProperty.call(e,"default"),this.default=e.default}get isRequired(){return!this.hasDefault}}class cl{constructor(e,t,r,i){this.name=e,this.rank=t,this.schema=r,this.spec=i,this.attrs=Cm(i.attrs),this.excluded=null;let o=Mm(this.attrs);this.instance=o?new ke(this,o):null}create(e=null){return!e&&this.instance?this.instance:new ke(this,Tm(this.attrs,e))}static compile(e,t){let r=Object.create(null),i=0;return e.forEach((o,l)=>r[o]=new cl(o,i++,t,l)),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 y_{constructor(e){this.cached=Object.create(null);let t=this.spec={};for(let i in e)t[i]=e[i];t.nodes=Xe.from(e.nodes),t.marks=Xe.from(e.marks||{}),this.nodes=Am.compile(this.spec.nodes,this),this.marks=cl.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],l=o.spec.content||"",u=o.spec.marks;o.contentMatch=r[l]||(r[l]=Xr.parse(l,this.nodes)),o.inlineContent=o.contentMatch.inlineContent,o.markSet=u=="_"?null:u?Im(this,u.split(" ")):u==""||!o.inlineContent?[]:null}for(let i in this.marks){let o=this.marks[i],l=o.spec.excludes;o.excluded=l==null?[o]:l==""?[]:Im(this,l.split(" "))}this.nodeFromJSON=this.nodeFromJSON.bind(this),this.markFromJSON=this.markFromJSON.bind(this),this.topNodeType=this.nodes[this.spec.topNode||"doc"],this.cached.wrappings=Object.create(null)}node(e,t=null,r,i){if(typeof e=="string")e=this.nodeType(e);else if(e instanceof Am){if(e.schema!=this)throw new RangeError("Node type from different schema used ("+e.name+")")}else throw new RangeError("Invalid node type: "+e);return e.createChecked(t,r,i)}text(e,t){let r=this.nodes.text;return new ul(r,r.defaultAttrs,e,ke.setFrom(t))}mark(e,t){return typeof e=="string"&&(e=this.marks[e]),e.create(t)}nodeFromJSON(e){return Br.fromJSON(this,e)}markFromJSON(e){return ke.fromJSON(this,e)}nodeType(e){let t=this.nodes[e];if(!t)throw new RangeError("Unknown node type: "+e);return t}}function Im(n,e){let t=[];for(let r=0;r<e.length;r++){let i=e[r],o=n.marks[i],l=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(l=f)}if(!l)throw new SyntaxError("Unknown mark type: '"+e[r]+"'")}return t}let lc=class Kf{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 Lm(this,t,!1);return r.addAll(e,t.from,t.to),r.finish()}parseSlice(e,t={}){let r=new Lm(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(w_(e,o.tag)&&(o.namespace===void 0||e.namespaceURI==o.namespace)&&(!o.context||t.matchesContext(o.context))){if(o.getAttrs){let l=o.getAttrs(e);if(l===!1)continue;o.attrs=l||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 l=this.styles[o],u=l.style;if(!(u.indexOf(e)!=0||l.context&&!r.matchesContext(l.context)||u.length>e.length&&(u.charCodeAt(e.length)!=61||u.slice(e.length+1)!=t))){if(l.getAttrs){let f=l.getAttrs(t);if(f===!1)continue;l.attrs=f||void 0}return l}}}static schemaRules(e){let t=[];function r(i){let o=i.priority==null?50:i.priority,l=0;for(;l<t.length;l++){let u=t[l];if((u.priority==null?50:u.priority)<o)break}t.splice(l,0,i)}for(let i in e.marks){let o=e.marks[i].spec.parseDOM;o&&o.forEach(l=>{r(l=Pm(l)),l.mark||l.ignore||l.clearMark||(l.mark=i)})}for(let i in e.nodes){let o=e.nodes[i].spec.parseDOM;o&&o.forEach(l=>{r(l=Pm(l)),l.node||l.ignore||l.mark||(l.node=i)})}return t}static fromSchema(e){return e.cached.domParser||(e.cached.domParser=new Kf(e,Kf.schemaRules(e)))}};const Om={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},b_={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},Nm={ol:!0,ul:!0},ua=1,ca=2,Es=4;function Rm(n,e,t){return e!=null?(e?ua:0)|(e==="full"?ca:0):n&&n.whitespace=="pre"?ua|ca:t&~Es}class fa{constructor(e,t,r,i,o,l,u){this.type=e,this.attrs=t,this.marks=r,this.pendingMarks=i,this.solid=o,this.options=u,this.content=[],this.activeMarks=ke.none,this.stashMarks=[],this.match=l||(u&Es?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&ua)){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):x_(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&&!Om.hasOwnProperty(e.parentNode.nodeName.toLowerCase())}}class Lm{constructor(e,t,r){this.parser=e,this.options=t,this.isOpen=r,this.open=0;let i=t.topNode,o,l=Rm(null,t.preserveWhitespace,0)|(r?Es:0);i?o=new fa(i.type,i.attrs,ke.none,ke.none,!0,t.topMatch||i.type.contentMatch,l):r?o=new fa(null,null,ke.none,ke.none,!0,null,l):o=new fa(e.schema.topNodeType,null,ke.none,ke.none,!0,null,l),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(S_(t));if(!r)return;let[i,o]=r,l=this.top;for(let u=0;u<o.length;u++)this.removePendingMark(o[u],l);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],l);for(let u=0;u<o.length;u++)this.addPendingMark(o[u])}}}addTextNode(e){let t=e.nodeValue,r=this.top;if(r.options&ca||r.inlineContext(e)||/[^ \t\r\n\u000c]/.test(t)){if(r.options&ua)r.options&ca?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;Nm.hasOwnProperty(r)&&this.parser.normalizeLists&&v_(e);let o=this.options.ruleFromNode&&this.options.ruleFromNode(e)||(i=this.parser.matchTag(e,this,t));if(o?o.ignore:b_.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 l,u=this.top,f=this.needsBlock;if(Om.hasOwnProperty(r))u.content.length&&u.content[0].isInline&&this.open&&(this.open--,u=this.top),l=!0,u.type||(this.needsBlock=!0);else if(!e.firstChild){this.leafFallback(e);return}this.addAll(e),l&&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=ke.none,r=ke.none;e:for(let i=0;i<e.length;i+=2)for(let o=void 0;;){let l=this.parser.matchStyle(e[i],e[i+1],this,o);if(!l)continue e;if(l.ignore)return null;if(l.clearMark?this.top.pendingMarks.forEach(u=>{l.clearMark(u)&&(r=u.addToSet(r))}):t=this.parser.schema.marks[l.mark].create(l.attrs).addToSet(t),l.consuming===!1)o=l;else break}return[t,r]}addElementByRule(e,t,r){let i,o,l;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)):(l=this.parser.schema.marks[t.mark].create(t.attrs),this.addPendingMark(l));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--,l&&this.removePendingMark(l,u)}addAll(e,t,r){let i=t||0;for(let o=t?e.childNodes[t]:e.firstChild,l=r==null?null:e.childNodes[r];o!=l;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],l=o.findWrapping(e);if(l&&(!t||t.length>l.length)&&(t=l,r=o,!l.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 l=Rm(e,i,o.options);o.options&Es&&o.content.length==0&&(l|=Es),this.nodes.push(new fa(e,t,o.activeMarks,o.pendingMarks,r,null,l)),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),l=(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(l(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 l(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=k_(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 l=i.popFromStashMark(e);l&&i.type&&i.type.allowsMarkType(l.type)&&(i.activeMarks=l.addToSet(i.activeMarks))}if(i==t)break}}}function v_(n){for(let e=n.firstChild,t=null;e;e=e.nextSibling){let r=e.nodeType==1?e.nodeName.toLowerCase():null;r&&Nm.hasOwnProperty(r)&&t?(t.appendChild(e),e=t):r=="li"?t=e:r&&(t=null)}}function w_(n,e){return(n.matches||n.msMatchesSelector||n.webkitMatchesSelector||n.mozMatchesSelector).call(n,e)}function S_(n){let e=/\s*([\w-]+)\s*:\s*([^;]+)/g,t,r=[];for(;t=e.exec(n);)r.push(t[1],t[2].trim());return r}function Pm(n){let e={};for(let t in n)e[t]=n[t];return e}function x_(n,e){let t=e.schema.nodes;for(let r in t){let i=t[r];if(!i.allowsMarkType(n))continue;let o=[],l=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&&l(m))return!0}};if(l(i.contentMatch))return!0}}function k_(n,e){for(let t=0;t<e.length;t++)if(n.eq(e[t]))return e[t]}class Qr{constructor(e,t){this.nodes=e,this.marks=t}serializeFragment(e,t={},r){r||(r=uc(t).createDocumentFragment());let i=r,o=[];return e.forEach(l=>{if(o.length||l.marks.length){let u=0,f=0;for(;u<o.length&&f<l.marks.length;){let h=l.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<l.marks.length;){let h=l.marks[f++],m=this.serializeMark(h,l.isInline,t);m&&(o.push([h,i]),i.appendChild(m.dom),i=m.contentDOM||m.dom)}}i.appendChild(this.serializeNodeInner(l,t))}),r}serializeNodeInner(e,t){let{dom:r,contentDOM:i}=Qr.renderSpec(uc(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&&Qr.renderSpec(uc(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 l,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:w}=Qr.renderSpec(e,p,r);if(u.appendChild(y),w){if(l)throw new RangeError("Multiple content holes");l=w}}}return{dom:u,contentDOM:l}}static fromSchema(e){return e.cached.domSerializer||(e.cached.domSerializer=new Qr(this.nodesFromSchema(e),this.marksFromSchema(e)))}static nodesFromSchema(e){let t=Dm(e.nodes);return t.text||(t.text=r=>r.text),t}static marksFromSchema(e){return Dm(e.marks)}}function Dm(n){let e={};for(let t in n){let r=n[t].spec.toDOM;r&&(e[t]=r)}return e}function uc(n){return n.document||window.document}const zm=65535,Bm=Math.pow(2,16);function __(n,e){return n+e*Bm}function Fm(n){return n&zm}function E_(n){return(n-(n&zm))/Bm}const Hm=1,$m=2,ha=4,Wm=8;class cc{constructor(e,t,r){this.pos=e,this.delInfo=t,this.recover=r}get deleted(){return(this.delInfo&Wm)>0}get deletedBefore(){return(this.delInfo&(Hm|ha))>0}get deletedAfter(){return(this.delInfo&($m|ha))>0}get deletedAcross(){return(this.delInfo&ha)>0}}class Kt{constructor(e,t=!1){if(this.ranges=e,this.inverted=t,!e.length&&Kt.empty)return Kt.empty}recover(e){let t=0,r=Fm(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+E_(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,l=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+l],p=f+h;if(e<=p){let y=h?e==f?-1:e==p?1:t:t,w=f+i+(y<0?0:m);if(r)return w;let S=e==(t<0?f:p)?null:__(u/3,e-f),M=e==f?$m:e==p?Hm:ha;return(t<0?e!=f:e!=p)&&(M|=Wm),new cc(w,M,S)}i+=m-h}return r?e+i:new cc(e+i,0,null)}touches(e,t){let r=0,i=Fm(t),o=this.inverted?2:1,l=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+l]-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 l=this.ranges[i],u=l-(this.inverted?o:0),f=l+(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 Kt(this.ranges,!this.inverted)}toString(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)}static offset(e){return e==0?Kt.empty:new Kt(e<0?[0,-e,0]:[0,0,e])}}Kt.empty=new Kt([]);class Ui{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 Ui(this.maps,this.mirror,e,t)}copy(){return new Ui(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 Ui;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 l=this.maps[o],u=l.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 cc(e,i,null)}}const fc=Object.create(null);class rt{getMap(){return Kt.empty}merge(e){return null}static fromJSON(e,t){if(!t||!t.stepType)throw new RangeError("Invalid input for Step.fromJSON");let r=fc[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 fc)throw new RangeError("Duplicate use of step JSON ID "+e);return fc[e]=t,t.prototype.jsonID=e,t}}class Re{constructor(e,t){this.doc=e,this.failed=t}static ok(e){return new Re(e,null)}static fail(e){return new Re(null,e)}static fromReplace(e,t,r,i){try{return Re.ok(e.replace(t,r,i))}catch(o){if(o instanceof oa)return Re.fail(o.message);throw o}}}function hc(n,e,t){let r=[];for(let i=0;i<n.childCount;i++){let o=n.child(i);o.content.size&&(o=o.copy(hc(o.content,e,o))),o.isInline&&(o=e(o,t,i)),r.push(o)}return L.fromArray(r)}class xr extends rt{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(hc(t.content,(l,u)=>!l.isAtom||!u.type.allowsMarkType(this.mark.type)?l:l.mark(this.mark.addToSet(l.marks)),i),t.openStart,t.openEnd);return Re.fromReplace(e,this.from,this.to,o)}invert(){return new vn(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 xr(t.pos,r.pos,this.mark)}merge(e){return e instanceof xr&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new xr(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 xr(t.from,t.to,e.markFromJSON(t.mark))}}rt.jsonID("addMark",xr);class vn extends rt{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(hc(t.content,i=>i.mark(this.mark.removeFromSet(i.marks)),e),t.openStart,t.openEnd);return Re.fromReplace(e,this.from,this.to,r)}invert(){return new xr(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 vn(t.pos,r.pos,this.mark)}merge(e){return e instanceof vn&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new vn(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 vn(t.from,t.to,e.markFromJSON(t.mark))}}rt.jsonID("removeMark",vn);class kr extends rt{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return Re.fail("No node at mark step's position");let r=t.type.create(t.attrs,null,this.mark.addToSet(t.marks));return Re.fromReplace(e,this.pos,this.pos+1,new 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 Vi(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))}}rt.jsonID("addNodeMark",kr);class Vi extends rt{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return Re.fail("No node at mark step's position");let r=t.type.create(t.attrs,null,this.mark.removeFromSet(t.marks));return Re.fromReplace(e,this.pos,this.pos+1,new 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 Vi(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 Vi(t.pos,e.markFromJSON(t.mark))}}rt.jsonID("removeNodeMark",Vi);class it extends rt{constructor(e,t,r,i=!1){super(),this.from=e,this.to=t,this.slice=r,this.structure=i}apply(e){return this.structure&&dc(e,this.from,this.to)?Re.fail("Structure replace would overwrite content"):Re.fromReplace(e,this.from,this.to,this.slice)}getMap(){return new Kt([this.from,this.to-this.from,this.slice.size])}invert(e){return new it(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 it(t.pos,Math.max(t.pos,r.pos),this.slice)}merge(e){if(!(e instanceof it)||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 it(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 it(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 it(t.from,t.to,U.fromJSON(e,t.slice),!!t.structure)}}rt.jsonID("replace",it);class Ge extends rt{constructor(e,t,r,i,o,l,u=!1){super(),this.from=e,this.to=t,this.gapFrom=r,this.gapTo=i,this.slice=o,this.insert=l,this.structure=u}apply(e){if(this.structure&&(dc(e,this.from,this.gapFrom)||dc(e,this.gapTo,this.to)))return Re.fail("Structure gap-replace would overwrite content");let t=e.slice(this.gapFrom,this.gapTo);if(t.openStart||t.openEnd)return Re.fail("Gap is not a flat range");let r=this.slice.insertAt(this.insert,t.content);return r?Re.fromReplace(e,this.from,this.to,r):Re.fail("Content does not fit in gap")}getMap(){return new Kt([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 Ge(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 Ge(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 Ge(t.from,t.to,t.gapFrom,t.gapTo,U.fromJSON(e,t.slice),t.insert,!!t.structure)}}rt.jsonID("replaceAround",Ge);function dc(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 l=r.node(o).maybeChild(r.indexAfter(o));for(;i>0;){if(!l||l.isLeaf)return!0;l=l.firstChild,i--}}return!1}function M_(n,e,t,r){let i=[],o=[],l,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),w=Math.min(h+f.nodeSize,t),S=r.addToSet(p);for(let M=0;M<p.length;M++)p[M].isInSet(S)||(l&&l.to==y&&l.mark.eq(p[M])?l.to=w:i.push(l=new vn(y,w,p[M])));u&&u.to==y?u.to=w:o.push(u=new xr(y,w,r))}}),i.forEach(f=>n.step(f)),o.forEach(f=>n.step(f))}function T_(n,e,t,r){let i=[],o=0;n.doc.nodesBetween(e,t,(l,u)=>{if(!l.isInline)return;o++;let f=null;if(r instanceof cl){let h=l.marks,m;for(;m=r.isInSet(h);)(f||(f=[])).push(m),h=m.removeFromSet(h)}else r?r.isInSet(l.marks)&&(f=[r]):f=l.marks;if(f&&f.length){let h=Math.min(u+l.nodeSize,t);for(let m=0;m<f.length;m++){let p=f[m],y;for(let w=0;w<i.length;w++){let S=i[w];S.step==o-1&&p.eq(i[w].style)&&(y=S)}y?(y.to=h,y.step=o):i.push({style:p,from:Math.max(u,e),to:h,step:o})}}}),i.forEach(l=>n.step(new vn(l.from,l.to,l.style)))}function C_(n,e,t,r=t.contentMatch){let i=n.doc.nodeAt(e),o=[],l=e+1;for(let u=0;u<i.childCount;u++){let f=i.child(u),h=l+f.nodeSize,m=r.matchType(f.type);if(!m)o.push(new it(l,h,U.empty));else{r=m;for(let p=0;p<f.marks.length;p++)t.allowsMarkType(f.marks[p].type)||n.step(new vn(l,h,f.marks[p]))}l=h}if(!r.validEnd){let u=r.fillBefore(L.empty,!0);n.replace(l,l,new U(u,0,0))}for(let u=o.length-1;u>=0;u--)n.step(o[u])}function A_(n,e,t){return(e==0||n.canReplace(e,n.childCount))&&(t==n.childCount||n.canReplace(0,t))}function _i(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),l=n.$to.indexAfter(r);if(r<n.depth&&i.canReplace(o,l,t))return r;if(r==0||i.type.spec.isolating||!A_(i,o,l))break}return null}function I_(n,e,t){let{$from:r,$to:i,depth:o}=e,l=r.before(o+1),u=i.after(o+1),f=l,h=u,m=L.empty,p=0;for(let S=o,M=!1;S>t;S--)M||r.index(S)>0?(M=!0,m=L.from(r.node(S).copy(m)),p++):f--;let y=L.empty,w=0;for(let S=o,M=!1;S>t;S--)M||i.after(S+1)<i.end(S)?(M=!0,y=L.from(i.node(S).copy(y)),w++):h++;n.step(new Ge(f,h,l,u,new U(m.append(y),p,w),m.size-p,!0))}function pc(n,e,t=null,r=n){let i=O_(n,e),o=i&&N_(r,e);return o?i.map(Um).concat({type:e,attrs:t}).concat(o.map(Um)):null}function Um(n){return{type:n,attrs:null}}function O_(n,e){let{parent:t,startIndex:r,endIndex:i}=n,o=t.contentMatchAt(r).findWrapping(e);if(!o)return null;let l=o.length?o[0]:e;return t.canReplaceWith(r,i,l)?o:null}function N_(n,e){let{parent:t,startIndex:r,endIndex:i}=n,o=t.child(r),l=e.contentMatch.findWrapping(o.type);if(!l)return null;let f=(l.length?l[l.length-1]:e).contentMatch;for(let h=r;f&&h<i;h++)f=f.matchType(t.child(h).type);return!f||!f.validEnd?null:l}function R_(n,e,t){let r=L.empty;for(let l=t.length-1;l>=0;l--){if(r.size){let u=t[l].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[l].type.create(t[l].attrs,r))}let i=e.start,o=e.end;n.step(new Ge(i,o,i,o,new U(r,0,0),t.length,!0))}function L_(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,(l,u)=>{if(l.isTextblock&&!l.hasMarkup(r,i)&&P_(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+l.nodeSize,1);return n.step(new Ge(h,m,h+1,m-1,new U(L.from(r.create(i,null,l.marks)),0,0),1,!0)),!1}})}function P_(n,e,t){let r=n.resolve(e),i=r.index();return r.parent.canReplaceWith(i,i+1,t)}function D_(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 l=t.create(r,null,i||o.marks);if(o.isLeaf)return n.replaceWith(e,e+o.nodeSize,l);if(!t.validContent(o.content))throw new RangeError("Invalid content for node type "+t.name);n.step(new Ge(e,e+o.nodeSize,e+1,e+o.nodeSize-1,new U(L.from(l),0,0),1,!0))}function zn(n,e,t=1,r){let i=n.resolve(e),o=i.depth-t,l=r&&r[r.length-1]||i.parent;if(o<0||i.parent.type.spec.isolating||!i.parent.canReplace(i.index(),i.parent.childCount)||!l.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 w=p.content.cutByIndex(y,p.childCount),S=r&&r[m]||p;if(S!=p&&(w=w.replaceChild(0,S.type.create(S.attrs))),!p.canReplace(y+1,p.childCount)||!S.type.validContent(w))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 z_(n,e,t=1,r){let i=n.doc.resolve(e),o=L.empty,l=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];l=L.from(m?m.type.create(m.attrs,l):i.node(u).copy(l))}n.step(new it(e,e,new U(o.append(l),t,t),!0))}function cr(n,e){let t=n.resolve(e),r=t.index();return Vm(t.nodeBefore,t.nodeAfter)&&t.parent.canReplace(r,r+1)}function Vm(n,e){return!!(n&&e&&!n.isLeaf&&n.canAppend(e))}function da(n,e,t=-1){let r=n.resolve(e);for(let i=r.depth;;i--){let o,l,u=r.index(i);if(i==r.depth?(o=r.nodeBefore,l=r.nodeAfter):t>0?(o=r.node(i+1),u++,l=r.node(i).maybeChild(u)):(o=r.node(i).maybeChild(u-1),l=r.node(i+1)),o&&!o.isTextblock&&Vm(o,l)&&r.node(i).canReplace(u,u+1))return e;if(i==0)break;e=t<0?r.before(i):r.after(i)}}function B_(n,e,t){let r=new it(e-t,e+t,U.empty,!0);n.step(r)}function F_(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 H_(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 l=r.depth;l>=0;l--){let u=l==r.depth?0:r.pos<=(r.start(l+1)+r.end(l+1))/2?-1:1,f=r.index(l)+(u>0?1:0),h=r.node(l),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(l+1):r.after(l+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 Km(i,o,r)?new it(e,t,r):new $_(i,o,r).fit()}function Km(n,e,t){return!t.openStart&&!t.openEnd&&n.start()==e.start()&&n.parent.canReplace(n.index(),e.index(),t.content)}class $_{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,l=r.depth,u=i.depth;for(;l&&u&&o.childCount==1;)o=o.firstChild.content,l--,u--;let f=new U(o,l,u);return e>-1?new Ge(r.pos,e,this.$to.pos,this.$to.end(),f,t):f.size||r.pos!=this.$to.pos?new it(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=gc(this.unplaced.content,t-1).firstChild,r=i.content):r=this.unplaced.content;let o=r.firstChild;for(let l=this.depth;l>=0;l--){let{type:u,match:f}=this.frontier[l],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:l,parent:i,inject:m};if(e==2&&o&&(h=f.findWrapping(o.type)))return{sliceDepth:t,frontierDepth:l,parent:i,wrap:h};if(i&&f.matchType(i.type))break}}}openMore(){let{content:e,openStart:t,openEnd:r}=this.unplaced,i=gc(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=gc(e,t);if(i.childCount<=1&&t>0){let o=e.size-t<=t+i.size;this.unplaced=new U(Ms(e,t-1,1),t-1,o?t-1:r)}else this.unplaced=new U(Ms(e,t,1),t,r)}placeNodes({sliceDepth:e,frontierDepth:t,parent:r,inject:i,wrap:o}){for(;this.depth>t;)this.closeFrontierNode();if(o)for(let M=0;M<o.length;M++)this.openFrontierNode(o[M]);let l=this.unplaced,u=r?r.content:l.content,f=l.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 w=u.size+e-(l.content.size-l.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(Gm(M.mark(y.allowedMarks(M.marks)),h==1?f:0,h==u.childCount?w:-1)))}let S=h==u.childCount;S||(w=-1),this.placed=Ts(this.placed,t,L.from(m)),this.frontier[t].match=p,S&&w<0&&r&&r.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let M=0,T=u;M<w;M++){let I=T.lastChild;this.frontier.push({type:I.type,match:I.contentMatchAt(I.childCount)}),T=I.content}this.unplaced=S?e==0?U.empty:new U(Ms(l.content,e-1,1),e-1,w<0?l.openEnd:e-1):new U(Ms(l.content,e,h),l.openStart,l.openEnd)}mustMoveInline(){if(!this.$to.parent.isTextblock)return-1;let e=this.frontier[this.depth],t;if(!e.type.isTextblock||!yc(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)),l=yc(e,t,i,r,o);if(l){for(let u=t-1;u>=0;u--){let{match:f,type:h}=this.frontier[u],m=yc(e,u,h,f,!0);if(!m||m.childCount)continue e}return{depth:t,fit:l,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=Ts(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=Ts(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=Ts(this.placed,this.frontier.length,t))}}function Ms(n,e,t){return e==0?n.cutByIndex(t,n.childCount):n.replaceChild(0,n.firstChild.copy(Ms(n.firstChild.content,e-1,t)))}function Ts(n,e,t){return e==0?n.append(t):n.replaceChild(n.childCount-1,n.lastChild.copy(Ts(n.lastChild.content,e-1,t)))}function gc(n,e){for(let t=0;t<e;t++)n=n.firstChild.content;return n}function Gm(n,e,t){if(e<=0)return n;let r=n.content;return e>1&&(r=r.replaceChild(0,Gm(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 yc(n,e,t,r,i){let o=n.node(e),l=i?n.indexAfter(e):n.index(e);if(l==o.childCount&&!t.compatibleContent(o.type))return null;let u=r.fillBefore(o.content,!0,l);return u&&!W_(t,o.content,l)?u:null}function W_(n,e,t){for(let r=t;r<e.childCount;r++)if(!n.allowsMarks(e.child(r).marks))return!0;return!1}function U_(n){return n.spec.defining||n.spec.definingForContent}function V_(n,e,t,r){if(!r.size)return n.deleteRange(e,t);let i=n.doc.resolve(e),o=n.doc.resolve(t);if(Km(i,o,r))return n.step(new it(e,t,r));let l=Jm(i,n.doc.resolve(t));l[l.length-1]==0&&l.pop();let u=-(i.depth+1);l.unshift(u);for(let y=i.depth,w=i.pos-1;y>0;y--,w--){let S=i.node(y).type.spec;if(S.defining||S.definingAsContext||S.isolating)break;l.indexOf(y)>-1?u=y:i.before(y)==w&&l.splice(1,0,-y)}let f=l.indexOf(u),h=[],m=r.openStart;for(let y=r.content,w=0;;w++){let S=y.firstChild;if(h.push(S),w==r.openStart)break;y=S.content}for(let y=m-1;y>=0;y--){let w=h[y].type,S=U_(w);if(S&&i.node(f).type!=w)m=y;else if(S||!w.isTextblock)break}for(let y=r.openStart;y>=0;y--){let w=(y+m+1)%(r.openStart+1),S=h[w];if(S)for(let M=0;M<l.length;M++){let T=l[(M+f)%l.length],I=!0;T<0&&(I=!1,T=-T);let F=i.node(T-1),B=i.index(T-1);if(F.canReplaceWith(B,B,S.type,S.marks))return n.replace(i.before(T),I?o.after(T):t,new U(qm(r.content,0,r.openStart,w),w,r.openEnd))}}let p=n.steps.length;for(let y=l.length-1;y>=0&&(n.replace(e,t,r),!(n.steps.length>p));y--){let w=l[y];w<0||(e=i.before(w),t=o.after(w))}}function qm(n,e,t,r,i){if(e<t){let o=n.firstChild;n=n.replaceChild(0,o.copy(qm(o.content,e+1,t,r,o)))}if(e>r){let o=i.contentMatchAt(0),l=o.fillBefore(n).append(n);n=l.append(o.matchFragment(l).fillBefore(L.empty,!0))}return n}function K_(n,e,t,r){if(!r.isInline&&e==t&&n.doc.resolve(e).parent.content.size){let i=F_(n.doc,e,r.type);i!=null&&(e=t=i)}n.replaceRange(e,t,new U(L.from(r),0,0))}function G_(n,e,t){let r=n.doc.resolve(e),i=n.doc.resolve(t),o=Jm(r,i);for(let l=0;l<o.length;l++){let u=o[l],f=l==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 l=1;l<=r.depth&&l<=i.depth;l++)if(e-r.start(l)==r.depth-l&&t>r.end(l)&&i.end(l)-t!=i.depth-l)return n.delete(r.before(l),t);n.delete(e,t)}function Jm(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 Ki extends rt{constructor(e,t,r){super(),this.pos=e,this.attr=t,this.value=r}apply(e){let t=e.nodeAt(this.pos);if(!t)return Re.fail("No node at attribute step's position");let r=Object.create(null);for(let o in t.attrs)r[o]=t.attrs[o];r[this.attr]=this.value;let i=t.type.create(r,null,t.marks);return Re.fromReplace(e,this.pos,this.pos+1,new U(L.from(i),0,t.isLeaf?0:1))}getMap(){return Kt.empty}invert(e){return new Ki(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 Ki(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 Ki(t.pos,t.attr,t.value)}}rt.jsonID("attr",Ki);let Ei=class extends Error{};Ei=function n(e){let t=Error.call(this,e);return t.__proto__=n.prototype,t},Ei.prototype=Object.create(Error.prototype),Ei.prototype.constructor=Ei,Ei.prototype.name="TransformError";class q_{constructor(e){this.doc=e,this.steps=[],this.docs=[],this.mapping=new Ui}get before(){return this.docs.length?this.docs[0]:this.doc}step(e){let t=this.maybeStep(e);if(t.failed)throw new Ei(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 V_(this,e,t,r),this}replaceRangeWith(e,t,r){return K_(this,e,t,r),this}deleteRange(e,t){return G_(this,e,t),this}lift(e,t){return I_(this,e,t),this}join(e,t=1){return B_(this,e,t),this}wrap(e,t){return R_(this,e,t),this}setBlockType(e,t=e,r,i=null){return L_(this,e,t,r,i),this}setNodeMarkup(e,t,r=null,i=[]){return D_(this,e,t,r,i),this}setNodeAttribute(e,t,r){return this.step(new Ki(e,t,r)),this}addNodeMark(e,t){return this.step(new kr(e,t)),this}removeNodeMark(e,t){if(!(t instanceof ke)){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 Vi(e,t)),this}split(e,t=1,r){return z_(this,e,t,r),this}addMark(e,t,r){return M_(this,e,t,r),this}removeMark(e,t,r){return T_(this,e,t,r),this}clearIncompatible(e,t,r){return C_(this,e,t,r),this}}const bc=Object.create(null);class me{constructor(e,t,r){this.$anchor=e,this.$head=t,this.ranges=r||[new J_(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,l=this.ranges;for(let u=0;u<l.length;u++){let{$from:f,$to:h}=l[u],m=e.mapping.slice(o);e.replaceRange(m.map(f.pos),m.map(h.pos),u?U.empty:t),u==0&&Xm(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:l,$to:u}=i[o],f=e.mapping.slice(r),h=f.map(l.pos),m=f.map(u.pos);o?e.deleteRange(h,m):(e.replaceRangeWith(h,m,t),Xm(e,r,t.isInline?-1:1))}}static findFrom(e,t,r=!1){let i=e.parent.inlineContent?new de(e):Mi(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 l=t<0?Mi(e.node(0),e.node(o),e.before(o+1),e.index(o),t,r):Mi(e.node(0),e.node(o),e.after(o+1),e.index(o)+1,t,r);if(l)return l}return null}static near(e,t=1){return this.findFrom(e,t)||this.findFrom(e,-t)||new Vt(e.node(0))}static atStart(e){return Mi(e,e,0,0,1)||new Vt(e)}static atEnd(e){return Mi(e,e,e.content.size,e.childCount,-1)||new Vt(e)}static fromJSON(e,t){if(!t||!t.type)throw new RangeError("Invalid input for Selection.fromJSON");let r=bc[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 bc)throw new RangeError("Duplicate use of selection JSON ID "+e);return bc[e]=t,t.prototype.jsonID=e,t}getBookmark(){return de.between(this.$anchor,this.$head).getBookmark()}}me.prototype.visible=!0;class J_{constructor(e,t){this.$from=e,this.$to=t}}let jm=!1;function Ym(n){!jm&&!n.parent.inlineContent&&(jm=!0,console.warn("TextSelection endpoint not pointing into a node with inline content ("+n.parent.type.name+")"))}class de extends me{constructor(e,t=e){Ym(e),Ym(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 me.near(r);let i=e.resolve(t.map(this.anchor));return new de(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 de&&e.anchor==this.anchor&&e.head==this.head}getBookmark(){return new fl(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 de(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=me.findFrom(t,r,!0)||me.findFrom(t,-r,!0);if(o)t=o.$head;else return me.near(t,r)}return e.parent.inlineContent||(i==0?e=t:(e=(me.findFrom(e,-r,!0)||me.findFrom(e,r,!0)).$anchor,e.pos<t.pos!=i<0&&(e=t))),new de(e,t)}}me.jsonID("text",de);class fl{constructor(e,t){this.anchor=e,this.head=t}map(e){return new fl(e.map(this.anchor),e.map(this.head))}resolve(e){return de.between(e.resolve(this.anchor),e.resolve(this.head))}}class Z extends me{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?me.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 Gf(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,me.jsonID("node",Z);class Gf{constructor(e){this.anchor=e}map(e){let{deleted:t,pos:r}=e.mapResult(this.anchor);return t?new fl(r,r):new Gf(r)}resolve(e){let t=e.resolve(this.anchor),r=t.nodeAfter;return r&&Z.isSelectable(r)?new Z(t):me.near(t)}}class Vt extends me{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=me.atStart(e.doc);r.eq(e.selection)||e.setSelection(r)}else super.replace(e,t)}toJSON(){return{type:"all"}}static fromJSON(e){return new Vt(e)}map(e){return new Vt(e)}eq(e){return e instanceof Vt}getBookmark(){return j_}}me.jsonID("all",Vt);const j_={map(){return this},resolve(n){return new Vt(n)}};function Mi(n,e,t,r,i,o=!1){if(e.inlineContent)return de.create(n,t);for(let l=r-(i>0?0:1);i>0?l<e.childCount:l>=0;l+=i){let u=e.child(l);if(u.isAtom){if(!o&&Z.isSelectable(u))return Z.create(n,t-(i<0?u.nodeSize:0))}else{let f=Mi(n,u,t+i,i<0?u.childCount:0,i,o);if(f)return f}t+=u.nodeSize*i}return null}function Xm(n,e,t){let r=n.steps.length-1;if(r<e)return;let i=n.steps[r];if(!(i instanceof it||i instanceof Ge))return;let o=n.mapping.maps[r],l;o.forEach((u,f,h,m)=>{l==null&&(l=m)}),n.setSelection(me.near(n.doc.resolve(l),t))}function Zm(n,e){return!e||!n?n:n.bind(e)}class pa{constructor(e,t,r){this.name=e,this.init=Zm(t.init,r),this.apply=Zm(t.apply,r)}}new pa("doc",{init(n){return n.doc||n.schema.topNodeType.createAndFill()},apply(n){return n.doc}}),new pa("selection",{init(n,e){return n.selection||me.atStart(e.doc)},apply(n){return n.selection}}),new pa("storedMarks",{init(n){return n.storedMarks||null},apply(n,e,t,r){return r.selection.$cursor?n.storedMarks:null}}),new pa("scrollToSelection",{init(){return 0},apply(n,e){return n.scrolledIntoView?e+1:e}});function Qm(n,e,t){for(let r in n){let i=n[r];i instanceof Function?i=i.bind(e):r=="handleDOMEvents"&&(i=Qm(i,e,{})),t[r]=i}return t}class Mt{constructor(e){this.spec=e,this.props={},e.props&&Qm(e.props,this,this.props),this.key=e.key?e.key.key:eg("plugin")}getState(e){return e[this.key]}}const vc=Object.create(null);function eg(n){return n in vc?n+"$"+ ++vc[n]:(vc[n]=0,n+"$")}class rn{constructor(e="key"){this.key=eg(e)}get(e){return e.config.pluginsByKey[this.key]}getState(e){return e[this.key]}}const Cs=function(n){for(var e=0;;e++)if(n=n.previousSibling,!n)return e},tg=function(n,e,t,r){return t&&(ng(n,e,t,r,-1)||ng(n,e,t,r,1))},Y_=/^(img|br|input|textarea|hr)$/i;function ng(n,e,t,r,i){for(;;){if(n==t&&e==r)return!0;if(e==(i<0?0:ma(n))){let o=n.parentNode;if(!o||o.nodeType!=1||Z_(n)||Y_.test(n.nodeName)||n.contentEditable=="false")return!1;e=Cs(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?ma(n):0}else return!1}}function ma(n){return n.nodeType==3?n.nodeValue.length:n.childNodes.length}function X_(n,e,t){for(let r=e==0,i=e==ma(n);r||i;){if(n==t)return!0;let o=Cs(n);if(n=n.parentNode,!n)return!1;r=r&&o==0,i=i&&o==ma(n)}}function Z_(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 rg=function(n){return n.focusNode&&tg(n.focusNode,n.focusOffset,n.anchorNode,n.anchorOffset)};function ig(n,e){let t=document.createEvent("Event");return t.initEvent("keydown",!0,!0),t.keyCode=n,t.key=t.code=e,t}const fr=typeof navigator<"u"?navigator:null,sg=typeof document<"u"?document:null,hr=fr&&fr.userAgent||"",wc=/Edge\/(\d+)/.exec(hr),og=/MSIE \d/.exec(hr),Sc=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(hr),As=!!(og||Sc||wc),ag=og?document.documentMode:Sc?+Sc[1]:wc?+wc[1]:0,ga=!As&&/gecko\/(\d+)/i.test(hr);ga&&+(/Firefox\/(\d+)/.exec(hr)||[0,0])[1];const xc=!As&&/Chrome\/(\d+)/.exec(hr),Ti=!!xc,Q_=xc?+xc[1]:0,Fr=!As&&!!fr&&/Apple Computer/.test(fr.vendor),kc=Fr&&(/Mobile\/\w+/.test(hr)||!!fr&&fr.maxTouchPoints>2),Ht=kc||(fr?/Mac/.test(fr.platform):!1),Is=/Android \d/.test(hr),_c=!!sg&&"webkitFontSmoothing"in sg.documentElement.style,eE=_c?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function tE(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,l=n.docView.posFromDOM(t.focusNode,t.focusOffset,1);if(l<0)return null;let u=r.resolve(l),f,h;if(rg(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&&X_(t.focusNode,t.focusOffset,i.dom))){let p=i.posBefore;h=new Z(l==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=dg(n,f,u,m)}return h}function lg(n){return n.editable?n.hasFocus():sE(n)&&document.activeElement&&document.activeElement.contains(n.dom)}function Ec(n,e=!1){let t=n.state.selection;if(iE(n,t),!!lg(n)){if(!e&&n.input.mouseDown&&n.input.mouseDown.allowDefault&&Ti){let r=n.domSelectionRange(),i=n.domObserver.currentSelection;if(r.anchorNode&&i.anchorNode&&tg(r.anchorNode,r.anchorOffset,i.anchorNode,i.anchorOffset)){n.input.mouseDown.delayedSelectionSync=!0,n.domObserver.setCurSelection();return}}if(n.domObserver.disconnectSelection(),n.cursorWrapper)rE(n);else{let{anchor:r,head:i}=t,o,l;ug&&!(t instanceof de)&&(t.$from.parent.inlineContent||(o=cg(n,t.from)),!t.empty&&!t.$from.parent.inlineContent&&(l=cg(n,t.to))),n.docView.setSelection(r,i,n.root,e),ug&&(o&&fg(o),l&&fg(l)),t.visible?n.dom.classList.remove("ProseMirror-hideselection"):(n.dom.classList.add("ProseMirror-hideselection"),"onselectionchange"in document&&nE(n))}n.domObserver.setCurSelection(),n.domObserver.connectSelection()}}const ug=Fr||Ti&&Q_<63;function cg(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(Fr&&i&&i.contentEditable=="false")return Mc(i);if((!i||i.contentEditable=="false")&&(!o||o.contentEditable=="false")){if(i)return Mc(i);if(o)return Mc(o)}}function Mc(n){return n.contentEditable="true",Fr&&n.draggable&&(n.draggable=!1,n.wasDraggable=!0),n}function fg(n){n.contentEditable="false",n.wasDraggable&&(n.draggable=!0,n.wasDraggable=null)}function nE(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(()=>{(!lg(n)||n.state.selection.visible)&&n.dom.classList.remove("ProseMirror-hideselection")},20))})}function rE(n){let e=n.domSelection(),t=document.createRange(),r=n.cursorWrapper.dom,i=r.nodeName=="IMG";i?t.setEnd(r.parentNode,Cs(r)+1):t.setEnd(r,0),t.collapse(!1),e.removeAllRanges(),e.addRange(t),!i&&!n.state.selection.visible&&As&&ag<=11&&(r.disabled=!0,r.disabled=!1)}function iE(n,e){if(e instanceof Z){let t=n.docView.descAt(e.from);t!=n.lastSelectedViewDesc&&(hg(n),t&&t.selectNode(),n.lastSelectedViewDesc=t)}else hg(n)}function hg(n){n.lastSelectedViewDesc&&(n.lastSelectedViewDesc.parent&&n.lastSelectedViewDesc.deselectNode(),n.lastSelectedViewDesc=void 0)}function dg(n,e,t,r){return n.someProp("createSelectionBetween",i=>i(n,e,t))||de.between(e,t,r)}function sE(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 Tc(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&&me.findFrom(o,e)}function Hr(n,e){return n.dispatch(n.state.tr.setSelection(e).scrollIntoView()),!0}function pg(n,e,t){let r=n.state.selection;if(r instanceof de){if(!r.empty||t.indexOf("s")>-1)return!1;if(n.endOfTextblock(e>0?"right":"left")){let i=Tc(n.state,e);return i&&i instanceof Z?Hr(n,i):!1}else if(!(Ht&&t.indexOf("m")>-1)){let i=r.$head,o=i.textOffset?null:e<0?i.nodeBefore:i.nodeAfter,l;if(!o||o.isText)return!1;let u=e<0?i.pos-o.nodeSize:i.pos;return o.isAtom||(l=n.docView.descAt(u))&&!l.contentDOM?Z.isSelectable(o)?Hr(n,new Z(e<0?n.state.doc.resolve(i.pos-o.nodeSize):i)):_c?Hr(n,new de(n.state.doc.resolve(e<0?u:u+o.nodeSize))):!1:!1}}else{if(r instanceof Z&&r.node.isInline)return Hr(n,new de(e>0?r.$to:r.$from));{let i=Tc(n.state,e);return i?Hr(n,i):!1}}}function ya(n){return n.nodeType==3?n.nodeValue.length:n.childNodes.length}function Os(n){let e=n.pmViewDesc;return e&&e.size==0&&(n.nextSibling||n.nodeName!="BR")}function Cc(n){let e=n.domSelectionRange(),t=e.focusNode,r=e.focusOffset;if(!t)return;let i,o,l=!1;for(ga&&t.nodeType==1&&r<ya(t)&&Os(t.childNodes[r])&&(l=!0);;)if(r>0){if(t.nodeType!=1)break;{let u=t.childNodes[r-1];if(Os(u))i=t,o=--r;else if(u.nodeType==3)t=u,r=t.nodeValue.length;else break}}else{if(mg(t))break;{let u=t.previousSibling;for(;u&&Os(u);)i=t.parentNode,o=Cs(u),u=u.previousSibling;if(u)t=u,r=ya(t);else{if(t=t.parentNode,t==n.dom)break;r=0}}}l?Ic(n,t,r):i&&Ic(n,i,o)}function Ac(n){let e=n.domSelectionRange(),t=e.focusNode,r=e.focusOffset;if(!t)return;let i=ya(t),o,l;for(;;)if(r<i){if(t.nodeType!=1)break;let u=t.childNodes[r];if(Os(u))o=t,l=++r;else break}else{if(mg(t))break;{let u=t.nextSibling;for(;u&&Os(u);)o=u.parentNode,l=Cs(u)+1,u=u.nextSibling;if(u)t=u,r=0,i=ya(t);else{if(t=t.parentNode,t==n.dom)break;r=i=0}}}o&&Ic(n,o,l)}function mg(n){let e=n.pmViewDesc;return e&&e.node&&e.node.isBlock}function Ic(n,e,t){let r=n.domSelection();if(rg(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&&Ec(n)},50)}function gg(n,e,t){let r=n.state.selection;if(r instanceof de&&!r.empty||t.indexOf("s")>-1||Ht&&t.indexOf("m")>-1)return!1;let{$from:i,$to:o}=r;if(!i.parent.inlineContent||n.endOfTextblock(e<0?"up":"down")){let l=Tc(n.state,e);if(l&&l instanceof Z)return Hr(n,l)}if(!i.parent.inlineContent){let l=e<0?i:o,u=r instanceof Vt?me.near(l,e):me.findFrom(l,e);return u?Hr(n,u):!1}return!1}function yg(n,e){if(!(n.state.selection instanceof de))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 l=n.state.tr;return e<0?l.delete(t.pos-o.nodeSize,t.pos):l.delete(t.pos,t.pos+o.nodeSize),n.dispatch(l),!0}return!1}function bg(n,e,t){n.domObserver.stop(),e.contentEditable=t,n.domObserver.start()}function oE(n){if(!Fr||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;bg(n,r,"true"),setTimeout(()=>bg(n,r,"false"),20)}return!1}function aE(n){let e="";return n.ctrlKey&&(e+="c"),n.metaKey&&(e+="m"),n.altKey&&(e+="a"),n.shiftKey&&(e+="s"),e}function lE(n,e){let t=e.keyCode,r=aE(e);return t==8||Ht&&t==72&&r=="c"?yg(n,-1)||Cc(n):t==46||Ht&&t==68&&r=="c"?yg(n,1)||Ac(n):t==13||t==27?!0:t==37||Ht&&t==66&&r=="c"?pg(n,-1,r)||Cc(n):t==39||Ht&&t==70&&r=="c"?pg(n,1,r)||Ac(n):t==38||Ht&&t==80&&r=="c"?gg(n,-1,r)||Cc(n):t==40||Ht&&t==78&&r=="c"?oE(n)||gg(n,1,r)||Ac(n):r==(Ht?"m":"c")&&(t==66||t==73||t==89||t==90)}function vg(n,e){n.someProp("transformCopied",w=>{e=w(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 w=r.firstChild;t.push(w.type.name,w.attrs!=w.type.defaultAttrs?w.attrs:null),r=w.content}let l=n.someProp("clipboardSerializer")||Qr.fromSchema(n.state.schema),u=Tg(),f=u.createElement("div");f.appendChild(l.serializeFragment(r,{document:u}));let h=f.firstChild,m,p=0;for(;h&&h.nodeType==1&&(m=Eg[h.nodeName.toLowerCase()]);){for(let w=m.length-1;w>=0;w--){let S=u.createElement(m[w]);for(;f.firstChild;)S.appendChild(f.firstChild);f.appendChild(S),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",w=>w(e,n))||e.content.textBetween(0,e.content.size,`
|
|
9
9
|
|
|
10
|
-
`);return{dom:f,text:y}}function
|
|
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=Qr.fromSchema(S);l=document.createElement("div"),e.split(/(?:\r\n?|\n)+/).forEach(M=>{let T=l.appendChild(document.createElement("p"));M&&T.appendChild(w.serializeNode(S.text(M,y)))})}}else n.someProp("transformPastedHTML",p=>{t=p(t,n)}),l=cE(t),_c&&fE(l);let h=l&&l.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=l.firstChild;for(;y&&y.nodeType!=1;)y=y.nextSibling;if(!y)break;l=y}if(u||(u=(n.someProp("clipboardParser")||n.someProp("domParser")||lc.fromSchema(n.state.schema)).parseSlice(l,{preserveWhitespace:!!(f||m),context:i,ruleFromNode(y){return y.nodeName=="BR"&&!y.nextSibling&&y.parentNode&&!lE.test(y.parentNode.nodeName)?{ignore:!0}:null}})),m)u=hE(kg(u,+m[1],+m[2]),m[4]);else if(u=U.maxOpen(uE(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=kg(u,p,y)}return n.someProp("transformPasted",p=>{u=p(u,n)}),u}const lE=/^(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 uE(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,l=[];if(n.forEach(u=>{if(!l)return;let f=i.findWrapping(u.type),h;if(!f)return l=null;if(h=l.length&&o.length&&wg(f,o,u,l[l.length-1],0))l[l.length-1]=h;else{l.length&&(l[l.length-1]=xg(l[l.length-1],o.length));let m=Sg(u,f);l.push(m),i=i.matchType(m.type),o=f}}),l)return L.from(l)}return n}function Sg(n,e,t=0){for(let r=e.length-1;r>=t;r--)n=e[r].create(null,L.from(n));return n}function wg(n,e,t,r,i){if(i<n.length&&i<e.length&&n[i]==e[i]){let o=wg(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(Sg(t,n,i+1))))}}function xg(n,e){if(e==0)return n;let t=n.content.replaceChild(n.childCount-1,xg(n.lastChild,e-1)),r=n.contentMatchAt(n.childCount).fillBefore(L.empty,!0);return n.copy(t.append(r))}function Oc(n,e,t,r,i,o){let l=e<0?n.firstChild:n.lastChild,u=l.content;return i<r-1&&(u=Oc(u,e,t,r,i+1,o)),i>=t&&(u=e<0?l.contentMatchAt(0).fillBefore(u,n.childCount>1||o<=i).append(u):u.append(l.contentMatchAt(l.childCount).fillBefore(L.empty,!0))),n.replaceChild(e<0?0:n.childCount-1,l.copy(u))}function kg(n,e,t){return e<n.openStart&&(n=new U(Oc(n.content,-1,e,n.openStart,0,n.openEnd),e,n.openEnd)),t<n.openEnd&&(n=new U(Oc(n.content,1,t,n.openEnd,0,0),n.openStart,t)),n}const _g={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 Eg=null;function Mg(){return Eg||(Eg=document.implementation.createHTMLDocument("title"))}function cE(n){let e=/^(\s*<meta [^>]*>)*/.exec(n);e&&(n=n.slice(e[0].length));let t=Mg().createElement("div"),r=/<([a-z][^>\s]+)/i.exec(n),i;if((i=r&&_g[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 fE(n){let e=n.querySelectorAll(Ti?"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 hE(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:l}=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++,l++}return new U(i,o,l)}const sn={},Tt={};function hr(n,e){n.input.lastSelectionOrigin=e,n.input.lastSelectionTime=Date.now()}Tt.keydown=(n,e)=>{let t=e;if(n.input.shiftKey=t.keyCode==16||t.shiftKey,!Cg(n,t)&&(n.input.lastKeyCode=t.keyCode,n.input.lastKeyCodeTime=Date.now(),!(Is&&Ti&&t.keyCode==13)))if(t.keyCode!=229&&n.domObserver.forceFlush(),kc&&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,rg(13,"Enter"))),n.input.lastIOSEnter=0)},200)}else n.someProp("handleKeyDown",r=>r(n,t))||aE(n,t)?t.preventDefault():hr(n,"key")},Tt.keyup=(n,e)=>{e.keyCode==16&&(n.input.shiftKey=!1)},Tt.keypress=(n,e)=>{let t=e;if(Cg(n,t)||!t.charCode||t.ctrlKey&&!t.altKey||Ht&&t.metaKey)return;if(n.someProp("handleKeyPress",i=>i(n,t))){t.preventDefault();return}let r=n.state.selection;if(!(r instanceof de)||!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 ba(n){return{left:n.clientX,top:n.clientY}}function dE(n,e){let t=e.x-n.clientX,r=e.y-n.clientY;return t*t+r*r<100}function Nc(n,e,t,r,i){if(r==-1)return!1;let o=n.state.doc.resolve(r);for(let l=o.depth+1;l>0;l--)if(n.someProp(e,u=>l>o.depth?u(n,t,o.nodeAfter,o.before(l),i,!0):u(n,t,o.node(l),o.before(l),i,!1)))return!0;return!1}function Ci(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)?(Ci(n,new Z(t)),!0):!1}function mE(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 l=o.depth+1;l>0;l--){let u=l>o.depth?o.nodeAfter:o.node(l);if(Z.isSelectable(u)){r&&t.$from.depth>0&&l>=t.$from.depth&&o.before(t.$from.depth+1)==t.$from.pos?i=o.before(t.$from.depth):i=o.before(l);break}}return i!=null?(Ci(n,Z.create(n.state.doc,i)),!0):!1}function gE(n,e,t,r,i){return Nc(n,"handleClickOn",e,t,r)||n.someProp("handleClick",o=>o(n,e,r))||(i?mE(n,t):pE(n,t))}function yE(n,e,t,r){return Nc(n,"handleDoubleClickOn",e,t,r)||n.someProp("handleDoubleClick",i=>i(n,e,r))}function bE(n,e,t,r){return Nc(n,"handleTripleClickOn",e,t,r)||n.someProp("handleTripleClick",i=>i(n,e,r))||vE(n,t,r)}function vE(n,e,t){if(t.button!=0)return!1;let r=n.state.doc;if(e==-1)return r.inlineContent?(Ci(n,de.create(r,0,r.content.size)),!0):!1;let i=r.resolve(e);for(let o=i.depth+1;o>0;o--){let l=o>i.depth?i.nodeAfter:i.node(o),u=i.before(o);if(l.inlineContent)Ci(n,de.create(r,u+1,u+1+l.content.size));else if(Z.isSelectable(l))Ci(n,Z.create(r,u));else continue;return!0}}function Rc(n){return va(n)}const Tg=Ht?"metaKey":"ctrlKey";sn.mousedown=(n,e)=>{let t=e;n.input.shiftKey=t.shiftKey;let r=Rc(n),i=Date.now(),o="singleClick";i-n.input.lastClick.time<500&&dE(t,n.input.lastClick)&&!t[Tg]&&(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 l=n.posAtCoords(ba(t));l&&(o=="singleClick"?(n.input.mouseDown&&n.input.mouseDown.done(),n.input.mouseDown=new SE(n,l,t,!!r)):(o=="doubleClick"?yE:bE)(n,l.pos,l.inside,t)?t.preventDefault():hr(n,"pointer"))};class SE{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[Tg],this.allowDefault=r.shiftKey;let o,l;if(t.inside>-1)o=e.state.doc.nodeAt(t.inside),l=t.inside;else{let m=e.state.doc.resolve(t.pos);o=m.parent,l=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<=l&&h.to>l)&&(this.mightDrag={node:o,pos:l,addAttr:!!(this.target&&!this.target.draggable),setUneditable:!!(this.target&&ga&&!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)),hr(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(()=>Ec(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(ba(e))),this.updateAllowDefault(e),this.allowDefault||!t?hr(this.view,"pointer"):gE(this.view,t.pos,t.inside,e,this.selectNode)?e.preventDefault():e.button==0&&(this.flushed||Fr&&this.mightDrag&&!this.mightDrag.node.isAtom||Ti&&!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)?(Ci(this.view,me.near(this.view.state.doc.resolve(t.pos))),e.preventDefault()):hr(this.view,"pointer")}move(e){this.updateAllowDefault(e),hr(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)}}sn.touchstart=n=>{n.input.lastTouch=Date.now(),Rc(n),hr(n,"pointer")},sn.touchmove=n=>{n.input.lastTouch=Date.now(),hr(n,"pointer")},sn.contextmenu=n=>Rc(n);function Cg(n,e){return n.composing?!0:Fr&&Math.abs(e.timeStamp-n.input.compositionEndedAt)<500?(n.input.compositionEndedAt=-2e8,!0):!1}const wE=Is?5e3:-1;Tt.compositionstart=Tt.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(),va(n,!0),n.markCursor=null;else if(va(n),ga&&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 l=o<0?i.lastChild:i.childNodes[o-1];if(!l)break;if(l.nodeType==3){n.domSelection().collapse(l,l.nodeValue.length);break}else i=l,o=-1}}n.input.composing=!0}Ag(n,wE)},Tt.compositionend=(n,e)=>{n.composing&&(n.input.composing=!1,n.input.compositionEndedAt=e.timeStamp,Ag(n,20))};function Ag(n,e){clearTimeout(n.input.composingTimeout),e>-1&&(n.input.composingTimeout=setTimeout(()=>va(n),e))}function xE(n){for(n.composing&&(n.input.composing=!1,n.input.compositionEndedAt=kE());n.input.compositionNodes.length>0;)n.input.compositionNodes.pop().markParentsDirty()}function kE(){let n=document.createEvent("Event");return n.initEvent("event",!0,!0),n.timeStamp}function va(n,e=!1){if(!(Is&&n.domObserver.flushingSoon>=0)){if(n.domObserver.forceFlush(),xE(n),e||n.docView&&n.docView.dirty){let t=eE(n);return t&&!t.eq(n.state.selection)?n.dispatch(n.state.tr.setSelection(t)):n.updateState(n.state),!0}return!1}}function _E(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 Ai=As&&og<15||kc&&Q_<604;sn.copy=Tt.cut=(n,e)=>{let t=e,r=n.state.selection,i=t.type=="cut";if(r.empty)return;let o=Ai?null:t.clipboardData,l=r.content(),{dom:u,text:f}=bg(n,l);o?(t.preventDefault(),o.clearData(),o.setData("text/html",u.innerHTML),o.setData("text/plain",f)):_E(n,u),i&&n.dispatch(n.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))};function EE(n){return n.openStart==0&&n.openEnd==0&&n.content.childCount==1?n.content.firstChild:null}function ME(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?Lc(n,r.value,null,e):Lc(n,r.textContent,r.innerHTML,e)},50)}function Lc(n,e,t,r){let i=vg(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=EE(i),l=o?n.state.tr.replaceSelectionWith(o,n.input.shiftKey):n.state.tr.replaceSelection(i);return n.dispatch(l.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste")),!0}Tt.paste=(n,e)=>{let t=e;if(n.composing&&!Is)return;let r=Ai?null:t.clipboardData;r&&Lc(n,r.getData("text/plain"),r.getData("text/html"),t)?t.preventDefault():ME(n,t)};class TE{constructor(e,t){this.slice=e,this.move=t}}const Ig=Ht?"altKey":"ctrlKey";sn.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(ba(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 l=n.state.selection.content(),{dom:u,text:f}=bg(n,l);t.dataTransfer.clearData(),t.dataTransfer.setData(Ai?"Text":"text/html",u.innerHTML),t.dataTransfer.effectAllowed="copyMove",Ai||t.dataTransfer.setData("text/plain",f),n.dragging=new TE(l,!t[Ig])},sn.dragend=n=>{let e=n.dragging;window.setTimeout(()=>{n.dragging==e&&(n.dragging=null)},50)},Tt.dragover=Tt.dragenter=(n,e)=>e.preventDefault(),Tt.drop=(n,e)=>{let t=e,r=n.dragging;if(n.dragging=null,!t.dataTransfer)return;let i=n.posAtCoords(ba(t));if(!i)return;let o=n.state.doc.resolve(i.pos),l=r&&r.slice;l?n.someProp("transformPasted",w=>{l=w(l,n)}):l=vg(n,t.dataTransfer.getData(Ai?"Text":"text/plain"),Ai?null:t.dataTransfer.getData("text/html"),!1,o);let u=!!(r&&!t[Ig]);if(n.someProp("handleDrop",w=>w(n,t,l||U.empty,u))){t.preventDefault();return}if(!l)return;t.preventDefault();let f=l?F_(n.state.doc,o.pos,l):o.pos;f==null&&(f=o.pos);let h=n.state.tr;u&&h.deleteSelection();let m=h.mapping.map(f),p=l.openStart==0&&l.openEnd==0&&l.content.childCount==1,y=h.doc;if(p?h.replaceRangeWith(m,m,l.content.firstChild):h.replaceRange(m,m,l),h.doc.eq(y))return;let S=h.doc.resolve(m);if(p&&Z.isSelectable(l.content.firstChild)&&S.nodeAfter&&S.nodeAfter.sameMarkup(l.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,I,F)=>w=F),h.setSelection(hg(n,S,h.doc.resolve(w)))}n.focus(),n.dispatch(h.setMeta("uiEvent","drop"))},sn.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())&&Ec(n)},20))},sn.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)},sn.beforeinput=(n,e)=>{if(Ti&&Is&&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,rg(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 Tt)sn[n]=Tt[n];function Ns(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 Gf{constructor(e,t){this.toDOM=e,this.spec=t||$r,this.side=this.spec.side||0}map(e,t,r,i){let{pos:o,deleted:l}=e.mapResult(t.from+i,this.side<0?-1:1);return l?null:new Sn(o-r,o-r,this)}valid(){return!0}eq(e){return this==e||e instanceof Gf&&(this.spec.key&&this.spec.key==e.spec.key||this.toDOM==e.toDOM&&Ns(this.spec,e.spec))}destroy(e){this.spec.destroy&&this.spec.destroy(e)}}class wr{constructor(e,t){this.attrs=e,this.spec=t||$r}map(e,t,r,i){let o=e.map(t.from+i,this.spec.inclusiveStart?-1:1)-r,l=e.map(t.to+i,this.spec.inclusiveEnd?1:-1)-r;return o>=l?null:new Sn(o,l,this)}valid(e,t){return t.from<t.to}eq(e){return this==e||e instanceof wr&&Ns(this.attrs,e.attrs)&&Ns(this.spec,e.spec)}static is(e){return e.type instanceof wr}destroy(){}}class qf{constructor(e,t){this.attrs=e,this.spec=t||$r}map(e,t,r,i){let o=e.mapResult(t.from+i,1);if(o.deleted)return null;let l=e.mapResult(t.to+i,-1);return l.deleted||l.pos<=o.pos?null:new Sn(o.pos-r,l.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 qf&&Ns(this.attrs,e.attrs)&&Ns(this.spec,e.spec)}destroy(){}}class Sn{constructor(e,t,r){this.from=e,this.to=t,this.type=r}copy(e,t){return new Sn(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 Sn(e,e,new Gf(t,r))}static inline(e,t,r,i){return new Sn(e,t,new wr(r,i))}static node(e,t,r,i){return new Sn(e,t,new qf(r,i))}get spec(){return this.type.spec}get inline(){return this.type instanceof wr}}const Ii=[],$r={};class qe{constructor(e,t){this.local=e.length?e:Ii,this.children=t.length?t:Ii}static create(e,t){return t.length?Sa(t,e,0,$r):ft}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 l=0;l<this.local.length;l++){let u=this.local[l];u.from<=t&&u.to>=e&&(!o||o(u.spec))&&r.push(u.copy(u.from+i,u.to+i))}for(let l=0;l<this.children.length;l+=3)if(this.children[l]<t&&this.children[l+1]>e){let u=this.children[l]+1;this.children[l+2].findInner(e-u,t-u,r,i+u,o)}}map(e,t,r){return this==ft||e.maps.length==0?this:this.mapInner(e,t,0,0,r||$r)}mapInner(e,t,r,i,o){let l;for(let u=0;u<this.local.length;u++){let f=this.local[u].map(e,r,i);f&&f.type.valid(t,f)?(l||(l=[])).push(f):o.onRemove&&o.onRemove(this.local[u].spec)}return this.children.length?CE(this.children,l||[],e,t,r,i,o):l?new qe(l.sort(Wr),Ii):ft}add(e,t){return t.length?this==ft?qe.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=Ng(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,Sa(m,u,h+1,$r)),o+=3}});let l=Og(o?Rg(t):t,-r);for(let u=0;u<l.length;u++)l[u].type.valid(e,l[u])||l.splice(u--,1);return new qe(l.length?this.local.concat(l).sort(Wr):this.local,i||this.children)}remove(e){return e.length==0||this==ft?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 l,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,(l||(l=[])).push(p));if(!l)continue;r==this.children&&(r=this.children.slice());let h=r[o+2].removeInner(l,u+1);h!=ft?r[o+2]=h:(r.splice(o,3),o-=3)}if(i.length){for(let o=0,l;o<e.length;o++)if(l=e[o])for(let u=0;u<i.length;u++)i[u].eq(l,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 qe(i,r):ft}forChild(e,t){if(this==ft)return this;if(t.isLeaf)return qe.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,l=o+t.content.size;for(let u=0;u<this.local.length;u++){let f=this.local[u];if(f.from<l&&f.to>o&&f.type instanceof wr){let h=Math.max(o,f.from)-o,m=Math.min(l,f.to)-o;h<m&&(i||(i=[])).push(f.copy(h,m))}}if(i){let u=new qe(i.sort(Wr),Ii);return r?new Zr([u,r]):u}return r||ft}eq(e){if(this==e)return!0;if(!(e instanceof qe)||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 Pc(this.localsInner(e))}localsInner(e){if(this==ft)return Ii;if(e.inlineContent||!this.local.some(wr.is))return this.local;let t=[];for(let r=0;r<this.local.length;r++)this.local[r].type instanceof wr||t.push(this.local[r]);return t}}qe.empty=new qe([],[]),qe.removeOverlap=Pc;const ft=qe.empty;class Zr{constructor(e){this.members=e}map(e,t){const r=this.members.map(i=>i.map(e,t,$r));return Zr.from(r)}forChild(e,t){if(t.isLeaf)return qe.empty;let r=[];for(let i=0;i<this.members.length;i++){let o=this.members[i].forChild(e,t);o!=ft&&(o instanceof Zr?r=r.concat(o.members):r.push(o))}return Zr.from(r)}eq(e){if(!(e instanceof Zr)||e.members.length!=this.members.length)return!1;for(let t=0;t<this.members.length;t++)if(!this.members[t].eq(e.members[t]))return!1;return!0}locals(e){let t,r=!0;for(let i=0;i<this.members.length;i++){let o=this.members[i].localsInner(e);if(o.length)if(!t)t=o;else{r&&(t=t.slice(),r=!1);for(let l=0;l<o.length;l++)t.push(o[l])}}return t?Pc(r?t:t.sort(Wr)):Ii}static from(e){switch(e.length){case 0:return ft;case 1:return e[0];default:return new Zr(e.every(t=>t instanceof qe)?e:e.reduce((t,r)=>t.concat(r instanceof qe?r:r.members),[]))}}}function CE(n,e,t,r,i,o,l){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 I=0;I<u.length;I+=3){let F=u[I+1];if(F<0||y>F+m-p)continue;let B=u[I]+m-p;S>=B?u[I+1]=y<=B?-2:-1:w>=i&&T&&(u[I]+=T,u[I+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 I=u[h+2].mapInner(t,T,m+1,n[h]+o+1,l);I!=ft?(u[h]=p,u[h+1]=S,u[h+2]=I):(u[h+1]=-2,f=!0)}else f=!0}if(f){let h=AE(u,n,e,t,i,o,l),m=Sa(h,r,0,l);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 qe(e.sort(Wr),u)}function Og(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 Sn(i.from+e,i.to+e,i.type))}return t}function AE(n,e,t,r,i,o,l){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):l.onRemove&&l.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 Ng(n,e,t){if(e.isLeaf)return null;let r=t+e.nodeSize,i=null;for(let o=0,l;o<n.length;o++)(l=n[o])&&l.from>t&&l.to<r&&((i||(i=[])).push(l),n[o]=null);return i}function Rg(n){let e=[];for(let t=0;t<n.length;t++)n[t]!=null&&e.push(n[t]);return e}function Sa(n,e,t,r){let i=[],o=!1;e.forEach((u,f)=>{let h=Ng(n,u,f+t);if(h){o=!0;let m=Sa(h,u,t+f+1,r);m!=ft&&i.push(f,f+u.nodeSize,m)}});let l=Og(o?Rg(n):n,-t).sort(Wr);for(let u=0;u<l.length;u++)l[u].type.valid(e,l[u])||(r.onRemove&&r.onRemove(l[u].spec),l.splice(u--,1));return l.length||i.length?new qe(l,i):ft}function Wr(n,e){return n.from-e.from||n.to-e.to}function Pc(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),Lg(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),Lg(e,i,r.copy(o.from,r.to)));break}}}return e}function Lg(n,e,t){for(;e<n.length&&Wr(t,n[e])>0;)e++;n.splice(e,0,t)}for(var dr={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:"'"},wa={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},Pg=typeof navigator<"u"&&/Chrome\/(\d+)/.exec(navigator.userAgent),IE=typeof navigator<"u"&&/Mac/.test(navigator.platform),OE=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),NE=IE||Pg&&+Pg[1]<57,Qe=0;Qe<10;Qe++)dr[48+Qe]=dr[96+Qe]=String(Qe);for(var Qe=1;Qe<=24;Qe++)dr[Qe+111]="F"+Qe;for(var Qe=65;Qe<=90;Qe++)dr[Qe]=String.fromCharCode(Qe+32),wa[Qe]=String.fromCharCode(Qe);for(var Dc in dr)wa.hasOwnProperty(Dc)||(wa[Dc]=dr[Dc]);function RE(n){var e=NE&&(n.ctrlKey||n.altKey||n.metaKey)||OE&&n.shiftKey&&n.key&&n.key.length==1||n.key=="Unidentified",t=!e&&n.key||(n.shiftKey?wa:dr)[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 LE=typeof navigator<"u"?/Mac|iP(hone|[oa]d)/.test(navigator.platform):!1;function PE(n){let e=n.split(/-(?!$)/),t=e[e.length-1];t=="Space"&&(t=" ");let r,i,o,l;for(let u=0;u<e.length-1;u++){let f=e[u];if(/^(cmd|meta|m)$/i.test(f))l=!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))LE?l=!0:i=!0;else throw new Error("Unrecognized modifier name: "+f)}return r&&(t="Alt-"+t),i&&(t="Ctrl-"+t),l&&(t="Meta-"+t),o&&(t="Shift-"+t),t}function DE(n){let e=Object.create(null);for(let t in n)e[PE(t)]=n[t];return e}function zc(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 zE(n){return new Mt({props:{handleKeyDown:BE(n)}})}function BE(n){let e=DE(n);return function(t,r){let i=RE(r),o=i.length==1&&i!=" ",l,u=e[zc(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)&&(l=dr[r.keyCode])&&l!=i){let f=e[zc(l,r,!0)];if(f&&f(t.state,t.dispatch,t))return!0}else if(o&&r.shiftKey){let f=e[zc(i,r,!0)];if(f&&f(t.state,t.dispatch,t))return!0}return!1}}const Bc=(n,e)=>n.selection.empty?!1:(e&&e(n.tr.deleteSelection().scrollIntoView()),!0);function FE(n,e){let{$cursor:t}=n.selection;return!t||(e?!e.endOfTextblock("backward",n):t.parentOffset>0)?null:t}const Dg=(n,e,t)=>{let r=FE(n,t);if(!r)return!1;let i=Bg(r);if(!i){let l=r.blockRange(),u=l&&_i(l);return u==null?!1:(e&&e(n.tr.lift(l,u).scrollIntoView()),!0)}let o=i.nodeBefore;if(!o.type.spec.isolating&&Kg(n,i,e))return!0;if(r.parent.content.size==0&&(Oi(o,"end")||Z.isSelectable(o))){let l=mc(n.doc,r.before(),r.after(),U.empty);if(l&&l.slice.size<l.to-l.from){if(e){let u=n.tr.step(l);u.setSelection(Oi(o,"end")?me.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 Oi(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 zg=(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=Bg(r)}let l=o&&o.nodeBefore;return!l||!Z.isSelectable(l)?!1:(e&&e(n.tr.setSelection(Z.create(n.doc,o.pos-l.nodeSize)).scrollIntoView()),!0)};function Bg(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 HE(n,e){let{$cursor:t}=n.selection;return!t||(e?!e.endOfTextblock("forward",n):t.parentOffset<t.parent.content.size)?null:t}const Fg=(n,e,t)=>{let r=HE(n,t);if(!r)return!1;let i=$g(r);if(!i)return!1;let o=i.nodeAfter;if(Kg(n,i,e))return!0;if(r.parent.content.size==0&&(Oi(o,"start")||Z.isSelectable(o))){let l=mc(n.doc,r.before(),r.after(),U.empty);if(l&&l.slice.size<l.to-l.from){if(e){let u=n.tr.step(l);u.setSelection(Oi(o,"start")?me.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},Hg=(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=$g(r)}let l=o&&o.nodeAfter;return!l||!Z.isSelectable(l)?!1:(e&&e(n.tr.setSelection(Z.create(n.doc,o.pos)).scrollIntoView()),!0)};function $g(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 $E=(n,e)=>{let t=n.selection,r=t instanceof Z,i;if(r){if(t.node.isTextblock||!ur(n.doc,t.from))return!1;i=t.from}else if(i=da(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},WE=(n,e)=>{let t=n.selection,r;if(t instanceof Z){if(t.node.isTextblock||!ur(n.doc,t.to))return!1;r=t.to}else if(r=da(n.doc,t.to,1),r==null)return!1;return e&&e(n.tr.join(r).scrollIntoView()),!0},UE=(n,e)=>{let{$from:t,$to:r}=n.selection,i=t.blockRange(r),o=i&&_i(i);return o==null?!1:(e&&e(n.tr.lift(i,o).scrollIntoView()),!0)},Wg=(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 Fc(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 VE=(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),l=Fc(i.contentMatchAt(o));if(!l||!i.canReplaceWith(o,o,l))return!1;if(e){let u=t.after(),f=n.tr.replaceWith(u,u,l.createAndFill());f.setSelection(me.near(f.doc.resolve(u),1)),e(f.scrollIntoView())}return!0},Ug=(n,e)=>{let t=n.selection,{$from:r,$to:i}=t;if(t instanceof Vt||r.parent.inlineContent||i.parent.inlineContent)return!1;let o=Fc(i.parent.contentMatchAt(i.indexAfter()));if(!o||!o.isTextblock)return!1;if(e){let l=(!r.parentOffset&&i.index()<i.parent.childCount?r:i).pos,u=n.tr.insert(l,o.createAndFill());u.setSelection(de.create(u.doc,l+1)),e(u.scrollIntoView())}return!0},Vg=(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(zn(n.doc,o))return e&&e(n.tr.split(o).scrollIntoView()),!0}let r=t.blockRange(),i=r&&_i(r);return i==null?!1:(e&&e(n.tr.lift(r,i).scrollIntoView()),!0)};function KE(n){return(e,t)=>{let{$from:r,$to:i}=e.selection;if(e.selection instanceof Z&&e.selection.node.isBlock)return!r.parentOffset||!zn(e.doc,r.pos)?!1:(t&&t(e.tr.split(r.pos).scrollIntoView()),!0);if(!r.parent.isBlock)return!1;if(t){let o=i.parentOffset==i.parent.content.size,l=e.tr;(e.selection instanceof de||e.selection instanceof Vt)&&l.deleteSelection();let u=r.depth==0?null:Fc(r.node(-1).contentMatchAt(r.indexAfter(-1))),f=o&&u?[{type:u}]:void 0,h=zn(l.doc,l.mapping.map(r.pos),1,f);if(!f&&!h&&zn(l.doc,l.mapping.map(r.pos),1,u?[{type:u}]:void 0)&&(u&&(f=[{type:u}]),h=!0),h&&(l.split(l.mapping.map(r.pos),1,f),!o&&!r.parentOffset&&r.parent.type!=u)){let m=l.mapping.map(r.before()),p=l.doc.resolve(m);u&&r.node(-1).canReplaceWith(p.index(),p.index()+1,u)&&l.setNodeMarkup(l.mapping.map(r.before()),u)}t(l.scrollIntoView())}return!0}}const GE=KE(),qE=(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 JE(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||ur(n.doc,e.pos))?!1:(t&&t(n.tr.clearIncompatible(e.pos,r.type,r.contentMatchAt(r.childCount)).join(e.pos).scrollIntoView()),!0)}function Kg(n,e,t){let r=e.nodeBefore,i=e.nodeAfter,o,l;if(r.type.spec.isolating||i.type.spec.isolating)return!1;if(JE(n,e,t))return!0;let u=e.parent.canReplace(e.index(),e.index()+1);if(u&&(o=(l=r.contentMatchAt(r.childCount)).findWrapping(i.type))&&l.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 Ge(e.pos-1,p,e.pos,p,new U(y,1,0),o.length,!0)),w=p+2*o.length;ur(S.doc,w)&&S.join(w),t(S.scrollIntoView())}return!0}let f=me.findFrom(e,1),h=f&&f.$from.blockRange(f.$to),m=h&&_i(h);if(m!=null&&m>=e.depth)return t&&t(n.tr.lift(h,m).scrollIntoView()),!0;if(u&&Oi(i,"start",!0)&&Oi(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 I=y.length-1;I>=0;I--)M=L.from(y[I].copy(M));let T=n.tr.step(new Ge(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 Gg(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(de.create(e.doc,n<0?i.start(o):i.end(o)))),!0):!1}}const jE=Gg(-1),YE=Gg(1);function XE(n,e=null){return function(t,r){let{$from:i,$to:o}=t.selection,l=i.blockRange(o),u=l&&pc(l,n,e);return u?(r&&r(t.tr.wrap(l,u).scrollIntoView()),!0):!1}}function qg(n,e=null){return function(t,r){let i=!1;for(let o=0;o<t.selection.ranges.length&&!i;o++){let{$from:{pos:l},$to:{pos:u}}=t.selection.ranges[o];t.doc.nodesBetween(l,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 l=0;l<t.selection.ranges.length;l++){let{$from:{pos:u},$to:{pos:f}}=t.selection.ranges[l];o.setBlockType(u,f,n,e)}r(o.scrollIntoView())}return!0}}function Hc(...n){return function(e,t,r){for(let i=0;i<n.length;i++)if(n[i](e,t,r))return!0;return!1}}Hc(Bc,Dg,zg),Hc(Bc,Fg,Hg),Hc(Wg,Ug,Vg,GE),typeof navigator<"u"?/Mac|iP(hone|[oa]d)/.test(navigator.platform):typeof os<"u"&&os.platform&&os.platform()=="darwin";function ZE(n,e=null){return function(t,r){let{$from:i,$to:o}=t.selection,l=i.blockRange(o),u=!1,f=l;if(!l)return!1;if(l.depth>=2&&i.node(l.depth-1).type.compatibleContent(n)&&l.startIndex==0){if(i.index(l.depth-1)==0)return!1;let m=t.doc.resolve(l.start-2);f=new la(m,m,l.depth),l.endIndex<l.parent.childCount&&(l=new la(i,t.doc.resolve(o.end(l.depth)),l.depth)),u=!0}let h=pc(f,n,e,l);return h?(r&&r(QE(t.tr,l,h,u,n).scrollIntoView()),!0):!1}}function QE(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 Ge(e.start-(r?2:0),e.end,e.start,e.end,new U(o,0,0),t.length,!0));let l=0;for(let m=0;m<t.length;m++)t[m].type==i&&(l=m+1);let u=t.length-l,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&&zn(n.doc,f,u)&&(n.split(f,u),f+=2*u),f+=h.child(m).nodeSize;return n}function eM(n){return function(e,t){let{$from:r,$to:i}=e.selection,o=r.blockRange(i,l=>l.childCount>0&&l.firstChild.type==n);return o?t?r.node(o.depth-1).type==n?tM(e,t,n,o):nM(e,t,o):!0:!1}}function tM(n,e,t,r){let i=n.tr,o=r.end,l=r.$to.end(r.depth);o<l&&(i.step(new Ge(o-1,l,o,l,new U(L.from(t.create(null,r.parent.copy())),1,0),1,!0)),r=new la(i.doc.resolve(r.$from.pos),i.doc.resolve(l),r.depth));const u=_i(r);if(u==null)return!1;i.lift(r,u);let f=i.mapping.map(o,-1)-1;return ur(i.doc,f)&&i.join(f),e(i.scrollIntoView()),!0}function nM(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),l=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,l.content.append(f?L.empty:L.from(i))))return!1;let p=o.pos,y=p+l.nodeSize;return r.step(new Ge(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 rM(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 l=o.startIndex;if(l==0)return!1;let u=o.parent,f=u.child(l-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 Ge(y-(h?3:1),S,y,S,p,1,!0)).scrollIntoView())}return!0}}function xa(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 $c{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,l=this.buildProps(o);return Object.fromEntries(Object.entries(e).map(([u,f])=>[u,(...m)=>{const p=f(...m)(l);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:l}=i,u=[],f=!!e,h=e||o.tr,m=()=>(!f&&t&&!h.getMeta("preventDispatch")&&!this.hasCustomState&&l.dispatch(h),u.every(y=>y===!0)),p={...Object.fromEntries(Object.entries(r).map(([y,S])=>[y,(...M)=>{const T=this.buildProps(h,t),I=S(...M)(T);return u.push(I),p}])),run:m};return p}createCan(e){const{rawCommands:t,state:r}=this,i=!1,o=e||r.tr,l=this.buildProps(o,i);return{...Object.fromEntries(Object.entries(t).map(([f,h])=>[f,(...m)=>h(...m)({...l,dispatch:void 0})])),chain:()=>this.createChain(o,i)}}buildProps(e,t=!0){const{rawCommands:r,editor:i,state:o}=this,{view:l}=i,u={tr:e,editor:i,view:l,state:xa({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 ka(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 Jg(n){const e=[],{nodeExtensions:t,markExtensions:r}=ka(n),i=[...t,...r],o={default:null,rendered:!0,renderHTML:null,parseHTML:null,keepOnSplit:!0,isRequired:!1};return n.forEach(l=>{const u={name:l.name,options:l.options,storage:l.storage},f=V(l,"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(l=>{const u={name:l.name,options:l.options,storage:l.storage},f=V(l,"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:l.name,name:m,attribute:y})})}),e}function Ue(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 Ni(...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 Wc(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)=>Ni(t,r),{})}function iM(n){return typeof n=="function"}function le(n,e=void 0,...t){return iM(n)?e?n.bind(e)(...t):n(...t):n}function sM(n={}){return Object.keys(n).length===0&&n.constructor===Object}function oM(n){return typeof n!="string"?n:n.match(/^[+-]?(?:\d*\.)?\d+$/)?Number(n):n==="true"?!0:n==="false"?!1:n}function jg(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,l)=>{const u=l.attribute.parseHTML?l.attribute.parseHTML(t):oM(t.getAttribute(l.name));return u==null?o:{...o,[l.name]:u}},{});return{...r,...i}}}}function Yg(n){return Object.fromEntries(Object.entries(n).filter(([e,t])=>e==="attrs"&&sM(t)?!1:t!=null))}function Xg(n,e){var t;const r=Jg(n),{nodeExtensions:i,markExtensions:o}=ka(n),l=(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(I=>I.type===h.name),p={name:h.name,options:h.options,storage:h.storage,editor:e},y=n.reduce((I,F)=>{const B=V(F,"extendNodeSchema",p);return{...I,...B?B(h):{}}},{}),S=Yg({...y,content:le(V(h,"content",p)),marks:le(V(h,"marks",p)),group:le(V(h,"group",p)),inline:le(V(h,"inline",p)),atom:le(V(h,"atom",p)),selectable:le(V(h,"selectable",p)),draggable:le(V(h,"draggable",p)),code:le(V(h,"code",p)),defining:le(V(h,"defining",p)),isolating:le(V(h,"isolating",p)),attrs:Object.fromEntries(m.map(I=>{var F;return[I.name,{default:(F=I?.attribute)===null||F===void 0?void 0:F.default}]}))}),w=le(V(h,"parseHTML",p));w&&(S.parseDOM=w.map(I=>jg(I,m)));const M=V(h,"renderHTML",p);M&&(S.toDOM=I=>M({node:I,HTMLAttributes:Wc(I,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,I)=>{const F=V(I,"extendMarkSchema",p);return{...T,...F?F(h):{}}},{}),S=Yg({...y,inclusive:le(V(h,"inclusive",p)),excludes:le(V(h,"excludes",p)),group:le(V(h,"group",p)),spanning:le(V(h,"spanning",p)),code:le(V(h,"code",p)),attrs:Object.fromEntries(m.map(T=>{var I;return[T.name,{default:(I=T?.attribute)===null||I===void 0?void 0:I.default}]}))}),w=le(V(h,"parseHTML",p));w&&(S.parseDOM=w.map(T=>jg(T,m)));const M=V(h,"renderHTML",p);return M&&(S.toDOM=T=>M({mark:T,HTMLAttributes:Wc(T,m)})),[h.name,S]}));return new g_({topNode:l,nodes:u,marks:f})}function Uc(n,e){return e.nodes[n]||e.marks[n]||null}function Zg(n,e){return Array.isArray(e)?e.some(t=>(typeof t=="string"?t:t.name)===n.name):e}const aM=(n,e=500)=>{let t="";const r=n.parentOffset;return n.parent.nodesBetween(Math.max(0,r-e),r,(i,o,l,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:l,index:u}))||i.textContent||"%leaf%";t+=m.slice(0,Math.max(0,r-o))}),t};function Vc(n){return Object.prototype.toString.call(n)==="[object RegExp]"}class Qg{constructor(e){this.find=e.find,this.handler=e.handler}}const lM=(n,e)=>{if(Vc(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 Kc(n){var e;const{editor:t,from:r,to:i,text:o,rules:l,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=aM(h)+o;return l.forEach(y=>{if(m)return;const S=lM(p,y.find);if(!S)return;const w=f.state.tr,M=xa({state:f.state,transaction:w}),T={from:r-(S[0].length-o.length),to:i},{commands:I,chain:F,can:B}=new $c({editor:t,state:M});y.handler({state:M,range:T,match:S,commands:I,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 uM(n){const{editor:e,rules:t}=n,r=new Mt({state:{init(){return null},apply(i,o){const l=i.getMeta(r);return l||(i.selectionSet||i.docChanged?null:o)}},props:{handleTextInput(i,o,l,u){return Kc({editor:e,from:o,to:l,text:u,rules:t,plugin:r})},handleDOMEvents:{compositionend:i=>(setTimeout(()=>{const{$cursor:o}=i.state.selection;o&&Kc({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:l}=i.state.selection;return l?Kc({editor:e,from:l.pos,to:l.pos,text:`
|
|
13
|
-
`,rules:t,plugin:r}):!1}},isInputRules:!0});return r}function
|
|
10
|
+
`);return{dom:f,text:y}}function wg(n,e,t,r,i){let o=i.parent.type.spec.code,l,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:w}=n.state,S=Qr.fromSchema(w);l=document.createElement("div"),e.split(/(?:\r\n?|\n)+/).forEach(M=>{let T=l.appendChild(document.createElement("p"));M&&T.appendChild(S.serializeNode(w.text(M,y)))})}}else n.someProp("transformPastedHTML",p=>{t=p(t,n)}),l=fE(t),_c&&hE(l);let h=l&&l.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=l.firstChild;for(;y&&y.nodeType!=1;)y=y.nextSibling;if(!y)break;l=y}if(u||(u=(n.someProp("clipboardParser")||n.someProp("domParser")||lc.fromSchema(n.state.schema)).parseSlice(l,{preserveWhitespace:!!(f||m),context:i,ruleFromNode(y){return y.nodeName=="BR"&&!y.nextSibling&&y.parentNode&&!uE.test(y.parentNode.nodeName)?{ignore:!0}:null}})),m)u=dE(_g(u,+m[1],+m[2]),m[4]);else if(u=U.maxOpen(cE(u.content,i),!0),u.openStart||u.openEnd){let p=0,y=0;for(let w=u.content.firstChild;p<u.openStart&&!w.type.spec.isolating;p++,w=w.firstChild);for(let w=u.content.lastChild;y<u.openEnd&&!w.type.spec.isolating;y++,w=w.lastChild);u=_g(u,p,y)}return n.someProp("transformPasted",p=>{u=p(u,n)}),u}const uE=/^(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 cE(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,l=[];if(n.forEach(u=>{if(!l)return;let f=i.findWrapping(u.type),h;if(!f)return l=null;if(h=l.length&&o.length&&xg(f,o,u,l[l.length-1],0))l[l.length-1]=h;else{l.length&&(l[l.length-1]=kg(l[l.length-1],o.length));let m=Sg(u,f);l.push(m),i=i.matchType(m.type),o=f}}),l)return L.from(l)}return n}function Sg(n,e,t=0){for(let r=e.length-1;r>=t;r--)n=e[r].create(null,L.from(n));return n}function xg(n,e,t,r,i){if(i<n.length&&i<e.length&&n[i]==e[i]){let o=xg(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(Sg(t,n,i+1))))}}function kg(n,e){if(e==0)return n;let t=n.content.replaceChild(n.childCount-1,kg(n.lastChild,e-1)),r=n.contentMatchAt(n.childCount).fillBefore(L.empty,!0);return n.copy(t.append(r))}function Oc(n,e,t,r,i,o){let l=e<0?n.firstChild:n.lastChild,u=l.content;return i<r-1&&(u=Oc(u,e,t,r,i+1,o)),i>=t&&(u=e<0?l.contentMatchAt(0).fillBefore(u,n.childCount>1||o<=i).append(u):u.append(l.contentMatchAt(l.childCount).fillBefore(L.empty,!0))),n.replaceChild(e<0?0:n.childCount-1,l.copy(u))}function _g(n,e,t){return e<n.openStart&&(n=new U(Oc(n.content,-1,e,n.openStart,0,n.openEnd),e,n.openEnd)),t<n.openEnd&&(n=new U(Oc(n.content,1,t,n.openEnd,0,0),n.openStart,t)),n}const Eg={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 Mg=null;function Tg(){return Mg||(Mg=document.implementation.createHTMLDocument("title"))}function fE(n){let e=/^(\s*<meta [^>]*>)*/.exec(n);e&&(n=n.slice(e[0].length));let t=Tg().createElement("div"),r=/<([a-z][^>\s]+)/i.exec(n),i;if((i=r&&Eg[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 hE(n){let e=n.querySelectorAll(Ti?"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 dE(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:l}=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++,l++}return new U(i,o,l)}const sn={},Tt={};function dr(n,e){n.input.lastSelectionOrigin=e,n.input.lastSelectionTime=Date.now()}Tt.keydown=(n,e)=>{let t=e;if(n.input.shiftKey=t.keyCode==16||t.shiftKey,!Ag(n,t)&&(n.input.lastKeyCode=t.keyCode,n.input.lastKeyCodeTime=Date.now(),!(Is&&Ti&&t.keyCode==13)))if(t.keyCode!=229&&n.domObserver.forceFlush(),kc&&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,ig(13,"Enter"))),n.input.lastIOSEnter=0)},200)}else n.someProp("handleKeyDown",r=>r(n,t))||lE(n,t)?t.preventDefault():dr(n,"key")},Tt.keyup=(n,e)=>{e.keyCode==16&&(n.input.shiftKey=!1)},Tt.keypress=(n,e)=>{let t=e;if(Ag(n,t)||!t.charCode||t.ctrlKey&&!t.altKey||Ht&&t.metaKey)return;if(n.someProp("handleKeyPress",i=>i(n,t))){t.preventDefault();return}let r=n.state.selection;if(!(r instanceof de)||!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 ba(n){return{left:n.clientX,top:n.clientY}}function pE(n,e){let t=e.x-n.clientX,r=e.y-n.clientY;return t*t+r*r<100}function Nc(n,e,t,r,i){if(r==-1)return!1;let o=n.state.doc.resolve(r);for(let l=o.depth+1;l>0;l--)if(n.someProp(e,u=>l>o.depth?u(n,t,o.nodeAfter,o.before(l),i,!0):u(n,t,o.node(l),o.before(l),i,!1)))return!0;return!1}function Ci(n,e,t){n.focused||n.focus();let r=n.state.tr.setSelection(e);r.setMeta("pointer",!0),n.dispatch(r)}function mE(n,e){if(e==-1)return!1;let t=n.state.doc.resolve(e),r=t.nodeAfter;return r&&r.isAtom&&Z.isSelectable(r)?(Ci(n,new Z(t)),!0):!1}function gE(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 l=o.depth+1;l>0;l--){let u=l>o.depth?o.nodeAfter:o.node(l);if(Z.isSelectable(u)){r&&t.$from.depth>0&&l>=t.$from.depth&&o.before(t.$from.depth+1)==t.$from.pos?i=o.before(t.$from.depth):i=o.before(l);break}}return i!=null?(Ci(n,Z.create(n.state.doc,i)),!0):!1}function yE(n,e,t,r,i){return Nc(n,"handleClickOn",e,t,r)||n.someProp("handleClick",o=>o(n,e,r))||(i?gE(n,t):mE(n,t))}function bE(n,e,t,r){return Nc(n,"handleDoubleClickOn",e,t,r)||n.someProp("handleDoubleClick",i=>i(n,e,r))}function vE(n,e,t,r){return Nc(n,"handleTripleClickOn",e,t,r)||n.someProp("handleTripleClick",i=>i(n,e,r))||wE(n,t,r)}function wE(n,e,t){if(t.button!=0)return!1;let r=n.state.doc;if(e==-1)return r.inlineContent?(Ci(n,de.create(r,0,r.content.size)),!0):!1;let i=r.resolve(e);for(let o=i.depth+1;o>0;o--){let l=o>i.depth?i.nodeAfter:i.node(o),u=i.before(o);if(l.inlineContent)Ci(n,de.create(r,u+1,u+1+l.content.size));else if(Z.isSelectable(l))Ci(n,Z.create(r,u));else continue;return!0}}function Rc(n){return va(n)}const Cg=Ht?"metaKey":"ctrlKey";sn.mousedown=(n,e)=>{let t=e;n.input.shiftKey=t.shiftKey;let r=Rc(n),i=Date.now(),o="singleClick";i-n.input.lastClick.time<500&&pE(t,n.input.lastClick)&&!t[Cg]&&(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 l=n.posAtCoords(ba(t));l&&(o=="singleClick"?(n.input.mouseDown&&n.input.mouseDown.done(),n.input.mouseDown=new SE(n,l,t,!!r)):(o=="doubleClick"?bE:vE)(n,l.pos,l.inside,t)?t.preventDefault():dr(n,"pointer"))};class SE{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[Cg],this.allowDefault=r.shiftKey;let o,l;if(t.inside>-1)o=e.state.doc.nodeAt(t.inside),l=t.inside;else{let m=e.state.doc.resolve(t.pos);o=m.parent,l=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<=l&&h.to>l)&&(this.mightDrag={node:o,pos:l,addAttr:!!(this.target&&!this.target.draggable),setUneditable:!!(this.target&&ga&&!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)),dr(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(()=>Ec(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(ba(e))),this.updateAllowDefault(e),this.allowDefault||!t?dr(this.view,"pointer"):yE(this.view,t.pos,t.inside,e,this.selectNode)?e.preventDefault():e.button==0&&(this.flushed||Fr&&this.mightDrag&&!this.mightDrag.node.isAtom||Ti&&!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)?(Ci(this.view,me.near(this.view.state.doc.resolve(t.pos))),e.preventDefault()):dr(this.view,"pointer")}move(e){this.updateAllowDefault(e),dr(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)}}sn.touchstart=n=>{n.input.lastTouch=Date.now(),Rc(n),dr(n,"pointer")},sn.touchmove=n=>{n.input.lastTouch=Date.now(),dr(n,"pointer")},sn.contextmenu=n=>Rc(n);function Ag(n,e){return n.composing?!0:Fr&&Math.abs(e.timeStamp-n.input.compositionEndedAt)<500?(n.input.compositionEndedAt=-2e8,!0):!1}const xE=Is?5e3:-1;Tt.compositionstart=Tt.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(),va(n,!0),n.markCursor=null;else if(va(n),ga&&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 l=o<0?i.lastChild:i.childNodes[o-1];if(!l)break;if(l.nodeType==3){n.domSelection().collapse(l,l.nodeValue.length);break}else i=l,o=-1}}n.input.composing=!0}Ig(n,xE)},Tt.compositionend=(n,e)=>{n.composing&&(n.input.composing=!1,n.input.compositionEndedAt=e.timeStamp,Ig(n,20))};function Ig(n,e){clearTimeout(n.input.composingTimeout),e>-1&&(n.input.composingTimeout=setTimeout(()=>va(n),e))}function kE(n){for(n.composing&&(n.input.composing=!1,n.input.compositionEndedAt=_E());n.input.compositionNodes.length>0;)n.input.compositionNodes.pop().markParentsDirty()}function _E(){let n=document.createEvent("Event");return n.initEvent("event",!0,!0),n.timeStamp}function va(n,e=!1){if(!(Is&&n.domObserver.flushingSoon>=0)){if(n.domObserver.forceFlush(),kE(n),e||n.docView&&n.docView.dirty){let t=tE(n);return t&&!t.eq(n.state.selection)?n.dispatch(n.state.tr.setSelection(t)):n.updateState(n.state),!0}return!1}}function EE(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 Ai=As&&ag<15||kc&&eE<604;sn.copy=Tt.cut=(n,e)=>{let t=e,r=n.state.selection,i=t.type=="cut";if(r.empty)return;let o=Ai?null:t.clipboardData,l=r.content(),{dom:u,text:f}=vg(n,l);o?(t.preventDefault(),o.clearData(),o.setData("text/html",u.innerHTML),o.setData("text/plain",f)):EE(n,u),i&&n.dispatch(n.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))};function ME(n){return n.openStart==0&&n.openEnd==0&&n.content.childCount==1?n.content.firstChild:null}function TE(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?Lc(n,r.value,null,e):Lc(n,r.textContent,r.innerHTML,e)},50)}function Lc(n,e,t,r){let i=wg(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=ME(i),l=o?n.state.tr.replaceSelectionWith(o,n.input.shiftKey):n.state.tr.replaceSelection(i);return n.dispatch(l.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste")),!0}Tt.paste=(n,e)=>{let t=e;if(n.composing&&!Is)return;let r=Ai?null:t.clipboardData;r&&Lc(n,r.getData("text/plain"),r.getData("text/html"),t)?t.preventDefault():TE(n,t)};class CE{constructor(e,t){this.slice=e,this.move=t}}const Og=Ht?"altKey":"ctrlKey";sn.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(ba(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 l=n.state.selection.content(),{dom:u,text:f}=vg(n,l);t.dataTransfer.clearData(),t.dataTransfer.setData(Ai?"Text":"text/html",u.innerHTML),t.dataTransfer.effectAllowed="copyMove",Ai||t.dataTransfer.setData("text/plain",f),n.dragging=new CE(l,!t[Og])},sn.dragend=n=>{let e=n.dragging;window.setTimeout(()=>{n.dragging==e&&(n.dragging=null)},50)},Tt.dragover=Tt.dragenter=(n,e)=>e.preventDefault(),Tt.drop=(n,e)=>{let t=e,r=n.dragging;if(n.dragging=null,!t.dataTransfer)return;let i=n.posAtCoords(ba(t));if(!i)return;let o=n.state.doc.resolve(i.pos),l=r&&r.slice;l?n.someProp("transformPasted",S=>{l=S(l,n)}):l=wg(n,t.dataTransfer.getData(Ai?"Text":"text/plain"),Ai?null:t.dataTransfer.getData("text/html"),!1,o);let u=!!(r&&!t[Og]);if(n.someProp("handleDrop",S=>S(n,t,l||U.empty,u))){t.preventDefault();return}if(!l)return;t.preventDefault();let f=l?H_(n.state.doc,o.pos,l):o.pos;f==null&&(f=o.pos);let h=n.state.tr;u&&h.deleteSelection();let m=h.mapping.map(f),p=l.openStart==0&&l.openEnd==0&&l.content.childCount==1,y=h.doc;if(p?h.replaceRangeWith(m,m,l.content.firstChild):h.replaceRange(m,m,l),h.doc.eq(y))return;let w=h.doc.resolve(m);if(p&&Z.isSelectable(l.content.firstChild)&&w.nodeAfter&&w.nodeAfter.sameMarkup(l.content.firstChild))h.setSelection(new Z(w));else{let S=h.mapping.map(f);h.mapping.maps[h.mapping.maps.length-1].forEach((M,T,I,F)=>S=F),h.setSelection(dg(n,w,h.doc.resolve(S)))}n.focus(),n.dispatch(h.setMeta("uiEvent","drop"))},sn.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())&&Ec(n)},20))},sn.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)},sn.beforeinput=(n,e)=>{if(Ti&&Is&&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,ig(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 Tt)sn[n]=Tt[n];function Ns(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 qf{constructor(e,t){this.toDOM=e,this.spec=t||$r,this.side=this.spec.side||0}map(e,t,r,i){let{pos:o,deleted:l}=e.mapResult(t.from+i,this.side<0?-1:1);return l?null:new wn(o-r,o-r,this)}valid(){return!0}eq(e){return this==e||e instanceof qf&&(this.spec.key&&this.spec.key==e.spec.key||this.toDOM==e.toDOM&&Ns(this.spec,e.spec))}destroy(e){this.spec.destroy&&this.spec.destroy(e)}}class Sr{constructor(e,t){this.attrs=e,this.spec=t||$r}map(e,t,r,i){let o=e.map(t.from+i,this.spec.inclusiveStart?-1:1)-r,l=e.map(t.to+i,this.spec.inclusiveEnd?1:-1)-r;return o>=l?null:new wn(o,l,this)}valid(e,t){return t.from<t.to}eq(e){return this==e||e instanceof Sr&&Ns(this.attrs,e.attrs)&&Ns(this.spec,e.spec)}static is(e){return e.type instanceof Sr}destroy(){}}class Jf{constructor(e,t){this.attrs=e,this.spec=t||$r}map(e,t,r,i){let o=e.mapResult(t.from+i,1);if(o.deleted)return null;let l=e.mapResult(t.to+i,-1);return l.deleted||l.pos<=o.pos?null:new wn(o.pos-r,l.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 Jf&&Ns(this.attrs,e.attrs)&&Ns(this.spec,e.spec)}destroy(){}}class wn{constructor(e,t,r){this.from=e,this.to=t,this.type=r}copy(e,t){return new wn(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 wn(e,e,new qf(t,r))}static inline(e,t,r,i){return new wn(e,t,new Sr(r,i))}static node(e,t,r,i){return new wn(e,t,new Jf(r,i))}get spec(){return this.type.spec}get inline(){return this.type instanceof Sr}}const Ii=[],$r={};class qe{constructor(e,t){this.local=e.length?e:Ii,this.children=t.length?t:Ii}static create(e,t){return t.length?wa(t,e,0,$r):ft}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 l=0;l<this.local.length;l++){let u=this.local[l];u.from<=t&&u.to>=e&&(!o||o(u.spec))&&r.push(u.copy(u.from+i,u.to+i))}for(let l=0;l<this.children.length;l+=3)if(this.children[l]<t&&this.children[l+1]>e){let u=this.children[l]+1;this.children[l+2].findInner(e-u,t-u,r,i+u,o)}}map(e,t,r){return this==ft||e.maps.length==0?this:this.mapInner(e,t,0,0,r||$r)}mapInner(e,t,r,i,o){let l;for(let u=0;u<this.local.length;u++){let f=this.local[u].map(e,r,i);f&&f.type.valid(t,f)?(l||(l=[])).push(f):o.onRemove&&o.onRemove(this.local[u].spec)}return this.children.length?AE(this.children,l||[],e,t,r,i,o):l?new qe(l.sort(Wr),Ii):ft}add(e,t){return t.length?this==ft?qe.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=Rg(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,wa(m,u,h+1,$r)),o+=3}});let l=Ng(o?Lg(t):t,-r);for(let u=0;u<l.length;u++)l[u].type.valid(e,l[u])||l.splice(u--,1);return new qe(l.length?this.local.concat(l).sort(Wr):this.local,i||this.children)}remove(e){return e.length==0||this==ft?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 l,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,(l||(l=[])).push(p));if(!l)continue;r==this.children&&(r=this.children.slice());let h=r[o+2].removeInner(l,u+1);h!=ft?r[o+2]=h:(r.splice(o,3),o-=3)}if(i.length){for(let o=0,l;o<e.length;o++)if(l=e[o])for(let u=0;u<i.length;u++)i[u].eq(l,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 qe(i,r):ft}forChild(e,t){if(this==ft)return this;if(t.isLeaf)return qe.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,l=o+t.content.size;for(let u=0;u<this.local.length;u++){let f=this.local[u];if(f.from<l&&f.to>o&&f.type instanceof Sr){let h=Math.max(o,f.from)-o,m=Math.min(l,f.to)-o;h<m&&(i||(i=[])).push(f.copy(h,m))}}if(i){let u=new qe(i.sort(Wr),Ii);return r?new Zr([u,r]):u}return r||ft}eq(e){if(this==e)return!0;if(!(e instanceof qe)||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 Pc(this.localsInner(e))}localsInner(e){if(this==ft)return Ii;if(e.inlineContent||!this.local.some(Sr.is))return this.local;let t=[];for(let r=0;r<this.local.length;r++)this.local[r].type instanceof Sr||t.push(this.local[r]);return t}}qe.empty=new qe([],[]),qe.removeOverlap=Pc;const ft=qe.empty;class Zr{constructor(e){this.members=e}map(e,t){const r=this.members.map(i=>i.map(e,t,$r));return Zr.from(r)}forChild(e,t){if(t.isLeaf)return qe.empty;let r=[];for(let i=0;i<this.members.length;i++){let o=this.members[i].forChild(e,t);o!=ft&&(o instanceof Zr?r=r.concat(o.members):r.push(o))}return Zr.from(r)}eq(e){if(!(e instanceof Zr)||e.members.length!=this.members.length)return!1;for(let t=0;t<this.members.length;t++)if(!this.members[t].eq(e.members[t]))return!1;return!0}locals(e){let t,r=!0;for(let i=0;i<this.members.length;i++){let o=this.members[i].localsInner(e);if(o.length)if(!t)t=o;else{r&&(t=t.slice(),r=!1);for(let l=0;l<o.length;l++)t.push(o[l])}}return t?Pc(r?t:t.sort(Wr)):Ii}static from(e){switch(e.length){case 0:return ft;case 1:return e[0];default:return new Zr(e.every(t=>t instanceof qe)?e:e.reduce((t,r)=>t.concat(r instanceof qe?r:r.members),[]))}}}function AE(n,e,t,r,i,o,l){let u=n.slice();for(let h=0,m=o;h<t.maps.length;h++){let p=0;t.maps[h].forEach((y,w,S,M)=>{let T=M-S-(w-y);for(let I=0;I<u.length;I+=3){let F=u[I+1];if(F<0||y>F+m-p)continue;let B=u[I]+m-p;w>=B?u[I+1]=y<=B?-2:-1:S>=i&&T&&(u[I]+=T,u[I+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),w=y-i,{index:S,offset:M}=r.content.findIndex(p),T=r.maybeChild(S);if(T&&M==p&&M+T.nodeSize==w){let I=u[h+2].mapInner(t,T,m+1,n[h]+o+1,l);I!=ft?(u[h]=p,u[h+1]=w,u[h+2]=I):(u[h+1]=-2,f=!0)}else f=!0}if(f){let h=IE(u,n,e,t,i,o,l),m=wa(h,r,0,l);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 w=m.children[p];for(;y<u.length&&u[y]<w;)y+=3;u.splice(y,0,m.children[p],m.children[p+1],m.children[p+2])}}return new qe(e.sort(Wr),u)}function Ng(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 wn(i.from+e,i.to+e,i.type))}return t}function IE(n,e,t,r,i,o,l){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):l.onRemove&&l.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 Rg(n,e,t){if(e.isLeaf)return null;let r=t+e.nodeSize,i=null;for(let o=0,l;o<n.length;o++)(l=n[o])&&l.from>t&&l.to<r&&((i||(i=[])).push(l),n[o]=null);return i}function Lg(n){let e=[];for(let t=0;t<n.length;t++)n[t]!=null&&e.push(n[t]);return e}function wa(n,e,t,r){let i=[],o=!1;e.forEach((u,f)=>{let h=Rg(n,u,f+t);if(h){o=!0;let m=wa(h,u,t+f+1,r);m!=ft&&i.push(f,f+u.nodeSize,m)}});let l=Ng(o?Lg(n):n,-t).sort(Wr);for(let u=0;u<l.length;u++)l[u].type.valid(e,l[u])||(r.onRemove&&r.onRemove(l[u].spec),l.splice(u--,1));return l.length||i.length?new qe(l,i):ft}function Wr(n,e){return n.from-e.from||n.to-e.to}function Pc(n){let e=n;for(let t=0;t<e.length-1;t++){let r=e[t];if(r.from!=r.to)for(let i=t+1;i<e.length;i++){let o=e[i];if(o.from==r.from){o.to!=r.to&&(e==n&&(e=n.slice()),e[i]=o.copy(o.from,r.to),Pg(e,i+1,o.copy(r.to,o.to)));continue}else{o.from<r.to&&(e==n&&(e=n.slice()),e[t]=r.copy(r.from,o.from),Pg(e,i,r.copy(o.from,r.to)));break}}}return e}function Pg(n,e,t){for(;e<n.length&&Wr(t,n[e])>0;)e++;n.splice(e,0,t)}for(var pr={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:"'"},Sa={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},Dg=typeof navigator<"u"&&/Chrome\/(\d+)/.exec(navigator.userAgent),OE=typeof navigator<"u"&&/Mac/.test(navigator.platform),NE=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),RE=OE||Dg&&+Dg[1]<57,Qe=0;Qe<10;Qe++)pr[48+Qe]=pr[96+Qe]=String(Qe);for(var Qe=1;Qe<=24;Qe++)pr[Qe+111]="F"+Qe;for(var Qe=65;Qe<=90;Qe++)pr[Qe]=String.fromCharCode(Qe+32),Sa[Qe]=String.fromCharCode(Qe);for(var Dc in pr)Sa.hasOwnProperty(Dc)||(Sa[Dc]=pr[Dc]);function LE(n){var e=RE&&(n.ctrlKey||n.altKey||n.metaKey)||NE&&n.shiftKey&&n.key&&n.key.length==1||n.key=="Unidentified",t=!e&&n.key||(n.shiftKey?Sa:pr)[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 PE=typeof navigator<"u"?/Mac|iP(hone|[oa]d)/.test(navigator.platform):!1;function DE(n){let e=n.split(/-(?!$)/),t=e[e.length-1];t=="Space"&&(t=" ");let r,i,o,l;for(let u=0;u<e.length-1;u++){let f=e[u];if(/^(cmd|meta|m)$/i.test(f))l=!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))PE?l=!0:i=!0;else throw new Error("Unrecognized modifier name: "+f)}return r&&(t="Alt-"+t),i&&(t="Ctrl-"+t),l&&(t="Meta-"+t),o&&(t="Shift-"+t),t}function zE(n){let e=Object.create(null);for(let t in n)e[DE(t)]=n[t];return e}function zc(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 BE(n){return new Mt({props:{handleKeyDown:FE(n)}})}function FE(n){let e=zE(n);return function(t,r){let i=LE(r),o=i.length==1&&i!=" ",l,u=e[zc(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)&&(l=pr[r.keyCode])&&l!=i){let f=e[zc(l,r,!0)];if(f&&f(t.state,t.dispatch,t))return!0}else if(o&&r.shiftKey){let f=e[zc(i,r,!0)];if(f&&f(t.state,t.dispatch,t))return!0}return!1}}const Bc=(n,e)=>n.selection.empty?!1:(e&&e(n.tr.deleteSelection().scrollIntoView()),!0);function HE(n,e){let{$cursor:t}=n.selection;return!t||(e?!e.endOfTextblock("backward",n):t.parentOffset>0)?null:t}const zg=(n,e,t)=>{let r=HE(n,t);if(!r)return!1;let i=Fg(r);if(!i){let l=r.blockRange(),u=l&&_i(l);return u==null?!1:(e&&e(n.tr.lift(l,u).scrollIntoView()),!0)}let o=i.nodeBefore;if(!o.type.spec.isolating&&Gg(n,i,e))return!0;if(r.parent.content.size==0&&(Oi(o,"end")||Z.isSelectable(o))){let l=mc(n.doc,r.before(),r.after(),U.empty);if(l&&l.slice.size<l.to-l.from){if(e){let u=n.tr.step(l);u.setSelection(Oi(o,"end")?me.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 Oi(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 Bg=(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=Fg(r)}let l=o&&o.nodeBefore;return!l||!Z.isSelectable(l)?!1:(e&&e(n.tr.setSelection(Z.create(n.doc,o.pos-l.nodeSize)).scrollIntoView()),!0)};function Fg(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 $E(n,e){let{$cursor:t}=n.selection;return!t||(e?!e.endOfTextblock("forward",n):t.parentOffset<t.parent.content.size)?null:t}const Hg=(n,e,t)=>{let r=$E(n,t);if(!r)return!1;let i=Wg(r);if(!i)return!1;let o=i.nodeAfter;if(Gg(n,i,e))return!0;if(r.parent.content.size==0&&(Oi(o,"start")||Z.isSelectable(o))){let l=mc(n.doc,r.before(),r.after(),U.empty);if(l&&l.slice.size<l.to-l.from){if(e){let u=n.tr.step(l);u.setSelection(Oi(o,"start")?me.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},$g=(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=Wg(r)}let l=o&&o.nodeAfter;return!l||!Z.isSelectable(l)?!1:(e&&e(n.tr.setSelection(Z.create(n.doc,o.pos)).scrollIntoView()),!0)};function Wg(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 WE=(n,e)=>{let t=n.selection,r=t instanceof Z,i;if(r){if(t.node.isTextblock||!cr(n.doc,t.from))return!1;i=t.from}else if(i=da(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},UE=(n,e)=>{let t=n.selection,r;if(t instanceof Z){if(t.node.isTextblock||!cr(n.doc,t.to))return!1;r=t.to}else if(r=da(n.doc,t.to,1),r==null)return!1;return e&&e(n.tr.join(r).scrollIntoView()),!0},VE=(n,e)=>{let{$from:t,$to:r}=n.selection,i=t.blockRange(r),o=i&&_i(i);return o==null?!1:(e&&e(n.tr.lift(i,o).scrollIntoView()),!0)},Ug=(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 Fc(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 KE=(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),l=Fc(i.contentMatchAt(o));if(!l||!i.canReplaceWith(o,o,l))return!1;if(e){let u=t.after(),f=n.tr.replaceWith(u,u,l.createAndFill());f.setSelection(me.near(f.doc.resolve(u),1)),e(f.scrollIntoView())}return!0},Vg=(n,e)=>{let t=n.selection,{$from:r,$to:i}=t;if(t instanceof Vt||r.parent.inlineContent||i.parent.inlineContent)return!1;let o=Fc(i.parent.contentMatchAt(i.indexAfter()));if(!o||!o.isTextblock)return!1;if(e){let l=(!r.parentOffset&&i.index()<i.parent.childCount?r:i).pos,u=n.tr.insert(l,o.createAndFill());u.setSelection(de.create(u.doc,l+1)),e(u.scrollIntoView())}return!0},Kg=(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(zn(n.doc,o))return e&&e(n.tr.split(o).scrollIntoView()),!0}let r=t.blockRange(),i=r&&_i(r);return i==null?!1:(e&&e(n.tr.lift(r,i).scrollIntoView()),!0)};function GE(n){return(e,t)=>{let{$from:r,$to:i}=e.selection;if(e.selection instanceof Z&&e.selection.node.isBlock)return!r.parentOffset||!zn(e.doc,r.pos)?!1:(t&&t(e.tr.split(r.pos).scrollIntoView()),!0);if(!r.parent.isBlock)return!1;if(t){let o=i.parentOffset==i.parent.content.size,l=e.tr;(e.selection instanceof de||e.selection instanceof Vt)&&l.deleteSelection();let u=r.depth==0?null:Fc(r.node(-1).contentMatchAt(r.indexAfter(-1))),f=o&&u?[{type:u}]:void 0,h=zn(l.doc,l.mapping.map(r.pos),1,f);if(!f&&!h&&zn(l.doc,l.mapping.map(r.pos),1,u?[{type:u}]:void 0)&&(u&&(f=[{type:u}]),h=!0),h&&(l.split(l.mapping.map(r.pos),1,f),!o&&!r.parentOffset&&r.parent.type!=u)){let m=l.mapping.map(r.before()),p=l.doc.resolve(m);u&&r.node(-1).canReplaceWith(p.index(),p.index()+1,u)&&l.setNodeMarkup(l.mapping.map(r.before()),u)}t(l.scrollIntoView())}return!0}}const qE=GE(),JE=(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 jE(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||cr(n.doc,e.pos))?!1:(t&&t(n.tr.clearIncompatible(e.pos,r.type,r.contentMatchAt(r.childCount)).join(e.pos).scrollIntoView()),!0)}function Gg(n,e,t){let r=e.nodeBefore,i=e.nodeAfter,o,l;if(r.type.spec.isolating||i.type.spec.isolating)return!1;if(jE(n,e,t))return!0;let u=e.parent.canReplace(e.index(),e.index()+1);if(u&&(o=(l=r.contentMatchAt(r.childCount)).findWrapping(i.type))&&l.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 w=n.tr.step(new Ge(e.pos-1,p,e.pos,p,new U(y,1,0),o.length,!0)),S=p+2*o.length;cr(w.doc,S)&&w.join(S),t(w.scrollIntoView())}return!0}let f=me.findFrom(e,1),h=f&&f.$from.blockRange(f.$to),m=h&&_i(h);if(m!=null&&m>=e.depth)return t&&t(n.tr.lift(h,m).scrollIntoView()),!0;if(u&&Oi(i,"start",!0)&&Oi(r,"end")){let p=r,y=[];for(;y.push(p),!p.isTextblock;)p=p.lastChild;let w=i,S=1;for(;!w.isTextblock;w=w.firstChild)S++;if(p.canReplace(p.childCount,p.childCount,w.content)){if(t){let M=L.empty;for(let I=y.length-1;I>=0;I--)M=L.from(y[I].copy(M));let T=n.tr.step(new Ge(e.pos-y.length,e.pos+i.nodeSize,e.pos+S,e.pos+i.nodeSize-S,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(de.create(e.doc,n<0?i.start(o):i.end(o)))),!0):!1}}const YE=qg(-1),XE=qg(1);function ZE(n,e=null){return function(t,r){let{$from:i,$to:o}=t.selection,l=i.blockRange(o),u=l&&pc(l,n,e);return u?(r&&r(t.tr.wrap(l,u).scrollIntoView()),!0):!1}}function Jg(n,e=null){return function(t,r){let i=!1;for(let o=0;o<t.selection.ranges.length&&!i;o++){let{$from:{pos:l},$to:{pos:u}}=t.selection.ranges[o];t.doc.nodesBetween(l,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 l=0;l<t.selection.ranges.length;l++){let{$from:{pos:u},$to:{pos:f}}=t.selection.ranges[l];o.setBlockType(u,f,n,e)}r(o.scrollIntoView())}return!0}}function Hc(...n){return function(e,t,r){for(let i=0;i<n.length;i++)if(n[i](e,t,r))return!0;return!1}}Hc(Bc,zg,Bg),Hc(Bc,Hg,$g),Hc(Ug,Vg,Kg,qE),typeof navigator<"u"?/Mac|iP(hone|[oa]d)/.test(navigator.platform):typeof os<"u"&&os.platform&&os.platform()=="darwin";function QE(n,e=null){return function(t,r){let{$from:i,$to:o}=t.selection,l=i.blockRange(o),u=!1,f=l;if(!l)return!1;if(l.depth>=2&&i.node(l.depth-1).type.compatibleContent(n)&&l.startIndex==0){if(i.index(l.depth-1)==0)return!1;let m=t.doc.resolve(l.start-2);f=new la(m,m,l.depth),l.endIndex<l.parent.childCount&&(l=new la(i,t.doc.resolve(o.end(l.depth)),l.depth)),u=!0}let h=pc(f,n,e,l);return h?(r&&r(eM(t.tr,l,h,u,n).scrollIntoView()),!0):!1}}function eM(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 Ge(e.start-(r?2:0),e.end,e.start,e.end,new U(o,0,0),t.length,!0));let l=0;for(let m=0;m<t.length;m++)t[m].type==i&&(l=m+1);let u=t.length-l,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&&zn(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,l=>l.childCount>0&&l.firstChild.type==n);return o?t?r.node(o.depth-1).type==n?nM(e,t,n,o):rM(e,t,o):!0:!1}}function nM(n,e,t,r){let i=n.tr,o=r.end,l=r.$to.end(r.depth);o<l&&(i.step(new Ge(o-1,l,o,l,new U(L.from(t.create(null,r.parent.copy())),1,0),1,!0)),r=new la(i.doc.resolve(r.$from.pos),i.doc.resolve(l),r.depth));const u=_i(r);if(u==null)return!1;i.lift(r,u);let f=i.mapping.map(o,-1)-1;return cr(i.doc,f)&&i.join(f),e(i.scrollIntoView()),!0}function rM(n,e,t){let r=n.tr,i=t.parent;for(let w=t.end,S=t.endIndex-1,M=t.startIndex;S>M;S--)w-=i.child(S).nodeSize,r.delete(w-1,w+1);let o=r.doc.resolve(t.start),l=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,l.content.append(f?L.empty:L.from(i))))return!1;let p=o.pos,y=p+l.nodeSize;return r.step(new Ge(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 iM(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 l=o.startIndex;if(l==0)return!1;let u=o.parent,f=u.child(l-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,w=o.end;t(e.tr.step(new Ge(y-(h?3:1),w,y,w,p,1,!0)).scrollIntoView())}return!0}}function xa(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 $c{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,l=this.buildProps(o);return Object.fromEntries(Object.entries(e).map(([u,f])=>[u,(...m)=>{const p=f(...m)(l);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:l}=i,u=[],f=!!e,h=e||o.tr,m=()=>(!f&&t&&!h.getMeta("preventDispatch")&&!this.hasCustomState&&l.dispatch(h),u.every(y=>y===!0)),p={...Object.fromEntries(Object.entries(r).map(([y,w])=>[y,(...M)=>{const T=this.buildProps(h,t),I=w(...M)(T);return u.push(I),p}])),run:m};return p}createCan(e){const{rawCommands:t,state:r}=this,i=!1,o=e||r.tr,l=this.buildProps(o,i);return{...Object.fromEntries(Object.entries(t).map(([f,h])=>[f,(...m)=>h(...m)({...l,dispatch:void 0})])),chain:()=>this.createChain(o,i)}}buildProps(e,t=!0){const{rawCommands:r,editor:i,state:o}=this,{view:l}=i,u={tr:e,editor:i,view:l,state:xa({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 ka(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 jg(n){const e=[],{nodeExtensions:t,markExtensions:r}=ka(n),i=[...t,...r],o={default:null,rendered:!0,renderHTML:null,parseHTML:null,keepOnSplit:!0,isRequired:!1};return n.forEach(l=>{const u={name:l.name,options:l.options,storage:l.storage},f=V(l,"addGlobalAttributes",u);if(!f)return;f().forEach(m=>{m.types.forEach(p=>{Object.entries(m.attributes).forEach(([y,w])=>{e.push({type:p,name:y,attribute:{...o,...w}})})})})}),i.forEach(l=>{const u={name:l.name,options:l.options,storage:l.storage},f=V(l,"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:l.name,name:m,attribute:y})})}),e}function Ue(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 Ni(...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 Wc(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)=>Ni(t,r),{})}function sM(n){return typeof n=="function"}function le(n,e=void 0,...t){return sM(n)?e?n.bind(e)(...t):n(...t):n}function oM(n={}){return Object.keys(n).length===0&&n.constructor===Object}function aM(n){return typeof n!="string"?n:n.match(/^[+-]?(?:\d*\.)?\d+$/)?Number(n):n==="true"?!0:n==="false"?!1:n}function Yg(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,l)=>{const u=l.attribute.parseHTML?l.attribute.parseHTML(t):aM(t.getAttribute(l.name));return u==null?o:{...o,[l.name]:u}},{});return{...r,...i}}}}function Xg(n){return Object.fromEntries(Object.entries(n).filter(([e,t])=>e==="attrs"&&oM(t)?!1:t!=null))}function Zg(n,e){var t;const r=jg(n),{nodeExtensions:i,markExtensions:o}=ka(n),l=(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(I=>I.type===h.name),p={name:h.name,options:h.options,storage:h.storage,editor:e},y=n.reduce((I,F)=>{const B=V(F,"extendNodeSchema",p);return{...I,...B?B(h):{}}},{}),w=Xg({...y,content:le(V(h,"content",p)),marks:le(V(h,"marks",p)),group:le(V(h,"group",p)),inline:le(V(h,"inline",p)),atom:le(V(h,"atom",p)),selectable:le(V(h,"selectable",p)),draggable:le(V(h,"draggable",p)),code:le(V(h,"code",p)),defining:le(V(h,"defining",p)),isolating:le(V(h,"isolating",p)),attrs:Object.fromEntries(m.map(I=>{var F;return[I.name,{default:(F=I?.attribute)===null||F===void 0?void 0:F.default}]}))}),S=le(V(h,"parseHTML",p));S&&(w.parseDOM=S.map(I=>Yg(I,m)));const M=V(h,"renderHTML",p);M&&(w.toDOM=I=>M({node:I,HTMLAttributes:Wc(I,m)}));const T=V(h,"renderText",p);return T&&(w.toText=T),[h.name,w]})),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,I)=>{const F=V(I,"extendMarkSchema",p);return{...T,...F?F(h):{}}},{}),w=Xg({...y,inclusive:le(V(h,"inclusive",p)),excludes:le(V(h,"excludes",p)),group:le(V(h,"group",p)),spanning:le(V(h,"spanning",p)),code:le(V(h,"code",p)),attrs:Object.fromEntries(m.map(T=>{var I;return[T.name,{default:(I=T?.attribute)===null||I===void 0?void 0:I.default}]}))}),S=le(V(h,"parseHTML",p));S&&(w.parseDOM=S.map(T=>Yg(T,m)));const M=V(h,"renderHTML",p);return M&&(w.toDOM=T=>M({mark:T,HTMLAttributes:Wc(T,m)})),[h.name,w]}));return new y_({topNode:l,nodes:u,marks:f})}function Uc(n,e){return e.nodes[n]||e.marks[n]||null}function Qg(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,l,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:l,index:u}))||i.textContent||"%leaf%";t+=m.slice(0,Math.max(0,r-o))}),t};function Vc(n){return Object.prototype.toString.call(n)==="[object RegExp]"}class e0{constructor(e){this.find=e.find,this.handler=e.handler}}const uM=(n,e)=>{if(Vc(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 Kc(n){var e;const{editor:t,from:r,to:i,text:o,rules:l,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 l.forEach(y=>{if(m)return;const w=uM(p,y.find);if(!w)return;const S=f.state.tr,M=xa({state:f.state,transaction:S}),T={from:r-(w[0].length-o.length),to:i},{commands:I,chain:F,can:B}=new $c({editor:t,state:M});y.handler({state:M,range:T,match:w,commands:I,chain:F,can:B})===null||!S.steps.length||(S.setMeta(u,{transform:S,from:r,to:i,text:o}),f.dispatch(S),m=!0)}),m}function cM(n){const{editor:e,rules:t}=n,r=new Mt({state:{init(){return null},apply(i,o){const l=i.getMeta(r);return l||(i.selectionSet||i.docChanged?null:o)}},props:{handleTextInput(i,o,l,u){return Kc({editor:e,from:o,to:l,text:u,rules:t,plugin:r})},handleDOMEvents:{compositionend:i=>(setTimeout(()=>{const{$cursor:o}=i.state.selection;o&&Kc({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:l}=i.state.selection;return l?Kc({editor:e,from:l.pos,to:l.pos,text:`
|
|
13
|
+
`,rules:t,plugin:r}):!1}},isInputRules:!0});return r}function fM(n){return typeof n=="number"}class hM{constructor(e){this.find=e.find,this.handler=e.handler}}const dM=(n,e)=>{if(Vc(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 pM(n){const{editor:e,state:t,from:r,to:i,rule:o,pasteEvent:l,dropEvent:u}=n,{commands:f,chain:h,can:m}=new $c({editor:e,state:t}),p=[];return t.doc.nodesBetween(r,i,(w,S)=>{if(!w.isTextblock||w.type.spec.code)return;const M=Math.max(r,S),T=Math.min(i,S+w.content.size),I=w.textBetween(M-S,T-S,void 0,"\uFFFC");dM(I,o.find).forEach(B=>{if(B.index===void 0)return;const $=M+B.index+1,X=$+B[0].length,q={from:t.tr.mapping.map($),to:t.tr.mapping.map(X)},ie=o.handler({state:t,range:q,match:B,commands:f,chain:h,can:m,pasteEvent:l,dropEvent:u});p.push(ie)})}),p.every(w=>w!==null)}function mM(n){const{editor:e,rules:t}=n;let r=null,i=!1,o=!1,l=new ClipboardEvent("paste"),u=new DragEvent("drop");return t.map(h=>new Mt({view(m){const p=y=>{var w;r=!((w=m.dom.parentElement)===null||w===void 0)&&w.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 w=(y=p.clipboardData)===null||y===void 0?void 0:y.getData("text/html");return l=p,i=!!w?.includes("data-pm-slice"),!1}}},appendTransaction:(m,p,y)=>{const w=m[0],S=w.getMeta("uiEvent")==="paste"&&!i,M=w.getMeta("uiEvent")==="drop"&&!o;if(!S&&!M)return;const T=p.doc.content.findDiffStart(y.doc.content),I=p.doc.content.findDiffEnd(y.doc.content);if(!fM(T)||!I||T===I.b)return;const F=y.tr,B=xa({state:y,transaction:F});if(!(!pM({editor:e,state:B,from:Math.max(T-1,0),to:I.b-1,rule:h,pasteEvent:l,dropEvent:u})||!F.steps.length))return u=new DragEvent("drop"),l=new ClipboardEvent("paste"),F}}))}function gM(n){const e=n.filter((t,r)=>n.indexOf(t)!==r);return[...new Set(e)]}class Wi{constructor(e,t){this.splittableMarks=[],this.editor=t,this.extensions=Wi.resolve(e),this.schema=Zg(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:Uc(r.name,this.schema)};r.type==="mark"&&(!((i=le(V(r,"keepOnSplit",o)))!==null&&i!==void 0)||i)&&this.splittableMarks.push(r.name);const l=V(r,"onBeforeCreate",o);l&&this.editor.on("beforeCreate",l);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 w=V(r,"onDestroy",o);w&&this.editor.on("destroy",w)})}static resolve(e){const t=Wi.sort(Wi.flatten(e)),r=gM(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,l=V(i,"priority")||100;return o>l?-1:o<l?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:Uc(t.name,this.schema)},i=V(t,"addCommands",r);return i?{...e,...i()}:e},{})}get plugins(){const{editor:e}=this,t=Wi.sort([...this.extensions].reverse()),r=[],i=[],o=t.map(l=>{const u={name:l.name,options:l.options,storage:l.storage,editor:e,type:Uc(l.name,this.schema)},f=[],h=V(l,"addKeyboardShortcuts",u);let m={};if(l.type==="mark"&&l.config.exitable&&(m.ArrowRight=()=>Ct.handleExit({editor:e,mark:l})),h){const M=Object.fromEntries(Object.entries(h()).map(([T,I])=>[T,()=>I({editor:e})]));m={...m,...M}}const p=BE(m);f.push(p);const y=V(l,"addInputRules",u);Qg(l,e.options.enableInputRules)&&y&&r.push(...y());const w=V(l,"addPasteRules",u);Qg(l,e.options.enablePasteRules)&&w&&i.push(...w());const S=V(l,"addProseMirrorPlugins",u);if(S){const M=S();f.push(...M)}return f}).flat();return[cM({editor:e,rules:r}),...mM({editor:e,rules:i}),...o]}get attributes(){return jg(this.extensions)}get nodeViews(){const{editor:e}=this,{nodeExtensions:t}=ka(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:Ue(r.name,this.schema)},l=V(r,"addNodeView",o);if(!l)return[];const u=(f,h,m,p)=>{const y=Wc(f,i);return l()({editor:e,node:f,getPos:m,decorations:p,HTMLAttributes:y,extension:r})};return[r.name,u]}))}}function yM(n){return Object.prototype.toString.call(n).slice(8,-1)}function Gc(n){return yM(n)!=="Object"?!1:n.constructor===Object&&Object.getPrototypeOf(n)===Object.prototype}function _a(n,e){const t={...n};return Gc(n)&&Gc(e)&&Object.keys(e).forEach(r=>{Gc(e[r])?r in n?t[r]=_a(n[r],e[r]):Object.assign(t,{[r]:e[r]}):Object.assign(t,{[r]:e[r]})}),t}class Ne{constructor(e={}){this.type="extension",this.name="extension",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...e},this.name=this.config.name,e.defaultOptions&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=le(V(this,"addOptions",{name:this.name}))),this.storage=le(V(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(e={}){return new Ne(e)}configure(e={}){const t=this.extend();return t.options=_a(this.options,e),t.storage=le(V(t,"addStorage",{name:t.name,options:t.options})),t}extend(e={}){const t=new Ne(e);return t.parent=this,this.child=t,t.name=e.name?e.name:t.parent.name,e.defaultOptions&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${t.name}".`),t.options=le(V(t,"addOptions",{name:t.name})),t.storage=le(V(t,"addStorage",{name:t.name,options:t.options})),t}}function bM(n,e,t){const{from:r,to:i}=e,{blockSeparator:o=`
|
|
14
14
|
|
|
15
|
-
`,textSerializers:l={}}=t||{};let u="",f=!0;return n.nodesBetween(r,i,(h,m,p,y)=>{var S;const w=l?.[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 bM(n){return Object.fromEntries(Object.entries(n.nodes).filter(([,e])=>e.spec.toText).map(([e,t])=>[e,t.spec.toText]))}Ne.create({name:"clipboardTextSerializer",addProseMirrorPlugins(){return[new Mt({key:new rn("clipboardTextSerializer"),props:{clipboardTextSerializer:()=>{const{editor:n}=this,{state:e,schema:t}=n,{doc:r,selection:i}=e,{ranges:o}=i,l=Math.min(...o.map(m=>m.$from.pos)),u=Math.max(...o.map(m=>m.$to.pos)),f=bM(t);return yM(r,{from:l,to:u},{textSerializers:f})}}})]}});const vM=()=>({editor:n,view:e})=>(requestAnimationFrame(()=>{var t;n.isDestroyed||(e.dom.blur(),(t=window?.getSelection())===null||t===void 0||t.removeAllRanges())}),!0),SM=(n=!1)=>({commands:e})=>e.setContent("",n),wM=()=>({state:n,tr:e,dispatch:t})=>{const{selection:r}=e,{ranges:i}=r;return t&&i.forEach(({$from:o,$to:l})=>{n.doc.nodesBetween(o.pos,l.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=_i(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},xM=n=>e=>n(e),kM=()=>({state:n,dispatch:e})=>Ug(n,e),_M=(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 l=r.mapping.map(e);return r.insert(l,o.content),r.setSelection(new de(r.doc.resolve(l-1))),!0},EM=()=>({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},MM=n=>({tr:e,state:t,dispatch:r})=>{const i=Ue(n,t.schema),o=e.selection.$anchor;for(let l=o.depth;l>0;l-=1)if(o.node(l).type===i){if(r){const f=o.before(l),h=o.after(l);e.delete(f,h).scrollIntoView()}return!0}return!1},TM=n=>({tr:e,dispatch:t})=>{const{from:r,to:i}=n;return t&&e.delete(r,i),!0},CM=()=>({state:n,dispatch:e})=>Bc(n,e),AM=()=>({commands:n})=>n.keyboardShortcut("Enter"),IM=()=>({state:n,dispatch:e})=>VE(n,e);function Ea(n,e,t={strict:!0}){const r=Object.keys(e);return r.length?r.every(i=>t.strict?e[i]===n[i]:Vc(e[i])?e[i].test(n[i]):e[i]===n[i]):!0}function qc(n,e,t={}){return n.find(r=>r.type===e&&Ea(r.attrs,t))}function OM(n,e,t={}){return!!qc(n,e,t)}function Jc(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=qc([...r.node.marks],e,t);if(!i)return;let o=r.index,l=n.start()+r.offset,u=o+1,f=l+r.node.nodeSize;for(qc([...r.node.marks],e,t);o>0&&i.isInSet(n.parent.child(o-1).marks);)o-=1,l-=n.parent.child(o).nodeSize;for(;u<n.parent.childCount&&OM([...n.parent.child(u).marks],e,t);)f+=n.parent.child(u).nodeSize,u+=1;return{from:l,to:f}}function dn(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 NM=(n,e={})=>({tr:t,state:r,dispatch:i})=>{const o=dn(n,r.schema),{doc:l,selection:u}=t,{$from:f,from:h,to:m}=u;if(i){const p=Jc(f,o,e);if(p&&p.from<=h&&p.to>=m){const y=de.create(l,p.from,p.to);t.setSelection(y)}}return!0},RM=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 e0(n){return n instanceof de}function Ur(n=0,e=0,t=0){return Math.min(Math.max(n,e),t)}function LM(n,e=null){if(!e)return null;const t=me.atStart(n),r=me.atEnd(n);if(e==="start"||e===!0)return t;if(e==="end")return r;const i=t.from,o=r.to;return e==="all"?de.create(n,Ur(0,i,o),Ur(n.content.size,i,o)):de.create(n,Ur(e,i,o),Ur(e,i,o))}function jc(){return["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document}const PM=(n=null,e={})=>({editor:t,view:r,tr:i,dispatch:o})=>{e={scrollIntoView:!0,...e};const l=()=>{jc()&&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&&!e0(t.state.selection))return l(),!0;const u=LM(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),l()),!0},DM=(n,e)=>t=>n.every((r,i)=>e(r,{...t,index:i})),zM=(n,e)=>({tr:t,commands:r})=>r.insertContentAt({from:t.selection.from,to:t.selection.to},n,e);function t0(n){const e=`<body>${n}</body>`;return new window.DOMParser().parseFromString(e,"text/html").body}function Ma(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),Ma("",e,t)}if(typeof n=="string"){const r=lc.fromSchema(e);return t.slice?r.parseSlice(t0(n),t.parseOptions).content:r.parse(t0(n),t.parseOptions)}return Ma("",e,t)}function BM(n,e,t){const r=n.steps.length-1;if(r<e)return;const i=n.steps[r];if(!(i instanceof it||i instanceof Ge))return;const o=n.mapping.maps[r];let l=0;o.forEach((u,f,h,m)=>{l===0&&(l=m)}),n.setSelection(me.near(n.doc.resolve(l),t))}const FM=n=>n.toString().startsWith("<"),HM=(n,e,t)=>({tr:r,dispatch:i,editor:o})=>{if(i){t={parseOptions:{},updateSelection:!0,...t};const l=Ma(e,o.schema,{parseOptions:{preserveWhitespace:"full",...t.parseOptions}});if(l.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((FM(l)?l:[l]).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,l),t.updateSelection&&BM(r,r.steps.length-1,-1)}return!0},$M=()=>({state:n,dispatch:e})=>$E(n,e),WM=()=>({state:n,dispatch:e})=>WE(n,e),UM=()=>({state:n,dispatch:e})=>Dg(n,e),VM=()=>({state:n,dispatch:e})=>Fg(n,e),KM=()=>({tr:n,state:e,dispatch:t})=>{try{const r=da(e.doc,e.selection.$from.pos,-1);return r==null?!1:(n.join(r,2),t&&t(n),!0)}catch{return!1}},GM=()=>({state:n,dispatch:e,tr:t})=>{try{const r=da(n.doc,n.selection.$from.pos,1);return r==null?!1:(t.join(r,2),e&&e(t),!0)}catch{return!1}};function n0(){return typeof navigator<"u"?/Mac/.test(navigator.platform):!1}function qM(n){const e=n.split(/-(?!$)/);let t=e[e.length-1];t==="Space"&&(t=" ");let r,i,o,l;for(let u=0;u<e.length-1;u+=1){const f=e[u];if(/^(cmd|meta|m)$/i.test(f))l=!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))jc()||n0()?l=!0:i=!0;else throw new Error(`Unrecognized modifier name: ${f}`)}return r&&(t=`Alt-${t}`),i&&(t=`Ctrl-${t}`),l&&(t=`Meta-${t}`),o&&(t=`Shift-${t}`),t}const JM=n=>({editor:e,view:t,tr:r,dispatch:i})=>{const o=qM(n).split(/-(?!$)/),l=o.find(h=>!["Alt","Ctrl","Meta","Shift"].includes(h)),u=new KeyboardEvent("keydown",{key:l==="Space"?" ":l,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 Yc(n,e,t={}){const{from:r,to:i,empty:o}=n.selection,l=e?Ue(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=>l?l.name===p.node.type.name:!0).filter(p=>Ea(p.node.attrs,t,{strict:!1}));return o?!!h.length:h.reduce((p,y)=>p+y.to-y.from,0)>=f}const jM=(n,e={})=>({state:t,dispatch:r})=>{const i=Ue(n,t.schema);return Yc(t,i,e)?UE(t,r):!1},YM=()=>({state:n,dispatch:e})=>Vg(n,e),XM=n=>({state:e,dispatch:t})=>{const r=Ue(n,e.schema);return eM(r)(e,t)},ZM=()=>({state:n,dispatch:e})=>Wg(n,e);function Xc(n,e){return e.nodes[n]?"node":e.marks[n]?"mark":null}function r0(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 QM=(n,e)=>({tr:t,state:r,dispatch:i})=>{let o=null,l=null;const u=Xc(typeof n=="string"?n:n.name,r.schema);return u?(u==="node"&&(o=Ue(n,r.schema)),u==="mark"&&(l=dn(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,r0(h.attrs,e)),l&&h.marks.length&&h.marks.forEach(p=>{l===p.type&&t.addMark(m,m+h.nodeSize,l.create(r0(p.attrs,e)))})})}),!0):!1},eT=()=>({tr:n,dispatch:e})=>(e&&n.scrollIntoView(),!0),tT=()=>({tr:n,commands:e})=>e.setTextSelection({from:0,to:n.doc.content.size}),nT=()=>({state:n,dispatch:e})=>zg(n,e),rT=()=>({state:n,dispatch:e})=>Hg(n,e),iT=()=>({state:n,dispatch:e})=>qE(n,e),sT=()=>({state:n,dispatch:e})=>YE(n,e),oT=()=>({state:n,dispatch:e})=>jE(n,e);function aT(n,e,t={}){return Ma(n,e,{slice:!1,parseOptions:t})}const lT=(n,e=!1,t={})=>({tr:r,editor:i,dispatch:o})=>{const{doc:l}=r,u=aT(n,i.schema,t);return o&&r.replaceWith(0,l.content.size,u).setMeta("preventUpdate",!e),!0};function i0(n,e){const t=dn(e,n.schema),{from:r,to:i,empty:o}=n.selection,l=[];o?(n.storedMarks&&l.push(...n.storedMarks),l.push(...n.selection.$head.marks())):n.doc.nodesBetween(r,i,f=>{l.push(...f.marks)});const u=l.find(f=>f.type.name===t.name);return u?{...u.attrs}:{}}function uT(n,e){const t=new G_(n);return e.forEach(r=>{r.steps.forEach(i=>{t.step(i)})}),t}function cT(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 fT(n,e,t){const r=[];return n.nodesBetween(e.from,e.to,(i,o)=>{t(i)&&r.push({node:i,pos:o})}),r}function hT(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 Zc(n){return e=>hT(e.$from,n)}function dT(n,e){const t=Wi.resolve(n);return Xg(t,e)}function pT(n,e){const t=Ue(e,n.schema),{from:r,to:i}=n.selection,o=[];n.doc.nodesBetween(r,i,u=>{o.push(u)});const l=o.reverse().find(u=>u.type.name===t.name);return l?{...l.attrs}:{}}function mT(n,e){const t=Xc(typeof e=="string"?e:e.name,n.schema);return t==="node"?pT(n,e):t==="mark"?i0(n,e):{}}function gT(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 yT(n){const e=gT(n);return e.length===1?e:e.filter((t,r)=>!e.filter((o,l)=>l!==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 bT(n){const{mapping:e,steps:t}=n,r=[];return e.maps.forEach((i,o)=>{const l=[];if(i.ranges.length)i.forEach((u,f)=>{l.push({from:u,to:f})});else{const{from:u,to:f}=t[o];if(u===void 0||f===void 0)return;l.push({from:u,to:f})}l.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}})})}),yT(r)}function s0(n,e,t){const r=[];return n===e?t.resolve(n).marks().forEach(i=>{const o=t.resolve(n-1),l=Jc(o,i.type);l&&r.push({mark:i,...l})}):t.nodesBetween(n,e,(i,o)=>{r.push(...i.marks.map(l=>({from:o,to:o+i.nodeSize,mark:l})))}),r}function Ta(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 vT(n,e,t={}){const{empty:r,ranges:i}=n.selection,o=e?dn(e,n.schema):null;if(r)return!!(n.storedMarks||n.selection.$from.marks()).filter(p=>o?o.name===p.type.name:!0).find(p=>Ea(p.attrs,t,{strict:!1}));let l=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 I=Math.max(S,T),F=Math.min(w,T+M.nodeSize),B=F-I;l+=B,u.push(...M.marks.map($=>({mark:$,from:I,to:F})))})}),l===0)return!1;const f=u.filter(p=>o?o.name===p.mark.type.name:!0).filter(p=>Ea(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)>=l}function o0(n,e){const{nodeExtensions:t}=ka(e),r=t.find(l=>l.name===n);if(!r)return!1;const i={name:r.name,options:r.options,storage:r.storage},o=le(V(r,"group",i));return typeof o!="string"?!1:o.split(" ").includes("list")}function ST(n,e,t){var r;const{selection:i}=e;let o=null;if(e0(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:l}=i;return l.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 wT=(n,e={})=>({tr:t,state:r,dispatch:i})=>{const{selection:o}=t,{empty:l,ranges:u}=o,f=dn(n,r.schema);if(i)if(l){const h=i0(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(I=>I.type===f)?y.marks.forEach(I=>{f===I.type&&t.addMark(w,M,f.create({...I.attrs,...e}))}):t.addMark(w,M,f.create(e))})});return ST(r,t,f)},xT=(n,e)=>({tr:t})=>(t.setMeta(n,e),!0),kT=(n,e={})=>({state:t,dispatch:r,chain:i})=>{const o=Ue(n,t.schema);return o.isTextblock?i().command(({commands:l})=>qg(o,e)(t)?!0:l.clearNodes()).command(({state:l})=>qg(o,e)(l,r)).run():(console.warn('[tiptap warn]: Currently "setNode()" only supports text block nodes.'),!1)},_T=n=>({tr:e,dispatch:t})=>{if(t){const{doc:r}=e,i=Ur(n,0,r.content.size),o=Z.create(r,i);e.setSelection(o)}return!0},ET=n=>({tr:e,dispatch:t})=>{if(t){const{doc:r}=e,{from:i,to:o}=typeof n=="number"?{from:n,to:n}:n,l=de.atStart(r).from,u=de.atEnd(r).to,f=Ur(i,l,u),h=Ur(o,l,u),m=de.create(r,f,h);e.setSelection(m)}return!0},MT=n=>({state:e,dispatch:t})=>{const r=Ue(n,e.schema);return rM(r)(e,t)};function a0(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 TT=({keepMarks:n=!0}={})=>({tr:e,state:t,dispatch:r,editor:i})=>{const{selection:o,doc:l}=e,{$from:u,$to:f}=o,h=i.extensionManager.attributes,m=Ta(h,u.node().type.name,u.node().attrs);if(o instanceof Z&&o.node.isBlock)return!u.parentOffset||!zn(l,u.pos)?!1:(r&&(n&&a0(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 de&&e.deleteSelection();const y=u.depth===0?void 0:cT(u.node(-1).contentMatchAt(u.indexAfter(-1)));let S=p&&y?[{type:y,attrs:m}]:void 0,w=zn(e.doc,e.mapping.map(u.pos),1,S);if(!S&&!w&&zn(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&&a0(t,i.extensionManager.splittableMarks),e.scrollIntoView()}return!0},CT=n=>({tr:e,state:t,dispatch:r,editor:i})=>{var o;const l=Ue(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!==l)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!==l||u.index(-2)!==u.node(-2).childCount-1)return!1;if(r){let T=L.empty;const I=u.index(-1)?1:u.index(-2)?2:3;for(let ie=u.depth-I;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=Ta(p,u.node().type.name,u.node().attrs),$=((o=l.contentMatch.defaultType)===null||o===void 0?void 0:o.createAndFill(B))||void 0;T=T.append(L.from(l.createAndFill(null,$)||void 0));const X=u.before(u.depth-(I-1));e.replace(X,u.after(-F),new U(T,4-I,0));let q=-1;e.doc.nodesBetween(X,e.doc.content.size,(ie,Ee)=>{if(q>-1)return!1;ie.isTextblock&&ie.content.size===0&&(q=Ee+1)}),q>-1&&e.setSelection(de.near(e.doc.resolve(q))),e.scrollIntoView()}return!0}const y=f.pos===u.end()?m.contentMatchAt(0).defaultType:null,S=Ta(p,m.type.name,m.attrs),w=Ta(p,u.node().type.name,u.node().attrs);e.delete(u.pos,f.pos);const M=y?[{type:l,attrs:S},{type:y,attrs:w}]:[{type:l,attrs:S}];if(!zn(e.doc,u.pos,2))return!1;if(r){const{selection:T,storedMarks:I}=t,{splittableMarks:F}=i.extensionManager,B=I||T.$to.parentOffset&&T.$from.marks();if(e.split(u.pos,2,M).scrollIntoView(),!B||!r)return!0;const $=B.filter(X=>F.includes(X.type.name));e.ensureMarks($)}return!0},Qc=(n,e)=>{const t=Zc(l=>l.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&&ur(n.doc,t.pos)&&n.join(t.pos),!0},ef=(n,e)=>{const t=Zc(l=>l.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&&ur(n.doc,r)&&n.join(r),!0},AT=(n,e,t,r={})=>({editor:i,tr:o,state:l,dispatch:u,chain:f,commands:h,can:m})=>{const{extensions:p,splittableMarks:y}=i.extensionManager,S=Ue(n,l.schema),w=Ue(e,l.schema),{selection:M,storedMarks:T}=l,{$from:I,$to:F}=M,B=I.blockRange(F),$=T||M.$to.parentOffset&&M.$from.marks();if(!B)return!1;const X=Zc(q=>o0(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(o0(X.node.type.name,p)&&S.validContent(X.node.content)&&u)return f().command(()=>(o.setNodeMarkup(X.pos,S),!0)).command(()=>Qc(o,S)).command(()=>ef(o,S)).run()}return!t||!$||!u?f().command(()=>m().wrapInList(S,r)?!0:h.clearNodes()).wrapInList(S,r).command(()=>Qc(o,S)).command(()=>ef(o,S)).run():f().command(()=>{const q=m().wrapInList(S,r),ie=$.filter(Ee=>y.includes(Ee.type.name));return o.ensureMarks(ie),q?!0:h.clearNodes()}).wrapInList(S,r).command(()=>Qc(o,S)).command(()=>ef(o,S)).run()},IT=(n,e={},t={})=>({state:r,commands:i})=>{const{extendEmptyMarkRange:o=!1}=t,l=dn(n,r.schema);return vT(r,l,e)?i.unsetMark(l,{extendEmptyMarkRange:o}):i.setMark(l,e)},OT=(n,e,t={})=>({state:r,commands:i})=>{const o=Ue(n,r.schema),l=Ue(e,r.schema);return Yc(r,o,t)?i.setNode(l):i.setNode(o,t)},NT=(n,e={})=>({state:t,commands:r})=>{const i=Ue(n,t.schema);return Yc(t,i,e)?r.lift(i):r.wrapIn(i,e)},RT=()=>({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 l=n.tr,u=o.transform;for(let f=u.steps.length-1;f>=0;f-=1)l.step(u.steps[f].invert(u.docs[f]));if(o.text){const f=l.doc.resolve(o.from).marks();l.replaceWith(o.from,o.to,n.schema.text(o.text,f))}else l.delete(o.from,o.to)}return!0}}return!1},LT=()=>({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},PT=(n,e={})=>({tr:t,state:r,dispatch:i})=>{var o;const{extendEmptyMarkRange:l=!1}=e,{selection:u}=t,f=dn(n,r.schema),{$from:h,empty:m,ranges:p}=u;if(!i)return!0;if(m&&l){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=Jc(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},DT=(n,e={})=>({tr:t,state:r,dispatch:i})=>{let o=null,l=null;const u=Xc(typeof n=="string"?n:n.name,r.schema);return u?(u==="node"&&(o=Ue(n,r.schema)),u==="mark"&&(l=dn(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}),l&&p.marks.length&&p.marks.forEach(S=>{if(l===S.type){const w=Math.max(y,h),M=Math.min(y+p.nodeSize,m);t.addMark(w,M,l.create({...S.attrs,...e}))}})})}),!0):!1},zT=(n,e={})=>({state:t,dispatch:r})=>{const i=Ue(n,t.schema);return XE(i,e)(t,r)},BT=(n,e={})=>({state:t,dispatch:r})=>{const i=Ue(n,t.schema);return ZE(i,e)(t,r)};var FT=Object.freeze({__proto__:null,blur:vM,clearContent:SM,clearNodes:wM,command:xM,createParagraphNear:kM,cut:_M,deleteCurrentNode:EM,deleteNode:MM,deleteRange:TM,deleteSelection:CM,enter:AM,exitCode:IM,extendMarkRange:NM,first:RM,focus:PM,forEach:DM,insertContent:zM,insertContentAt:HM,joinUp:$M,joinDown:WM,joinBackward:UM,joinForward:VM,joinItemBackward:KM,joinItemForward:GM,keyboardShortcut:JM,lift:jM,liftEmptyBlock:YM,liftListItem:XM,newlineInCode:ZM,resetAttributes:QM,scrollIntoView:eT,selectAll:tT,selectNodeBackward:nT,selectNodeForward:rT,selectParentNode:iT,selectTextblockEnd:sT,selectTextblockStart:oT,setContent:lT,setMark:wT,setMeta:xT,setNode:kT,setNodeSelection:_T,setTextSelection:ET,sinkListItem:MT,splitBlock:TT,splitListItem:CT,toggleList:AT,toggleMark:IT,toggleNode:OT,toggleWrap:NT,undoInputRule:RT,unsetAllMarks:LT,unsetMark:PT,updateAttributes:DT,wrapIn:zT,wrapInList:BT});Ne.create({name:"commands",addCommands(){return{...FT}}}),Ne.create({name:"editable",addProseMirrorPlugins(){return[new Mt({key:new rn("editable"),props:{editable:()=>this.editor.options.editable}})]}}),Ne.create({name:"focusEvents",addProseMirrorPlugins(){const{editor:n}=this;return[new Mt({key:new rn("focusEvents"),props:{handleDOMEvents:{focus:(e,t)=>{n.isFocused=!0;const r=n.state.tr.setMeta("focus",{event:t}).setMeta("addToHistory",!1);return e.dispatch(r),!1},blur:(e,t)=>{n.isFocused=!1;const r=n.state.tr.setMeta("blur",{event:t}).setMeta("addToHistory",!1);return e.dispatch(r),!1}}}})]}}),Ne.create({name:"keymap",addKeyboardShortcuts(){const n=()=>this.editor.commands.first(({commands:l})=>[()=>l.undoInputRule(),()=>l.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,I=M&&w.parent.childCount===1?T===p.pos:me.atStart(h).from===y;return!m||!I||!S.type.isTextblock||S.textContent.length?!1:l.clearNodes()}),()=>l.deleteSelection(),()=>l.joinBackward(),()=>l.selectNodeBackward()]),e=()=>this.editor.commands.first(({commands:l})=>[()=>l.deleteSelection(),()=>l.deleteCurrentNode(),()=>l.joinForward(),()=>l.selectNodeForward()]),r={Enter:()=>this.editor.commands.first(({commands:l})=>[()=>l.newlineInCode(),()=>l.createParagraphNear(),()=>l.liftEmptyBlock(),()=>l.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 jc()||n0()?o:i},addProseMirrorPlugins(){return[new Mt({key:new rn("clearDocument"),appendTransaction:(n,e,t)=>{if(!(n.some(w=>w.docChanged)&&!e.doc.eq(t.doc)))return;const{empty:i,from:o,to:l}=e.selection,u=me.atStart(e.doc).from,f=me.atEnd(e.doc).to;if(i||!(o===u&&l===f)||!(t.doc.textBetween(0,t.doc.content.size," "," ").length===0))return;const p=t.tr,y=xa({state:t,transaction:p}),{commands:S}=new $c({editor:this.editor,state:y});if(S.clearNodes(),!!p.steps.length)return p}})]}}),Ne.create({name:"tabindex",addProseMirrorPlugins(){return[new Mt({key:new rn("tabindex"),props:{attributes:this.editor.isEditable?{tabindex:"0"}:{}}})]}});function HT(n){return new Qg({find:n.find,handler:({state:e,range:t,match:r})=>{const i=e.doc.resolve(t.from),o=le(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 $T(n){return new Qg({find:n.find,handler:({state:e,range:t,match:r,chain:i})=>{const o=le(n.getAttributes,void 0,r)||{},l=e.tr.delete(t.from,t.to),f=l.doc.resolve(t.from).blockRange(),h=f&&pc(f,n.type,o);if(!h)return null;if(l.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));l.ensureMarks(M)}}if(n.keepAttributes){const p=n.type.name==="bulletList"||n.type.name==="orderedList"?"listItem":"taskList";i().updateAttributes(p,o).run()}const m=l.doc.resolve(t.from-1).nodeBefore;m&&m.type===n.type&&ur(l.doc,t.from-1)&&(!n.joinPredicate||n.joinPredicate(r,m))&&l.join(t.from-1)}})}class Ct{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=le(V(this,"addOptions",{name:this.name}))),this.storage=le(V(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(e={}){return new Ct(e)}configure(e={}){const t=this.extend();return t.options=_a(this.options,e),t.storage=le(V(t,"addStorage",{name:t.name,options:t.options})),t}extend(e={}){const t=new Ct(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=le(V(t,"addOptions",{name:t.name})),t.storage=le(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 l=i.marks();if(!!!l.find(h=>h?.type.name===t.name))return!1;const f=l.find(h=>h?.type.name===t.name);return f&&r.removeStoredMark(f),r.insertText(" ",i.pos),e.view.dispatch(r),!0}return!1}}class Vn{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=le(V(this,"addOptions",{name:this.name}))),this.storage=le(V(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(e={}){return new Vn(e)}configure(e={}){const t=this.extend();return t.options=_a(this.options,e),t.storage=le(V(t,"addStorage",{name:t.name,options:t.options})),t}extend(e={}){const t=new Vn(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=le(V(t,"addOptions",{name:t.name})),t.storage=le(V(t,"addStorage",{name:t.name,options:t.options})),t}}function WT(n){return new fM({find:n.find,handler:({state:e,range:t,match:r,pasteEvent:i})=>{const o=le(n.getAttributes,void 0,r,i);if(o===!1||o===null)return null;const{tr:l}=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(s0(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&&l.delete(y,t.to),p>t.from&&l.delete(t.from+m,p),h=t.from+m+u.length,l.addMark(t.from+m,h,n.type.create(o||{})),l.removeStoredMark(n.type)}}})}const UT=Vn.create({name:"text",group:"inline"});var Ca=200,Ze=function(){};Ze.prototype.append=function(e){return e.length?(e=Ze.from(e),!this.length&&e||e.length<Ca&&this.leafAppend(e)||this.length<Ca&&e.leafPrepend(this)||this.appendInner(e)):this},Ze.prototype.prepend=function(e){return e.length?Ze.from(e).append(this):this},Ze.prototype.appendInner=function(e){return new VT(this,e)},Ze.prototype.slice=function(e,t){return e===void 0&&(e=0),t===void 0&&(t=this.length),e>=t?Ze.empty:this.sliceInner(Math.max(0,e),Math.min(this.length,t))},Ze.prototype.get=function(e){if(!(e<0||e>=this.length))return this.getInner(e)},Ze.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)},Ze.prototype.map=function(e,t,r){t===void 0&&(t=0),r===void 0&&(r=this.length);var i=[];return this.forEach(function(o,l){return i.push(e(o,l))},t,r),i},Ze.from=function(e){return e instanceof Ze?e:e&&e.length?new l0(e):Ze.empty};var l0=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,l,u){for(var f=o;f<l;f++)if(i(this.values[f],u+f)===!1)return!1},e.prototype.forEachInvertedInner=function(i,o,l,u){for(var f=o-1;f>=l;f--)if(i(this.values[f],u+f)===!1)return!1},e.prototype.leafAppend=function(i){if(this.length+i.length<=Ca)return new e(this.values.concat(i.flatten()))},e.prototype.leafPrepend=function(i){if(this.length+i.length<=Ca)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}(Ze);Ze.empty=new l0([]);var VT=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,l){var u=this.left.length;if(i<u&&this.left.forEachInner(r,i,Math.min(o,u),l)===!1||o>u&&this.right.forEachInner(r,Math.max(i-u,0),Math.min(this.length,o)-u,l+u)===!1)return!1},e.prototype.forEachInvertedInner=function(r,i,o,l){var u=this.left.length;if(i>u&&this.right.forEachInvertedInner(r,i-u,Math.max(o,u)-u,l+u)===!1||o<u&&this.left.forEachInvertedInner(r,Math.min(i,u),o,l)===!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}(Ze),u0=Ze;const KT=500;class ln{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 l=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 yn(p.map));let S=p.step.map(i.slice(o)),w;S&&l.maybeStep(S).doc&&(w=l.mapping.maps[l.mapping.maps.length-1],h.push(new yn(w,void 0,void 0,h.length+m.length))),o--,w&&i.appendMap(w,o)}else l.maybeStep(p.step);if(p.selection)return u=i?p.selection.map(i.slice(o)):p.selection,f=new ln(this.items.slice(0,r).append(m.reverse().concat(h)),this.eventCount-1),!1},this.items.length,0),{remaining:f,transform:l,selection:u}}addTransform(e,t,r,i){let o=[],l=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 yn(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&&(l++,t=void 0),i||(f=y)}let h=l-r.depth;return h>qT&&(u=GT(u,h),l-=h),new ln(u.append(o),l)}remapping(e,t){let r=new Ui;return this.items.forEach((i,o)=>{let l=i.mirrorOffset!=null&&o-i.mirrorOffset>=e?r.maps.length-i.mirrorOffset:void 0;r.appendMap(i.map,l)},e,t),r}addMaps(e){return this.eventCount==0?this:new ln(this.items.append(e.map(t=>new yn(t))),this.eventCount)}rebased(e,t){if(!this.eventCount)return this;let r=[],i=Math.max(0,this.items.length-t),o=e.mapping,l=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;l=Math.min(l,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 yn(w,M,T))}else r.push(new yn(w))},i);let h=[];for(let y=t;y<l;y++)h.push(new yn(o.maps[y]));let m=this.items.slice(0,i).append(h).append(r),p=new ln(m,u);return p.emptyItemCount()>KT&&(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((l,u)=>{if(u>=e)i.push(l),l.selection&&o++;else if(l.step){let f=l.step.map(t.slice(r)),h=f&&f.getMap();if(r--,h&&t.appendMap(h,r),f){let m=l.selection&&l.selection.map(t.slice(r));m&&o++;let p=new yn(h.invert(),f,m),y,S=i.length-1;(y=i.length&&i[S].merge(p))?i[S]=y:i.push(p)}}else l.map&&r--},this.items.length,0),new ln(u0.from(i.reverse()),o)}}ln.empty=new ln(u0.empty,0);function GT(n,e){let t;return n.forEach((r,i)=>{if(r.selection&&e--==0)return t=i,!1}),n.slice(t)}class yn{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 yn(t.getMap().invert(),t,this.selection)}}}class pr{constructor(e,t,r,i){this.done=e,this.undone=t,this.prevRanges=r,this.prevTime=i}}const qT=20;function JT(n,e,t,r){let i=t.getMeta(mr),o;if(i)return i.historyState;t.getMeta(YT)&&(n=new pr(n.done,n.undone,null,0));let l=t.getMeta("appendedTransaction");if(t.steps.length==0)return n;if(l&&l.getMeta(mr))return l.getMeta(mr).redo?new pr(n.done.addTransform(t,void 0,r,Aa(e)),n.undone,c0(t.mapping.maps[t.steps.length-1]),n.prevTime):new pr(n.done,n.undone.addTransform(t,void 0,r,Aa(e)),null,n.prevTime);if(t.getMeta("addToHistory")!==!1&&!(l&&l.getMeta("addToHistory")===!1)){let u=n.prevTime==0||!l&&(n.prevTime<(t.time||0)-r.newGroupDelay||!jT(t,n.prevRanges)),f=l?tf(n.prevRanges,t.mapping):c0(t.mapping.maps[t.steps.length-1]);return new pr(n.done.addTransform(t,u?e.selection.getBookmark():void 0,r,Aa(e)),ln.empty,f,t.time)}else return(o=t.getMeta("rebased"))?new pr(n.done.rebased(t,o),n.undone.rebased(t,o),tf(n.prevRanges,t.mapping),n.prevTime):new pr(n.done.addMaps(t.mapping.maps),n.undone.addMaps(t.mapping.maps),tf(n.prevRanges,t.mapping),n.prevTime)}function jT(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 c0(n){let e=[];return n.forEach((t,r,i,o)=>e.push(i,o)),e}function tf(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 f0(n,e,t,r){let i=Aa(e),o=mr.get(e).spec.config,l=(r?n.undone:n.done).popEvent(e,i);if(!l)return;let u=l.selection.resolve(l.transform.doc),f=(r?n.done:n.undone).addTransform(l.transform,e.selection.getBookmark(),o,i),h=new pr(r?f:l.remaining,r?l.remaining:f,null,0);t(l.transform.setSelection(u).setMeta(mr,{redo:r,historyState:h}).scrollIntoView())}let nf=!1,h0=null;function Aa(n){let e=n.plugins;if(h0!=e){nf=!1,h0=e;for(let t=0;t<e.length;t++)if(e[t].spec.historyPreserveItems){nf=!0;break}}return nf}const mr=new rn("history"),YT=new rn("closeHistory");function XT(n={}){return n={depth:n.depth||100,newGroupDelay:n.newGroupDelay||500},new Mt({key:mr,state:{init(){return new pr(ln.empty,ln.empty,null,0)},apply(e,t,r){return JT(t,r,e,n)}},config:n,props:{handleDOMEvents:{beforeinput(e,t){let r=t.inputType,i=r=="historyUndo"?d0:r=="historyRedo"?p0:null;return i?(t.preventDefault(),i(e.state,e.dispatch)):!1}}}})}const d0=(n,e)=>{let t=mr.getState(n);return!t||t.done.eventCount==0?!1:(e&&f0(t,n,e,!1),!0)},p0=(n,e)=>{let t=mr.getState(n);return!t||t.undone.eventCount==0?!1:(e&&f0(t,n,e,!0),!0)},ZT=Ne.create({name:"history",addOptions(){return{depth:100,newGroupDelay:500}},addCommands(){return{undo:()=>({state:n,dispatch:e})=>d0(n,e),redo:()=>({state:n,dispatch:e})=>p0(n,e)}},addProseMirrorPlugins(){return[XT(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()}}}),rf=Object.freeze({COMMON:"common",DESKTOP:"desktop",TABLET:"tablet",MOBILE:"mobile",get values(){return[this.COMMON,this.MOBILE,this.TABLET,this.DESKTOP]}}),sf=Object.freeze({UPPERCASE:"uppercase",LOWERCASE:"lowercase",CAPITALIZE:"capitalize"}),gr=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]}}),$t=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]}}),on=Object.freeze({SETTINGS:"settings",ALL:"_"}),m0=Object.freeze({BLANK:"_blank",SELF:"_self"}),Rs=Object.freeze({URL:"url",BLOCK:"block"});class of{static create(e,t){const r=new this(e,t||{});return new Mt({key:new rn(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 QT extends of{addProps(){return{transformPastedHTML:this._transformPastedHTML,handlePaste:this._handlePaste}}_transformPastedHTML(e){if(e.includes("data-pm-slice")&&e.includes("zw-style"))return e;const t=hl.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,l,u)=>{u.type.name===ne.DOCUMENT&&(r=Math.min(r,l+1),i=Math.max(i,l+o.nodeSize-1))}),{from:r,to:i}}_isMatchPosition(e,t){return Math.abs(e-t)<5}}class eC extends of{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=Sn.node(i,i+r.nodeSize,{class:"zw-wysiwyg__placeholder","data-placeholder":"Type your text here..."});t.push(o)}return!1}),qe.create(e,t)}}const tC="aaa1rp3barth4b0ott3vie4c1le2ogado5udhabi7c0ademy5centure6ountant0s9o1tor4d0s1ult4e0g1ro2tna4f0l1rica5g0akhan5ency5i0g1rbus3force5tel5kdn3l0faromeo7ibaba4pay4lfinanz6state5y2sace3tom5m0azon4ericanexpress7family11x2fam3ica3sterdam8nalytics7droid5quan4z2o0l2partments8p0le4q0uarelle8r0ab1mco4chi3my2pa2t0e3s0da2ia2sociates9t0hleta5torney7u0ction5di0ble3o3spost5thor3o0s4vianca6w0s2x0a2z0ure5ba0by2idu3namex3narepublic11d1k2r0celona5laycard4s5efoot5gains6seball5ketball8uhaus5yern5b0c1t1va3cg1n2d1e0ats2uty4er2ntley5rlin4st0buy5t2f1g1h0arti5i0ble3d1ke2ng0o3o1z2j1lack0friday9ockbuster8g1omberg7ue3m0s1w2n0pparibas9o0ats3ehringer8fa2m1nd2o0k0ing5sch2tik2on4t1utique6x2r0adesco6idgestone9oadway5ker3ther5ussels7s1t1uild0ers6siness6y1zz3v1w1y1z0h3ca0b1fe2l0l1vinklein9m0era3p2non3petown5ital0one8r0avan4ds2e0er0s4s2sa1e1h1ino4t0ering5holic7ba1n1re2s2c1d1enter4o1rn3f0a1d2g1h0anel2nel4rity4se2t2eap3intai5ristmas6ome4urch5i0priani6rcle4sco3tadel4i0c2y0eats7k1l0aims4eaning6ick2nic1que6othing5ud3ub0med6m1n1o0ach3des3ffee4llege4ogne5m0cast4mbank4unity6pany2re3uter5sec4ndos3struction8ulting7tact3ractors9oking0channel11l1p2rsica5untry4pon0s4rses6pa2r0edit0card4union9icket5own3s1uise0s6u0isinella9v1w1x1y0mru3ou3z2dabur3d1nce3ta1e1ing3sun4y2clk3ds2e0al0er2s3gree4livery5l1oitte5ta3mocrat6ntal2ist5si0gn4v2hl2iamonds6et2gital5rect0ory7scount3ver5h2y2j1k1m1np2o0cs1tor4g1mains5t1wnload7rive4tv2ubai3nlop4pont4rban5vag2r2z2earth3t2c0o2deka3u0cation8e1g1mail3erck5nergy4gineer0ing9terprises10pson4quipment8r0icsson6ni3s0q1tate5t0isalat7u0rovision8s2vents5xchange6pert3osed4ress5traspace10fage2il1rwinds6th3mily4n0s2rm0ers5shion4t3edex3edback6rrari3ero6i0at2delity5o2lm2nal1nce1ial7re0stone6mdale6sh0ing5t0ness6j1k1lickr3ghts4r2orist4wers5y2m1o0o0d0network8tball6rd1ex2sale4um3undation8x2r0ee1senius7l1ogans4ntdoor4ier7tr2ujitsu5n0d2rniture7tbol5yi3ga0l0lery3o1up4me0s3p1rden4y2b0iz3d0n2e0a1nt0ing5orge5f1g0ee3h1i0ft0s3ves2ing5l0ass3e1obal2o4m0ail3bh2o1x2n1odaddy5ld0point6f2o0dyear5g0le4p1t1v2p1q1r0ainger5phics5tis4een3ipe3ocery4up4s1t1u0ardian6cci3ge2ide2tars5ru3w1y2hair2mburg5ngout5us3bo2dfc0bank7ealth0care8lp1sinki6re1mes5gtv3iphop4samitsu7tachi5v2k0t2m1n1ockey4ldings5iday5medepot5goods5s0ense7nda3rse3spital5t0ing5t0eles2s3mail5use3w2r1sbc3t1u0ghes5yatt3undai7ibm2cbc2e1u2d1e0ee3fm2kano4l1m0amat4db2mo0bilien9n0c1dustries8finiti5o2g1k1stitute6urance4e4t0ernational10uit4vestments10o1piranga7q1r0ish4s0maili5t0anbul7t0au2v3jaguar4va3cb2e0ep2tzt3welry6io2ll2m0p2nj2o0bs1urg4t1y2p0morgan6rs3uegos4niper7kaufen5ddi3e0rryhotels6logistics9properties14fh2g1h1i0a1ds2m1nder2le4tchen5wi3m1n1oeln3matsu5sher5p0mg2n2r0d1ed3uokgroup8w1y0oto4z2la0caixa5mborghini8er3ncaster5ia3d0rover6xess5salle5t0ino3robe5w0yer5b1c1ds2ease3clerc5frak4gal2o2xus4gbt3i0dl2fe0insurance9style7ghting6ke2lly3mited4o2ncoln4de2k2psy3ve1ing5k1lc1p2oan0s3cker3us3l1ndon4tte1o3ve3pl0financial11r1s1t0d0a3u0ndbeck6xe1ury5v1y2ma0cys3drid4if1son4keup4n0agement7go3p1rket0ing3s4riott5shalls7serati6ttel5ba2c0kinsey7d1e0d0ia3et2lbourne7me1orial6n0u2rckmsd7g1h1iami3crosoft7l1ni1t2t0subishi9k1l0b1s2m0a2n1o0bi0le4da2e1i1m1nash3ey2ster5rmon3tgage6scow4to0rcycles9v0ie4p1q1r1s0d2t0n1r2u0seum3ic3tual5v1w1x1y1z2na0b1goya4me2tura4vy3ba2c1e0c1t0bank4flix4work5ustar5w0s2xt0direct7us4f0l2g0o2hk2i0co2ke1on3nja3ssan1y5l1o0kia3rthwesternmutual14on4w0ruz3tv4p1r0a1w2tt2u1yc2z2obi1server7ffice5kinawa6layan0group9dnavy5lo3m0ega4ne1g1l0ine5oo2pen3racle3nge4g0anic5igins6saka4tsuka4t2vh3pa0ge2nasonic7ris2s1tners4s1y3ssagens7y2ccw3e0t2f0izer5g1h0armacy6d1ilips5one2to0graphy6s4ysio5ics1tet2ures6d1n0g1k2oneer5zza4k1l0ace2y0station9umbing5s3m1n0c2ohl2ker3litie5rn2st3r0america6xi3ess3ime3o0d0uctions8f1gressive8mo2perties3y5tection8u0dential9s1t1ub2w0c2y2qa1pon3uebec3st5racing4dio4e0ad1lestate6tor2y4cipes5d0stone5umbrella9hab3ise0n3t2liance6n0t0als5pair3ort3ublican8st0aurant8view0s5xroth6ich0ardli6oh3l1o1p2o0cher3ks3deo3gers4om3s0vp3u0gby3hr2n2w0e2yukyu6sa0arland6fe0ty4kura4le1on3msclub4ung5ndvik0coromant12ofi4p1rl2s1ve2xo3b0i1s2c0a1b1haeffler7midt4olarships8ol3ule3warz5ience5ot3d1e0arch3t2cure1ity6ek2lect4ner3rvices6ven3w1x0y3fr2g1h0angrila6rp2w2ell3ia1ksha5oes2p0ping5uji3w0time7i0lk2na1gles5te3j1k0i0n2y0pe4l0ing4m0art3ile4n0cf3o0ccer3ial4ftbank4ware6hu2lar2utions7ng1y2y2pa0ce3ort2t3r0l2s1t0ada2ples4r1tebank4farm7c0group6ockholm6rage3e3ream4udio2y3yle4u0cks3pplies3y2ort5rf1gery5zuki5v1watch4iss4x1y0dney4stems6z2tab1ipei4lk2obao4rget4tamotors6r2too4x0i3c0i2d0k2eam2ch0nology8l1masek5nnis4va3f1g1h0d1eater2re6iaa2ckets5enda4ffany5ps2res2ol4j0maxx4x2k0maxx5l1m0all4n1o0day3kyo3ols3p1ray3shiba5tal3urs3wn2yota3s3r0ade1ing4ining5vel0channel7ers0insurance16ust3v2t1ube2i1nes3shu4v0s2w1z2ua1bank3s2g1k1nicom3versity8o2ol2ps2s1y1z2va0cations7na1guard7c1e0gas3ntures6risign5m\xF6gensberater2ung14sicherung10t2g1i0ajes4deo3g1king4llas4n1p1rgin4sa1ion4va1o3laanderen9n1odka3lkswagen7vo3te1ing3o2yage5u0elos6wales2mart4ter4ng0gou5tch0es6eather0channel12bcam3er2site5d0ding5ibo2r3f1hoswho6ien2ki2lliamhill9n0dows4e1ners6me2olterskluwer11odside6rk0s2ld3w2s1tc1f3xbox3erox4finity6ihuan4n2xx2yz3yachts4hoo3maxun5ndex5e1odobashi7ga2kohama6u0tube6t1un3za0ppos4ra3ero3ip2m1one3uerich6w2",nC="\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",Ri=(n,e)=>{for(const t in e)n[t]=e[t];return n},af="numeric",lf="ascii",uf="alpha",Ia="asciinumeric",Oa="alphanumeric",cf="domain",g0="emoji",rC="scheme",iC="slashscheme",y0="whitespace";function sC(n,e){return n in e||(e[n]=[]),e[n]}function Vr(n,e,t){e[af]&&(e[Ia]=!0,e[Oa]=!0),e[lf]&&(e[Ia]=!0,e[uf]=!0),e[Ia]&&(e[Oa]=!0),e[uf]&&(e[Oa]=!0),e[Oa]&&(e[cf]=!0),e[g0]&&(e[cf]=!0);for(const r in e){const i=sC(r,t);i.indexOf(n)<0&&i.push(n)}}function oC(n,e){const t={};for(const r in e)e[r].indexOf(n)>=0&&(t[r]=!0);return t}function vt(n){n===void 0&&(n=null),this.j={},this.jr=[],this.jd=null,this.t=n}vt.groups={},vt.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||vt.groups;let i;return e&&e.j?i=e:(i=new vt(e),t&&r&&Vr(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 l=0;l<o-1;l++)i=i.tt(n[l]);return i.tt(n[o-1],e,t,r)},tt(n,e,t,r){r=r||vt.groups;const i=this;if(e&&e.j)return i.j[n]=e,e;const o=e;let l,u=i.go(n);if(u?(l=new vt,Ri(l.j,u.j),l.jr.push.apply(l.jr,u.jr),l.jd=u.jd,l.t=u.t):l=new vt,o){if(r)if(l.t&&typeof l.t=="string"){const f=Ri(oC(l.t,r),t);Vr(o,f,r)}else t&&Vr(o,t,r);l.t=o}return i.j[n]=l,l}};const G=(n,e,t,r,i)=>n.ta(e,t,r,i),Wt=(n,e,t,r,i)=>n.tr(e,t,r,i),b0=(n,e,t,r,i)=>n.ts(e,t,r,i),D=(n,e,t,r,i)=>n.tt(e,t,r,i),Bn="WORD",ff="UWORD",Ls="LOCALHOST",hf="TLD",df="UTLD",Na="SCHEME",Li="SLASH_SCHEME",pf="NUM",v0="WS",mf="NL",Pi="OPENBRACE",Ps="OPENBRACKET",Ds="OPENANGLEBRACKET",zs="OPENPAREN",Kr="CLOSEBRACE",Di="CLOSEBRACKET",zi="CLOSEANGLEBRACKET",Gr="CLOSEPAREN",Ra="AMPERSAND",La="APOSTROPHE",Pa="ASTERISK",yr="AT",Da="BACKSLASH",za="BACKTICK",Ba="CARET",br="COLON",gf="COMMA",Fa="DOLLAR",pn="DOT",Ha="EQUALS",yf="EXCLAMATION",mn="HYPHEN",$a="PERCENT",Wa="PIPE",Ua="PLUS",Va="POUND",Ka="QUERY",bf="QUOTE",vf="SEMI",gn="SLASH",Bs="TILDE",Ga="UNDERSCORE",S0="EMOJI",qa="SYM";var w0=Object.freeze({__proto__:null,WORD:Bn,UWORD:ff,LOCALHOST:Ls,TLD:hf,UTLD:df,SCHEME:Na,SLASH_SCHEME:Li,NUM:pf,WS:v0,NL:mf,OPENBRACE:Pi,OPENBRACKET:Ps,OPENANGLEBRACKET:Ds,OPENPAREN:zs,CLOSEBRACE:Kr,CLOSEBRACKET:Di,CLOSEANGLEBRACKET:zi,CLOSEPAREN:Gr,AMPERSAND:Ra,APOSTROPHE:La,ASTERISK:Pa,AT:yr,BACKSLASH:Da,BACKTICK:za,CARET:Ba,COLON:br,COMMA:gf,DOLLAR:Fa,DOT:pn,EQUALS:Ha,EXCLAMATION:yf,HYPHEN:mn,PERCENT:$a,PIPE:Wa,PLUS:Ua,POUND:Va,QUERY:Ka,QUOTE:bf,SEMI:vf,SLASH:gn,TILDE:Bs,UNDERSCORE:Ga,EMOJI:S0,SYM:qa});const Bi=/[a-z]/,Sf=/\p{L}/u,wf=/\p{Emoji}/u,xf=/\d/,x0=/\s/,k0=`
|
|
16
|
-
`,
|
|
15
|
+
`,textSerializers:l={}}=t||{};let u="",f=!0;return n.nodesBetween(r,i,(h,m,p,y)=>{var w;const S=l?.[h.type.name];S?(h.isBlock&&!f&&(u+=o,f=!0),p&&(u+=S({node:h,pos:m,parent:p,index:y,range:e}))):h.isText?(u+=(w=h?.text)===null||w===void 0?void 0:w.slice(Math.max(r,m)-m,i-m),f=!1):h.isBlock&&!f&&(u+=o,f=!0)}),u}function vM(n){return Object.fromEntries(Object.entries(n.nodes).filter(([,e])=>e.spec.toText).map(([e,t])=>[e,t.spec.toText]))}Ne.create({name:"clipboardTextSerializer",addProseMirrorPlugins(){return[new Mt({key:new rn("clipboardTextSerializer"),props:{clipboardTextSerializer:()=>{const{editor:n}=this,{state:e,schema:t}=n,{doc:r,selection:i}=e,{ranges:o}=i,l=Math.min(...o.map(m=>m.$from.pos)),u=Math.max(...o.map(m=>m.$to.pos)),f=vM(t);return bM(r,{from:l,to:u},{textSerializers:f})}}})]}});const wM=()=>({editor:n,view:e})=>(requestAnimationFrame(()=>{var t;n.isDestroyed||(e.dom.blur(),(t=window?.getSelection())===null||t===void 0||t.removeAllRanges())}),!0),SM=(n=!1)=>({commands:e})=>e.setContent("",n),xM=()=>({state:n,tr:e,dispatch:t})=>{const{selection:r}=e,{ranges:i}=r;return t&&i.forEach(({$from:o,$to:l})=>{n.doc.nodesBetween(o.pos,l.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)),w=p.blockRange(y);if(!w)return;const S=_i(w);if(u.type.isTextblock){const{defaultType:M}=p.parent.contentMatchAt(p.index());e.setNodeMarkup(w.start,M)}(S||S===0)&&e.lift(w,S)})}),!0},kM=n=>e=>n(e),_M=()=>({state:n,dispatch:e})=>Vg(n,e),EM=(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 l=r.mapping.map(e);return r.insert(l,o.content),r.setSelection(new de(r.doc.resolve(l-1))),!0},MM=()=>({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},TM=n=>({tr:e,state:t,dispatch:r})=>{const i=Ue(n,t.schema),o=e.selection.$anchor;for(let l=o.depth;l>0;l-=1)if(o.node(l).type===i){if(r){const f=o.before(l),h=o.after(l);e.delete(f,h).scrollIntoView()}return!0}return!1},CM=n=>({tr:e,dispatch:t})=>{const{from:r,to:i}=n;return t&&e.delete(r,i),!0},AM=()=>({state:n,dispatch:e})=>Bc(n,e),IM=()=>({commands:n})=>n.keyboardShortcut("Enter"),OM=()=>({state:n,dispatch:e})=>KE(n,e);function Ea(n,e,t={strict:!0}){const r=Object.keys(e);return r.length?r.every(i=>t.strict?e[i]===n[i]:Vc(e[i])?e[i].test(n[i]):e[i]===n[i]):!0}function qc(n,e,t={}){return n.find(r=>r.type===e&&Ea(r.attrs,t))}function NM(n,e,t={}){return!!qc(n,e,t)}function Jc(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=qc([...r.node.marks],e,t);if(!i)return;let o=r.index,l=n.start()+r.offset,u=o+1,f=l+r.node.nodeSize;for(qc([...r.node.marks],e,t);o>0&&i.isInSet(n.parent.child(o-1).marks);)o-=1,l-=n.parent.child(o).nodeSize;for(;u<n.parent.childCount&&NM([...n.parent.child(u).marks],e,t);)f+=n.parent.child(u).nodeSize,u+=1;return{from:l,to:f}}function dn(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 RM=(n,e={})=>({tr:t,state:r,dispatch:i})=>{const o=dn(n,r.schema),{doc:l,selection:u}=t,{$from:f,from:h,to:m}=u;if(i){const p=Jc(f,o,e);if(p&&p.from<=h&&p.to>=m){const y=de.create(l,p.from,p.to);t.setSelection(y)}}return!0},LM=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 t0(n){return n instanceof de}function Ur(n=0,e=0,t=0){return Math.min(Math.max(n,e),t)}function PM(n,e=null){if(!e)return null;const t=me.atStart(n),r=me.atEnd(n);if(e==="start"||e===!0)return t;if(e==="end")return r;const i=t.from,o=r.to;return e==="all"?de.create(n,Ur(0,i,o),Ur(n.content.size,i,o)):de.create(n,Ur(e,i,o),Ur(e,i,o))}function jc(){return["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document}const DM=(n=null,e={})=>({editor:t,view:r,tr:i,dispatch:o})=>{e={scrollIntoView:!0,...e};const l=()=>{jc()&&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&&!t0(t.state.selection))return l(),!0;const u=PM(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),l()),!0},zM=(n,e)=>t=>n.every((r,i)=>e(r,{...t,index:i})),BM=(n,e)=>({tr:t,commands:r})=>r.insertContentAt({from:t.selection.from,to:t.selection.to},n,e);function n0(n){const e=`<body>${n}</body>`;return new window.DOMParser().parseFromString(e,"text/html").body}function Ma(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),Ma("",e,t)}if(typeof n=="string"){const r=lc.fromSchema(e);return t.slice?r.parseSlice(n0(n),t.parseOptions).content:r.parse(n0(n),t.parseOptions)}return Ma("",e,t)}function FM(n,e,t){const r=n.steps.length-1;if(r<e)return;const i=n.steps[r];if(!(i instanceof it||i instanceof Ge))return;const o=n.mapping.maps[r];let l=0;o.forEach((u,f,h,m)=>{l===0&&(l=m)}),n.setSelection(me.near(n.doc.resolve(l),t))}const HM=n=>n.toString().startsWith("<"),$M=(n,e,t)=>({tr:r,dispatch:i,editor:o})=>{if(i){t={parseOptions:{},updateSelection:!0,...t};const l=Ma(e,o.schema,{parseOptions:{preserveWhitespace:"full",...t.parseOptions}});if(l.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((HM(l)?l:[l]).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,l),t.updateSelection&&FM(r,r.steps.length-1,-1)}return!0},WM=()=>({state:n,dispatch:e})=>WE(n,e),UM=()=>({state:n,dispatch:e})=>UE(n,e),VM=()=>({state:n,dispatch:e})=>zg(n,e),KM=()=>({state:n,dispatch:e})=>Hg(n,e),GM=()=>({tr:n,state:e,dispatch:t})=>{try{const r=da(e.doc,e.selection.$from.pos,-1);return r==null?!1:(n.join(r,2),t&&t(n),!0)}catch{return!1}},qM=()=>({state:n,dispatch:e,tr:t})=>{try{const r=da(n.doc,n.selection.$from.pos,1);return r==null?!1:(t.join(r,2),e&&e(t),!0)}catch{return!1}};function r0(){return typeof navigator<"u"?/Mac/.test(navigator.platform):!1}function JM(n){const e=n.split(/-(?!$)/);let t=e[e.length-1];t==="Space"&&(t=" ");let r,i,o,l;for(let u=0;u<e.length-1;u+=1){const f=e[u];if(/^(cmd|meta|m)$/i.test(f))l=!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))jc()||r0()?l=!0:i=!0;else throw new Error(`Unrecognized modifier name: ${f}`)}return r&&(t=`Alt-${t}`),i&&(t=`Ctrl-${t}`),l&&(t=`Meta-${t}`),o&&(t=`Shift-${t}`),t}const jM=n=>({editor:e,view:t,tr:r,dispatch:i})=>{const o=JM(n).split(/-(?!$)/),l=o.find(h=>!["Alt","Ctrl","Meta","Shift"].includes(h)),u=new KeyboardEvent("keydown",{key:l==="Space"?" ":l,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 Yc(n,e,t={}){const{from:r,to:i,empty:o}=n.selection,l=e?Ue(e,n.schema):null,u=[];n.doc.nodesBetween(r,i,(p,y)=>{if(p.isText)return;const w=Math.max(r,y),S=Math.min(i,y+p.nodeSize);u.push({node:p,from:w,to:S})});const f=i-r,h=u.filter(p=>l?l.name===p.node.type.name:!0).filter(p=>Ea(p.node.attrs,t,{strict:!1}));return o?!!h.length:h.reduce((p,y)=>p+y.to-y.from,0)>=f}const YM=(n,e={})=>({state:t,dispatch:r})=>{const i=Ue(n,t.schema);return Yc(t,i,e)?VE(t,r):!1},XM=()=>({state:n,dispatch:e})=>Kg(n,e),ZM=n=>({state:e,dispatch:t})=>{const r=Ue(n,e.schema);return tM(r)(e,t)},QM=()=>({state:n,dispatch:e})=>Ug(n,e);function Xc(n,e){return e.nodes[n]?"node":e.marks[n]?"mark":null}function i0(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 eT=(n,e)=>({tr:t,state:r,dispatch:i})=>{let o=null,l=null;const u=Xc(typeof n=="string"?n:n.name,r.schema);return u?(u==="node"&&(o=Ue(n,r.schema)),u==="mark"&&(l=dn(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,i0(h.attrs,e)),l&&h.marks.length&&h.marks.forEach(p=>{l===p.type&&t.addMark(m,m+h.nodeSize,l.create(i0(p.attrs,e)))})})}),!0):!1},tT=()=>({tr:n,dispatch:e})=>(e&&n.scrollIntoView(),!0),nT=()=>({tr:n,commands:e})=>e.setTextSelection({from:0,to:n.doc.content.size}),rT=()=>({state:n,dispatch:e})=>Bg(n,e),iT=()=>({state:n,dispatch:e})=>$g(n,e),sT=()=>({state:n,dispatch:e})=>JE(n,e),oT=()=>({state:n,dispatch:e})=>XE(n,e),aT=()=>({state:n,dispatch:e})=>YE(n,e);function lT(n,e,t={}){return Ma(n,e,{slice:!1,parseOptions:t})}const uT=(n,e=!1,t={})=>({tr:r,editor:i,dispatch:o})=>{const{doc:l}=r,u=lT(n,i.schema,t);return o&&r.replaceWith(0,l.content.size,u).setMeta("preventUpdate",!e),!0};function s0(n,e){const t=dn(e,n.schema),{from:r,to:i,empty:o}=n.selection,l=[];o?(n.storedMarks&&l.push(...n.storedMarks),l.push(...n.selection.$head.marks())):n.doc.nodesBetween(r,i,f=>{l.push(...f.marks)});const u=l.find(f=>f.type.name===t.name);return u?{...u.attrs}:{}}function cT(n,e){const t=new q_(n);return e.forEach(r=>{r.steps.forEach(i=>{t.step(i)})}),t}function fT(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 hT(n,e,t){const r=[];return n.nodesBetween(e.from,e.to,(i,o)=>{t(i)&&r.push({node:i,pos:o})}),r}function dT(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 Zc(n){return e=>dT(e.$from,n)}function pT(n,e){const t=Wi.resolve(n);return Zg(t,e)}function mT(n,e){const t=Ue(e,n.schema),{from:r,to:i}=n.selection,o=[];n.doc.nodesBetween(r,i,u=>{o.push(u)});const l=o.reverse().find(u=>u.type.name===t.name);return l?{...l.attrs}:{}}function gT(n,e){const t=Xc(typeof e=="string"?e:e.name,n.schema);return t==="node"?mT(n,e):t==="mark"?s0(n,e):{}}function yT(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 bT(n){const e=yT(n);return e.length===1?e:e.filter((t,r)=>!e.filter((o,l)=>l!==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 vT(n){const{mapping:e,steps:t}=n,r=[];return e.maps.forEach((i,o)=>{const l=[];if(i.ranges.length)i.forEach((u,f)=>{l.push({from:u,to:f})});else{const{from:u,to:f}=t[o];if(u===void 0||f===void 0)return;l.push({from:u,to:f})}l.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}})})}),bT(r)}function o0(n,e,t){const r=[];return n===e?t.resolve(n).marks().forEach(i=>{const o=t.resolve(n-1),l=Jc(o,i.type);l&&r.push({mark:i,...l})}):t.nodesBetween(n,e,(i,o)=>{r.push(...i.marks.map(l=>({from:o,to:o+i.nodeSize,mark:l})))}),r}function Ta(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 wT(n,e,t={}){const{empty:r,ranges:i}=n.selection,o=e?dn(e,n.schema):null;if(r)return!!(n.storedMarks||n.selection.$from.marks()).filter(p=>o?o.name===p.type.name:!0).find(p=>Ea(p.attrs,t,{strict:!1}));let l=0;const u=[];if(i.forEach(({$from:p,$to:y})=>{const w=p.pos,S=y.pos;n.doc.nodesBetween(w,S,(M,T)=>{if(!M.isText&&!M.marks.length)return;const I=Math.max(w,T),F=Math.min(S,T+M.nodeSize),B=F-I;l+=B,u.push(...M.marks.map($=>({mark:$,from:I,to:F})))})}),l===0)return!1;const f=u.filter(p=>o?o.name===p.mark.type.name:!0).filter(p=>Ea(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)>=l}function a0(n,e){const{nodeExtensions:t}=ka(e),r=t.find(l=>l.name===n);if(!r)return!1;const i={name:r.name,options:r.options,storage:r.storage},o=le(V(r,"group",i));return typeof o!="string"?!1:o.split(" ").includes("list")}function ST(n,e,t){var r;const{selection:i}=e;let o=null;if(t0(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:l}=i;return l.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 w=!y||y.type.allowsMarkType(t),S=!!t.isInSet(m.marks)||!m.marks.some(M=>M.type.excludes(t));h=w&&S}return!h}),h})}const xT=(n,e={})=>({tr:t,state:r,dispatch:i})=>{const{selection:o}=t,{empty:l,ranges:u}=o,f=dn(n,r.schema);if(i)if(l){const h=s0(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,w)=>{const S=Math.max(w,m),M=Math.min(w+y.nodeSize,p);y.marks.find(I=>I.type===f)?y.marks.forEach(I=>{f===I.type&&t.addMark(S,M,f.create({...I.attrs,...e}))}):t.addMark(S,M,f.create(e))})});return ST(r,t,f)},kT=(n,e)=>({tr:t})=>(t.setMeta(n,e),!0),_T=(n,e={})=>({state:t,dispatch:r,chain:i})=>{const o=Ue(n,t.schema);return o.isTextblock?i().command(({commands:l})=>Jg(o,e)(t)?!0:l.clearNodes()).command(({state:l})=>Jg(o,e)(l,r)).run():(console.warn('[tiptap warn]: Currently "setNode()" only supports text block nodes.'),!1)},ET=n=>({tr:e,dispatch:t})=>{if(t){const{doc:r}=e,i=Ur(n,0,r.content.size),o=Z.create(r,i);e.setSelection(o)}return!0},MT=n=>({tr:e,dispatch:t})=>{if(t){const{doc:r}=e,{from:i,to:o}=typeof n=="number"?{from:n,to:n}:n,l=de.atStart(r).from,u=de.atEnd(r).to,f=Ur(i,l,u),h=Ur(o,l,u),m=de.create(r,f,h);e.setSelection(m)}return!0},TT=n=>({state:e,dispatch:t})=>{const r=Ue(n,e.schema);return iM(r)(e,t)};function l0(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 CT=({keepMarks:n=!0}={})=>({tr:e,state:t,dispatch:r,editor:i})=>{const{selection:o,doc:l}=e,{$from:u,$to:f}=o,h=i.extensionManager.attributes,m=Ta(h,u.node().type.name,u.node().attrs);if(o instanceof Z&&o.node.isBlock)return!u.parentOffset||!zn(l,u.pos)?!1:(r&&(n&&l0(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 de&&e.deleteSelection();const y=u.depth===0?void 0:fT(u.node(-1).contentMatchAt(u.indexAfter(-1)));let w=p&&y?[{type:y,attrs:m}]:void 0,S=zn(e.doc,e.mapping.map(u.pos),1,w);if(!w&&!S&&zn(e.doc,e.mapping.map(u.pos),1,y?[{type:y}]:void 0)&&(S=!0,w=y?[{type:y,attrs:m}]:void 0),S&&(e.split(e.mapping.map(u.pos),1,w),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&&l0(t,i.extensionManager.splittableMarks),e.scrollIntoView()}return!0},AT=n=>({tr:e,state:t,dispatch:r,editor:i})=>{var o;const l=Ue(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!==l)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!==l||u.index(-2)!==u.node(-2).childCount-1)return!1;if(r){let T=L.empty;const I=u.index(-1)?1:u.index(-2)?2:3;for(let ie=u.depth-I;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=Ta(p,u.node().type.name,u.node().attrs),$=((o=l.contentMatch.defaultType)===null||o===void 0?void 0:o.createAndFill(B))||void 0;T=T.append(L.from(l.createAndFill(null,$)||void 0));const X=u.before(u.depth-(I-1));e.replace(X,u.after(-F),new U(T,4-I,0));let q=-1;e.doc.nodesBetween(X,e.doc.content.size,(ie,Ee)=>{if(q>-1)return!1;ie.isTextblock&&ie.content.size===0&&(q=Ee+1)}),q>-1&&e.setSelection(de.near(e.doc.resolve(q))),e.scrollIntoView()}return!0}const y=f.pos===u.end()?m.contentMatchAt(0).defaultType:null,w=Ta(p,m.type.name,m.attrs),S=Ta(p,u.node().type.name,u.node().attrs);e.delete(u.pos,f.pos);const M=y?[{type:l,attrs:w},{type:y,attrs:S}]:[{type:l,attrs:w}];if(!zn(e.doc,u.pos,2))return!1;if(r){const{selection:T,storedMarks:I}=t,{splittableMarks:F}=i.extensionManager,B=I||T.$to.parentOffset&&T.$from.marks();if(e.split(u.pos,2,M).scrollIntoView(),!B||!r)return!0;const $=B.filter(X=>F.includes(X.type.name));e.ensureMarks($)}return!0},Qc=(n,e)=>{const t=Zc(l=>l.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&&cr(n.doc,t.pos)&&n.join(t.pos),!0},ef=(n,e)=>{const t=Zc(l=>l.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&&cr(n.doc,r)&&n.join(r),!0},IT=(n,e,t,r={})=>({editor:i,tr:o,state:l,dispatch:u,chain:f,commands:h,can:m})=>{const{extensions:p,splittableMarks:y}=i.extensionManager,w=Ue(n,l.schema),S=Ue(e,l.schema),{selection:M,storedMarks:T}=l,{$from:I,$to:F}=M,B=I.blockRange(F),$=T||M.$to.parentOffset&&M.$from.marks();if(!B)return!1;const X=Zc(q=>a0(q.type.name,p))(M);if(B.depth>=1&&X&&B.depth-X.depth<=1){if(X.node.type===w)return h.liftListItem(S);if(a0(X.node.type.name,p)&&w.validContent(X.node.content)&&u)return f().command(()=>(o.setNodeMarkup(X.pos,w),!0)).command(()=>Qc(o,w)).command(()=>ef(o,w)).run()}return!t||!$||!u?f().command(()=>m().wrapInList(w,r)?!0:h.clearNodes()).wrapInList(w,r).command(()=>Qc(o,w)).command(()=>ef(o,w)).run():f().command(()=>{const q=m().wrapInList(w,r),ie=$.filter(Ee=>y.includes(Ee.type.name));return o.ensureMarks(ie),q?!0:h.clearNodes()}).wrapInList(w,r).command(()=>Qc(o,w)).command(()=>ef(o,w)).run()},OT=(n,e={},t={})=>({state:r,commands:i})=>{const{extendEmptyMarkRange:o=!1}=t,l=dn(n,r.schema);return wT(r,l,e)?i.unsetMark(l,{extendEmptyMarkRange:o}):i.setMark(l,e)},NT=(n,e,t={})=>({state:r,commands:i})=>{const o=Ue(n,r.schema),l=Ue(e,r.schema);return Yc(r,o,t)?i.setNode(l):i.setNode(o,t)},RT=(n,e={})=>({state:t,commands:r})=>{const i=Ue(n,t.schema);return Yc(t,i,e)?r.lift(i):r.wrapIn(i,e)},LT=()=>({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 l=n.tr,u=o.transform;for(let f=u.steps.length-1;f>=0;f-=1)l.step(u.steps[f].invert(u.docs[f]));if(o.text){const f=l.doc.resolve(o.from).marks();l.replaceWith(o.from,o.to,n.schema.text(o.text,f))}else l.delete(o.from,o.to)}return!0}}return!1},PT=()=>({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},DT=(n,e={})=>({tr:t,state:r,dispatch:i})=>{var o;const{extendEmptyMarkRange:l=!1}=e,{selection:u}=t,f=dn(n,r.schema),{$from:h,empty:m,ranges:p}=u;if(!i)return!0;if(m&&l){let{from:y,to:w}=u;const S=(o=h.marks().find(T=>T.type===f))===null||o===void 0?void 0:o.attrs,M=Jc(h,f,S);M&&(y=M.from,w=M.to),t.removeMark(y,w,f)}else p.forEach(y=>{t.removeMark(y.$from.pos,y.$to.pos,f)});return t.removeStoredMark(f),!0},zT=(n,e={})=>({tr:t,state:r,dispatch:i})=>{let o=null,l=null;const u=Xc(typeof n=="string"?n:n.name,r.schema);return u?(u==="node"&&(o=Ue(n,r.schema)),u==="mark"&&(l=dn(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}),l&&p.marks.length&&p.marks.forEach(w=>{if(l===w.type){const S=Math.max(y,h),M=Math.min(y+p.nodeSize,m);t.addMark(S,M,l.create({...w.attrs,...e}))}})})}),!0):!1},BT=(n,e={})=>({state:t,dispatch:r})=>{const i=Ue(n,t.schema);return ZE(i,e)(t,r)},FT=(n,e={})=>({state:t,dispatch:r})=>{const i=Ue(n,t.schema);return QE(i,e)(t,r)};var HT=Object.freeze({__proto__:null,blur:wM,clearContent:SM,clearNodes:xM,command:kM,createParagraphNear:_M,cut:EM,deleteCurrentNode:MM,deleteNode:TM,deleteRange:CM,deleteSelection:AM,enter:IM,exitCode:OM,extendMarkRange:RM,first:LM,focus:DM,forEach:zM,insertContent:BM,insertContentAt:$M,joinUp:WM,joinDown:UM,joinBackward:VM,joinForward:KM,joinItemBackward:GM,joinItemForward:qM,keyboardShortcut:jM,lift:YM,liftEmptyBlock:XM,liftListItem:ZM,newlineInCode:QM,resetAttributes:eT,scrollIntoView:tT,selectAll:nT,selectNodeBackward:rT,selectNodeForward:iT,selectParentNode:sT,selectTextblockEnd:oT,selectTextblockStart:aT,setContent:uT,setMark:xT,setMeta:kT,setNode:_T,setNodeSelection:ET,setTextSelection:MT,sinkListItem:TT,splitBlock:CT,splitListItem:AT,toggleList:IT,toggleMark:OT,toggleNode:NT,toggleWrap:RT,undoInputRule:LT,unsetAllMarks:PT,unsetMark:DT,updateAttributes:zT,wrapIn:BT,wrapInList:FT});Ne.create({name:"commands",addCommands(){return{...HT}}}),Ne.create({name:"editable",addProseMirrorPlugins(){return[new Mt({key:new rn("editable"),props:{editable:()=>this.editor.options.editable}})]}}),Ne.create({name:"focusEvents",addProseMirrorPlugins(){const{editor:n}=this;return[new Mt({key:new rn("focusEvents"),props:{handleDOMEvents:{focus:(e,t)=>{n.isFocused=!0;const r=n.state.tr.setMeta("focus",{event:t}).setMeta("addToHistory",!1);return e.dispatch(r),!1},blur:(e,t)=>{n.isFocused=!1;const r=n.state.tr.setMeta("blur",{event:t}).setMeta("addToHistory",!1);return e.dispatch(r),!1}}}})]}}),Ne.create({name:"keymap",addKeyboardShortcuts(){const n=()=>this.editor.commands.first(({commands:l})=>[()=>l.undoInputRule(),()=>l.command(({tr:u})=>{const{selection:f,doc:h}=u,{empty:m,$anchor:p}=f,{pos:y,parent:w}=p,S=p.parent.isTextblock?u.doc.resolve(y-1):p,M=S.parent.type.spec.isolating,T=p.pos-p.parentOffset,I=M&&S.parent.childCount===1?T===p.pos:me.atStart(h).from===y;return!m||!I||!w.type.isTextblock||w.textContent.length?!1:l.clearNodes()}),()=>l.deleteSelection(),()=>l.joinBackward(),()=>l.selectNodeBackward()]),e=()=>this.editor.commands.first(({commands:l})=>[()=>l.deleteSelection(),()=>l.deleteCurrentNode(),()=>l.joinForward(),()=>l.selectNodeForward()]),r={Enter:()=>this.editor.commands.first(({commands:l})=>[()=>l.newlineInCode(),()=>l.createParagraphNear(),()=>l.liftEmptyBlock(),()=>l.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 jc()||r0()?o:i},addProseMirrorPlugins(){return[new Mt({key:new rn("clearDocument"),appendTransaction:(n,e,t)=>{if(!(n.some(S=>S.docChanged)&&!e.doc.eq(t.doc)))return;const{empty:i,from:o,to:l}=e.selection,u=me.atStart(e.doc).from,f=me.atEnd(e.doc).to;if(i||!(o===u&&l===f)||!(t.doc.textBetween(0,t.doc.content.size," "," ").length===0))return;const p=t.tr,y=xa({state:t,transaction:p}),{commands:w}=new $c({editor:this.editor,state:y});if(w.clearNodes(),!!p.steps.length)return p}})]}}),Ne.create({name:"tabindex",addProseMirrorPlugins(){return[new Mt({key:new rn("tabindex"),props:{attributes:this.editor.isEditable?{tabindex:"0"}:{}}})]}});function $T(n){return new e0({find:n.find,handler:({state:e,range:t,match:r})=>{const i=e.doc.resolve(t.from),o=le(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 WT(n){return new e0({find:n.find,handler:({state:e,range:t,match:r,chain:i})=>{const o=le(n.getAttributes,void 0,r)||{},l=e.tr.delete(t.from,t.to),f=l.doc.resolve(t.from).blockRange(),h=f&&pc(f,n.type,o);if(!h)return null;if(l.wrap(f,h),n.keepMarks&&n.editor){const{selection:p,storedMarks:y}=e,{splittableMarks:w}=n.editor.extensionManager,S=y||p.$to.parentOffset&&p.$from.marks();if(S){const M=S.filter(T=>w.includes(T.type.name));l.ensureMarks(M)}}if(n.keepAttributes){const p=n.type.name==="bulletList"||n.type.name==="orderedList"?"listItem":"taskList";i().updateAttributes(p,o).run()}const m=l.doc.resolve(t.from-1).nodeBefore;m&&m.type===n.type&&cr(l.doc,t.from-1)&&(!n.joinPredicate||n.joinPredicate(r,m))&&l.join(t.from-1)}})}class Ct{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=le(V(this,"addOptions",{name:this.name}))),this.storage=le(V(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(e={}){return new Ct(e)}configure(e={}){const t=this.extend();return t.options=_a(this.options,e),t.storage=le(V(t,"addStorage",{name:t.name,options:t.options})),t}extend(e={}){const t=new Ct(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=le(V(t,"addOptions",{name:t.name})),t.storage=le(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 l=i.marks();if(!!!l.find(h=>h?.type.name===t.name))return!1;const f=l.find(h=>h?.type.name===t.name);return f&&r.removeStoredMark(f),r.insertText(" ",i.pos),e.view.dispatch(r),!0}return!1}}class Kn{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=le(V(this,"addOptions",{name:this.name}))),this.storage=le(V(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(e={}){return new Kn(e)}configure(e={}){const t=this.extend();return t.options=_a(this.options,e),t.storage=le(V(t,"addStorage",{name:t.name,options:t.options})),t}extend(e={}){const t=new Kn(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=le(V(t,"addOptions",{name:t.name})),t.storage=le(V(t,"addStorage",{name:t.name,options:t.options})),t}}function UT(n){return new hM({find:n.find,handler:({state:e,range:t,match:r,pasteEvent:i})=>{const o=le(n.getAttributes,void 0,r,i);if(o===!1||o===null)return null;const{tr:l}=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(o0(t.from,t.to,e.doc).filter(S=>S.mark.type.excluded.find(T=>T===n.type&&T!==S.mark.type)).filter(S=>S.to>p).length)return null;y<t.to&&l.delete(y,t.to),p>t.from&&l.delete(t.from+m,p),h=t.from+m+u.length,l.addMark(t.from+m,h,n.type.create(o||{})),l.removeStoredMark(n.type)}}})}const VT=Kn.create({name:"text",group:"inline"});var Ca=200,Ze=function(){};Ze.prototype.append=function(e){return e.length?(e=Ze.from(e),!this.length&&e||e.length<Ca&&this.leafAppend(e)||this.length<Ca&&e.leafPrepend(this)||this.appendInner(e)):this},Ze.prototype.prepend=function(e){return e.length?Ze.from(e).append(this):this},Ze.prototype.appendInner=function(e){return new KT(this,e)},Ze.prototype.slice=function(e,t){return e===void 0&&(e=0),t===void 0&&(t=this.length),e>=t?Ze.empty:this.sliceInner(Math.max(0,e),Math.min(this.length,t))},Ze.prototype.get=function(e){if(!(e<0||e>=this.length))return this.getInner(e)},Ze.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)},Ze.prototype.map=function(e,t,r){t===void 0&&(t=0),r===void 0&&(r=this.length);var i=[];return this.forEach(function(o,l){return i.push(e(o,l))},t,r),i},Ze.from=function(e){return e instanceof Ze?e:e&&e.length?new u0(e):Ze.empty};var u0=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,l,u){for(var f=o;f<l;f++)if(i(this.values[f],u+f)===!1)return!1},e.prototype.forEachInvertedInner=function(i,o,l,u){for(var f=o-1;f>=l;f--)if(i(this.values[f],u+f)===!1)return!1},e.prototype.leafAppend=function(i){if(this.length+i.length<=Ca)return new e(this.values.concat(i.flatten()))},e.prototype.leafPrepend=function(i){if(this.length+i.length<=Ca)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}(Ze);Ze.empty=new u0([]);var KT=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,l){var u=this.left.length;if(i<u&&this.left.forEachInner(r,i,Math.min(o,u),l)===!1||o>u&&this.right.forEachInner(r,Math.max(i-u,0),Math.min(this.length,o)-u,l+u)===!1)return!1},e.prototype.forEachInvertedInner=function(r,i,o,l){var u=this.left.length;if(i>u&&this.right.forEachInvertedInner(r,i-u,Math.max(o,u)-u,l+u)===!1||o<u&&this.left.forEachInvertedInner(r,Math.min(i,u),o,l)===!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}(Ze),c0=Ze;const GT=500;class ln{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 l=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 yn(p.map));let w=p.step.map(i.slice(o)),S;w&&l.maybeStep(w).doc&&(S=l.mapping.maps[l.mapping.maps.length-1],h.push(new yn(S,void 0,void 0,h.length+m.length))),o--,S&&i.appendMap(S,o)}else l.maybeStep(p.step);if(p.selection)return u=i?p.selection.map(i.slice(o)):p.selection,f=new ln(this.items.slice(0,r).append(m.reverse().concat(h)),this.eventCount-1),!1},this.items.length,0),{remaining:f,transform:l,selection:u}}addTransform(e,t,r,i){let o=[],l=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 yn(e.mapping.maps[m],p,t),w;(w=f&&f.merge(y))&&(y=w,m?o.pop():u=u.slice(0,u.length-1)),o.push(y),t&&(l++,t=void 0),i||(f=y)}let h=l-r.depth;return h>JT&&(u=qT(u,h),l-=h),new ln(u.append(o),l)}remapping(e,t){let r=new Ui;return this.items.forEach((i,o)=>{let l=i.mirrorOffset!=null&&o-i.mirrorOffset>=e?r.maps.length-i.mirrorOffset:void 0;r.appendMap(i.map,l)},e,t),r}addMaps(e){return this.eventCount==0?this:new ln(this.items.append(e.map(t=>new yn(t))),this.eventCount)}rebased(e,t){if(!this.eventCount)return this;let r=[],i=Math.max(0,this.items.length-t),o=e.mapping,l=e.steps.length,u=this.eventCount;this.items.forEach(y=>{y.selection&&u--},i);let f=t;this.items.forEach(y=>{let w=o.getMirror(--f);if(w==null)return;l=Math.min(l,w);let S=o.maps[w];if(y.step){let M=e.steps[w].invert(e.docs[w]),T=y.selection&&y.selection.map(o.slice(f+1,w));T&&u++,r.push(new yn(S,M,T))}else r.push(new yn(S))},i);let h=[];for(let y=t;y<l;y++)h.push(new yn(o.maps[y]));let m=this.items.slice(0,i).append(h).append(r),p=new ln(m,u);return p.emptyItemCount()>GT&&(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((l,u)=>{if(u>=e)i.push(l),l.selection&&o++;else if(l.step){let f=l.step.map(t.slice(r)),h=f&&f.getMap();if(r--,h&&t.appendMap(h,r),f){let m=l.selection&&l.selection.map(t.slice(r));m&&o++;let p=new yn(h.invert(),f,m),y,w=i.length-1;(y=i.length&&i[w].merge(p))?i[w]=y:i.push(p)}}else l.map&&r--},this.items.length,0),new ln(c0.from(i.reverse()),o)}}ln.empty=new ln(c0.empty,0);function qT(n,e){let t;return n.forEach((r,i)=>{if(r.selection&&e--==0)return t=i,!1}),n.slice(t)}class yn{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 yn(t.getMap().invert(),t,this.selection)}}}class mr{constructor(e,t,r,i){this.done=e,this.undone=t,this.prevRanges=r,this.prevTime=i}}const JT=20;function jT(n,e,t,r){let i=t.getMeta(gr),o;if(i)return i.historyState;t.getMeta(XT)&&(n=new mr(n.done,n.undone,null,0));let l=t.getMeta("appendedTransaction");if(t.steps.length==0)return n;if(l&&l.getMeta(gr))return l.getMeta(gr).redo?new mr(n.done.addTransform(t,void 0,r,Aa(e)),n.undone,f0(t.mapping.maps[t.steps.length-1]),n.prevTime):new mr(n.done,n.undone.addTransform(t,void 0,r,Aa(e)),null,n.prevTime);if(t.getMeta("addToHistory")!==!1&&!(l&&l.getMeta("addToHistory")===!1)){let u=n.prevTime==0||!l&&(n.prevTime<(t.time||0)-r.newGroupDelay||!YT(t,n.prevRanges)),f=l?tf(n.prevRanges,t.mapping):f0(t.mapping.maps[t.steps.length-1]);return new mr(n.done.addTransform(t,u?e.selection.getBookmark():void 0,r,Aa(e)),ln.empty,f,t.time)}else return(o=t.getMeta("rebased"))?new mr(n.done.rebased(t,o),n.undone.rebased(t,o),tf(n.prevRanges,t.mapping),n.prevTime):new mr(n.done.addMaps(t.mapping.maps),n.undone.addMaps(t.mapping.maps),tf(n.prevRanges,t.mapping),n.prevTime)}function YT(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 f0(n){let e=[];return n.forEach((t,r,i,o)=>e.push(i,o)),e}function tf(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 h0(n,e,t,r){let i=Aa(e),o=gr.get(e).spec.config,l=(r?n.undone:n.done).popEvent(e,i);if(!l)return;let u=l.selection.resolve(l.transform.doc),f=(r?n.done:n.undone).addTransform(l.transform,e.selection.getBookmark(),o,i),h=new mr(r?f:l.remaining,r?l.remaining:f,null,0);t(l.transform.setSelection(u).setMeta(gr,{redo:r,historyState:h}).scrollIntoView())}let nf=!1,d0=null;function Aa(n){let e=n.plugins;if(d0!=e){nf=!1,d0=e;for(let t=0;t<e.length;t++)if(e[t].spec.historyPreserveItems){nf=!0;break}}return nf}const gr=new rn("history"),XT=new rn("closeHistory");function ZT(n={}){return n={depth:n.depth||100,newGroupDelay:n.newGroupDelay||500},new Mt({key:gr,state:{init(){return new mr(ln.empty,ln.empty,null,0)},apply(e,t,r){return jT(t,r,e,n)}},config:n,props:{handleDOMEvents:{beforeinput(e,t){let r=t.inputType,i=r=="historyUndo"?p0:r=="historyRedo"?m0:null;return i?(t.preventDefault(),i(e.state,e.dispatch)):!1}}}})}const p0=(n,e)=>{let t=gr.getState(n);return!t||t.done.eventCount==0?!1:(e&&h0(t,n,e,!1),!0)},m0=(n,e)=>{let t=gr.getState(n);return!t||t.undone.eventCount==0?!1:(e&&h0(t,n,e,!0),!0)},QT=Ne.create({name:"history",addOptions(){return{depth:100,newGroupDelay:500}},addCommands(){return{undo:()=>({state:n,dispatch:e})=>p0(n,e),redo:()=>({state:n,dispatch:e})=>m0(n,e)}},addProseMirrorPlugins(){return[ZT(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()}}});var rf=(n=>(n.COMMON="common",n.MOBILE="mobile",n.TABLET="tablet",n.DESKTOP="desktop",n))(rf||{});const sf=Object.freeze({...rf,get values(){return Object.values(rf)}}),of=Object.freeze({UPPERCASE:"uppercase",LOWERCASE:"lowercase",CAPITALIZE:"capitalize"}),yr=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]}}),$t=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]}}),on=Object.freeze({SETTINGS:"settings",ALL:"_"}),g0=Object.freeze({BLANK:"_blank",SELF:"_self"}),Rs=Object.freeze({URL:"url",BLOCK:"block"});class af{static create(e,t){const r=new this(e,t||{});return new Mt({key:new rn(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 eC extends af{addProps(){return{transformPastedHTML:this._transformPastedHTML,handlePaste:this._handlePaste}}_transformPastedHTML(e){if(e.includes("data-pm-slice")&&e.includes("zw-style"))return e;const t=hl.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,l,u)=>{u.type.name===ne.DOCUMENT&&(r=Math.min(r,l+1),i=Math.max(i,l+o.nodeSize-1))}),{from:r,to:i}}_isMatchPosition(e,t){return Math.abs(e-t)<5}}class tC extends af{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=wn.node(i,i+r.nodeSize,{class:"zw-wysiwyg__placeholder","data-placeholder":"Type your text here..."});t.push(o)}return!1}),qe.create(e,t)}}const nC="aaa1rp3barth4b0ott3vie4c1le2ogado5udhabi7c0ademy5centure6ountant0s9o1tor4d0s1ult4e0g1ro2tna4f0l1rica5g0akhan5ency5i0g1rbus3force5tel5kdn3l0faromeo7ibaba4pay4lfinanz6state5y2sace3tom5m0azon4ericanexpress7family11x2fam3ica3sterdam8nalytics7droid5quan4z2o0l2partments8p0le4q0uarelle8r0ab1mco4chi3my2pa2t0e3s0da2ia2sociates9t0hleta5torney7u0ction5di0ble3o3spost5thor3o0s4vianca6w0s2x0a2z0ure5ba0by2idu3namex3narepublic11d1k2r0celona5laycard4s5efoot5gains6seball5ketball8uhaus5yern5b0c1t1va3cg1n2d1e0ats2uty4er2ntley5rlin4st0buy5t2f1g1h0arti5i0ble3d1ke2ng0o3o1z2j1lack0friday9ockbuster8g1omberg7ue3m0s1w2n0pparibas9o0ats3ehringer8fa2m1nd2o0k0ing5sch2tik2on4t1utique6x2r0adesco6idgestone9oadway5ker3ther5ussels7s1t1uild0ers6siness6y1zz3v1w1y1z0h3ca0b1fe2l0l1vinklein9m0era3p2non3petown5ital0one8r0avan4ds2e0er0s4s2sa1e1h1ino4t0ering5holic7ba1n1re2s2c1d1enter4o1rn3f0a1d2g1h0anel2nel4rity4se2t2eap3intai5ristmas6ome4urch5i0priani6rcle4sco3tadel4i0c2y0eats7k1l0aims4eaning6ick2nic1que6othing5ud3ub0med6m1n1o0ach3des3ffee4llege4ogne5m0cast4mbank4unity6pany2re3uter5sec4ndos3struction8ulting7tact3ractors9oking0channel11l1p2rsica5untry4pon0s4rses6pa2r0edit0card4union9icket5own3s1uise0s6u0isinella9v1w1x1y0mru3ou3z2dabur3d1nce3ta1e1ing3sun4y2clk3ds2e0al0er2s3gree4livery5l1oitte5ta3mocrat6ntal2ist5si0gn4v2hl2iamonds6et2gital5rect0ory7scount3ver5h2y2j1k1m1np2o0cs1tor4g1mains5t1wnload7rive4tv2ubai3nlop4pont4rban5vag2r2z2earth3t2c0o2deka3u0cation8e1g1mail3erck5nergy4gineer0ing9terprises10pson4quipment8r0icsson6ni3s0q1tate5t0isalat7u0rovision8s2vents5xchange6pert3osed4ress5traspace10fage2il1rwinds6th3mily4n0s2rm0ers5shion4t3edex3edback6rrari3ero6i0at2delity5o2lm2nal1nce1ial7re0stone6mdale6sh0ing5t0ness6j1k1lickr3ghts4r2orist4wers5y2m1o0o0d0network8tball6rd1ex2sale4um3undation8x2r0ee1senius7l1ogans4ntdoor4ier7tr2ujitsu5n0d2rniture7tbol5yi3ga0l0lery3o1up4me0s3p1rden4y2b0iz3d0n2e0a1nt0ing5orge5f1g0ee3h1i0ft0s3ves2ing5l0ass3e1obal2o4m0ail3bh2o1x2n1odaddy5ld0point6f2o0dyear5g0le4p1t1v2p1q1r0ainger5phics5tis4een3ipe3ocery4up4s1t1u0ardian6cci3ge2ide2tars5ru3w1y2hair2mburg5ngout5us3bo2dfc0bank7ealth0care8lp1sinki6re1mes5gtv3iphop4samitsu7tachi5v2k0t2m1n1ockey4ldings5iday5medepot5goods5s0ense7nda3rse3spital5t0ing5t0eles2s3mail5use3w2r1sbc3t1u0ghes5yatt3undai7ibm2cbc2e1u2d1e0ee3fm2kano4l1m0amat4db2mo0bilien9n0c1dustries8finiti5o2g1k1stitute6urance4e4t0ernational10uit4vestments10o1piranga7q1r0ish4s0maili5t0anbul7t0au2v3jaguar4va3cb2e0ep2tzt3welry6io2ll2m0p2nj2o0bs1urg4t1y2p0morgan6rs3uegos4niper7kaufen5ddi3e0rryhotels6logistics9properties14fh2g1h1i0a1ds2m1nder2le4tchen5wi3m1n1oeln3matsu5sher5p0mg2n2r0d1ed3uokgroup8w1y0oto4z2la0caixa5mborghini8er3ncaster5ia3d0rover6xess5salle5t0ino3robe5w0yer5b1c1ds2ease3clerc5frak4gal2o2xus4gbt3i0dl2fe0insurance9style7ghting6ke2lly3mited4o2ncoln4de2k2psy3ve1ing5k1lc1p2oan0s3cker3us3l1ndon4tte1o3ve3pl0financial11r1s1t0d0a3u0ndbeck6xe1ury5v1y2ma0cys3drid4if1son4keup4n0agement7go3p1rket0ing3s4riott5shalls7serati6ttel5ba2c0kinsey7d1e0d0ia3et2lbourne7me1orial6n0u2rckmsd7g1h1iami3crosoft7l1ni1t2t0subishi9k1l0b1s2m0a2n1o0bi0le4da2e1i1m1nash3ey2ster5rmon3tgage6scow4to0rcycles9v0ie4p1q1r1s0d2t0n1r2u0seum3ic3tual5v1w1x1y1z2na0b1goya4me2tura4vy3ba2c1e0c1t0bank4flix4work5ustar5w0s2xt0direct7us4f0l2g0o2hk2i0co2ke1on3nja3ssan1y5l1o0kia3rthwesternmutual14on4w0ruz3tv4p1r0a1w2tt2u1yc2z2obi1server7ffice5kinawa6layan0group9dnavy5lo3m0ega4ne1g1l0ine5oo2pen3racle3nge4g0anic5igins6saka4tsuka4t2vh3pa0ge2nasonic7ris2s1tners4s1y3ssagens7y2ccw3e0t2f0izer5g1h0armacy6d1ilips5one2to0graphy6s4ysio5ics1tet2ures6d1n0g1k2oneer5zza4k1l0ace2y0station9umbing5s3m1n0c2ohl2ker3litie5rn2st3r0america6xi3ess3ime3o0d0uctions8f1gressive8mo2perties3y5tection8u0dential9s1t1ub2w0c2y2qa1pon3uebec3st5racing4dio4e0ad1lestate6tor2y4cipes5d0stone5umbrella9hab3ise0n3t2liance6n0t0als5pair3ort3ublican8st0aurant8view0s5xroth6ich0ardli6oh3l1o1p2o0cher3ks3deo3gers4om3s0vp3u0gby3hr2n2w0e2yukyu6sa0arland6fe0ty4kura4le1on3msclub4ung5ndvik0coromant12ofi4p1rl2s1ve2xo3b0i1s2c0a1b1haeffler7midt4olarships8ol3ule3warz5ience5ot3d1e0arch3t2cure1ity6ek2lect4ner3rvices6ven3w1x0y3fr2g1h0angrila6rp2w2ell3ia1ksha5oes2p0ping5uji3w0time7i0lk2na1gles5te3j1k0i0n2y0pe4l0ing4m0art3ile4n0cf3o0ccer3ial4ftbank4ware6hu2lar2utions7ng1y2y2pa0ce3ort2t3r0l2s1t0ada2ples4r1tebank4farm7c0group6ockholm6rage3e3ream4udio2y3yle4u0cks3pplies3y2ort5rf1gery5zuki5v1watch4iss4x1y0dney4stems6z2tab1ipei4lk2obao4rget4tamotors6r2too4x0i3c0i2d0k2eam2ch0nology8l1masek5nnis4va3f1g1h0d1eater2re6iaa2ckets5enda4ffany5ps2res2ol4j0maxx4x2k0maxx5l1m0all4n1o0day3kyo3ols3p1ray3shiba5tal3urs3wn2yota3s3r0ade1ing4ining5vel0channel7ers0insurance16ust3v2t1ube2i1nes3shu4v0s2w1z2ua1bank3s2g1k1nicom3versity8o2ol2ps2s1y1z2va0cations7na1guard7c1e0gas3ntures6risign5m\xF6gensberater2ung14sicherung10t2g1i0ajes4deo3g1king4llas4n1p1rgin4sa1ion4va1o3laanderen9n1odka3lkswagen7vo3te1ing3o2yage5u0elos6wales2mart4ter4ng0gou5tch0es6eather0channel12bcam3er2site5d0ding5ibo2r3f1hoswho6ien2ki2lliamhill9n0dows4e1ners6me2olterskluwer11odside6rk0s2ld3w2s1tc1f3xbox3erox4finity6ihuan4n2xx2yz3yachts4hoo3maxun5ndex5e1odobashi7ga2kohama6u0tube6t1un3za0ppos4ra3ero3ip2m1one3uerich6w2",rC="\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",Ri=(n,e)=>{for(const t in e)n[t]=e[t];return n},lf="numeric",uf="ascii",cf="alpha",Ia="asciinumeric",Oa="alphanumeric",ff="domain",y0="emoji",iC="scheme",sC="slashscheme",b0="whitespace";function oC(n,e){return n in e||(e[n]=[]),e[n]}function Vr(n,e,t){e[lf]&&(e[Ia]=!0,e[Oa]=!0),e[uf]&&(e[Ia]=!0,e[cf]=!0),e[Ia]&&(e[Oa]=!0),e[cf]&&(e[Oa]=!0),e[Oa]&&(e[ff]=!0),e[y0]&&(e[ff]=!0);for(const r in e){const i=oC(r,t);i.indexOf(n)<0&&i.push(n)}}function aC(n,e){const t={};for(const r in e)e[r].indexOf(n)>=0&&(t[r]=!0);return t}function vt(n){n===void 0&&(n=null),this.j={},this.jr=[],this.jd=null,this.t=n}vt.groups={},vt.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||vt.groups;let i;return e&&e.j?i=e:(i=new vt(e),t&&r&&Vr(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 l=0;l<o-1;l++)i=i.tt(n[l]);return i.tt(n[o-1],e,t,r)},tt(n,e,t,r){r=r||vt.groups;const i=this;if(e&&e.j)return i.j[n]=e,e;const o=e;let l,u=i.go(n);if(u?(l=new vt,Ri(l.j,u.j),l.jr.push.apply(l.jr,u.jr),l.jd=u.jd,l.t=u.t):l=new vt,o){if(r)if(l.t&&typeof l.t=="string"){const f=Ri(aC(l.t,r),t);Vr(o,f,r)}else t&&Vr(o,t,r);l.t=o}return i.j[n]=l,l}};const G=(n,e,t,r,i)=>n.ta(e,t,r,i),Wt=(n,e,t,r,i)=>n.tr(e,t,r,i),v0=(n,e,t,r,i)=>n.ts(e,t,r,i),D=(n,e,t,r,i)=>n.tt(e,t,r,i),Bn="WORD",hf="UWORD",Ls="LOCALHOST",df="TLD",pf="UTLD",Na="SCHEME",Li="SLASH_SCHEME",mf="NUM",w0="WS",gf="NL",Pi="OPENBRACE",Ps="OPENBRACKET",Ds="OPENANGLEBRACKET",zs="OPENPAREN",Kr="CLOSEBRACE",Di="CLOSEBRACKET",zi="CLOSEANGLEBRACKET",Gr="CLOSEPAREN",Ra="AMPERSAND",La="APOSTROPHE",Pa="ASTERISK",br="AT",Da="BACKSLASH",za="BACKTICK",Ba="CARET",vr="COLON",yf="COMMA",Fa="DOLLAR",pn="DOT",Ha="EQUALS",bf="EXCLAMATION",mn="HYPHEN",$a="PERCENT",Wa="PIPE",Ua="PLUS",Va="POUND",Ka="QUERY",vf="QUOTE",wf="SEMI",gn="SLASH",Bs="TILDE",Ga="UNDERSCORE",S0="EMOJI",qa="SYM";var x0=Object.freeze({__proto__:null,WORD:Bn,UWORD:hf,LOCALHOST:Ls,TLD:df,UTLD:pf,SCHEME:Na,SLASH_SCHEME:Li,NUM:mf,WS:w0,NL:gf,OPENBRACE:Pi,OPENBRACKET:Ps,OPENANGLEBRACKET:Ds,OPENPAREN:zs,CLOSEBRACE:Kr,CLOSEBRACKET:Di,CLOSEANGLEBRACKET:zi,CLOSEPAREN:Gr,AMPERSAND:Ra,APOSTROPHE:La,ASTERISK:Pa,AT:br,BACKSLASH:Da,BACKTICK:za,CARET:Ba,COLON:vr,COMMA:yf,DOLLAR:Fa,DOT:pn,EQUALS:Ha,EXCLAMATION:bf,HYPHEN:mn,PERCENT:$a,PIPE:Wa,PLUS:Ua,POUND:Va,QUERY:Ka,QUOTE:vf,SEMI:wf,SLASH:gn,TILDE:Bs,UNDERSCORE:Ga,EMOJI:S0,SYM:qa});const Bi=/[a-z]/,Sf=/\p{L}/u,xf=/\p{Emoji}/u,kf=/\d/,k0=/\s/,_0=`
|
|
16
|
+
`,lC="\uFE0F",uC="\u200D";let Ja=null,ja=null;function cC(n){n===void 0&&(n=[]);const e={};vt.groups=e;const t=new vt;Ja==null&&(Ja=E0(nC)),ja==null&&(ja=E0(rC)),D(t,"'",La),D(t,"{",Pi),D(t,"[",Ps),D(t,"<",Ds),D(t,"(",zs),D(t,"}",Kr),D(t,"]",Di),D(t,">",zi),D(t,")",Gr),D(t,"&",Ra),D(t,"*",Pa),D(t,"@",br),D(t,"`",za),D(t,"^",Ba),D(t,":",vr),D(t,",",yf),D(t,"$",Fa),D(t,".",pn),D(t,"=",Ha),D(t,"!",bf),D(t,"-",mn),D(t,"%",$a),D(t,"|",Wa),D(t,"+",Ua),D(t,"#",Va),D(t,"?",Ka),D(t,'"',vf),D(t,"/",gn),D(t,";",wf),D(t,"~",Bs),D(t,"_",Ga),D(t,"\\",Da);const r=Wt(t,kf,mf,{[lf]:!0});Wt(r,kf,r);const i=Wt(t,Bi,Bn,{[uf]:!0});Wt(i,Bi,i);const o=Wt(t,Sf,hf,{[cf]:!0});Wt(o,Bi),Wt(o,Sf,o);const l=Wt(t,k0,w0,{[b0]:!0});D(t,_0,gf,{[b0]:!0}),D(l,_0),Wt(l,k0,l);const u=Wt(t,xf,S0,{[y0]:!0});Wt(u,xf,u),D(u,lC,u);const f=D(u,uC);Wt(f,xf,u);const h=[[Bi,i]],m=[[Bi,null],[Sf,o]];for(let p=0;p<Ja.length;p++)wr(t,Ja[p],df,Bn,h);for(let p=0;p<ja.length;p++)wr(t,ja[p],pf,hf,m);Vr(df,{tld:!0,ascii:!0},e),Vr(pf,{utld:!0,alpha:!0},e),wr(t,"file",Na,Bn,h),wr(t,"mailto",Na,Bn,h),wr(t,"http",Li,Bn,h),wr(t,"https",Li,Bn,h),wr(t,"ftp",Li,Bn,h),wr(t,"ftps",Li,Bn,h),Vr(Na,{scheme:!0,ascii:!0},e),Vr(Li,{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],S=n[p][1]?{[iC]:!0}:{[sC]:!0};y.indexOf("-")>=0?S[ff]=!0:Bi.test(y)?kf.test(y)?S[Ia]=!0:S[uf]=!0:S[lf]=!0,v0(t,y,y,S)}return v0(t,"localhost",Ls,{ascii:!0}),t.jd=new vt(qa),{start:t,tokens:Ri({groups:e},x0)}}function fC(n,e){const t=hC(e.replace(/[A-Z]/g,u=>u.toLowerCase())),r=t.length,i=[];let o=0,l=0;for(;l<r;){let u=n,f=null,h=0,m=null,p=-1,y=-1;for(;l<r&&(f=u.go(t[l]));)u=f,u.accepts()?(p=0,y=0,m=u):p>=0&&(p+=t[l].length,y++),h+=t[l].length,o+=t[l].length,l++;o-=p,l-=y,h-=p,i.push({t:m.t,v:e.slice(o-h,o),s:o-h,e:o})}return i}function hC(n){const e=[],t=n.length;let r=0;for(;r<t;){let i=n.charCodeAt(r),o,l=i<55296||i>56319||r+1===t||(o=n.charCodeAt(r+1))<56320||o>57343?n[r]:n.slice(r,r+2);e.push(l),r+=l.length}return e}function wr(n,e,t,r,i){let o;const l=e.length;for(let u=0;u<l-1;u++){const f=e[u];n.j[f]?o=n.j[f]:(o=new vt(r),o.jr=i.slice(),n.j[f]=o),n=o}return o=new vt(t),o.jr=i.slice(),n.j[e[l-1]]=o,o}function E0(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 l=parseInt(n.substring(r,r+o),10);l>0;l--)t.pop();r+=o}else t.push(n[r]),r++}return e}const Fs={defaultProtocol:"http",events:null,format:M0,formatHref:M0,nl2br:!1,tagName:"a",target:null,rel:null,validate:!0,truncate:1/0,className:null,attributes:null,ignoreTags:[],render:null};function _f(n,e){e===void 0&&(e=null);let t=Ri({},Fs);n&&(t=Ri(t,n instanceof _f?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}_f.prototype={o:Fs,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]:Fs[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 M0(n){return n}function T0(n,e){this.t="token",this.v=n,this.tk=e}T0.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=Fs.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),l={},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 l.href=r,u&&(l.class=u),f&&(l.target=f),h&&(l.rel=h),m&&Ri(l,m),{tagName:i,attributes:l,content:o,eventListeners:p}}};function Ya(n,e){class t extends T0{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 C0=Ya("email",{isLink:!0,toHref(){return"mailto:"+this.toString()}}),A0=Ya("text"),dC=Ya("nl"),qr=Ya("url",{isLink:!0,toHref(n){return n===void 0&&(n=Fs.defaultProtocol),this.hasProtocol()?this.v:`${n}://${this.v}`},hasProtocol(){const n=this.tk;return n.length>=2&&n[0].t!==Ls&&n[1].t===vr}}),Ve=n=>new vt(n);function pC(n){let{groups:e}=n;const t=e.domain.concat([Ra,Pa,br,Da,za,Ba,Fa,Ha,mn,mf,$a,Wa,Ua,Va,gn,qa,Bs,Ga]),r=[La,zi,Kr,Di,Gr,vr,yf,pn,bf,Ds,Pi,Ps,zs,Ka,vf,wf],i=[Ra,La,Pa,Da,za,Ba,Kr,Fa,Ha,mn,Pi,$a,Wa,Ua,Va,Ka,gn,qa,Bs,Ga],o=Ve(),l=D(o,Bs);G(l,i,l),G(l,e.domain,l);const u=Ve(),f=Ve(),h=Ve();G(o,e.domain,u),G(o,e.scheme,f),G(o,e.slashscheme,h),G(u,i,l),G(u,e.domain,u);const m=D(u,br);D(l,br,m),D(f,br,m),D(h,br,m);const p=D(l,pn);G(p,i,l),G(p,e.domain,l);const y=Ve();G(m,e.domain,y),G(y,e.domain,y);const w=D(y,pn);G(w,e.domain,y);const S=Ve(C0);G(w,e.tld,S),G(w,e.utld,S),D(m,Ls,S);const M=D(y,mn);G(M,e.domain,y),G(S,e.domain,y),D(S,pn,w),D(S,mn,M);const T=D(S,vr);G(T,e.numeric,C0);const I=D(u,mn),F=D(u,pn);G(I,e.domain,u),G(F,i,l),G(F,e.domain,u);const B=Ve(qr);G(F,e.tld,B),G(F,e.utld,B),G(B,e.domain,u),G(B,i,l),D(B,pn,F),D(B,mn,I),D(B,br,m);const $=D(B,vr),X=Ve(qr);G($,e.numeric,X);const q=Ve(qr),ie=Ve();G(q,t,q),G(q,r,ie),G(ie,t,q),G(ie,r,ie),D(B,gn,q),D(X,gn,q);const Ee=D(f,vr),Gt=D(h,vr),ei=D(Gt,gn),qt=D(ei,gn);G(f,e.domain,u),D(f,pn,F),D(f,mn,I),G(h,e.domain,u),D(h,pn,F),D(h,mn,I),G(Ee,e.domain,q),D(Ee,gn,q),G(qt,e.domain,q),G(qt,t,q),D(qt,gn,q);const un=D(q,Pi),Gn=D(q,Ps),Jt=D(q,Ds),Sn=D(q,zs);D(ie,Pi,un),D(ie,Ps,Gn),D(ie,Ds,Jt),D(ie,zs,Sn),D(un,Kr,q),D(Gn,Di,q),D(Jt,zi,q),D(Sn,Gr,q),D(un,Kr,q);const Be=Ve(qr),Fe=Ve(qr),He=Ve(qr),It=Ve(qr);G(un,t,Be),G(Gn,t,Fe),G(Jt,t,He),G(Sn,t,It);const et=Ve(),$e=Ve(),qn=Ve(),Jn=Ve();return G(un,r),G(Gn,r),G(Jt,r),G(Sn,r),G(Be,t,Be),G(Fe,t,Fe),G(He,t,He),G(It,t,It),G(Be,r,Be),G(Fe,r,Fe),G(He,r,He),G(It,r,It),G(et,t,et),G($e,t,Fe),G(qn,t,He),G(Jn,t,It),G(et,r,et),G($e,r,$e),G(qn,r,qn),G(Jn,r,Jn),D(Fe,Di,q),D(He,zi,q),D(It,Gr,q),D(Be,Kr,q),D($e,Di,q),D(qn,zi,q),D(Jn,Gr,q),D(et,Gr,q),D(o,Ls,B),D(o,gf,dC),{start:o,tokens:x0}}function mC(n,e,t){let r=t.length,i=0,o=[],l=[];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));)l.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&&(l.push(t[i]),i++);else{l.length>0&&(o.push(Ef(A0,e,l)),l=[]),i-=y,m-=y;const w=p.t,S=t.slice(i-m,i);o.push(Ef(w,e,S))}}return l.length>0&&o.push(Ef(A0,e,l)),o}function Ef(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 gC=typeof console<"u"&&console&&console.warn||(()=>{}),yC="until manual call of linkify.init(). Register all schemes and plugins before invoking linkify the first time.",Te={scanner:null,parser:null,tokenQueue:[],pluginQueue:[],customSchemes:[],initialized:!1};function bC(){vt.groups={},Te.scanner=null,Te.parser=null,Te.tokenQueue=[],Te.pluginQueue=[],Te.customSchemes=[],Te.initialized=!1}function I0(n,e){if(e===void 0&&(e=!1),Te.initialized&&gC(`linkifyjs: already initialized - will not register custom scheme "${n}" ${yC}`),!/^[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`);Te.customSchemes.push([n,e])}function bC(){Te.scanner=uC(Te.customSchemes);for(let n=0;n<Te.tokenQueue.length;n++)Te.tokenQueue[n][1]({scanner:Te.scanner});Te.parser=dC(Te.scanner.tokens);for(let n=0;n<Te.pluginQueue.length;n++)Te.pluginQueue[n][1]({scanner:Te.scanner,parser:Te.parser});Te.initialized=!0}function I0(n){return Te.initialized||bC(),pC(Te.parser.start,n,cC(Te.scanner.start,n))}function Ef(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 kf(t),i=I0(n),o=[];for(let l=0;l<i.length;l++){const u=i[l];u.isLink&&(!e||u.t===e)&&o.push(u.toFormattedObject(r))}return o}function vC(n,e){e===void 0&&(e=null);const t=I0(n);return t.length===1&&t[0].isLink&&(!e||t[0].t===e)}class SC extends of{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=vC(i);if(!i||!o)return!1;const l=this._createLinkAttrs(i,r.content);return this.editor.commands.applyLink(l),!0}_createLinkAttrs(e,t){return Yf.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 Xa(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 Jr(n){const e=Xa(n);return["span",e?{...e,class:"zw-style"}:{},0]}function wC(n){return n.toLowerCase().replace(/(?:^|\s)\S/g,e=>e.toUpperCase())}function Ut(n,...e){return({editor:t})=>(t.commands[n](...e),!0)}var xC=Object.defineProperty,kC=(n,e,t)=>e in n?xC(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,Sr=(n,e,t)=>kC(n,typeof e!="symbol"?e+"":e,t),O0,N0,R0;function De(n,e){let t=n.length;Array.isArray(n[0])||(n=[n]),Array.isArray(e[0])||(e=e.map(l=>[l]));let r=e[0].length,i=e[0].map((l,u)=>e.map(f=>f[u])),o=n.map(l=>i.map(u=>{let f=0;if(!Array.isArray(l)){for(let h of u)f+=l*h;return f}for(let h=0;h<l.length;h++)f+=l[h]*(u[h]||0);return f}));return t===1&&(o=o[0]),r===1?o.map(l=>l[0]):o}function L0(n){return Hs(n)==="string"}function Hs(n){return(Object.prototype.toString.call(n).match(/^\[object\s+(.*?)\]$/)[1]||"").toLowerCase()}function Mf(n,{precision:e,unit:t}){return Tf(n)?"none":_C(n,e)+(t??"")}function Tf(n){return Number.isNaN(n)||n instanceof Number&&n?.none}function _C(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 EC={deg:1,grad:.9,rad:180/Math.PI,turn:360};function MC(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 l=[];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*EC[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),l.push(m)}),{name:o[1].toLowerCase(),rawName:o[1],rawArgs:o[2],args:l}}}function TC(n){return n[n.length-1]}function P0(n,e,t){return isNaN(n)?e:isNaN(e)?n:n+(e-n)*t}function CC(n,e,t){return(t-n)/(e-n)}function D0(n,e,t){return P0(e[0],e[1],CC(n[0],n[1],t))}function AC(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 IC(n,e,t){return Math.max(Math.min(t,e),n)}function Cf(n,e){return Math.sign(n)===Math.sign(e)?n:-n}function Fn(n,e){return Cf(Math.abs(n)**e,n)}function z0(n,e){return e===0?0:n/e}function OC(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 NC{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 Za=new NC,Hn={D50:[.3457/.3585,1,(1-.3457-.3585)/.3585],D65:[.3127/.329,1,(1-.3127-.329)/.329]};function Af(n){return Array.isArray(n)?n:Hn[n]}function Qa(n,e,t,r={}){if(n=Af(n),e=Af(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(Za.run("chromatic-adaptation-start",i),i.M||(i.W1===Hn.D65&&i.W2===Hn.D50?i.M=[[1.0479297925449969,.022946870601609652,-.05019226628920524],[.02962780877005599,.9904344267538799,-.017073799063418826],[-.009243040646204504,.015055191490298152,.7518742814281371]]:i.W1===Hn.D50&&i.W2===Hn.D65&&(i.M=[[.955473421488075,-.02309845494876471,.06325924320057072],[-.0283697093338637,1.0099953980813041,.021041441191917323],[.012314014864481998,-.020507649298898964,1.330365926242124]])),Za.run("chromatic-adaptation-end",i),i.M)return De(i.M,i.XYZ);throw new TypeError("Only Bradford CAT with white points D50 and D65 supported for now.")}const $s={gamut_mapping:"css",precision:5,deltaE:"76",verbose:((R0=(N0=(O0=globalThis?.process)==null?void 0:O0.env)==null?void 0:N0.NODE_ENV)==null?void 0:R0.toLowerCase())!=="test",warn:function(e){var t,r;this.verbose&&((r=(t=globalThis?.console)==null?void 0:t.warn)==null||r.call(t,e))}},RC=new Set(["<number>","<percentage>","<angle>"]);function B0(n,e,t,r){return Object.entries(n.coords).map(([o,l],u)=>{let f=e.coordGrammar[u],h=r[u],m=h?.type,p;if(h.none?p=f.find(w=>RC.has(w)):p=f.find(w=>w==m),!p){let w=l.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=l.range||l.refRange;return y&&S&&(r[u]=D0(y,S,r[u])),p})}function F0(n,{meta:e}={}){var t,r,i,o;let l={str:(t=String(n))==null?void 0:t.trim()};if(Za.run("parse-start",l),l.color)return l.color;if(l.parsed=MC(l.str),l.parsed){let u=l.parsed.name;if(u==="color"){let f=l.parsed.args.shift(),h=f.startsWith("--")?f.substring(2):`--${f}`,m=[f,h],p=l.parsed.rawArgs.indexOf("/")>0?l.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)=>l.parsed.args[B]||0);let I;return M.coordGrammar&&(I=B0(w,M,"color",T)),e&&Object.assign(e,{formatId:"color",types:I}),M.id.startsWith("--")&&!f.startsWith("--")&&$s.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("--")&&$s.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||TC(l.parsed.args).alpha)&&(m=l.parsed.args.pop());let p=l.parsed.args,y;return h.coordGrammar&&(y=B0(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(l.str))continue;let m=h.parse(l.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 Ke(n){if(Array.isArray(n))return n.map(Ke);if(!n)throw new TypeError("Empty color reference");L0(n)&&(n=F0(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 LC=75e-6,If=class an{constructor(e){var t;this.id=e.id,this.name=e.name,this.base=e.base?an.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=Af(i),this.formats=e.formats??{};for(let o in this.formats){let l=this.formats[o];l.type||(l.type="function"),l.name||(l.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:an.get(e.gamutSpace):this.isPolar?this.gamutSpace=this.base:this.gamutSpace=this,this.gamutSpace.isUnbounded&&(this.inGamut=(o,l)=>!0),this.referred=e.referred,Object.defineProperty(this,"path",{value:PC(this).reverse(),writable:!1,enumerable:!0,configurable:!0}),Za.run("colorspace-init-end",this)}inGamut(e,{epsilon:t=LC}={}){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 l=r[o];if(l.type!=="angle"&&l.range){if(Number.isNaN(i))return!0;let[u,f]=l.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=H0(e,this),e;let t;return e==="default"?t=Object.values(this.formats)[0]:t=this.formats[e],t?(t=H0(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=Ke(e);[e,t]=[u.space,u.coords]}if(e=an.get(e),this.equals(e))return t;t=t.map(u=>Number.isNaN(u)?0:u);let r=this.path,i=e.path,o,l;for(let u=0;u<r.length&&r[u].equals(i[u]);u++)o=r[u],l=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>l;u--)t=r[u].toBase(t);for(let u=l+1;u<i.length;u++)t=i[u].fromBase(t);return t}from(e,t){if(arguments.length===1){const r=Ke(e);[e,t]=[r.space,r.coords]}return e=an.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(an.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 an)return e;if(Hs(e)==="string"){let i=an.registry[e.toLowerCase()];if(!i)throw new TypeError(`No color space found with id = "${e}"`);return i}if(t.length)return an.get(...t);throw new TypeError(`${e} is not a valid color space`)}static resolveCoord(e,t){var r;let i=Hs(e),o,l;if(i==="string"?e.includes(".")?[o,l]=e.split("."):[o,l]=[,e]:Array.isArray(e)?[o,l]=e:(o=e.space,l=e.coordId),o=an.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=Hs(l),i==="number"||i==="string"&&l>=0){let h=Object.entries(o.coords)[l];if(h)return{space:o,id:h[0],index:l,...h[1]}}o=an.get(o);let u=l.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 "${l}" coordinate found in ${o.name}. Its coordinates are: ${Object.keys(o.coords).join(", ")}`)}};Sr(If,"registry",{}),Sr(If,"DEFAULT_FORMAT",{type:"functions",name:"color"});let oe=If;function PC(n){let e=[n];for(let t=n;t=t.base;)e.push(t);return e}function H0(n,{coords:e}={}){if(n.coords&&!n.coordGrammar){n.type||(n.type="function"),n.name||(n.name="color"),n.coordGrammar=AC(n.coords);let t=Object.entries(e).map(([r,i],o)=>{let l=n.coordGrammar[o][0],u=i.range||i.refRange,f=l.range,h="";return l=="<percentage>"?(f=[0,100],h="%"):l=="<angle>"&&(h="deg"),{fromRange:u,toRange:f,suffix:h}});n.serializeCoords=(r,i)=>r.map((o,l)=>{let{fromRange:u,toRange:f,suffix:h}=t[l];return u&&f&&(o=D0(u,f,o)),o=Mf(o,{precision:i,unit:h}),o})}return n}const $n=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 $0 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=$n),e.toXYZ_M&&e.fromXYZ_M&&(e.toBase??(e.toBase=t=>{let r=De(e.toXYZ_M,t);return this.white!==this.base.white&&(r=Qa(this.white,this.base.white,r)),r}),e.fromBase??(e.fromBase=t=>(t=Qa(this.base.white,this.white,t),De(e.fromXYZ_M,t)))),e.referred??(e.referred="display"),super(e)}}function Of(n,e){return n=Ke(n),!e||n.space.equals(e)?n.coords.slice():(e=oe.get(e),e.from(n))}function Wn(n,e){n=Ke(n);let{space:t,index:r}=oe.resolveCoord(e,n.space);return Of(n,t)[r]}function W0(n,e,t){return n=Ke(n),e=oe.get(e),n.coords=e.to(n.space,t),n}W0.returns="color";function Nf(n,e,t){if(n=Ke(n),arguments.length===2&&Hs(arguments[1])==="object"){let r=arguments[1];for(let i in r)Nf(n,i,r[i])}else{typeof t=="function"&&(t=t(Wn(n,e)));let{space:r,index:i}=oe.resolveCoord(e,n.space),o=Of(n,r);o[i]=t,W0(n,r,o)}return n}Nf.returns="color";const DC=new oe({id:"xyz-d50",name:"XYZ D50",white:"D50",base:$n,fromBase:n=>Qa($n.white,"D50",n),toBase:n=>Qa("D50",$n.white,n)}),zC=216/24389,U0=24/116,el=24389/27;let Rf=Hn.D50;const Un=new oe({id:"lab",name:"Lab",coords:{l:{refRange:[0,100],name:"Lightness"},a:{refRange:[-125,125]},b:{refRange:[-125,125]}},white:Rf,base:DC,fromBase(n){let t=n.map((r,i)=>r/Rf[i]).map(r=>r>zC?Math.cbrt(r):(el*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]>U0?Math.pow(e[0],3):(116*e[0]-16)/el,n[0]>8?Math.pow((n[0]+16)/116,3):n[0]/el,e[2]>U0?Math.pow(e[2],3):(116*e[2]-16)/el].map((r,i)=>r*Rf[i])},formats:{lab:{coords:["<number> | <percentage>","<number> | <percentage>[-1,1]","<number> | <percentage>[-1,1]"]}}});function jr(n){return(n%360+360)%360}const tl=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:Un,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),jr(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>"]}}}),V0=25**7,nl=Math.PI,K0=180/nl,Fi=nl/180;function G0(n){const e=n*n;return e*e*e*n}function q0(n,e,{kL:t=1,kC:r=1,kH:i=1}={}){[n,e]=Ke([n,e]);let[o,l,u]=Un.from(n),f=tl.from(Un,[o,l,u])[1],[h,m,p]=Un.from(e),y=tl.from(Un,[h,m,p])[1];f<0&&(f=0),y<0&&(y=0);let S=(f+y)/2,w=G0(S),M=.5*(1-Math.sqrt(w/(w+V0))),T=(1+M)*l,I=(1+M)*m,F=Math.sqrt(T**2+u**2),B=Math.sqrt(I**2+p**2),$=T===0&&u===0?0:Math.atan2(u,T),X=I===0&&p===0?0:Math.atan2(p,I);$<0&&($+=2*nl),X<0&&(X+=2*nl),$*=K0,X*=K0;let q=h-o,ie=B-F,Ee=X-$,Gt=$+X,ei=Math.abs(Ee),qt;F*B===0?qt=0:ei<=180?qt=Ee:Ee>180?qt=Ee-360:Ee<-180?qt=Ee+360:$s.warn("the unthinkable has happened");let un=2*Math.sqrt(B*F)*Math.sin(qt*Fi/2),Kn=(o+h)/2,Jt=(F+B)/2,wn=G0(Jt),Be;F*B===0?Be=Gt:ei<=180?Be=Gt/2:Gt<360?Be=(Gt+360)/2:Be=(Gt-360)/2;let Fe=(Kn-50)**2,He=1+.015*Fe/Math.sqrt(20+Fe),It=1+.045*Jt,et=1;et-=.17*Math.cos((Be-30)*Fi),et+=.24*Math.cos(2*Be*Fi),et+=.32*Math.cos((3*Be+6)*Fi),et-=.2*Math.cos((4*Be-63)*Fi);let $e=1+.015*Jt*et,Gn=30*Math.exp(-1*((Be-275)/25)**2),qn=2*Math.sqrt(wn/(wn+V0)),dl=-1*Math.sin(2*Gn*Fi)*qn,jt=(q/(t*He))**2;return jt+=(ie/(r*It))**2,jt+=(un/(i*$e))**2,jt+=dl*(ie/(r*It))*(un/(i*$e)),Math.sqrt(jt)}const BC=[[.819022437996703,.3619062600528904,-.1288737815209879],[.0329836539323885,.9292868615863434,.0361446663506424],[.0481771893596242,.2642395317527308,.6335478284694309]],FC=[[1.2268798758459243,-.5578149944602171,.2813910456659647],[-.0405757452148008,1.112286803280317,-.0717110580655164],[-.0763729366746601,-.4214933324022432,1.5869240198367816]],HC=[[.210454268309314,.7936177747023054,-.0040720430116193],[1.9779985324311684,-2.42859224204858,.450593709617411],[.0259040424655478,.7827717124575296,-.8086757549230774]],$C=[[1,.3963377773761749,.2158037573099136],[1,-.1055613458156586,-.0638541728258133],[1,-.0894841775298119,-1.2914855480194092]],rl=new oe({id:"oklab",name:"Oklab",coords:{l:{refRange:[0,1],name:"Lightness"},a:{refRange:[-.4,.4]},b:{refRange:[-.4,.4]}},white:"D65",base:$n,fromBase(n){let t=De(BC,n).map(r=>Math.cbrt(r));return De(HC,t)},toBase(n){let t=De($C,n).map(r=>r**3);return De(FC,t)},formats:{oklab:{coords:["<percentage> | <number>","<number> | <percentage>[-1,1]","<number> | <percentage>[-1,1]"]}}});function Lf(n,e){[n,e]=Ke([n,e]);let[t,r,i]=rl.from(n),[o,l,u]=rl.from(e),f=t-o,h=r-l,m=i-u;return Math.sqrt(f**2+h**2+m**2)}const WC=75e-6;function Hi(n,e,{epsilon:t=WC}={}){n=Ke(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 Pf(n){return{space:n.space,coords:n.coords.slice(),alpha:n.alpha}}function UC(n,e,t="lab"){t=oe.get(t);let r=t.from(n),i=t.from(e);return Math.sqrt(r.reduce((o,l,u)=>{let f=i[u];return isNaN(l)||isNaN(f)?o:o+(f-l)**2},0))}function VC(n,e){return UC(n,e,"lab")}const KC=Math.PI,J0=KC/180;function GC(n,e,{l:t=2,c:r=1}={}){[n,e]=Ke([n,e]);let[i,o,l]=Un.from(n),[,u,f]=tl.from(Un,[i,o,l]),[h,m,p]=Un.from(e),y=tl.from(Un,[h,m,p])[1];u<0&&(u=0),y<0&&(y=0);let S=i-h,w=u-y,M=o-m,T=l-p,I=M**2+T**2-w**2,F=.511;i>=16&&(F=.040975*i/(1+.01765*i));let B=.0638*u/(1+.0131*u)+.638,$;Number.isNaN(f)&&(f=0),f>=164&&f<=345?$=.56+Math.abs(.2*Math.cos((f+168)*J0)):$=.36+Math.abs(.4*Math.cos((f+35)*J0));let X=Math.pow(u,4),q=Math.sqrt(X/(X+1900)),ie=B*(q*$+1-q),Ee=(S/(t*F))**2;return Ee+=(w/(r*B))**2,Ee+=I/ie**2,Math.sqrt(Ee)}const j0=203,Y0=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:$n,fromBase(n){return n.map(e=>Math.max(e*j0,0))},toBase(n){return n.map(e=>Math.max(e/j0,0))}}),il=1.15,sl=.66,X0=2610/2**14,qC=2**14/2610,Z0=3424/2**12,Q0=2413/2**7,e1=2392/2**7,JC=1.7*2523/2**5,t1=2**5/(1.7*2523),ol=-.56,Df=16295499532821565e-27,jC=[[.41478972,.579999,.014648],[-.20151,1.120649,.0531008],[-.0166008,.2648,.6684799]],YC=[[1.9242264357876067,-1.0047923125953657,.037651404030618],[.35031676209499907,.7264811939316552,-.06538442294808501],[-.09098281098284752,-.3127282905230739,1.5227665613052603]],XC=[[.5,.5,0],[3.524,-4.066708,.542708],[.199076,1.096799,-1.295875]],ZC=[[1,.1386050432715393,.05804731615611886],[.9999999999999999,-.1386050432715393,-.05804731615611886],[.9999999999999998,-.09601924202631895,-.8118918960560388]],QC=new oe({id:"jzazbz",name:"Jzazbz",coords:{jz:{refRange:[0,1],name:"Jz"},az:{refRange:[-.5,.5]},bz:{refRange:[-.5,.5]}},base:Y0,fromBase(n){let[e,t,r]=n,i=il*e-(il-1)*r,o=sl*t-(sl-1)*e,u=De(jC,[i,o,r]).map(function(y){let S=Z0+Q0*(y/1e4)**X0,w=1+e1*(y/1e4)**X0;return(S/w)**JC}),[f,h,m]=De(XC,u);return[(1+ol)*f/(1+ol*f)-Df,h,m]},toBase(n){let[e,t,r]=n,i=(e+Df)/(1+ol-ol*(e+Df)),l=De(ZC,[i,t,r]).map(function(y){let S=Z0-y**t1,w=e1*y**t1-Q0;return 1e4*(S/w)**qC}),[u,f,h]=De(YC,l),m=(u+(il-1)*h)/il,p=(f+(sl-1)*m)/sl;return[m,p,h]},formats:{color:{coords:["<number> | <percentage>","<number> | <percentage>[-1,1]","<number> | <percentage>[-1,1]"]}}}),n1=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:QC,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),jr(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 eA(n,e){[n,e]=Ke([n,e]);let[t,r,i]=n1.from(n),[o,l,u]=n1.from(e),f=t-o,h=r-l;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*l)*Math.sin(m/2*(Math.PI/180));return Math.sqrt(f**2+h**2+p**2)}const r1=3424/4096,i1=2413/128,s1=2392/128,o1=2610/16384,tA=2523/32,nA=16384/2610,a1=32/2523,rA=[[.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]],sA=[[.9999999999999998,.0086090370379328,.111029625003026],[.9999999999999998,-.0086090370379328,-.1110296250030259],[.9999999999999998,.5600313357106791,-.3206271749873188]],oA=[[2.0701522183894223,-1.3263473389671563,.2066510476294053],[.3647385209748072,.6805660249472273,-.0453045459220347],[-.0497472075358123,-.0492609666966131,1.1880659249923042]],l1=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:Y0,fromBase(n){let e=De(rA,n);return aA(e)},toBase(n){let e=lA(n);return De(oA,e)}});function aA(n){let e=n.map(function(t){let r=r1+i1*(t/1e4)**o1,i=1+s1*(t/1e4)**o1;return(r/i)**tA});return De(iA,e)}function lA(n){return De(sA,n).map(function(r){let i=Math.max(r**a1-r1,0),o=i1-s1*r**a1;return 1e4*(i/o)**nA})}function uA(n,e){[n,e]=Ke([n,e]);let[t,r,i]=l1.from(n),[o,l,u]=l1.from(e);return 720*Math.sqrt((t-o)**2+.25*(r-l)**2+(i-u)**2)}const cA=Hn.D65,u1=.42,c1=1/u1,zf=2*Math.PI,f1=[[.401288,.650173,-.051461],[-.250268,1.204414,.045854],[-.002079,.048952,.953127]],fA=[[1.8620678550872327,-1.0112546305316843,.14918677544445175],[.38752654323613717,.6214474419314753,-.008973985167612518],[-.015841498849333856,-.03412293802851557,1.0499644368778496]],hA=[[460,451,288],[460,-891,-261],[460,-220,-6300]],dA={dark:[.8,.525,.8],dim:[.9,.59,.9],average:[1,.69,1]},Yr={h:[20.14,90,164.25,237.53,380.14],e:[.8,.7,1,1.2,.8],H:[0,100,200,300,400]},pA=180/Math.PI,h1=Math.PI/180;function d1(n,e){return n.map(r=>{const i=Fn(e*Math.abs(r)*.01,u1);return 400*Cf(i,r)/(i+27.13)})}function mA(n,e){const t=100/e*27.13**c1;return n.map(r=>{const i=Math.abs(r);return Cf(t*Fn(i/(400-i),c1),r)})}function gA(n){let e=jr(n);e<=Yr.h[0]&&(e+=360);const t=OC(Yr.h,e)-1,[r,i]=Yr.h.slice(t,t+2),[o,l]=Yr.e.slice(t,t+2),u=Yr.H[t],f=(e-r)/o;return u+100*f/(f+(i-e)/l)}function yA(n){let e=(n%400+400)%400;const t=Math.floor(.01*e);e=e%100;const[r,i]=Yr.h.slice(t,t+2),[o,l]=Yr.e.slice(t,t+2);return jr((e*(l*r-o*i)-100*r*l)/(e*(l-o)-100*l))}function p1(n,e,t,r,i){const o={};o.discounting=i,o.refWhite=n,o.surround=r;const l=n.map(M=>M*100);o.la=e,o.yb=t;const u=l[1],f=De(f1,l);r=dA[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=>P0(1,u/M,y)),o.dRgbInv=o.dRgb.map(M=>1/M);const S=f.map((M,T)=>M*o.dRgb[T]),w=d1(S,o.fl);return o.aW=o.nbb*(2*w[0]+w[1]+.05*w[2]),o}const m1=p1(cA,64/Math.PI*.2,20,"average",!1);function Bf(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=jr(n.h)*h1:t=yA(n.H)*h1;const r=Math.cos(t),i=Math.sin(t);let o=0;n.J!==void 0?o=Fn(n.J,1/2)*.1:n.Q!==void 0&&(o=.25*e.c*n.Q/((e.aW+4)*e.flRoot));let l=0;n.C!==void 0?l=n.C/o:n.M!==void 0?l=n.M/e.flRoot/o:n.s!==void 0&&(l=4e-4*n.s**2*(e.aW+4)/e.c);const u=Fn(l*Math.pow(1.64-Math.pow(.29,e.n),-.73),10/9),f=.25*(Math.cos(t+2)+3.8),h=e.aW*Fn(o,2/e.c/e.z),m=5e4/13*e.nc*e.ncb*f,p=h/e.nbb,y=23*(p+.305)*z0(u,23*m+u*(11*r+108*i)),S=y*r,w=y*i,M=mA(De(hA,[p,S,w]).map(T=>T*1/1403),e.fl);return De(fA,M.map((T,I)=>T*e.dRgbInv[I])).map(T=>T/100)}function g1(n,e){const t=n.map(B=>B*100),r=d1(De(f1,t).map((B,$)=>B*e.dRgb[$]),e.fl),i=r[0]+(-12*r[1]+r[2])/11,o=(r[0]+r[1]-2*r[2])/9,l=(Math.atan2(o,i)%zf+zf)%zf,u=.25*(Math.cos(l+2)+3.8),f=5e4/13*e.nc*e.ncb*z0(u*Math.sqrt(i**2+o**2),r[0]+r[1]+1.05*r[2]+.305),h=Fn(f,.9)*Math.pow(1.64-Math.pow(.29,e.n),.73),m=e.nbb*(2*r[0]+r[1]+.05*r[2]),p=Fn(m/e.aW,.5*e.c*e.z),y=100*Fn(p,2),S=4/e.c*p*(e.aW+4)*e.flRoot,w=h*p,M=w*e.flRoot,T=jr(l*pA),I=gA(T),F=50*Fn(e.c*h/(e.aW+4),1/2);return{J:y,C:w,h:T,s:F,Q:S,M,H:I}}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:$n,fromBase(n){const e=g1(n,m1);return[e.J,e.M,e.h]},toBase(n){return Bf({J:n[0],M:n[1],h:n[2]},m1)}});const bA=Hn.D65,vA=216/24389,y1=24389/27;function SA(n){return 116*(n>vA?Math.cbrt(n):(y1*n+16)/116)-16}function Ff(n){return n>8?Math.pow((n+16)/116,3):n/y1}function wA(n,e){let[t,r,i]=n,o=[],l=0;if(i===0)return[0,0,0];let u=Ff(i);i>0?l=.00379058511492914*i**2+.608983189401032*i+.9155088574762233:l=9514440756550361e-21*i**2+.08693057439788597*i-21.928975842194614;const f=2e-12,h=15;let m=0,p=1/0;for(;m<=h;){o=Bf({J:l,C:r,h:t},e);const y=Math.abs(o[1]-u);if(y<p){if(y<=f)return o;p=y}l=l-(o[1]-u)*l/(2*o[1]),m+=1}return Bf({J:l,C:r,h:t},e)}function xA(n,e){const t=SA(n[1]);if(t===0)return[0,0,0];const r=g1(n,Hf);return[jr(r.h),r.C,t]}const Hf=p1(bA,200/Math.PI*Ff(50),Ff(50)*100,"average",!1),al=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:$n,fromBase(n){return xA(n)},toBase(n){return wA(n,Hf)},formats:{color:{id:"--hct",coords:["<number> | <angle>","<percentage> | <number>","<percentage> | <number>"]}}}),kA=Math.PI/180,b1=[1,.007,.0228];function v1(n){n[1]<0&&(n=al.fromBase(al.toBase(n)));const e=Math.log(Math.max(1+b1[2]*n[1]*Hf.flRoot,1))/b1[2],t=n[0]*kA,r=e*Math.cos(t),i=e*Math.sin(t);return[n[2],r,i]}function _A(n,e){[n,e]=Ke([n,e]);let[t,r,i]=v1(al.from(n)),[o,l,u]=v1(al.from(e));return Math.sqrt((t-o)**2+(r-l)**2+(i-u)**2)}const S1={deltaE76:VC,deltaECMC:GC,deltaE2000:q0,deltaEJz:eA,deltaEITP:uA,deltaEOK:Lf,deltaEHCT:_A};function EA(n){const e=n?Math.floor(Math.log10(Math.abs(n))):0;return Math.max(parseFloat(`1e${e-2}`),1e-6)}const w1={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 Ws(n,{method:e=$s.gamut_mapping,space:t=void 0,deltaEMethod:r="",jnd:i=2,blackWhiteClamp:o={}}={}){if(n=Ke(n),L0(arguments[1])?t=arguments[1]:t||(t=n.space),t=oe.get(t),Hi(n,t,{epsilon:0}))return n;let l;if(e==="css")l=MA(n,{space:t});else{if(e!=="clip"&&!Hi(n,t)){Object.prototype.hasOwnProperty.call(w1,e)&&({method:e,jnd:i,deltaEMethod:r,blackWhiteClamp:o}=w1[e]);let u=q0;if(r!==""){for(let h in S1)if("deltae"+r.toLowerCase()===h.toLowerCase()){u=S1[h];break}}let f=Ws(ze(n,t),{method:"clip",space:t});if(u(n,f)>i){if(Object.keys(o).length===3){let F=oe.resolveCoord(o.channel),B=Wn(ze(n,F.space),F.id);if(Tf(B)&&(B=0),B>=o.max)return ze({space:"xyz-d65",coords:Hn.D65},n.space);if(B<=o.min)return ze({space:"xyz-d65",coords:[0,0,0]},n.space)}let h=oe.resolveCoord(e),m=h.space,p=h.id,y=ze(n,m);y.coords.forEach((F,B)=>{Tf(F)&&(y.coords[B]=0)});let w=(h.range||h.refRange)[0],M=EA(i),T=w,I=Wn(y,p);for(;I-T>M;){let F=Pf(y);F=Ws(F,{space:t,method:"clip"}),u(y,F)-i<M?T=Wn(y,p):I=Wn(y,p),Nf(y,p,(T+I)/2)}l=ze(y,t)}else l=f}else l=ze(n,t);if(e==="clip"||!Hi(l,t,{epsilon:0})){let u=Object.values(t.coords).map(f=>f.range||[]);l.coords=l.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&&(l=ze(l,n.space)),n.coords=l.coords,n}Ws.returns="color";const x1={WHITE:{space:rl,coords:[1,0,0]},BLACK:{space:rl,coords:[0,0,0]}};function MA(n,{space:e}={}){n=Ke(n),e||(e=n.space),e=oe.get(e);const i=oe.get("oklch");if(e.isUnbounded)return ze(n,e);const o=ze(n,i);let l=o.coords[0];if(l>=1){const w=ze(x1.WHITE,e);return w.alpha=n.alpha,ze(w,e)}if(l<=0){const w=ze(x1.BLACK,e);return w.alpha=n.alpha,ze(w,e)}if(Hi(o,e,{epsilon:0}))return ze(o,e);function u(w){const M=ze(w,e),T=Object.values(e.coords);return M.coords=M.coords.map((I,F)=>{if("range"in T[F]){const[B,$]=T[F].range;return IC(B,I,$)}return I}),M}let f=0,h=o.coords[1],m=!0,p=Pf(o),y=u(p),S=Lf(y,p);if(S<.02)return y;for(;h-f>1e-4;){const w=(f+h)/2;if(p.coords[1]=w,m&&Hi(p,e,{epsilon:0}))f=w;else if(y=u(p),S=Lf(y,p),S<.02){if(.02-S<1e-4)break;m=!1,f=w}else h=w}return y}function ze(n,e,{inGamut:t}={}){n=Ke(n),e=oe.get(e);let r=e.from(n),i={space:e,coords:r,alpha:n.alpha};return t&&(i=Ws(i,t===!0?void 0:t)),i}ze.returns="color";function TA(n,{precision:e=$s.precision,format:t="default",inGamut:r=!0,...i}={}){var o;let l;n=Ke(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&&!Hi(n)&&(f=Ws(Pf(n),r===!0?void 0:r).coords),t.type==="custom")if(i.precision=e,t.serialize)l=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=>Mf(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=Mf(p,{precision:e}));let y=n.alpha>=1||t.noAlpha?"":`${t.commas?",":" /"} ${p}`;l=`${h}(${m.join(t.commas?", ":" ")}${y})`}return l}const CA=[[.41239079926595934,.357584339383878,.1804807884018343],[.21263900587151027,.715168678767756,.07219231536073371],[.01933081871559182,.11919477979462598,.9505321522496607]],AA=[[3.2409699419045226,-1.537383177570094,-.4986107602930034],[-.9692436362808796,1.8759675015077202,.04155505740717559],[.05563007969699366,-.20397695888897652,1.0569715142428786]],IA=new $0({id:"srgb-linear",name:"Linear sRGB",white:"D65",toXYZ_M:CA,fromXYZ_M:AA}),k1={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 _1=Array(3).fill("<percentage> | <number>[0, 255]"),E1=Array(3).fill("<number>[0, 255]");const M1=new $0({id:"srgb",name:"sRGB",base:IA,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:_1},rgb_number:{name:"rgb",commas:!0,coords:E1,noAlpha:!0},color:{},rgba:{coords:_1,commas:!0,lastAlpha:!0},rgba_number:{name:"rgba",commas:!0,coords:E1},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=k1.black,e.alpha=0):e.coords=k1[n],e.coords)return e}}}});function OA(n){return Wn(n,[$n,"y"])}const T1=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:M1,fromBase:n=>{let e=Math.max(...n),t=Math.min(...n),[r,i,o]=n,[l,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:l=(i-o)/h+(i<o?6:0);break;case i:l=(o-r)/h+2;break;case o:l=(r-i)/h+4}l=l*60}return u<0&&(l+=180,u=Math.abs(u)),l>=360&&(l-=360),[l,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 l=(o+e/30)%12,u=t*Math.min(r,1-r);return r-u*Math.max(-1,Math.min(l-3,9-l,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}}}),NA=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:T1,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 At{constructor(e){Sr(this,"data"),Sr(this,"isEmpty",!1),this.data=ze(e,"srgb")}static fromEmpty(){return At.fromWhite().setEmpty(!0)}static fromBlack(){return new At({spaceId:"srgb",coords:[0,0,0],alpha:1})}static fromWhite(){return new At({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 Wn(this.data,"hsv.h")}get s(){return Wn(this.data,"hsv.s")}get v(){return Wn(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 OA(this.data)<.5}setEmpty(e){return this.isEmpty=e,this}withAlpha(e){return new At({...this.data,alpha:e})}withRgb(e){return new At({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=Of(this.data,"hsv"),i=Math.max(e.s??r[1],1e-5),o=Math.max(e.v??r[2],1e-5);return new At({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=TA(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 At(this.data).setEmpty(this.isEmpty)}}class RA{constructor(e){Sr(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 C1=999;function LA(){return C1+=1,C1}function PA(n){return n?n.startsWith("linear-gradient("):!1}function DA(){const n=At.fromEmpty();return{isGradient:!1,solidColor:n,angle:0,transitions:[{color:n.clone(),offset:0},{color:n.clone(),offset:100}]}}oe.register(M1),oe.register(NA),oe.register(T1);function A1(n){if(!n)return At.fromEmpty();try{return new At(ze(F0(n),"srgb"))}catch(e){return console.warn(e),At.fromBlack()}}function zA(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 BA(n){return n.map(e=>{const[t,r]=e.trim().split(/\s+(?![^(]*\))/);return{color:A1(t),offset:Number.parseFloat(r.replace("%",""))}})}function FA(n){const e=n.indexOf("("),t=n.lastIndexOf(")"),[r,...i]=n.slice(e+1,t).split(/,(?![^(]*\))/),o=BA(i),l=zA(r);return{isGradient:!0,solidColor:o[0].color,angle:l,transitions:o}}function HA(n){const e=A1(n),t=At.fromWhite();return{isGradient:!1,solidColor:e,angle:0,transitions:[{color:t,offset:0},{color:e.withAlpha(1),offset:100}]}}function $A(n,e=!0){if(!n)return DA();const t=PA(n)?FA(n):HA(n);return t.isGradient&&!e?{...t,isGradient:!1}:t}class Jf{constructor(e,t=0){Sr(this,"id"),this.color=e,this.offset=t,this.id=LA()}get isEmpty(){return this.color.isEmpty}setOffset(e){this.offset=e}toString(){return`${this.color.toString()} ${this.offset}%`}clone(e){return new Jf(this.color.clone(),e)}}class WA{constructor(e){Sr(this,"_angle",0),Sr(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 Jf(t,r))}hasTransition(e){return this.transitions.some(t=>t.id===e.id)}}function UA(n){const e=$A(n);return(e.isGradient?new WA(e):new RA(e)).toString()}function I1(n){return UA(n)}function O1(n,e){if(!n.includes("em"))return parseInt(n);const t=$i.getComputedStyle(e).fontSize,r=parseFloat(n)*parseFloat(t);return Math.round(r)}function VA(n,e){return(n.firstElementChild||n).style.fontSize||$i.getComputedStyle(e).fontSize}function KA(n,e,t){if(!n.includes("px"))return n;const r=VA(e,t),i=O1(r,t);return i?(parseInt(n)/i).toFixed(2):null}const GA={start:gr.LEFT,end:gr.RIGHT};function qA(n){const e=GA[n]||n;return gr.values.includes(e)?e:null}const N1=(n,e,t,r)=>({from:Math.max(r,n.pos),to:Math.min(r+t.nodeSize,e.pos)});function R1(n,e){return n.resolve(e).depth+1}function JA(n,e,t,r){const i=R1(n,r),o=e.from-i<=r,l=e.to+i>=t.nodeSize+r;return o&&l}const jA=(n,e)=>n.eq(e);function YA(n,e,t,r=jA){const i=n.resolve(e).path.reverse();for(const o of i)if(typeof o!="number"){for(const l of o.marks)if(r(l,t))return!0}return!1}function XA(n,e){const t=typeof e=="string"?e:e.name;return n.find(r=>r.type.name===t)}var ll=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},Us={exports:{}};var ZA=Us.exports,L1;function QA(){return L1||(L1=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.",l="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,I=2,F=4,B=8,$=16,X=32,q=64,ie=128,Ee=256,Gt=512,ei=30,qt="...",un=800,Kn=16,Jt=1,wn=2,Be=3,Fe=1/0,He=9007199254740991,It=17976931348623157e292,et=NaN,$e=4294967295,Gn=$e-1,qn=$e>>>1,dl=[["ary",ie],["bind",T],["bindKey",I],["curry",B],["curryRight",$],["flip",Gt],["partial",X],["partialRight",q],["rearg",Ee]],jt="[object Arguments]",Gs="[object Array]",$1="[object AsyncFunction]",Gi="[object Boolean]",qi="[object Date]",W1="[object DOMException]",qs="[object Error]",Js="[object Function]",Xf="[object GeneratorFunction]",Yt="[object Map]",Ji="[object Number]",U1="[object Null]",xn="[object Object]",Zf="[object Promise]",V1="[object Proxy]",ji="[object RegExp]",Xt="[object Set]",Yi="[object String]",js="[object Symbol]",K1="[object Undefined]",Xi="[object WeakMap]",G1="[object WeakSet]",Zi="[object ArrayBuffer]",ti="[object DataView]",pl="[object Float32Array]",ml="[object Float64Array]",gl="[object Int8Array]",yl="[object Int16Array]",bl="[object Int32Array]",vl="[object Uint8Array]",Sl="[object Uint8ClampedArray]",wl="[object Uint16Array]",xl="[object Uint32Array]",q1=/\b__p \+= '';/g,J1=/\b(__p \+=) '' \+/g,j1=/(__e\(.*?\)|\b__t\)) \+\n'';/g,Qf=/&(?:amp|lt|gt|quot|#39);/g,eh=/[&<>"']/g,Y1=RegExp(Qf.source),X1=RegExp(eh.source),Z1=/<%-([\s\S]+?)%>/g,Q1=/<%([\s\S]+?)%>/g,th=/<%=([\s\S]+?)%>/g,ey=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,ty=/^\w*$/,ny=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,kl=/[\\^$.*+?()[\]{}|]/g,ry=RegExp(kl.source),_l=/^\s+/,iy=/\s/,sy=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,oy=/\{\n\/\* \[wrapped with (.+)\] \*/,ay=/,? & /,ly=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,uy=/[()=,{}\[\]\/\s]/,cy=/\\(\\)?/g,fy=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,nh=/\w*$/,hy=/^[-+]0x[0-9a-f]+$/i,dy=/^0b[01]+$/i,py=/^\[object .+?Constructor\]$/,my=/^0o[0-7]+$/i,gy=/^(?:0|[1-9]\d*)$/,yy=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Ys=/($^)/,by=/['\n\r\u2028\u2029\\]/g,Xs="\\ud800-\\udfff",vy="\\u0300-\\u036f",Sy="\\ufe20-\\ufe2f",wy="\\u20d0-\\u20ff",rh=vy+Sy+wy,ih="\\u2700-\\u27bf",sh="a-z\\xdf-\\xf6\\xf8-\\xff",xy="\\xac\\xb1\\xd7\\xf7",ky="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",_y="\\u2000-\\u206f",Ey=" \\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",oh="A-Z\\xc0-\\xd6\\xd8-\\xde",ah="\\ufe0e\\ufe0f",lh=xy+ky+_y+Ey,El="['\u2019]",My="["+Xs+"]",uh="["+lh+"]",Zs="["+rh+"]",ch="\\d+",Ty="["+ih+"]",fh="["+sh+"]",hh="[^"+Xs+lh+ch+ih+sh+oh+"]",Ml="\\ud83c[\\udffb-\\udfff]",Cy="(?:"+Zs+"|"+Ml+")",dh="[^"+Xs+"]",Tl="(?:\\ud83c[\\udde6-\\uddff]){2}",Cl="[\\ud800-\\udbff][\\udc00-\\udfff]",ni="["+oh+"]",ph="\\u200d",mh="(?:"+fh+"|"+hh+")",Ay="(?:"+ni+"|"+hh+")",gh="(?:"+El+"(?:d|ll|m|re|s|t|ve))?",yh="(?:"+El+"(?:D|LL|M|RE|S|T|VE))?",bh=Cy+"?",vh="["+ah+"]?",Iy="(?:"+ph+"(?:"+[dh,Tl,Cl].join("|")+")"+vh+bh+")*",Oy="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Ny="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",Sh=vh+bh+Iy,Ry="(?:"+[Ty,Tl,Cl].join("|")+")"+Sh,Ly="(?:"+[dh+Zs+"?",Zs,Tl,Cl,My].join("|")+")",Py=RegExp(El,"g"),Dy=RegExp(Zs,"g"),Al=RegExp(Ml+"(?="+Ml+")|"+Ly+Sh,"g"),zy=RegExp([ni+"?"+fh+"+"+gh+"(?="+[uh,ni,"$"].join("|")+")",Ay+"+"+yh+"(?="+[uh,ni+mh,"$"].join("|")+")",ni+"?"+mh+"+"+gh,ni+"+"+yh,Ny,Oy,ch,Ry].join("|"),"g"),By=RegExp("["+ph+Xs+rh+ah+"]"),Fy=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,Hy=["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"],$y=-1,xe={};xe[pl]=xe[ml]=xe[gl]=xe[yl]=xe[bl]=xe[vl]=xe[Sl]=xe[wl]=xe[xl]=!0,xe[jt]=xe[Gs]=xe[Zi]=xe[Gi]=xe[ti]=xe[qi]=xe[qs]=xe[Js]=xe[Yt]=xe[Ji]=xe[xn]=xe[ji]=xe[Xt]=xe[Yi]=xe[Xi]=!1;var we={};we[jt]=we[Gs]=we[Zi]=we[ti]=we[Gi]=we[qi]=we[pl]=we[ml]=we[gl]=we[yl]=we[bl]=we[Yt]=we[Ji]=we[xn]=we[ji]=we[Xt]=we[Yi]=we[js]=we[vl]=we[Sl]=we[wl]=we[xl]=!0,we[qs]=we[Js]=we[Xi]=!1;var Wy={\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"},Uy={"&":"&","<":"<",">":">",'"':""","'":"'"},Vy={"&":"&","<":"<",">":">",""":'"',"'":"'"},Ky={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},Gy=parseFloat,qy=parseInt,wh=typeof ll=="object"&&ll&&ll.Object===Object&&ll,Jy=typeof self=="object"&&self&&self.Object===Object&&self,Je=wh||Jy||Function("return this")(),Il=e&&!e.nodeType&&e,_r=Il&&!0&&n&&!n.nodeType&&n,xh=_r&&_r.exports===Il,Ol=xh&&wh.process,Ot=function(){try{var _=_r&&_r.require&&_r.require("util").types;return _||Ol&&Ol.binding&&Ol.binding("util")}catch{}}(),kh=Ot&&Ot.isArrayBuffer,_h=Ot&&Ot.isDate,Eh=Ot&&Ot.isMap,Mh=Ot&&Ot.isRegExp,Th=Ot&&Ot.isSet,Ch=Ot&&Ot.isTypedArray;function St(_,A,C){switch(C.length){case 0:return _.call(A);case 1:return _.call(A,C[0]);case 2:return _.call(A,C[0],C[1]);case 3:return _.call(A,C[0],C[1],C[2])}return _.apply(A,C)}function jy(_,A,C,W){for(var Q=-1,ge=_==null?0:_.length;++Q<ge;){var Le=_[Q];A(W,Le,C(Le),_)}return W}function Nt(_,A){for(var C=-1,W=_==null?0:_.length;++C<W&&A(_[C],C,_)!==!1;);return _}function Yy(_,A){for(var C=_==null?0:_.length;C--&&A(_[C],C,_)!==!1;);return _}function Ah(_,A){for(var C=-1,W=_==null?0:_.length;++C<W;)if(!A(_[C],C,_))return!1;return!0}function Jn(_,A){for(var C=-1,W=_==null?0:_.length,Q=0,ge=[];++C<W;){var Le=_[C];A(Le,C,_)&&(ge[Q++]=Le)}return ge}function Qs(_,A){var C=_==null?0:_.length;return!!C&&ri(_,A,0)>-1}function Nl(_,A,C){for(var W=-1,Q=_==null?0:_.length;++W<Q;)if(C(A,_[W]))return!0;return!1}function _e(_,A){for(var C=-1,W=_==null?0:_.length,Q=Array(W);++C<W;)Q[C]=A(_[C],C,_);return Q}function jn(_,A){for(var C=-1,W=A.length,Q=_.length;++C<W;)_[Q+C]=A[C];return _}function Rl(_,A,C,W){var Q=-1,ge=_==null?0:_.length;for(W&&ge&&(C=_[++Q]);++Q<ge;)C=A(C,_[Q],Q,_);return C}function Xy(_,A,C,W){var Q=_==null?0:_.length;for(W&&Q&&(C=_[--Q]);Q--;)C=A(C,_[Q],Q,_);return C}function Ll(_,A){for(var C=-1,W=_==null?0:_.length;++C<W;)if(A(_[C],C,_))return!0;return!1}var Zy=Pl("length");function Qy(_){return _.split("")}function e2(_){return _.match(ly)||[]}function Ih(_,A,C){var W;return C(_,function(Q,ge,Le){if(A(Q,ge,Le))return W=ge,!1}),W}function eo(_,A,C,W){for(var Q=_.length,ge=C+(W?1:-1);W?ge--:++ge<Q;)if(A(_[ge],ge,_))return ge;return-1}function ri(_,A,C){return A===A?h2(_,A,C):eo(_,Oh,C)}function t2(_,A,C,W){for(var Q=C-1,ge=_.length;++Q<ge;)if(W(_[Q],A))return Q;return-1}function Oh(_){return _!==_}function Nh(_,A){var C=_==null?0:_.length;return C?zl(_,A)/C:et}function Pl(_){return function(A){return A==null?t:A[_]}}function Dl(_){return function(A){return _==null?t:_[A]}}function Rh(_,A,C,W,Q){return Q(_,function(ge,Le,Se){C=W?(W=!1,ge):A(C,ge,Le,Se)}),C}function n2(_,A){var C=_.length;for(_.sort(A);C--;)_[C]=_[C].value;return _}function zl(_,A){for(var C,W=-1,Q=_.length;++W<Q;){var ge=A(_[W]);ge!==t&&(C=C===t?ge:C+ge)}return C}function Bl(_,A){for(var C=-1,W=Array(_);++C<_;)W[C]=A(C);return W}function r2(_,A){return _e(A,function(C){return[C,_[C]]})}function Lh(_){return _&&_.slice(0,Bh(_)+1).replace(_l,"")}function wt(_){return function(A){return _(A)}}function Fl(_,A){return _e(A,function(C){return _[C]})}function Qi(_,A){return _.has(A)}function Ph(_,A){for(var C=-1,W=_.length;++C<W&&ri(A,_[C],0)>-1;);return C}function Dh(_,A){for(var C=_.length;C--&&ri(A,_[C],0)>-1;);return C}function i2(_,A){for(var C=_.length,W=0;C--;)_[C]===A&&++W;return W}var s2=Dl(Wy),o2=Dl(Uy);function a2(_){return"\\"+Ky[_]}function l2(_,A){return _==null?t:_[A]}function ii(_){return By.test(_)}function u2(_){return Fy.test(_)}function c2(_){for(var A,C=[];!(A=_.next()).done;)C.push(A.value);return C}function Hl(_){var A=-1,C=Array(_.size);return _.forEach(function(W,Q){C[++A]=[Q,W]}),C}function zh(_,A){return function(C){return _(A(C))}}function Yn(_,A){for(var C=-1,W=_.length,Q=0,ge=[];++C<W;){var Le=_[C];(Le===A||Le===m)&&(_[C]=m,ge[Q++]=C)}return ge}function to(_){var A=-1,C=Array(_.size);return _.forEach(function(W){C[++A]=W}),C}function f2(_){var A=-1,C=Array(_.size);return _.forEach(function(W){C[++A]=[W,W]}),C}function h2(_,A,C){for(var W=C-1,Q=_.length;++W<Q;)if(_[W]===A)return W;return-1}function d2(_,A,C){for(var W=C+1;W--;)if(_[W]===A)return W;return W}function si(_){return ii(_)?m2(_):Zy(_)}function Zt(_){return ii(_)?g2(_):Qy(_)}function Bh(_){for(var A=_.length;A--&&iy.test(_.charAt(A)););return A}var p2=Dl(Vy);function m2(_){for(var A=Al.lastIndex=0;Al.test(_);)++A;return A}function g2(_){return _.match(Al)||[]}function y2(_){return _.match(zy)||[]}var b2=function _(A){A=A==null?Je:oi.defaults(Je.Object(),A,oi.pick(Je,Hy));var C=A.Array,W=A.Date,Q=A.Error,ge=A.Function,Le=A.Math,Se=A.Object,$l=A.RegExp,v2=A.String,Rt=A.TypeError,no=C.prototype,S2=ge.prototype,ai=Se.prototype,ro=A["__core-js_shared__"],io=S2.toString,ve=ai.hasOwnProperty,w2=0,Fh=function(){var s=/[^.]+$/.exec(ro&&ro.keys&&ro.keys.IE_PROTO||"");return s?"Symbol(src)_1."+s:""}(),so=ai.toString,x2=io.call(Se),k2=Je._,_2=$l("^"+io.call(ve).replace(kl,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),oo=xh?A.Buffer:t,Xn=A.Symbol,ao=A.Uint8Array,Hh=oo?oo.allocUnsafe:t,lo=zh(Se.getPrototypeOf,Se),$h=Se.create,Wh=ai.propertyIsEnumerable,uo=no.splice,Uh=Xn?Xn.isConcatSpreadable:t,es=Xn?Xn.iterator:t,Er=Xn?Xn.toStringTag:t,co=function(){try{var s=Ir(Se,"defineProperty");return s({},"",{}),s}catch{}}(),E2=A.clearTimeout!==Je.clearTimeout&&A.clearTimeout,M2=W&&W.now!==Je.Date.now&&W.now,T2=A.setTimeout!==Je.setTimeout&&A.setTimeout,fo=Le.ceil,ho=Le.floor,Wl=Se.getOwnPropertySymbols,C2=oo?oo.isBuffer:t,Vh=A.isFinite,A2=no.join,I2=zh(Se.keys,Se),Pe=Le.max,tt=Le.min,O2=W.now,N2=A.parseInt,Kh=Le.random,R2=no.reverse,Ul=Ir(A,"DataView"),ts=Ir(A,"Map"),Vl=Ir(A,"Promise"),li=Ir(A,"Set"),ns=Ir(A,"WeakMap"),rs=Ir(Se,"create"),po=ns&&new ns,ui={},L2=Or(Ul),P2=Or(ts),D2=Or(Vl),z2=Or(li),B2=Or(ns),mo=Xn?Xn.prototype:t,is=mo?mo.valueOf:t,Gh=mo?mo.toString:t;function b(s){if(Ce(s)&&!ee(s)&&!(s instanceof ue)){if(s instanceof Lt)return s;if(ve.call(s,"__wrapped__"))return qd(s)}return new Lt(s)}var ci=function(){function s(){}return function(a){if(!Me(a))return{};if($h)return $h(a);s.prototype=a;var c=new s;return s.prototype=t,c}}();function go(){}function Lt(s,a){this.__wrapped__=s,this.__actions__=[],this.__chain__=!!a,this.__index__=0,this.__values__=t}b.templateSettings={escape:Z1,evaluate:Q1,interpolate:th,variable:"",imports:{_:b}},b.prototype=go.prototype,b.prototype.constructor=b,Lt.prototype=ci(go.prototype),Lt.prototype.constructor=Lt;function ue(s){this.__wrapped__=s,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=$e,this.__views__=[]}function F2(){var s=new ue(this.__wrapped__);return s.__actions__=ht(this.__actions__),s.__dir__=this.__dir__,s.__filtered__=this.__filtered__,s.__iteratees__=ht(this.__iteratees__),s.__takeCount__=this.__takeCount__,s.__views__=ht(this.__views__),s}function H2(){if(this.__filtered__){var s=new ue(this);s.__dir__=-1,s.__filtered__=!0}else s=this.clone(),s.__dir__*=-1;return s}function $2(){var s=this.__wrapped__.value(),a=this.__dir__,c=ee(s),d=a<0,g=c?s.length:0,v=Qb(0,g,this.__views__),x=v.start,k=v.end,E=k-x,O=d?k:x-1,N=this.__iteratees__,R=N.length,H=0,K=tt(E,this.__takeCount__);if(!c||!d&&g==E&&K==E)return gd(s,this.__actions__);var j=[];e:for(;E--&&H<K;){O+=a;for(var re=-1,Y=s[O];++re<R;){var ae=N[re],fe=ae.iteratee,_t=ae.type,at=fe(Y);if(_t==wn)Y=at;else if(!at){if(_t==Jt)continue e;break e}}j[H++]=Y}return j}ue.prototype=ci(go.prototype),ue.prototype.constructor=ue;function Mr(s){var a=-1,c=s==null?0:s.length;for(this.clear();++a<c;){var d=s[a];this.set(d[0],d[1])}}function W2(){this.__data__=rs?rs(null):{},this.size=0}function U2(s){var a=this.has(s)&&delete this.__data__[s];return this.size-=a?1:0,a}function V2(s){var a=this.__data__;if(rs){var c=a[s];return c===f?t:c}return ve.call(a,s)?a[s]:t}function K2(s){var a=this.__data__;return rs?a[s]!==t:ve.call(a,s)}function G2(s,a){var c=this.__data__;return this.size+=this.has(s)?0:1,c[s]=rs&&a===t?f:a,this}Mr.prototype.clear=W2,Mr.prototype.delete=U2,Mr.prototype.get=V2,Mr.prototype.has=K2,Mr.prototype.set=G2;function kn(s){var a=-1,c=s==null?0:s.length;for(this.clear();++a<c;){var d=s[a];this.set(d[0],d[1])}}function q2(){this.__data__=[],this.size=0}function J2(s){var a=this.__data__,c=yo(a,s);if(c<0)return!1;var d=a.length-1;return c==d?a.pop():uo.call(a,c,1),--this.size,!0}function j2(s){var a=this.__data__,c=yo(a,s);return c<0?t:a[c][1]}function Y2(s){return yo(this.__data__,s)>-1}function X2(s,a){var c=this.__data__,d=yo(c,s);return d<0?(++this.size,c.push([s,a])):c[d][1]=a,this}kn.prototype.clear=q2,kn.prototype.delete=J2,kn.prototype.get=j2,kn.prototype.has=Y2,kn.prototype.set=X2;function _n(s){var a=-1,c=s==null?0:s.length;for(this.clear();++a<c;){var d=s[a];this.set(d[0],d[1])}}function Z2(){this.size=0,this.__data__={hash:new Mr,map:new(ts||kn),string:new Mr}}function Q2(s){var a=Ao(this,s).delete(s);return this.size-=a?1:0,a}function eb(s){return Ao(this,s).get(s)}function tb(s){return Ao(this,s).has(s)}function nb(s,a){var c=Ao(this,s),d=c.size;return c.set(s,a),this.size+=c.size==d?0:1,this}_n.prototype.clear=Z2,_n.prototype.delete=Q2,_n.prototype.get=eb,_n.prototype.has=tb,_n.prototype.set=nb;function Tr(s){var a=-1,c=s==null?0:s.length;for(this.__data__=new _n;++a<c;)this.add(s[a])}function rb(s){return this.__data__.set(s,f),this}function ib(s){return this.__data__.has(s)}Tr.prototype.add=Tr.prototype.push=rb,Tr.prototype.has=ib;function Qt(s){var a=this.__data__=new kn(s);this.size=a.size}function sb(){this.__data__=new kn,this.size=0}function ob(s){var a=this.__data__,c=a.delete(s);return this.size=a.size,c}function ab(s){return this.__data__.get(s)}function lb(s){return this.__data__.has(s)}function ub(s,a){var c=this.__data__;if(c instanceof kn){var d=c.__data__;if(!ts||d.length<i-1)return d.push([s,a]),this.size=++c.size,this;c=this.__data__=new _n(d)}return c.set(s,a),this.size=c.size,this}Qt.prototype.clear=sb,Qt.prototype.delete=ob,Qt.prototype.get=ab,Qt.prototype.has=lb,Qt.prototype.set=ub;function qh(s,a){var c=ee(s),d=!c&&Nr(s),g=!c&&!d&&nr(s),v=!c&&!d&&!g&&pi(s),x=c||d||g||v,k=x?Bl(s.length,v2):[],E=k.length;for(var O in s)(a||ve.call(s,O))&&!(x&&(O=="length"||g&&(O=="offset"||O=="parent")||v&&(O=="buffer"||O=="byteLength"||O=="byteOffset")||Cn(O,E)))&&k.push(O);return k}function Jh(s){var a=s.length;return a?s[tu(0,a-1)]:t}function cb(s,a){return Io(ht(s),Cr(a,0,s.length))}function fb(s){return Io(ht(s))}function Kl(s,a,c){(c!==t&&!en(s[a],c)||c===t&&!(a in s))&&En(s,a,c)}function ss(s,a,c){var d=s[a];(!(ve.call(s,a)&&en(d,c))||c===t&&!(a in s))&&En(s,a,c)}function yo(s,a){for(var c=s.length;c--;)if(en(s[c][0],a))return c;return-1}function hb(s,a,c,d){return Zn(s,function(g,v,x){a(d,g,c(g),x)}),d}function jh(s,a){return s&&fn(a,We(a),s)}function db(s,a){return s&&fn(a,pt(a),s)}function En(s,a,c){a=="__proto__"&&co?co(s,a,{configurable:!0,enumerable:!0,value:c,writable:!0}):s[a]=c}function Gl(s,a){for(var c=-1,d=a.length,g=C(d),v=s==null;++c<d;)g[c]=v?t:Mu(s,a[c]);return g}function Cr(s,a,c){return s===s&&(c!==t&&(s=s<=c?s:c),a!==t&&(s=s>=a?s:a)),s}function Pt(s,a,c,d,g,v){var x,k=a&p,E=a&y,O=a&S;if(c&&(x=g?c(s,d,g,v):c(s)),x!==t)return x;if(!Me(s))return s;var N=ee(s);if(N){if(x=tv(s),!k)return ht(s,x)}else{var R=nt(s),H=R==Js||R==Xf;if(nr(s))return vd(s,k);if(R==xn||R==jt||H&&!g){if(x=E||H?{}:Bd(s),!k)return E?Vb(s,db(x,s)):Ub(s,jh(x,s))}else{if(!we[R])return g?s:{};x=nv(s,R,k)}}v||(v=new Qt);var K=v.get(s);if(K)return K;v.set(s,x),dp(s)?s.forEach(function(Y){x.add(Pt(Y,a,c,Y,s,v))}):fp(s)&&s.forEach(function(Y,ae){x.set(ae,Pt(Y,a,c,ae,s,v))});var j=O?E?hu:fu:E?pt:We,re=N?t:j(s);return Nt(re||s,function(Y,ae){re&&(ae=Y,Y=s[ae]),ss(x,ae,Pt(Y,a,c,ae,s,v))}),x}function pb(s){var a=We(s);return function(c){return Yh(c,s,a)}}function Yh(s,a,c){var d=c.length;if(s==null)return!d;for(s=Se(s);d--;){var g=c[d],v=a[g],x=s[g];if(x===t&&!(g in s)||!v(x))return!1}return!0}function Xh(s,a,c){if(typeof s!="function")throw new Rt(l);return ds(function(){s.apply(t,c)},a)}function as(s,a,c,d){var g=-1,v=Qs,x=!0,k=s.length,E=[],O=a.length;if(!k)return E;c&&(a=_e(a,wt(c))),d?(v=Nl,x=!1):a.length>=i&&(v=Qi,x=!1,a=new Tr(a));e:for(;++g<k;){var N=s[g],R=c==null?N:c(N);if(N=d||N!==0?N:0,x&&R===R){for(var H=O;H--;)if(a[H]===R)continue e;E.push(N)}else v(a,R,d)||E.push(N)}return E}var Zn=_d(cn),Zh=_d(Jl,!0);function mb(s,a){var c=!0;return Zn(s,function(d,g,v){return c=!!a(d,g,v),c}),c}function bo(s,a,c){for(var d=-1,g=s.length;++d<g;){var v=s[d],x=a(v);if(x!=null&&(k===t?x===x&&!kt(x):c(x,k)))var k=x,E=v}return E}function gb(s,a,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:mp(d);c<d;)s[c++]=a;return s}function Qh(s,a){var c=[];return Zn(s,function(d,g,v){a(d,g,v)&&c.push(d)}),c}function je(s,a,c,d,g){var v=-1,x=s.length;for(c||(c=iv),g||(g=[]);++v<x;){var k=s[v];a>0&&c(k)?a>1?je(k,a-1,c,d,g):jn(g,k):d||(g[g.length]=k)}return g}var ql=Ed(),ed=Ed(!0);function cn(s,a){return s&&ql(s,a,We)}function Jl(s,a){return s&&ed(s,a,We)}function vo(s,a){return Jn(a,function(c){return An(s[c])})}function Ar(s,a){a=er(a,s);for(var c=0,d=a.length;s!=null&&c<d;)s=s[hn(a[c++])];return c&&c==d?s:t}function td(s,a,c){var d=a(s);return ee(s)?d:jn(d,c(s))}function st(s){return s==null?s===t?K1:U1:Er&&Er in Se(s)?Zb(s):fv(s)}function jl(s,a){return s>a}function yb(s,a){return s!=null&&ve.call(s,a)}function bb(s,a){return s!=null&&a in Se(s)}function vb(s,a,c){return s>=tt(a,c)&&s<Pe(a,c)}function Yl(s,a,c){for(var d=c?Nl:Qs,g=s[0].length,v=s.length,x=v,k=C(v),E=1/0,O=[];x--;){var N=s[x];x&&a&&(N=_e(N,wt(a))),E=tt(N.length,E),k[x]=!c&&(a||g>=120&&N.length>=120)?new Tr(x&&N):t}N=s[0];var R=-1,H=k[0];e:for(;++R<g&&O.length<E;){var K=N[R],j=a?a(K):K;if(K=c||K!==0?K:0,!(H?Qi(H,j):d(O,j,c))){for(x=v;--x;){var re=k[x];if(!(re?Qi(re,j):d(s[x],j,c)))continue e}H&&H.push(j),O.push(K)}}return O}function Sb(s,a,c,d){return cn(s,function(g,v,x){a(d,c(g),v,x)}),d}function ls(s,a,c){a=er(a,s),s=Wd(s,a);var d=s==null?s:s[hn(zt(a))];return d==null?t:St(d,s,c)}function nd(s){return Ce(s)&&st(s)==jt}function wb(s){return Ce(s)&&st(s)==Zi}function xb(s){return Ce(s)&&st(s)==qi}function us(s,a,c,d,g){return s===a?!0:s==null||a==null||!Ce(s)&&!Ce(a)?s!==s&&a!==a:kb(s,a,c,d,us,g)}function kb(s,a,c,d,g,v){var x=ee(s),k=ee(a),E=x?Gs:nt(s),O=k?Gs:nt(a);E=E==jt?xn:E,O=O==jt?xn:O;var N=E==xn,R=O==xn,H=E==O;if(H&&nr(s)){if(!nr(a))return!1;x=!0,N=!1}if(H&&!N)return v||(v=new Qt),x||pi(s)?Pd(s,a,c,d,g,v):Yb(s,a,E,c,d,g,v);if(!(c&w)){var K=N&&ve.call(s,"__wrapped__"),j=R&&ve.call(a,"__wrapped__");if(K||j){var re=K?s.value():s,Y=j?a.value():a;return v||(v=new Qt),g(re,Y,c,d,v)}}return H?(v||(v=new Qt),Xb(s,a,c,d,g,v)):!1}function _b(s){return Ce(s)&&nt(s)==Yt}function Xl(s,a,c,d){var g=c.length,v=g,x=!d;if(s==null)return!v;for(s=Se(s);g--;){var k=c[g];if(x&&k[2]?k[1]!==s[k[0]]:!(k[0]in s))return!1}for(;++g<v;){k=c[g];var E=k[0],O=s[E],N=k[1];if(x&&k[2]){if(O===t&&!(E in s))return!1}else{var R=new Qt;if(d)var H=d(O,N,E,s,a,R);if(!(H===t?us(N,O,w|M,d,R):H))return!1}}return!0}function rd(s){if(!Me(s)||ov(s))return!1;var a=An(s)?_2:py;return a.test(Or(s))}function Eb(s){return Ce(s)&&st(s)==ji}function Mb(s){return Ce(s)&&nt(s)==Xt}function Tb(s){return Ce(s)&&Do(s.length)&&!!xe[st(s)]}function id(s){return typeof s=="function"?s:s==null?mt:typeof s=="object"?ee(s)?ad(s[0],s[1]):od(s):Mp(s)}function Zl(s){if(!hs(s))return I2(s);var a=[];for(var c in Se(s))ve.call(s,c)&&c!="constructor"&&a.push(c);return a}function Cb(s){if(!Me(s))return cv(s);var a=hs(s),c=[];for(var d in s)d=="constructor"&&(a||!ve.call(s,d))||c.push(d);return c}function Ql(s,a){return s<a}function sd(s,a){var c=-1,d=dt(s)?C(s.length):[];return Zn(s,function(g,v,x){d[++c]=a(g,v,x)}),d}function od(s){var a=pu(s);return a.length==1&&a[0][2]?Hd(a[0][0],a[0][1]):function(c){return c===s||Xl(c,s,a)}}function ad(s,a){return gu(s)&&Fd(a)?Hd(hn(s),a):function(c){var d=Mu(c,s);return d===t&&d===a?Tu(c,s):us(a,d,w|M)}}function So(s,a,c,d,g){s!==a&&ql(a,function(v,x){if(g||(g=new Qt),Me(v))Ab(s,a,x,c,So,d,g);else{var k=d?d(bu(s,x),v,x+"",s,a,g):t;k===t&&(k=v),Kl(s,x,k)}},pt)}function Ab(s,a,c,d,g,v,x){var k=bu(s,c),E=bu(a,c),O=x.get(E);if(O){Kl(s,c,O);return}var N=v?v(k,E,c+"",s,a,x):t,R=N===t;if(R){var H=ee(E),K=!H&&nr(E),j=!H&&!K&&pi(E);N=E,H||K||j?ee(k)?N=k:Ae(k)?N=ht(k):K?(R=!1,N=vd(E,!0)):j?(R=!1,N=Sd(E,!0)):N=[]:ps(E)||Nr(E)?(N=k,Nr(k)?N=gp(k):(!Me(k)||An(k))&&(N=Bd(E))):R=!1}R&&(x.set(E,N),g(N,E,d,v,x),x.delete(E)),Kl(s,c,N)}function ld(s,a){var c=s.length;if(c)return a+=a<0?c:0,Cn(a,c)?s[a]:t}function ud(s,a,c){a.length?a=_e(a,function(v){return ee(v)?function(x){return Ar(x,v.length===1?v[0]:v)}:v}):a=[mt];var d=-1;a=_e(a,wt(J()));var g=sd(s,function(v,x,k){var E=_e(a,function(O){return O(v)});return{criteria:E,index:++d,value:v}});return n2(g,function(v,x){return Wb(v,x,c)})}function Ib(s,a){return cd(s,a,function(c,d){return Tu(s,d)})}function cd(s,a,c){for(var d=-1,g=a.length,v={};++d<g;){var x=a[d],k=Ar(s,x);c(k,x)&&cs(v,er(x,s),k)}return v}function Ob(s){return function(a){return Ar(a,s)}}function eu(s,a,c,d){var g=d?t2:ri,v=-1,x=a.length,k=s;for(s===a&&(a=ht(a)),c&&(k=_e(s,wt(c)));++v<x;)for(var E=0,O=a[v],N=c?c(O):O;(E=g(k,N,E,d))>-1;)k!==s&&uo.call(k,E,1),uo.call(s,E,1);return s}function fd(s,a){for(var c=s?a.length:0,d=c-1;c--;){var g=a[c];if(c==d||g!==v){var v=g;Cn(g)?uo.call(s,g,1):iu(s,g)}}return s}function tu(s,a){return s+ho(Kh()*(a-s+1))}function Nb(s,a,c,d){for(var g=-1,v=Pe(fo((a-s)/(c||1)),0),x=C(v);v--;)x[d?v:++g]=s,s+=c;return x}function nu(s,a){var c="";if(!s||a<1||a>He)return c;do a%2&&(c+=s),a=ho(a/2),a&&(s+=s);while(a);return c}function se(s,a){return vu($d(s,a,mt),s+"")}function Rb(s){return Jh(mi(s))}function Lb(s,a){var c=mi(s);return Io(c,Cr(a,0,c.length))}function cs(s,a,c,d){if(!Me(s))return s;a=er(a,s);for(var g=-1,v=a.length,x=v-1,k=s;k!=null&&++g<v;){var E=hn(a[g]),O=c;if(E==="__proto__"||E==="constructor"||E==="prototype")return s;if(g!=x){var N=k[E];O=d?d(N,E,k):t,O===t&&(O=Me(N)?N:Cn(a[g+1])?[]:{})}ss(k,E,O),k=k[E]}return s}var hd=po?function(s,a){return po.set(s,a),s}:mt,Pb=co?function(s,a){return co(s,"toString",{configurable:!0,enumerable:!1,value:Au(a),writable:!0})}:mt;function Db(s){return Io(mi(s))}function Dt(s,a,c){var d=-1,g=s.length;a<0&&(a=-a>g?0:g+a),c=c>g?g:c,c<0&&(c+=g),g=a>c?0:c-a>>>0,a>>>=0;for(var v=C(g);++d<g;)v[d]=s[d+a];return v}function zb(s,a){var c;return Zn(s,function(d,g,v){return c=a(d,g,v),!c}),!!c}function wo(s,a,c){var d=0,g=s==null?d:s.length;if(typeof a=="number"&&a===a&&g<=qn){for(;d<g;){var v=d+g>>>1,x=s[v];x!==null&&!kt(x)&&(c?x<=a:x<a)?d=v+1:g=v}return g}return ru(s,a,mt,c)}function ru(s,a,c,d){var g=0,v=s==null?0:s.length;if(v===0)return 0;a=c(a);for(var x=a!==a,k=a===null,E=kt(a),O=a===t;g<v;){var N=ho((g+v)/2),R=c(s[N]),H=R!==t,K=R===null,j=R===R,re=kt(R);if(x)var Y=d||j;else O?Y=j&&(d||H):k?Y=j&&H&&(d||!K):E?Y=j&&H&&!K&&(d||!re):K||re?Y=!1:Y=d?R<=a:R<a;Y?g=N+1:v=N}return tt(v,Gn)}function dd(s,a){for(var c=-1,d=s.length,g=0,v=[];++c<d;){var x=s[c],k=a?a(x):x;if(!c||!en(k,E)){var E=k;v[g++]=x===0?0:x}}return v}function pd(s){return typeof s=="number"?s:kt(s)?et:+s}function xt(s){if(typeof s=="string")return s;if(ee(s))return _e(s,xt)+"";if(kt(s))return Gh?Gh.call(s):"";var a=s+"";return a=="0"&&1/s==-Fe?"-0":a}function Qn(s,a,c){var d=-1,g=Qs,v=s.length,x=!0,k=[],E=k;if(c)x=!1,g=Nl;else if(v>=i){var O=a?null:Jb(s);if(O)return to(O);x=!1,g=Qi,E=new Tr}else E=a?[]:k;e:for(;++d<v;){var N=s[d],R=a?a(N):N;if(N=c||N!==0?N:0,x&&R===R){for(var H=E.length;H--;)if(E[H]===R)continue e;a&&E.push(R),k.push(N)}else g(E,R,c)||(E!==k&&E.push(R),k.push(N))}return k}function iu(s,a){return a=er(a,s),s=Wd(s,a),s==null||delete s[hn(zt(a))]}function md(s,a,c,d){return cs(s,a,c(Ar(s,a)),d)}function xo(s,a,c,d){for(var g=s.length,v=d?g:-1;(d?v--:++v<g)&&a(s[v],v,s););return c?Dt(s,d?0:v,d?v+1:g):Dt(s,d?v+1:0,d?g:v)}function gd(s,a){var c=s;return c instanceof ue&&(c=c.value()),Rl(a,function(d,g){return g.func.apply(g.thisArg,jn([d],g.args))},c)}function su(s,a,c){var d=s.length;if(d<2)return d?Qn(s[0]):[];for(var g=-1,v=C(d);++g<d;)for(var x=s[g],k=-1;++k<d;)k!=g&&(v[g]=as(v[g]||x,s[k],a,c));return Qn(je(v,1),a,c)}function yd(s,a,c){for(var d=-1,g=s.length,v=a.length,x={};++d<g;){var k=d<v?a[d]:t;c(x,s[d],k)}return x}function ou(s){return Ae(s)?s:[]}function au(s){return typeof s=="function"?s:mt}function er(s,a){return ee(s)?s:gu(s,a)?[s]:Gd(ye(s))}var Bb=se;function tr(s,a,c){var d=s.length;return c=c===t?d:c,!a&&c>=d?s:Dt(s,a,c)}var bd=E2||function(s){return Je.clearTimeout(s)};function vd(s,a){if(a)return s.slice();var c=s.length,d=Hh?Hh(c):new s.constructor(c);return s.copy(d),d}function lu(s){var a=new s.constructor(s.byteLength);return new ao(a).set(new ao(s)),a}function Fb(s,a){var c=a?lu(s.buffer):s.buffer;return new s.constructor(c,s.byteOffset,s.byteLength)}function Hb(s){var a=new s.constructor(s.source,nh.exec(s));return a.lastIndex=s.lastIndex,a}function $b(s){return is?Se(is.call(s)):{}}function Sd(s,a){var c=a?lu(s.buffer):s.buffer;return new s.constructor(c,s.byteOffset,s.length)}function wd(s,a){if(s!==a){var c=s!==t,d=s===null,g=s===s,v=kt(s),x=a!==t,k=a===null,E=a===a,O=kt(a);if(!k&&!O&&!v&&s>a||v&&x&&E&&!k&&!O||d&&x&&E||!c&&E||!g)return 1;if(!d&&!v&&!O&&s<a||O&&c&&g&&!d&&!v||k&&c&&g||!x&&g||!E)return-1}return 0}function Wb(s,a,c){for(var d=-1,g=s.criteria,v=a.criteria,x=g.length,k=c.length;++d<x;){var E=wd(g[d],v[d]);if(E){if(d>=k)return E;var O=c[d];return E*(O=="desc"?-1:1)}}return s.index-a.index}function xd(s,a,c,d){for(var g=-1,v=s.length,x=c.length,k=-1,E=a.length,O=Pe(v-x,0),N=C(E+O),R=!d;++k<E;)N[k]=a[k];for(;++g<x;)(R||g<v)&&(N[c[g]]=s[g]);for(;O--;)N[k++]=s[g++];return N}function kd(s,a,c,d){for(var g=-1,v=s.length,x=-1,k=c.length,E=-1,O=a.length,N=Pe(v-k,0),R=C(N+O),H=!d;++g<N;)R[g]=s[g];for(var K=g;++E<O;)R[K+E]=a[E];for(;++x<k;)(H||g<v)&&(R[K+c[x]]=s[g++]);return R}function ht(s,a){var c=-1,d=s.length;for(a||(a=C(d));++c<d;)a[c]=s[c];return a}function fn(s,a,c,d){var g=!c;c||(c={});for(var v=-1,x=a.length;++v<x;){var k=a[v],E=d?d(c[k],s[k],k,c,s):t;E===t&&(E=s[k]),g?En(c,k,E):ss(c,k,E)}return c}function Ub(s,a){return fn(s,mu(s),a)}function Vb(s,a){return fn(s,Dd(s),a)}function ko(s,a){return function(c,d){var g=ee(c)?jy:hb,v=a?a():{};return g(c,s,J(d,2),v)}}function fi(s){return se(function(a,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&&ot(c[0],c[1],x)&&(v=g<3?t:v,g=1),a=Se(a);++d<g;){var k=c[d];k&&s(a,k,d,v)}return a})}function _d(s,a){return function(c,d){if(c==null)return c;if(!dt(c))return s(c,d);for(var g=c.length,v=a?g:-1,x=Se(c);(a?v--:++v<g)&&d(x[v],v,x)!==!1;);return c}}function Ed(s){return function(a,c,d){for(var g=-1,v=Se(a),x=d(a),k=x.length;k--;){var E=x[s?k:++g];if(c(v[E],E,v)===!1)break}return a}}function Kb(s,a,c){var d=a&T,g=fs(s);function v(){var x=this&&this!==Je&&this instanceof v?g:s;return x.apply(d?c:this,arguments)}return v}function Md(s){return function(a){a=ye(a);var c=ii(a)?Zt(a):t,d=c?c[0]:a.charAt(0),g=c?tr(c,1).join(""):a.slice(1);return d[s]()+g}}function hi(s){return function(a){return Rl(_p(kp(a).replace(Py,"")),s,"")}}function fs(s){return function(){var a=arguments;switch(a.length){case 0:return new s;case 1:return new s(a[0]);case 2:return new s(a[0],a[1]);case 3:return new s(a[0],a[1],a[2]);case 4:return new s(a[0],a[1],a[2],a[3]);case 5:return new s(a[0],a[1],a[2],a[3],a[4]);case 6:return new s(a[0],a[1],a[2],a[3],a[4],a[5]);case 7:return new s(a[0],a[1],a[2],a[3],a[4],a[5],a[6])}var c=ci(s.prototype),d=s.apply(c,a);return Me(d)?d:c}}function Gb(s,a,c){var d=fs(s);function g(){for(var v=arguments.length,x=C(v),k=v,E=di(g);k--;)x[k]=arguments[k];var O=v<3&&x[0]!==E&&x[v-1]!==E?[]:Yn(x,E);if(v-=O.length,v<c)return Od(s,a,_o,g.placeholder,t,x,O,t,t,c-v);var N=this&&this!==Je&&this instanceof g?d:s;return St(N,this,x)}return g}function Td(s){return function(a,c,d){var g=Se(a);if(!dt(a)){var v=J(c,3);a=We(a),c=function(k){return v(g[k],k,g)}}var x=s(a,c,d);return x>-1?g[v?a[x]:x]:t}}function Cd(s){return Tn(function(a){var c=a.length,d=c,g=Lt.prototype.thru;for(s&&a.reverse();d--;){var v=a[d];if(typeof v!="function")throw new Rt(l);if(g&&!x&&Co(v)=="wrapper")var x=new Lt([],!0)}for(d=x?d:c;++d<c;){v=a[d];var k=Co(v),E=k=="wrapper"?du(v):t;E&&yu(E[0])&&E[1]==(ie|B|X|Ee)&&!E[4].length&&E[9]==1?x=x[Co(E[0])].apply(x,E[3]):x=v.length==1&&yu(v)?x[k]():x.thru(v)}return function(){var O=arguments,N=O[0];if(x&&O.length==1&&ee(N))return x.plant(N).value();for(var R=0,H=c?a[R].apply(this,O):N;++R<c;)H=a[R].call(this,H);return H}})}function _o(s,a,c,d,g,v,x,k,E,O){var N=a&ie,R=a&T,H=a&I,K=a&(B|$),j=a&Gt,re=H?t:fs(s);function Y(){for(var ae=arguments.length,fe=C(ae),_t=ae;_t--;)fe[_t]=arguments[_t];if(K)var at=di(Y),Et=i2(fe,at);if(d&&(fe=xd(fe,d,g,K)),v&&(fe=kd(fe,v,x,K)),ae-=Et,K&&ae<O){var Ie=Yn(fe,at);return Od(s,a,_o,Y.placeholder,c,fe,Ie,k,E,O-ae)}var tn=R?c:this,On=H?tn[s]:s;return ae=fe.length,k?fe=hv(fe,k):j&&ae>1&&fe.reverse(),N&&E<ae&&(fe.length=E),this&&this!==Je&&this instanceof Y&&(On=re||fs(On)),On.apply(tn,fe)}return Y}function Ad(s,a){return function(c,d){return Sb(c,s,a(d),{})}}function Eo(s,a){return function(c,d){var g;if(c===t&&d===t)return a;if(c!==t&&(g=c),d!==t){if(g===t)return d;typeof c=="string"||typeof d=="string"?(c=xt(c),d=xt(d)):(c=pd(c),d=pd(d)),g=s(c,d)}return g}}function uu(s){return Tn(function(a){return a=_e(a,wt(J())),se(function(c){var d=this;return s(a,function(g){return St(g,d,c)})})})}function Mo(s,a){a=a===t?" ":xt(a);var c=a.length;if(c<2)return c?nu(a,s):a;var d=nu(a,fo(s/si(a)));return ii(a)?tr(Zt(d),0,s).join(""):d.slice(0,s)}function qb(s,a,c,d){var g=a&T,v=fs(s);function x(){for(var k=-1,E=arguments.length,O=-1,N=d.length,R=C(N+E),H=this&&this!==Je&&this instanceof x?v:s;++O<N;)R[O]=d[O];for(;E--;)R[O++]=arguments[++k];return St(H,g?c:this,R)}return x}function Id(s){return function(a,c,d){return d&&typeof d!="number"&&ot(a,c,d)&&(c=d=t),a=In(a),c===t?(c=a,a=0):c=In(c),d=d===t?a<c?1:-1:In(d),Nb(a,c,d,s)}}function To(s){return function(a,c){return typeof a=="string"&&typeof c=="string"||(a=Bt(a),c=Bt(c)),s(a,c)}}function Od(s,a,c,d,g,v,x,k,E,O){var N=a&B,R=N?x:t,H=N?t:x,K=N?v:t,j=N?t:v;a|=N?X:q,a&=~(N?q:X),a&F||(a&=~(T|I));var re=[s,a,g,K,R,j,H,k,E,O],Y=c.apply(t,re);return yu(s)&&Ud(Y,re),Y.placeholder=d,Vd(Y,s,a)}function cu(s){var a=Le[s];return function(c,d){if(c=Bt(c),d=d==null?0:tt(te(d),292),d&&Vh(c)){var g=(ye(c)+"e").split("e"),v=a(g[0]+"e"+(+g[1]+d));return g=(ye(v)+"e").split("e"),+(g[0]+"e"+(+g[1]-d))}return a(c)}}var Jb=li&&1/to(new li([,-0]))[1]==Fe?function(s){return new li(s)}:Nu;function Nd(s){return function(a){var c=nt(a);return c==Yt?Hl(a):c==Xt?f2(a):r2(a,s(a))}}function Mn(s,a,c,d,g,v,x,k){var E=a&I;if(!E&&typeof s!="function")throw new Rt(l);var O=d?d.length:0;if(O||(a&=~(X|q),d=g=t),x=x===t?x:Pe(te(x),0),k=k===t?k:te(k),O-=g?g.length:0,a&q){var N=d,R=g;d=g=t}var H=E?t:du(s),K=[s,a,c,d,g,N,R,v,x,k];if(H&&uv(K,H),s=K[0],a=K[1],c=K[2],d=K[3],g=K[4],k=K[9]=K[9]===t?E?0:s.length:Pe(K[9]-O,0),!k&&a&(B|$)&&(a&=~(B|$)),!a||a==T)var j=Kb(s,a,c);else a==B||a==$?j=Gb(s,a,k):(a==X||a==(T|X))&&!g.length?j=qb(s,a,c,d):j=_o.apply(t,K);var re=H?hd:Ud;return Vd(re(j,K),s,a)}function Rd(s,a,c,d){return s===t||en(s,ai[c])&&!ve.call(d,c)?a:s}function Ld(s,a,c,d,g,v){return Me(s)&&Me(a)&&(v.set(a,s),So(s,a,t,Ld,v),v.delete(a)),s}function jb(s){return ps(s)?t:s}function Pd(s,a,c,d,g,v){var x=c&w,k=s.length,E=a.length;if(k!=E&&!(x&&E>k))return!1;var O=v.get(s),N=v.get(a);if(O&&N)return O==a&&N==s;var R=-1,H=!0,K=c&M?new Tr:t;for(v.set(s,a),v.set(a,s);++R<k;){var j=s[R],re=a[R];if(d)var Y=x?d(re,j,R,a,s,v):d(j,re,R,s,a,v);if(Y!==t){if(Y)continue;H=!1;break}if(K){if(!Ll(a,function(ae,fe){if(!Qi(K,fe)&&(j===ae||g(j,ae,c,d,v)))return K.push(fe)})){H=!1;break}}else if(!(j===re||g(j,re,c,d,v))){H=!1;break}}return v.delete(s),v.delete(a),H}function Yb(s,a,c,d,g,v,x){switch(c){case ti:if(s.byteLength!=a.byteLength||s.byteOffset!=a.byteOffset)return!1;s=s.buffer,a=a.buffer;case Zi:return!(s.byteLength!=a.byteLength||!v(new ao(s),new ao(a)));case Gi:case qi:case Ji:return en(+s,+a);case qs:return s.name==a.name&&s.message==a.message;case ji:case Yi:return s==a+"";case Yt:var k=Hl;case Xt:var E=d&w;if(k||(k=to),s.size!=a.size&&!E)return!1;var O=x.get(s);if(O)return O==a;d|=M,x.set(s,a);var N=Pd(k(s),k(a),d,g,v,x);return x.delete(s),N;case js:if(is)return is.call(s)==is.call(a)}return!1}function Xb(s,a,c,d,g,v){var x=c&w,k=fu(s),E=k.length,O=fu(a),N=O.length;if(E!=N&&!x)return!1;for(var R=E;R--;){var H=k[R];if(!(x?H in a:ve.call(a,H)))return!1}var K=v.get(s),j=v.get(a);if(K&&j)return K==a&&j==s;var re=!0;v.set(s,a),v.set(a,s);for(var Y=x;++R<E;){H=k[R];var ae=s[H],fe=a[H];if(d)var _t=x?d(fe,ae,H,a,s,v):d(ae,fe,H,s,a,v);if(!(_t===t?ae===fe||g(ae,fe,c,d,v):_t)){re=!1;break}Y||(Y=H=="constructor")}if(re&&!Y){var at=s.constructor,Et=a.constructor;at!=Et&&"constructor"in s&&"constructor"in a&&!(typeof at=="function"&&at instanceof at&&typeof Et=="function"&&Et instanceof Et)&&(re=!1)}return v.delete(s),v.delete(a),re}function Tn(s){return vu($d(s,t,Yd),s+"")}function fu(s){return td(s,We,mu)}function hu(s){return td(s,pt,Dd)}var du=po?function(s){return po.get(s)}:Nu;function Co(s){for(var a=s.name+"",c=ui[a],d=ve.call(ui,a)?c.length:0;d--;){var g=c[d],v=g.func;if(v==null||v==s)return g.name}return a}function di(s){var a=ve.call(b,"placeholder")?b:s;return a.placeholder}function J(){var s=b.iteratee||Iu;return s=s===Iu?id:s,arguments.length?s(arguments[0],arguments[1]):s}function Ao(s,a){var c=s.__data__;return sv(a)?c[typeof a=="string"?"string":"hash"]:c.map}function pu(s){for(var a=We(s),c=a.length;c--;){var d=a[c],g=s[d];a[c]=[d,g,Fd(g)]}return a}function Ir(s,a){var c=l2(s,a);return rd(c)?c:t}function Zb(s){var a=ve.call(s,Er),c=s[Er];try{s[Er]=t;var d=!0}catch{}var g=so.call(s);return d&&(a?s[Er]=c:delete s[Er]),g}var mu=Wl?function(s){return s==null?[]:(s=Se(s),Jn(Wl(s),function(a){return Wh.call(s,a)}))}:Ru,Dd=Wl?function(s){for(var a=[];s;)jn(a,mu(s)),s=lo(s);return a}:Ru,nt=st;(Ul&&nt(new Ul(new ArrayBuffer(1)))!=ti||ts&&nt(new ts)!=Yt||Vl&&nt(Vl.resolve())!=Zf||li&&nt(new li)!=Xt||ns&&nt(new ns)!=Xi)&&(nt=function(s){var a=st(s),c=a==xn?s.constructor:t,d=c?Or(c):"";if(d)switch(d){case L2:return ti;case P2:return Yt;case D2:return Zf;case z2:return Xt;case B2:return Xi}return a});function Qb(s,a,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":a-=x;break;case"take":a=tt(a,s+x);break;case"takeRight":s=Pe(s,a-x);break}}return{start:s,end:a}}function ev(s){var a=s.match(oy);return a?a[1].split(ay):[]}function zd(s,a,c){a=er(a,s);for(var d=-1,g=a.length,v=!1;++d<g;){var x=hn(a[d]);if(!(v=s!=null&&c(s,x)))break;s=s[x]}return v||++d!=g?v:(g=s==null?0:s.length,!!g&&Do(g)&&Cn(x,g)&&(ee(s)||Nr(s)))}function tv(s){var a=s.length,c=new s.constructor(a);return a&&typeof s[0]=="string"&&ve.call(s,"index")&&(c.index=s.index,c.input=s.input),c}function Bd(s){return typeof s.constructor=="function"&&!hs(s)?ci(lo(s)):{}}function nv(s,a,c){var d=s.constructor;switch(a){case Zi:return lu(s);case Gi:case qi:return new d(+s);case ti:return Fb(s,c);case pl:case ml:case gl:case yl:case bl:case vl:case Sl:case wl:case xl:return Sd(s,c);case Yt:return new d;case Ji:case Yi:return new d(s);case ji:return Hb(s);case Xt:return new d;case js:return $b(s)}}function rv(s,a){var c=a.length;if(!c)return s;var d=c-1;return a[d]=(c>1?"& ":"")+a[d],a=a.join(c>2?", ":" "),s.replace(sy,`{
|
|
19
|
+
3. "-" cannot repeat`);Te.customSchemes.push([n,e])}function vC(){Te.scanner=cC(Te.customSchemes);for(let n=0;n<Te.tokenQueue.length;n++)Te.tokenQueue[n][1]({scanner:Te.scanner});Te.parser=pC(Te.scanner.tokens);for(let n=0;n<Te.pluginQueue.length;n++)Te.pluginQueue[n][1]({scanner:Te.scanner,parser:Te.parser});Te.initialized=!0}function O0(n){return Te.initialized||vC(),mC(Te.parser.start,n,fC(Te.scanner.start,n))}function Mf(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 _f(t),i=O0(n),o=[];for(let l=0;l<i.length;l++){const u=i[l];u.isLink&&(!e||u.t===e)&&o.push(u.toFormattedObject(r))}return o}function wC(n,e){e===void 0&&(e=null);const t=O0(n);return t.length===1&&t[0].isLink&&(!e||t[0].t===e)}class SC extends af{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=wC(i);if(!i||!o)return!1;const l=this._createLinkAttrs(i,r.content);return this.editor.commands.applyLink(l),!0}_createLinkAttrs(e,t){return Xf.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 Xa(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 Jr(n){const e=Xa(n);return["span",e?{...e,class:"zw-style"}:{},0]}function xC(n){return n.toLowerCase().replace(/(?:^|\s)\S/g,e=>e.toUpperCase())}function Ut(n,...e){return({editor:t})=>(t.commands[n](...e),!0)}var kC=Object.defineProperty,_C=(n,e,t)=>e in n?kC(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,Fn=(n,e,t)=>_C(n,typeof e!="symbol"?e+"":e,t),N0,R0,L0;function De(n,e){let t=n.length;Array.isArray(n[0])||(n=[n]),Array.isArray(e[0])||(e=e.map(l=>[l]));let r=e[0].length,i=e[0].map((l,u)=>e.map(f=>f[u])),o=n.map(l=>i.map(u=>{let f=0;if(!Array.isArray(l)){for(let h of u)f+=l*h;return f}for(let h=0;h<l.length;h++)f+=l[h]*(u[h]||0);return f}));return t===1&&(o=o[0]),r===1?o.map(l=>l[0]):o}function P0(n){return Hs(n)==="string"}function Hs(n){return(Object.prototype.toString.call(n).match(/^\[object\s+(.*?)\]$/)[1]||"").toLowerCase()}function Tf(n,{precision:e,unit:t}){return Cf(n)?"none":EC(n,e)+(t??"")}function Cf(n){return Number.isNaN(n)||n instanceof Number&&n?.none}function EC(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 MC={deg:1,grad:.9,rad:180/Math.PI,turn:360};function TC(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 l=[];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*MC[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),l.push(m)}),{name:o[1].toLowerCase(),rawName:o[1],rawArgs:o[2],args:l}}}function CC(n){return n[n.length-1]}function D0(n,e,t){return isNaN(n)?e:isNaN(e)?n:n+(e-n)*t}function AC(n,e,t){return(t-n)/(e-n)}function z0(n,e,t){return D0(e[0],e[1],AC(n[0],n[1],t))}function IC(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 OC(n,e,t){return Math.max(Math.min(t,e),n)}function Af(n,e){return Math.sign(n)===Math.sign(e)?n:-n}function Hn(n,e){return Af(Math.abs(n)**e,n)}function B0(n,e){return e===0?0:n/e}function NC(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 RC{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 Za=new RC,$n={D50:[.3457/.3585,1,(1-.3457-.3585)/.3585],D65:[.3127/.329,1,(1-.3127-.329)/.329]};function If(n){return Array.isArray(n)?n:$n[n]}function Qa(n,e,t,r={}){if(n=If(n),e=If(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(Za.run("chromatic-adaptation-start",i),i.M||(i.W1===$n.D65&&i.W2===$n.D50?i.M=[[1.0479297925449969,.022946870601609652,-.05019226628920524],[.02962780877005599,.9904344267538799,-.017073799063418826],[-.009243040646204504,.015055191490298152,.7518742814281371]]:i.W1===$n.D50&&i.W2===$n.D65&&(i.M=[[.955473421488075,-.02309845494876471,.06325924320057072],[-.0283697093338637,1.0099953980813041,.021041441191917323],[.012314014864481998,-.020507649298898964,1.330365926242124]])),Za.run("chromatic-adaptation-end",i),i.M)return De(i.M,i.XYZ);throw new TypeError("Only Bradford CAT with white points D50 and D65 supported for now.")}const $s={gamut_mapping:"css",precision:5,deltaE:"76",verbose:((L0=(R0=(N0=globalThis?.process)==null?void 0:N0.env)==null?void 0:R0.NODE_ENV)==null?void 0:L0.toLowerCase())!=="test",warn:function(e){var t,r;this.verbose&&((r=(t=globalThis?.console)==null?void 0:t.warn)==null||r.call(t,e))}},LC=new Set(["<number>","<percentage>","<angle>"]);function F0(n,e,t,r){return Object.entries(n.coords).map(([o,l],u)=>{let f=e.coordGrammar[u],h=r[u],m=h?.type,p;if(h.none?p=f.find(S=>LC.has(S)):p=f.find(S=>S==m),!p){let S=l.name||o;throw new TypeError(`${m??h.raw} not allowed for ${S} in ${t}()`)}let y=p.range;m==="<percentage>"&&(y||(y=[0,1]));let w=l.range||l.refRange;return y&&w&&(r[u]=z0(y,w,r[u])),p})}function H0(n,{meta:e}={}){var t,r,i,o;let l={str:(t=String(n))==null?void 0:t.trim()};if(Za.run("parse-start",l),l.color)return l.color;if(l.parsed=TC(l.str),l.parsed){let u=l.parsed.name;if(u==="color"){let f=l.parsed.args.shift(),h=f.startsWith("--")?f.substring(2):`--${f}`,m=[f,h],p=l.parsed.rawArgs.indexOf("/")>0?l.parsed.args.pop():1;for(let S of oe.all){let M=S.getFormat("color");if(M&&(m.includes(M.id)||(r=M.ids)!=null&&r.filter(T=>m.includes(T)).length)){const T=Object.keys(S.coords).map((F,B)=>l.parsed.args[B]||0);let I;return M.coordGrammar&&(I=F0(S,M,"color",T)),e&&Object.assign(e,{formatId:"color",types:I}),M.id.startsWith("--")&&!f.startsWith("--")&&$s.warn(`${S.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("--")&&$s.warn(`${S.name} is a standard space and supported in the CSS spec. Use color(${M.id}) instead of prefixed color(${f}).`),{spaceId:S.id,coords:T,alpha:p}}}let y="",w=f in oe.registry?f:h;if(w in oe.registry){let S=(o=(i=oe.registry[w].formats)==null?void 0:i.color)==null?void 0:o.id;S&&(y=`Did you mean color(${S})?`)}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||CC(l.parsed.args).alpha)&&(m=l.parsed.args.pop());let p=l.parsed.args,y;return h.coordGrammar&&(y=F0(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(l.str))continue;let m=h.parse(l.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 Ke(n){if(Array.isArray(n))return n.map(Ke);if(!n)throw new TypeError("Empty color reference");P0(n)&&(n=H0(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 PC=75e-6,Of=class an{constructor(e){var t;this.id=e.id,this.name=e.name,this.base=e.base?an.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=If(i),this.formats=e.formats??{};for(let o in this.formats){let l=this.formats[o];l.type||(l.type="function"),l.name||(l.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:an.get(e.gamutSpace):this.isPolar?this.gamutSpace=this.base:this.gamutSpace=this,this.gamutSpace.isUnbounded&&(this.inGamut=(o,l)=>!0),this.referred=e.referred,Object.defineProperty(this,"path",{value:DC(this).reverse(),writable:!1,enumerable:!0,configurable:!0}),Za.run("colorspace-init-end",this)}inGamut(e,{epsilon:t=PC}={}){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 l=r[o];if(l.type!=="angle"&&l.range){if(Number.isNaN(i))return!0;let[u,f]=l.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=$0(e,this),e;let t;return e==="default"?t=Object.values(this.formats)[0]:t=this.formats[e],t?(t=$0(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=Ke(e);[e,t]=[u.space,u.coords]}if(e=an.get(e),this.equals(e))return t;t=t.map(u=>Number.isNaN(u)?0:u);let r=this.path,i=e.path,o,l;for(let u=0;u<r.length&&r[u].equals(i[u]);u++)o=r[u],l=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>l;u--)t=r[u].toBase(t);for(let u=l+1;u<i.length;u++)t=i[u].fromBase(t);return t}from(e,t){if(arguments.length===1){const r=Ke(e);[e,t]=[r.space,r.coords]}return e=an.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(an.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 an)return e;if(Hs(e)==="string"){let i=an.registry[e.toLowerCase()];if(!i)throw new TypeError(`No color space found with id = "${e}"`);return i}if(t.length)return an.get(...t);throw new TypeError(`${e} is not a valid color space`)}static resolveCoord(e,t){var r;let i=Hs(e),o,l;if(i==="string"?e.includes(".")?[o,l]=e.split("."):[o,l]=[,e]:Array.isArray(e)?[o,l]=e:(o=e.space,l=e.coordId),o=an.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=Hs(l),i==="number"||i==="string"&&l>=0){let h=Object.entries(o.coords)[l];if(h)return{space:o,id:h[0],index:l,...h[1]}}o=an.get(o);let u=l.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 "${l}" coordinate found in ${o.name}. Its coordinates are: ${Object.keys(o.coords).join(", ")}`)}};Fn(Of,"registry",{}),Fn(Of,"DEFAULT_FORMAT",{type:"functions",name:"color"});let oe=Of;function DC(n){let e=[n];for(let t=n;t=t.base;)e.push(t);return e}function $0(n,{coords:e}={}){if(n.coords&&!n.coordGrammar){n.type||(n.type="function"),n.name||(n.name="color"),n.coordGrammar=IC(n.coords);let t=Object.entries(e).map(([r,i],o)=>{let l=n.coordGrammar[o][0],u=i.range||i.refRange,f=l.range,h="";return l=="<percentage>"?(f=[0,100],h="%"):l=="<angle>"&&(h="deg"),{fromRange:u,toRange:f,suffix:h}});n.serializeCoords=(r,i)=>r.map((o,l)=>{let{fromRange:u,toRange:f,suffix:h}=t[l];return u&&f&&(o=z0(u,f,o)),o=Tf(o,{precision:i,unit:h}),o})}return n}const Wn=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 W0 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=Wn),e.toXYZ_M&&e.fromXYZ_M&&(e.toBase??(e.toBase=t=>{let r=De(e.toXYZ_M,t);return this.white!==this.base.white&&(r=Qa(this.white,this.base.white,r)),r}),e.fromBase??(e.fromBase=t=>(t=Qa(this.base.white,this.white,t),De(e.fromXYZ_M,t)))),e.referred??(e.referred="display"),super(e)}}function Nf(n,e){return n=Ke(n),!e||n.space.equals(e)?n.coords.slice():(e=oe.get(e),e.from(n))}function Un(n,e){n=Ke(n);let{space:t,index:r}=oe.resolveCoord(e,n.space);return Nf(n,t)[r]}function U0(n,e,t){return n=Ke(n),e=oe.get(e),n.coords=e.to(n.space,t),n}U0.returns="color";function Rf(n,e,t){if(n=Ke(n),arguments.length===2&&Hs(arguments[1])==="object"){let r=arguments[1];for(let i in r)Rf(n,i,r[i])}else{typeof t=="function"&&(t=t(Un(n,e)));let{space:r,index:i}=oe.resolveCoord(e,n.space),o=Nf(n,r);o[i]=t,U0(n,r,o)}return n}Rf.returns="color";const zC=new oe({id:"xyz-d50",name:"XYZ D50",white:"D50",base:Wn,fromBase:n=>Qa(Wn.white,"D50",n),toBase:n=>Qa("D50",Wn.white,n)}),BC=216/24389,V0=24/116,el=24389/27;let Lf=$n.D50;const Vn=new oe({id:"lab",name:"Lab",coords:{l:{refRange:[0,100],name:"Lightness"},a:{refRange:[-125,125]},b:{refRange:[-125,125]}},white:Lf,base:zC,fromBase(n){let t=n.map((r,i)=>r/Lf[i]).map(r=>r>BC?Math.cbrt(r):(el*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]>V0?Math.pow(e[0],3):(116*e[0]-16)/el,n[0]>8?Math.pow((n[0]+16)/116,3):n[0]/el,e[2]>V0?Math.pow(e[2],3):(116*e[2]-16)/el].map((r,i)=>r*Lf[i])},formats:{lab:{coords:["<number> | <percentage>","<number> | <percentage>[-1,1]","<number> | <percentage>[-1,1]"]}}});function jr(n){return(n%360+360)%360}const tl=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:Vn,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),jr(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>"]}}}),K0=25**7,nl=Math.PI,G0=180/nl,Fi=nl/180;function q0(n){const e=n*n;return e*e*e*n}function J0(n,e,{kL:t=1,kC:r=1,kH:i=1}={}){[n,e]=Ke([n,e]);let[o,l,u]=Vn.from(n),f=tl.from(Vn,[o,l,u])[1],[h,m,p]=Vn.from(e),y=tl.from(Vn,[h,m,p])[1];f<0&&(f=0),y<0&&(y=0);let w=(f+y)/2,S=q0(w),M=.5*(1-Math.sqrt(S/(S+K0))),T=(1+M)*l,I=(1+M)*m,F=Math.sqrt(T**2+u**2),B=Math.sqrt(I**2+p**2),$=T===0&&u===0?0:Math.atan2(u,T),X=I===0&&p===0?0:Math.atan2(p,I);$<0&&($+=2*nl),X<0&&(X+=2*nl),$*=G0,X*=G0;let q=h-o,ie=B-F,Ee=X-$,Gt=$+X,ei=Math.abs(Ee),qt;F*B===0?qt=0:ei<=180?qt=Ee:Ee>180?qt=Ee-360:Ee<-180?qt=Ee+360:$s.warn("the unthinkable has happened");let un=2*Math.sqrt(B*F)*Math.sin(qt*Fi/2),Gn=(o+h)/2,Jt=(F+B)/2,Sn=q0(Jt),Be;F*B===0?Be=Gt:ei<=180?Be=Gt/2:Gt<360?Be=(Gt+360)/2:Be=(Gt-360)/2;let Fe=(Gn-50)**2,He=1+.015*Fe/Math.sqrt(20+Fe),It=1+.045*Jt,et=1;et-=.17*Math.cos((Be-30)*Fi),et+=.24*Math.cos(2*Be*Fi),et+=.32*Math.cos((3*Be+6)*Fi),et-=.2*Math.cos((4*Be-63)*Fi);let $e=1+.015*Jt*et,qn=30*Math.exp(-1*((Be-275)/25)**2),Jn=2*Math.sqrt(Sn/(Sn+K0)),dl=-1*Math.sin(2*qn*Fi)*Jn,jt=(q/(t*He))**2;return jt+=(ie/(r*It))**2,jt+=(un/(i*$e))**2,jt+=dl*(ie/(r*It))*(un/(i*$e)),Math.sqrt(jt)}const FC=[[.819022437996703,.3619062600528904,-.1288737815209879],[.0329836539323885,.9292868615863434,.0361446663506424],[.0481771893596242,.2642395317527308,.6335478284694309]],HC=[[1.2268798758459243,-.5578149944602171,.2813910456659647],[-.0405757452148008,1.112286803280317,-.0717110580655164],[-.0763729366746601,-.4214933324022432,1.5869240198367816]],$C=[[.210454268309314,.7936177747023054,-.0040720430116193],[1.9779985324311684,-2.42859224204858,.450593709617411],[.0259040424655478,.7827717124575296,-.8086757549230774]],WC=[[1,.3963377773761749,.2158037573099136],[1,-.1055613458156586,-.0638541728258133],[1,-.0894841775298119,-1.2914855480194092]],rl=new oe({id:"oklab",name:"Oklab",coords:{l:{refRange:[0,1],name:"Lightness"},a:{refRange:[-.4,.4]},b:{refRange:[-.4,.4]}},white:"D65",base:Wn,fromBase(n){let t=De(FC,n).map(r=>Math.cbrt(r));return De($C,t)},toBase(n){let t=De(WC,n).map(r=>r**3);return De(HC,t)},formats:{oklab:{coords:["<percentage> | <number>","<number> | <percentage>[-1,1]","<number> | <percentage>[-1,1]"]}}});function Pf(n,e){[n,e]=Ke([n,e]);let[t,r,i]=rl.from(n),[o,l,u]=rl.from(e),f=t-o,h=r-l,m=i-u;return Math.sqrt(f**2+h**2+m**2)}const UC=75e-6;function Hi(n,e,{epsilon:t=UC}={}){n=Ke(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 Df(n){return{space:n.space,coords:n.coords.slice(),alpha:n.alpha}}function VC(n,e,t="lab"){t=oe.get(t);let r=t.from(n),i=t.from(e);return Math.sqrt(r.reduce((o,l,u)=>{let f=i[u];return isNaN(l)||isNaN(f)?o:o+(f-l)**2},0))}function KC(n,e){return VC(n,e,"lab")}const GC=Math.PI,j0=GC/180;function qC(n,e,{l:t=2,c:r=1}={}){[n,e]=Ke([n,e]);let[i,o,l]=Vn.from(n),[,u,f]=tl.from(Vn,[i,o,l]),[h,m,p]=Vn.from(e),y=tl.from(Vn,[h,m,p])[1];u<0&&(u=0),y<0&&(y=0);let w=i-h,S=u-y,M=o-m,T=l-p,I=M**2+T**2-S**2,F=.511;i>=16&&(F=.040975*i/(1+.01765*i));let B=.0638*u/(1+.0131*u)+.638,$;Number.isNaN(f)&&(f=0),f>=164&&f<=345?$=.56+Math.abs(.2*Math.cos((f+168)*j0)):$=.36+Math.abs(.4*Math.cos((f+35)*j0));let X=Math.pow(u,4),q=Math.sqrt(X/(X+1900)),ie=B*(q*$+1-q),Ee=(w/(t*F))**2;return Ee+=(S/(r*B))**2,Ee+=I/ie**2,Math.sqrt(Ee)}const Y0=203,X0=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:Wn,fromBase(n){return n.map(e=>Math.max(e*Y0,0))},toBase(n){return n.map(e=>Math.max(e/Y0,0))}}),il=1.15,sl=.66,Z0=2610/2**14,JC=2**14/2610,Q0=3424/2**12,e1=2413/2**7,t1=2392/2**7,jC=1.7*2523/2**5,n1=2**5/(1.7*2523),ol=-.56,zf=16295499532821565e-27,YC=[[.41478972,.579999,.014648],[-.20151,1.120649,.0531008],[-.0166008,.2648,.6684799]],XC=[[1.9242264357876067,-1.0047923125953657,.037651404030618],[.35031676209499907,.7264811939316552,-.06538442294808501],[-.09098281098284752,-.3127282905230739,1.5227665613052603]],ZC=[[.5,.5,0],[3.524,-4.066708,.542708],[.199076,1.096799,-1.295875]],QC=[[1,.1386050432715393,.05804731615611886],[.9999999999999999,-.1386050432715393,-.05804731615611886],[.9999999999999998,-.09601924202631895,-.8118918960560388]],eA=new oe({id:"jzazbz",name:"Jzazbz",coords:{jz:{refRange:[0,1],name:"Jz"},az:{refRange:[-.5,.5]},bz:{refRange:[-.5,.5]}},base:X0,fromBase(n){let[e,t,r]=n,i=il*e-(il-1)*r,o=sl*t-(sl-1)*e,u=De(YC,[i,o,r]).map(function(y){let w=Q0+e1*(y/1e4)**Z0,S=1+t1*(y/1e4)**Z0;return(w/S)**jC}),[f,h,m]=De(ZC,u);return[(1+ol)*f/(1+ol*f)-zf,h,m]},toBase(n){let[e,t,r]=n,i=(e+zf)/(1+ol-ol*(e+zf)),l=De(QC,[i,t,r]).map(function(y){let w=Q0-y**n1,S=t1*y**n1-e1;return 1e4*(w/S)**JC}),[u,f,h]=De(XC,l),m=(u+(il-1)*h)/il,p=(f+(sl-1)*m)/sl;return[m,p,h]},formats:{color:{coords:["<number> | <percentage>","<number> | <percentage>[-1,1]","<number> | <percentage>[-1,1]"]}}}),r1=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:eA,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),jr(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]=Ke([n,e]);let[t,r,i]=r1.from(n),[o,l,u]=r1.from(e),f=t-o,h=r-l;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*l)*Math.sin(m/2*(Math.PI/180));return Math.sqrt(f**2+h**2+p**2)}const i1=3424/4096,s1=2413/128,o1=2392/128,a1=2610/16384,nA=2523/32,rA=16384/2610,l1=32/2523,iA=[[.3592832590121217,.6976051147779502,-.035891593232029],[-.1920808463704993,1.100476797037432,.0753748658519118],[.0070797844607479,.0748396662186362,.8433265453898765]],sA=[[2048/4096,2048/4096,0],[6610/4096,-13613/4096,7003/4096],[17933/4096,-17390/4096,-543/4096]],oA=[[.9999999999999998,.0086090370379328,.111029625003026],[.9999999999999998,-.0086090370379328,-.1110296250030259],[.9999999999999998,.5600313357106791,-.3206271749873188]],aA=[[2.0701522183894223,-1.3263473389671563,.2066510476294053],[.3647385209748072,.6805660249472273,-.0453045459220347],[-.0497472075358123,-.0492609666966131,1.1880659249923042]],u1=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:X0,fromBase(n){let e=De(iA,n);return lA(e)},toBase(n){let e=uA(n);return De(aA,e)}});function lA(n){let e=n.map(function(t){let r=i1+s1*(t/1e4)**a1,i=1+o1*(t/1e4)**a1;return(r/i)**nA});return De(sA,e)}function uA(n){return De(oA,n).map(function(r){let i=Math.max(r**l1-i1,0),o=s1-o1*r**l1;return 1e4*(i/o)**rA})}function cA(n,e){[n,e]=Ke([n,e]);let[t,r,i]=u1.from(n),[o,l,u]=u1.from(e);return 720*Math.sqrt((t-o)**2+.25*(r-l)**2+(i-u)**2)}const fA=$n.D65,c1=.42,f1=1/c1,Bf=2*Math.PI,h1=[[.401288,.650173,-.051461],[-.250268,1.204414,.045854],[-.002079,.048952,.953127]],hA=[[1.8620678550872327,-1.0112546305316843,.14918677544445175],[.38752654323613717,.6214474419314753,-.008973985167612518],[-.015841498849333856,-.03412293802851557,1.0499644368778496]],dA=[[460,451,288],[460,-891,-261],[460,-220,-6300]],pA={dark:[.8,.525,.8],dim:[.9,.59,.9],average:[1,.69,1]},Yr={h:[20.14,90,164.25,237.53,380.14],e:[.8,.7,1,1.2,.8],H:[0,100,200,300,400]},mA=180/Math.PI,d1=Math.PI/180;function p1(n,e){return n.map(r=>{const i=Hn(e*Math.abs(r)*.01,c1);return 400*Af(i,r)/(i+27.13)})}function gA(n,e){const t=100/e*27.13**f1;return n.map(r=>{const i=Math.abs(r);return Af(t*Hn(i/(400-i),f1),r)})}function yA(n){let e=jr(n);e<=Yr.h[0]&&(e+=360);const t=NC(Yr.h,e)-1,[r,i]=Yr.h.slice(t,t+2),[o,l]=Yr.e.slice(t,t+2),u=Yr.H[t],f=(e-r)/o;return u+100*f/(f+(i-e)/l)}function bA(n){let e=(n%400+400)%400;const t=Math.floor(.01*e);e=e%100;const[r,i]=Yr.h.slice(t,t+2),[o,l]=Yr.e.slice(t,t+2);return jr((e*(l*r-o*i)-100*r*l)/(e*(l-o)-100*l))}function m1(n,e,t,r,i){const o={};o.discounting=i,o.refWhite=n,o.surround=r;const l=n.map(M=>M*100);o.la=e,o.yb=t;const u=l[1],f=De(h1,l);r=pA[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=>D0(1,u/M,y)),o.dRgbInv=o.dRgb.map(M=>1/M);const w=f.map((M,T)=>M*o.dRgb[T]),S=p1(w,o.fl);return o.aW=o.nbb*(2*S[0]+S[1]+.05*S[2]),o}const g1=m1(fA,64/Math.PI*.2,20,"average",!1);function Ff(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=jr(n.h)*d1:t=bA(n.H)*d1;const r=Math.cos(t),i=Math.sin(t);let o=0;n.J!==void 0?o=Hn(n.J,1/2)*.1:n.Q!==void 0&&(o=.25*e.c*n.Q/((e.aW+4)*e.flRoot));let l=0;n.C!==void 0?l=n.C/o:n.M!==void 0?l=n.M/e.flRoot/o:n.s!==void 0&&(l=4e-4*n.s**2*(e.aW+4)/e.c);const u=Hn(l*Math.pow(1.64-Math.pow(.29,e.n),-.73),10/9),f=.25*(Math.cos(t+2)+3.8),h=e.aW*Hn(o,2/e.c/e.z),m=5e4/13*e.nc*e.ncb*f,p=h/e.nbb,y=23*(p+.305)*B0(u,23*m+u*(11*r+108*i)),w=y*r,S=y*i,M=gA(De(dA,[p,w,S]).map(T=>T*1/1403),e.fl);return De(hA,M.map((T,I)=>T*e.dRgbInv[I])).map(T=>T/100)}function y1(n,e){const t=n.map(B=>B*100),r=p1(De(h1,t).map((B,$)=>B*e.dRgb[$]),e.fl),i=r[0]+(-12*r[1]+r[2])/11,o=(r[0]+r[1]-2*r[2])/9,l=(Math.atan2(o,i)%Bf+Bf)%Bf,u=.25*(Math.cos(l+2)+3.8),f=5e4/13*e.nc*e.ncb*B0(u*Math.sqrt(i**2+o**2),r[0]+r[1]+1.05*r[2]+.305),h=Hn(f,.9)*Math.pow(1.64-Math.pow(.29,e.n),.73),m=e.nbb*(2*r[0]+r[1]+.05*r[2]),p=Hn(m/e.aW,.5*e.c*e.z),y=100*Hn(p,2),w=4/e.c*p*(e.aW+4)*e.flRoot,S=h*p,M=S*e.flRoot,T=jr(l*mA),I=yA(T),F=50*Hn(e.c*h/(e.aW+4),1/2);return{J:y,C:S,h:T,s:F,Q:w,M,H:I}}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:Wn,fromBase(n){const e=y1(n,g1);return[e.J,e.M,e.h]},toBase(n){return Ff({J:n[0],M:n[1],h:n[2]},g1)}});const vA=$n.D65,wA=216/24389,b1=24389/27;function SA(n){return 116*(n>wA?Math.cbrt(n):(b1*n+16)/116)-16}function Hf(n){return n>8?Math.pow((n+16)/116,3):n/b1}function xA(n,e){let[t,r,i]=n,o=[],l=0;if(i===0)return[0,0,0];let u=Hf(i);i>0?l=.00379058511492914*i**2+.608983189401032*i+.9155088574762233:l=9514440756550361e-21*i**2+.08693057439788597*i-21.928975842194614;const f=2e-12,h=15;let m=0,p=1/0;for(;m<=h;){o=Ff({J:l,C:r,h:t},e);const y=Math.abs(o[1]-u);if(y<p){if(y<=f)return o;p=y}l=l-(o[1]-u)*l/(2*o[1]),m+=1}return Ff({J:l,C:r,h:t},e)}function kA(n,e){const t=SA(n[1]);if(t===0)return[0,0,0];const r=y1(n,$f);return[jr(r.h),r.C,t]}const $f=m1(vA,200/Math.PI*Hf(50),Hf(50)*100,"average",!1),al=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:Wn,fromBase(n){return kA(n)},toBase(n){return xA(n,$f)},formats:{color:{id:"--hct",coords:["<number> | <angle>","<percentage> | <number>","<percentage> | <number>"]}}}),_A=Math.PI/180,v1=[1,.007,.0228];function w1(n){n[1]<0&&(n=al.fromBase(al.toBase(n)));const e=Math.log(Math.max(1+v1[2]*n[1]*$f.flRoot,1))/v1[2],t=n[0]*_A,r=e*Math.cos(t),i=e*Math.sin(t);return[n[2],r,i]}function EA(n,e){[n,e]=Ke([n,e]);let[t,r,i]=w1(al.from(n)),[o,l,u]=w1(al.from(e));return Math.sqrt((t-o)**2+(r-l)**2+(i-u)**2)}const S1={deltaE76:KC,deltaECMC:qC,deltaE2000:J0,deltaEJz:tA,deltaEITP:cA,deltaEOK:Pf,deltaEHCT:EA};function MA(n){const e=n?Math.floor(Math.log10(Math.abs(n))):0;return Math.max(parseFloat(`1e${e-2}`),1e-6)}const x1={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 Ws(n,{method:e=$s.gamut_mapping,space:t=void 0,deltaEMethod:r="",jnd:i=2,blackWhiteClamp:o={}}={}){if(n=Ke(n),P0(arguments[1])?t=arguments[1]:t||(t=n.space),t=oe.get(t),Hi(n,t,{epsilon:0}))return n;let l;if(e==="css")l=TA(n,{space:t});else{if(e!=="clip"&&!Hi(n,t)){Object.prototype.hasOwnProperty.call(x1,e)&&({method:e,jnd:i,deltaEMethod:r,blackWhiteClamp:o}=x1[e]);let u=J0;if(r!==""){for(let h in S1)if("deltae"+r.toLowerCase()===h.toLowerCase()){u=S1[h];break}}let f=Ws(ze(n,t),{method:"clip",space:t});if(u(n,f)>i){if(Object.keys(o).length===3){let F=oe.resolveCoord(o.channel),B=Un(ze(n,F.space),F.id);if(Cf(B)&&(B=0),B>=o.max)return ze({space:"xyz-d65",coords:$n.D65},n.space);if(B<=o.min)return ze({space:"xyz-d65",coords:[0,0,0]},n.space)}let h=oe.resolveCoord(e),m=h.space,p=h.id,y=ze(n,m);y.coords.forEach((F,B)=>{Cf(F)&&(y.coords[B]=0)});let S=(h.range||h.refRange)[0],M=MA(i),T=S,I=Un(y,p);for(;I-T>M;){let F=Df(y);F=Ws(F,{space:t,method:"clip"}),u(y,F)-i<M?T=Un(y,p):I=Un(y,p),Rf(y,p,(T+I)/2)}l=ze(y,t)}else l=f}else l=ze(n,t);if(e==="clip"||!Hi(l,t,{epsilon:0})){let u=Object.values(t.coords).map(f=>f.range||[]);l.coords=l.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&&(l=ze(l,n.space)),n.coords=l.coords,n}Ws.returns="color";const k1={WHITE:{space:rl,coords:[1,0,0]},BLACK:{space:rl,coords:[0,0,0]}};function TA(n,{space:e}={}){n=Ke(n),e||(e=n.space),e=oe.get(e);const i=oe.get("oklch");if(e.isUnbounded)return ze(n,e);const o=ze(n,i);let l=o.coords[0];if(l>=1){const S=ze(k1.WHITE,e);return S.alpha=n.alpha,ze(S,e)}if(l<=0){const S=ze(k1.BLACK,e);return S.alpha=n.alpha,ze(S,e)}if(Hi(o,e,{epsilon:0}))return ze(o,e);function u(S){const M=ze(S,e),T=Object.values(e.coords);return M.coords=M.coords.map((I,F)=>{if("range"in T[F]){const[B,$]=T[F].range;return OC(B,I,$)}return I}),M}let f=0,h=o.coords[1],m=!0,p=Df(o),y=u(p),w=Pf(y,p);if(w<.02)return y;for(;h-f>1e-4;){const S=(f+h)/2;if(p.coords[1]=S,m&&Hi(p,e,{epsilon:0}))f=S;else if(y=u(p),w=Pf(y,p),w<.02){if(.02-w<1e-4)break;m=!1,f=S}else h=S}return y}function ze(n,e,{inGamut:t}={}){n=Ke(n),e=oe.get(e);let r=e.from(n),i={space:e,coords:r,alpha:n.alpha};return t&&(i=Ws(i,t===!0?void 0:t)),i}ze.returns="color";function CA(n,{precision:e=$s.precision,format:t="default",inGamut:r=!0,...i}={}){var o;let l;n=Ke(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&&!Hi(n)&&(f=Ws(Df(n),r===!0?void 0:r).coords),t.type==="custom")if(i.precision=e,t.serialize)l=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(w=>Tf(w,{precision:e})));let m=[...f];if(h==="color"){let w=t.id||((o=t.ids)==null?void 0:o[0])||n.space.id;m.unshift(w)}let p=n.alpha;e!==null&&(p=Tf(p,{precision:e}));let y=n.alpha>=1||t.noAlpha?"":`${t.commas?",":" /"} ${p}`;l=`${h}(${m.join(t.commas?", ":" ")}${y})`}return l}const AA=[[.41239079926595934,.357584339383878,.1804807884018343],[.21263900587151027,.715168678767756,.07219231536073371],[.01933081871559182,.11919477979462598,.9505321522496607]],IA=[[3.2409699419045226,-1.537383177570094,-.4986107602930034],[-.9692436362808796,1.8759675015077202,.04155505740717559],[.05563007969699366,-.20397695888897652,1.0569715142428786]],OA=new W0({id:"srgb-linear",name:"Linear sRGB",white:"D65",toXYZ_M:AA,fromXYZ_M:IA}),_1={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 E1=Array(3).fill("<percentage> | <number>[0, 255]"),M1=Array(3).fill("<number>[0, 255]");const T1=new W0({id:"srgb",name:"sRGB",base:OA,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:E1},rgb_number:{name:"rgb",commas:!0,coords:M1,noAlpha:!0},color:{},rgba:{coords:E1,commas:!0,lastAlpha:!0},rgba_number:{name:"rgba",commas:!0,coords:M1},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=_1.black,e.alpha=0):e.coords=_1[n],e.coords)return e}}}});function NA(n){return Un(n,[Wn,"y"])}const C1=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:T1,fromBase:n=>{let e=Math.max(...n),t=Math.min(...n),[r,i,o]=n,[l,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:l=(i-o)/h+(i<o?6:0);break;case i:l=(o-r)/h+2;break;case o:l=(r-i)/h+4}l=l*60}return u<0&&(l+=180,u=Math.abs(u)),l>=360&&(l-=360),[l,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 l=(o+e/30)%12,u=t*Math.min(r,1-r);return r-u*Math.max(-1,Math.min(l-3,9-l,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}}}),RA=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:C1,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 At{constructor(e){Fn(this,"data"),this.data=ze(e,"srgb")}static fromTransparent(){return new At({spaceId:"srgb",coords:[1,1,1],alpha:0})}static fromBlack(){return new At({spaceId:"srgb",coords:[0,0,0],alpha:1})}static fromWhite(){return new At({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 Un(this.data,"hsv.h")}get s(){return Un(this.data,"hsv.s")}get v(){return Un(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 NA(this.data)<.5}withAlpha(e){return new At({...this.data,alpha:e})}withRgb(e){const t=this.alpha===0?1:this.alpha;return new At({spaceId:"srgb",alpha:e.a??t,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]]})}withHsv(e){const r=Nf(this.data,"hsv"),i=Math.max(e.s??r[1],1e-5),o=Math.max(e.v??r[2],1e-5),l=this.alpha===0?1:this.alpha;return new At({alpha:l,spaceId:"hsv",coords:[e.h??r[0],i,o]})}toString(){return this.alpha===1?this.toHexString():this.toRgbaString()}toHexString(){const e=CA(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 At(this.data)}}class LA{constructor(e){Fn(this,"_color"),Fn(this,"isEmpty",!1),this.update(e)}get color(){return this._color}setColor(e){this._color=e}setEmpty(e){this.isEmpty=e}toString(){return this.isEmpty?"":this.color.toString()}isEqual(e){return this.toString()===e}update({solidColor:e,isEmpty:t}){this.setColor(e),this.setEmpty(t)}}let A1=999;function PA(){return A1+=1,A1}function DA(n){return n?n.startsWith("linear-gradient("):!1}function zA(){const n=At.fromTransparent();return{isEmpty:!0,isGradient:!1,solidColor:n,angle:0,transitions:[{color:n.clone(),offset:0},{color:n.clone(),offset:100}]}}oe.register(T1),oe.register(RA),oe.register(C1);function I1(n){if(!n)return At.fromTransparent();try{return new At(ze(H0(n),"srgb"))}catch(e){return console.warn(e),At.fromBlack()}}function BA(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 FA(n){return n.map(e=>{const[t,r]=e.trim().split(/\s+(?![^(]*\))/);return{color:I1(t),offset:Number.parseFloat(r.replace("%",""))}})}function HA(n){const e=n.indexOf("("),t=n.lastIndexOf(")"),[r,...i]=n.slice(e+1,t).split(/,(?![^(]*\))/),o=FA(i),l=BA(r);return{isEmpty:!1,isGradient:!0,solidColor:o[0].color,angle:l,transitions:o}}function $A(n){const e=I1(n),t=At.fromWhite();return{isEmpty:!1,isGradient:!1,solidColor:e,angle:0,transitions:[{color:t,offset:0},{color:e.withAlpha(1),offset:100}]}}function WA(n,e=!0){if(!n)return zA();const t=DA(n)?HA(n):$A(n);return t.isGradient&&!e?{...t,isGradient:!1}:t}class jf{constructor(e,t=0){Fn(this,"id"),this.color=e,this.offset=t,this.id=PA()}setOffset(e){this.offset=e}toString(){return`${this.color.toString()} ${this.offset}%`}clone(e){return new jf(this.color.clone(),e)}}class UA{constructor(e){Fn(this,"isEmpty",!1),Fn(this,"_angle",0),Fn(this,"_transitions",[]),this.update(e)}get transitions(){return this._transitions}get canAddTransition(){return this.transitions.length<5}get canRemoveTransition(){return this.transitions.length>2}get angle(){return this._angle}setAngle(e){this._angle=e}setEmpty(e){this.isEmpty=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.isEmpty)return"";const t=this.transitions.map(r=>r.toString());return`linear-gradient(${e??this.angle}deg, ${t.join(", ")})`}isEqual(e){return this.toString()===e}update(e){this._angle=e.angle,this._transitions=e.transitions.map(({color:t,offset:r})=>new jf(t,r)),this.setEmpty(e.isEmpty)}hasTransition(e){return this.transitions.some(t=>t.id===e.id)}}function VA(n){const e=WA(n);return(e.isGradient?new UA(e):new LA(e)).toString()}function O1(n){return VA(n)}function N1(n,e){if(!n.includes("em"))return parseInt(n);const t=$i.getComputedStyle(e).fontSize,r=parseFloat(n)*parseFloat(t);return Math.round(r)}function KA(n,e){return(n.firstElementChild||n).style.fontSize||$i.getComputedStyle(e).fontSize}function GA(n,e,t){if(!n.includes("px"))return n;const r=KA(e,t),i=N1(r,t);return i?(parseInt(n)/i).toFixed(2):null}const qA={start:yr.LEFT,end:yr.RIGHT};function JA(n){const e=qA[n]||n;return yr.values.includes(e)?e:null}const R1=(n,e,t,r)=>({from:Math.max(r,n.pos),to:Math.min(r+t.nodeSize,e.pos)});function L1(n,e){return n.resolve(e).depth+1}function jA(n,e,t,r){const i=L1(n,r),o=e.from-i<=r,l=e.to+i>=t.nodeSize+r;return o&&l}const YA=(n,e)=>n.eq(e);function XA(n,e,t,r=YA){const i=n.resolve(e).path.reverse();for(const o of i)if(typeof o!="number"){for(const l of o.marks)if(r(l,t))return!0}return!1}function ZA(n,e){const t=typeof e=="string"?e:e.name;return n.find(r=>r.type.name===t)}var ll=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},Us={exports:{}};var QA=Us.exports,P1;function eI(){return P1||(P1=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.",l="Expected a function",u="Invalid `variable` option passed into `_.template`",f="__lodash_hash_undefined__",h=500,m="__lodash_placeholder__",p=1,y=2,w=4,S=1,M=2,T=1,I=2,F=4,B=8,$=16,X=32,q=64,ie=128,Ee=256,Gt=512,ei=30,qt="...",un=800,Gn=16,Jt=1,Sn=2,Be=3,Fe=1/0,He=9007199254740991,It=17976931348623157e292,et=NaN,$e=4294967295,qn=$e-1,Jn=$e>>>1,dl=[["ary",ie],["bind",T],["bindKey",I],["curry",B],["curryRight",$],["flip",Gt],["partial",X],["partialRight",q],["rearg",Ee]],jt="[object Arguments]",Gs="[object Array]",W1="[object AsyncFunction]",Gi="[object Boolean]",qi="[object Date]",U1="[object DOMException]",qs="[object Error]",Js="[object Function]",Zf="[object GeneratorFunction]",Yt="[object Map]",Ji="[object Number]",V1="[object Null]",xn="[object Object]",Qf="[object Promise]",K1="[object Proxy]",ji="[object RegExp]",Xt="[object Set]",Yi="[object String]",js="[object Symbol]",G1="[object Undefined]",Xi="[object WeakMap]",q1="[object WeakSet]",Zi="[object ArrayBuffer]",ti="[object DataView]",pl="[object Float32Array]",ml="[object Float64Array]",gl="[object Int8Array]",yl="[object Int16Array]",bl="[object Int32Array]",vl="[object Uint8Array]",wl="[object Uint8ClampedArray]",Sl="[object Uint16Array]",xl="[object Uint32Array]",J1=/\b__p \+= '';/g,j1=/\b(__p \+=) '' \+/g,Y1=/(__e\(.*?\)|\b__t\)) \+\n'';/g,eh=/&(?:amp|lt|gt|quot|#39);/g,th=/[&<>"']/g,X1=RegExp(eh.source),Z1=RegExp(th.source),Q1=/<%-([\s\S]+?)%>/g,ey=/<%([\s\S]+?)%>/g,nh=/<%=([\s\S]+?)%>/g,ty=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,ny=/^\w*$/,ry=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,kl=/[\\^$.*+?()[\]{}|]/g,iy=RegExp(kl.source),_l=/^\s+/,sy=/\s/,oy=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,ay=/\{\n\/\* \[wrapped with (.+)\] \*/,ly=/,? & /,uy=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,cy=/[()=,{}\[\]\/\s]/,fy=/\\(\\)?/g,hy=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,rh=/\w*$/,dy=/^[-+]0x[0-9a-f]+$/i,py=/^0b[01]+$/i,my=/^\[object .+?Constructor\]$/,gy=/^0o[0-7]+$/i,yy=/^(?:0|[1-9]\d*)$/,by=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Ys=/($^)/,vy=/['\n\r\u2028\u2029\\]/g,Xs="\\ud800-\\udfff",wy="\\u0300-\\u036f",Sy="\\ufe20-\\ufe2f",xy="\\u20d0-\\u20ff",ih=wy+Sy+xy,sh="\\u2700-\\u27bf",oh="a-z\\xdf-\\xf6\\xf8-\\xff",ky="\\xac\\xb1\\xd7\\xf7",_y="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",Ey="\\u2000-\\u206f",My=" \\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",ah="A-Z\\xc0-\\xd6\\xd8-\\xde",lh="\\ufe0e\\ufe0f",uh=ky+_y+Ey+My,El="['\u2019]",Ty="["+Xs+"]",ch="["+uh+"]",Zs="["+ih+"]",fh="\\d+",Cy="["+sh+"]",hh="["+oh+"]",dh="[^"+Xs+uh+fh+sh+oh+ah+"]",Ml="\\ud83c[\\udffb-\\udfff]",Ay="(?:"+Zs+"|"+Ml+")",ph="[^"+Xs+"]",Tl="(?:\\ud83c[\\udde6-\\uddff]){2}",Cl="[\\ud800-\\udbff][\\udc00-\\udfff]",ni="["+ah+"]",mh="\\u200d",gh="(?:"+hh+"|"+dh+")",Iy="(?:"+ni+"|"+dh+")",yh="(?:"+El+"(?:d|ll|m|re|s|t|ve))?",bh="(?:"+El+"(?:D|LL|M|RE|S|T|VE))?",vh=Ay+"?",wh="["+lh+"]?",Oy="(?:"+mh+"(?:"+[ph,Tl,Cl].join("|")+")"+wh+vh+")*",Ny="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Ry="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",Sh=wh+vh+Oy,Ly="(?:"+[Cy,Tl,Cl].join("|")+")"+Sh,Py="(?:"+[ph+Zs+"?",Zs,Tl,Cl,Ty].join("|")+")",Dy=RegExp(El,"g"),zy=RegExp(Zs,"g"),Al=RegExp(Ml+"(?="+Ml+")|"+Py+Sh,"g"),By=RegExp([ni+"?"+hh+"+"+yh+"(?="+[ch,ni,"$"].join("|")+")",Iy+"+"+bh+"(?="+[ch,ni+gh,"$"].join("|")+")",ni+"?"+gh+"+"+yh,ni+"+"+bh,Ry,Ny,fh,Ly].join("|"),"g"),Fy=RegExp("["+mh+Xs+ih+lh+"]"),Hy=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,$y=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],Wy=-1,xe={};xe[pl]=xe[ml]=xe[gl]=xe[yl]=xe[bl]=xe[vl]=xe[wl]=xe[Sl]=xe[xl]=!0,xe[jt]=xe[Gs]=xe[Zi]=xe[Gi]=xe[ti]=xe[qi]=xe[qs]=xe[Js]=xe[Yt]=xe[Ji]=xe[xn]=xe[ji]=xe[Xt]=xe[Yi]=xe[Xi]=!1;var Se={};Se[jt]=Se[Gs]=Se[Zi]=Se[ti]=Se[Gi]=Se[qi]=Se[pl]=Se[ml]=Se[gl]=Se[yl]=Se[bl]=Se[Yt]=Se[Ji]=Se[xn]=Se[ji]=Se[Xt]=Se[Yi]=Se[js]=Se[vl]=Se[wl]=Se[Sl]=Se[xl]=!0,Se[qs]=Se[Js]=Se[Xi]=!1;var Uy={\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"},Vy={"&":"&","<":"<",">":">",'"':""","'":"'"},Ky={"&":"&","<":"<",">":">",""":'"',"'":"'"},Gy={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},qy=parseFloat,Jy=parseInt,xh=typeof ll=="object"&&ll&&ll.Object===Object&&ll,jy=typeof self=="object"&&self&&self.Object===Object&&self,Je=xh||jy||Function("return this")(),Il=e&&!e.nodeType&&e,_r=Il&&!0&&n&&!n.nodeType&&n,kh=_r&&_r.exports===Il,Ol=kh&&xh.process,Ot=function(){try{var _=_r&&_r.require&&_r.require("util").types;return _||Ol&&Ol.binding&&Ol.binding("util")}catch{}}(),_h=Ot&&Ot.isArrayBuffer,Eh=Ot&&Ot.isDate,Mh=Ot&&Ot.isMap,Th=Ot&&Ot.isRegExp,Ch=Ot&&Ot.isSet,Ah=Ot&&Ot.isTypedArray;function wt(_,A,C){switch(C.length){case 0:return _.call(A);case 1:return _.call(A,C[0]);case 2:return _.call(A,C[0],C[1]);case 3:return _.call(A,C[0],C[1],C[2])}return _.apply(A,C)}function Yy(_,A,C,W){for(var Q=-1,ge=_==null?0:_.length;++Q<ge;){var Le=_[Q];A(W,Le,C(Le),_)}return W}function Nt(_,A){for(var C=-1,W=_==null?0:_.length;++C<W&&A(_[C],C,_)!==!1;);return _}function Xy(_,A){for(var C=_==null?0:_.length;C--&&A(_[C],C,_)!==!1;);return _}function Ih(_,A){for(var C=-1,W=_==null?0:_.length;++C<W;)if(!A(_[C],C,_))return!1;return!0}function jn(_,A){for(var C=-1,W=_==null?0:_.length,Q=0,ge=[];++C<W;){var Le=_[C];A(Le,C,_)&&(ge[Q++]=Le)}return ge}function Qs(_,A){var C=_==null?0:_.length;return!!C&&ri(_,A,0)>-1}function Nl(_,A,C){for(var W=-1,Q=_==null?0:_.length;++W<Q;)if(C(A,_[W]))return!0;return!1}function _e(_,A){for(var C=-1,W=_==null?0:_.length,Q=Array(W);++C<W;)Q[C]=A(_[C],C,_);return Q}function Yn(_,A){for(var C=-1,W=A.length,Q=_.length;++C<W;)_[Q+C]=A[C];return _}function Rl(_,A,C,W){var Q=-1,ge=_==null?0:_.length;for(W&&ge&&(C=_[++Q]);++Q<ge;)C=A(C,_[Q],Q,_);return C}function Zy(_,A,C,W){var Q=_==null?0:_.length;for(W&&Q&&(C=_[--Q]);Q--;)C=A(C,_[Q],Q,_);return C}function Ll(_,A){for(var C=-1,W=_==null?0:_.length;++C<W;)if(A(_[C],C,_))return!0;return!1}var Qy=Pl("length");function e2(_){return _.split("")}function t2(_){return _.match(uy)||[]}function Oh(_,A,C){var W;return C(_,function(Q,ge,Le){if(A(Q,ge,Le))return W=ge,!1}),W}function eo(_,A,C,W){for(var Q=_.length,ge=C+(W?1:-1);W?ge--:++ge<Q;)if(A(_[ge],ge,_))return ge;return-1}function ri(_,A,C){return A===A?d2(_,A,C):eo(_,Nh,C)}function n2(_,A,C,W){for(var Q=C-1,ge=_.length;++Q<ge;)if(W(_[Q],A))return Q;return-1}function Nh(_){return _!==_}function Rh(_,A){var C=_==null?0:_.length;return C?zl(_,A)/C:et}function Pl(_){return function(A){return A==null?t:A[_]}}function Dl(_){return function(A){return _==null?t:_[A]}}function Lh(_,A,C,W,Q){return Q(_,function(ge,Le,we){C=W?(W=!1,ge):A(C,ge,Le,we)}),C}function r2(_,A){var C=_.length;for(_.sort(A);C--;)_[C]=_[C].value;return _}function zl(_,A){for(var C,W=-1,Q=_.length;++W<Q;){var ge=A(_[W]);ge!==t&&(C=C===t?ge:C+ge)}return C}function Bl(_,A){for(var C=-1,W=Array(_);++C<_;)W[C]=A(C);return W}function i2(_,A){return _e(A,function(C){return[C,_[C]]})}function Ph(_){return _&&_.slice(0,Fh(_)+1).replace(_l,"")}function St(_){return function(A){return _(A)}}function Fl(_,A){return _e(A,function(C){return _[C]})}function Qi(_,A){return _.has(A)}function Dh(_,A){for(var C=-1,W=_.length;++C<W&&ri(A,_[C],0)>-1;);return C}function zh(_,A){for(var C=_.length;C--&&ri(A,_[C],0)>-1;);return C}function s2(_,A){for(var C=_.length,W=0;C--;)_[C]===A&&++W;return W}var o2=Dl(Uy),a2=Dl(Vy);function l2(_){return"\\"+Gy[_]}function u2(_,A){return _==null?t:_[A]}function ii(_){return Fy.test(_)}function c2(_){return Hy.test(_)}function f2(_){for(var A,C=[];!(A=_.next()).done;)C.push(A.value);return C}function Hl(_){var A=-1,C=Array(_.size);return _.forEach(function(W,Q){C[++A]=[Q,W]}),C}function Bh(_,A){return function(C){return _(A(C))}}function Xn(_,A){for(var C=-1,W=_.length,Q=0,ge=[];++C<W;){var Le=_[C];(Le===A||Le===m)&&(_[C]=m,ge[Q++]=C)}return ge}function to(_){var A=-1,C=Array(_.size);return _.forEach(function(W){C[++A]=W}),C}function h2(_){var A=-1,C=Array(_.size);return _.forEach(function(W){C[++A]=[W,W]}),C}function d2(_,A,C){for(var W=C-1,Q=_.length;++W<Q;)if(_[W]===A)return W;return-1}function p2(_,A,C){for(var W=C+1;W--;)if(_[W]===A)return W;return W}function si(_){return ii(_)?g2(_):Qy(_)}function Zt(_){return ii(_)?y2(_):e2(_)}function Fh(_){for(var A=_.length;A--&&sy.test(_.charAt(A)););return A}var m2=Dl(Ky);function g2(_){for(var A=Al.lastIndex=0;Al.test(_);)++A;return A}function y2(_){return _.match(Al)||[]}function b2(_){return _.match(By)||[]}var v2=function _(A){A=A==null?Je:oi.defaults(Je.Object(),A,oi.pick(Je,$y));var C=A.Array,W=A.Date,Q=A.Error,ge=A.Function,Le=A.Math,we=A.Object,$l=A.RegExp,w2=A.String,Rt=A.TypeError,no=C.prototype,S2=ge.prototype,ai=we.prototype,ro=A["__core-js_shared__"],io=S2.toString,ve=ai.hasOwnProperty,x2=0,Hh=function(){var s=/[^.]+$/.exec(ro&&ro.keys&&ro.keys.IE_PROTO||"");return s?"Symbol(src)_1."+s:""}(),so=ai.toString,k2=io.call(we),_2=Je._,E2=$l("^"+io.call(ve).replace(kl,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),oo=kh?A.Buffer:t,Zn=A.Symbol,ao=A.Uint8Array,$h=oo?oo.allocUnsafe:t,lo=Bh(we.getPrototypeOf,we),Wh=we.create,Uh=ai.propertyIsEnumerable,uo=no.splice,Vh=Zn?Zn.isConcatSpreadable:t,es=Zn?Zn.iterator:t,Er=Zn?Zn.toStringTag:t,co=function(){try{var s=Ir(we,"defineProperty");return s({},"",{}),s}catch{}}(),M2=A.clearTimeout!==Je.clearTimeout&&A.clearTimeout,T2=W&&W.now!==Je.Date.now&&W.now,C2=A.setTimeout!==Je.setTimeout&&A.setTimeout,fo=Le.ceil,ho=Le.floor,Wl=we.getOwnPropertySymbols,A2=oo?oo.isBuffer:t,Kh=A.isFinite,I2=no.join,O2=Bh(we.keys,we),Pe=Le.max,tt=Le.min,N2=W.now,R2=A.parseInt,Gh=Le.random,L2=no.reverse,Ul=Ir(A,"DataView"),ts=Ir(A,"Map"),Vl=Ir(A,"Promise"),li=Ir(A,"Set"),ns=Ir(A,"WeakMap"),rs=Ir(we,"create"),po=ns&&new ns,ui={},P2=Or(Ul),D2=Or(ts),z2=Or(Vl),B2=Or(li),F2=Or(ns),mo=Zn?Zn.prototype:t,is=mo?mo.valueOf:t,qh=mo?mo.toString:t;function b(s){if(Ce(s)&&!ee(s)&&!(s instanceof ue)){if(s instanceof Lt)return s;if(ve.call(s,"__wrapped__"))return Jd(s)}return new Lt(s)}var ci=function(){function s(){}return function(a){if(!Me(a))return{};if(Wh)return Wh(a);s.prototype=a;var c=new s;return s.prototype=t,c}}();function go(){}function Lt(s,a){this.__wrapped__=s,this.__actions__=[],this.__chain__=!!a,this.__index__=0,this.__values__=t}b.templateSettings={escape:Q1,evaluate:ey,interpolate:nh,variable:"",imports:{_:b}},b.prototype=go.prototype,b.prototype.constructor=b,Lt.prototype=ci(go.prototype),Lt.prototype.constructor=Lt;function ue(s){this.__wrapped__=s,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=$e,this.__views__=[]}function H2(){var s=new ue(this.__wrapped__);return s.__actions__=ht(this.__actions__),s.__dir__=this.__dir__,s.__filtered__=this.__filtered__,s.__iteratees__=ht(this.__iteratees__),s.__takeCount__=this.__takeCount__,s.__views__=ht(this.__views__),s}function $2(){if(this.__filtered__){var s=new ue(this);s.__dir__=-1,s.__filtered__=!0}else s=this.clone(),s.__dir__*=-1;return s}function W2(){var s=this.__wrapped__.value(),a=this.__dir__,c=ee(s),d=a<0,g=c?s.length:0,v=ev(0,g,this.__views__),x=v.start,k=v.end,E=k-x,O=d?k:x-1,N=this.__iteratees__,R=N.length,H=0,K=tt(E,this.__takeCount__);if(!c||!d&&g==E&&K==E)return yd(s,this.__actions__);var j=[];e:for(;E--&&H<K;){O+=a;for(var re=-1,Y=s[O];++re<R;){var ae=N[re],fe=ae.iteratee,_t=ae.type,at=fe(Y);if(_t==Sn)Y=at;else if(!at){if(_t==Jt)continue e;break e}}j[H++]=Y}return j}ue.prototype=ci(go.prototype),ue.prototype.constructor=ue;function Mr(s){var a=-1,c=s==null?0:s.length;for(this.clear();++a<c;){var d=s[a];this.set(d[0],d[1])}}function U2(){this.__data__=rs?rs(null):{},this.size=0}function V2(s){var a=this.has(s)&&delete this.__data__[s];return this.size-=a?1:0,a}function K2(s){var a=this.__data__;if(rs){var c=a[s];return c===f?t:c}return ve.call(a,s)?a[s]:t}function G2(s){var a=this.__data__;return rs?a[s]!==t:ve.call(a,s)}function q2(s,a){var c=this.__data__;return this.size+=this.has(s)?0:1,c[s]=rs&&a===t?f:a,this}Mr.prototype.clear=U2,Mr.prototype.delete=V2,Mr.prototype.get=K2,Mr.prototype.has=G2,Mr.prototype.set=q2;function kn(s){var a=-1,c=s==null?0:s.length;for(this.clear();++a<c;){var d=s[a];this.set(d[0],d[1])}}function J2(){this.__data__=[],this.size=0}function j2(s){var a=this.__data__,c=yo(a,s);if(c<0)return!1;var d=a.length-1;return c==d?a.pop():uo.call(a,c,1),--this.size,!0}function Y2(s){var a=this.__data__,c=yo(a,s);return c<0?t:a[c][1]}function X2(s){return yo(this.__data__,s)>-1}function Z2(s,a){var c=this.__data__,d=yo(c,s);return d<0?(++this.size,c.push([s,a])):c[d][1]=a,this}kn.prototype.clear=J2,kn.prototype.delete=j2,kn.prototype.get=Y2,kn.prototype.has=X2,kn.prototype.set=Z2;function _n(s){var a=-1,c=s==null?0:s.length;for(this.clear();++a<c;){var d=s[a];this.set(d[0],d[1])}}function Q2(){this.size=0,this.__data__={hash:new Mr,map:new(ts||kn),string:new Mr}}function eb(s){var a=Ao(this,s).delete(s);return this.size-=a?1:0,a}function tb(s){return Ao(this,s).get(s)}function nb(s){return Ao(this,s).has(s)}function rb(s,a){var c=Ao(this,s),d=c.size;return c.set(s,a),this.size+=c.size==d?0:1,this}_n.prototype.clear=Q2,_n.prototype.delete=eb,_n.prototype.get=tb,_n.prototype.has=nb,_n.prototype.set=rb;function Tr(s){var a=-1,c=s==null?0:s.length;for(this.__data__=new _n;++a<c;)this.add(s[a])}function ib(s){return this.__data__.set(s,f),this}function sb(s){return this.__data__.has(s)}Tr.prototype.add=Tr.prototype.push=ib,Tr.prototype.has=sb;function Qt(s){var a=this.__data__=new kn(s);this.size=a.size}function ob(){this.__data__=new kn,this.size=0}function ab(s){var a=this.__data__,c=a.delete(s);return this.size=a.size,c}function lb(s){return this.__data__.get(s)}function ub(s){return this.__data__.has(s)}function cb(s,a){var c=this.__data__;if(c instanceof kn){var d=c.__data__;if(!ts||d.length<i-1)return d.push([s,a]),this.size=++c.size,this;c=this.__data__=new _n(d)}return c.set(s,a),this.size=c.size,this}Qt.prototype.clear=ob,Qt.prototype.delete=ab,Qt.prototype.get=lb,Qt.prototype.has=ub,Qt.prototype.set=cb;function Jh(s,a){var c=ee(s),d=!c&&Nr(s),g=!c&&!d&&rr(s),v=!c&&!d&&!g&&pi(s),x=c||d||g||v,k=x?Bl(s.length,w2):[],E=k.length;for(var O in s)(a||ve.call(s,O))&&!(x&&(O=="length"||g&&(O=="offset"||O=="parent")||v&&(O=="buffer"||O=="byteLength"||O=="byteOffset")||Cn(O,E)))&&k.push(O);return k}function jh(s){var a=s.length;return a?s[tu(0,a-1)]:t}function fb(s,a){return Io(ht(s),Cr(a,0,s.length))}function hb(s){return Io(ht(s))}function Kl(s,a,c){(c!==t&&!en(s[a],c)||c===t&&!(a in s))&&En(s,a,c)}function ss(s,a,c){var d=s[a];(!(ve.call(s,a)&&en(d,c))||c===t&&!(a in s))&&En(s,a,c)}function yo(s,a){for(var c=s.length;c--;)if(en(s[c][0],a))return c;return-1}function db(s,a,c,d){return Qn(s,function(g,v,x){a(d,g,c(g),x)}),d}function Yh(s,a){return s&&fn(a,We(a),s)}function pb(s,a){return s&&fn(a,pt(a),s)}function En(s,a,c){a=="__proto__"&&co?co(s,a,{configurable:!0,enumerable:!0,value:c,writable:!0}):s[a]=c}function Gl(s,a){for(var c=-1,d=a.length,g=C(d),v=s==null;++c<d;)g[c]=v?t:Mu(s,a[c]);return g}function Cr(s,a,c){return s===s&&(c!==t&&(s=s<=c?s:c),a!==t&&(s=s>=a?s:a)),s}function Pt(s,a,c,d,g,v){var x,k=a&p,E=a&y,O=a&w;if(c&&(x=g?c(s,d,g,v):c(s)),x!==t)return x;if(!Me(s))return s;var N=ee(s);if(N){if(x=nv(s),!k)return ht(s,x)}else{var R=nt(s),H=R==Js||R==Zf;if(rr(s))return wd(s,k);if(R==xn||R==jt||H&&!g){if(x=E||H?{}:Fd(s),!k)return E?Kb(s,pb(x,s)):Vb(s,Yh(x,s))}else{if(!Se[R])return g?s:{};x=rv(s,R,k)}}v||(v=new Qt);var K=v.get(s);if(K)return K;v.set(s,x),pp(s)?s.forEach(function(Y){x.add(Pt(Y,a,c,Y,s,v))}):hp(s)&&s.forEach(function(Y,ae){x.set(ae,Pt(Y,a,c,ae,s,v))});var j=O?E?hu:fu:E?pt:We,re=N?t:j(s);return Nt(re||s,function(Y,ae){re&&(ae=Y,Y=s[ae]),ss(x,ae,Pt(Y,a,c,ae,s,v))}),x}function mb(s){var a=We(s);return function(c){return Xh(c,s,a)}}function Xh(s,a,c){var d=c.length;if(s==null)return!d;for(s=we(s);d--;){var g=c[d],v=a[g],x=s[g];if(x===t&&!(g in s)||!v(x))return!1}return!0}function Zh(s,a,c){if(typeof s!="function")throw new Rt(l);return ds(function(){s.apply(t,c)},a)}function as(s,a,c,d){var g=-1,v=Qs,x=!0,k=s.length,E=[],O=a.length;if(!k)return E;c&&(a=_e(a,St(c))),d?(v=Nl,x=!1):a.length>=i&&(v=Qi,x=!1,a=new Tr(a));e:for(;++g<k;){var N=s[g],R=c==null?N:c(N);if(N=d||N!==0?N:0,x&&R===R){for(var H=O;H--;)if(a[H]===R)continue e;E.push(N)}else v(a,R,d)||E.push(N)}return E}var Qn=Ed(cn),Qh=Ed(Jl,!0);function gb(s,a){var c=!0;return Qn(s,function(d,g,v){return c=!!a(d,g,v),c}),c}function bo(s,a,c){for(var d=-1,g=s.length;++d<g;){var v=s[d],x=a(v);if(x!=null&&(k===t?x===x&&!kt(x):c(x,k)))var k=x,E=v}return E}function yb(s,a,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:gp(d);c<d;)s[c++]=a;return s}function ed(s,a){var c=[];return Qn(s,function(d,g,v){a(d,g,v)&&c.push(d)}),c}function je(s,a,c,d,g){var v=-1,x=s.length;for(c||(c=sv),g||(g=[]);++v<x;){var k=s[v];a>0&&c(k)?a>1?je(k,a-1,c,d,g):Yn(g,k):d||(g[g.length]=k)}return g}var ql=Md(),td=Md(!0);function cn(s,a){return s&&ql(s,a,We)}function Jl(s,a){return s&&td(s,a,We)}function vo(s,a){return jn(a,function(c){return An(s[c])})}function Ar(s,a){a=tr(a,s);for(var c=0,d=a.length;s!=null&&c<d;)s=s[hn(a[c++])];return c&&c==d?s:t}function nd(s,a,c){var d=a(s);return ee(s)?d:Yn(d,c(s))}function st(s){return s==null?s===t?G1:V1:Er&&Er in we(s)?Qb(s):hv(s)}function jl(s,a){return s>a}function bb(s,a){return s!=null&&ve.call(s,a)}function vb(s,a){return s!=null&&a in we(s)}function wb(s,a,c){return s>=tt(a,c)&&s<Pe(a,c)}function Yl(s,a,c){for(var d=c?Nl:Qs,g=s[0].length,v=s.length,x=v,k=C(v),E=1/0,O=[];x--;){var N=s[x];x&&a&&(N=_e(N,St(a))),E=tt(N.length,E),k[x]=!c&&(a||g>=120&&N.length>=120)?new Tr(x&&N):t}N=s[0];var R=-1,H=k[0];e:for(;++R<g&&O.length<E;){var K=N[R],j=a?a(K):K;if(K=c||K!==0?K:0,!(H?Qi(H,j):d(O,j,c))){for(x=v;--x;){var re=k[x];if(!(re?Qi(re,j):d(s[x],j,c)))continue e}H&&H.push(j),O.push(K)}}return O}function Sb(s,a,c,d){return cn(s,function(g,v,x){a(d,c(g),v,x)}),d}function ls(s,a,c){a=tr(a,s),s=Ud(s,a);var d=s==null?s:s[hn(zt(a))];return d==null?t:wt(d,s,c)}function rd(s){return Ce(s)&&st(s)==jt}function xb(s){return Ce(s)&&st(s)==Zi}function kb(s){return Ce(s)&&st(s)==qi}function us(s,a,c,d,g){return s===a?!0:s==null||a==null||!Ce(s)&&!Ce(a)?s!==s&&a!==a:_b(s,a,c,d,us,g)}function _b(s,a,c,d,g,v){var x=ee(s),k=ee(a),E=x?Gs:nt(s),O=k?Gs:nt(a);E=E==jt?xn:E,O=O==jt?xn:O;var N=E==xn,R=O==xn,H=E==O;if(H&&rr(s)){if(!rr(a))return!1;x=!0,N=!1}if(H&&!N)return v||(v=new Qt),x||pi(s)?Dd(s,a,c,d,g,v):Xb(s,a,E,c,d,g,v);if(!(c&S)){var K=N&&ve.call(s,"__wrapped__"),j=R&&ve.call(a,"__wrapped__");if(K||j){var re=K?s.value():s,Y=j?a.value():a;return v||(v=new Qt),g(re,Y,c,d,v)}}return H?(v||(v=new Qt),Zb(s,a,c,d,g,v)):!1}function Eb(s){return Ce(s)&&nt(s)==Yt}function Xl(s,a,c,d){var g=c.length,v=g,x=!d;if(s==null)return!v;for(s=we(s);g--;){var k=c[g];if(x&&k[2]?k[1]!==s[k[0]]:!(k[0]in s))return!1}for(;++g<v;){k=c[g];var E=k[0],O=s[E],N=k[1];if(x&&k[2]){if(O===t&&!(E in s))return!1}else{var R=new Qt;if(d)var H=d(O,N,E,s,a,R);if(!(H===t?us(N,O,S|M,d,R):H))return!1}}return!0}function id(s){if(!Me(s)||av(s))return!1;var a=An(s)?E2:my;return a.test(Or(s))}function Mb(s){return Ce(s)&&st(s)==ji}function Tb(s){return Ce(s)&&nt(s)==Xt}function Cb(s){return Ce(s)&&Do(s.length)&&!!xe[st(s)]}function sd(s){return typeof s=="function"?s:s==null?mt:typeof s=="object"?ee(s)?ld(s[0],s[1]):ad(s):Tp(s)}function Zl(s){if(!hs(s))return O2(s);var a=[];for(var c in we(s))ve.call(s,c)&&c!="constructor"&&a.push(c);return a}function Ab(s){if(!Me(s))return fv(s);var a=hs(s),c=[];for(var d in s)d=="constructor"&&(a||!ve.call(s,d))||c.push(d);return c}function Ql(s,a){return s<a}function od(s,a){var c=-1,d=dt(s)?C(s.length):[];return Qn(s,function(g,v,x){d[++c]=a(g,v,x)}),d}function ad(s){var a=pu(s);return a.length==1&&a[0][2]?$d(a[0][0],a[0][1]):function(c){return c===s||Xl(c,s,a)}}function ld(s,a){return gu(s)&&Hd(a)?$d(hn(s),a):function(c){var d=Mu(c,s);return d===t&&d===a?Tu(c,s):us(a,d,S|M)}}function wo(s,a,c,d,g){s!==a&&ql(a,function(v,x){if(g||(g=new Qt),Me(v))Ib(s,a,x,c,wo,d,g);else{var k=d?d(bu(s,x),v,x+"",s,a,g):t;k===t&&(k=v),Kl(s,x,k)}},pt)}function Ib(s,a,c,d,g,v,x){var k=bu(s,c),E=bu(a,c),O=x.get(E);if(O){Kl(s,c,O);return}var N=v?v(k,E,c+"",s,a,x):t,R=N===t;if(R){var H=ee(E),K=!H&&rr(E),j=!H&&!K&&pi(E);N=E,H||K||j?ee(k)?N=k:Ae(k)?N=ht(k):K?(R=!1,N=wd(E,!0)):j?(R=!1,N=Sd(E,!0)):N=[]:ps(E)||Nr(E)?(N=k,Nr(k)?N=yp(k):(!Me(k)||An(k))&&(N=Fd(E))):R=!1}R&&(x.set(E,N),g(N,E,d,v,x),x.delete(E)),Kl(s,c,N)}function ud(s,a){var c=s.length;if(c)return a+=a<0?c:0,Cn(a,c)?s[a]:t}function cd(s,a,c){a.length?a=_e(a,function(v){return ee(v)?function(x){return Ar(x,v.length===1?v[0]:v)}:v}):a=[mt];var d=-1;a=_e(a,St(J()));var g=od(s,function(v,x,k){var E=_e(a,function(O){return O(v)});return{criteria:E,index:++d,value:v}});return r2(g,function(v,x){return Ub(v,x,c)})}function Ob(s,a){return fd(s,a,function(c,d){return Tu(s,d)})}function fd(s,a,c){for(var d=-1,g=a.length,v={};++d<g;){var x=a[d],k=Ar(s,x);c(k,x)&&cs(v,tr(x,s),k)}return v}function Nb(s){return function(a){return Ar(a,s)}}function eu(s,a,c,d){var g=d?n2:ri,v=-1,x=a.length,k=s;for(s===a&&(a=ht(a)),c&&(k=_e(s,St(c)));++v<x;)for(var E=0,O=a[v],N=c?c(O):O;(E=g(k,N,E,d))>-1;)k!==s&&uo.call(k,E,1),uo.call(s,E,1);return s}function hd(s,a){for(var c=s?a.length:0,d=c-1;c--;){var g=a[c];if(c==d||g!==v){var v=g;Cn(g)?uo.call(s,g,1):iu(s,g)}}return s}function tu(s,a){return s+ho(Gh()*(a-s+1))}function Rb(s,a,c,d){for(var g=-1,v=Pe(fo((a-s)/(c||1)),0),x=C(v);v--;)x[d?v:++g]=s,s+=c;return x}function nu(s,a){var c="";if(!s||a<1||a>He)return c;do a%2&&(c+=s),a=ho(a/2),a&&(s+=s);while(a);return c}function se(s,a){return vu(Wd(s,a,mt),s+"")}function Lb(s){return jh(mi(s))}function Pb(s,a){var c=mi(s);return Io(c,Cr(a,0,c.length))}function cs(s,a,c,d){if(!Me(s))return s;a=tr(a,s);for(var g=-1,v=a.length,x=v-1,k=s;k!=null&&++g<v;){var E=hn(a[g]),O=c;if(E==="__proto__"||E==="constructor"||E==="prototype")return s;if(g!=x){var N=k[E];O=d?d(N,E,k):t,O===t&&(O=Me(N)?N:Cn(a[g+1])?[]:{})}ss(k,E,O),k=k[E]}return s}var dd=po?function(s,a){return po.set(s,a),s}:mt,Db=co?function(s,a){return co(s,"toString",{configurable:!0,enumerable:!1,value:Au(a),writable:!0})}:mt;function zb(s){return Io(mi(s))}function Dt(s,a,c){var d=-1,g=s.length;a<0&&(a=-a>g?0:g+a),c=c>g?g:c,c<0&&(c+=g),g=a>c?0:c-a>>>0,a>>>=0;for(var v=C(g);++d<g;)v[d]=s[d+a];return v}function Bb(s,a){var c;return Qn(s,function(d,g,v){return c=a(d,g,v),!c}),!!c}function So(s,a,c){var d=0,g=s==null?d:s.length;if(typeof a=="number"&&a===a&&g<=Jn){for(;d<g;){var v=d+g>>>1,x=s[v];x!==null&&!kt(x)&&(c?x<=a:x<a)?d=v+1:g=v}return g}return ru(s,a,mt,c)}function ru(s,a,c,d){var g=0,v=s==null?0:s.length;if(v===0)return 0;a=c(a);for(var x=a!==a,k=a===null,E=kt(a),O=a===t;g<v;){var N=ho((g+v)/2),R=c(s[N]),H=R!==t,K=R===null,j=R===R,re=kt(R);if(x)var Y=d||j;else O?Y=j&&(d||H):k?Y=j&&H&&(d||!K):E?Y=j&&H&&!K&&(d||!re):K||re?Y=!1:Y=d?R<=a:R<a;Y?g=N+1:v=N}return tt(v,qn)}function pd(s,a){for(var c=-1,d=s.length,g=0,v=[];++c<d;){var x=s[c],k=a?a(x):x;if(!c||!en(k,E)){var E=k;v[g++]=x===0?0:x}}return v}function md(s){return typeof s=="number"?s:kt(s)?et:+s}function xt(s){if(typeof s=="string")return s;if(ee(s))return _e(s,xt)+"";if(kt(s))return qh?qh.call(s):"";var a=s+"";return a=="0"&&1/s==-Fe?"-0":a}function er(s,a,c){var d=-1,g=Qs,v=s.length,x=!0,k=[],E=k;if(c)x=!1,g=Nl;else if(v>=i){var O=a?null:jb(s);if(O)return to(O);x=!1,g=Qi,E=new Tr}else E=a?[]:k;e:for(;++d<v;){var N=s[d],R=a?a(N):N;if(N=c||N!==0?N:0,x&&R===R){for(var H=E.length;H--;)if(E[H]===R)continue e;a&&E.push(R),k.push(N)}else g(E,R,c)||(E!==k&&E.push(R),k.push(N))}return k}function iu(s,a){return a=tr(a,s),s=Ud(s,a),s==null||delete s[hn(zt(a))]}function gd(s,a,c,d){return cs(s,a,c(Ar(s,a)),d)}function xo(s,a,c,d){for(var g=s.length,v=d?g:-1;(d?v--:++v<g)&&a(s[v],v,s););return c?Dt(s,d?0:v,d?v+1:g):Dt(s,d?v+1:0,d?g:v)}function yd(s,a){var c=s;return c instanceof ue&&(c=c.value()),Rl(a,function(d,g){return g.func.apply(g.thisArg,Yn([d],g.args))},c)}function su(s,a,c){var d=s.length;if(d<2)return d?er(s[0]):[];for(var g=-1,v=C(d);++g<d;)for(var x=s[g],k=-1;++k<d;)k!=g&&(v[g]=as(v[g]||x,s[k],a,c));return er(je(v,1),a,c)}function bd(s,a,c){for(var d=-1,g=s.length,v=a.length,x={};++d<g;){var k=d<v?a[d]:t;c(x,s[d],k)}return x}function ou(s){return Ae(s)?s:[]}function au(s){return typeof s=="function"?s:mt}function tr(s,a){return ee(s)?s:gu(s,a)?[s]:qd(ye(s))}var Fb=se;function nr(s,a,c){var d=s.length;return c=c===t?d:c,!a&&c>=d?s:Dt(s,a,c)}var vd=M2||function(s){return Je.clearTimeout(s)};function wd(s,a){if(a)return s.slice();var c=s.length,d=$h?$h(c):new s.constructor(c);return s.copy(d),d}function lu(s){var a=new s.constructor(s.byteLength);return new ao(a).set(new ao(s)),a}function Hb(s,a){var c=a?lu(s.buffer):s.buffer;return new s.constructor(c,s.byteOffset,s.byteLength)}function $b(s){var a=new s.constructor(s.source,rh.exec(s));return a.lastIndex=s.lastIndex,a}function Wb(s){return is?we(is.call(s)):{}}function Sd(s,a){var c=a?lu(s.buffer):s.buffer;return new s.constructor(c,s.byteOffset,s.length)}function xd(s,a){if(s!==a){var c=s!==t,d=s===null,g=s===s,v=kt(s),x=a!==t,k=a===null,E=a===a,O=kt(a);if(!k&&!O&&!v&&s>a||v&&x&&E&&!k&&!O||d&&x&&E||!c&&E||!g)return 1;if(!d&&!v&&!O&&s<a||O&&c&&g&&!d&&!v||k&&c&&g||!x&&g||!E)return-1}return 0}function Ub(s,a,c){for(var d=-1,g=s.criteria,v=a.criteria,x=g.length,k=c.length;++d<x;){var E=xd(g[d],v[d]);if(E){if(d>=k)return E;var O=c[d];return E*(O=="desc"?-1:1)}}return s.index-a.index}function kd(s,a,c,d){for(var g=-1,v=s.length,x=c.length,k=-1,E=a.length,O=Pe(v-x,0),N=C(E+O),R=!d;++k<E;)N[k]=a[k];for(;++g<x;)(R||g<v)&&(N[c[g]]=s[g]);for(;O--;)N[k++]=s[g++];return N}function _d(s,a,c,d){for(var g=-1,v=s.length,x=-1,k=c.length,E=-1,O=a.length,N=Pe(v-k,0),R=C(N+O),H=!d;++g<N;)R[g]=s[g];for(var K=g;++E<O;)R[K+E]=a[E];for(;++x<k;)(H||g<v)&&(R[K+c[x]]=s[g++]);return R}function ht(s,a){var c=-1,d=s.length;for(a||(a=C(d));++c<d;)a[c]=s[c];return a}function fn(s,a,c,d){var g=!c;c||(c={});for(var v=-1,x=a.length;++v<x;){var k=a[v],E=d?d(c[k],s[k],k,c,s):t;E===t&&(E=s[k]),g?En(c,k,E):ss(c,k,E)}return c}function Vb(s,a){return fn(s,mu(s),a)}function Kb(s,a){return fn(s,zd(s),a)}function ko(s,a){return function(c,d){var g=ee(c)?Yy:db,v=a?a():{};return g(c,s,J(d,2),v)}}function fi(s){return se(function(a,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&&ot(c[0],c[1],x)&&(v=g<3?t:v,g=1),a=we(a);++d<g;){var k=c[d];k&&s(a,k,d,v)}return a})}function Ed(s,a){return function(c,d){if(c==null)return c;if(!dt(c))return s(c,d);for(var g=c.length,v=a?g:-1,x=we(c);(a?v--:++v<g)&&d(x[v],v,x)!==!1;);return c}}function Md(s){return function(a,c,d){for(var g=-1,v=we(a),x=d(a),k=x.length;k--;){var E=x[s?k:++g];if(c(v[E],E,v)===!1)break}return a}}function Gb(s,a,c){var d=a&T,g=fs(s);function v(){var x=this&&this!==Je&&this instanceof v?g:s;return x.apply(d?c:this,arguments)}return v}function Td(s){return function(a){a=ye(a);var c=ii(a)?Zt(a):t,d=c?c[0]:a.charAt(0),g=c?nr(c,1).join(""):a.slice(1);return d[s]()+g}}function hi(s){return function(a){return Rl(Ep(_p(a).replace(Dy,"")),s,"")}}function fs(s){return function(){var a=arguments;switch(a.length){case 0:return new s;case 1:return new s(a[0]);case 2:return new s(a[0],a[1]);case 3:return new s(a[0],a[1],a[2]);case 4:return new s(a[0],a[1],a[2],a[3]);case 5:return new s(a[0],a[1],a[2],a[3],a[4]);case 6:return new s(a[0],a[1],a[2],a[3],a[4],a[5]);case 7:return new s(a[0],a[1],a[2],a[3],a[4],a[5],a[6])}var c=ci(s.prototype),d=s.apply(c,a);return Me(d)?d:c}}function qb(s,a,c){var d=fs(s);function g(){for(var v=arguments.length,x=C(v),k=v,E=di(g);k--;)x[k]=arguments[k];var O=v<3&&x[0]!==E&&x[v-1]!==E?[]:Xn(x,E);if(v-=O.length,v<c)return Nd(s,a,_o,g.placeholder,t,x,O,t,t,c-v);var N=this&&this!==Je&&this instanceof g?d:s;return wt(N,this,x)}return g}function Cd(s){return function(a,c,d){var g=we(a);if(!dt(a)){var v=J(c,3);a=We(a),c=function(k){return v(g[k],k,g)}}var x=s(a,c,d);return x>-1?g[v?a[x]:x]:t}}function Ad(s){return Tn(function(a){var c=a.length,d=c,g=Lt.prototype.thru;for(s&&a.reverse();d--;){var v=a[d];if(typeof v!="function")throw new Rt(l);if(g&&!x&&Co(v)=="wrapper")var x=new Lt([],!0)}for(d=x?d:c;++d<c;){v=a[d];var k=Co(v),E=k=="wrapper"?du(v):t;E&&yu(E[0])&&E[1]==(ie|B|X|Ee)&&!E[4].length&&E[9]==1?x=x[Co(E[0])].apply(x,E[3]):x=v.length==1&&yu(v)?x[k]():x.thru(v)}return function(){var O=arguments,N=O[0];if(x&&O.length==1&&ee(N))return x.plant(N).value();for(var R=0,H=c?a[R].apply(this,O):N;++R<c;)H=a[R].call(this,H);return H}})}function _o(s,a,c,d,g,v,x,k,E,O){var N=a&ie,R=a&T,H=a&I,K=a&(B|$),j=a&Gt,re=H?t:fs(s);function Y(){for(var ae=arguments.length,fe=C(ae),_t=ae;_t--;)fe[_t]=arguments[_t];if(K)var at=di(Y),Et=s2(fe,at);if(d&&(fe=kd(fe,d,g,K)),v&&(fe=_d(fe,v,x,K)),ae-=Et,K&&ae<O){var Ie=Xn(fe,at);return Nd(s,a,_o,Y.placeholder,c,fe,Ie,k,E,O-ae)}var tn=R?c:this,On=H?tn[s]:s;return ae=fe.length,k?fe=dv(fe,k):j&&ae>1&&fe.reverse(),N&&E<ae&&(fe.length=E),this&&this!==Je&&this instanceof Y&&(On=re||fs(On)),On.apply(tn,fe)}return Y}function Id(s,a){return function(c,d){return Sb(c,s,a(d),{})}}function Eo(s,a){return function(c,d){var g;if(c===t&&d===t)return a;if(c!==t&&(g=c),d!==t){if(g===t)return d;typeof c=="string"||typeof d=="string"?(c=xt(c),d=xt(d)):(c=md(c),d=md(d)),g=s(c,d)}return g}}function uu(s){return Tn(function(a){return a=_e(a,St(J())),se(function(c){var d=this;return s(a,function(g){return wt(g,d,c)})})})}function Mo(s,a){a=a===t?" ":xt(a);var c=a.length;if(c<2)return c?nu(a,s):a;var d=nu(a,fo(s/si(a)));return ii(a)?nr(Zt(d),0,s).join(""):d.slice(0,s)}function Jb(s,a,c,d){var g=a&T,v=fs(s);function x(){for(var k=-1,E=arguments.length,O=-1,N=d.length,R=C(N+E),H=this&&this!==Je&&this instanceof x?v:s;++O<N;)R[O]=d[O];for(;E--;)R[O++]=arguments[++k];return wt(H,g?c:this,R)}return x}function Od(s){return function(a,c,d){return d&&typeof d!="number"&&ot(a,c,d)&&(c=d=t),a=In(a),c===t?(c=a,a=0):c=In(c),d=d===t?a<c?1:-1:In(d),Rb(a,c,d,s)}}function To(s){return function(a,c){return typeof a=="string"&&typeof c=="string"||(a=Bt(a),c=Bt(c)),s(a,c)}}function Nd(s,a,c,d,g,v,x,k,E,O){var N=a&B,R=N?x:t,H=N?t:x,K=N?v:t,j=N?t:v;a|=N?X:q,a&=~(N?q:X),a&F||(a&=~(T|I));var re=[s,a,g,K,R,j,H,k,E,O],Y=c.apply(t,re);return yu(s)&&Vd(Y,re),Y.placeholder=d,Kd(Y,s,a)}function cu(s){var a=Le[s];return function(c,d){if(c=Bt(c),d=d==null?0:tt(te(d),292),d&&Kh(c)){var g=(ye(c)+"e").split("e"),v=a(g[0]+"e"+(+g[1]+d));return g=(ye(v)+"e").split("e"),+(g[0]+"e"+(+g[1]-d))}return a(c)}}var jb=li&&1/to(new li([,-0]))[1]==Fe?function(s){return new li(s)}:Nu;function Rd(s){return function(a){var c=nt(a);return c==Yt?Hl(a):c==Xt?h2(a):i2(a,s(a))}}function Mn(s,a,c,d,g,v,x,k){var E=a&I;if(!E&&typeof s!="function")throw new Rt(l);var O=d?d.length:0;if(O||(a&=~(X|q),d=g=t),x=x===t?x:Pe(te(x),0),k=k===t?k:te(k),O-=g?g.length:0,a&q){var N=d,R=g;d=g=t}var H=E?t:du(s),K=[s,a,c,d,g,N,R,v,x,k];if(H&&cv(K,H),s=K[0],a=K[1],c=K[2],d=K[3],g=K[4],k=K[9]=K[9]===t?E?0:s.length:Pe(K[9]-O,0),!k&&a&(B|$)&&(a&=~(B|$)),!a||a==T)var j=Gb(s,a,c);else a==B||a==$?j=qb(s,a,k):(a==X||a==(T|X))&&!g.length?j=Jb(s,a,c,d):j=_o.apply(t,K);var re=H?dd:Vd;return Kd(re(j,K),s,a)}function Ld(s,a,c,d){return s===t||en(s,ai[c])&&!ve.call(d,c)?a:s}function Pd(s,a,c,d,g,v){return Me(s)&&Me(a)&&(v.set(a,s),wo(s,a,t,Pd,v),v.delete(a)),s}function Yb(s){return ps(s)?t:s}function Dd(s,a,c,d,g,v){var x=c&S,k=s.length,E=a.length;if(k!=E&&!(x&&E>k))return!1;var O=v.get(s),N=v.get(a);if(O&&N)return O==a&&N==s;var R=-1,H=!0,K=c&M?new Tr:t;for(v.set(s,a),v.set(a,s);++R<k;){var j=s[R],re=a[R];if(d)var Y=x?d(re,j,R,a,s,v):d(j,re,R,s,a,v);if(Y!==t){if(Y)continue;H=!1;break}if(K){if(!Ll(a,function(ae,fe){if(!Qi(K,fe)&&(j===ae||g(j,ae,c,d,v)))return K.push(fe)})){H=!1;break}}else if(!(j===re||g(j,re,c,d,v))){H=!1;break}}return v.delete(s),v.delete(a),H}function Xb(s,a,c,d,g,v,x){switch(c){case ti:if(s.byteLength!=a.byteLength||s.byteOffset!=a.byteOffset)return!1;s=s.buffer,a=a.buffer;case Zi:return!(s.byteLength!=a.byteLength||!v(new ao(s),new ao(a)));case Gi:case qi:case Ji:return en(+s,+a);case qs:return s.name==a.name&&s.message==a.message;case ji:case Yi:return s==a+"";case Yt:var k=Hl;case Xt:var E=d&S;if(k||(k=to),s.size!=a.size&&!E)return!1;var O=x.get(s);if(O)return O==a;d|=M,x.set(s,a);var N=Dd(k(s),k(a),d,g,v,x);return x.delete(s),N;case js:if(is)return is.call(s)==is.call(a)}return!1}function Zb(s,a,c,d,g,v){var x=c&S,k=fu(s),E=k.length,O=fu(a),N=O.length;if(E!=N&&!x)return!1;for(var R=E;R--;){var H=k[R];if(!(x?H in a:ve.call(a,H)))return!1}var K=v.get(s),j=v.get(a);if(K&&j)return K==a&&j==s;var re=!0;v.set(s,a),v.set(a,s);for(var Y=x;++R<E;){H=k[R];var ae=s[H],fe=a[H];if(d)var _t=x?d(fe,ae,H,a,s,v):d(ae,fe,H,s,a,v);if(!(_t===t?ae===fe||g(ae,fe,c,d,v):_t)){re=!1;break}Y||(Y=H=="constructor")}if(re&&!Y){var at=s.constructor,Et=a.constructor;at!=Et&&"constructor"in s&&"constructor"in a&&!(typeof at=="function"&&at instanceof at&&typeof Et=="function"&&Et instanceof Et)&&(re=!1)}return v.delete(s),v.delete(a),re}function Tn(s){return vu(Wd(s,t,Xd),s+"")}function fu(s){return nd(s,We,mu)}function hu(s){return nd(s,pt,zd)}var du=po?function(s){return po.get(s)}:Nu;function Co(s){for(var a=s.name+"",c=ui[a],d=ve.call(ui,a)?c.length:0;d--;){var g=c[d],v=g.func;if(v==null||v==s)return g.name}return a}function di(s){var a=ve.call(b,"placeholder")?b:s;return a.placeholder}function J(){var s=b.iteratee||Iu;return s=s===Iu?sd:s,arguments.length?s(arguments[0],arguments[1]):s}function Ao(s,a){var c=s.__data__;return ov(a)?c[typeof a=="string"?"string":"hash"]:c.map}function pu(s){for(var a=We(s),c=a.length;c--;){var d=a[c],g=s[d];a[c]=[d,g,Hd(g)]}return a}function Ir(s,a){var c=u2(s,a);return id(c)?c:t}function Qb(s){var a=ve.call(s,Er),c=s[Er];try{s[Er]=t;var d=!0}catch{}var g=so.call(s);return d&&(a?s[Er]=c:delete s[Er]),g}var mu=Wl?function(s){return s==null?[]:(s=we(s),jn(Wl(s),function(a){return Uh.call(s,a)}))}:Ru,zd=Wl?function(s){for(var a=[];s;)Yn(a,mu(s)),s=lo(s);return a}:Ru,nt=st;(Ul&&nt(new Ul(new ArrayBuffer(1)))!=ti||ts&&nt(new ts)!=Yt||Vl&&nt(Vl.resolve())!=Qf||li&&nt(new li)!=Xt||ns&&nt(new ns)!=Xi)&&(nt=function(s){var a=st(s),c=a==xn?s.constructor:t,d=c?Or(c):"";if(d)switch(d){case P2:return ti;case D2:return Yt;case z2:return Qf;case B2:return Xt;case F2:return Xi}return a});function ev(s,a,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":a-=x;break;case"take":a=tt(a,s+x);break;case"takeRight":s=Pe(s,a-x);break}}return{start:s,end:a}}function tv(s){var a=s.match(ay);return a?a[1].split(ly):[]}function Bd(s,a,c){a=tr(a,s);for(var d=-1,g=a.length,v=!1;++d<g;){var x=hn(a[d]);if(!(v=s!=null&&c(s,x)))break;s=s[x]}return v||++d!=g?v:(g=s==null?0:s.length,!!g&&Do(g)&&Cn(x,g)&&(ee(s)||Nr(s)))}function nv(s){var a=s.length,c=new s.constructor(a);return a&&typeof s[0]=="string"&&ve.call(s,"index")&&(c.index=s.index,c.input=s.input),c}function Fd(s){return typeof s.constructor=="function"&&!hs(s)?ci(lo(s)):{}}function rv(s,a,c){var d=s.constructor;switch(a){case Zi:return lu(s);case Gi:case qi:return new d(+s);case ti:return Hb(s,c);case pl:case ml:case gl:case yl:case bl:case vl:case wl:case Sl:case xl:return Sd(s,c);case Yt:return new d;case Ji:case Yi:return new d(s);case ji:return $b(s);case Xt:return new d;case js:return Wb(s)}}function iv(s,a){var c=a.length;if(!c)return s;var d=c-1;return a[d]=(c>1?"& ":"")+a[d],a=a.join(c>2?", ":" "),s.replace(oy,`{
|
|
20
20
|
/* [wrapped with `+a+`] */
|
|
21
|
-
`)}function iv(s){return ee(s)||Nr(s)||!!(Uh&&s&&s[Uh])}function Cn(s,a){var c=typeof s;return a=a??He,!!a&&(c=="number"||c!="symbol"&&gy.test(s))&&s>-1&&s%1==0&&s<a}function ot(s,a,c){if(!Me(c))return!1;var d=typeof a;return(d=="number"?dt(c)&&Cn(a,c.length):d=="string"&&a in c)?en(c[a],s):!1}function gu(s,a){if(ee(s))return!1;var c=typeof s;return c=="number"||c=="symbol"||c=="boolean"||s==null||kt(s)?!0:ty.test(s)||!ey.test(s)||a!=null&&s in Se(a)}function sv(s){var a=typeof s;return a=="string"||a=="number"||a=="symbol"||a=="boolean"?s!=="__proto__":s===null}function yu(s){var a=Co(s),c=b[a];if(typeof c!="function"||!(a in ue.prototype))return!1;if(s===c)return!0;var d=du(c);return!!d&&s===d[0]}function ov(s){return!!Fh&&Fh in s}var av=ro?An:Lu;function hs(s){var a=s&&s.constructor,c=typeof a=="function"&&a.prototype||ai;return s===c}function Fd(s){return s===s&&!Me(s)}function Hd(s,a){return function(c){return c==null?!1:c[s]===a&&(a!==t||s in Se(c))}}function lv(s){var a=Lo(s,function(d){return c.size===h&&c.clear(),d}),c=a.cache;return a}function uv(s,a){var c=s[1],d=a[1],g=c|d,v=g<(T|I|ie),x=d==ie&&c==B||d==ie&&c==Ee&&s[7].length<=a[8]||d==(ie|Ee)&&a[7].length<=a[8]&&c==B;if(!(v||x))return s;d&T&&(s[2]=a[2],g|=c&T?0:F);var k=a[3];if(k){var E=s[3];s[3]=E?xd(E,k,a[4]):k,s[4]=E?Yn(s[3],m):a[4]}return k=a[5],k&&(E=s[5],s[5]=E?kd(E,k,a[6]):k,s[6]=E?Yn(s[5],m):a[6]),k=a[7],k&&(s[7]=k),d&ie&&(s[8]=s[8]==null?a[8]:tt(s[8],a[8])),s[9]==null&&(s[9]=a[9]),s[0]=a[0],s[1]=g,s}function cv(s){var a=[];if(s!=null)for(var c in Se(s))a.push(c);return a}function fv(s){return so.call(s)}function $d(s,a,c){return a=Pe(a===t?s.length-1:a,0),function(){for(var d=arguments,g=-1,v=Pe(d.length-a,0),x=C(v);++g<v;)x[g]=d[a+g];g=-1;for(var k=C(a+1);++g<a;)k[g]=d[g];return k[a]=c(x),St(s,this,k)}}function Wd(s,a){return a.length<2?s:Ar(s,Dt(a,0,-1))}function hv(s,a){for(var c=s.length,d=tt(a.length,c),g=ht(s);d--;){var v=a[d];s[d]=Cn(v,c)?g[v]:t}return s}function bu(s,a){if(!(a==="constructor"&&typeof s[a]=="function")&&a!="__proto__")return s[a]}var Ud=Kd(hd),ds=T2||function(s,a){return Je.setTimeout(s,a)},vu=Kd(Pb);function Vd(s,a,c){var d=a+"";return vu(s,rv(d,dv(ev(d),c)))}function Kd(s){var a=0,c=0;return function(){var d=O2(),g=Kn-(d-c);if(c=d,g>0){if(++a>=un)return arguments[0]}else a=0;return s.apply(t,arguments)}}function Io(s,a){var c=-1,d=s.length,g=d-1;for(a=a===t?d:a;++c<a;){var v=tu(c,g),x=s[v];s[v]=s[c],s[c]=x}return s.length=a,s}var Gd=lv(function(s){var a=[];return s.charCodeAt(0)===46&&a.push(""),s.replace(ny,function(c,d,g,v){a.push(g?v.replace(cy,"$1"):d||c)}),a});function hn(s){if(typeof s=="string"||kt(s))return s;var a=s+"";return a=="0"&&1/s==-Fe?"-0":a}function Or(s){if(s!=null){try{return io.call(s)}catch{}try{return s+""}catch{}}return""}function dv(s,a){return Nt(dl,function(c){var d="_."+c[0];a&c[1]&&!Qs(s,d)&&s.push(d)}),s.sort()}function qd(s){if(s instanceof ue)return s.clone();var a=new Lt(s.__wrapped__,s.__chain__);return a.__actions__=ht(s.__actions__),a.__index__=s.__index__,a.__values__=s.__values__,a}function pv(s,a,c){(c?ot(s,a,c):a===t)?a=1:a=Pe(te(a),0);var d=s==null?0:s.length;if(!d||a<1)return[];for(var g=0,v=0,x=C(fo(d/a));g<d;)x[v++]=Dt(s,g,g+=a);return x}function mv(s){for(var a=-1,c=s==null?0:s.length,d=0,g=[];++a<c;){var v=s[a];v&&(g[d++]=v)}return g}function gv(){var s=arguments.length;if(!s)return[];for(var a=C(s-1),c=arguments[0],d=s;d--;)a[d-1]=arguments[d];return jn(ee(c)?ht(c):[c],je(a,1))}var yv=se(function(s,a){return Ae(s)?as(s,je(a,1,Ae,!0)):[]}),bv=se(function(s,a){var c=zt(a);return Ae(c)&&(c=t),Ae(s)?as(s,je(a,1,Ae,!0),J(c,2)):[]}),vv=se(function(s,a){var c=zt(a);return Ae(c)&&(c=t),Ae(s)?as(s,je(a,1,Ae,!0),t,c):[]});function Sv(s,a,c){var d=s==null?0:s.length;return d?(a=c||a===t?1:te(a),Dt(s,a<0?0:a,d)):[]}function wv(s,a,c){var d=s==null?0:s.length;return d?(a=c||a===t?1:te(a),a=d-a,Dt(s,0,a<0?0:a)):[]}function xv(s,a){return s&&s.length?xo(s,J(a,3),!0,!0):[]}function kv(s,a){return s&&s.length?xo(s,J(a,3),!0):[]}function _v(s,a,c,d){var g=s==null?0:s.length;return g?(c&&typeof c!="number"&&ot(s,a,c)&&(c=0,d=g),gb(s,a,c,d)):[]}function Jd(s,a,c){var d=s==null?0:s.length;if(!d)return-1;var g=c==null?0:te(c);return g<0&&(g=Pe(d+g,0)),eo(s,J(a,3),g)}function jd(s,a,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?Pe(d+g,0):tt(g,d-1)),eo(s,J(a,3),g,!0)}function Yd(s){var a=s==null?0:s.length;return a?je(s,1):[]}function Ev(s){var a=s==null?0:s.length;return a?je(s,Fe):[]}function Mv(s,a){var c=s==null?0:s.length;return c?(a=a===t?1:te(a),je(s,a)):[]}function Tv(s){for(var a=-1,c=s==null?0:s.length,d={};++a<c;){var g=s[a];d[g[0]]=g[1]}return d}function Xd(s){return s&&s.length?s[0]:t}function Cv(s,a,c){var d=s==null?0:s.length;if(!d)return-1;var g=c==null?0:te(c);return g<0&&(g=Pe(d+g,0)),ri(s,a,g)}function Av(s){var a=s==null?0:s.length;return a?Dt(s,0,-1):[]}var Iv=se(function(s){var a=_e(s,ou);return a.length&&a[0]===s[0]?Yl(a):[]}),Ov=se(function(s){var a=zt(s),c=_e(s,ou);return a===zt(c)?a=t:c.pop(),c.length&&c[0]===s[0]?Yl(c,J(a,2)):[]}),Nv=se(function(s){var a=zt(s),c=_e(s,ou);return a=typeof a=="function"?a:t,a&&c.pop(),c.length&&c[0]===s[0]?Yl(c,t,a):[]});function Rv(s,a){return s==null?"":A2.call(s,a)}function zt(s){var a=s==null?0:s.length;return a?s[a-1]:t}function Lv(s,a,c){var d=s==null?0:s.length;if(!d)return-1;var g=d;return c!==t&&(g=te(c),g=g<0?Pe(d+g,0):tt(g,d-1)),a===a?d2(s,a,g):eo(s,Oh,g,!0)}function Pv(s,a){return s&&s.length?ld(s,te(a)):t}var Dv=se(Zd);function Zd(s,a){return s&&s.length&&a&&a.length?eu(s,a):s}function zv(s,a,c){return s&&s.length&&a&&a.length?eu(s,a,J(c,2)):s}function Bv(s,a,c){return s&&s.length&&a&&a.length?eu(s,a,t,c):s}var Fv=Tn(function(s,a){var c=s==null?0:s.length,d=Gl(s,a);return fd(s,_e(a,function(g){return Cn(g,c)?+g:g}).sort(wd)),d});function Hv(s,a){var c=[];if(!(s&&s.length))return c;var d=-1,g=[],v=s.length;for(a=J(a,3);++d<v;){var x=s[d];a(x,d,s)&&(c.push(x),g.push(d))}return fd(s,g),c}function Su(s){return s==null?s:R2.call(s)}function $v(s,a,c){var d=s==null?0:s.length;return d?(c&&typeof c!="number"&&ot(s,a,c)?(a=0,c=d):(a=a==null?0:te(a),c=c===t?d:te(c)),Dt(s,a,c)):[]}function Wv(s,a){return wo(s,a)}function Uv(s,a,c){return ru(s,a,J(c,2))}function Vv(s,a){var c=s==null?0:s.length;if(c){var d=wo(s,a);if(d<c&&en(s[d],a))return d}return-1}function Kv(s,a){return wo(s,a,!0)}function Gv(s,a,c){return ru(s,a,J(c,2),!0)}function qv(s,a){var c=s==null?0:s.length;if(c){var d=wo(s,a,!0)-1;if(en(s[d],a))return d}return-1}function Jv(s){return s&&s.length?dd(s):[]}function jv(s,a){return s&&s.length?dd(s,J(a,2)):[]}function Yv(s){var a=s==null?0:s.length;return a?Dt(s,1,a):[]}function Xv(s,a,c){return s&&s.length?(a=c||a===t?1:te(a),Dt(s,0,a<0?0:a)):[]}function Zv(s,a,c){var d=s==null?0:s.length;return d?(a=c||a===t?1:te(a),a=d-a,Dt(s,a<0?0:a,d)):[]}function Qv(s,a){return s&&s.length?xo(s,J(a,3),!1,!0):[]}function e5(s,a){return s&&s.length?xo(s,J(a,3)):[]}var t5=se(function(s){return Qn(je(s,1,Ae,!0))}),n5=se(function(s){var a=zt(s);return Ae(a)&&(a=t),Qn(je(s,1,Ae,!0),J(a,2))}),r5=se(function(s){var a=zt(s);return a=typeof a=="function"?a:t,Qn(je(s,1,Ae,!0),t,a)});function i5(s){return s&&s.length?Qn(s):[]}function s5(s,a){return s&&s.length?Qn(s,J(a,2)):[]}function o5(s,a){return a=typeof a=="function"?a:t,s&&s.length?Qn(s,t,a):[]}function wu(s){if(!(s&&s.length))return[];var a=0;return s=Jn(s,function(c){if(Ae(c))return a=Pe(c.length,a),!0}),Bl(a,function(c){return _e(s,Pl(c))})}function Qd(s,a){if(!(s&&s.length))return[];var c=wu(s);return a==null?c:_e(c,function(d){return St(a,t,d)})}var a5=se(function(s,a){return Ae(s)?as(s,a):[]}),l5=se(function(s){return su(Jn(s,Ae))}),u5=se(function(s){var a=zt(s);return Ae(a)&&(a=t),su(Jn(s,Ae),J(a,2))}),c5=se(function(s){var a=zt(s);return a=typeof a=="function"?a:t,su(Jn(s,Ae),t,a)}),f5=se(wu);function h5(s,a){return yd(s||[],a||[],ss)}function d5(s,a){return yd(s||[],a||[],cs)}var p5=se(function(s){var a=s.length,c=a>1?s[a-1]:t;return c=typeof c=="function"?(s.pop(),c):t,Qd(s,c)});function ep(s){var a=b(s);return a.__chain__=!0,a}function m5(s,a){return a(s),s}function Oo(s,a){return a(s)}var g5=Tn(function(s){var a=s.length,c=a?s[0]:0,d=this.__wrapped__,g=function(v){return Gl(v,s)};return a>1||this.__actions__.length||!(d instanceof ue)||!Cn(c)?this.thru(g):(d=d.slice(c,+c+(a?1:0)),d.__actions__.push({func:Oo,args:[g],thisArg:t}),new Lt(d,this.__chain__).thru(function(v){return a&&!v.length&&v.push(t),v}))});function y5(){return ep(this)}function b5(){return new Lt(this.value(),this.__chain__)}function v5(){this.__values__===t&&(this.__values__=pp(this.value()));var s=this.__index__>=this.__values__.length,a=s?t:this.__values__[this.__index__++];return{done:s,value:a}}function S5(){return this}function w5(s){for(var a,c=this;c instanceof go;){var d=qd(c);d.__index__=0,d.__values__=t,a?g.__wrapped__=d:a=d;var g=d;c=c.__wrapped__}return g.__wrapped__=s,a}function x5(){var s=this.__wrapped__;if(s instanceof ue){var a=s;return this.__actions__.length&&(a=new ue(this)),a=a.reverse(),a.__actions__.push({func:Oo,args:[Su],thisArg:t}),new Lt(a,this.__chain__)}return this.thru(Su)}function k5(){return gd(this.__wrapped__,this.__actions__)}var _5=ko(function(s,a,c){ve.call(s,c)?++s[c]:En(s,c,1)});function E5(s,a,c){var d=ee(s)?Ah:mb;return c&&ot(s,a,c)&&(a=t),d(s,J(a,3))}function M5(s,a){var c=ee(s)?Jn:Qh;return c(s,J(a,3))}var T5=Td(Jd),C5=Td(jd);function A5(s,a){return je(No(s,a),1)}function I5(s,a){return je(No(s,a),Fe)}function O5(s,a,c){return c=c===t?1:te(c),je(No(s,a),c)}function tp(s,a){var c=ee(s)?Nt:Zn;return c(s,J(a,3))}function np(s,a){var c=ee(s)?Yy:Zh;return c(s,J(a,3))}var N5=ko(function(s,a,c){ve.call(s,c)?s[c].push(a):En(s,c,[a])});function R5(s,a,c,d){s=dt(s)?s:mi(s),c=c&&!d?te(c):0;var g=s.length;return c<0&&(c=Pe(g+c,0)),zo(s)?c<=g&&s.indexOf(a,c)>-1:!!g&&ri(s,a,c)>-1}var L5=se(function(s,a,c){var d=-1,g=typeof a=="function",v=dt(s)?C(s.length):[];return Zn(s,function(x){v[++d]=g?St(a,x,c):ls(x,a,c)}),v}),P5=ko(function(s,a,c){En(s,c,a)});function No(s,a){var c=ee(s)?_e:sd;return c(s,J(a,3))}function D5(s,a,c,d){return s==null?[]:(ee(a)||(a=a==null?[]:[a]),c=d?t:c,ee(c)||(c=c==null?[]:[c]),ud(s,a,c))}var z5=ko(function(s,a,c){s[c?0:1].push(a)},function(){return[[],[]]});function B5(s,a,c){var d=ee(s)?Rl:Rh,g=arguments.length<3;return d(s,J(a,4),c,g,Zn)}function F5(s,a,c){var d=ee(s)?Xy:Rh,g=arguments.length<3;return d(s,J(a,4),c,g,Zh)}function H5(s,a){var c=ee(s)?Jn:Qh;return c(s,Po(J(a,3)))}function $5(s){var a=ee(s)?Jh:Rb;return a(s)}function W5(s,a,c){(c?ot(s,a,c):a===t)?a=1:a=te(a);var d=ee(s)?cb:Lb;return d(s,a)}function U5(s){var a=ee(s)?fb:Db;return a(s)}function V5(s){if(s==null)return 0;if(dt(s))return zo(s)?si(s):s.length;var a=nt(s);return a==Yt||a==Xt?s.size:Zl(s).length}function K5(s,a,c){var d=ee(s)?Ll:zb;return c&&ot(s,a,c)&&(a=t),d(s,J(a,3))}var G5=se(function(s,a){if(s==null)return[];var c=a.length;return c>1&&ot(s,a[0],a[1])?a=[]:c>2&&ot(a[0],a[1],a[2])&&(a=[a[0]]),ud(s,je(a,1),[])}),Ro=M2||function(){return Je.Date.now()};function q5(s,a){if(typeof a!="function")throw new Rt(l);return s=te(s),function(){if(--s<1)return a.apply(this,arguments)}}function rp(s,a,c){return a=c?t:a,a=s&&a==null?s.length:a,Mn(s,ie,t,t,t,t,a)}function ip(s,a){var c;if(typeof a!="function")throw new Rt(l);return s=te(s),function(){return--s>0&&(c=a.apply(this,arguments)),s<=1&&(a=t),c}}var xu=se(function(s,a,c){var d=T;if(c.length){var g=Yn(c,di(xu));d|=X}return Mn(s,d,a,c,g)}),sp=se(function(s,a,c){var d=T|I;if(c.length){var g=Yn(c,di(sp));d|=X}return Mn(a,d,s,c,g)});function op(s,a,c){a=c?t:a;var d=Mn(s,B,t,t,t,t,t,a);return d.placeholder=op.placeholder,d}function ap(s,a,c){a=c?t:a;var d=Mn(s,$,t,t,t,t,t,a);return d.placeholder=ap.placeholder,d}function lp(s,a,c){var d,g,v,x,k,E,O=0,N=!1,R=!1,H=!0;if(typeof s!="function")throw new Rt(l);a=Bt(a)||0,Me(c)&&(N=!!c.leading,R="maxWait"in c,v=R?Pe(Bt(c.maxWait)||0,a):v,H="trailing"in c?!!c.trailing:H);function K(Ie){var tn=d,On=g;return d=g=t,O=Ie,x=s.apply(On,tn),x}function j(Ie){return O=Ie,k=ds(ae,a),N?K(Ie):x}function re(Ie){var tn=Ie-E,On=Ie-O,Tp=a-tn;return R?tt(Tp,v-On):Tp}function Y(Ie){var tn=Ie-E,On=Ie-O;return E===t||tn>=a||tn<0||R&&On>=v}function ae(){var Ie=Ro();if(Y(Ie))return fe(Ie);k=ds(ae,re(Ie))}function fe(Ie){return k=t,H&&d?K(Ie):(d=g=t,x)}function _t(){k!==t&&bd(k),O=0,d=E=g=k=t}function at(){return k===t?x:fe(Ro())}function Et(){var Ie=Ro(),tn=Y(Ie);if(d=arguments,g=this,E=Ie,tn){if(k===t)return j(E);if(R)return bd(k),k=ds(ae,a),K(E)}return k===t&&(k=ds(ae,a)),x}return Et.cancel=_t,Et.flush=at,Et}var J5=se(function(s,a){return Xh(s,1,a)}),j5=se(function(s,a,c){return Xh(s,Bt(a)||0,c)});function Y5(s){return Mn(s,Gt)}function Lo(s,a){if(typeof s!="function"||a!=null&&typeof a!="function")throw new Rt(l);var c=function(){var d=arguments,g=a?a.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(Lo.Cache||_n),c}Lo.Cache=_n;function Po(s){if(typeof s!="function")throw new Rt(l);return function(){var a=arguments;switch(a.length){case 0:return!s.call(this);case 1:return!s.call(this,a[0]);case 2:return!s.call(this,a[0],a[1]);case 3:return!s.call(this,a[0],a[1],a[2])}return!s.apply(this,a)}}function X5(s){return ip(2,s)}var Z5=Bb(function(s,a){a=a.length==1&&ee(a[0])?_e(a[0],wt(J())):_e(je(a,1),wt(J()));var c=a.length;return se(function(d){for(var g=-1,v=tt(d.length,c);++g<v;)d[g]=a[g].call(this,d[g]);return St(s,this,d)})}),ku=se(function(s,a){var c=Yn(a,di(ku));return Mn(s,X,t,a,c)}),up=se(function(s,a){var c=Yn(a,di(up));return Mn(s,q,t,a,c)}),Q5=Tn(function(s,a){return Mn(s,Ee,t,t,t,a)});function eS(s,a){if(typeof s!="function")throw new Rt(l);return a=a===t?a:te(a),se(s,a)}function tS(s,a){if(typeof s!="function")throw new Rt(l);return a=a==null?0:Pe(te(a),0),se(function(c){var d=c[a],g=tr(c,0,a);return d&&jn(g,d),St(s,this,g)})}function nS(s,a,c){var d=!0,g=!0;if(typeof s!="function")throw new Rt(l);return Me(c)&&(d="leading"in c?!!c.leading:d,g="trailing"in c?!!c.trailing:g),lp(s,a,{leading:d,maxWait:a,trailing:g})}function rS(s){return rp(s,1)}function iS(s,a){return ku(au(a),s)}function sS(){if(!arguments.length)return[];var s=arguments[0];return ee(s)?s:[s]}function oS(s){return Pt(s,S)}function aS(s,a){return a=typeof a=="function"?a:t,Pt(s,S,a)}function lS(s){return Pt(s,p|S)}function uS(s,a){return a=typeof a=="function"?a:t,Pt(s,p|S,a)}function cS(s,a){return a==null||Yh(s,a,We(a))}function en(s,a){return s===a||s!==s&&a!==a}var fS=To(jl),hS=To(function(s,a){return s>=a}),Nr=nd(function(){return arguments}())?nd:function(s){return Ce(s)&&ve.call(s,"callee")&&!Wh.call(s,"callee")},ee=C.isArray,dS=kh?wt(kh):wb;function dt(s){return s!=null&&Do(s.length)&&!An(s)}function Ae(s){return Ce(s)&&dt(s)}function pS(s){return s===!0||s===!1||Ce(s)&&st(s)==Gi}var nr=C2||Lu,mS=_h?wt(_h):xb;function gS(s){return Ce(s)&&s.nodeType===1&&!ps(s)}function yS(s){if(s==null)return!0;if(dt(s)&&(ee(s)||typeof s=="string"||typeof s.splice=="function"||nr(s)||pi(s)||Nr(s)))return!s.length;var a=nt(s);if(a==Yt||a==Xt)return!s.size;if(hs(s))return!Zl(s).length;for(var c in s)if(ve.call(s,c))return!1;return!0}function bS(s,a){return us(s,a)}function vS(s,a,c){c=typeof c=="function"?c:t;var d=c?c(s,a):t;return d===t?us(s,a,t,c):!!d}function _u(s){if(!Ce(s))return!1;var a=st(s);return a==qs||a==W1||typeof s.message=="string"&&typeof s.name=="string"&&!ps(s)}function SS(s){return typeof s=="number"&&Vh(s)}function An(s){if(!Me(s))return!1;var a=st(s);return a==Js||a==Xf||a==$1||a==V1}function cp(s){return typeof s=="number"&&s==te(s)}function Do(s){return typeof s=="number"&&s>-1&&s%1==0&&s<=He}function Me(s){var a=typeof s;return s!=null&&(a=="object"||a=="function")}function Ce(s){return s!=null&&typeof s=="object"}var fp=Eh?wt(Eh):_b;function wS(s,a){return s===a||Xl(s,a,pu(a))}function xS(s,a,c){return c=typeof c=="function"?c:t,Xl(s,a,pu(a),c)}function kS(s){return hp(s)&&s!=+s}function _S(s){if(av(s))throw new Q(o);return rd(s)}function ES(s){return s===null}function MS(s){return s==null}function hp(s){return typeof s=="number"||Ce(s)&&st(s)==Ji}function ps(s){if(!Ce(s)||st(s)!=xn)return!1;var a=lo(s);if(a===null)return!0;var c=ve.call(a,"constructor")&&a.constructor;return typeof c=="function"&&c instanceof c&&io.call(c)==x2}var Eu=Mh?wt(Mh):Eb;function TS(s){return cp(s)&&s>=-He&&s<=He}var dp=Th?wt(Th):Mb;function zo(s){return typeof s=="string"||!ee(s)&&Ce(s)&&st(s)==Yi}function kt(s){return typeof s=="symbol"||Ce(s)&&st(s)==js}var pi=Ch?wt(Ch):Tb;function CS(s){return s===t}function AS(s){return Ce(s)&&nt(s)==Xi}function IS(s){return Ce(s)&&st(s)==G1}var OS=To(Ql),NS=To(function(s,a){return s<=a});function pp(s){if(!s)return[];if(dt(s))return zo(s)?Zt(s):ht(s);if(es&&s[es])return c2(s[es]());var a=nt(s),c=a==Yt?Hl:a==Xt?to:mi;return c(s)}function In(s){if(!s)return s===0?s:0;if(s=Bt(s),s===Fe||s===-Fe){var a=s<0?-1:1;return a*It}return s===s?s:0}function te(s){var a=In(s),c=a%1;return a===a?c?a-c:a:0}function mp(s){return s?Cr(te(s),0,$e):0}function Bt(s){if(typeof s=="number")return s;if(kt(s))return et;if(Me(s)){var a=typeof s.valueOf=="function"?s.valueOf():s;s=Me(a)?a+"":a}if(typeof s!="string")return s===0?s:+s;s=Lh(s);var c=dy.test(s);return c||my.test(s)?qy(s.slice(2),c?2:8):hy.test(s)?et:+s}function gp(s){return fn(s,pt(s))}function RS(s){return s?Cr(te(s),-He,He):s===0?s:0}function ye(s){return s==null?"":xt(s)}var LS=fi(function(s,a){if(hs(a)||dt(a)){fn(a,We(a),s);return}for(var c in a)ve.call(a,c)&&ss(s,c,a[c])}),yp=fi(function(s,a){fn(a,pt(a),s)}),Bo=fi(function(s,a,c,d){fn(a,pt(a),s,d)}),PS=fi(function(s,a,c,d){fn(a,We(a),s,d)}),DS=Tn(Gl);function zS(s,a){var c=ci(s);return a==null?c:jh(c,a)}var BS=se(function(s,a){s=Se(s);var c=-1,d=a.length,g=d>2?a[2]:t;for(g&&ot(a[0],a[1],g)&&(d=1);++c<d;)for(var v=a[c],x=pt(v),k=-1,E=x.length;++k<E;){var O=x[k],N=s[O];(N===t||en(N,ai[O])&&!ve.call(s,O))&&(s[O]=v[O])}return s}),FS=se(function(s){return s.push(t,Ld),St(bp,t,s)});function HS(s,a){return Ih(s,J(a,3),cn)}function $S(s,a){return Ih(s,J(a,3),Jl)}function WS(s,a){return s==null?s:ql(s,J(a,3),pt)}function US(s,a){return s==null?s:ed(s,J(a,3),pt)}function VS(s,a){return s&&cn(s,J(a,3))}function KS(s,a){return s&&Jl(s,J(a,3))}function GS(s){return s==null?[]:vo(s,We(s))}function qS(s){return s==null?[]:vo(s,pt(s))}function Mu(s,a,c){var d=s==null?t:Ar(s,a);return d===t?c:d}function JS(s,a){return s!=null&&zd(s,a,yb)}function Tu(s,a){return s!=null&&zd(s,a,bb)}var jS=Ad(function(s,a,c){a!=null&&typeof a.toString!="function"&&(a=so.call(a)),s[a]=c},Au(mt)),YS=Ad(function(s,a,c){a!=null&&typeof a.toString!="function"&&(a=so.call(a)),ve.call(s,a)?s[a].push(c):s[a]=[c]},J),XS=se(ls);function We(s){return dt(s)?qh(s):Zl(s)}function pt(s){return dt(s)?qh(s,!0):Cb(s)}function ZS(s,a){var c={};return a=J(a,3),cn(s,function(d,g,v){En(c,a(d,g,v),d)}),c}function QS(s,a){var c={};return a=J(a,3),cn(s,function(d,g,v){En(c,g,a(d,g,v))}),c}var ew=fi(function(s,a,c){So(s,a,c)}),bp=fi(function(s,a,c,d){So(s,a,c,d)}),tw=Tn(function(s,a){var c={};if(s==null)return c;var d=!1;a=_e(a,function(v){return v=er(v,s),d||(d=v.length>1),v}),fn(s,hu(s),c),d&&(c=Pt(c,p|y|S,jb));for(var g=a.length;g--;)iu(c,a[g]);return c});function nw(s,a){return vp(s,Po(J(a)))}var rw=Tn(function(s,a){return s==null?{}:Ib(s,a)});function vp(s,a){if(s==null)return{};var c=_e(hu(s),function(d){return[d]});return a=J(a),cd(s,c,function(d,g){return a(d,g[0])})}function iw(s,a,c){a=er(a,s);var d=-1,g=a.length;for(g||(g=1,s=t);++d<g;){var v=s==null?t:s[hn(a[d])];v===t&&(d=g,v=c),s=An(v)?v.call(s):v}return s}function sw(s,a,c){return s==null?s:cs(s,a,c)}function ow(s,a,c,d){return d=typeof d=="function"?d:t,s==null?s:cs(s,a,c,d)}var Sp=Nd(We),wp=Nd(pt);function aw(s,a,c){var d=ee(s),g=d||nr(s)||pi(s);if(a=J(a,4),c==null){var v=s&&s.constructor;g?c=d?new v:[]:Me(s)?c=An(v)?ci(lo(s)):{}:c={}}return(g?Nt:cn)(s,function(x,k,E){return a(c,x,k,E)}),c}function lw(s,a){return s==null?!0:iu(s,a)}function uw(s,a,c){return s==null?s:md(s,a,au(c))}function cw(s,a,c,d){return d=typeof d=="function"?d:t,s==null?s:md(s,a,au(c),d)}function mi(s){return s==null?[]:Fl(s,We(s))}function fw(s){return s==null?[]:Fl(s,pt(s))}function hw(s,a,c){return c===t&&(c=a,a=t),c!==t&&(c=Bt(c),c=c===c?c:0),a!==t&&(a=Bt(a),a=a===a?a:0),Cr(Bt(s),a,c)}function dw(s,a,c){return a=In(a),c===t?(c=a,a=0):c=In(c),s=Bt(s),vb(s,a,c)}function pw(s,a,c){if(c&&typeof c!="boolean"&&ot(s,a,c)&&(a=c=t),c===t&&(typeof a=="boolean"?(c=a,a=t):typeof s=="boolean"&&(c=s,s=t)),s===t&&a===t?(s=0,a=1):(s=In(s),a===t?(a=s,s=0):a=In(a)),s>a){var d=s;s=a,a=d}if(c||s%1||a%1){var g=Kh();return tt(s+g*(a-s+Gy("1e-"+((g+"").length-1))),a)}return tu(s,a)}var mw=hi(function(s,a,c){return a=a.toLowerCase(),s+(c?xp(a):a)});function xp(s){return Cu(ye(s).toLowerCase())}function kp(s){return s=ye(s),s&&s.replace(yy,s2).replace(Dy,"")}function gw(s,a,c){s=ye(s),a=xt(a);var d=s.length;c=c===t?d:Cr(te(c),0,d);var g=c;return c-=a.length,c>=0&&s.slice(c,g)==a}function yw(s){return s=ye(s),s&&X1.test(s)?s.replace(eh,o2):s}function bw(s){return s=ye(s),s&&ry.test(s)?s.replace(kl,"\\$&"):s}var vw=hi(function(s,a,c){return s+(c?"-":"")+a.toLowerCase()}),Sw=hi(function(s,a,c){return s+(c?" ":"")+a.toLowerCase()}),ww=Md("toLowerCase");function xw(s,a,c){s=ye(s),a=te(a);var d=a?si(s):0;if(!a||d>=a)return s;var g=(a-d)/2;return Mo(ho(g),c)+s+Mo(fo(g),c)}function kw(s,a,c){s=ye(s),a=te(a);var d=a?si(s):0;return a&&d<a?s+Mo(a-d,c):s}function _w(s,a,c){s=ye(s),a=te(a);var d=a?si(s):0;return a&&d<a?Mo(a-d,c)+s:s}function Ew(s,a,c){return c||a==null?a=0:a&&(a=+a),N2(ye(s).replace(_l,""),a||0)}function Mw(s,a,c){return(c?ot(s,a,c):a===t)?a=1:a=te(a),nu(ye(s),a)}function Tw(){var s=arguments,a=ye(s[0]);return s.length<3?a:a.replace(s[1],s[2])}var Cw=hi(function(s,a,c){return s+(c?"_":"")+a.toLowerCase()});function Aw(s,a,c){return c&&typeof c!="number"&&ot(s,a,c)&&(a=c=t),c=c===t?$e:c>>>0,c?(s=ye(s),s&&(typeof a=="string"||a!=null&&!Eu(a))&&(a=xt(a),!a&&ii(s))?tr(Zt(s),0,c):s.split(a,c)):[]}var Iw=hi(function(s,a,c){return s+(c?" ":"")+Cu(a)});function Ow(s,a,c){return s=ye(s),c=c==null?0:Cr(te(c),0,s.length),a=xt(a),s.slice(c,c+a.length)==a}function Nw(s,a,c){var d=b.templateSettings;c&&ot(s,a,c)&&(a=t),s=ye(s),a=Bo({},a,d,Rd);var g=Bo({},a.imports,d.imports,Rd),v=We(g),x=Fl(g,v),k,E,O=0,N=a.interpolate||Ys,R="__p += '",H=$l((a.escape||Ys).source+"|"+N.source+"|"+(N===th?fy:Ys).source+"|"+(a.evaluate||Ys).source+"|$","g"),K="//# sourceURL="+(ve.call(a,"sourceURL")?(a.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++$y+"]")+`
|
|
22
|
-
`;s.replace(H,function(Y,ae,fe,_t,at,Et){return fe||(fe=_t),R+=s.slice(O,Et).replace(
|
|
21
|
+
`)}function sv(s){return ee(s)||Nr(s)||!!(Vh&&s&&s[Vh])}function Cn(s,a){var c=typeof s;return a=a??He,!!a&&(c=="number"||c!="symbol"&&yy.test(s))&&s>-1&&s%1==0&&s<a}function ot(s,a,c){if(!Me(c))return!1;var d=typeof a;return(d=="number"?dt(c)&&Cn(a,c.length):d=="string"&&a in c)?en(c[a],s):!1}function gu(s,a){if(ee(s))return!1;var c=typeof s;return c=="number"||c=="symbol"||c=="boolean"||s==null||kt(s)?!0:ny.test(s)||!ty.test(s)||a!=null&&s in we(a)}function ov(s){var a=typeof s;return a=="string"||a=="number"||a=="symbol"||a=="boolean"?s!=="__proto__":s===null}function yu(s){var a=Co(s),c=b[a];if(typeof c!="function"||!(a in ue.prototype))return!1;if(s===c)return!0;var d=du(c);return!!d&&s===d[0]}function av(s){return!!Hh&&Hh in s}var lv=ro?An:Lu;function hs(s){var a=s&&s.constructor,c=typeof a=="function"&&a.prototype||ai;return s===c}function Hd(s){return s===s&&!Me(s)}function $d(s,a){return function(c){return c==null?!1:c[s]===a&&(a!==t||s in we(c))}}function uv(s){var a=Lo(s,function(d){return c.size===h&&c.clear(),d}),c=a.cache;return a}function cv(s,a){var c=s[1],d=a[1],g=c|d,v=g<(T|I|ie),x=d==ie&&c==B||d==ie&&c==Ee&&s[7].length<=a[8]||d==(ie|Ee)&&a[7].length<=a[8]&&c==B;if(!(v||x))return s;d&T&&(s[2]=a[2],g|=c&T?0:F);var k=a[3];if(k){var E=s[3];s[3]=E?kd(E,k,a[4]):k,s[4]=E?Xn(s[3],m):a[4]}return k=a[5],k&&(E=s[5],s[5]=E?_d(E,k,a[6]):k,s[6]=E?Xn(s[5],m):a[6]),k=a[7],k&&(s[7]=k),d&ie&&(s[8]=s[8]==null?a[8]:tt(s[8],a[8])),s[9]==null&&(s[9]=a[9]),s[0]=a[0],s[1]=g,s}function fv(s){var a=[];if(s!=null)for(var c in we(s))a.push(c);return a}function hv(s){return so.call(s)}function Wd(s,a,c){return a=Pe(a===t?s.length-1:a,0),function(){for(var d=arguments,g=-1,v=Pe(d.length-a,0),x=C(v);++g<v;)x[g]=d[a+g];g=-1;for(var k=C(a+1);++g<a;)k[g]=d[g];return k[a]=c(x),wt(s,this,k)}}function Ud(s,a){return a.length<2?s:Ar(s,Dt(a,0,-1))}function dv(s,a){for(var c=s.length,d=tt(a.length,c),g=ht(s);d--;){var v=a[d];s[d]=Cn(v,c)?g[v]:t}return s}function bu(s,a){if(!(a==="constructor"&&typeof s[a]=="function")&&a!="__proto__")return s[a]}var Vd=Gd(dd),ds=C2||function(s,a){return Je.setTimeout(s,a)},vu=Gd(Db);function Kd(s,a,c){var d=a+"";return vu(s,iv(d,pv(tv(d),c)))}function Gd(s){var a=0,c=0;return function(){var d=N2(),g=Gn-(d-c);if(c=d,g>0){if(++a>=un)return arguments[0]}else a=0;return s.apply(t,arguments)}}function Io(s,a){var c=-1,d=s.length,g=d-1;for(a=a===t?d:a;++c<a;){var v=tu(c,g),x=s[v];s[v]=s[c],s[c]=x}return s.length=a,s}var qd=uv(function(s){var a=[];return s.charCodeAt(0)===46&&a.push(""),s.replace(ry,function(c,d,g,v){a.push(g?v.replace(fy,"$1"):d||c)}),a});function hn(s){if(typeof s=="string"||kt(s))return s;var a=s+"";return a=="0"&&1/s==-Fe?"-0":a}function Or(s){if(s!=null){try{return io.call(s)}catch{}try{return s+""}catch{}}return""}function pv(s,a){return Nt(dl,function(c){var d="_."+c[0];a&c[1]&&!Qs(s,d)&&s.push(d)}),s.sort()}function Jd(s){if(s instanceof ue)return s.clone();var a=new Lt(s.__wrapped__,s.__chain__);return a.__actions__=ht(s.__actions__),a.__index__=s.__index__,a.__values__=s.__values__,a}function mv(s,a,c){(c?ot(s,a,c):a===t)?a=1:a=Pe(te(a),0);var d=s==null?0:s.length;if(!d||a<1)return[];for(var g=0,v=0,x=C(fo(d/a));g<d;)x[v++]=Dt(s,g,g+=a);return x}function gv(s){for(var a=-1,c=s==null?0:s.length,d=0,g=[];++a<c;){var v=s[a];v&&(g[d++]=v)}return g}function yv(){var s=arguments.length;if(!s)return[];for(var a=C(s-1),c=arguments[0],d=s;d--;)a[d-1]=arguments[d];return Yn(ee(c)?ht(c):[c],je(a,1))}var bv=se(function(s,a){return Ae(s)?as(s,je(a,1,Ae,!0)):[]}),vv=se(function(s,a){var c=zt(a);return Ae(c)&&(c=t),Ae(s)?as(s,je(a,1,Ae,!0),J(c,2)):[]}),wv=se(function(s,a){var c=zt(a);return Ae(c)&&(c=t),Ae(s)?as(s,je(a,1,Ae,!0),t,c):[]});function Sv(s,a,c){var d=s==null?0:s.length;return d?(a=c||a===t?1:te(a),Dt(s,a<0?0:a,d)):[]}function xv(s,a,c){var d=s==null?0:s.length;return d?(a=c||a===t?1:te(a),a=d-a,Dt(s,0,a<0?0:a)):[]}function kv(s,a){return s&&s.length?xo(s,J(a,3),!0,!0):[]}function _v(s,a){return s&&s.length?xo(s,J(a,3),!0):[]}function Ev(s,a,c,d){var g=s==null?0:s.length;return g?(c&&typeof c!="number"&&ot(s,a,c)&&(c=0,d=g),yb(s,a,c,d)):[]}function jd(s,a,c){var d=s==null?0:s.length;if(!d)return-1;var g=c==null?0:te(c);return g<0&&(g=Pe(d+g,0)),eo(s,J(a,3),g)}function Yd(s,a,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?Pe(d+g,0):tt(g,d-1)),eo(s,J(a,3),g,!0)}function Xd(s){var a=s==null?0:s.length;return a?je(s,1):[]}function Mv(s){var a=s==null?0:s.length;return a?je(s,Fe):[]}function Tv(s,a){var c=s==null?0:s.length;return c?(a=a===t?1:te(a),je(s,a)):[]}function Cv(s){for(var a=-1,c=s==null?0:s.length,d={};++a<c;){var g=s[a];d[g[0]]=g[1]}return d}function Zd(s){return s&&s.length?s[0]:t}function Av(s,a,c){var d=s==null?0:s.length;if(!d)return-1;var g=c==null?0:te(c);return g<0&&(g=Pe(d+g,0)),ri(s,a,g)}function Iv(s){var a=s==null?0:s.length;return a?Dt(s,0,-1):[]}var Ov=se(function(s){var a=_e(s,ou);return a.length&&a[0]===s[0]?Yl(a):[]}),Nv=se(function(s){var a=zt(s),c=_e(s,ou);return a===zt(c)?a=t:c.pop(),c.length&&c[0]===s[0]?Yl(c,J(a,2)):[]}),Rv=se(function(s){var a=zt(s),c=_e(s,ou);return a=typeof a=="function"?a:t,a&&c.pop(),c.length&&c[0]===s[0]?Yl(c,t,a):[]});function Lv(s,a){return s==null?"":I2.call(s,a)}function zt(s){var a=s==null?0:s.length;return a?s[a-1]:t}function Pv(s,a,c){var d=s==null?0:s.length;if(!d)return-1;var g=d;return c!==t&&(g=te(c),g=g<0?Pe(d+g,0):tt(g,d-1)),a===a?p2(s,a,g):eo(s,Nh,g,!0)}function Dv(s,a){return s&&s.length?ud(s,te(a)):t}var zv=se(Qd);function Qd(s,a){return s&&s.length&&a&&a.length?eu(s,a):s}function Bv(s,a,c){return s&&s.length&&a&&a.length?eu(s,a,J(c,2)):s}function Fv(s,a,c){return s&&s.length&&a&&a.length?eu(s,a,t,c):s}var Hv=Tn(function(s,a){var c=s==null?0:s.length,d=Gl(s,a);return hd(s,_e(a,function(g){return Cn(g,c)?+g:g}).sort(xd)),d});function $v(s,a){var c=[];if(!(s&&s.length))return c;var d=-1,g=[],v=s.length;for(a=J(a,3);++d<v;){var x=s[d];a(x,d,s)&&(c.push(x),g.push(d))}return hd(s,g),c}function wu(s){return s==null?s:L2.call(s)}function Wv(s,a,c){var d=s==null?0:s.length;return d?(c&&typeof c!="number"&&ot(s,a,c)?(a=0,c=d):(a=a==null?0:te(a),c=c===t?d:te(c)),Dt(s,a,c)):[]}function Uv(s,a){return So(s,a)}function Vv(s,a,c){return ru(s,a,J(c,2))}function Kv(s,a){var c=s==null?0:s.length;if(c){var d=So(s,a);if(d<c&&en(s[d],a))return d}return-1}function Gv(s,a){return So(s,a,!0)}function qv(s,a,c){return ru(s,a,J(c,2),!0)}function Jv(s,a){var c=s==null?0:s.length;if(c){var d=So(s,a,!0)-1;if(en(s[d],a))return d}return-1}function jv(s){return s&&s.length?pd(s):[]}function Yv(s,a){return s&&s.length?pd(s,J(a,2)):[]}function Xv(s){var a=s==null?0:s.length;return a?Dt(s,1,a):[]}function Zv(s,a,c){return s&&s.length?(a=c||a===t?1:te(a),Dt(s,0,a<0?0:a)):[]}function Qv(s,a,c){var d=s==null?0:s.length;return d?(a=c||a===t?1:te(a),a=d-a,Dt(s,a<0?0:a,d)):[]}function e5(s,a){return s&&s.length?xo(s,J(a,3),!1,!0):[]}function t5(s,a){return s&&s.length?xo(s,J(a,3)):[]}var n5=se(function(s){return er(je(s,1,Ae,!0))}),r5=se(function(s){var a=zt(s);return Ae(a)&&(a=t),er(je(s,1,Ae,!0),J(a,2))}),i5=se(function(s){var a=zt(s);return a=typeof a=="function"?a:t,er(je(s,1,Ae,!0),t,a)});function s5(s){return s&&s.length?er(s):[]}function o5(s,a){return s&&s.length?er(s,J(a,2)):[]}function a5(s,a){return a=typeof a=="function"?a:t,s&&s.length?er(s,t,a):[]}function Su(s){if(!(s&&s.length))return[];var a=0;return s=jn(s,function(c){if(Ae(c))return a=Pe(c.length,a),!0}),Bl(a,function(c){return _e(s,Pl(c))})}function ep(s,a){if(!(s&&s.length))return[];var c=Su(s);return a==null?c:_e(c,function(d){return wt(a,t,d)})}var l5=se(function(s,a){return Ae(s)?as(s,a):[]}),u5=se(function(s){return su(jn(s,Ae))}),c5=se(function(s){var a=zt(s);return Ae(a)&&(a=t),su(jn(s,Ae),J(a,2))}),f5=se(function(s){var a=zt(s);return a=typeof a=="function"?a:t,su(jn(s,Ae),t,a)}),h5=se(Su);function d5(s,a){return bd(s||[],a||[],ss)}function p5(s,a){return bd(s||[],a||[],cs)}var m5=se(function(s){var a=s.length,c=a>1?s[a-1]:t;return c=typeof c=="function"?(s.pop(),c):t,ep(s,c)});function tp(s){var a=b(s);return a.__chain__=!0,a}function g5(s,a){return a(s),s}function Oo(s,a){return a(s)}var y5=Tn(function(s){var a=s.length,c=a?s[0]:0,d=this.__wrapped__,g=function(v){return Gl(v,s)};return a>1||this.__actions__.length||!(d instanceof ue)||!Cn(c)?this.thru(g):(d=d.slice(c,+c+(a?1:0)),d.__actions__.push({func:Oo,args:[g],thisArg:t}),new Lt(d,this.__chain__).thru(function(v){return a&&!v.length&&v.push(t),v}))});function b5(){return tp(this)}function v5(){return new Lt(this.value(),this.__chain__)}function w5(){this.__values__===t&&(this.__values__=mp(this.value()));var s=this.__index__>=this.__values__.length,a=s?t:this.__values__[this.__index__++];return{done:s,value:a}}function S5(){return this}function x5(s){for(var a,c=this;c instanceof go;){var d=Jd(c);d.__index__=0,d.__values__=t,a?g.__wrapped__=d:a=d;var g=d;c=c.__wrapped__}return g.__wrapped__=s,a}function k5(){var s=this.__wrapped__;if(s instanceof ue){var a=s;return this.__actions__.length&&(a=new ue(this)),a=a.reverse(),a.__actions__.push({func:Oo,args:[wu],thisArg:t}),new Lt(a,this.__chain__)}return this.thru(wu)}function _5(){return yd(this.__wrapped__,this.__actions__)}var E5=ko(function(s,a,c){ve.call(s,c)?++s[c]:En(s,c,1)});function M5(s,a,c){var d=ee(s)?Ih:gb;return c&&ot(s,a,c)&&(a=t),d(s,J(a,3))}function T5(s,a){var c=ee(s)?jn:ed;return c(s,J(a,3))}var C5=Cd(jd),A5=Cd(Yd);function I5(s,a){return je(No(s,a),1)}function O5(s,a){return je(No(s,a),Fe)}function N5(s,a,c){return c=c===t?1:te(c),je(No(s,a),c)}function np(s,a){var c=ee(s)?Nt:Qn;return c(s,J(a,3))}function rp(s,a){var c=ee(s)?Xy:Qh;return c(s,J(a,3))}var R5=ko(function(s,a,c){ve.call(s,c)?s[c].push(a):En(s,c,[a])});function L5(s,a,c,d){s=dt(s)?s:mi(s),c=c&&!d?te(c):0;var g=s.length;return c<0&&(c=Pe(g+c,0)),zo(s)?c<=g&&s.indexOf(a,c)>-1:!!g&&ri(s,a,c)>-1}var P5=se(function(s,a,c){var d=-1,g=typeof a=="function",v=dt(s)?C(s.length):[];return Qn(s,function(x){v[++d]=g?wt(a,x,c):ls(x,a,c)}),v}),D5=ko(function(s,a,c){En(s,c,a)});function No(s,a){var c=ee(s)?_e:od;return c(s,J(a,3))}function z5(s,a,c,d){return s==null?[]:(ee(a)||(a=a==null?[]:[a]),c=d?t:c,ee(c)||(c=c==null?[]:[c]),cd(s,a,c))}var B5=ko(function(s,a,c){s[c?0:1].push(a)},function(){return[[],[]]});function F5(s,a,c){var d=ee(s)?Rl:Lh,g=arguments.length<3;return d(s,J(a,4),c,g,Qn)}function H5(s,a,c){var d=ee(s)?Zy:Lh,g=arguments.length<3;return d(s,J(a,4),c,g,Qh)}function $5(s,a){var c=ee(s)?jn:ed;return c(s,Po(J(a,3)))}function W5(s){var a=ee(s)?jh:Lb;return a(s)}function U5(s,a,c){(c?ot(s,a,c):a===t)?a=1:a=te(a);var d=ee(s)?fb:Pb;return d(s,a)}function V5(s){var a=ee(s)?hb:zb;return a(s)}function K5(s){if(s==null)return 0;if(dt(s))return zo(s)?si(s):s.length;var a=nt(s);return a==Yt||a==Xt?s.size:Zl(s).length}function G5(s,a,c){var d=ee(s)?Ll:Bb;return c&&ot(s,a,c)&&(a=t),d(s,J(a,3))}var q5=se(function(s,a){if(s==null)return[];var c=a.length;return c>1&&ot(s,a[0],a[1])?a=[]:c>2&&ot(a[0],a[1],a[2])&&(a=[a[0]]),cd(s,je(a,1),[])}),Ro=T2||function(){return Je.Date.now()};function J5(s,a){if(typeof a!="function")throw new Rt(l);return s=te(s),function(){if(--s<1)return a.apply(this,arguments)}}function ip(s,a,c){return a=c?t:a,a=s&&a==null?s.length:a,Mn(s,ie,t,t,t,t,a)}function sp(s,a){var c;if(typeof a!="function")throw new Rt(l);return s=te(s),function(){return--s>0&&(c=a.apply(this,arguments)),s<=1&&(a=t),c}}var xu=se(function(s,a,c){var d=T;if(c.length){var g=Xn(c,di(xu));d|=X}return Mn(s,d,a,c,g)}),op=se(function(s,a,c){var d=T|I;if(c.length){var g=Xn(c,di(op));d|=X}return Mn(a,d,s,c,g)});function ap(s,a,c){a=c?t:a;var d=Mn(s,B,t,t,t,t,t,a);return d.placeholder=ap.placeholder,d}function lp(s,a,c){a=c?t:a;var d=Mn(s,$,t,t,t,t,t,a);return d.placeholder=lp.placeholder,d}function up(s,a,c){var d,g,v,x,k,E,O=0,N=!1,R=!1,H=!0;if(typeof s!="function")throw new Rt(l);a=Bt(a)||0,Me(c)&&(N=!!c.leading,R="maxWait"in c,v=R?Pe(Bt(c.maxWait)||0,a):v,H="trailing"in c?!!c.trailing:H);function K(Ie){var tn=d,On=g;return d=g=t,O=Ie,x=s.apply(On,tn),x}function j(Ie){return O=Ie,k=ds(ae,a),N?K(Ie):x}function re(Ie){var tn=Ie-E,On=Ie-O,Cp=a-tn;return R?tt(Cp,v-On):Cp}function Y(Ie){var tn=Ie-E,On=Ie-O;return E===t||tn>=a||tn<0||R&&On>=v}function ae(){var Ie=Ro();if(Y(Ie))return fe(Ie);k=ds(ae,re(Ie))}function fe(Ie){return k=t,H&&d?K(Ie):(d=g=t,x)}function _t(){k!==t&&vd(k),O=0,d=E=g=k=t}function at(){return k===t?x:fe(Ro())}function Et(){var Ie=Ro(),tn=Y(Ie);if(d=arguments,g=this,E=Ie,tn){if(k===t)return j(E);if(R)return vd(k),k=ds(ae,a),K(E)}return k===t&&(k=ds(ae,a)),x}return Et.cancel=_t,Et.flush=at,Et}var j5=se(function(s,a){return Zh(s,1,a)}),Y5=se(function(s,a,c){return Zh(s,Bt(a)||0,c)});function X5(s){return Mn(s,Gt)}function Lo(s,a){if(typeof s!="function"||a!=null&&typeof a!="function")throw new Rt(l);var c=function(){var d=arguments,g=a?a.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(Lo.Cache||_n),c}Lo.Cache=_n;function Po(s){if(typeof s!="function")throw new Rt(l);return function(){var a=arguments;switch(a.length){case 0:return!s.call(this);case 1:return!s.call(this,a[0]);case 2:return!s.call(this,a[0],a[1]);case 3:return!s.call(this,a[0],a[1],a[2])}return!s.apply(this,a)}}function Z5(s){return sp(2,s)}var Q5=Fb(function(s,a){a=a.length==1&&ee(a[0])?_e(a[0],St(J())):_e(je(a,1),St(J()));var c=a.length;return se(function(d){for(var g=-1,v=tt(d.length,c);++g<v;)d[g]=a[g].call(this,d[g]);return wt(s,this,d)})}),ku=se(function(s,a){var c=Xn(a,di(ku));return Mn(s,X,t,a,c)}),cp=se(function(s,a){var c=Xn(a,di(cp));return Mn(s,q,t,a,c)}),ew=Tn(function(s,a){return Mn(s,Ee,t,t,t,a)});function tw(s,a){if(typeof s!="function")throw new Rt(l);return a=a===t?a:te(a),se(s,a)}function nw(s,a){if(typeof s!="function")throw new Rt(l);return a=a==null?0:Pe(te(a),0),se(function(c){var d=c[a],g=nr(c,0,a);return d&&Yn(g,d),wt(s,this,g)})}function rw(s,a,c){var d=!0,g=!0;if(typeof s!="function")throw new Rt(l);return Me(c)&&(d="leading"in c?!!c.leading:d,g="trailing"in c?!!c.trailing:g),up(s,a,{leading:d,maxWait:a,trailing:g})}function iw(s){return ip(s,1)}function sw(s,a){return ku(au(a),s)}function ow(){if(!arguments.length)return[];var s=arguments[0];return ee(s)?s:[s]}function aw(s){return Pt(s,w)}function lw(s,a){return a=typeof a=="function"?a:t,Pt(s,w,a)}function uw(s){return Pt(s,p|w)}function cw(s,a){return a=typeof a=="function"?a:t,Pt(s,p|w,a)}function fw(s,a){return a==null||Xh(s,a,We(a))}function en(s,a){return s===a||s!==s&&a!==a}var hw=To(jl),dw=To(function(s,a){return s>=a}),Nr=rd(function(){return arguments}())?rd:function(s){return Ce(s)&&ve.call(s,"callee")&&!Uh.call(s,"callee")},ee=C.isArray,pw=_h?St(_h):xb;function dt(s){return s!=null&&Do(s.length)&&!An(s)}function Ae(s){return Ce(s)&&dt(s)}function mw(s){return s===!0||s===!1||Ce(s)&&st(s)==Gi}var rr=A2||Lu,gw=Eh?St(Eh):kb;function yw(s){return Ce(s)&&s.nodeType===1&&!ps(s)}function bw(s){if(s==null)return!0;if(dt(s)&&(ee(s)||typeof s=="string"||typeof s.splice=="function"||rr(s)||pi(s)||Nr(s)))return!s.length;var a=nt(s);if(a==Yt||a==Xt)return!s.size;if(hs(s))return!Zl(s).length;for(var c in s)if(ve.call(s,c))return!1;return!0}function vw(s,a){return us(s,a)}function ww(s,a,c){c=typeof c=="function"?c:t;var d=c?c(s,a):t;return d===t?us(s,a,t,c):!!d}function _u(s){if(!Ce(s))return!1;var a=st(s);return a==qs||a==U1||typeof s.message=="string"&&typeof s.name=="string"&&!ps(s)}function Sw(s){return typeof s=="number"&&Kh(s)}function An(s){if(!Me(s))return!1;var a=st(s);return a==Js||a==Zf||a==W1||a==K1}function fp(s){return typeof s=="number"&&s==te(s)}function Do(s){return typeof s=="number"&&s>-1&&s%1==0&&s<=He}function Me(s){var a=typeof s;return s!=null&&(a=="object"||a=="function")}function Ce(s){return s!=null&&typeof s=="object"}var hp=Mh?St(Mh):Eb;function xw(s,a){return s===a||Xl(s,a,pu(a))}function kw(s,a,c){return c=typeof c=="function"?c:t,Xl(s,a,pu(a),c)}function _w(s){return dp(s)&&s!=+s}function Ew(s){if(lv(s))throw new Q(o);return id(s)}function Mw(s){return s===null}function Tw(s){return s==null}function dp(s){return typeof s=="number"||Ce(s)&&st(s)==Ji}function ps(s){if(!Ce(s)||st(s)!=xn)return!1;var a=lo(s);if(a===null)return!0;var c=ve.call(a,"constructor")&&a.constructor;return typeof c=="function"&&c instanceof c&&io.call(c)==k2}var Eu=Th?St(Th):Mb;function Cw(s){return fp(s)&&s>=-He&&s<=He}var pp=Ch?St(Ch):Tb;function zo(s){return typeof s=="string"||!ee(s)&&Ce(s)&&st(s)==Yi}function kt(s){return typeof s=="symbol"||Ce(s)&&st(s)==js}var pi=Ah?St(Ah):Cb;function Aw(s){return s===t}function Iw(s){return Ce(s)&&nt(s)==Xi}function Ow(s){return Ce(s)&&st(s)==q1}var Nw=To(Ql),Rw=To(function(s,a){return s<=a});function mp(s){if(!s)return[];if(dt(s))return zo(s)?Zt(s):ht(s);if(es&&s[es])return f2(s[es]());var a=nt(s),c=a==Yt?Hl:a==Xt?to:mi;return c(s)}function In(s){if(!s)return s===0?s:0;if(s=Bt(s),s===Fe||s===-Fe){var a=s<0?-1:1;return a*It}return s===s?s:0}function te(s){var a=In(s),c=a%1;return a===a?c?a-c:a:0}function gp(s){return s?Cr(te(s),0,$e):0}function Bt(s){if(typeof s=="number")return s;if(kt(s))return et;if(Me(s)){var a=typeof s.valueOf=="function"?s.valueOf():s;s=Me(a)?a+"":a}if(typeof s!="string")return s===0?s:+s;s=Ph(s);var c=py.test(s);return c||gy.test(s)?Jy(s.slice(2),c?2:8):dy.test(s)?et:+s}function yp(s){return fn(s,pt(s))}function Lw(s){return s?Cr(te(s),-He,He):s===0?s:0}function ye(s){return s==null?"":xt(s)}var Pw=fi(function(s,a){if(hs(a)||dt(a)){fn(a,We(a),s);return}for(var c in a)ve.call(a,c)&&ss(s,c,a[c])}),bp=fi(function(s,a){fn(a,pt(a),s)}),Bo=fi(function(s,a,c,d){fn(a,pt(a),s,d)}),Dw=fi(function(s,a,c,d){fn(a,We(a),s,d)}),zw=Tn(Gl);function Bw(s,a){var c=ci(s);return a==null?c:Yh(c,a)}var Fw=se(function(s,a){s=we(s);var c=-1,d=a.length,g=d>2?a[2]:t;for(g&&ot(a[0],a[1],g)&&(d=1);++c<d;)for(var v=a[c],x=pt(v),k=-1,E=x.length;++k<E;){var O=x[k],N=s[O];(N===t||en(N,ai[O])&&!ve.call(s,O))&&(s[O]=v[O])}return s}),Hw=se(function(s){return s.push(t,Pd),wt(vp,t,s)});function $w(s,a){return Oh(s,J(a,3),cn)}function Ww(s,a){return Oh(s,J(a,3),Jl)}function Uw(s,a){return s==null?s:ql(s,J(a,3),pt)}function Vw(s,a){return s==null?s:td(s,J(a,3),pt)}function Kw(s,a){return s&&cn(s,J(a,3))}function Gw(s,a){return s&&Jl(s,J(a,3))}function qw(s){return s==null?[]:vo(s,We(s))}function Jw(s){return s==null?[]:vo(s,pt(s))}function Mu(s,a,c){var d=s==null?t:Ar(s,a);return d===t?c:d}function jw(s,a){return s!=null&&Bd(s,a,bb)}function Tu(s,a){return s!=null&&Bd(s,a,vb)}var Yw=Id(function(s,a,c){a!=null&&typeof a.toString!="function"&&(a=so.call(a)),s[a]=c},Au(mt)),Xw=Id(function(s,a,c){a!=null&&typeof a.toString!="function"&&(a=so.call(a)),ve.call(s,a)?s[a].push(c):s[a]=[c]},J),Zw=se(ls);function We(s){return dt(s)?Jh(s):Zl(s)}function pt(s){return dt(s)?Jh(s,!0):Ab(s)}function Qw(s,a){var c={};return a=J(a,3),cn(s,function(d,g,v){En(c,a(d,g,v),d)}),c}function eS(s,a){var c={};return a=J(a,3),cn(s,function(d,g,v){En(c,g,a(d,g,v))}),c}var tS=fi(function(s,a,c){wo(s,a,c)}),vp=fi(function(s,a,c,d){wo(s,a,c,d)}),nS=Tn(function(s,a){var c={};if(s==null)return c;var d=!1;a=_e(a,function(v){return v=tr(v,s),d||(d=v.length>1),v}),fn(s,hu(s),c),d&&(c=Pt(c,p|y|w,Yb));for(var g=a.length;g--;)iu(c,a[g]);return c});function rS(s,a){return wp(s,Po(J(a)))}var iS=Tn(function(s,a){return s==null?{}:Ob(s,a)});function wp(s,a){if(s==null)return{};var c=_e(hu(s),function(d){return[d]});return a=J(a),fd(s,c,function(d,g){return a(d,g[0])})}function sS(s,a,c){a=tr(a,s);var d=-1,g=a.length;for(g||(g=1,s=t);++d<g;){var v=s==null?t:s[hn(a[d])];v===t&&(d=g,v=c),s=An(v)?v.call(s):v}return s}function oS(s,a,c){return s==null?s:cs(s,a,c)}function aS(s,a,c,d){return d=typeof d=="function"?d:t,s==null?s:cs(s,a,c,d)}var Sp=Rd(We),xp=Rd(pt);function lS(s,a,c){var d=ee(s),g=d||rr(s)||pi(s);if(a=J(a,4),c==null){var v=s&&s.constructor;g?c=d?new v:[]:Me(s)?c=An(v)?ci(lo(s)):{}:c={}}return(g?Nt:cn)(s,function(x,k,E){return a(c,x,k,E)}),c}function uS(s,a){return s==null?!0:iu(s,a)}function cS(s,a,c){return s==null?s:gd(s,a,au(c))}function fS(s,a,c,d){return d=typeof d=="function"?d:t,s==null?s:gd(s,a,au(c),d)}function mi(s){return s==null?[]:Fl(s,We(s))}function hS(s){return s==null?[]:Fl(s,pt(s))}function dS(s,a,c){return c===t&&(c=a,a=t),c!==t&&(c=Bt(c),c=c===c?c:0),a!==t&&(a=Bt(a),a=a===a?a:0),Cr(Bt(s),a,c)}function pS(s,a,c){return a=In(a),c===t?(c=a,a=0):c=In(c),s=Bt(s),wb(s,a,c)}function mS(s,a,c){if(c&&typeof c!="boolean"&&ot(s,a,c)&&(a=c=t),c===t&&(typeof a=="boolean"?(c=a,a=t):typeof s=="boolean"&&(c=s,s=t)),s===t&&a===t?(s=0,a=1):(s=In(s),a===t?(a=s,s=0):a=In(a)),s>a){var d=s;s=a,a=d}if(c||s%1||a%1){var g=Gh();return tt(s+g*(a-s+qy("1e-"+((g+"").length-1))),a)}return tu(s,a)}var gS=hi(function(s,a,c){return a=a.toLowerCase(),s+(c?kp(a):a)});function kp(s){return Cu(ye(s).toLowerCase())}function _p(s){return s=ye(s),s&&s.replace(by,o2).replace(zy,"")}function yS(s,a,c){s=ye(s),a=xt(a);var d=s.length;c=c===t?d:Cr(te(c),0,d);var g=c;return c-=a.length,c>=0&&s.slice(c,g)==a}function bS(s){return s=ye(s),s&&Z1.test(s)?s.replace(th,a2):s}function vS(s){return s=ye(s),s&&iy.test(s)?s.replace(kl,"\\$&"):s}var wS=hi(function(s,a,c){return s+(c?"-":"")+a.toLowerCase()}),SS=hi(function(s,a,c){return s+(c?" ":"")+a.toLowerCase()}),xS=Td("toLowerCase");function kS(s,a,c){s=ye(s),a=te(a);var d=a?si(s):0;if(!a||d>=a)return s;var g=(a-d)/2;return Mo(ho(g),c)+s+Mo(fo(g),c)}function _S(s,a,c){s=ye(s),a=te(a);var d=a?si(s):0;return a&&d<a?s+Mo(a-d,c):s}function ES(s,a,c){s=ye(s),a=te(a);var d=a?si(s):0;return a&&d<a?Mo(a-d,c)+s:s}function MS(s,a,c){return c||a==null?a=0:a&&(a=+a),R2(ye(s).replace(_l,""),a||0)}function TS(s,a,c){return(c?ot(s,a,c):a===t)?a=1:a=te(a),nu(ye(s),a)}function CS(){var s=arguments,a=ye(s[0]);return s.length<3?a:a.replace(s[1],s[2])}var AS=hi(function(s,a,c){return s+(c?"_":"")+a.toLowerCase()});function IS(s,a,c){return c&&typeof c!="number"&&ot(s,a,c)&&(a=c=t),c=c===t?$e:c>>>0,c?(s=ye(s),s&&(typeof a=="string"||a!=null&&!Eu(a))&&(a=xt(a),!a&&ii(s))?nr(Zt(s),0,c):s.split(a,c)):[]}var OS=hi(function(s,a,c){return s+(c?" ":"")+Cu(a)});function NS(s,a,c){return s=ye(s),c=c==null?0:Cr(te(c),0,s.length),a=xt(a),s.slice(c,c+a.length)==a}function RS(s,a,c){var d=b.templateSettings;c&&ot(s,a,c)&&(a=t),s=ye(s),a=Bo({},a,d,Ld);var g=Bo({},a.imports,d.imports,Ld),v=We(g),x=Fl(g,v),k,E,O=0,N=a.interpolate||Ys,R="__p += '",H=$l((a.escape||Ys).source+"|"+N.source+"|"+(N===nh?hy:Ys).source+"|"+(a.evaluate||Ys).source+"|$","g"),K="//# sourceURL="+(ve.call(a,"sourceURL")?(a.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++Wy+"]")+`
|
|
22
|
+
`;s.replace(H,function(Y,ae,fe,_t,at,Et){return fe||(fe=_t),R+=s.slice(O,Et).replace(vy,l2),ae&&(k=!0,R+=`' +
|
|
23
23
|
__e(`+ae+`) +
|
|
24
24
|
'`),at&&(E=!0,R+=`';
|
|
25
25
|
`+at+`;
|
|
@@ -29,10 +29,10 @@ __p += '`),fe&&(R+=`' +
|
|
|
29
29
|
`;var j=ve.call(a,"variable")&&a.variable;if(!j)R=`with (obj) {
|
|
30
30
|
`+R+`
|
|
31
31
|
}
|
|
32
|
-
`;else if(
|
|
32
|
+
`;else if(cy.test(j))throw new Q(u);R=(E?R.replace(J1,""):R).replace(j1,"$1").replace(Y1,"$1;"),R="function("+(j||"obj")+`) {
|
|
33
33
|
`+(j?"":`obj || (obj = {});
|
|
34
34
|
`)+"var __t, __p = ''"+(k?", __e = _.escape":"")+(E?`, __j = Array.prototype.join;
|
|
35
35
|
function print() { __p += __j.call(arguments, '') }
|
|
36
36
|
`:`;
|
|
37
37
|
`)+R+`return __p
|
|
38
|
-
}`;var re=Ep(function(){return ge(v,K+"return "+R).apply(t,x)});if(re.source=R,_u(re))throw re;return re}function Rw(s){return ye(s).toLowerCase()}function Lw(s){return ye(s).toUpperCase()}function Pw(s,a,c){if(s=ye(s),s&&(c||a===t))return Lh(s);if(!s||!(a=xt(a)))return s;var d=Zt(s),g=Zt(a),v=Ph(d,g),x=Dh(d,g)+1;return tr(d,v,x).join("")}function Dw(s,a,c){if(s=ye(s),s&&(c||a===t))return s.slice(0,Bh(s)+1);if(!s||!(a=xt(a)))return s;var d=Zt(s),g=Dh(d,Zt(a))+1;return tr(d,0,g).join("")}function zw(s,a,c){if(s=ye(s),s&&(c||a===t))return s.replace(_l,"");if(!s||!(a=xt(a)))return s;var d=Zt(s),g=Ph(d,Zt(a));return tr(d,g).join("")}function Bw(s,a){var c=ei,d=qt;if(Me(a)){var g="separator"in a?a.separator:g;c="length"in a?te(a.length):c,d="omission"in a?xt(a.omission):d}s=ye(s);var v=s.length;if(ii(s)){var x=Zt(s);v=x.length}if(c>=v)return s;var k=c-si(d);if(k<1)return d;var E=x?tr(x,0,k).join(""):s.slice(0,k);if(g===t)return E+d;if(x&&(k+=E.length-k),Eu(g)){if(s.slice(k).search(g)){var O,N=E;for(g.global||(g=$l(g.source,ye(nh.exec(g))+"g")),g.lastIndex=0;O=g.exec(N);)var R=O.index;E=E.slice(0,R===t?k:R)}}else if(s.indexOf(xt(g),k)!=k){var H=E.lastIndexOf(g);H>-1&&(E=E.slice(0,H))}return E+d}function Fw(s){return s=ye(s),s&&Y1.test(s)?s.replace(Qf,p2):s}var Hw=hi(function(s,a,c){return s+(c?" ":"")+a.toUpperCase()}),Cu=Md("toUpperCase");function _p(s,a,c){return s=ye(s),a=c?t:a,a===t?u2(s)?y2(s):e2(s):s.match(a)||[]}var Ep=se(function(s,a){try{return St(s,t,a)}catch(c){return _u(c)?c:new Q(c)}}),$w=Tn(function(s,a){return Nt(a,function(c){c=hn(c),En(s,c,xu(s[c],s))}),s});function Ww(s){var a=s==null?0:s.length,c=J();return s=a?_e(s,function(d){if(typeof d[1]!="function")throw new Rt(l);return[c(d[0]),d[1]]}):[],se(function(d){for(var g=-1;++g<a;){var v=s[g];if(St(v[0],this,d))return St(v[1],this,d)}})}function Uw(s){return pb(Pt(s,p))}function Au(s){return function(){return s}}function Vw(s,a){return s==null||s!==s?a:s}var Kw=Cd(),Gw=Cd(!0);function mt(s){return s}function Iu(s){return id(typeof s=="function"?s:Pt(s,p))}function qw(s){return od(Pt(s,p))}function Jw(s,a){return ad(s,Pt(a,p))}var jw=se(function(s,a){return function(c){return ls(c,s,a)}}),Yw=se(function(s,a){return function(c){return ls(s,c,a)}});function Ou(s,a,c){var d=We(a),g=vo(a,d);c==null&&!(Me(a)&&(g.length||!d.length))&&(c=a,a=s,s=this,g=vo(a,We(a)));var v=!(Me(c)&&"chain"in c)||!!c.chain,x=An(s);return Nt(g,function(k){var E=a[k];s[k]=E,x&&(s.prototype[k]=function(){var O=this.__chain__;if(v||O){var N=s(this.__wrapped__),R=N.__actions__=ht(this.__actions__);return R.push({func:E,args:arguments,thisArg:s}),N.__chain__=O,N}return E.apply(s,jn([this.value()],arguments))})}),s}function Xw(){return Je._===this&&(Je._=k2),this}function Nu(){}function Zw(s){return s=te(s),se(function(a){return ld(a,s)})}var Qw=uu(_e),ex=uu(Ah),tx=uu(Ll);function Mp(s){return gu(s)?Pl(hn(s)):Ob(s)}function nx(s){return function(a){return s==null?t:Ar(s,a)}}var rx=Id(),ix=Id(!0);function Ru(){return[]}function Lu(){return!1}function sx(){return{}}function ox(){return""}function ax(){return!0}function lx(s,a){if(s=te(s),s<1||s>He)return[];var c=$e,d=tt(s,$e);a=J(a),s-=$e;for(var g=Bl(d,a);++c<s;)a(c);return g}function ux(s){return ee(s)?_e(s,hn):kt(s)?[s]:ht(Gd(ye(s)))}function cx(s){var a=++w2;return ye(s)+a}var fx=Eo(function(s,a){return s+a},0),hx=cu("ceil"),dx=Eo(function(s,a){return s/a},1),px=cu("floor");function mx(s){return s&&s.length?bo(s,mt,jl):t}function gx(s,a){return s&&s.length?bo(s,J(a,2),jl):t}function yx(s){return Nh(s,mt)}function bx(s,a){return Nh(s,J(a,2))}function vx(s){return s&&s.length?bo(s,mt,Ql):t}function Sx(s,a){return s&&s.length?bo(s,J(a,2),Ql):t}var wx=Eo(function(s,a){return s*a},1),xx=cu("round"),kx=Eo(function(s,a){return s-a},0);function _x(s){return s&&s.length?zl(s,mt):0}function Ex(s,a){return s&&s.length?zl(s,J(a,2)):0}return b.after=q5,b.ary=rp,b.assign=LS,b.assignIn=yp,b.assignInWith=Bo,b.assignWith=PS,b.at=DS,b.before=ip,b.bind=xu,b.bindAll=$w,b.bindKey=sp,b.castArray=sS,b.chain=ep,b.chunk=pv,b.compact=mv,b.concat=gv,b.cond=Ww,b.conforms=Uw,b.constant=Au,b.countBy=_5,b.create=zS,b.curry=op,b.curryRight=ap,b.debounce=lp,b.defaults=BS,b.defaultsDeep=FS,b.defer=J5,b.delay=j5,b.difference=yv,b.differenceBy=bv,b.differenceWith=vv,b.drop=Sv,b.dropRight=wv,b.dropRightWhile=xv,b.dropWhile=kv,b.fill=_v,b.filter=M5,b.flatMap=A5,b.flatMapDeep=I5,b.flatMapDepth=O5,b.flatten=Yd,b.flattenDeep=Ev,b.flattenDepth=Mv,b.flip=Y5,b.flow=Kw,b.flowRight=Gw,b.fromPairs=Tv,b.functions=GS,b.functionsIn=qS,b.groupBy=N5,b.initial=Av,b.intersection=Iv,b.intersectionBy=Ov,b.intersectionWith=Nv,b.invert=jS,b.invertBy=YS,b.invokeMap=L5,b.iteratee=Iu,b.keyBy=P5,b.keys=We,b.keysIn=pt,b.map=No,b.mapKeys=ZS,b.mapValues=QS,b.matches=qw,b.matchesProperty=Jw,b.memoize=Lo,b.merge=ew,b.mergeWith=bp,b.method=jw,b.methodOf=Yw,b.mixin=Ou,b.negate=Po,b.nthArg=Zw,b.omit=tw,b.omitBy=nw,b.once=X5,b.orderBy=D5,b.over=Qw,b.overArgs=Z5,b.overEvery=ex,b.overSome=tx,b.partial=ku,b.partialRight=up,b.partition=z5,b.pick=rw,b.pickBy=vp,b.property=Mp,b.propertyOf=nx,b.pull=Dv,b.pullAll=Zd,b.pullAllBy=zv,b.pullAllWith=Bv,b.pullAt=Fv,b.range=rx,b.rangeRight=ix,b.rearg=Q5,b.reject=H5,b.remove=Hv,b.rest=eS,b.reverse=Su,b.sampleSize=W5,b.set=sw,b.setWith=ow,b.shuffle=U5,b.slice=$v,b.sortBy=G5,b.sortedUniq=Jv,b.sortedUniqBy=jv,b.split=Aw,b.spread=tS,b.tail=Yv,b.take=Xv,b.takeRight=Zv,b.takeRightWhile=Qv,b.takeWhile=e5,b.tap=m5,b.throttle=nS,b.thru=Oo,b.toArray=pp,b.toPairs=Sp,b.toPairsIn=wp,b.toPath=ux,b.toPlainObject=gp,b.transform=aw,b.unary=rS,b.union=t5,b.unionBy=n5,b.unionWith=r5,b.uniq=i5,b.uniqBy=s5,b.uniqWith=o5,b.unset=lw,b.unzip=wu,b.unzipWith=Qd,b.update=uw,b.updateWith=cw,b.values=mi,b.valuesIn=fw,b.without=a5,b.words=_p,b.wrap=iS,b.xor=l5,b.xorBy=u5,b.xorWith=c5,b.zip=f5,b.zipObject=h5,b.zipObjectDeep=d5,b.zipWith=p5,b.entries=Sp,b.entriesIn=wp,b.extend=yp,b.extendWith=Bo,Ou(b,b),b.add=fx,b.attempt=Ep,b.camelCase=mw,b.capitalize=xp,b.ceil=hx,b.clamp=hw,b.clone=oS,b.cloneDeep=lS,b.cloneDeepWith=uS,b.cloneWith=aS,b.conformsTo=cS,b.deburr=kp,b.defaultTo=Vw,b.divide=dx,b.endsWith=gw,b.eq=en,b.escape=yw,b.escapeRegExp=bw,b.every=E5,b.find=T5,b.findIndex=Jd,b.findKey=HS,b.findLast=C5,b.findLastIndex=jd,b.findLastKey=$S,b.floor=px,b.forEach=tp,b.forEachRight=np,b.forIn=WS,b.forInRight=US,b.forOwn=VS,b.forOwnRight=KS,b.get=Mu,b.gt=fS,b.gte=hS,b.has=JS,b.hasIn=Tu,b.head=Xd,b.identity=mt,b.includes=R5,b.indexOf=Cv,b.inRange=dw,b.invoke=XS,b.isArguments=Nr,b.isArray=ee,b.isArrayBuffer=dS,b.isArrayLike=dt,b.isArrayLikeObject=Ae,b.isBoolean=pS,b.isBuffer=nr,b.isDate=mS,b.isElement=gS,b.isEmpty=yS,b.isEqual=bS,b.isEqualWith=vS,b.isError=_u,b.isFinite=SS,b.isFunction=An,b.isInteger=cp,b.isLength=Do,b.isMap=fp,b.isMatch=wS,b.isMatchWith=xS,b.isNaN=kS,b.isNative=_S,b.isNil=MS,b.isNull=ES,b.isNumber=hp,b.isObject=Me,b.isObjectLike=Ce,b.isPlainObject=ps,b.isRegExp=Eu,b.isSafeInteger=TS,b.isSet=dp,b.isString=zo,b.isSymbol=kt,b.isTypedArray=pi,b.isUndefined=CS,b.isWeakMap=AS,b.isWeakSet=IS,b.join=Rv,b.kebabCase=vw,b.last=zt,b.lastIndexOf=Lv,b.lowerCase=Sw,b.lowerFirst=ww,b.lt=OS,b.lte=NS,b.max=mx,b.maxBy=gx,b.mean=yx,b.meanBy=bx,b.min=vx,b.minBy=Sx,b.stubArray=Ru,b.stubFalse=Lu,b.stubObject=sx,b.stubString=ox,b.stubTrue=ax,b.multiply=wx,b.nth=Pv,b.noConflict=Xw,b.noop=Nu,b.now=Ro,b.pad=xw,b.padEnd=kw,b.padStart=_w,b.parseInt=Ew,b.random=pw,b.reduce=B5,b.reduceRight=F5,b.repeat=Mw,b.replace=Tw,b.result=iw,b.round=xx,b.runInContext=_,b.sample=$5,b.size=V5,b.snakeCase=Cw,b.some=K5,b.sortedIndex=Wv,b.sortedIndexBy=Uv,b.sortedIndexOf=Vv,b.sortedLastIndex=Kv,b.sortedLastIndexBy=Gv,b.sortedLastIndexOf=qv,b.startCase=Iw,b.startsWith=Ow,b.subtract=kx,b.sum=_x,b.sumBy=Ex,b.template=Nw,b.times=lx,b.toFinite=In,b.toInteger=te,b.toLength=mp,b.toLower=Rw,b.toNumber=Bt,b.toSafeInteger=RS,b.toString=ye,b.toUpper=Lw,b.trim=Pw,b.trimEnd=Dw,b.trimStart=zw,b.truncate=Bw,b.unescape=Fw,b.uniqueId=cx,b.upperCase=Hw,b.upperFirst=Cu,b.each=tp,b.eachRight=np,b.first=Xd,Ou(b,function(){var s={};return cn(b,function(a,c){ve.call(b.prototype,c)||(s[c]=a)}),s}(),{chain:!1}),b.VERSION=r,Nt(["bind","bindKey","curry","curryRight","partial","partialRight"],function(s){b[s].placeholder=b}),Nt(["drop","take"],function(s,a){ue.prototype[s]=function(c){c=c===t?1:Pe(te(c),0);var d=this.__filtered__&&!a?new ue(this):this.clone();return d.__filtered__?d.__takeCount__=tt(c,d.__takeCount__):d.__views__.push({size:tt(c,$e),type:s+(d.__dir__<0?"Right":"")}),d},ue.prototype[s+"Right"]=function(c){return this.reverse()[s](c).reverse()}}),Nt(["filter","map","takeWhile"],function(s,a){var c=a+1,d=c==Jt||c==Be;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}}),Nt(["head","last"],function(s,a){var c="take"+(a?"Right":"");ue.prototype[s]=function(){return this[c](1).value()[0]}}),Nt(["initial","tail"],function(s,a){var c="drop"+(a?"":"Right");ue.prototype[s]=function(){return this.__filtered__?new ue(this):this[c](1)}}),ue.prototype.compact=function(){return this.filter(mt)},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,a){return typeof s=="function"?new ue(this):this.map(function(c){return ls(c,s,a)})}),ue.prototype.reject=function(s){return this.filter(Po(J(s)))},ue.prototype.slice=function(s,a){s=te(s);var c=this;return c.__filtered__&&(s>0||a<0)?new ue(c):(s<0?c=c.takeRight(-s):s&&(c=c.drop(s)),a!==t&&(a=te(a),c=a<0?c.dropRight(-a):c.take(a-s)),c)},ue.prototype.takeRightWhile=function(s){return this.reverse().takeWhile(s).reverse()},ue.prototype.toArray=function(){return this.take($e)},cn(ue.prototype,function(s,a){var c=/^(?:filter|find|map|reject)|While$/.test(a),d=/^(?:head|last)$/.test(a),g=b[d?"take"+(a=="last"?"Right":""):a],v=d||/^find/.test(a);g&&(b.prototype[a]=function(){var x=this.__wrapped__,k=d?[1]:arguments,E=x instanceof ue,O=k[0],N=E||ee(x),R=function(ae){var fe=g.apply(b,jn([ae],k));return d&&H?fe[0]:fe};N&&c&&typeof O=="function"&&O.length!=1&&(E=N=!1);var H=this.__chain__,K=!!this.__actions__.length,j=v&&!H,re=E&&!K;if(!v&&N){x=re?x:new ue(this);var Y=s.apply(x,k);return Y.__actions__.push({func:Oo,args:[R],thisArg:t}),new Lt(Y,H)}return j&&re?s.apply(this,k):(Y=this.thru(R),j?d?Y.value()[0]:Y.value():Y)})}),Nt(["pop","push","shift","sort","splice","unshift"],function(s){var a=no[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 a.apply(ee(v)?v:[],g)}return this[c](function(x){return a.apply(ee(x)?x:[],g)})}}),cn(ue.prototype,function(s,a){var c=b[a];if(c){var d=c.name+"";ve.call(ui,d)||(ui[d]=[]),ui[d].push({name:a,func:c})}}),ui[_o(t,I).name]=[{name:"wrapper",func:t}],ue.prototype.clone=F2,ue.prototype.reverse=H2,ue.prototype.value=$2,b.prototype.at=g5,b.prototype.chain=y5,b.prototype.commit=b5,b.prototype.next=v5,b.prototype.plant=w5,b.prototype.reverse=x5,b.prototype.toJSON=b.prototype.valueOf=b.prototype.value=k5,b.prototype.first=b.prototype.head,es&&(b.prototype[es]=S5),b},oi=b2();_r?((_r.exports=oi)._=oi,Il._=oi):Je._=oi}).call(ZA)}(Us,Us.exports)),Us.exports}var P1=QA();function $f(n){return n.type.create(P1.cloneDeep(n.attrs))}const eI=Ne.create({name:"node_processor",addCommands(){return{setBlockAttributes:P(({commands:n,state:e},t,r,i={})=>{const o=z(n.getBlockAttributes(t))??{},{doc:l,tr:u}=e,{from:f,to:h}=u.selection;l.nodesBetween(f,h,(m,p)=>{ne.blocks.includes(m.type.name)&&u.setNodeAttribute(p,t,{...i,...o,...r})})}),getBlockAttributes:P(({editor:n},e,t)=>pe(()=>{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:l,schema:u}=n,{$from:f,$to:h}=o.selection,m=dn(he.LINK,u),p=dn(t,u);if(!(p.spec.group||"").includes(on.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:I,mark:F}=w;e._removeNodeMark({tr:M,node:T,position:I,mark:F.type})}};l.nodesBetween(f.pos,h.pos,(w,M)=>{if(w.type.name===ne.LIST)return;const T=XA(w.marks,t),I=p.create({...T?.attrs||{},...r}),F=N1(f,h,w,M);if(!m.isInSet(w.marks)&&YA(o.doc,M,I,i.isAppliedToParent))return S({tr:o,node:w,position:M,mark:I});if(w.isText){o.addMark(F.from,F.to,I);return}JA(o.doc,o.selection,w,M)&&o.addNodeMark(M,I)})}),getMarks:P(({editor:n},e)=>{const t=vi(n,"state");return pe(()=>{const{selection:r,doc:i}=z(t),{from:o,to:l}=z(r),u=[];return i.nodesBetween(o,l,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 pe(()=>z(t)[0]??null)}),hasMark:P(({commands:n},e)=>{const t=n.getMark(e);return pe(()=>!!z(t))}),getCommonSettingMark:P(({commands:n},e,t)=>{const r=n.getMark(e);return pe(()=>z(r)?.value??z(t))}),getDeviceSettingMark:P(({commands:n},e,t)=>{const r=n.getMarks(e),i=n.getDevice();return pe(()=>{for(const o of z(r)){const l=o[z(i)];if(l)return l}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,(l,u)=>{for(const f of l.marks)e._removeNodeMark({tr:t,node:l,position:u,mark:f})})}),removeMarks:P(({state:n,commands:e},t)=>{const{tr:r,doc:i}=n,{from:o,to:l}=r.selection;i.nodesBetween(o,l,(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))}}}),tI=Ne.create({name:"text_processor",addCommands(){return{getSelectedText:P(({state:n})=>{const{from:e,to:t}=n.selection;return n.doc.textBetween(e,t," ")}),transformText:P(({state:n},e)=>{const{$from:t,$to:r}=n.tr.selection;t.pos!==r.pos&&n.doc.nodesBetween(t.pos,r.pos,(i,o)=>{if(!i.isText)return;const l=N1(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(l.from,l.to,m)})})}}}),nI=Ne.create({name:"selection_processor",addStorage:()=>({selection:null}),addCommands(){return{storeSelection:P(({state:n})=>{this.storage.selection=n.selection}),restoreSelection:P(({commands:n})=>{this.storage.selection&&n.setTextSelection(this.storage.selection)}),expandSelection:P(({tr:n,commands:e},t)=>{let r=n.selection.from,i=n.selection.to;n.doc.nodesBetween(r,i,(o,l,u)=>{if(t({node:o,parent:u})){const f=o.isText?0:R1(n.doc,l);r=Math.min(r,l+f),i=Math.max(i,l+o.nodeSize-f)}}),e.setTextSelection({from:r,to:i})}),expandSelectionToBlock:P(({commands:n})=>{n.expandSelection(({parent:e})=>e.type.name===ne.DOCUMENT)})}}}),rI=Vn.create({name:"doc",topNode:!0,content:"block+"});class Ks extends rt{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=Br.fromJSON(this.schema,e.toJSON());return t.attrs.meta[this.key]=this.value,Re.ok(t)}invert(){return new Ks(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 Ks(e.key,e.value,e.stepType)}}rt.jsonID("setDocAttr",Ks);const iI=rI.extend({marks:on.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 Ks(e,t,n.schema))})}}}),sI=Vn.create({name:"paragraph",priority:1e3,addOptions(){return{HTMLAttributes:{}}},group:"block",content:"inline*",parseHTML(){return[{tag:"p"}]},renderHTML({HTMLAttributes:n}){return["p",Ni(this.options.HTMLAttributes,n),0]},addCommands(){return{setParagraph:()=>({commands:n})=>n.setNode(this.name)}},addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}}),oI=sI.extend({marks:on.ALL,addOptions:()=>({HTMLAttributes:{class:"zw-style"}})}),aI=Vn.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]}`,Ni(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=>HT({find:new RegExp(`^(#{1,${n}})\\s$`),type:this.type,getAttributes:{level:n}}))}}),lI=aI.extend({marks:on.ALL,addOptions:()=>({levels:[1,2,3,4],HTMLAttributes:{class:"zw-style"}})}),uI=Ne.create({name:"prose_mirror_plugins",addProseMirrorPlugins(){return[QT.create(this.editor),eC.create(this.editor)]}}),cI=()=>[iI,oI,lI,UT,ZT,eI,tI,nI,uI],fI=Ct.create({name:he.FONT_FAMILY,group:on.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 pe(()=>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 pe(()=>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 Jr({font_family:e})}}),hI=Ne.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 l=t[o],u=r[o],f=!u||u.toLowerCase()==="inherit";i[o]=f?l:u}return i}return{getPresetList:P(()=>pe(()=>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(),l=t.getLinkPreset();return pe(()=>{const u=n(z(i),z(r).id);if(!z(o))return u;const f=z(l);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()),l=n(o,i),u=l.node?.type??ne.PARAGRAPH,f={preset:{id:i}};l.node&&(f.level=l.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=vi(t,"state");return pe(()=>{const{selection:o,doc:l}=z(i),{from:u,to:f}=o;return r._getSettingCustomization(l,u,f)})}),isSettingCustomized:P(({commands:t},r)=>{const i=t.getPresetCustomization(),o=he.presetAttributes.includes(r)?"attributes":"marks";return pe(()=>z(i)[o]?.includes(r)??!1)}),getContentCustomization:P(({editor:t,commands:r})=>{const i=vi(t,"state");return pe(()=>{const{doc:o}=z(i);return r._getSettingCustomization(o,0,o.content.size)})}),_getSettingCustomization:P((t,r,i,o)=>{const l=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)&&l.add(h.name)}),{attributes:Array.from(u),marks:Array.from(l)}}),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($i.head,z(this.options.presets))}}),dI=Ct.create({name:he.FONT_WEIGHT,group:on.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 pe(()=>{const r=z(e),i=z(t);return i.isWeightSupported(r)?r:i.findClosestWeight(r)})}),getDefaultFontWeight:P(({commands:n})=>{const e=n.getPreset();return pe(()=>z(e).common.font_weight)})}},addKeyboardShortcuts:()=>({"Mod-b":Ut("toggleBold"),"Mod-B":Ut("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 Jr({font_weight:n.value})}}),pI=Ct.create({name:he.FONT_SIZE,group:on.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 pe(()=>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:l})=>{const u={...l.attrs,[t]:null};if(!Object.values(u).some(m=>!!m))return!1;const h=l.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-=":Ut("increaseFontSize"),"Mod-Shift--":Ut("decreaseFontSize")}),parseHTML(){const n=e=>{if(!e)return null;const t=z(this.options.wrapperRef),r=O1(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 Jr({font_size_mobile:e(n.mobile),font_size_tablet:e(n.tablet),font_size_desktop:e(n.desktop)})}}),mI=Ct.create({name:he.FONT_COLOR,group:on.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 pe(()=>z(e).common.color)}),applyFontColor:P(({commands:n},e)=>{n.applyMark(this.name,{value:e})})}},parseHTML(){const n=e=>({value:I1(e)});return[{style:"--zw-font-color",getAttrs:n},{style:"color",getAttrs:n}]},renderHTML({HTMLAttributes:n}){return Jr({font_color:n.value})}}),gI=Ct.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:I1(e)});return[{style:"--zw-background-color",getAttrs:n},{style:"background-color",getAttrs:n}]},renderHTML({HTMLAttributes:n}){return Jr({background_color:n.value})}}),yI=Ne.create({name:"device_manager",addCommands(){return{getDevice:P(()=>vi(this.options,"device"))}}}),bI=Ct.create({name:he.FONT_STYLE,group:on.SETTINGS,addAttributes:()=>({italic:{required:!0}}),addCommands(){return{isItalic:P(({commands:n})=>{const e=n.getMark(this.name),t=n.getDefaultFontStyle();return pe(()=>z(e)?.italic??z(t).italic)}),isItalicAvailable:P(({commands:n})=>{const e=n.getFont(),t=n.getFontWeight();return pe(()=>{const r=z(e),i=z(t);return r.isItalicSupported(i)&&!r.isWeightItalicOnly(i)})}),getDefaultFontStyle:P(({commands:n})=>{const e=n.getPreset();return pe(()=>({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":Ut("toggleItalic"),"Mod-I":Ut("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 Jr({font_style:e})}}),vI=Ct.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 pe(()=>z(e).underline)}),isStrikeThrough:P(({commands:n})=>{const e=n.getTextDecoration();return pe(()=>z(e).strike_through)}),getTextDecoration:P(({commands:n})=>{const e=n.getMark(this.name),t=n.getDefaultTextDecoration();return pe(()=>{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 pe(()=>z(e)!==z(t).underline)}),getDefaultTextDecoration:P(({commands:n})=>{const e=n.getPreset();return pe(()=>{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":Ut("toggleUnderline"),"Mod-U":Ut("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"),Jr({text_decoration:e.join(" ")})}}),SI=Ne.create({name:"case_style",addCommands(){return{applyCaseStyle:P(({commands:n},e)=>{switch(e){case sf.CAPITALIZE:return n.applyCapitalize();case sf.LOWERCASE:return n.applyLowerCase();case sf.UPPERCASE:return n.applyUpperCase()}}),applyCapitalize:P(({commands:n})=>{n.transformText(({text:e})=>wC(e))}),applyLowerCase:P(({commands:n})=>{n.transformText(({text:e})=>e.toLowerCase())}),applyUpperCase:P(({commands:n})=>{n.transformText(({text:e})=>e.toUpperCase())})}}}),D1={mobile:null,tablet:null,desktop:null},wI=Ne.create({name:he.ALIGNMENT,addGlobalAttributes:()=>[{types:[ne.PARAGRAPH,ne.HEADING],attributes:{[he.ALIGNMENT]:{isRequired:!1,parseHTML({style:n}){const e=qA(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?Xa({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},D1)}),removeAlignment:P(({commands:n})=>n.removeBlockAttributes(this.name)),getAlignment:P(({commands:n})=>{const e=n.getBlockAttributes(this.name,D1),t=n.getDevice(),r=n.getDefaultAlignment();return pe(()=>z(e)?.[z(t)]??z(r))}),getDefaultAlignment:P(({commands:n})=>{const e=n.getDevice(),t=n.getPreset();return pe(()=>z(t)[z(e)].alignment??gr.LEFT)})}},addKeyboardShortcuts:()=>({"Mod-Shift-l":Ut("applyAlignment",gr.LEFT),"Mod-Shift-e":Ut("applyAlignment",gr.CENTER),"Mod-Shift-r":Ut("applyAlignment",gr.RIGHT),"Mod-Shift-j":Ut("applyAlignment",gr.JUSTIFY)})}),z1={mobile:null,tablet:null,desktop:null},xI=Ne.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,l=n.style.getPropertyValue("--zw-line-height-desktop")||null;return{mobile:null,tablet:o,desktop:l}}const e=n.style.lineHeight;if(!e)return null;const t=z(this.options.wrapperRef),r=KA(e,n,t);return r?{desktop:r,tablet:r,mobile:null}:null},renderHTML(n){return n.line_height?Xa({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,z1),t=n.getDevice(),r=n.getDefaultLineHeight();return pe(()=>z(e)?.[z(t)]??z(r))}),getDefaultLineHeight:P(({commands:n})=>{const e=n.getDevice(),t=n.getPreset();return pe(()=>z(t)[z(e)].line_height)}),applyLineHeight:P(({commands:n},e)=>{const t=z(n.getDevice());n.setBlockAttributes(this.name,{[t]:e},z1)})}}}),kI=Vn.create({name:"listItem",addOptions(){return{HTMLAttributes:{},bulletListTypeName:"bulletList",orderedListTypeName:"orderedList"}},content:"paragraph block*",defining:!0,parseHTML(){return[{tag:"li"}]},renderHTML({HTMLAttributes:n}){return["li",Ni(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)}}}),_I=kI.extend({name:ne.LIST_ITEM,marks:on.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 l of r.marks)t.addNodeMark(o,$f(l));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()}})}),EI=Vn.create({name:ne.LIST,content:`${ne.LIST_ITEM}+`,group:"block list",marks:on.SETTINGS,addExtensions:()=>[_I],addOptions:()=>({baseClass:"",presetClass:""}),addAttributes:()=>({bullet:{default:{type:$t.DISC}}}),parseHTML(){const n={a:$t.ROMAN,i:$t.LATIN,1:$t.DECIMAL},e=t=>{for(const r of $t.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)||$t.DECIMAL}})},{tag:"ul",getAttrs:t=>({bullet:{type:e(t)||$t.DISC}})}]},renderHTML({HTMLAttributes:n}){const e=[z(this.options.baseClass)+n.bullet.type,z(this.options.presetClass)];return[$t.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 pe(()=>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 l(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}l(u,p)&&(e.removeNodeMark(f+1,p),e.addNodeMark(f,$f(p)),h.push(p))}}),!1})}),removeList:P(({commands:n,state:e})=>{const{tr:t,doc:r,selection:i}=e,o=i.$from.start(),l=i.$to.end();r.nodesBetween(o,l,(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,$f(p));return!1}),n.liftListItem(ne.LIST_ITEM)})}},addInputRules(){const n=(e,t)=>$T({find:t,type:this.type,getAttributes:{bullet:{type:e}},joinPredicate:(r,{attrs:i})=>i.bullet.type===e});return[n($t.DISC,/^\s*([-+*])\s$/),n($t.DECIMAL,/^(\d+)\.\s$/),n($t.LATIN,/^([ivx]{1,3})\.\s$/i),n($t.ROMAN,/^([a-z])\.\s$/i)]}});function MI(n){return new Mt({key:new rn("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:l}=r,u=uT(t.doc,[...e]);if(bT(u).forEach(({newRange:h})=>{const m=fT(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;Ef(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=>{s0(T.from,T.to,r.doc).some(I=>I.mark.type===n.type)||l.addMark(T.from,T.to,n.type.create({href:T.href}))})}}),!!l.steps.length)return l}})}function TI(n){return new Mt({key:new rn("handleClickLink"),props:{handleClick:(e,t,r)=>{var i,o;if(r.button!==0||r.target.nodeName!=="A")return!1;const u=mT(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 CI(n){return new Mt({key:new rn("handlePasteLink"),props:{handlePaste:(e,t,r)=>{var i;const{state:o}=e,{selection:l}=o,{empty:u}=l;if(u)return!1;let f="";r.content.forEach(w=>{f+=w.textContent});const h=Ef(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 AI=Ct.create({name:"link",priority:1e3,keepOnSplit:!1,onCreate(){this.options.protocols.forEach(n=>{if(typeof n=="string"){A0(n);return}A0(n.scheme,n.optionalSlashes)})},onDestroy(){yC()},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",Ni(this.options.HTMLAttributes,{...n,href:""}),0]:["a",Ni(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[WT({find:n=>Ef(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="([^"]*)"/,l=i?.match(o);return l?{href:l[1]}:{href:(r=n.data)===null||r===void 0?void 0:r.href}}})]},addProseMirrorPlugins(){const n=[];return this.options.autolink&&n.push(MI({type:this.type,validate:this.options.validate})),this.options.openOnClick&&n.push(TI({type:this.type})),this.options.linkOnPaste&&n.push(CI({editor:this.editor,type:this.type})),n}}),II=AI.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:m0.SELF,parseHTML:n=>n.getAttribute("target")||m0.SELF},destination:{default:Rs.URL,parseHTML:n=>{const e=n.getAttribute("href");if(!e.startsWith("#"))return Rs.URL;const t=e.replace("#","");return z(this.options.pageBlocks).find(o=>o.id===parseInt(t))?Rs.BLOCK:Rs.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(F1.text(r.text,[F1.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(()=>pe(()=>z(this.options.preset)))}},addProseMirrorPlugins(){return[...this.parent(),SC.create(this.editor)]},renderHTML({HTMLAttributes:n}){const e=n.destination===Rs.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]}}),OI=Ct.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 pe(()=>!!z(e))})}},parseHTML(){return[{tag:"sup"},{style:"vertical-align",getAttrs:n=>n!=="super"?!1:null}]},renderHTML(){return["sup",{class:"zw-superscript"},0]}}),NI=Ne.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?Xa({margin:n.margin.value}):null}}}}]});function RI(n){const e=r=>n.presetsRef.value.find(i=>i.id===r),t=Yu({default:null,link:null});return Bk(n.presetsRef,()=>{t.default=e(n.defaultPresetId),t.link=e(n.linkPresetId)},{immediate:!0,deep:!0}),cI().concat([hI.configure({presets:n.presetsRef,defaultId:n.defaultPresetId,styleRenderer:new DI({baseClass:n.basePresetClass,makeVariable:n.makePresetVariable,linkPresetId:n.linkPresetId})}),EI.configure({baseClass:n.baseListClass,presetClass:n.basePresetClass+n.defaultPresetId}),yI.configure({device:n.deviceRef}),pI.configure({minSize:n.minFontSize,maxSize:n.maxFontSize,wrapperRef:n.wrapperRef}),fI.configure({fonts:n.fonts,defaultPreset:vi(t,"default"),defaultFont:n.defaultFont}),dI,mI,gI,bI,vI,SI,OI,wI,xI.configure({wrapperRef:n.wrapperRef}),II.configure({preset:vi(t,"link"),basePresetClass:n.basePresetClass,pageBlocks:n.pageBlocksRef}),NI])}class LI{_domParser=new DOMParser;types=window;parse(e){return this._domParser.parseFromString(e,"text/html")}}class B1{content;constructor({content:e}){this.content=e}normalize(){throw new Error("Implement abstract method")}}class bn extends B1{static BLOCK_NODE_NAMES=["P","H1","H2","H3","H4"];static ROOT_NODE_NAMES=bn.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 l=u=>{this._assignElementProperties(u,e,bn.BLOCK_STYLES),t.append(u)};this._assignElementProperties(e,e.parentElement,bn.BLOCK_STYLES);for(const u of r){if(this._isBlockNode(u)){l(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),l(f),i=null,o=u;continue}i||(i=this.dom.createElement("p"),l(i)),i.append(u),o=u}e.append(t),this._removeStyleProperties(e,bn.BLOCK_STYLES),this._removeStyleProperties(e.parentElement,bn.BLOCK_STYLES),this._assignElementProperties(e,e.parentElement),e.parentElement.lastElementChild===e&&this._removeStyleProperties(e.parentElement)}_isBlockNode(e){return bn.BLOCK_NODE_NAMES.includes(e.tagName)}_isRootNode(e){return bn.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 l=u=>{this._assignElementProperties(u,e,bn.BLOCK_STYLES),t.append(u)};for(const u of r){if(u.tagName==="BR"){l(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),l={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(l).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 PI extends B1{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=>P1.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 hl{static build(e,t={}){return typeof e=="string"?this._buildHtml(e,t):this._buildJson(e)}static _buildHtml(e,t){return new bn({content:e,parser:t.parser||new LI})}static _buildJson(e){return new PI({content:e})}static normalize(e,t={}){return hl.build(e,t).normalize()}}class $i{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 jf{static build({config:e,nodeDomParser:t}){const r=RI({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(rf.DESKTOP),pageBlocksRef:qo([]),wrapperRef:$i.document.createElement("p")}),i=dT(r);return new jf({schema:i,domParser:lc.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=hl.build(e,{parser:this._nodeDomParser});return t.normalizeHTML(),this._domParser.parse(t.dom.body).toJSON()}}class F1{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 DI{_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=$i.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 l of rf.values)for(const u of Object.keys(r[l])){const f=this._makeVariable({device:l,preset:r,property:u}),h=this._makeInternalVariableName(u,l);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===rf.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 Yf{static _instance;static get instance(){return this._instance??=new Yf,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 zI{static createWindow(){return new Cp.JSDOM().window}types;parse(e){const{window:t}=new Cp.JSDOM(e);return this.types=t,t.document}}exports.ContentSerializer=jf,exports.ContextWindow=$i,exports.NodeDomParser=zI;
|
|
38
|
+
}`;var re=Mp(function(){return ge(v,K+"return "+R).apply(t,x)});if(re.source=R,_u(re))throw re;return re}function LS(s){return ye(s).toLowerCase()}function PS(s){return ye(s).toUpperCase()}function DS(s,a,c){if(s=ye(s),s&&(c||a===t))return Ph(s);if(!s||!(a=xt(a)))return s;var d=Zt(s),g=Zt(a),v=Dh(d,g),x=zh(d,g)+1;return nr(d,v,x).join("")}function zS(s,a,c){if(s=ye(s),s&&(c||a===t))return s.slice(0,Fh(s)+1);if(!s||!(a=xt(a)))return s;var d=Zt(s),g=zh(d,Zt(a))+1;return nr(d,0,g).join("")}function BS(s,a,c){if(s=ye(s),s&&(c||a===t))return s.replace(_l,"");if(!s||!(a=xt(a)))return s;var d=Zt(s),g=Dh(d,Zt(a));return nr(d,g).join("")}function FS(s,a){var c=ei,d=qt;if(Me(a)){var g="separator"in a?a.separator:g;c="length"in a?te(a.length):c,d="omission"in a?xt(a.omission):d}s=ye(s);var v=s.length;if(ii(s)){var x=Zt(s);v=x.length}if(c>=v)return s;var k=c-si(d);if(k<1)return d;var E=x?nr(x,0,k).join(""):s.slice(0,k);if(g===t)return E+d;if(x&&(k+=E.length-k),Eu(g)){if(s.slice(k).search(g)){var O,N=E;for(g.global||(g=$l(g.source,ye(rh.exec(g))+"g")),g.lastIndex=0;O=g.exec(N);)var R=O.index;E=E.slice(0,R===t?k:R)}}else if(s.indexOf(xt(g),k)!=k){var H=E.lastIndexOf(g);H>-1&&(E=E.slice(0,H))}return E+d}function HS(s){return s=ye(s),s&&X1.test(s)?s.replace(eh,m2):s}var $S=hi(function(s,a,c){return s+(c?" ":"")+a.toUpperCase()}),Cu=Td("toUpperCase");function Ep(s,a,c){return s=ye(s),a=c?t:a,a===t?c2(s)?b2(s):t2(s):s.match(a)||[]}var Mp=se(function(s,a){try{return wt(s,t,a)}catch(c){return _u(c)?c:new Q(c)}}),WS=Tn(function(s,a){return Nt(a,function(c){c=hn(c),En(s,c,xu(s[c],s))}),s});function US(s){var a=s==null?0:s.length,c=J();return s=a?_e(s,function(d){if(typeof d[1]!="function")throw new Rt(l);return[c(d[0]),d[1]]}):[],se(function(d){for(var g=-1;++g<a;){var v=s[g];if(wt(v[0],this,d))return wt(v[1],this,d)}})}function VS(s){return mb(Pt(s,p))}function Au(s){return function(){return s}}function KS(s,a){return s==null||s!==s?a:s}var GS=Ad(),qS=Ad(!0);function mt(s){return s}function Iu(s){return sd(typeof s=="function"?s:Pt(s,p))}function JS(s){return ad(Pt(s,p))}function jS(s,a){return ld(s,Pt(a,p))}var YS=se(function(s,a){return function(c){return ls(c,s,a)}}),XS=se(function(s,a){return function(c){return ls(s,c,a)}});function Ou(s,a,c){var d=We(a),g=vo(a,d);c==null&&!(Me(a)&&(g.length||!d.length))&&(c=a,a=s,s=this,g=vo(a,We(a)));var v=!(Me(c)&&"chain"in c)||!!c.chain,x=An(s);return Nt(g,function(k){var E=a[k];s[k]=E,x&&(s.prototype[k]=function(){var O=this.__chain__;if(v||O){var N=s(this.__wrapped__),R=N.__actions__=ht(this.__actions__);return R.push({func:E,args:arguments,thisArg:s}),N.__chain__=O,N}return E.apply(s,Yn([this.value()],arguments))})}),s}function ZS(){return Je._===this&&(Je._=_2),this}function Nu(){}function QS(s){return s=te(s),se(function(a){return ud(a,s)})}var ex=uu(_e),tx=uu(Ih),nx=uu(Ll);function Tp(s){return gu(s)?Pl(hn(s)):Nb(s)}function rx(s){return function(a){return s==null?t:Ar(s,a)}}var ix=Od(),sx=Od(!0);function Ru(){return[]}function Lu(){return!1}function ox(){return{}}function ax(){return""}function lx(){return!0}function ux(s,a){if(s=te(s),s<1||s>He)return[];var c=$e,d=tt(s,$e);a=J(a),s-=$e;for(var g=Bl(d,a);++c<s;)a(c);return g}function cx(s){return ee(s)?_e(s,hn):kt(s)?[s]:ht(qd(ye(s)))}function fx(s){var a=++x2;return ye(s)+a}var hx=Eo(function(s,a){return s+a},0),dx=cu("ceil"),px=Eo(function(s,a){return s/a},1),mx=cu("floor");function gx(s){return s&&s.length?bo(s,mt,jl):t}function yx(s,a){return s&&s.length?bo(s,J(a,2),jl):t}function bx(s){return Rh(s,mt)}function vx(s,a){return Rh(s,J(a,2))}function wx(s){return s&&s.length?bo(s,mt,Ql):t}function Sx(s,a){return s&&s.length?bo(s,J(a,2),Ql):t}var xx=Eo(function(s,a){return s*a},1),kx=cu("round"),_x=Eo(function(s,a){return s-a},0);function Ex(s){return s&&s.length?zl(s,mt):0}function Mx(s,a){return s&&s.length?zl(s,J(a,2)):0}return b.after=J5,b.ary=ip,b.assign=Pw,b.assignIn=bp,b.assignInWith=Bo,b.assignWith=Dw,b.at=zw,b.before=sp,b.bind=xu,b.bindAll=WS,b.bindKey=op,b.castArray=ow,b.chain=tp,b.chunk=mv,b.compact=gv,b.concat=yv,b.cond=US,b.conforms=VS,b.constant=Au,b.countBy=E5,b.create=Bw,b.curry=ap,b.curryRight=lp,b.debounce=up,b.defaults=Fw,b.defaultsDeep=Hw,b.defer=j5,b.delay=Y5,b.difference=bv,b.differenceBy=vv,b.differenceWith=wv,b.drop=Sv,b.dropRight=xv,b.dropRightWhile=kv,b.dropWhile=_v,b.fill=Ev,b.filter=T5,b.flatMap=I5,b.flatMapDeep=O5,b.flatMapDepth=N5,b.flatten=Xd,b.flattenDeep=Mv,b.flattenDepth=Tv,b.flip=X5,b.flow=GS,b.flowRight=qS,b.fromPairs=Cv,b.functions=qw,b.functionsIn=Jw,b.groupBy=R5,b.initial=Iv,b.intersection=Ov,b.intersectionBy=Nv,b.intersectionWith=Rv,b.invert=Yw,b.invertBy=Xw,b.invokeMap=P5,b.iteratee=Iu,b.keyBy=D5,b.keys=We,b.keysIn=pt,b.map=No,b.mapKeys=Qw,b.mapValues=eS,b.matches=JS,b.matchesProperty=jS,b.memoize=Lo,b.merge=tS,b.mergeWith=vp,b.method=YS,b.methodOf=XS,b.mixin=Ou,b.negate=Po,b.nthArg=QS,b.omit=nS,b.omitBy=rS,b.once=Z5,b.orderBy=z5,b.over=ex,b.overArgs=Q5,b.overEvery=tx,b.overSome=nx,b.partial=ku,b.partialRight=cp,b.partition=B5,b.pick=iS,b.pickBy=wp,b.property=Tp,b.propertyOf=rx,b.pull=zv,b.pullAll=Qd,b.pullAllBy=Bv,b.pullAllWith=Fv,b.pullAt=Hv,b.range=ix,b.rangeRight=sx,b.rearg=ew,b.reject=$5,b.remove=$v,b.rest=tw,b.reverse=wu,b.sampleSize=U5,b.set=oS,b.setWith=aS,b.shuffle=V5,b.slice=Wv,b.sortBy=q5,b.sortedUniq=jv,b.sortedUniqBy=Yv,b.split=IS,b.spread=nw,b.tail=Xv,b.take=Zv,b.takeRight=Qv,b.takeRightWhile=e5,b.takeWhile=t5,b.tap=g5,b.throttle=rw,b.thru=Oo,b.toArray=mp,b.toPairs=Sp,b.toPairsIn=xp,b.toPath=cx,b.toPlainObject=yp,b.transform=lS,b.unary=iw,b.union=n5,b.unionBy=r5,b.unionWith=i5,b.uniq=s5,b.uniqBy=o5,b.uniqWith=a5,b.unset=uS,b.unzip=Su,b.unzipWith=ep,b.update=cS,b.updateWith=fS,b.values=mi,b.valuesIn=hS,b.without=l5,b.words=Ep,b.wrap=sw,b.xor=u5,b.xorBy=c5,b.xorWith=f5,b.zip=h5,b.zipObject=d5,b.zipObjectDeep=p5,b.zipWith=m5,b.entries=Sp,b.entriesIn=xp,b.extend=bp,b.extendWith=Bo,Ou(b,b),b.add=hx,b.attempt=Mp,b.camelCase=gS,b.capitalize=kp,b.ceil=dx,b.clamp=dS,b.clone=aw,b.cloneDeep=uw,b.cloneDeepWith=cw,b.cloneWith=lw,b.conformsTo=fw,b.deburr=_p,b.defaultTo=KS,b.divide=px,b.endsWith=yS,b.eq=en,b.escape=bS,b.escapeRegExp=vS,b.every=M5,b.find=C5,b.findIndex=jd,b.findKey=$w,b.findLast=A5,b.findLastIndex=Yd,b.findLastKey=Ww,b.floor=mx,b.forEach=np,b.forEachRight=rp,b.forIn=Uw,b.forInRight=Vw,b.forOwn=Kw,b.forOwnRight=Gw,b.get=Mu,b.gt=hw,b.gte=dw,b.has=jw,b.hasIn=Tu,b.head=Zd,b.identity=mt,b.includes=L5,b.indexOf=Av,b.inRange=pS,b.invoke=Zw,b.isArguments=Nr,b.isArray=ee,b.isArrayBuffer=pw,b.isArrayLike=dt,b.isArrayLikeObject=Ae,b.isBoolean=mw,b.isBuffer=rr,b.isDate=gw,b.isElement=yw,b.isEmpty=bw,b.isEqual=vw,b.isEqualWith=ww,b.isError=_u,b.isFinite=Sw,b.isFunction=An,b.isInteger=fp,b.isLength=Do,b.isMap=hp,b.isMatch=xw,b.isMatchWith=kw,b.isNaN=_w,b.isNative=Ew,b.isNil=Tw,b.isNull=Mw,b.isNumber=dp,b.isObject=Me,b.isObjectLike=Ce,b.isPlainObject=ps,b.isRegExp=Eu,b.isSafeInteger=Cw,b.isSet=pp,b.isString=zo,b.isSymbol=kt,b.isTypedArray=pi,b.isUndefined=Aw,b.isWeakMap=Iw,b.isWeakSet=Ow,b.join=Lv,b.kebabCase=wS,b.last=zt,b.lastIndexOf=Pv,b.lowerCase=SS,b.lowerFirst=xS,b.lt=Nw,b.lte=Rw,b.max=gx,b.maxBy=yx,b.mean=bx,b.meanBy=vx,b.min=wx,b.minBy=Sx,b.stubArray=Ru,b.stubFalse=Lu,b.stubObject=ox,b.stubString=ax,b.stubTrue=lx,b.multiply=xx,b.nth=Dv,b.noConflict=ZS,b.noop=Nu,b.now=Ro,b.pad=kS,b.padEnd=_S,b.padStart=ES,b.parseInt=MS,b.random=mS,b.reduce=F5,b.reduceRight=H5,b.repeat=TS,b.replace=CS,b.result=sS,b.round=kx,b.runInContext=_,b.sample=W5,b.size=K5,b.snakeCase=AS,b.some=G5,b.sortedIndex=Uv,b.sortedIndexBy=Vv,b.sortedIndexOf=Kv,b.sortedLastIndex=Gv,b.sortedLastIndexBy=qv,b.sortedLastIndexOf=Jv,b.startCase=OS,b.startsWith=NS,b.subtract=_x,b.sum=Ex,b.sumBy=Mx,b.template=RS,b.times=ux,b.toFinite=In,b.toInteger=te,b.toLength=gp,b.toLower=LS,b.toNumber=Bt,b.toSafeInteger=Lw,b.toString=ye,b.toUpper=PS,b.trim=DS,b.trimEnd=zS,b.trimStart=BS,b.truncate=FS,b.unescape=HS,b.uniqueId=fx,b.upperCase=$S,b.upperFirst=Cu,b.each=np,b.eachRight=rp,b.first=Zd,Ou(b,function(){var s={};return cn(b,function(a,c){ve.call(b.prototype,c)||(s[c]=a)}),s}(),{chain:!1}),b.VERSION=r,Nt(["bind","bindKey","curry","curryRight","partial","partialRight"],function(s){b[s].placeholder=b}),Nt(["drop","take"],function(s,a){ue.prototype[s]=function(c){c=c===t?1:Pe(te(c),0);var d=this.__filtered__&&!a?new ue(this):this.clone();return d.__filtered__?d.__takeCount__=tt(c,d.__takeCount__):d.__views__.push({size:tt(c,$e),type:s+(d.__dir__<0?"Right":"")}),d},ue.prototype[s+"Right"]=function(c){return this.reverse()[s](c).reverse()}}),Nt(["filter","map","takeWhile"],function(s,a){var c=a+1,d=c==Jt||c==Be;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}}),Nt(["head","last"],function(s,a){var c="take"+(a?"Right":"");ue.prototype[s]=function(){return this[c](1).value()[0]}}),Nt(["initial","tail"],function(s,a){var c="drop"+(a?"":"Right");ue.prototype[s]=function(){return this.__filtered__?new ue(this):this[c](1)}}),ue.prototype.compact=function(){return this.filter(mt)},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,a){return typeof s=="function"?new ue(this):this.map(function(c){return ls(c,s,a)})}),ue.prototype.reject=function(s){return this.filter(Po(J(s)))},ue.prototype.slice=function(s,a){s=te(s);var c=this;return c.__filtered__&&(s>0||a<0)?new ue(c):(s<0?c=c.takeRight(-s):s&&(c=c.drop(s)),a!==t&&(a=te(a),c=a<0?c.dropRight(-a):c.take(a-s)),c)},ue.prototype.takeRightWhile=function(s){return this.reverse().takeWhile(s).reverse()},ue.prototype.toArray=function(){return this.take($e)},cn(ue.prototype,function(s,a){var c=/^(?:filter|find|map|reject)|While$/.test(a),d=/^(?:head|last)$/.test(a),g=b[d?"take"+(a=="last"?"Right":""):a],v=d||/^find/.test(a);g&&(b.prototype[a]=function(){var x=this.__wrapped__,k=d?[1]:arguments,E=x instanceof ue,O=k[0],N=E||ee(x),R=function(ae){var fe=g.apply(b,Yn([ae],k));return d&&H?fe[0]:fe};N&&c&&typeof O=="function"&&O.length!=1&&(E=N=!1);var H=this.__chain__,K=!!this.__actions__.length,j=v&&!H,re=E&&!K;if(!v&&N){x=re?x:new ue(this);var Y=s.apply(x,k);return Y.__actions__.push({func:Oo,args:[R],thisArg:t}),new Lt(Y,H)}return j&&re?s.apply(this,k):(Y=this.thru(R),j?d?Y.value()[0]:Y.value():Y)})}),Nt(["pop","push","shift","sort","splice","unshift"],function(s){var a=no[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 a.apply(ee(v)?v:[],g)}return this[c](function(x){return a.apply(ee(x)?x:[],g)})}}),cn(ue.prototype,function(s,a){var c=b[a];if(c){var d=c.name+"";ve.call(ui,d)||(ui[d]=[]),ui[d].push({name:a,func:c})}}),ui[_o(t,I).name]=[{name:"wrapper",func:t}],ue.prototype.clone=H2,ue.prototype.reverse=$2,ue.prototype.value=W2,b.prototype.at=y5,b.prototype.chain=b5,b.prototype.commit=v5,b.prototype.next=w5,b.prototype.plant=x5,b.prototype.reverse=k5,b.prototype.toJSON=b.prototype.valueOf=b.prototype.value=_5,b.prototype.first=b.prototype.head,es&&(b.prototype[es]=S5),b},oi=v2();_r?((_r.exports=oi)._=oi,Il._=oi):Je._=oi}).call(QA)}(Us,Us.exports)),Us.exports}var D1=eI();function Wf(n){return n.type.create(D1.cloneDeep(n.attrs))}const tI=Ne.create({name:"node_processor",addCommands(){return{setBlockAttributes:P(({commands:n,state:e},t,r,i={})=>{const o=z(n.getBlockAttributes(t))??{},{doc:l,tr:u}=e,{from:f,to:h}=u.selection;l.nodesBetween(f,h,(m,p)=>{ne.blocks.includes(m.type.name)&&u.setNodeAttribute(p,t,{...i,...o,...r})})}),getBlockAttributes:P(({editor:n},e,t)=>pe(()=>{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:l,schema:u}=n,{$from:f,$to:h}=o.selection,m=dn(he.LINK,u),p=dn(t,u);if(!(p.spec.group||"").includes(on.SETTINGS))return e.setMark(t,r);if(f.pos===h.pos)return;const w=S=>{if(!i.onAppliedToParent||i.onAppliedToParent(S)===!1){const{tr:M,node:T,position:I,mark:F}=S;e._removeNodeMark({tr:M,node:T,position:I,mark:F.type})}};l.nodesBetween(f.pos,h.pos,(S,M)=>{if(S.type.name===ne.LIST)return;const T=ZA(S.marks,t),I=p.create({...T?.attrs||{},...r}),F=R1(f,h,S,M);if(!m.isInSet(S.marks)&&XA(o.doc,M,I,i.isAppliedToParent))return w({tr:o,node:S,position:M,mark:I});if(S.isText){o.addMark(F.from,F.to,I);return}jA(o.doc,o.selection,S,M)&&o.addNodeMark(M,I)})}),getMarks:P(({editor:n},e)=>{const t=vi(n,"state");return pe(()=>{const{selection:r,doc:i}=z(t),{from:o,to:l}=z(r),u=[];return i.nodesBetween(o,l,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 pe(()=>z(t)[0]??null)}),hasMark:P(({commands:n},e)=>{const t=n.getMark(e);return pe(()=>!!z(t))}),getCommonSettingMark:P(({commands:n},e,t)=>{const r=n.getMark(e);return pe(()=>z(r)?.value??z(t))}),getDeviceSettingMark:P(({commands:n},e,t)=>{const r=n.getMarks(e),i=n.getDevice();return pe(()=>{for(const o of z(r)){const l=o[z(i)];if(l)return l}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,(l,u)=>{for(const f of l.marks)e._removeNodeMark({tr:t,node:l,position:u,mark:f})})}),removeMarks:P(({state:n,commands:e},t)=>{const{tr:r,doc:i}=n,{from:o,to:l}=r.selection;i.nodesBetween(o,l,(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))}}}),nI=Ne.create({name:"text_processor",addCommands(){return{getSelectedText:P(({state:n})=>{const{from:e,to:t}=n.selection;return n.doc.textBetween(e,t," ")}),transformText:P(({state:n},e)=>{const{$from:t,$to:r}=n.tr.selection;t.pos!==r.pos&&n.doc.nodesBetween(t.pos,r.pos,(i,o)=>{if(!i.isText)return;const l=R1(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(l.from,l.to,m)})})}}}),rI=Ne.create({name:"selection_processor",addStorage:()=>({selection:null}),addCommands(){return{storeSelection:P(({state:n})=>{this.storage.selection=n.selection}),restoreSelection:P(({commands:n})=>{this.storage.selection&&n.setTextSelection(this.storage.selection)}),expandSelection:P(({tr:n,commands:e},t)=>{let r=n.selection.from,i=n.selection.to;n.doc.nodesBetween(r,i,(o,l,u)=>{if(t({node:o,parent:u})){const f=o.isText?0:L1(n.doc,l);r=Math.min(r,l+f),i=Math.max(i,l+o.nodeSize-f)}}),e.setTextSelection({from:r,to:i})}),expandSelectionToBlock:P(({commands:n})=>{n.expandSelection(({parent:e})=>e.type.name===ne.DOCUMENT)})}}}),iI=Kn.create({name:"doc",topNode:!0,content:"block+"});class Ks extends rt{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=Br.fromJSON(this.schema,e.toJSON());return t.attrs.meta[this.key]=this.value,Re.ok(t)}invert(){return new Ks(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 Ks(e.key,e.value,e.stepType)}}rt.jsonID("setDocAttr",Ks);const sI=iI.extend({marks:on.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 Ks(e,t,n.schema))})}}}),oI=Kn.create({name:"paragraph",priority:1e3,addOptions(){return{HTMLAttributes:{}}},group:"block",content:"inline*",parseHTML(){return[{tag:"p"}]},renderHTML({HTMLAttributes:n}){return["p",Ni(this.options.HTMLAttributes,n),0]},addCommands(){return{setParagraph:()=>({commands:n})=>n.setNode(this.name)}},addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}}),aI=oI.extend({marks:on.ALL,addOptions:()=>({HTMLAttributes:{class:"zw-style"}})}),lI=Kn.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]}`,Ni(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=>$T({find:new RegExp(`^(#{1,${n}})\\s$`),type:this.type,getAttributes:{level:n}}))}}),uI=lI.extend({marks:on.ALL,addOptions:()=>({levels:[1,2,3,4],HTMLAttributes:{class:"zw-style"}})}),cI=Ne.create({name:"prose_mirror_plugins",addProseMirrorPlugins(){return[eC.create(this.editor),tC.create(this.editor)]}}),fI=()=>[sI,aI,uI,VT,QT,tI,nI,rI,cI],hI=Ct.create({name:he.FONT_FAMILY,group:on.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 pe(()=>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 pe(()=>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 Jr({font_family:e})}}),dI=Ne.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 l=t[o],u=r[o],f=!u||u.toLowerCase()==="inherit";i[o]=f?l:u}return i}return{getPresetList:P(()=>pe(()=>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(),l=t.getLinkPreset();return pe(()=>{const u=n(z(i),z(r).id);if(!z(o))return u;const f=z(l);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()),l=n(o,i),u=l.node?.type??ne.PARAGRAPH,f={preset:{id:i}};l.node&&(f.level=l.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=vi(t,"state");return pe(()=>{const{selection:o,doc:l}=z(i),{from:u,to:f}=o;return r._getSettingCustomization(l,u,f)})}),isSettingCustomized:P(({commands:t},r)=>{const i=t.getPresetCustomization(),o=he.presetAttributes.includes(r)?"attributes":"marks";return pe(()=>z(i)[o]?.includes(r)??!1)}),getContentCustomization:P(({editor:t,commands:r})=>{const i=vi(t,"state");return pe(()=>{const{doc:o}=z(i);return r._getSettingCustomization(o,0,o.content.size)})}),_getSettingCustomization:P((t,r,i,o)=>{const l=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)&&l.add(h.name)}),{attributes:Array.from(u),marks:Array.from(l)}}),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($i.head,z(this.options.presets))}}),pI=Ct.create({name:he.FONT_WEIGHT,group:on.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 pe(()=>{const r=z(e),i=z(t);return i.isWeightSupported(r)?r:i.findClosestWeight(r)})}),getDefaultFontWeight:P(({commands:n})=>{const e=n.getPreset();return pe(()=>z(e).common.font_weight)})}},addKeyboardShortcuts:()=>({"Mod-b":Ut("toggleBold"),"Mod-B":Ut("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 Jr({font_weight:n.value})}}),mI=Ct.create({name:he.FONT_SIZE,group:on.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 pe(()=>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:l})=>{const u={...l.attrs,[t]:null};if(!Object.values(u).some(m=>!!m))return!1;const h=l.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-=":Ut("increaseFontSize"),"Mod-Shift--":Ut("decreaseFontSize")}),parseHTML(){const n=e=>{if(!e)return null;const t=z(this.options.wrapperRef),r=N1(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 Jr({font_size_mobile:e(n.mobile),font_size_tablet:e(n.tablet),font_size_desktop:e(n.desktop)})}}),gI=Ct.create({name:he.FONT_COLOR,group:on.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 pe(()=>z(e).common.color)}),applyFontColor:P(({commands:n},e)=>{n.applyMark(this.name,{value:e})})}},parseHTML(){const n=e=>({value:O1(e)});return[{style:"--zw-font-color",getAttrs:n},{style:"color",getAttrs:n}]},renderHTML({HTMLAttributes:n}){return Jr({font_color:n.value})}}),yI=Ct.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:O1(e)});return[{style:"--zw-background-color",getAttrs:n},{style:"background-color",getAttrs:n}]},renderHTML({HTMLAttributes:n}){return Jr({background_color:n.value})}}),bI=Ne.create({name:"device_manager",addCommands(){return{getDevice:P(()=>vi(this.options,"device"))}}}),vI=Ct.create({name:he.FONT_STYLE,group:on.SETTINGS,addAttributes:()=>({italic:{required:!0}}),addCommands(){return{isItalic:P(({commands:n})=>{const e=n.getMark(this.name),t=n.getDefaultFontStyle();return pe(()=>z(e)?.italic??z(t).italic)}),isItalicAvailable:P(({commands:n})=>{const e=n.getFont(),t=n.getFontWeight();return pe(()=>{const r=z(e),i=z(t);return r.isItalicSupported(i)&&!r.isWeightItalicOnly(i)})}),getDefaultFontStyle:P(({commands:n})=>{const e=n.getPreset();return pe(()=>({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":Ut("toggleItalic"),"Mod-I":Ut("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 Jr({font_style:e})}}),wI=Ct.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 pe(()=>z(e).underline)}),isStrikeThrough:P(({commands:n})=>{const e=n.getTextDecoration();return pe(()=>z(e).strike_through)}),getTextDecoration:P(({commands:n})=>{const e=n.getMark(this.name),t=n.getDefaultTextDecoration();return pe(()=>{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 pe(()=>z(e)!==z(t).underline)}),getDefaultTextDecoration:P(({commands:n})=>{const e=n.getPreset();return pe(()=>{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":Ut("toggleUnderline"),"Mod-U":Ut("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"),Jr({text_decoration:e.join(" ")})}}),SI=Ne.create({name:"case_style",addCommands(){return{applyCaseStyle:P(({commands:n},e)=>{switch(e){case of.CAPITALIZE:return n.applyCapitalize();case of.LOWERCASE:return n.applyLowerCase();case of.UPPERCASE:return n.applyUpperCase()}}),applyCapitalize:P(({commands:n})=>{n.transformText(({text:e})=>xC(e))}),applyLowerCase:P(({commands:n})=>{n.transformText(({text:e})=>e.toLowerCase())}),applyUpperCase:P(({commands:n})=>{n.transformText(({text:e})=>e.toUpperCase())})}}}),z1={mobile:null,tablet:null,desktop:null},xI=Ne.create({name:he.ALIGNMENT,addGlobalAttributes:()=>[{types:[ne.PARAGRAPH,ne.HEADING],attributes:{[he.ALIGNMENT]:{isRequired:!1,parseHTML({style:n}){const e=JA(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?Xa({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},z1)}),removeAlignment:P(({commands:n})=>n.removeBlockAttributes(this.name)),getAlignment:P(({commands:n})=>{const e=n.getBlockAttributes(this.name,z1),t=n.getDevice(),r=n.getDefaultAlignment();return pe(()=>z(e)?.[z(t)]??z(r))}),getDefaultAlignment:P(({commands:n})=>{const e=n.getDevice(),t=n.getPreset();return pe(()=>z(t)[z(e)].alignment??yr.LEFT)})}},addKeyboardShortcuts:()=>({"Mod-Shift-l":Ut("applyAlignment",yr.LEFT),"Mod-Shift-e":Ut("applyAlignment",yr.CENTER),"Mod-Shift-r":Ut("applyAlignment",yr.RIGHT),"Mod-Shift-j":Ut("applyAlignment",yr.JUSTIFY)})}),B1={mobile:null,tablet:null,desktop:null},kI=Ne.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,l=n.style.getPropertyValue("--zw-line-height-desktop")||null;return{mobile:null,tablet:o,desktop:l}}const e=n.style.lineHeight;if(!e)return null;const t=z(this.options.wrapperRef),r=GA(e,n,t);return r?{desktop:r,tablet:r,mobile:null}:null},renderHTML(n){return n.line_height?Xa({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,B1),t=n.getDevice(),r=n.getDefaultLineHeight();return pe(()=>z(e)?.[z(t)]??z(r))}),getDefaultLineHeight:P(({commands:n})=>{const e=n.getDevice(),t=n.getPreset();return pe(()=>z(t)[z(e)].line_height)}),applyLineHeight:P(({commands:n},e)=>{const t=z(n.getDevice());n.setBlockAttributes(this.name,{[t]:e},B1)})}}}),_I=Kn.create({name:"listItem",addOptions(){return{HTMLAttributes:{},bulletListTypeName:"bulletList",orderedListTypeName:"orderedList"}},content:"paragraph block*",defining:!0,parseHTML(){return[{tag:"li"}]},renderHTML({HTMLAttributes:n}){return["li",Ni(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)}}}),EI=_I.extend({name:ne.LIST_ITEM,marks:on.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 l of r.marks)t.addNodeMark(o,Wf(l));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()}})}),MI=Kn.create({name:ne.LIST,content:`${ne.LIST_ITEM}+`,group:"block list",marks:on.SETTINGS,addExtensions:()=>[EI],addOptions:()=>({baseClass:"",presetClass:""}),addAttributes:()=>({bullet:{default:{type:$t.DISC}}}),parseHTML(){const n={a:$t.ROMAN,i:$t.LATIN,1:$t.DECIMAL},e=t=>{for(const r of $t.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)||$t.DECIMAL}})},{tag:"ul",getAttrs:t=>({bullet:{type:e(t)||$t.DISC}})}]},renderHTML({HTMLAttributes:n}){const e=[z(this.options.baseClass)+n.bullet.type,z(this.options.presetClass)];return[$t.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 pe(()=>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 l(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}l(u,p)&&(e.removeNodeMark(f+1,p),e.addNodeMark(f,Wf(p)),h.push(p))}}),!1})}),removeList:P(({commands:n,state:e})=>{const{tr:t,doc:r,selection:i}=e,o=i.$from.start(),l=i.$to.end();r.nodesBetween(o,l,(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,Wf(p));return!1}),n.liftListItem(ne.LIST_ITEM)})}},addInputRules(){const n=(e,t)=>WT({find:t,type:this.type,getAttributes:{bullet:{type:e}},joinPredicate:(r,{attrs:i})=>i.bullet.type===e});return[n($t.DISC,/^\s*([-+*])\s$/),n($t.DECIMAL,/^(\d+)\.\s$/),n($t.LATIN,/^([ivx]{1,3})\.\s$/i),n($t.ROMAN,/^([a-z])\.\s$/i)]}});function TI(n){return new Mt({key:new rn("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:l}=r,u=cT(t.doc,[...e]);if(vT(u).forEach(({newRange:h})=>{const m=hT(r.doc,h,w=>w.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 w=y.split(" ").filter(T=>T!=="");if(w.length<=0)return!1;const S=w[w.length-1],M=p.pos+y.lastIndexOf(S);if(!S)return!1;Mf(S).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=>{o0(T.from,T.to,r.doc).some(I=>I.mark.type===n.type)||l.addMark(T.from,T.to,n.type.create({href:T.href}))})}}),!!l.steps.length)return l}})}function CI(n){return new Mt({key:new rn("handleClickLink"),props:{handleClick:(e,t,r)=>{var i,o;if(r.button!==0||r.target.nodeName!=="A")return!1;const u=gT(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 AI(n){return new Mt({key:new rn("handlePasteLink"),props:{handlePaste:(e,t,r)=>{var i;const{state:o}=e,{selection:l}=o,{empty:u}=l;if(u)return!1;let f="";r.content.forEach(S=>{f+=S.textContent});const h=Mf(f).find(S=>S.isLink&&S.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),w=y?y[1]:h.href;return n.editor.commands.setMark(n.type,{href:w}),!0}}})}const II=Ct.create({name:"link",priority:1e3,keepOnSplit:!1,onCreate(){this.options.protocols.forEach(n=>{if(typeof n=="string"){I0(n);return}I0(n.scheme,n.optionalSlashes)})},onDestroy(){bC()},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",Ni(this.options.HTMLAttributes,{...n,href:""}),0]:["a",Ni(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[UT({find:n=>Mf(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="([^"]*)"/,l=i?.match(o);return l?{href:l[1]}:{href:(r=n.data)===null||r===void 0?void 0:r.href}}})]},addProseMirrorPlugins(){const n=[];return this.options.autolink&&n.push(TI({type:this.type,validate:this.options.validate})),this.options.openOnClick&&n.push(CI({type:this.type})),this.options.linkOnPaste&&n.push(AI({editor:this.editor,type:this.type})),n}}),OI=II.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:g0.SELF,parseHTML:n=>n.getAttribute("target")||g0.SELF},destination:{default:Rs.URL,parseHTML:n=>{const e=n.getAttribute("href");if(!e.startsWith("#"))return Rs.URL;const t=e.replace("#","");return z(this.options.pageBlocks).find(o=>o.id===parseInt(t))?Rs.BLOCK:Rs.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(H1.text(r.text,[H1.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(()=>pe(()=>z(this.options.preset)))}},addProseMirrorPlugins(){return[...this.parent(),SC.create(this.editor)]},renderHTML({HTMLAttributes:n}){const e=n.destination===Rs.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]}}),NI=Ct.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 pe(()=>!!z(e))})}},parseHTML(){return[{tag:"sup"},{style:"vertical-align",getAttrs:n=>n!=="super"?!1:null}]},renderHTML(){return["sup",{class:"zw-superscript"},0]}}),RI=Ne.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?Xa({margin:n.margin.value}):null}}}}]});function LI(n){const e=r=>n.presetsRef.value.find(i=>i.id===r),t=Yu({default:null,link:null});return Fk(n.presetsRef,()=>{t.default=e(n.defaultPresetId),t.link=e(n.linkPresetId)},{immediate:!0,deep:!0}),fI().concat([dI.configure({presets:n.presetsRef,defaultId:n.defaultPresetId,styleRenderer:new zI({baseClass:n.basePresetClass,makeVariable:n.makePresetVariable,linkPresetId:n.linkPresetId})}),MI.configure({baseClass:n.baseListClass,presetClass:n.basePresetClass+n.defaultPresetId}),bI.configure({device:n.deviceRef}),mI.configure({minSize:n.minFontSize,maxSize:n.maxFontSize,wrapperRef:n.wrapperRef}),hI.configure({fonts:n.fonts,defaultPreset:vi(t,"default"),defaultFont:n.defaultFont}),pI,gI,yI,vI,wI,SI,NI,xI,kI.configure({wrapperRef:n.wrapperRef}),OI.configure({preset:vi(t,"link"),basePresetClass:n.basePresetClass,pageBlocks:n.pageBlocksRef}),RI])}class PI{_domParser=new DOMParser;types=window;parse(e){return this._domParser.parseFromString(e,"text/html")}}class F1{content;constructor({content:e}){this.content=e}normalize(){throw new Error("Implement abstract method")}}class bn extends F1{static BLOCK_NODE_NAMES=["P","H1","H2","H3","H4"];static ROOT_NODE_NAMES=bn.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 l=u=>{this._assignElementProperties(u,e,bn.BLOCK_STYLES),t.append(u)};this._assignElementProperties(e,e.parentElement,bn.BLOCK_STYLES);for(const u of r){if(this._isBlockNode(u)){l(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),l(f),i=null,o=u;continue}i||(i=this.dom.createElement("p"),l(i)),i.append(u),o=u}e.append(t),this._removeStyleProperties(e,bn.BLOCK_STYLES),this._removeStyleProperties(e.parentElement,bn.BLOCK_STYLES),this._assignElementProperties(e,e.parentElement),e.parentElement.lastElementChild===e&&this._removeStyleProperties(e.parentElement)}_isBlockNode(e){return bn.BLOCK_NODE_NAMES.includes(e.tagName)}_isRootNode(e){return bn.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 l=u=>{this._assignElementProperties(u,e,bn.BLOCK_STYLES),t.append(u)};for(const u of r){if(u.tagName==="BR"){l(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),l={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(l).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 DI extends F1{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=>D1.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 hl{static build(e,t={}){return typeof e=="string"?this._buildHtml(e,t):this._buildJson(e)}static _buildHtml(e,t){return new bn({content:e,parser:t.parser||new PI})}static _buildJson(e){return new DI({content:e})}static normalize(e,t={}){return hl.build(e,t).normalize()}}class $i{static window=globalThis.window;static use(e){this.window=e}static get document(){return this.window.document}static get body(){return this.document.body}static get head(){return this.document.head}static getComputedStyle(e){return this.window.getComputedStyle(e)}}class Yf{static build({config:e,nodeDomParser:t}){const r=LI({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(sf.DESKTOP),pageBlocksRef:qo([]),wrapperRef:$i.document.createElement("p")}),i=pT(r);return new Yf({schema:i,domParser:lc.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=hl.build(e,{parser:this._nodeDomParser});return t.normalizeHTML(),this._domParser.parse(t.dom.body).toJSON()}}class H1{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 zI{_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=$i.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 l of sf.values)for(const u of Object.keys(r[l])){const f=this._makeVariable({device:l,preset:r,property:u}),h=this._makeInternalVariableName(u,l);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===sf.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 Xf{static _instance;static get instance(){return this._instance??=new Xf,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 BI{static createWindow(){return new Ap.JSDOM().window}types;parse(e){const{window:t}=new Ap.JSDOM(e);return this.types=t,t.document}}exports.ContentSerializer=Yf,exports.ContextWindow=$i,exports.NodeDomParser=BI;
|