reactjs-tiptap-editor 0.0.26 → 0.0.27

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.
@@ -1,596 +0,0 @@
1
- "use strict";var HI=Object.defineProperty;var zI=(t,e,r)=>e in t?HI(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r;var kl=(t,e,r)=>zI(t,typeof e!="symbol"?e+"":e,r);const pe=require("react"),vf=require("react-dom"),ee=require("react/jsx-runtime");function JE(t){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const r in t)if(r!=="default"){const n=Object.getOwnPropertyDescriptor(t,r);Object.defineProperty(e,r,n.get?n:{enumerable:!0,get:()=>t[r]})}}return e.default=t,Object.freeze(e)}const L=JE(pe),wf=JE(vf);function Et(t){this.content=t}Et.prototype={constructor:Et,find:function(t){for(var e=0;e<this.content.length;e+=2)if(this.content[e]===t)return e;return-1},get:function(t){var e=this.find(t);return e==-1?void 0:this.content[e+1]},update:function(t,e,r){var n=r&&r!=t?this.remove(r):this,i=n.find(t),o=n.content.slice();return i==-1?o.push(r||t,e):(o[i+1]=e,r&&(o[i]=r)),new Et(o)},remove:function(t){var e=this.find(t);if(e==-1)return this;var r=this.content.slice();return r.splice(e,2),new Et(r)},addToStart:function(t,e){return new Et([t,e].concat(this.remove(t).content))},addToEnd:function(t,e){var r=this.remove(t).content.slice();return r.push(t,e),new Et(r)},addBefore:function(t,e,r){var n=this.remove(e),i=n.content.slice(),o=n.find(t);return i.splice(o==-1?i.length:o,0,e,r),new Et(i)},forEach:function(t){for(var e=0;e<this.content.length;e+=2)t(this.content[e],this.content[e+1])},prepend:function(t){return t=Et.from(t),t.size?new Et(t.content.concat(this.subtract(t).content)):this},append:function(t){return t=Et.from(t),t.size?new Et(this.subtract(t).content.concat(t.content)):this},subtract:function(t){var e=this;t=Et.from(t);for(var r=0;r<t.content.length;r+=2)e=e.remove(t.content[r]);return e},toObject:function(){var t={};return this.forEach(function(e,r){t[e]=r}),t},get size(){return this.content.length>>1}};Et.from=function(t){if(t instanceof Et)return t;var e=[];if(t)for(var r in t)e.push(r,t[r]);return new Et(e)};function YE(t,e,r){for(let n=0;;n++){if(n==t.childCount||n==e.childCount)return t.childCount==e.childCount?null:r;let i=t.child(n),o=e.child(n);if(i==o){r+=i.nodeSize;continue}if(!i.sameMarkup(o))return r;if(i.isText&&i.text!=o.text){for(let s=0;i.text[s]==o.text[s];s++)r++;return r}if(i.content.size||o.content.size){let s=YE(i.content,o.content,r+1);if(s!=null)return s}r+=i.nodeSize}}function ZE(t,e,r,n){for(let i=t.childCount,o=e.childCount;;){if(i==0||o==0)return i==o?null:{a:r,b:n};let s=t.child(--i),a=e.child(--o),l=s.nodeSize;if(s==a){r-=l,n-=l;continue}if(!s.sameMarkup(a))return{a:r,b:n};if(s.isText&&s.text!=a.text){let c=0,u=Math.min(s.text.length,a.text.length);for(;c<u&&s.text[s.text.length-c-1]==a.text[a.text.length-c-1];)c++,r--,n--;return{a:r,b:n}}if(s.content.size||a.content.size){let c=ZE(s.content,a.content,r-1,n-1);if(c)return c}r-=l,n-=l}}class he{constructor(e,r){if(this.content=e,this.size=r||0,r==null)for(let n=0;n<e.length;n++)this.size+=e[n].nodeSize}nodesBetween(e,r,n,i=0,o){for(let s=0,a=0;a<r;s++){let l=this.content[s],c=a+l.nodeSize;if(c>e&&n(l,i+a,o||null,s)!==!1&&l.content.size){let u=a+1;l.nodesBetween(Math.max(0,e-u),Math.min(l.content.size,r-u),n,i+u)}a=c}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,r,n,i){let o="",s=!0;return this.nodesBetween(e,r,(a,l)=>{let c=a.isText?a.text.slice(Math.max(e,l)-l,r-l):a.isLeaf?i?typeof i=="function"?i(a):i:a.type.spec.leafText?a.type.spec.leafText(a):"":"";a.isBlock&&(a.isLeaf&&c||a.isTextblock)&&n&&(s?s=!1:o+=n),o+=c},0),o}append(e){if(!e.size)return this;if(!this.size)return e;let r=this.lastChild,n=e.firstChild,i=this.content.slice(),o=0;for(r.isText&&r.sameMarkup(n)&&(i[i.length-1]=r.withText(r.text+n.text),o=1);o<e.content.length;o++)i.push(e.content[o]);return new he(i,this.size+e.size)}cut(e,r=this.size){if(e==0&&r==this.size)return this;let n=[],i=0;if(r>e)for(let o=0,s=0;s<r;o++){let a=this.content[o],l=s+a.nodeSize;l>e&&((s<e||l>r)&&(a.isText?a=a.cut(Math.max(0,e-s),Math.min(a.text.length,r-s)):a=a.cut(Math.max(0,e-s-1),Math.min(a.content.size,r-s-1))),n.push(a),i+=a.nodeSize),s=l}return new he(n,i)}cutByIndex(e,r){return e==r?he.empty:e==0&&r==this.content.length?this:new he(this.content.slice(e,r))}replaceChild(e,r){let n=this.content[e];if(n==r)return this;let i=this.content.slice(),o=this.size+r.nodeSize-n.nodeSize;return i[e]=r,new he(i,o)}addToStart(e){return new he([e].concat(this.content),this.size+e.nodeSize)}addToEnd(e){return new he(this.content.concat(e),this.size+e.nodeSize)}eq(e){if(this.content.length!=e.content.length)return!1;for(let r=0;r<this.content.length;r++)if(!this.content[r].eq(e.content[r]))return!1;return!0}get firstChild(){return this.content.length?this.content[0]:null}get lastChild(){return this.content.length?this.content[this.content.length-1]:null}get childCount(){return this.content.length}child(e){let r=this.content[e];if(!r)throw new RangeError("Index "+e+" out of range for "+this);return r}maybeChild(e){return this.content[e]||null}forEach(e){for(let r=0,n=0;r<this.content.length;r++){let i=this.content[r];e(i,n,r),n+=i.nodeSize}}findDiffStart(e,r=0){return YE(this,e,r)}findDiffEnd(e,r=this.size,n=e.size){return ZE(this,e,r,n)}findIndex(e,r=-1){if(e==0)return _l(0,e);if(e==this.size)return _l(this.content.length,e);if(e>this.size||e<0)throw new RangeError(`Position ${e} outside of fragment (${this})`);for(let n=0,i=0;;n++){let o=this.child(n),s=i+o.nodeSize;if(s>=e)return s==e||r>0?_l(n+1,s):_l(n,i);i=s}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map(e=>e.toJSON()):null}static fromJSON(e,r){if(!r)return he.empty;if(!Array.isArray(r))throw new RangeError("Invalid input for Fragment.fromJSON");return new he(r.map(e.nodeFromJSON))}static fromArray(e){if(!e.length)return he.empty;let r,n=0;for(let i=0;i<e.length;i++){let o=e[i];n+=o.nodeSize,i&&o.isText&&e[i-1].sameMarkup(o)?(r||(r=e.slice(0,i)),r[r.length-1]=o.withText(r[r.length-1].text+o.text)):r&&r.push(o)}return new he(r||e,n)}static from(e){if(!e)return he.empty;if(e instanceof he)return e;if(Array.isArray(e))return this.fromArray(e);if(e.attrs)return new he([e],e.nodeSize);throw new RangeError("Can not convert "+e+" to a Fragment"+(e.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}}he.empty=new he([],0);const kd={index:0,offset:0};function _l(t,e){return kd.index=t,kd.offset=e,kd}function Gc(t,e){if(t===e)return!0;if(!(t&&typeof t=="object")||!(e&&typeof e=="object"))return!1;let r=Array.isArray(t);if(Array.isArray(e)!=r)return!1;if(r){if(t.length!=e.length)return!1;for(let n=0;n<t.length;n++)if(!Gc(t[n],e[n]))return!1}else{for(let n in t)if(!(n in e)||!Gc(t[n],e[n]))return!1;for(let n in e)if(!(n in t))return!1}return!0}let We=class qp{constructor(e,r){this.type=e,this.attrs=r}addToSet(e){let r,n=!1;for(let i=0;i<e.length;i++){let o=e[i];if(this.eq(o))return e;if(this.type.excludes(o.type))r||(r=e.slice(0,i));else{if(o.type.excludes(this.type))return e;!n&&o.type.rank>this.type.rank&&(r||(r=e.slice(0,i)),r.push(this),n=!0),r&&r.push(o)}}return r||(r=e.slice()),n||r.push(this),r}removeFromSet(e){for(let r=0;r<e.length;r++)if(this.eq(e[r]))return e.slice(0,r).concat(e.slice(r+1));return e}isInSet(e){for(let r=0;r<e.length;r++)if(this.eq(e[r]))return!0;return!1}eq(e){return this==e||this.type==e.type&&Gc(this.attrs,e.attrs)}toJSON(){let e={type:this.type.name};for(let r in this.attrs){e.attrs=this.attrs;break}return e}static fromJSON(e,r){if(!r)throw new RangeError("Invalid input for Mark.fromJSON");let n=e.marks[r.type];if(!n)throw new RangeError(`There is no mark type ${r.type} in this schema`);let i=n.create(r.attrs);return n.checkAttrs(i.attrs),i}static sameSet(e,r){if(e==r)return!0;if(e.length!=r.length)return!1;for(let n=0;n<e.length;n++)if(!e[n].eq(r[n]))return!1;return!0}static setFrom(e){if(!e||Array.isArray(e)&&e.length==0)return qp.none;if(e instanceof qp)return[e];let r=e.slice();return r.sort((n,i)=>n.type.rank-i.type.rank),r}};We.none=[];class Kc extends Error{}class we{constructor(e,r,n){this.content=e,this.openStart=r,this.openEnd=n}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(e,r){let n=eT(this.content,e+this.openStart,r);return n&&new we(n,this.openStart,this.openEnd)}removeBetween(e,r){return new we(QE(this.content,e+this.openStart,r+this.openStart),this.openStart,this.openEnd)}eq(e){return this.content.eq(e.content)&&this.openStart==e.openStart&&this.openEnd==e.openEnd}toString(){return this.content+"("+this.openStart+","+this.openEnd+")"}toJSON(){if(!this.content.size)return null;let e={content:this.content.toJSON()};return this.openStart>0&&(e.openStart=this.openStart),this.openEnd>0&&(e.openEnd=this.openEnd),e}static fromJSON(e,r){if(!r)return we.empty;let n=r.openStart||0,i=r.openEnd||0;if(typeof n!="number"||typeof i!="number")throw new RangeError("Invalid input for Slice.fromJSON");return new we(he.fromJSON(e,r.content),n,i)}static maxOpen(e,r=!0){let n=0,i=0;for(let o=e.firstChild;o&&!o.isLeaf&&(r||!o.type.spec.isolating);o=o.firstChild)n++;for(let o=e.lastChild;o&&!o.isLeaf&&(r||!o.type.spec.isolating);o=o.lastChild)i++;return new we(e,n,i)}}we.empty=new we(he.empty,0,0);function QE(t,e,r){let{index:n,offset:i}=t.findIndex(e),o=t.maybeChild(n),{index:s,offset:a}=t.findIndex(r);if(i==e||o.isText){if(a!=r&&!t.child(s).isText)throw new RangeError("Removing non-flat range");return t.cut(0,e).append(t.cut(r))}if(n!=s)throw new RangeError("Removing non-flat range");return t.replaceChild(n,o.copy(QE(o.content,e-i-1,r-i-1)))}function eT(t,e,r,n){let{index:i,offset:o}=t.findIndex(e),s=t.maybeChild(i);if(o==e||s.isText)return t.cut(0,e).append(r).append(t.cut(e));let a=eT(s.content,e-o-1,r);return a&&t.replaceChild(i,s.copy(a))}function UI(t,e,r){if(r.openStart>t.depth)throw new Kc("Inserted content deeper than insertion position");if(t.depth-r.openStart!=e.depth-r.openEnd)throw new Kc("Inconsistent open depths");return tT(t,e,r,0)}function tT(t,e,r,n){let i=t.index(n),o=t.node(n);if(i==e.index(n)&&n<t.depth-r.openStart){let s=tT(t,e,r,n+1);return o.copy(o.content.replaceChild(i,s))}else if(r.content.size)if(!r.openStart&&!r.openEnd&&t.depth==n&&e.depth==n){let s=t.parent,a=s.content;return Wi(s,a.cut(0,t.parentOffset).append(r.content).append(a.cut(e.parentOffset)))}else{let{start:s,end:a}=WI(r,t);return Wi(o,nT(t,s,a,e,n))}else return Wi(o,qc(t,e,n))}function rT(t,e){if(!e.type.compatibleContent(t.type))throw new Kc("Cannot join "+e.type.name+" onto "+t.type.name)}function Xp(t,e,r){let n=t.node(r);return rT(n,e.node(r)),n}function Ui(t,e){let r=e.length-1;r>=0&&t.isText&&t.sameMarkup(e[r])?e[r]=t.withText(e[r].text+t.text):e.push(t)}function ua(t,e,r,n){let i=(e||t).node(r),o=0,s=e?e.index(r):i.childCount;t&&(o=t.index(r),t.depth>r?o++:t.textOffset&&(Ui(t.nodeAfter,n),o++));for(let a=o;a<s;a++)Ui(i.child(a),n);e&&e.depth==r&&e.textOffset&&Ui(e.nodeBefore,n)}function Wi(t,e){return t.type.checkContent(e),t.copy(e)}function nT(t,e,r,n,i){let o=t.depth>i&&Xp(t,e,i+1),s=n.depth>i&&Xp(r,n,i+1),a=[];return ua(null,t,i,a),o&&s&&e.index(i)==r.index(i)?(rT(o,s),Ui(Wi(o,nT(t,e,r,n,i+1)),a)):(o&&Ui(Wi(o,qc(t,e,i+1)),a),ua(e,r,i,a),s&&Ui(Wi(s,qc(r,n,i+1)),a)),ua(n,null,i,a),new he(a)}function qc(t,e,r){let n=[];if(ua(null,t,r,n),t.depth>r){let i=Xp(t,e,r+1);Ui(Wi(i,qc(t,e,r+1)),n)}return ua(e,null,r,n),new he(n)}function WI(t,e){let r=e.depth-t.openStart,i=e.node(r).copy(t.content);for(let o=r-1;o>=0;o--)i=e.node(o).copy(he.from(i));return{start:i.resolveNoCache(t.openStart+r),end:i.resolveNoCache(i.content.size-t.openEnd-r)}}class Oa{constructor(e,r,n){this.pos=e,this.path=r,this.parentOffset=n,this.depth=r.length/3-1}resolveDepth(e){return e==null?this.depth:e<0?this.depth+e:e}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(e){return this.path[this.resolveDepth(e)*3]}index(e){return this.path[this.resolveDepth(e)*3+1]}indexAfter(e){return e=this.resolveDepth(e),this.index(e)+(e==this.depth&&!this.textOffset?0:1)}start(e){return e=this.resolveDepth(e),e==0?0:this.path[e*3-1]+1}end(e){return e=this.resolveDepth(e),this.start(e)+this.node(e).content.size}before(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position before the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]}after(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position after the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]+this.path[e*3].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let e=this.parent,r=this.index(this.depth);if(r==e.childCount)return null;let n=this.pos-this.path[this.path.length-1],i=e.child(r);return n?e.child(r).cut(n):i}get nodeBefore(){let e=this.index(this.depth),r=this.pos-this.path[this.path.length-1];return r?this.parent.child(e).cut(0,r):e==0?null:this.parent.child(e-1)}posAtIndex(e,r){r=this.resolveDepth(r);let n=this.path[r*3],i=r==0?0:this.path[r*3-1]+1;for(let o=0;o<e;o++)i+=n.child(o).nodeSize;return i}marks(){let e=this.parent,r=this.index();if(e.content.size==0)return We.none;if(this.textOffset)return e.child(r).marks;let n=e.maybeChild(r-1),i=e.maybeChild(r);if(!n){let a=n;n=i,i=a}let o=n.marks;for(var s=0;s<o.length;s++)o[s].type.spec.inclusive===!1&&(!i||!o[s].isInSet(i.marks))&&(o=o[s--].removeFromSet(o));return o}marksAcross(e){let r=this.parent.maybeChild(this.index());if(!r||!r.isInline)return null;let n=r.marks,i=e.parent.maybeChild(e.index());for(var o=0;o<n.length;o++)n[o].type.spec.inclusive===!1&&(!i||!n[o].isInSet(i.marks))&&(n=n[o--].removeFromSet(n));return n}sharedDepth(e){for(let r=this.depth;r>0;r--)if(this.start(r)<=e&&this.end(r)>=e)return r;return 0}blockRange(e=this,r){if(e.pos<this.pos)return e.blockRange(this);for(let n=this.depth-(this.parent.inlineContent||this.pos==e.pos?1:0);n>=0;n--)if(e.pos<=this.end(n)&&(!r||r(this.node(n))))return new Ra(this,e,n);return null}sameParent(e){return this.pos-this.parentOffset==e.pos-e.parentOffset}max(e){return e.pos>this.pos?e:this}min(e){return e.pos<this.pos?e:this}toString(){let e="";for(let r=1;r<=this.depth;r++)e+=(e?"/":"")+this.node(r).type.name+"_"+this.index(r-1);return e+":"+this.parentOffset}static resolve(e,r){if(!(r>=0&&r<=e.content.size))throw new RangeError("Position "+r+" out of range");let n=[],i=0,o=r;for(let s=e;;){let{index:a,offset:l}=s.content.findIndex(o),c=o-l;if(n.push(s,a,i+l),!c||(s=s.child(a),s.isText))break;o=c-1,i+=l+1}return new Oa(r,n,o)}static resolveCached(e,r){let n=Aw.get(e);if(n)for(let o=0;o<n.elts.length;o++){let s=n.elts[o];if(s.pos==r)return s}else Aw.set(e,n=new VI);let i=n.elts[n.i]=Oa.resolve(e,r);return n.i=(n.i+1)%GI,i}}class VI{constructor(){this.elts=[],this.i=0}}const GI=12,Aw=new WeakMap;class Ra{constructor(e,r,n){this.$from=e,this.$to=r,this.depth=n}get start(){return this.$from.before(this.depth+1)}get end(){return this.$to.after(this.depth+1)}get parent(){return this.$from.node(this.depth)}get startIndex(){return this.$from.index(this.depth)}get endIndex(){return this.$to.indexAfter(this.depth)}}const KI=Object.create(null);let si=class Jp{constructor(e,r,n,i=We.none){this.type=e,this.attrs=r,this.marks=i,this.content=n||he.empty}get nodeSize(){return this.isLeaf?1:2+this.content.size}get childCount(){return this.content.childCount}child(e){return this.content.child(e)}maybeChild(e){return this.content.maybeChild(e)}forEach(e){this.content.forEach(e)}nodesBetween(e,r,n,i=0){this.content.nodesBetween(e,r,n,i,this)}descendants(e){this.nodesBetween(0,this.content.size,e)}get textContent(){return this.isLeaf&&this.type.spec.leafText?this.type.spec.leafText(this):this.textBetween(0,this.content.size,"")}textBetween(e,r,n,i){return this.content.textBetween(e,r,n,i)}get firstChild(){return this.content.firstChild}get lastChild(){return this.content.lastChild}eq(e){return this==e||this.sameMarkup(e)&&this.content.eq(e.content)}sameMarkup(e){return this.hasMarkup(e.type,e.attrs,e.marks)}hasMarkup(e,r,n){return this.type==e&&Gc(this.attrs,r||e.defaultAttrs||KI)&&We.sameSet(this.marks,n||We.none)}copy(e=null){return e==this.content?this:new Jp(this.type,this.attrs,e,this.marks)}mark(e){return e==this.marks?this:new Jp(this.type,this.attrs,this.content,e)}cut(e,r=this.content.size){return e==0&&r==this.content.size?this:this.copy(this.content.cut(e,r))}slice(e,r=this.content.size,n=!1){if(e==r)return we.empty;let i=this.resolve(e),o=this.resolve(r),s=n?0:i.sharedDepth(r),a=i.start(s),c=i.node(s).content.cut(i.pos-a,o.pos-a);return new we(c,i.depth-s,o.depth-s)}replace(e,r,n){return UI(this.resolve(e),this.resolve(r),n)}nodeAt(e){for(let r=this;;){let{index:n,offset:i}=r.content.findIndex(e);if(r=r.maybeChild(n),!r)return null;if(i==e||r.isText)return r;e-=i+1}}childAfter(e){let{index:r,offset:n}=this.content.findIndex(e);return{node:this.content.maybeChild(r),index:r,offset:n}}childBefore(e){if(e==0)return{node:null,index:0,offset:0};let{index:r,offset:n}=this.content.findIndex(e);if(n<e)return{node:this.content.child(r),index:r,offset:n};let i=this.content.child(r-1);return{node:i,index:r-1,offset:n-i.nodeSize}}resolve(e){return Oa.resolveCached(this,e)}resolveNoCache(e){return Oa.resolve(this,e)}rangeHasMark(e,r,n){let i=!1;return r>e&&this.nodesBetween(e,r,o=>(n.isInSet(o.marks)&&(i=!0),!i)),i}get isBlock(){return this.type.isBlock}get isTextblock(){return this.type.isTextblock}get inlineContent(){return this.type.inlineContent}get isInline(){return this.type.isInline}get isText(){return this.type.isText}get isLeaf(){return this.type.isLeaf}get isAtom(){return this.type.isAtom}toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);let e=this.type.name;return this.content.size&&(e+="("+this.content.toStringInner()+")"),iT(this.marks,e)}contentMatchAt(e){let r=this.type.contentMatch.matchFragment(this.content,0,e);if(!r)throw new Error("Called contentMatchAt on a node with invalid content");return r}canReplace(e,r,n=he.empty,i=0,o=n.childCount){let s=this.contentMatchAt(e).matchFragment(n,i,o),a=s&&s.matchFragment(this.content,r);if(!a||!a.validEnd)return!1;for(let l=i;l<o;l++)if(!this.type.allowsMarks(n.child(l).marks))return!1;return!0}canReplaceWith(e,r,n,i){if(i&&!this.type.allowsMarks(i))return!1;let o=this.contentMatchAt(e).matchType(n),s=o&&o.matchFragment(this.content,r);return s?s.validEnd:!1}canAppend(e){return e.content.size?this.canReplace(this.childCount,this.childCount,e.content):this.type.compatibleContent(e.type)}check(){this.type.checkContent(this.content),this.type.checkAttrs(this.attrs);let e=We.none;for(let r=0;r<this.marks.length;r++){let n=this.marks[r];n.type.checkAttrs(n.attrs),e=n.addToSet(e)}if(!We.sameSet(e,this.marks))throw new RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map(r=>r.type.name)}`);this.content.forEach(r=>r.check())}toJSON(){let e={type:this.type.name};for(let r in this.attrs){e.attrs=this.attrs;break}return this.content.size&&(e.content=this.content.toJSON()),this.marks.length&&(e.marks=this.marks.map(r=>r.toJSON())),e}static fromJSON(e,r){if(!r)throw new RangeError("Invalid input for Node.fromJSON");let n;if(r.marks){if(!Array.isArray(r.marks))throw new RangeError("Invalid mark data for Node.fromJSON");n=r.marks.map(e.markFromJSON)}if(r.type=="text"){if(typeof r.text!="string")throw new RangeError("Invalid text node in JSON");return e.text(r.text,n)}let i=he.fromJSON(e,r.content),o=e.nodeType(r.type).create(r.attrs,i,n);return o.type.checkAttrs(o.attrs),o}};si.prototype.text=void 0;class Xc extends si{constructor(e,r,n,i){if(super(e,r,null,i),!n)throw new RangeError("Empty text nodes are not allowed");this.text=n}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):iT(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(e,r){return this.text.slice(e,r)}get nodeSize(){return this.text.length}mark(e){return e==this.marks?this:new Xc(this.type,this.attrs,this.text,e)}withText(e){return e==this.text?this:new Xc(this.type,this.attrs,e,this.marks)}cut(e=0,r=this.text.length){return e==0&&r==this.text.length?this:this.withText(this.text.slice(e,r))}eq(e){return this.sameMarkup(e)&&this.text==e.text}toJSON(){let e=super.toJSON();return e.text=this.text,e}}function iT(t,e){for(let r=t.length-1;r>=0;r--)e=t[r].type.name+"("+e+")";return e}class Zi{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(e,r){let n=new qI(e,r);if(n.next==null)return Zi.empty;let i=oT(n);n.next&&n.err("Unexpected trailing text");let o=tN(eN(i));return rN(o,n),o}matchType(e){for(let r=0;r<this.next.length;r++)if(this.next[r].type==e)return this.next[r].next;return null}matchFragment(e,r=0,n=e.childCount){let i=this;for(let o=r;i&&o<n;o++)i=i.matchType(e.child(o).type);return i}get inlineContent(){return this.next.length!=0&&this.next[0].type.isInline}get defaultType(){for(let e=0;e<this.next.length;e++){let{type:r}=this.next[e];if(!(r.isText||r.hasRequiredAttrs()))return r}return null}compatible(e){for(let r=0;r<this.next.length;r++)for(let n=0;n<e.next.length;n++)if(this.next[r].type==e.next[n].type)return!0;return!1}fillBefore(e,r=!1,n=0){let i=[this];function o(s,a){let l=s.matchFragment(e,n);if(l&&(!r||l.validEnd))return he.from(a.map(c=>c.createAndFill()));for(let c=0;c<s.next.length;c++){let{type:u,next:f}=s.next[c];if(!(u.isText||u.hasRequiredAttrs())&&i.indexOf(f)==-1){i.push(f);let d=o(f,a.concat(u));if(d)return d}}return null}return o(this,[])}findWrapping(e){for(let n=0;n<this.wrapCache.length;n+=2)if(this.wrapCache[n]==e)return this.wrapCache[n+1];let r=this.computeWrapping(e);return this.wrapCache.push(e,r),r}computeWrapping(e){let r=Object.create(null),n=[{match:this,type:null,via:null}];for(;n.length;){let i=n.shift(),o=i.match;if(o.matchType(e)){let s=[];for(let a=i;a.type;a=a.via)s.push(a.type);return s.reverse()}for(let s=0;s<o.next.length;s++){let{type:a,next:l}=o.next[s];!a.isLeaf&&!a.hasRequiredAttrs()&&!(a.name in r)&&(!i.type||l.validEnd)&&(n.push({match:a.contentMatch,type:a,via:i}),r[a.name]=!0)}}return null}get edgeCount(){return this.next.length}edge(e){if(e>=this.next.length)throw new RangeError(`There's no ${e}th edge in this content match`);return this.next[e]}toString(){let e=[];function r(n){e.push(n);for(let i=0;i<n.next.length;i++)e.indexOf(n.next[i].next)==-1&&r(n.next[i].next)}return r(this),e.map((n,i)=>{let o=i+(n.validEnd?"*":" ")+" ";for(let s=0;s<n.next.length;s++)o+=(s?", ":"")+n.next[s].type.name+"->"+e.indexOf(n.next[s].next);return o}).join(`
2
- `)}}Zi.empty=new Zi(!0);class qI{constructor(e,r){this.string=e,this.nodeTypes=r,this.inline=null,this.pos=0,this.tokens=e.split(/\s*(?=\b|\W|$)/),this.tokens[this.tokens.length-1]==""&&this.tokens.pop(),this.tokens[0]==""&&this.tokens.shift()}get next(){return this.tokens[this.pos]}eat(e){return this.next==e&&(this.pos++||!0)}err(e){throw new SyntaxError(e+" (in content expression '"+this.string+"')")}}function oT(t){let e=[];do e.push(XI(t));while(t.eat("|"));return e.length==1?e[0]:{type:"choice",exprs:e}}function XI(t){let e=[];do e.push(JI(t));while(t.next&&t.next!=")"&&t.next!="|");return e.length==1?e[0]:{type:"seq",exprs:e}}function JI(t){let e=QI(t);for(;;)if(t.eat("+"))e={type:"plus",expr:e};else if(t.eat("*"))e={type:"star",expr:e};else if(t.eat("?"))e={type:"opt",expr:e};else if(t.eat("{"))e=YI(t,e);else break;return e}function Cw(t){/\D/.test(t.next)&&t.err("Expected number, got '"+t.next+"'");let e=Number(t.next);return t.pos++,e}function YI(t,e){let r=Cw(t),n=r;return t.eat(",")&&(t.next!="}"?n=Cw(t):n=-1),t.eat("}")||t.err("Unclosed braced range"),{type:"range",min:r,max:n,expr:e}}function ZI(t,e){let r=t.nodeTypes,n=r[e];if(n)return[n];let i=[];for(let o in r){let s=r[o];s.groups.indexOf(e)>-1&&i.push(s)}return i.length==0&&t.err("No node type or group '"+e+"' found"),i}function QI(t){if(t.eat("(")){let e=oT(t);return t.eat(")")||t.err("Missing closing paren"),e}else if(/\W/.test(t.next))t.err("Unexpected token '"+t.next+"'");else{let e=ZI(t,t.next).map(r=>(t.inline==null?t.inline=r.isInline:t.inline!=r.isInline&&t.err("Mixing inline and block content"),{type:"name",value:r}));return t.pos++,e.length==1?e[0]:{type:"choice",exprs:e}}}function eN(t){let e=[[]];return i(o(t,0),r()),e;function r(){return e.push([])-1}function n(s,a,l){let c={term:l,to:a};return e[s].push(c),c}function i(s,a){s.forEach(l=>l.to=a)}function o(s,a){if(s.type=="choice")return s.exprs.reduce((l,c)=>l.concat(o(c,a)),[]);if(s.type=="seq")for(let l=0;;l++){let c=o(s.exprs[l],a);if(l==s.exprs.length-1)return c;i(c,a=r())}else if(s.type=="star"){let l=r();return n(a,l),i(o(s.expr,l),l),[n(l)]}else if(s.type=="plus"){let l=r();return i(o(s.expr,a),l),i(o(s.expr,l),l),[n(l)]}else{if(s.type=="opt")return[n(a)].concat(o(s.expr,a));if(s.type=="range"){let l=a;for(let c=0;c<s.min;c++){let u=r();i(o(s.expr,l),u),l=u}if(s.max==-1)i(o(s.expr,l),l);else for(let c=s.min;c<s.max;c++){let u=r();n(l,u),i(o(s.expr,l),u),l=u}return[n(l)]}else{if(s.type=="name")return[n(a,void 0,s.value)];throw new Error("Unknown expr type")}}}}function sT(t,e){return e-t}function kw(t,e){let r=[];return n(e),r.sort(sT);function n(i){let o=t[i];if(o.length==1&&!o[0].term)return n(o[0].to);r.push(i);for(let s=0;s<o.length;s++){let{term:a,to:l}=o[s];!a&&r.indexOf(l)==-1&&n(l)}}}function tN(t){let e=Object.create(null);return r(kw(t,0));function r(n){let i=[];n.forEach(s=>{t[s].forEach(({term:a,to:l})=>{if(!a)return;let c;for(let u=0;u<i.length;u++)i[u][0]==a&&(c=i[u][1]);kw(t,l).forEach(u=>{c||i.push([a,c=[]]),c.indexOf(u)==-1&&c.push(u)})})});let o=e[n.join(",")]=new Zi(n.indexOf(t.length-1)>-1);for(let s=0;s<i.length;s++){let a=i[s][1].sort(sT);o.next.push({type:i[s][0],next:e[a.join(",")]||r(a)})}return o}}function rN(t,e){for(let r=0,n=[t];r<n.length;r++){let i=n[r],o=!i.validEnd,s=[];for(let a=0;a<i.next.length;a++){let{type:l,next:c}=i.next[a];s.push(l.name),o&&!(l.isText||l.hasRequiredAttrs())&&(o=!1),n.indexOf(c)==-1&&n.push(c)}o&&e.err("Only non-generatable nodes ("+s.join(", ")+") in a required position (see https://prosemirror.net/docs/guide/#generatable)")}}function aT(t){let e=Object.create(null);for(let r in t){let n=t[r];if(!n.hasDefault)return null;e[r]=n.default}return e}function lT(t,e){let r=Object.create(null);for(let n in t){let i=e&&e[n];if(i===void 0){let o=t[n];if(o.hasDefault)i=o.default;else throw new RangeError("No value supplied for attribute "+n)}r[n]=i}return r}function cT(t,e,r,n){for(let i in e)if(!(i in t))throw new RangeError(`Unsupported attribute ${i} for ${r} of type ${i}`);for(let i in t){let o=t[i];o.validate&&o.validate(e[i])}}function uT(t,e){let r=Object.create(null);if(e)for(let n in e)r[n]=new iN(t,n,e[n]);return r}let _w=class fT{constructor(e,r,n){this.name=e,this.schema=r,this.spec=n,this.markSet=null,this.groups=n.group?n.group.split(" "):[],this.attrs=uT(e,n.attrs),this.defaultAttrs=aT(this.attrs),this.contentMatch=null,this.inlineContent=null,this.isBlock=!(n.inline||e=="text"),this.isText=e=="text"}get isInline(){return!this.isBlock}get isTextblock(){return this.isBlock&&this.inlineContent}get isLeaf(){return this.contentMatch==Zi.empty}get isAtom(){return this.isLeaf||!!this.spec.atom}get whitespace(){return this.spec.whitespace||(this.spec.code?"pre":"normal")}hasRequiredAttrs(){for(let e in this.attrs)if(this.attrs[e].isRequired)return!0;return!1}compatibleContent(e){return this==e||this.contentMatch.compatible(e.contentMatch)}computeAttrs(e){return!e&&this.defaultAttrs?this.defaultAttrs:lT(this.attrs,e)}create(e=null,r,n){if(this.isText)throw new Error("NodeType.create can't construct text nodes");return new si(this,this.computeAttrs(e),he.from(r),We.setFrom(n))}createChecked(e=null,r,n){return r=he.from(r),this.checkContent(r),new si(this,this.computeAttrs(e),r,We.setFrom(n))}createAndFill(e=null,r,n){if(e=this.computeAttrs(e),r=he.from(r),r.size){let s=this.contentMatch.fillBefore(r);if(!s)return null;r=s.append(r)}let i=this.contentMatch.matchFragment(r),o=i&&i.fillBefore(he.empty,!0);return o?new si(this,e,r.append(o),We.setFrom(n)):null}validContent(e){let r=this.contentMatch.matchFragment(e);if(!r||!r.validEnd)return!1;for(let n=0;n<e.childCount;n++)if(!this.allowsMarks(e.child(n).marks))return!1;return!0}checkContent(e){if(!this.validContent(e))throw new RangeError(`Invalid content for node ${this.name}: ${e.toString().slice(0,50)}`)}checkAttrs(e){cT(this.attrs,e,"node",this.name)}allowsMarkType(e){return this.markSet==null||this.markSet.indexOf(e)>-1}allowsMarks(e){if(this.markSet==null)return!0;for(let r=0;r<e.length;r++)if(!this.allowsMarkType(e[r].type))return!1;return!0}allowedMarks(e){if(this.markSet==null)return e;let r;for(let n=0;n<e.length;n++)this.allowsMarkType(e[n].type)?r&&r.push(e[n]):r||(r=e.slice(0,n));return r?r.length?r:We.none:e}static compile(e,r){let n=Object.create(null);e.forEach((o,s)=>n[o]=new fT(o,r,s));let i=r.spec.topNode||"doc";if(!n[i])throw new RangeError("Schema is missing its top node type ('"+i+"')");if(!n.text)throw new RangeError("Every schema needs a 'text' type");for(let o in n.text.attrs)throw new RangeError("The text node type should not have attributes");return n}};function nN(t,e,r){let n=r.split("|");return i=>{let o=i===null?"null":typeof i;if(n.indexOf(o)<0)throw new RangeError(`Expected value of type ${n} for attribute ${e} on type ${t}, got ${o}`)}}class iN{constructor(e,r,n){this.hasDefault=Object.prototype.hasOwnProperty.call(n,"default"),this.default=n.default,this.validate=typeof n.validate=="string"?nN(e,r,n.validate):n.validate}get isRequired(){return!this.hasDefault}}class bf{constructor(e,r,n,i){this.name=e,this.rank=r,this.schema=n,this.spec=i,this.attrs=uT(e,i.attrs),this.excluded=null;let o=aT(this.attrs);this.instance=o?new We(this,o):null}create(e=null){return!e&&this.instance?this.instance:new We(this,lT(this.attrs,e))}static compile(e,r){let n=Object.create(null),i=0;return e.forEach((o,s)=>n[o]=new bf(o,i++,r,s)),n}removeFromSet(e){for(var r=0;r<e.length;r++)e[r].type==this&&(e=e.slice(0,r).concat(e.slice(r+1)),r--);return e}isInSet(e){for(let r=0;r<e.length;r++)if(e[r].type==this)return e[r]}checkAttrs(e){cT(this.attrs,e,"mark",this.name)}excludes(e){return this.excluded.indexOf(e)>-1}}class dT{constructor(e){this.linebreakReplacement=null,this.cached=Object.create(null);let r=this.spec={};for(let i in e)r[i]=e[i];r.nodes=Et.from(e.nodes),r.marks=Et.from(e.marks||{}),this.nodes=_w.compile(this.spec.nodes,this),this.marks=bf.compile(this.spec.marks,this);let n=Object.create(null);for(let i in this.nodes){if(i in this.marks)throw new RangeError(i+" can not be both a node and a mark");let o=this.nodes[i],s=o.spec.content||"",a=o.spec.marks;if(o.contentMatch=n[s]||(n[s]=Zi.parse(s,this.nodes)),o.inlineContent=o.contentMatch.inlineContent,o.spec.linebreakReplacement){if(this.linebreakReplacement)throw new RangeError("Multiple linebreak nodes defined");if(!o.isInline||!o.isLeaf)throw new RangeError("Linebreak replacement nodes must be inline leaf nodes");this.linebreakReplacement=o}o.markSet=a=="_"?null:a?Ow(this,a.split(" ")):a==""||!o.inlineContent?[]:null}for(let i in this.marks){let o=this.marks[i],s=o.spec.excludes;o.excluded=s==null?[o]:s==""?[]:Ow(this,s.split(" "))}this.nodeFromJSON=this.nodeFromJSON.bind(this),this.markFromJSON=this.markFromJSON.bind(this),this.topNodeType=this.nodes[this.spec.topNode||"doc"],this.cached.wrappings=Object.create(null)}node(e,r=null,n,i){if(typeof e=="string")e=this.nodeType(e);else if(e instanceof _w){if(e.schema!=this)throw new RangeError("Node type from different schema used ("+e.name+")")}else throw new RangeError("Invalid node type: "+e);return e.createChecked(r,n,i)}text(e,r){let n=this.nodes.text;return new Xc(n,n.defaultAttrs,e,We.setFrom(r))}mark(e,r){return typeof e=="string"&&(e=this.marks[e]),e.create(r)}nodeFromJSON(e){return si.fromJSON(this,e)}markFromJSON(e){return We.fromJSON(this,e)}nodeType(e){let r=this.nodes[e];if(!r)throw new RangeError("Unknown node type: "+e);return r}}function Ow(t,e){let r=[];for(let n=0;n<e.length;n++){let i=e[n],o=t.marks[i],s=o;if(o)r.push(o);else for(let a in t.marks){let l=t.marks[a];(i=="_"||l.spec.group&&l.spec.group.split(" ").indexOf(i)>-1)&&r.push(s=l)}if(!s)throw new SyntaxError("Unknown mark type: '"+e[n]+"'")}return r}function oN(t){return t.tag!=null}function sN(t){return t.style!=null}let fa=class Yp{constructor(e,r){this.schema=e,this.rules=r,this.tags=[],this.styles=[];let n=this.matchedStyles=[];r.forEach(i=>{if(oN(i))this.tags.push(i);else if(sN(i)){let o=/[^=]*/.exec(i.style)[0];n.indexOf(o)<0&&n.push(o),this.styles.push(i)}}),this.normalizeLists=!this.tags.some(i=>{if(!/^(ul|ol)\b/.test(i.tag)||!i.node)return!1;let o=e.nodes[i.node];return o.contentMatch.matchType(o)})}parse(e,r={}){let n=new Mw(this,r,!1);return n.addAll(e,r.from,r.to),n.finish()}parseSlice(e,r={}){let n=new Mw(this,r,!0);return n.addAll(e,r.from,r.to),we.maxOpen(n.finish())}matchTag(e,r,n){for(let i=n?this.tags.indexOf(n)+1:0;i<this.tags.length;i++){let o=this.tags[i];if(cN(e,o.tag)&&(o.namespace===void 0||e.namespaceURI==o.namespace)&&(!o.context||r.matchesContext(o.context))){if(o.getAttrs){let s=o.getAttrs(e);if(s===!1)continue;o.attrs=s||void 0}return o}}}matchStyle(e,r,n,i){for(let o=i?this.styles.indexOf(i)+1:0;o<this.styles.length;o++){let s=this.styles[o],a=s.style;if(!(a.indexOf(e)!=0||s.context&&!n.matchesContext(s.context)||a.length>e.length&&(a.charCodeAt(e.length)!=61||a.slice(e.length+1)!=r))){if(s.getAttrs){let l=s.getAttrs(r);if(l===!1)continue;s.attrs=l||void 0}return s}}}static schemaRules(e){let r=[];function n(i){let o=i.priority==null?50:i.priority,s=0;for(;s<r.length;s++){let a=r[s];if((a.priority==null?50:a.priority)<o)break}r.splice(s,0,i)}for(let i in e.marks){let o=e.marks[i].spec.parseDOM;o&&o.forEach(s=>{n(s=Iw(s)),s.mark||s.ignore||s.clearMark||(s.mark=i)})}for(let i in e.nodes){let o=e.nodes[i].spec.parseDOM;o&&o.forEach(s=>{n(s=Iw(s)),s.node||s.ignore||s.mark||(s.node=i)})}return r}static fromSchema(e){return e.cached.domParser||(e.cached.domParser=new Yp(e,Yp.schemaRules(e)))}};const hT={address:!0,article:!0,aside:!0,blockquote:!0,canvas:!0,dd:!0,div:!0,dl:!0,fieldset:!0,figcaption:!0,figure:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,li:!0,noscript:!0,ol:!0,output:!0,p:!0,pre:!0,section:!0,table:!0,tfoot:!0,ul:!0},aN={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},pT={ol:!0,ul:!0},Jc=1,Yc=2,da=4;function Rw(t,e,r){return e!=null?(e?Jc:0)|(e==="full"?Yc:0):t&&t.whitespace=="pre"?Jc|Yc:r&~da}class Ol{constructor(e,r,n,i,o,s,a){this.type=e,this.attrs=r,this.marks=n,this.pendingMarks=i,this.solid=o,this.options=a,this.content=[],this.activeMarks=We.none,this.stashMarks=[],this.match=s||(a&da?null:e.contentMatch)}findWrapping(e){if(!this.match){if(!this.type)return[];let r=this.type.contentMatch.fillBefore(he.from(e));if(r)this.match=this.type.contentMatch.matchFragment(r);else{let n=this.type.contentMatch,i;return(i=n.findWrapping(e.type))?(this.match=n,i):null}}return this.match.findWrapping(e.type)}finish(e){if(!(this.options&Jc)){let n=this.content[this.content.length-1],i;if(n&&n.isText&&(i=/[ \t\r\n\u000c]+$/.exec(n.text))){let o=n;n.text.length==i[0].length?this.content.pop():this.content[this.content.length-1]=o.withText(o.text.slice(0,o.text.length-i[0].length))}}let r=he.from(this.content);return!e&&this.match&&(r=r.append(this.match.fillBefore(he.empty,!0))),this.type?this.type.create(this.attrs,r,this.marks):r}popFromStashMark(e){for(let r=this.stashMarks.length-1;r>=0;r--)if(e.eq(this.stashMarks[r]))return this.stashMarks.splice(r,1)[0]}applyPending(e){for(let r=0,n=this.pendingMarks;r<n.length;r++){let i=n[r];(this.type?this.type.allowsMarkType(i.type):uN(i.type,e))&&!i.isInSet(this.activeMarks)&&(this.activeMarks=i.addToSet(this.activeMarks),this.pendingMarks=i.removeFromSet(this.pendingMarks))}}inlineContext(e){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:e.parentNode&&!hT.hasOwnProperty(e.parentNode.nodeName.toLowerCase())}}class Mw{constructor(e,r,n){this.parser=e,this.options=r,this.isOpen=n,this.open=0;let i=r.topNode,o,s=Rw(null,r.preserveWhitespace,0)|(n?da:0);i?o=new Ol(i.type,i.attrs,We.none,We.none,!0,r.topMatch||i.type.contentMatch,s):n?o=new Ol(null,null,We.none,We.none,!0,null,s):o=new Ol(e.schema.topNodeType,null,We.none,We.none,!0,null,s),this.nodes=[o],this.find=r.findPositions,this.needsBlock=!1}get top(){return this.nodes[this.open]}addDOM(e){e.nodeType==3?this.addTextNode(e):e.nodeType==1&&this.addElement(e)}withStyleRules(e,r){let n=e.style;if(!n||!n.length)return r();let i=this.readStyles(e.style);if(!i)return;let[o,s]=i,a=this.top;for(let l=0;l<s.length;l++)this.removePendingMark(s[l],a);for(let l=0;l<o.length;l++)this.addPendingMark(o[l]);r();for(let l=0;l<o.length;l++)this.removePendingMark(o[l],a);for(let l=0;l<s.length;l++)this.addPendingMark(s[l])}addTextNode(e){let r=e.nodeValue,n=this.top;if(n.options&Yc||n.inlineContext(e)||/[^ \t\r\n\u000c]/.test(r)){if(n.options&Jc)n.options&Yc?r=r.replace(/\r\n?/g,`
3
- `):r=r.replace(/\r?\n|\r/g," ");else if(r=r.replace(/[ \t\r\n\u000c]+/g," "),/^[ \t\r\n\u000c]/.test(r)&&this.open==this.nodes.length-1){let i=n.content[n.content.length-1],o=e.previousSibling;(!i||o&&o.nodeName=="BR"||i.isText&&/[ \t\r\n\u000c]$/.test(i.text))&&(r=r.slice(1))}r&&this.insertNode(this.parser.schema.text(r)),this.findInText(e)}else this.findInside(e)}addElement(e,r){let n=e.nodeName.toLowerCase(),i;pT.hasOwnProperty(n)&&this.parser.normalizeLists&&lN(e);let o=this.options.ruleFromNode&&this.options.ruleFromNode(e)||(i=this.parser.matchTag(e,this,r));if(o?o.ignore:aN.hasOwnProperty(n))this.findInside(e),this.ignoreFallback(e);else if(!o||o.skip||o.closeParent){o&&o.closeParent?this.open=Math.max(0,this.open-1):o&&o.skip.nodeType&&(e=o.skip);let s,a=this.top,l=this.needsBlock;if(hT.hasOwnProperty(n))a.content.length&&a.content[0].isInline&&this.open&&(this.open--,a=this.top),s=!0,a.type||(this.needsBlock=!0);else if(!e.firstChild){this.leafFallback(e);return}o&&o.skip?this.addAll(e):this.withStyleRules(e,()=>this.addAll(e)),s&&this.sync(a),this.needsBlock=l}else this.withStyleRules(e,()=>{this.addElementByRule(e,o,o.consuming===!1?i:void 0)})}leafFallback(e){e.nodeName=="BR"&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(e.ownerDocument.createTextNode(`
4
- `))}ignoreFallback(e){e.nodeName=="BR"&&(!this.top.type||!this.top.type.inlineContent)&&this.findPlace(this.parser.schema.text("-"))}readStyles(e){let r=We.none,n=We.none;if(e.length)for(let i=0;i<this.parser.matchedStyles.length;i++){let o=this.parser.matchedStyles[i],s=e.getPropertyValue(o);if(s)for(let a=void 0;;){let l=this.parser.matchStyle(o,s,this,a);if(!l)break;if(l.ignore)return null;if(l.clearMark?this.top.pendingMarks.concat(this.top.activeMarks).forEach(c=>{l.clearMark(c)&&(n=c.addToSet(n))}):r=this.parser.schema.marks[l.mark].create(l.attrs).addToSet(r),l.consuming===!1)a=l;else break}}return[r,n]}addElementByRule(e,r,n){let i,o,s;r.node?(o=this.parser.schema.nodes[r.node],o.isLeaf?this.insertNode(o.create(r.attrs))||this.leafFallback(e):i=this.enter(o,r.attrs||null,r.preserveWhitespace)):(s=this.parser.schema.marks[r.mark].create(r.attrs),this.addPendingMark(s));let a=this.top;if(o&&o.isLeaf)this.findInside(e);else if(n)this.addElement(e,n);else if(r.getContent)this.findInside(e),r.getContent(e,this.parser.schema).forEach(l=>this.insertNode(l));else{let l=e;typeof r.contentElement=="string"?l=e.querySelector(r.contentElement):typeof r.contentElement=="function"?l=r.contentElement(e):r.contentElement&&(l=r.contentElement),this.findAround(e,l,!0),this.addAll(l)}i&&this.sync(a)&&this.open--,s&&this.removePendingMark(s,a)}addAll(e,r,n){let i=r||0;for(let o=r?e.childNodes[r]:e.firstChild,s=n==null?null:e.childNodes[n];o!=s;o=o.nextSibling,++i)this.findAtPoint(e,i),this.addDOM(o);this.findAtPoint(e,i)}findPlace(e){let r,n;for(let i=this.open;i>=0;i--){let o=this.nodes[i],s=o.findWrapping(e);if(s&&(!r||r.length>s.length)&&(r=s,n=o,!s.length)||o.solid)break}if(!r)return!1;this.sync(n);for(let i=0;i<r.length;i++)this.enterInner(r[i],null,!1);return!0}insertNode(e){if(e.isInline&&this.needsBlock&&!this.top.type){let r=this.textblockFromContext();r&&this.enterInner(r)}if(this.findPlace(e)){this.closeExtra();let r=this.top;r.applyPending(e.type),r.match&&(r.match=r.match.matchType(e.type));let n=r.activeMarks;for(let i=0;i<e.marks.length;i++)(!r.type||r.type.allowsMarkType(e.marks[i].type))&&(n=e.marks[i].addToSet(n));return r.content.push(e.mark(n)),!0}return!1}enter(e,r,n){let i=this.findPlace(e.create(r));return i&&this.enterInner(e,r,!0,n),i}enterInner(e,r=null,n=!1,i){this.closeExtra();let o=this.top;o.applyPending(e),o.match=o.match&&o.match.matchType(e);let s=Rw(e,i,o.options);o.options&da&&o.content.length==0&&(s|=da),this.nodes.push(new Ol(e,r,o.activeMarks,o.pendingMarks,n,null,s)),this.open++}closeExtra(e=!1){let r=this.nodes.length-1;if(r>this.open){for(;r>this.open;r--)this.nodes[r-1].content.push(this.nodes[r].finish(e));this.nodes.length=this.open+1}}finish(){return this.open=0,this.closeExtra(this.isOpen),this.nodes[0].finish(this.isOpen||this.options.topOpen)}sync(e){for(let r=this.open;r>=0;r--)if(this.nodes[r]==e)return this.open=r,!0;return!1}get currentPos(){this.closeExtra();let e=0;for(let r=this.open;r>=0;r--){let n=this.nodes[r].content;for(let i=n.length-1;i>=0;i--)e+=n[i].nodeSize;r&&e++}return e}findAtPoint(e,r){if(this.find)for(let n=0;n<this.find.length;n++)this.find[n].node==e&&this.find[n].offset==r&&(this.find[n].pos=this.currentPos)}findInside(e){if(this.find)for(let r=0;r<this.find.length;r++)this.find[r].pos==null&&e.nodeType==1&&e.contains(this.find[r].node)&&(this.find[r].pos=this.currentPos)}findAround(e,r,n){if(e!=r&&this.find)for(let i=0;i<this.find.length;i++)this.find[i].pos==null&&e.nodeType==1&&e.contains(this.find[i].node)&&r.compareDocumentPosition(this.find[i].node)&(n?2:4)&&(this.find[i].pos=this.currentPos)}findInText(e){if(this.find)for(let r=0;r<this.find.length;r++)this.find[r].node==e&&(this.find[r].pos=this.currentPos-(e.nodeValue.length-this.find[r].offset))}matchesContext(e){if(e.indexOf("|")>-1)return e.split(/\s*\|\s*/).some(this.matchesContext,this);let r=e.split("/"),n=this.options.context,i=!this.isOpen&&(!n||n.parent.type==this.nodes[0].type),o=-(n?n.depth+1:0)+(i?0:1),s=(a,l)=>{for(;a>=0;a--){let c=r[a];if(c==""){if(a==r.length-1||a==0)continue;for(;l>=o;l--)if(s(a-1,l))return!0;return!1}else{let u=l>0||l==0&&i?this.nodes[l].type:n&&l>=o?n.node(l-o).type:null;if(!u||u.name!=c&&u.groups.indexOf(c)==-1)return!1;l--}}return!0};return s(r.length-1,this.open)}textblockFromContext(){let e=this.options.context;if(e)for(let r=e.depth;r>=0;r--){let n=e.node(r).contentMatchAt(e.indexAfter(r)).defaultType;if(n&&n.isTextblock&&n.defaultAttrs)return n}for(let r in this.parser.schema.nodes){let n=this.parser.schema.nodes[r];if(n.isTextblock&&n.defaultAttrs)return n}}addPendingMark(e){let r=fN(e,this.top.pendingMarks);r&&this.top.stashMarks.push(r),this.top.pendingMarks=e.addToSet(this.top.pendingMarks)}removePendingMark(e,r){for(let n=this.open;n>=0;n--){let i=this.nodes[n];if(i.pendingMarks.lastIndexOf(e)>-1)i.pendingMarks=e.removeFromSet(i.pendingMarks);else{i.activeMarks=e.removeFromSet(i.activeMarks);let s=i.popFromStashMark(e);s&&i.type&&i.type.allowsMarkType(s.type)&&(i.activeMarks=s.addToSet(i.activeMarks))}if(i==r)break}}}function lN(t){for(let e=t.firstChild,r=null;e;e=e.nextSibling){let n=e.nodeType==1?e.nodeName.toLowerCase():null;n&&pT.hasOwnProperty(n)&&r?(r.appendChild(e),e=r):n=="li"?r=e:n&&(r=null)}}function cN(t,e){return(t.matches||t.msMatchesSelector||t.webkitMatchesSelector||t.mozMatchesSelector).call(t,e)}function Iw(t){let e={};for(let r in t)e[r]=t[r];return e}function uN(t,e){let r=e.schema.nodes;for(let n in r){let i=r[n];if(!i.allowsMarkType(t))continue;let o=[],s=a=>{o.push(a);for(let l=0;l<a.edgeCount;l++){let{type:c,next:u}=a.edge(l);if(c==e||o.indexOf(u)<0&&s(u))return!0}};if(s(i.contentMatch))return!0}}function fN(t,e){for(let r=0;r<e.length;r++)if(t.eq(e[r]))return e[r]}class uo{constructor(e,r){this.nodes=e,this.marks=r}serializeFragment(e,r={},n){n||(n=_d(r).createDocumentFragment());let i=n,o=[];return e.forEach(s=>{if(o.length||s.marks.length){let a=0,l=0;for(;a<o.length&&l<s.marks.length;){let c=s.marks[l];if(!this.marks[c.type.name]){l++;continue}if(!c.eq(o[a][0])||c.type.spec.spanning===!1)break;a++,l++}for(;a<o.length;)i=o.pop()[1];for(;l<s.marks.length;){let c=s.marks[l++],u=this.serializeMark(c,s.isInline,r);u&&(o.push([c,i]),i.appendChild(u.dom),i=u.contentDOM||u.dom)}}i.appendChild(this.serializeNodeInner(s,r))}),n}serializeNodeInner(e,r){let{dom:n,contentDOM:i}=vc(_d(r),this.nodes[e.type.name](e),null,e.attrs);if(i){if(e.isLeaf)throw new RangeError("Content hole not allowed in a leaf node spec");this.serializeFragment(e.content,r,i)}return n}serializeNode(e,r={}){let n=this.serializeNodeInner(e,r);for(let i=e.marks.length-1;i>=0;i--){let o=this.serializeMark(e.marks[i],e.isInline,r);o&&((o.contentDOM||o.dom).appendChild(n),n=o.dom)}return n}serializeMark(e,r,n={}){let i=this.marks[e.type.name];return i&&vc(_d(n),i(e,r),null,e.attrs)}static renderSpec(e,r,n=null,i){return vc(e,r,n,i)}static fromSchema(e){return e.cached.domSerializer||(e.cached.domSerializer=new uo(this.nodesFromSchema(e),this.marksFromSchema(e)))}static nodesFromSchema(e){let r=Nw(e.nodes);return r.text||(r.text=n=>n.text),r}static marksFromSchema(e){return Nw(e.marks)}}function Nw(t){let e={};for(let r in t){let n=t[r].spec.toDOM;n&&(e[r]=n)}return e}function _d(t){return t.document||window.document}const Dw=new WeakMap;function dN(t){let e=Dw.get(t);return e===void 0&&Dw.set(t,e=hN(t)),e}function hN(t){let e=null;function r(n){if(n&&typeof n=="object")if(Array.isArray(n))if(typeof n[0]=="string")e||(e=[]),e.push(n);else for(let i=0;i<n.length;i++)r(n[i]);else for(let i in n)r(n[i])}return r(t),e}function vc(t,e,r,n){if(typeof e=="string")return{dom:t.createTextNode(e)};if(e.nodeType!=null)return{dom:e};if(e.dom&&e.dom.nodeType!=null)return e;let i=e[0],o;if(typeof i!="string")throw new RangeError("Invalid array passed to renderSpec");if(n&&(o=dN(n))&&o.indexOf(e)>-1)throw new RangeError("Using an array from an attribute object as a DOM spec. This may be an attempted cross site scripting attack.");let s=i.indexOf(" ");s>0&&(r=i.slice(0,s),i=i.slice(s+1));let a,l=r?t.createElementNS(r,i):t.createElement(i),c=e[1],u=1;if(c&&typeof c=="object"&&c.nodeType==null&&!Array.isArray(c)){u=2;for(let f in c)if(c[f]!=null){let d=f.indexOf(" ");d>0?l.setAttributeNS(f.slice(0,d),f.slice(d+1),c[f]):l.setAttribute(f,c[f])}}for(let f=u;f<e.length;f++){let d=e[f];if(d===0){if(f<e.length-1||f>u)throw new RangeError("Content hole must be the only child of its parent node");return{dom:l,contentDOM:l}}else{let{dom:h,contentDOM:p}=vc(t,d,r,n);if(l.appendChild(h),p){if(a)throw new RangeError("Multiple content holes");a=p}}}return{dom:l,contentDOM:a}}const mT=65535,gT=Math.pow(2,16);function pN(t,e){return t+e*gT}function Pw(t){return t&mT}function mN(t){return(t-(t&mT))/gT}const yT=1,vT=2,wc=4,wT=8;class Zp{constructor(e,r,n){this.pos=e,this.delInfo=r,this.recover=n}get deleted(){return(this.delInfo&wT)>0}get deletedBefore(){return(this.delInfo&(yT|wc))>0}get deletedAfter(){return(this.delInfo&(vT|wc))>0}get deletedAcross(){return(this.delInfo&wc)>0}}class tr{constructor(e,r=!1){if(this.ranges=e,this.inverted=r,!e.length&&tr.empty)return tr.empty}recover(e){let r=0,n=Pw(e);if(!this.inverted)for(let i=0;i<n;i++)r+=this.ranges[i*3+2]-this.ranges[i*3+1];return this.ranges[n*3]+r+mN(e)}mapResult(e,r=1){return this._map(e,r,!1)}map(e,r=1){return this._map(e,r,!0)}_map(e,r,n){let i=0,o=this.inverted?2:1,s=this.inverted?1:2;for(let a=0;a<this.ranges.length;a+=3){let l=this.ranges[a]-(this.inverted?i:0);if(l>e)break;let c=this.ranges[a+o],u=this.ranges[a+s],f=l+c;if(e<=f){let d=c?e==l?-1:e==f?1:r:r,h=l+i+(d<0?0:u);if(n)return h;let p=e==(r<0?l:f)?null:pN(a/3,e-l),m=e==l?vT:e==f?yT:wc;return(r<0?e!=l:e!=f)&&(m|=wT),new Zp(h,m,p)}i+=u-c}return n?e+i:new Zp(e+i,0,null)}touches(e,r){let n=0,i=Pw(r),o=this.inverted?2:1,s=this.inverted?1:2;for(let a=0;a<this.ranges.length;a+=3){let l=this.ranges[a]-(this.inverted?n:0);if(l>e)break;let c=this.ranges[a+o],u=l+c;if(e<=u&&a==i*3)return!0;n+=this.ranges[a+s]-c}return!1}forEach(e){let r=this.inverted?2:1,n=this.inverted?1:2;for(let i=0,o=0;i<this.ranges.length;i+=3){let s=this.ranges[i],a=s-(this.inverted?o:0),l=s+(this.inverted?0:o),c=this.ranges[i+r],u=this.ranges[i+n];e(a,a+c,l,l+u),o+=u-c}}invert(){return new tr(this.ranges,!this.inverted)}toString(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)}static offset(e){return e==0?tr.empty:new tr(e<0?[0,-e,0]:[0,0,e])}}tr.empty=new tr([]);class Wo{constructor(e=[],r,n=0,i=e.length){this.maps=e,this.mirror=r,this.from=n,this.to=i}slice(e=0,r=this.maps.length){return new Wo(this.maps,this.mirror,e,r)}copy(){return new Wo(this.maps.slice(),this.mirror&&this.mirror.slice(),this.from,this.to)}appendMap(e,r){this.to=this.maps.push(e),r!=null&&this.setMirror(this.maps.length-1,r)}appendMapping(e){for(let r=0,n=this.maps.length;r<e.maps.length;r++){let i=e.getMirror(r);this.appendMap(e.maps[r],i!=null&&i<r?n+i:void 0)}}getMirror(e){if(this.mirror){for(let r=0;r<this.mirror.length;r++)if(this.mirror[r]==e)return this.mirror[r+(r%2?-1:1)]}}setMirror(e,r){this.mirror||(this.mirror=[]),this.mirror.push(e,r)}appendMappingInverted(e){for(let r=e.maps.length-1,n=this.maps.length+e.maps.length;r>=0;r--){let i=e.getMirror(r);this.appendMap(e.maps[r].invert(),i!=null&&i>r?n-i-1:void 0)}}invert(){let e=new Wo;return e.appendMappingInverted(this),e}map(e,r=1){if(this.mirror)return this._map(e,r,!0);for(let n=this.from;n<this.to;n++)e=this.maps[n].map(e,r);return e}mapResult(e,r=1){return this._map(e,r,!1)}_map(e,r,n){let i=0;for(let o=this.from;o<this.to;o++){let s=this.maps[o],a=s.mapResult(e,r);if(a.recover!=null){let l=this.getMirror(o);if(l!=null&&l>o&&l<this.to){o=l,e=this.maps[l].recover(a.recover);continue}}i|=a.delInfo,e=a.pos}return n?e:new Zp(e,i,null)}}const Od=Object.create(null);class $t{getMap(){return tr.empty}merge(e){return null}static fromJSON(e,r){if(!r||!r.stepType)throw new RangeError("Invalid input for Step.fromJSON");let n=Od[r.stepType];if(!n)throw new RangeError(`No step type ${r.stepType} defined`);return n.fromJSON(e,r)}static jsonID(e,r){if(e in Od)throw new RangeError("Duplicate use of step JSON ID "+e);return Od[e]=r,r.prototype.jsonID=e,r}}class ft{constructor(e,r){this.doc=e,this.failed=r}static ok(e){return new ft(e,null)}static fail(e){return new ft(null,e)}static fromReplace(e,r,n,i){try{return ft.ok(e.replace(r,n,i))}catch(o){if(o instanceof Kc)return ft.fail(o.message);throw o}}}function ty(t,e,r){let n=[];for(let i=0;i<t.childCount;i++){let o=t.child(i);o.content.size&&(o=o.copy(ty(o.content,e,o))),o.isInline&&(o=e(o,r,i)),n.push(o)}return he.fromArray(n)}class ti extends $t{constructor(e,r,n){super(),this.from=e,this.to=r,this.mark=n}apply(e){let r=e.slice(this.from,this.to),n=e.resolve(this.from),i=n.node(n.sharedDepth(this.to)),o=new we(ty(r.content,(s,a)=>!s.isAtom||!a.type.allowsMarkType(this.mark.type)?s:s.mark(this.mark.addToSet(s.marks)),i),r.openStart,r.openEnd);return ft.fromReplace(e,this.from,this.to,o)}invert(){return new Ur(this.from,this.to,this.mark)}map(e){let r=e.mapResult(this.from,1),n=e.mapResult(this.to,-1);return r.deleted&&n.deleted||r.pos>=n.pos?null:new ti(r.pos,n.pos,this.mark)}merge(e){return e instanceof ti&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new ti(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,r){if(typeof r.from!="number"||typeof r.to!="number")throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new ti(r.from,r.to,e.markFromJSON(r.mark))}}$t.jsonID("addMark",ti);class Ur extends $t{constructor(e,r,n){super(),this.from=e,this.to=r,this.mark=n}apply(e){let r=e.slice(this.from,this.to),n=new we(ty(r.content,i=>i.mark(this.mark.removeFromSet(i.marks)),e),r.openStart,r.openEnd);return ft.fromReplace(e,this.from,this.to,n)}invert(){return new ti(this.from,this.to,this.mark)}map(e){let r=e.mapResult(this.from,1),n=e.mapResult(this.to,-1);return r.deleted&&n.deleted||r.pos>=n.pos?null:new Ur(r.pos,n.pos,this.mark)}merge(e){return e instanceof Ur&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new Ur(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,r){if(typeof r.from!="number"||typeof r.to!="number")throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new Ur(r.from,r.to,e.markFromJSON(r.mark))}}$t.jsonID("removeMark",Ur);class ri extends $t{constructor(e,r){super(),this.pos=e,this.mark=r}apply(e){let r=e.nodeAt(this.pos);if(!r)return ft.fail("No node at mark step's position");let n=r.type.create(r.attrs,null,this.mark.addToSet(r.marks));return ft.fromReplace(e,this.pos,this.pos+1,new we(he.from(n),0,r.isLeaf?0:1))}invert(e){let r=e.nodeAt(this.pos);if(r){let n=this.mark.addToSet(r.marks);if(n.length==r.marks.length){for(let i=0;i<r.marks.length;i++)if(!r.marks[i].isInSet(n))return new ri(this.pos,r.marks[i]);return new ri(this.pos,this.mark)}}return new ns(this.pos,this.mark)}map(e){let r=e.mapResult(this.pos,1);return r.deletedAfter?null:new ri(r.pos,this.mark)}toJSON(){return{stepType:"addNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,r){if(typeof r.pos!="number")throw new RangeError("Invalid input for AddNodeMarkStep.fromJSON");return new ri(r.pos,e.markFromJSON(r.mark))}}$t.jsonID("addNodeMark",ri);class ns extends $t{constructor(e,r){super(),this.pos=e,this.mark=r}apply(e){let r=e.nodeAt(this.pos);if(!r)return ft.fail("No node at mark step's position");let n=r.type.create(r.attrs,null,this.mark.removeFromSet(r.marks));return ft.fromReplace(e,this.pos,this.pos+1,new we(he.from(n),0,r.isLeaf?0:1))}invert(e){let r=e.nodeAt(this.pos);return!r||!this.mark.isInSet(r.marks)?this:new ri(this.pos,this.mark)}map(e){let r=e.mapResult(this.pos,1);return r.deletedAfter?null:new ns(r.pos,this.mark)}toJSON(){return{stepType:"removeNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,r){if(typeof r.pos!="number")throw new RangeError("Invalid input for RemoveNodeMarkStep.fromJSON");return new ns(r.pos,e.markFromJSON(r.mark))}}$t.jsonID("removeNodeMark",ns);class mt extends $t{constructor(e,r,n,i=!1){super(),this.from=e,this.to=r,this.slice=n,this.structure=i}apply(e){return this.structure&&Qp(e,this.from,this.to)?ft.fail("Structure replace would overwrite content"):ft.fromReplace(e,this.from,this.to,this.slice)}getMap(){return new tr([this.from,this.to-this.from,this.slice.size])}invert(e){return new mt(this.from,this.from+this.slice.size,e.slice(this.from,this.to))}map(e){let r=e.mapResult(this.from,1),n=e.mapResult(this.to,-1);return r.deletedAcross&&n.deletedAcross?null:new mt(r.pos,Math.max(r.pos,n.pos),this.slice)}merge(e){if(!(e instanceof mt)||e.structure||this.structure)return null;if(this.from+this.slice.size==e.from&&!this.slice.openEnd&&!e.slice.openStart){let r=this.slice.size+e.slice.size==0?we.empty:new we(this.slice.content.append(e.slice.content),this.slice.openStart,e.slice.openEnd);return new mt(this.from,this.to+(e.to-e.from),r,this.structure)}else if(e.to==this.from&&!this.slice.openStart&&!e.slice.openEnd){let r=this.slice.size+e.slice.size==0?we.empty:new we(e.slice.content.append(this.slice.content),e.slice.openStart,this.slice.openEnd);return new mt(e.from,this.to,r,this.structure)}else return null}toJSON(){let e={stepType:"replace",from:this.from,to:this.to};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(e,r){if(typeof r.from!="number"||typeof r.to!="number")throw new RangeError("Invalid input for ReplaceStep.fromJSON");return new mt(r.from,r.to,we.fromJSON(e,r.slice),!!r.structure)}}$t.jsonID("replace",mt);class yt extends $t{constructor(e,r,n,i,o,s,a=!1){super(),this.from=e,this.to=r,this.gapFrom=n,this.gapTo=i,this.slice=o,this.insert=s,this.structure=a}apply(e){if(this.structure&&(Qp(e,this.from,this.gapFrom)||Qp(e,this.gapTo,this.to)))return ft.fail("Structure gap-replace would overwrite content");let r=e.slice(this.gapFrom,this.gapTo);if(r.openStart||r.openEnd)return ft.fail("Gap is not a flat range");let n=this.slice.insertAt(this.insert,r.content);return n?ft.fromReplace(e,this.from,this.to,n):ft.fail("Content does not fit in gap")}getMap(){return new tr([this.from,this.gapFrom-this.from,this.insert,this.gapTo,this.to-this.gapTo,this.slice.size-this.insert])}invert(e){let r=this.gapTo-this.gapFrom;return new yt(this.from,this.from+this.slice.size+r,this.from+this.insert,this.from+this.insert+r,e.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure)}map(e){let r=e.mapResult(this.from,1),n=e.mapResult(this.to,-1),i=this.from==this.gapFrom?r.pos:e.map(this.gapFrom,-1),o=this.to==this.gapTo?n.pos:e.map(this.gapTo,1);return r.deletedAcross&&n.deletedAcross||i<r.pos||o>n.pos?null:new yt(r.pos,n.pos,i,o,this.slice,this.insert,this.structure)}toJSON(){let e={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(e,r){if(typeof r.from!="number"||typeof r.to!="number"||typeof r.gapFrom!="number"||typeof r.gapTo!="number"||typeof r.insert!="number")throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new yt(r.from,r.to,r.gapFrom,r.gapTo,we.fromJSON(e,r.slice),r.insert,!!r.structure)}}$t.jsonID("replaceAround",yt);function Qp(t,e,r){let n=t.resolve(e),i=r-e,o=n.depth;for(;i>0&&o>0&&n.indexAfter(o)==n.node(o).childCount;)o--,i--;if(i>0){let s=n.node(o).maybeChild(n.indexAfter(o));for(;i>0;){if(!s||s.isLeaf)return!0;s=s.firstChild,i--}}return!1}function gN(t,e,r,n){let i=[],o=[],s,a;t.doc.nodesBetween(e,r,(l,c,u)=>{if(!l.isInline)return;let f=l.marks;if(!n.isInSet(f)&&u.type.allowsMarkType(n.type)){let d=Math.max(c,e),h=Math.min(c+l.nodeSize,r),p=n.addToSet(f);for(let m=0;m<f.length;m++)f[m].isInSet(p)||(s&&s.to==d&&s.mark.eq(f[m])?s.to=h:i.push(s=new Ur(d,h,f[m])));a&&a.to==d?a.to=h:o.push(a=new ti(d,h,n))}}),i.forEach(l=>t.step(l)),o.forEach(l=>t.step(l))}function yN(t,e,r,n){let i=[],o=0;t.doc.nodesBetween(e,r,(s,a)=>{if(!s.isInline)return;o++;let l=null;if(n instanceof bf){let c=s.marks,u;for(;u=n.isInSet(c);)(l||(l=[])).push(u),c=u.removeFromSet(c)}else n?n.isInSet(s.marks)&&(l=[n]):l=s.marks;if(l&&l.length){let c=Math.min(a+s.nodeSize,r);for(let u=0;u<l.length;u++){let f=l[u],d;for(let h=0;h<i.length;h++){let p=i[h];p.step==o-1&&f.eq(i[h].style)&&(d=p)}d?(d.to=c,d.step=o):i.push({style:f,from:Math.max(a,e),to:c,step:o})}}}),i.forEach(s=>t.step(new Ur(s.from,s.to,s.style)))}function bT(t,e,r,n=r.contentMatch,i=!0){let o=t.doc.nodeAt(e),s=[],a=e+1;for(let l=0;l<o.childCount;l++){let c=o.child(l),u=a+c.nodeSize,f=n.matchType(c.type);if(!f)s.push(new mt(a,u,we.empty));else{n=f;for(let d=0;d<c.marks.length;d++)r.allowsMarkType(c.marks[d].type)||t.step(new Ur(a,u,c.marks[d]));if(i&&c.isText&&r.whitespace!="pre"){let d,h=/\r?\n|\r/g,p;for(;d=h.exec(c.text);)p||(p=new we(he.from(r.schema.text(" ",r.allowedMarks(c.marks))),0,0)),s.push(new mt(a+d.index,a+d.index+d[0].length,p))}}a=u}if(!n.validEnd){let l=n.fillBefore(he.empty,!0);t.replace(a,a,new we(l,0,0))}for(let l=s.length-1;l>=0;l--)t.step(s[l])}function vN(t,e,r){return(e==0||t.canReplace(e,t.childCount))&&(r==t.childCount||t.canReplace(0,r))}function Os(t){let r=t.parent.content.cutByIndex(t.startIndex,t.endIndex);for(let n=t.depth;;--n){let i=t.$from.node(n),o=t.$from.index(n),s=t.$to.indexAfter(n);if(n<t.depth&&i.canReplace(o,s,r))return n;if(n==0||i.type.spec.isolating||!vN(i,o,s))break}return null}function wN(t,e,r){let{$from:n,$to:i,depth:o}=e,s=n.before(o+1),a=i.after(o+1),l=s,c=a,u=he.empty,f=0;for(let p=o,m=!1;p>r;p--)m||n.index(p)>0?(m=!0,u=he.from(n.node(p).copy(u)),f++):l--;let d=he.empty,h=0;for(let p=o,m=!1;p>r;p--)m||i.after(p+1)<i.end(p)?(m=!0,d=he.from(i.node(p).copy(d)),h++):c++;t.step(new yt(l,c,s,a,new we(u.append(d),f,h),u.size-f,!0))}function ry(t,e,r=null,n=t){let i=bN(t,e),o=i&&xN(n,e);return o?i.map(Lw).concat({type:e,attrs:r}).concat(o.map(Lw)):null}function Lw(t){return{type:t,attrs:null}}function bN(t,e){let{parent:r,startIndex:n,endIndex:i}=t,o=r.contentMatchAt(n).findWrapping(e);if(!o)return null;let s=o.length?o[0]:e;return r.canReplaceWith(n,i,s)?o:null}function xN(t,e){let{parent:r,startIndex:n,endIndex:i}=t,o=r.child(n),s=e.contentMatch.findWrapping(o.type);if(!s)return null;let l=(s.length?s[s.length-1]:e).contentMatch;for(let c=n;l&&c<i;c++)l=l.matchType(r.child(c).type);return!l||!l.validEnd?null:s}function SN(t,e,r){let n=he.empty;for(let s=r.length-1;s>=0;s--){if(n.size){let a=r[s].type.contentMatch.matchFragment(n);if(!a||!a.validEnd)throw new RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}n=he.from(r[s].type.create(r[s].attrs,n))}let i=e.start,o=e.end;t.step(new yt(i,o,i,o,new we(n,0,0),r.length,!0))}function EN(t,e,r,n,i){if(!n.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");let o=t.steps.length;t.doc.nodesBetween(e,r,(s,a)=>{if(s.isTextblock&&!s.hasMarkup(n,i)&&CN(t.doc,t.mapping.slice(o).map(a),n)){let l=null;if(n.schema.linebreakReplacement){let d=n.whitespace=="pre",h=!!n.contentMatch.matchType(n.schema.linebreakReplacement);d&&!h?l=!1:!d&&h&&(l=!0)}l===!1&&AN(t,s,a,o),bT(t,t.mapping.slice(o).map(a,1),n,void 0,l===null);let c=t.mapping.slice(o),u=c.map(a,1),f=c.map(a+s.nodeSize,1);return t.step(new yt(u,f,u+1,f-1,new we(he.from(n.create(i,null,s.marks)),0,0),1,!0)),l===!0&&TN(t,s,a,o),!1}})}function TN(t,e,r,n){e.forEach((i,o)=>{if(i.isText){let s,a=/\r?\n|\r/g;for(;s=a.exec(i.text);){let l=t.mapping.slice(n).map(r+1+o+s.index);t.replaceWith(l,l+1,e.type.schema.linebreakReplacement.create())}}})}function AN(t,e,r,n){e.forEach((i,o)=>{if(i.type==i.type.schema.linebreakReplacement){let s=t.mapping.slice(n).map(r+1+o);t.replaceWith(s,s+1,e.type.schema.text(`
5
- `))}})}function CN(t,e,r){let n=t.resolve(e),i=n.index();return n.parent.canReplaceWith(i,i+1,r)}function kN(t,e,r,n,i){let o=t.doc.nodeAt(e);if(!o)throw new RangeError("No node at given position");r||(r=o.type);let s=r.create(n,null,i||o.marks);if(o.isLeaf)return t.replaceWith(e,e+o.nodeSize,s);if(!r.validContent(o.content))throw new RangeError("Invalid content for node type "+r.name);t.step(new yt(e,e+o.nodeSize,e+1,e+o.nodeSize-1,new we(he.from(s),0,0),1,!0))}function Vo(t,e,r=1,n){let i=t.resolve(e),o=i.depth-r,s=n&&n[n.length-1]||i.parent;if(o<0||i.parent.type.spec.isolating||!i.parent.canReplace(i.index(),i.parent.childCount)||!s.type.validContent(i.parent.content.cutByIndex(i.index(),i.parent.childCount)))return!1;for(let c=i.depth-1,u=r-2;c>o;c--,u--){let f=i.node(c),d=i.index(c);if(f.type.spec.isolating)return!1;let h=f.content.cutByIndex(d,f.childCount),p=n&&n[u+1];p&&(h=h.replaceChild(0,p.type.create(p.attrs)));let m=n&&n[u]||f;if(!f.canReplace(d+1,f.childCount)||!m.type.validContent(h))return!1}let a=i.indexAfter(o),l=n&&n[0];return i.node(o).canReplaceWith(a,a,l?l.type:i.node(o+1).type)}function _N(t,e,r=1,n){let i=t.doc.resolve(e),o=he.empty,s=he.empty;for(let a=i.depth,l=i.depth-r,c=r-1;a>l;a--,c--){o=he.from(i.node(a).copy(o));let u=n&&n[c];s=he.from(u?u.type.create(u.attrs,s):i.node(a).copy(s))}t.step(new mt(e,e,new we(o.append(s),r,r),!0))}function Si(t,e){let r=t.resolve(e),n=r.index();return xT(r.nodeBefore,r.nodeAfter)&&r.parent.canReplace(n,n+1)}function xT(t,e){return!!(t&&e&&!t.isLeaf&&t.canAppend(e))}function xf(t,e,r=-1){let n=t.resolve(e);for(let i=n.depth;;i--){let o,s,a=n.index(i);if(i==n.depth?(o=n.nodeBefore,s=n.nodeAfter):r>0?(o=n.node(i+1),a++,s=n.node(i).maybeChild(a)):(o=n.node(i).maybeChild(a-1),s=n.node(i+1)),o&&!o.isTextblock&&xT(o,s)&&n.node(i).canReplace(a,a+1))return e;if(i==0)break;e=r<0?n.before(i):n.after(i)}}function ON(t,e,r){let n=new mt(e-r,e+r,we.empty,!0);t.step(n)}function RN(t,e,r){let n=t.resolve(e);if(n.parent.canReplaceWith(n.index(),n.index(),r))return e;if(n.parentOffset==0)for(let i=n.depth-1;i>=0;i--){let o=n.index(i);if(n.node(i).canReplaceWith(o,o,r))return n.before(i+1);if(o>0)return null}if(n.parentOffset==n.parent.content.size)for(let i=n.depth-1;i>=0;i--){let o=n.indexAfter(i);if(n.node(i).canReplaceWith(o,o,r))return n.after(i+1);if(o<n.node(i).childCount)return null}return null}function ST(t,e,r){let n=t.resolve(e);if(!r.content.size)return e;let i=r.content;for(let o=0;o<r.openStart;o++)i=i.firstChild.content;for(let o=1;o<=(r.openStart==0&&r.size?2:1);o++)for(let s=n.depth;s>=0;s--){let a=s==n.depth?0:n.pos<=(n.start(s+1)+n.end(s+1))/2?-1:1,l=n.index(s)+(a>0?1:0),c=n.node(s),u=!1;if(o==1)u=c.canReplace(l,l,i);else{let f=c.contentMatchAt(l).findWrapping(i.firstChild.type);u=f&&c.canReplaceWith(l,l,f[0])}if(u)return a==0?n.pos:a<0?n.before(s+1):n.after(s+1)}return null}function Sf(t,e,r=e,n=we.empty){if(e==r&&!n.size)return null;let i=t.resolve(e),o=t.resolve(r);return ET(i,o,n)?new mt(e,r,n):new MN(i,o,n).fit()}function ET(t,e,r){return!r.openStart&&!r.openEnd&&t.start()==e.start()&&t.parent.canReplace(t.index(),e.index(),r.content)}class MN{constructor(e,r,n){this.$from=e,this.$to=r,this.unplaced=n,this.frontier=[],this.placed=he.empty;for(let i=0;i<=e.depth;i++){let o=e.node(i);this.frontier.push({type:o.type,match:o.contentMatchAt(e.indexAfter(i))})}for(let i=e.depth;i>0;i--)this.placed=he.from(e.node(i).copy(this.placed))}get depth(){return this.frontier.length-1}fit(){for(;this.unplaced.size;){let c=this.findFittable();c?this.placeNodes(c):this.openMore()||this.dropNode()}let e=this.mustMoveInline(),r=this.placed.size-this.depth-this.$from.depth,n=this.$from,i=this.close(e<0?this.$to:n.doc.resolve(e));if(!i)return null;let o=this.placed,s=n.depth,a=i.depth;for(;s&&a&&o.childCount==1;)o=o.firstChild.content,s--,a--;let l=new we(o,s,a);return e>-1?new yt(n.pos,e,this.$to.pos,this.$to.end(),l,r):l.size||n.pos!=this.$to.pos?new mt(n.pos,i.pos,l):null}findFittable(){let e=this.unplaced.openStart;for(let r=this.unplaced.content,n=0,i=this.unplaced.openEnd;n<e;n++){let o=r.firstChild;if(r.childCount>1&&(i=0),o.type.spec.isolating&&i<=n){e=n;break}r=o.content}for(let r=1;r<=2;r++)for(let n=r==1?e:this.unplaced.openStart;n>=0;n--){let i,o=null;n?(o=Rd(this.unplaced.content,n-1).firstChild,i=o.content):i=this.unplaced.content;let s=i.firstChild;for(let a=this.depth;a>=0;a--){let{type:l,match:c}=this.frontier[a],u,f=null;if(r==1&&(s?c.matchType(s.type)||(f=c.fillBefore(he.from(s),!1)):o&&l.compatibleContent(o.type)))return{sliceDepth:n,frontierDepth:a,parent:o,inject:f};if(r==2&&s&&(u=c.findWrapping(s.type)))return{sliceDepth:n,frontierDepth:a,parent:o,wrap:u};if(o&&c.matchType(o.type))break}}}openMore(){let{content:e,openStart:r,openEnd:n}=this.unplaced,i=Rd(e,r);return!i.childCount||i.firstChild.isLeaf?!1:(this.unplaced=new we(e,r+1,Math.max(n,i.size+r>=e.size-n?r+1:0)),!0)}dropNode(){let{content:e,openStart:r,openEnd:n}=this.unplaced,i=Rd(e,r);if(i.childCount<=1&&r>0){let o=e.size-r<=r+i.size;this.unplaced=new we(na(e,r-1,1),r-1,o?r-1:n)}else this.unplaced=new we(na(e,r,1),r,n)}placeNodes({sliceDepth:e,frontierDepth:r,parent:n,inject:i,wrap:o}){for(;this.depth>r;)this.closeFrontierNode();if(o)for(let m=0;m<o.length;m++)this.openFrontierNode(o[m]);let s=this.unplaced,a=n?n.content:s.content,l=s.openStart-e,c=0,u=[],{match:f,type:d}=this.frontier[r];if(i){for(let m=0;m<i.childCount;m++)u.push(i.child(m));f=f.matchFragment(i)}let h=a.size+e-(s.content.size-s.openEnd);for(;c<a.childCount;){let m=a.child(c),y=f.matchType(m.type);if(!y)break;c++,(c>1||l==0||m.content.size)&&(f=y,u.push(TT(m.mark(d.allowedMarks(m.marks)),c==1?l:0,c==a.childCount?h:-1)))}let p=c==a.childCount;p||(h=-1),this.placed=ia(this.placed,r,he.from(u)),this.frontier[r].match=f,p&&h<0&&n&&n.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let m=0,y=a;m<h;m++){let g=y.lastChild;this.frontier.push({type:g.type,match:g.contentMatchAt(g.childCount)}),y=g.content}this.unplaced=p?e==0?we.empty:new we(na(s.content,e-1,1),e-1,h<0?s.openEnd:e-1):new we(na(s.content,e,c),s.openStart,s.openEnd)}mustMoveInline(){if(!this.$to.parent.isTextblock)return-1;let e=this.frontier[this.depth],r;if(!e.type.isTextblock||!Md(this.$to,this.$to.depth,e.type,e.match,!1)||this.$to.depth==this.depth&&(r=this.findCloseLevel(this.$to))&&r.depth==this.depth)return-1;let{depth:n}=this.$to,i=this.$to.after(n);for(;n>1&&i==this.$to.end(--n);)++i;return i}findCloseLevel(e){e:for(let r=Math.min(this.depth,e.depth);r>=0;r--){let{match:n,type:i}=this.frontier[r],o=r<e.depth&&e.end(r+1)==e.pos+(e.depth-(r+1)),s=Md(e,r,i,n,o);if(s){for(let a=r-1;a>=0;a--){let{match:l,type:c}=this.frontier[a],u=Md(e,a,c,l,!0);if(!u||u.childCount)continue e}return{depth:r,fit:s,move:o?e.doc.resolve(e.after(r+1)):e}}}}close(e){let r=this.findCloseLevel(e);if(!r)return null;for(;this.depth>r.depth;)this.closeFrontierNode();r.fit.childCount&&(this.placed=ia(this.placed,r.depth,r.fit)),e=r.move;for(let n=r.depth+1;n<=e.depth;n++){let i=e.node(n),o=i.type.contentMatch.fillBefore(i.content,!0,e.index(n));this.openFrontierNode(i.type,i.attrs,o)}return e}openFrontierNode(e,r=null,n){let i=this.frontier[this.depth];i.match=i.match.matchType(e),this.placed=ia(this.placed,this.depth,he.from(e.create(r,n))),this.frontier.push({type:e,match:e.contentMatch})}closeFrontierNode(){let r=this.frontier.pop().match.fillBefore(he.empty,!0);r.childCount&&(this.placed=ia(this.placed,this.frontier.length,r))}}function na(t,e,r){return e==0?t.cutByIndex(r,t.childCount):t.replaceChild(0,t.firstChild.copy(na(t.firstChild.content,e-1,r)))}function ia(t,e,r){return e==0?t.append(r):t.replaceChild(t.childCount-1,t.lastChild.copy(ia(t.lastChild.content,e-1,r)))}function Rd(t,e){for(let r=0;r<e;r++)t=t.firstChild.content;return t}function TT(t,e,r){if(e<=0)return t;let n=t.content;return e>1&&(n=n.replaceChild(0,TT(n.firstChild,e-1,n.childCount==1?r-1:0))),e>0&&(n=t.type.contentMatch.fillBefore(n).append(n),r<=0&&(n=n.append(t.type.contentMatch.matchFragment(n).fillBefore(he.empty,!0)))),t.copy(n)}function Md(t,e,r,n,i){let o=t.node(e),s=i?t.indexAfter(e):t.index(e);if(s==o.childCount&&!r.compatibleContent(o.type))return null;let a=n.fillBefore(o.content,!0,s);return a&&!IN(r,o.content,s)?a:null}function IN(t,e,r){for(let n=r;n<e.childCount;n++)if(!t.allowsMarks(e.child(n).marks))return!0;return!1}function NN(t){return t.spec.defining||t.spec.definingForContent}function DN(t,e,r,n){if(!n.size)return t.deleteRange(e,r);let i=t.doc.resolve(e),o=t.doc.resolve(r);if(ET(i,o,n))return t.step(new mt(e,r,n));let s=CT(i,t.doc.resolve(r));s[s.length-1]==0&&s.pop();let a=-(i.depth+1);s.unshift(a);for(let d=i.depth,h=i.pos-1;d>0;d--,h--){let p=i.node(d).type.spec;if(p.defining||p.definingAsContext||p.isolating)break;s.indexOf(d)>-1?a=d:i.before(d)==h&&s.splice(1,0,-d)}let l=s.indexOf(a),c=[],u=n.openStart;for(let d=n.content,h=0;;h++){let p=d.firstChild;if(c.push(p),h==n.openStart)break;d=p.content}for(let d=u-1;d>=0;d--){let h=c[d],p=NN(h.type);if(p&&!h.sameMarkup(i.node(Math.abs(a)-1)))u=d;else if(p||!h.type.isTextblock)break}for(let d=n.openStart;d>=0;d--){let h=(d+u+1)%(n.openStart+1),p=c[h];if(p)for(let m=0;m<s.length;m++){let y=s[(m+l)%s.length],g=!0;y<0&&(g=!1,y=-y);let b=i.node(y-1),S=i.index(y-1);if(b.canReplaceWith(S,S,p.type,p.marks))return t.replace(i.before(y),g?o.after(y):r,new we(AT(n.content,0,n.openStart,h),h,n.openEnd))}}let f=t.steps.length;for(let d=s.length-1;d>=0&&(t.replace(e,r,n),!(t.steps.length>f));d--){let h=s[d];h<0||(e=i.before(h),r=o.after(h))}}function AT(t,e,r,n,i){if(e<r){let o=t.firstChild;t=t.replaceChild(0,o.copy(AT(o.content,e+1,r,n,o)))}if(e>n){let o=i.contentMatchAt(0),s=o.fillBefore(t).append(t);t=s.append(o.matchFragment(s).fillBefore(he.empty,!0))}return t}function PN(t,e,r,n){if(!n.isInline&&e==r&&t.doc.resolve(e).parent.content.size){let i=RN(t.doc,e,n.type);i!=null&&(e=r=i)}t.replaceRange(e,r,new we(he.from(n),0,0))}function LN(t,e,r){let n=t.doc.resolve(e),i=t.doc.resolve(r),o=CT(n,i);for(let s=0;s<o.length;s++){let a=o[s],l=s==o.length-1;if(l&&a==0||n.node(a).type.contentMatch.validEnd)return t.delete(n.start(a),i.end(a));if(a>0&&(l||n.node(a-1).canReplace(n.index(a-1),i.indexAfter(a-1))))return t.delete(n.before(a),i.after(a))}for(let s=1;s<=n.depth&&s<=i.depth;s++)if(e-n.start(s)==n.depth-s&&r>n.end(s)&&i.end(s)-r!=i.depth-s)return t.delete(n.before(s),r);t.delete(e,r)}function CT(t,e){let r=[],n=Math.min(t.depth,e.depth);for(let i=n;i>=0;i--){let o=t.start(i);if(o<t.pos-(t.depth-i)||e.end(i)>e.pos+(e.depth-i)||t.node(i).type.spec.isolating||e.node(i).type.spec.isolating)break;(o==e.start(i)||i==t.depth&&i==e.depth&&t.parent.inlineContent&&e.parent.inlineContent&&i&&e.start(i-1)==o-1)&&r.push(i)}return r}class Go extends $t{constructor(e,r,n){super(),this.pos=e,this.attr=r,this.value=n}apply(e){let r=e.nodeAt(this.pos);if(!r)return ft.fail("No node at attribute step's position");let n=Object.create(null);for(let o in r.attrs)n[o]=r.attrs[o];n[this.attr]=this.value;let i=r.type.create(n,null,r.marks);return ft.fromReplace(e,this.pos,this.pos+1,new we(he.from(i),0,r.isLeaf?0:1))}getMap(){return tr.empty}invert(e){return new Go(this.pos,this.attr,e.nodeAt(this.pos).attrs[this.attr])}map(e){let r=e.mapResult(this.pos,1);return r.deletedAfter?null:new Go(r.pos,this.attr,this.value)}toJSON(){return{stepType:"attr",pos:this.pos,attr:this.attr,value:this.value}}static fromJSON(e,r){if(typeof r.pos!="number"||typeof r.attr!="string")throw new RangeError("Invalid input for AttrStep.fromJSON");return new Go(r.pos,r.attr,r.value)}}$t.jsonID("attr",Go);class Ma extends $t{constructor(e,r){super(),this.attr=e,this.value=r}apply(e){let r=Object.create(null);for(let i in e.attrs)r[i]=e.attrs[i];r[this.attr]=this.value;let n=e.type.create(r,e.content,e.marks);return ft.ok(n)}getMap(){return tr.empty}invert(e){return new Ma(this.attr,e.attrs[this.attr])}map(e){return this}toJSON(){return{stepType:"docAttr",attr:this.attr,value:this.value}}static fromJSON(e,r){if(typeof r.attr!="string")throw new RangeError("Invalid input for DocAttrStep.fromJSON");return new Ma(r.attr,r.value)}}$t.jsonID("docAttr",Ma);let is=class extends Error{};is=function t(e){let r=Error.call(this,e);return r.__proto__=t.prototype,r};is.prototype=Object.create(Error.prototype);is.prototype.constructor=is;is.prototype.name="TransformError";class ny{constructor(e){this.doc=e,this.steps=[],this.docs=[],this.mapping=new Wo}get before(){return this.docs.length?this.docs[0]:this.doc}step(e){let r=this.maybeStep(e);if(r.failed)throw new is(r.failed);return this}maybeStep(e){let r=e.apply(this.doc);return r.failed||this.addStep(e,r.doc),r}get docChanged(){return this.steps.length>0}addStep(e,r){this.docs.push(this.doc),this.steps.push(e),this.mapping.appendMap(e.getMap()),this.doc=r}replace(e,r=e,n=we.empty){let i=Sf(this.doc,e,r,n);return i&&this.step(i),this}replaceWith(e,r,n){return this.replace(e,r,new we(he.from(n),0,0))}delete(e,r){return this.replace(e,r,we.empty)}insert(e,r){return this.replaceWith(e,e,r)}replaceRange(e,r,n){return DN(this,e,r,n),this}replaceRangeWith(e,r,n){return PN(this,e,r,n),this}deleteRange(e,r){return LN(this,e,r),this}lift(e,r){return wN(this,e,r),this}join(e,r=1){return ON(this,e,r),this}wrap(e,r){return SN(this,e,r),this}setBlockType(e,r=e,n,i=null){return EN(this,e,r,n,i),this}setNodeMarkup(e,r,n=null,i){return kN(this,e,r,n,i),this}setNodeAttribute(e,r,n){return this.step(new Go(e,r,n)),this}setDocAttribute(e,r){return this.step(new Ma(e,r)),this}addNodeMark(e,r){return this.step(new ri(e,r)),this}removeNodeMark(e,r){if(!(r instanceof We)){let n=this.doc.nodeAt(e);if(!n)throw new RangeError("No node at position "+e);if(r=r.isInSet(n.marks),!r)return this}return this.step(new ns(e,r)),this}split(e,r=1,n){return _N(this,e,r,n),this}addMark(e,r,n){return gN(this,e,r,n),this}removeMark(e,r,n){return yN(this,e,r,n),this}clearIncompatible(e,r,n){return bT(this,e,r,n),this}}const Id=Object.create(null);class Re{constructor(e,r,n){this.$anchor=e,this.$head=r,this.ranges=n||[new iy(e.min(r),e.max(r))]}get anchor(){return this.$anchor.pos}get head(){return this.$head.pos}get from(){return this.$from.pos}get to(){return this.$to.pos}get $from(){return this.ranges[0].$from}get $to(){return this.ranges[0].$to}get empty(){let e=this.ranges;for(let r=0;r<e.length;r++)if(e[r].$from.pos!=e[r].$to.pos)return!1;return!0}content(){return this.$from.doc.slice(this.from,this.to,!0)}replace(e,r=we.empty){let n=r.content.lastChild,i=null;for(let a=0;a<r.openEnd;a++)i=n,n=n.lastChild;let o=e.steps.length,s=this.ranges;for(let a=0;a<s.length;a++){let{$from:l,$to:c}=s[a],u=e.mapping.slice(o);e.replaceRange(u.map(l.pos),u.map(c.pos),a?we.empty:r),a==0&&$w(e,o,(n?n.isInline:i&&i.isTextblock)?-1:1)}}replaceWith(e,r){let n=e.steps.length,i=this.ranges;for(let o=0;o<i.length;o++){let{$from:s,$to:a}=i[o],l=e.mapping.slice(n),c=l.map(s.pos),u=l.map(a.pos);o?e.deleteRange(c,u):(e.replaceRangeWith(c,u,r),$w(e,n,r.isInline?-1:1))}}static findFrom(e,r,n=!1){let i=e.parent.inlineContent?new _e(e):Po(e.node(0),e.parent,e.pos,e.index(),r,n);if(i)return i;for(let o=e.depth-1;o>=0;o--){let s=r<0?Po(e.node(0),e.node(o),e.before(o+1),e.index(o),r,n):Po(e.node(0),e.node(o),e.after(o+1),e.index(o)+1,r,n);if(s)return s}return null}static near(e,r=1){return this.findFrom(e,r)||this.findFrom(e,-r)||new hr(e.node(0))}static atStart(e){return Po(e,e,0,0,1)||new hr(e)}static atEnd(e){return Po(e,e,e.content.size,e.childCount,-1)||new hr(e)}static fromJSON(e,r){if(!r||!r.type)throw new RangeError("Invalid input for Selection.fromJSON");let n=Id[r.type];if(!n)throw new RangeError(`No selection type ${r.type} defined`);return n.fromJSON(e,r)}static jsonID(e,r){if(e in Id)throw new RangeError("Duplicate use of selection JSON ID "+e);return Id[e]=r,r.prototype.jsonID=e,r}getBookmark(){return _e.between(this.$anchor,this.$head).getBookmark()}}Re.prototype.visible=!0;class iy{constructor(e,r){this.$from=e,this.$to=r}}let Fw=!1;function Bw(t){!Fw&&!t.parent.inlineContent&&(Fw=!0,console.warn("TextSelection endpoint not pointing into a node with inline content ("+t.parent.type.name+")"))}class _e extends Re{constructor(e,r=e){Bw(e),Bw(r),super(e,r)}get $cursor(){return this.$anchor.pos==this.$head.pos?this.$head:null}map(e,r){let n=e.resolve(r.map(this.head));if(!n.parent.inlineContent)return Re.near(n);let i=e.resolve(r.map(this.anchor));return new _e(i.parent.inlineContent?i:n,n)}replace(e,r=we.empty){if(super.replace(e,r),r==we.empty){let n=this.$from.marksAcross(this.$to);n&&e.ensureMarks(n)}}eq(e){return e instanceof _e&&e.anchor==this.anchor&&e.head==this.head}getBookmark(){return new Ef(this.anchor,this.head)}toJSON(){return{type:"text",anchor:this.anchor,head:this.head}}static fromJSON(e,r){if(typeof r.anchor!="number"||typeof r.head!="number")throw new RangeError("Invalid input for TextSelection.fromJSON");return new _e(e.resolve(r.anchor),e.resolve(r.head))}static create(e,r,n=r){let i=e.resolve(r);return new this(i,n==r?i:e.resolve(n))}static between(e,r,n){let i=e.pos-r.pos;if((!n||i)&&(n=i>=0?1:-1),!r.parent.inlineContent){let o=Re.findFrom(r,n,!0)||Re.findFrom(r,-n,!0);if(o)r=o.$head;else return Re.near(r,n)}return e.parent.inlineContent||(i==0?e=r:(e=(Re.findFrom(e,-n,!0)||Re.findFrom(e,n,!0)).$anchor,e.pos<r.pos!=i<0&&(e=r))),new _e(e,r)}}Re.jsonID("text",_e);class Ef{constructor(e,r){this.anchor=e,this.head=r}map(e){return new Ef(e.map(this.anchor),e.map(this.head))}resolve(e){return _e.between(e.resolve(this.anchor),e.resolve(this.head))}}class ke extends Re{constructor(e){let r=e.nodeAfter,n=e.node(0).resolve(e.pos+r.nodeSize);super(e,n),this.node=r}map(e,r){let{deleted:n,pos:i}=r.mapResult(this.anchor),o=e.resolve(i);return n?Re.near(o):new ke(o)}content(){return new we(he.from(this.node),0,0)}eq(e){return e instanceof ke&&e.anchor==this.anchor}toJSON(){return{type:"node",anchor:this.anchor}}getBookmark(){return new oy(this.anchor)}static fromJSON(e,r){if(typeof r.anchor!="number")throw new RangeError("Invalid input for NodeSelection.fromJSON");return new ke(e.resolve(r.anchor))}static create(e,r){return new ke(e.resolve(r))}static isSelectable(e){return!e.isText&&e.type.spec.selectable!==!1}}ke.prototype.visible=!1;Re.jsonID("node",ke);class oy{constructor(e){this.anchor=e}map(e){let{deleted:r,pos:n}=e.mapResult(this.anchor);return r?new Ef(n,n):new oy(n)}resolve(e){let r=e.resolve(this.anchor),n=r.nodeAfter;return n&&ke.isSelectable(n)?new ke(r):Re.near(r)}}class hr extends Re{constructor(e){super(e.resolve(0),e.resolve(e.content.size))}replace(e,r=we.empty){if(r==we.empty){e.delete(0,e.doc.content.size);let n=Re.atStart(e.doc);n.eq(e.selection)||e.setSelection(n)}else super.replace(e,r)}toJSON(){return{type:"all"}}static fromJSON(e){return new hr(e)}map(e){return new hr(e)}eq(e){return e instanceof hr}getBookmark(){return FN}}Re.jsonID("all",hr);const FN={map(){return this},resolve(t){return new hr(t)}};function Po(t,e,r,n,i,o=!1){if(e.inlineContent)return _e.create(t,r);for(let s=n-(i>0?0:1);i>0?s<e.childCount:s>=0;s+=i){let a=e.child(s);if(a.isAtom){if(!o&&ke.isSelectable(a))return ke.create(t,r-(i<0?a.nodeSize:0))}else{let l=Po(t,a,r+i,i<0?a.childCount:0,i,o);if(l)return l}r+=a.nodeSize*i}return null}function $w(t,e,r){let n=t.steps.length-1;if(n<e)return;let i=t.steps[n];if(!(i instanceof mt||i instanceof yt))return;let o=t.mapping.maps[n],s;o.forEach((a,l,c,u)=>{s==null&&(s=u)}),t.setSelection(Re.near(t.doc.resolve(s),r))}const jw=1,Rl=2,Hw=4;let BN=class extends ny{constructor(e){super(e.doc),this.curSelectionFor=0,this.updated=0,this.meta=Object.create(null),this.time=Date.now(),this.curSelection=e.selection,this.storedMarks=e.storedMarks}get selection(){return this.curSelectionFor<this.steps.length&&(this.curSelection=this.curSelection.map(this.doc,this.mapping.slice(this.curSelectionFor)),this.curSelectionFor=this.steps.length),this.curSelection}setSelection(e){if(e.$from.doc!=this.doc)throw new RangeError("Selection passed to setSelection must point at the current document");return this.curSelection=e,this.curSelectionFor=this.steps.length,this.updated=(this.updated|jw)&~Rl,this.storedMarks=null,this}get selectionSet(){return(this.updated&jw)>0}setStoredMarks(e){return this.storedMarks=e,this.updated|=Rl,this}ensureMarks(e){return We.sameSet(this.storedMarks||this.selection.$from.marks(),e)||this.setStoredMarks(e),this}addStoredMark(e){return this.ensureMarks(e.addToSet(this.storedMarks||this.selection.$head.marks()))}removeStoredMark(e){return this.ensureMarks(e.removeFromSet(this.storedMarks||this.selection.$head.marks()))}get storedMarksSet(){return(this.updated&Rl)>0}addStep(e,r){super.addStep(e,r),this.updated=this.updated&~Rl,this.storedMarks=null}setTime(e){return this.time=e,this}replaceSelection(e){return this.selection.replace(this,e),this}replaceSelectionWith(e,r=!0){let n=this.selection;return r&&(e=e.mark(this.storedMarks||(n.empty?n.$from.marks():n.$from.marksAcross(n.$to)||We.none))),n.replaceWith(this,e),this}deleteSelection(){return this.selection.replace(this),this}insertText(e,r,n){let i=this.doc.type.schema;if(r==null)return e?this.replaceSelectionWith(i.text(e),!0):this.deleteSelection();{if(n==null&&(n=r),n=n??r,!e)return this.deleteRange(r,n);let o=this.storedMarks;if(!o){let s=this.doc.resolve(r);o=n==r?s.marks():s.marksAcross(this.doc.resolve(n))}return this.replaceRangeWith(r,n,i.text(e,o)),this.selection.empty||this.setSelection(Re.near(this.selection.$to)),this}}setMeta(e,r){return this.meta[typeof e=="string"?e:e.key]=r,this}getMeta(e){return this.meta[typeof e=="string"?e:e.key]}get isGeneric(){for(let e in this.meta)return!1;return!0}scrollIntoView(){return this.updated|=Hw,this}get scrolledIntoView(){return(this.updated&Hw)>0}};function zw(t,e){return!e||!t?t:t.bind(e)}class oa{constructor(e,r,n){this.name=e,this.init=zw(r.init,n),this.apply=zw(r.apply,n)}}const $N=[new oa("doc",{init(t){return t.doc||t.schema.topNodeType.createAndFill()},apply(t){return t.doc}}),new oa("selection",{init(t,e){return t.selection||Re.atStart(e.doc)},apply(t){return t.selection}}),new oa("storedMarks",{init(t){return t.storedMarks||null},apply(t,e,r,n){return n.selection.$cursor?t.storedMarks:null}}),new oa("scrollToSelection",{init(){return 0},apply(t,e){return t.scrolledIntoView?e+1:e}})];class Nd{constructor(e,r){this.schema=e,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=$N.slice(),r&&r.forEach(n=>{if(this.pluginsByKey[n.key])throw new RangeError("Adding different instances of a keyed plugin ("+n.key+")");this.plugins.push(n),this.pluginsByKey[n.key]=n,n.spec.state&&this.fields.push(new oa(n.key,n.spec.state,n))})}}class Ho{constructor(e){this.config=e}get schema(){return this.config.schema}get plugins(){return this.config.plugins}apply(e){return this.applyTransaction(e).state}filterTransaction(e,r=-1){for(let n=0;n<this.config.plugins.length;n++)if(n!=r){let i=this.config.plugins[n];if(i.spec.filterTransaction&&!i.spec.filterTransaction.call(i,e,this))return!1}return!0}applyTransaction(e){if(!this.filterTransaction(e))return{state:this,transactions:[]};let r=[e],n=this.applyInner(e),i=null;for(;;){let o=!1;for(let s=0;s<this.config.plugins.length;s++){let a=this.config.plugins[s];if(a.spec.appendTransaction){let l=i?i[s].n:0,c=i?i[s].state:this,u=l<r.length&&a.spec.appendTransaction.call(a,l?r.slice(l):r,c,n);if(u&&n.filterTransaction(u,s)){if(u.setMeta("appendedTransaction",e),!i){i=[];for(let f=0;f<this.config.plugins.length;f++)i.push(f<s?{state:n,n:r.length}:{state:this,n:0})}r.push(u),n=n.applyInner(u),o=!0}i&&(i[s]={state:n,n:r.length})}}if(!o)return{state:n,transactions:r}}}applyInner(e){if(!e.before.eq(this.doc))throw new RangeError("Applying a mismatched transaction");let r=new Ho(this.config),n=this.config.fields;for(let i=0;i<n.length;i++){let o=n[i];r[o.name]=o.apply(e,this[o.name],this,r)}return r}get tr(){return new BN(this)}static create(e){let r=new Nd(e.doc?e.doc.type.schema:e.schema,e.plugins),n=new Ho(r);for(let i=0;i<r.fields.length;i++)n[r.fields[i].name]=r.fields[i].init(e,n);return n}reconfigure(e){let r=new Nd(this.schema,e.plugins),n=r.fields,i=new Ho(r);for(let o=0;o<n.length;o++){let s=n[o].name;i[s]=this.hasOwnProperty(s)?this[s]:n[o].init(e,i)}return i}toJSON(e){let r={doc:this.doc.toJSON(),selection:this.selection.toJSON()};if(this.storedMarks&&(r.storedMarks=this.storedMarks.map(n=>n.toJSON())),e&&typeof e=="object")for(let n in e){if(n=="doc"||n=="selection")throw new RangeError("The JSON fields `doc` and `selection` are reserved");let i=e[n],o=i.spec.state;o&&o.toJSON&&(r[n]=o.toJSON.call(i,this[i.key]))}return r}static fromJSON(e,r,n){if(!r)throw new RangeError("Invalid input for EditorState.fromJSON");if(!e.schema)throw new RangeError("Required config field 'schema' missing");let i=new Nd(e.schema,e.plugins),o=new Ho(i);return i.fields.forEach(s=>{if(s.name=="doc")o.doc=si.fromJSON(e.schema,r.doc);else if(s.name=="selection")o.selection=Re.fromJSON(o.doc,r.selection);else if(s.name=="storedMarks")r.storedMarks&&(o.storedMarks=r.storedMarks.map(e.schema.markFromJSON));else{if(n)for(let a in n){let l=n[a],c=l.spec.state;if(l.key==s.name&&c&&c.fromJSON&&Object.prototype.hasOwnProperty.call(r,a)){o[s.name]=c.fromJSON.call(l,e,r[a],o);return}}o[s.name]=s.init(e,o)}}),o}}function kT(t,e,r){for(let n in t){let i=t[n];i instanceof Function?i=i.bind(e):n=="handleDOMEvents"&&(i=kT(i,e,{})),r[n]=i}return r}class tt{constructor(e){this.spec=e,this.props={},e.props&&kT(e.props,this,this.props),this.key=e.key?e.key.key:_T("plugin")}getState(e){return e[this.key]}}const Dd=Object.create(null);function _T(t){return t in Dd?t+"$"+ ++Dd[t]:(Dd[t]=0,t+"$")}class et{constructor(e="key"){this.key=_T(e)}get(e){return e.config.pluginsByKey[this.key]}getState(e){return e[this.key]}}const Tt=function(t){for(var e=0;;e++)if(t=t.previousSibling,!t)return e},Ia=function(t){let e=t.assignedSlot||t.parentNode;return e&&e.nodeType==11?e.host:e};let em=null;const mn=function(t,e,r){let n=em||(em=document.createRange());return n.setEnd(t,r??t.nodeValue.length),n.setStart(t,e||0),n},jN=function(){em=null},Qi=function(t,e,r,n){return r&&(Uw(t,e,r,n,-1)||Uw(t,e,r,n,1))},HN=/^(img|br|input|textarea|hr)$/i;function Uw(t,e,r,n,i){for(;;){if(t==r&&e==n)return!0;if(e==(i<0?0:Hr(t))){let o=t.parentNode;if(!o||o.nodeType!=1||ll(t)||HN.test(t.nodeName)||t.contentEditable=="false")return!1;e=Tt(t)+(i<0?0:1),t=o}else if(t.nodeType==1){if(t=t.childNodes[e+(i<0?-1:0)],t.contentEditable=="false")return!1;e=i<0?Hr(t):0}else return!1}}function Hr(t){return t.nodeType==3?t.nodeValue.length:t.childNodes.length}function zN(t,e){for(;;){if(t.nodeType==3&&e)return t;if(t.nodeType==1&&e>0){if(t.contentEditable=="false")return null;t=t.childNodes[e-1],e=Hr(t)}else if(t.parentNode&&!ll(t))e=Tt(t),t=t.parentNode;else return null}}function UN(t,e){for(;;){if(t.nodeType==3&&e<t.nodeValue.length)return t;if(t.nodeType==1&&e<t.childNodes.length){if(t.contentEditable=="false")return null;t=t.childNodes[e],e=0}else if(t.parentNode&&!ll(t))e=Tt(t)+1,t=t.parentNode;else return null}}function WN(t,e,r){for(let n=e==0,i=e==Hr(t);n||i;){if(t==r)return!0;let o=Tt(t);if(t=t.parentNode,!t)return!1;n=n&&o==0,i=i&&o==Hr(t)}}function ll(t){let e;for(let r=t;r&&!(e=r.pmViewDesc);r=r.parentNode);return e&&e.node&&e.node.isBlock&&(e.dom==t||e.contentDOM==t)}const Tf=function(t){return t.focusNode&&Qi(t.focusNode,t.focusOffset,t.anchorNode,t.anchorOffset)};function Li(t,e){let r=document.createEvent("Event");return r.initEvent("keydown",!0,!0),r.keyCode=t,r.key=r.code=e,r}function VN(t){let e=t.activeElement;for(;e&&e.shadowRoot;)e=e.shadowRoot.activeElement;return e}function GN(t,e,r){if(t.caretPositionFromPoint)try{let n=t.caretPositionFromPoint(e,r);if(n)return{node:n.offsetNode,offset:n.offset}}catch{}if(t.caretRangeFromPoint){let n=t.caretRangeFromPoint(e,r);if(n)return{node:n.startContainer,offset:n.startOffset}}}const Xr=typeof navigator<"u"?navigator:null,Ww=typeof document<"u"?document:null,Ei=Xr&&Xr.userAgent||"",tm=/Edge\/(\d+)/.exec(Ei),OT=/MSIE \d/.exec(Ei),rm=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(Ei),qt=!!(OT||rm||tm),ai=OT?document.documentMode:rm?+rm[1]:tm?+tm[1]:0,Cr=!qt&&/gecko\/(\d+)/i.test(Ei);Cr&&+(/Firefox\/(\d+)/.exec(Ei)||[0,0])[1];const nm=!qt&&/Chrome\/(\d+)/.exec(Ei),Rt=!!nm,RT=nm?+nm[1]:0,Ht=!qt&&!!Xr&&/Apple Computer/.test(Xr.vendor),ss=Ht&&(/Mobile\/\w+/.test(Ei)||!!Xr&&Xr.maxTouchPoints>2),fr=ss||(Xr?/Mac/.test(Xr.platform):!1),KN=Xr?/Win/.test(Xr.platform):!1,Er=/Android \d/.test(Ei),cl=!!Ww&&"webkitFontSmoothing"in Ww.documentElement.style,qN=cl?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function XN(t){let e=t.defaultView&&t.defaultView.visualViewport;return e?{left:0,right:e.width,top:0,bottom:e.height}:{left:0,right:t.documentElement.clientWidth,top:0,bottom:t.documentElement.clientHeight}}function cn(t,e){return typeof t=="number"?t:t[e]}function JN(t){let e=t.getBoundingClientRect(),r=e.width/t.offsetWidth||1,n=e.height/t.offsetHeight||1;return{left:e.left,right:e.left+t.clientWidth*r,top:e.top,bottom:e.top+t.clientHeight*n}}function Vw(t,e,r){let n=t.someProp("scrollThreshold")||0,i=t.someProp("scrollMargin")||5,o=t.dom.ownerDocument;for(let s=r||t.dom;s;s=Ia(s)){if(s.nodeType!=1)continue;let a=s,l=a==o.body,c=l?XN(o):JN(a),u=0,f=0;if(e.top<c.top+cn(n,"top")?f=-(c.top-e.top+cn(i,"top")):e.bottom>c.bottom-cn(n,"bottom")&&(f=e.bottom-e.top>c.bottom-c.top?e.top+cn(i,"top")-c.top:e.bottom-c.bottom+cn(i,"bottom")),e.left<c.left+cn(n,"left")?u=-(c.left-e.left+cn(i,"left")):e.right>c.right-cn(n,"right")&&(u=e.right-c.right+cn(i,"right")),u||f)if(l)o.defaultView.scrollBy(u,f);else{let d=a.scrollLeft,h=a.scrollTop;f&&(a.scrollTop+=f),u&&(a.scrollLeft+=u);let p=a.scrollLeft-d,m=a.scrollTop-h;e={left:e.left-p,top:e.top-m,right:e.right-p,bottom:e.bottom-m}}if(l||/^(fixed|sticky)$/.test(getComputedStyle(s).position))break}}function YN(t){let e=t.dom.getBoundingClientRect(),r=Math.max(0,e.top),n,i;for(let o=(e.left+e.right)/2,s=r+1;s<Math.min(innerHeight,e.bottom);s+=5){let a=t.root.elementFromPoint(o,s);if(!a||a==t.dom||!t.dom.contains(a))continue;let l=a.getBoundingClientRect();if(l.top>=r-20){n=a,i=l.top;break}}return{refDOM:n,refTop:i,stack:MT(t.dom)}}function MT(t){let e=[],r=t.ownerDocument;for(let n=t;n&&(e.push({dom:n,top:n.scrollTop,left:n.scrollLeft}),t!=r);n=Ia(n));return e}function ZN({refDOM:t,refTop:e,stack:r}){let n=t?t.getBoundingClientRect().top:0;IT(r,n==0?0:n-e)}function IT(t,e){for(let r=0;r<t.length;r++){let{dom:n,top:i,left:o}=t[r];n.scrollTop!=i+e&&(n.scrollTop=i+e),n.scrollLeft!=o&&(n.scrollLeft=o)}}let Eo=null;function QN(t){if(t.setActive)return t.setActive();if(Eo)return t.focus(Eo);let e=MT(t);t.focus(Eo==null?{get preventScroll(){return Eo={preventScroll:!0},!0}}:void 0),Eo||(Eo=!1,IT(e,0))}function NT(t,e){let r,n=2e8,i,o=0,s=e.top,a=e.top,l,c;for(let u=t.firstChild,f=0;u;u=u.nextSibling,f++){let d;if(u.nodeType==1)d=u.getClientRects();else if(u.nodeType==3)d=mn(u).getClientRects();else continue;for(let h=0;h<d.length;h++){let p=d[h];if(p.top<=s&&p.bottom>=a){s=Math.max(p.bottom,s),a=Math.min(p.top,a);let m=p.left>e.left?p.left-e.left:p.right<e.left?e.left-p.right:0;if(m<n){r=u,n=m,i=m&&r.nodeType==3?{left:p.right<e.left?p.right:p.left,top:e.top}:e,u.nodeType==1&&m&&(o=f+(e.left>=(p.left+p.right)/2?1:0));continue}}else p.top>e.top&&!l&&p.left<=e.left&&p.right>=e.left&&(l=u,c={left:Math.max(p.left,Math.min(p.right,e.left)),top:p.top});!r&&(e.left>=p.right&&e.top>=p.top||e.left>=p.left&&e.top>=p.bottom)&&(o=f+1)}}return!r&&l&&(r=l,i=c,n=0),r&&r.nodeType==3?eD(r,i):!r||n&&r.nodeType==1?{node:t,offset:o}:NT(r,i)}function eD(t,e){let r=t.nodeValue.length,n=document.createRange();for(let i=0;i<r;i++){n.setEnd(t,i+1),n.setStart(t,i);let o=Un(n,1);if(o.top!=o.bottom&&sy(e,o))return{node:t,offset:i+(e.left>=(o.left+o.right)/2?1:0)}}return{node:t,offset:0}}function sy(t,e){return t.left>=e.left-1&&t.left<=e.right+1&&t.top>=e.top-1&&t.top<=e.bottom+1}function tD(t,e){let r=t.parentNode;return r&&/^li$/i.test(r.nodeName)&&e.left<t.getBoundingClientRect().left?r:t}function rD(t,e,r){let{node:n,offset:i}=NT(e,r),o=-1;if(n.nodeType==1&&!n.firstChild){let s=n.getBoundingClientRect();o=s.left!=s.right&&r.left>(s.left+s.right)/2?1:-1}return t.docView.posFromDOM(n,i,o)}function nD(t,e,r,n){let i=-1;for(let o=e,s=!1;o!=t.dom;){let a=t.docView.nearestDesc(o,!0);if(!a)return null;if(a.dom.nodeType==1&&(a.node.isBlock&&a.parent||!a.contentDOM)){let l=a.dom.getBoundingClientRect();if(a.node.isBlock&&a.parent&&(!s&&l.left>n.left||l.top>n.top?i=a.posBefore:(!s&&l.right<n.left||l.bottom<n.top)&&(i=a.posAfter),s=!0),!a.contentDOM&&i<0&&!a.node.isText)return(a.node.isBlock?n.top<(l.top+l.bottom)/2:n.left<(l.left+l.right)/2)?a.posBefore:a.posAfter}o=a.dom.parentNode}return i>-1?i:t.docView.posFromDOM(e,r,-1)}function DT(t,e,r){let n=t.childNodes.length;if(n&&r.top<r.bottom)for(let i=Math.max(0,Math.min(n-1,Math.floor(n*(e.top-r.top)/(r.bottom-r.top))-2)),o=i;;){let s=t.childNodes[o];if(s.nodeType==1){let a=s.getClientRects();for(let l=0;l<a.length;l++){let c=a[l];if(sy(e,c))return DT(s,e,c)}}if((o=(o+1)%n)==i)break}return t}function iD(t,e){let r=t.dom.ownerDocument,n,i=0,o=GN(r,e.left,e.top);o&&({node:n,offset:i}=o);let s=(t.root.elementFromPoint?t.root:r).elementFromPoint(e.left,e.top),a;if(!s||!t.dom.contains(s.nodeType!=1?s.parentNode:s)){let c=t.dom.getBoundingClientRect();if(!sy(e,c)||(s=DT(t.dom,e,c),!s))return null}if(Ht)for(let c=s;n&&c;c=Ia(c))c.draggable&&(n=void 0);if(s=tD(s,e),n){if(Cr&&n.nodeType==1&&(i=Math.min(i,n.childNodes.length),i<n.childNodes.length)){let u=n.childNodes[i],f;u.nodeName=="IMG"&&(f=u.getBoundingClientRect()).right<=e.left&&f.bottom>e.top&&i++}let c;cl&&i&&n.nodeType==1&&(c=n.childNodes[i-1]).nodeType==1&&c.contentEditable=="false"&&c.getBoundingClientRect().top>=e.top&&i--,n==t.dom&&i==n.childNodes.length-1&&n.lastChild.nodeType==1&&e.top>n.lastChild.getBoundingClientRect().bottom?a=t.state.doc.content.size:(i==0||n.nodeType!=1||n.childNodes[i-1].nodeName!="BR")&&(a=nD(t,n,i,e))}a==null&&(a=rD(t,s,e));let l=t.docView.nearestDesc(s,!0);return{pos:a,inside:l?l.posAtStart-l.border:-1}}function Gw(t){return t.top<t.bottom||t.left<t.right}function Un(t,e){let r=t.getClientRects();if(r.length){let n=r[e<0?0:r.length-1];if(Gw(n))return n}return Array.prototype.find.call(r,Gw)||t.getBoundingClientRect()}const oD=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;function PT(t,e,r){let{node:n,offset:i,atom:o}=t.docView.domFromPos(e,r<0?-1:1),s=cl||Cr;if(n.nodeType==3)if(s&&(oD.test(n.nodeValue)||(r<0?!i:i==n.nodeValue.length))){let l=Un(mn(n,i,i),r);if(Cr&&i&&/\s/.test(n.nodeValue[i-1])&&i<n.nodeValue.length){let c=Un(mn(n,i-1,i-1),-1);if(c.top==l.top){let u=Un(mn(n,i,i+1),-1);if(u.top!=l.top)return Ws(u,u.left<c.left)}}return l}else{let l=i,c=i,u=r<0?1:-1;return r<0&&!i?(c++,u=-1):r>=0&&i==n.nodeValue.length?(l--,u=1):r<0?l--:c++,Ws(Un(mn(n,l,c),u),u<0)}if(!t.state.doc.resolve(e-(o||0)).parent.inlineContent){if(o==null&&i&&(r<0||i==Hr(n))){let l=n.childNodes[i-1];if(l.nodeType==1)return Pd(l.getBoundingClientRect(),!1)}if(o==null&&i<Hr(n)){let l=n.childNodes[i];if(l.nodeType==1)return Pd(l.getBoundingClientRect(),!0)}return Pd(n.getBoundingClientRect(),r>=0)}if(o==null&&i&&(r<0||i==Hr(n))){let l=n.childNodes[i-1],c=l.nodeType==3?mn(l,Hr(l)-(s?0:1)):l.nodeType==1&&(l.nodeName!="BR"||!l.nextSibling)?l:null;if(c)return Ws(Un(c,1),!1)}if(o==null&&i<Hr(n)){let l=n.childNodes[i];for(;l.pmViewDesc&&l.pmViewDesc.ignoreForCoords;)l=l.nextSibling;let c=l?l.nodeType==3?mn(l,0,s?0:1):l.nodeType==1?l:null:null;if(c)return Ws(Un(c,-1),!0)}return Ws(Un(n.nodeType==3?mn(n):n,-r),r>=0)}function Ws(t,e){if(t.width==0)return t;let r=e?t.left:t.right;return{top:t.top,bottom:t.bottom,left:r,right:r}}function Pd(t,e){if(t.height==0)return t;let r=e?t.top:t.bottom;return{top:r,bottom:r,left:t.left,right:t.right}}function LT(t,e,r){let n=t.state,i=t.root.activeElement;n!=e&&t.updateState(e),i!=t.dom&&t.focus();try{return r()}finally{n!=e&&t.updateState(n),i!=t.dom&&i&&i.focus()}}function sD(t,e,r){let n=e.selection,i=r=="up"?n.$from:n.$to;return LT(t,e,()=>{let{node:o}=t.docView.domFromPos(i.pos,r=="up"?-1:1);for(;;){let a=t.docView.nearestDesc(o,!0);if(!a)break;if(a.node.isBlock){o=a.contentDOM||a.dom;break}o=a.dom.parentNode}let s=PT(t,i.pos,1);for(let a=o.firstChild;a;a=a.nextSibling){let l;if(a.nodeType==1)l=a.getClientRects();else if(a.nodeType==3)l=mn(a,0,a.nodeValue.length).getClientRects();else continue;for(let c=0;c<l.length;c++){let u=l[c];if(u.bottom>u.top+1&&(r=="up"?s.top-u.top>(u.bottom-s.top)*2:u.bottom-s.bottom>(s.bottom-u.top)*2))return!1}}return!0})}const aD=/[\u0590-\u08ac]/;function lD(t,e,r){let{$head:n}=e.selection;if(!n.parent.isTextblock)return!1;let i=n.parentOffset,o=!i,s=i==n.parent.content.size,a=t.domSelection();return a?!aD.test(n.parent.textContent)||!a.modify?r=="left"||r=="backward"?o:s:LT(t,e,()=>{let{focusNode:l,focusOffset:c,anchorNode:u,anchorOffset:f}=t.domSelectionRange(),d=a.caretBidiLevel;a.modify("move",r,"character");let h=n.depth?t.docView.domAfterPos(n.before()):t.dom,{focusNode:p,focusOffset:m}=t.domSelectionRange(),y=p&&!h.contains(p.nodeType==1?p:p.parentNode)||l==p&&c==m;try{a.collapse(u,f),l&&(l!=u||c!=f)&&a.extend&&a.extend(l,c)}catch{}return d!=null&&(a.caretBidiLevel=d),y}):n.pos==n.start()||n.pos==n.end()}let Kw=null,qw=null,Xw=!1;function cD(t,e,r){return Kw==e&&qw==r?Xw:(Kw=e,qw=r,Xw=r=="up"||r=="down"?sD(t,e,r):lD(t,e,r))}const pr=0,Jw=1,Bi=2,Jr=3;class ul{constructor(e,r,n,i){this.parent=e,this.children=r,this.dom=n,this.contentDOM=i,this.dirty=pr,n.pmViewDesc=this}matchesWidget(e){return!1}matchesMark(e){return!1}matchesNode(e,r,n){return!1}matchesHack(e){return!1}parseRule(){return null}stopEvent(e){return!1}get size(){let e=0;for(let r=0;r<this.children.length;r++)e+=this.children[r].size;return e}get border(){return 0}destroy(){this.parent=void 0,this.dom.pmViewDesc==this&&(this.dom.pmViewDesc=void 0);for(let e=0;e<this.children.length;e++)this.children[e].destroy()}posBeforeChild(e){for(let r=0,n=this.posAtStart;;r++){let i=this.children[r];if(i==e)return n;n+=i.size}}get posBefore(){return this.parent.posBeforeChild(this)}get posAtStart(){return this.parent?this.parent.posBeforeChild(this)+this.border:0}get posAfter(){return this.posBefore+this.size}get posAtEnd(){return this.posAtStart+this.size-2*this.border}localPosFromDOM(e,r,n){if(this.contentDOM&&this.contentDOM.contains(e.nodeType==1?e:e.parentNode))if(n<0){let o,s;if(e==this.contentDOM)o=e.childNodes[r-1];else{for(;e.parentNode!=this.contentDOM;)e=e.parentNode;o=e.previousSibling}for(;o&&!((s=o.pmViewDesc)&&s.parent==this);)o=o.previousSibling;return o?this.posBeforeChild(s)+s.size:this.posAtStart}else{let o,s;if(e==this.contentDOM)o=e.childNodes[r];else{for(;e.parentNode!=this.contentDOM;)e=e.parentNode;o=e.nextSibling}for(;o&&!((s=o.pmViewDesc)&&s.parent==this);)o=o.nextSibling;return o?this.posBeforeChild(s):this.posAtEnd}let i;if(e==this.dom&&this.contentDOM)i=r>Tt(this.contentDOM);else if(this.contentDOM&&this.contentDOM!=this.dom&&this.dom.contains(this.contentDOM))i=e.compareDocumentPosition(this.contentDOM)&2;else if(this.dom.firstChild){if(r==0)for(let o=e;;o=o.parentNode){if(o==this.dom){i=!1;break}if(o.previousSibling)break}if(i==null&&r==e.childNodes.length)for(let o=e;;o=o.parentNode){if(o==this.dom){i=!0;break}if(o.nextSibling)break}}return i??n>0?this.posAtEnd:this.posAtStart}nearestDesc(e,r=!1){for(let n=!0,i=e;i;i=i.parentNode){let o=this.getDesc(i),s;if(o&&(!r||o.node))if(n&&(s=o.nodeDOM)&&!(s.nodeType==1?s.contains(e.nodeType==1?e:e.parentNode):s==e))n=!1;else return o}}getDesc(e){let r=e.pmViewDesc;for(let n=r;n;n=n.parent)if(n==this)return r}posFromDOM(e,r,n){for(let i=e;i;i=i.parentNode){let o=this.getDesc(i);if(o)return o.localPosFromDOM(e,r,n)}return-1}descAt(e){for(let r=0,n=0;r<this.children.length;r++){let i=this.children[r],o=n+i.size;if(n==e&&o!=n){for(;!i.border&&i.children.length;)i=i.children[0];return i}if(e<o)return i.descAt(e-n-i.border);n=o}}domFromPos(e,r){if(!this.contentDOM)return{node:this.dom,offset:0,atom:e+1};let n=0,i=0;for(let o=0;n<this.children.length;n++){let s=this.children[n],a=o+s.size;if(a>e||s instanceof BT){i=e-o;break}o=a}if(i)return this.children[n].domFromPos(i-this.children[n].border,r);for(let o;n&&!(o=this.children[n-1]).size&&o instanceof FT&&o.side>=0;n--);if(r<=0){let o,s=!0;for(;o=n?this.children[n-1]:null,!(!o||o.dom.parentNode==this.contentDOM);n--,s=!1);return o&&r&&s&&!o.border&&!o.domAtom?o.domFromPos(o.size,r):{node:this.contentDOM,offset:o?Tt(o.dom)+1:0}}else{let o,s=!0;for(;o=n<this.children.length?this.children[n]:null,!(!o||o.dom.parentNode==this.contentDOM);n++,s=!1);return o&&s&&!o.border&&!o.domAtom?o.domFromPos(0,r):{node:this.contentDOM,offset:o?Tt(o.dom):this.contentDOM.childNodes.length}}}parseRange(e,r,n=0){if(this.children.length==0)return{node:this.contentDOM,from:e,to:r,fromOffset:0,toOffset:this.contentDOM.childNodes.length};let i=-1,o=-1;for(let s=n,a=0;;a++){let l=this.children[a],c=s+l.size;if(i==-1&&e<=c){let u=s+l.border;if(e>=u&&r<=c-l.border&&l.node&&l.contentDOM&&this.contentDOM.contains(l.contentDOM))return l.parseRange(e,r,u);e=s;for(let f=a;f>0;f--){let d=this.children[f-1];if(d.size&&d.dom.parentNode==this.contentDOM&&!d.emptyChildAt(1)){i=Tt(d.dom)+1;break}e-=d.size}i==-1&&(i=0)}if(i>-1&&(c>r||a==this.children.length-1)){r=c;for(let u=a+1;u<this.children.length;u++){let f=this.children[u];if(f.size&&f.dom.parentNode==this.contentDOM&&!f.emptyChildAt(-1)){o=Tt(f.dom);break}r+=f.size}o==-1&&(o=this.contentDOM.childNodes.length);break}s=c}return{node:this.contentDOM,from:e,to:r,fromOffset:i,toOffset:o}}emptyChildAt(e){if(this.border||!this.contentDOM||!this.children.length)return!1;let r=this.children[e<0?0:this.children.length-1];return r.size==0||r.emptyChildAt(e)}domAfterPos(e){let{node:r,offset:n}=this.domFromPos(e,0);if(r.nodeType!=1||n==r.childNodes.length)throw new RangeError("No node after pos "+e);return r.childNodes[n]}setSelection(e,r,n,i=!1){let o=Math.min(e,r),s=Math.max(e,r);for(let d=0,h=0;d<this.children.length;d++){let p=this.children[d],m=h+p.size;if(o>h&&s<m)return p.setSelection(e-h-p.border,r-h-p.border,n,i);h=m}let a=this.domFromPos(e,e?-1:1),l=r==e?a:this.domFromPos(r,r?-1:1),c=n.getSelection(),u=!1;if((Cr||Ht)&&e==r){let{node:d,offset:h}=a;if(d.nodeType==3){if(u=!!(h&&d.nodeValue[h-1]==`
6
- `),u&&h==d.nodeValue.length)for(let p=d,m;p;p=p.parentNode){if(m=p.nextSibling){m.nodeName=="BR"&&(a=l={node:m.parentNode,offset:Tt(m)+1});break}let y=p.pmViewDesc;if(y&&y.node&&y.node.isBlock)break}}else{let p=d.childNodes[h-1];u=p&&(p.nodeName=="BR"||p.contentEditable=="false")}}if(Cr&&c.focusNode&&c.focusNode!=l.node&&c.focusNode.nodeType==1){let d=c.focusNode.childNodes[c.focusOffset];d&&d.contentEditable=="false"&&(i=!0)}if(!(i||u&&Ht)&&Qi(a.node,a.offset,c.anchorNode,c.anchorOffset)&&Qi(l.node,l.offset,c.focusNode,c.focusOffset))return;let f=!1;if((c.extend||e==r)&&!u){c.collapse(a.node,a.offset);try{e!=r&&c.extend(l.node,l.offset),f=!0}catch{}}if(!f){if(e>r){let h=a;a=l,l=h}let d=document.createRange();d.setEnd(l.node,l.offset),d.setStart(a.node,a.offset),c.removeAllRanges(),c.addRange(d)}}ignoreMutation(e){return!this.contentDOM&&e.type!="selection"}get contentLost(){return this.contentDOM&&this.contentDOM!=this.dom&&!this.dom.contains(this.contentDOM)}markDirty(e,r){for(let n=0,i=0;i<this.children.length;i++){let o=this.children[i],s=n+o.size;if(n==s?e<=s&&r>=n:e<s&&r>n){let a=n+o.border,l=s-o.border;if(e>=a&&r<=l){this.dirty=e==n||r==s?Bi:Jw,e==a&&r==l&&(o.contentLost||o.dom.parentNode!=this.contentDOM)?o.dirty=Jr:o.markDirty(e-a,r-a);return}else o.dirty=o.dom==o.contentDOM&&o.dom.parentNode==this.contentDOM&&!o.children.length?Bi:Jr}n=s}this.dirty=Bi}markParentsDirty(){let e=1;for(let r=this.parent;r;r=r.parent,e++){let n=e==1?Bi:Jw;r.dirty<n&&(r.dirty=n)}}get domAtom(){return!1}get ignoreForCoords(){return!1}isText(e){return!1}}class FT extends ul{constructor(e,r,n,i){let o,s=r.type.toDOM;if(typeof s=="function"&&(s=s(n,()=>{if(!o)return i;if(o.parent)return o.parent.posBeforeChild(o)})),!r.type.spec.raw){if(s.nodeType!=1){let a=document.createElement("span");a.appendChild(s),s=a}s.contentEditable="false",s.classList.add("ProseMirror-widget")}super(e,[],s,null),this.widget=r,this.widget=r,o=this}matchesWidget(e){return this.dirty==pr&&e.type.eq(this.widget.type)}parseRule(){return{ignore:!0}}stopEvent(e){let r=this.widget.spec.stopEvent;return r?r(e):!1}ignoreMutation(e){return e.type!="selection"||this.widget.spec.ignoreSelection}destroy(){this.widget.type.destroy(this.dom),super.destroy()}get domAtom(){return!0}get side(){return this.widget.type.side}}class uD extends ul{constructor(e,r,n,i){super(e,[],r,null),this.textDOM=n,this.text=i}get size(){return this.text.length}localPosFromDOM(e,r){return e!=this.textDOM?this.posAtStart+(r?this.size:0):this.posAtStart+r}domFromPos(e){return{node:this.textDOM,offset:e}}ignoreMutation(e){return e.type==="characterData"&&e.target.nodeValue==e.oldValue}}class eo extends ul{constructor(e,r,n,i){super(e,[],n,i),this.mark=r}static create(e,r,n,i){let o=i.nodeViews[r.type.name],s=o&&o(r,i,n);return(!s||!s.dom)&&(s=uo.renderSpec(document,r.type.spec.toDOM(r,n),null,r.attrs)),new eo(e,r,s.dom,s.contentDOM||s.dom)}parseRule(){return this.dirty&Jr||this.mark.type.spec.reparseInView?null:{mark:this.mark.type.name,attrs:this.mark.attrs,contentElement:this.contentDOM}}matchesMark(e){return this.dirty!=Jr&&this.mark.eq(e)}markDirty(e,r){if(super.markDirty(e,r),this.dirty!=pr){let n=this.parent;for(;!n.node;)n=n.parent;n.dirty<this.dirty&&(n.dirty=this.dirty),this.dirty=pr}}slice(e,r,n){let i=eo.create(this.parent,this.mark,!0,n),o=this.children,s=this.size;r<s&&(o=sm(o,r,s,n)),e>0&&(o=sm(o,0,e,n));for(let a=0;a<o.length;a++)o[a].parent=i;return i.children=o,i}}class li extends ul{constructor(e,r,n,i,o,s,a,l,c){super(e,[],o,s),this.node=r,this.outerDeco=n,this.innerDeco=i,this.nodeDOM=a}static create(e,r,n,i,o,s){let a=o.nodeViews[r.type.name],l,c=a&&a(r,o,()=>{if(!l)return s;if(l.parent)return l.parent.posBeforeChild(l)},n,i),u=c&&c.dom,f=c&&c.contentDOM;if(r.isText){if(!u)u=document.createTextNode(r.text);else if(u.nodeType!=3)throw new RangeError("Text must be rendered as a DOM text node")}else u||({dom:u,contentDOM:f}=uo.renderSpec(document,r.type.spec.toDOM(r),null,r.attrs));!f&&!r.isText&&u.nodeName!="BR"&&(u.hasAttribute("contenteditable")||(u.contentEditable="false"),r.type.spec.draggable&&(u.draggable=!0));let d=u;return u=HT(u,n,r),c?l=new fD(e,r,n,i,u,f||null,d,c,o,s+1):r.isText?new Af(e,r,n,i,u,d,o):new li(e,r,n,i,u,f||null,d,o,s+1)}parseRule(){if(this.node.type.spec.reparseInView)return null;let e={node:this.node.type.name,attrs:this.node.attrs};if(this.node.type.whitespace=="pre"&&(e.preserveWhitespace="full"),!this.contentDOM)e.getContent=()=>this.node.content;else if(!this.contentLost)e.contentElement=this.contentDOM;else{for(let r=this.children.length-1;r>=0;r--){let n=this.children[r];if(this.dom.contains(n.dom.parentNode)){e.contentElement=n.dom.parentNode;break}}e.contentElement||(e.getContent=()=>he.empty)}return e}matchesNode(e,r,n){return this.dirty==pr&&e.eq(this.node)&&om(r,this.outerDeco)&&n.eq(this.innerDeco)}get size(){return this.node.nodeSize}get border(){return this.node.isLeaf?0:1}updateChildren(e,r){let n=this.node.inlineContent,i=r,o=e.composing?this.localCompositionInfo(e,r):null,s=o&&o.pos>-1?o:null,a=o&&o.pos<0,l=new hD(this,s&&s.node,e);gD(this.node,this.innerDeco,(c,u,f)=>{c.spec.marks?l.syncToMarks(c.spec.marks,n,e):c.type.side>=0&&!f&&l.syncToMarks(u==this.node.childCount?We.none:this.node.child(u).marks,n,e),l.placeWidget(c,e,i)},(c,u,f,d)=>{l.syncToMarks(c.marks,n,e);let h;l.findNodeMatch(c,u,f,d)||a&&e.state.selection.from>i&&e.state.selection.to<i+c.nodeSize&&(h=l.findIndexWithChild(o.node))>-1&&l.updateNodeAt(c,u,f,h,e)||l.updateNextNode(c,u,f,e,d,i)||l.addNode(c,u,f,e,i),i+=c.nodeSize}),l.syncToMarks([],n,e),this.node.isTextblock&&l.addTextblockHacks(),l.destroyRest(),(l.changed||this.dirty==Bi)&&(s&&this.protectLocalComposition(e,s),$T(this.contentDOM,this.children,e),ss&&yD(this.dom))}localCompositionInfo(e,r){let{from:n,to:i}=e.state.selection;if(!(e.state.selection instanceof _e)||n<r||i>r+this.node.content.size)return null;let o=e.input.compositionNode;if(!o||!this.dom.contains(o.parentNode))return null;if(this.node.inlineContent){let s=o.nodeValue,a=vD(this.node.content,s,n-r,i-r);return a<0?null:{node:o,pos:a,text:s}}else return{node:o,pos:-1,text:""}}protectLocalComposition(e,{node:r,pos:n,text:i}){if(this.getDesc(r))return;let o=r;for(;o.parentNode!=this.contentDOM;o=o.parentNode){for(;o.previousSibling;)o.parentNode.removeChild(o.previousSibling);for(;o.nextSibling;)o.parentNode.removeChild(o.nextSibling);o.pmViewDesc&&(o.pmViewDesc=void 0)}let s=new uD(this,o,r,i);e.input.compositionNodes.push(s),this.children=sm(this.children,n,n+i.length,e,s)}update(e,r,n,i){return this.dirty==Jr||!e.sameMarkup(this.node)?!1:(this.updateInner(e,r,n,i),!0)}updateInner(e,r,n,i){this.updateOuterDeco(r),this.node=e,this.innerDeco=n,this.contentDOM&&this.updateChildren(i,this.posAtStart),this.dirty=pr}updateOuterDeco(e){if(om(e,this.outerDeco))return;let r=this.nodeDOM.nodeType!=1,n=this.dom;this.dom=jT(this.dom,this.nodeDOM,im(this.outerDeco,this.node,r),im(e,this.node,r)),this.dom!=n&&(n.pmViewDesc=void 0,this.dom.pmViewDesc=this),this.outerDeco=e}selectNode(){this.nodeDOM.nodeType==1&&this.nodeDOM.classList.add("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&(this.dom.draggable=!0)}deselectNode(){this.nodeDOM.nodeType==1&&(this.nodeDOM.classList.remove("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&this.dom.removeAttribute("draggable"))}get domAtom(){return this.node.isAtom}}function Yw(t,e,r,n,i){HT(n,e,t);let o=new li(void 0,t,e,r,n,n,n,i,0);return o.contentDOM&&o.updateChildren(i,0),o}class Af extends li{constructor(e,r,n,i,o,s,a){super(e,r,n,i,o,null,s,a,0)}parseRule(){let e=this.nodeDOM.parentNode;for(;e&&e!=this.dom&&!e.pmIsDeco;)e=e.parentNode;return{skip:e||!0}}update(e,r,n,i){return this.dirty==Jr||this.dirty!=pr&&!this.inParent()||!e.sameMarkup(this.node)?!1:(this.updateOuterDeco(r),(this.dirty!=pr||e.text!=this.node.text)&&e.text!=this.nodeDOM.nodeValue&&(this.nodeDOM.nodeValue=e.text,i.trackWrites==this.nodeDOM&&(i.trackWrites=null)),this.node=e,this.dirty=pr,!0)}inParent(){let e=this.parent.contentDOM;for(let r=this.nodeDOM;r;r=r.parentNode)if(r==e)return!0;return!1}domFromPos(e){return{node:this.nodeDOM,offset:e}}localPosFromDOM(e,r,n){return e==this.nodeDOM?this.posAtStart+Math.min(r,this.node.text.length):super.localPosFromDOM(e,r,n)}ignoreMutation(e){return e.type!="characterData"&&e.type!="selection"}slice(e,r,n){let i=this.node.cut(e,r),o=document.createTextNode(i.text);return new Af(this.parent,i,this.outerDeco,this.innerDeco,o,o,n)}markDirty(e,r){super.markDirty(e,r),this.dom!=this.nodeDOM&&(e==0||r==this.nodeDOM.nodeValue.length)&&(this.dirty=Jr)}get domAtom(){return!1}isText(e){return this.node.text==e}}class BT extends ul{parseRule(){return{ignore:!0}}matchesHack(e){return this.dirty==pr&&this.dom.nodeName==e}get domAtom(){return!0}get ignoreForCoords(){return this.dom.nodeName=="IMG"}}class fD extends li{constructor(e,r,n,i,o,s,a,l,c,u){super(e,r,n,i,o,s,a,c,u),this.spec=l}update(e,r,n,i){if(this.dirty==Jr)return!1;if(this.spec.update){let o=this.spec.update(e,r,n);return o&&this.updateInner(e,r,n,i),o}else return!this.contentDOM&&!e.isLeaf?!1:super.update(e,r,n,i)}selectNode(){this.spec.selectNode?this.spec.selectNode():super.selectNode()}deselectNode(){this.spec.deselectNode?this.spec.deselectNode():super.deselectNode()}setSelection(e,r,n,i){this.spec.setSelection?this.spec.setSelection(e,r,n):super.setSelection(e,r,n,i)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}stopEvent(e){return this.spec.stopEvent?this.spec.stopEvent(e):!1}ignoreMutation(e){return this.spec.ignoreMutation?this.spec.ignoreMutation(e):super.ignoreMutation(e)}}function $T(t,e,r){let n=t.firstChild,i=!1;for(let o=0;o<e.length;o++){let s=e[o],a=s.dom;if(a.parentNode==t){for(;a!=n;)n=Zw(n),i=!0;n=n.nextSibling}else i=!0,t.insertBefore(a,n);if(s instanceof eo){let l=n?n.previousSibling:t.lastChild;$T(s.contentDOM,s.children,r),n=l?l.nextSibling:t.firstChild}}for(;n;)n=Zw(n),i=!0;i&&r.trackWrites==t&&(r.trackWrites=null)}const ha=function(t){t&&(this.nodeName=t)};ha.prototype=Object.create(null);const $i=[new ha];function im(t,e,r){if(t.length==0)return $i;let n=r?$i[0]:new ha,i=[n];for(let o=0;o<t.length;o++){let s=t[o].type.attrs;if(s){s.nodeName&&i.push(n=new ha(s.nodeName));for(let a in s){let l=s[a];l!=null&&(r&&i.length==1&&i.push(n=new ha(e.isInline?"span":"div")),a=="class"?n.class=(n.class?n.class+" ":"")+l:a=="style"?n.style=(n.style?n.style+";":"")+l:a!="nodeName"&&(n[a]=l))}}}return i}function jT(t,e,r,n){if(r==$i&&n==$i)return e;let i=e;for(let o=0;o<n.length;o++){let s=n[o],a=r[o];if(o){let l;a&&a.nodeName==s.nodeName&&i!=t&&(l=i.parentNode)&&l.nodeName.toLowerCase()==s.nodeName||(l=document.createElement(s.nodeName),l.pmIsDeco=!0,l.appendChild(i),a=$i[0]),i=l}dD(i,a||$i[0],s)}return i}function dD(t,e,r){for(let n in e)n!="class"&&n!="style"&&n!="nodeName"&&!(n in r)&&t.removeAttribute(n);for(let n in r)n!="class"&&n!="style"&&n!="nodeName"&&r[n]!=e[n]&&t.setAttribute(n,r[n]);if(e.class!=r.class){let n=e.class?e.class.split(" ").filter(Boolean):[],i=r.class?r.class.split(" ").filter(Boolean):[];for(let o=0;o<n.length;o++)i.indexOf(n[o])==-1&&t.classList.remove(n[o]);for(let o=0;o<i.length;o++)n.indexOf(i[o])==-1&&t.classList.add(i[o]);t.classList.length==0&&t.removeAttribute("class")}if(e.style!=r.style){if(e.style){let n=/\s*([\w\-\xa1-\uffff]+)\s*:(?:"(?:\\.|[^"])*"|'(?:\\.|[^'])*'|\(.*?\)|[^;])*/g,i;for(;i=n.exec(e.style);)t.style.removeProperty(i[1])}r.style&&(t.style.cssText+=r.style)}}function HT(t,e,r){return jT(t,t,$i,im(e,r,t.nodeType!=1))}function om(t,e){if(t.length!=e.length)return!1;for(let r=0;r<t.length;r++)if(!t[r].type.eq(e[r].type))return!1;return!0}function Zw(t){let e=t.nextSibling;return t.parentNode.removeChild(t),e}class hD{constructor(e,r,n){this.lock=r,this.view=n,this.index=0,this.stack=[],this.changed=!1,this.top=e,this.preMatch=pD(e.node.content,e)}destroyBetween(e,r){if(e!=r){for(let n=e;n<r;n++)this.top.children[n].destroy();this.top.children.splice(e,r-e),this.changed=!0}}destroyRest(){this.destroyBetween(this.index,this.top.children.length)}syncToMarks(e,r,n){let i=0,o=this.stack.length>>1,s=Math.min(o,e.length);for(;i<s&&(i==o-1?this.top:this.stack[i+1<<1]).matchesMark(e[i])&&e[i].type.spec.spanning!==!1;)i++;for(;i<o;)this.destroyRest(),this.top.dirty=pr,this.index=this.stack.pop(),this.top=this.stack.pop(),o--;for(;o<e.length;){this.stack.push(this.top,this.index+1);let a=-1;for(let l=this.index;l<Math.min(this.index+3,this.top.children.length);l++){let c=this.top.children[l];if(c.matchesMark(e[o])&&!this.isLocked(c.dom)){a=l;break}}if(a>-1)a>this.index&&(this.changed=!0,this.destroyBetween(this.index,a)),this.top=this.top.children[this.index];else{let l=eo.create(this.top,e[o],r,n);this.top.children.splice(this.index,0,l),this.top=l,this.changed=!0}this.index=0,o++}}findNodeMatch(e,r,n,i){let o=-1,s;if(i>=this.preMatch.index&&(s=this.preMatch.matches[i-this.preMatch.index]).parent==this.top&&s.matchesNode(e,r,n))o=this.top.children.indexOf(s,this.index);else for(let a=this.index,l=Math.min(this.top.children.length,a+5);a<l;a++){let c=this.top.children[a];if(c.matchesNode(e,r,n)&&!this.preMatch.matched.has(c)){o=a;break}}return o<0?!1:(this.destroyBetween(this.index,o),this.index++,!0)}updateNodeAt(e,r,n,i,o){let s=this.top.children[i];return s.dirty==Jr&&s.dom==s.contentDOM&&(s.dirty=Bi),s.update(e,r,n,o)?(this.destroyBetween(this.index,i),this.index++,!0):!1}findIndexWithChild(e){for(;;){let r=e.parentNode;if(!r)return-1;if(r==this.top.contentDOM){let n=e.pmViewDesc;if(n){for(let i=this.index;i<this.top.children.length;i++)if(this.top.children[i]==n)return i}return-1}e=r}}updateNextNode(e,r,n,i,o,s){for(let a=this.index;a<this.top.children.length;a++){let l=this.top.children[a];if(l instanceof li){let c=this.preMatch.matched.get(l);if(c!=null&&c!=o)return!1;let u=l.dom,f,d=this.isLocked(u)&&!(e.isText&&l.node&&l.node.isText&&l.nodeDOM.nodeValue==e.text&&l.dirty!=Jr&&om(r,l.outerDeco));if(!d&&l.update(e,r,n,i))return this.destroyBetween(this.index,a),l.dom!=u&&(this.changed=!0),this.index++,!0;if(!d&&(f=this.recreateWrapper(l,e,r,n,i,s)))return this.top.children[this.index]=f,f.contentDOM&&(f.dirty=Bi,f.updateChildren(i,s+1),f.dirty=pr),this.changed=!0,this.index++,!0;break}}return!1}recreateWrapper(e,r,n,i,o,s){if(e.dirty||r.isAtom||!e.children.length||!e.node.content.eq(r.content))return null;let a=li.create(this.top,r,n,i,o,s);if(a.contentDOM){a.children=e.children,e.children=[];for(let l of a.children)l.parent=a}return e.destroy(),a}addNode(e,r,n,i,o){let s=li.create(this.top,e,r,n,i,o);s.contentDOM&&s.updateChildren(i,o+1),this.top.children.splice(this.index++,0,s),this.changed=!0}placeWidget(e,r,n){let i=this.index<this.top.children.length?this.top.children[this.index]:null;if(i&&i.matchesWidget(e)&&(e==i.widget||!i.widget.type.toDOM.parentNode))this.index++;else{let o=new FT(this.top,e,r,n);this.top.children.splice(this.index++,0,o),this.changed=!0}}addTextblockHacks(){let e=this.top.children[this.index-1],r=this.top;for(;e instanceof eo;)r=e,e=r.children[r.children.length-1];(!e||!(e instanceof Af)||/\n$/.test(e.node.text)||this.view.requiresGeckoHackNode&&/\s$/.test(e.node.text))&&((Ht||Rt)&&e&&e.dom.contentEditable=="false"&&this.addHackNode("IMG",r),this.addHackNode("BR",this.top))}addHackNode(e,r){if(r==this.top&&this.index<r.children.length&&r.children[this.index].matchesHack(e))this.index++;else{let n=document.createElement(e);e=="IMG"&&(n.className="ProseMirror-separator",n.alt=""),e=="BR"&&(n.className="ProseMirror-trailingBreak");let i=new BT(this.top,[],n,null);r!=this.top?r.children.push(i):r.children.splice(this.index++,0,i),this.changed=!0}}isLocked(e){return this.lock&&(e==this.lock||e.nodeType==1&&e.contains(this.lock.parentNode))}}function pD(t,e){let r=e,n=r.children.length,i=t.childCount,o=new Map,s=[];e:for(;i>0;){let a;for(;;)if(n){let c=r.children[n-1];if(c instanceof eo)r=c,n=c.children.length;else{a=c,n--;break}}else{if(r==e)break e;n=r.parent.children.indexOf(r),r=r.parent}let l=a.node;if(l){if(l!=t.child(i-1))break;--i,o.set(a,i),s.push(a)}}return{index:i,matched:o,matches:s.reverse()}}function mD(t,e){return t.type.side-e.type.side}function gD(t,e,r,n){let i=e.locals(t),o=0;if(i.length==0){for(let c=0;c<t.childCount;c++){let u=t.child(c);n(u,i,e.forChild(o,u),c),o+=u.nodeSize}return}let s=0,a=[],l=null;for(let c=0;;){let u,f;for(;s<i.length&&i[s].to==o;){let y=i[s++];y.widget&&(u?(f||(f=[u])).push(y):u=y)}if(u)if(f){f.sort(mD);for(let y=0;y<f.length;y++)r(f[y],c,!!l)}else r(u,c,!!l);let d,h;if(l)h=-1,d=l,l=null;else if(c<t.childCount)h=c,d=t.child(c++);else break;for(let y=0;y<a.length;y++)a[y].to<=o&&a.splice(y--,1);for(;s<i.length&&i[s].from<=o&&i[s].to>o;)a.push(i[s++]);let p=o+d.nodeSize;if(d.isText){let y=p;s<i.length&&i[s].from<y&&(y=i[s].from);for(let g=0;g<a.length;g++)a[g].to<y&&(y=a[g].to);y<p&&(l=d.cut(y-o),d=d.cut(0,y-o),p=y,h=-1)}else for(;s<i.length&&i[s].to<p;)s++;let m=d.isInline&&!d.isLeaf?a.filter(y=>!y.inline):a.slice();n(d,m,e.forChild(o,d),h),o=p}}function yD(t){if(t.nodeName=="UL"||t.nodeName=="OL"){let e=t.style.cssText;t.style.cssText=e+"; list-style: square !important",window.getComputedStyle(t).listStyle,t.style.cssText=e}}function vD(t,e,r,n){for(let i=0,o=0;i<t.childCount&&o<=n;){let s=t.child(i++),a=o;if(o+=s.nodeSize,!s.isText)continue;let l=s.text;for(;i<t.childCount;){let c=t.child(i++);if(o+=c.nodeSize,!c.isText)break;l+=c.text}if(o>=r){if(o>=n&&l.slice(n-e.length-a,n-a)==e)return n-e.length;let c=a<n?l.lastIndexOf(e,n-a-1):-1;if(c>=0&&c+e.length+a>=r)return a+c;if(r==n&&l.length>=n+e.length-a&&l.slice(n-a,n-a+e.length)==e)return n}}return-1}function sm(t,e,r,n,i){let o=[];for(let s=0,a=0;s<t.length;s++){let l=t[s],c=a,u=a+=l.size;c>=r||u<=e?o.push(l):(c<e&&o.push(l.slice(0,e-c,n)),i&&(o.push(i),i=void 0),u>r&&o.push(l.slice(r-c,l.size,n)))}return o}function ay(t,e=null){let r=t.domSelectionRange(),n=t.state.doc;if(!r.focusNode)return null;let i=t.docView.nearestDesc(r.focusNode),o=i&&i.size==0,s=t.docView.posFromDOM(r.focusNode,r.focusOffset,1);if(s<0)return null;let a=n.resolve(s),l,c;if(Tf(r)){for(l=a;i&&!i.node;)i=i.parent;let u=i.node;if(i&&u.isAtom&&ke.isSelectable(u)&&i.parent&&!(u.isInline&&WN(r.focusNode,r.focusOffset,i.dom))){let f=i.posBefore;c=new ke(s==f?a:n.resolve(f))}}else{let u=t.docView.posFromDOM(r.anchorNode,r.anchorOffset,1);if(u<0)return null;l=n.resolve(u)}if(!c){let u=e=="pointer"||t.state.selection.head<a.pos&&!o?1:-1;c=ly(t,l,a,u)}return c}function zT(t){return t.editable?t.hasFocus():WT(t)&&document.activeElement&&document.activeElement.contains(t.dom)}function Sn(t,e=!1){let r=t.state.selection;if(UT(t,r),!!zT(t)){if(!e&&t.input.mouseDown&&t.input.mouseDown.allowDefault&&Rt){let n=t.domSelectionRange(),i=t.domObserver.currentSelection;if(n.anchorNode&&i.anchorNode&&Qi(n.anchorNode,n.anchorOffset,i.anchorNode,i.anchorOffset)){t.input.mouseDown.delayedSelectionSync=!0,t.domObserver.setCurSelection();return}}if(t.domObserver.disconnectSelection(),t.cursorWrapper)bD(t);else{let{anchor:n,head:i}=r,o,s;Qw&&!(r instanceof _e)&&(r.$from.parent.inlineContent||(o=eb(t,r.from)),!r.empty&&!r.$from.parent.inlineContent&&(s=eb(t,r.to))),t.docView.setSelection(n,i,t.root,e),Qw&&(o&&tb(o),s&&tb(s)),r.visible?t.dom.classList.remove("ProseMirror-hideselection"):(t.dom.classList.add("ProseMirror-hideselection"),"onselectionchange"in document&&wD(t))}t.domObserver.setCurSelection(),t.domObserver.connectSelection()}}const Qw=Ht||Rt&&RT<63;function eb(t,e){let{node:r,offset:n}=t.docView.domFromPos(e,0),i=n<r.childNodes.length?r.childNodes[n]:null,o=n?r.childNodes[n-1]:null;if(Ht&&i&&i.contentEditable=="false")return Ld(i);if((!i||i.contentEditable=="false")&&(!o||o.contentEditable=="false")){if(i)return Ld(i);if(o)return Ld(o)}}function Ld(t){return t.contentEditable="true",Ht&&t.draggable&&(t.draggable=!1,t.wasDraggable=!0),t}function tb(t){t.contentEditable="false",t.wasDraggable&&(t.draggable=!0,t.wasDraggable=null)}function wD(t){let e=t.dom.ownerDocument;e.removeEventListener("selectionchange",t.input.hideSelectionGuard);let r=t.domSelectionRange(),n=r.anchorNode,i=r.anchorOffset;e.addEventListener("selectionchange",t.input.hideSelectionGuard=()=>{(r.anchorNode!=n||r.anchorOffset!=i)&&(e.removeEventListener("selectionchange",t.input.hideSelectionGuard),setTimeout(()=>{(!zT(t)||t.state.selection.visible)&&t.dom.classList.remove("ProseMirror-hideselection")},20))})}function bD(t){let e=t.domSelection(),r=document.createRange();if(!e)return;let n=t.cursorWrapper.dom,i=n.nodeName=="IMG";i?r.setStart(n.parentNode,Tt(n)+1):r.setStart(n,0);let o=t.state.selection;if(o.empty)r.collapse(!0);else{let s=t.domAtPos(o.to);r.setEnd(s.node,s.offset)}e.removeAllRanges(),e.addRange(r),!i&&!t.state.selection.visible&&qt&&ai<=11&&(n.disabled=!0,n.disabled=!1)}function UT(t,e){if(e instanceof ke){let r=t.docView.descAt(e.from);r!=t.lastSelectedViewDesc&&(rb(t),r&&r.selectNode(),t.lastSelectedViewDesc=r)}else rb(t)}function rb(t){t.lastSelectedViewDesc&&(t.lastSelectedViewDesc.parent&&t.lastSelectedViewDesc.deselectNode(),t.lastSelectedViewDesc=void 0)}function ly(t,e,r,n){return t.someProp("createSelectionBetween",i=>i(t,e,r))||_e.between(e,r,n)}function nb(t){return t.editable&&!t.hasFocus()?!1:WT(t)}function WT(t){let e=t.domSelectionRange();if(!e.anchorNode)return!1;try{return t.dom.contains(e.anchorNode.nodeType==3?e.anchorNode.parentNode:e.anchorNode)&&(t.editable||t.dom.contains(e.focusNode.nodeType==3?e.focusNode.parentNode:e.focusNode))}catch{return!1}}function xD(t){let e=t.docView.domFromPos(t.state.selection.anchor,0),r=t.domSelectionRange();return Qi(e.node,e.offset,r.anchorNode,r.anchorOffset)}function am(t,e){let{$anchor:r,$head:n}=t.selection,i=e>0?r.max(n):r.min(n),o=i.parent.inlineContent?i.depth?t.doc.resolve(e>0?i.after():i.before()):null:i;return o&&Re.findFrom(o,e)}function Vn(t,e){return t.dispatch(t.state.tr.setSelection(e).scrollIntoView()),!0}function ib(t,e,r){let n=t.state.selection;if(n instanceof _e)if(r.indexOf("s")>-1){let{$head:i}=n,o=i.textOffset?null:e<0?i.nodeBefore:i.nodeAfter;if(!o||o.isText||!o.isLeaf)return!1;let s=t.state.doc.resolve(i.pos+o.nodeSize*(e<0?-1:1));return Vn(t,new _e(n.$anchor,s))}else if(n.empty){if(t.endOfTextblock(e>0?"forward":"backward")){let i=am(t.state,e);return i&&i instanceof ke?Vn(t,i):!1}else if(!(fr&&r.indexOf("m")>-1)){let i=n.$head,o=i.textOffset?null:e<0?i.nodeBefore:i.nodeAfter,s;if(!o||o.isText)return!1;let a=e<0?i.pos-o.nodeSize:i.pos;return o.isAtom||(s=t.docView.descAt(a))&&!s.contentDOM?ke.isSelectable(o)?Vn(t,new ke(e<0?t.state.doc.resolve(i.pos-o.nodeSize):i)):cl?Vn(t,new _e(t.state.doc.resolve(e<0?a:a+o.nodeSize))):!1:!1}}else return!1;else{if(n instanceof ke&&n.node.isInline)return Vn(t,new _e(e>0?n.$to:n.$from));{let i=am(t.state,e);return i?Vn(t,i):!1}}}function Zc(t){return t.nodeType==3?t.nodeValue.length:t.childNodes.length}function pa(t,e){let r=t.pmViewDesc;return r&&r.size==0&&(e<0||t.nextSibling||t.nodeName!="BR")}function To(t,e){return e<0?SD(t):ED(t)}function SD(t){let e=t.domSelectionRange(),r=e.focusNode,n=e.focusOffset;if(!r)return;let i,o,s=!1;for(Cr&&r.nodeType==1&&n<Zc(r)&&pa(r.childNodes[n],-1)&&(s=!0);;)if(n>0){if(r.nodeType!=1)break;{let a=r.childNodes[n-1];if(pa(a,-1))i=r,o=--n;else if(a.nodeType==3)r=a,n=r.nodeValue.length;else break}}else{if(VT(r))break;{let a=r.previousSibling;for(;a&&pa(a,-1);)i=r.parentNode,o=Tt(a),a=a.previousSibling;if(a)r=a,n=Zc(r);else{if(r=r.parentNode,r==t.dom)break;n=0}}}s?lm(t,r,n):i&&lm(t,i,o)}function ED(t){let e=t.domSelectionRange(),r=e.focusNode,n=e.focusOffset;if(!r)return;let i=Zc(r),o,s;for(;;)if(n<i){if(r.nodeType!=1)break;let a=r.childNodes[n];if(pa(a,1))o=r,s=++n;else break}else{if(VT(r))break;{let a=r.nextSibling;for(;a&&pa(a,1);)o=a.parentNode,s=Tt(a)+1,a=a.nextSibling;if(a)r=a,n=0,i=Zc(r);else{if(r=r.parentNode,r==t.dom)break;n=i=0}}}o&&lm(t,o,s)}function VT(t){let e=t.pmViewDesc;return e&&e.node&&e.node.isBlock}function TD(t,e){for(;t&&e==t.childNodes.length&&!ll(t);)e=Tt(t)+1,t=t.parentNode;for(;t&&e<t.childNodes.length;){let r=t.childNodes[e];if(r.nodeType==3)return r;if(r.nodeType==1&&r.contentEditable=="false")break;t=r,e=0}}function AD(t,e){for(;t&&!e&&!ll(t);)e=Tt(t),t=t.parentNode;for(;t&&e;){let r=t.childNodes[e-1];if(r.nodeType==3)return r;if(r.nodeType==1&&r.contentEditable=="false")break;t=r,e=t.childNodes.length}}function lm(t,e,r){if(e.nodeType!=3){let o,s;(s=TD(e,r))?(e=s,r=0):(o=AD(e,r))&&(e=o,r=o.nodeValue.length)}let n=t.domSelection();if(!n)return;if(Tf(n)){let o=document.createRange();o.setEnd(e,r),o.setStart(e,r),n.removeAllRanges(),n.addRange(o)}else n.extend&&n.extend(e,r);t.domObserver.setCurSelection();let{state:i}=t;setTimeout(()=>{t.state==i&&Sn(t)},50)}function ob(t,e){let r=t.state.doc.resolve(e);if(!(Rt||KN)&&r.parent.inlineContent){let i=t.coordsAtPos(e);if(e>r.start()){let o=t.coordsAtPos(e-1),s=(o.top+o.bottom)/2;if(s>i.top&&s<i.bottom&&Math.abs(o.left-i.left)>1)return o.left<i.left?"ltr":"rtl"}if(e<r.end()){let o=t.coordsAtPos(e+1),s=(o.top+o.bottom)/2;if(s>i.top&&s<i.bottom&&Math.abs(o.left-i.left)>1)return o.left>i.left?"ltr":"rtl"}}return getComputedStyle(t.dom).direction=="rtl"?"rtl":"ltr"}function sb(t,e,r){let n=t.state.selection;if(n instanceof _e&&!n.empty||r.indexOf("s")>-1||fr&&r.indexOf("m")>-1)return!1;let{$from:i,$to:o}=n;if(!i.parent.inlineContent||t.endOfTextblock(e<0?"up":"down")){let s=am(t.state,e);if(s&&s instanceof ke)return Vn(t,s)}if(!i.parent.inlineContent){let s=e<0?i:o,a=n instanceof hr?Re.near(s,e):Re.findFrom(s,e);return a?Vn(t,a):!1}return!1}function ab(t,e){if(!(t.state.selection instanceof _e))return!0;let{$head:r,$anchor:n,empty:i}=t.state.selection;if(!r.sameParent(n))return!0;if(!i)return!1;if(t.endOfTextblock(e>0?"forward":"backward"))return!0;let o=!r.textOffset&&(e<0?r.nodeBefore:r.nodeAfter);if(o&&!o.isText){let s=t.state.tr;return e<0?s.delete(r.pos-o.nodeSize,r.pos):s.delete(r.pos,r.pos+o.nodeSize),t.dispatch(s),!0}return!1}function lb(t,e,r){t.domObserver.stop(),e.contentEditable=r,t.domObserver.start()}function CD(t){if(!Ht||t.state.selection.$head.parentOffset>0)return!1;let{focusNode:e,focusOffset:r}=t.domSelectionRange();if(e&&e.nodeType==1&&r==0&&e.firstChild&&e.firstChild.contentEditable=="false"){let n=e.firstChild;lb(t,n,"true"),setTimeout(()=>lb(t,n,"false"),20)}return!1}function kD(t){let e="";return t.ctrlKey&&(e+="c"),t.metaKey&&(e+="m"),t.altKey&&(e+="a"),t.shiftKey&&(e+="s"),e}function _D(t,e){let r=e.keyCode,n=kD(e);if(r==8||fr&&r==72&&n=="c")return ab(t,-1)||To(t,-1);if(r==46&&!e.shiftKey||fr&&r==68&&n=="c")return ab(t,1)||To(t,1);if(r==13||r==27)return!0;if(r==37||fr&&r==66&&n=="c"){let i=r==37?ob(t,t.state.selection.from)=="ltr"?-1:1:-1;return ib(t,i,n)||To(t,i)}else if(r==39||fr&&r==70&&n=="c"){let i=r==39?ob(t,t.state.selection.from)=="ltr"?1:-1:1;return ib(t,i,n)||To(t,i)}else{if(r==38||fr&&r==80&&n=="c")return sb(t,-1,n)||To(t,-1);if(r==40||fr&&r==78&&n=="c")return CD(t)||sb(t,1,n)||To(t,1);if(n==(fr?"m":"c")&&(r==66||r==73||r==89||r==90))return!0}return!1}function GT(t,e){t.someProp("transformCopied",h=>{e=h(e,t)});let r=[],{content:n,openStart:i,openEnd:o}=e;for(;i>1&&o>1&&n.childCount==1&&n.firstChild.childCount==1;){i--,o--;let h=n.firstChild;r.push(h.type.name,h.attrs!=h.type.defaultAttrs?h.attrs:null),n=h.content}let s=t.someProp("clipboardSerializer")||uo.fromSchema(t.state.schema),a=ZT(),l=a.createElement("div");l.appendChild(s.serializeFragment(n,{document:a}));let c=l.firstChild,u,f=0;for(;c&&c.nodeType==1&&(u=YT[c.nodeName.toLowerCase()]);){for(let h=u.length-1;h>=0;h--){let p=a.createElement(u[h]);for(;l.firstChild;)p.appendChild(l.firstChild);l.appendChild(p),f++}c=l.firstChild}c&&c.nodeType==1&&c.setAttribute("data-pm-slice",`${i} ${o}${f?` -${f}`:""} ${JSON.stringify(r)}`);let d=t.someProp("clipboardTextSerializer",h=>h(e,t))||e.content.textBetween(0,e.content.size,`
7
-
8
- `);return{dom:l,text:d,slice:e}}function KT(t,e,r,n,i){let o=i.parent.type.spec.code,s,a;if(!r&&!e)return null;let l=e&&(n||o||!r);if(l){if(t.someProp("transformPastedText",d=>{e=d(e,o||n,t)}),o)return e?new we(he.from(t.state.schema.text(e.replace(/\r\n?/g,`
9
- `))),0,0):we.empty;let f=t.someProp("clipboardTextParser",d=>d(e,i,n,t));if(f)a=f;else{let d=i.marks(),{schema:h}=t.state,p=uo.fromSchema(h);s=document.createElement("div"),e.split(/(?:\r\n?|\n)+/).forEach(m=>{let y=s.appendChild(document.createElement("p"));m&&y.appendChild(p.serializeNode(h.text(m,d)))})}}else t.someProp("transformPastedHTML",f=>{r=f(r,t)}),s=MD(r),cl&&ID(s);let c=s&&s.querySelector("[data-pm-slice]"),u=c&&/^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(c.getAttribute("data-pm-slice")||"");if(u&&u[3])for(let f=+u[3];f>0;f--){let d=s.firstChild;for(;d&&d.nodeType!=1;)d=d.nextSibling;if(!d)break;s=d}if(a||(a=(t.someProp("clipboardParser")||t.someProp("domParser")||fa.fromSchema(t.state.schema)).parseSlice(s,{preserveWhitespace:!!(l||u),context:i,ruleFromNode(d){return d.nodeName=="BR"&&!d.nextSibling&&d.parentNode&&!OD.test(d.parentNode.nodeName)?{ignore:!0}:null}})),u)a=ND(cb(a,+u[1],+u[2]),u[4]);else if(a=we.maxOpen(RD(a.content,i),!0),a.openStart||a.openEnd){let f=0,d=0;for(let h=a.content.firstChild;f<a.openStart&&!h.type.spec.isolating;f++,h=h.firstChild);for(let h=a.content.lastChild;d<a.openEnd&&!h.type.spec.isolating;d++,h=h.lastChild);a=cb(a,f,d)}return t.someProp("transformPasted",f=>{a=f(a,t)}),a}const OD=/^(a|abbr|acronym|b|cite|code|del|em|i|ins|kbd|label|output|q|ruby|s|samp|span|strong|sub|sup|time|u|tt|var)$/i;function RD(t,e){if(t.childCount<2)return t;for(let r=e.depth;r>=0;r--){let i=e.node(r).contentMatchAt(e.index(r)),o,s=[];if(t.forEach(a=>{if(!s)return;let l=i.findWrapping(a.type),c;if(!l)return s=null;if(c=s.length&&o.length&&XT(l,o,a,s[s.length-1],0))s[s.length-1]=c;else{s.length&&(s[s.length-1]=JT(s[s.length-1],o.length));let u=qT(a,l);s.push(u),i=i.matchType(u.type),o=l}}),s)return he.from(s)}return t}function qT(t,e,r=0){for(let n=e.length-1;n>=r;n--)t=e[n].create(null,he.from(t));return t}function XT(t,e,r,n,i){if(i<t.length&&i<e.length&&t[i]==e[i]){let o=XT(t,e,r,n.lastChild,i+1);if(o)return n.copy(n.content.replaceChild(n.childCount-1,o));if(n.contentMatchAt(n.childCount).matchType(i==t.length-1?r.type:t[i+1]))return n.copy(n.content.append(he.from(qT(r,t,i+1))))}}function JT(t,e){if(e==0)return t;let r=t.content.replaceChild(t.childCount-1,JT(t.lastChild,e-1)),n=t.contentMatchAt(t.childCount).fillBefore(he.empty,!0);return t.copy(r.append(n))}function cm(t,e,r,n,i,o){let s=e<0?t.firstChild:t.lastChild,a=s.content;return t.childCount>1&&(o=0),i<n-1&&(a=cm(a,e,r,n,i+1,o)),i>=r&&(a=e<0?s.contentMatchAt(0).fillBefore(a,o<=i).append(a):a.append(s.contentMatchAt(s.childCount).fillBefore(he.empty,!0))),t.replaceChild(e<0?0:t.childCount-1,s.copy(a))}function cb(t,e,r){return e<t.openStart&&(t=new we(cm(t.content,-1,e,t.openStart,0,t.openEnd),e,t.openEnd)),r<t.openEnd&&(t=new we(cm(t.content,1,r,t.openEnd,0,0),t.openStart,r)),t}const YT={thead:["table"],tbody:["table"],tfoot:["table"],caption:["table"],colgroup:["table"],col:["table","colgroup"],tr:["table","tbody"],td:["table","tbody","tr"],th:["table","tbody","tr"]};let ub=null;function ZT(){return ub||(ub=document.implementation.createHTMLDocument("title"))}function MD(t){let e=/^(\s*<meta [^>]*>)*/.exec(t);e&&(t=t.slice(e[0].length));let r=ZT().createElement("div"),n=/<([a-z][^>\s]+)/i.exec(t),i;if((i=n&&YT[n[1].toLowerCase()])&&(t=i.map(o=>"<"+o+">").join("")+t+i.map(o=>"</"+o+">").reverse().join("")),r.innerHTML=t,i)for(let o=0;o<i.length;o++)r=r.querySelector(i[o])||r;return r}function ID(t){let e=t.querySelectorAll(Rt?"span:not([class]):not([style])":"span.Apple-converted-space");for(let r=0;r<e.length;r++){let n=e[r];n.childNodes.length==1&&n.textContent==" "&&n.parentNode&&n.parentNode.replaceChild(t.ownerDocument.createTextNode(" "),n)}}function ND(t,e){if(!t.size)return t;let r=t.content.firstChild.type.schema,n;try{n=JSON.parse(e)}catch{return t}let{content:i,openStart:o,openEnd:s}=t;for(let a=n.length-2;a>=0;a-=2){let l=r.nodes[n[a]];if(!l||l.hasRequiredAttrs())break;i=he.from(l.create(n[a+1],i)),o++,s++}return new we(i,o,s)}const zt={},Ut={},DD={touchstart:!0,touchmove:!0};class PD{constructor(){this.shiftKey=!1,this.mouseDown=null,this.lastKeyCode=null,this.lastKeyCodeTime=0,this.lastClick={time:0,x:0,y:0,type:""},this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastIOSEnter=0,this.lastIOSEnterFallbackTimeout=-1,this.lastFocus=0,this.lastTouch=0,this.lastAndroidDelete=0,this.composing=!1,this.compositionNode=null,this.composingTimeout=-1,this.compositionNodes=[],this.compositionEndedAt=-2e8,this.compositionID=1,this.compositionPendingChanges=0,this.domChangeCount=0,this.eventHandlers=Object.create(null),this.hideSelectionGuard=null}}function LD(t){for(let e in zt){let r=zt[e];t.dom.addEventListener(e,t.input.eventHandlers[e]=n=>{BD(t,n)&&!cy(t,n)&&(t.editable||!(n.type in Ut))&&r(t,n)},DD[e]?{passive:!0}:void 0)}Ht&&t.dom.addEventListener("input",()=>null),um(t)}function ni(t,e){t.input.lastSelectionOrigin=e,t.input.lastSelectionTime=Date.now()}function FD(t){t.domObserver.stop();for(let e in t.input.eventHandlers)t.dom.removeEventListener(e,t.input.eventHandlers[e]);clearTimeout(t.input.composingTimeout),clearTimeout(t.input.lastIOSEnterFallbackTimeout)}function um(t){t.someProp("handleDOMEvents",e=>{for(let r in e)t.input.eventHandlers[r]||t.dom.addEventListener(r,t.input.eventHandlers[r]=n=>cy(t,n))})}function cy(t,e){return t.someProp("handleDOMEvents",r=>{let n=r[e.type];return n?n(t,e)||e.defaultPrevented:!1})}function BD(t,e){if(!e.bubbles)return!0;if(e.defaultPrevented)return!1;for(let r=e.target;r!=t.dom;r=r.parentNode)if(!r||r.nodeType==11||r.pmViewDesc&&r.pmViewDesc.stopEvent(e))return!1;return!0}function $D(t,e){!cy(t,e)&&zt[e.type]&&(t.editable||!(e.type in Ut))&&zt[e.type](t,e)}Ut.keydown=(t,e)=>{let r=e;if(t.input.shiftKey=r.keyCode==16||r.shiftKey,!eA(t,r)&&(t.input.lastKeyCode=r.keyCode,t.input.lastKeyCodeTime=Date.now(),!(Er&&Rt&&r.keyCode==13)))if(r.keyCode!=229&&t.domObserver.forceFlush(),ss&&r.keyCode==13&&!r.ctrlKey&&!r.altKey&&!r.metaKey){let n=Date.now();t.input.lastIOSEnter=n,t.input.lastIOSEnterFallbackTimeout=setTimeout(()=>{t.input.lastIOSEnter==n&&(t.someProp("handleKeyDown",i=>i(t,Li(13,"Enter"))),t.input.lastIOSEnter=0)},200)}else t.someProp("handleKeyDown",n=>n(t,r))||_D(t,r)?r.preventDefault():ni(t,"key")};Ut.keyup=(t,e)=>{e.keyCode==16&&(t.input.shiftKey=!1)};Ut.keypress=(t,e)=>{let r=e;if(eA(t,r)||!r.charCode||r.ctrlKey&&!r.altKey||fr&&r.metaKey)return;if(t.someProp("handleKeyPress",i=>i(t,r))){r.preventDefault();return}let n=t.state.selection;if(!(n instanceof _e)||!n.$from.sameParent(n.$to)){let i=String.fromCharCode(r.charCode);!/[\r\n]/.test(i)&&!t.someProp("handleTextInput",o=>o(t,n.$from.pos,n.$to.pos,i))&&t.dispatch(t.state.tr.insertText(i).scrollIntoView()),r.preventDefault()}};function Cf(t){return{left:t.clientX,top:t.clientY}}function jD(t,e){let r=e.x-t.clientX,n=e.y-t.clientY;return r*r+n*n<100}function uy(t,e,r,n,i){if(n==-1)return!1;let o=t.state.doc.resolve(n);for(let s=o.depth+1;s>0;s--)if(t.someProp(e,a=>s>o.depth?a(t,r,o.nodeAfter,o.before(s),i,!0):a(t,r,o.node(s),o.before(s),i,!1)))return!0;return!1}function Ko(t,e,r){if(t.focused||t.focus(),t.state.selection.eq(e))return;let n=t.state.tr.setSelection(e);n.setMeta("pointer",!0),t.dispatch(n)}function HD(t,e){if(e==-1)return!1;let r=t.state.doc.resolve(e),n=r.nodeAfter;return n&&n.isAtom&&ke.isSelectable(n)?(Ko(t,new ke(r)),!0):!1}function zD(t,e){if(e==-1)return!1;let r=t.state.selection,n,i;r instanceof ke&&(n=r.node);let o=t.state.doc.resolve(e);for(let s=o.depth+1;s>0;s--){let a=s>o.depth?o.nodeAfter:o.node(s);if(ke.isSelectable(a)){n&&r.$from.depth>0&&s>=r.$from.depth&&o.before(r.$from.depth+1)==r.$from.pos?i=o.before(r.$from.depth):i=o.before(s);break}}return i!=null?(Ko(t,ke.create(t.state.doc,i)),!0):!1}function UD(t,e,r,n,i){return uy(t,"handleClickOn",e,r,n)||t.someProp("handleClick",o=>o(t,e,n))||(i?zD(t,r):HD(t,r))}function WD(t,e,r,n){return uy(t,"handleDoubleClickOn",e,r,n)||t.someProp("handleDoubleClick",i=>i(t,e,n))}function VD(t,e,r,n){return uy(t,"handleTripleClickOn",e,r,n)||t.someProp("handleTripleClick",i=>i(t,e,n))||GD(t,r,n)}function GD(t,e,r){if(r.button!=0)return!1;let n=t.state.doc;if(e==-1)return n.inlineContent?(Ko(t,_e.create(n,0,n.content.size)),!0):!1;let i=n.resolve(e);for(let o=i.depth+1;o>0;o--){let s=o>i.depth?i.nodeAfter:i.node(o),a=i.before(o);if(s.inlineContent)Ko(t,_e.create(n,a+1,a+1+s.content.size));else if(ke.isSelectable(s))Ko(t,ke.create(n,a));else continue;return!0}}function fy(t){return Qc(t)}const QT=fr?"metaKey":"ctrlKey";zt.mousedown=(t,e)=>{let r=e;t.input.shiftKey=r.shiftKey;let n=fy(t),i=Date.now(),o="singleClick";i-t.input.lastClick.time<500&&jD(r,t.input.lastClick)&&!r[QT]&&(t.input.lastClick.type=="singleClick"?o="doubleClick":t.input.lastClick.type=="doubleClick"&&(o="tripleClick")),t.input.lastClick={time:i,x:r.clientX,y:r.clientY,type:o};let s=t.posAtCoords(Cf(r));s&&(o=="singleClick"?(t.input.mouseDown&&t.input.mouseDown.done(),t.input.mouseDown=new KD(t,s,r,!!n)):(o=="doubleClick"?WD:VD)(t,s.pos,s.inside,r)?r.preventDefault():ni(t,"pointer"))};class KD{constructor(e,r,n,i){this.view=e,this.pos=r,this.event=n,this.flushed=i,this.delayedSelectionSync=!1,this.mightDrag=null,this.startDoc=e.state.doc,this.selectNode=!!n[QT],this.allowDefault=n.shiftKey;let o,s;if(r.inside>-1)o=e.state.doc.nodeAt(r.inside),s=r.inside;else{let u=e.state.doc.resolve(r.pos);o=u.parent,s=u.depth?u.before():0}const a=i?null:n.target,l=a?e.docView.nearestDesc(a,!0):null;this.target=l&&l.dom.nodeType==1?l.dom:null;let{selection:c}=e.state;(n.button==0&&o.type.spec.draggable&&o.type.spec.selectable!==!1||c instanceof ke&&c.from<=s&&c.to>s)&&(this.mightDrag={node:o,pos:s,addAttr:!!(this.target&&!this.target.draggable),setUneditable:!!(this.target&&Cr&&!this.target.hasAttribute("contentEditable"))}),this.target&&this.mightDrag&&(this.mightDrag.addAttr||this.mightDrag.setUneditable)&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&(this.target.draggable=!0),this.mightDrag.setUneditable&&setTimeout(()=>{this.view.input.mouseDown==this&&this.target.setAttribute("contentEditable","false")},20),this.view.domObserver.start()),e.root.addEventListener("mouseup",this.up=this.up.bind(this)),e.root.addEventListener("mousemove",this.move=this.move.bind(this)),ni(e,"pointer")}done(){this.view.root.removeEventListener("mouseup",this.up),this.view.root.removeEventListener("mousemove",this.move),this.mightDrag&&this.target&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&this.target.removeAttribute("draggable"),this.mightDrag.setUneditable&&this.target.removeAttribute("contentEditable"),this.view.domObserver.start()),this.delayedSelectionSync&&setTimeout(()=>Sn(this.view)),this.view.input.mouseDown=null}up(e){if(this.done(),!this.view.dom.contains(e.target))return;let r=this.pos;this.view.state.doc!=this.startDoc&&(r=this.view.posAtCoords(Cf(e))),this.updateAllowDefault(e),this.allowDefault||!r?ni(this.view,"pointer"):UD(this.view,r.pos,r.inside,e,this.selectNode)?e.preventDefault():e.button==0&&(this.flushed||Ht&&this.mightDrag&&!this.mightDrag.node.isAtom||Rt&&!this.view.state.selection.visible&&Math.min(Math.abs(r.pos-this.view.state.selection.from),Math.abs(r.pos-this.view.state.selection.to))<=2)?(Ko(this.view,Re.near(this.view.state.doc.resolve(r.pos))),e.preventDefault()):ni(this.view,"pointer")}move(e){this.updateAllowDefault(e),ni(this.view,"pointer"),e.buttons==0&&this.done()}updateAllowDefault(e){!this.allowDefault&&(Math.abs(this.event.x-e.clientX)>4||Math.abs(this.event.y-e.clientY)>4)&&(this.allowDefault=!0)}}zt.touchstart=t=>{t.input.lastTouch=Date.now(),fy(t),ni(t,"pointer")};zt.touchmove=t=>{t.input.lastTouch=Date.now(),ni(t,"pointer")};zt.contextmenu=t=>fy(t);function eA(t,e){return t.composing?!0:Ht&&Math.abs(e.timeStamp-t.input.compositionEndedAt)<500?(t.input.compositionEndedAt=-2e8,!0):!1}const qD=Er?5e3:-1;Ut.compositionstart=Ut.compositionupdate=t=>{if(!t.composing){t.domObserver.flush();let{state:e}=t,r=e.selection.$to;if(e.selection instanceof _e&&(e.storedMarks||!r.textOffset&&r.parentOffset&&r.nodeBefore.marks.some(n=>n.type.spec.inclusive===!1)))t.markCursor=t.state.storedMarks||r.marks(),Qc(t,!0),t.markCursor=null;else if(Qc(t),Cr&&e.selection.empty&&r.parentOffset&&!r.textOffset&&r.nodeBefore.marks.length){let n=t.domSelectionRange();for(let i=n.focusNode,o=n.focusOffset;i&&i.nodeType==1&&o!=0;){let s=o<0?i.lastChild:i.childNodes[o-1];if(!s)break;if(s.nodeType==3){let a=t.domSelection();a&&a.collapse(s,s.nodeValue.length);break}else i=s,o=-1}}t.input.composing=!0}tA(t,qD)};Ut.compositionend=(t,e)=>{t.composing&&(t.input.composing=!1,t.input.compositionEndedAt=e.timeStamp,t.input.compositionPendingChanges=t.domObserver.pendingRecords().length?t.input.compositionID:0,t.input.compositionNode=null,t.input.compositionPendingChanges&&Promise.resolve().then(()=>t.domObserver.flush()),t.input.compositionID++,tA(t,20))};function tA(t,e){clearTimeout(t.input.composingTimeout),e>-1&&(t.input.composingTimeout=setTimeout(()=>Qc(t),e))}function rA(t){for(t.composing&&(t.input.composing=!1,t.input.compositionEndedAt=JD());t.input.compositionNodes.length>0;)t.input.compositionNodes.pop().markParentsDirty()}function XD(t){let e=t.domSelectionRange();if(!e.focusNode)return null;let r=zN(e.focusNode,e.focusOffset),n=UN(e.focusNode,e.focusOffset);if(r&&n&&r!=n){let i=n.pmViewDesc,o=t.domObserver.lastChangedTextNode;if(r==o||n==o)return o;if(!i||!i.isText(n.nodeValue))return n;if(t.input.compositionNode==n){let s=r.pmViewDesc;if(!(!s||!s.isText(r.nodeValue)))return n}}return r||n}function JD(){let t=document.createEvent("Event");return t.initEvent("event",!0,!0),t.timeStamp}function Qc(t,e=!1){if(!(Er&&t.domObserver.flushingSoon>=0)){if(t.domObserver.forceFlush(),rA(t),e||t.docView&&t.docView.dirty){let r=ay(t);return r&&!r.eq(t.state.selection)?t.dispatch(t.state.tr.setSelection(r)):t.updateState(t.state),!0}return!1}}function YD(t,e){if(!t.dom.parentNode)return;let r=t.dom.parentNode.appendChild(document.createElement("div"));r.appendChild(e),r.style.cssText="position: fixed; left: -10000px; top: 10px";let n=getSelection(),i=document.createRange();i.selectNodeContents(e),t.dom.blur(),n.removeAllRanges(),n.addRange(i),setTimeout(()=>{r.parentNode&&r.parentNode.removeChild(r),t.focus()},50)}const Na=qt&&ai<15||ss&&qN<604;zt.copy=Ut.cut=(t,e)=>{let r=e,n=t.state.selection,i=r.type=="cut";if(n.empty)return;let o=Na?null:r.clipboardData,s=n.content(),{dom:a,text:l}=GT(t,s);o?(r.preventDefault(),o.clearData(),o.setData("text/html",a.innerHTML),o.setData("text/plain",l)):YD(t,a),i&&t.dispatch(t.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))};function ZD(t){return t.openStart==0&&t.openEnd==0&&t.content.childCount==1?t.content.firstChild:null}function QD(t,e){if(!t.dom.parentNode)return;let r=t.input.shiftKey||t.state.selection.$from.parent.type.spec.code,n=t.dom.parentNode.appendChild(document.createElement(r?"textarea":"div"));r||(n.contentEditable="true"),n.style.cssText="position: fixed; left: -10000px; top: 10px",n.focus();let i=t.input.shiftKey&&t.input.lastKeyCode!=45;setTimeout(()=>{t.focus(),n.parentNode&&n.parentNode.removeChild(n),r?Da(t,n.value,null,i,e):Da(t,n.textContent,n.innerHTML,i,e)},50)}function Da(t,e,r,n,i){let o=KT(t,e,r,n,t.state.selection.$from);if(t.someProp("handlePaste",l=>l(t,i,o||we.empty)))return!0;if(!o)return!1;let s=ZD(o),a=s?t.state.tr.replaceSelectionWith(s,n):t.state.tr.replaceSelection(o);return t.dispatch(a.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste")),!0}function nA(t){let e=t.getData("text/plain")||t.getData("Text");if(e)return e;let r=t.getData("text/uri-list");return r?r.replace(/\r?\n/g," "):""}Ut.paste=(t,e)=>{let r=e;if(t.composing&&!Er)return;let n=Na?null:r.clipboardData,i=t.input.shiftKey&&t.input.lastKeyCode!=45;n&&Da(t,nA(n),n.getData("text/html"),i,r)?r.preventDefault():QD(t,r)};class iA{constructor(e,r,n){this.slice=e,this.move=r,this.node=n}}const oA=fr?"altKey":"ctrlKey";zt.dragstart=(t,e)=>{let r=e,n=t.input.mouseDown;if(n&&n.done(),!r.dataTransfer)return;let i=t.state.selection,o=i.empty?null:t.posAtCoords(Cf(r)),s;if(!(o&&o.pos>=i.from&&o.pos<=(i instanceof ke?i.to-1:i.to))){if(n&&n.mightDrag)s=ke.create(t.state.doc,n.mightDrag.pos);else if(r.target&&r.target.nodeType==1){let f=t.docView.nearestDesc(r.target,!0);f&&f.node.type.spec.draggable&&f!=t.docView&&(s=ke.create(t.state.doc,f.posBefore))}}let a=(s||t.state.selection).content(),{dom:l,text:c,slice:u}=GT(t,a);(!r.dataTransfer.files.length||!Rt||RT>120)&&r.dataTransfer.clearData(),r.dataTransfer.setData(Na?"Text":"text/html",l.innerHTML),r.dataTransfer.effectAllowed="copyMove",Na||r.dataTransfer.setData("text/plain",c),t.dragging=new iA(u,!r[oA],s)};zt.dragend=t=>{let e=t.dragging;window.setTimeout(()=>{t.dragging==e&&(t.dragging=null)},50)};Ut.dragover=Ut.dragenter=(t,e)=>e.preventDefault();Ut.drop=(t,e)=>{let r=e,n=t.dragging;if(t.dragging=null,!r.dataTransfer)return;let i=t.posAtCoords(Cf(r));if(!i)return;let o=t.state.doc.resolve(i.pos),s=n&&n.slice;s?t.someProp("transformPasted",p=>{s=p(s,t)}):s=KT(t,nA(r.dataTransfer),Na?null:r.dataTransfer.getData("text/html"),!1,o);let a=!!(n&&!r[oA]);if(t.someProp("handleDrop",p=>p(t,r,s||we.empty,a))){r.preventDefault();return}if(!s)return;r.preventDefault();let l=s?ST(t.state.doc,o.pos,s):o.pos;l==null&&(l=o.pos);let c=t.state.tr;if(a){let{node:p}=n;p?p.replace(c):c.deleteSelection()}let u=c.mapping.map(l),f=s.openStart==0&&s.openEnd==0&&s.content.childCount==1,d=c.doc;if(f?c.replaceRangeWith(u,u,s.content.firstChild):c.replaceRange(u,u,s),c.doc.eq(d))return;let h=c.doc.resolve(u);if(f&&ke.isSelectable(s.content.firstChild)&&h.nodeAfter&&h.nodeAfter.sameMarkup(s.content.firstChild))c.setSelection(new ke(h));else{let p=c.mapping.map(l);c.mapping.maps[c.mapping.maps.length-1].forEach((m,y,g,b)=>p=b),c.setSelection(ly(t,h,c.doc.resolve(p)))}t.focus(),t.dispatch(c.setMeta("uiEvent","drop"))};zt.focus=t=>{t.input.lastFocus=Date.now(),t.focused||(t.domObserver.stop(),t.dom.classList.add("ProseMirror-focused"),t.domObserver.start(),t.focused=!0,setTimeout(()=>{t.docView&&t.hasFocus()&&!t.domObserver.currentSelection.eq(t.domSelectionRange())&&Sn(t)},20))};zt.blur=(t,e)=>{let r=e;t.focused&&(t.domObserver.stop(),t.dom.classList.remove("ProseMirror-focused"),t.domObserver.start(),r.relatedTarget&&t.dom.contains(r.relatedTarget)&&t.domObserver.currentSelection.clear(),t.focused=!1)};zt.beforeinput=(t,e)=>{if(Rt&&Er&&e.inputType=="deleteContentBackward"){t.domObserver.flushSoon();let{domChangeCount:n}=t.input;setTimeout(()=>{if(t.input.domChangeCount!=n||(t.dom.blur(),t.focus(),t.someProp("handleKeyDown",o=>o(t,Li(8,"Backspace")))))return;let{$cursor:i}=t.state.selection;i&&i.pos>0&&t.dispatch(t.state.tr.delete(i.pos-1,i.pos).scrollIntoView())},50)}};for(let t in Ut)zt[t]=Ut[t];function Pa(t,e){if(t==e)return!0;for(let r in t)if(t[r]!==e[r])return!1;for(let r in e)if(!(r in t))return!1;return!0}class eu{constructor(e,r){this.toDOM=e,this.spec=r||Vi,this.side=this.spec.side||0}map(e,r,n,i){let{pos:o,deleted:s}=e.mapResult(r.from+i,this.side<0?-1:1);return s?null:new gt(o-n,o-n,this)}valid(){return!0}eq(e){return this==e||e instanceof eu&&(this.spec.key&&this.spec.key==e.spec.key||this.toDOM==e.toDOM&&Pa(this.spec,e.spec))}destroy(e){this.spec.destroy&&this.spec.destroy(e)}}class ci{constructor(e,r){this.attrs=e,this.spec=r||Vi}map(e,r,n,i){let o=e.map(r.from+i,this.spec.inclusiveStart?-1:1)-n,s=e.map(r.to+i,this.spec.inclusiveEnd?1:-1)-n;return o>=s?null:new gt(o,s,this)}valid(e,r){return r.from<r.to}eq(e){return this==e||e instanceof ci&&Pa(this.attrs,e.attrs)&&Pa(this.spec,e.spec)}static is(e){return e.type instanceof ci}destroy(){}}class dy{constructor(e,r){this.attrs=e,this.spec=r||Vi}map(e,r,n,i){let o=e.mapResult(r.from+i,1);if(o.deleted)return null;let s=e.mapResult(r.to+i,-1);return s.deleted||s.pos<=o.pos?null:new gt(o.pos-n,s.pos-n,this)}valid(e,r){let{index:n,offset:i}=e.content.findIndex(r.from),o;return i==r.from&&!(o=e.child(n)).isText&&i+o.nodeSize==r.to}eq(e){return this==e||e instanceof dy&&Pa(this.attrs,e.attrs)&&Pa(this.spec,e.spec)}destroy(){}}class gt{constructor(e,r,n){this.from=e,this.to=r,this.type=n}copy(e,r){return new gt(e,r,this.type)}eq(e,r=0){return this.type.eq(e.type)&&this.from+r==e.from&&this.to+r==e.to}map(e,r,n){return this.type.map(e,this,r,n)}static widget(e,r,n){return new gt(e,e,new eu(r,n))}static inline(e,r,n,i){return new gt(e,r,new ci(n,i))}static node(e,r,n,i){return new gt(e,r,new dy(n,i))}get spec(){return this.type.spec}get inline(){return this.type instanceof ci}get widget(){return this.type instanceof eu}}const Lo=[],Vi={};class Ke{constructor(e,r){this.local=e.length?e:Lo,this.children=r.length?r:Lo}static create(e,r){return r.length?tu(r,e,0,Vi):Ot}find(e,r,n){let i=[];return this.findInner(e??0,r??1e9,i,0,n),i}findInner(e,r,n,i,o){for(let s=0;s<this.local.length;s++){let a=this.local[s];a.from<=r&&a.to>=e&&(!o||o(a.spec))&&n.push(a.copy(a.from+i,a.to+i))}for(let s=0;s<this.children.length;s+=3)if(this.children[s]<r&&this.children[s+1]>e){let a=this.children[s]+1;this.children[s+2].findInner(e-a,r-a,n,i+a,o)}}map(e,r,n){return this==Ot||e.maps.length==0?this:this.mapInner(e,r,0,0,n||Vi)}mapInner(e,r,n,i,o){let s;for(let a=0;a<this.local.length;a++){let l=this.local[a].map(e,n,i);l&&l.type.valid(r,l)?(s||(s=[])).push(l):o.onRemove&&o.onRemove(this.local[a].spec)}return this.children.length?eP(this.children,s||[],e,r,n,i,o):s?new Ke(s.sort(Gi),Lo):Ot}add(e,r){return r.length?this==Ot?Ke.create(e,r):this.addInner(e,r,0):this}addInner(e,r,n){let i,o=0;e.forEach((a,l)=>{let c=l+n,u;if(u=aA(r,a,c)){for(i||(i=this.children.slice());o<i.length&&i[o]<l;)o+=3;i[o]==l?i[o+2]=i[o+2].addInner(a,u,c+1):i.splice(o,0,l,l+a.nodeSize,tu(u,a,c+1,Vi)),o+=3}});let s=sA(o?lA(r):r,-n);for(let a=0;a<s.length;a++)s[a].type.valid(e,s[a])||s.splice(a--,1);return new Ke(s.length?this.local.concat(s).sort(Gi):this.local,i||this.children)}remove(e){return e.length==0||this==Ot?this:this.removeInner(e,0)}removeInner(e,r){let n=this.children,i=this.local;for(let o=0;o<n.length;o+=3){let s,a=n[o]+r,l=n[o+1]+r;for(let u=0,f;u<e.length;u++)(f=e[u])&&f.from>a&&f.to<l&&(e[u]=null,(s||(s=[])).push(f));if(!s)continue;n==this.children&&(n=this.children.slice());let c=n[o+2].removeInner(s,a+1);c!=Ot?n[o+2]=c:(n.splice(o,3),o-=3)}if(i.length){for(let o=0,s;o<e.length;o++)if(s=e[o])for(let a=0;a<i.length;a++)i[a].eq(s,r)&&(i==this.local&&(i=this.local.slice()),i.splice(a--,1))}return n==this.children&&i==this.local?this:i.length||n.length?new Ke(i,n):Ot}forChild(e,r){if(this==Ot)return this;if(r.isLeaf)return Ke.empty;let n,i;for(let a=0;a<this.children.length;a+=3)if(this.children[a]>=e){this.children[a]==e&&(n=this.children[a+2]);break}let o=e+1,s=o+r.content.size;for(let a=0;a<this.local.length;a++){let l=this.local[a];if(l.from<s&&l.to>o&&l.type instanceof ci){let c=Math.max(o,l.from)-o,u=Math.min(s,l.to)-o;c<u&&(i||(i=[])).push(l.copy(c,u))}}if(i){let a=new Ke(i.sort(Gi),Lo);return n?new Yn([a,n]):a}return n||Ot}eq(e){if(this==e)return!0;if(!(e instanceof Ke)||this.local.length!=e.local.length||this.children.length!=e.children.length)return!1;for(let r=0;r<this.local.length;r++)if(!this.local[r].eq(e.local[r]))return!1;for(let r=0;r<this.children.length;r+=3)if(this.children[r]!=e.children[r]||this.children[r+1]!=e.children[r+1]||!this.children[r+2].eq(e.children[r+2]))return!1;return!0}locals(e){return hy(this.localsInner(e))}localsInner(e){if(this==Ot)return Lo;if(e.inlineContent||!this.local.some(ci.is))return this.local;let r=[];for(let n=0;n<this.local.length;n++)this.local[n].type instanceof ci||r.push(this.local[n]);return r}}Ke.empty=new Ke([],[]);Ke.removeOverlap=hy;const Ot=Ke.empty;class Yn{constructor(e){this.members=e}map(e,r){const n=this.members.map(i=>i.map(e,r,Vi));return Yn.from(n)}forChild(e,r){if(r.isLeaf)return Ke.empty;let n=[];for(let i=0;i<this.members.length;i++){let o=this.members[i].forChild(e,r);o!=Ot&&(o instanceof Yn?n=n.concat(o.members):n.push(o))}return Yn.from(n)}eq(e){if(!(e instanceof Yn)||e.members.length!=this.members.length)return!1;for(let r=0;r<this.members.length;r++)if(!this.members[r].eq(e.members[r]))return!1;return!0}locals(e){let r,n=!0;for(let i=0;i<this.members.length;i++){let o=this.members[i].localsInner(e);if(o.length)if(!r)r=o;else{n&&(r=r.slice(),n=!1);for(let s=0;s<o.length;s++)r.push(o[s])}}return r?hy(n?r:r.sort(Gi)):Lo}static from(e){switch(e.length){case 0:return Ot;case 1:return e[0];default:return new Yn(e.every(r=>r instanceof Ke)?e:e.reduce((r,n)=>r.concat(n instanceof Ke?n:n.members),[]))}}}function eP(t,e,r,n,i,o,s){let a=t.slice();for(let c=0,u=o;c<r.maps.length;c++){let f=0;r.maps[c].forEach((d,h,p,m)=>{let y=m-p-(h-d);for(let g=0;g<a.length;g+=3){let b=a[g+1];if(b<0||d>b+u-f)continue;let S=a[g]+u-f;h>=S?a[g+1]=d<=S?-2:-1:d>=u&&y&&(a[g]+=y,a[g+1]+=y)}f+=y}),u=r.maps[c].map(u,-1)}let l=!1;for(let c=0;c<a.length;c+=3)if(a[c+1]<0){if(a[c+1]==-2){l=!0,a[c+1]=-1;continue}let u=r.map(t[c]+o),f=u-i;if(f<0||f>=n.content.size){l=!0;continue}let d=r.map(t[c+1]+o,-1),h=d-i,{index:p,offset:m}=n.content.findIndex(f),y=n.maybeChild(p);if(y&&m==f&&m+y.nodeSize==h){let g=a[c+2].mapInner(r,y,u+1,t[c]+o+1,s);g!=Ot?(a[c]=f,a[c+1]=h,a[c+2]=g):(a[c+1]=-2,l=!0)}else l=!0}if(l){let c=tP(a,t,e,r,i,o,s),u=tu(c,n,0,s);e=u.local;for(let f=0;f<a.length;f+=3)a[f+1]<0&&(a.splice(f,3),f-=3);for(let f=0,d=0;f<u.children.length;f+=3){let h=u.children[f];for(;d<a.length&&a[d]<h;)d+=3;a.splice(d,0,u.children[f],u.children[f+1],u.children[f+2])}}return new Ke(e.sort(Gi),a)}function sA(t,e){if(!e||!t.length)return t;let r=[];for(let n=0;n<t.length;n++){let i=t[n];r.push(new gt(i.from+e,i.to+e,i.type))}return r}function tP(t,e,r,n,i,o,s){function a(l,c){for(let u=0;u<l.local.length;u++){let f=l.local[u].map(n,i,c);f?r.push(f):s.onRemove&&s.onRemove(l.local[u].spec)}for(let u=0;u<l.children.length;u+=3)a(l.children[u+2],l.children[u]+c+1)}for(let l=0;l<t.length;l+=3)t[l+1]==-1&&a(t[l+2],e[l]+o+1);return r}function aA(t,e,r){if(e.isLeaf)return null;let n=r+e.nodeSize,i=null;for(let o=0,s;o<t.length;o++)(s=t[o])&&s.from>r&&s.to<n&&((i||(i=[])).push(s),t[o]=null);return i}function lA(t){let e=[];for(let r=0;r<t.length;r++)t[r]!=null&&e.push(t[r]);return e}function tu(t,e,r,n){let i=[],o=!1;e.forEach((a,l)=>{let c=aA(t,a,l+r);if(c){o=!0;let u=tu(c,a,r+l+1,n);u!=Ot&&i.push(l,l+a.nodeSize,u)}});let s=sA(o?lA(t):t,-r).sort(Gi);for(let a=0;a<s.length;a++)s[a].type.valid(e,s[a])||(n.onRemove&&n.onRemove(s[a].spec),s.splice(a--,1));return s.length||i.length?new Ke(s,i):Ot}function Gi(t,e){return t.from-e.from||t.to-e.to}function hy(t){let e=t;for(let r=0;r<e.length-1;r++){let n=e[r];if(n.from!=n.to)for(let i=r+1;i<e.length;i++){let o=e[i];if(o.from==n.from){o.to!=n.to&&(e==t&&(e=t.slice()),e[i]=o.copy(o.from,n.to),fb(e,i+1,o.copy(n.to,o.to)));continue}else{o.from<n.to&&(e==t&&(e=t.slice()),e[r]=n.copy(n.from,o.from),fb(e,i,n.copy(o.from,n.to)));break}}}return e}function fb(t,e,r){for(;e<t.length&&Gi(r,t[e])>0;)e++;t.splice(e,0,r)}function Fd(t){let e=[];return t.someProp("decorations",r=>{let n=r(t.state);n&&n!=Ot&&e.push(n)}),t.cursorWrapper&&e.push(Ke.create(t.state.doc,[t.cursorWrapper.deco])),Yn.from(e)}const rP={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},nP=qt&&ai<=11;class iP{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}set(e){this.anchorNode=e.anchorNode,this.anchorOffset=e.anchorOffset,this.focusNode=e.focusNode,this.focusOffset=e.focusOffset}clear(){this.anchorNode=this.focusNode=null}eq(e){return e.anchorNode==this.anchorNode&&e.anchorOffset==this.anchorOffset&&e.focusNode==this.focusNode&&e.focusOffset==this.focusOffset}}class oP{constructor(e,r){this.view=e,this.handleDOMChange=r,this.queue=[],this.flushingSoon=-1,this.observer=null,this.currentSelection=new iP,this.onCharData=null,this.suppressingSelectionUpdates=!1,this.lastChangedTextNode=null,this.observer=window.MutationObserver&&new window.MutationObserver(n=>{for(let i=0;i<n.length;i++)this.queue.push(n[i]);qt&&ai<=11&&n.some(i=>i.type=="childList"&&i.removedNodes.length||i.type=="characterData"&&i.oldValue.length>i.target.nodeValue.length)?this.flushSoon():this.flush()}),nP&&(this.onCharData=n=>{this.queue.push({target:n.target,type:"characterData",oldValue:n.prevValue}),this.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this)}flushSoon(){this.flushingSoon<0&&(this.flushingSoon=window.setTimeout(()=>{this.flushingSoon=-1,this.flush()},20))}forceFlush(){this.flushingSoon>-1&&(window.clearTimeout(this.flushingSoon),this.flushingSoon=-1,this.flush())}start(){this.observer&&(this.observer.takeRecords(),this.observer.observe(this.view.dom,rP)),this.onCharData&&this.view.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.connectSelection()}stop(){if(this.observer){let e=this.observer.takeRecords();if(e.length){for(let r=0;r<e.length;r++)this.queue.push(e[r]);window.setTimeout(()=>this.flush(),20)}this.observer.disconnect()}this.onCharData&&this.view.dom.removeEventListener("DOMCharacterDataModified",this.onCharData),this.disconnectSelection()}connectSelection(){this.view.dom.ownerDocument.addEventListener("selectionchange",this.onSelectionChange)}disconnectSelection(){this.view.dom.ownerDocument.removeEventListener("selectionchange",this.onSelectionChange)}suppressSelectionUpdates(){this.suppressingSelectionUpdates=!0,setTimeout(()=>this.suppressingSelectionUpdates=!1,50)}onSelectionChange(){if(nb(this.view)){if(this.suppressingSelectionUpdates)return Sn(this.view);if(qt&&ai<=11&&!this.view.state.selection.empty){let e=this.view.domSelectionRange();if(e.focusNode&&Qi(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset))return this.flushSoon()}this.flush()}}setCurSelection(){this.currentSelection.set(this.view.domSelectionRange())}ignoreSelectionChange(e){if(!e.focusNode)return!0;let r=new Set,n;for(let o=e.focusNode;o;o=Ia(o))r.add(o);for(let o=e.anchorNode;o;o=Ia(o))if(r.has(o)){n=o;break}let i=n&&this.view.docView.nearestDesc(n);if(i&&i.ignoreMutation({type:"selection",target:n.nodeType==3?n.parentNode:n}))return this.setCurSelection(),!0}pendingRecords(){if(this.observer)for(let e of this.observer.takeRecords())this.queue.push(e);return this.queue}flush(){let{view:e}=this;if(!e.docView||this.flushingSoon>-1)return;let r=this.pendingRecords();r.length&&(this.queue=[]);let n=e.domSelectionRange(),i=!this.suppressingSelectionUpdates&&!this.currentSelection.eq(n)&&nb(e)&&!this.ignoreSelectionChange(n),o=-1,s=-1,a=!1,l=[];if(e.editable)for(let u=0;u<r.length;u++){let f=this.registerMutation(r[u],l);f&&(o=o<0?f.from:Math.min(f.from,o),s=s<0?f.to:Math.max(f.to,s),f.typeOver&&(a=!0))}if(Cr&&l.length){let u=l.filter(f=>f.nodeName=="BR");if(u.length==2){let[f,d]=u;f.parentNode&&f.parentNode.parentNode==d.parentNode?d.remove():f.remove()}else{let{focusNode:f}=this.currentSelection;for(let d of u){let h=d.parentNode;h&&h.nodeName=="LI"&&(!f||lP(e,f)!=h)&&d.remove()}}}let c=null;o<0&&i&&e.input.lastFocus>Date.now()-200&&Math.max(e.input.lastTouch,e.input.lastClick.time)<Date.now()-300&&Tf(n)&&(c=ay(e))&&c.eq(Re.near(e.state.doc.resolve(0),1))?(e.input.lastFocus=0,Sn(e),this.currentSelection.set(n),e.scrollToSelection()):(o>-1||i)&&(o>-1&&(e.docView.markDirty(o,s),sP(e)),this.handleDOMChange(o,s,a,l),e.docView&&e.docView.dirty?e.updateState(e.state):this.currentSelection.eq(n)||Sn(e),this.currentSelection.set(n))}registerMutation(e,r){if(r.indexOf(e.target)>-1)return null;let n=this.view.docView.nearestDesc(e.target);if(e.type=="attributes"&&(n==this.view.docView||e.attributeName=="contenteditable"||e.attributeName=="style"&&!e.oldValue&&!e.target.getAttribute("style"))||!n||n.ignoreMutation(e))return null;if(e.type=="childList"){for(let u=0;u<e.addedNodes.length;u++){let f=e.addedNodes[u];r.push(f),f.nodeType==3&&(this.lastChangedTextNode=f)}if(n.contentDOM&&n.contentDOM!=n.dom&&!n.contentDOM.contains(e.target))return{from:n.posBefore,to:n.posAfter};let i=e.previousSibling,o=e.nextSibling;if(qt&&ai<=11&&e.addedNodes.length)for(let u=0;u<e.addedNodes.length;u++){let{previousSibling:f,nextSibling:d}=e.addedNodes[u];(!f||Array.prototype.indexOf.call(e.addedNodes,f)<0)&&(i=f),(!d||Array.prototype.indexOf.call(e.addedNodes,d)<0)&&(o=d)}let s=i&&i.parentNode==e.target?Tt(i)+1:0,a=n.localPosFromDOM(e.target,s,-1),l=o&&o.parentNode==e.target?Tt(o):e.target.childNodes.length,c=n.localPosFromDOM(e.target,l,1);return{from:a,to:c}}else return e.type=="attributes"?{from:n.posAtStart-n.border,to:n.posAtEnd+n.border}:(this.lastChangedTextNode=e.target,{from:n.posAtStart,to:n.posAtEnd,typeOver:e.target.nodeValue==e.oldValue})}}let db=new WeakMap,hb=!1;function sP(t){if(!db.has(t)&&(db.set(t,null),["normal","nowrap","pre-line"].indexOf(getComputedStyle(t.dom).whiteSpace)!==-1)){if(t.requiresGeckoHackNode=Cr,hb)return;console.warn("ProseMirror expects the CSS white-space property to be set, preferably to 'pre-wrap'. It is recommended to load style/prosemirror.css from the prosemirror-view package."),hb=!0}}function pb(t,e){let r=e.startContainer,n=e.startOffset,i=e.endContainer,o=e.endOffset,s=t.domAtPos(t.state.selection.anchor);return Qi(s.node,s.offset,i,o)&&([r,n,i,o]=[i,o,r,n]),{anchorNode:r,anchorOffset:n,focusNode:i,focusOffset:o}}function aP(t,e){if(e.getComposedRanges){let i=e.getComposedRanges(t.root)[0];if(i)return pb(t,i)}let r;function n(i){i.preventDefault(),i.stopImmediatePropagation(),r=i.getTargetRanges()[0]}return t.dom.addEventListener("beforeinput",n,!0),document.execCommand("indent"),t.dom.removeEventListener("beforeinput",n,!0),r?pb(t,r):null}function lP(t,e){for(let r=e.parentNode;r&&r!=t.dom;r=r.parentNode){let n=t.docView.nearestDesc(r,!0);if(n&&n.node.isBlock)return r}return null}function cP(t,e,r){let{node:n,fromOffset:i,toOffset:o,from:s,to:a}=t.docView.parseRange(e,r),l=t.domSelectionRange(),c,u=l.anchorNode;if(u&&t.dom.contains(u.nodeType==1?u:u.parentNode)&&(c=[{node:u,offset:l.anchorOffset}],Tf(l)||c.push({node:l.focusNode,offset:l.focusOffset})),Rt&&t.input.lastKeyCode===8)for(let y=o;y>i;y--){let g=n.childNodes[y-1],b=g.pmViewDesc;if(g.nodeName=="BR"&&!b){o=y;break}if(!b||b.size)break}let f=t.state.doc,d=t.someProp("domParser")||fa.fromSchema(t.state.schema),h=f.resolve(s),p=null,m=d.parse(n,{topNode:h.parent,topMatch:h.parent.contentMatchAt(h.index()),topOpen:!0,from:i,to:o,preserveWhitespace:h.parent.type.whitespace=="pre"?"full":!0,findPositions:c,ruleFromNode:uP,context:h});if(c&&c[0].pos!=null){let y=c[0].pos,g=c[1]&&c[1].pos;g==null&&(g=y),p={anchor:y+s,head:g+s}}return{doc:m,sel:p,from:s,to:a}}function uP(t){let e=t.pmViewDesc;if(e)return e.parseRule();if(t.nodeName=="BR"&&t.parentNode){if(Ht&&/^(ul|ol)$/i.test(t.parentNode.nodeName)){let r=document.createElement("div");return r.appendChild(document.createElement("li")),{skip:r}}else if(t.parentNode.lastChild==t||Ht&&/^(tr|table)$/i.test(t.parentNode.nodeName))return{ignore:!0}}else if(t.nodeName=="IMG"&&t.getAttribute("mark-placeholder"))return{ignore:!0};return null}const fP=/^(a|abbr|acronym|b|bd[io]|big|br|button|cite|code|data(list)?|del|dfn|em|i|ins|kbd|label|map|mark|meter|output|q|ruby|s|samp|small|span|strong|su[bp]|time|u|tt|var)$/i;function dP(t,e,r,n,i){let o=t.input.compositionPendingChanges||(t.composing?t.input.compositionID:0);if(t.input.compositionPendingChanges=0,e<0){let A=t.input.lastSelectionTime>Date.now()-50?t.input.lastSelectionOrigin:null,V=ay(t,A);if(V&&!t.state.selection.eq(V)){if(Rt&&Er&&t.input.lastKeyCode===13&&Date.now()-100<t.input.lastKeyCodeTime&&t.someProp("handleKeyDown",I=>I(t,Li(13,"Enter"))))return;let Q=t.state.tr.setSelection(V);A=="pointer"?Q.setMeta("pointer",!0):A=="key"&&Q.scrollIntoView(),o&&Q.setMeta("composition",o),t.dispatch(Q)}return}let s=t.state.doc.resolve(e),a=s.sharedDepth(r);e=s.before(a+1),r=t.state.doc.resolve(r).after(a+1);let l=t.state.selection,c=cP(t,e,r),u=t.state.doc,f=u.slice(c.from,c.to),d,h;t.input.lastKeyCode===8&&Date.now()-100<t.input.lastKeyCodeTime?(d=t.state.selection.to,h="end"):(d=t.state.selection.from,h="start"),t.input.lastKeyCode=null;let p=mP(f.content,c.doc.content,c.from,d,h);if((ss&&t.input.lastIOSEnter>Date.now()-225||Er)&&i.some(A=>A.nodeType==1&&!fP.test(A.nodeName))&&(!p||p.endA>=p.endB)&&t.someProp("handleKeyDown",A=>A(t,Li(13,"Enter")))){t.input.lastIOSEnter=0;return}if(!p)if(n&&l instanceof _e&&!l.empty&&l.$head.sameParent(l.$anchor)&&!t.composing&&!(c.sel&&c.sel.anchor!=c.sel.head))p={start:l.from,endA:l.to,endB:l.to};else{if(c.sel){let A=mb(t,t.state.doc,c.sel);if(A&&!A.eq(t.state.selection)){let V=t.state.tr.setSelection(A);o&&V.setMeta("composition",o),t.dispatch(V)}}return}t.input.domChangeCount++,t.state.selection.from<t.state.selection.to&&p.start==p.endB&&t.state.selection instanceof _e&&(p.start>t.state.selection.from&&p.start<=t.state.selection.from+2&&t.state.selection.from>=c.from?p.start=t.state.selection.from:p.endA<t.state.selection.to&&p.endA>=t.state.selection.to-2&&t.state.selection.to<=c.to&&(p.endB+=t.state.selection.to-p.endA,p.endA=t.state.selection.to)),qt&&ai<=11&&p.endB==p.start+1&&p.endA==p.start&&p.start>c.from&&c.doc.textBetween(p.start-c.from-1,p.start-c.from+1)=="  "&&(p.start--,p.endA--,p.endB--);let m=c.doc.resolveNoCache(p.start-c.from),y=c.doc.resolveNoCache(p.endB-c.from),g=u.resolve(p.start),b=m.sameParent(y)&&m.parent.inlineContent&&g.end()>=p.endA,S;if((ss&&t.input.lastIOSEnter>Date.now()-225&&(!b||i.some(A=>A.nodeName=="DIV"||A.nodeName=="P"))||!b&&m.pos<c.doc.content.size&&!m.sameParent(y)&&(S=Re.findFrom(c.doc.resolve(m.pos+1),1,!0))&&S.head==y.pos)&&t.someProp("handleKeyDown",A=>A(t,Li(13,"Enter")))){t.input.lastIOSEnter=0;return}if(t.state.selection.anchor>p.start&&pP(u,p.start,p.endA,m,y)&&t.someProp("handleKeyDown",A=>A(t,Li(8,"Backspace")))){Er&&Rt&&t.domObserver.suppressSelectionUpdates();return}Rt&&Er&&p.endB==p.start&&(t.input.lastAndroidDelete=Date.now()),Er&&!b&&m.start()!=y.start()&&y.parentOffset==0&&m.depth==y.depth&&c.sel&&c.sel.anchor==c.sel.head&&c.sel.head==p.endA&&(p.endB-=2,y=c.doc.resolveNoCache(p.endB-c.from),setTimeout(()=>{t.someProp("handleKeyDown",function(A){return A(t,Li(13,"Enter"))})},20));let x=p.start,O=p.endA,M,D,$;if(b){if(m.pos==y.pos)qt&&ai<=11&&m.parentOffset==0&&(t.domObserver.suppressSelectionUpdates(),setTimeout(()=>Sn(t),20)),M=t.state.tr.delete(x,O),D=u.resolve(p.start).marksAcross(u.resolve(p.endA));else if(p.endA==p.endB&&($=hP(m.parent.content.cut(m.parentOffset,y.parentOffset),g.parent.content.cut(g.parentOffset,p.endA-g.start()))))M=t.state.tr,$.type=="add"?M.addMark(x,O,$.mark):M.removeMark(x,O,$.mark);else if(m.parent.child(m.index()).isText&&m.index()==y.index()-(y.textOffset?0:1)){let A=m.parent.textBetween(m.parentOffset,y.parentOffset);if(t.someProp("handleTextInput",V=>V(t,x,O,A)))return;M=t.state.tr.insertText(A,x,O)}}if(M||(M=t.state.tr.replace(x,O,c.doc.slice(p.start-c.from,p.endB-c.from))),c.sel){let A=mb(t,M.doc,c.sel);A&&!(Rt&&Er&&t.composing&&A.empty&&(p.start!=p.endB||t.input.lastAndroidDelete<Date.now()-100)&&(A.head==x||A.head==M.mapping.map(O)-1)||qt&&A.empty&&A.head==x)&&M.setSelection(A)}D&&M.ensureMarks(D),o&&M.setMeta("composition",o),t.dispatch(M.scrollIntoView())}function mb(t,e,r){return Math.max(r.anchor,r.head)>e.content.size?null:ly(t,e.resolve(r.anchor),e.resolve(r.head))}function hP(t,e){let r=t.firstChild.marks,n=e.firstChild.marks,i=r,o=n,s,a,l;for(let u=0;u<n.length;u++)i=n[u].removeFromSet(i);for(let u=0;u<r.length;u++)o=r[u].removeFromSet(o);if(i.length==1&&o.length==0)a=i[0],s="add",l=u=>u.mark(a.addToSet(u.marks));else if(i.length==0&&o.length==1)a=o[0],s="remove",l=u=>u.mark(a.removeFromSet(u.marks));else return null;let c=[];for(let u=0;u<e.childCount;u++)c.push(l(e.child(u)));if(he.from(c).eq(t))return{mark:a,type:s}}function pP(t,e,r,n,i){if(r-e<=i.pos-n.pos||Bd(n,!0,!1)<i.pos)return!1;let o=t.resolve(e);if(!n.parent.isTextblock){let a=o.nodeAfter;return a!=null&&r==e+a.nodeSize}if(o.parentOffset<o.parent.content.size||!o.parent.isTextblock)return!1;let s=t.resolve(Bd(o,!0,!0));return!s.parent.isTextblock||s.pos>r||Bd(s,!0,!1)<r?!1:n.parent.content.cut(n.parentOffset).eq(s.parent.content)}function Bd(t,e,r){let n=t.depth,i=e?t.end():t.pos;for(;n>0&&(e||t.indexAfter(n)==t.node(n).childCount);)n--,i++,e=!1;if(r){let o=t.node(n).maybeChild(t.indexAfter(n));for(;o&&!o.isLeaf;)o=o.firstChild,i++}return i}function mP(t,e,r,n,i){let o=t.findDiffStart(e,r);if(o==null)return null;let{a:s,b:a}=t.findDiffEnd(e,r+t.size,r+e.size);if(i=="end"){let l=Math.max(0,o-Math.min(s,a));n-=s+l-o}if(s<o&&t.size<e.size){let l=n<=o&&n>=s?o-n:0;o-=l,o&&o<e.size&&gb(e.textBetween(o-1,o+1))&&(o+=l?1:-1),a=o+(a-s),s=o}else if(a<o){let l=n<=o&&n>=a?o-n:0;o-=l,o&&o<t.size&&gb(t.textBetween(o-1,o+1))&&(o+=l?1:-1),s=o+(s-a),a=o}return{start:o,endA:s,endB:a}}function gb(t){if(t.length!=2)return!1;let e=t.charCodeAt(0),r=t.charCodeAt(1);return e>=56320&&e<=57343&&r>=55296&&r<=56319}class gP{constructor(e,r){this._root=null,this.focused=!1,this.trackWrites=null,this.mounted=!1,this.markCursor=null,this.cursorWrapper=null,this.lastSelectedViewDesc=void 0,this.input=new PD,this.prevDirectPlugins=[],this.pluginViews=[],this.requiresGeckoHackNode=!1,this.dragging=null,this._props=r,this.state=r.state,this.directPlugins=r.plugins||[],this.directPlugins.forEach(xb),this.dispatch=this.dispatch.bind(this),this.dom=e&&e.mount||document.createElement("div"),e&&(e.appendChild?e.appendChild(this.dom):typeof e=="function"?e(this.dom):e.mount&&(this.mounted=!0)),this.editable=wb(this),vb(this),this.nodeViews=bb(this),this.docView=Yw(this.state.doc,yb(this),Fd(this),this.dom,this),this.domObserver=new oP(this,(n,i,o,s)=>dP(this,n,i,o,s)),this.domObserver.start(),LD(this),this.updatePluginViews()}get composing(){return this.input.composing}get props(){if(this._props.state!=this.state){let e=this._props;this._props={};for(let r in e)this._props[r]=e[r];this._props.state=this.state}return this._props}update(e){e.handleDOMEvents!=this._props.handleDOMEvents&&um(this);let r=this._props;this._props=e,e.plugins&&(e.plugins.forEach(xb),this.directPlugins=e.plugins),this.updateStateInner(e.state,r)}setProps(e){let r={};for(let n in this._props)r[n]=this._props[n];r.state=this.state;for(let n in e)r[n]=e[n];this.update(r)}updateState(e){this.updateStateInner(e,this._props)}updateStateInner(e,r){var n;let i=this.state,o=!1,s=!1;e.storedMarks&&this.composing&&(rA(this),s=!0),this.state=e;let a=i.plugins!=e.plugins||this._props.plugins!=r.plugins;if(a||this._props.plugins!=r.plugins||this._props.nodeViews!=r.nodeViews){let h=bb(this);vP(h,this.nodeViews)&&(this.nodeViews=h,o=!0)}(a||r.handleDOMEvents!=this._props.handleDOMEvents)&&um(this),this.editable=wb(this),vb(this);let l=Fd(this),c=yb(this),u=i.plugins!=e.plugins&&!i.doc.eq(e.doc)?"reset":e.scrollToSelection>i.scrollToSelection?"to selection":"preserve",f=o||!this.docView.matchesNode(e.doc,c,l);(f||!e.selection.eq(i.selection))&&(s=!0);let d=u=="preserve"&&s&&this.dom.style.overflowAnchor==null&&YN(this);if(s){this.domObserver.stop();let h=f&&(qt||Rt)&&!this.composing&&!i.selection.empty&&!e.selection.empty&&yP(i.selection,e.selection);if(f){let p=Rt?this.trackWrites=this.domSelectionRange().focusNode:null;this.composing&&(this.input.compositionNode=XD(this)),(o||!this.docView.update(e.doc,c,l,this))&&(this.docView.updateOuterDeco(c),this.docView.destroy(),this.docView=Yw(e.doc,c,l,this.dom,this)),p&&!this.trackWrites&&(h=!0)}h||!(this.input.mouseDown&&this.domObserver.currentSelection.eq(this.domSelectionRange())&&xD(this))?Sn(this,h):(UT(this,e.selection),this.domObserver.setCurSelection()),this.domObserver.start()}this.updatePluginViews(i),!((n=this.dragging)===null||n===void 0)&&n.node&&!i.doc.eq(e.doc)&&this.updateDraggedNode(this.dragging,i),u=="reset"?this.dom.scrollTop=0:u=="to selection"?this.scrollToSelection():d&&ZN(d)}scrollToSelection(){let e=this.domSelectionRange().focusNode;if(!this.someProp("handleScrollToSelection",r=>r(this)))if(this.state.selection instanceof ke){let r=this.docView.domAfterPos(this.state.selection.from);r.nodeType==1&&Vw(this,r.getBoundingClientRect(),e)}else Vw(this,this.coordsAtPos(this.state.selection.head,1),e)}destroyPluginViews(){let e;for(;e=this.pluginViews.pop();)e.destroy&&e.destroy()}updatePluginViews(e){if(!e||e.plugins!=this.state.plugins||this.directPlugins!=this.prevDirectPlugins){this.prevDirectPlugins=this.directPlugins,this.destroyPluginViews();for(let r=0;r<this.directPlugins.length;r++){let n=this.directPlugins[r];n.spec.view&&this.pluginViews.push(n.spec.view(this))}for(let r=0;r<this.state.plugins.length;r++){let n=this.state.plugins[r];n.spec.view&&this.pluginViews.push(n.spec.view(this))}}else for(let r=0;r<this.pluginViews.length;r++){let n=this.pluginViews[r];n.update&&n.update(this,e)}}updateDraggedNode(e,r){let n=e.node,i=-1;if(this.state.doc.nodeAt(n.from)==n.node)i=n.from;else{let o=n.from+(this.state.doc.content.size-r.doc.content.size);(o>0&&this.state.doc.nodeAt(o))==n.node&&(i=o)}this.dragging=new iA(e.slice,e.move,i<0?void 0:ke.create(this.state.doc,i))}someProp(e,r){let n=this._props&&this._props[e],i;if(n!=null&&(i=r?r(n):n))return i;for(let s=0;s<this.directPlugins.length;s++){let a=this.directPlugins[s].props[e];if(a!=null&&(i=r?r(a):a))return i}let o=this.state.plugins;if(o)for(let s=0;s<o.length;s++){let a=o[s].props[e];if(a!=null&&(i=r?r(a):a))return i}}hasFocus(){if(qt){let e=this.root.activeElement;if(e==this.dom)return!0;if(!e||!this.dom.contains(e))return!1;for(;e&&this.dom!=e&&this.dom.contains(e);){if(e.contentEditable=="false")return!1;e=e.parentElement}return!0}return this.root.activeElement==this.dom}focus(){this.domObserver.stop(),this.editable&&QN(this.dom),Sn(this),this.domObserver.start()}get root(){let e=this._root;if(e==null){for(let r=this.dom.parentNode;r;r=r.parentNode)if(r.nodeType==9||r.nodeType==11&&r.host)return r.getSelection||(Object.getPrototypeOf(r).getSelection=()=>r.ownerDocument.getSelection()),this._root=r}return e||document}updateRoot(){this._root=null}posAtCoords(e){return iD(this,e)}coordsAtPos(e,r=1){return PT(this,e,r)}domAtPos(e,r=0){return this.docView.domFromPos(e,r)}nodeDOM(e){let r=this.docView.descAt(e);return r?r.nodeDOM:null}posAtDOM(e,r,n=-1){let i=this.docView.posFromDOM(e,r,n);if(i==null)throw new RangeError("DOM position not inside the editor");return i}endOfTextblock(e,r){return cD(this,r||this.state,e)}pasteHTML(e,r){return Da(this,"",e,!1,r||new ClipboardEvent("paste"))}pasteText(e,r){return Da(this,e,null,!0,r||new ClipboardEvent("paste"))}destroy(){this.docView&&(FD(this),this.destroyPluginViews(),this.mounted?(this.docView.update(this.state.doc,[],Fd(this),this),this.dom.textContent=""):this.dom.parentNode&&this.dom.parentNode.removeChild(this.dom),this.docView.destroy(),this.docView=null,jN())}get isDestroyed(){return this.docView==null}dispatchEvent(e){return $D(this,e)}dispatch(e){let r=this._props.dispatchTransaction;r?r.call(this,e):this.updateState(this.state.apply(e))}domSelectionRange(){let e=this.domSelection();return e?Ht&&this.root.nodeType===11&&VN(this.dom.ownerDocument)==this.dom&&aP(this,e)||e:{focusNode:null,focusOffset:0,anchorNode:null,anchorOffset:0}}domSelection(){return this.root.getSelection()}}function yb(t){let e=Object.create(null);return e.class="ProseMirror",e.contenteditable=String(t.editable),t.someProp("attributes",r=>{if(typeof r=="function"&&(r=r(t.state)),r)for(let n in r)n=="class"?e.class+=" "+r[n]:n=="style"?e.style=(e.style?e.style+";":"")+r[n]:!e[n]&&n!="contenteditable"&&n!="nodeName"&&(e[n]=String(r[n]))}),e.translate||(e.translate="no"),[gt.node(0,t.state.doc.content.size,e)]}function vb(t){if(t.markCursor){let e=document.createElement("img");e.className="ProseMirror-separator",e.setAttribute("mark-placeholder","true"),e.setAttribute("alt",""),t.cursorWrapper={dom:e,deco:gt.widget(t.state.selection.from,e,{raw:!0,marks:t.markCursor})}}else t.cursorWrapper=null}function wb(t){return!t.someProp("editable",e=>e(t.state)===!1)}function yP(t,e){let r=Math.min(t.$anchor.sharedDepth(t.head),e.$anchor.sharedDepth(e.head));return t.$anchor.start(r)!=e.$anchor.start(r)}function bb(t){let e=Object.create(null);function r(n){for(let i in n)Object.prototype.hasOwnProperty.call(e,i)||(e[i]=n[i])}return t.someProp("nodeViews",r),t.someProp("markViews",r),e}function vP(t,e){let r=0,n=0;for(let i in t){if(t[i]!=e[i])return!0;r++}for(let i in e)n++;return r!=n}function xb(t){if(t.spec.state||t.spec.filterTransaction||t.spec.appendTransaction)throw new RangeError("Plugins passed directly to the view must not have a state component")}var fi={8:"Backspace",9:"Tab",10:"Enter",12:"NumLock",13:"Enter",16:"Shift",17:"Control",18:"Alt",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",44:"PrintScreen",45:"Insert",46:"Delete",59:";",61:"=",91:"Meta",92:"Meta",106:"*",107:"+",108:",",109:"-",110:".",111:"/",144:"NumLock",145:"ScrollLock",160:"Shift",161:"Shift",162:"Control",163:"Control",164:"Alt",165:"Alt",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},ru={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},wP=typeof navigator<"u"&&/Mac/.test(navigator.platform),bP=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);for(var At=0;At<10;At++)fi[48+At]=fi[96+At]=String(At);for(var At=1;At<=24;At++)fi[At+111]="F"+At;for(var At=65;At<=90;At++)fi[At]=String.fromCharCode(At+32),ru[At]=String.fromCharCode(At);for(var $d in fi)ru.hasOwnProperty($d)||(ru[$d]=fi[$d]);function xP(t){var e=wP&&t.metaKey&&t.shiftKey&&!t.ctrlKey&&!t.altKey||bP&&t.shiftKey&&t.key&&t.key.length==1||t.key=="Unidentified",r=!e&&t.key||(t.shiftKey?ru:fi)[t.keyCode]||t.key||"Unidentified";return r=="Esc"&&(r="Escape"),r=="Del"&&(r="Delete"),r=="Left"&&(r="ArrowLeft"),r=="Up"&&(r="ArrowUp"),r=="Right"&&(r="ArrowRight"),r=="Down"&&(r="ArrowDown"),r}const SP=typeof navigator<"u"?/Mac|iP(hone|[oa]d)/.test(navigator.platform):!1;function EP(t){let e=t.split(/-(?!$)/),r=e[e.length-1];r=="Space"&&(r=" ");let n,i,o,s;for(let a=0;a<e.length-1;a++){let l=e[a];if(/^(cmd|meta|m)$/i.test(l))s=!0;else if(/^a(lt)?$/i.test(l))n=!0;else if(/^(c|ctrl|control)$/i.test(l))i=!0;else if(/^s(hift)?$/i.test(l))o=!0;else if(/^mod$/i.test(l))SP?s=!0:i=!0;else throw new Error("Unrecognized modifier name: "+l)}return n&&(r="Alt-"+r),i&&(r="Ctrl-"+r),s&&(r="Meta-"+r),o&&(r="Shift-"+r),r}function TP(t){let e=Object.create(null);for(let r in t)e[EP(r)]=t[r];return e}function jd(t,e,r=!0){return e.altKey&&(t="Alt-"+t),e.ctrlKey&&(t="Ctrl-"+t),e.metaKey&&(t="Meta-"+t),r&&e.shiftKey&&(t="Shift-"+t),t}function AP(t){return new tt({props:{handleKeyDown:py(t)}})}function py(t){let e=TP(t);return function(r,n){let i=xP(n),o,s=e[jd(i,n)];if(s&&s(r.state,r.dispatch,r))return!0;if(i.length==1&&i!=" "){if(n.shiftKey){let a=e[jd(i,n,!1)];if(a&&a(r.state,r.dispatch,r))return!0}if((n.shiftKey||n.altKey||n.metaKey||i.charCodeAt(0)>127)&&(o=fi[n.keyCode])&&o!=i){let a=e[jd(o,n)];if(a&&a(r.state,r.dispatch,r))return!0}}return!1}}const cA=(t,e)=>t.selection.empty?!1:(e&&e(t.tr.deleteSelection().scrollIntoView()),!0);function uA(t,e){let{$cursor:r}=t.selection;return!r||(e?!e.endOfTextblock("backward",t):r.parentOffset>0)?null:r}const CP=(t,e,r)=>{let n=uA(t,r);if(!n)return!1;let i=my(n);if(!i){let s=n.blockRange(),a=s&&Os(s);return a==null?!1:(e&&e(t.tr.lift(s,a).scrollIntoView()),!0)}let o=i.nodeBefore;if(pA(t,i,e,-1))return!0;if(n.parent.content.size==0&&(as(o,"end")||ke.isSelectable(o)))for(let s=n.depth;;s--){let a=Sf(t.doc,n.before(s),n.after(s),we.empty);if(a&&a.slice.size<a.to-a.from){if(e){let l=t.tr.step(a);l.setSelection(as(o,"end")?Re.findFrom(l.doc.resolve(l.mapping.map(i.pos,-1)),-1):ke.create(l.doc,i.pos-o.nodeSize)),e(l.scrollIntoView())}return!0}if(s==1||n.node(s-1).childCount>1)break}return o.isAtom&&i.depth==n.depth-1?(e&&e(t.tr.delete(i.pos-o.nodeSize,i.pos).scrollIntoView()),!0):!1},kP=(t,e,r)=>{let n=uA(t,r);if(!n)return!1;let i=my(n);return i?fA(t,i,e):!1},_P=(t,e,r)=>{let n=dA(t,r);if(!n)return!1;let i=gy(n);return i?fA(t,i,e):!1};function fA(t,e,r){let n=e.nodeBefore,i=n,o=e.pos-1;for(;!i.isTextblock;o--){if(i.type.spec.isolating)return!1;let u=i.lastChild;if(!u)return!1;i=u}let s=e.nodeAfter,a=s,l=e.pos+1;for(;!a.isTextblock;l++){if(a.type.spec.isolating)return!1;let u=a.firstChild;if(!u)return!1;a=u}let c=Sf(t.doc,o,l,we.empty);if(!c||c.from!=o||c instanceof mt&&c.slice.size>=l-o)return!1;if(r){let u=t.tr.step(c);u.setSelection(_e.create(u.doc,o)),r(u.scrollIntoView())}return!0}function as(t,e,r=!1){for(let n=t;n;n=e=="start"?n.firstChild:n.lastChild){if(n.isTextblock)return!0;if(r&&n.childCount!=1)return!1}return!1}const OP=(t,e,r)=>{let{$head:n,empty:i}=t.selection,o=n;if(!i)return!1;if(n.parent.isTextblock){if(r?!r.endOfTextblock("backward",t):n.parentOffset>0)return!1;o=my(n)}let s=o&&o.nodeBefore;return!s||!ke.isSelectable(s)?!1:(e&&e(t.tr.setSelection(ke.create(t.doc,o.pos-s.nodeSize)).scrollIntoView()),!0)};function my(t){if(!t.parent.type.spec.isolating)for(let e=t.depth-1;e>=0;e--){if(t.index(e)>0)return t.doc.resolve(t.before(e+1));if(t.node(e).type.spec.isolating)break}return null}function dA(t,e){let{$cursor:r}=t.selection;return!r||(e?!e.endOfTextblock("forward",t):r.parentOffset<r.parent.content.size)?null:r}const RP=(t,e,r)=>{let n=dA(t,r);if(!n)return!1;let i=gy(n);if(!i)return!1;let o=i.nodeAfter;if(pA(t,i,e,1))return!0;if(n.parent.content.size==0&&(as(o,"start")||ke.isSelectable(o))){let s=Sf(t.doc,n.before(),n.after(),we.empty);if(s&&s.slice.size<s.to-s.from){if(e){let a=t.tr.step(s);a.setSelection(as(o,"start")?Re.findFrom(a.doc.resolve(a.mapping.map(i.pos)),1):ke.create(a.doc,a.mapping.map(i.pos))),e(a.scrollIntoView())}return!0}}return o.isAtom&&i.depth==n.depth-1?(e&&e(t.tr.delete(i.pos,i.pos+o.nodeSize).scrollIntoView()),!0):!1},MP=(t,e,r)=>{let{$head:n,empty:i}=t.selection,o=n;if(!i)return!1;if(n.parent.isTextblock){if(r?!r.endOfTextblock("forward",t):n.parentOffset<n.parent.content.size)return!1;o=gy(n)}let s=o&&o.nodeAfter;return!s||!ke.isSelectable(s)?!1:(e&&e(t.tr.setSelection(ke.create(t.doc,o.pos)).scrollIntoView()),!0)};function gy(t){if(!t.parent.type.spec.isolating)for(let e=t.depth-1;e>=0;e--){let r=t.node(e);if(t.index(e)+1<r.childCount)return t.doc.resolve(t.after(e+1));if(r.type.spec.isolating)break}return null}const IP=(t,e)=>{let r=t.selection,n=r instanceof ke,i;if(n){if(r.node.isTextblock||!Si(t.doc,r.from))return!1;i=r.from}else if(i=xf(t.doc,r.from,-1),i==null)return!1;if(e){let o=t.tr.join(i);n&&o.setSelection(ke.create(o.doc,i-t.doc.resolve(i).nodeBefore.nodeSize)),e(o.scrollIntoView())}return!0},NP=(t,e)=>{let r=t.selection,n;if(r instanceof ke){if(r.node.isTextblock||!Si(t.doc,r.to))return!1;n=r.to}else if(n=xf(t.doc,r.to,1),n==null)return!1;return e&&e(t.tr.join(n).scrollIntoView()),!0},DP=(t,e)=>{let{$from:r,$to:n}=t.selection,i=r.blockRange(n),o=i&&Os(i);return o==null?!1:(e&&e(t.tr.lift(i,o).scrollIntoView()),!0)},PP=(t,e)=>{let{$head:r,$anchor:n}=t.selection;return!r.parent.type.spec.code||!r.sameParent(n)?!1:(e&&e(t.tr.insertText(`
10
- `).scrollIntoView()),!0)};function hA(t){for(let e=0;e<t.edgeCount;e++){let{type:r}=t.edge(e);if(r.isTextblock&&!r.hasRequiredAttrs())return r}return null}const LP=(t,e)=>{let{$head:r,$anchor:n}=t.selection;if(!r.parent.type.spec.code||!r.sameParent(n))return!1;let i=r.node(-1),o=r.indexAfter(-1),s=hA(i.contentMatchAt(o));if(!s||!i.canReplaceWith(o,o,s))return!1;if(e){let a=r.after(),l=t.tr.replaceWith(a,a,s.createAndFill());l.setSelection(Re.near(l.doc.resolve(a),1)),e(l.scrollIntoView())}return!0},FP=(t,e)=>{let r=t.selection,{$from:n,$to:i}=r;if(r instanceof hr||n.parent.inlineContent||i.parent.inlineContent)return!1;let o=hA(i.parent.contentMatchAt(i.indexAfter()));if(!o||!o.isTextblock)return!1;if(e){let s=(!n.parentOffset&&i.index()<i.parent.childCount?n:i).pos,a=t.tr.insert(s,o.createAndFill());a.setSelection(_e.create(a.doc,s+1)),e(a.scrollIntoView())}return!0},BP=(t,e)=>{let{$cursor:r}=t.selection;if(!r||r.parent.content.size)return!1;if(r.depth>1&&r.after()!=r.end(-1)){let o=r.before();if(Vo(t.doc,o))return e&&e(t.tr.split(o).scrollIntoView()),!0}let n=r.blockRange(),i=n&&Os(n);return i==null?!1:(e&&e(t.tr.lift(n,i).scrollIntoView()),!0)},$P=(t,e)=>{let{$from:r,to:n}=t.selection,i,o=r.sharedDepth(n);return o==0?!1:(i=r.before(o),e&&e(t.tr.setSelection(ke.create(t.doc,i))),!0)};function jP(t,e,r){let n=e.nodeBefore,i=e.nodeAfter,o=e.index();return!n||!i||!n.type.compatibleContent(i.type)?!1:!n.content.size&&e.parent.canReplace(o-1,o)?(r&&r(t.tr.delete(e.pos-n.nodeSize,e.pos).scrollIntoView()),!0):!e.parent.canReplace(o,o+1)||!(i.isTextblock||Si(t.doc,e.pos))?!1:(r&&r(t.tr.clearIncompatible(e.pos,n.type,n.contentMatchAt(n.childCount)).join(e.pos).scrollIntoView()),!0)}function pA(t,e,r,n){let i=e.nodeBefore,o=e.nodeAfter,s,a,l=i.type.spec.isolating||o.type.spec.isolating;if(!l&&jP(t,e,r))return!0;let c=!l&&e.parent.canReplace(e.index(),e.index()+1);if(c&&(s=(a=i.contentMatchAt(i.childCount)).findWrapping(o.type))&&a.matchType(s[0]||o.type).validEnd){if(r){let h=e.pos+o.nodeSize,p=he.empty;for(let g=s.length-1;g>=0;g--)p=he.from(s[g].create(null,p));p=he.from(i.copy(p));let m=t.tr.step(new yt(e.pos-1,h,e.pos,h,new we(p,1,0),s.length,!0)),y=h+2*s.length;Si(m.doc,y)&&m.join(y),r(m.scrollIntoView())}return!0}let u=o.type.spec.isolating||n>0&&l?null:Re.findFrom(e,1),f=u&&u.$from.blockRange(u.$to),d=f&&Os(f);if(d!=null&&d>=e.depth)return r&&r(t.tr.lift(f,d).scrollIntoView()),!0;if(c&&as(o,"start",!0)&&as(i,"end")){let h=i,p=[];for(;p.push(h),!h.isTextblock;)h=h.lastChild;let m=o,y=1;for(;!m.isTextblock;m=m.firstChild)y++;if(h.canReplace(h.childCount,h.childCount,m.content)){if(r){let g=he.empty;for(let S=p.length-1;S>=0;S--)g=he.from(p[S].copy(g));let b=t.tr.step(new yt(e.pos-p.length,e.pos+o.nodeSize,e.pos+y,e.pos+o.nodeSize-y,new we(g,p.length,0),0,!0));r(b.scrollIntoView())}return!0}}return!1}function mA(t){return function(e,r){let n=e.selection,i=t<0?n.$from:n.$to,o=i.depth;for(;i.node(o).isInline;){if(!o)return!1;o--}return i.node(o).isTextblock?(r&&r(e.tr.setSelection(_e.create(e.doc,t<0?i.start(o):i.end(o)))),!0):!1}}const HP=mA(-1),zP=mA(1);function UP(t,e=null){return function(r,n){let{$from:i,$to:o}=r.selection,s=i.blockRange(o),a=s&&ry(s,t,e);return a?(n&&n(r.tr.wrap(s,a).scrollIntoView()),!0):!1}}function Sb(t,e=null){return function(r,n){let i=!1;for(let o=0;o<r.selection.ranges.length&&!i;o++){let{$from:{pos:s},$to:{pos:a}}=r.selection.ranges[o];r.doc.nodesBetween(s,a,(l,c)=>{if(i)return!1;if(!(!l.isTextblock||l.hasMarkup(t,e)))if(l.type==t)i=!0;else{let u=r.doc.resolve(c),f=u.index();i=u.parent.canReplaceWith(f,f+1,t)}})}if(!i)return!1;if(n){let o=r.tr;for(let s=0;s<r.selection.ranges.length;s++){let{$from:{pos:a},$to:{pos:l}}=r.selection.ranges[s];o.setBlockType(a,l,t,e)}n(o.scrollIntoView())}return!0}}typeof navigator<"u"?/Mac|iP(hone|[oa]d)/.test(navigator.platform):typeof os<"u"&&os.platform&&os.platform()=="darwin";function WP(t,e=null){return function(r,n){let{$from:i,$to:o}=r.selection,s=i.blockRange(o),a=!1,l=s;if(!s)return!1;if(s.depth>=2&&i.node(s.depth-1).type.compatibleContent(t)&&s.startIndex==0){if(i.index(s.depth-1)==0)return!1;let u=r.doc.resolve(s.start-2);l=new Ra(u,u,s.depth),s.endIndex<s.parent.childCount&&(s=new Ra(i,r.doc.resolve(o.end(s.depth)),s.depth)),a=!0}let c=ry(l,t,e,s);return c?(n&&n(VP(r.tr,s,c,a,t).scrollIntoView()),!0):!1}}function VP(t,e,r,n,i){let o=he.empty;for(let u=r.length-1;u>=0;u--)o=he.from(r[u].type.create(r[u].attrs,o));t.step(new yt(e.start-(n?2:0),e.end,e.start,e.end,new we(o,0,0),r.length,!0));let s=0;for(let u=0;u<r.length;u++)r[u].type==i&&(s=u+1);let a=r.length-s,l=e.start+r.length-(n?2:0),c=e.parent;for(let u=e.startIndex,f=e.endIndex,d=!0;u<f;u++,d=!1)!d&&Vo(t.doc,l,a)&&(t.split(l,a),l+=2*a),l+=c.child(u).nodeSize;return t}function GP(t){return function(e,r){let{$from:n,$to:i}=e.selection,o=n.blockRange(i,s=>s.childCount>0&&s.firstChild.type==t);return o?r?n.node(o.depth-1).type==t?KP(e,r,t,o):qP(e,r,o):!0:!1}}function KP(t,e,r,n){let i=t.tr,o=n.end,s=n.$to.end(n.depth);o<s&&(i.step(new yt(o-1,s,o,s,new we(he.from(r.create(null,n.parent.copy())),1,0),1,!0)),n=new Ra(i.doc.resolve(n.$from.pos),i.doc.resolve(s),n.depth));const a=Os(n);if(a==null)return!1;i.lift(n,a);let l=i.mapping.map(o,-1)-1;return Si(i.doc,l)&&i.join(l),e(i.scrollIntoView()),!0}function qP(t,e,r){let n=t.tr,i=r.parent;for(let h=r.end,p=r.endIndex-1,m=r.startIndex;p>m;p--)h-=i.child(p).nodeSize,n.delete(h-1,h+1);let o=n.doc.resolve(r.start),s=o.nodeAfter;if(n.mapping.map(r.end)!=r.start+o.nodeAfter.nodeSize)return!1;let a=r.startIndex==0,l=r.endIndex==i.childCount,c=o.node(-1),u=o.index(-1);if(!c.canReplace(u+(a?0:1),u+1,s.content.append(l?he.empty:he.from(i))))return!1;let f=o.pos,d=f+s.nodeSize;return n.step(new yt(f-(a?1:0),d+(l?1:0),f+1,d-1,new we((a?he.empty:he.from(i.copy(he.empty))).append(l?he.empty:he.from(i.copy(he.empty))),a?0:1,l?0:1),a?0:1)),e(n.scrollIntoView()),!0}function XP(t){return function(e,r){let{$from:n,$to:i}=e.selection,o=n.blockRange(i,c=>c.childCount>0&&c.firstChild.type==t);if(!o)return!1;let s=o.startIndex;if(s==0)return!1;let a=o.parent,l=a.child(s-1);if(l.type!=t)return!1;if(r){let c=l.lastChild&&l.lastChild.type==a.type,u=he.from(c?t.create():null),f=new we(he.from(t.create(null,he.from(a.type.create(null,u)))),c?3:1,0),d=o.start,h=o.end;r(e.tr.step(new yt(d-(c?3:1),h,d,h,f,1,!0)).scrollIntoView())}return!0}}function kf(t){const{state:e,transaction:r}=t;let{selection:n}=r,{doc:i}=r,{storedMarks:o}=r;return{...e,apply:e.apply.bind(e),applyTransaction:e.applyTransaction.bind(e),plugins:e.plugins,schema:e.schema,reconfigure:e.reconfigure.bind(e),toJSON:e.toJSON.bind(e),get storedMarks(){return o},get selection(){return n},get doc(){return i},get tr(){return n=r.selection,i=r.doc,o=r.storedMarks,r}}}class _f{constructor(e){this.editor=e.editor,this.rawCommands=this.editor.extensionManager.commands,this.customState=e.state}get hasCustomState(){return!!this.customState}get state(){return this.customState||this.editor.state}get commands(){const{rawCommands:e,editor:r,state:n}=this,{view:i}=r,{tr:o}=n,s=this.buildProps(o);return Object.fromEntries(Object.entries(e).map(([a,l])=>[a,(...u)=>{const f=l(...u)(s);return!o.getMeta("preventDispatch")&&!this.hasCustomState&&i.dispatch(o),f}]))}get chain(){return()=>this.createChain()}get can(){return()=>this.createCan()}createChain(e,r=!0){const{rawCommands:n,editor:i,state:o}=this,{view:s}=i,a=[],l=!!e,c=e||o.tr,u=()=>(!l&&r&&!c.getMeta("preventDispatch")&&!this.hasCustomState&&s.dispatch(c),a.every(d=>d===!0)),f={...Object.fromEntries(Object.entries(n).map(([d,h])=>[d,(...m)=>{const y=this.buildProps(c,r),g=h(...m)(y);return a.push(g),f}])),run:u};return f}createCan(e){const{rawCommands:r,state:n}=this,i=!1,o=e||n.tr,s=this.buildProps(o,i);return{...Object.fromEntries(Object.entries(r).map(([l,c])=>[l,(...u)=>c(...u)({...s,dispatch:void 0})])),chain:()=>this.createChain(o,i)}}buildProps(e,r=!0){const{rawCommands:n,editor:i,state:o}=this,{view:s}=i,a={tr:e,editor:i,view:s,state:kf({state:o,transaction:e}),dispatch:r?()=>{}:void 0,chain:()=>this.createChain(e,r),can:()=>this.createCan(e),get commands(){return Object.fromEntries(Object.entries(n).map(([l,c])=>[l,(...u)=>c(...u)(a)]))}};return a}}let JP=class{constructor(){this.callbacks={}}on(e,r){return this.callbacks[e]||(this.callbacks[e]=[]),this.callbacks[e].push(r),this}emit(e,...r){const n=this.callbacks[e];return n&&n.forEach(i=>i.apply(this,r)),this}off(e,r){const n=this.callbacks[e];return n&&(r?this.callbacks[e]=n.filter(i=>i!==r):delete this.callbacks[e]),this}removeAllListeners(){this.callbacks={}}};function Ee(t,e,r){return t.config[e]===void 0&&t.parent?Ee(t.parent,e,r):typeof t.config[e]=="function"?t.config[e].bind({...r,parent:t.parent?Ee(t.parent,e,r):null}):t.config[e]}function Of(t){const e=t.filter(i=>i.type==="extension"),r=t.filter(i=>i.type==="node"),n=t.filter(i=>i.type==="mark");return{baseExtensions:e,nodeExtensions:r,markExtensions:n}}function gA(t){const e=[],{nodeExtensions:r,markExtensions:n}=Of(t),i=[...r,...n],o={default:null,rendered:!0,renderHTML:null,parseHTML:null,keepOnSplit:!0,isRequired:!1};return t.forEach(s=>{const a={name:s.name,options:s.options,storage:s.storage,extensions:i},l=Ee(s,"addGlobalAttributes",a);if(!l)return;l().forEach(u=>{u.types.forEach(f=>{Object.entries(u.attributes).forEach(([d,h])=>{e.push({type:f,name:d,attribute:{...o,...h}})})})})}),i.forEach(s=>{const a={name:s.name,options:s.options,storage:s.storage},l=Ee(s,"addAttributes",a);if(!l)return;const c=l();Object.entries(c).forEach(([u,f])=>{const d={...o,...f};typeof(d==null?void 0:d.default)=="function"&&(d.default=d.default()),d!=null&&d.isRequired&&(d==null?void 0:d.default)===void 0&&delete d.default,e.push({type:s.name,name:u,attribute:d})})}),e}function wt(t,e){if(typeof t=="string"){if(!e.nodes[t])throw Error(`There is no node type named '${t}'. Maybe you forgot to add the extension?`);return e.nodes[t]}return t}function Be(...t){return t.filter(e=>!!e).reduce((e,r)=>{const n={...e};return Object.entries(r).forEach(([i,o])=>{if(!n[i]){n[i]=o;return}if(i==="class"){const a=o?o.split(" "):[],l=n[i]?n[i].split(" "):[],c=a.filter(u=>!l.includes(u));n[i]=[...l,...c].join(" ")}else i==="style"?n[i]=[n[i],o].join("; "):n[i]=o}),n},{})}function fm(t,e){return e.filter(r=>r.attribute.rendered).map(r=>r.attribute.renderHTML?r.attribute.renderHTML(t.attrs)||{}:{[r.name]:t.attrs[r.name]}).reduce((r,n)=>Be(r,n),{})}function yA(t){return typeof t=="function"}function De(t,e=void 0,...r){return yA(t)?e?t.bind(e)(...r):t(...r):t}function YP(t={}){return Object.keys(t).length===0&&t.constructor===Object}function ZP(t){return typeof t!="string"?t:t.match(/^[+-]?(?:\d*\.)?\d+$/)?Number(t):t==="true"?!0:t==="false"?!1:t}function Eb(t,e){return"style"in t?t:{...t,getAttrs:r=>{const n=t.getAttrs?t.getAttrs(r):t.attrs;if(n===!1)return!1;const i=e.reduce((o,s)=>{const a=s.attribute.parseHTML?s.attribute.parseHTML(r):ZP(r.getAttribute(s.name));return a==null?o:{...o,[s.name]:a}},{});return{...n,...i}}}}function Tb(t){return Object.fromEntries(Object.entries(t).filter(([e,r])=>e==="attrs"&&YP(r)?!1:r!=null))}function QP(t,e){var r;const n=gA(t),{nodeExtensions:i,markExtensions:o}=Of(t),s=(r=i.find(c=>Ee(c,"topNode")))===null||r===void 0?void 0:r.name,a=Object.fromEntries(i.map(c=>{const u=n.filter(g=>g.type===c.name),f={name:c.name,options:c.options,storage:c.storage,editor:e},d=t.reduce((g,b)=>{const S=Ee(b,"extendNodeSchema",f);return{...g,...S?S(c):{}}},{}),h=Tb({...d,content:De(Ee(c,"content",f)),marks:De(Ee(c,"marks",f)),group:De(Ee(c,"group",f)),inline:De(Ee(c,"inline",f)),atom:De(Ee(c,"atom",f)),selectable:De(Ee(c,"selectable",f)),draggable:De(Ee(c,"draggable",f)),code:De(Ee(c,"code",f)),whitespace:De(Ee(c,"whitespace",f)),defining:De(Ee(c,"defining",f)),isolating:De(Ee(c,"isolating",f)),attrs:Object.fromEntries(u.map(g=>{var b;return[g.name,{default:(b=g==null?void 0:g.attribute)===null||b===void 0?void 0:b.default}]}))}),p=De(Ee(c,"parseHTML",f));p&&(h.parseDOM=p.map(g=>Eb(g,u)));const m=Ee(c,"renderHTML",f);m&&(h.toDOM=g=>m({node:g,HTMLAttributes:fm(g,u)}));const y=Ee(c,"renderText",f);return y&&(h.toText=y),[c.name,h]})),l=Object.fromEntries(o.map(c=>{const u=n.filter(y=>y.type===c.name),f={name:c.name,options:c.options,storage:c.storage,editor:e},d=t.reduce((y,g)=>{const b=Ee(g,"extendMarkSchema",f);return{...y,...b?b(c):{}}},{}),h=Tb({...d,inclusive:De(Ee(c,"inclusive",f)),excludes:De(Ee(c,"excludes",f)),group:De(Ee(c,"group",f)),spanning:De(Ee(c,"spanning",f)),code:De(Ee(c,"code",f)),attrs:Object.fromEntries(u.map(y=>{var g;return[y.name,{default:(g=y==null?void 0:y.attribute)===null||g===void 0?void 0:g.default}]}))}),p=De(Ee(c,"parseHTML",f));p&&(h.parseDOM=p.map(y=>Eb(y,u)));const m=Ee(c,"renderHTML",f);return m&&(h.toDOM=y=>m({mark:y,HTMLAttributes:fm(y,u)})),[c.name,h]}));return new dT({topNode:s,nodes:a,marks:l})}function Hd(t,e){return e.nodes[t]||e.marks[t]||null}function Ab(t,e){return Array.isArray(e)?e.some(r=>(typeof r=="string"?r:r.name)===t.name):e}const eL=(t,e=500)=>{let r="";const n=t.parentOffset;return t.parent.nodesBetween(Math.max(0,n-e),n,(i,o,s,a)=>{var l,c;const u=((c=(l=i.type.spec).toText)===null||c===void 0?void 0:c.call(l,{node:i,pos:o,parent:s,index:a}))||i.textContent||"%leaf%";r+=i.isAtom&&!i.isText?u:u.slice(0,Math.max(0,n-o))}),r};function yy(t){return Object.prototype.toString.call(t)==="[object RegExp]"}class Rf{constructor(e){this.find=e.find,this.handler=e.handler}}const tL=(t,e)=>{if(yy(e))return e.exec(t);const r=e(t);if(!r)return null;const n=[r.text];return n.index=r.index,n.input=t,n.data=r.data,r.replaceWith&&(r.text.includes(r.replaceWith)||console.warn('[tiptap warn]: "inputRuleMatch.replaceWith" must be part of "inputRuleMatch.text".'),n.push(r.replaceWith)),n};function Ml(t){var e;const{editor:r,from:n,to:i,text:o,rules:s,plugin:a}=t,{view:l}=r;if(l.composing)return!1;const c=l.state.doc.resolve(n);if(c.parent.type.spec.code||!((e=c.nodeBefore||c.nodeAfter)===null||e===void 0)&&e.marks.find(d=>d.type.spec.code))return!1;let u=!1;const f=eL(c)+o;return s.forEach(d=>{if(u)return;const h=tL(f,d.find);if(!h)return;const p=l.state.tr,m=kf({state:l.state,transaction:p}),y={from:n-(h[0].length-o.length),to:i},{commands:g,chain:b,can:S}=new _f({editor:r,state:m});d.handler({state:m,range:y,match:h,commands:g,chain:b,can:S})===null||!p.steps.length||(p.setMeta(a,{transform:p,from:n,to:i,text:o}),l.dispatch(p),u=!0)}),u}function rL(t){const{editor:e,rules:r}=t,n=new tt({state:{init(){return null},apply(i,o){const s=i.getMeta(n);if(s)return s;const a=i.getMeta("applyInputRules");return!!a&&setTimeout(()=>{const{from:c,text:u}=a,f=c+u.length;Ml({editor:e,from:c,to:f,text:u,rules:r,plugin:n})}),i.selectionSet||i.docChanged?null:o}},props:{handleTextInput(i,o,s,a){return Ml({editor:e,from:o,to:s,text:a,rules:r,plugin:n})},handleDOMEvents:{compositionend:i=>(setTimeout(()=>{const{$cursor:o}=i.state.selection;o&&Ml({editor:e,from:o.pos,to:o.pos,text:"",rules:r,plugin:n})}),!1)},handleKeyDown(i,o){if(o.key!=="Enter")return!1;const{$cursor:s}=i.state.selection;return s?Ml({editor:e,from:s.pos,to:s.pos,text:`
11
- `,rules:r,plugin:n}):!1}},isInputRules:!0});return n}function nL(t){return typeof t=="number"}class iL{constructor(e){this.find=e.find,this.handler=e.handler}}const oL=(t,e,r)=>{if(yy(e))return[...t.matchAll(e)];const n=e(t,r);return n?n.map(i=>{const o=[i.text];return o.index=i.index,o.input=t,o.data=i.data,i.replaceWith&&(i.text.includes(i.replaceWith)||console.warn('[tiptap warn]: "pasteRuleMatch.replaceWith" must be part of "pasteRuleMatch.text".'),o.push(i.replaceWith)),o}):[]};function sL(t){const{editor:e,state:r,from:n,to:i,rule:o,pasteEvent:s,dropEvent:a}=t,{commands:l,chain:c,can:u}=new _f({editor:e,state:r}),f=[];return r.doc.nodesBetween(n,i,(h,p)=>{if(!h.isTextblock||h.type.spec.code)return;const m=Math.max(n,p),y=Math.min(i,p+h.content.size),g=h.textBetween(m-p,y-p,void 0,"");oL(g,o.find,s).forEach(S=>{if(S.index===void 0)return;const x=m+S.index+1,O=x+S[0].length,M={from:r.tr.mapping.map(x),to:r.tr.mapping.map(O)},D=o.handler({state:r,range:M,match:S,commands:l,chain:c,can:u,pasteEvent:s,dropEvent:a});f.push(D)})}),f.every(h=>h!==null)}const aL=t=>{var e;const r=new ClipboardEvent("paste",{clipboardData:new DataTransfer});return(e=r.clipboardData)===null||e===void 0||e.setData("text/html",t),r};function lL(t){const{editor:e,rules:r}=t;let n=null,i=!1,o=!1,s=typeof ClipboardEvent<"u"?new ClipboardEvent("paste"):null,a=typeof DragEvent<"u"?new DragEvent("drop"):null;const l=({state:u,from:f,to:d,rule:h,pasteEvt:p})=>{const m=u.tr,y=kf({state:u,transaction:m});if(!(!sL({editor:e,state:y,from:Math.max(f-1,0),to:d.b-1,rule:h,pasteEvent:p,dropEvent:a})||!m.steps.length))return a=typeof DragEvent<"u"?new DragEvent("drop"):null,s=typeof ClipboardEvent<"u"?new ClipboardEvent("paste"):null,m};return r.map(u=>new tt({view(f){const d=h=>{var p;n=!((p=f.dom.parentElement)===null||p===void 0)&&p.contains(h.target)?f.dom.parentElement:null};return window.addEventListener("dragstart",d),{destroy(){window.removeEventListener("dragstart",d)}}},props:{handleDOMEvents:{drop:(f,d)=>(o=n===f.dom.parentElement,a=d,!1),paste:(f,d)=>{var h;const p=(h=d.clipboardData)===null||h===void 0?void 0:h.getData("text/html");return s=d,i=!!(p!=null&&p.includes("data-pm-slice")),!1}}},appendTransaction:(f,d,h)=>{const p=f[0],m=p.getMeta("uiEvent")==="paste"&&!i,y=p.getMeta("uiEvent")==="drop"&&!o,g=p.getMeta("applyPasteRules"),b=!!g;if(!m&&!y&&!b)return;if(b){const{from:O,text:M}=g,D=O+M.length,$=aL(M);return l({rule:u,state:h,from:O,to:{b:D},pasteEvt:$})}const S=d.doc.content.findDiffStart(h.doc.content),x=d.doc.content.findDiffEnd(h.doc.content);if(!(!nL(S)||!x||S===x.b))return l({rule:u,state:h,from:S,to:x,pasteEvt:s})}}))}function cL(t){const e=t.filter((r,n)=>t.indexOf(r)!==n);return Array.from(new Set(e))}class zo{constructor(e,r){this.splittableMarks=[],this.editor=r,this.extensions=zo.resolve(e),this.schema=QP(this.extensions,r),this.setupExtensions()}static resolve(e){const r=zo.sort(zo.flatten(e)),n=cL(r.map(i=>i.name));return n.length&&console.warn(`[tiptap warn]: Duplicate extension names found: [${n.map(i=>`'${i}'`).join(", ")}]. This can lead to issues.`),r}static flatten(e){return e.map(r=>{const n={name:r.name,options:r.options,storage:r.storage},i=Ee(r,"addExtensions",n);return i?[r,...this.flatten(i())]:r}).flat(10)}static sort(e){return e.sort((n,i)=>{const o=Ee(n,"priority")||100,s=Ee(i,"priority")||100;return o>s?-1:o<s?1:0})}get commands(){return this.extensions.reduce((e,r)=>{const n={name:r.name,options:r.options,storage:r.storage,editor:this.editor,type:Hd(r.name,this.schema)},i=Ee(r,"addCommands",n);return i?{...e,...i()}:e},{})}get plugins(){const{editor:e}=this,r=zo.sort([...this.extensions].reverse()),n=[],i=[],o=r.map(s=>{const a={name:s.name,options:s.options,storage:s.storage,editor:e,type:Hd(s.name,this.schema)},l=[],c=Ee(s,"addKeyboardShortcuts",a);let u={};if(s.type==="mark"&&Ee(s,"exitable",a)&&(u.ArrowRight=()=>Nt.handleExit({editor:e,mark:s})),c){const m=Object.fromEntries(Object.entries(c()).map(([y,g])=>[y,()=>g({editor:e})]));u={...u,...m}}const f=AP(u);l.push(f);const d=Ee(s,"addInputRules",a);Ab(s,e.options.enableInputRules)&&d&&n.push(...d());const h=Ee(s,"addPasteRules",a);Ab(s,e.options.enablePasteRules)&&h&&i.push(...h());const p=Ee(s,"addProseMirrorPlugins",a);if(p){const m=p();l.push(...m)}return l}).flat();return[rL({editor:e,rules:n}),...lL({editor:e,rules:i}),...o]}get attributes(){return gA(this.extensions)}get nodeViews(){const{editor:e}=this,{nodeExtensions:r}=Of(this.extensions);return Object.fromEntries(r.filter(n=>!!Ee(n,"addNodeView")).map(n=>{const i=this.attributes.filter(l=>l.type===n.name),o={name:n.name,options:n.options,storage:n.storage,editor:e,type:wt(n.name,this.schema)},s=Ee(n,"addNodeView",o);if(!s)return[];const a=(l,c,u,f)=>{const d=fm(l,i);return s()({editor:e,node:l,getPos:u,decorations:f,HTMLAttributes:d,extension:n})};return[n.name,a]}))}setupExtensions(){this.extensions.forEach(e=>{var r;this.editor.extensionStorage[e.name]=e.storage;const n={name:e.name,options:e.options,storage:e.storage,editor:this.editor,type:Hd(e.name,this.schema)};e.type==="mark"&&(!((r=De(Ee(e,"keepOnSplit",n)))!==null&&r!==void 0)||r)&&this.splittableMarks.push(e.name);const i=Ee(e,"onBeforeCreate",n),o=Ee(e,"onCreate",n),s=Ee(e,"onUpdate",n),a=Ee(e,"onSelectionUpdate",n),l=Ee(e,"onTransaction",n),c=Ee(e,"onFocus",n),u=Ee(e,"onBlur",n),f=Ee(e,"onDestroy",n);i&&this.editor.on("beforeCreate",i),o&&this.editor.on("create",o),s&&this.editor.on("update",s),a&&this.editor.on("selectionUpdate",a),l&&this.editor.on("transaction",l),c&&this.editor.on("focus",c),u&&this.editor.on("blur",u),f&&this.editor.on("destroy",f)})}}function uL(t){return Object.prototype.toString.call(t).slice(8,-1)}function Il(t){return uL(t)!=="Object"?!1:t.constructor===Object&&Object.getPrototypeOf(t)===Object.prototype}function Mf(t,e){const r={...t};return Il(t)&&Il(e)&&Object.keys(e).forEach(n=>{Il(e[n])&&Il(t[n])?r[n]=Mf(t[n],e[n]):r[n]=e[n]}),r}class dt{constructor(e={}){this.type="extension",this.name="extension",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...e},this.name=this.config.name,e.defaultOptions&&Object.keys(e.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=De(Ee(this,"addOptions",{name:this.name}))),this.storage=De(Ee(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(e={}){return new dt(e)}configure(e={}){const r=this.extend({...this.config,addOptions:()=>Mf(this.options,e)});return r.name=this.name,r.parent=this.parent,r}extend(e={}){const r=new dt({...this.config,...e});return r.parent=this,this.child=r,r.name=e.name?e.name:r.parent.name,e.defaultOptions&&Object.keys(e.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${r.name}".`),r.options=De(Ee(r,"addOptions",{name:r.name})),r.storage=De(Ee(r,"addStorage",{name:r.name,options:r.options})),r}}function vA(t,e,r){const{from:n,to:i}=e,{blockSeparator:o=`
12
-
13
- `,textSerializers:s={}}=r||{};let a="";return t.nodesBetween(n,i,(l,c,u,f)=>{var d;l.isBlock&&c>n&&(a+=o);const h=s==null?void 0:s[l.type.name];if(h)return u&&(a+=h({node:l,pos:c,parent:u,index:f,range:e})),!1;l.isText&&(a+=(d=l==null?void 0:l.text)===null||d===void 0?void 0:d.slice(Math.max(n,c)-c,i-c))}),a}function wA(t){return Object.fromEntries(Object.entries(t.nodes).filter(([,e])=>e.spec.toText).map(([e,r])=>[e,r.spec.toText]))}const fL=dt.create({name:"clipboardTextSerializer",addOptions(){return{blockSeparator:void 0}},addProseMirrorPlugins(){return[new tt({key:new et("clipboardTextSerializer"),props:{clipboardTextSerializer:()=>{const{editor:t}=this,{state:e,schema:r}=t,{doc:n,selection:i}=e,{ranges:o}=i,s=Math.min(...o.map(u=>u.$from.pos)),a=Math.max(...o.map(u=>u.$to.pos)),l=wA(r);return vA(n,{from:s,to:a},{...this.options.blockSeparator!==void 0?{blockSeparator:this.options.blockSeparator}:{},textSerializers:l})}}})]}}),dL=()=>({editor:t,view:e})=>(requestAnimationFrame(()=>{var r;t.isDestroyed||(e.dom.blur(),(r=window==null?void 0:window.getSelection())===null||r===void 0||r.removeAllRanges())}),!0),hL=(t=!1)=>({commands:e})=>e.setContent("",t),pL=()=>({state:t,tr:e,dispatch:r})=>{const{selection:n}=e,{ranges:i}=n;return r&&i.forEach(({$from:o,$to:s})=>{t.doc.nodesBetween(o.pos,s.pos,(a,l)=>{if(a.type.isText)return;const{doc:c,mapping:u}=e,f=c.resolve(u.map(l)),d=c.resolve(u.map(l+a.nodeSize)),h=f.blockRange(d);if(!h)return;const p=Os(h);if(a.type.isTextblock){const{defaultType:m}=f.parent.contentMatchAt(f.index());e.setNodeMarkup(h.start,m)}(p||p===0)&&e.lift(h,p)})}),!0},mL=t=>e=>t(e),gL=()=>({state:t,dispatch:e})=>FP(t,e),yL=(t,e)=>({editor:r,tr:n})=>{const{state:i}=r,o=i.doc.slice(t.from,t.to);n.deleteRange(t.from,t.to);const s=n.mapping.map(e);return n.insert(s,o.content),n.setSelection(new _e(n.doc.resolve(s-1))),!0},vL=()=>({tr:t,dispatch:e})=>{const{selection:r}=t,n=r.$anchor.node();if(n.content.size>0)return!1;const i=t.selection.$anchor;for(let o=i.depth;o>0;o-=1)if(i.node(o).type===n.type){if(e){const a=i.before(o),l=i.after(o);t.delete(a,l).scrollIntoView()}return!0}return!1},wL=t=>({tr:e,state:r,dispatch:n})=>{const i=wt(t,r.schema),o=e.selection.$anchor;for(let s=o.depth;s>0;s-=1)if(o.node(s).type===i){if(n){const l=o.before(s),c=o.after(s);e.delete(l,c).scrollIntoView()}return!0}return!1},bL=t=>({tr:e,dispatch:r})=>{const{from:n,to:i}=t;return r&&e.delete(n,i),!0},xL=()=>({state:t,dispatch:e})=>cA(t,e),SL=()=>({commands:t})=>t.keyboardShortcut("Enter"),EL=()=>({state:t,dispatch:e})=>LP(t,e);function nu(t,e,r={strict:!0}){const n=Object.keys(e);return n.length?n.every(i=>r.strict?e[i]===t[i]:yy(e[i])?e[i].test(t[i]):e[i]===t[i]):!0}function dm(t,e,r={}){return t.find(n=>n.type===e&&nu(n.attrs,r))}function TL(t,e,r={}){return!!dm(t,e,r)}function If(t,e,r={}){if(!t||!e)return;let n=t.parent.childAfter(t.parentOffset);if(t.parentOffset===n.offset&&n.offset!==0&&(n=t.parent.childBefore(t.parentOffset)),!n.node)return;const i=dm([...n.node.marks],e,r);if(!i)return;let o=n.index,s=t.start()+n.offset,a=o+1,l=s+n.node.nodeSize;for(dm([...n.node.marks],e,r);o>0&&i.isInSet(t.parent.child(o-1).marks);)o-=1,s-=t.parent.child(o).nodeSize;for(;a<t.parent.childCount&&TL([...t.parent.child(a).marks],e,r);)l+=t.parent.child(a).nodeSize,a+=1;return{from:s,to:l}}function Ti(t,e){if(typeof t=="string"){if(!e.marks[t])throw Error(`There is no mark type named '${t}'. Maybe you forgot to add the extension?`);return e.marks[t]}return t}const AL=(t,e={})=>({tr:r,state:n,dispatch:i})=>{const o=Ti(t,n.schema),{doc:s,selection:a}=r,{$from:l,from:c,to:u}=a;if(i){const f=If(l,o,e);if(f&&f.from<=c&&f.to>=u){const d=_e.create(s,f.from,f.to);r.setSelection(d)}}return!0},CL=t=>e=>{const r=typeof t=="function"?t(e):t;for(let n=0;n<r.length;n+=1)if(r[n](e))return!0;return!1};function vy(t){return t instanceof _e}function vn(t=0,e=0,r=0){return Math.min(Math.max(t,e),r)}function bA(t,e=null){if(!e)return null;const r=Re.atStart(t),n=Re.atEnd(t);if(e==="start"||e===!0)return r;if(e==="end")return n;const i=r.from,o=n.to;return e==="all"?_e.create(t,vn(0,i,o),vn(t.content.size,i,o)):_e.create(t,vn(e,i,o),vn(e,i,o))}function Nf(){return["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document}const kL=(t=null,e={})=>({editor:r,view:n,tr:i,dispatch:o})=>{e={scrollIntoView:!0,...e};const s=()=>{Nf()&&n.dom.focus(),requestAnimationFrame(()=>{r.isDestroyed||(n.focus(),e!=null&&e.scrollIntoView&&r.commands.scrollIntoView())})};if(n.hasFocus()&&t===null||t===!1)return!0;if(o&&t===null&&!vy(r.state.selection))return s(),!0;const a=bA(i.doc,t)||r.state.selection,l=r.state.selection.eq(a);return o&&(l||i.setSelection(a),l&&i.storedMarks&&i.setStoredMarks(i.storedMarks),s()),!0},_L=(t,e)=>r=>t.every((n,i)=>e(n,{...r,index:i})),OL=(t,e)=>({tr:r,commands:n})=>n.insertContentAt({from:r.selection.from,to:r.selection.to},t,e),xA=t=>{const e=t.childNodes;for(let r=e.length-1;r>=0;r-=1){const n=e[r];n.nodeType===3&&n.nodeValue&&/^(\n\s\s|\n)$/.test(n.nodeValue)?t.removeChild(n):n.nodeType===1&&xA(n)}return t};function Nl(t){const e=`<body>${t}</body>`,r=new window.DOMParser().parseFromString(e,"text/html").body;return xA(r)}function iu(t,e,r){r={slice:!0,parseOptions:{},...r};const n=typeof t=="object"&&t!==null,i=typeof t=="string";if(n)try{return Array.isArray(t)&&t.length>0?he.fromArray(t.map(s=>e.nodeFromJSON(s))):e.nodeFromJSON(t)}catch(o){if(r.errorOnInvalidContent)throw new Error("[tiptap error]: Invalid JSON content",{cause:o});return console.warn("[tiptap warn]: Invalid content.","Passed value:",t,"Error:",o),iu("",e,r)}if(i){if(r.errorOnInvalidContent){let s=!1,a="";const l=new dT({topNode:e.spec.topNode,marks:e.spec.marks,nodes:e.spec.nodes.append({__tiptap__private__unknown__catch__all__node:{content:"inline*",group:"block",parseDOM:[{tag:"*",getAttrs:c=>(s=!0,a=typeof c=="string"?c:c.outerHTML,null)}]}})});if(r.slice?fa.fromSchema(l).parseSlice(Nl(t),r.parseOptions):fa.fromSchema(l).parse(Nl(t),r.parseOptions),r.errorOnInvalidContent&&s)throw new Error("[tiptap error]: Invalid HTML content",{cause:new Error(`Invalid element found: ${a}`)})}const o=fa.fromSchema(e);return r.slice?o.parseSlice(Nl(t),r.parseOptions).content:o.parse(Nl(t),r.parseOptions)}return iu("",e,r)}function RL(t,e,r){const n=t.steps.length-1;if(n<e)return;const i=t.steps[n];if(!(i instanceof mt||i instanceof yt))return;const o=t.mapping.maps[n];let s=0;o.forEach((a,l,c,u)=>{s===0&&(s=u)}),t.setSelection(Re.near(t.doc.resolve(s),r))}const ML=t=>!("type"in t),IL=(t,e,r)=>({tr:n,dispatch:i,editor:o})=>{var s;if(i){r={parseOptions:{},updateSelection:!0,applyInputRules:!1,applyPasteRules:!1,...r};let a;try{a=iu(e,o.schema,{parseOptions:{preserveWhitespace:"full",...r.parseOptions},errorOnInvalidContent:(s=r.errorOnInvalidContent)!==null&&s!==void 0?s:o.options.enableContentCheck})}catch(p){return o.emit("contentError",{editor:o,error:p,disableCollaboration:()=>{console.error("[tiptap error]: Unable to disable collaboration at this point in time")}}),!1}let{from:l,to:c}=typeof t=="number"?{from:t,to:t}:{from:t.from,to:t.to},u=!0,f=!0;if((ML(a)?a:[a]).forEach(p=>{p.check(),u=u?p.isText&&p.marks.length===0:!1,f=f?p.isBlock:!1}),l===c&&f){const{parent:p}=n.doc.resolve(l);p.isTextblock&&!p.type.spec.code&&!p.childCount&&(l-=1,c+=1)}let h;u?(Array.isArray(e)?h=e.map(p=>p.text||"").join(""):typeof e=="object"&&e&&e.text?h=e.text:h=e,n.insertText(h,l,c)):(h=a,n.replaceWith(l,c,h)),r.updateSelection&&RL(n,n.steps.length-1,-1),r.applyInputRules&&n.setMeta("applyInputRules",{from:l,text:h}),r.applyPasteRules&&n.setMeta("applyPasteRules",{from:l,text:h})}return!0},NL=()=>({state:t,dispatch:e})=>IP(t,e),DL=()=>({state:t,dispatch:e})=>NP(t,e),PL=()=>({state:t,dispatch:e})=>CP(t,e),LL=()=>({state:t,dispatch:e})=>RP(t,e),FL=()=>({state:t,dispatch:e,tr:r})=>{try{const n=xf(t.doc,t.selection.$from.pos,-1);return n==null?!1:(r.join(n,2),e&&e(r),!0)}catch{return!1}},BL=()=>({state:t,dispatch:e,tr:r})=>{try{const n=xf(t.doc,t.selection.$from.pos,1);return n==null?!1:(r.join(n,2),e&&e(r),!0)}catch{return!1}},$L=()=>({state:t,dispatch:e})=>kP(t,e),jL=()=>({state:t,dispatch:e})=>_P(t,e);function SA(){return typeof navigator<"u"?/Mac/.test(navigator.platform):!1}function HL(t){const e=t.split(/-(?!$)/);let r=e[e.length-1];r==="Space"&&(r=" ");let n,i,o,s;for(let a=0;a<e.length-1;a+=1){const l=e[a];if(/^(cmd|meta|m)$/i.test(l))s=!0;else if(/^a(lt)?$/i.test(l))n=!0;else if(/^(c|ctrl|control)$/i.test(l))i=!0;else if(/^s(hift)?$/i.test(l))o=!0;else if(/^mod$/i.test(l))Nf()||SA()?s=!0:i=!0;else throw new Error(`Unrecognized modifier name: ${l}`)}return n&&(r=`Alt-${r}`),i&&(r=`Ctrl-${r}`),s&&(r=`Meta-${r}`),o&&(r=`Shift-${r}`),r}const zL=t=>({editor:e,view:r,tr:n,dispatch:i})=>{const o=HL(t).split(/-(?!$)/),s=o.find(c=>!["Alt","Ctrl","Meta","Shift"].includes(c)),a=new KeyboardEvent("keydown",{key:s==="Space"?" ":s,altKey:o.includes("Alt"),ctrlKey:o.includes("Ctrl"),metaKey:o.includes("Meta"),shiftKey:o.includes("Shift"),bubbles:!0,cancelable:!0}),l=e.captureTransaction(()=>{r.someProp("handleKeyDown",c=>c(r,a))});return l==null||l.steps.forEach(c=>{const u=c.map(n.mapping);u&&i&&n.maybeStep(u)}),!0};function La(t,e,r={}){const{from:n,to:i,empty:o}=t.selection,s=e?wt(e,t.schema):null,a=[];t.doc.nodesBetween(n,i,(f,d)=>{if(f.isText)return;const h=Math.max(n,d),p=Math.min(i,d+f.nodeSize);a.push({node:f,from:h,to:p})});const l=i-n,c=a.filter(f=>s?s.name===f.node.type.name:!0).filter(f=>nu(f.node.attrs,r,{strict:!1}));return o?!!c.length:c.reduce((f,d)=>f+d.to-d.from,0)>=l}const UL=(t,e={})=>({state:r,dispatch:n})=>{const i=wt(t,r.schema);return La(r,i,e)?DP(r,n):!1},WL=()=>({state:t,dispatch:e})=>BP(t,e),VL=t=>({state:e,dispatch:r})=>{const n=wt(t,e.schema);return GP(n)(e,r)},GL=()=>({state:t,dispatch:e})=>PP(t,e);function Df(t,e){return e.nodes[t]?"node":e.marks[t]?"mark":null}function Cb(t,e){const r=typeof e=="string"?[e]:e;return Object.keys(t).reduce((n,i)=>(r.includes(i)||(n[i]=t[i]),n),{})}const KL=(t,e)=>({tr:r,state:n,dispatch:i})=>{let o=null,s=null;const a=Df(typeof t=="string"?t:t.name,n.schema);return a?(a==="node"&&(o=wt(t,n.schema)),a==="mark"&&(s=Ti(t,n.schema)),i&&r.selection.ranges.forEach(l=>{n.doc.nodesBetween(l.$from.pos,l.$to.pos,(c,u)=>{o&&o===c.type&&r.setNodeMarkup(u,void 0,Cb(c.attrs,e)),s&&c.marks.length&&c.marks.forEach(f=>{s===f.type&&r.addMark(u,u+c.nodeSize,s.create(Cb(f.attrs,e)))})})}),!0):!1},qL=()=>({tr:t,dispatch:e})=>(e&&t.scrollIntoView(),!0),XL=()=>({tr:t,commands:e})=>e.setTextSelection({from:0,to:t.doc.content.size}),JL=()=>({state:t,dispatch:e})=>OP(t,e),YL=()=>({state:t,dispatch:e})=>MP(t,e),ZL=()=>({state:t,dispatch:e})=>$P(t,e),QL=()=>({state:t,dispatch:e})=>zP(t,e),eF=()=>({state:t,dispatch:e})=>HP(t,e);function hm(t,e,r={},n={}){return iu(t,e,{slice:!1,parseOptions:r,errorOnInvalidContent:n.errorOnInvalidContent})}const tF=(t,e=!1,r={},n={})=>({editor:i,tr:o,dispatch:s,commands:a})=>{var l,c;const{doc:u}=o;if(r.preserveWhitespace!=="full"){const f=hm(t,i.schema,r,{errorOnInvalidContent:(l=n.errorOnInvalidContent)!==null&&l!==void 0?l:i.options.enableContentCheck});return s&&o.replaceWith(0,u.content.size,f).setMeta("preventUpdate",!e),!0}return s&&o.setMeta("preventUpdate",!e),a.insertContentAt({from:0,to:u.content.size},t,{parseOptions:r,errorOnInvalidContent:(c=n.errorOnInvalidContent)!==null&&c!==void 0?c:i.options.enableContentCheck})};function fl(t,e){const r=Ti(e,t.schema),{from:n,to:i,empty:o}=t.selection,s=[];o?(t.storedMarks&&s.push(...t.storedMarks),s.push(...t.selection.$head.marks())):t.doc.nodesBetween(n,i,l=>{s.push(...l.marks)});const a=s.find(l=>l.type.name===r.name);return a?{...a.attrs}:{}}function rF(t,e){const r=new ny(t);return e.forEach(n=>{n.steps.forEach(i=>{r.step(i)})}),r}function nF(t){for(let e=0;e<t.edgeCount;e+=1){const{type:r}=t.edge(e);if(r.isTextblock&&!r.hasRequiredAttrs())return r}return null}function iF(t,e){const r=[];return t.descendants((n,i)=>{e(n)&&r.push({node:n,pos:i})}),r}function oF(t,e,r){const n=[];return t.nodesBetween(e.from,e.to,(i,o)=>{r(i)&&n.push({node:i,pos:o})}),n}function EA(t,e){for(let r=t.depth;r>0;r-=1){const n=t.node(r);if(e(n))return{pos:r>0?t.before(r):0,start:t.start(r),depth:r,node:n}}}function Pf(t){return e=>EA(e.$from,t)}function sF(t,e){const r=uo.fromSchema(e).serializeFragment(t),i=document.implementation.createHTMLDocument().createElement("div");return i.appendChild(r),i.innerHTML}function aF(t,e){const r={from:0,to:t.content.size};return vA(t,r,e)}function lF(t,e){const r=wt(e,t.schema),{from:n,to:i}=t.selection,o=[];t.doc.nodesBetween(n,i,a=>{o.push(a)});const s=o.reverse().find(a=>a.type.name===r.name);return s?{...s.attrs}:{}}function TA(t,e){const r=Df(typeof e=="string"?e:e.name,t.schema);return r==="node"?lF(t,e):r==="mark"?fl(t,e):{}}function cF(t,e=JSON.stringify){const r={};return t.filter(n=>{const i=e(n);return Object.prototype.hasOwnProperty.call(r,i)?!1:r[i]=!0})}function uF(t){const e=cF(t);return e.length===1?e:e.filter((r,n)=>!e.filter((o,s)=>s!==n).some(o=>r.oldRange.from>=o.oldRange.from&&r.oldRange.to<=o.oldRange.to&&r.newRange.from>=o.newRange.from&&r.newRange.to<=o.newRange.to))}function fF(t){const{mapping:e,steps:r}=t,n=[];return e.maps.forEach((i,o)=>{const s=[];if(i.ranges.length)i.forEach((a,l)=>{s.push({from:a,to:l})});else{const{from:a,to:l}=r[o];if(a===void 0||l===void 0)return;s.push({from:a,to:l})}s.forEach(({from:a,to:l})=>{const c=e.slice(o).map(a,-1),u=e.slice(o).map(l),f=e.invert().map(c,-1),d=e.invert().map(u);n.push({oldRange:{from:f,to:d},newRange:{from:c,to:u}})})}),uF(n)}function wy(t,e,r){const n=[];return t===e?r.resolve(t).marks().forEach(i=>{const o=r.resolve(t),s=If(o,i.type);s&&n.push({mark:i,...s})}):r.nodesBetween(t,e,(i,o)=>{!i||(i==null?void 0:i.nodeSize)===void 0||n.push(...i.marks.map(s=>({from:o,to:o+i.nodeSize,mark:s})))}),n}function bc(t,e,r){return Object.fromEntries(Object.entries(r).filter(([n])=>{const i=t.find(o=>o.type===e&&o.name===n);return i?i.attribute.keepOnSplit:!1}))}function pm(t,e,r={}){const{empty:n,ranges:i}=t.selection,o=e?Ti(e,t.schema):null;if(n)return!!(t.storedMarks||t.selection.$from.marks()).filter(f=>o?o.name===f.type.name:!0).find(f=>nu(f.attrs,r,{strict:!1}));let s=0;const a=[];if(i.forEach(({$from:f,$to:d})=>{const h=f.pos,p=d.pos;t.doc.nodesBetween(h,p,(m,y)=>{if(!m.isText&&!m.marks.length)return;const g=Math.max(h,y),b=Math.min(p,y+m.nodeSize),S=b-g;s+=S,a.push(...m.marks.map(x=>({mark:x,from:g,to:b})))})}),s===0)return!1;const l=a.filter(f=>o?o.name===f.mark.type.name:!0).filter(f=>nu(f.mark.attrs,r,{strict:!1})).reduce((f,d)=>f+d.to-d.from,0),c=a.filter(f=>o?f.mark.type!==o&&f.mark.type.excludes(o):!0).reduce((f,d)=>f+d.to-d.from,0);return(l>0?l+c:l)>=s}function AA(t,e,r={}){if(!e)return La(t,null,r)||pm(t,null,r);const n=Df(e,t.schema);return n==="node"?La(t,e,r):n==="mark"?pm(t,e,r):!1}function mm(t,e){const{nodeExtensions:r}=Of(e),n=r.find(s=>s.name===t);if(!n)return!1;const i={name:n.name,options:n.options,storage:n.storage},o=De(Ee(n,"group",i));return typeof o!="string"?!1:o.split(" ").includes("list")}function by(t,{checkChildren:e=!0,ignoreWhitespace:r=!1}={}){var n;if(r){if(t.type.name==="hardBreak")return!0;if(t.isText)return/^\s*$/m.test((n=t.text)!==null&&n!==void 0?n:"")}if(t.isText)return!t.text;if(t.isAtom||t.isLeaf)return!1;if(t.content.childCount===0)return!0;if(e){let i=!0;return t.content.forEach(o=>{i!==!1&&(by(o,{ignoreWhitespace:r,checkChildren:e})||(i=!1))}),i}return!1}function CA(t){return t instanceof ke}function dF(t,e,r){const i=t.state.doc.content.size,o=vn(e,0,i),s=vn(r,0,i),a=t.coordsAtPos(o),l=t.coordsAtPos(s,-1),c=Math.min(a.top,l.top),u=Math.max(a.bottom,l.bottom),f=Math.min(a.left,l.left),d=Math.max(a.right,l.right),h=d-f,p=u-c,g={top:c,bottom:u,left:f,right:d,width:h,height:p,x:f,y:c};return{...g,toJSON:()=>g}}function hF(t,e,r){var n;const{selection:i}=e;let o=null;if(vy(i)&&(o=i.$cursor),o){const a=(n=t.storedMarks)!==null&&n!==void 0?n:o.marks();return!!r.isInSet(a)||!a.some(l=>l.type.excludes(r))}const{ranges:s}=i;return s.some(({$from:a,$to:l})=>{let c=a.depth===0?t.doc.inlineContent&&t.doc.type.allowsMarkType(r):!1;return t.doc.nodesBetween(a.pos,l.pos,(u,f,d)=>{if(c)return!1;if(u.isInline){const h=!d||d.type.allowsMarkType(r),p=!!r.isInSet(u.marks)||!u.marks.some(m=>m.type.excludes(r));c=h&&p}return!c}),c})}const pF=(t,e={})=>({tr:r,state:n,dispatch:i})=>{const{selection:o}=r,{empty:s,ranges:a}=o,l=Ti(t,n.schema);if(i)if(s){const c=fl(n,l);r.addStoredMark(l.create({...c,...e}))}else a.forEach(c=>{const u=c.$from.pos,f=c.$to.pos;n.doc.nodesBetween(u,f,(d,h)=>{const p=Math.max(h,u),m=Math.min(h+d.nodeSize,f);d.marks.find(g=>g.type===l)?d.marks.forEach(g=>{l===g.type&&r.addMark(p,m,l.create({...g.attrs,...e}))}):r.addMark(p,m,l.create(e))})});return hF(n,r,l)},mF=(t,e)=>({tr:r})=>(r.setMeta(t,e),!0),gF=(t,e={})=>({state:r,dispatch:n,chain:i})=>{const o=wt(t,r.schema);return o.isTextblock?i().command(({commands:s})=>Sb(o,e)(r)?!0:s.clearNodes()).command(({state:s})=>Sb(o,e)(s,n)).run():(console.warn('[tiptap warn]: Currently "setNode()" only supports text block nodes.'),!1)},yF=t=>({tr:e,dispatch:r})=>{if(r){const{doc:n}=e,i=vn(t,0,n.content.size),o=ke.create(n,i);e.setSelection(o)}return!0},vF=t=>({tr:e,dispatch:r})=>{if(r){const{doc:n}=e,{from:i,to:o}=typeof t=="number"?{from:t,to:t}:t,s=_e.atStart(n).from,a=_e.atEnd(n).to,l=vn(i,s,a),c=vn(o,s,a),u=_e.create(n,l,c);e.setSelection(u)}return!0},wF=t=>({state:e,dispatch:r})=>{const n=wt(t,e.schema);return XP(n)(e,r)};function kb(t,e){const r=t.storedMarks||t.selection.$to.parentOffset&&t.selection.$from.marks();if(r){const n=r.filter(i=>e==null?void 0:e.includes(i.type.name));t.tr.ensureMarks(n)}}const bF=({keepMarks:t=!0}={})=>({tr:e,state:r,dispatch:n,editor:i})=>{const{selection:o,doc:s}=e,{$from:a,$to:l}=o,c=i.extensionManager.attributes,u=bc(c,a.node().type.name,a.node().attrs);if(o instanceof ke&&o.node.isBlock)return!a.parentOffset||!Vo(s,a.pos)?!1:(n&&(t&&kb(r,i.extensionManager.splittableMarks),e.split(a.pos).scrollIntoView()),!0);if(!a.parent.isBlock)return!1;const f=l.parentOffset===l.parent.content.size,d=a.depth===0?void 0:nF(a.node(-1).contentMatchAt(a.indexAfter(-1)));let h=f&&d?[{type:d,attrs:u}]:void 0,p=Vo(e.doc,e.mapping.map(a.pos),1,h);if(!h&&!p&&Vo(e.doc,e.mapping.map(a.pos),1,d?[{type:d}]:void 0)&&(p=!0,h=d?[{type:d,attrs:u}]:void 0),n){if(p&&(o instanceof _e&&e.deleteSelection(),e.split(e.mapping.map(a.pos),1,h),d&&!f&&!a.parentOffset&&a.parent.type!==d)){const m=e.mapping.map(a.before()),y=e.doc.resolve(m);a.node(-1).canReplaceWith(y.index(),y.index()+1,d)&&e.setNodeMarkup(e.mapping.map(a.before()),d)}t&&kb(r,i.extensionManager.splittableMarks),e.scrollIntoView()}return p},xF=(t,e={})=>({tr:r,state:n,dispatch:i,editor:o})=>{var s;const a=wt(t,n.schema),{$from:l,$to:c}=n.selection,u=n.selection.node;if(u&&u.isBlock||l.depth<2||!l.sameParent(c))return!1;const f=l.node(-1);if(f.type!==a)return!1;const d=o.extensionManager.attributes;if(l.parent.content.size===0&&l.node(-1).childCount===l.indexAfter(-1)){if(l.depth===2||l.node(-3).type!==a||l.index(-2)!==l.node(-2).childCount-1)return!1;if(i){let g=he.empty;const b=l.index(-1)?1:l.index(-2)?2:3;for(let $=l.depth-b;$>=l.depth-3;$-=1)g=he.from(l.node($).copy(g));const S=l.indexAfter(-1)<l.node(-2).childCount?1:l.indexAfter(-2)<l.node(-3).childCount?2:3,x={...bc(d,l.node().type.name,l.node().attrs),...e},O=((s=a.contentMatch.defaultType)===null||s===void 0?void 0:s.createAndFill(x))||void 0;g=g.append(he.from(a.createAndFill(null,O)||void 0));const M=l.before(l.depth-(b-1));r.replace(M,l.after(-S),new we(g,4-b,0));let D=-1;r.doc.nodesBetween(M,r.doc.content.size,($,A)=>{if(D>-1)return!1;$.isTextblock&&$.content.size===0&&(D=A+1)}),D>-1&&r.setSelection(_e.near(r.doc.resolve(D))),r.scrollIntoView()}return!0}const h=c.pos===l.end()?f.contentMatchAt(0).defaultType:null,p={...bc(d,f.type.name,f.attrs),...e},m={...bc(d,l.node().type.name,l.node().attrs),...e};r.delete(l.pos,c.pos);const y=h?[{type:a,attrs:p},{type:h,attrs:m}]:[{type:a,attrs:p}];if(!Vo(r.doc,l.pos,2))return!1;if(i){const{selection:g,storedMarks:b}=n,{splittableMarks:S}=o.extensionManager,x=b||g.$to.parentOffset&&g.$from.marks();if(r.split(l.pos,2,y).scrollIntoView(),!x||!i)return!0;const O=x.filter(M=>S.includes(M.type.name));r.ensureMarks(O)}return!0},zd=(t,e)=>{const r=Pf(s=>s.type===e)(t.selection);if(!r)return!0;const n=t.doc.resolve(Math.max(0,r.pos-1)).before(r.depth);if(n===void 0)return!0;const i=t.doc.nodeAt(n);return r.node.type===(i==null?void 0:i.type)&&Si(t.doc,r.pos)&&t.join(r.pos),!0},Ud=(t,e)=>{const r=Pf(s=>s.type===e)(t.selection);if(!r)return!0;const n=t.doc.resolve(r.start).after(r.depth);if(n===void 0)return!0;const i=t.doc.nodeAt(n);return r.node.type===(i==null?void 0:i.type)&&Si(t.doc,n)&&t.join(n),!0},SF=(t,e,r,n={})=>({editor:i,tr:o,state:s,dispatch:a,chain:l,commands:c,can:u})=>{const{extensions:f,splittableMarks:d}=i.extensionManager,h=wt(t,s.schema),p=wt(e,s.schema),{selection:m,storedMarks:y}=s,{$from:g,$to:b}=m,S=g.blockRange(b),x=y||m.$to.parentOffset&&m.$from.marks();if(!S)return!1;const O=Pf(M=>mm(M.type.name,f))(m);if(S.depth>=1&&O&&S.depth-O.depth<=1){if(O.node.type===h)return c.liftListItem(p);if(mm(O.node.type.name,f)&&h.validContent(O.node.content)&&a)return l().command(()=>(o.setNodeMarkup(O.pos,h),!0)).command(()=>zd(o,h)).command(()=>Ud(o,h)).run()}return!r||!x||!a?l().command(()=>u().wrapInList(h,n)?!0:c.clearNodes()).wrapInList(h,n).command(()=>zd(o,h)).command(()=>Ud(o,h)).run():l().command(()=>{const M=u().wrapInList(h,n),D=x.filter($=>d.includes($.type.name));return o.ensureMarks(D),M?!0:c.clearNodes()}).wrapInList(h,n).command(()=>zd(o,h)).command(()=>Ud(o,h)).run()},EF=(t,e={},r={})=>({state:n,commands:i})=>{const{extendEmptyMarkRange:o=!1}=r,s=Ti(t,n.schema);return pm(n,s,e)?i.unsetMark(s,{extendEmptyMarkRange:o}):i.setMark(s,e)},TF=(t,e,r={})=>({state:n,commands:i})=>{const o=wt(t,n.schema),s=wt(e,n.schema);return La(n,o,r)?i.setNode(s):i.setNode(o,r)},AF=(t,e={})=>({state:r,commands:n})=>{const i=wt(t,r.schema);return La(r,i,e)?n.lift(i):n.wrapIn(i,e)},CF=()=>({state:t,dispatch:e})=>{const r=t.plugins;for(let n=0;n<r.length;n+=1){const i=r[n];let o;if(i.spec.isInputRules&&(o=i.getState(t))){if(e){const s=t.tr,a=o.transform;for(let l=a.steps.length-1;l>=0;l-=1)s.step(a.steps[l].invert(a.docs[l]));if(o.text){const l=s.doc.resolve(o.from).marks();s.replaceWith(o.from,o.to,t.schema.text(o.text,l))}else s.delete(o.from,o.to)}return!0}}return!1},kF=()=>({tr:t,dispatch:e})=>{const{selection:r}=t,{empty:n,ranges:i}=r;return n||e&&i.forEach(o=>{t.removeMark(o.$from.pos,o.$to.pos)}),!0},_F=(t,e={})=>({tr:r,state:n,dispatch:i})=>{var o;const{extendEmptyMarkRange:s=!1}=e,{selection:a}=r,l=Ti(t,n.schema),{$from:c,empty:u,ranges:f}=a;if(!i)return!0;if(u&&s){let{from:d,to:h}=a;const p=(o=c.marks().find(y=>y.type===l))===null||o===void 0?void 0:o.attrs,m=If(c,l,p);m&&(d=m.from,h=m.to),r.removeMark(d,h,l)}else f.forEach(d=>{r.removeMark(d.$from.pos,d.$to.pos,l)});return r.removeStoredMark(l),!0},OF=(t,e={})=>({tr:r,state:n,dispatch:i})=>{let o=null,s=null;const a=Df(typeof t=="string"?t:t.name,n.schema);return a?(a==="node"&&(o=wt(t,n.schema)),a==="mark"&&(s=Ti(t,n.schema)),i&&r.selection.ranges.forEach(l=>{const c=l.$from.pos,u=l.$to.pos;n.doc.nodesBetween(c,u,(f,d)=>{o&&o===f.type&&r.setNodeMarkup(d,void 0,{...f.attrs,...e}),s&&f.marks.length&&f.marks.forEach(h=>{if(s===h.type){const p=Math.max(d,c),m=Math.min(d+f.nodeSize,u);r.addMark(p,m,s.create({...h.attrs,...e}))}})})}),!0):!1},RF=(t,e={})=>({state:r,dispatch:n})=>{const i=wt(t,r.schema);return UP(i,e)(r,n)},MF=(t,e={})=>({state:r,dispatch:n})=>{const i=wt(t,r.schema);return WP(i,e)(r,n)};var IF=Object.freeze({__proto__:null,blur:dL,clearContent:hL,clearNodes:pL,command:mL,createParagraphNear:gL,cut:yL,deleteCurrentNode:vL,deleteNode:wL,deleteRange:bL,deleteSelection:xL,enter:SL,exitCode:EL,extendMarkRange:AL,first:CL,focus:kL,forEach:_L,insertContent:OL,insertContentAt:IL,joinBackward:PL,joinDown:DL,joinForward:LL,joinItemBackward:FL,joinItemForward:BL,joinTextblockBackward:$L,joinTextblockForward:jL,joinUp:NL,keyboardShortcut:zL,lift:UL,liftEmptyBlock:WL,liftListItem:VL,newlineInCode:GL,resetAttributes:KL,scrollIntoView:qL,selectAll:XL,selectNodeBackward:JL,selectNodeForward:YL,selectParentNode:ZL,selectTextblockEnd:QL,selectTextblockStart:eF,setContent:tF,setMark:pF,setMeta:mF,setNode:gF,setNodeSelection:yF,setTextSelection:vF,sinkListItem:wF,splitBlock:bF,splitListItem:xF,toggleList:SF,toggleMark:EF,toggleNode:TF,toggleWrap:AF,undoInputRule:CF,unsetAllMarks:kF,unsetMark:_F,updateAttributes:OF,wrapIn:RF,wrapInList:MF});const NF=dt.create({name:"commands",addCommands(){return{...IF}}}),DF=dt.create({name:"editable",addProseMirrorPlugins(){return[new tt({key:new et("editable"),props:{editable:()=>this.editor.options.editable}})]}}),PF=dt.create({name:"focusEvents",addProseMirrorPlugins(){const{editor:t}=this;return[new tt({key:new et("focusEvents"),props:{handleDOMEvents:{focus:(e,r)=>{t.isFocused=!0;const n=t.state.tr.setMeta("focus",{event:r}).setMeta("addToHistory",!1);return e.dispatch(n),!1},blur:(e,r)=>{t.isFocused=!1;const n=t.state.tr.setMeta("blur",{event:r}).setMeta("addToHistory",!1);return e.dispatch(n),!1}}}})]}}),LF=dt.create({name:"keymap",addKeyboardShortcuts(){const t=()=>this.editor.commands.first(({commands:s})=>[()=>s.undoInputRule(),()=>s.command(({tr:a})=>{const{selection:l,doc:c}=a,{empty:u,$anchor:f}=l,{pos:d,parent:h}=f,p=f.parent.isTextblock&&d>0?a.doc.resolve(d-1):f,m=p.parent.type.spec.isolating,y=f.pos-f.parentOffset,g=m&&p.parent.childCount===1?y===f.pos:Re.atStart(c).from===d;return!u||!h.type.isTextblock||h.textContent.length||!g||g&&f.parent.type.name==="paragraph"?!1:s.clearNodes()}),()=>s.deleteSelection(),()=>s.joinBackward(),()=>s.selectNodeBackward()]),e=()=>this.editor.commands.first(({commands:s})=>[()=>s.deleteSelection(),()=>s.deleteCurrentNode(),()=>s.joinForward(),()=>s.selectNodeForward()]),n={Enter:()=>this.editor.commands.first(({commands:s})=>[()=>s.newlineInCode(),()=>s.createParagraphNear(),()=>s.liftEmptyBlock(),()=>s.splitBlock()]),"Mod-Enter":()=>this.editor.commands.exitCode(),Backspace:t,"Mod-Backspace":t,"Shift-Backspace":t,Delete:e,"Mod-Delete":e,"Mod-a":()=>this.editor.commands.selectAll()},i={...n},o={...n,"Ctrl-h":t,"Alt-Backspace":t,"Ctrl-d":e,"Ctrl-Alt-Backspace":e,"Alt-Delete":e,"Alt-d":e,"Ctrl-a":()=>this.editor.commands.selectTextblockStart(),"Ctrl-e":()=>this.editor.commands.selectTextblockEnd()};return Nf()||SA()?o:i},addProseMirrorPlugins(){return[new tt({key:new et("clearDocument"),appendTransaction:(t,e,r)=>{if(!(t.some(p=>p.docChanged)&&!e.doc.eq(r.doc)))return;const{empty:i,from:o,to:s}=e.selection,a=Re.atStart(e.doc).from,l=Re.atEnd(e.doc).to;if(i||!(o===a&&s===l)||!(r.doc.textBetween(0,r.doc.content.size," "," ").length===0))return;const f=r.tr,d=kf({state:r,transaction:f}),{commands:h}=new _f({editor:this.editor,state:d});if(h.clearNodes(),!!f.steps.length)return f}})]}}),FF=dt.create({name:"tabindex",addProseMirrorPlugins(){return[new tt({key:new et("tabindex"),props:{attributes:()=>this.editor.isEditable?{tabindex:"0"}:{}}})]}});class Fi{get name(){return this.node.type.name}constructor(e,r,n=!1,i=null){this.currentNode=null,this.actualDepth=null,this.isBlock=n,this.resolvedPos=e,this.editor=r,this.currentNode=i}get node(){return this.currentNode||this.resolvedPos.node()}get element(){return this.editor.view.domAtPos(this.pos).node}get depth(){var e;return(e=this.actualDepth)!==null&&e!==void 0?e:this.resolvedPos.depth}get pos(){return this.resolvedPos.pos}get content(){return this.node.content}set content(e){let r=this.from,n=this.to;if(this.isBlock){if(this.content.size===0){console.error(`You can’t set content on a block node. Tried to set content on ${this.name} at ${this.pos}`);return}r=this.from+1,n=this.to-1}this.editor.commands.insertContentAt({from:r,to:n},e)}get attributes(){return this.node.attrs}get textContent(){return this.node.textContent}get size(){return this.node.nodeSize}get from(){return this.isBlock?this.pos:this.resolvedPos.start(this.resolvedPos.depth)}get range(){return{from:this.from,to:this.to}}get to(){return this.isBlock?this.pos+this.size:this.resolvedPos.end(this.resolvedPos.depth)+(this.node.isText?0:1)}get parent(){if(this.depth===0)return null;const e=this.resolvedPos.start(this.resolvedPos.depth-1),r=this.resolvedPos.doc.resolve(e);return new Fi(r,this.editor)}get before(){let e=this.resolvedPos.doc.resolve(this.from-(this.isBlock?1:2));return e.depth!==this.depth&&(e=this.resolvedPos.doc.resolve(this.from-3)),new Fi(e,this.editor)}get after(){let e=this.resolvedPos.doc.resolve(this.to+(this.isBlock?2:1));return e.depth!==this.depth&&(e=this.resolvedPos.doc.resolve(this.to+3)),new Fi(e,this.editor)}get children(){const e=[];return this.node.content.forEach((r,n)=>{const i=r.isBlock&&!r.isTextblock,o=this.pos+n+1,s=this.resolvedPos.doc.resolve(o);if(!i&&s.depth<=this.depth)return;const a=new Fi(s,this.editor,i,i?r:null);i&&(a.actualDepth=this.depth+1),e.push(new Fi(s,this.editor,i,i?r:null))}),e}get firstChild(){return this.children[0]||null}get lastChild(){const e=this.children;return e[e.length-1]||null}closest(e,r={}){let n=null,i=this.parent;for(;i&&!n;){if(i.node.type.name===e)if(Object.keys(r).length>0){const o=i.node.attrs,s=Object.keys(r);for(let a=0;a<s.length;a+=1){const l=s[a];if(o[l]!==r[l])break}}else n=i;i=i.parent}return n}querySelector(e,r={}){return this.querySelectorAll(e,r,!0)[0]||null}querySelectorAll(e,r={},n=!1){let i=[];if(!this.children||this.children.length===0)return i;const o=Object.keys(r);return this.children.forEach(s=>{n&&i.length>0||(s.node.type.name===e&&o.every(l=>r[l]===s.node.attrs[l])&&i.push(s),!(n&&i.length>0)&&(i=i.concat(s.querySelectorAll(e,r,n))))}),i}setAttribute(e){const r=this.editor.state.selection;this.editor.chain().setTextSelection(this.from).updateAttributes(this.node.type.name,e).setTextSelection(r.from).run()}}const BF=`.ProseMirror {
14
- position: relative;
15
- }
16
-
17
- .ProseMirror {
18
- word-wrap: break-word;
19
- white-space: pre-wrap;
20
- white-space: break-spaces;
21
- -webkit-font-variant-ligatures: none;
22
- font-variant-ligatures: none;
23
- font-feature-settings: "liga" 0; /* the above doesn't seem to work in Edge */
24
- }
25
-
26
- .ProseMirror [contenteditable="false"] {
27
- white-space: normal;
28
- }
29
-
30
- .ProseMirror [contenteditable="false"] [contenteditable="true"] {
31
- white-space: pre-wrap;
32
- }
33
-
34
- .ProseMirror pre {
35
- white-space: pre-wrap;
36
- }
37
-
38
- img.ProseMirror-separator {
39
- display: inline !important;
40
- border: none !important;
41
- margin: 0 !important;
42
- width: 0 !important;
43
- height: 0 !important;
44
- }
45
-
46
- .ProseMirror-gapcursor {
47
- display: none;
48
- pointer-events: none;
49
- position: absolute;
50
- margin: 0;
51
- }
52
-
53
- .ProseMirror-gapcursor:after {
54
- content: "";
55
- display: block;
56
- position: absolute;
57
- top: -2px;
58
- width: 20px;
59
- border-top: 1px solid black;
60
- animation: ProseMirror-cursor-blink 1.1s steps(2, start) infinite;
61
- }
62
-
63
- @keyframes ProseMirror-cursor-blink {
64
- to {
65
- visibility: hidden;
66
- }
67
- }
68
-
69
- .ProseMirror-hideselection *::selection {
70
- background: transparent;
71
- }
72
-
73
- .ProseMirror-hideselection *::-moz-selection {
74
- background: transparent;
75
- }
76
-
77
- .ProseMirror-hideselection * {
78
- caret-color: transparent;
79
- }
80
-
81
- .ProseMirror-focused .ProseMirror-gapcursor {
82
- display: block;
83
- }
84
-
85
- .tippy-box[data-animation=fade][data-state=hidden] {
86
- opacity: 0
87
- }`;function $F(t,e,r){const n=document.querySelector("style[data-tiptap-style]");if(n!==null)return n;const i=document.createElement("style");return e&&i.setAttribute("nonce",e),i.setAttribute("data-tiptap-style",""),i.innerHTML=t,document.getElementsByTagName("head")[0].appendChild(i),i}class jF extends JP{constructor(e={}){super(),this.isFocused=!1,this.isInitialized=!1,this.extensionStorage={},this.options={element:document.createElement("div"),content:"",injectCSS:!0,injectNonce:void 0,extensions:[],autofocus:!1,editable:!0,editorProps:{},parseOptions:{},coreExtensionOptions:{},enableInputRules:!0,enablePasteRules:!0,enableCoreExtensions:!0,enableContentCheck:!1,onBeforeCreate:()=>null,onCreate:()=>null,onUpdate:()=>null,onSelectionUpdate:()=>null,onTransaction:()=>null,onFocus:()=>null,onBlur:()=>null,onDestroy:()=>null,onContentError:({error:r})=>{throw r}},this.isCapturingTransaction=!1,this.capturedTransaction=null,this.setOptions(e),this.createExtensionManager(),this.createCommandManager(),this.createSchema(),this.on("beforeCreate",this.options.onBeforeCreate),this.emit("beforeCreate",{editor:this}),this.on("contentError",this.options.onContentError),this.createView(),this.injectCSS(),this.on("create",this.options.onCreate),this.on("update",this.options.onUpdate),this.on("selectionUpdate",this.options.onSelectionUpdate),this.on("transaction",this.options.onTransaction),this.on("focus",this.options.onFocus),this.on("blur",this.options.onBlur),this.on("destroy",this.options.onDestroy),window.setTimeout(()=>{this.isDestroyed||(this.commands.focus(this.options.autofocus),this.emit("create",{editor:this}),this.isInitialized=!0)},0)}get storage(){return this.extensionStorage}get commands(){return this.commandManager.commands}chain(){return this.commandManager.chain()}can(){return this.commandManager.can()}injectCSS(){this.options.injectCSS&&document&&(this.css=$F(BF,this.options.injectNonce))}setOptions(e={}){this.options={...this.options,...e},!(!this.view||!this.state||this.isDestroyed)&&(this.options.editorProps&&this.view.setProps(this.options.editorProps),this.view.updateState(this.state))}setEditable(e,r=!0){this.setOptions({editable:e}),r&&this.emit("update",{editor:this,transaction:this.state.tr})}get isEditable(){return this.options.editable&&this.view&&this.view.editable}get state(){return this.view.state}registerPlugin(e,r){const n=yA(r)?r(e,[...this.state.plugins]):[...this.state.plugins,e],i=this.state.reconfigure({plugins:n});this.view.updateState(i)}unregisterPlugin(e){if(this.isDestroyed)return;const r=typeof e=="string"?`${e}$`:e.key,n=this.state.reconfigure({plugins:this.state.plugins.filter(i=>!i.key.startsWith(r))});this.view.updateState(n)}createExtensionManager(){var e,r;const i=[...this.options.enableCoreExtensions?[DF,fL.configure({blockSeparator:(r=(e=this.options.coreExtensionOptions)===null||e===void 0?void 0:e.clipboardTextSerializer)===null||r===void 0?void 0:r.blockSeparator}),NF,PF,LF,FF]:[],...this.options.extensions].filter(o=>["extension","node","mark"].includes(o==null?void 0:o.type));this.extensionManager=new zo(i,this)}createCommandManager(){this.commandManager=new _f({editor:this})}createSchema(){this.schema=this.extensionManager.schema}createView(){let e;try{e=hm(this.options.content,this.schema,this.options.parseOptions,{errorOnInvalidContent:this.options.enableContentCheck})}catch(o){if(!(o instanceof Error)||!["[tiptap error]: Invalid JSON content","[tiptap error]: Invalid HTML content"].includes(o.message))throw o;this.emit("contentError",{editor:this,error:o,disableCollaboration:()=>{this.options.extensions=this.options.extensions.filter(s=>s.name!=="collaboration"),this.createExtensionManager()}}),e=hm(this.options.content,this.schema,this.options.parseOptions,{errorOnInvalidContent:!1})}const r=bA(e,this.options.autofocus);this.view=new gP(this.options.element,{...this.options.editorProps,dispatchTransaction:this.dispatchTransaction.bind(this),state:Ho.create({doc:e,selection:r||void 0})});const n=this.state.reconfigure({plugins:this.extensionManager.plugins});this.view.updateState(n),this.createNodeViews(),this.prependClass();const i=this.view.dom;i.editor=this}createNodeViews(){this.view.isDestroyed||this.view.setProps({nodeViews:this.extensionManager.nodeViews})}prependClass(){this.view.dom.className=`tiptap ${this.view.dom.className}`}captureTransaction(e){this.isCapturingTransaction=!0,e(),this.isCapturingTransaction=!1;const r=this.capturedTransaction;return this.capturedTransaction=null,r}dispatchTransaction(e){if(this.view.isDestroyed)return;if(this.isCapturingTransaction){if(!this.capturedTransaction){this.capturedTransaction=e;return}e.steps.forEach(s=>{var a;return(a=this.capturedTransaction)===null||a===void 0?void 0:a.step(s)});return}const r=this.state.apply(e),n=!this.state.selection.eq(r.selection);this.emit("beforeTransaction",{editor:this,transaction:e,nextState:r}),this.view.updateState(r),this.emit("transaction",{editor:this,transaction:e}),n&&this.emit("selectionUpdate",{editor:this,transaction:e});const i=e.getMeta("focus"),o=e.getMeta("blur");i&&this.emit("focus",{editor:this,event:i.event,transaction:e}),o&&this.emit("blur",{editor:this,event:o.event,transaction:e}),!(!e.docChanged||e.getMeta("preventUpdate"))&&this.emit("update",{editor:this,transaction:e})}getAttributes(e){return TA(this.state,e)}isActive(e,r){const n=typeof e=="string"?e:null,i=typeof e=="string"?r:e;return AA(this.state,n,i)}getJSON(){return this.state.doc.toJSON()}getHTML(){return sF(this.state.doc.content,this.schema)}getText(e){const{blockSeparator:r=`
88
-
89
- `,textSerializers:n={}}=e||{};return aF(this.state.doc,{blockSeparator:r,textSerializers:{...wA(this.schema),...n}})}get isEmpty(){return by(this.state.doc)}getCharacterCount(){return console.warn('[tiptap warn]: "editor.getCharacterCount()" is deprecated. Please use "editor.storage.characterCount.characters()" instead.'),this.state.doc.content.size-2}destroy(){this.emit("destroy"),this.view&&this.view.destroy(),this.removeAllListeners()}get isDestroyed(){var e;return!(!((e=this.view)===null||e===void 0)&&e.docView)}$node(e,r){var n;return((n=this.$doc)===null||n===void 0?void 0:n.querySelector(e,r))||null}$nodes(e,r){var n;return((n=this.$doc)===null||n===void 0?void 0:n.querySelectorAll(e,r))||null}$pos(e){const r=this.state.doc.resolve(e);return new Fi(r,this)}get $doc(){return this.$pos(0)}}function to(t){return new Rf({find:t.find,handler:({state:e,range:r,match:n})=>{const i=De(t.getAttributes,void 0,n);if(i===!1||i===null)return null;const{tr:o}=e,s=n[n.length-1],a=n[0];if(s){const l=a.search(/\S/),c=r.from+a.indexOf(s),u=c+s.length;if(wy(r.from,r.to,e.doc).filter(h=>h.mark.type.excluded.find(m=>m===t.type&&m!==h.mark.type)).filter(h=>h.to>c).length)return null;u<r.to&&o.delete(u,r.to),c>r.from&&o.delete(r.from+l,c);const d=r.from+l+s.length;o.addMark(r.from+l,d,t.type.create(i||{})),o.removeStoredMark(t.type)}}})}function xy(t){return new Rf({find:t.find,handler:({state:e,range:r,match:n})=>{const i=De(t.getAttributes,void 0,n)||{},{tr:o}=e,s=r.from;let a=r.to;const l=t.type.create(i);if(n[1]){const c=n[0].lastIndexOf(n[1]);let u=s+c;u>a?u=a:a=u+n[1].length;const f=n[0][n[0].length-1];o.insertText(f,s+n[0].length-1),o.replaceWith(u,a,l)}else if(n[0]){const c=t.type.isInline?s:s-1;o.insert(c,t.type.create(i)).delete(o.mapping.map(s),o.mapping.map(a))}o.scrollIntoView()}})}function gm(t){return new Rf({find:t.find,handler:({state:e,range:r,match:n})=>{const i=e.doc.resolve(r.from),o=De(t.getAttributes,void 0,n)||{};if(!i.node(-1).canReplaceWith(i.index(-1),i.indexAfter(-1),t.type))return null;e.tr.delete(r.from,r.to).setBlockType(r.from,r.from,t.type,o)}})}function ls(t){return new Rf({find:t.find,handler:({state:e,range:r,match:n,chain:i})=>{const o=De(t.getAttributes,void 0,n)||{},s=e.tr.delete(r.from,r.to),l=s.doc.resolve(r.from).blockRange(),c=l&&ry(l,t.type,o);if(!c)return null;if(s.wrap(l,c),t.keepMarks&&t.editor){const{selection:f,storedMarks:d}=e,{splittableMarks:h}=t.editor.extensionManager,p=d||f.$to.parentOffset&&f.$from.marks();if(p){const m=p.filter(y=>h.includes(y.type.name));s.ensureMarks(m)}}if(t.keepAttributes){const f=t.type.name==="bulletList"||t.type.name==="orderedList"?"listItem":"taskList";i().updateAttributes(f,o).run()}const u=s.doc.resolve(r.from-1).nodeBefore;u&&u.type===t.type&&Si(s.doc,r.from-1)&&(!t.joinPredicate||t.joinPredicate(n,u))&&s.join(r.from-1)}})}class Nt{constructor(e={}){this.type="mark",this.name="mark",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...e},this.name=this.config.name,e.defaultOptions&&Object.keys(e.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=De(Ee(this,"addOptions",{name:this.name}))),this.storage=De(Ee(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(e={}){return new Nt(e)}configure(e={}){const r=this.extend({...this.config,addOptions:()=>Mf(this.options,e)});return r.name=this.name,r.parent=this.parent,r}extend(e={}){const r=new Nt(e);return r.parent=this,this.child=r,r.name=e.name?e.name:r.parent.name,e.defaultOptions&&Object.keys(e.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${r.name}".`),r.options=De(Ee(r,"addOptions",{name:r.name})),r.storage=De(Ee(r,"addStorage",{name:r.name,options:r.options})),r}static handleExit({editor:e,mark:r}){const{tr:n}=e.state,i=e.state.selection.$from;if(i.pos===i.end()){const s=i.marks();if(!!!s.find(c=>(c==null?void 0:c.type.name)===r.name))return!1;const l=s.find(c=>(c==null?void 0:c.type.name)===r.name);return l&&n.removeStoredMark(l),n.insertText(" ",i.pos),e.view.dispatch(n),!0}return!1}}let ct=class ym{constructor(e={}){this.type="node",this.name="node",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...e},this.name=this.config.name,e.defaultOptions&&Object.keys(e.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=De(Ee(this,"addOptions",{name:this.name}))),this.storage=De(Ee(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(e={}){return new ym(e)}configure(e={}){const r=this.extend({...this.config,addOptions:()=>Mf(this.options,e)});return r.name=this.name,r.parent=this.parent,r}extend(e={}){const r=new ym(e);return r.parent=this,this.child=r,r.name=e.name?e.name:r.parent.name,e.defaultOptions&&Object.keys(e.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${r.name}".`),r.options=De(Ee(r,"addOptions",{name:r.name})),r.storage=De(Ee(r,"addStorage",{name:r.name,options:r.options})),r}};function HF(){return navigator.platform==="Android"||/android/i.test(navigator.userAgent)}class zF{constructor(e,r,n){this.isDragging=!1,this.component=e,this.editor=r.editor,this.options={stopEvent:null,ignoreMutation:null,...n},this.extension=r.extension,this.node=r.node,this.decorations=r.decorations,this.getPos=r.getPos,this.mount()}mount(){}get dom(){return this.editor.view.dom}get contentDOM(){return null}onDragStart(e){var r,n,i,o,s,a,l;const{view:c}=this.editor,u=e.target,f=u.nodeType===3?(r=u.parentElement)===null||r===void 0?void 0:r.closest("[data-drag-handle]"):u.closest("[data-drag-handle]");if(!this.dom||!((n=this.contentDOM)===null||n===void 0)&&n.contains(u)||!f)return;let d=0,h=0;if(this.dom!==f){const y=this.dom.getBoundingClientRect(),g=f.getBoundingClientRect(),b=(i=e.offsetX)!==null&&i!==void 0?i:(o=e.nativeEvent)===null||o===void 0?void 0:o.offsetX,S=(s=e.offsetY)!==null&&s!==void 0?s:(a=e.nativeEvent)===null||a===void 0?void 0:a.offsetY;d=g.x-y.x+b,h=g.y-y.y+S}(l=e.dataTransfer)===null||l===void 0||l.setDragImage(this.dom,d,h);const p=ke.create(c.state.doc,this.getPos()),m=c.state.tr.setSelection(p);c.dispatch(m)}stopEvent(e){var r;if(!this.dom)return!1;if(typeof this.options.stopEvent=="function")return this.options.stopEvent({event:e});const n=e.target;if(!(this.dom.contains(n)&&!(!((r=this.contentDOM)===null||r===void 0)&&r.contains(n))))return!1;const o=e.type.startsWith("drag"),s=e.type==="drop";if((["INPUT","BUTTON","SELECT","TEXTAREA"].includes(n.tagName)||n.isContentEditable)&&!s&&!o)return!0;const{isEditable:l}=this.editor,{isDragging:c}=this,u=!!this.node.type.spec.draggable,f=ke.isSelectable(this.node),d=e.type==="copy",h=e.type==="paste",p=e.type==="cut",m=e.type==="mousedown";if(!u&&f&&o&&e.preventDefault(),u&&o&&!c)return e.preventDefault(),!1;if(u&&l&&!c&&m){const y=n.closest("[data-drag-handle]");y&&(this.dom===y||this.dom.contains(y))&&(this.isDragging=!0,document.addEventListener("dragend",()=>{this.isDragging=!1},{once:!0}),document.addEventListener("drop",()=>{this.isDragging=!1},{once:!0}),document.addEventListener("mouseup",()=>{this.isDragging=!1},{once:!0}))}return!(c||s||d||h||p||m&&f)}ignoreMutation(e){return!this.dom||!this.contentDOM?!0:typeof this.options.ignoreMutation=="function"?this.options.ignoreMutation({mutation:e}):this.node.isLeaf||this.node.isAtom?!0:e.type==="selection"||this.dom.contains(e.target)&&e.type==="childList"&&(Nf()||HF())&&this.editor.isFocused&&[...Array.from(e.addedNodes),...Array.from(e.removedNodes)].every(n=>n.isContentEditable)?!1:this.contentDOM===e.target&&e.type==="attributes"?!0:!this.contentDOM.contains(e.target)}updateAttributes(e){this.editor.commands.command(({tr:r})=>{const n=this.getPos();return r.setNodeMarkup(n,void 0,{...this.node.attrs,...e}),!0})}deleteNode(){const e=this.getPos(),r=e+this.node.nodeSize;this.editor.commands.deleteRange({from:e,to:r})}}function di(t){return new iL({find:t.find,handler:({state:e,range:r,match:n,pasteEvent:i})=>{const o=De(t.getAttributes,void 0,n,i);if(o===!1||o===null)return null;const{tr:s}=e,a=n[n.length-1],l=n[0];let c=r.to;if(a){const u=l.search(/\S/),f=r.from+l.indexOf(a),d=f+a.length;if(wy(r.from,r.to,e.doc).filter(p=>p.mark.type.excluded.find(y=>y===t.type&&y!==p.mark.type)).filter(p=>p.to>f).length)return null;d<r.to&&s.delete(d,r.to),f>r.from&&s.delete(r.from+u,f),c=r.from+u+a.length,s.addMark(r.from+u,c,t.type.create(o||{})),s.removeStoredMark(t.type)}}})}function UF(t){return t.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&")}const WF=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))$/,VF=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))/g,GF=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))$/,KF=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))/g,qF=Nt.create({name:"bold",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"strong"},{tag:"b",getAttrs:t=>t.style.fontWeight!=="normal"&&null},{style:"font-weight",getAttrs:t=>/^(bold(er)?|[5-9]\d{2,})$/.test(t)&&null}]},renderHTML({HTMLAttributes:t}){return["strong",Be(this.options.HTMLAttributes,t),0]},addCommands(){return{setBold:()=>({commands:t})=>t.setMark(this.name),toggleBold:()=>({commands:t})=>t.toggleMark(this.name),unsetBold:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-b":()=>this.editor.commands.toggleBold(),"Mod-B":()=>this.editor.commands.toggleBold()}},addInputRules(){return[to({find:WF,type:this.type}),to({find:GF,type:this.type})]},addPasteRules(){return[di({find:VF,type:this.type}),di({find:KF,type:this.type})]}});function XF(t,e){typeof t=="function"?t(e):t!=null&&(t.current=e)}function Lf(...t){return e=>t.forEach(r=>XF(r,e))}function lt(...t){return L.useCallback(Lf(...t),t)}var ro=L.forwardRef((t,e)=>{const{children:r,...n}=t,i=L.Children.toArray(r),o=i.find(JF);if(o){const s=o.props.children,a=i.map(l=>l===o?L.Children.count(s)>1?L.Children.only(null):L.isValidElement(s)?s.props.children:null:l);return ee.jsx(vm,{...n,ref:e,children:L.isValidElement(s)?L.cloneElement(s,void 0,a):null})}return ee.jsx(vm,{...n,ref:e,children:r})});ro.displayName="Slot";var vm=L.forwardRef((t,e)=>{const{children:r,...n}=t;if(L.isValidElement(r)){const i=ZF(r);return L.cloneElement(r,{...YF(n,r.props),ref:e?Lf(e,i):i})}return L.Children.count(r)>1?L.Children.only(null):null});vm.displayName="SlotClone";var kA=({children:t})=>ee.jsx(ee.Fragment,{children:t});function JF(t){return L.isValidElement(t)&&t.type===kA}function YF(t,e){const r={...e};for(const n in e){const i=t[n],o=e[n];/^on[A-Z]/.test(n)?i&&o?r[n]=(...a)=>{o(...a),i(...a)}:i&&(r[n]=i):n==="style"?r[n]={...i,...o}:n==="className"&&(r[n]=[i,o].filter(Boolean).join(" "))}return{...t,...r}}function ZF(t){var n,i;let e=(n=Object.getOwnPropertyDescriptor(t.props,"ref"))==null?void 0:n.get,r=e&&"isReactWarning"in e&&e.isReactWarning;return r?t.ref:(e=(i=Object.getOwnPropertyDescriptor(t,"ref"))==null?void 0:i.get,r=e&&"isReactWarning"in e&&e.isReactWarning,r?t.props.ref:t.props.ref||t.ref)}function _A(t){var e,r,n="";if(typeof t=="string"||typeof t=="number")n+=t;else if(typeof t=="object")if(Array.isArray(t)){var i=t.length;for(e=0;e<i;e++)t[e]&&(r=_A(t[e]))&&(n&&(n+=" "),n+=r)}else for(r in t)t[r]&&(n&&(n+=" "),n+=r);return n}function QF(){for(var t,e,r=0,n="",i=arguments.length;r<i;r++)(t=arguments[r])&&(e=_A(t))&&(n&&(n+=" "),n+=e);return n}const Sy="-",eB=t=>{const e=rB(t),{conflictingClassGroups:r,conflictingClassGroupModifiers:n}=t;return{getClassGroupId:s=>{const a=s.split(Sy);return a[0]===""&&a.length!==1&&a.shift(),OA(a,e)||tB(s)},getConflictingClassGroupIds:(s,a)=>{const l=r[s]||[];return a&&n[s]?[...l,...n[s]]:l}}},OA=(t,e)=>{var s;if(t.length===0)return e.classGroupId;const r=t[0],n=e.nextPart.get(r),i=n?OA(t.slice(1),n):void 0;if(i)return i;if(e.validators.length===0)return;const o=t.join(Sy);return(s=e.validators.find(({validator:a})=>a(o)))==null?void 0:s.classGroupId},_b=/^\[(.+)\]$/,tB=t=>{if(_b.test(t)){const e=_b.exec(t)[1],r=e==null?void 0:e.substring(0,e.indexOf(":"));if(r)return"arbitrary.."+r}},rB=t=>{const{theme:e,prefix:r}=t,n={nextPart:new Map,validators:[]};return iB(Object.entries(t.classGroups),r).forEach(([o,s])=>{wm(s,n,o,e)}),n},wm=(t,e,r,n)=>{t.forEach(i=>{if(typeof i=="string"){const o=i===""?e:Ob(e,i);o.classGroupId=r;return}if(typeof i=="function"){if(nB(i)){wm(i(n),e,r,n);return}e.validators.push({validator:i,classGroupId:r});return}Object.entries(i).forEach(([o,s])=>{wm(s,Ob(e,o),r,n)})})},Ob=(t,e)=>{let r=t;return e.split(Sy).forEach(n=>{r.nextPart.has(n)||r.nextPart.set(n,{nextPart:new Map,validators:[]}),r=r.nextPart.get(n)}),r},nB=t=>t.isThemeGetter,iB=(t,e)=>e?t.map(([r,n])=>{const i=n.map(o=>typeof o=="string"?e+o:typeof o=="object"?Object.fromEntries(Object.entries(o).map(([s,a])=>[e+s,a])):o);return[r,i]}):t,oB=t=>{if(t<1)return{get:()=>{},set:()=>{}};let e=0,r=new Map,n=new Map;const i=(o,s)=>{r.set(o,s),e++,e>t&&(e=0,n=r,r=new Map)};return{get(o){let s=r.get(o);if(s!==void 0)return s;if((s=n.get(o))!==void 0)return i(o,s),s},set(o,s){r.has(o)?r.set(o,s):i(o,s)}}},RA="!",sB=t=>{const{separator:e,experimentalParseClassName:r}=t,n=e.length===1,i=e[0],o=e.length,s=a=>{const l=[];let c=0,u=0,f;for(let y=0;y<a.length;y++){let g=a[y];if(c===0){if(g===i&&(n||a.slice(y,y+o)===e)){l.push(a.slice(u,y)),u=y+o;continue}if(g==="/"){f=y;continue}}g==="["?c++:g==="]"&&c--}const d=l.length===0?a:a.substring(u),h=d.startsWith(RA),p=h?d.substring(1):d,m=f&&f>u?f-u:void 0;return{modifiers:l,hasImportantModifier:h,baseClassName:p,maybePostfixModifierPosition:m}};return r?a=>r({className:a,parseClassName:s}):s},aB=t=>{if(t.length<=1)return t;const e=[];let r=[];return t.forEach(n=>{n[0]==="["?(e.push(...r.sort(),n),r=[]):r.push(n)}),e.push(...r.sort()),e},lB=t=>({cache:oB(t.cacheSize),parseClassName:sB(t),...eB(t)}),cB=/\s+/,uB=(t,e)=>{const{parseClassName:r,getClassGroupId:n,getConflictingClassGroupIds:i}=e,o=[],s=t.trim().split(cB);let a="";for(let l=s.length-1;l>=0;l-=1){const c=s[l],{modifiers:u,hasImportantModifier:f,baseClassName:d,maybePostfixModifierPosition:h}=r(c);let p=!!h,m=n(p?d.substring(0,h):d);if(!m){if(!p){a=c+(a.length>0?" "+a:a);continue}if(m=n(d),!m){a=c+(a.length>0?" "+a:a);continue}p=!1}const y=aB(u).join(":"),g=f?y+RA:y,b=g+m;if(o.includes(b))continue;o.push(b);const S=i(m,p);for(let x=0;x<S.length;++x){const O=S[x];o.push(g+O)}a=c+(a.length>0?" "+a:a)}return a};function fB(){let t=0,e,r,n="";for(;t<arguments.length;)(e=arguments[t++])&&(r=MA(e))&&(n&&(n+=" "),n+=r);return n}const MA=t=>{if(typeof t=="string")return t;let e,r="";for(let n=0;n<t.length;n++)t[n]&&(e=MA(t[n]))&&(r&&(r+=" "),r+=e);return r};function dB(t,...e){let r,n,i,o=s;function s(l){const c=e.reduce((u,f)=>f(u),t());return r=lB(c),n=r.cache.get,i=r.cache.set,o=a,a(l)}function a(l){const c=n(l);if(c)return c;const u=uB(l,r);return i(l,u),u}return function(){return o(fB.apply(null,arguments))}}const Je=t=>{const e=r=>r[t]||[];return e.isThemeGetter=!0,e},IA=/^\[(?:([a-z-]+):)?(.+)\]$/i,hB=/^\d+\/\d+$/,pB=new Set(["px","full","screen"]),mB=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,gB=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,yB=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,vB=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,wB=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,un=t=>qo(t)||pB.has(t)||hB.test(t),Bn=t=>Rs(t,"length",kB),qo=t=>!!t&&!Number.isNaN(Number(t)),Wd=t=>Rs(t,"number",qo),Vs=t=>!!t&&Number.isInteger(Number(t)),bB=t=>t.endsWith("%")&&qo(t.slice(0,-1)),Ie=t=>IA.test(t),$n=t=>mB.test(t),xB=new Set(["length","size","percentage"]),SB=t=>Rs(t,xB,NA),EB=t=>Rs(t,"position",NA),TB=new Set(["image","url"]),AB=t=>Rs(t,TB,OB),CB=t=>Rs(t,"",_B),Gs=()=>!0,Rs=(t,e,r)=>{const n=IA.exec(t);return n?n[1]?typeof e=="string"?n[1]===e:e.has(n[1]):r(n[2]):!1},kB=t=>gB.test(t)&&!yB.test(t),NA=()=>!1,_B=t=>vB.test(t),OB=t=>wB.test(t),RB=()=>{const t=Je("colors"),e=Je("spacing"),r=Je("blur"),n=Je("brightness"),i=Je("borderColor"),o=Je("borderRadius"),s=Je("borderSpacing"),a=Je("borderWidth"),l=Je("contrast"),c=Je("grayscale"),u=Je("hueRotate"),f=Je("invert"),d=Je("gap"),h=Je("gradientColorStops"),p=Je("gradientColorStopPositions"),m=Je("inset"),y=Je("margin"),g=Je("opacity"),b=Je("padding"),S=Je("saturate"),x=Je("scale"),O=Je("sepia"),M=Je("skew"),D=Je("space"),$=Je("translate"),A=()=>["auto","contain","none"],V=()=>["auto","hidden","clip","visible","scroll"],Q=()=>["auto",Ie,e],I=()=>[Ie,e],U=()=>["",un,Bn],k=()=>["auto",qo,Ie],G=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],te=()=>["solid","dashed","dotted","double","none"],W=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],ae=()=>["start","end","center","between","around","evenly","stretch"],X=()=>["","0",Ie],de=()=>["auto","avoid","all","avoid-page","page","left","right","column"],q=()=>[qo,Ie];return{cacheSize:500,separator:":",theme:{colors:[Gs],spacing:[un,Bn],blur:["none","",$n,Ie],brightness:q(),borderColor:[t],borderRadius:["none","","full",$n,Ie],borderSpacing:I(),borderWidth:U(),contrast:q(),grayscale:X(),hueRotate:q(),invert:X(),gap:I(),gradientColorStops:[t],gradientColorStopPositions:[bB,Bn],inset:Q(),margin:Q(),opacity:q(),padding:I(),saturate:q(),scale:q(),sepia:X(),skew:q(),space:I(),translate:I()},classGroups:{aspect:[{aspect:["auto","square","video",Ie]}],container:["container"],columns:[{columns:[$n]}],"break-after":[{"break-after":de()}],"break-before":[{"break-before":de()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...G(),Ie]}],overflow:[{overflow:V()}],"overflow-x":[{"overflow-x":V()}],"overflow-y":[{"overflow-y":V()}],overscroll:[{overscroll:A()}],"overscroll-x":[{"overscroll-x":A()}],"overscroll-y":[{"overscroll-y":A()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[m]}],"inset-x":[{"inset-x":[m]}],"inset-y":[{"inset-y":[m]}],start:[{start:[m]}],end:[{end:[m]}],top:[{top:[m]}],right:[{right:[m]}],bottom:[{bottom:[m]}],left:[{left:[m]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",Vs,Ie]}],basis:[{basis:Q()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",Ie]}],grow:[{grow:X()}],shrink:[{shrink:X()}],order:[{order:["first","last","none",Vs,Ie]}],"grid-cols":[{"grid-cols":[Gs]}],"col-start-end":[{col:["auto",{span:["full",Vs,Ie]},Ie]}],"col-start":[{"col-start":k()}],"col-end":[{"col-end":k()}],"grid-rows":[{"grid-rows":[Gs]}],"row-start-end":[{row:["auto",{span:[Vs,Ie]},Ie]}],"row-start":[{"row-start":k()}],"row-end":[{"row-end":k()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",Ie]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",Ie]}],gap:[{gap:[d]}],"gap-x":[{"gap-x":[d]}],"gap-y":[{"gap-y":[d]}],"justify-content":[{justify:["normal",...ae()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...ae(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...ae(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[b]}],px:[{px:[b]}],py:[{py:[b]}],ps:[{ps:[b]}],pe:[{pe:[b]}],pt:[{pt:[b]}],pr:[{pr:[b]}],pb:[{pb:[b]}],pl:[{pl:[b]}],m:[{m:[y]}],mx:[{mx:[y]}],my:[{my:[y]}],ms:[{ms:[y]}],me:[{me:[y]}],mt:[{mt:[y]}],mr:[{mr:[y]}],mb:[{mb:[y]}],ml:[{ml:[y]}],"space-x":[{"space-x":[D]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[D]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",Ie,e]}],"min-w":[{"min-w":[Ie,e,"min","max","fit"]}],"max-w":[{"max-w":[Ie,e,"none","full","min","max","fit","prose",{screen:[$n]},$n]}],h:[{h:[Ie,e,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[Ie,e,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[Ie,e,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[Ie,e,"auto","min","max","fit"]}],"font-size":[{text:["base",$n,Bn]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",Wd]}],"font-family":[{font:[Gs]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractons"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",Ie]}],"line-clamp":[{"line-clamp":["none",qo,Wd]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",un,Ie]}],"list-image":[{"list-image":["none",Ie]}],"list-style-type":[{list:["none","disc","decimal",Ie]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[t]}],"placeholder-opacity":[{"placeholder-opacity":[g]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[t]}],"text-opacity":[{"text-opacity":[g]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...te(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",un,Bn]}],"underline-offset":[{"underline-offset":["auto",un,Ie]}],"text-decoration-color":[{decoration:[t]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:I()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Ie]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",Ie]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[g]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...G(),EB]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",SB]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},AB]}],"bg-color":[{bg:[t]}],"gradient-from-pos":[{from:[p]}],"gradient-via-pos":[{via:[p]}],"gradient-to-pos":[{to:[p]}],"gradient-from":[{from:[h]}],"gradient-via":[{via:[h]}],"gradient-to":[{to:[h]}],rounded:[{rounded:[o]}],"rounded-s":[{"rounded-s":[o]}],"rounded-e":[{"rounded-e":[o]}],"rounded-t":[{"rounded-t":[o]}],"rounded-r":[{"rounded-r":[o]}],"rounded-b":[{"rounded-b":[o]}],"rounded-l":[{"rounded-l":[o]}],"rounded-ss":[{"rounded-ss":[o]}],"rounded-se":[{"rounded-se":[o]}],"rounded-ee":[{"rounded-ee":[o]}],"rounded-es":[{"rounded-es":[o]}],"rounded-tl":[{"rounded-tl":[o]}],"rounded-tr":[{"rounded-tr":[o]}],"rounded-br":[{"rounded-br":[o]}],"rounded-bl":[{"rounded-bl":[o]}],"border-w":[{border:[a]}],"border-w-x":[{"border-x":[a]}],"border-w-y":[{"border-y":[a]}],"border-w-s":[{"border-s":[a]}],"border-w-e":[{"border-e":[a]}],"border-w-t":[{"border-t":[a]}],"border-w-r":[{"border-r":[a]}],"border-w-b":[{"border-b":[a]}],"border-w-l":[{"border-l":[a]}],"border-opacity":[{"border-opacity":[g]}],"border-style":[{border:[...te(),"hidden"]}],"divide-x":[{"divide-x":[a]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[a]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[g]}],"divide-style":[{divide:te()}],"border-color":[{border:[i]}],"border-color-x":[{"border-x":[i]}],"border-color-y":[{"border-y":[i]}],"border-color-t":[{"border-t":[i]}],"border-color-r":[{"border-r":[i]}],"border-color-b":[{"border-b":[i]}],"border-color-l":[{"border-l":[i]}],"divide-color":[{divide:[i]}],"outline-style":[{outline:["",...te()]}],"outline-offset":[{"outline-offset":[un,Ie]}],"outline-w":[{outline:[un,Bn]}],"outline-color":[{outline:[t]}],"ring-w":[{ring:U()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[t]}],"ring-opacity":[{"ring-opacity":[g]}],"ring-offset-w":[{"ring-offset":[un,Bn]}],"ring-offset-color":[{"ring-offset":[t]}],shadow:[{shadow:["","inner","none",$n,CB]}],"shadow-color":[{shadow:[Gs]}],opacity:[{opacity:[g]}],"mix-blend":[{"mix-blend":[...W(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":W()}],filter:[{filter:["","none"]}],blur:[{blur:[r]}],brightness:[{brightness:[n]}],contrast:[{contrast:[l]}],"drop-shadow":[{"drop-shadow":["","none",$n,Ie]}],grayscale:[{grayscale:[c]}],"hue-rotate":[{"hue-rotate":[u]}],invert:[{invert:[f]}],saturate:[{saturate:[S]}],sepia:[{sepia:[O]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[r]}],"backdrop-brightness":[{"backdrop-brightness":[n]}],"backdrop-contrast":[{"backdrop-contrast":[l]}],"backdrop-grayscale":[{"backdrop-grayscale":[c]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[u]}],"backdrop-invert":[{"backdrop-invert":[f]}],"backdrop-opacity":[{"backdrop-opacity":[g]}],"backdrop-saturate":[{"backdrop-saturate":[S]}],"backdrop-sepia":[{"backdrop-sepia":[O]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[s]}],"border-spacing-x":[{"border-spacing-x":[s]}],"border-spacing-y":[{"border-spacing-y":[s]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",Ie]}],duration:[{duration:q()}],ease:[{ease:["linear","in","out","in-out",Ie]}],delay:[{delay:q()}],animate:[{animate:["none","spin","ping","pulse","bounce",Ie]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[x]}],"scale-x":[{"scale-x":[x]}],"scale-y":[{"scale-y":[x]}],rotate:[{rotate:[Vs,Ie]}],"translate-x":[{"translate-x":[$]}],"translate-y":[{"translate-y":[$]}],"skew-x":[{"skew-x":[M]}],"skew-y":[{"skew-y":[M]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",Ie]}],accent:[{accent:["auto",t]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",Ie]}],"caret-color":[{caret:[t]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":I()}],"scroll-mx":[{"scroll-mx":I()}],"scroll-my":[{"scroll-my":I()}],"scroll-ms":[{"scroll-ms":I()}],"scroll-me":[{"scroll-me":I()}],"scroll-mt":[{"scroll-mt":I()}],"scroll-mr":[{"scroll-mr":I()}],"scroll-mb":[{"scroll-mb":I()}],"scroll-ml":[{"scroll-ml":I()}],"scroll-p":[{"scroll-p":I()}],"scroll-px":[{"scroll-px":I()}],"scroll-py":[{"scroll-py":I()}],"scroll-ps":[{"scroll-ps":I()}],"scroll-pe":[{"scroll-pe":I()}],"scroll-pt":[{"scroll-pt":I()}],"scroll-pr":[{"scroll-pr":I()}],"scroll-pb":[{"scroll-pb":I()}],"scroll-pl":[{"scroll-pl":I()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",Ie]}],fill:[{fill:[t,"none"]}],"stroke-w":[{stroke:[un,Bn,Wd]}],stroke:[{stroke:[t,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}},MB=dB(RB);var Xt="top",yr="bottom",vr="right",Jt="left",Ey="auto",dl=[Xt,yr,vr,Jt],cs="start",Fa="end",IB="clippingParents",DA="viewport",Ks="popper",NB="reference",Rb=dl.reduce(function(t,e){return t.concat([e+"-"+cs,e+"-"+Fa])},[]),PA=[].concat(dl,[Ey]).reduce(function(t,e){return t.concat([e,e+"-"+cs,e+"-"+Fa])},[]),DB="beforeRead",PB="read",LB="afterRead",FB="beforeMain",BB="main",$B="afterMain",jB="beforeWrite",HB="write",zB="afterWrite",UB=[DB,PB,LB,FB,BB,$B,jB,HB,zB];function Yr(t){return t?(t.nodeName||"").toLowerCase():null}function or(t){if(t==null)return window;if(t.toString()!=="[object Window]"){var e=t.ownerDocument;return e&&e.defaultView||window}return t}function no(t){var e=or(t).Element;return t instanceof e||t instanceof Element}function mr(t){var e=or(t).HTMLElement;return t instanceof e||t instanceof HTMLElement}function Ty(t){if(typeof ShadowRoot>"u")return!1;var e=or(t).ShadowRoot;return t instanceof e||t instanceof ShadowRoot}function WB(t){var e=t.state;Object.keys(e.elements).forEach(function(r){var n=e.styles[r]||{},i=e.attributes[r]||{},o=e.elements[r];!mr(o)||!Yr(o)||(Object.assign(o.style,n),Object.keys(i).forEach(function(s){var a=i[s];a===!1?o.removeAttribute(s):o.setAttribute(s,a===!0?"":a)}))})}function VB(t){var e=t.state,r={popper:{position:e.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(e.elements.popper.style,r.popper),e.styles=r,e.elements.arrow&&Object.assign(e.elements.arrow.style,r.arrow),function(){Object.keys(e.elements).forEach(function(n){var i=e.elements[n],o=e.attributes[n]||{},s=Object.keys(e.styles.hasOwnProperty(n)?e.styles[n]:r[n]),a=s.reduce(function(l,c){return l[c]="",l},{});!mr(i)||!Yr(i)||(Object.assign(i.style,a),Object.keys(o).forEach(function(l){i.removeAttribute(l)}))})}}const LA={name:"applyStyles",enabled:!0,phase:"write",fn:WB,effect:VB,requires:["computeStyles"]};function Gr(t){return t.split("-")[0]}var Ki=Math.max,ou=Math.min,us=Math.round;function bm(){var t=navigator.userAgentData;return t!=null&&t.brands&&Array.isArray(t.brands)?t.brands.map(function(e){return e.brand+"/"+e.version}).join(" "):navigator.userAgent}function FA(){return!/^((?!chrome|android).)*safari/i.test(bm())}function fs(t,e,r){e===void 0&&(e=!1),r===void 0&&(r=!1);var n=t.getBoundingClientRect(),i=1,o=1;e&&mr(t)&&(i=t.offsetWidth>0&&us(n.width)/t.offsetWidth||1,o=t.offsetHeight>0&&us(n.height)/t.offsetHeight||1);var s=no(t)?or(t):window,a=s.visualViewport,l=!FA()&&r,c=(n.left+(l&&a?a.offsetLeft:0))/i,u=(n.top+(l&&a?a.offsetTop:0))/o,f=n.width/i,d=n.height/o;return{width:f,height:d,top:u,right:c+f,bottom:u+d,left:c,x:c,y:u}}function Ay(t){var e=fs(t),r=t.offsetWidth,n=t.offsetHeight;return Math.abs(e.width-r)<=1&&(r=e.width),Math.abs(e.height-n)<=1&&(n=e.height),{x:t.offsetLeft,y:t.offsetTop,width:r,height:n}}function BA(t,e){var r=e.getRootNode&&e.getRootNode();if(t.contains(e))return!0;if(r&&Ty(r)){var n=e;do{if(n&&t.isSameNode(n))return!0;n=n.parentNode||n.host}while(n)}return!1}function Tn(t){return or(t).getComputedStyle(t)}function GB(t){return["table","td","th"].indexOf(Yr(t))>=0}function Ai(t){return((no(t)?t.ownerDocument:t.document)||window.document).documentElement}function Ff(t){return Yr(t)==="html"?t:t.assignedSlot||t.parentNode||(Ty(t)?t.host:null)||Ai(t)}function Mb(t){return!mr(t)||Tn(t).position==="fixed"?null:t.offsetParent}function KB(t){var e=/firefox/i.test(bm()),r=/Trident/i.test(bm());if(r&&mr(t)){var n=Tn(t);if(n.position==="fixed")return null}var i=Ff(t);for(Ty(i)&&(i=i.host);mr(i)&&["html","body"].indexOf(Yr(i))<0;){var o=Tn(i);if(o.transform!=="none"||o.perspective!=="none"||o.contain==="paint"||["transform","perspective"].indexOf(o.willChange)!==-1||e&&o.willChange==="filter"||e&&o.filter&&o.filter!=="none")return i;i=i.parentNode}return null}function hl(t){for(var e=or(t),r=Mb(t);r&&GB(r)&&Tn(r).position==="static";)r=Mb(r);return r&&(Yr(r)==="html"||Yr(r)==="body"&&Tn(r).position==="static")?e:r||KB(t)||e}function Cy(t){return["top","bottom"].indexOf(t)>=0?"x":"y"}function ma(t,e,r){return Ki(t,ou(e,r))}function qB(t,e,r){var n=ma(t,e,r);return n>r?r:n}function $A(){return{top:0,right:0,bottom:0,left:0}}function jA(t){return Object.assign({},$A(),t)}function HA(t,e){return e.reduce(function(r,n){return r[n]=t,r},{})}var XB=function(e,r){return e=typeof e=="function"?e(Object.assign({},r.rects,{placement:r.placement})):e,jA(typeof e!="number"?e:HA(e,dl))};function JB(t){var e,r=t.state,n=t.name,i=t.options,o=r.elements.arrow,s=r.modifiersData.popperOffsets,a=Gr(r.placement),l=Cy(a),c=[Jt,vr].indexOf(a)>=0,u=c?"height":"width";if(!(!o||!s)){var f=XB(i.padding,r),d=Ay(o),h=l==="y"?Xt:Jt,p=l==="y"?yr:vr,m=r.rects.reference[u]+r.rects.reference[l]-s[l]-r.rects.popper[u],y=s[l]-r.rects.reference[l],g=hl(o),b=g?l==="y"?g.clientHeight||0:g.clientWidth||0:0,S=m/2-y/2,x=f[h],O=b-d[u]-f[p],M=b/2-d[u]/2+S,D=ma(x,M,O),$=l;r.modifiersData[n]=(e={},e[$]=D,e.centerOffset=D-M,e)}}function YB(t){var e=t.state,r=t.options,n=r.element,i=n===void 0?"[data-popper-arrow]":n;i!=null&&(typeof i=="string"&&(i=e.elements.popper.querySelector(i),!i)||BA(e.elements.popper,i)&&(e.elements.arrow=i))}const ZB={name:"arrow",enabled:!0,phase:"main",fn:JB,effect:YB,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function ds(t){return t.split("-")[1]}var QB={top:"auto",right:"auto",bottom:"auto",left:"auto"};function e5(t,e){var r=t.x,n=t.y,i=e.devicePixelRatio||1;return{x:us(r*i)/i||0,y:us(n*i)/i||0}}function Ib(t){var e,r=t.popper,n=t.popperRect,i=t.placement,o=t.variation,s=t.offsets,a=t.position,l=t.gpuAcceleration,c=t.adaptive,u=t.roundOffsets,f=t.isFixed,d=s.x,h=d===void 0?0:d,p=s.y,m=p===void 0?0:p,y=typeof u=="function"?u({x:h,y:m}):{x:h,y:m};h=y.x,m=y.y;var g=s.hasOwnProperty("x"),b=s.hasOwnProperty("y"),S=Jt,x=Xt,O=window;if(c){var M=hl(r),D="clientHeight",$="clientWidth";if(M===or(r)&&(M=Ai(r),Tn(M).position!=="static"&&a==="absolute"&&(D="scrollHeight",$="scrollWidth")),M=M,i===Xt||(i===Jt||i===vr)&&o===Fa){x=yr;var A=f&&M===O&&O.visualViewport?O.visualViewport.height:M[D];m-=A-n.height,m*=l?1:-1}if(i===Jt||(i===Xt||i===yr)&&o===Fa){S=vr;var V=f&&M===O&&O.visualViewport?O.visualViewport.width:M[$];h-=V-n.width,h*=l?1:-1}}var Q=Object.assign({position:a},c&&QB),I=u===!0?e5({x:h,y:m},or(r)):{x:h,y:m};if(h=I.x,m=I.y,l){var U;return Object.assign({},Q,(U={},U[x]=b?"0":"",U[S]=g?"0":"",U.transform=(O.devicePixelRatio||1)<=1?"translate("+h+"px, "+m+"px)":"translate3d("+h+"px, "+m+"px, 0)",U))}return Object.assign({},Q,(e={},e[x]=b?m+"px":"",e[S]=g?h+"px":"",e.transform="",e))}function t5(t){var e=t.state,r=t.options,n=r.gpuAcceleration,i=n===void 0?!0:n,o=r.adaptive,s=o===void 0?!0:o,a=r.roundOffsets,l=a===void 0?!0:a,c={placement:Gr(e.placement),variation:ds(e.placement),popper:e.elements.popper,popperRect:e.rects.popper,gpuAcceleration:i,isFixed:e.options.strategy==="fixed"};e.modifiersData.popperOffsets!=null&&(e.styles.popper=Object.assign({},e.styles.popper,Ib(Object.assign({},c,{offsets:e.modifiersData.popperOffsets,position:e.options.strategy,adaptive:s,roundOffsets:l})))),e.modifiersData.arrow!=null&&(e.styles.arrow=Object.assign({},e.styles.arrow,Ib(Object.assign({},c,{offsets:e.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:l})))),e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-placement":e.placement})}const r5={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:t5,data:{}};var Dl={passive:!0};function n5(t){var e=t.state,r=t.instance,n=t.options,i=n.scroll,o=i===void 0?!0:i,s=n.resize,a=s===void 0?!0:s,l=or(e.elements.popper),c=[].concat(e.scrollParents.reference,e.scrollParents.popper);return o&&c.forEach(function(u){u.addEventListener("scroll",r.update,Dl)}),a&&l.addEventListener("resize",r.update,Dl),function(){o&&c.forEach(function(u){u.removeEventListener("scroll",r.update,Dl)}),a&&l.removeEventListener("resize",r.update,Dl)}}const i5={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:n5,data:{}};var o5={left:"right",right:"left",bottom:"top",top:"bottom"};function xc(t){return t.replace(/left|right|bottom|top/g,function(e){return o5[e]})}var s5={start:"end",end:"start"};function Nb(t){return t.replace(/start|end/g,function(e){return s5[e]})}function ky(t){var e=or(t),r=e.pageXOffset,n=e.pageYOffset;return{scrollLeft:r,scrollTop:n}}function _y(t){return fs(Ai(t)).left+ky(t).scrollLeft}function a5(t,e){var r=or(t),n=Ai(t),i=r.visualViewport,o=n.clientWidth,s=n.clientHeight,a=0,l=0;if(i){o=i.width,s=i.height;var c=FA();(c||!c&&e==="fixed")&&(a=i.offsetLeft,l=i.offsetTop)}return{width:o,height:s,x:a+_y(t),y:l}}function l5(t){var e,r=Ai(t),n=ky(t),i=(e=t.ownerDocument)==null?void 0:e.body,o=Ki(r.scrollWidth,r.clientWidth,i?i.scrollWidth:0,i?i.clientWidth:0),s=Ki(r.scrollHeight,r.clientHeight,i?i.scrollHeight:0,i?i.clientHeight:0),a=-n.scrollLeft+_y(t),l=-n.scrollTop;return Tn(i||r).direction==="rtl"&&(a+=Ki(r.clientWidth,i?i.clientWidth:0)-o),{width:o,height:s,x:a,y:l}}function Oy(t){var e=Tn(t),r=e.overflow,n=e.overflowX,i=e.overflowY;return/auto|scroll|overlay|hidden/.test(r+i+n)}function zA(t){return["html","body","#document"].indexOf(Yr(t))>=0?t.ownerDocument.body:mr(t)&&Oy(t)?t:zA(Ff(t))}function ga(t,e){var r;e===void 0&&(e=[]);var n=zA(t),i=n===((r=t.ownerDocument)==null?void 0:r.body),o=or(n),s=i?[o].concat(o.visualViewport||[],Oy(n)?n:[]):n,a=e.concat(s);return i?a:a.concat(ga(Ff(s)))}function xm(t){return Object.assign({},t,{left:t.x,top:t.y,right:t.x+t.width,bottom:t.y+t.height})}function c5(t,e){var r=fs(t,!1,e==="fixed");return r.top=r.top+t.clientTop,r.left=r.left+t.clientLeft,r.bottom=r.top+t.clientHeight,r.right=r.left+t.clientWidth,r.width=t.clientWidth,r.height=t.clientHeight,r.x=r.left,r.y=r.top,r}function Db(t,e,r){return e===DA?xm(a5(t,r)):no(e)?c5(e,r):xm(l5(Ai(t)))}function u5(t){var e=ga(Ff(t)),r=["absolute","fixed"].indexOf(Tn(t).position)>=0,n=r&&mr(t)?hl(t):t;return no(n)?e.filter(function(i){return no(i)&&BA(i,n)&&Yr(i)!=="body"}):[]}function f5(t,e,r,n){var i=e==="clippingParents"?u5(t):[].concat(e),o=[].concat(i,[r]),s=o[0],a=o.reduce(function(l,c){var u=Db(t,c,n);return l.top=Ki(u.top,l.top),l.right=ou(u.right,l.right),l.bottom=ou(u.bottom,l.bottom),l.left=Ki(u.left,l.left),l},Db(t,s,n));return a.width=a.right-a.left,a.height=a.bottom-a.top,a.x=a.left,a.y=a.top,a}function UA(t){var e=t.reference,r=t.element,n=t.placement,i=n?Gr(n):null,o=n?ds(n):null,s=e.x+e.width/2-r.width/2,a=e.y+e.height/2-r.height/2,l;switch(i){case Xt:l={x:s,y:e.y-r.height};break;case yr:l={x:s,y:e.y+e.height};break;case vr:l={x:e.x+e.width,y:a};break;case Jt:l={x:e.x-r.width,y:a};break;default:l={x:e.x,y:e.y}}var c=i?Cy(i):null;if(c!=null){var u=c==="y"?"height":"width";switch(o){case cs:l[c]=l[c]-(e[u]/2-r[u]/2);break;case Fa:l[c]=l[c]+(e[u]/2-r[u]/2);break}}return l}function Ba(t,e){e===void 0&&(e={});var r=e,n=r.placement,i=n===void 0?t.placement:n,o=r.strategy,s=o===void 0?t.strategy:o,a=r.boundary,l=a===void 0?IB:a,c=r.rootBoundary,u=c===void 0?DA:c,f=r.elementContext,d=f===void 0?Ks:f,h=r.altBoundary,p=h===void 0?!1:h,m=r.padding,y=m===void 0?0:m,g=jA(typeof y!="number"?y:HA(y,dl)),b=d===Ks?NB:Ks,S=t.rects.popper,x=t.elements[p?b:d],O=f5(no(x)?x:x.contextElement||Ai(t.elements.popper),l,u,s),M=fs(t.elements.reference),D=UA({reference:M,element:S,strategy:"absolute",placement:i}),$=xm(Object.assign({},S,D)),A=d===Ks?$:M,V={top:O.top-A.top+g.top,bottom:A.bottom-O.bottom+g.bottom,left:O.left-A.left+g.left,right:A.right-O.right+g.right},Q=t.modifiersData.offset;if(d===Ks&&Q){var I=Q[i];Object.keys(V).forEach(function(U){var k=[vr,yr].indexOf(U)>=0?1:-1,G=[Xt,yr].indexOf(U)>=0?"y":"x";V[U]+=I[G]*k})}return V}function d5(t,e){e===void 0&&(e={});var r=e,n=r.placement,i=r.boundary,o=r.rootBoundary,s=r.padding,a=r.flipVariations,l=r.allowedAutoPlacements,c=l===void 0?PA:l,u=ds(n),f=u?a?Rb:Rb.filter(function(p){return ds(p)===u}):dl,d=f.filter(function(p){return c.indexOf(p)>=0});d.length===0&&(d=f);var h=d.reduce(function(p,m){return p[m]=Ba(t,{placement:m,boundary:i,rootBoundary:o,padding:s})[Gr(m)],p},{});return Object.keys(h).sort(function(p,m){return h[p]-h[m]})}function h5(t){if(Gr(t)===Ey)return[];var e=xc(t);return[Nb(t),e,Nb(e)]}function p5(t){var e=t.state,r=t.options,n=t.name;if(!e.modifiersData[n]._skip){for(var i=r.mainAxis,o=i===void 0?!0:i,s=r.altAxis,a=s===void 0?!0:s,l=r.fallbackPlacements,c=r.padding,u=r.boundary,f=r.rootBoundary,d=r.altBoundary,h=r.flipVariations,p=h===void 0?!0:h,m=r.allowedAutoPlacements,y=e.options.placement,g=Gr(y),b=g===y,S=l||(b||!p?[xc(y)]:h5(y)),x=[y].concat(S).reduce(function(Z,ie){return Z.concat(Gr(ie)===Ey?d5(e,{placement:ie,boundary:u,rootBoundary:f,padding:c,flipVariations:p,allowedAutoPlacements:m}):ie)},[]),O=e.rects.reference,M=e.rects.popper,D=new Map,$=!0,A=x[0],V=0;V<x.length;V++){var Q=x[V],I=Gr(Q),U=ds(Q)===cs,k=[Xt,yr].indexOf(I)>=0,G=k?"width":"height",te=Ba(e,{placement:Q,boundary:u,rootBoundary:f,altBoundary:d,padding:c}),W=k?U?vr:Jt:U?yr:Xt;O[G]>M[G]&&(W=xc(W));var ae=xc(W),X=[];if(o&&X.push(te[I]<=0),a&&X.push(te[W]<=0,te[ae]<=0),X.every(function(Z){return Z})){A=Q,$=!1;break}D.set(Q,X)}if($)for(var de=p?3:1,q=function(ie){var K=x.find(function(_){var C=D.get(_);if(C)return C.slice(0,ie).every(function(z){return z})});if(K)return A=K,"break"},N=de;N>0;N--){var Y=q(N);if(Y==="break")break}e.placement!==A&&(e.modifiersData[n]._skip=!0,e.placement=A,e.reset=!0)}}const m5={name:"flip",enabled:!0,phase:"main",fn:p5,requiresIfExists:["offset"],data:{_skip:!1}};function Pb(t,e,r){return r===void 0&&(r={x:0,y:0}),{top:t.top-e.height-r.y,right:t.right-e.width+r.x,bottom:t.bottom-e.height+r.y,left:t.left-e.width-r.x}}function Lb(t){return[Xt,vr,yr,Jt].some(function(e){return t[e]>=0})}function g5(t){var e=t.state,r=t.name,n=e.rects.reference,i=e.rects.popper,o=e.modifiersData.preventOverflow,s=Ba(e,{elementContext:"reference"}),a=Ba(e,{altBoundary:!0}),l=Pb(s,n),c=Pb(a,i,o),u=Lb(l),f=Lb(c);e.modifiersData[r]={referenceClippingOffsets:l,popperEscapeOffsets:c,isReferenceHidden:u,hasPopperEscaped:f},e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-reference-hidden":u,"data-popper-escaped":f})}const y5={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:g5};function v5(t,e,r){var n=Gr(t),i=[Jt,Xt].indexOf(n)>=0?-1:1,o=typeof r=="function"?r(Object.assign({},e,{placement:t})):r,s=o[0],a=o[1];return s=s||0,a=(a||0)*i,[Jt,vr].indexOf(n)>=0?{x:a,y:s}:{x:s,y:a}}function w5(t){var e=t.state,r=t.options,n=t.name,i=r.offset,o=i===void 0?[0,0]:i,s=PA.reduce(function(u,f){return u[f]=v5(f,e.rects,o),u},{}),a=s[e.placement],l=a.x,c=a.y;e.modifiersData.popperOffsets!=null&&(e.modifiersData.popperOffsets.x+=l,e.modifiersData.popperOffsets.y+=c),e.modifiersData[n]=s}const b5={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:w5};function x5(t){var e=t.state,r=t.name;e.modifiersData[r]=UA({reference:e.rects.reference,element:e.rects.popper,strategy:"absolute",placement:e.placement})}const S5={name:"popperOffsets",enabled:!0,phase:"read",fn:x5,data:{}};function E5(t){return t==="x"?"y":"x"}function T5(t){var e=t.state,r=t.options,n=t.name,i=r.mainAxis,o=i===void 0?!0:i,s=r.altAxis,a=s===void 0?!1:s,l=r.boundary,c=r.rootBoundary,u=r.altBoundary,f=r.padding,d=r.tether,h=d===void 0?!0:d,p=r.tetherOffset,m=p===void 0?0:p,y=Ba(e,{boundary:l,rootBoundary:c,padding:f,altBoundary:u}),g=Gr(e.placement),b=ds(e.placement),S=!b,x=Cy(g),O=E5(x),M=e.modifiersData.popperOffsets,D=e.rects.reference,$=e.rects.popper,A=typeof m=="function"?m(Object.assign({},e.rects,{placement:e.placement})):m,V=typeof A=="number"?{mainAxis:A,altAxis:A}:Object.assign({mainAxis:0,altAxis:0},A),Q=e.modifiersData.offset?e.modifiersData.offset[e.placement]:null,I={x:0,y:0};if(M){if(o){var U,k=x==="y"?Xt:Jt,G=x==="y"?yr:vr,te=x==="y"?"height":"width",W=M[x],ae=W+y[k],X=W-y[G],de=h?-$[te]/2:0,q=b===cs?D[te]:$[te],N=b===cs?-$[te]:-D[te],Y=e.elements.arrow,Z=h&&Y?Ay(Y):{width:0,height:0},ie=e.modifiersData["arrow#persistent"]?e.modifiersData["arrow#persistent"].padding:$A(),K=ie[k],_=ie[G],C=ma(0,D[te],Z[te]),z=S?D[te]/2-de-C-K-V.mainAxis:q-C-K-V.mainAxis,j=S?-D[te]/2+de+C+_+V.mainAxis:N+C+_+V.mainAxis,P=e.elements.arrow&&hl(e.elements.arrow),F=P?x==="y"?P.clientTop||0:P.clientLeft||0:0,ne=(U=Q==null?void 0:Q[x])!=null?U:0,T=W+z-ne-F,re=W+j-ne,R=ma(h?ou(ae,T):ae,W,h?Ki(X,re):X);M[x]=R,I[x]=R-W}if(a){var v,w=x==="x"?Xt:Jt,E=x==="x"?yr:vr,B=M[O],J=O==="y"?"height":"width",H=B+y[w],ce=B-y[E],me=[Xt,Jt].indexOf(g)!==-1,fe=(v=Q==null?void 0:Q[O])!=null?v:0,ve=me?H:B-D[J]-$[J]-fe+V.altAxis,Te=me?B+D[J]+$[J]-fe-V.altAxis:ce,Oe=h&&me?qB(ve,B,Te):ma(h?ve:H,B,h?Te:ce);M[O]=Oe,I[O]=Oe-B}e.modifiersData[n]=I}}const A5={name:"preventOverflow",enabled:!0,phase:"main",fn:T5,requiresIfExists:["offset"]};function C5(t){return{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}}function k5(t){return t===or(t)||!mr(t)?ky(t):C5(t)}function _5(t){var e=t.getBoundingClientRect(),r=us(e.width)/t.offsetWidth||1,n=us(e.height)/t.offsetHeight||1;return r!==1||n!==1}function O5(t,e,r){r===void 0&&(r=!1);var n=mr(e),i=mr(e)&&_5(e),o=Ai(e),s=fs(t,i,r),a={scrollLeft:0,scrollTop:0},l={x:0,y:0};return(n||!n&&!r)&&((Yr(e)!=="body"||Oy(o))&&(a=k5(e)),mr(e)?(l=fs(e,!0),l.x+=e.clientLeft,l.y+=e.clientTop):o&&(l.x=_y(o))),{x:s.left+a.scrollLeft-l.x,y:s.top+a.scrollTop-l.y,width:s.width,height:s.height}}function R5(t){var e=new Map,r=new Set,n=[];t.forEach(function(o){e.set(o.name,o)});function i(o){r.add(o.name);var s=[].concat(o.requires||[],o.requiresIfExists||[]);s.forEach(function(a){if(!r.has(a)){var l=e.get(a);l&&i(l)}}),n.push(o)}return t.forEach(function(o){r.has(o.name)||i(o)}),n}function M5(t){var e=R5(t);return UB.reduce(function(r,n){return r.concat(e.filter(function(i){return i.phase===n}))},[])}function I5(t){var e;return function(){return e||(e=new Promise(function(r){Promise.resolve().then(function(){e=void 0,r(t())})})),e}}function N5(t){var e=t.reduce(function(r,n){var i=r[n.name];return r[n.name]=i?Object.assign({},i,n,{options:Object.assign({},i.options,n.options),data:Object.assign({},i.data,n.data)}):n,r},{});return Object.keys(e).map(function(r){return e[r]})}var Fb={placement:"bottom",modifiers:[],strategy:"absolute"};function Bb(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];return!e.some(function(n){return!(n&&typeof n.getBoundingClientRect=="function")})}function D5(t){t===void 0&&(t={});var e=t,r=e.defaultModifiers,n=r===void 0?[]:r,i=e.defaultOptions,o=i===void 0?Fb:i;return function(a,l,c){c===void 0&&(c=o);var u={placement:"bottom",orderedModifiers:[],options:Object.assign({},Fb,o),modifiersData:{},elements:{reference:a,popper:l},attributes:{},styles:{}},f=[],d=!1,h={state:u,setOptions:function(g){var b=typeof g=="function"?g(u.options):g;m(),u.options=Object.assign({},o,u.options,b),u.scrollParents={reference:no(a)?ga(a):a.contextElement?ga(a.contextElement):[],popper:ga(l)};var S=M5(N5([].concat(n,u.options.modifiers)));return u.orderedModifiers=S.filter(function(x){return x.enabled}),p(),h.update()},forceUpdate:function(){if(!d){var g=u.elements,b=g.reference,S=g.popper;if(Bb(b,S)){u.rects={reference:O5(b,hl(S),u.options.strategy==="fixed"),popper:Ay(S)},u.reset=!1,u.placement=u.options.placement,u.orderedModifiers.forEach(function(V){return u.modifiersData[V.name]=Object.assign({},V.data)});for(var x=0;x<u.orderedModifiers.length;x++){if(u.reset===!0){u.reset=!1,x=-1;continue}var O=u.orderedModifiers[x],M=O.fn,D=O.options,$=D===void 0?{}:D,A=O.name;typeof M=="function"&&(u=M({state:u,options:$,name:A,instance:h})||u)}}}},update:I5(function(){return new Promise(function(y){h.forceUpdate(),y(u)})}),destroy:function(){m(),d=!0}};if(!Bb(a,l))return h;h.setOptions(c).then(function(y){!d&&c.onFirstUpdate&&c.onFirstUpdate(y)});function p(){u.orderedModifiers.forEach(function(y){var g=y.name,b=y.options,S=b===void 0?{}:b,x=y.effect;if(typeof x=="function"){var O=x({state:u,name:g,instance:h,options:S}),M=function(){};f.push(O||M)}})}function m(){f.forEach(function(y){return y()}),f=[]}return h}}var P5=[i5,S5,r5,LA,b5,m5,A5,ZB,y5],L5=D5({defaultModifiers:P5}),F5="tippy-box",WA="tippy-content",B5="tippy-backdrop",VA="tippy-arrow",GA="tippy-svg-arrow",Pi={passive:!0,capture:!0},KA=function(){return document.body};function $5(t,e){return{}.hasOwnProperty.call(t,e)}function Vd(t,e,r){if(Array.isArray(t)){var n=t[e];return n??(Array.isArray(r)?r[e]:r)}return t}function Ry(t,e){var r={}.toString.call(t);return r.indexOf("[object")===0&&r.indexOf(e+"]")>-1}function qA(t,e){return typeof t=="function"?t.apply(void 0,e):t}function $b(t,e){if(e===0)return t;var r;return function(n){clearTimeout(r),r=setTimeout(function(){t(n)},e)}}function j5(t,e){var r=Object.assign({},t);return e.forEach(function(n){delete r[n]}),r}function H5(t){return t.split(/\s+/).filter(Boolean)}function Fo(t){return[].concat(t)}function jb(t,e){t.indexOf(e)===-1&&t.push(e)}function z5(t){return t.filter(function(e,r){return t.indexOf(e)===r})}function U5(t){return t.split("-")[0]}function su(t){return[].slice.call(t)}function Hb(t){return Object.keys(t).reduce(function(e,r){return t[r]!==void 0&&(e[r]=t[r]),e},{})}function ya(){return document.createElement("div")}function $a(t){return["Element","Fragment"].some(function(e){return Ry(t,e)})}function W5(t){return Ry(t,"NodeList")}function V5(t){return Ry(t,"MouseEvent")}function G5(t){return!!(t&&t._tippy&&t._tippy.reference===t)}function K5(t){return $a(t)?[t]:W5(t)?su(t):Array.isArray(t)?t:su(document.querySelectorAll(t))}function Gd(t,e){t.forEach(function(r){r&&(r.style.transitionDuration=e+"ms")})}function zb(t,e){t.forEach(function(r){r&&r.setAttribute("data-state",e)})}function q5(t){var e,r=Fo(t),n=r[0];return n!=null&&(e=n.ownerDocument)!=null&&e.body?n.ownerDocument:document}function X5(t,e){var r=e.clientX,n=e.clientY;return t.every(function(i){var o=i.popperRect,s=i.popperState,a=i.props,l=a.interactiveBorder,c=U5(s.placement),u=s.modifiersData.offset;if(!u)return!0;var f=c==="bottom"?u.top.y:0,d=c==="top"?u.bottom.y:0,h=c==="right"?u.left.x:0,p=c==="left"?u.right.x:0,m=o.top-n+f>l,y=n-o.bottom-d>l,g=o.left-r+h>l,b=r-o.right-p>l;return m||y||g||b})}function Kd(t,e,r){var n=e+"EventListener";["transitionend","webkitTransitionEnd"].forEach(function(i){t[n](i,r)})}function Ub(t,e){for(var r=e;r;){var n;if(t.contains(r))return!0;r=r.getRootNode==null||(n=r.getRootNode())==null?void 0:n.host}return!1}var Br={isTouch:!1},Wb=0;function J5(){Br.isTouch||(Br.isTouch=!0,window.performance&&document.addEventListener("mousemove",XA))}function XA(){var t=performance.now();t-Wb<20&&(Br.isTouch=!1,document.removeEventListener("mousemove",XA)),Wb=t}function Y5(){var t=document.activeElement;if(G5(t)){var e=t._tippy;t.blur&&!e.state.isVisible&&t.blur()}}function Z5(){document.addEventListener("touchstart",J5,Pi),window.addEventListener("blur",Y5)}var Q5=typeof window<"u"&&typeof document<"u",e6=Q5?!!window.msCrypto:!1;function Ao(t){var e=t==="destroy"?"n already-":" ";return[t+"() was called on a"+e+"destroyed instance. This is a no-op but","indicates a potential memory leak."].join(" ")}function Vb(t){var e=/[ \t]{2,}/g,r=/^[ \t]*/gm;return t.replace(e," ").replace(r,"").trim()}function t6(t){return Vb(`
90
- %ctippy.js
91
-
92
- %c`+Vb(t)+`
93
-
94
- %c👷‍ This is a development-only message. It will be removed in production.
95
- `)}function JA(t){return[t6(t),"color: #00C584; font-size: 1.3em; font-weight: bold;","line-height: 1.5","color: #a6a095;"]}var ja;process.env.NODE_ENV!=="production"&&r6();function r6(){ja=new Set}function gn(t,e){if(t&&!ja.has(e)){var r;ja.add(e),(r=console).warn.apply(r,JA(e))}}function Sm(t,e){if(t&&!ja.has(e)){var r;ja.add(e),(r=console).error.apply(r,JA(e))}}function n6(t){var e=!t,r=Object.prototype.toString.call(t)==="[object Object]"&&!t.addEventListener;Sm(e,["tippy() was passed","`"+String(t)+"`","as its targets (first) argument. Valid types are: String, Element,","Element[], or NodeList."].join(" ")),Sm(r,["tippy() was passed a plain object which is not supported as an argument","for virtual positioning. Use props.getReferenceClientRect instead."].join(" "))}var YA={animateFill:!1,followCursor:!1,inlinePositioning:!1,sticky:!1},i6={allowHTML:!1,animation:"fade",arrow:!0,content:"",inertia:!1,maxWidth:350,role:"tooltip",theme:"",zIndex:9999},rr=Object.assign({appendTo:KA,aria:{content:"auto",expanded:"auto"},delay:0,duration:[300,250],getReferenceClientRect:null,hideOnClick:!0,ignoreAttributes:!1,interactive:!1,interactiveBorder:2,interactiveDebounce:0,moveTransition:"",offset:[0,10],onAfterUpdate:function(){},onBeforeUpdate:function(){},onCreate:function(){},onDestroy:function(){},onHidden:function(){},onHide:function(){},onMount:function(){},onShow:function(){},onShown:function(){},onTrigger:function(){},onUntrigger:function(){},onClickOutside:function(){},placement:"top",plugins:[],popperOptions:{},render:null,showOnCreate:!1,touch:!0,trigger:"mouseenter focus",triggerTarget:null},YA,i6),o6=Object.keys(rr),s6=function(e){process.env.NODE_ENV!=="production"&&QA(e,[]);var r=Object.keys(e);r.forEach(function(n){rr[n]=e[n]})};function ZA(t){var e=t.plugins||[],r=e.reduce(function(n,i){var o=i.name,s=i.defaultValue;if(o){var a;n[o]=t[o]!==void 0?t[o]:(a=rr[o])!=null?a:s}return n},{});return Object.assign({},t,r)}function a6(t,e){var r=e?Object.keys(ZA(Object.assign({},rr,{plugins:e}))):o6,n=r.reduce(function(i,o){var s=(t.getAttribute("data-tippy-"+o)||"").trim();if(!s)return i;if(o==="content")i[o]=s;else try{i[o]=JSON.parse(s)}catch{i[o]=s}return i},{});return n}function Gb(t,e){var r=Object.assign({},e,{content:qA(e.content,[t])},e.ignoreAttributes?{}:a6(t,e.plugins));return r.aria=Object.assign({},rr.aria,r.aria),r.aria={expanded:r.aria.expanded==="auto"?e.interactive:r.aria.expanded,content:r.aria.content==="auto"?e.interactive?null:"describedby":r.aria.content},r}function QA(t,e){t===void 0&&(t={}),e===void 0&&(e=[]);var r=Object.keys(t);r.forEach(function(n){var i=j5(rr,Object.keys(YA)),o=!$5(i,n);o&&(o=e.filter(function(s){return s.name===n}).length===0),gn(o,["`"+n+"`","is not a valid prop. You may have spelled it incorrectly, or if it's","a plugin, forgot to pass it in an array as props.plugins.",`
96
-
97
- `,`All props: https://atomiks.github.io/tippyjs/v6/all-props/
98
- `,"Plugins: https://atomiks.github.io/tippyjs/v6/plugins/"].join(" "))})}var l6=function(){return"innerHTML"};function Em(t,e){t[l6()]=e}function Kb(t){var e=ya();return t===!0?e.className=VA:(e.className=GA,$a(t)?e.appendChild(t):Em(e,t)),e}function qb(t,e){$a(e.content)?(Em(t,""),t.appendChild(e.content)):typeof e.content!="function"&&(e.allowHTML?Em(t,e.content):t.textContent=e.content)}function Tm(t){var e=t.firstElementChild,r=su(e.children);return{box:e,content:r.find(function(n){return n.classList.contains(WA)}),arrow:r.find(function(n){return n.classList.contains(VA)||n.classList.contains(GA)}),backdrop:r.find(function(n){return n.classList.contains(B5)})}}function eC(t){var e=ya(),r=ya();r.className=F5,r.setAttribute("data-state","hidden"),r.setAttribute("tabindex","-1");var n=ya();n.className=WA,n.setAttribute("data-state","hidden"),qb(n,t.props),e.appendChild(r),r.appendChild(n),i(t.props,t.props);function i(o,s){var a=Tm(e),l=a.box,c=a.content,u=a.arrow;s.theme?l.setAttribute("data-theme",s.theme):l.removeAttribute("data-theme"),typeof s.animation=="string"?l.setAttribute("data-animation",s.animation):l.removeAttribute("data-animation"),s.inertia?l.setAttribute("data-inertia",""):l.removeAttribute("data-inertia"),l.style.maxWidth=typeof s.maxWidth=="number"?s.maxWidth+"px":s.maxWidth,s.role?l.setAttribute("role",s.role):l.removeAttribute("role"),(o.content!==s.content||o.allowHTML!==s.allowHTML)&&qb(c,t.props),s.arrow?u?o.arrow!==s.arrow&&(l.removeChild(u),l.appendChild(Kb(s.arrow))):l.appendChild(Kb(s.arrow)):u&&l.removeChild(u)}return{popper:e,onUpdate:i}}eC.$$tippy=!0;var c6=1,Pl=[],qd=[];function u6(t,e){var r=Gb(t,Object.assign({},rr,ZA(Hb(e)))),n,i,o,s=!1,a=!1,l=!1,c=!1,u,f,d,h=[],p=$b(T,r.interactiveDebounce),m,y=c6++,g=null,b=z5(r.plugins),S={isEnabled:!0,isVisible:!1,isDestroyed:!1,isMounted:!1,isShown:!1},x={id:y,reference:t,popper:ya(),popperInstance:g,props:r,state:S,plugins:b,clearDelayTimeouts:ve,setProps:Te,setContent:Oe,show:xt,hide:Rr,hideWithInteractivity:sr,enable:me,disable:fe,unmount:Ii,destroy:rt};if(!r.render)return process.env.NODE_ENV!=="production"&&Sm(!0,"render() function has not been supplied."),x;var O=r.render(x),M=O.popper,D=O.onUpdate;M.setAttribute("data-tippy-root",""),M.id="tippy-"+x.id,x.popper=M,t._tippy=x,M._tippy=x;var $=b.map(function(ue){return ue.fn(x)}),A=t.hasAttribute("aria-expanded");return P(),de(),W(),ae("onCreate",[x]),r.showOnCreate&&H(),M.addEventListener("mouseenter",function(){x.props.interactive&&x.state.isVisible&&x.clearDelayTimeouts()}),M.addEventListener("mouseleave",function(){x.props.interactive&&x.props.trigger.indexOf("mouseenter")>=0&&k().addEventListener("mousemove",p)}),x;function V(){var ue=x.props.touch;return Array.isArray(ue)?ue:[ue,0]}function Q(){return V()[0]==="hold"}function I(){var ue;return!!((ue=x.props.render)!=null&&ue.$$tippy)}function U(){return m||t}function k(){var ue=U().parentNode;return ue?q5(ue):document}function G(){return Tm(M)}function te(ue){return x.state.isMounted&&!x.state.isVisible||Br.isTouch||u&&u.type==="focus"?0:Vd(x.props.delay,ue?0:1,rr.delay)}function W(ue){ue===void 0&&(ue=!1),M.style.pointerEvents=x.props.interactive&&!ue?"":"none",M.style.zIndex=""+x.props.zIndex}function ae(ue,Se,Ce){if(Ce===void 0&&(Ce=!0),$.forEach(function(Fe){Fe[ue]&&Fe[ue].apply(Fe,Se)}),Ce){var He;(He=x.props)[ue].apply(He,Se)}}function X(){var ue=x.props.aria;if(ue.content){var Se="aria-"+ue.content,Ce=M.id,He=Fo(x.props.triggerTarget||t);He.forEach(function(Fe){var St=Fe.getAttribute(Se);if(x.state.isVisible)Fe.setAttribute(Se,St?St+" "+Ce:Ce);else{var Wt=St&&St.replace(Ce,"").trim();Wt?Fe.setAttribute(Se,Wt):Fe.removeAttribute(Se)}})}}function de(){if(!(A||!x.props.aria.expanded)){var ue=Fo(x.props.triggerTarget||t);ue.forEach(function(Se){x.props.interactive?Se.setAttribute("aria-expanded",x.state.isVisible&&Se===U()?"true":"false"):Se.removeAttribute("aria-expanded")})}}function q(){k().removeEventListener("mousemove",p),Pl=Pl.filter(function(ue){return ue!==p})}function N(ue){if(!(Br.isTouch&&(l||ue.type==="mousedown"))){var Se=ue.composedPath&&ue.composedPath()[0]||ue.target;if(!(x.props.interactive&&Ub(M,Se))){if(Fo(x.props.triggerTarget||t).some(function(Ce){return Ub(Ce,Se)})){if(Br.isTouch||x.state.isVisible&&x.props.trigger.indexOf("click")>=0)return}else ae("onClickOutside",[x,ue]);x.props.hideOnClick===!0&&(x.clearDelayTimeouts(),x.hide(),a=!0,setTimeout(function(){a=!1}),x.state.isMounted||K())}}}function Y(){l=!0}function Z(){l=!1}function ie(){var ue=k();ue.addEventListener("mousedown",N,!0),ue.addEventListener("touchend",N,Pi),ue.addEventListener("touchstart",Z,Pi),ue.addEventListener("touchmove",Y,Pi)}function K(){var ue=k();ue.removeEventListener("mousedown",N,!0),ue.removeEventListener("touchend",N,Pi),ue.removeEventListener("touchstart",Z,Pi),ue.removeEventListener("touchmove",Y,Pi)}function _(ue,Se){z(ue,function(){!x.state.isVisible&&M.parentNode&&M.parentNode.contains(M)&&Se()})}function C(ue,Se){z(ue,Se)}function z(ue,Se){var Ce=G().box;function He(Fe){Fe.target===Ce&&(Kd(Ce,"remove",He),Se())}if(ue===0)return Se();Kd(Ce,"remove",f),Kd(Ce,"add",He),f=He}function j(ue,Se,Ce){Ce===void 0&&(Ce=!1);var He=Fo(x.props.triggerTarget||t);He.forEach(function(Fe){Fe.addEventListener(ue,Se,Ce),h.push({node:Fe,eventType:ue,handler:Se,options:Ce})})}function P(){Q()&&(j("touchstart",ne,{passive:!0}),j("touchend",re,{passive:!0})),H5(x.props.trigger).forEach(function(ue){if(ue!=="manual")switch(j(ue,ne),ue){case"mouseenter":j("mouseleave",re);break;case"focus":j(e6?"focusout":"blur",R);break;case"focusin":j("focusout",R);break}})}function F(){h.forEach(function(ue){var Se=ue.node,Ce=ue.eventType,He=ue.handler,Fe=ue.options;Se.removeEventListener(Ce,He,Fe)}),h=[]}function ne(ue){var Se,Ce=!1;if(!(!x.state.isEnabled||v(ue)||a)){var He=((Se=u)==null?void 0:Se.type)==="focus";u=ue,m=ue.currentTarget,de(),!x.state.isVisible&&V5(ue)&&Pl.forEach(function(Fe){return Fe(ue)}),ue.type==="click"&&(x.props.trigger.indexOf("mouseenter")<0||s)&&x.props.hideOnClick!==!1&&x.state.isVisible?Ce=!0:H(ue),ue.type==="click"&&(s=!Ce),Ce&&!He&&ce(ue)}}function T(ue){var Se=ue.target,Ce=U().contains(Se)||M.contains(Se);if(!(ue.type==="mousemove"&&Ce)){var He=J().concat(M).map(function(Fe){var St,Wt=Fe._tippy,ln=(St=Wt.popperInstance)==null?void 0:St.state;return ln?{popperRect:Fe.getBoundingClientRect(),popperState:ln,props:r}:null}).filter(Boolean);X5(He,ue)&&(q(),ce(ue))}}function re(ue){var Se=v(ue)||x.props.trigger.indexOf("click")>=0&&s;if(!Se){if(x.props.interactive){x.hideWithInteractivity(ue);return}ce(ue)}}function R(ue){x.props.trigger.indexOf("focusin")<0&&ue.target!==U()||x.props.interactive&&ue.relatedTarget&&M.contains(ue.relatedTarget)||ce(ue)}function v(ue){return Br.isTouch?Q()!==ue.type.indexOf("touch")>=0:!1}function w(){E();var ue=x.props,Se=ue.popperOptions,Ce=ue.placement,He=ue.offset,Fe=ue.getReferenceClientRect,St=ue.moveTransition,Wt=I()?Tm(M).arrow:null,ln=Fe?{getBoundingClientRect:Fe,contextElement:Fe.contextElement||U()}:t,Fn={name:"$$tippy",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:function(Al){var So=Al.state;if(I()){var jI=G(),Cd=jI.box;["placement","reference-hidden","escaped"].forEach(function(Cl){Cl==="placement"?Cd.setAttribute("data-placement",So.placement):So.attributes.popper["data-popper-"+Cl]?Cd.setAttribute("data-"+Cl,""):Cd.removeAttribute("data-"+Cl)}),So.attributes.popper={}}}},ar=[{name:"offset",options:{offset:He}},{name:"preventOverflow",options:{padding:{top:2,bottom:2,left:5,right:5}}},{name:"flip",options:{padding:5}},{name:"computeStyles",options:{adaptive:!St}},Fn];I()&&Wt&&ar.push({name:"arrow",options:{element:Wt,padding:3}}),ar.push.apply(ar,(Se==null?void 0:Se.modifiers)||[]),x.popperInstance=L5(ln,M,Object.assign({},Se,{placement:Ce,onFirstUpdate:d,modifiers:ar}))}function E(){x.popperInstance&&(x.popperInstance.destroy(),x.popperInstance=null)}function B(){var ue=x.props.appendTo,Se,Ce=U();x.props.interactive&&ue===KA||ue==="parent"?Se=Ce.parentNode:Se=qA(ue,[Ce]),Se.contains(M)||Se.appendChild(M),x.state.isMounted=!0,w(),process.env.NODE_ENV!=="production"&&gn(x.props.interactive&&ue===rr.appendTo&&Ce.nextElementSibling!==M,["Interactive tippy element may not be accessible via keyboard","navigation because it is not directly after the reference element","in the DOM source order.",`
99
-
100
- `,"Using a wrapper <div> or <span> tag around the reference element","solves this by creating a new parentNode context.",`
101
-
102
- `,"Specifying `appendTo: document.body` silences this warning, but it","assumes you are using a focus management solution to handle","keyboard navigation.",`
103
-
104
- `,"See: https://atomiks.github.io/tippyjs/v6/accessibility/#interactivity"].join(" "))}function J(){return su(M.querySelectorAll("[data-tippy-root]"))}function H(ue){x.clearDelayTimeouts(),ue&&ae("onTrigger",[x,ue]),ie();var Se=te(!0),Ce=V(),He=Ce[0],Fe=Ce[1];Br.isTouch&&He==="hold"&&Fe&&(Se=Fe),Se?n=setTimeout(function(){x.show()},Se):x.show()}function ce(ue){if(x.clearDelayTimeouts(),ae("onUntrigger",[x,ue]),!x.state.isVisible){K();return}if(!(x.props.trigger.indexOf("mouseenter")>=0&&x.props.trigger.indexOf("click")>=0&&["mouseleave","mousemove"].indexOf(ue.type)>=0&&s)){var Se=te(!1);Se?i=setTimeout(function(){x.state.isVisible&&x.hide()},Se):o=requestAnimationFrame(function(){x.hide()})}}function me(){x.state.isEnabled=!0}function fe(){x.hide(),x.state.isEnabled=!1}function ve(){clearTimeout(n),clearTimeout(i),cancelAnimationFrame(o)}function Te(ue){if(process.env.NODE_ENV!=="production"&&gn(x.state.isDestroyed,Ao("setProps")),!x.state.isDestroyed){ae("onBeforeUpdate",[x,ue]),F();var Se=x.props,Ce=Gb(t,Object.assign({},Se,Hb(ue),{ignoreAttributes:!0}));x.props=Ce,P(),Se.interactiveDebounce!==Ce.interactiveDebounce&&(q(),p=$b(T,Ce.interactiveDebounce)),Se.triggerTarget&&!Ce.triggerTarget?Fo(Se.triggerTarget).forEach(function(He){He.removeAttribute("aria-expanded")}):Ce.triggerTarget&&t.removeAttribute("aria-expanded"),de(),W(),D&&D(Se,Ce),x.popperInstance&&(w(),J().forEach(function(He){requestAnimationFrame(He._tippy.popperInstance.forceUpdate)})),ae("onAfterUpdate",[x,ue])}}function Oe(ue){x.setProps({content:ue})}function xt(){process.env.NODE_ENV!=="production"&&gn(x.state.isDestroyed,Ao("show"));var ue=x.state.isVisible,Se=x.state.isDestroyed,Ce=!x.state.isEnabled,He=Br.isTouch&&!x.props.touch,Fe=Vd(x.props.duration,0,rr.duration);if(!(ue||Se||Ce||He)&&!U().hasAttribute("disabled")&&(ae("onShow",[x],!1),x.props.onShow(x)!==!1)){if(x.state.isVisible=!0,I()&&(M.style.visibility="visible"),W(),ie(),x.state.isMounted||(M.style.transition="none"),I()){var St=G(),Wt=St.box,ln=St.content;Gd([Wt,ln],0)}d=function(){var ar;if(!(!x.state.isVisible||c)){if(c=!0,M.offsetHeight,M.style.transition=x.props.moveTransition,I()&&x.props.animation){var Ad=G(),Al=Ad.box,So=Ad.content;Gd([Al,So],Fe),zb([Al,So],"visible")}X(),de(),jb(qd,x),(ar=x.popperInstance)==null||ar.forceUpdate(),ae("onMount",[x]),x.props.animation&&I()&&C(Fe,function(){x.state.isShown=!0,ae("onShown",[x])})}},B()}}function Rr(){process.env.NODE_ENV!=="production"&&gn(x.state.isDestroyed,Ao("hide"));var ue=!x.state.isVisible,Se=x.state.isDestroyed,Ce=!x.state.isEnabled,He=Vd(x.props.duration,1,rr.duration);if(!(ue||Se||Ce)&&(ae("onHide",[x],!1),x.props.onHide(x)!==!1)){if(x.state.isVisible=!1,x.state.isShown=!1,c=!1,s=!1,I()&&(M.style.visibility="hidden"),q(),K(),W(!0),I()){var Fe=G(),St=Fe.box,Wt=Fe.content;x.props.animation&&(Gd([St,Wt],He),zb([St,Wt],"hidden"))}X(),de(),x.props.animation?I()&&_(He,x.unmount):x.unmount()}}function sr(ue){process.env.NODE_ENV!=="production"&&gn(x.state.isDestroyed,Ao("hideWithInteractivity")),k().addEventListener("mousemove",p),jb(Pl,p),p(ue)}function Ii(){process.env.NODE_ENV!=="production"&&gn(x.state.isDestroyed,Ao("unmount")),x.state.isVisible&&x.hide(),x.state.isMounted&&(E(),J().forEach(function(ue){ue._tippy.unmount()}),M.parentNode&&M.parentNode.removeChild(M),qd=qd.filter(function(ue){return ue!==x}),x.state.isMounted=!1,ae("onHidden",[x]))}function rt(){process.env.NODE_ENV!=="production"&&gn(x.state.isDestroyed,Ao("destroy")),!x.state.isDestroyed&&(x.clearDelayTimeouts(),x.unmount(),F(),delete t._tippy,x.state.isDestroyed=!0,ae("onDestroy",[x]))}}function fo(t,e){e===void 0&&(e={});var r=rr.plugins.concat(e.plugins||[]);process.env.NODE_ENV!=="production"&&(n6(t),QA(e,r)),Z5();var n=Object.assign({},e,{plugins:r}),i=K5(t);if(process.env.NODE_ENV!=="production"){var o=$a(n.content),s=i.length>1;gn(o&&s,["tippy() was passed an Element as the `content` prop, but more than","one tippy instance was created by this invocation. This means the","content element will only be appended to the last tippy instance.",`
105
-
106
- `,"Instead, pass the .innerHTML of the element, or use a function that","returns a cloned version of the element instead.",`
107
-
108
- `,`1) content: element.innerHTML
109
- `,"2) content: () => element.cloneNode(true)"].join(" "))}var a=i.reduce(function(l,c){var u=c&&u6(c,n);return u&&l.push(u),l},[]);return $a(t)?a[0]:a}fo.defaultProps=rr;fo.setDefaultProps=s6;fo.currentInput=Br;Object.assign({},LA,{effect:function(e){var r=e.state,n={popper:{position:r.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};Object.assign(r.elements.popper.style,n.popper),r.styles=n,r.elements.arrow&&Object.assign(r.elements.arrow.style,n.arrow)}});var f6={name:"sticky",defaultValue:!1,fn:function(e){var r=e.reference,n=e.popper;function i(){return e.popperInstance?e.popperInstance.state.elements.reference:r}function o(c){return e.props.sticky===!0||e.props.sticky===c}var s=null,a=null;function l(){var c=o("reference")?i().getBoundingClientRect():null,u=o("popper")?n.getBoundingClientRect():null;(c&&Xb(s,c)||u&&Xb(a,u))&&e.popperInstance&&e.popperInstance.update(),s=c,a=u,e.state.isMounted&&requestAnimationFrame(l)}return{onMount:function(){e.props.sticky&&l()}}}};function Xb(t,e){return t&&e?t.top!==e.top||t.right!==e.right||t.bottom!==e.bottom||t.left!==e.left:!0}fo.setDefaultProps({render:eC});class d6{constructor({editor:e,element:r,view:n,tippyOptions:i={},updateDelay:o=250,shouldShow:s}){this.preventHide=!1,this.shouldShow=({view:a,state:l,from:c,to:u})=>{const{doc:f,selection:d}=l,{empty:h}=d,p=!f.textBetween(c,u).length&&vy(l.selection),m=this.element.contains(document.activeElement);return!(!(a.hasFocus()||m)||h||p||!this.editor.isEditable)},this.mousedownHandler=()=>{this.preventHide=!0},this.dragstartHandler=()=>{this.hide()},this.focusHandler=()=>{setTimeout(()=>this.update(this.editor.view))},this.blurHandler=({event:a})=>{var l;if(this.preventHide){this.preventHide=!1;return}a!=null&&a.relatedTarget&&(!((l=this.element.parentNode)===null||l===void 0)&&l.contains(a.relatedTarget))||this.hide()},this.tippyBlurHandler=a=>{this.blurHandler({event:a})},this.handleDebouncedUpdate=(a,l)=>{const c=!(l!=null&&l.selection.eq(a.state.selection)),u=!(l!=null&&l.doc.eq(a.state.doc));!c&&!u||(this.updateDebounceTimer&&clearTimeout(this.updateDebounceTimer),this.updateDebounceTimer=window.setTimeout(()=>{this.updateHandler(a,c,u,l)},this.updateDelay))},this.updateHandler=(a,l,c,u)=>{var f,d,h;const{state:p,composing:m}=a,{selection:y}=p;if(m||!l&&!c)return;this.createTooltip();const{ranges:b}=y,S=Math.min(...b.map(M=>M.$from.pos)),x=Math.max(...b.map(M=>M.$to.pos));if(!((f=this.shouldShow)===null||f===void 0?void 0:f.call(this,{editor:this.editor,view:a,state:p,oldState:u,from:S,to:x}))){this.hide();return}(d=this.tippy)===null||d===void 0||d.setProps({getReferenceClientRect:((h=this.tippyOptions)===null||h===void 0?void 0:h.getReferenceClientRect)||(()=>{if(CA(p.selection)){let M=a.nodeDOM(S);const D=M.dataset.nodeViewWrapper?M:M.querySelector("[data-node-view-wrapper]");if(D&&(M=D.firstChild),M)return M.getBoundingClientRect()}return dF(a,S,x)})}),this.show()},this.editor=e,this.element=r,this.view=n,this.updateDelay=o,s&&(this.shouldShow=s),this.element.addEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.view.dom.addEventListener("dragstart",this.dragstartHandler),this.editor.on("focus",this.focusHandler),this.editor.on("blur",this.blurHandler),this.tippyOptions=i,this.element.remove(),this.element.style.visibility="visible"}createTooltip(){const{element:e}=this.editor.options,r=!!e.parentElement;this.tippy||!r||(this.tippy=fo(e,{duration:0,getReferenceClientRect:null,content:this.element,interactive:!0,trigger:"manual",placement:"top",hideOnClick:"toggle",...this.tippyOptions}),this.tippy.popper.firstChild&&this.tippy.popper.firstChild.addEventListener("blur",this.tippyBlurHandler))}update(e,r){const{state:n}=e,i=n.selection.from!==n.selection.to;if(this.updateDelay>0&&i){this.handleDebouncedUpdate(e,r);return}const o=!(r!=null&&r.selection.eq(e.state.selection)),s=!(r!=null&&r.doc.eq(e.state.doc));this.updateHandler(e,o,s,r)}show(){var e;(e=this.tippy)===null||e===void 0||e.show()}hide(){var e;(e=this.tippy)===null||e===void 0||e.hide()}destroy(){var e,r;!((e=this.tippy)===null||e===void 0)&&e.popper.firstChild&&this.tippy.popper.firstChild.removeEventListener("blur",this.tippyBlurHandler),(r=this.tippy)===null||r===void 0||r.destroy(),this.element.removeEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.view.dom.removeEventListener("dragstart",this.dragstartHandler),this.editor.off("focus",this.focusHandler),this.editor.off("blur",this.blurHandler)}}const tC=t=>new tt({key:typeof t.pluginKey=="string"?new et(t.pluginKey):t.pluginKey,view:e=>new d6({view:e,...t})});dt.create({name:"bubbleMenu",addOptions(){return{element:null,tippyOptions:{},pluginKey:"bubbleMenu",updateDelay:void 0,shouldShow:null}},addProseMirrorPlugins(){return this.options.element?[tC({pluginKey:this.options.pluginKey,editor:this.editor,element:this.options.element,tippyOptions:this.options.tippyOptions,updateDelay:this.options.updateDelay,shouldShow:this.options.shouldShow})]:[]}});var Am={exports:{}},Xd={};/**
110
- * @license React
111
- * use-sync-external-store-shim.production.min.js
112
- *
113
- * Copyright (c) Facebook, Inc. and its affiliates.
114
- *
115
- * This source code is licensed under the MIT license found in the
116
- * LICENSE file in the root directory of this source tree.
117
- */var Jb;function h6(){if(Jb)return Xd;Jb=1;var t=pe;function e(f,d){return f===d&&(f!==0||1/f===1/d)||f!==f&&d!==d}var r=typeof Object.is=="function"?Object.is:e,n=t.useState,i=t.useEffect,o=t.useLayoutEffect,s=t.useDebugValue;function a(f,d){var h=d(),p=n({inst:{value:h,getSnapshot:d}}),m=p[0].inst,y=p[1];return o(function(){m.value=h,m.getSnapshot=d,l(m)&&y({inst:m})},[f,h,d]),i(function(){return l(m)&&y({inst:m}),f(function(){l(m)&&y({inst:m})})},[f]),s(h),h}function l(f){var d=f.getSnapshot;f=f.value;try{var h=d();return!r(f,h)}catch{return!0}}function c(f,d){return d()}var u=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?c:a;return Xd.useSyncExternalStore=t.useSyncExternalStore!==void 0?t.useSyncExternalStore:u,Xd}var Jd={};/**
118
- * @license React
119
- * use-sync-external-store-shim.development.js
120
- *
121
- * Copyright (c) Facebook, Inc. and its affiliates.
122
- *
123
- * This source code is licensed under the MIT license found in the
124
- * LICENSE file in the root directory of this source tree.
125
- */var Yb;function p6(){return Yb||(Yb=1,process.env.NODE_ENV!=="production"&&function(){typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error);var t=pe,e=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function r(S){{for(var x=arguments.length,O=new Array(x>1?x-1:0),M=1;M<x;M++)O[M-1]=arguments[M];n("error",S,O)}}function n(S,x,O){{var M=e.ReactDebugCurrentFrame,D=M.getStackAddendum();D!==""&&(x+="%s",O=O.concat([D]));var $=O.map(function(A){return String(A)});$.unshift("Warning: "+x),Function.prototype.apply.call(console[S],console,$)}}function i(S,x){return S===x&&(S!==0||1/S===1/x)||S!==S&&x!==x}var o=typeof Object.is=="function"?Object.is:i,s=t.useState,a=t.useEffect,l=t.useLayoutEffect,c=t.useDebugValue,u=!1,f=!1;function d(S,x,O){u||t.startTransition!==void 0&&(u=!0,r("You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim will not work correctly. Upgrade to a newer pre-release."));var M=x();if(!f){var D=x();o(M,D)||(r("The result of getSnapshot should be cached to avoid an infinite loop"),f=!0)}var $=s({inst:{value:M,getSnapshot:x}}),A=$[0].inst,V=$[1];return l(function(){A.value=M,A.getSnapshot=x,h(A)&&V({inst:A})},[S,M,x]),a(function(){h(A)&&V({inst:A});var Q=function(){h(A)&&V({inst:A})};return S(Q)},[S]),c(M),M}function h(S){var x=S.getSnapshot,O=S.value;try{var M=x();return!o(O,M)}catch{return!0}}function p(S,x,O){return x()}var m=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",y=!m,g=y?p:d,b=t.useSyncExternalStore!==void 0?t.useSyncExternalStore:g;Jd.useSyncExternalStore=b,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error)}()),Jd}process.env.NODE_ENV==="production"?Am.exports=h6():Am.exports=p6();var Bf=Am.exports;const m6=(...t)=>e=>{t.forEach(r=>{typeof r=="function"?r(e):r&&(r.current=e)})},g6=({contentComponent:t})=>{const e=Bf.useSyncExternalStore(t.subscribe,t.getSnapshot,t.getServerSnapshot);return pe.createElement(pe.Fragment,null,Object.values(e))};function y6(){const t=new Set;let e={};return{subscribe(r){return t.add(r),()=>{t.delete(r)}},getSnapshot(){return e},getServerSnapshot(){return e},setRenderer(r,n){e={...e,[r]:vf.createPortal(n.reactElement,n.element,r)},t.forEach(i=>i())},removeRenderer(r){const n={...e};delete n[r],e=n,t.forEach(i=>i())}}}class v6 extends pe.Component{constructor(e){var r;super(e),this.editorContentRef=pe.createRef(),this.initialized=!1,this.state={hasContentComponentInitialized:!!(!((r=e.editor)===null||r===void 0)&&r.contentComponent)}}componentDidMount(){this.init()}componentDidUpdate(){this.init()}init(){const e=this.props.editor;if(e&&!e.isDestroyed&&e.options.element){if(e.contentComponent)return;const r=this.editorContentRef.current;r.append(...e.options.element.childNodes),e.setOptions({element:r}),e.contentComponent=y6(),this.state.hasContentComponentInitialized||(this.unsubscribeToContentComponent=e.contentComponent.subscribe(()=>{this.setState(n=>n.hasContentComponentInitialized?n:{hasContentComponentInitialized:!0}),this.unsubscribeToContentComponent&&this.unsubscribeToContentComponent()})),e.createNodeViews(),this.initialized=!0}}componentWillUnmount(){const e=this.props.editor;if(!e||(this.initialized=!1,e.isDestroyed||e.view.setProps({nodeViews:{}}),this.unsubscribeToContentComponent&&this.unsubscribeToContentComponent(),e.contentComponent=null,!e.options.element.firstChild))return;const r=document.createElement("div");r.append(...e.options.element.childNodes),e.setOptions({element:r})}render(){const{editor:e,innerRef:r,...n}=this.props;return pe.createElement(pe.Fragment,null,pe.createElement("div",{ref:m6(r,this.editorContentRef),...n}),(e==null?void 0:e.contentComponent)&&pe.createElement(g6,{contentComponent:e.contentComponent}))}}const w6=pe.forwardRef((t,e)=>{const r=pe.useMemo(()=>Math.floor(Math.random()*4294967295).toString(),[t.editor]);return pe.createElement(v6,{key:r,innerRef:e,...t})}),b6=pe.memo(w6);var Cm={exports:{}},Yd={};/**
126
- * @license React
127
- * use-sync-external-store-shim/with-selector.production.min.js
128
- *
129
- * Copyright (c) Facebook, Inc. and its affiliates.
130
- *
131
- * This source code is licensed under the MIT license found in the
132
- * LICENSE file in the root directory of this source tree.
133
- */var Zb;function x6(){if(Zb)return Yd;Zb=1;var t=pe,e=Bf;function r(c,u){return c===u&&(c!==0||1/c===1/u)||c!==c&&u!==u}var n=typeof Object.is=="function"?Object.is:r,i=e.useSyncExternalStore,o=t.useRef,s=t.useEffect,a=t.useMemo,l=t.useDebugValue;return Yd.useSyncExternalStoreWithSelector=function(c,u,f,d,h){var p=o(null);if(p.current===null){var m={hasValue:!1,value:null};p.current=m}else m=p.current;p=a(function(){function g(M){if(!b){if(b=!0,S=M,M=d(M),h!==void 0&&m.hasValue){var D=m.value;if(h(D,M))return x=D}return x=M}if(D=x,n(S,M))return D;var $=d(M);return h!==void 0&&h(D,$)?D:(S=M,x=$)}var b=!1,S,x,O=f===void 0?null:f;return[function(){return g(u())},O===null?void 0:function(){return g(O())}]},[u,f,d,h]);var y=i(c,p[0],p[1]);return s(function(){m.hasValue=!0,m.value=y},[y]),l(y),y},Yd}var Zd={};/**
134
- * @license React
135
- * use-sync-external-store-shim/with-selector.development.js
136
- *
137
- * Copyright (c) Facebook, Inc. and its affiliates.
138
- *
139
- * This source code is licensed under the MIT license found in the
140
- * LICENSE file in the root directory of this source tree.
141
- */var Qb;function S6(){return Qb||(Qb=1,process.env.NODE_ENV!=="production"&&function(){typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error);var t=pe,e=Bf;function r(u,f){return u===f&&(u!==0||1/u===1/f)||u!==u&&f!==f}var n=typeof Object.is=="function"?Object.is:r,i=e.useSyncExternalStore,o=t.useRef,s=t.useEffect,a=t.useMemo,l=t.useDebugValue;function c(u,f,d,h,p){var m=o(null),y;m.current===null?(y={hasValue:!1,value:null},m.current=y):y=m.current;var g=a(function(){var O=!1,M,D,$=function(I){if(!O){O=!0,M=I;var U=h(I);if(p!==void 0&&y.hasValue){var k=y.value;if(p(k,U))return D=k,k}return D=U,U}var G=M,te=D;if(n(G,I))return te;var W=h(I);return p!==void 0&&p(te,W)?te:(M=I,D=W,W)},A=d===void 0?null:d,V=function(){return $(f())},Q=A===null?void 0:function(){return $(A())};return[V,Q]},[f,d,h,p]),b=g[0],S=g[1],x=i(u,b,S);return s(function(){y.hasValue=!0,y.value=x},[x]),l(x),x}Zd.useSyncExternalStoreWithSelector=c,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error)}()),Zd}process.env.NODE_ENV==="production"?Cm.exports=x6():Cm.exports=S6();var E6=Cm.exports;class T6{constructor(e){this.transactionNumber=0,this.lastTransactionNumber=0,this.subscribers=new Set,this.editor=e,this.lastSnapshot={editor:e,transactionNumber:0},this.getSnapshot=this.getSnapshot.bind(this),this.getServerSnapshot=this.getServerSnapshot.bind(this),this.watch=this.watch.bind(this),this.subscribe=this.subscribe.bind(this)}getSnapshot(){return this.transactionNumber===this.lastTransactionNumber?this.lastSnapshot:(this.lastTransactionNumber=this.transactionNumber,this.lastSnapshot={editor:this.editor,transactionNumber:this.transactionNumber},this.lastSnapshot)}getServerSnapshot(){return{editor:null,transactionNumber:0}}subscribe(e){return this.subscribers.add(e),()=>{this.subscribers.delete(e)}}watch(e){if(this.editor=e,this.editor){const r=()=>{this.transactionNumber+=1,this.subscribers.forEach(i=>i())},n=this.editor;return n.on("transaction",r),()=>{n.off("transaction",r)}}}}function A6(t){const[e]=pe.useState(()=>new T6(t.editor)),r=E6.useSyncExternalStoreWithSelector(e.subscribe,e.getSnapshot,e.getServerSnapshot,t.selector,t.equalityFn);return pe.useEffect(()=>e.watch(t.editor),[t.editor,e]),pe.useDebugValue(r),r}const e0=process.env.NODE_ENV!=="production",km=typeof window>"u",C6=km||!!(typeof window<"u"&&window.next);class k6{constructor(e){this.editor=null,this.subscriptions=new Set,this.isComponentMounted=!1,this.previousDeps=null,this.instanceId="",this.options=e,this.subscriptions=new Set,this.setEditor(this.getInitialEditor()),this.getEditor=this.getEditor.bind(this),this.getServerSnapshot=this.getServerSnapshot.bind(this),this.subscribe=this.subscribe.bind(this),this.refreshEditorInstance=this.refreshEditorInstance.bind(this),this.scheduleDestroy=this.scheduleDestroy.bind(this),this.onRender=this.onRender.bind(this),this.createEditor=this.createEditor.bind(this)}setEditor(e){this.editor=e,this.instanceId=Math.random().toString(36).slice(2,9),this.subscriptions.forEach(r=>r())}getInitialEditor(){if(this.options.current.immediatelyRender===void 0)return km||C6?(e0&&console.warn("Tiptap Error: SSR has been detected, please set `immediatelyRender` explicitly to `false` to avoid hydration mismatches."),null):this.createEditor();if(this.options.current.immediatelyRender&&km&&e0)throw new Error("Tiptap Error: SSR has been detected, and `immediatelyRender` has been set to `true` this is an unsupported configuration that may result in errors, explicitly set `immediatelyRender` to `false` to avoid hydration mismatches.");return this.options.current.immediatelyRender?this.createEditor():null}createEditor(){const e={...this.options.current,onBeforeCreate:(...n)=>{var i,o;return(o=(i=this.options.current).onBeforeCreate)===null||o===void 0?void 0:o.call(i,...n)},onBlur:(...n)=>{var i,o;return(o=(i=this.options.current).onBlur)===null||o===void 0?void 0:o.call(i,...n)},onCreate:(...n)=>{var i,o;return(o=(i=this.options.current).onCreate)===null||o===void 0?void 0:o.call(i,...n)},onDestroy:(...n)=>{var i,o;return(o=(i=this.options.current).onDestroy)===null||o===void 0?void 0:o.call(i,...n)},onFocus:(...n)=>{var i,o;return(o=(i=this.options.current).onFocus)===null||o===void 0?void 0:o.call(i,...n)},onSelectionUpdate:(...n)=>{var i,o;return(o=(i=this.options.current).onSelectionUpdate)===null||o===void 0?void 0:o.call(i,...n)},onTransaction:(...n)=>{var i,o;return(o=(i=this.options.current).onTransaction)===null||o===void 0?void 0:o.call(i,...n)},onUpdate:(...n)=>{var i,o;return(o=(i=this.options.current).onUpdate)===null||o===void 0?void 0:o.call(i,...n)},onContentError:(...n)=>{var i,o;return(o=(i=this.options.current).onContentError)===null||o===void 0?void 0:o.call(i,...n)}};return new jF(e)}getEditor(){return this.editor}getServerSnapshot(){return null}subscribe(e){return this.subscriptions.add(e),()=>{this.subscriptions.delete(e)}}onRender(e){return()=>(this.isComponentMounted=!0,clearTimeout(this.scheduledDestructionTimeout),this.editor&&!this.editor.isDestroyed&&e.length===0?this.editor.setOptions(this.options.current):this.refreshEditorInstance(e),()=>{this.isComponentMounted=!1,this.scheduleDestroy()})}refreshEditorInstance(e){if(this.editor&&!this.editor.isDestroyed){if(this.previousDeps===null){this.previousDeps=e;return}if(this.previousDeps.length===e.length&&this.previousDeps.every((n,i)=>n===e[i]))return}this.editor&&!this.editor.isDestroyed&&this.editor.destroy(),this.setEditor(this.createEditor()),this.previousDeps=e}scheduleDestroy(){const e=this.instanceId,r=this.editor;this.scheduledDestructionTimeout=setTimeout(()=>{if(this.isComponentMounted&&this.instanceId===e){r&&r.setOptions(this.options.current);return}r&&!r.isDestroyed&&(r.destroy(),this.instanceId===e&&this.setEditor(null))},0)}}function _6(t={},e=[]){const r=pe.useRef(t);r.current=t;const[n]=pe.useState(()=>new k6(r)),i=Bf.useSyncExternalStore(n.subscribe,n.getEditor,n.getServerSnapshot);return pe.useDebugValue(i),pe.useEffect(n.onRender(e)),A6({editor:i,selector:({transactionNumber:o})=>t.shouldRerenderOnTransaction===!1?null:t.immediatelyRender&&o===0?0:o+1}),i}const rC=pe.createContext({editor:null});rC.Consumer;const O6=()=>pe.useContext(rC),R6=t=>{const[e,r]=pe.useState(null),{editor:n}=O6();return pe.useEffect(()=>{var i;if(!e||!((i=t.editor)===null||i===void 0)&&i.isDestroyed||n!=null&&n.isDestroyed)return;const{pluginKey:o="bubbleMenu",editor:s,tippyOptions:a={},updateDelay:l,shouldShow:c=null}=t,u=s||n;if(!u){console.warn("BubbleMenu component is not rendered inside of an editor component or does not have editor prop.");return}const f=tC({updateDelay:l,editor:u,element:e,pluginKey:o,shouldShow:c,tippyOptions:a});return u.registerPlugin(f),()=>u.unregisterPlugin(o)},[t.editor,n,e]),pe.createElement("div",{ref:r,className:t.className,style:{visibility:"hidden"}},t.children)},nC=pe.createContext({onDragStart:void 0}),M6=()=>pe.useContext(nC),I6=pe.forwardRef((t,e)=>{const{onDragStart:r}=M6(),n=t.as||"div";return pe.createElement(n,{...t,ref:e,"data-node-view-wrapper":"",onDragStart:r,style:{whiteSpace:"normal",...t.style}})});function N6(t){return!!(typeof t=="function"&&t.prototype&&t.prototype.isReactComponent)}function D6(t){var e;return typeof t=="object"&&((e=t.$$typeof)===null||e===void 0?void 0:e.toString())==="Symbol(react.forward_ref)"}class iC{constructor(e,{editor:r,props:n={},as:i="div",className:o="",attrs:s}){this.ref=null,this.id=Math.floor(Math.random()*4294967295).toString(),this.component=e,this.editor=r,this.props=n,this.element=document.createElement(i),this.element.classList.add("react-renderer"),o&&this.element.classList.add(...o.split(" ")),s&&Object.keys(s).forEach(a=>{this.element.setAttribute(a,s[a])}),this.editor.isInitialized?vf.flushSync(()=>{this.render()}):this.render()}render(){var e;const r=this.component,n=this.props,i=this.editor;(N6(r)||D6(r))&&(n.ref=o=>{this.ref=o}),this.reactElement=pe.createElement(r,n),(e=i==null?void 0:i.contentComponent)===null||e===void 0||e.setRenderer(this.id,this)}updateProps(e={}){this.props={...this.props,...e},this.render()}destroy(){var e;const r=this.editor;(e=r==null?void 0:r.contentComponent)===null||e===void 0||e.removeRenderer(this.id)}}class P6 extends zF{mount(){const e={editor:this.editor,node:this.node,decorations:this.decorations,selected:!1,extension:this.extension,getPos:()=>this.getPos(),updateAttributes:(c={})=>this.updateAttributes(c),deleteNode:()=>this.deleteNode()};if(!this.component.displayName){const c=u=>u.charAt(0).toUpperCase()+u.substring(1);this.component.displayName=c(this.extension.name)}const i={onDragStart:this.onDragStart.bind(this),nodeViewContentRef:c=>{c&&this.contentDOMElement&&c.firstChild!==this.contentDOMElement&&c.appendChild(this.contentDOMElement)}},o=this.component,s=pe.memo(c=>pe.createElement(nC.Provider,{value:i},pe.createElement(o,c)));s.displayName="ReactNodeView",this.node.isLeaf?this.contentDOMElement=null:this.options.contentDOMElementTag?this.contentDOMElement=document.createElement(this.options.contentDOMElementTag):this.contentDOMElement=document.createElement(this.node.isInline?"span":"div"),this.contentDOMElement&&(this.contentDOMElement.style.whiteSpace="inherit");let a=this.node.isInline?"span":"div";this.options.as&&(a=this.options.as);const{className:l=""}=this.options;this.handleSelectionUpdate=this.handleSelectionUpdate.bind(this),this.editor.on("selectionUpdate",this.handleSelectionUpdate),this.renderer=new iC(s,{editor:this.editor,props:e,as:a,className:`node-${this.node.type.name} ${l}`.trim(),attrs:this.options.attrs})}get dom(){var e;if(this.renderer.element.firstElementChild&&!(!((e=this.renderer.element.firstElementChild)===null||e===void 0)&&e.hasAttribute("data-node-view-wrapper")))throw Error("Please use the NodeViewWrapper component for your node view.");return this.renderer.element}get contentDOM(){return this.node.isLeaf?null:this.contentDOMElement}handleSelectionUpdate(){const{from:e,to:r}=this.editor.state.selection;if(e<=this.getPos()&&r>=this.getPos()+this.node.nodeSize){if(this.renderer.props.selected)return;this.selectNode()}else{if(!this.renderer.props.selected)return;this.deselectNode()}}update(e,r){const n=i=>{this.renderer.updateProps(i)};if(e.type!==this.node.type)return!1;if(typeof this.options.update=="function"){const i=this.node,o=this.decorations;return this.node=e,this.decorations=r,this.options.update({oldNode:i,oldDecorations:o,newNode:e,newDecorations:r,updateProps:()=>n({node:e,decorations:r})})}return e===this.node&&this.decorations===r||(this.node=e,this.decorations=r,n({node:e,decorations:r})),!0}selectNode(){this.renderer.updateProps({selected:!0}),this.renderer.element.classList.add("ProseMirror-selectednode")}deselectNode(){this.renderer.updateProps({selected:!1}),this.renderer.element.classList.remove("ProseMirror-selectednode")}destroy(){this.renderer.destroy(),this.editor.off("selectionUpdate",this.handleSelectionUpdate),this.contentDOMElement=null}}function L6(t,e){return r=>r.editor.contentComponent?new P6(t,r,e):{}}/**
142
- * @license lucide-react v0.427.0 - ISC
143
- *
144
- * This source code is licensed under the ISC license.
145
- * See the LICENSE file in the root directory of this source tree.
146
- */const F6=t=>t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),oC=(...t)=>t.filter((e,r,n)=>!!e&&n.indexOf(e)===r).join(" ");/**
147
- * @license lucide-react v0.427.0 - ISC
148
- *
149
- * This source code is licensed under the ISC license.
150
- * See the LICENSE file in the root directory of this source tree.
151
- */var B6={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
152
- * @license lucide-react v0.427.0 - ISC
153
- *
154
- * This source code is licensed under the ISC license.
155
- * See the LICENSE file in the root directory of this source tree.
156
- */const $6=pe.forwardRef(({color:t="currentColor",size:e=24,strokeWidth:r=2,absoluteStrokeWidth:n,className:i="",children:o,iconNode:s,...a},l)=>pe.createElement("svg",{ref:l,...B6,width:e,height:e,stroke:t,strokeWidth:n?Number(r)*24/Number(e):r,className:oC("lucide",i),...a},[...s.map(([c,u])=>pe.createElement(c,u)),...Array.isArray(o)?o:[o]]));/**
157
- * @license lucide-react v0.427.0 - ISC
158
- *
159
- * This source code is licensed under the ISC license.
160
- * See the LICENSE file in the root directory of this source tree.
161
- */const xe=(t,e)=>{const r=pe.forwardRef(({className:n,...i},o)=>pe.createElement($6,{ref:o,iconNode:e,className:oC(`lucide-${F6(t)}`,n),...i}));return r.displayName=`${t}`,r};/**
162
- * @license lucide-react v0.427.0 - ISC
163
- *
164
- * This source code is licensed under the ISC license.
165
- * See the LICENSE file in the root directory of this source tree.
166
- */const j6=xe("BetweenHorizontalEnd",[["rect",{width:"13",height:"7",x:"3",y:"3",rx:"1",key:"11xb64"}],["path",{d:"m22 15-3-3 3-3",key:"26chmm"}],["rect",{width:"13",height:"7",x:"3",y:"14",rx:"1",key:"k6ky7n"}]]);/**
167
- * @license lucide-react v0.427.0 - ISC
168
- *
169
- * This source code is licensed under the ISC license.
170
- * See the LICENSE file in the root directory of this source tree.
171
- */const H6=xe("BetweenHorizontalStart",[["rect",{width:"13",height:"7",x:"8",y:"3",rx:"1",key:"pkso9a"}],["path",{d:"m2 9 3 3-3 3",key:"1agib5"}],["rect",{width:"13",height:"7",x:"8",y:"14",rx:"1",key:"1q5fc1"}]]);/**
172
- * @license lucide-react v0.427.0 - ISC
173
- *
174
- * This source code is licensed under the ISC license.
175
- * See the LICENSE file in the root directory of this source tree.
176
- */const z6=xe("BetweenVerticalEnd",[["rect",{width:"7",height:"13",x:"3",y:"3",rx:"1",key:"1fdu0f"}],["path",{d:"m9 22 3-3 3 3",key:"17z65a"}],["rect",{width:"7",height:"13",x:"14",y:"3",rx:"1",key:"1squn4"}]]);/**
177
- * @license lucide-react v0.427.0 - ISC
178
- *
179
- * This source code is licensed under the ISC license.
180
- * See the LICENSE file in the root directory of this source tree.
181
- */const U6=xe("BetweenVerticalStart",[["rect",{width:"7",height:"13",x:"3",y:"8",rx:"1",key:"1fjrkv"}],["path",{d:"m15 2-3 3-3-3",key:"1uh6eb"}],["rect",{width:"7",height:"13",x:"14",y:"8",rx:"1",key:"w3fjg8"}]]);/**
182
- * @license lucide-react v0.427.0 - ISC
183
- *
184
- * This source code is licensed under the ISC license.
185
- * See the LICENSE file in the root directory of this source tree.
186
- */const W6=xe("Bold",[["path",{d:"M6 12h9a4 4 0 0 1 0 8H7a1 1 0 0 1-1-1V5a1 1 0 0 1 1-1h7a4 4 0 0 1 0 8",key:"mg9rjx"}]]);/**
187
- * @license lucide-react v0.427.0 - ISC
188
- *
189
- * This source code is licensed under the ISC license.
190
- * See the LICENSE file in the root directory of this source tree.
191
- */const V6=xe("BookMarked",[["path",{d:"M10 2v8l3-3 3 3V2",key:"sqw3rj"}],["path",{d:"M4 19.5v-15A2.5 2.5 0 0 1 6.5 2H19a1 1 0 0 1 1 1v18a1 1 0 0 1-1 1H6.5a1 1 0 0 1 0-5H20",key:"k3hazp"}]]);/**
192
- * @license lucide-react v0.427.0 - ISC
193
- *
194
- * This source code is licensed under the ISC license.
195
- * See the LICENSE file in the root directory of this source tree.
196
- */const G6=xe("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/**
197
- * @license lucide-react v0.427.0 - ISC
198
- *
199
- * This source code is licensed under the ISC license.
200
- * See the LICENSE file in the root directory of this source tree.
201
- */const K6=xe("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/**
202
- * @license lucide-react v0.427.0 - ISC
203
- *
204
- * This source code is licensed under the ISC license.
205
- * See the LICENSE file in the root directory of this source tree.
206
- */const q6=xe("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/**
207
- * @license lucide-react v0.427.0 - ISC
208
- *
209
- * This source code is licensed under the ISC license.
210
- * See the LICENSE file in the root directory of this source tree.
211
- */const X6=xe("ChevronsUpDown",[["path",{d:"m7 15 5 5 5-5",key:"1hf1tw"}],["path",{d:"m7 9 5-5 5 5",key:"sgt6xg"}]]);/**
212
- * @license lucide-react v0.427.0 - ISC
213
- *
214
- * This source code is licensed under the ISC license.
215
- * See the LICENSE file in the root directory of this source tree.
216
- */const J6=xe("CircleHelp",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);/**
217
- * @license lucide-react v0.427.0 - ISC
218
- *
219
- * This source code is licensed under the ISC license.
220
- * See the LICENSE file in the root directory of this source tree.
221
- */const Y6=xe("Circle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);/**
222
- * @license lucide-react v0.427.0 - ISC
223
- *
224
- * This source code is licensed under the ISC license.
225
- * See the LICENSE file in the root directory of this source tree.
226
- */const Z6=xe("Clipboard",[["rect",{width:"8",height:"4",x:"8",y:"2",rx:"1",ry:"1",key:"tgr4d6"}],["path",{d:"M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2",key:"116196"}]]);/**
227
- * @license lucide-react v0.427.0 - ISC
228
- *
229
- * This source code is licensed under the ISC license.
230
- * See the LICENSE file in the root directory of this source tree.
231
- */const Q6=xe("Clock3",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16.5 12",key:"1aq6pp"}]]);/**
232
- * @license lucide-react v0.427.0 - ISC
233
- *
234
- * This source code is licensed under the ISC license.
235
- * See the LICENSE file in the root directory of this source tree.
236
- */const e3=xe("CodeXml",[["path",{d:"m18 16 4-4-4-4",key:"1inbqp"}],["path",{d:"m6 8-4 4 4 4",key:"15zrgr"}],["path",{d:"m14.5 4-5 16",key:"e7oirm"}]]);/**
237
- * @license lucide-react v0.427.0 - ISC
238
- *
239
- * This source code is licensed under the ISC license.
240
- * See the LICENSE file in the root directory of this source tree.
241
- */const t3=xe("Code",[["polyline",{points:"16 18 22 12 16 6",key:"z7tu5w"}],["polyline",{points:"8 6 2 12 8 18",key:"1eg1df"}]]);/**
242
- * @license lucide-react v0.427.0 - ISC
243
- *
244
- * This source code is licensed under the ISC license.
245
- * See the LICENSE file in the root directory of this source tree.
246
- */const r3=xe("Columns2",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M12 3v18",key:"108xh3"}]]);/**
247
- * @license lucide-react v0.427.0 - ISC
248
- *
249
- * This source code is licensed under the ISC license.
250
- * See the LICENSE file in the root directory of this source tree.
251
- */const n3=xe("Columns3",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}],["path",{d:"M15 3v18",key:"14nvp0"}]]);/**
252
- * @license lucide-react v0.427.0 - ISC
253
- *
254
- * This source code is licensed under the ISC license.
255
- * See the LICENSE file in the root directory of this source tree.
256
- */const i3=xe("Columns4",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M7.5 3v18",key:"w0wo6v"}],["path",{d:"M12 3v18",key:"108xh3"}],["path",{d:"M16.5 3v18",key:"10tjh1"}]]);/**
257
- * @license lucide-react v0.427.0 - ISC
258
- *
259
- * This source code is licensed under the ISC license.
260
- * See the LICENSE file in the root directory of this source tree.
261
- */const o3=xe("Copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);/**
262
- * @license lucide-react v0.427.0 - ISC
263
- *
264
- * This source code is licensed under the ISC license.
265
- * See the LICENSE file in the root directory of this source tree.
266
- */const s3=xe("Eraser",[["path",{d:"m7 21-4.3-4.3c-1-1-1-2.5 0-3.4l9.6-9.6c1-1 2.5-1 3.4 0l5.6 5.6c1 1 1 2.5 0 3.4L13 21",key:"182aya"}],["path",{d:"M22 21H7",key:"t4ddhn"}],["path",{d:"m5 11 9 9",key:"1mo9qw"}]]);/**
267
- * @license lucide-react v0.427.0 - ISC
268
- *
269
- * This source code is licensed under the ISC license.
270
- * See the LICENSE file in the root directory of this source tree.
271
- */const a3=xe("Frame",[["line",{x1:"22",x2:"2",y1:"6",y2:"6",key:"15w7dq"}],["line",{x1:"22",x2:"2",y1:"18",y2:"18",key:"1ip48p"}],["line",{x1:"6",x2:"6",y1:"2",y2:"22",key:"a2lnyx"}],["line",{x1:"18",x2:"18",y1:"2",y2:"22",key:"8vb6jd"}]]);/**
272
- * @license lucide-react v0.427.0 - ISC
273
- *
274
- * This source code is licensed under the ISC license.
275
- * See the LICENSE file in the root directory of this source tree.
276
- */const l3=xe("GripVertical",[["circle",{cx:"9",cy:"12",r:"1",key:"1vctgf"}],["circle",{cx:"9",cy:"5",r:"1",key:"hp0tcf"}],["circle",{cx:"9",cy:"19",r:"1",key:"fkjjf6"}],["circle",{cx:"15",cy:"12",r:"1",key:"1tmaij"}],["circle",{cx:"15",cy:"5",r:"1",key:"19l28e"}],["circle",{cx:"15",cy:"19",r:"1",key:"f4zoj3"}]]);/**
277
- * @license lucide-react v0.427.0 - ISC
278
- *
279
- * This source code is licensed under the ISC license.
280
- * See the LICENSE file in the root directory of this source tree.
281
- */const c3=xe("Heading1",[["path",{d:"M4 12h8",key:"17cfdx"}],["path",{d:"M4 18V6",key:"1rz3zl"}],["path",{d:"M12 18V6",key:"zqpxq5"}],["path",{d:"m17 12 3-2v8",key:"1hhhft"}]]);/**
282
- * @license lucide-react v0.427.0 - ISC
283
- *
284
- * This source code is licensed under the ISC license.
285
- * See the LICENSE file in the root directory of this source tree.
286
- */const u3=xe("Heading2",[["path",{d:"M4 12h8",key:"17cfdx"}],["path",{d:"M4 18V6",key:"1rz3zl"}],["path",{d:"M12 18V6",key:"zqpxq5"}],["path",{d:"M21 18h-4c0-4 4-3 4-6 0-1.5-2-2.5-4-1",key:"9jr5yi"}]]);/**
287
- * @license lucide-react v0.427.0 - ISC
288
- *
289
- * This source code is licensed under the ISC license.
290
- * See the LICENSE file in the root directory of this source tree.
291
- */const f3=xe("Heading3",[["path",{d:"M4 12h8",key:"17cfdx"}],["path",{d:"M4 18V6",key:"1rz3zl"}],["path",{d:"M12 18V6",key:"zqpxq5"}],["path",{d:"M17.5 10.5c1.7-1 3.5 0 3.5 1.5a2 2 0 0 1-2 2",key:"68ncm8"}],["path",{d:"M17 17.5c2 1.5 4 .3 4-1.5a2 2 0 0 0-2-2",key:"1ejuhz"}]]);/**
292
- * @license lucide-react v0.427.0 - ISC
293
- *
294
- * This source code is licensed under the ISC license.
295
- * See the LICENSE file in the root directory of this source tree.
296
- */const d3=xe("Heading4",[["path",{d:"M4 12h8",key:"17cfdx"}],["path",{d:"M4 18V6",key:"1rz3zl"}],["path",{d:"M12 18V6",key:"zqpxq5"}],["path",{d:"M17 10v4h4",key:"13sv97"}],["path",{d:"M21 10v8",key:"1kdml4"}]]);/**
297
- * @license lucide-react v0.427.0 - ISC
298
- *
299
- * This source code is licensed under the ISC license.
300
- * See the LICENSE file in the root directory of this source tree.
301
- */const h3=xe("Heading5",[["path",{d:"M4 12h8",key:"17cfdx"}],["path",{d:"M4 18V6",key:"1rz3zl"}],["path",{d:"M12 18V6",key:"zqpxq5"}],["path",{d:"M17 13v-3h4",key:"1nvgqp"}],["path",{d:"M17 17.7c.4.2.8.3 1.3.3 1.5 0 2.7-1.1 2.7-2.5S19.8 13 18.3 13H17",key:"2nebdn"}]]);/**
302
- * @license lucide-react v0.427.0 - ISC
303
- *
304
- * This source code is licensed under the ISC license.
305
- * See the LICENSE file in the root directory of this source tree.
306
- */const p3=xe("Heading6",[["path",{d:"M4 12h8",key:"17cfdx"}],["path",{d:"M4 18V6",key:"1rz3zl"}],["path",{d:"M12 18V6",key:"zqpxq5"}],["circle",{cx:"19",cy:"16",r:"2",key:"15mx69"}],["path",{d:"M20 10c-2 2-3 3.5-3 6",key:"f35dl0"}]]);/**
307
- * @license lucide-react v0.427.0 - ISC
308
- *
309
- * This source code is licensed under the ISC license.
310
- * See the LICENSE file in the root directory of this source tree.
311
- */const m3=xe("ImageUp",[["path",{d:"M10.3 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2v10l-3.1-3.1a2 2 0 0 0-2.814.014L6 21",key:"9csbqa"}],["path",{d:"m14 19.5 3-3 3 3",key:"9vmjn0"}],["path",{d:"M17 22v-5.5",key:"1aa6fl"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}]]);/**
312
- * @license lucide-react v0.427.0 - ISC
313
- *
314
- * This source code is licensed under the ISC license.
315
- * See the LICENSE file in the root directory of this source tree.
316
- */const g3=xe("IndentDecrease",[["polyline",{points:"7 8 3 12 7 16",key:"2j60jr"}],["line",{x1:"21",x2:"11",y1:"12",y2:"12",key:"1fxxak"}],["line",{x1:"21",x2:"11",y1:"6",y2:"6",key:"asgu94"}],["line",{x1:"21",x2:"11",y1:"18",y2:"18",key:"13dsj7"}]]);/**
317
- * @license lucide-react v0.427.0 - ISC
318
- *
319
- * This source code is licensed under the ISC license.
320
- * See the LICENSE file in the root directory of this source tree.
321
- */const y3=xe("IndentIncrease",[["polyline",{points:"3 8 7 12 3 16",key:"f3rxhf"}],["line",{x1:"21",x2:"11",y1:"12",y2:"12",key:"1fxxak"}],["line",{x1:"21",x2:"11",y1:"6",y2:"6",key:"asgu94"}],["line",{x1:"21",x2:"11",y1:"18",y2:"18",key:"13dsj7"}]]);/**
322
- * @license lucide-react v0.427.0 - ISC
323
- *
324
- * This source code is licensed under the ISC license.
325
- * See the LICENSE file in the root directory of this source tree.
326
- */const v3=xe("Italic",[["line",{x1:"19",x2:"10",y1:"4",y2:"4",key:"15jd3p"}],["line",{x1:"14",x2:"5",y1:"20",y2:"20",key:"bu0au3"}],["line",{x1:"15",x2:"9",y1:"4",y2:"20",key:"uljnxc"}]]);/**
327
- * @license lucide-react v0.427.0 - ISC
328
- *
329
- * This source code is licensed under the ISC license.
330
- * See the LICENSE file in the root directory of this source tree.
331
- */const w3=xe("Laugh",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M18 13a6 6 0 0 1-6 5 6 6 0 0 1-6-5h12Z",key:"b2q4dd"}],["line",{x1:"9",x2:"9.01",y1:"9",y2:"9",key:"yxxnd0"}],["line",{x1:"15",x2:"15.01",y1:"9",y2:"9",key:"1p4y9e"}]]);/**
332
- * @license lucide-react v0.427.0 - ISC
333
- *
334
- * This source code is licensed under the ISC license.
335
- * See the LICENSE file in the root directory of this source tree.
336
- */const b3=xe("Link",[["path",{d:"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71",key:"1cjeqo"}],["path",{d:"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71",key:"19qd67"}]]);/**
337
- * @license lucide-react v0.427.0 - ISC
338
- *
339
- * This source code is licensed under the ISC license.
340
- * See the LICENSE file in the root directory of this source tree.
341
- */const x3=xe("ListOrdered",[["line",{x1:"10",x2:"21",y1:"6",y2:"6",key:"76qw6h"}],["line",{x1:"10",x2:"21",y1:"12",y2:"12",key:"16nom4"}],["line",{x1:"10",x2:"21",y1:"18",y2:"18",key:"u3jurt"}],["path",{d:"M4 6h1v4",key:"cnovpq"}],["path",{d:"M4 10h2",key:"16xx2s"}],["path",{d:"M6 18H4c0-1 2-2 2-3s-1-1.5-2-1",key:"m9a95d"}]]);/**
342
- * @license lucide-react v0.427.0 - ISC
343
- *
344
- * This source code is licensed under the ISC license.
345
- * See the LICENSE file in the root directory of this source tree.
346
- */const S3=xe("ListTodo",[["rect",{x:"3",y:"5",width:"6",height:"6",rx:"1",key:"1defrl"}],["path",{d:"m3 17 2 2 4-4",key:"1jhpwq"}],["path",{d:"M13 6h8",key:"15sg57"}],["path",{d:"M13 12h8",key:"h98zly"}],["path",{d:"M13 18h8",key:"oe0vm4"}]]);/**
347
- * @license lucide-react v0.427.0 - ISC
348
- *
349
- * This source code is licensed under the ISC license.
350
- * See the LICENSE file in the root directory of this source tree.
351
- */const E3=xe("List",[["line",{x1:"8",x2:"21",y1:"6",y2:"6",key:"7ey8pc"}],["line",{x1:"8",x2:"21",y1:"12",y2:"12",key:"rjfblc"}],["line",{x1:"8",x2:"21",y1:"18",y2:"18",key:"c3b1m8"}],["line",{x1:"3",x2:"3.01",y1:"6",y2:"6",key:"1g7gq3"}],["line",{x1:"3",x2:"3.01",y1:"12",y2:"12",key:"1pjlvk"}],["line",{x1:"3",x2:"3.01",y1:"18",y2:"18",key:"28t2mc"}]]);/**
352
- * @license lucide-react v0.427.0 - ISC
353
- *
354
- * This source code is licensed under the ISC license.
355
- * See the LICENSE file in the root directory of this source tree.
356
- */const T3=xe("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);/**
357
- * @license lucide-react v0.427.0 - ISC
358
- *
359
- * This source code is licensed under the ISC license.
360
- * See the LICENSE file in the root directory of this source tree.
361
- */const A3=xe("Maximize",[["path",{d:"M8 3H5a2 2 0 0 0-2 2v3",key:"1dcmit"}],["path",{d:"M21 8V5a2 2 0 0 0-2-2h-3",key:"1e4gt3"}],["path",{d:"M3 16v3a2 2 0 0 0 2 2h3",key:"wsl5sc"}],["path",{d:"M16 21h3a2 2 0 0 0 2-2v-3",key:"18trek"}]]);/**
362
- * @license lucide-react v0.427.0 - ISC
363
- *
364
- * This source code is licensed under the ISC license.
365
- * See the LICENSE file in the root directory of this source tree.
366
- */const C3=xe("Minimize",[["path",{d:"M8 3v3a2 2 0 0 1-2 2H3",key:"hohbtr"}],["path",{d:"M21 8h-3a2 2 0 0 1-2-2V3",key:"5jw1f3"}],["path",{d:"M3 16h3a2 2 0 0 1 2 2v3",key:"198tvr"}],["path",{d:"M16 21v-3a2 2 0 0 1 2-2h3",key:"ph8mxp"}]]);/**
367
- * @license lucide-react v0.427.0 - ISC
368
- *
369
- * This source code is licensed under the ISC license.
370
- * See the LICENSE file in the root directory of this source tree.
371
- */const k3=xe("Minus",[["path",{d:"M5 12h14",key:"1ays0h"}]]);/**
372
- * @license lucide-react v0.427.0 - ISC
373
- *
374
- * This source code is licensed under the ISC license.
375
- * See the LICENSE file in the root directory of this source tree.
376
- */const _3=xe("PaintRoller",[["rect",{width:"16",height:"6",x:"2",y:"2",rx:"2",key:"jcyz7m"}],["path",{d:"M10 16v-2a2 2 0 0 1 2-2h8a2 2 0 0 0 2-2V7a2 2 0 0 0-2-2h-2",key:"1b9h7c"}],["rect",{width:"4",height:"6",x:"8",y:"16",rx:"1",key:"d6e7yl"}]]);/**
377
- * @license lucide-react v0.427.0 - ISC
378
- *
379
- * This source code is licensed under the ISC license.
380
- * See the LICENSE file in the root directory of this source tree.
381
- */const O3=xe("PanelLeft",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}]]);/**
382
- * @license lucide-react v0.427.0 - ISC
383
- *
384
- * This source code is licensed under the ISC license.
385
- * See the LICENSE file in the root directory of this source tree.
386
- */const R3=xe("PanelRight",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M15 3v18",key:"14nvp0"}]]);/**
387
- * @license lucide-react v0.427.0 - ISC
388
- *
389
- * This source code is licensed under the ISC license.
390
- * See the LICENSE file in the root directory of this source tree.
391
- */const M3=xe("Pencil",[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]]);/**
392
- * @license lucide-react v0.427.0 - ISC
393
- *
394
- * This source code is licensed under the ISC license.
395
- * See the LICENSE file in the root directory of this source tree.
396
- */const I3=xe("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/**
397
- * @license lucide-react v0.427.0 - ISC
398
- *
399
- * This source code is licensed under the ISC license.
400
- * See the LICENSE file in the root directory of this source tree.
401
- */const N3=xe("Quote",[["path",{d:"M16 3a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2 1 1 0 0 1 1 1v1a2 2 0 0 1-2 2 1 1 0 0 0-1 1v2a1 1 0 0 0 1 1 6 6 0 0 0 6-6V5a2 2 0 0 0-2-2z",key:"rib7q0"}],["path",{d:"M5 3a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2 1 1 0 0 1 1 1v1a2 2 0 0 1-2 2 1 1 0 0 0-1 1v2a1 1 0 0 0 1 1 6 6 0 0 0 6-6V5a2 2 0 0 0-2-2z",key:"1ymkrd"}]]);/**
402
- * @license lucide-react v0.427.0 - ISC
403
- *
404
- * This source code is licensed under the ISC license.
405
- * See the LICENSE file in the root directory of this source tree.
406
- */const D3=xe("Redo2",[["path",{d:"m15 14 5-5-5-5",key:"12vg1m"}],["path",{d:"M20 9H9.5A5.5 5.5 0 0 0 4 14.5A5.5 5.5 0 0 0 9.5 20H13",key:"6uklza"}]]);/**
407
- * @license lucide-react v0.427.0 - ISC
408
- *
409
- * This source code is licensed under the ISC license.
410
- * See the LICENSE file in the root directory of this source tree.
411
- */const P3=xe("Replace",[["path",{d:"M14 4a2 2 0 0 1 2-2",key:"1w2hp7"}],["path",{d:"M16 10a2 2 0 0 1-2-2",key:"shjach"}],["path",{d:"M20 2a2 2 0 0 1 2 2",key:"188mtx"}],["path",{d:"M22 8a2 2 0 0 1-2 2",key:"ddf4tu"}],["path",{d:"m3 7 3 3 3-3",key:"x25e72"}],["path",{d:"M6 10V5a3 3 0 0 1 3-3h1",key:"3y3t5z"}],["rect",{x:"2",y:"14",width:"8",height:"8",rx:"2",key:"4rksxw"}]]);/**
412
- * @license lucide-react v0.427.0 - ISC
413
- *
414
- * This source code is licensed under the ISC license.
415
- * See the LICENSE file in the root directory of this source tree.
416
- */const L3=xe("Sigma",[["path",{d:"M18 7V5a1 1 0 0 0-1-1H6.5a.5.5 0 0 0-.4.8l4.5 6a2 2 0 0 1 0 2.4l-4.5 6a.5.5 0 0 0 .4.8H17a1 1 0 0 0 1-1v-2",key:"wuwx1p"}]]);/**
417
- * @license lucide-react v0.427.0 - ISC
418
- *
419
- * This source code is licensed under the ISC license.
420
- * See the LICENSE file in the root directory of this source tree.
421
- */const F3=xe("SmilePlus",[["path",{d:"M22 11v1a10 10 0 1 1-9-10",key:"ew0xw9"}],["path",{d:"M8 14s1.5 2 4 2 4-2 4-2",key:"1y1vjs"}],["line",{x1:"9",x2:"9.01",y1:"9",y2:"9",key:"yxxnd0"}],["line",{x1:"15",x2:"15.01",y1:"9",y2:"9",key:"1p4y9e"}],["path",{d:"M16 5h6",key:"1vod17"}],["path",{d:"M19 2v6",key:"4bpg5p"}]]);/**
422
- * @license lucide-react v0.427.0 - ISC
423
- *
424
- * This source code is licensed under the ISC license.
425
- * See the LICENSE file in the root directory of this source tree.
426
- */const B3=xe("Sparkles",[["path",{d:"M9.937 15.5A2 2 0 0 0 8.5 14.063l-6.135-1.582a.5.5 0 0 1 0-.962L8.5 9.936A2 2 0 0 0 9.937 8.5l1.582-6.135a.5.5 0 0 1 .963 0L14.063 8.5A2 2 0 0 0 15.5 9.937l6.135 1.581a.5.5 0 0 1 0 .964L15.5 14.063a2 2 0 0 0-1.437 1.437l-1.582 6.135a.5.5 0 0 1-.963 0z",key:"4pj2yx"}],["path",{d:"M20 3v4",key:"1olli1"}],["path",{d:"M22 5h-4",key:"1gvqau"}],["path",{d:"M4 17v2",key:"vumght"}],["path",{d:"M5 18H3",key:"zchphs"}]]);/**
427
- * @license lucide-react v0.427.0 - ISC
428
- *
429
- * This source code is licensed under the ISC license.
430
- * See the LICENSE file in the root directory of this source tree.
431
- */const $3=xe("Strikethrough",[["path",{d:"M16 4H9a3 3 0 0 0-2.83 4",key:"43sutm"}],["path",{d:"M14 12a4 4 0 0 1 0 8H6",key:"nlfj13"}],["line",{x1:"4",x2:"20",y1:"12",y2:"12",key:"1e0a9i"}]]);/**
432
- * @license lucide-react v0.427.0 - ISC
433
- *
434
- * This source code is licensed under the ISC license.
435
- * See the LICENSE file in the root directory of this source tree.
436
- */const j3=xe("Subscript",[["path",{d:"m4 5 8 8",key:"1eunvl"}],["path",{d:"m12 5-8 8",key:"1ah0jp"}],["path",{d:"M20 19h-4c0-1.5.44-2 1.5-2.5S20 15.33 20 14c0-.47-.17-.93-.48-1.29a2.11 2.11 0 0 0-2.62-.44c-.42.24-.74.62-.9 1.07",key:"e8ta8j"}]]);/**
437
- * @license lucide-react v0.427.0 - ISC
438
- *
439
- * This source code is licensed under the ISC license.
440
- * See the LICENSE file in the root directory of this source tree.
441
- */const H3=xe("Superscript",[["path",{d:"m4 19 8-8",key:"hr47gm"}],["path",{d:"m12 19-8-8",key:"1dhhmo"}],["path",{d:"M20 12h-4c0-1.5.442-2 1.5-2.5S20 8.334 20 7.002c0-.472-.17-.93-.484-1.29a2.105 2.105 0 0 0-2.617-.436c-.42.239-.738.614-.899 1.06",key:"1dfcux"}]]);/**
442
- * @license lucide-react v0.427.0 - ISC
443
- *
444
- * This source code is licensed under the ISC license.
445
- * See the LICENSE file in the root directory of this source tree.
446
- */const z3=xe("TableCellsMerge",[["path",{d:"M12 21v-6",key:"lihzve"}],["path",{d:"M12 9V3",key:"da5inc"}],["path",{d:"M3 15h18",key:"5xshup"}],["path",{d:"M3 9h18",key:"1pudct"}],["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]]);/**
447
- * @license lucide-react v0.427.0 - ISC
448
- *
449
- * This source code is licensed under the ISC license.
450
- * See the LICENSE file in the root directory of this source tree.
451
- */const U3=xe("TableCellsSplit",[["path",{d:"M12 15V9",key:"8c7uyn"}],["path",{d:"M3 15h18",key:"5xshup"}],["path",{d:"M3 9h18",key:"1pudct"}],["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]]);/**
452
- * @license lucide-react v0.427.0 - ISC
453
- *
454
- * This source code is licensed under the ISC license.
455
- * See the LICENSE file in the root directory of this source tree.
456
- */const W3=xe("Table",[["path",{d:"M12 3v18",key:"108xh3"}],["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M3 9h18",key:"1pudct"}],["path",{d:"M3 15h18",key:"5xshup"}]]);/**
457
- * @license lucide-react v0.427.0 - ISC
458
- *
459
- * This source code is licensed under the ISC license.
460
- * See the LICENSE file in the root directory of this source tree.
461
- */const V3=xe("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]]);/**
462
- * @license lucide-react v0.427.0 - ISC
463
- *
464
- * This source code is licensed under the ISC license.
465
- * See the LICENSE file in the root directory of this source tree.
466
- */const G3=xe("Trash",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}]]);/**
467
- * @license lucide-react v0.427.0 - ISC
468
- *
469
- * This source code is licensed under the ISC license.
470
- * See the LICENSE file in the root directory of this source tree.
471
- */const K3=xe("Type",[["polyline",{points:"4 7 4 4 20 4 20 7",key:"1nosan"}],["line",{x1:"9",x2:"15",y1:"20",y2:"20",key:"swin9y"}],["line",{x1:"12",x2:"12",y1:"4",y2:"20",key:"1tx1rr"}]]);/**
472
- * @license lucide-react v0.427.0 - ISC
473
- *
474
- * This source code is licensed under the ISC license.
475
- * See the LICENSE file in the root directory of this source tree.
476
- */const q3=xe("Underline",[["path",{d:"M6 4v6a6 6 0 0 0 12 0V4",key:"9kb039"}],["line",{x1:"4",x2:"20",y1:"20",y2:"20",key:"nun2al"}]]);/**
477
- * @license lucide-react v0.427.0 - ISC
478
- *
479
- * This source code is licensed under the ISC license.
480
- * See the LICENSE file in the root directory of this source tree.
481
- */const X3=xe("Undo2",[["path",{d:"M9 14 4 9l5-5",key:"102s5s"}],["path",{d:"M4 9h10.5a5.5 5.5 0 0 1 5.5 5.5a5.5 5.5 0 0 1-5.5 5.5H11",key:"f3b9sd"}]]);/**
482
- * @license lucide-react v0.427.0 - ISC
483
- *
484
- * This source code is licensed under the ISC license.
485
- * See the LICENSE file in the root directory of this source tree.
486
- */const J3=xe("Unlink",[["path",{d:"m18.84 12.25 1.72-1.71h-.02a5.004 5.004 0 0 0-.12-7.07 5.006 5.006 0 0 0-6.95 0l-1.72 1.71",key:"yqzxt4"}],["path",{d:"m5.17 11.75-1.71 1.71a5.004 5.004 0 0 0 .12 7.07 5.006 5.006 0 0 0 6.95 0l1.71-1.71",key:"4qinb0"}],["line",{x1:"8",x2:"8",y1:"2",y2:"5",key:"1041cp"}],["line",{x1:"2",x2:"5",y1:"8",y2:"8",key:"14m1p5"}],["line",{x1:"16",x2:"16",y1:"19",y2:"22",key:"rzdirn"}],["line",{x1:"19",x2:"22",y1:"16",y2:"16",key:"ox905f"}]]);/**
487
- * @license lucide-react v0.427.0 - ISC
488
- *
489
- * This source code is licensed under the ISC license.
490
- * See the LICENSE file in the root directory of this source tree.
491
- */const Y3=xe("Video",[["path",{d:"m16 13 5.223 3.482a.5.5 0 0 0 .777-.416V7.87a.5.5 0 0 0-.752-.432L16 10.5",key:"ftymec"}],["rect",{x:"2",y:"6",width:"14",height:"12",rx:"2",key:"158x01"}]]);/**
492
- * @license lucide-react v0.427.0 - ISC
493
- *
494
- * This source code is licensed under the ISC license.
495
- * See the LICENSE file in the root directory of this source tree.
496
- */const Z3=xe("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);var yn=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function My(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function Q3(t){if(t.__esModule)return t;var e=t.default;if(typeof e=="function"){var r=function n(){return this instanceof n?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};r.prototype=e.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(t).forEach(function(n){var i=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(r,n,i.get?i:{enumerable:!0,get:function(){return t[n]}})}),r}var t0=Object.prototype.toString,sC=function(e){var r=t0.call(e),n=r==="[object Arguments]";return n||(n=r!=="[object Array]"&&e!==null&&typeof e=="object"&&typeof e.length=="number"&&e.length>=0&&t0.call(e.callee)==="[object Function]"),n},Qd,r0;function e$(){if(r0)return Qd;r0=1;var t;if(!Object.keys){var e=Object.prototype.hasOwnProperty,r=Object.prototype.toString,n=sC,i=Object.prototype.propertyIsEnumerable,o=!i.call({toString:null},"toString"),s=i.call(function(){},"prototype"),a=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],l=function(d){var h=d.constructor;return h&&h.prototype===d},c={$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(!c["$"+d]&&e.call(window,d)&&window[d]!==null&&typeof window[d]=="object")try{l(window[d])}catch{return!0}}catch{return!0}return!1}(),f=function(d){if(typeof window>"u"||!u)return l(d);try{return l(d)}catch{return!1}};t=function(h){var p=h!==null&&typeof h=="object",m=r.call(h)==="[object Function]",y=n(h),g=p&&r.call(h)==="[object String]",b=[];if(!p&&!m&&!y)throw new TypeError("Object.keys called on a non-object");var S=s&&m;if(g&&h.length>0&&!e.call(h,0))for(var x=0;x<h.length;++x)b.push(String(x));if(y&&h.length>0)for(var O=0;O<h.length;++O)b.push(String(O));else for(var M in h)!(S&&M==="prototype")&&e.call(h,M)&&b.push(String(M));if(o)for(var D=f(h),$=0;$<a.length;++$)!(D&&a[$]==="constructor")&&e.call(h,a[$])&&b.push(a[$]);return b}}return Qd=t,Qd}var t$=Array.prototype.slice,r$=sC,n0=Object.keys,Sc=n0?function(e){return n0(e)}:e$(),i0=Object.keys;Sc.shim=function(){if(Object.keys){var e=function(){var r=Object.keys(arguments);return r&&r.length===arguments.length}(1,2);e||(Object.keys=function(n){return r$(n)?i0(t$.call(n)):i0(n)})}else Object.keys=Sc;return Object.keys||Sc};var Iy=Sc,n$=Error,i$=EvalError,o$=RangeError,s$=ReferenceError,aC=SyntaxError,Ci=TypeError,a$=URIError,$f=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var e={},r=Symbol("test"),n=Object(r);if(typeof r=="string"||Object.prototype.toString.call(r)!=="[object Symbol]"||Object.prototype.toString.call(n)!=="[object Symbol]")return!1;var i=42;e[r]=i;for(r 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 o=Object.getOwnPropertySymbols(e);if(o.length!==1||o[0]!==r||!Object.prototype.propertyIsEnumerable.call(e,r))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var s=Object.getOwnPropertyDescriptor(e,r);if(s.value!==i||s.enumerable!==!0)return!1}return!0},o0=typeof Symbol<"u"&&Symbol,l$=$f,Ny=function(){return typeof o0!="function"||typeof Symbol!="function"||typeof o0("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:l$()},eh={__proto__:null,foo:{}},c$=Object,u$=function(){return{__proto__:eh}.foo===eh.foo&&!(eh instanceof c$)},f$="Function.prototype.bind called on incompatible ",d$=Object.prototype.toString,h$=Math.max,p$="[object Function]",s0=function(e,r){for(var n=[],i=0;i<e.length;i+=1)n[i]=e[i];for(var o=0;o<r.length;o+=1)n[o+e.length]=r[o];return n},m$=function(e,r){for(var n=[],i=r,o=0;i<e.length;i+=1,o+=1)n[o]=e[i];return n},g$=function(t,e){for(var r="",n=0;n<t.length;n+=1)r+=t[n],n+1<t.length&&(r+=e);return r},y$=function(e){var r=this;if(typeof r!="function"||d$.apply(r)!==p$)throw new TypeError(f$+r);for(var n=m$(arguments,1),i,o=function(){if(this instanceof i){var u=r.apply(this,s0(n,arguments));return Object(u)===u?u:this}return r.apply(e,s0(n,arguments))},s=h$(0,r.length-n.length),a=[],l=0;l<s;l++)a[l]="$"+l;if(i=Function("binder","return function ("+g$(a,",")+"){ return binder.apply(this,arguments); }")(o),r.prototype){var c=function(){};c.prototype=r.prototype,i.prototype=new c,c.prototype=null}return i},v$=y$,Dy=Function.prototype.bind||v$,w$=Function.prototype.call,b$=Object.prototype.hasOwnProperty,x$=Dy,lC=x$.call(w$,b$),Le,S$=n$,E$=i$,T$=o$,A$=s$,hs=aC,Xo=Ci,C$=a$,cC=Function,th=function(t){try{return cC('"use strict"; return ('+t+").constructor;")()}catch{}},qi=Object.getOwnPropertyDescriptor;if(qi)try{qi({},"")}catch{qi=null}var rh=function(){throw new Xo},k$=qi?function(){try{return arguments.callee,rh}catch{try{return qi(arguments,"callee").get}catch{return rh}}}():rh,Co=Ny(),_$=u$(),ht=Object.getPrototypeOf||(_$?function(t){return t.__proto__}:null),Bo={},O$=typeof Uint8Array>"u"||!ht?Le:ht(Uint8Array),Xi={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?Le:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?Le:ArrayBuffer,"%ArrayIteratorPrototype%":Co&&ht?ht([][Symbol.iterator]()):Le,"%AsyncFromSyncIteratorPrototype%":Le,"%AsyncFunction%":Bo,"%AsyncGenerator%":Bo,"%AsyncGeneratorFunction%":Bo,"%AsyncIteratorPrototype%":Bo,"%Atomics%":typeof Atomics>"u"?Le:Atomics,"%BigInt%":typeof BigInt>"u"?Le:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?Le:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?Le:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?Le:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":S$,"%eval%":eval,"%EvalError%":E$,"%Float32Array%":typeof Float32Array>"u"?Le:Float32Array,"%Float64Array%":typeof Float64Array>"u"?Le:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?Le:FinalizationRegistry,"%Function%":cC,"%GeneratorFunction%":Bo,"%Int8Array%":typeof Int8Array>"u"?Le:Int8Array,"%Int16Array%":typeof Int16Array>"u"?Le:Int16Array,"%Int32Array%":typeof Int32Array>"u"?Le:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":Co&&ht?ht(ht([][Symbol.iterator]())):Le,"%JSON%":typeof JSON=="object"?JSON:Le,"%Map%":typeof Map>"u"?Le:Map,"%MapIteratorPrototype%":typeof Map>"u"||!Co||!ht?Le:ht(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?Le:Promise,"%Proxy%":typeof Proxy>"u"?Le:Proxy,"%RangeError%":T$,"%ReferenceError%":A$,"%Reflect%":typeof Reflect>"u"?Le:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?Le:Set,"%SetIteratorPrototype%":typeof Set>"u"||!Co||!ht?Le:ht(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?Le:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":Co&&ht?ht(""[Symbol.iterator]()):Le,"%Symbol%":Co?Symbol:Le,"%SyntaxError%":hs,"%ThrowTypeError%":k$,"%TypedArray%":O$,"%TypeError%":Xo,"%Uint8Array%":typeof Uint8Array>"u"?Le:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?Le:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?Le:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?Le:Uint32Array,"%URIError%":C$,"%WeakMap%":typeof WeakMap>"u"?Le:WeakMap,"%WeakRef%":typeof WeakRef>"u"?Le:WeakRef,"%WeakSet%":typeof WeakSet>"u"?Le:WeakSet};if(ht)try{null.error}catch(t){var R$=ht(ht(t));Xi["%Error.prototype%"]=R$}var M$=function t(e){var r;if(e==="%AsyncFunction%")r=th("async function () {}");else if(e==="%GeneratorFunction%")r=th("function* () {}");else if(e==="%AsyncGeneratorFunction%")r=th("async function* () {}");else if(e==="%AsyncGenerator%"){var n=t("%AsyncGeneratorFunction%");n&&(r=n.prototype)}else if(e==="%AsyncIteratorPrototype%"){var i=t("%AsyncGenerator%");i&&ht&&(r=ht(i.prototype))}return Xi[e]=r,r},a0={__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"]},pl=Dy,au=lC,I$=pl.call(Function.call,Array.prototype.concat),N$=pl.call(Function.apply,Array.prototype.splice),l0=pl.call(Function.call,String.prototype.replace),lu=pl.call(Function.call,String.prototype.slice),D$=pl.call(Function.call,RegExp.prototype.exec),P$=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,L$=/\\(\\)?/g,F$=function(e){var r=lu(e,0,1),n=lu(e,-1);if(r==="%"&&n!=="%")throw new hs("invalid intrinsic syntax, expected closing `%`");if(n==="%"&&r!=="%")throw new hs("invalid intrinsic syntax, expected opening `%`");var i=[];return l0(e,P$,function(o,s,a,l){i[i.length]=a?l0(l,L$,"$1"):s||o}),i},B$=function(e,r){var n=e,i;if(au(a0,n)&&(i=a0[n],n="%"+i[0]+"%"),au(Xi,n)){var o=Xi[n];if(o===Bo&&(o=M$(n)),typeof o>"u"&&!r)throw new Xo("intrinsic "+e+" exists, but is not available. Please file an issue!");return{alias:i,name:n,value:o}}throw new hs("intrinsic "+e+" does not exist!")},tn=function(e,r){if(typeof e!="string"||e.length===0)throw new Xo("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof r!="boolean")throw new Xo('"allowMissing" argument must be a boolean');if(D$(/^%?[^%]*%?$/,e)===null)throw new hs("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var n=F$(e),i=n.length>0?n[0]:"",o=B$("%"+i+"%",r),s=o.name,a=o.value,l=!1,c=o.alias;c&&(i=c[0],N$(n,I$([0,1],c)));for(var u=1,f=!0;u<n.length;u+=1){var d=n[u],h=lu(d,0,1),p=lu(d,-1);if((h==='"'||h==="'"||h==="`"||p==='"'||p==="'"||p==="`")&&h!==p)throw new hs("property names with quotes must have matching quotes");if((d==="constructor"||!f)&&(l=!0),i+="."+d,s="%"+i+"%",au(Xi,s))a=Xi[s];else if(a!=null){if(!(d in a)){if(!r)throw new Xo("base intrinsic for "+e+" exists, but the property is not available.");return}if(qi&&u+1>=n.length){var m=qi(a,d);f=!!m,f&&"get"in m&&!("originalValue"in m.get)?a=m.get:a=a[d]}else f=au(a,d),a=a[d];f&&!l&&(Xi[s]=a)}}return a},$$=tn,Ec=$$("%Object.defineProperty%",!0)||!1;if(Ec)try{Ec({},"a",{value:1})}catch{Ec=!1}var Py=Ec,j$=tn,Tc=j$("%Object.getOwnPropertyDescriptor%",!0);if(Tc)try{Tc([],"length")}catch{Tc=null}var Ly=Tc,c0=Py,H$=aC,ko=Ci,u0=Ly,Fy=function(e,r,n){if(!e||typeof e!="object"&&typeof e!="function")throw new ko("`obj` must be an object or a function`");if(typeof r!="string"&&typeof r!="symbol")throw new ko("`property` must be a string or a symbol`");if(arguments.length>3&&typeof arguments[3]!="boolean"&&arguments[3]!==null)throw new ko("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&typeof arguments[4]!="boolean"&&arguments[4]!==null)throw new ko("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&typeof arguments[5]!="boolean"&&arguments[5]!==null)throw new ko("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&typeof arguments[6]!="boolean")throw new ko("`loose`, if provided, must be a boolean");var i=arguments.length>3?arguments[3]:null,o=arguments.length>4?arguments[4]:null,s=arguments.length>5?arguments[5]:null,a=arguments.length>6?arguments[6]:!1,l=!!u0&&u0(e,r);if(c0)c0(e,r,{configurable:s===null&&l?l.configurable:!s,enumerable:i===null&&l?l.enumerable:!i,value:n,writable:o===null&&l?l.writable:!o});else if(a||!i&&!o&&!s)e[r]=n;else throw new H$("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.")},_m=Py,uC=function(){return!!_m};uC.hasArrayLengthDefineBug=function(){if(!_m)return null;try{return _m([],"length",{value:1}).length!==1}catch{return!0}};var By=uC,z$=Iy,U$=typeof Symbol=="function"&&typeof Symbol("foo")=="symbol",W$=Object.prototype.toString,V$=Array.prototype.concat,f0=Fy,G$=function(t){return typeof t=="function"&&W$.call(t)==="[object Function]"},fC=By(),K$=function(t,e,r,n){if(e in t){if(n===!0){if(t[e]===r)return}else if(!G$(n)||!n())return}fC?f0(t,e,r,!0):f0(t,e,r)},dC=function(t,e){var r=arguments.length>2?arguments[2]:{},n=z$(e);U$&&(n=V$.call(n,Object.getOwnPropertySymbols(e)));for(var i=0;i<n.length;i+=1)K$(t,n[i],e[n[i]],r[n[i]])};dC.supportsDescriptors=!!fC;var ho=dC,hC={exports:{}},q$=tn,d0=Fy,X$=By(),h0=Ly,p0=Ci,J$=q$("%Math.floor%"),Y$=function(e,r){if(typeof e!="function")throw new p0("`fn` is not a function");if(typeof r!="number"||r<0||r>4294967295||J$(r)!==r)throw new p0("`length` must be a positive 32-bit integer");var n=arguments.length>2&&!!arguments[2],i=!0,o=!0;if("length"in e&&h0){var s=h0(e,"length");s&&!s.configurable&&(i=!1),s&&!s.writable&&(o=!1)}return(i||o||!n)&&(X$?d0(e,"length",r,!0,!0):d0(e,"length",r)),e};(function(t){var e=Dy,r=tn,n=Y$,i=Ci,o=r("%Function.prototype.apply%"),s=r("%Function.prototype.call%"),a=r("%Reflect.apply%",!0)||e.call(s,o),l=Py,c=r("%Math.max%");t.exports=function(d){if(typeof d!="function")throw new i("a function is required");var h=a(e,s,arguments);return n(h,1+c(0,d.length-(arguments.length-1)),!0)};var u=function(){return a(e,o,arguments)};l?l(t.exports,"apply",{value:u}):t.exports.apply=u})(hC);var Ms=hC.exports,pC=tn,mC=Ms,Z$=mC(pC("String.prototype.indexOf")),br=function(e,r){var n=pC(e,!!r);return typeof n=="function"&&Z$(e,".prototype.")>-1?mC(n):n},Q$=Iy,gC=$f(),yC=br,m0=Object,e2=yC("Array.prototype.push"),g0=yC("Object.prototype.propertyIsEnumerable"),t2=gC?Object.getOwnPropertySymbols:null,vC=function(e,r){if(e==null)throw new TypeError("target must be an object");var n=m0(e);if(arguments.length===1)return n;for(var i=1;i<arguments.length;++i){var o=m0(arguments[i]),s=Q$(o),a=gC&&(Object.getOwnPropertySymbols||t2);if(a)for(var l=a(o),c=0;c<l.length;++c){var u=l[c];g0(o,u)&&e2(s,u)}for(var f=0;f<s.length;++f){var d=s[f];if(g0(o,d)){var h=o[d];n[d]=h}}}return n},nh=vC,r2=function(){if(!Object.assign)return!1;for(var t="abcdefghijklmnopqrst",e=t.split(""),r={},n=0;n<e.length;++n)r[e[n]]=e[n];var i=Object.assign({},r),o="";for(var s in i)o+=s;return t!==o},n2=function(){if(!Object.assign||!Object.preventExtensions)return!1;var t=Object.preventExtensions({1:2});try{Object.assign(t,"xy")}catch{return t[1]==="y"}return!1},wC=function(){return!Object.assign||r2()||n2()?nh:Object.assign},i2=ho,o2=wC,s2=function(){var e=o2();return i2(Object,{assign:e},{assign:function(){return Object.assign!==e}}),e},a2=ho,l2=Ms,c2=vC,bC=wC,u2=s2,f2=l2.apply(bC()),xC=function(e,r){return f2(Object,arguments)};a2(xC,{getPolyfill:bC,implementation:c2,shim:u2});var d2=xC,Ha=function(){return typeof(function(){}).name=="string"},va=Object.getOwnPropertyDescriptor;if(va)try{va([],"length")}catch{va=null}Ha.functionsHaveConfigurableNames=function(){if(!Ha()||!va)return!1;var e=va(function(){},"name");return!!e&&!!e.configurable};var h2=Function.prototype.bind;Ha.boundFunctionsHaveNames=function(){return Ha()&&typeof h2=="function"&&(function(){}).bind().name!==""};var p2=Ha,y0=Fy,m2=By(),g2=p2.functionsHaveConfigurableNames(),y2=Ci,v2=function(e,r){if(typeof e!="function")throw new y2("`fn` is not a function");var n=arguments.length>2&&!!arguments[2];return(!n||g2)&&(m2?y0(e,"name",r,!0,!0):y0(e,"name",r)),e},w2=v2,b2=Ci,x2=Object,SC=w2(function(){if(this==null||this!==x2(this))throw new b2("RegExp.prototype.flags getter called on non-object");var e="";return this.hasIndices&&(e+="d"),this.global&&(e+="g"),this.ignoreCase&&(e+="i"),this.multiline&&(e+="m"),this.dotAll&&(e+="s"),this.unicode&&(e+="u"),this.unicodeSets&&(e+="v"),this.sticky&&(e+="y"),e},"get flags",!0),S2=SC,E2=ho.supportsDescriptors,T2=Object.getOwnPropertyDescriptor,EC=function(){if(E2&&/a/mig.flags==="gim"){var e=T2(RegExp.prototype,"flags");if(e&&typeof e.get=="function"&&typeof RegExp.prototype.dotAll=="boolean"&&typeof RegExp.prototype.hasIndices=="boolean"){var r="",n={};if(Object.defineProperty(n,"hasIndices",{get:function(){r+="d"}}),Object.defineProperty(n,"sticky",{get:function(){r+="y"}}),r==="dy")return e.get}}return S2},A2=ho.supportsDescriptors,C2=EC,k2=Object.getOwnPropertyDescriptor,_2=Object.defineProperty,O2=TypeError,v0=Object.getPrototypeOf,R2=/a/,M2=function(){if(!A2||!v0)throw new O2("RegExp.prototype.flags requires a true ES5 environment that supports property descriptors");var e=C2(),r=v0(R2),n=k2(r,"flags");return(!n||n.get!==e)&&_2(r,"flags",{configurable:!0,enumerable:!1,get:e}),e},I2=ho,N2=Ms,D2=SC,TC=EC,P2=M2,AC=N2(TC());I2(AC,{getPolyfill:TC,implementation:D2,shim:P2});var L2=AC,Ac={exports:{}},F2=$f,po=function(){return F2()&&!!Symbol.toStringTag},B2=po(),$2=br,Om=$2("Object.prototype.toString"),jf=function(e){return B2&&e&&typeof e=="object"&&Symbol.toStringTag in e?!1:Om(e)==="[object Arguments]"},CC=function(e){return jf(e)?!0:e!==null&&typeof e=="object"&&typeof e.length=="number"&&e.length>=0&&Om(e)!=="[object Array]"&&Om(e.callee)==="[object Function]"},j2=function(){return jf(arguments)}();jf.isLegacyArguments=CC;var kC=j2?jf:CC;const H2={},z2=Object.freeze(Object.defineProperty({__proto__:null,default:H2},Symbol.toStringTag,{value:"Module"})),U2=Q3(z2);var $y=typeof Map=="function"&&Map.prototype,ih=Object.getOwnPropertyDescriptor&&$y?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,cu=$y&&ih&&typeof ih.get=="function"?ih.get:null,w0=$y&&Map.prototype.forEach,jy=typeof Set=="function"&&Set.prototype,oh=Object.getOwnPropertyDescriptor&&jy?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,uu=jy&&oh&&typeof oh.get=="function"?oh.get:null,b0=jy&&Set.prototype.forEach,W2=typeof WeakMap=="function"&&WeakMap.prototype,wa=W2?WeakMap.prototype.has:null,V2=typeof WeakSet=="function"&&WeakSet.prototype,ba=V2?WeakSet.prototype.has:null,G2=typeof WeakRef=="function"&&WeakRef.prototype,x0=G2?WeakRef.prototype.deref:null,K2=Boolean.prototype.valueOf,q2=Object.prototype.toString,X2=Function.prototype.toString,J2=String.prototype.match,Hy=String.prototype.slice,ii=String.prototype.replace,Y2=String.prototype.toUpperCase,S0=String.prototype.toLowerCase,_C=RegExp.prototype.test,E0=Array.prototype.concat,$r=Array.prototype.join,Z2=Array.prototype.slice,T0=Math.floor,Rm=typeof BigInt=="function"?BigInt.prototype.valueOf:null,sh=Object.getOwnPropertySymbols,Mm=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Symbol.prototype.toString:null,ps=typeof Symbol=="function"&&typeof Symbol.iterator=="object",Dt=typeof Symbol=="function"&&Symbol.toStringTag&&(typeof Symbol.toStringTag===ps||!0)?Symbol.toStringTag:null,OC=Object.prototype.propertyIsEnumerable,A0=(typeof Reflect=="function"?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(t){return t.__proto__}:null);function C0(t,e){if(t===1/0||t===-1/0||t!==t||t&&t>-1e3&&t<1e3||_C.call(/e/,e))return e;var r=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if(typeof t=="number"){var n=t<0?-T0(-t):T0(t);if(n!==t){var i=String(n),o=Hy.call(e,i.length+1);return ii.call(i,r,"$&_")+"."+ii.call(ii.call(o,/([0-9]{3})/g,"$&_"),/_$/,"")}}return ii.call(e,r,"$&_")}var Im=U2,k0=Im.custom,_0=MC(k0)?k0:null,Q2=function t(e,r,n,i){var o=r||{};if(Gn(o,"quoteStyle")&&o.quoteStyle!=="single"&&o.quoteStyle!=="double")throw new TypeError('option "quoteStyle" must be "single" or "double"');if(Gn(o,"maxStringLength")&&(typeof o.maxStringLength=="number"?o.maxStringLength<0&&o.maxStringLength!==1/0:o.maxStringLength!==null))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var s=Gn(o,"customInspect")?o.customInspect:!0;if(typeof s!="boolean"&&s!=="symbol")throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(Gn(o,"indent")&&o.indent!==null&&o.indent!==" "&&!(parseInt(o.indent,10)===o.indent&&o.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(Gn(o,"numericSeparator")&&typeof o.numericSeparator!="boolean")throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var a=o.numericSeparator;if(typeof e>"u")return"undefined";if(e===null)return"null";if(typeof e=="boolean")return e?"true":"false";if(typeof e=="string")return NC(e,o);if(typeof e=="number"){if(e===0)return 1/0/e>0?"0":"-0";var l=String(e);return a?C0(e,l):l}if(typeof e=="bigint"){var c=String(e)+"n";return a?C0(e,c):c}var u=typeof o.depth>"u"?5:o.depth;if(typeof n>"u"&&(n=0),n>=u&&u>0&&typeof e=="object")return Nm(e)?"[Array]":"[Object]";var f=y4(o,n);if(typeof i>"u")i=[];else if(IC(i,e)>=0)return"[Circular]";function d(U,k,G){if(k&&(i=Z2.call(i),i.push(k)),G){var te={depth:o.depth};return Gn(o,"quoteStyle")&&(te.quoteStyle=o.quoteStyle),t(U,te,n+1,i)}return t(U,o,n+1,i)}if(typeof e=="function"&&!O0(e)){var h=l4(e),p=Ll(e,d);return"[Function"+(h?": "+h:" (anonymous)")+"]"+(p.length>0?" { "+$r.call(p,", ")+" }":"")}if(MC(e)){var m=ps?ii.call(String(e),/^(Symbol\(.*\))_[^)]*$/,"$1"):Mm.call(e);return typeof e=="object"&&!ps?qs(m):m}if(p4(e)){for(var y="<"+S0.call(String(e.nodeName)),g=e.attributes||[],b=0;b<g.length;b++)y+=" "+g[b].name+"="+RC(e4(g[b].value),"double",o);return y+=">",e.childNodes&&e.childNodes.length&&(y+="..."),y+="</"+S0.call(String(e.nodeName))+">",y}if(Nm(e)){if(e.length===0)return"[]";var S=Ll(e,d);return f&&!g4(S)?"["+Dm(S,f)+"]":"[ "+$r.call(S,", ")+" ]"}if(r4(e)){var x=Ll(e,d);return!("cause"in Error.prototype)&&"cause"in e&&!OC.call(e,"cause")?"{ ["+String(e)+"] "+$r.call(E0.call("[cause]: "+d(e.cause),x),", ")+" }":x.length===0?"["+String(e)+"]":"{ ["+String(e)+"] "+$r.call(x,", ")+" }"}if(typeof e=="object"&&s){if(_0&&typeof e[_0]=="function"&&Im)return Im(e,{depth:u-n});if(s!=="symbol"&&typeof e.inspect=="function")return e.inspect()}if(c4(e)){var O=[];return w0&&w0.call(e,function(U,k){O.push(d(k,e,!0)+" => "+d(U,e))}),R0("Map",cu.call(e),O,f)}if(d4(e)){var M=[];return b0&&b0.call(e,function(U){M.push(d(U,e))}),R0("Set",uu.call(e),M,f)}if(u4(e))return ah("WeakMap");if(h4(e))return ah("WeakSet");if(f4(e))return ah("WeakRef");if(i4(e))return qs(d(Number(e)));if(s4(e))return qs(d(Rm.call(e)));if(o4(e))return qs(K2.call(e));if(n4(e))return qs(d(String(e)));if(typeof window<"u"&&e===window)return"{ [object Window] }";if(typeof globalThis<"u"&&e===globalThis||typeof yn<"u"&&e===yn)return"{ [object globalThis] }";if(!t4(e)&&!O0(e)){var D=Ll(e,d),$=A0?A0(e)===Object.prototype:e instanceof Object||e.constructor===Object,A=e instanceof Object?"":"null prototype",V=!$&&Dt&&Object(e)===e&&Dt in e?Hy.call(ki(e),8,-1):A?"Object":"",Q=$||typeof e.constructor!="function"?"":e.constructor.name?e.constructor.name+" ":"",I=Q+(V||A?"["+$r.call(E0.call([],V||[],A||[]),": ")+"] ":"");return D.length===0?I+"{}":f?I+"{"+Dm(D,f)+"}":I+"{ "+$r.call(D,", ")+" }"}return String(e)};function RC(t,e,r){var n=(r.quoteStyle||e)==="double"?'"':"'";return n+t+n}function e4(t){return ii.call(String(t),/"/g,"&quot;")}function Nm(t){return ki(t)==="[object Array]"&&(!Dt||!(typeof t=="object"&&Dt in t))}function t4(t){return ki(t)==="[object Date]"&&(!Dt||!(typeof t=="object"&&Dt in t))}function O0(t){return ki(t)==="[object RegExp]"&&(!Dt||!(typeof t=="object"&&Dt in t))}function r4(t){return ki(t)==="[object Error]"&&(!Dt||!(typeof t=="object"&&Dt in t))}function n4(t){return ki(t)==="[object String]"&&(!Dt||!(typeof t=="object"&&Dt in t))}function i4(t){return ki(t)==="[object Number]"&&(!Dt||!(typeof t=="object"&&Dt in t))}function o4(t){return ki(t)==="[object Boolean]"&&(!Dt||!(typeof t=="object"&&Dt in t))}function MC(t){if(ps)return t&&typeof t=="object"&&t instanceof Symbol;if(typeof t=="symbol")return!0;if(!t||typeof t!="object"||!Mm)return!1;try{return Mm.call(t),!0}catch{}return!1}function s4(t){if(!t||typeof t!="object"||!Rm)return!1;try{return Rm.call(t),!0}catch{}return!1}var a4=Object.prototype.hasOwnProperty||function(t){return t in this};function Gn(t,e){return a4.call(t,e)}function ki(t){return q2.call(t)}function l4(t){if(t.name)return t.name;var e=J2.call(X2.call(t),/^function\s*([\w$]+)/);return e?e[1]:null}function IC(t,e){if(t.indexOf)return t.indexOf(e);for(var r=0,n=t.length;r<n;r++)if(t[r]===e)return r;return-1}function c4(t){if(!cu||!t||typeof t!="object")return!1;try{cu.call(t);try{uu.call(t)}catch{return!0}return t instanceof Map}catch{}return!1}function u4(t){if(!wa||!t||typeof t!="object")return!1;try{wa.call(t,wa);try{ba.call(t,ba)}catch{return!0}return t instanceof WeakMap}catch{}return!1}function f4(t){if(!x0||!t||typeof t!="object")return!1;try{return x0.call(t),!0}catch{}return!1}function d4(t){if(!uu||!t||typeof t!="object")return!1;try{uu.call(t);try{cu.call(t)}catch{return!0}return t instanceof Set}catch{}return!1}function h4(t){if(!ba||!t||typeof t!="object")return!1;try{ba.call(t,ba);try{wa.call(t,wa)}catch{return!0}return t instanceof WeakSet}catch{}return!1}function p4(t){return!t||typeof t!="object"?!1:typeof HTMLElement<"u"&&t instanceof HTMLElement?!0:typeof t.nodeName=="string"&&typeof t.getAttribute=="function"}function NC(t,e){if(t.length>e.maxStringLength){var r=t.length-e.maxStringLength,n="... "+r+" more character"+(r>1?"s":"");return NC(Hy.call(t,0,e.maxStringLength),e)+n}var i=ii.call(ii.call(t,/(['\\])/g,"\\$1"),/[\x00-\x1f]/g,m4);return RC(i,"single",e)}function m4(t){var e=t.charCodeAt(0),r={8:"b",9:"t",10:"n",12:"f",13:"r"}[e];return r?"\\"+r:"\\x"+(e<16?"0":"")+Y2.call(e.toString(16))}function qs(t){return"Object("+t+")"}function ah(t){return t+" { ? }"}function R0(t,e,r,n){var i=n?Dm(r,n):$r.call(r,", ");return t+" ("+e+") {"+i+"}"}function g4(t){for(var e=0;e<t.length;e++)if(IC(t[e],`
497
- `)>=0)return!1;return!0}function y4(t,e){var r;if(t.indent===" ")r=" ";else if(typeof t.indent=="number"&&t.indent>0)r=$r.call(Array(t.indent+1)," ");else return null;return{base:r,prev:$r.call(Array(e+1),r)}}function Dm(t,e){if(t.length===0)return"";var r=`
498
- `+e.prev+e.base;return r+$r.call(t,","+r)+`
499
- `+e.prev}function Ll(t,e){var r=Nm(t),n=[];if(r){n.length=t.length;for(var i=0;i<t.length;i++)n[i]=Gn(t,i)?e(t[i],t):""}var o=typeof sh=="function"?sh(t):[],s;if(ps){s={};for(var a=0;a<o.length;a++)s["$"+o[a]]=o[a]}for(var l in t)Gn(t,l)&&(r&&String(Number(l))===l&&l<t.length||ps&&s["$"+l]instanceof Symbol||(_C.call(/[^\w$]/,l)?n.push(e(l,t)+": "+e(t[l],t)):n.push(l+": "+e(t[l],t))));if(typeof sh=="function")for(var c=0;c<o.length;c++)OC.call(t,o[c])&&n.push("["+e(o[c])+"]: "+e(t[o[c]],t));return n}var DC=tn,Is=br,v4=Q2,w4=Ci,Fl=DC("%WeakMap%",!0),Bl=DC("%Map%",!0),b4=Is("WeakMap.prototype.get",!0),x4=Is("WeakMap.prototype.set",!0),S4=Is("WeakMap.prototype.has",!0),E4=Is("Map.prototype.get",!0),T4=Is("Map.prototype.set",!0),A4=Is("Map.prototype.has",!0),zy=function(t,e){for(var r=t,n;(n=r.next)!==null;r=n)if(n.key===e)return r.next=n.next,n.next=t.next,t.next=n,n},C4=function(t,e){var r=zy(t,e);return r&&r.value},k4=function(t,e,r){var n=zy(t,e);n?n.value=r:t.next={key:e,next:t.next,value:r}},_4=function(t,e){return!!zy(t,e)},PC=function(){var e,r,n,i={assert:function(o){if(!i.has(o))throw new w4("Side channel does not contain "+v4(o))},get:function(o){if(Fl&&o&&(typeof o=="object"||typeof o=="function")){if(e)return b4(e,o)}else if(Bl){if(r)return E4(r,o)}else if(n)return C4(n,o)},has:function(o){if(Fl&&o&&(typeof o=="object"||typeof o=="function")){if(e)return S4(e,o)}else if(Bl){if(r)return A4(r,o)}else if(n)return _4(n,o);return!1},set:function(o,s){Fl&&o&&(typeof o=="object"||typeof o=="function")?(e||(e=new Fl),x4(e,o,s)):Bl?(r||(r=new Bl),T4(r,o,s)):(n||(n={key:{},next:null}),k4(n,o,s))}};return i},O4=lC,Xs=PC(),fn=Ci,Uy={assert:function(t,e){if(!t||typeof t!="object"&&typeof t!="function")throw new fn("`O` is not an object");if(typeof e!="string")throw new fn("`slot` must be a string");if(Xs.assert(t),!Uy.has(t,e))throw new fn("`"+e+"` is not present on `O`")},get:function(t,e){if(!t||typeof t!="object"&&typeof t!="function")throw new fn("`O` is not an object");if(typeof e!="string")throw new fn("`slot` must be a string");var r=Xs.get(t);return r&&r["$"+e]},has:function(t,e){if(!t||typeof t!="object"&&typeof t!="function")throw new fn("`O` is not an object");if(typeof e!="string")throw new fn("`slot` must be a string");var r=Xs.get(t);return!!r&&O4(r,"$"+e)},set:function(t,e,r){if(!t||typeof t!="object"&&typeof t!="function")throw new fn("`O` is not an object");if(typeof e!="string")throw new fn("`slot` must be a string");var n=Xs.get(t);n||(n={},Xs.set(t,n)),n["$"+e]=r}};Object.freeze&&Object.freeze(Uy);var R4=Uy,Js=R4,M4=SyntaxError,M0=typeof StopIteration=="object"?StopIteration:null,I4=function(e){if(!M0)throw new M4("this environment lacks StopIteration");Js.set(e,"[[Done]]",!1);var r={next:function(){var i=Js.get(this,"[[Iterator]]"),o=Js.get(i,"[[Done]]");try{return{done:o,value:o?void 0:i.next()}}catch(s){if(Js.set(i,"[[Done]]",!0),s!==M0)throw s;return{done:!0,value:void 0}}}};return Js.set(r,"[[Iterator]]",e),r},N4={}.toString,LC=Array.isArray||function(t){return N4.call(t)=="[object Array]"},D4=String.prototype.valueOf,P4=function(e){try{return D4.call(e),!0}catch{return!1}},L4=Object.prototype.toString,F4="[object String]",B4=po(),FC=function(e){return typeof e=="string"?!0:typeof e!="object"?!1:B4?P4(e):L4.call(e)===F4},Wy=typeof Map=="function"&&Map.prototype?Map:null,$4=typeof Set=="function"&&Set.prototype?Set:null,fu;Wy||(fu=function(e){return!1});var BC=Wy?Map.prototype.has:null,I0=$4?Set.prototype.has:null;!fu&&!BC&&(fu=function(e){return!1});var $C=fu||function(e){if(!e||typeof e!="object")return!1;try{if(BC.call(e),I0)try{I0.call(e)}catch{return!0}return e instanceof Wy}catch{}return!1},j4=typeof Map=="function"&&Map.prototype?Map:null,Vy=typeof Set=="function"&&Set.prototype?Set:null,du;Vy||(du=function(e){return!1});var N0=j4?Map.prototype.has:null,jC=Vy?Set.prototype.has:null;!du&&!jC&&(du=function(e){return!1});var HC=du||function(e){if(!e||typeof e!="object")return!1;try{if(jC.call(e),N0)try{N0.call(e)}catch{return!0}return e instanceof Vy}catch{}return!1},D0=kC,P0=I4;if(Ny()||$f()){var lh=Symbol.iterator;Ac.exports=function(e){if(e!=null&&typeof e[lh]<"u")return e[lh]();if(D0(e))return Array.prototype[lh].call(e)}}else{var H4=LC,z4=FC,L0=tn,U4=L0("%Map%",!0),W4=L0("%Set%",!0),xr=br,F0=xr("Array.prototype.push"),B0=xr("String.prototype.charCodeAt"),V4=xr("String.prototype.slice"),G4=function(e,r){var n=e.length;if(r+1>=n)return r+1;var i=B0(e,r);if(i<55296||i>56319)return r+1;var o=B0(e,r+1);return o<56320||o>57343?r+1:r+2},ch=function(e){var r=0;return{next:function(){var i=r>=e.length,o;return i||(o=e[r],r+=1),{done:i,value:o}}}},$0=function(e,r){if(H4(e)||D0(e))return ch(e);if(z4(e)){var n=0;return{next:function(){var o=G4(e,n),s=V4(e,n,o);return n=o,{done:o>e.length,value:s}}}}if(r&&typeof e["_es6-shim iterator_"]<"u")return e["_es6-shim iterator_"]()};if(!U4&&!W4)Ac.exports=function(e){if(e!=null)return $0(e,!0)};else{var K4=$C,q4=HC,j0=xr("Map.prototype.forEach",!0),H0=xr("Set.prototype.forEach",!0);if(typeof process>"u"||!process.versions||!process.versions.node)var z0=xr("Map.prototype.iterator",!0),U0=xr("Set.prototype.iterator",!0);var W0=xr("Map.prototype.@@iterator",!0)||xr("Map.prototype._es6-shim iterator_",!0),V0=xr("Set.prototype.@@iterator",!0)||xr("Set.prototype._es6-shim iterator_",!0),X4=function(e){if(K4(e)){if(z0)return P0(z0(e));if(W0)return W0(e);if(j0){var r=[];return j0(e,function(i,o){F0(r,[o,i])}),ch(r)}}if(q4(e)){if(U0)return P0(U0(e));if(V0)return V0(e);if(H0){var n=[];return H0(e,function(i){F0(n,i)}),ch(n)}}};Ac.exports=function(e){return X4(e)||$0(e)}}}var J4=Ac.exports,G0=function(t){return t!==t},zC=function(e,r){return e===0&&r===0?1/e===1/r:!!(e===r||G0(e)&&G0(r))},Y4=zC,UC=function(){return typeof Object.is=="function"?Object.is:Y4},Z4=UC,Q4=ho,e8=function(){var e=Z4();return Q4(Object,{is:e},{is:function(){return Object.is!==e}}),e},t8=ho,r8=Ms,n8=zC,WC=UC,i8=e8,VC=r8(WC(),Object);t8(VC,{getPolyfill:WC,implementation:n8,shim:i8});var o8=VC,s8=Ms,GC=br,a8=tn,Pm=a8("%ArrayBuffer%",!0),Cc=GC("ArrayBuffer.prototype.byteLength",!0),l8=GC("Object.prototype.toString"),K0=!!Pm&&!Cc&&new Pm(0).slice,q0=!!K0&&s8(K0),KC=Cc||q0?function(e){if(!e||typeof e!="object")return!1;try{return Cc?Cc(e):q0(e,0),!0}catch{return!1}}:Pm?function(e){return l8(e)==="[object ArrayBuffer]"}:function(e){return!1},c8=Date.prototype.getDay,u8=function(e){try{return c8.call(e),!0}catch{return!1}},f8=Object.prototype.toString,d8="[object Date]",h8=po(),p8=function(e){return typeof e!="object"||e===null?!1:h8?u8(e):f8.call(e)===d8},Lm=br,qC=po(),XC,JC,Fm,Bm;if(qC){XC=Lm("Object.prototype.hasOwnProperty"),JC=Lm("RegExp.prototype.exec"),Fm={};var uh=function(){throw Fm};Bm={toString:uh,valueOf:uh},typeof Symbol.toPrimitive=="symbol"&&(Bm[Symbol.toPrimitive]=uh)}var m8=Lm("Object.prototype.toString"),g8=Object.getOwnPropertyDescriptor,y8="[object RegExp]",v8=qC?function(e){if(!e||typeof e!="object")return!1;var r=g8(e,"lastIndex"),n=r&&XC(r,"value");if(!n)return!1;try{JC(e,Bm)}catch(i){return i===Fm}}:function(e){return!e||typeof e!="object"&&typeof e!="function"?!1:m8(e)===y8},w8=br,X0=w8("SharedArrayBuffer.prototype.byteLength",!0),b8=X0?function(e){if(!e||typeof e!="object")return!1;try{return X0(e),!0}catch{return!1}}:function(e){return!1},x8=Number.prototype.toString,S8=function(e){try{return x8.call(e),!0}catch{return!1}},E8=Object.prototype.toString,T8="[object Number]",A8=po(),C8=function(e){return typeof e=="number"?!0:typeof e!="object"?!1:A8?S8(e):E8.call(e)===T8},YC=br,k8=YC("Boolean.prototype.toString"),_8=YC("Object.prototype.toString"),O8=function(e){try{return k8(e),!0}catch{return!1}},R8="[object Boolean]",M8=po(),I8=function(e){return typeof e=="boolean"?!0:e===null||typeof e!="object"?!1:M8&&Symbol.toStringTag in e?O8(e):_8(e)===R8},$m={exports:{}},N8=Object.prototype.toString,D8=Ny();if(D8){var P8=Symbol.prototype.toString,L8=/^Symbol\(.*\)$/,F8=function(e){return typeof e.valueOf()!="symbol"?!1:L8.test(P8.call(e))};$m.exports=function(e){if(typeof e=="symbol")return!0;if(N8.call(e)!=="[object Symbol]")return!1;try{return F8(e)}catch{return!1}}}else $m.exports=function(e){return!1};var B8=$m.exports,jm={exports:{}},J0=typeof BigInt<"u"&&BigInt,$8=function(){return typeof J0=="function"&&typeof BigInt=="function"&&typeof J0(42)=="bigint"&&typeof BigInt(42)=="bigint"},j8=$8();if(j8){var H8=BigInt.prototype.valueOf,z8=function(e){try{return H8.call(e),!0}catch{}return!1};jm.exports=function(e){return e===null||typeof e>"u"||typeof e=="boolean"||typeof e=="string"||typeof e=="number"||typeof e=="symbol"||typeof e=="function"?!1:typeof e=="bigint"?!0:z8(e)}}else jm.exports=function(e){return!1};var U8=jm.exports,W8=FC,V8=C8,G8=I8,K8=B8,q8=U8,X8=function(e){if(e==null||typeof e!="object"&&typeof e!="function")return null;if(W8(e))return"String";if(V8(e))return"Number";if(G8(e))return"Boolean";if(K8(e))return"Symbol";if(q8(e))return"BigInt"},hu=typeof WeakMap=="function"&&WeakMap.prototype?WeakMap:null,Y0=typeof WeakSet=="function"&&WeakSet.prototype?WeakSet:null,pu;hu||(pu=function(e){return!1});var Hm=hu?hu.prototype.has:null,fh=Y0?Y0.prototype.has:null;!pu&&!Hm&&(pu=function(e){return!1});var J8=pu||function(e){if(!e||typeof e!="object")return!1;try{if(Hm.call(e,Hm),fh)try{fh.call(e,fh)}catch{return!0}return e instanceof hu}catch{}return!1},zm={exports:{}},Y8=tn,ZC=br,Z8=Y8("%WeakSet%",!0),dh=ZC("WeakSet.prototype.has",!0);if(dh){var hh=ZC("WeakMap.prototype.has",!0);zm.exports=function(e){if(!e||typeof e!="object")return!1;try{if(dh(e,dh),hh)try{hh(e,hh)}catch{return!0}return e instanceof Z8}catch{}return!1}}else zm.exports=function(e){return!1};var Q8=zm.exports,ej=$C,tj=HC,rj=J8,nj=Q8,ij=function(e){if(e&&typeof e=="object"){if(ej(e))return"Map";if(tj(e))return"Set";if(rj(e))return"WeakMap";if(nj(e))return"WeakSet"}return!1},QC=Function.prototype.toString,Uo=typeof Reflect=="object"&&Reflect!==null&&Reflect.apply,Um,kc;if(typeof Uo=="function"&&typeof Object.defineProperty=="function")try{Um=Object.defineProperty({},"length",{get:function(){throw kc}}),kc={},Uo(function(){throw 42},null,Um)}catch(t){t!==kc&&(Uo=null)}else Uo=null;var oj=/^\s*class\b/,Wm=function(e){try{var r=QC.call(e);return oj.test(r)}catch{return!1}},ph=function(e){try{return Wm(e)?!1:(QC.call(e),!0)}catch{return!1}},_c=Object.prototype.toString,sj="[object Object]",aj="[object Function]",lj="[object GeneratorFunction]",cj="[object HTMLAllCollection]",uj="[object HTML document.all class]",fj="[object HTMLCollection]",dj=typeof Symbol=="function"&&!!Symbol.toStringTag,hj=!(0 in[,]),Vm=function(){return!1};if(typeof document=="object"){var pj=document.all;_c.call(pj)===_c.call(document.all)&&(Vm=function(e){if((hj||!e)&&(typeof e>"u"||typeof e=="object"))try{var r=_c.call(e);return(r===cj||r===uj||r===fj||r===sj)&&e("")==null}catch{}return!1})}var mj=Uo?function(e){if(Vm(e))return!0;if(!e||typeof e!="function"&&typeof e!="object")return!1;try{Uo(e,null,Um)}catch(r){if(r!==kc)return!1}return!Wm(e)&&ph(e)}:function(e){if(Vm(e))return!0;if(!e||typeof e!="function"&&typeof e!="object")return!1;if(dj)return ph(e);if(Wm(e))return!1;var r=_c.call(e);return r!==aj&&r!==lj&&!/^\[object HTML/.test(r)?!1:ph(e)},gj=mj,yj=Object.prototype.toString,ek=Object.prototype.hasOwnProperty,vj=function(e,r,n){for(var i=0,o=e.length;i<o;i++)ek.call(e,i)&&(n==null?r(e[i],i,e):r.call(n,e[i],i,e))},wj=function(e,r,n){for(var i=0,o=e.length;i<o;i++)n==null?r(e.charAt(i),i,e):r.call(n,e.charAt(i),i,e)},bj=function(e,r,n){for(var i in e)ek.call(e,i)&&(n==null?r(e[i],i,e):r.call(n,e[i],i,e))},xj=function(e,r,n){if(!gj(r))throw new TypeError("iterator must be a function");var i;arguments.length>=3&&(i=n),yj.call(e)==="[object Array]"?vj(e,r,i):typeof e=="string"?wj(e,r,i):bj(e,r,i)},Sj=xj,Ej=["Float32Array","Float64Array","Int8Array","Int16Array","Int32Array","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array"],mh=Ej,Tj=typeof globalThis>"u"?yn:globalThis,Aj=function(){for(var e=[],r=0;r<mh.length;r++)typeof Tj[mh[r]]=="function"&&(e[e.length]=mh[r]);return e},mu=Sj,Cj=Aj,Z0=Ms,Gy=br,Oc=Ly,kj=Gy("Object.prototype.toString"),tk=po(),Q0=typeof globalThis>"u"?yn:globalThis,Gm=Cj(),Ky=Gy("String.prototype.slice"),gh=Object.getPrototypeOf,_j=Gy("Array.prototype.indexOf",!0)||function(e,r){for(var n=0;n<e.length;n+=1)if(e[n]===r)return n;return-1},gu={__proto__:null};tk&&Oc&&gh?mu(Gm,function(t){var e=new Q0[t];if(Symbol.toStringTag in e){var r=gh(e),n=Oc(r,Symbol.toStringTag);if(!n){var i=gh(r);n=Oc(i,Symbol.toStringTag)}gu["$"+t]=Z0(n.get)}}):mu(Gm,function(t){var e=new Q0[t],r=e.slice||e.set;r&&(gu["$"+t]=Z0(r))});var Oj=function(e){var r=!1;return mu(gu,function(n,i){if(!r)try{"$"+n(e)===i&&(r=Ky(i,1))}catch{}}),r},Rj=function(e){var r=!1;return mu(gu,function(n,i){if(!r)try{n(e),r=Ky(i,1)}catch{}}),r},Mj=function(e){if(!e||typeof e!="object")return!1;if(!tk){var r=Ky(kj(e),8,-1);return _j(Gm,r)>-1?r:r!=="Object"?!1:Rj(e)}return Oc?Oj(e):null},Ij=br,e1=Ij("ArrayBuffer.prototype.byteLength",!0),Nj=KC,Dj=function(e){return Nj(e)?e1?e1(e):e.byteLength:NaN},rk=d2,rn=br,t1=L2,Pj=tn,ms=J4,Lj=PC,r1=o8,n1=kC,i1=LC,o1=KC,s1=p8,a1=v8,l1=b8,c1=Iy,u1=X8,f1=ij,d1=Mj,h1=Dj,p1=rn("SharedArrayBuffer.prototype.byteLength",!0),m1=rn("Date.prototype.getTime"),yh=Object.getPrototypeOf,g1=rn("Object.prototype.toString"),yu=Pj("%Set%",!0),Km=rn("Map.prototype.has",!0),vu=rn("Map.prototype.get",!0),y1=rn("Map.prototype.size",!0),wu=rn("Set.prototype.add",!0),nk=rn("Set.prototype.delete",!0),bu=rn("Set.prototype.has",!0),Rc=rn("Set.prototype.size",!0);function v1(t,e,r,n){for(var i=ms(t),o;(o=i.next())&&!o.done;)if(Ar(e,o.value,r,n))return nk(t,o.value),!0;return!1}function ik(t){if(typeof t>"u")return null;if(typeof t!="object")return typeof t=="symbol"?!1:typeof t=="string"||typeof t=="number"?+t==+t:!0}function Fj(t,e,r,n,i,o){var s=ik(r);if(s!=null)return s;var a=vu(e,s),l=rk({},i,{strict:!1});return typeof a>"u"&&!Km(e,s)||!Ar(n,a,l,o)?!1:!Km(t,s)&&Ar(n,a,l,o)}function Bj(t,e,r){var n=ik(r);return n??(bu(e,n)&&!bu(t,n))}function w1(t,e,r,n,i,o){for(var s=ms(t),a,l;(a=s.next())&&!a.done;)if(l=a.value,Ar(r,l,i,o)&&Ar(n,vu(e,l),i,o))return nk(t,l),!0;return!1}function Ar(t,e,r,n){var i=r||{};if(i.strict?r1(t,e):t===e)return!0;var o=u1(t),s=u1(e);if(o!==s)return!1;if(!t||!e||typeof t!="object"&&typeof e!="object")return i.strict?r1(t,e):t==e;var a=n.has(t),l=n.has(e),c;if(a&&l){if(n.get(t)===n.get(e))return!0}else c={};return a||n.set(t,c),l||n.set(e,c),Hj(t,e,i,n)}function b1(t){return!t||typeof t!="object"||typeof t.length!="number"||typeof t.copy!="function"||typeof t.slice!="function"||t.length>0&&typeof t[0]!="number"?!1:!!(t.constructor&&t.constructor.isBuffer&&t.constructor.isBuffer(t))}function $j(t,e,r,n){if(Rc(t)!==Rc(e))return!1;for(var i=ms(t),o=ms(e),s,a,l;(s=i.next())&&!s.done;)if(s.value&&typeof s.value=="object")l||(l=new yu),wu(l,s.value);else if(!bu(e,s.value)){if(r.strict||!Bj(t,e,s.value))return!1;l||(l=new yu),wu(l,s.value)}if(l){for(;(a=o.next())&&!a.done;)if(a.value&&typeof a.value=="object"){if(!v1(l,a.value,r.strict,n))return!1}else if(!r.strict&&!bu(t,a.value)&&!v1(l,a.value,r.strict,n))return!1;return Rc(l)===0}return!0}function jj(t,e,r,n){if(y1(t)!==y1(e))return!1;for(var i=ms(t),o=ms(e),s,a,l,c,u,f;(s=i.next())&&!s.done;)if(c=s.value[0],u=s.value[1],c&&typeof c=="object")l||(l=new yu),wu(l,c);else if(f=vu(e,c),typeof f>"u"&&!Km(e,c)||!Ar(u,f,r,n)){if(r.strict||!Fj(t,e,c,u,r,n))return!1;l||(l=new yu),wu(l,c)}if(l){for(;(a=o.next())&&!a.done;)if(c=a.value[0],f=a.value[1],c&&typeof c=="object"){if(!w1(l,t,c,f,r,n))return!1}else if(!r.strict&&(!t.has(c)||!Ar(vu(t,c),f,r,n))&&!w1(l,t,c,f,rk({},r,{strict:!1}),n))return!1;return Rc(l)===0}return!0}function Hj(t,e,r,n){var i,o;if(typeof t!=typeof e||t==null||e==null||g1(t)!==g1(e)||n1(t)!==n1(e))return!1;var s=i1(t),a=i1(e);if(s!==a)return!1;var l=t instanceof Error,c=e instanceof Error;if(l!==c||(l||c)&&(t.name!==e.name||t.message!==e.message))return!1;var u=a1(t),f=a1(e);if(u!==f||(u||f)&&(t.source!==e.source||t1(t)!==t1(e)))return!1;var d=s1(t),h=s1(e);if(d!==h||(d||h)&&m1(t)!==m1(e)||r.strict&&yh&&yh(t)!==yh(e))return!1;var p=d1(t),m=d1(e);if(p!==m)return!1;if(p||m){if(t.length!==e.length)return!1;for(i=0;i<t.length;i++)if(t[i]!==e[i])return!1;return!0}var y=b1(t),g=b1(e);if(y!==g)return!1;if(y||g){if(t.length!==e.length)return!1;for(i=0;i<t.length;i++)if(t[i]!==e[i])return!1;return!0}var b=o1(t),S=o1(e);if(b!==S)return!1;if(b||S)return h1(t)!==h1(e)?!1:typeof Uint8Array=="function"&&Ar(new Uint8Array(t),new Uint8Array(e),r,n);var x=l1(t),O=l1(e);if(x!==O)return!1;if(x||O)return p1(t)!==p1(e)?!1:typeof Uint8Array=="function"&&Ar(new Uint8Array(t),new Uint8Array(e),r,n);if(typeof t!=typeof e)return!1;var M=c1(t),D=c1(e);if(M.length!==D.length)return!1;for(M.sort(),D.sort(),i=M.length-1;i>=0;i--)if(M[i]!=D[i])return!1;for(i=M.length-1;i>=0;i--)if(o=M[i],!Ar(t[o],e[o],r,n))return!1;var $=f1(t),A=f1(e);return $!==A?!1:$==="Set"||A==="Set"?$j(t,e,r,n):$==="Map"?jj(t,e,r,n):!0}var zj=function(e,r,n){return Ar(e,r,n,Lj())};const Uj=My(zj);function ok(t){var e,r,n="";if(typeof t=="string"||typeof t=="number")n+=t;else if(typeof t=="object")if(Array.isArray(t))for(e=0;e<t.length;e++)t[e]&&(r=ok(t[e]))&&(n&&(n+=" "),n+=r);else for(e in t)t[e]&&(n&&(n+=" "),n+=e);return n}function Wj(){for(var t,e,r=0,n="";r<arguments.length;)(t=arguments[r++])&&(e=ok(t))&&(n&&(n+=" "),n+=e);return n}const x1=t=>typeof t=="boolean"?"".concat(t):t===0?"0":t,S1=Wj,Vj=(t,e)=>r=>{var n;if((e==null?void 0:e.variants)==null)return S1(t,r==null?void 0:r.class,r==null?void 0:r.className);const{variants:i,defaultVariants:o}=e,s=Object.keys(i).map(c=>{const u=r==null?void 0:r[c],f=o==null?void 0:o[c];if(u===null)return null;const d=x1(u)||x1(f);return i[c][d]}),a=r&&Object.entries(r).reduce((c,u)=>{let[f,d]=u;return d===void 0||(c[f]=d),c},{}),l=e==null||(n=e.compoundVariants)===null||n===void 0?void 0:n.reduce((c,u)=>{let{class:f,className:d,...h}=u;return Object.entries(h).every(p=>{let[m,y]=p;return Array.isArray(y)?y.includes({...o,...a}[m]):{...o,...a}[m]===y})?[...c,f,d]:c},[]);return S1(t,s,l,r==null?void 0:r.class,r==null?void 0:r.className)};function Ae(t,e,{checkForDefaultPrevented:r=!0}={}){return function(i){if(t==null||t(i),r===!1||!i.defaultPrevented)return e==null?void 0:e(i)}}function nn(t,e=[]){let r=[];function n(o,s){const a=L.createContext(s),l=r.length;r=[...r,s];function c(f){const{scope:d,children:h,...p}=f,m=(d==null?void 0:d[t][l])||a,y=L.useMemo(()=>p,Object.values(p));return ee.jsx(m.Provider,{value:y,children:h})}function u(f,d){const h=(d==null?void 0:d[t][l])||a,p=L.useContext(h);if(p)return p;if(s!==void 0)return s;throw new Error(`\`${f}\` must be used within \`${o}\``)}return c.displayName=o+"Provider",[c,u]}const i=()=>{const o=r.map(s=>L.createContext(s));return function(a){const l=(a==null?void 0:a[t])||o;return L.useMemo(()=>({[`__scope${t}`]:{...a,[t]:l}}),[a,l])}};return i.scopeName=t,[n,Gj(i,...e)]}function Gj(...t){const e=t[0];if(t.length===1)return e;const r=()=>{const n=t.map(i=>({useScope:i(),scopeName:i.scopeName}));return function(o){const s=n.reduce((a,{useScope:l,scopeName:c})=>{const f=l(o)[`__scope${c}`];return{...a,...f}},{});return L.useMemo(()=>({[`__scope${e.scopeName}`]:s}),[s])}};return r.scopeName=e.scopeName,r}function Pt(t){const e=L.useRef(t);return L.useEffect(()=>{e.current=t}),L.useMemo(()=>(...r)=>{var n;return(n=e.current)==null?void 0:n.call(e,...r)},[])}function On({prop:t,defaultProp:e,onChange:r=()=>{}}){const[n,i]=Kj({defaultProp:e,onChange:r}),o=t!==void 0,s=o?t:n,a=Pt(r),l=L.useCallback(c=>{if(o){const f=typeof c=="function"?c(t):c;f!==t&&a(f)}else i(c)},[o,t,i,a]);return[s,l]}function Kj({defaultProp:t,onChange:e}){const r=L.useState(t),[n]=r,i=L.useRef(n),o=Pt(e);return L.useEffect(()=>{i.current!==n&&(o(n),i.current=n)},[n,i,o]),r}var qj=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],$e=qj.reduce((t,e)=>{const r=L.forwardRef((n,i)=>{const{asChild:o,...s}=n,a=o?ro:e;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),ee.jsx(a,{...s,ref:i})});return r.displayName=`Primitive.${e}`,{...t,[e]:r}},{});function qy(t,e){t&&wf.flushSync(()=>t.dispatchEvent(e))}function Xy(t){const e=t+"CollectionProvider",[r,n]=nn(e),[i,o]=r(e,{collectionRef:{current:null},itemMap:new Map}),s=h=>{const{scope:p,children:m}=h,y=pe.useRef(null),g=pe.useRef(new Map).current;return ee.jsx(i,{scope:p,itemMap:g,collectionRef:y,children:m})};s.displayName=e;const a=t+"CollectionSlot",l=pe.forwardRef((h,p)=>{const{scope:m,children:y}=h,g=o(a,m),b=lt(p,g.collectionRef);return ee.jsx(ro,{ref:b,children:y})});l.displayName=a;const c=t+"CollectionItemSlot",u="data-radix-collection-item",f=pe.forwardRef((h,p)=>{const{scope:m,children:y,...g}=h,b=pe.useRef(null),S=lt(p,b),x=o(c,m);return pe.useEffect(()=>(x.itemMap.set(b,{ref:b,...g}),()=>void x.itemMap.delete(b))),ee.jsx(ro,{[u]:"",ref:S,children:y})});f.displayName=c;function d(h){const p=o(t+"CollectionConsumer",h);return pe.useCallback(()=>{const y=p.collectionRef.current;if(!y)return[];const g=Array.from(y.querySelectorAll(`[${u}]`));return Array.from(p.itemMap.values()).sort((x,O)=>g.indexOf(x.ref.current)-g.indexOf(O.ref.current))},[p.collectionRef,p.itemMap])}return[{Provider:s,Slot:l,ItemSlot:f},d,n]}var Xj=L.createContext(void 0);function Jy(t){const e=L.useContext(Xj);return t||e||"ltr"}function Jj(t,e=globalThis==null?void 0:globalThis.document){const r=Pt(t);L.useEffect(()=>{const n=i=>{i.key==="Escape"&&r(i)};return e.addEventListener("keydown",n,{capture:!0}),()=>e.removeEventListener("keydown",n,{capture:!0})},[r,e])}var Yj="DismissableLayer",qm="dismissableLayer.update",Zj="dismissableLayer.pointerDownOutside",Qj="dismissableLayer.focusOutside",E1,sk=L.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),ml=L.forwardRef((t,e)=>{const{disableOutsidePointerEvents:r=!1,onEscapeKeyDown:n,onPointerDownOutside:i,onFocusOutside:o,onInteractOutside:s,onDismiss:a,...l}=t,c=L.useContext(sk),[u,f]=L.useState(null),d=(u==null?void 0:u.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,h]=L.useState({}),p=lt(e,D=>f(D)),m=Array.from(c.layers),[y]=[...c.layersWithOutsidePointerEventsDisabled].slice(-1),g=m.indexOf(y),b=u?m.indexOf(u):-1,S=c.layersWithOutsidePointerEventsDisabled.size>0,x=b>=g,O=tH(D=>{const $=D.target,A=[...c.branches].some(V=>V.contains($));!x||A||(i==null||i(D),s==null||s(D),D.defaultPrevented||a==null||a())},d),M=rH(D=>{const $=D.target;[...c.branches].some(V=>V.contains($))||(o==null||o(D),s==null||s(D),D.defaultPrevented||a==null||a())},d);return Jj(D=>{b===c.layers.size-1&&(n==null||n(D),!D.defaultPrevented&&a&&(D.preventDefault(),a()))},d),L.useEffect(()=>{if(u)return r&&(c.layersWithOutsidePointerEventsDisabled.size===0&&(E1=d.body.style.pointerEvents,d.body.style.pointerEvents="none"),c.layersWithOutsidePointerEventsDisabled.add(u)),c.layers.add(u),T1(),()=>{r&&c.layersWithOutsidePointerEventsDisabled.size===1&&(d.body.style.pointerEvents=E1)}},[u,d,r,c]),L.useEffect(()=>()=>{u&&(c.layers.delete(u),c.layersWithOutsidePointerEventsDisabled.delete(u),T1())},[u,c]),L.useEffect(()=>{const D=()=>h({});return document.addEventListener(qm,D),()=>document.removeEventListener(qm,D)},[]),ee.jsx($e.div,{...l,ref:p,style:{pointerEvents:S?x?"auto":"none":void 0,...t.style},onFocusCapture:Ae(t.onFocusCapture,M.onFocusCapture),onBlurCapture:Ae(t.onBlurCapture,M.onBlurCapture),onPointerDownCapture:Ae(t.onPointerDownCapture,O.onPointerDownCapture)})});ml.displayName=Yj;var eH="DismissableLayerBranch",ak=L.forwardRef((t,e)=>{const r=L.useContext(sk),n=L.useRef(null),i=lt(e,n);return L.useEffect(()=>{const o=n.current;if(o)return r.branches.add(o),()=>{r.branches.delete(o)}},[r.branches]),ee.jsx($e.div,{...t,ref:i})});ak.displayName=eH;function tH(t,e=globalThis==null?void 0:globalThis.document){const r=Pt(t),n=L.useRef(!1),i=L.useRef(()=>{});return L.useEffect(()=>{const o=a=>{if(a.target&&!n.current){let l=function(){lk(Zj,r,c,{discrete:!0})};const c={originalEvent:a};a.pointerType==="touch"?(e.removeEventListener("click",i.current),i.current=l,e.addEventListener("click",i.current,{once:!0})):l()}else e.removeEventListener("click",i.current);n.current=!1},s=window.setTimeout(()=>{e.addEventListener("pointerdown",o)},0);return()=>{window.clearTimeout(s),e.removeEventListener("pointerdown",o),e.removeEventListener("click",i.current)}},[e,r]),{onPointerDownCapture:()=>n.current=!0}}function rH(t,e=globalThis==null?void 0:globalThis.document){const r=Pt(t),n=L.useRef(!1);return L.useEffect(()=>{const i=o=>{o.target&&!n.current&&lk(Qj,r,{originalEvent:o},{discrete:!1})};return e.addEventListener("focusin",i),()=>e.removeEventListener("focusin",i)},[e,r]),{onFocusCapture:()=>n.current=!0,onBlurCapture:()=>n.current=!1}}function T1(){const t=new CustomEvent(qm);document.dispatchEvent(t)}function lk(t,e,r,{discrete:n}){const i=r.originalEvent.target,o=new CustomEvent(t,{bubbles:!1,cancelable:!0,detail:r});e&&i.addEventListener(t,e,{once:!0}),n?qy(i,o):i.dispatchEvent(o)}var nH=ml,iH=ak,vh=0;function ck(){L.useEffect(()=>{const t=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",t[0]??A1()),document.body.insertAdjacentElement("beforeend",t[1]??A1()),vh++,()=>{vh===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(e=>e.remove()),vh--}},[])}function A1(){const t=document.createElement("span");return t.setAttribute("data-radix-focus-guard",""),t.tabIndex=0,t.style.cssText="outline: none; opacity: 0; position: fixed; pointer-events: none",t}var wh="focusScope.autoFocusOnMount",bh="focusScope.autoFocusOnUnmount",C1={bubbles:!1,cancelable:!0},oH="FocusScope",Yy=L.forwardRef((t,e)=>{const{loop:r=!1,trapped:n=!1,onMountAutoFocus:i,onUnmountAutoFocus:o,...s}=t,[a,l]=L.useState(null),c=Pt(i),u=Pt(o),f=L.useRef(null),d=lt(e,m=>l(m)),h=L.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;L.useEffect(()=>{if(n){let m=function(S){if(h.paused||!a)return;const x=S.target;a.contains(x)?f.current=x:Wn(f.current,{select:!0})},y=function(S){if(h.paused||!a)return;const x=S.relatedTarget;x!==null&&(a.contains(x)||Wn(f.current,{select:!0}))},g=function(S){if(document.activeElement===document.body)for(const O of S)O.removedNodes.length>0&&Wn(a)};document.addEventListener("focusin",m),document.addEventListener("focusout",y);const b=new MutationObserver(g);return a&&b.observe(a,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",m),document.removeEventListener("focusout",y),b.disconnect()}}},[n,a,h.paused]),L.useEffect(()=>{if(a){_1.add(h);const m=document.activeElement;if(!a.contains(m)){const g=new CustomEvent(wh,C1);a.addEventListener(wh,c),a.dispatchEvent(g),g.defaultPrevented||(sH(fH(uk(a)),{select:!0}),document.activeElement===m&&Wn(a))}return()=>{a.removeEventListener(wh,c),setTimeout(()=>{const g=new CustomEvent(bh,C1);a.addEventListener(bh,u),a.dispatchEvent(g),g.defaultPrevented||Wn(m??document.body,{select:!0}),a.removeEventListener(bh,u),_1.remove(h)},0)}}},[a,c,u,h]);const p=L.useCallback(m=>{if(!r&&!n||h.paused)return;const y=m.key==="Tab"&&!m.altKey&&!m.ctrlKey&&!m.metaKey,g=document.activeElement;if(y&&g){const b=m.currentTarget,[S,x]=aH(b);S&&x?!m.shiftKey&&g===x?(m.preventDefault(),r&&Wn(S,{select:!0})):m.shiftKey&&g===S&&(m.preventDefault(),r&&Wn(x,{select:!0})):g===b&&m.preventDefault()}},[r,n,h.paused]);return ee.jsx($e.div,{tabIndex:-1,...s,ref:d,onKeyDown:p})});Yy.displayName=oH;function sH(t,{select:e=!1}={}){const r=document.activeElement;for(const n of t)if(Wn(n,{select:e}),document.activeElement!==r)return}function aH(t){const e=uk(t),r=k1(e,t),n=k1(e.reverse(),t);return[r,n]}function uk(t){const e=[],r=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,{acceptNode:n=>{const i=n.tagName==="INPUT"&&n.type==="hidden";return n.disabled||n.hidden||i?NodeFilter.FILTER_SKIP:n.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;r.nextNode();)e.push(r.currentNode);return e}function k1(t,e){for(const r of t)if(!lH(r,{upTo:e}))return r}function lH(t,{upTo:e}){if(getComputedStyle(t).visibility==="hidden")return!0;for(;t;){if(e!==void 0&&t===e)return!1;if(getComputedStyle(t).display==="none")return!0;t=t.parentElement}return!1}function cH(t){return t instanceof HTMLInputElement&&"select"in t}function Wn(t,{select:e=!1}={}){if(t&&t.focus){const r=document.activeElement;t.focus({preventScroll:!0}),t!==r&&cH(t)&&e&&t.select()}}var _1=uH();function uH(){let t=[];return{add(e){const r=t[0];e!==r&&(r==null||r.pause()),t=O1(t,e),t.unshift(e)},remove(e){var r;t=O1(t,e),(r=t[0])==null||r.resume()}}}function O1(t,e){const r=[...t],n=r.indexOf(e);return n!==-1&&r.splice(n,1),r}function fH(t){return t.filter(e=>e.tagName!=="A")}var hi=globalThis!=null&&globalThis.document?L.useLayoutEffect:()=>{},dH=L.useId||(()=>{}),hH=0;function pi(t){const[e,r]=L.useState(dH());return hi(()=>{t||r(n=>n??String(hH++))},[t]),t||(e?`radix-${e}`:"")}const pH=["top","right","bottom","left"],Wr=Math.min,er=Math.max,xu=Math.round,$l=Math.floor,mi=t=>({x:t,y:t}),mH={left:"right",right:"left",bottom:"top",top:"bottom"},gH={start:"end",end:"start"};function Xm(t,e,r){return er(t,Wr(e,r))}function An(t,e){return typeof t=="function"?t(e):t}function Cn(t){return t.split("-")[0]}function Ns(t){return t.split("-")[1]}function Zy(t){return t==="x"?"y":"x"}function Qy(t){return t==="y"?"height":"width"}function gi(t){return["top","bottom"].includes(Cn(t))?"y":"x"}function ev(t){return Zy(gi(t))}function yH(t,e,r){r===void 0&&(r=!1);const n=Ns(t),i=ev(t),o=Qy(i);let s=i==="x"?n===(r?"end":"start")?"right":"left":n==="start"?"bottom":"top";return e.reference[o]>e.floating[o]&&(s=Su(s)),[s,Su(s)]}function vH(t){const e=Su(t);return[Jm(t),e,Jm(e)]}function Jm(t){return t.replace(/start|end/g,e=>gH[e])}function wH(t,e,r){const n=["left","right"],i=["right","left"],o=["top","bottom"],s=["bottom","top"];switch(t){case"top":case"bottom":return r?e?i:n:e?n:i;case"left":case"right":return e?o:s;default:return[]}}function bH(t,e,r,n){const i=Ns(t);let o=wH(Cn(t),r==="start",n);return i&&(o=o.map(s=>s+"-"+i),e&&(o=o.concat(o.map(Jm)))),o}function Su(t){return t.replace(/left|right|bottom|top/g,e=>mH[e])}function xH(t){return{top:0,right:0,bottom:0,left:0,...t}}function fk(t){return typeof t!="number"?xH(t):{top:t,right:t,bottom:t,left:t}}function Eu(t){const{x:e,y:r,width:n,height:i}=t;return{width:n,height:i,top:r,left:e,right:e+n,bottom:r+i,x:e,y:r}}function R1(t,e,r){let{reference:n,floating:i}=t;const o=gi(e),s=ev(e),a=Qy(s),l=Cn(e),c=o==="y",u=n.x+n.width/2-i.width/2,f=n.y+n.height/2-i.height/2,d=n[a]/2-i[a]/2;let h;switch(l){case"top":h={x:u,y:n.y-i.height};break;case"bottom":h={x:u,y:n.y+n.height};break;case"right":h={x:n.x+n.width,y:f};break;case"left":h={x:n.x-i.width,y:f};break;default:h={x:n.x,y:n.y}}switch(Ns(e)){case"start":h[s]-=d*(r&&c?-1:1);break;case"end":h[s]+=d*(r&&c?-1:1);break}return h}const SH=async(t,e,r)=>{const{placement:n="bottom",strategy:i="absolute",middleware:o=[],platform:s}=r,a=o.filter(Boolean),l=await(s.isRTL==null?void 0:s.isRTL(e));let c=await s.getElementRects({reference:t,floating:e,strategy:i}),{x:u,y:f}=R1(c,n,l),d=n,h={},p=0;for(let m=0;m<a.length;m++){const{name:y,fn:g}=a[m],{x:b,y:S,data:x,reset:O}=await g({x:u,y:f,initialPlacement:n,placement:d,strategy:i,middlewareData:h,rects:c,platform:s,elements:{reference:t,floating:e}});u=b??u,f=S??f,h={...h,[y]:{...h[y],...x}},O&&p<=50&&(p++,typeof O=="object"&&(O.placement&&(d=O.placement),O.rects&&(c=O.rects===!0?await s.getElementRects({reference:t,floating:e,strategy:i}):O.rects),{x:u,y:f}=R1(c,d,l)),m=-1)}return{x:u,y:f,placement:d,strategy:i,middlewareData:h}};async function za(t,e){var r;e===void 0&&(e={});const{x:n,y:i,platform:o,rects:s,elements:a,strategy:l}=t,{boundary:c="clippingAncestors",rootBoundary:u="viewport",elementContext:f="floating",altBoundary:d=!1,padding:h=0}=An(e,t),p=fk(h),y=a[d?f==="floating"?"reference":"floating":f],g=Eu(await o.getClippingRect({element:(r=await(o.isElement==null?void 0:o.isElement(y)))==null||r?y:y.contextElement||await(o.getDocumentElement==null?void 0:o.getDocumentElement(a.floating)),boundary:c,rootBoundary:u,strategy:l})),b=f==="floating"?{x:n,y:i,width:s.floating.width,height:s.floating.height}:s.reference,S=await(o.getOffsetParent==null?void 0:o.getOffsetParent(a.floating)),x=await(o.isElement==null?void 0:o.isElement(S))?await(o.getScale==null?void 0:o.getScale(S))||{x:1,y:1}:{x:1,y:1},O=Eu(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:b,offsetParent:S,strategy:l}):b);return{top:(g.top-O.top+p.top)/x.y,bottom:(O.bottom-g.bottom+p.bottom)/x.y,left:(g.left-O.left+p.left)/x.x,right:(O.right-g.right+p.right)/x.x}}const EH=t=>({name:"arrow",options:t,async fn(e){const{x:r,y:n,placement:i,rects:o,platform:s,elements:a,middlewareData:l}=e,{element:c,padding:u=0}=An(t,e)||{};if(c==null)return{};const f=fk(u),d={x:r,y:n},h=ev(i),p=Qy(h),m=await s.getDimensions(c),y=h==="y",g=y?"top":"left",b=y?"bottom":"right",S=y?"clientHeight":"clientWidth",x=o.reference[p]+o.reference[h]-d[h]-o.floating[p],O=d[h]-o.reference[h],M=await(s.getOffsetParent==null?void 0:s.getOffsetParent(c));let D=M?M[S]:0;(!D||!await(s.isElement==null?void 0:s.isElement(M)))&&(D=a.floating[S]||o.floating[p]);const $=x/2-O/2,A=D/2-m[p]/2-1,V=Wr(f[g],A),Q=Wr(f[b],A),I=V,U=D-m[p]-Q,k=D/2-m[p]/2+$,G=Xm(I,k,U),te=!l.arrow&&Ns(i)!=null&&k!==G&&o.reference[p]/2-(k<I?V:Q)-m[p]/2<0,W=te?k<I?k-I:k-U:0;return{[h]:d[h]+W,data:{[h]:G,centerOffset:k-G-W,...te&&{alignmentOffset:W}},reset:te}}}),TH=function(t){return t===void 0&&(t={}),{name:"flip",options:t,async fn(e){var r,n;const{placement:i,middlewareData:o,rects:s,initialPlacement:a,platform:l,elements:c}=e,{mainAxis:u=!0,crossAxis:f=!0,fallbackPlacements:d,fallbackStrategy:h="bestFit",fallbackAxisSideDirection:p="none",flipAlignment:m=!0,...y}=An(t,e);if((r=o.arrow)!=null&&r.alignmentOffset)return{};const g=Cn(i),b=gi(a),S=Cn(a)===a,x=await(l.isRTL==null?void 0:l.isRTL(c.floating)),O=d||(S||!m?[Su(a)]:vH(a)),M=p!=="none";!d&&M&&O.push(...bH(a,m,p,x));const D=[a,...O],$=await za(e,y),A=[];let V=((n=o.flip)==null?void 0:n.overflows)||[];if(u&&A.push($[g]),f){const k=yH(i,s,x);A.push($[k[0]],$[k[1]])}if(V=[...V,{placement:i,overflows:A}],!A.every(k=>k<=0)){var Q,I;const k=(((Q=o.flip)==null?void 0:Q.index)||0)+1,G=D[k];if(G)return{data:{index:k,overflows:V},reset:{placement:G}};let te=(I=V.filter(W=>W.overflows[0]<=0).sort((W,ae)=>W.overflows[1]-ae.overflows[1])[0])==null?void 0:I.placement;if(!te)switch(h){case"bestFit":{var U;const W=(U=V.filter(ae=>{if(M){const X=gi(ae.placement);return X===b||X==="y"}return!0}).map(ae=>[ae.placement,ae.overflows.filter(X=>X>0).reduce((X,de)=>X+de,0)]).sort((ae,X)=>ae[1]-X[1])[0])==null?void 0:U[0];W&&(te=W);break}case"initialPlacement":te=a;break}if(i!==te)return{reset:{placement:te}}}return{}}}};function M1(t,e){return{top:t.top-e.height,right:t.right-e.width,bottom:t.bottom-e.height,left:t.left-e.width}}function I1(t){return pH.some(e=>t[e]>=0)}const AH=function(t){return t===void 0&&(t={}),{name:"hide",options:t,async fn(e){const{rects:r}=e,{strategy:n="referenceHidden",...i}=An(t,e);switch(n){case"referenceHidden":{const o=await za(e,{...i,elementContext:"reference"}),s=M1(o,r.reference);return{data:{referenceHiddenOffsets:s,referenceHidden:I1(s)}}}case"escaped":{const o=await za(e,{...i,altBoundary:!0}),s=M1(o,r.floating);return{data:{escapedOffsets:s,escaped:I1(s)}}}default:return{}}}}};async function CH(t,e){const{placement:r,platform:n,elements:i}=t,o=await(n.isRTL==null?void 0:n.isRTL(i.floating)),s=Cn(r),a=Ns(r),l=gi(r)==="y",c=["left","top"].includes(s)?-1:1,u=o&&l?-1:1,f=An(e,t);let{mainAxis:d,crossAxis:h,alignmentAxis:p}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...f};return a&&typeof p=="number"&&(h=a==="end"?p*-1:p),l?{x:h*u,y:d*c}:{x:d*c,y:h*u}}const kH=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(e){var r,n;const{x:i,y:o,placement:s,middlewareData:a}=e,l=await CH(e,t);return s===((r=a.offset)==null?void 0:r.placement)&&(n=a.arrow)!=null&&n.alignmentOffset?{}:{x:i+l.x,y:o+l.y,data:{...l,placement:s}}}}},_H=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(e){const{x:r,y:n,placement:i}=e,{mainAxis:o=!0,crossAxis:s=!1,limiter:a={fn:y=>{let{x:g,y:b}=y;return{x:g,y:b}}},...l}=An(t,e),c={x:r,y:n},u=await za(e,l),f=gi(Cn(i)),d=Zy(f);let h=c[d],p=c[f];if(o){const y=d==="y"?"top":"left",g=d==="y"?"bottom":"right",b=h+u[y],S=h-u[g];h=Xm(b,h,S)}if(s){const y=f==="y"?"top":"left",g=f==="y"?"bottom":"right",b=p+u[y],S=p-u[g];p=Xm(b,p,S)}const m=a.fn({...e,[d]:h,[f]:p});return{...m,data:{x:m.x-r,y:m.y-n}}}}},OH=function(t){return t===void 0&&(t={}),{options:t,fn(e){const{x:r,y:n,placement:i,rects:o,middlewareData:s}=e,{offset:a=0,mainAxis:l=!0,crossAxis:c=!0}=An(t,e),u={x:r,y:n},f=gi(i),d=Zy(f);let h=u[d],p=u[f];const m=An(a,e),y=typeof m=="number"?{mainAxis:m,crossAxis:0}:{mainAxis:0,crossAxis:0,...m};if(l){const S=d==="y"?"height":"width",x=o.reference[d]-o.floating[S]+y.mainAxis,O=o.reference[d]+o.reference[S]-y.mainAxis;h<x?h=x:h>O&&(h=O)}if(c){var g,b;const S=d==="y"?"width":"height",x=["top","left"].includes(Cn(i)),O=o.reference[f]-o.floating[S]+(x&&((g=s.offset)==null?void 0:g[f])||0)+(x?0:y.crossAxis),M=o.reference[f]+o.reference[S]+(x?0:((b=s.offset)==null?void 0:b[f])||0)-(x?y.crossAxis:0);p<O?p=O:p>M&&(p=M)}return{[d]:h,[f]:p}}}},RH=function(t){return t===void 0&&(t={}),{name:"size",options:t,async fn(e){const{placement:r,rects:n,platform:i,elements:o}=e,{apply:s=()=>{},...a}=An(t,e),l=await za(e,a),c=Cn(r),u=Ns(r),f=gi(r)==="y",{width:d,height:h}=n.floating;let p,m;c==="top"||c==="bottom"?(p=c,m=u===(await(i.isRTL==null?void 0:i.isRTL(o.floating))?"start":"end")?"left":"right"):(m=c,p=u==="end"?"top":"bottom");const y=h-l.top-l.bottom,g=d-l.left-l.right,b=Wr(h-l[p],y),S=Wr(d-l[m],g),x=!e.middlewareData.shift;let O=b,M=S;if(f?M=u||x?Wr(S,g):g:O=u||x?Wr(b,y):y,x&&!u){const $=er(l.left,0),A=er(l.right,0),V=er(l.top,0),Q=er(l.bottom,0);f?M=d-2*($!==0||A!==0?$+A:er(l.left,l.right)):O=h-2*(V!==0||Q!==0?V+Q:er(l.top,l.bottom))}await s({...e,availableWidth:M,availableHeight:O});const D=await i.getDimensions(o.floating);return d!==D.width||h!==D.height?{reset:{rects:!0}}:{}}}};function Ds(t){return dk(t)?(t.nodeName||"").toLowerCase():"#document"}function ir(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function Rn(t){var e;return(e=(dk(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function dk(t){return t instanceof Node||t instanceof ir(t).Node}function kr(t){return t instanceof Element||t instanceof ir(t).Element}function Zr(t){return t instanceof HTMLElement||t instanceof ir(t).HTMLElement}function N1(t){return typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof ir(t).ShadowRoot}function gl(t){const{overflow:e,overflowX:r,overflowY:n,display:i}=_r(t);return/auto|scroll|overlay|hidden|clip/.test(e+n+r)&&!["inline","contents"].includes(i)}function MH(t){return["table","td","th"].includes(Ds(t))}function Hf(t){return[":popover-open",":modal"].some(e=>{try{return t.matches(e)}catch{return!1}})}function tv(t){const e=rv(),r=kr(t)?_r(t):t;return r.transform!=="none"||r.perspective!=="none"||(r.containerType?r.containerType!=="normal":!1)||!e&&(r.backdropFilter?r.backdropFilter!=="none":!1)||!e&&(r.filter?r.filter!=="none":!1)||["transform","perspective","filter"].some(n=>(r.willChange||"").includes(n))||["paint","layout","strict","content"].some(n=>(r.contain||"").includes(n))}function IH(t){let e=yi(t);for(;Zr(e)&&!gs(e);){if(tv(e))return e;if(Hf(e))return null;e=yi(e)}return null}function rv(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function gs(t){return["html","body","#document"].includes(Ds(t))}function _r(t){return ir(t).getComputedStyle(t)}function zf(t){return kr(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function yi(t){if(Ds(t)==="html")return t;const e=t.assignedSlot||t.parentNode||N1(t)&&t.host||Rn(t);return N1(e)?e.host:e}function hk(t){const e=yi(t);return gs(e)?t.ownerDocument?t.ownerDocument.body:t.body:Zr(e)&&gl(e)?e:hk(e)}function Ua(t,e,r){var n;e===void 0&&(e=[]),r===void 0&&(r=!0);const i=hk(t),o=i===((n=t.ownerDocument)==null?void 0:n.body),s=ir(i);return o?e.concat(s,s.visualViewport||[],gl(i)?i:[],s.frameElement&&r?Ua(s.frameElement):[]):e.concat(i,Ua(i,[],r))}function pk(t){const e=_r(t);let r=parseFloat(e.width)||0,n=parseFloat(e.height)||0;const i=Zr(t),o=i?t.offsetWidth:r,s=i?t.offsetHeight:n,a=xu(r)!==o||xu(n)!==s;return a&&(r=o,n=s),{width:r,height:n,$:a}}function nv(t){return kr(t)?t:t.contextElement}function Jo(t){const e=nv(t);if(!Zr(e))return mi(1);const r=e.getBoundingClientRect(),{width:n,height:i,$:o}=pk(e);let s=(o?xu(r.width):r.width)/n,a=(o?xu(r.height):r.height)/i;return(!s||!Number.isFinite(s))&&(s=1),(!a||!Number.isFinite(a))&&(a=1),{x:s,y:a}}const NH=mi(0);function mk(t){const e=ir(t);return!rv()||!e.visualViewport?NH:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function DH(t,e,r){return e===void 0&&(e=!1),!r||e&&r!==ir(t)?!1:e}function io(t,e,r,n){e===void 0&&(e=!1),r===void 0&&(r=!1);const i=t.getBoundingClientRect(),o=nv(t);let s=mi(1);e&&(n?kr(n)&&(s=Jo(n)):s=Jo(t));const a=DH(o,r,n)?mk(o):mi(0);let l=(i.left+a.x)/s.x,c=(i.top+a.y)/s.y,u=i.width/s.x,f=i.height/s.y;if(o){const d=ir(o),h=n&&kr(n)?ir(n):n;let p=d,m=p.frameElement;for(;m&&n&&h!==p;){const y=Jo(m),g=m.getBoundingClientRect(),b=_r(m),S=g.left+(m.clientLeft+parseFloat(b.paddingLeft))*y.x,x=g.top+(m.clientTop+parseFloat(b.paddingTop))*y.y;l*=y.x,c*=y.y,u*=y.x,f*=y.y,l+=S,c+=x,p=ir(m),m=p.frameElement}}return Eu({width:u,height:f,x:l,y:c})}function PH(t){let{elements:e,rect:r,offsetParent:n,strategy:i}=t;const o=i==="fixed",s=Rn(n),a=e?Hf(e.floating):!1;if(n===s||a&&o)return r;let l={scrollLeft:0,scrollTop:0},c=mi(1);const u=mi(0),f=Zr(n);if((f||!f&&!o)&&((Ds(n)!=="body"||gl(s))&&(l=zf(n)),Zr(n))){const d=io(n);c=Jo(n),u.x=d.x+n.clientLeft,u.y=d.y+n.clientTop}return{width:r.width*c.x,height:r.height*c.y,x:r.x*c.x-l.scrollLeft*c.x+u.x,y:r.y*c.y-l.scrollTop*c.y+u.y}}function LH(t){return Array.from(t.getClientRects())}function gk(t){return io(Rn(t)).left+zf(t).scrollLeft}function FH(t){const e=Rn(t),r=zf(t),n=t.ownerDocument.body,i=er(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),o=er(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight);let s=-r.scrollLeft+gk(t);const a=-r.scrollTop;return _r(n).direction==="rtl"&&(s+=er(e.clientWidth,n.clientWidth)-i),{width:i,height:o,x:s,y:a}}function BH(t,e){const r=ir(t),n=Rn(t),i=r.visualViewport;let o=n.clientWidth,s=n.clientHeight,a=0,l=0;if(i){o=i.width,s=i.height;const c=rv();(!c||c&&e==="fixed")&&(a=i.offsetLeft,l=i.offsetTop)}return{width:o,height:s,x:a,y:l}}function $H(t,e){const r=io(t,!0,e==="fixed"),n=r.top+t.clientTop,i=r.left+t.clientLeft,o=Zr(t)?Jo(t):mi(1),s=t.clientWidth*o.x,a=t.clientHeight*o.y,l=i*o.x,c=n*o.y;return{width:s,height:a,x:l,y:c}}function D1(t,e,r){let n;if(e==="viewport")n=BH(t,r);else if(e==="document")n=FH(Rn(t));else if(kr(e))n=$H(e,r);else{const i=mk(t);n={...e,x:e.x-i.x,y:e.y-i.y}}return Eu(n)}function yk(t,e){const r=yi(t);return r===e||!kr(r)||gs(r)?!1:_r(r).position==="fixed"||yk(r,e)}function jH(t,e){const r=e.get(t);if(r)return r;let n=Ua(t,[],!1).filter(a=>kr(a)&&Ds(a)!=="body"),i=null;const o=_r(t).position==="fixed";let s=o?yi(t):t;for(;kr(s)&&!gs(s);){const a=_r(s),l=tv(s);!l&&a.position==="fixed"&&(i=null),(o?!l&&!i:!l&&a.position==="static"&&!!i&&["absolute","fixed"].includes(i.position)||gl(s)&&!l&&yk(t,s))?n=n.filter(u=>u!==s):i=a,s=yi(s)}return e.set(t,n),n}function HH(t){let{element:e,boundary:r,rootBoundary:n,strategy:i}=t;const s=[...r==="clippingAncestors"?Hf(e)?[]:jH(e,this._c):[].concat(r),n],a=s[0],l=s.reduce((c,u)=>{const f=D1(e,u,i);return c.top=er(f.top,c.top),c.right=Wr(f.right,c.right),c.bottom=Wr(f.bottom,c.bottom),c.left=er(f.left,c.left),c},D1(e,a,i));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function zH(t){const{width:e,height:r}=pk(t);return{width:e,height:r}}function UH(t,e,r){const n=Zr(e),i=Rn(e),o=r==="fixed",s=io(t,!0,o,e);let a={scrollLeft:0,scrollTop:0};const l=mi(0);if(n||!n&&!o)if((Ds(e)!=="body"||gl(i))&&(a=zf(e)),n){const f=io(e,!0,o,e);l.x=f.x+e.clientLeft,l.y=f.y+e.clientTop}else i&&(l.x=gk(i));const c=s.left+a.scrollLeft-l.x,u=s.top+a.scrollTop-l.y;return{x:c,y:u,width:s.width,height:s.height}}function xh(t){return _r(t).position==="static"}function P1(t,e){return!Zr(t)||_r(t).position==="fixed"?null:e?e(t):t.offsetParent}function vk(t,e){const r=ir(t);if(Hf(t))return r;if(!Zr(t)){let i=yi(t);for(;i&&!gs(i);){if(kr(i)&&!xh(i))return i;i=yi(i)}return r}let n=P1(t,e);for(;n&&MH(n)&&xh(n);)n=P1(n,e);return n&&gs(n)&&xh(n)&&!tv(n)?r:n||IH(t)||r}const WH=async function(t){const e=this.getOffsetParent||vk,r=this.getDimensions,n=await r(t.floating);return{reference:UH(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:n.width,height:n.height}}};function VH(t){return _r(t).direction==="rtl"}const GH={convertOffsetParentRelativeRectToViewportRelativeRect:PH,getDocumentElement:Rn,getClippingRect:HH,getOffsetParent:vk,getElementRects:WH,getClientRects:LH,getDimensions:zH,getScale:Jo,isElement:kr,isRTL:VH};function KH(t,e){let r=null,n;const i=Rn(t);function o(){var a;clearTimeout(n),(a=r)==null||a.disconnect(),r=null}function s(a,l){a===void 0&&(a=!1),l===void 0&&(l=1),o();const{left:c,top:u,width:f,height:d}=t.getBoundingClientRect();if(a||e(),!f||!d)return;const h=$l(u),p=$l(i.clientWidth-(c+f)),m=$l(i.clientHeight-(u+d)),y=$l(c),b={rootMargin:-h+"px "+-p+"px "+-m+"px "+-y+"px",threshold:er(0,Wr(1,l))||1};let S=!0;function x(O){const M=O[0].intersectionRatio;if(M!==l){if(!S)return s();M?s(!1,M):n=setTimeout(()=>{s(!1,1e-7)},1e3)}S=!1}try{r=new IntersectionObserver(x,{...b,root:i.ownerDocument})}catch{r=new IntersectionObserver(x,b)}r.observe(t)}return s(!0),o}function qH(t,e,r,n){n===void 0&&(n={});const{ancestorScroll:i=!0,ancestorResize:o=!0,elementResize:s=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:l=!1}=n,c=nv(t),u=i||o?[...c?Ua(c):[],...Ua(e)]:[];u.forEach(g=>{i&&g.addEventListener("scroll",r,{passive:!0}),o&&g.addEventListener("resize",r)});const f=c&&a?KH(c,r):null;let d=-1,h=null;s&&(h=new ResizeObserver(g=>{let[b]=g;b&&b.target===c&&h&&(h.unobserve(e),cancelAnimationFrame(d),d=requestAnimationFrame(()=>{var S;(S=h)==null||S.observe(e)})),r()}),c&&!l&&h.observe(c),h.observe(e));let p,m=l?io(t):null;l&&y();function y(){const g=io(t);m&&(g.x!==m.x||g.y!==m.y||g.width!==m.width||g.height!==m.height)&&r(),m=g,p=requestAnimationFrame(y)}return r(),()=>{var g;u.forEach(b=>{i&&b.removeEventListener("scroll",r),o&&b.removeEventListener("resize",r)}),f==null||f(),(g=h)==null||g.disconnect(),h=null,l&&cancelAnimationFrame(p)}}const XH=kH,JH=_H,YH=TH,ZH=RH,QH=AH,L1=EH,ez=OH,tz=(t,e,r)=>{const n=new Map,i={platform:GH,...r},o={...i.platform,_c:n};return SH(t,e,{...i,platform:o})};var Mc=typeof document<"u"?pe.useLayoutEffect:pe.useEffect;function Tu(t,e){if(t===e)return!0;if(typeof t!=typeof e)return!1;if(typeof t=="function"&&t.toString()===e.toString())return!0;let r,n,i;if(t&&e&&typeof t=="object"){if(Array.isArray(t)){if(r=t.length,r!==e.length)return!1;for(n=r;n--!==0;)if(!Tu(t[n],e[n]))return!1;return!0}if(i=Object.keys(t),r=i.length,r!==Object.keys(e).length)return!1;for(n=r;n--!==0;)if(!{}.hasOwnProperty.call(e,i[n]))return!1;for(n=r;n--!==0;){const o=i[n];if(!(o==="_owner"&&t.$$typeof)&&!Tu(t[o],e[o]))return!1}return!0}return t!==t&&e!==e}function wk(t){return typeof window>"u"?1:(t.ownerDocument.defaultView||window).devicePixelRatio||1}function F1(t,e){const r=wk(t);return Math.round(e*r)/r}function B1(t){const e=L.useRef(t);return Mc(()=>{e.current=t}),e}function rz(t){t===void 0&&(t={});const{placement:e="bottom",strategy:r="absolute",middleware:n=[],platform:i,elements:{reference:o,floating:s}={},transform:a=!0,whileElementsMounted:l,open:c}=t,[u,f]=L.useState({x:0,y:0,strategy:r,placement:e,middlewareData:{},isPositioned:!1}),[d,h]=L.useState(n);Tu(d,n)||h(n);const[p,m]=L.useState(null),[y,g]=L.useState(null),b=L.useCallback(W=>{W!==M.current&&(M.current=W,m(W))},[]),S=L.useCallback(W=>{W!==D.current&&(D.current=W,g(W))},[]),x=o||p,O=s||y,M=L.useRef(null),D=L.useRef(null),$=L.useRef(u),A=l!=null,V=B1(l),Q=B1(i),I=L.useCallback(()=>{if(!M.current||!D.current)return;const W={placement:e,strategy:r,middleware:d};Q.current&&(W.platform=Q.current),tz(M.current,D.current,W).then(ae=>{const X={...ae,isPositioned:!0};U.current&&!Tu($.current,X)&&($.current=X,wf.flushSync(()=>{f(X)}))})},[d,e,r,Q]);Mc(()=>{c===!1&&$.current.isPositioned&&($.current.isPositioned=!1,f(W=>({...W,isPositioned:!1})))},[c]);const U=L.useRef(!1);Mc(()=>(U.current=!0,()=>{U.current=!1}),[]),Mc(()=>{if(x&&(M.current=x),O&&(D.current=O),x&&O){if(V.current)return V.current(x,O,I);I()}},[x,O,I,V,A]);const k=L.useMemo(()=>({reference:M,floating:D,setReference:b,setFloating:S}),[b,S]),G=L.useMemo(()=>({reference:x,floating:O}),[x,O]),te=L.useMemo(()=>{const W={position:r,left:0,top:0};if(!G.floating)return W;const ae=F1(G.floating,u.x),X=F1(G.floating,u.y);return a?{...W,transform:"translate("+ae+"px, "+X+"px)",...wk(G.floating)>=1.5&&{willChange:"transform"}}:{position:r,left:ae,top:X}},[r,a,G.floating,u.x,u.y]);return L.useMemo(()=>({...u,update:I,refs:k,elements:G,floatingStyles:te}),[u,I,k,G,te])}const nz=t=>{function e(r){return{}.hasOwnProperty.call(r,"current")}return{name:"arrow",options:t,fn(r){const{element:n,padding:i}=typeof t=="function"?t(r):t;return n&&e(n)?n.current!=null?L1({element:n.current,padding:i}).fn(r):{}:n?L1({element:n,padding:i}).fn(r):{}}}},iz=(t,e)=>({...XH(t),options:[t,e]}),oz=(t,e)=>({...JH(t),options:[t,e]}),sz=(t,e)=>({...ez(t),options:[t,e]}),az=(t,e)=>({...YH(t),options:[t,e]}),lz=(t,e)=>({...ZH(t),options:[t,e]}),cz=(t,e)=>({...QH(t),options:[t,e]}),uz=(t,e)=>({...nz(t),options:[t,e]});var fz="Arrow",bk=L.forwardRef((t,e)=>{const{children:r,width:n=10,height:i=5,...o}=t;return ee.jsx($e.svg,{...o,ref:e,width:n,height:i,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:t.asChild?r:ee.jsx("polygon",{points:"0,0 30,0 15,10"})})});bk.displayName=fz;var dz=bk;function xk(t){const[e,r]=L.useState(void 0);return hi(()=>{if(t){r({width:t.offsetWidth,height:t.offsetHeight});const n=new ResizeObserver(i=>{if(!Array.isArray(i)||!i.length)return;const o=i[0];let s,a;if("borderBoxSize"in o){const l=o.borderBoxSize,c=Array.isArray(l)?l[0]:l;s=c.inlineSize,a=c.blockSize}else s=t.offsetWidth,a=t.offsetHeight;r({width:s,height:a})});return n.observe(t,{box:"border-box"}),()=>n.unobserve(t)}else r(void 0)},[t]),e}var iv="Popper",[Sk,Ps]=nn(iv),[hz,Ek]=Sk(iv),Tk=t=>{const{__scopePopper:e,children:r}=t,[n,i]=L.useState(null);return ee.jsx(hz,{scope:e,anchor:n,onAnchorChange:i,children:r})};Tk.displayName=iv;var Ak="PopperAnchor",Ck=L.forwardRef((t,e)=>{const{__scopePopper:r,virtualRef:n,...i}=t,o=Ek(Ak,r),s=L.useRef(null),a=lt(e,s);return L.useEffect(()=>{o.onAnchorChange((n==null?void 0:n.current)||s.current)}),n?null:ee.jsx($e.div,{...i,ref:a})});Ck.displayName=Ak;var ov="PopperContent",[pz,mz]=Sk(ov),kk=L.forwardRef((t,e)=>{var _,C,z,j,P,F;const{__scopePopper:r,side:n="bottom",sideOffset:i=0,align:o="center",alignOffset:s=0,arrowPadding:a=0,avoidCollisions:l=!0,collisionBoundary:c=[],collisionPadding:u=0,sticky:f="partial",hideWhenDetached:d=!1,updatePositionStrategy:h="optimized",onPlaced:p,...m}=t,y=Ek(ov,r),[g,b]=L.useState(null),S=lt(e,ne=>b(ne)),[x,O]=L.useState(null),M=xk(x),D=(M==null?void 0:M.width)??0,$=(M==null?void 0:M.height)??0,A=n+(o!=="center"?"-"+o:""),V=typeof u=="number"?u:{top:0,right:0,bottom:0,left:0,...u},Q=Array.isArray(c)?c:[c],I=Q.length>0,U={padding:V,boundary:Q.filter(yz),altBoundary:I},{refs:k,floatingStyles:G,placement:te,isPositioned:W,middlewareData:ae}=rz({strategy:"fixed",placement:A,whileElementsMounted:(...ne)=>qH(...ne,{animationFrame:h==="always"}),elements:{reference:y.anchor},middleware:[iz({mainAxis:i+$,alignmentAxis:s}),l&&oz({mainAxis:!0,crossAxis:!1,limiter:f==="partial"?sz():void 0,...U}),l&&az({...U}),lz({...U,apply:({elements:ne,rects:T,availableWidth:re,availableHeight:R})=>{const{width:v,height:w}=T.reference,E=ne.floating.style;E.setProperty("--radix-popper-available-width",`${re}px`),E.setProperty("--radix-popper-available-height",`${R}px`),E.setProperty("--radix-popper-anchor-width",`${v}px`),E.setProperty("--radix-popper-anchor-height",`${w}px`)}}),x&&uz({element:x,padding:a}),vz({arrowWidth:D,arrowHeight:$}),d&&cz({strategy:"referenceHidden",...U})]}),[X,de]=Rk(te),q=Pt(p);hi(()=>{W&&(q==null||q())},[W,q]);const N=(_=ae.arrow)==null?void 0:_.x,Y=(C=ae.arrow)==null?void 0:C.y,Z=((z=ae.arrow)==null?void 0:z.centerOffset)!==0,[ie,K]=L.useState();return hi(()=>{g&&K(window.getComputedStyle(g).zIndex)},[g]),ee.jsx("div",{ref:k.setFloating,"data-radix-popper-content-wrapper":"",style:{...G,transform:W?G.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:ie,"--radix-popper-transform-origin":[(j=ae.transformOrigin)==null?void 0:j.x,(P=ae.transformOrigin)==null?void 0:P.y].join(" "),...((F=ae.hide)==null?void 0:F.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:t.dir,children:ee.jsx(pz,{scope:r,placedSide:X,onArrowChange:O,arrowX:N,arrowY:Y,shouldHideArrow:Z,children:ee.jsx($e.div,{"data-side":X,"data-align":de,...m,ref:S,style:{...m.style,animation:W?void 0:"none"}})})})});kk.displayName=ov;var _k="PopperArrow",gz={top:"bottom",right:"left",bottom:"top",left:"right"},Ok=L.forwardRef(function(e,r){const{__scopePopper:n,...i}=e,o=mz(_k,n),s=gz[o.placedSide];return ee.jsx("span",{ref:o.onArrowChange,style:{position:"absolute",left:o.arrowX,top:o.arrowY,[s]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[o.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[o.placedSide],visibility:o.shouldHideArrow?"hidden":void 0},children:ee.jsx(dz,{...i,ref:r,style:{...i.style,display:"block"}})})});Ok.displayName=_k;function yz(t){return t!==null}var vz=t=>({name:"transformOrigin",options:t,fn(e){var y,g,b;const{placement:r,rects:n,middlewareData:i}=e,s=((y=i.arrow)==null?void 0:y.centerOffset)!==0,a=s?0:t.arrowWidth,l=s?0:t.arrowHeight,[c,u]=Rk(r),f={start:"0%",center:"50%",end:"100%"}[u],d=(((g=i.arrow)==null?void 0:g.x)??0)+a/2,h=(((b=i.arrow)==null?void 0:b.y)??0)+l/2;let p="",m="";return c==="bottom"?(p=s?f:`${d}px`,m=`${-l}px`):c==="top"?(p=s?f:`${d}px`,m=`${n.floating.height+l}px`):c==="right"?(p=`${-l}px`,m=s?f:`${h}px`):c==="left"&&(p=`${n.floating.width+l}px`,m=s?f:`${h}px`),{data:{x:p,y:m}}}});function Rk(t){const[e,r="center"]=t.split("-");return[e,r]}var Uf=Tk,Wf=Ck,sv=kk,av=Ok,wz="Portal",Vf=L.forwardRef((t,e)=>{var a;const{container:r,...n}=t,[i,o]=L.useState(!1);hi(()=>o(!0),[]);const s=r||i&&((a=globalThis==null?void 0:globalThis.document)==null?void 0:a.body);return s?vf.createPortal(ee.jsx($e.div,{...n,ref:e}),s):null});Vf.displayName=wz;function bz(t,e){return L.useReducer((r,n)=>e[r][n]??r,t)}var on=t=>{const{present:e,children:r}=t,n=xz(e),i=typeof r=="function"?r({present:n.isPresent}):L.Children.only(r),o=lt(n.ref,Sz(i));return typeof r=="function"||n.isPresent?L.cloneElement(i,{ref:o}):null};on.displayName="Presence";function xz(t){const[e,r]=L.useState(),n=L.useRef({}),i=L.useRef(t),o=L.useRef("none"),s=t?"mounted":"unmounted",[a,l]=bz(s,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return L.useEffect(()=>{const c=jl(n.current);o.current=a==="mounted"?c:"none"},[a]),hi(()=>{const c=n.current,u=i.current;if(u!==t){const d=o.current,h=jl(c);t?l("MOUNT"):h==="none"||(c==null?void 0:c.display)==="none"?l("UNMOUNT"):l(u&&d!==h?"ANIMATION_OUT":"UNMOUNT"),i.current=t}},[t,l]),hi(()=>{if(e){const c=f=>{const h=jl(n.current).includes(f.animationName);f.target===e&&h&&wf.flushSync(()=>l("ANIMATION_END"))},u=f=>{f.target===e&&(o.current=jl(n.current))};return e.addEventListener("animationstart",u),e.addEventListener("animationcancel",c),e.addEventListener("animationend",c),()=>{e.removeEventListener("animationstart",u),e.removeEventListener("animationcancel",c),e.removeEventListener("animationend",c)}}else l("ANIMATION_END")},[e,l]),{isPresent:["mounted","unmountSuspended"].includes(a),ref:L.useCallback(c=>{c&&(n.current=getComputedStyle(c)),r(c)},[])}}function jl(t){return(t==null?void 0:t.animationName)||"none"}function Sz(t){var n,i;let e=(n=Object.getOwnPropertyDescriptor(t.props,"ref"))==null?void 0:n.get,r=e&&"isReactWarning"in e&&e.isReactWarning;return r?t.ref:(e=(i=Object.getOwnPropertyDescriptor(t,"ref"))==null?void 0:i.get,r=e&&"isReactWarning"in e&&e.isReactWarning,r?t.props.ref:t.props.ref||t.ref)}var Sh="rovingFocusGroup.onEntryFocus",Ez={bubbles:!1,cancelable:!0},Gf="RovingFocusGroup",[Ym,Mk,Tz]=Xy(Gf),[Az,Kf]=nn(Gf,[Tz]),[Cz,kz]=Az(Gf),Ik=L.forwardRef((t,e)=>ee.jsx(Ym.Provider,{scope:t.__scopeRovingFocusGroup,children:ee.jsx(Ym.Slot,{scope:t.__scopeRovingFocusGroup,children:ee.jsx(_z,{...t,ref:e})})}));Ik.displayName=Gf;var _z=L.forwardRef((t,e)=>{const{__scopeRovingFocusGroup:r,orientation:n,loop:i=!1,dir:o,currentTabStopId:s,defaultCurrentTabStopId:a,onCurrentTabStopIdChange:l,onEntryFocus:c,preventScrollOnEntryFocus:u=!1,...f}=t,d=L.useRef(null),h=lt(e,d),p=Jy(o),[m=null,y]=On({prop:s,defaultProp:a,onChange:l}),[g,b]=L.useState(!1),S=Pt(c),x=Mk(r),O=L.useRef(!1),[M,D]=L.useState(0);return L.useEffect(()=>{const $=d.current;if($)return $.addEventListener(Sh,S),()=>$.removeEventListener(Sh,S)},[S]),ee.jsx(Cz,{scope:r,orientation:n,dir:p,loop:i,currentTabStopId:m,onItemFocus:L.useCallback($=>y($),[y]),onItemShiftTab:L.useCallback(()=>b(!0),[]),onFocusableItemAdd:L.useCallback(()=>D($=>$+1),[]),onFocusableItemRemove:L.useCallback(()=>D($=>$-1),[]),children:ee.jsx($e.div,{tabIndex:g||M===0?-1:0,"data-orientation":n,...f,ref:h,style:{outline:"none",...t.style},onMouseDown:Ae(t.onMouseDown,()=>{O.current=!0}),onFocus:Ae(t.onFocus,$=>{const A=!O.current;if($.target===$.currentTarget&&A&&!g){const V=new CustomEvent(Sh,Ez);if($.currentTarget.dispatchEvent(V),!V.defaultPrevented){const Q=x().filter(te=>te.focusable),I=Q.find(te=>te.active),U=Q.find(te=>te.id===m),G=[I,U,...Q].filter(Boolean).map(te=>te.ref.current);Pk(G,u)}}O.current=!1}),onBlur:Ae(t.onBlur,()=>b(!1))})})}),Nk="RovingFocusGroupItem",Dk=L.forwardRef((t,e)=>{const{__scopeRovingFocusGroup:r,focusable:n=!0,active:i=!1,tabStopId:o,...s}=t,a=pi(),l=o||a,c=kz(Nk,r),u=c.currentTabStopId===l,f=Mk(r),{onFocusableItemAdd:d,onFocusableItemRemove:h}=c;return L.useEffect(()=>{if(n)return d(),()=>h()},[n,d,h]),ee.jsx(Ym.ItemSlot,{scope:r,id:l,focusable:n,active:i,children:ee.jsx($e.span,{tabIndex:u?0:-1,"data-orientation":c.orientation,...s,ref:e,onMouseDown:Ae(t.onMouseDown,p=>{n?c.onItemFocus(l):p.preventDefault()}),onFocus:Ae(t.onFocus,()=>c.onItemFocus(l)),onKeyDown:Ae(t.onKeyDown,p=>{if(p.key==="Tab"&&p.shiftKey){c.onItemShiftTab();return}if(p.target!==p.currentTarget)return;const m=Mz(p,c.orientation,c.dir);if(m!==void 0){if(p.metaKey||p.ctrlKey||p.altKey||p.shiftKey)return;p.preventDefault();let g=f().filter(b=>b.focusable).map(b=>b.ref.current);if(m==="last")g.reverse();else if(m==="prev"||m==="next"){m==="prev"&&g.reverse();const b=g.indexOf(p.currentTarget);g=c.loop?Iz(g,b+1):g.slice(b+1)}setTimeout(()=>Pk(g))}})})})});Dk.displayName=Nk;var Oz={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function Rz(t,e){return e!=="rtl"?t:t==="ArrowLeft"?"ArrowRight":t==="ArrowRight"?"ArrowLeft":t}function Mz(t,e,r){const n=Rz(t.key,r);if(!(e==="vertical"&&["ArrowLeft","ArrowRight"].includes(n))&&!(e==="horizontal"&&["ArrowUp","ArrowDown"].includes(n)))return Oz[n]}function Pk(t,e=!1){const r=document.activeElement;for(const n of t)if(n===r||(n.focus({preventScroll:e}),document.activeElement!==r))return}function Iz(t,e){return t.map((r,n)=>t[(e+n)%t.length])}var Lk=Ik,Fk=Dk,Nz=function(t){if(typeof document>"u")return null;var e=Array.isArray(t)?t[0]:t;return e.ownerDocument.body},_o=new WeakMap,Hl=new WeakMap,zl={},Eh=0,Bk=function(t){return t&&(t.host||Bk(t.parentNode))},Dz=function(t,e){return e.map(function(r){if(t.contains(r))return r;var n=Bk(r);return n&&t.contains(n)?n:(console.error("aria-hidden",r,"in not contained inside",t,". Doing nothing"),null)}).filter(function(r){return!!r})},Pz=function(t,e,r,n){var i=Dz(e,Array.isArray(t)?t:[t]);zl[r]||(zl[r]=new WeakMap);var o=zl[r],s=[],a=new Set,l=new Set(i),c=function(f){!f||a.has(f)||(a.add(f),c(f.parentNode))};i.forEach(c);var u=function(f){!f||l.has(f)||Array.prototype.forEach.call(f.children,function(d){if(a.has(d))u(d);else try{var h=d.getAttribute(n),p=h!==null&&h!=="false",m=(_o.get(d)||0)+1,y=(o.get(d)||0)+1;_o.set(d,m),o.set(d,y),s.push(d),m===1&&p&&Hl.set(d,!0),y===1&&d.setAttribute(r,"true"),p||d.setAttribute(n,"true")}catch(g){console.error("aria-hidden: cannot operate on ",d,g)}})};return u(e),a.clear(),Eh++,function(){s.forEach(function(f){var d=_o.get(f)-1,h=o.get(f)-1;_o.set(f,d),o.set(f,h),d||(Hl.has(f)||f.removeAttribute(n),Hl.delete(f)),h||f.removeAttribute(r)}),Eh--,Eh||(_o=new WeakMap,_o=new WeakMap,Hl=new WeakMap,zl={})}},$k=function(t,e,r){r===void 0&&(r="data-aria-hidden");var n=Array.from(Array.isArray(t)?t:[t]),i=Nz(t);return i?(n.push.apply(n,Array.from(i.querySelectorAll("[aria-live]"))),Pz(n,i,r,"aria-hidden")):function(){return null}},zr=function(){return zr=Object.assign||function(e){for(var r,n=1,i=arguments.length;n<i;n++){r=arguments[n];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(e[o]=r[o])}return e},zr.apply(this,arguments)};function jk(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(t);i<n.length;i++)e.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(t,n[i])&&(r[n[i]]=t[n[i]]);return r}function Lz(t,e,r){if(r||arguments.length===2)for(var n=0,i=e.length,o;n<i;n++)(o||!(n in e))&&(o||(o=Array.prototype.slice.call(e,0,n)),o[n]=e[n]);return t.concat(o||Array.prototype.slice.call(e))}var Ic="right-scroll-bar-position",Nc="width-before-scroll-bar",Fz="with-scroll-bars-hidden",Bz="--removed-body-scroll-bar-size";function Th(t,e){return typeof t=="function"?t(e):t&&(t.current=e),t}function $z(t,e){var r=pe.useState(function(){return{value:t,callback:e,facade:{get current(){return r.value},set current(n){var i=r.value;i!==n&&(r.value=n,r.callback(n,i))}}}})[0];return r.callback=e,r.facade}var jz=typeof window<"u"?L.useLayoutEffect:L.useEffect,$1=new WeakMap;function Hz(t,e){var r=$z(null,function(n){return t.forEach(function(i){return Th(i,n)})});return jz(function(){var n=$1.get(r);if(n){var i=new Set(n),o=new Set(t),s=r.current;i.forEach(function(a){o.has(a)||Th(a,null)}),o.forEach(function(a){i.has(a)||Th(a,s)})}$1.set(r,t)},[t]),r}function zz(t){return t}function Uz(t,e){e===void 0&&(e=zz);var r=[],n=!1,i={read:function(){if(n)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return r.length?r[r.length-1]:t},useMedium:function(o){var s=e(o,n);return r.push(s),function(){r=r.filter(function(a){return a!==s})}},assignSyncMedium:function(o){for(n=!0;r.length;){var s=r;r=[],s.forEach(o)}r={push:function(a){return o(a)},filter:function(){return r}}},assignMedium:function(o){n=!0;var s=[];if(r.length){var a=r;r=[],a.forEach(o),s=r}var l=function(){var u=s;s=[],u.forEach(o)},c=function(){return Promise.resolve().then(l)};c(),r={push:function(u){s.push(u),c()},filter:function(u){return s=s.filter(u),r}}}};return i}function Wz(t){t===void 0&&(t={});var e=Uz(null);return e.options=zr({async:!0,ssr:!1},t),e}var Hk=function(t){var e=t.sideCar,r=jk(t,["sideCar"]);if(!e)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var n=e.read();if(!n)throw new Error("Sidecar medium not found");return L.createElement(n,zr({},r))};Hk.isSideCarExport=!0;function Vz(t,e){return t.useMedium(e),Hk}var zk=Wz(),Ah=function(){},qf=L.forwardRef(function(t,e){var r=L.useRef(null),n=L.useState({onScrollCapture:Ah,onWheelCapture:Ah,onTouchMoveCapture:Ah}),i=n[0],o=n[1],s=t.forwardProps,a=t.children,l=t.className,c=t.removeScrollBar,u=t.enabled,f=t.shards,d=t.sideCar,h=t.noIsolation,p=t.inert,m=t.allowPinchZoom,y=t.as,g=y===void 0?"div":y,b=t.gapMode,S=jk(t,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as","gapMode"]),x=d,O=Hz([r,e]),M=zr(zr({},S),i);return L.createElement(L.Fragment,null,u&&L.createElement(x,{sideCar:zk,removeScrollBar:c,shards:f,noIsolation:h,inert:p,setCallbacks:o,allowPinchZoom:!!m,lockRef:r,gapMode:b}),s?L.cloneElement(L.Children.only(a),zr(zr({},M),{ref:O})):L.createElement(g,zr({},M,{className:l,ref:O}),a))});qf.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};qf.classNames={fullWidth:Nc,zeroRight:Ic};var Gz=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function Kz(){if(!document)return null;var t=document.createElement("style");t.type="text/css";var e=Gz();return e&&t.setAttribute("nonce",e),t}function qz(t,e){t.styleSheet?t.styleSheet.cssText=e:t.appendChild(document.createTextNode(e))}function Xz(t){var e=document.head||document.getElementsByTagName("head")[0];e.appendChild(t)}var Jz=function(){var t=0,e=null;return{add:function(r){t==0&&(e=Kz())&&(qz(e,r),Xz(e)),t++},remove:function(){t--,!t&&e&&(e.parentNode&&e.parentNode.removeChild(e),e=null)}}},Yz=function(){var t=Jz();return function(e,r){L.useEffect(function(){return t.add(e),function(){t.remove()}},[e&&r])}},Uk=function(){var t=Yz(),e=function(r){var n=r.styles,i=r.dynamic;return t(n,i),null};return e},Zz={left:0,top:0,right:0,gap:0},Ch=function(t){return parseInt(t||"",10)||0},Qz=function(t){var e=window.getComputedStyle(document.body),r=e[t==="padding"?"paddingLeft":"marginLeft"],n=e[t==="padding"?"paddingTop":"marginTop"],i=e[t==="padding"?"paddingRight":"marginRight"];return[Ch(r),Ch(n),Ch(i)]},eU=function(t){if(t===void 0&&(t="margin"),typeof window>"u")return Zz;var e=Qz(t),r=document.documentElement.clientWidth,n=window.innerWidth;return{left:e[0],top:e[1],right:e[2],gap:Math.max(0,n-r+e[2]-e[0])}},tU=Uk(),Yo="data-scroll-locked",rU=function(t,e,r,n){var i=t.left,o=t.top,s=t.right,a=t.gap;return r===void 0&&(r="margin"),`
500
- .`.concat(Fz,` {
501
- overflow: hidden `).concat(n,`;
502
- padding-right: `).concat(a,"px ").concat(n,`;
503
- }
504
- body[`).concat(Yo,`] {
505
- overflow: hidden `).concat(n,`;
506
- overscroll-behavior: contain;
507
- `).concat([e&&"position: relative ".concat(n,";"),r==="margin"&&`
508
- padding-left: `.concat(i,`px;
509
- padding-top: `).concat(o,`px;
510
- padding-right: `).concat(s,`px;
511
- margin-left:0;
512
- margin-top:0;
513
- margin-right: `).concat(a,"px ").concat(n,`;
514
- `),r==="padding"&&"padding-right: ".concat(a,"px ").concat(n,";")].filter(Boolean).join(""),`
515
- }
516
-
517
- .`).concat(Ic,` {
518
- right: `).concat(a,"px ").concat(n,`;
519
- }
520
-
521
- .`).concat(Nc,` {
522
- margin-right: `).concat(a,"px ").concat(n,`;
523
- }
524
-
525
- .`).concat(Ic," .").concat(Ic,` {
526
- right: 0 `).concat(n,`;
527
- }
528
-
529
- .`).concat(Nc," .").concat(Nc,` {
530
- margin-right: 0 `).concat(n,`;
531
- }
532
-
533
- body[`).concat(Yo,`] {
534
- `).concat(Bz,": ").concat(a,`px;
535
- }
536
- `)},j1=function(){var t=parseInt(document.body.getAttribute(Yo)||"0",10);return isFinite(t)?t:0},nU=function(){L.useEffect(function(){return document.body.setAttribute(Yo,(j1()+1).toString()),function(){var t=j1()-1;t<=0?document.body.removeAttribute(Yo):document.body.setAttribute(Yo,t.toString())}},[])},iU=function(t){var e=t.noRelative,r=t.noImportant,n=t.gapMode,i=n===void 0?"margin":n;nU();var o=L.useMemo(function(){return eU(i)},[i]);return L.createElement(tU,{styles:rU(o,!e,i,r?"":"!important")})},Zm=!1;if(typeof window<"u")try{var Ul=Object.defineProperty({},"passive",{get:function(){return Zm=!0,!0}});window.addEventListener("test",Ul,Ul),window.removeEventListener("test",Ul,Ul)}catch{Zm=!1}var Oo=Zm?{passive:!1}:!1,oU=function(t){return t.tagName==="TEXTAREA"},Wk=function(t,e){var r=window.getComputedStyle(t);return r[e]!=="hidden"&&!(r.overflowY===r.overflowX&&!oU(t)&&r[e]==="visible")},sU=function(t){return Wk(t,"overflowY")},aU=function(t){return Wk(t,"overflowX")},H1=function(t,e){var r=e.ownerDocument,n=e;do{typeof ShadowRoot<"u"&&n instanceof ShadowRoot&&(n=n.host);var i=Vk(t,n);if(i){var o=Gk(t,n),s=o[1],a=o[2];if(s>a)return!0}n=n.parentNode}while(n&&n!==r.body);return!1},lU=function(t){var e=t.scrollTop,r=t.scrollHeight,n=t.clientHeight;return[e,r,n]},cU=function(t){var e=t.scrollLeft,r=t.scrollWidth,n=t.clientWidth;return[e,r,n]},Vk=function(t,e){return t==="v"?sU(e):aU(e)},Gk=function(t,e){return t==="v"?lU(e):cU(e)},uU=function(t,e){return t==="h"&&e==="rtl"?-1:1},fU=function(t,e,r,n,i){var o=uU(t,window.getComputedStyle(e).direction),s=o*n,a=r.target,l=e.contains(a),c=!1,u=s>0,f=0,d=0;do{var h=Gk(t,a),p=h[0],m=h[1],y=h[2],g=m-y-o*p;(p||g)&&Vk(t,a)&&(f+=g,d+=p),a instanceof ShadowRoot?a=a.host:a=a.parentNode}while(!l&&a!==document.body||l&&(e.contains(a)||e===a));return(u&&(Math.abs(f)<1||!i)||!u&&(Math.abs(d)<1||!i))&&(c=!0),c},Wl=function(t){return"changedTouches"in t?[t.changedTouches[0].clientX,t.changedTouches[0].clientY]:[0,0]},z1=function(t){return[t.deltaX,t.deltaY]},U1=function(t){return t&&"current"in t?t.current:t},dU=function(t,e){return t[0]===e[0]&&t[1]===e[1]},hU=function(t){return`
537
- .block-interactivity-`.concat(t,` {pointer-events: none;}
538
- .allow-interactivity-`).concat(t,` {pointer-events: all;}
539
- `)},pU=0,Ro=[];function mU(t){var e=L.useRef([]),r=L.useRef([0,0]),n=L.useRef(),i=L.useState(pU++)[0],o=L.useState(Uk)[0],s=L.useRef(t);L.useEffect(function(){s.current=t},[t]),L.useEffect(function(){if(t.inert){document.body.classList.add("block-interactivity-".concat(i));var m=Lz([t.lockRef.current],(t.shards||[]).map(U1),!0).filter(Boolean);return m.forEach(function(y){return y.classList.add("allow-interactivity-".concat(i))}),function(){document.body.classList.remove("block-interactivity-".concat(i)),m.forEach(function(y){return y.classList.remove("allow-interactivity-".concat(i))})}}},[t.inert,t.lockRef.current,t.shards]);var a=L.useCallback(function(m,y){if("touches"in m&&m.touches.length===2)return!s.current.allowPinchZoom;var g=Wl(m),b=r.current,S="deltaX"in m?m.deltaX:b[0]-g[0],x="deltaY"in m?m.deltaY:b[1]-g[1],O,M=m.target,D=Math.abs(S)>Math.abs(x)?"h":"v";if("touches"in m&&D==="h"&&M.type==="range")return!1;var $=H1(D,M);if(!$)return!0;if($?O=D:(O=D==="v"?"h":"v",$=H1(D,M)),!$)return!1;if(!n.current&&"changedTouches"in m&&(S||x)&&(n.current=O),!O)return!0;var A=n.current||O;return fU(A,y,m,A==="h"?S:x,!0)},[]),l=L.useCallback(function(m){var y=m;if(!(!Ro.length||Ro[Ro.length-1]!==o)){var g="deltaY"in y?z1(y):Wl(y),b=e.current.filter(function(O){return O.name===y.type&&(O.target===y.target||y.target===O.shadowParent)&&dU(O.delta,g)})[0];if(b&&b.should){y.cancelable&&y.preventDefault();return}if(!b){var S=(s.current.shards||[]).map(U1).filter(Boolean).filter(function(O){return O.contains(y.target)}),x=S.length>0?a(y,S[0]):!s.current.noIsolation;x&&y.cancelable&&y.preventDefault()}}},[]),c=L.useCallback(function(m,y,g,b){var S={name:m,delta:y,target:g,should:b,shadowParent:gU(g)};e.current.push(S),setTimeout(function(){e.current=e.current.filter(function(x){return x!==S})},1)},[]),u=L.useCallback(function(m){r.current=Wl(m),n.current=void 0},[]),f=L.useCallback(function(m){c(m.type,z1(m),m.target,a(m,t.lockRef.current))},[]),d=L.useCallback(function(m){c(m.type,Wl(m),m.target,a(m,t.lockRef.current))},[]);L.useEffect(function(){return Ro.push(o),t.setCallbacks({onScrollCapture:f,onWheelCapture:f,onTouchMoveCapture:d}),document.addEventListener("wheel",l,Oo),document.addEventListener("touchmove",l,Oo),document.addEventListener("touchstart",u,Oo),function(){Ro=Ro.filter(function(m){return m!==o}),document.removeEventListener("wheel",l,Oo),document.removeEventListener("touchmove",l,Oo),document.removeEventListener("touchstart",u,Oo)}},[]);var h=t.removeScrollBar,p=t.inert;return L.createElement(L.Fragment,null,p?L.createElement(o,{styles:hU(i)}):null,h?L.createElement(iU,{gapMode:t.gapMode}):null)}function gU(t){for(var e=null;t!==null;)t instanceof ShadowRoot&&(e=t.host,t=t.host),t=t.parentNode;return e}const yU=Vz(zk,mU);var lv=L.forwardRef(function(t,e){return L.createElement(qf,zr({},t,{ref:e,sideCar:yU}))});lv.classNames=qf.classNames;var Qm=["Enter"," "],vU=["ArrowDown","PageUp","Home"],Kk=["ArrowUp","PageDown","End"],wU=[...vU,...Kk],bU={ltr:[...Qm,"ArrowRight"],rtl:[...Qm,"ArrowLeft"]},xU={ltr:["ArrowLeft"],rtl:["ArrowRight"]},yl="Menu",[Wa,SU,EU]=Xy(yl),[mo,qk]=nn(yl,[EU,Ps,Kf]),vl=Ps(),Xk=Kf(),[Jk,_i]=mo(yl),[TU,wl]=mo(yl),Yk=t=>{const{__scopeMenu:e,open:r=!1,children:n,dir:i,onOpenChange:o,modal:s=!0}=t,a=vl(e),[l,c]=L.useState(null),u=L.useRef(!1),f=Pt(o),d=Jy(i);return L.useEffect(()=>{const h=()=>{u.current=!0,document.addEventListener("pointerdown",p,{capture:!0,once:!0}),document.addEventListener("pointermove",p,{capture:!0,once:!0})},p=()=>u.current=!1;return document.addEventListener("keydown",h,{capture:!0}),()=>{document.removeEventListener("keydown",h,{capture:!0}),document.removeEventListener("pointerdown",p,{capture:!0}),document.removeEventListener("pointermove",p,{capture:!0})}},[]),ee.jsx(Uf,{...a,children:ee.jsx(Jk,{scope:e,open:r,onOpenChange:f,content:l,onContentChange:c,children:ee.jsx(TU,{scope:e,onClose:L.useCallback(()=>f(!1),[f]),isUsingKeyboardRef:u,dir:d,modal:s,children:n})})})};Yk.displayName=yl;var AU="MenuAnchor",cv=L.forwardRef((t,e)=>{const{__scopeMenu:r,...n}=t,i=vl(r);return ee.jsx(Wf,{...i,...n,ref:e})});cv.displayName=AU;var uv="MenuPortal",[CU,Zk]=mo(uv,{forceMount:void 0}),Qk=t=>{const{__scopeMenu:e,forceMount:r,children:n,container:i}=t,o=_i(uv,e);return ee.jsx(CU,{scope:e,forceMount:r,children:ee.jsx(on,{present:r||o.open,children:ee.jsx(Vf,{asChild:!0,container:i,children:n})})})};Qk.displayName=uv;var gr="MenuContent",[kU,fv]=mo(gr),e_=L.forwardRef((t,e)=>{const r=Zk(gr,t.__scopeMenu),{forceMount:n=r.forceMount,...i}=t,o=_i(gr,t.__scopeMenu),s=wl(gr,t.__scopeMenu);return ee.jsx(Wa.Provider,{scope:t.__scopeMenu,children:ee.jsx(on,{present:n||o.open,children:ee.jsx(Wa.Slot,{scope:t.__scopeMenu,children:s.modal?ee.jsx(_U,{...i,ref:e}):ee.jsx(OU,{...i,ref:e})})})})}),_U=L.forwardRef((t,e)=>{const r=_i(gr,t.__scopeMenu),n=L.useRef(null),i=lt(e,n);return L.useEffect(()=>{const o=n.current;if(o)return $k(o)},[]),ee.jsx(dv,{...t,ref:i,trapFocus:r.open,disableOutsidePointerEvents:r.open,disableOutsideScroll:!0,onFocusOutside:Ae(t.onFocusOutside,o=>o.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>r.onOpenChange(!1)})}),OU=L.forwardRef((t,e)=>{const r=_i(gr,t.__scopeMenu);return ee.jsx(dv,{...t,ref:e,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>r.onOpenChange(!1)})}),dv=L.forwardRef((t,e)=>{const{__scopeMenu:r,loop:n=!1,trapFocus:i,onOpenAutoFocus:o,onCloseAutoFocus:s,disableOutsidePointerEvents:a,onEntryFocus:l,onEscapeKeyDown:c,onPointerDownOutside:u,onFocusOutside:f,onInteractOutside:d,onDismiss:h,disableOutsideScroll:p,...m}=t,y=_i(gr,r),g=wl(gr,r),b=vl(r),S=Xk(r),x=SU(r),[O,M]=L.useState(null),D=L.useRef(null),$=lt(e,D,y.onContentChange),A=L.useRef(0),V=L.useRef(""),Q=L.useRef(0),I=L.useRef(null),U=L.useRef("right"),k=L.useRef(0),G=p?lv:L.Fragment,te=p?{as:ro,allowPinchZoom:!0}:void 0,W=X=>{var _,C;const de=V.current+X,q=x().filter(z=>!z.disabled),N=document.activeElement,Y=(_=q.find(z=>z.ref.current===N))==null?void 0:_.textValue,Z=q.map(z=>z.textValue),ie=HU(Z,de,Y),K=(C=q.find(z=>z.textValue===ie))==null?void 0:C.ref.current;(function z(j){V.current=j,window.clearTimeout(A.current),j!==""&&(A.current=window.setTimeout(()=>z(""),1e3))})(de),K&&setTimeout(()=>K.focus())};L.useEffect(()=>()=>window.clearTimeout(A.current),[]),ck();const ae=L.useCallback(X=>{var q,N;return U.current===((q=I.current)==null?void 0:q.side)&&UU(X,(N=I.current)==null?void 0:N.area)},[]);return ee.jsx(kU,{scope:r,searchRef:V,onItemEnter:L.useCallback(X=>{ae(X)&&X.preventDefault()},[ae]),onItemLeave:L.useCallback(X=>{var de;ae(X)||((de=D.current)==null||de.focus(),M(null))},[ae]),onTriggerLeave:L.useCallback(X=>{ae(X)&&X.preventDefault()},[ae]),pointerGraceTimerRef:Q,onPointerGraceIntentChange:L.useCallback(X=>{I.current=X},[]),children:ee.jsx(G,{...te,children:ee.jsx(Yy,{asChild:!0,trapped:i,onMountAutoFocus:Ae(o,X=>{var de;X.preventDefault(),(de=D.current)==null||de.focus({preventScroll:!0})}),onUnmountAutoFocus:s,children:ee.jsx(ml,{asChild:!0,disableOutsidePointerEvents:a,onEscapeKeyDown:c,onPointerDownOutside:u,onFocusOutside:f,onInteractOutside:d,onDismiss:h,children:ee.jsx(Lk,{asChild:!0,...S,dir:g.dir,orientation:"vertical",loop:n,currentTabStopId:O,onCurrentTabStopIdChange:M,onEntryFocus:Ae(l,X=>{g.isUsingKeyboardRef.current||X.preventDefault()}),preventScrollOnEntryFocus:!0,children:ee.jsx(sv,{role:"menu","aria-orientation":"vertical","data-state":y_(y.open),"data-radix-menu-content":"",dir:g.dir,...b,...m,ref:$,style:{outline:"none",...m.style},onKeyDown:Ae(m.onKeyDown,X=>{const q=X.target.closest("[data-radix-menu-content]")===X.currentTarget,N=X.ctrlKey||X.altKey||X.metaKey,Y=X.key.length===1;q&&(X.key==="Tab"&&X.preventDefault(),!N&&Y&&W(X.key));const Z=D.current;if(X.target!==Z||!wU.includes(X.key))return;X.preventDefault();const K=x().filter(_=>!_.disabled).map(_=>_.ref.current);Kk.includes(X.key)&&K.reverse(),$U(K)}),onBlur:Ae(t.onBlur,X=>{X.currentTarget.contains(X.target)||(window.clearTimeout(A.current),V.current="")}),onPointerMove:Ae(t.onPointerMove,Va(X=>{const de=X.target,q=k.current!==X.clientX;if(X.currentTarget.contains(de)&&q){const N=X.clientX>k.current?"right":"left";U.current=N,k.current=X.clientX}}))})})})})})})});e_.displayName=gr;var RU="MenuGroup",hv=L.forwardRef((t,e)=>{const{__scopeMenu:r,...n}=t;return ee.jsx($e.div,{role:"group",...n,ref:e})});hv.displayName=RU;var MU="MenuLabel",t_=L.forwardRef((t,e)=>{const{__scopeMenu:r,...n}=t;return ee.jsx($e.div,{...n,ref:e})});t_.displayName=MU;var Au="MenuItem",W1="menu.itemSelect",Xf=L.forwardRef((t,e)=>{const{disabled:r=!1,onSelect:n,...i}=t,o=L.useRef(null),s=wl(Au,t.__scopeMenu),a=fv(Au,t.__scopeMenu),l=lt(e,o),c=L.useRef(!1),u=()=>{const f=o.current;if(!r&&f){const d=new CustomEvent(W1,{bubbles:!0,cancelable:!0});f.addEventListener(W1,h=>n==null?void 0:n(h),{once:!0}),qy(f,d),d.defaultPrevented?c.current=!1:s.onClose()}};return ee.jsx(r_,{...i,ref:l,disabled:r,onClick:Ae(t.onClick,u),onPointerDown:f=>{var d;(d=t.onPointerDown)==null||d.call(t,f),c.current=!0},onPointerUp:Ae(t.onPointerUp,f=>{var d;c.current||(d=f.currentTarget)==null||d.click()}),onKeyDown:Ae(t.onKeyDown,f=>{const d=a.searchRef.current!=="";r||d&&f.key===" "||Qm.includes(f.key)&&(f.currentTarget.click(),f.preventDefault())})})});Xf.displayName=Au;var r_=L.forwardRef((t,e)=>{const{__scopeMenu:r,disabled:n=!1,textValue:i,...o}=t,s=fv(Au,r),a=Xk(r),l=L.useRef(null),c=lt(e,l),[u,f]=L.useState(!1),[d,h]=L.useState("");return L.useEffect(()=>{const p=l.current;p&&h((p.textContent??"").trim())},[o.children]),ee.jsx(Wa.ItemSlot,{scope:r,disabled:n,textValue:i??d,children:ee.jsx(Fk,{asChild:!0,...a,focusable:!n,children:ee.jsx($e.div,{role:"menuitem","data-highlighted":u?"":void 0,"aria-disabled":n||void 0,"data-disabled":n?"":void 0,...o,ref:c,onPointerMove:Ae(t.onPointerMove,Va(p=>{n?s.onItemLeave(p):(s.onItemEnter(p),p.defaultPrevented||p.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:Ae(t.onPointerLeave,Va(p=>s.onItemLeave(p))),onFocus:Ae(t.onFocus,()=>f(!0)),onBlur:Ae(t.onBlur,()=>f(!1))})})})}),IU="MenuCheckboxItem",n_=L.forwardRef((t,e)=>{const{checked:r=!1,onCheckedChange:n,...i}=t;return ee.jsx(l_,{scope:t.__scopeMenu,checked:r,children:ee.jsx(Xf,{role:"menuitemcheckbox","aria-checked":Cu(r)?"mixed":r,...i,ref:e,"data-state":gv(r),onSelect:Ae(i.onSelect,()=>n==null?void 0:n(Cu(r)?!0:!r),{checkForDefaultPrevented:!1})})})});n_.displayName=IU;var i_="MenuRadioGroup",[NU,DU]=mo(i_,{value:void 0,onValueChange:()=>{}}),o_=L.forwardRef((t,e)=>{const{value:r,onValueChange:n,...i}=t,o=Pt(n);return ee.jsx(NU,{scope:t.__scopeMenu,value:r,onValueChange:o,children:ee.jsx(hv,{...i,ref:e})})});o_.displayName=i_;var s_="MenuRadioItem",a_=L.forwardRef((t,e)=>{const{value:r,...n}=t,i=DU(s_,t.__scopeMenu),o=r===i.value;return ee.jsx(l_,{scope:t.__scopeMenu,checked:o,children:ee.jsx(Xf,{role:"menuitemradio","aria-checked":o,...n,ref:e,"data-state":gv(o),onSelect:Ae(n.onSelect,()=>{var s;return(s=i.onValueChange)==null?void 0:s.call(i,r)},{checkForDefaultPrevented:!1})})})});a_.displayName=s_;var pv="MenuItemIndicator",[l_,PU]=mo(pv,{checked:!1}),c_=L.forwardRef((t,e)=>{const{__scopeMenu:r,forceMount:n,...i}=t,o=PU(pv,r);return ee.jsx(on,{present:n||Cu(o.checked)||o.checked===!0,children:ee.jsx($e.span,{...i,ref:e,"data-state":gv(o.checked)})})});c_.displayName=pv;var LU="MenuSeparator",u_=L.forwardRef((t,e)=>{const{__scopeMenu:r,...n}=t;return ee.jsx($e.div,{role:"separator","aria-orientation":"horizontal",...n,ref:e})});u_.displayName=LU;var FU="MenuArrow",f_=L.forwardRef((t,e)=>{const{__scopeMenu:r,...n}=t,i=vl(r);return ee.jsx(av,{...i,...n,ref:e})});f_.displayName=FU;var mv="MenuSub",[BU,d_]=mo(mv),h_=t=>{const{__scopeMenu:e,children:r,open:n=!1,onOpenChange:i}=t,o=_i(mv,e),s=vl(e),[a,l]=L.useState(null),[c,u]=L.useState(null),f=Pt(i);return L.useEffect(()=>(o.open===!1&&f(!1),()=>f(!1)),[o.open,f]),ee.jsx(Uf,{...s,children:ee.jsx(Jk,{scope:e,open:n,onOpenChange:f,content:c,onContentChange:u,children:ee.jsx(BU,{scope:e,contentId:pi(),triggerId:pi(),trigger:a,onTriggerChange:l,children:r})})})};h_.displayName=mv;var sa="MenuSubTrigger",p_=L.forwardRef((t,e)=>{const r=_i(sa,t.__scopeMenu),n=wl(sa,t.__scopeMenu),i=d_(sa,t.__scopeMenu),o=fv(sa,t.__scopeMenu),s=L.useRef(null),{pointerGraceTimerRef:a,onPointerGraceIntentChange:l}=o,c={__scopeMenu:t.__scopeMenu},u=L.useCallback(()=>{s.current&&window.clearTimeout(s.current),s.current=null},[]);return L.useEffect(()=>u,[u]),L.useEffect(()=>{const f=a.current;return()=>{window.clearTimeout(f),l(null)}},[a,l]),ee.jsx(cv,{asChild:!0,...c,children:ee.jsx(r_,{id:i.triggerId,"aria-haspopup":"menu","aria-expanded":r.open,"aria-controls":i.contentId,"data-state":y_(r.open),...t,ref:Lf(e,i.onTriggerChange),onClick:f=>{var d;(d=t.onClick)==null||d.call(t,f),!(t.disabled||f.defaultPrevented)&&(f.currentTarget.focus(),r.open||r.onOpenChange(!0))},onPointerMove:Ae(t.onPointerMove,Va(f=>{o.onItemEnter(f),!f.defaultPrevented&&!t.disabled&&!r.open&&!s.current&&(o.onPointerGraceIntentChange(null),s.current=window.setTimeout(()=>{r.onOpenChange(!0),u()},100))})),onPointerLeave:Ae(t.onPointerLeave,Va(f=>{var h,p;u();const d=(h=r.content)==null?void 0:h.getBoundingClientRect();if(d){const m=(p=r.content)==null?void 0:p.dataset.side,y=m==="right",g=y?-5:5,b=d[y?"left":"right"],S=d[y?"right":"left"];o.onPointerGraceIntentChange({area:[{x:f.clientX+g,y:f.clientY},{x:b,y:d.top},{x:S,y:d.top},{x:S,y:d.bottom},{x:b,y:d.bottom}],side:m}),window.clearTimeout(a.current),a.current=window.setTimeout(()=>o.onPointerGraceIntentChange(null),300)}else{if(o.onTriggerLeave(f),f.defaultPrevented)return;o.onPointerGraceIntentChange(null)}})),onKeyDown:Ae(t.onKeyDown,f=>{var h;const d=o.searchRef.current!=="";t.disabled||d&&f.key===" "||bU[n.dir].includes(f.key)&&(r.onOpenChange(!0),(h=r.content)==null||h.focus(),f.preventDefault())})})})});p_.displayName=sa;var m_="MenuSubContent",g_=L.forwardRef((t,e)=>{const r=Zk(gr,t.__scopeMenu),{forceMount:n=r.forceMount,...i}=t,o=_i(gr,t.__scopeMenu),s=wl(gr,t.__scopeMenu),a=d_(m_,t.__scopeMenu),l=L.useRef(null),c=lt(e,l);return ee.jsx(Wa.Provider,{scope:t.__scopeMenu,children:ee.jsx(on,{present:n||o.open,children:ee.jsx(Wa.Slot,{scope:t.__scopeMenu,children:ee.jsx(dv,{id:a.contentId,"aria-labelledby":a.triggerId,...i,ref:c,align:"start",side:s.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:u=>{var f;s.isUsingKeyboardRef.current&&((f=l.current)==null||f.focus()),u.preventDefault()},onCloseAutoFocus:u=>u.preventDefault(),onFocusOutside:Ae(t.onFocusOutside,u=>{u.target!==a.trigger&&o.onOpenChange(!1)}),onEscapeKeyDown:Ae(t.onEscapeKeyDown,u=>{s.onClose(),u.preventDefault()}),onKeyDown:Ae(t.onKeyDown,u=>{var h;const f=u.currentTarget.contains(u.target),d=xU[s.dir].includes(u.key);f&&d&&(o.onOpenChange(!1),(h=a.trigger)==null||h.focus(),u.preventDefault())})})})})})});g_.displayName=m_;function y_(t){return t?"open":"closed"}function Cu(t){return t==="indeterminate"}function gv(t){return Cu(t)?"indeterminate":t?"checked":"unchecked"}function $U(t){const e=document.activeElement;for(const r of t)if(r===e||(r.focus(),document.activeElement!==e))return}function jU(t,e){return t.map((r,n)=>t[(e+n)%t.length])}function HU(t,e,r){const i=e.length>1&&Array.from(e).every(c=>c===e[0])?e[0]:e,o=r?t.indexOf(r):-1;let s=jU(t,Math.max(o,0));i.length===1&&(s=s.filter(c=>c!==r));const l=s.find(c=>c.toLowerCase().startsWith(i.toLowerCase()));return l!==r?l:void 0}function zU(t,e){const{x:r,y:n}=t;let i=!1;for(let o=0,s=e.length-1;o<e.length;s=o++){const a=e[o].x,l=e[o].y,c=e[s].x,u=e[s].y;l>n!=u>n&&r<(c-a)*(n-l)/(u-l)+a&&(i=!i)}return i}function UU(t,e){if(!e)return!1;const r={x:t.clientX,y:t.clientY};return zU(r,e)}function Va(t){return e=>e.pointerType==="mouse"?t(e):void 0}var WU=Yk,VU=cv,GU=Qk,KU=e_,qU=hv,XU=t_,JU=Xf,YU=n_,ZU=o_,QU=a_,eW=c_,tW=u_,rW=f_,nW=h_,iW=p_,oW=g_,yv="DropdownMenu",[sW,Bae]=nn(yv,[qk]),jt=qk(),[aW,v_]=sW(yv),w_=t=>{const{__scopeDropdownMenu:e,children:r,dir:n,open:i,defaultOpen:o,onOpenChange:s,modal:a=!0}=t,l=jt(e),c=L.useRef(null),[u=!1,f]=On({prop:i,defaultProp:o,onChange:s});return ee.jsx(aW,{scope:e,triggerId:pi(),triggerRef:c,contentId:pi(),open:u,onOpenChange:f,onOpenToggle:L.useCallback(()=>f(d=>!d),[f]),modal:a,children:ee.jsx(WU,{...l,open:u,onOpenChange:f,dir:n,modal:a,children:r})})};w_.displayName=yv;var b_="DropdownMenuTrigger",x_=L.forwardRef((t,e)=>{const{__scopeDropdownMenu:r,disabled:n=!1,...i}=t,o=v_(b_,r),s=jt(r);return ee.jsx(VU,{asChild:!0,...s,children:ee.jsx($e.button,{type:"button",id:o.triggerId,"aria-haspopup":"menu","aria-expanded":o.open,"aria-controls":o.open?o.contentId:void 0,"data-state":o.open?"open":"closed","data-disabled":n?"":void 0,disabled:n,...i,ref:Lf(e,o.triggerRef),onPointerDown:Ae(t.onPointerDown,a=>{!n&&a.button===0&&a.ctrlKey===!1&&(o.onOpenToggle(),o.open||a.preventDefault())}),onKeyDown:Ae(t.onKeyDown,a=>{n||(["Enter"," "].includes(a.key)&&o.onOpenToggle(),a.key==="ArrowDown"&&o.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(a.key)&&a.preventDefault())})})})});x_.displayName=b_;var lW="DropdownMenuPortal",S_=t=>{const{__scopeDropdownMenu:e,...r}=t,n=jt(e);return ee.jsx(GU,{...n,...r})};S_.displayName=lW;var E_="DropdownMenuContent",T_=L.forwardRef((t,e)=>{const{__scopeDropdownMenu:r,...n}=t,i=v_(E_,r),o=jt(r),s=L.useRef(!1);return ee.jsx(KU,{id:i.contentId,"aria-labelledby":i.triggerId,...o,...n,ref:e,onCloseAutoFocus:Ae(t.onCloseAutoFocus,a=>{var l;s.current||(l=i.triggerRef.current)==null||l.focus(),s.current=!1,a.preventDefault()}),onInteractOutside:Ae(t.onInteractOutside,a=>{const l=a.detail.originalEvent,c=l.button===0&&l.ctrlKey===!0,u=l.button===2||c;(!i.modal||u)&&(s.current=!0)}),style:{...t.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});T_.displayName=E_;var cW="DropdownMenuGroup",A_=L.forwardRef((t,e)=>{const{__scopeDropdownMenu:r,...n}=t,i=jt(r);return ee.jsx(qU,{...i,...n,ref:e})});A_.displayName=cW;var uW="DropdownMenuLabel",C_=L.forwardRef((t,e)=>{const{__scopeDropdownMenu:r,...n}=t,i=jt(r);return ee.jsx(XU,{...i,...n,ref:e})});C_.displayName=uW;var fW="DropdownMenuItem",k_=L.forwardRef((t,e)=>{const{__scopeDropdownMenu:r,...n}=t,i=jt(r);return ee.jsx(JU,{...i,...n,ref:e})});k_.displayName=fW;var dW="DropdownMenuCheckboxItem",__=L.forwardRef((t,e)=>{const{__scopeDropdownMenu:r,...n}=t,i=jt(r);return ee.jsx(YU,{...i,...n,ref:e})});__.displayName=dW;var hW="DropdownMenuRadioGroup",O_=L.forwardRef((t,e)=>{const{__scopeDropdownMenu:r,...n}=t,i=jt(r);return ee.jsx(ZU,{...i,...n,ref:e})});O_.displayName=hW;var pW="DropdownMenuRadioItem",R_=L.forwardRef((t,e)=>{const{__scopeDropdownMenu:r,...n}=t,i=jt(r);return ee.jsx(QU,{...i,...n,ref:e})});R_.displayName=pW;var mW="DropdownMenuItemIndicator",M_=L.forwardRef((t,e)=>{const{__scopeDropdownMenu:r,...n}=t,i=jt(r);return ee.jsx(eW,{...i,...n,ref:e})});M_.displayName=mW;var gW="DropdownMenuSeparator",I_=L.forwardRef((t,e)=>{const{__scopeDropdownMenu:r,...n}=t,i=jt(r);return ee.jsx(tW,{...i,...n,ref:e})});I_.displayName=gW;var yW="DropdownMenuArrow",vW=L.forwardRef((t,e)=>{const{__scopeDropdownMenu:r,...n}=t,i=jt(r);return ee.jsx(rW,{...i,...n,ref:e})});vW.displayName=yW;var wW=t=>{const{__scopeDropdownMenu:e,children:r,open:n,onOpenChange:i,defaultOpen:o}=t,s=jt(e),[a=!1,l]=On({prop:n,defaultProp:o,onChange:i});return ee.jsx(nW,{...s,open:a,onOpenChange:l,children:r})},bW="DropdownMenuSubTrigger",N_=L.forwardRef((t,e)=>{const{__scopeDropdownMenu:r,...n}=t,i=jt(r);return ee.jsx(iW,{...i,...n,ref:e})});N_.displayName=bW;var xW="DropdownMenuSubContent",D_=L.forwardRef((t,e)=>{const{__scopeDropdownMenu:r,...n}=t,i=jt(r);return ee.jsx(oW,{...i,...n,ref:e,style:{...t.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});D_.displayName=xW;var SW=w_,EW=x_,TW=S_,AW=T_,CW=A_,kW=C_,_W=k_,OW=__,RW=O_,MW=R_,IW=M_,NW=I_,DW=wW,PW=N_,LW=D_,FW="Label",P_=L.forwardRef((t,e)=>ee.jsx($e.label,{...t,ref:e,onMouseDown:r=>{var i;r.target.closest("button, input, select, textarea")||((i=t.onMouseDown)==null||i.call(t,r),!r.defaultPrevented&&r.detail>1&&r.preventDefault())}}));P_.displayName=FW;var BW=P_,vv="Popover",[L_,$ae]=nn(vv,[Ps]),bl=Ps(),[$W,Oi]=L_(vv),F_=t=>{const{__scopePopover:e,children:r,open:n,defaultOpen:i,onOpenChange:o,modal:s=!1}=t,a=bl(e),l=L.useRef(null),[c,u]=L.useState(!1),[f=!1,d]=On({prop:n,defaultProp:i,onChange:o});return ee.jsx(Uf,{...a,children:ee.jsx($W,{scope:e,contentId:pi(),triggerRef:l,open:f,onOpenChange:d,onOpenToggle:L.useCallback(()=>d(h=>!h),[d]),hasCustomAnchor:c,onCustomAnchorAdd:L.useCallback(()=>u(!0),[]),onCustomAnchorRemove:L.useCallback(()=>u(!1),[]),modal:s,children:r})})};F_.displayName=vv;var B_="PopoverAnchor",jW=L.forwardRef((t,e)=>{const{__scopePopover:r,...n}=t,i=Oi(B_,r),o=bl(r),{onCustomAnchorAdd:s,onCustomAnchorRemove:a}=i;return L.useEffect(()=>(s(),()=>a()),[s,a]),ee.jsx(Wf,{...o,...n,ref:e})});jW.displayName=B_;var $_="PopoverTrigger",j_=L.forwardRef((t,e)=>{const{__scopePopover:r,...n}=t,i=Oi($_,r),o=bl(r),s=lt(e,i.triggerRef),a=ee.jsx($e.button,{type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.contentId,"data-state":V_(i.open),...n,ref:s,onClick:Ae(t.onClick,i.onOpenToggle)});return i.hasCustomAnchor?a:ee.jsx(Wf,{asChild:!0,...o,children:a})});j_.displayName=$_;var wv="PopoverPortal",[HW,zW]=L_(wv,{forceMount:void 0}),H_=t=>{const{__scopePopover:e,forceMount:r,children:n,container:i}=t,o=Oi(wv,e);return ee.jsx(HW,{scope:e,forceMount:r,children:ee.jsx(on,{present:r||o.open,children:ee.jsx(Vf,{asChild:!0,container:i,children:n})})})};H_.displayName=wv;var ys="PopoverContent",z_=L.forwardRef((t,e)=>{const r=zW(ys,t.__scopePopover),{forceMount:n=r.forceMount,...i}=t,o=Oi(ys,t.__scopePopover);return ee.jsx(on,{present:n||o.open,children:o.modal?ee.jsx(UW,{...i,ref:e}):ee.jsx(WW,{...i,ref:e})})});z_.displayName=ys;var UW=L.forwardRef((t,e)=>{const r=Oi(ys,t.__scopePopover),n=L.useRef(null),i=lt(e,n),o=L.useRef(!1);return L.useEffect(()=>{const s=n.current;if(s)return $k(s)},[]),ee.jsx(lv,{as:ro,allowPinchZoom:!0,children:ee.jsx(U_,{...t,ref:i,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Ae(t.onCloseAutoFocus,s=>{var a;s.preventDefault(),o.current||(a=r.triggerRef.current)==null||a.focus()}),onPointerDownOutside:Ae(t.onPointerDownOutside,s=>{const a=s.detail.originalEvent,l=a.button===0&&a.ctrlKey===!0,c=a.button===2||l;o.current=c},{checkForDefaultPrevented:!1}),onFocusOutside:Ae(t.onFocusOutside,s=>s.preventDefault(),{checkForDefaultPrevented:!1})})})}),WW=L.forwardRef((t,e)=>{const r=Oi(ys,t.__scopePopover),n=L.useRef(!1),i=L.useRef(!1);return ee.jsx(U_,{...t,ref:e,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:o=>{var s,a;(s=t.onCloseAutoFocus)==null||s.call(t,o),o.defaultPrevented||(n.current||(a=r.triggerRef.current)==null||a.focus(),o.preventDefault()),n.current=!1,i.current=!1},onInteractOutside:o=>{var l,c;(l=t.onInteractOutside)==null||l.call(t,o),o.defaultPrevented||(n.current=!0,o.detail.originalEvent.type==="pointerdown"&&(i.current=!0));const s=o.target;((c=r.triggerRef.current)==null?void 0:c.contains(s))&&o.preventDefault(),o.detail.originalEvent.type==="focusin"&&i.current&&o.preventDefault()}})}),U_=L.forwardRef((t,e)=>{const{__scopePopover:r,trapFocus:n,onOpenAutoFocus:i,onCloseAutoFocus:o,disableOutsidePointerEvents:s,onEscapeKeyDown:a,onPointerDownOutside:l,onFocusOutside:c,onInteractOutside:u,...f}=t,d=Oi(ys,r),h=bl(r);return ck(),ee.jsx(Yy,{asChild:!0,loop:!0,trapped:n,onMountAutoFocus:i,onUnmountAutoFocus:o,children:ee.jsx(ml,{asChild:!0,disableOutsidePointerEvents:s,onInteractOutside:u,onEscapeKeyDown:a,onPointerDownOutside:l,onFocusOutside:c,onDismiss:()=>d.onOpenChange(!1),children:ee.jsx(sv,{"data-state":V_(d.open),role:"dialog",id:d.contentId,...h,...f,ref:e,style:{...f.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})}),W_="PopoverClose",VW=L.forwardRef((t,e)=>{const{__scopePopover:r,...n}=t,i=Oi(W_,r);return ee.jsx($e.button,{type:"button",...n,ref:e,onClick:Ae(t.onClick,()=>i.onOpenChange(!1))})});VW.displayName=W_;var GW="PopoverArrow",KW=L.forwardRef((t,e)=>{const{__scopePopover:r,...n}=t,i=bl(r);return ee.jsx(av,{...i,...n,ref:e})});KW.displayName=GW;function V_(t){return t?"open":"closed"}var qW=F_,XW=j_,JW=H_,YW=z_,ZW="Separator",V1="horizontal",QW=["horizontal","vertical"],G_=L.forwardRef((t,e)=>{const{decorative:r,orientation:n=V1,...i}=t,o=eV(n)?n:V1,a=r?{role:"none"}:{"aria-orientation":o==="vertical"?o:void 0,role:"separator"};return ee.jsx($e.div,{"data-orientation":o,...a,...i,ref:e})});G_.displayName=ZW;function eV(t){return QW.includes(t)}var tV=G_;function rV(t){const e=L.useRef({value:t,previous:t});return L.useMemo(()=>(e.current.value!==t&&(e.current.previous=e.current.value,e.current.value=t),e.current.previous),[t])}var bv="Switch",[nV,jae]=nn(bv),[iV,oV]=nV(bv),K_=L.forwardRef((t,e)=>{const{__scopeSwitch:r,name:n,checked:i,defaultChecked:o,required:s,disabled:a,value:l="on",onCheckedChange:c,...u}=t,[f,d]=L.useState(null),h=lt(e,b=>d(b)),p=L.useRef(!1),m=f?!!f.closest("form"):!0,[y=!1,g]=On({prop:i,defaultProp:o,onChange:c});return ee.jsxs(iV,{scope:r,checked:y,disabled:a,children:[ee.jsx($e.button,{type:"button",role:"switch","aria-checked":y,"aria-required":s,"data-state":J_(y),"data-disabled":a?"":void 0,disabled:a,value:l,...u,ref:h,onClick:Ae(t.onClick,b=>{g(S=>!S),m&&(p.current=b.isPropagationStopped(),p.current||b.stopPropagation())})}),m&&ee.jsx(sV,{control:f,bubbles:!p.current,name:n,value:l,checked:y,required:s,disabled:a,style:{transform:"translateX(-100%)"}})]})});K_.displayName=bv;var q_="SwitchThumb",X_=L.forwardRef((t,e)=>{const{__scopeSwitch:r,...n}=t,i=oV(q_,r);return ee.jsx($e.span,{"data-state":J_(i.checked),"data-disabled":i.disabled?"":void 0,...n,ref:e})});X_.displayName=q_;var sV=t=>{const{control:e,checked:r,bubbles:n=!0,...i}=t,o=L.useRef(null),s=rV(r),a=xk(e);return L.useEffect(()=>{const l=o.current,c=window.HTMLInputElement.prototype,f=Object.getOwnPropertyDescriptor(c,"checked").set;if(s!==r&&f){const d=new Event("click",{bubbles:n});f.call(l,r),l.dispatchEvent(d)}},[s,r,n]),ee.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:r,...i,tabIndex:-1,ref:o,style:{...t.style,...a,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})};function J_(t){return t?"checked":"unchecked"}var aV=K_,lV=X_,xv="Tabs",[cV,Hae]=nn(xv,[Kf]),Y_=Kf(),[uV,Sv]=cV(xv),Z_=L.forwardRef((t,e)=>{const{__scopeTabs:r,value:n,onValueChange:i,defaultValue:o,orientation:s="horizontal",dir:a,activationMode:l="automatic",...c}=t,u=Jy(a),[f,d]=On({prop:n,onChange:i,defaultProp:o});return ee.jsx(uV,{scope:r,baseId:pi(),value:f,onValueChange:d,orientation:s,dir:u,activationMode:l,children:ee.jsx($e.div,{dir:u,"data-orientation":s,...c,ref:e})})});Z_.displayName=xv;var Q_="TabsList",eO=L.forwardRef((t,e)=>{const{__scopeTabs:r,loop:n=!0,...i}=t,o=Sv(Q_,r),s=Y_(r);return ee.jsx(Lk,{asChild:!0,...s,orientation:o.orientation,dir:o.dir,loop:n,children:ee.jsx($e.div,{role:"tablist","aria-orientation":o.orientation,...i,ref:e})})});eO.displayName=Q_;var tO="TabsTrigger",rO=L.forwardRef((t,e)=>{const{__scopeTabs:r,value:n,disabled:i=!1,...o}=t,s=Sv(tO,r),a=Y_(r),l=oO(s.baseId,n),c=sO(s.baseId,n),u=n===s.value;return ee.jsx(Fk,{asChild:!0,...a,focusable:!i,active:u,children:ee.jsx($e.button,{type:"button",role:"tab","aria-selected":u,"aria-controls":c,"data-state":u?"active":"inactive","data-disabled":i?"":void 0,disabled:i,id:l,...o,ref:e,onMouseDown:Ae(t.onMouseDown,f=>{!i&&f.button===0&&f.ctrlKey===!1?s.onValueChange(n):f.preventDefault()}),onKeyDown:Ae(t.onKeyDown,f=>{[" ","Enter"].includes(f.key)&&s.onValueChange(n)}),onFocus:Ae(t.onFocus,()=>{const f=s.activationMode!=="manual";!u&&!i&&f&&s.onValueChange(n)})})})});rO.displayName=tO;var nO="TabsContent",iO=L.forwardRef((t,e)=>{const{__scopeTabs:r,value:n,forceMount:i,children:o,...s}=t,a=Sv(nO,r),l=oO(a.baseId,n),c=sO(a.baseId,n),u=n===a.value,f=L.useRef(u);return L.useEffect(()=>{const d=requestAnimationFrame(()=>f.current=!1);return()=>cancelAnimationFrame(d)},[]),ee.jsx(on,{present:i||u,children:({present:d})=>ee.jsx($e.div,{"data-state":u?"active":"inactive","data-orientation":a.orientation,role:"tabpanel","aria-labelledby":l,hidden:!d,id:c,tabIndex:0,...s,ref:e,style:{...t.style,animationDuration:f.current?"0s":void 0},children:d&&o})})});iO.displayName=nO;function oO(t,e){return`${t}-trigger-${e}`}function sO(t,e){return`${t}-content-${e}`}var fV=Z_,dV=eO,hV=rO,pV=iO,mV="VisuallyHidden",Jf=L.forwardRef((t,e)=>ee.jsx($e.span,{...t,ref:e,style:{position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal",...t.style}}));Jf.displayName=mV;var gV=Jf,Ev="ToastProvider",[Tv,yV,vV]=Xy("Toast"),[aO,zae]=nn("Toast",[vV]),[wV,Yf]=aO(Ev),lO=t=>{const{__scopeToast:e,label:r="Notification",duration:n=5e3,swipeDirection:i="right",swipeThreshold:o=50,children:s}=t,[a,l]=L.useState(null),[c,u]=L.useState(0),f=L.useRef(!1),d=L.useRef(!1);return r.trim()||console.error(`Invalid prop \`label\` supplied to \`${Ev}\`. Expected non-empty \`string\`.`),ee.jsx(Tv.Provider,{scope:e,children:ee.jsx(wV,{scope:e,label:r,duration:n,swipeDirection:i,swipeThreshold:o,toastCount:c,viewport:a,onViewportChange:l,onToastAdd:L.useCallback(()=>u(h=>h+1),[]),onToastRemove:L.useCallback(()=>u(h=>h-1),[]),isFocusedToastEscapeKeyDownRef:f,isClosePausedRef:d,children:s})})};lO.displayName=Ev;var cO="ToastViewport",bV=["F8"],eg="toast.viewportPause",tg="toast.viewportResume",uO=L.forwardRef((t,e)=>{const{__scopeToast:r,hotkey:n=bV,label:i="Notifications ({hotkey})",...o}=t,s=Yf(cO,r),a=yV(r),l=L.useRef(null),c=L.useRef(null),u=L.useRef(null),f=L.useRef(null),d=lt(e,f,s.onViewportChange),h=n.join("+").replace(/Key/g,"").replace(/Digit/g,""),p=s.toastCount>0;L.useEffect(()=>{const y=g=>{var S;n.every(x=>g[x]||g.code===x)&&((S=f.current)==null||S.focus())};return document.addEventListener("keydown",y),()=>document.removeEventListener("keydown",y)},[n]),L.useEffect(()=>{const y=l.current,g=f.current;if(p&&y&&g){const b=()=>{if(!s.isClosePausedRef.current){const M=new CustomEvent(eg);g.dispatchEvent(M),s.isClosePausedRef.current=!0}},S=()=>{if(s.isClosePausedRef.current){const M=new CustomEvent(tg);g.dispatchEvent(M),s.isClosePausedRef.current=!1}},x=M=>{!y.contains(M.relatedTarget)&&S()},O=()=>{y.contains(document.activeElement)||S()};return y.addEventListener("focusin",b),y.addEventListener("focusout",x),y.addEventListener("pointermove",b),y.addEventListener("pointerleave",O),window.addEventListener("blur",b),window.addEventListener("focus",S),()=>{y.removeEventListener("focusin",b),y.removeEventListener("focusout",x),y.removeEventListener("pointermove",b),y.removeEventListener("pointerleave",O),window.removeEventListener("blur",b),window.removeEventListener("focus",S)}}},[p,s.isClosePausedRef]);const m=L.useCallback(({tabbingDirection:y})=>{const b=a().map(S=>{const x=S.ref.current,O=[x,...NV(x)];return y==="forwards"?O:O.reverse()});return(y==="forwards"?b.reverse():b).flat()},[a]);return L.useEffect(()=>{const y=f.current;if(y){const g=b=>{var O,M,D;const S=b.altKey||b.ctrlKey||b.metaKey;if(b.key==="Tab"&&!S){const $=document.activeElement,A=b.shiftKey;if(b.target===y&&A){(O=c.current)==null||O.focus();return}const I=m({tabbingDirection:A?"backwards":"forwards"}),U=I.findIndex(k=>k===$);kh(I.slice(U+1))?b.preventDefault():A?(M=c.current)==null||M.focus():(D=u.current)==null||D.focus()}};return y.addEventListener("keydown",g),()=>y.removeEventListener("keydown",g)}},[a,m]),ee.jsxs(iH,{ref:l,role:"region","aria-label":i.replace("{hotkey}",h),tabIndex:-1,style:{pointerEvents:p?void 0:"none"},children:[p&&ee.jsx(rg,{ref:c,onFocusFromOutsideViewport:()=>{const y=m({tabbingDirection:"forwards"});kh(y)}}),ee.jsx(Tv.Slot,{scope:r,children:ee.jsx($e.ol,{tabIndex:-1,...o,ref:d})}),p&&ee.jsx(rg,{ref:u,onFocusFromOutsideViewport:()=>{const y=m({tabbingDirection:"backwards"});kh(y)}})]})});uO.displayName=cO;var fO="ToastFocusProxy",rg=L.forwardRef((t,e)=>{const{__scopeToast:r,onFocusFromOutsideViewport:n,...i}=t,o=Yf(fO,r);return ee.jsx(Jf,{"aria-hidden":!0,tabIndex:0,...i,ref:e,style:{position:"fixed"},onFocus:s=>{var c;const a=s.relatedTarget;!((c=o.viewport)!=null&&c.contains(a))&&n()}})});rg.displayName=fO;var Zf="Toast",xV="toast.swipeStart",SV="toast.swipeMove",EV="toast.swipeCancel",TV="toast.swipeEnd",dO=L.forwardRef((t,e)=>{const{forceMount:r,open:n,defaultOpen:i,onOpenChange:o,...s}=t,[a=!0,l]=On({prop:n,defaultProp:i,onChange:o});return ee.jsx(on,{present:r||a,children:ee.jsx(kV,{open:a,...s,ref:e,onClose:()=>l(!1),onPause:Pt(t.onPause),onResume:Pt(t.onResume),onSwipeStart:Ae(t.onSwipeStart,c=>{c.currentTarget.setAttribute("data-swipe","start")}),onSwipeMove:Ae(t.onSwipeMove,c=>{const{x:u,y:f}=c.detail.delta;c.currentTarget.setAttribute("data-swipe","move"),c.currentTarget.style.setProperty("--radix-toast-swipe-move-x",`${u}px`),c.currentTarget.style.setProperty("--radix-toast-swipe-move-y",`${f}px`)}),onSwipeCancel:Ae(t.onSwipeCancel,c=>{c.currentTarget.setAttribute("data-swipe","cancel"),c.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),c.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),c.currentTarget.style.removeProperty("--radix-toast-swipe-end-x"),c.currentTarget.style.removeProperty("--radix-toast-swipe-end-y")}),onSwipeEnd:Ae(t.onSwipeEnd,c=>{const{x:u,y:f}=c.detail.delta;c.currentTarget.setAttribute("data-swipe","end"),c.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),c.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),c.currentTarget.style.setProperty("--radix-toast-swipe-end-x",`${u}px`),c.currentTarget.style.setProperty("--radix-toast-swipe-end-y",`${f}px`),l(!1)})})})});dO.displayName=Zf;var[AV,CV]=aO(Zf,{onClose(){}}),kV=L.forwardRef((t,e)=>{const{__scopeToast:r,type:n="foreground",duration:i,open:o,onClose:s,onEscapeKeyDown:a,onPause:l,onResume:c,onSwipeStart:u,onSwipeMove:f,onSwipeCancel:d,onSwipeEnd:h,...p}=t,m=Yf(Zf,r),[y,g]=L.useState(null),b=lt(e,k=>g(k)),S=L.useRef(null),x=L.useRef(null),O=i||m.duration,M=L.useRef(0),D=L.useRef(O),$=L.useRef(0),{onToastAdd:A,onToastRemove:V}=m,Q=Pt(()=>{var G;(y==null?void 0:y.contains(document.activeElement))&&((G=m.viewport)==null||G.focus()),s()}),I=L.useCallback(k=>{!k||k===1/0||(window.clearTimeout($.current),M.current=new Date().getTime(),$.current=window.setTimeout(Q,k))},[Q]);L.useEffect(()=>{const k=m.viewport;if(k){const G=()=>{I(D.current),c==null||c()},te=()=>{const W=new Date().getTime()-M.current;D.current=D.current-W,window.clearTimeout($.current),l==null||l()};return k.addEventListener(eg,te),k.addEventListener(tg,G),()=>{k.removeEventListener(eg,te),k.removeEventListener(tg,G)}}},[m.viewport,O,l,c,I]),L.useEffect(()=>{o&&!m.isClosePausedRef.current&&I(O)},[o,O,m.isClosePausedRef,I]),L.useEffect(()=>(A(),()=>V()),[A,V]);const U=L.useMemo(()=>y?wO(y):null,[y]);return m.viewport?ee.jsxs(ee.Fragment,{children:[U&&ee.jsx(_V,{__scopeToast:r,role:"status","aria-live":n==="foreground"?"assertive":"polite","aria-atomic":!0,children:U}),ee.jsx(AV,{scope:r,onClose:Q,children:wf.createPortal(ee.jsx(Tv.ItemSlot,{scope:r,children:ee.jsx(nH,{asChild:!0,onEscapeKeyDown:Ae(a,()=>{m.isFocusedToastEscapeKeyDownRef.current||Q(),m.isFocusedToastEscapeKeyDownRef.current=!1}),children:ee.jsx($e.li,{role:"status","aria-live":"off","aria-atomic":!0,tabIndex:0,"data-state":o?"open":"closed","data-swipe-direction":m.swipeDirection,...p,ref:b,style:{userSelect:"none",touchAction:"none",...t.style},onKeyDown:Ae(t.onKeyDown,k=>{k.key==="Escape"&&(a==null||a(k.nativeEvent),k.nativeEvent.defaultPrevented||(m.isFocusedToastEscapeKeyDownRef.current=!0,Q()))}),onPointerDown:Ae(t.onPointerDown,k=>{k.button===0&&(S.current={x:k.clientX,y:k.clientY})}),onPointerMove:Ae(t.onPointerMove,k=>{if(!S.current)return;const G=k.clientX-S.current.x,te=k.clientY-S.current.y,W=!!x.current,ae=["left","right"].includes(m.swipeDirection),X=["left","up"].includes(m.swipeDirection)?Math.min:Math.max,de=ae?X(0,G):0,q=ae?0:X(0,te),N=k.pointerType==="touch"?10:2,Y={x:de,y:q},Z={originalEvent:k,delta:Y};W?(x.current=Y,Vl(SV,f,Z,{discrete:!1})):G1(Y,m.swipeDirection,N)?(x.current=Y,Vl(xV,u,Z,{discrete:!1}),k.target.setPointerCapture(k.pointerId)):(Math.abs(G)>N||Math.abs(te)>N)&&(S.current=null)}),onPointerUp:Ae(t.onPointerUp,k=>{const G=x.current,te=k.target;if(te.hasPointerCapture(k.pointerId)&&te.releasePointerCapture(k.pointerId),x.current=null,S.current=null,G){const W=k.currentTarget,ae={originalEvent:k,delta:G};G1(G,m.swipeDirection,m.swipeThreshold)?Vl(TV,h,ae,{discrete:!0}):Vl(EV,d,ae,{discrete:!0}),W.addEventListener("click",X=>X.preventDefault(),{once:!0})}})})})}),m.viewport)})]}):null}),_V=t=>{const{__scopeToast:e,children:r,...n}=t,i=Yf(Zf,e),[o,s]=L.useState(!1),[a,l]=L.useState(!1);return MV(()=>s(!0)),L.useEffect(()=>{const c=window.setTimeout(()=>l(!0),1e3);return()=>window.clearTimeout(c)},[]),a?null:ee.jsx(Vf,{asChild:!0,children:ee.jsx(Jf,{...n,children:o&&ee.jsxs(ee.Fragment,{children:[i.label," ",r]})})})},OV="ToastTitle",hO=L.forwardRef((t,e)=>{const{__scopeToast:r,...n}=t;return ee.jsx($e.div,{...n,ref:e})});hO.displayName=OV;var RV="ToastDescription",pO=L.forwardRef((t,e)=>{const{__scopeToast:r,...n}=t;return ee.jsx($e.div,{...n,ref:e})});pO.displayName=RV;var mO="ToastAction",gO=L.forwardRef((t,e)=>{const{altText:r,...n}=t;return r.trim()?ee.jsx(vO,{altText:r,asChild:!0,children:ee.jsx(Av,{...n,ref:e})}):(console.error(`Invalid prop \`altText\` supplied to \`${mO}\`. Expected non-empty \`string\`.`),null)});gO.displayName=mO;var yO="ToastClose",Av=L.forwardRef((t,e)=>{const{__scopeToast:r,...n}=t,i=CV(yO,r);return ee.jsx(vO,{asChild:!0,children:ee.jsx($e.button,{type:"button",...n,ref:e,onClick:Ae(t.onClick,i.onClose)})})});Av.displayName=yO;var vO=L.forwardRef((t,e)=>{const{__scopeToast:r,altText:n,...i}=t;return ee.jsx($e.div,{"data-radix-toast-announce-exclude":"","data-radix-toast-announce-alt":n||void 0,...i,ref:e})});function wO(t){const e=[];return Array.from(t.childNodes).forEach(n=>{if(n.nodeType===n.TEXT_NODE&&n.textContent&&e.push(n.textContent),IV(n)){const i=n.ariaHidden||n.hidden||n.style.display==="none",o=n.dataset.radixToastAnnounceExclude==="";if(!i)if(o){const s=n.dataset.radixToastAnnounceAlt;s&&e.push(s)}else e.push(...wO(n))}}),e}function Vl(t,e,r,{discrete:n}){const i=r.originalEvent.currentTarget,o=new CustomEvent(t,{bubbles:!0,cancelable:!0,detail:r});e&&i.addEventListener(t,e,{once:!0}),n?qy(i,o):i.dispatchEvent(o)}var G1=(t,e,r=0)=>{const n=Math.abs(t.x),i=Math.abs(t.y),o=n>i;return e==="left"||e==="right"?o&&n>r:!o&&i>r};function MV(t=()=>{}){const e=Pt(t);hi(()=>{let r=0,n=0;return r=window.requestAnimationFrame(()=>n=window.requestAnimationFrame(e)),()=>{window.cancelAnimationFrame(r),window.cancelAnimationFrame(n)}},[e])}function IV(t){return t.nodeType===t.ELEMENT_NODE}function NV(t){const e=[],r=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,{acceptNode:n=>{const i=n.tagName==="INPUT"&&n.type==="hidden";return n.disabled||n.hidden||i?NodeFilter.FILTER_SKIP:n.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;r.nextNode();)e.push(r.currentNode);return e}function kh(t){const e=document.activeElement;return t.some(r=>r===e?!0:(r.focus(),document.activeElement!==e))}var DV=lO,PV=uO,LV=dO,FV=hO,BV=pO,$V=gO,jV=Av,HV="Toggle",bO=L.forwardRef((t,e)=>{const{pressed:r,defaultPressed:n=!1,onPressedChange:i,...o}=t,[s=!1,a]=On({prop:r,onChange:i,defaultProp:n});return ee.jsx($e.button,{type:"button","aria-pressed":s,"data-state":s?"on":"off","data-disabled":t.disabled?"":void 0,...o,ref:e,onClick:Ae(t.onClick,()=>{t.disabled||a(!s)})})});bO.displayName=HV;var zV=bO,[Qf,Uae]=nn("Tooltip",[Ps]),ed=Ps(),xO="TooltipProvider",UV=700,ng="tooltip.open",[WV,Cv]=Qf(xO),SO=t=>{const{__scopeTooltip:e,delayDuration:r=UV,skipDelayDuration:n=300,disableHoverableContent:i=!1,children:o}=t,[s,a]=L.useState(!0),l=L.useRef(!1),c=L.useRef(0);return L.useEffect(()=>{const u=c.current;return()=>window.clearTimeout(u)},[]),ee.jsx(WV,{scope:e,isOpenDelayed:s,delayDuration:r,onOpen:L.useCallback(()=>{window.clearTimeout(c.current),a(!1)},[]),onClose:L.useCallback(()=>{window.clearTimeout(c.current),c.current=window.setTimeout(()=>a(!0),n)},[n]),isPointerInTransitRef:l,onPointerInTransitChange:L.useCallback(u=>{l.current=u},[]),disableHoverableContent:i,children:o})};SO.displayName=xO;var td="Tooltip",[VV,rd]=Qf(td),EO=t=>{const{__scopeTooltip:e,children:r,open:n,defaultOpen:i=!1,onOpenChange:o,disableHoverableContent:s,delayDuration:a}=t,l=Cv(td,t.__scopeTooltip),c=ed(e),[u,f]=L.useState(null),d=pi(),h=L.useRef(0),p=s??l.disableHoverableContent,m=a??l.delayDuration,y=L.useRef(!1),[g=!1,b]=On({prop:n,defaultProp:i,onChange:D=>{D?(l.onOpen(),document.dispatchEvent(new CustomEvent(ng))):l.onClose(),o==null||o(D)}}),S=L.useMemo(()=>g?y.current?"delayed-open":"instant-open":"closed",[g]),x=L.useCallback(()=>{window.clearTimeout(h.current),y.current=!1,b(!0)},[b]),O=L.useCallback(()=>{window.clearTimeout(h.current),b(!1)},[b]),M=L.useCallback(()=>{window.clearTimeout(h.current),h.current=window.setTimeout(()=>{y.current=!0,b(!0)},m)},[m,b]);return L.useEffect(()=>()=>window.clearTimeout(h.current),[]),ee.jsx(Uf,{...c,children:ee.jsx(VV,{scope:e,contentId:d,open:g,stateAttribute:S,trigger:u,onTriggerChange:f,onTriggerEnter:L.useCallback(()=>{l.isOpenDelayed?M():x()},[l.isOpenDelayed,M,x]),onTriggerLeave:L.useCallback(()=>{p?O():window.clearTimeout(h.current)},[O,p]),onOpen:x,onClose:O,disableHoverableContent:p,children:r})})};EO.displayName=td;var ig="TooltipTrigger",TO=L.forwardRef((t,e)=>{const{__scopeTooltip:r,...n}=t,i=rd(ig,r),o=Cv(ig,r),s=ed(r),a=L.useRef(null),l=lt(e,a,i.onTriggerChange),c=L.useRef(!1),u=L.useRef(!1),f=L.useCallback(()=>c.current=!1,[]);return L.useEffect(()=>()=>document.removeEventListener("pointerup",f),[f]),ee.jsx(Wf,{asChild:!0,...s,children:ee.jsx($e.button,{"aria-describedby":i.open?i.contentId:void 0,"data-state":i.stateAttribute,...n,ref:l,onPointerMove:Ae(t.onPointerMove,d=>{d.pointerType!=="touch"&&!u.current&&!o.isPointerInTransitRef.current&&(i.onTriggerEnter(),u.current=!0)}),onPointerLeave:Ae(t.onPointerLeave,()=>{i.onTriggerLeave(),u.current=!1}),onPointerDown:Ae(t.onPointerDown,()=>{c.current=!0,document.addEventListener("pointerup",f,{once:!0})}),onFocus:Ae(t.onFocus,()=>{c.current||i.onOpen()}),onBlur:Ae(t.onBlur,i.onClose),onClick:Ae(t.onClick,i.onClose)})})});TO.displayName=ig;var GV="TooltipPortal",[Wae,KV]=Qf(GV,{forceMount:void 0}),vs="TooltipContent",AO=L.forwardRef((t,e)=>{const r=KV(vs,t.__scopeTooltip),{forceMount:n=r.forceMount,side:i="top",...o}=t,s=rd(vs,t.__scopeTooltip);return ee.jsx(on,{present:n||s.open,children:s.disableHoverableContent?ee.jsx(CO,{side:i,...o,ref:e}):ee.jsx(qV,{side:i,...o,ref:e})})}),qV=L.forwardRef((t,e)=>{const r=rd(vs,t.__scopeTooltip),n=Cv(vs,t.__scopeTooltip),i=L.useRef(null),o=lt(e,i),[s,a]=L.useState(null),{trigger:l,onClose:c}=r,u=i.current,{onPointerInTransitChange:f}=n,d=L.useCallback(()=>{a(null),f(!1)},[f]),h=L.useCallback((p,m)=>{const y=p.currentTarget,g={x:p.clientX,y:p.clientY},b=ZV(g,y.getBoundingClientRect()),S=QV(g,b),x=e7(m.getBoundingClientRect()),O=r7([...S,...x]);a(O),f(!0)},[f]);return L.useEffect(()=>()=>d(),[d]),L.useEffect(()=>{if(l&&u){const p=y=>h(y,u),m=y=>h(y,l);return l.addEventListener("pointerleave",p),u.addEventListener("pointerleave",m),()=>{l.removeEventListener("pointerleave",p),u.removeEventListener("pointerleave",m)}}},[l,u,h,d]),L.useEffect(()=>{if(s){const p=m=>{const y=m.target,g={x:m.clientX,y:m.clientY},b=(l==null?void 0:l.contains(y))||(u==null?void 0:u.contains(y)),S=!t7(g,s);b?d():S&&(d(),c())};return document.addEventListener("pointermove",p),()=>document.removeEventListener("pointermove",p)}},[l,u,s,c,d]),ee.jsx(CO,{...t,ref:o})}),[XV,JV]=Qf(td,{isInside:!1}),CO=L.forwardRef((t,e)=>{const{__scopeTooltip:r,children:n,"aria-label":i,onEscapeKeyDown:o,onPointerDownOutside:s,...a}=t,l=rd(vs,r),c=ed(r),{onClose:u}=l;return L.useEffect(()=>(document.addEventListener(ng,u),()=>document.removeEventListener(ng,u)),[u]),L.useEffect(()=>{if(l.trigger){const f=d=>{const h=d.target;h!=null&&h.contains(l.trigger)&&u()};return window.addEventListener("scroll",f,{capture:!0}),()=>window.removeEventListener("scroll",f,{capture:!0})}},[l.trigger,u]),ee.jsx(ml,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:o,onPointerDownOutside:s,onFocusOutside:f=>f.preventDefault(),onDismiss:u,children:ee.jsxs(sv,{"data-state":l.stateAttribute,...c,...a,ref:e,style:{...a.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[ee.jsx(kA,{children:n}),ee.jsx(XV,{scope:r,isInside:!0,children:ee.jsx(gV,{id:l.contentId,role:"tooltip",children:i||n})})]})})});AO.displayName=vs;var kO="TooltipArrow",YV=L.forwardRef((t,e)=>{const{__scopeTooltip:r,...n}=t,i=ed(r);return JV(kO,r).isInside?null:ee.jsx(av,{...i,...n,ref:e})});YV.displayName=kO;function ZV(t,e){const r=Math.abs(e.top-t.y),n=Math.abs(e.bottom-t.y),i=Math.abs(e.right-t.x),o=Math.abs(e.left-t.x);switch(Math.min(r,n,i,o)){case o:return"left";case i:return"right";case r:return"top";case n:return"bottom";default:throw new Error("unreachable")}}function QV(t,e,r=5){const n=[];switch(e){case"top":n.push({x:t.x-r,y:t.y+r},{x:t.x+r,y:t.y+r});break;case"bottom":n.push({x:t.x-r,y:t.y-r},{x:t.x+r,y:t.y-r});break;case"left":n.push({x:t.x+r,y:t.y-r},{x:t.x+r,y:t.y+r});break;case"right":n.push({x:t.x-r,y:t.y-r},{x:t.x-r,y:t.y+r});break}return n}function e7(t){const{top:e,right:r,bottom:n,left:i}=t;return[{x:i,y:e},{x:r,y:e},{x:r,y:n},{x:i,y:n}]}function t7(t,e){const{x:r,y:n}=t;let i=!1;for(let o=0,s=e.length-1;o<e.length;s=o++){const a=e[o].x,l=e[o].y,c=e[s].x,u=e[s].y;l>n!=u>n&&r<(c-a)*(n-l)/(u-l)+a&&(i=!i)}return i}function r7(t){const e=t.slice();return e.sort((r,n)=>r.x<n.x?-1:r.x>n.x?1:r.y<n.y?-1:r.y>n.y?1:0),n7(e)}function n7(t){if(t.length<=1)return t.slice();const e=[];for(let n=0;n<t.length;n++){const i=t[n];for(;e.length>=2;){const o=e[e.length-1],s=e[e.length-2];if((o.x-s.x)*(i.y-s.y)>=(o.y-s.y)*(i.x-s.x))e.pop();else break}e.push(i)}e.pop();const r=[];for(let n=t.length-1;n>=0;n--){const i=t[n];for(;r.length>=2;){const o=r[r.length-1],s=r[r.length-2];if((o.x-s.x)*(i.y-s.y)>=(o.y-s.y)*(i.x-s.x))r.pop();else break}r.push(i)}return r.pop(),e.length===1&&r.length===1&&e[0].x===r[0].x&&e[0].y===r[0].y?e:e.concat(r)}var i7=SO,o7=EO,s7=TO,a7=AO;function nd(){return(nd=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t}).apply(this,arguments)}function _O(t,e){if(t==null)return{};var r,n,i={},o=Object.keys(t);for(n=0;n<o.length;n++)e.indexOf(r=o[n])>=0||(i[r]=t[r]);return i}function og(t){var e=pe.useRef(t),r=pe.useRef(function(n){e.current&&e.current(n)});return e.current=t,r.current}var Ga=function(t,e,r){return e===void 0&&(e=0),r===void 0&&(r=1),t>r?r:t<e?e:t},xa=function(t){return"touches"in t},sg=function(t){return t&&t.ownerDocument.defaultView||self},K1=function(t,e,r){var n=t.getBoundingClientRect(),i=xa(e)?function(o,s){for(var a=0;a<o.length;a++)if(o[a].identifier===s)return o[a];return o[0]}(e.touches,r):e;return{left:Ga((i.pageX-(n.left+sg(t).pageXOffset))/n.width),top:Ga((i.pageY-(n.top+sg(t).pageYOffset))/n.height)}},q1=function(t){!xa(t)&&t.preventDefault()},OO=pe.memo(function(t){var e=t.onMove,r=t.onKey,n=_O(t,["onMove","onKey"]),i=pe.useRef(null),o=og(e),s=og(r),a=pe.useRef(null),l=pe.useRef(!1),c=pe.useMemo(function(){var h=function(y){q1(y),(xa(y)?y.touches.length>0:y.buttons>0)&&i.current?o(K1(i.current,y,a.current)):m(!1)},p=function(){return m(!1)};function m(y){var g=l.current,b=sg(i.current),S=y?b.addEventListener:b.removeEventListener;S(g?"touchmove":"mousemove",h),S(g?"touchend":"mouseup",p)}return[function(y){var g=y.nativeEvent,b=i.current;if(b&&(q1(g),!function(x,O){return O&&!xa(x)}(g,l.current)&&b)){if(xa(g)){l.current=!0;var S=g.changedTouches||[];S.length&&(a.current=S[0].identifier)}b.focus(),o(K1(b,g,a.current)),m(!0)}},function(y){var g=y.which||y.keyCode;g<37||g>40||(y.preventDefault(),s({left:g===39?.05:g===37?-.05:0,top:g===40?.05:g===38?-.05:0}))},m]},[s,o]),u=c[0],f=c[1],d=c[2];return pe.useEffect(function(){return d},[d]),pe.createElement("div",nd({},n,{onTouchStart:u,onMouseDown:u,className:"react-colorful__interactive",ref:i,onKeyDown:f,tabIndex:0,role:"slider"}))}),kv=function(t){return t.filter(Boolean).join(" ")},RO=function(t){var e=t.color,r=t.left,n=t.top,i=n===void 0?.5:n,o=kv(["react-colorful__pointer",t.className]);return pe.createElement("div",{className:o,style:{top:100*i+"%",left:100*r+"%"}},pe.createElement("div",{className:"react-colorful__pointer-fill",style:{backgroundColor:e}}))},kt=function(t,e,r){return e===void 0&&(e=0),r===void 0&&(r=Math.pow(10,e)),Math.round(r*t)/r},l7=function(t){return h7(ag(t))},ag=function(t){return t[0]==="#"&&(t=t.substring(1)),t.length<6?{r:parseInt(t[0]+t[0],16),g:parseInt(t[1]+t[1],16),b:parseInt(t[2]+t[2],16),a:t.length===4?kt(parseInt(t[3]+t[3],16)/255,2):1}:{r:parseInt(t.substring(0,2),16),g:parseInt(t.substring(2,4),16),b:parseInt(t.substring(4,6),16),a:t.length===8?kt(parseInt(t.substring(6,8),16)/255,2):1}},c7=function(t){return d7(f7(t))},u7=function(t){var e=t.s,r=t.v,n=t.a,i=(200-e)*r/100;return{h:kt(t.h),s:kt(i>0&&i<200?e*r/100/(i<=100?i:200-i)*100:0),l:kt(i/2),a:kt(n,2)}},lg=function(t){var e=u7(t);return"hsl("+e.h+", "+e.s+"%, "+e.l+"%)"},f7=function(t){var e=t.h,r=t.s,n=t.v,i=t.a;e=e/360*6,r/=100,n/=100;var o=Math.floor(e),s=n*(1-r),a=n*(1-(e-o)*r),l=n*(1-(1-e+o)*r),c=o%6;return{r:kt(255*[n,a,s,s,l,n][c]),g:kt(255*[l,n,n,a,s,s][c]),b:kt(255*[s,s,l,n,n,a][c]),a:kt(i,2)}},Gl=function(t){var e=t.toString(16);return e.length<2?"0"+e:e},d7=function(t){var e=t.r,r=t.g,n=t.b,i=t.a,o=i<1?Gl(kt(255*i)):"";return"#"+Gl(e)+Gl(r)+Gl(n)+o},h7=function(t){var e=t.r,r=t.g,n=t.b,i=t.a,o=Math.max(e,r,n),s=o-Math.min(e,r,n),a=s?o===e?(r-n)/s:o===r?2+(n-e)/s:4+(e-r)/s:0;return{h:kt(60*(a<0?a+6:a)),s:kt(o?s/o*100:0),v:kt(o/255*100),a:i}},p7=pe.memo(function(t){var e=t.hue,r=t.onChange,n=kv(["react-colorful__hue",t.className]);return pe.createElement("div",{className:n},pe.createElement(OO,{onMove:function(i){r({h:360*i.left})},onKey:function(i){r({h:Ga(e+360*i.left,0,360)})},"aria-label":"Hue","aria-valuenow":kt(e),"aria-valuemax":"360","aria-valuemin":"0"},pe.createElement(RO,{className:"react-colorful__hue-pointer",left:e/360,color:lg({h:e,s:100,v:100,a:1})})))}),m7=pe.memo(function(t){var e=t.hsva,r=t.onChange,n={backgroundColor:lg({h:e.h,s:100,v:100,a:1})};return pe.createElement("div",{className:"react-colorful__saturation",style:n},pe.createElement(OO,{onMove:function(i){r({s:100*i.left,v:100-100*i.top})},onKey:function(i){r({s:Ga(e.s+100*i.left,0,100),v:Ga(e.v-100*i.top,0,100)})},"aria-label":"Color","aria-valuetext":"Saturation "+kt(e.s)+"%, Brightness "+kt(e.v)+"%"},pe.createElement(RO,{className:"react-colorful__saturation-pointer",top:1-e.v/100,left:e.s/100,color:lg(e)})))}),MO=function(t,e){if(t===e)return!0;for(var r in t)if(t[r]!==e[r])return!1;return!0},g7=function(t,e){return t.toLowerCase()===e.toLowerCase()||MO(ag(t),ag(e))};function y7(t,e,r){var n=og(r),i=pe.useState(function(){return t.toHsva(e)}),o=i[0],s=i[1],a=pe.useRef({color:e,hsva:o});pe.useEffect(function(){if(!t.equal(e,a.current.color)){var c=t.toHsva(e);a.current={hsva:c,color:e},s(c)}},[e,t]),pe.useEffect(function(){var c;MO(o,a.current.hsva)||t.equal(c=t.fromHsva(o),a.current.color)||(a.current={hsva:o,color:c},n(c))},[o,t,n]);var l=pe.useCallback(function(c){s(function(u){return Object.assign({},u,c)})},[]);return[o,l]}var v7=typeof window<"u"?pe.useLayoutEffect:pe.useEffect,w7=function(){return typeof __webpack_nonce__<"u"?__webpack_nonce__:void 0},X1=new Map,b7=function(t){v7(function(){var e=t.current?t.current.ownerDocument:document;if(e!==void 0&&!X1.has(e)){var r=e.createElement("style");r.innerHTML=`.react-colorful{position:relative;display:flex;flex-direction:column;width:200px;height:200px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;cursor:default}.react-colorful__saturation{position:relative;flex-grow:1;border-color:transparent;border-bottom:12px solid #000;border-radius:8px 8px 0 0;background-image:linear-gradient(0deg,#000,transparent),linear-gradient(90deg,#fff,hsla(0,0%,100%,0))}.react-colorful__alpha-gradient,.react-colorful__pointer-fill{content:"";position:absolute;left:0;top:0;right:0;bottom:0;pointer-events:none;border-radius:inherit}.react-colorful__alpha-gradient,.react-colorful__saturation{box-shadow:inset 0 0 0 1px rgba(0,0,0,.05)}.react-colorful__alpha,.react-colorful__hue{position:relative;height:24px}.react-colorful__hue{background:linear-gradient(90deg,red 0,#ff0 17%,#0f0 33%,#0ff 50%,#00f 67%,#f0f 83%,red)}.react-colorful__last-control{border-radius:0 0 8px 8px}.react-colorful__interactive{position:absolute;left:0;top:0;right:0;bottom:0;border-radius:inherit;outline:none;touch-action:none}.react-colorful__pointer{position:absolute;z-index:1;box-sizing:border-box;width:28px;height:28px;transform:translate(-50%,-50%);background-color:#fff;border:2px solid #fff;border-radius:50%;box-shadow:0 2px 4px rgba(0,0,0,.2)}.react-colorful__interactive:focus .react-colorful__pointer{transform:translate(-50%,-50%) scale(1.1)}.react-colorful__alpha,.react-colorful__alpha-pointer{background-color:#fff;background-image:url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill-opacity=".05"><path d="M8 0h8v8H8zM0 8h8v8H0z"/></svg>')}.react-colorful__saturation-pointer{z-index:3}.react-colorful__hue-pointer{z-index:2}`,X1.set(e,r);var n=w7();n&&r.setAttribute("nonce",n),e.head.appendChild(r)}},[])},x7=function(t){var e=t.className,r=t.colorModel,n=t.color,i=n===void 0?r.defaultColor:n,o=t.onChange,s=_O(t,["className","colorModel","color","onChange"]),a=pe.useRef(null);b7(a);var l=y7(r,i,o),c=l[0],u=l[1],f=kv(["react-colorful",e]);return pe.createElement("div",nd({},s,{ref:a,className:f}),pe.createElement(m7,{hsva:c,onChange:u}),pe.createElement(p7,{hue:c.h,onChange:u,className:"react-colorful__last-control"}))},S7={defaultColor:"000",toHsva:l7,fromHsva:function(t){return c7({h:t.h,s:t.s,v:t.v,a:1})},equal:g7},E7=function(t){return pe.createElement(x7,nd({},t,{colorModel:S7}))};const T7=Symbol(),_v=Symbol(),Ys="a",Sa="w";let A7=(t,e)=>new Proxy(t,e);const cg=Object.getPrototypeOf,ug=new WeakMap,IO=t=>t&&(ug.has(t)?ug.get(t):cg(t)===Object.prototype||cg(t)===Array.prototype),ku=t=>typeof t=="object"&&t!==null,C7=t=>{if(Array.isArray(t))return Array.from(t);const e=Object.getOwnPropertyDescriptors(t);return Object.values(e).forEach(r=>{r.configurable=!0}),Object.create(cg(t),e)},Ov=t=>t[_v]||t,NO=(t,e,r,n)=>{if(!IO(t))return t;let i=n&&n.get(t);if(!i){const l=Ov(t);i=(c=>Object.values(Object.getOwnPropertyDescriptors(c)).some(u=>!u.configurable&&!u.writable))(l)?[l,C7(l)]:[l],n==null||n.set(t,i)}const[o,s]=i;let a=r&&r.get(o);return a&&a[1].f===!!s||(a=((l,c)=>{const u={f:c};let f=!1;const d=(p,m)=>{if(!f){let y=u[Ys].get(l);if(y||(y={},u[Ys].set(l,y)),p===Sa)y[Sa]=!0;else{let g=y[p];g||(g=new Set,y[p]=g),g.add(m)}}},h={get:(p,m)=>m===_v?l:(d("k",m),NO(Reflect.get(p,m),u[Ys],u.c,u.t)),has:(p,m)=>m===T7?(f=!0,u[Ys].delete(l),!0):(d("h",m),Reflect.has(p,m)),getOwnPropertyDescriptor:(p,m)=>(d("o",m),Reflect.getOwnPropertyDescriptor(p,m)),ownKeys:p=>(d(Sa),Reflect.ownKeys(p))};return c&&(h.set=h.deleteProperty=()=>!1),[h,u]})(o,!!s),a[1].p=A7(s||o,a[0]),r&&r.set(o,a)),a[1][Ys]=e,a[1].c=r,a[1].t=n,a[1].p},DO=(t,e,r,n,i=Object.is)=>{if(i(t,e))return!1;if(!ku(t)||!ku(e))return!0;const o=r.get(Ov(t));if(!o)return!0;if(n){const a=n.get(t);if(a&&a.n===e)return a.g;n.set(t,{n:e,g:!1})}let s=null;try{for(const a of o.h||[])if(s=Reflect.has(t,a)!==Reflect.has(e,a),s)return s;if(o[Sa]===!0){if(s=((a,l)=>{const c=Reflect.ownKeys(a),u=Reflect.ownKeys(l);return c.length!==u.length||c.some((f,d)=>f!==u[d])})(t,e),s)return s}else for(const a of o.o||[])if(s=!!Reflect.getOwnPropertyDescriptor(t,a)!=!!Reflect.getOwnPropertyDescriptor(e,a),s)return s;for(const a of o.k||[])if(s=DO(t[a],e[a],r,n,i),s)return s;return s===null&&(s=!0),s}finally{n&&n.set(t,{n:e,g:s})}},k7=t=>IO(t)&&t[_v]||null,J1=(t,e=!0)=>{ug.set(t,e)},_7=(t,e,r)=>{const n=[],i=new WeakSet,o=(s,a)=>{if(i.has(s))return;ku(s)&&i.add(s);const l=ku(s)&&e.get(Ov(s));if(l){var c,u;if((c=l.h)==null||c.forEach(d=>{const h=`:has(${String(d)})`;n.push(a?[...a,h]:[h])}),l[Sa]===!0){const d=":ownKeys";n.push(a?[...a,d]:[d])}else{var f;(f=l.o)==null||f.forEach(d=>{const h=`:hasOwn(${String(d)})`;n.push(a?[...a,h]:[h])})}(u=l.k)==null||u.forEach(d=>{!("value"in(Object.getOwnPropertyDescriptor(s,d)||{}))||o(s[d],a?[...a,d]:[d])})}else a&&n.push(a)};return o(t),n},_u={BASE_URL:"/",DEV:!1,MODE:"production",PROD:!0,SSR:!1},_h=t=>typeof t=="object"&&t!==null,Kn=new WeakMap,Kl=new WeakSet,O7=(t=Object.is,e=(c,u)=>new Proxy(c,u),r=c=>_h(c)&&!Kl.has(c)&&(Array.isArray(c)||!(Symbol.iterator in c))&&!(c instanceof WeakMap)&&!(c instanceof WeakSet)&&!(c instanceof Error)&&!(c instanceof Number)&&!(c instanceof Date)&&!(c instanceof String)&&!(c instanceof RegExp)&&!(c instanceof ArrayBuffer),n=c=>{switch(c.status){case"fulfilled":return c.value;case"rejected":throw c.reason;default:throw c}},i=new WeakMap,o=(c,u,f=n)=>{const d=i.get(c);if((d==null?void 0:d[0])===u)return d[1];const h=Array.isArray(c)?[]:Object.create(Object.getPrototypeOf(c));return J1(h,!0),i.set(c,[u,h]),Reflect.ownKeys(c).forEach(p=>{if(Object.getOwnPropertyDescriptor(h,p))return;const m=Reflect.get(c,p),{enumerable:y}=Reflect.getOwnPropertyDescriptor(c,p),g={value:m,enumerable:y,configurable:!0};if(Kl.has(m))J1(m,!1);else if(m instanceof Promise)delete g.value,g.get=()=>f(m);else if(Kn.has(m)){const[b,S]=Kn.get(m);g.value=o(b,S(),f)}Object.defineProperty(h,p,g)}),Object.preventExtensions(h)},s=new WeakMap,a=[1,1],l=c=>{if(!_h(c))throw new Error("object required");const u=s.get(c);if(u)return u;let f=a[0];const d=new Set,h=(A,V=++a[0])=>{f!==V&&(f=V,d.forEach(Q=>Q(A,V)))};let p=a[1];const m=(A=++a[1])=>(p!==A&&!d.size&&(p=A,g.forEach(([V])=>{const Q=V[1](A);Q>f&&(f=Q)})),f),y=A=>(V,Q)=>{const I=[...V];I[1]=[A,...I[1]],h(I,Q)},g=new Map,b=(A,V)=>{if((_u?"production":void 0)!=="production"&&g.has(A))throw new Error("prop listener already exists");if(d.size){const Q=V[3](y(A));g.set(A,[V,Q])}else g.set(A,[V])},S=A=>{var V;const Q=g.get(A);Q&&(g.delete(A),(V=Q[1])==null||V.call(Q))},x=A=>(d.add(A),d.size===1&&g.forEach(([Q,I],U)=>{if((_u?"production":void 0)!=="production"&&I)throw new Error("remove already exists");const k=Q[3](y(U));g.set(U,[Q,k])}),()=>{d.delete(A),d.size===0&&g.forEach(([Q,I],U)=>{I&&(I(),g.set(U,[Q]))})}),O=Array.isArray(c)?[]:Object.create(Object.getPrototypeOf(c)),D=e(O,{deleteProperty(A,V){const Q=Reflect.get(A,V);S(V);const I=Reflect.deleteProperty(A,V);return I&&h(["delete",[V],Q]),I},set(A,V,Q,I){const U=Reflect.has(A,V),k=Reflect.get(A,V,I);if(U&&(t(k,Q)||s.has(Q)&&t(k,s.get(Q))))return!0;S(V),_h(Q)&&(Q=k7(Q)||Q);let G=Q;if(Q instanceof Promise)Q.then(te=>{Q.status="fulfilled",Q.value=te,h(["resolve",[V],te])}).catch(te=>{Q.status="rejected",Q.reason=te,h(["reject",[V],te])});else{!Kn.has(Q)&&r(Q)&&(G=l(Q));const te=!Kl.has(G)&&Kn.get(G);te&&b(V,te)}return Reflect.set(A,V,G,I),h(["set",[V],Q,k]),!0}});s.set(c,D);const $=[O,m,o,x];return Kn.set(D,$),Reflect.ownKeys(c).forEach(A=>{const V=Object.getOwnPropertyDescriptor(c,A);"value"in V&&(D[A]=c[A],delete V.value,delete V.writable),Object.defineProperty(O,A,V)}),D})=>[l,Kn,Kl,t,e,r,n,i,o,s,a],[R7]=O7();function M7(t={}){return R7(t)}function I7(t,e,r){const n=Kn.get(t);(_u?"production":void 0)!=="production"&&!n&&console.warn("Please use proxy object");let i;const o=[],s=n[3];let a=!1;const c=s(u=>{o.push(u),i||(i=Promise.resolve().then(()=>{i=void 0,a&&e(o.splice(0))}))});return a=!0,()=>{a=!1,c()}}function Y1(t,e){const r=Kn.get(t);(_u?"production":void 0)!=="production"&&!r&&console.warn("Please use proxy object");const[n,i,o]=r;return o(n,i(),e)}var fg={exports:{}},Oh={};/**
540
- * @license React
541
- * use-sync-external-store-shim.production.min.js
542
- *
543
- * Copyright (c) Facebook, Inc. and its affiliates.
544
- *
545
- * This source code is licensed under the MIT license found in the
546
- * LICENSE file in the root directory of this source tree.
547
- */var Z1;function N7(){if(Z1)return Oh;Z1=1;var t=pe;function e(f,d){return f===d&&(f!==0||1/f===1/d)||f!==f&&d!==d}var r=typeof Object.is=="function"?Object.is:e,n=t.useState,i=t.useEffect,o=t.useLayoutEffect,s=t.useDebugValue;function a(f,d){var h=d(),p=n({inst:{value:h,getSnapshot:d}}),m=p[0].inst,y=p[1];return o(function(){m.value=h,m.getSnapshot=d,l(m)&&y({inst:m})},[f,h,d]),i(function(){return l(m)&&y({inst:m}),f(function(){l(m)&&y({inst:m})})},[f]),s(h),h}function l(f){var d=f.getSnapshot;f=f.value;try{var h=d();return!r(f,h)}catch{return!0}}function c(f,d){return d()}var u=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?c:a;return Oh.useSyncExternalStore=t.useSyncExternalStore!==void 0?t.useSyncExternalStore:u,Oh}var Rh={};/**
548
- * @license React
549
- * use-sync-external-store-shim.development.js
550
- *
551
- * Copyright (c) Facebook, Inc. and its affiliates.
552
- *
553
- * This source code is licensed under the MIT license found in the
554
- * LICENSE file in the root directory of this source tree.
555
- */var Q1;function D7(){return Q1||(Q1=1,process.env.NODE_ENV!=="production"&&function(){typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error);var t=pe,e=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function r(S){{for(var x=arguments.length,O=new Array(x>1?x-1:0),M=1;M<x;M++)O[M-1]=arguments[M];n("error",S,O)}}function n(S,x,O){{var M=e.ReactDebugCurrentFrame,D=M.getStackAddendum();D!==""&&(x+="%s",O=O.concat([D]));var $=O.map(function(A){return String(A)});$.unshift("Warning: "+x),Function.prototype.apply.call(console[S],console,$)}}function i(S,x){return S===x&&(S!==0||1/S===1/x)||S!==S&&x!==x}var o=typeof Object.is=="function"?Object.is:i,s=t.useState,a=t.useEffect,l=t.useLayoutEffect,c=t.useDebugValue,u=!1,f=!1;function d(S,x,O){u||t.startTransition!==void 0&&(u=!0,r("You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim will not work correctly. Upgrade to a newer pre-release."));var M=x();if(!f){var D=x();o(M,D)||(r("The result of getSnapshot should be cached to avoid an infinite loop"),f=!0)}var $=s({inst:{value:M,getSnapshot:x}}),A=$[0].inst,V=$[1];return l(function(){A.value=M,A.getSnapshot=x,h(A)&&V({inst:A})},[S,M,x]),a(function(){h(A)&&V({inst:A});var Q=function(){h(A)&&V({inst:A})};return S(Q)},[S]),c(M),M}function h(S){var x=S.getSnapshot,O=S.value;try{var M=x();return!o(O,M)}catch{return!0}}function p(S,x,O){return x()}var m=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",y=!m,g=y?p:d,b=t.useSyncExternalStore!==void 0?t.useSyncExternalStore:g;Rh.useSyncExternalStore=b,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error)}()),Rh}process.env.NODE_ENV==="production"?fg.exports=N7():fg.exports=D7();var P7=fg.exports;const L7=My(P7),F7={BASE_URL:"/",DEV:!1,MODE:"production",PROD:!0,SSR:!1},{use:ex}=pe,{useSyncExternalStore:B7}=L7,$7=(t,e)=>{const r=pe.useRef();pe.useEffect(()=>{r.current=_7(t,e)}),pe.useDebugValue(r.current)},j7=new WeakMap;function H7(t,e){const n=pe.useRef(),i=pe.useRef();let o=!0;const s=B7(pe.useCallback(c=>{const u=I7(t,c);return c(),u},[t,void 0]),()=>{const c=Y1(t,ex);try{if(!o&&n.current&&i.current&&!DO(n.current,c,i.current,new WeakMap))return n.current}catch{}return c},()=>Y1(t,ex));o=!1;const a=new WeakMap;pe.useEffect(()=>{n.current=s,i.current=a}),(F7?"production":void 0)!=="production"&&$7(s,a);const l=pe.useMemo(()=>new WeakMap,[]);return NO(s,a,l,j7)}var PO=typeof global=="object"&&global&&global.Object===Object&&global,z7=typeof self=="object"&&self&&self.Object===Object&&self,sn=PO||z7||Function("return this")(),Qr=sn.Symbol,LO=Object.prototype,U7=LO.hasOwnProperty,W7=LO.toString,Zs=Qr?Qr.toStringTag:void 0;function V7(t){var e=U7.call(t,Zs),r=t[Zs];try{t[Zs]=void 0;var n=!0}catch{}var i=W7.call(t);return n&&(e?t[Zs]=r:delete t[Zs]),i}var G7=Object.prototype,K7=G7.toString;function q7(t){return K7.call(t)}var X7="[object Null]",J7="[object Undefined]",tx=Qr?Qr.toStringTag:void 0;function go(t){return t==null?t===void 0?J7:X7:tx&&tx in Object(t)?V7(t):q7(t)}function vi(t){return t!=null&&typeof t=="object"}var Y7="[object Symbol]";function id(t){return typeof t=="symbol"||vi(t)&&go(t)==Y7}function FO(t,e){for(var r=-1,n=t==null?0:t.length,i=Array(n);++r<n;)i[r]=e(t[r],r,t);return i}var en=Array.isArray,Z7=1/0,rx=Qr?Qr.prototype:void 0,nx=rx?rx.toString:void 0;function Ou(t){if(typeof t=="string")return t;if(en(t))return FO(t,Ou)+"";if(id(t))return nx?nx.call(t):"";var e=t+"";return e=="0"&&1/t==-Z7?"-0":e}var Q7=/\s/;function eG(t){for(var e=t.length;e--&&Q7.test(t.charAt(e)););return e}var tG=/^\s+/;function rG(t){return t&&t.slice(0,eG(t)+1).replace(tG,"")}function wi(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}var ix=NaN,nG=/^[-+]0x[0-9a-f]+$/i,iG=/^0b[01]+$/i,oG=/^0o[0-7]+$/i,sG=parseInt;function dg(t){if(typeof t=="number")return t;if(id(t))return ix;if(wi(t)){var e=typeof t.valueOf=="function"?t.valueOf():t;t=wi(e)?e+"":e}if(typeof t!="string")return t===0?t:+t;t=rG(t);var r=iG.test(t);return r||oG.test(t)?sG(t.slice(2),r?2:8):nG.test(t)?ix:+t}var ox=1/0,aG=17976931348623157e292;function lG(t){if(!t)return t===0?t:0;if(t=dg(t),t===ox||t===-ox){var e=t<0?-1:1;return e*aG}return t===t?t:0}function cG(t){var e=lG(t),r=e%1;return e===e?r?e-r:e:0}function Rv(t){return t}var uG="[object AsyncFunction]",fG="[object Function]",dG="[object GeneratorFunction]",hG="[object Proxy]";function BO(t){if(!wi(t))return!1;var e=go(t);return e==fG||e==dG||e==uG||e==hG}var Mh=sn["__core-js_shared__"],sx=function(){var t=/[^.]+$/.exec(Mh&&Mh.keys&&Mh.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}();function pG(t){return!!sx&&sx in t}var mG=Function.prototype,gG=mG.toString;function yo(t){if(t!=null){try{return gG.call(t)}catch{}try{return t+""}catch{}}return""}var yG=/[\\^$.*+?()[\]{}|]/g,vG=/^\[object .+?Constructor\]$/,wG=Function.prototype,bG=Object.prototype,xG=wG.toString,SG=bG.hasOwnProperty,EG=RegExp("^"+xG.call(SG).replace(yG,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function TG(t){if(!wi(t)||pG(t))return!1;var e=BO(t)?EG:vG;return e.test(yo(t))}function AG(t,e){return t==null?void 0:t[e]}function vo(t,e){var r=AG(t,e);return TG(r)?r:void 0}var hg=vo(sn,"WeakMap");function CG(t,e,r){switch(r.length){case 0:return t.call(e);case 1:return t.call(e,r[0]);case 2:return t.call(e,r[0],r[1]);case 3:return t.call(e,r[0],r[1],r[2])}return t.apply(e,r)}var kG=800,_G=16,OG=Date.now;function RG(t){var e=0,r=0;return function(){var n=OG(),i=_G-(n-r);if(r=n,i>0){if(++e>=kG)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}function MG(t){return function(){return t}}var ax=function(){try{var t=vo(Object,"defineProperty");return t({},"",{}),t}catch{}}(),IG=ax?function(t,e){return ax(t,"toString",{configurable:!0,enumerable:!1,value:MG(e),writable:!0})}:Rv,NG=RG(IG);function DG(t,e,r,n){for(var i=t.length,o=r+-1;++o<i;)if(e(t[o],o,t))return o;return-1}function PG(t){return t!==t}function LG(t,e,r){for(var n=r-1,i=t.length;++n<i;)if(t[n]===e)return n;return-1}function FG(t,e,r){return e===e?LG(t,e,r):DG(t,PG,r)}function BG(t,e){var r=t==null?0:t.length;return!!r&&FG(t,e,0)>-1}var $G=9007199254740991,jG=/^(?:0|[1-9]\d*)$/;function $O(t,e){var r=typeof t;return e=e??$G,!!e&&(r=="number"||r!="symbol"&&jG.test(t))&&t>-1&&t%1==0&&t<e}function jO(t,e){return t===e||t!==t&&e!==e}var lx=Math.max;function HG(t,e,r){return e=lx(e===void 0?t.length-1:e,0),function(){for(var n=arguments,i=-1,o=lx(n.length-e,0),s=Array(o);++i<o;)s[i]=n[e+i];i=-1;for(var a=Array(e+1);++i<e;)a[i]=n[i];return a[e]=r(s),CG(t,this,a)}}function zG(t,e){return NG(HG(t,e,Rv),t+"")}var UG=9007199254740991;function Mv(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=UG}function HO(t){return t!=null&&Mv(t.length)&&!BO(t)}var WG=Object.prototype;function VG(t){var e=t&&t.constructor,r=typeof e=="function"&&e.prototype||WG;return t===r}function GG(t,e){for(var r=-1,n=Array(t);++r<t;)n[r]=e(r);return n}var KG="[object Arguments]";function cx(t){return vi(t)&&go(t)==KG}var zO=Object.prototype,qG=zO.hasOwnProperty,XG=zO.propertyIsEnumerable,Iv=cx(function(){return arguments}())?cx:function(t){return vi(t)&&qG.call(t,"callee")&&!XG.call(t,"callee")};function JG(){return!1}var UO=typeof exports=="object"&&exports&&!exports.nodeType&&exports,ux=UO&&typeof module=="object"&&module&&!module.nodeType&&module,YG=ux&&ux.exports===UO,fx=YG?sn.Buffer:void 0,ZG=fx?fx.isBuffer:void 0,pg=ZG||JG,QG="[object Arguments]",eK="[object Array]",tK="[object Boolean]",rK="[object Date]",nK="[object Error]",iK="[object Function]",oK="[object Map]",sK="[object Number]",aK="[object Object]",lK="[object RegExp]",cK="[object Set]",uK="[object String]",fK="[object WeakMap]",dK="[object ArrayBuffer]",hK="[object DataView]",pK="[object Float32Array]",mK="[object Float64Array]",gK="[object Int8Array]",yK="[object Int16Array]",vK="[object Int32Array]",wK="[object Uint8Array]",bK="[object Uint8ClampedArray]",xK="[object Uint16Array]",SK="[object Uint32Array]",Ye={};Ye[pK]=Ye[mK]=Ye[gK]=Ye[yK]=Ye[vK]=Ye[wK]=Ye[bK]=Ye[xK]=Ye[SK]=!0;Ye[QG]=Ye[eK]=Ye[dK]=Ye[tK]=Ye[hK]=Ye[rK]=Ye[nK]=Ye[iK]=Ye[oK]=Ye[sK]=Ye[aK]=Ye[lK]=Ye[cK]=Ye[uK]=Ye[fK]=!1;function EK(t){return vi(t)&&Mv(t.length)&&!!Ye[go(t)]}function Nv(t){return function(e){return t(e)}}var WO=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Ea=WO&&typeof module=="object"&&module&&!module.nodeType&&module,TK=Ea&&Ea.exports===WO,Ih=TK&&PO.process,Ru=function(){try{var t=Ea&&Ea.require&&Ea.require("util").types;return t||Ih&&Ih.binding&&Ih.binding("util")}catch{}}(),dx=Ru&&Ru.isTypedArray,VO=dx?Nv(dx):EK,AK=Object.prototype,CK=AK.hasOwnProperty;function kK(t,e){var r=en(t),n=!r&&Iv(t),i=!r&&!n&&pg(t),o=!r&&!n&&!i&&VO(t),s=r||n||i||o,a=s?GG(t.length,String):[],l=a.length;for(var c in t)CK.call(t,c)&&!(s&&(c=="length"||i&&(c=="offset"||c=="parent")||o&&(c=="buffer"||c=="byteLength"||c=="byteOffset")||$O(c,l)))&&a.push(c);return a}function _K(t,e){return function(r){return t(e(r))}}var OK=_K(Object.keys,Object),RK=Object.prototype,MK=RK.hasOwnProperty;function IK(t){if(!VG(t))return OK(t);var e=[];for(var r in Object(t))MK.call(t,r)&&r!="constructor"&&e.push(r);return e}function GO(t){return HO(t)?kK(t):IK(t)}var NK=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,DK=/^\w*$/;function Dv(t,e){if(en(t))return!1;var r=typeof t;return r=="number"||r=="symbol"||r=="boolean"||t==null||id(t)?!0:DK.test(t)||!NK.test(t)||e!=null&&t in Object(e)}var Ka=vo(Object,"create");function PK(){this.__data__=Ka?Ka(null):{},this.size=0}function LK(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}var FK="__lodash_hash_undefined__",BK=Object.prototype,$K=BK.hasOwnProperty;function jK(t){var e=this.__data__;if(Ka){var r=e[t];return r===FK?void 0:r}return $K.call(e,t)?e[t]:void 0}var HK=Object.prototype,zK=HK.hasOwnProperty;function UK(t){var e=this.__data__;return Ka?e[t]!==void 0:zK.call(e,t)}var WK="__lodash_hash_undefined__";function VK(t,e){var r=this.__data__;return this.size+=this.has(t)?0:1,r[t]=Ka&&e===void 0?WK:e,this}function oo(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}oo.prototype.clear=PK;oo.prototype.delete=LK;oo.prototype.get=jK;oo.prototype.has=UK;oo.prototype.set=VK;function GK(){this.__data__=[],this.size=0}function od(t,e){for(var r=t.length;r--;)if(jO(t[r][0],e))return r;return-1}var KK=Array.prototype,qK=KK.splice;function XK(t){var e=this.__data__,r=od(e,t);if(r<0)return!1;var n=e.length-1;return r==n?e.pop():qK.call(e,r,1),--this.size,!0}function JK(t){var e=this.__data__,r=od(e,t);return r<0?void 0:e[r][1]}function YK(t){return od(this.__data__,t)>-1}function ZK(t,e){var r=this.__data__,n=od(r,t);return n<0?(++this.size,r.push([t,e])):r[n][1]=e,this}function Mn(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}Mn.prototype.clear=GK;Mn.prototype.delete=XK;Mn.prototype.get=JK;Mn.prototype.has=YK;Mn.prototype.set=ZK;var qa=vo(sn,"Map");function QK(){this.size=0,this.__data__={hash:new oo,map:new(qa||Mn),string:new oo}}function e9(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}function sd(t,e){var r=t.__data__;return e9(e)?r[typeof e=="string"?"string":"hash"]:r.map}function t9(t){var e=sd(this,t).delete(t);return this.size-=e?1:0,e}function r9(t){return sd(this,t).get(t)}function n9(t){return sd(this,t).has(t)}function i9(t,e){var r=sd(this,t),n=r.size;return r.set(t,e),this.size+=r.size==n?0:1,this}function In(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}In.prototype.clear=QK;In.prototype.delete=t9;In.prototype.get=r9;In.prototype.has=n9;In.prototype.set=i9;var o9="Expected a function";function Pv(t,e){if(typeof t!="function"||e!=null&&typeof e!="function")throw new TypeError(o9);var r=function(){var n=arguments,i=e?e.apply(this,n):n[0],o=r.cache;if(o.has(i))return o.get(i);var s=t.apply(this,n);return r.cache=o.set(i,s)||o,s};return r.cache=new(Pv.Cache||In),r}Pv.Cache=In;var s9=500;function a9(t){var e=Pv(t,function(n){return r.size===s9&&r.clear(),n}),r=e.cache;return e}var l9=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,c9=/\\(\\)?/g,u9=a9(function(t){var e=[];return t.charCodeAt(0)===46&&e.push(""),t.replace(l9,function(r,n,i,o){e.push(i?o.replace(c9,"$1"):n||r)}),e});function mg(t){return t==null?"":Ou(t)}function KO(t,e){return en(t)?t:Dv(t,e)?[t]:u9(mg(t))}var f9=1/0;function ad(t){if(typeof t=="string"||id(t))return t;var e=t+"";return e=="0"&&1/t==-f9?"-0":e}function qO(t,e){e=KO(e,t);for(var r=0,n=e.length;t!=null&&r<n;)t=t[ad(e[r++])];return r&&r==n?t:void 0}function d9(t,e,r){var n=t==null?void 0:qO(t,e);return n===void 0?r:n}function XO(t,e){for(var r=-1,n=e.length,i=t.length;++r<n;)t[i+r]=e[r];return t}var hx=Qr?Qr.isConcatSpreadable:void 0;function h9(t){return en(t)||Iv(t)||!!(hx&&t&&t[hx])}function p9(t,e,r,n,i){var o=-1,s=t.length;for(r||(r=h9),i||(i=[]);++o<s;){var a=t[o];r(a)&&XO(i,a)}return i}function m9(t,e,r){var n=-1,i=t.length;e<0&&(e=-e>i?0:i+e),r=r>i?i:r,r<0&&(r+=i),i=e>r?0:r-e>>>0,e>>>=0;for(var o=Array(i);++n<i;)o[n]=t[n+e];return o}function g9(t,e,r){var n=t.length;return r=r===void 0?n:r,!e&&r>=n?t:m9(t,e,r)}var y9="\\ud800-\\udfff",v9="\\u0300-\\u036f",w9="\\ufe20-\\ufe2f",b9="\\u20d0-\\u20ff",x9=v9+w9+b9,S9="\\ufe0e\\ufe0f",E9="\\u200d",T9=RegExp("["+E9+y9+x9+S9+"]");function Lv(t){return T9.test(t)}function A9(t){return t.split("")}var JO="\\ud800-\\udfff",C9="\\u0300-\\u036f",k9="\\ufe20-\\ufe2f",_9="\\u20d0-\\u20ff",O9=C9+k9+_9,R9="\\ufe0e\\ufe0f",M9="["+JO+"]",gg="["+O9+"]",yg="\\ud83c[\\udffb-\\udfff]",I9="(?:"+gg+"|"+yg+")",YO="[^"+JO+"]",ZO="(?:\\ud83c[\\udde6-\\uddff]){2}",QO="[\\ud800-\\udbff][\\udc00-\\udfff]",N9="\\u200d",eR=I9+"?",tR="["+R9+"]?",D9="(?:"+N9+"(?:"+[YO,ZO,QO].join("|")+")"+tR+eR+")*",P9=tR+eR+D9,L9="(?:"+[YO+gg+"?",gg,ZO,QO,M9].join("|")+")",F9=RegExp(yg+"(?="+yg+")|"+L9+P9,"g");function B9(t){return t.match(F9)||[]}function $9(t){return Lv(t)?B9(t):A9(t)}function j9(){this.__data__=new Mn,this.size=0}function H9(t){var e=this.__data__,r=e.delete(t);return this.size=e.size,r}function z9(t){return this.__data__.get(t)}function U9(t){return this.__data__.has(t)}var W9=200;function V9(t,e){var r=this.__data__;if(r instanceof Mn){var n=r.__data__;if(!qa||n.length<W9-1)return n.push([t,e]),this.size=++r.size,this;r=this.__data__=new In(n)}return r.set(t,e),this.size=r.size,this}function En(t){var e=this.__data__=new Mn(t);this.size=e.size}En.prototype.clear=j9;En.prototype.delete=H9;En.prototype.get=z9;En.prototype.has=U9;En.prototype.set=V9;function G9(t,e){for(var r=-1,n=t==null?0:t.length,i=0,o=[];++r<n;){var s=t[r];e(s,r,t)&&(o[i++]=s)}return o}function K9(){return[]}var q9=Object.prototype,X9=q9.propertyIsEnumerable,px=Object.getOwnPropertySymbols,J9=px?function(t){return t==null?[]:(t=Object(t),G9(px(t),function(e){return X9.call(t,e)}))}:K9;function Y9(t,e,r){var n=e(t);return en(t)?n:XO(n,r(t))}function mx(t){return Y9(t,GO,J9)}var vg=vo(sn,"DataView"),wg=vo(sn,"Promise"),bg=vo(sn,"Set"),gx="[object Map]",Z9="[object Object]",yx="[object Promise]",vx="[object Set]",wx="[object WeakMap]",bx="[object DataView]",Q9=yo(vg),eq=yo(qa),tq=yo(wg),rq=yo(bg),nq=yo(hg),qn=go;(vg&&qn(new vg(new ArrayBuffer(1)))!=bx||qa&&qn(new qa)!=gx||wg&&qn(wg.resolve())!=yx||bg&&qn(new bg)!=vx||hg&&qn(new hg)!=wx)&&(qn=function(t){var e=go(t),r=e==Z9?t.constructor:void 0,n=r?yo(r):"";if(n)switch(n){case Q9:return bx;case eq:return gx;case tq:return yx;case rq:return vx;case nq:return wx}return e});var xx=sn.Uint8Array,iq="__lodash_hash_undefined__";function oq(t){return this.__data__.set(t,iq),this}function sq(t){return this.__data__.has(t)}function Xa(t){var e=-1,r=t==null?0:t.length;for(this.__data__=new In;++e<r;)this.add(t[e])}Xa.prototype.add=Xa.prototype.push=oq;Xa.prototype.has=sq;function aq(t,e){for(var r=-1,n=t==null?0:t.length;++r<n;)if(e(t[r],r,t))return!0;return!1}function rR(t,e){return t.has(e)}var lq=1,cq=2;function nR(t,e,r,n,i,o){var s=r&lq,a=t.length,l=e.length;if(a!=l&&!(s&&l>a))return!1;var c=o.get(t),u=o.get(e);if(c&&u)return c==e&&u==t;var f=-1,d=!0,h=r&cq?new Xa:void 0;for(o.set(t,e),o.set(e,t);++f<a;){var p=t[f],m=e[f];if(n)var y=s?n(m,p,f,e,t,o):n(p,m,f,t,e,o);if(y!==void 0){if(y)continue;d=!1;break}if(h){if(!aq(e,function(g,b){if(!rR(h,b)&&(p===g||i(p,g,r,n,o)))return h.push(b)})){d=!1;break}}else if(!(p===m||i(p,m,r,n,o))){d=!1;break}}return o.delete(t),o.delete(e),d}function uq(t){var e=-1,r=Array(t.size);return t.forEach(function(n,i){r[++e]=[i,n]}),r}function fq(t){var e=-1,r=Array(t.size);return t.forEach(function(n){r[++e]=n}),r}var dq=1,hq=2,pq="[object Boolean]",mq="[object Date]",gq="[object Error]",yq="[object Map]",vq="[object Number]",wq="[object RegExp]",bq="[object Set]",xq="[object String]",Sq="[object Symbol]",Eq="[object ArrayBuffer]",Tq="[object DataView]",Sx=Qr?Qr.prototype:void 0,Nh=Sx?Sx.valueOf:void 0;function Aq(t,e,r,n,i,o,s){switch(r){case Tq:if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case Eq:return!(t.byteLength!=e.byteLength||!o(new xx(t),new xx(e)));case pq:case mq:case vq:return jO(+t,+e);case gq:return t.name==e.name&&t.message==e.message;case wq:case xq:return t==e+"";case yq:var a=uq;case bq:var l=n&dq;if(a||(a=fq),t.size!=e.size&&!l)return!1;var c=s.get(t);if(c)return c==e;n|=hq,s.set(t,e);var u=nR(a(t),a(e),n,i,o,s);return s.delete(t),u;case Sq:if(Nh)return Nh.call(t)==Nh.call(e)}return!1}var Cq=1,kq=Object.prototype,_q=kq.hasOwnProperty;function Oq(t,e,r,n,i,o){var s=r&Cq,a=mx(t),l=a.length,c=mx(e),u=c.length;if(l!=u&&!s)return!1;for(var f=l;f--;){var d=a[f];if(!(s?d in e:_q.call(e,d)))return!1}var h=o.get(t),p=o.get(e);if(h&&p)return h==e&&p==t;var m=!0;o.set(t,e),o.set(e,t);for(var y=s;++f<l;){d=a[f];var g=t[d],b=e[d];if(n)var S=s?n(b,g,d,e,t,o):n(g,b,d,t,e,o);if(!(S===void 0?g===b||i(g,b,r,n,o):S)){m=!1;break}y||(y=d=="constructor")}if(m&&!y){var x=t.constructor,O=e.constructor;x!=O&&"constructor"in t&&"constructor"in e&&!(typeof x=="function"&&x instanceof x&&typeof O=="function"&&O instanceof O)&&(m=!1)}return o.delete(t),o.delete(e),m}var Rq=1,Ex="[object Arguments]",Tx="[object Array]",ql="[object Object]",Mq=Object.prototype,Ax=Mq.hasOwnProperty;function Iq(t,e,r,n,i,o){var s=en(t),a=en(e),l=s?Tx:qn(t),c=a?Tx:qn(e);l=l==Ex?ql:l,c=c==Ex?ql:c;var u=l==ql,f=c==ql,d=l==c;if(d&&pg(t)){if(!pg(e))return!1;s=!0,u=!1}if(d&&!u)return o||(o=new En),s||VO(t)?nR(t,e,r,n,i,o):Aq(t,e,l,r,n,i,o);if(!(r&Rq)){var h=u&&Ax.call(t,"__wrapped__"),p=f&&Ax.call(e,"__wrapped__");if(h||p){var m=h?t.value():t,y=p?e.value():e;return o||(o=new En),i(m,y,r,n,o)}}return d?(o||(o=new En),Oq(t,e,r,n,i,o)):!1}function Fv(t,e,r,n,i){return t===e?!0:t==null||e==null||!vi(t)&&!vi(e)?t!==t&&e!==e:Iq(t,e,r,n,Fv,i)}var Nq=1,Dq=2;function Pq(t,e,r,n){var i=r.length,o=i;if(t==null)return!o;for(t=Object(t);i--;){var s=r[i];if(s[2]?s[1]!==t[s[0]]:!(s[0]in t))return!1}for(;++i<o;){s=r[i];var a=s[0],l=t[a],c=s[1];if(s[2]){if(l===void 0&&!(a in t))return!1}else{var u=new En,f;if(!(f===void 0?Fv(c,l,Nq|Dq,n,u):f))return!1}}return!0}function iR(t){return t===t&&!wi(t)}function Lq(t){for(var e=GO(t),r=e.length;r--;){var n=e[r],i=t[n];e[r]=[n,i,iR(i)]}return e}function oR(t,e){return function(r){return r==null?!1:r[t]===e&&(e!==void 0||t in Object(r))}}function Fq(t){var e=Lq(t);return e.length==1&&e[0][2]?oR(e[0][0],e[0][1]):function(r){return r===t||Pq(r,t,e)}}function Bq(t,e){return t!=null&&e in Object(t)}function $q(t,e,r){e=KO(e,t);for(var n=-1,i=e.length,o=!1;++n<i;){var s=ad(e[n]);if(!(o=t!=null&&r(t,s)))break;t=t[s]}return o||++n!=i?o:(i=t==null?0:t.length,!!i&&Mv(i)&&$O(s,i)&&(en(t)||Iv(t)))}function jq(t,e){return t!=null&&$q(t,e,Bq)}var Hq=1,zq=2;function Uq(t,e){return Dv(t)&&iR(e)?oR(ad(t),e):function(r){var n=d9(r,t);return n===void 0&&n===e?jq(r,t):Fv(e,n,Hq|zq)}}function sR(t){return function(e){return e==null?void 0:e[t]}}function Wq(t){return function(e){return qO(e,t)}}function Vq(t){return Dv(t)?sR(ad(t)):Wq(t)}function Gq(t){return typeof t=="function"?t:t==null?Rv:typeof t=="object"?en(t)?Uq(t[0],t[1]):Fq(t):Vq(t)}var Dh=function(){return sn.Date.now()},Kq="Expected a function",qq=Math.max,Xq=Math.min;function aR(t,e,r){var n,i,o,s,a,l,c=0,u=!1,f=!1,d=!0;if(typeof t!="function")throw new TypeError(Kq);e=dg(e)||0,wi(r)&&(u=!!r.leading,f="maxWait"in r,o=f?qq(dg(r.maxWait)||0,e):o,d="trailing"in r?!!r.trailing:d);function h(M){var D=n,$=i;return n=i=void 0,c=M,s=t.apply($,D),s}function p(M){return c=M,a=setTimeout(g,e),u?h(M):s}function m(M){var D=M-l,$=M-c,A=e-D;return f?Xq(A,o-$):A}function y(M){var D=M-l,$=M-c;return l===void 0||D>=e||D<0||f&&$>=o}function g(){var M=Dh();if(y(M))return b(M);a=setTimeout(g,m(M))}function b(M){return a=void 0,d&&n?h(M):(n=i=void 0,s)}function S(){a!==void 0&&clearTimeout(a),c=0,n=l=i=a=void 0}function x(){return a===void 0?s:b(Dh())}function O(){var M=Dh(),D=y(M);if(n=arguments,i=this,l=M,D){if(a===void 0)return p(l);if(f)return clearTimeout(a),a=setTimeout(g,e),h(l)}return a===void 0&&(a=setTimeout(g,e)),s}return O.cancel=S,O.flush=x,O}function Ph(t){return vi(t)&&HO(t)}var Jq=200;function Yq(t,e,r,n){var i=-1,o=BG,s=!0,a=t.length,l=[],c=e.length;if(!a)return l;r&&(e=FO(e,Nv(r))),e.length>=Jq&&(o=rR,s=!1,e=new Xa(e));e:for(;++i<a;){var u=t[i],f=r==null?u:r(u);if(u=u!==0?u:0,s&&f===f){for(var d=c;d--;)if(e[d]===f)continue e;l.push(u)}else o(e,f,n)||l.push(u)}return l}function Zq(t){var e=t==null?0:t.length;return e?t[e-1]:void 0}var Qq=zG(function(t,e){var r=Zq(e);return Ph(r)&&(r=void 0),Ph(t)?Yq(t,p9(e,1,Ph),Gq(r)):[]}),eX="[object RegExp]";function tX(t){return vi(t)&&go(t)==eX}var Cx=Ru&&Ru.isRegExp,rX=Cx?Nv(Cx):tX,nX=sR("length"),lR="\\ud800-\\udfff",iX="\\u0300-\\u036f",oX="\\ufe20-\\ufe2f",sX="\\u20d0-\\u20ff",aX=iX+oX+sX,lX="\\ufe0e\\ufe0f",cX="["+lR+"]",xg="["+aX+"]",Sg="\\ud83c[\\udffb-\\udfff]",uX="(?:"+xg+"|"+Sg+")",cR="[^"+lR+"]",uR="(?:\\ud83c[\\udde6-\\uddff]){2}",fR="[\\ud800-\\udbff][\\udc00-\\udfff]",fX="\\u200d",dR=uX+"?",hR="["+lX+"]?",dX="(?:"+fX+"(?:"+[cR,uR,fR].join("|")+")"+hR+dR+")*",hX=hR+dR+dX,pX="(?:"+[cR+xg+"?",xg,uR,fR,cX].join("|")+")",kx=RegExp(Sg+"(?="+Sg+")|"+pX+hX,"g");function mX(t){for(var e=kx.lastIndex=0;kx.test(t);)++e;return e}function gX(t){return Lv(t)?mX(t):nX(t)}var yX="Expected a function";function vX(t,e,r){var n=!0,i=!0;if(typeof t!="function")throw new TypeError(yX);return wi(r)&&(n="leading"in r?!!r.leading:n,i="trailing"in r?!!r.trailing:i),aR(t,e,{leading:n,maxWait:e,trailing:i})}var wX=30,bX="...",xX=/\w*$/;function SX(t,e){var r=wX,n=bX;if(wi(e)){var i="separator"in e?e.separator:i;r="length"in e?cG(e.length):r,n="omission"in e?Ou(e.omission):n}t=mg(t);var o=t.length;if(Lv(t)){var s=$9(t);o=s.length}if(r>=o)return t;var a=r-gX(n);if(a<1)return n;var l=s?g9(s,0,a).join(""):t.slice(0,a);if(i===void 0)return l+n;if(s&&(a+=l.length-a),rX(i)){if(t.slice(a).search(i)){var c,u=l;for(i.global||(i=RegExp(i.source,mg(xX.exec(i))+"g")),i.lastIndex=0;c=i.exec(u);)var f=c.index;l=l.slice(0,f===void 0?a:f)}}else if(t.indexOf(Ou(i),a)!=a){var d=l.lastIndexOf(i);d>-1&&(l=l.slice(0,d))}return l+n}function ld(t,e){if(t==null)return{};var r={},n=Object.keys(t),i,o;for(o=0;o<n.length;o++)i=n[o],!(e.indexOf(i)>=0)&&(r[i]=t[i]);return r}var EX=["color"],TX=pe.forwardRef(function(t,e){var r=t.color,n=r===void 0?"currentColor":r,i=ld(t,EX);return pe.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},i,{ref:e}),pe.createElement("path",{d:"M2 4.5C2 4.22386 2.22386 4 2.5 4H12.5C12.7761 4 13 4.22386 13 4.5C13 4.77614 12.7761 5 12.5 5H2.5C2.22386 5 2 4.77614 2 4.5ZM4 7.5C4 7.22386 4.22386 7 4.5 7H10.5C10.7761 7 11 7.22386 11 7.5C11 7.77614 10.7761 8 10.5 8H4.5C4.22386 8 4 7.77614 4 7.5ZM3 10.5C3 10.2239 3.22386 10 3.5 10H11.5C11.7761 10 12 10.2239 12 10.5C12 10.7761 11.7761 11 11.5 11H3.5C3.22386 11 3 10.7761 3 10.5Z",fill:n,fillRule:"evenodd",clipRule:"evenodd"}))}),AX=["color"],CX=pe.forwardRef(function(t,e){var r=t.color,n=r===void 0?"currentColor":r,i=ld(t,AX);return pe.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},i,{ref:e}),pe.createElement("path",{d:"M2.5 4C2.22386 4 2 4.22386 2 4.5C2 4.77614 2.22386 5 2.5 5H12.5C12.7761 5 13 4.77614 13 4.5C13 4.22386 12.7761 4 12.5 4H2.5ZM2 7.5C2 7.22386 2.22386 7 2.5 7H12.5C12.7761 7 13 7.22386 13 7.5C13 7.77614 12.7761 8 12.5 8H2.5C2.22386 8 2 7.77614 2 7.5ZM2 10.5C2 10.2239 2.22386 10 2.5 10H12.5C12.7761 10 13 10.2239 13 10.5C13 10.7761 12.7761 11 12.5 11H2.5C2.22386 11 2 10.7761 2 10.5Z",fill:n,fillRule:"evenodd",clipRule:"evenodd"}))}),kX=["color"],_X=pe.forwardRef(function(t,e){var r=t.color,n=r===void 0?"currentColor":r,i=ld(t,kX);return pe.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},i,{ref:e}),pe.createElement("path",{d:"M2 4.5C2 4.22386 2.22386 4 2.5 4H12.5C12.7761 4 13 4.22386 13 4.5C13 4.77614 12.7761 5 12.5 5H2.5C2.22386 5 2 4.77614 2 4.5ZM2 7.5C2 7.22386 2.22386 7 2.5 7H7.5C7.77614 7 8 7.22386 8 7.5C8 7.77614 7.77614 8 7.5 8H2.5C2.22386 8 2 7.77614 2 7.5ZM2 10.5C2 10.2239 2.22386 10 2.5 10H10.5C10.7761 10 11 10.2239 11 10.5C11 10.7761 10.7761 11 10.5 11H2.5C2.22386 11 2 10.7761 2 10.5Z",fill:n,fillRule:"evenodd",clipRule:"evenodd"}))}),OX=["color"],RX=pe.forwardRef(function(t,e){var r=t.color,n=r===void 0?"currentColor":r,i=ld(t,OX);return pe.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},i,{ref:e}),pe.createElement("path",{d:"M2 4.5C2 4.22386 2.22386 4 2.5 4H12.5C12.7761 4 13 4.22386 13 4.5C13 4.77614 12.7761 5 12.5 5H2.5C2.22386 5 2 4.77614 2 4.5ZM7 7.5C7 7.22386 7.22386 7 7.5 7H12.5C12.7761 7 13 7.22386 13 7.5C13 7.77614 12.7761 8 12.5 8H7.5C7.22386 8 7 7.77614 7 7.5ZM4 10.5C4 10.2239 4.22386 10 4.5 10H12.5C12.7761 10 13 10.2239 13 10.5C13 10.7761 12.7761 11 12.5 11H4.5C4.22386 11 4 10.7761 4 10.5Z",fill:n,fillRule:"evenodd",clipRule:"evenodd"}))});const Kr=()=>new Map,Eg=t=>{const e=Kr();return t.forEach((r,n)=>{e.set(n,r)}),e},Ls=(t,e,r)=>{let n=t.get(e);return n===void 0&&t.set(e,n=r()),n},MX=(t,e)=>{const r=[];for(const[n,i]of t)r.push(e(i,n));return r},IX=(t,e)=>{for(const[r,n]of t)if(e(n,r))return!0;return!1},ws=()=>new Set,Lh=t=>t[t.length-1],bs=Array.from,NX=Array.isArray;class DX{constructor(){this._observers=Kr()}on(e,r){return Ls(this._observers,e,ws).add(r),r}once(e,r){const n=(...i)=>{this.off(e,n),r(...i)};this.on(e,n)}off(e,r){const n=this._observers.get(e);n!==void 0&&(n.delete(r),n.size===0&&this._observers.delete(e))}emit(e,r){return bs((this._observers.get(e)||Kr()).values()).forEach(n=>n(...r))}destroy(){this._observers=Kr()}}const so=Math.floor,Dc=Math.abs,pR=(t,e)=>t<e?t:e,Fs=(t,e)=>t>e?t:e,PX=t=>t!==0?t<0:1/t<0,_x=1,Ox=2,Fh=4,Bh=8,LX=32,mR=64,Mu=128,FX=31,Rx=63,Ta=127,BX=2147483647,$X=Number.isInteger||(t=>typeof t=="number"&&isFinite(t)&&so(t)===t),jX=t=>t.toLowerCase(),HX=/^\s*/g,zX=t=>t.replace(HX,""),UX=/([A-Z])/g,Mx=(t,e)=>zX(t.replace(UX,r=>`${e}${jX(r)}`)),WX=t=>{const e=unescape(encodeURIComponent(t)),r=e.length,n=new Uint8Array(r);for(let i=0;i<r;i++)n[i]=e.codePointAt(i);return n},Ja=typeof TextEncoder<"u"?new TextEncoder:null,VX=t=>Ja.encode(t),GX=Ja?VX:WX;let $h=typeof TextDecoder>"u"?null:new TextDecoder("utf-8",{fatal:!0,ignoreBOM:!0});$h&&$h.decode(new Uint8Array).length===1&&($h=null);class xl{constructor(){this.cpos=0,this.cbuf=new Uint8Array(100),this.bufs=[]}}const Bv=()=>new xl,KX=t=>{let e=t.cpos;for(let r=0;r<t.bufs.length;r++)e+=t.bufs[r].length;return e},wn=t=>{const e=new Uint8Array(KX(t));let r=0;for(let n=0;n<t.bufs.length;n++){const i=t.bufs[n];e.set(i,r),r+=i.length}return e.set(new Uint8Array(t.cbuf.buffer,0,t.cpos),r),e},qX=(t,e)=>{const r=t.cbuf.length;r-t.cpos<e&&(t.bufs.push(new Uint8Array(t.cbuf.buffer,0,t.cpos)),t.cbuf=new Uint8Array(Fs(r,e)*2),t.cpos=0)},pt=(t,e)=>{const r=t.cbuf.length;t.cpos===r&&(t.bufs.push(t.cbuf),t.cbuf=new Uint8Array(r*2),t.cpos=0),t.cbuf[t.cpos++]=e},Tg=pt,Ge=(t,e)=>{for(;e>Ta;)pt(t,Mu|Ta&e),e=so(e/128);pt(t,Ta&e)},$v=(t,e)=>{const r=PX(e);for(r&&(e=-e),pt(t,(e>Rx?Mu:0)|(r?mR:0)|Rx&e),e=so(e/64);e>0;)pt(t,(e>Ta?Mu:0)|Ta&e),e=so(e/128)},Ag=new Uint8Array(3e4),XX=Ag.length/3,JX=(t,e)=>{if(e.length<XX){const r=Ja.encodeInto(e,Ag).written||0;Ge(t,r);for(let n=0;n<r;n++)pt(t,Ag[n])}else Zt(t,GX(e))},YX=(t,e)=>{const r=unescape(encodeURIComponent(e)),n=r.length;Ge(t,n);for(let i=0;i<n;i++)pt(t,r.codePointAt(i))},Zo=Ja&&Ja.encodeInto?JX:YX,jv=(t,e)=>{const r=t.cbuf.length,n=t.cpos,i=pR(r-n,e.length),o=e.length-i;t.cbuf.set(e.subarray(0,i),n),t.cpos+=i,o>0&&(t.bufs.push(t.cbuf),t.cbuf=new Uint8Array(Fs(r*2,o)),t.cbuf.set(e.subarray(i)),t.cpos=o)},Zt=(t,e)=>{Ge(t,e.byteLength),jv(t,e)},Hv=(t,e)=>{qX(t,e);const r=new DataView(t.cbuf.buffer,t.cpos,e);return t.cpos+=e,r},ZX=(t,e)=>Hv(t,4).setFloat32(0,e,!1),QX=(t,e)=>Hv(t,8).setFloat64(0,e,!1),eJ=(t,e)=>Hv(t,8).setBigInt64(0,e,!1),Ix=new DataView(new ArrayBuffer(4)),tJ=t=>(Ix.setFloat32(0,t),Ix.getFloat32(0)===t),Ya=(t,e)=>{switch(typeof e){case"string":pt(t,119),Zo(t,e);break;case"number":$X(e)&&Dc(e)<=BX?(pt(t,125),$v(t,e)):tJ(e)?(pt(t,124),ZX(t,e)):(pt(t,123),QX(t,e));break;case"bigint":pt(t,122),eJ(t,e);break;case"object":if(e===null)pt(t,126);else if(NX(e)){pt(t,117),Ge(t,e.length);for(let r=0;r<e.length;r++)Ya(t,e[r])}else if(e instanceof Uint8Array)pt(t,116),Zt(t,e);else{pt(t,118);const r=Object.keys(e);Ge(t,r.length);for(let n=0;n<r.length;n++){const i=r[n];Zo(t,i),Ya(t,e[i])}}break;case"boolean":pt(t,e?120:121);break;default:pt(t,127)}};class Nx extends xl{constructor(e){super(),this.w=e,this.s=null,this.count=0}write(e){this.s===e?this.count++:(this.count>0&&Ge(this,this.count-1),this.count=1,this.w(this,e),this.s=e)}}const Dx=t=>{t.count>0&&($v(t.encoder,t.count===1?t.s:-t.s),t.count>1&&Ge(t.encoder,t.count-2))};class Pc{constructor(){this.encoder=new xl,this.s=0,this.count=0}write(e){this.s===e?this.count++:(Dx(this),this.count=1,this.s=e)}toUint8Array(){return Dx(this),wn(this.encoder)}}const Px=t=>{if(t.count>0){const e=t.diff*2+(t.count===1?0:1);$v(t.encoder,e),t.count>1&&Ge(t.encoder,t.count-2)}};class jh{constructor(){this.encoder=new xl,this.s=0,this.count=0,this.diff=0}write(e){this.diff===e-this.s?(this.s=e,this.count++):(Px(this),this.count=1,this.diff=e-this.s,this.s=e)}toUint8Array(){return Px(this),wn(this.encoder)}}class rJ{constructor(){this.sarr=[],this.s="",this.lensE=new Pc}write(e){this.s+=e,this.s.length>19&&(this.sarr.push(this.s),this.s=""),this.lensE.write(e.length)}toUint8Array(){const e=new xl;return this.sarr.push(this.s),this.s="",Zo(e,this.sarr.join("")),jv(e,this.lensE.toUint8Array()),wn(e)}}const xs=t=>new Error(t),qr=()=>{throw xs("Method unimplemented")},bi=()=>{throw xs("Unexpected case")},nJ=crypto.getRandomValues.bind(crypto),gR=()=>nJ(new Uint32Array(1))[0],iJ="10000000-1000-4000-8000"+-1e11,oJ=()=>iJ.replace(/[018]/g,t=>(t^gR()&15>>t/4).toString(16)),Lx=t=>new Promise(t);Promise.all.bind(Promise);const Fx=t=>t===void 0?null:t;class sJ{constructor(){this.map=new Map}setItem(e,r){this.map.set(e,r)}getItem(e){return this.map.get(e)}}let yR=new sJ,aJ=!0;try{typeof localStorage<"u"&&localStorage&&(yR=localStorage,aJ=!1)}catch{}const lJ=yR,cJ=Object.assign,uJ=Object.keys,fJ=(t,e)=>{for(const r in t)e(t[r],r)},Bx=t=>uJ(t).length,dJ=t=>{for(const e in t)return!1;return!0},hJ=(t,e)=>{for(const r in t)if(!e(t[r],r))return!1;return!0},pJ=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),mJ=(t,e)=>t===e||Bx(t)===Bx(e)&&hJ(t,(r,n)=>(r!==void 0||pJ(e,n))&&e[n]===r),zv=(t,e,r=0)=>{try{for(;r<t.length;r++)t[r](...e)}finally{r<t.length&&zv(t,e,r+1)}},gJ=(t,e)=>e.includes(t),Za=typeof process<"u"&&process.release&&/node|io\.js/.test(process.release.name)&&Object.prototype.toString.call(typeof process<"u"?process:0)==="[object process]";let Mr;const yJ=()=>{if(Mr===void 0)if(Za){Mr=Kr();const t=process.argv;let e=null;for(let r=0;r<t.length;r++){const n=t[r];n[0]==="-"?(e!==null&&Mr.set(e,""),e=n):e!==null&&(Mr.set(e,n),e=null)}e!==null&&Mr.set(e,"")}else typeof location=="object"?(Mr=Kr(),(location.search||"?").slice(1).split("&").forEach(t=>{if(t.length!==0){const[e,r]=t.split("=");Mr.set(`--${Mx(e,"-")}`,r),Mr.set(`-${Mx(e,"-")}`,r)}})):Mr=Kr();return Mr},Cg=t=>yJ().has(t),kg=t=>Fx(Za?process.env[t.toUpperCase().replaceAll("-","_")]:lJ.getItem(t)),vR=t=>Cg("--"+t)||kg(t)!==null;vR("production");const vJ=Za&&gJ(process.env.FORCE_COLOR,["true","1","2"]),wJ=vJ||!Cg("--no-colors")&&!vR("no-color")&&(!Za||process.stdout.isTTY)&&(!Za||Cg("--color")||kg("COLORTERM")!==null||(kg("TERM")||"").includes("color"));class bJ{constructor(e,r){this.left=e,this.right=r}}const dn=(t,e)=>new bJ(t,e);typeof DOMParser<"u"&&new DOMParser;const xJ=t=>MX(t,(e,r)=>`${r}:${e};`).join(""),Nn=Symbol,wR=Nn(),bR=Nn(),SJ=Nn(),EJ=Nn(),TJ=Nn(),xR=Nn(),AJ=Nn(),SR=Nn(),CJ=Nn(),kJ=t=>{var i;t.length===1&&((i=t[0])==null?void 0:i.constructor)===Function&&(t=t[0]());const e=[],r=[];let n=0;for(;n<t.length;n++){const o=t[n];if(o===void 0)break;if(o.constructor===String||o.constructor===Number)e.push(o);else if(o.constructor===Object)break}for(n>0&&r.push(e.join(""));n<t.length;n++){const o=t[n];o instanceof Symbol||r.push(o)}return r},_J={[wR]:dn("font-weight","bold"),[bR]:dn("font-weight","normal"),[SJ]:dn("color","blue"),[TJ]:dn("color","green"),[EJ]:dn("color","grey"),[xR]:dn("color","red"),[AJ]:dn("color","purple"),[SR]:dn("color","orange"),[CJ]:dn("color","black")},OJ=t=>{var s;t.length===1&&((s=t[0])==null?void 0:s.constructor)===Function&&(t=t[0]());const e=[],r=[],n=Kr();let i=[],o=0;for(;o<t.length;o++){const a=t[o],l=_J[a];if(l!==void 0)n.set(l.left,l.right);else{if(a===void 0)break;if(a.constructor===String||a.constructor===Number){const c=xJ(n);o>0||c.length>0?(e.push("%c"+a),r.push(c)):e.push(a)}else break}}for(o>0&&(i=r,i.unshift(e.join("")));o<t.length;o++){const a=t[o];a instanceof Symbol||i.push(a)}return i},RJ=wJ?OJ:kJ,MJ=(...t)=>{console.log(...RJ(t)),IJ.forEach(e=>e.print(t))},IJ=ws(),ER=t=>({[Symbol.iterator](){return this},next:t}),NJ=(t,e)=>ER(()=>{let r;do r=t.next();while(!r.done&&!e(r.value));return r}),Hh=(t,e)=>ER(()=>{const{done:r,value:n}=t.next();return{done:r,value:r?void 0:e(n)}});class DJ{constructor(e,r){this.clock=e,this.len=r}}class PJ{constructor(){this.clients=new Map}}const TR=(t,e,r)=>e.clients.forEach((n,i)=>{const o=t.doc.store.clients.get(i);for(let s=0;s<n.length;s++){const a=n[s];MR(t,o,a.clock,a.len,r)}}),LJ=(t,e)=>{let r=0,n=t.length-1;for(;r<=n;){const i=so((r+n)/2),o=t[i],s=o.clock;if(s<=e){if(e<s+o.len)return i;r=i+1}else n=i-1}return null},AR=(t,e)=>{const r=t.clients.get(e.client);return r!==void 0&&LJ(r,e.clock)!==null},CR=t=>{t.clients.forEach(e=>{e.sort((i,o)=>i.clock-o.clock);let r,n;for(r=1,n=1;r<e.length;r++){const i=e[n-1],o=e[r];i.clock+i.len>=o.clock?i.len=Fs(i.len,o.clock+o.len-i.clock):(n<r&&(e[n]=o),n++)}e.length=n})},kR=(t,e,r,n)=>{Ls(t.clients,e,()=>[]).push(new DJ(r,n))},FJ=(t,e)=>{Ge(t.restEncoder,e.clients.size),bs(e.clients.entries()).sort((r,n)=>n[0]-r[0]).forEach(([r,n])=>{t.resetDsCurVal(),Ge(t.restEncoder,r);const i=n.length;Ge(t.restEncoder,i);for(let o=0;o<i;o++){const s=n[o];t.writeDsClock(s.clock),t.writeDsLen(s.len)}})},_R=gR;class Sl extends DX{constructor({guid:e=oJ(),collectionid:r=null,gc:n=!0,gcFilter:i=()=>!0,meta:o=null,autoLoad:s=!1,shouldLoad:a=!0}={}){super(),this.gc=n,this.gcFilter=i,this.clientID=_R(),this.guid=e,this.collectionid=r,this.share=new Map,this.store=new GJ,this._transaction=null,this._transactionCleanups=[],this.subdocs=new Set,this._item=null,this.shouldLoad=a,this.autoLoad=s,this.meta=o,this.isLoaded=!1,this.isSynced=!1,this.whenLoaded=Lx(c=>{this.on("load",()=>{this.isLoaded=!0,c(this)})});const l=()=>Lx(c=>{const u=f=>{(f===void 0||f===!0)&&(this.off("sync",u),c())};this.on("sync",u)});this.on("sync",c=>{c===!1&&this.isSynced&&(this.whenSynced=l()),this.isSynced=c===void 0||c===!0,this.isSynced&&!this.isLoaded&&this.emit("load",[this])}),this.whenSynced=l()}load(){const e=this._item;e!==null&&!this.shouldLoad&&Ze(e.parent.doc,r=>{r.subdocsLoaded.add(this)},null,!0),this.shouldLoad=!0}getSubdocs(){return this.subdocs}getSubdocGuids(){return new Set(bs(this.subdocs).map(e=>e.guid))}transact(e,r=null){return Ze(this,e,r)}get(e,r=_t){const n=Ls(this.share,e,()=>{const o=new r;return o._integrate(this,null),o}),i=n.constructor;if(r!==_t&&i!==r)if(i===_t){const o=new r;o._map=n._map,n._map.forEach(s=>{for(;s!==null;s=s.left)s.parent=o}),o._start=n._start;for(let s=o._start;s!==null;s=s.right)s.parent=o;return o._length=n._length,this.share.set(e,o),o._integrate(this,null),o}else throw new Error(`Type with the name ${e} has already been defined with a different constructor`);return n}getArray(e=""){return this.get(e,Aa)}getText(e=""){return this.get(e,rl)}getMap(e=""){return this.get(e,Pu)}getXmlElement(e=""){return this.get(e,nl)}getXmlFragment(e=""){return this.get(e,Ss)}toJSON(){const e={};return this.share.forEach((r,n)=>{e[n]=r.toJSON()}),e}destroy(){bs(this.subdocs).forEach(r=>r.destroy());const e=this._item;if(e!==null){this._item=null;const r=e.content;r.doc=new Sl({guid:this.guid,...r.opts,shouldLoad:!1}),r.doc._item=e,Ze(e.parent.doc,n=>{const i=r.doc;e.deleted||n.subdocsAdded.add(i),n.subdocsRemoved.add(this)},null,!0)}this.emit("destroyed",[!0]),this.emit("destroy",[this]),super.destroy()}}class BJ{constructor(){this.restEncoder=Bv()}toUint8Array(){return wn(this.restEncoder)}resetDsCurVal(){}writeDsClock(e){Ge(this.restEncoder,e)}writeDsLen(e){Ge(this.restEncoder,e)}}class $J extends BJ{writeLeftID(e){Ge(this.restEncoder,e.client),Ge(this.restEncoder,e.clock)}writeRightID(e){Ge(this.restEncoder,e.client),Ge(this.restEncoder,e.clock)}writeClient(e){Ge(this.restEncoder,e)}writeInfo(e){Tg(this.restEncoder,e)}writeString(e){Zo(this.restEncoder,e)}writeParentInfo(e){Ge(this.restEncoder,e?1:0)}writeTypeRef(e){Ge(this.restEncoder,e)}writeLen(e){Ge(this.restEncoder,e)}writeAny(e){Ya(this.restEncoder,e)}writeBuf(e){Zt(this.restEncoder,e)}writeJSON(e){Zo(this.restEncoder,JSON.stringify(e))}writeKey(e){Zo(this.restEncoder,e)}}class jJ{constructor(){this.restEncoder=Bv(),this.dsCurrVal=0}toUint8Array(){return wn(this.restEncoder)}resetDsCurVal(){this.dsCurrVal=0}writeDsClock(e){const r=e-this.dsCurrVal;this.dsCurrVal=e,Ge(this.restEncoder,r)}writeDsLen(e){e===0&&bi(),Ge(this.restEncoder,e-1),this.dsCurrVal+=e}}class HJ extends jJ{constructor(){super(),this.keyMap=new Map,this.keyClock=0,this.keyClockEncoder=new jh,this.clientEncoder=new Pc,this.leftClockEncoder=new jh,this.rightClockEncoder=new jh,this.infoEncoder=new Nx(Tg),this.stringEncoder=new rJ,this.parentInfoEncoder=new Nx(Tg),this.typeRefEncoder=new Pc,this.lenEncoder=new Pc}toUint8Array(){const e=Bv();return Ge(e,0),Zt(e,this.keyClockEncoder.toUint8Array()),Zt(e,this.clientEncoder.toUint8Array()),Zt(e,this.leftClockEncoder.toUint8Array()),Zt(e,this.rightClockEncoder.toUint8Array()),Zt(e,wn(this.infoEncoder)),Zt(e,this.stringEncoder.toUint8Array()),Zt(e,wn(this.parentInfoEncoder)),Zt(e,this.typeRefEncoder.toUint8Array()),Zt(e,this.lenEncoder.toUint8Array()),jv(e,wn(this.restEncoder)),wn(e)}writeLeftID(e){this.clientEncoder.write(e.client),this.leftClockEncoder.write(e.clock)}writeRightID(e){this.clientEncoder.write(e.client),this.rightClockEncoder.write(e.clock)}writeClient(e){this.clientEncoder.write(e)}writeInfo(e){this.infoEncoder.write(e)}writeString(e){this.stringEncoder.write(e)}writeParentInfo(e){this.parentInfoEncoder.write(e?1:0)}writeTypeRef(e){this.typeRefEncoder.write(e)}writeLen(e){this.lenEncoder.write(e)}writeAny(e){Ya(this.restEncoder,e)}writeBuf(e){Zt(this.restEncoder,e)}writeJSON(e){Ya(this.restEncoder,e)}writeKey(e){const r=this.keyMap.get(e);r===void 0?(this.keyClockEncoder.write(this.keyClock++),this.stringEncoder.write(e)):this.keyClockEncoder.write(r)}}const zJ=(t,e,r,n)=>{n=Fs(n,e[0].id.clock);const i=kn(e,n);Ge(t.restEncoder,e.length-i),t.writeClient(r),Ge(t.restEncoder,n);const o=e[i];o.write(t,n-o.id.clock);for(let s=i+1;s<e.length;s++)e[s].write(t,0)},UJ=(t,e,r)=>{const n=new Map;r.forEach((i,o)=>{Kt(e,o)>i&&n.set(o,i)}),Uv(e).forEach((i,o)=>{r.has(o)||n.set(o,0)}),Ge(t.restEncoder,n.size),bs(n.entries()).sort((i,o)=>o[0]-i[0]).forEach(([i,o])=>{zJ(t,e.clients.get(i),i,o)})},WJ=(t,e)=>UJ(t,e.doc.store,e.beforeState);class VJ{constructor(){this.l=[]}}const $x=()=>new VJ,jx=(t,e)=>t.l.push(e),Hx=(t,e)=>{const r=t.l,n=r.length;t.l=r.filter(i=>e!==i),n===t.l.length&&console.error("[yjs] Tried to remove event handler that doesn't exist.")},OR=(t,e,r)=>zv(t.l,[e,r]);class Lc{constructor(e,r){this.client=e,this.clock=r}}const Xl=(t,e)=>t===e||t!==null&&e!==null&&t.client===e.client&&t.clock===e.clock,Qe=(t,e)=>new Lc(t,e),Qa=t=>{for(const[e,r]of t.doc.share.entries())if(r===t)return e;throw bi()};class Iu{constructor(e,r,n,i=0){this.type=e,this.tname=r,this.item=n,this.assoc=i}}const Jl=(t,e,r)=>{let n=null,i=null;return t._item===null?i=Qa(t):n=Qe(t._item.id.client,t._item.id.clock),new Iu(n,i,e,r)},zh=(t,e,r=0)=>{let n=t._start;if(r<0){if(e===0)return Jl(t,null,r);e--}for(;n!==null;){if(!n.deleted&&n.countable){if(n.length>e)return Jl(t,Qe(n.id.client,n.id.clock+e),r);e-=n.length}if(n.right===null&&r<0)return Jl(t,n.lastId,r);n=n.right}return Jl(t,null,r)},$o=(t,e)=>e===void 0?!t.deleted:e.sv.has(t.id.client)&&(e.sv.get(t.id.client)||0)>t.id.clock&&!AR(e.ds,t.id),_g=(t,e)=>{const r=Ls(t.meta,_g,ws),n=t.doc.store;r.has(e)||(e.sv.forEach((i,o)=>{i<Kt(n,o)&&xi(t,Qe(o,i))}),TR(t,e.ds,i=>{}),r.add(e))};class GJ{constructor(){this.clients=new Map,this.pendingStructs=null,this.pendingDs=null}}const Uv=t=>{const e=new Map;return t.clients.forEach((r,n)=>{const i=r[r.length-1];e.set(n,i.id.clock+i.length)}),e},Kt=(t,e)=>{const r=t.clients.get(e);if(r===void 0)return 0;const n=r[r.length-1];return n.id.clock+n.length},RR=(t,e)=>{let r=t.clients.get(e.id.client);if(r===void 0)r=[],t.clients.set(e.id.client,r);else{const n=r[r.length-1];if(n.id.clock+n.length!==e.id.clock)throw bi()}r.push(e)},kn=(t,e)=>{let r=0,n=t.length-1,i=t[n],o=i.id.clock;if(o===e)return n;let s=so(e/(o+i.length-1)*n);for(;r<=n;){if(i=t[s],o=i.id.clock,o<=e){if(e<o+i.length)return s;r=s+1}else n=s-1;s=so((r+n)/2)}throw bi()},KJ=(t,e)=>{const r=t.clients.get(e.client);return r[kn(r,e.clock)]},Uh=KJ,Og=(t,e,r)=>{const n=kn(e,r),i=e[n];return i.id.clock<r&&i instanceof nr?(e.splice(n+1,0,XR(t,i,r-i.id.clock)),n+1):n},xi=(t,e)=>{const r=t.doc.store.clients.get(e.client);return r[Og(t,r,e.clock)]},zx=(t,e,r)=>{const n=e.clients.get(r.client),i=kn(n,r.clock),o=n[i];return r.clock!==o.id.clock+o.length-1&&o.constructor!==Zn&&n.splice(i+1,0,XR(t,o,r.clock-o.id.clock+1)),o},qJ=(t,e,r)=>{const n=t.clients.get(e.id.client);n[kn(n,e.id.clock)]=r},MR=(t,e,r,n,i)=>{if(n===0)return;const o=r+n;let s=Og(t,e,r),a;do a=e[s++],o<a.id.clock+a.length&&Og(t,e,o),i(a);while(s<e.length&&e[s].id.clock<o)};class XJ{constructor(e,r,n){this.doc=e,this.deleteSet=new PJ,this.beforeState=Uv(e.store),this.afterState=new Map,this.changed=new Map,this.changedParentTypes=new Map,this._mergeStructs=[],this.origin=r,this.meta=new Map,this.local=n,this.subdocsAdded=new Set,this.subdocsRemoved=new Set,this.subdocsLoaded=new Set,this._needFormattingCleanup=!1}}const Ux=(t,e)=>e.deleteSet.clients.size===0&&!IX(e.afterState,(r,n)=>e.beforeState.get(n)!==r)?!1:(CR(e.deleteSet),WJ(t,e),FJ(t,e.deleteSet),!0),Wx=(t,e,r)=>{const n=e._item;(n===null||n.id.clock<(t.beforeState.get(n.id.client)||0)&&!n.deleted)&&Ls(t.changed,e,ws).add(r)},Fc=(t,e)=>{let r=t[e],n=t[e-1],i=e;for(;i>0;r=n,n=t[--i-1]){if(n.deleted===r.deleted&&n.constructor===r.constructor&&n.mergeWith(r)){r instanceof nr&&r.parentSub!==null&&r.parent._map.get(r.parentSub)===r&&r.parent._map.set(r.parentSub,n);continue}break}const o=e-i;return o&&t.splice(e+1-o,o),o},JJ=(t,e,r)=>{for(const[n,i]of t.clients.entries()){const o=e.clients.get(n);for(let s=i.length-1;s>=0;s--){const a=i[s],l=a.clock+a.len;for(let c=kn(o,a.clock),u=o[c];c<o.length&&u.id.clock<l;u=o[++c]){const f=o[c];if(a.clock+a.len<=f.id.clock)break;f instanceof nr&&f.deleted&&!f.keep&&r(f)&&f.gc(e,!1)}}}},YJ=(t,e)=>{t.clients.forEach((r,n)=>{const i=e.clients.get(n);for(let o=r.length-1;o>=0;o--){const s=r[o],a=pR(i.length-1,1+kn(i,s.clock+s.len-1));for(let l=a,c=i[l];l>0&&c.id.clock>=s.clock;c=i[l])l-=1+Fc(i,l)}})},IR=(t,e)=>{if(e<t.length){const r=t[e],n=r.doc,i=n.store,o=r.deleteSet,s=r._mergeStructs;try{CR(o),r.afterState=Uv(r.doc.store),n.emit("beforeObserverCalls",[r,n]);const a=[];r.changed.forEach((l,c)=>a.push(()=>{(c._item===null||!c._item.deleted)&&c._callObserver(r,l)})),a.push(()=>{r.changedParentTypes.forEach((l,c)=>{c._dEH.l.length>0&&(c._item===null||!c._item.deleted)&&(l=l.filter(u=>u.target._item===null||!u.target._item.deleted),l.forEach(u=>{u.currentTarget=c,u._path=null}),l.sort((u,f)=>u.path.length-f.path.length),OR(c._dEH,l,r))})}),a.push(()=>n.emit("afterTransaction",[r,n])),zv(a,[]),r._needFormattingCleanup&&cY(r)}finally{n.gc&&JJ(o,i,n.gcFilter),YJ(o,i),r.afterState.forEach((u,f)=>{const d=r.beforeState.get(f)||0;if(d!==u){const h=i.clients.get(f),p=Fs(kn(h,d),1);for(let m=h.length-1;m>=p;)m-=1+Fc(h,m)}});for(let u=s.length-1;u>=0;u--){const{client:f,clock:d}=s[u].id,h=i.clients.get(f),p=kn(h,d);p+1<h.length&&Fc(h,p+1)>1||p>0&&Fc(h,p)}if(!r.local&&r.afterState.get(n.clientID)!==r.beforeState.get(n.clientID)&&(MJ(SR,wR,"[yjs] ",bR,xR,"Changed the client-id because another client seems to be using it."),n.clientID=_R()),n.emit("afterTransactionCleanup",[r,n]),n._observers.has("update")){const u=new $J;Ux(u,r)&&n.emit("update",[u.toUint8Array(),r.origin,n,r])}if(n._observers.has("updateV2")){const u=new HJ;Ux(u,r)&&n.emit("updateV2",[u.toUint8Array(),r.origin,n,r])}const{subdocsAdded:a,subdocsLoaded:l,subdocsRemoved:c}=r;(a.size>0||c.size>0||l.size>0)&&(a.forEach(u=>{u.clientID=n.clientID,u.collectionid==null&&(u.collectionid=n.collectionid),n.subdocs.add(u)}),c.forEach(u=>n.subdocs.delete(u)),n.emit("subdocs",[{loaded:l,added:a,removed:c},n,r]),c.forEach(u=>u.destroy())),t.length<=e+1?(n._transactionCleanups=[],n.emit("afterAllTransactions",[n,t])):IR(t,e+1)}}},Ze=(t,e,r=null,n=!0)=>{const i=t._transactionCleanups;let o=!1,s=null;t._transaction===null&&(o=!0,t._transaction=new XJ(t,r,n),i.push(t._transaction),i.length===1&&t.emit("beforeAllTransactions",[t]),t.emit("beforeTransaction",[t._transaction,t]));try{s=e(t._transaction)}finally{if(o){const a=t._transaction===i[0];t._transaction=null,a&&IR(i,0)}}return s},Vx="You must not compute changes after the event-handler fired.";class cd{constructor(e,r){this.target=e,this.currentTarget=e,this.transaction=r,this._changes=null,this._keys=null,this._delta=null,this._path=null}get path(){return this._path||(this._path=ZJ(this.currentTarget,this.target))}deletes(e){return AR(this.transaction.deleteSet,e.id)}get keys(){if(this._keys===null){if(this.transaction.doc._transactionCleanups.length===0)throw xs(Vx);const e=new Map,r=this.target;this.transaction.changed.get(r).forEach(i=>{if(i!==null){const o=r._map.get(i);let s,a;if(this.adds(o)){let l=o.left;for(;l!==null&&this.adds(l);)l=l.left;if(this.deletes(o))if(l!==null&&this.deletes(l))s="delete",a=Lh(l.content.getContent());else return;else l!==null&&this.deletes(l)?(s="update",a=Lh(l.content.getContent())):(s="add",a=void 0)}else if(this.deletes(o))s="delete",a=Lh(o.content.getContent());else return;e.set(i,{action:s,oldValue:a})}}),this._keys=e}return this._keys}get delta(){return this.changes.delta}adds(e){return e.id.clock>=(this.transaction.beforeState.get(e.id.client)||0)}get changes(){let e=this._changes;if(e===null){if(this.transaction.doc._transactionCleanups.length===0)throw xs(Vx);const r=this.target,n=ws(),i=ws(),o=[];if(e={added:n,deleted:i,delta:o,keys:this.keys},this.transaction.changed.get(r).has(null)){let a=null;const l=()=>{a&&o.push(a)};for(let c=r._start;c!==null;c=c.right)c.deleted?this.deletes(c)&&!this.adds(c)&&((a===null||a.delete===void 0)&&(l(),a={delete:0}),a.delete+=c.length,i.add(c)):this.adds(c)?((a===null||a.insert===void 0)&&(l(),a={insert:[]}),a.insert=a.insert.concat(c.content.getContent()),n.add(c)):((a===null||a.retain===void 0)&&(l(),a={retain:0}),a.retain+=c.length);a!==null&&a.retain===void 0&&l()}this._changes=e}return e}}const ZJ=(t,e)=>{const r=[];for(;e._item!==null&&e!==t;){if(e._item.parentSub!==null)r.unshift(e._item.parentSub);else{let n=0,i=e._item.parent._start;for(;i!==e._item&&i!==null;)!i.deleted&&i.countable&&(n+=i.length),i=i.right;r.unshift(n)}e=e._item.parent}return r},NR=80;let Wv=0;class QJ{constructor(e,r){e.marker=!0,this.p=e,this.index=r,this.timestamp=Wv++}}const eY=t=>{t.timestamp=Wv++},DR=(t,e,r)=>{t.p.marker=!1,t.p=e,e.marker=!0,t.index=r,t.timestamp=Wv++},tY=(t,e,r)=>{if(t.length>=NR){const n=t.reduce((i,o)=>i.timestamp<o.timestamp?i:o);return DR(n,e,r),n}else{const n=new QJ(e,r);return t.push(n),n}},ud=(t,e)=>{if(t._start===null||e===0||t._searchMarker===null)return null;const r=t._searchMarker.length===0?null:t._searchMarker.reduce((o,s)=>Dc(e-o.index)<Dc(e-s.index)?o:s);let n=t._start,i=0;for(r!==null&&(n=r.p,i=r.index,eY(r));n.right!==null&&i<e;){if(!n.deleted&&n.countable){if(e<i+n.length)break;i+=n.length}n=n.right}for(;n.left!==null&&i>e;)n=n.left,!n.deleted&&n.countable&&(i-=n.length);for(;n.left!==null&&n.left.id.client===n.id.client&&n.left.id.clock+n.left.length===n.id.clock;)n=n.left,!n.deleted&&n.countable&&(i-=n.length);return r!==null&&Dc(r.index-i)<n.parent.length/NR?(DR(r,n,i),r):tY(t._searchMarker,n,i)},el=(t,e,r)=>{for(let n=t.length-1;n>=0;n--){const i=t[n];if(r>0){let o=i.p;for(o.marker=!1;o&&(o.deleted||!o.countable);)o=o.left,o&&!o.deleted&&o.countable&&(i.index-=o.length);if(o===null||o.marker===!0){t.splice(n,1);continue}i.p=o,o.marker=!0}(e<i.index||r>0&&e===i.index)&&(i.index=Fs(e,i.index+r))}},fd=(t,e,r)=>{const n=t,i=e.changedParentTypes;for(;Ls(i,t,()=>[]).push(r),t._item!==null;)t=t._item.parent;OR(n._eH,r,e)};class _t{constructor(){this._item=null,this._map=new Map,this._start=null,this.doc=null,this._length=0,this._eH=$x(),this._dEH=$x(),this._searchMarker=null}get parent(){return this._item?this._item.parent:null}_integrate(e,r){this.doc=e,this._item=r}_copy(){throw qr()}clone(){throw qr()}_write(e){}get _first(){let e=this._start;for(;e!==null&&e.deleted;)e=e.right;return e}_callObserver(e,r){!e.local&&this._searchMarker&&(this._searchMarker.length=0)}observe(e){jx(this._eH,e)}observeDeep(e){jx(this._dEH,e)}unobserve(e){Hx(this._eH,e)}unobserveDeep(e){Hx(this._dEH,e)}toJSON(){}}const PR=(t,e,r)=>{e<0&&(e=t._length+e),r<0&&(r=t._length+r);let n=r-e;const i=[];let o=t._start;for(;o!==null&&n>0;){if(o.countable&&!o.deleted){const s=o.content.getContent();if(s.length<=e)e-=s.length;else{for(let a=e;a<s.length&&n>0;a++)i.push(s[a]),n--;e=0}}o=o.right}return i},LR=t=>{const e=[];let r=t._start;for(;r!==null;){if(r.countable&&!r.deleted){const n=r.content.getContent();for(let i=0;i<n.length;i++)e.push(n[i])}r=r.right}return e},tl=(t,e)=>{let r=0,n=t._start;for(;n!==null;){if(n.countable&&!n.deleted){const i=n.content.getContent();for(let o=0;o<i.length;o++)e(i[o],r++,t)}n=n.right}},FR=(t,e)=>{const r=[];return tl(t,(n,i)=>{r.push(e(n,i,t))}),r},rY=t=>{let e=t._start,r=null,n=0;return{[Symbol.iterator](){return this},next:()=>{if(r===null){for(;e!==null&&e.deleted;)e=e.right;if(e===null)return{done:!0,value:void 0};r=e.content.getContent(),n=0,e=e.right}const i=r[n++];return r.length<=n&&(r=null),{done:!1,value:i}}}},BR=(t,e)=>{const r=ud(t,e);let n=t._start;for(r!==null&&(n=r.p,e-=r.index);n!==null;n=n.right)if(!n.deleted&&n.countable){if(e<n.length)return n.content.getContent()[e];e-=n.length}},Nu=(t,e,r,n)=>{let i=r;const o=t.doc,s=o.clientID,a=o.store,l=r===null?e._start:r.right;let c=[];const u=()=>{c.length>0&&(i=new nr(Qe(s,Kt(a,s)),i,i&&i.lastId,l,l&&l.id,e,null,new Es(c)),i.integrate(t,0),c=[])};n.forEach(f=>{if(f===null)c.push(f);else switch(f.constructor){case Number:case Object:case Boolean:case Array:case String:c.push(f);break;default:switch(u(),f.constructor){case Uint8Array:case ArrayBuffer:i=new nr(Qe(s,Kt(a,s)),i,i&&i.lastId,l,l&&l.id,e,null,new dd(new Uint8Array(f))),i.integrate(t,0);break;case Sl:i=new nr(Qe(s,Kt(a,s)),i,i&&i.lastId,l,l&&l.id,e,null,new hd(f)),i.integrate(t,0);break;default:if(f instanceof _t)i=new nr(Qe(s,Kt(a,s)),i,i&&i.lastId,l,l&&l.id,e,null,new Ri(f)),i.integrate(t,0);else throw new Error("Unexpected content type in insert operation")}}}),u()},$R=()=>xs("Length exceeded!"),jR=(t,e,r,n)=>{if(r>e._length)throw $R();if(r===0)return e._searchMarker&&el(e._searchMarker,r,n.length),Nu(t,e,null,n);const i=r,o=ud(e,r);let s=e._start;for(o!==null&&(s=o.p,r-=o.index,r===0&&(s=s.prev,r+=s&&s.countable&&!s.deleted?s.length:0));s!==null;s=s.right)if(!s.deleted&&s.countable){if(r<=s.length){r<s.length&&xi(t,Qe(s.id.client,s.id.clock+r));break}r-=s.length}return e._searchMarker&&el(e._searchMarker,i,n.length),Nu(t,e,s,n)},nY=(t,e,r)=>{let i=(e._searchMarker||[]).reduce((o,s)=>s.index>o.index?s:o,{index:0,p:e._start}).p;if(i)for(;i.right;)i=i.right;return Nu(t,e,i,r)},HR=(t,e,r,n)=>{if(n===0)return;const i=r,o=n,s=ud(e,r);let a=e._start;for(s!==null&&(a=s.p,r-=s.index);a!==null&&r>0;a=a.right)!a.deleted&&a.countable&&(r<a.length&&xi(t,Qe(a.id.client,a.id.clock+r)),r-=a.length);for(;n>0&&a!==null;)a.deleted||(n<a.length&&xi(t,Qe(a.id.client,a.id.clock+n)),a.delete(t),n-=a.length),a=a.right;if(n>0)throw $R();e._searchMarker&&el(e._searchMarker,i,-o+n)},Du=(t,e,r)=>{const n=e._map.get(r);n!==void 0&&n.delete(t)},Vv=(t,e,r,n)=>{const i=e._map.get(r)||null,o=t.doc,s=o.clientID;let a;if(n==null)a=new Es([n]);else switch(n.constructor){case Number:case Object:case Boolean:case Array:case String:a=new Es([n]);break;case Uint8Array:a=new dd(n);break;case Sl:a=new hd(n);break;default:if(n instanceof _t)a=new Ri(n);else throw new Error("Unexpected content type")}new nr(Qe(s,Kt(o.store,s)),i,i&&i.lastId,null,null,e,r,a).integrate(t,0)},Gv=(t,e)=>{const r=t._map.get(e);return r!==void 0&&!r.deleted?r.content.getContent()[r.length-1]:void 0},zR=t=>{const e={};return t._map.forEach((r,n)=>{r.deleted||(e[n]=r.content.getContent()[r.length-1])}),e},UR=(t,e)=>{const r=t._map.get(e);return r!==void 0&&!r.deleted},iY=(t,e)=>{const r={};return t._map.forEach((n,i)=>{let o=n;for(;o!==null&&(!e.sv.has(o.id.client)||o.id.clock>=(e.sv.get(o.id.client)||0));)o=o.left;o!==null&&$o(o,e)&&(r[i]=o.content.getContent()[o.length-1])}),r},Yl=t=>NJ(t.entries(),e=>!e[1].deleted);class oY extends cd{}class Aa extends _t{constructor(){super(),this._prelimContent=[],this._searchMarker=[]}static from(e){const r=new Aa;return r.push(e),r}_integrate(e,r){super._integrate(e,r),this.insert(0,this._prelimContent),this._prelimContent=null}_copy(){return new Aa}clone(){const e=new Aa;return e.insert(0,this.toArray().map(r=>r instanceof _t?r.clone():r)),e}get length(){return this._prelimContent===null?this._length:this._prelimContent.length}_callObserver(e,r){super._callObserver(e,r),fd(this,e,new oY(this,e))}insert(e,r){this.doc!==null?Ze(this.doc,n=>{jR(n,this,e,r)}):this._prelimContent.splice(e,0,...r)}push(e){this.doc!==null?Ze(this.doc,r=>{nY(r,this,e)}):this._prelimContent.push(...e)}unshift(e){this.insert(0,e)}delete(e,r=1){this.doc!==null?Ze(this.doc,n=>{HR(n,this,e,r)}):this._prelimContent.splice(e,r)}get(e){return BR(this,e)}toArray(){return LR(this)}slice(e=0,r=this.length){return PR(this,e,r)}toJSON(){return this.map(e=>e instanceof _t?e.toJSON():e)}map(e){return FR(this,e)}forEach(e){tl(this,e)}[Symbol.iterator](){return rY(this)}_write(e){e.writeTypeRef(pY)}}class sY extends cd{constructor(e,r,n){super(e,r),this.keysChanged=n}}class Pu extends _t{constructor(e){super(),this._prelimContent=null,e===void 0?this._prelimContent=new Map:this._prelimContent=new Map(e)}_integrate(e,r){super._integrate(e,r),this._prelimContent.forEach((n,i)=>{this.set(i,n)}),this._prelimContent=null}_copy(){return new Pu}clone(){const e=new Pu;return this.forEach((r,n)=>{e.set(n,r instanceof _t?r.clone():r)}),e}_callObserver(e,r){fd(this,e,new sY(this,e,r))}toJSON(){const e={};return this._map.forEach((r,n)=>{if(!r.deleted){const i=r.content.getContent()[r.length-1];e[n]=i instanceof _t?i.toJSON():i}}),e}get size(){return[...Yl(this._map)].length}keys(){return Hh(Yl(this._map),e=>e[0])}values(){return Hh(Yl(this._map),e=>e[1].content.getContent()[e[1].length-1])}entries(){return Hh(Yl(this._map),e=>[e[0],e[1].content.getContent()[e[1].length-1]])}forEach(e){this._map.forEach((r,n)=>{r.deleted||e(r.content.getContent()[r.length-1],n,this)})}[Symbol.iterator](){return this.entries()}delete(e){this.doc!==null?Ze(this.doc,r=>{Du(r,this,e)}):this._prelimContent.delete(e)}set(e,r){return this.doc!==null?Ze(this.doc,n=>{Vv(n,this,e,r)}):this._prelimContent.set(e,r),r}get(e){return Gv(this,e)}has(e){return UR(this,e)}clear(){this.doc!==null?Ze(this.doc,e=>{this.forEach(function(r,n,i){Du(e,i,n)})}):this._prelimContent.clear()}_write(e){e.writeTypeRef(mY)}}const oi=(t,e)=>t===e||typeof t=="object"&&typeof e=="object"&&t&&e&&mJ(t,e);class Rg{constructor(e,r,n,i){this.left=e,this.right=r,this.index=n,this.currentAttributes=i}forward(){switch(this.right===null&&bi(),this.right.content.constructor){case bt:this.right.deleted||Bs(this.currentAttributes,this.right.content);break;default:this.right.deleted||(this.index+=this.right.length);break}this.left=this.right,this.right=this.right.right}}const Gx=(t,e,r)=>{for(;e.right!==null&&r>0;){switch(e.right.content.constructor){case bt:e.right.deleted||Bs(e.currentAttributes,e.right.content);break;default:e.right.deleted||(r<e.right.length&&xi(t,Qe(e.right.id.client,e.right.id.clock+r)),e.index+=e.right.length,r-=e.right.length);break}e.left=e.right,e.right=e.right.right}return e},Zl=(t,e,r,n)=>{const i=new Map,o=n?ud(e,r):null;if(o){const s=new Rg(o.p.left,o.p,o.index,i);return Gx(t,s,r-o.index)}else{const s=new Rg(null,e._start,0,i);return Gx(t,s,r)}},WR=(t,e,r,n)=>{for(;r.right!==null&&(r.right.deleted===!0||r.right.content.constructor===bt&&oi(n.get(r.right.content.key),r.right.content.value));)r.right.deleted||n.delete(r.right.content.key),r.forward();const i=t.doc,o=i.clientID;n.forEach((s,a)=>{const l=r.left,c=r.right,u=new nr(Qe(o,Kt(i.store,o)),l,l&&l.lastId,c,c&&c.id,e,null,new bt(a,s));u.integrate(t,0),r.right=u,r.forward()})},Bs=(t,e)=>{const{key:r,value:n}=e;n===null?t.delete(r):t.set(r,n)},VR=(t,e)=>{for(;t.right!==null;){if(!(t.right.deleted||t.right.content.constructor===bt&&oi(e[t.right.content.key]??null,t.right.content.value)))break;t.forward()}},GR=(t,e,r,n)=>{const i=t.doc,o=i.clientID,s=new Map;for(const a in n){const l=n[a],c=r.currentAttributes.get(a)??null;if(!oi(c,l)){s.set(a,c);const{left:u,right:f}=r;r.right=new nr(Qe(o,Kt(i.store,o)),u,u&&u.lastId,f,f&&f.id,e,null,new bt(a,l)),r.right.integrate(t,0),r.forward()}}return s},Wh=(t,e,r,n,i)=>{r.currentAttributes.forEach((d,h)=>{i[h]===void 0&&(i[h]=null)});const o=t.doc,s=o.clientID;VR(r,i);const a=GR(t,e,r,i),l=n.constructor===String?new _n(n):n instanceof _t?new Ri(n):new $s(n);let{left:c,right:u,index:f}=r;e._searchMarker&&el(e._searchMarker,r.index,l.getLength()),u=new nr(Qe(s,Kt(o.store,s)),c,c&&c.lastId,u,u&&u.id,e,null,l),u.integrate(t,0),r.right=u,r.index=f,r.forward(),WR(t,e,r,a)},Kx=(t,e,r,n,i)=>{const o=t.doc,s=o.clientID;VR(r,i);const a=GR(t,e,r,i);e:for(;r.right!==null&&(n>0||a.size>0&&(r.right.deleted||r.right.content.constructor===bt));){if(!r.right.deleted)switch(r.right.content.constructor){case bt:{const{key:l,value:c}=r.right.content,u=i[l];if(u!==void 0){if(oi(u,c))a.delete(l);else{if(n===0)break e;a.set(l,c)}r.right.delete(t)}else r.currentAttributes.set(l,c);break}default:n<r.right.length&&xi(t,Qe(r.right.id.client,r.right.id.clock+n)),n-=r.right.length;break}r.forward()}if(n>0){let l="";for(;n>0;n--)l+=`
556
- `;r.right=new nr(Qe(s,Kt(o.store,s)),r.left,r.left&&r.left.lastId,r.right,r.right&&r.right.id,e,null,new _n(l)),r.right.integrate(t,0),r.forward()}WR(t,e,r,a)},KR=(t,e,r,n,i)=>{let o=e;const s=Kr();for(;o&&(!o.countable||o.deleted);){if(!o.deleted&&o.content.constructor===bt){const c=o.content;s.set(c.key,c)}o=o.right}let a=0,l=!1;for(;e!==o;){if(r===e&&(l=!0),!e.deleted){const c=e.content;switch(c.constructor){case bt:{const{key:u,value:f}=c,d=n.get(u)??null;(s.get(u)!==c||d===f)&&(e.delete(t),a++,!l&&(i.get(u)??null)===f&&d!==f&&(d===null?i.delete(u):i.set(u,d))),!l&&!e.deleted&&Bs(i,c);break}}}e=e.right}return a},aY=(t,e)=>{for(;e&&e.right&&(e.right.deleted||!e.right.countable);)e=e.right;const r=new Set;for(;e&&(e.deleted||!e.countable);){if(!e.deleted&&e.content.constructor===bt){const n=e.content.key;r.has(n)?e.delete(t):r.add(n)}e=e.left}},lY=t=>{let e=0;return Ze(t.doc,r=>{let n=t._start,i=t._start,o=Kr();const s=Eg(o);for(;i;){if(i.deleted===!1)switch(i.content.constructor){case bt:Bs(s,i.content);break;default:e+=KR(r,n,i,o,s),o=Eg(s),n=i;break}i=i.right}}),e},cY=t=>{const e=new Set,r=t.doc;for(const[n,i]of t.afterState.entries()){const o=t.beforeState.get(n)||0;i!==o&&MR(t,r.store.clients.get(n),o,i,s=>{!s.deleted&&s.content.constructor===bt&&s.constructor!==Zn&&e.add(s.parent)})}Ze(r,n=>{TR(t,t.deleteSet,i=>{if(i instanceof Zn||!i.parent._hasFormatting||e.has(i.parent))return;const o=i.parent;i.content.constructor===bt?e.add(o):aY(n,i)});for(const i of e)lY(i)})},qx=(t,e,r)=>{const n=r,i=Eg(e.currentAttributes),o=e.right;for(;r>0&&e.right!==null;){if(e.right.deleted===!1)switch(e.right.content.constructor){case Ri:case $s:case _n:r<e.right.length&&xi(t,Qe(e.right.id.client,e.right.id.clock+r)),r-=e.right.length,e.right.delete(t);break}e.forward()}o&&KR(t,o,e.right,i,e.currentAttributes);const s=(e.left||e.right).parent;return s._searchMarker&&el(s._searchMarker,e.index,-n+r),e};class uY extends cd{constructor(e,r,n){super(e,r),this.childListChanged=!1,this.keysChanged=new Set,n.forEach(i=>{i===null?this.childListChanged=!0:this.keysChanged.add(i)})}get changes(){if(this._changes===null){const e={keys:this.keys,delta:this.delta,added:new Set,deleted:new Set};this._changes=e}return this._changes}get delta(){if(this._delta===null){const e=this.target.doc,r=[];Ze(e,n=>{const i=new Map,o=new Map;let s=this.target._start,a=null;const l={};let c="",u=0,f=0;const d=()=>{if(a!==null){let h=null;switch(a){case"delete":f>0&&(h={delete:f}),f=0;break;case"insert":(typeof c=="object"||c.length>0)&&(h={insert:c},i.size>0&&(h.attributes={},i.forEach((p,m)=>{p!==null&&(h.attributes[m]=p)}))),c="";break;case"retain":u>0&&(h={retain:u},dJ(l)||(h.attributes=cJ({},l))),u=0;break}h&&r.push(h),a=null}};for(;s!==null;){switch(s.content.constructor){case Ri:case $s:this.adds(s)?this.deletes(s)||(d(),a="insert",c=s.content.getContent()[0],d()):this.deletes(s)?(a!=="delete"&&(d(),a="delete"),f+=1):s.deleted||(a!=="retain"&&(d(),a="retain"),u+=1);break;case _n:this.adds(s)?this.deletes(s)||(a!=="insert"&&(d(),a="insert"),c+=s.content.str):this.deletes(s)?(a!=="delete"&&(d(),a="delete"),f+=s.length):s.deleted||(a!=="retain"&&(d(),a="retain"),u+=s.length);break;case bt:{const{key:h,value:p}=s.content;if(this.adds(s)){if(!this.deletes(s)){const m=i.get(h)??null;oi(m,p)?p!==null&&s.delete(n):(a==="retain"&&d(),oi(p,o.get(h)??null)?delete l[h]:l[h]=p)}}else if(this.deletes(s)){o.set(h,p);const m=i.get(h)??null;oi(m,p)||(a==="retain"&&d(),l[h]=m)}else if(!s.deleted){o.set(h,p);const m=l[h];m!==void 0&&(oi(m,p)?m!==null&&s.delete(n):(a==="retain"&&d(),p===null?delete l[h]:l[h]=p))}s.deleted||(a==="insert"&&d(),Bs(i,s.content));break}}s=s.right}for(d();r.length>0;){const h=r[r.length-1];if(h.retain!==void 0&&h.attributes===void 0)r.pop();else break}}),this._delta=r}return this._delta}}class rl extends _t{constructor(e){super(),this._pending=e!==void 0?[()=>this.insert(0,e)]:[],this._searchMarker=[],this._hasFormatting=!1}get length(){return this._length}_integrate(e,r){super._integrate(e,r);try{this._pending.forEach(n=>n())}catch(n){console.error(n)}this._pending=null}_copy(){return new rl}clone(){const e=new rl;return e.applyDelta(this.toDelta()),e}_callObserver(e,r){super._callObserver(e,r);const n=new uY(this,e,r);fd(this,e,n),!e.local&&this._hasFormatting&&(e._needFormattingCleanup=!0)}toString(){let e="",r=this._start;for(;r!==null;)!r.deleted&&r.countable&&r.content.constructor===_n&&(e+=r.content.str),r=r.right;return e}toJSON(){return this.toString()}applyDelta(e,{sanitize:r=!0}={}){this.doc!==null?Ze(this.doc,n=>{const i=new Rg(null,this._start,0,new Map);for(let o=0;o<e.length;o++){const s=e[o];if(s.insert!==void 0){const a=!r&&typeof s.insert=="string"&&o===e.length-1&&i.right===null&&s.insert.slice(-1)===`
557
- `?s.insert.slice(0,-1):s.insert;(typeof a!="string"||a.length>0)&&Wh(n,this,i,a,s.attributes||{})}else s.retain!==void 0?Kx(n,this,i,s.retain,s.attributes||{}):s.delete!==void 0&&qx(n,i,s.delete)}}):this._pending.push(()=>this.applyDelta(e))}toDelta(e,r,n){const i=[],o=new Map,s=this.doc;let a="",l=this._start;function c(){if(a.length>0){const f={};let d=!1;o.forEach((p,m)=>{d=!0,f[m]=p});const h={insert:a};d&&(h.attributes=f),i.push(h),a=""}}const u=()=>{for(;l!==null;){if($o(l,e)||r!==void 0&&$o(l,r))switch(l.content.constructor){case _n:{const f=o.get("ychange");e!==void 0&&!$o(l,e)?(f===void 0||f.user!==l.id.client||f.type!=="removed")&&(c(),o.set("ychange",n?n("removed",l.id):{type:"removed"})):r!==void 0&&!$o(l,r)?(f===void 0||f.user!==l.id.client||f.type!=="added")&&(c(),o.set("ychange",n?n("added",l.id):{type:"added"})):f!==void 0&&(c(),o.delete("ychange")),a+=l.content.str;break}case Ri:case $s:{c();const f={insert:l.content.getContent()[0]};if(o.size>0){const d={};f.attributes=d,o.forEach((h,p)=>{d[p]=h})}i.push(f);break}case bt:$o(l,e)&&(c(),Bs(o,l.content));break}l=l.right}c()};return e||r?Ze(s,f=>{e&&_g(f,e),r&&_g(f,r),u()},"cleanup"):u(),i}insert(e,r,n){if(r.length<=0)return;const i=this.doc;i!==null?Ze(i,o=>{const s=Zl(o,this,e,!n);n||(n={},s.currentAttributes.forEach((a,l)=>{n[l]=a})),Wh(o,this,s,r,n)}):this._pending.push(()=>this.insert(e,r,n))}insertEmbed(e,r,n){const i=this.doc;i!==null?Ze(i,o=>{const s=Zl(o,this,e,!n);Wh(o,this,s,r,n||{})}):this._pending.push(()=>this.insertEmbed(e,r,n||{}))}delete(e,r){if(r===0)return;const n=this.doc;n!==null?Ze(n,i=>{qx(i,Zl(i,this,e,!0),r)}):this._pending.push(()=>this.delete(e,r))}format(e,r,n){if(r===0)return;const i=this.doc;i!==null?Ze(i,o=>{const s=Zl(o,this,e,!1);s.right!==null&&Kx(o,this,s,r,n)}):this._pending.push(()=>this.format(e,r,n))}removeAttribute(e){this.doc!==null?Ze(this.doc,r=>{Du(r,this,e)}):this._pending.push(()=>this.removeAttribute(e))}setAttribute(e,r){this.doc!==null?Ze(this.doc,n=>{Vv(n,this,e,r)}):this._pending.push(()=>this.setAttribute(e,r))}getAttribute(e){return Gv(this,e)}getAttributes(){return zR(this)}_write(e){e.writeTypeRef(gY)}}class Vh{constructor(e,r=()=>!0){this._filter=r,this._root=e,this._currentNode=e._start,this._firstCall=!0}[Symbol.iterator](){return this}next(){let e=this._currentNode,r=e&&e.content&&e.content.type;if(e!==null&&(!this._firstCall||e.deleted||!this._filter(r)))do if(r=e.content.type,!e.deleted&&(r.constructor===nl||r.constructor===Ss)&&r._start!==null)e=r._start;else for(;e!==null;)if(e.right!==null){e=e.right;break}else e.parent===this._root?e=null:e=e.parent._item;while(e!==null&&(e.deleted||!this._filter(e.content.type)));return this._firstCall=!1,e===null?{value:void 0,done:!0}:(this._currentNode=e,{value:e.content.type,done:!1})}}class Ss extends _t{constructor(){super(),this._prelimContent=[]}get firstChild(){const e=this._first;return e?e.content.getContent()[0]:null}_integrate(e,r){super._integrate(e,r),this.insert(0,this._prelimContent),this._prelimContent=null}_copy(){return new Ss}clone(){const e=new Ss;return e.insert(0,this.toArray().map(r=>r instanceof _t?r.clone():r)),e}get length(){return this._prelimContent===null?this._length:this._prelimContent.length}createTreeWalker(e){return new Vh(this,e)}querySelector(e){e=e.toUpperCase();const n=new Vh(this,i=>i.nodeName&&i.nodeName.toUpperCase()===e).next();return n.done?null:n.value}querySelectorAll(e){return e=e.toUpperCase(),bs(new Vh(this,r=>r.nodeName&&r.nodeName.toUpperCase()===e))}_callObserver(e,r){fd(this,e,new fY(this,r,e))}toString(){return FR(this,e=>e.toString()).join("")}toJSON(){return this.toString()}toDOM(e=document,r={},n){const i=e.createDocumentFragment();return n!==void 0&&n._createAssociation(i,this),tl(this,o=>{i.insertBefore(o.toDOM(e,r,n),null)}),i}insert(e,r){this.doc!==null?Ze(this.doc,n=>{jR(n,this,e,r)}):this._prelimContent.splice(e,0,...r)}insertAfter(e,r){if(this.doc!==null)Ze(this.doc,n=>{const i=e&&e instanceof _t?e._item:e;Nu(n,this,i,r)});else{const n=this._prelimContent,i=e===null?0:n.findIndex(o=>o===e)+1;if(i===0&&e!==null)throw xs("Reference item not found");n.splice(i,0,...r)}}delete(e,r=1){this.doc!==null?Ze(this.doc,n=>{HR(n,this,e,r)}):this._prelimContent.splice(e,r)}toArray(){return LR(this)}push(e){this.insert(this.length,e)}unshift(e){this.insert(0,e)}get(e){return BR(this,e)}slice(e=0,r=this.length){return PR(this,e,r)}forEach(e){tl(this,e)}_write(e){e.writeTypeRef(vY)}}class nl extends Ss{constructor(e="UNDEFINED"){super(),this.nodeName=e,this._prelimAttrs=new Map}get nextSibling(){const e=this._item?this._item.next:null;return e?e.content.type:null}get prevSibling(){const e=this._item?this._item.prev:null;return e?e.content.type:null}_integrate(e,r){super._integrate(e,r),this._prelimAttrs.forEach((n,i)=>{this.setAttribute(i,n)}),this._prelimAttrs=null}_copy(){return new nl(this.nodeName)}clone(){const e=new nl(this.nodeName),r=this.getAttributes();return fJ(r,(n,i)=>{typeof n=="string"&&e.setAttribute(i,n)}),e.insert(0,this.toArray().map(n=>n instanceof _t?n.clone():n)),e}toString(){const e=this.getAttributes(),r=[],n=[];for(const a in e)n.push(a);n.sort();const i=n.length;for(let a=0;a<i;a++){const l=n[a];r.push(l+'="'+e[l]+'"')}const o=this.nodeName.toLocaleLowerCase(),s=r.length>0?" "+r.join(" "):"";return`<${o}${s}>${super.toString()}</${o}>`}removeAttribute(e){this.doc!==null?Ze(this.doc,r=>{Du(r,this,e)}):this._prelimAttrs.delete(e)}setAttribute(e,r){this.doc!==null?Ze(this.doc,n=>{Vv(n,this,e,r)}):this._prelimAttrs.set(e,r)}getAttribute(e){return Gv(this,e)}hasAttribute(e){return UR(this,e)}getAttributes(e){return e?iY(this,e):zR(this)}toDOM(e=document,r={},n){const i=e.createElement(this.nodeName),o=this.getAttributes();for(const s in o){const a=o[s];typeof a=="string"&&i.setAttribute(s,a)}return tl(this,s=>{i.appendChild(s.toDOM(e,r,n))}),n!==void 0&&n._createAssociation(i,this),i}_write(e){e.writeTypeRef(yY),e.writeKey(this.nodeName)}}class fY extends cd{constructor(e,r,n){super(e,n),this.childListChanged=!1,this.attributesChanged=new Set,r.forEach(i=>{i===null?this.childListChanged=!0:this.attributesChanged.add(i)})}}class il extends rl{get nextSibling(){const e=this._item?this._item.next:null;return e?e.content.type:null}get prevSibling(){const e=this._item?this._item.prev:null;return e?e.content.type:null}_copy(){return new il}clone(){const e=new il;return e.applyDelta(this.toDelta()),e}toDOM(e=document,r,n){const i=e.createTextNode(this.toString());return n!==void 0&&n._createAssociation(i,this),i}toString(){return this.toDelta().map(e=>{const r=[];for(const i in e.attributes){const o=[];for(const s in e.attributes[i])o.push({key:s,value:e.attributes[i][s]});o.sort((s,a)=>s.key<a.key?-1:1),r.push({nodeName:i,attrs:o})}r.sort((i,o)=>i.nodeName<o.nodeName?-1:1);let n="";for(let i=0;i<r.length;i++){const o=r[i];n+=`<${o.nodeName}`;for(let s=0;s<o.attrs.length;s++){const a=o.attrs[s];n+=` ${a.key}="${a.value}"`}n+=">"}n+=e.insert;for(let i=r.length-1;i>=0;i--)n+=`</${r[i].nodeName}>`;return n}).join("")}toJSON(){return this.toString()}_write(e){e.writeTypeRef(wY)}}class qR{constructor(e,r){this.id=e,this.length=r}get deleted(){throw qr()}mergeWith(e){return!1}write(e,r,n){throw qr()}integrate(e,r){throw qr()}}const dY=0;class Zn extends qR{get deleted(){return!0}delete(){}mergeWith(e){return this.constructor!==e.constructor?!1:(this.length+=e.length,!0)}integrate(e,r){r>0&&(this.id.clock+=r,this.length-=r),RR(e.doc.store,this)}write(e,r){e.writeInfo(dY),e.writeLen(this.length-r)}getMissing(e,r){return null}}class dd{constructor(e){this.content=e}getLength(){return 1}getContent(){return[this.content]}isCountable(){return!0}copy(){return new dd(this.content)}splice(e){throw qr()}mergeWith(e){return!1}integrate(e,r){}delete(e){}gc(e){}write(e,r){e.writeBuf(this.content)}getRef(){return 3}}class Lu{constructor(e){this.len=e}getLength(){return this.len}getContent(){return[]}isCountable(){return!1}copy(){return new Lu(this.len)}splice(e){const r=new Lu(this.len-e);return this.len=e,r}mergeWith(e){return this.len+=e.len,!0}integrate(e,r){kR(e.deleteSet,r.id.client,r.id.clock,this.len),r.markDeleted()}delete(e){}gc(e){}write(e,r){e.writeLen(this.len-r)}getRef(){return 1}}const hY=(t,e)=>new Sl({guid:t,...e,shouldLoad:e.shouldLoad||e.autoLoad||!1});class hd{constructor(e){e._item&&console.error("This document was already integrated as a sub-document. You should create a second instance instead with the same guid."),this.doc=e;const r={};this.opts=r,e.gc||(r.gc=!1),e.autoLoad&&(r.autoLoad=!0),e.meta!==null&&(r.meta=e.meta)}getLength(){return 1}getContent(){return[this.doc]}isCountable(){return!0}copy(){return new hd(hY(this.doc.guid,this.opts))}splice(e){throw qr()}mergeWith(e){return!1}integrate(e,r){this.doc._item=r,e.subdocsAdded.add(this.doc),this.doc.shouldLoad&&e.subdocsLoaded.add(this.doc)}delete(e){e.subdocsAdded.has(this.doc)?e.subdocsAdded.delete(this.doc):e.subdocsRemoved.add(this.doc)}gc(e){}write(e,r){e.writeString(this.doc.guid),e.writeAny(this.opts)}getRef(){return 9}}class $s{constructor(e){this.embed=e}getLength(){return 1}getContent(){return[this.embed]}isCountable(){return!0}copy(){return new $s(this.embed)}splice(e){throw qr()}mergeWith(e){return!1}integrate(e,r){}delete(e){}gc(e){}write(e,r){e.writeJSON(this.embed)}getRef(){return 5}}class bt{constructor(e,r){this.key=e,this.value=r}getLength(){return 1}getContent(){return[]}isCountable(){return!1}copy(){return new bt(this.key,this.value)}splice(e){throw qr()}mergeWith(e){return!1}integrate(e,r){const n=r.parent;n._searchMarker=null,n._hasFormatting=!0}delete(e){}gc(e){}write(e,r){e.writeKey(this.key),e.writeJSON(this.value)}getRef(){return 6}}class Es{constructor(e){this.arr=e}getLength(){return this.arr.length}getContent(){return this.arr}isCountable(){return!0}copy(){return new Es(this.arr)}splice(e){const r=new Es(this.arr.slice(e));return this.arr=this.arr.slice(0,e),r}mergeWith(e){return this.arr=this.arr.concat(e.arr),!0}integrate(e,r){}delete(e){}gc(e){}write(e,r){const n=this.arr.length;e.writeLen(n-r);for(let i=r;i<n;i++){const o=this.arr[i];e.writeAny(o)}}getRef(){return 8}}class _n{constructor(e){this.str=e}getLength(){return this.str.length}getContent(){return this.str.split("")}isCountable(){return!0}copy(){return new _n(this.str)}splice(e){const r=new _n(this.str.slice(e));this.str=this.str.slice(0,e);const n=this.str.charCodeAt(e-1);return n>=55296&&n<=56319&&(this.str=this.str.slice(0,e-1)+"�",r.str="�"+r.str.slice(1)),r}mergeWith(e){return this.str+=e.str,!0}integrate(e,r){}delete(e){}gc(e){}write(e,r){e.writeString(r===0?this.str:this.str.slice(r))}getRef(){return 4}}const pY=0,mY=1,gY=2,yY=3,vY=4,wY=6;class Ri{constructor(e){this.type=e}getLength(){return 1}getContent(){return[this.type]}isCountable(){return!0}copy(){return new Ri(this.type._copy())}splice(e){throw qr()}mergeWith(e){return!1}integrate(e,r){this.type._integrate(e.doc,r)}delete(e){let r=this.type._start;for(;r!==null;)r.deleted?r.id.clock<(e.beforeState.get(r.id.client)||0)&&e._mergeStructs.push(r):r.delete(e),r=r.right;this.type._map.forEach(n=>{n.deleted?n.id.clock<(e.beforeState.get(n.id.client)||0)&&e._mergeStructs.push(n):n.delete(e)}),e.changed.delete(this.type)}gc(e){let r=this.type._start;for(;r!==null;)r.gc(e,!0),r=r.right;this.type._start=null,this.type._map.forEach(n=>{for(;n!==null;)n.gc(e,!0),n=n.left}),this.type._map=new Map}write(e,r){this.type._write(e)}getRef(){return 7}}const XR=(t,e,r)=>{const{client:n,clock:i}=e.id,o=new nr(Qe(n,i+r),e,Qe(n,i+r-1),e.right,e.rightOrigin,e.parent,e.parentSub,e.content.splice(r));return e.deleted&&o.markDeleted(),e.keep&&(o.keep=!0),e.redone!==null&&(o.redone=Qe(e.redone.client,e.redone.clock+r)),e.right=o,o.right!==null&&(o.right.left=o),t._mergeStructs.push(o),o.parentSub!==null&&o.right===null&&o.parent._map.set(o.parentSub,o),e.length=r,o};let nr=class Mg extends qR{constructor(e,r,n,i,o,s,a,l){super(e,l.getLength()),this.origin=n,this.left=r,this.right=i,this.rightOrigin=o,this.parent=s,this.parentSub=a,this.redone=null,this.content=l,this.info=this.content.isCountable()?Ox:0}set marker(e){(this.info&Bh)>0!==e&&(this.info^=Bh)}get marker(){return(this.info&Bh)>0}get keep(){return(this.info&_x)>0}set keep(e){this.keep!==e&&(this.info^=_x)}get countable(){return(this.info&Ox)>0}get deleted(){return(this.info&Fh)>0}set deleted(e){this.deleted!==e&&(this.info^=Fh)}markDeleted(){this.info|=Fh}getMissing(e,r){if(this.origin&&this.origin.client!==this.id.client&&this.origin.clock>=Kt(r,this.origin.client))return this.origin.client;if(this.rightOrigin&&this.rightOrigin.client!==this.id.client&&this.rightOrigin.clock>=Kt(r,this.rightOrigin.client))return this.rightOrigin.client;if(this.parent&&this.parent.constructor===Lc&&this.id.client!==this.parent.client&&this.parent.clock>=Kt(r,this.parent.client))return this.parent.client;if(this.origin&&(this.left=zx(e,r,this.origin),this.origin=this.left.lastId),this.rightOrigin&&(this.right=xi(e,this.rightOrigin),this.rightOrigin=this.right.id),this.left&&this.left.constructor===Zn||this.right&&this.right.constructor===Zn)this.parent=null;else if(!this.parent)this.left&&this.left.constructor===Mg&&(this.parent=this.left.parent,this.parentSub=this.left.parentSub),this.right&&this.right.constructor===Mg&&(this.parent=this.right.parent,this.parentSub=this.right.parentSub);else if(this.parent.constructor===Lc){const n=Uh(r,this.parent);n.constructor===Zn?this.parent=null:this.parent=n.content.type}return null}integrate(e,r){if(r>0&&(this.id.clock+=r,this.left=zx(e,e.doc.store,Qe(this.id.client,this.id.clock-1)),this.origin=this.left.lastId,this.content=this.content.splice(r),this.length-=r),this.parent){if(!this.left&&(!this.right||this.right.left!==null)||this.left&&this.left.right!==this.right){let n=this.left,i;if(n!==null)i=n.right;else if(this.parentSub!==null)for(i=this.parent._map.get(this.parentSub)||null;i!==null&&i.left!==null;)i=i.left;else i=this.parent._start;const o=new Set,s=new Set;for(;i!==null&&i!==this.right;){if(s.add(i),o.add(i),Xl(this.origin,i.origin)){if(i.id.client<this.id.client)n=i,o.clear();else if(Xl(this.rightOrigin,i.rightOrigin))break}else if(i.origin!==null&&s.has(Uh(e.doc.store,i.origin)))o.has(Uh(e.doc.store,i.origin))||(n=i,o.clear());else break;i=i.right}this.left=n}if(this.left!==null){const n=this.left.right;this.right=n,this.left.right=this}else{let n;if(this.parentSub!==null)for(n=this.parent._map.get(this.parentSub)||null;n!==null&&n.left!==null;)n=n.left;else n=this.parent._start,this.parent._start=this;this.right=n}this.right!==null?this.right.left=this:this.parentSub!==null&&(this.parent._map.set(this.parentSub,this),this.left!==null&&this.left.delete(e)),this.parentSub===null&&this.countable&&!this.deleted&&(this.parent._length+=this.length),RR(e.doc.store,this),this.content.integrate(e,this),Wx(e,this.parent,this.parentSub),(this.parent._item!==null&&this.parent._item.deleted||this.parentSub!==null&&this.right!==null)&&this.delete(e)}else new Zn(this.id,this.length).integrate(e,0)}get next(){let e=this.right;for(;e!==null&&e.deleted;)e=e.right;return e}get prev(){let e=this.left;for(;e!==null&&e.deleted;)e=e.left;return e}get lastId(){return this.length===1?this.id:Qe(this.id.client,this.id.clock+this.length-1)}mergeWith(e){if(this.constructor===e.constructor&&Xl(e.origin,this.lastId)&&this.right===e&&Xl(this.rightOrigin,e.rightOrigin)&&this.id.client===e.id.client&&this.id.clock+this.length===e.id.clock&&this.deleted===e.deleted&&this.redone===null&&e.redone===null&&this.content.constructor===e.content.constructor&&this.content.mergeWith(e.content)){const r=this.parent._searchMarker;return r&&r.forEach(n=>{n.p===e&&(n.p=this,!this.deleted&&this.countable&&(n.index-=this.length))}),e.keep&&(this.keep=!0),this.right=e.right,this.right!==null&&(this.right.left=this),this.length+=e.length,!0}return!1}delete(e){if(!this.deleted){const r=this.parent;this.countable&&this.parentSub===null&&(r._length-=this.length),this.markDeleted(),kR(e.deleteSet,this.id.client,this.id.clock,this.length),Wx(e,r,this.parentSub),this.content.delete(e)}}gc(e,r){if(!this.deleted)throw bi();this.content.gc(e),r?qJ(e,this,new Zn(this.id,this.length)):this.content=new Lu(this.length)}write(e,r){const n=r>0?Qe(this.id.client,this.id.clock+r-1):this.origin,i=this.rightOrigin,o=this.parentSub,s=this.content.getRef()&FX|(n===null?0:Mu)|(i===null?0:mR)|(o===null?0:LX);if(e.writeInfo(s),n!==null&&e.writeLeftID(n),i!==null&&e.writeRightID(i),n===null&&i===null){const a=this.parent;if(a._item!==void 0){const l=a._item;if(l===null){const c=Qa(a);e.writeParentInfo(!0),e.writeString(c)}else e.writeParentInfo(!1),e.writeLeftID(l.id)}else a.constructor===String?(e.writeParentInfo(!0),e.writeString(a)):a.constructor===Lc?(e.writeParentInfo(!1),e.writeLeftID(a)):bi();o!==null&&e.writeString(o)}this.content.write(e,r)}};const JR=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:{},YR="__ $YJS$ __";JR[YR]===!0&&console.error("Yjs was already imported. This breaks constructor checks and will lead to issues! - https://github.com/yjs/yjs/issues/438");JR[YR]=!0;const bY=new et("y-sync");new et("y-undo");new et("yjs-cursor");const xY=(t,e,r)=>{if(t===0)return zh(e,0,-1);let n=e._first===null?null:e._first.content.type;for(;n!==null&&e!==n;){if(n instanceof il){if(n._length>=t)return zh(n,t,-1);if(t-=n._length,n._item!==null&&n._item.next!==null)n=n._item.next.content.type;else{do n=n._item===null?null:n._item.parent,t--;while(n!==e&&n!==null&&n._item!==null&&n._item.next===null);n!==null&&n!==e&&(n=n._item===null?null:n._item.next.content.type)}}else{const i=(r.get(n)||{nodeSize:0}).nodeSize;if(n._first!==null&&t<i)n=n._first.content.type,t--;else{if(t===1&&n._length===0&&i>1)return new Iu(n._item===null?null:n._item.id,n._item===null?Qa(n):null,null);if(t-=i,n._item!==null&&n._item.next!==null)n=n._item.next.content.type;else{if(t===0)return n=n._item===null?n:n._item.parent,new Iu(n._item===null?null:n._item.id,n._item===null?Qa(n):null,null);do n=n._item.parent,t--;while(n!==e&&n._item.next===null);n!==e&&(n=n._item.next.content.type)}}}if(n===null)throw bi();if(t===0&&n.constructor!==il&&n!==e)return SY(n._item.parent,n._item)}return zh(e,e._length,-1)},SY=(t,e)=>{let r=null,n=null;return t._item===null?n=Qa(t):r=Qe(t._item.id.client,t._item.id.clock),new Iu(r,n,e.id)};function Kv(t,e,r){const n=[],i=t.node(0);r=typeof r=="number"&&r>=0?r:t.sameParent(e)?Math.max(0,t.sharedDepth(e.pos)-1):t.sharedDepth(e.pos);const o=new Ra(t,e,r),s=o.depth===0?0:i.resolve(o.start).posAtIndex(0);return o.parent.forEach((a,l)=>{const c=s+l,u=c+a.nodeSize;if(c<o.start||c>=o.end)return;const f=new iy(i.resolve(c),i.resolve(u));n.push(f)}),n}class qv{constructor(e,r){kl(this,"anchor");kl(this,"head");this.anchor=e,this.head=r}map(e){return new qv(e.map(this.anchor),e.map(this.head))}resolve(e){const r=e.resolve(this.anchor),n=e.resolve(this.head);return new Pr(r,n)}}class Pr extends Re{constructor(r,n,i,o=1){const{doc:s}=r,a=r===n,l=r.pos===s.content.size&&n.pos===s.content.size,c=a&&!l?s.resolve(n.pos+(o>0?1:-1)):n,u=a&&l?s.resolve(r.pos-(o>0?1:-1)):r,f=Kv(u.min(c),u.max(c),i);super(c.pos>=r.pos?f[0].$from:f[f.length-1].$to,c.pos>=r.pos?f[f.length-1].$to:f[0].$from,f);kl(this,"depth");this.depth=i}get $to(){return this.ranges[this.ranges.length-1].$to}eq(r){return r instanceof Pr&&r.$from.pos===this.$from.pos&&r.$to.pos===this.$to.pos}map(r,n){const i=r.resolve(n.map(this.anchor)),o=r.resolve(n.map(this.head));return new Pr(i,o)}toJSON(){return{type:"nodeRange",anchor:this.anchor,head:this.head}}get isForwards(){return this.head>=this.anchor}get isBackwards(){return!this.isForwards}extendBackwards(){const{doc:r}=this.$from;if(this.isForwards&&this.ranges.length>1){const o=this.ranges.slice(0,-1),s=o[0].$from,a=o[o.length-1].$to;return new Pr(s,a,this.depth)}const n=this.ranges[0],i=r.resolve(Math.max(0,n.$from.pos-1));return new Pr(this.$anchor,i,this.depth)}extendForwards(){const{doc:r}=this.$from;if(this.isBackwards&&this.ranges.length>1){const o=this.ranges.slice(1),s=o[0].$from,a=o[o.length-1].$to;return new Pr(a,s,this.depth)}const n=this.ranges[this.ranges.length-1],i=r.resolve(Math.min(r.content.size,n.$to.pos+1));return new Pr(this.$anchor,i,this.depth)}static fromJSON(r,n){return new Pr(r.resolve(n.anchor),r.resolve(n.head))}static create(r,n,i,o,s=1){return new this(r.resolve(n),r.resolve(i),o,s)}getBookmark(){return new qv(this.anchor,this.head)}}function EY(t){const e=t.cloneNode(!0),r=[t,...Array.from(t.getElementsByTagName("*"))],n=[e,...Array.from(e.getElementsByTagName("*"))];return r.forEach((i,o)=>{n[o].style.cssText=function(s){let a="";const l=getComputedStyle(s);for(let c=0;c<l.length;c+=1)a+=`${l[c]}:${l.getPropertyValue(l[c])};`;return a}(i)}),e}function Ql(t,e){return window.getComputedStyle(t)[e]}function TY(t=0,e=0,r=0){return Math.min(Math.max(t,e),r)}function Xx(t){t.parentNode!==null&&t.parentNode!==void 0&&t.parentNode.removeChild(t)}const ZR=t=>{const{x:e,y:r,direction:n,editor:i}=t;let o=null,s=null,a=null,l=e;for(;s===null&&l<window.innerWidth&&l>0;){const c=document.elementsFromPoint(l,r),u=c.findIndex(d=>d.classList.contains("ProseMirror")),f=c.slice(0,u);if(f.length>0){const d=f[0];if(o=d,a=i.view.posAtDOM(d,0),a>=0){s=i.state.doc.nodeAt(Math.max(a-1,0)),(s===null||s.isText)&&(s=i.state.doc.nodeAt(Math.max(a-1,0))),s||(s=i.state.doc.nodeAt(Math.max(a,0)));break}}n==="left"?l-=1:l+=1}return{resultElement:o,resultNode:s,pos:a!==null?a:null}};function AY(t,e){const{doc:r}=e.view.state,n=ZR({editor:e,x:t.clientX,y:t.clientY,direction:"right"});if(!n.resultNode||n.pos===null)return[];const i=t.clientX,o=function(u,f,d){const h=parseInt(Ql(u.dom,"paddingLeft"),10),p=parseInt(Ql(u.dom,"paddingRight"),10),m=parseInt(Ql(u.dom,"borderLeftWidth"),10),y=parseInt(Ql(u.dom,"borderLeftWidth"),10),g=u.dom.getBoundingClientRect();return{left:TY(f,g.left+h+m,g.right-p-y),top:d}}(e.view,i,t.clientY),s=e.view.posAtCoords(o);if(!s)return[];const{pos:a}=s;if(!r.resolve(a).parent)return[];const l=r.resolve(n.pos),c=r.resolve(n.pos+1);return Kv(l,c,0)}const Jx=(t,e)=>{const r=t.resolve(e),{depth:n}=r;return n===0?e:r.pos-r.parentOffset-1},Yx=(t,e)=>{const r=t.nodeAt(e),n=t.resolve(e);let{depth:i}=n,o=r;for(;i>0;){const s=n.node(i);i-=1,i===0&&(o=s)}return o},Gh=(t,e)=>{const r=bY.getState(t);return r?xY(e,r.type,r.binding.mapping):null},Zx=(t,e)=>{let r=e;for(;r&&r.parentNode&&r.parentNode!==t.dom;)r=r.parentNode;return r},QR=new et("dragHandle"),CY=({pluginKey:t=QR,element:e,editor:r,tippyOptions:n,onNodeChange:i})=>{const o=document.createElement("div");let s=null,a=!1,l=null,c=-1;return e.addEventListener("dragstart",u=>{const{view:f}=r;if(!u.dataTransfer)return;const{empty:d,$from:h,$to:p}=f.state.selection,m=AY(u,r),y=Kv(h,p,0),g=y.some(A=>m.find(V=>V.$from===A.$from&&V.$to===A.$to)),b=d||!g?m:y;if(!b.length)return;const{tr:S}=f.state,x=document.createElement("div"),O=b[0].$from.pos,M=b[b.length-1].$to.pos,D=Pr.create(f.state.doc,O,M),$=D.content();b.forEach(A=>{const V=EY(f.nodeDOM(A.$from.pos));x.append(V)}),x.style.position="absolute",x.style.top="-10000px",document.body.append(x),u.dataTransfer.clearData(),u.dataTransfer.setDragImage(x,0,0),f.dragging={slice:$,move:!0},S.setSelection(D),f.dispatch(S),document.addEventListener("drop",()=>Xx(x),{once:!0}),setTimeout(()=>{e&&(e.style.pointerEvents="none")},0)}),e.addEventListener("dragend",()=>{e&&(e.style.pointerEvents="auto")}),new tt({key:typeof t=="string"?new et(t):t,state:{init:()=>({locked:!1}),apply(u,f,d,h){const p=u.getMeta("lockDragHandle"),m=u.getMeta("hideDragHandle");if(p!==void 0&&(a=p),m&&s)return s.hide(),a=!1,l=null,c=-1,i==null||i({editor:r,node:null,pos:-1}),f;if(u.docChanged&&c!==-1&&e&&s){const y=u.mapping.map(c);y!==c&&(c=y,Gh(h,c))}return f}},view:u=>{var f;return e.draggable=!0,e.style.pointerEvents="auto",(f=r.view.dom.parentElement)===null||f===void 0||f.appendChild(o),o.appendChild(e),o.style.pointerEvents="none",o.style.position="absolute",o.style.top="0",o.style.left="0",s=fo(u.dom,{getReferenceClientRect:null,interactive:!0,trigger:"manual",placement:"left-start",hideOnClick:!1,duration:100,zIndex:10,popperOptions:{modifiers:[{name:"flip",enabled:!1},{name:"preventOverflow",options:{rootBoundary:"document",mainAxis:!1}}]},...n,appendTo:o,content:e}),{update(d,h){if(!e||!s||(e.draggable=!a,u.state.doc.eq(h.doc)||c===-1))return;let p=u.nodeDOM(c);if(p=Zx(u,p),p===u.dom||(p==null?void 0:p.nodeType)!==1)return;const m=u.posAtDOM(p,0),y=Yx(r.state.doc,m);if(y!==l){const g=Jx(r.state.doc,m);l=y,c=g,Gh(u.state,c),i==null||i({editor:r,node:l,pos:c}),s.setProps({getReferenceClientRect:()=>p.getBoundingClientRect()}),s.show()}},destroy(){s==null||s.destroy(),e&&Xx(o)}}},props:{handleDOMEvents:{mouseleave:(u,f)=>(a||f.target&&!o.contains(f.relatedTarget)&&(s==null||s.hide(),l=null,c=-1,i==null||i({editor:r,node:null,pos:-1})),!1),mousemove(u,f){if(!e||!s||a)return!1;const d=ZR({x:f.clientX,y:f.clientY,direction:"right",editor:r});if(!d.resultElement)return!1;let h=d.resultElement;if(h=Zx(u,h),h===u.dom||(h==null?void 0:h.nodeType)!==1)return!1;const p=u.posAtDOM(h,0),m=Yx(r.state.doc,p);if(m!==l){const y=Jx(r.state.doc,p);l=m,c=y,Gh(u.state,c),i==null||i({editor:r,node:l,pos:c}),s.setProps({getReferenceClientRect:()=>h.getBoundingClientRect()}),s.show()}return!1}}}})},kY=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))$/,_Y=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))/g,OY=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))$/,RY=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))/g,MY=Nt.create({name:"italic",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"em"},{tag:"i",getAttrs:t=>t.style.fontStyle!=="normal"&&null},{style:"font-style=italic"}]},renderHTML({HTMLAttributes:t}){return["em",Be(this.options.HTMLAttributes,t),0]},addCommands(){return{setItalic:()=>({commands:t})=>t.setMark(this.name),toggleItalic:()=>({commands:t})=>t.toggleMark(this.name),unsetItalic:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-i":()=>this.editor.commands.toggleItalic(),"Mod-I":()=>this.editor.commands.toggleItalic()}},addInputRules(){return[to({find:kY,type:this.type}),to({find:OY,type:this.type})]},addPasteRules(){return[di({find:_Y,type:this.type}),di({find:RY,type:this.type})]}}),IY=Nt.create({name:"underline",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"u"},{style:"text-decoration",consuming:!1,getAttrs:t=>t.includes("underline")?{}:!1}]},renderHTML({HTMLAttributes:t}){return["u",Be(this.options.HTMLAttributes,t),0]},addCommands(){return{setUnderline:()=>({commands:t})=>t.setMark(this.name),toggleUnderline:()=>({commands:t})=>t.toggleMark(this.name),unsetUnderline:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-u":()=>this.editor.commands.toggleUnderline(),"Mod-U":()=>this.editor.commands.toggleUnderline()}}}),NY=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))$/,DY=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))/g,PY=Nt.create({name:"strike",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"s"},{tag:"del"},{tag:"strike"},{style:"text-decoration",consuming:!1,getAttrs:t=>t.includes("line-through")?{}:!1}]},renderHTML({HTMLAttributes:t}){return["s",Be(this.options.HTMLAttributes,t),0]},addCommands(){return{setStrike:()=>({commands:t})=>t.setMark(this.name),toggleStrike:()=>({commands:t})=>t.toggleMark(this.name),unsetStrike:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-s":()=>this.editor.commands.toggleStrike()}},addInputRules(){return[to({find:NY,type:this.type})]},addPasteRules(){return[di({find:DY,type:this.type})]}}),LY=/(?:^|\s)(`(?!\s+`)((?:[^`]+))`(?!\s+`))$/,FY=/(?:^|\s)(`(?!\s+`)((?:[^`]+))`(?!\s+`))/g,BY=Nt.create({name:"code",addOptions(){return{HTMLAttributes:{}}},excludes:"_",code:!0,exitable:!0,parseHTML(){return[{tag:"code"}]},renderHTML({HTMLAttributes:t}){return["code",Be(this.options.HTMLAttributes,t),0]},addCommands(){return{setCode:()=>({commands:t})=>t.setMark(this.name),toggleCode:()=>({commands:t})=>t.toggleMark(this.name),unsetCode:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-e":()=>this.editor.commands.toggleCode()}},addInputRules(){return[to({find:LY,type:this.type})]},addPasteRules(){return[di({find:FY,type:this.type})]}}),$Y=/^```([a-z]+)?[\s\n]$/,jY=/^~~~([a-z]+)?[\s\n]$/,HY=ct.create({name:"codeBlock",addOptions(){return{languageClassPrefix:"language-",exitOnTripleEnter:!0,exitOnArrowDown:!0,defaultLanguage:null,HTMLAttributes:{}}},content:"text*",marks:"",group:"block",code:!0,defining:!0,addAttributes(){return{language:{default:this.options.defaultLanguage,parseHTML:t=>{var e;const{languageClassPrefix:r}=this.options,o=[...((e=t.firstElementChild)===null||e===void 0?void 0:e.classList)||[]].filter(s=>s.startsWith(r)).map(s=>s.replace(r,""))[0];return o||null},rendered:!1}}},parseHTML(){return[{tag:"pre",preserveWhitespace:"full"}]},renderHTML({node:t,HTMLAttributes:e}){return["pre",Be(this.options.HTMLAttributes,e),["code",{class:t.attrs.language?this.options.languageClassPrefix+t.attrs.language:null},0]]},addCommands(){return{setCodeBlock:t=>({commands:e})=>e.setNode(this.name,t),toggleCodeBlock:t=>({commands:e})=>e.toggleNode(this.name,"paragraph",t)}},addKeyboardShortcuts(){return{"Mod-Alt-c":()=>this.editor.commands.toggleCodeBlock(),Backspace:()=>{const{empty:t,$anchor:e}=this.editor.state.selection,r=e.pos===1;return!t||e.parent.type.name!==this.name?!1:r||!e.parent.textContent.length?this.editor.commands.clearNodes():!1},Enter:({editor:t})=>{if(!this.options.exitOnTripleEnter)return!1;const{state:e}=t,{selection:r}=e,{$from:n,empty:i}=r;if(!i||n.parent.type!==this.type)return!1;const o=n.parentOffset===n.parent.nodeSize-2,s=n.parent.textContent.endsWith(`
558
-
559
- `);return!o||!s?!1:t.chain().command(({tr:a})=>(a.delete(n.pos-2,n.pos),!0)).exitCode().run()},ArrowDown:({editor:t})=>{if(!this.options.exitOnArrowDown)return!1;const{state:e}=t,{selection:r,doc:n}=e,{$from:i,empty:o}=r;if(!o||i.parent.type!==this.type||!(i.parentOffset===i.parent.nodeSize-2))return!1;const a=i.after();return a===void 0?!1:n.nodeAt(a)?t.commands.command(({tr:c})=>(c.setSelection(Re.near(n.resolve(a))),!0)):t.commands.exitCode()}}},addInputRules(){return[gm({find:$Y,type:this.type,getAttributes:t=>({language:t[1]})}),gm({find:jY,type:this.type,getAttributes:t=>({language:t[1]})})]},addProseMirrorPlugins(){return[new tt({key:new et("codeBlockVSCodeHandler"),props:{handlePaste:(t,e)=>{if(!e.clipboardData||this.editor.isActive(this.type.name))return!1;const r=e.clipboardData.getData("text/plain"),n=e.clipboardData.getData("vscode-editor-data"),i=n?JSON.parse(n):void 0,o=i==null?void 0:i.mode;if(!r||!o)return!1;const{tr:s,schema:a}=t.state,l=a.text(r.replace(/\r\n?/g,`
560
- `));return s.replaceSelectionWith(this.type.create({language:o},l)),s.selection.$from.parent.type!==this.type&&s.setSelection(_e.near(s.doc.resolve(Math.max(0,s.selection.from-2)))),s.setMeta("paste",!0),t.dispatch(s),!0}}})]}}),zY=Nt.create({name:"textStyle",priority:101,addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"span",getAttrs:t=>t.hasAttribute("style")?{}:!1}]},renderHTML({HTMLAttributes:t}){return["span",Be(this.options.HTMLAttributes,t),0]},addCommands(){return{removeEmptyTextStyle:()=>({state:t,commands:e})=>{const r=fl(t,this.type);return Object.entries(r).some(([,i])=>!!i)?!0:e.unsetMark(this.name)}}}}),UY=dt.create({name:"fontFamily",addOptions(){return{types:["textStyle"]}},addGlobalAttributes(){return[{types:this.options.types,attributes:{fontFamily:{default:null,parseHTML:t=>{var e;return(e=t.style.fontFamily)===null||e===void 0?void 0:e.replace(/['"]+/g,"")},renderHTML:t=>t.fontFamily?{style:`font-family: ${t.fontFamily}`}:{}}}}]},addCommands(){return{setFontFamily:t=>({chain:e})=>e().setMark("textStyle",{fontFamily:t}).run(),unsetFontFamily:()=>({chain:t})=>t().setMark("textStyle",{fontFamily:null}).removeEmptyTextStyle().run()}}}),WY=ct.create({name:"heading",addOptions(){return{levels:[1,2,3,4,5,6],HTMLAttributes:{}}},content:"inline*",group:"block",defining:!0,addAttributes(){return{level:{default:1,rendered:!1}}},parseHTML(){return this.options.levels.map(t=>({tag:`h${t}`,attrs:{level:t}}))},renderHTML({node:t,HTMLAttributes:e}){return[`h${this.options.levels.includes(t.attrs.level)?t.attrs.level:this.options.levels[0]}`,Be(this.options.HTMLAttributes,e),0]},addCommands(){return{setHeading:t=>({commands:e})=>this.options.levels.includes(t.level)?e.setNode(this.name,t):!1,toggleHeading:t=>({commands:e})=>this.options.levels.includes(t.level)?e.toggleNode(this.name,"paragraph",t):!1}},addKeyboardShortcuts(){return this.options.levels.reduce((t,e)=>({...t,[`Mod-Alt-${e}`]:()=>this.editor.commands.toggleHeading({level:e})}),{})},addInputRules(){return this.options.levels.map(t=>gm({find:new RegExp(`^(#{1,${t}})\\s$`),type:this.type,getAttributes:{level:t}}))}}),VY=dt.create({name:"textAlign",addOptions(){return{types:[],alignments:["left","center","right","justify"],defaultAlignment:"left"}},addGlobalAttributes(){return[{types:this.options.types,attributes:{textAlign:{default:this.options.defaultAlignment,parseHTML:t=>{const e=t.style.textAlign||this.options.defaultAlignment;return this.options.alignments.includes(e)?e:this.options.defaultAlignment},renderHTML:t=>t.textAlign===this.options.defaultAlignment?{}:{style:`text-align: ${t.textAlign}`}}}}]},addCommands(){return{setTextAlign:t=>({commands:e})=>this.options.alignments.includes(t)?this.options.types.map(r=>e.updateAttributes(r,{textAlign:t})).every(r=>r):!1,unsetTextAlign:()=>({commands:t})=>this.options.types.map(e=>t.resetAttributes(e,"textAlign")).every(e=>e)}},addKeyboardShortcuts(){return{"Mod-Shift-l":()=>this.editor.commands.setTextAlign("left"),"Mod-Shift-e":()=>this.editor.commands.setTextAlign("center"),"Mod-Shift-r":()=>this.editor.commands.setTextAlign("right"),"Mod-Shift-j":()=>this.editor.commands.setTextAlign("justify")}}}),GY=dt.create({name:"color",addOptions(){return{types:["textStyle"]}},addGlobalAttributes(){return[{types:this.options.types,attributes:{color:{default:null,parseHTML:t=>{var e;return(e=t.style.color)===null||e===void 0?void 0:e.replace(/['"]+/g,"")},renderHTML:t=>t.color?{style:`color: ${t.color}`}:{}}}}]},addCommands(){return{setColor:t=>({chain:e})=>e().setMark("textStyle",{color:t}).run(),unsetColor:()=>({chain:t})=>t().setMark("textStyle",{color:null}).removeEmptyTextStyle().run()}}}),KY=/(?:^|\s)(==(?!\s+==)((?:[^=]+))==(?!\s+==))$/,qY=/(?:^|\s)(==(?!\s+==)((?:[^=]+))==(?!\s+==))/g,XY=Nt.create({name:"highlight",addOptions(){return{multicolor:!1,HTMLAttributes:{}}},addAttributes(){return this.options.multicolor?{color:{default:null,parseHTML:t=>t.getAttribute("data-color")||t.style.backgroundColor,renderHTML:t=>t.color?{"data-color":t.color,style:`background-color: ${t.color}; color: inherit`}:{}}}:{}},parseHTML(){return[{tag:"mark"}]},renderHTML({HTMLAttributes:t}){return["mark",Be(this.options.HTMLAttributes,t),0]},addCommands(){return{setHighlight:t=>({commands:e})=>e.setMark(this.name,t),toggleHighlight:t=>({commands:e})=>e.toggleMark(this.name,t),unsetHighlight:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-h":()=>this.editor.commands.toggleHighlight()}},addInputRules(){return[to({find:KY,type:this.type})]},addPasteRules(){return[di({find:qY,type:this.type})]}}),JY=ct.create({name:"listItem",addOptions(){return{HTMLAttributes:{},bulletListTypeName:"bulletList",orderedListTypeName:"orderedList"}},content:"paragraph block*",defining:!0,parseHTML(){return[{tag:"li"}]},renderHTML({HTMLAttributes:t}){return["li",Be(this.options.HTMLAttributes,t),0]},addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem(this.name),Tab:()=>this.editor.commands.sinkListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)}}}),Qx=Nt.create({name:"textStyle",priority:101,addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"span",getAttrs:t=>t.hasAttribute("style")?{}:!1}]},renderHTML({HTMLAttributes:t}){return["span",Be(this.options.HTMLAttributes,t),0]},addCommands(){return{removeEmptyTextStyle:()=>({state:t,commands:e})=>{const r=fl(t,this.type);return Object.entries(r).some(([,i])=>!!i)?!0:e.unsetMark(this.name)}}}}),eS=/^\s*([-+*])\s$/,YY=ct.create({name:"bulletList",addOptions(){return{itemTypeName:"listItem",HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}},group:"block list",content(){return`${this.options.itemTypeName}+`},parseHTML(){return[{tag:"ul"}]},renderHTML({HTMLAttributes:t}){return["ul",Be(this.options.HTMLAttributes,t),0]},addCommands(){return{toggleBulletList:()=>({commands:t,chain:e})=>this.options.keepAttributes?e().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(JY.name,this.editor.getAttributes(Qx.name)).run():t.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-8":()=>this.editor.commands.toggleBulletList()}},addInputRules(){let t=ls({find:eS,type:this.type});return(this.options.keepMarks||this.options.keepAttributes)&&(t=ls({find:eS,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:()=>this.editor.getAttributes(Qx.name),editor:this.editor})),[t]}}),ZY=ct.create({name:"listItem",addOptions(){return{HTMLAttributes:{},bulletListTypeName:"bulletList",orderedListTypeName:"orderedList"}},content:"paragraph block*",defining:!0,parseHTML(){return[{tag:"li"}]},renderHTML({HTMLAttributes:t}){return["li",Be(this.options.HTMLAttributes,t),0]},addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem(this.name),Tab:()=>this.editor.commands.sinkListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)}}}),tS=Nt.create({name:"textStyle",priority:101,addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"span",getAttrs:t=>t.hasAttribute("style")?{}:!1}]},renderHTML({HTMLAttributes:t}){return["span",Be(this.options.HTMLAttributes,t),0]},addCommands(){return{removeEmptyTextStyle:()=>({state:t,commands:e})=>{const r=fl(t,this.type);return Object.entries(r).some(([,i])=>!!i)?!0:e.unsetMark(this.name)}}}}),rS=/^(\d+)\.\s$/,QY=ct.create({name:"orderedList",addOptions(){return{itemTypeName:"listItem",HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}},group:"block list",content(){return`${this.options.itemTypeName}+`},addAttributes(){return{start:{default:1,parseHTML:t=>t.hasAttribute("start")?parseInt(t.getAttribute("start")||"",10):1},type:{default:void 0,parseHTML:t=>t.getAttribute("type")}}},parseHTML(){return[{tag:"ol"}]},renderHTML({HTMLAttributes:t}){const{start:e,...r}=t;return e===1?["ol",Be(this.options.HTMLAttributes,r),0]:["ol",Be(this.options.HTMLAttributes,t),0]},addCommands(){return{toggleOrderedList:()=>({commands:t,chain:e})=>this.options.keepAttributes?e().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(ZY.name,this.editor.getAttributes(tS.name)).run():t.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-7":()=>this.editor.commands.toggleOrderedList()}},addInputRules(){let t=ls({find:rS,type:this.type,getAttributes:e=>({start:+e[1]}),joinPredicate:(e,r)=>r.childCount+r.attrs.start===+e[1]});return(this.options.keepMarks||this.options.keepAttributes)&&(t=ls({find:rS,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:e=>({start:+e[1],...this.editor.getAttributes(tS.name)}),joinPredicate:(e,r)=>r.childCount+r.attrs.start===+e[1],editor:this.editor})),[t]}}),eZ=/^\s*(\[([( |x])?\])\s$/,tZ=ct.create({name:"taskItem",addOptions(){return{nested:!1,HTMLAttributes:{},taskListTypeName:"taskList"}},content(){return this.options.nested?"paragraph block*":"paragraph+"},defining:!0,addAttributes(){return{checked:{default:!1,keepOnSplit:!1,parseHTML:t=>{const e=t.getAttribute("data-checked");return e===""||e==="true"},renderHTML:t=>({"data-checked":t.checked})}}},parseHTML(){return[{tag:`li[data-type="${this.name}"]`,priority:51}]},renderHTML({node:t,HTMLAttributes:e}){return["li",Be(this.options.HTMLAttributes,e,{"data-type":this.name}),["label",["input",{type:"checkbox",checked:t.attrs.checked?"checked":null}],["span"]],["div",0]]},addKeyboardShortcuts(){const t={Enter:()=>this.editor.commands.splitListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)};return this.options.nested?{...t,Tab:()=>this.editor.commands.sinkListItem(this.name)}:t},addNodeView(){return({node:t,HTMLAttributes:e,getPos:r,editor:n})=>{const i=document.createElement("li"),o=document.createElement("label"),s=document.createElement("span"),a=document.createElement("input"),l=document.createElement("div");return o.contentEditable="false",a.type="checkbox",a.addEventListener("change",c=>{if(!n.isEditable&&!this.options.onReadOnlyChecked){a.checked=!a.checked;return}const{checked:u}=c.target;n.isEditable&&typeof r=="function"&&n.chain().focus(void 0,{scrollIntoView:!1}).command(({tr:f})=>{const d=r(),h=f.doc.nodeAt(d);return f.setNodeMarkup(d,void 0,{...h==null?void 0:h.attrs,checked:u}),!0}).run(),!n.isEditable&&this.options.onReadOnlyChecked&&(this.options.onReadOnlyChecked(t,u)||(a.checked=!a.checked))}),Object.entries(this.options.HTMLAttributes).forEach(([c,u])=>{i.setAttribute(c,u)}),i.dataset.checked=t.attrs.checked,t.attrs.checked&&a.setAttribute("checked","checked"),o.append(a,s),i.append(o,l),Object.entries(e).forEach(([c,u])=>{i.setAttribute(c,u)}),{dom:i,contentDOM:l,update:c=>c.type!==this.type?!1:(i.dataset.checked=c.attrs.checked,c.attrs.checked?a.setAttribute("checked","checked"):a.removeAttribute("checked"),!0)}}},addInputRules(){return[ls({find:eZ,type:this.type,getAttributes:t=>({checked:t[t.length-1]==="x"})})]}}),rZ=ct.create({name:"taskList",addOptions(){return{itemTypeName:"taskItem",HTMLAttributes:{}}},group:"block list",content(){return`${this.options.itemTypeName}+`},parseHTML(){return[{tag:`ul[data-type="${this.name}"]`,priority:51}]},renderHTML({HTMLAttributes:t}){return["ul",Be(this.options.HTMLAttributes,t,{"data-type":this.name}),0]},addCommands(){return{toggleTaskList:()=>({commands:t})=>t.toggleList(this.name,this.options.itemTypeName)}},addKeyboardShortcuts(){return{"Mod-Shift-9":()=>this.editor.commands.toggleTaskList()}}}),nZ=/^\s*>\s$/,iZ=ct.create({name:"blockquote",addOptions(){return{HTMLAttributes:{}}},content:"block+",group:"block",defining:!0,parseHTML(){return[{tag:"blockquote"}]},renderHTML({HTMLAttributes:t}){return["blockquote",Be(this.options.HTMLAttributes,t),0]},addCommands(){return{setBlockquote:()=>({commands:t})=>t.wrapIn(this.name),toggleBlockquote:()=>({commands:t})=>t.toggleWrap(this.name),unsetBlockquote:()=>({commands:t})=>t.lift(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-b":()=>this.editor.commands.toggleBlockquote()}},addInputRules(){return[ls({find:nZ,type:this.type})]}}),oZ="aaa1rp3bb0ott3vie4c1le2ogado5udhabi7c0ademy5centure6ountant0s9o1tor4d0s1ult4e0g1ro2tna4f0l1rica5g0akhan5ency5i0g1rbus3force5tel5kdn3l0ibaba4pay4lfinanz6state5y2sace3tom5m0azon4ericanexpress7family11x2fam3ica3sterdam8nalytics7droid5quan4z2o0l2partments8p0le4q0uarelle8r0ab1mco4chi3my2pa2t0e3s0da2ia2sociates9t0hleta5torney7u0ction5di0ble3o3spost5thor3o0s4vianca6w0s2x0a2z0ure5ba0by2idu3namex3narepublic11d1k2r0celona5laycard4s5efoot5gains6seball5ketball8uhaus5yern5b0c1t1va3cg1n2d1e0ats2uty4er2ntley5rlin4st0buy5t2f1g1h0arti5i0ble3d1ke2ng0o3o1z2j1lack0friday9ockbuster8g1omberg7ue3m0s1w2n0pparibas9o0ats3ehringer8fa2m1nd2o0k0ing5sch2tik2on4t1utique6x2r0adesco6idgestone9oadway5ker3ther5ussels7s1t1uild0ers6siness6y1zz3v1w1y1z0h3ca0b1fe2l0l1vinklein9m0era3p2non3petown5ital0one8r0avan4ds2e0er0s4s2sa1e1h1ino4t0ering5holic7ba1n1re3c1d1enter4o1rn3f0a1d2g1h0anel2nel4rity4se2t2eap3intai5ristmas6ome4urch5i0priani6rcle4sco3tadel4i0c2y3k1l0aims4eaning6ick2nic1que6othing5ud3ub0med6m1n1o0ach3des3ffee4llege4ogne5m0cast4mbank4unity6pany2re3uter5sec4ndos3struction8ulting7tact3ractors9oking4l1p2rsica5untry4pon0s4rses6pa2r0edit0card4union9icket5own3s1uise0s6u0isinella9v1w1x1y0mru3ou3z2dabur3d1nce3ta1e1ing3sun4y2clk3ds2e0al0er2s3gree4livery5l1oitte5ta3mocrat6ntal2ist5si0gn4v2hl2iamonds6et2gital5rect0ory7scount3ver5h2y2j1k1m1np2o0cs1tor4g1mains5t1wnload7rive4tv2ubai3nlop4pont4rban5vag2r2z2earth3t2c0o2deka3u0cation8e1g1mail3erck5nergy4gineer0ing9terprises10pson4quipment8r0icsson6ni3s0q1tate5t1u0rovision8s2vents5xchange6pert3osed4ress5traspace10fage2il1rwinds6th3mily4n0s2rm0ers5shion4t3edex3edback6rrari3ero6i0delity5o2lm2nal1nce1ial7re0stone6mdale6sh0ing5t0ness6j1k1lickr3ghts4r2orist4wers5y2m1o0o0d1tball6rd1ex2sale4um3undation8x2r0ee1senius7l1ogans4ntier7tr2ujitsu5n0d2rniture7tbol5yi3ga0l0lery3o1up4me0s3p1rden4y2b0iz3d0n2e0a1nt0ing5orge5f1g0ee3h1i0ft0s3ves2ing5l0ass3e1obal2o4m0ail3bh2o1x2n1odaddy5ld0point6f2o0dyear5g0le4p1t1v2p1q1r0ainger5phics5tis4een3ipe3ocery4up4s1t1u0ardian6cci3ge2ide2tars5ru3w1y2hair2mburg5ngout5us3bo2dfc0bank7ealth0care8lp1sinki6re1mes5iphop4samitsu7tachi5v2k0t2m1n1ockey4ldings5iday5medepot5goods5s0ense7nda3rse3spital5t0ing5t0els3mail5use3w2r1sbc3t1u0ghes5yatt3undai7ibm2cbc2e1u2d1e0ee3fm2kano4l1m0amat4db2mo0bilien9n0c1dustries8finiti5o2g1k1stitute6urance4e4t0ernational10uit4vestments10o1piranga7q1r0ish4s0maili5t0anbul7t0au2v3jaguar4va3cb2e0ep2tzt3welry6io2ll2m0p2nj2o0bs1urg4t1y2p0morgan6rs3uegos4niper7kaufen5ddi3e0rryhotels6logistics9properties14fh2g1h1i0a1ds2m1ndle4tchen5wi3m1n1oeln3matsu5sher5p0mg2n2r0d1ed3uokgroup8w1y0oto4z2la0caixa5mborghini8er3ncaster6d0rover6xess5salle5t0ino3robe5w0yer5b1c1ds2ease3clerc5frak4gal2o2xus4gbt3i0dl2fe0insurance9style7ghting6ke2lly3mited4o2ncoln4k2psy3ve1ing5k1lc1p2oan0s3cker3us3l1ndon4tte1o3ve3pl0financial11r1s1t0d0a3u0ndbeck6xe1ury5v1y2ma0drid4if1son4keup4n0agement7go3p1rket0ing3s4riott5shalls7ttel5ba2c0kinsey7d1e0d0ia3et2lbourne7me1orial6n0u2rckmsd7g1h1iami3crosoft7l1ni1t2t0subishi9k1l0b1s2m0a2n1o0bi0le4da2e1i1m1nash3ey2ster5rmon3tgage6scow4to0rcycles9v0ie4p1q1r1s0d2t0n1r2u0seum3ic4v1w1x1y1z2na0b1goya4me2tura4vy3ba2c1e0c1t0bank4flix4work5ustar5w0s2xt0direct7us4f0l2g0o2hk2i0co2ke1on3nja3ssan1y5l1o0kia3rton4w0ruz3tv4p1r0a1w2tt2u1yc2z2obi1server7ffice5kinawa6layan0group9dnavy5lo3m0ega4ne1g1l0ine5oo2pen3racle3nge4g0anic5igins6saka4tsuka4t2vh3pa0ge2nasonic7ris2s1tners4s1y3y2ccw3e0t2f0izer5g1h0armacy6d1ilips5one2to0graphy6s4ysio5ics1tet2ures6d1n0g1k2oneer5zza4k1l0ace2y0station9umbing5s3m1n0c2ohl2ker3litie5rn2st3r0america6xi3ess3ime3o0d0uctions8f1gressive8mo2perties3y5tection8u0dential9s1t1ub2w0c2y2qa1pon3uebec3st5racing4dio4e0ad1lestate6tor2y4cipes5d0stone5umbrella9hab3ise0n3t2liance6n0t0als5pair3ort3ublican8st0aurant8view0s5xroth6ich0ardli6oh3l1o1p2o0cks3deo3gers4om3s0vp3u0gby3hr2n2w0e2yukyu6sa0arland6fe0ty4kura4le1on3msclub4ung5ndvik0coromant12ofi4p1rl2s1ve2xo3b0i1s2c0a1b1haeffler7midt4olarships8ol3ule3warz5ience5ot3d1e0arch3t2cure1ity6ek2lect4ner3rvices6ven3w1x0y3fr2g1h0angrila6rp2w2ell3ia1ksha5oes2p0ping5uji3w3i0lk2na1gles5te3j1k0i0n2y0pe4l0ing4m0art3ile4n0cf3o0ccer3ial4ftbank4ware6hu2lar2utions7ng1y2y2pa0ce3ort2t3r0l2s1t0ada2ples4r1tebank4farm7c0group6ockholm6rage3e3ream4udio2y3yle4u0cks3pplies3y2ort5rf1gery5zuki5v1watch4iss4x1y0dney4stems6z2tab1ipei4lk2obao4rget4tamotors6r2too4x0i3c0i2d0k2eam2ch0nology8l1masek5nnis4va3f1g1h0d1eater2re6iaa2ckets5enda4ps2res2ol4j0maxx4x2k0maxx5l1m0all4n1o0day3kyo3ols3p1ray3shiba5tal3urs3wn2yota3s3r0ade1ing4ining5vel0ers0insurance16ust3v2t1ube2i1nes3shu4v0s2w1z2ua1bank3s2g1k1nicom3versity8o2ol2ps2s1y1z2va0cations7na1guard7c1e0gas3ntures6risign5mögensberater2ung14sicherung10t2g1i0ajes4deo3g1king4llas4n1p1rgin4sa1ion4va1o3laanderen9n1odka3lvo3te1ing3o2yage5u2wales2mart4ter4ng0gou5tch0es6eather0channel12bcam3er2site5d0ding5ibo2r3f1hoswho6ien2ki2lliamhill9n0dows4e1ners6me2olterskluwer11odside6rk0s2ld3w2s1tc1f3xbox3erox4finity6ihuan4n2xx2yz3yachts4hoo3maxun5ndex5e1odobashi7ga2kohama6u0tube6t1un3za0ppos4ra3ero3ip2m1one3uerich6w2",sZ="ελ1υ2бг1ел3дети4ею2католик6ом3мкд2он1сква6онлайн5рг3рус2ф2сайт3рб3укр3қаз3հայ3ישראל5קום3ابوظبي5رامكو5لاردن4بحرين5جزائر5سعودية6عليان5مغرب5مارات5یران5بارت2زار4يتك3ھارت5تونس4سودان3رية5شبكة4عراق2ب2مان4فلسطين6قطر3كاثوليك6وم3مصر2ليسيا5وريتانيا7قع4همراه5پاکستان7ڀارت4कॉम3नेट3भारत0म्3ोत5संगठन5বাংলা5ভারত2ৰত4ਭਾਰਤ4ભારત4ଭାରତ4இந்தியா6லங்கை6சிங்கப்பூர்11భారత్5ಭಾರತ4ഭാരതം5ලංකා4คอม3ไทย3ລາວ3გე2みんな3アマゾン4クラウド4グーグル4コム2ストア3セール3ファッション6ポイント4世界2中信1国1國1文网3亚马逊3企业2佛山2信息2健康2八卦2公司1益2台湾1灣2商城1店1标2嘉里0大酒店5在线2大拿2天主教3娱乐2家電2广东2微博2慈善2我爱你3手机2招聘2政务1府2新加坡2闻2时尚2書籍2机构2淡马锡3游戏2澳門2点看2移动2组织机构4网址1店1站1络2联通2谷歌2购物2通販2集团2電訊盈科4飞利浦3食品2餐厅2香格里拉3港2닷넷1컴2삼성2한국2",Ts=(t,e)=>{for(const r in e)t[r]=e[r];return t},Ig="numeric",Ng="ascii",Dg="alpha",Bc="asciinumeric",ec="alphanumeric",Pg="domain",eM="emoji",aZ="scheme",lZ="slashscheme",nS="whitespace";function cZ(t,e){return t in e||(e[t]=[]),e[t]}function ji(t,e,r){e[Ig]&&(e[Bc]=!0,e[ec]=!0),e[Ng]&&(e[Bc]=!0,e[Dg]=!0),e[Bc]&&(e[ec]=!0),e[Dg]&&(e[ec]=!0),e[ec]&&(e[Pg]=!0),e[eM]&&(e[Pg]=!0);for(const n in e){const i=cZ(n,r);i.indexOf(t)<0&&i.push(t)}}function uZ(t,e){const r={};for(const n in e)e[n].indexOf(t)>=0&&(r[n]=!0);return r}function Gt(t){t===void 0&&(t=null),this.j={},this.jr=[],this.jd=null,this.t=t}Gt.groups={};Gt.prototype={accepts(){return!!this.t},go(t){const e=this,r=e.j[t];if(r)return r;for(let n=0;n<e.jr.length;n++){const i=e.jr[n][0],o=e.jr[n][1];if(o&&i.test(t))return o}return e.jd},has(t,e){return e===void 0&&(e=!1),e?t in this.j:!!this.go(t)},ta(t,e,r,n){for(let i=0;i<t.length;i++)this.tt(t[i],e,r,n)},tr(t,e,r,n){n=n||Gt.groups;let i;return e&&e.j?i=e:(i=new Gt(e),r&&n&&ji(e,r,n)),this.jr.push([t,i]),i},ts(t,e,r,n){let i=this;const o=t.length;if(!o)return i;for(let s=0;s<o-1;s++)i=i.tt(t[s]);return i.tt(t[o-1],e,r,n)},tt(t,e,r,n){n=n||Gt.groups;const i=this;if(e&&e.j)return i.j[t]=e,e;const o=e;let s,a=i.go(t);if(a?(s=new Gt,Ts(s.j,a.j),s.jr.push.apply(s.jr,a.jr),s.jd=a.jd,s.t=a.t):s=new Gt,o){if(n)if(s.t&&typeof s.t=="string"){const l=Ts(uZ(s.t,n),r);ji(o,l,n)}else r&&ji(o,r,n);s.t=o}return i.j[t]=s,s}};const Ne=(t,e,r,n,i)=>t.ta(e,r,n,i),lr=(t,e,r,n,i)=>t.tr(e,r,n,i),iS=(t,e,r,n,i)=>t.ts(e,r,n,i),ye=(t,e,r,n,i)=>t.tt(e,r,n,i),hn="WORD",Lg="UWORD",ol="LOCALHOST",Fg="TLD",Bg="UTLD",$c="SCHEME",jo="SLASH_SCHEME",Xv="NUM",tM="WS",Jv="NL",Ca="OPENBRACE",ka="CLOSEBRACE",Fu="OPENBRACKET",Bu="CLOSEBRACKET",$u="OPENPAREN",ju="CLOSEPAREN",Hu="OPENANGLEBRACKET",zu="CLOSEANGLEBRACKET",Uu="FULLWIDTHLEFTPAREN",Wu="FULLWIDTHRIGHTPAREN",Vu="LEFTCORNERBRACKET",Gu="RIGHTCORNERBRACKET",Ku="LEFTWHITECORNERBRACKET",qu="RIGHTWHITECORNERBRACKET",Xu="FULLWIDTHLESSTHAN",Ju="FULLWIDTHGREATERTHAN",Yu="AMPERSAND",Zu="APOSTROPHE",Qu="ASTERISK",Xn="AT",ef="BACKSLASH",tf="BACKTICK",rf="CARET",Qn="COLON",Yv="COMMA",nf="DOLLAR",Ir="DOT",of="EQUALS",Zv="EXCLAMATION",Nr="HYPHEN",sf="PERCENT",af="PIPE",lf="PLUS",cf="POUND",uf="QUERY",Qv="QUOTE",ew="SEMI",Dr="SLASH",_a="TILDE",ff="UNDERSCORE",rM="EMOJI",df="SYM";var nM=Object.freeze({__proto__:null,WORD:hn,UWORD:Lg,LOCALHOST:ol,TLD:Fg,UTLD:Bg,SCHEME:$c,SLASH_SCHEME:jo,NUM:Xv,WS:tM,NL:Jv,OPENBRACE:Ca,CLOSEBRACE:ka,OPENBRACKET:Fu,CLOSEBRACKET:Bu,OPENPAREN:$u,CLOSEPAREN:ju,OPENANGLEBRACKET:Hu,CLOSEANGLEBRACKET:zu,FULLWIDTHLEFTPAREN:Uu,FULLWIDTHRIGHTPAREN:Wu,LEFTCORNERBRACKET:Vu,RIGHTCORNERBRACKET:Gu,LEFTWHITECORNERBRACKET:Ku,RIGHTWHITECORNERBRACKET:qu,FULLWIDTHLESSTHAN:Xu,FULLWIDTHGREATERTHAN:Ju,AMPERSAND:Yu,APOSTROPHE:Zu,ASTERISK:Qu,AT:Xn,BACKSLASH:ef,BACKTICK:tf,CARET:rf,COLON:Qn,COMMA:Yv,DOLLAR:nf,DOT:Ir,EQUALS:of,EXCLAMATION:Zv,HYPHEN:Nr,PERCENT:sf,PIPE:af,PLUS:lf,POUND:cf,QUERY:uf,QUOTE:Qv,SEMI:ew,SLASH:Dr,TILDE:_a,UNDERSCORE:ff,EMOJI:rM,SYM:df});const Mo=/[a-z]/,Kh=new RegExp("\\p{L}","u"),qh=new RegExp("\\p{Emoji}","u"),Xh=/\d/,oS=/\s/,sS=`
561
- `,fZ="️",dZ="‍";let tc=null,rc=null;function hZ(t){t===void 0&&(t=[]);const e={};Gt.groups=e;const r=new Gt;tc==null&&(tc=aS(oZ)),rc==null&&(rc=aS(sZ)),ye(r,"'",Zu),ye(r,"{",Ca),ye(r,"}",ka),ye(r,"[",Fu),ye(r,"]",Bu),ye(r,"(",$u),ye(r,")",ju),ye(r,"<",Hu),ye(r,">",zu),ye(r,"(",Uu),ye(r,")",Wu),ye(r,"「",Vu),ye(r,"」",Gu),ye(r,"『",Ku),ye(r,"』",qu),ye(r,"<",Xu),ye(r,">",Ju),ye(r,"&",Yu),ye(r,"*",Qu),ye(r,"@",Xn),ye(r,"`",tf),ye(r,"^",rf),ye(r,":",Qn),ye(r,",",Yv),ye(r,"$",nf),ye(r,".",Ir),ye(r,"=",of),ye(r,"!",Zv),ye(r,"-",Nr),ye(r,"%",sf),ye(r,"|",af),ye(r,"+",lf),ye(r,"#",cf),ye(r,"?",uf),ye(r,'"',Qv),ye(r,"/",Dr),ye(r,";",ew),ye(r,"~",_a),ye(r,"_",ff),ye(r,"\\",ef);const n=lr(r,Xh,Xv,{[Ig]:!0});lr(n,Xh,n);const i=lr(r,Mo,hn,{[Ng]:!0});lr(i,Mo,i);const o=lr(r,Kh,Lg,{[Dg]:!0});lr(o,Mo),lr(o,Kh,o);const s=lr(r,oS,tM,{[nS]:!0});ye(r,sS,Jv,{[nS]:!0}),ye(s,sS),lr(s,oS,s);const a=lr(r,qh,rM,{[eM]:!0});lr(a,qh,a),ye(a,fZ,a);const l=ye(a,dZ);lr(l,qh,a);const c=[[Mo,i]],u=[[Mo,null],[Kh,o]];for(let f=0;f<tc.length;f++)jn(r,tc[f],Fg,hn,c);for(let f=0;f<rc.length;f++)jn(r,rc[f],Bg,Lg,u);ji(Fg,{tld:!0,ascii:!0},e),ji(Bg,{utld:!0,alpha:!0},e),jn(r,"file",$c,hn,c),jn(r,"mailto",$c,hn,c),jn(r,"http",jo,hn,c),jn(r,"https",jo,hn,c),jn(r,"ftp",jo,hn,c),jn(r,"ftps",jo,hn,c),ji($c,{scheme:!0,ascii:!0},e),ji(jo,{slashscheme:!0,ascii:!0},e),t=t.sort((f,d)=>f[0]>d[0]?1:-1);for(let f=0;f<t.length;f++){const d=t[f][0],p=t[f][1]?{[aZ]:!0}:{[lZ]:!0};d.indexOf("-")>=0?p[Pg]=!0:Mo.test(d)?Xh.test(d)?p[Bc]=!0:p[Ng]=!0:p[Ig]=!0,iS(r,d,d,p)}return iS(r,"localhost",ol,{ascii:!0}),r.jd=new Gt(df),{start:r,tokens:Ts({groups:e},nM)}}function pZ(t,e){const r=mZ(e.replace(/[A-Z]/g,a=>a.toLowerCase())),n=r.length,i=[];let o=0,s=0;for(;s<n;){let a=t,l=null,c=0,u=null,f=-1,d=-1;for(;s<n&&(l=a.go(r[s]));)a=l,a.accepts()?(f=0,d=0,u=a):f>=0&&(f+=r[s].length,d++),c+=r[s].length,o+=r[s].length,s++;o-=f,s-=d,c-=f,i.push({t:u.t,v:e.slice(o-c,o),s:o-c,e:o})}return i}function mZ(t){const e=[],r=t.length;let n=0;for(;n<r;){let i=t.charCodeAt(n),o,s=i<55296||i>56319||n+1===r||(o=t.charCodeAt(n+1))<56320||o>57343?t[n]:t.slice(n,n+2);e.push(s),n+=s.length}return e}function jn(t,e,r,n,i){let o;const s=e.length;for(let a=0;a<s-1;a++){const l=e[a];t.j[l]?o=t.j[l]:(o=new Gt(n),o.jr=i.slice(),t.j[l]=o),t=o}return o=new Gt(r),o.jr=i.slice(),t.j[e[s-1]]=o,o}function aS(t){const e=[],r=[];let n=0,i="0123456789";for(;n<t.length;){let o=0;for(;i.indexOf(t[n+o])>=0;)o++;if(o>0){e.push(r.join(""));for(let s=parseInt(t.substring(n,n+o),10);s>0;s--)r.pop();n+=o}else r.push(t[n]),n++}return e}const sl={defaultProtocol:"http",events:null,format:lS,formatHref:lS,nl2br:!1,tagName:"a",target:null,rel:null,validate:!0,truncate:1/0,className:null,attributes:null,ignoreTags:[],render:null};function tw(t,e){e===void 0&&(e=null);let r=Ts({},sl);t&&(r=Ts(r,t instanceof tw?t.o:t));const n=r.ignoreTags,i=[];for(let o=0;o<n.length;o++)i.push(n[o].toUpperCase());this.o=r,e&&(this.defaultRender=e),this.ignoreTags=i}tw.prototype={o:sl,ignoreTags:[],defaultRender(t){return t},check(t){return this.get("validate",t.toString(),t)},get(t,e,r){const n=e!=null;let i=this.o[t];return i&&(typeof i=="object"?(i=r.t in i?i[r.t]:sl[t],typeof i=="function"&&n&&(i=i(e,r))):typeof i=="function"&&n&&(i=i(e,r.t,r)),i)},getObj(t,e,r){let n=this.o[t];return typeof n=="function"&&e!=null&&(n=n(e,r.t,r)),n},render(t){const e=t.render(this);return(this.get("render",null,t)||this.defaultRender)(e,t.t,t)}};function lS(t){return t}function iM(t,e){this.t="token",this.v=t,this.tk=e}iM.prototype={isLink:!1,toString(){return this.v},toHref(t){return this.toString()},toFormattedString(t){const e=this.toString(),r=t.get("truncate",e,this),n=t.get("format",e,this);return r&&n.length>r?n.substring(0,r)+"…":n},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){return t===void 0&&(t=sl.defaultProtocol),{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,r=this.toHref(t.get("defaultProtocol")),n=t.get("formatHref",r,this),i=t.get("tagName",r,e),o=this.toFormattedString(t),s={},a=t.get("className",r,e),l=t.get("target",r,e),c=t.get("rel",r,e),u=t.getObj("attributes",r,e),f=t.getObj("events",r,e);return s.href=n,a&&(s.class=a),l&&(s.target=l),c&&(s.rel=c),u&&Ts(s,u),{tagName:i,attributes:s,content:o,eventListeners:f}}};function pd(t,e){class r extends iM{constructor(i,o){super(i,o),this.t=t}}for(const n in e)r.prototype[n]=e[n];return r.t=t,r}const cS=pd("email",{isLink:!0,toHref(){return"mailto:"+this.toString()}}),uS=pd("text"),gZ=pd("nl"),nc=pd("url",{isLink:!0,toHref(t){return t===void 0&&(t=sl.defaultProtocol),this.hasProtocol()?this.v:`${t}://${this.v}`},hasProtocol(){const t=this.tk;return t.length>=2&&t[0].t!==ol&&t[1].t===Qn}}),cr=t=>new Gt(t);function yZ(t){let{groups:e}=t;const r=e.domain.concat([Yu,Qu,Xn,ef,tf,rf,nf,of,Nr,Xv,sf,af,lf,cf,Dr,df,_a,ff]),n=[Zu,Qn,Yv,Ir,Zv,uf,Qv,ew,Hu,zu,Ca,ka,Bu,Fu,$u,ju,Uu,Wu,Vu,Gu,Ku,qu,Xu,Ju],i=[Yu,Zu,Qu,ef,tf,rf,nf,of,Nr,Ca,ka,sf,af,lf,cf,uf,Dr,df,_a,ff],o=cr(),s=ye(o,_a);Ne(s,i,s),Ne(s,e.domain,s);const a=cr(),l=cr(),c=cr();Ne(o,e.domain,a),Ne(o,e.scheme,l),Ne(o,e.slashscheme,c),Ne(a,i,s),Ne(a,e.domain,a);const u=ye(a,Xn);ye(s,Xn,u),ye(l,Xn,u),ye(c,Xn,u);const f=ye(s,Ir);Ne(f,i,s),Ne(f,e.domain,s);const d=cr();Ne(u,e.domain,d),Ne(d,e.domain,d);const h=ye(d,Ir);Ne(h,e.domain,d);const p=cr(cS);Ne(h,e.tld,p),Ne(h,e.utld,p),ye(u,ol,p);const m=ye(d,Nr);Ne(m,e.domain,d),Ne(p,e.domain,d),ye(p,Ir,h),ye(p,Nr,m);const y=ye(p,Qn);Ne(y,e.numeric,cS);const g=ye(a,Nr),b=ye(a,Ir);Ne(g,e.domain,a),Ne(b,i,s),Ne(b,e.domain,a);const S=cr(nc);Ne(b,e.tld,S),Ne(b,e.utld,S),Ne(S,e.domain,a),Ne(S,i,s),ye(S,Ir,b),ye(S,Nr,g),ye(S,Xn,u);const x=ye(S,Qn),O=cr(nc);Ne(x,e.numeric,O);const M=cr(nc),D=cr();Ne(M,r,M),Ne(M,n,D),Ne(D,r,M),Ne(D,n,D),ye(S,Dr,M),ye(O,Dr,M);const $=ye(l,Qn),A=ye(c,Qn),V=ye(A,Dr),Q=ye(V,Dr);Ne(l,e.domain,a),ye(l,Ir,b),ye(l,Nr,g),Ne(c,e.domain,a),ye(c,Ir,b),ye(c,Nr,g),Ne($,e.domain,M),ye($,Dr,M),Ne(Q,e.domain,M),Ne(Q,r,M),ye(Q,Dr,M);const I=[[Ca,ka],[Fu,Bu],[$u,ju],[Hu,zu],[Uu,Wu],[Vu,Gu],[Ku,qu],[Xu,Ju]];for(let U=0;U<I.length;U++){const[k,G]=I[U],te=ye(M,k);ye(D,k,te),ye(te,G,M);const W=cr(nc);Ne(te,r,W);const ae=cr();Ne(te,n),Ne(W,r,W),Ne(W,n,ae),Ne(ae,r,W),Ne(ae,n,ae),ye(W,G,M),ye(ae,G,M)}return ye(o,ol,S),ye(o,Jv,gZ),{start:o,tokens:nM}}function vZ(t,e,r){let n=r.length,i=0,o=[],s=[];for(;i<n;){let a=t,l=null,c=null,u=0,f=null,d=-1;for(;i<n&&!(l=a.go(r[i].t));)s.push(r[i++]);for(;i<n&&(c=l||a.go(r[i].t));)l=null,a=c,a.accepts()?(d=0,f=a):d>=0&&d++,i++,u++;if(d<0)i-=u,i<n&&(s.push(r[i]),i++);else{s.length>0&&(o.push(Jh(uS,e,s)),s=[]),i-=d,u-=d;const h=f.t,p=r.slice(i-u,i);o.push(Jh(h,e,p))}}return s.length>0&&o.push(Jh(uS,e,s)),o}function Jh(t,e,r){const n=r[0].s,i=r[r.length-1].e,o=e.slice(n,i);return new t(o,r)}const wZ=typeof console<"u"&&console&&console.warn||(()=>{}),bZ="until manual call of linkify.init(). Register all schemes and plugins before invoking linkify the first time.",nt={scanner:null,parser:null,tokenQueue:[],pluginQueue:[],customSchemes:[],initialized:!1};function xZ(){Gt.groups={},nt.scanner=null,nt.parser=null,nt.tokenQueue=[],nt.pluginQueue=[],nt.customSchemes=[],nt.initialized=!1}function fS(t,e){if(e===void 0&&(e=!1),nt.initialized&&wZ(`linkifyjs: already initialized - will not register custom scheme "${t}" ${bZ}`),!/^[0-9a-z]+(-[0-9a-z]+)*$/.test(t))throw new Error(`linkifyjs: incorrect scheme format.
562
- 1. Must only contain digits, lowercase ASCII letters or "-"
563
- 2. Cannot start or end with "-"
564
- 3. "-" cannot repeat`);nt.customSchemes.push([t,e])}function SZ(){nt.scanner=hZ(nt.customSchemes);for(let t=0;t<nt.tokenQueue.length;t++)nt.tokenQueue[t][1]({scanner:nt.scanner});nt.parser=yZ(nt.scanner.tokens);for(let t=0;t<nt.pluginQueue.length;t++)nt.pluginQueue[t][1]({scanner:nt.scanner,parser:nt.parser});nt.initialized=!0}function oM(t){return nt.initialized||SZ(),vZ(nt.parser.start,t,pZ(nt.scanner.start,t))}function sM(t,e,r){if(e===void 0&&(e=null),r===void 0&&(r=null),e&&typeof e=="object"){if(r)throw Error(`linkifyjs: Invalid link type ${e}; must be a string`);r=e,e=null}const n=new tw(r),i=oM(t),o=[];for(let s=0;s<i.length;s++){const a=i[s];a.isLink&&(!e||a.t===e)&&n.check(a)&&o.push(a.toFormattedObject(n))}return o}function EZ(t){return t.length===1?t[0].isLink:t.length===3&&t[1].isLink?["()","[]"].includes(t[0].value+t[2].value):!1}function TZ(t){return new tt({key:new et("autolink"),appendTransaction:(e,r,n)=>{const i=e.some(c=>c.docChanged)&&!r.doc.eq(n.doc),o=e.some(c=>c.getMeta("preventAutolink"));if(!i||o)return;const{tr:s}=n,a=rF(r.doc,[...e]);if(fF(a).forEach(({newRange:c})=>{const u=oF(n.doc,c,h=>h.isTextblock);let f,d;if(u.length>1?(f=u[0],d=n.doc.textBetween(f.pos,f.pos+f.node.nodeSize,void 0," ")):u.length&&n.doc.textBetween(c.from,c.to," "," ").endsWith(" ")&&(f=u[0],d=n.doc.textBetween(f.pos,c.to,void 0," ")),f&&d){const h=d.split(" ").filter(g=>g!=="");if(h.length<=0)return!1;const p=h[h.length-1],m=f.pos+d.lastIndexOf(p);if(!p)return!1;const y=oM(p).map(g=>g.toObject(t.defaultProtocol));if(!EZ(y))return!1;y.filter(g=>g.isLink).map(g=>({...g,from:m+g.start+1,to:m+g.end+1})).filter(g=>n.schema.marks.code?!n.doc.rangeHasMark(g.from,g.to,n.schema.marks.code):!0).filter(g=>t.validate(g.value)).forEach(g=>{wy(g.from,g.to,n.doc).some(b=>b.mark.type===t.type)||s.addMark(g.from,g.to,t.type.create({href:g.href}))})}}),!!s.steps.length)return s}})}function AZ(t){return new tt({key:new et("handleClickLink"),props:{handleClick:(e,r,n)=>{var i,o;if(n.button!==0||!e.editable)return!1;let s=n.target;const a=[];for(;s.nodeName!=="DIV";)a.push(s),s=s.parentNode;if(!a.find(d=>d.nodeName==="A"))return!1;const l=TA(e.state,t.type.name),c=n.target,u=(i=c==null?void 0:c.href)!==null&&i!==void 0?i:l.href,f=(o=c==null?void 0:c.target)!==null&&o!==void 0?o:l.target;return c&&u?(window.open(u,f),!0):!1}}})}function CZ(t){return new tt({key:new et("handlePasteLink"),props:{handlePaste:(e,r,n)=>{const{state:i}=e,{selection:o}=i,{empty:s}=o;if(s)return!1;let a="";n.content.forEach(c=>{a+=c.textContent});const l=sM(a,{defaultProtocol:t.defaultProtocol}).find(c=>c.isLink&&c.value===a);return!a||!l?!1:(t.editor.commands.setMark(t.type,{href:l.href}),!0)}}})}const kZ=/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g,_Z=/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i;function dS(t){return!t||t.replace(kZ,"").match(_Z)}const OZ=Nt.create({name:"link",priority:1e3,keepOnSplit:!1,exitable:!0,onCreate(){this.options.protocols.forEach(t=>{if(typeof t=="string"){fS(t);return}fS(t.scheme,t.optionalSlashes)})},onDestroy(){xZ()},inclusive(){return this.options.autolink},addOptions(){return{openOnClick:!0,linkOnPaste:!0,autolink:!0,protocols:[],defaultProtocol:"http",HTMLAttributes:{target:"_blank",rel:"noopener noreferrer nofollow",class:null},validate:t=>!!t}},addAttributes(){return{href:{default:null,parseHTML(t){return t.getAttribute("href")}},target:{default:this.options.HTMLAttributes.target},rel:{default:this.options.HTMLAttributes.rel},class:{default:this.options.HTMLAttributes.class}}},parseHTML(){return[{tag:"a[href]",getAttrs:t=>{const e=t.getAttribute("href");return!e||!dS(e)?!1:null}}]},renderHTML({HTMLAttributes:t}){return dS(t.href)?["a",Be(this.options.HTMLAttributes,t),0]:["a",Be(this.options.HTMLAttributes,{...t,href:""}),0]},addCommands(){return{setLink:t=>({chain:e})=>e().setMark(this.name,t).setMeta("preventAutolink",!0).run(),toggleLink:t=>({chain:e})=>e().toggleMark(this.name,t,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run(),unsetLink:()=>({chain:t})=>t().unsetMark(this.name,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run()}},addPasteRules(){return[di({find:t=>{const e=[];if(t){const{validate:r}=this.options,n=sM(t).filter(i=>i.isLink&&r(i.value));n.length&&n.forEach(i=>e.push({text:i.value,data:{href:i.href},index:i.start}))}return e},type:this.type,getAttributes:t=>{var e;return{href:(e=t.data)===null||e===void 0?void 0:e.href}}})]},addProseMirrorPlugins(){const t=[];return this.options.autolink&&t.push(TZ({type:this.type,defaultProtocol:this.options.defaultProtocol,validate:this.options.validate})),this.options.openOnClick===!0&&t.push(AZ({type:this.type})),this.options.linkOnPaste&&t.push(CZ({editor:this.editor,defaultProtocol:this.options.defaultProtocol,type:this.type})),t}}),RZ=ct.create({name:"horizontalRule",addOptions(){return{HTMLAttributes:{}}},group:"block",parseHTML(){return[{tag:"hr"}]},renderHTML({HTMLAttributes:t}){return["hr",Be(this.options.HTMLAttributes,t)]},addCommands(){return{setHorizontalRule:()=>({chain:t,state:e})=>{const{selection:r}=e,{$from:n,$to:i}=r,o=t();return n.parentOffset===0?o.insertContentAt({from:Math.max(n.pos-1,0),to:i.pos},{type:this.name}):CA(r)?o.insertContentAt(i.pos,{type:this.name}):o.insertContent({type:this.name}),o.command(({tr:s,dispatch:a})=>{var l;if(a){const{$to:c}=s.selection,u=c.end();if(c.nodeAfter)c.nodeAfter.isTextblock?s.setSelection(_e.create(s.doc,c.pos+1)):c.nodeAfter.isBlock?s.setSelection(ke.create(s.doc,c.pos)):s.setSelection(_e.create(s.doc,c.pos));else{const f=(l=c.parent.type.contentMatch.defaultType)===null||l===void 0?void 0:l.create();f&&(s.insert(u,f),s.setSelection(_e.create(s.doc,u+1)))}s.scrollIntoView()}return!0}).run()}}},addInputRules(){return[xy({find:/^(?:---|—-|___\s|\*\*\*\s)$/,type:this.type})]}});var hf=200,vt=function(){};vt.prototype.append=function(e){return e.length?(e=vt.from(e),!this.length&&e||e.length<hf&&this.leafAppend(e)||this.length<hf&&e.leafPrepend(this)||this.appendInner(e)):this};vt.prototype.prepend=function(e){return e.length?vt.from(e).append(this):this};vt.prototype.appendInner=function(e){return new MZ(this,e)};vt.prototype.slice=function(e,r){return e===void 0&&(e=0),r===void 0&&(r=this.length),e>=r?vt.empty:this.sliceInner(Math.max(0,e),Math.min(this.length,r))};vt.prototype.get=function(e){if(!(e<0||e>=this.length))return this.getInner(e)};vt.prototype.forEach=function(e,r,n){r===void 0&&(r=0),n===void 0&&(n=this.length),r<=n?this.forEachInner(e,r,n,0):this.forEachInvertedInner(e,r,n,0)};vt.prototype.map=function(e,r,n){r===void 0&&(r=0),n===void 0&&(n=this.length);var i=[];return this.forEach(function(o,s){return i.push(e(o,s))},r,n),i};vt.from=function(e){return e instanceof vt?e:e&&e.length?new aM(e):vt.empty};var aM=function(t){function e(n){t.call(this),this.values=n}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var r={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,s,a){for(var l=o;l<s;l++)if(i(this.values[l],a+l)===!1)return!1},e.prototype.forEachInvertedInner=function(i,o,s,a){for(var l=o-1;l>=s;l--)if(i(this.values[l],a+l)===!1)return!1},e.prototype.leafAppend=function(i){if(this.length+i.length<=hf)return new e(this.values.concat(i.flatten()))},e.prototype.leafPrepend=function(i){if(this.length+i.length<=hf)return new e(i.flatten().concat(this.values))},r.length.get=function(){return this.values.length},r.depth.get=function(){return 0},Object.defineProperties(e.prototype,r),e}(vt);vt.empty=new aM([]);var MZ=function(t){function e(r,n){t.call(this),this.left=r,this.right=n,this.length=r.length+n.length,this.depth=Math.max(r.depth,n.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(n){return n<this.left.length?this.left.get(n):this.right.get(n-this.left.length)},e.prototype.forEachInner=function(n,i,o,s){var a=this.left.length;if(i<a&&this.left.forEachInner(n,i,Math.min(o,a),s)===!1||o>a&&this.right.forEachInner(n,Math.max(i-a,0),Math.min(this.length,o)-a,s+a)===!1)return!1},e.prototype.forEachInvertedInner=function(n,i,o,s){var a=this.left.length;if(i>a&&this.right.forEachInvertedInner(n,i-a,Math.max(o,a)-a,s+a)===!1||o<a&&this.left.forEachInvertedInner(n,Math.min(i,a),o,s)===!1)return!1},e.prototype.sliceInner=function(n,i){if(n==0&&i==this.length)return this;var o=this.left.length;return i<=o?this.left.slice(n,i):n>=o?this.right.slice(n-o,i-o):this.left.slice(n,o).append(this.right.slice(0,i-o))},e.prototype.leafAppend=function(n){var i=this.right.leafAppend(n);if(i)return new e(this.left,i)},e.prototype.leafPrepend=function(n){var i=this.left.leafPrepend(n);if(i)return new e(i,this.right)},e.prototype.appendInner=function(n){return this.left.depth>=Math.max(this.right.depth,n.depth)+1?new e(this.left,new e(this.right,n)):new e(this,n)},e}(vt);const IZ=500;class Tr{constructor(e,r){this.items=e,this.eventCount=r}popEvent(e,r){if(this.eventCount==0)return null;let n=this.items.length;for(;;n--)if(this.items.get(n-1).selection){--n;break}let i,o;r&&(i=this.remapping(n,this.items.length),o=i.maps.length);let s=e.tr,a,l,c=[],u=[];return this.items.forEach((f,d)=>{if(!f.step){i||(i=this.remapping(n,d+1),o=i.maps.length),o--,u.push(f);return}if(i){u.push(new Hn(f.map));let h=f.step.map(i.slice(o)),p;h&&s.maybeStep(h).doc&&(p=s.mapping.maps[s.mapping.maps.length-1],c.push(new Hn(p,void 0,void 0,c.length+u.length))),o--,p&&i.appendMap(p,o)}else s.maybeStep(f.step);if(f.selection)return a=i?f.selection.map(i.slice(o)):f.selection,l=new Tr(this.items.slice(0,n).append(u.reverse().concat(c)),this.eventCount-1),!1},this.items.length,0),{remaining:l,transform:s,selection:a}}addTransform(e,r,n,i){let o=[],s=this.eventCount,a=this.items,l=!i&&a.length?a.get(a.length-1):null;for(let u=0;u<e.steps.length;u++){let f=e.steps[u].invert(e.docs[u]),d=new Hn(e.mapping.maps[u],f,r),h;(h=l&&l.merge(d))&&(d=h,u?o.pop():a=a.slice(0,a.length-1)),o.push(d),r&&(s++,r=void 0),i||(l=d)}let c=s-n.depth;return c>DZ&&(a=NZ(a,c),s-=c),new Tr(a.append(o),s)}remapping(e,r){let n=new Wo;return this.items.forEach((i,o)=>{let s=i.mirrorOffset!=null&&o-i.mirrorOffset>=e?n.maps.length-i.mirrorOffset:void 0;n.appendMap(i.map,s)},e,r),n}addMaps(e){return this.eventCount==0?this:new Tr(this.items.append(e.map(r=>new Hn(r))),this.eventCount)}rebased(e,r){if(!this.eventCount)return this;let n=[],i=Math.max(0,this.items.length-r),o=e.mapping,s=e.steps.length,a=this.eventCount;this.items.forEach(d=>{d.selection&&a--},i);let l=r;this.items.forEach(d=>{let h=o.getMirror(--l);if(h==null)return;s=Math.min(s,h);let p=o.maps[h];if(d.step){let m=e.steps[h].invert(e.docs[h]),y=d.selection&&d.selection.map(o.slice(l+1,h));y&&a++,n.push(new Hn(p,m,y))}else n.push(new Hn(p))},i);let c=[];for(let d=r;d<s;d++)c.push(new Hn(o.maps[d]));let u=this.items.slice(0,i).append(c).append(n),f=new Tr(u,a);return f.emptyItemCount()>IZ&&(f=f.compress(this.items.length-n.length)),f}emptyItemCount(){let e=0;return this.items.forEach(r=>{r.step||e++}),e}compress(e=this.items.length){let r=this.remapping(0,e),n=r.maps.length,i=[],o=0;return this.items.forEach((s,a)=>{if(a>=e)i.push(s),s.selection&&o++;else if(s.step){let l=s.step.map(r.slice(n)),c=l&&l.getMap();if(n--,c&&r.appendMap(c,n),l){let u=s.selection&&s.selection.map(r.slice(n));u&&o++;let f=new Hn(c.invert(),l,u),d,h=i.length-1;(d=i.length&&i[h].merge(f))?i[h]=d:i.push(f)}}else s.map&&n--},this.items.length,0),new Tr(vt.from(i.reverse()),o)}}Tr.empty=new Tr(vt.empty,0);function NZ(t,e){let r;return t.forEach((n,i)=>{if(n.selection&&e--==0)return r=i,!1}),t.slice(r)}let Hn=class lM{constructor(e,r,n,i){this.map=e,this.step=r,this.selection=n,this.mirrorOffset=i}merge(e){if(this.step&&e.step&&!e.selection){let r=e.step.merge(this.step);if(r)return new lM(r.getMap().invert(),r,this.selection)}}};class Jn{constructor(e,r,n,i,o){this.done=e,this.undone=r,this.prevRanges=n,this.prevTime=i,this.prevComposition=o}}const DZ=20;function PZ(t,e,r,n){let i=r.getMeta(Ji),o;if(i)return i.historyState;r.getMeta(BZ)&&(t=new Jn(t.done,t.undone,null,0,-1));let s=r.getMeta("appendedTransaction");if(r.steps.length==0)return t;if(s&&s.getMeta(Ji))return s.getMeta(Ji).redo?new Jn(t.done.addTransform(r,void 0,n,jc(e)),t.undone,hS(r.mapping.maps),t.prevTime,t.prevComposition):new Jn(t.done,t.undone.addTransform(r,void 0,n,jc(e)),null,t.prevTime,t.prevComposition);if(r.getMeta("addToHistory")!==!1&&!(s&&s.getMeta("addToHistory")===!1)){let a=r.getMeta("composition"),l=t.prevTime==0||!s&&t.prevComposition!=a&&(t.prevTime<(r.time||0)-n.newGroupDelay||!LZ(r,t.prevRanges)),c=s?Yh(t.prevRanges,r.mapping):hS(r.mapping.maps);return new Jn(t.done.addTransform(r,l?e.selection.getBookmark():void 0,n,jc(e)),Tr.empty,c,r.time,a??t.prevComposition)}else return(o=r.getMeta("rebased"))?new Jn(t.done.rebased(r,o),t.undone.rebased(r,o),Yh(t.prevRanges,r.mapping),t.prevTime,t.prevComposition):new Jn(t.done.addMaps(r.mapping.maps),t.undone.addMaps(r.mapping.maps),Yh(t.prevRanges,r.mapping),t.prevTime,t.prevComposition)}function LZ(t,e){if(!e)return!1;if(!t.docChanged)return!0;let r=!1;return t.mapping.maps[0].forEach((n,i)=>{for(let o=0;o<e.length;o+=2)n<=e[o+1]&&i>=e[o]&&(r=!0)}),r}function hS(t){let e=[];for(let r=t.length-1;r>=0&&e.length==0;r--)t[r].forEach((n,i,o,s)=>e.push(o,s));return e}function Yh(t,e){if(!t)return null;let r=[];for(let n=0;n<t.length;n+=2){let i=e.map(t[n],1),o=e.map(t[n+1],-1);i<=o&&r.push(i,o)}return r}function FZ(t,e,r){let n=jc(e),i=Ji.get(e).spec.config,o=(r?t.undone:t.done).popEvent(e,n);if(!o)return null;let s=o.selection.resolve(o.transform.doc),a=(r?t.done:t.undone).addTransform(o.transform,e.selection.getBookmark(),i,n),l=new Jn(r?a:o.remaining,r?o.remaining:a,null,0,-1);return o.transform.setSelection(s).setMeta(Ji,{redo:r,historyState:l})}let Zh=!1,pS=null;function jc(t){let e=t.plugins;if(pS!=e){Zh=!1,pS=e;for(let r=0;r<e.length;r++)if(e[r].spec.historyPreserveItems){Zh=!0;break}}return Zh}const Ji=new et("history"),BZ=new et("closeHistory");function $Z(t={}){return t={depth:t.depth||100,newGroupDelay:t.newGroupDelay||500},new tt({key:Ji,state:{init(){return new Jn(Tr.empty,Tr.empty,null,0,-1)},apply(e,r,n){return PZ(r,n,e,t)}},config:t,props:{handleDOMEvents:{beforeinput(e,r){let n=r.inputType,i=n=="historyUndo"?uM:n=="historyRedo"?fM:null;return i?(r.preventDefault(),i(e.state,e.dispatch)):!1}}}})}function cM(t,e){return(r,n)=>{let i=Ji.getState(r);if(!i||(t?i.undone:i.done).eventCount==0)return!1;if(n){let o=FZ(i,r,t);o&&n(e?o.scrollIntoView():o)}return!0}}const uM=cM(!1,!0),fM=cM(!0,!0),jZ=dt.create({name:"history",addOptions(){return{depth:100,newGroupDelay:500}},addCommands(){return{undo:()=>({state:t,dispatch:e})=>uM(t,e),redo:()=>({state:t,dispatch:e})=>fM(t,e)}},addProseMirrorPlugins(){return[$Z(this.options)]},addKeyboardShortcuts(){return{"Mod-z":()=>this.editor.commands.undo(),"Shift-Mod-z":()=>this.editor.commands.redo(),"Mod-y":()=>this.editor.commands.redo(),"Mod-я":()=>this.editor.commands.undo(),"Shift-Mod-я":()=>this.editor.commands.redo()}}}),HZ=dt.create({name:"characterCount",addOptions(){return{limit:null,mode:"textSize"}},addStorage(){return{characters:()=>0,words:()=>0}},onBeforeCreate(){this.storage.characters=t=>{const e=(t==null?void 0:t.node)||this.editor.state.doc;return((t==null?void 0:t.mode)||this.options.mode)==="textSize"?e.textBetween(0,e.content.size,void 0," ").length:e.nodeSize},this.storage.words=t=>{const e=(t==null?void 0:t.node)||this.editor.state.doc;return e.textBetween(0,e.content.size," "," ").split(" ").filter(i=>i!=="").length}},addProseMirrorPlugins(){return[new tt({key:new et("characterCount"),filterTransaction:(t,e)=>{const r=this.options.limit;if(!t.docChanged||r===0||r===null||r===void 0)return!0;const n=this.storage.characters({node:e.doc}),i=this.storage.characters({node:t.doc});if(i<=r||n>r&&i>r&&i<=n)return!0;if(n>r&&i>r&&i>n||!t.getMeta("paste"))return!1;const s=t.selection.$head.pos,a=i-r,l=s-a,c=s;return t.deleteRange(l,c),!(this.storage.characters({node:t.doc})>r)}})]}});function zZ(t={}){return new tt({view(e){return new UZ(e,t)}})}class UZ{constructor(e,r){var n;this.editorView=e,this.cursorPos=null,this.element=null,this.timeout=-1,this.width=(n=r.width)!==null&&n!==void 0?n:1,this.color=r.color===!1?void 0:r.color||"black",this.class=r.class,this.handlers=["dragover","dragend","drop","dragleave"].map(i=>{let o=s=>{this[i](s)};return e.dom.addEventListener(i,o),{name:i,handler:o}})}destroy(){this.handlers.forEach(({name:e,handler:r})=>this.editorView.dom.removeEventListener(e,r))}update(e,r){this.cursorPos!=null&&r.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),r=!e.parent.inlineContent,n;if(r){let a=e.nodeBefore,l=e.nodeAfter;if(a||l){let c=this.editorView.nodeDOM(this.cursorPos-(a?a.nodeSize:0));if(c){let u=c.getBoundingClientRect(),f=a?u.bottom:u.top;a&&l&&(f=(f+this.editorView.nodeDOM(this.cursorPos).getBoundingClientRect().top)/2),n={left:u.left,right:u.right,top:f-this.width/2,bottom:f+this.width/2}}}}if(!n){let a=this.editorView.coordsAtPos(this.cursorPos);n={left:a.left-this.width/2,right:a.left+this.width/2,top:a.top,bottom:a.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",r),this.element.classList.toggle("prosemirror-dropcursor-inline",!r);let o,s;if(!i||i==document.body&&getComputedStyle(i).position=="static")o=-pageXOffset,s=-pageYOffset;else{let a=i.getBoundingClientRect();o=a.left-i.scrollLeft,s=a.top-i.scrollTop}this.element.style.left=n.left-o+"px",this.element.style.top=n.top-s+"px",this.element.style.width=n.right-n.left+"px",this.element.style.height=n.bottom-n.top+"px"}scheduleRemoval(e){clearTimeout(this.timeout),this.timeout=setTimeout(()=>this.setCursor(null),e)}dragover(e){if(!this.editorView.editable)return;let r=this.editorView.posAtCoords({left:e.clientX,top:e.clientY}),n=r&&r.inside>=0&&this.editorView.state.doc.nodeAt(r.inside),i=n&&n.type.spec.disableDropCursor,o=typeof i=="function"?i(this.editorView,r,e):i;if(r&&!o){let s=r.pos;if(this.editorView.dragging&&this.editorView.dragging.slice){let a=ST(this.editorView.state.doc,s,this.editorView.dragging.slice);a!=null&&(s=a)}this.setCursor(s),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)}}const WZ=dt.create({name:"dropCursor",addOptions(){return{color:"currentColor",width:1,class:void 0}},addProseMirrorPlugins(){return[zZ(this.options)]}}),VZ=dt.create({name:"focus",addOptions(){return{className:"has-focus",mode:"all"}},addProseMirrorPlugins(){return[new tt({key:new et("focus"),props:{decorations:({doc:t,selection:e})=>{const{isEditable:r,isFocused:n}=this.editor,{anchor:i}=e,o=[];if(!r||!n)return Ke.create(t,[]);let s=0;this.options.mode==="deepest"&&t.descendants((l,c)=>{if(l.isText)return;if(!(i>=c&&i<=c+l.nodeSize-1))return!1;s+=1});let a=0;return t.descendants((l,c)=>{if(l.isText||!(i>=c&&i<=c+l.nodeSize-1))return!1;if(a+=1,this.options.mode==="deepest"&&s-a>0||this.options.mode==="shallowest"&&a>1)return this.options.mode==="deepest";o.push(gt.node(c,c+l.nodeSize,{class:this.options.className}))}),Ke.create(t,o)}}})]}});class it extends Re{constructor(e){super(e,e)}map(e,r){let n=e.resolve(r.map(this.head));return it.valid(n)?new it(n):Re.near(n)}content(){return we.empty}eq(e){return e instanceof it&&e.head==this.head}toJSON(){return{type:"gapcursor",pos:this.head}}static fromJSON(e,r){if(typeof r.pos!="number")throw new RangeError("Invalid input for GapCursor.fromJSON");return new it(e.resolve(r.pos))}getBookmark(){return new rw(this.anchor)}static valid(e){let r=e.parent;if(r.isTextblock||!GZ(e)||!KZ(e))return!1;let n=r.type.spec.allowGapCursor;if(n!=null)return n;let i=r.contentMatchAt(e.index()).defaultType;return i&&i.isTextblock}static findGapCursorFrom(e,r,n=!1){e:for(;;){if(!n&&it.valid(e))return e;let i=e.pos,o=null;for(let s=e.depth;;s--){let a=e.node(s);if(r>0?e.indexAfter(s)<a.childCount:e.index(s)>0){o=a.child(r>0?e.indexAfter(s):e.index(s)-1);break}else if(s==0)return null;i+=r;let l=e.doc.resolve(i);if(it.valid(l))return l}for(;;){let s=r>0?o.firstChild:o.lastChild;if(!s){if(o.isAtom&&!o.isText&&!ke.isSelectable(o)){e=e.doc.resolve(i+o.nodeSize*r),n=!1;continue e}break}o=s,i+=r;let a=e.doc.resolve(i);if(it.valid(a))return a}return null}}}it.prototype.visible=!1;it.findFrom=it.findGapCursorFrom;Re.jsonID("gapcursor",it);class rw{constructor(e){this.pos=e}map(e){return new rw(e.map(this.pos))}resolve(e){let r=e.resolve(this.pos);return it.valid(r)?new it(r):Re.near(r)}}function GZ(t){for(let e=t.depth;e>=0;e--){let r=t.index(e),n=t.node(e);if(r==0){if(n.type.spec.isolating)return!0;continue}for(let i=n.child(r-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 KZ(t){for(let e=t.depth;e>=0;e--){let r=t.indexAfter(e),n=t.node(e);if(r==n.childCount){if(n.type.spec.isolating)return!0;continue}for(let i=n.child(r);;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 qZ(){return new tt({props:{decorations:ZZ,createSelectionBetween(t,e,r){return e.pos==r.pos&&it.valid(r)?new it(r):null},handleClick:JZ,handleKeyDown:XZ,handleDOMEvents:{beforeinput:YZ}}})}const XZ=py({ArrowLeft:ic("horiz",-1),ArrowRight:ic("horiz",1),ArrowUp:ic("vert",-1),ArrowDown:ic("vert",1)});function ic(t,e){const r=t=="vert"?e>0?"down":"up":e>0?"right":"left";return function(n,i,o){let s=n.selection,a=e>0?s.$to:s.$from,l=s.empty;if(s instanceof _e){if(!o.endOfTextblock(r)||a.depth==0)return!1;l=!1,a=n.doc.resolve(e>0?a.after():a.before())}let c=it.findGapCursorFrom(a,e,l);return c?(i&&i(n.tr.setSelection(new it(c))),!0):!1}}function JZ(t,e,r){if(!t||!t.editable)return!1;let n=t.state.doc.resolve(e);if(!it.valid(n))return!1;let i=t.posAtCoords({left:r.clientX,top:r.clientY});return i&&i.inside>-1&&ke.isSelectable(t.state.doc.nodeAt(i.inside))?!1:(t.dispatch(t.state.tr.setSelection(new it(n))),!0)}function YZ(t,e){if(e.inputType!="insertCompositionText"||!(t.state.selection instanceof it))return!1;let{$from:r}=t.state.selection,n=r.parent.contentMatchAt(r.index()).findWrapping(t.state.schema.nodes.text);if(!n)return!1;let i=he.empty;for(let s=n.length-1;s>=0;s--)i=he.from(n[s].createAndFill(null,i));let o=t.state.tr.replace(r.pos,r.pos,new we(i,0,0));return o.setSelection(_e.near(o.doc.resolve(r.pos+1))),t.dispatch(o),!1}function ZZ(t){if(!(t.selection instanceof it))return null;let e=document.createElement("div");return e.className="ProseMirror-gapcursor",Ke.create(t.doc,[gt.widget(t.selection.head,e,{key:"gapcursor"})])}const QZ=dt.create({name:"gapCursor",addProseMirrorPlugins(){return[qZ()]},extendNodeSchema(t){var e;const r={name:t.name,options:t.options,storage:t.storage};return{allowGapCursor:(e=De(Ee(t,"allowGapCursor",r)))!==null&&e!==void 0?e:null}}}),eQ=ct.create({name:"hardBreak",addOptions(){return{keepMarks:!0,HTMLAttributes:{}}},inline:!0,group:"inline",selectable:!1,parseHTML(){return[{tag:"br"}]},renderHTML({HTMLAttributes:t}){return["br",Be(this.options.HTMLAttributes,t)]},renderText(){return`
565
- `},addCommands(){return{setHardBreak:()=>({commands:t,chain:e,state:r,editor:n})=>t.first([()=>t.exitCode(),()=>t.command(()=>{const{selection:i,storedMarks:o}=r;if(i.$from.parent.type.spec.isolating)return!1;const{keepMarks:s}=this.options,{splittableMarks:a}=n.extensionManager,l=o||i.$to.parentOffset&&i.$from.marks();return e().insertContent({type:this.name}).command(({tr:c,dispatch:u})=>{if(u&&l&&s){const f=l.filter(d=>a.includes(d.type.name));c.ensureMarks(f)}return!0}).run()})])}},addKeyboardShortcuts(){return{"Mod-Enter":()=>this.editor.commands.setHardBreak(),"Shift-Enter":()=>this.editor.commands.setHardBreak()}}}),tQ=ct.create({name:"listItem",addOptions(){return{HTMLAttributes:{},bulletListTypeName:"bulletList",orderedListTypeName:"orderedList"}},content:"paragraph block*",defining:!0,parseHTML(){return[{tag:"li"}]},renderHTML({HTMLAttributes:t}){return["li",Be(this.options.HTMLAttributes,t),0]},addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem(this.name),Tab:()=>this.editor.commands.sinkListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)}}}),rQ=ct.create({name:"paragraph",priority:1e3,addOptions(){return{HTMLAttributes:{}}},group:"block",content:"inline*",parseHTML(){return[{tag:"p"}]},renderHTML({HTMLAttributes:t}){return["p",Be(this.options.HTMLAttributes,t),0]},addCommands(){return{setParagraph:()=>({commands:t})=>t.setNode(this.name)}},addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}}),nQ=dt.create({name:"placeholder",addOptions(){return{emptyEditorClass:"is-editor-empty",emptyNodeClass:"is-empty",placeholder:"Write something …",showOnlyWhenEditable:!0,showOnlyCurrent:!0,includeChildren:!1}},addProseMirrorPlugins(){return[new tt({key:new et("placeholder"),props:{decorations:({doc:t,selection:e})=>{const r=this.editor.isEditable||!this.options.showOnlyWhenEditable,{anchor:n}=e,i=[];if(!r)return null;const o=this.editor.isEmpty;return t.descendants((s,a)=>{const l=n>=a&&n<=a+s.nodeSize,c=!s.isLeaf&&by(s);if((l||!this.options.showOnlyCurrent)&&c){const u=[this.options.emptyNodeClass];o&&u.push(this.options.emptyEditorClass);const f=gt.node(a,a+s.nodeSize,{class:u.join(" "),"data-placeholder":typeof this.options.placeholder=="function"?this.options.placeholder({editor:this.editor,node:s,pos:a,hasAnchor:l}):this.options.placeholder});i.push(f)}return this.options.includeChildren}),Ke.create(t,i)}}})]}}),iQ=ct.create({name:"text",group:"inline"}),oQ=ct.create({name:"doc",topNode:!0,content:"block+"}),sQ=Nt.create({name:"subscript",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"sub"},{style:"vertical-align",getAttrs(t){return t!=="sub"?!1:null}}]},renderHTML({HTMLAttributes:t}){return["sub",Be(this.options.HTMLAttributes,t),0]},addCommands(){return{setSubscript:()=>({commands:t})=>t.setMark(this.name),toggleSubscript:()=>({commands:t})=>t.toggleMark(this.name),unsetSubscript:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-,":()=>this.editor.commands.toggleSubscript()}}}),aQ=Nt.create({name:"superscript",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"sup"},{style:"vertical-align",getAttrs(t){return t!=="super"?!1:null}}]},renderHTML({HTMLAttributes:t}){return["sup",Be(this.options.HTMLAttributes,t),0]},addCommands(){return{setSuperscript:()=>({commands:t})=>t.setMark(this.name),toggleSuperscript:()=>({commands:t})=>t.toggleMark(this.name),unsetSuperscript:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-.":()=>this.editor.commands.toggleSuperscript()}}});function lQ(t){var e;const{char:r,allowSpaces:n,allowedPrefixes:i,startOfLine:o,$position:s}=t,a=UF(r),l=new RegExp(`\\s${a}$`),c=o?"^":"",u=n?new RegExp(`${c}${a}.*?(?=\\s${a}|$)`,"gm"):new RegExp(`${c}(?:^)?${a}[^\\s${a}]*`,"gm"),f=((e=s.nodeBefore)===null||e===void 0?void 0:e.isText)&&s.nodeBefore.text;if(!f)return null;const d=s.pos-f.length,h=Array.from(f.matchAll(u)).pop();if(!h||h.input===void 0||h.index===void 0)return null;const p=h.input.slice(Math.max(0,h.index-1),h.index),m=new RegExp(`^[${i==null?void 0:i.join("")}\0]?$`).test(p);if(i!==null&&!m)return null;const y=d+h.index;let g=y+h[0].length;return n&&l.test(f.slice(g-1,g+1))&&(h[0]+=" ",g+=1),y<s.pos&&g>=s.pos?{range:{from:y,to:g},query:h[0].slice(r.length),text:h[0]}:null}const cQ=new et("suggestion");function uQ({pluginKey:t=cQ,editor:e,char:r="@",allowSpaces:n=!1,allowedPrefixes:i=[" "],startOfLine:o=!1,decorationTag:s="span",decorationClass:a="suggestion",command:l=()=>null,items:c=()=>[],render:u=()=>({}),allow:f=()=>!0,findSuggestionMatch:d=lQ}){let h;const p=u==null?void 0:u(),m=new tt({key:t,view(){return{update:async(y,g)=>{var b,S,x,O,M,D,$;const A=(b=this.key)===null||b===void 0?void 0:b.getState(g),V=(S=this.key)===null||S===void 0?void 0:S.getState(y.state),Q=A.active&&V.active&&A.range.from!==V.range.from,I=!A.active&&V.active,U=A.active&&!V.active,k=!I&&!U&&A.query!==V.query,G=I,te=k||Q,W=U;if(!G&&!te&&!W)return;const ae=W&&!G?A:V,X=y.dom.querySelector(`[data-decoration-id="${ae.decorationId}"]`);h={editor:e,range:ae.range,query:ae.query,text:ae.text,items:[],command:de=>l({editor:e,range:ae.range,props:de}),decorationNode:X,clientRect:X?()=>{var de;const{decorationId:q}=(de=this.key)===null||de===void 0?void 0:de.getState(e.state),N=y.dom.querySelector(`[data-decoration-id="${q}"]`);return(N==null?void 0:N.getBoundingClientRect())||null}:null},G&&((x=p==null?void 0:p.onBeforeStart)===null||x===void 0||x.call(p,h)),te&&((O=p==null?void 0:p.onBeforeUpdate)===null||O===void 0||O.call(p,h)),(te||G)&&(h.items=await c({editor:e,query:ae.query})),W&&((M=p==null?void 0:p.onExit)===null||M===void 0||M.call(p,h)),te&&((D=p==null?void 0:p.onUpdate)===null||D===void 0||D.call(p,h)),G&&(($=p==null?void 0:p.onStart)===null||$===void 0||$.call(p,h))},destroy:()=>{var y;h&&((y=p==null?void 0:p.onExit)===null||y===void 0||y.call(p,h))}}},state:{init(){return{active:!1,range:{from:0,to:0},query:null,text:null,composing:!1}},apply(y,g,b,S){const{isEditable:x}=e,{composing:O}=e.view,{selection:M}=y,{empty:D,from:$}=M,A={...g};if(A.composing=O,x&&(D||e.view.composing)){($<g.range.from||$>g.range.to)&&!O&&!g.composing&&(A.active=!1);const V=d({char:r,allowSpaces:n,allowedPrefixes:i,startOfLine:o,$position:M.$from}),Q=`id_${Math.floor(Math.random()*4294967295)}`;V&&f({editor:e,state:S,range:V.range,isActive:g.active})?(A.active=!0,A.decorationId=g.decorationId?g.decorationId:Q,A.range=V.range,A.query=V.query,A.text=V.text):A.active=!1}else A.active=!1;return A.active||(A.decorationId=null,A.range={from:0,to:0},A.query=null,A.text=null),A}},props:{handleKeyDown(y,g){var b;const{active:S,range:x}=m.getState(y.state);return S&&((b=p==null?void 0:p.onKeyDown)===null||b===void 0?void 0:b.call(p,{view:y,event:g,range:x}))||!1},decorations(y){const{active:g,range:b,decorationId:S}=m.getState(y);return g?Ke.create(y.doc,[gt.inline(b.from,b.to,{nodeName:s,class:a,"data-decoration-id":S})]):null}}});return m}const fQ=/(?:^|\s)(!\[(.+|:?)]\((\S+)(?:(?:\s+)["'](\S+)["'])?\))$/,dQ=ct.create({name:"image",addOptions(){return{inline:!1,allowBase64:!1,HTMLAttributes:{}}},inline(){return this.options.inline},group(){return this.options.inline?"inline":"block"},draggable:!0,addAttributes(){return{src:{default:null},alt:{default:null},title:{default:null}}},parseHTML(){return[{tag:this.options.allowBase64?"img[src]":'img[src]:not([src^="data:"])'}]},renderHTML({HTMLAttributes:t}){return["img",Be(this.options.HTMLAttributes,t)]},addCommands(){return{setImage:t=>({commands:e})=>e.insertContent({type:this.name,attrs:t})}},addInputRules(){return[xy({find:fQ,type:this.type,getAttributes:t=>{const[,,e,r,n]=t;return{src:r,alt:e,title:n}}})]}}),hQ=ct.create({name:"tableRow",addOptions(){return{HTMLAttributes:{}}},content:"(tableCell | tableHeader)*",tableRole:"row",parseHTML(){return[{tag:"tr"}]},renderHTML({HTMLAttributes:t}){return["tr",Be(this.options.HTMLAttributes,t),0]}});var $g,jg;if(typeof WeakMap<"u"){let t=new WeakMap;$g=e=>t.get(e),jg=(e,r)=>(t.set(e,r),r)}else{const t=[];let r=0;$g=n=>{for(let i=0;i<t.length;i+=2)if(t[i]==n)return t[i+1]},jg=(n,i)=>(r==10&&(r=0),t[r++]=n,t[r++]=i)}var ot=class{constructor(t,e,r,n){this.width=t,this.height=e,this.map=r,this.problems=n}findCell(t){for(let e=0;e<this.map.length;e++){const r=this.map[e];if(r!=t)continue;const n=e%this.width,i=e/this.width|0;let o=n+1,s=i+1;for(let a=1;o<this.width&&this.map[e+a]==r;a++)o++;for(let a=1;s<this.height&&this.map[e+this.width*a]==r;a++)s++;return{left:n,top:i,right:o,bottom:s}}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,r){const{left:n,right:i,top:o,bottom:s}=this.findCell(t);return e=="horiz"?(r<0?n==0:i==this.width)?null:this.map[o*this.width+(r<0?n-1:i)]:(r<0?o==0:s==this.height)?null:this.map[n+this.width*(r<0?o-1:s)]}rectBetween(t,e){const{left:r,right:n,top:i,bottom:o}=this.findCell(t),{left:s,right:a,top:l,bottom:c}=this.findCell(e);return{left:Math.min(r,s),top:Math.min(i,l),right:Math.max(n,a),bottom:Math.max(o,c)}}cellsInRect(t){const e=[],r={};for(let n=t.top;n<t.bottom;n++)for(let i=t.left;i<t.right;i++){const o=n*this.width+i,s=this.map[o];r[s]||(r[s]=!0,!(i==t.left&&i&&this.map[o-1]==s||n==t.top&&n&&this.map[o-this.width]==s)&&e.push(s))}return e}positionAt(t,e,r){for(let n=0,i=0;;n++){const o=i+r.child(n).nodeSize;if(n==t){let s=e+t*this.width;const a=(t+1)*this.width;for(;s<a&&this.map[s]<i;)s++;return s==a?o-1:this.map[s]}i=o}}static get(t){return $g(t)||jg(t,pQ(t))}};function pQ(t){if(t.type.spec.tableRole!="table")throw new RangeError("Not a table node: "+t.type.name);const e=mQ(t),r=t.childCount,n=[];let i=0,o=null;const s=[];for(let c=0,u=e*r;c<u;c++)n[c]=0;for(let c=0,u=0;c<r;c++){const f=t.child(c);u++;for(let p=0;;p++){for(;i<n.length&&n[i]!=0;)i++;if(p==f.childCount)break;const m=f.child(p),{colspan:y,rowspan:g,colwidth:b}=m.attrs;for(let S=0;S<g;S++){if(S+c>=r){(o||(o=[])).push({type:"overlong_rowspan",pos:u,n:g-S});break}const x=i+S*e;for(let O=0;O<y;O++){n[x+O]==0?n[x+O]=u:(o||(o=[])).push({type:"collision",row:c,pos:u,n:y-O});const M=b&&b[O];if(M){const D=(x+O)%e*2,$=s[D];$==null||$!=M&&s[D+1]==1?(s[D]=M,s[D+1]=1):$==M&&s[D+1]++}}}i+=y,u+=m.nodeSize}const d=(c+1)*e;let h=0;for(;i<d;)n[i++]==0&&h++;h&&(o||(o=[])).push({type:"missing",row:c,n:h}),u++}const a=new ot(e,r,n,o);let l=!1;for(let c=0;!l&&c<s.length;c+=2)s[c]!=null&&s[c+1]<r&&(l=!0);return l&&gQ(a,s,t),a}function mQ(t){let e=-1,r=!1;for(let n=0;n<t.childCount;n++){const i=t.child(n);let o=0;if(r)for(let s=0;s<n;s++){const a=t.child(s);for(let l=0;l<a.childCount;l++){const c=a.child(l);s+c.attrs.rowspan>n&&(o+=c.attrs.colspan)}}for(let s=0;s<i.childCount;s++){const a=i.child(s);o+=a.attrs.colspan,a.attrs.rowspan>1&&(r=!0)}e==-1?e=o:e!=o&&(e=Math.max(e,o))}return e}function gQ(t,e,r){t.problems||(t.problems=[]);const n={};for(let i=0;i<t.map.length;i++){const o=t.map[i];if(n[o])continue;n[o]=!0;const s=r.nodeAt(o);if(!s)throw new RangeError(`No cell with offset ${o} found`);let a=null;const l=s.attrs;for(let c=0;c<l.colspan;c++){const u=(i+c)%t.width,f=e[u*2];f!=null&&(!l.colwidth||l.colwidth[c]!=f)&&((a||(a=yQ(l)))[c]=f)}a&&t.problems.unshift({type:"colwidth mismatch",pos:o,colwidth:a})}}function yQ(t){if(t.colwidth)return t.colwidth.slice();const e=[];for(let r=0;r<t.colspan;r++)e.push(0);return e}function Lt(t){let e=t.cached.tableNodeTypes;if(!e){e=t.cached.tableNodeTypes={};for(const r in t.nodes){const n=t.nodes[r],i=n.spec.tableRole;i&&(e[i]=n)}}return e}var ei=new et("selectingCells");function js(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 vQ(t){for(let e=t.depth;e>0;e--){const r=t.node(e).type.spec.tableRole;if(r==="cell"||r==="header_cell")return t.node(e)}return null}function Or(t){const e=t.selection.$head;for(let r=e.depth;r>0;r--)if(e.node(r).type.spec.tableRole=="row")return!0;return!1}function md(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 r=js(e.$head)||wQ(e.$head);if(r)return r;throw new RangeError(`No cell found around position ${e.head}`)}function wQ(t){for(let e=t.nodeAfter,r=t.pos;e;e=e.firstChild,r++){const n=e.type.spec.tableRole;if(n=="cell"||n=="header_cell")return t.doc.resolve(r)}for(let e=t.nodeBefore,r=t.pos;e;e=e.lastChild,r--){const n=e.type.spec.tableRole;if(n=="cell"||n=="header_cell")return t.doc.resolve(r-e.nodeSize)}}function Hg(t){return t.parent.type.spec.tableRole=="row"&&!!t.nodeAfter}function bQ(t){return t.node(0).resolve(t.pos+t.nodeAfter.nodeSize)}function nw(t,e){return t.depth==e.depth&&t.pos>=e.start(-1)&&t.pos<=e.end(-1)}function dM(t,e,r){const n=t.node(-1),i=ot.get(n),o=t.start(-1),s=i.nextCell(t.pos-o,e,r);return s==null?null:t.node(0).resolve(o+s)}function ao(t,e,r=1){const n={...t,colspan:t.colspan-r};return n.colwidth&&(n.colwidth=n.colwidth.slice(),n.colwidth.splice(e,r),n.colwidth.some(i=>i>0)||(n.colwidth=null)),n}function hM(t,e,r=1){const n={...t,colspan:t.colspan+r};if(n.colwidth){n.colwidth=n.colwidth.slice();for(let i=0;i<r;i++)n.colwidth.splice(e,0,0)}return n}function xQ(t,e,r){const n=Lt(e.type.schema).header_cell;for(let i=0;i<t.height;i++)if(e.nodeAt(t.map[r+i*t.width]).type!=n)return!1;return!0}var qe=class pn extends Re{constructor(e,r=e){const n=e.node(-1),i=ot.get(n),o=e.start(-1),s=i.rectBetween(e.pos-o,r.pos-o),a=e.node(0),l=i.cellsInRect(s).filter(u=>u!=r.pos-o);l.unshift(r.pos-o);const c=l.map(u=>{const f=n.nodeAt(u);if(!f)throw RangeError(`No cell with offset ${u} found`);const d=o+u+1;return new iy(a.resolve(d),a.resolve(d+f.content.size))});super(c[0].$from,c[0].$to,c),this.$anchorCell=e,this.$headCell=r}map(e,r){const n=e.resolve(r.map(this.$anchorCell.pos)),i=e.resolve(r.map(this.$headCell.pos));if(Hg(n)&&Hg(i)&&nw(n,i)){const o=this.$anchorCell.node(-1)!=n.node(-1);return o&&this.isRowSelection()?pn.rowSelection(n,i):o&&this.isColSelection()?pn.colSelection(n,i):new pn(n,i)}return _e.between(n,i)}content(){const e=this.$anchorCell.node(-1),r=ot.get(e),n=this.$anchorCell.start(-1),i=r.rectBetween(this.$anchorCell.pos-n,this.$headCell.pos-n),o={},s=[];for(let l=i.top;l<i.bottom;l++){const c=[];for(let u=l*r.width+i.left,f=i.left;f<i.right;f++,u++){const d=r.map[u];if(o[d])continue;o[d]=!0;const h=r.findCell(d);let p=e.nodeAt(d);if(!p)throw RangeError(`No cell with offset ${d} found`);const m=i.left-h.left,y=h.right-i.right;if(m>0||y>0){let g=p.attrs;if(m>0&&(g=ao(g,0,m)),y>0&&(g=ao(g,g.colspan-y,y)),h.left<i.left){if(p=p.type.createAndFill(g),!p)throw RangeError(`Could not create cell with attrs ${JSON.stringify(g)}`)}else p=p.type.create(g,p.content)}if(h.top<i.top||h.bottom>i.bottom){const g={...p.attrs,rowspan:Math.min(h.bottom,i.bottom)-Math.max(h.top,i.top)};h.top<i.top?p=p.type.createAndFill(g):p=p.type.create(g,p.content)}c.push(p)}s.push(e.child(l).copy(he.from(c)))}const a=this.isColSelection()&&this.isRowSelection()?e:s;return new we(he.from(a),1,1)}replace(e,r=we.empty){const n=e.steps.length,i=this.ranges;for(let s=0;s<i.length;s++){const{$from:a,$to:l}=i[s],c=e.mapping.slice(n);e.replace(c.map(a.pos),c.map(l.pos),s?we.empty:r)}const o=Re.findFrom(e.doc.resolve(e.mapping.slice(n).map(this.to)),-1);o&&e.setSelection(o)}replaceWith(e,r){this.replace(e,new we(he.from(r),0,0))}forEachCell(e){const r=this.$anchorCell.node(-1),n=ot.get(r),i=this.$anchorCell.start(-1),o=n.cellsInRect(n.rectBetween(this.$anchorCell.pos-i,this.$headCell.pos-i));for(let s=0;s<o.length;s++)e(r.nodeAt(o[s]),i+o[s])}isColSelection(){const e=this.$anchorCell.index(-1),r=this.$headCell.index(-1);if(Math.min(e,r)>0)return!1;const n=e+this.$anchorCell.nodeAfter.attrs.rowspan,i=r+this.$headCell.nodeAfter.attrs.rowspan;return Math.max(n,i)==this.$headCell.node(-1).childCount}static colSelection(e,r=e){const n=e.node(-1),i=ot.get(n),o=e.start(-1),s=i.findCell(e.pos-o),a=i.findCell(r.pos-o),l=e.node(0);return s.top<=a.top?(s.top>0&&(e=l.resolve(o+i.map[s.left])),a.bottom<i.height&&(r=l.resolve(o+i.map[i.width*(i.height-1)+a.right-1]))):(a.top>0&&(r=l.resolve(o+i.map[a.left])),s.bottom<i.height&&(e=l.resolve(o+i.map[i.width*(i.height-1)+s.right-1]))),new pn(e,r)}isRowSelection(){const e=this.$anchorCell.node(-1),r=ot.get(e),n=this.$anchorCell.start(-1),i=r.colCount(this.$anchorCell.pos-n),o=r.colCount(this.$headCell.pos-n);if(Math.min(i,o)>0)return!1;const s=i+this.$anchorCell.nodeAfter.attrs.colspan,a=o+this.$headCell.nodeAfter.attrs.colspan;return Math.max(s,a)==r.width}eq(e){return e instanceof pn&&e.$anchorCell.pos==this.$anchorCell.pos&&e.$headCell.pos==this.$headCell.pos}static rowSelection(e,r=e){const n=e.node(-1),i=ot.get(n),o=e.start(-1),s=i.findCell(e.pos-o),a=i.findCell(r.pos-o),l=e.node(0);return s.left<=a.left?(s.left>0&&(e=l.resolve(o+i.map[s.top*i.width])),a.right<i.width&&(r=l.resolve(o+i.map[i.width*(a.top+1)-1]))):(a.left>0&&(r=l.resolve(o+i.map[a.top*i.width])),s.right<i.width&&(e=l.resolve(o+i.map[i.width*(s.top+1)-1]))),new pn(e,r)}toJSON(){return{type:"cell",anchor:this.$anchorCell.pos,head:this.$headCell.pos}}static fromJSON(e,r){return new pn(e.resolve(r.anchor),e.resolve(r.head))}static create(e,r,n=r){return new pn(e.resolve(r),e.resolve(n))}getBookmark(){return new SQ(this.$anchorCell.pos,this.$headCell.pos)}};qe.prototype.visible=!1;Re.jsonID("cell",qe);var SQ=class pM{constructor(e,r){this.anchor=e,this.head=r}map(e){return new pM(e.map(this.anchor),e.map(this.head))}resolve(e){const r=e.resolve(this.anchor),n=e.resolve(this.head);return r.parent.type.spec.tableRole=="row"&&n.parent.type.spec.tableRole=="row"&&r.index()<r.parent.childCount&&n.index()<n.parent.childCount&&nw(r,n)?new qe(r,n):Re.near(n,1)}};function EQ(t){if(!(t.selection instanceof qe))return null;const e=[];return t.selection.forEachCell((r,n)=>{e.push(gt.node(n,n+r.nodeSize,{class:"selectedCell"}))}),Ke.create(t.doc,e)}function TQ({$from:t,$to:e}){if(t.pos==e.pos||t.pos<t.pos-6)return!1;let r=t.pos,n=e.pos,i=t.depth;for(;i>=0&&!(t.after(i+1)<t.end(i));i--,r++);for(let o=e.depth;o>=0&&!(e.before(o+1)>e.start(o));o--,n--);return r==n&&/row|table/.test(t.node(i).type.spec.tableRole)}function AQ({$from:t,$to:e}){let r,n;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"){r=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"){n=o;break}}return r!==n&&e.parentOffset===0}function CQ(t,e,r){const n=(e||t).selection,i=(e||t).doc;let o,s;if(n instanceof ke&&(s=n.node.type.spec.tableRole)){if(s=="cell"||s=="header_cell")o=qe.create(i,n.from);else if(s=="row"){const a=i.resolve(n.from+1);o=qe.rowSelection(a,a)}else if(!r){const a=ot.get(n.node),l=n.from+1,c=l+a.map[a.width*a.height-1];o=qe.create(i,l+1,c)}}else n instanceof _e&&TQ(n)?o=_e.create(i,n.from):n instanceof _e&&AQ(n)&&(o=_e.create(i,n.$from.start(),n.$from.end()));return o&&(e||(e=t.tr)).setSelection(o),e}var kQ=new et("fix-tables");function mM(t,e,r,n){const i=t.childCount,o=e.childCount;e:for(let s=0,a=0;s<o;s++){const l=e.child(s);for(let c=a,u=Math.min(i,s+3);c<u;c++)if(t.child(c)==l){a=c+1,r+=l.nodeSize;continue e}n(l,r),a<i&&t.child(a).sameMarkup(l)?mM(t.child(a),l,r+1,n):l.nodesBetween(0,l.content.size,n,r+1),r+=l.nodeSize}}function gM(t,e){let r;const n=(i,o)=>{i.type.spec.tableRole=="table"&&(r=_Q(t,i,o,r))};return e?e.doc!=t.doc&&mM(e.doc,t.doc,0,n):t.doc.descendants(n),r}function _Q(t,e,r,n){const i=ot.get(e);if(!i.problems)return n;n||(n=t.tr);const o=[];for(let l=0;l<i.height;l++)o.push(0);for(let l=0;l<i.problems.length;l++){const c=i.problems[l];if(c.type=="collision"){const u=e.nodeAt(c.pos);if(!u)continue;const f=u.attrs;for(let d=0;d<f.rowspan;d++)o[c.row+d]+=c.n;n.setNodeMarkup(n.mapping.map(r+1+c.pos),null,ao(f,f.colspan-c.n,c.n))}else if(c.type=="missing")o[c.row]+=c.n;else if(c.type=="overlong_rowspan"){const u=e.nodeAt(c.pos);if(!u)continue;n.setNodeMarkup(n.mapping.map(r+1+c.pos),null,{...u.attrs,rowspan:u.attrs.rowspan-c.n})}else if(c.type=="colwidth mismatch"){const u=e.nodeAt(c.pos);if(!u)continue;n.setNodeMarkup(n.mapping.map(r+1+c.pos),null,{...u.attrs,colwidth:c.colwidth})}}let s,a;for(let l=0;l<o.length;l++)o[l]&&(s==null&&(s=l),a=l);for(let l=0,c=r+1;l<i.height;l++){const u=e.child(l),f=c+u.nodeSize,d=o[l];if(d>0){let h="cell";u.firstChild&&(h=u.firstChild.type.spec.tableRole);const p=[];for(let y=0;y<d;y++){const g=Lt(t.schema)[h].createAndFill();g&&p.push(g)}const m=(l==0||s==l-1)&&a==l?c+1:f-1;n.insert(n.mapping.map(m),p)}c=f}return n.setMeta(kQ,{fixTables:!0})}function OQ(t){if(!t.size)return null;let{content:e,openStart:r,openEnd:n}=t;for(;e.childCount==1&&(r>0&&n>0||e.child(0).type.spec.tableRole=="table");)r--,n--,e=e.child(0).content;const i=e.child(0),o=i.type.spec.tableRole,s=i.type.schema,a=[];if(o=="row")for(let l=0;l<e.childCount;l++){let c=e.child(l).content;const u=l?0:Math.max(0,r-1),f=l<e.childCount-1?0:Math.max(0,n-1);(u||f)&&(c=zg(Lt(s).row,new we(c,u,f)).content),a.push(c)}else if(o=="cell"||o=="header_cell")a.push(r||n?zg(Lt(s).row,new we(e,r,n)).content:e);else return null;return RQ(s,a)}function RQ(t,e){const r=[];for(let i=0;i<e.length;i++){const o=e[i];for(let s=o.childCount-1;s>=0;s--){const{rowspan:a,colspan:l}=o.child(s).attrs;for(let c=i;c<i+a;c++)r[c]=(r[c]||0)+l}}let n=0;for(let i=0;i<r.length;i++)n=Math.max(n,r[i]);for(let i=0;i<r.length;i++)if(i>=e.length&&e.push(he.empty),r[i]<n){const o=Lt(t).cell.createAndFill(),s=[];for(let a=r[i];a<n;a++)s.push(o);e[i]=e[i].append(he.from(s))}return{height:e.length,width:n,rows:e}}function zg(t,e){const r=t.createAndFill();return new ny(r).replace(0,r.content.size,e).doc}function MQ({width:t,height:e,rows:r},n,i){if(t!=n){const o=[],s=[];for(let a=0;a<r.length;a++){const l=r[a],c=[];for(let u=o[a]||0,f=0;u<n;f++){let d=l.child(f%l.childCount);u+d.attrs.colspan>n&&(d=d.type.createChecked(ao(d.attrs,d.attrs.colspan,u+d.attrs.colspan-n),d.content)),c.push(d),u+=d.attrs.colspan;for(let h=1;h<d.attrs.rowspan;h++)o[a+h]=(o[a+h]||0)+d.attrs.colspan}s.push(he.from(c))}r=s,t=n}if(e!=i){const o=[];for(let s=0,a=0;s<i;s++,a++){const l=[],c=r[a%e];for(let u=0;u<c.childCount;u++){let f=c.child(u);s+f.attrs.rowspan>i&&(f=f.type.create({...f.attrs,rowspan:Math.max(1,i-f.attrs.rowspan)},f.content)),l.push(f)}o.push(he.from(l))}r=o,e=i}return{width:t,height:e,rows:r}}function IQ(t,e,r,n,i,o,s){const a=t.doc.type.schema,l=Lt(a);let c,u;if(i>e.width)for(let f=0,d=0;f<e.height;f++){const h=r.child(f);d+=h.nodeSize;const p=[];let m;h.lastChild==null||h.lastChild.type==l.cell?m=c||(c=l.cell.createAndFill()):m=u||(u=l.header_cell.createAndFill());for(let y=e.width;y<i;y++)p.push(m);t.insert(t.mapping.slice(s).map(d-1+n),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 y=p>=e.width?!1:r.nodeAt(e.map[m+p]).type==l.header_cell;f.push(y?u||(u=l.header_cell.createAndFill()):c||(c=l.cell.createAndFill()))}const d=l.row.create(null,he.from(f)),h=[];for(let p=e.height;p<o;p++)h.push(d);t.insert(t.mapping.slice(s).map(n+r.nodeSize-2),h)}return!!(c||u)}function mS(t,e,r,n,i,o,s,a){if(s==0||s==e.height)return!1;let l=!1;for(let c=i;c<o;c++){const u=s*e.width+c,f=e.map[u];if(e.map[u-e.width]==f){l=!0;const d=r.nodeAt(f),{top:h,left:p}=e.findCell(f);t.setNodeMarkup(t.mapping.slice(a).map(f+n),null,{...d.attrs,rowspan:s-h}),t.insert(t.mapping.slice(a).map(e.positionAt(s,p,r)),d.type.createAndFill({...d.attrs,rowspan:h+d.attrs.rowspan-s})),c+=d.attrs.colspan-1}}return l}function gS(t,e,r,n,i,o,s,a){if(s==0||s==e.width)return!1;let l=!1;for(let c=i;c<o;c++){const u=c*e.width+s,f=e.map[u];if(e.map[u-1]==f){l=!0;const d=r.nodeAt(f),h=e.colCount(f),p=t.mapping.slice(a).map(f+n);t.setNodeMarkup(p,null,ao(d.attrs,s-h,d.attrs.colspan-(s-h))),t.insert(p+d.nodeSize,d.type.createAndFill(ao(d.attrs,0,s-h))),c+=d.attrs.rowspan-1}}return l}function yS(t,e,r,n,i){let o=r?t.doc.nodeAt(r-1):t.doc;if(!o)throw new Error("No table found");let s=ot.get(o);const{top:a,left:l}=n,c=l+i.width,u=a+i.height,f=t.tr;let d=0;function h(){if(o=r?f.doc.nodeAt(r-1):f.doc,!o)throw new Error("No table found");s=ot.get(o),d=f.mapping.maps.length}IQ(f,s,o,r,c,u,d)&&h(),mS(f,s,o,r,l,c,a,d)&&h(),mS(f,s,o,r,l,c,u,d)&&h(),gS(f,s,o,r,a,u,l,d)&&h(),gS(f,s,o,r,a,u,c,d)&&h();for(let p=a;p<u;p++){const m=s.positionAt(p,l,o),y=s.positionAt(p,c,o);f.replace(f.mapping.slice(d).map(m+r),f.mapping.slice(d).map(y+r),new we(i.rows[p-a],0,0))}h(),f.setSelection(new qe(f.doc.resolve(r+s.positionAt(a,l,o)),f.doc.resolve(r+s.positionAt(u-1,c-1,o)))),e(f)}var NQ=py({ArrowLeft:oc("horiz",-1),ArrowRight:oc("horiz",1),ArrowUp:oc("vert",-1),ArrowDown:oc("vert",1),"Shift-ArrowLeft":sc("horiz",-1),"Shift-ArrowRight":sc("horiz",1),"Shift-ArrowUp":sc("vert",-1),"Shift-ArrowDown":sc("vert",1),Backspace:ac,"Mod-Backspace":ac,Delete:ac,"Mod-Delete":ac});function Hc(t,e,r){return r.eq(t.selection)?!1:(e&&e(t.tr.setSelection(r).scrollIntoView()),!0)}function oc(t,e){return(r,n,i)=>{if(!i)return!1;const o=r.selection;if(o instanceof qe)return Hc(r,n,Re.near(o.$headCell,e));if(t!="horiz"&&!o.empty)return!1;const s=yM(i,t,e);if(s==null)return!1;if(t=="horiz")return Hc(r,n,Re.near(r.doc.resolve(o.head+e),e));{const a=r.doc.resolve(s),l=dM(a,t,e);let c;return l?c=Re.near(l,1):e<0?c=Re.near(r.doc.resolve(a.before(-1)),-1):c=Re.near(r.doc.resolve(a.after(-1)),1),Hc(r,n,c)}}}function sc(t,e){return(r,n,i)=>{if(!i)return!1;const o=r.selection;let s;if(o instanceof qe)s=o;else{const l=yM(i,t,e);if(l==null)return!1;s=new qe(r.doc.resolve(l))}const a=dM(s.$headCell,t,e);return a?Hc(r,n,new qe(s.$anchorCell,a)):!1}}function ac(t,e){const r=t.selection;if(!(r instanceof qe))return!1;if(e){const n=t.tr,i=Lt(t.schema).cell.createAndFill().content;r.forEachCell((o,s)=>{o.content.eq(i)||n.replace(n.mapping.map(s+1),n.mapping.map(s+o.nodeSize-1),new we(i,0,0))}),n.docChanged&&e(n)}return!0}function DQ(t,e){const r=t.state.doc,n=js(r.resolve(e));return n?(t.dispatch(t.state.tr.setSelection(new qe(n))),!0):!1}function PQ(t,e,r){if(!Or(t.state))return!1;let n=OQ(r);const i=t.state.selection;if(i instanceof qe){n||(n={width:1,height:1,rows:[he.from(zg(Lt(t.state.schema).cell,r))]});const o=i.$anchorCell.node(-1),s=i.$anchorCell.start(-1),a=ot.get(o).rectBetween(i.$anchorCell.pos-s,i.$headCell.pos-s);return n=MQ(n,a.right-a.left,a.bottom-a.top),yS(t.state,t.dispatch,s,a,n),!0}else if(n){const o=md(t.state),s=o.start(-1);return yS(t.state,t.dispatch,s,ot.get(o.node(-1)).findCell(o.pos-s),n),!0}else return!1}function LQ(t,e){var r;if(e.ctrlKey||e.metaKey)return;const n=vS(t,e.target);let i;if(e.shiftKey&&t.state.selection instanceof qe)o(t.state.selection.$anchorCell,e),e.preventDefault();else if(e.shiftKey&&n&&(i=js(t.state.selection.$anchor))!=null&&((r=Qh(t,e))==null?void 0:r.pos)!=i.pos)o(i,e),e.preventDefault();else if(!n)return;function o(l,c){let u=Qh(t,c);const f=ei.getState(t.state)==null;if(!u||!nw(l,u))if(f)u=l;else return;const d=new qe(l,u);if(f||!t.state.selection.eq(d)){const h=t.state.tr.setSelection(d);f&&h.setMeta(ei,l.pos),t.dispatch(h)}}function s(){t.root.removeEventListener("mouseup",s),t.root.removeEventListener("dragstart",s),t.root.removeEventListener("mousemove",a),ei.getState(t.state)!=null&&t.dispatch(t.state.tr.setMeta(ei,-1))}function a(l){const c=l,u=ei.getState(t.state);let f;if(u!=null)f=t.state.doc.resolve(u);else if(vS(t,c.target)!=n&&(f=Qh(t,e),!f))return s();f&&o(f,c)}t.root.addEventListener("mouseup",s),t.root.addEventListener("dragstart",s),t.root.addEventListener("mousemove",a)}function yM(t,e,r){if(!(t.state.selection instanceof _e))return null;const{$head:n}=t.state.selection;for(let i=n.depth-1;i>=0;i--){const o=n.node(i);if((r<0?n.index(i):n.indexAfter(i))!=(r<0?0:o.childCount))return null;if(o.type.spec.tableRole=="cell"||o.type.spec.tableRole=="header_cell"){const a=n.before(i),l=e=="vert"?r>0?"down":"up":r>0?"right":"left";return t.endOfTextblock(l)?a:null}}return null}function vS(t,e){for(;e&&e!=t.dom;e=e.parentNode)if(e.nodeName=="TD"||e.nodeName=="TH")return e;return null}function Qh(t,e){const r=t.posAtCoords({left:e.clientX,top:e.clientY});return r&&r?js(t.state.doc.resolve(r.pos)):null}var FQ=class{constructor(e,r){this.node=e,this.cellMinWidth=r,this.dom=document.createElement("div"),this.dom.className="tableWrapper",this.table=this.dom.appendChild(document.createElement("table")),this.colgroup=this.table.appendChild(document.createElement("colgroup")),Ug(e,this.colgroup,this.table,r),this.contentDOM=this.table.appendChild(document.createElement("tbody"))}update(e){return e.type!=this.node.type?!1:(this.node=e,Ug(e,this.colgroup,this.table,this.cellMinWidth),!0)}ignoreMutation(e){return e.type=="attributes"&&(e.target==this.table||this.colgroup.contains(e.target))}};function Ug(t,e,r,n,i,o){var s;let a=0,l=!0,c=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 y=i==d?o:p&&p[m],g=y?y+"px":"";a+=y||n,y||(l=!1),c?(c.style.width!=g&&(c.style.width=g),c=c.nextSibling):e.appendChild(document.createElement("col")).style.width=g}}for(;c;){const f=c.nextSibling;(s=c.parentNode)==null||s.removeChild(c),c=f}l?(r.style.width=a+"px",r.style.minWidth=""):(r.style.width="",r.style.minWidth=a+"px")}}var dr=new et("tableColumnResizing");function BQ({handleWidth:t=5,cellMinWidth:e=25,View:r=FQ,lastColumnResizable:n=!0}={}){const i=new tt({key:dr,state:{init(o,s){var a,l;const c=(l=(a=i.spec)==null?void 0:a.props)==null?void 0:l.nodeViews,u=Lt(s.schema).table.name;return r&&c&&(c[u]=(f,d)=>new r(f,e,d)),new $Q(-1,!1)},apply(o,s){return s.apply(o)}},props:{attributes:o=>{const s=dr.getState(o);return s&&s.activeHandle>-1?{class:"resize-cursor"}:{}},handleDOMEvents:{mousemove:(o,s)=>{jQ(o,s,t,e,n)},mouseleave:o=>{HQ(o)},mousedown:(o,s)=>{zQ(o,s,e)}},decorations:o=>{const s=dr.getState(o);if(s&&s.activeHandle>-1)return qQ(o,s.activeHandle)},nodeViews:{}}});return i}var $Q=class zc{constructor(e,r){this.activeHandle=e,this.dragging=r}apply(e){const r=this,n=e.getMeta(dr);if(n&&n.setHandle!=null)return new zc(n.setHandle,!1);if(n&&n.setDragging!==void 0)return new zc(r.activeHandle,n.setDragging);if(r.activeHandle>-1&&e.docChanged){let i=e.mapping.map(r.activeHandle,-1);return Hg(e.doc.resolve(i))||(i=-1),new zc(i,r.dragging)}return r}};function jQ(t,e,r,n,i){const o=dr.getState(t.state);if(o&&!o.dragging){const s=WQ(e.target);let a=-1;if(s){const{left:l,right:c}=s.getBoundingClientRect();e.clientX-l<=r?a=wS(t,e,"left",r):c-e.clientX<=r&&(a=wS(t,e,"right",r))}if(a!=o.activeHandle){if(!i&&a!==-1){const l=t.state.doc.resolve(a),c=l.node(-1),u=ot.get(c),f=l.start(-1);if(u.colCount(l.pos-f)+l.nodeAfter.attrs.colspan-1==u.width-1)return}vM(t,a)}}}function HQ(t){const e=dr.getState(t.state);e&&e.activeHandle>-1&&!e.dragging&&vM(t,-1)}function zQ(t,e,r){var n;const i=(n=t.dom.ownerDocument.defaultView)!=null?n:window,o=dr.getState(t.state);if(!o||o.activeHandle==-1||o.dragging)return!1;const s=t.state.doc.nodeAt(o.activeHandle),a=UQ(t,o.activeHandle,s.attrs);t.dispatch(t.state.tr.setMeta(dr,{setDragging:{startX:e.clientX,startWidth:a}}));function l(u){i.removeEventListener("mouseup",l),i.removeEventListener("mousemove",c);const f=dr.getState(t.state);f!=null&&f.dragging&&(VQ(t,f.activeHandle,bS(f.dragging,u,r)),t.dispatch(t.state.tr.setMeta(dr,{setDragging:null})))}function c(u){if(!u.which)return l(u);const f=dr.getState(t.state);if(f&&f.dragging){const d=bS(f.dragging,u,r);GQ(t,f.activeHandle,d,r)}}return i.addEventListener("mouseup",l),i.addEventListener("mousemove",c),e.preventDefault(),!0}function UQ(t,e,{colspan:r,colwidth:n}){const i=n&&n[n.length-1];if(i)return i;const o=t.domAtPos(e);let a=o.node.childNodes[o.offset].offsetWidth,l=r;if(n)for(let c=0;c<r;c++)n[c]&&(a-=n[c],l--);return a/l}function WQ(t){for(;t&&t.nodeName!="TD"&&t.nodeName!="TH";)t=t.classList&&t.classList.contains("ProseMirror")?null:t.parentNode;return t}function wS(t,e,r,n){const i=r=="right"?-n:n,o=t.posAtCoords({left:e.clientX+i,top:e.clientY});if(!o)return-1;const{pos:s}=o,a=js(t.state.doc.resolve(s));if(!a)return-1;if(r=="right")return a.pos;const l=ot.get(a.node(-1)),c=a.start(-1),u=l.map.indexOf(a.pos-c);return u%l.width==0?-1:c+l.map[u-1]}function bS(t,e,r){const n=e.clientX-t.startX;return Math.max(r,t.startWidth+n)}function vM(t,e){t.dispatch(t.state.tr.setMeta(dr,{setHandle:e}))}function VQ(t,e,r){const n=t.state.doc.resolve(e),i=n.node(-1),o=ot.get(i),s=n.start(-1),a=o.colCount(n.pos-s)+n.nodeAfter.attrs.colspan-1,l=t.state.tr;for(let c=0;c<o.height;c++){const u=c*o.width+a;if(c&&o.map[u]==o.map[u-o.width])continue;const f=o.map[u],d=i.nodeAt(f).attrs,h=d.colspan==1?0:a-o.colCount(f);if(d.colwidth&&d.colwidth[h]==r)continue;const p=d.colwidth?d.colwidth.slice():KQ(d.colspan);p[h]=r,l.setNodeMarkup(s+f,null,{...d,colwidth:p})}l.docChanged&&t.dispatch(l)}function GQ(t,e,r,n){const i=t.state.doc.resolve(e),o=i.node(-1),s=i.start(-1),a=ot.get(o).colCount(i.pos-s)+i.nodeAfter.attrs.colspan-1;let l=t.domAtPos(i.start(-1)).node;for(;l&&l.nodeName!="TABLE";)l=l.parentNode;l&&Ug(o,l.firstChild,l,n,a,r)}function KQ(t){return Array(t).fill(0)}function qQ(t,e){const r=[],n=t.doc.resolve(e),i=n.node(-1);if(!i)return Ke.empty;const o=ot.get(i),s=n.start(-1),a=o.colCount(n.pos-s)+n.nodeAfter.attrs.colspan-1;for(let l=0;l<o.height;l++){const c=a+l*o.width;if((a==o.width-1||o.map[c]!=o.map[c+1])&&(l==0||o.map[c]!=o.map[c-o.width])){const u=o.map[c],f=s+u+i.nodeAt(u).nodeSize-1,d=document.createElement("div");d.className="column-resize-handle",r.push(gt.widget(f,d))}}return Ke.create(t.doc,r)}function an(t){const e=t.selection,r=md(t),n=r.node(-1),i=r.start(-1),o=ot.get(n);return{...e instanceof qe?o.rectBetween(e.$anchorCell.pos-i,e.$headCell.pos-i):o.findCell(r.pos-i),tableStart:i,map:o,table:n}}function wM(t,{map:e,tableStart:r,table:n},i){let o=i>0?-1:0;xQ(e,n,i+o)&&(o=i==0||i==e.width?null:0);for(let s=0;s<e.height;s++){const a=s*e.width+i;if(i>0&&i<e.width&&e.map[a-1]==e.map[a]){const l=e.map[a],c=n.nodeAt(l);t.setNodeMarkup(t.mapping.map(r+l),null,hM(c.attrs,i-e.colCount(l))),s+=c.attrs.rowspan-1}else{const l=o==null?Lt(n.type.schema).cell:n.nodeAt(e.map[a+o]).type,c=e.positionAt(s,i,n);t.insert(t.mapping.map(r+c),l.createAndFill())}}return t}function XQ(t,e){if(!Or(t))return!1;if(e){const r=an(t);e(wM(t.tr,r,r.left))}return!0}function JQ(t,e){if(!Or(t))return!1;if(e){const r=an(t);e(wM(t.tr,r,r.right))}return!0}function YQ(t,{map:e,table:r,tableStart:n},i){const o=t.mapping.maps.length;for(let s=0;s<e.height;){const a=s*e.width+i,l=e.map[a],c=r.nodeAt(l),u=c.attrs;if(i>0&&e.map[a-1]==l||i<e.width-1&&e.map[a+1]==l)t.setNodeMarkup(t.mapping.slice(o).map(n+l),null,ao(u,i-e.colCount(l)));else{const f=t.mapping.slice(o).map(n+l);t.delete(f,f+c.nodeSize)}s+=u.rowspan}}function ZQ(t,e){if(!Or(t))return!1;if(e){const r=an(t),n=t.tr;if(r.left==0&&r.right==r.map.width)return!1;for(let i=r.right-1;YQ(n,r,i),i!=r.left;i--){const o=r.tableStart?n.doc.nodeAt(r.tableStart-1):n.doc;if(!o)throw RangeError("No table found");r.table=o,r.map=ot.get(o)}e(n)}return!0}function QQ(t,e,r){var n;const i=Lt(e.type.schema).header_cell;for(let o=0;o<t.width;o++)if(((n=e.nodeAt(t.map[o+r*t.width]))==null?void 0:n.type)!=i)return!1;return!0}function bM(t,{map:e,tableStart:r,table:n},i){var o;let s=r;for(let c=0;c<i;c++)s+=n.child(c).nodeSize;const a=[];let l=i>0?-1:0;QQ(e,n,i+l)&&(l=i==0||i==e.height?null:0);for(let c=0,u=e.width*i;c<e.width;c++,u++)if(i>0&&i<e.height&&e.map[u]==e.map[u-e.width]){const f=e.map[u],d=n.nodeAt(f).attrs;t.setNodeMarkup(r+f,null,{...d,rowspan:d.rowspan+1}),c+=d.colspan-1}else{const f=l==null?Lt(n.type.schema).cell:(o=n.nodeAt(e.map[u+l*e.width]))==null?void 0:o.type,d=f==null?void 0:f.createAndFill();d&&a.push(d)}return t.insert(s,Lt(n.type.schema).row.create(null,a)),t}function eee(t,e){if(!Or(t))return!1;if(e){const r=an(t);e(bM(t.tr,r,r.top))}return!0}function tee(t,e){if(!Or(t))return!1;if(e){const r=an(t);e(bM(t.tr,r,r.bottom))}return!0}function ree(t,{map:e,table:r,tableStart:n},i){let o=0;for(let c=0;c<i;c++)o+=r.child(c).nodeSize;const s=o+r.child(i).nodeSize,a=t.mapping.maps.length;t.delete(o+n,s+n);const l=new Set;for(let c=0,u=i*e.width;c<e.width;c++,u++){const f=e.map[u];if(!l.has(f)){if(l.add(f),i>0&&f==e.map[u-e.width]){const d=r.nodeAt(f).attrs;t.setNodeMarkup(t.mapping.slice(a).map(f+n),null,{...d,rowspan:d.rowspan-1}),c+=d.colspan-1}else if(i<e.height&&f==e.map[u+e.width]){const d=r.nodeAt(f),h=d.attrs,p=d.type.create({...h,rowspan:d.attrs.rowspan-1},d.content),m=e.positionAt(i+1,c,r);t.insert(t.mapping.slice(a).map(n+m),p),c+=h.colspan-1}}}}function nee(t,e){if(!Or(t))return!1;if(e){const r=an(t),n=t.tr;if(r.top==0&&r.bottom==r.map.height)return!1;for(let i=r.bottom-1;ree(n,r,i),i!=r.top;i--){const o=r.tableStart?n.doc.nodeAt(r.tableStart-1):n.doc;if(!o)throw RangeError("No table found");r.table=o,r.map=ot.get(r.table)}e(n)}return!0}function xS(t){const e=t.content;return e.childCount==1&&e.child(0).isTextblock&&e.child(0).childCount==0}function iee({width:t,height:e,map:r},n){let i=n.top*t+n.left,o=i,s=(n.bottom-1)*t+n.left,a=i+(n.right-n.left-1);for(let l=n.top;l<n.bottom;l++){if(n.left>0&&r[o]==r[o-1]||n.right<t&&r[a]==r[a+1])return!0;o+=t,a+=t}for(let l=n.left;l<n.right;l++){if(n.top>0&&r[i]==r[i-t]||n.bottom<e&&r[s]==r[s+t])return!0;i++,s++}return!1}function SS(t,e){const r=t.selection;if(!(r instanceof qe)||r.$anchorCell.pos==r.$headCell.pos)return!1;const n=an(t),{map:i}=n;if(iee(i,n))return!1;if(e){const o=t.tr,s={};let a=he.empty,l,c;for(let u=n.top;u<n.bottom;u++)for(let f=n.left;f<n.right;f++){const d=i.map[u*i.width+f],h=n.table.nodeAt(d);if(!(s[d]||!h))if(s[d]=!0,l==null)l=d,c=h;else{xS(h)||(a=a.append(h.content));const p=o.mapping.map(d+n.tableStart);o.delete(p,p+h.nodeSize)}}if(l==null||c==null)return!0;if(o.setNodeMarkup(l+n.tableStart,null,{...hM(c.attrs,c.attrs.colspan,n.right-n.left-c.attrs.colspan),rowspan:n.bottom-n.top}),a.size){const u=l+1+c.content.size,f=xS(c)?l+1:u;o.replaceWith(f+n.tableStart,u+n.tableStart,a)}o.setSelection(new qe(o.doc.resolve(l+n.tableStart))),e(o)}return!0}function ES(t,e){const r=Lt(t.schema);return oee(({node:n})=>r[n.type.spec.tableRole])(t,e)}function oee(t){return(e,r)=>{var n;const i=e.selection;let o,s;if(i instanceof qe){if(i.$anchorCell.pos!=i.$headCell.pos)return!1;o=i.$anchorCell.nodeAfter,s=i.$anchorCell.pos}else{if(o=vQ(i.$from),!o)return!1;s=(n=js(i.$from))==null?void 0:n.pos}if(o==null||s==null||o.attrs.colspan==1&&o.attrs.rowspan==1)return!1;if(r){let a=o.attrs;const l=[],c=a.colwidth;a.rowspan>1&&(a={...a,rowspan:1}),a.colspan>1&&(a={...a,colspan:1});const u=an(e),f=e.tr;for(let h=0;h<u.right-u.left;h++)l.push(c?{...a,colwidth:c&&c[h]?[c[h]]:null}:a);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,y=0;m<u.right;m++,y++)m==u.left&&h==u.top||f.insert(d=f.mapping.map(p+u.tableStart,1),t({node:o,row:h,col:m}).createAndFill(l[y]))}f.setNodeMarkup(s,t({node:o,row:u.top,col:u.left}),l[0]),i instanceof qe&&f.setSelection(new qe(f.doc.resolve(i.$anchorCell.pos),d?f.doc.resolve(d):void 0)),r(f)}return!0}}function see(t,e){return function(r,n){if(!Or(r))return!1;const i=md(r);if(i.nodeAfter.attrs[t]===e)return!1;if(n){const o=r.tr;r.selection instanceof qe?r.selection.forEachCell((s,a)=>{s.attrs[t]!==e&&o.setNodeMarkup(a,null,{...s.attrs,[t]:e})}):o.setNodeMarkup(i.pos,null,{...i.nodeAfter.attrs,[t]:e}),n(o)}return!0}}function aee(t){return function(e,r){if(!Or(e))return!1;if(r){const n=Lt(e.schema),i=an(e),o=e.tr,s=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),a=s.map(l=>i.table.nodeAt(l));for(let l=0;l<s.length;l++)a[l].type==n.header_cell&&o.setNodeMarkup(i.tableStart+s[l],n.cell,a[l].attrs);if(o.steps.length==0)for(let l=0;l<s.length;l++)o.setNodeMarkup(i.tableStart+s[l],n.header_cell,a[l].attrs);r(o)}return!0}}function TS(t,e,r){const n=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<n.length;i++){const o=e.table.nodeAt(n[i]);if(o&&o.type!==r.header_cell)return!1}return!0}function al(t,e){return e=e||{useDeprecatedLogic:!1},e.useDeprecatedLogic?aee(t):function(r,n){if(!Or(r))return!1;if(n){const i=Lt(r.schema),o=an(r),s=r.tr,a=TS("row",o,i),l=TS("column",o,i),u=(t==="column"?a:t==="row"?l:!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"?l?i.cell:i.header_cell:t=="row"?a?i.cell:i.header_cell:i.cell;o.map.cellsInRect(f).forEach(h=>{const p=h+o.tableStart,m=s.doc.nodeAt(p);m&&s.setNodeMarkup(p,d,m.attrs)}),n(s)}return!0}}al("row",{useDeprecatedLogic:!0});al("column",{useDeprecatedLogic:!0});var lee=al("cell",{useDeprecatedLogic:!0});function cee(t,e){if(e<0){const r=t.nodeBefore;if(r)return t.pos-r.nodeSize;for(let n=t.index(-1)-1,i=t.before();n>=0;n--){const o=t.node(-1).child(n),s=o.lastChild;if(s)return i-1-s.nodeSize;i-=o.nodeSize}}else{if(t.index()<t.parent.childCount-1)return t.pos+t.nodeAfter.nodeSize;const r=t.node(-1);for(let n=t.indexAfter(-1),i=t.after();n<r.childCount;n++){const o=r.child(n);if(o.childCount)return i+1;i+=o.nodeSize}}return null}function AS(t){return function(e,r){if(!Or(e))return!1;const n=cee(md(e),t);if(n==null)return!1;if(r){const i=e.doc.resolve(n);r(e.tr.setSelection(_e.between(i,bQ(i))).scrollIntoView())}return!0}}function uee(t,e){const r=t.selection.$anchor;for(let n=r.depth;n>0;n--)if(r.node(n).type.spec.tableRole=="table")return e&&e(t.tr.delete(r.before(n),r.after(n)).scrollIntoView()),!0;return!1}function fee({allowTableNodeSelection:t=!1}={}){return new tt({key:ei,state:{init(){return null},apply(e,r){const n=e.getMeta(ei);if(n!=null)return n==-1?null:n;if(r==null||!e.docChanged)return r;const{deleted:i,pos:o}=e.mapping.mapResult(r);return i?null:o}},props:{decorations:EQ,handleDOMEvents:{mousedown:LQ},createSelectionBetween(e){return ei.getState(e.state)!=null?e.state.selection:null},handleTripleClick:DQ,handleKeyDown:NQ,handlePaste:PQ},appendTransaction(e,r,n){return CQ(n,gM(n,r),t)}})}function CS(t,e,r,n,i,o){let s=0,a=!0,l=e.firstChild;const c=t.firstChild;for(let u=0,f=0;u<c.childCount;u+=1){const{colspan:d,colwidth:h}=c.child(u).attrs;for(let p=0;p<d;p+=1,f+=1){const m=i===f?o:h&&h[p],y=m?`${m}px`:"";s+=m||n,m||(a=!1),l?(l.style.width!==y&&(l.style.width=y),l=l.nextSibling):e.appendChild(document.createElement("col")).style.width=y}}for(;l;){const u=l.nextSibling;l.parentNode.removeChild(l),l=u}a?(r.style.width=`${s}px`,r.style.minWidth=""):(r.style.width="",r.style.minWidth=`${s}px`)}class dee{constructor(e,r){this.node=e,this.cellMinWidth=r,this.dom=document.createElement("div"),this.dom.className="tableWrapper",this.table=this.dom.appendChild(document.createElement("table")),this.colgroup=this.table.appendChild(document.createElement("colgroup")),CS(e,this.colgroup,this.table,r),this.contentDOM=this.table.appendChild(document.createElement("tbody"))}update(e){return e.type!==this.node.type?!1:(this.node=e,CS(e,this.colgroup,this.table,this.cellMinWidth),!0)}ignoreMutation(e){return e.type==="attributes"&&(e.target===this.table||this.colgroup.contains(e.target))}}function hee(t,e,r,n){let i=0,o=!0;const s=[],a=t.firstChild;if(!a)return{};for(let f=0,d=0;f<a.childCount;f+=1){const{colspan:h,colwidth:p}=a.child(f).attrs;for(let m=0;m<h;m+=1,d+=1){const y=r===d?n:p&&p[m],g=y?`${y}px`:"";i+=y||e,y||(o=!1),s.push(["col",g?{style:`width: ${g}`}:{}])}}const l=o?`${i}px`:"",c=o?"":`${i}px`;return{colgroup:["colgroup",{},...s],tableWidth:l,tableMinWidth:c}}function kS(t,e){return t.createAndFill()}function pee(t){if(t.cached.tableNodeTypes)return t.cached.tableNodeTypes;const e={};return Object.keys(t.nodes).forEach(r=>{const n=t.nodes[r];n.spec.tableRole&&(e[n.spec.tableRole]=n)}),t.cached.tableNodeTypes=e,e}function mee(t,e,r,n,i){const o=pee(t),s=[],a=[];for(let c=0;c<r;c+=1){const u=kS(o.cell);if(u&&a.push(u),n){const f=kS(o.header_cell);f&&s.push(f)}}const l=[];for(let c=0;c<e;c+=1)l.push(o.row.createChecked(null,n&&c===0?s:a));return o.table.createChecked(null,l)}function gee(t){return t instanceof qe}const lc=({editor:t})=>{const{selection:e}=t.state;if(!gee(e))return!1;let r=0;const n=EA(e.ranges[0].$from,o=>o.type.name==="table");return n==null||n.node.descendants(o=>{if(o.type.name==="table")return!1;["tableCell","tableHeader"].includes(o.type.name)&&(r+=1)}),r===e.ranges.length?(t.commands.deleteTable(),!0):!1},yee=ct.create({name:"table",addOptions(){return{HTMLAttributes:{},resizable:!1,handleWidth:5,cellMinWidth:25,View:dee,lastColumnResizable:!0,allowTableNodeSelection:!1}},content:"tableRow+",tableRole:"table",isolating:!0,group:"block",parseHTML(){return[{tag:"table"}]},renderHTML({node:t,HTMLAttributes:e}){const{colgroup:r,tableWidth:n,tableMinWidth:i}=hee(t,this.options.cellMinWidth);return["table",Be(this.options.HTMLAttributes,e,{style:n?`width: ${n}`:`min-width: ${i}`}),r,["tbody",0]]},addCommands(){return{insertTable:({rows:t=3,cols:e=3,withHeaderRow:r=!0}={})=>({tr:n,dispatch:i,editor:o})=>{const s=mee(o.schema,t,e,r);if(i){const a=n.selection.from+1;n.replaceSelectionWith(s).scrollIntoView().setSelection(_e.near(n.doc.resolve(a)))}return!0},addColumnBefore:()=>({state:t,dispatch:e})=>XQ(t,e),addColumnAfter:()=>({state:t,dispatch:e})=>JQ(t,e),deleteColumn:()=>({state:t,dispatch:e})=>ZQ(t,e),addRowBefore:()=>({state:t,dispatch:e})=>eee(t,e),addRowAfter:()=>({state:t,dispatch:e})=>tee(t,e),deleteRow:()=>({state:t,dispatch:e})=>nee(t,e),deleteTable:()=>({state:t,dispatch:e})=>uee(t,e),mergeCells:()=>({state:t,dispatch:e})=>SS(t,e),splitCell:()=>({state:t,dispatch:e})=>ES(t,e),toggleHeaderColumn:()=>({state:t,dispatch:e})=>al("column")(t,e),toggleHeaderRow:()=>({state:t,dispatch:e})=>al("row")(t,e),toggleHeaderCell:()=>({state:t,dispatch:e})=>lee(t,e),mergeOrSplit:()=>({state:t,dispatch:e})=>SS(t,e)?!0:ES(t,e),setCellAttribute:(t,e)=>({state:r,dispatch:n})=>see(t,e)(r,n),goToNextCell:()=>({state:t,dispatch:e})=>AS(1)(t,e),goToPreviousCell:()=>({state:t,dispatch:e})=>AS(-1)(t,e),fixTables:()=>({state:t,dispatch:e})=>(e&&gM(t),!0),setCellSelection:t=>({tr:e,dispatch:r})=>{if(r){const n=qe.create(e.doc,t.anchorCell,t.headCell);e.setSelection(n)}return!0}}},addKeyboardShortcuts(){return{Tab:()=>this.editor.commands.goToNextCell()?!0:this.editor.can().addRowAfter()?this.editor.chain().addRowAfter().goToNextCell().run():!1,"Shift-Tab":()=>this.editor.commands.goToPreviousCell(),Backspace:lc,"Mod-Backspace":lc,Delete:lc,"Mod-Delete":lc}},addProseMirrorPlugins(){return[...this.options.resizable&&this.editor.isEditable?[BQ({handleWidth:this.options.handleWidth,cellMinWidth:this.options.cellMinWidth,View:this.options.View,lastColumnResizable:this.options.lastColumnResizable})]:[],fee({allowTableNodeSelection:this.options.allowTableNodeSelection})]},extendNodeSchema(t){const e={name:t.name,options:t.options,storage:t.storage};return{tableRole:De(Ee(t,"tableRole",e))}}}),vee=ct.create({name:"tableCell",addOptions(){return{HTMLAttributes:{}}},content:"block+",addAttributes(){return{colspan:{default:1},rowspan:{default:1},colwidth:{default:null,parseHTML:t=>{const e=t.getAttribute("colwidth");return e?[parseInt(e,10)]:null}}}},tableRole:"cell",isolating:!0,parseHTML(){return[{tag:"td"}]},renderHTML({HTMLAttributes:t}){return["td",Be(this.options.HTMLAttributes,t),0]}}),wee=ct.create({name:"tableHeader",addOptions(){return{HTMLAttributes:{}}},content:"block+",addAttributes(){return{colspan:{default:1},rowspan:{default:1},colwidth:{default:null,parseHTML:t=>{const e=t.getAttribute("colwidth");return e?[parseInt(e,10)]:null}}}},tableRole:"header_cell",isolating:!0,parseHTML(){return[{tag:"th"}]},renderHTML({HTMLAttributes:t}){return["th",Be(this.options.HTMLAttributes,t),0]}}),_S=t=>typeof t=="object"&&t!=null&&t.nodeType===1,OS=(t,e)=>(!e||t!=="hidden")&&t!=="visible"&&t!=="clip",ep=(t,e)=>{if(t.clientHeight<t.scrollHeight||t.clientWidth<t.scrollWidth){const r=getComputedStyle(t,null);return OS(r.overflowY,e)||OS(r.overflowX,e)||(n=>{const i=(o=>{if(!o.ownerDocument||!o.ownerDocument.defaultView)return null;try{return o.ownerDocument.defaultView.frameElement}catch{return null}})(n);return!!i&&(i.clientHeight<n.scrollHeight||i.clientWidth<n.scrollWidth)})(t)}return!1},cc=(t,e,r,n,i,o,s,a)=>o<t&&s>e||o>t&&s<e?0:o<=t&&a<=r||s>=e&&a>=r?o-t-n:s>e&&a<r||o<t&&a>r?s-e+i:0,bee=t=>{const e=t.parentElement;return e??(t.getRootNode().host||null)},RS=(t,e)=>{var r,n,i,o;if(typeof document>"u")return[];const{scrollMode:s,block:a,inline:l,boundary:c,skipOverflowHiddenElements:u}=e,f=typeof c=="function"?c:te=>te!==c;if(!_S(t))throw new TypeError("Invalid target");const d=document.scrollingElement||document.documentElement,h=[];let p=t;for(;_S(p)&&f(p);){if(p=bee(p),p===d){h.push(p);break}p!=null&&p===document.body&&ep(p)&&!ep(document.documentElement)||p!=null&&ep(p,u)&&h.push(p)}const m=(n=(r=window.visualViewport)==null?void 0:r.width)!=null?n:innerWidth,y=(o=(i=window.visualViewport)==null?void 0:i.height)!=null?o:innerHeight,{scrollX:g,scrollY:b}=window,{height:S,width:x,top:O,right:M,bottom:D,left:$}=t.getBoundingClientRect(),{top:A,right:V,bottom:Q,left:I}=(te=>{const W=window.getComputedStyle(te);return{top:parseFloat(W.scrollMarginTop)||0,right:parseFloat(W.scrollMarginRight)||0,bottom:parseFloat(W.scrollMarginBottom)||0,left:parseFloat(W.scrollMarginLeft)||0}})(t);let U=a==="start"||a==="nearest"?O-A:a==="end"?D+Q:O+S/2-A+Q,k=l==="center"?$+x/2-I+V:l==="end"?M+V:$-I;const G=[];for(let te=0;te<h.length;te++){const W=h[te],{height:ae,width:X,top:de,right:q,bottom:N,left:Y}=W.getBoundingClientRect();if(s==="if-needed"&&O>=0&&$>=0&&D<=y&&M<=m&&O>=de&&D<=N&&$>=Y&&M<=q)return G;const Z=getComputedStyle(W),ie=parseInt(Z.borderLeftWidth,10),K=parseInt(Z.borderTopWidth,10),_=parseInt(Z.borderRightWidth,10),C=parseInt(Z.borderBottomWidth,10);let z=0,j=0;const P="offsetWidth"in W?W.offsetWidth-W.clientWidth-ie-_:0,F="offsetHeight"in W?W.offsetHeight-W.clientHeight-K-C:0,ne="offsetWidth"in W?W.offsetWidth===0?0:X/W.offsetWidth:0,T="offsetHeight"in W?W.offsetHeight===0?0:ae/W.offsetHeight:0;if(d===W)z=a==="start"?U:a==="end"?U-y:a==="nearest"?cc(b,b+y,y,K,C,b+U,b+U+S,S):U-y/2,j=l==="start"?k:l==="center"?k-m/2:l==="end"?k-m:cc(g,g+m,m,ie,_,g+k,g+k+x,x),z=Math.max(0,z+b),j=Math.max(0,j+g);else{z=a==="start"?U-de-K:a==="end"?U-N+C+F:a==="nearest"?cc(de,N,ae,K,C+F,U,U+S,S):U-(de+ae/2)+F/2,j=l==="start"?k-Y-ie:l==="center"?k-(Y+X/2)+P/2:l==="end"?k-q+_+P:cc(Y,q,X,ie,_+P,k,k+x,x);const{scrollLeft:re,scrollTop:R}=W;z=T===0?0:Math.max(0,Math.min(R+z/T,W.scrollHeight-ae/T+F)),j=ne===0?0:Math.max(0,Math.min(re+j/ne,W.scrollWidth-X/ne+P)),U+=R-z,k+=re-j}G.push({el:W,top:z,left:j})}return G},xee=t=>t===!1?{block:"end",inline:"nearest"}:(e=>e===Object(e)&&Object.keys(e).length!==0)(t)?t:{block:"start",inline:"nearest"};function See(t,e){if(!t.isConnected||!(i=>{let o=i;for(;o&&o.parentNode;){if(o.parentNode===document)return!0;o=o.parentNode instanceof ShadowRoot?o.parentNode.host:o.parentNode}return!1})(t))return;const r=(i=>{const o=window.getComputedStyle(i);return{top:parseFloat(o.scrollMarginTop)||0,right:parseFloat(o.scrollMarginRight)||0,bottom:parseFloat(o.scrollMarginBottom)||0,left:parseFloat(o.scrollMarginLeft)||0}})(t);if((i=>typeof i=="object"&&typeof i.behavior=="function")(e))return e.behavior(RS(t,e));const n=typeof e=="boolean"||e==null?void 0:e.behavior;for(const{el:i,top:o,left:s}of RS(t,xee(e))){const a=o-r.top+r.bottom,l=s-r.left+r.right;i.scroll({top:a,left:l,behavior:n})}}var xM={exports:{}};(function(t,e){(function(r,n){n()})(yn,function(){function r(c,u){return typeof u>"u"?u={autoBom:!1}:typeof u!="object"&&(console.warn("Deprecated: Expected third argument to be a object"),u={autoBom:!u}),u.autoBom&&/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(c.type)?new Blob(["\uFEFF",c],{type:c.type}):c}function n(c,u,f){var d=new XMLHttpRequest;d.open("GET",c),d.responseType="blob",d.onload=function(){l(d.response,u,f)},d.onerror=function(){console.error("could not download file")},d.send()}function i(c){var u=new XMLHttpRequest;u.open("HEAD",c,!1);try{u.send()}catch{}return 200<=u.status&&299>=u.status}function o(c){try{c.dispatchEvent(new MouseEvent("click"))}catch{var u=document.createEvent("MouseEvents");u.initMouseEvent("click",!0,!0,window,0,0,0,80,20,!1,!1,!1,!1,0,null),c.dispatchEvent(u)}}var s=typeof window=="object"&&window.window===window?window:typeof self=="object"&&self.self===self?self:typeof yn=="object"&&yn.global===yn?yn:void 0,a=s.navigator&&/Macintosh/.test(navigator.userAgent)&&/AppleWebKit/.test(navigator.userAgent)&&!/Safari/.test(navigator.userAgent),l=s.saveAs||(typeof window!="object"||window!==s?function(){}:"download"in HTMLAnchorElement.prototype&&!a?function(c,u,f){var d=s.URL||s.webkitURL,h=document.createElement("a");u=u||c.name||"download",h.download=u,h.rel="noopener",typeof c=="string"?(h.href=c,h.origin===location.origin?o(h):i(h.href)?n(c,u,f):o(h,h.target="_blank")):(h.href=d.createObjectURL(c),setTimeout(function(){d.revokeObjectURL(h.href)},4e4),setTimeout(function(){o(h)},0))}:"msSaveOrOpenBlob"in navigator?function(c,u,f){if(u=u||c.name||"download",typeof c!="string")navigator.msSaveOrOpenBlob(r(c,f),u);else if(i(c))n(c,u,f);else{var d=document.createElement("a");d.href=c,d.target="_blank",setTimeout(function(){o(d)})}}:function(c,u,f,d){if(d=d||open("","_blank"),d&&(d.document.title=d.document.body.innerText="downloading..."),typeof c=="string")return n(c,u,f);var h=c.type==="application/octet-stream",p=/constructor/i.test(s.HTMLElement)||s.safari,m=/CriOS\/[\d]+/.test(navigator.userAgent);if((m||h&&p||a)&&typeof FileReader<"u"){var y=new FileReader;y.onloadend=function(){var S=y.result;S=m?S:S.replace(/^data:[^;]*;/,"data:attachment/file;"),d?d.location.href=S:location=S,d=null},y.readAsDataURL(c)}else{var g=s.URL||s.webkitURL,b=g.createObjectURL(c);d?d.location=b:location.href=b,d=null,setTimeout(function(){g.revokeObjectURL(b)},4e4)}});s.saveAs=l.saveAs=l,t.exports=l})})(xM);var Eee=xM.exports,Tee=Object.defineProperty,Aee=Object.defineProperties,Cee=Object.getOwnPropertyDescriptors,MS=Object.getOwnPropertySymbols,kee=Object.prototype.hasOwnProperty,_ee=Object.prototype.propertyIsEnumerable,Wg=(t,e,r)=>e in t?Tee(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,je=(t,e)=>{for(var r in e||(e={}))kee.call(e,r)&&Wg(t,r,e[r]);if(MS)for(var r of MS(e))_ee.call(e,r)&&Wg(t,r,e[r]);return t},As=(t,e)=>Aee(t,Cee(e)),se=(t,e,r)=>(Wg(t,typeof e!="symbol"?e+"":e,r),r),uc=(t,e,r)=>new Promise((n,i)=>{var o=l=>{try{a(r.next(l))}catch(c){i(c)}},s=l=>{try{a(r.throw(l))}catch(c){i(c)}},a=l=>l.done?n(l.value):Promise.resolve(l.value).then(o,s);a((r=r.apply(t,e)).next())});class pf{constructor(e){se(this,"rootKey"),this.rootKey=e}}const Oee=Object.seal({});class oe extends pf{constructor(e){super(e),se(this,"root"),this.root=new Array}prepForXml(e){var r;e.stack.push(this);const n=this.root.map(i=>i instanceof pf?i.prepForXml(e):i).filter(i=>i!==void 0);return e.stack.pop(),{[this.rootKey]:n.length?n.length===1&&((r=n[0])!=null&&r._attr)?n[0]:n:Oee}}addChildElement(e){return this.root.push(e),this}}class Dn extends oe{prepForXml(e){const r=super.prepForXml(e);if(r&&(typeof r[this.rootKey]!="object"||Object.keys(r[this.rootKey]).length))return r}}class be extends pf{constructor(e){super("_attr"),se(this,"xmlKeys"),this.root=e}prepForXml(e){const r={};return Object.keys(this.root).forEach(n=>{const i=this.root[n];if(i!==void 0){const o=this.xmlKeys&&this.xmlKeys[n]||n;r[o]=i}}),{_attr:r}}}class Pn extends pf{constructor(e){super("_attr"),this.root=e}prepForXml(e){return{_attr:Object.values(this.root).filter(({value:n})=>n!==void 0).reduce((n,{key:i,value:o})=>As(je({},n),{[i]:o}),{})}}}class st extends be{constructor(){super(...arguments),se(this,"xmlKeys",{val:"w:val",color:"w:color",fill:"w:fill",space:"w:space",sz:"w:sz",type:"w:type",rsidR:"w:rsidR",rsidRPr:"w:rsidRPr",rsidSect:"w:rsidSect",w:"w:w",h:"w:h",top:"w:top",right:"w:right",bottom:"w:bottom",left:"w:left",header:"w:header",footer:"w:footer",gutter:"w:gutter",linePitch:"w:linePitch",pos:"w:pos"})}}var Vr=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function SM(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var EM={},iw={exports:{}},Qo=typeof Reflect=="object"?Reflect:null,IS=Qo&&typeof Qo.apply=="function"?Qo.apply:function(e,r,n){return Function.prototype.apply.call(e,r,n)},Uc;Qo&&typeof Qo.ownKeys=="function"?Uc=Qo.ownKeys:Object.getOwnPropertySymbols?Uc=function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:Uc=function(e){return Object.getOwnPropertyNames(e)};function Ree(t){console&&console.warn&&console.warn(t)}var TM=Number.isNaN||function(e){return e!==e};function Ve(){Ve.init.call(this)}iw.exports=Ve;iw.exports.once=Dee;Ve.EventEmitter=Ve;Ve.prototype._events=void 0;Ve.prototype._eventsCount=0;Ve.prototype._maxListeners=void 0;var NS=10;function gd(t){if(typeof t!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof t)}Object.defineProperty(Ve,"defaultMaxListeners",{enumerable:!0,get:function(){return NS},set:function(t){if(typeof t!="number"||t<0||TM(t))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+t+".");NS=t}});Ve.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0};Ve.prototype.setMaxListeners=function(e){if(typeof e!="number"||e<0||TM(e))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".");return this._maxListeners=e,this};function AM(t){return t._maxListeners===void 0?Ve.defaultMaxListeners:t._maxListeners}Ve.prototype.getMaxListeners=function(){return AM(this)};Ve.prototype.emit=function(e){for(var r=[],n=1;n<arguments.length;n++)r.push(arguments[n]);var i=e==="error",o=this._events;if(o!==void 0)i=i&&o.error===void 0;else if(!i)return!1;if(i){var s;if(r.length>0&&(s=r[0]),s instanceof Error)throw s;var a=new Error("Unhandled error."+(s?" ("+s.message+")":""));throw a.context=s,a}var l=o[e];if(l===void 0)return!1;if(typeof l=="function")IS(l,this,r);else for(var c=l.length,u=RM(l,c),n=0;n<c;++n)IS(u[n],this,r);return!0};function CM(t,e,r,n){var i,o,s;if(gd(r),o=t._events,o===void 0?(o=t._events=Object.create(null),t._eventsCount=0):(o.newListener!==void 0&&(t.emit("newListener",e,r.listener?r.listener:r),o=t._events),s=o[e]),s===void 0)s=o[e]=r,++t._eventsCount;else if(typeof s=="function"?s=o[e]=n?[r,s]:[s,r]:n?s.unshift(r):s.push(r),i=AM(t),i>0&&s.length>i&&!s.warned){s.warned=!0;var a=new Error("Possible EventEmitter memory leak detected. "+s.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");a.name="MaxListenersExceededWarning",a.emitter=t,a.type=e,a.count=s.length,Ree(a)}return t}Ve.prototype.addListener=function(e,r){return CM(this,e,r,!1)};Ve.prototype.on=Ve.prototype.addListener;Ve.prototype.prependListener=function(e,r){return CM(this,e,r,!0)};function Mee(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function kM(t,e,r){var n={fired:!1,wrapFn:void 0,target:t,type:e,listener:r},i=Mee.bind(n);return i.listener=r,n.wrapFn=i,i}Ve.prototype.once=function(e,r){return gd(r),this.on(e,kM(this,e,r)),this};Ve.prototype.prependOnceListener=function(e,r){return gd(r),this.prependListener(e,kM(this,e,r)),this};Ve.prototype.removeListener=function(e,r){var n,i,o,s,a;if(gd(r),i=this._events,i===void 0)return this;if(n=i[e],n===void 0)return this;if(n===r||n.listener===r)--this._eventsCount===0?this._events=Object.create(null):(delete i[e],i.removeListener&&this.emit("removeListener",e,n.listener||r));else if(typeof n!="function"){for(o=-1,s=n.length-1;s>=0;s--)if(n[s]===r||n[s].listener===r){a=n[s].listener,o=s;break}if(o<0)return this;o===0?n.shift():Iee(n,o),n.length===1&&(i[e]=n[0]),i.removeListener!==void 0&&this.emit("removeListener",e,a||r)}return this};Ve.prototype.off=Ve.prototype.removeListener;Ve.prototype.removeAllListeners=function(e){var r,n,i;if(n=this._events,n===void 0)return this;if(n.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):n[e]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete n[e]),this;if(arguments.length===0){var o=Object.keys(n),s;for(i=0;i<o.length;++i)s=o[i],s!=="removeListener"&&this.removeAllListeners(s);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(r=n[e],typeof r=="function")this.removeListener(e,r);else if(r!==void 0)for(i=r.length-1;i>=0;i--)this.removeListener(e,r[i]);return this};function _M(t,e,r){var n=t._events;if(n===void 0)return[];var i=n[e];return i===void 0?[]:typeof i=="function"?r?[i.listener||i]:[i]:r?Nee(i):RM(i,i.length)}Ve.prototype.listeners=function(e){return _M(this,e,!0)};Ve.prototype.rawListeners=function(e){return _M(this,e,!1)};Ve.listenerCount=function(t,e){return typeof t.listenerCount=="function"?t.listenerCount(e):OM.call(t,e)};Ve.prototype.listenerCount=OM;function OM(t){var e=this._events;if(e!==void 0){var r=e[t];if(typeof r=="function")return 1;if(r!==void 0)return r.length}return 0}Ve.prototype.eventNames=function(){return this._eventsCount>0?Uc(this._events):[]};function RM(t,e){for(var r=new Array(e),n=0;n<e;++n)r[n]=t[n];return r}function Iee(t,e){for(;e+1<t.length;e++)t[e]=t[e+1];t.pop()}function Nee(t){for(var e=new Array(t.length),r=0;r<e.length;++r)e[r]=t[r].listener||t[r];return e}function Dee(t,e){return new Promise(function(r,n){function i(s){t.removeListener(e,o),n(s)}function o(){typeof t.removeListener=="function"&&t.removeListener("error",i),r([].slice.call(arguments))}MM(t,e,o,{once:!0}),e!=="error"&&Pee(t,i,{once:!0})})}function Pee(t,e,r){typeof t.on=="function"&&MM(t,"error",e,r)}function MM(t,e,r,n){if(typeof t.on=="function")n.once?t.once(e,r):t.on(e,r);else if(typeof t.addEventListener=="function")t.addEventListener(e,function i(o){n.once&&t.removeEventListener(e,i),r(o)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof t)}var ow=iw.exports,Vg={exports:{}};typeof Object.create=="function"?Vg.exports=function(e,r){r&&(e.super_=r,e.prototype=Object.create(r.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:Vg.exports=function(e,r){if(r){e.super_=r;var n=function(){};n.prototype=r.prototype,e.prototype=new n,e.prototype.constructor=e}};var wo=Vg.exports;function Lee(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var IM={exports:{}},ut=IM.exports={},Lr,Fr;function Gg(){throw new Error("setTimeout has not been defined")}function Kg(){throw new Error("clearTimeout has not been defined")}(function(){try{typeof setTimeout=="function"?Lr=setTimeout:Lr=Gg}catch{Lr=Gg}try{typeof clearTimeout=="function"?Fr=clearTimeout:Fr=Kg}catch{Fr=Kg}})();function NM(t){if(Lr===setTimeout)return setTimeout(t,0);if((Lr===Gg||!Lr)&&setTimeout)return Lr=setTimeout,setTimeout(t,0);try{return Lr(t,0)}catch{try{return Lr.call(null,t,0)}catch{return Lr.call(this,t,0)}}}function Fee(t){if(Fr===clearTimeout)return clearTimeout(t);if((Fr===Kg||!Fr)&&clearTimeout)return Fr=clearTimeout,clearTimeout(t);try{return Fr(t)}catch{try{return Fr.call(null,t)}catch{return Fr.call(this,t)}}}var bn=[],es=!1,Hi,Wc=-1;function Bee(){!es||!Hi||(es=!1,Hi.length?bn=Hi.concat(bn):Wc=-1,bn.length&&DM())}function DM(){if(!es){var t=NM(Bee);es=!0;for(var e=bn.length;e;){for(Hi=bn,bn=[];++Wc<e;)Hi&&Hi[Wc].run();Wc=-1,e=bn.length}Hi=null,es=!1,Fee(t)}}ut.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)e[r-1]=arguments[r];bn.push(new PM(t,e)),bn.length===1&&!es&&NM(DM)};function PM(t,e){this.fun=t,this.array=e}PM.prototype.run=function(){this.fun.apply(null,this.array)};ut.title="browser";ut.browser=!0;ut.env={};ut.argv=[];ut.version="";ut.versions={};function Ln(){}ut.on=Ln;ut.addListener=Ln;ut.once=Ln;ut.off=Ln;ut.removeListener=Ln;ut.removeAllListeners=Ln;ut.emit=Ln;ut.prependListener=Ln;ut.prependOnceListener=Ln;ut.listeners=function(t){return[]};ut.binding=function(t){throw new Error("process.binding is not supported")};ut.cwd=function(){return"/"};ut.chdir=function(t){throw new Error("process.chdir is not supported")};ut.umask=function(){return 0};var $ee=IM.exports;const Pe=Lee($ee);var tp,DS;function LM(){return DS||(DS=1,tp=ow.EventEmitter),tp}var rp={},Qs={},PS;function jee(){if(PS)return Qs;PS=1,Qs.byteLength=a,Qs.toByteArray=c,Qs.fromByteArray=d;for(var t=[],e=[],r=typeof Uint8Array<"u"?Uint8Array:Array,n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",i=0,o=n.length;i<o;++i)t[i]=n[i],e[n.charCodeAt(i)]=i;e[45]=62,e[95]=63;function s(h){var p=h.length;if(p%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var m=h.indexOf("=");m===-1&&(m=p);var y=m===p?0:4-m%4;return[m,y]}function a(h){var p=s(h),m=p[0],y=p[1];return(m+y)*3/4-y}function l(h,p,m){return(p+m)*3/4-m}function c(h){var p,m=s(h),y=m[0],g=m[1],b=new r(l(h,y,g)),S=0,x=g>0?y-4:y,O;for(O=0;O<x;O+=4)p=e[h.charCodeAt(O)]<<18|e[h.charCodeAt(O+1)]<<12|e[h.charCodeAt(O+2)]<<6|e[h.charCodeAt(O+3)],b[S++]=p>>16&255,b[S++]=p>>8&255,b[S++]=p&255;return g===2&&(p=e[h.charCodeAt(O)]<<2|e[h.charCodeAt(O+1)]>>4,b[S++]=p&255),g===1&&(p=e[h.charCodeAt(O)]<<10|e[h.charCodeAt(O+1)]<<4|e[h.charCodeAt(O+2)]>>2,b[S++]=p>>8&255,b[S++]=p&255),b}function u(h){return t[h>>18&63]+t[h>>12&63]+t[h>>6&63]+t[h&63]}function f(h,p,m){for(var y,g=[],b=p;b<m;b+=3)y=(h[b]<<16&16711680)+(h[b+1]<<8&65280)+(h[b+2]&255),g.push(u(y));return g.join("")}function d(h){for(var p,m=h.length,y=m%3,g=[],b=16383,S=0,x=m-y;S<x;S+=b)g.push(f(h,S,S+b>x?x:S+b));return y===1?(p=h[m-1],g.push(t[p>>2]+t[p<<4&63]+"==")):y===2&&(p=(h[m-2]<<8)+h[m-1],g.push(t[p>>10]+t[p>>4&63]+t[p<<2&63]+"=")),g.join("")}return Qs}var fc={};/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */var LS;function Hee(){return LS||(LS=1,fc.read=function(t,e,r,n,i){var o,s,a=i*8-n-1,l=(1<<a)-1,c=l>>1,u=-7,f=r?i-1:0,d=r?-1:1,h=t[e+f];for(f+=d,o=h&(1<<-u)-1,h>>=-u,u+=a;u>0;o=o*256+t[e+f],f+=d,u-=8);for(s=o&(1<<-u)-1,o>>=-u,u+=n;u>0;s=s*256+t[e+f],f+=d,u-=8);if(o===0)o=1-c;else{if(o===l)return s?NaN:(h?-1:1)*(1/0);s=s+Math.pow(2,n),o=o-c}return(h?-1:1)*s*Math.pow(2,o-n)},fc.write=function(t,e,r,n,i,o){var s,a,l,c=o*8-i-1,u=(1<<c)-1,f=u>>1,d=i===23?Math.pow(2,-24)-Math.pow(2,-77):0,h=n?0:o-1,p=n?1:-1,m=e<0||e===0&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(a=isNaN(e)?1:0,s=u):(s=Math.floor(Math.log(e)/Math.LN2),e*(l=Math.pow(2,-s))<1&&(s--,l*=2),s+f>=1?e+=d/l:e+=d*Math.pow(2,1-f),e*l>=2&&(s++,l/=2),s+f>=u?(a=0,s=u):s+f>=1?(a=(e*l-1)*Math.pow(2,i),s=s+f):(a=e*Math.pow(2,f-1)*Math.pow(2,i),s=0));i>=8;t[r+h]=a&255,h+=p,a/=256,i-=8);for(s=s<<i|a,c+=i;c>0;t[r+h]=s&255,h+=p,s/=256,c-=8);t[r+h-p]|=m*128}),fc}/*!
566
- * The buffer module from node.js, for the browser.
567
- *
568
- * @author Feross Aboukhadijeh <https://feross.org>
569
- * @license MIT
570
- */var FS;function yd(){return FS||(FS=1,function(t){var e=jee(),r=Hee(),n=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;t.Buffer=a,t.SlowBuffer=b,t.INSPECT_MAX_BYTES=50;var i=2147483647;t.kMaxLength=i,a.TYPED_ARRAY_SUPPORT=o(),!a.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function o(){try{var R=new Uint8Array(1),v={foo:function(){return 42}};return Object.setPrototypeOf(v,Uint8Array.prototype),Object.setPrototypeOf(R,v),R.foo()===42}catch{return!1}}Object.defineProperty(a.prototype,"parent",{enumerable:!0,get:function(){if(a.isBuffer(this))return this.buffer}}),Object.defineProperty(a.prototype,"offset",{enumerable:!0,get:function(){if(a.isBuffer(this))return this.byteOffset}});function s(R){if(R>i)throw new RangeError('The value "'+R+'" is invalid for option "size"');var v=new Uint8Array(R);return Object.setPrototypeOf(v,a.prototype),v}function a(R,v,w){if(typeof R=="number"){if(typeof v=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return f(R)}return l(R,v,w)}a.poolSize=8192;function l(R,v,w){if(typeof R=="string")return d(R,v);if(ArrayBuffer.isView(R))return p(R);if(R==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof R);if(ne(R,ArrayBuffer)||R&&ne(R.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(ne(R,SharedArrayBuffer)||R&&ne(R.buffer,SharedArrayBuffer)))return m(R,v,w);if(typeof R=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');var E=R.valueOf&&R.valueOf();if(E!=null&&E!==R)return a.from(E,v,w);var B=y(R);if(B)return B;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof R[Symbol.toPrimitive]=="function")return a.from(R[Symbol.toPrimitive]("string"),v,w);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof R)}a.from=function(R,v,w){return l(R,v,w)},Object.setPrototypeOf(a.prototype,Uint8Array.prototype),Object.setPrototypeOf(a,Uint8Array);function c(R){if(typeof R!="number")throw new TypeError('"size" argument must be of type number');if(R<0)throw new RangeError('The value "'+R+'" is invalid for option "size"')}function u(R,v,w){return c(R),R<=0?s(R):v!==void 0?typeof w=="string"?s(R).fill(v,w):s(R).fill(v):s(R)}a.alloc=function(R,v,w){return u(R,v,w)};function f(R){return c(R),s(R<0?0:g(R)|0)}a.allocUnsafe=function(R){return f(R)},a.allocUnsafeSlow=function(R){return f(R)};function d(R,v){if((typeof v!="string"||v==="")&&(v="utf8"),!a.isEncoding(v))throw new TypeError("Unknown encoding: "+v);var w=S(R,v)|0,E=s(w),B=E.write(R,v);return B!==w&&(E=E.slice(0,B)),E}function h(R){for(var v=R.length<0?0:g(R.length)|0,w=s(v),E=0;E<v;E+=1)w[E]=R[E]&255;return w}function p(R){if(ne(R,Uint8Array)){var v=new Uint8Array(R);return m(v.buffer,v.byteOffset,v.byteLength)}return h(R)}function m(R,v,w){if(v<0||R.byteLength<v)throw new RangeError('"offset" is outside of buffer bounds');if(R.byteLength<v+(w||0))throw new RangeError('"length" is outside of buffer bounds');var E;return v===void 0&&w===void 0?E=new Uint8Array(R):w===void 0?E=new Uint8Array(R,v):E=new Uint8Array(R,v,w),Object.setPrototypeOf(E,a.prototype),E}function y(R){if(a.isBuffer(R)){var v=g(R.length)|0,w=s(v);return w.length===0||R.copy(w,0,0,v),w}if(R.length!==void 0)return typeof R.length!="number"||T(R.length)?s(0):h(R);if(R.type==="Buffer"&&Array.isArray(R.data))return h(R.data)}function g(R){if(R>=i)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+i.toString(16)+" bytes");return R|0}function b(R){return+R!=R&&(R=0),a.alloc(+R)}a.isBuffer=function(v){return v!=null&&v._isBuffer===!0&&v!==a.prototype},a.compare=function(v,w){if(ne(v,Uint8Array)&&(v=a.from(v,v.offset,v.byteLength)),ne(w,Uint8Array)&&(w=a.from(w,w.offset,w.byteLength)),!a.isBuffer(v)||!a.isBuffer(w))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(v===w)return 0;for(var E=v.length,B=w.length,J=0,H=Math.min(E,B);J<H;++J)if(v[J]!==w[J]){E=v[J],B=w[J];break}return E<B?-1:B<E?1:0},a.isEncoding=function(v){switch(String(v).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},a.concat=function(v,w){if(!Array.isArray(v))throw new TypeError('"list" argument must be an Array of Buffers');if(v.length===0)return a.alloc(0);var E;if(w===void 0)for(w=0,E=0;E<v.length;++E)w+=v[E].length;var B=a.allocUnsafe(w),J=0;for(E=0;E<v.length;++E){var H=v[E];if(ne(H,Uint8Array))J+H.length>B.length?a.from(H).copy(B,J):Uint8Array.prototype.set.call(B,H,J);else if(a.isBuffer(H))H.copy(B,J);else throw new TypeError('"list" argument must be an Array of Buffers');J+=H.length}return B};function S(R,v){if(a.isBuffer(R))return R.length;if(ArrayBuffer.isView(R)||ne(R,ArrayBuffer))return R.byteLength;if(typeof R!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof R);var w=R.length,E=arguments.length>2&&arguments[2]===!0;if(!E&&w===0)return 0;for(var B=!1;;)switch(v){case"ascii":case"latin1":case"binary":return w;case"utf8":case"utf-8":return C(R).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return w*2;case"hex":return w>>>1;case"base64":return P(R).length;default:if(B)return E?-1:C(R).length;v=(""+v).toLowerCase(),B=!0}}a.byteLength=S;function x(R,v,w){var E=!1;if((v===void 0||v<0)&&(v=0),v>this.length||((w===void 0||w>this.length)&&(w=this.length),w<=0)||(w>>>=0,v>>>=0,w<=v))return"";for(R||(R="utf8");;)switch(R){case"hex":return X(this,v,w);case"utf8":case"utf-8":return k(this,v,w);case"ascii":return W(this,v,w);case"latin1":case"binary":return ae(this,v,w);case"base64":return U(this,v,w);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return de(this,v,w);default:if(E)throw new TypeError("Unknown encoding: "+R);R=(R+"").toLowerCase(),E=!0}}a.prototype._isBuffer=!0;function O(R,v,w){var E=R[v];R[v]=R[w],R[w]=E}a.prototype.swap16=function(){var v=this.length;if(v%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var w=0;w<v;w+=2)O(this,w,w+1);return this},a.prototype.swap32=function(){var v=this.length;if(v%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var w=0;w<v;w+=4)O(this,w,w+3),O(this,w+1,w+2);return this},a.prototype.swap64=function(){var v=this.length;if(v%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var w=0;w<v;w+=8)O(this,w,w+7),O(this,w+1,w+6),O(this,w+2,w+5),O(this,w+3,w+4);return this},a.prototype.toString=function(){var v=this.length;return v===0?"":arguments.length===0?k(this,0,v):x.apply(this,arguments)},a.prototype.toLocaleString=a.prototype.toString,a.prototype.equals=function(v){if(!a.isBuffer(v))throw new TypeError("Argument must be a Buffer");return this===v?!0:a.compare(this,v)===0},a.prototype.inspect=function(){var v="",w=t.INSPECT_MAX_BYTES;return v=this.toString("hex",0,w).replace(/(.{2})/g,"$1 ").trim(),this.length>w&&(v+=" ... "),"<Buffer "+v+">"},n&&(a.prototype[n]=a.prototype.inspect),a.prototype.compare=function(v,w,E,B,J){if(ne(v,Uint8Array)&&(v=a.from(v,v.offset,v.byteLength)),!a.isBuffer(v))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof v);if(w===void 0&&(w=0),E===void 0&&(E=v?v.length:0),B===void 0&&(B=0),J===void 0&&(J=this.length),w<0||E>v.length||B<0||J>this.length)throw new RangeError("out of range index");if(B>=J&&w>=E)return 0;if(B>=J)return-1;if(w>=E)return 1;if(w>>>=0,E>>>=0,B>>>=0,J>>>=0,this===v)return 0;for(var H=J-B,ce=E-w,me=Math.min(H,ce),fe=this.slice(B,J),ve=v.slice(w,E),Te=0;Te<me;++Te)if(fe[Te]!==ve[Te]){H=fe[Te],ce=ve[Te];break}return H<ce?-1:ce<H?1:0};function M(R,v,w,E,B){if(R.length===0)return-1;if(typeof w=="string"?(E=w,w=0):w>2147483647?w=2147483647:w<-2147483648&&(w=-2147483648),w=+w,T(w)&&(w=B?0:R.length-1),w<0&&(w=R.length+w),w>=R.length){if(B)return-1;w=R.length-1}else if(w<0)if(B)w=0;else return-1;if(typeof v=="string"&&(v=a.from(v,E)),a.isBuffer(v))return v.length===0?-1:D(R,v,w,E,B);if(typeof v=="number")return v=v&255,typeof Uint8Array.prototype.indexOf=="function"?B?Uint8Array.prototype.indexOf.call(R,v,w):Uint8Array.prototype.lastIndexOf.call(R,v,w):D(R,[v],w,E,B);throw new TypeError("val must be string, number or Buffer")}function D(R,v,w,E,B){var J=1,H=R.length,ce=v.length;if(E!==void 0&&(E=String(E).toLowerCase(),E==="ucs2"||E==="ucs-2"||E==="utf16le"||E==="utf-16le")){if(R.length<2||v.length<2)return-1;J=2,H/=2,ce/=2,w/=2}function me(xt,Rr){return J===1?xt[Rr]:xt.readUInt16BE(Rr*J)}var fe;if(B){var ve=-1;for(fe=w;fe<H;fe++)if(me(R,fe)===me(v,ve===-1?0:fe-ve)){if(ve===-1&&(ve=fe),fe-ve+1===ce)return ve*J}else ve!==-1&&(fe-=fe-ve),ve=-1}else for(w+ce>H&&(w=H-ce),fe=w;fe>=0;fe--){for(var Te=!0,Oe=0;Oe<ce;Oe++)if(me(R,fe+Oe)!==me(v,Oe)){Te=!1;break}if(Te)return fe}return-1}a.prototype.includes=function(v,w,E){return this.indexOf(v,w,E)!==-1},a.prototype.indexOf=function(v,w,E){return M(this,v,w,E,!0)},a.prototype.lastIndexOf=function(v,w,E){return M(this,v,w,E,!1)};function $(R,v,w,E){w=Number(w)||0;var B=R.length-w;E?(E=Number(E),E>B&&(E=B)):E=B;var J=v.length;E>J/2&&(E=J/2);for(var H=0;H<E;++H){var ce=parseInt(v.substr(H*2,2),16);if(T(ce))return H;R[w+H]=ce}return H}function A(R,v,w,E){return F(C(v,R.length-w),R,w,E)}function V(R,v,w,E){return F(z(v),R,w,E)}function Q(R,v,w,E){return F(P(v),R,w,E)}function I(R,v,w,E){return F(j(v,R.length-w),R,w,E)}a.prototype.write=function(v,w,E,B){if(w===void 0)B="utf8",E=this.length,w=0;else if(E===void 0&&typeof w=="string")B=w,E=this.length,w=0;else if(isFinite(w))w=w>>>0,isFinite(E)?(E=E>>>0,B===void 0&&(B="utf8")):(B=E,E=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var J=this.length-w;if((E===void 0||E>J)&&(E=J),v.length>0&&(E<0||w<0)||w>this.length)throw new RangeError("Attempt to write outside buffer bounds");B||(B="utf8");for(var H=!1;;)switch(B){case"hex":return $(this,v,w,E);case"utf8":case"utf-8":return A(this,v,w,E);case"ascii":case"latin1":case"binary":return V(this,v,w,E);case"base64":return Q(this,v,w,E);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return I(this,v,w,E);default:if(H)throw new TypeError("Unknown encoding: "+B);B=(""+B).toLowerCase(),H=!0}},a.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function U(R,v,w){return v===0&&w===R.length?e.fromByteArray(R):e.fromByteArray(R.slice(v,w))}function k(R,v,w){w=Math.min(R.length,w);for(var E=[],B=v;B<w;){var J=R[B],H=null,ce=J>239?4:J>223?3:J>191?2:1;if(B+ce<=w){var me,fe,ve,Te;switch(ce){case 1:J<128&&(H=J);break;case 2:me=R[B+1],(me&192)===128&&(Te=(J&31)<<6|me&63,Te>127&&(H=Te));break;case 3:me=R[B+1],fe=R[B+2],(me&192)===128&&(fe&192)===128&&(Te=(J&15)<<12|(me&63)<<6|fe&63,Te>2047&&(Te<55296||Te>57343)&&(H=Te));break;case 4:me=R[B+1],fe=R[B+2],ve=R[B+3],(me&192)===128&&(fe&192)===128&&(ve&192)===128&&(Te=(J&15)<<18|(me&63)<<12|(fe&63)<<6|ve&63,Te>65535&&Te<1114112&&(H=Te))}}H===null?(H=65533,ce=1):H>65535&&(H-=65536,E.push(H>>>10&1023|55296),H=56320|H&1023),E.push(H),B+=ce}return te(E)}var G=4096;function te(R){var v=R.length;if(v<=G)return String.fromCharCode.apply(String,R);for(var w="",E=0;E<v;)w+=String.fromCharCode.apply(String,R.slice(E,E+=G));return w}function W(R,v,w){var E="";w=Math.min(R.length,w);for(var B=v;B<w;++B)E+=String.fromCharCode(R[B]&127);return E}function ae(R,v,w){var E="";w=Math.min(R.length,w);for(var B=v;B<w;++B)E+=String.fromCharCode(R[B]);return E}function X(R,v,w){var E=R.length;(!v||v<0)&&(v=0),(!w||w<0||w>E)&&(w=E);for(var B="",J=v;J<w;++J)B+=re[R[J]];return B}function de(R,v,w){for(var E=R.slice(v,w),B="",J=0;J<E.length-1;J+=2)B+=String.fromCharCode(E[J]+E[J+1]*256);return B}a.prototype.slice=function(v,w){var E=this.length;v=~~v,w=w===void 0?E:~~w,v<0?(v+=E,v<0&&(v=0)):v>E&&(v=E),w<0?(w+=E,w<0&&(w=0)):w>E&&(w=E),w<v&&(w=v);var B=this.subarray(v,w);return Object.setPrototypeOf(B,a.prototype),B};function q(R,v,w){if(R%1!==0||R<0)throw new RangeError("offset is not uint");if(R+v>w)throw new RangeError("Trying to access beyond buffer length")}a.prototype.readUintLE=a.prototype.readUIntLE=function(v,w,E){v=v>>>0,w=w>>>0,E||q(v,w,this.length);for(var B=this[v],J=1,H=0;++H<w&&(J*=256);)B+=this[v+H]*J;return B},a.prototype.readUintBE=a.prototype.readUIntBE=function(v,w,E){v=v>>>0,w=w>>>0,E||q(v,w,this.length);for(var B=this[v+--w],J=1;w>0&&(J*=256);)B+=this[v+--w]*J;return B},a.prototype.readUint8=a.prototype.readUInt8=function(v,w){return v=v>>>0,w||q(v,1,this.length),this[v]},a.prototype.readUint16LE=a.prototype.readUInt16LE=function(v,w){return v=v>>>0,w||q(v,2,this.length),this[v]|this[v+1]<<8},a.prototype.readUint16BE=a.prototype.readUInt16BE=function(v,w){return v=v>>>0,w||q(v,2,this.length),this[v]<<8|this[v+1]},a.prototype.readUint32LE=a.prototype.readUInt32LE=function(v,w){return v=v>>>0,w||q(v,4,this.length),(this[v]|this[v+1]<<8|this[v+2]<<16)+this[v+3]*16777216},a.prototype.readUint32BE=a.prototype.readUInt32BE=function(v,w){return v=v>>>0,w||q(v,4,this.length),this[v]*16777216+(this[v+1]<<16|this[v+2]<<8|this[v+3])},a.prototype.readIntLE=function(v,w,E){v=v>>>0,w=w>>>0,E||q(v,w,this.length);for(var B=this[v],J=1,H=0;++H<w&&(J*=256);)B+=this[v+H]*J;return J*=128,B>=J&&(B-=Math.pow(2,8*w)),B},a.prototype.readIntBE=function(v,w,E){v=v>>>0,w=w>>>0,E||q(v,w,this.length);for(var B=w,J=1,H=this[v+--B];B>0&&(J*=256);)H+=this[v+--B]*J;return J*=128,H>=J&&(H-=Math.pow(2,8*w)),H},a.prototype.readInt8=function(v,w){return v=v>>>0,w||q(v,1,this.length),this[v]&128?(255-this[v]+1)*-1:this[v]},a.prototype.readInt16LE=function(v,w){v=v>>>0,w||q(v,2,this.length);var E=this[v]|this[v+1]<<8;return E&32768?E|4294901760:E},a.prototype.readInt16BE=function(v,w){v=v>>>0,w||q(v,2,this.length);var E=this[v+1]|this[v]<<8;return E&32768?E|4294901760:E},a.prototype.readInt32LE=function(v,w){return v=v>>>0,w||q(v,4,this.length),this[v]|this[v+1]<<8|this[v+2]<<16|this[v+3]<<24},a.prototype.readInt32BE=function(v,w){return v=v>>>0,w||q(v,4,this.length),this[v]<<24|this[v+1]<<16|this[v+2]<<8|this[v+3]},a.prototype.readFloatLE=function(v,w){return v=v>>>0,w||q(v,4,this.length),r.read(this,v,!0,23,4)},a.prototype.readFloatBE=function(v,w){return v=v>>>0,w||q(v,4,this.length),r.read(this,v,!1,23,4)},a.prototype.readDoubleLE=function(v,w){return v=v>>>0,w||q(v,8,this.length),r.read(this,v,!0,52,8)},a.prototype.readDoubleBE=function(v,w){return v=v>>>0,w||q(v,8,this.length),r.read(this,v,!1,52,8)};function N(R,v,w,E,B,J){if(!a.isBuffer(R))throw new TypeError('"buffer" argument must be a Buffer instance');if(v>B||v<J)throw new RangeError('"value" argument is out of bounds');if(w+E>R.length)throw new RangeError("Index out of range")}a.prototype.writeUintLE=a.prototype.writeUIntLE=function(v,w,E,B){if(v=+v,w=w>>>0,E=E>>>0,!B){var J=Math.pow(2,8*E)-1;N(this,v,w,E,J,0)}var H=1,ce=0;for(this[w]=v&255;++ce<E&&(H*=256);)this[w+ce]=v/H&255;return w+E},a.prototype.writeUintBE=a.prototype.writeUIntBE=function(v,w,E,B){if(v=+v,w=w>>>0,E=E>>>0,!B){var J=Math.pow(2,8*E)-1;N(this,v,w,E,J,0)}var H=E-1,ce=1;for(this[w+H]=v&255;--H>=0&&(ce*=256);)this[w+H]=v/ce&255;return w+E},a.prototype.writeUint8=a.prototype.writeUInt8=function(v,w,E){return v=+v,w=w>>>0,E||N(this,v,w,1,255,0),this[w]=v&255,w+1},a.prototype.writeUint16LE=a.prototype.writeUInt16LE=function(v,w,E){return v=+v,w=w>>>0,E||N(this,v,w,2,65535,0),this[w]=v&255,this[w+1]=v>>>8,w+2},a.prototype.writeUint16BE=a.prototype.writeUInt16BE=function(v,w,E){return v=+v,w=w>>>0,E||N(this,v,w,2,65535,0),this[w]=v>>>8,this[w+1]=v&255,w+2},a.prototype.writeUint32LE=a.prototype.writeUInt32LE=function(v,w,E){return v=+v,w=w>>>0,E||N(this,v,w,4,4294967295,0),this[w+3]=v>>>24,this[w+2]=v>>>16,this[w+1]=v>>>8,this[w]=v&255,w+4},a.prototype.writeUint32BE=a.prototype.writeUInt32BE=function(v,w,E){return v=+v,w=w>>>0,E||N(this,v,w,4,4294967295,0),this[w]=v>>>24,this[w+1]=v>>>16,this[w+2]=v>>>8,this[w+3]=v&255,w+4},a.prototype.writeIntLE=function(v,w,E,B){if(v=+v,w=w>>>0,!B){var J=Math.pow(2,8*E-1);N(this,v,w,E,J-1,-J)}var H=0,ce=1,me=0;for(this[w]=v&255;++H<E&&(ce*=256);)v<0&&me===0&&this[w+H-1]!==0&&(me=1),this[w+H]=(v/ce>>0)-me&255;return w+E},a.prototype.writeIntBE=function(v,w,E,B){if(v=+v,w=w>>>0,!B){var J=Math.pow(2,8*E-1);N(this,v,w,E,J-1,-J)}var H=E-1,ce=1,me=0;for(this[w+H]=v&255;--H>=0&&(ce*=256);)v<0&&me===0&&this[w+H+1]!==0&&(me=1),this[w+H]=(v/ce>>0)-me&255;return w+E},a.prototype.writeInt8=function(v,w,E){return v=+v,w=w>>>0,E||N(this,v,w,1,127,-128),v<0&&(v=255+v+1),this[w]=v&255,w+1},a.prototype.writeInt16LE=function(v,w,E){return v=+v,w=w>>>0,E||N(this,v,w,2,32767,-32768),this[w]=v&255,this[w+1]=v>>>8,w+2},a.prototype.writeInt16BE=function(v,w,E){return v=+v,w=w>>>0,E||N(this,v,w,2,32767,-32768),this[w]=v>>>8,this[w+1]=v&255,w+2},a.prototype.writeInt32LE=function(v,w,E){return v=+v,w=w>>>0,E||N(this,v,w,4,2147483647,-2147483648),this[w]=v&255,this[w+1]=v>>>8,this[w+2]=v>>>16,this[w+3]=v>>>24,w+4},a.prototype.writeInt32BE=function(v,w,E){return v=+v,w=w>>>0,E||N(this,v,w,4,2147483647,-2147483648),v<0&&(v=4294967295+v+1),this[w]=v>>>24,this[w+1]=v>>>16,this[w+2]=v>>>8,this[w+3]=v&255,w+4};function Y(R,v,w,E,B,J){if(w+E>R.length)throw new RangeError("Index out of range");if(w<0)throw new RangeError("Index out of range")}function Z(R,v,w,E,B){return v=+v,w=w>>>0,B||Y(R,v,w,4),r.write(R,v,w,E,23,4),w+4}a.prototype.writeFloatLE=function(v,w,E){return Z(this,v,w,!0,E)},a.prototype.writeFloatBE=function(v,w,E){return Z(this,v,w,!1,E)};function ie(R,v,w,E,B){return v=+v,w=w>>>0,B||Y(R,v,w,8),r.write(R,v,w,E,52,8),w+8}a.prototype.writeDoubleLE=function(v,w,E){return ie(this,v,w,!0,E)},a.prototype.writeDoubleBE=function(v,w,E){return ie(this,v,w,!1,E)},a.prototype.copy=function(v,w,E,B){if(!a.isBuffer(v))throw new TypeError("argument should be a Buffer");if(E||(E=0),!B&&B!==0&&(B=this.length),w>=v.length&&(w=v.length),w||(w=0),B>0&&B<E&&(B=E),B===E||v.length===0||this.length===0)return 0;if(w<0)throw new RangeError("targetStart out of bounds");if(E<0||E>=this.length)throw new RangeError("Index out of range");if(B<0)throw new RangeError("sourceEnd out of bounds");B>this.length&&(B=this.length),v.length-w<B-E&&(B=v.length-w+E);var J=B-E;return this===v&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(w,E,B):Uint8Array.prototype.set.call(v,this.subarray(E,B),w),J},a.prototype.fill=function(v,w,E,B){if(typeof v=="string"){if(typeof w=="string"?(B=w,w=0,E=this.length):typeof E=="string"&&(B=E,E=this.length),B!==void 0&&typeof B!="string")throw new TypeError("encoding must be a string");if(typeof B=="string"&&!a.isEncoding(B))throw new TypeError("Unknown encoding: "+B);if(v.length===1){var J=v.charCodeAt(0);(B==="utf8"&&J<128||B==="latin1")&&(v=J)}}else typeof v=="number"?v=v&255:typeof v=="boolean"&&(v=Number(v));if(w<0||this.length<w||this.length<E)throw new RangeError("Out of range index");if(E<=w)return this;w=w>>>0,E=E===void 0?this.length:E>>>0,v||(v=0);var H;if(typeof v=="number")for(H=w;H<E;++H)this[H]=v;else{var ce=a.isBuffer(v)?v:a.from(v,B),me=ce.length;if(me===0)throw new TypeError('The value "'+v+'" is invalid for argument "value"');for(H=0;H<E-w;++H)this[H+w]=ce[H%me]}return this};var K=/[^+/0-9A-Za-z-_]/g;function _(R){if(R=R.split("=")[0],R=R.trim().replace(K,""),R.length<2)return"";for(;R.length%4!==0;)R=R+"=";return R}function C(R,v){v=v||1/0;for(var w,E=R.length,B=null,J=[],H=0;H<E;++H){if(w=R.charCodeAt(H),w>55295&&w<57344){if(!B){if(w>56319){(v-=3)>-1&&J.push(239,191,189);continue}else if(H+1===E){(v-=3)>-1&&J.push(239,191,189);continue}B=w;continue}if(w<56320){(v-=3)>-1&&J.push(239,191,189),B=w;continue}w=(B-55296<<10|w-56320)+65536}else B&&(v-=3)>-1&&J.push(239,191,189);if(B=null,w<128){if((v-=1)<0)break;J.push(w)}else if(w<2048){if((v-=2)<0)break;J.push(w>>6|192,w&63|128)}else if(w<65536){if((v-=3)<0)break;J.push(w>>12|224,w>>6&63|128,w&63|128)}else if(w<1114112){if((v-=4)<0)break;J.push(w>>18|240,w>>12&63|128,w>>6&63|128,w&63|128)}else throw new Error("Invalid code point")}return J}function z(R){for(var v=[],w=0;w<R.length;++w)v.push(R.charCodeAt(w)&255);return v}function j(R,v){for(var w,E,B,J=[],H=0;H<R.length&&!((v-=2)<0);++H)w=R.charCodeAt(H),E=w>>8,B=w%256,J.push(B),J.push(E);return J}function P(R){return e.toByteArray(_(R))}function F(R,v,w,E){for(var B=0;B<E&&!(B+w>=v.length||B>=R.length);++B)v[B+w]=R[B];return B}function ne(R,v){return R instanceof v||R!=null&&R.constructor!=null&&R.constructor.name!=null&&R.constructor.name===v.name}function T(R){return R!==R}var re=function(){for(var R="0123456789abcdef",v=new Array(256),w=0;w<16;++w)for(var E=w*16,B=0;B<16;++B)v[E+B]=R[w]+R[B];return v}()}(rp)),rp}var np={},ip={},op,BS;function FM(){return BS||(BS=1,op=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var e={},r=Symbol("test"),n=Object(r);if(typeof r=="string"||Object.prototype.toString.call(r)!=="[object Symbol]"||Object.prototype.toString.call(n)!=="[object Symbol]")return!1;var i=42;e[r]=i;for(r 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 o=Object.getOwnPropertySymbols(e);if(o.length!==1||o[0]!==r||!Object.prototype.propertyIsEnumerable.call(e,r))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var s=Object.getOwnPropertyDescriptor(e,r);if(s.value!==i||s.enumerable!==!0)return!1}return!0}),op}var sp,$S;function sw(){if($S)return sp;$S=1;var t=FM();return sp=function(){return t()&&!!Symbol.toStringTag},sp}var ap,jS;function zee(){if(jS)return ap;jS=1;var t=typeof Symbol<"u"&&Symbol,e=FM();return ap=function(){return typeof t!="function"||typeof Symbol!="function"||typeof t("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:e()},ap}var lp,HS;function Uee(){if(HS)return lp;HS=1;var t={foo:{}},e=Object;return lp=function(){return{__proto__:t}.foo===t.foo&&!({__proto__:null}instanceof e)},lp}var cp,zS;function Wee(){if(zS)return cp;zS=1;var t="Function.prototype.bind called on incompatible ",e=Object.prototype.toString,r=Math.max,n="[object Function]",i=function(l,c){for(var u=[],f=0;f<l.length;f+=1)u[f]=l[f];for(var d=0;d<c.length;d+=1)u[d+l.length]=c[d];return u},o=function(l,c){for(var u=[],f=c,d=0;f<l.length;f+=1,d+=1)u[d]=l[f];return u},s=function(a,l){for(var c="",u=0;u<a.length;u+=1)c+=a[u],u+1<a.length&&(c+=l);return c};return cp=function(l){var c=this;if(typeof c!="function"||e.apply(c)!==n)throw new TypeError(t+c);for(var u=o(arguments,1),f,d=function(){if(this instanceof f){var g=c.apply(this,i(u,arguments));return Object(g)===g?g:this}return c.apply(l,i(u,arguments))},h=r(0,c.length-u.length),p=[],m=0;m<h;m++)p[m]="$"+m;if(f=Function("binder","return function ("+s(p,",")+"){ return binder.apply(this,arguments); }")(d),c.prototype){var y=function(){};y.prototype=c.prototype,f.prototype=new y,y.prototype=null}return f},cp}var up,US;function aw(){if(US)return up;US=1;var t=Wee();return up=Function.prototype.bind||t,up}var fp,WS;function Vee(){if(WS)return fp;WS=1;var t=Function.prototype.call,e=Object.prototype.hasOwnProperty,r=aw();return fp=r.call(t,e),fp}var dp,VS;function Hs(){if(VS)return dp;VS=1;var t,e=SyntaxError,r=Function,n=TypeError,i=function(I){try{return r('"use strict"; return ('+I+").constructor;")()}catch{}},o=Object.getOwnPropertyDescriptor;if(o)try{o({},"")}catch{o=null}var s=function(){throw new n},a=o?function(){try{return arguments.callee,s}catch{try{return o(arguments,"callee").get}catch{return s}}}():s,l=zee()(),c=Uee()(),u=Object.getPrototypeOf||(c?function(I){return I.__proto__}:null),f={},d=typeof Uint8Array>"u"||!u?t:u(Uint8Array),h={"%AggregateError%":typeof AggregateError>"u"?t:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?t:ArrayBuffer,"%ArrayIteratorPrototype%":l&&u?u([][Symbol.iterator]()):t,"%AsyncFromSyncIteratorPrototype%":t,"%AsyncFunction%":f,"%AsyncGenerator%":f,"%AsyncGeneratorFunction%":f,"%AsyncIteratorPrototype%":f,"%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%":Error,"%eval%":eval,"%EvalError%":EvalError,"%Float32Array%":typeof Float32Array>"u"?t:Float32Array,"%Float64Array%":typeof Float64Array>"u"?t:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?t:FinalizationRegistry,"%Function%":r,"%GeneratorFunction%":f,"%Int8Array%":typeof Int8Array>"u"?t:Int8Array,"%Int16Array%":typeof Int16Array>"u"?t:Int16Array,"%Int32Array%":typeof Int32Array>"u"?t:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":l&&u?u(u([][Symbol.iterator]())):t,"%JSON%":typeof JSON=="object"?JSON:t,"%Map%":typeof Map>"u"?t:Map,"%MapIteratorPrototype%":typeof Map>"u"||!l||!u?t:u(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?t:Promise,"%Proxy%":typeof Proxy>"u"?t:Proxy,"%RangeError%":RangeError,"%ReferenceError%":ReferenceError,"%Reflect%":typeof Reflect>"u"?t:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?t:Set,"%SetIteratorPrototype%":typeof Set>"u"||!l||!u?t:u(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?t:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":l&&u?u(""[Symbol.iterator]()):t,"%Symbol%":l?Symbol:t,"%SyntaxError%":e,"%ThrowTypeError%":a,"%TypedArray%":d,"%TypeError%":n,"%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%":URIError,"%WeakMap%":typeof WeakMap>"u"?t:WeakMap,"%WeakRef%":typeof WeakRef>"u"?t:WeakRef,"%WeakSet%":typeof WeakSet>"u"?t:WeakSet};if(u)try{null.error}catch(I){var p=u(u(I));h["%Error.prototype%"]=p}var m=function I(U){var k;if(U==="%AsyncFunction%")k=i("async function () {}");else if(U==="%GeneratorFunction%")k=i("function* () {}");else if(U==="%AsyncGeneratorFunction%")k=i("async function* () {}");else if(U==="%AsyncGenerator%"){var G=I("%AsyncGeneratorFunction%");G&&(k=G.prototype)}else if(U==="%AsyncIteratorPrototype%"){var te=I("%AsyncGenerator%");te&&u&&(k=u(te.prototype))}return h[U]=k,k},y={"%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"]},g=aw(),b=Vee(),S=g.call(Function.call,Array.prototype.concat),x=g.call(Function.apply,Array.prototype.splice),O=g.call(Function.call,String.prototype.replace),M=g.call(Function.call,String.prototype.slice),D=g.call(Function.call,RegExp.prototype.exec),$=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,A=/\\(\\)?/g,V=function(U){var k=M(U,0,1),G=M(U,-1);if(k==="%"&&G!=="%")throw new e("invalid intrinsic syntax, expected closing `%`");if(G==="%"&&k!=="%")throw new e("invalid intrinsic syntax, expected opening `%`");var te=[];return O(U,$,function(W,ae,X,de){te[te.length]=X?O(de,A,"$1"):ae||W}),te},Q=function(U,k){var G=U,te;if(b(y,G)&&(te=y[G],G="%"+te[0]+"%"),b(h,G)){var W=h[G];if(W===f&&(W=m(G)),typeof W>"u"&&!k)throw new n("intrinsic "+U+" exists, but is not available. Please file an issue!");return{alias:te,name:G,value:W}}throw new e("intrinsic "+U+" does not exist!")};return dp=function(U,k){if(typeof U!="string"||U.length===0)throw new n("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof k!="boolean")throw new n('"allowMissing" argument must be a boolean');if(D(/^%?[^%]*%?$/,U)===null)throw new e("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var G=V(U),te=G.length>0?G[0]:"",W=Q("%"+te+"%",k),ae=W.name,X=W.value,de=!1,q=W.alias;q&&(te=q[0],x(G,S([0,1],q)));for(var N=1,Y=!0;N<G.length;N+=1){var Z=G[N],ie=M(Z,0,1),K=M(Z,-1);if((ie==='"'||ie==="'"||ie==="`"||K==='"'||K==="'"||K==="`")&&ie!==K)throw new e("property names with quotes must have matching quotes");if((Z==="constructor"||!Y)&&(de=!0),te+="."+Z,ae="%"+te+"%",b(h,ae))X=h[ae];else if(X!=null){if(!(Z in X)){if(!k)throw new n("base intrinsic for "+U+" exists, but the property is not available.");return}if(o&&N+1>=G.length){var _=o(X,Z);Y=!!_,Y&&"get"in _&&!("originalValue"in _.get)?X=_.get:X=X[Z]}else Y=b(X,Z),X=X[Z];Y&&!de&&(h[ae]=X)}}return X},dp}var hp={exports:{}},pp,GS;function BM(){if(GS)return pp;GS=1;var t=Hs(),e=t("%Object.defineProperty%",!0),r=function(){if(e)try{return e({},"a",{value:1}),!0}catch{return!1}return!1};return r.hasArrayLengthDefineBug=function(){if(!r())return null;try{return e([],"length",{value:1}).length!==1}catch{return!0}},pp=r,pp}var mp,KS;function lw(){if(KS)return mp;KS=1;var t=Hs(),e=t("%Object.getOwnPropertyDescriptor%",!0);if(e)try{e([],"length")}catch{e=null}return mp=e,mp}var gp,qS;function Gee(){if(qS)return gp;qS=1;var t=BM()(),e=Hs(),r=t&&e("%Object.defineProperty%",!0);if(r)try{r({},"a",{value:1})}catch{r=!1}var n=e("%SyntaxError%"),i=e("%TypeError%"),o=lw();return gp=function(a,l,c){if(!a||typeof a!="object"&&typeof a!="function")throw new i("`obj` must be an object or a function`");if(typeof l!="string"&&typeof l!="symbol")throw new i("`property` must be a string or a symbol`");if(arguments.length>3&&typeof arguments[3]!="boolean"&&arguments[3]!==null)throw new i("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&typeof arguments[4]!="boolean"&&arguments[4]!==null)throw new i("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&typeof arguments[5]!="boolean"&&arguments[5]!==null)throw new i("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&typeof arguments[6]!="boolean")throw new i("`loose`, if provided, must be a boolean");var u=arguments.length>3?arguments[3]:null,f=arguments.length>4?arguments[4]:null,d=arguments.length>5?arguments[5]:null,h=arguments.length>6?arguments[6]:!1,p=!!o&&o(a,l);if(r)r(a,l,{configurable:d===null&&p?p.configurable:!d,enumerable:u===null&&p?p.enumerable:!u,value:c,writable:f===null&&p?p.writable:!f});else if(h||!u&&!f&&!d)a[l]=c;else throw new n("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.")},gp}var yp,XS;function Kee(){if(XS)return yp;XS=1;var t=Hs(),e=Gee(),r=BM()(),n=lw(),i=t("%TypeError%"),o=t("%Math.floor%");return yp=function(a,l){if(typeof a!="function")throw new i("`fn` is not a function");if(typeof l!="number"||l<0||l>4294967295||o(l)!==l)throw new i("`length` must be a positive 32-bit integer");var c=arguments.length>2&&!!arguments[2],u=!0,f=!0;if("length"in a&&n){var d=n(a,"length");d&&!d.configurable&&(u=!1),d&&!d.writable&&(f=!1)}return(u||f||!c)&&(r?e(a,"length",l,!0,!0):e(a,"length",l)),a},yp}var JS;function $M(){return JS||(JS=1,function(t){var e=aw(),r=Hs(),n=Kee(),i=r("%TypeError%"),o=r("%Function.prototype.apply%"),s=r("%Function.prototype.call%"),a=r("%Reflect.apply%",!0)||e.call(s,o),l=r("%Object.defineProperty%",!0),c=r("%Math.max%");if(l)try{l({},"a",{value:1})}catch{l=null}t.exports=function(d){if(typeof d!="function")throw new i("a function is required");var h=a(e,s,arguments);return n(h,1+c(0,d.length-(arguments.length-1)),!0)};var u=function(){return a(e,o,arguments)};l?l(t.exports,"apply",{value:u}):t.exports.apply=u}(hp)),hp.exports}var vp,YS;function jM(){if(YS)return vp;YS=1;var t=Hs(),e=$M(),r=e(t("String.prototype.indexOf"));return vp=function(i,o){var s=t(i,!!o);return typeof s=="function"&&r(i,".prototype.")>-1?e(s):s},vp}var wp,ZS;function qee(){if(ZS)return wp;ZS=1;var t=sw()(),e=jM(),r=e("Object.prototype.toString"),n=function(a){return t&&a&&typeof a=="object"&&Symbol.toStringTag in a?!1:r(a)==="[object Arguments]"},i=function(a){return n(a)?!0:a!==null&&typeof a=="object"&&typeof a.length=="number"&&a.length>=0&&r(a)!=="[object Array]"&&r(a.callee)==="[object Function]"},o=function(){return n(arguments)}();return n.isLegacyArguments=i,wp=o?n:i,wp}var bp,QS;function Xee(){if(QS)return bp;QS=1;var t=Object.prototype.toString,e=Function.prototype.toString,r=/^\s*(?:function)?\*/,n=sw()(),i=Object.getPrototypeOf,o=function(){if(!n)return!1;try{return Function("return function*() {}")()}catch{}},s;return bp=function(l){if(typeof l!="function")return!1;if(r.test(e.call(l)))return!0;if(!n){var c=t.call(l);return c==="[object GeneratorFunction]"}if(!i)return!1;if(typeof s>"u"){var u=o();s=u?i(u):!1}return i(l)===s},bp}var xp,eE;function Jee(){if(eE)return xp;eE=1;var t=Function.prototype.toString,e=typeof Reflect=="object"&&Reflect!==null&&Reflect.apply,r,n;if(typeof e=="function"&&typeof Object.defineProperty=="function")try{r=Object.defineProperty({},"length",{get:function(){throw n}}),n={},e(function(){throw 42},null,r)}catch(b){b!==n&&(e=null)}else e=null;var i=/^\s*class\b/,o=function(S){try{var x=t.call(S);return i.test(x)}catch{return!1}},s=function(S){try{return o(S)?!1:(t.call(S),!0)}catch{return!1}},a=Object.prototype.toString,l="[object Object]",c="[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[,]),y=function(){return!1};if(typeof document=="object"){var g=document.all;a.call(g)===a.call(document.all)&&(y=function(S){if((m||!S)&&(typeof S>"u"||typeof S=="object"))try{var x=a.call(S);return(x===f||x===d||x===h||x===l)&&S("")==null}catch{}return!1})}return xp=e?function(S){if(y(S))return!0;if(!S||typeof S!="function"&&typeof S!="object")return!1;try{e(S,null,r)}catch(x){if(x!==n)return!1}return!o(S)&&s(S)}:function(S){if(y(S))return!0;if(!S||typeof S!="function"&&typeof S!="object")return!1;if(p)return s(S);if(o(S))return!1;var x=a.call(S);return x!==c&&x!==u&&!/^\[object HTML/.test(x)?!1:s(S)},xp}var Sp,tE;function Yee(){if(tE)return Sp;tE=1;var t=Jee(),e=Object.prototype.toString,r=Object.prototype.hasOwnProperty,n=function(l,c,u){for(var f=0,d=l.length;f<d;f++)r.call(l,f)&&(u==null?c(l[f],f,l):c.call(u,l[f],f,l))},i=function(l,c,u){for(var f=0,d=l.length;f<d;f++)u==null?c(l.charAt(f),f,l):c.call(u,l.charAt(f),f,l)},o=function(l,c,u){for(var f in l)r.call(l,f)&&(u==null?c(l[f],f,l):c.call(u,l[f],f,l))},s=function(l,c,u){if(!t(c))throw new TypeError("iterator must be a function");var f;arguments.length>=3&&(f=u),e.call(l)==="[object Array]"?n(l,c,f):typeof l=="string"?i(l,c,f):o(l,c,f)};return Sp=s,Sp}var Ep,rE;function Zee(){if(rE)return Ep;rE=1;var t=["BigInt64Array","BigUint64Array","Float32Array","Float64Array","Int16Array","Int32Array","Int8Array","Uint16Array","Uint32Array","Uint8Array","Uint8ClampedArray"],e=typeof globalThis>"u"?Vr:globalThis;return Ep=function(){for(var n=[],i=0;i<t.length;i++)typeof e[t[i]]=="function"&&(n[n.length]=t[i]);return n},Ep}var Tp,nE;function HM(){if(nE)return Tp;nE=1;var t=Yee(),e=Zee(),r=$M(),n=jM(),i=lw(),o=n("Object.prototype.toString"),s=sw()(),a=typeof globalThis>"u"?Vr:globalThis,l=e(),c=n("String.prototype.slice"),u=Object.getPrototypeOf,f=n("Array.prototype.indexOf",!0)||function(y,g){for(var b=0;b<y.length;b+=1)if(y[b]===g)return b;return-1},d={__proto__:null};s&&i&&u?t(l,function(m){var y=new a[m];if(Symbol.toStringTag in y){var g=u(y),b=i(g,Symbol.toStringTag);if(!b){var S=u(g);b=i(S,Symbol.toStringTag)}d["$"+m]=r(b.get)}}):t(l,function(m){var y=new a[m],g=y.slice||y.set;g&&(d["$"+m]=r(g))});var h=function(y){var g=!1;return t(d,function(b,S){if(!g)try{"$"+b(y)===S&&(g=c(S,1))}catch{}}),g},p=function(y){var g=!1;return t(d,function(b,S){if(!g)try{b(y),g=c(S,1)}catch{}}),g};return Tp=function(y){if(!y||typeof y!="object")return!1;if(!s){var g=c(o(y),8,-1);return f(l,g)>-1?g:g!=="Object"?!1:p(y)}return i?h(y):null},Tp}var Ap,iE;function Qee(){if(iE)return Ap;iE=1;var t=HM();return Ap=function(r){return!!t(r)},Ap}var oE;function ete(){return oE||(oE=1,function(t){var e=qee(),r=Xee(),n=HM(),i=Qee();function o(E){return E.call.bind(E)}var s=typeof BigInt<"u",a=typeof Symbol<"u",l=o(Object.prototype.toString),c=o(Number.prototype.valueOf),u=o(String.prototype.valueOf),f=o(Boolean.prototype.valueOf);if(s)var d=o(BigInt.prototype.valueOf);if(a)var h=o(Symbol.prototype.valueOf);function p(E,B){if(typeof E!="object")return!1;try{return B(E),!0}catch{return!1}}t.isArgumentsObject=e,t.isGeneratorFunction=r,t.isTypedArray=i;function m(E){return typeof Promise<"u"&&E instanceof Promise||E!==null&&typeof E=="object"&&typeof E.then=="function"&&typeof E.catch=="function"}t.isPromise=m;function y(E){return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?ArrayBuffer.isView(E):i(E)||Y(E)}t.isArrayBufferView=y;function g(E){return n(E)==="Uint8Array"}t.isUint8Array=g;function b(E){return n(E)==="Uint8ClampedArray"}t.isUint8ClampedArray=b;function S(E){return n(E)==="Uint16Array"}t.isUint16Array=S;function x(E){return n(E)==="Uint32Array"}t.isUint32Array=x;function O(E){return n(E)==="Int8Array"}t.isInt8Array=O;function M(E){return n(E)==="Int16Array"}t.isInt16Array=M;function D(E){return n(E)==="Int32Array"}t.isInt32Array=D;function $(E){return n(E)==="Float32Array"}t.isFloat32Array=$;function A(E){return n(E)==="Float64Array"}t.isFloat64Array=A;function V(E){return n(E)==="BigInt64Array"}t.isBigInt64Array=V;function Q(E){return n(E)==="BigUint64Array"}t.isBigUint64Array=Q;function I(E){return l(E)==="[object Map]"}I.working=typeof Map<"u"&&I(new Map);function U(E){return typeof Map>"u"?!1:I.working?I(E):E instanceof Map}t.isMap=U;function k(E){return l(E)==="[object Set]"}k.working=typeof Set<"u"&&k(new Set);function G(E){return typeof Set>"u"?!1:k.working?k(E):E instanceof Set}t.isSet=G;function te(E){return l(E)==="[object WeakMap]"}te.working=typeof WeakMap<"u"&&te(new WeakMap);function W(E){return typeof WeakMap>"u"?!1:te.working?te(E):E instanceof WeakMap}t.isWeakMap=W;function ae(E){return l(E)==="[object WeakSet]"}ae.working=typeof WeakSet<"u"&&ae(new WeakSet);function X(E){return ae(E)}t.isWeakSet=X;function de(E){return l(E)==="[object ArrayBuffer]"}de.working=typeof ArrayBuffer<"u"&&de(new ArrayBuffer);function q(E){return typeof ArrayBuffer>"u"?!1:de.working?de(E):E instanceof ArrayBuffer}t.isArrayBuffer=q;function N(E){return l(E)==="[object DataView]"}N.working=typeof ArrayBuffer<"u"&&typeof DataView<"u"&&N(new DataView(new ArrayBuffer(1),0,1));function Y(E){return typeof DataView>"u"?!1:N.working?N(E):E instanceof DataView}t.isDataView=Y;var Z=typeof SharedArrayBuffer<"u"?SharedArrayBuffer:void 0;function ie(E){return l(E)==="[object SharedArrayBuffer]"}function K(E){return typeof Z>"u"?!1:(typeof ie.working>"u"&&(ie.working=ie(new Z)),ie.working?ie(E):E instanceof Z)}t.isSharedArrayBuffer=K;function _(E){return l(E)==="[object AsyncFunction]"}t.isAsyncFunction=_;function C(E){return l(E)==="[object Map Iterator]"}t.isMapIterator=C;function z(E){return l(E)==="[object Set Iterator]"}t.isSetIterator=z;function j(E){return l(E)==="[object Generator]"}t.isGeneratorObject=j;function P(E){return l(E)==="[object WebAssembly.Module]"}t.isWebAssemblyCompiledModule=P;function F(E){return p(E,c)}t.isNumberObject=F;function ne(E){return p(E,u)}t.isStringObject=ne;function T(E){return p(E,f)}t.isBooleanObject=T;function re(E){return s&&p(E,d)}t.isBigIntObject=re;function R(E){return a&&p(E,h)}t.isSymbolObject=R;function v(E){return F(E)||ne(E)||T(E)||re(E)||R(E)}t.isBoxedPrimitive=v;function w(E){return typeof Uint8Array<"u"&&(q(E)||K(E))}t.isAnyArrayBuffer=w,["isProxy","isExternal","isModuleNamespaceObject"].forEach(function(E){Object.defineProperty(t,E,{enumerable:!1,value:function(){throw new Error(E+" is not supported in userland")}})})}(ip)),ip}var Cp,sE;function tte(){return sE||(sE=1,Cp=function(e){return e&&typeof e=="object"&&typeof e.copy=="function"&&typeof e.fill=="function"&&typeof e.readUInt8=="function"}),Cp}var aE;function zM(){return aE||(aE=1,function(t){var e=Object.getOwnPropertyDescriptors||function(Y){for(var Z=Object.keys(Y),ie={},K=0;K<Z.length;K++)ie[Z[K]]=Object.getOwnPropertyDescriptor(Y,Z[K]);return ie},r=/%[sdj%]/g;t.format=function(N){if(!O(N)){for(var Y=[],Z=0;Z<arguments.length;Z++)Y.push(s(arguments[Z]));return Y.join(" ")}for(var Z=1,ie=arguments,K=ie.length,_=String(N).replace(r,function(z){if(z==="%%")return"%";if(Z>=K)return z;switch(z){case"%s":return String(ie[Z++]);case"%d":return Number(ie[Z++]);case"%j":try{return JSON.stringify(ie[Z++])}catch{return"[Circular]"}default:return z}}),C=ie[Z];Z<K;C=ie[++Z])b(C)||!A(C)?_+=" "+C:_+=" "+s(C);return _},t.deprecate=function(N,Y){if(typeof Pe<"u"&&Pe.noDeprecation===!0)return N;if(typeof Pe>"u")return function(){return t.deprecate(N,Y).apply(this,arguments)};var Z=!1;function ie(){if(!Z){if(Pe.throwDeprecation)throw new Error(Y);Pe.traceDeprecation?console.trace(Y):console.error(Y),Z=!0}return N.apply(this,arguments)}return ie};var n={},i=/^$/;if(Pe.env.NODE_DEBUG){var o=Pe.env.NODE_DEBUG;o=o.replace(/[|\\{}()[\]^$+?.]/g,"\\$&").replace(/\*/g,".*").replace(/,/g,"$|^").toUpperCase(),i=new RegExp("^"+o+"$","i")}t.debuglog=function(N){if(N=N.toUpperCase(),!n[N])if(i.test(N)){var Y=Pe.pid;n[N]=function(){var Z=t.format.apply(t,arguments);console.error("%s %d: %s",N,Y,Z)}}else n[N]=function(){};return n[N]};function s(N,Y){var Z={seen:[],stylize:l};return arguments.length>=3&&(Z.depth=arguments[2]),arguments.length>=4&&(Z.colors=arguments[3]),g(Y)?Z.showHidden=Y:Y&&t._extend(Z,Y),D(Z.showHidden)&&(Z.showHidden=!1),D(Z.depth)&&(Z.depth=2),D(Z.colors)&&(Z.colors=!1),D(Z.customInspect)&&(Z.customInspect=!0),Z.colors&&(Z.stylize=a),u(Z,N,Z.depth)}t.inspect=s,s.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},s.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"};function a(N,Y){var Z=s.styles[Y];return Z?"\x1B["+s.colors[Z][0]+"m"+N+"\x1B["+s.colors[Z][1]+"m":N}function l(N,Y){return N}function c(N){var Y={};return N.forEach(function(Z,ie){Y[Z]=!0}),Y}function u(N,Y,Z){if(N.customInspect&&Y&&I(Y.inspect)&&Y.inspect!==t.inspect&&!(Y.constructor&&Y.constructor.prototype===Y)){var ie=Y.inspect(Z,N);return O(ie)||(ie=u(N,ie,Z)),ie}var K=f(N,Y);if(K)return K;var _=Object.keys(Y),C=c(_);if(N.showHidden&&(_=Object.getOwnPropertyNames(Y)),Q(Y)&&(_.indexOf("message")>=0||_.indexOf("description")>=0))return d(Y);if(_.length===0){if(I(Y)){var z=Y.name?": "+Y.name:"";return N.stylize("[Function"+z+"]","special")}if($(Y))return N.stylize(RegExp.prototype.toString.call(Y),"regexp");if(V(Y))return N.stylize(Date.prototype.toString.call(Y),"date");if(Q(Y))return d(Y)}var j="",P=!1,F=["{","}"];if(y(Y)&&(P=!0,F=["[","]"]),I(Y)){var ne=Y.name?": "+Y.name:"";j=" [Function"+ne+"]"}if($(Y)&&(j=" "+RegExp.prototype.toString.call(Y)),V(Y)&&(j=" "+Date.prototype.toUTCString.call(Y)),Q(Y)&&(j=" "+d(Y)),_.length===0&&(!P||Y.length==0))return F[0]+j+F[1];if(Z<0)return $(Y)?N.stylize(RegExp.prototype.toString.call(Y),"regexp"):N.stylize("[Object]","special");N.seen.push(Y);var T;return P?T=h(N,Y,Z,C,_):T=_.map(function(re){return p(N,Y,Z,C,re,P)}),N.seen.pop(),m(T,j,F)}function f(N,Y){if(D(Y))return N.stylize("undefined","undefined");if(O(Y)){var Z="'"+JSON.stringify(Y).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return N.stylize(Z,"string")}if(x(Y))return N.stylize(""+Y,"number");if(g(Y))return N.stylize(""+Y,"boolean");if(b(Y))return N.stylize("null","null")}function d(N){return"["+Error.prototype.toString.call(N)+"]"}function h(N,Y,Z,ie,K){for(var _=[],C=0,z=Y.length;C<z;++C)ae(Y,String(C))?_.push(p(N,Y,Z,ie,String(C),!0)):_.push("");return K.forEach(function(j){j.match(/^\d+$/)||_.push(p(N,Y,Z,ie,j,!0))}),_}function p(N,Y,Z,ie,K,_){var C,z,j;if(j=Object.getOwnPropertyDescriptor(Y,K)||{value:Y[K]},j.get?j.set?z=N.stylize("[Getter/Setter]","special"):z=N.stylize("[Getter]","special"):j.set&&(z=N.stylize("[Setter]","special")),ae(ie,K)||(C="["+K+"]"),z||(N.seen.indexOf(j.value)<0?(b(Z)?z=u(N,j.value,null):z=u(N,j.value,Z-1),z.indexOf(`
571
- `)>-1&&(_?z=z.split(`
572
- `).map(function(P){return" "+P}).join(`
573
- `).slice(2):z=`
574
- `+z.split(`
575
- `).map(function(P){return" "+P}).join(`
576
- `))):z=N.stylize("[Circular]","special")),D(C)){if(_&&K.match(/^\d+$/))return z;C=JSON.stringify(""+K),C.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(C=C.slice(1,-1),C=N.stylize(C,"name")):(C=C.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),C=N.stylize(C,"string"))}return C+": "+z}function m(N,Y,Z){var ie=N.reduce(function(K,_){return _.indexOf(`
577
- `)>=0,K+_.replace(/\u001b\[\d\d?m/g,"").length+1},0);return ie>60?Z[0]+(Y===""?"":Y+`
578
- `)+" "+N.join(`,
579
- `)+" "+Z[1]:Z[0]+Y+" "+N.join(", ")+" "+Z[1]}t.types=ete();function y(N){return Array.isArray(N)}t.isArray=y;function g(N){return typeof N=="boolean"}t.isBoolean=g;function b(N){return N===null}t.isNull=b;function S(N){return N==null}t.isNullOrUndefined=S;function x(N){return typeof N=="number"}t.isNumber=x;function O(N){return typeof N=="string"}t.isString=O;function M(N){return typeof N=="symbol"}t.isSymbol=M;function D(N){return N===void 0}t.isUndefined=D;function $(N){return A(N)&&k(N)==="[object RegExp]"}t.isRegExp=$,t.types.isRegExp=$;function A(N){return typeof N=="object"&&N!==null}t.isObject=A;function V(N){return A(N)&&k(N)==="[object Date]"}t.isDate=V,t.types.isDate=V;function Q(N){return A(N)&&(k(N)==="[object Error]"||N instanceof Error)}t.isError=Q,t.types.isNativeError=Q;function I(N){return typeof N=="function"}t.isFunction=I;function U(N){return N===null||typeof N=="boolean"||typeof N=="number"||typeof N=="string"||typeof N=="symbol"||typeof N>"u"}t.isPrimitive=U,t.isBuffer=tte();function k(N){return Object.prototype.toString.call(N)}function G(N){return N<10?"0"+N.toString(10):N.toString(10)}var te=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function W(){var N=new Date,Y=[G(N.getHours()),G(N.getMinutes()),G(N.getSeconds())].join(":");return[N.getDate(),te[N.getMonth()],Y].join(" ")}t.log=function(){console.log("%s - %s",W(),t.format.apply(t,arguments))},t.inherits=wo,t._extend=function(N,Y){if(!Y||!A(Y))return N;for(var Z=Object.keys(Y),ie=Z.length;ie--;)N[Z[ie]]=Y[Z[ie]];return N};function ae(N,Y){return Object.prototype.hasOwnProperty.call(N,Y)}var X=typeof Symbol<"u"?Symbol("util.promisify.custom"):void 0;t.promisify=function(Y){if(typeof Y!="function")throw new TypeError('The "original" argument must be of type Function');if(X&&Y[X]){var Z=Y[X];if(typeof Z!="function")throw new TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(Z,X,{value:Z,enumerable:!1,writable:!1,configurable:!0}),Z}function Z(){for(var ie,K,_=new Promise(function(j,P){ie=j,K=P}),C=[],z=0;z<arguments.length;z++)C.push(arguments[z]);C.push(function(j,P){j?K(j):ie(P)});try{Y.apply(this,C)}catch(j){K(j)}return _}return Object.setPrototypeOf(Z,Object.getPrototypeOf(Y)),X&&Object.defineProperty(Z,X,{value:Z,enumerable:!1,writable:!1,configurable:!0}),Object.defineProperties(Z,e(Y))},t.promisify.custom=X;function de(N,Y){if(!N){var Z=new Error("Promise was rejected with a falsy value");Z.reason=N,N=Z}return Y(N)}function q(N){if(typeof N!="function")throw new TypeError('The "original" argument must be of type Function');function Y(){for(var Z=[],ie=0;ie<arguments.length;ie++)Z.push(arguments[ie]);var K=Z.pop();if(typeof K!="function")throw new TypeError("The last argument must be of type Function");var _=this,C=function(){return K.apply(_,arguments)};N.apply(this,Z).then(function(z){Pe.nextTick(C.bind(null,null,z))},function(z){Pe.nextTick(de.bind(null,z,C))})}return Object.setPrototypeOf(Y,Object.getPrototypeOf(N)),Object.defineProperties(Y,e(N)),Y}t.callbackify=q}(np)),np}var kp,lE;function rte(){if(lE)return kp;lE=1;function t(d,h){var p=Object.keys(d);if(Object.getOwnPropertySymbols){var m=Object.getOwnPropertySymbols(d);h&&(m=m.filter(function(y){return Object.getOwnPropertyDescriptor(d,y).enumerable})),p.push.apply(p,m)}return p}function e(d){for(var h=1;h<arguments.length;h++){var p=arguments[h]!=null?arguments[h]:{};h%2?t(Object(p),!0).forEach(function(m){r(d,m,p[m])}):Object.getOwnPropertyDescriptors?Object.defineProperties(d,Object.getOwnPropertyDescriptors(p)):t(Object(p)).forEach(function(m){Object.defineProperty(d,m,Object.getOwnPropertyDescriptor(p,m))})}return d}function r(d,h,p){return h in d?Object.defineProperty(d,h,{value:p,enumerable:!0,configurable:!0,writable:!0}):d[h]=p,d}function n(d,h){if(!(d instanceof h))throw new TypeError("Cannot call a class as a function")}function i(d,h){for(var p=0;p<h.length;p++){var m=h[p];m.enumerable=m.enumerable||!1,m.configurable=!0,"value"in m&&(m.writable=!0),Object.defineProperty(d,m.key,m)}}function o(d,h,p){return h&&i(d.prototype,h),d}var s=yd(),a=s.Buffer,l=zM(),c=l.inspect,u=c&&c.custom||"inspect";function f(d,h,p){a.prototype.copy.call(d,h,p)}return kp=function(){function d(){n(this,d),this.head=null,this.tail=null,this.length=0}return o(d,[{key:"push",value:function(p){var m={data:p,next:null};this.length>0?this.tail.next=m:this.head=m,this.tail=m,++this.length}},{key:"unshift",value:function(p){var m={data:p,next:this.head};this.length===0&&(this.tail=m),this.head=m,++this.length}},{key:"shift",value:function(){if(this.length!==0){var p=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,p}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(p){if(this.length===0)return"";for(var m=this.head,y=""+m.data;m=m.next;)y+=p+m.data;return y}},{key:"concat",value:function(p){if(this.length===0)return a.alloc(0);for(var m=a.allocUnsafe(p>>>0),y=this.head,g=0;y;)f(y.data,m,g),g+=y.data.length,y=y.next;return m}},{key:"consume",value:function(p,m){var y;return p<this.head.data.length?(y=this.head.data.slice(0,p),this.head.data=this.head.data.slice(p)):p===this.head.data.length?y=this.shift():y=m?this._getString(p):this._getBuffer(p),y}},{key:"first",value:function(){return this.head.data}},{key:"_getString",value:function(p){var m=this.head,y=1,g=m.data;for(p-=g.length;m=m.next;){var b=m.data,S=p>b.length?b.length:p;if(S===b.length?g+=b:g+=b.slice(0,p),p-=S,p===0){S===b.length?(++y,m.next?this.head=m.next:this.head=this.tail=null):(this.head=m,m.data=b.slice(S));break}++y}return this.length-=y,g}},{key:"_getBuffer",value:function(p){var m=a.allocUnsafe(p),y=this.head,g=1;for(y.data.copy(m),p-=y.data.length;y=y.next;){var b=y.data,S=p>b.length?b.length:p;if(b.copy(m,m.length-p,0,S),p-=S,p===0){S===b.length?(++g,y.next?this.head=y.next:this.head=this.tail=null):(this.head=y,y.data=b.slice(S));break}++g}return this.length-=g,m}},{key:u,value:function(p,m){return c(this,e({},m,{depth:0,customInspect:!1}))}}]),d}(),kp}var _p,cE;function UM(){if(cE)return _p;cE=1;function t(s,a){var l=this,c=this._readableState&&this._readableState.destroyed,u=this._writableState&&this._writableState.destroyed;return c||u?(a?a(s):s&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,Pe.nextTick(i,this,s)):Pe.nextTick(i,this,s)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(s||null,function(f){!a&&f?l._writableState?l._writableState.errorEmitted?Pe.nextTick(r,l):(l._writableState.errorEmitted=!0,Pe.nextTick(e,l,f)):Pe.nextTick(e,l,f):a?(Pe.nextTick(r,l),a(f)):Pe.nextTick(r,l)}),this)}function e(s,a){i(s,a),r(s)}function r(s){s._writableState&&!s._writableState.emitClose||s._readableState&&!s._readableState.emitClose||s.emit("close")}function n(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}function i(s,a){s.emit("error",a)}function o(s,a){var l=s._readableState,c=s._writableState;l&&l.autoDestroy||c&&c.autoDestroy?s.destroy(a):s.emit("error",a)}return _p={destroy:t,undestroy:n,errorOrDestroy:o},_p}var Op={},uE;function zs(){if(uE)return Op;uE=1;function t(a,l){a.prototype=Object.create(l.prototype),a.prototype.constructor=a,a.__proto__=l}var e={};function r(a,l,c){c||(c=Error);function u(d,h,p){return typeof l=="string"?l:l(d,h,p)}var f=function(d){t(h,d);function h(p,m,y){return d.call(this,u(p,m,y))||this}return h}(c);f.prototype.name=c.name,f.prototype.code=a,e[a]=f}function n(a,l){if(Array.isArray(a)){var c=a.length;return a=a.map(function(u){return String(u)}),c>2?"one of ".concat(l," ").concat(a.slice(0,c-1).join(", "),", or ")+a[c-1]:c===2?"one of ".concat(l," ").concat(a[0]," or ").concat(a[1]):"of ".concat(l," ").concat(a[0])}else return"of ".concat(l," ").concat(String(a))}function i(a,l,c){return a.substr(0,l.length)===l}function o(a,l,c){return(c===void 0||c>a.length)&&(c=a.length),a.substring(c-l.length,c)===l}function s(a,l,c){return typeof c!="number"&&(c=0),c+l.length>a.length?!1:a.indexOf(l,c)!==-1}return r("ERR_INVALID_OPT_VALUE",function(a,l){return'The value "'+l+'" is invalid for option "'+a+'"'},TypeError),r("ERR_INVALID_ARG_TYPE",function(a,l,c){var u;typeof l=="string"&&i(l,"not ")?(u="must not be",l=l.replace(/^not /,"")):u="must be";var f;if(o(a," argument"))f="The ".concat(a," ").concat(u," ").concat(n(l,"type"));else{var d=s(a,".")?"property":"argument";f='The "'.concat(a,'" ').concat(d," ").concat(u," ").concat(n(l,"type"))}return f+=". Received type ".concat(typeof c),f},TypeError),r("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),r("ERR_METHOD_NOT_IMPLEMENTED",function(a){return"The "+a+" method is not implemented"}),r("ERR_STREAM_PREMATURE_CLOSE","Premature close"),r("ERR_STREAM_DESTROYED",function(a){return"Cannot call "+a+" after a stream was destroyed"}),r("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),r("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),r("ERR_STREAM_WRITE_AFTER_END","write after end"),r("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),r("ERR_UNKNOWN_ENCODING",function(a){return"Unknown encoding: "+a},TypeError),r("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),Op.codes=e,Op}var Rp,fE;function WM(){if(fE)return Rp;fE=1;var t=zs().codes.ERR_INVALID_OPT_VALUE;function e(n,i,o){return n.highWaterMark!=null?n.highWaterMark:i?n[o]:null}function r(n,i,o,s){var a=e(i,s,o);if(a!=null){if(!(isFinite(a)&&Math.floor(a)===a)||a<0){var l=s?o:"highWaterMark";throw new t(l,a)}return Math.floor(a)}return n.objectMode?16:16*1024}return Rp={getHighWaterMark:r},Rp}var Mp,dE;function nte(){if(dE)return Mp;dE=1,Mp=t;function t(r,n){if(e("noDeprecation"))return r;var i=!1;function o(){if(!i){if(e("throwDeprecation"))throw new Error(n);e("traceDeprecation")?console.trace(n):console.warn(n),i=!0}return r.apply(this,arguments)}return o}function e(r){try{if(!Vr.localStorage)return!1}catch{return!1}var n=Vr.localStorage[r];return n==null?!1:String(n).toLowerCase()==="true"}return Mp}var Ip,hE;function VM(){if(hE)return Ip;hE=1,Ip=$;function t(K){var _=this;this.next=null,this.entry=null,this.finish=function(){ie(_,K)}}var e;$.WritableState=M;var r={deprecate:nte()},n=LM(),i=yd().Buffer,o=Vr.Uint8Array||function(){};function s(K){return i.from(K)}function a(K){return i.isBuffer(K)||K instanceof o}var l=UM(),c=WM(),u=c.getHighWaterMark,f=zs().codes,d=f.ERR_INVALID_ARG_TYPE,h=f.ERR_METHOD_NOT_IMPLEMENTED,p=f.ERR_MULTIPLE_CALLBACK,m=f.ERR_STREAM_CANNOT_PIPE,y=f.ERR_STREAM_DESTROYED,g=f.ERR_STREAM_NULL_VALUES,b=f.ERR_STREAM_WRITE_AFTER_END,S=f.ERR_UNKNOWN_ENCODING,x=l.errorOrDestroy;wo($,n);function O(){}function M(K,_,C){e=e||Cs(),K=K||{},typeof C!="boolean"&&(C=_ instanceof e),this.objectMode=!!K.objectMode,C&&(this.objectMode=this.objectMode||!!K.writableObjectMode),this.highWaterMark=u(this,K,"writableHighWaterMark",C),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var z=K.decodeStrings===!1;this.decodeStrings=!z,this.defaultEncoding=K.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(j){te(_,j)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=K.emitClose!==!1,this.autoDestroy=!!K.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new t(this)}M.prototype.getBuffer=function(){for(var _=this.bufferedRequest,C=[];_;)C.push(_),_=_.next;return C},function(){try{Object.defineProperty(M.prototype,"buffer",{get:r.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch{}}();var D;typeof Symbol=="function"&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]=="function"?(D=Function.prototype[Symbol.hasInstance],Object.defineProperty($,Symbol.hasInstance,{value:function(_){return D.call(this,_)?!0:this!==$?!1:_&&_._writableState instanceof M}})):D=function(_){return _ instanceof this};function $(K){e=e||Cs();var _=this instanceof e;if(!_&&!D.call($,this))return new $(K);this._writableState=new M(K,this,_),this.writable=!0,K&&(typeof K.write=="function"&&(this._write=K.write),typeof K.writev=="function"&&(this._writev=K.writev),typeof K.destroy=="function"&&(this._destroy=K.destroy),typeof K.final=="function"&&(this._final=K.final)),n.call(this)}$.prototype.pipe=function(){x(this,new m)};function A(K,_){var C=new b;x(K,C),Pe.nextTick(_,C)}function V(K,_,C,z){var j;return C===null?j=new g:typeof C!="string"&&!_.objectMode&&(j=new d("chunk",["string","Buffer"],C)),j?(x(K,j),Pe.nextTick(z,j),!1):!0}$.prototype.write=function(K,_,C){var z=this._writableState,j=!1,P=!z.objectMode&&a(K);return P&&!i.isBuffer(K)&&(K=s(K)),typeof _=="function"&&(C=_,_=null),P?_="buffer":_||(_=z.defaultEncoding),typeof C!="function"&&(C=O),z.ending?A(this,C):(P||V(this,z,K,C))&&(z.pendingcb++,j=I(this,z,P,K,_,C)),j},$.prototype.cork=function(){this._writableState.corked++},$.prototype.uncork=function(){var K=this._writableState;K.corked&&(K.corked--,!K.writing&&!K.corked&&!K.bufferProcessing&&K.bufferedRequest&&X(this,K))},$.prototype.setDefaultEncoding=function(_){if(typeof _=="string"&&(_=_.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((_+"").toLowerCase())>-1))throw new S(_);return this._writableState.defaultEncoding=_,this},Object.defineProperty($.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}});function Q(K,_,C){return!K.objectMode&&K.decodeStrings!==!1&&typeof _=="string"&&(_=i.from(_,C)),_}Object.defineProperty($.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function I(K,_,C,z,j,P){if(!C){var F=Q(_,z,j);z!==F&&(C=!0,j="buffer",z=F)}var ne=_.objectMode?1:z.length;_.length+=ne;var T=_.length<_.highWaterMark;if(T||(_.needDrain=!0),_.writing||_.corked){var re=_.lastBufferedRequest;_.lastBufferedRequest={chunk:z,encoding:j,isBuf:C,callback:P,next:null},re?re.next=_.lastBufferedRequest:_.bufferedRequest=_.lastBufferedRequest,_.bufferedRequestCount+=1}else U(K,_,!1,ne,z,j,P);return T}function U(K,_,C,z,j,P,F){_.writelen=z,_.writecb=F,_.writing=!0,_.sync=!0,_.destroyed?_.onwrite(new y("write")):C?K._writev(j,_.onwrite):K._write(j,P,_.onwrite),_.sync=!1}function k(K,_,C,z,j){--_.pendingcb,C?(Pe.nextTick(j,z),Pe.nextTick(Y,K,_),K._writableState.errorEmitted=!0,x(K,z)):(j(z),K._writableState.errorEmitted=!0,x(K,z),Y(K,_))}function G(K){K.writing=!1,K.writecb=null,K.length-=K.writelen,K.writelen=0}function te(K,_){var C=K._writableState,z=C.sync,j=C.writecb;if(typeof j!="function")throw new p;if(G(C),_)k(K,C,z,_,j);else{var P=de(C)||K.destroyed;!P&&!C.corked&&!C.bufferProcessing&&C.bufferedRequest&&X(K,C),z?Pe.nextTick(W,K,C,P,j):W(K,C,P,j)}}function W(K,_,C,z){C||ae(K,_),_.pendingcb--,z(),Y(K,_)}function ae(K,_){_.length===0&&_.needDrain&&(_.needDrain=!1,K.emit("drain"))}function X(K,_){_.bufferProcessing=!0;var C=_.bufferedRequest;if(K._writev&&C&&C.next){var z=_.bufferedRequestCount,j=new Array(z),P=_.corkedRequestsFree;P.entry=C;for(var F=0,ne=!0;C;)j[F]=C,C.isBuf||(ne=!1),C=C.next,F+=1;j.allBuffers=ne,U(K,_,!0,_.length,j,"",P.finish),_.pendingcb++,_.lastBufferedRequest=null,P.next?(_.corkedRequestsFree=P.next,P.next=null):_.corkedRequestsFree=new t(_),_.bufferedRequestCount=0}else{for(;C;){var T=C.chunk,re=C.encoding,R=C.callback,v=_.objectMode?1:T.length;if(U(K,_,!1,v,T,re,R),C=C.next,_.bufferedRequestCount--,_.writing)break}C===null&&(_.lastBufferedRequest=null)}_.bufferedRequest=C,_.bufferProcessing=!1}$.prototype._write=function(K,_,C){C(new h("_write()"))},$.prototype._writev=null,$.prototype.end=function(K,_,C){var z=this._writableState;return typeof K=="function"?(C=K,K=null,_=null):typeof _=="function"&&(C=_,_=null),K!=null&&this.write(K,_),z.corked&&(z.corked=1,this.uncork()),z.ending||Z(this,z,C),this},Object.defineProperty($.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}});function de(K){return K.ending&&K.length===0&&K.bufferedRequest===null&&!K.finished&&!K.writing}function q(K,_){K._final(function(C){_.pendingcb--,C&&x(K,C),_.prefinished=!0,K.emit("prefinish"),Y(K,_)})}function N(K,_){!_.prefinished&&!_.finalCalled&&(typeof K._final=="function"&&!_.destroyed?(_.pendingcb++,_.finalCalled=!0,Pe.nextTick(q,K,_)):(_.prefinished=!0,K.emit("prefinish")))}function Y(K,_){var C=de(_);if(C&&(N(K,_),_.pendingcb===0&&(_.finished=!0,K.emit("finish"),_.autoDestroy))){var z=K._readableState;(!z||z.autoDestroy&&z.endEmitted)&&K.destroy()}return C}function Z(K,_,C){_.ending=!0,Y(K,_),C&&(_.finished?Pe.nextTick(C):K.once("finish",C)),_.ended=!0,K.writable=!1}function ie(K,_,C){var z=K.entry;for(K.entry=null;z;){var j=z.callback;_.pendingcb--,j(C),z=z.next}_.corkedRequestsFree.next=K}return Object.defineProperty($.prototype,"destroyed",{enumerable:!1,get:function(){return this._writableState===void 0?!1:this._writableState.destroyed},set:function(_){this._writableState&&(this._writableState.destroyed=_)}}),$.prototype.destroy=l.destroy,$.prototype._undestroy=l.undestroy,$.prototype._destroy=function(K,_){_(K)},Ip}var Np,pE;function Cs(){if(pE)return Np;pE=1;var t=Object.keys||function(c){var u=[];for(var f in c)u.push(f);return u};Np=s;var e=GM(),r=VM();wo(s,e);for(var n=t(r.prototype),i=0;i<n.length;i++){var o=n[i];s.prototype[o]||(s.prototype[o]=r.prototype[o])}function s(c){if(!(this instanceof s))return new s(c);e.call(this,c),r.call(this,c),this.allowHalfOpen=!0,c&&(c.readable===!1&&(this.readable=!1),c.writable===!1&&(this.writable=!1),c.allowHalfOpen===!1&&(this.allowHalfOpen=!1,this.once("end",a)))}Object.defineProperty(s.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Object.defineProperty(s.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(s.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}});function a(){this._writableState.ended||Pe.nextTick(l,this)}function l(c){c.end()}return Object.defineProperty(s.prototype,"destroyed",{enumerable:!1,get:function(){return this._readableState===void 0||this._writableState===void 0?!1:this._readableState.destroyed&&this._writableState.destroyed},set:function(u){this._readableState===void 0||this._writableState===void 0||(this._readableState.destroyed=u,this._writableState.destroyed=u)}}),Np}var Dp={},dc={exports:{}},mE;function ite(){return mE||(mE=1,function(t,e){var r=yd(),n=r.Buffer;function i(s,a){for(var l in s)a[l]=s[l]}n.from&&n.alloc&&n.allocUnsafe&&n.allocUnsafeSlow?t.exports=r:(i(r,e),e.Buffer=o);function o(s,a,l){return n(s,a,l)}i(n,o),o.from=function(s,a,l){if(typeof s=="number")throw new TypeError("Argument must not be a number");return n(s,a,l)},o.alloc=function(s,a,l){if(typeof s!="number")throw new TypeError("Argument must be a number");var c=n(s);return a!==void 0?typeof l=="string"?c.fill(a,l):c.fill(a):c.fill(0),c},o.allocUnsafe=function(s){if(typeof s!="number")throw new TypeError("Argument must be a number");return n(s)},o.allocUnsafeSlow=function(s){if(typeof s!="number")throw new TypeError("Argument must be a number");return r.SlowBuffer(s)}}(dc,dc.exports)),dc.exports}var gE;function qg(){if(gE)return Dp;gE=1;var t=ite().Buffer,e=t.isEncoding||function(g){switch(g=""+g,g&&g.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function r(g){if(!g)return"utf8";for(var b;;)switch(g){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return g;default:if(b)return;g=(""+g).toLowerCase(),b=!0}}function n(g){var b=r(g);if(typeof b!="string"&&(t.isEncoding===e||!e(g)))throw new Error("Unknown encoding: "+g);return b||g}Dp.StringDecoder=i;function i(g){this.encoding=n(g);var b;switch(this.encoding){case"utf16le":this.text=f,this.end=d,b=4;break;case"utf8":this.fillLast=l,b=4;break;case"base64":this.text=h,this.end=p,b=3;break;default:this.write=m,this.end=y;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=t.allocUnsafe(b)}i.prototype.write=function(g){if(g.length===0)return"";var b,S;if(this.lastNeed){if(b=this.fillLast(g),b===void 0)return"";S=this.lastNeed,this.lastNeed=0}else S=0;return S<g.length?b?b+this.text(g,S):this.text(g,S):b||""},i.prototype.end=u,i.prototype.text=c,i.prototype.fillLast=function(g){if(this.lastNeed<=g.length)return g.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);g.copy(this.lastChar,this.lastTotal-this.lastNeed,0,g.length),this.lastNeed-=g.length};function o(g){return g<=127?0:g>>5===6?2:g>>4===14?3:g>>3===30?4:g>>6===2?-1:-2}function s(g,b,S){var x=b.length-1;if(x<S)return 0;var O=o(b[x]);return O>=0?(O>0&&(g.lastNeed=O-1),O):--x<S||O===-2?0:(O=o(b[x]),O>=0?(O>0&&(g.lastNeed=O-2),O):--x<S||O===-2?0:(O=o(b[x]),O>=0?(O>0&&(O===2?O=0:g.lastNeed=O-3),O):0))}function a(g,b,S){if((b[0]&192)!==128)return g.lastNeed=0,"�";if(g.lastNeed>1&&b.length>1){if((b[1]&192)!==128)return g.lastNeed=1,"�";if(g.lastNeed>2&&b.length>2&&(b[2]&192)!==128)return g.lastNeed=2,"�"}}function l(g){var b=this.lastTotal-this.lastNeed,S=a(this,g);if(S!==void 0)return S;if(this.lastNeed<=g.length)return g.copy(this.lastChar,b,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);g.copy(this.lastChar,b,0,g.length),this.lastNeed-=g.length}function c(g,b){var S=s(this,g,b);if(!this.lastNeed)return g.toString("utf8",b);this.lastTotal=S;var x=g.length-(S-this.lastNeed);return g.copy(this.lastChar,0,x),g.toString("utf8",b,x)}function u(g){var b=g&&g.length?this.write(g):"";return this.lastNeed?b+"�":b}function f(g,b){if((g.length-b)%2===0){var S=g.toString("utf16le",b);if(S){var x=S.charCodeAt(S.length-1);if(x>=55296&&x<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=g[g.length-2],this.lastChar[1]=g[g.length-1],S.slice(0,-1)}return S}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=g[g.length-1],g.toString("utf16le",b,g.length-1)}function d(g){var b=g&&g.length?this.write(g):"";if(this.lastNeed){var S=this.lastTotal-this.lastNeed;return b+this.lastChar.toString("utf16le",0,S)}return b}function h(g,b){var S=(g.length-b)%3;return S===0?g.toString("base64",b):(this.lastNeed=3-S,this.lastTotal=3,S===1?this.lastChar[0]=g[g.length-1]:(this.lastChar[0]=g[g.length-2],this.lastChar[1]=g[g.length-1]),g.toString("base64",b,g.length-S))}function p(g){var b=g&&g.length?this.write(g):"";return this.lastNeed?b+this.lastChar.toString("base64",0,3-this.lastNeed):b}function m(g){return g.toString(this.encoding)}function y(g){return g&&g.length?this.write(g):""}return Dp}var Pp,yE;function cw(){if(yE)return Pp;yE=1;var t=zs().codes.ERR_STREAM_PREMATURE_CLOSE;function e(o){var s=!1;return function(){if(!s){s=!0;for(var a=arguments.length,l=new Array(a),c=0;c<a;c++)l[c]=arguments[c];o.apply(this,l)}}}function r(){}function n(o){return o.setHeader&&typeof o.abort=="function"}function i(o,s,a){if(typeof s=="function")return i(o,null,s);s||(s={}),a=e(a||r);var l=s.readable||s.readable!==!1&&o.readable,c=s.writable||s.writable!==!1&&o.writable,u=function(){o.writable||d()},f=o._writableState&&o._writableState.finished,d=function(){c=!1,f=!0,l||a.call(o)},h=o._readableState&&o._readableState.endEmitted,p=function(){l=!1,h=!0,c||a.call(o)},m=function(S){a.call(o,S)},y=function(){var S;if(l&&!h)return(!o._readableState||!o._readableState.ended)&&(S=new t),a.call(o,S);if(c&&!f)return(!o._writableState||!o._writableState.ended)&&(S=new t),a.call(o,S)},g=function(){o.req.on("finish",d)};return n(o)?(o.on("complete",d),o.on("abort",y),o.req?g():o.on("request",g)):c&&!o._writableState&&(o.on("end",u),o.on("close",u)),o.on("end",p),o.on("finish",d),s.error!==!1&&o.on("error",m),o.on("close",y),function(){o.removeListener("complete",d),o.removeListener("abort",y),o.removeListener("request",g),o.req&&o.req.removeListener("finish",d),o.removeListener("end",u),o.removeListener("close",u),o.removeListener("finish",d),o.removeListener("end",p),o.removeListener("error",m),o.removeListener("close",y)}}return Pp=i,Pp}var Lp,vE;function ote(){if(vE)return Lp;vE=1;var t;function e(g,b,S){return b in g?Object.defineProperty(g,b,{value:S,enumerable:!0,configurable:!0,writable:!0}):g[b]=S,g}var r=cw(),n=Symbol("lastResolve"),i=Symbol("lastReject"),o=Symbol("error"),s=Symbol("ended"),a=Symbol("lastPromise"),l=Symbol("handlePromise"),c=Symbol("stream");function u(g,b){return{value:g,done:b}}function f(g){var b=g[n];if(b!==null){var S=g[c].read();S!==null&&(g[a]=null,g[n]=null,g[i]=null,b(u(S,!1)))}}function d(g){Pe.nextTick(f,g)}function h(g,b){return function(S,x){g.then(function(){if(b[s]){S(u(void 0,!0));return}b[l](S,x)},x)}}var p=Object.getPrototypeOf(function(){}),m=Object.setPrototypeOf((t={get stream(){return this[c]},next:function(){var b=this,S=this[o];if(S!==null)return Promise.reject(S);if(this[s])return Promise.resolve(u(void 0,!0));if(this[c].destroyed)return new Promise(function(D,$){Pe.nextTick(function(){b[o]?$(b[o]):D(u(void 0,!0))})});var x=this[a],O;if(x)O=new Promise(h(x,this));else{var M=this[c].read();if(M!==null)return Promise.resolve(u(M,!1));O=new Promise(this[l])}return this[a]=O,O}},e(t,Symbol.asyncIterator,function(){return this}),e(t,"return",function(){var b=this;return new Promise(function(S,x){b[c].destroy(null,function(O){if(O){x(O);return}S(u(void 0,!0))})})}),t),p),y=function(b){var S,x=Object.create(m,(S={},e(S,c,{value:b,writable:!0}),e(S,n,{value:null,writable:!0}),e(S,i,{value:null,writable:!0}),e(S,o,{value:null,writable:!0}),e(S,s,{value:b._readableState.endEmitted,writable:!0}),e(S,l,{value:function(M,D){var $=x[c].read();$?(x[a]=null,x[n]=null,x[i]=null,M(u($,!1))):(x[n]=M,x[i]=D)},writable:!0}),S));return x[a]=null,r(b,function(O){if(O&&O.code!=="ERR_STREAM_PREMATURE_CLOSE"){var M=x[i];M!==null&&(x[a]=null,x[n]=null,x[i]=null,M(O)),x[o]=O;return}var D=x[n];D!==null&&(x[a]=null,x[n]=null,x[i]=null,D(u(void 0,!0))),x[s]=!0}),b.on("readable",d.bind(null,x)),x};return Lp=y,Lp}var Fp,wE;function ste(){return wE||(wE=1,Fp=function(){throw new Error("Readable.from is not available in the browser")}),Fp}var Bp,bE;function GM(){if(bE)return Bp;bE=1,Bp=A;var t;A.ReadableState=$,ow.EventEmitter;var e=function(F,ne){return F.listeners(ne).length},r=LM(),n=yd().Buffer,i=Vr.Uint8Array||function(){};function o(P){return n.from(P)}function s(P){return n.isBuffer(P)||P instanceof i}var a=zM(),l;a&&a.debuglog?l=a.debuglog("stream"):l=function(){};var c=rte(),u=UM(),f=WM(),d=f.getHighWaterMark,h=zs().codes,p=h.ERR_INVALID_ARG_TYPE,m=h.ERR_STREAM_PUSH_AFTER_EOF,y=h.ERR_METHOD_NOT_IMPLEMENTED,g=h.ERR_STREAM_UNSHIFT_AFTER_END_EVENT,b,S,x;wo(A,r);var O=u.errorOrDestroy,M=["error","close","destroy","pause","resume"];function D(P,F,ne){if(typeof P.prependListener=="function")return P.prependListener(F,ne);!P._events||!P._events[F]?P.on(F,ne):Array.isArray(P._events[F])?P._events[F].unshift(ne):P._events[F]=[ne,P._events[F]]}function $(P,F,ne){t=t||Cs(),P=P||{},typeof ne!="boolean"&&(ne=F instanceof t),this.objectMode=!!P.objectMode,ne&&(this.objectMode=this.objectMode||!!P.readableObjectMode),this.highWaterMark=d(this,P,"readableHighWaterMark",ne),this.buffer=new c,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.paused=!0,this.emitClose=P.emitClose!==!1,this.autoDestroy=!!P.autoDestroy,this.destroyed=!1,this.defaultEncoding=P.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,P.encoding&&(b||(b=qg().StringDecoder),this.decoder=new b(P.encoding),this.encoding=P.encoding)}function A(P){if(t=t||Cs(),!(this instanceof A))return new A(P);var F=this instanceof t;this._readableState=new $(P,this,F),this.readable=!0,P&&(typeof P.read=="function"&&(this._read=P.read),typeof P.destroy=="function"&&(this._destroy=P.destroy)),r.call(this)}Object.defineProperty(A.prototype,"destroyed",{enumerable:!1,get:function(){return this._readableState===void 0?!1:this._readableState.destroyed},set:function(F){this._readableState&&(this._readableState.destroyed=F)}}),A.prototype.destroy=u.destroy,A.prototype._undestroy=u.undestroy,A.prototype._destroy=function(P,F){F(P)},A.prototype.push=function(P,F){var ne=this._readableState,T;return ne.objectMode?T=!0:typeof P=="string"&&(F=F||ne.defaultEncoding,F!==ne.encoding&&(P=n.from(P,F),F=""),T=!0),V(this,P,F,!1,T)},A.prototype.unshift=function(P){return V(this,P,null,!0,!1)};function V(P,F,ne,T,re){l("readableAddChunk",F);var R=P._readableState;if(F===null)R.reading=!1,te(P,R);else{var v;if(re||(v=I(R,F)),v)O(P,v);else if(R.objectMode||F&&F.length>0)if(typeof F!="string"&&!R.objectMode&&Object.getPrototypeOf(F)!==n.prototype&&(F=o(F)),T)R.endEmitted?O(P,new g):Q(P,R,F,!0);else if(R.ended)O(P,new m);else{if(R.destroyed)return!1;R.reading=!1,R.decoder&&!ne?(F=R.decoder.write(F),R.objectMode||F.length!==0?Q(P,R,F,!1):X(P,R)):Q(P,R,F,!1)}else T||(R.reading=!1,X(P,R))}return!R.ended&&(R.length<R.highWaterMark||R.length===0)}function Q(P,F,ne,T){F.flowing&&F.length===0&&!F.sync?(F.awaitDrain=0,P.emit("data",ne)):(F.length+=F.objectMode?1:ne.length,T?F.buffer.unshift(ne):F.buffer.push(ne),F.needReadable&&W(P)),X(P,F)}function I(P,F){var ne;return!s(F)&&typeof F!="string"&&F!==void 0&&!P.objectMode&&(ne=new p("chunk",["string","Buffer","Uint8Array"],F)),ne}A.prototype.isPaused=function(){return this._readableState.flowing===!1},A.prototype.setEncoding=function(P){b||(b=qg().StringDecoder);var F=new b(P);this._readableState.decoder=F,this._readableState.encoding=this._readableState.decoder.encoding;for(var ne=this._readableState.buffer.head,T="";ne!==null;)T+=F.write(ne.data),ne=ne.next;return this._readableState.buffer.clear(),T!==""&&this._readableState.buffer.push(T),this._readableState.length=T.length,this};var U=1073741824;function k(P){return P>=U?P=U:(P--,P|=P>>>1,P|=P>>>2,P|=P>>>4,P|=P>>>8,P|=P>>>16,P++),P}function G(P,F){return P<=0||F.length===0&&F.ended?0:F.objectMode?1:P!==P?F.flowing&&F.length?F.buffer.head.data.length:F.length:(P>F.highWaterMark&&(F.highWaterMark=k(P)),P<=F.length?P:F.ended?F.length:(F.needReadable=!0,0))}A.prototype.read=function(P){l("read",P),P=parseInt(P,10);var F=this._readableState,ne=P;if(P!==0&&(F.emittedReadable=!1),P===0&&F.needReadable&&((F.highWaterMark!==0?F.length>=F.highWaterMark:F.length>0)||F.ended))return l("read: emitReadable",F.length,F.ended),F.length===0&&F.ended?C(this):W(this),null;if(P=G(P,F),P===0&&F.ended)return F.length===0&&C(this),null;var T=F.needReadable;l("need readable",T),(F.length===0||F.length-P<F.highWaterMark)&&(T=!0,l("length less than watermark",T)),F.ended||F.reading?(T=!1,l("reading or ended",T)):T&&(l("do read"),F.reading=!0,F.sync=!0,F.length===0&&(F.needReadable=!0),this._read(F.highWaterMark),F.sync=!1,F.reading||(P=G(ne,F)));var re;return P>0?re=_(P,F):re=null,re===null?(F.needReadable=F.length<=F.highWaterMark,P=0):(F.length-=P,F.awaitDrain=0),F.length===0&&(F.ended||(F.needReadable=!0),ne!==P&&F.ended&&C(this)),re!==null&&this.emit("data",re),re};function te(P,F){if(l("onEofChunk"),!F.ended){if(F.decoder){var ne=F.decoder.end();ne&&ne.length&&(F.buffer.push(ne),F.length+=F.objectMode?1:ne.length)}F.ended=!0,F.sync?W(P):(F.needReadable=!1,F.emittedReadable||(F.emittedReadable=!0,ae(P)))}}function W(P){var F=P._readableState;l("emitReadable",F.needReadable,F.emittedReadable),F.needReadable=!1,F.emittedReadable||(l("emitReadable",F.flowing),F.emittedReadable=!0,Pe.nextTick(ae,P))}function ae(P){var F=P._readableState;l("emitReadable_",F.destroyed,F.length,F.ended),!F.destroyed&&(F.length||F.ended)&&(P.emit("readable"),F.emittedReadable=!1),F.needReadable=!F.flowing&&!F.ended&&F.length<=F.highWaterMark,K(P)}function X(P,F){F.readingMore||(F.readingMore=!0,Pe.nextTick(de,P,F))}function de(P,F){for(;!F.reading&&!F.ended&&(F.length<F.highWaterMark||F.flowing&&F.length===0);){var ne=F.length;if(l("maybeReadMore read 0"),P.read(0),ne===F.length)break}F.readingMore=!1}A.prototype._read=function(P){O(this,new y("_read()"))},A.prototype.pipe=function(P,F){var ne=this,T=this._readableState;switch(T.pipesCount){case 0:T.pipes=P;break;case 1:T.pipes=[T.pipes,P];break;default:T.pipes.push(P);break}T.pipesCount+=1,l("pipe count=%d opts=%j",T.pipesCount,F);var re=(!F||F.end!==!1)&&P!==Pe.stdout&&P!==Pe.stderr,R=re?w:ve;T.endEmitted?Pe.nextTick(R):ne.once("end",R),P.on("unpipe",v);function v(Te,Oe){l("onunpipe"),Te===ne&&Oe&&Oe.hasUnpiped===!1&&(Oe.hasUnpiped=!0,J())}function w(){l("onend"),P.end()}var E=q(ne);P.on("drain",E);var B=!1;function J(){l("cleanup"),P.removeListener("close",me),P.removeListener("finish",fe),P.removeListener("drain",E),P.removeListener("error",ce),P.removeListener("unpipe",v),ne.removeListener("end",w),ne.removeListener("end",ve),ne.removeListener("data",H),B=!0,T.awaitDrain&&(!P._writableState||P._writableState.needDrain)&&E()}ne.on("data",H);function H(Te){l("ondata");var Oe=P.write(Te);l("dest.write",Oe),Oe===!1&&((T.pipesCount===1&&T.pipes===P||T.pipesCount>1&&j(T.pipes,P)!==-1)&&!B&&(l("false write response, pause",T.awaitDrain),T.awaitDrain++),ne.pause())}function ce(Te){l("onerror",Te),ve(),P.removeListener("error",ce),e(P,"error")===0&&O(P,Te)}D(P,"error",ce);function me(){P.removeListener("finish",fe),ve()}P.once("close",me);function fe(){l("onfinish"),P.removeListener("close",me),ve()}P.once("finish",fe);function ve(){l("unpipe"),ne.unpipe(P)}return P.emit("pipe",ne),T.flowing||(l("pipe resume"),ne.resume()),P};function q(P){return function(){var ne=P._readableState;l("pipeOnDrain",ne.awaitDrain),ne.awaitDrain&&ne.awaitDrain--,ne.awaitDrain===0&&e(P,"data")&&(ne.flowing=!0,K(P))}}A.prototype.unpipe=function(P){var F=this._readableState,ne={hasUnpiped:!1};if(F.pipesCount===0)return this;if(F.pipesCount===1)return P&&P!==F.pipes?this:(P||(P=F.pipes),F.pipes=null,F.pipesCount=0,F.flowing=!1,P&&P.emit("unpipe",this,ne),this);if(!P){var T=F.pipes,re=F.pipesCount;F.pipes=null,F.pipesCount=0,F.flowing=!1;for(var R=0;R<re;R++)T[R].emit("unpipe",this,{hasUnpiped:!1});return this}var v=j(F.pipes,P);return v===-1?this:(F.pipes.splice(v,1),F.pipesCount-=1,F.pipesCount===1&&(F.pipes=F.pipes[0]),P.emit("unpipe",this,ne),this)},A.prototype.on=function(P,F){var ne=r.prototype.on.call(this,P,F),T=this._readableState;return P==="data"?(T.readableListening=this.listenerCount("readable")>0,T.flowing!==!1&&this.resume()):P==="readable"&&!T.endEmitted&&!T.readableListening&&(T.readableListening=T.needReadable=!0,T.flowing=!1,T.emittedReadable=!1,l("on readable",T.length,T.reading),T.length?W(this):T.reading||Pe.nextTick(Y,this)),ne},A.prototype.addListener=A.prototype.on,A.prototype.removeListener=function(P,F){var ne=r.prototype.removeListener.call(this,P,F);return P==="readable"&&Pe.nextTick(N,this),ne},A.prototype.removeAllListeners=function(P){var F=r.prototype.removeAllListeners.apply(this,arguments);return(P==="readable"||P===void 0)&&Pe.nextTick(N,this),F};function N(P){var F=P._readableState;F.readableListening=P.listenerCount("readable")>0,F.resumeScheduled&&!F.paused?F.flowing=!0:P.listenerCount("data")>0&&P.resume()}function Y(P){l("readable nexttick read 0"),P.read(0)}A.prototype.resume=function(){var P=this._readableState;return P.flowing||(l("resume"),P.flowing=!P.readableListening,Z(this,P)),P.paused=!1,this};function Z(P,F){F.resumeScheduled||(F.resumeScheduled=!0,Pe.nextTick(ie,P,F))}function ie(P,F){l("resume",F.reading),F.reading||P.read(0),F.resumeScheduled=!1,P.emit("resume"),K(P),F.flowing&&!F.reading&&P.read(0)}A.prototype.pause=function(){return l("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(l("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this};function K(P){var F=P._readableState;for(l("flow",F.flowing);F.flowing&&P.read()!==null;);}A.prototype.wrap=function(P){var F=this,ne=this._readableState,T=!1;P.on("end",function(){if(l("wrapped end"),ne.decoder&&!ne.ended){var v=ne.decoder.end();v&&v.length&&F.push(v)}F.push(null)}),P.on("data",function(v){if(l("wrapped data"),ne.decoder&&(v=ne.decoder.write(v)),!(ne.objectMode&&v==null)&&!(!ne.objectMode&&(!v||!v.length))){var w=F.push(v);w||(T=!0,P.pause())}});for(var re in P)this[re]===void 0&&typeof P[re]=="function"&&(this[re]=function(w){return function(){return P[w].apply(P,arguments)}}(re));for(var R=0;R<M.length;R++)P.on(M[R],this.emit.bind(this,M[R]));return this._read=function(v){l("wrapped _read",v),T&&(T=!1,P.resume())},this},typeof Symbol=="function"&&(A.prototype[Symbol.asyncIterator]=function(){return S===void 0&&(S=ote()),S(this)}),Object.defineProperty(A.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),Object.defineProperty(A.prototype,"readableBuffer",{enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}}),Object.defineProperty(A.prototype,"readableFlowing",{enumerable:!1,get:function(){return this._readableState.flowing},set:function(F){this._readableState&&(this._readableState.flowing=F)}}),A._fromList=_,Object.defineProperty(A.prototype,"readableLength",{enumerable:!1,get:function(){return this._readableState.length}});function _(P,F){if(F.length===0)return null;var ne;return F.objectMode?ne=F.buffer.shift():!P||P>=F.length?(F.decoder?ne=F.buffer.join(""):F.buffer.length===1?ne=F.buffer.first():ne=F.buffer.concat(F.length),F.buffer.clear()):ne=F.buffer.consume(P,F.decoder),ne}function C(P){var F=P._readableState;l("endReadable",F.endEmitted),F.endEmitted||(F.ended=!0,Pe.nextTick(z,F,P))}function z(P,F){if(l("endReadableNT",P.endEmitted,P.length),!P.endEmitted&&P.length===0&&(P.endEmitted=!0,F.readable=!1,F.emit("end"),P.autoDestroy)){var ne=F._writableState;(!ne||ne.autoDestroy&&ne.finished)&&F.destroy()}}typeof Symbol=="function"&&(A.from=function(P,F){return x===void 0&&(x=ste()),x(A,P,F)});function j(P,F){for(var ne=0,T=P.length;ne<T;ne++)if(P[ne]===F)return ne;return-1}return Bp}var $p,xE;function KM(){if(xE)return $p;xE=1,$p=a;var t=zs().codes,e=t.ERR_METHOD_NOT_IMPLEMENTED,r=t.ERR_MULTIPLE_CALLBACK,n=t.ERR_TRANSFORM_ALREADY_TRANSFORMING,i=t.ERR_TRANSFORM_WITH_LENGTH_0,o=Cs();wo(a,o);function s(u,f){var d=this._transformState;d.transforming=!1;var h=d.writecb;if(h===null)return this.emit("error",new r);d.writechunk=null,d.writecb=null,f!=null&&this.push(f),h(u);var p=this._readableState;p.reading=!1,(p.needReadable||p.length<p.highWaterMark)&&this._read(p.highWaterMark)}function a(u){if(!(this instanceof a))return new a(u);o.call(this,u),this._transformState={afterTransform:s.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,u&&(typeof u.transform=="function"&&(this._transform=u.transform),typeof u.flush=="function"&&(this._flush=u.flush)),this.on("prefinish",l)}function l(){var u=this;typeof this._flush=="function"&&!this._readableState.destroyed?this._flush(function(f,d){c(u,f,d)}):c(this,null,null)}a.prototype.push=function(u,f){return this._transformState.needTransform=!1,o.prototype.push.call(this,u,f)},a.prototype._transform=function(u,f,d){d(new e("_transform()"))},a.prototype._write=function(u,f,d){var h=this._transformState;if(h.writecb=d,h.writechunk=u,h.writeencoding=f,!h.transforming){var p=this._readableState;(h.needTransform||p.needReadable||p.length<p.highWaterMark)&&this._read(p.highWaterMark)}},a.prototype._read=function(u){var f=this._transformState;f.writechunk!==null&&!f.transforming?(f.transforming=!0,this._transform(f.writechunk,f.writeencoding,f.afterTransform)):f.needTransform=!0},a.prototype._destroy=function(u,f){o.prototype._destroy.call(this,u,function(d){f(d)})};function c(u,f,d){if(f)return u.emit("error",f);if(d!=null&&u.push(d),u._writableState.length)throw new i;if(u._transformState.transforming)throw new n;return u.push(null)}return $p}var jp,SE;function ate(){if(SE)return jp;SE=1,jp=e;var t=KM();wo(e,t);function e(r){if(!(this instanceof e))return new e(r);t.call(this,r)}return e.prototype._transform=function(r,n,i){i(null,r)},jp}var Hp,EE;function lte(){if(EE)return Hp;EE=1;var t;function e(d){var h=!1;return function(){h||(h=!0,d.apply(void 0,arguments))}}var r=zs().codes,n=r.ERR_MISSING_ARGS,i=r.ERR_STREAM_DESTROYED;function o(d){if(d)throw d}function s(d){return d.setHeader&&typeof d.abort=="function"}function a(d,h,p,m){m=e(m);var y=!1;d.on("close",function(){y=!0}),t===void 0&&(t=cw()),t(d,{readable:h,writable:p},function(b){if(b)return m(b);y=!0,m()});var g=!1;return function(b){if(!y&&!g){if(g=!0,s(d))return d.abort();if(typeof d.destroy=="function")return d.destroy();m(b||new i("pipe"))}}}function l(d){d()}function c(d,h){return d.pipe(h)}function u(d){return!d.length||typeof d[d.length-1]!="function"?o:d.pop()}function f(){for(var d=arguments.length,h=new Array(d),p=0;p<d;p++)h[p]=arguments[p];var m=u(h);if(Array.isArray(h[0])&&(h=h[0]),h.length<2)throw new n("streams");var y,g=h.map(function(b,S){var x=S<h.length-1,O=S>0;return a(b,x,O,function(M){y||(y=M),M&&g.forEach(l),!x&&(g.forEach(l),m(y))})});return h.reduce(c)}return Hp=f,Hp}var uw=wr,fw=ow.EventEmitter,cte=wo;cte(wr,fw);wr.Readable=GM();wr.Writable=VM();wr.Duplex=Cs();wr.Transform=KM();wr.PassThrough=ate();wr.finished=cw();wr.pipeline=lte();wr.Stream=wr;function wr(){fw.call(this)}wr.prototype.pipe=function(t,e){var r=this;function n(u){t.writable&&t.write(u)===!1&&r.pause&&r.pause()}r.on("data",n);function i(){r.readable&&r.resume&&r.resume()}t.on("drain",i),!t._isStdio&&(!e||e.end!==!1)&&(r.on("end",s),r.on("close",a));var o=!1;function s(){o||(o=!0,t.end())}function a(){o||(o=!0,typeof t.destroy=="function"&&t.destroy())}function l(u){if(c(),fw.listenerCount(this,"error")===0)throw u}r.on("error",l),t.on("error",l);function c(){r.removeListener("data",n),t.removeListener("drain",i),r.removeListener("end",s),r.removeListener("close",a),r.removeListener("error",l),t.removeListener("error",l),r.removeListener("end",c),r.removeListener("close",c),t.removeListener("close",c)}return r.on("end",c),r.on("close",c),t.on("close",c),t.emit("pipe",r),t};(function(t){(function(e){e.parser=function(_,C){return new n(_,C)},e.SAXParser=n,e.SAXStream=u,e.createStream=c,e.MAX_BUFFER_LENGTH=64*1024;var r=["comment","sgmlDecl","textNode","tagName","doctype","procInstName","procInstBody","entity","attribName","attribValue","cdata","script"];e.EVENTS=["text","processinginstruction","sgmldeclaration","doctype","comment","opentagstart","attribute","opentag","closetag","opencdata","cdata","closecdata","error","end","ready","script","opennamespace","closenamespace"];function n(_,C){if(!(this instanceof n))return new n(_,C);var z=this;o(z),z.q=z.c="",z.bufferCheckPosition=e.MAX_BUFFER_LENGTH,z.opt=C||{},z.opt.lowercase=z.opt.lowercase||z.opt.lowercasetags,z.looseCase=z.opt.lowercase?"toLowerCase":"toUpperCase",z.tags=[],z.closed=z.closedRoot=z.sawRoot=!1,z.tag=z.error=null,z.strict=!!_,z.noscript=!!(_||z.opt.noscript),z.state=A.BEGIN,z.strictEntities=z.opt.strictEntities,z.ENTITIES=z.strictEntities?Object.create(e.XML_ENTITIES):Object.create(e.ENTITIES),z.attribList=[],z.opt.xmlns&&(z.ns=Object.create(m)),z.trackPosition=z.opt.position!==!1,z.trackPosition&&(z.position=z.line=z.column=0),Q(z,"onready")}Object.create||(Object.create=function(_){function C(){}C.prototype=_;var z=new C;return z}),Object.keys||(Object.keys=function(_){var C=[];for(var z in _)_.hasOwnProperty(z)&&C.push(z);return C});function i(_){for(var C=Math.max(e.MAX_BUFFER_LENGTH,10),z=0,j=0,P=r.length;j<P;j++){var F=_[r[j]].length;if(F>C)switch(r[j]){case"textNode":U(_);break;case"cdata":I(_,"oncdata",_.cdata),_.cdata="";break;case"script":I(_,"onscript",_.script),_.script="";break;default:G(_,"Max buffer length exceeded: "+r[j])}z=Math.max(z,F)}var ne=e.MAX_BUFFER_LENGTH-z;_.bufferCheckPosition=ne+_.position}function o(_){for(var C=0,z=r.length;C<z;C++)_[r[C]]=""}function s(_){U(_),_.cdata!==""&&(I(_,"oncdata",_.cdata),_.cdata=""),_.script!==""&&(I(_,"onscript",_.script),_.script="")}n.prototype={end:function(){te(this)},write:K,resume:function(){return this.error=null,this},close:function(){return this.write(null)},flush:function(){s(this)}};var a;try{a=uw.Stream}catch{a=function(){}}var l=e.EVENTS.filter(function(_){return _!=="error"&&_!=="end"});function c(_,C){return new u(_,C)}function u(_,C){if(!(this instanceof u))return new u(_,C);a.apply(this),this._parser=new n(_,C),this.writable=!0,this.readable=!0;var z=this;this._parser.onend=function(){z.emit("end")},this._parser.onerror=function(j){z.emit("error",j),z._parser.error=null},this._decoder=null,l.forEach(function(j){Object.defineProperty(z,"on"+j,{get:function(){return z._parser["on"+j]},set:function(P){if(!P)return z.removeAllListeners(j),z._parser["on"+j]=P,P;z.on(j,P)},enumerable:!0,configurable:!1})})}u.prototype=Object.create(a.prototype,{constructor:{value:u}}),u.prototype.write=function(_){if(typeof Buffer=="function"&&typeof Buffer.isBuffer=="function"&&Buffer.isBuffer(_)){if(!this._decoder){var C=qg().StringDecoder;this._decoder=new C("utf8")}_=this._decoder.write(_)}return this._parser.write(_.toString()),this.emit("data",_),!0},u.prototype.end=function(_){return _&&_.length&&this.write(_),this._parser.end(),!0},u.prototype.on=function(_,C){var z=this;return!z._parser["on"+_]&&l.indexOf(_)!==-1&&(z._parser["on"+_]=function(){var j=arguments.length===1?[arguments[0]]:Array.apply(null,arguments);j.splice(0,0,_),z.emit.apply(z,j)}),a.prototype.on.call(z,_,C)};var f="[CDATA[",d="DOCTYPE",h="http://www.w3.org/XML/1998/namespace",p="http://www.w3.org/2000/xmlns/",m={xml:h,xmlns:p},y=/[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/,g=/[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u00B7\u0300-\u036F\u203F-\u2040.\d-]/,b=/[#:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/,S=/[#:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u00B7\u0300-\u036F\u203F-\u2040.\d-]/;function x(_){return _===" "||_===`
580
- `||_==="\r"||_===" "}function O(_){return _==='"'||_==="'"}function M(_){return _===">"||x(_)}function D(_,C){return _.test(C)}function $(_,C){return!D(_,C)}var A=0;e.STATE={BEGIN:A++,BEGIN_WHITESPACE:A++,TEXT:A++,TEXT_ENTITY:A++,OPEN_WAKA:A++,SGML_DECL:A++,SGML_DECL_QUOTED:A++,DOCTYPE:A++,DOCTYPE_QUOTED:A++,DOCTYPE_DTD:A++,DOCTYPE_DTD_QUOTED:A++,COMMENT_STARTING:A++,COMMENT:A++,COMMENT_ENDING:A++,COMMENT_ENDED:A++,CDATA:A++,CDATA_ENDING:A++,CDATA_ENDING_2:A++,PROC_INST:A++,PROC_INST_BODY:A++,PROC_INST_ENDING:A++,OPEN_TAG:A++,OPEN_TAG_SLASH:A++,ATTRIB:A++,ATTRIB_NAME:A++,ATTRIB_NAME_SAW_WHITE:A++,ATTRIB_VALUE:A++,ATTRIB_VALUE_QUOTED:A++,ATTRIB_VALUE_CLOSED:A++,ATTRIB_VALUE_UNQUOTED:A++,ATTRIB_VALUE_ENTITY_Q:A++,ATTRIB_VALUE_ENTITY_U:A++,CLOSE_TAG:A++,CLOSE_TAG_SAW_WHITE:A++,SCRIPT:A++,SCRIPT_ENDING:A++},e.XML_ENTITIES={amp:"&",gt:">",lt:"<",quot:'"',apos:"'"},e.ENTITIES={amp:"&",gt:">",lt:"<",quot:'"',apos:"'",AElig:198,Aacute:193,Acirc:194,Agrave:192,Aring:197,Atilde:195,Auml:196,Ccedil:199,ETH:208,Eacute:201,Ecirc:202,Egrave:200,Euml:203,Iacute:205,Icirc:206,Igrave:204,Iuml:207,Ntilde:209,Oacute:211,Ocirc:212,Ograve:210,Oslash:216,Otilde:213,Ouml:214,THORN:222,Uacute:218,Ucirc:219,Ugrave:217,Uuml:220,Yacute:221,aacute:225,acirc:226,aelig:230,agrave:224,aring:229,atilde:227,auml:228,ccedil:231,eacute:233,ecirc:234,egrave:232,eth:240,euml:235,iacute:237,icirc:238,igrave:236,iuml:239,ntilde:241,oacute:243,ocirc:244,ograve:242,oslash:248,otilde:245,ouml:246,szlig:223,thorn:254,uacute:250,ucirc:251,ugrave:249,uuml:252,yacute:253,yuml:255,copy:169,reg:174,nbsp:160,iexcl:161,cent:162,pound:163,curren:164,yen:165,brvbar:166,sect:167,uml:168,ordf:170,laquo:171,not:172,shy:173,macr:175,deg:176,plusmn:177,sup1:185,sup2:178,sup3:179,acute:180,micro:181,para:182,middot:183,cedil:184,ordm:186,raquo:187,frac14:188,frac12:189,frac34:190,iquest:191,times:215,divide:247,OElig:338,oelig:339,Scaron:352,scaron:353,Yuml:376,fnof:402,circ:710,tilde:732,Alpha:913,Beta:914,Gamma:915,Delta:916,Epsilon:917,Zeta:918,Eta:919,Theta:920,Iota:921,Kappa:922,Lambda:923,Mu:924,Nu:925,Xi:926,Omicron:927,Pi:928,Rho:929,Sigma:931,Tau:932,Upsilon:933,Phi:934,Chi:935,Psi:936,Omega:937,alpha:945,beta:946,gamma:947,delta:948,epsilon:949,zeta:950,eta:951,theta:952,iota:953,kappa:954,lambda:955,mu:956,nu:957,xi:958,omicron:959,pi:960,rho:961,sigmaf:962,sigma:963,tau:964,upsilon:965,phi:966,chi:967,psi:968,omega:969,thetasym:977,upsih:978,piv:982,ensp:8194,emsp:8195,thinsp:8201,zwnj:8204,zwj:8205,lrm:8206,rlm:8207,ndash:8211,mdash:8212,lsquo:8216,rsquo:8217,sbquo:8218,ldquo:8220,rdquo:8221,bdquo:8222,dagger:8224,Dagger:8225,bull:8226,hellip:8230,permil:8240,prime:8242,Prime:8243,lsaquo:8249,rsaquo:8250,oline:8254,frasl:8260,euro:8364,image:8465,weierp:8472,real:8476,trade:8482,alefsym:8501,larr:8592,uarr:8593,rarr:8594,darr:8595,harr:8596,crarr:8629,lArr:8656,uArr:8657,rArr:8658,dArr:8659,hArr:8660,forall:8704,part:8706,exist:8707,empty:8709,nabla:8711,isin:8712,notin:8713,ni:8715,prod:8719,sum:8721,minus:8722,lowast:8727,radic:8730,prop:8733,infin:8734,ang:8736,and:8743,or:8744,cap:8745,cup:8746,int:8747,there4:8756,sim:8764,cong:8773,asymp:8776,ne:8800,equiv:8801,le:8804,ge:8805,sub:8834,sup:8835,nsub:8836,sube:8838,supe:8839,oplus:8853,otimes:8855,perp:8869,sdot:8901,lceil:8968,rceil:8969,lfloor:8970,rfloor:8971,lang:9001,rang:9002,loz:9674,spades:9824,clubs:9827,hearts:9829,diams:9830},Object.keys(e.ENTITIES).forEach(function(_){var C=e.ENTITIES[_],z=typeof C=="number"?String.fromCharCode(C):C;e.ENTITIES[_]=z});for(var V in e.STATE)e.STATE[e.STATE[V]]=V;A=e.STATE;function Q(_,C,z){_[C]&&_[C](z)}function I(_,C,z){_.textNode&&U(_),Q(_,C,z)}function U(_){_.textNode=k(_.opt,_.textNode),_.textNode&&Q(_,"ontext",_.textNode),_.textNode=""}function k(_,C){return _.trim&&(C=C.trim()),_.normalize&&(C=C.replace(/\s+/g," ")),C}function G(_,C){return U(_),_.trackPosition&&(C+=`
581
- Line: `+_.line+`
582
- Column: `+_.column+`
583
- Char: `+_.c),C=new Error(C),_.error=C,Q(_,"onerror",C),_}function te(_){return _.sawRoot&&!_.closedRoot&&W(_,"Unclosed root tag"),_.state!==A.BEGIN&&_.state!==A.BEGIN_WHITESPACE&&_.state!==A.TEXT&&G(_,"Unexpected end"),U(_),_.c="",_.closed=!0,Q(_,"onend"),n.call(_,_.strict,_.opt),_}function W(_,C){if(typeof _!="object"||!(_ instanceof n))throw new Error("bad call to strictFail");_.strict&&G(_,C)}function ae(_){_.strict||(_.tagName=_.tagName[_.looseCase]());var C=_.tags[_.tags.length-1]||_,z=_.tag={name:_.tagName,attributes:{}};_.opt.xmlns&&(z.ns=C.ns),_.attribList.length=0,I(_,"onopentagstart",z)}function X(_,C){var z=_.indexOf(":"),j=z<0?["",_]:_.split(":"),P=j[0],F=j[1];return C&&_==="xmlns"&&(P="xmlns",F=""),{prefix:P,local:F}}function de(_){if(_.strict||(_.attribName=_.attribName[_.looseCase]()),_.attribList.indexOf(_.attribName)!==-1||_.tag.attributes.hasOwnProperty(_.attribName)){_.attribName=_.attribValue="";return}if(_.opt.xmlns){var C=X(_.attribName,!0),z=C.prefix,j=C.local;if(z==="xmlns")if(j==="xml"&&_.attribValue!==h)W(_,"xml: prefix must be bound to "+h+`
584
- Actual: `+_.attribValue);else if(j==="xmlns"&&_.attribValue!==p)W(_,"xmlns: prefix must be bound to "+p+`
585
- Actual: `+_.attribValue);else{var P=_.tag,F=_.tags[_.tags.length-1]||_;P.ns===F.ns&&(P.ns=Object.create(F.ns)),P.ns[j]=_.attribValue}_.attribList.push([_.attribName,_.attribValue])}else _.tag.attributes[_.attribName]=_.attribValue,I(_,"onattribute",{name:_.attribName,value:_.attribValue});_.attribName=_.attribValue=""}function q(_,C){if(_.opt.xmlns){var z=_.tag,j=X(_.tagName);z.prefix=j.prefix,z.local=j.local,z.uri=z.ns[j.prefix]||"",z.prefix&&!z.uri&&(W(_,"Unbound namespace prefix: "+JSON.stringify(_.tagName)),z.uri=j.prefix);var P=_.tags[_.tags.length-1]||_;z.ns&&P.ns!==z.ns&&Object.keys(z.ns).forEach(function(H){I(_,"onopennamespace",{prefix:H,uri:z.ns[H]})});for(var F=0,ne=_.attribList.length;F<ne;F++){var T=_.attribList[F],re=T[0],R=T[1],v=X(re,!0),w=v.prefix,E=v.local,B=w===""?"":z.ns[w]||"",J={name:re,value:R,prefix:w,local:E,uri:B};w&&w!=="xmlns"&&!B&&(W(_,"Unbound namespace prefix: "+JSON.stringify(w)),J.uri=w),_.tag.attributes[re]=J,I(_,"onattribute",J)}_.attribList.length=0}_.tag.isSelfClosing=!!C,_.sawRoot=!0,_.tags.push(_.tag),I(_,"onopentag",_.tag),C||(!_.noscript&&_.tagName.toLowerCase()==="script"?_.state=A.SCRIPT:_.state=A.TEXT,_.tag=null,_.tagName=""),_.attribName=_.attribValue="",_.attribList.length=0}function N(_){if(!_.tagName){W(_,"Weird empty close tag."),_.textNode+="</>",_.state=A.TEXT;return}if(_.script){if(_.tagName!=="script"){_.script+="</"+_.tagName+">",_.tagName="",_.state=A.SCRIPT;return}I(_,"onscript",_.script),_.script=""}var C=_.tags.length,z=_.tagName;_.strict||(z=z[_.looseCase]());for(var j=z;C--;){var P=_.tags[C];if(P.name!==j)W(_,"Unexpected close tag");else break}if(C<0){W(_,"Unmatched closing tag: "+_.tagName),_.textNode+="</"+_.tagName+">",_.state=A.TEXT;return}_.tagName=z;for(var F=_.tags.length;F-- >C;){var ne=_.tag=_.tags.pop();_.tagName=_.tag.name,I(_,"onclosetag",_.tagName);var T={};for(var re in ne.ns)T[re]=ne.ns[re];var R=_.tags[_.tags.length-1]||_;_.opt.xmlns&&ne.ns!==R.ns&&Object.keys(ne.ns).forEach(function(v){var w=ne.ns[v];I(_,"onclosenamespace",{prefix:v,uri:w})})}C===0&&(_.closedRoot=!0),_.tagName=_.attribValue=_.attribName="",_.attribList.length=0,_.state=A.TEXT}function Y(_){var C=_.entity,z=C.toLowerCase(),j,P="";return _.ENTITIES[C]?_.ENTITIES[C]:_.ENTITIES[z]?_.ENTITIES[z]:(C=z,C.charAt(0)==="#"&&(C.charAt(1)==="x"?(C=C.slice(2),j=parseInt(C,16),P=j.toString(16)):(C=C.slice(1),j=parseInt(C,10),P=j.toString(10))),C=C.replace(/^0+/,""),isNaN(j)||P.toLowerCase()!==C?(W(_,"Invalid character entity"),"&"+_.entity+";"):String.fromCodePoint(j))}function Z(_,C){C==="<"?(_.state=A.OPEN_WAKA,_.startTagPosition=_.position):x(C)||(W(_,"Non-whitespace before first tag."),_.textNode=C,_.state=A.TEXT)}function ie(_,C){var z="";return C<_.length&&(z=_.charAt(C)),z}function K(_){var C=this;if(this.error)throw this.error;if(C.closed)return G(C,"Cannot write after close. Assign an onready handler.");if(_===null)return te(C);typeof _=="object"&&(_=_.toString());for(var z=0,j="";j=ie(_,z++),C.c=j,!!j;)switch(C.trackPosition&&(C.position++,j===`
586
- `?(C.line++,C.column=0):C.column++),C.state){case A.BEGIN:if(C.state=A.BEGIN_WHITESPACE,j==="\uFEFF")continue;Z(C,j);continue;case A.BEGIN_WHITESPACE:Z(C,j);continue;case A.TEXT:if(C.sawRoot&&!C.closedRoot){for(var P=z-1;j&&j!=="<"&&j!=="&";)j=ie(_,z++),j&&C.trackPosition&&(C.position++,j===`
587
- `?(C.line++,C.column=0):C.column++);C.textNode+=_.substring(P,z-1)}j==="<"&&!(C.sawRoot&&C.closedRoot&&!C.strict)?(C.state=A.OPEN_WAKA,C.startTagPosition=C.position):(!x(j)&&(!C.sawRoot||C.closedRoot)&&W(C,"Text data outside of root node."),j==="&"?C.state=A.TEXT_ENTITY:C.textNode+=j);continue;case A.SCRIPT:j==="<"?C.state=A.SCRIPT_ENDING:C.script+=j;continue;case A.SCRIPT_ENDING:j==="/"?C.state=A.CLOSE_TAG:(C.script+="<"+j,C.state=A.SCRIPT);continue;case A.OPEN_WAKA:if(j==="!")C.state=A.SGML_DECL,C.sgmlDecl="";else if(!x(j))if(D(y,j))C.state=A.OPEN_TAG,C.tagName=j;else if(j==="/")C.state=A.CLOSE_TAG,C.tagName="";else if(j==="?")C.state=A.PROC_INST,C.procInstName=C.procInstBody="";else{if(W(C,"Unencoded <"),C.startTagPosition+1<C.position){var F=C.position-C.startTagPosition;j=new Array(F).join(" ")+j}C.textNode+="<"+j,C.state=A.TEXT}continue;case A.SGML_DECL:(C.sgmlDecl+j).toUpperCase()===f?(I(C,"onopencdata"),C.state=A.CDATA,C.sgmlDecl="",C.cdata=""):C.sgmlDecl+j==="--"?(C.state=A.COMMENT,C.comment="",C.sgmlDecl=""):(C.sgmlDecl+j).toUpperCase()===d?(C.state=A.DOCTYPE,(C.doctype||C.sawRoot)&&W(C,"Inappropriately located doctype declaration"),C.doctype="",C.sgmlDecl=""):j===">"?(I(C,"onsgmldeclaration",C.sgmlDecl),C.sgmlDecl="",C.state=A.TEXT):(O(j)&&(C.state=A.SGML_DECL_QUOTED),C.sgmlDecl+=j);continue;case A.SGML_DECL_QUOTED:j===C.q&&(C.state=A.SGML_DECL,C.q=""),C.sgmlDecl+=j;continue;case A.DOCTYPE:j===">"?(C.state=A.TEXT,I(C,"ondoctype",C.doctype),C.doctype=!0):(C.doctype+=j,j==="["?C.state=A.DOCTYPE_DTD:O(j)&&(C.state=A.DOCTYPE_QUOTED,C.q=j));continue;case A.DOCTYPE_QUOTED:C.doctype+=j,j===C.q&&(C.q="",C.state=A.DOCTYPE);continue;case A.DOCTYPE_DTD:C.doctype+=j,j==="]"?C.state=A.DOCTYPE:O(j)&&(C.state=A.DOCTYPE_DTD_QUOTED,C.q=j);continue;case A.DOCTYPE_DTD_QUOTED:C.doctype+=j,j===C.q&&(C.state=A.DOCTYPE_DTD,C.q="");continue;case A.COMMENT:j==="-"?C.state=A.COMMENT_ENDING:C.comment+=j;continue;case A.COMMENT_ENDING:j==="-"?(C.state=A.COMMENT_ENDED,C.comment=k(C.opt,C.comment),C.comment&&I(C,"oncomment",C.comment),C.comment=""):(C.comment+="-"+j,C.state=A.COMMENT);continue;case A.COMMENT_ENDED:j!==">"?(W(C,"Malformed comment"),C.comment+="--"+j,C.state=A.COMMENT):C.state=A.TEXT;continue;case A.CDATA:j==="]"?C.state=A.CDATA_ENDING:C.cdata+=j;continue;case A.CDATA_ENDING:j==="]"?C.state=A.CDATA_ENDING_2:(C.cdata+="]"+j,C.state=A.CDATA);continue;case A.CDATA_ENDING_2:j===">"?(C.cdata&&I(C,"oncdata",C.cdata),I(C,"onclosecdata"),C.cdata="",C.state=A.TEXT):j==="]"?C.cdata+="]":(C.cdata+="]]"+j,C.state=A.CDATA);continue;case A.PROC_INST:j==="?"?C.state=A.PROC_INST_ENDING:x(j)?C.state=A.PROC_INST_BODY:C.procInstName+=j;continue;case A.PROC_INST_BODY:if(!C.procInstBody&&x(j))continue;j==="?"?C.state=A.PROC_INST_ENDING:C.procInstBody+=j;continue;case A.PROC_INST_ENDING:j===">"?(I(C,"onprocessinginstruction",{name:C.procInstName,body:C.procInstBody}),C.procInstName=C.procInstBody="",C.state=A.TEXT):(C.procInstBody+="?"+j,C.state=A.PROC_INST_BODY);continue;case A.OPEN_TAG:D(g,j)?C.tagName+=j:(ae(C),j===">"?q(C):j==="/"?C.state=A.OPEN_TAG_SLASH:(x(j)||W(C,"Invalid character in tag name"),C.state=A.ATTRIB));continue;case A.OPEN_TAG_SLASH:j===">"?(q(C,!0),N(C)):(W(C,"Forward-slash in opening tag not followed by >"),C.state=A.ATTRIB);continue;case A.ATTRIB:if(x(j))continue;j===">"?q(C):j==="/"?C.state=A.OPEN_TAG_SLASH:D(y,j)?(C.attribName=j,C.attribValue="",C.state=A.ATTRIB_NAME):W(C,"Invalid attribute name");continue;case A.ATTRIB_NAME:j==="="?C.state=A.ATTRIB_VALUE:j===">"?(W(C,"Attribute without value"),C.attribValue=C.attribName,de(C),q(C)):x(j)?C.state=A.ATTRIB_NAME_SAW_WHITE:D(g,j)?C.attribName+=j:W(C,"Invalid attribute name");continue;case A.ATTRIB_NAME_SAW_WHITE:if(j==="=")C.state=A.ATTRIB_VALUE;else{if(x(j))continue;W(C,"Attribute without value"),C.tag.attributes[C.attribName]="",C.attribValue="",I(C,"onattribute",{name:C.attribName,value:""}),C.attribName="",j===">"?q(C):D(y,j)?(C.attribName=j,C.state=A.ATTRIB_NAME):(W(C,"Invalid attribute name"),C.state=A.ATTRIB)}continue;case A.ATTRIB_VALUE:if(x(j))continue;O(j)?(C.q=j,C.state=A.ATTRIB_VALUE_QUOTED):(W(C,"Unquoted attribute value"),C.state=A.ATTRIB_VALUE_UNQUOTED,C.attribValue=j);continue;case A.ATTRIB_VALUE_QUOTED:if(j!==C.q){j==="&"?C.state=A.ATTRIB_VALUE_ENTITY_Q:C.attribValue+=j;continue}de(C),C.q="",C.state=A.ATTRIB_VALUE_CLOSED;continue;case A.ATTRIB_VALUE_CLOSED:x(j)?C.state=A.ATTRIB:j===">"?q(C):j==="/"?C.state=A.OPEN_TAG_SLASH:D(y,j)?(W(C,"No whitespace between attributes"),C.attribName=j,C.attribValue="",C.state=A.ATTRIB_NAME):W(C,"Invalid attribute name");continue;case A.ATTRIB_VALUE_UNQUOTED:if(!M(j)){j==="&"?C.state=A.ATTRIB_VALUE_ENTITY_U:C.attribValue+=j;continue}de(C),j===">"?q(C):C.state=A.ATTRIB;continue;case A.CLOSE_TAG:if(C.tagName)j===">"?N(C):D(g,j)?C.tagName+=j:C.script?(C.script+="</"+C.tagName,C.tagName="",C.state=A.SCRIPT):(x(j)||W(C,"Invalid tagname in closing tag"),C.state=A.CLOSE_TAG_SAW_WHITE);else{if(x(j))continue;$(y,j)?C.script?(C.script+="</"+j,C.state=A.SCRIPT):W(C,"Invalid tagname in closing tag."):C.tagName=j}continue;case A.CLOSE_TAG_SAW_WHITE:if(x(j))continue;j===">"?N(C):W(C,"Invalid characters in closing tag");continue;case A.TEXT_ENTITY:case A.ATTRIB_VALUE_ENTITY_Q:case A.ATTRIB_VALUE_ENTITY_U:var ne,T;switch(C.state){case A.TEXT_ENTITY:ne=A.TEXT,T="textNode";break;case A.ATTRIB_VALUE_ENTITY_Q:ne=A.ATTRIB_VALUE_QUOTED,T="attribValue";break;case A.ATTRIB_VALUE_ENTITY_U:ne=A.ATTRIB_VALUE_UNQUOTED,T="attribValue";break}j===";"?(C[T]+=Y(C),C.entity="",C.state=ne):D(C.entity.length?S:b,j)?C.entity+=j:(W(C,"Invalid character in entity name"),C[T]+="&"+C.entity+j,C.entity="",C.state=ne);continue;default:throw new Error(C,"Unknown state: "+C.state)}return C.position>=C.bufferCheckPosition&&i(C),C}/*! http://mths.be/fromcodepoint v0.1.0 by @mathias */String.fromCodePoint||function(){var _=String.fromCharCode,C=Math.floor,z=function(){var j=16384,P=[],F,ne,T=-1,re=arguments.length;if(!re)return"";for(var R="";++T<re;){var v=Number(arguments[T]);if(!isFinite(v)||v<0||v>1114111||C(v)!==v)throw RangeError("Invalid code point: "+v);v<=65535?P.push(v):(v-=65536,F=(v>>10)+55296,ne=v%1024+56320,P.push(F,ne)),(T+1===re||P.length>j)&&(R+=_.apply(null,P),P.length=0)}return R};Object.defineProperty?Object.defineProperty(String,"fromCodePoint",{value:z,configurable:!0,writable:!0}):String.fromCodePoint=z}()})(t)})(EM);var dw={isArray:function(t){return Array.isArray?Array.isArray(t):Object.prototype.toString.call(t)==="[object Array]"}},ute=dw.isArray,hw={copyOptions:function(t){var e,r={};for(e in t)t.hasOwnProperty(e)&&(r[e]=t[e]);return r},ensureFlagExists:function(t,e){(!(t in e)||typeof e[t]!="boolean")&&(e[t]=!1)},ensureSpacesExists:function(t){(!("spaces"in t)||typeof t.spaces!="number"&&typeof t.spaces!="string")&&(t.spaces=0)},ensureAlwaysArrayExists:function(t){(!("alwaysArray"in t)||typeof t.alwaysArray!="boolean"&&!ute(t.alwaysArray))&&(t.alwaysArray=!1)},ensureKeyExists:function(t,e){(!(t+"Key"in e)||typeof e[t+"Key"]!="string")&&(e[t+"Key"]=e.compact?"_"+t:t)},checkFnExists:function(t,e){return t+"Fn"in e}},fte=EM,ze=hw,ts=dw.isArray,le,Me;function dte(t){return le=ze.copyOptions(t),ze.ensureFlagExists("ignoreDeclaration",le),ze.ensureFlagExists("ignoreInstruction",le),ze.ensureFlagExists("ignoreAttributes",le),ze.ensureFlagExists("ignoreText",le),ze.ensureFlagExists("ignoreComment",le),ze.ensureFlagExists("ignoreCdata",le),ze.ensureFlagExists("ignoreDoctype",le),ze.ensureFlagExists("compact",le),ze.ensureFlagExists("alwaysChildren",le),ze.ensureFlagExists("addParent",le),ze.ensureFlagExists("trim",le),ze.ensureFlagExists("nativeType",le),ze.ensureFlagExists("nativeTypeAttributes",le),ze.ensureFlagExists("sanitize",le),ze.ensureFlagExists("instructionHasAttributes",le),ze.ensureFlagExists("captureSpacesBetweenElements",le),ze.ensureAlwaysArrayExists(le),ze.ensureKeyExists("declaration",le),ze.ensureKeyExists("instruction",le),ze.ensureKeyExists("attributes",le),ze.ensureKeyExists("text",le),ze.ensureKeyExists("comment",le),ze.ensureKeyExists("cdata",le),ze.ensureKeyExists("doctype",le),ze.ensureKeyExists("type",le),ze.ensureKeyExists("name",le),ze.ensureKeyExists("elements",le),ze.ensureKeyExists("parent",le),le}function qM(t){var e=Number(t);if(!isNaN(e))return e;var r=t.toLowerCase();return r==="true"?!0:r==="false"?!1:t}function El(t,e){var r;if(le.compact){if(!Me[le[t+"Key"]]&&(ts(le.alwaysArray)?le.alwaysArray.indexOf(le[t+"Key"])!==-1:le.alwaysArray)&&(Me[le[t+"Key"]]=[]),Me[le[t+"Key"]]&&!ts(Me[le[t+"Key"]])&&(Me[le[t+"Key"]]=[Me[le[t+"Key"]]]),t+"Fn"in le&&typeof e=="string"&&(e=le[t+"Fn"](e,Me)),t==="instruction"&&("instructionFn"in le||"instructionNameFn"in le)){for(r in e)if(e.hasOwnProperty(r))if("instructionFn"in le)e[r]=le.instructionFn(e[r],r,Me);else{var n=e[r];delete e[r],e[le.instructionNameFn(r,n,Me)]=n}}ts(Me[le[t+"Key"]])?Me[le[t+"Key"]].push(e):Me[le[t+"Key"]]=e}else{Me[le.elementsKey]||(Me[le.elementsKey]=[]);var i={};if(i[le.typeKey]=t,t==="instruction"){for(r in e)if(e.hasOwnProperty(r))break;i[le.nameKey]="instructionNameFn"in le?le.instructionNameFn(r,e,Me):r,le.instructionHasAttributes?(i[le.attributesKey]=e[r][le.attributesKey],"instructionFn"in le&&(i[le.attributesKey]=le.instructionFn(i[le.attributesKey],r,Me))):("instructionFn"in le&&(e[r]=le.instructionFn(e[r],r,Me)),i[le.instructionKey]=e[r])}else t+"Fn"in le&&(e=le[t+"Fn"](e,Me)),i[le[t+"Key"]]=e;le.addParent&&(i[le.parentKey]=Me),Me[le.elementsKey].push(i)}}function XM(t){if("attributesFn"in le&&t&&(t=le.attributesFn(t,Me)),(le.trim||"attributeValueFn"in le||"attributeNameFn"in le||le.nativeTypeAttributes)&&t){var e;for(e in t)if(t.hasOwnProperty(e)&&(le.trim&&(t[e]=t[e].trim()),le.nativeTypeAttributes&&(t[e]=qM(t[e])),"attributeValueFn"in le&&(t[e]=le.attributeValueFn(t[e],e,Me)),"attributeNameFn"in le)){var r=t[e];delete t[e],t[le.attributeNameFn(e,t[e],Me)]=r}}return t}function hte(t){var e={};if(t.body&&(t.name.toLowerCase()==="xml"||le.instructionHasAttributes)){for(var r=/([\w:-]+)\s*=\s*(?:"([^"]*)"|'([^']*)'|(\w+))\s*/g,n;(n=r.exec(t.body))!==null;)e[n[1]]=n[2]||n[3]||n[4];e=XM(e)}if(t.name.toLowerCase()==="xml"){if(le.ignoreDeclaration)return;Me[le.declarationKey]={},Object.keys(e).length&&(Me[le.declarationKey][le.attributesKey]=e),le.addParent&&(Me[le.declarationKey][le.parentKey]=Me)}else{if(le.ignoreInstruction)return;le.trim&&(t.body=t.body.trim());var i={};le.instructionHasAttributes&&Object.keys(e).length?(i[t.name]={},i[t.name][le.attributesKey]=e):i[t.name]=t.body,El("instruction",i)}}function pte(t,e){var r;if(typeof t=="object"&&(e=t.attributes,t=t.name),e=XM(e),"elementNameFn"in le&&(t=le.elementNameFn(t,Me)),le.compact){if(r={},!le.ignoreAttributes&&e&&Object.keys(e).length){r[le.attributesKey]={};var n;for(n in e)e.hasOwnProperty(n)&&(r[le.attributesKey][n]=e[n])}!(t in Me)&&(ts(le.alwaysArray)?le.alwaysArray.indexOf(t)!==-1:le.alwaysArray)&&(Me[t]=[]),Me[t]&&!ts(Me[t])&&(Me[t]=[Me[t]]),ts(Me[t])?Me[t].push(r):Me[t]=r}else Me[le.elementsKey]||(Me[le.elementsKey]=[]),r={},r[le.typeKey]="element",r[le.nameKey]=t,!le.ignoreAttributes&&e&&Object.keys(e).length&&(r[le.attributesKey]=e),le.alwaysChildren&&(r[le.elementsKey]=[]),Me[le.elementsKey].push(r);r[le.parentKey]=Me,Me=r}function mte(t){le.ignoreText||!t.trim()&&!le.captureSpacesBetweenElements||(le.trim&&(t=t.trim()),le.nativeType&&(t=qM(t)),le.sanitize&&(t=t.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")),El("text",t))}function gte(t){le.ignoreComment||(le.trim&&(t=t.trim()),El("comment",t))}function yte(t){var e=Me[le.parentKey];le.addParent||delete Me[le.parentKey],Me=e}function vte(t){le.ignoreCdata||(le.trim&&(t=t.trim()),El("cdata",t))}function wte(t){le.ignoreDoctype||(t=t.replace(/^ /,""),le.trim&&(t=t.trim()),El("doctype",t))}function bte(t){t.note=t}var JM=function(t,e){var r=fte.parser(!0,{}),n={};if(Me=n,le=dte(e),r.opt={strictEntities:!0},r.onopentag=pte,r.ontext=mte,r.oncomment=gte,r.onclosetag=yte,r.onerror=bte,r.oncdata=vte,r.ondoctype=wte,r.onprocessinginstruction=hte,r.write(t).close(),n[le.elementsKey]){var i=n[le.elementsKey];delete n[le.elementsKey],n[le.elementsKey]=i,delete n.text}return n},TE=hw,xte=JM;function Ste(t){var e=TE.copyOptions(t);return TE.ensureSpacesExists(e),e}var Ete=function(t,e){var r,n,i,o;return r=Ste(e),n=xte(t,r),o="compact"in r&&r.compact?"_parent":"parent","addParent"in r&&r.addParent?i=JSON.stringify(n,function(s,a){return s===o?"_":a},r.spaces):i=JSON.stringify(n,null,r.spaces),i.replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")},Xe=hw,Tte=dw.isArray,Mt,It;function Ate(t){var e=Xe.copyOptions(t);return Xe.ensureFlagExists("ignoreDeclaration",e),Xe.ensureFlagExists("ignoreInstruction",e),Xe.ensureFlagExists("ignoreAttributes",e),Xe.ensureFlagExists("ignoreText",e),Xe.ensureFlagExists("ignoreComment",e),Xe.ensureFlagExists("ignoreCdata",e),Xe.ensureFlagExists("ignoreDoctype",e),Xe.ensureFlagExists("compact",e),Xe.ensureFlagExists("indentText",e),Xe.ensureFlagExists("indentCdata",e),Xe.ensureFlagExists("indentAttributes",e),Xe.ensureFlagExists("indentInstruction",e),Xe.ensureFlagExists("fullTagEmptyElement",e),Xe.ensureFlagExists("noQuotesForNativeAttributes",e),Xe.ensureSpacesExists(e),typeof e.spaces=="number"&&(e.spaces=Array(e.spaces+1).join(" ")),Xe.ensureKeyExists("declaration",e),Xe.ensureKeyExists("instruction",e),Xe.ensureKeyExists("attributes",e),Xe.ensureKeyExists("text",e),Xe.ensureKeyExists("comment",e),Xe.ensureKeyExists("cdata",e),Xe.ensureKeyExists("doctype",e),Xe.ensureKeyExists("type",e),Xe.ensureKeyExists("name",e),Xe.ensureKeyExists("elements",e),e}function jr(t,e,r){return(!r&&t.spaces?`
588
- `:"")+Array(e+1).join(t.spaces)}function vd(t,e,r){if(e.ignoreAttributes)return"";"attributesFn"in e&&(t=e.attributesFn(t,It,Mt));var n,i,o,s,a=[];for(n in t)t.hasOwnProperty(n)&&t[n]!==null&&t[n]!==void 0&&(s=e.noQuotesForNativeAttributes&&typeof t[n]!="string"?"":'"',i=""+t[n],i=i.replace(/"/g,"&quot;"),o="attributeNameFn"in e?e.attributeNameFn(n,i,It,Mt):n,a.push(e.spaces&&e.indentAttributes?jr(e,r+1,!1):" "),a.push(o+"="+s+("attributeValueFn"in e?e.attributeValueFn(i,n,It,Mt):i)+s));return t&&Object.keys(t).length&&e.spaces&&e.indentAttributes&&a.push(jr(e,r,!1)),a.join("")}function YM(t,e,r){return Mt=t,It="xml",e.ignoreDeclaration?"":"<?xml"+vd(t[e.attributesKey],e,r)+"?>"}function ZM(t,e,r){if(e.ignoreInstruction)return"";var n;for(n in t)if(t.hasOwnProperty(n))break;var i="instructionNameFn"in e?e.instructionNameFn(n,t[n],It,Mt):n;if(typeof t[n]=="object")return Mt=t,It=i,"<?"+i+vd(t[n][e.attributesKey],e,r)+"?>";var o=t[n]?t[n]:"";return"instructionFn"in e&&(o=e.instructionFn(o,n,It,Mt)),"<?"+i+(o?" "+o:"")+"?>"}function QM(t,e){return e.ignoreComment?"":"<!--"+("commentFn"in e?e.commentFn(t,It,Mt):t)+"-->"}function eI(t,e){return e.ignoreCdata?"":"<![CDATA["+("cdataFn"in e?e.cdataFn(t,It,Mt):t.replace("]]>","]]]]><![CDATA[>"))+"]]>"}function tI(t,e){return e.ignoreDoctype?"":"<!DOCTYPE "+("doctypeFn"in e?e.doctypeFn(t,It,Mt):t)+">"}function pw(t,e){return e.ignoreText?"":(t=""+t,t=t.replace(/&amp;/g,"&"),t=t.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;"),"textFn"in e?e.textFn(t,It,Mt):t)}function Cte(t,e){var r;if(t.elements&&t.elements.length)for(r=0;r<t.elements.length;++r)switch(t.elements[r][e.typeKey]){case"text":if(e.indentText)return!0;break;case"cdata":if(e.indentCdata)return!0;break;case"instruction":if(e.indentInstruction)return!0;break;case"doctype":case"comment":case"element":return!0;default:return!0}return!1}function kte(t,e,r){Mt=t,It=t.name;var n=[],i="elementNameFn"in e?e.elementNameFn(t.name,t):t.name;n.push("<"+i),t[e.attributesKey]&&n.push(vd(t[e.attributesKey],e,r));var o=t[e.elementsKey]&&t[e.elementsKey].length||t[e.attributesKey]&&t[e.attributesKey]["xml:space"]==="preserve";return o||("fullTagEmptyElementFn"in e?o=e.fullTagEmptyElementFn(t.name,t):o=e.fullTagEmptyElement),o?(n.push(">"),t[e.elementsKey]&&t[e.elementsKey].length&&(n.push(rI(t[e.elementsKey],e,r+1)),Mt=t,It=t.name),n.push(e.spaces&&Cte(t,e)?`
589
- `+Array(r+1).join(e.spaces):""),n.push("</"+i+">")):n.push("/>"),n.join("")}function rI(t,e,r,n){return t.reduce(function(i,o){var s=jr(e,r,n&&!i);switch(o.type){case"element":return i+s+kte(o,e,r);case"comment":return i+s+QM(o[e.commentKey],e);case"doctype":return i+s+tI(o[e.doctypeKey],e);case"cdata":return i+(e.indentCdata?s:"")+eI(o[e.cdataKey],e);case"text":return i+(e.indentText?s:"")+pw(o[e.textKey],e);case"instruction":var a={};return a[o[e.nameKey]]=o[e.attributesKey]?o:o[e.instructionKey],i+(e.indentInstruction?s:"")+ZM(a,e,r)}},"")}function nI(t,e,r){var n;for(n in t)if(t.hasOwnProperty(n))switch(n){case e.parentKey:case e.attributesKey:break;case e.textKey:if(e.indentText||r)return!0;break;case e.cdataKey:if(e.indentCdata||r)return!0;break;case e.instructionKey:if(e.indentInstruction||r)return!0;break;case e.doctypeKey:case e.commentKey:return!0;default:return!0}return!1}function _te(t,e,r,n,i){Mt=t,It=e;var o="elementNameFn"in r?r.elementNameFn(e,t):e;if(typeof t>"u"||t===null||t==="")return"fullTagEmptyElementFn"in r&&r.fullTagEmptyElementFn(e,t)||r.fullTagEmptyElement?"<"+o+"></"+o+">":"<"+o+"/>";var s=[];if(e){if(s.push("<"+o),typeof t!="object")return s.push(">"+pw(t,r)+"</"+o+">"),s.join("");t[r.attributesKey]&&s.push(vd(t[r.attributesKey],r,n));var a=nI(t,r,!0)||t[r.attributesKey]&&t[r.attributesKey]["xml:space"]==="preserve";if(a||("fullTagEmptyElementFn"in r?a=r.fullTagEmptyElementFn(e,t):a=r.fullTagEmptyElement),a)s.push(">");else return s.push("/>"),s.join("")}return s.push(iI(t,r,n+1,!1)),Mt=t,It=e,e&&s.push((i?jr(r,n,!1):"")+"</"+o+">"),s.join("")}function iI(t,e,r,n){var i,o,s,a=[];for(o in t)if(t.hasOwnProperty(o))for(s=Tte(t[o])?t[o]:[t[o]],i=0;i<s.length;++i){switch(o){case e.declarationKey:a.push(YM(s[i],e,r));break;case e.instructionKey:a.push((e.indentInstruction?jr(e,r,n):"")+ZM(s[i],e,r));break;case e.attributesKey:case e.parentKey:break;case e.textKey:a.push((e.indentText?jr(e,r,n):"")+pw(s[i],e));break;case e.cdataKey:a.push((e.indentCdata?jr(e,r,n):"")+eI(s[i],e));break;case e.doctypeKey:a.push(jr(e,r,n)+tI(s[i],e));break;case e.commentKey:a.push(jr(e,r,n)+QM(s[i],e));break;default:a.push(jr(e,r,n)+_te(s[i],o,e,r,nI(s[i],e)))}n=n&&!a.length}return a.join("")}var oI=function(t,e){e=Ate(e);var r=[];return Mt=t,It="_root_",e.compact?r.push(iI(t,e,0,!0)):(t[e.declarationKey]&&r.push(YM(t[e.declarationKey],e,0)),t[e.elementsKey]&&t[e.elementsKey].length&&r.push(rI(t[e.elementsKey],e,0,!r.length))),r.join("")},Ote=oI,Rte=function(t,e){t instanceof Buffer&&(t=t.toString());var r=null;if(typeof t=="string")try{r=JSON.parse(t)}catch{throw new Error("The JSON structure is invalid")}else r=t;return Ote(r,e)},Mte=JM,Ite=Ete,Nte=oI,Dte=Rte,sI={xml2js:Mte,xml2json:Ite,js2xml:Nte,json2xml:Dte};const mw=t=>{switch(t.type){case void 0:case"element":const e=new Lte(t.name,t.attributes),r=t.elements||[];for(const n of r){const i=mw(n);i!==void 0&&e.push(i)}return e;case"text":return t.text;default:return}};class Pte extends be{}class Lte extends oe{static fromXmlString(e){const r=sI.xml2js(e,{compact:!1});return mw(r)}constructor(e,r){super(e),r&&this.root.push(new Pte(r))}push(e){this.root.push(e)}}class Fte extends oe{constructor(e){super(""),this._attr=e}prepForXml(e){return{_attr:this._attr}}}class aI extends oe{constructor(e,r){super(e),r&&(this.root=r.root)}}const Ft=t=>{if(isNaN(t))throw new Error(`Invalid value '${t}' specified. Must be an integer.`);return Math.floor(t)},wd=t=>{const e=Ft(t);if(e<0)throw new Error(`Invalid value '${t}' specified. Must be a positive integer.`);return e},lI=(t,e)=>{const r=e*2;if(t.length!==r||isNaN(+`0x${t}`))throw new Error(`Invalid hex value '${t}'. Expected ${r} digit hex value`);return t},AE=t=>lI(t,1),gw=t=>{const e=t.slice(-2),r=t.substring(0,t.length-2);return`${Number(r)}${e}`},cI=t=>{const e=gw(t);if(parseFloat(e)<0)throw new Error(`Invalid value '${e}' specified. Expected a positive number.`);return e},ks=t=>{if(t==="auto")return t;const e=t.charAt(0)==="#"?t.substring(1):t;return lI(e,3)},xn=t=>typeof t=="string"?gw(t):Ft(t),Bte=t=>typeof t=="string"?cI(t):wd(t),Ct=t=>typeof t=="string"?cI(t):wd(t),$te=t=>{const e=t.substring(0,t.length-1);return`${Number(e)}%`},jte=t=>typeof t=="number"?Ft(t):t.slice(-1)==="%"?$te(t):gw(t),Hte=wd,zte=wd,Ute=t=>t.toISOString();class ge extends oe{constructor(e,r=!0){super(e),r!==!0&&this.root.push(new st({val:r}))}}class zp extends oe{constructor(e,r){super(e),this.root.push(new st({val:Bte(r)}))}}class Yi extends oe{constructor(e,r){super(e),this.root.push(new st({val:r}))}}const ea=(t,e)=>new Bt({name:t,attributes:{value:{key:"w:val",value:e}}});class yw extends oe{constructor(e,r){super(e),this.root.push(new st({val:r}))}}class Wte extends oe{constructor(e,r){super(e),this.root.push(new st({val:r}))}}class Ni extends oe{constructor(e,r){super(e),this.root.push(r)}}class Bt extends oe{constructor({name:e,attributes:r,children:n}){super(e),r&&this.root.push(new Pn(r)),n&&this.root.push(...n)}}const Vt={START:"start",CENTER:"center",END:"end",BOTH:"both",MEDIUM_KASHIDA:"mediumKashida",DISTRIBUTE:"distribute",NUM_TAB:"numTab",HIGH_KASHIDA:"highKashida",LOW_KASHIDA:"lowKashida",THAI_DISTRIBUTE:"thaiDistribute",LEFT:"left",RIGHT:"right",JUSTIFIED:"both"};class Vte extends be{constructor(){super(...arguments),se(this,"xmlKeys",{val:"w:val"})}}class uI extends oe{constructor(e){super("w:jc"),this.root.push(new Vte({val:e}))}}class Ue extends oe{constructor(e,{color:r,size:n,space:i,style:o}){super(e),this.root.push(new Gte({style:o,color:r===void 0?void 0:ks(r),size:n===void 0?void 0:Hte(n),space:i===void 0?void 0:zte(i)}))}}class Gte extends be{constructor(){super(...arguments),se(this,"xmlKeys",{style:"w:val",color:"w:color",size:"w:sz",space:"w:space"})}}const vw={SINGLE:"single",DASH_DOT_STROKED:"dashDotStroked",DASHED:"dashed",DASH_SMALL_GAP:"dashSmallGap",DOT_DASH:"dotDash",DOT_DOT_DASH:"dotDotDash",DOTTED:"dotted",DOUBLE:"double",DOUBLE_WAVE:"doubleWave",INSET:"inset",NIL:"nil",NONE:"none",OUTSET:"outset",THICK:"thick",THICK_THIN_LARGE_GAP:"thickThinLargeGap",THICK_THIN_MEDIUM_GAP:"thickThinMediumGap",THICK_THIN_SMALL_GAP:"thickThinSmallGap",THIN_THICK_LARGE_GAP:"thinThickLargeGap",THIN_THICK_MEDIUM_GAP:"thinThickMediumGap",THIN_THICK_SMALL_GAP:"thinThickSmallGap",THIN_THICK_THIN_LARGE_GAP:"thinThickThinLargeGap",THIN_THICK_THIN_MEDIUM_GAP:"thinThickThinMediumGap",THIN_THICK_THIN_SMALL_GAP:"thinThickThinSmallGap",THREE_D_EMBOSS:"threeDEmboss",THREE_D_ENGRAVE:"threeDEngrave",TRIPLE:"triple",WAVE:"wave"};class Kte extends Dn{constructor(e){super("w:pBdr"),e.top&&this.root.push(new Ue("w:top",e.top)),e.bottom&&this.root.push(new Ue("w:bottom",e.bottom)),e.left&&this.root.push(new Ue("w:left",e.left)),e.right&&this.root.push(new Ue("w:right",e.right))}}class qte extends oe{constructor(){super("w:pBdr");const e=new Ue("w:bottom",{color:"auto",space:1,style:vw.SINGLE,size:6});this.root.push(e)}}class Xte extends oe{constructor({start:e,end:r,left:n,right:i,hanging:o,firstLine:s}){super("w:ind"),this.root.push(new Pn({start:{key:"w:start",value:e===void 0?void 0:xn(e)},end:{key:"w:end",value:r===void 0?void 0:xn(r)},left:{key:"w:left",value:n===void 0?void 0:xn(n)},right:{key:"w:right",value:i===void 0?void 0:xn(i)},hanging:{key:"w:hanging",value:o===void 0?void 0:Ct(o)},firstLine:{key:"w:firstLine",value:s===void 0?void 0:Ct(s)}}))}}let Jte=class extends oe{constructor(){super("w:br")}};const ww={BEGIN:"begin",END:"end",SEPARATE:"separate"};class bw extends be{constructor(){super(...arguments),se(this,"xmlKeys",{type:"w:fldCharType",dirty:"w:dirty"})}}class aa extends oe{constructor(e){super("w:fldChar"),this.root.push(new bw({type:ww.BEGIN,dirty:e}))}}class la extends oe{constructor(e){super("w:fldChar"),this.root.push(new bw({type:ww.SEPARATE,dirty:e}))}}class ca extends oe{constructor(e){super("w:fldChar"),this.root.push(new bw({type:ww.END,dirty:e}))}}const lo={DEFAULT:"default",PRESERVE:"preserve"};class co extends be{constructor(){super(...arguments),se(this,"xmlKeys",{space:"xml:space"})}}class Yte extends oe{constructor(){super("w:instrText"),this.root.push(new co({space:lo.PRESERVE})),this.root.push("PAGE")}}class Zte extends oe{constructor(){super("w:instrText"),this.root.push(new co({space:lo.PRESERVE})),this.root.push("NUMPAGES")}}class Qte extends oe{constructor(){super("w:instrText"),this.root.push(new co({space:lo.PRESERVE})),this.root.push("SECTIONPAGES")}}class ere extends oe{constructor(){super("w:instrText"),this.root.push(new co({space:lo.PRESERVE})),this.root.push("SECTION")}}class tre extends be{constructor(){super(...arguments),se(this,"xmlKeys",{fill:"w:fill",color:"w:color",type:"w:val"})}}class bd extends oe{constructor({fill:e,color:r,type:n}){super("w:shd"),this.root.push(new tre({fill:e===void 0?void 0:ks(e),color:r===void 0?void 0:ks(r),type:n}))}}const rre={CLEAR:"clear",DIAGONAL_CROSS:"diagCross",DIAGONAL_STRIPE:"diagStripe",HORIZONTAL_CROSS:"horzCross",HORIZONTAL_STRIPE:"horzStripe",NIL:"nil",PERCENT_5:"pct5",PERCENT_10:"pct10",PERCENT_12:"pct12",PERCENT_15:"pct15",PERCENT_20:"pct20",PERCENT_25:"pct25",PERCENT_30:"pct30",PERCENT_35:"pct35",PERCENT_37:"pct37",PERCENT_40:"pct40",PERCENT_45:"pct45",PERCENT_50:"pct50",PERCENT_55:"pct55",PERCENT_60:"pct60",PERCENT_62:"pct62",PERCENT_65:"pct65",PERCENT_70:"pct70",PERCENT_75:"pct75",PERCENT_80:"pct80",PERCENT_85:"pct85",PERCENT_87:"pct87",PERCENT_90:"pct90",PERCENT_95:"pct95",REVERSE_DIAGONAL_STRIPE:"reverseDiagStripe",SOLID:"solid",THIN_DIAGONAL_CROSS:"thinDiagCross",THIN_DIAGONAL_STRIPE:"thinDiagStripe",THIN_HORIZONTAL_CROSS:"thinHorzCross",THIN_REVERSE_DIAGONAL_STRIPE:"thinReverseDiagStripe",THIN_VERTICAL_STRIPE:"thinVertStripe",VERTICAL_STRIPE:"vertStripe"};class nre extends be{constructor(){super(...arguments),se(this,"xmlKeys",{id:"w:id",author:"w:author",date:"w:date"})}}const ire={DOT:"dot"};class ore extends oe{constructor(e){super("w:em"),this.root.push(new st({val:e}))}}class sre extends ore{constructor(e=ire.DOT){super(e)}}class are extends oe{constructor(e){super("w:spacing"),this.root.push(new st({val:xn(e)}))}}class lre extends oe{constructor(e){super("w:color"),this.root.push(new st({val:ks(e)}))}}class cre extends oe{constructor(e){super("w:highlight"),this.root.push(new st({val:e}))}}class ure extends oe{constructor(e){super("w:highlightCs"),this.root.push(new st({val:e}))}}const fre=t=>new Bt({name:"w:lang",attributes:{value:{key:"w:val",value:t.value},eastAsia:{key:"w:eastAsia",value:t.eastAsia},bidirectional:{key:"w:bidi",value:t.bidirectional}}});class CE extends be{constructor(){super(...arguments),se(this,"xmlKeys",{ascii:"w:ascii",cs:"w:cs",eastAsia:"w:eastAsia",hAnsi:"w:hAnsi",hint:"w:hint"})}}class Up extends oe{constructor(e,r){if(super("w:rFonts"),typeof e=="string"){const n=e;this.root.push(new CE({ascii:n,cs:n,eastAsia:n,hAnsi:n,hint:r}))}else{const n=e;this.root.push(new CE(n))}}}let fI=class extends oe{constructor(e){super("w:vertAlign"),this.root.push(new st({val:e}))}};class dre extends fI{constructor(){super("superscript")}}class hre extends fI{constructor(){super("subscript")}}const dI={SINGLE:"single",WORDS:"words",DOUBLE:"double",THICK:"thick",DOTTED:"dotted",DOTTEDHEAVY:"dottedHeavy",DASH:"dash",DASHEDHEAVY:"dashedHeavy",DASHLONG:"dashLong",DASHLONGHEAVY:"dashLongHeavy",DOTDASH:"dotDash",DASHDOTHEAVY:"dashDotHeavy",DOTDOTDASH:"dotDotDash",DASHDOTDOTHEAVY:"dashDotDotHeavy",WAVE:"wave",WAVYHEAVY:"wavyHeavy",WAVYDOUBLE:"wavyDouble",NONE:"none"};class pre extends oe{constructor(e=dI.SINGLE,r){super("w:u"),this.root.push(new st({val:e,color:r===void 0?void 0:ks(r)}))}}class bo extends Dn{constructor(e){var r,n;if(super("w:rPr"),!e)return;e.noProof!==void 0&&this.push(new ge("w:noProof",e.noProof)),e.bold!==void 0&&this.push(new ge("w:b",e.bold)),(e.boldComplexScript===void 0&&e.bold!==void 0||e.boldComplexScript)&&this.push(new ge("w:bCs",(r=e.boldComplexScript)!=null?r:e.bold)),e.italics!==void 0&&this.push(new ge("w:i",e.italics)),(e.italicsComplexScript===void 0&&e.italics!==void 0||e.italicsComplexScript)&&this.push(new ge("w:iCs",(n=e.italicsComplexScript)!=null?n:e.italics)),e.underline&&this.push(new pre(e.underline.type,e.underline.color)),e.effect&&this.push(new Yi("w:effect",e.effect)),e.emphasisMark&&this.push(new sre(e.emphasisMark.type)),e.color&&this.push(new lre(e.color)),e.kern&&this.push(new zp("w:kern",e.kern)),e.position&&this.push(new Yi("w:position",e.position)),e.size!==void 0&&this.push(new zp("w:sz",e.size));const i=e.sizeComplexScript===void 0||e.sizeComplexScript===!0?e.size:e.sizeComplexScript;i&&this.push(new zp("w:szCs",i)),e.rightToLeft!==void 0&&this.push(new ge("w:rtl",e.rightToLeft)),e.smallCaps!==void 0?this.push(new ge("w:smallCaps",e.smallCaps)):e.allCaps!==void 0&&this.push(new ge("w:caps",e.allCaps)),e.strike!==void 0&&this.push(new ge("w:strike",e.strike)),e.doubleStrike!==void 0&&this.push(new ge("w:dstrike",e.doubleStrike)),e.subScript&&this.push(new hre),e.superScript&&this.push(new dre),e.style&&this.push(new Yi("w:rStyle",e.style)),e.font&&(typeof e.font=="string"?this.push(new Up(e.font)):"name"in e.font?this.push(new Up(e.font.name,e.font.hint)):this.push(new Up(e.font))),e.highlight&&this.push(new cre(e.highlight));const o=e.highlightComplexScript===void 0||e.highlightComplexScript===!0?e.highlight:e.highlightComplexScript;o&&this.push(new ure(o)),e.characterSpacing&&this.push(new are(e.characterSpacing)),e.emboss!==void 0&&this.push(new ge("w:emboss",e.emboss)),e.imprint!==void 0&&this.push(new ge("w:imprint",e.imprint)),e.shading&&this.push(new bd(e.shading)),e.revision&&this.push(new mre(e.revision)),e.border&&this.push(new Ue("w:bdr",e.border)),e.snapToGrid!==void 0&&this.push(new ge("w:snapToGrid",e.snapToGrid)),e.vanish&&this.push(new ge("w:vanish",e.vanish)),e.specVanish&&this.push(new ge("w:specVanish",e.vanish)),e.scale!==void 0&&this.push(new yw("w:w",e.scale)),e.language&&this.push(fre(e.language)),e.math&&this.push(new ge("w:oMath",e.math))}push(e){this.root.push(e)}}class mre extends oe{constructor(e){super("w:rPrChange"),this.root.push(new nre({id:e.id,author:e.author,date:e.date})),this.addChildElement(new bo(e))}}class Xg extends oe{constructor(e){var r;return super("w:t"),typeof e=="string"?(this.root.push(new co({space:lo.PRESERVE})),this.root.push(e),this):(this.root.push(new co({space:(r=e.space)!=null?r:lo.DEFAULT})),this.root.push(e.text),this)}}const hc={CURRENT:"CURRENT",TOTAL_PAGES:"TOTAL_PAGES",TOTAL_PAGES_IN_SECTION:"TOTAL_PAGES_IN_SECTION",CURRENT_SECTION:"SECTION"};class xo extends oe{constructor(e){if(super("w:r"),se(this,"properties"),this.properties=new bo(e),this.root.push(this.properties),e.break)for(let r=0;r<e.break;r++)this.root.push(new Jte);if(e.children)for(const r of e.children){if(typeof r=="string"){switch(r){case hc.CURRENT:this.root.push(new aa),this.root.push(new Yte),this.root.push(new la),this.root.push(new ca);break;case hc.TOTAL_PAGES:this.root.push(new aa),this.root.push(new Zte),this.root.push(new la),this.root.push(new ca);break;case hc.TOTAL_PAGES_IN_SECTION:this.root.push(new aa),this.root.push(new Qte),this.root.push(new la),this.root.push(new ca);break;case hc.CURRENT_SECTION:this.root.push(new aa),this.root.push(new ere),this.root.push(new la),this.root.push(new ca);break;default:this.root.push(new Xg(r));break}continue}this.root.push(r)}else e.text&&this.root.push(new Xg(e.text))}}class Sr extends xo{constructor(e){if(typeof e=="string")return super({}),this.root.push(new Xg(e)),this;super(e)}}let gre="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict",yre=(t,e=21)=>(r=e)=>{let n="",i=r;for(;i--;)n+=t[Math.random()*t.length|0];return n},vre=(t=21)=>{let e="",r=t;for(;r--;)e+=gre[Math.random()*64|0];return e};const Yt=t=>Math.floor(t*72*20),xd=(t=0)=>{let e=t;return()=>++e},wre=()=>xd(),bre=()=>xd(1),xre=()=>xd(),Sre=()=>xd(),xw=()=>vre().toLowerCase(),ta=t=>yre("1234567890abcdef",t)(),Ere=()=>`${ta(8)}-${ta(4)}-${ta(4)}-${ta(4)}-${ta(12)}`,Tre={CHARACTER:"character",COLUMN:"column",INSIDE_MARGIN:"insideMargin",LEFT_MARGIN:"leftMargin",MARGIN:"margin",OUTSIDE_MARGIN:"outsideMargin",PAGE:"page",RIGHT_MARGIN:"rightMargin"},Are={BOTTOM_MARGIN:"bottomMargin",INSIDE_MARGIN:"insideMargin",LINE:"line",MARGIN:"margin",OUTSIDE_MARGIN:"outsideMargin",PAGE:"page",PARAGRAPH:"paragraph",TOP_MARGIN:"topMargin"};class Cre extends be{constructor(){super(...arguments),se(this,"xmlKeys",{x:"x",y:"y"})}}class kre extends oe{constructor(){super("wp:simplePos"),this.root.push(new Cre({x:0,y:0}))}}class hI extends oe{constructor(e){super("wp:align"),this.root.push(e)}}class pI extends oe{constructor(e){super("wp:posOffset"),this.root.push(e.toString())}}class _re extends be{constructor(){super(...arguments),se(this,"xmlKeys",{relativeFrom:"relativeFrom"})}}class Ore extends oe{constructor(e){if(super("wp:positionH"),this.root.push(new _re({relativeFrom:e.relative||Tre.PAGE})),e.align)this.root.push(new hI(e.align));else if(e.offset!==void 0)this.root.push(new pI(e.offset));else throw new Error("There is no configuration provided for floating position (Align or offset)")}}class Rre extends be{constructor(){super(...arguments),se(this,"xmlKeys",{relativeFrom:"relativeFrom"})}}class Mre extends oe{constructor(e){if(super("wp:positionV"),this.root.push(new Rre({relativeFrom:e.relative||Are.PAGE})),e.align)this.root.push(new hI(e.align));else if(e.offset!==void 0)this.root.push(new pI(e.offset));else throw new Error("There is no configuration provided for floating position (Align or offset)")}}class Ire extends be{constructor(){super(...arguments),se(this,"xmlKeys",{uri:"uri"})}}class Nre extends be{constructor(){super(...arguments),se(this,"xmlKeys",{embed:"r:embed",cstate:"cstate"})}}class Dre extends oe{constructor(e){super("a:blip"),this.root.push(new Nre({embed:`rId{${e.fileName}}`,cstate:"none"}))}}class Pre extends oe{constructor(){super("a:srcRect")}}class Lre extends oe{constructor(){super("a:fillRect")}}class Fre extends oe{constructor(){super("a:stretch"),this.root.push(new Lre)}}class Bre extends oe{constructor(e){super("pic:blipFill"),this.root.push(new Dre(e)),this.root.push(new Pre),this.root.push(new Fre)}}class $re extends be{constructor(){super(...arguments),se(this,"xmlKeys",{noChangeAspect:"noChangeAspect",noChangeArrowheads:"noChangeArrowheads"})}}class jre extends oe{constructor(){super("a:picLocks"),this.root.push(new $re({noChangeAspect:1,noChangeArrowheads:1}))}}class Hre extends oe{constructor(){super("pic:cNvPicPr"),this.root.push(new jre)}}const mI=(t,e)=>new Bt({name:"a:hlinkClick",attributes:As(je({},e?{xmlns:{key:"xmlns:a",value:"http://schemas.openxmlformats.org/drawingml/2006/main"}}:{}),{id:{key:"r:id",value:`rId${t}`}})});class zre extends be{constructor(){super(...arguments),se(this,"xmlKeys",{id:"id",name:"name",descr:"descr"})}}class Ure extends oe{constructor(){super("pic:cNvPr"),this.root.push(new zre({id:0,name:"",descr:""}))}prepForXml(e){for(let r=e.stack.length-1;r>=0;r--){const n=e.stack[r];if(n instanceof Sd){this.root.push(mI(n.linkId,!1));break}}return super.prepForXml(e)}}class Wre extends oe{constructor(){super("pic:nvPicPr"),this.root.push(new Ure),this.root.push(new Hre)}}class Vre extends be{constructor(){super(...arguments),se(this,"xmlKeys",{xmlns:"xmlns:pic"})}}class Gre extends be{constructor(){super(...arguments),se(this,"xmlKeys",{cx:"cx",cy:"cy"})}}class Kre extends oe{constructor(e,r){super("a:ext"),se(this,"attributes"),this.attributes=new Gre({cx:e,cy:r}),this.root.push(this.attributes)}}class qre extends be{constructor(){super(...arguments),se(this,"xmlKeys",{x:"x",y:"y"})}}class Xre extends oe{constructor(){super("a:off"),this.root.push(new qre({x:0,y:0}))}}class Jre extends be{constructor(){super(...arguments),se(this,"xmlKeys",{flipVertical:"flipV",flipHorizontal:"flipH",rotation:"rot"})}}class Yre extends oe{constructor(e){var r,n;super("a:xfrm"),se(this,"extents"),this.root.push(new Jre({flipVertical:(r=e.flip)==null?void 0:r.vertical,flipHorizontal:(n=e.flip)==null?void 0:n.horizontal,rotation:e.rotation})),this.extents=new Kre(e.emus.x,e.emus.y),this.root.push(new Xre),this.root.push(this.extents)}}const gI=()=>new Bt({name:"a:noFill"}),Zre=t=>new Bt({name:"a:schemeClr",attributes:{value:{key:"val",value:t.value}}}),Qre=t=>new Bt({name:"a:srgbClr",attributes:{value:{key:"val",value:t.value}}}),kE=t=>new Bt({name:"a:solidFill",children:[t.type==="rgb"?Qre(t):Zre(t)]}),ene=t=>new Bt({name:"a:ln",attributes:{width:{key:"w",value:t.width},cap:{key:"cap",value:t.cap},compoundLine:{key:"cmpd",value:t.compoundLine},align:{key:"algn",value:t.align}},children:[t.type==="noFill"?gI():t.solidFillType==="rgb"?kE({type:"rgb",value:t.value}):kE({type:"scheme",value:t.value})]});class tne extends oe{constructor(){super("a:avLst")}}class rne extends be{constructor(){super(...arguments),se(this,"xmlKeys",{prst:"prst"})}}class nne extends oe{constructor(){super("a:prstGeom"),this.root.push(new rne({prst:"rect"})),this.root.push(new tne)}}class ine extends be{constructor(){super(...arguments),se(this,"xmlKeys",{bwMode:"bwMode"})}}class one extends oe{constructor({outline:e,transform:r}){super("pic:spPr"),se(this,"form"),this.root.push(new ine({bwMode:"auto"})),this.form=new Yre(r),this.root.push(this.form),this.root.push(new nne),e&&(this.root.push(gI()),this.root.push(ene(e)))}}class sne extends oe{constructor({mediaData:e,transform:r,outline:n}){super("pic:pic"),this.root.push(new Vre({xmlns:"http://schemas.openxmlformats.org/drawingml/2006/picture"})),this.root.push(new Wre),this.root.push(new Bre(e)),this.root.push(new one({transform:r,outline:n}))}}class ane extends oe{constructor({mediaData:e,transform:r,outline:n}){super("a:graphicData"),se(this,"pic"),this.root.push(new Ire({uri:"http://schemas.openxmlformats.org/drawingml/2006/picture"})),this.pic=new sne({mediaData:e,transform:r,outline:n}),this.root.push(this.pic)}}class lne extends be{constructor(){super(...arguments),se(this,"xmlKeys",{a:"xmlns:a"})}}class yI extends oe{constructor({mediaData:e,transform:r,outline:n}){super("a:graphic"),se(this,"data"),this.root.push(new lne({a:"http://schemas.openxmlformats.org/drawingml/2006/main"})),this.data=new ane({mediaData:e,transform:r,outline:n}),this.root.push(this.data)}}const pc={NONE:0,SQUARE:1,TIGHT:2,TOP_AND_BOTTOM:3},cne={BOTH_SIDES:"bothSides",LEFT:"left",RIGHT:"right",LARGEST:"largest"};class _E extends oe{constructor(){super("wp:wrapNone")}}class une extends be{constructor(){super(...arguments),se(this,"xmlKeys",{distT:"distT",distB:"distB",distL:"distL",distR:"distR",wrapText:"wrapText"})}}class fne extends oe{constructor(e,r={top:0,bottom:0,left:0,right:0}){super("wp:wrapSquare"),this.root.push(new une({wrapText:e.side||cne.BOTH_SIDES,distT:r.top,distB:r.bottom,distL:r.left,distR:r.right}))}}class dne extends be{constructor(){super(...arguments),se(this,"xmlKeys",{distT:"distT",distB:"distB"})}}class hne extends oe{constructor(e={top:0,bottom:0}){super("wp:wrapTight"),this.root.push(new dne({distT:e.top,distB:e.bottom}))}}class pne extends be{constructor(){super(...arguments),se(this,"xmlKeys",{distT:"distT",distB:"distB"})}}class mne extends oe{constructor(e={top:0,bottom:0}){super("wp:wrapTopAndBottom"),this.root.push(new pne({distT:e.top,distB:e.bottom}))}}class vI extends oe{constructor({name:e,description:r,title:n}={name:"",description:"",title:""}){super("wp:docPr"),se(this,"docPropertiesUniqueNumericId",xre()),this.root.push(new Pn({id:{key:"id",value:this.docPropertiesUniqueNumericId()},name:{key:"name",value:e},description:{key:"descr",value:r},title:{key:"title",value:n}}))}prepForXml(e){for(let r=e.stack.length-1;r>=0;r--){const n=e.stack[r];if(n instanceof Sd){this.root.push(mI(n.linkId,!0));break}}return super.prepForXml(e)}}const wI=({top:t,right:e,bottom:r,left:n})=>new Bt({name:"wp:effectExtent",attributes:{top:{key:"t",value:t},right:{key:"r",value:e},bottom:{key:"b",value:r},left:{key:"l",value:n}}});class gne extends be{constructor(){super(...arguments),se(this,"xmlKeys",{cx:"cx",cy:"cy"})}}class bI extends oe{constructor(e,r){super("wp:extent"),se(this,"attributes"),this.attributes=new gne({cx:e,cy:r}),this.root.push(this.attributes)}}class yne extends be{constructor(){super(...arguments),se(this,"xmlKeys",{xmlns:"xmlns:a",noChangeAspect:"noChangeAspect"})}}class vne extends oe{constructor(){super("a:graphicFrameLocks"),this.root.push(new yne({xmlns:"http://schemas.openxmlformats.org/drawingml/2006/main",noChangeAspect:1}))}}class xI extends oe{constructor(){super("wp:cNvGraphicFramePr"),this.root.push(new vne)}}class wne extends be{constructor(){super(...arguments),se(this,"xmlKeys",{distT:"distT",distB:"distB",distL:"distL",distR:"distR",allowOverlap:"allowOverlap",behindDoc:"behindDoc",layoutInCell:"layoutInCell",locked:"locked",relativeHeight:"relativeHeight",simplePos:"simplePos"})}}class bne extends oe{constructor({mediaData:e,transform:r,drawingOptions:n}){super("wp:anchor");const i=je({allowOverlap:!0,behindDocument:!1,lockAnchor:!1,layoutInCell:!0,verticalPosition:{},horizontalPosition:{}},n.floating);if(this.root.push(new wne({distT:i.margins&&i.margins.top||0,distB:i.margins&&i.margins.bottom||0,distL:i.margins&&i.margins.left||0,distR:i.margins&&i.margins.right||0,simplePos:"0",allowOverlap:i.allowOverlap===!0?"1":"0",behindDoc:i.behindDocument===!0?"1":"0",locked:i.lockAnchor===!0?"1":"0",layoutInCell:i.layoutInCell===!0?"1":"0",relativeHeight:i.zIndex?i.zIndex:r.emus.y})),this.root.push(new kre),this.root.push(new Ore(i.horizontalPosition)),this.root.push(new Mre(i.verticalPosition)),this.root.push(new bI(r.emus.x,r.emus.y)),this.root.push(wI({top:0,right:0,bottom:0,left:0})),n.floating!==void 0&&n.floating.wrap!==void 0)switch(n.floating.wrap.type){case pc.SQUARE:this.root.push(new fne(n.floating.wrap,n.floating.margins));break;case pc.TIGHT:this.root.push(new hne(n.floating.margins));break;case pc.TOP_AND_BOTTOM:this.root.push(new mne(n.floating.margins));break;case pc.NONE:default:this.root.push(new _E)}else this.root.push(new _E);this.root.push(new vI(n.docProperties)),this.root.push(new xI),this.root.push(new yI({mediaData:e,transform:r,outline:n.outline}))}}const xne=({mediaData:t,transform:e,docProperties:r,outline:n})=>{var i,o,s,a;return new Bt({name:"wp:inline",attributes:{distanceTop:{key:"distT",value:0},distanceBottom:{key:"distB",value:0},distanceLeft:{key:"distL",value:0},distanceRight:{key:"distR",value:0}},children:[new bI(e.emus.x,e.emus.y),wI(n?{top:((i=n.width)!=null?i:9525)*2,right:((o=n.width)!=null?o:9525)*2,bottom:((s=n.width)!=null?s:9525)*2,left:((a=n.width)!=null?a:9525)*2}:{top:0,right:0,bottom:0,left:0}),new vI(r),new xI,new yI({mediaData:t,transform:e,outline:n})]})};class Sne extends oe{constructor(e,r={}){super("w:drawing"),r.floating?this.root.push(new bne({mediaData:e,transform:e.transformation,drawingOptions:r})):this.root.push(xne({mediaData:e,transform:e.transformation,docProperties:r.docProperties,outline:r.outline}))}}class Ene extends xo{constructor(e){super({}),se(this,"key",`${xw()}.png`),se(this,"imageData");const r=typeof e.data=="string"?this.convertDataURIToBinary(e.data):e.data;this.imageData={stream:r,fileName:this.key,transformation:{pixels:{x:Math.round(e.transformation.width),y:Math.round(e.transformation.height)},emus:{x:Math.round(e.transformation.width*9525),y:Math.round(e.transformation.height*9525)},flip:e.transformation.flip,rotation:e.transformation.rotation?e.transformation.rotation*6e4:void 0}};const n=new Sne(this.imageData,{floating:e.floating,docProperties:e.altText,outline:e.outline});this.root.push(n)}prepForXml(e){return e.file.Media.addImage(this.key,this.imageData),super.prepForXml(e)}convertDataURIToBinary(e){if(typeof atob=="function"){const r=";base64,",n=e.indexOf(r),i=n===-1?0:n+r.length;return new Uint8Array(atob(e.substring(i)).split("").map(o=>o.charCodeAt(0)))}else{const r=require("buffer");return new r.Buffer(e,"base64")}}}class Tne extends oe{constructor(e){super("w:instrText"),this.root.push(new co({space:lo.PRESERVE})),this.root.push(`SEQ ${e}`)}}class Ane extends xo{constructor(e){super({}),this.root.push(new aa(!0)),this.root.push(new Tne(e)),this.root.push(new la),this.root.push(new ca)}}class Cne extends be{constructor(){super(...arguments),se(this,"xmlKeys",{instr:"w:instr"})}}class kne extends oe{constructor(e,r){super("w:fldSimple"),this.root.push(new Cne({instr:e})),r!==void 0&&this.root.push(new Sr(r))}}class _ne extends be{constructor(){super(...arguments),se(this,"xmlKeys",{id:"w:id",initials:"w:initials",author:"w:author",date:"w:date"})}}class One extends be{constructor(){super(...arguments),se(this,"xmlKeys",{"xmlns:cx":"xmlns:cx","xmlns:cx1":"xmlns:cx1","xmlns:cx2":"xmlns:cx2","xmlns:cx3":"xmlns:cx3","xmlns:cx4":"xmlns:cx4","xmlns:cx5":"xmlns:cx5","xmlns:cx6":"xmlns:cx6","xmlns:cx7":"xmlns:cx7","xmlns:cx8":"xmlns:cx8","xmlns:mc":"xmlns:mc","xmlns:aink":"xmlns:aink","xmlns:am3d":"xmlns:am3d","xmlns:o":"xmlns:o","xmlns:r":"xmlns:r","xmlns:m":"xmlns:m","xmlns:v":"xmlns:v","xmlns:wp14":"xmlns:wp14","xmlns:wp":"xmlns:wp","xmlns:w10":"xmlns:w10","xmlns:w":"xmlns:w","xmlns:w14":"xmlns:w14","xmlns:w15":"xmlns:w15","xmlns:w16cex":"xmlns:w16cex","xmlns:w16cid":"xmlns:w16cid","xmlns:w16":"xmlns:w16","xmlns:w16sdtdh":"xmlns:w16sdtdh","xmlns:w16se":"xmlns:w16se","xmlns:wpg":"xmlns:wpg","xmlns:wpi":"xmlns:wpi","xmlns:wne":"xmlns:wne","xmlns:wps":"xmlns:wps"})}}class Rne extends oe{constructor({id:e,initials:r,author:n,date:i=new Date,children:o}){super("w:comment"),this.root.push(new _ne({id:e,initials:r,author:n,date:i.toISOString()}));for(const s of o)this.root.push(s)}}class Mne extends oe{constructor({children:e}){super("w:comments"),this.root.push(new One({"xmlns:cx":"http://schemas.microsoft.com/office/drawing/2014/chartex","xmlns:cx1":"http://schemas.microsoft.com/office/drawing/2015/9/8/chartex","xmlns:cx2":"http://schemas.microsoft.com/office/drawing/2015/10/21/chartex","xmlns:cx3":"http://schemas.microsoft.com/office/drawing/2016/5/9/chartex","xmlns:cx4":"http://schemas.microsoft.com/office/drawing/2016/5/10/chartex","xmlns:cx5":"http://schemas.microsoft.com/office/drawing/2016/5/11/chartex","xmlns:cx6":"http://schemas.microsoft.com/office/drawing/2016/5/12/chartex","xmlns:cx7":"http://schemas.microsoft.com/office/drawing/2016/5/13/chartex","xmlns:cx8":"http://schemas.microsoft.com/office/drawing/2016/5/14/chartex","xmlns:mc":"http://schemas.openxmlformats.org/markup-compatibility/2006","xmlns:aink":"http://schemas.microsoft.com/office/drawing/2016/ink","xmlns:am3d":"http://schemas.microsoft.com/office/drawing/2017/model3d","xmlns:o":"urn:schemas-microsoft-com:office:office","xmlns:r":"http://schemas.openxmlformats.org/officeDocument/2006/relationships","xmlns:m":"http://schemas.openxmlformats.org/officeDocument/2006/math","xmlns:v":"urn:schemas-microsoft-com:vml","xmlns:wp14":"http://schemas.microsoft.com/office/word/2010/wordprocessingDrawing","xmlns:wp":"http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing","xmlns:w10":"urn:schemas-microsoft-com:office:word","xmlns:w":"http://schemas.openxmlformats.org/wordprocessingml/2006/main","xmlns:w14":"http://schemas.microsoft.com/office/word/2010/wordml","xmlns:w15":"http://schemas.microsoft.com/office/word/2012/wordml","xmlns:w16cex":"http://schemas.microsoft.com/office/word/2018/wordml/cex","xmlns:w16cid":"http://schemas.microsoft.com/office/word/2016/wordml/cid","xmlns:w16":"http://schemas.microsoft.com/office/word/2018/wordml","xmlns:w16sdtdh":"http://schemas.microsoft.com/office/word/2020/wordml/sdtdatahash","xmlns:w16se":"http://schemas.microsoft.com/office/word/2015/wordml/symex","xmlns:wpg":"http://schemas.microsoft.com/office/word/2010/wordprocessingGroup","xmlns:wpi":"http://schemas.microsoft.com/office/word/2010/wordprocessingInk","xmlns:wne":"http://schemas.microsoft.com/office/word/2006/wordml","xmlns:wps":"http://schemas.microsoft.com/office/word/2010/wordprocessingShape"}));for(const r of e)this.root.push(new Rne(r))}}class Ine extends oe{constructor(){super("w:pageBreakBefore")}}const Jg={AT_LEAST:"atLeast",EXACTLY:"exactly",EXACT:"exact",AUTO:"auto"};class Nne extends be{constructor(){super(...arguments),se(this,"xmlKeys",{after:"w:after",before:"w:before",line:"w:line",lineRule:"w:lineRule"})}}class Dne extends oe{constructor(e){super("w:spacing"),this.root.push(new Nne(e))}}const Io={HEADING_1:"Heading1",HEADING_2:"Heading2",HEADING_3:"Heading3",HEADING_4:"Heading4",HEADING_5:"Heading5",HEADING_6:"Heading6",TITLE:"Title"};let mc=class extends oe{constructor(e){super("w:pStyle"),this.root.push(new st({val:e}))}};class Pne extends oe{constructor(e){super("w:tabs");for(const r of e)this.root.push(new Fne(r))}}const mf={LEFT:"left",RIGHT:"right",CENTER:"center",BAR:"bar",CLEAR:"clear",DECIMAL:"decimal",END:"end",NUM:"num",START:"start"},OE={MAX:9026};class Lne extends be{constructor(){super(...arguments),se(this,"xmlKeys",{val:"w:val",pos:"w:pos",leader:"w:leader"})}}class Fne extends oe{constructor({type:e,position:r,leader:n}){super("w:tab"),this.root.push(new Lne({val:e,pos:r,leader:n}))}}class RE extends oe{constructor(e,r){super("w:numPr"),this.root.push(new Bne(r)),this.root.push(new $ne(e))}}class Bne extends oe{constructor(e){if(super("w:ilvl"),e>9)throw new Error("Level cannot be greater than 9. Read more here: https://answers.microsoft.com/en-us/msoffice/forum/all/does-word-support-more-than-9-list-levels/d130fdcd-1781-446d-8c84-c6c79124e4d7");this.root.push(new st({val:e}))}}class $ne extends oe{constructor(e){super("w:numId"),this.root.push(new st({val:typeof e=="string"?`{${e}}`:e}))}}class SI extends oe{constructor(){super(...arguments),se(this,"fileChild",Symbol())}}class jne extends be{constructor(){super(...arguments),se(this,"xmlKeys",{id:"Id",type:"Type",target:"Target",targetMode:"TargetMode"})}}const Hne={EXTERNAL:"External"};class zne extends oe{constructor(e,r,n,i){super("Relationship"),this.root.push(new jne({id:e,type:r,target:n,targetMode:i}))}}class Une extends be{constructor(){super(...arguments),se(this,"xmlKeys",{id:"r:id",history:"w:history",anchor:"w:anchor"})}}class Sd extends oe{constructor(e,r,n){super("w:hyperlink"),se(this,"linkId"),this.linkId=r;const i={history:1,anchor:n||void 0,id:n?void 0:`rId${this.linkId}`},o=new Une(i);this.root.push(o),e.forEach(s=>{this.root.push(s)})}}class Wne extends Sd{constructor(e){super(e.children,xw(),e.anchor)}}class EI extends oe{constructor(e){super("w:externalHyperlink"),this.options=e}}class Vne extends be{constructor(){super(...arguments),se(this,"xmlKeys",{id:"w:id",name:"w:name"})}}class Gne extends be{constructor(){super(...arguments),se(this,"xmlKeys",{id:"w:id"})}}class TI{constructor(e){se(this,"bookmarkUniqueNumericId",Sre()),se(this,"start"),se(this,"children"),se(this,"end");const r=this.bookmarkUniqueNumericId();this.start=new Kne(e.id,r),this.children=e.children,this.end=new qne(r)}}class Kne extends oe{constructor(e,r){super("w:bookmarkStart");const n=new Vne({name:e,id:r});this.root.push(n)}}class qne extends oe{constructor(e){super("w:bookmarkEnd");const r=new Gne({id:e});this.root.push(r)}}class Xne extends oe{constructor(e){super("w:outlineLvl"),this.level=e,this.root.push(new st({val:e}))}}class Jne extends be{constructor(){super(...arguments),se(this,"xmlKeys",{verticalAlign:"w:val"})}}class AI extends oe{constructor(e){super("w:vAlign"),this.root.push(new Jne({verticalAlign:e}))}}const rs={DEFAULT:"default",FIRST:"first",EVEN:"even"};class Yne extends be{constructor(){super(...arguments),se(this,"xmlKeys",{type:"w:type",id:"r:id"})}}const ME={HEADER:"w:headerReference",FOOTER:"w:footerReference"};class Wp extends oe{constructor(e,r){super(e),this.root.push(new Yne({type:r.type||rs.DEFAULT,id:`rId${r.id}`}))}}class Zne extends oe{constructor({space:e,count:r,separate:n,equalWidth:i,children:o}){super("w:cols"),this.root.push(new Pn({space:{key:"w:space",value:e===void 0?void 0:Ct(e)},count:{key:"w:num",value:r===void 0?void 0:Ft(r)},separate:{key:"w:sep",value:n},equalWidth:{key:"w:equalWidth",value:i}})),!i&&o&&o.forEach(s=>this.addChildElement(s))}}class Qne extends be{constructor(){super(...arguments),se(this,"xmlKeys",{type:"w:type",linePitch:"w:linePitch",charSpace:"w:charSpace"})}}class eie extends oe{constructor(e,r,n){super("w:docGrid"),this.root.push(new Qne({type:n,linePitch:Ft(e),charSpace:r?Ft(r):void 0}))}}const tie=({countBy:t,start:e,restart:r,distance:n})=>new Bt({name:"w:lnNumType",attributes:{countBy:{key:"w:countBy",value:t===void 0?void 0:Ft(t)},start:{key:"w:start",value:e===void 0?void 0:Ft(e)},restart:{key:"w:restart",value:r},distance:{key:"w:distance",value:n===void 0?void 0:Ct(n)}}});class IE extends be{constructor(){super(...arguments),se(this,"xmlKeys",{display:"w:display",offsetFrom:"w:offsetFrom",zOrder:"w:zOrder"})}}class rie extends Dn{constructor(e){if(super("w:pgBorders"),!e)return this;e.pageBorders?this.root.push(new IE({display:e.pageBorders.display,offsetFrom:e.pageBorders.offsetFrom,zOrder:e.pageBorders.zOrder})):this.root.push(new IE({})),e.pageBorderTop&&this.root.push(new Ue("w:top",e.pageBorderTop)),e.pageBorderLeft&&this.root.push(new Ue("w:left",e.pageBorderLeft)),e.pageBorderBottom&&this.root.push(new Ue("w:bottom",e.pageBorderBottom)),e.pageBorderRight&&this.root.push(new Ue("w:right",e.pageBorderRight))}}class nie extends oe{constructor(e,r,n,i,o,s,a){super("w:pgMar"),this.root.push(new Pn({top:{key:"w:top",value:xn(e)},right:{key:"w:right",value:Ct(r)},bottom:{key:"w:bottom",value:xn(n)},left:{key:"w:left",value:Ct(i)},header:{key:"w:header",value:Ct(o)},footer:{key:"w:footer",value:Ct(s)},gutter:{key:"w:gutter",value:Ct(a)}}))}}class iie extends be{constructor(){super(...arguments),se(this,"xmlKeys",{start:"w:start",formatType:"w:fmt",separator:"w:chapSep"})}}class oie extends oe{constructor({start:e,formatType:r,separator:n}){super("w:pgNumType"),this.root.push(new iie({start:e===void 0?void 0:Ft(e),formatType:r,separator:n}))}}const CI={PORTRAIT:"portrait",LANDSCAPE:"landscape"};class sie extends oe{constructor(e,r,n){super("w:pgSz");const i=n===CI.LANDSCAPE,o=Ct(e),s=Ct(r);this.root.push(new Pn({width:{key:"w:w",value:i?s:o},height:{key:"w:h",value:i?o:s},orientation:{key:"w:orient",value:n}}))}}class aie extends be{constructor(){super(...arguments),se(this,"xmlKeys",{val:"w:val"})}}class lie extends oe{constructor(e){super("w:textDirection"),this.root.push(new aie({val:e}))}}const cie={NEXT_PAGE:"nextPage",NEXT_COLUMN:"nextColumn",CONTINUOUS:"continuous",EVEN_PAGE:"evenPage",ODD_PAGE:"oddPage"};class uie extends be{constructor(){super(...arguments),se(this,"xmlKeys",{val:"w:val"})}}class fie extends oe{constructor(e){super("w:type"),this.root.push(new uie({val:e}))}}const Di={TOP:1440,RIGHT:1440,BOTTOM:1440,LEFT:1440,HEADER:708,FOOTER:708,GUTTER:0},Vp={WIDTH:11906,HEIGHT:16838,ORIENTATION:CI.PORTRAIT};class die extends oe{constructor({page:{size:{width:e=Vp.WIDTH,height:r=Vp.HEIGHT,orientation:n=Vp.ORIENTATION}={},margin:{top:i=Di.TOP,right:o=Di.RIGHT,bottom:s=Di.BOTTOM,left:a=Di.LEFT,header:l=Di.HEADER,footer:c=Di.FOOTER,gutter:u=Di.GUTTER}={},pageNumbers:f={},borders:d,textDirection:h}={},grid:{linePitch:p=360,charSpace:m,type:y}={},headerWrapperGroup:g={},footerWrapperGroup:b={},lineNumbers:S,titlePage:x,verticalAlign:O,column:M,type:D}={}){super("w:sectPr"),this.addHeaderFooterGroup(ME.HEADER,g),this.addHeaderFooterGroup(ME.FOOTER,b),D&&this.root.push(new fie(D)),this.root.push(new sie(e,r,n)),this.root.push(new nie(i,o,s,a,l,c,u)),d&&this.root.push(new rie(d)),S&&this.root.push(tie(S)),this.root.push(new oie(f)),M&&this.root.push(new Zne(M)),O&&this.root.push(new AI(O)),x!==void 0&&this.root.push(new ge("w:titlePg",x)),h&&this.root.push(new lie(h)),this.root.push(new eie(p,m,y))}addHeaderFooterGroup(e,r){r.default&&this.root.push(new Wp(e,{type:rs.DEFAULT,id:r.default.View.ReferenceId})),r.first&&this.root.push(new Wp(e,{type:rs.FIRST,id:r.first.View.ReferenceId})),r.even&&this.root.push(new Wp(e,{type:rs.EVEN,id:r.even.View.ReferenceId}))}}class hie extends oe{constructor(){super("w:body"),se(this,"sections",[])}addSection(e){const r=this.sections.pop();this.root.push(this.createSectionParagraph(r)),this.sections.push(new die(e))}prepForXml(e){return this.sections.length===1&&(this.root.splice(0,1),this.root.push(this.sections.pop())),super.prepForXml(e)}push(e){this.root.push(e)}createSectionParagraph(e){const r=new ui({}),n=new _s({});return n.push(e),r.addChildElement(n),r}}class Tl extends be{constructor(){super(...arguments),se(this,"xmlKeys",{wpc:"xmlns:wpc",mc:"xmlns:mc",o:"xmlns:o",r:"xmlns:r",m:"xmlns:m",v:"xmlns:v",wp14:"xmlns:wp14",wp:"xmlns:wp",w10:"xmlns:w10",w:"xmlns:w",w14:"xmlns:w14",w15:"xmlns:w15",wpg:"xmlns:wpg",wpi:"xmlns:wpi",wne:"xmlns:wne",wps:"xmlns:wps",Ignorable:"mc:Ignorable",cp:"xmlns:cp",dc:"xmlns:dc",dcterms:"xmlns:dcterms",dcmitype:"xmlns:dcmitype",xsi:"xmlns:xsi",type:"xsi:type",cx:"xmlns:cx",cx1:"xmlns:cx1",cx2:"xmlns:cx2",cx3:"xmlns:cx3",cx4:"xmlns:cx4",cx5:"xmlns:cx5",cx6:"xmlns:cx6",cx7:"xmlns:cx7",cx8:"xmlns:cx8",aink:"xmlns:aink",am3d:"xmlns:am3d",w16cex:"xmlns:w16cex",w16cid:"xmlns:w16cid",w16:"xmlns:w16",w16sdtdh:"xmlns:w16sdtdh",w16se:"xmlns:w16se"})}}class pie extends be{constructor(){super(...arguments),se(this,"xmlKeys",{color:"w:color",themeColor:"w:themeColor",themeShade:"w:themeShade",themeTint:"w:themeTint"})}}class mie extends oe{constructor(e){super("w:background"),this.root.push(new pie({color:e.color===void 0?void 0:ks(e.color),themeColor:e.themeColor,themeShade:e.themeShade===void 0?void 0:AE(e.themeShade),themeTint:e.themeTint===void 0?void 0:AE(e.themeTint)}))}}class gie extends oe{constructor(e){super("w:document"),se(this,"body"),this.root.push(new Tl({wpc:"http://schemas.microsoft.com/office/word/2010/wordprocessingCanvas",mc:"http://schemas.openxmlformats.org/markup-compatibility/2006",o:"urn:schemas-microsoft-com:office:office",r:"http://schemas.openxmlformats.org/officeDocument/2006/relationships",m:"http://schemas.openxmlformats.org/officeDocument/2006/math",v:"urn:schemas-microsoft-com:vml",wp14:"http://schemas.microsoft.com/office/word/2010/wordprocessingDrawing",wp:"http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing",w10:"urn:schemas-microsoft-com:office:word",w:"http://schemas.openxmlformats.org/wordprocessingml/2006/main",w14:"http://schemas.microsoft.com/office/word/2010/wordml",w15:"http://schemas.microsoft.com/office/word/2012/wordml",wpg:"http://schemas.microsoft.com/office/word/2010/wordprocessingGroup",wpi:"http://schemas.microsoft.com/office/word/2010/wordprocessingInk",wne:"http://schemas.microsoft.com/office/word/2006/wordml",wps:"http://schemas.microsoft.com/office/word/2010/wordprocessingShape",cx:"http://schemas.microsoft.com/office/drawing/2014/chartex",cx1:"http://schemas.microsoft.com/office/drawing/2015/9/8/chartex",cx2:"http://schemas.microsoft.com/office/drawing/2015/10/21/chartex",cx3:"http://schemas.microsoft.com/office/drawing/2016/5/9/chartex",cx4:"http://schemas.microsoft.com/office/drawing/2016/5/10/chartex",cx5:"http://schemas.microsoft.com/office/drawing/2016/5/11/chartex",cx6:"http://schemas.microsoft.com/office/drawing/2016/5/12/chartex",cx7:"http://schemas.microsoft.com/office/drawing/2016/5/13/chartex",cx8:"http://schemas.microsoft.com/office/drawing/2016/5/14/chartex",aink:"http://schemas.microsoft.com/office/drawing/2016/ink",am3d:"http://schemas.microsoft.com/office/drawing/2017/model3d",w16cex:"http://schemas.microsoft.com/office/word/2018/wordml/cex",w16cid:"http://schemas.microsoft.com/office/word/2016/wordml/cid",w16:"http://schemas.microsoft.com/office/word/2018/wordml",w16sdtdh:"http://schemas.microsoft.com/office/word/2020/wordml/sdtdatahash",w16se:"http://schemas.microsoft.com/office/word/2015/wordml/symex",Ignorable:"w14 w15 wp14"})),this.body=new hie,e.background&&this.root.push(new mie(e.background)),this.root.push(this.body)}add(e){return this.body.push(e),this}get Body(){return this.body}}class yie extends be{constructor(){super(...arguments),se(this,"xmlKeys",{xmlns:"xmlns"})}}class Us extends oe{constructor(){super("Relationships"),this.root.push(new yie({xmlns:"http://schemas.openxmlformats.org/package/2006/relationships"}))}createRelationship(e,r,n,i){const o=new zne(`rId${e}`,r,n,i);return this.root.push(o),o}get RelationshipCount(){return this.root.length-1}}class kI{constructor(e){se(this,"document"),se(this,"relationships"),this.document=new gie(e),this.relationships=new Us}get View(){return this.document}get Relationships(){return this.relationships}}class vie extends be{constructor(){super(...arguments),se(this,"xmlKeys",{val:"w:val"})}}class wie extends oe{constructor(){super("w:wordWrap"),this.root.push(new vie({val:0}))}}const bie=t=>{var e,r;return new Bt({name:"w:framePr",attributes:{anchorLock:{key:"w:anchorLock",value:t.anchorLock},dropCap:{key:"w:dropCap",value:t.dropCap},width:{key:"w:w",value:t.width},height:{key:"w:h",value:t.height},x:{key:"w:x",value:t.position?t.position.x:void 0},y:{key:"w:y",value:t.position?t.position.y:void 0},anchorHorizontal:{key:"w:hAnchor",value:t.anchor.horizontal},anchorVertical:{key:"w:vAnchor",value:t.anchor.vertical},spaceHorizontal:{key:"w:hSpace",value:(e=t.space)==null?void 0:e.horizontal},spaceVertical:{key:"w:vSpace",value:(r=t.space)==null?void 0:r.vertical},rule:{key:"w:hRule",value:t.rule},alignmentX:{key:"w:xAlign",value:t.alignment?t.alignment.x:void 0},alignmentY:{key:"w:yAlign",value:t.alignment?t.alignment.y:void 0},lines:{key:"w:lines",value:t.lines},wrap:{key:"w:wrap",value:t.wrap}}})};class _s extends Dn{constructor(e){var r,n;if(super("w:pPr"),se(this,"numberingReferences",[]),!e)return this;e.heading&&this.push(new mc(e.heading)),e.bullet&&this.push(new mc("ListParagraph")),e.numbering&&!e.style&&!e.heading&&(e.numbering.custom||this.push(new mc("ListParagraph"))),e.style&&this.push(new mc(e.style)),e.keepNext!==void 0&&this.push(new ge("w:keepNext",e.keepNext)),e.keepLines!==void 0&&this.push(new ge("w:keepLines",e.keepLines)),e.pageBreakBefore&&this.push(new Ine),e.frame&&this.push(bie(e.frame)),e.widowControl!==void 0&&this.push(new ge("w:widowControl",e.widowControl)),e.bullet&&this.push(new RE(1,e.bullet.level)),e.numbering&&(this.numberingReferences.push({reference:e.numbering.reference,instance:(r=e.numbering.instance)!=null?r:0}),this.push(new RE(`${e.numbering.reference}-${(n=e.numbering.instance)!=null?n:0}`,e.numbering.level))),e.border&&this.push(new Kte(e.border)),e.thematicBreak&&this.push(new qte),e.shading&&this.push(new bd(e.shading)),e.wordWrap&&this.push(new wie),e.overflowPunctuation&&this.push(new ge("w:overflowPunct",e.overflowPunctuation));const i=[...e.rightTabStop!==void 0?[{type:mf.RIGHT,position:e.rightTabStop}]:[],...e.tabStops?e.tabStops:[],...e.leftTabStop!==void 0?[{type:mf.LEFT,position:e.leftTabStop}]:[]];i.length>0&&this.push(new Pne(i)),e.bidirectional!==void 0&&this.push(new ge("w:bidi",e.bidirectional)),e.spacing&&this.push(new Dne(e.spacing)),e.indent&&this.push(new Xte(e.indent)),e.contextualSpacing!==void 0&&this.push(new ge("w:contextualSpacing",e.contextualSpacing)),e.alignment&&this.push(new uI(e.alignment)),e.outlineLevel!==void 0&&this.push(new Xne(e.outlineLevel)),e.suppressLineNumbers!==void 0&&this.push(new ge("w:suppressLineNumbers",e.suppressLineNumbers)),e.autoSpaceEastAsianText!==void 0&&this.push(new ge("w:autoSpaceDN",e.autoSpaceEastAsianText)),e.run&&this.push(new bo(e.run))}push(e){this.root.push(e)}prepForXml(e){if(e.viewWrapper instanceof kI)for(const r of this.numberingReferences)e.file.Numbering.createConcreteNumberingInstance(r.reference,r.instance);return super.prepForXml(e)}}class ui extends SI{constructor(e){if(super("w:p"),se(this,"properties"),typeof e=="string")return this.properties=new _s({}),this.root.push(this.properties),this.root.push(new Sr(e)),this;if(this.properties=new _s(e),this.root.push(this.properties),e.text&&this.root.push(new Sr(e.text)),e.children)for(const r of e.children){if(r instanceof TI){this.root.push(r.start);for(const n of r.children)this.root.push(n);this.root.push(r.end);continue}this.root.push(r)}}prepForXml(e){for(const r of this.root)if(r instanceof EI){const n=this.root.indexOf(r),i=new Sd(r.options.children,xw());e.viewWrapper.Relationships.createRelationship(i.linkId,"http://schemas.openxmlformats.org/officeDocument/2006/relationships/hyperlink",r.options.link,Hne.EXTERNAL),this.root[n]=i}return super.prepForXml(e)}addRunToFront(e){return this.root.splice(1,0,e),this}}let NE=class extends oe{constructor(e){super("m:oMath");for(const r of e.children)this.root.push(r)}};class xie extends oe{constructor(e){super("m:t"),this.root.push(e)}}class DE extends oe{constructor(e){super("m:r"),this.root.push(new xie(e))}}class Sie extends oe{constructor(e){super("w:tblGrid");for(const r of e)this.root.push(new Eie(r))}}class Eie extends oe{constructor(e){super("w:gridCol"),e!==void 0&&this.root.push(new Pn({width:{key:"w:w",value:Ct(e)}}))}}const _I={TABLE:"w:tblCellMar",TABLE_CELL:"w:tcMar"};class OI extends Dn{constructor(e,{marginUnitType:r=Yg.DXA,top:n,left:i,bottom:o,right:s}){super(e),n!==void 0&&this.root.push(new zi("w:top",{type:r,size:n})),i!==void 0&&this.root.push(new zi("w:left",{type:r,size:i})),o!==void 0&&this.root.push(new zi("w:bottom",{type:r,size:o})),s!==void 0&&this.root.push(new zi("w:right",{type:r,size:s}))}}const Yg={AUTO:"auto",DXA:"dxa",NIL:"nil",PERCENTAGE:"pct"};class zi extends oe{constructor(e,{type:r=Yg.AUTO,size:n}){super(e);let i=n;r===Yg.PERCENTAGE&&typeof n=="number"&&(i=`${n}%`),this.root.push(new Pn({type:{key:"w:type",value:r},size:{key:"w:w",value:jte(i)}}))}}class Tie extends Dn{constructor(e){super("w:tcBorders"),e.top&&this.root.push(new Ue("w:top",e.top)),e.start&&this.root.push(new Ue("w:start",e.start)),e.left&&this.root.push(new Ue("w:left",e.left)),e.bottom&&this.root.push(new Ue("w:bottom",e.bottom)),e.end&&this.root.push(new Ue("w:end",e.end)),e.right&&this.root.push(new Ue("w:right",e.right))}}class Aie extends be{constructor(){super(...arguments),se(this,"xmlKeys",{val:"w:val"})}}class Cie extends oe{constructor(e){super("w:gridSpan"),this.root.push(new Aie({val:Ft(e)}))}}const RI={CONTINUE:"continue",RESTART:"restart"};class kie extends be{constructor(){super(...arguments),se(this,"xmlKeys",{val:"w:val"})}}class PE extends oe{constructor(e){super("w:vMerge"),this.root.push(new kie({val:e}))}}class _ie extends be{constructor(){super(...arguments),se(this,"xmlKeys",{val:"w:val"})}}class Oie extends oe{constructor(e){super("w:textDirection"),this.root.push(new _ie({val:e}))}}class Rie extends Dn{constructor(e){super("w:tcPr"),e.width&&this.root.push(new zi("w:tcW",e.width)),e.columnSpan&&this.root.push(new Cie(e.columnSpan)),e.verticalMerge?this.root.push(new PE(e.verticalMerge)):e.rowSpan&&e.rowSpan>1&&this.root.push(new PE(RI.RESTART)),e.borders&&this.root.push(new Tie(e.borders)),e.shading&&this.root.push(new bd(e.shading)),e.margins&&this.root.push(new OI(_I.TABLE_CELL,e.margins)),e.textDirection&&this.root.push(new Oie(e.textDirection)),e.verticalAlign&&this.root.push(new AI(e.verticalAlign))}}class Sw extends oe{constructor(e){super("w:tc"),this.options=e,this.root.push(new Rie(e));for(const r of e.children)this.root.push(r)}prepForXml(e){return this.root[this.root.length-1]instanceof ui||this.root.push(new ui({})),super.prepForXml(e)}}const No={style:vw.NONE,size:0,color:"auto"},Do={style:vw.SINGLE,size:4,color:"auto"};class MI extends oe{constructor(e){super("w:tblBorders"),e.top?this.root.push(new Ue("w:top",e.top)):this.root.push(new Ue("w:top",Do)),e.left?this.root.push(new Ue("w:left",e.left)):this.root.push(new Ue("w:left",Do)),e.bottom?this.root.push(new Ue("w:bottom",e.bottom)):this.root.push(new Ue("w:bottom",Do)),e.right?this.root.push(new Ue("w:right",e.right)):this.root.push(new Ue("w:right",Do)),e.insideHorizontal?this.root.push(new Ue("w:insideH",e.insideHorizontal)):this.root.push(new Ue("w:insideH",Do)),e.insideVertical?this.root.push(new Ue("w:insideV",e.insideVertical)):this.root.push(new Ue("w:insideV",Do))}}se(MI,"NONE",{top:No,bottom:No,left:No,right:No,insideHorizontal:No,insideVertical:No});class Mie extends oe{constructor({horizontalAnchor:e,verticalAnchor:r,absoluteHorizontalPosition:n,relativeHorizontalPosition:i,absoluteVerticalPosition:o,relativeVerticalPosition:s,bottomFromText:a,topFromText:l,leftFromText:c,rightFromText:u,overlap:f}){super("w:tblpPr"),this.root.push(new Pn({leftFromText:{key:"w:leftFromText",value:c===void 0?void 0:Ct(c)},rightFromText:{key:"w:rightFromText",value:u===void 0?void 0:Ct(u)},topFromText:{key:"w:topFromText",value:l===void 0?void 0:Ct(l)},bottomFromText:{key:"w:bottomFromText",value:a===void 0?void 0:Ct(a)},absoluteHorizontalPosition:{key:"w:tblpX",value:n===void 0?void 0:xn(n)},absoluteVerticalPosition:{key:"w:tblpY",value:o===void 0?void 0:xn(o)},horizontalAnchor:{key:"w:horzAnchor",value:e===void 0?void 0:e},relativeHorizontalPosition:{key:"w:tblpXSpec",value:i},relativeVerticalPosition:{key:"w:tblpYSpec",value:s},verticalAnchor:{key:"w:vertAnchor",value:r}})),f&&this.root.push(new Wte("w:tblOverlap",f))}}class Iie extends be{constructor(){super(...arguments),se(this,"xmlKeys",{type:"w:type"})}}class Nie extends oe{constructor(e){super("w:tblLayout"),this.root.push(new Iie({type:e}))}}class Die extends Dn{constructor(e){super("w:tblPr"),e.style&&this.root.push(new Yi("w:tblStyle",e.style)),e.float&&this.root.push(new Mie(e.float)),e.visuallyRightToLeft!==void 0&&this.root.push(new ge("w:bidiVisual",e.visuallyRightToLeft)),e.width&&this.root.push(new zi("w:tblW",e.width)),e.alignment&&this.root.push(new uI(e.alignment)),e.indent&&this.root.push(new zi("w:tblInd",e.indent)),e.borders&&this.root.push(new MI(e.borders)),e.shading&&this.root.push(new bd(e.shading)),e.layout&&this.root.push(new Nie(e.layout)),e.cellMargin&&this.root.push(new OI(_I.TABLE,e.cellMargin))}}class Pie extends SI{constructor({rows:e,width:r,columnWidths:n=Array(Math.max(...e.map(d=>d.CellCount))).fill(100),margins:i,indent:o,float:s,layout:a,style:l,borders:c,alignment:u,visuallyRightToLeft:f}){super("w:tbl"),this.root.push(new Die({borders:c??{},width:r??{size:100},indent:o,float:s,layout:a,style:l,alignment:u,cellMargin:i,visuallyRightToLeft:f})),this.root.push(new Sie(n));for(const d of e)this.root.push(d);e.forEach((d,h)=>{if(h===e.length-1)return;let p=0;d.cells.forEach(m=>{if(m.options.rowSpan&&m.options.rowSpan>1){const y=new Sw({rowSpan:m.options.rowSpan-1,columnSpan:m.options.columnSpan,borders:m.options.borders,children:[],verticalMerge:RI.CONTINUE});e[h+1].addCellToColumnIndex(y,p)}p+=m.options.columnSpan||1})})}}class Lie extends be{constructor(){super(...arguments),se(this,"xmlKeys",{value:"w:val",rule:"w:hRule"})}}class Fie extends oe{constructor(e,r){super("w:trHeight"),this.root.push(new Lie({value:Ct(e),rule:r}))}}class Bie extends Dn{constructor(e){super("w:trPr"),e.cantSplit!==void 0&&this.root.push(new ge("w:cantSplit",e.cantSplit)),e.tableHeader!==void 0&&this.root.push(new ge("w:tblHeader",e.tableHeader)),e.height&&this.root.push(new Fie(e.height.value,e.height.rule))}}class $ie extends oe{constructor(e){super("w:tr"),this.options=e,this.root.push(new Bie(e));for(const r of e.children)this.root.push(r)}get CellCount(){return this.options.children.length}get cells(){return this.root.filter(e=>e instanceof Sw)}addCellToIndex(e,r){this.root.splice(r+1,0,e)}addCellToColumnIndex(e,r){const n=this.columnIndexToRootIndex(r,!0);this.addCellToIndex(e,n-1)}rootIndexToColumnIndex(e){if(e<1||e>=this.root.length)throw new Error(`cell 'rootIndex' should between 1 to ${this.root.length-1}`);let r=0;for(let n=1;n<e;n++){const i=this.root[n];r+=i.options.columnSpan||1}return r}columnIndexToRootIndex(e,r=!1){if(e<0)throw new Error("cell 'columnIndex' should not less than zero");let n=0,i=1;for(;n<=e;){if(i>=this.root.length){if(r)return this.root.length;throw new Error(`cell 'columnIndex' should not great than ${n-1}`)}const o=this.root[i];i+=1,n+=o&&o.options.columnSpan||1}return i-1}}class jie extends be{constructor(){super(...arguments),se(this,"xmlKeys",{xmlns:"xmlns",vt:"xmlns:vt"})}}class Hie extends oe{constructor(){super("Properties"),this.root.push(new jie({xmlns:"http://schemas.openxmlformats.org/officeDocument/2006/extended-properties",vt:"http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes"}))}}class zie extends be{constructor(){super(...arguments),se(this,"xmlKeys",{xmlns:"xmlns"})}}class Uie extends be{constructor(){super(...arguments),se(this,"xmlKeys",{contentType:"ContentType",extension:"Extension"})}}class zn extends oe{constructor(e,r){super("Default"),this.root.push(new Uie({contentType:e,extension:r}))}}class Wie extends be{constructor(){super(...arguments),se(this,"xmlKeys",{contentType:"ContentType",partName:"PartName"})}}class ur extends oe{constructor(e,r){super("Override"),this.root.push(new Wie({contentType:e,partName:r}))}}class Vie extends oe{constructor(){super("Types"),this.root.push(new zie({xmlns:"http://schemas.openxmlformats.org/package/2006/content-types"})),this.root.push(new zn("image/png","png")),this.root.push(new zn("image/jpeg","jpeg")),this.root.push(new zn("image/jpeg","jpg")),this.root.push(new zn("image/bmp","bmp")),this.root.push(new zn("image/gif","gif")),this.root.push(new zn("application/vnd.openxmlformats-package.relationships+xml","rels")),this.root.push(new zn("application/xml","xml")),this.root.push(new zn("application/vnd.openxmlformats-officedocument.obfuscatedFont","odttf")),this.root.push(new ur("application/vnd.openxmlformats-officedocument.wordprocessingml.document.main+xml","/word/document.xml")),this.root.push(new ur("application/vnd.openxmlformats-officedocument.wordprocessingml.styles+xml","/word/styles.xml")),this.root.push(new ur("application/vnd.openxmlformats-package.core-properties+xml","/docProps/core.xml")),this.root.push(new ur("application/vnd.openxmlformats-officedocument.custom-properties+xml","/docProps/custom.xml")),this.root.push(new ur("application/vnd.openxmlformats-officedocument.extended-properties+xml","/docProps/app.xml")),this.root.push(new ur("application/vnd.openxmlformats-officedocument.wordprocessingml.numbering+xml","/word/numbering.xml")),this.root.push(new ur("application/vnd.openxmlformats-officedocument.wordprocessingml.footnotes+xml","/word/footnotes.xml")),this.root.push(new ur("application/vnd.openxmlformats-officedocument.wordprocessingml.settings+xml","/word/settings.xml")),this.root.push(new ur("application/vnd.openxmlformats-officedocument.wordprocessingml.comments+xml","/word/comments.xml")),this.root.push(new ur("application/vnd.openxmlformats-officedocument.wordprocessingml.fontTable+xml","/word/fontTable.xml"))}addFooter(e){this.root.push(new ur("application/vnd.openxmlformats-officedocument.wordprocessingml.footer+xml",`/word/footer${e}.xml`))}addHeader(e){this.root.push(new ur("application/vnd.openxmlformats-officedocument.wordprocessingml.header+xml",`/word/header${e}.xml`))}}class Gie extends oe{constructor(e){super("cp:coreProperties"),this.root.push(new Tl({cp:"http://schemas.openxmlformats.org/package/2006/metadata/core-properties",dc:"http://purl.org/dc/elements/1.1/",dcterms:"http://purl.org/dc/terms/",dcmitype:"http://purl.org/dc/dcmitype/",xsi:"http://www.w3.org/2001/XMLSchema-instance"})),e.title&&this.root.push(new Ni("dc:title",e.title)),e.subject&&this.root.push(new Ni("dc:subject",e.subject)),e.creator&&this.root.push(new Ni("dc:creator",e.creator)),e.keywords&&this.root.push(new Ni("cp:keywords",e.keywords)),e.description&&this.root.push(new Ni("dc:description",e.description)),e.lastModifiedBy&&this.root.push(new Ni("cp:lastModifiedBy",e.lastModifiedBy)),e.revision&&this.root.push(new Ni("cp:revision",String(e.revision))),this.root.push(new LE("dcterms:created")),this.root.push(new LE("dcterms:modified"))}}class LE extends oe{constructor(e){super(e),this.root.push(new Tl({type:"dcterms:W3CDTF"})),this.root.push(Ute(new Date))}}class Kie extends be{constructor(){super(...arguments),se(this,"xmlKeys",{xmlns:"xmlns",vt:"xmlns:vt"})}}class qie extends be{constructor(){super(...arguments),se(this,"xmlKeys",{fmtid:"fmtid",pid:"pid",name:"name"})}}class Xie extends oe{constructor(e,r){super("property"),this.root.push(new qie({fmtid:"{D5CDD505-2E9C-101B-9397-08002B2CF9AE}",pid:e.toString(),name:r.name})),this.root.push(new Jie(r.value))}}class Jie extends oe{constructor(e){super("vt:lpwstr"),this.root.push(e)}}class Yie extends oe{constructor(e){super("Properties"),se(this,"nextId"),se(this,"properties",[]),this.root.push(new Kie({xmlns:"http://schemas.openxmlformats.org/officeDocument/2006/custom-properties",vt:"http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes"})),this.nextId=2;for(const r of e)this.addCustomProperty(r)}prepForXml(e){return this.properties.forEach(r=>this.root.push(r)),super.prepForXml(e)}addCustomProperty(e){this.properties.push(new Xie(this.nextId++,e))}}class Zie extends be{constructor(){super(...arguments),se(this,"xmlKeys",{wpc:"xmlns:wpc",mc:"xmlns:mc",o:"xmlns:o",r:"xmlns:r",m:"xmlns:m",v:"xmlns:v",wp14:"xmlns:wp14",wp:"xmlns:wp",w10:"xmlns:w10",w:"xmlns:w",w14:"xmlns:w14",w15:"xmlns:w15",wpg:"xmlns:wpg",wpi:"xmlns:wpi",wne:"xmlns:wne",wps:"xmlns:wps",cp:"xmlns:cp",dc:"xmlns:dc",dcterms:"xmlns:dcterms",dcmitype:"xmlns:dcmitype",xsi:"xmlns:xsi",type:"xsi:type"})}}let Qie=class extends aI{constructor(e,r){super("w:ftr",r),se(this,"refId"),this.refId=e,r||this.root.push(new Zie({wpc:"http://schemas.microsoft.com/office/word/2010/wordprocessingCanvas",mc:"http://schemas.openxmlformats.org/markup-compatibility/2006",o:"urn:schemas-microsoft-com:office:office",r:"http://schemas.openxmlformats.org/officeDocument/2006/relationships",m:"http://schemas.openxmlformats.org/officeDocument/2006/math",v:"urn:schemas-microsoft-com:vml",wp14:"http://schemas.microsoft.com/office/word/2010/wordprocessingDrawing",wp:"http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing",w10:"urn:schemas-microsoft-com:office:word",w:"http://schemas.openxmlformats.org/wordprocessingml/2006/main",w14:"http://schemas.microsoft.com/office/word/2010/wordml",w15:"http://schemas.microsoft.com/office/word/2012/wordml",wpg:"http://schemas.microsoft.com/office/word/2010/wordprocessingGroup",wpi:"http://schemas.microsoft.com/office/word/2010/wordprocessingInk",wne:"http://schemas.microsoft.com/office/word/2006/wordml",wps:"http://schemas.microsoft.com/office/word/2010/wordprocessingShape"}))}get ReferenceId(){return this.refId}add(e){this.root.push(e)}};class eoe{constructor(e,r,n){se(this,"footer"),se(this,"relationships"),this.media=e,this.footer=new Qie(r,n),this.relationships=new Us}add(e){this.footer.add(e)}addChildElement(e){this.footer.addChildElement(e)}get View(){return this.footer}get Relationships(){return this.relationships}get Media(){return this.media}}class toe extends be{constructor(){super(...arguments),se(this,"xmlKeys",{type:"w:type",id:"w:id"})}}class roe extends oe{constructor(){super("w:footnoteRef")}}class noe extends xo{constructor(){super({style:"FootnoteReference"}),this.root.push(new roe)}}const FE={SEPERATOR:"separator",CONTINUATION_SEPERATOR:"continuationSeparator"};class Gp extends oe{constructor(e){super("w:footnote"),this.root.push(new toe({type:e.type,id:e.id}));for(let r=0;r<e.children.length;r++){const n=e.children[r];r===0&&n.addRunToFront(new noe),this.root.push(n)}}}class ioe extends oe{constructor(){super("w:continuationSeparator")}}class ooe extends xo{constructor(){super({}),this.root.push(new ioe)}}class soe extends oe{constructor(){super("w:separator")}}class aoe extends xo{constructor(){super({}),this.root.push(new soe)}}class loe extends be{constructor(){super(...arguments),se(this,"xmlKeys",{wpc:"xmlns:wpc",mc:"xmlns:mc",o:"xmlns:o",r:"xmlns:r",m:"xmlns:m",v:"xmlns:v",wp14:"xmlns:wp14",wp:"xmlns:wp",w10:"xmlns:w10",w:"xmlns:w",w14:"xmlns:w14",w15:"xmlns:w15",wpg:"xmlns:wpg",wpi:"xmlns:wpi",wne:"xmlns:wne",wps:"xmlns:wps",Ignorable:"mc:Ignorable"})}}class coe extends oe{constructor(){super("w:footnotes"),this.root.push(new loe({wpc:"http://schemas.microsoft.com/office/word/2010/wordprocessingCanvas",mc:"http://schemas.openxmlformats.org/markup-compatibility/2006",o:"urn:schemas-microsoft-com:office:office",r:"http://schemas.openxmlformats.org/officeDocument/2006/relationships",m:"http://schemas.openxmlformats.org/officeDocument/2006/math",v:"urn:schemas-microsoft-com:vml",wp14:"http://schemas.microsoft.com/office/word/2010/wordprocessingDrawing",wp:"http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing",w10:"urn:schemas-microsoft-com:office:word",w:"http://schemas.openxmlformats.org/wordprocessingml/2006/main",w14:"http://schemas.microsoft.com/office/word/2010/wordml",w15:"http://schemas.microsoft.com/office/word/2012/wordml",wpg:"http://schemas.microsoft.com/office/word/2010/wordprocessingGroup",wpi:"http://schemas.microsoft.com/office/word/2010/wordprocessingInk",wne:"http://schemas.microsoft.com/office/word/2006/wordml",wps:"http://schemas.microsoft.com/office/word/2010/wordprocessingShape",Ignorable:"w14 w15 wp14"}));const e=new Gp({id:-1,type:FE.SEPERATOR,children:[new ui({spacing:{after:0,line:240,lineRule:Jg.AUTO},children:[new aoe]})]});this.root.push(e);const r=new Gp({id:0,type:FE.CONTINUATION_SEPERATOR,children:[new ui({spacing:{after:0,line:240,lineRule:Jg.AUTO},children:[new ooe]})]});this.root.push(r)}createFootNote(e,r){const n=new Gp({id:e,children:r});this.root.push(n)}}class uoe{constructor(){se(this,"footnotess"),se(this,"relationships"),this.footnotess=new coe,this.relationships=new Us}get View(){return this.footnotess}get Relationships(){return this.relationships}}class foe extends be{constructor(){super(...arguments),se(this,"xmlKeys",{wpc:"xmlns:wpc",mc:"xmlns:mc",o:"xmlns:o",r:"xmlns:r",m:"xmlns:m",v:"xmlns:v",wp14:"xmlns:wp14",wp:"xmlns:wp",w10:"xmlns:w10",w:"xmlns:w",w14:"xmlns:w14",w15:"xmlns:w15",wpg:"xmlns:wpg",wpi:"xmlns:wpi",wne:"xmlns:wne",wps:"xmlns:wps",cp:"xmlns:cp",dc:"xmlns:dc",dcterms:"xmlns:dcterms",dcmitype:"xmlns:dcmitype",xsi:"xmlns:xsi",type:"xsi:type",cx:"xmlns:cx",cx1:"xmlns:cx1",cx2:"xmlns:cx2",cx3:"xmlns:cx3",cx4:"xmlns:cx4",cx5:"xmlns:cx5",cx6:"xmlns:cx6",cx7:"xmlns:cx7",cx8:"xmlns:cx8",w16cid:"xmlns:w16cid",w16se:"xmlns:w16se"})}}let doe=class extends aI{constructor(e,r){super("w:hdr",r),se(this,"refId"),this.refId=e,r||this.root.push(new foe({wpc:"http://schemas.microsoft.com/office/word/2010/wordprocessingCanvas",mc:"http://schemas.openxmlformats.org/markup-compatibility/2006",o:"urn:schemas-microsoft-com:office:office",r:"http://schemas.openxmlformats.org/officeDocument/2006/relationships",m:"http://schemas.openxmlformats.org/officeDocument/2006/math",v:"urn:schemas-microsoft-com:vml",wp14:"http://schemas.microsoft.com/office/word/2010/wordprocessingDrawing",wp:"http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing",w10:"urn:schemas-microsoft-com:office:word",w:"http://schemas.openxmlformats.org/wordprocessingml/2006/main",w14:"http://schemas.microsoft.com/office/word/2010/wordml",w15:"http://schemas.microsoft.com/office/word/2012/wordml",wpg:"http://schemas.microsoft.com/office/word/2010/wordprocessingGroup",wpi:"http://schemas.microsoft.com/office/word/2010/wordprocessingInk",wne:"http://schemas.microsoft.com/office/word/2006/wordml",wps:"http://schemas.microsoft.com/office/word/2010/wordprocessingShape",cx:"http://schemas.microsoft.com/office/drawing/2014/chartex",cx1:"http://schemas.microsoft.com/office/drawing/2015/9/8/chartex",cx2:"http://schemas.microsoft.com/office/drawing/2015/10/21/chartex",cx3:"http://schemas.microsoft.com/office/drawing/2016/5/9/chartex",cx4:"http://schemas.microsoft.com/office/drawing/2016/5/10/chartex",cx5:"http://schemas.microsoft.com/office/drawing/2016/5/11/chartex",cx6:"http://schemas.microsoft.com/office/drawing/2016/5/12/chartex",cx7:"http://schemas.microsoft.com/office/drawing/2016/5/13/chartex",cx8:"http://schemas.microsoft.com/office/drawing/2016/5/14/chartex",w16cid:"http://schemas.microsoft.com/office/word/2016/wordml/cid",w16se:"http://schemas.microsoft.com/office/word/2015/wordml/symex"}))}get ReferenceId(){return this.refId}add(e){this.root.push(e)}};class hoe{constructor(e,r,n){se(this,"header"),se(this,"relationships"),this.media=e,this.header=new doe(r,n),this.relationships=new Us}add(e){return this.header.add(e),this}addChildElement(e){this.header.addChildElement(e)}get View(){return this.header}get Relationships(){return this.relationships}get Media(){return this.media}}class poe{constructor(){se(this,"map"),this.map=new Map}addImage(e,r){this.map.set(e,r)}get Array(){return Array.from(this.map.values())}}const Qt={DECIMAL:"decimal",UPPER_ROMAN:"upperRoman",LOWER_ROMAN:"lowerRoman",UPPER_LETTER:"upperLetter",LOWER_LETTER:"lowerLetter",ORDINAL:"ordinal",CARDINAL_TEXT:"cardinalText",ORDINAL_TEXT:"ordinalText",HEX:"hex",CHICAGO:"chicago",IDEOGRAPH__DIGITAL:"ideographDigital",JAPANESE_COUNTING:"japaneseCounting",AIUEO:"aiueo",IROHA:"iroha",DECIMAL_FULL_WIDTH:"decimalFullWidth",DECIMAL_HALF_WIDTH:"decimalHalfWidth",JAPANESE_LEGAL:"japaneseLegal",JAPANESE_DIGITAL_TEN_THOUSAND:"japaneseDigitalTenThousand",DECIMAL_ENCLOSED_CIRCLE:"decimalEnclosedCircle",DECIMAL_FULL_WIDTH2:"decimalFullWidth2",AIUEO_FULL_WIDTH:"aiueoFullWidth",IROHA_FULL_WIDTH:"irohaFullWidth",DECIMAL_ZERO:"decimalZero",BULLET:"bullet",GANADA:"ganada",CHOSUNG:"chosung",DECIMAL_ENCLOSED_FULLSTOP:"decimalEnclosedFullstop",DECIMAL_ENCLOSED_PARENTHESES:"decimalEnclosedParen",DECIMAL_ENCLOSED_CIRCLE_CHINESE:"decimalEnclosedCircleChinese",IDEOGRAPH_ENCLOSED_CIRCLE:"ideographEnclosedCircle",IDEOGRAPH_TRADITIONAL:"ideographTraditional",IDEOGRAPH_ZODIAC:"ideographZodiac",IDEOGRAPH_ZODIAC_TRADITIONAL:"ideographZodiacTraditional",TAIWANESE_COUNTING:"taiwaneseCounting",IDEOGRAPH_LEGAL_TRADITIONAL:"ideographLegalTraditional",TAIWANESE_COUNTING_THOUSAND:"taiwaneseCountingThousand",TAIWANESE_DIGITAL:"taiwaneseDigital",CHINESE_COUNTING:"chineseCounting",CHINESE_LEGAL_SIMPLIFIED:"chineseLegalSimplified",CHINESE_COUNTING_THOUSAND:"chineseCountingThousand",KOREAN_DIGITAL:"koreanDigital",KOREAN_COUNTING:"koreanCounting",KOREAN_LEGAL:"koreanLegal",KOREAN_DIGITAL2:"koreanDigital2",VIETNAMESE_COUNTING:"vietnameseCounting",RUSSIAN_LOWER:"russianLower",RUSSIAN_UPPER:"russianUpper",NONE:"none",NUMBER_IN_DASH:"numberInDash",HEBREW1:"hebrew1",HEBREW2:"hebrew2",ARABIC_ALPHA:"arabicAlpha",ARABIC_ABJAD:"arabicAbjad",HINDI_VOWELS:"hindiVowels",HINDI_CONSONANTS:"hindiConsonants",HINDI_NUMBERS:"hindiNumbers",HINDI_COUNTING:"hindiCounting",THAI_LETTERS:"thaiLetters",THAI_NUMBERS:"thaiNumbers",THAI_COUNTING:"thaiCounting",BAHT_TEXT:"bahtText",DOLLAR_TEXT:"dollarText",CUSTOM:"custom"};class moe extends be{constructor(){super(...arguments),se(this,"xmlKeys",{ilvl:"w:ilvl",tentative:"w15:tentative"})}}class goe extends oe{constructor(e){super("w:numFmt"),this.root.push(new st({val:e}))}}class yoe extends oe{constructor(e){super("w:lvlText"),this.root.push(new st({val:e}))}}class voe extends oe{constructor(e){super("w:lvlJc"),this.root.push(new st({val:e}))}}class woe extends oe{constructor(e){super("w:suff"),this.root.push(new st({val:e}))}}class boe extends oe{constructor(){super("w:isLgl")}}class xoe extends oe{constructor({level:e,format:r,text:n,alignment:i=Vt.START,start:o=1,style:s,suffix:a,isLegalNumberingStyle:l}){if(super("w:lvl"),se(this,"paragraphProperties"),se(this,"runProperties"),this.root.push(new yw("w:start",Ft(o))),r&&this.root.push(new goe(r)),a&&this.root.push(new woe(a)),l&&this.root.push(new boe),n&&this.root.push(new yoe(n)),this.root.push(new voe(i)),this.paragraphProperties=new _s(s&&s.paragraph),this.runProperties=new bo(s&&s.run),this.root.push(this.paragraphProperties),this.root.push(this.runProperties),e>9)throw new Error("Level cannot be greater than 9. Read more here: https://answers.microsoft.com/en-us/msoffice/forum/all/does-word-support-more-than-9-list-levels/d130fdcd-1781-446d-8c84-c6c79124e4d7");this.root.push(new moe({ilvl:Ft(e),tentative:1}))}}class Soe extends xoe{}class Eoe extends oe{constructor(e){super("w:multiLevelType"),this.root.push(new st({val:e}))}}class Toe extends be{constructor(){super(...arguments),se(this,"xmlKeys",{abstractNumId:"w:abstractNumId",restartNumberingAfterBreak:"w15:restartNumberingAfterBreak"})}}class BE extends oe{constructor(e,r){super("w:abstractNum"),se(this,"id"),this.root.push(new Toe({abstractNumId:Ft(e),restartNumberingAfterBreak:0})),this.root.push(new Eoe("hybridMultilevel")),this.id=e;for(const n of r)this.root.push(new Soe(n))}}class Aoe extends oe{constructor(e){super("w:abstractNumId"),this.root.push(new st({val:e}))}}class Coe extends be{constructor(){super(...arguments),se(this,"xmlKeys",{numId:"w:numId"})}}class $E extends oe{constructor(e){if(super("w:num"),se(this,"numId"),se(this,"reference"),se(this,"instance"),this.numId=e.numId,this.reference=e.reference,this.instance=e.instance,this.root.push(new Coe({numId:Ft(e.numId)})),this.root.push(new Aoe(Ft(e.abstractNumId))),e.overrideLevels&&e.overrideLevels.length)for(const r of e.overrideLevels)this.root.push(new _oe(r.num,r.start))}}class koe extends be{constructor(){super(...arguments),se(this,"xmlKeys",{ilvl:"w:ilvl"})}}class _oe extends oe{constructor(e,r){super("w:lvlOverride"),this.root.push(new koe({ilvl:e})),r!==void 0&&this.root.push(new Roe(r))}}class Ooe extends be{constructor(){super(...arguments),se(this,"xmlKeys",{val:"w:val"})}}class Roe extends oe{constructor(e){super("w:startOverride"),this.root.push(new Ooe({val:e}))}}class Moe extends oe{constructor(e){super("w:numbering"),se(this,"abstractNumberingMap",new Map),se(this,"concreteNumberingMap",new Map),se(this,"referenceConfigMap",new Map),se(this,"abstractNumUniqueNumericId",wre()),se(this,"concreteNumUniqueNumericId",bre()),this.root.push(new Tl({wpc:"http://schemas.microsoft.com/office/word/2010/wordprocessingCanvas",mc:"http://schemas.openxmlformats.org/markup-compatibility/2006",o:"urn:schemas-microsoft-com:office:office",r:"http://schemas.openxmlformats.org/officeDocument/2006/relationships",m:"http://schemas.openxmlformats.org/officeDocument/2006/math",v:"urn:schemas-microsoft-com:vml",wp14:"http://schemas.microsoft.com/office/word/2010/wordprocessingDrawing",wp:"http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing",w10:"urn:schemas-microsoft-com:office:word",w:"http://schemas.openxmlformats.org/wordprocessingml/2006/main",w14:"http://schemas.microsoft.com/office/word/2010/wordml",w15:"http://schemas.microsoft.com/office/word/2012/wordml",wpg:"http://schemas.microsoft.com/office/word/2010/wordprocessingGroup",wpi:"http://schemas.microsoft.com/office/word/2010/wordprocessingInk",wne:"http://schemas.microsoft.com/office/word/2006/wordml",wps:"http://schemas.microsoft.com/office/word/2010/wordprocessingShape",Ignorable:"w14 w15 wp14"}));const r=new BE(this.abstractNumUniqueNumericId(),[{level:0,format:Qt.BULLET,text:"●",alignment:Vt.LEFT,style:{paragraph:{indent:{left:Yt(.5),hanging:Yt(.25)}}}},{level:1,format:Qt.BULLET,text:"○",alignment:Vt.LEFT,style:{paragraph:{indent:{left:Yt(1),hanging:Yt(.25)}}}},{level:2,format:Qt.BULLET,text:"■",alignment:Vt.LEFT,style:{paragraph:{indent:{left:2160,hanging:Yt(.25)}}}},{level:3,format:Qt.BULLET,text:"●",alignment:Vt.LEFT,style:{paragraph:{indent:{left:2880,hanging:Yt(.25)}}}},{level:4,format:Qt.BULLET,text:"○",alignment:Vt.LEFT,style:{paragraph:{indent:{left:3600,hanging:Yt(.25)}}}},{level:5,format:Qt.BULLET,text:"■",alignment:Vt.LEFT,style:{paragraph:{indent:{left:4320,hanging:Yt(.25)}}}},{level:6,format:Qt.BULLET,text:"●",alignment:Vt.LEFT,style:{paragraph:{indent:{left:5040,hanging:Yt(.25)}}}},{level:7,format:Qt.BULLET,text:"●",alignment:Vt.LEFT,style:{paragraph:{indent:{left:5760,hanging:Yt(.25)}}}},{level:8,format:Qt.BULLET,text:"●",alignment:Vt.LEFT,style:{paragraph:{indent:{left:6480,hanging:Yt(.25)}}}}]);this.concreteNumberingMap.set("default-bullet-numbering",new $E({numId:1,abstractNumId:r.id,reference:"default-bullet-numbering",instance:0,overrideLevels:[{num:0,start:1}]})),this.abstractNumberingMap.set("default-bullet-numbering",r);for(const n of e.config)this.abstractNumberingMap.set(n.reference,new BE(this.abstractNumUniqueNumericId(),n.levels)),this.referenceConfigMap.set(n.reference,n.levels)}prepForXml(e){for(const r of this.abstractNumberingMap.values())this.root.push(r);for(const r of this.concreteNumberingMap.values())this.root.push(r);return super.prepForXml(e)}createConcreteNumberingInstance(e,r){const n=this.abstractNumberingMap.get(e);if(!n)return;const i=`${e}-${r}`;if(this.concreteNumberingMap.has(i))return;const o=this.referenceConfigMap.get(e),s=o&&o[0].start,a={numId:this.concreteNumUniqueNumericId(),abstractNumId:n.id,reference:e,instance:r,overrideLevels:[s&&Number.isInteger(s)?{num:0,start:s}:{num:0,start:1}]};this.concreteNumberingMap.set(i,new $E(a))}get ConcreteNumbering(){return Array.from(this.concreteNumberingMap.values())}get ReferenceConfig(){return Array.from(this.referenceConfigMap.values())}}class Ioe extends be{constructor(){super(...arguments),se(this,"xmlKeys",{version:"w:val",name:"w:name",uri:"w:uri"})}}class Noe extends oe{constructor(e){super("w:compatSetting"),this.root.push(new Ioe({version:e,uri:"http://schemas.microsoft.com/office/word",name:"compatibilityMode"}))}}class Doe extends oe{constructor(e){super("w:compat"),e.version&&this.root.push(new Noe(e.version)),e.useSingleBorderforContiguousCells&&this.root.push(new ge("w:useSingleBorderforContiguousCells",e.useSingleBorderforContiguousCells)),e.wordPerfectJustification&&this.root.push(new ge("w:wpJustification",e.wordPerfectJustification)),e.noTabStopForHangingIndent&&this.root.push(new ge("w:noTabHangInd",e.noTabStopForHangingIndent)),e.noLeading&&this.root.push(new ge("w:noLeading",e.noLeading)),e.spaceForUnderline&&this.root.push(new ge("w:spaceForUL",e.spaceForUnderline)),e.noColumnBalance&&this.root.push(new ge("w:noColumnBalance",e.noColumnBalance)),e.balanceSingleByteDoubleByteWidth&&this.root.push(new ge("w:balanceSingleByteDoubleByteWidth",e.balanceSingleByteDoubleByteWidth)),e.noExtraLineSpacing&&this.root.push(new ge("w:noExtraLineSpacing",e.noExtraLineSpacing)),e.doNotLeaveBackslashAlone&&this.root.push(new ge("w:doNotLeaveBackslashAlone",e.doNotLeaveBackslashAlone)),e.underlineTrailingSpaces&&this.root.push(new ge("w:ulTrailSpace",e.underlineTrailingSpaces)),e.doNotExpandShiftReturn&&this.root.push(new ge("w:doNotExpandShiftReturn",e.doNotExpandShiftReturn)),e.spacingInWholePoints&&this.root.push(new ge("w:spacingInWholePoints",e.spacingInWholePoints)),e.lineWrapLikeWord6&&this.root.push(new ge("w:lineWrapLikeWord6",e.lineWrapLikeWord6)),e.printBodyTextBeforeHeader&&this.root.push(new ge("w:printBodyTextBeforeHeader",e.printBodyTextBeforeHeader)),e.printColorsBlack&&this.root.push(new ge("w:printColBlack",e.printColorsBlack)),e.spaceWidth&&this.root.push(new ge("w:wpSpaceWidth",e.spaceWidth)),e.showBreaksInFrames&&this.root.push(new ge("w:showBreaksInFrames",e.showBreaksInFrames)),e.subFontBySize&&this.root.push(new ge("w:subFontBySize",e.subFontBySize)),e.suppressBottomSpacing&&this.root.push(new ge("w:suppressBottomSpacing",e.suppressBottomSpacing)),e.suppressTopSpacing&&this.root.push(new ge("w:suppressTopSpacing",e.suppressTopSpacing)),e.suppressSpacingAtTopOfPage&&this.root.push(new ge("w:suppressSpacingAtTopOfPage",e.suppressSpacingAtTopOfPage)),e.suppressTopSpacingWP&&this.root.push(new ge("w:suppressTopSpacingWP",e.suppressTopSpacingWP)),e.suppressSpBfAfterPgBrk&&this.root.push(new ge("w:suppressSpBfAfterPgBrk",e.suppressSpBfAfterPgBrk)),e.swapBordersFacingPages&&this.root.push(new ge("w:swapBordersFacingPages",e.swapBordersFacingPages)),e.convertMailMergeEsc&&this.root.push(new ge("w:convMailMergeEsc",e.convertMailMergeEsc)),e.truncateFontHeightsLikeWP6&&this.root.push(new ge("w:truncateFontHeightsLikeWP6",e.truncateFontHeightsLikeWP6)),e.macWordSmallCaps&&this.root.push(new ge("w:mwSmallCaps",e.macWordSmallCaps)),e.usePrinterMetrics&&this.root.push(new ge("w:usePrinterMetrics",e.usePrinterMetrics)),e.doNotSuppressParagraphBorders&&this.root.push(new ge("w:doNotSuppressParagraphBorders",e.doNotSuppressParagraphBorders)),e.wrapTrailSpaces&&this.root.push(new ge("w:wrapTrailSpaces",e.wrapTrailSpaces)),e.footnoteLayoutLikeWW8&&this.root.push(new ge("w:footnoteLayoutLikeWW8",e.footnoteLayoutLikeWW8)),e.shapeLayoutLikeWW8&&this.root.push(new ge("w:shapeLayoutLikeWW8",e.shapeLayoutLikeWW8)),e.alignTablesRowByRow&&this.root.push(new ge("w:alignTablesRowByRow",e.alignTablesRowByRow)),e.forgetLastTabAlignment&&this.root.push(new ge("w:forgetLastTabAlignment",e.forgetLastTabAlignment)),e.adjustLineHeightInTable&&this.root.push(new ge("w:adjustLineHeightInTable",e.adjustLineHeightInTable)),e.autoSpaceLikeWord95&&this.root.push(new ge("w:autoSpaceLikeWord95",e.autoSpaceLikeWord95)),e.noSpaceRaiseLower&&this.root.push(new ge("w:noSpaceRaiseLower",e.noSpaceRaiseLower)),e.doNotUseHTMLParagraphAutoSpacing&&this.root.push(new ge("w:doNotUseHTMLParagraphAutoSpacing",e.doNotUseHTMLParagraphAutoSpacing)),e.layoutRawTableWidth&&this.root.push(new ge("w:layoutRawTableWidth",e.layoutRawTableWidth)),e.layoutTableRowsApart&&this.root.push(new ge("w:layoutTableRowsApart",e.layoutTableRowsApart)),e.useWord97LineBreakRules&&this.root.push(new ge("w:useWord97LineBreakRules",e.useWord97LineBreakRules)),e.doNotBreakWrappedTables&&this.root.push(new ge("w:doNotBreakWrappedTables",e.doNotBreakWrappedTables)),e.doNotSnapToGridInCell&&this.root.push(new ge("w:doNotSnapToGridInCell",e.doNotSnapToGridInCell)),e.selectFieldWithFirstOrLastCharacter&&this.root.push(new ge("w:selectFldWithFirstOrLastChar",e.selectFieldWithFirstOrLastCharacter)),e.applyBreakingRules&&this.root.push(new ge("w:applyBreakingRules",e.applyBreakingRules)),e.doNotWrapTextWithPunctuation&&this.root.push(new ge("w:doNotWrapTextWithPunct",e.doNotWrapTextWithPunctuation)),e.doNotUseEastAsianBreakRules&&this.root.push(new ge("w:doNotUseEastAsianBreakRules",e.doNotUseEastAsianBreakRules)),e.useWord2002TableStyleRules&&this.root.push(new ge("w:useWord2002TableStyleRules",e.useWord2002TableStyleRules)),e.growAutofit&&this.root.push(new ge("w:growAutofit",e.growAutofit)),e.useFELayout&&this.root.push(new ge("w:useFELayout",e.useFELayout)),e.useNormalStyleForList&&this.root.push(new ge("w:useNormalStyleForList",e.useNormalStyleForList)),e.doNotUseIndentAsNumberingTabStop&&this.root.push(new ge("w:doNotUseIndentAsNumberingTabStop",e.doNotUseIndentAsNumberingTabStop)),e.useAlternateEastAsianLineBreakRules&&this.root.push(new ge("w:useAltKinsokuLineBreakRules",e.useAlternateEastAsianLineBreakRules)),e.allowSpaceOfSameStyleInTable&&this.root.push(new ge("w:allowSpaceOfSameStyleInTable",e.allowSpaceOfSameStyleInTable)),e.doNotSuppressIndentation&&this.root.push(new ge("w:doNotSuppressIndentation",e.doNotSuppressIndentation)),e.doNotAutofitConstrainedTables&&this.root.push(new ge("w:doNotAutofitConstrainedTables",e.doNotAutofitConstrainedTables)),e.autofitToFirstFixedWidthCell&&this.root.push(new ge("w:autofitToFirstFixedWidthCell",e.autofitToFirstFixedWidthCell)),e.underlineTabInNumberingList&&this.root.push(new ge("w:underlineTabInNumList",e.underlineTabInNumberingList)),e.displayHangulFixedWidth&&this.root.push(new ge("w:displayHangulFixedWidth",e.displayHangulFixedWidth)),e.splitPgBreakAndParaMark&&this.root.push(new ge("w:splitPgBreakAndParaMark",e.splitPgBreakAndParaMark)),e.doNotVerticallyAlignCellWithSp&&this.root.push(new ge("w:doNotVertAlignCellWithSp",e.doNotVerticallyAlignCellWithSp)),e.doNotBreakConstrainedForcedTable&&this.root.push(new ge("w:doNotBreakConstrainedForcedTable",e.doNotBreakConstrainedForcedTable)),e.ignoreVerticalAlignmentInTextboxes&&this.root.push(new ge("w:doNotVertAlignInTxbx",e.ignoreVerticalAlignmentInTextboxes)),e.useAnsiKerningPairs&&this.root.push(new ge("w:useAnsiKerningPairs",e.useAnsiKerningPairs)),e.cachedColumnBalance&&this.root.push(new ge("w:cachedColBalance",e.cachedColumnBalance))}}class Poe extends be{constructor(){super(...arguments),se(this,"xmlKeys",{wpc:"xmlns:wpc",mc:"xmlns:mc",o:"xmlns:o",r:"xmlns:r",m:"xmlns:m",v:"xmlns:v",wp14:"xmlns:wp14",wp:"xmlns:wp",w10:"xmlns:w10",w:"xmlns:w",w14:"xmlns:w14",w15:"xmlns:w15",wpg:"xmlns:wpg",wpi:"xmlns:wpi",wne:"xmlns:wne",wps:"xmlns:wps",Ignorable:"mc:Ignorable"})}}class Loe extends oe{constructor(e){var r,n,i,o;super("w:settings"),this.root.push(new Poe({wpc:"http://schemas.microsoft.com/office/word/2010/wordprocessingCanvas",mc:"http://schemas.openxmlformats.org/markup-compatibility/2006",o:"urn:schemas-microsoft-com:office:office",r:"http://schemas.openxmlformats.org/officeDocument/2006/relationships",m:"http://schemas.openxmlformats.org/officeDocument/2006/math",v:"urn:schemas-microsoft-com:vml",wp14:"http://schemas.microsoft.com/office/word/2010/wordprocessingDrawing",wp:"http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing",w10:"urn:schemas-microsoft-com:office:word",w:"http://schemas.openxmlformats.org/wordprocessingml/2006/main",w14:"http://schemas.microsoft.com/office/word/2010/wordml",w15:"http://schemas.microsoft.com/office/word/2012/wordml",wpg:"http://schemas.microsoft.com/office/word/2010/wordprocessingGroup",wpi:"http://schemas.microsoft.com/office/word/2010/wordprocessingInk",wne:"http://schemas.microsoft.com/office/word/2006/wordml",wps:"http://schemas.microsoft.com/office/word/2010/wordprocessingShape",Ignorable:"w14 w15 wp14"})),this.root.push(new ge("w:displayBackgroundShape",!0)),e.trackRevisions!==void 0&&this.root.push(new ge("w:trackRevisions",e.trackRevisions)),e.evenAndOddHeaders!==void 0&&this.root.push(new ge("w:evenAndOddHeaders",e.evenAndOddHeaders)),e.updateFields!==void 0&&this.root.push(new ge("w:updateFields",e.updateFields)),e.defaultTabStop!==void 0&&this.root.push(new yw("w:defaultTabStop",e.defaultTabStop)),this.root.push(new Doe(As(je({},(r=e.compatibility)!=null?r:{}),{version:(o=(i=(n=e.compatibility)==null?void 0:n.version)!=null?i:e.compatibilityModeVersion)!=null?o:15})))}}class II extends be{constructor(){super(...arguments),se(this,"xmlKeys",{val:"w:val"})}}class Foe extends oe{constructor(e){super("w:name"),this.root.push(new II({val:e}))}}class Boe extends oe{constructor(e){super("w:uiPriority"),this.root.push(new II({val:Ft(e)}))}}class $oe extends be{constructor(){super(...arguments),se(this,"xmlKeys",{type:"w:type",styleId:"w:styleId",default:"w:default",customStyle:"w:customStyle"})}}class NI extends oe{constructor(e,r){super("w:style"),this.root.push(new $oe(e)),r.name&&this.root.push(new Foe(r.name)),r.basedOn&&this.root.push(new Yi("w:basedOn",r.basedOn)),r.next&&this.root.push(new Yi("w:next",r.next)),r.link&&this.root.push(new Yi("w:link",r.link)),r.uiPriority!==void 0&&this.root.push(new Boe(r.uiPriority)),r.semiHidden!==void 0&&this.root.push(new ge("w:semiHidden",r.semiHidden)),r.unhideWhenUsed!==void 0&&this.root.push(new ge("w:unhideWhenUsed",r.unhideWhenUsed)),r.quickFormat!==void 0&&this.root.push(new ge("w:qFormat",r.quickFormat))}}class Ed extends NI{constructor(e){super({type:"paragraph",styleId:e.id},e),se(this,"paragraphProperties"),se(this,"runProperties"),this.paragraphProperties=new _s(e.paragraph),this.runProperties=new bo(e.run),this.root.push(this.paragraphProperties),this.root.push(this.runProperties)}}class Td extends NI{constructor(e){super({type:"character",styleId:e.id},je({uiPriority:99,unhideWhenUsed:!0},e)),se(this,"runProperties"),this.runProperties=new bo(e.run),this.root.push(this.runProperties)}}class Mi extends Ed{constructor(e){super(je({basedOn:"Normal",next:"Normal",quickFormat:!0},e))}}class joe extends Mi{constructor(e){super(je({id:"Title",name:"Title"},e))}}class Hoe extends Mi{constructor(e){super(je({id:"Heading1",name:"Heading 1"},e))}}class zoe extends Mi{constructor(e){super(je({id:"Heading2",name:"Heading 2"},e))}}class Uoe extends Mi{constructor(e){super(je({id:"Heading3",name:"Heading 3"},e))}}class Woe extends Mi{constructor(e){super(je({id:"Heading4",name:"Heading 4"},e))}}class Voe extends Mi{constructor(e){super(je({id:"Heading5",name:"Heading 5"},e))}}class Goe extends Mi{constructor(e){super(je({id:"Heading6",name:"Heading 6"},e))}}class Koe extends Mi{constructor(e){super(je({id:"Strong",name:"Strong"},e))}}class qoe extends Ed{constructor(e){super(je({id:"ListParagraph",name:"List Paragraph",basedOn:"Normal",quickFormat:!0},e))}}class Xoe extends Ed{constructor(e){super(je({id:"FootnoteText",name:"footnote text",link:"FootnoteTextChar",basedOn:"Normal",uiPriority:99,semiHidden:!0,unhideWhenUsed:!0,paragraph:{spacing:{after:0,line:240,lineRule:Jg.AUTO}},run:{size:20}},e))}}class Joe extends Td{constructor(e){super(je({id:"FootnoteReference",name:"footnote reference",basedOn:"DefaultParagraphFont",semiHidden:!0,run:{superScript:!0}},e))}}class Yoe extends Td{constructor(e){super(je({id:"FootnoteTextChar",name:"Footnote Text Char",basedOn:"DefaultParagraphFont",link:"FootnoteText",semiHidden:!0,run:{size:20}},e))}}class Zoe extends Td{constructor(e){super(je({id:"Hyperlink",name:"Hyperlink",basedOn:"DefaultParagraphFont",run:{color:"0563C1",underline:{type:dI.SINGLE}}},e))}}class Zg extends oe{constructor(e){if(super("w:styles"),e.initialStyles&&this.root.push(e.initialStyles),e.importedStyles)for(const r of e.importedStyles)this.root.push(r);if(e.paragraphStyles)for(const r of e.paragraphStyles)this.root.push(new Ed(r));if(e.characterStyles)for(const r of e.characterStyles)this.root.push(new Td(r))}}class Qoe extends oe{constructor(e){super("w:pPrDefault"),this.root.push(new _s(e))}}class ese extends oe{constructor(e){super("w:rPrDefault"),this.root.push(new bo(e))}}class tse extends oe{constructor(e){super("w:docDefaults"),se(this,"runPropertiesDefaults"),se(this,"paragraphPropertiesDefaults"),this.runPropertiesDefaults=new ese(e.run),this.paragraphPropertiesDefaults=new Qoe(e.paragraph),this.root.push(this.runPropertiesDefaults),this.root.push(this.paragraphPropertiesDefaults)}}class rse{newInstance(e){const r=sI.xml2js(e,{compact:!1});let n;for(const s of r.elements||[])s.name==="w:styles"&&(n=s);if(n===void 0)throw new Error("can not find styles element");const i=n.elements||[];return new Zg({initialStyles:new Fte(n.attributes),importedStyles:i.map(s=>mw(s))})}}class jE{newInstance(e={}){var r;return{initialStyles:new Tl({mc:"http://schemas.openxmlformats.org/markup-compatibility/2006",r:"http://schemas.openxmlformats.org/officeDocument/2006/relationships",w:"http://schemas.openxmlformats.org/wordprocessingml/2006/main",w14:"http://schemas.microsoft.com/office/word/2010/wordml",w15:"http://schemas.microsoft.com/office/word/2012/wordml",Ignorable:"w14 w15"}),importedStyles:[new tse((r=e.document)!=null?r:{}),new joe(je({run:{size:56}},e.title)),new Hoe(je({run:{color:"2E74B5",size:32}},e.heading1)),new zoe(je({run:{color:"2E74B5",size:26}},e.heading2)),new Uoe(je({run:{color:"1F4D78",size:24}},e.heading3)),new Woe(je({run:{color:"2E74B5",italics:!0}},e.heading4)),new Voe(je({run:{color:"2E74B5"}},e.heading5)),new Goe(je({run:{color:"1F4D78"}},e.heading6)),new Koe(je({run:{bold:!0}},e.strong)),new qoe(e.listParagraph||{}),new Zoe(e.hyperlink||{}),new Joe(e.footnoteReference||{}),new Xoe(e.footnoteText||{}),new Yoe(e.footnoteTextChar||{})]}}}const gc=({id:t,fontKey:e,subsetted:r},n)=>new Bt({name:n,attributes:je({id:{key:"r:id",value:t}},e?{fontKey:{key:"w:fontKey",value:`{${e}}`}}:{}),children:[...r?[new ge("w:subsetted",r)]:[]]}),nse=({name:t,altName:e,panose1:r,charset:n,family:i,notTrueType:o,pitch:s,sig:a,embedRegular:l,embedBold:c,embedItalic:u,embedBoldItalic:f})=>new Bt({name:"w:font",attributes:{name:{key:"w:name",value:t}},children:[...e?[ea("w:altName",e)]:[],...r?[ea("w:panose1",r)]:[],...n?[ea("w:charset",n)]:[],...i?[ea("w:family",i)]:[],...o?[new ge("w:notTrueType",o)]:[],...s?[ea("w:pitch",s)]:[],...a?[new Bt({name:"w:sig",attributes:{usb0:{key:"w:usb0",value:a.usb0},usb1:{key:"w:usb1",value:a.usb1},usb2:{key:"w:usb2",value:a.usb2},usb3:{key:"w:usb3",value:a.usb3},csb0:{key:"w:csb0",value:a.csb0},csb1:{key:"w:csb1",value:a.csb1}}})]:[],...l?[gc(l,"w:embedRegular")]:[],...c?[gc(c,"w:embedBold")]:[],...u?[gc(u,"w:embedItalic")]:[],...f?[gc(f,"w:embedBoldItalic")]:[]]}),ise=({name:t,index:e,fontKey:r,characterSet:n})=>nse({name:t,sig:{usb0:"E0002AFF",usb1:"C000247B",usb2:"00000009",usb3:"00000000",csb0:"000001FF",csb1:"00000000"},charset:n,family:"auto",pitch:"variable",embedRegular:{fontKey:r,id:`rId${e}`}}),ose=t=>new Bt({name:"w:fonts",attributes:{mc:{key:"xmlns:mc",value:"http://schemas.openxmlformats.org/markup-compatibility/2006"},r:{key:"xmlns:r",value:"http://schemas.openxmlformats.org/officeDocument/2006/relationships"},w:{key:"xmlns:w",value:"http://schemas.openxmlformats.org/wordprocessingml/2006/main"},w14:{key:"xmlns:w14",value:"http://schemas.microsoft.com/office/word/2010/wordml"},w15:{key:"xmlns:w15",value:"http://schemas.microsoft.com/office/word/2012/wordml"},w16cex:{key:"xmlns:w16cex",value:"http://schemas.microsoft.com/office/word/2018/wordml/cex"},w16cid:{key:"xmlns:w16cid",value:"http://schemas.microsoft.com/office/word/2016/wordml/cid"},w16:{key:"xmlns:w16",value:"http://schemas.microsoft.com/office/word/2018/wordml"},w16sdtdh:{key:"xmlns:w16sdtdh",value:"http://schemas.microsoft.com/office/word/2020/wordml/sdtdatahash"},w16se:{key:"xmlns:w16se",value:"http://schemas.microsoft.com/office/word/2015/wordml/symex"},Ignorable:{key:"mc:Ignorable",value:"w14 w15 w16se w16cid w16 w16cex w16sdtdh"}},children:t.map((e,r)=>ise({name:e.name,index:r+1,fontKey:e.fontKey}))});class sse{constructor(e){se(this,"fontTable"),se(this,"relationships"),se(this,"fontOptionsWithKey",[]),this.options=e,this.fontOptionsWithKey=e.map(r=>As(je({},r),{fontKey:Ere()})),this.fontTable=ose(this.fontOptionsWithKey),this.relationships=new Us;for(let r=0;r<e.length;r++)this.relationships.createRelationship(r+1,"http://schemas.openxmlformats.org/officeDocument/2006/relationships/font",`fonts/${e[r].name}.odttf`)}get View(){return this.fontTable}get Relationships(){return this.relationships}}class ase{constructor(e){se(this,"currentRelationshipId",1),se(this,"documentWrapper"),se(this,"headers",[]),se(this,"footers",[]),se(this,"coreProperties"),se(this,"numbering"),se(this,"media"),se(this,"fileRelationships"),se(this,"footnotesWrapper"),se(this,"settings"),se(this,"contentTypes"),se(this,"customProperties"),se(this,"appProperties"),se(this,"styles"),se(this,"comments"),se(this,"fontWrapper");var r,n,i,o,s,a,l,c;if(this.coreProperties=new Gie(As(je({},e),{creator:(r=e.creator)!=null?r:"Un-named",revision:(n=e.revision)!=null?n:1,lastModifiedBy:(i=e.lastModifiedBy)!=null?i:"Un-named"})),this.numbering=new Moe(e.numbering?e.numbering:{config:[]}),this.comments=new Mne((o=e.comments)!=null?o:{children:[]}),this.fileRelationships=new Us,this.customProperties=new Yie((s=e.customProperties)!=null?s:[]),this.appProperties=new Hie,this.footnotesWrapper=new uoe,this.contentTypes=new Vie,this.documentWrapper=new kI({background:e.background}),this.settings=new Loe({compatibilityModeVersion:e.compatabilityModeVersion,compatibility:e.compatibility,evenAndOddHeaders:!!e.evenAndOddHeaderAndFooters,trackRevisions:(a=e.features)==null?void 0:a.trackRevisions,updateFields:(l=e.features)==null?void 0:l.updateFields,defaultTabStop:e.defaultTabStop}),this.media=new poe,e.externalStyles){const u=new rse;this.styles=u.newInstance(e.externalStyles)}else if(e.styles){const f=new jE().newInstance(e.styles.default);this.styles=new Zg(je(je({},f),e.styles))}else{const u=new jE;this.styles=new Zg(u.newInstance())}this.addDefaultRelationships();for(const u of e.sections)this.addSection(u);if(e.footnotes)for(const u in e.footnotes)this.footnotesWrapper.View.createFootNote(parseFloat(u),e.footnotes[u].children);this.fontWrapper=new sse((c=e.fonts)!=null?c:[])}addSection({headers:e={},footers:r={},children:n,properties:i}){this.documentWrapper.View.Body.addSection(As(je({},i),{headerWrapperGroup:{default:e.default?this.createHeader(e.default):void 0,first:e.first?this.createHeader(e.first):void 0,even:e.even?this.createHeader(e.even):void 0},footerWrapperGroup:{default:r.default?this.createFooter(r.default):void 0,first:r.first?this.createFooter(r.first):void 0,even:r.even?this.createFooter(r.even):void 0}}));for(const o of n)this.documentWrapper.View.add(o)}createHeader(e){const r=new hoe(this.media,this.currentRelationshipId++);for(const n of e.options.children)r.add(n);return this.addHeaderToDocument(r),r}createFooter(e){const r=new eoe(this.media,this.currentRelationshipId++);for(const n of e.options.children)r.add(n);return this.addFooterToDocument(r),r}addHeaderToDocument(e,r=rs.DEFAULT){this.headers.push({header:e,type:r}),this.documentWrapper.Relationships.createRelationship(e.View.ReferenceId,"http://schemas.openxmlformats.org/officeDocument/2006/relationships/header",`header${this.headers.length}.xml`),this.contentTypes.addHeader(this.headers.length)}addFooterToDocument(e,r=rs.DEFAULT){this.footers.push({footer:e,type:r}),this.documentWrapper.Relationships.createRelationship(e.View.ReferenceId,"http://schemas.openxmlformats.org/officeDocument/2006/relationships/footer",`footer${this.footers.length}.xml`),this.contentTypes.addFooter(this.footers.length)}addDefaultRelationships(){this.fileRelationships.createRelationship(1,"http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument","word/document.xml"),this.fileRelationships.createRelationship(2,"http://schemas.openxmlformats.org/package/2006/relationships/metadata/core-properties","docProps/core.xml"),this.fileRelationships.createRelationship(3,"http://schemas.openxmlformats.org/officeDocument/2006/relationships/extended-properties","docProps/app.xml"),this.fileRelationships.createRelationship(4,"http://schemas.openxmlformats.org/officeDocument/2006/relationships/custom-properties","docProps/custom.xml"),this.documentWrapper.Relationships.createRelationship(this.currentRelationshipId++,"http://schemas.openxmlformats.org/officeDocument/2006/relationships/styles","styles.xml"),this.documentWrapper.Relationships.createRelationship(this.currentRelationshipId++,"http://schemas.openxmlformats.org/officeDocument/2006/relationships/numbering","numbering.xml"),this.documentWrapper.Relationships.createRelationship(this.currentRelationshipId++,"http://schemas.openxmlformats.org/officeDocument/2006/relationships/footnotes","footnotes.xml"),this.documentWrapper.Relationships.createRelationship(this.currentRelationshipId++,"http://schemas.openxmlformats.org/officeDocument/2006/relationships/settings","settings.xml"),this.documentWrapper.Relationships.createRelationship(this.currentRelationshipId++,"http://schemas.openxmlformats.org/officeDocument/2006/relationships/comments","comments.xml")}get Document(){return this.documentWrapper}get Styles(){return this.styles}get CoreProperties(){return this.coreProperties}get Numbering(){return this.numbering}get Media(){return this.media}get FileRelationships(){return this.fileRelationships}get Headers(){return this.headers.map(e=>e.header)}get Footers(){return this.footers.map(e=>e.footer)}get ContentTypes(){return this.contentTypes}get CustomProperties(){return this.customProperties}get AppProperties(){return this.appProperties}get FootNotes(){return this.footnotesWrapper}get Settings(){return this.settings}get Comments(){return this.comments}get FontTable(){return this.fontWrapper}}class lse extends be{constructor(){super(...arguments),se(this,"xmlKeys",{id:"w:id"})}}class cse extends oe{constructor(e){super("w:footnoteReference"),this.root.push(new lse({id:e}))}}class use extends xo{constructor(e){super({style:"FootnoteReference"}),this.root.push(new cse(e))}}function yc(t){throw new Error('Could not dynamically require "'+t+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var DI={exports:{}};(function(t,e){(function(r){t.exports=r()})(function(){return function r(n,i,o){function s(c,u){if(!i[c]){if(!n[c]){var f=typeof yc=="function"&&yc;if(!u&&f)return f(c,!0);if(a)return a(c,!0);var d=new Error("Cannot find module '"+c+"'");throw d.code="MODULE_NOT_FOUND",d}var h=i[c]={exports:{}};n[c][0].call(h.exports,function(p){var m=n[c][1][p];return s(m||p)},h,h.exports,r,n,i,o)}return i[c].exports}for(var a=typeof yc=="function"&&yc,l=0;l<o.length;l++)s(o[l]);return s}({1:[function(r,n,i){var o=r("./utils"),s=r("./support"),a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";i.encode=function(l){for(var c,u,f,d,h,p,m,y=[],g=0,b=l.length,S=b,x=o.getTypeOf(l)!=="string";g<l.length;)S=b-g,f=x?(c=l[g++],u=g<b?l[g++]:0,g<b?l[g++]:0):(c=l.charCodeAt(g++),u=g<b?l.charCodeAt(g++):0,g<b?l.charCodeAt(g++):0),d=c>>2,h=(3&c)<<4|u>>4,p=1<S?(15&u)<<2|f>>6:64,m=2<S?63&f:64,y.push(a.charAt(d)+a.charAt(h)+a.charAt(p)+a.charAt(m));return y.join("")},i.decode=function(l){var c,u,f,d,h,p,m=0,y=0,g="data:";if(l.substr(0,g.length)===g)throw new Error("Invalid base64 input, it looks like a data url.");var b,S=3*(l=l.replace(/[^A-Za-z0-9+/=]/g,"")).length/4;if(l.charAt(l.length-1)===a.charAt(64)&&S--,l.charAt(l.length-2)===a.charAt(64)&&S--,S%1!=0)throw new Error("Invalid base64 input, bad content length.");for(b=s.uint8array?new Uint8Array(0|S):new Array(0|S);m<l.length;)c=a.indexOf(l.charAt(m++))<<2|(d=a.indexOf(l.charAt(m++)))>>4,u=(15&d)<<4|(h=a.indexOf(l.charAt(m++)))>>2,f=(3&h)<<6|(p=a.indexOf(l.charAt(m++))),b[y++]=c,h!==64&&(b[y++]=u),p!==64&&(b[y++]=f);return b}},{"./support":30,"./utils":32}],2:[function(r,n,i){var o=r("./external"),s=r("./stream/DataWorker"),a=r("./stream/Crc32Probe"),l=r("./stream/DataLengthProbe");function c(u,f,d,h,p){this.compressedSize=u,this.uncompressedSize=f,this.crc32=d,this.compression=h,this.compressedContent=p}c.prototype={getContentWorker:function(){var u=new s(o.Promise.resolve(this.compressedContent)).pipe(this.compression.uncompressWorker()).pipe(new l("data_length")),f=this;return u.on("end",function(){if(this.streamInfo.data_length!==f.uncompressedSize)throw new Error("Bug : uncompressed data size mismatch")}),u},getCompressedWorker:function(){return new s(o.Promise.resolve(this.compressedContent)).withStreamInfo("compressedSize",this.compressedSize).withStreamInfo("uncompressedSize",this.uncompressedSize).withStreamInfo("crc32",this.crc32).withStreamInfo("compression",this.compression)}},c.createWorkerFrom=function(u,f,d){return u.pipe(new a).pipe(new l("uncompressedSize")).pipe(f.compressWorker(d)).pipe(new l("compressedSize")).withStreamInfo("compression",f)},n.exports=c},{"./external":6,"./stream/Crc32Probe":25,"./stream/DataLengthProbe":26,"./stream/DataWorker":27}],3:[function(r,n,i){var o=r("./stream/GenericWorker");i.STORE={magic:"\0\0",compressWorker:function(){return new o("STORE compression")},uncompressWorker:function(){return new o("STORE decompression")}},i.DEFLATE=r("./flate")},{"./flate":7,"./stream/GenericWorker":28}],4:[function(r,n,i){var o=r("./utils"),s=function(){for(var a,l=[],c=0;c<256;c++){a=c;for(var u=0;u<8;u++)a=1&a?3988292384^a>>>1:a>>>1;l[c]=a}return l}();n.exports=function(a,l){return a!==void 0&&a.length?o.getTypeOf(a)!=="string"?function(c,u,f,d){var h=s,p=d+f;c^=-1;for(var m=d;m<p;m++)c=c>>>8^h[255&(c^u[m])];return-1^c}(0|l,a,a.length,0):function(c,u,f,d){var h=s,p=d+f;c^=-1;for(var m=d;m<p;m++)c=c>>>8^h[255&(c^u.charCodeAt(m))];return-1^c}(0|l,a,a.length,0):0}},{"./utils":32}],5:[function(r,n,i){i.base64=!1,i.binary=!1,i.dir=!1,i.createFolders=!0,i.date=null,i.compression=null,i.compressionOptions=null,i.comment=null,i.unixPermissions=null,i.dosPermissions=null},{}],6:[function(r,n,i){var o=null;o=typeof Promise<"u"?Promise:r("lie"),n.exports={Promise:o}},{lie:37}],7:[function(r,n,i){var o=typeof Uint8Array<"u"&&typeof Uint16Array<"u"&&typeof Uint32Array<"u",s=r("pako"),a=r("./utils"),l=r("./stream/GenericWorker"),c=o?"uint8array":"array";function u(f,d){l.call(this,"FlateWorker/"+f),this._pako=null,this._pakoAction=f,this._pakoOptions=d,this.meta={}}i.magic="\b\0",a.inherits(u,l),u.prototype.processChunk=function(f){this.meta=f.meta,this._pako===null&&this._createPako(),this._pako.push(a.transformTo(c,f.data),!1)},u.prototype.flush=function(){l.prototype.flush.call(this),this._pako===null&&this._createPako(),this._pako.push([],!0)},u.prototype.cleanUp=function(){l.prototype.cleanUp.call(this),this._pako=null},u.prototype._createPako=function(){this._pako=new s[this._pakoAction]({raw:!0,level:this._pakoOptions.level||-1});var f=this;this._pako.onData=function(d){f.push({data:d,meta:f.meta})}},i.compressWorker=function(f){return new u("Deflate",f)},i.uncompressWorker=function(){return new u("Inflate",{})}},{"./stream/GenericWorker":28,"./utils":32,pako:38}],8:[function(r,n,i){function o(h,p){var m,y="";for(m=0;m<p;m++)y+=String.fromCharCode(255&h),h>>>=8;return y}function s(h,p,m,y,g,b){var S,x,O=h.file,M=h.compression,D=b!==c.utf8encode,$=a.transformTo("string",b(O.name)),A=a.transformTo("string",c.utf8encode(O.name)),V=O.comment,Q=a.transformTo("string",b(V)),I=a.transformTo("string",c.utf8encode(V)),U=A.length!==O.name.length,k=I.length!==V.length,G="",te="",W="",ae=O.dir,X=O.date,de={crc32:0,compressedSize:0,uncompressedSize:0};p&&!m||(de.crc32=h.crc32,de.compressedSize=h.compressedSize,de.uncompressedSize=h.uncompressedSize);var q=0;p&&(q|=8),D||!U&&!k||(q|=2048);var N=0,Y=0;ae&&(N|=16),g==="UNIX"?(Y=798,N|=function(ie,K){var _=ie;return ie||(_=K?16893:33204),(65535&_)<<16}(O.unixPermissions,ae)):(Y=20,N|=function(ie){return 63&(ie||0)}(O.dosPermissions)),S=X.getUTCHours(),S<<=6,S|=X.getUTCMinutes(),S<<=5,S|=X.getUTCSeconds()/2,x=X.getUTCFullYear()-1980,x<<=4,x|=X.getUTCMonth()+1,x<<=5,x|=X.getUTCDate(),U&&(te=o(1,1)+o(u($),4)+A,G+="up"+o(te.length,2)+te),k&&(W=o(1,1)+o(u(Q),4)+I,G+="uc"+o(W.length,2)+W);var Z="";return Z+=`
590
- \0`,Z+=o(q,2),Z+=M.magic,Z+=o(S,2),Z+=o(x,2),Z+=o(de.crc32,4),Z+=o(de.compressedSize,4),Z+=o(de.uncompressedSize,4),Z+=o($.length,2),Z+=o(G.length,2),{fileRecord:f.LOCAL_FILE_HEADER+Z+$+G,dirRecord:f.CENTRAL_FILE_HEADER+o(Y,2)+Z+o(Q.length,2)+"\0\0\0\0"+o(N,4)+o(y,4)+$+G+Q}}var a=r("../utils"),l=r("../stream/GenericWorker"),c=r("../utf8"),u=r("../crc32"),f=r("../signature");function d(h,p,m,y){l.call(this,"ZipFileWorker"),this.bytesWritten=0,this.zipComment=p,this.zipPlatform=m,this.encodeFileName=y,this.streamFiles=h,this.accumulate=!1,this.contentBuffer=[],this.dirRecords=[],this.currentSourceOffset=0,this.entriesCount=0,this.currentFile=null,this._sources=[]}a.inherits(d,l),d.prototype.push=function(h){var p=h.meta.percent||0,m=this.entriesCount,y=this._sources.length;this.accumulate?this.contentBuffer.push(h):(this.bytesWritten+=h.data.length,l.prototype.push.call(this,{data:h.data,meta:{currentFile:this.currentFile,percent:m?(p+100*(m-y-1))/m:100}}))},d.prototype.openedSource=function(h){this.currentSourceOffset=this.bytesWritten,this.currentFile=h.file.name;var p=this.streamFiles&&!h.file.dir;if(p){var m=s(h,p,!1,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);this.push({data:m.fileRecord,meta:{percent:0}})}else this.accumulate=!0},d.prototype.closedSource=function(h){this.accumulate=!1;var p=this.streamFiles&&!h.file.dir,m=s(h,p,!0,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);if(this.dirRecords.push(m.dirRecord),p)this.push({data:function(y){return f.DATA_DESCRIPTOR+o(y.crc32,4)+o(y.compressedSize,4)+o(y.uncompressedSize,4)}(h),meta:{percent:100}});else for(this.push({data:m.fileRecord,meta:{percent:0}});this.contentBuffer.length;)this.push(this.contentBuffer.shift());this.currentFile=null},d.prototype.flush=function(){for(var h=this.bytesWritten,p=0;p<this.dirRecords.length;p++)this.push({data:this.dirRecords[p],meta:{percent:100}});var m=this.bytesWritten-h,y=function(g,b,S,x,O){var M=a.transformTo("string",O(x));return f.CENTRAL_DIRECTORY_END+"\0\0\0\0"+o(g,2)+o(g,2)+o(b,4)+o(S,4)+o(M.length,2)+M}(this.dirRecords.length,m,h,this.zipComment,this.encodeFileName);this.push({data:y,meta:{percent:100}})},d.prototype.prepareNextSource=function(){this.previous=this._sources.shift(),this.openedSource(this.previous.streamInfo),this.isPaused?this.previous.pause():this.previous.resume()},d.prototype.registerPrevious=function(h){this._sources.push(h);var p=this;return h.on("data",function(m){p.processChunk(m)}),h.on("end",function(){p.closedSource(p.previous.streamInfo),p._sources.length?p.prepareNextSource():p.end()}),h.on("error",function(m){p.error(m)}),this},d.prototype.resume=function(){return!!l.prototype.resume.call(this)&&(!this.previous&&this._sources.length?(this.prepareNextSource(),!0):this.previous||this._sources.length||this.generatedError?void 0:(this.end(),!0))},d.prototype.error=function(h){var p=this._sources;if(!l.prototype.error.call(this,h))return!1;for(var m=0;m<p.length;m++)try{p[m].error(h)}catch{}return!0},d.prototype.lock=function(){l.prototype.lock.call(this);for(var h=this._sources,p=0;p<h.length;p++)h[p].lock()},n.exports=d},{"../crc32":4,"../signature":23,"../stream/GenericWorker":28,"../utf8":31,"../utils":32}],9:[function(r,n,i){var o=r("../compressions"),s=r("./ZipFileWorker");i.generateWorker=function(a,l,c){var u=new s(l.streamFiles,c,l.platform,l.encodeFileName),f=0;try{a.forEach(function(d,h){f++;var p=function(b,S){var x=b||S,O=o[x];if(!O)throw new Error(x+" is not a valid compression method !");return O}(h.options.compression,l.compression),m=h.options.compressionOptions||l.compressionOptions||{},y=h.dir,g=h.date;h._compressWorker(p,m).withStreamInfo("file",{name:d,dir:y,date:g,comment:h.comment||"",unixPermissions:h.unixPermissions,dosPermissions:h.dosPermissions}).pipe(u)}),u.entriesCount=f}catch(d){u.error(d)}return u}},{"../compressions":3,"./ZipFileWorker":8}],10:[function(r,n,i){function o(){if(!(this instanceof o))return new o;if(arguments.length)throw new Error("The constructor with parameters has been removed in JSZip 3.0, please check the upgrade guide.");this.files=Object.create(null),this.comment=null,this.root="",this.clone=function(){var s=new o;for(var a in this)typeof this[a]!="function"&&(s[a]=this[a]);return s}}(o.prototype=r("./object")).loadAsync=r("./load"),o.support=r("./support"),o.defaults=r("./defaults"),o.version="3.10.1",o.loadAsync=function(s,a){return new o().loadAsync(s,a)},o.external=r("./external"),n.exports=o},{"./defaults":5,"./external":6,"./load":11,"./object":15,"./support":30}],11:[function(r,n,i){var o=r("./utils"),s=r("./external"),a=r("./utf8"),l=r("./zipEntries"),c=r("./stream/Crc32Probe"),u=r("./nodejsUtils");function f(d){return new s.Promise(function(h,p){var m=d.decompressed.getContentWorker().pipe(new c);m.on("error",function(y){p(y)}).on("end",function(){m.streamInfo.crc32!==d.decompressed.crc32?p(new Error("Corrupted zip : CRC32 mismatch")):h()}).resume()})}n.exports=function(d,h){var p=this;return h=o.extend(h||{},{base64:!1,checkCRC32:!1,optimizedBinaryString:!1,createFolders:!1,decodeFileName:a.utf8decode}),u.isNode&&u.isStream(d)?s.Promise.reject(new Error("JSZip can't accept a stream when loading a zip file.")):o.prepareContent("the loaded zip file",d,!0,h.optimizedBinaryString,h.base64).then(function(m){var y=new l(h);return y.load(m),y}).then(function(m){var y=[s.Promise.resolve(m)],g=m.files;if(h.checkCRC32)for(var b=0;b<g.length;b++)y.push(f(g[b]));return s.Promise.all(y)}).then(function(m){for(var y=m.shift(),g=y.files,b=0;b<g.length;b++){var S=g[b],x=S.fileNameStr,O=o.resolve(S.fileNameStr);p.file(O,S.decompressed,{binary:!0,optimizedBinaryString:!0,date:S.date,dir:S.dir,comment:S.fileCommentStr.length?S.fileCommentStr:null,unixPermissions:S.unixPermissions,dosPermissions:S.dosPermissions,createFolders:h.createFolders}),S.dir||(p.file(O).unsafeOriginalName=x)}return y.zipComment.length&&(p.comment=y.zipComment),p})}},{"./external":6,"./nodejsUtils":14,"./stream/Crc32Probe":25,"./utf8":31,"./utils":32,"./zipEntries":33}],12:[function(r,n,i){var o=r("../utils"),s=r("../stream/GenericWorker");function a(l,c){s.call(this,"Nodejs stream input adapter for "+l),this._upstreamEnded=!1,this._bindStream(c)}o.inherits(a,s),a.prototype._bindStream=function(l){var c=this;(this._stream=l).pause(),l.on("data",function(u){c.push({data:u,meta:{percent:0}})}).on("error",function(u){c.isPaused?this.generatedError=u:c.error(u)}).on("end",function(){c.isPaused?c._upstreamEnded=!0:c.end()})},a.prototype.pause=function(){return!!s.prototype.pause.call(this)&&(this._stream.pause(),!0)},a.prototype.resume=function(){return!!s.prototype.resume.call(this)&&(this._upstreamEnded?this.end():this._stream.resume(),!0)},n.exports=a},{"../stream/GenericWorker":28,"../utils":32}],13:[function(r,n,i){var o=r("readable-stream").Readable;function s(a,l,c){o.call(this,l),this._helper=a;var u=this;a.on("data",function(f,d){u.push(f)||u._helper.pause(),c&&c(d)}).on("error",function(f){u.emit("error",f)}).on("end",function(){u.push(null)})}r("../utils").inherits(s,o),s.prototype._read=function(){this._helper.resume()},n.exports=s},{"../utils":32,"readable-stream":16}],14:[function(r,n,i){n.exports={isNode:typeof Buffer<"u",newBufferFrom:function(o,s){if(Buffer.from&&Buffer.from!==Uint8Array.from)return Buffer.from(o,s);if(typeof o=="number")throw new Error('The "data" argument must not be a number');return new Buffer(o,s)},allocBuffer:function(o){if(Buffer.alloc)return Buffer.alloc(o);var s=new Buffer(o);return s.fill(0),s},isBuffer:function(o){return Buffer.isBuffer(o)},isStream:function(o){return o&&typeof o.on=="function"&&typeof o.pause=="function"&&typeof o.resume=="function"}}},{}],15:[function(r,n,i){function o(O,M,D){var $,A=a.getTypeOf(M),V=a.extend(D||{},u);V.date=V.date||new Date,V.compression!==null&&(V.compression=V.compression.toUpperCase()),typeof V.unixPermissions=="string"&&(V.unixPermissions=parseInt(V.unixPermissions,8)),V.unixPermissions&&16384&V.unixPermissions&&(V.dir=!0),V.dosPermissions&&16&V.dosPermissions&&(V.dir=!0),V.dir&&(O=g(O)),V.createFolders&&($=y(O))&&b.call(this,$,!0);var Q=A==="string"&&V.binary===!1&&V.base64===!1;D&&D.binary!==void 0||(V.binary=!Q),(M instanceof f&&M.uncompressedSize===0||V.dir||!M||M.length===0)&&(V.base64=!1,V.binary=!0,M="",V.compression="STORE",A="string");var I=null;I=M instanceof f||M instanceof l?M:p.isNode&&p.isStream(M)?new m(O,M):a.prepareContent(O,M,V.binary,V.optimizedBinaryString,V.base64);var U=new d(O,I,V);this.files[O]=U}var s=r("./utf8"),a=r("./utils"),l=r("./stream/GenericWorker"),c=r("./stream/StreamHelper"),u=r("./defaults"),f=r("./compressedObject"),d=r("./zipObject"),h=r("./generate"),p=r("./nodejsUtils"),m=r("./nodejs/NodejsStreamInputAdapter"),y=function(O){O.slice(-1)==="/"&&(O=O.substring(0,O.length-1));var M=O.lastIndexOf("/");return 0<M?O.substring(0,M):""},g=function(O){return O.slice(-1)!=="/"&&(O+="/"),O},b=function(O,M){return M=M!==void 0?M:u.createFolders,O=g(O),this.files[O]||o.call(this,O,null,{dir:!0,createFolders:M}),this.files[O]};function S(O){return Object.prototype.toString.call(O)==="[object RegExp]"}var x={load:function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},forEach:function(O){var M,D,$;for(M in this.files)$=this.files[M],(D=M.slice(this.root.length,M.length))&&M.slice(0,this.root.length)===this.root&&O(D,$)},filter:function(O){var M=[];return this.forEach(function(D,$){O(D,$)&&M.push($)}),M},file:function(O,M,D){if(arguments.length!==1)return O=this.root+O,o.call(this,O,M,D),this;if(S(O)){var $=O;return this.filter(function(V,Q){return!Q.dir&&$.test(V)})}var A=this.files[this.root+O];return A&&!A.dir?A:null},folder:function(O){if(!O)return this;if(S(O))return this.filter(function(A,V){return V.dir&&O.test(A)});var M=this.root+O,D=b.call(this,M),$=this.clone();return $.root=D.name,$},remove:function(O){O=this.root+O;var M=this.files[O];if(M||(O.slice(-1)!=="/"&&(O+="/"),M=this.files[O]),M&&!M.dir)delete this.files[O];else for(var D=this.filter(function(A,V){return V.name.slice(0,O.length)===O}),$=0;$<D.length;$++)delete this.files[D[$].name];return this},generate:function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},generateInternalStream:function(O){var M,D={};try{if((D=a.extend(O||{},{streamFiles:!1,compression:"STORE",compressionOptions:null,type:"",platform:"DOS",comment:null,mimeType:"application/zip",encodeFileName:s.utf8encode})).type=D.type.toLowerCase(),D.compression=D.compression.toUpperCase(),D.type==="binarystring"&&(D.type="string"),!D.type)throw new Error("No output type specified.");a.checkSupport(D.type),D.platform!=="darwin"&&D.platform!=="freebsd"&&D.platform!=="linux"&&D.platform!=="sunos"||(D.platform="UNIX"),D.platform==="win32"&&(D.platform="DOS");var $=D.comment||this.comment||"";M=h.generateWorker(this,D,$)}catch(A){(M=new l("error")).error(A)}return new c(M,D.type||"string",D.mimeType)},generateAsync:function(O,M){return this.generateInternalStream(O).accumulate(M)},generateNodeStream:function(O,M){return(O=O||{}).type||(O.type="nodebuffer"),this.generateInternalStream(O).toNodejsStream(M)}};n.exports=x},{"./compressedObject":2,"./defaults":5,"./generate":9,"./nodejs/NodejsStreamInputAdapter":12,"./nodejsUtils":14,"./stream/GenericWorker":28,"./stream/StreamHelper":29,"./utf8":31,"./utils":32,"./zipObject":35}],16:[function(r,n,i){n.exports=r("stream")},{stream:void 0}],17:[function(r,n,i){var o=r("./DataReader");function s(a){o.call(this,a);for(var l=0;l<this.data.length;l++)a[l]=255&a[l]}r("../utils").inherits(s,o),s.prototype.byteAt=function(a){return this.data[this.zero+a]},s.prototype.lastIndexOfSignature=function(a){for(var l=a.charCodeAt(0),c=a.charCodeAt(1),u=a.charCodeAt(2),f=a.charCodeAt(3),d=this.length-4;0<=d;--d)if(this.data[d]===l&&this.data[d+1]===c&&this.data[d+2]===u&&this.data[d+3]===f)return d-this.zero;return-1},s.prototype.readAndCheckSignature=function(a){var l=a.charCodeAt(0),c=a.charCodeAt(1),u=a.charCodeAt(2),f=a.charCodeAt(3),d=this.readData(4);return l===d[0]&&c===d[1]&&u===d[2]&&f===d[3]},s.prototype.readData=function(a){if(this.checkOffset(a),a===0)return[];var l=this.data.slice(this.zero+this.index,this.zero+this.index+a);return this.index+=a,l},n.exports=s},{"../utils":32,"./DataReader":18}],18:[function(r,n,i){var o=r("../utils");function s(a){this.data=a,this.length=a.length,this.index=0,this.zero=0}s.prototype={checkOffset:function(a){this.checkIndex(this.index+a)},checkIndex:function(a){if(this.length<this.zero+a||a<0)throw new Error("End of data reached (data length = "+this.length+", asked index = "+a+"). Corrupted zip ?")},setIndex:function(a){this.checkIndex(a),this.index=a},skip:function(a){this.setIndex(this.index+a)},byteAt:function(){},readInt:function(a){var l,c=0;for(this.checkOffset(a),l=this.index+a-1;l>=this.index;l--)c=(c<<8)+this.byteAt(l);return this.index+=a,c},readString:function(a){return o.transformTo("string",this.readData(a))},readData:function(){},lastIndexOfSignature:function(){},readAndCheckSignature:function(){},readDate:function(){var a=this.readInt(4);return new Date(Date.UTC(1980+(a>>25&127),(a>>21&15)-1,a>>16&31,a>>11&31,a>>5&63,(31&a)<<1))}},n.exports=s},{"../utils":32}],19:[function(r,n,i){var o=r("./Uint8ArrayReader");function s(a){o.call(this,a)}r("../utils").inherits(s,o),s.prototype.readData=function(a){this.checkOffset(a);var l=this.data.slice(this.zero+this.index,this.zero+this.index+a);return this.index+=a,l},n.exports=s},{"../utils":32,"./Uint8ArrayReader":21}],20:[function(r,n,i){var o=r("./DataReader");function s(a){o.call(this,a)}r("../utils").inherits(s,o),s.prototype.byteAt=function(a){return this.data.charCodeAt(this.zero+a)},s.prototype.lastIndexOfSignature=function(a){return this.data.lastIndexOf(a)-this.zero},s.prototype.readAndCheckSignature=function(a){return a===this.readData(4)},s.prototype.readData=function(a){this.checkOffset(a);var l=this.data.slice(this.zero+this.index,this.zero+this.index+a);return this.index+=a,l},n.exports=s},{"../utils":32,"./DataReader":18}],21:[function(r,n,i){var o=r("./ArrayReader");function s(a){o.call(this,a)}r("../utils").inherits(s,o),s.prototype.readData=function(a){if(this.checkOffset(a),a===0)return new Uint8Array(0);var l=this.data.subarray(this.zero+this.index,this.zero+this.index+a);return this.index+=a,l},n.exports=s},{"../utils":32,"./ArrayReader":17}],22:[function(r,n,i){var o=r("../utils"),s=r("../support"),a=r("./ArrayReader"),l=r("./StringReader"),c=r("./NodeBufferReader"),u=r("./Uint8ArrayReader");n.exports=function(f){var d=o.getTypeOf(f);return o.checkSupport(d),d!=="string"||s.uint8array?d==="nodebuffer"?new c(f):s.uint8array?new u(o.transformTo("uint8array",f)):new a(o.transformTo("array",f)):new l(f)}},{"../support":30,"../utils":32,"./ArrayReader":17,"./NodeBufferReader":19,"./StringReader":20,"./Uint8ArrayReader":21}],23:[function(r,n,i){i.LOCAL_FILE_HEADER="PK",i.CENTRAL_FILE_HEADER="PK",i.CENTRAL_DIRECTORY_END="PK",i.ZIP64_CENTRAL_DIRECTORY_LOCATOR="PK\x07",i.ZIP64_CENTRAL_DIRECTORY_END="PK",i.DATA_DESCRIPTOR="PK\x07\b"},{}],24:[function(r,n,i){var o=r("./GenericWorker"),s=r("../utils");function a(l){o.call(this,"ConvertWorker to "+l),this.destType=l}s.inherits(a,o),a.prototype.processChunk=function(l){this.push({data:s.transformTo(this.destType,l.data),meta:l.meta})},n.exports=a},{"../utils":32,"./GenericWorker":28}],25:[function(r,n,i){var o=r("./GenericWorker"),s=r("../crc32");function a(){o.call(this,"Crc32Probe"),this.withStreamInfo("crc32",0)}r("../utils").inherits(a,o),a.prototype.processChunk=function(l){this.streamInfo.crc32=s(l.data,this.streamInfo.crc32||0),this.push(l)},n.exports=a},{"../crc32":4,"../utils":32,"./GenericWorker":28}],26:[function(r,n,i){var o=r("../utils"),s=r("./GenericWorker");function a(l){s.call(this,"DataLengthProbe for "+l),this.propName=l,this.withStreamInfo(l,0)}o.inherits(a,s),a.prototype.processChunk=function(l){if(l){var c=this.streamInfo[this.propName]||0;this.streamInfo[this.propName]=c+l.data.length}s.prototype.processChunk.call(this,l)},n.exports=a},{"../utils":32,"./GenericWorker":28}],27:[function(r,n,i){var o=r("../utils"),s=r("./GenericWorker");function a(l){s.call(this,"DataWorker");var c=this;this.dataIsReady=!1,this.index=0,this.max=0,this.data=null,this.type="",this._tickScheduled=!1,l.then(function(u){c.dataIsReady=!0,c.data=u,c.max=u&&u.length||0,c.type=o.getTypeOf(u),c.isPaused||c._tickAndRepeat()},function(u){c.error(u)})}o.inherits(a,s),a.prototype.cleanUp=function(){s.prototype.cleanUp.call(this),this.data=null},a.prototype.resume=function(){return!!s.prototype.resume.call(this)&&(!this._tickScheduled&&this.dataIsReady&&(this._tickScheduled=!0,o.delay(this._tickAndRepeat,[],this)),!0)},a.prototype._tickAndRepeat=function(){this._tickScheduled=!1,this.isPaused||this.isFinished||(this._tick(),this.isFinished||(o.delay(this._tickAndRepeat,[],this),this._tickScheduled=!0))},a.prototype._tick=function(){if(this.isPaused||this.isFinished)return!1;var l=null,c=Math.min(this.max,this.index+16384);if(this.index>=this.max)return this.end();switch(this.type){case"string":l=this.data.substring(this.index,c);break;case"uint8array":l=this.data.subarray(this.index,c);break;case"array":case"nodebuffer":l=this.data.slice(this.index,c)}return this.index=c,this.push({data:l,meta:{percent:this.max?this.index/this.max*100:0}})},n.exports=a},{"../utils":32,"./GenericWorker":28}],28:[function(r,n,i){function o(s){this.name=s||"default",this.streamInfo={},this.generatedError=null,this.extraStreamInfo={},this.isPaused=!0,this.isFinished=!1,this.isLocked=!1,this._listeners={data:[],end:[],error:[]},this.previous=null}o.prototype={push:function(s){this.emit("data",s)},end:function(){if(this.isFinished)return!1;this.flush();try{this.emit("end"),this.cleanUp(),this.isFinished=!0}catch(s){this.emit("error",s)}return!0},error:function(s){return!this.isFinished&&(this.isPaused?this.generatedError=s:(this.isFinished=!0,this.emit("error",s),this.previous&&this.previous.error(s),this.cleanUp()),!0)},on:function(s,a){return this._listeners[s].push(a),this},cleanUp:function(){this.streamInfo=this.generatedError=this.extraStreamInfo=null,this._listeners=[]},emit:function(s,a){if(this._listeners[s])for(var l=0;l<this._listeners[s].length;l++)this._listeners[s][l].call(this,a)},pipe:function(s){return s.registerPrevious(this)},registerPrevious:function(s){if(this.isLocked)throw new Error("The stream '"+this+"' has already been used.");this.streamInfo=s.streamInfo,this.mergeStreamInfo(),this.previous=s;var a=this;return s.on("data",function(l){a.processChunk(l)}),s.on("end",function(){a.end()}),s.on("error",function(l){a.error(l)}),this},pause:function(){return!this.isPaused&&!this.isFinished&&(this.isPaused=!0,this.previous&&this.previous.pause(),!0)},resume:function(){if(!this.isPaused||this.isFinished)return!1;var s=this.isPaused=!1;return this.generatedError&&(this.error(this.generatedError),s=!0),this.previous&&this.previous.resume(),!s},flush:function(){},processChunk:function(s){this.push(s)},withStreamInfo:function(s,a){return this.extraStreamInfo[s]=a,this.mergeStreamInfo(),this},mergeStreamInfo:function(){for(var s in this.extraStreamInfo)Object.prototype.hasOwnProperty.call(this.extraStreamInfo,s)&&(this.streamInfo[s]=this.extraStreamInfo[s])},lock:function(){if(this.isLocked)throw new Error("The stream '"+this+"' has already been used.");this.isLocked=!0,this.previous&&this.previous.lock()},toString:function(){var s="Worker "+this.name;return this.previous?this.previous+" -> "+s:s}},n.exports=o},{}],29:[function(r,n,i){var o=r("../utils"),s=r("./ConvertWorker"),a=r("./GenericWorker"),l=r("../base64"),c=r("../support"),u=r("../external"),f=null;if(c.nodestream)try{f=r("../nodejs/NodejsStreamOutputAdapter")}catch{}function d(p,m){return new u.Promise(function(y,g){var b=[],S=p._internalType,x=p._outputType,O=p._mimeType;p.on("data",function(M,D){b.push(M),m&&m(D)}).on("error",function(M){b=[],g(M)}).on("end",function(){try{var M=function(D,$,A){switch(D){case"blob":return o.newBlob(o.transformTo("arraybuffer",$),A);case"base64":return l.encode($);default:return o.transformTo(D,$)}}(x,function(D,$){var A,V=0,Q=null,I=0;for(A=0;A<$.length;A++)I+=$[A].length;switch(D){case"string":return $.join("");case"array":return Array.prototype.concat.apply([],$);case"uint8array":for(Q=new Uint8Array(I),A=0;A<$.length;A++)Q.set($[A],V),V+=$[A].length;return Q;case"nodebuffer":return Buffer.concat($);default:throw new Error("concat : unsupported type '"+D+"'")}}(S,b),O);y(M)}catch(D){g(D)}b=[]}).resume()})}function h(p,m,y){var g=m;switch(m){case"blob":case"arraybuffer":g="uint8array";break;case"base64":g="string"}try{this._internalType=g,this._outputType=m,this._mimeType=y,o.checkSupport(g),this._worker=p.pipe(new s(g)),p.lock()}catch(b){this._worker=new a("error"),this._worker.error(b)}}h.prototype={accumulate:function(p){return d(this,p)},on:function(p,m){var y=this;return p==="data"?this._worker.on(p,function(g){m.call(y,g.data,g.meta)}):this._worker.on(p,function(){o.delay(m,arguments,y)}),this},resume:function(){return o.delay(this._worker.resume,[],this._worker),this},pause:function(){return this._worker.pause(),this},toNodejsStream:function(p){if(o.checkSupport("nodestream"),this._outputType!=="nodebuffer")throw new Error(this._outputType+" is not supported by this method");return new f(this,{objectMode:this._outputType!=="nodebuffer"},p)}},n.exports=h},{"../base64":1,"../external":6,"../nodejs/NodejsStreamOutputAdapter":13,"../support":30,"../utils":32,"./ConvertWorker":24,"./GenericWorker":28}],30:[function(r,n,i){if(i.base64=!0,i.array=!0,i.string=!0,i.arraybuffer=typeof ArrayBuffer<"u"&&typeof Uint8Array<"u",i.nodebuffer=typeof Buffer<"u",i.uint8array=typeof Uint8Array<"u",typeof ArrayBuffer>"u")i.blob=!1;else{var o=new ArrayBuffer(0);try{i.blob=new Blob([o],{type:"application/zip"}).size===0}catch{try{var s=new(self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder);s.append(o),i.blob=s.getBlob("application/zip").size===0}catch{i.blob=!1}}}try{i.nodestream=!!r("readable-stream").Readable}catch{i.nodestream=!1}},{"readable-stream":16}],31:[function(r,n,i){for(var o=r("./utils"),s=r("./support"),a=r("./nodejsUtils"),l=r("./stream/GenericWorker"),c=new Array(256),u=0;u<256;u++)c[u]=252<=u?6:248<=u?5:240<=u?4:224<=u?3:192<=u?2:1;c[254]=c[254]=1;function f(){l.call(this,"utf-8 decode"),this.leftOver=null}function d(){l.call(this,"utf-8 encode")}i.utf8encode=function(h){return s.nodebuffer?a.newBufferFrom(h,"utf-8"):function(p){var m,y,g,b,S,x=p.length,O=0;for(b=0;b<x;b++)(64512&(y=p.charCodeAt(b)))==55296&&b+1<x&&(64512&(g=p.charCodeAt(b+1)))==56320&&(y=65536+(y-55296<<10)+(g-56320),b++),O+=y<128?1:y<2048?2:y<65536?3:4;for(m=s.uint8array?new Uint8Array(O):new Array(O),b=S=0;S<O;b++)(64512&(y=p.charCodeAt(b)))==55296&&b+1<x&&(64512&(g=p.charCodeAt(b+1)))==56320&&(y=65536+(y-55296<<10)+(g-56320),b++),y<128?m[S++]=y:(y<2048?m[S++]=192|y>>>6:(y<65536?m[S++]=224|y>>>12:(m[S++]=240|y>>>18,m[S++]=128|y>>>12&63),m[S++]=128|y>>>6&63),m[S++]=128|63&y);return m}(h)},i.utf8decode=function(h){return s.nodebuffer?o.transformTo("nodebuffer",h).toString("utf-8"):function(p){var m,y,g,b,S=p.length,x=new Array(2*S);for(m=y=0;m<S;)if((g=p[m++])<128)x[y++]=g;else if(4<(b=c[g]))x[y++]=65533,m+=b-1;else{for(g&=b===2?31:b===3?15:7;1<b&&m<S;)g=g<<6|63&p[m++],b--;1<b?x[y++]=65533:g<65536?x[y++]=g:(g-=65536,x[y++]=55296|g>>10&1023,x[y++]=56320|1023&g)}return x.length!==y&&(x.subarray?x=x.subarray(0,y):x.length=y),o.applyFromCharCode(x)}(h=o.transformTo(s.uint8array?"uint8array":"array",h))},o.inherits(f,l),f.prototype.processChunk=function(h){var p=o.transformTo(s.uint8array?"uint8array":"array",h.data);if(this.leftOver&&this.leftOver.length){if(s.uint8array){var m=p;(p=new Uint8Array(m.length+this.leftOver.length)).set(this.leftOver,0),p.set(m,this.leftOver.length)}else p=this.leftOver.concat(p);this.leftOver=null}var y=function(b,S){var x;for((S=S||b.length)>b.length&&(S=b.length),x=S-1;0<=x&&(192&b[x])==128;)x--;return x<0||x===0?S:x+c[b[x]]>S?x:S}(p),g=p;y!==p.length&&(s.uint8array?(g=p.subarray(0,y),this.leftOver=p.subarray(y,p.length)):(g=p.slice(0,y),this.leftOver=p.slice(y,p.length))),this.push({data:i.utf8decode(g),meta:h.meta})},f.prototype.flush=function(){this.leftOver&&this.leftOver.length&&(this.push({data:i.utf8decode(this.leftOver),meta:{}}),this.leftOver=null)},i.Utf8DecodeWorker=f,o.inherits(d,l),d.prototype.processChunk=function(h){this.push({data:i.utf8encode(h.data),meta:h.meta})},i.Utf8EncodeWorker=d},{"./nodejsUtils":14,"./stream/GenericWorker":28,"./support":30,"./utils":32}],32:[function(r,n,i){var o=r("./support"),s=r("./base64"),a=r("./nodejsUtils"),l=r("./external");function c(m){return m}function u(m,y){for(var g=0;g<m.length;++g)y[g]=255&m.charCodeAt(g);return y}r("setimmediate"),i.newBlob=function(m,y){i.checkSupport("blob");try{return new Blob([m],{type:y})}catch{try{var g=new(self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder);return g.append(m),g.getBlob(y)}catch{throw new Error("Bug : can't construct the Blob.")}}};var f={stringifyByChunk:function(m,y,g){var b=[],S=0,x=m.length;if(x<=g)return String.fromCharCode.apply(null,m);for(;S<x;)y==="array"||y==="nodebuffer"?b.push(String.fromCharCode.apply(null,m.slice(S,Math.min(S+g,x)))):b.push(String.fromCharCode.apply(null,m.subarray(S,Math.min(S+g,x)))),S+=g;return b.join("")},stringifyByChar:function(m){for(var y="",g=0;g<m.length;g++)y+=String.fromCharCode(m[g]);return y},applyCanBeUsed:{uint8array:function(){try{return o.uint8array&&String.fromCharCode.apply(null,new Uint8Array(1)).length===1}catch{return!1}}(),nodebuffer:function(){try{return o.nodebuffer&&String.fromCharCode.apply(null,a.allocBuffer(1)).length===1}catch{return!1}}()}};function d(m){var y=65536,g=i.getTypeOf(m),b=!0;if(g==="uint8array"?b=f.applyCanBeUsed.uint8array:g==="nodebuffer"&&(b=f.applyCanBeUsed.nodebuffer),b)for(;1<y;)try{return f.stringifyByChunk(m,g,y)}catch{y=Math.floor(y/2)}return f.stringifyByChar(m)}function h(m,y){for(var g=0;g<m.length;g++)y[g]=m[g];return y}i.applyFromCharCode=d;var p={};p.string={string:c,array:function(m){return u(m,new Array(m.length))},arraybuffer:function(m){return p.string.uint8array(m).buffer},uint8array:function(m){return u(m,new Uint8Array(m.length))},nodebuffer:function(m){return u(m,a.allocBuffer(m.length))}},p.array={string:d,array:c,arraybuffer:function(m){return new Uint8Array(m).buffer},uint8array:function(m){return new Uint8Array(m)},nodebuffer:function(m){return a.newBufferFrom(m)}},p.arraybuffer={string:function(m){return d(new Uint8Array(m))},array:function(m){return h(new Uint8Array(m),new Array(m.byteLength))},arraybuffer:c,uint8array:function(m){return new Uint8Array(m)},nodebuffer:function(m){return a.newBufferFrom(new Uint8Array(m))}},p.uint8array={string:d,array:function(m){return h(m,new Array(m.length))},arraybuffer:function(m){return m.buffer},uint8array:c,nodebuffer:function(m){return a.newBufferFrom(m)}},p.nodebuffer={string:d,array:function(m){return h(m,new Array(m.length))},arraybuffer:function(m){return p.nodebuffer.uint8array(m).buffer},uint8array:function(m){return h(m,new Uint8Array(m.length))},nodebuffer:c},i.transformTo=function(m,y){if(y=y||"",!m)return y;i.checkSupport(m);var g=i.getTypeOf(y);return p[g][m](y)},i.resolve=function(m){for(var y=m.split("/"),g=[],b=0;b<y.length;b++){var S=y[b];S==="."||S===""&&b!==0&&b!==y.length-1||(S===".."?g.pop():g.push(S))}return g.join("/")},i.getTypeOf=function(m){return typeof m=="string"?"string":Object.prototype.toString.call(m)==="[object Array]"?"array":o.nodebuffer&&a.isBuffer(m)?"nodebuffer":o.uint8array&&m instanceof Uint8Array?"uint8array":o.arraybuffer&&m instanceof ArrayBuffer?"arraybuffer":void 0},i.checkSupport=function(m){if(!o[m.toLowerCase()])throw new Error(m+" is not supported by this platform")},i.MAX_VALUE_16BITS=65535,i.MAX_VALUE_32BITS=-1,i.pretty=function(m){var y,g,b="";for(g=0;g<(m||"").length;g++)b+="\\x"+((y=m.charCodeAt(g))<16?"0":"")+y.toString(16).toUpperCase();return b},i.delay=function(m,y,g){setImmediate(function(){m.apply(g||null,y||[])})},i.inherits=function(m,y){function g(){}g.prototype=y.prototype,m.prototype=new g},i.extend=function(){var m,y,g={};for(m=0;m<arguments.length;m++)for(y in arguments[m])Object.prototype.hasOwnProperty.call(arguments[m],y)&&g[y]===void 0&&(g[y]=arguments[m][y]);return g},i.prepareContent=function(m,y,g,b,S){return l.Promise.resolve(y).then(function(x){return o.blob&&(x instanceof Blob||["[object File]","[object Blob]"].indexOf(Object.prototype.toString.call(x))!==-1)&&typeof FileReader<"u"?new l.Promise(function(O,M){var D=new FileReader;D.onload=function($){O($.target.result)},D.onerror=function($){M($.target.error)},D.readAsArrayBuffer(x)}):x}).then(function(x){var O=i.getTypeOf(x);return O?(O==="arraybuffer"?x=i.transformTo("uint8array",x):O==="string"&&(S?x=s.decode(x):g&&b!==!0&&(x=function(M){return u(M,o.uint8array?new Uint8Array(M.length):new Array(M.length))}(x))),x):l.Promise.reject(new Error("Can't read the data of '"+m+"'. Is it in a supported JavaScript type (String, Blob, ArrayBuffer, etc) ?"))})}},{"./base64":1,"./external":6,"./nodejsUtils":14,"./support":30,setimmediate:54}],33:[function(r,n,i){var o=r("./reader/readerFor"),s=r("./utils"),a=r("./signature"),l=r("./zipEntry"),c=r("./support");function u(f){this.files=[],this.loadOptions=f}u.prototype={checkSignature:function(f){if(!this.reader.readAndCheckSignature(f)){this.reader.index-=4;var d=this.reader.readString(4);throw new Error("Corrupted zip or bug: unexpected signature ("+s.pretty(d)+", expected "+s.pretty(f)+")")}},isSignature:function(f,d){var h=this.reader.index;this.reader.setIndex(f);var p=this.reader.readString(4)===d;return this.reader.setIndex(h),p},readBlockEndOfCentral:function(){this.diskNumber=this.reader.readInt(2),this.diskWithCentralDirStart=this.reader.readInt(2),this.centralDirRecordsOnThisDisk=this.reader.readInt(2),this.centralDirRecords=this.reader.readInt(2),this.centralDirSize=this.reader.readInt(4),this.centralDirOffset=this.reader.readInt(4),this.zipCommentLength=this.reader.readInt(2);var f=this.reader.readData(this.zipCommentLength),d=c.uint8array?"uint8array":"array",h=s.transformTo(d,f);this.zipComment=this.loadOptions.decodeFileName(h)},readBlockZip64EndOfCentral:function(){this.zip64EndOfCentralSize=this.reader.readInt(8),this.reader.skip(4),this.diskNumber=this.reader.readInt(4),this.diskWithCentralDirStart=this.reader.readInt(4),this.centralDirRecordsOnThisDisk=this.reader.readInt(8),this.centralDirRecords=this.reader.readInt(8),this.centralDirSize=this.reader.readInt(8),this.centralDirOffset=this.reader.readInt(8),this.zip64ExtensibleData={};for(var f,d,h,p=this.zip64EndOfCentralSize-44;0<p;)f=this.reader.readInt(2),d=this.reader.readInt(4),h=this.reader.readData(d),this.zip64ExtensibleData[f]={id:f,length:d,value:h}},readBlockZip64EndOfCentralLocator:function(){if(this.diskWithZip64CentralDirStart=this.reader.readInt(4),this.relativeOffsetEndOfZip64CentralDir=this.reader.readInt(8),this.disksCount=this.reader.readInt(4),1<this.disksCount)throw new Error("Multi-volumes zip are not supported")},readLocalFiles:function(){var f,d;for(f=0;f<this.files.length;f++)d=this.files[f],this.reader.setIndex(d.localHeaderOffset),this.checkSignature(a.LOCAL_FILE_HEADER),d.readLocalPart(this.reader),d.handleUTF8(),d.processAttributes()},readCentralDir:function(){var f;for(this.reader.setIndex(this.centralDirOffset);this.reader.readAndCheckSignature(a.CENTRAL_FILE_HEADER);)(f=new l({zip64:this.zip64},this.loadOptions)).readCentralPart(this.reader),this.files.push(f);if(this.centralDirRecords!==this.files.length&&this.centralDirRecords!==0&&this.files.length===0)throw new Error("Corrupted zip or bug: expected "+this.centralDirRecords+" records in central dir, got "+this.files.length)},readEndOfCentral:function(){var f=this.reader.lastIndexOfSignature(a.CENTRAL_DIRECTORY_END);if(f<0)throw this.isSignature(0,a.LOCAL_FILE_HEADER)?new Error("Corrupted zip: can't find end of central directory"):new Error("Can't find end of central directory : is this a zip file ? If it is, see https://stuk.github.io/jszip/documentation/howto/read_zip.html");this.reader.setIndex(f);var d=f;if(this.checkSignature(a.CENTRAL_DIRECTORY_END),this.readBlockEndOfCentral(),this.diskNumber===s.MAX_VALUE_16BITS||this.diskWithCentralDirStart===s.MAX_VALUE_16BITS||this.centralDirRecordsOnThisDisk===s.MAX_VALUE_16BITS||this.centralDirRecords===s.MAX_VALUE_16BITS||this.centralDirSize===s.MAX_VALUE_32BITS||this.centralDirOffset===s.MAX_VALUE_32BITS){if(this.zip64=!0,(f=this.reader.lastIndexOfSignature(a.ZIP64_CENTRAL_DIRECTORY_LOCATOR))<0)throw new Error("Corrupted zip: can't find the ZIP64 end of central directory locator");if(this.reader.setIndex(f),this.checkSignature(a.ZIP64_CENTRAL_DIRECTORY_LOCATOR),this.readBlockZip64EndOfCentralLocator(),!this.isSignature(this.relativeOffsetEndOfZip64CentralDir,a.ZIP64_CENTRAL_DIRECTORY_END)&&(this.relativeOffsetEndOfZip64CentralDir=this.reader.lastIndexOfSignature(a.ZIP64_CENTRAL_DIRECTORY_END),this.relativeOffsetEndOfZip64CentralDir<0))throw new Error("Corrupted zip: can't find the ZIP64 end of central directory");this.reader.setIndex(this.relativeOffsetEndOfZip64CentralDir),this.checkSignature(a.ZIP64_CENTRAL_DIRECTORY_END),this.readBlockZip64EndOfCentral()}var h=this.centralDirOffset+this.centralDirSize;this.zip64&&(h+=20,h+=12+this.zip64EndOfCentralSize);var p=d-h;if(0<p)this.isSignature(d,a.CENTRAL_FILE_HEADER)||(this.reader.zero=p);else if(p<0)throw new Error("Corrupted zip: missing "+Math.abs(p)+" bytes.")},prepareReader:function(f){this.reader=o(f)},load:function(f){this.prepareReader(f),this.readEndOfCentral(),this.readCentralDir(),this.readLocalFiles()}},n.exports=u},{"./reader/readerFor":22,"./signature":23,"./support":30,"./utils":32,"./zipEntry":34}],34:[function(r,n,i){var o=r("./reader/readerFor"),s=r("./utils"),a=r("./compressedObject"),l=r("./crc32"),c=r("./utf8"),u=r("./compressions"),f=r("./support");function d(h,p){this.options=h,this.loadOptions=p}d.prototype={isEncrypted:function(){return(1&this.bitFlag)==1},useUTF8:function(){return(2048&this.bitFlag)==2048},readLocalPart:function(h){var p,m;if(h.skip(22),this.fileNameLength=h.readInt(2),m=h.readInt(2),this.fileName=h.readData(this.fileNameLength),h.skip(m),this.compressedSize===-1||this.uncompressedSize===-1)throw new Error("Bug or corrupted zip : didn't get enough information from the central directory (compressedSize === -1 || uncompressedSize === -1)");if((p=function(y){for(var g in u)if(Object.prototype.hasOwnProperty.call(u,g)&&u[g].magic===y)return u[g];return null}(this.compressionMethod))===null)throw new Error("Corrupted zip : compression "+s.pretty(this.compressionMethod)+" unknown (inner file : "+s.transformTo("string",this.fileName)+")");this.decompressed=new a(this.compressedSize,this.uncompressedSize,this.crc32,p,h.readData(this.compressedSize))},readCentralPart:function(h){this.versionMadeBy=h.readInt(2),h.skip(2),this.bitFlag=h.readInt(2),this.compressionMethod=h.readString(2),this.date=h.readDate(),this.crc32=h.readInt(4),this.compressedSize=h.readInt(4),this.uncompressedSize=h.readInt(4);var p=h.readInt(2);if(this.extraFieldsLength=h.readInt(2),this.fileCommentLength=h.readInt(2),this.diskNumberStart=h.readInt(2),this.internalFileAttributes=h.readInt(2),this.externalFileAttributes=h.readInt(4),this.localHeaderOffset=h.readInt(4),this.isEncrypted())throw new Error("Encrypted zip are not supported");h.skip(p),this.readExtraFields(h),this.parseZIP64ExtraField(h),this.fileComment=h.readData(this.fileCommentLength)},processAttributes:function(){this.unixPermissions=null,this.dosPermissions=null;var h=this.versionMadeBy>>8;this.dir=!!(16&this.externalFileAttributes),h==0&&(this.dosPermissions=63&this.externalFileAttributes),h==3&&(this.unixPermissions=this.externalFileAttributes>>16&65535),this.dir||this.fileNameStr.slice(-1)!=="/"||(this.dir=!0)},parseZIP64ExtraField:function(){if(this.extraFields[1]){var h=o(this.extraFields[1].value);this.uncompressedSize===s.MAX_VALUE_32BITS&&(this.uncompressedSize=h.readInt(8)),this.compressedSize===s.MAX_VALUE_32BITS&&(this.compressedSize=h.readInt(8)),this.localHeaderOffset===s.MAX_VALUE_32BITS&&(this.localHeaderOffset=h.readInt(8)),this.diskNumberStart===s.MAX_VALUE_32BITS&&(this.diskNumberStart=h.readInt(4))}},readExtraFields:function(h){var p,m,y,g=h.index+this.extraFieldsLength;for(this.extraFields||(this.extraFields={});h.index+4<g;)p=h.readInt(2),m=h.readInt(2),y=h.readData(m),this.extraFields[p]={id:p,length:m,value:y};h.setIndex(g)},handleUTF8:function(){var h=f.uint8array?"uint8array":"array";if(this.useUTF8())this.fileNameStr=c.utf8decode(this.fileName),this.fileCommentStr=c.utf8decode(this.fileComment);else{var p=this.findExtraFieldUnicodePath();if(p!==null)this.fileNameStr=p;else{var m=s.transformTo(h,this.fileName);this.fileNameStr=this.loadOptions.decodeFileName(m)}var y=this.findExtraFieldUnicodeComment();if(y!==null)this.fileCommentStr=y;else{var g=s.transformTo(h,this.fileComment);this.fileCommentStr=this.loadOptions.decodeFileName(g)}}},findExtraFieldUnicodePath:function(){var h=this.extraFields[28789];if(h){var p=o(h.value);return p.readInt(1)!==1||l(this.fileName)!==p.readInt(4)?null:c.utf8decode(p.readData(h.length-5))}return null},findExtraFieldUnicodeComment:function(){var h=this.extraFields[25461];if(h){var p=o(h.value);return p.readInt(1)!==1||l(this.fileComment)!==p.readInt(4)?null:c.utf8decode(p.readData(h.length-5))}return null}},n.exports=d},{"./compressedObject":2,"./compressions":3,"./crc32":4,"./reader/readerFor":22,"./support":30,"./utf8":31,"./utils":32}],35:[function(r,n,i){function o(p,m,y){this.name=p,this.dir=y.dir,this.date=y.date,this.comment=y.comment,this.unixPermissions=y.unixPermissions,this.dosPermissions=y.dosPermissions,this._data=m,this._dataBinary=y.binary,this.options={compression:y.compression,compressionOptions:y.compressionOptions}}var s=r("./stream/StreamHelper"),a=r("./stream/DataWorker"),l=r("./utf8"),c=r("./compressedObject"),u=r("./stream/GenericWorker");o.prototype={internalStream:function(p){var m=null,y="string";try{if(!p)throw new Error("No output type specified.");var g=(y=p.toLowerCase())==="string"||y==="text";y!=="binarystring"&&y!=="text"||(y="string"),m=this._decompressWorker();var b=!this._dataBinary;b&&!g&&(m=m.pipe(new l.Utf8EncodeWorker)),!b&&g&&(m=m.pipe(new l.Utf8DecodeWorker))}catch(S){(m=new u("error")).error(S)}return new s(m,y,"")},async:function(p,m){return this.internalStream(p).accumulate(m)},nodeStream:function(p,m){return this.internalStream(p||"nodebuffer").toNodejsStream(m)},_compressWorker:function(p,m){if(this._data instanceof c&&this._data.compression.magic===p.magic)return this._data.getCompressedWorker();var y=this._decompressWorker();return this._dataBinary||(y=y.pipe(new l.Utf8EncodeWorker)),c.createWorkerFrom(y,p,m)},_decompressWorker:function(){return this._data instanceof c?this._data.getContentWorker():this._data instanceof u?this._data:new a(this._data)}};for(var f=["asText","asBinary","asNodeBuffer","asUint8Array","asArrayBuffer"],d=function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},h=0;h<f.length;h++)o.prototype[f[h]]=d;n.exports=o},{"./compressedObject":2,"./stream/DataWorker":27,"./stream/GenericWorker":28,"./stream/StreamHelper":29,"./utf8":31}],36:[function(r,n,i){(function(o){var s,a,l=o.MutationObserver||o.WebKitMutationObserver;if(l){var c=0,u=new l(p),f=o.document.createTextNode("");u.observe(f,{characterData:!0}),s=function(){f.data=c=++c%2}}else if(o.setImmediate||o.MessageChannel===void 0)s="document"in o&&"onreadystatechange"in o.document.createElement("script")?function(){var m=o.document.createElement("script");m.onreadystatechange=function(){p(),m.onreadystatechange=null,m.parentNode.removeChild(m),m=null},o.document.documentElement.appendChild(m)}:function(){setTimeout(p,0)};else{var d=new o.MessageChannel;d.port1.onmessage=p,s=function(){d.port2.postMessage(0)}}var h=[];function p(){var m,y;a=!0;for(var g=h.length;g;){for(y=h,h=[],m=-1;++m<g;)y[m]();g=h.length}a=!1}n.exports=function(m){h.push(m)!==1||a||s()}}).call(this,typeof Vr<"u"?Vr:typeof self<"u"?self:typeof window<"u"?window:{})},{}],37:[function(r,n,i){var o=r("immediate");function s(){}var a={},l=["REJECTED"],c=["FULFILLED"],u=["PENDING"];function f(g){if(typeof g!="function")throw new TypeError("resolver must be a function");this.state=u,this.queue=[],this.outcome=void 0,g!==s&&m(this,g)}function d(g,b,S){this.promise=g,typeof b=="function"&&(this.onFulfilled=b,this.callFulfilled=this.otherCallFulfilled),typeof S=="function"&&(this.onRejected=S,this.callRejected=this.otherCallRejected)}function h(g,b,S){o(function(){var x;try{x=b(S)}catch(O){return a.reject(g,O)}x===g?a.reject(g,new TypeError("Cannot resolve promise with itself")):a.resolve(g,x)})}function p(g){var b=g&&g.then;if(g&&(typeof g=="object"||typeof g=="function")&&typeof b=="function")return function(){b.apply(g,arguments)}}function m(g,b){var S=!1;function x(D){S||(S=!0,a.reject(g,D))}function O(D){S||(S=!0,a.resolve(g,D))}var M=y(function(){b(O,x)});M.status==="error"&&x(M.value)}function y(g,b){var S={};try{S.value=g(b),S.status="success"}catch(x){S.status="error",S.value=x}return S}(n.exports=f).prototype.finally=function(g){if(typeof g!="function")return this;var b=this.constructor;return this.then(function(S){return b.resolve(g()).then(function(){return S})},function(S){return b.resolve(g()).then(function(){throw S})})},f.prototype.catch=function(g){return this.then(null,g)},f.prototype.then=function(g,b){if(typeof g!="function"&&this.state===c||typeof b!="function"&&this.state===l)return this;var S=new this.constructor(s);return this.state!==u?h(S,this.state===c?g:b,this.outcome):this.queue.push(new d(S,g,b)),S},d.prototype.callFulfilled=function(g){a.resolve(this.promise,g)},d.prototype.otherCallFulfilled=function(g){h(this.promise,this.onFulfilled,g)},d.prototype.callRejected=function(g){a.reject(this.promise,g)},d.prototype.otherCallRejected=function(g){h(this.promise,this.onRejected,g)},a.resolve=function(g,b){var S=y(p,b);if(S.status==="error")return a.reject(g,S.value);var x=S.value;if(x)m(g,x);else{g.state=c,g.outcome=b;for(var O=-1,M=g.queue.length;++O<M;)g.queue[O].callFulfilled(b)}return g},a.reject=function(g,b){g.state=l,g.outcome=b;for(var S=-1,x=g.queue.length;++S<x;)g.queue[S].callRejected(b);return g},f.resolve=function(g){return g instanceof this?g:a.resolve(new this(s),g)},f.reject=function(g){var b=new this(s);return a.reject(b,g)},f.all=function(g){var b=this;if(Object.prototype.toString.call(g)!=="[object Array]")return this.reject(new TypeError("must be an array"));var S=g.length,x=!1;if(!S)return this.resolve([]);for(var O=new Array(S),M=0,D=-1,$=new this(s);++D<S;)A(g[D],D);return $;function A(V,Q){b.resolve(V).then(function(I){O[Q]=I,++M!==S||x||(x=!0,a.resolve($,O))},function(I){x||(x=!0,a.reject($,I))})}},f.race=function(g){var b=this;if(Object.prototype.toString.call(g)!=="[object Array]")return this.reject(new TypeError("must be an array"));var S=g.length,x=!1;if(!S)return this.resolve([]);for(var O=-1,M=new this(s);++O<S;)D=g[O],b.resolve(D).then(function($){x||(x=!0,a.resolve(M,$))},function($){x||(x=!0,a.reject(M,$))});var D;return M}},{immediate:36}],38:[function(r,n,i){var o={};(0,r("./lib/utils/common").assign)(o,r("./lib/deflate"),r("./lib/inflate"),r("./lib/zlib/constants")),n.exports=o},{"./lib/deflate":39,"./lib/inflate":40,"./lib/utils/common":41,"./lib/zlib/constants":44}],39:[function(r,n,i){var o=r("./zlib/deflate"),s=r("./utils/common"),a=r("./utils/strings"),l=r("./zlib/messages"),c=r("./zlib/zstream"),u=Object.prototype.toString,f=0,d=-1,h=0,p=8;function m(g){if(!(this instanceof m))return new m(g);this.options=s.assign({level:d,method:p,chunkSize:16384,windowBits:15,memLevel:8,strategy:h,to:""},g||{});var b=this.options;b.raw&&0<b.windowBits?b.windowBits=-b.windowBits:b.gzip&&0<b.windowBits&&b.windowBits<16&&(b.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new c,this.strm.avail_out=0;var S=o.deflateInit2(this.strm,b.level,b.method,b.windowBits,b.memLevel,b.strategy);if(S!==f)throw new Error(l[S]);if(b.header&&o.deflateSetHeader(this.strm,b.header),b.dictionary){var x;if(x=typeof b.dictionary=="string"?a.string2buf(b.dictionary):u.call(b.dictionary)==="[object ArrayBuffer]"?new Uint8Array(b.dictionary):b.dictionary,(S=o.deflateSetDictionary(this.strm,x))!==f)throw new Error(l[S]);this._dict_set=!0}}function y(g,b){var S=new m(b);if(S.push(g,!0),S.err)throw S.msg||l[S.err];return S.result}m.prototype.push=function(g,b){var S,x,O=this.strm,M=this.options.chunkSize;if(this.ended)return!1;x=b===~~b?b:b===!0?4:0,typeof g=="string"?O.input=a.string2buf(g):u.call(g)==="[object ArrayBuffer]"?O.input=new Uint8Array(g):O.input=g,O.next_in=0,O.avail_in=O.input.length;do{if(O.avail_out===0&&(O.output=new s.Buf8(M),O.next_out=0,O.avail_out=M),(S=o.deflate(O,x))!==1&&S!==f)return this.onEnd(S),!(this.ended=!0);O.avail_out!==0&&(O.avail_in!==0||x!==4&&x!==2)||(this.options.to==="string"?this.onData(a.buf2binstring(s.shrinkBuf(O.output,O.next_out))):this.onData(s.shrinkBuf(O.output,O.next_out)))}while((0<O.avail_in||O.avail_out===0)&&S!==1);return x===4?(S=o.deflateEnd(this.strm),this.onEnd(S),this.ended=!0,S===f):x!==2||(this.onEnd(f),!(O.avail_out=0))},m.prototype.onData=function(g){this.chunks.push(g)},m.prototype.onEnd=function(g){g===f&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=s.flattenChunks(this.chunks)),this.chunks=[],this.err=g,this.msg=this.strm.msg},i.Deflate=m,i.deflate=y,i.deflateRaw=function(g,b){return(b=b||{}).raw=!0,y(g,b)},i.gzip=function(g,b){return(b=b||{}).gzip=!0,y(g,b)}},{"./utils/common":41,"./utils/strings":42,"./zlib/deflate":46,"./zlib/messages":51,"./zlib/zstream":53}],40:[function(r,n,i){var o=r("./zlib/inflate"),s=r("./utils/common"),a=r("./utils/strings"),l=r("./zlib/constants"),c=r("./zlib/messages"),u=r("./zlib/zstream"),f=r("./zlib/gzheader"),d=Object.prototype.toString;function h(m){if(!(this instanceof h))return new h(m);this.options=s.assign({chunkSize:16384,windowBits:0,to:""},m||{});var y=this.options;y.raw&&0<=y.windowBits&&y.windowBits<16&&(y.windowBits=-y.windowBits,y.windowBits===0&&(y.windowBits=-15)),!(0<=y.windowBits&&y.windowBits<16)||m&&m.windowBits||(y.windowBits+=32),15<y.windowBits&&y.windowBits<48&&!(15&y.windowBits)&&(y.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new u,this.strm.avail_out=0;var g=o.inflateInit2(this.strm,y.windowBits);if(g!==l.Z_OK)throw new Error(c[g]);this.header=new f,o.inflateGetHeader(this.strm,this.header)}function p(m,y){var g=new h(y);if(g.push(m,!0),g.err)throw g.msg||c[g.err];return g.result}h.prototype.push=function(m,y){var g,b,S,x,O,M,D=this.strm,$=this.options.chunkSize,A=this.options.dictionary,V=!1;if(this.ended)return!1;b=y===~~y?y:y===!0?l.Z_FINISH:l.Z_NO_FLUSH,typeof m=="string"?D.input=a.binstring2buf(m):d.call(m)==="[object ArrayBuffer]"?D.input=new Uint8Array(m):D.input=m,D.next_in=0,D.avail_in=D.input.length;do{if(D.avail_out===0&&(D.output=new s.Buf8($),D.next_out=0,D.avail_out=$),(g=o.inflate(D,l.Z_NO_FLUSH))===l.Z_NEED_DICT&&A&&(M=typeof A=="string"?a.string2buf(A):d.call(A)==="[object ArrayBuffer]"?new Uint8Array(A):A,g=o.inflateSetDictionary(this.strm,M)),g===l.Z_BUF_ERROR&&V===!0&&(g=l.Z_OK,V=!1),g!==l.Z_STREAM_END&&g!==l.Z_OK)return this.onEnd(g),!(this.ended=!0);D.next_out&&(D.avail_out!==0&&g!==l.Z_STREAM_END&&(D.avail_in!==0||b!==l.Z_FINISH&&b!==l.Z_SYNC_FLUSH)||(this.options.to==="string"?(S=a.utf8border(D.output,D.next_out),x=D.next_out-S,O=a.buf2string(D.output,S),D.next_out=x,D.avail_out=$-x,x&&s.arraySet(D.output,D.output,S,x,0),this.onData(O)):this.onData(s.shrinkBuf(D.output,D.next_out)))),D.avail_in===0&&D.avail_out===0&&(V=!0)}while((0<D.avail_in||D.avail_out===0)&&g!==l.Z_STREAM_END);return g===l.Z_STREAM_END&&(b=l.Z_FINISH),b===l.Z_FINISH?(g=o.inflateEnd(this.strm),this.onEnd(g),this.ended=!0,g===l.Z_OK):b!==l.Z_SYNC_FLUSH||(this.onEnd(l.Z_OK),!(D.avail_out=0))},h.prototype.onData=function(m){this.chunks.push(m)},h.prototype.onEnd=function(m){m===l.Z_OK&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=s.flattenChunks(this.chunks)),this.chunks=[],this.err=m,this.msg=this.strm.msg},i.Inflate=h,i.inflate=p,i.inflateRaw=function(m,y){return(y=y||{}).raw=!0,p(m,y)},i.ungzip=p},{"./utils/common":41,"./utils/strings":42,"./zlib/constants":44,"./zlib/gzheader":47,"./zlib/inflate":49,"./zlib/messages":51,"./zlib/zstream":53}],41:[function(r,n,i){var o=typeof Uint8Array<"u"&&typeof Uint16Array<"u"&&typeof Int32Array<"u";i.assign=function(l){for(var c=Array.prototype.slice.call(arguments,1);c.length;){var u=c.shift();if(u){if(typeof u!="object")throw new TypeError(u+"must be non-object");for(var f in u)u.hasOwnProperty(f)&&(l[f]=u[f])}}return l},i.shrinkBuf=function(l,c){return l.length===c?l:l.subarray?l.subarray(0,c):(l.length=c,l)};var s={arraySet:function(l,c,u,f,d){if(c.subarray&&l.subarray)l.set(c.subarray(u,u+f),d);else for(var h=0;h<f;h++)l[d+h]=c[u+h]},flattenChunks:function(l){var c,u,f,d,h,p;for(c=f=0,u=l.length;c<u;c++)f+=l[c].length;for(p=new Uint8Array(f),c=d=0,u=l.length;c<u;c++)h=l[c],p.set(h,d),d+=h.length;return p}},a={arraySet:function(l,c,u,f,d){for(var h=0;h<f;h++)l[d+h]=c[u+h]},flattenChunks:function(l){return[].concat.apply([],l)}};i.setTyped=function(l){l?(i.Buf8=Uint8Array,i.Buf16=Uint16Array,i.Buf32=Int32Array,i.assign(i,s)):(i.Buf8=Array,i.Buf16=Array,i.Buf32=Array,i.assign(i,a))},i.setTyped(o)},{}],42:[function(r,n,i){var o=r("./common"),s=!0,a=!0;try{String.fromCharCode.apply(null,[0])}catch{s=!1}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch{a=!1}for(var l=new o.Buf8(256),c=0;c<256;c++)l[c]=252<=c?6:248<=c?5:240<=c?4:224<=c?3:192<=c?2:1;function u(f,d){if(d<65537&&(f.subarray&&a||!f.subarray&&s))return String.fromCharCode.apply(null,o.shrinkBuf(f,d));for(var h="",p=0;p<d;p++)h+=String.fromCharCode(f[p]);return h}l[254]=l[254]=1,i.string2buf=function(f){var d,h,p,m,y,g=f.length,b=0;for(m=0;m<g;m++)(64512&(h=f.charCodeAt(m)))==55296&&m+1<g&&(64512&(p=f.charCodeAt(m+1)))==56320&&(h=65536+(h-55296<<10)+(p-56320),m++),b+=h<128?1:h<2048?2:h<65536?3:4;for(d=new o.Buf8(b),m=y=0;y<b;m++)(64512&(h=f.charCodeAt(m)))==55296&&m+1<g&&(64512&(p=f.charCodeAt(m+1)))==56320&&(h=65536+(h-55296<<10)+(p-56320),m++),h<128?d[y++]=h:(h<2048?d[y++]=192|h>>>6:(h<65536?d[y++]=224|h>>>12:(d[y++]=240|h>>>18,d[y++]=128|h>>>12&63),d[y++]=128|h>>>6&63),d[y++]=128|63&h);return d},i.buf2binstring=function(f){return u(f,f.length)},i.binstring2buf=function(f){for(var d=new o.Buf8(f.length),h=0,p=d.length;h<p;h++)d[h]=f.charCodeAt(h);return d},i.buf2string=function(f,d){var h,p,m,y,g=d||f.length,b=new Array(2*g);for(h=p=0;h<g;)if((m=f[h++])<128)b[p++]=m;else if(4<(y=l[m]))b[p++]=65533,h+=y-1;else{for(m&=y===2?31:y===3?15:7;1<y&&h<g;)m=m<<6|63&f[h++],y--;1<y?b[p++]=65533:m<65536?b[p++]=m:(m-=65536,b[p++]=55296|m>>10&1023,b[p++]=56320|1023&m)}return u(b,p)},i.utf8border=function(f,d){var h;for((d=d||f.length)>f.length&&(d=f.length),h=d-1;0<=h&&(192&f[h])==128;)h--;return h<0||h===0?d:h+l[f[h]]>d?h:d}},{"./common":41}],43:[function(r,n,i){n.exports=function(o,s,a,l){for(var c=65535&o|0,u=o>>>16&65535|0,f=0;a!==0;){for(a-=f=2e3<a?2e3:a;u=u+(c=c+s[l++]|0)|0,--f;);c%=65521,u%=65521}return c|u<<16|0}},{}],44:[function(r,n,i){n.exports={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8}},{}],45:[function(r,n,i){var o=function(){for(var s,a=[],l=0;l<256;l++){s=l;for(var c=0;c<8;c++)s=1&s?3988292384^s>>>1:s>>>1;a[l]=s}return a}();n.exports=function(s,a,l,c){var u=o,f=c+l;s^=-1;for(var d=c;d<f;d++)s=s>>>8^u[255&(s^a[d])];return-1^s}},{}],46:[function(r,n,i){var o,s=r("../utils/common"),a=r("./trees"),l=r("./adler32"),c=r("./crc32"),u=r("./messages"),f=0,d=4,h=0,p=-2,m=-1,y=4,g=2,b=8,S=9,x=286,O=30,M=19,D=2*x+1,$=15,A=3,V=258,Q=V+A+1,I=42,U=113,k=1,G=2,te=3,W=4;function ae(T,re){return T.msg=u[re],re}function X(T){return(T<<1)-(4<T?9:0)}function de(T){for(var re=T.length;0<=--re;)T[re]=0}function q(T){var re=T.state,R=re.pending;R>T.avail_out&&(R=T.avail_out),R!==0&&(s.arraySet(T.output,re.pending_buf,re.pending_out,R,T.next_out),T.next_out+=R,re.pending_out+=R,T.total_out+=R,T.avail_out-=R,re.pending-=R,re.pending===0&&(re.pending_out=0))}function N(T,re){a._tr_flush_block(T,0<=T.block_start?T.block_start:-1,T.strstart-T.block_start,re),T.block_start=T.strstart,q(T.strm)}function Y(T,re){T.pending_buf[T.pending++]=re}function Z(T,re){T.pending_buf[T.pending++]=re>>>8&255,T.pending_buf[T.pending++]=255&re}function ie(T,re){var R,v,w=T.max_chain_length,E=T.strstart,B=T.prev_length,J=T.nice_match,H=T.strstart>T.w_size-Q?T.strstart-(T.w_size-Q):0,ce=T.window,me=T.w_mask,fe=T.prev,ve=T.strstart+V,Te=ce[E+B-1],Oe=ce[E+B];T.prev_length>=T.good_match&&(w>>=2),J>T.lookahead&&(J=T.lookahead);do if(ce[(R=re)+B]===Oe&&ce[R+B-1]===Te&&ce[R]===ce[E]&&ce[++R]===ce[E+1]){E+=2,R++;do;while(ce[++E]===ce[++R]&&ce[++E]===ce[++R]&&ce[++E]===ce[++R]&&ce[++E]===ce[++R]&&ce[++E]===ce[++R]&&ce[++E]===ce[++R]&&ce[++E]===ce[++R]&&ce[++E]===ce[++R]&&E<ve);if(v=V-(ve-E),E=ve-V,B<v){if(T.match_start=re,J<=(B=v))break;Te=ce[E+B-1],Oe=ce[E+B]}}while((re=fe[re&me])>H&&--w!=0);return B<=T.lookahead?B:T.lookahead}function K(T){var re,R,v,w,E,B,J,H,ce,me,fe=T.w_size;do{if(w=T.window_size-T.lookahead-T.strstart,T.strstart>=fe+(fe-Q)){for(s.arraySet(T.window,T.window,fe,fe,0),T.match_start-=fe,T.strstart-=fe,T.block_start-=fe,re=R=T.hash_size;v=T.head[--re],T.head[re]=fe<=v?v-fe:0,--R;);for(re=R=fe;v=T.prev[--re],T.prev[re]=fe<=v?v-fe:0,--R;);w+=fe}if(T.strm.avail_in===0)break;if(B=T.strm,J=T.window,H=T.strstart+T.lookahead,ce=w,me=void 0,me=B.avail_in,ce<me&&(me=ce),R=me===0?0:(B.avail_in-=me,s.arraySet(J,B.input,B.next_in,me,H),B.state.wrap===1?B.adler=l(B.adler,J,me,H):B.state.wrap===2&&(B.adler=c(B.adler,J,me,H)),B.next_in+=me,B.total_in+=me,me),T.lookahead+=R,T.lookahead+T.insert>=A)for(E=T.strstart-T.insert,T.ins_h=T.window[E],T.ins_h=(T.ins_h<<T.hash_shift^T.window[E+1])&T.hash_mask;T.insert&&(T.ins_h=(T.ins_h<<T.hash_shift^T.window[E+A-1])&T.hash_mask,T.prev[E&T.w_mask]=T.head[T.ins_h],T.head[T.ins_h]=E,E++,T.insert--,!(T.lookahead+T.insert<A)););}while(T.lookahead<Q&&T.strm.avail_in!==0)}function _(T,re){for(var R,v;;){if(T.lookahead<Q){if(K(T),T.lookahead<Q&&re===f)return k;if(T.lookahead===0)break}if(R=0,T.lookahead>=A&&(T.ins_h=(T.ins_h<<T.hash_shift^T.window[T.strstart+A-1])&T.hash_mask,R=T.prev[T.strstart&T.w_mask]=T.head[T.ins_h],T.head[T.ins_h]=T.strstart),R!==0&&T.strstart-R<=T.w_size-Q&&(T.match_length=ie(T,R)),T.match_length>=A)if(v=a._tr_tally(T,T.strstart-T.match_start,T.match_length-A),T.lookahead-=T.match_length,T.match_length<=T.max_lazy_match&&T.lookahead>=A){for(T.match_length--;T.strstart++,T.ins_h=(T.ins_h<<T.hash_shift^T.window[T.strstart+A-1])&T.hash_mask,R=T.prev[T.strstart&T.w_mask]=T.head[T.ins_h],T.head[T.ins_h]=T.strstart,--T.match_length!=0;);T.strstart++}else T.strstart+=T.match_length,T.match_length=0,T.ins_h=T.window[T.strstart],T.ins_h=(T.ins_h<<T.hash_shift^T.window[T.strstart+1])&T.hash_mask;else v=a._tr_tally(T,0,T.window[T.strstart]),T.lookahead--,T.strstart++;if(v&&(N(T,!1),T.strm.avail_out===0))return k}return T.insert=T.strstart<A-1?T.strstart:A-1,re===d?(N(T,!0),T.strm.avail_out===0?te:W):T.last_lit&&(N(T,!1),T.strm.avail_out===0)?k:G}function C(T,re){for(var R,v,w;;){if(T.lookahead<Q){if(K(T),T.lookahead<Q&&re===f)return k;if(T.lookahead===0)break}if(R=0,T.lookahead>=A&&(T.ins_h=(T.ins_h<<T.hash_shift^T.window[T.strstart+A-1])&T.hash_mask,R=T.prev[T.strstart&T.w_mask]=T.head[T.ins_h],T.head[T.ins_h]=T.strstart),T.prev_length=T.match_length,T.prev_match=T.match_start,T.match_length=A-1,R!==0&&T.prev_length<T.max_lazy_match&&T.strstart-R<=T.w_size-Q&&(T.match_length=ie(T,R),T.match_length<=5&&(T.strategy===1||T.match_length===A&&4096<T.strstart-T.match_start)&&(T.match_length=A-1)),T.prev_length>=A&&T.match_length<=T.prev_length){for(w=T.strstart+T.lookahead-A,v=a._tr_tally(T,T.strstart-1-T.prev_match,T.prev_length-A),T.lookahead-=T.prev_length-1,T.prev_length-=2;++T.strstart<=w&&(T.ins_h=(T.ins_h<<T.hash_shift^T.window[T.strstart+A-1])&T.hash_mask,R=T.prev[T.strstart&T.w_mask]=T.head[T.ins_h],T.head[T.ins_h]=T.strstart),--T.prev_length!=0;);if(T.match_available=0,T.match_length=A-1,T.strstart++,v&&(N(T,!1),T.strm.avail_out===0))return k}else if(T.match_available){if((v=a._tr_tally(T,0,T.window[T.strstart-1]))&&N(T,!1),T.strstart++,T.lookahead--,T.strm.avail_out===0)return k}else T.match_available=1,T.strstart++,T.lookahead--}return T.match_available&&(v=a._tr_tally(T,0,T.window[T.strstart-1]),T.match_available=0),T.insert=T.strstart<A-1?T.strstart:A-1,re===d?(N(T,!0),T.strm.avail_out===0?te:W):T.last_lit&&(N(T,!1),T.strm.avail_out===0)?k:G}function z(T,re,R,v,w){this.good_length=T,this.max_lazy=re,this.nice_length=R,this.max_chain=v,this.func=w}function j(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=b,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new s.Buf16(2*D),this.dyn_dtree=new s.Buf16(2*(2*O+1)),this.bl_tree=new s.Buf16(2*(2*M+1)),de(this.dyn_ltree),de(this.dyn_dtree),de(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new s.Buf16($+1),this.heap=new s.Buf16(2*x+1),de(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new s.Buf16(2*x+1),de(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}function P(T){var re;return T&&T.state?(T.total_in=T.total_out=0,T.data_type=g,(re=T.state).pending=0,re.pending_out=0,re.wrap<0&&(re.wrap=-re.wrap),re.status=re.wrap?I:U,T.adler=re.wrap===2?0:1,re.last_flush=f,a._tr_init(re),h):ae(T,p)}function F(T){var re=P(T);return re===h&&function(R){R.window_size=2*R.w_size,de(R.head),R.max_lazy_match=o[R.level].max_lazy,R.good_match=o[R.level].good_length,R.nice_match=o[R.level].nice_length,R.max_chain_length=o[R.level].max_chain,R.strstart=0,R.block_start=0,R.lookahead=0,R.insert=0,R.match_length=R.prev_length=A-1,R.match_available=0,R.ins_h=0}(T.state),re}function ne(T,re,R,v,w,E){if(!T)return p;var B=1;if(re===m&&(re=6),v<0?(B=0,v=-v):15<v&&(B=2,v-=16),w<1||S<w||R!==b||v<8||15<v||re<0||9<re||E<0||y<E)return ae(T,p);v===8&&(v=9);var J=new j;return(T.state=J).strm=T,J.wrap=B,J.gzhead=null,J.w_bits=v,J.w_size=1<<J.w_bits,J.w_mask=J.w_size-1,J.hash_bits=w+7,J.hash_size=1<<J.hash_bits,J.hash_mask=J.hash_size-1,J.hash_shift=~~((J.hash_bits+A-1)/A),J.window=new s.Buf8(2*J.w_size),J.head=new s.Buf16(J.hash_size),J.prev=new s.Buf16(J.w_size),J.lit_bufsize=1<<w+6,J.pending_buf_size=4*J.lit_bufsize,J.pending_buf=new s.Buf8(J.pending_buf_size),J.d_buf=1*J.lit_bufsize,J.l_buf=3*J.lit_bufsize,J.level=re,J.strategy=E,J.method=R,F(T)}o=[new z(0,0,0,0,function(T,re){var R=65535;for(R>T.pending_buf_size-5&&(R=T.pending_buf_size-5);;){if(T.lookahead<=1){if(K(T),T.lookahead===0&&re===f)return k;if(T.lookahead===0)break}T.strstart+=T.lookahead,T.lookahead=0;var v=T.block_start+R;if((T.strstart===0||T.strstart>=v)&&(T.lookahead=T.strstart-v,T.strstart=v,N(T,!1),T.strm.avail_out===0)||T.strstart-T.block_start>=T.w_size-Q&&(N(T,!1),T.strm.avail_out===0))return k}return T.insert=0,re===d?(N(T,!0),T.strm.avail_out===0?te:W):(T.strstart>T.block_start&&(N(T,!1),T.strm.avail_out),k)}),new z(4,4,8,4,_),new z(4,5,16,8,_),new z(4,6,32,32,_),new z(4,4,16,16,C),new z(8,16,32,32,C),new z(8,16,128,128,C),new z(8,32,128,256,C),new z(32,128,258,1024,C),new z(32,258,258,4096,C)],i.deflateInit=function(T,re){return ne(T,re,b,15,8,0)},i.deflateInit2=ne,i.deflateReset=F,i.deflateResetKeep=P,i.deflateSetHeader=function(T,re){return T&&T.state?T.state.wrap!==2?p:(T.state.gzhead=re,h):p},i.deflate=function(T,re){var R,v,w,E;if(!T||!T.state||5<re||re<0)return T?ae(T,p):p;if(v=T.state,!T.output||!T.input&&T.avail_in!==0||v.status===666&&re!==d)return ae(T,T.avail_out===0?-5:p);if(v.strm=T,R=v.last_flush,v.last_flush=re,v.status===I)if(v.wrap===2)T.adler=0,Y(v,31),Y(v,139),Y(v,8),v.gzhead?(Y(v,(v.gzhead.text?1:0)+(v.gzhead.hcrc?2:0)+(v.gzhead.extra?4:0)+(v.gzhead.name?8:0)+(v.gzhead.comment?16:0)),Y(v,255&v.gzhead.time),Y(v,v.gzhead.time>>8&255),Y(v,v.gzhead.time>>16&255),Y(v,v.gzhead.time>>24&255),Y(v,v.level===9?2:2<=v.strategy||v.level<2?4:0),Y(v,255&v.gzhead.os),v.gzhead.extra&&v.gzhead.extra.length&&(Y(v,255&v.gzhead.extra.length),Y(v,v.gzhead.extra.length>>8&255)),v.gzhead.hcrc&&(T.adler=c(T.adler,v.pending_buf,v.pending,0)),v.gzindex=0,v.status=69):(Y(v,0),Y(v,0),Y(v,0),Y(v,0),Y(v,0),Y(v,v.level===9?2:2<=v.strategy||v.level<2?4:0),Y(v,3),v.status=U);else{var B=b+(v.w_bits-8<<4)<<8;B|=(2<=v.strategy||v.level<2?0:v.level<6?1:v.level===6?2:3)<<6,v.strstart!==0&&(B|=32),B+=31-B%31,v.status=U,Z(v,B),v.strstart!==0&&(Z(v,T.adler>>>16),Z(v,65535&T.adler)),T.adler=1}if(v.status===69)if(v.gzhead.extra){for(w=v.pending;v.gzindex<(65535&v.gzhead.extra.length)&&(v.pending!==v.pending_buf_size||(v.gzhead.hcrc&&v.pending>w&&(T.adler=c(T.adler,v.pending_buf,v.pending-w,w)),q(T),w=v.pending,v.pending!==v.pending_buf_size));)Y(v,255&v.gzhead.extra[v.gzindex]),v.gzindex++;v.gzhead.hcrc&&v.pending>w&&(T.adler=c(T.adler,v.pending_buf,v.pending-w,w)),v.gzindex===v.gzhead.extra.length&&(v.gzindex=0,v.status=73)}else v.status=73;if(v.status===73)if(v.gzhead.name){w=v.pending;do{if(v.pending===v.pending_buf_size&&(v.gzhead.hcrc&&v.pending>w&&(T.adler=c(T.adler,v.pending_buf,v.pending-w,w)),q(T),w=v.pending,v.pending===v.pending_buf_size)){E=1;break}E=v.gzindex<v.gzhead.name.length?255&v.gzhead.name.charCodeAt(v.gzindex++):0,Y(v,E)}while(E!==0);v.gzhead.hcrc&&v.pending>w&&(T.adler=c(T.adler,v.pending_buf,v.pending-w,w)),E===0&&(v.gzindex=0,v.status=91)}else v.status=91;if(v.status===91)if(v.gzhead.comment){w=v.pending;do{if(v.pending===v.pending_buf_size&&(v.gzhead.hcrc&&v.pending>w&&(T.adler=c(T.adler,v.pending_buf,v.pending-w,w)),q(T),w=v.pending,v.pending===v.pending_buf_size)){E=1;break}E=v.gzindex<v.gzhead.comment.length?255&v.gzhead.comment.charCodeAt(v.gzindex++):0,Y(v,E)}while(E!==0);v.gzhead.hcrc&&v.pending>w&&(T.adler=c(T.adler,v.pending_buf,v.pending-w,w)),E===0&&(v.status=103)}else v.status=103;if(v.status===103&&(v.gzhead.hcrc?(v.pending+2>v.pending_buf_size&&q(T),v.pending+2<=v.pending_buf_size&&(Y(v,255&T.adler),Y(v,T.adler>>8&255),T.adler=0,v.status=U)):v.status=U),v.pending!==0){if(q(T),T.avail_out===0)return v.last_flush=-1,h}else if(T.avail_in===0&&X(re)<=X(R)&&re!==d)return ae(T,-5);if(v.status===666&&T.avail_in!==0)return ae(T,-5);if(T.avail_in!==0||v.lookahead!==0||re!==f&&v.status!==666){var J=v.strategy===2?function(H,ce){for(var me;;){if(H.lookahead===0&&(K(H),H.lookahead===0)){if(ce===f)return k;break}if(H.match_length=0,me=a._tr_tally(H,0,H.window[H.strstart]),H.lookahead--,H.strstart++,me&&(N(H,!1),H.strm.avail_out===0))return k}return H.insert=0,ce===d?(N(H,!0),H.strm.avail_out===0?te:W):H.last_lit&&(N(H,!1),H.strm.avail_out===0)?k:G}(v,re):v.strategy===3?function(H,ce){for(var me,fe,ve,Te,Oe=H.window;;){if(H.lookahead<=V){if(K(H),H.lookahead<=V&&ce===f)return k;if(H.lookahead===0)break}if(H.match_length=0,H.lookahead>=A&&0<H.strstart&&(fe=Oe[ve=H.strstart-1])===Oe[++ve]&&fe===Oe[++ve]&&fe===Oe[++ve]){Te=H.strstart+V;do;while(fe===Oe[++ve]&&fe===Oe[++ve]&&fe===Oe[++ve]&&fe===Oe[++ve]&&fe===Oe[++ve]&&fe===Oe[++ve]&&fe===Oe[++ve]&&fe===Oe[++ve]&&ve<Te);H.match_length=V-(Te-ve),H.match_length>H.lookahead&&(H.match_length=H.lookahead)}if(H.match_length>=A?(me=a._tr_tally(H,1,H.match_length-A),H.lookahead-=H.match_length,H.strstart+=H.match_length,H.match_length=0):(me=a._tr_tally(H,0,H.window[H.strstart]),H.lookahead--,H.strstart++),me&&(N(H,!1),H.strm.avail_out===0))return k}return H.insert=0,ce===d?(N(H,!0),H.strm.avail_out===0?te:W):H.last_lit&&(N(H,!1),H.strm.avail_out===0)?k:G}(v,re):o[v.level].func(v,re);if(J!==te&&J!==W||(v.status=666),J===k||J===te)return T.avail_out===0&&(v.last_flush=-1),h;if(J===G&&(re===1?a._tr_align(v):re!==5&&(a._tr_stored_block(v,0,0,!1),re===3&&(de(v.head),v.lookahead===0&&(v.strstart=0,v.block_start=0,v.insert=0))),q(T),T.avail_out===0))return v.last_flush=-1,h}return re!==d?h:v.wrap<=0?1:(v.wrap===2?(Y(v,255&T.adler),Y(v,T.adler>>8&255),Y(v,T.adler>>16&255),Y(v,T.adler>>24&255),Y(v,255&T.total_in),Y(v,T.total_in>>8&255),Y(v,T.total_in>>16&255),Y(v,T.total_in>>24&255)):(Z(v,T.adler>>>16),Z(v,65535&T.adler)),q(T),0<v.wrap&&(v.wrap=-v.wrap),v.pending!==0?h:1)},i.deflateEnd=function(T){var re;return T&&T.state?(re=T.state.status)!==I&&re!==69&&re!==73&&re!==91&&re!==103&&re!==U&&re!==666?ae(T,p):(T.state=null,re===U?ae(T,-3):h):p},i.deflateSetDictionary=function(T,re){var R,v,w,E,B,J,H,ce,me=re.length;if(!T||!T.state||(E=(R=T.state).wrap)===2||E===1&&R.status!==I||R.lookahead)return p;for(E===1&&(T.adler=l(T.adler,re,me,0)),R.wrap=0,me>=R.w_size&&(E===0&&(de(R.head),R.strstart=0,R.block_start=0,R.insert=0),ce=new s.Buf8(R.w_size),s.arraySet(ce,re,me-R.w_size,R.w_size,0),re=ce,me=R.w_size),B=T.avail_in,J=T.next_in,H=T.input,T.avail_in=me,T.next_in=0,T.input=re,K(R);R.lookahead>=A;){for(v=R.strstart,w=R.lookahead-(A-1);R.ins_h=(R.ins_h<<R.hash_shift^R.window[v+A-1])&R.hash_mask,R.prev[v&R.w_mask]=R.head[R.ins_h],R.head[R.ins_h]=v,v++,--w;);R.strstart=v,R.lookahead=A-1,K(R)}return R.strstart+=R.lookahead,R.block_start=R.strstart,R.insert=R.lookahead,R.lookahead=0,R.match_length=R.prev_length=A-1,R.match_available=0,T.next_in=J,T.input=H,T.avail_in=B,R.wrap=E,h},i.deflateInfo="pako deflate (from Nodeca project)"},{"../utils/common":41,"./adler32":43,"./crc32":45,"./messages":51,"./trees":52}],47:[function(r,n,i){n.exports=function(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}},{}],48:[function(r,n,i){n.exports=function(o,s){var a,l,c,u,f,d,h,p,m,y,g,b,S,x,O,M,D,$,A,V,Q,I,U,k,G;a=o.state,l=o.next_in,k=o.input,c=l+(o.avail_in-5),u=o.next_out,G=o.output,f=u-(s-o.avail_out),d=u+(o.avail_out-257),h=a.dmax,p=a.wsize,m=a.whave,y=a.wnext,g=a.window,b=a.hold,S=a.bits,x=a.lencode,O=a.distcode,M=(1<<a.lenbits)-1,D=(1<<a.distbits)-1;e:do{S<15&&(b+=k[l++]<<S,S+=8,b+=k[l++]<<S,S+=8),$=x[b&M];t:for(;;){if(b>>>=A=$>>>24,S-=A,(A=$>>>16&255)===0)G[u++]=65535&$;else{if(!(16&A)){if(!(64&A)){$=x[(65535&$)+(b&(1<<A)-1)];continue t}if(32&A){a.mode=12;break e}o.msg="invalid literal/length code",a.mode=30;break e}V=65535&$,(A&=15)&&(S<A&&(b+=k[l++]<<S,S+=8),V+=b&(1<<A)-1,b>>>=A,S-=A),S<15&&(b+=k[l++]<<S,S+=8,b+=k[l++]<<S,S+=8),$=O[b&D];r:for(;;){if(b>>>=A=$>>>24,S-=A,!(16&(A=$>>>16&255))){if(!(64&A)){$=O[(65535&$)+(b&(1<<A)-1)];continue r}o.msg="invalid distance code",a.mode=30;break e}if(Q=65535&$,S<(A&=15)&&(b+=k[l++]<<S,(S+=8)<A&&(b+=k[l++]<<S,S+=8)),h<(Q+=b&(1<<A)-1)){o.msg="invalid distance too far back",a.mode=30;break e}if(b>>>=A,S-=A,(A=u-f)<Q){if(m<(A=Q-A)&&a.sane){o.msg="invalid distance too far back",a.mode=30;break e}if(U=g,(I=0)===y){if(I+=p-A,A<V){for(V-=A;G[u++]=g[I++],--A;);I=u-Q,U=G}}else if(y<A){if(I+=p+y-A,(A-=y)<V){for(V-=A;G[u++]=g[I++],--A;);if(I=0,y<V){for(V-=A=y;G[u++]=g[I++],--A;);I=u-Q,U=G}}}else if(I+=y-A,A<V){for(V-=A;G[u++]=g[I++],--A;);I=u-Q,U=G}for(;2<V;)G[u++]=U[I++],G[u++]=U[I++],G[u++]=U[I++],V-=3;V&&(G[u++]=U[I++],1<V&&(G[u++]=U[I++]))}else{for(I=u-Q;G[u++]=G[I++],G[u++]=G[I++],G[u++]=G[I++],2<(V-=3););V&&(G[u++]=G[I++],1<V&&(G[u++]=G[I++]))}break}}break}}while(l<c&&u<d);l-=V=S>>3,b&=(1<<(S-=V<<3))-1,o.next_in=l,o.next_out=u,o.avail_in=l<c?c-l+5:5-(l-c),o.avail_out=u<d?d-u+257:257-(u-d),a.hold=b,a.bits=S}},{}],49:[function(r,n,i){var o=r("../utils/common"),s=r("./adler32"),a=r("./crc32"),l=r("./inffast"),c=r("./inftrees"),u=1,f=2,d=0,h=-2,p=1,m=852,y=592;function g(I){return(I>>>24&255)+(I>>>8&65280)+((65280&I)<<8)+((255&I)<<24)}function b(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new o.Buf16(320),this.work=new o.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function S(I){var U;return I&&I.state?(U=I.state,I.total_in=I.total_out=U.total=0,I.msg="",U.wrap&&(I.adler=1&U.wrap),U.mode=p,U.last=0,U.havedict=0,U.dmax=32768,U.head=null,U.hold=0,U.bits=0,U.lencode=U.lendyn=new o.Buf32(m),U.distcode=U.distdyn=new o.Buf32(y),U.sane=1,U.back=-1,d):h}function x(I){var U;return I&&I.state?((U=I.state).wsize=0,U.whave=0,U.wnext=0,S(I)):h}function O(I,U){var k,G;return I&&I.state?(G=I.state,U<0?(k=0,U=-U):(k=1+(U>>4),U<48&&(U&=15)),U&&(U<8||15<U)?h:(G.window!==null&&G.wbits!==U&&(G.window=null),G.wrap=k,G.wbits=U,x(I))):h}function M(I,U){var k,G;return I?(G=new b,(I.state=G).window=null,(k=O(I,U))!==d&&(I.state=null),k):h}var D,$,A=!0;function V(I){if(A){var U;for(D=new o.Buf32(512),$=new o.Buf32(32),U=0;U<144;)I.lens[U++]=8;for(;U<256;)I.lens[U++]=9;for(;U<280;)I.lens[U++]=7;for(;U<288;)I.lens[U++]=8;for(c(u,I.lens,0,288,D,0,I.work,{bits:9}),U=0;U<32;)I.lens[U++]=5;c(f,I.lens,0,32,$,0,I.work,{bits:5}),A=!1}I.lencode=D,I.lenbits=9,I.distcode=$,I.distbits=5}function Q(I,U,k,G){var te,W=I.state;return W.window===null&&(W.wsize=1<<W.wbits,W.wnext=0,W.whave=0,W.window=new o.Buf8(W.wsize)),G>=W.wsize?(o.arraySet(W.window,U,k-W.wsize,W.wsize,0),W.wnext=0,W.whave=W.wsize):(G<(te=W.wsize-W.wnext)&&(te=G),o.arraySet(W.window,U,k-G,te,W.wnext),(G-=te)?(o.arraySet(W.window,U,k-G,G,0),W.wnext=G,W.whave=W.wsize):(W.wnext+=te,W.wnext===W.wsize&&(W.wnext=0),W.whave<W.wsize&&(W.whave+=te))),0}i.inflateReset=x,i.inflateReset2=O,i.inflateResetKeep=S,i.inflateInit=function(I){return M(I,15)},i.inflateInit2=M,i.inflate=function(I,U){var k,G,te,W,ae,X,de,q,N,Y,Z,ie,K,_,C,z,j,P,F,ne,T,re,R,v,w=0,E=new o.Buf8(4),B=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];if(!I||!I.state||!I.output||!I.input&&I.avail_in!==0)return h;(k=I.state).mode===12&&(k.mode=13),ae=I.next_out,te=I.output,de=I.avail_out,W=I.next_in,G=I.input,X=I.avail_in,q=k.hold,N=k.bits,Y=X,Z=de,re=d;e:for(;;)switch(k.mode){case p:if(k.wrap===0){k.mode=13;break}for(;N<16;){if(X===0)break e;X--,q+=G[W++]<<N,N+=8}if(2&k.wrap&&q===35615){E[k.check=0]=255&q,E[1]=q>>>8&255,k.check=a(k.check,E,2,0),N=q=0,k.mode=2;break}if(k.flags=0,k.head&&(k.head.done=!1),!(1&k.wrap)||(((255&q)<<8)+(q>>8))%31){I.msg="incorrect header check",k.mode=30;break}if((15&q)!=8){I.msg="unknown compression method",k.mode=30;break}if(N-=4,T=8+(15&(q>>>=4)),k.wbits===0)k.wbits=T;else if(T>k.wbits){I.msg="invalid window size",k.mode=30;break}k.dmax=1<<T,I.adler=k.check=1,k.mode=512&q?10:12,N=q=0;break;case 2:for(;N<16;){if(X===0)break e;X--,q+=G[W++]<<N,N+=8}if(k.flags=q,(255&k.flags)!=8){I.msg="unknown compression method",k.mode=30;break}if(57344&k.flags){I.msg="unknown header flags set",k.mode=30;break}k.head&&(k.head.text=q>>8&1),512&k.flags&&(E[0]=255&q,E[1]=q>>>8&255,k.check=a(k.check,E,2,0)),N=q=0,k.mode=3;case 3:for(;N<32;){if(X===0)break e;X--,q+=G[W++]<<N,N+=8}k.head&&(k.head.time=q),512&k.flags&&(E[0]=255&q,E[1]=q>>>8&255,E[2]=q>>>16&255,E[3]=q>>>24&255,k.check=a(k.check,E,4,0)),N=q=0,k.mode=4;case 4:for(;N<16;){if(X===0)break e;X--,q+=G[W++]<<N,N+=8}k.head&&(k.head.xflags=255&q,k.head.os=q>>8),512&k.flags&&(E[0]=255&q,E[1]=q>>>8&255,k.check=a(k.check,E,2,0)),N=q=0,k.mode=5;case 5:if(1024&k.flags){for(;N<16;){if(X===0)break e;X--,q+=G[W++]<<N,N+=8}k.length=q,k.head&&(k.head.extra_len=q),512&k.flags&&(E[0]=255&q,E[1]=q>>>8&255,k.check=a(k.check,E,2,0)),N=q=0}else k.head&&(k.head.extra=null);k.mode=6;case 6:if(1024&k.flags&&(X<(ie=k.length)&&(ie=X),ie&&(k.head&&(T=k.head.extra_len-k.length,k.head.extra||(k.head.extra=new Array(k.head.extra_len)),o.arraySet(k.head.extra,G,W,ie,T)),512&k.flags&&(k.check=a(k.check,G,ie,W)),X-=ie,W+=ie,k.length-=ie),k.length))break e;k.length=0,k.mode=7;case 7:if(2048&k.flags){if(X===0)break e;for(ie=0;T=G[W+ie++],k.head&&T&&k.length<65536&&(k.head.name+=String.fromCharCode(T)),T&&ie<X;);if(512&k.flags&&(k.check=a(k.check,G,ie,W)),X-=ie,W+=ie,T)break e}else k.head&&(k.head.name=null);k.length=0,k.mode=8;case 8:if(4096&k.flags){if(X===0)break e;for(ie=0;T=G[W+ie++],k.head&&T&&k.length<65536&&(k.head.comment+=String.fromCharCode(T)),T&&ie<X;);if(512&k.flags&&(k.check=a(k.check,G,ie,W)),X-=ie,W+=ie,T)break e}else k.head&&(k.head.comment=null);k.mode=9;case 9:if(512&k.flags){for(;N<16;){if(X===0)break e;X--,q+=G[W++]<<N,N+=8}if(q!==(65535&k.check)){I.msg="header crc mismatch",k.mode=30;break}N=q=0}k.head&&(k.head.hcrc=k.flags>>9&1,k.head.done=!0),I.adler=k.check=0,k.mode=12;break;case 10:for(;N<32;){if(X===0)break e;X--,q+=G[W++]<<N,N+=8}I.adler=k.check=g(q),N=q=0,k.mode=11;case 11:if(k.havedict===0)return I.next_out=ae,I.avail_out=de,I.next_in=W,I.avail_in=X,k.hold=q,k.bits=N,2;I.adler=k.check=1,k.mode=12;case 12:if(U===5||U===6)break e;case 13:if(k.last){q>>>=7&N,N-=7&N,k.mode=27;break}for(;N<3;){if(X===0)break e;X--,q+=G[W++]<<N,N+=8}switch(k.last=1&q,N-=1,3&(q>>>=1)){case 0:k.mode=14;break;case 1:if(V(k),k.mode=20,U!==6)break;q>>>=2,N-=2;break e;case 2:k.mode=17;break;case 3:I.msg="invalid block type",k.mode=30}q>>>=2,N-=2;break;case 14:for(q>>>=7&N,N-=7&N;N<32;){if(X===0)break e;X--,q+=G[W++]<<N,N+=8}if((65535&q)!=(q>>>16^65535)){I.msg="invalid stored block lengths",k.mode=30;break}if(k.length=65535&q,N=q=0,k.mode=15,U===6)break e;case 15:k.mode=16;case 16:if(ie=k.length){if(X<ie&&(ie=X),de<ie&&(ie=de),ie===0)break e;o.arraySet(te,G,W,ie,ae),X-=ie,W+=ie,de-=ie,ae+=ie,k.length-=ie;break}k.mode=12;break;case 17:for(;N<14;){if(X===0)break e;X--,q+=G[W++]<<N,N+=8}if(k.nlen=257+(31&q),q>>>=5,N-=5,k.ndist=1+(31&q),q>>>=5,N-=5,k.ncode=4+(15&q),q>>>=4,N-=4,286<k.nlen||30<k.ndist){I.msg="too many length or distance symbols",k.mode=30;break}k.have=0,k.mode=18;case 18:for(;k.have<k.ncode;){for(;N<3;){if(X===0)break e;X--,q+=G[W++]<<N,N+=8}k.lens[B[k.have++]]=7&q,q>>>=3,N-=3}for(;k.have<19;)k.lens[B[k.have++]]=0;if(k.lencode=k.lendyn,k.lenbits=7,R={bits:k.lenbits},re=c(0,k.lens,0,19,k.lencode,0,k.work,R),k.lenbits=R.bits,re){I.msg="invalid code lengths set",k.mode=30;break}k.have=0,k.mode=19;case 19:for(;k.have<k.nlen+k.ndist;){for(;z=(w=k.lencode[q&(1<<k.lenbits)-1])>>>16&255,j=65535&w,!((C=w>>>24)<=N);){if(X===0)break e;X--,q+=G[W++]<<N,N+=8}if(j<16)q>>>=C,N-=C,k.lens[k.have++]=j;else{if(j===16){for(v=C+2;N<v;){if(X===0)break e;X--,q+=G[W++]<<N,N+=8}if(q>>>=C,N-=C,k.have===0){I.msg="invalid bit length repeat",k.mode=30;break}T=k.lens[k.have-1],ie=3+(3&q),q>>>=2,N-=2}else if(j===17){for(v=C+3;N<v;){if(X===0)break e;X--,q+=G[W++]<<N,N+=8}N-=C,T=0,ie=3+(7&(q>>>=C)),q>>>=3,N-=3}else{for(v=C+7;N<v;){if(X===0)break e;X--,q+=G[W++]<<N,N+=8}N-=C,T=0,ie=11+(127&(q>>>=C)),q>>>=7,N-=7}if(k.have+ie>k.nlen+k.ndist){I.msg="invalid bit length repeat",k.mode=30;break}for(;ie--;)k.lens[k.have++]=T}}if(k.mode===30)break;if(k.lens[256]===0){I.msg="invalid code -- missing end-of-block",k.mode=30;break}if(k.lenbits=9,R={bits:k.lenbits},re=c(u,k.lens,0,k.nlen,k.lencode,0,k.work,R),k.lenbits=R.bits,re){I.msg="invalid literal/lengths set",k.mode=30;break}if(k.distbits=6,k.distcode=k.distdyn,R={bits:k.distbits},re=c(f,k.lens,k.nlen,k.ndist,k.distcode,0,k.work,R),k.distbits=R.bits,re){I.msg="invalid distances set",k.mode=30;break}if(k.mode=20,U===6)break e;case 20:k.mode=21;case 21:if(6<=X&&258<=de){I.next_out=ae,I.avail_out=de,I.next_in=W,I.avail_in=X,k.hold=q,k.bits=N,l(I,Z),ae=I.next_out,te=I.output,de=I.avail_out,W=I.next_in,G=I.input,X=I.avail_in,q=k.hold,N=k.bits,k.mode===12&&(k.back=-1);break}for(k.back=0;z=(w=k.lencode[q&(1<<k.lenbits)-1])>>>16&255,j=65535&w,!((C=w>>>24)<=N);){if(X===0)break e;X--,q+=G[W++]<<N,N+=8}if(z&&!(240&z)){for(P=C,F=z,ne=j;z=(w=k.lencode[ne+((q&(1<<P+F)-1)>>P)])>>>16&255,j=65535&w,!(P+(C=w>>>24)<=N);){if(X===0)break e;X--,q+=G[W++]<<N,N+=8}q>>>=P,N-=P,k.back+=P}if(q>>>=C,N-=C,k.back+=C,k.length=j,z===0){k.mode=26;break}if(32&z){k.back=-1,k.mode=12;break}if(64&z){I.msg="invalid literal/length code",k.mode=30;break}k.extra=15&z,k.mode=22;case 22:if(k.extra){for(v=k.extra;N<v;){if(X===0)break e;X--,q+=G[W++]<<N,N+=8}k.length+=q&(1<<k.extra)-1,q>>>=k.extra,N-=k.extra,k.back+=k.extra}k.was=k.length,k.mode=23;case 23:for(;z=(w=k.distcode[q&(1<<k.distbits)-1])>>>16&255,j=65535&w,!((C=w>>>24)<=N);){if(X===0)break e;X--,q+=G[W++]<<N,N+=8}if(!(240&z)){for(P=C,F=z,ne=j;z=(w=k.distcode[ne+((q&(1<<P+F)-1)>>P)])>>>16&255,j=65535&w,!(P+(C=w>>>24)<=N);){if(X===0)break e;X--,q+=G[W++]<<N,N+=8}q>>>=P,N-=P,k.back+=P}if(q>>>=C,N-=C,k.back+=C,64&z){I.msg="invalid distance code",k.mode=30;break}k.offset=j,k.extra=15&z,k.mode=24;case 24:if(k.extra){for(v=k.extra;N<v;){if(X===0)break e;X--,q+=G[W++]<<N,N+=8}k.offset+=q&(1<<k.extra)-1,q>>>=k.extra,N-=k.extra,k.back+=k.extra}if(k.offset>k.dmax){I.msg="invalid distance too far back",k.mode=30;break}k.mode=25;case 25:if(de===0)break e;if(ie=Z-de,k.offset>ie){if((ie=k.offset-ie)>k.whave&&k.sane){I.msg="invalid distance too far back",k.mode=30;break}K=ie>k.wnext?(ie-=k.wnext,k.wsize-ie):k.wnext-ie,ie>k.length&&(ie=k.length),_=k.window}else _=te,K=ae-k.offset,ie=k.length;for(de<ie&&(ie=de),de-=ie,k.length-=ie;te[ae++]=_[K++],--ie;);k.length===0&&(k.mode=21);break;case 26:if(de===0)break e;te[ae++]=k.length,de--,k.mode=21;break;case 27:if(k.wrap){for(;N<32;){if(X===0)break e;X--,q|=G[W++]<<N,N+=8}if(Z-=de,I.total_out+=Z,k.total+=Z,Z&&(I.adler=k.check=k.flags?a(k.check,te,Z,ae-Z):s(k.check,te,Z,ae-Z)),Z=de,(k.flags?q:g(q))!==k.check){I.msg="incorrect data check",k.mode=30;break}N=q=0}k.mode=28;case 28:if(k.wrap&&k.flags){for(;N<32;){if(X===0)break e;X--,q+=G[W++]<<N,N+=8}if(q!==(4294967295&k.total)){I.msg="incorrect length check",k.mode=30;break}N=q=0}k.mode=29;case 29:re=1;break e;case 30:re=-3;break e;case 31:return-4;case 32:default:return h}return I.next_out=ae,I.avail_out=de,I.next_in=W,I.avail_in=X,k.hold=q,k.bits=N,(k.wsize||Z!==I.avail_out&&k.mode<30&&(k.mode<27||U!==4))&&Q(I,I.output,I.next_out,Z-I.avail_out)?(k.mode=31,-4):(Y-=I.avail_in,Z-=I.avail_out,I.total_in+=Y,I.total_out+=Z,k.total+=Z,k.wrap&&Z&&(I.adler=k.check=k.flags?a(k.check,te,Z,I.next_out-Z):s(k.check,te,Z,I.next_out-Z)),I.data_type=k.bits+(k.last?64:0)+(k.mode===12?128:0)+(k.mode===20||k.mode===15?256:0),(Y==0&&Z===0||U===4)&&re===d&&(re=-5),re)},i.inflateEnd=function(I){if(!I||!I.state)return h;var U=I.state;return U.window&&(U.window=null),I.state=null,d},i.inflateGetHeader=function(I,U){var k;return I&&I.state&&2&(k=I.state).wrap?((k.head=U).done=!1,d):h},i.inflateSetDictionary=function(I,U){var k,G=U.length;return I&&I.state?(k=I.state).wrap!==0&&k.mode!==11?h:k.mode===11&&s(1,U,G,0)!==k.check?-3:Q(I,U,G,G)?(k.mode=31,-4):(k.havedict=1,d):h},i.inflateInfo="pako inflate (from Nodeca project)"},{"../utils/common":41,"./adler32":43,"./crc32":45,"./inffast":48,"./inftrees":50}],50:[function(r,n,i){var o=r("../utils/common"),s=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0],a=[16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78],l=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0],c=[16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64];n.exports=function(u,f,d,h,p,m,y,g){var b,S,x,O,M,D,$,A,V,Q=g.bits,I=0,U=0,k=0,G=0,te=0,W=0,ae=0,X=0,de=0,q=0,N=null,Y=0,Z=new o.Buf16(16),ie=new o.Buf16(16),K=null,_=0;for(I=0;I<=15;I++)Z[I]=0;for(U=0;U<h;U++)Z[f[d+U]]++;for(te=Q,G=15;1<=G&&Z[G]===0;G--);if(G<te&&(te=G),G===0)return p[m++]=20971520,p[m++]=20971520,g.bits=1,0;for(k=1;k<G&&Z[k]===0;k++);for(te<k&&(te=k),I=X=1;I<=15;I++)if(X<<=1,(X-=Z[I])<0)return-1;if(0<X&&(u===0||G!==1))return-1;for(ie[1]=0,I=1;I<15;I++)ie[I+1]=ie[I]+Z[I];for(U=0;U<h;U++)f[d+U]!==0&&(y[ie[f[d+U]]++]=U);if(D=u===0?(N=K=y,19):u===1?(N=s,Y-=257,K=a,_-=257,256):(N=l,K=c,-1),I=k,M=m,ae=U=q=0,x=-1,O=(de=1<<(W=te))-1,u===1&&852<de||u===2&&592<de)return 1;for(;;){for($=I-ae,V=y[U]<D?(A=0,y[U]):y[U]>D?(A=K[_+y[U]],N[Y+y[U]]):(A=96,0),b=1<<I-ae,k=S=1<<W;p[M+(q>>ae)+(S-=b)]=$<<24|A<<16|V|0,S!==0;);for(b=1<<I-1;q&b;)b>>=1;if(b!==0?(q&=b-1,q+=b):q=0,U++,--Z[I]==0){if(I===G)break;I=f[d+y[U]]}if(te<I&&(q&O)!==x){for(ae===0&&(ae=te),M+=k,X=1<<(W=I-ae);W+ae<G&&!((X-=Z[W+ae])<=0);)W++,X<<=1;if(de+=1<<W,u===1&&852<de||u===2&&592<de)return 1;p[x=q&O]=te<<24|W<<16|M-m|0}}return q!==0&&(p[M+q]=I-ae<<24|64<<16|0),g.bits=te,0}},{"../utils/common":41}],51:[function(r,n,i){n.exports={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"}},{}],52:[function(r,n,i){var o=r("../utils/common"),s=0,a=1;function l(w){for(var E=w.length;0<=--E;)w[E]=0}var c=0,u=29,f=256,d=f+1+u,h=30,p=19,m=2*d+1,y=15,g=16,b=7,S=256,x=16,O=17,M=18,D=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0],$=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],A=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],V=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],Q=new Array(2*(d+2));l(Q);var I=new Array(2*h);l(I);var U=new Array(512);l(U);var k=new Array(256);l(k);var G=new Array(u);l(G);var te,W,ae,X=new Array(h);function de(w,E,B,J,H){this.static_tree=w,this.extra_bits=E,this.extra_base=B,this.elems=J,this.max_length=H,this.has_stree=w&&w.length}function q(w,E){this.dyn_tree=w,this.max_code=0,this.stat_desc=E}function N(w){return w<256?U[w]:U[256+(w>>>7)]}function Y(w,E){w.pending_buf[w.pending++]=255&E,w.pending_buf[w.pending++]=E>>>8&255}function Z(w,E,B){w.bi_valid>g-B?(w.bi_buf|=E<<w.bi_valid&65535,Y(w,w.bi_buf),w.bi_buf=E>>g-w.bi_valid,w.bi_valid+=B-g):(w.bi_buf|=E<<w.bi_valid&65535,w.bi_valid+=B)}function ie(w,E,B){Z(w,B[2*E],B[2*E+1])}function K(w,E){for(var B=0;B|=1&w,w>>>=1,B<<=1,0<--E;);return B>>>1}function _(w,E,B){var J,H,ce=new Array(y+1),me=0;for(J=1;J<=y;J++)ce[J]=me=me+B[J-1]<<1;for(H=0;H<=E;H++){var fe=w[2*H+1];fe!==0&&(w[2*H]=K(ce[fe]++,fe))}}function C(w){var E;for(E=0;E<d;E++)w.dyn_ltree[2*E]=0;for(E=0;E<h;E++)w.dyn_dtree[2*E]=0;for(E=0;E<p;E++)w.bl_tree[2*E]=0;w.dyn_ltree[2*S]=1,w.opt_len=w.static_len=0,w.last_lit=w.matches=0}function z(w){8<w.bi_valid?Y(w,w.bi_buf):0<w.bi_valid&&(w.pending_buf[w.pending++]=w.bi_buf),w.bi_buf=0,w.bi_valid=0}function j(w,E,B,J){var H=2*E,ce=2*B;return w[H]<w[ce]||w[H]===w[ce]&&J[E]<=J[B]}function P(w,E,B){for(var J=w.heap[B],H=B<<1;H<=w.heap_len&&(H<w.heap_len&&j(E,w.heap[H+1],w.heap[H],w.depth)&&H++,!j(E,J,w.heap[H],w.depth));)w.heap[B]=w.heap[H],B=H,H<<=1;w.heap[B]=J}function F(w,E,B){var J,H,ce,me,fe=0;if(w.last_lit!==0)for(;J=w.pending_buf[w.d_buf+2*fe]<<8|w.pending_buf[w.d_buf+2*fe+1],H=w.pending_buf[w.l_buf+fe],fe++,J===0?ie(w,H,E):(ie(w,(ce=k[H])+f+1,E),(me=D[ce])!==0&&Z(w,H-=G[ce],me),ie(w,ce=N(--J),B),(me=$[ce])!==0&&Z(w,J-=X[ce],me)),fe<w.last_lit;);ie(w,S,E)}function ne(w,E){var B,J,H,ce=E.dyn_tree,me=E.stat_desc.static_tree,fe=E.stat_desc.has_stree,ve=E.stat_desc.elems,Te=-1;for(w.heap_len=0,w.heap_max=m,B=0;B<ve;B++)ce[2*B]!==0?(w.heap[++w.heap_len]=Te=B,w.depth[B]=0):ce[2*B+1]=0;for(;w.heap_len<2;)ce[2*(H=w.heap[++w.heap_len]=Te<2?++Te:0)]=1,w.depth[H]=0,w.opt_len--,fe&&(w.static_len-=me[2*H+1]);for(E.max_code=Te,B=w.heap_len>>1;1<=B;B--)P(w,ce,B);for(H=ve;B=w.heap[1],w.heap[1]=w.heap[w.heap_len--],P(w,ce,1),J=w.heap[1],w.heap[--w.heap_max]=B,w.heap[--w.heap_max]=J,ce[2*H]=ce[2*B]+ce[2*J],w.depth[H]=(w.depth[B]>=w.depth[J]?w.depth[B]:w.depth[J])+1,ce[2*B+1]=ce[2*J+1]=H,w.heap[1]=H++,P(w,ce,1),2<=w.heap_len;);w.heap[--w.heap_max]=w.heap[1],function(Oe,xt){var Rr,sr,Ii,rt,ue,Se,Ce=xt.dyn_tree,He=xt.max_code,Fe=xt.stat_desc.static_tree,St=xt.stat_desc.has_stree,Wt=xt.stat_desc.extra_bits,ln=xt.stat_desc.extra_base,Fn=xt.stat_desc.max_length,ar=0;for(rt=0;rt<=y;rt++)Oe.bl_count[rt]=0;for(Ce[2*Oe.heap[Oe.heap_max]+1]=0,Rr=Oe.heap_max+1;Rr<m;Rr++)Fn<(rt=Ce[2*Ce[2*(sr=Oe.heap[Rr])+1]+1]+1)&&(rt=Fn,ar++),Ce[2*sr+1]=rt,He<sr||(Oe.bl_count[rt]++,ue=0,ln<=sr&&(ue=Wt[sr-ln]),Se=Ce[2*sr],Oe.opt_len+=Se*(rt+ue),St&&(Oe.static_len+=Se*(Fe[2*sr+1]+ue)));if(ar!==0){do{for(rt=Fn-1;Oe.bl_count[rt]===0;)rt--;Oe.bl_count[rt]--,Oe.bl_count[rt+1]+=2,Oe.bl_count[Fn]--,ar-=2}while(0<ar);for(rt=Fn;rt!==0;rt--)for(sr=Oe.bl_count[rt];sr!==0;)He<(Ii=Oe.heap[--Rr])||(Ce[2*Ii+1]!==rt&&(Oe.opt_len+=(rt-Ce[2*Ii+1])*Ce[2*Ii],Ce[2*Ii+1]=rt),sr--)}}(w,E),_(ce,Te,w.bl_count)}function T(w,E,B){var J,H,ce=-1,me=E[1],fe=0,ve=7,Te=4;for(me===0&&(ve=138,Te=3),E[2*(B+1)+1]=65535,J=0;J<=B;J++)H=me,me=E[2*(J+1)+1],++fe<ve&&H===me||(fe<Te?w.bl_tree[2*H]+=fe:H!==0?(H!==ce&&w.bl_tree[2*H]++,w.bl_tree[2*x]++):fe<=10?w.bl_tree[2*O]++:w.bl_tree[2*M]++,ce=H,Te=(fe=0)===me?(ve=138,3):H===me?(ve=6,3):(ve=7,4))}function re(w,E,B){var J,H,ce=-1,me=E[1],fe=0,ve=7,Te=4;for(me===0&&(ve=138,Te=3),J=0;J<=B;J++)if(H=me,me=E[2*(J+1)+1],!(++fe<ve&&H===me)){if(fe<Te)for(;ie(w,H,w.bl_tree),--fe!=0;);else H!==0?(H!==ce&&(ie(w,H,w.bl_tree),fe--),ie(w,x,w.bl_tree),Z(w,fe-3,2)):fe<=10?(ie(w,O,w.bl_tree),Z(w,fe-3,3)):(ie(w,M,w.bl_tree),Z(w,fe-11,7));ce=H,Te=(fe=0)===me?(ve=138,3):H===me?(ve=6,3):(ve=7,4)}}l(X);var R=!1;function v(w,E,B,J){Z(w,(c<<1)+(J?1:0),3),function(H,ce,me,fe){z(H),Y(H,me),Y(H,~me),o.arraySet(H.pending_buf,H.window,ce,me,H.pending),H.pending+=me}(w,E,B)}i._tr_init=function(w){R||(function(){var E,B,J,H,ce,me=new Array(y+1);for(H=J=0;H<u-1;H++)for(G[H]=J,E=0;E<1<<D[H];E++)k[J++]=H;for(k[J-1]=H,H=ce=0;H<16;H++)for(X[H]=ce,E=0;E<1<<$[H];E++)U[ce++]=H;for(ce>>=7;H<h;H++)for(X[H]=ce<<7,E=0;E<1<<$[H]-7;E++)U[256+ce++]=H;for(B=0;B<=y;B++)me[B]=0;for(E=0;E<=143;)Q[2*E+1]=8,E++,me[8]++;for(;E<=255;)Q[2*E+1]=9,E++,me[9]++;for(;E<=279;)Q[2*E+1]=7,E++,me[7]++;for(;E<=287;)Q[2*E+1]=8,E++,me[8]++;for(_(Q,d+1,me),E=0;E<h;E++)I[2*E+1]=5,I[2*E]=K(E,5);te=new de(Q,D,f+1,d,y),W=new de(I,$,0,h,y),ae=new de(new Array(0),A,0,p,b)}(),R=!0),w.l_desc=new q(w.dyn_ltree,te),w.d_desc=new q(w.dyn_dtree,W),w.bl_desc=new q(w.bl_tree,ae),w.bi_buf=0,w.bi_valid=0,C(w)},i._tr_stored_block=v,i._tr_flush_block=function(w,E,B,J){var H,ce,me=0;0<w.level?(w.strm.data_type===2&&(w.strm.data_type=function(fe){var ve,Te=4093624447;for(ve=0;ve<=31;ve++,Te>>>=1)if(1&Te&&fe.dyn_ltree[2*ve]!==0)return s;if(fe.dyn_ltree[18]!==0||fe.dyn_ltree[20]!==0||fe.dyn_ltree[26]!==0)return a;for(ve=32;ve<f;ve++)if(fe.dyn_ltree[2*ve]!==0)return a;return s}(w)),ne(w,w.l_desc),ne(w,w.d_desc),me=function(fe){var ve;for(T(fe,fe.dyn_ltree,fe.l_desc.max_code),T(fe,fe.dyn_dtree,fe.d_desc.max_code),ne(fe,fe.bl_desc),ve=p-1;3<=ve&&fe.bl_tree[2*V[ve]+1]===0;ve--);return fe.opt_len+=3*(ve+1)+5+5+4,ve}(w),H=w.opt_len+3+7>>>3,(ce=w.static_len+3+7>>>3)<=H&&(H=ce)):H=ce=B+5,B+4<=H&&E!==-1?v(w,E,B,J):w.strategy===4||ce===H?(Z(w,2+(J?1:0),3),F(w,Q,I)):(Z(w,4+(J?1:0),3),function(fe,ve,Te,Oe){var xt;for(Z(fe,ve-257,5),Z(fe,Te-1,5),Z(fe,Oe-4,4),xt=0;xt<Oe;xt++)Z(fe,fe.bl_tree[2*V[xt]+1],3);re(fe,fe.dyn_ltree,ve-1),re(fe,fe.dyn_dtree,Te-1)}(w,w.l_desc.max_code+1,w.d_desc.max_code+1,me+1),F(w,w.dyn_ltree,w.dyn_dtree)),C(w),J&&z(w)},i._tr_tally=function(w,E,B){return w.pending_buf[w.d_buf+2*w.last_lit]=E>>>8&255,w.pending_buf[w.d_buf+2*w.last_lit+1]=255&E,w.pending_buf[w.l_buf+w.last_lit]=255&B,w.last_lit++,E===0?w.dyn_ltree[2*B]++:(w.matches++,E--,w.dyn_ltree[2*(k[B]+f+1)]++,w.dyn_dtree[2*N(E)]++),w.last_lit===w.lit_bufsize-1},i._tr_align=function(w){Z(w,2,3),ie(w,S,Q),function(E){E.bi_valid===16?(Y(E,E.bi_buf),E.bi_buf=0,E.bi_valid=0):8<=E.bi_valid&&(E.pending_buf[E.pending++]=255&E.bi_buf,E.bi_buf>>=8,E.bi_valid-=8)}(w)}},{"../utils/common":41}],53:[function(r,n,i){n.exports=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}},{}],54:[function(r,n,i){(function(o){(function(s,a){if(!s.setImmediate){var l,c,u,f,d=1,h={},p=!1,m=s.document,y=Object.getPrototypeOf&&Object.getPrototypeOf(s);y=y&&y.setTimeout?y:s,l={}.toString.call(s.process)==="[object process]"?function(x){Pe.nextTick(function(){b(x)})}:function(){if(s.postMessage&&!s.importScripts){var x=!0,O=s.onmessage;return s.onmessage=function(){x=!1},s.postMessage("","*"),s.onmessage=O,x}}()?(f="setImmediate$"+Math.random()+"$",s.addEventListener?s.addEventListener("message",S,!1):s.attachEvent("onmessage",S),function(x){s.postMessage(f+x,"*")}):s.MessageChannel?((u=new MessageChannel).port1.onmessage=function(x){b(x.data)},function(x){u.port2.postMessage(x)}):m&&"onreadystatechange"in m.createElement("script")?(c=m.documentElement,function(x){var O=m.createElement("script");O.onreadystatechange=function(){b(x),O.onreadystatechange=null,c.removeChild(O),O=null},c.appendChild(O)}):function(x){setTimeout(b,0,x)},y.setImmediate=function(x){typeof x!="function"&&(x=new Function(""+x));for(var O=new Array(arguments.length-1),M=0;M<O.length;M++)O[M]=arguments[M+1];var D={callback:x,args:O};return h[d]=D,l(d),d++},y.clearImmediate=g}function g(x){delete h[x]}function b(x){if(p)setTimeout(b,0,x);else{var O=h[x];if(O){p=!0;try{(function(M){var D=M.callback,$=M.args;switch($.length){case 0:D();break;case 1:D($[0]);break;case 2:D($[0],$[1]);break;case 3:D($[0],$[1],$[2]);break;default:D.apply(a,$)}})(O)}finally{g(x),p=!1}}}}function S(x){x.source===s&&typeof x.data=="string"&&x.data.indexOf(f)===0&&b(+x.data.slice(f.length))}})(typeof self>"u"?o===void 0?this:o:self)}).call(this,typeof Vr<"u"?Vr:typeof self<"u"?self:typeof window<"u"?window:{})},{}]},{},[10])(10)})})(DI);var fse=DI.exports;const dse=SM(fse);var gf={exports:{}},hse={"&":"&amp;",'"':"&quot;","'":"&apos;","<":"&lt;",">":"&gt;"};function pse(t){return t&&t.replace?t.replace(/([&"<>'])/g,function(e,r){return hse[r]}):t}var mse=pse,Qg=mse,HE=uw.Stream,gse=" ";function yse(t,e){typeof e!="object"&&(e={indent:e});var r=e.stream?new HE:null,n="",i=!1,o=e.indent?e.indent===!0?gse:e.indent:"",s=!0;function a(d){s?Pe.nextTick(d):d()}function l(d,h){if(h!==void 0&&(n+=h),d&&!i&&(r=r||new HE,i=!0),d&&i){var p=n;a(function(){r.emit("data",p)}),n=""}}function c(d,h){Ew(l,yf(d,o,o?1:0),h)}function u(){if(r){var d=n;a(function(){r.emit("data",d),r.emit("end"),r.readable=!1,r.emit("close")})}}function f(d){var h=d.encoding||"UTF-8",p={version:"1.0",encoding:h};d.standalone&&(p.standalone=d.standalone),c({"?xml":{_attr:p}}),n=n.replace("/>","?>")}return a(function(){s=!1}),e.declaration&&f(e.declaration),t&&t.forEach?t.forEach(function(d,h){var p;h+1===t.length&&(p=u),c(d,p)}):c(t,u),r?(r.readable=!0,r):n}function vse(){var t=Array.prototype.slice.call(arguments),e={_elem:yf(t)};return e.push=function(r){if(!this.append)throw new Error("not assigned to a parent!");var n=this,i=this._elem.indent;Ew(this.append,yf(r,i,this._elem.icount+(i?1:0)),function(){n.append(!0)})},e.close=function(r){r!==void 0&&this.push(r),this.end&&this.end()},e}function wse(t,e){return new Array(e||0).join(t||"")}function yf(t,e,r){r=r||0;var n=wse(e,r),i,o=t,s=!1;if(typeof t=="object"){var a=Object.keys(t);if(i=a[0],o=t[i],o&&o._elem)return o._elem.name=i,o._elem.icount=r,o._elem.indent=e,o._elem.indents=n,o._elem.interrupt=o,o._elem}var l=[],c=[],u;function f(d){var h=Object.keys(d);h.forEach(function(p){l.push(bse(p,d[p]))})}switch(typeof o){case"object":if(o===null)break;o._attr&&f(o._attr),o._cdata&&c.push(("<![CDATA["+o._cdata).replace(/\]\]>/g,"]]]]><![CDATA[>")+"]]>"),o.forEach&&(u=!1,c.push(""),o.forEach(function(d){if(typeof d=="object"){var h=Object.keys(d)[0];h=="_attr"?f(d._attr):c.push(yf(d,e,r+1))}else c.pop(),u=!0,c.push(Qg(d))}),u||c.push(""));break;default:c.push(Qg(o))}return{name:i,interrupt:s,attributes:l,content:c,icount:r,indents:n,indent:e}}function Ew(t,e,r){if(typeof e!="object")return t(!1,e);var n=e.interrupt?1:e.content.length;function i(){for(;e.content.length;){var s=e.content.shift();if(s!==void 0){if(o(s))return;Ew(t,s)}}t(!1,(n>1?e.indents:"")+(e.name?"</"+e.name+">":"")+(e.indent&&!r?`
591
- `:"")),r&&r()}function o(s){return s.interrupt?(s.interrupt.append=t,s.interrupt.end=i,s.interrupt=!1,t(!0),!0):!1}if(t(!1,e.indents+(e.name?"<"+e.name:"")+(e.attributes.length?" "+e.attributes.join(" "):"")+(n?e.name?">":"":e.name?"/>":"")+(e.indent&&n>1?`
592
- `:"")),!n)return t(!1,e.indent?`
593
- `:"");o(e)||i()}function bse(t,e){return t+'="'+Qg(e)+'"'}gf.exports=yse;gf.exports.element=gf.exports.Element=vse;var xse=gf.exports;const at=SM(xse),zE=0,UE=32,Sse=32,Ese=(t,e)=>{const r=e.replace(/-/g,"");if(r.length!==Sse)throw new Error(`Error: Cannot extract GUID from font filename: ${e}`);const i=r.replace(/(..)/g,"$1 ").trim().split(" ").map(l=>parseInt(l,16));i.reverse();const s=t.slice(zE,UE).map((l,c)=>l^i[c%i.length]);return Buffer.concat([t.slice(0,zE),s,t.slice(UE)])};class Tse{format(e,r={stack:[]}){const n=e.prepForXml(r);if(n)return n;throw Error("XMLComponent did not format correctly")}}class Ase{replace(e,r,n){let i=e;return r.forEach((o,s)=>{i=i.replace(new RegExp(`{${o.fileName}}`,"g"),(n+s).toString())}),i}getMediaData(e,r){return r.Array.filter(n=>e.search(`{${n.fileName}}`)>0)}}class Cse{replace(e,r){let n=e;for(const i of r)n=n.replace(new RegExp(`{${i.reference}-${i.instance}}`,"g"),i.numId.toString());return n}}class kse{constructor(){se(this,"formatter"),se(this,"imageReplacer"),se(this,"numberingReplacer"),this.formatter=new Tse,this.imageReplacer=new Ase,this.numberingReplacer=new Cse}compile(e,r){const n=new dse,i=this.xmlifyFile(e,r),o=new Map(Object.entries(i));for(const[,s]of o)if(Array.isArray(s))for(const a of s)n.file(a.path,a.data);else n.file(s.path,s.data);for(const{stream:s,fileName:a}of e.Media.Array)n.file(`word/media/${a}`,s);for(const{data:s,name:a,fontKey:l}of e.FontTable.fontOptionsWithKey){const[c]=a.split(".");n.file(`word/fonts/${c}.odttf`,Ese(s,l))}return n}xmlifyFile(e,r){const n=e.Document.Relationships.RelationshipCount+1,i=at(this.formatter.format(e.Document.View,{viewWrapper:e.Document,file:e,stack:[]}),{indent:r,declaration:{standalone:"yes",encoding:"UTF-8"}}),o=this.imageReplacer.getMediaData(i,e.Media);return{Relationships:{data:(o.forEach((s,a)=>{e.Document.Relationships.createRelationship(n+a,"http://schemas.openxmlformats.org/officeDocument/2006/relationships/image",`media/${s.fileName}`)}),at(this.formatter.format(e.Document.Relationships,{viewWrapper:e.Document,file:e,stack:[]}),{indent:r,declaration:{encoding:"UTF-8"}})),path:"word/_rels/document.xml.rels"},Document:{data:(()=>{const s=this.imageReplacer.replace(i,o,n);return this.numberingReplacer.replace(s,e.Numbering.ConcreteNumbering)})(),path:"word/document.xml"},Styles:{data:(()=>{const s=at(this.formatter.format(e.Styles,{viewWrapper:e.Document,file:e,stack:[]}),{indent:r,declaration:{standalone:"yes",encoding:"UTF-8"}});return this.numberingReplacer.replace(s,e.Numbering.ConcreteNumbering)})(),path:"word/styles.xml"},Properties:{data:at(this.formatter.format(e.CoreProperties,{viewWrapper:e.Document,file:e,stack:[]}),{indent:r,declaration:{standalone:"yes",encoding:"UTF-8"}}),path:"docProps/core.xml"},Numbering:{data:at(this.formatter.format(e.Numbering,{viewWrapper:e.Document,file:e,stack:[]}),{indent:r,declaration:{standalone:"yes",encoding:"UTF-8"}}),path:"word/numbering.xml"},FileRelationships:{data:at(this.formatter.format(e.FileRelationships,{viewWrapper:e.Document,file:e,stack:[]}),{indent:r,declaration:{encoding:"UTF-8"}}),path:"_rels/.rels"},HeaderRelationships:e.Headers.map((s,a)=>{const l=at(this.formatter.format(s.View,{viewWrapper:s,file:e,stack:[]}),{indent:r,declaration:{encoding:"UTF-8"}});return this.imageReplacer.getMediaData(l,e.Media).forEach((u,f)=>{s.Relationships.createRelationship(f,"http://schemas.openxmlformats.org/officeDocument/2006/relationships/image",`media/${u.fileName}`)}),{data:at(this.formatter.format(s.Relationships,{viewWrapper:s,file:e,stack:[]}),{indent:r,declaration:{encoding:"UTF-8"}}),path:`word/_rels/header${a+1}.xml.rels`}}),FooterRelationships:e.Footers.map((s,a)=>{const l=at(this.formatter.format(s.View,{viewWrapper:s,file:e,stack:[]}),{indent:r,declaration:{encoding:"UTF-8"}});return this.imageReplacer.getMediaData(l,e.Media).forEach((u,f)=>{s.Relationships.createRelationship(f,"http://schemas.openxmlformats.org/officeDocument/2006/relationships/image",`media/${u.fileName}`)}),{data:at(this.formatter.format(s.Relationships,{viewWrapper:s,file:e,stack:[]}),{indent:r,declaration:{encoding:"UTF-8"}}),path:`word/_rels/footer${a+1}.xml.rels`}}),Headers:e.Headers.map((s,a)=>{const l=at(this.formatter.format(s.View,{viewWrapper:s,file:e,stack:[]}),{indent:r,declaration:{encoding:"UTF-8"}}),c=this.imageReplacer.getMediaData(l,e.Media),u=this.imageReplacer.replace(l,c,0);return{data:this.numberingReplacer.replace(u,e.Numbering.ConcreteNumbering),path:`word/header${a+1}.xml`}}),Footers:e.Footers.map((s,a)=>{const l=at(this.formatter.format(s.View,{viewWrapper:s,file:e,stack:[]}),{indent:r,declaration:{encoding:"UTF-8"}}),c=this.imageReplacer.getMediaData(l,e.Media),u=this.imageReplacer.replace(l,c,0);return{data:this.numberingReplacer.replace(u,e.Numbering.ConcreteNumbering),path:`word/footer${a+1}.xml`}}),ContentTypes:{data:at(this.formatter.format(e.ContentTypes,{viewWrapper:e.Document,file:e,stack:[]}),{indent:r,declaration:{encoding:"UTF-8"}}),path:"[Content_Types].xml"},CustomProperties:{data:at(this.formatter.format(e.CustomProperties,{viewWrapper:e.Document,file:e,stack:[]}),{indent:r,declaration:{standalone:"yes",encoding:"UTF-8"}}),path:"docProps/custom.xml"},AppProperties:{data:at(this.formatter.format(e.AppProperties,{viewWrapper:e.Document,file:e,stack:[]}),{indent:r,declaration:{standalone:"yes",encoding:"UTF-8"}}),path:"docProps/app.xml"},FootNotes:{data:at(this.formatter.format(e.FootNotes.View,{viewWrapper:e.FootNotes,file:e,stack:[]}),{indent:r,declaration:{encoding:"UTF-8"}}),path:"word/footnotes.xml"},FootNotesRelationships:{data:at(this.formatter.format(e.FootNotes.Relationships,{viewWrapper:e.FootNotes,file:e,stack:[]}),{indent:r,declaration:{encoding:"UTF-8"}}),path:"word/_rels/footnotes.xml.rels"},Settings:{data:at(this.formatter.format(e.Settings,{viewWrapper:e.Document,file:e,stack:[]}),{indent:r,declaration:{standalone:"yes",encoding:"UTF-8"}}),path:"word/settings.xml"},Comments:{data:at(this.formatter.format(e.Comments,{viewWrapper:e.Document,file:e,stack:[]}),{indent:r,declaration:{standalone:"yes",encoding:"UTF-8"}}),path:"word/comments.xml"},FontTable:{data:at(this.formatter.format(e.FontTable.View,{viewWrapper:e.Document,file:e,stack:[]}),{indent:r,declaration:{standalone:"yes",encoding:"UTF-8"}}),path:"word/fontTable.xml"},FontTableRelationships:{data:at(this.formatter.format(e.FontTable.Relationships,{viewWrapper:e.Document,file:e,stack:[]}),{indent:r,declaration:{encoding:"UTF-8"}}),path:"word/_rels/fontTable.xml.rels"}}}}const _se={NONE:"",WITH_2_BLANKS:" ",WITH_4_BLANKS:" ",WITH_TAB:" "},ra=t=>t===!0?_se.WITH_2_BLANKS:t===!1?void 0:t;class PI{static toString(e,r){return uc(this,null,function*(){return yield this.compiler.compile(e,ra(r)).generateAsync({type:"string",mimeType:"application/vnd.openxmlformats-officedocument.wordprocessingml.document",compression:"DEFLATE"})})}static toBuffer(e,r){return uc(this,null,function*(){return yield this.compiler.compile(e,ra(r)).generateAsync({type:"nodebuffer",mimeType:"application/vnd.openxmlformats-officedocument.wordprocessingml.document",compression:"DEFLATE"})})}static toBase64String(e,r){return uc(this,null,function*(){return yield this.compiler.compile(e,ra(r)).generateAsync({type:"base64",mimeType:"application/vnd.openxmlformats-officedocument.wordprocessingml.document",compression:"DEFLATE"})})}static toBlob(e,r){return uc(this,null,function*(){return yield this.compiler.compile(e,ra(r)).generateAsync({type:"blob",mimeType:"application/vnd.openxmlformats-officedocument.wordprocessingml.document",compression:"DEFLATE"})})}static toStream(e,r){const n=new uw.Stream;return this.compiler.compile(e,ra(r)).generateAsync({type:"nodebuffer",mimeType:"application/vnd.openxmlformats-officedocument.wordprocessingml.document",compression:"DEFLATE"}).then(o=>{n.emit("data",o),n.emit("end")}),n}}se(PI,"compiler",new kse);var Tw={exports:{}};function Ose(t){return t.toString("ascii",0,2)==="BM"}function Rse(t){return{width:t.readUInt32LE(18),height:Math.abs(t.readInt32LE(22))}}var Mse={detect:Ose,calculate:Rse},Ise=1,Nse=6,Dse=16;function Pse(t){var e;return t.readUInt16LE(0)!==0?!1:(e=t.readUInt16LE(2),e===Ise)}function WE(t,e){var r=t.readUInt8(e);return r===0?256:r}function VE(t,e){var r=Nse+e*Dse;return{width:WE(t,r),height:WE(t,r+1)}}function Lse(t){var e=t.readUInt16LE(4),r=VE(t,0),n;if(e===1)return r;for(r.images=[{width:r.width,height:r.height}],n=1;n<e;n+=1)r.images.push(VE(t,n));return r}var LI={detect:Pse,calculate:Lse},Fse=2;function Bse(t){var e;return t.readUInt16LE(0)!==0?!1:(e=t.readUInt16LE(2),e===Fse)}var $se={detect:Bse,calculate:LI.calculate};function jse(t){return t.readUInt32LE(0)===542327876}function Hse(t){return{height:t.readUInt32LE(12),width:t.readUInt32LE(16)}}var zse={detect:jse,calculate:Hse},Use=/^GIF8[79]a/;function Wse(t){var e=t.toString("ascii",0,6);return Use.test(e)}function Vse(t){return{width:t.readUInt16LE(6),height:t.readUInt16LE(8)}}var Gse={detect:Wse,calculate:Vse};function Kse(t){var e=t.toString("hex",0,2);return e==="ffd8"}function qse(t,e){return{height:t.readUInt16BE(e),width:t.readUInt16BE(e+2)}}function Xse(t,e){if(e>t.length)throw new TypeError("Corrupt JPG, exceeded buffer limits");if(t[e]!==255)throw new TypeError("Invalid JPG, marker table corrupted")}function Jse(t){t=t.slice(4);for(var e,r;t.length;){if(e=t.readUInt16BE(0),Xse(t,e),r=t[e+1],r===192||r===193||r===194)return qse(t,e+5);t=t.slice(e+2)}throw new TypeError("Invalid JPG, no size found")}var Yse={detect:Kse,calculate:Jse},Zse=`PNG\r
594
- 
595
- `,Qse="IHDR",FI="CgBI";function eae(t){if(Zse===t.toString("ascii",1,8)){var e=t.toString("ascii",12,16);if(e===FI&&(e=t.toString("ascii",28,32)),e!==Qse)throw new TypeError("invalid png");return!0}}function tae(t){return t.toString("ascii",12,16)===FI?{width:t.readUInt32BE(32),height:t.readUInt32BE(36)}:{width:t.readUInt32BE(16),height:t.readUInt32BE(20)}}var rae={detect:eae,calculate:tae};function nae(t){return t.toString("ascii",0,4)==="8BPS"}function iae(t){return{width:t.readUInt32BE(18),height:t.readUInt32BE(14)}}var oae={detect:nae,calculate:iae},sae=/<svg[^>]+[^>]*>/;function aae(t){return sae.test(t)}var Vc={root:/<svg\s[^>]+>/,width:/\bwidth=(['"])([^%]+?)\1/,height:/\bheight=(['"])([^%]+?)\1/,viewbox:/\bviewBox=(['"])(.+?)\1/};function lae(t){var e=t.split(" ");return{width:parseInt(e[2],10),height:parseInt(e[3],10)}}function cae(t){var e=t.match(Vc.width),r=t.match(Vc.height),n=t.match(Vc.viewbox);return{width:e&&parseInt(e[2],10),height:r&&parseInt(r[2],10),viewbox:n&&lae(n[2])}}function uae(t){return{width:t.width,height:t.height}}function fae(t){var e=t.viewbox.width/t.viewbox.height;return t.width?{width:t.width,height:Math.floor(t.width/e)}:t.height?{width:Math.floor(t.height*e),height:t.height}:{width:t.viewbox.width,height:t.viewbox.height}}function dae(t){var e=t.toString("utf8").match(Vc.root);if(e){var r=cae(e[0]);if(r.width&&r.height)return uae(r);if(r.viewbox)return fae(r)}throw new TypeError("invalid svg")}var hae={detect:aae,calculate:dae};function pae(t){var e=t.toString("ascii",0,4)==="RIFF",r=t.toString("ascii",8,12)==="WEBP",n=t.toString("ascii",12,15)==="VP8";return e&&r&&n}function mae(t){var e=t.toString("ascii",12,16);if(t=t.slice(20,30),e==="VP8X"){var r=t[0],n=(r&192)===0,i=(r&1)===0;return n&&i?gae(t):!1}if(e==="VP8 "&&t[0]!==47)return vae(t);var o=t.toString("hex",3,6);return e==="VP8L"&&o!=="9d012a"?yae(t):!1}function gae(t){return{width:1+t.readUIntLE(4,3),height:1+t.readUIntLE(7,3)}}function yae(t){return{width:1+((t[2]&63)<<8|t[1]),height:1+((t[4]&15)<<10|t[3]<<2|(t[2]&192)>>6)}}function vae(t){return{width:t.readInt16LE(6)&16383,height:t.readInt16LE(8)&16383}}var wae={detect:pae,calculate:mae},bae={bmp:Mse,cur:$se,dds:zse,gif:Gse,ico:LI,jpg:Yse,png:rae,psd:oae,svg:hae,webp:wae},BI=bae,GE=BI,xae=function(t){var e,r;for(e in GE)if(r=GE[e].detect(t),r)return e},ey=BI,Sae=xae;function Eae(t){var e=Sae(t);if(e in ey){var r=ey[e].calculate(t);if(r!==!1)return r.type=e,r}throw new TypeError("unsupported file type: "+e)}Tw.exports=function(t){if(Buffer.isBuffer(t))return Eae(t);throw new TypeError("expecting only a buffer as input")};Tw.exports.types=Object.keys(ey);var Tae=Tw.exports;const Aae=My(Tae);function $I(t){return{alignment:Vt.START,style:{paragraph:{indent:{left:Yt(t),hanging:Yt(.18)}}}}}const Cae=Array(3).fill([Qt.DECIMAL,Qt.LOWER_LETTER,Qt.LOWER_ROMAN]).flat().map((t,e)=>Object.assign({level:e,format:t,text:`%${e+1}.`},$I((e+1)/2))),kae=Array(3).fill(["●","○","■"]).flat().map((t,e)=>Object.assign({level:e,format:Qt.BULLET,text:t},$I((e+1)/2))),_ae={numbered:Cae,bullets:kae};function Oae(t,e){return{reference:t,levels:_ae[e]}}function KE(){return Math.random().toString(36).substr(2,9)}function Rae(t){return new ase({footnotes:t.footnotes,numbering:{config:t.numbering},sections:[{properties:{type:cie.CONTINUOUS},children:t.children}]})}function qE(t){let e="";return t.forEach(r=>{r.isText&&(e+=r.text)}),e}const Kp=600;function XE(t,e,r,n){const i=r?[new Sr(r)]:[],o=[];return new TI({id:t,children:[...i,new Ane(e),...o]})}class Mae{constructor(e,r,n){this.footnotes={},this.current=[],this.maxImageWidth=Kp,this.$footnoteCounter=0,this.nodes=e,this.marks=r,this.options=n??{},this.children=[],this.numbering=[]}renderContent(e,r){e.forEach((n,i,o)=>{r&&this.addParagraphOptions(r),this.render(n,e,o)})}render(e,r,n){if(typeof r=="number")throw new Error("!");if(!this.nodes[e.type.name])throw new Error(`Token type \`${e.type.name}\` not supported by Word renderer`);this.nodes[e.type.name](this,e,r,n)}renderMarks(e,r){return r.map(n=>{var i,o;return(o=(i=this.marks)[n.type.name])===null||o===void 0?void 0:o.call(i,this,e,n)}).reduce((n,i)=>Object.assign(Object.assign({},n),i),{})}renderInline(e){let r;const n=()=>{if(!r)return;const s=new EI({link:r.link,children:this.current});this.current=[...r.stack,s],r=void 0},i=s=>{const a=s===(r==null?void 0:r.link);this.addRunOptions({style:"Hyperlink"});{if(r&&a)return;r&&!a&&n()}r={link:s,stack:this.current},this.current=[]},o=(s,a,l)=>{const c=s.marks.filter(f=>f.type.name==="link"),u=c.length>0;u?i(c[0].attrs.href):!u&&r&&n(),s.isText?this.text(s.text,this.renderMarks(s,[...s.marks])):this.render(s,e,l)};e.forEach(o),n()}renderList(e,r){if(this.currentNumbering){const{reference:n,level:i}=this.currentNumbering;this.currentNumbering={reference:n,level:i+1}}else{const n=KE();this.numbering.push(Oae(n,r)),this.currentNumbering={reference:n,level:0}}if(this.renderContent(e),this.currentNumbering.level===0)delete this.currentNumbering;else{const{reference:n,level:i}=this.currentNumbering;this.currentNumbering={reference:n,level:i-1}}}renderListItem(e){if(!this.currentNumbering)throw new Error("Trying to create a list item without a list?");this.addParagraphOptions({numbering:this.currentNumbering}),this.renderContent(e)}addParagraphOptions(e){this.nextParentParagraphOpts=Object.assign(Object.assign({},this.nextParentParagraphOpts),e)}addRunOptions(e){this.nextRunOpts=Object.assign(Object.assign({},this.nextRunOpts),e)}text(e,r){e&&(this.current.push(new Sr(Object.assign(Object.assign({text:e},this.nextRunOpts),r))),delete this.nextRunOpts)}math(e,r={inline:!0}){var n;if(r.inline||!r.numbered){this.current.push(new NE({children:[new DE(e)]}));return}const i=(n=r.id)!==null&&n!==void 0?n:KE();this.current=[new Sr(" "),new NE({children:[new DE(e)]}),new Sr(" ("),XE(i,"Equation"),new Sr(")")],this.addParagraphOptions({tabStops:[{type:mf.CENTER,position:OE.MAX/2},{type:mf.RIGHT,position:OE.MAX}]})}image(e,r=70,n="center",i){const o=this.options.getImageBuffer(e),s=Aae(o),a=s.height/s.width,l=this.maxImageWidth*(r/100);this.current.push(new Ene(Object.assign(Object.assign({},i),{data:o,transformation:Object.assign(Object.assign({},(i==null?void 0:i.transformation)||{}),{width:l,height:l*a})})));let c;switch(n){case"right":c=Vt.RIGHT;break;case"left":c=Vt.LEFT;break;default:c=Vt.CENTER}this.addParagraphOptions({alignment:c})}table(e,r={}){const{getCellOptions:n,getRowOptions:i,tableOptions:o}=r,s=this.children,a=[];e.content.forEach(c=>{const u=[];let f=!0;c.content.forEach(d=>{d.type.name!=="table_header"&&(f=!1)}),this.maxImageWidth=Kp/c.content.childCount,c.content.forEach(d=>{var h,p;this.children=[],this.renderContent(d);const m={children:this.children},y=(h=d.attrs.colspan)!==null&&h!==void 0?h:1,g=(p=d.attrs.rowspan)!==null&&p!==void 0?p:1;y>1&&(m.columnSpan=y),g>1&&(m.rowSpan=g),u.push(new Sw(Object.assign(Object.assign({},m),(n==null?void 0:n(d))||{})))}),a.push(new $ie(Object.assign(Object.assign({},(i==null?void 0:i(c))||{}),{children:u,tableHeader:f})))}),this.maxImageWidth=Kp;const l=new Pie(Object.assign(Object.assign({},o),{rows:a}));s.push(l),s.push(new ui("")),this.children=s}captionLabel(e,r,{suffix:n}={suffix:": "}){this.current.push(XE(e,r,`${r} `),new Sr(n))}footnote(e){const{current:r,nextRunOpts:n}=this;this.current=[],delete this.nextRunOpts,this.$footnoteCounter+=1,this.renderInline(e),this.footnotes[this.$footnoteCounter]={children:[new ui({children:this.current})]},this.current=r,this.nextRunOpts=n,this.current.push(new use(this.$footnoteCounter))}closeBlock(e,r){const n=new ui(Object.assign(Object.assign({children:this.current},this.nextParentParagraphOpts),r));this.current=[],delete this.nextParentParagraphOpts,this.children.push(n)}createReference(e,r,n){const i=[];r&&i.push(new Sr(r)),i.push(new kne(`REF ${e} \\h`)),n&&i.push(new Sr(n));const o=new Wne({anchor:e,children:i});this.current.push(o)}}class Iae{constructor(e,r){this.nodes=e,this.marks=r}serialize(e,r){const n=new Mae(this.nodes,this.marks,r);return n.renderContent(e),Rae(n)}}const Nae={text(t,e){var r;t.text((r=e.text)!==null&&r!==void 0?r:"")},paragraph(t,e){t.renderInline(e),t.closeBlock(e)},heading(t,e){t.renderInline(e);const r=[Io.HEADING_1,Io.HEADING_2,Io.HEADING_3,Io.HEADING_4,Io.HEADING_5,Io.HEADING_6][e.attrs.level-1];t.closeBlock(e,{heading:r})},blockquote(t,e){t.renderContent(e,{style:"IntenseQuote"})},code_block(t,e){t.renderContent(e),t.closeBlock(e)},horizontal_rule(t,e){t.closeBlock(e,{thematicBreak:!0}),t.closeBlock(e)},hard_break(t){t.addRunOptions({break:1})},ordered_list(t,e){t.renderList(e,"numbered")},bullet_list(t,e){t.renderList(e,"bullets")},list_item(t,e){t.renderListItem(e)},image(t,e){const{src:r}=e.attrs;t.image(r),t.closeBlock(e)},math(t,e){t.math(qE(e),{inline:!0})},equation(t,e){const{id:r,numbered:n}=e.attrs;t.math(qE(e),{inline:!1,numbered:n,id:r}),t.closeBlock(e)},table(t,e){t.table(e)}},Dae={em(){return{italics:!0}},strong(){return{bold:!0}},italic(){return{italics:!0}},bold(){return{bold:!0}},link(){return{}},code(){return{font:{name:"Monospace"},color:"000000",shading:{type:rre.SOLID,color:"D2D3D2",fill:"D2D3D2"}}},abbr(){return{}},subscript(){return{subScript:!0}},superscript(){return{superScript:!0}},strikethrough(){return{strike:!0}},underline(){return{underline:{}}},smallcaps(){return{smallCaps:!0}},allcaps(){return{allCaps:!0}}};exports.Action=$V;exports.AllSelection=hr;exports.BetweenHorizontalEnd=j6;exports.BetweenHorizontalStart=H6;exports.BetweenVerticalEnd=z6;exports.BetweenVerticalStart=U6;exports.Blockquote=iZ;exports.Bold=W6;exports.Bold$1=qF;exports.BookMarked=V6;exports.BubbleMenu=R6;exports.BulletList=YY;exports.CellSelection=qe;exports.CharacterCount=HZ;exports.Check=G6;exports.CheckboxItem2=OW;exports.ChevronDown=K6;exports.ChevronRight=q6;exports.ChevronsUpDown=X6;exports.Circle=Y6;exports.CircleHelp=J6;exports.Clipboard=Z6;exports.Clock3=Q6;exports.Close=jV;exports.Code=t3;exports.Code$1=BY;exports.CodeBlock=HY;exports.CodeXml=e3;exports.Color=GY;exports.Columns2=r3;exports.Columns3=n3;exports.Columns4=i3;exports.Content=pV;exports.Content2=AW;exports.Content2$1=YW;exports.Content2$2=a7;exports.Copy=o3;exports.Decoration=gt;exports.DecorationSet=Ke;exports.Description=BV;exports.Document=oQ;exports.DocxSerializer=Iae;exports.DragHandlePlugin=CY;exports.Dropcursor=WZ;exports.EditorContent=b6;exports.Eraser=s3;exports.Extension=dt;exports.FileSaver_minExports=Eee;exports.FocusClasses=VZ;exports.FontFamily=UY;exports.Frame=a3;exports.Gapcursor=QZ;exports.GripVertical=l3;exports.Group2=CW;exports.HardBreak=eQ;exports.Heading=WY;exports.Heading1=c3;exports.Heading2=u3;exports.Heading3=f3;exports.Heading4=d3;exports.Heading5=h3;exports.Heading6=p3;exports.Highlight=XY;exports.History=jZ;exports.HorizontalRule=RZ;exports.Image=dQ;exports.ImageUp=m3;exports.IndentDecrease=g3;exports.IndentIncrease=y3;exports.Italic=v3;exports.Italic$1=MY;exports.Item2=_W;exports.ItemIndicator2=IW;exports.Label2=kW;exports.Laugh=w3;exports.Link=b3;exports.Link$1=OZ;exports.List=dV;exports.List$1=E3;exports.ListItem=tQ;exports.ListOrdered=x3;exports.ListTodo=S3;exports.LoaderCircle=T3;exports.Maximize=A3;exports.Minimize=C3;exports.Minus=k3;exports.Node=ct;exports.Node$1=si;exports.NodeViewWrapper=I6;exports.OrderedList=QY;exports.Packer=PI;exports.PaintRoller=_3;exports.PanelLeft=O3;exports.PanelRight=R3;exports.Paragraph=rQ;exports.Pencil=M3;exports.Placeholder=nQ;exports.Plugin=tt;exports.PluginKey=et;exports.Plus=I3;exports.Portal=JW;exports.Portal2=TW;exports.Provider=DV;exports.Provider$1=i7;exports.Quote=N3;exports.RadioGroup2=RW;exports.RadioItem2=MW;exports.ReactNodeViewRenderer=L6;exports.ReactRenderer=iC;exports.Redo2=D3;exports.Replace=P3;exports.Root=BW;exports.Root$1=tV;exports.Root$2=aV;exports.Root$3=zV;exports.Root2=SW;exports.Root2$1=qW;exports.Root2$2=fV;exports.Root2$3=LV;exports.Root3=o7;exports.Separator2=NW;exports.Sigma=L3;exports.Slot=ro;exports.SmilePlus=F3;exports.Sparkles=B3;exports.Strike=PY;exports.Strikethrough=$3;exports.Sub2=DW;exports.SubContent2=LW;exports.SubTrigger2=PW;exports.Subscript=j3;exports.Subscript$1=sQ;exports.Suggestion=uQ;exports.Superscript=H3;exports.Superscript$1=aQ;exports.Table=W3;exports.Table$1=yee;exports.TableCell=vee;exports.TableCellsMerge=z3;exports.TableCellsSplit=U3;exports.TableHeader=wee;exports.TableRow=hQ;exports.TaskItem=tZ;exports.TaskList=rZ;exports.Text=iQ;exports.TextAlign=VY;exports.TextAlignCenterIcon=TX;exports.TextAlignJustifyIcon=CX;exports.TextAlignLeftIcon=_X;exports.TextAlignRightIcon=RX;exports.TextSelection=_e;exports.TextStyle=zY;exports.Thumb=lV;exports.Title=FV;exports.Trash=G3;exports.Trash2=V3;exports.Trigger=EW;exports.Trigger$1=XW;exports.Trigger$2=hV;exports.Trigger$3=s7;exports.Type=K3;exports.Underline=q3;exports.Underline$1=IY;exports.Undo2=X3;exports.Unlink=J3;exports.Video=Y3;exports.Viewport=PV;exports.X=Z3;exports.Z=E7;exports.clsx=QF;exports.cva=Vj;exports.debounce=aR;exports.deepEqual=Uj;exports.defaultMarks=Dae;exports.defaultNodes=Nae;exports.deleteSelection=cA;exports.differenceBy=Qq;exports.dragHandlePluginDefaultKey=QR;exports.e=See;exports.findChildren=iF;exports.findParentNode=Pf;exports.getMarkRange=If;exports.isActive=AA;exports.isList=mm;exports.mergeAttributes=Be;exports.nodeInputRule=xy;exports.proxy=M7;exports.sticky=f6;exports.throttle=vX;exports.tippy=fo;exports.truncate=SX;exports.twMerge=MB;exports.useEditor=_6;exports.useSnapshot=H7;
596
- //# sourceMappingURL=vendor-BfS5bQGj.cjs.map