reactjs-tiptap-editor 0.2.8 → 0.2.9

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.
@@ -11,7 +11,7 @@
11
11
  `,Z5="️",Y5="‍",Qc="";let Ho=null,Xo=null;function Q5(t=[]){const e={};St.groups=e;const n=new St;Ho==null&&(Ho=Sm(V5)),Xo==null&&(Xo=Sm(H5)),De(n,"'",Bh),De(n,"{",co),De(n,"}",lo),De(n,"[",cs),De(n,"]",ls),De(n,"(",us),De(n,")",fs),De(n,"<",ds),De(n,">",hs),De(n,"(",ps),De(n,")",gs),De(n,"「",ms),De(n,"」",ys),De(n,"『",bs),De(n,"』",vs),De(n,"<",xs),De(n,">",Ds),De(n,"&",ws),De(n,"*",_s),De(n,"@",Zn),De(n,"`",Es),De(n,"^",Cs),De(n,":",er),De(n,",",Ih),De(n,"$",Ss),De(n,".",ln),De(n,"=",As),De(n,"!",Mh),De(n,"-",$t),De(n,"%",uo),De(n,"|",Us),De(n,"+",ks),De(n,"#",Fs),De(n,"?",fo),De(n,'"',Wh),De(n,"/",un),De(n,";",Lh),De(n,"~",ho),De(n,"_",Os),De(n,"\\",Ts),De(n,"・",Tx);const r=Ze(n,Cn,Rh,{[Ud]:!0});Ze(r,Cn,r);const i=Ze(r,En,wx,{[so]:!0}),o=Ze(r,Pi,_x,{[no]:!0}),a=Ze(n,En,Un,{[kd]:!0});Ze(a,Cn,i),Ze(a,En,a),Ze(i,Cn,i),Ze(i,En,i);const s=Ze(n,Pi,Rd,{[Fd]:!0});Ze(s,En),Ze(s,Cn,o),Ze(s,Pi,s),Ze(o,Cn,o),Ze(o,En),Ze(o,Pi,o);const c=De(n,Yc,Nh,{[Kc]:!0}),l=De(n,Cm,Id,{[Kc]:!0}),u=Ze(n,Zc,Id,{[Kc]:!0});De(n,Qc,u),De(l,Yc,c),De(l,Qc,u),Ze(l,Zc,u),De(u,Cm),De(u,Yc),Ze(u,Zc,u),De(u,Qc,u);const f=Ze(n,Jc,Ex,{[Dx]:!0});De(f,"#"),Ze(f,Jc,f),De(f,Z5,f);const d=De(f,Y5);De(d,"#"),Ze(d,Jc,f);const h=[[En,a],[Cn,i]],p=[[En,null],[Pi,s],[Cn,o]];for(let m=0;m<Ho.length;m++)Vn(n,Ho[m],Nd,Un,h);for(let m=0;m<Xo.length;m++)Vn(n,Xo[m],Bd,Rd,p);Ur(Nd,{tld:!0,ascii:!0},e),Ur(Bd,{utld:!0,alpha:!0},e),Vn(n,"file",_a,Un,h),Vn(n,"mailto",_a,Un,h),Vn(n,"http",ui,Un,h),Vn(n,"https",ui,Un,h),Vn(n,"ftp",ui,Un,h),Vn(n,"ftps",ui,Un,h),Ur(_a,{scheme:!0,ascii:!0},e),Ur(ui,{slashscheme:!0,ascii:!0},e),t=t.sort((m,g)=>m[0]>g[0]?1:-1);for(let m=0;m<t.length;m++){const g=t[m][0],b=t[m][1]?{[X5]:!0}:{[G5]:!0};g.indexOf("-")>=0?b[Od]=!0:En.test(g)?Cn.test(g)?b[so]=!0:b[kd]=!0:b[Ud]=!0,Em(n,g,g,b)}return Em(n,"localhost",Eo,{ascii:!0}),n.jd=new St(Rs),{start:n,tokens:Ei({groups:e},Cx)}}function Sx(t,e){const n=e8(e.replace(/[A-Z]/g,s=>s.toLowerCase())),r=n.length,i=[];let o=0,a=0;for(;a<r;){let s=t,c=null,l=0,u=null,f=-1,d=-1;for(;a<r&&(c=s.go(n[a]));)s=c,s.accepts()?(f=0,d=0,u=s):f>=0&&(f+=n[a].length,d++),l+=n[a].length,o+=n[a].length,a++;o-=f,a-=d,l-=f,i.push({t:u.t,v:e.slice(o-l,o),s:o-l,e:o})}return i}function e8(t){const e=[],n=t.length;let r=0;for(;r<n;){let i=t.charCodeAt(r),o,a=i<55296||i>56319||r+1===n||(o=t.charCodeAt(r+1))<56320||o>57343?t[r]:t.slice(r,r+2);e.push(a),r+=a.length}return e}function Vn(t,e,n,r,i){let o;const a=e.length;for(let s=0;s<a-1;s++){const c=e[s];t.j[c]?o=t.j[c]:(o=new St(r),o.jr=i.slice(),t.j[c]=o),t=o}return o=new St(n),o.jr=i.slice(),t.j[e[a-1]]=o,o}function Sm(t){const e=[],n=[];let r=0,i="0123456789";for(;r<t.length;){let o=0;for(;i.indexOf(t[r+o])>=0;)o++;if(o>0){e.push(n.join(""));for(let a=parseInt(t.substring(r,r+o),10);a>0;a--)n.pop();r+=o}else n.push(t[r]),r++}return e}const Co={defaultProtocol:"http",events:null,format:Am,formatHref:Am,nl2br:!1,tagName:"a",target:null,rel:null,validate:!0,truncate:1/0,className:null,attributes:null,ignoreTags:[],render:null};function Ph(t,e=null){let n=Ei({},Co);t&&(n=Ei(n,t instanceof Ph?t.o:t));const r=n.ignoreTags,i=[];for(let o=0;o<r.length;o++)i.push(r[o].toUpperCase());this.o=n,e&&(this.defaultRender=e),this.ignoreTags=i}Ph.prototype={o:Co,ignoreTags:[],defaultRender(t){return t},check(t){return this.get("validate",t.toString(),t)},get(t,e,n){const r=e!=null;let i=this.o[t];return i&&(typeof i=="object"?(i=n.t in i?i[n.t]:Co[t],typeof i=="function"&&r&&(i=i(e,n))):typeof i=="function"&&r&&(i=i(e,n.t,n)),i)},getObj(t,e,n){let r=this.o[t];return typeof r=="function"&&e!=null&&(r=r(e,n.t,n)),r},render(t){const e=t.render(this);return(this.get("render",null,t)||this.defaultRender)(e,t.t,t)}};function Am(t){return t}function Ax(t,e){this.t="token",this.v=t,this.tk=e}Ax.prototype={isLink:!1,toString(){return this.v},toHref(t){return this.toString()},toFormattedString(t){const e=this.toString(),n=t.get("truncate",e,this),r=t.get("format",e,this);return n&&r.length>n?r.substring(0,n)+"…":r},toFormattedHref(t){return t.get("formatHref",this.toHref(t.get("defaultProtocol")),this)},startIndex(){return this.tk[0].s},endIndex(){return this.tk[this.tk.length-1].e},toObject(t=Co.defaultProtocol){return{type:this.t,value:this.toString(),isLink:this.isLink,href:this.toHref(t),start:this.startIndex(),end:this.endIndex()}},toFormattedObject(t){return{type:this.t,value:this.toFormattedString(t),isLink:this.isLink,href:this.toFormattedHref(t),start:this.startIndex(),end:this.endIndex()}},validate(t){return t.get("validate",this.toString(),this)},render(t){const e=this,n=this.toHref(t.get("defaultProtocol")),r=t.get("formatHref",n,this),i=t.get("tagName",n,e),o=this.toFormattedString(t),a={},s=t.get("className",n,e),c=t.get("target",n,e),l=t.get("rel",n,e),u=t.getObj("attributes",n,e),f=t.getObj("events",n,e);return a.href=r,s&&(a.class=s),c&&(a.target=c),l&&(a.rel=l),u&&Ei(a,u),{tagName:i,attributes:a,content:o,eventListeners:f}}};function Js(t,e){class n extends Ax{constructor(i,o){super(i,o),this.t=t}}for(const r in e)n.prototype[r]=e[r];return n.t=t,n}const Um=Js("email",{isLink:!0,toHref(){return"mailto:"+this.toString()}}),km=Js("text"),t8=Js("nl"),Go=Js("url",{isLink:!0,toHref(t=Co.defaultProtocol){return this.hasProtocol()?this.v:`${t}://${this.v}`},hasProtocol(){const t=this.tk;return t.length>=2&&t[0].t!==Eo&&t[1].t===er}}),qt=t=>new St(t);function n8({groups:t}){const e=t.domain.concat([ws,_s,Zn,Ts,Es,Cs,Ss,As,$t,Rh,uo,Us,ks,Fs,un,Rs,ho,Os]),n=[er,Ih,ln,Mh,uo,fo,Wh,Lh,ds,hs,co,lo,ls,cs,us,fs,ps,gs,ms,ys,bs,vs,xs,Ds],r=[ws,Bh,_s,Ts,Es,Cs,Ss,As,$t,co,lo,uo,Us,ks,Fs,fo,un,Rs,ho,Os],i=qt(),o=De(i,ho);Ne(o,r,o),Ne(o,t.domain,o);const a=qt(),s=qt(),c=qt();Ne(i,t.domain,a),Ne(i,t.scheme,s),Ne(i,t.slashscheme,c),Ne(a,r,o),Ne(a,t.domain,a);const l=De(a,Zn);De(o,Zn,l),De(s,Zn,l),De(c,Zn,l);const u=De(o,ln);Ne(u,r,o),Ne(u,t.domain,o);const f=qt();Ne(l,t.domain,f),Ne(f,t.domain,f);const d=De(f,ln);Ne(d,t.domain,f);const h=qt(Um);Ne(d,t.tld,h),Ne(d,t.utld,h),De(l,Eo,h);const p=De(f,$t);De(p,$t,p),Ne(p,t.domain,f),Ne(h,t.domain,f),De(h,ln,d),De(h,$t,p);const m=De(h,er);Ne(m,t.numeric,Um);const g=De(a,$t),y=De(a,ln);De(g,$t,g),Ne(g,t.domain,a),Ne(y,r,o),Ne(y,t.domain,a);const b=qt(Go);Ne(y,t.tld,b),Ne(y,t.utld,b),Ne(b,t.domain,a),Ne(b,r,o),De(b,ln,y),De(b,$t,g),De(b,Zn,l);const v=De(b,er),T=qt(Go);Ne(v,t.numeric,T);const w=qt(Go),E=qt();Ne(w,e,w),Ne(w,n,E),Ne(E,e,w),Ne(E,n,E),De(b,un,w),De(T,un,w);const S=De(s,er),U=De(c,er),C=De(U,un),R=De(C,un);Ne(s,t.domain,a),De(s,ln,y),De(s,$t,g),Ne(c,t.domain,a),De(c,ln,y),De(c,$t,g),Ne(S,t.domain,w),De(S,un,w),De(S,fo,w),Ne(R,t.domain,w),Ne(R,e,w),De(R,un,w);const L=[[co,lo],[cs,ls],[us,fs],[ds,hs],[ps,gs],[ms,ys],[bs,vs],[xs,Ds]];for(let _=0;_<L.length;_++){const[k,x]=L[_],z=De(w,k);De(E,k,z),De(z,x,w);const F=qt(Go);Ne(z,e,F);const I=qt();Ne(z,n),Ne(F,e,F),Ne(F,n,I),Ne(I,e,F),Ne(I,n,I),De(F,x,w),De(I,x,w)}return De(i,Eo,b),De(i,Nh,t8),{start:i,tokens:Cx}}function r8(t,e,n){let r=n.length,i=0,o=[],a=[];for(;i<r;){let s=t,c=null,l=null,u=0,f=null,d=-1;for(;i<r&&!(c=s.go(n[i].t));)a.push(n[i++]);for(;i<r&&(l=c||s.go(n[i].t));)c=null,s=l,s.accepts()?(d=0,f=s):d>=0&&d++,i++,u++;if(d<0)i-=u,i<r&&(a.push(n[i]),i++);else{a.length>0&&(o.push(el(km,e,a)),a=[]),i-=d,u-=d;const h=f.t,p=n.slice(i-u,i);o.push(el(h,e,p))}}return a.length>0&&o.push(el(km,e,a)),o}function el(t,e,n){const r=n[0].s,i=n[n.length-1].e,o=e.slice(r,i);return new t(o,n)}const i8=typeof console<"u"&&console&&console.warn||(()=>{}),o8="until manual call of linkify.init(). Register all schemes and plugins before invoking linkify the first time.",Ge={scanner:null,parser:null,tokenQueue:[],pluginQueue:[],customSchemes:[],initialized:!1};function a8(){return St.groups={},Ge.scanner=null,Ge.parser=null,Ge.tokenQueue=[],Ge.pluginQueue=[],Ge.customSchemes=[],Ge.initialized=!1,Ge}function s8(t,e=!1){if(Ge.initialized&&i8(`linkifyjs: already initialized - will not register custom scheme "${t}" ${o8}`),!/^[0-9a-z]+(-[0-9a-z]+)*$/.test(t))throw new Error(`linkifyjs: incorrect scheme format.
12
12
  1. Must only contain digits, lowercase ASCII letters or "-"
13
13
  2. Cannot start or end with "-"
14
- 3. "-" cannot repeat`);Ge.customSchemes.push([t,e])}function c8(){Ge.scanner=Q5(Ge.customSchemes);for(let t=0;t<Ge.tokenQueue.length;t++)Ge.tokenQueue[t][1]({scanner:Ge.scanner});Ge.parser=n8(Ge.scanner.tokens);for(let t=0;t<Ge.pluginQueue.length;t++)Ge.pluginQueue[t][1]({scanner:Ge.scanner,parser:Ge.parser});return Ge.initialized=!0,Ge}function qh(t){return Ge.initialized||c8(),r8(Ge.parser.start,t,Sx(Ge.scanner.start,t))}qh.scan=Sx;function l8(t,e=null,n=null){if(e&&typeof e=="object"){if(n)throw Error(`linkifyjs: Invalid link type ${e}; must be a string`);n=e,e=null}const r=new Ph(n),i=qh(t),o=[];for(let a=0;a<i.length;a++){const s=i[a];s.isLink&&(!e||s.t===e)&&r.check(s)&&o.push(s.toFormattedObject(r))}return o}var Ns=200,st=function(){};st.prototype.append=function(e){return e.length?(e=st.from(e),!this.length&&e||e.length<Ns&&this.leafAppend(e)||this.length<Ns&&e.leafPrepend(this)||this.appendInner(e)):this};st.prototype.prepend=function(e){return e.length?st.from(e).append(this):this};st.prototype.appendInner=function(e){return new u8(this,e)};st.prototype.slice=function(e,n){return e===void 0&&(e=0),n===void 0&&(n=this.length),e>=n?st.empty:this.sliceInner(Math.max(0,e),Math.min(this.length,n))};st.prototype.get=function(e){if(!(e<0||e>=this.length))return this.getInner(e)};st.prototype.forEach=function(e,n,r){n===void 0&&(n=0),r===void 0&&(r=this.length),n<=r?this.forEachInner(e,n,r,0):this.forEachInvertedInner(e,n,r,0)};st.prototype.map=function(e,n,r){n===void 0&&(n=0),r===void 0&&(r=this.length);var i=[];return this.forEach(function(o,a){return i.push(e(o,a))},n,r),i};st.from=function(e){return e instanceof st?e:e&&e.length?new Ux(e):st.empty};var Ux=function(t){function e(r){t.call(this),this.values=r}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var n={length:{configurable:!0},depth:{configurable:!0}};return e.prototype.flatten=function(){return this.values},e.prototype.sliceInner=function(i,o){return i==0&&o==this.length?this:new e(this.values.slice(i,o))},e.prototype.getInner=function(i){return this.values[i]},e.prototype.forEachInner=function(i,o,a,s){for(var c=o;c<a;c++)if(i(this.values[c],s+c)===!1)return!1},e.prototype.forEachInvertedInner=function(i,o,a,s){for(var c=o-1;c>=a;c--)if(i(this.values[c],s+c)===!1)return!1},e.prototype.leafAppend=function(i){if(this.length+i.length<=Ns)return new e(this.values.concat(i.flatten()))},e.prototype.leafPrepend=function(i){if(this.length+i.length<=Ns)return new e(i.flatten().concat(this.values))},n.length.get=function(){return this.values.length},n.depth.get=function(){return 0},Object.defineProperties(e.prototype,n),e}(st);st.empty=new Ux([]);var u8=function(t){function e(n,r){t.call(this),this.left=n,this.right=r,this.length=n.length+r.length,this.depth=Math.max(n.depth,r.depth)+1}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.flatten=function(){return this.left.flatten().concat(this.right.flatten())},e.prototype.getInner=function(r){return r<this.left.length?this.left.get(r):this.right.get(r-this.left.length)},e.prototype.forEachInner=function(r,i,o,a){var s=this.left.length;if(i<s&&this.left.forEachInner(r,i,Math.min(o,s),a)===!1||o>s&&this.right.forEachInner(r,Math.max(i-s,0),Math.min(this.length,o)-s,a+s)===!1)return!1},e.prototype.forEachInvertedInner=function(r,i,o,a){var s=this.left.length;if(i>s&&this.right.forEachInvertedInner(r,i-s,Math.max(o,s)-s,a+s)===!1||o<s&&this.left.forEachInvertedInner(r,Math.min(i,s),o,a)===!1)return!1},e.prototype.sliceInner=function(r,i){if(r==0&&i==this.length)return this;var o=this.left.length;return i<=o?this.left.slice(r,i):r>=o?this.right.slice(r-o,i-o):this.left.slice(r,o).append(this.right.slice(0,i-o))},e.prototype.leafAppend=function(r){var i=this.right.leafAppend(r);if(i)return new e(this.left,i)},e.prototype.leafPrepend=function(r){var i=this.left.leafPrepend(r);if(i)return new e(i,this.right)},e.prototype.appendInner=function(r){return this.left.depth>=Math.max(this.right.depth,r.depth)+1?new e(this.left,new e(this.right,r)):new e(this,r)},e}(st);const f8=500;class nn{constructor(e,n){this.items=e,this.eventCount=n}popEvent(e,n){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;n&&(i=this.remapping(r,this.items.length),o=i.maps.length);let a=e.tr,s,c,l=[],u=[];return this.items.forEach((f,d)=>{if(!f.step){i||(i=this.remapping(r,d+1),o=i.maps.length),o--,u.push(f);return}if(i){u.push(new fn(f.map));let h=f.step.map(i.slice(o)),p;h&&a.maybeStep(h).doc&&(p=a.mapping.maps[a.mapping.maps.length-1],l.push(new fn(p,void 0,void 0,l.length+u.length))),o--,p&&i.appendMap(p,o)}else a.maybeStep(f.step);if(f.selection)return s=i?f.selection.map(i.slice(o)):f.selection,c=new nn(this.items.slice(0,r).append(u.reverse().concat(l)),this.eventCount-1),!1},this.items.length,0),{remaining:c,transform:a,selection:s}}addTransform(e,n,r,i){let o=[],a=this.eventCount,s=this.items,c=!i&&s.length?s.get(s.length-1):null;for(let u=0;u<e.steps.length;u++){let f=e.steps[u].invert(e.docs[u]),d=new fn(e.mapping.maps[u],f,n),h;(h=c&&c.merge(d))&&(d=h,u?o.pop():s=s.slice(0,s.length-1)),o.push(d),n&&(a++,n=void 0),i||(c=d)}let l=a-r.depth;return l>h8&&(s=d8(s,l),a-=l),new nn(s.append(o),a)}remapping(e,n){let r=new di;return this.items.forEach((i,o)=>{let a=i.mirrorOffset!=null&&o-i.mirrorOffset>=e?r.maps.length-i.mirrorOffset:void 0;r.appendMap(i.map,a)},e,n),r}addMaps(e){return this.eventCount==0?this:new nn(this.items.append(e.map(n=>new fn(n))),this.eventCount)}rebased(e,n){if(!this.eventCount)return this;let r=[],i=Math.max(0,this.items.length-n),o=e.mapping,a=e.steps.length,s=this.eventCount;this.items.forEach(d=>{d.selection&&s--},i);let c=n;this.items.forEach(d=>{let h=o.getMirror(--c);if(h==null)return;a=Math.min(a,h);let p=o.maps[h];if(d.step){let m=e.steps[h].invert(e.docs[h]),g=d.selection&&d.selection.map(o.slice(c+1,h));g&&s++,r.push(new fn(p,m,g))}else r.push(new fn(p))},i);let l=[];for(let d=n;d<a;d++)l.push(new fn(o.maps[d]));let u=this.items.slice(0,i).append(l).append(r),f=new nn(u,s);return f.emptyItemCount()>f8&&(f=f.compress(this.items.length-r.length)),f}emptyItemCount(){let e=0;return this.items.forEach(n=>{n.step||e++}),e}compress(e=this.items.length){let n=this.remapping(0,e),r=n.maps.length,i=[],o=0;return this.items.forEach((a,s)=>{if(s>=e)i.push(a),a.selection&&o++;else if(a.step){let c=a.step.map(n.slice(r)),l=c&&c.getMap();if(r--,l&&n.appendMap(l,r),c){let u=a.selection&&a.selection.map(n.slice(r));u&&o++;let f=new fn(l.invert(),c,u),d,h=i.length-1;(d=i.length&&i[h].merge(f))?i[h]=d:i.push(f)}}else a.map&&r--},this.items.length,0),new nn(st.from(i.reverse()),o)}}nn.empty=new nn(st.empty,0);function d8(t,e){let n;return t.forEach((r,i)=>{if(r.selection&&e--==0)return n=i,!1}),t.slice(n)}class fn{constructor(e,n,r,i){this.map=e,this.step=n,this.selection=r,this.mirrorOffset=i}merge(e){if(this.step&&e.step&&!e.selection){let n=e.step.merge(this.step);if(n)return new fn(n.getMap().invert(),n,this.selection)}}}class Yn{constructor(e,n,r,i,o){this.done=e,this.undone=n,this.prevRanges=r,this.prevTime=i,this.prevComposition=o}}const h8=20;function p8(t,e,n,r){let i=n.getMeta(Nr),o;if(i)return i.historyState;n.getMeta(y8)&&(t=new Yn(t.done,t.undone,null,0,-1));let a=n.getMeta("appendedTransaction");if(n.steps.length==0)return t;if(a&&a.getMeta(Nr))return a.getMeta(Nr).redo?new Yn(t.done.addTransform(n,void 0,r,Ta(e)),t.undone,Fm(n.mapping.maps),t.prevTime,t.prevComposition):new Yn(t.done,t.undone.addTransform(n,void 0,r,Ta(e)),null,t.prevTime,t.prevComposition);if(n.getMeta("addToHistory")!==!1&&!(a&&a.getMeta("addToHistory")===!1)){let s=n.getMeta("composition"),c=t.prevTime==0||!a&&t.prevComposition!=s&&(t.prevTime<(n.time||0)-r.newGroupDelay||!g8(n,t.prevRanges)),l=a?tl(t.prevRanges,n.mapping):Fm(n.mapping.maps);return new Yn(t.done.addTransform(n,c?e.selection.getBookmark():void 0,r,Ta(e)),nn.empty,l,n.time,s??t.prevComposition)}else return(o=n.getMeta("rebased"))?new Yn(t.done.rebased(n,o),t.undone.rebased(n,o),tl(t.prevRanges,n.mapping),t.prevTime,t.prevComposition):new Yn(t.done.addMaps(n.mapping.maps),t.undone.addMaps(n.mapping.maps),tl(t.prevRanges,n.mapping),t.prevTime,t.prevComposition)}function g8(t,e){if(!e)return!1;if(!t.docChanged)return!0;let n=!1;return t.mapping.maps[0].forEach((r,i)=>{for(let o=0;o<e.length;o+=2)r<=e[o+1]&&i>=e[o]&&(n=!0)}),n}function Fm(t){let e=[];for(let n=t.length-1;n>=0&&e.length==0;n--)t[n].forEach((r,i,o,a)=>e.push(o,a));return e}function tl(t,e){if(!t)return null;let n=[];for(let r=0;r<t.length;r+=2){let i=e.map(t[r],1),o=e.map(t[r+1],-1);i<=o&&n.push(i,o)}return n}function m8(t,e,n){let r=Ta(e),i=Nr.get(e).spec.config,o=(n?t.undone:t.done).popEvent(e,r);if(!o)return null;let a=o.selection.resolve(o.transform.doc),s=(n?t.done:t.undone).addTransform(o.transform,e.selection.getBookmark(),i,r),c=new Yn(n?s:o.remaining,n?o.remaining:s,null,0,-1);return o.transform.setSelection(a).setMeta(Nr,{redo:n,historyState:c})}let nl=!1,Om=null;function Ta(t){let e=t.plugins;if(Om!=e){nl=!1,Om=e;for(let n=0;n<e.length;n++)if(e[n].spec.historyPreserveItems){nl=!0;break}}return nl}const Nr=new ki("history"),y8=new ki("closeHistory");function b8(t={}){return t={depth:t.depth||100,newGroupDelay:t.newGroupDelay||500},new jr({key:Nr,state:{init(){return new Yn(nn.empty,nn.empty,null,0,-1)},apply(e,n,r){return p8(n,r,e,t)}},config:t,props:{handleDOMEvents:{beforeinput(e,n){let r=n.inputType,i=r=="historyUndo"?Fx:r=="historyRedo"?Ox:null;return i?(n.preventDefault(),i(e.state,e.dispatch)):!1}}}})}function kx(t,e){return(n,r)=>{let i=Nr.getState(n);if(!i||(t?i.undone:i.done).eventCount==0)return!1;if(r){let o=m8(i,n,t);o&&r(e?o.scrollIntoView():o)}return!0}}const Fx=kx(!1,!0),Ox=kx(!0,!0);function v8(t={}){return new jr({view(e){return new x8(e,t)}})}class x8{constructor(e,n){var r;this.editorView=e,this.cursorPos=null,this.element=null,this.timeout=-1,this.width=(r=n.width)!==null&&r!==void 0?r:1,this.color=n.color===!1?void 0:n.color||"black",this.class=n.class,this.handlers=["dragover","dragend","drop","dragleave"].map(i=>{let o=a=>{this[i](a)};return e.dom.addEventListener(i,o),{name:i,handler:o}})}destroy(){this.handlers.forEach(({name:e,handler:n})=>this.editorView.dom.removeEventListener(e,n))}update(e,n){this.cursorPos!=null&&n.doc!=e.state.doc&&(this.cursorPos>e.state.doc.content.size?this.setCursor(null):this.updateOverlay())}setCursor(e){e!=this.cursorPos&&(this.cursorPos=e,e==null?(this.element.parentNode.removeChild(this.element),this.element=null):this.updateOverlay())}updateOverlay(){let e=this.editorView.state.doc.resolve(this.cursorPos),n=!e.parent.inlineContent,r;if(n){let s=e.nodeBefore,c=e.nodeAfter;if(s||c){let l=this.editorView.nodeDOM(this.cursorPos-(s?s.nodeSize:0));if(l){let u=l.getBoundingClientRect(),f=s?u.bottom:u.top;s&&c&&(f=(f+this.editorView.nodeDOM(this.cursorPos).getBoundingClientRect().top)/2),r={left:u.left,right:u.right,top:f-this.width/2,bottom:f+this.width/2}}}}if(!r){let s=this.editorView.coordsAtPos(this.cursorPos);r={left:s.left-this.width/2,right:s.left+this.width/2,top:s.top,bottom:s.bottom}}let i=this.editorView.dom.offsetParent;this.element||(this.element=i.appendChild(document.createElement("div")),this.class&&(this.element.className=this.class),this.element.style.cssText="position: absolute; z-index: 50; pointer-events: none;",this.color&&(this.element.style.backgroundColor=this.color)),this.element.classList.toggle("prosemirror-dropcursor-block",n),this.element.classList.toggle("prosemirror-dropcursor-inline",!n);let o,a;if(!i||i==document.body&&getComputedStyle(i).position=="static")o=-pageXOffset,a=-pageYOffset;else{let s=i.getBoundingClientRect();o=s.left-i.scrollLeft,a=s.top-i.scrollTop}this.element.style.left=r.left-o+"px",this.element.style.top=r.top-a+"px",this.element.style.width=r.right-r.left+"px",this.element.style.height=r.bottom-r.top+"px"}scheduleRemoval(e){clearTimeout(this.timeout),this.timeout=setTimeout(()=>this.setCursor(null),e)}dragover(e){if(!this.editorView.editable)return;let n=this.editorView.posAtCoords({left:e.clientX,top:e.clientY}),r=n&&n.inside>=0&&this.editorView.state.doc.nodeAt(n.inside),i=r&&r.type.spec.disableDropCursor,o=typeof i=="function"?i(this.editorView,n,e):i;if(n&&!o){let a=n.pos;if(this.editorView.dragging&&this.editorView.dragging.slice){let s=N0(this.editorView.state.doc,a,this.editorView.dragging.slice);s!=null&&(a=s)}this.setCursor(a),this.scheduleRemoval(5e3)}}dragend(){this.scheduleRemoval(20)}drop(){this.scheduleRemoval(20)}dragleave(e){(e.target==this.editorView.dom||!this.editorView.dom.contains(e.relatedTarget))&&this.setCursor(null)}}class Ye extends Fe{constructor(e){super(e,e)}map(e,n){let r=e.resolve(n.map(this.head));return Ye.valid(r)?new Ye(r):Fe.near(r)}content(){return _e.empty}eq(e){return e instanceof Ye&&e.head==this.head}toJSON(){return{type:"gapcursor",pos:this.head}}static fromJSON(e,n){if(typeof n.pos!="number")throw new RangeError("Invalid input for GapCursor.fromJSON");return new Ye(e.resolve(n.pos))}getBookmark(){return new zh(this.anchor)}static valid(e){let n=e.parent;if(n.isTextblock||!D8(e)||!w8(e))return!1;let r=n.type.spec.allowGapCursor;if(r!=null)return r;let i=n.contentMatchAt(e.index()).defaultType;return i&&i.isTextblock}static findGapCursorFrom(e,n,r=!1){e:for(;;){if(!r&&Ye.valid(e))return e;let i=e.pos,o=null;for(let a=e.depth;;a--){let s=e.node(a);if(n>0?e.indexAfter(a)<s.childCount:e.index(a)>0){o=s.child(n>0?e.indexAfter(a):e.index(a)-1);break}else if(a==0)return null;i+=n;let c=e.doc.resolve(i);if(Ye.valid(c))return c}for(;;){let a=n>0?o.firstChild:o.lastChild;if(!a){if(o.isAtom&&!o.isText&&!Ae.isSelectable(o)){e=e.doc.resolve(i+o.nodeSize*n),r=!1;continue e}break}o=a,i+=n;let s=e.doc.resolve(i);if(Ye.valid(s))return s}return null}}}Ye.prototype.visible=!1;Ye.findFrom=Ye.findGapCursorFrom;Fe.jsonID("gapcursor",Ye);class zh{constructor(e){this.pos=e}map(e){return new zh(e.map(this.pos))}resolve(e){let n=e.resolve(this.pos);return Ye.valid(n)?new Ye(n):Fe.near(n)}}function D8(t){for(let e=t.depth;e>=0;e--){let n=t.index(e),r=t.node(e);if(n==0){if(r.type.spec.isolating)return!0;continue}for(let i=r.child(n-1);;i=i.lastChild){if(i.childCount==0&&!i.inlineContent||i.isAtom||i.type.spec.isolating)return!0;if(i.inlineContent)return!1}}return!0}function w8(t){for(let e=t.depth;e>=0;e--){let n=t.indexAfter(e),r=t.node(e);if(n==r.childCount){if(r.type.spec.isolating)return!0;continue}for(let i=r.child(n);;i=i.firstChild){if(i.childCount==0&&!i.inlineContent||i.isAtom||i.type.spec.isolating)return!0;if(i.inlineContent)return!1}}return!0}function _8(){return new jr({props:{decorations:S8,createSelectionBetween(t,e,n){return e.pos==n.pos&&Ye.valid(n)?new Ye(n):null},handleClick:E8,handleKeyDown:T8,handleDOMEvents:{beforeinput:C8}}})}const T8=mh({ArrowLeft:Ko("horiz",-1),ArrowRight:Ko("horiz",1),ArrowUp:Ko("vert",-1),ArrowDown:Ko("vert",1)});function Ko(t,e){const n=t=="vert"?e>0?"down":"up":e>0?"right":"left";return function(r,i,o){let a=r.selection,s=e>0?a.$to:a.$from,c=a.empty;if(a instanceof Be){if(!o.endOfTextblock(n)||s.depth==0)return!1;c=!1,s=r.doc.resolve(e>0?s.after():s.before())}let l=Ye.findGapCursorFrom(s,e,c);return l?(i&&i(r.tr.setSelection(new Ye(l))),!0):!1}}function E8(t,e,n){if(!t||!t.editable)return!1;let r=t.state.doc.resolve(e);if(!Ye.valid(r))return!1;let i=t.posAtCoords({left:n.clientX,top:n.clientY});return i&&i.inside>-1&&Ae.isSelectable(t.state.doc.nodeAt(i.inside))?!1:(t.dispatch(t.state.tr.setSelection(new Ye(r))),!0)}function C8(t,e){if(e.inputType!="insertCompositionText"||!(t.state.selection instanceof Ye))return!1;let{$from:n}=t.state.selection,r=n.parent.contentMatchAt(n.index()).findWrapping(t.state.schema.nodes.text);if(!r)return!1;let i=pe.empty;for(let a=r.length-1;a>=0;a--)i=pe.from(r[a].createAndFill(null,i));let o=t.state.tr.replace(n.pos,n.pos,new _e(i,0,0));return o.setSelection(Be.near(o.doc.resolve(n.pos+1))),t.dispatch(o),!1}function S8(t){if(!(t.selection instanceof Ye))return null;let e=document.createElement("div");return e.className="ProseMirror-gapcursor",Je.create(t.doc,[pt.widget(t.selection.head,e,{key:"gapcursor"})])}var Md,Wd;if(typeof WeakMap<"u"){let t=new WeakMap;Md=e=>t.get(e),Wd=(e,n)=>(t.set(e,n),n)}else{const t=[];let n=0;Md=r=>{for(let i=0;i<t.length;i+=2)if(t[i]==r)return t[i+1]},Wd=(r,i)=>(n==10&&(n=0),t[n++]=r,t[n++]=i)}var Qe=class{constructor(t,e,n,r){this.width=t,this.height=e,this.map=n,this.problems=r}findCell(t){for(let e=0;e<this.map.length;e++){const n=this.map[e];if(n!=t)continue;const r=e%this.width,i=e/this.width|0;let o=r+1,a=i+1;for(let s=1;o<this.width&&this.map[e+s]==n;s++)o++;for(let s=1;a<this.height&&this.map[e+this.width*s]==n;s++)a++;return{left:r,top:i,right:o,bottom:a}}throw new RangeError(`No cell with offset ${t} found`)}colCount(t){for(let e=0;e<this.map.length;e++)if(this.map[e]==t)return e%this.width;throw new RangeError(`No cell with offset ${t} found`)}nextCell(t,e,n){const{left:r,right:i,top:o,bottom:a}=this.findCell(t);return e=="horiz"?(n<0?r==0:i==this.width)?null:this.map[o*this.width+(n<0?r-1:i)]:(n<0?o==0:a==this.height)?null:this.map[r+this.width*(n<0?o-1:a)]}rectBetween(t,e){const{left:n,right:r,top:i,bottom:o}=this.findCell(t),{left:a,right:s,top:c,bottom:l}=this.findCell(e);return{left:Math.min(n,a),top:Math.min(i,c),right:Math.max(r,s),bottom:Math.max(o,l)}}cellsInRect(t){const e=[],n={};for(let r=t.top;r<t.bottom;r++)for(let i=t.left;i<t.right;i++){const o=r*this.width+i,a=this.map[o];n[a]||(n[a]=!0,!(i==t.left&&i&&this.map[o-1]==a||r==t.top&&r&&this.map[o-this.width]==a)&&e.push(a))}return e}positionAt(t,e,n){for(let r=0,i=0;;r++){const o=i+n.child(r).nodeSize;if(r==t){let a=e+t*this.width;const s=(t+1)*this.width;for(;a<s&&this.map[a]<i;)a++;return a==s?o-1:this.map[a]}i=o}}static get(t){return Md(t)||Wd(t,A8(t))}};function A8(t){if(t.type.spec.tableRole!="table")throw new RangeError("Not a table node: "+t.type.name);const e=U8(t),n=t.childCount,r=[];let i=0,o=null;const a=[];for(let l=0,u=e*n;l<u;l++)r[l]=0;for(let l=0,u=0;l<n;l++){const f=t.child(l);u++;for(let p=0;;p++){for(;i<r.length&&r[i]!=0;)i++;if(p==f.childCount)break;const m=f.child(p),{colspan:g,rowspan:y,colwidth:b}=m.attrs;for(let v=0;v<y;v++){if(v+l>=n){(o||(o=[])).push({type:"overlong_rowspan",pos:u,n:y-v});break}const T=i+v*e;for(let w=0;w<g;w++){r[T+w]==0?r[T+w]=u:(o||(o=[])).push({type:"collision",row:l,pos:u,n:g-w});const E=b&&b[w];if(E){const S=(T+w)%e*2,U=a[S];U==null||U!=E&&a[S+1]==1?(a[S]=E,a[S+1]=1):U==E&&a[S+1]++}}}i+=g,u+=m.nodeSize}const d=(l+1)*e;let h=0;for(;i<d;)r[i++]==0&&h++;h&&(o||(o=[])).push({type:"missing",row:l,n:h}),u++}(e===0||n===0)&&(o||(o=[])).push({type:"zero_sized"});const s=new Qe(e,n,r,o);let c=!1;for(let l=0;!c&&l<a.length;l+=2)a[l]!=null&&a[l+1]<n&&(c=!0);return c&&k8(s,a,t),s}function U8(t){let e=-1,n=!1;for(let r=0;r<t.childCount;r++){const i=t.child(r);let o=0;if(n)for(let a=0;a<r;a++){const s=t.child(a);for(let c=0;c<s.childCount;c++){const l=s.child(c);a+l.attrs.rowspan>r&&(o+=l.attrs.colspan)}}for(let a=0;a<i.childCount;a++){const s=i.child(a);o+=s.attrs.colspan,s.attrs.rowspan>1&&(n=!0)}e==-1?e=o:e!=o&&(e=Math.max(e,o))}return e}function k8(t,e,n){t.problems||(t.problems=[]);const r={};for(let i=0;i<t.map.length;i++){const o=t.map[i];if(r[o])continue;r[o]=!0;const a=n.nodeAt(o);if(!a)throw new RangeError(`No cell with offset ${o} found`);let s=null;const c=a.attrs;for(let l=0;l<c.colspan;l++){const u=(i+l)%t.width,f=e[u*2];f!=null&&(!c.colwidth||c.colwidth[l]!=f)&&((s||(s=F8(c)))[l]=f)}s&&t.problems.unshift({type:"colwidth mismatch",pos:o,colwidth:s})}}function F8(t){if(t.colwidth)return t.colwidth.slice();const e=[];for(let n=0;n<t.colspan;n++)e.push(0);return e}function gt(t){let e=t.cached.tableNodeTypes;if(!e){e=t.cached.tableNodeTypes={};for(const n in t.nodes){const r=t.nodes[n],i=r.spec.tableRole;i&&(e[i]=r)}}return e}var tr=new ki("selectingCells");function Oi(t){for(let e=t.depth-1;e>0;e--)if(t.node(e).type.spec.tableRole=="row")return t.node(0).resolve(t.before(e+1));return null}function O8(t){for(let e=t.depth;e>0;e--){const n=t.node(e).type.spec.tableRole;if(n==="cell"||n==="header_cell")return t.node(e)}return null}function sn(t){const e=t.selection.$head;for(let n=e.depth;n>0;n--)if(e.node(n).type.spec.tableRole=="row")return!0;return!1}function Zs(t){const e=t.selection;if("$anchorCell"in e&&e.$anchorCell)return e.$anchorCell.pos>e.$headCell.pos?e.$anchorCell:e.$headCell;if("node"in e&&e.node&&e.node.type.spec.tableRole=="cell")return e.$anchor;const n=Oi(e.$head)||R8(e.$head);if(n)return n;throw new RangeError(`No cell found around position ${e.head}`)}function R8(t){for(let e=t.nodeAfter,n=t.pos;e;e=e.firstChild,n++){const r=e.type.spec.tableRole;if(r=="cell"||r=="header_cell")return t.doc.resolve(n)}for(let e=t.nodeBefore,n=t.pos;e;e=e.lastChild,n--){const r=e.type.spec.tableRole;if(r=="cell"||r=="header_cell")return t.doc.resolve(n-e.nodeSize)}}function Ld(t){return t.parent.type.spec.tableRole=="row"&&!!t.nodeAfter}function N8(t){return t.node(0).resolve(t.pos+t.nodeAfter.nodeSize)}function jh(t,e){return t.depth==e.depth&&t.pos>=e.start(-1)&&t.pos<=e.end(-1)}function Rx(t,e,n){const r=t.node(-1),i=Qe.get(r),o=t.start(-1),a=i.nextCell(t.pos-o,e,n);return a==null?null:t.node(0).resolve(o+a)}function Pr(t,e,n=1){const r={...t,colspan:t.colspan-n};return r.colwidth&&(r.colwidth=r.colwidth.slice(),r.colwidth.splice(e,n),r.colwidth.some(i=>i>0)||(r.colwidth=null)),r}function Nx(t,e,n=1){const r={...t,colspan:t.colspan+n};if(r.colwidth){r.colwidth=r.colwidth.slice();for(let i=0;i<n;i++)r.colwidth.splice(e,0,0)}return r}function B8(t,e,n){const r=gt(e.type.schema).header_cell;for(let i=0;i<t.height;i++)if(e.nodeAt(t.map[n+i*t.width]).type!=r)return!1;return!0}var Ke=class kn extends Fe{constructor(e,n=e){const r=e.node(-1),i=Qe.get(r),o=e.start(-1),a=i.rectBetween(e.pos-o,n.pos-o),s=e.node(0),c=i.cellsInRect(a).filter(u=>u!=n.pos-o);c.unshift(n.pos-o);const l=c.map(u=>{const f=r.nodeAt(u);if(!f)throw RangeError(`No cell with offset ${u} found`);const d=o+u+1;return new oh(s.resolve(d),s.resolve(d+f.content.size))});super(l[0].$from,l[0].$to,l),this.$anchorCell=e,this.$headCell=n}map(e,n){const r=e.resolve(n.map(this.$anchorCell.pos)),i=e.resolve(n.map(this.$headCell.pos));if(Ld(r)&&Ld(i)&&jh(r,i)){const o=this.$anchorCell.node(-1)!=r.node(-1);return o&&this.isRowSelection()?kn.rowSelection(r,i):o&&this.isColSelection()?kn.colSelection(r,i):new kn(r,i)}return Be.between(r,i)}content(){const e=this.$anchorCell.node(-1),n=Qe.get(e),r=this.$anchorCell.start(-1),i=n.rectBetween(this.$anchorCell.pos-r,this.$headCell.pos-r),o={},a=[];for(let c=i.top;c<i.bottom;c++){const l=[];for(let u=c*n.width+i.left,f=i.left;f<i.right;f++,u++){const d=n.map[u];if(o[d])continue;o[d]=!0;const h=n.findCell(d);let p=e.nodeAt(d);if(!p)throw RangeError(`No cell with offset ${d} found`);const m=i.left-h.left,g=h.right-i.right;if(m>0||g>0){let y=p.attrs;if(m>0&&(y=Pr(y,0,m)),g>0&&(y=Pr(y,y.colspan-g,g)),h.left<i.left){if(p=p.type.createAndFill(y),!p)throw RangeError(`Could not create cell with attrs ${JSON.stringify(y)}`)}else p=p.type.create(y,p.content)}if(h.top<i.top||h.bottom>i.bottom){const y={...p.attrs,rowspan:Math.min(h.bottom,i.bottom)-Math.max(h.top,i.top)};h.top<i.top?p=p.type.createAndFill(y):p=p.type.create(y,p.content)}l.push(p)}a.push(e.child(c).copy(pe.from(l)))}const s=this.isColSelection()&&this.isRowSelection()?e:a;return new _e(pe.from(s),1,1)}replace(e,n=_e.empty){const r=e.steps.length,i=this.ranges;for(let a=0;a<i.length;a++){const{$from:s,$to:c}=i[a],l=e.mapping.slice(r);e.replace(l.map(s.pos),l.map(c.pos),a?_e.empty:n)}const o=Fe.findFrom(e.doc.resolve(e.mapping.slice(r).map(this.to)),-1);o&&e.setSelection(o)}replaceWith(e,n){this.replace(e,new _e(pe.from(n),0,0))}forEachCell(e){const n=this.$anchorCell.node(-1),r=Qe.get(n),i=this.$anchorCell.start(-1),o=r.cellsInRect(r.rectBetween(this.$anchorCell.pos-i,this.$headCell.pos-i));for(let a=0;a<o.length;a++)e(n.nodeAt(o[a]),i+o[a])}isColSelection(){const e=this.$anchorCell.index(-1),n=this.$headCell.index(-1);if(Math.min(e,n)>0)return!1;const r=e+this.$anchorCell.nodeAfter.attrs.rowspan,i=n+this.$headCell.nodeAfter.attrs.rowspan;return Math.max(r,i)==this.$headCell.node(-1).childCount}static colSelection(e,n=e){const r=e.node(-1),i=Qe.get(r),o=e.start(-1),a=i.findCell(e.pos-o),s=i.findCell(n.pos-o),c=e.node(0);return a.top<=s.top?(a.top>0&&(e=c.resolve(o+i.map[a.left])),s.bottom<i.height&&(n=c.resolve(o+i.map[i.width*(i.height-1)+s.right-1]))):(s.top>0&&(n=c.resolve(o+i.map[s.left])),a.bottom<i.height&&(e=c.resolve(o+i.map[i.width*(i.height-1)+a.right-1]))),new kn(e,n)}isRowSelection(){const e=this.$anchorCell.node(-1),n=Qe.get(e),r=this.$anchorCell.start(-1),i=n.colCount(this.$anchorCell.pos-r),o=n.colCount(this.$headCell.pos-r);if(Math.min(i,o)>0)return!1;const a=i+this.$anchorCell.nodeAfter.attrs.colspan,s=o+this.$headCell.nodeAfter.attrs.colspan;return Math.max(a,s)==n.width}eq(e){return e instanceof kn&&e.$anchorCell.pos==this.$anchorCell.pos&&e.$headCell.pos==this.$headCell.pos}static rowSelection(e,n=e){const r=e.node(-1),i=Qe.get(r),o=e.start(-1),a=i.findCell(e.pos-o),s=i.findCell(n.pos-o),c=e.node(0);return a.left<=s.left?(a.left>0&&(e=c.resolve(o+i.map[a.top*i.width])),s.right<i.width&&(n=c.resolve(o+i.map[i.width*(s.top+1)-1]))):(s.left>0&&(n=c.resolve(o+i.map[s.top*i.width])),a.right<i.width&&(e=c.resolve(o+i.map[i.width*(a.top+1)-1]))),new kn(e,n)}toJSON(){return{type:"cell",anchor:this.$anchorCell.pos,head:this.$headCell.pos}}static fromJSON(e,n){return new kn(e.resolve(n.anchor),e.resolve(n.head))}static create(e,n,r=n){return new kn(e.resolve(n),e.resolve(r))}getBookmark(){return new I8(this.$anchorCell.pos,this.$headCell.pos)}};Ke.prototype.visible=!1;Fe.jsonID("cell",Ke);var I8=class Bx{constructor(e,n){this.anchor=e,this.head=n}map(e){return new Bx(e.map(this.anchor),e.map(this.head))}resolve(e){const n=e.resolve(this.anchor),r=e.resolve(this.head);return n.parent.type.spec.tableRole=="row"&&r.parent.type.spec.tableRole=="row"&&n.index()<n.parent.childCount&&r.index()<r.parent.childCount&&jh(n,r)?new Ke(n,r):Fe.near(r,1)}};function M8(t){if(!(t.selection instanceof Ke))return null;const e=[];return t.selection.forEachCell((n,r)=>{e.push(pt.node(r,r+n.nodeSize,{class:"selectedCell"}))}),Je.create(t.doc,e)}function W8({$from:t,$to:e}){if(t.pos==e.pos||t.pos<e.pos-6)return!1;let n=t.pos,r=e.pos,i=t.depth;for(;i>=0&&!(t.after(i+1)<t.end(i));i--,n++);for(let o=e.depth;o>=0&&!(e.before(o+1)>e.start(o));o--,r--);return n==r&&/row|table/.test(t.node(i).type.spec.tableRole)}function L8({$from:t,$to:e}){let n,r;for(let i=t.depth;i>0;i--){const o=t.node(i);if(o.type.spec.tableRole==="cell"||o.type.spec.tableRole==="header_cell"){n=o;break}}for(let i=e.depth;i>0;i--){const o=e.node(i);if(o.type.spec.tableRole==="cell"||o.type.spec.tableRole==="header_cell"){r=o;break}}return n!==r&&e.parentOffset===0}function P8(t,e,n){const r=(e||t).selection,i=(e||t).doc;let o,a;if(r instanceof Ae&&(a=r.node.type.spec.tableRole)){if(a=="cell"||a=="header_cell")o=Ke.create(i,r.from);else if(a=="row"){const s=i.resolve(r.from+1);o=Ke.rowSelection(s,s)}else if(!n){const s=Qe.get(r.node),c=r.from+1,l=c+s.map[s.width*s.height-1];o=Ke.create(i,c+1,l)}}else r instanceof Be&&W8(r)?o=Be.create(i,r.from):r instanceof Be&&L8(r)&&(o=Be.create(i,r.$from.start(),r.$from.end()));return o&&(e||(e=t.tr)).setSelection(o),e}var q8=new ki("fix-tables");function Ix(t,e,n,r){const i=t.childCount,o=e.childCount;e:for(let a=0,s=0;a<o;a++){const c=e.child(a);for(let l=s,u=Math.min(i,a+3);l<u;l++)if(t.child(l)==c){s=l+1,n+=c.nodeSize;continue e}r(c,n),s<i&&t.child(s).sameMarkup(c)?Ix(t.child(s),c,n+1,r):c.nodesBetween(0,c.content.size,r,n+1),n+=c.nodeSize}}function Mx(t,e){let n;const r=(i,o)=>{i.type.spec.tableRole=="table"&&(n=z8(t,i,o,n))};return e?e.doc!=t.doc&&Ix(e.doc,t.doc,0,r):t.doc.descendants(r),n}function z8(t,e,n,r){const i=Qe.get(e);if(!i.problems)return r;r||(r=t.tr);const o=[];for(let c=0;c<i.height;c++)o.push(0);for(let c=0;c<i.problems.length;c++){const l=i.problems[c];if(l.type=="collision"){const u=e.nodeAt(l.pos);if(!u)continue;const f=u.attrs;for(let d=0;d<f.rowspan;d++)o[l.row+d]+=l.n;r.setNodeMarkup(r.mapping.map(n+1+l.pos),null,Pr(f,f.colspan-l.n,l.n))}else if(l.type=="missing")o[l.row]+=l.n;else if(l.type=="overlong_rowspan"){const u=e.nodeAt(l.pos);if(!u)continue;r.setNodeMarkup(r.mapping.map(n+1+l.pos),null,{...u.attrs,rowspan:u.attrs.rowspan-l.n})}else if(l.type=="colwidth mismatch"){const u=e.nodeAt(l.pos);if(!u)continue;r.setNodeMarkup(r.mapping.map(n+1+l.pos),null,{...u.attrs,colwidth:l.colwidth})}else if(l.type=="zero_sized"){const u=r.mapping.map(n);r.delete(u,u+e.nodeSize)}}let a,s;for(let c=0;c<o.length;c++)o[c]&&(a==null&&(a=c),s=c);for(let c=0,l=n+1;c<i.height;c++){const u=e.child(c),f=l+u.nodeSize,d=o[c];if(d>0){let h="cell";u.firstChild&&(h=u.firstChild.type.spec.tableRole);const p=[];for(let g=0;g<d;g++){const y=gt(t.schema)[h].createAndFill();y&&p.push(y)}const m=(c==0||a==c-1)&&s==c?l+1:f-1;r.insert(r.mapping.map(m),p)}l=f}return r.setMeta(q8,{fixTables:!0})}function Dn(t){const e=t.selection,n=Zs(t),r=n.node(-1),i=n.start(-1),o=Qe.get(r);return{...e instanceof Ke?o.rectBetween(e.$anchorCell.pos-i,e.$headCell.pos-i):o.findCell(n.pos-i),tableStart:i,map:o,table:r}}function Wx(t,{map:e,tableStart:n,table:r},i){let o=i>0?-1:0;B8(e,r,i+o)&&(o=i==0||i==e.width?null:0);for(let a=0;a<e.height;a++){const s=a*e.width+i;if(i>0&&i<e.width&&e.map[s-1]==e.map[s]){const c=e.map[s],l=r.nodeAt(c);t.setNodeMarkup(t.mapping.map(n+c),null,Nx(l.attrs,i-e.colCount(c))),a+=l.attrs.rowspan-1}else{const c=o==null?gt(r.type.schema).cell:r.nodeAt(e.map[s+o]).type,l=e.positionAt(a,i,r);t.insert(t.mapping.map(n+l),c.createAndFill())}}return t}function j8(t,e){if(!sn(t))return!1;if(e){const n=Dn(t);e(Wx(t.tr,n,n.left))}return!0}function $8(t,e){if(!sn(t))return!1;if(e){const n=Dn(t);e(Wx(t.tr,n,n.right))}return!0}function V8(t,{map:e,table:n,tableStart:r},i){const o=t.mapping.maps.length;for(let a=0;a<e.height;){const s=a*e.width+i,c=e.map[s],l=n.nodeAt(c),u=l.attrs;if(i>0&&e.map[s-1]==c||i<e.width-1&&e.map[s+1]==c)t.setNodeMarkup(t.mapping.slice(o).map(r+c),null,Pr(u,i-e.colCount(c)));else{const f=t.mapping.slice(o).map(r+c);t.delete(f,f+l.nodeSize)}a+=u.rowspan}}function H8(t,e){if(!sn(t))return!1;if(e){const n=Dn(t),r=t.tr;if(n.left==0&&n.right==n.map.width)return!1;for(let i=n.right-1;V8(r,n,i),i!=n.left;i--){const o=n.tableStart?r.doc.nodeAt(n.tableStart-1):r.doc;if(!o)throw RangeError("No table found");n.table=o,n.map=Qe.get(o)}e(r)}return!0}function X8(t,e,n){var r;const i=gt(e.type.schema).header_cell;for(let o=0;o<t.width;o++)if(((r=e.nodeAt(t.map[o+n*t.width]))==null?void 0:r.type)!=i)return!1;return!0}function Lx(t,{map:e,tableStart:n,table:r},i){var o;let a=n;for(let l=0;l<i;l++)a+=r.child(l).nodeSize;const s=[];let c=i>0?-1:0;X8(e,r,i+c)&&(c=i==0||i==e.height?null:0);for(let l=0,u=e.width*i;l<e.width;l++,u++)if(i>0&&i<e.height&&e.map[u]==e.map[u-e.width]){const f=e.map[u],d=r.nodeAt(f).attrs;t.setNodeMarkup(n+f,null,{...d,rowspan:d.rowspan+1}),l+=d.colspan-1}else{const f=c==null?gt(r.type.schema).cell:(o=r.nodeAt(e.map[u+c*e.width]))==null?void 0:o.type,d=f==null?void 0:f.createAndFill();d&&s.push(d)}return t.insert(a,gt(r.type.schema).row.create(null,s)),t}function G8(t,e){if(!sn(t))return!1;if(e){const n=Dn(t);e(Lx(t.tr,n,n.top))}return!0}function K8(t,e){if(!sn(t))return!1;if(e){const n=Dn(t);e(Lx(t.tr,n,n.bottom))}return!0}function J8(t,{map:e,table:n,tableStart:r},i){let o=0;for(let l=0;l<i;l++)o+=n.child(l).nodeSize;const a=o+n.child(i).nodeSize,s=t.mapping.maps.length;t.delete(o+r,a+r);const c=new Set;for(let l=0,u=i*e.width;l<e.width;l++,u++){const f=e.map[u];if(!c.has(f)){if(c.add(f),i>0&&f==e.map[u-e.width]){const d=n.nodeAt(f).attrs;t.setNodeMarkup(t.mapping.slice(s).map(f+r),null,{...d,rowspan:d.rowspan-1}),l+=d.colspan-1}else if(i<e.height&&f==e.map[u+e.width]){const d=n.nodeAt(f),h=d.attrs,p=d.type.create({...h,rowspan:d.attrs.rowspan-1},d.content),m=e.positionAt(i+1,l,n);t.insert(t.mapping.slice(s).map(r+m),p),l+=h.colspan-1}}}}function Z8(t,e){if(!sn(t))return!1;if(e){const n=Dn(t),r=t.tr;if(n.top==0&&n.bottom==n.map.height)return!1;for(let i=n.bottom-1;J8(r,n,i),i!=n.top;i--){const o=n.tableStart?r.doc.nodeAt(n.tableStart-1):r.doc;if(!o)throw RangeError("No table found");n.table=o,n.map=Qe.get(n.table)}e(r)}return!0}function Rm(t){const e=t.content;return e.childCount==1&&e.child(0).isTextblock&&e.child(0).childCount==0}function Y8({width:t,height:e,map:n},r){let i=r.top*t+r.left,o=i,a=(r.bottom-1)*t+r.left,s=i+(r.right-r.left-1);for(let c=r.top;c<r.bottom;c++){if(r.left>0&&n[o]==n[o-1]||r.right<t&&n[s]==n[s+1])return!0;o+=t,s+=t}for(let c=r.left;c<r.right;c++){if(r.top>0&&n[i]==n[i-t]||r.bottom<e&&n[a]==n[a+t])return!0;i++,a++}return!1}function Q8(t,e){const n=t.selection;if(!(n instanceof Ke)||n.$anchorCell.pos==n.$headCell.pos)return!1;const r=Dn(t),{map:i}=r;if(Y8(i,r))return!1;if(e){const o=t.tr,a={};let s=pe.empty,c,l;for(let u=r.top;u<r.bottom;u++)for(let f=r.left;f<r.right;f++){const d=i.map[u*i.width+f],h=r.table.nodeAt(d);if(!(a[d]||!h))if(a[d]=!0,c==null)c=d,l=h;else{Rm(h)||(s=s.append(h.content));const p=o.mapping.map(d+r.tableStart);o.delete(p,p+h.nodeSize)}}if(c==null||l==null)return!0;if(o.setNodeMarkup(c+r.tableStart,null,{...Nx(l.attrs,l.attrs.colspan,r.right-r.left-l.attrs.colspan),rowspan:r.bottom-r.top}),s.size){const u=c+1+l.content.size,f=Rm(l)?c+1:u;o.replaceWith(f+r.tableStart,u+r.tableStart,s)}o.setSelection(new Ke(o.doc.resolve(c+r.tableStart))),e(o)}return!0}function ek(t,e){const n=gt(t.schema);return tk(({node:r})=>n[r.type.spec.tableRole])(t,e)}function tk(t){return(e,n)=>{var r;const i=e.selection;let o,a;if(i instanceof Ke){if(i.$anchorCell.pos!=i.$headCell.pos)return!1;o=i.$anchorCell.nodeAfter,a=i.$anchorCell.pos}else{if(o=O8(i.$from),!o)return!1;a=(r=Oi(i.$from))==null?void 0:r.pos}if(o==null||a==null||o.attrs.colspan==1&&o.attrs.rowspan==1)return!1;if(n){let s=o.attrs;const c=[],l=s.colwidth;s.rowspan>1&&(s={...s,rowspan:1}),s.colspan>1&&(s={...s,colspan:1});const u=Dn(e),f=e.tr;for(let h=0;h<u.right-u.left;h++)c.push(l?{...s,colwidth:l&&l[h]?[l[h]]:null}:s);let d;for(let h=u.top;h<u.bottom;h++){let p=u.map.positionAt(h,u.left,u.table);h==u.top&&(p+=o.nodeSize);for(let m=u.left,g=0;m<u.right;m++,g++)m==u.left&&h==u.top||f.insert(d=f.mapping.map(p+u.tableStart,1),t({node:o,row:h,col:m}).createAndFill(c[g]))}f.setNodeMarkup(a,t({node:o,row:u.top,col:u.left}),c[0]),i instanceof Ke&&f.setSelection(new Ke(f.doc.resolve(i.$anchorCell.pos),d?f.doc.resolve(d):void 0)),n(f)}return!0}}function nk(t,e){return function(n,r){if(!sn(n))return!1;const i=Zs(n);if(i.nodeAfter.attrs[t]===e)return!1;if(r){const o=n.tr;n.selection instanceof Ke?n.selection.forEachCell((a,s)=>{a.attrs[t]!==e&&o.setNodeMarkup(s,null,{...a.attrs,[t]:e})}):o.setNodeMarkup(i.pos,null,{...i.nodeAfter.attrs,[t]:e}),r(o)}return!0}}function rk(t){return function(e,n){if(!sn(e))return!1;if(n){const r=gt(e.schema),i=Dn(e),o=e.tr,a=i.map.cellsInRect(t=="column"?{left:i.left,top:0,right:i.right,bottom:i.map.height}:t=="row"?{left:0,top:i.top,right:i.map.width,bottom:i.bottom}:i),s=a.map(c=>i.table.nodeAt(c));for(let c=0;c<a.length;c++)s[c].type==r.header_cell&&o.setNodeMarkup(i.tableStart+a[c],r.cell,s[c].attrs);if(o.steps.length==0)for(let c=0;c<a.length;c++)o.setNodeMarkup(i.tableStart+a[c],r.header_cell,s[c].attrs);n(o)}return!0}}function Nm(t,e,n){const r=e.map.cellsInRect({left:0,top:0,right:t=="row"?e.map.width:1,bottom:t=="column"?e.map.height:1});for(let i=0;i<r.length;i++){const o=e.table.nodeAt(r[i]);if(o&&o.type!==n.header_cell)return!1}return!0}function Ys(t,e){return e=e||{useDeprecatedLogic:!1},e.useDeprecatedLogic?rk(t):function(n,r){if(!sn(n))return!1;if(r){const i=gt(n.schema),o=Dn(n),a=n.tr,s=Nm("row",o,i),c=Nm("column",o,i),u=(t==="column"?s:t==="row"?c:!1)?1:0,f=t=="column"?{left:0,top:u,right:1,bottom:o.map.height}:t=="row"?{left:u,top:0,right:o.map.width,bottom:1}:o,d=t=="column"?c?i.cell:i.header_cell:t=="row"?s?i.cell:i.header_cell:i.cell;o.map.cellsInRect(f).forEach(h=>{const p=h+o.tableStart,m=a.doc.nodeAt(p);m&&a.setNodeMarkup(p,d,m.attrs)}),r(a)}return!0}}Ys("row",{useDeprecatedLogic:!0});Ys("column",{useDeprecatedLogic:!0});var ik=Ys("cell",{useDeprecatedLogic:!0});function ok(t,e){if(e<0){const n=t.nodeBefore;if(n)return t.pos-n.nodeSize;for(let r=t.index(-1)-1,i=t.before();r>=0;r--){const o=t.node(-1).child(r),a=o.lastChild;if(a)return i-1-a.nodeSize;i-=o.nodeSize}}else{if(t.index()<t.parent.childCount-1)return t.pos+t.nodeAfter.nodeSize;const n=t.node(-1);for(let r=t.indexAfter(-1),i=t.after();r<n.childCount;r++){const o=n.child(r);if(o.childCount)return i+1;i+=o.nodeSize}}return null}function ak(t){return function(e,n){if(!sn(e))return!1;const r=ok(Zs(e),t);if(r==null)return!1;if(n){const i=e.doc.resolve(r);n(e.tr.setSelection(Be.between(i,N8(i))).scrollIntoView())}return!0}}function sk(t,e){const n=t.selection.$anchor;for(let r=n.depth;r>0;r--)if(n.node(r).type.spec.tableRole=="table")return e&&e(t.tr.delete(n.before(r),n.after(r)).scrollIntoView()),!0;return!1}function Jo(t,e){const n=t.selection;if(!(n instanceof Ke))return!1;if(e){const r=t.tr,i=gt(t.schema).cell.createAndFill().content;n.forEachCell((o,a)=>{o.content.eq(i)||r.replace(r.mapping.map(a+1),r.mapping.map(a+o.nodeSize-1),new _e(i,0,0))}),r.docChanged&&e(r)}return!0}function ck(t){if(!t.size)return null;let{content:e,openStart:n,openEnd:r}=t;for(;e.childCount==1&&(n>0&&r>0||e.child(0).type.spec.tableRole=="table");)n--,r--,e=e.child(0).content;const i=e.child(0),o=i.type.spec.tableRole,a=i.type.schema,s=[];if(o=="row")for(let c=0;c<e.childCount;c++){let l=e.child(c).content;const u=c?0:Math.max(0,n-1),f=c<e.childCount-1?0:Math.max(0,r-1);(u||f)&&(l=Pd(gt(a).row,new _e(l,u,f)).content),s.push(l)}else if(o=="cell"||o=="header_cell")s.push(n||r?Pd(gt(a).row,new _e(e,n,r)).content:e);else return null;return lk(a,s)}function lk(t,e){const n=[];for(let i=0;i<e.length;i++){const o=e[i];for(let a=o.childCount-1;a>=0;a--){const{rowspan:s,colspan:c}=o.child(a).attrs;for(let l=i;l<i+s;l++)n[l]=(n[l]||0)+c}}let r=0;for(let i=0;i<n.length;i++)r=Math.max(r,n[i]);for(let i=0;i<n.length;i++)if(i>=e.length&&e.push(pe.empty),n[i]<r){const o=gt(t).cell.createAndFill(),a=[];for(let s=n[i];s<r;s++)a.push(o);e[i]=e[i].append(pe.from(a))}return{height:e.length,width:r,rows:e}}function Pd(t,e){const n=t.createAndFill();return new ih(n).replace(0,n.content.size,e).doc}function uk({width:t,height:e,rows:n},r,i){if(t!=r){const o=[],a=[];for(let s=0;s<n.length;s++){const c=n[s],l=[];for(let u=o[s]||0,f=0;u<r;f++){let d=c.child(f%c.childCount);u+d.attrs.colspan>r&&(d=d.type.createChecked(Pr(d.attrs,d.attrs.colspan,u+d.attrs.colspan-r),d.content)),l.push(d),u+=d.attrs.colspan;for(let h=1;h<d.attrs.rowspan;h++)o[s+h]=(o[s+h]||0)+d.attrs.colspan}a.push(pe.from(l))}n=a,t=r}if(e!=i){const o=[];for(let a=0,s=0;a<i;a++,s++){const c=[],l=n[s%e];for(let u=0;u<l.childCount;u++){let f=l.child(u);a+f.attrs.rowspan>i&&(f=f.type.create({...f.attrs,rowspan:Math.max(1,i-f.attrs.rowspan)},f.content)),c.push(f)}o.push(pe.from(c))}n=o,e=i}return{width:t,height:e,rows:n}}function fk(t,e,n,r,i,o,a){const s=t.doc.type.schema,c=gt(s);let l,u;if(i>e.width)for(let f=0,d=0;f<e.height;f++){const h=n.child(f);d+=h.nodeSize;const p=[];let m;h.lastChild==null||h.lastChild.type==c.cell?m=l||(l=c.cell.createAndFill()):m=u||(u=c.header_cell.createAndFill());for(let g=e.width;g<i;g++)p.push(m);t.insert(t.mapping.slice(a).map(d-1+r),p)}if(o>e.height){const f=[];for(let p=0,m=(e.height-1)*e.width;p<Math.max(e.width,i);p++){const g=p>=e.width?!1:n.nodeAt(e.map[m+p]).type==c.header_cell;f.push(g?u||(u=c.header_cell.createAndFill()):l||(l=c.cell.createAndFill()))}const d=c.row.create(null,pe.from(f)),h=[];for(let p=e.height;p<o;p++)h.push(d);t.insert(t.mapping.slice(a).map(r+n.nodeSize-2),h)}return!!(l||u)}function Bm(t,e,n,r,i,o,a,s){if(a==0||a==e.height)return!1;let c=!1;for(let l=i;l<o;l++){const u=a*e.width+l,f=e.map[u];if(e.map[u-e.width]==f){c=!0;const d=n.nodeAt(f),{top:h,left:p}=e.findCell(f);t.setNodeMarkup(t.mapping.slice(s).map(f+r),null,{...d.attrs,rowspan:a-h}),t.insert(t.mapping.slice(s).map(e.positionAt(a,p,n)),d.type.createAndFill({...d.attrs,rowspan:h+d.attrs.rowspan-a})),l+=d.attrs.colspan-1}}return c}function Im(t,e,n,r,i,o,a,s){if(a==0||a==e.width)return!1;let c=!1;for(let l=i;l<o;l++){const u=l*e.width+a,f=e.map[u];if(e.map[u-1]==f){c=!0;const d=n.nodeAt(f),h=e.colCount(f),p=t.mapping.slice(s).map(f+r);t.setNodeMarkup(p,null,Pr(d.attrs,a-h,d.attrs.colspan-(a-h))),t.insert(p+d.nodeSize,d.type.createAndFill(Pr(d.attrs,0,a-h))),l+=d.attrs.rowspan-1}}return c}function Mm(t,e,n,r,i){let o=n?t.doc.nodeAt(n-1):t.doc;if(!o)throw new Error("No table found");let a=Qe.get(o);const{top:s,left:c}=r,l=c+i.width,u=s+i.height,f=t.tr;let d=0;function h(){if(o=n?f.doc.nodeAt(n-1):f.doc,!o)throw new Error("No table found");a=Qe.get(o),d=f.mapping.maps.length}fk(f,a,o,n,l,u,d)&&h(),Bm(f,a,o,n,c,l,s,d)&&h(),Bm(f,a,o,n,c,l,u,d)&&h(),Im(f,a,o,n,s,u,c,d)&&h(),Im(f,a,o,n,s,u,l,d)&&h();for(let p=s;p<u;p++){const m=a.positionAt(p,c,o),g=a.positionAt(p,l,o);f.replace(f.mapping.slice(d).map(m+n),f.mapping.slice(d).map(g+n),new _e(i.rows[p-s],0,0))}h(),f.setSelection(new Ke(f.doc.resolve(n+a.positionAt(s,c,o)),f.doc.resolve(n+a.positionAt(u-1,l-1,o)))),e(f)}var dk=mh({ArrowLeft:Zo("horiz",-1),ArrowRight:Zo("horiz",1),ArrowUp:Zo("vert",-1),ArrowDown:Zo("vert",1),"Shift-ArrowLeft":Yo("horiz",-1),"Shift-ArrowRight":Yo("horiz",1),"Shift-ArrowUp":Yo("vert",-1),"Shift-ArrowDown":Yo("vert",1),Backspace:Jo,"Mod-Backspace":Jo,Delete:Jo,"Mod-Delete":Jo});function Ea(t,e,n){return n.eq(t.selection)?!1:(e&&e(t.tr.setSelection(n).scrollIntoView()),!0)}function Zo(t,e){return(n,r,i)=>{if(!i)return!1;const o=n.selection;if(o instanceof Ke)return Ea(n,r,Fe.near(o.$headCell,e));if(t!="horiz"&&!o.empty)return!1;const a=Px(i,t,e);if(a==null)return!1;if(t=="horiz")return Ea(n,r,Fe.near(n.doc.resolve(o.head+e),e));{const s=n.doc.resolve(a),c=Rx(s,t,e);let l;return c?l=Fe.near(c,1):e<0?l=Fe.near(n.doc.resolve(s.before(-1)),-1):l=Fe.near(n.doc.resolve(s.after(-1)),1),Ea(n,r,l)}}}function Yo(t,e){return(n,r,i)=>{if(!i)return!1;const o=n.selection;let a;if(o instanceof Ke)a=o;else{const c=Px(i,t,e);if(c==null)return!1;a=new Ke(n.doc.resolve(c))}const s=Rx(a.$headCell,t,e);return s?Ea(n,r,new Ke(a.$anchorCell,s)):!1}}function hk(t,e){const n=t.state.doc,r=Oi(n.resolve(e));return r?(t.dispatch(t.state.tr.setSelection(new Ke(r))),!0):!1}function pk(t,e,n){if(!sn(t.state))return!1;let r=ck(n);const i=t.state.selection;if(i instanceof Ke){r||(r={width:1,height:1,rows:[pe.from(Pd(gt(t.state.schema).cell,n))]});const o=i.$anchorCell.node(-1),a=i.$anchorCell.start(-1),s=Qe.get(o).rectBetween(i.$anchorCell.pos-a,i.$headCell.pos-a);return r=uk(r,s.right-s.left,s.bottom-s.top),Mm(t.state,t.dispatch,a,s,r),!0}else if(r){const o=Zs(t.state),a=o.start(-1);return Mm(t.state,t.dispatch,a,Qe.get(o.node(-1)).findCell(o.pos-a),r),!0}else return!1}function gk(t,e){var n;if(e.ctrlKey||e.metaKey)return;const r=Wm(t,e.target);let i;if(e.shiftKey&&t.state.selection instanceof Ke)o(t.state.selection.$anchorCell,e),e.preventDefault();else if(e.shiftKey&&r&&(i=Oi(t.state.selection.$anchor))!=null&&((n=rl(t,e))==null?void 0:n.pos)!=i.pos)o(i,e),e.preventDefault();else if(!r)return;function o(c,l){let u=rl(t,l);const f=tr.getState(t.state)==null;if(!u||!jh(c,u))if(f)u=c;else return;const d=new Ke(c,u);if(f||!t.state.selection.eq(d)){const h=t.state.tr.setSelection(d);f&&h.setMeta(tr,c.pos),t.dispatch(h)}}function a(){t.root.removeEventListener("mouseup",a),t.root.removeEventListener("dragstart",a),t.root.removeEventListener("mousemove",s),tr.getState(t.state)!=null&&t.dispatch(t.state.tr.setMeta(tr,-1))}function s(c){const l=c,u=tr.getState(t.state);let f;if(u!=null)f=t.state.doc.resolve(u);else if(Wm(t,l.target)!=r&&(f=rl(t,e),!f))return a();f&&o(f,l)}t.root.addEventListener("mouseup",a),t.root.addEventListener("dragstart",a),t.root.addEventListener("mousemove",s)}function Px(t,e,n){if(!(t.state.selection instanceof Be))return null;const{$head:r}=t.state.selection;for(let i=r.depth-1;i>=0;i--){const o=r.node(i);if((n<0?r.index(i):r.indexAfter(i))!=(n<0?0:o.childCount))return null;if(o.type.spec.tableRole=="cell"||o.type.spec.tableRole=="header_cell"){const s=r.before(i),c=e=="vert"?n>0?"down":"up":n>0?"right":"left";return t.endOfTextblock(c)?s:null}}return null}function Wm(t,e){for(;e&&e!=t.dom;e=e.parentNode)if(e.nodeName=="TD"||e.nodeName=="TH")return e;return null}function rl(t,e){const n=t.posAtCoords({left:e.clientX,top:e.clientY});return n&&n?Oi(t.state.doc.resolve(n.pos)):null}var mk=class{constructor(t,e){this.node=t,this.defaultCellMinWidth=e,this.dom=document.createElement("div"),this.dom.className="tableWrapper",this.table=this.dom.appendChild(document.createElement("table")),this.table.style.setProperty("--default-cell-min-width",`${e}px`),this.colgroup=this.table.appendChild(document.createElement("colgroup")),qd(t,this.colgroup,this.table,e),this.contentDOM=this.table.appendChild(document.createElement("tbody"))}update(t){return t.type!=this.node.type?!1:(this.node=t,qd(t,this.colgroup,this.table,this.defaultCellMinWidth),!0)}ignoreMutation(t){return t.type=="attributes"&&(t.target==this.table||this.colgroup.contains(t.target))}};function qd(t,e,n,r,i,o){var a;let s=0,c=!0,l=e.firstChild;const u=t.firstChild;if(u){for(let f=0,d=0;f<u.childCount;f++){const{colspan:h,colwidth:p}=u.child(f).attrs;for(let m=0;m<h;m++,d++){const g=i==d?o:p&&p[m],y=g?g+"px":"";if(s+=g||r,g||(c=!1),l)l.style.width!=y&&(l.style.width=y),l=l.nextSibling;else{const b=document.createElement("col");b.style.width=y,e.appendChild(b)}}}for(;l;){const f=l.nextSibling;(a=l.parentNode)==null||a.removeChild(l),l=f}c?(n.style.width=s+"px",n.style.minWidth=""):(n.style.width="",n.style.minWidth=s+"px")}}var Bt=new ki("tableColumnResizing");function yk({handleWidth:t=5,cellMinWidth:e=25,defaultCellMinWidth:n=100,View:r=mk,lastColumnResizable:i=!0}={}){const o=new jr({key:Bt,state:{init(a,s){var c,l;const u=(l=(c=o.spec)==null?void 0:c.props)==null?void 0:l.nodeViews,f=gt(s.schema).table.name;return r&&u&&(u[f]=(d,h)=>new r(d,n,h)),new bk(-1,!1)},apply(a,s){return s.apply(a)}},props:{attributes:a=>{const s=Bt.getState(a);return s&&s.activeHandle>-1?{class:"resize-cursor"}:{}},handleDOMEvents:{mousemove:(a,s)=>{vk(a,s,t,i)},mouseleave:a=>{xk(a)},mousedown:(a,s)=>{Dk(a,s,e,n)}},decorations:a=>{const s=Bt.getState(a);if(s&&s.activeHandle>-1)return Ck(a,s.activeHandle)},nodeViews:{}}});return o}var bk=class Ca{constructor(e,n){this.activeHandle=e,this.dragging=n}apply(e){const n=this,r=e.getMeta(Bt);if(r&&r.setHandle!=null)return new Ca(r.setHandle,!1);if(r&&r.setDragging!==void 0)return new Ca(n.activeHandle,r.setDragging);if(n.activeHandle>-1&&e.docChanged){let i=e.mapping.map(n.activeHandle,-1);return Ld(e.doc.resolve(i))||(i=-1),new Ca(i,n.dragging)}return n}};function vk(t,e,n,r){if(!t.editable)return;const i=Bt.getState(t.state);if(i&&!i.dragging){const o=_k(e.target);let a=-1;if(o){const{left:s,right:c}=o.getBoundingClientRect();e.clientX-s<=n?a=Lm(t,e,"left",n):c-e.clientX<=n&&(a=Lm(t,e,"right",n))}if(a!=i.activeHandle){if(!r&&a!==-1){const s=t.state.doc.resolve(a),c=s.node(-1),l=Qe.get(c),u=s.start(-1);if(l.colCount(s.pos-u)+s.nodeAfter.attrs.colspan-1==l.width-1)return}qx(t,a)}}}function xk(t){if(!t.editable)return;const e=Bt.getState(t.state);e&&e.activeHandle>-1&&!e.dragging&&qx(t,-1)}function Dk(t,e,n,r){var i;if(!t.editable)return!1;const o=(i=t.dom.ownerDocument.defaultView)!=null?i:window,a=Bt.getState(t.state);if(!a||a.activeHandle==-1||a.dragging)return!1;const s=t.state.doc.nodeAt(a.activeHandle),c=wk(t,a.activeHandle,s.attrs);t.dispatch(t.state.tr.setMeta(Bt,{setDragging:{startX:e.clientX,startWidth:c}}));function l(f){o.removeEventListener("mouseup",l),o.removeEventListener("mousemove",u);const d=Bt.getState(t.state);d!=null&&d.dragging&&(Tk(t,d.activeHandle,Pm(d.dragging,f,n)),t.dispatch(t.state.tr.setMeta(Bt,{setDragging:null})))}function u(f){if(!f.which)return l(f);const d=Bt.getState(t.state);if(d&&d.dragging){const h=Pm(d.dragging,f,n);qm(t,d.activeHandle,h,r)}}return qm(t,a.activeHandle,c,r),o.addEventListener("mouseup",l),o.addEventListener("mousemove",u),e.preventDefault(),!0}function wk(t,e,{colspan:n,colwidth:r}){const i=r&&r[r.length-1];if(i)return i;const o=t.domAtPos(e);let s=o.node.childNodes[o.offset].offsetWidth,c=n;if(r)for(let l=0;l<n;l++)r[l]&&(s-=r[l],c--);return s/c}function _k(t){for(;t&&t.nodeName!="TD"&&t.nodeName!="TH";)t=t.classList&&t.classList.contains("ProseMirror")?null:t.parentNode;return t}function Lm(t,e,n,r){const i=n=="right"?-r:r,o=t.posAtCoords({left:e.clientX+i,top:e.clientY});if(!o)return-1;const{pos:a}=o,s=Oi(t.state.doc.resolve(a));if(!s)return-1;if(n=="right")return s.pos;const c=Qe.get(s.node(-1)),l=s.start(-1),u=c.map.indexOf(s.pos-l);return u%c.width==0?-1:l+c.map[u-1]}function Pm(t,e,n){const r=e.clientX-t.startX;return Math.max(n,t.startWidth+r)}function qx(t,e){t.dispatch(t.state.tr.setMeta(Bt,{setHandle:e}))}function Tk(t,e,n){const r=t.state.doc.resolve(e),i=r.node(-1),o=Qe.get(i),a=r.start(-1),s=o.colCount(r.pos-a)+r.nodeAfter.attrs.colspan-1,c=t.state.tr;for(let l=0;l<o.height;l++){const u=l*o.width+s;if(l&&o.map[u]==o.map[u-o.width])continue;const f=o.map[u],d=i.nodeAt(f).attrs,h=d.colspan==1?0:s-o.colCount(f);if(d.colwidth&&d.colwidth[h]==n)continue;const p=d.colwidth?d.colwidth.slice():Ek(d.colspan);p[h]=n,c.setNodeMarkup(a+f,null,{...d,colwidth:p})}c.docChanged&&t.dispatch(c)}function qm(t,e,n,r){const i=t.state.doc.resolve(e),o=i.node(-1),a=i.start(-1),s=Qe.get(o).colCount(i.pos-a)+i.nodeAfter.attrs.colspan-1;let c=t.domAtPos(i.start(-1)).node;for(;c&&c.nodeName!="TABLE";)c=c.parentNode;c&&qd(o,c.firstChild,c,r,s,n)}function Ek(t){return Array(t).fill(0)}function Ck(t,e){var n;const r=[],i=t.doc.resolve(e),o=i.node(-1);if(!o)return Je.empty;const a=Qe.get(o),s=i.start(-1),c=a.colCount(i.pos-s)+i.nodeAfter.attrs.colspan-1;for(let l=0;l<a.height;l++){const u=c+l*a.width;if((c==a.width-1||a.map[u]!=a.map[u+1])&&(l==0||a.map[u]!=a.map[u-a.width])){const f=a.map[u],d=s+f+o.nodeAt(f).nodeSize-1,h=document.createElement("div");h.className="column-resize-handle",(n=Bt.getState(t))!=null&&n.dragging&&r.push(pt.node(s+f,s+f+o.nodeAt(f).nodeSize,{class:"column-resize-dragging"})),r.push(pt.widget(d,h))}}return Je.create(t.doc,r)}function Sk({allowTableNodeSelection:t=!1}={}){return new jr({key:tr,state:{init(){return null},apply(e,n){const r=e.getMeta(tr);if(r!=null)return r==-1?null:r;if(n==null||!e.docChanged)return n;const{deleted:i,pos:o}=e.mapping.mapResult(n);return i?null:o}},props:{decorations:M8,handleDOMEvents:{mousedown:gk},createSelectionBetween(e){return tr.getState(e.state)!=null?e.state.selection:null},handleTripleClick:hk,handleKeyDown:dk,handlePaste:pk},appendTransaction(e,n,r){return P8(r,Mx(r,n),t)}})}var Xt=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function $h(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function zx(t){if(t.__esModule)return t;var e=t.default;if(typeof e=="function"){var n=function r(){return this instanceof r?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};n.prototype=e.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(t).forEach(function(r){var i=Object.getOwnPropertyDescriptor(t,r);Object.defineProperty(n,r,i.get?i:{enumerable:!0,get:function(){return t[r]}})}),n}var il,zm;function jx(){if(zm)return il;zm=1;var t=Object.prototype.toString;return il=function(n){var r=t.call(n),i=r==="[object Arguments]";return i||(i=r!=="[object Array]"&&n!==null&&typeof n=="object"&&typeof n.length=="number"&&n.length>=0&&t.call(n.callee)==="[object Function]"),i},il}var ol,jm;function Ak(){if(jm)return ol;jm=1;var t;if(!Object.keys){var e=Object.prototype.hasOwnProperty,n=Object.prototype.toString,r=jx(),i=Object.prototype.propertyIsEnumerable,o=!i.call({toString:null},"toString"),a=i.call(function(){},"prototype"),s=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],c=function(d){var h=d.constructor;return h&&h.prototype===d},l={$applicationCache:!0,$console:!0,$external:!0,$frame:!0,$frameElement:!0,$frames:!0,$innerHeight:!0,$innerWidth:!0,$onmozfullscreenchange:!0,$onmozfullscreenerror:!0,$outerHeight:!0,$outerWidth:!0,$pageXOffset:!0,$pageYOffset:!0,$parent:!0,$scrollLeft:!0,$scrollTop:!0,$scrollX:!0,$scrollY:!0,$self:!0,$webkitIndexedDB:!0,$webkitStorageInfo:!0,$window:!0},u=function(){if(typeof window>"u")return!1;for(var d in window)try{if(!l["$"+d]&&e.call(window,d)&&window[d]!==null&&typeof window[d]=="object")try{c(window[d])}catch{return!0}}catch{return!0}return!1}(),f=function(d){if(typeof window>"u"||!u)return c(d);try{return c(d)}catch{return!1}};t=function(h){var p=h!==null&&typeof h=="object",m=n.call(h)==="[object Function]",g=r(h),y=p&&n.call(h)==="[object String]",b=[];if(!p&&!m&&!g)throw new TypeError("Object.keys called on a non-object");var v=a&&m;if(y&&h.length>0&&!e.call(h,0))for(var T=0;T<h.length;++T)b.push(String(T));if(g&&h.length>0)for(var w=0;w<h.length;++w)b.push(String(w));else for(var E in h)!(v&&E==="prototype")&&e.call(h,E)&&b.push(String(E));if(o)for(var S=f(h),U=0;U<s.length;++U)!(S&&s[U]==="constructor")&&e.call(h,s[U])&&b.push(s[U]);return b}}return ol=t,ol}var al,$m;function Vh(){if($m)return al;$m=1;var t=Array.prototype.slice,e=jx(),n=Object.keys,r=n?function(a){return n(a)}:Ak(),i=Object.keys;return r.shim=function(){if(Object.keys){var a=function(){var s=Object.keys(arguments);return s&&s.length===arguments.length}(1,2);a||(Object.keys=function(c){return e(c)?i(t.call(c)):i(c)})}else Object.keys=r;return Object.keys||r},al=r,al}var sl,Vm;function Qs(){if(Vm)return sl;Vm=1;var t=Object.defineProperty||!1;if(t)try{t({},"a",{value:1})}catch{t=!1}return sl=t,sl}var cl,Hm;function Hh(){return Hm||(Hm=1,cl=SyntaxError),cl}var ll,Xm;function Jt(){return Xm||(Xm=1,ll=TypeError),ll}var ul,Gm;function Uk(){return Gm||(Gm=1,ul=Object.getOwnPropertyDescriptor),ul}var fl,Km;function Hr(){if(Km)return fl;Km=1;var t=Uk();if(t)try{t([],"length")}catch{t=null}return fl=t,fl}var dl,Jm;function Xh(){if(Jm)return dl;Jm=1;var t=Qs(),e=Hh(),n=Jt(),r=Hr();return dl=function(o,a,s){if(!o||typeof o!="object"&&typeof o!="function")throw new n("`obj` must be an object or a function`");if(typeof a!="string"&&typeof a!="symbol")throw new n("`property` must be a string or a symbol`");if(arguments.length>3&&typeof arguments[3]!="boolean"&&arguments[3]!==null)throw new n("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&typeof arguments[4]!="boolean"&&arguments[4]!==null)throw new n("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&typeof arguments[5]!="boolean"&&arguments[5]!==null)throw new n("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&typeof arguments[6]!="boolean")throw new n("`loose`, if provided, must be a boolean");var c=arguments.length>3?arguments[3]:null,l=arguments.length>4?arguments[4]:null,u=arguments.length>5?arguments[5]:null,f=arguments.length>6?arguments[6]:!1,d=!!r&&r(o,a);if(t)t(o,a,{configurable:u===null&&d?d.configurable:!u,enumerable:c===null&&d?d.enumerable:!c,value:s,writable:l===null&&d?d.writable:!l});else if(f||!c&&!l&&!u)o[a]=s;else throw new e("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.")},dl}var hl,Zm;function Gh(){if(Zm)return hl;Zm=1;var t=Qs(),e=function(){return!!t};return e.hasArrayLengthDefineBug=function(){if(!t)return null;try{return t([],"length",{value:1}).length!==1}catch{return!0}},hl=e,hl}var pl,Ym;function Xr(){if(Ym)return pl;Ym=1;var t=Vh(),e=typeof Symbol=="function"&&typeof Symbol("foo")=="symbol",n=Object.prototype.toString,r=Array.prototype.concat,i=Xh(),o=function(l){return typeof l=="function"&&n.call(l)==="[object Function]"},a=Gh()(),s=function(l,u,f,d){if(u in l){if(d===!0){if(l[u]===f)return}else if(!o(d)||!d())return}a?i(l,u,f,!0):i(l,u,f)},c=function(l,u){var f=arguments.length>2?arguments[2]:{},d=t(u);e&&(d=r.call(d,Object.getOwnPropertySymbols(u)));for(var h=0;h<d.length;h+=1)s(l,d[h],u[d[h]],f[d[h]])};return c.supportsDescriptors=!!a,pl=c,pl}var gl={exports:{}},ml,Qm;function Kh(){return Qm||(Qm=1,ml=Object),ml}var yl,ey;function $x(){return ey||(ey=1,yl=Error),yl}var bl,ty;function kk(){return ty||(ty=1,bl=EvalError),bl}var vl,ny;function Fk(){return ny||(ny=1,vl=RangeError),vl}var xl,ry;function Ok(){return ry||(ry=1,xl=ReferenceError),xl}var Dl,iy;function Rk(){return iy||(iy=1,Dl=URIError),Dl}var wl,oy;function Nk(){return oy||(oy=1,wl=Math.abs),wl}var _l,ay;function Bk(){return ay||(ay=1,_l=Math.floor),_l}var Tl,sy;function Ik(){return sy||(sy=1,Tl=Math.max),Tl}var El,cy;function Mk(){return cy||(cy=1,El=Math.min),El}var Cl,ly;function Wk(){return ly||(ly=1,Cl=Math.pow),Cl}var Sl,uy;function Lk(){return uy||(uy=1,Sl=Math.round),Sl}var Al,fy;function Pk(){return fy||(fy=1,Al=Number.isNaN||function(e){return e!==e}),Al}var Ul,dy;function qk(){if(dy)return Ul;dy=1;var t=Pk();return Ul=function(n){return t(n)||n===0?n:n<0?-1:1},Ul}var kl,hy;function ec(){return hy||(hy=1,kl=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var e={},n=Symbol("test"),r=Object(n);if(typeof n=="string"||Object.prototype.toString.call(n)!=="[object Symbol]"||Object.prototype.toString.call(r)!=="[object Symbol]")return!1;var i=42;e[n]=i;for(var o in e)return!1;if(typeof Object.keys=="function"&&Object.keys(e).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(e).length!==0)return!1;var a=Object.getOwnPropertySymbols(e);if(a.length!==1||a[0]!==n||!Object.prototype.propertyIsEnumerable.call(e,n))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var s=Object.getOwnPropertyDescriptor(e,n);if(s.value!==i||s.enumerable!==!0)return!1}return!0}),kl}var Fl,py;function Jh(){if(py)return Fl;py=1;var t=typeof Symbol<"u"&&Symbol,e=ec();return Fl=function(){return typeof t!="function"||typeof Symbol!="function"||typeof t("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:e()},Fl}var Ol,gy;function Vx(){return gy||(gy=1,Ol=typeof Reflect<"u"&&Reflect.getPrototypeOf||null),Ol}var Rl,my;function Hx(){if(my)return Rl;my=1;var t=Kh();return Rl=t.getPrototypeOf||null,Rl}var Nl,yy;function zk(){if(yy)return Nl;yy=1;var t="Function.prototype.bind called on incompatible ",e=Object.prototype.toString,n=Math.max,r="[object Function]",i=function(c,l){for(var u=[],f=0;f<c.length;f+=1)u[f]=c[f];for(var d=0;d<l.length;d+=1)u[d+c.length]=l[d];return u},o=function(c,l){for(var u=[],f=l,d=0;f<c.length;f+=1,d+=1)u[d]=c[f];return u},a=function(s,c){for(var l="",u=0;u<s.length;u+=1)l+=s[u],u+1<s.length&&(l+=c);return l};return Nl=function(c){var l=this;if(typeof l!="function"||e.apply(l)!==r)throw new TypeError(t+l);for(var u=o(arguments,1),f,d=function(){if(this instanceof f){var y=l.apply(this,i(u,arguments));return Object(y)===y?y:this}return l.apply(c,i(u,arguments))},h=n(0,l.length-u.length),p=[],m=0;m<h;m++)p[m]="$"+m;if(f=Function("binder","return function ("+a(p,",")+"){ return binder.apply(this,arguments); }")(d),l.prototype){var g=function(){};g.prototype=l.prototype,f.prototype=new g,g.prototype=null}return f},Nl}var Bl,by;function Mo(){if(by)return Bl;by=1;var t=zk();return Bl=Function.prototype.bind||t,Bl}var Il,vy;function Zh(){return vy||(vy=1,Il=Function.prototype.call),Il}var Ml,xy;function Yh(){return xy||(xy=1,Ml=Function.prototype.apply),Ml}var Wl,Dy;function jk(){return Dy||(Dy=1,Wl=typeof Reflect<"u"&&Reflect&&Reflect.apply),Wl}var Ll,wy;function Xx(){if(wy)return Ll;wy=1;var t=Mo(),e=Yh(),n=Zh(),r=jk();return Ll=r||t.call(n,e),Ll}var Pl,_y;function Qh(){if(_y)return Pl;_y=1;var t=Mo(),e=Jt(),n=Zh(),r=Xx();return Pl=function(o){if(o.length<1||typeof o[0]!="function")throw new e("a function is required");return r(t,n,o)},Pl}var ql,Ty;function $k(){if(Ty)return ql;Ty=1;var t=Qh(),e=Hr(),n;try{n=[].__proto__===Array.prototype}catch(a){if(!a||typeof a!="object"||!("code"in a)||a.code!=="ERR_PROTO_ACCESS")throw a}var r=!!n&&e&&e(Object.prototype,"__proto__"),i=Object,o=i.getPrototypeOf;return ql=r&&typeof r.get=="function"?t([r.get]):typeof o=="function"?function(s){return o(s==null?s:i(s))}:!1,ql}var zl,Ey;function Gx(){if(Ey)return zl;Ey=1;var t=Vx(),e=Hx(),n=$k();return zl=t?function(i){return t(i)}:e?function(i){if(!i||typeof i!="object"&&typeof i!="function")throw new TypeError("getProto: not an object");return e(i)}:n?function(i){return n(i)}:null,zl}var jl,Cy;function ep(){if(Cy)return jl;Cy=1;var t=Function.prototype.call,e=Object.prototype.hasOwnProperty,n=Mo();return jl=n.call(t,e),jl}var $l,Sy;function qn(){if(Sy)return $l;Sy=1;var t,e=Kh(),n=$x(),r=kk(),i=Fk(),o=Ok(),a=Hh(),s=Jt(),c=Rk(),l=Nk(),u=Bk(),f=Ik(),d=Mk(),h=Wk(),p=Lk(),m=qk(),g=Function,y=function(me){try{return g('"use strict"; return ('+me+").constructor;")()}catch{}},b=Hr(),v=Qs(),T=function(){throw new s},w=b?function(){try{return arguments.callee,T}catch{try{return b(arguments,"callee").get}catch{return T}}}():T,E=Jh()(),S=Gx(),U=Hx(),C=Vx(),R=Yh(),L=Zh(),_={},k=typeof Uint8Array>"u"||!S?t:S(Uint8Array),x={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?t:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?t:ArrayBuffer,"%ArrayIteratorPrototype%":E&&S?S([][Symbol.iterator]()):t,"%AsyncFromSyncIteratorPrototype%":t,"%AsyncFunction%":_,"%AsyncGenerator%":_,"%AsyncGeneratorFunction%":_,"%AsyncIteratorPrototype%":_,"%Atomics%":typeof Atomics>"u"?t:Atomics,"%BigInt%":typeof BigInt>"u"?t:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?t:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?t:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?t:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":n,"%eval%":eval,"%EvalError%":r,"%Float32Array%":typeof Float32Array>"u"?t:Float32Array,"%Float64Array%":typeof Float64Array>"u"?t:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?t:FinalizationRegistry,"%Function%":g,"%GeneratorFunction%":_,"%Int8Array%":typeof Int8Array>"u"?t:Int8Array,"%Int16Array%":typeof Int16Array>"u"?t:Int16Array,"%Int32Array%":typeof Int32Array>"u"?t:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":E&&S?S(S([][Symbol.iterator]())):t,"%JSON%":typeof JSON=="object"?JSON:t,"%Map%":typeof Map>"u"?t:Map,"%MapIteratorPrototype%":typeof Map>"u"||!E||!S?t:S(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":e,"%Object.getOwnPropertyDescriptor%":b,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?t:Promise,"%Proxy%":typeof Proxy>"u"?t:Proxy,"%RangeError%":i,"%ReferenceError%":o,"%Reflect%":typeof Reflect>"u"?t:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?t:Set,"%SetIteratorPrototype%":typeof Set>"u"||!E||!S?t:S(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?t:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":E&&S?S(""[Symbol.iterator]()):t,"%Symbol%":E?Symbol:t,"%SyntaxError%":a,"%ThrowTypeError%":w,"%TypedArray%":k,"%TypeError%":s,"%Uint8Array%":typeof Uint8Array>"u"?t:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?t:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?t:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?t:Uint32Array,"%URIError%":c,"%WeakMap%":typeof WeakMap>"u"?t:WeakMap,"%WeakRef%":typeof WeakRef>"u"?t:WeakRef,"%WeakSet%":typeof WeakSet>"u"?t:WeakSet,"%Function.prototype.call%":L,"%Function.prototype.apply%":R,"%Object.defineProperty%":v,"%Object.getPrototypeOf%":U,"%Math.abs%":l,"%Math.floor%":u,"%Math.max%":f,"%Math.min%":d,"%Math.pow%":h,"%Math.round%":p,"%Math.sign%":m,"%Reflect.getPrototypeOf%":C};if(S)try{null.error}catch(me){var z=S(S(me));x["%Error.prototype%"]=z}var F=function me(de){var ge;if(de==="%AsyncFunction%")ge=y("async function () {}");else if(de==="%GeneratorFunction%")ge=y("function* () {}");else if(de==="%AsyncGeneratorFunction%")ge=y("async function* () {}");else if(de==="%AsyncGenerator%"){var ye=me("%AsyncGeneratorFunction%");ye&&(ge=ye.prototype)}else if(de==="%AsyncIteratorPrototype%"){var be=me("%AsyncGenerator%");be&&S&&(ge=S(be.prototype))}return x[de]=ge,ge},I={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},K=Mo(),P=ep(),te=K.call(L,Array.prototype.concat),W=K.call(R,Array.prototype.splice),B=K.call(L,String.prototype.replace),oe=K.call(L,String.prototype.slice),X=K.call(L,RegExp.prototype.exec),J=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,le=/\\(\\)?/g,he=function(de){var ge=oe(de,0,1),ye=oe(de,-1);if(ge==="%"&&ye!=="%")throw new a("invalid intrinsic syntax, expected closing `%`");if(ye==="%"&&ge!=="%")throw new a("invalid intrinsic syntax, expected opening `%`");var be=[];return B(de,J,function(D,V,j,M){be[be.length]=j?B(M,le,"$1"):V||D}),be},fe=function(de,ge){var ye=de,be;if(P(I,ye)&&(be=I[ye],ye="%"+be[0]+"%"),P(x,ye)){var D=x[ye];if(D===_&&(D=F(ye)),typeof D>"u"&&!ge)throw new s("intrinsic "+de+" exists, but is not available. Please file an issue!");return{alias:be,name:ye,value:D}}throw new a("intrinsic "+de+" does not exist!")};return $l=function(de,ge){if(typeof de!="string"||de.length===0)throw new s("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof ge!="boolean")throw new s('"allowMissing" argument must be a boolean');if(X(/^%?[^%]*%?$/,de)===null)throw new a("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var ye=he(de),be=ye.length>0?ye[0]:"",D=fe("%"+be+"%",ge),V=D.name,j=D.value,M=!1,N=D.alias;N&&(be=N[0],W(ye,te([0,1],N)));for(var $=1,ie=!0;$<ye.length;$+=1){var ne=ye[$],Z=oe(ne,0,1),q=oe(ne,-1);if((Z==='"'||Z==="'"||Z==="`"||q==='"'||q==="'"||q==="`")&&Z!==q)throw new a("property names with quotes must have matching quotes");if((ne==="constructor"||!ie)&&(M=!0),be+="."+ne,V="%"+be+"%",P(x,V))j=x[V];else if(j!=null){if(!(ne in j)){if(!ge)throw new s("base intrinsic for "+de+" exists, but the property is not available.");return}if(b&&$+1>=ye.length){var G=b(j,ne);ie=!!G,ie&&"get"in G&&!("originalValue"in G.get)?j=G.get:j=j[ne]}else ie=P(j,ne),j=j[ne];ie&&!M&&(x[V]=j)}}return j},$l}var Vl,Ay;function Vk(){if(Ay)return Vl;Ay=1;var t=qn(),e=Xh(),n=Gh()(),r=Hr(),i=Jt(),o=t("%Math.floor%");return Vl=function(s,c){if(typeof s!="function")throw new i("`fn` is not a function");if(typeof c!="number"||c<0||c>4294967295||o(c)!==c)throw new i("`length` must be a positive 32-bit integer");var l=arguments.length>2&&!!arguments[2],u=!0,f=!0;if("length"in s&&r){var d=r(s,"length");d&&!d.configurable&&(u=!1),d&&!d.writable&&(f=!1)}return(u||f||!l)&&(n?e(s,"length",c,!0,!0):e(s,"length",c)),s},Vl}var Hl,Uy;function Hk(){if(Uy)return Hl;Uy=1;var t=Mo(),e=Yh(),n=Xx();return Hl=function(){return n(t,e,arguments)},Hl}var ky;function Ri(){return ky||(ky=1,function(t){var e=Vk(),n=Qs(),r=Qh(),i=Hk();t.exports=function(a){var s=r(arguments),c=a.length-(arguments.length-1);return e(s,1+(c>0?c:0),!0)},n?n(t.exports,"apply",{value:i}):t.exports.apply=i}(gl)),gl.exports}var Xl,Fy;function bt(){if(Fy)return Xl;Fy=1;var t=qn(),e=Qh(),n=e([t("%String.prototype.indexOf%")]);return Xl=function(i,o){var a=t(i,!!o);return typeof a=="function"&&n(i,".prototype.")>-1?e([a]):a},Xl}var Gl,Oy;function Kx(){if(Oy)return Gl;Oy=1;var t=Vh(),e=ec()(),n=bt(),r=Kh(),i=n("Array.prototype.push"),o=n("Object.prototype.propertyIsEnumerable"),a=e?r.getOwnPropertySymbols:null;return Gl=function(c,l){if(c==null)throw new TypeError("target must be an object");var u=r(c);if(arguments.length===1)return u;for(var f=1;f<arguments.length;++f){var d=r(arguments[f]),h=t(d),p=e&&(r.getOwnPropertySymbols||a);if(p)for(var m=p(d),g=0;g<m.length;++g){var y=m[g];o(d,y)&&i(h,y)}for(var b=0;b<h.length;++b){var v=h[b];if(o(d,v)){var T=d[v];u[v]=T}}}return u},Gl}var Kl,Ry;function Jx(){if(Ry)return Kl;Ry=1;var t=Kx(),e=function(){if(!Object.assign)return!1;for(var r="abcdefghijklmnopqrst",i=r.split(""),o={},a=0;a<i.length;++a)o[i[a]]=i[a];var s=Object.assign({},o),c="";for(var l in s)c+=l;return r!==c},n=function(){if(!Object.assign||!Object.preventExtensions)return!1;var r=Object.preventExtensions({1:2});try{Object.assign(r,"xy")}catch{return r[1]==="y"}return!1};return Kl=function(){return!Object.assign||e()||n()?t:Object.assign},Kl}var Jl,Ny;function Xk(){if(Ny)return Jl;Ny=1;var t=Xr(),e=Jx();return Jl=function(){var r=e();return t(Object,{assign:r},{assign:function(){return Object.assign!==r}}),r},Jl}var Zl,By;function Gk(){if(By)return Zl;By=1;var t=Xr(),e=Ri(),n=Kx(),r=Jx(),i=Xk(),o=e.apply(r()),a=function(c,l){return o(Object,arguments)};return t(a,{getPolyfill:r,implementation:n,shim:i}),Zl=a,Zl}var Yl,Iy;function Zx(){if(Iy)return Yl;Iy=1;var t=qn(),e=Ri(),n=e(t("String.prototype.indexOf"));return Yl=function(i,o){var a=t(i,!!o);return typeof a=="function"&&n(i,".prototype.")>-1?e(a):a},Yl}var Ql,My;function Kk(){if(My)return Ql;My=1;var t=function(){return typeof(function(){}).name=="string"},e=Object.getOwnPropertyDescriptor;if(e)try{e([],"length")}catch{e=null}t.functionsHaveConfigurableNames=function(){if(!t()||!e)return!1;var i=e(function(){},"name");return!!i&&!!i.configurable};var n=Function.prototype.bind;return t.boundFunctionsHaveNames=function(){return t()&&typeof n=="function"&&(function(){}).bind().name!==""},Ql=t,Ql}var eu,Wy;function Jk(){if(Wy)return eu;Wy=1;var t=Xh(),e=Gh()(),n=Kk().functionsHaveConfigurableNames(),r=Jt();return eu=function(o,a){if(typeof o!="function")throw new r("`fn` is not a function");var s=arguments.length>2&&!!arguments[2];return(!s||n)&&(e?t(o,"name",a,!0,!0):t(o,"name",a)),o},eu}var tu,Ly;function Yx(){if(Ly)return tu;Ly=1;var t=Jk(),e=Jt(),n=Object;return tu=t(function(){if(this==null||this!==n(this))throw new e("RegExp.prototype.flags getter called on non-object");var i="";return this.hasIndices&&(i+="d"),this.global&&(i+="g"),this.ignoreCase&&(i+="i"),this.multiline&&(i+="m"),this.dotAll&&(i+="s"),this.unicode&&(i+="u"),this.unicodeSets&&(i+="v"),this.sticky&&(i+="y"),i},"get flags",!0),tu}var nu,Py;function Qx(){if(Py)return nu;Py=1;var t=Yx(),e=Xr().supportsDescriptors,n=Object.getOwnPropertyDescriptor;return nu=function(){if(e&&/a/mig.flags==="gim"){var i=n(RegExp.prototype,"flags");if(i&&typeof i.get=="function"&&"dotAll"in RegExp.prototype&&"hasIndices"in RegExp.prototype){var o="",a={};if(Object.defineProperty(a,"hasIndices",{get:function(){o+="d"}}),Object.defineProperty(a,"sticky",{get:function(){o+="y"}}),i.get.call(a),o==="dy")return i.get}}return t},nu}var ru,qy;function Zk(){if(qy)return ru;qy=1;var t=Xr().supportsDescriptors,e=Qx(),n=Hr(),r=Object.defineProperty,i=$x(),o=Gx(),a=/a/;return ru=function(){if(!t||!o)throw new i("RegExp.prototype.flags requires a true ES5 environment that supports property descriptors");var c=e(),l=o(a),u=n(l,"flags");return(!u||u.get!==c)&&r(l,"flags",{configurable:!0,enumerable:!1,get:c}),c},ru}var iu,zy;function Yk(){if(zy)return iu;zy=1;var t=Xr(),e=Ri(),n=Yx(),r=Qx(),i=Zk(),o=e(r());return t(o,{getPolyfill:r,implementation:n,shim:i}),iu=o,iu}var qi={exports:{}},ou,jy;function Gr(){if(jy)return ou;jy=1;var t=ec();return ou=function(){return t()&&!!Symbol.toStringTag},ou}var au,$y;function eD(){if($y)return au;$y=1;var t=Gr()(),e=bt(),n=e("Object.prototype.toString"),r=function(s){return t&&s&&typeof s=="object"&&Symbol.toStringTag in s?!1:n(s)==="[object Arguments]"},i=function(s){return r(s)?!0:s!==null&&typeof s=="object"&&"length"in s&&typeof s.length=="number"&&s.length>=0&&n(s)!=="[object Array]"&&"callee"in s&&n(s.callee)==="[object Function]"},o=function(){return r(arguments)}();return r.isLegacyArguments=i,au=o?r:i,au}const Qk={},e4=Object.freeze(Object.defineProperty({__proto__:null,default:Qk},Symbol.toStringTag,{value:"Module"})),t4=zx(e4);var su,Vy;function tc(){if(Vy)return su;Vy=1;var t=typeof Map=="function"&&Map.prototype,e=Object.getOwnPropertyDescriptor&&t?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,n=t&&e&&typeof e.get=="function"?e.get:null,r=t&&Map.prototype.forEach,i=typeof Set=="function"&&Set.prototype,o=Object.getOwnPropertyDescriptor&&i?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,a=i&&o&&typeof o.get=="function"?o.get:null,s=i&&Set.prototype.forEach,c=typeof WeakMap=="function"&&WeakMap.prototype,l=c?WeakMap.prototype.has:null,u=typeof WeakSet=="function"&&WeakSet.prototype,f=u?WeakSet.prototype.has:null,d=typeof WeakRef=="function"&&WeakRef.prototype,h=d?WeakRef.prototype.deref:null,p=Boolean.prototype.valueOf,m=Object.prototype.toString,g=Function.prototype.toString,y=String.prototype.match,b=String.prototype.slice,v=String.prototype.replace,T=String.prototype.toUpperCase,w=String.prototype.toLowerCase,E=RegExp.prototype.test,S=Array.prototype.concat,U=Array.prototype.join,C=Array.prototype.slice,R=Math.floor,L=typeof BigInt=="function"?BigInt.prototype.valueOf:null,_=Object.getOwnPropertySymbols,k=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Symbol.prototype.toString:null,x=typeof Symbol=="function"&&typeof Symbol.iterator=="object",z=typeof Symbol=="function"&&Symbol.toStringTag&&(typeof Symbol.toStringTag===x||!0)?Symbol.toStringTag:null,F=Object.prototype.propertyIsEnumerable,I=(typeof Reflect=="function"?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(Q){return Q.__proto__}:null);function K(Q,re){if(Q===1/0||Q===-1/0||Q!==Q||Q&&Q>-1e3&&Q<1e3||E.call(/e/,re))return re;var Oe=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if(typeof Q=="number"){var Ie=Q<0?-R(-Q):R(Q);if(Ie!==Q){var qe=String(Ie),A=b.call(re,qe.length+1);return v.call(qe,Oe,"$&_")+"."+v.call(v.call(A,/([0-9]{3})/g,"$&_"),/_$/,"")}}return v.call(re,Oe,"$&_")}var P=t4,te=P.custom,W=D(te)?te:null,B={__proto__:null,double:'"',single:"'"},oe={__proto__:null,double:/(["\\])/g,single:/(['\\])/g};su=function Q(re,Oe,Ie,qe){var A=Oe||{};if(M(A,"quoteStyle")&&!M(B,A.quoteStyle))throw new TypeError('option "quoteStyle" must be "single" or "double"');if(M(A,"maxStringLength")&&(typeof A.maxStringLength=="number"?A.maxStringLength<0&&A.maxStringLength!==1/0:A.maxStringLength!==null))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var O=M(A,"customInspect")?A.customInspect:!0;if(typeof O!="boolean"&&O!=="symbol")throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(M(A,"indent")&&A.indent!==null&&A.indent!==" "&&!(parseInt(A.indent,10)===A.indent&&A.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(M(A,"numericSeparator")&&typeof A.numericSeparator!="boolean")throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var H=A.numericSeparator;if(typeof re>"u")return"undefined";if(re===null)return"null";if(typeof re=="boolean")return re?"true":"false";if(typeof re=="string")return xe(re,A);if(typeof re=="number"){if(re===0)return 1/0/re>0?"0":"-0";var se=String(re);return H?K(re,se):se}if(typeof re=="bigint"){var we=String(re)+"n";return H?K(re,we):we}var Ue=typeof A.depth>"u"?5:A.depth;if(typeof Ie>"u"&&(Ie=0),Ie>=Ue&&Ue>0&&typeof re=="object")return he(re)?"[Array]":"[Object]";var We=ve(A,Ie);if(typeof qe>"u")qe=[];else if(ie(qe,re)>=0)return"[Circular]";function $e(ti,zo,f_){if(zo&&(qe=C.call(qe),qe.push(zo)),f_){var Kp={depth:A.depth};return M(A,"quoteStyle")&&(Kp.quoteStyle=A.quoteStyle),Q(ti,Kp,Ie+1,qe)}return Q(ti,A,Ie+1,qe)}if(typeof re=="function"&&!me(re)){var Wt=$(re),Zt=ke(re,$e);return"[Function"+(Wt?": "+Wt:" (anonymous)")+"]"+(Zt.length>0?" { "+U.call(Zt,", ")+" }":"")}if(D(re)){var Lt=x?v.call(String(re),/^(Symbol\(.*\))_[^)]*$/,"$1"):k.call(re);return typeof re=="object"&&!x?Se(Lt):Lt}if(ae(re)){for(var Ot="<"+w.call(String(re.nodeName)),Yt=re.attributes||[],Pt=0;Pt<Yt.length;Pt++)Ot+=" "+Yt[Pt].name+"="+X(J(Yt[Pt].value),"double",A);return Ot+=">",re.childNodes&&re.childNodes.length&&(Ot+="..."),Ot+="</"+w.call(String(re.nodeName))+">",Ot}if(he(re)){if(re.length===0)return"[]";var Et=ke(re,$e);return We&&!ue(Et)?"["+Ee(Et,We)+"]":"[ "+U.call(Et,", ")+" ]"}if(de(re)){var Qt=ke(re,$e);return!("cause"in Error.prototype)&&"cause"in re&&!F.call(re,"cause")?"{ ["+String(re)+"] "+U.call(S.call("[cause]: "+$e(re.cause),Qt),", ")+" }":Qt.length===0?"["+String(re)+"]":"{ ["+String(re)+"] "+U.call(Qt,", ")+" }"}if(typeof re=="object"&&O){if(W&&typeof re[W]=="function"&&P)return P(re,{depth:Ue-Ie});if(O!=="symbol"&&typeof re.inspect=="function")return re.inspect()}if(ne(re)){var zn=[];return r&&r.call(re,function(ti,zo){zn.push($e(zo,re,!0)+" => "+$e(ti,re))}),ee("Map",n.call(re),zn,We)}if(G(re)){var nt=[];return s&&s.call(re,function(ti){nt.push($e(ti,re))}),ee("Set",a.call(re),nt,We)}if(Z(re))return Ce("WeakMap");if(Y(re))return Ce("WeakSet");if(q(re))return Ce("WeakRef");if(ye(re))return Se($e(Number(re)));if(V(re))return Se($e(L.call(re)));if(be(re))return Se(p.call(re));if(ge(re))return Se($e(String(re)));if(typeof window<"u"&&re===window)return"{ [object Window] }";if(typeof globalThis<"u"&&re===globalThis||typeof Xt<"u"&&re===Xt)return"{ [object globalThis] }";if(!fe(re)&&!me(re)){var Qr=ke(re,$e),wn=I?I(re)===Object.prototype:re instanceof Object||re.constructor===Object,ei=re instanceof Object?"":"null prototype",Gp=!wn&&z&&Object(re)===re&&z in re?b.call(N(re),8,-1):ei?"Object":"",u_=wn||typeof re.constructor!="function"?"":re.constructor.name?re.constructor.name+" ":"",Sc=u_+(Gp||ei?"["+U.call(S.call([],Gp||[],ei||[]),": ")+"] ":"");return Qr.length===0?Sc+"{}":We?Sc+"{"+Ee(Qr,We)+"}":Sc+"{ "+U.call(Qr,", ")+" }"}return String(re)};function X(Q,re,Oe){var Ie=Oe.quoteStyle||re,qe=B[Ie];return qe+Q+qe}function J(Q){return v.call(String(Q),/"/g,"&quot;")}function le(Q){return!z||!(typeof Q=="object"&&(z in Q||typeof Q[z]<"u"))}function he(Q){return N(Q)==="[object Array]"&&le(Q)}function fe(Q){return N(Q)==="[object Date]"&&le(Q)}function me(Q){return N(Q)==="[object RegExp]"&&le(Q)}function de(Q){return N(Q)==="[object Error]"&&le(Q)}function ge(Q){return N(Q)==="[object String]"&&le(Q)}function ye(Q){return N(Q)==="[object Number]"&&le(Q)}function be(Q){return N(Q)==="[object Boolean]"&&le(Q)}function D(Q){if(x)return Q&&typeof Q=="object"&&Q instanceof Symbol;if(typeof Q=="symbol")return!0;if(!Q||typeof Q!="object"||!k)return!1;try{return k.call(Q),!0}catch{}return!1}function V(Q){if(!Q||typeof Q!="object"||!L)return!1;try{return L.call(Q),!0}catch{}return!1}var j=Object.prototype.hasOwnProperty||function(Q){return Q in this};function M(Q,re){return j.call(Q,re)}function N(Q){return m.call(Q)}function $(Q){if(Q.name)return Q.name;var re=y.call(g.call(Q),/^function\s*([\w$]+)/);return re?re[1]:null}function ie(Q,re){if(Q.indexOf)return Q.indexOf(re);for(var Oe=0,Ie=Q.length;Oe<Ie;Oe++)if(Q[Oe]===re)return Oe;return-1}function ne(Q){if(!n||!Q||typeof Q!="object")return!1;try{n.call(Q);try{a.call(Q)}catch{return!0}return Q instanceof Map}catch{}return!1}function Z(Q){if(!l||!Q||typeof Q!="object")return!1;try{l.call(Q,l);try{f.call(Q,f)}catch{return!0}return Q instanceof WeakMap}catch{}return!1}function q(Q){if(!h||!Q||typeof Q!="object")return!1;try{return h.call(Q),!0}catch{}return!1}function G(Q){if(!a||!Q||typeof Q!="object")return!1;try{a.call(Q);try{n.call(Q)}catch{return!0}return Q instanceof Set}catch{}return!1}function Y(Q){if(!f||!Q||typeof Q!="object")return!1;try{f.call(Q,f);try{l.call(Q,l)}catch{return!0}return Q instanceof WeakSet}catch{}return!1}function ae(Q){return!Q||typeof Q!="object"?!1:typeof HTMLElement<"u"&&Q instanceof HTMLElement?!0:typeof Q.nodeName=="string"&&typeof Q.getAttribute=="function"}function xe(Q,re){if(Q.length>re.maxStringLength){var Oe=Q.length-re.maxStringLength,Ie="... "+Oe+" more character"+(Oe>1?"s":"");return xe(b.call(Q,0,re.maxStringLength),re)+Ie}var qe=oe[re.quoteStyle||"single"];qe.lastIndex=0;var A=v.call(v.call(Q,qe,"\\$1"),/[\x00-\x1f]/g,Te);return X(A,"single",re)}function Te(Q){var re=Q.charCodeAt(0),Oe={8:"b",9:"t",10:"n",12:"f",13:"r"}[re];return Oe?"\\"+Oe:"\\x"+(re<16?"0":"")+T.call(re.toString(16))}function Se(Q){return"Object("+Q+")"}function Ce(Q){return Q+" { ? }"}function ee(Q,re,Oe,Ie){var qe=Ie?Ee(Oe,Ie):U.call(Oe,", ");return Q+" ("+re+") {"+qe+"}"}function ue(Q){for(var re=0;re<Q.length;re++)if(ie(Q[re],`
14
+ 3. "-" cannot repeat`);Ge.customSchemes.push([t,e])}function c8(){Ge.scanner=Q5(Ge.customSchemes);for(let t=0;t<Ge.tokenQueue.length;t++)Ge.tokenQueue[t][1]({scanner:Ge.scanner});Ge.parser=n8(Ge.scanner.tokens);for(let t=0;t<Ge.pluginQueue.length;t++)Ge.pluginQueue[t][1]({scanner:Ge.scanner,parser:Ge.parser});return Ge.initialized=!0,Ge}function qh(t){return Ge.initialized||c8(),r8(Ge.parser.start,t,Sx(Ge.scanner.start,t))}qh.scan=Sx;function l8(t,e=null,n=null){if(e&&typeof e=="object"){if(n)throw Error(`linkifyjs: Invalid link type ${e}; must be a string`);n=e,e=null}const r=new Ph(n),i=qh(t),o=[];for(let a=0;a<i.length;a++){const s=i[a];s.isLink&&(!e||s.t===e)&&r.check(s)&&o.push(s.toFormattedObject(r))}return o}var Ns=200,st=function(){};st.prototype.append=function(e){return e.length?(e=st.from(e),!this.length&&e||e.length<Ns&&this.leafAppend(e)||this.length<Ns&&e.leafPrepend(this)||this.appendInner(e)):this};st.prototype.prepend=function(e){return e.length?st.from(e).append(this):this};st.prototype.appendInner=function(e){return new u8(this,e)};st.prototype.slice=function(e,n){return e===void 0&&(e=0),n===void 0&&(n=this.length),e>=n?st.empty:this.sliceInner(Math.max(0,e),Math.min(this.length,n))};st.prototype.get=function(e){if(!(e<0||e>=this.length))return this.getInner(e)};st.prototype.forEach=function(e,n,r){n===void 0&&(n=0),r===void 0&&(r=this.length),n<=r?this.forEachInner(e,n,r,0):this.forEachInvertedInner(e,n,r,0)};st.prototype.map=function(e,n,r){n===void 0&&(n=0),r===void 0&&(r=this.length);var i=[];return this.forEach(function(o,a){return i.push(e(o,a))},n,r),i};st.from=function(e){return e instanceof st?e:e&&e.length?new Ux(e):st.empty};var Ux=function(t){function e(r){t.call(this),this.values=r}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var n={length:{configurable:!0},depth:{configurable:!0}};return e.prototype.flatten=function(){return this.values},e.prototype.sliceInner=function(i,o){return i==0&&o==this.length?this:new e(this.values.slice(i,o))},e.prototype.getInner=function(i){return this.values[i]},e.prototype.forEachInner=function(i,o,a,s){for(var c=o;c<a;c++)if(i(this.values[c],s+c)===!1)return!1},e.prototype.forEachInvertedInner=function(i,o,a,s){for(var c=o-1;c>=a;c--)if(i(this.values[c],s+c)===!1)return!1},e.prototype.leafAppend=function(i){if(this.length+i.length<=Ns)return new e(this.values.concat(i.flatten()))},e.prototype.leafPrepend=function(i){if(this.length+i.length<=Ns)return new e(i.flatten().concat(this.values))},n.length.get=function(){return this.values.length},n.depth.get=function(){return 0},Object.defineProperties(e.prototype,n),e}(st);st.empty=new Ux([]);var u8=function(t){function e(n,r){t.call(this),this.left=n,this.right=r,this.length=n.length+r.length,this.depth=Math.max(n.depth,r.depth)+1}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.flatten=function(){return this.left.flatten().concat(this.right.flatten())},e.prototype.getInner=function(r){return r<this.left.length?this.left.get(r):this.right.get(r-this.left.length)},e.prototype.forEachInner=function(r,i,o,a){var s=this.left.length;if(i<s&&this.left.forEachInner(r,i,Math.min(o,s),a)===!1||o>s&&this.right.forEachInner(r,Math.max(i-s,0),Math.min(this.length,o)-s,a+s)===!1)return!1},e.prototype.forEachInvertedInner=function(r,i,o,a){var s=this.left.length;if(i>s&&this.right.forEachInvertedInner(r,i-s,Math.max(o,s)-s,a+s)===!1||o<s&&this.left.forEachInvertedInner(r,Math.min(i,s),o,a)===!1)return!1},e.prototype.sliceInner=function(r,i){if(r==0&&i==this.length)return this;var o=this.left.length;return i<=o?this.left.slice(r,i):r>=o?this.right.slice(r-o,i-o):this.left.slice(r,o).append(this.right.slice(0,i-o))},e.prototype.leafAppend=function(r){var i=this.right.leafAppend(r);if(i)return new e(this.left,i)},e.prototype.leafPrepend=function(r){var i=this.left.leafPrepend(r);if(i)return new e(i,this.right)},e.prototype.appendInner=function(r){return this.left.depth>=Math.max(this.right.depth,r.depth)+1?new e(this.left,new e(this.right,r)):new e(this,r)},e}(st);const f8=500;class nn{constructor(e,n){this.items=e,this.eventCount=n}popEvent(e,n){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;n&&(i=this.remapping(r,this.items.length),o=i.maps.length);let a=e.tr,s,c,l=[],u=[];return this.items.forEach((f,d)=>{if(!f.step){i||(i=this.remapping(r,d+1),o=i.maps.length),o--,u.push(f);return}if(i){u.push(new fn(f.map));let h=f.step.map(i.slice(o)),p;h&&a.maybeStep(h).doc&&(p=a.mapping.maps[a.mapping.maps.length-1],l.push(new fn(p,void 0,void 0,l.length+u.length))),o--,p&&i.appendMap(p,o)}else a.maybeStep(f.step);if(f.selection)return s=i?f.selection.map(i.slice(o)):f.selection,c=new nn(this.items.slice(0,r).append(u.reverse().concat(l)),this.eventCount-1),!1},this.items.length,0),{remaining:c,transform:a,selection:s}}addTransform(e,n,r,i){let o=[],a=this.eventCount,s=this.items,c=!i&&s.length?s.get(s.length-1):null;for(let u=0;u<e.steps.length;u++){let f=e.steps[u].invert(e.docs[u]),d=new fn(e.mapping.maps[u],f,n),h;(h=c&&c.merge(d))&&(d=h,u?o.pop():s=s.slice(0,s.length-1)),o.push(d),n&&(a++,n=void 0),i||(c=d)}let l=a-r.depth;return l>h8&&(s=d8(s,l),a-=l),new nn(s.append(o),a)}remapping(e,n){let r=new di;return this.items.forEach((i,o)=>{let a=i.mirrorOffset!=null&&o-i.mirrorOffset>=e?r.maps.length-i.mirrorOffset:void 0;r.appendMap(i.map,a)},e,n),r}addMaps(e){return this.eventCount==0?this:new nn(this.items.append(e.map(n=>new fn(n))),this.eventCount)}rebased(e,n){if(!this.eventCount)return this;let r=[],i=Math.max(0,this.items.length-n),o=e.mapping,a=e.steps.length,s=this.eventCount;this.items.forEach(d=>{d.selection&&s--},i);let c=n;this.items.forEach(d=>{let h=o.getMirror(--c);if(h==null)return;a=Math.min(a,h);let p=o.maps[h];if(d.step){let m=e.steps[h].invert(e.docs[h]),g=d.selection&&d.selection.map(o.slice(c+1,h));g&&s++,r.push(new fn(p,m,g))}else r.push(new fn(p))},i);let l=[];for(let d=n;d<a;d++)l.push(new fn(o.maps[d]));let u=this.items.slice(0,i).append(l).append(r),f=new nn(u,s);return f.emptyItemCount()>f8&&(f=f.compress(this.items.length-r.length)),f}emptyItemCount(){let e=0;return this.items.forEach(n=>{n.step||e++}),e}compress(e=this.items.length){let n=this.remapping(0,e),r=n.maps.length,i=[],o=0;return this.items.forEach((a,s)=>{if(s>=e)i.push(a),a.selection&&o++;else if(a.step){let c=a.step.map(n.slice(r)),l=c&&c.getMap();if(r--,l&&n.appendMap(l,r),c){let u=a.selection&&a.selection.map(n.slice(r));u&&o++;let f=new fn(l.invert(),c,u),d,h=i.length-1;(d=i.length&&i[h].merge(f))?i[h]=d:i.push(f)}}else a.map&&r--},this.items.length,0),new nn(st.from(i.reverse()),o)}}nn.empty=new nn(st.empty,0);function d8(t,e){let n;return t.forEach((r,i)=>{if(r.selection&&e--==0)return n=i,!1}),t.slice(n)}class fn{constructor(e,n,r,i){this.map=e,this.step=n,this.selection=r,this.mirrorOffset=i}merge(e){if(this.step&&e.step&&!e.selection){let n=e.step.merge(this.step);if(n)return new fn(n.getMap().invert(),n,this.selection)}}}class Yn{constructor(e,n,r,i,o){this.done=e,this.undone=n,this.prevRanges=r,this.prevTime=i,this.prevComposition=o}}const h8=20;function p8(t,e,n,r){let i=n.getMeta(Nr),o;if(i)return i.historyState;n.getMeta(y8)&&(t=new Yn(t.done,t.undone,null,0,-1));let a=n.getMeta("appendedTransaction");if(n.steps.length==0)return t;if(a&&a.getMeta(Nr))return a.getMeta(Nr).redo?new Yn(t.done.addTransform(n,void 0,r,Ta(e)),t.undone,Fm(n.mapping.maps),t.prevTime,t.prevComposition):new Yn(t.done,t.undone.addTransform(n,void 0,r,Ta(e)),null,t.prevTime,t.prevComposition);if(n.getMeta("addToHistory")!==!1&&!(a&&a.getMeta("addToHistory")===!1)){let s=n.getMeta("composition"),c=t.prevTime==0||!a&&t.prevComposition!=s&&(t.prevTime<(n.time||0)-r.newGroupDelay||!g8(n,t.prevRanges)),l=a?tl(t.prevRanges,n.mapping):Fm(n.mapping.maps);return new Yn(t.done.addTransform(n,c?e.selection.getBookmark():void 0,r,Ta(e)),nn.empty,l,n.time,s??t.prevComposition)}else return(o=n.getMeta("rebased"))?new Yn(t.done.rebased(n,o),t.undone.rebased(n,o),tl(t.prevRanges,n.mapping),t.prevTime,t.prevComposition):new Yn(t.done.addMaps(n.mapping.maps),t.undone.addMaps(n.mapping.maps),tl(t.prevRanges,n.mapping),t.prevTime,t.prevComposition)}function g8(t,e){if(!e)return!1;if(!t.docChanged)return!0;let n=!1;return t.mapping.maps[0].forEach((r,i)=>{for(let o=0;o<e.length;o+=2)r<=e[o+1]&&i>=e[o]&&(n=!0)}),n}function Fm(t){let e=[];for(let n=t.length-1;n>=0&&e.length==0;n--)t[n].forEach((r,i,o,a)=>e.push(o,a));return e}function tl(t,e){if(!t)return null;let n=[];for(let r=0;r<t.length;r+=2){let i=e.map(t[r],1),o=e.map(t[r+1],-1);i<=o&&n.push(i,o)}return n}function m8(t,e,n){let r=Ta(e),i=Nr.get(e).spec.config,o=(n?t.undone:t.done).popEvent(e,r);if(!o)return null;let a=o.selection.resolve(o.transform.doc),s=(n?t.done:t.undone).addTransform(o.transform,e.selection.getBookmark(),i,r),c=new Yn(n?s:o.remaining,n?o.remaining:s,null,0,-1);return o.transform.setSelection(a).setMeta(Nr,{redo:n,historyState:c})}let nl=!1,Om=null;function Ta(t){let e=t.plugins;if(Om!=e){nl=!1,Om=e;for(let n=0;n<e.length;n++)if(e[n].spec.historyPreserveItems){nl=!0;break}}return nl}const Nr=new ki("history"),y8=new ki("closeHistory");function b8(t={}){return t={depth:t.depth||100,newGroupDelay:t.newGroupDelay||500},new jr({key:Nr,state:{init(){return new Yn(nn.empty,nn.empty,null,0,-1)},apply(e,n,r){return p8(n,r,e,t)}},config:t,props:{handleDOMEvents:{beforeinput(e,n){let r=n.inputType,i=r=="historyUndo"?Fx:r=="historyRedo"?Ox:null;return i?(n.preventDefault(),i(e.state,e.dispatch)):!1}}}})}function kx(t,e){return(n,r)=>{let i=Nr.getState(n);if(!i||(t?i.undone:i.done).eventCount==0)return!1;if(r){let o=m8(i,n,t);o&&r(e?o.scrollIntoView():o)}return!0}}const Fx=kx(!1,!0),Ox=kx(!0,!0);function v8(t={}){return new jr({view(e){return new x8(e,t)}})}class x8{constructor(e,n){var r;this.editorView=e,this.cursorPos=null,this.element=null,this.timeout=-1,this.width=(r=n.width)!==null&&r!==void 0?r:1,this.color=n.color===!1?void 0:n.color||"black",this.class=n.class,this.handlers=["dragover","dragend","drop","dragleave"].map(i=>{let o=a=>{this[i](a)};return e.dom.addEventListener(i,o),{name:i,handler:o}})}destroy(){this.handlers.forEach(({name:e,handler:n})=>this.editorView.dom.removeEventListener(e,n))}update(e,n){this.cursorPos!=null&&n.doc!=e.state.doc&&(this.cursorPos>e.state.doc.content.size?this.setCursor(null):this.updateOverlay())}setCursor(e){e!=this.cursorPos&&(this.cursorPos=e,e==null?(this.element.parentNode.removeChild(this.element),this.element=null):this.updateOverlay())}updateOverlay(){let e=this.editorView.state.doc.resolve(this.cursorPos),n=!e.parent.inlineContent,r;if(n){let s=e.nodeBefore,c=e.nodeAfter;if(s||c){let l=this.editorView.nodeDOM(this.cursorPos-(s?s.nodeSize:0));if(l){let u=l.getBoundingClientRect(),f=s?u.bottom:u.top;s&&c&&(f=(f+this.editorView.nodeDOM(this.cursorPos).getBoundingClientRect().top)/2),r={left:u.left,right:u.right,top:f-this.width/2,bottom:f+this.width/2}}}}if(!r){let s=this.editorView.coordsAtPos(this.cursorPos);r={left:s.left-this.width/2,right:s.left+this.width/2,top:s.top,bottom:s.bottom}}let i=this.editorView.dom.offsetParent;this.element||(this.element=i.appendChild(document.createElement("div")),this.class&&(this.element.className=this.class),this.element.style.cssText="position: absolute; z-index: 50; pointer-events: none;",this.color&&(this.element.style.backgroundColor=this.color)),this.element.classList.toggle("prosemirror-dropcursor-block",n),this.element.classList.toggle("prosemirror-dropcursor-inline",!n);let o,a;if(!i||i==document.body&&getComputedStyle(i).position=="static")o=-pageXOffset,a=-pageYOffset;else{let s=i.getBoundingClientRect();o=s.left-i.scrollLeft,a=s.top-i.scrollTop}this.element.style.left=r.left-o+"px",this.element.style.top=r.top-a+"px",this.element.style.width=r.right-r.left+"px",this.element.style.height=r.bottom-r.top+"px"}scheduleRemoval(e){clearTimeout(this.timeout),this.timeout=setTimeout(()=>this.setCursor(null),e)}dragover(e){if(!this.editorView.editable)return;let n=this.editorView.posAtCoords({left:e.clientX,top:e.clientY}),r=n&&n.inside>=0&&this.editorView.state.doc.nodeAt(n.inside),i=r&&r.type.spec.disableDropCursor,o=typeof i=="function"?i(this.editorView,n,e):i;if(n&&!o){let a=n.pos;if(this.editorView.dragging&&this.editorView.dragging.slice){let s=N0(this.editorView.state.doc,a,this.editorView.dragging.slice);s!=null&&(a=s)}this.setCursor(a),this.scheduleRemoval(5e3)}}dragend(){this.scheduleRemoval(20)}drop(){this.scheduleRemoval(20)}dragleave(e){(e.target==this.editorView.dom||!this.editorView.dom.contains(e.relatedTarget))&&this.setCursor(null)}}class Ye extends Fe{constructor(e){super(e,e)}map(e,n){let r=e.resolve(n.map(this.head));return Ye.valid(r)?new Ye(r):Fe.near(r)}content(){return _e.empty}eq(e){return e instanceof Ye&&e.head==this.head}toJSON(){return{type:"gapcursor",pos:this.head}}static fromJSON(e,n){if(typeof n.pos!="number")throw new RangeError("Invalid input for GapCursor.fromJSON");return new Ye(e.resolve(n.pos))}getBookmark(){return new zh(this.anchor)}static valid(e){let n=e.parent;if(n.isTextblock||!D8(e)||!w8(e))return!1;let r=n.type.spec.allowGapCursor;if(r!=null)return r;let i=n.contentMatchAt(e.index()).defaultType;return i&&i.isTextblock}static findGapCursorFrom(e,n,r=!1){e:for(;;){if(!r&&Ye.valid(e))return e;let i=e.pos,o=null;for(let a=e.depth;;a--){let s=e.node(a);if(n>0?e.indexAfter(a)<s.childCount:e.index(a)>0){o=s.child(n>0?e.indexAfter(a):e.index(a)-1);break}else if(a==0)return null;i+=n;let c=e.doc.resolve(i);if(Ye.valid(c))return c}for(;;){let a=n>0?o.firstChild:o.lastChild;if(!a){if(o.isAtom&&!o.isText&&!Ae.isSelectable(o)){e=e.doc.resolve(i+o.nodeSize*n),r=!1;continue e}break}o=a,i+=n;let s=e.doc.resolve(i);if(Ye.valid(s))return s}return null}}}Ye.prototype.visible=!1;Ye.findFrom=Ye.findGapCursorFrom;Fe.jsonID("gapcursor",Ye);class zh{constructor(e){this.pos=e}map(e){return new zh(e.map(this.pos))}resolve(e){let n=e.resolve(this.pos);return Ye.valid(n)?new Ye(n):Fe.near(n)}}function D8(t){for(let e=t.depth;e>=0;e--){let n=t.index(e),r=t.node(e);if(n==0){if(r.type.spec.isolating)return!0;continue}for(let i=r.child(n-1);;i=i.lastChild){if(i.childCount==0&&!i.inlineContent||i.isAtom||i.type.spec.isolating)return!0;if(i.inlineContent)return!1}}return!0}function w8(t){for(let e=t.depth;e>=0;e--){let n=t.indexAfter(e),r=t.node(e);if(n==r.childCount){if(r.type.spec.isolating)return!0;continue}for(let i=r.child(n);;i=i.firstChild){if(i.childCount==0&&!i.inlineContent||i.isAtom||i.type.spec.isolating)return!0;if(i.inlineContent)return!1}}return!0}function _8(){return new jr({props:{decorations:S8,createSelectionBetween(t,e,n){return e.pos==n.pos&&Ye.valid(n)?new Ye(n):null},handleClick:E8,handleKeyDown:T8,handleDOMEvents:{beforeinput:C8}}})}const T8=mh({ArrowLeft:Ko("horiz",-1),ArrowRight:Ko("horiz",1),ArrowUp:Ko("vert",-1),ArrowDown:Ko("vert",1)});function Ko(t,e){const n=t=="vert"?e>0?"down":"up":e>0?"right":"left";return function(r,i,o){let a=r.selection,s=e>0?a.$to:a.$from,c=a.empty;if(a instanceof Be){if(!o.endOfTextblock(n)||s.depth==0)return!1;c=!1,s=r.doc.resolve(e>0?s.after():s.before())}let l=Ye.findGapCursorFrom(s,e,c);return l?(i&&i(r.tr.setSelection(new Ye(l))),!0):!1}}function E8(t,e,n){if(!t||!t.editable)return!1;let r=t.state.doc.resolve(e);if(!Ye.valid(r))return!1;let i=t.posAtCoords({left:n.clientX,top:n.clientY});return i&&i.inside>-1&&Ae.isSelectable(t.state.doc.nodeAt(i.inside))?!1:(t.dispatch(t.state.tr.setSelection(new Ye(r))),!0)}function C8(t,e){if(e.inputType!="insertCompositionText"||!(t.state.selection instanceof Ye))return!1;let{$from:n}=t.state.selection,r=n.parent.contentMatchAt(n.index()).findWrapping(t.state.schema.nodes.text);if(!r)return!1;let i=pe.empty;for(let a=r.length-1;a>=0;a--)i=pe.from(r[a].createAndFill(null,i));let o=t.state.tr.replace(n.pos,n.pos,new _e(i,0,0));return o.setSelection(Be.near(o.doc.resolve(n.pos+1))),t.dispatch(o),!1}function S8(t){if(!(t.selection instanceof Ye))return null;let e=document.createElement("div");return e.className="ProseMirror-gapcursor",Je.create(t.doc,[pt.widget(t.selection.head,e,{key:"gapcursor"})])}var Md,Wd;if(typeof WeakMap<"u"){let t=new WeakMap;Md=e=>t.get(e),Wd=(e,n)=>(t.set(e,n),n)}else{const t=[];let n=0;Md=r=>{for(let i=0;i<t.length;i+=2)if(t[i]==r)return t[i+1]},Wd=(r,i)=>(n==10&&(n=0),t[n++]=r,t[n++]=i)}var Qe=class{constructor(t,e,n,r){this.width=t,this.height=e,this.map=n,this.problems=r}findCell(t){for(let e=0;e<this.map.length;e++){const n=this.map[e];if(n!=t)continue;const r=e%this.width,i=e/this.width|0;let o=r+1,a=i+1;for(let s=1;o<this.width&&this.map[e+s]==n;s++)o++;for(let s=1;a<this.height&&this.map[e+this.width*s]==n;s++)a++;return{left:r,top:i,right:o,bottom:a}}throw new RangeError(`No cell with offset ${t} found`)}colCount(t){for(let e=0;e<this.map.length;e++)if(this.map[e]==t)return e%this.width;throw new RangeError(`No cell with offset ${t} found`)}nextCell(t,e,n){const{left:r,right:i,top:o,bottom:a}=this.findCell(t);return e=="horiz"?(n<0?r==0:i==this.width)?null:this.map[o*this.width+(n<0?r-1:i)]:(n<0?o==0:a==this.height)?null:this.map[r+this.width*(n<0?o-1:a)]}rectBetween(t,e){const{left:n,right:r,top:i,bottom:o}=this.findCell(t),{left:a,right:s,top:c,bottom:l}=this.findCell(e);return{left:Math.min(n,a),top:Math.min(i,c),right:Math.max(r,s),bottom:Math.max(o,l)}}cellsInRect(t){const e=[],n={};for(let r=t.top;r<t.bottom;r++)for(let i=t.left;i<t.right;i++){const o=r*this.width+i,a=this.map[o];n[a]||(n[a]=!0,!(i==t.left&&i&&this.map[o-1]==a||r==t.top&&r&&this.map[o-this.width]==a)&&e.push(a))}return e}positionAt(t,e,n){for(let r=0,i=0;;r++){const o=i+n.child(r).nodeSize;if(r==t){let a=e+t*this.width;const s=(t+1)*this.width;for(;a<s&&this.map[a]<i;)a++;return a==s?o-1:this.map[a]}i=o}}static get(t){return Md(t)||Wd(t,A8(t))}};function A8(t){if(t.type.spec.tableRole!="table")throw new RangeError("Not a table node: "+t.type.name);const e=U8(t),n=t.childCount,r=[];let i=0,o=null;const a=[];for(let l=0,u=e*n;l<u;l++)r[l]=0;for(let l=0,u=0;l<n;l++){const f=t.child(l);u++;for(let p=0;;p++){for(;i<r.length&&r[i]!=0;)i++;if(p==f.childCount)break;const m=f.child(p),{colspan:g,rowspan:y,colwidth:b}=m.attrs;for(let v=0;v<y;v++){if(v+l>=n){(o||(o=[])).push({type:"overlong_rowspan",pos:u,n:y-v});break}const T=i+v*e;for(let w=0;w<g;w++){r[T+w]==0?r[T+w]=u:(o||(o=[])).push({type:"collision",row:l,pos:u,n:g-w});const E=b&&b[w];if(E){const S=(T+w)%e*2,U=a[S];U==null||U!=E&&a[S+1]==1?(a[S]=E,a[S+1]=1):U==E&&a[S+1]++}}}i+=g,u+=m.nodeSize}const d=(l+1)*e;let h=0;for(;i<d;)r[i++]==0&&h++;h&&(o||(o=[])).push({type:"missing",row:l,n:h}),u++}(e===0||n===0)&&(o||(o=[])).push({type:"zero_sized"});const s=new Qe(e,n,r,o);let c=!1;for(let l=0;!c&&l<a.length;l+=2)a[l]!=null&&a[l+1]<n&&(c=!0);return c&&k8(s,a,t),s}function U8(t){let e=-1,n=!1;for(let r=0;r<t.childCount;r++){const i=t.child(r);let o=0;if(n)for(let a=0;a<r;a++){const s=t.child(a);for(let c=0;c<s.childCount;c++){const l=s.child(c);a+l.attrs.rowspan>r&&(o+=l.attrs.colspan)}}for(let a=0;a<i.childCount;a++){const s=i.child(a);o+=s.attrs.colspan,s.attrs.rowspan>1&&(n=!0)}e==-1?e=o:e!=o&&(e=Math.max(e,o))}return e}function k8(t,e,n){t.problems||(t.problems=[]);const r={};for(let i=0;i<t.map.length;i++){const o=t.map[i];if(r[o])continue;r[o]=!0;const a=n.nodeAt(o);if(!a)throw new RangeError(`No cell with offset ${o} found`);let s=null;const c=a.attrs;for(let l=0;l<c.colspan;l++){const u=(i+l)%t.width,f=e[u*2];f!=null&&(!c.colwidth||c.colwidth[l]!=f)&&((s||(s=F8(c)))[l]=f)}s&&t.problems.unshift({type:"colwidth mismatch",pos:o,colwidth:s})}}function F8(t){if(t.colwidth)return t.colwidth.slice();const e=[];for(let n=0;n<t.colspan;n++)e.push(0);return e}function gt(t){let e=t.cached.tableNodeTypes;if(!e){e=t.cached.tableNodeTypes={};for(const n in t.nodes){const r=t.nodes[n],i=r.spec.tableRole;i&&(e[i]=r)}}return e}var tr=new ki("selectingCells");function Oi(t){for(let e=t.depth-1;e>0;e--)if(t.node(e).type.spec.tableRole=="row")return t.node(0).resolve(t.before(e+1));return null}function O8(t){for(let e=t.depth;e>0;e--){const n=t.node(e).type.spec.tableRole;if(n==="cell"||n==="header_cell")return t.node(e)}return null}function sn(t){const e=t.selection.$head;for(let n=e.depth;n>0;n--)if(e.node(n).type.spec.tableRole=="row")return!0;return!1}function Zs(t){const e=t.selection;if("$anchorCell"in e&&e.$anchorCell)return e.$anchorCell.pos>e.$headCell.pos?e.$anchorCell:e.$headCell;if("node"in e&&e.node&&e.node.type.spec.tableRole=="cell")return e.$anchor;const n=Oi(e.$head)||R8(e.$head);if(n)return n;throw new RangeError(`No cell found around position ${e.head}`)}function R8(t){for(let e=t.nodeAfter,n=t.pos;e;e=e.firstChild,n++){const r=e.type.spec.tableRole;if(r=="cell"||r=="header_cell")return t.doc.resolve(n)}for(let e=t.nodeBefore,n=t.pos;e;e=e.lastChild,n--){const r=e.type.spec.tableRole;if(r=="cell"||r=="header_cell")return t.doc.resolve(n-e.nodeSize)}}function Ld(t){return t.parent.type.spec.tableRole=="row"&&!!t.nodeAfter}function N8(t){return t.node(0).resolve(t.pos+t.nodeAfter.nodeSize)}function jh(t,e){return t.depth==e.depth&&t.pos>=e.start(-1)&&t.pos<=e.end(-1)}function Rx(t,e,n){const r=t.node(-1),i=Qe.get(r),o=t.start(-1),a=i.nextCell(t.pos-o,e,n);return a==null?null:t.node(0).resolve(o+a)}function Pr(t,e,n=1){const r={...t,colspan:t.colspan-n};return r.colwidth&&(r.colwidth=r.colwidth.slice(),r.colwidth.splice(e,n),r.colwidth.some(i=>i>0)||(r.colwidth=null)),r}function Nx(t,e,n=1){const r={...t,colspan:t.colspan+n};if(r.colwidth){r.colwidth=r.colwidth.slice();for(let i=0;i<n;i++)r.colwidth.splice(e,0,0)}return r}function B8(t,e,n){const r=gt(e.type.schema).header_cell;for(let i=0;i<t.height;i++)if(e.nodeAt(t.map[n+i*t.width]).type!=r)return!1;return!0}var Ke=class kn extends Fe{constructor(e,n=e){const r=e.node(-1),i=Qe.get(r),o=e.start(-1),a=i.rectBetween(e.pos-o,n.pos-o),s=e.node(0),c=i.cellsInRect(a).filter(u=>u!=n.pos-o);c.unshift(n.pos-o);const l=c.map(u=>{const f=r.nodeAt(u);if(!f)throw RangeError(`No cell with offset ${u} found`);const d=o+u+1;return new oh(s.resolve(d),s.resolve(d+f.content.size))});super(l[0].$from,l[0].$to,l),this.$anchorCell=e,this.$headCell=n}map(e,n){const r=e.resolve(n.map(this.$anchorCell.pos)),i=e.resolve(n.map(this.$headCell.pos));if(Ld(r)&&Ld(i)&&jh(r,i)){const o=this.$anchorCell.node(-1)!=r.node(-1);return o&&this.isRowSelection()?kn.rowSelection(r,i):o&&this.isColSelection()?kn.colSelection(r,i):new kn(r,i)}return Be.between(r,i)}content(){const e=this.$anchorCell.node(-1),n=Qe.get(e),r=this.$anchorCell.start(-1),i=n.rectBetween(this.$anchorCell.pos-r,this.$headCell.pos-r),o={},a=[];for(let c=i.top;c<i.bottom;c++){const l=[];for(let u=c*n.width+i.left,f=i.left;f<i.right;f++,u++){const d=n.map[u];if(o[d])continue;o[d]=!0;const h=n.findCell(d);let p=e.nodeAt(d);if(!p)throw RangeError(`No cell with offset ${d} found`);const m=i.left-h.left,g=h.right-i.right;if(m>0||g>0){let y=p.attrs;if(m>0&&(y=Pr(y,0,m)),g>0&&(y=Pr(y,y.colspan-g,g)),h.left<i.left){if(p=p.type.createAndFill(y),!p)throw RangeError(`Could not create cell with attrs ${JSON.stringify(y)}`)}else p=p.type.create(y,p.content)}if(h.top<i.top||h.bottom>i.bottom){const y={...p.attrs,rowspan:Math.min(h.bottom,i.bottom)-Math.max(h.top,i.top)};h.top<i.top?p=p.type.createAndFill(y):p=p.type.create(y,p.content)}l.push(p)}a.push(e.child(c).copy(pe.from(l)))}const s=this.isColSelection()&&this.isRowSelection()?e:a;return new _e(pe.from(s),1,1)}replace(e,n=_e.empty){const r=e.steps.length,i=this.ranges;for(let a=0;a<i.length;a++){const{$from:s,$to:c}=i[a],l=e.mapping.slice(r);e.replace(l.map(s.pos),l.map(c.pos),a?_e.empty:n)}const o=Fe.findFrom(e.doc.resolve(e.mapping.slice(r).map(this.to)),-1);o&&e.setSelection(o)}replaceWith(e,n){this.replace(e,new _e(pe.from(n),0,0))}forEachCell(e){const n=this.$anchorCell.node(-1),r=Qe.get(n),i=this.$anchorCell.start(-1),o=r.cellsInRect(r.rectBetween(this.$anchorCell.pos-i,this.$headCell.pos-i));for(let a=0;a<o.length;a++)e(n.nodeAt(o[a]),i+o[a])}isColSelection(){const e=this.$anchorCell.index(-1),n=this.$headCell.index(-1);if(Math.min(e,n)>0)return!1;const r=e+this.$anchorCell.nodeAfter.attrs.rowspan,i=n+this.$headCell.nodeAfter.attrs.rowspan;return Math.max(r,i)==this.$headCell.node(-1).childCount}static colSelection(e,n=e){const r=e.node(-1),i=Qe.get(r),o=e.start(-1),a=i.findCell(e.pos-o),s=i.findCell(n.pos-o),c=e.node(0);return a.top<=s.top?(a.top>0&&(e=c.resolve(o+i.map[a.left])),s.bottom<i.height&&(n=c.resolve(o+i.map[i.width*(i.height-1)+s.right-1]))):(s.top>0&&(n=c.resolve(o+i.map[s.left])),a.bottom<i.height&&(e=c.resolve(o+i.map[i.width*(i.height-1)+a.right-1]))),new kn(e,n)}isRowSelection(){const e=this.$anchorCell.node(-1),n=Qe.get(e),r=this.$anchorCell.start(-1),i=n.colCount(this.$anchorCell.pos-r),o=n.colCount(this.$headCell.pos-r);if(Math.min(i,o)>0)return!1;const a=i+this.$anchorCell.nodeAfter.attrs.colspan,s=o+this.$headCell.nodeAfter.attrs.colspan;return Math.max(a,s)==n.width}eq(e){return e instanceof kn&&e.$anchorCell.pos==this.$anchorCell.pos&&e.$headCell.pos==this.$headCell.pos}static rowSelection(e,n=e){const r=e.node(-1),i=Qe.get(r),o=e.start(-1),a=i.findCell(e.pos-o),s=i.findCell(n.pos-o),c=e.node(0);return a.left<=s.left?(a.left>0&&(e=c.resolve(o+i.map[a.top*i.width])),s.right<i.width&&(n=c.resolve(o+i.map[i.width*(s.top+1)-1]))):(s.left>0&&(n=c.resolve(o+i.map[s.top*i.width])),a.right<i.width&&(e=c.resolve(o+i.map[i.width*(a.top+1)-1]))),new kn(e,n)}toJSON(){return{type:"cell",anchor:this.$anchorCell.pos,head:this.$headCell.pos}}static fromJSON(e,n){return new kn(e.resolve(n.anchor),e.resolve(n.head))}static create(e,n,r=n){return new kn(e.resolve(n),e.resolve(r))}getBookmark(){return new I8(this.$anchorCell.pos,this.$headCell.pos)}};Ke.prototype.visible=!1;Fe.jsonID("cell",Ke);var I8=class Bx{constructor(e,n){this.anchor=e,this.head=n}map(e){return new Bx(e.map(this.anchor),e.map(this.head))}resolve(e){const n=e.resolve(this.anchor),r=e.resolve(this.head);return n.parent.type.spec.tableRole=="row"&&r.parent.type.spec.tableRole=="row"&&n.index()<n.parent.childCount&&r.index()<r.parent.childCount&&jh(n,r)?new Ke(n,r):Fe.near(r,1)}};function M8(t){if(!(t.selection instanceof Ke))return null;const e=[];return t.selection.forEachCell((n,r)=>{e.push(pt.node(r,r+n.nodeSize,{class:"selectedCell"}))}),Je.create(t.doc,e)}function W8({$from:t,$to:e}){if(t.pos==e.pos||t.pos<e.pos-6)return!1;let n=t.pos,r=e.pos,i=t.depth;for(;i>=0&&!(t.after(i+1)<t.end(i));i--,n++);for(let o=e.depth;o>=0&&!(e.before(o+1)>e.start(o));o--,r--);return n==r&&/row|table/.test(t.node(i).type.spec.tableRole)}function L8({$from:t,$to:e}){let n,r;for(let i=t.depth;i>0;i--){const o=t.node(i);if(o.type.spec.tableRole==="cell"||o.type.spec.tableRole==="header_cell"){n=o;break}}for(let i=e.depth;i>0;i--){const o=e.node(i);if(o.type.spec.tableRole==="cell"||o.type.spec.tableRole==="header_cell"){r=o;break}}return n!==r&&e.parentOffset===0}function P8(t,e,n){const r=(e||t).selection,i=(e||t).doc;let o,a;if(r instanceof Ae&&(a=r.node.type.spec.tableRole)){if(a=="cell"||a=="header_cell")o=Ke.create(i,r.from);else if(a=="row"){const s=i.resolve(r.from+1);o=Ke.rowSelection(s,s)}else if(!n){const s=Qe.get(r.node),c=r.from+1,l=c+s.map[s.width*s.height-1];o=Ke.create(i,c+1,l)}}else r instanceof Be&&W8(r)?o=Be.create(i,r.from):r instanceof Be&&L8(r)&&(o=Be.create(i,r.$from.start(),r.$from.end()));return o&&(e||(e=t.tr)).setSelection(o),e}var q8=new ki("fix-tables");function Ix(t,e,n,r){const i=t.childCount,o=e.childCount;e:for(let a=0,s=0;a<o;a++){const c=e.child(a);for(let l=s,u=Math.min(i,a+3);l<u;l++)if(t.child(l)==c){s=l+1,n+=c.nodeSize;continue e}r(c,n),s<i&&t.child(s).sameMarkup(c)?Ix(t.child(s),c,n+1,r):c.nodesBetween(0,c.content.size,r,n+1),n+=c.nodeSize}}function Mx(t,e){let n;const r=(i,o)=>{i.type.spec.tableRole=="table"&&(n=z8(t,i,o,n))};return e?e.doc!=t.doc&&Ix(e.doc,t.doc,0,r):t.doc.descendants(r),n}function z8(t,e,n,r){const i=Qe.get(e);if(!i.problems)return r;r||(r=t.tr);const o=[];for(let c=0;c<i.height;c++)o.push(0);for(let c=0;c<i.problems.length;c++){const l=i.problems[c];if(l.type=="collision"){const u=e.nodeAt(l.pos);if(!u)continue;const f=u.attrs;for(let d=0;d<f.rowspan;d++)o[l.row+d]+=l.n;r.setNodeMarkup(r.mapping.map(n+1+l.pos),null,Pr(f,f.colspan-l.n,l.n))}else if(l.type=="missing")o[l.row]+=l.n;else if(l.type=="overlong_rowspan"){const u=e.nodeAt(l.pos);if(!u)continue;r.setNodeMarkup(r.mapping.map(n+1+l.pos),null,{...u.attrs,rowspan:u.attrs.rowspan-l.n})}else if(l.type=="colwidth mismatch"){const u=e.nodeAt(l.pos);if(!u)continue;r.setNodeMarkup(r.mapping.map(n+1+l.pos),null,{...u.attrs,colwidth:l.colwidth})}else if(l.type=="zero_sized"){const u=r.mapping.map(n);r.delete(u,u+e.nodeSize)}}let a,s;for(let c=0;c<o.length;c++)o[c]&&(a==null&&(a=c),s=c);for(let c=0,l=n+1;c<i.height;c++){const u=e.child(c),f=l+u.nodeSize,d=o[c];if(d>0){let h="cell";u.firstChild&&(h=u.firstChild.type.spec.tableRole);const p=[];for(let g=0;g<d;g++){const y=gt(t.schema)[h].createAndFill();y&&p.push(y)}const m=(c==0||a==c-1)&&s==c?l+1:f-1;r.insert(r.mapping.map(m),p)}l=f}return r.setMeta(q8,{fixTables:!0})}function Dn(t){const e=t.selection,n=Zs(t),r=n.node(-1),i=n.start(-1),o=Qe.get(r);return{...e instanceof Ke?o.rectBetween(e.$anchorCell.pos-i,e.$headCell.pos-i):o.findCell(n.pos-i),tableStart:i,map:o,table:r}}function Wx(t,{map:e,tableStart:n,table:r},i){let o=i>0?-1:0;B8(e,r,i+o)&&(o=i==0||i==e.width?null:0);for(let a=0;a<e.height;a++){const s=a*e.width+i;if(i>0&&i<e.width&&e.map[s-1]==e.map[s]){const c=e.map[s],l=r.nodeAt(c);t.setNodeMarkup(t.mapping.map(n+c),null,Nx(l.attrs,i-e.colCount(c))),a+=l.attrs.rowspan-1}else{const c=o==null?gt(r.type.schema).cell:r.nodeAt(e.map[s+o]).type,l=e.positionAt(a,i,r);t.insert(t.mapping.map(n+l),c.createAndFill())}}return t}function j8(t,e){if(!sn(t))return!1;if(e){const n=Dn(t);e(Wx(t.tr,n,n.left))}return!0}function $8(t,e){if(!sn(t))return!1;if(e){const n=Dn(t);e(Wx(t.tr,n,n.right))}return!0}function V8(t,{map:e,table:n,tableStart:r},i){const o=t.mapping.maps.length;for(let a=0;a<e.height;){const s=a*e.width+i,c=e.map[s],l=n.nodeAt(c),u=l.attrs;if(i>0&&e.map[s-1]==c||i<e.width-1&&e.map[s+1]==c)t.setNodeMarkup(t.mapping.slice(o).map(r+c),null,Pr(u,i-e.colCount(c)));else{const f=t.mapping.slice(o).map(r+c);t.delete(f,f+l.nodeSize)}a+=u.rowspan}}function H8(t,e){if(!sn(t))return!1;if(e){const n=Dn(t),r=t.tr;if(n.left==0&&n.right==n.map.width)return!1;for(let i=n.right-1;V8(r,n,i),i!=n.left;i--){const o=n.tableStart?r.doc.nodeAt(n.tableStart-1):r.doc;if(!o)throw RangeError("No table found");n.table=o,n.map=Qe.get(o)}e(r)}return!0}function X8(t,e,n){var r;const i=gt(e.type.schema).header_cell;for(let o=0;o<t.width;o++)if(((r=e.nodeAt(t.map[o+n*t.width]))==null?void 0:r.type)!=i)return!1;return!0}function Lx(t,{map:e,tableStart:n,table:r},i){var o;let a=n;for(let l=0;l<i;l++)a+=r.child(l).nodeSize;const s=[];let c=i>0?-1:0;X8(e,r,i+c)&&(c=i==0||i==e.height?null:0);for(let l=0,u=e.width*i;l<e.width;l++,u++)if(i>0&&i<e.height&&e.map[u]==e.map[u-e.width]){const f=e.map[u],d=r.nodeAt(f).attrs;t.setNodeMarkup(n+f,null,{...d,rowspan:d.rowspan+1}),l+=d.colspan-1}else{const f=c==null?gt(r.type.schema).cell:(o=r.nodeAt(e.map[u+c*e.width]))==null?void 0:o.type,d=f==null?void 0:f.createAndFill();d&&s.push(d)}return t.insert(a,gt(r.type.schema).row.create(null,s)),t}function G8(t,e){if(!sn(t))return!1;if(e){const n=Dn(t);e(Lx(t.tr,n,n.top))}return!0}function K8(t,e){if(!sn(t))return!1;if(e){const n=Dn(t);e(Lx(t.tr,n,n.bottom))}return!0}function J8(t,{map:e,table:n,tableStart:r},i){let o=0;for(let l=0;l<i;l++)o+=n.child(l).nodeSize;const a=o+n.child(i).nodeSize,s=t.mapping.maps.length;t.delete(o+r,a+r);const c=new Set;for(let l=0,u=i*e.width;l<e.width;l++,u++){const f=e.map[u];if(!c.has(f)){if(c.add(f),i>0&&f==e.map[u-e.width]){const d=n.nodeAt(f).attrs;t.setNodeMarkup(t.mapping.slice(s).map(f+r),null,{...d,rowspan:d.rowspan-1}),l+=d.colspan-1}else if(i<e.height&&f==e.map[u+e.width]){const d=n.nodeAt(f),h=d.attrs,p=d.type.create({...h,rowspan:d.attrs.rowspan-1},d.content),m=e.positionAt(i+1,l,n);t.insert(t.mapping.slice(s).map(r+m),p),l+=h.colspan-1}}}}function Z8(t,e){if(!sn(t))return!1;if(e){const n=Dn(t),r=t.tr;if(n.top==0&&n.bottom==n.map.height)return!1;for(let i=n.bottom-1;J8(r,n,i),i!=n.top;i--){const o=n.tableStart?r.doc.nodeAt(n.tableStart-1):r.doc;if(!o)throw RangeError("No table found");n.table=o,n.map=Qe.get(n.table)}e(r)}return!0}function Rm(t){const e=t.content;return e.childCount==1&&e.child(0).isTextblock&&e.child(0).childCount==0}function Y8({width:t,height:e,map:n},r){let i=r.top*t+r.left,o=i,a=(r.bottom-1)*t+r.left,s=i+(r.right-r.left-1);for(let c=r.top;c<r.bottom;c++){if(r.left>0&&n[o]==n[o-1]||r.right<t&&n[s]==n[s+1])return!0;o+=t,s+=t}for(let c=r.left;c<r.right;c++){if(r.top>0&&n[i]==n[i-t]||r.bottom<e&&n[a]==n[a+t])return!0;i++,a++}return!1}function Q8(t,e){const n=t.selection;if(!(n instanceof Ke)||n.$anchorCell.pos==n.$headCell.pos)return!1;const r=Dn(t),{map:i}=r;if(Y8(i,r))return!1;if(e){const o=t.tr,a={};let s=pe.empty,c,l;for(let u=r.top;u<r.bottom;u++)for(let f=r.left;f<r.right;f++){const d=i.map[u*i.width+f],h=r.table.nodeAt(d);if(!(a[d]||!h))if(a[d]=!0,c==null)c=d,l=h;else{Rm(h)||(s=s.append(h.content));const p=o.mapping.map(d+r.tableStart);o.delete(p,p+h.nodeSize)}}if(c==null||l==null)return!0;if(o.setNodeMarkup(c+r.tableStart,null,{...Nx(l.attrs,l.attrs.colspan,r.right-r.left-l.attrs.colspan),rowspan:r.bottom-r.top}),s.size){const u=c+1+l.content.size,f=Rm(l)?c+1:u;o.replaceWith(f+r.tableStart,u+r.tableStart,s)}o.setSelection(new Ke(o.doc.resolve(c+r.tableStart))),e(o)}return!0}function ek(t,e){const n=gt(t.schema);return tk(({node:r})=>n[r.type.spec.tableRole])(t,e)}function tk(t){return(e,n)=>{var r;const i=e.selection;let o,a;if(i instanceof Ke){if(i.$anchorCell.pos!=i.$headCell.pos)return!1;o=i.$anchorCell.nodeAfter,a=i.$anchorCell.pos}else{if(o=O8(i.$from),!o)return!1;a=(r=Oi(i.$from))==null?void 0:r.pos}if(o==null||a==null||o.attrs.colspan==1&&o.attrs.rowspan==1)return!1;if(n){let s=o.attrs;const c=[],l=s.colwidth;s.rowspan>1&&(s={...s,rowspan:1}),s.colspan>1&&(s={...s,colspan:1});const u=Dn(e),f=e.tr;for(let h=0;h<u.right-u.left;h++)c.push(l?{...s,colwidth:l&&l[h]?[l[h]]:null}:s);let d;for(let h=u.top;h<u.bottom;h++){let p=u.map.positionAt(h,u.left,u.table);h==u.top&&(p+=o.nodeSize);for(let m=u.left,g=0;m<u.right;m++,g++)m==u.left&&h==u.top||f.insert(d=f.mapping.map(p+u.tableStart,1),t({node:o,row:h,col:m}).createAndFill(c[g]))}f.setNodeMarkup(a,t({node:o,row:u.top,col:u.left}),c[0]),i instanceof Ke&&f.setSelection(new Ke(f.doc.resolve(i.$anchorCell.pos),d?f.doc.resolve(d):void 0)),n(f)}return!0}}function nk(t,e){return function(n,r){if(!sn(n))return!1;const i=Zs(n);if(i.nodeAfter.attrs[t]===e)return!1;if(r){const o=n.tr;n.selection instanceof Ke?n.selection.forEachCell((a,s)=>{a.attrs[t]!==e&&o.setNodeMarkup(s,null,{...a.attrs,[t]:e})}):o.setNodeMarkup(i.pos,null,{...i.nodeAfter.attrs,[t]:e}),r(o)}return!0}}function rk(t){return function(e,n){if(!sn(e))return!1;if(n){const r=gt(e.schema),i=Dn(e),o=e.tr,a=i.map.cellsInRect(t=="column"?{left:i.left,top:0,right:i.right,bottom:i.map.height}:t=="row"?{left:0,top:i.top,right:i.map.width,bottom:i.bottom}:i),s=a.map(c=>i.table.nodeAt(c));for(let c=0;c<a.length;c++)s[c].type==r.header_cell&&o.setNodeMarkup(i.tableStart+a[c],r.cell,s[c].attrs);if(o.steps.length==0)for(let c=0;c<a.length;c++)o.setNodeMarkup(i.tableStart+a[c],r.header_cell,s[c].attrs);n(o)}return!0}}function Nm(t,e,n){const r=e.map.cellsInRect({left:0,top:0,right:t=="row"?e.map.width:1,bottom:t=="column"?e.map.height:1});for(let i=0;i<r.length;i++){const o=e.table.nodeAt(r[i]);if(o&&o.type!==n.header_cell)return!1}return!0}function Ys(t,e){return e=e||{useDeprecatedLogic:!1},e.useDeprecatedLogic?rk(t):function(n,r){if(!sn(n))return!1;if(r){const i=gt(n.schema),o=Dn(n),a=n.tr,s=Nm("row",o,i),c=Nm("column",o,i),u=(t==="column"?s:t==="row"?c:!1)?1:0,f=t=="column"?{left:0,top:u,right:1,bottom:o.map.height}:t=="row"?{left:u,top:0,right:o.map.width,bottom:1}:o,d=t=="column"?c?i.cell:i.header_cell:t=="row"?s?i.cell:i.header_cell:i.cell;o.map.cellsInRect(f).forEach(h=>{const p=h+o.tableStart,m=a.doc.nodeAt(p);m&&a.setNodeMarkup(p,d,m.attrs)}),r(a)}return!0}}Ys("row",{useDeprecatedLogic:!0});Ys("column",{useDeprecatedLogic:!0});var ik=Ys("cell",{useDeprecatedLogic:!0});function ok(t,e){if(e<0){const n=t.nodeBefore;if(n)return t.pos-n.nodeSize;for(let r=t.index(-1)-1,i=t.before();r>=0;r--){const o=t.node(-1).child(r),a=o.lastChild;if(a)return i-1-a.nodeSize;i-=o.nodeSize}}else{if(t.index()<t.parent.childCount-1)return t.pos+t.nodeAfter.nodeSize;const n=t.node(-1);for(let r=t.indexAfter(-1),i=t.after();r<n.childCount;r++){const o=n.child(r);if(o.childCount)return i+1;i+=o.nodeSize}}return null}function ak(t){return function(e,n){if(!sn(e))return!1;const r=ok(Zs(e),t);if(r==null)return!1;if(n){const i=e.doc.resolve(r);n(e.tr.setSelection(Be.between(i,N8(i))).scrollIntoView())}return!0}}function sk(t,e){const n=t.selection.$anchor;for(let r=n.depth;r>0;r--)if(n.node(r).type.spec.tableRole=="table")return e&&e(t.tr.delete(n.before(r),n.after(r)).scrollIntoView()),!0;return!1}function Jo(t,e){const n=t.selection;if(!(n instanceof Ke))return!1;if(e){const r=t.tr,i=gt(t.schema).cell.createAndFill().content;n.forEachCell((o,a)=>{o.content.eq(i)||r.replace(r.mapping.map(a+1),r.mapping.map(a+o.nodeSize-1),new _e(i,0,0))}),r.docChanged&&e(r)}return!0}function ck(t){if(!t.size)return null;let{content:e,openStart:n,openEnd:r}=t;for(;e.childCount==1&&(n>0&&r>0||e.child(0).type.spec.tableRole=="table");)n--,r--,e=e.child(0).content;const i=e.child(0),o=i.type.spec.tableRole,a=i.type.schema,s=[];if(o=="row")for(let c=0;c<e.childCount;c++){let l=e.child(c).content;const u=c?0:Math.max(0,n-1),f=c<e.childCount-1?0:Math.max(0,r-1);(u||f)&&(l=Pd(gt(a).row,new _e(l,u,f)).content),s.push(l)}else if(o=="cell"||o=="header_cell")s.push(n||r?Pd(gt(a).row,new _e(e,n,r)).content:e);else return null;return lk(a,s)}function lk(t,e){const n=[];for(let i=0;i<e.length;i++){const o=e[i];for(let a=o.childCount-1;a>=0;a--){const{rowspan:s,colspan:c}=o.child(a).attrs;for(let l=i;l<i+s;l++)n[l]=(n[l]||0)+c}}let r=0;for(let i=0;i<n.length;i++)r=Math.max(r,n[i]);for(let i=0;i<n.length;i++)if(i>=e.length&&e.push(pe.empty),n[i]<r){const o=gt(t).cell.createAndFill(),a=[];for(let s=n[i];s<r;s++)a.push(o);e[i]=e[i].append(pe.from(a))}return{height:e.length,width:r,rows:e}}function Pd(t,e){const n=t.createAndFill();return new ih(n).replace(0,n.content.size,e).doc}function uk({width:t,height:e,rows:n},r,i){if(t!=r){const o=[],a=[];for(let s=0;s<n.length;s++){const c=n[s],l=[];for(let u=o[s]||0,f=0;u<r;f++){let d=c.child(f%c.childCount);u+d.attrs.colspan>r&&(d=d.type.createChecked(Pr(d.attrs,d.attrs.colspan,u+d.attrs.colspan-r),d.content)),l.push(d),u+=d.attrs.colspan;for(let h=1;h<d.attrs.rowspan;h++)o[s+h]=(o[s+h]||0)+d.attrs.colspan}a.push(pe.from(l))}n=a,t=r}if(e!=i){const o=[];for(let a=0,s=0;a<i;a++,s++){const c=[],l=n[s%e];for(let u=0;u<l.childCount;u++){let f=l.child(u);a+f.attrs.rowspan>i&&(f=f.type.create({...f.attrs,rowspan:Math.max(1,i-f.attrs.rowspan)},f.content)),c.push(f)}o.push(pe.from(c))}n=o,e=i}return{width:t,height:e,rows:n}}function fk(t,e,n,r,i,o,a){const s=t.doc.type.schema,c=gt(s);let l,u;if(i>e.width)for(let f=0,d=0;f<e.height;f++){const h=n.child(f);d+=h.nodeSize;const p=[];let m;h.lastChild==null||h.lastChild.type==c.cell?m=l||(l=c.cell.createAndFill()):m=u||(u=c.header_cell.createAndFill());for(let g=e.width;g<i;g++)p.push(m);t.insert(t.mapping.slice(a).map(d-1+r),p)}if(o>e.height){const f=[];for(let p=0,m=(e.height-1)*e.width;p<Math.max(e.width,i);p++){const g=p>=e.width?!1:n.nodeAt(e.map[m+p]).type==c.header_cell;f.push(g?u||(u=c.header_cell.createAndFill()):l||(l=c.cell.createAndFill()))}const d=c.row.create(null,pe.from(f)),h=[];for(let p=e.height;p<o;p++)h.push(d);t.insert(t.mapping.slice(a).map(r+n.nodeSize-2),h)}return!!(l||u)}function Bm(t,e,n,r,i,o,a,s){if(a==0||a==e.height)return!1;let c=!1;for(let l=i;l<o;l++){const u=a*e.width+l,f=e.map[u];if(e.map[u-e.width]==f){c=!0;const d=n.nodeAt(f),{top:h,left:p}=e.findCell(f);t.setNodeMarkup(t.mapping.slice(s).map(f+r),null,{...d.attrs,rowspan:a-h}),t.insert(t.mapping.slice(s).map(e.positionAt(a,p,n)),d.type.createAndFill({...d.attrs,rowspan:h+d.attrs.rowspan-a})),l+=d.attrs.colspan-1}}return c}function Im(t,e,n,r,i,o,a,s){if(a==0||a==e.width)return!1;let c=!1;for(let l=i;l<o;l++){const u=l*e.width+a,f=e.map[u];if(e.map[u-1]==f){c=!0;const d=n.nodeAt(f),h=e.colCount(f),p=t.mapping.slice(s).map(f+r);t.setNodeMarkup(p,null,Pr(d.attrs,a-h,d.attrs.colspan-(a-h))),t.insert(p+d.nodeSize,d.type.createAndFill(Pr(d.attrs,0,a-h))),l+=d.attrs.rowspan-1}}return c}function Mm(t,e,n,r,i){let o=n?t.doc.nodeAt(n-1):t.doc;if(!o)throw new Error("No table found");let a=Qe.get(o);const{top:s,left:c}=r,l=c+i.width,u=s+i.height,f=t.tr;let d=0;function h(){if(o=n?f.doc.nodeAt(n-1):f.doc,!o)throw new Error("No table found");a=Qe.get(o),d=f.mapping.maps.length}fk(f,a,o,n,l,u,d)&&h(),Bm(f,a,o,n,c,l,s,d)&&h(),Bm(f,a,o,n,c,l,u,d)&&h(),Im(f,a,o,n,s,u,c,d)&&h(),Im(f,a,o,n,s,u,l,d)&&h();for(let p=s;p<u;p++){const m=a.positionAt(p,c,o),g=a.positionAt(p,l,o);f.replace(f.mapping.slice(d).map(m+n),f.mapping.slice(d).map(g+n),new _e(i.rows[p-s],0,0))}h(),f.setSelection(new Ke(f.doc.resolve(n+a.positionAt(s,c,o)),f.doc.resolve(n+a.positionAt(u-1,l-1,o)))),e(f)}var dk=mh({ArrowLeft:Zo("horiz",-1),ArrowRight:Zo("horiz",1),ArrowUp:Zo("vert",-1),ArrowDown:Zo("vert",1),"Shift-ArrowLeft":Yo("horiz",-1),"Shift-ArrowRight":Yo("horiz",1),"Shift-ArrowUp":Yo("vert",-1),"Shift-ArrowDown":Yo("vert",1),Backspace:Jo,"Mod-Backspace":Jo,Delete:Jo,"Mod-Delete":Jo});function Ea(t,e,n){return n.eq(t.selection)?!1:(e&&e(t.tr.setSelection(n).scrollIntoView()),!0)}function Zo(t,e){return(n,r,i)=>{if(!i)return!1;const o=n.selection;if(o instanceof Ke)return Ea(n,r,Fe.near(o.$headCell,e));if(t!="horiz"&&!o.empty)return!1;const a=Px(i,t,e);if(a==null)return!1;if(t=="horiz")return Ea(n,r,Fe.near(n.doc.resolve(o.head+e),e));{const s=n.doc.resolve(a),c=Rx(s,t,e);let l;return c?l=Fe.near(c,1):e<0?l=Fe.near(n.doc.resolve(s.before(-1)),-1):l=Fe.near(n.doc.resolve(s.after(-1)),1),Ea(n,r,l)}}}function Yo(t,e){return(n,r,i)=>{if(!i)return!1;const o=n.selection;let a;if(o instanceof Ke)a=o;else{const c=Px(i,t,e);if(c==null)return!1;a=new Ke(n.doc.resolve(c))}const s=Rx(a.$headCell,t,e);return s?Ea(n,r,new Ke(a.$anchorCell,s)):!1}}function hk(t,e){const n=t.state.doc,r=Oi(n.resolve(e));return r?(t.dispatch(t.state.tr.setSelection(new Ke(r))),!0):!1}function pk(t,e,n){if(!sn(t.state))return!1;let r=ck(n);const i=t.state.selection;if(i instanceof Ke){r||(r={width:1,height:1,rows:[pe.from(Pd(gt(t.state.schema).cell,n))]});const o=i.$anchorCell.node(-1),a=i.$anchorCell.start(-1),s=Qe.get(o).rectBetween(i.$anchorCell.pos-a,i.$headCell.pos-a);return r=uk(r,s.right-s.left,s.bottom-s.top),Mm(t.state,t.dispatch,a,s,r),!0}else if(r){const o=Zs(t.state),a=o.start(-1);return Mm(t.state,t.dispatch,a,Qe.get(o.node(-1)).findCell(o.pos-a),r),!0}else return!1}function gk(t,e){var n;if(e.ctrlKey||e.metaKey)return;const r=Wm(t,e.target);let i;if(e.shiftKey&&t.state.selection instanceof Ke)o(t.state.selection.$anchorCell,e),e.preventDefault();else if(e.shiftKey&&r&&(i=Oi(t.state.selection.$anchor))!=null&&((n=rl(t,e))==null?void 0:n.pos)!=i.pos)o(i,e),e.preventDefault();else if(!r)return;function o(c,l){let u=rl(t,l);const f=tr.getState(t.state)==null;if(!u||!jh(c,u))if(f)u=c;else return;const d=new Ke(c,u);if(f||!t.state.selection.eq(d)){const h=t.state.tr.setSelection(d);f&&h.setMeta(tr,c.pos),t.dispatch(h)}}function a(){t.root.removeEventListener("mouseup",a),t.root.removeEventListener("dragstart",a),t.root.removeEventListener("mousemove",s),tr.getState(t.state)!=null&&t.dispatch(t.state.tr.setMeta(tr,-1))}function s(c){const l=c,u=tr.getState(t.state);let f;if(u!=null)f=t.state.doc.resolve(u);else if(Wm(t,l.target)!=r&&(f=rl(t,e),!f))return a();f&&o(f,l)}t.root.addEventListener("mouseup",a),t.root.addEventListener("dragstart",a),t.root.addEventListener("mousemove",s)}function Px(t,e,n){if(!(t.state.selection instanceof Be))return null;const{$head:r}=t.state.selection;for(let i=r.depth-1;i>=0;i--){const o=r.node(i);if((n<0?r.index(i):r.indexAfter(i))!=(n<0?0:o.childCount))return null;if(o.type.spec.tableRole=="cell"||o.type.spec.tableRole=="header_cell"){const s=r.before(i),c=e=="vert"?n>0?"down":"up":n>0?"right":"left";return t.endOfTextblock(c)?s:null}}return null}function Wm(t,e){for(;e&&e!=t.dom;e=e.parentNode)if(e.nodeName=="TD"||e.nodeName=="TH")return e;return null}function rl(t,e){const n=t.posAtCoords({left:e.clientX,top:e.clientY});return n&&n?Oi(t.state.doc.resolve(n.pos)):null}var mk=class{constructor(t,e){this.node=t,this.defaultCellMinWidth=e,this.dom=document.createElement("div"),this.dom.className="tableWrapper",this.table=this.dom.appendChild(document.createElement("table")),this.table.style.setProperty("--default-cell-min-width",`${e}px`),this.colgroup=this.table.appendChild(document.createElement("colgroup")),qd(t,this.colgroup,this.table,e),this.contentDOM=this.table.appendChild(document.createElement("tbody"))}update(t){return t.type!=this.node.type?!1:(this.node=t,qd(t,this.colgroup,this.table,this.defaultCellMinWidth),!0)}ignoreMutation(t){return t.type=="attributes"&&(t.target==this.table||this.colgroup.contains(t.target))}};function qd(t,e,n,r,i,o){var a;let s=0,c=!0,l=e.firstChild;const u=t.firstChild;if(u){for(let f=0,d=0;f<u.childCount;f++){const{colspan:h,colwidth:p}=u.child(f).attrs;for(let m=0;m<h;m++,d++){const g=i==d?o:p&&p[m],y=g?g+"px":"";if(s+=g||r,g||(c=!1),l)l.style.width!=y&&(l.style.width=y),l=l.nextSibling;else{const b=document.createElement("col");b.style.width=y,e.appendChild(b)}}}for(;l;){const f=l.nextSibling;(a=l.parentNode)==null||a.removeChild(l),l=f}c?(n.style.width=s+"px",n.style.minWidth=""):(n.style.width="",n.style.minWidth=s+"px")}}var Bt=new ki("tableColumnResizing");function yk({handleWidth:t=5,cellMinWidth:e=25,defaultCellMinWidth:n=100,View:r=mk,lastColumnResizable:i=!0}={}){const o=new jr({key:Bt,state:{init(a,s){var c,l;const u=(l=(c=o.spec)==null?void 0:c.props)==null?void 0:l.nodeViews,f=gt(s.schema).table.name;return r&&u&&(u[f]=(d,h)=>new r(d,n,h)),new bk(-1,!1)},apply(a,s){return s.apply(a)}},props:{attributes:a=>{const s=Bt.getState(a);return s&&s.activeHandle>-1?{class:"resize-cursor"}:{}},handleDOMEvents:{mousemove:(a,s)=>{vk(a,s,t,i)},mouseleave:a=>{xk(a)},mousedown:(a,s)=>{Dk(a,s,e,n)}},decorations:a=>{const s=Bt.getState(a);if(s&&s.activeHandle>-1)return Ck(a,s.activeHandle)},nodeViews:{}}});return o}var bk=class Ca{constructor(e,n){this.activeHandle=e,this.dragging=n}apply(e){const n=this,r=e.getMeta(Bt);if(r&&r.setHandle!=null)return new Ca(r.setHandle,!1);if(r&&r.setDragging!==void 0)return new Ca(n.activeHandle,r.setDragging);if(n.activeHandle>-1&&e.docChanged){let i=e.mapping.map(n.activeHandle,-1);return Ld(e.doc.resolve(i))||(i=-1),new Ca(i,n.dragging)}return n}};function vk(t,e,n,r){if(!t.editable)return;const i=Bt.getState(t.state);if(i&&!i.dragging){const o=_k(e.target);let a=-1;if(o){const{left:s,right:c}=o.getBoundingClientRect();e.clientX-s<=n?a=Lm(t,e,"left",n):c-e.clientX<=n&&(a=Lm(t,e,"right",n))}if(a!=i.activeHandle){if(!r&&a!==-1){const s=t.state.doc.resolve(a),c=s.node(-1),l=Qe.get(c),u=s.start(-1);if(l.colCount(s.pos-u)+s.nodeAfter.attrs.colspan-1==l.width-1)return}qx(t,a)}}}function xk(t){if(!t.editable)return;const e=Bt.getState(t.state);e&&e.activeHandle>-1&&!e.dragging&&qx(t,-1)}function Dk(t,e,n,r){var i;if(!t.editable)return!1;const o=(i=t.dom.ownerDocument.defaultView)!=null?i:window,a=Bt.getState(t.state);if(!a||a.activeHandle==-1||a.dragging)return!1;const s=t.state.doc.nodeAt(a.activeHandle),c=wk(t,a.activeHandle,s.attrs);t.dispatch(t.state.tr.setMeta(Bt,{setDragging:{startX:e.clientX,startWidth:c}}));function l(f){o.removeEventListener("mouseup",l),o.removeEventListener("mousemove",u);const d=Bt.getState(t.state);d!=null&&d.dragging&&(Tk(t,d.activeHandle,Pm(d.dragging,f,n)),t.dispatch(t.state.tr.setMeta(Bt,{setDragging:null})))}function u(f){if(!f.which)return l(f);const d=Bt.getState(t.state);if(d&&d.dragging){const h=Pm(d.dragging,f,n);qm(t,d.activeHandle,h,r)}}return qm(t,a.activeHandle,c,r),o.addEventListener("mouseup",l),o.addEventListener("mousemove",u),e.preventDefault(),!0}function wk(t,e,{colspan:n,colwidth:r}){const i=r&&r[r.length-1];if(i)return i;const o=t.domAtPos(e);let s=o.node.childNodes[o.offset].offsetWidth,c=n;if(r)for(let l=0;l<n;l++)r[l]&&(s-=r[l],c--);return s/c}function _k(t){for(;t&&t.nodeName!="TD"&&t.nodeName!="TH";)t=t.classList&&t.classList.contains("ProseMirror")?null:t.parentNode;return t}function Lm(t,e,n,r){const i=n=="right"?-r:r,o=t.posAtCoords({left:e.clientX+i,top:e.clientY});if(!o)return-1;const{pos:a}=o,s=Oi(t.state.doc.resolve(a));if(!s)return-1;if(n=="right")return s.pos;const c=Qe.get(s.node(-1)),l=s.start(-1),u=c.map.indexOf(s.pos-l);return u%c.width==0?-1:l+c.map[u-1]}function Pm(t,e,n){const r=e.clientX-t.startX;return Math.max(n,t.startWidth+r)}function qx(t,e){t.dispatch(t.state.tr.setMeta(Bt,{setHandle:e}))}function Tk(t,e,n){const r=t.state.doc.resolve(e),i=r.node(-1),o=Qe.get(i),a=r.start(-1),s=o.colCount(r.pos-a)+r.nodeAfter.attrs.colspan-1,c=t.state.tr;for(let l=0;l<o.height;l++){const u=l*o.width+s;if(l&&o.map[u]==o.map[u-o.width])continue;const f=o.map[u],d=i.nodeAt(f).attrs,h=d.colspan==1?0:s-o.colCount(f);if(d.colwidth&&d.colwidth[h]==n)continue;const p=d.colwidth?d.colwidth.slice():Ek(d.colspan);p[h]=n,c.setNodeMarkup(a+f,null,{...d,colwidth:p})}c.docChanged&&t.dispatch(c)}function qm(t,e,n,r){const i=t.state.doc.resolve(e),o=i.node(-1),a=i.start(-1),s=Qe.get(o).colCount(i.pos-a)+i.nodeAfter.attrs.colspan-1;let c=t.domAtPos(i.start(-1)).node;for(;c&&c.nodeName!="TABLE";)c=c.parentNode;c&&qd(o,c.firstChild,c,r,s,n)}function Ek(t){return Array(t).fill(0)}function Ck(t,e){var n;const r=[],i=t.doc.resolve(e),o=i.node(-1);if(!o)return Je.empty;const a=Qe.get(o),s=i.start(-1),c=a.colCount(i.pos-s)+i.nodeAfter.attrs.colspan-1;for(let l=0;l<a.height;l++){const u=c+l*a.width;if((c==a.width-1||a.map[u]!=a.map[u+1])&&(l==0||a.map[u]!=a.map[u-a.width])){const f=a.map[u],d=s+f+o.nodeAt(f).nodeSize-1,h=document.createElement("div");h.className="column-resize-handle",(n=Bt.getState(t))!=null&&n.dragging&&r.push(pt.node(s+f,s+f+o.nodeAt(f).nodeSize,{class:"column-resize-dragging"})),r.push(pt.widget(d,h))}}return Je.create(t.doc,r)}function Sk({allowTableNodeSelection:t=!1}={}){return new jr({key:tr,state:{init(){return null},apply(e,n){const r=e.getMeta(tr);if(r!=null)return r==-1?null:r;if(n==null||!e.docChanged)return n;const{deleted:i,pos:o}=e.mapping.mapResult(n);return i?null:o}},props:{decorations:M8,handleDOMEvents:{mousedown:gk},createSelectionBetween(e){return tr.getState(e.state)!=null?e.state.selection:null},handleTripleClick:hk,handleKeyDown:dk,handlePaste:pk},appendTransaction(e,n,r){return P8(r,Mx(r,n),t)}})}var Xt=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function $h(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function zx(t){if(Object.prototype.hasOwnProperty.call(t,"__esModule"))return t;var e=t.default;if(typeof e=="function"){var n=function r(){return this instanceof r?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};n.prototype=e.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(t).forEach(function(r){var i=Object.getOwnPropertyDescriptor(t,r);Object.defineProperty(n,r,i.get?i:{enumerable:!0,get:function(){return t[r]}})}),n}var il,zm;function jx(){if(zm)return il;zm=1;var t=Object.prototype.toString;return il=function(n){var r=t.call(n),i=r==="[object Arguments]";return i||(i=r!=="[object Array]"&&n!==null&&typeof n=="object"&&typeof n.length=="number"&&n.length>=0&&t.call(n.callee)==="[object Function]"),i},il}var ol,jm;function Ak(){if(jm)return ol;jm=1;var t;if(!Object.keys){var e=Object.prototype.hasOwnProperty,n=Object.prototype.toString,r=jx(),i=Object.prototype.propertyIsEnumerable,o=!i.call({toString:null},"toString"),a=i.call(function(){},"prototype"),s=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],c=function(d){var h=d.constructor;return h&&h.prototype===d},l={$applicationCache:!0,$console:!0,$external:!0,$frame:!0,$frameElement:!0,$frames:!0,$innerHeight:!0,$innerWidth:!0,$onmozfullscreenchange:!0,$onmozfullscreenerror:!0,$outerHeight:!0,$outerWidth:!0,$pageXOffset:!0,$pageYOffset:!0,$parent:!0,$scrollLeft:!0,$scrollTop:!0,$scrollX:!0,$scrollY:!0,$self:!0,$webkitIndexedDB:!0,$webkitStorageInfo:!0,$window:!0},u=function(){if(typeof window>"u")return!1;for(var d in window)try{if(!l["$"+d]&&e.call(window,d)&&window[d]!==null&&typeof window[d]=="object")try{c(window[d])}catch{return!0}}catch{return!0}return!1}(),f=function(d){if(typeof window>"u"||!u)return c(d);try{return c(d)}catch{return!1}};t=function(h){var p=h!==null&&typeof h=="object",m=n.call(h)==="[object Function]",g=r(h),y=p&&n.call(h)==="[object String]",b=[];if(!p&&!m&&!g)throw new TypeError("Object.keys called on a non-object");var v=a&&m;if(y&&h.length>0&&!e.call(h,0))for(var T=0;T<h.length;++T)b.push(String(T));if(g&&h.length>0)for(var w=0;w<h.length;++w)b.push(String(w));else for(var E in h)!(v&&E==="prototype")&&e.call(h,E)&&b.push(String(E));if(o)for(var S=f(h),U=0;U<s.length;++U)!(S&&s[U]==="constructor")&&e.call(h,s[U])&&b.push(s[U]);return b}}return ol=t,ol}var al,$m;function Vh(){if($m)return al;$m=1;var t=Array.prototype.slice,e=jx(),n=Object.keys,r=n?function(a){return n(a)}:Ak(),i=Object.keys;return r.shim=function(){if(Object.keys){var a=function(){var s=Object.keys(arguments);return s&&s.length===arguments.length}(1,2);a||(Object.keys=function(c){return e(c)?i(t.call(c)):i(c)})}else Object.keys=r;return Object.keys||r},al=r,al}var sl,Vm;function Qs(){if(Vm)return sl;Vm=1;var t=Object.defineProperty||!1;if(t)try{t({},"a",{value:1})}catch{t=!1}return sl=t,sl}var cl,Hm;function Hh(){return Hm||(Hm=1,cl=SyntaxError),cl}var ll,Xm;function Jt(){return Xm||(Xm=1,ll=TypeError),ll}var ul,Gm;function Uk(){return Gm||(Gm=1,ul=Object.getOwnPropertyDescriptor),ul}var fl,Km;function Hr(){if(Km)return fl;Km=1;var t=Uk();if(t)try{t([],"length")}catch{t=null}return fl=t,fl}var dl,Jm;function Xh(){if(Jm)return dl;Jm=1;var t=Qs(),e=Hh(),n=Jt(),r=Hr();return dl=function(o,a,s){if(!o||typeof o!="object"&&typeof o!="function")throw new n("`obj` must be an object or a function`");if(typeof a!="string"&&typeof a!="symbol")throw new n("`property` must be a string or a symbol`");if(arguments.length>3&&typeof arguments[3]!="boolean"&&arguments[3]!==null)throw new n("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&typeof arguments[4]!="boolean"&&arguments[4]!==null)throw new n("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&typeof arguments[5]!="boolean"&&arguments[5]!==null)throw new n("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&typeof arguments[6]!="boolean")throw new n("`loose`, if provided, must be a boolean");var c=arguments.length>3?arguments[3]:null,l=arguments.length>4?arguments[4]:null,u=arguments.length>5?arguments[5]:null,f=arguments.length>6?arguments[6]:!1,d=!!r&&r(o,a);if(t)t(o,a,{configurable:u===null&&d?d.configurable:!u,enumerable:c===null&&d?d.enumerable:!c,value:s,writable:l===null&&d?d.writable:!l});else if(f||!c&&!l&&!u)o[a]=s;else throw new e("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.")},dl}var hl,Zm;function Gh(){if(Zm)return hl;Zm=1;var t=Qs(),e=function(){return!!t};return e.hasArrayLengthDefineBug=function(){if(!t)return null;try{return t([],"length",{value:1}).length!==1}catch{return!0}},hl=e,hl}var pl,Ym;function Xr(){if(Ym)return pl;Ym=1;var t=Vh(),e=typeof Symbol=="function"&&typeof Symbol("foo")=="symbol",n=Object.prototype.toString,r=Array.prototype.concat,i=Xh(),o=function(l){return typeof l=="function"&&n.call(l)==="[object Function]"},a=Gh()(),s=function(l,u,f,d){if(u in l){if(d===!0){if(l[u]===f)return}else if(!o(d)||!d())return}a?i(l,u,f,!0):i(l,u,f)},c=function(l,u){var f=arguments.length>2?arguments[2]:{},d=t(u);e&&(d=r.call(d,Object.getOwnPropertySymbols(u)));for(var h=0;h<d.length;h+=1)s(l,d[h],u[d[h]],f[d[h]])};return c.supportsDescriptors=!!a,pl=c,pl}var gl={exports:{}},ml,Qm;function Kh(){return Qm||(Qm=1,ml=Object),ml}var yl,ey;function $x(){return ey||(ey=1,yl=Error),yl}var bl,ty;function kk(){return ty||(ty=1,bl=EvalError),bl}var vl,ny;function Fk(){return ny||(ny=1,vl=RangeError),vl}var xl,ry;function Ok(){return ry||(ry=1,xl=ReferenceError),xl}var Dl,iy;function Rk(){return iy||(iy=1,Dl=URIError),Dl}var wl,oy;function Nk(){return oy||(oy=1,wl=Math.abs),wl}var _l,ay;function Bk(){return ay||(ay=1,_l=Math.floor),_l}var Tl,sy;function Ik(){return sy||(sy=1,Tl=Math.max),Tl}var El,cy;function Mk(){return cy||(cy=1,El=Math.min),El}var Cl,ly;function Wk(){return ly||(ly=1,Cl=Math.pow),Cl}var Sl,uy;function Lk(){return uy||(uy=1,Sl=Math.round),Sl}var Al,fy;function Pk(){return fy||(fy=1,Al=Number.isNaN||function(e){return e!==e}),Al}var Ul,dy;function qk(){if(dy)return Ul;dy=1;var t=Pk();return Ul=function(n){return t(n)||n===0?n:n<0?-1:1},Ul}var kl,hy;function ec(){return hy||(hy=1,kl=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var e={},n=Symbol("test"),r=Object(n);if(typeof n=="string"||Object.prototype.toString.call(n)!=="[object Symbol]"||Object.prototype.toString.call(r)!=="[object Symbol]")return!1;var i=42;e[n]=i;for(var o in e)return!1;if(typeof Object.keys=="function"&&Object.keys(e).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(e).length!==0)return!1;var a=Object.getOwnPropertySymbols(e);if(a.length!==1||a[0]!==n||!Object.prototype.propertyIsEnumerable.call(e,n))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var s=Object.getOwnPropertyDescriptor(e,n);if(s.value!==i||s.enumerable!==!0)return!1}return!0}),kl}var Fl,py;function Jh(){if(py)return Fl;py=1;var t=typeof Symbol<"u"&&Symbol,e=ec();return Fl=function(){return typeof t!="function"||typeof Symbol!="function"||typeof t("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:e()},Fl}var Ol,gy;function Vx(){return gy||(gy=1,Ol=typeof Reflect<"u"&&Reflect.getPrototypeOf||null),Ol}var Rl,my;function Hx(){if(my)return Rl;my=1;var t=Kh();return Rl=t.getPrototypeOf||null,Rl}var Nl,yy;function zk(){if(yy)return Nl;yy=1;var t="Function.prototype.bind called on incompatible ",e=Object.prototype.toString,n=Math.max,r="[object Function]",i=function(c,l){for(var u=[],f=0;f<c.length;f+=1)u[f]=c[f];for(var d=0;d<l.length;d+=1)u[d+c.length]=l[d];return u},o=function(c,l){for(var u=[],f=l,d=0;f<c.length;f+=1,d+=1)u[d]=c[f];return u},a=function(s,c){for(var l="",u=0;u<s.length;u+=1)l+=s[u],u+1<s.length&&(l+=c);return l};return Nl=function(c){var l=this;if(typeof l!="function"||e.apply(l)!==r)throw new TypeError(t+l);for(var u=o(arguments,1),f,d=function(){if(this instanceof f){var y=l.apply(this,i(u,arguments));return Object(y)===y?y:this}return l.apply(c,i(u,arguments))},h=n(0,l.length-u.length),p=[],m=0;m<h;m++)p[m]="$"+m;if(f=Function("binder","return function ("+a(p,",")+"){ return binder.apply(this,arguments); }")(d),l.prototype){var g=function(){};g.prototype=l.prototype,f.prototype=new g,g.prototype=null}return f},Nl}var Bl,by;function Mo(){if(by)return Bl;by=1;var t=zk();return Bl=Function.prototype.bind||t,Bl}var Il,vy;function Zh(){return vy||(vy=1,Il=Function.prototype.call),Il}var Ml,xy;function Yh(){return xy||(xy=1,Ml=Function.prototype.apply),Ml}var Wl,Dy;function jk(){return Dy||(Dy=1,Wl=typeof Reflect<"u"&&Reflect&&Reflect.apply),Wl}var Ll,wy;function Xx(){if(wy)return Ll;wy=1;var t=Mo(),e=Yh(),n=Zh(),r=jk();return Ll=r||t.call(n,e),Ll}var Pl,_y;function Qh(){if(_y)return Pl;_y=1;var t=Mo(),e=Jt(),n=Zh(),r=Xx();return Pl=function(o){if(o.length<1||typeof o[0]!="function")throw new e("a function is required");return r(t,n,o)},Pl}var ql,Ty;function $k(){if(Ty)return ql;Ty=1;var t=Qh(),e=Hr(),n;try{n=[].__proto__===Array.prototype}catch(a){if(!a||typeof a!="object"||!("code"in a)||a.code!=="ERR_PROTO_ACCESS")throw a}var r=!!n&&e&&e(Object.prototype,"__proto__"),i=Object,o=i.getPrototypeOf;return ql=r&&typeof r.get=="function"?t([r.get]):typeof o=="function"?function(s){return o(s==null?s:i(s))}:!1,ql}var zl,Ey;function Gx(){if(Ey)return zl;Ey=1;var t=Vx(),e=Hx(),n=$k();return zl=t?function(i){return t(i)}:e?function(i){if(!i||typeof i!="object"&&typeof i!="function")throw new TypeError("getProto: not an object");return e(i)}:n?function(i){return n(i)}:null,zl}var jl,Cy;function ep(){if(Cy)return jl;Cy=1;var t=Function.prototype.call,e=Object.prototype.hasOwnProperty,n=Mo();return jl=n.call(t,e),jl}var $l,Sy;function qn(){if(Sy)return $l;Sy=1;var t,e=Kh(),n=$x(),r=kk(),i=Fk(),o=Ok(),a=Hh(),s=Jt(),c=Rk(),l=Nk(),u=Bk(),f=Ik(),d=Mk(),h=Wk(),p=Lk(),m=qk(),g=Function,y=function(me){try{return g('"use strict"; return ('+me+").constructor;")()}catch{}},b=Hr(),v=Qs(),T=function(){throw new s},w=b?function(){try{return arguments.callee,T}catch{try{return b(arguments,"callee").get}catch{return T}}}():T,E=Jh()(),S=Gx(),U=Hx(),C=Vx(),R=Yh(),L=Zh(),_={},k=typeof Uint8Array>"u"||!S?t:S(Uint8Array),x={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?t:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?t:ArrayBuffer,"%ArrayIteratorPrototype%":E&&S?S([][Symbol.iterator]()):t,"%AsyncFromSyncIteratorPrototype%":t,"%AsyncFunction%":_,"%AsyncGenerator%":_,"%AsyncGeneratorFunction%":_,"%AsyncIteratorPrototype%":_,"%Atomics%":typeof Atomics>"u"?t:Atomics,"%BigInt%":typeof BigInt>"u"?t:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?t:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?t:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?t:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":n,"%eval%":eval,"%EvalError%":r,"%Float32Array%":typeof Float32Array>"u"?t:Float32Array,"%Float64Array%":typeof Float64Array>"u"?t:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?t:FinalizationRegistry,"%Function%":g,"%GeneratorFunction%":_,"%Int8Array%":typeof Int8Array>"u"?t:Int8Array,"%Int16Array%":typeof Int16Array>"u"?t:Int16Array,"%Int32Array%":typeof Int32Array>"u"?t:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":E&&S?S(S([][Symbol.iterator]())):t,"%JSON%":typeof JSON=="object"?JSON:t,"%Map%":typeof Map>"u"?t:Map,"%MapIteratorPrototype%":typeof Map>"u"||!E||!S?t:S(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":e,"%Object.getOwnPropertyDescriptor%":b,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?t:Promise,"%Proxy%":typeof Proxy>"u"?t:Proxy,"%RangeError%":i,"%ReferenceError%":o,"%Reflect%":typeof Reflect>"u"?t:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?t:Set,"%SetIteratorPrototype%":typeof Set>"u"||!E||!S?t:S(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?t:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":E&&S?S(""[Symbol.iterator]()):t,"%Symbol%":E?Symbol:t,"%SyntaxError%":a,"%ThrowTypeError%":w,"%TypedArray%":k,"%TypeError%":s,"%Uint8Array%":typeof Uint8Array>"u"?t:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?t:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?t:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?t:Uint32Array,"%URIError%":c,"%WeakMap%":typeof WeakMap>"u"?t:WeakMap,"%WeakRef%":typeof WeakRef>"u"?t:WeakRef,"%WeakSet%":typeof WeakSet>"u"?t:WeakSet,"%Function.prototype.call%":L,"%Function.prototype.apply%":R,"%Object.defineProperty%":v,"%Object.getPrototypeOf%":U,"%Math.abs%":l,"%Math.floor%":u,"%Math.max%":f,"%Math.min%":d,"%Math.pow%":h,"%Math.round%":p,"%Math.sign%":m,"%Reflect.getPrototypeOf%":C};if(S)try{null.error}catch(me){var z=S(S(me));x["%Error.prototype%"]=z}var F=function me(de){var ge;if(de==="%AsyncFunction%")ge=y("async function () {}");else if(de==="%GeneratorFunction%")ge=y("function* () {}");else if(de==="%AsyncGeneratorFunction%")ge=y("async function* () {}");else if(de==="%AsyncGenerator%"){var ye=me("%AsyncGeneratorFunction%");ye&&(ge=ye.prototype)}else if(de==="%AsyncIteratorPrototype%"){var be=me("%AsyncGenerator%");be&&S&&(ge=S(be.prototype))}return x[de]=ge,ge},I={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},K=Mo(),P=ep(),te=K.call(L,Array.prototype.concat),W=K.call(R,Array.prototype.splice),B=K.call(L,String.prototype.replace),oe=K.call(L,String.prototype.slice),X=K.call(L,RegExp.prototype.exec),J=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,le=/\\(\\)?/g,he=function(de){var ge=oe(de,0,1),ye=oe(de,-1);if(ge==="%"&&ye!=="%")throw new a("invalid intrinsic syntax, expected closing `%`");if(ye==="%"&&ge!=="%")throw new a("invalid intrinsic syntax, expected opening `%`");var be=[];return B(de,J,function(D,V,j,M){be[be.length]=j?B(M,le,"$1"):V||D}),be},fe=function(de,ge){var ye=de,be;if(P(I,ye)&&(be=I[ye],ye="%"+be[0]+"%"),P(x,ye)){var D=x[ye];if(D===_&&(D=F(ye)),typeof D>"u"&&!ge)throw new s("intrinsic "+de+" exists, but is not available. Please file an issue!");return{alias:be,name:ye,value:D}}throw new a("intrinsic "+de+" does not exist!")};return $l=function(de,ge){if(typeof de!="string"||de.length===0)throw new s("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof ge!="boolean")throw new s('"allowMissing" argument must be a boolean');if(X(/^%?[^%]*%?$/,de)===null)throw new a("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var ye=he(de),be=ye.length>0?ye[0]:"",D=fe("%"+be+"%",ge),V=D.name,j=D.value,M=!1,N=D.alias;N&&(be=N[0],W(ye,te([0,1],N)));for(var $=1,ie=!0;$<ye.length;$+=1){var ne=ye[$],Z=oe(ne,0,1),q=oe(ne,-1);if((Z==='"'||Z==="'"||Z==="`"||q==='"'||q==="'"||q==="`")&&Z!==q)throw new a("property names with quotes must have matching quotes");if((ne==="constructor"||!ie)&&(M=!0),be+="."+ne,V="%"+be+"%",P(x,V))j=x[V];else if(j!=null){if(!(ne in j)){if(!ge)throw new s("base intrinsic for "+de+" exists, but the property is not available.");return}if(b&&$+1>=ye.length){var G=b(j,ne);ie=!!G,ie&&"get"in G&&!("originalValue"in G.get)?j=G.get:j=j[ne]}else ie=P(j,ne),j=j[ne];ie&&!M&&(x[V]=j)}}return j},$l}var Vl,Ay;function Vk(){if(Ay)return Vl;Ay=1;var t=qn(),e=Xh(),n=Gh()(),r=Hr(),i=Jt(),o=t("%Math.floor%");return Vl=function(s,c){if(typeof s!="function")throw new i("`fn` is not a function");if(typeof c!="number"||c<0||c>4294967295||o(c)!==c)throw new i("`length` must be a positive 32-bit integer");var l=arguments.length>2&&!!arguments[2],u=!0,f=!0;if("length"in s&&r){var d=r(s,"length");d&&!d.configurable&&(u=!1),d&&!d.writable&&(f=!1)}return(u||f||!l)&&(n?e(s,"length",c,!0,!0):e(s,"length",c)),s},Vl}var Hl,Uy;function Hk(){if(Uy)return Hl;Uy=1;var t=Mo(),e=Yh(),n=Xx();return Hl=function(){return n(t,e,arguments)},Hl}var ky;function Ri(){return ky||(ky=1,function(t){var e=Vk(),n=Qs(),r=Qh(),i=Hk();t.exports=function(a){var s=r(arguments),c=a.length-(arguments.length-1);return e(s,1+(c>0?c:0),!0)},n?n(t.exports,"apply",{value:i}):t.exports.apply=i}(gl)),gl.exports}var Xl,Fy;function bt(){if(Fy)return Xl;Fy=1;var t=qn(),e=Qh(),n=e([t("%String.prototype.indexOf%")]);return Xl=function(i,o){var a=t(i,!!o);return typeof a=="function"&&n(i,".prototype.")>-1?e([a]):a},Xl}var Gl,Oy;function Kx(){if(Oy)return Gl;Oy=1;var t=Vh(),e=ec()(),n=bt(),r=Kh(),i=n("Array.prototype.push"),o=n("Object.prototype.propertyIsEnumerable"),a=e?r.getOwnPropertySymbols:null;return Gl=function(c,l){if(c==null)throw new TypeError("target must be an object");var u=r(c);if(arguments.length===1)return u;for(var f=1;f<arguments.length;++f){var d=r(arguments[f]),h=t(d),p=e&&(r.getOwnPropertySymbols||a);if(p)for(var m=p(d),g=0;g<m.length;++g){var y=m[g];o(d,y)&&i(h,y)}for(var b=0;b<h.length;++b){var v=h[b];if(o(d,v)){var T=d[v];u[v]=T}}}return u},Gl}var Kl,Ry;function Jx(){if(Ry)return Kl;Ry=1;var t=Kx(),e=function(){if(!Object.assign)return!1;for(var r="abcdefghijklmnopqrst",i=r.split(""),o={},a=0;a<i.length;++a)o[i[a]]=i[a];var s=Object.assign({},o),c="";for(var l in s)c+=l;return r!==c},n=function(){if(!Object.assign||!Object.preventExtensions)return!1;var r=Object.preventExtensions({1:2});try{Object.assign(r,"xy")}catch{return r[1]==="y"}return!1};return Kl=function(){return!Object.assign||e()||n()?t:Object.assign},Kl}var Jl,Ny;function Xk(){if(Ny)return Jl;Ny=1;var t=Xr(),e=Jx();return Jl=function(){var r=e();return t(Object,{assign:r},{assign:function(){return Object.assign!==r}}),r},Jl}var Zl,By;function Gk(){if(By)return Zl;By=1;var t=Xr(),e=Ri(),n=Kx(),r=Jx(),i=Xk(),o=e.apply(r()),a=function(c,l){return o(Object,arguments)};return t(a,{getPolyfill:r,implementation:n,shim:i}),Zl=a,Zl}var Yl,Iy;function Zx(){if(Iy)return Yl;Iy=1;var t=qn(),e=Ri(),n=e(t("String.prototype.indexOf"));return Yl=function(i,o){var a=t(i,!!o);return typeof a=="function"&&n(i,".prototype.")>-1?e(a):a},Yl}var Ql,My;function Kk(){if(My)return Ql;My=1;var t=function(){return typeof(function(){}).name=="string"},e=Object.getOwnPropertyDescriptor;if(e)try{e([],"length")}catch{e=null}t.functionsHaveConfigurableNames=function(){if(!t()||!e)return!1;var i=e(function(){},"name");return!!i&&!!i.configurable};var n=Function.prototype.bind;return t.boundFunctionsHaveNames=function(){return t()&&typeof n=="function"&&(function(){}).bind().name!==""},Ql=t,Ql}var eu,Wy;function Jk(){if(Wy)return eu;Wy=1;var t=Xh(),e=Gh()(),n=Kk().functionsHaveConfigurableNames(),r=Jt();return eu=function(o,a){if(typeof o!="function")throw new r("`fn` is not a function");var s=arguments.length>2&&!!arguments[2];return(!s||n)&&(e?t(o,"name",a,!0,!0):t(o,"name",a)),o},eu}var tu,Ly;function Yx(){if(Ly)return tu;Ly=1;var t=Jk(),e=Jt(),n=Object;return tu=t(function(){if(this==null||this!==n(this))throw new e("RegExp.prototype.flags getter called on non-object");var i="";return this.hasIndices&&(i+="d"),this.global&&(i+="g"),this.ignoreCase&&(i+="i"),this.multiline&&(i+="m"),this.dotAll&&(i+="s"),this.unicode&&(i+="u"),this.unicodeSets&&(i+="v"),this.sticky&&(i+="y"),i},"get flags",!0),tu}var nu,Py;function Qx(){if(Py)return nu;Py=1;var t=Yx(),e=Xr().supportsDescriptors,n=Object.getOwnPropertyDescriptor;return nu=function(){if(e&&/a/mig.flags==="gim"){var i=n(RegExp.prototype,"flags");if(i&&typeof i.get=="function"&&"dotAll"in RegExp.prototype&&"hasIndices"in RegExp.prototype){var o="",a={};if(Object.defineProperty(a,"hasIndices",{get:function(){o+="d"}}),Object.defineProperty(a,"sticky",{get:function(){o+="y"}}),i.get.call(a),o==="dy")return i.get}}return t},nu}var ru,qy;function Zk(){if(qy)return ru;qy=1;var t=Xr().supportsDescriptors,e=Qx(),n=Hr(),r=Object.defineProperty,i=$x(),o=Gx(),a=/a/;return ru=function(){if(!t||!o)throw new i("RegExp.prototype.flags requires a true ES5 environment that supports property descriptors");var c=e(),l=o(a),u=n(l,"flags");return(!u||u.get!==c)&&r(l,"flags",{configurable:!0,enumerable:!1,get:c}),c},ru}var iu,zy;function Yk(){if(zy)return iu;zy=1;var t=Xr(),e=Ri(),n=Yx(),r=Qx(),i=Zk(),o=e(r());return t(o,{getPolyfill:r,implementation:n,shim:i}),iu=o,iu}var qi={exports:{}},ou,jy;function Gr(){if(jy)return ou;jy=1;var t=ec();return ou=function(){return t()&&!!Symbol.toStringTag},ou}var au,$y;function eD(){if($y)return au;$y=1;var t=Gr()(),e=bt(),n=e("Object.prototype.toString"),r=function(s){return t&&s&&typeof s=="object"&&Symbol.toStringTag in s?!1:n(s)==="[object Arguments]"},i=function(s){return r(s)?!0:s!==null&&typeof s=="object"&&"length"in s&&typeof s.length=="number"&&s.length>=0&&n(s)!=="[object Array]"&&"callee"in s&&n(s.callee)==="[object Function]"},o=function(){return r(arguments)}();return r.isLegacyArguments=i,au=o?r:i,au}const Qk={},e4=Object.freeze(Object.defineProperty({__proto__:null,default:Qk},Symbol.toStringTag,{value:"Module"})),t4=zx(e4);var su,Vy;function tc(){if(Vy)return su;Vy=1;var t=typeof Map=="function"&&Map.prototype,e=Object.getOwnPropertyDescriptor&&t?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,n=t&&e&&typeof e.get=="function"?e.get:null,r=t&&Map.prototype.forEach,i=typeof Set=="function"&&Set.prototype,o=Object.getOwnPropertyDescriptor&&i?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,a=i&&o&&typeof o.get=="function"?o.get:null,s=i&&Set.prototype.forEach,c=typeof WeakMap=="function"&&WeakMap.prototype,l=c?WeakMap.prototype.has:null,u=typeof WeakSet=="function"&&WeakSet.prototype,f=u?WeakSet.prototype.has:null,d=typeof WeakRef=="function"&&WeakRef.prototype,h=d?WeakRef.prototype.deref:null,p=Boolean.prototype.valueOf,m=Object.prototype.toString,g=Function.prototype.toString,y=String.prototype.match,b=String.prototype.slice,v=String.prototype.replace,T=String.prototype.toUpperCase,w=String.prototype.toLowerCase,E=RegExp.prototype.test,S=Array.prototype.concat,U=Array.prototype.join,C=Array.prototype.slice,R=Math.floor,L=typeof BigInt=="function"?BigInt.prototype.valueOf:null,_=Object.getOwnPropertySymbols,k=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Symbol.prototype.toString:null,x=typeof Symbol=="function"&&typeof Symbol.iterator=="object",z=typeof Symbol=="function"&&Symbol.toStringTag&&(typeof Symbol.toStringTag===x||!0)?Symbol.toStringTag:null,F=Object.prototype.propertyIsEnumerable,I=(typeof Reflect=="function"?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(Q){return Q.__proto__}:null);function K(Q,re){if(Q===1/0||Q===-1/0||Q!==Q||Q&&Q>-1e3&&Q<1e3||E.call(/e/,re))return re;var Oe=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if(typeof Q=="number"){var Ie=Q<0?-R(-Q):R(Q);if(Ie!==Q){var qe=String(Ie),A=b.call(re,qe.length+1);return v.call(qe,Oe,"$&_")+"."+v.call(v.call(A,/([0-9]{3})/g,"$&_"),/_$/,"")}}return v.call(re,Oe,"$&_")}var P=t4,te=P.custom,W=D(te)?te:null,B={__proto__:null,double:'"',single:"'"},oe={__proto__:null,double:/(["\\])/g,single:/(['\\])/g};su=function Q(re,Oe,Ie,qe){var A=Oe||{};if(M(A,"quoteStyle")&&!M(B,A.quoteStyle))throw new TypeError('option "quoteStyle" must be "single" or "double"');if(M(A,"maxStringLength")&&(typeof A.maxStringLength=="number"?A.maxStringLength<0&&A.maxStringLength!==1/0:A.maxStringLength!==null))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var O=M(A,"customInspect")?A.customInspect:!0;if(typeof O!="boolean"&&O!=="symbol")throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(M(A,"indent")&&A.indent!==null&&A.indent!==" "&&!(parseInt(A.indent,10)===A.indent&&A.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(M(A,"numericSeparator")&&typeof A.numericSeparator!="boolean")throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var H=A.numericSeparator;if(typeof re>"u")return"undefined";if(re===null)return"null";if(typeof re=="boolean")return re?"true":"false";if(typeof re=="string")return xe(re,A);if(typeof re=="number"){if(re===0)return 1/0/re>0?"0":"-0";var se=String(re);return H?K(re,se):se}if(typeof re=="bigint"){var we=String(re)+"n";return H?K(re,we):we}var Ue=typeof A.depth>"u"?5:A.depth;if(typeof Ie>"u"&&(Ie=0),Ie>=Ue&&Ue>0&&typeof re=="object")return he(re)?"[Array]":"[Object]";var We=ve(A,Ie);if(typeof qe>"u")qe=[];else if(ie(qe,re)>=0)return"[Circular]";function $e(ti,zo,f_){if(zo&&(qe=C.call(qe),qe.push(zo)),f_){var Kp={depth:A.depth};return M(A,"quoteStyle")&&(Kp.quoteStyle=A.quoteStyle),Q(ti,Kp,Ie+1,qe)}return Q(ti,A,Ie+1,qe)}if(typeof re=="function"&&!me(re)){var Wt=$(re),Zt=ke(re,$e);return"[Function"+(Wt?": "+Wt:" (anonymous)")+"]"+(Zt.length>0?" { "+U.call(Zt,", ")+" }":"")}if(D(re)){var Lt=x?v.call(String(re),/^(Symbol\(.*\))_[^)]*$/,"$1"):k.call(re);return typeof re=="object"&&!x?Se(Lt):Lt}if(ae(re)){for(var Ot="<"+w.call(String(re.nodeName)),Yt=re.attributes||[],Pt=0;Pt<Yt.length;Pt++)Ot+=" "+Yt[Pt].name+"="+X(J(Yt[Pt].value),"double",A);return Ot+=">",re.childNodes&&re.childNodes.length&&(Ot+="..."),Ot+="</"+w.call(String(re.nodeName))+">",Ot}if(he(re)){if(re.length===0)return"[]";var Et=ke(re,$e);return We&&!ue(Et)?"["+Ee(Et,We)+"]":"[ "+U.call(Et,", ")+" ]"}if(de(re)){var Qt=ke(re,$e);return!("cause"in Error.prototype)&&"cause"in re&&!F.call(re,"cause")?"{ ["+String(re)+"] "+U.call(S.call("[cause]: "+$e(re.cause),Qt),", ")+" }":Qt.length===0?"["+String(re)+"]":"{ ["+String(re)+"] "+U.call(Qt,", ")+" }"}if(typeof re=="object"&&O){if(W&&typeof re[W]=="function"&&P)return P(re,{depth:Ue-Ie});if(O!=="symbol"&&typeof re.inspect=="function")return re.inspect()}if(ne(re)){var zn=[];return r&&r.call(re,function(ti,zo){zn.push($e(zo,re,!0)+" => "+$e(ti,re))}),ee("Map",n.call(re),zn,We)}if(G(re)){var nt=[];return s&&s.call(re,function(ti){nt.push($e(ti,re))}),ee("Set",a.call(re),nt,We)}if(Z(re))return Ce("WeakMap");if(Y(re))return Ce("WeakSet");if(q(re))return Ce("WeakRef");if(ye(re))return Se($e(Number(re)));if(V(re))return Se($e(L.call(re)));if(be(re))return Se(p.call(re));if(ge(re))return Se($e(String(re)));if(typeof window<"u"&&re===window)return"{ [object Window] }";if(typeof globalThis<"u"&&re===globalThis||typeof Xt<"u"&&re===Xt)return"{ [object globalThis] }";if(!fe(re)&&!me(re)){var Qr=ke(re,$e),wn=I?I(re)===Object.prototype:re instanceof Object||re.constructor===Object,ei=re instanceof Object?"":"null prototype",Gp=!wn&&z&&Object(re)===re&&z in re?b.call(N(re),8,-1):ei?"Object":"",u_=wn||typeof re.constructor!="function"?"":re.constructor.name?re.constructor.name+" ":"",Sc=u_+(Gp||ei?"["+U.call(S.call([],Gp||[],ei||[]),": ")+"] ":"");return Qr.length===0?Sc+"{}":We?Sc+"{"+Ee(Qr,We)+"}":Sc+"{ "+U.call(Qr,", ")+" }"}return String(re)};function X(Q,re,Oe){var Ie=Oe.quoteStyle||re,qe=B[Ie];return qe+Q+qe}function J(Q){return v.call(String(Q),/"/g,"&quot;")}function le(Q){return!z||!(typeof Q=="object"&&(z in Q||typeof Q[z]<"u"))}function he(Q){return N(Q)==="[object Array]"&&le(Q)}function fe(Q){return N(Q)==="[object Date]"&&le(Q)}function me(Q){return N(Q)==="[object RegExp]"&&le(Q)}function de(Q){return N(Q)==="[object Error]"&&le(Q)}function ge(Q){return N(Q)==="[object String]"&&le(Q)}function ye(Q){return N(Q)==="[object Number]"&&le(Q)}function be(Q){return N(Q)==="[object Boolean]"&&le(Q)}function D(Q){if(x)return Q&&typeof Q=="object"&&Q instanceof Symbol;if(typeof Q=="symbol")return!0;if(!Q||typeof Q!="object"||!k)return!1;try{return k.call(Q),!0}catch{}return!1}function V(Q){if(!Q||typeof Q!="object"||!L)return!1;try{return L.call(Q),!0}catch{}return!1}var j=Object.prototype.hasOwnProperty||function(Q){return Q in this};function M(Q,re){return j.call(Q,re)}function N(Q){return m.call(Q)}function $(Q){if(Q.name)return Q.name;var re=y.call(g.call(Q),/^function\s*([\w$]+)/);return re?re[1]:null}function ie(Q,re){if(Q.indexOf)return Q.indexOf(re);for(var Oe=0,Ie=Q.length;Oe<Ie;Oe++)if(Q[Oe]===re)return Oe;return-1}function ne(Q){if(!n||!Q||typeof Q!="object")return!1;try{n.call(Q);try{a.call(Q)}catch{return!0}return Q instanceof Map}catch{}return!1}function Z(Q){if(!l||!Q||typeof Q!="object")return!1;try{l.call(Q,l);try{f.call(Q,f)}catch{return!0}return Q instanceof WeakMap}catch{}return!1}function q(Q){if(!h||!Q||typeof Q!="object")return!1;try{return h.call(Q),!0}catch{}return!1}function G(Q){if(!a||!Q||typeof Q!="object")return!1;try{a.call(Q);try{n.call(Q)}catch{return!0}return Q instanceof Set}catch{}return!1}function Y(Q){if(!f||!Q||typeof Q!="object")return!1;try{f.call(Q,f);try{l.call(Q,l)}catch{return!0}return Q instanceof WeakSet}catch{}return!1}function ae(Q){return!Q||typeof Q!="object"?!1:typeof HTMLElement<"u"&&Q instanceof HTMLElement?!0:typeof Q.nodeName=="string"&&typeof Q.getAttribute=="function"}function xe(Q,re){if(Q.length>re.maxStringLength){var Oe=Q.length-re.maxStringLength,Ie="... "+Oe+" more character"+(Oe>1?"s":"");return xe(b.call(Q,0,re.maxStringLength),re)+Ie}var qe=oe[re.quoteStyle||"single"];qe.lastIndex=0;var A=v.call(v.call(Q,qe,"\\$1"),/[\x00-\x1f]/g,Te);return X(A,"single",re)}function Te(Q){var re=Q.charCodeAt(0),Oe={8:"b",9:"t",10:"n",12:"f",13:"r"}[re];return Oe?"\\"+Oe:"\\x"+(re<16?"0":"")+T.call(re.toString(16))}function Se(Q){return"Object("+Q+")"}function Ce(Q){return Q+" { ? }"}function ee(Q,re,Oe,Ie){var qe=Ie?Ee(Oe,Ie):U.call(Oe,", ");return Q+" ("+re+") {"+qe+"}"}function ue(Q){for(var re=0;re<Q.length;re++)if(ie(Q[re],`
15
15
  `)>=0)return!1;return!0}function ve(Q,re){var Oe;if(Q.indent===" ")Oe=" ";else if(typeof Q.indent=="number"&&Q.indent>0)Oe=U.call(Array(Q.indent+1)," ");else return null;return{base:Oe,prev:U.call(Array(re+1),Oe)}}function Ee(Q,re){if(Q.length===0)return"";var Oe=`
16
16
  `+re.prev+re.base;return Oe+U.call(Q,","+Oe)+`
17
17
  `+re.prev}function ke(Q,re){var Oe=he(Q),Ie=[];if(Oe){Ie.length=Q.length;for(var qe=0;qe<Q.length;qe++)Ie[qe]=M(Q,qe)?re(Q[qe],Q):""}var A=typeof _=="function"?_(Q):[],O;if(x){O={};for(var H=0;H<A.length;H++)O["$"+A[H]]=A[H]}for(var se in Q)M(Q,se)&&(Oe&&String(Number(se))===se&&se<Q.length||x&&O["$"+se]instanceof Symbol||(E.call(/[^\w$]/,se)?Ie.push(re(se,Q)+": "+re(Q[se],Q)):Ie.push(se+": "+re(Q[se],Q))));if(typeof _=="function")for(var we=0;we<A.length;we++)F.call(Q,A[we])&&Ie.push("["+re(A[we])+"]: "+re(Q[A[we]],Q));return Ie}return su}var cu,Hy;function n4(){if(Hy)return cu;Hy=1;var t=tc(),e=Jt(),n=function(s,c,l){for(var u=s,f;(f=u.next)!=null;u=f)if(f.key===c)return u.next=f.next,l||(f.next=s.next,s.next=f),f},r=function(s,c){if(s){var l=n(s,c);return l&&l.value}},i=function(s,c,l){var u=n(s,c);u?u.value=l:s.next={key:c,next:s.next,value:l}},o=function(s,c){return s?!!n(s,c):!1},a=function(s,c){if(s)return n(s,c,!0)};return cu=function(){var c,l={assert:function(u){if(!l.has(u))throw new e("Side channel does not contain "+t(u))},delete:function(u){var f=c&&c.next,d=a(c,u);return d&&f&&f===d&&(c=void 0),!!d},get:function(u){return r(c,u)},has:function(u){return o(c,u)},set:function(u,f){c||(c={next:void 0}),i(c,u,f)}};return l},cu}var lu,Xy;function tD(){if(Xy)return lu;Xy=1;var t=qn(),e=bt(),n=tc(),r=Jt(),i=t("%Map%",!0),o=e("Map.prototype.get",!0),a=e("Map.prototype.set",!0),s=e("Map.prototype.has",!0),c=e("Map.prototype.delete",!0),l=e("Map.prototype.size",!0);return lu=!!i&&function(){var f,d={assert:function(h){if(!d.has(h))throw new r("Side channel does not contain "+n(h))},delete:function(h){if(f){var p=c(f,h);return l(f)===0&&(f=void 0),p}return!1},get:function(h){if(f)return o(f,h)},has:function(h){return f?s(f,h):!1},set:function(h,p){f||(f=new i),a(f,h,p)}};return d},lu}var uu,Gy;function r4(){if(Gy)return uu;Gy=1;var t=qn(),e=bt(),n=tc(),r=tD(),i=Jt(),o=t("%WeakMap%",!0),a=e("WeakMap.prototype.get",!0),s=e("WeakMap.prototype.set",!0),c=e("WeakMap.prototype.has",!0),l=e("WeakMap.prototype.delete",!0);return uu=o?function(){var f,d,h={assert:function(p){if(!h.has(p))throw new i("Side channel does not contain "+n(p))},delete:function(p){if(o&&p&&(typeof p=="object"||typeof p=="function")){if(f)return l(f,p)}else if(r&&d)return d.delete(p);return!1},get:function(p){return o&&p&&(typeof p=="object"||typeof p=="function")&&f?a(f,p):d&&d.get(p)},has:function(p){return o&&p&&(typeof p=="object"||typeof p=="function")&&f?c(f,p):!!d&&d.has(p)},set:function(p,m){o&&p&&(typeof p=="object"||typeof p=="function")?(f||(f=new o),s(f,p,m)):r&&(d||(d=r()),d.set(p,m))}};return h}:r,uu}var fu,Ky;function nD(){if(Ky)return fu;Ky=1;var t=Jt(),e=tc(),n=n4(),r=tD(),i=r4(),o=i||r||n;return fu=function(){var s,c={assert:function(l){if(!c.has(l))throw new t("Side channel does not contain "+e(l))},delete:function(l){return!!s&&s.delete(l)},get:function(l){return s&&s.get(l)},has:function(l){return!!s&&s.has(l)},set:function(l,u){s||(s=o()),s.set(l,u)}};return c},fu}var du,Jy;function i4(){if(Jy)return du;Jy=1;var t=ep(),e=nD()(),n=Jt(),r={assert:function(i,o){if(!i||typeof i!="object"&&typeof i!="function")throw new n("`O` is not an object");if(typeof o!="string")throw new n("`slot` must be a string");if(e.assert(i),!r.has(i,o))throw new n("`"+o+"` is not present on `O`")},get:function(i,o){if(!i||typeof i!="object"&&typeof i!="function")throw new n("`O` is not an object");if(typeof o!="string")throw new n("`slot` must be a string");var a=e.get(i);return a&&a["$"+o]},has:function(i,o){if(!i||typeof i!="object"&&typeof i!="function")throw new n("`O` is not an object");if(typeof o!="string")throw new n("`slot` must be a string");var a=e.get(i);return!!a&&t(a,"$"+o)},set:function(i,o,a){if(!i||typeof i!="object"&&typeof i!="function")throw new n("`O` is not an object");if(typeof o!="string")throw new n("`slot` must be a string");var s=e.get(i);s||(s={},e.set(i,s)),s["$"+o]=a}};return Object.freeze&&Object.freeze(r),du=r,du}var hu,Zy;function o4(){if(Zy)return hu;Zy=1;var t=i4(),e=Hh(),n=typeof StopIteration=="object"?StopIteration:null;return hu=function(i){if(!n)throw new e("this environment lacks StopIteration");t.set(i,"[[Done]]",!1);var o={next:function(){var s=t.get(this,"[[Iterator]]"),c=!!t.get(s,"[[Done]]");try{return{done:c,value:c?void 0:s.next()}}catch(l){if(t.set(s,"[[Done]]",!0),l!==n)throw l;return{done:!0,value:void 0}}}};return t.set(o,"[[Iterator]]",i),o},hu}var pu,Yy;function rD(){if(Yy)return pu;Yy=1;var t={}.toString;return pu=Array.isArray||function(e){return t.call(e)=="[object Array]"},pu}var gu,Qy;function iD(){if(Qy)return gu;Qy=1;var t=bt(),e=t("String.prototype.valueOf"),n=function(s){try{return e(s),!0}catch{return!1}},r=t("Object.prototype.toString"),i="[object String]",o=Gr()();return gu=function(s){return typeof s=="string"?!0:!s||typeof s!="object"?!1:o?n(s):r(s)===i},gu}var mu,e1;function oD(){if(e1)return mu;e1=1;var t=typeof Map=="function"&&Map.prototype?Map:null,e=typeof Set=="function"&&Set.prototype?Set:null,n;t||(n=function(a){return!1});var r=t?Map.prototype.has:null,i=e?Set.prototype.has:null;return!n&&!r&&(n=function(a){return!1}),mu=n||function(a){if(!a||typeof a!="object")return!1;try{if(r.call(a),i)try{i.call(a)}catch{return!0}return a instanceof t}catch{}return!1},mu}var yu,t1;function aD(){if(t1)return yu;t1=1;var t=typeof Map=="function"&&Map.prototype?Map:null,e=typeof Set=="function"&&Set.prototype?Set:null,n;e||(n=function(a){return!1});var r=t?Map.prototype.has:null,i=e?Set.prototype.has:null;return!n&&!i&&(n=function(a){return!1}),yu=n||function(a){if(!a||typeof a!="object")return!1;try{if(i.call(a),r)try{r.call(a)}catch{return!0}return a instanceof e}catch{}return!1},yu}var n1;function a4(){if(n1)return qi.exports;n1=1;var t=eD(),e=o4();if(Jh()()||ec()()){var n=Symbol.iterator;qi.exports=function(C){if(C!=null&&typeof C[n]<"u")return C[n]();if(t(C))return Array.prototype[n].call(C)}}else{var r=rD(),i=iD(),o=qn(),a=o("%Map%",!0),s=o("%Set%",!0),c=Zx(),l=c("Array.prototype.push"),u=c("String.prototype.charCodeAt"),f=c("String.prototype.slice"),d=function(C,R){var L=C.length;if(R+1>=L)return R+1;var _=u(C,R);if(_<55296||_>56319)return R+1;var k=u(C,R+1);return k<56320||k>57343?R+1:R+2},h=function(C){var R=0;return{next:function(){var _=R>=C.length,k;return _||(k=C[R],R+=1),{done:_,value:k}}}},p=function(C,R){if(r(C)||t(C))return h(C);if(i(C)){var L=0;return{next:function(){var k=d(C,L),x=f(C,L,k);return L=k,{done:k>C.length,value:x}}}}if(R&&typeof C["_es6-shim iterator_"]<"u")return C["_es6-shim iterator_"]()};if(!a&&!s)qi.exports=function(C){if(C!=null)return p(C,!0)};else{var m=oD(),g=aD(),y=c("Map.prototype.forEach",!0),b=c("Set.prototype.forEach",!0);if(typeof process>"u"||!process.versions||!process.versions.node)var v=c("Map.prototype.iterator",!0),T=c("Set.prototype.iterator",!0);var w=c("Map.prototype.@@iterator",!0)||c("Map.prototype._es6-shim iterator_",!0),E=c("Set.prototype.@@iterator",!0)||c("Set.prototype._es6-shim iterator_",!0),S=function(C){if(m(C)){if(v)return e(v(C));if(w)return w(C);if(y){var R=[];return y(C,function(_,k){l(R,[k,_])}),h(R)}}if(g(C)){if(T)return e(T(C));if(E)return E(C);if(b){var L=[];return b(C,function(_){l(L,_)}),h(L)}}};qi.exports=function(C){return S(C)||p(C)}}}return qi.exports}var bu,r1;function sD(){if(r1)return bu;r1=1;var t=function(e){return e!==e};return bu=function(n,r){return n===0&&r===0?1/n===1/r:!!(n===r||t(n)&&t(r))},bu}var vu,i1;function cD(){if(i1)return vu;i1=1;var t=sD();return vu=function(){return typeof Object.is=="function"?Object.is:t},vu}var xu,o1;function s4(){if(o1)return xu;o1=1;var t=cD(),e=Xr();return xu=function(){var r=t();return e(Object,{is:r},{is:function(){return Object.is!==r}}),r},xu}var Du,a1;function c4(){if(a1)return Du;a1=1;var t=Xr(),e=Ri(),n=sD(),r=cD(),i=s4(),o=e(r(),Object);return t(o,{getPolyfill:r,implementation:n,shim:i}),Du=o,Du}var wu,s1;function lD(){if(s1)return wu;s1=1;var t=Ri(),e=bt(),n=qn(),r=n("%ArrayBuffer%",!0),i=e("ArrayBuffer.prototype.byteLength",!0),o=e("Object.prototype.toString"),a=!!r&&!i&&new r(0).slice,s=!!a&&t(a);return wu=i||s?function(l){if(!l||typeof l!="object")return!1;try{return i?i(l):s(l,0),!0}catch{return!1}}:r?function(l){return o(l)==="[object ArrayBuffer]"}:function(l){return!1},wu}var _u,c1;function l4(){if(c1)return _u;c1=1;var t=bt(),e=t("Date.prototype.getDay"),n=function(s){try{return e(s),!0}catch{return!1}},r=t("Object.prototype.toString"),i="[object Date]",o=Gr()();return _u=function(s){return typeof s!="object"||s===null?!1:o?n(s):r(s)===i},_u}var Tu,l1;function uD(){if(l1)return Tu;l1=1;var t=bt(),e=Gr()(),n=ep(),r=Hr(),i;if(e){var o=t("RegExp.prototype.exec"),a={},s=function(){throw a},c={toString:s,valueOf:s};typeof Symbol.toPrimitive=="symbol"&&(c[Symbol.toPrimitive]=s),i=function(d){if(!d||typeof d!="object")return!1;var h=r(d,"lastIndex"),p=h&&n(h,"value");if(!p)return!1;try{o(d,c)}catch(m){return m===a}}}else{var l=t("Object.prototype.toString"),u="[object RegExp]";i=function(d){return!d||typeof d!="object"&&typeof d!="function"?!1:l(d)===u}}return Tu=i,Tu}var Eu,u1;function u4(){if(u1)return Eu;u1=1;var t=bt(),e=t("SharedArrayBuffer.prototype.byteLength",!0);return Eu=e?function(r){if(!r||typeof r!="object")return!1;try{return e(r),!0}catch{return!1}}:function(r){return!1},Eu}var Cu,f1;function f4(){if(f1)return Cu;f1=1;var t=bt(),e=t("Number.prototype.toString"),n=function(s){try{return e(s),!0}catch{return!1}},r=t("Object.prototype.toString"),i="[object Number]",o=Gr()();return Cu=function(s){return typeof s=="number"?!0:!s||typeof s!="object"?!1:o?n(s):r(s)===i},Cu}var Su,d1;function d4(){if(d1)return Su;d1=1;var t=bt(),e=t("Boolean.prototype.toString"),n=t("Object.prototype.toString"),r=function(s){try{return e(s),!0}catch{return!1}},i="[object Boolean]",o=Gr()();return Su=function(s){return typeof s=="boolean"?!0:s===null||typeof s!="object"?!1:o?r(s):n(s)===i},Su}var Qo={exports:{}},Au,h1;function h4(){if(h1)return Au;h1=1;var t=bt(),e=uD(),n=t("RegExp.prototype.exec"),r=Jt();return Au=function(o){if(!e(o))throw new r("`regex` must be a RegExp");return function(s){return n(o,s)!==null}},Au}var p1;function p4(){if(p1)return Qo.exports;p1=1;var t=bt(),e=t("Object.prototype.toString"),n=Jh()(),r=h4();if(n){var i=t("Symbol.prototype.toString"),o=r(/^Symbol\(.*\)$/),a=function(c){return typeof c.valueOf()!="symbol"?!1:o(i(c))};Qo.exports=function(c){if(typeof c=="symbol")return!0;if(!c||typeof c!="object"||e(c)!=="[object Symbol]")return!1;try{return a(c)}catch{return!1}}}else Qo.exports=function(c){return!1};return Qo.exports}var ea={exports:{}},Uu,g1;function g4(){if(g1)return Uu;g1=1;var t=typeof BigInt<"u"&&BigInt;return Uu=function(){return typeof t=="function"&&typeof BigInt=="function"&&typeof t(42)=="bigint"&&typeof BigInt(42)=="bigint"},Uu}var m1;function m4(){if(m1)return ea.exports;m1=1;var t=g4()();if(t){var e=BigInt.prototype.valueOf,n=function(i){try{return e.call(i),!0}catch{}return!1};ea.exports=function(i){return i===null||typeof i>"u"||typeof i=="boolean"||typeof i=="string"||typeof i=="number"||typeof i=="symbol"||typeof i=="function"?!1:typeof i=="bigint"?!0:n(i)}}else ea.exports=function(i){return!1};return ea.exports}var ku,y1;function y4(){if(y1)return ku;y1=1;var t=iD(),e=f4(),n=d4(),r=p4(),i=m4();return ku=function(a){if(a==null||typeof a!="object"&&typeof a!="function")return null;if(t(a))return"String";if(e(a))return"Number";if(n(a))return"Boolean";if(r(a))return"Symbol";if(i(a))return"BigInt"},ku}var Fu,b1;function b4(){if(b1)return Fu;b1=1;var t=typeof WeakMap=="function"&&WeakMap.prototype?WeakMap:null,e=typeof WeakSet=="function"&&WeakSet.prototype?WeakSet:null,n;t||(n=function(a){return!1});var r=t?t.prototype.has:null,i=e?e.prototype.has:null;return!n&&!r&&(n=function(a){return!1}),Fu=n||function(a){if(!a||typeof a!="object")return!1;try{if(r.call(a,r),i)try{i.call(a,i)}catch{return!0}return a instanceof t}catch{}return!1},Fu}var ta={exports:{}},v1;function v4(){if(v1)return ta.exports;v1=1;var t=qn(),e=bt(),n=t("%WeakSet%",!0),r=e("WeakSet.prototype.has",!0);if(r){var i=e("WeakMap.prototype.has",!0);ta.exports=function(a){if(!a||typeof a!="object")return!1;try{if(r(a,r),i)try{i(a,i)}catch{return!0}return a instanceof n}catch{}return!1}}else ta.exports=function(a){return!1};return ta.exports}var Ou,x1;function x4(){if(x1)return Ou;x1=1;var t=oD(),e=aD(),n=b4(),r=v4();return Ou=function(o){if(o&&typeof o=="object"){if(t(o))return"Map";if(e(o))return"Set";if(n(o))return"WeakMap";if(r(o))return"WeakSet"}return!1},Ou}var Ru,D1;function D4(){if(D1)return Ru;D1=1;var t=Function.prototype.toString,e=typeof Reflect=="object"&&Reflect!==null&&Reflect.apply,n,r;if(typeof e=="function"&&typeof Object.defineProperty=="function")try{n=Object.defineProperty({},"length",{get:function(){throw r}}),r={},e(function(){throw 42},null,n)}catch(b){b!==r&&(e=null)}else e=null;var i=/^\s*class\b/,o=function(v){try{var T=t.call(v);return i.test(T)}catch{return!1}},a=function(v){try{return o(v)?!1:(t.call(v),!0)}catch{return!1}},s=Object.prototype.toString,c="[object Object]",l="[object Function]",u="[object GeneratorFunction]",f="[object HTMLAllCollection]",d="[object HTML document.all class]",h="[object HTMLCollection]",p=typeof Symbol=="function"&&!!Symbol.toStringTag,m=!(0 in[,]),g=function(){return!1};if(typeof document=="object"){var y=document.all;s.call(y)===s.call(document.all)&&(g=function(v){if((m||!v)&&(typeof v>"u"||typeof v=="object"))try{var T=s.call(v);return(T===f||T===d||T===h||T===c)&&v("")==null}catch{}return!1})}return Ru=e?function(v){if(g(v))return!0;if(!v||typeof v!="function"&&typeof v!="object")return!1;try{e(v,null,n)}catch(T){if(T!==r)return!1}return!o(v)&&a(v)}:function(v){if(g(v))return!0;if(!v||typeof v!="function"&&typeof v!="object")return!1;if(p)return a(v);if(o(v))return!1;var T=s.call(v);return T!==l&&T!==u&&!/^\[object HTML/.test(T)?!1:a(v)},Ru}var Nu,w1;function w4(){if(w1)return Nu;w1=1;var t=D4(),e=Object.prototype.toString,n=Object.prototype.hasOwnProperty,r=function(c,l,u){for(var f=0,d=c.length;f<d;f++)n.call(c,f)&&(u==null?l(c[f],f,c):l.call(u,c[f],f,c))},i=function(c,l,u){for(var f=0,d=c.length;f<d;f++)u==null?l(c.charAt(f),f,c):l.call(u,c.charAt(f),f,c)},o=function(c,l,u){for(var f in c)n.call(c,f)&&(u==null?l(c[f],f,c):l.call(u,c[f],f,c))};function a(s){return e.call(s)==="[object Array]"}return Nu=function(c,l,u){if(!t(l))throw new TypeError("iterator must be a function");var f;arguments.length>=3&&(f=u),a(c)?r(c,l,f):typeof c=="string"?i(c,l,f):o(c,l,f)},Nu}var Bu,_1;function _4(){return _1||(_1=1,Bu=["Float16Array","Float32Array","Float64Array","Int8Array","Int16Array","Int32Array","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array"]),Bu}var Iu,T1;function T4(){if(T1)return Iu;T1=1;var t=_4(),e=typeof globalThis>"u"?Xt:globalThis;return Iu=function(){for(var r=[],i=0;i<t.length;i++)typeof e[t[i]]=="function"&&(r[r.length]=t[i]);return r},Iu}var Mu,E1;function E4(){if(E1)return Mu;E1=1;var t=w4(),e=T4(),n=Ri(),r=bt(),i=Hr(),o=r("Object.prototype.toString"),a=Gr()(),s=typeof globalThis>"u"?Xt:globalThis,c=e(),l=r("String.prototype.slice"),u=Object.getPrototypeOf,f=r("Array.prototype.indexOf",!0)||function(g,y){for(var b=0;b<g.length;b+=1)if(g[b]===y)return b;return-1},d={__proto__:null};a&&i&&u?t(c,function(m){var g=new s[m];if(Symbol.toStringTag in g){var y=u(g),b=i(y,Symbol.toStringTag);if(!b){var v=u(y);b=i(v,Symbol.toStringTag)}d["$"+m]=n(b.get)}}):t(c,function(m){var g=new s[m],y=g.slice||g.set;y&&(d["$"+m]=n(y))});var h=function(g){var y=!1;return t(d,function(b,v){if(!y)try{"$"+b(g)===v&&(y=l(v,1))}catch{}}),y},p=function(g){var y=!1;return t(d,function(b,v){if(!y)try{b(g),y=l(v,1)}catch{}}),y};return Mu=function(g){if(!g||typeof g!="object")return!1;if(!a){var y=l(o(g),8,-1);return f(c,y)>-1?y:y!=="Object"?!1:p(g)}return i?h(g):null},Mu}var Wu,C1;function C4(){if(C1)return Wu;C1=1;var t=bt(),e=t("ArrayBuffer.prototype.byteLength",!0),n=lD();return Wu=function(i){return n(i)?e?e(i):i.byteLength:NaN},Wu}var Lu,S1;function S4(){if(S1)return Lu;S1=1;var t=Gk(),e=Zx(),n=Yk(),r=qn(),i=a4(),o=nD(),a=c4(),s=eD(),c=rD(),l=lD(),u=l4(),f=uD(),d=u4(),h=Vh(),p=y4(),m=x4(),g=E4(),y=C4(),b=e("SharedArrayBuffer.prototype.byteLength",!0),v=e("Date.prototype.getTime"),T=Object.getPrototypeOf,w=e("Object.prototype.toString"),E=r("%Set%",!0),S=e("Map.prototype.has",!0),U=e("Map.prototype.get",!0),C=e("Map.prototype.size",!0),R=e("Set.prototype.add",!0),L=e("Set.prototype.delete",!0),_=e("Set.prototype.has",!0),k=e("Set.prototype.size",!0);function x(X,J,le,he){for(var fe=i(X),me;(me=fe.next())&&!me.done;)if(P(J,me.value,le,he))return L(X,me.value),!0;return!1}function z(X){if(typeof X>"u")return null;if(typeof X!="object")return typeof X=="symbol"?!1:typeof X=="string"||typeof X=="number"?+X==+X:!0}function F(X,J,le,he,fe,me){var de=z(le);if(de!=null)return de;var ge=U(J,de),ye=t({},fe,{strict:!1});return typeof ge>"u"&&!S(J,de)||!P(he,ge,ye,me)?!1:!S(X,de)&&P(he,ge,ye,me)}function I(X,J,le){var he=z(le);return he??(_(J,he)&&!_(X,he))}function K(X,J,le,he,fe,me){for(var de=i(X),ge,ye;(ge=de.next())&&!ge.done;)if(ye=ge.value,P(le,ye,fe,me)&&P(he,U(J,ye),fe,me))return L(X,ye),!0;return!1}function P(X,J,le,he){var fe=le||{};if(fe.strict?a(X,J):X===J)return!0;var me=p(X),de=p(J);if(me!==de)return!1;if(!X||!J||typeof X!="object"&&typeof J!="object")return fe.strict?a(X,J):X==J;var ge=he.has(X),ye=he.has(J),be;if(ge&&ye){if(he.get(X)===he.get(J))return!0}else be={};return ge||he.set(X,be),ye||he.set(J,be),oe(X,J,fe,he)}function te(X){return!X||typeof X!="object"||typeof X.length!="number"||typeof X.copy!="function"||typeof X.slice!="function"||X.length>0&&typeof X[0]!="number"?!1:!!(X.constructor&&X.constructor.isBuffer&&X.constructor.isBuffer(X))}function W(X,J,le,he){if(k(X)!==k(J))return!1;for(var fe=i(X),me=i(J),de,ge,ye;(de=fe.next())&&!de.done;)if(de.value&&typeof de.value=="object")ye||(ye=new E),R(ye,de.value);else if(!_(J,de.value)){if(le.strict||!I(X,J,de.value))return!1;ye||(ye=new E),R(ye,de.value)}if(ye){for(;(ge=me.next())&&!ge.done;)if(ge.value&&typeof ge.value=="object"){if(!x(ye,ge.value,le.strict,he))return!1}else if(!le.strict&&!_(X,ge.value)&&!x(ye,ge.value,le.strict,he))return!1;return k(ye)===0}return!0}function B(X,J,le,he){if(C(X)!==C(J))return!1;for(var fe=i(X),me=i(J),de,ge,ye,be,D,V;(de=fe.next())&&!de.done;)if(be=de.value[0],D=de.value[1],be&&typeof be=="object")ye||(ye=new E),R(ye,be);else if(V=U(J,be),typeof V>"u"&&!S(J,be)||!P(D,V,le,he)){if(le.strict||!F(X,J,be,D,le,he))return!1;ye||(ye=new E),R(ye,be)}if(ye){for(;(ge=me.next())&&!ge.done;)if(be=ge.value[0],V=ge.value[1],be&&typeof be=="object"){if(!K(ye,X,be,V,le,he))return!1}else if(!le.strict&&(!X.has(be)||!P(U(X,be),V,le,he))&&!K(ye,X,be,V,t({},le,{strict:!1}),he))return!1;return k(ye)===0}return!0}function oe(X,J,le,he){var fe,me;if(typeof X!=typeof J||X==null||J==null||w(X)!==w(J)||s(X)!==s(J))return!1;var de=c(X),ge=c(J);if(de!==ge)return!1;var ye=X instanceof Error,be=J instanceof Error;if(ye!==be||(ye||be)&&(X.name!==J.name||X.message!==J.message))return!1;var D=f(X),V=f(J);if(D!==V||(D||V)&&(X.source!==J.source||n(X)!==n(J)))return!1;var j=u(X),M=u(J);if(j!==M||(j||M)&&v(X)!==v(J)||le.strict&&T&&T(X)!==T(J))return!1;var N=g(X),$=g(J);if(N!==$)return!1;if(N||$){if(X.length!==J.length)return!1;for(fe=0;fe<X.length;fe++)if(X[fe]!==J[fe])return!1;return!0}var ie=te(X),ne=te(J);if(ie!==ne)return!1;if(ie||ne){if(X.length!==J.length)return!1;for(fe=0;fe<X.length;fe++)if(X[fe]!==J[fe])return!1;return!0}var Z=l(X),q=l(J);if(Z!==q)return!1;if(Z||q)return y(X)!==y(J)?!1:typeof Uint8Array=="function"&&P(new Uint8Array(X),new Uint8Array(J),le,he);var G=d(X),Y=d(J);if(G!==Y)return!1;if(G||Y)return b(X)!==b(J)?!1:typeof Uint8Array=="function"&&P(new Uint8Array(X),new Uint8Array(J),le,he);if(typeof X!=typeof J)return!1;var ae=h(X),xe=h(J);if(ae.length!==xe.length)return!1;for(ae.sort(),xe.sort(),fe=ae.length-1;fe>=0;fe--)if(ae[fe]!=xe[fe])return!1;for(fe=ae.length-1;fe>=0;fe--)if(me=ae[fe],!P(X[me],J[me],le,he))return!1;var Te=m(X),Se=m(J);return Te!==Se?!1:Te==="Set"||Se==="Set"?W(X,J,le,he):Te==="Map"?B(X,J,le,he):!0}return Lu=function(J,le,he){return P(J,le,he,o())},Lu}var A4=S4();const U4=$h(A4);var zt={},tp="1.13.7",A1=typeof self=="object"&&self.self===self&&self||typeof global=="object"&&global.global===global&&global||Function("return this")()||{},nc=Array.prototype,np=Object.prototype,U1=typeof Symbol<"u"?Symbol.prototype:null,k4=nc.push,Wo=nc.slice,So=np.toString,F4=np.hasOwnProperty,fD=typeof ArrayBuffer<"u",O4=typeof DataView<"u",R4=Array.isArray,k1=Object.keys,F1=Object.create,O1=fD&&ArrayBuffer.isView,N4=isNaN,B4=isFinite,dD=!{toString:null}.propertyIsEnumerable("toString"),R1=["valueOf","isPrototypeOf","toString","propertyIsEnumerable","hasOwnProperty","toLocaleString"],I4=Math.pow(2,53)-1;function Tt(t,e){return e=e==null?t.length-1:+e,function(){for(var n=Math.max(arguments.length-e,0),r=Array(n),i=0;i<n;i++)r[i]=arguments[i+e];switch(e){case 0:return t.call(this,r);case 1:return t.call(this,arguments[0],r);case 2:return t.call(this,arguments[0],arguments[1],r)}var o=Array(e+1);for(i=0;i<e;i++)o[i]=arguments[i];return o[e]=r,t.apply(this,o)}}function mr(t){var e=typeof t;return e==="function"||e==="object"&&!!t}function hD(t){return t===null}function rp(t){return t===void 0}function ip(t){return t===!0||t===!1||So.call(t)==="[object Boolean]"}function pD(t){return!!(t&&t.nodeType===1)}function vt(t){var e="[object "+t+"]";return function(n){return So.call(n)===e}}const rc=vt("String"),op=vt("Number"),gD=vt("Date"),mD=vt("RegExp"),yD=vt("Error"),ap=vt("Symbol"),sp=vt("ArrayBuffer");var bD=vt("Function"),M4=A1.document&&A1.document.childNodes;typeof/./!="function"&&typeof Int8Array!="object"&&typeof M4!="function"&&(bD=function(t){return typeof t=="function"||!1});const mt=bD,vD=vt("Object");var xD=O4&&(!/\[native code\]/.test(String(DataView))||vD(new DataView(new ArrayBuffer(8)))),cp=typeof Map<"u"&&vD(new Map),W4=vt("DataView");function L4(t){return t!=null&&mt(t.getInt8)&&sp(t.buffer)}const Ao=xD?L4:W4,yr=R4||vt("Array");function br(t,e){return t!=null&&F4.call(t,e)}var zd=vt("Arguments");(function(){zd(arguments)||(zd=function(t){return br(t,"callee")})})();const ic=zd;function DD(t){return!ap(t)&&B4(t)&&!isNaN(parseFloat(t))}function lp(t){return op(t)&&N4(t)}function up(t){return function(){return t}}function wD(t){return function(e){var n=t(e);return typeof n=="number"&&n>=0&&n<=I4}}function _D(t){return function(e){return e==null?void 0:e[t]}}const Bs=_D("byteLength"),P4=wD(Bs);var q4=/\[object ((I|Ui)nt(8|16|32)|Float(32|64)|Uint8Clamped|Big(I|Ui)nt64)Array\]/;function z4(t){return O1?O1(t)&&!Ao(t):P4(t)&&q4.test(So.call(t))}const fp=fD?z4:up(!1),Ut=_D("length");function j4(t){for(var e={},n=t.length,r=0;r<n;++r)e[t[r]]=!0;return{contains:function(i){return e[i]===!0},push:function(i){return e[i]=!0,t.push(i)}}}function TD(t,e){e=j4(e);var n=R1.length,r=t.constructor,i=mt(r)&&r.prototype||np,o="constructor";for(br(t,o)&&!e.contains(o)&&e.push(o);n--;)o=R1[n],o in t&&t[o]!==i[o]&&!e.contains(o)&&e.push(o)}function rt(t){if(!mr(t))return[];if(k1)return k1(t);var e=[];for(var n in t)br(t,n)&&e.push(n);return dD&&TD(t,e),e}function ED(t){if(t==null)return!0;var e=Ut(t);return typeof e=="number"&&(yr(t)||rc(t)||ic(t))?e===0:Ut(rt(t))===0}function dp(t,e){var n=rt(e),r=n.length;if(t==null)return!r;for(var i=Object(t),o=0;o<r;o++){var a=n[o];if(e[a]!==i[a]||!(a in i))return!1}return!0}function je(t){if(t instanceof je)return t;if(!(this instanceof je))return new je(t);this._wrapped=t}je.VERSION=tp;je.prototype.value=function(){return this._wrapped};je.prototype.valueOf=je.prototype.toJSON=je.prototype.value;je.prototype.toString=function(){return String(this._wrapped)};function N1(t){return new Uint8Array(t.buffer||t,t.byteOffset||0,Bs(t))}var B1="[object DataView]";function jd(t,e,n,r){if(t===e)return t!==0||1/t===1/e;if(t==null||e==null)return!1;if(t!==t)return e!==e;var i=typeof t;return i!=="function"&&i!=="object"&&typeof e!="object"?!1:CD(t,e,n,r)}function CD(t,e,n,r){t instanceof je&&(t=t._wrapped),e instanceof je&&(e=e._wrapped);var i=So.call(t);if(i!==So.call(e))return!1;if(xD&&i=="[object Object]"&&Ao(t)){if(!Ao(e))return!1;i=B1}switch(i){case"[object RegExp]":case"[object String]":return""+t==""+e;case"[object Number]":return+t!=+t?+e!=+e:+t==0?1/+t===1/e:+t==+e;case"[object Date]":case"[object Boolean]":return+t==+e;case"[object Symbol]":return U1.valueOf.call(t)===U1.valueOf.call(e);case"[object ArrayBuffer]":case B1:return CD(N1(t),N1(e),n,r)}var o=i==="[object Array]";if(!o&&fp(t)){var a=Bs(t);if(a!==Bs(e))return!1;if(t.buffer===e.buffer&&t.byteOffset===e.byteOffset)return!0;o=!0}if(!o){if(typeof t!="object"||typeof e!="object")return!1;var s=t.constructor,c=e.constructor;if(s!==c&&!(mt(s)&&s instanceof s&&mt(c)&&c instanceof c)&&"constructor"in t&&"constructor"in e)return!1}n=n||[],r=r||[];for(var l=n.length;l--;)if(n[l]===t)return r[l]===e;if(n.push(t),r.push(e),o){if(l=t.length,l!==e.length)return!1;for(;l--;)if(!jd(t[l],e[l],n,r))return!1}else{var u=rt(t),f;if(l=u.length,rt(e).length!==l)return!1;for(;l--;)if(f=u[l],!(br(e,f)&&jd(t[f],e[f],n,r)))return!1}return n.pop(),r.pop(),!0}function SD(t,e){return jd(t,e)}function Ni(t){if(!mr(t))return[];var e=[];for(var n in t)e.push(n);return dD&&TD(t,e),e}function hp(t){var e=Ut(t);return function(n){if(n==null)return!1;var r=Ni(n);if(Ut(r))return!1;for(var i=0;i<e;i++)if(!mt(n[t[i]]))return!1;return t!==kD||!mt(n[pp])}}var pp="forEach",AD="has",gp=["clear","delete"],UD=["get",AD,"set"],$4=gp.concat(pp,UD),kD=gp.concat(UD),V4=["add"].concat(gp,pp,AD);const FD=cp?hp($4):vt("Map"),OD=cp?hp(kD):vt("WeakMap"),RD=cp?hp(V4):vt("Set"),ND=vt("WeakSet");function Kr(t){for(var e=rt(t),n=e.length,r=Array(n),i=0;i<n;i++)r[i]=t[e[i]];return r}function BD(t){for(var e=rt(t),n=e.length,r=Array(n),i=0;i<n;i++)r[i]=[e[i],t[e[i]]];return r}function mp(t){for(var e={},n=rt(t),r=0,i=n.length;r<i;r++)e[t[n[r]]]=n[r];return e}function Uo(t){var e=[];for(var n in t)mt(t[n])&&e.push(n);return e.sort()}function yp(t,e){return function(n){var r=arguments.length;if(e&&(n=Object(n)),r<2||n==null)return n;for(var i=1;i<r;i++)for(var o=arguments[i],a=t(o),s=a.length,c=0;c<s;c++){var l=a[c];(!e||n[l]===void 0)&&(n[l]=o[l])}return n}}const bp=yp(Ni),Ci=yp(rt),vp=yp(Ni,!0);function H4(){return function(){}}function ID(t){if(!mr(t))return{};if(F1)return F1(t);var e=H4();e.prototype=t;var n=new e;return e.prototype=null,n}function MD(t,e){var n=ID(t);return e&&Ci(n,e),n}function WD(t){return mr(t)?yr(t)?t.slice():bp({},t):t}function LD(t,e){return e(t),t}function xp(t){return yr(t)?t:[t]}je.toPath=xp;function Lo(t){return je.toPath(t)}function Dp(t,e){for(var n=e.length,r=0;r<n;r++){if(t==null)return;t=t[e[r]]}return n?t:void 0}function wp(t,e,n){var r=Dp(t,Lo(e));return rp(r)?n:r}function PD(t,e){e=Lo(e);for(var n=e.length,r=0;r<n;r++){var i=e[r];if(!br(t,i))return!1;t=t[i]}return!!n}function oc(t){return t}function qr(t){return t=Ci({},t),function(e){return dp(e,t)}}function ac(t){return t=Lo(t),function(e){return Dp(e,t)}}function Po(t,e,n){if(e===void 0)return t;switch(n??3){case 1:return function(r){return t.call(e,r)};case 3:return function(r,i,o){return t.call(e,r,i,o)};case 4:return function(r,i,o,a){return t.call(e,r,i,o,a)}}return function(){return t.apply(e,arguments)}}function qD(t,e,n){return t==null?oc:mt(t)?Po(t,e,n):mr(t)&&!yr(t)?qr(t):ac(t)}function sc(t,e){return qD(t,e,1/0)}je.iteratee=sc;function kt(t,e,n){return je.iteratee!==sc?je.iteratee(t,e):qD(t,e,n)}function zD(t,e,n){e=kt(e,n);for(var r=rt(t),i=r.length,o={},a=0;a<i;a++){var s=r[a];o[s]=e(t[s],s,t)}return o}function _p(){}function jD(t){return t==null?_p:function(e){return wp(t,e)}}function $D(t,e,n){var r=Array(Math.max(0,t));e=Po(e,n,1);for(var i=0;i<t;i++)r[i]=e(i);return r}function Is(t,e){return e==null&&(e=t,t=0),t+Math.floor(Math.random()*(e-t+1))}const Si=Date.now||function(){return new Date().getTime()};function VD(t){var e=function(o){return t[o]},n="(?:"+rt(t).join("|")+")",r=RegExp(n),i=RegExp(n,"g");return function(o){return o=o==null?"":""+o,r.test(o)?o.replace(i,e):o}}const HD={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#x27;","`":"&#x60;"},XD=VD(HD),X4=mp(HD),GD=VD(X4),KD=je.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var Pu=/(.)^/,G4={"'":"'","\\":"\\","\r":"r","\n":"n","\u2028":"u2028","\u2029":"u2029"},K4=/\\|'|\r|\n|\u2028|\u2029/g;function J4(t){return"\\"+G4[t]}var Z4=/^\s*(\w|\$)+\s*$/;function JD(t,e,n){!e&&n&&(e=n),e=vp({},e,je.templateSettings);var r=RegExp([(e.escape||Pu).source,(e.interpolate||Pu).source,(e.evaluate||Pu).source].join("|")+"|$","g"),i=0,o="__p+='";t.replace(r,function(l,u,f,d,h){return o+=t.slice(i,h).replace(K4,J4),i=h+l.length,u?o+=`'+
@@ -16052,7 +16052,7 @@ function zh(t) {
16052
16052
  return t && t.__esModule && Object.prototype.hasOwnProperty.call(t, "default") ? t.default : t;
16053
16053
  }
16054
16054
  function WD(t) {
16055
- if (t.__esModule) return t;
16055
+ if (Object.prototype.hasOwnProperty.call(t, "__esModule")) return t;
16056
16056
  var e = t.default;
16057
16057
  if (typeof e == "function") {
16058
16058
  var n = function r() {